src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- """ Created on Mon Nov 10 11:43:10 2014 @author: htelg """ import datetime import warnings from io import StringIO as io import numpy as np import pandas as pd import pylab as plt from scipy.interpolate import UnivariateSpline from atmPy.general import timeseries from atmPy.aerosols.size_dis...
import time import datetime import random from werkzeug.security import gen_salt from flask.ext.testing import TestCase from adsws.modules.oauth2server.models import OAuthClient, Scope, OAuthToken from adsws.tests.test_accounts import AccountsSetup from adsws.core.users import User from adsws.core import db, user_mani...
#!/usr/bin/python # -*- coding: utf-8 -*- import socket import time import binascii import os import sys from libmich.formats import * import gsm_um import smarter_fuzzer_function_def as fuzzer import itertools from random import randint from math import factorial import logging from pythonjsonlogger import jsonlogger...
import os from datetime import datetime from uuid import uuid4 from flask import current_app, safe_join from flask_login import current_user from sqlalchemy import func, orm from sqlalchemy.dialects.postgresql import UUID, JSONB from sqlalchemy_utils import aggregated, generic_repr from ..auth import current_user_is_...
from flask_wtf import FlaskForm from wtforms import ( StringField, PasswordField, BooleanField, SubmitField, ValidationError, ) from wtforms.validators import ( InputRequired, Length, Email, Regexp, EqualTo, ) from .models import User class LoginForm(FlaskForm): email = St...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 3.0.0.11832 on 2017-03-22. # 2017, SMART Health IT. import io import json import os import unittest from . import relatedperson from .fhirdate import FHIRDate class RelatedPersonTests(unittest.TestCase): def instantiate_from(self, filename...
import unittest from cubes.browser import * from cubes.errors import * from .common import CubesTestCaseBase class CutsTestCase(CubesTestCaseBase): def setUp(self): super(CutsTestCase, self).setUp() self.workspace = self.create_workspace(model="browser_test.json") self.cube = self.works...
#! /usr/bin/env python3 from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtMultimedia import * from PyQt5.QtMultimediaWidgets import * from math import * from hashlib import sha256 import sys, os import traceback _args = sys.argv class Stuff : width = 800 height = 6...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # The Hazard Library # Copyright (C) 2013-2016 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either ...
import unittest from ctypes import * import _ctypes_test class Callbacks(unittest.TestCase): functype = CFUNCTYPE ## def tearDown(self): ## import gc ## gc.collect() def callback(self, *args): self.got_args = args return args[-1] def check_type(self, typ, ...
from collections import OrderedDict from copy import deepcopy from numbers import Real, Integral import warnings from xml.etree import ElementTree as ET import numpy as np import openmc import openmc.data import openmc.checkvalue as cv from openmc.clean_xml import clean_xml_indentation from .mixin import IDManagerMix...
#-*- coding: utf-8 -*- ########################################################################### ## ## ## Copyrights Etienne Chové <chove@crans.org> 2009 ## ## ...
import os from setuptools import setup ########## autover ########## def get_setup_version(reponame): """Use autover to get up to date version.""" # importing self into setup.py is unorthodox, but param has no # required dependencies outside of python from param.version import Version return Ver...
# DFF -- An Open Source Digital Forensics Framework # Copyright (C) 2009-2010 ArxSys # This program is free software, distributed under the terms of # the GNU General Public License Version 2. See the LICENSE file # at the top of the source tree. # # See http://www.digital-forensic.org for more information about this...
# -*- coding: utf-8 -*- ''' Created on 15 Feb 2014 @author: Antonio ''' import sys, getopt, shelve, os import preprocessing_functions as pre import classifier_functions as clf import classifier_evaluation as ce def main(args): if args[0].has_key('-a'): annotation = args[0]['-a'] else: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import copy import shutil import os.path import datetime import subprocess from configparser import ConfigParser from . import options class Checkout(object): def __init__(self, branch, commit, name): self.branch, self.commit, self.name ...
from couchpotato.core.helpers.variable import tryInt from couchpotato.core.logger import CPLog from couchpotato.core.media._base.providers.torrent.base import TorrentProvider log = CPLog(__name__) class Base(TorrentProvider): urls = { 'test': 'http://www.td.af/', 'login': 'http://www.td.af/torre...
from django.contrib import admin import nested_admin from polymorphic.admin import PolymorphicChildModelAdmin, PolymorphicParentModelAdmin from . import forms from . import models class ZoneInline(nested_admin.NestedTabularInline): model = models.Zone extra = 1 class AWSRegionInline(nested_admin.NestedSt...
import os import subprocess import sys import tempfile import time from fabric.api import local, env, run, sudo from config import Config # environment variable prefix prefix = Config.environment_variable_prefix() # disable logging (as otherwise we would have to use the production setting for the log file location)...
"""This processor reshapes the data to match the fiscal schema.""" from datapackage_pipelines.wrapper import ingest from datapackage_pipelines.wrapper import spew from common.utilities import get_fiscal_field_names import logging def process_row(row, fiscal_fields): """Add and remove appropriate columns. """ ...
import url_file_read as provided import math import random import project4 import matplotlib.pyplot as plt protein_human = provided.read_protein(provided.HUMAN_EYELESS_URL) protein_fly = provided.read_protein(provided.FRUITFLY_EYELESS_URL) scoring_matrix = provided.read_scoring_matrix(provided.PAM50_URL) """ caluclat...
from django.template.loader import render_to_string from messaging.models import CharacterMessage, MessageRecipient, \ MessageRecipientGroup def create_message( template, world, title, template_context=None, sender=None, link=None ): content = render_to_string( '{}'.format(template), ...
__author__ = 'explorentis' from random import choice, randint from village import Village from dice import incremental_count from global_vars import maxValueOfParameters from translate import t def attack_weak(village): army_count = 0 print t['weak_enemy.attack.village'] for habitant in village.Habitants: ...
#!/usr/bin/env python import collections import contextlib import sys import wave import webrtcvad def read_wave(path): with contextlib.closing(wave.open(path, 'rb')) as wf: num_channels = wf.getnchannels() assert num_channels == 1 sample_width = wf.getsampwidth() assert sample_wi...
""" """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import datetime from dateutil.parser import parse as date_parse from django.conf import settings from django.core.management.base import BaseCommand from django.core.serializers.json import Dja...
''' Created on 08/05/2013 @author: victor ''' import os import prody import urllib2 def get_elements (pdb): pdb_elements = pdb.getElements() names = pdb.getNames() elements = [] for i, element in enumerate(pdb_elements): if len(element) == 0: elements.append(names[i][0]) ...
"""Unit tests for the pymt.framwork.bmi_ugrid module.""" import numpy as np import xarray as xr from pymt.framework.bmi_ugrid import ( Points, Rectilinear, Scalar, StructuredQuadrilateral, UniformRectilinear, Unstructured, Vector, ) grid_id = 0 class BmiScalar: def grid_type(self, gr...
import math class Apportion: populations = {} seats = {} def __init__(self): f = open('../data/2010.csv', 'r') for line in f: state, pop = [s.strip() for s in line.split(',')] self.seats[state] = 1 self.populations[state] = int(pop.strip()) @classmethod def find_highest_priority(cls): highest = ...
#!/usr/bin/env python """ Python wrapper to time the CFFI wrapper for computing the nth fibonacci number in a non-recursive fashion and compare it to the pure Python implementation. """ import cffi import fib_python if __name__ == '__main__': import sys import timeit n = 20 try: n = int(sys.ar...
# -*- coding: utf-8 -*- # # This tool helps you rebase your package to the latest version # Copyright (C) 2013-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version...
__author__ = 'SongJun-Dell' import logging import numpy as np import theano import theano.tensor as T from collections import OrderedDict class BasicModel(object): def __init__(self, state): self.state = state self.floatX = theano.config.floatX self.layers = list() self.params = lis...
#!/usr/bin/env python ############################################################################ # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The A...
# -*- coding: utf-8 -*- # Copyright (c) 2011, Diego Souza # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from unittest.mock import patch from datetime import datetime, date from dateutil.relativedelta import relativedelta from odoo import fields from odoo.tests.common import TransactionCase, new_test_user from odoo.addons....
from django.conf.urls import patterns, include, url from rest_framework.urlpatterns import format_suffix_patterns from biz.instance import views as instance_view from biz.image import views as image_view from biz.network import views as network_view from biz.lbaas import views as lb_view from biz.volume import views...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ################################################################################################################## #################################################### PRE-DEFINED IMPORTS #################################################### ################################...
from wiki.conf import settings ############################### # TARGET PERMISSION HANDLING # ############################### # # All functions are: # can_something(target, user) # => True/False # # All functions can be replaced by pointing their relevant # settings variable in wiki.conf.settings to a callable(...
# -*- coding: utf-8 -*- # Copyright 2017 IBM RESEARCH. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
#!/usr/bin/env python3 """ mkFFscale.py simply.... emissions given in eg moles/day or kg/hr, since we don't need to allow for grid area. UNFINISHED!! """ import argparse import numpy as np import netCDF4 as cdf import os import sys #------------------ arguments ----------------------------------------------...
# -*- coding: utf-8 -*- # # This file is part of Harvesting Kit. # Copyright (C) 2014, 2015 CERN. # # Harvesting Kit is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at yo...
# # Copyright 2014 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
from __future__ import unicode_literals __author__ = 'lexxodus' from app import db from app.api import api from app.models import Task as TaskModel from flask import abort, request from flask.ext.restful import Resource def get_task_json(task, public=False): data = {} data["id"] = task.id data["name"] = ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
""" Formal Python Analyses of the Data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python 3.5 """ import pandas as pd from tqdm import tqdm from pprint import pprint from funding_database_tools import MAIN_FOLDER from easymoney.easy_pandas import pandas_print_full # ---------------------------------------------...
# coding: utf-8 # ----------------------------------------------------------------------------- # Karajlug.org # Copyright (C) 2010-2012 Karajlug community # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # th...
""" Django settings for Contest project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
""" ================================================================= Test with permutations the significance of a classification score ================================================================= In order to test if a classification score is significative a technique in repeating the classification procedure aft...
#!/usr/bin/env python import sys from os.path import join, dirname sys.path.append(join(dirname(__file__), 'src')) from ez_setup import use_setuptools use_setuptools() from setuptools import setup execfile(join(dirname(__file__), 'src', 'AppiumLibrary', 'version.py')) setup(name = 'robotframework-mobilelibr...
# -*- coding: utf-8 -*- """ Created on Sun Aug 29 00:09:26 2010 @author: Charles Law """ import math def fft(fin, inverse): nfft = len(fin) twiddles, factors = fft_alloc(nfft, inverse) fout = [] for i in xrange(nfft): fout.append((0, 0)) fout_ind_start = 0 ...
import csv import configparser import logging from builtins import range from carto.auth import APIKeyAuthClient from carto.sql import SQLClient from carto.sql import BatchSQLClient logger = logging.getLogger('carto-etl') config = configparser.RawConfigParser() config.read("etl.conf") CARTO_BASE_URL = config.get('...
# idea: order by size and take largest elements until the sum becomes > sum of remaining class Solution: def minSubsequence(self, nums: List[int]) -> List[int]: nums = sorted(nums, reverse=True) total_sum = sum(nums) running_sum = 0 subseq_len = 0 # how many biggest members we'll nee...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#! /usr/bin/python import sys import os import os.path import subprocess import re line_re = re.compile(r'^(warning|error) (\d+) in line (\d+) of "([^"]*)":\s*(.*)$') def fix_fn(root_dir, fn): # If there are path separators in the filename, assume the path is valid if fn.find(os.sep) != -1: return fn if os.pa...
import datetime from functools import wraps from logging import getLogger LOG = getLogger(__name__) class RecordDetail(object): def __init__(self, name=None): self.name = name self.status = None self.start_time = datetime.datetime.now() self.stop_time = None self.number_o...
# -*- coding: utf-8 -*- """The application's model objects""" from zope.sqlalchemy import ZopeTransactionExtension from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base # Global session manager: DBSession() returns the Thread-local # session object appropriate...
import datetime from sqlalchemy import create_engine, exists from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, DateTime, Float, Boolean,\ ForeignKey from sqlalchemy.orm import relationship def _convert_bool(s): ''' Function to be just used here!! ...
# # # Most stuff has been disabled. # See: INSTALLED_APPS, MIDDLEWARE_CLASSES, DATABASES # # # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) STATIC_URL = '/yatable/' # Quick-start development settings - unsuitab...
import numpy as np from lmfit import minimize, Parameters, Parameter from astropy import units as u from .. import spectrum from functions import * class Fitter(): """ A class for multi-component fitting to spectroscopic data of ices. This is the heart of Omnifit, which receives spectra from the spectrum modu...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource f...
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # ...
from tests.Dispatcher.DataCreator import CreateDeviceData import json import unittest from bin.Devices.Containers.ContainersDevice import ContainersDevice from bin.Devices.Containers.ContainersManager import EventlessContainersManager, NullContainersManager, \ ContainersManager from bin.Devices.Containers.Container...
# -*- coding: utf-8 -*- # # GeoGig documentation build configuration file, created by # sphinx-quickstart on Tue Oct 28 10:01:09 2008. # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
import numpy as np from IPython.display import clear_output from ipywidgets import * from step import StepExample from pjdiagram import * def merge(left, right): i = j = 0 result = [] while i < len(left) or j < len(right): if i >= len(left): result.append(right[j]) j += 1...
# Copyright 2014-2016 Tecnativa - Pedro M. Baeza # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3 from odoo import api, fields, models class ImportInvoiceLine(models.TransientModel): _name = "import.invoice.line.wizard" _description = "Import supplier invoice line" supplier = fields.Many2one( ...
# pylint: disable=protected-access from __future__ import absolute_import import os import unittest from fnmatch import fnmatch from collections import OrderedDict import py from rotest.common import core_log from rotest.core.case import TestCase from rotest.core.flow import TestFlow from rotest.common.config import ...
from core.himesis import Himesis import uuid class HEPackage(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule EPackage. """ # Flag this instance as compiled now self.is_compiled = True super(HEPackage, sel...
import ARM from CairisHTTPError import ARMHTTPError, MalformedJSONHTTPError, ObjectNotFoundHTTPError, MissingParameterHTTPError from Environment import Environment from EnvironmentParameters import EnvironmentParameters from data.CairisDAO import CairisDAO from tools.JsonConverter import json_serialize, json_deserializ...
import os import codecs import re import jieba import numpy as np from tqdm import tqdm from tensorflow.contrib import learn from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import LabelEncoder class TextData(object): def __init__(self,args): self.args = args corpus_dir =...
# player.py # # Copyright (C) 2014-2016 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # Manages playing of videos import sys import os from kano.utils import is_installed, run_bg, get_volume, percent_to_millibel from kano.logging import logger from .youtube import get_video_file...
# =============================================================================== # Copyright 2011 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...
""" Created on 22. apr. 2015 @author: pab References ---------- A METHODOLOGY FOR ROBUST OPTIMIZATION OF LOW-THRUST TRAJECTORIES IN MULTI-BODY ENVIRONMENTS Gregory Lantoine (2010) Phd thesis, Georgia Institute of Technology USING MULTICOMPLEX VARIABLES FOR AUTOMATIC COMPUTATION OF HIGH-ORDER DERIVATIVES Gregory Lant...
from django import forms from django.core.exceptions import ValidationError from django.forms.models import inlineformset_factory import inspect import os import re import sys from simulation.models import ProbabilityDistribution from simulation.models import DiscreteProbabilityDistribution from simulation.models impo...
'''PipelineWindows - Tasks for window based read distribution analysis ====================================================================== Requirements: * bedtools >= 2.21.0 * picardtools >= 1.106 * samtools >= 1.1 * MEDIPS >= 1.15.0 Reference --------- ''' import os import re import collections import pandas i...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """ All o...
import logging import os import shutil import sys import subprocess import urllib.request def ensure_path(path): if not os.path.exists(path): os.mkdir(path) def confirm_overwrite(dir): if os.path.exists(dir): answer = input( 'The directory {} exists. Overwrite it? (Y/n): '.format(...
from typing import Generic, Iterable, List, TypeVar from gevent.event import Event from gevent.queue import Queue T = TypeVar("T") class NotifyingQueue(Event, Generic[T]): """This is not the same as a JoinableQueue. Here, instead of waiting for all the work to be processed, the wait is for work to be availa...
import unittest from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_condit...
"""Define an app for processing requests to LaTeX up tweets.""" import base64 import os import flask import flask_socketio import eventlet import redis import tweet_cereal.tasks as tasks import tweet_cereal.tweets as tweets JOB_RESULT_POLL_INTERVAL = 1 app = flask.Flask(__name__) socketio = flask_socketio.SocketIO...
# coding: utf-8 """ Talon.One API The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. #...
"""Loads and/or plots 2D, topologlically structured data on quadrilaterals using matplotlib. """ import sys,os import numpy as np import h5py import mesh import colors def fullname(varname): fullname = varname if not '.cell.' in fullname: fullname = fullname+'.cell.0' return fullname def transec...
# -*- coding: utf-8 -*- """ tests for multi channels and gateway Groups """ import gc from time import sleep import execnet import py import pytest from execnet import XSpec from execnet.gateway_base import Channel from execnet.multi import Group from execnet.multi import safe_terminate class TestMultiChannelAnd...
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2016) # # This file is part of GWpy. # # GWpy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ################################################## # AUTHOR : Loïc Banet # # SUMMARY : Contain enum class that define color # ################################################## import math from enum import Enum from itertools import count cla...
import json import colorlog import logging import logging.handlers from elloghandler.handler import ElLogHandler from socr_streamhandler.handler import SoCR_StreamHandler from socr_filehandler.handler import SoCR_FileHandler from datetime import datetime, date, time def logger_conf(loglevel,index=None): #Formatte...
# This file is part of ArcJail. # # ArcJail is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ArcJail is distributed in the hope that...
import re from datetime import datetime import pytz from django import forms from django.conf import settings from django.test import TestCase import vendor.timezones.forms import vendor.timezones.timezones_tests.models as test_models from vendor.timezones.utilities import localtime_for_timezone, adjust_datetime_t...
# -*- coding: utf-8 -*- from path import Path # Load shared config file execfile(Path('../../_shared/conf.py').abspath()) # -- General configuration ----------------------------------------------------- project = u'Office Native WOPI Integration Documentation' # Configure sphinx.ext.intersphinx # noinspection PyUn...
from pytest_benchmark.utils import time_unit try: from pygal.graph.box import Box from pygal.graph.box import is_list_like from pygal.style import DefaultStyle except ImportError as exc: raise ImportError(exc.args, "Please install pygal and pygaljs or pytest-benchmark[histogram]") class Plot(Box): ...
from sympy.core.sympify import _sympify from sympy.core import S, Basic from sympy.matrices.expressions.matexpr import ShapeError from sympy.matrices.expressions.matpow import MatPow class Inverse(MatPow): """ The multiplicative inverse of a matrix expression This is a symbolic object that simply stores...
import json import logging from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import IndexGroupCommand from pip._internal.cli.status_codes import SUCCESS from pip._internal.exceptions import CommandError from pip._internal.index.collector import LinkCollector from pip._internal.index.package_f...
# # Copyright (C) 2018 by YOUR NAME HERE # # This file is part of RoboComp # # RoboComp is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any...
""" Content library unit tests that require the CMS runtime. """ import ddt import six from django.test.utils import override_settings from mock import Mock, patch from opaque_keys.edx.locator import CourseKey, LibraryLocator from six.moves import range from cms.djangoapps.contentstore.tests.utils import AjaxEnabled...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
""" Flow Hierarchy. """ import networkx as nx __all__ = ["flow_hierarchy"] def flow_hierarchy(G, weight=None): """Returns the flow hierarchy of a directed network. Flow hierarchy is defined as the fraction of edges not participating in cycles in a directed graph [1]_. Parameters ---------- ...
# -*- coding: utf-8 -*- """A/B Testing for Django django-lean allows you to perform split-test experiments on your users. In brief, this involves exposing 50% of your users to one implementation and 50% to another, then comparing the performance of these two groups with regards to certain metrics. """ from distutil...
import numpy as np import numpy.linalg as nl import numpy.random as nr import rv_model as rv import scipy.linalg as sl import scipy.stats as ss def generate_covariance(ts, sigma, tau): r"""Generates a covariance matrix according to an squared-exponential autocovariance .. math:: \left\lang...
from kivy.app import App from kivy.uix.widget import Widget from kivy.properties import NumericProperty, ReferenceListProperty, ObjectProperty, BooleanProperty, OptionProperty from kivy.vector import Vector from kivy.clock import Clock from kivy.core.window import Window from kivy.graphics import Color, Ellipse, Rectan...
import io import shutil from unittest import mock import pytest from mitmproxy import exceptions from mitmproxy.addons import dumper from mitmproxy.http import Headers from mitmproxy.test import taddons from mitmproxy.test import tflow from mitmproxy.test import tutils def test_configure(): d = dumper.Dumper() ...
# Copyright (c) 2016 Lee Cannon # Licensed under the MIT License, see included LICENSE File from unittest import TestCase from trending import count from trending import interaction def _create_test_interactions(): i = interaction.Interaction('12/10/2016 03:15:55', 'ENTERPRISE ENTERPRISE USER DIRECTORY', 'DIIR-G...
# -*- coding: utf-8 -*- """ .. module:: pytfa :platform: Unix, Windows :synopsis: Thermodynamics-based Flux Analysis .. moduleauthor:: pyTFA team Make the model serializable """ from collections import OrderedDict, defaultdict import cobra.io.dict as cbd from cobra.exceptions import SolverNotFound ...