code
stringlengths
1
199k
"""A simple script for inspect checkpoint files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys import tensorflow as tf from tensorflow.contrib.learn.python.learn.utils import checkpoints FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string("f...
from .kafka import KafkaService from .util import TopicPartition from .config import KafkaConfig
from requestbuilder import Arg from euca2ools.commands.ec2 import EC2Request class AssociateRouteTable(EC2Request): DESCRIPTION = 'Associate a VPC route table with a subnet' ARGS = [Arg('RouteTableId', metavar='RTABLE', help='ID of the route table to associate (required)'), Arg('-s',...
from pyvex.expr import RdTmp, Get from .base import SimIRExpr from ..irop import translate from .... import sim_options as o from ....errors import UnsupportedIROpError, SimOperationError from ....state_plugins.sim_action import SimActionOperation, SimActionObject class SimIRExpr_Op(SimIRExpr): def _execute(self): ...
"""Contains the convolutional layer classes and their functional aliases. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from six.moves import xrange # pylint: disable=redefined-builtin import numpy as np from tensorflow.python.framework impo...
import time import uuid import random class TimeUnit: def __init__(self): self._start = time.time() self._elapsed_time = 0 def end(self): self._elapsed_time = time.time() - self._start def elapsed(self): return self._elapsed_time class Timer: def __init__(self, logfile="/...
from django.apps.registry import Apps from django.db import models from django.db.migrations.operations import ( AlterField, DeleteModel, RemoveField, ) from django.db.migrations.state import ( InvalidBasesError, ModelState, ProjectState, get_related_models_recursive, ) from django.test import SimpleTestCase, T...
from exec_util import exec_cmd import os def is_checkout(path): """ Returns true if the path represents a git checkout. """ return os.path.exists(os.path.join(path, '.git')) def get_hash(path = '.', branch = 'HEAD'): """ Returns the git hash for the specified branch/tag/hash. """ cmd = "git rev-parse %s" % (bra...
import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'plata.db', ...
from nipype.testing import assert_equal from nipype.interfaces.freesurfer.utils import SurfaceSmooth def test_SurfaceSmooth_inputs(): input_map = dict(args=dict(argstr='%s', ), cortex=dict(argstr='--cortex', usedefault=True, ), environ=dict(nohash=True, usedefault=True, ), fwhm=dict(...
from datetime import date from django.conf import settings from kitsune.kbadge.tests import BadgeFactory from kitsune.sumo.tests import TestCase from kitsune.users.tests import UserFactory from kitsune.wiki.badges import register_signals, WIKI_BADGES from kitsune.wiki.tests import ApprovedRevisionFactory, RevisionFacto...
""" Images Pipeline See documentation in topics/media-pipeline.rst """ import hashlib import six try: from cStringIO import StringIO as BytesIO except ImportError: from io import BytesIO from PIL import Image from scrapy.utils.misc import md5sum from scrapy.utils.python import to_bytes from scrapy.http import R...
""" survey - Assessment Data Analysis Tool For more details see the blueprint at: http://eden.sahanafoundation.org/wiki/BluePrint/SurveyTool/ADAT @todo: open template from the dataTables into the section tab not update @todo: in the pages that add a link to a template make the combobox display the l...
""" tests.helper ~~~~~~~~~~~~~ Helper method for writing tests. """ import os from datetime import timedelta from unittest import mock from homeassistant import core as ha, loader import homeassistant.util.location as location_util from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import ( ...
import os import re def write_file(path, data): wdata = data.rstrip() + "\n" with open(path, "w") as f: f.write(wdata) def append_file(path, data): wdata = data.rstrip() + "\n" with open(path, "a") as f: f.write(wdata) def read_file(path): data = None with open(path) as f: ...
''' The MIT License (MIT) GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi. Copyright (C) 2015 Dexter Industries Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to de...
__all__ = ['FlashStatusFilter','FlashStatusViewFilter'] from pyasm.common import SetupException from pyasm.biz import * from pyasm.web import * from pyasm.widget import * from pyasm.search import Search class FlashStatusFilter(Widget): def __init__(my, pipeline_name="dept"): my.pipeline_name = pipeline_name...
""" *************************************************************************** ModelerScene.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************************************************...
from PyQt4 import QtCore, QtGui from colors import Colors from demoitem import DemoItem class ScanItem(DemoItem): ITEM_WIDTH = 16 ITEM_HEIGHT = 16 def __init__(self, scene=None, parent=None): super(ScanItem, self).__init__(scene, parent) self.useSharedImage(__file__) def createImage(self...
import logging from autotest.client.shared import error from virttest import utils_misc @error.context_aware def run(test, params, env): """ KVM -no-shutdown flag test: 1. Boot a guest, with -no-shutdown flag on command line 2. Run 'system_powerdown' command in monitor 3. Wait for guest OS to shutdo...
""" *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, 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 3 of the License, or (at yo...
from decimal import Decimal class ComplexType(dict): _value = 'Value' def __repr__(self): return '{0}{1}'.format(getattr(self, self._value, None), self.copy()) def __str__(self): return str(getattr(self, self._value, '')) class DeclarativeType(object): def __init__(self, _hint=None, **kw...
from odoo import api, fields, models class PeopleRole(models.Model): """ CRM Reveal People Roles for People """ _name = 'crm.iap.lead.role' _description = 'People Role' name = fields.Char(string='Role Name', required=True, translate=True) reveal_id = fields.Char(required=True) color = fields.Int...
{ 'name': 'Journal Security', 'version': '8.0.1.0.0', 'category': 'Accounting', 'sequence': 14, 'summary': '', 'description': """ Journal Security ================ It creates a many2many field between journals and users. If you set users to journal or viceversa, then this journals and the relate...
def execute(): import webnotes from webnotes.utils.nestedset import rebuild_tree rebuild_tree('Account', 'parent_account') roots = webnotes.conn.sql(""" select lft, rgt, debit_or_credit, is_pl_account, company from `tabAccount` where ifnull(parent_account, '') = '' """, as_dict=1) for acc in roots: webnotes...
from coalib.core.Bear import Bear from coalib.settings.FunctionMetadata import FunctionMetadata class ProjectBear(Bear): """ This bear base class does not parallelize tasks at all, it runs on the whole file base provided. """ def __init__(self, section, file_dict): """ :param section...
import sys import signal import logging import tornado.web import tornado.ioloop import mist.io.sock log = logging.getLogger(__name__) def sig_handler(sig, frame): log.warning("SockJS-Tornado process received SIGTERM/SIGINT") for conn in list(mist.io.sock.CONNECTIONS): conn.on_close() tornado.ioloop...
""" Initialize the mako template lookup """ from django.conf import settings from . import add_lookup, clear_lookups def run(): """ Setup mako lookup directories. IMPORTANT: This method can be called multiple times during application startup. Any changes to this method must be safe for multiple callers ...
"""Test device_registry API.""" import pytest from homeassistant.components.config import device_registry from tests.common import mock_device_registry @pytest.fixture def client(hass, hass_ws_client): """Fixture that can interact with the config manager API.""" hass.loop.run_until_complete(device_registry.asyn...
class FakeDriver(): def __init__(self, first_arg=True): self.first_arg = first_arg class FakeDriver2(): def __init__(self, first_arg): self.first_arg = first_arg
"""Hierarchical Topographical Factor Analysis (HTFA) This implementation is based on the work in [Manning2014-1]_, [Manning2014-2]_, [AndersonMJ2016]_, and [Manning2018]_. .. [Manning2014-1] "Topographic factor analysis: a bayesian model for inferring brain networks from neural data", J. R. Manning, R. Ranganath,...
"""Utility for DM labels.""" def UpdateLabels(labels, labels_proto, update_labels=None, remove_labels=None): """Returns a list of label protos based on the current state plus edits. Args: labels: The current label values. labels_proto: The LabelEntry proto ...
from __future__ import print_function import time from upm import pyupm_grovemd as upmGrovemd def main(): I2C_BUS = upmGrovemd.GROVEMD_I2C_BUS I2C_ADDR = upmGrovemd.GROVEMD_DEFAULT_I2C_ADDR # Instantiate an I2C Grove Motor Driver on I2C bus 0 myMotorDriver = upmGrovemd.GroveMD(I2C_BUS, I2C_ADDR) # s...
import socket import sys from getopt import getopt, GetoptError def usage(): print ("Usage: %s [OPTION]\n" " --list list all hosts\n" " --host=HOST gives extra info" "about the specified host\n") % sys.argv[0] def list_hosts(): host_name = socket.gethostname() print "{ \...
import sys from pokemongo_bot.base_task import BaseTask from pokemongo_bot import inventory class CollectLevelUpReward(BaseTask): SUPPORTED_TASK_API_VERSION = 1 current_level = 0 previous_level = 0 def initialize(self): self._process_config() self.current_level = inventory.player().level...
""" Test the API of the symtable module. """ import symtable import unittest from test import test_support TEST_CODE = """ import sys glob = 42 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 x = 23 glob def internal(): ...
import unittest from flask import current_app from flask.ext.testing import TestCase from project import app class TestTestingConfig(TestCase): def create_app(self): app.config.from_object('project.config.TestingConfig') return app def test_app_is_testing(self): self.assertTrue(current_a...
import os import struct import sys import glob import shlex import re import subprocess if len(sys.argv) != 4: sys.stderr.write('''Usage: %s [implib-dir] [dll-dir] [identify-cmd] For each MinGW-style import library in implib-dir, locates the corresponding DLL in dll-dir and creates a .def file for it in implib-dir,...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import multiprocessing import os import tempfile from ansible import constants as C from ansible import context from ansible.errors import AnsibleError from ansible.executor.play_iterator import PlayIterator from ansible.executor.st...
import os import subprocess import tempfile from optparse import OptionParser parser = OptionParser() parser.add_option("-e", "--exe", dest="exe", help="xgettext executable location", default="xgettext/xgettext.exe" ) parser.add_option("-v", "--version", dest="version", help="MTA:SA ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- module: fortios_system_mobile_tunnel short_description: Configure Mob...
from __future__ import division, absolute_import, print_function from numpy.testing import TestCase, run_module_suite, assert_,\ assert_raises, assert_equal from numpy import random from numpy.compat import asbytes import numpy as np class TestBinomial(TestCase): def test_n_zero(self): # Tests the c...
from typing import Optional from . import events from .packet import QuicStreamFrame from .packet_builder import QuicDeliveryState from .rangeset import RangeSet class QuicStream: def __init__( self, stream_id: Optional[int] = None, max_stream_data_local: int = 0, max_stream_data_rem...
import sys import os from compat import ssubprocess _p = None def start_syslog(): global _p _p = ssubprocess.Popen(['logger', '-p', 'daemon.notice', '-t', 'sshuttle'], stdin=ssubprocess.PIPE) def stderr_to_syslog(): sys.stdout.flush() sys.stderr.fl...
"""PrograReader and ProgramEditor need to be able to read UserRole resources. Revision ID: 3e08ed6b47b8 Revises: 2785a204a673 Create Date: 2013-12-18 22:58:18.613406 """ revision = '3e08ed6b47b8' down_revision = '2785a204a673' import sqlalchemy as sa from alembic import op from datetime import datetime from sqlalchemy....
try: import simplejson as json except ImportError: import json from pecan.jsonify import GenericJSON import six __all__ = [ 'json_encode' ] def json_encode(obj, indent=4): return json.dumps(obj, cls=GenericJSON, indent=indent) def load_file(path): with open(path, 'r') as fd: return json.load...
from __future__ import unicode_literals from boxsdk.util.text_enum import TextEnum class MockTextEnum(TextEnum): member = 'member' def test_text_enum_repr_is_value(): assert MockTextEnum.member.__repr__() == MockTextEnum.member.value # pylint:disable=no-member def test_text_enum_str_is_value(): assert str(...
from __future__ import absolute_import, division, print_function INCLUDES = """ """ TYPES = """ typedef struct dh_st { /* Prime number (shared) */ BIGNUM *p; /* Generator of Z_p (shared) */ BIGNUM *g; /* Private DH value x */ BIGNUM *priv_key; /* Public DH value g^x */ BIGNUM *pub_key; ...
""" Tests for pika.connection.Connection """ try: import mock except ImportError: from unittest import mock import random import urllib import copy try: import unittest2 as unittest except ImportError: import unittest from pika import connection from pika import channel from pika import credentials from...
from translate.lang import factory def test_punctranslate(): """Tests that we can translate punctuation.""" language = factory.getlanguage('vi') assert language.punctranslate(u"") == u"" assert language.punctranslate(u"abc efg") == u"abc efg" assert language.punctranslate(u"abc efg.") == u"abc efg."...
from django.http import HttpResponse from climatedata.models import Archive from django.shortcuts import render_to_response import logging logger = logging.getLogger(__name__) def index(request): logger.debug("just testing...") logger.info("just testing...") logger.error("just testing...") return render...
from __future__ import division, absolute_import, print_function import sys import warnings import itertools import platform import pytest from decimal import Decimal import numpy as np from numpy.core import umath from numpy.random import rand, randint, randn from numpy.testing import ( assert_, assert_equal, asse...
hiddenimports = ["mitmproxy.script"]
try: # py 3.4 from html import unescape as unescape_html except ImportError: import re from html.entities import entitydefs def unescape_html(string): '''HTML entity decode''' string = re.sub(r'&#[^;]+;', _sharp2uni, string) string = re.sub(r'&[^;]+;', lambda m: entitydefs[m....
def get_number_of_copies(recid): """ Searches inside crcITEM for the number of appearances of recid @param recid: @return: Number of copies """ from invenio.legacy.dbquery import run_sql if recid: try: return run_sql('SELECT COUNT(*) FROM crcITEM WHERE id_bibrec=%s', (rec...
from deluge.ui.client import client from deluge.ui.console.main import BaseCommand from twisted.internet import reactor class Command(BaseCommand): """Exit from the client.""" aliases = ['exit'] interactive_only = True def handle(self, *args, **options): if client.connected(): def on...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = """ --- module: openvswitch_db author: "Mark Hamilton (mhamilton@vmware.com)" v...
from .core import Dtool_funcToMethod from direct.directnotify.DirectNotifyGlobal import directNotify CInterval.DtoolClassDict["notify"] = directNotify.newCategory("Interval") def setT(self, t): # Overridden from the C++ function to call privPostEvent # afterward. We do this by renaming the C++ function in ...
import re from django.utils.regex_helper import _lazy_re_compile hex_regex = _lazy_re_compile(r'^[0-9A-F]+$', re.I) wkt_regex = _lazy_re_compile( r'^(SRID=(?P<srid>\-?\d+);)?' r'(?P<wkt>' r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|' r'MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)' ...
import datetime import logging import os from telemetry.page import page_measurement from metrics import network class ChromeProxyMetricException(page_measurement.MeasurementFailure): pass CHROME_PROXY_VIA_HEADER = 'Chrome-Compression-Proxy' CHROME_PROXY_VIA_HEADER_DEPRECATED = '1.1 Chrome Compression Proxy' PROXY_SE...
''' @author Fabio Zadrozny ''' import sys import pytest from _pydev_imps._pydev_saved_modules import thread start_new_thread = thread.start_new_thread IS_PYTHON_3_ONWARDS = sys.version_info[0] >= 3 IS_JYTHON = sys.platform.find('java') != -1 try: import __builtin__ #@UnusedImport BUILTIN_MOD = '__builtin__' exc...
''' * jQuery JavaScript Library v1.4.2 * http://jquery.com/ * * Copyright 2010, John Resig * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Includes Sizzle.js * http://sizzlejs.com/ * Copyright 2010, The Dojo Foundation * Released under the MIT, BSD, and GPL Licenses. ...
from gnuradio import gr, gr_unittest import blocks_swig as blocks import math def sig_source_f(samp_rate, freq, amp, N): t = map(lambda x: float(x)/samp_rate, xrange(N)) y = map(lambda x: amp*math.cos(2.*math.pi*freq*x), t) return y def sig_source_c(samp_rate, freq, amp, N): t = map(lambda x: float(x)/s...
import tools from osv import fields,osv class hr_holidays_remaining_leaves_user(osv.osv): _name = "hr.holidays.remaining.leaves.user" _description = "Total holidays by type" _auto = False _columns = { 'name': fields.char('Employee', size=64), 'no_of_leaves': fields.integer('Remaining lea...
from __future__ import absolute_import, print_function, division from operator import itemgetter import numpy as np from sklearn.base import ClusterMixin, TransformerMixin from . import MultiSequenceClusterMixin from . import _kmedoids from .. import libdistance from ..base import BaseEstimator class _KMedoids(ClusterM...
"""Test utils for Ironic Managers.""" import pkg_resources from stevedore import dispatch from ironic.common import driver_factory def mock_the_extension_manager(driver="fake", namespace="ironic.drivers"): """Get a fake stevedore NameDispatchExtensionManager instance. :param namespace: A string representing the...
""" pygments.lexers.sql ~~~~~~~~~~~~~~~~~~~ Lexers for various SQL dialects and related interactive sessions. Postgres specific lexers: `PostgresLexer` A SQL lexer for the PostgreSQL dialect. Differences w.r.t. the SQL lexer are: - keywords and data types list parsed from the...
from __future__ import absolute_import, unicode_literals from django.apps import AppConfig class WagtailSettingsAppConfig(AppConfig): name = 'wagtail.contrib.settings' label = 'wagtailsettings' verbose_name = "Wagtail site settings"
from __future__ import unicode_literals from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.views import shortcut from django.contrib.sites.models import Site, get_current_site from django.http import HttpRequest, Http404 from django.test import TestC...
"""Provides interfaces to various commands provided by diffusion toolkit Change directory to provide relative paths for doctests >>> import os >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) >>> os.chdir(datadir) ...
import re,urlparse,urllib2 from liveresolver.modules import client from liveresolver.modules import rowbalance,decryptionUtils,constants from liveresolver.modules.log_utils import log import urllib import xbmcgui,xbmc,os,xbmcaddon import requests path=xbmcaddon.Addon().getAddonInfo("path") captcha_img = os.path.join(pa...
"""empty message Revision ID: 623663663ec8 Revises: b96384251d86 Create Date: 2016-06-15 14:19:31.702806 """ revision = '623663663ec8' down_revision = 'b96384251d86' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ### commands auto generated by Alembic - please adjust! ### ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import pipes import ansible.constants as C import time import random _USER_HOME_PATH_RE = re.compile(r'^~[_.A-Za-z0-9][-_.A-Za-z0-9]*$') class ShellModule(object): # How to end lines in a python script one-li...
from math import log def getDigit(num, base, digit_num): # pulls the selected digit return (num // base ** digit_num) % base def makeBlanks(size): # create a list of empty lists to hold the split by digit return [ [] for i in range(size) ] def split(a_list, base, digit_num): buckets = makeBlanks(bas...
""" A utility that expects JSON data at a particular URL and lets you recursively extract keys from the JSON object as specified on the command line (each argument on the command line after the first will be used to recursively index into the JSON object). The name is a play off of 'curl'. """ import json import sys im...
import copy import mock import testtools from nova import test from nova.tests.functional import api_samples_test_base class TestCompareResult(test.NoDBTestCase): """Provide test coverage for result comparison logic in functional tests. _compare_result two types of comparisons, template data and sample ...
""" This sphinx extension adds two directives for summarizing the public members of a module or package. These directives are primarily for use with the `automodapi`_ extension, but can be used independently. .. _automodsumm: ======================= automodsumm directive ======================= This directive will prod...
""" USAGE: $ python -m gensim.scripts.word2vec2tensor --input <Word2Vec model file> --output <TSV tensor filename prefix> [--binary] <Word2Vec binary flag> Where: <Word2Vec model file>: Input Word2Vec model <TSV tensor filename prefix>: 2D tensor TSV output file name prefix <Word2Vec binary flag>: Set True ...
CLIENT_ID = 'chaneme' CLIENT_SECRET = 'changeme' EXPIRY_TIME = 60 * 60 * 24 * 175 # 175 days REFRESH_TIME = 5 * 60 # 5 minutes OAUTH_SCOPE = [ 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/drive', ] OAUTH_BASE_URL = 'https://accounts.google.com/o/oauth2/' API_BASE_URL = ...
from __future__ import division, print_function, absolute_import import warnings import numpy as np from numpy import array from numpy.testing import (assert_array_almost_equal, assert_array_equal, run_module_suite, assert_raises, assert_allclose, assert_equal, asse...
class StagedObject: """ Use this class as a mixin to provide an interface for onStage/offStage objects. The idea here is that a DistributedObject could be present and active due to simple visibility, but we want to hide or otherwise disable it for some reason. """ UNKNOWN = -1 OFF = 0 ...
''' SelectableDataItem ================== .. versionadded:: 1.5 .. deprecated:: 1.10.0 The feature has been deprecated. .. warning:: This code is still experimental, and its API is subject to change in a future version. Data Models ----------- Kivy is open about the type of data used in applications built w...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: opendj_backendprop short_description: Will update the backend configuration of OpenDJ via the dsconfig set-backend-prop command. description: - Th...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: elb_application_lb_info short_description: Gather information a...
from __future__ import print_function, division from collections import defaultdict from sympy.core import (Basic, S, Add, Mul, Pow, Symbol, sympify, expand_mul, expand_func, Function, Dummy, Expr, factor_terms, symbols, expand_power_exp) from sympy.core.compatibility import (iterable, ordered, range, a...
import random import unittest from mock import MagicMock as Mock import pyrax.exceptions as exc from pyrax import manager import pyrax.utils as utils from pyrax import fakes fake_url = "http://example.com" class ManagerTest(unittest.TestCase): def __init__(self, *args, **kwargs): super(ManagerTest, self).__...
''' Neo is a package for representing electrophysiology data in Python, together with support for reading a wide range of neurophysiology file formats ''' import logging logging_handler = logging.StreamHandler() from neo.core import * from neo.io import * from neo.version import version as __version__
""" test views """ import datetime import json import re import pytz import ddt from mock import patch, MagicMock from nose.plugins.attrib import attr from capa.tests.response_xml_factory import StringResponseXMLFactory from courseware.courses import get_course_by_id # pyline: disable=import-error from courseware.fiel...
""" Python program to authenticate and print a friendly encouragement to joining the community! """ import atexit import argparse import getpass from pyVim import connect from pyVmomi import vmodl def get_args(): """Get command line args from the user. """ parser = argparse.ArgumentParser( descripti...
from __future__ import unicode_literals from django.utils import unittest from django.utils.encoding import force_bytes class TestEncodingUtils(unittest.TestCase): def test_force_bytes_exception(self): """ Test that force_bytes knows how to convert to bytes an exception containing non-ASCII ...
"""Helper functions for commonly used utilities.""" import base64 import calendar import datetime import six from six.moves import urllib CLOCK_SKEW_SECS = 300 # 5 minutes in seconds CLOCK_SKEW = datetime.timedelta(seconds=CLOCK_SKEW_SECS) def copy_docstring(source_class): """Decorator that copies a method's docst...
""" Common Policy Engine Implementation Policies can be expressed in one of two forms: A list of lists, or a string written in the new policy language. In the list-of-lists representation, each check inside the innermost list is combined as with an "and" conjunction--for that check to pass, all the specified checks mus...
from . import purchase_order from . import sale_order
import operator from deap import base from deap import creator from deap import gp from deap import tools pset = gp.PrimitiveSet("MAIN", arity=1) pset.addPrimitive(operator.add, 2) pset.addPrimitive(operator.sub, 2) pset.addPrimitive(operator.mul, 2) creator.create("FitnessMin", base.Fitness, weights=(-1.0,)) creator.c...
from __future__ import division from sympy.physics.optics.utils import (refraction_angle, deviation, lens_makers_formula, mirror_formula, lens_formula) from sympy.physics.optics.medium import Medium from sympy.physics.units import e0 from sympy import symbols, sqrt, Matrix, oo from sympy.geometry.point3d import Poi...
from sympy.core.assumptions import StdFactKB from sympy.core import S, Pow from sympy.core.expr import AtomicExpr from sympy import diff as df, sqrt, ImmutableMatrix as Matrix from sympy.vector.coordsysrect import CoordSysCartesian from sympy.vector.basisdependent import BasisDependent, \ BasisDependentAdd, BasisD...
from setuptools import setup, find_packages NAME = "autorestheadexceptiontestservice" VERSION = "1.0.0" REQUIRES = ["msrestazure>=0.4.7"] setup( name=NAME, version=VERSION, description="AutoRestHeadExceptionTestService", author_email="", url="", keywords=["Swagger", "AutoRestHeadExceptionTestSer...
from __future__ import unicode_literals import frappe from frappe.model.document import Document import gocardless_pro from frappe import _ from six.moves.urllib.parse import urlencode from frappe.utils import get_url, call_hook_method, flt, cint from frappe.integrations.utils import create_request_log, create_payment_...
import copy import mock from mock import patch import shutil import lxml.html from lxml import etree import ddt from datetime import timedelta from fs.osfs import OSFS from json import loads from path import Path as path from textwrap import dedent from uuid import uuid4 from functools import wraps from unittest import...
"""Logging support for Tornado. Tornado uses three logger streams: * ``tornado.access``: Per-request logging for Tornado's HTTP servers (and potentially other servers in the future) * ``tornado.application``: Logging of errors from application code (i.e. uncaught exceptions from callbacks) * ``tornado.general``: Ge...