content
stringlengths
4
20k
from rpython.flowspace.model import mkentrymap, checkgraph # this transformation is very academical -- I had too much time def _remove_tail_call(translator, graph, block): print "removing tail call" assert len(block.exits) == 1 assert block.exits[0].target is graph.returnblock assert block.operations[...
import nest import unittest import numpy as np @nest.ll_api.check_stack class RateCopyModelTestCase(unittest.TestCase): ''' Test whether a rate connection created by copy model behaves identical to the original version ''' def test_rate_copy_model(self): # neuron parameters neur...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} from ansible.module_utils.basic import AnsibleModule import time import sys try: import paramiko HAS_LIB=True except ImportError: HAS_LIB=False _PROMPTBUFF = 4096 def wait_w...
""" Example LatestOnlyOperator and TriggerRule interactions """ import datetime as dt import airflow from airflow.models import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.operators.latest_only_operator import LatestOnlyOperator from airflow.utils.trigger_rule import TriggerRule dag = ...
from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y. F j.' TIME_FORMAT = 'G.i.s' DATETIME_FORMAT = 'Y. F j. G.i.s' YEAR_MONTH_FORMAT = 'Y. F' MONTH_DAY_FORMAT = 'F j.' SHORT_DATE_FORMA...
'''Molekel wavefunction input file format''' import numpy as np from horton.units import angstrom from horton.io.molden import _fix_molden_from_buggy_codes from horton.gbasis.iobas import str_to_shell_types from horton.gbasis.gobasis import GOBasis from horton.meanfield.orbitals import Orbitals __all__ = ['load_mk...
#!/usr/bin/python import h5py import matplotlib.pylab as plt import sys import numpy as np; # Go over each feioutput and plot each one. thefile = "Monotonic_Contact_Behaviour_Adding_Normal_Load.h5.feioutput"; finput = h5py.File(thefile) # Read the time and displacement times = finput["time"][:] shear_strain_x = fi...
from openerp.osv import orm, fields class AccountConfigSettings(orm.TransientModel): _inherit = 'account.config.settings' _columns = { 'use_journal_setting': fields.boolean( 'Use journal setting to post journal entries ' 'on invoice and bank statement validation',), } ...
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
"""The cert_expiry component.""" from datetime import timedelta import logging from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PORT from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.typing import HomeAssistantType from homeassistant...
import logging import logging.config from path import Path from qface.generator import FileSystem # logging.config.fileConfig('logging.ini') logging.basicConfig() log = logging.getLogger(__name__) inputPath = Path('tests/in') log.debug('input path folder: {0}'.format(inputPath.abspath())) def load_one(): path...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/InsurancePlan) on 2019-05-07. # 2019, SMART Health IT. from . import domainresource class InsurancePlan(domainresource.DomainResource): """ Details of a Health Insurance product/plan ...
from pyjamas import DOM from pyjamas import Factory from pyjamas.ui.TextBoxBase import TextBoxBase class TextBox(TextBoxBase): ''' Use Kind to set a HTML5 type Attributes supported: * Kind * MaxLength * Min * Max * Placeholder * Required * Step * VisibleLength ''' ...
#!/usr/bin/even/python import os import re import sys dirname = "" RE_CODE_BLOCK = re.compile(r'.. code-block:: (.+?)\s*$') RE_INCLUDE = re.compile(r'.. include:: (.+?)\s*$') RE_REFERENCE = re.compile(r':(.+?):`(.+?)`') def include_file(lines, pos, match): global dirname orig_filename = match.groups()[0] ...
from chainer import function from chainer.utils import type_check def _count_unknown_dims(shape): cnt = 0 for dim in shape: cnt += dim < 0 return cnt class Reshape(function.Function): """Reshapes an input array without copy.""" def __init__(self, shape): cnt = _count_unknown_di...
""" This code has been developed by Baptiste Busch: https://github.com/buschbapti This module allows you to retrieve Skeleton information from a Kinect device. It is only the client side of a zmq client/server application. The server part can be found at: https://bitbucket.org/buschbapti/kinectserver/src It us...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): needed_by = ( ("desktop", "0007_auto__add_documentpermission__add_documenttag__add_document"), ) def forwards(self, orm): # Adding ...
import pygtk pygtk.require('2.0') import gtk from chavier.dialogs import ( TextInputDialog, PointDialog, OptionDialog, RandomGeneratorDialog, AboutDialog, warning, ) class GUI(object): def __init__(self, app): self.app = app self.chart = None self.surface = None sel...
import exceptions class BaseCacheModule(object): def get(self, key): raise exceptions.NotImplementedError def set(self, key, value): raise exceptions.NotImplementedError def keys(self): raise exceptions.NotImplementedError def contains(self, key): raise exceptions.No...
#!/usr/bin/env python from egfrd import * from logger import * import sys import os from fractionS import * # Args: # Keq # koff_ratio # N_K # N_P # V (liter) # mode: 'normal' 'immobile' 'localized' 'single' 'clustered' # T Keq_str = sys.argv[1] koff_ratio_str = sys.argv[2] N_S_total = int( sys.argv[3] ) N_K = i...
from __future__ import unicode_literals import atexit import os import shutil import sys import django def main(package="mezzanine"): """ This is the main test function called via ``python setup.py test``. It's responsible for hacking the ``project_template`` dir into an actual project to test again...
import os import sys terminal_path = os.path.abspath(__file__) dir_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) if __name__ == '__main__' and __package__ is None: if dir_path != '/usr': sys.path.insert(1, dir_path) from ..commands_fake import cd from ..commands_real import ls, su...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: dbrecio.py """ File-like objects that read from or write to a bsddb record. This implements (nearly) all stdio methods. f = DBRecIO(db, key, txn=No...
import copy import json from django import http from django import shortcuts from django.views import generic from horizon import exceptions from horizon.forms.views import ADD_TO_FIELD_HEADER # noqa from horizon import messages class WorkflowView(generic.TemplateView): """A generic class-based view which hand...
from builtins import next from builtins import zip import logging from tempfile import NamedTemporaryFile from airflow.utils.file import TemporaryDirectory import gzip import bz2 import tempfile import os from airflow.exceptions import AirflowException from airflow.hooks.S3_hook import S3Hook from airflow.hooks.hive_h...
import unittest import requests from mock import patch from airflow import DAG, configuration from airflow.exceptions import AirflowException, AirflowSensorTimeout from airflow.operators.http_operator import SimpleHttpOperator from airflow.sensors.http_sensor import HttpSensor from airflow.utils.timezone import datet...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import time from ansible.module_utils.basic import AnsibleModule from ansible.module_utils...
import spec class Validator(object): BITNESS = None MAX_SUPERINSTRUCTION_LENGTH = None def ValidateSuperinstruction(self, superinstruction): raise NotImplementedError() def FitsWithinBundle(self, insns): offset = insns[0].address last_byte_offset = offset + sum(len(insn.bytes) for insn in insns...
from django.conf.urls import patterns, url urlpatterns = patterns('pootle_store.views', # permalinks url(r'^unit/(?P<uid>[0-9]+)/?$', 'permalink_redirect', name='pootle-unit-permalink'), # XHR url(r'^xhr/stats/checks/?$', 'get_qualitycheck_stats', name='pootle-xhr-stats...
from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: set_stats short_description: Define and display stats for the current ansible run description: - This module allows setting/accumulating stats on the current ansible run, either per host or for ...
# pylint: skip-file # flake8: noqa # pylint: disable=too-many-public-methods class DeploymentConfig(Yedit): ''' Class to model an openshift DeploymentConfig''' default_deployment_config = ''' apiVersion: v1 kind: DeploymentConfig metadata: name: default_dc namespace: default spec: replicas: 0 selector...
FIRST_TEN = ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine"] SECOND_TEN = ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"] OTHER_TENS = ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", ...
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.8.4. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
"""Test Z-Wave config panel.""" import asyncio import json from unittest.mock import MagicMock, patch import pytest from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from homeassistant.components.zwave import DATA_NETWORK, const from tests.mock.zwave import MockNod...
import protolib import sys # Import the packet proto definitions try: import inst_pb2 except: print "Did not find protobuf inst definitions, attempting to generate" from subprocess import call error = call(['protoc', '--python_out=util', '--proto_path=src/proto', 'src/proto/inst.proto...
import matplotlib.patches as mpatches import matplotlib.path as mpath from matplotlib.collections import PatchCollection import matplotlib.cm import numpy import os from shapely.geometry import Polygon # XXX Make the data dir configurable project_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) data_...
from setuptools import setup, find_packages setup( name="c7n_indexer", version='0.0.2', description="Cloud Custodian - Metrics/Resource Indexer", classifiers=[ "Topic :: System :: Systems Administration", "Topic :: System :: Distributed Computing" ], url="https://github.com/clou...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @author Philip import tarfile as tf import zipfile as zf import os, re, shutil, sys, platform pyversion = platform.python_version() islinux = platform.system().lower() == 'linux' if pyversion[:3] in ['2.6', '2.7']: import urllib as urllib_request import codecs ...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import os import sys from pants.base.build_environment import get_buildroot from pants.subsystem.subsystem import Subsystem from pants.util.contextutil...
import unittest from perf_insights import value as value_module from perf_insights.value import run_info as run_info_module class ValueTests(unittest.TestCase): def testDict(self): run_info = run_info_module.RunInfo('file:///a.json', '/a.json', metadata={'m': 1}) d = {...
from bitmovin.resources import AbstractIdResource class EncodingStatus(AbstractIdResource): def __init__(self, status, number_of_segments=None, id_=None, messages=None, subtasks=None, created_at=None, queued_at=None, finished_at=None, error_at=None, progress=None): super().__init__(id_=i...
from __future__ import division, absolute_import, print_function import numpy as np from numpy.compat import long from numpy.core import (array, arange, atleast_1d, atleast_2d, atleast_3d, vstack, hstack, newaxis, concatenate, stack) from numpy.testing import (TestCase, assert_, assert_raises, ...
import unittest import amulet class TestDeploy(unittest.TestCase): """ Trivial deployment test for Apache Hadoop NameNode. This charm cannot do anything useful by itself, so integration testing is done in the bundle. """ def test_deploy(self): self.d = amulet.Deployment(series='xenia...
""" HTML forms (part of web.py) """ import copy, re import webapi as web import utils, net def attrget(obj, attr, value=None): try: if hasattr(obj, 'has_key') and obj.has_key(attr): return obj[attr] except TypeError: # Handle the case where has_key takes different number of argume...
# coding=utf-8 import json import platform import psutil import sys import traceback import urllib import urllib2 from twisted.internet.task import LoopingCall from system.constants import version_info from system.decorators.threads import run_async_threadpool from system.events.manager import EventManager from syst...
from __future__ import absolute_import import collections import functools import logging from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValueError, MaxRetryError, ProxyScheme...
""" Make sure warning level is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGyp(formats=['msvs', 'ninja']) CHDIR = 'compiler-flags' test.run_gyp('warning-level.gyp', chdir=CHDIR) # A separate target for each warning level: one pass (compiling a file # c...
#!/usr/bin/env python """Read events from rtl_433 and gpsd and print out.""" # Needs gpsd (and the Python support from gpsd) # Start gpsd and rtl_433 (rtl_433 -F syslog::1433), then this script from __future__ import print_function import socket import json import gps import threading # rtl_433 syslog address UDP_...
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para documentary.es # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os from cor...
"""List command for gcloud debug snapshots command group.""" from googlecloudsdk.api_lib.debug import debug from googlecloudsdk.calliope import base from googlecloudsdk.command_lib.debug import flags from googlecloudsdk.core import properties class Describe(base.DescribeCommand): """Describe debug snapshots.""" ...
from oslo.serialization import jsonutils from nova import context from nova.openstack.common import log as logging from nova.virt import firewall from nova.virt import netutils LOG = logging.getLogger(__name__) class Dom0IptablesFirewallDriver(firewall.IptablesFirewallDriver): """Dom0IptablesFirewallDriver clas...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import re import time HAS_PB_SDK = True try: from profitbricks.client import ProfitBri...
import os import errno import shutil import unittest import tempfile from test import support import modulefinder TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST_DIR, os.path.dirname(tempfile.__file__)] # Each test description is a list of 5 items: # # 1. a module name that will be imported by modulefinder # 2. a l...
"""Keras data preprocessing utils for sequence data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.keras.python.keras.preprocessing.sequence import make_sampling_table from tensorflow.contrib.keras.python.keras.preprocessing.seq...
import os, filecmp, shutil, tempfile import unittest from test import test_support class FileCompareTestCase(unittest.TestCase): def setUp(self): self.name = test_support.TESTFN self.name_same = test_support.TESTFN + '-same' self.name_diff = test_support.TESTFN + '-diff' data = 'Con...
import netaddr import webob from webob import exc from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import context as nova_context from nova import exception from nova.i18n import _ from nova import network from nova.objects import base as base_obj from nova.objects import fields ...
""" Multivariate Conditional and Unconditional Kernel Density Estimation with Mixed Data Types References ---------- [1] Racine, J., Li, Q. Nonparametric econometrics: theory and practice. Princeton University Press. (2007) [2] Racine, Jeff. "Nonparametric Econometrics: A Primer," Foundation and Trends in Econ...
""" Print the IP address for a given hostname. eg python gethostbyname.py www.google.com This script does a host lookup using the default Twisted Names resolver, a chained resolver, which attempts to lookup a name from: * local hosts file * memory cache of previous lookup results * system recursive DNS servers ""...
"""download mscelebrities dataset""" import os import utils import requests import urllib from tqdm import tqdm def download_imdb(face_only=True, data_dir="./data"): """ https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/ """ full_urls = ["https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/imdb_0.ta...
#Clases donde cada clase es un test diferente class TestUnitario: def run(self): print("--- Test Unitario ---") print("Realizando Test Unitario...") print("Resultados: -53,15\n") class TestRegresion: def run(self): print("---- Test De Regresion ---") print("Realizando T...
from django import template from django.template import Node, Token, TemplateSyntaxError from django.template import resolve_variable from django.template.defaultfilters import stringfilter from django.templatetags import future from localeurlcustom import utils register = template.Library() def chlocale(url, loca...
from __future__ import unicode_literals from django import forms from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase, TestCase, override_settings from django.test.client import RequestFactory from django.urls import reverse from django.views.generic.base import View from djan...
__version__ = '0.14.6-dev'
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this ...
"""BibIndexFulltextTokenizer: extracts words form a given document. Document is given by its URL. """ import os import sys import logging import urllib2 import re from six import iteritems from invenio.config import \ CFG_SOLR_URL, \ CFG_XAPIAN_ENABLED, \ CFG_BIBINDEX_FULLTEXT_INDEX_LOCAL_FILES_ONL...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, int_or_none, ) class GorillaVidIE(InfoExtractor): IE_DESC = 'GorillaVid.in, dacli...
from gnuradio import gr, gr_unittest, blocks class test_regenerate(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() def tearDown(self): self.tb = None def test_regen1(self): tb = self.tb data = [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
import os import uno import unohelper import xmlrpclib import base64 from com.sun.star.task import XJobExecutor if __name__<>"package": from lib.gui import * from lib.error import ErrorDialog from lib.tools import * from LoginTest import * from lib.rpc import * database="test" uid = 3 class...
__doc_all__ = [] import unittest import random import threading import socket import time import sys import errno import exceptions import datetime import traceback import thread from cStringIO import StringIO from cogen.common import * from base import priorities, proactors_available from cogen.co...
import socket import threading from django.core.handlers.wsgi import WSGIHandler from django.core.management import call_command from django.core.servers import basehttp from django.db import connections from django.test.testcases import TransactionTestCase, TestCase class StoppableWSGIServer(basehttp.WSGIServer): ...
import json import os import subprocess import sys def main(crate=None): os.chdir(os.path.join(os.path.dirname(__file__), "..")) meta = json.loads(subprocess.check_output(["cargo", "metadata", "--format-version", "1"])) graph = {} for package in meta["packages"]: if package["source"] is None: ...
"""Ensemble methods that create consensus calls from multiple approaches. This handles merging calls produced by multiple calling methods or technologies into a single consolidated callset. Uses the bcbio.variation toolkit: https://github.com/chapmanb/bcbio.variation and bcbio.variation.recall: https://github.com/chap...
""" This is some of the code behind 'cobbler sync'. 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 2 of the License, or (at your option) any later version. This program is distribute...
import usocket as socket import ustruct as struct from ubinascii import hexlify class MQTTException(Exception): pass class MQTTClient: def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0, ssl=False, ssl_params={}): if port == 0: port = 8883...
from kivy.lang import Builder from plyer import gps from kivy.app import App from kivy.properties import StringProperty from kivy.clock import Clock, mainthread kv = ''' BoxLayout: orientation: 'vertical' Label: text: app.gps_location Label: text: app.gps_status BoxLayout: size_...
""" generic classes/functions for pyreverse core/extensions """ import sys import re import os ########### pyreverse option utils ############################## RCFILE = '.pyreverserc' def get_default_options(): """ Read config file and return list of options """ options = [] home = os.environ....
"""Beam fn API log handler.""" import logging import math import Queue as queue import threading import grpc from apache_beam.portability.api import beam_fn_api_pb2 from apache_beam.portability.api import beam_fn_api_pb2_grpc # This module is experimental. No backwards-compatibility guarantees. class FnApiLogReco...
import logging log = logging.getLogger("composer-cli") from composer import http_client as client from composer.cli.help import status_help from composer.cli.utilities import handle_api_result def status_cmd(opts): """Process status commands :param opts: Cmdline arguments :type opts: argparse.Namespace ...
import time import pytest import numpy as np import multiprocessing import psi4 # Test below is fine on its own but erratic through pytest. Most likely # to succeed as first test collected, so here it lies. @pytest.mark.xfail(True, reason='threading treatment suspect', run=True) def disabled_test_threaded_blas(): ...
""" This object provides quoting for GEOS geometries into PostgreSQL/PostGIS. """ from psycopg2 import Binary from psycopg2.extensions import ISQLQuote class PostGISAdapter(object): def __init__(self, geom): "Initializes on the geometry." # Getting the WKB (in string form, to allow easy pickling ...
#: E121 print "E121", ( "dent") #: E122 print "E122", ( "dent") #: E123 my_list = [ 1, 2, 3, 4, 5, 6, ] #: E124 print "E124", ("visual", "indent_two" ) #: E124 print "E124", ("visual", "indent_five" ) #: E124 a = (123, ) #: E129 if (row < 0 or self.moduleCount <...
#!/usr/bin/env python """ subsection.py, module definition of Subsection class. This defines a subsection of the presentation. """ # modules loading # standard library modules: these should be present in any recent python distribution from collections import OrderedDict import re # MaTiSSe.py modules from ..config impo...
import time from openerp import pooler from openerp.report import report_sxw class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, name, context=context) self.localcontext....
"""Operator classes for eval. """ import operator as op from functools import partial from datetime import datetime import numpy as np from pandas.core.dtypes.common import is_list_like, is_scalar import pandas as pd from pandas.compat import PY3, string_types, text_type import pandas.core.common as com from pandas....
class ModuleDocFragment(object): # Standard files documentation fragment DOCUMENTATION = r"""options: provider: description: - B(Deprecated) - 'Starting with Ansible 2.5 we recommend using C(connection: network_cli).' - For more information please see the L(IOS Platform Options guide, ../netw...
from django.db import connection, connections from django.db.migrations.exceptions import ( AmbiguityError, InconsistentMigrationHistory, NodeNotFoundError, ) from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder from django.test import TestCase, modify_...
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- import re from sublimedsl.keymap import * def asciidoc_macro(name): return "res://Packages/Asciidoctor/Macros/%s.sublime-macro" % name def builtin_macro(name): return "res://Packages/Default/%s.sublime-macro" % name def escape(string): """ Escape regex ...
from django.utils.translation import ugettext_lazy as _ from enumfields.enums import Enum UNILINGUAL_TEMPLATE_LANGUAGE = "default" class TemplateUse(Enum): NONE = 0 UNILINGUAL = 1 MULTILINGUAL = 2 class Labels: NONE = _('none') UNILINGUAL = _('unilingual') MULTILINGUAL = _('m...
from __future__ import absolute_import, division, unicode_literals import json import unittest from .support import get_data_files try: unittest.TestCase.assertEqual except AttributeError: unittest.TestCase.assertEqual = unittest.TestCase.assertEquals import html5lib from html5lib import constants from html...
""" Handler for Griffin PowerMate, Contour ShuttlePro & ShuttleXpress USB knobs This is Linux and wxPython specific. """ import os import sys import struct import exceptions import threading import wx from gnuradio import gru imported_ok = True try: import select import fcntl except ImportError: importe...
__author__ = 'mramire8' __copyright__ = "Copyright 2013, ML Lab" __version__ = "0.1" __status__ = "Development" import numpy as np import copy import random class BaseLearner(object): def __init__(self, model=None, cost_model=None, accuracy_model=None, budget=None, seed=1234567, subpool=None): self.cur...
# -*- coding: utf-8 -*- import time import numpy as np np.set_printoptions(precision=3, linewidth=80) from dyconnmap import tvfcg, tvfcg_cfc from dyconnmap.fc import MI, PLV, PLI from dyconnmap.fc import PAC from dyconnmap.fc import plv_within def try_PLV(data): fb = [1.0, 4.0] fs = 128 pairs = None ...
"""Description: function Report_Number_Generation This function creates a reference for the submitted document and saves it in the specified file. Author: T.Baron""" __revision__ = "$Id$" import os import re import time import fcntl import errno from invenio.config i...
# coding=utf-8 from __future__ import absolute_import __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License" import os from jinja2.loaders import FileSystemLoader, TemplateNotFound...
""" Utilities for spawning and killing mongodb clusters for use with the tests """ from itertools import count import os import shutil import socket import subprocess import time from pymongo import MongoClient from tests import mongo_host, mongo_start_port from tests.util import assert_soon free_port = count(mongo_...
import threading import unittest import sys import pydevconsole from pydev_imports import xmlrpclib, SimpleXMLRPCServer, StringIO try: raw_input raw_input_name = 'raw_input' except NameError: raw_input_name = 'input' #========================================================================================...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Count the number of prime numbers less than a non-negative number, n. SOLUTION: Consider global solution: - The algorithm scans for all non-prime numbers up to a limit - Instead of local solution of checking if is prime for each number within a limit ...
def main(request, response): def fail(message): response.content = "FAIL: " + str(message) response.status = 400 def getState(token): server_state = request.server.stash.take(token) if not server_state: return "Uninitialized" return server_state def setS...
import os, sys sys.path.append(os.getcwd()) import time import numpy as np import tensorflow as tf import language_helpers import tflib as lib import tflib.ops.linear import tflib.ops.conv1d import tflib.plot # Download Google Billion Word at http://www.statmt.org/lm-benchmark/ and # fill in the path to the extract...
#!/usr/bin/python import sys from intelhex import IntelHex import time import datetime import struct def add8(a, b): return (a + b & 0xFF) page_size = 255 class Hex2BinConv(): def __init__(self, out): self.hex = IntelHex() self.out = out def load(self, filename): print...