content
string
"""Upgrade script to move from pre-release schema to new schema. Usage examples: bazel run tensorflow/lite/schema/upgrade_schema -- in.json out.json bazel run tensorflow/lite/schema/upgrade_schema -- in.bin out.bin bazel run tensorflow/lite/schema/upgrade_schema -- in.bin out.json bazel run tensorflow/lite/schema/upg...
"""A `QueueRunner` that takes a feed function as an argument.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import threading from tensorflow.python.framework import errors from tensorflow.python.platform import tf_logging as logging from tensorflow.py...
#!/usr/bin/env python # flake8: noqa import nose from itertools import product from distutils.version import LooseVersion import pandas as pd from pandas.util import testing as tm from pandas.computation.engines import _engines import pandas.computation.expr as expr ENGINES_PARSERS = list(product(_engines, expr._p...
# -*- coding: utf-8 -*- """The output modules CLI arguments helper.""" import sys from plaso.cli import tools from plaso.cli.helpers import interface from plaso.cli.helpers import manager from plaso.lib import errors from plaso.output import manager as output_manager class OutputModulesArgumentsHelper(interface.Arg...
import os import socket import StringIO import traceback from django.conf import settings import commonware.log from PIL import Image import amo.search from amo.helpers import user_media_path from applications.management.commands import dump_apps monitor_log = commonware.log.getLogger('z.monitor') def memcache():...
import base64 import datetime import json from protorpc import message_types from protorpc import messages from protorpc import util import unittest2 from apitools.base.py import encoding from apitools.base.py import exceptions class SimpleMessage(messages.Message): field = messages.StringField(1) repfield ...
""" Unit tests for the common functions used by different CLI interfaces. """ import sys import fixtures import mock from six.moves import StringIO from nova.cmd import common as cmd_common from nova.db import api from nova import exception from nova import test class TestCmdCommon(test.NoDBTestCase): @mo...
from __future__ import annotations from collections import namedtuple from flask import url_for from baseframe import __ import baseframe.forms as forms from ..models import User, notification_type_registry from ..transports import platform_transports __all__ = [ 'transport_labels', 'UnsubscribeForm', ...
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Read some AVS UCD data in ASCII form r = vtk.vtkAVSucdReader() r.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/cellsnd.ascii.inp") AVSMapper = vtk.vtkDataSetMapper() AVSMap...
from __future__ import absolute_import, division, print_function __metaclass__ = type import errno import json from units.mock.procenv import ModuleTestCase, swap_stdin_and_argv from ansible.compat.tests.mock import patch, MagicMock, mock_open, Mock from ansible.module_utils.six.moves import builtins realimport = b...
"""Fichier contenant le paramètre dynamique de la commande 'prompt'.""" from primaires.format.fonctions import supprimer_accents from primaires.interpreteur.masque.parametre import Parametre # Constantes AIDE = """ Utilisez cette commande pour consulter ou modifier votre {courte}. ...
# encoding: utf-8 from __future__ import unicode_literals from collections import Mapping from bson import ObjectId as OID from bson import DBRef from bson.errors import InvalidId from .. import Document, Field from ....package.canonical import name as canon from ....package.loader import traverse from ....schema i...
from tornado import web from sprockets.http import app, mixins import sprockets.http class StatusHandler(mixins.ErrorLogger, mixins.ErrorWriter, web.RequestHandler): """Example that exercises the mix-ins in this library.""" def get(self, status_code): """ Returns the requ...
""" WSGI config for weblate project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
"""Unit tests to cover Logger.""" __author__ = '<EMAIL> (Joseph DiLallo)' import logging import os import sys sys.path.insert(0, os.path.join('..', '..', '..', '..')) import unittest from adspygoogle.common import Utils from tests.adspygoogle.dfa.v1_19 import client from tests.adspygoogle.dfa.v1_19 import HTTP_PROXY...
from devp2p.service import BaseService from ethereum.slogging import get_logger log = get_logger('db') # load available databases dbs = {} try: from leveldb_service import LevelDBService except ImportError: pass else: dbs['LevelDB'] = LevelDBService try: from codernitydb_service import CodernityDB ex...
""" A.Mereghetti, 2017-01-29 script for parsing the server_status.php and getting values from tables NB: html file is a table of tables! parsing of HTML table based on: http://codereview.stackexchange.com/questions/60769/scrape-an-html-table-with-python reminders on html tables: - <table>: start a new table; - <tr>: ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.plugins.action.network import ActionModule as ActionNetworkModule class ActionModule(ActionNetworkModule): def run(self, tmp=None, task_vars=None): del tmp # tmp no longer has any effect self._...
import os, re, datetime from subprocess import call, Popen, PIPE class Testbed(): log_dir_name = 'log' def __init__(self): pass def initCleanWithFlash(self): self.stop() self.cleanLogs() self.flashNodes() self.start() def initClean(self): self.cleanLo...
"""Terminator by Chris Jones <<EMAIL>> Validator and functions for dealing with Terminator's customisable keyboard shortcuts. """ import re from gi.repository import Gtk, Gdk from util import err class KeymapError(Exception): """Custom exception for errors in keybinding configurations""" MODIFIER = re.compile...
"""Support for Ambiclimate devices.""" import logging import voluptuous as vol from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET from homeassistant.helpers import config_validation as cv from . import config_flow from .const import DOMAIN _LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = vol.S...
""" Test grading events across apps. """ # pylint: disable=protected-access from mock import call as mock_call, patch from unittest import skip from capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from courseware.tests.test_submitting_problems import ProblemSubmissionTestMixin from lms.djangoa...
# -*- coding: utf-8 -*- from tests.base import TestCase from vilya.models.user_fav import UserFavItem from vilya.models.consts import K_PULL, K_ISSUE class TestUser(TestCase): def test_add_fav(self): user_id = "testuser" pull_id = 1 kind = K_PULL UserFavItem.add(user_id, pull_id...
"""The AstroidBuilder makes astroid from living object and / or from _ast The builder is not thread safe and can't be used to parse different sources at the same time. """ from __future__ import with_statement __docformat__ = "restructuredtext en" import sys from os.path import splitext, basename, exists, abspath f...
# -*- coding: utf-8 -*- """ Created on Wed Dec 5 21:44:22 2012 @author: cryan """ import numpy as np from numpy import sin, cos from scipy.constants import pi from scipy.linalg import expm, eigh from PySim.SystemParams import SystemParams from PySim.PulseSequence import PulseSequence from PySim.Simulation import s...
from beaker._compat import pickle import logging import pickle from datetime import datetime from beaker.container import OpenResourceNamespaceManager, Container from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter from beaker.synchronization import file_synchronizer, null_synchronizer from b...
BRANCH = "mozilla-beta" MOZ_UPDATE_CHANNEL = "beta" MOZILLA_DIR = BRANCH OBJDIR = "obj-l10n" STAGE_SERVER = "dev-stage01.srv.releng.scl3.mozilla.com" #STAGE_SERVER = "stage.mozilla.org" EN_US_BINARY_URL = "http://" + STAGE_SERVER + "/pub/mozilla.org/mobile/candidates/%(version)s-candidates/build%(buildnum)d/android/en-...
#!/usr/bin/python # $Id:$ import random import sys from pyglet.gl import * from pyglet import clock from pyglet import image from pyglet import window from pyglet.graphics import vertexdomain if len(sys.argv) > 1: SPRITES = int(sys.argv[1]) else: SPRITES = 2000 SPRITE_IMAGE = 'examples/noisy/ball.png' # Ho...
"""A more or less complete user-defined wrapper around dictionary objects.""" class UserDict: def __init__(*args, **kwargs): if not args: raise TypeError("descriptor '__init__' of 'UserDict' object " "needs an argument") self = args[0] args = args[1:]...
from openerp.osv import fields, osv from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp class sale_advance_payment_inv(osv.osv_memory): _name = "sale.advance.payment.inv" _description = "Sales Advance Payment Invoice" _columns = { 'advance_payment_method':fields.sel...
from __future__ import unicode_literals from django.db import models from django.test import TestCase from .models import ( First, Third, Parent, Child, Category, Record, Relation, Car, Driver) class ManyToOneRegressionTests(TestCase): def test_object_creation(self): Third.objects.create(id='3', nam...
from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as vcapi, raster as rcapi from django.utils import six from django.utils.encoding import force_bytes, force_text class Driver(GDALBas...
#!/usr/bin/env python ''' POX GUI This file creates the main application window, sets up the layout and invokes the GUI's widgets. The left panel (log) is used for displaying context-specific information. The right panel (topology) is an interactive display of the topology. @author Kyriakos Zarifis (<EMAIL>) ''' impo...
from tests.unit import unittest import xml.dom.minidom import xml.sax from boto.s3.website import WebsiteConfiguration from boto.s3.website import RedirectLocation from boto.s3.website import RoutingRules from boto.s3.website import Condition from boto.s3.website import RoutingRules from boto.s3.website import Routing...
try: from cs import CloudStack, CloudStackException, read_config has_lib_cs = True except ImportError: has_lib_cs = False # import cloudstack common from ansible.module_utils.cloudstack import * class AnsibleCloudStackPortforwarding(AnsibleCloudStack): def __init__(self, module): super(Ansib...
""" Nonogram (Painting by numbers) in Google CP Solver. http://en.wikipedia.org/wiki/Nonogram ''' Nonograms or Paint by Numbers are picture logic puzzles in which cells in a grid have to be colored or left blank according to numbers given at the side of the grid to reveal a hidden picture. In this puzzle...
import inspect, logging, os, sys, traceback from time import time from bl.dict import Dict from bl.json import JSON log = logging.getLogger(__name__) class Progress(JSON): """tabulate progress statistics for given processes, and report the progress of those processes""" def __init__(self, fn=None, data=None, key=...
import sys import re from sqlalchemy.connectors import Connector class MxODBCConnector(Connector): driver='mxodbc' supports_sane_multi_rowcount = False supports_unicode_statements = False supports_unicode_binds = False supports_native_decimal = False @classmethod def dbapi(cls): ...
import gdb from linux import cpus, utils, lists module_type = utils.CachedType("struct module") def module_list(): global module_type modules = utils.gdb_eval_or_none("modules") if modules is None: return module_ptr_type = module_type.get_type().pointer() for module in lists.list_for_...
__author__ = "Cyril Jaquier, Lee Clemens, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Yaroslav Halchenko" __license__ = "GPL" import Queue, logging from .actions import Actions from ..helpers import getLogger # Gets the instance of the logger. logSys = getLogger...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} import re from ansible.module_utils.network.nxos.nxos import load_config, run_commands from ansible.module_utils.network.nxos.nxos import nxos_argument_spec, check_args from ansibl...
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import sineModel as SM import stft as STFT import utilFunctions as UF plt.f...
# -*- coding: utf-8 -*- """ werkzeug.testsuite.wsgi ~~~~~~~~~~~~~~~~~~~~~~~ Tests the WSGI utilities. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from os import path from cStringIO import StringIO ...
import hr_attendance_error # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
#!/usr/bin/env python # -*- coding: utf-8 -*- def convert_to_existing_name( name ): if name == 'Hemato-immunologie' or name == 'H�mato-immunologie': return 'Hemto-Immunology' elif name == 'Biochimie': return 'Biochemistry' elif name == 'H�matologie' or name == 'Hematologie': ...
from django.template.loader import get_template, select_template from wagtailmenus.conf import settings from wagtailmenus.utils.inspection import accepts_kwarg def get_item_by_index_or_last_item(items, index): if items is None: return try: return items[index] except IndexError: re...
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("versio...
import os import unittest from mock import patch, PropertyMock, Mock, MagicMock, DEFAULT import numpy as np from nansat.pointbrowser import PointBrowser try: import matplotlib import matplotlib.pyplot as plt plt.switch_backend('Agg') except ImportError: MATPLOTLIB_IS_INSTALLED = False else: MATPLO...
"""Unit tests for the doorstop.vcs.base module.""" import unittest from unittest.mock import patch from doorstop.core.vcs.base import BaseWorkingCopy class SampleWorkingCopy(BaseWorkingCopy): """Sample WorkingCopy implementation.""" def __init__(self, path): super().__init__(path) self._ig...
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from .base import Client from ..parameters import prepare_token_request from ...
# -*- coding: utf-8 -*- from orgmode import settings from orgmode import ORGMODE, apply_count from orgmode.menu import Submenu, ActionEntry from orgmode.keybinding import Keybinding, Plug, MODE_NORMAL import vim class ShowHide(object): u""" Show Hide plugin """ def __init__(self): u""" Initialize plugin """ o...
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import traceback try: from botocore.exceptions import ClientError except ImportError: ...
import unittest from autothreadharness.harness_case import HarnessCase class Router_5_1_1(HarnessCase): role = HarnessCase.ROLE_ROUTER case = '5 1 1' golden_devices_required = 1 def on_dialog(self, dialog, title): pass if __name__ == '__main__': unittest.main()
''' Python module of NeuroM to check neuronal trees. ''' import numpy as np from neurom.core.dataformat import COLS from neurom import morphmath as mm from neurom.morphmath import principal_direction_extent from neurom._compat import range, filter def is_monotonic(neurite, tol): '''Check if neurite tree is monot...
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \ cs_clone, cs_getordinate, cs_setordinate, c...
# encoding: utf-8 """ An embedded IPython shell. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import with_statement from __future__ import print_function import sys import warnings from IPython.core import ultratb, compilerop from IPython.co...
import pkgutil import pkg_resources from thumbor import __version__ class ErrorHandler(object): def __init__(self, config, client=None): import raven dsn = config.SENTRY_DSN_URL if not dsn: raise RuntimeError( "If you set USE_CUSTOM_ERROR_HANDLING to True, and...
from . import chart class ChartScatter(chart.Chart): """ A class for writing the Excel XLSX Scatter charts. """ ########################################################################### # # Public API. # ########################################################################### ...
import argparse import datetime import hashlib import os import random import tarfile import uuid from Crypto import Random try: import yaml except ImportError: raise SystemExit('Missing Dependency, "PyYAML"') class CredentialGenerator(object): """Credential generator class. This class is simply a m...
import unittest import imath import IECore import Gaffer import GafferUI import GafferUITest class LinearContainerTest( GafferUITest.TestCase ) : def testConstruction( self ) : c = GafferUI.LinearContainer() self.assertEqual( c.getName(), "LinearContainer" ) self.assertEqual( c.getOrientation(), GafferUI.Li...
""" This is a stress test that saves and loads an OPF checkpoint multiple times, doing one compute step in between. This test was put in place to catch a crash bug. """ import datetime import numpy.random import os import shutil import tempfile import unittest2 as unittest from nupic.frameworks.opf.model_factory impo...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ TIGR contig format, see spec: <http://www.cbcb.umd.edu/research/contig_representation.shtml#contig> """ import sys import logging from jcvi.formats.base import BaseFile, read_block from jcvi.apps.base import OptionParser, ActionDispatcher class ReadLine(object): ...
""" ============================================================================= Manifold learning on handwritten digits: Locally Linear Embedding, Isomap... ============================================================================= An illustration of various embeddings on the digits dataset. The RandomTreesEmbed...
from __future__ import unicode_literals import re import unicodedata from gzip import GzipFile from io import BytesIO from django.utils import six from django.utils.encoding import force_text from django.utils.functional import SimpleLazyObject, keep_lazy, keep_lazy_text from django.utils.safestring import SafeText, ...
# Logistic regression implemented from Scratch in Python import numpy as np import matplotlib.pyplot as plt def sigmoid(scores): return 1 / (1 + np.exp(-scores)) def log_likelihood(features, target, weights): scores = np.dot(features, weights) ll = np.sum(target * scores - np.log(1 + np.exp(scores))) ...
"""This example illustrates how to run a report.""" import argparse import sys from apiclient import sample_tools from oauth2client import client # Declare command-line flags. argparser = argparse.ArgumentParser(add_help=False) argparser.add_argument( 'profile_id', type=int, help='The ID of the profile to us...
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
from __future__ import print_function from ryu import cfg import inspect import platform import logging import logging.config import logging.handlers import os import sys import ConfigParser CONF = cfg.CONF CONF.register_cli_opts([ cfg.IntOpt('default-log-level', default=None, help='default log level'), cfg....
import browser.html import _jsre as re import __random as random letters = 'abcdefghijklmnopqrstuvwxyz' letters += letters.upper()+'0123456789' class URL: def __init__(self,src): elts = src.split(maxsplit=1) self.href = elts[0] self.alt = '' if len(elts)==2: alt = elts[...
# First, put a steward DID and its keypair in the wallet. This doesn't write anything to the ledger, # but it gives us a key that we can use to sign a ledger transaction that we're going to submit later. print_log('\n5. Generate and store steward DID and verkey\n') # The DID and public verkey fo...
import logging import urlparse import random from django.conf import settings from locust import TaskSet, task import lxml.html from fxa import oauth as fxa_oauth import helpers log = logging.getLogger(__name__) MAX_UPLOAD_POLL_ATTEMPTS = 200 FXA_CONFIG = settings.FXA_CONFIG[settings.DEFAULT_FXA_CONFIG_NAME] clas...
""" Helper functions for caching course assets. """ from django.core.cache import caches from django.core.cache.backends.base import InvalidCacheBackendError from opaque_keys import InvalidKeyError from xmodule.contentstore.content import STATIC_CONTENT_VERSION # See if there's a "course_assets" cache configured, and ...
from django.conf.urls.defaults import * from django.views.generic.simple import redirect_to import views urlpatterns = patterns('', (r'^get_view/$', views.get_view), (r'^post_view/$', views.post_view), (r'^header_view/$', views.view_with_header), (r'^raw_post_view/$', views.raw_post_view), (r'^redi...
data = ( 'Sha ', # 0x00 'Li ', # 0x01 'Han ', # 0x02 'Xian ', # 0x03 'Jing ', # 0x04 'Pai ', # 0x05 'Fei ', # 0x06 'Yao ', # 0x07 'Ba ', # 0x08 'Qi ', # 0x09 'Ni ', # 0x0a 'Biao ', # 0x0b 'Yin ', # 0x0c 'Lai ', # 0x0d 'Xi ', # 0x0e 'Jian ', # 0x0f 'Qiang ', # 0x10 'Kun...
from tensorflow.keras import Input from tensorflow.keras import Model from tensorflow.keras.layers import Layer, Activation, BatchNormalization, Convolution2D, Dense, Flatten, MaxPooling2D, AveragePooling2D, \ add from tensorflow.keras.models import Sequential from tensorflow.keras.regularizers import l2 from tenso...
#!/usr/bin/env python """This spawns a sub-shell (bash) and gives the user interactive control. The entire shell session is logged to a file called script.log. This behaves much like the classic BSD command 'script'. ./script.py [-a] [-c command] {logfilename} logfilename : This is the name of the log file. Defa...
import crm from datetime import datetime from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.translate import _ class crm_phonecall(osv.osv): """ Model for CRM phonecalls """ _name = "crm.phonecall" _description = "Phonecall" _order = "id desc...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from itertools import product import pytest SYNONYMS_0660 = ( 0o660, '0o660', '660', 'u+rw-x,g+rw-x,o-rwx', 'u=rw,g=rw,o-rwx', ) @pytest.fixture def mock_stats(mocker): mock_stat1 = mocker.Mag...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} try: import boto.ec2.elb from boto.ec2.tag import Tag from boto.exception import BotoServerError HAS_BOTO = True except ImportError: HAS_BOTO = False class ElbInformati...
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class MalemotionIE(InfoExtractor): _VALID_URL = r'https?://malemotion\.com/video/(.+?)\.(?P<id>.+?)(#|$)' _TEST = { 'url': 'http://malemotion.com/video/bete-de-co...
import sys import unittest __all__ = ['get_config_vars', 'get_path'] try: # Python 2.7 or >=3.2 from sysconfig import get_config_vars, get_path except ImportError: from distutils.sysconfig import get_config_vars, get_python_lib def get_path(name): if name not in ('platlib', 'purelib'): ...
import datetime import json from google.appengine.api import oauth from google.appengine.api import users from google.appengine.ext import ndb import jsonify import models import search def get_oauth_user(): """Return the OAuth authenticated user, else raise an exception.""" try: # Get the db.User t...
from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.gepetto import Viewer white=[1.0,1.0,1.0,1.0] green=[0.23,0.75,0.2,0.5] yellow=[0.85,0.75,0.15,1] pink=[1,0.6,1,1] orange=[1,0.42,0,1] brown=[0.85,0.75,0.15,0.5] blue = [0.0, 0.0, 0.8, 1.0] grey = [0.7,0.7,0.7,1.0] red = [0.8,0.0,0.0,1.0] rootJointType = ...
# coding: utf-8 """Tests for conversions from markdown to other formats""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import re from copy import copy from functools import partial from ipython_genutils.py3compat import string_types from ipython_genutils.testi...
__all__ = ['Task', 'ListTask', 'DownloadTask', 'StopTask'] class Task(object): """Base class for tasks to use in subliminal""" pass class ListTask(Task): """List task used by the worker to search for subtitles :param video: video to search subtitles for :type video: :class:`~subliminal.videos.V...
# encoding: utf-8 # module gtk._gtk # from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so # by generator 1.135 # no doc # imports import atk as __atk import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject from DrawingArea import DrawingArea class Curve(DrawingArea): ...
import os from enigma import eConsoleAppContainer from Components.Harddisk import harddiskmanager from boxbranding import getImageDistro opkgDestinations = [] opkgStatusPath = '' def opkgExtraDestinations(): global opkgDestinations return ''.join([" --add-dest %s:%s" % (i,i) for i in opkgDestinations]) def opkgAdd...
from __future__ import absolute_import, division, unicode_literals from jx_base.expressions.expression import Expression from jx_base.language import is_op from mo_imports import export from mo_json import BOOLEAN class NotOp(Expression): data_type = BOOLEAN def __init__(self, term): Expression.__in...
{ "name": "Quality control claim", "version": "1.0", "author": "OdooMRP team", "website": "http://www.odoomrp.com", "contributors": [ "Pedro M. Baeza <<EMAIL>", "Ana Juaristi <<EMAIL>>", "Alfredo de la Fuente <<EMAIL>>", ], "category": "Quality control", "depends"...
""" Session Management (from web.py) """ import os, time, datetime, random, base64 import os.path from copy import deepcopy try: import cPickle as pickle except ImportError: import pickle try: import hashlib sha1 = hashlib.sha1 except ImportError: import sha sha1 = sha.new import utils import ...
from unittest2 import TestCase from six import PY3 from autobahn.wamp.exception import ApplicationError class ApplicationErrorTestCase(TestCase): def test_unicode_str(self): """ Unicode arguments in ApplicationError will not raise an exception when str()'d. """ error = Ap...
from rhombus.lib.utils import get_dbhandler from rhombus.lib.roles import SYSADM from rhombus.lib.tags import (div, table, thead, tbody, th, tr, td, literal, selection_bar, br, ul, li, a, i, form, POST, GET, fieldset, input_text, input_hidden, input_select, input_password, ...
from __future__ import division from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from builtins import * # NOQA from past.utils import old_div from time import sleep import threadi...
import json from functools import partial from django.contrib import auth from django.core.exceptions import ImproperlyConfigured from django import http from crashstats.tokens import models def json_forbidden_response(msg): body = json.dumps({'error': msg}) return http.HttpResponseForbidden( body +...
"""Common utilities used in testing""" import os import shutil import subprocess import sys import fixtures import testresources import testtools from pbr import packaging class DiveDir(fixtures.Fixture): """Dive into given directory and return back on cleanup. :ivar path: The target directory. """ ...
from __future__ import absolute_import, division, print_function, unicode_literals import json import os import sys import tempfile import time from botocore.exceptions import ClientError from dateutil.parser import parse as parse_date import six from c7n import ipaddress, utils from c7n.config import Config from ....
from __future__ import unicode_literals from datetime import datetime from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding import python_2_unicode_compatible def validate_answer_to_universe(value): if value != 42: raise ValidationError('This is not t...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.pycompat24 import get_exception try: import ldap import ldap.modlist import ldap.sasl ...
data = ( 'Bo ', # 0x00 'Chi ', # 0x01 'Gua ', # 0x02 'Zhi ', # 0x03 'Kuo ', # 0x04 'Duo ', # 0x05 'Duo ', # 0x06 'Zhi ', # 0x07 'Qie ', # 0x08 'An ', # 0x09 'Nong ', # 0x0a 'Zhen ', # 0x0b 'Ge ', # 0x0c 'Jiao ', # 0x0d 'Ku ', # 0x0e 'Dong ', # 0x0f 'Ru ', # 0x10 'Tiao ...