code
stringlengths
1
199k
""" FibreChannel Cinder Volume driver for Fujitsu ETERNUS DX S3 series. """ from oslo_log import log as logging import six from cinder import interface from cinder.volume import driver from cinder.volume.drivers.fujitsu import eternus_dx_common from cinder.zonemanager import utils as fczm_utils LOG = logging.getLogger(...
"""Provides device automations for ZHA devices that emit events.""" import voluptuous as vol import homeassistant.components.automation.event as event from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.exceptions import ( InvalidDeviceAutomatio...
"""VPN Utilities and helper functions.""" from neutronclient.common import exceptions from neutronclient.i18n import _ dpd_supported_actions = ['hold', 'clear', 'restart', 'restart-by-peer', 'disabled'] dpd_supported_keys = ['action', 'interval', 'timeout'] lifetime_keys = ['units', 'value'] li...
import logging from django.core.urlresolvers import reverse from django import template from django.template import defaultfilters as filters from django.utils.translation import pgettext_lazy from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ungettext_lazy from horizon import...
"""Tests for tf.layers.core.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import numpy as np from tensorflow.python.eager import context from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtype...
from __future__ import print_function import shlex import subprocess import sys from .config import Configuration class PkgConfig(object): class Error(Exception): """Raised when information could not be obtained from pkg-config.""" def __init__(self, package_name): """Query pkg-config for inform...
import sys, os sys.path.insert(0, os.path.abspath('..')) sys.path.insert(0, os.path.abspath('../cloudtracker/')) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.pngmath'] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'cloudtracker' copyright = u'2011, Jorda...
None import datetime import os import json def run(): print "starting" from receiver.models import Submission from xformmanager.models import FormDefModel # this part of the script walks through all the registered # form definitions and bundles them with the original xsd # schema for resubmissio...
""" Control global computation context """ from collections import defaultdict _globals = defaultdict(lambda: None) _globals['callbacks'] = set() class set_options(object): """ Set global state within controled context This lets you specify various global settings in a tightly controlled with block Vali...
from __future__ import unicode_literals from django.core.exceptions import PermissionDenied from django.core.mail import send_mail from django.core import validators from django.db import models from django.db.models.manager import EmptyManager from django.utils.crypto import get_random_string, salted_hmac from django....
from __future__ import absolute_import, unicode_literals from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from wagtail.wagtailadmin.forms import PageViewRestrictionForm from wagtail.wagtailadmin.modal_workflow import render_modal_workflow from wagtail.wagtailcore.models...
"""API Request cache tests.""" from __future__ import unicode_literals __version__ = '$Id$' from pywikibot.site import BaseSite import scripts.maintenance.cache as cache from tests import _cache_dir from tests.aspects import unittest, TestCase class RequestCacheTests(TestCase): """Validate cache entries.""" net...
from __future__ import print_function import sys def func(): print('{0}.{1}'.format(*sys.version_info[:2])) print(repr(sys.argv[1:])) print('Hello World') return 0
BLOCK_W = 16 # pow2 BLOCK_H = 16 # pow2 import sensor, image, time, math sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE (or RGB565) sensor.set_framesize(sensor.B128X128) # Set frame size to 128x128... (or 128x64)... senso...
""" categories: Types,bytes description: Bytes subscr with step != 1 not implemented cause: Unknown workaround: Unknown """ print(b'123'[0:3:2])
"""Invenio Access Control Config. """ __revision__ = \ "$Id$" from invenio import config from invenio.config import CFG_SITE_NAME, CFG_SITE_URL, CFG_SITE_LANG, \ CFG_SITE_SECURE_URL, CFG_SITE_SUPPORT_EMAIL, CFG_CERN_SITE, \ CFG_OPENAIRE_SITE, CFG_SITE_RECORD, CFG_INSPIRE_SITE, \ CFG_SITE_ADMIN_EMAIL ...
"""Unit tests for the `iris.quickplot.points` function.""" from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa import iris.tests as tests from iris.tests.unit.plot import TestGraphicStringCoord if tests.MPL_AVAILABLE: import iris.quickplo...
from gnuradio import gr, optfir from gnuradio.blks2impl.fm_emph import fm_deemph from math import pi class fm_demod_cf(gr.hier_block2): """ Generalized FM demodulation block with deemphasis and audio filtering. This block demodulates a band-limited, complex down-converted FM channel into the the ori...
from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, add_months, cint, nowdate, getdate from frappe.model.document import Document from erpnext.accounts.doctype.purchase_invoice.purchase_invoice import get_fixed_asset_account from erpnext.accounts.doctype.asset.deprec...
from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: fetch short_description: Fetch files from remote nodes description: - This module works like M(copy), but in reverse. - It is used for fetching files from remote machines and storing them locally in a ...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import import smtplib import sys from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from mo_logs import Log from mo_dots import listwrap from mo_dots import coalesce from mo_kwargs im...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '0001_initial'), ] operations = [ migrations.AddField( model_name='catalogintegration', name='service_username', field=models.CharField(default=u'l...
from __future__ import unicode_literals def execute(): """Make standard print formats readonly for system manager""" import webnotes.model.doc new_perms = [ { 'parent': 'Print Format', 'parentfield': 'permissions', 'parenttype': 'DocType', 'role': 'System Manager', 'permlevel': 1, 'read': 1, },...
from keystoneclient import exceptions from heat.common import exception from heat.common import heat_keystoneclient as hkc from heat.engine.clients import client_plugin from heat.engine import constraints class KeystoneClientPlugin(client_plugin.ClientPlugin): exceptions_module = exceptions service_types = [IDE...
from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args self.kwargs = kwargs self.is_running = False ...
""" Covenant Add-on 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 License, or (at your option) any later version. This program is distributed in the h...
"""Sensor to collect the reference daily prices of electricity ('PVPC') in Spain.""" import logging from random import randint from typing import Optional from aiopvpc import PVPCData from homeassistant import config_entries from homeassistant.const import CONF_NAME, ENERGY_KILO_WATT_HOUR from homeassistant.core import...
"""Training helper that checkpoints models and creates session.""" import time import numpy as np from tensorflow.python.client import session from tensorflow.python.distribute import distribution_strategy_context from tensorflow.python.framework import errors from tensorflow.python.framework import ops from tensorflow...
"""Tests for RNN cell wrapper v2 implementation.""" from absl.testing import parameterized import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.keras import combinations from tensorflow.python.keras import layers from tensorflow.python.kera...
import pygtk pygtk.require('2.0') import gtk class CheckButton: # Our callback. # The data passed to this method is printed to stdout def callback(self, widget, data=None): print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()]) # This callback quits the program def delete_eve...
"""Tkinker gui for pylint""" from Tkinter import Tk, Frame, Listbox, Entry, Label, Button, Scrollbar from Tkinter import TOP, LEFT, RIGHT, BOTTOM, END, X, Y, BOTH import os import sys if sys.platform.startswith('win'): PYLINT = 'pylint.bat' else: PYLINT = 'pylint' class LintGui: """Build and control a windo...
from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.models class Migration(migrations.Migration): dependencies = [ ('scanners', '0008_auto_20191021_1718'), ] operations = [ migrations.CreateModel( name='Scanner...
from django.utils.six.moves import http_client from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django_webtest import WebTest from purl import URL from oscar.core.compat import get_user_model User = get_user_model() def add_permissions(user, permissions): """ G...
from msrest.serialization import Model class ConnectivitySource(Model): """Parameters that define the source of the connection. All required parameters must be populated in order to send to Azure. :param resource_id: Required. The ID of the resource from which a connectivity check will be initiated. ...
import bpy camera = bpy.context.edit_movieclip.tracking.camera camera.sensor_width = 23.6 camera.units = 'MILLIMETERS' camera.pixel_aspect = 1 camera.k1 = 0.0 camera.k2 = 0.0 camera.k3 = 0.0
""" Tools and data structures for working with genomic intervals (or sets of regions on a line in general) efficiently. """ from bx.intervals.intersection import *
from ..internal.DeadCrypter import DeadCrypter class Movie2KTo(DeadCrypter): __name__ = "Movie2KTo" __type__ = "crypter" __version__ = "0.56" __status__ = "stable" __pattern__ = r'http://(?:www\.)?movie2k\.to/(.+)\.html' __config__ = [("activated", "bool", "Activated", True)] __description__...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: bigip_ike_peer short_description: Manage IPSec IKE Peer config...
from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('sites', '0...
""" :mod: RequestProxyHandler .. module: ReqtProxyHandler :synopsis: ReqProxy service .. moduleauthor:: Krzysztof.Ciba@NOSPAMgmail.com Careful with that axe, Eugene! Some 'transfer' requests are using local fs and they never should be forwarded to the central RequestManager. """ __RCSID__ = "$Id$" import os from type...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('trans', '0045_auto_20150916_1007'), ] operations = [ ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( HEADRequest, sanitized_Request, urlencode_postdata, ) class GDCVaultIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?gdcvault\.com/play/(?P<id>\d+)/(?P<name>(\w|-)+)?' _NETRC_MACHINE = 'gdcv...
import struct from optparse import OptionParser import matplotlib.pyplot as plt import debug_dump_pb2 def GetNextMessageSize(file_to_parse): data = file_to_parse.read(4) if data == '': return 0 return struct.unpack('<I', data)[0] def GetNextMessageFromFile(file_to_parse): message_size = GetNextMessageSize(f...
"""Support for Verisure Smartplugs.""" import logging from time import monotonic from homeassistant.components.switch import SwitchEntity from . import CONF_SMARTPLUGS, HUB as hub _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Verisure switch...
from tempest.api.compute import base from tempest import test class HypervisorAdminTestJSON(base.BaseV2ComputeAdminTest): """Tests Hypervisors API that require admin privileges""" @classmethod def setup_clients(cls): super(HypervisorAdminTestJSON, cls).setup_clients() cls.client = cls.os_adm...
import os, sys, subprocess, socket, fcntl, struct from socket import gethostname from xml.dom.minidom import parseString from xmlrpclib import ServerProxy, Error def get_ip_address(ifname): s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( s.fileno(), 0x89...
import sys sys.path.insert(0, "../../python/") import mxnet as mx kv = mx.kv.create('dist_async') my_rank = kv.rank nworker = kv.num_workers def test_gluon_trainer_type(): def check_trainer_kv_update(weight_stype, update_on_kv): x = mx.gluon.Parameter('x', shape=(10,1), lr_mult=1.0, stype=weight_stype) ...
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119. DON'T USE THIS MODULE DIRECTLY! The classes here should be imported via collections; they are defined here only to alleviate certain bootstrapping issues. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys ...
import pygtk pygtk.require('2.0') import gtk import time class SetSelectionExample: # Callback when the user toggles the selection def selection_toggled(self, widget, window): if widget.get_active(): self.have_selection = window.selection_owner_set("PRIMARY") # if claiming the se...
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase import vtk class vtkRuledSurfaceFilter(SimpleVTKClassModuleBase): def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkRuledSurfaceFilter(), 'Processing.', ('vtk...
from telemetry.internal.app import possible_app class PossibleBrowser(possible_app.PossibleApp): """A browser that can be controlled. Call Create() to launch the browser and begin manipulating it.. """ def __init__(self, browser_type, target_os, supports_tab_control): super(PossibleBrowser, self).__init__(a...
"""Implements a standard mechanism for Chrome Infra Python environment setup. This library provides a central location to define Chrome Infra environment setup. It also provides several faculties to install this environment. Within a cooperating script, the environment can be setup by importing this module and running ...
from translate.convert import xliff2po from translate.misc import wStringIO from translate.storage.test_base import headerless_len, first_translatable class TestXLIFF2PO: xliffskeleton = '''<?xml version="1.0" ?> <xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1"> <file original="filename.po" sour...
from .mbcharsetprober import MultiByteCharSetProber from .codingstatemachine import CodingStateMachine from .chardistribution import EUCTWDistributionAnalysis from .mbcssm import EUCTW_SM_MODEL class EUCTWProber(MultiByteCharSetProber): def __init__(self): super(EUCTWProber, self).__init__() self.co...
"""The tests for the heat control thermostat.""" import unittest from homeassistant.bootstrap import _setup_component from homeassistant.const import ( ATTR_UNIT_OF_MEASUREMENT, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_ON, STATE_OFF, TEMP_CELSIUS, ) from homeassistant.components import thermosta...
from test import CollectorTestCase from test import get_collector_config from test import unittest from mock import Mock from mock import patch try: from cStringIO import StringIO StringIO # workaround for pyflakes issue #13 except ImportError: from StringIO import StringIO from diamond.collector import Co...
import chainer from chainer import backend from chainer import utils def sign(x): """Elementwise sign function. For a given input :math:`x`, this function returns :math:`sgn(x)` defined as .. math:: sgn(x) = \\left \\{ \\begin{array}{cc} -1 & {\\rm if~x < 0} \\\\ 0 & {\\rm if~x =...
""" Manager of RPC calls from plugins. """ from golismero.api.config import Config __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it a...
""" Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. Note that the search function converts the encoding names to lower case and replaces hyphens with underscores *before* performing the lookup. """ aliases = { # Latin-...
from __future__ import absolute_import, print_function, unicode_literals import base64 import json import os import os.path as path import re import shutil import sys import urllib2 from mach.decorators import ( CommandArgument, CommandProvider, Command, ) import servo.bootstrap as bootstrap from servo.comm...
from click_plugins import with_plugins from pkg_resources import iter_entry_points import click @with_plugins(iter_entry_points('girder.cli_plugins')) @click.group(help='Girder: data management platform for the web.', context_settings=dict(help_option_names=['-h', '--help'])) @click.version_option(message=...
class UniqueIndexViolationCheck: unique_indexes_query = """ select table_oid, index_name, table_name, array_agg(attname) as column_names from pg_attribute, ( select pg_index.indrelid as table_oid, index_class.relname as index_name, table_class.relname as table_name, unnest(pg_index.indke...
import unittest from ...compatibility import StringIO from ...worksheet import Worksheet class TestWriteWorksheet(unittest.TestCase): """ Test the Worksheet _write_worksheet() method. """ def setUp(self): self.fh = StringIO() self.worksheet = Worksheet() self.worksheet._set_fileh...
VERSION = (1, 3, 0, 'alpha', 1) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] != 'final': version = '%s %s...
import re import django, logging, warnings from django import forms from django.conf import settings from django.core.urlresolvers import reverse from django.forms.models import formset_factory from django.middleware.csrf import _get_new_csrf_key from django.template import ( loader, TemplateSyntaxError, Context ) ...
"""Implement standard (and unused) TCP protocols. These protocols are either provided by inetd, or are not provided at all. """ from __future__ import absolute_import, division import time import struct from zope.interface import implementer from twisted.internet import protocol, interfaces from twisted.python.compat i...
import requests.cookies try: import cookielib except ImportError: import http.cookiejar as cookielib __all__ = ['WeboobCookieJar'] class WeboobCookieJar(requests.cookies.RequestsCookieJar): @classmethod def from_cookiejar(klass, cj): """ Create a WeboobCookieJar from another CookieJar in...
""" parseutils.py Routines to parse "flexible" configuration files for tools like gpaddmirrors, gprecoverseg, gpexpand, etc. Copyright (c) EMC/Greenplum Inc 2011. All Rights Reserved. """ import sys from gppylib.mainUtils import ExceptionNoStackTraceNeeded from gppylib.gplog import get_default_logger, logging...
from collections import OrderedDict import copy import operator from functools import partial, reduce, update_wrapper import warnings from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import widgets, helpers from django.contrib.admin import validatio...
"""Valid certificate chain where the target certificate contains a public key with a 512-bit modulus (weak).""" import sys sys.path += ['../..'] import gencerts root = gencerts.create_self_signed_root_certificate('Root') intermediate = gencerts.create_intermediate_certificate('Intermediate', root) target = gencerts.cre...
from sys import * from pdflib_py import * p = PDF_new() PDF_open_file(p, "gradients.pdf") PDF_set_parameter(p, "usercoordinates", "true") PDF_set_value(p, "compress", 0) PDF_set_info(p, "Author", "pdflib") PDF_set_info(p, "Creator", "pdflib_py") PDF_set_info(p, "Title", "gradients") width = 1024 height = 800 PDF_begin_...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: cnos_factory author: "Anil Kumar Muraleedharan (@amuraleedhar...
"""Support for MySensors covers.""" from homeassistant.components import mysensors from homeassistant.components.cover import ATTR_POSITION, DOMAIN, CoverDevice from homeassistant.const import STATE_OFF, STATE_ON async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): """Set ...
"""Tests for Airly."""
import xml.etree.ElementTree as ET class brocade_ip_access_list(object): """Auto generated class. """ def __init__(self, **kwargs): self._callback = kwargs.pop('callback') def ip_acl_ip_access_list_standard_name(self, **kwargs): """Auto Generated Code """ config = ET.Elem...
def test_is_generator_alias(): from nose.util import is_generator, isgenerator
from __future__ import absolute_import from inspect import isclass from celery.datastructures import AttributeDict from tower import ugettext_lazy as _ __all__ = ('LOG', 'LOG_BY_ID', 'LOG_KEEP',) class _LOG(object): action_class = None class CREATE_ADDON(_LOG): id = 1 action_class = 'add' format = _(u'{...
"""test a warning is triggered when using for a lists comprehension variable""" __revision__ = 'yo' TEST_LC = [C for C in __revision__ if C.isalpha()] print C # WARN C = 4 print C # this one shouldn't trigger any warning B = [B for B in __revision__ if B.isalpha()] print B # nor this one for var1, var2 in TEST_LC: ...
import py_utils from telemetry import story as story_module from telemetry.page import page as page_module from telemetry.page import shared_page_state class LeakDetectionSharedState(shared_page_state.SharedDesktopPageState): def ShouldReuseBrowserForAllStoryRuns(self): return True class LeakDetectionPage(page_mo...
""" Methods for working with cecog Copyright 2010 University of Dundee, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import os import re import sys from omero.cli import BaseControl, CLI import omero import omero.constants from omero.rtypes import rstring class CecogCon...
import re from waflib import Utils,Task,TaskGen,Logs from waflib.TaskGen import feature,before_method,after_method,extension from waflib.Configure import conf INC_REGEX="""(?:^|['">]\s*;)\s*(?:|#\s*)INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" USE_REGEX="""(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w...
import tick_mark import line_style import pychart_util import error_bar import chart_object import legend import object_set import line_plot_doc import theme from pychart_types import * from types import * default_width = 1.2 line_style_itr = None _keys = { 'data' : (AnyType, None, pychart_util.data_desc), 'lab...
"""Utility functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.kfac.python.ops.utils import * from tensorflow.python.util.all_util import remove_undocumented _allowed_symbols = [ "SequenceDict", "setdefault", "ten...
from Child import Child from Node import Node # noqa: I201 AVAILABILITY_NODES = [ # availability-spec-list -> availability-entry availability-spec-list? Node('AvailabilitySpecList', kind='SyntaxCollection', element='AvailabilityArgument'), # Wrapper for all the different entries that may occur ins...
"""Generator for C++ structs from api json files. The purpose of this tool is to remove the need for hand-written code that converts to and from base::Value types when receiving javascript api calls. Originally written for generating code for extension apis. Reference schemas are in chrome/common/extensions/api. Usage ...
from Source import Source from Components.Element import cached from Components.SystemInfo import SystemInfo from enigma import eServiceReference StreamServiceList = [] class StreamService(Source): def __init__(self, navcore): Source.__init__(self) self.ref = None self.__service = None self.navcore = navcore ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: aci_tenant_span_dst_group short_description: Manage SPAN desti...
from odoo import api, fields, models class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" google_drive_authorization_code = fields.Char(string='Authorization Code') google_drive_uri = fields.Char(compute='_compute_drive_uri', string='URI', help="The URL to generate the authorizat...
"""Implementation of the public test library logging API. This is exposed via :py:mod:`robot.api.logger`. Implementation must reside here to avoid cyclic imports. """ import sys import threading from robot.errors import DataError from robot.utils import unic, encode_output from .logger import LOGGER from .loggerhelper ...
import warnings from django.conf import settings from django.contrib.auth.models import User, Group, Permission, AnonymousUser from django.contrib.contenttypes.models import ContentType from django.test import TestCase class BackendTest(TestCase): backend = 'django.contrib.auth.backends.ModelBackend' def setUp(...
from SimpleCV import Camera, Image, Color, TemporalColorTracker, ROI, Display import matplotlib.pyplot as plt cam = Camera(1) tct = TemporalColorTracker() img = cam.getImage() roi = ROI(img.width*0.45,img.height*0.45,img.width*0.1,img.height*0.1,img) tct.train(cam,roi=roi,maxFrames=250,pkWndw=20) plotc = {'r':'r','g':'...
"""Extension argument processing code """ __all__ = ['Message', 'NamespaceMap', 'no_default', 'registerNamespaceAlias', 'OPENID_NS', 'BARE_NS', 'OPENID1_NS', 'OPENID2_NS', 'SREG_URI', 'IDENTIFIER_SELECT'] import copy import warnings import urllib from openid import oidutil from openid import kvfor...
import os from cpp_namespace_environment import CppNamespaceEnvironment from model import Model, UnixName from schema_loader import SchemaLoader def _GenerateFilenames(full_namespace): # Try to find the file defining the namespace. Eg. for # nameSpace.sub_name_space.Type' the following heuristics looks for: # 1. ...
from __future__ import division, absolute_import, print_function import sys import collections import pickle import warnings from os import path import numpy as np from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal, assert_array_almost_equal, assert_raises, assert_...
from __future__ import print_function try: import ConfigParser except ImportError: import configparser as ConfigParser import logging import mock import os import subprocess from helpers import unittest import warnings from luigi import six import luigi from luigi.mock import MockTarget class SomeTask(luigi.Tas...
fh = open(r'd:\temp\words.txt') text = fh.read() fh.close() print(len(text)) print(text)
from __future__ import division __author__ = "William Walters" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["William Walters", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "William Walters" __email__ = "William.A.Walters@colorado.edu" from os.path import basename...
import shutil import tempfile from telemetry import decorators from telemetry.testing import options_for_unittests from telemetry.testing import page_test_test_case from measurements import skpicture_printer class SkpicturePrinterUnitTest(page_test_test_case.PageTestTestCase): def setUp(self): self._options = opt...
from __future__ import print_function import soco """ Prints the name of each discovered player in the network. """ for zone in soco.discover(): print(zone.player_name)
from __future__ import unicode_literals import datetime import itertools import os import re from importlib import import_module from django.apps import apps from django.conf import settings from django.contrib.admin.models import LogEntry from django.contrib.auth import REDIRECT_FIELD_NAME, SESSION_KEY from django.con...