content
stringlengths
4
20k
"""Tests for the routing function op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.tensor_forest.hybrid.ops import gen_training_ops from tensorflow.contrib.tensor_forest.hybrid.python.ops import training_ops from tensorflow.pyt...
""" To run the tests, simply invoke this script from the commandline: jython runner.py <xml config file> [vendor, ...] If no vendors are given, then all vendors will be tested. If a vendor is given, then only that vendor will be tested. """ import unittest, os import xmllib, __builtin__, re def __imp__(module, at...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings from opaque_keys.edx.django.models import CourseKeyField class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MO...
#coding=utf-8 from pymongo import MongoClient import db_config as config import mongo_init_datas as init_all_datas class MongoDB: def __init__(self): self.db = self.get_connect() def get_connect(self): client = MongoClient(config.uri, config.port) #client = MongoClient('mong...
""" Implements gradient clipping as a cost wrapper. """ from functools import wraps from theano.compat import six from theano import tensor from pylearn2.compat import OrderedDict from pylearn2.costs.cost import Cost from pylearn2.utils import is_iterable from pylearn2.utils import py_number_types class GradientCli...
"""Support for Join notifications.""" import logging import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService) from homeassistant.const import CONF_API_KEY import homeassistant.helpers.config_validation as cv _LOG...
''' httpQsRequest.py Copyright 2006 Andres Riancho This file is part of w3af, w3af.sourceforge.net . w3af 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 version 2 of the License. w3af is distributed in the hop...
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
import sys import time from gi.repository import Aravis Aravis.enable_interface ("Fake") try: if len(sys.argv) > 1: camera = Aravis.Camera.new (sys.argv[1]) else: camera = Aravis.Camera.new (None) except: print ("No camera found") exit () device = camera.get_device () genicam = device.get_genicam_xml (); p...
import unittest from selenium.webdriver.common.by import By class ElementEqualityTests(unittest.TestCase): def testSameElementLookedUpDifferentWaysShouldBeEqual(self): self._loadSimplePage() body = self.driver.find_element(By.TAG_NAME, "body") xbody = self.driver.find_elements(By.XPATH, ...
""" Module for performing checks on a Kibana logging deployment """ import json import ssl try: from urllib2 import HTTPError, URLError import urllib2 except ImportError: from urllib.error import HTTPError, URLError import urllib.request as urllib2 from openshift_checks.logging.logging import Logging...
import logging import sys import os from optparse import make_option, OptionParser from django.conf import settings from django.core.management.base import BaseCommand from django.test.utils import get_runner class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noinput', ...
""" This module provides support for Twisted to interact with the PyGTK mainloop. In order to use this support, simply do the following:: | from twisted.internet import gtkreactor | gtkreactor.install() Then use twisted.internet APIs as usual. The other methods here are not intended to be called directly....
"""Adadelta for TensorFlow.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import math_ops from tensorflow.python.training import optimizer from tensorflow.python.training import trai...
''' Kinetic effect ============== .. versionadded:: 1.7.0 The :class:`KineticEffect` is the base class that is used to compute the velocity out of a movement. When the movement is finished, the effect will compute the position of the movement according to the velocity, and reduce the velocity with a friction. The mov...
from nbodykit.core import GridSource import numpy from pmesh.pm import ParticleMesh, RealField, ComplexField class BigFileGridSource(GridSource): """ Class to read field gridded data from a binary file Notes ----- * Reading is designed to be done by `GridPainter`, which reads gridded quantit...
""" This module provides a pool manager that uses Google App Engine's `URLFetch Service <https://cloud.google.com/appengine/docs/python/urlfetch>`_. Example usage:: from urllib3 import PoolManager from urllib3.contrib.appengine import AppEngineManager, is_appengine_sandbox if is_appengine_sandbox(): ...
""" ================== Prediction Latency ================== This is an example showing the prediction latency of various scikit-learn estimators. The goal is to measure the latency one can expect when doing predictions either in bulk or atomic (i.e. one by one) mode. The plots represent the distribution of the pred...
# -*- test-case-name: twisted.pb.test.test_copyable -*- # this module is responsible for all copy-by-value objects from zope.interface import interface, implements from twisted.python import reflect from twisted.python.components import registerAdapter from twisted.internet import defer import slicer, tokens from to...
import datetime from django.utils import tree class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % operator - it is quoted # because it can be u...
import pytest import datetime import pytz from collections import OrderedDict from multipledispatch.conflict import ambiguities import ibis import ibis.expr.datatypes as dt from ibis.common import IbisTypeError def test_validate_type(): assert dt.validate_type is dt.dtype @pytest.mark.parametrize(('spec', 'exp...
"""Reporting utilities module""" import os import sys from mako.template import Template from collections import OrderedDict from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import cm from reportlab.platypus import Paragraph, SimpleDocTemplate from reportlab.lib import colors from reportla...
from __future__ import (absolute_import, division, print_function) import numpy as np # older version of numpy does not support nanmean and nanmedian # and nanmean and nanmedian was removed in scipy 0.18 in favor of numpy # so try numpy first then scipy.stats try: from numpy import nanmean, nanmedian except Import...
import time from openerp.osv import fields, osv from openerp.tools.translate import _ class hr_timesheet_current_open(osv.osv_memory): _name = 'hr.timesheet.current.open' _description = 'hr.timesheet.current.open' def open_timesheet(self, cr, uid, ids, context=None): ts = self.pool.get('hr_timesh...
#!/usr/bin/python ''' (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' import os from nvme_utils import ServerFillUp from dmg_utils import DmgCommand from command_utils_base import CommandFailure class NvmeFault(ServerFillUp): # pylint: disable=too-many-ancestors ...
import inspect from numpy import ones, zeros, where, argmin, unique, array from numpy import logical_and, logical_or, arange, sqrt from numpy import maximum, pi, log from numpy.random import choice from numpy.linalg import norm, det from scipy.stats import binom, uniform from sklearn.metrics.pairwise import pairwise_di...
import base64 import logging from odoo import _, api, fields, models, tools from odoo.exceptions import UserError _logger = logging.getLogger(__name__) class MailTemplate(models.Model): "Templates for sending email" _name = "mail.template" _inherit = ['mail.render.mixin'] _description = 'Email Temp...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import re import time import glob from ansible.plugins.action.dellos10 import ActionModule as _ActionModule from ansible.module_utils._text import to_text from ansible.module_utils.six.moves.urllib.parse import urlsplit ...
import math import numpy as np from scipy.optimize import brentq def get_antropogenic_release(xt, c1, c2, r1, r2, w1): ''' Parameters ---------- xt : float polution in lake at time t c1 : float center rbf 1 c2 : float center rbf 2 r1 : float ratius rbf ...
import gettext import os import re import tempfile from otopi import base, util def _(m): return gettext.dgettext(message=m, domain='ovirt-engine-setup') @util.export class StorageDomainType(object): # See: org.ovirt.engine.core.common.businessentities.StorageDomainType MASTER = 0 DATA = 1 ISO ...
""" Created on Dec 22, 2012 @author: Alexandre The goal of this test is to verifiy that the PUAdapter really allows a regular estimator to achieve better accuracy in the case where the \"negative\" examples are contaminated with a number of positive examples. Here we use the breast cancer dataset from UCI. We purpos...
from __future__ import print_function, division import sys, os sys.path.append(os.path.abspath(".")) from problems.problem import * __author__ = 'panzer' class DTLZ2(Problem): """ Hypothetical test problem with "m" objectives and "n" decisions """ k = 10 def __init__(self, m, n=None): """ Initiali...
""" interactive debugging with PDB, the Python Debugger. """ from __future__ import absolute_import, division, print_function import pdb import sys def pytest_addoption(parser): group = parser.getgroup("general") group._addoption( '--pdb', dest="usepdb", action="store_true", help="start the in...
"""Utility to use the Closure Compiler CLI from Python.""" import distutils.version import logging import re import subprocess # Pulls a version number from the first line of 'java -version' # See http://java.sun.com/j2se/versioning_naming.html to learn more about the # command's output format. _VERSION_REGEX = re.c...
from pox.lib.revent.revent import * from pox.core import core as core from pox.messenger import * log = core.getLogger() from pox.lib.recoco.recoco import * class TCPTransport (Task, Transport): def __init__ (self, address = "0.0.0.0", port = 7790, nexus = None): port = int(port) Task.__init__(self) Tr...
""" ######################################################################## # Fonte: http://pygame.org/wiki/2DVectorClass # ######################################################################## """ import operator import math class vec2d(object): """2d vector ...
from oslo_config import cfg from oslo_db import exception as db_exc from oslo_log import log from six import moves import sqlalchemy as sa from sqlalchemy import sql from neutron.common import exceptions as n_exc from neutron.db import api as db_api from neutron.db import model_base from neutron.i18n import _LE, _LW f...
# -*- coding: utf-8 -*- """ *************************************************************************** ConcaveHull.py --------------------- Date : May 2014 Copyright : (C) 2012 by Piotr Pociask Email : piotr dot pociask at gis-support dot pl **************...
import pytest from tomviz.jsonrpc import JsonRpcHandler, jsonrpc_message @pytest.fixture def handler(): return JsonRpcHandler('/some/path') def test_invalid_request(handler): request = {} response = handler.rpc(request) excepted = jsonrpc_message({ 'id': None, 'error': { ...
import logging from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse_lazy from django.utils import datastructures from django.utils.translation import ugettext_lazy as _ from horizon import exceptions from horizon import forms from horizon import tables from horizon import tabs fro...
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
#!/usr/bin/python # coding=utf-8 ################################################################################ from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch from diamond.collector import Collector from supervisord imp...
import unittest from tests.integration import ServiceCertVerificationTest import boto.redshift class RedshiftCertVerificationTest(unittest.TestCase, ServiceCertVerificationTest): redshift = True regions = boto.redshift.regions() def sample_service_call(self, conn): conn.describe_cluster_version...
import numpy as np import numpy.linalg as L import scipy.interpolate import scipy.linalg __docformat__ = 'restructuredtext' def recipr(X): """ Return the reciprocal of an array, setting all entries less than or equal to 0 to 0. Therefore, it presumes that X should be positive in general. """ x...
import warnings from collections import OrderedDict from optparse import make_option from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import router, DEFAULT_DB_ALIAS from django.utils.deprecation import RemovedInDjango19W...
import os import tempfile from invenio.config import CFG_SITE_URL, CFG_WEBDIR cfg_gnuplot_available = 1 try: import Gnuplot except ImportError, e: cfg_gnuplot_available = 0 def write_coordinates_in_tmp_file(lists_coordinates): """ Writes the graph coordinates in a temporary file for reading it later ...
import json import errno import socket class QMPError(Exception): pass class QMPConnectError(QMPError): pass class QMPCapabilitiesError(QMPError): pass class QEMUMonitorProtocol: def __init__(self, address, server=False): """ Create a QEMUMonitorProtocol class. @param addres...
"""Tests for ComposableModel classes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.framework.python.ops import variables as contrib_variables from tensorflow.contrib.layers.python.layers import feature_column from tensorflow.co...
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import SimpleTestCase, TestCase from .models import ( Bookmark, Domain, Family, Genus, HybridSpecies, Kingdom, Klass, Order, Phylum, Pizza, Species, TaggedItem, ) class SelectRelatedTests(TestCase): @...
import dns.exception import dns.rdata import dns.rdatatype import dns.name class NXT(dns.rdata.Rdata): """NXT record @ivar next: the next name @type next: dns.name.Name object @ivar bitmap: the type bitmap @type bitmap: string @see: RFC 2535""" __slots__ = ['next', 'bitmap'] def __in...
from test.test_support import have_unicode, run_unittest import unittest class base_set: def __init__(self, el): self.el = el class set(base_set): def __contains__(self, el): return self.el == el class seq(base_set): def __getitem__(self, n): return [self.el][n] class TestConta...
"""Keras data preprocessing utils for image data.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.keras.python.keras.preprocessing.image import apply_transform from tensorflow.contrib.keras.python.keras.preprocessing.image import ...
from essentia_test import * from essentia.streaming import MaxToTotal as sMaxToTotal class TestMaxToTotal_Streaming(TestCase): def testRegression(self): # triangle input envelope = range(22050) envelope.reverse() envelope = range(22050) + envelope gen = VectorInput(envelop...
import os import sys import urllib import urllib2 import re import shutil import zipfile import time import xbmc import xbmcgui import xbmcaddon import xbmcplugin import plugintools import json addonName = xbmcaddon.Addon().getAddonInfo("name") addonVersion = xbmcaddon.Addon().getAddonInfo("version...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, parse_iso8601, float_or_none, int_or_none, compat_str, determine_ext, ) class HitboxIE(InfoExtractor): IE_NAME = 'hitbox' _VALID_URL = r'https?://(?:w...
from django.contrib.auth.models import User from api_openvpn.models import UserProfile, Server from rest_framework.test import APIClient from rest_framework.test import APITestCase from functions import EasyRSAFuncions from rest_framework import exceptions import time class ApiTest(APITestCase): """ It tests ...
import numpy as np import hftools.plotting from hftools.constants import k from hftools.dataset import DimMatrix_j, DimMatrix_i, DataBlock from hftools.networks.multiports import SArray, YArray, ABCDArray, ZArray,\ convert from hftools.math import matrix_multiply def Hconj(A): i_idx = A.dims_index("i") j...
import time from datetime import datetime from dateutil import relativedelta from openerp.osv import osv from openerp.report import report_sxw class contribution_register_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(contribution_register_report, self).__init__(cr, uid, n...
"""Public buildspec to GIT mapping.""" import re from deps2git import SplitScmUrl GIT_HOST = 'https://chromium.googlesource.com/' webkit_git = GIT_HOST + 'chromium/blink.git' # Remove the ffmpeg overrides, since the buildspec DEPS have stripped out these # (and other) vars that they don't use, and without them in th...
import datetime import numpy as np import pandas as pd from copy import deepcopy def _ensure_index(x): if not isinstance(x, pd.Index): x = pd.Index(sorted(x)) return x class RollingPanel(object): """ Preallocation strategies for rolling window over expanding data set Restrictions: maj...
from django.core.exceptions import PermissionDenied from datetime import datetime from API.models import SSORefreshToken, SSOAccessList from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from core.utils import get_config import API.cache_handler ...
from __future__ import unicode_literals from django.db import models from django.utils import timezone import json # Create your models here. class StarsFilter(models.Model): id = models.AutoField(primary_key=True) user = models.ForeignKey('auth.User') status = models.CharField(default="Not started", max...
import sys class out_saver: def __init__(self): self.saved_stdout = sys.stdout def write(self, text): self.s += text def retrieve(self): return self.s def start(self): self.s = "" sys.stdout = self def stop(self): sys.stdout = self.saved_stdout return self.s
from twisted.python import usage from twisted.application import app from twisted.persisted import sob import sys, getpass class ConvertOptions(usage.Options): synopsis = "Usage: tapconvert [options]" optParameters = [ ['in', 'i', None, "The filename of the tap to read from"], ['out', ...
"""Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os import re import shutil import subprocess import stat import string import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # A regex matching an argument corresponding to th...
import os import re from sentiment_analysis import analyze RESOURCES = os.path.join(os.path.dirname(__file__), 'resources') def test_pos(capsys): analyze(os.path.join(RESOURCES, 'pos.txt')) out, err = capsys.readouterr() score = float(re.search('score of (.+?) with', out).group(1)) magnitude = float...
import datetime import json import logging import uuid from airflow.exceptions import AirflowException from airflow.models import DagRun, DagBag from airflow.utils.state import State import airflow.settings def run_dag(dag_id, params=None, run_id=None, conf=None, execution_date=None): dagbag = DagBag() if da...
# This file is a minimal swift-format vim-integration. To install: # - Change 'binary' if swift-format is not on the path (see below). # - Add to your .vimrc: # # map <C-I> :pyf <path-to-this-file>/swift-format.py<cr> # imap <C-I> <c-o>:pyf <path-to-this-file>/swift-format.py<cr> # # The first line enables swift-f...
import time class Timer(object): '''A simple timer which starts when constructed and stops when Stop is called. ''' def __init__(self): self._start = time.time() self._elapsed = None def Stop(self): '''Stops the timer. Must only be called once. Returns |self|. ''' assert self._elapsed is...
""" Unit Tests for remote procedure calls shared between all implementations """ import time from eventlet import greenthread import nose from nova import context from nova import log as logging from nova.rpc import amqp as rpc_amqp from nova.rpc import common as rpc_common from nova import test LOG = logging.getL...
""" Verify that a link time only dependency will get pulled into the set of built targets, even if no executable uses it. """ import TestGyp import sys test = TestGyp.TestGyp() test.run_gyp('lib_only.gyp') test.build('lib_only.gyp', test.ALL) test.built_file_must_exist('a', type=test.STATIC_LIB) # TODO(bradnelso...
#!/usr/bin/env python ''' ''' import math, time, numpy as np import rospy import gazebo_msgs.msg, std_msgs.msg, geometry_msgs, nav_msgs.msg, sensor_msgs.msg, rosmip_control.msg import tf.transformations import pdb def list_of_position(p): return (p.x, p.y, p.z) def list_of_orientation(q): return (q.x, q.y, q.z, q....
import os import re import json import cocos class Project(object): CPP = 'cpp' LUA = 'lua' JS = 'js' CONFIG = '.cocos-project.json' KEY_PROJ_TYPE = 'project_type' KEY_HAS_NATIVE = 'has_native' KEY_CUSTOM_STEP_SCRIPT = "custom_step_script" CUSTOM_STEP_PRE_BUILD = "pre-build" ...
# -*- coding: utf-8 -*- """ *************************************************************************** PointsFromLines.py --------------------- Date : August 2013 Copyright : (C) 2013 by Alexander Bruy Email : alexander dot bruy at gmail dot com **********...
import os all_commands = {} my_dir = os.path.dirname(__file__) for py in os.listdir(my_dir): if py == '__init__.py': continue if py.endswith('.py'): name = py[:-3] clsn = name.capitalize() while clsn.find('_') > 0: h = clsn.index('_') clsn = clsn[0:h] + clsn[h + 1:].capitalize() ...
# Embedded file name: /usr/lib/enigma2/python/keymapparser.py import enigma import xml.etree.cElementTree from keyids import KEYIDS from Tools.KeyBindings import addKeyBinding class KeymapError(Exception): def __init__(self, message): self.msg = message def __str__(self): return s...
from __future__ import print_function, division from sympy.core.singleton import S from sympy.core.function import Function from sympy.core import Add from sympy.core.evalf import get_integer_part, PrecisionExhausted from sympy.core.numbers import Integer from sympy.core.relational import Gt, Lt, Ge, Le from sympy.cor...
from unittest2.test.support import LoggingResult import unittest2 class Test_TestSkipping(unittest2.TestCase): def test_skipping(self): class Foo(unittest2.TestCase): def test_skip_me(self): self.skipTest("skip") events = [] result = LoggingResult(events) ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import json import traceback from ansible.module_utils.api import basic_auth_argument_spec...
# -*- coding: utf-8 -*- """ pygments.lexers.idl ~~~~~~~~~~~~~~~~~~~ Lexers for IDL. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, words from pygments.token import Text, Comment, Oper...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' from collections import OrderedDict from calibre.ebooks.docx.block_styles im...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Written in place of AboutBlocks in the Ruby Koans # # Note: Both blocks and generators use a yield keyword, but they behave # a lot differently # from runner.koan import * class AboutGenerators(Koan): def test_generating_values_on_the_fly(self): result ...
import sys if sys.version_info < (3, 7): from ._namelengthsrc import NamelengthsrcValidator from ._namelength import NamelengthValidator from ._font import FontValidator from ._bordercolorsrc import BordercolorsrcValidator from ._bordercolor import BordercolorValidator from ._bgcolorsrc import ...
import unittest import subprocess class make_targets(unittest.TestCase): def test_makeNative(self): ''' In this make targets test, we execute makeNative target to make sure native target is working without any issues. Passing criteria: make native test completed successfully w...
{ "name" : "Vietnam Chart of Accounts", "version" : "1.0", "author" : "General Solutions", 'website': 'http://gscom.vn', "category" : "Localization/Account Charts", "description": """ This is the module to manage the accounting chart for Vietnam in OpenERP. ======================================...
import argparse import sys import random import os silent = False def minimize_file(input_file_path, output_file_path, lines): if not silent: sys.stdout.write("Minimizing file `{}` to {} lines.\n".format(input_file_path, lines)) sys.stdout.flush() counter = 0 with open(input_file_path) ...
""" Page classes to test either the Course Team page or the Library Team page. """ from bok_choy.promise import EmptyPromise from bok_choy.page_object import PageObject from ...tests.helpers import disable_animations from .course_page import CoursePage from . import BASE_URL def wait_for_ajax_or_reload(browser): ...
from django.db import models from django.db.models.fields.related import ForwardManyToOneDescriptor from django.utils.translation import get_language class ArticleTranslationDescriptor(ForwardManyToOneDescriptor): """ The set of articletranslation should not set any local fields. """ def __set__(self,...
from mythril.disassembler.disassembly import * instruction_list = [ {"opcode": "PUSH4", "argument": "0x10203040"}, {"opcode": "EQ"}, {"opcode": "PUSH4", "argument": "0x40302010"}, {"opcode": "JUMPI"}, ] def test_get_function_info(mocker): # Arrange global instruction_list signature_datab...
import time from report import report_sxw import logging _logger = logging.getLogger('reportes') class reportes_reportc( report_sxw.rml_parse ): def __init__(self,cr,uid,name,context): super(reportes_reportc,self).__init__(cr,uid,name,context=context) self.localcontext.update({ 'time': time, '_periodos_...
import base64 import hmac import json import struct import time import os from hashlib import sha1 def load_steam_guard(steam_guard: str) -> dict: if os.path.isfile(steam_guard): with open(steam_guard, 'r') as f: return json.loads(f.read()) else: return json.loads(steam_guard) d...
""" Path operations common to more than one OS Do not use directly. The OS specific modules import the appropriate functions from this module themselves. """ import os __all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime', 'getsize', 'isdir', 'isfile'] # Does a path exist? # This is fal...
from typing import List, Union import numpy as np from ..file_utils import add_end_docstrings from ..tokenization_utils import TruncationStrategy from ..utils import logging from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Pipeline logger = logging.get_logger(__name__) class ZeroShotClassificationArgumentHa...
# -*- coding: utf-8 -*- from django.conf.urls import url from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.views import login, password_change from appliances import api, views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^check_appliance/(?P<provider_id>[^/]+)/(?P<...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
from spack import * from shutil import copyfile import os class Igvtools(Package): """IGVTools suite of command-line utilities for preprocessing data files""" homepage = "https://software.broadinstitute.org/software/igv/home" url = "http://data.broadinstitute.org/igv/projects/downloads/2.3/igvto...
""" Verifies --generator-output= behavior when using rules. """ import TestGyp test = TestGyp.TestGyp() test.writable(test.workpath('rules'), False) test.run_gyp('rules.gyp', '--generator-output=' + test.workpath('gypfiles'), chdir='rules') test.writable(test.workpath('rules'), True) tes...
""" Views used by XQueue certificate generation. """ import json import logging from django.contrib.auth.models import User from django.db import transaction from django.http import HttpResponse, Http404, HttpResponseForbidden from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http impor...
"""Helper methods for creating & verifying XSRF tokens.""" __authors__ = [ '"Doug Coker" <<EMAIL>>', '"Joe Gregorio" <<EMAIL>>', ] import base64 import hmac import os # for urandom import time from oauth2client import util # Delimiter character DELIMITER = ':' # 1 hour in seconds DEFAULT...
""" Tests for msvc9compiler. """ import os import contextlib import distutils.errors import pytest try: from unittest import mock except ImportError: import mock from . import contexts # importing only setuptools should apply the patch __import__('setuptools') pytest.importorskip("distutils.msvc9compiler")...