content string |
|---|
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pants_test.contrib.android.test_android_base import TestAndroidBase, distribution
from pants.contrib.android.tasks.aapt_builder import AaptBuilder
c... |
"""
pgoapi - Pokemon Go API
Copyright (c) 2016 tjado <https://github.com/tejado>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... |
#!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
#!/usr/bin/env python
'''
set stream rate on an APM
'''
import sys, struct, time, os
from optparse import OptionParser
parser = OptionParser("apmsetrate.py [options]")
parser.add_option("--baudrate", dest="baudrate", type='int',
help="master port baud rate", default=115200)
parser.add_option("--d... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class product_pricelist(osv.osv):
_inherit = 'product.pricelist'
_columns ={
'visible_discount': fields.boolean('Visible Discount'),
}
_defaults = {
'visible_discount': True,
}
class sale_order_line(osv.os... |
"""Unit tests for pytree.py.
NOTE: Please *don't* add doc strings to individual test methods!
In verbose mode, printing of the module, class and method name is much
more helpful than printing of (the first line of) the docstring,
especially when debugging a test.
"""
from __future__ import with_statement
import sys
... |
"""
The MIT License
Copyright (c) 2007 Leah Culver
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... |
"""
Low-level wrapper for PortMidi library
Copied straight from Grant Yoshida's portmidizero, with slight
modifications.
"""
import sys
from ctypes import (CDLL, CFUNCTYPE, POINTER, Structure, c_char_p,
c_int, c_long, c_uint, c_void_p, cast,
create_string_buffer)
import ctypes.u... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# take a list of pages
# select a level default = 1
# prepare a list of links in the pages from the original list
# create a file with the titles of all the selected pages
# create a file with the content of all the selected pages
import codecs
import re
from xml.sax impo... |
#!/usr/bin/env python
import sys
import rospy
import rostest
import unittest
from rosbridge_library.internal import ros_loader
class TestROSLoader(unittest.TestCase):
def setUp(self):
rospy.init_node("test_ros_loader")
def test_bad_msgnames(self):
bad = ["", "/", "//", "///", "////", "/////... |
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class IntlEsFrPtBrPage(page_module.Page):
def __init__(self, url, page_set):
super(IntlEsFrPtBrPage, self).__init__(
url=url, page_set=page_set,
shared_page_state_class=shared... |
""" Utilities for dealing with builder names. This module obtains its attributes
dynamically from builder_name_schema.json. """
import json
import os
# All of these global variables are filled in by _LoadSchema().
# The full schema.
BUILDER_NAME_SCHEMA = None
# Character which separates parts of a builder name.
B... |
"""Ops and utilities for neural networks.
For now, just an LSTM layer.
"""
import shapes
import tensorflow as tf
rnn = tf.load_op_library("../cc/rnn_ops.so")
def rnn_helper(inp,
length,
cell_type=None,
direction="forward",
name=None,
*args,
... |
"""Archiver API implementation."""
from __future__ import absolute_import
from fs.zipfs import ZipFS
from invenio.modules.documents import api
from .bagit import create_bagit
from .utils import name_generator
def get_archive_package(recid, version=None):
"""Return archive package.
:param recid: The recor... |
__author__ = 'brendan'
import helper_functions
import os
import tarfile
proj_cwd = os.path.dirname(os.getcwd())
data_dir = proj_cwd + r'/data'
def download_url(url, destination_path, curl_path=r'C:/Users/brendan/Downloads/curl-7.38.0-win64/bin/curl'):
"""
This is a quick and easy function that simulates cli... |
import chainer
import chainer.links.rnn as rnn
import chainermn.functions
class _MultiNodeNStepRNN(chainer.Chain):
def __init__(self, link, communicator, rank_in, rank_out):
super(_MultiNodeNStepRNN, self).__init__(actual_rnn=link)
self.communicator = communicator
self.rank_in = rank_in
... |
'''Extensible attributed text format for representing pyglet formatted
documents.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import operator
import parser
import re
import token
import pyglet
_pattern = re.compile(r'''
(?P<escape_hex>\{\#x(?P<escape_hex_val>[0-9a-fA-F]+)\})
| (?P<escape_dec... |
# -*- 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
... |
# -*- coding: utf-8 -*-
import unittest
from wechatpy.replies import TextReply, create_reply
class CreateReplyTestCase(unittest.TestCase):
def test_create_reply_with_text_not_render(self):
text = 'test'
reply = create_reply(text, render=False)
self.assertEqual('text', reply.type)
... |
from __future__ import absolute_import
import errno
import warnings
import hmac
import socket
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
from ..packages import six
SSLContext = None
HAS_SNI = False
IS_PY... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... |
"""
This file defines RotatePictureExplorer, an explorer for
PictureSensor.
"""
from nupic.regions.PictureSensor import PictureSensor
class RotatePictureExplorer(PictureSensor.PictureExplorer):
@classmethod
def queryRelevantParams(klass):
"""
Returns a sequence of parameter names that are relevant to
... |
import unittest
from telemetry.util import color_histogram
from telemetry.util import rgba_color
from metrics import speedindex
class FakeImageUtil(object):
# pylint: disable=unused-argument
def GetColorHistogram(self, image, ignore_color=None, tolerance=None):
return image.ColorHistogram()
class FakeVid... |
"""Validate coverage files."""
from pathlib import Path
from typing import Dict
from .model import Config, Integration
DONT_IGNORE = (
"config_flow.py",
"device_action.py",
"device_condition.py",
"device_trigger.py",
"group.py",
"intent.py",
"logbook.py",
"media_source.py",
"scene.... |
# -*- coding: utf-8 -*-
import mimetypes
import StringIO
import unittest
import sys
from test import test_support
# Tell it we don't know about external files:
mimetypes.knownfiles = []
mimetypes.inited = False
mimetypes._default_mime_types()
class MimeTypesTestCase(unittest.TestCase):
def setUp(self):
... |
"""distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: filelist.py 37828 2004-11-10 22:23:15Z loewis $"
import os, string, re
import fnmatch
from types import *
from glob i... |
from django import http
import commonware
import requests
from rest_framework.exceptions import ParseError
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny, BasePermission
from rest_framework.response import Response
from rest_framework.views import APIView
import mkt
fr... |
"""The tests for reproduction of state."""
from asyncio import Future
from unittest.mock import patch
from homeassistant.components.group.reproduce_state import async_reproduce_states
from homeassistant.core import Context, State
async def test_reproduce_group(hass):
"""Test reproduce_state with group."""
co... |
from django.db import models
from django.db.models.query import F
from six import string_types
from .constants import collection_kinds
from .errors import InvalidHierarchyRelationsArgument
class HierarchyRelationsFilter(object):
"""
Helper class for efficiently making queries based on relations between model... |
from django.db import models
from datetime import datetime
from django.contrib.gis.db import models
from social.core.models import *
from social.core.models import Social_node
# Create your models here.
class Group(models.Model):
manager=models.ManyToManyField("Player",null=True)
name=models.TextField(null=Fal... |
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_apm_policy_import
short_description: Manage BIG-IP AP... |
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Site(models.Model):
domain = models.CharField(max_length=100)
def __str__(self):
return self.domain
class Article(models.Model):
"""
A s... |
"""
Base functionality useful to various parts of Twisted Names.
"""
from __future__ import division, absolute_import
import socket
from zope.interface import implementer
from twisted.names import dns
from twisted.names.error import DNSFormatError, DNSServerError, DNSNameError
from twisted.names.error import DNSNot... |
class CreatorError(Exception):
"""An exception base class for all imgcreate errors."""
def __init__(self, msg):
Exception.__init__(self, msg)
# Some error messages may contain unicode strings (especially if your system
# locale is different from 'C', e.g. 'de_DE'). Python's exception class does... |
import logging
import time
import gevent
import msgpack
import zmq.green as zmq
from lymph.core.components import Component
logger = logging.getLogger(__name__)
DEFAULT_MONITOR_ENDPOINT = 'tcp://127.0.0.1:44044'
class MonitorPusher(Component):
def __init__(self, container, aggregator, endpoint=None, interva... |
"""
Slovenian specific form helpers.
"""
from __future__ import absolute_import, unicode_literals
import datetime
import re
from django.contrib.localflavor.si.si_postalcodes import SI_POSTALCODES_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields... |
# Server Specific Configurations
server = {
'port': '8080',
'host': '0.0.0.0'
}
# Pecan Application Configurations
app = {
'root': 'sketch.controllers.root.RootController',
'modules': ['sketch'],
'static_root': '%(confdir)s/public',
'template_path': '%(confdir)s/sketch/templates',
'debug': ... |
import sys
from django.conf import settings
from django.core.urlresolvers import clear_url_caches, resolve
class UrlResetMixin(object):
"""Mixin to reset urls.py before and after a test
Django memoizes the function that reads the urls module (whatever module
urlconf names). The module itself is also sto... |
def parse_future(tree, feature_flags):
from ayrton.parser.astcompiler import ast
future_lineno = 0
future_column = 0
flags = 0
have_docstring = False
body = None
if isinstance(tree, ast.Module):
body = tree.body
elif isinstance(tree, ast.Interactive):
body = tree.body
... |
from moto.core import BaseBackend
import boto.logs
from moto.core.utils import unix_time_millis
from .exceptions import (
ResourceNotFoundException,
ResourceAlreadyExistsException
)
class LogEvent:
_event_id = 0
def __init__(self, ingestion_time, log_event):
self.ingestionTime = ingestion_tim... |
"""
Wraps the Spotify Web Player to play music
Usage Examples:
- "Open facebook.com"
- "Search Neil Degrasse Tyson"
- "Maximize the browser"
"""
from athena.classes.module import Module
from athena.classes.task import ActiveTask
from athena.apis import api_lib
VB_PATTERNS... |
"""Preprocessing tools useful for building models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.contrib.learn.python.learn.preprocessing.categorical import *
from tensorflow.contrib.learn.python.learn.... |
# Embedded file name: /usr/lib/enigma2/python/Components/ScrollLabel.py
import skin
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from enigma import eLabel, eWidget, eSlider, fontRenderClass, ePoint, eSize
class ScrollLabel(HTMLComponent, GUIComponent):
def __init__(self, t... |
"""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 sy... |
"""This file exports public symbols.
"""
from mod_pywebsocket._stream_base import BadOperationException
from mod_pywebsocket._stream_base import ConnectionTerminatedException
from mod_pywebsocket._stream_base import InvalidFrameException
from mod_pywebsocket._stream_base import InvalidUTF8Exception
from mod_pywebsock... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = r'''
---
module: aci_aaa_user_certificate
short_description: Manage AAA user ... |
# -*- coding: utf-8 -*-
'''
Created on 17.09.2015
@author: derChris
'''
from pydispatch import dispatcher
import PlugIns.NodeTemplates
import PlugIns.MATLAB.MATLAB
import Pipe
class FunctionSelectionNode(PlugIns.NodeTemplates.NodeTemplate):
_UPDATE_FUNCTION_SELECTION_WIDGET = 'UPDATE_FUNCTION_SELECTION_WID... |
# parameters.py
# -*- coding: utf-8 -*-
'''
IIIF Image API parameters as objects.
The attributes of this class should make it possible to work with most imaging
libraries without any further need to process the IIIF syntax.
'''
import re
from decimal import Decimal
from math import floor
from logging import getLog... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
import re
from ansible.module_utils.nxos import load_config, run_commands
from ansible.module_utils.nxos import nxos_argument_spec, check_args
from ansible.module_utils.basic imp... |
import collections
from .primitive import DeviceTarget, Primitive
class Frame(collections.MutableSequence):
def __init__(self, chain, *prims, fill=False):
self._chain = chain
self._prims = [None for i in range(len(chain._devices))]
self._valid_prim = None
#self._prim_type = None
... |
__license__ = 'GPL v3'
__copyright__ = '2008, Ashish Kulkarni <<EMAIL>>'
'''Read meta information from RB files'''
import sys, struct
from calibre.ebooks.metadata import MetaInformation, string_to_authors
MAGIC = '\xb0\x0c\xb0\x0c\x02\x00NUVO\x00\x00\x00\x00'
def get_metadata(stream):
""" Return metadata as a... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
test = TestSCons.TestSCons()
test.write('SConstruct', "")
test.option_not_yet_implemented('-W', 'foo .')
test.option_not_yet_implemented('--what-if', '=foo .')
test.option_not_yet_implemented('--new-file', '=foo .')
test.option_not_ye... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class List(Choreography):
def __init__(self, temboo_session):
"""
Create a new inst... |
import sigrokdecode as srd
# Dictionary of FUNCTION commands and their names.
commands_2432 = {
0x0f: 'Write scratchpad',
0xaa: 'Read scratchpad',
0x55: 'Copy scratchpad',
0xf0: 'Read memory',
0x5a: 'Load first secret',
0x33: 'Compute next secret',
0xa5: 'Read authenticated page',
}
comman... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: installp
author:
- Kairo Araujo (@kairoaraujo)
short_descrip... |
from PyQt4 import QtCore, QtGui
import draggableicons_rc
class DragWidget(QtGui.QFrame):
def __init__(self, parent=None):
super(DragWidget, self).__init__(parent)
self.setMinimumSize(200, 200)
self.setFrameStyle(QtGui.QFrame.Sunken | QtGui.QFrame.StyledPanel)
self.setAcceptDrops(... |
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
from ansible.module_utils.ipa import IPAClient
class SudoRuleIPACl... |
from zz_failure_summary import deduplicate_failures
import pytest
@pytest.mark.parametrize('failures,deduplicated', [
(
[
{
'host': 'master1',
'msg': 'One or more checks failed',
},
],
[
{
'host': ('master... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following line in the
entry_points section in setup.cfg:
console_scripts =
fibonacci = stupidlang.skeleton:run
Then run `python setup.py i... |
import kivy
kivy.require('1.4.2')
import os
import sys
from kivy.app import App
from kivy.factory import Factory
from kivy.lang import Builder, Parser, ParserException
from kivy.properties import ObjectProperty
from kivy.config import Config
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.popup import Popup
fro... |
# coding: utf-8
from doaj.client import Client, PAGESIZE, must_have_token
class Applications(Client):
endpoint = "application/"
search_endpoint = "search/applications/"
@must_have_token
def search(self, query, sort=None, pagesize=PAGESIZE):
"""
query must be a valid lucene query
... |
"""Tests for google.appengine.tools.devappserver2.python.request_state."""
import ctypes
import threading
import unittest
import google
import mox
from google.appengine.tools.devappserver2.python import request_state
class CtypesComparator(mox.Comparator):
def __init__(self, lhs):
self.lhs = lhs.value
d... |
#!/usr/bin/env python
"""
Flash Socket Policy Server.
- Starts Flash socket policy file server.
- Defaults to port 843.
- NOTE: Most operating systems require administrative privileges to use
ports under 1024.
$ ./policyserver.py [options]
"""
"""
Also consider Adobe's solutions:
http://www.adobe.com/devnet/fla... |
import datetime
import json
import flask
from google.cloud import datastore
class AppModule(object):
"""
Base class for application module
"""
def __init__(self, Blueprint=flask.Blueprint, current_app=flask.current_app,
redirect=flask.redirect, render_template=flask.render_template,... |
#!/usr/bin/env python
import rospy
from rqt_gui_py.plugin import Plugin
from python_qt_binding.QtCore import Qt
from python_qt_binding.QtGui import QInputDialog
from rqt_launchtree.launchtree_widget import LaunchtreeWidget
class LaunchtreePlugin(Plugin):
_SETTING_LASTPKG = 'last_pkg'
_SETTING_LASTLAUNCHFIL... |
import six
from hamcrest.core.string_description import *
from hamcrest.core.selfdescribing import SelfDescribing
import re
import pytest
try:
import unittest2 as unittest
except ImportError:
import unittest
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.... |
import math
import unittest
import numpy
import six
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class TestSoftmaxCrossEntropy(unittest.TestCase):
def s... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import argparse
import os
import pyfastx
from amptk import amptklib
class MyFormatter(argparse.ArgumentDefaultsHelpFormatter):
def __init__(self,prog):
super(MyFormatter,self).__init__(prog,max_help_position=50)
def countBarcodes(fi... |
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
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
CONF = cfg.CONF
CONF.register_cli_opts([
cfg.IntOpt(... |
import mock
import pytest
from pylib.aeon.opx import device
from pylib.aeon.cumulus import connector
g_facts = {
'hw_version': None,
'hw_part_number': None,
'hostname': 'opx221_vm',
'serial_number': '525400A5EC36',
'fqdn': 'opx221_vm',
'os_version': '2.2.1',
'virtual': True,
'hw_model'... |
import subprocess
import gc
import os, os.path
import time, re
from rar_exceptions import *
class UnpackerNotInstalled(Exception): pass
rar_executable_cached = None
rar_executable_version = None
def call_unrar(params):
"Calls rar/unrar command line executable, returns stdout pipe"
global rar_executable_cac... |
from gnuradio import gr, gr_unittest, analog, blocks
def clip(x, lo, hi):
if(x < lo):
return lo
elif(x > hi):
return hi
else:
return x
class test_rail(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
... |
"""VARBLOCK file support
.. deprecated:: 3.4
The VARBLOCK format is NOT recommended for general use, has been deprecated since
Python-RSA 3.4, and will be removed in a future release. It's vulnerable to a
number of attacks:
1. decrypt/encrypt_bigfile() does not implement `Authenticated encryption`_ n... |
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a de julio 1887'
TIME_FORMAT = 'H:i' # '18:59'
DATETIME_FORMAT = r'j\-\a \d\e F Y\,... |
from django.contrib.gis.gdal.error import GDALException
from django.utils import six
class OGRGeomType(object):
"Encapsulates OGR Geometry Types."
wkb25bit = -2147483648
# Dictionary of acceptable OGRwkbGeometryType s and their string names.
_types = {0: 'Unknown',
1: 'Point',
... |
'''
@author: Frank
'''
import os.path
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstacktestagent.plugins.host as host_plugin
import zstacktestagent.testagent as testagent
import zstackwoodpecker.operations.deploy_operations as deploy_operations
import zstackwoodpecker... |
try:
from io import UnsupportedOperation
except ImportError:
UnsupportedOperation = object()
import logging
import mimetypes
mimetypes.init()
mimetypes.types_map['.dwg']='image/x-dwg'
mimetypes.types_map['.ico']='image/x-icon'
mimetypes.types_map['.bz2']='application/x-bzip2'
mimetypes.types_map['.gz']='applica... |
import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
# EXERCISE: try out different sort orders for the names
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['... |
from __future__ import division, print_function, absolute_import
from nose import SkipTest
import numpy as np
from numpy.testing import assert_array_almost_equal
try:
from scipy.sparse.csgraph import breadth_first_tree, depth_first_tree,\
csgraph_to_dense, csgraph_from_dense
except ImportError:
# Oldi... |
"""The hosts admin extension."""
import webob.exc
from xml.parsers import expat
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import compute
from nova import exception
from nova.openstack.common import log as logging
from nova import uti... |
"""Support for HomematicIP Cloud cover devices."""
import logging
from typing import Optional
from homematicip.aio.device import (
AsyncFullFlushBlind,
AsyncFullFlushShutter,
AsyncGarageDoorModuleTormatic,
AsyncHoermannDrivesModule,
)
from homematicip.aio.group import AsyncExtendedLinkedShutterGroup
fr... |
from twisted.trial import unittest
from twisted.words.im import basesupport
from twisted.internet import error, defer
class DummyAccount(basesupport.AbstractAccount):
"""
An account object that will do nothing when asked to start to log on.
"""
loginHasFailed = False
loginCallbackCalled = False
... |
from setuptools import setup, find_packages
NAME = "autorestbooltestservice"
VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
REQUIRES = ["msrest>=0.2.0"]
setup(
name=NAME,
version=VERSION,
des... |
from unittest import TestCase
import plotly.graph_objs as go
OLD_CLASS_NAMES = [
"AngularAxis",
"Annotation",
"Annotations",
"Bar",
"Box",
"ColorBar",
"Contour",
"Contours",
"Data",
"ErrorX",
"ErrorY",
"ErrorZ",
"Figure",
"Font",
"Frame",
"Frames",
... |
from odoo.addons.event_crm.tests.common import TestEventCrmCommon
class TestEventFullCommon(TestEventCrmCommon):
@classmethod
def setUpClass(cls):
super(TestEventFullCommon, cls).setUpClass()
cls.event_product = cls.env['product.product'].create({
'name': 'Test Registration Produ... |
#!/usr/bin/python
"""
takes templated file .xxx.src and produces .xxx file where .xxx is
.i or .c or .h, using the following template rules
/**begin repeat -- on a line by itself marks the start of a repeated code
segment
/**end repeat**/ -- on a line by itself marks it's end
After the /**begin ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# @Author: Mani
# @Date: 2017-08-28 19:20:58
# @Last Modified time: 2017-09-27 12:54:55
#
##############################################
import mani_config
import docker_config
import emby_config
SERVICE_CONFIG_OPTIONS = {
"embyserver" : {
"module":"emby... |
import os
import re
from pip.backwardcompat import urlparse
from pip import InstallationError
from pip.index import Link
from pip.util import rmtree, display_path, call_subprocess
from pip.log import logger
from pip.vcs import vcs, VersionControl
_svn_xml_url_re = re.compile('url="([^"]+)"')
_svn_rev_re = re.compile('... |
from dbapi2 import * |
import os
import unittest
from tomber import *
from random import randrange
from shutil import rmtree, copyfile
class tomberTester(unittest.TestCase):
@classmethod
def setUpClass(self):
self.pid = str(os.getpid())
self.tombfile = '.'.join([self.pid, 'tomb'])
self.keyfile = '.'.join([s... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class WayOfTheMasterIE(InfoExtractor):
_VALID_URL = r'https?://www\.wayofthemaster\.com/([^/?#]*/)*(?P<id>[^/?#]+)\.s?html(?:$|[?#])'
_TEST = {
'url': 'http://www.wayofthemaster.com/hbks.shtml',
'md5': '5316... |
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import FileSystemStorage
from django.utils.importlib import import_module
from django.contrib.staticfiles import utils
class StaticFilesStorage(FileSystemStorage):
"""
Standard fi... |
"""
Test if the firing number of coincidences after inhibition equals spatial pooler
numActiveColumnsPerInhArea.
TODO: Fix this up to be more unit testy.
"""
import numpy
import unittest2 as unittest
from nupic.research.spatial_pooler import SpatialPooler
numpy.random.seed(100)
class InhibitionObjectTest(unitte... |
import requests
from httpretty import HTTPretty
from social.p3 import urlparse
from social.utils import parse_qs, url_add_parameters
from social.tests.models import User
from social.tests.backends.base import BaseBackendTest
class BaseOAuthTest(BaseBackendTest):
backend = None
backend_path = None
user_... |
"""Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <<EMAIL>>
# Fabian Pedregosa <<EMAIL>>
# Alexandre Gramfort <<EMAIL>>
# Sparseness support by Lars Buitinck <<EMAIL>>
# Multi-output support by Arnaud Joly <<EMAIL>>
#
# License: BSD 3 clause (C) INRIA, University of Amste... |
from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import (UserCreationForm, UserChangeForm,
AdminPasswordChangeForm)
from django.contrib.auth.models import User, Group
from django.contrib import messages
from django.core.exceptions imp... |
from __future__ import print_function
import os
import numpy as np
from tabulate import tabulate
from htmresearch.frameworks.pytorch.mnist_sparse_experiment import \
MNISTSparseExperiment
def bestScore(scores):
"""
Given a single repetition of a single experiment, return the test, and
total noise score fro... |
from __future__ import unicode_literals
import hashlib
import os
import posixpath
import re
try:
from urllib.parse import unquote, urlsplit, urlunsplit, urldefrag
except ImportError: # Python 2
from urllib import unquote
from urlparse import urlsplit, urlunsplit, urldefrag
from django.conf import setti... |
import time
from openerp.report import report_sxw
class workcenter_code(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(workcenter_code, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
})
report_sxw.report_sxw('rep... |
"""Support for the MySQL database via the pyodbc adapter.
pyodbc is available at:
http://pypi.python.org/pypi/pyodbc/
Connecting
----------
Connect string::
mysql+pyodbc://<username>:<password>@<dsnname>
Limitations
-----------
The mysql-pyodbc dialect is subject to unresolved character encoding issues
w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.