code
stringlengths
1
199k
""" .. py:currentmodule:: __init__ .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> """ import os.path import configparser import logging import fnmatch __author__ = """Hendrix Demers""" __email__ = 'hendrix.demers@mail.mcgill.ca' __version__ = '0.1.4' def get_current_module_path(module_path, relative_p...
import os import errno import numpy import math from config import config as cfg systems = ['cassandra', 'flume', 'hbase', 'hdfs', 'mapreduce', 'zookeeper'] cwd = os.getcwd() def ensure_path_exists(path): try: os.makedirs(path) except OSError as exception: if exception.errno != errno.EEXIST: ...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1beta1IPBlock(objec...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
import uuid import six import wsme from wsme.rest import json as wjson from wsme import types as wtypes from solum.api.controllers.v1.datamodel import types as api_types class Requirement(wtypes.Base): requirement_type = wtypes.text "Type of requirement." fulfillment = wtypes.text "The ID of the service...
from testtools.matchers import Equals from testtools.matchers import Is from testtools.matchers import Not import uuid from unittest.mock import ANY from unittest.mock import MagicMock from unittest.mock import patch from novaclient.client import Client from novaclient.v2.flavors import Flavor from novaclient.v2.flavor...
import pytest from hades_logs import RadiusLogEntry class TestEffectiveEquality: @pytest.fixture(scope='class') def timestamp(self): return 1501623826.391414 @pytest.fixture(scope='class') def entry(self, timestamp): return RadiusLogEntry( '00:de:ad:be:ef:00', 'Ac...
import os from JumpScale import j class OsisPyApps: def __init__(self, appName): self.appName = appName self.components = [('passwd', ''), ('login', self.appName), ('database', self.appName),('ip', '127.0.0.1')] def generate_cfg(self): iniFile = j.system.fs.joinPa...
import os from mock import Mock from mock import ANY from amen.audio import Audio from queue_functions import do_work from queue_functions import make_audio from server import handle_post from uploaders.s3 import get_url class MockAnalysis(): def to_json(self): return True def faux_analysis(filepath): r...
''' Utility method that does a binarySearch on the sorted array a to return the index of the element i in the array. Searches the array a in the range (start,end) - both inclusive Time Complexity : log(N) Returns the Index of the element if found Returns index of immdiately greater element other...
import unittest, os import pandas as pd import pandas.util.testing as pdt import numpy as np from kvsstcp.kvsclient import KVSClient from subprocess import CalledProcessError from .. import bbsr_python from .. import utils my_dir = os.path.dirname(__file__) def should_skip(environment_flags=[("TRAVIS", "true"), ("SKIP_...
from peyotl.phylesystem.git_workflows import acquire_lock_raise, \ commit_and_try_merge2master, \ delete_study, \ GitWorkflowError, \ merge_...
""" Orange Canvas Configuration """ import os import sys import logging import pickle as pickle import itertools import pkg_resources from AnyQt.QtGui import ( QPainter, QFont, QFontMetrics, QColor, QPixmap, QIcon ) from AnyQt.QtCore import Qt, QCoreApplication, QPoint, QRect, QSettings from .utils.settings import ...
from django.db import models from cachetask.query import CacheQuerySet class CacheManager(models.Manager): """ Caches only selected queries """ def cached(self): return CacheQuerySet(model=self.model, using=self._db) class GreedyCacheManager(CacheManager): """ Caches every query """ ...
import os, re, shutil files = [] dir_with_new_files = "newitems/" for file in os.listdir(dir_with_new_files): if file.startswith("collectibles_"): files.append(file) for file in files: m = re.match("collectibles_(\d\d\d|\d\d\dx)_.*\.png", file) newname = "collectibles_" + m.group(1) + ".png" shu...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fsforms', '0057_auto_20180426_1451'), ] operations = [ migrations.AddField( model_name='finstance', name='is_deleted', ...
import bee from bee import * import dragonfly from dragonfly.commandhive import commandhive, commandapp from dragonfly.sys import exitactuator from dragonfly.io import display, commandsensor from dragonfly.logic import filter from dragonfly.op.pull import equal2 from dragonfly.std import variable, transistor from drago...
""" K-Neighbors for Photometric Redshifts ------------------------------------- Estimate redshifts from the colors of sdss galaxies and quasars. This uses colors from a sample of 50,000 objects with SDSS photometry and ugriz magnitudes. The example shows how far one can get with an extremely simple machine learning ap...
""" flow.py Created by Thomas Mangin on 2010-01-14. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack from exabgp.protocol.ip import IP from exabgp.protocol.ip import NoIP from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from ...
""" OHSU - ROI utility functions. TODO - move this to ohsu-qipipe. """ import os import re import glob import qiutil from ..helpers.logging import logger PARAM_REGEX = re.compile('(?P<key>\w+)\s*\:\s*(?P<value>\w+)') """ The regex to parse a parameter file. """ class LesionROI(object): """ Aggregate with attrib...
import json from django.db.utils import ProgrammingError from django.utils import translation from django.conf import settings from django.db.models.signals import post_delete, post_save from xendor.models import Page try: NEED_REGENERATE_MODELS = settings.NEED_REGENERATE_MODELS except AttributeError: NEED_REGE...
import unittest from test.markdown_builder import MarkdownBuilder from test.test_plantuml import PlantumlTest class PlantumlTest_fenced(PlantumlTest): def setUp(self): super(PlantumlTest_fenced, self).setUp() # Setup testing with backticks fenced block delimiter self.text_builder = MarkdownB...
world=[ ['R','G','G','R','R'], ['R','R','G','R','R'], ['R','R','G','R','R'], ['R','R','R','R','R'], ] col = len(world[0]) row = len(world) pinit = 1./(row*col) p = [[pinit for x in range(col)] for y in range(row)] pHit = 0.7 pMiss = 1- pHit p_move = 0.8 Measurement = ['G','G','G','G','G'] motion = [[0,...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p from OpenGL.GL import glget EXTENSION_NAME = 'GL_EXT_texture_compression_s3tc' _p.unpack_constants( """GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 GL...
import numpy as np import matplotlib as plt import mayavi.mlab as mv import gto MAX_HF_ITERS = 10 class Atom: def __init__(this, position, charge): this.position = position this.charge = charge def make_initial_guess(atoms): return [] def build_fock_matrix(atoms, current_wavefunctions): retu...
import logging import requests import urlparse import shutil import tempfile import os import re import lxml from cgi import parse_header from collections import defaultdict from django.conf import settings from allmychanges.utils import ( get_text_from_response, is_http_url, html_document_fromstring, s...
import sys import os extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'Tank Maven' copyright = u'2014, Greg Aker' version = '0.0.1' release = '0.0.1' exclude_patterns = ['_build'] pygments_style = 'sphinx' on_rtd...
import rg class Robot: def act(self, game): # if we're in the center, stay put if self.location == rg.CENTER_POINT: return ['guard'] # if there are enemies around, attack them for loc, bot in game.robots.iteritems(): if bot.player_id != self.player_id: ...
from django import template import random register = template.Library() greetings = [ 'Nooooooooooooooooooooooooooooo! {{ name }}', 'We have the dead sommelier to prove it, {{ name }}', 'Ignore the antlers {{ name }}', 'What ho, {{ name }}?', 'Tally ho, {{ name}}!', 'Pip pip, {{ name }}!', ...
from __future__ import unicode_literals from .base import Client from .defaults import create_client, list_clients
def extractPickupthisnoveltranslationsCom(item): ''' Parser for 'pickupthisnoveltranslations.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Yotohime', 'Yotogi no Kuni no Gekkouhime', ...
import abutil import os.path def check_errors(source, errors): def error_set(e): return set(tuple(sorted(x.items())) for x in e) expected = error_set(errors) try: abutil.run_autobind(source, capture_errors=True) except abutil.BindingGenerationFailedError as exc: actual = error_set(exc.args[0]) else: actual...
from unittest import TestCase from datetime import timedelta import os from ebu_tt_live.documents.converters import ebutt3_to_ebuttd from ebu_tt_live.documents.ebutt3 import EBUTT3Document from ebu_tt_live.clocks.local import LocalMachineClock from ebu_tt_live.clocks.media import MediaClock from ebu_tt_live.bindings im...
import json from django.shortcuts import render from django.http import Http404, HttpResponse from django.utils.html import escape import deltalife def index(request): obcine = deltalife.get_obcine() sklopi = [] for key, val in deltalife.SKLOPI.items(): sklopi.append({'id': key, 'ime': val['ime']}) ...
from SloppyCell.ReactionNetworks import * net = Network('example') net.add_compartment('trivial') net.add_species('A', 'trivial', initial_conc=1) net.add_species('B', 'trivial', initial_conc=0) net.add_species('C', 'trivial', initial_conc=0) net.add_species('B_scaled', 'trivial') net.add_assignment_rule('B_scaled', 'B*...
from codecs import open # To use a consistent encoding from os import path from setuptools import setup HERE = path.dirname(path.abspath(__file__)) ABOUT = {} with open(path.join(HERE, 'datadog_checks', 'snmpwalk', '__about__.py')) as f: exec(f.read(), ABOUT) with open(path.join(HERE, 'README.md'), encoding='utf-8...
from __future__ import absolute_import from django.db import connection from sentry.utils.compat.mock import patch import responses from sentry.mediators.sentry_apps import Destroyer from sentry.models import ( AuditLogEntry, AuditLogEntryEvent, ApiApplication, User, SentryApp, SentryAppInstalla...
class VersionedFile: def __init__(self, base, suffix, digits=2): self._base = base self._suffix = suffix self._version = 0 self._format = "%s.%%0%dd.%s" % (base, digits, suffix) def new(self): self._version += 1 return self.get() def get(self): if self...
from __future__ import absolute_import import logging import six from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ from sentry import features from sentry.integrations import ( IntegrationInstallation, IntegrationFeatures, IntegrationProvider, IntegrationMet...
"""Fichier contenant les convertisseurs de la classe BaseObj.""" from bases.collections.liste import Liste from bases.collections.dictionnaire import Dictionnaire, DictionnaireOrdonne class Convertisseur: """Classe pour envelopper les convertisseurs.""" def depuis_version_0(objet, classe): objet.set_ver...
from django.conf.urls.defaults import patterns, url urlpatterns = patterns( '', url(r'^upload-events/$', 'event_uploader.views.import_events_spreadsheet', name='import_events'), )
import pytest @pytest.fixture(scope="session", autouse=True) def set_up_overall(request): pass @pytest.fixture(scope="function", autouse=True) def set_up(): pass def tear_down(): pass
from __future__ import unicode_literals, division, print_function import sys import os import pwd import time import subprocess try: import ujson as json except ImportError: import json import pyinotify MASK = pyinotify.IN_CLOSE_WRITE def demote(username): pw = pwd.getpwnam(username) uid, gid = pw.pw_ui...
import pytest import sqlalchemy as sa from sqlalchemy_utils import EmailType @pytest.fixture def User(Base): class User(Base): __tablename__ = 'user' id = sa.Column(sa.Integer, primary_key=True) email = sa.Column(EmailType) def __repr__(self): return 'Building(%r)' % self...
""" wakatime.projects.mercurial ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Information about the mercurial project for a given file. :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os import sys from .base import BaseProject from ..compat import u, open log...
import json import unittest import httpretty import requests from morfeu.tsuru.client import TsuruClient, TsuruClientUrls class MorfeuTsuruClientTestCase(unittest.TestCase): def setUp(self): self.tsuru_client = TsuruClient() def tearDown(self): self.tsuru_client = None def raiseTimeout(reque...
""" decoding.py Created by Thomas Mangin on 2009-08-25. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from exabgp.configuration.ancient import Configuration from exabgp.configuration.ancient import formated from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.proto...
import base64 import hashlib import logging import os import re from uuid import uuid4 from django.conf import settings from watson import search as watson from auditlog.registry import auditlog from django.contrib import admin from django.contrib.auth import get_user_model from django.urls import reverse from django.c...
""" ===================== Metabolic Null Models ===================== :Authors: Moritz Emanuel Beber :Date: 2011-07-01 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: nullmodels.py """ import logging import itertools from operator import itemgetter from ..errors im...
__version__ = '''0.3.23''' __sub_version__ = '''20070121195422''' __copyright__ = '''(c) Alex A. Naanou 2003-2004''' __doc__ = '''\ This module defines the event framework. Basic concepts: Event: An object that represents a hook-point (bind-point), and controls the execution of its hooks/handlers. When an even...
import urllib2 import urllib import urlparse import base64 import sys import json config = {'Global': { 'update_dns' : 'no' }, 'ChipmunkAPIServer': { 'username' : 'user1', 'password' : 'password1', 'method' : 'set', 'endpoint' : 'http://localho...
"""Reader for .xvg files.""" import numpy as np import itertools as it class XvgError(Exception): pass class Reader(object): def __init__(self, filename, **kwargs): if isinstance(filename, basestring): filename = [filename] else: filename = filename self.filename ...
import os class pathObject: """Contains a path as an array of parts with some methods for analysing them""" def __init__(self, pathstring): """Take a raw pathstring, normalise it and split it up into an array of parts""" path = pathstring norm_path = os.path.abspath(pathstring) p...
""" Created on Wed Dec 16 18:01:24 2015 @author: Avinash """ import numpy as np from numpy import * import numpy from math import * import ev_charge_schedule as ev import time from numba.decorators import autojit func1=ev.dynamic func=autojit(func1) mode=0 runs=0 maxiter=500 F=0.8 # Mutation Factor between 0 to 2 CR=0....
import click import subprocess @click.command() def loaddata_set(): users_fixtures_path = "users/fixtures/users_data.yaml" teams_fixtures_path = "teams/fixtures/teams_data.yaml" projects_fixtures_path = "projects/fixtures/projects_data.yaml" properties_fixtures_path = "properties/fixtures/properties_dat...
import sys import os.path infile = sys.argv[1] outfile = sys.argv[2] if os.path.exists(infile)==True: with open(outfile,"w") as outfileh, open(infile,"r") as infileh: lines = infileh.readlines() for line in lines: if "noname." not in line: outfileh.write(line.replace("\t....
from django.utils import six from django import template from django.template import TemplateSyntaxError from ella.core.models import Category from ella.positions.models import Position register = template.Library() def _get_category_from_pars_var(template_var, context): ''' get category from template variable ...
"""Example of band structure and group velocity calculation by NaCl.""" from typing import List import numpy as np import phonopy def _append_band(bands, q_start, q_end): band = [] nq = 51 for i in range(nq): band.append( np.array(q_start) + (np.array(q_end) - np.array(q_start)) / (nq - ...
"""Bootstrap for running a Django app under Google App Engine. The site-specific code is all in other files: settings.py, urls.py, models.py, views.py. And in fact, only 'settings' is referenced here directly -- everything else is controlled from there. """ import os import sys import logging import __builtin__ import...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "BoxCox", sigma = 0.0, exog_count = 20, ar_order = 0);
""" setup.py Created by Thomas Mangin on 2013-07-13. Copyright (c) 2013-2013 Exa Networks. All rights reserved. """ import time import socket import select import platform from struct import pack,calcsize from exabgp.util.errstr import errstr from exabgp.protocol.family import AFI from exabgp.protocol.ip import IP from...
from django.db import models from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from laconicurls.obfuscation import base27_encode, base27_decode from django.core.urlresolvers import reverse from django.db.models.signals import pre_save class Shortcut(models.Model)...
""" ========================== Display images for MEG ========================== """ import numpy as np from expyfun import visual, ExperimentController from expyfun.io import write_hdf5 import time from PIL import Image import os from os import path as op import glob testing = False test_trig = [15] if testing: bg...
import difflib import distutils.dir_util import filecmp import os import re import shutil import subprocess import sys import tempfile def ZapTimestamp(filename): contents = open(filename, 'rb').read() # midl.exe writes timestamp 2147483647 (2^31 - 1) as creation date into its # outputs, but using the local timez...
from django.conf.urls import patterns, include, url from publication_backbone.views import PublicationTemplateView urlpatterns = patterns('', url(r'^terms-of-service/$', PublicationTemplateView.as_view(template_name="publication_backbone/terms_of_service.html"), name='terms_of_service'), url(r'^...
""" sentry.nodestore.riak.backend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import riak import riak.resolver import six from time import sleep from sentry.nodestore.bas...
""" Script for inserting Power Meter Events directly from MS Excel source data. Usage: With the current working directory set to the path containing the data files: python insertPowerMeterEvents.py """ __author__ = 'Daniel Zhang (張道博)' __copyright__ = 'Copyright (c) 2013, University of Hawaii Smart Energy Project' ...
lookup_table = { 'RAD_FACILITY': { 'CITY_NAME': ('The name of the city, town, or village where a facility is ' 'located.'), 'CONGRESSIONAL_DIST_NUM': ('The number that represents a Congressional District for a ' 'state within the United States.'), ...
from ..robotsim import WorldModel,RobotModel,RobotModelLink,RigidObjectModel,IKObjective from ..math import vectorops,so3,se3 import coordinates def isCompound(item): if isinstance(item,WorldModel): return True elif isinstance(item,coordinates.Group): return True elif hasattr(item,'__iter__'...
""" Record all environment variables. """ import os import sys description = "Record all environment variables" def usage(): print "env:", description def CheckCLI(options): if options: sys.exit("env plugin has no options") return "" class Auditor: def __init__(self, audit_options): pass...
import os import re import time import math import subprocess import numpy as np from google.protobuf import text_format import caffe try: import caffe_pb2 except ImportError: # See issue #32 from caffe.proto import caffe_pb2 from train import TrainTask from digits.config import config_value from digits.sta...
import pytest from distributed.protocol import deserialize, serialize np = pytest.importorskip("numpy") torch = pytest.importorskip("torch") def test_tensor(): x = np.arange(10) t = torch.Tensor(x) header, frames = serialize(t) assert header["serializer"] == "dask" t2 = deserialize(header, frames) ...
from setuptools import setup install_requires = [ 'dnspython>=1.12.0', 'requests>=2.5.1' ] test_requires = [ 'mock>=1.0.1' ] setup( name='bcresolver', version='0.0.4', packages=['bcresolver'], install_requires=install_requires, tests_require=test_requires, test_suite='tests', url...
"""Fichier contenant les tours des familiers.""" from secondaires.familier.tours.proteger_maitre import ProtegerMaitre from secondaires.familier.tours.suivre_maitre import SuivreMaitre TOURS = { "proteger_maitre": ProtegerMaitre, "suivre_maitre": SuivreMaitre, }
from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^([0-9]+)/$', 'dbforms.views.handle_contactform') )
import numpy as np import pytest from pandas.core.dtypes.dtypes import CategoricalDtype import pandas as pd from pandas import Categorical, DataFrame, Index, Series import pandas._testing as tm class TestDataFrameIndexingCategorical: def test_assignment(self): # assignment df = DataFrame( ...
from oauthlib.common import Request from oauthlib.oauth1 import ( SIGNATURE_HMAC_SHA1, SIGNATURE_HMAC_SHA256, SIGNATURE_PLAINTEXT, SIGNATURE_RSA, SIGNATURE_TYPE_BODY, SIGNATURE_TYPE_QUERY, ) from oauthlib.oauth1.rfc5849 import Client from tests.unittest import TestCase class ClientRealmTests(TestCase): def ...
import urllib2 import httplib import socket import json import re import sys from telemetry.core import util from telemetry.core import exceptions from telemetry.core import user_agent from telemetry.core import wpr_modes from telemetry.core import wpr_server from telemetry.core.chrome import extension_dict_backend fro...
import ctypes import windows import windows.generated_def as gdef from ..apiproxy import ApiProxy, NeededParameter, is_implemented from ..error import fail_on_zero class ShlwapiProxy(ApiProxy): APIDLL = "Shlwapi" default_error_check = staticmethod(fail_on_zero) @ShlwapiProxy() def StrStrIW(pszFirst, pszSrch): ...
import sys, os, time, socket from gi.repository import Gtk import paramiko import pps_io.pps_import as ppsimport class pps_connect_dlg(Gtk.Window): def __init__(self): self.ssh = paramiko.SSHClient() self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.connected = False ...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations def update_site_forward(apps, schema_editor): """Set site domain and name.""" Site = apps.get_model("sites", "Site") Site.objects.update_or_create( id=settings.SITE_ID, defaults={ ...
import struct from vtdb import dbexceptions from vtdb import keyrange_constants ZK_KEYSPACE_PATH = '/zk/local/vt/ns' pack_keyspace_id = struct.Struct('!Q').pack class Keyspace(object): name = None db_types = None partitions = None sharding_col_name = None sharding_col_type = None served_from = None shard_...
import datetime from dojo.endpoint.utils import endpoint_get_or_create from dojo.importers import utils as importer_utils from dojo.models import Notes, Finding, \ BurpRawRequestResponse, \ Endpoint_Status, \ Test_Import from dojo.utils import get_current_user from django.core.exceptions import MultipleObje...
from kfusiontables.tests.base import KFTTestCase class KftUtilsCollectTestCase(KFTTestCase): def setUp(self): pass def tearDown(self): pass def test_example(self): pass
from sympy.physics.secondquant import (AntiSymmetricTensor, wicks, F, Fd, NO, evaluate_deltas, substitute_dummies, Commutator, simplify_index_permutations, PermutationOperator) from sympy import ( symbols, expand, pprint, Number, latex ) print print "Calculates the Coupled-Cluster energy- and amplit...
DEPS = [ 'recipe_engine/json', 'recipe_engine/step', ]
""" Parser for to pofile translation format. """ from datetime import datetime from django.utils import timezone import polib import sys from pontoon.sync import KEY_SEPARATOR from pontoon.sync.exceptions import ParseError from pontoon.sync.formats.base import ParsedResource from pontoon.sync.vcs.models import VCSTrans...
""" Multitenancy settings """ from django.conf import LazySettings from pandora import box DEFAULTS = { 'MODULE_IDENTIFIER': 'hmodule', 'RESPONSE_FORMATS': { 'html': 'text/html', 'mobile': 'text/html', 'json': 'text/plain', # 'json': 'application/j...
import base64 import copy import logging import re import shlex import sys import time import os from webkitpy.common.system import path from webkitpy.common.system.profiler import ProfilerFactory _log = logging.getLogger(__name__) DRIVER_START_TIMEOUT_SECS = 30 class DriverInput(object): def __init__(self, test_na...
""" Implements a manager for connection pools which providing connections bound to a specific configuration. """ from threading import RLock from datafinder.persistence.error import PersistenceError __version__ = "$Revision-Id:$" class ConnectionPoolManager(object): """ Manages the connection pool for different con...
import inspect import os from pprint import pprint import sys from config import get_checksd_path, get_confd_path from util import get_os def run_check(name, path=None): """ Test custom checks on Windows. """ # Read the config file confd_path = path or os.path.join(get_confd_path(get_os()), '%s.yaml...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['LinearTrend'] , ['Seasonal_Minute'] , ['NoAR'] );
from __future__ import absolute_import import six from sentry.api.serializers import Serializer, register from sentry.models import Environment, Rule, RuleActivity, RuleActivityType from sentry.utils.compat import filter def _generate_rule_label(project, rule, data): from sentry.rules import rules rule_cls = ru...
from twisted.internet.defer import inlineCallbacks from vumi.tests.helpers import VumiTestCase from go.vumitools.subscription.handlers import SubscriptionHandler from go.vumitools.tests.helpers import EventHandlerHelper class TestSubscriptionHandler(VumiTestCase): @inlineCallbacks def setUp(self): self....
""" gotta make bread if you want crumbs Copyright (c) 2009, whit 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 lis...
""" decoding.py Created by Thomas Mangin on 2009-08-25. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ from exabgp.configuration.ancient import Configuration from exabgp.configuration.ancient import formated from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI from exabgp.proto...
"""GDB pretty-printers for libc++. These should work for objects compiled when _LIBCPP_ABI_UNSTABLE is defined and when it is undefined. """ from __future__ import print_function import re import gdb _void_pointer_type = gdb.lookup_type("void").pointer() _long_int_type = gdb.lookup_type("unsigned long long") _libcpp_bi...
import os os.environ['NETKI_ENV'] = 'test' import string from unittest import TestCase from netki.util.validation import InputValidation __author__ = 'mdavid' class TestInputValidation(TestCase): def test_is_valid_domain(self): # Test Empties self.assertFalse(InputValidation.is_valid_domain(None)) ...
from django.conf.urls import patterns, url, include from django.contrib.auth.views import login, logout urlpatterns = patterns('ietf.codestand.accounts.views', url(r'^$', 'index', name='index'), url(r'^login/$', login, {'template_name': 'codestand/accounts/login.html'}), ...
from .dtype import (img_as_float, img_as_int, img_as_uint, img_as_ubyte, img_as_bool, dtype_limits) from .shape import view_as_blocks, view_as_windows from .noise import random_noise import numpy ver = numpy.__version__.split('.') chk = int(ver[0] + ver[1]) if chk < 18: # Use internal version for...