content
string
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/...
from django.template import loader, RequestContext from django.http import HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, HttpResponseGone from django.utils.log import getLogger import warnings warnings.warn( 'Function-based generic views have been deprecated; use class-based views instead.', ...
"""TODO.""" from enum import Enum import UBX def isObj(obj, cls): """Test if UBX message obj is of class cls.""" return obj._class == cls._class and obj._id == cls._id def isACK(obj): """Test whether message obj is a ACK.""" return isObj(obj, UBX.ACK.ACK) def isNAK(obj): """Test whether messag...
# -*- coding: utf-8 -*- import os from ._compat import itervalues from ._globals import GLOBAL_LOCKER, THREAD_LOCAL from ._load import OrderedDict from .helpers._internals import Cursor class ConnectionPool(object): POOLS = {} check_active_connection = True def __init__(self): _iid_ = str(id(self...
""" Collect status information for Windows services """ # project from checks import AgentCheck from checks.wmi_check import WinWMICheck from utils.containers import hash_mutable from utils.timeout import TimeoutException class WindowsService(WinWMICheck): STATE_TO_VALUE = { 'Stopped': AgentCheck.CRITICAL...
"""Tests for contrib.copy_graph.python.util.copy.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.copy_graph.python.util import copy_elements from tensorflow.contrib.framework.python.framework import tensor_util ...
#! /usr/bin/env python from pygments.lexer import RegexLexer from pygments.token import * class CapnpLexer(RegexLexer): name = "Cap'n Proto lexer" aliases = ['capnp'] filenames = ['*.capnp'] tokens = { 'root': [ (r'#.*?$', Comment.Single), (r'@[0-9a-zA-Z]*', Name.Decor...
"""PID providers.""" from __future__ import absolute_import, print_function from invenio_pidstore.providers.base import BaseProvider from invenio_pidstore.models import PIDStatus class CustomRecordProvider(BaseProvider): """Record identifier provider.""" pid_type = 'custid' """Type of persistent identi...
#!/usr/bin/env python # encoding: utf-8 """ connection.py Created by Thomas Mangin on 2013-07-13. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ import os import sys import unittest from exabgp.util.od import od def test (): OPEN = ''.join([chr(int(_,16)) for _ in "FF FF FF FF FF FF FF FF FF FF FF ...
# -*- coding: utf-8 -*- """ New Zealand specific form helpers """ from __future__ import unicode_literals import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from django.utils.encoding import smart_str from djang...
# -- coding: utf-8 -- # Note that we import as `DjangoRequestFactory` and `DjangoClient` in order # to make it harder for the user to import the wrong thing without realizing. from __future__ import unicode_literals from django.conf import settings from django.test import testcases from django.test.client import Clie...
import sys import os import IMP import IMP.em import IMP.test import IMP.core import IMP.atom import IMP.multifit class Tests(IMP.test.TestCase): """Test connected components """ def setUp(self): """Build test model and optimizer""" IMP.test.TestCase.setUp(self) IMP.set_log_level(IMP...
#!/usr/bin/env python class Alignment: def __init__(self): self.qname = "" self.tname = "" self.qstat = 0 self.qend = 0 self.qstrand = 0 self.qlen = 0 self.tstart = 0 self.tend = 0 self.tstrand = 0 self.tlen = 0 self.score...
""" Expose each GPU device directly """ from __future__ import print_function, absolute_import, division import functools from numba import servicelib from .driver import hsa as driver, Context as _Context class _culist(object): """A thread local list of GPU instances """ def __init__(self): self...
import sys, getopt, os # Custom modules. from cluster_actions import * def main(argv): action = "" cluster_file_name = "" deploy_path = "" try: opts, args = getopt.getopt(argv, "a:c:d:h", ["action=", "deploy_path="]) except getopt.GetoptError: print 'The file options for clust...
from __future__ import absolute_import import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. ...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, 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 Lic...
import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt import pylab as pl import numpy as np import os import sys from glob import glob import argparse import scipy from scipy import interpolate import inspect import csv # Issues: Done nothing with MAD def lineno(): ''' Get current line number ...
""" Mail sending helpers See documentation in docs/topics/email.rst """ import logging from six.moves import cStringIO as StringIO import six from email.utils import COMMASPACE, formatdate from six.moves.email_mime_multipart import MIMEMultipart from six.moves.email_mime_text import MIMEText from six.moves.email_mim...
"""INSPIRE authors.""" from __future__ import absolute_import, division, print_function from .ext import INSPIRELiteratureSuggestion # noqa: F401
# Test that locks work when cancelling multiple waiters on the lock try: import uasyncio as asyncio except ImportError: try: import asyncio except ImportError: print("SKIP") raise SystemExit async def task(i, lock, lock_flag): print("task", i, "start") try: await l...
__author__ = 'traviswarren' from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from train_track.apps.profile.models import UserProfileEvent from train_track.tests.model_factory import UserProfileEventFactory class EventGetDeleteViewTestCases(Tes...
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_...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_str, ) from ..utils import ( int_or_none, ExtractorError, ) class VubeIE(InfoExtractor): IE_NAME = 'vube' IE_DESC = 'Vube.com' _VALID_URL = r'https?://vube\.com/(?:[^/]+/)+(?P<id...
# -*- coding: utf-8 -*- """ werkzeug ~~~~~~~~ Werkzeug is the Swiss Army knife of Python web development. It provides useful classes and functions for any WSGI application to make the life of a python web developer much easier. All of the provided classes are independent from each other so yo...
import urllib2 from StringIO import StringIO import gzip import cookielib import time class NZBDownloader(object): def __init__( self ): self.cj = cookielib.CookieJar() self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj)) self.lastRequestTime = None ...
""" parser.http.searchCompanyParser module (imdb package). This module provides the HTMLSearchCompanyParser class (and the search_company_parser instance), used to parse the results of a search for a given company. E.g., when searching for the name "Columbia Pictures", the parsed page would be: http://akas.imdb.co...
import os import sys from itertools import groupby from operator import itemgetter SEPARATOR = "\t" class Streaming(object): @staticmethod def get_job_conf(name): name = name.replace(".", "_").upper() return os.environ.get(name) def __init__(self, infile=sys.stdin, separator=SEPARATOR):...
from mi.instrument.seabird.sbe37smb.ooicore.driver import NEWLINE SAMPLE_DS = "SBE37-SMP V 2.6 SERIAL NO. 2165 05 Feb 2013 19:11:43" + NEWLINE + \ "not logging: received stop command" + NEWLINE + \ "sample interval = 20208 seconds" + NEWLINE + \ "samplenumber = 0, free = 200000" ...
# -*- coding: utf-8 -*- """This module contains some math and statistics functions. In the future plan: Eigenvalue, Inverse, Matrix Multiplication, SVD, PCA """ __author__ = 'Wenzhi Mao' __all__ = ['isSquare', 'ANOVA', 'performRegression', 'performPolyRegression'] def isSquare(x): """It is a...
from datetime import datetime, timedelta import random from urlparse import urljoin import werkzeug from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT, ustr from ast import literal_eval from openerp.t...
import unittest import dns.set # for convenience S = dns.set.Set class SimpleSetTestCase(unittest.TestCase): def testLen1(self): s1 = S() self.failUnless(len(s1) == 0) def testLen2(self): s1 = S([1, 2, 3]) self.failUnless(len(s1) == 3) def testLen3(self): s1 = S...
import ctypes.util import types import logging.handlers from typeutils.TypeChecker import require # Copyright (c) 2010 Siddhu Warrier (http://siddhuwarrier.homelinux.org, # siddhuwarrier AT gmail DOT com). # # This file is part of the xkb package. # The xkb package is free software: you can redistribute it and/or m...
"""Tests for tensorflow.ops.math_ops.matrix_solve.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.client import session from tensorflow.python.framework import constant_op from tensorflow.python.framework impor...
import hashlib import warnings import logging import unittest import ssl from itertools import chain from mock import patch, Mock from urllib3 import add_stderr_logger, disable_warnings from urllib3.util.request import make_headers from urllib3.util.timeout import Timeout from urllib3.util.url import ( get_host, ...
### Author: Bert de Bruijn <bert+dstat$debruijn,be> ### VMware memory stats ### Displays memory stats coming from the hypervisor inside VMware VMs. ### The vmGuestLib API from VMware Tools needs to be installed class dstat_plugin(dstat): def __init__(self): self.name = 'vmware memory' self.vars = ...
import numpy as np import chainladder as cl from rpy2.robjects.packages import importr from rpy2.robjects import r CL = importr("ChainLadder") def test_mcl_paid(): df = r("MunichChainLadder(MCLpaid, MCLincurred)").rx("MCLPaid") p = cl.MunichAdjustment(paid_to_incurred=("paid", "incurred")).fit( cl.De...
from openerp import tools from openerp.addons.crm import crm from openerp.osv import fields, osv AVAILABLE_STATES = [ ('draft', 'Draft'), ('open', 'Todo'), ('cancel', 'Cancelled'), ('done', 'Held'), ('pending', 'Pending') ] class crm_phonecall_report(osv.osv): """ Phone calls by user and sect...
# Definition for a point class Point: def __init__(self, a=0, b=0): self.x = a self.y = b class Solution: # @param points, a list of Points # @return an integer def maxPoints(self, points): result = 0 for i in xrange(len(points)): d = {} duplicate...
def use_azure_secret(secret_name='azcreds'): """An operator that configures the container to use Azure user credentials. The azcreds secret is created as part of the kubeflow deployment that stores the client ID and secrets for the kubeflow azure service principal. With this service princi...
from __future__ import with_statement import collections import errno import filecmp import os.path import re import tempfile import sys # A minimal memoizing decorator. It'll blow up if the args aren't immutable, # among other "problems". class memoize(object): def __init__(self, func): self.func = func s...
import os import subprocess def cpp_demangle(name): return subprocess.check_output(['c++filt', name]).decode('utf-8').strip() def split_identifier(identifier): """Splits string at _ or between lower case and uppercase letters.""" prev_split = 0 parts = [] if '_' in identifier: parts = [...
""" Test reporter forwarding test results over trial distributed AMP commands. @since: 12.3 """ from twisted.python.failure import Failure from twisted.python.reflect import qual from twisted.trial.reporter import TestResult from twisted.trial._dist import managercommands class WorkerReporter(TestResult): """ ...
from commando.conf import AutoProp, ConfigDict class TestClass(AutoProp): @AutoProp.default def source(self): return 'source' def test_auto(): t = TestClass() assert t.source == 'source' def test_override(): t = TestClass() t.source = 'source1' assert t.source == 'source1' ...
import time from openerp.osv import fields, osv class hr_salary_employee_bymonth(osv.osv_memory): _name = 'hr.salary.employee.month' _description = 'Hr Salary Employee By Month Report' _columns = { 'start_date': fields.date('Start Date', required=True), 'end_date': fields.date('End Date',...
""" **Contains** * Medium """ from __future__ import division __all__ = ['Medium'] from sympy import Symbol, sympify, sqrt from sympy.physics.units import c, u0, e0 class Medium(Symbol): """ This class represents an optical medium. The prime reason to implement this is to facilitate refraction, Fermat...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.playbook.attribute import FieldAttribute from ansible.playbook.base import Base class LoopControl(Base): _loop_var = FieldAttribute(isa='str') _label = FieldAttribute(isa='str') _pause = FieldAttribute(i...
"""Support for Nexia / Trane XL Thermostats.""" from nexia.const import UNIT_CELSIUS from homeassistant.const import ( DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT, ) from .const import DOMAIN, NEXIA_DEVICE, UPDATE_COORDINATOR from .entity import Nexi...
import contextlib import mock from neutron.common import constants from neutron import context from neutron.db.vpn import vpn_validator from neutron import manager from neutron.plugins.common import constants as p_constants from neutron.services.vpn.service_drivers import ipsec as ipsec_driver from neutron.tests.unit...
from builtins import range import numpy as np from lib.transition import Transition from lib.buffer_utils import BufferUtils, struct_flat class FixtureStep(Transition): """ """ def __init__(self, app): Transition.__init__(self, app) def __str__(self): return "Fixture Step" def ...
from pyanaconda.core.signal import Signal from pyanaconda.core.dbus import DBus from pyanaconda.core.storage import blivet_version from pyanaconda.modules.common.base import KickstartService from pyanaconda.modules.common.constants.services import STORAGE from pyanaconda.modules.common.containers import TaskContainer f...
from spack import * class Muparser(Package): """C++ math expression parser library.""" homepage = "http://muparser.beltoforion.de/" url = "https://github.com/beltoforion/muparser/archive/v2.2.5.tar.gz" version('2.2.6.1', sha256='d2562853d972b6ddb07af47ce8a1cdeeb8bb3fa9e8da308746de391db67897b3') ...
import numpy as np import paddle.fluid.core as core from paddle.fluid.framework import Program from paddle.fluid.executor import global_scope class Float16Transpiler: def transpile(self, program, place, scope=None): ''' Transpile the program desc and cast the weights to float16 data type to ...
"""End-to-end tests for traffic control library.""" import os import re import sys import unittest import traffic_control class TrafficControlTests(unittest.TestCase): """System tests for traffic_control functions. These tests require root access. """ # A dummy interface name to use instead of real interfac...
from openerp.osv import fields, osv class account_analytic_journal(osv.osv): _name = 'account.analytic.journal' _description = 'Analytic Journal' _columns = { 'name': fields.char('Journal Name', required=True), 'code': fields.char('Journal Code', size=8), 'active': fields.boolean('A...
# -*- 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): # Changing field 'Project.num_point' db.alter_column('projects_project', 'num_point', self.gf('django.db.mo...
#! /usr/bin/env python from contextlib import closing import os, sys, subprocess, re, textwrap def loadFile(path): with closing( open(path) ) as fd: return fd.read() def writeFile(path, buffer): with closing( open(path, "w") ) as fd: fd.write(buffer) def splitSections(buffer): while buffer: assert...
from .results import BaseQueryResults from .func import Count from ..base.helper import key_for_cypher, value_for_cypher class BaseQuery(object): query_template = '''{match} {where} {optional_match} {with} {return}''' delete_template = '''DETACH DELETE {alias}''' aggregate_template = ''...
from optparse import make_option from django.core.management.base import AppCommand, CommandError from django.core.management.color import no_style from django.core.management.sql import sql_reset from django.db import connections, transaction, DEFAULT_DB_ALIAS class Command(AppCommand): option_list = AppCommand....
#!/usr/bin/python # created by shead import sys import numpy as np import matplotlib.pyplot as plt import pylab """ USAGE ============ ./plotter.py [log] ./plotter.py my_log.log REQUIRED DEPENDENCIES ============ * Python2 * Matplot http://matplotlib.org/users/installing.html FILE FORMAT ============ [iterat...
from meshless.espim.plate2d_add_k0s_cell_based import add_k0s as add_k0s_cell from meshless.espim.plate2d_add_k0s_cell_based_no_smoothing import add_k0s as add_k0s_cell_no_smoothing from meshless.espim.plate2d_add_k0s_edge_based import add_k0s as add_k0s_edge def add_k0s(k0, mesh, prop_from_node, method='cell-based', ...
from django import template from django.template import defaultfilters as filters from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from horizon import tables from horizon.utils import filters as utils_filters SERVICE_ENABLED = "enabled" SERVICE_DISABLED = "di...
""" Tests for testing the modulestore settings migration code. """ import copy import ddt from tempfile import mkdtemp from unittest import TestCase from xmodule.modulestore.modulestore_settings import ( convert_module_store_setting_if_needed, update_module_store_settings, get_mixed_stores, ) @ddt.ddt cl...
import unittest from hustle.core.column_fn import ip_ntoa from hustle.core.pipeline import SelectPipe, _get_sort_range from hustle.core.marble import Marble from operator import itemgetter EMP_FIELDS = ("+@2id", "+$name", "+%2hire_date", "+@4salary", "+@2department_id") DEPT_FIELDS = ("+@2id", "+%2name", "+%2building...
import os import tempfile from selenium.webdriver.common import service class Service(service.Service): """ Object that manages the starting and stopping of PhantomJS / Ghostdriver """ def __init__(self, executable_path, port=0, service_args=None, log_path=None): """ Creates a new ins...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class SimplePage(page_module.Page): def __init__(self, url, page_set): super(SimplePage, self).__init__( url=url, page_set=page_set, credentials_path='data/credentials.json') self.a...
""" Test Iterator Length Transparency Some functions or methods which accept general iterable arguments have optional, more efficient code paths if they know how many items to expect. For instance, map(func, iterable), will pre-allocate the exact amount of space required whenever the iterable can report its length. T...
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <<EMAIL>> from __future__ import print_function from capstone import * import binascii from xprint import to_x, to_hex, to_x_32 X86_CODE32 = b"\x8d\x4c\x32\x08\x01\xd8\x81\xc6\x34\x12\x00\x00\x00\x91\x92" RANDOM_CODE = b"\xed\x00\x00\x00\x00\x1a...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
import datetime class Participant: def __init__(self): self.name = "" self.isStillIn = True self.hasCheckedIn = False self.relapseDate = None @property def hasRelapsed(self): return self.relapseDate is not None def setFromLine(self, lineString): # form...
import struct import unittest from collections import OrderedDict from oppy.cell.fixedlen import ( FixedLenCell, Create2Cell, Created2Cell, CreatedFastCell, CreatedCell, CreateFastCell, CreateCell, DestroyCell, EncryptedCell, NetInfoCell, PaddingCell, ) from oppy.cell.util ...
""".""" import time as _time import numpy as _np from epics import PV from apsuite.optimization import SimulAnneal from siriuspy.devices import Tune, TuneCorr, CurrInfoSI from ..utils import MeasBaseClass as _BaseClass, \ ParamsBaseClass as _ParamsBaseClass class InjSIParams(_ParamsBaseClass): """.""" de...
import sys from command import Command from git_command import git from progress import Progress class Abandon(Command): common = True helpSummary = "Permanently abandon a development branch" helpUsage = """ %prog <branchname> [<project>...] This subcommand permanently abandons a development branch by deleting ...
""" classes to manage the cfme test framework configuration """ import os import warnings import attr import yaycl class Configuration(object): """ holds the current configuration """ def __init__(self): self.yaycl_config = None def configure(self, config_dir, crypt_key_file=None): ...
import os import stat import fnmatch import time import re import shutil def pfilter(f, patterns=None): '''filter using glob patterns''' if patterns is None: return True for p in patterns: if fnmatch.fnmatch(f, p): return True return False def agefilter(st, now, age, tim...
import time from gettext import ngettext import online import game import connection from config import config heartbeat_timeout = 5 def heartbeat(): # idle timeout if config.idle_timeout: now = time.time() for u in online.online: if (now - u.session.last_command_time > config.idl...
"""Tests which set DEBUG_SAVEALL and assert no garbage was created. This flag seems to be sticky, so these tests have been isolated for now. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.eager import context from tensorflow.pyt...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible import constants as C from ansible.inventory.group import Group from ansible.utils.vars import combine_vars __all__ = ['Host'] class Host: ''' a single ansible host ''' #__slots__ = [ 'name', 'vars', 'groups...
""" Oracle database specific implementations of changeset classes. """ import sqlalchemy as sa from sqlalchemy.databases import oracle as sa_base from migrate import exceptions from migrate.changeset import ansisql, SQLA_06 if not SQLA_06: OracleSchemaGenerator = sa_base.OracleSchemaGenerator else: Oracle...
import re from ansible.module_utils._text import to_text from ansible.module_utils.basic import env_fallback, return_values from ansible.module_utils.network_common import to_list, ComplexList from ansible.module_utils.connection import exec_command from ansible.module_utils.netcfg import NetworkConfig, ConfigLine _D...
""" Weak references to bound and unbound methods. """ import weakref class DeadMethodCalled(Exception): """ Raised by L{WeakMethod} if it is called when the referenced object is already dead. """ pass class WeakMethod(object): """ Do not create this class directly; use L{ref()} instead. ...
# -*- coding: utf8 -*- """Tests for distutils.dist.""" import os import StringIO import sys import unittest import warnings import textwrap from distutils.dist import Distribution, fix_help_options from distutils.cmd import Command import distutils.dist from test.test_support import TESTFN, captured_stdout, run_unitt...
from setuptools import setup setup(name='django-easyrest', version='0.0.2', description='An ultra-lightweight read-only REST api framework for Django', author='Suneel Chakravorty', author_email='<EMAIL>', url='https://github.com/suneel0101/django-restroom', packages=['easyrest'], ...
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 = r'j \d\e F \d\e Y' TIME_FORMAT = 'H:i' DATETIME_FORMAT = r'j \d\e F \d\e Y à\s H:i' YEAR_MONTH_FORMAT = r'F \d\e Y' MONTH_DAY_FORMAT = ...
#!/usr/bin/env python # encoding: utf-8 import socket import threading from hashlib import sha1 from random import randint from struct import unpack from socket import inet_ntoa from threading import Timer, Thread from time import sleep from collections import deque from bencode import bencode, bdecode from Queue impo...
# -*- coding: UTF-8 -*- import html from outwiker.gui.guiconfig import GeneralGuiConfig from outwiker.core.system import getOS class HtmlReport (object): """ Класс для генерации HTML-а, для вывода найденных страниц """ def __init__(self, pages, searchPhrase, searchTags, application): """ ...
""" Copyright (C) MX4J. All rights reserved. This software is distributed under the terms of the MX4J License version 1.0. See the terms of the MX4J License in the documentation provided with this software. author <a href="mailto:<EMAIL>">Carlos Quiroz</a> version $Revision: 1.1 $ Adapted by Martin F...
from __future__ import print_function import unittest import paddle.fluid as fluid import numpy as np from threading import Thread def feed_data(feed_queue, inputs): for in_data in inputs: feed_queue.push(in_data) class TestPyReader(unittest.TestCase): def setUp(self): self.capacity = 10 ...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(3, 2), ()], 'dtype': [numpy.float16, numpy.float32, ...
from datetime import date, datetime from django.forms import ( DateField, Form, HiddenInput, SelectDateWidget, ValidationError, ) from django.test import SimpleTestCase, override_settings from django.utils import translation class GetDate(Form): mydate = DateField(widget=SelectDateWidget) class DateFieldTe...
from django.test import TestCase from django.test.utils import override_settings from django_dynamic_fixture import get from django_dynamic_fixture import fixture from readthedocs.builds.constants import LATEST from readthedocs.projects.models import Project from readthedocs.redirects.models import Redirect import l...
from common.exceptions import InvocationException from common.hgraph.hgraph import Hgraph from common.cfg import NonterminalLabel from lib.tree import Tree import re from collections import defaultdict as ddict import itertools from parser.vo_rule import Rule import sys DEFAULT_COMPOSITION_DEPTH = 3 class ExtractorSy...
from typing import Dict, Optional from kubernetes import client from airflow.exceptions import AirflowException from airflow.providers.cncf.kubernetes.hooks.kubernetes import KubernetesHook from airflow.sensors.base import BaseSensorOperator from airflow.utils.decorators import apply_defaults class SparkKubernetesS...
from boto.compat import six class Blob(object): """Blob object""" def __init__(self, value=None, file=None, id=None): self._file = file self.id = id self.value = value @property def file(self): from StringIO import StringIO if self._file: f = self._...
""" This module provides an interface to the Elastic Compute Cloud (EC2) service from AWS. """ from boto.ec2.connection import EC2Connection from boto.regioninfo import RegionInfo, get_regions, load_regions from boto.regioninfo import connect RegionData = load_regions().get('ec2', {}) def regions(**kw_params): ...
""" German-language mappings for language-dependent features of reStructuredText. """ __docformat__ = 'reStructuredText' directives = { 'achtung': 'attention', 'vorsicht': 'caution', 'code': 'code', 'gefahr': 'danger', 'fehler': 'error', 'hinweis': 'hint', 'wichtig': 'import...
from edxmako.shortcuts import render_to_string from pipeline.conf import settings from pipeline.packager import Packager from pipeline.utils import guess_type from static_replace import try_staticfiles_lookup def compressed_css(package_name, raw=False): package = settings.PIPELINE_CSS.get(package_name, {}) i...
import json from mock import MagicMock, patch from path import Path import pytest import sys d = Path('__file__').parent.abspath() / 'hooks' sys.path.insert(0, d.abspath()) from lib.registrator import Registrator class TestRegistrator(): def setup_method(self, method): self.r = Registrator() def t...
#! /usr/bin/env python from __future__ import print_function from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # NonCentralChiSquare related functions # dNonCentralChiSquare nuMin = 0.2 nuMax = 5.0 n1 = 5 lambdaMin = 0.2 lambdaMax = 5.0 n2 = 5 xMin = 0.1 x...
# -*- coding: utf-8 -*- """ Production Configurations - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis for cache {% if cookiecutter.use_sentry_for_error_reporting == 'y' %} - Use sentry for error logging {% endif %} {% if cookiecutter.use_opbeat == 'y' %} - Use opb...