content
string
from __future__ import print_function import sys, os, operator from collections import Counter from eyed3 import id3, mp3 from eyed3.core import AUDIO_MP3 from eyed3.utils import guessMimetype from eyed3.utils.console import Fore, Style, printMsg from eyed3.plugins import LoaderPlugin from eyed3.id3.frames import Imag...
"""A simple baseline feed-forward neural network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.tensor_forest.hybrid.python import hybrid_model from tensorflow.contrib.tensor_forest.hybrid.python.layers import fully_connected fro...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from actstream.compat import user_model_label class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Action.timestamp' db.alter_column('actstream_act...
from libsaas import http, parsers from libsaas.services import base from .resource import BasecampResource from .comments import Comments from . import accesses as acc class CalendarEventResource(BasecampResource): path = 'calendar_events' class CalendarEvents(CalendarEventResource): @base.apimethod d...
#!/usr/bin/env python import os import re import sys from codecs import open try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() packages = [ 'requests', 'requests.packages'...
import sys sys.path.append('../../python/') import mxnet as mx import logging def ConvFactory(data, num_filter, kernel, stride=(1,1), pad=(0, 0), name=None, suffix=''): conv = mx.symbol.Convolution(data=data, num_filter=num_filter, kernel=kernel, stride=stride, pad=pad, name='conv_%s%s' %(name, suffix)) bn = m...
try: # Only exists in Python 2.4+ from threading import local except ImportError: # Import copy of _thread_local.py from Python 2.4 from django.utils._threading_local import local class BaseDatabaseWrapper(local): """ Represents a database connection. """ ops = None def __init__(sel...
import inspect import json import sys import os import renpy # A list of (name, filename, linenumber) tuples, for various types of # name. These are added to as the definitions occur. definitions = [ ] transforms = [ ] screens = [ ] # Does a file exist? We cache the result here. file_exists_cache = { } def file_e...
"""SCons.Tool.rpm Tool-specific initialization for rpm. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. The rpm tool calls the rpmbuild command. The first and only argument should a tar.gz consisting of the sourc...
"""Student aggregate collection of page enter/exit events.""" __author__ = ['Michael Gainer (<EMAIL>)'] import collections import datetime import urlparse from common import schema_fields from models import courses from models import transforms from modules.analytics import student_aggregate from tools import verify...
"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers should be based on this code. """ import handler from _exceptions import SAXNotSupportedException, SAXNotRecognizedException # ===== XMLREADER ===== class XMLReader: """Interface for reading an XML document using callbacks. XMLReader is the...
import json # django imports from django.contrib.auth.decorators import permission_required from django.core.exceptions import ObjectDoesNotExist from django.core.paginator import Paginator, EmptyPage from django.urls import reverse from django.db.models import Q from django.http import HttpResponseRedirect from djang...
from south.db import db from django.db import models from mysite.profile.models import * class Migration: def forwards(self, orm): # Adding field 'Person.last_polled' db.add_column('profile_person', 'last_polled', models.DateTimeField(default=datetime.datetime(1970, 1, 1, 0, 0))) ...
"""Adamax 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.keras import backend_config from tensorflow.python.keras.optimizer_v2 import optimizer_v2 from tensorflow.python.o...
#!/usr/bin/env python3 import bs4 import json import urllib.request from collections import OrderedDict url = ''' http://minecraft.gamepedia.com/api.php?action=parse&format=json&prop=text&title=Data_values&text=%7B%7B%3AData+values%2FItem+IDs%7D%7D '''.strip() def get_items_data(): req = urllib.request.Request(...
"""TensorFlow collective Ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import device from tensorflow.python.ops import gen_collective_ops def all_reduce(t, group_size, group_key, instance_key, merge_op, final_op, ...
"""Proxy for coordinates stored outside Shapely geometries """ from shapely.geometry.base import deserialize_wkb, EMPTY from shapely.geos import lgeos class CachingGeometryProxy(object): context = None factory = None __geom__ = EMPTY _gtag = None def __init__(self, context): self.contex...
# -*- coding: utf-8 -*- """ *************************************************************************** las2demPro.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- ...
from msrest.serialization import Model class BootDiagnostics(Model): """Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. <br><br> For Linux Virtual Machines, you can easily view the output of your console log. <br><br> For both Windo...
from webcomix.comic import Comic from webcomix.search import discovery from webcomix.tests.fake_websites.fixture import ( one_webpage_searchable_uri, three_webpages_uri, three_webpages_classes_uri, ) def test_search_searchable_website(mocker, three_webpages_classes_uri): expected = Comic( "Bli...
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unified_strdate, ) class NormalbootsIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?normalboots\.com/video/(?P<videoid>[0-9a-z-]*)/?$' _TEST = { 'url': 'http://normalbo...
import time from openerp.osv import osv, fields from openerp.osv.orm import browse_record, browse_null from openerp.tools.misc import attrgetter # ------------------------------------------------------------------------- # Properties # ------------------------------------------------------------------------- class i...
from django.conf import settings import os def get_streaming_supported(): """ example settings file FILESERVICE_CONFIG = { 'streaming_supported': True } """ conf = getattr(settings, 'FILESERVICE_CONFIG', {}) return conf.get('streaming_supported', False) def get_fileservice_dir():...
from oslo_utils import strutils from webob import exc from nova.api.openstack import api_version_request from nova.api.openstack import common from nova.api.openstack.compute.schemas import evacuate from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api import validation from nova ...
""" Common functions used to report the results of tests. """ import sys from enum import Enum class Color(Enum): RED = 31 GREEN = 32 class Status(Enum): """ Enum to represent success/failure. The values are the color codes used to print the status. """ PASSED = Color.GREEN FAILED =...
""" AMF metadata (inside Flash video, FLV file) parser. Documentation: - flashticle: Python project to read Flash (formats SWF, FLV and AMF) http://undefined.org/python/#flashticle Author: Victor Stinner Creation date: 4 november 2006 """ from hachoir_py2.field import (FieldSet, ParserError, ...
import mock from oslo_config import fixture as config_fixture from oslo_serialization import jsonutils from murano.api.v1 import environments from murano.api.v1 import sessions from murano.db import models from murano.db import session as db_session from murano.services import states import murano.tests.unit.api.base ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ast import literal_eval from itertools import islice, chain import types from jinja2.runtime import StrictUndefined from ansible.module_utils._text import to_text from ansible.module_utils.common.collections import is_seque...
""" homeassistant.components.notify.instapush ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Instapush notification service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.instapush.html """ import logging import json from homeassistant.helpers import...
""" Collect and index AmberResidueType instances from amber topology files. """ from biskit import PDBModel, AmberPrepParser, StdLog import biskit.tools as T class AmberResidueLibraryError( Exception ): pass class AmberResidueLibrary: """ A collection of reference residue types taken from Amber topology ...
# -*- coding: utf-8 -*- import pdb from pprint import pprint import re import sys import os sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib'))) import config from models import Superblock, Proposal, GovernanceObject, Setting, Signal, Vote, Outcome from models import VoteSignals, VoteOut...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from gaebusiness.business import CommandExecutionException from tekton.gae.middleware.json_middleware import JsonResponse from course_app import facade def index(): cmd = facade.list_courses_cmd() course_list = cmd() short_fo...
"""TensorFlow-related utilities.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.python.eager import context from tensorflow.python.framework import ops from tensorflow.python.framework import smart_cond as smart_module from te...
from django.conf.urls import patterns, include urlpatterns = patterns('', # test_client modeltest urls (r'^test_client/', include('modeltests.test_client.urls')), (r'^test_client_regress/', include('regressiontests.test_client_regress.urls')), # File upload test views (r'^file_uploads/', include('...
{ 'name': 'Gamification', 'version': '1.0', 'author': 'OpenERP SA', 'category': 'Human Ressources', 'depends': ['mail', 'email_template', 'web_kanban_gauge'], 'description': """ Gamification process ==================== The Gamification module provides ways to evaluate and motivate the users of ...
# -*- coding: utf-8 -*- ''' @author: lizheng @date: 2014-01-01 ''' import requests import urllib import re import json from pprint import pprint from django.conf import settings CLIENT_ID = '266639437' CLIENT_SECRET = 'b10ce4a1500d819a2c5437b7d6d1ea79' API_URL = 'https://api.weibo.com' REDIRECT_URI = '%s/account/oau...
import unittest from moya import urlmapper from moya.urlmapper import RouteMatch class TestURLMapper(unittest.TestCase): def setUp(self): self.mapper = urlmapper.URLMapper() self.mapper.map("/", "front") self.mapper.map("/page/", "page", defaults={"page": "front"}) self.mapper.map(...
"""convert Gettext PO localization files to iCal files""" from translate.storage import factory from translate.storage import ical class reical: def __init__(self, templatefile, inputstore): self.templatefile = templatefile self.templatestore = ical.icalfile(templatefile) self.inputstore...
import zmq import pmt import threading class rpc_manager(): def __init__(self): self.zmq_context = zmq.Context() self.poller_rep = zmq.Poller() self.poller_req_out = zmq.Poller() self.poller_req_in = zmq.Poller() self.interfaces = dict() def __del__(self): self...
import unittest import httpclient import platformsettings class RealHttpFetchTest(unittest.TestCase): # Initialize test data CONTENT_TYPE = 'content-type: image/x-icon' COOKIE_1 = ('Set-Cookie: GMAIL_IMP=EXPIRED; ' 'Expires=Thu, 12-Jul-2012 22:41:22 GMT; ' 'Path=/mail; Secure') C...
"""A module for the run command.""" import cr class RunCommand(cr.Command): """The implementation of the run command. This first uses Builder to bring the target up to date. It then uses Installer to install the target (if needed), and finally it uses Runner to run the target. You can use skip version to ...
from __future__ import unicode_literals import os from mach.base import MachError from mach.main import Mach from mach.test.common import TestBase from mozunit import main def _populate_context(context, key=None): if key is None: return if key == 'foo': return True if key == 'bar': ...
""" Module implementing a graphics item for an association between two items. """ from __future__ import unicode_literals from PyQt5.QtCore import QPointF, QRectF, QLineF from PyQt5.QtWidgets import QGraphicsItem from E5Graphics.E5ArrowItem import E5ArrowItem, NormalArrow, WideArrow import Utilities Normal = 0 Ge...
# -*- coding: utf-8 -*- """ pygments.lexers.d ~~~~~~~~~~~~~~~~~ Lexers for D languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, include, words from pygments.token import Text, Comment, Ke...
import json import random import requests from flask import request from twilio.rest import TwilioRestClient from . import app from config import FLICKR_API_KEY client = TwilioRestClient() @app.route('/', methods=['GET', 'POST']) def send_image(): if request.method == 'GET': return 'The deployment work...
from openerp.tests import common class TestMoveExplode(common.TransactionCase): def setUp(self): super(TestMoveExplode, self).setUp() cr, uid = self.cr, self.uid # Usefull models self.ir_model_data = self.registry('ir.model.data') self.sale_order_line = self.registry('sal...
"""Loads the _boosted_trees_ops.so when the binary is not statically linked.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.util import loader from tensorflow.python.framework import errors from tensorflow.python.platform import ...
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
# Based on @berenm's pull request https://github.com/quarnster/SublimeClang/pull/135 # Create the database with cmake with for example: cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON .. # or you could have set(CMAKE_EXPORT_COMPILE_COMMANDS ON) in your CMakeLists.txt # Usage within SublimeClang: # "sublimeclang_options_scri...
#!/usr/bin/env python # life.py -- A curses-based version of Conway's Game of Life. # Contributed by AMK # # An empty board will be displayed, and the following commands are available: # E : Erase the board # R : Fill the board randomly # S : Step for a single generation # C : Update continuously until a key is str...
from openerp import models, fields, api class AccountInvoiceReport(models.Model): _inherit = "account.invoice.report" actual_cost_total = fields.Float(string="Total Actual Cost", readonly=True, help="Total Actual Costs of invoices") margin_avg = fields.Float(string="M...
# uncompyle6 version 2.9.10 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: Mcl_Cmd_DomainController_DataHandler.py def DataHandlerMain(namespace, InputFilename, OutputFilename): import mcl.imports import mcl.data.I...
from math import sqrt from edisgo.grid.components import Storage, Line, LVStation from edisgo.grid.grids import MVGrid from edisgo.grid.tools import select_cable def storage_at_hvmv_substation(mv_grid, parameters, mode=None): """ Place storage at HV/MV substation bus bar. Parameters ---------- mv...
from __future__ import print_function import unittest import numpy as np from op_test import OpTest import paddle import paddle.fluid as fluid import paddle.fluid.layers as layers from paddle.fluid import core from paddle.fluid.framework import switch_main_program from simple_nets import simple_fc_net, init_data from...
""" Application-specific exceptions raised by the block structure framework. """ class BlockStructureException(Exception): """ Base class for all Block Structure framework exceptions. """ pass class TransformerException(BlockStructureException): """ Exception class for Transformer related er...
# -*- coding: UTF-8 -*- """develop tests """ import sys import os, shutil, tempfile, unittest import tempfile import site from distutils.errors import DistutilsError from setuptools.compat import StringIO from setuptools.command.test import test from setuptools.command import easy_install as easy_install_pkg from set...
# -*- coding: latin-1 -*- from state import * from copy import copy # A classe robot representa um robo # state_map representa o mapa interno do robo, que é construido conforme ele anda # start é a posição inicial # position é a posição atual do robo # goal é o objetivo # open_list guarda os estados que estão com t =...
import logging import random import string import sys import time import avro.datafile import avro.io import avro.schema TYPES = ('A', 'CNAME',) FILENAME = 'datafile.avr' def GenerateRandomName(): return ''.join(random.sample(string.ascii_lowercase, 15)) def GenerateRandomIP(): return '%s.%s.%s.%s' % ( ...
#!/usr/bin/env python # -*- coding: utf8 -*- import os, os.path, shutil, logging, sys, filecmp, stat, re, time from puke.FileList import * from puke.Console import * from scss import Scss from puke.FileSystem import * from puke.Compress import * from puke.Std import * from puke.ToolsExec import * from puke.Cache ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, parse_iso8601, ) class GodTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?godtube\.com/watch/\?v=(?P<id>[\da-zA-Z]+)' _TESTS = [ { 'url': 'https://ww...
from supybot.test import * class DunnoTestCase(ChannelPluginTestCase): plugins = ('Dunno', 'User') def setUp(self): PluginTestCase.setUp(self) self.prefix = 'foo!bar@baz' self.assertNotError('register tester moo', private=True) def testDunnoAdd(self): self.assertNotError('d...
import pybullet as p p.connect(p.SHARED_MEMORY) p.resetSimulation() objects = [p.loadURDF("plane.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] objects = [p.loadURDF("samurai.urdf", 0.000000,0.000000,0.000000,0.000000,0.000000,0.000000,1.000000)] objects = [p.loadURDF("pr2_gripper.urdf", 0.500...
""" Middleware to identify the country of origin of page requests. Middleware adds `country_code` in session. Usage: # To enable the Geoinfo feature on a per-view basis, use: decorator `django.utils.decorators.decorator_from_middleware(middleware_class)` """ import logging import pygeoip from ipware.ip import get...
import sys from twisted.internet import reactor from twisted.python import log from twisted.web.server import Site from twisted.web.static import Data from autobahn.websocket import WebSocketServerFactory, \ WebSocketServerProtocol from autobahn.resource import WebSocketResource clas...
""" An error to represent bad things happening in Conch. Maintainer: Paul Swartz """ from twisted.cred.error import UnauthorizedLogin class ConchError(Exception): def __init__(self, value, data = None): Exception.__init__(self, value, data) self.value = value self.data = data class N...
from nova.scheduler import filters from nova.scheduler.filters import utils class AggregateTypeAffinityFilter(filters.BaseHostFilter): """AggregateTypeAffinityFilter limits instance_type by aggregate return True if no instance_type key is set or if the aggregate metadata key 'instance_type' has the insta...
from __future__ import print_function import theano.tensor as T import numpy as np from theano.compat.six.moves import xrange from theano import config from theano import function import time from pylearn2.utils import sharedX from pylearn2.sandbox.cuda_convnet.probabilistic_max_pooling import \ prob_max_pool...
#!/usr/bin/python import time import smbus from Adafruit_I2C import Adafruit_I2C # =========================================================================== # SDL_BM017 / TCS34725 color sensor i2c driver Class # SwitchDoc Labs / Project Curacao # originally from Project Curacao # Version 1.1 # 2/14/14 # # ========...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/catalog/catalog_tab_template.ui' # # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore...
from tempest.api.network import base from tempest.common.utils import data_utils class BaseSecGroupTest(base.BaseNetworkTest): def _create_security_group(self): # Create a security group name = data_utils.rand_name('secgroup-') group_create_body = self.client.create_security_group(name=na...
class PymagingException(Exception): pass class FormatNotSupported(PymagingException): pass class InvalidColor(PymagingException): pass
''' Problem: design and implement a call center which has 3 types of employees: respondents, managers, directors. A call is answered by the first available respondent. If the respondent can't handle the call, they must escalate to a manager. If the manager can't handle it or is not free, they must escalate ...
# -*- coding: utf-8 -*- from datetime import datetime from framework.sessions import session, create_session, Session from modularodm import Q from framework import bcrypt from framework.auth import signals from framework.auth.exceptions import DuplicateEmailError from .core import User, Auth from .core import get_u...
""" An implementation of stochastic max-pooling, based on Stochastic Pooling for Regularization of Deep Convolutional Neural Networks Matthew D. Zeiler, Rob Fergus, ICLR 2013 """ __authors__ = "Mehdi Mirza" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Mehdi Mirza", "Ian Goodfellow"] _...
#!/usr/bin/python3 ''' KMUX - a free and open source small business server. Copyright (C) 2015, Julian Thomé <<EMAIL>> 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 2 of the License,...
__all__ = ['set_debugprint_fn', 'Device', 'Printer', 'activateNewPrinter', 'copyPPDOptions', 'getDevices', 'getPrinters', 'missingPackagesAndExecutables', 'missingExecutables', 'parseDeviceID', 'setPPDPageSize', 'ppds', 'openprinting']...
# -*- coding: utf-8 -*- import datetime from openerp import api, models, _ from openerp.tools.safe_eval import safe_eval as eval # # Use period and Journal for selection or resources # class ReportAssertAccount(models.AbstractModel): _name = 'report.account_test.report_accounttest' @api.model def execute...
# coding: utf-8 # # Recovering rotation periods in simulated LSST data from __future__ import print_function import numpy as np import matplotlib.pyplot as plt from gatspy.periodic import LombScargle from toy_simulator import simulate_LSST import simple_gyro as sg import pandas as pd import sys def find_nearest(arra...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Blockstack ~~~~~ copyright: (c) 2014-2015 by Halfmoon Labs, Inc. copyright: (c) 2016 by Blockstack.org This file is part of Blockstack Blockstack is free software: you can redistribute it and/or modify it under the terms of the GNU General...
"""SMTP email backend class.""" import smtplib import socket import threading from django.conf import settings from django.core.mail.backends.base import BaseEmailBackend from django.core.mail.utils import DNS_NAME from django.core.mail.message import sanitize_address class EmailBackend(BaseEmailBackend): """ ...
#!/usr/bin/env python3 import asyncio import telepot import yaml import datetime import random import math import dataset from . import help, task def format_seconds_as_mm_ss(seconds): return "{}:{:02}".format( math.floor(seconds/60.0), math.floor(seconds) % 60) class Tomato(telepot.helper.ChatHandler):...
from typing import Callable, Any import sys from collections import ChainMap from collections.abc import Mapping from functools import wraps from pyramid.config import * from pyramid.config import Configurator from tet.decorators import deprecated from tet.i18n import configure_i18n from tet.util.collections import ...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule try: from ansible.module_utils.avi import ( avi_common_argument_spec, HAS_AVI, avi_ansible_api) except ImportError:...
from __future__ import unicode_literals import os from django.conf import settings from django.contrib.gis.geos import GEOSGeometry from django.contrib.gis.geoip import GeoIP, GeoIPException from django.utils import unittest # Note: Requires use of both the GeoIP country and city datasets. # The GEOIP_DATA path shoul...
from core.himesis import Himesis, HimesisPostConditionPattern import cPickle as pickle class HTakeRulePivotRHS(HimesisPostConditionPattern): def __init__(self): """ Creates the himesis graph representing the AToM3 model HTakeRulePivotRHS. """ # Create the himesis graph ...
import mrp import stock import product import wizard import report import company import procurement import res_config # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
""" Base file for Grades tests """ from crum import set_current_request from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from lms.djangoapps.course_blocks.api import get_course_blocks from openedx.core.djangolib.testing.utils import get_mock_request from student.models import CourseEnrollme...
from __future__ import print_function import logging from argparse import ArgumentParser import os import re import shutil import subprocess import sys import tempfile from threading import Thread, Lock import time import uuid if sys.version < '3': import Queue else: import queue as Queue from multiprocessing i...
import collections import os.path import mimetypes import base64 from openerp.osv.orm import Model class IrAttachment(Model): _inherit = 'ir.attachment' def get_binary_extension( self, cr, uid, model, ids, binary_field, filename_field=None, context=None): result = {} f...
"""Script to install ARM root image for cross building of ARM chrome on linux. This script can be run manually but is more often run as part of gclient hooks. When run from hooks this script should be a no-op on non-linux platforms. The sysroot image could be constructed from scratch based on the current state or prec...
from melkman.green import green_init green_init() from datetime import datetime, timedelta from eventlet.green import socket from eventlet.support.greenlets import GreenletExit from eventlet.wsgi import server as wsgi_server import os import time from urlparse import urlsplit from urllib import quote_plus from webob i...
"""Test Z-Wave lights.""" from unittest.mock import patch, MagicMock from homeassistant.components import zwave from homeassistant.components.zwave import const, light from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_TRANSITION, SUPPORT_BRIGHTNESS, ...
import os import shutil import tarfile from lib.util.mysqlBaseTestCase import mysqlBaseTestCase server_requirements = [["--innodb_strict_mode --innodb_file_per_table --innodb_file_format=Barracuda"]] servers = [] server_manager = None test_executor = None # we explicitly use the --no-timestamp option # here. We will...
#!/usr/bin/env python """ Handler of timestamps which operation type is insert op=insert """ __author__ = "Yaroslav Litvinov" __copyright__ = "Copyright 2016, Rackspace Inc." __email__ = "<EMAIL>" ENCODE_ESCAPE = 1 ENCODE_ONLY = 0 NO_ENCODE_NO_ESCAPE = None def format_string_insert_query(table, psql_schema_name, ta...
from __future__ import absolute_import class VdsmException(Exception): code = 0 message = "Vdsm Exception" def __init__(self, code=0, message='Vdsm Exception'): self.code = code self.message = message def __str__(self): return self.message def response(self): ret...
""" Exercise the wallet backup code. Ported from walletbackup.sh. Test case is: 4 nodes. 1 2 and 3 send transactions between each other, fourth node is a miner. 1 2 3 each mine a block to start, then Miner creates 100 blocks so 1 2 3 each have 50 mature coins to spend. Then 5 iterations of 1/2/3 sending coins amongst...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} # =========================================== # Module execution. # import json import sock...
"""Module for parsing the output of /proc/cpuinfo""" from hwinfo.util import CommandParser REGEX_TEMPLATE = r'%s([\ \t])+\:\ (?P<%s>.*)' class CPUInfoParser(CommandParser): ITEM_SEPERATOR = "\n\n" ITEM_REGEXS = [ REGEX_TEMPLATE % ('processor', 'processor'), REGEX_TEMPLATE % ('vendor_id', 'v...
""" Testing dataset creation with unicode characters """ from bigmler.tests.world import (world, common_setup_module, common_teardown_module, teardown_class) import bigmler.tests.dataset_advanced_steps as dataset_adv import bigmler.tests.basic_tst_prediction_steps as test_pred d...
from django.utils.encoding import python_2_unicode_compatible from ..models import models @python_2_unicode_compatible class NamedModel(models.Model): name = models.CharField(max_length=25) objects = models.GeoManager() class Meta: abstract = True required_db_features = ['gis_enabled'] ...