content
stringlengths
4
20k
# encoding: 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 'Targeting' db.create_table('facebook_ads_targeting', ( ('id', self.gf('django....
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughImageCasesPage(page_module.Page): def __init__(self, url, page_set): super(ToughImageCasesPage, self).__init__(url=url, page_set=page_set) self.user_agent_type = 'desktop' class ToughImageCase...
# -*- 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 'ReceiveAddress' db.create_table('bitcoin_frespo_receiveaddress', ( ('id', self.g...
from contextlib import contextmanager import zlib import io from socket import timeout as SocketTimeout from ._collections import HTTPHeaderDict from .exceptions import ( ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked ) from .packages.six import string_types as basestring, binary_type, PY3 from ....
from openerp.osv import fields, osv from openerp.tools.translate import _ class asset_depreciation_confirmation_wizard(osv.osv_memory): _name = "asset.depreciation.confirmation.wizard" _description = "asset.depreciation.confirmation.wizard" _columns = { 'period_id': fields.many2one('account.period',...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='AlertSubscription', fields=[ ('id', models.Auto...
from django.urls import reverse from django.test import TestCase, override_settings from unittest.mock import patch, Mock from silk.config import SilkyConfig from silk.middleware import SilkyMiddleware, _should_intercept from silk.models import Request from .util import mock_data_collector def fake_get_response(): ...
from . import constants import sys import codecs from .latin1prober import Latin1Prober # windows-1252 from .mbcsgroupprober import MBCSGroupProber # multi-byte character sets from .sbcsgroupprober import SBCSGroupProber # single-byte character sets from .escprober import EscCharSetProber # ISO-2122, etc. import re...
""" An example demonstrating k-means clustering. Run with: bin/spark-submit examples/src/main/python/ml/kmeans_example.py This example requires NumPy (http://www.numpy.org/). """ from __future__ import print_function # $example on$ from pyspark.ml.clustering import KMeans from pyspark.ml.evaluation import Clusterin...
from allauth.socialaccount.tests import create_oauth2_tests from allauth.tests import MockedResponse from allauth.socialaccount.providers import registry from .provider import SoundCloudProvider class SoundCloudTests(create_oauth2_tests(registry.by_id(SoundCloudProvider.id))): def get_mocked_response(self): ...
""" Represents a Virtual Private Cloud. """ from boto.ec2.ec2object import TaggedEC2Object class VPC(TaggedEC2Object): def __init__(self, connection=None): """ Represents a VPC. :ivar id: The unique ID of the VPC. :ivar dhcp_options_id: The ID of the set of DHCP options you've as...
""" This module collects helper functions and classes that "span" multiple levels of MVC. In other words, these functions/classes introduce controlled coupling for convenience's sake. """ import warnings from django.core import urlresolvers from django.db.models.base import ModelBase from django.db.models.manager imp...
from sure import expect from moto.swf.models import GenericType # Tests for GenericType (ActivityType, WorkflowType) class FooType(GenericType): @property def kind(self): return "foo" @property def _configuration_keys(self): return ["justAnExampleTimeout"] def test_type_short_dict_...
# -*- test-case-name: allmydata.test.test_observer -*- from twisted.internet import defer try: from foolscap.eventual import eventually eventually # http://divmod.org/trac/ticket/1499 except ImportError: from twisted.internet import reactor def eventually(f, *args, **kwargs): return reactor.cal...
# -*- coding: utf-8 -*- """ :copyright: (c) 2010-2012 Fabien Potencier :license: MIT, see LICENSE for more details. """ from docutils.parsers.rst import Directive, directives from docutils import nodes from string import upper class configurationblock(nodes.General, nodes.Element): pass class Configurati...
import re from django.conf import settings from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.utils.module_loading import import_by_path from django.middleware.csrf import rotate_token from .signals import user_logged_in, user_logged_out, user_login_failed SESSION_KEY = '_auth_user...
# XXX TO DO: # - popup menu # - support partial or total redisplay # - key bindings (instead of quick-n-dirty bindings on Canvas): # - up/down arrow keys to move focus around # - ditto for page up/down, home/end # - left/right arrows to expand/collapse & move out/in # - more doc strings # - add icons for "file", ...
import json import hmac import logging import time from base64 import urlsafe_b64encode as encodestring, urlsafe_b64decode as decodestring from grokcore.component import GlobalUtility, context, name from grokcore.security import require from twisted.internet import defer from twisted.cred.credentials import UsernamePa...
ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'version': '1.0'} HEADERS = { "Content-Type": "application/json", "Accept": "application/json", } import json from ansible.module_utils.api import basic_auth_argument_spec from ansible.module_utils....
import doctest import gettext import os import unittest from babel.compat import BytesIO, u, text_type from babel.messages import mofile, Catalog class ReadMoTestCase(unittest.TestCase): def setUp(self): self.datadir = os.path.join(os.path.dirname(__file__), 'data') def test_basics(self): m...
import numpy as np import subprocess from dataportal import DataBroker, DataMuxer from dataportal.broker import EventQueue import matplotlib.pyplot as plt import time as ttime import sys from ophyd.userapi.scan_api import estimate def new_queue(header, queue=None): if queue is None: queue = EventQueue(head...
from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.blocktools import * COIN = 100000000 SEQUENCE_LOCKTIME_DISABLE_FLAG = (1<<31) SEQUENCE_LOCKTIME_TYPE_FLAG = (1<<22) # this means...
from django.template.defaultfilters import length from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LengthTests(SimpleTestCase): @setup({'length01': '{{ list|length }}'}) def test_length01(self): output = self.engine.render_to_string...
# -*- 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 field 'CourseEnrollment.date' db.add_column('student_courseenrollment', 'date', ...
import unittest from triangle import Triangle, TriangleError class TriangleTests(unittest.TestCase): def test_equilateral_triangles_have_equal_sides(self): self.assertEqual("equilateral", Triangle(2, 2, 2).kind()) def test_larger_equilateral_triangles_also_have_equal_sides(self): self.assert...
import copy import fixtures import mock import oslo_messaging as messaging from oslo_messaging.rpc import dispatcher from oslo_serialization import jsonutils import testtools from nova import context from nova import rpc from nova import test # Make a class that resets all of the global variables in nova.rpc class ...
from oslo_log import log as logging from oslo_utils import excutils import paramiko import six from cinder import exception from cinder.i18n import _, _LE from cinder import utils from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts import cinder.zonemanager.drivers.brocade.fc_zone_constants ...
import struct from mutagen._util import cdata, get_size from mutagen._compat import text_type, xrange, izip from mutagen._tags import PaddingInfo from ._util import guid2bytes, bytes2guid, CODECS, ASFError, ASFHeaderError from ._attrs import ASFBaseAttribute, ASFUnicodeAttribute class BaseObject(object): """Bas...
from test_framework.mininode import * from test_framework.test_framework import KoreTestFramework from test_framework.util import * import time from test_framework.blocktools import create_block, create_coinbase ''' AcceptBlockTest -- test processing of unrequested blocks. Since behavior differs when receiving unrequ...
from pybench import Test # Check for new-style class support: try: class c(object): pass except NameError: raise ImportError ### class CreateNewInstances(Test): version = 2.0 operations = 3 + 7 + 4 rounds = 60000 def test(self): class c(object): pass cl...
""" CORE MARKDOWN BLOCKPARSER ============================================================================= This parser handles basic parsing of Markdown blocks. It doesn't concern itself with inline elements such as **bold** or *italics*, but rather just catches blocks, lists, quotes, etc. The BlockParser is made ...
# This is an extremely important file for creating your own bot microservices. # # It dynamically connects microservices (your new application-layer features and services) with the representative # models (locations and devices) provided by com.ppc.Bot. # # Your microservices extend and implement the event-driven inter...
# -*- coding: utf-8 -*- from addons.base.models import BaseNodeSettings from dirtyfields import DirtyFieldsMixin from django.db import models from osf.exceptions import ValidationValueError from osf.models.validators import validate_no_html class NodeSettings(DirtyFieldsMixin, BaseNodeSettings): complete = True ...
""" Giving models custom methods Any method you add to a model will be available to instances. """ import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Article(models.Model): headline = models.CharField(max_length=100) ...
#!/usr/bin/env python data = {} times = [] threads = [] cpus = [] def get_key(time, event, cpu, thread): return "%d-%s-%d-%d" % (time, event, cpu, thread) def store_key(time, cpu, thread): if (time not in times): times.append(time) if (cpu not in cpus): cpus.append(cpu) if (...
from tapiriik.settings import WEB_ROOT, DROPBOX_APP_KEY, DROPBOX_APP_SECRET, DROPBOX_FULL_APP_KEY, DROPBOX_FULL_APP_SECRET from tapiriik.services.service_base import ServiceAuthenticationType, ServiceBase from tapiriik.services.api import APIException, ServiceExceptionScope, UserException, UserExceptionType, APIExclu...
import json from mox3.mox import MoxTestBase, IsA from six.moves import cPickle import gevent from boto.s3.bucket import Bucket from boto.s3.key import Key from boto.sqs.queue import Queue from boto.sqs.message import Message from slimta.envelope import Envelope from slimta.cloudstorage.aws import SimpleStorageServi...
"""Support for the Twitch stream status.""" import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) ATTR_GAME = 'game' ATTR_TITLE = '...
"""Tests for distutils.command.bdist.""" import os import unittest from test.test_support import run_unittest from distutils.command.bdist import bdist from distutils.tests import support class BuildTestCase(support.TempdirManager, unittest.TestCase): def test_formats(self): # let's...
from mechanize import Browser from bs4 import BeautifulSoup from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from time import sleep from datetime import date from datetime import datetime from collections import deque import lxml import cPickle as pickle import random impor...
# -*- coding: utf-8 -*- """Scripts for counting recently added users by email domain; pushes results to the specified project. """ import datetime import collections from cStringIO import StringIO from framework.mongo import database from website import models from website.app import app, init_app from scripts.anal...
# basic functionality test for {} format string def test(fmt, *args): print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<') test("}}{{") test("{}-{}", 1, [4, 5]) test("{0}-{1}", 1, [4, 5]) test("{1}-{0}", 1, [4, 5]) test("{:x}", 1) test("{!r}", 2) test("{:x}", 0x10) test("{!r}", "foo") test("{!s}", "foo") t...
from icalendar import Calendar, vCalAddress, vText import icalendar from datetime import timedelta from django.template import RequestContext from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.core.urlresolvers import reverse from django.core.exceptions import Objec...
''' Progress class for modules. Represents where a student is in a module. For most subclassing needs, you should only need to reimplement frac() and __str__(). ''' from __future__ import absolute_import import numbers class Progress(object): '''Represents a progress of a/b (a out of b done) a and b must...
"""Defines Twisted Web resources for status reporting.""" from greplin import scales from greplin.scales import formats, util from twisted.web import resource class StatsResource(resource.Resource): """Twisted web resource for a status page.""" isLeaf = True def __init__(self, serverName): resource.R...
from optparse import OptionParser import xmmsclient import os import sys parser = OptionParser() parser.add_option("-n", "--next", action="store_true", dest="next", default=False, help="switch to next playlist") parser.add_option("-p", "--prev", action="store_tru...
from datetime import datetime from operator import attrgetter from django.db.models import Q from django.test import TestCase from models import Article class OrLookupsTests(TestCase): def setUp(self): self.a1 = Article.objects.create( headline='Hello', pub_date=datetime(2005, 11, 27) ...
import logging from django.utils.translation import ugettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import network from openstack_dashboard.api import sahara as saharaclient from opens...
"""Code for listing files that belong to the library.""" import logging import pylearn2 import os __authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" ...
"""empty message Revision ID: 84474ea117fe Revises: None Create Date: 2016-07-07 17:54:41.579400 """ # revision identifiers, used by Alembic. revision = '84474ea117fe' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ###...
import logging from gettext import gettext as _ from gi.repository import GObject from gi.repository import Gtk from sugar3.graphics import style from sugar3.graphics.icon import Icon from jarabe.journal.expandedentry import ExpandedEntry from jarabe.journal import model class DetailView(Gtk.VBox): __gtype_nam...
import sys if sys.version < '2.7' or sys.version >= '2.8': sys.stderr.write("Unsupported Python version: webkitpy requires 2.7.x, and you're running %s.\n" % sys.version.split()[0]) sys.exit(1)
import unittest import pysal from .. import moran from ...common import pandas, RTOL, ATOL import numpy as np PANDAS_EXTINCT = pandas is None class Moran_Tester(unittest.TestCase): def setUp(self): self.w = pysal.open(pysal.examples.get_path("stl.gal")).read() f = pysal.open(pysal.examples.get_pa...
import os, sys import time from ConfigParser import ConfigParser import boto from boto import ec2 from boto.ec2 import elb from boto.ec2.connection import EC2Connection from boto.ec2.elb import HealthCheck from fabric.api import env, execute, local from fabric.tasks import Task from fab_deploy import functions from...
import sys # noqa try: import boto.ec2 import boto.vpc from boto.exception import EC2ResponseError HAS_BOTO = True except ImportError: HAS_BOTO = False if __name__ != '__main__': raise class AnsibleIGWException(Exception): pass def ensure_igw_absent(vpc_conn, vpc_id, check_mode...
import os import tempfile from twisted.trial import unittest from deluge import maketorrent def check_torrent(filename): # Test loading with libtorrent to make sure it's valid from deluge._libtorrent import lt lt.torrent_info(filename) # Test loading with our internal TorrentInfo class from del...
"""Keyword args functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from tensorflow.python.util import decorator_utils def keyword_args_only(func): """Decorator for marking specific function accepting keyword args only. Th...
import unittest from autothreadharness.harness_case import HarnessCase class MED_6_3_2(HarnessCase): role = HarnessCase.ROLE_MED case = '6 3 2' golden_devices_required = 1 def on_dialog(self, dialog, title): pass if __name__ == '__main__': unittest.main()
""" Make sure that the content type cache (see ContentTypeManager) works correctly. Lookups for a particular content type -- by model or by ID -- should hit the database only on the first lookup. First, let's make sure we're dealing with a blank slate (and that DEBUG is on so that queries get logged):: >>> from d...
from __future__ import print_function from bcc import BPF from sys import stderr from time import sleep, strftime import argparse import errno import signal # arg validation def positive_int(val): try: ival = int(val) except ValueError: raise argparse.ArgumentTypeError("must be an integer") ...
''' Defines the manager for global hot keys. @author: Eitan Isaacson @organization: IBM Corporation @copyright: Copyright (c) 2006, 2007 IBM Corporation @license: BSD All rights reserved. This program and the accompanying materials are made available under the terms of the BSD which accompanies this distribution, an...
import sys import os, unittest import sqlite3 as sqlite def get_db_path(): return "sqlite_testdb" class TransactionTests(unittest.TestCase): def setUp(self): try: os.remove(get_db_path()) except OSError: pass self.con1 = sqlite.connect(get_db_path(), timeout=0....
"""Tests that tracking data are successfully logged""" import mock import unittest from django.test import TestCase from django.core.urlresolvers import reverse from django.conf import settings from track.models import TrackingLog from track.views import user_track @unittest.skip("TODO: these tests were not being ru...
# coding: utf-8 import os from .base import BaseTestCase from prettyconf.loaders import EnvFileConfigurationLoader class EnvFileTestCase(BaseTestCase): def setUp(self): super(EnvFileTestCase, self).setUp() self.envfile = os.path.join(self.test_files_path, "envfile") def test_config_file_pa...
__title__="FreeCAD Equipment" __author__ = "Yorik van Havre" __url__ = "http://www.freecadweb.org" import FreeCAD,Draft,ArchComponent,DraftVecUtils,ArchCommands,Units from FreeCAD import Vector if FreeCAD.GuiUp: import FreeCADGui from PySide import QtCore, QtGui from DraftTools import translate from Py...
# CudaPy module from ctypes import * import hashlib, subprocess, tempfile, os.path from pkg_resources import resource_filename from cudatypes import * from template import Template, parseSig from wrapper import wrapper # Load the py2cuda library py2cudaLib = cdll.LoadLibrary(resource_filename(__name__, 'py2cuda.so')...
from msrest.serialization import Model class StatusCodesBasedTrigger(Model): """Trigger based on status code. :param status: HTTP status code. :type status: int :param sub_status: SubStatus. :type sub_status: int :param win32_status: Win32 error code. :type win32_status: int :param co...
#!/usr/bin/env python # This includes the two classes wxGLWindow and wxAdvancedGLWindow # from OpenGL.TK in the PyOpenGL distribution # ported to wxPython by greg Landrum # modified by Y. Wong # modified by R. Amezquita # modified by O. Olarte from OpenGL.GL import * from OpenGL.GLU import * from wx import * from wx....
import time from osv import osv, fields from tools.translate import _ ## Create an invoice based on selected timesheet lines # class account_analytic_line(osv.osv): _inherit = "account.analytic.line" # # data = { # 'date': boolean # 'time': boolean # 'name': boolean # 'price': bo...
import sys import urllib import urlparse import weakref import datetime import json import xbmc import xbmcaddon import xbmcplugin import xbmcvfs from ..abstract_context import AbstractContext from .xbmc_plugin_settings import XbmcPluginSettings from .xbmc_context_ui import XbmcContextUI from .xbmc_system_version imp...
#!/usr/bin/python3 import json import sys sys.path.append("..") import insummer #这个是只用了title的Question类,非常傻逼易用好用 from insummer.common_type import NaiveQuestion from insummer.read_conf import config from insummer.knowledge_base import init_assoc_space from insummer.query_expansion.entity_finder import NgramEntityFinde...
import gzip import logging import zlib from io import BytesIO from .exceptions import DecodeError from .packages.six import string_types as basestring log = logging.getLogger(__name__) def decode_gzip(data): gzipper = gzip.GzipFile(fileobj=BytesIO(data)) return gzipper.read() def decode_deflate(data): ...
from mediacloud.test.basetest import AdminApiBaseTest, ApiBaseTest TEST_TOPIC_ID = 1537 # climate change topic TEST_TOPIC2_ID = 1019 # common core TEST_TOPIC3_ID = 3180 # rahul test class ApiTopicTest(AdminApiBaseTest): def testTopic(self): topic = self._mc.topic(TEST_TOPIC_ID) self.asser...
"""Text annotation module""" from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.core import Scope, String from xmodule.annotator_mixin import get_instructions from xmodule.annotator_token import retrieve_token f...
# -*- coding: utf-8 -*- URLS = { # Issue comments 'GET_COMMENTS': 'repositories/%(username)s/%(repo_slug)s/issues/%(issue_id)s/comments/', 'GET_COMMENT': 'repositories/%(username)s/%(repo_slug)s/issues/%(issue_id)s/comments/%(comment_id)s/', 'CREATE_COMMENT': 'repositories/%(username)s/%(repo_slug)s/iss...
# -*- coding: UTF-8 -*- from __future__ import print_function import sys import unittest from pychess.Utils.const import SUICIDECHESS from pychess.Utils.logic import validate from pychess.Utils.Move import Move, parseSAN from pychess.Variants.suicide import SuicideBoard # ♚ . . ♔ . . . . # ♙ . . . . . . . # . . ....
"Functions that help with dynamically creating decorators for views." try: from contextlib import ContextDecorator except ImportError: ContextDecorator = None from functools import WRAPPER_ASSIGNMENTS, update_wrapper, wraps from django.utils import six class classonlymethod(classmethod): def __get__(se...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutInheritance(Koan): class Dog: def __init__(self, name): self._name = name @property def name(self): return self._name def bark(self): return "WOOF" class Ch...
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a tuple in this format: (view_function, function_args, function_kwargs) """ import re from threading import local from django.http import Http40...
# -*- coding: utf-8 -*- import os import six import sqlalchemy from sqlalchemy import * from migrate.versioning import genmodel, schemadiff from migrate.changeset import schema from migrate.tests import fixture class TestSchemaDiff(fixture.DB): table_name = 'tmp_schemadiff' level = fixture.DB.CONNECT ...
from __future__ import (absolute_import, division, print_function, unicode_literals) from . import get_assert_same_ggplot, cleanup, assert_same_elements assert_same_ggplot = get_assert_same_ggplot(__file__) from nose.tools import (assert_true, assert_raises, assert_is, ...
import logging import random import time from _mysql_exceptions import OperationalError logger = logging.getLogger(__name__) def get_now_timestamp(): """ Return a unix timestamp for the current time. This is useful because it can be mocked out in unit tests. """ return int(time.time()) def re...
# -*- coding: utf-8 -*- import commands import logging import json import os import os.path import io import base64 import openerp import time import random import math import md5 import openerp.addons.hw_proxy.controllers.main as hw_proxy import pickle import re import subprocess import traceback try: from .. es...
#! /usr/bin/env python3 from memo import memoize import sys description = ''' Path sum: two ways Problem 81 In the 5 by 5 matrix below, the minimal path sum from the top left to the bottom right, by only moving to the right and down, is indicated in bold red and is equal to 2427. 131 673 234 103 18 201 96 342 965 1...
from i3pystatus import IntervalModule from i3pystatus.core.util import internet, require from datetime import datetime from urllib.request import urlopen import json import re GEOLOOKUP_URL = 'http://api.wunderground.com/api/%s/geolookup%s/q/%s.json' STATION_QUERY_URL = 'http://api.wunderground.com/api/%s/%s/q/%s.jso...
''' This graph is a modification of the :py:mod:`~test.graph_testing.parallel_pipeline` example, showing how the user can specify how the graph is going to be partitioned into MPI processes. In this example we are specifying that one MPI process is executing the pipline of nodes ``prod``, ``cons1`` and ``cons2`` and...
import unittest import os import comm class TestCrosswalkApptoolsFunctions(unittest.TestCase): def test_check_host_without_platforms(self): comm.setUp() os.chdir(comm.XwalkPath) cmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app check" (return_code, output) = comm.getstatuso...
from helpers import unittest import luigi import luigi.notifications luigi.notifications.DEBUG = True class LinearSum(luigi.Task): lo = luigi.IntParameter() hi = luigi.IntParameter() def requires(self): if self.hi > self.lo: return self.clone(hi=self.hi - 1) def run(self): ...
from unittest import main from qiita_pet.test.tornado_test_base import TestHandlerBase class TestAuthCreateHandler(TestHandlerBase): database = True def test_get(self): response = self.get('/auth/create/') self.assertEqual(response.code, 200) def test_post(self): post_args = { ...
from weboob.capabilities.recipe import CapRecipe, Recipe from weboob.tools.backend import Module from .browser import SupertoinetteBrowser __all__ = ['SupertoinetteModule'] class SupertoinetteModule(Module, CapRecipe): NAME = 'supertoinette' MAINTAINER = u'Julien Veyssier' EMAIL = '<EMAIL>' VERSION ...
import os from devassistant import exceptions from devassistant import settings class AssistantBase(object): """WARNING: if assigning subassistants in __init__, make sure to override it in subclass, so that it doesn't get inherited!""" # Some informations about assistant # These should all be present...
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, tempfile, shutil, errno, time, atexit from threading import Threa...
""" This module implements several commonly used utility functions. The implemented functions can be used to swap variables, write and read data from files and to convert a number to raw text. """ import obfsproxy.common.log as logging import os import time import const import mycrypto log = logging.get_obfslogger...
import inspect, glob from os import path from twisted.trial import unittest from twisted.python import reflect from twisted.python.modules import getModule def errorInFile(f, line=17, name=''): """ Return a filename formatted so emacs will recognize it as an error point @param line: Line number in file...
# -*- coding: utf-8 -*- ''' accpy.dataio.hdf5 author: Felix Kramer ''' from h5py import File as h5pyFile from h5py._hl.group import Group from h5py._hl.dataset import Dataset from time import strftime from numpy import ndarray class struct(object): def __init__(self, **entries): self.__dict__.update(e...
"""Runs Android's lint tool.""" import optparse import os import sys from xml.dom import minidom from util import build_utils _SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')) def _RunLint(lint_path, config_path, processed_config_path,...
import openerp class WebKitHelper(object): """Set of usefull report helper""" def __init__(self, cursor, uid, report_id, context): "constructor" self.cursor = cursor self.uid = uid self.pool = openerp.registry(self.cursor.dbname) self.report_id = report_id self.c...
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...
"""Command for recreating instances of managed instance group.""" from googlecloudsdk.api_lib.compute import base_classes from googlecloudsdk.calliope import base from googlecloudsdk.command_lib.compute.instance_groups import flags as instance_groups_flags from googlecloudsdk.command_lib.compute.instance_groups.manage...
"""Tests for denormal handling.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import platform from tensorflow.python.framework import constant_op from tensorflow.python.ops import array_ops from tensorflow.python.platform import tes...