content
stringlengths
4
20k
import os from helpers import d2df import numpy as np def filenames(project_path): #project_path = os.path.realpath('..') #project_path = os.path.dirname(os.path.realpath(__file__)) #project_path = project_path + os.sep + ".." output = {} # Input files output["dataset_raw"] = project_path + o...
try: from libcloud.compute.types import Provider from libcloud.compute.providers import get_driver from libcloud.common.google import GoogleBaseError, QuotaExceededError, \ ResourceExistsError, ResourceNotFoundError _ = Provider.GCE HAS_LIBCLOUD = True except ImportError: HAS_LIBCLOU...
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models from actstream import follow from django.contrib.auth.models import User from knesset.mks.models import Party, Member class Migration(DataMigration): def forwards(self, orm): "Write yo...
# -*- coding: utf-8 -*- """ Demonstrate use of GLLinePlotItem to draw cross-sections of a surface. """ ## Add path to library (just for examples; you do not need this) #import initExample from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph.opengl as gl import pyqtgraph as pg import numpy as np import scipy.ndimag...
from __future__ import absolute_import from fife import fifechan from .widget import Widget from fife.extensions.pychan.attrs import PointAttr class Spacer(Widget): """ A spacer represents expandable or fixed 'whitespace' in the GUI. In a XML file you can get this by adding a <Spacer /> inside a VBox or HBox ele...
# -*- coding: utf-8 -*- from django.core.exceptions import ValidationError from nose.tools import * # noqa: F403 (PEP8 asserts) from osf.exceptions import ValidationValueError from tests.base import OsfTestCase from osf_tests.factories import SubjectFactory, PreprintFactory, PreprintProviderFactory from osf.models.v...
te_types=""" type TEMPLATETYPE_cache_t; files_type(TEMPLATETYPE_cache_t) """ te_rules=""" manage_dirs_pattern(TEMPLATETYPE_t, TEMPLATETYPE_cache_t, TEMPLATETYPE_cache_t) manage_files_pattern(TEMPLATETYPE_t, TEMPLATETYPE_cache_t, TEMPLATETYPE_cache_t) manage_lnk_files_pattern(TEMPLATETYPE_t, TEMPLATETYPE_cache_t, TEMPLA...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone import django.core.validators class Migration(migrations.Migration): dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.CreateModel( ...
from openerp.osv import osv, fields class pos_discount(osv.osv_memory): _name = 'pos.discount' _description = 'Add a Global Discount' _columns = { 'discount': fields.float('Discount (%)', required=True, digits=(16,2)), } _defaults = { 'discount': 5, } def apply_discount(se...
import os from django.db import connection from django.test import TransactionTestCase from django.utils._os import upath class MigrationTestBase(TransactionTestCase): """ Contains an extended set of asserts for testing migrations and schema operations. """ available_apps = ["migrations"] test_d...
import unittest import common from binascii import unhexlify class TestMsgVerifymessageSegwitNative(common.KeepKeyTest): def test_message_long(self): self.setup_mnemonic_nopin_nopassphrase() ret = self.client.verify_message( 'Bitcoin', 'bc1qyjjkmdpu7metqt5r36jf872a34syws33...
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( find_xpath_attr, fix_xml_ampersands ) class ClipsyndicateIE(InfoExtractor): _VALID_URL = r'https?://(?:chic|www)\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)' _TESTS = [{ 'url': 'http://w...
import os import tkinter from tkinter import ttk class Dialog(tkinter.Toplevel): def __init__(self, parent, message = None, title = None, seed = None, border = 'blue', **kwargs): tkinter.Toplevel.__init__(self, parent) self.transient(parent) if title: self.title(title) ...
import pytest from nose.tools import * # noqa: import functools from framework.auth.core import Auth from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase from osf_tests.factories import ( ProjectFactory, AuthUserFactory, RegistrationFactory ) @pytest.mark.enable_quickfiles...
from datetime import date, datetime from unittest import TestCase from pyrestorm.fields import Field, DateField from pyrestorm import exceptions class FieldsTestCase(TestCase): def test_field_clean(self): field = Field() self.assertRaises(NotImplementedError, field.clean, 1) def test_field_r...
from django.dispatch import Signal import unittest import sys import gc import django.utils.copycompat as copy if sys.platform.startswith('java'): def garbage_collect(): """Run the garbage collector and wait a bit to let it do his work""" import time gc.collect() time.sleep(0.1) els...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'core'} import time import re import shlex from functools import partial from xml.etree import ElementTree as etree from xml.etree.ElementTree import Element, SubElement, tostring from ansib...
"Base Cache class." from __future__ import unicode_literals import time import warnings from django.core.exceptions import DjangoRuntimeWarning, ImproperlyConfigured from django.utils.module_loading import import_string class InvalidCacheBackendError(ImproperlyConfigured): pass class CacheKeyWarning(DjangoRun...
# File name: comicwidgets.py import kivy kivy.require('1.9.0') from kivy.uix.relativelayout import RelativeLayout from kivy.graphics import Line class DraggableWidget(RelativeLayout): def __init__(self, **kwargs): super(DraggableWidget, self).__init__(**kwargs) self.selected = None def on_t...
""" CADIMI on LUNA16 data. Based on the model from the paper: FALSE POSITIVE REDUCTION FOR NODULE DETECTION IN CT SCANS USING A CONVOLUTIONAL NEURAL NETWORK: APPLICATION TO THE LUNA16 CHALLENGE Thomas de Bel, Cas van den Bogaard, Valentin Kotov, Luuk Scholten, Nicole Walasek https://luna16.grand-challenge.org/serve/pu...
import time import argparse import os import re import codecs import progressbar def build_money_regex(amount='amount', currency='currency'): return r'(?P<%s>[^\d]*)\s*(?P<%s>(\d*,?\d*)*\.?\d+)' % (currency, amount) HEADER_REGEX = re.compile( r'PokerStars\s+(?P<game_sub_type>Home Game|Zoom)?\s*(Hand|Game)\...
from django.core.exceptions import ValidationError from django.utils.six.moves import xrange def clean_ipv6_address(ip_str, unpack_ipv4=False, error_message="This is not a valid IPv6 address"): """ Cleans a IPv6 address string. Validity is checked by calling is_valid_ipv6_address() - if an inv...
import matplotlib matplotlib.use('Agg') import sys import os import numpy import numpy.ma as ma import pylab from scipy.interpolate import interp1d from scipy import interpolate from MSUtils import msutils from pyrap.tables import table import matplotlib.cm as cm MEERKAT_SEFD = numpy.array([ [ 856e6, 580.], [ 900e6...
"""Utility functions for the graph_editor. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import re from six import iteritems from tensorflow.python.framework import ops as tf_ops from tensorflow.python.ops import array_ops as tf_arr...
import re import os import tempfile EXAMPLES = r""" - replace: dest=/etc/hosts regexp='(\s+)old\.host\.name(\s+.*)?$' replace='\1new.host.name\2' backup=yes - replace: dest=/home/jdoe/.ssh/known_hosts regexp='^old\.host\.name[^\n]*\n' owner=jdoe group=jdoe mode=644 - replace: dest=/etc/apache/ports regexp='^(NameVir...
"""RT-DC dataset core classes and methods""" import warnings import numpy as np from dclab import definitions as dfn from .. import downsampling from ..polygon_filter import PolygonFilter class NanWarning(UserWarning): pass class Filter(object): def __init__(self, rtdc_ds): """Boolean filter arr...
"""Determines the list of files to be checked from command line arguments.""" __author__ = ('<EMAIL> (Robert Walker)', '<EMAIL> (Andy Perelson)') import glob import os import re import gflags as flags FLAGS = flags.FLAGS flags.DEFINE_multistring( 'recurse', None, 'Recurse in to the subdi...
"""Parse prices of a device from geizhals.""" from datetime import timedelta import logging from geizhals import Device, Geizhals import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import CONF_NAME import homeassistant.helpers.config_validation as cv from hom...
import os # traceback from exceptions that inherit from this class are suppressed class CommandLineError(Exception): """The traceback of all CommandLineError's is supressed when the errors occur on the command line to provide a useful command line interface. """ def render(self, msg): retu...
from __future__ import division, print_function, absolute_import import numpy as np from numpy.testing import assert_array_almost_equal, dec from scipy.lib._version import NumpyVersion from scipy.sparse import csr_matrix from scipy.sparse.csgraph import csgraph_from_dense, csgraph_to_dense def test_csgraph_from_dens...
def attach_roles(queryset, as_field="roles_attr"): """Attach roles to each object of the queryset. :param queryset: A Django user stories queryset object. :param as_field: Attach the roles as an attribute with this name. :return: Queryset object with the additional `as_field` field. """ model ...
# -*- coding: utf-8 -*- r''' werkzeug.script ~~~~~~~~~~~~~~~ .. admonition:: Deprecated Functionality ``werkzeug.script`` is deprecated without replacement functionality. Python's command line support improved greatly with :mod:`argparse` and a bunch of alternative modules. Most ...
""" remove intrachomosomal events above a specified size """ import os, sys import re def isInfoFlag(infoString,key) : word=infoString.split(";") for w in word : if w == key : return True return False def getKeyVal(infoString,key) : match=re.search("%s=([^;\t]*);?" % (key) ,infoString) ...
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, assertRegexpMatches from youtube_dl import YoutubeDL from youtube_dl.extractor i...
from mock import patch import pytest from arctic.auth import Credential from arctic.arctic import Arctic from arctic.scripts import arctic_init_library as mil from ...util import run_as_main def test_init_library(mongo_host): # Create the user agains the current mongo database with patch('arctic.scripts.arc...
from openerp.osv import fields, osv from openerp.tools.translate import _ from datetime import datetime import logging _logger = logging.getLogger(__name__) _schema = logging.getLogger(__name__ + '.schema') class query_invoices(osv.osv_memory): _name = 'l10n_ar_wsafip_fe.query_invoices' _description = 'Query ...
import time import math from ducktape.mark import parametrize from ducktape.mark.resource import cluster from ducktape.utils.util import wait_until from kafkatest.services.performance import ProducerPerformanceService from kafkatest.services.zookeeper import ZookeeperService from kafkatest.services.kafka import KafkaS...
ZULIP_USER = "<EMAIL>" ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" ZULIP_SITE = "https://zulip.example.com" # commit_notice_destination() lets you customize where commit notices # are sent to with the full power of a Python function. # # It takes the following arguments: # * path = the path to the Perforce de...
"""SCons.Tool.Packaging.rpm The rpm packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the ...
import time def installData(s,idpi,n =[]): #check if all names are valid c='' for i in n: c = c + str(i) + '-' s.send(c+idpi) def sendData(s,t, **kwargs): #print kwargs #print '--------------------------' s.send("time:{}\n".format(t)) for i in kwargs: s.send("{}:{}\n".f...
import os import unittest import six from src.test.py.bazel import test_base class RunfilesTest(test_base.TestBase): def _AssertRunfilesLibraryInBazelToolsRepo(self, family, lang_name): for s, t, exe in [("WORKSPACE.mock", "WORKSPACE", False), ("foo/BUILD.mock", "foo/BUILD", ...
"""Tests for Softplus and SoftplusGrad.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import test_util from tensorflow.python.ops import gradient_c...
from openerp.osv import osv class procurement_order(osv.osv): _inherit = "procurement.order" def create(self, cr, uid, vals, context=None): procurement_id = super(procurement_order, self).create(cr, uid, vals, context=context) self.run(cr, uid, [procurement_id], context=context) self.c...
import tools.pluginmanager as pm from chapi.Clearinghouse import CHv1Handler, CHv1DelegateBase from chapi.MemberAuthority import MAv1Handler, MAv1DelegateBase from chapi.SliceAuthority import SAv1Handler, SAv1DelegateBase from chapi.GuardBase import GuardBase from chapi.Parameters import set_parameters, configure_loggi...
import os import StringIO import unittest from telemetry import benchmark from telemetry import page as page_module from telemetry.page import page_set from telemetry.results import html_output_formatter from telemetry.results import page_test_results from telemetry.value import scalar def _MakePageSet(): ps = pag...
from django.contrib.auth import get_user_model import factory from feincms.module.medialibrary.models import MediaFile from feincms.module.page.models import Page from . import content, models User = get_user_model() class DummyFactory(factory.DjangoModelFactory): FACTORY_FOR = models.Dummy @factory.post_...
""" .. warn:: This module_util is currently internal implementation. We want to evaluate this code for stability and API suitability before making backwards compatibility guarantees. The API may change between releases. Do not use this unless you are willing to port your module code. """ import codecs fr...
import os import sys import numpy as np import matplotlib.pyplot as plt def rehbinder(r): # Results from Rehbinder with parameters used in the MOOSE simulation. # Rehbinder's manuscript contains a few typos - I've corrected them here. # G Rehbinder "Analytic solutions of stationary coupled thermo-hydro-mec...
"""Tests for numpy_io.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.learn.python.learn.learn_io import numpy_io from tensorflow.python.framework import errors from tensorflow.python.platform import test from...
from oslo_log import log as logging from tempest_lib import exceptions as lib_exc from tempest.api.orchestration import base from tempest.common.utils import data_utils from tempest import config from tempest import test LOG = logging.getLogger(__name__) CONF = config.CONF class TestSoftwareConfig(base.BaseOrchestr...
"""SCons.Platform.irix Platform-specific initialization for SGI IRIX systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2...
"""Notifications for Android TV notification service.""" import base64 import io import logging import requests from requests.auth import HTTPBasicAuth, HTTPDigestAuth import voluptuous as vol from homeassistant.const import CONF_TIMEOUT, CONF_HOST import homeassistant.helpers.config_validation as cv from homeassist...
"""Implementation of allocation API.""" from __future__ import absolute_import from .. import admin from .. import authz from .. import context from .. import schema def _set_auth_resource(cls, resource): """Set auth resource name for CRUD methods of the class.""" for method_name in ['get', 'create', 'update...
#!/usr/bin/env python """Example implementation for a perceptron.""" import logging import math import sys import numpy as np from sklearn.metrics import accuracy_score logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.DEBUG, stream=sys.stdout)...
from .application_gateways_operations import ApplicationGatewaysOperations from .express_route_circuit_authorizations_operations import ExpressRouteCircuitAuthorizationsOperations from .express_route_circuit_peerings_operations import ExpressRouteCircuitPeeringsOperations from .express_route_circuits_operations import ...
#flask libs from flask import Flask, request, g from flask.ext.restful import Resource, Api, reqparse from sqlalchemy import or_ #global libs from sys import exit import sys import os ## Import Local Libs from penguicontrax import dump_table from functions import return_null_if_not_logged_in from .. import db ##User ...
from .base import FunctionalTest, login_test_user_with_browser class CountPageViewTest(FunctionalTest): @login_test_user_with_browser def test_count_view_of_post(self): self.move_to_default_board() # 혜선이는 'grape'에 대한 게시글을 작성한다 self.add_post('grape', 'purple\nsweet') # 글 목록을 보...
import datetime import time from _sqlite3 import * paramstyle = "qmark" threadsafety = 1 apilevel = "2.0" Date = datetime.date Time = datetime.time Timestamp = datetime.datetime def DateFromTicks(ticks): return Date(*time.localtime(ticks)[:3]) def TimeFromTicks(ticks): return Time(*time.localtime(ticks...
# lint-amnesty, pylint: disable=missing-module-docstring import datetime from unittest.mock import patch import pytest from openedx.core.djangoapps.schedules.content_highlights import ( course_has_highlights_from_store, get_all_course_highlights, get_next_section_highlights, get_week_highlights ) from o...
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(Databas...
{ 'name': 'Products & Pricelists', 'version': '1.1', 'author': 'OpenERP SA', 'category': 'Sales Management', 'depends': ['base', 'process', 'decimal_precision', 'mail'], 'demo': [ 'product_demo.xml', 'product_image_demo.xml', ], 'description': """ This is the base module ...
import unittest from pyscsi.pyscsi.scsi_cdb_inquiry import Inquiry from pyscsi.pyscsi.scsi_enum_command import spc from pyscsi.utils.converter import scsi_ba_to_int from .mock_device import MockDevice, MockSCSI class CdbInquiryTest(unittest.TestCase): def test_main(self): with MockSCSI(MockDevice(spc)) ...
{ 'name': 'Dashboards', 'version': '1.0', 'category': 'Hidden', 'description': """ Lets the user create a custom dashboard. ======================================== Allows users to create custom dashboard. """, 'author': 'OpenERP SA', 'depends': ['base', 'web'], 'data': [ 'secur...
""" Pythonization API. """ # TODO: externalize this (have PythonizationScope and UserPythonizations as # globals here and picked up from this module # TODO: set explicit export list # TODO: move cast to cppyy.lowlevel or some sort # TODO: remove all need for accessing _backend def _set_backend( backend ): global...
"""Abstractions for the Intel Compiler families. Intel provides both a posix/gcc-like compiler (ICC) and an msvc-like compiler (ICL). """ import os import typing from ... import mesonlib from ..compilers import CompilerType from .gnu import GnuLikeCompiler from .visualstudio import VisualStudioLikeCompiler if typin...
from inwx import domrobot, prettyprint from configuration import get_account_data def main(): api_url, username, password = get_account_data(True) inwx_conn = domrobot(api_url, username, password, 'en', False) print prettyprint.contacts(inwx_conn.contact.list()['contact']) print prettyprint.nameservers...
""" ============================ ``ctypes`` Utility Functions ============================ See Also --------- load_library : Load a C library. ndpointer : Array restype/argtype with verification. as_ctypes : Create a ctypes array from an ndarray. as_array : Create an ndarray from a ctypes array. References ----------...
import logging logger = logging.getLogger(__name__) import os from urllib2 import urlparse import httplib import socket try: import xml.etree.cElementTree as ETree except ImportError: import xml.etree.ElementTree as ETree from xl import ( event, main, playlist, xdg ) from xl.radio import * from ...
# -*- coding: utf-8 -*- """ Created on Fri Mar 14 01:34:41 2014 @author: deokwoo """ from __future__ import division # To forace float point division import numpy as np from numpy.linalg import norm from scipy.interpolate import interp1d from shared_constants import * from data_tools import * from scipy.stats import s...
# -*- coding -*- """ Provides some command utility functions. TODO: matcher that ignores empty lines and whitespace and has contains comparison """ from __future__ import absolute_import, print_function, unicode_literals import os.path import codecs # --------------------------------------------------------------...
from django.contrib.messages import constants from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.test import TestCase from django.utils.safestring import SafeData, mark_safe from .base import BaseTests def set_session_data(storage, ...
from distutils.core import Extension as _Extension from distutils.core import Distribution as _Distribution def _get_unpatched(cls): """Protect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. """ while cls.__module__.s...
#!/usr/bin/env python """ Install.py tool to download, unpack, build, and link to the plumed2 library used to automate the steps described in the README file in this dir """ from __future__ import print_function import sys, os, platform, subprocess, shutil from argparse import ArgumentParser sys.path.append('..') fr...
#!/usr/bin/env python """Extract the FreeType version numbers from `<freetype/freetype.h>`. This script parses the header to extract the version number defined there. By default, the full dotted version number is printed, but `--major`, `--minor` or `--patch` can be used to only print one of these values instead. """ ...
"""Package to communicate with the authentication API.""" class CloudError(Exception): """Base class for cloud related errors.""" class Unauthenticated(CloudError): """Raised when authentication failed.""" class UserNotFound(CloudError): """Raised when a user is not found.""" class UserNotConfirmed(...
from django.core.management.base import BaseCommand from optparse import make_option class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--addrport', action='store', dest='addrport', type='string', default='', help='port number or ipaddr:port to run t...
from __future__ import unicode_literals, absolute_import import mimetypes import re _exact_mapping = { 'application/json': 'icon-file-css', 'text/css': 'icon-file-css', 'text/calendar': 'icon-calendar', # Word 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'icon-file-w...
from datetime import datetime from openerp.tools.translate import _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp import models, fields, SUPERUSER_ID class document_page_history_wkfl(models.Model): _inherit = 'document.page.history' def page_approval_draft(self, cr, uid, ids, context=...
""" This module defines the mechanism by which errors are handled in FoxySheep. """ import sys from antlr4.ParserRuleContext import ParserRuleContext from AST import ASTNode def _print_err(*args, flush=False): sys.stderr.write(' '.join(map(str, args)) + '\n') if flush: sys.stderr.flush() class Err...
"Dialog to specify or edit the parameters for a user configured help source." import os import sys from Tkinter import * import tkMessageBox import tkFileDialog class GetHelpSourceDialog(Toplevel): def __init__(self, parent, title, menuItem='', filePath=''): """Get menu entry and url/ local file location...
from unittest import mock from django.http import HttpRequest from django.template import ( Context, Engine, RequestContext, Template, Variable, VariableDoesNotExist, ) from django.template.context import RenderContext from django.test import RequestFactory, SimpleTestCase class ContextTests(SimpleTestCase): ...
import os import sys import json from common import run_cmd, err def run(): dbcfgs = json.loads(dbcfgs_json) nodes = dbcfgs['node_list'].split(',') scratch_locs = dbcfgs['scratch_locs'].split(',') # this script is running by trafodion user, so get sqroot from env traf_conf = os.environ['TRAF_CONF...
from copy import copy, deepcopy from django.core.checks.templates import ( E001, E002, check_setting_app_dirs_loaders, check_string_if_invalid_is_string, ) from django.test import SimpleTestCase from django.test.utils import override_settings class CheckTemplateSettingsAppDirsTest(SimpleTestCase): TEMPLA...
__version__=''' $Id$ ''' __doc__='''This module defines a Area mixin classes''' from reportlab.lib.validators import isNumber, isColor, isColorOrNone, isNoneOrShape from reportlab.graphics.widgetbase import Widget from reportlab.graphics.shapes import Rect, Group, Line, Polygon from reportlab.lib.attrmap import AttrMa...
"""Test qwikswitch sensors.""" import logging import pytest from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.components.qwikswitch import DOMAIN as QWIKSWITCH from homeassistant.bootstrap import async_setup_component from tests.test_util.aiohttp import mock_aiohttp_client from aiohttp.clie...
""" Archive tools for wheel. """ import os import time import logging import os.path import zipfile log = logging.getLogger("wheel") def archive_wheelfile(base_name, base_dir): '''Archive all files under `base_dir` in a whl file and name it like `base_name`. ''' olddir = os.path.abspath(os.curdir) ...
import sys from optparse import OptionParser from twisted.python import log from twisted.internet import reactor, ssl from autobahn.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS class EchoClientProtocol(WebSocketClientProtocol): def sendHello(self): self.sendMessage("Hello, wor...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.cache import BaseCacheModule class CacheModule(BaseCacheModule): def __init__(self, *args, **kwargs): self._cache = {} def get(self, key): return self._cache.get(key) def set(se...
import vtkAll as vtk from shallowCopy import shallowCopy import numpy as np try: from vtk.util import numpy_support except ImportError: from paraview import numpy_support def numpyToPolyData(pts, pointData=None, createVertexCells=False): pd = vtk.vtkPolyData() pd.SetPoints(vtk.vtkPoints()) # Makes...
from __future__ import ( absolute_import, division, print_function, unicode_literals) import six from six.moves import (zip, filter, map, reduce, input, range) import unittest import numpy as np import tapeworm.scoring from tapeworm.core import OneGoodBlobException class TestBadDatasets(unittest.TestCase): ...
__author__ = 'hfriedrich' import numpy as np from tools.tensor_utils import SparseTensor from math import log10 from scipy.sparse import csr_matrix # see http://en.wikipedia.org/wiki/Okapi_BM25 # parameters: # tensor: SparseTensor object # indices: indices pointing to (need, need) combinations to compute the connecti...
from json import loads from datetime import datetime from inspect import getargspec from django.apps import apps from django.test import TestCase from django.template import Template, Context from django.utils.timesince import timesince from django.contrib.sites.models import Site from django.contrib.auth import get_u...
import mock from oslo_vmware import vim_util from nova import exception from nova.network import model as network_model from nova import test from nova.tests.unit import utils from nova.tests.unit.virt.vmwareapi import fake from nova.virt.vmwareapi import constants from nova.virt.vmwareapi import network_util from nov...
"""A command to clean the StudentModuleHistory table. When we added XBlock storage, each field modification wrote a new history row to the db. Now that we have bulk saves to avoid that database hammering, we need to clean out the unnecessary rows from the database. This command that does that. """ import datetime ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import subprocess from ansible.module_utils._text import to_bytes _HAS_CONTROLPERSIST = {} def check_for_controlpersist(ssh_executable): try: # If we've already checked this executable return _HAS_CONTROLPE...
""" insults/SSH integration support. @author: Jp Calderone """ from zope.interface import implements from twisted.conch import avatar, interfaces as iconch, error as econch from twisted.conch.ssh import factory, keys, session from twisted.cred import credentials, checkers, portal from twisted.python import component...
import pytest from io import BytesIO from tests.utils import Command from thefuck.rules.docker_not_command import get_new_command, match @pytest.fixture def docker_help(mocker): help = b'''Usage: docker [OPTIONS] COMMAND [arg...] A self-sufficient runtime for linux containers. Options: --api-cors-header= ...
from openerp.osv import fields, osv import logging _logger = logging.getLogger(__name__) class calendar_event(osv.Model): """ Model for Calendar Event """ _inherit = 'calendar.event' _columns = { 'phonecall_id': fields.many2one('crm.phonecall', 'Phonecall'), 'opportunity_id': fields.many2o...
import os from random import randint import uuid import time from flask import Flask, request, render_template, redirect, make_response from werkzeug import secure_filename from data_manager import DataManager from model.puzzle_manager import PuzzleManager from model.puzzle import Puzzle, PuzzleState from model.probl...
import inspect import os import pkgutil import warnings from importlib import import_module from threading import local from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils._os import npath, upath from django.utils.deprecation import Re...