content
string
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} import re from ansible.module_utils.basic import get_exception from ansible.module_utils.openswitch import NetworkModule, NetworkError from ansible.module_utils.netcfg import Net...
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
import unittest from scrapy.downloadermiddlewares.redirect import RedirectMiddleware, MetaRefreshMiddleware from scrapy.spiders import Spider from scrapy.exceptions import IgnoreRequest from scrapy.http import Request, Response, HtmlResponse from scrapy.utils.test import get_crawler class RedirectMiddlewareTest(unit...
# -*- coding: utf-8 -*- """ *************************************************************************** v_in_geonames.py ---------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *****************************...
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
import sys from core import * import args import config import config_printer import enumerate as enum from config import * from enumerate import enumerate from data import get_data, get_data_columns, post_data_columns, rel_channels, SPECIAL_FIELDS from plot import plot, subst_data import dummymp try: # Should b...
from __future__ import print_function __version__='3.3.0' __all__ = ('USPS_4State',) from reportlab.lib.colors import black from reportlab.graphics.barcode.common import Barcode from reportlab.lib.utils import asNative def nhex(i): 'normalized hex' r = hex(i) r = r[:2]+r[2:].lower() if r.endswith('l')...
"""Tests for moving_average_optimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import tempfile import six from tensorflow.contrib.opt.python.training import moving_average_optimizer from tensorflow.python.framework import constant_...
import os import time import datetime from StringIO import StringIO from UserDict import DictMixin class UTC(datetime.tzinfo): """ A UTC tzinfo class, based on http://docs.python.org/library/datetime.html#datetime.tzinfo """ ZERO = datetime.timedelta(0) def utcoffset(self, dt): retu...
# -*- encoding: utf-8 -*- def yield_all_partitions_of_integer(n): r'''Yields all partitions of positive integer `n` in descending lex order: :: >>> for partition in mathtools.yield_all_partitions_of_integer(7): ... partition ... (7,) (6, 1) (5, 2) ...
from sources import * from content import * from utils import * from formatter import * from tohtml import * import utils import sys, os, time, string, glob, getopt def usage(): print "\nDocMaker Usage information\n" print " docmaker [options] file1 [file2 ...]\n" print "using the following...
""" globalmaptiles.py Global Map Tiles as defined in Tile Map Service (TMS) Profiles ============================================================== Functions necessary for generation of global tiles used on the web. It contains classes implementing coordinate conversions for: - GlobalMercator (based on EPSG:900913...
''' forest data structure ''' import itertools from p2pool.util import skiplist, variable class TrackerSkipList(skiplist.SkipList): def __init__(self, tracker): skiplist.SkipList.__init__(self) self.tracker = tracker self.tracker.removed.watch_weakref(self, lambda self, item: se...
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __repr__(self): return "(%f;%f)" % (self.x, self.y) def adapt_point(point): return ("%f;%f" % (point.x, point.y)).encode('ascii') def convert_point(s): x, y = list(map(float, s.split(b";"))) return Po...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 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 os import traceback from couchpotato import CPLog, md5 from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getExt from couchpotato.core.plugins.base import Plugin import six log = CPLog(__n...
import sys sys.path.append("/usr/share/rhn") from up2date_client import rhnreg from up2date_client import rhnregGui from up2date_client import up2dateErrors import gtk from gtk import glade import gettext _ = lambda x: gettext.ldgettext("rhn-client-tools", x) gtk.glade.bindtextdomain("rhn-client-tools") from firstb...
""" An s-expression syntax for XML documents, together with a serializer to UTF-8. Use like this: >>> x = [sxml.h1, "text"] >>> sxml_to_string (x) "<h1>text</h1>" >>> x = [sxml.a(href="about:blank", title="foo"), [sxml.i, "italics & stuff"]] >>> sxml_to_string (x) "<a href="about:blank" title="foo"><i>italics &amp; ...
from openerp.osv import osv from openerp.tools.translate import _ class account_move_line(osv.osv): _inherit = "account.move.line" def line2bank(self, cr, uid, ids, payment_type=None, context=None): """ Try to return for each Ledger Posting line a corresponding bank account according t...
"""Constants for special keys.""" class Keys: """Constants for special keys.""" NULL = '\uE000' CANCEL = '\uE001' HELP = '\uE002' BACK_SPACE = '\uE003' TAB = '\uE004' CLEAR = '\uE005' RETURN = '\uE006' ENTER = '\uE007' SHIFT = '\uE008' LEFT_SHIFT = '\uE008' CONTROL = '\u...
from __future__ import print_function, unicode_literals from six.moves import urllib import sickbeard from sickbeard import logger from sickchill.helper.exceptions import ex try: import json except ImportError: import simplejson as json class Notifier(object): def _notify_emby(self, message, host=None...
# coding=utf-8 """MLDonkey Client.""" from __future__ import unicode_literals from medusa.clients.torrent.generic import GenericClient class MLNetAPI(GenericClient): """MLDonkey API class.""" def __init__(self, host=None, username=None, password=None): """Constructor. :param host: ...
"""Utilities for the win32 Performance Data Helper module Example: To get a single bit of data: >>> import win32pdhutil >>> win32pdhutil.GetPerformanceAttributes("Memory", "Available Bytes") 6053888 >>> win32pdhutil.FindPerformanceAttributesByName("python", counter="Virtual Bytes") [22278144] First exam...
from south.db import db from django.db import models from mysite.customs.models import * class Migration: def forwards(self, orm): # Adding field 'BugzillaUrl.tracker' db.add_column('customs_bugzillaurl', 'tracker', orm['customs.bugzillaurl:tracker']) # Deleting field...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import uuid import socket import getpass from datetime import datetime from os.path import basename from ansible.module_utils.urls import open_url from ansible.parsing.ajson import AnsibleJSONEncoder from ansible.plug...
from datetime import datetime import operator import os import re import string from django import template from django.conf import settings from django.template import Template from django.template.loader import render_to_string from django.template.defaultfilters import truncatewords_html, stringfilter from django.t...
# -*- coding: utf-8 -*- """ This module defines :class:`BaseNeo`, the abstract base class used by all :module:`neo.core` classes. """ # needed for python 3 compatibility from __future__ import absolute_import, division, print_function from datetime import datetime, date, time, timedelta from decimal import Decimal im...
from __future__ import print_function, division, absolute_import, unicode_literals from hope.options import get_cxxflags # Additional compiler flags, formated as array of strings cxxflags = get_cxxflags() """ List of c++ compiler flags. Normally hope does determing the right flags itself. """ #TODO implement prefi...
import time import xml.etree.ElementTree as ET import re try: import boto.ec2 from boto.exception import BotoServerError HAS_BOTO = True except ImportError: HAS_BOTO = False def get_error_message(xml_string): root = ET.fromstring(xml_string) for message in root.findall('.//Message'): ...
from openerp import tools import math def rounding(f, r): # TODO for trunk: log deprecation warning # _logger.warning("Deprecated rounding method, please use tools.float_round to round floats.") return tools.float_round(f, precision_rounding=r) # TODO for trunk: add rounding method parameter to tools.float_round...
import logging import os import shutil import tempfile import unittest import yaml from mock import patch from buildtool import ( check_subprocess_sequence, check_subprocess, MetricsManager) def init_runtime(options=None): logging.basicConfig( format='%(levelname).1s %(asctime)s.%(msecs)03d %(mes...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Chrome Preferences file parser.""" import unittest # pylint: disable=unused-import from plaso.formatters import chrome_preferences as chrome_preferences_formatter from plaso.lib import timelib from plaso.parsers import chrome_preferences from tests.parsers i...
# coding: utf-8 from __future__ import unicode_literals from .brightcove import ( BrightcoveLegacyIE, BrightcoveNewIE, ) from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, sanitized_Request, ) class NownessBaseIE(InfoExtractor): def _extract_ur...
"""Test ACL.""" import datetime import hashlib import json import mock from oslo_utils import timeutils import webtest from aodh.api import app from aodh.tests.api import v2 from aodh.tests import db as tests_db VALID_TOKEN = '4562138218392831' VALID_TOKEN2 = '4562138218392832' class FakeMemcache(object): TO...
from boto.cognito.identity.exceptions import ResourceNotFoundException from tests.integration.cognito import CognitoTest class TestCognitoIdentity(CognitoTest): """ Test Cognitoy identity pools operations since individual Cognito identities require an AWS account ID. """ def test_cognito_identity(...
""" A number of function that enhance IDLE on MacOSX when it used as a normal GUI application (as opposed to an X11 application). """ import sys import Tkinter from os import path _appbundle = None def runningAsOSXApp(): """ Returns True if Python is running from within an app on OSX. If so, assume that ...
import pulsar as psr def load_ref_system(): """ Returns d-leucine as found in the IQMol fragment library. All credit to https://github.com/nutjunkie/IQmol """ return psr.make_system(""" C 1.6125 -0.7205 -0.4004 C 0.1080 -0.4462 -0.4641 C -0.2699 ...
import base64 from laikaboss.objectmodel import ModuleObject, ExternalVars from laikaboss.si_module import SI_MODULE class DECODE_BASE64(SI_MODULE): def __init__(self,): self.module_name = "DECODE_BASE64" def _run(self, scanObject, result, depth, args): moduleResult = [] try: ...
from gppylib.mainUtils import * import os, sys, traceback gProgramName = os.path.split(sys.argv[0])[-1] from gppylib.commands.base import setExecutionContextFactory, ExecutionContext,CommandResult from gppylib import gplog from gppylib.commands import unix from gppylib.system import configurationInterface as configIn...
from __future__ import absolute_import, unicode_literals import os from django.core.management import call_command from django.test import TestCase, TransactionTestCase from django.test.utils import override_system_checks, extend_sys_path from django.utils._os import upath from .models import (ConcreteModel, Concret...
"""Tests for distributions KL mechanism.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.distributions.python.ops import kullback_leibler from tensorflow.contrib.distributions.python.ops import normal from tensorflow.python.ops im...
"""Tests for the testing base code.""" import mock from oslo_config import cfg import oslo_messaging as messaging from cinder import rpc from cinder import test class IsolationTestCase(test.TestCase): """Ensure that things are cleaned up after failed tests. These tests don't really do much here, but if iso...
""" queuebot.py A pure utility virtualbot to be subclassed. The Queuebot provides a queue decorator to be used on get_action, allowing subclasses to define action sequences instead of juggling around action primitives. """ # Global imports from collections import deque # Local imports import real.definitions as d fr...
{ 'name': 'Marketing Campaign - Demo', 'version': '1.0', 'depends': ['marketing_campaign', 'crm', ], 'author': 'OpenERP SA', 'category': 'Marketing', 'description': """ Demo data for the module marketing_campaign. ============================================ Creates demo da...
from lib.hachoir_metadata.metadata import (registerExtractor, Metadata, RootMetadata, MultipleMetadata) from lib.hachoir_parser.image import ( BmpFile, IcoFile, PcxFile, GifFile, PngFile, TiffFile, XcfFile, TargaFile, WMF_File, PsdFile) from lib.hachoir_parser.image.png import getBitsPerPixel as pngBitsPerP...
import mrp_operations import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: <EMAIL> Version: 0.0.1 Created Time: 2016-05-10 Last_modify: 2016-05-10 ****************************************** ''' ''' Given an Iterator class interface with methods: next(...
from __future__ import absolute_import from __future__ import with_statement import os import sys import tempfile from libcloud import _init_once from libcloud.test import LibcloudTestCase from libcloud.test import unittest from libcloud.compute.ssh import ParamikoSSHClient from libcloud.compute.ssh import ShellOutSS...
#!/usr/bin/env python import numpy #import pylab def princomp(A,numpc=4,reconstruct=False,getEigenValues=True): # computing eigenvalues and eigenvectors of covariance matrix M = (A - numpy.atleast_2d(numpy.mean(A,axis=1)).T) # subtract the mean (along columns) # print 'A:%s'%A # print 'M:%s'%M # print 'cov:%s'%numpy...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
import commands import logging import time from threading import Lock from odoo import http from odoo.http import request _logger = logging.getLogger(__name__) # Those are the builtin raspberry pi USB modules, they should # not appear in the list of connected devices. BANNED_DEVICES = set([ "0424:9514", # Standar...
#!/usr/bin/env python import os import pandas as pd from StringIO import StringIO from unittest import TestCase, main from numpy import array, nan from biom import Table from pandas.util.testing import assert_frame_equal from americangut.util import ( slice_mapping_file, parse_mapping_file, verify_subset, ...
from sklearn import datasets from sklearn.neural_network import MLPClassifier import traceback from submissions.Fritz import medal_of_honor class DataFrame: data = [] feature_names = [] target = [] target_names = [] honordata = DataFrame() honordata.data = [] honortarget = [] class DataFrame2: da...
__author__ = "mozman <<EMAIL>>" from array import array from dxfwrite.htmlcolors import get_color_tuple_by_name # dxf default pen assignment: # 1 : 1.40mm - red # 2 : 0.35mm - yellow # 3 : 0.70mm - green # 4 : 0.50mm - cyan # 5 : 0.13mm - blue # 6 : 1.00mm - magenta # 7 : 0.25mm - white/black # 8, 9 : 2.00mm # >=10 ...
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from codecs import register_error, xmlcharrefreplace_errors from .constants import voidElements, booleanAttributes, spaceCharacters from .constants import rcdataElements, entities, xmlEntities from . im...
from distutils.core import setup, Extension import os if 'BASE_TOOLS_PATH' not in os.environ: raise "Please define BASE_TOOLS_PATH to the root of base tools tree" BaseToolsDir = os.environ['BASE_TOOLS_PATH'] setup( name="PyUtility", version="0.01", ext_modules=[ Extension( 'PyUtili...
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django_comment_common.models import ( Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_STUDENT) from django_comment_common.utils import seed_permissions_roles from student.models i...
# -*- 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): # Adding model 'CourseAccessRuleHistory' db.create_table('embargo_courseaccessrulehistory', ( ('...
"""Functional tests for aggregate operations.""" 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 dtypes from tensorflow.python.framework import o...
from . import exception_helper from . import label_helper from . import label
from test import test_support mimetools = test_support.import_module('mimetools', deprecated=True) multifile = test_support.import_module('multifile', deprecated=True) import cStringIO msg = """Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_590453667==_" X-OriginalArrivalTime:...
#!/usr/bin/python # -*- coding: utf-8 -*- # vim: expandtab:tabstop=4:shiftwidth=4 """Ansible module for modifying OpenShift configs during an upgrade""" import os import yaml def modify_api_levels(level_list, remove, ensure, msg_prepend='', msg_append=''): """ modify_api_levels """ chan...
""" The ApplicationCache implementaion. """ from selenium.webdriver.remote.command import Command class ApplicationCache(object): UNCACHED = 0 IDLE = 1 CHECKING = 2 DOWNLOADING = 3 UPDATE_READY = 4 OBSOLETE = 5 def __init__(self, driver): """ Creates a new Aplication Cac...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals """ LANG_INFO is a dictionary structure to provide meta information about languages. About name_local: capitalize it as if your language name was appearing inside a sentence in your language. The 'fallback' key can be used to specify a special fallback...
#!/usr/bin/env python2 import dns.query import dns.zone import dns.rdtypes import dns.rdatatype import dns.rdataclass import dns.rdata import dns.update import dns.tsigkeyring import IPy import urllib from operator import itemgetter import time from .models import * from .main import * class dns_utils(): def __...
from tempest.api.identity import base from tempest import test class ExtensionTestJSON(base.BaseIdentityV2AdminTest): @test.idempotent_id('85f3f661-f54c-4d48-b563-72ae952b9383') def test_list_extensions(self): # List all the extensions body = self.non_admin_client.list_extensions()['extension...
from __future__ import unicode_literals from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import ( TestCase, modify_settings, override_settings, skipUnlessDBFeature, ) from .models import City @modify_settings(INSTALLED_APPS={'append': 'd...
"""pythonshare.client - interface for executing code on pythonshare servers """ import socket import cPickle import pythonshare from pythonshare.messages import Exec, Exec_rv, Async_rv, Register_ns, Request_ns, Ns_rv class Connection(object): """Connection to a Pythonshare server. Example: connect to a serv...
from twisted.internet.protocol import Factory from twisted.protocols import basic from twisted.internet import reactor import sys, time USER = "test" PASS = "twisted" PORT = 1100 SSL_SUPPORT = True UIDL_SUPPORT = True INVALID_SERVER_RESPONSE = False INVALID_CAPABILITY_RESPONSE = False INVALID_LOGIN_RESPONSE = False ...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, qualities, xpath_text, ) class TurboIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?turbo\.fr/videos-voiture/(?P<id>[0-9]+)-' _API_URL =...
# coding=utf-8 import sqlite3 # noinspection PyUnresolvedReferences,SqlResolve class Database(object): """ 数据库操作对象 """ def __init__(self): self.conn = None ''' 提交 ''' def commit(self): self.conn.commit() ''' 关闭 ''' def close(self): self.conn.c...
"""Main entry point for Swarming backend handlers.""" import datetime import json import logging import webapp2 from google.appengine.api import datastore_errors from google.appengine.ext import ndb from google.appengine import runtime from google.protobuf import json_format from proto.api import plugin_pb2 from c...
__author__ = 'shahbaz' from optparse import OptionParser from mininet.node import RemoteController from mininet.net import Mininet, CLI from mininet.topo import SingleSwitchTopo, LinearTopo from mininet.log import setLogLevel from netasm.back_ends.soft_switch.mininet.node import NetASMSwitch def test(): op = Op...
from neutron.tests.unit.ml2 import test_ml2_plugin from neutron.tests.unit.openvswitch import test_agent_scheduler class Ml2AgentSchedulerTestCase( test_agent_scheduler.OvsAgentSchedulerTestCase): plugin_str = test_ml2_plugin.PLUGIN_NAME l3_plugin = ('neutron.services.l3_router.' 'l3_rout...
"""A collection of functions to be used as evaluation metrics.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib import losses from tensorflow.contrib.learn.python.learn.estimators import prediction_key from tenso...
from mod_pywebsocket import util class XHRBenchmarkHandler(object): def __init__(self, headers, rfile, wfile): self._logger = util.get_class_logger(self) self.headers = headers self.rfile = rfile self.wfile = wfile def do_send(self): content_length = int(self.headers....
""" Journal Tab of Learner Dashboard views """ from datetime import datetime, time import logging from django.http import Http404 from edxmako.shortcuts import render_to_response from openedx.core.djangoapps.programs.models import ProgramsApiConfig from openedx.features.journals.api import ( fetch_journal_access,...
import array from PIL import Image, ImageColor class ImagePalette: "Color palette for palette mapped images" def __init__(self, mode = "RGB", palette = None): self.mode = mode self.rawmode = None # if set, palette contains raw data self.palette = palette or list(range(256))*len(self.m...
"""Negative compilation test for Google Test.""" __author__ = '<EMAIL> (Zhanyong Wan)' import os import sys import unittest IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' if not IS_LINUX: sys.exit(0) # Negative compilation tests are not supported on Windows & Mac. class GTestNCTest(unittest.TestCas...
import os,sys import copy, json import re g_dbg = '-dbg' in sys.argv or False g_force_keep_indent = '-force_keep_indent' in sys.argv g_kill_indent = True g_enable_lzmath = False if '-no_lzmath' in sys.argv else True g_re1 = re.compile(r"(\\)([A-Z])\b") g_re1_subst = '\mathbb{\\2}' g_re2 = re.compile(r"(])([A-Z])\b") ...
""" Support for Forecast.io weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.forecast/ """ import logging from datetime import timedelta from blumate.const import CONF_API_KEY, TEMP_CELSIUS from blumate.helpers.entity import Entity...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2, 7): pytestmark = pytest.mark.skip("F5 Ansible modules require Python >= 2.7") from ansible.module_utils.basic import AnsibleModule try: from librar...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'core'} EXAMPLES = r""" # Before 2.3, option 'dest' or 'name' was used instead of 'path' - name: insert/update "Match User" configuration block in /etc/ssh/sshd_config blockinfile: path:...
from __future__ import absolute_import import datetime import logging import os import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six from .packages.six.moves.http_client import HTTPConnection as _HTTPConnection from .packages.six.moves.http_client imp...
""" View configurations of user information for Users APIs in Common Repo project. """ from __future__ import absolute_import, unicode_literals from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from rest_framework import permissions from rest_framework import renderers from re...
#!/usr/bin/env python """ Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from xml.dom import minidom import os import sys import compound import indexsuper as supermod class DoxygenTypeSub(supermod.DoxygenType): def __init__(self, version=None, compound=None): supermod.DoxygenType.__init__(se...
import hr_evaluation_report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
from django.test import TestCase, Client from ...models import Country from django.core.exceptions import ObjectDoesNotExist import json from django.utils import timezone class CountryViewTestCase(TestCase): def test_post(self): country1 = Country.objects.create(name="Italy") c = Client() ...
""" IDLRelease for PPAPI This file defines the behavior of the AST namespace which allows for resolving a symbol as one or more AST nodes given a Release or range of Releases. """ import sys from idl_log import ErrOut, InfoOut, WarnOut from idl_option import GetOption, Option, ParseOptions Option('release_debug', '...
import base64 import json import os import re import url_fetcher_fake from extensions_paths import SERVER2 from path_util import IsDirectory from test_util import ReadFile, ChromiumPath import url_constants # TODO(kalman): Investigate why logging in this class implies that the server # isn't properly caching some fe...
import json from PIL import Image, ImageTk from cv2 import imread, imwrite from numpy import zeros, unique from tkinter import Toplevel, Label from glob import glob import os from re import search def change_values(data): removex = data[0]["X"] removey = data[0]["Y"] for cell in data: cell["X"] = ...
""" ========================================================= Hashing feature transformation using Totally Random Trees ========================================================= RandomTreesEmbedding provides a way to map data to a very high-dimensional, sparse representation, which might be beneficial for classificati...
"""Sanity test using yamllint.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import os from .. import types as t from ..sanity import ( SanitySingleVersion, SanityMessage, SanityFailure, SanitySuccess, SANITY_ROOT, ) from ..target import (...
#! /usr/bin/python3 import binascii import struct from . import (util, config, exceptions, jetcoin, util, rps) # move random rps_match_id FORMAT = '>H16s32s32s' LENGTH = 2 + 16 + 32 + 32 ID = 81 def validate (db, source, move, random, rps_match_id): problems = [] rps_match = None if not isinstance(move...
# This is a helper module for test_threaded_import. The test imports this # module, and this module tries to run various Python library functions in # their own thread, as a side effect of being imported. If the spawned # thread doesn't complete in TIMEOUT seconds, an "appeared to hang" message # is appended to the m...
__all__ = [ 'split', 'mkNonce', 'checkTimestamp', ] from openid import cryptutil from time import strptime, strftime, gmtime, time from calendar import timegm import string NONCE_CHARS = string.ascii_letters + string.digits # Keep nonces for five hours (allow five hours for the combination of # reque...
from __future__ import print_function import sys # This is not required if you've installed pycparser into # your site-packages/ with setup.py # sys.path.extend(['.', '..']) from pycparser import parse_file, c_parser, c_generator def translate_to_c(filename): """ Simply use the c_generator module to emit a pars...
import zstackwoodpecker.header.header as zstack_header CONNECTED = 'Connected' CONNECTING = 'Connecting' DISCONNECTED = 'Disconnected' ENABLED = 'Enabled' DISABLED = 'Disabled' PREMAINTENANCE = 'PreMaintenance' MAINTENANCE = 'Maintenance' class TestHost(zstack_header.ZstackObject): def __init__(self): self...
from __future__ import unicode_literals import datetime import decimal from collections import defaultdict from django.contrib.auth import get_permission_codename from django.core.exceptions import FieldDoesNotExist from django.db import models from django.db.models.constants import LOOKUP_SEP from django.db.models.d...
# -*- coding: utf-8 -*- import six from .. import i18n, ImproperlyConfigured from ..utils import str_coercible @str_coercible class Currency(object): """ Currency class wraps a 3-letter currency code. It provides various convenience properties and methods. :: from babel import Locale ...