content
stringlengths
4
20k
from datetime import timedelta from odoo import fields from odoo.addons.stock.tests.common2 import TestStockCommon from odoo.tests import Form class TestSaleMrpLeadTime(TestStockCommon): def setUp(self): super(TestSaleMrpLeadTime, self).setUp() self.env.ref('stock.route_warehouse0_mto').active ...
from configman import Namespace from socorro.external.crashstorage_base import CrashStorageBase import os import urllib2 import poster poster.streaminghttp.register_openers() #============================================================================== class BreakpadPOSTDestination(CrashStorageBase): """this a...
from abc import ABCMeta, abstractmethod from six import with_metaclass, iteritems # Consistent error to be thrown in various cases regarding overriding # `final` attributes. _type_error = TypeError('Cannot override final attribute') def bases_mro(bases): """ Yield classes in the order that methods should be...
from starcluster import exception from starcluster.logger import log from completers import ClusterCompleter class CmdTerminate(ClusterCompleter): """ terminate [options] <cluster_tag> ... Terminate a running or stopped cluster Example: $ starcluster terminate mycluster This will term...
from pyramid import testing from pytest import fixture from pytest import mark import colander @mark.usefixtures('log') class TestJSONHTTPException: @fixture def make_one(self, errors, request=None, **kwargs): from adhocracy_core.rest.exceptions import JSONHTTPClientError return JSONHTTPClie...
""" More complex expression parsing """ from __future__ import print_function import sys from spark_parser.ast import AST from scanner import ExprScanner from spark_parser import GenericASTBuilder, DEFAULT_DEBUG class ExprParser(GenericASTBuilder): """A more complete expression Parser. Note: function pars...
"""Tests for ceilometer/hardware/inspector/snmp/inspector.py """ from oslo_utils import netutils from oslotest import mockpatch from ceilometer.hardware.inspector import snmp from ceilometer.tests import base as test_base ins = snmp.SNMPInspector class FakeObjectName(object): def __init__(self, name): s...
""" Common tests for built-ins. Attempting to cover generic run time behavior. Static optimization of these is not expected. """ def yield_helper(): print("Yielding 40") yield 40 print("Yielding 60") yield 60 print("Yielding 30") yield 30 class CommonOptimizationTest: _list_tests = { ...
import unittest from kazoo.client import KazooClient from pykit import utdocker from pykit import ututil from pykit import zkutil dd = ututil.dd zk_tag = 'daocloud.io/zookeeper:3.4.10' zk_name = 'zk_test' class ZKTestBase(unittest.TestCase): @classmethod def setUpClass(cls): utdocker.pull_image(zk...
"""Unit tests for the `iris.fileformats.netcdf._load_cube` function.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa # Import iris.tests first so that some things can be initialised before # importing anything else. import iris.tests...
import sys sys.path.append("..") from sql_base import dbutils import errno import os import deal_one_file import file_op import logging import logging.config LOG_HANDLE = None logger = None def log_init(): global logger if(logger == None): logging.config.fileConfig("../logger.conf") logger = lo...
from __future__ import absolute_import from __future__ import print_function import re from datetime import datetime from twisted.internet import defer from twisted.internet import reactor from twisted.trial import unittest from twisted.web import client from twisted.web.error import Error from buildbot.changes.bitb...
""" Support for Insteon dimmers via local hub control. For more details about this component, please refer to the documentation at https://home-assistant.io/components/light.insteon_local/ """ import json import logging import os from datetime import timedelta from homeassistant.components.light import ( ATTR_BRI...
"""Manage access to the clients, including authenticating when needed. """ import logging from neutronclient import client from neutronclient.neutron import client as neutron_client LOG = logging.getLogger(__name__) class ClientCache(object): """Descriptor class for caching created client handles.""" def...
"""A switch driver for the Nexus 5500 Currently the driver uses telnet to connect to the switch's console; in the long term we want to be using SNMP. """ import re from schema import Schema, Optional, And, Use import logging from hil.model import db, Switch from hil.ext.switches import _console from hil.errors impor...
import config import os import subprocess from lib.util import command_check_error def rsync(project,node,files='.',includes=None,excludes=None,**kwargs): '''Runs the rsync command on project, rsyncing it to node''' if includes is None: includes = [] if excludes is None: excludes = [] excludes_opts = ...
import unittest import ccs import time #################################################################################################################### # BTCCPRO # ##############################################...
from __future__ import division, absolute_import, print_function import sys import platform import numpy as np import numpy.core.umath as ncu from numpy.testing import ( run_module_suite, assert_raises, assert_equal, assert_array_equal, assert_almost_equal, dec ) # TODO: branch cuts (use Pauli code) # TODO: ...
#!/usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-admin-get-job-pilots ######################################################################## """ Retrieve info about pilots that have matched a given Job """ __RCSID__ = "$Id$" from DIRAC.Cor...
"""Test hassbian config.""" import asyncio from unittest.mock import patch from homeassistant.bootstrap import async_setup_component from homeassistant.components import config from homeassistant.components.config.core import CheckConfigView from tests.common import mock_http_component_app, mock_coro @asyncio.corout...
import re from streamlink.plugin import Plugin from streamlink.plugin.api import http, useragents, validate from streamlink.stream import HLSStream, HTTPStream from streamlink.utils import parse_json class Telefe(Plugin): _url_re = re.compile(r'https?://telefe.com/.+') @classmethod def can_handle_url(cl...
#!/usr/bin/env python """ This script generates patches containing the Jython-specific deviations from the stdlib modules. It looks for the string "svn.python.org" in the changeset summary and generates a patch for all the changes made after that in each module. The script expects to be run in the jython root director...
"""Tensor Tracer report generation utilities.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from tensorflow.python.platform import gfile from tensorflow.python.platform import tf_logging as logging _TRACER_LOG_PREFIX = ' [>>>TT>>>]...
import requests import csv from datetime import datetime from django.core.management.base import BaseCommand, CommandError from covid.models import County, State, DailyDatum DATA_URL = 'https://raw.githubusercontent.com/nytimes/covid-19-data/master/us-counties.csv' DATE_FORMAT = '%Y-%m-%d' def construct_state_dict(s...
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep from airflow.utils.db import provide_session from airflow.utils.state import State class PrevDagrunDep(BaseTIDep): """ Is the past dagrun in a state that allows this task instance to run, e.g. did this task instance's task in the previous dagrun compl...
from lxml import etree from nova.api.openstack import common from nova.api.openstack import xmlutil from nova.openstack.common import log as logging from nova.tests.integrated.api import client from nova.tests.integrated import integrated_helpers LOG = logging.getLogger(__name__) class XmlTests(integrated_helpers....
import argparse import json from matplotlib import pyplot import numpy from expsuite import PyExperimentSuite def readExperiment(experiment): with open(experiment, "r") as file: predictions = [] predictionsSDR = [] truths = [] iterations = [] resets = [] randoms = [] trains = [] ki...
from __future__ import with_statement from watchdog.utils import platform if not platform.is_windows(): raise ImportError import ctypes import threading import os.path import time from pathtools.path import absolute_path from watchdog.observers.winapi_common import ( DIR_ACTION_EVENT_MAP, FILE_ACTION_EV...
"""Export utilities.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.framework import deprecated from tensorflow.contrib.framework.python.ops import variables as contrib_variables from tensorflow.contrib.session_bundle import expo...
import os import errno from itertools import zip_longest, chain import signal import sys import contextlib from threading import Thread import numpy as np def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter...
#!/usr/bin/env python # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import print_function # Python 2/3 compatibility import sys USAGE = """ usage : python %s [1x4-contrast] where [1x4-contrast] is optional and is something like 1,0,0,...
"""Unit tests for `base.py`.""" from absl.testing import absltest from absl.testing import parameterized import jax import jax.numpy as jnp import numpy as np from rlax._src import base class OneHotTest(parameterized.TestCase): def test_one_hot(self): num_classes = 3 indices = jnp.array( [[[1., 2...
from __future__ import division, absolute_import, print_function import sys from os import path import numpy as np from numpy.testing import * from numpy.compat import asbytes, asunicode import warnings import collections import pickle class TestFromrecords(TestCase): def test_fromrecords(self): r = np....
import os import sys import time from PyQt4 import QtCore, QtGui import conf from app import USSyncApp try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class BackgroundWorker(QtCore.QThread): filesUpdated = QtCore.pyqtSignal(list) progressUpdated = QtCore.pyqt...
import numpy as np from multiprocessing import Process from sklearn.neighbors import KNeighborsRegressor from scipy.spatial.distance import euclidean def filter_data(input, output, distance, pivot_distance, threshold): training = [] result = [] for i in xrange(0, len(input)): if euclidean(pivot_distance, d...
import xbmc import xbmcaddon import inspect import os import sys import socket import re class printDebug: def __init__(self, main, sub=None): self.main=main if sub: self.sub="."+sub else: self.sub='' self.level=settings.get_debug() self.DEBUG_OFF...
import uno import unohelper from com.sun.star.awt import Rectangle from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK from com.sun.star.awt.MessageBoxType import INFOBOX from com.sun.star.frame import XDispatch, XDispatchProvider from com.sun.star.lang import XServiceInfo class Provider(unohelper.Base, XServic...
from .models import SearchableModel, Song, Artist, Album, Tag from collections import namedtuple from datetime import datetime, timedelta import logging import copy import re logger = logging.getLogger(__name__) class SearchEngine(object): SEARCH_FOR_SONGS = 'songs' SEARCH_FOR_ALBUMS = 'albums' SEARCH_FO...
import socket #for sockets import sys #for exit class Client: def __init__(self, port=8888, host='localhost'): self._host = host self._port = port # UDP socket try: self._s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) except socket.erro...
from gi.repository import Gst import xl.providers from xl.player.gst.gst_utils import ElementBin class Mono(ElementBin): index = 90 name = 'mono' def __init__(self): ElementBin.__init__(self, name=self.name) #self.elements[50] = Gst.ElementFactory.make('audioconvert', None) self.e...
from sklearn.kernel_approximation import (RBFSampler,Nystroem) from sklearn.ensemble import RandomForestClassifier import pandas import numpy as np import random from sklearn.svm import SVC from sklearn.metrics.pairwise import rbf_kernel,laplacian_kernel,chi2_kernel,linear_kernel,polynomial_kernel,cosine_similarity fro...
{ "name": "Hr Agent - Extended management of human resources for Managing Commercial's Agents.", 'version': '2.0.3.0', 'category': 'Generic Modules/Human Resources', "description": """This Module, extended management of human resources for Managing Commercial's Agents.""", "author": "Bortolatto Ivan...
"""test_api.py""" import hug from jose import jwt import requests_mock from app import api from models import Dashboard, Job, Event, ApiKey from settings import settings from .base_testcase import ApiTestCase PRIVATE_KEY = """-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS...
from django import forms from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.forms import SetPasswordForm, AuthenticationForm, \ PasswordResetForm from django.core.exceptions import ValidationError from django.urls import reverse from django.core.validators import ...
import sys import os import re # ----------------------------------------------------------------------------- # list of words that should be excluded from mindex comamnds exclude_list = 'a an and as at by for in of or to'.split() # ----------------------------------------------------------------------------- def split...
"""Module for creating illustrations. To create an annotated image we need an instance of the :class:`jicbioimage.illustrate.AnnotatedImage` class. >>> from jicbioimage.illustrate import AnnotatedImage Suppose that we have an existing image. >>> from jicbioimage.core.image import Image >>> im = Image((50,50)) We c...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from hypothesis import given import hypothesis.strategies as st import numpy as np from caffe2.python import brew, core, workspace import caffe2.python.hypothesis_test_ut...
#!/usr/bin/env python from utils.munin.base import MuninGraph class NBMuninGraph(MuninGraph): @property def graph_config(self): return { 'graph_category' : 'PyTune', 'graph_title' : 'PyTune Feeds & Subscriptions', 'graph_vlabel' : 'Feeds & Subscribers', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Celery settings """ BROKER_URL = 'amqp://orkarbmq:orkapass@localhost:5672//escience_tasks' #: Only add pickle to this list if your broker is secured #: from unwanted access (see userguide/security.html) CELERY_ACCEPT_CONTENT = ['json'] CELERY_TASK_SERIALIZER = 'json' C...
try: basestring except NameError: # Python 3.x basestring = str import base64 import shutil import warnings from contextlib import contextmanager from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver from ....
# -*- coding: utf-8 -*- from collections import OrderedDict from cms.constants import LEFT, REFRESH_PAGE from cms.models import UserSettings, Placeholder from cms.toolbar.items import Menu, ToolbarAPIMixin, ButtonList from cms.toolbar_pool import toolbar_pool from cms.utils import get_language_from_request from cms.ut...
import logging import random import requests import time from kazoo.client import KazooClient, KazooState from kazoo.exceptions import NoNodeError, NodeExistsError from patroni.dcs import AbstractDCS, Cluster, Failover, Leader, Member from patroni.exceptions import DCSError from patroni.utils import sleep from request...
"""Logging core.""" __copyright__ = "Copyright (C) 2014 Ivan D Vasin" __docformat__ = "restructuredtext" import logging as _logging from logging import * INSECURE = 5 """Insecure logging level. Messages that contain sensitive data should be logged at or below this level. """ _logging.addLevelName(INSECURE, 'INSE...
from __future__ import print_function import time import datetime from decorator import decorator __author__ = "Antonio Lima" __author_email__ = "<EMAIL>" __license__ = "MIT" __copyright__ = "Copyright (c) 2013-2014 Antonio Lima" class greedy(object): def __init__(self, max_calls, time_interval): if max...
# -*- coding: utf-8 -*- """ # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License as # published by the Free Software Foun...
from unittest import TestCase from django.template import Context from django.template import Template class DummyFile(object): def __init__(self, url='http://example.com/static/hello.jpg'): self.url = url class TemplateTagsTestCase(TestCase): def render_template(self, string, **context): c...
from .lib import order_models def generate_formencode_validators(models): yield PREAMBLE for model in order_models(models): for line in generate_schema(model): yield line def generate_schema(model): yield '' yield '' yield 'class %s(fes.Schema):' % model['id'] for k, v in...
''' demo5.py Demo of a simple cell driven by synaptic inputs. Written by Sungho Hong, Computational Neuroscience Unit, OIST, 2017 ''' from neuron import h, gui h.load_file("stdrun.hoc") h.load_file("CNSutils.hoc") # CNSsaveVectors # The simulation will run for 100 ms. h.tstop = 200 # Global sampling period will be...
#!/usr/bin/python ############################################## ###Python template ###Author: Elizabeth Lee ###Date: 2/6/15 ###Function: Redraw figure 4A in Shifting Demographic Landscape (Bansal2010) ###Import data: ###Command Line: python ############################################## ### notes ### ### pack...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('typeclasses', '0001_initial'), ] operations = [ migrations.CreateModel( name='HelpEntry', fields=[ ...
''' *** SHED SKIN Python-to-C++ Compiler *** Copyright 2005-2013 Mark Dufour; License GNU GPL version 3 (See LICENSE) ''' from __future__ import print_function import os import sys class GlobalInfo: # XXX add comments, split up def __init__(self): self.constraints = set() self.allvars = set() ...
from django.contrib.auth.models import User from django.test import TestCase from django.test.client import RequestFactory from onadata.libs.utils.log import audit_log, Actions from onadata.apps.main.models import AuditLog class TestAuditLog(TestCase): def test_audit_log_call(self): account_user = User(u...
""" Compile the externals """ __RCSID__ = "$Id$" import platform import sys import os import re # We need to patch python platform module. It does a string comparison for the libc versions. # it fails when going from 2.9 to 2.10, # the fix converts the version to a tuple and attempts a numeric comparison _libc_sear...
from airflow.contrib.hooks.redis_hook import RedisHook from airflow.operators.sensors import BaseSensorOperator from airflow.utils.decorators import apply_defaults class RedisKeySensor(BaseSensorOperator): """ Checks for the existence of a key in a Redis database """ template_fields = ('key',) ui_...
from regioninfo import SQSRegionInfo def regions(): """ Get all available regions for the SQS service. :rtype: list :return: A list of :class:`boto.ec2.regioninfo.RegionInfo` """ return [SQSRegionInfo(name='us-east-1', endpoint='sqs.us-east-1.amazonaws.com'), ...
# -*- coding:utf-8 -*- # Перегрузка математических операций. # Создаем класс-точку, имеем точку в двухмерном пространстве: class Point(object): def __init__(self, x, y): self._x = x self._y = y # Сравнение def __eq__(self, other): if not isinstance(other, Point): return NotImpl...
import mock import os import shutil import unittest from django.conf import settings from vcs_support import utils TEST_STATICS = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test_statics') class TestNonBlockingLock(unittest.TestCase): @classmethod def setUpClass(cls): try: ...
#!/usr/bin/env python3 #=============================================================================# # https://github.com/MartyCombs/bin/blob/master/clean.py #=============================================================================# import argparse, sys, os, re parser = argparse.ArgumentParser(description='')...
import capi def request_sync(req): ptr = capi.conf.lib.sourcekitd_send_request_sync(capi.Object(req)) resp = capi.Response(ptr) if capi.conf.lib.sourcekitd_response_is_error(resp): raise SourceKitError( capi.conf.lib.sourcekitd_response_error_get_kind(resp), capi.conf.lib.s...
###################################################################### # # minSimple.py: minimize a molecule # ###################################################################### from __future__ import print_function import openbabel import sys # Make sure we have a filename try: filename = sys.argv[1] except: ...
import bitcoin.rpc proxy_connection = bitcoin.rpc.Proxy() print(proxy_connection.getnewaddress())
""" This module provides the profile object and support functions for loading and saving user preferences between sessions. The preferences are saved on disk as a cPickle, because of this no objects that cannot be resolved in the namespace of this module prior to starting the mainloop must not be put in the Profile...
#!/usr/bin/env python """ Applying perturbation theory to calculate the ground state energy of the infinite 1D box of width ``a`` with a perturbation which is linear in ``x``, up to second order in perturbation """ from sympy.core import pi from sympy import Integral, var, S from sympy.functions import sin, sqrt def...
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline ...
from apscheduler.scheduler import Scheduler import RelayChannel import DHT11 import DHT22 import Weather import pigpio import json class StatusPage: def __init__(self): pigpio.start() scheduler = Scheduler() self.overhead = RelayChannel.RelayChannel(11, scheduler) self.overhead.tur...
import rospy import tf2_ros as tf2 from tf2_geometry_msgs import PoseStamped from geometry_msgs.msg import Point, Quaternion from tf.transformations import quaternion_from_euler from dynamic_stack_decider.abstract_action_element import AbstractActionElement class CircleBall(AbstractActionElement): def __init__(s...
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : <EMAIL> **...
from datetime import datetime, timedelta from pulp.server.db.model.base import Model from pulp.server.db.model.reaper_base import ReaperMixin class CeleryResult(Model, ReaperMixin): """ Model reference to the Celery Results backend. """ collection_name = 'celery_taskmeta' unique_indices = tuple(...
from __future__ import unicode_literals import frappe, unittest import requests from frappe.model.delete_doc import delete_doc from frappe.utils.data import today, add_to_date from frappe import _dict from frappe.limits import update_limits, clear_limit from frappe.utils import get_url from frappe.core.doctype.user.u...
import re from oslo_serialization import jsonutils as json from six.moves.urllib import parse as urlparse import sahara.exceptions as ex class OozieClient(object): def __init__(self, url, oozie_server): self.job_url = url + "/v1/job/%s" self.jobs_url = url + "/v1/jobs" self.oozie_server ...
import sqlite3 import numpy as np import argparse from pyimzml.ImzMLWriter import ImzMLWriter def threshold_otsu(image, nbins=256): # Stripped-down function from scikit-image to avoid the heavy dependency. assert image.min() != image.max() hist, bin_edges = np.histogram(image.flat, bins=nbins) bin_cent...
from __future__ import unicode_literals from __future__ import absolute_import import re import six.moves.urllib.request import six.moves.urllib.parse import six.moves.urllib.error import hashlib from tg import config from allura.lib import helpers as h _wrapped_email = re.compile(r'.*<(.+)>') def id(email): ...
""" Author: RedFantom License: GNU GPLv3 Copyright (c) 2017-2018 RedFantom """ # Standard library import os from shutil import copytree, rmtree # Packages from PIL import Image, ImageEnhance # Project Modules from . import _utils as utils from . import _imgops as imgops from ._utils import get_file_directory class Th...
import matplotlib import matplotlib.pyplot as plot __backend = None __parameters = None pgf_parameters = { "pgf.texsystem": "pdflatex", "text.usetex": True, "figure.figsize": (3.1, 2.5), "pgf.preamble": [ r"\usepackage[utf8]{inputenc}", r"\usepackage[T1]{fontenc}", r"\renewco...
import logging from redbreast.core import WFException from redbreast.core.spec import * from uuid import uuid4 import time LOG = logging.getLogger(__name__) class Task(object): ACTIVE = 1 READY = 2 EXECUTING = 4 EXECUTED = 8 COMPLETED = 16 # active --> ready() ...
from tornado.httpclient import AsyncHTTPClient, HTTPRequest, HTTPError from . import StoreComponent, StoreComponents, StoreComponentError from .. order import OrdersModel from anthill.common.social import steam from urllib import parse import ujson import logging class SteamErrorCodes(object): @staticmethod ...
import numpy as np from .core import Element import nusa.templates as tmp from scipy.sparse import csr_matrix class Spring(Element): """ Spring element for finite element analysis *nodes* : tuple Connectivity for element given as tuple of :class:`~core.base.Node` objects *ke*...
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by...
""" Test the partitions and partitions service """ import json from django.conf import settings import django.test from django.test.utils import override_settings from mock import patch from unittest import skipUnless from courseware.masquerade import handle_ajax, setup_masquerade from courseware.tests.test_masquera...
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup from configparser import ConfigParser from urllib.request import urlopen, Request from urllib.parse import quote from gtts import gTTS import logging import re import requests import urllib.parse import flickrapi import json import os logging.basicConfig(format='...
# -*- coding: UTF-8 -*- logger.info("Loading 23 objects to table properties_property...") # fields: id, name, group, type loader.save(create_properties_property(1,['Gartenarbeit', 'Jardinier', 'Gardener'],1,1)) loader.save(create_properties_property(2,['Gehorsam', 'Ob\xe9issant', 'Obedient'],2,2)) loader.save(create_pr...
import select import socket import host import packet import logging logger = logging.getLogger('pyrad') class RemoteHost: """Remote RADIUS capable host we can talk to. """ def __init__(self, address, secret, name, authport=1812, acctport=1813): """Constructor. :param address: IP add...
"""AMQP Messages.""" # Copyright (C) 2007-2008 Barry Pederson <<EMAIL>> from __future__ import absolute_import, unicode_literals from .serialization import GenericContent # Intended to fix #85: ImportError: cannot import name spec # Encountered on python 2.7.3 # "The submodules often need to refer to each other. For e...
import numpy as np from numpy.testing import assert_approx_equal from sklearn.utils.testing import (assert_equal, assert_array_almost_equal, assert_array_equal, assert_true, assert_raise_message) from sklearn.datasets import load_linnerud from sklea...
from __future__ import with_statement, absolute_import from django.forms import EmailField from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature from django.utils.unittest import skip from .models import Person class SkippingTestCase(TestCase): def test_skip_unless_db_feature(self): "A t...
""" pickle compat """ import numpy as np from numpy.lib.format import read_array, write_array from pandas.compat import BytesIO, cPickle as pkl, pickle_compat as pc, PY3 from pandas.core.dtypes.common import is_datetime64_dtype, _NS_DTYPE from pandas.io.common import _get_handle, _infer_compression, _stringify_path ...
"""Console Proxy Service.""" import socket from nova.compute import rpcapi as compute_rpcapi from nova import exception from nova import flags from nova import manager from nova.openstack.common import cfg from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova import ...
#!/usr/bin/env python """ This modules defines routines for performing numerical integration (quadrature) of a function in one dimension. There are routines for adaptive and non-adaptive integration of general functions, with specialised routines for specific cases. These include integration over infin...
"""Tests for tensorflow.ops.math_ops.matrix_inverse.""" 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 imp...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Restore-ServiceBinary', 'Author': ['@harmj0y'], 'Description': ("Restore a backed up service binary."), 'Background' : True, 'Output...