content
string
"""A model that places a soft decision tree embedding before a neural net.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.tensor_forest.hybrid.python import hybrid_model from tensorflow.contrib.tensor_forest.hybrid.python.layers i...
from openerp.osv import fields, osv class stock_move(osv.osv): _inherit = 'stock.move' _columns = { 'sale_line_id': fields.many2one('sale.order.line', 'Sales Order Line', ondelete='set null', select=True, readonly=True), } def _prepare_chained_picking(self, cr, uid, picking_name, picking, pick...
from MemObject import MemObject from m5.params import * from m5.proxy import * class GarnetSyntheticTraffic(MemObject): type = 'GarnetSyntheticTraffic' cxx_header = \ "cpu/testers/garnet_synthetic_traffic/GarnetSyntheticTraffic.hh" block_offset = Param.Int(6, "block offset in bits") num_dest = ...
"""Provisioning serializers for orchestrator""" from itertools import groupby import netaddr import six from nailgun import consts from nailgun.extensions import node_extension_call from nailgun.logger import logger from nailgun import objects from nailgun.orchestrator.priority_serializers import PriorityStrategy fr...
"""Test LRUCache by running different input batch sizes on same network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_test from tensorflow.pyt...
#!/usr/bin/env python2.7 -E # -*- coding: utf-8 -*- # Launch script for Jython. It may be wrapped as an executable with # tools like PyInstaller, creating jython.exe, or run directly. The # installer will make this the default launcher under the name # bin/jython if CPython 2.7 is available with the above shebang # in...
from ctypes import POINTER, c_double, c_int, c_uint from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR, GEOSFuncFactory from django.contrib.gis.geos.prototypes.errcheck import ( GEOSException, last_arg_byref, ) # ## Error-checking routines specific to coordinate sequences. ## def check_cs_op(result, fu...
from __future__ import print_function import errno import gc import os import pprint import socket import sys import traceback import eventlet import eventlet.backdoor import greenlet from oslo.config import cfg from helloworld.openstack.common.gettextutils import _ from helloworld.openstack.common import log as log...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import os from ansible.module_utils.basic import AnsibleModule class Zfs(object): d...
# Adapted from test_file.py by Daniel Stutzbach import sys import os import io import errno import unittest from array import array from weakref import proxy from functools import wraps from test.support import TESTFN, check_warnings, run_unittest, make_bad_fd, cpython_only from collections import UserList from _io ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- from collections import defaultdict import random import sys sys.path.insert(1, "../../") import h2o from h2o.exceptions import H2OValueError from h2o.utils.compatibility import viewvalues from tests import pyunit_utils def create_frame_test(): """Test `h2o.create_fr...
from .bases import _ScandinavianStemmer from whoosh.compat import u class SwedishStemmer(_ScandinavianStemmer): """ The Swedish Snowball stemmer. :cvar __vowels: The Swedish vowels. :type __vowels: unicode :cvar __s_ending: Letters that may directly appear before a word final 's'. :type __s...
from . import constants # 255: Control characters that usually does not exist in any text # 254: Carriage/Return # 253: symbol (punctuation) that does not belong to word # 252: 0 - 9 # Character Mapping Table: Latin2_HungarianCharToOrderMap = ( \ 255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,25...
from io import BytesIO class CallbackFileWrapper(object): """ Small wrapper around a fp object which will tee everything read into a buffer, and when that file is closed it will execute a callback with the contents of that buffer. All attributes are proxied to the underlying file object. Thi...
# -*- coding: utf-8 -*- from setuptools import find_packages, setup DESCRIPTION = "A MongoEngine MapField that allows and requires ObjectIds as " \ "keys." try: LONG_DESCRIPTION = open('README.md').read() except: LONG_DESCRIPTION = DESCRIPTION setup( name='mongoengine-objectidmapfield', ...
from ducktape.services.background_thread import BackgroundThreadService import json class VerifiableProducer(BackgroundThreadService): logs = { "producer_log": { "path": "/mnt/producer.log", "collect_default": False} } def __init__(self, context, num_nodes, kafka, topic,...
from setuptools import setup, find_packages setup( name="XModule", version="0.1", packages=find_packages(exclude=["tests"]), install_requires=[ 'distribute', 'docopt', 'capa', 'path.py', ], package_data={ 'xmodule': ['js/module/*'] }, # See http:...
# -*- coding: utf-8 -*- from website.util import rubeus from ..api import Figshare def figshare_hgrid_data(node_settings, auth, parent=None, **kwargs): node = node_settings.owner if node_settings.figshare_type == 'project': item = Figshare.from_settings(node_settings.user_settings).project(node_setti...
#!/usr/bin/python """ PN CLI show commands """ # # This file is part of Ansible # # Ansible 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 ver...
import boto from boto.services.message import ServiceMessage from boto.services.servicedef import ServiceDef from boto.pyami.scriptbase import ScriptBase from boto.utils import get_ts import time import os import mimetypes class Service(ScriptBase): # Time required to process a transaction ProcessingTime = 6...
from __future__ import absolute_import, division, print_function __metaclass__ = type ################################################################################ # Documentation ################################################################################ ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu...
""" Module for checking permissions with the comment_client backend """ import logging from types import NoneType from django.core import cache from opaque_keys.edx.keys import CourseKey CACHE = cache.get_cache('default') CACHE_LIFESPAN = 60 def cached_has_permission(user, permission, course_id=None): """ C...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetZestimate(Choreography): def __init__(self, temboo_session): """ Create a ...
""" Views for support dashboard """ import logging from django.contrib.auth.models import User from django.views.generic.edit import FormView from django.views.generic.base import TemplateView from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect from django.contrib import mes...
try: import ldap except ImportError: # This module needs to be importable despite ldap not being a requirement ldap = None import time from oslo_config import cfg from oslo_log import log as logging from nova import exception from nova.i18n import _, _LW from nova.network import dns_driver from nova impo...
import numpy as np from numpy.testing import assert_array_equal, assert_allclose from vispy.testing import run_tests_if_main from vispy.geometry import (create_box, create_cube, create_cylinder, create_sphere, create_plane) def test_box(): """Test box function""" vertices, filled,...
import cvxopt import cvxopt.solvers import numpy import pymanoid_sage import time import vector from numpy import array, dot, eye, hstack, vstack, zeros cvxopt.solvers.options['show_progress'] = False # disable cvxopt output CONV_THRES = 1e-2 DEBUG = False DOF_SCALE = 0.8 # additional scaling to avoid joint-limit...
import asyncio import datetime import logging import logging.handlers import sys from aiohttp.web_log import AccessLogger from utilities.database import create_database_connection sys.path.insert(0, "..") from units.files import create_folder sys.path.pop(0) class ConsoleLogger(object): '''Console Logger''' d...
"""Management command for backpopulating missing program credentials.""" import logging from collections import namedtuple from django.contrib.sites.models import Site from django.core.management import BaseCommand from django.db.models import Q from opaque_keys.edx.keys import CourseKey from lms.djangoapps.certifica...
""" Tests For CellStateManager """ import time import mock from oslo_config import cfg from oslo_db import exception as db_exc import six from nova.cells import state from nova import db from nova.db.sqlalchemy import models from nova import exception from nova import objects from nova import test from nova import u...
from __future__ import (absolute_import, division) __metaclass__ = type import errno from itertools import product from io import BytesIO import pytest from ansible.module_utils._text import to_native from ansible.module_utils.six import PY2 from ansible.module_utils.compat import selectors class OpenBytesIO(Bytes...
"""Functional tests for aggregate operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtyp...
from __future__ import absolute_import import responses from six.moves.urllib.parse import urlencode from sentry.models import Integration from sentry.integrations.msteams.client import MsTeamsClient from sentry.testutils import TestCase from sentry.utils.compat.mock import patch class MsTeamsClientTest(TestCase):...
import numpy as np from opentrons import config from opentrons.calibration_storage import file_operators as io from opentrons.hardware_control import robot_calibration from opentrons.util.helpers import utc_now from opentrons.types import Mount def test_migrate_affine_xy_to_attitude(): affine = [[1.0, 2.0, 3.0, ...
#!/usr/bin/env python # # metadataPDF.py - dump pdf metadata # # Copy of Yusuke's dumppdf to add dumpmeta import sys, re from pdfminer.psparser import PSKeyword, PSLiteral from pdfminer.pdfparser import PDFDocument, PDFParser from pdfminer.pdftypes import PDFStream, PDFObjRef, resolve1, stream_value # dumpmeta class...
from django.test import TestCase from famille import models from famille.templatetags import helpers, users __all__ = ["TemplateTagsTestCase", ] class TemplateTagsTestCase(TestCase): def test_get_class_name(self): obj = models.Prestataire() self.assertEqual(helpers.get_class_name(obj), "Presta...
""" Provide tests for git_add_course management command. """ import logging import os import shutil import StringIO import subprocess import unittest from uuid import uuid4 from nose.plugins.attrib import attr from django.conf import settings from django.core.management import call_command from django.core.management....
from . import wgwidget from .wgtextbox import Textfield class AnnotateTextboxBase(wgwidget.Widget): """A base class intented for customization. Note in particular the annotationColor and annotationNoColor methods which you should override.""" ANNOTATE_WIDTH = 5 def __init__(self, screen, value =...
# -*- coding: utf-8 -*- """ werkzeug.debug.tbtools ~~~~~~~~~~~~~~~~~~~~~~ This module provides various traceback related utility functions. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import re import os import sys import inspect import traceback imp...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.loader import MigrationLoader class Command(BaseCommand): help = "Shows all available migrations for the ...
import os, sys, subprocess, hashlib import subprocess def check_output(*popenargs, **kwargs): r"""Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. >>> check_output(['/usr/bin/python', '--version']) Python 2.6....
from tornado import testing from mainWebserver import make_app import json from echo.feeds.feed import Feed HTTP_SUCCESS_CODE = 200 HTTP_NOT_FOUND_CODE = 404 class CustomFeedTest(testing.AsyncHTTPTestCase): def get_app(self): return make_app() def test_crud_feed(self): payload = { ...
__author__ = 'jgressmann' from datetime import date import pickle import sys import traceback import urllib import urlparse #import urlresolver import xbmc import xbmcaddon import xbmcgui import xbmcplugin import zlib import resources.lib.sc2links as sc2links addon = xbmcaddon.Addon() #__addonname__ = addon.getAddon...
#!/usr/bin/env python2 """Some validation for proc_doc.Proc*""" __author__ = 'Manuel Holtgrewe <<EMAIL>>' class ProcDocValidator(object): """Validate proc_doc.Proc* objects. Implements the visitor pattern. """ def __init__(self, msg_printer): self.msg_printer = msg_printer def validate(...
"""Bundles for Jasmine test runner.""" from __future__ import unicode_literals from invenio_base.bundles import invenio as _i from invenio_base.bundles import jquery as _j from invenio_ext.assets import Bundle, RequireJSFilter jasmine_js = Bundle( # es5-shim is needed by PhantomJS # 'vendors/es5-shim/es5-shi...
from __future__ import unicode_literals import collections import getpass import optparse import os import re import shutil import socket import subprocess import sys try: import urllib.request as compat_urllib_request except ImportError: # Python 2 import urllib2 as compat_urllib_request try: import u...
"""Testing for Spectral Clustering methods""" from sklearn.externals.six.moves import cPickle dumps, loads = cPickle.dumps, cPickle.loads import numpy as np from scipy import sparse from sklearn.utils import check_random_state from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_a...
# Test the functions and main class method of FormatParagraph.py import unittest from idlelib import FormatParagraph as fp from idlelib.EditorWindow import EditorWindow from tkinter import Tk, Text from test.support import requires class Is_Get_Test(unittest.TestCase): """Test the is_ and get_ functions""" te...
# -*- coding: utf-8 -*- """ Tests of ConfigurationModel """ import ddt from django.contrib.auth.models import User from django.db import models from django.test import TestCase from rest_framework.test import APIRequestFactory from freezegun import freeze_time from mock import patch, Mock from config_models.models i...
import argparse import os.path import sys from filecmp import dircmp from shutil import rmtree from tempfile import mkdtemp from mopy.paths import Paths paths = Paths() sys.path.insert(0, os.path.join(paths.mojo_dir, "public", "tools", "bindings", "pylib")) from mojom_tests.support.fin...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding unique constraint on 'MetaData', fields ['xform', 'data_type', 'data_value'] db.create_unique(u'mai...
import numpy import six from chainer import cuda from chainer import function from chainer import utils from chainer.utils import type_check class TheanoFunction(function.Function): def __init__(self, forward_func, backward_func): utils.experimental('chainer.functions.TheanoFunction') self.forwa...
from ceilometer.compute import pollsters from ceilometer.compute.pollsters import util from ceilometer import sample class InstancePollster(pollsters.BaseComputePollster): @staticmethod def get_samples(manager, cache, resources): for instance in resources: yield util.make_sample_from_inst...
import sys, re, os, types, time from operator import attrgetter import graph from misc.ExtMap import ExtMap from ecmascript.frontend import lang from ecmascript.transform.check import global_symbols as gs from generator.code.Class import DependencyError from generator.code.DependencyItem i...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from argparse import ArgumentParser from datetime import datetime from dateutil.rrule import rrulestr import os import sys from textwrap import dedent from .config import ConfigHandler from .errors import AnswerError CONFIG_LOCATION =...
# -*- test-case-name: openid.test.test_fetchers -*- """ This module contains the HTTP fetcher interface and several implementations. """ __all__ = ['fetch', 'getDefaultFetcher', 'setDefaultFetcher', 'HTTPResponse', 'HTTPFetcher', 'createHTTPFetcher', 'HTTPFetchingError', 'HTTPError'] import urll...
import sys from . import constants from .charsetprober import CharSetProber from .compat import wrap_ord SAMPLE_SIZE = 64 SB_ENOUGH_REL_THRESHOLD = 1024 POSITIVE_SHORTCUT_THRESHOLD = 0.95 NEGATIVE_SHORTCUT_THRESHOLD = 0.05 SYMBOL_CAT_ORDER = 250 NUMBER_OF_SEQ_CAT = 4 POSITIVE_CAT = NUMBER_OF_SEQ_CAT - 1 #NEGATIVE_CAT ...
import json import os import pipes import stat def _get_facter_dir(): if os.getuid() == 0: return '/etc/facter/facts.d' else: return os.path.expanduser('~/.facter/facts.d') def _write_structured_data(basedir, basename, data): if not os.path.exists(basedir): os.makedirs(basedir) ...
import hashlib import Crypto.Hash.SHA256 as sha256 import binascii from bitcoin import key as ecdsa from bitcoin import base58 from baseconv import dice_to_10 def dsha256(s): return sha256.new(sha256.new(s).digest()).digest() def rhash(s): h1 = hashlib.new('ripemd160') h1.update(hashlib.sha256(s).digest()) retu...
# -*- coding: utf-8 -*- import sys import os reload(sys) sys.setdefaultencoding("utf-8") from sqlalchemy import Table from yaml import load,dump try: from yaml import CSafeLoader as SafeLoader print "Using CSafeLoader" except ImportError: from yaml import SafeLoader print "Using Python SafeLoader" distribution={...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
from numpy.testing import * from numpy import array from numpy.compat import asbytes import util class TestReturnCharacter(util.F2PyTest): def check_function(self, t): tname = t.__doc__.split()[0] if tname in ['t0','t1','s0','s1']: assert t(23)==asbytes('2') r = t('ab');asse...
from spack import * class Libvorbis(AutotoolsPackage): """Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format for mid to high quality (8kHz- 48.0kHz, 16+ bit, polyphonic) audio and music at fixed and variable bitrates from 16 to 128 kbps/channe...
"""Implementation of the JSON adaptation objects This module exists to avoid a circular import problem: pyscopg2.extras depends on psycopg2.extension, so I can't create the default JSON typecasters in extensions importing register_json from extras. """ # psycopg/_json.py - Implementation of the JSON adaptation object...
import sys from ansible.module_utils.basic import * from ansible.module_utils.ec2 import * try: import boto import boto.ec2 import boto.sns HAS_BOTO = True except ImportError: HAS_BOTO = False def arn_topic_lookup(connection, short_topic): response = connection.get_all_topics() result = ...
"""Test node responses to invalid transactions. In this test we connect to one node over p2p, and test tx requests. """ from test_framework.test_framework import ComparisonTestFramework from test_framework.comptool import TestManager, TestInstance, RejectResult from test_framework.blocktools import * import time #...
"""Exceptions raised by the credit API. """ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from rest_framework import status from rest_framework.exceptions import APIException # TODO: Cleanup this mess! ECOM-2908 class CreditApiBadRequest(Exception): """ Could...
"""Utilities for OAuth. Utilities for making it easier to work with OAuth 2.0 credentials. """ __author__ = '<EMAIL> (Joe Gregorio)' import os import stat import threading from anyjson import simplejson from client import Storage as BaseStorage from client import Credentials class CredentialsFileSymbolicLinkError...
import uno import unohelper import string import re import base64 from com.sun.star.task import XJobExecutor if __name__<>"package": from lib.gui import * from LoginTest import * from lib.logreport import * from lib.rpc import * database="test" uid = 1 class ConvertBracesToField( unohelper.B...
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import encode_basestring as c_encode_basestring except ImportError: c_encode_basestring = None try: from _j...
from openerp.osv import osv, fields from openerp.tools.translate import _ class account_sepa_purpose(osv.Model): """Represents the payment category purpose code for SEPA payments specified by ISO 20022. """ _name = 'account.sepa.purpose' _columns = { 'code': fields.char( size=...
import unittest from openerp.tools.translate import quote, unquote, xml_translate class TranslationToolsTestCase(unittest.TestCase): def test_quote_unquote(self): def test_string(str): quoted = quote(str) #print "\n1:", repr(str) #print "2:", repr(quoted) u...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys import copy from ansible import constants as C from ansible.module_utils._text import to_text from ansible.module_utils.connection import Connection, ConnectionError from ansible.plugins.action.normal import ActionModul...
# The plot server must be running # Go to http://localhost:5006/bokeh to view this plot from numpy.random import random from bokeh.plotting import figure, show, output_server def mscatter(p, x, y, typestr): p.scatter(x, y, marker=typestr, line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, si...
#!/usr/bin/env python """ Collins external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. Collins ...
import os import sys import logging import nose.tools import angr from angr.sim_type import SimTypePointer, SimTypeChar test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')) def test_execute_address_brancher(): p = angr.Project(os.path.join(test_locatio...
from osv import osv, fields import netsvc import base64 import tempfile import tarfile import httplib import os class RstDoc(object): def __init__(self, module, objects): self.dico = { 'name': module.name, 'shortdesc': module.shortdesc, 'latest_version': module.latest_v...
''' Nautiluscoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return...
# -*- coding: utf-8 -*- import re from time import time from module.common.json_layer import json_loads from module.plugins.internal.CaptchaService import ReCaptcha from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class FilepostCom(SimpleHoster): __name__ = "FilepostCom" __t...
"""TF-Slim Nets. ## Standard Networks. @@alexnet_v2 @@inception_v1 @@inception_v1_base @@inception_v2 @@inception_v2_base @@inception_v3 @@inception_v3_base @@overfeat @@vgg_a @@vgg_16 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=u...
""" Module containing a concrete implementation for JSONParser abstract class, returning a Station instance """ import json import time from pyowm.webapi25 import station from pyowm.webapi25 import weather from pyowm.abstractions import jsonparser from pyowm.exceptions import parse_response_error, api_response_error ...
from __future__ import unicode_literals import base64 from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) from ..utils import ( ExtractorError, HEADRequest, ) class HotNewHipHopIE(InfoExtractor): _VALID_URL = r'http://www\.hotnewhiphop\.com/.*\....
from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import numpy as np from tensorflow.python.data.ops import dataset_ops from tensorflow.python.debug.lib import check_numerics_callback from tensorflow.python.eager import backprop from tensorflow.pyt...
import oslo_messaging as messaging from manila import rpc from manila.share import utils class HuaweiV3API(object): """Client side of the huawei V3 rpc API. API version history: 1.0 - Initial version. """ BASE_RPC_API_VERSION = '1.0' def __init__(self): self....
from openerp.osv import osv, fields class certification_type(osv.Model): _name = 'certification.type' _order = 'name ASC' _columns = { 'name': fields.char("Certification Type", required=True) } class certification_certification(osv.Model): _name = 'certification.certification' _order...
import json from urllib2 import urlopen, quote as urlquote from urlparse import urlparse from ansible.errors import AnsibleError class GalaxyAPI(object): ''' This class is meant to be used as a API client for an Ansible Galaxy server ''' SUPPORTED_VERSIONS = ['v1'] def __init__(self, galaxy, api_server)...
#! /usr/bin/env python # ---------------------------------------------------------------------- # Settings vardir = "./var" date_format = "%d-%b-%Y" # ---------------------------------------------------------------------- # functions def usage(): print("""Usage: gen.py file.in [...] Substitute placeholders in in...
# -*- coding: utf-8 -*- """ test_configuration ~~~~~~~~~~~~~~~~~~ Basic configuration tests """ import base64 import pytest from utils import authenticate, logout @pytest.mark.settings( logout_url='/custom_logout', login_url='/custom_login', post_login_view='/post_login', post_logout_v...
"""Functions that read and write gzipped files. The user of the file doesn't have to worry about the compression, but random access is not allowed.""" # based on Andrew Kuchling's minigzip.py distributed with the zlib module import struct, sys, time, os import zlib import io import __builtin__ __all__ =...
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
from classes import * from helper_functions import * def method(servers_and_threads, arguments): print # Line break # Argument Check if len(arguments) != 0: email = arguments[0] if not helpers_for_commands.email_is_valid(email): print "You did not enter a valid email." ...
#BRUNO IOCHINS GRISCI import json import sys import math import os def create_vocabulary(news): vocabulary = [] for ide in news: vocabulary = vocabulary + news[ide]["text"] return set(vocabulary) def count_labels(news): n_positive_news = 0.0 n_negative_news = 0.0 for ide in news: ...
import os import argparse import numpy as np import h5py from Q50_config import LoadParameters from GPSReader import GPSReader from GPSTransforms import IMUTransforms from LidarTransforms import loadLDR from pipeline_config import LANE_FILTER, PARAMS_TO_LOAD, OPT_POS_FILE from LidarIntegrator import transform_points_in...
from boto.exception import BotoServerError class DuplicateRequest(BotoServerError): pass class DomainLimitExceeded(BotoServerError): pass class InvalidInput(BotoServerError): pass class OperationLimitExceeded(BotoServerError): pass class UnsupportedTLD(BotoServerError): pass class TLDRul...
#!/usr/bin/env python3 import configparser as cp __version__ = "1.0" class ConfigReader(object): """This class holds information on devices in the network This class holds information about people and their contact information: first- and last name, the cell phone number and the email address. """...
""" some utilities """ import os import sys import __main__ from twisted.python.filepath import FilePath from twisted.python.reflect import namedAny # from twisted.python.modules import theSystemPath def findPackagePath(modulePath): """ Try to find the sys.path entry from a modulePath object, simultaneously ...
""" Test view handler for rerun (and eventually create) """ import ddt from mock import patch from django.test.client import RequestFactory from django.core.urlresolvers import reverse from opaque_keys.edx.keys import CourseKey from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.module...
#!/usr/bin/env python # Image pipeline image1 = vtk.vtkTIFFReader() image1.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/beach.tif") # "beach.tif" image contains ORIENTATION tag which is # ORIENTATION_TOPLEFT (row 0 top, col 0 lhs) type. The TIFF # reader parses this tag and sets the internal TIFF image # orientation a...
"""Possible task states for instances. Compute instance task states represent what is happening to the instance at the current moment. These tasks can be generic, such as 'spawning', or specific, such as 'block_device_mapping'. These task states allow for a better view into what an instance is doing and should be disp...
import re import unittest from external.wip import work_in_progress from rmgpy.species import Species from .adjlist import ConsistencyChecker from .molecule import Molecule from .util import retrieveElementCount from .inchi import compose_aug_inchi, P_LAYER_PREFIX, P_LAYER_SEPARATOR, U_LAYER_PREFIX, U_LAYER_SEPARATOR ...