code stringlengths 1 199k |
|---|
"""
Tests of random Parameter distributions, using the Kolmogorov-Smirnov test.
"""
import unittest
import nest
import numpy as np
try:
import scipy.stats
HAVE_SCIPY = True
except ImportError:
HAVE_SCIPY = False
@unittest.skipIf(not HAVE_SCIPY, 'SciPy package is not available')
class RandomParameterTestCase... |
import os
import shutil
import shlex
import traceback
import re
import time
import sys
from subprocess import call
from misc.colour_terminal import print_red, print_blue
from exc.test_failed import TestFailed
import conf
HTTP = "HTTP"
HTTPS = "HTTPS"
class BaseTest:
"""
Class that defines methods common to both... |
from odoo.addons.account.tests.account_test_classes import AccountingTestCase
from odoo.osv.orm import except_orm
from datetime import datetime, timedelta
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT
class TestPeriodState(AccountingTestCase):
"""
Forbid creation of Journal Entries for a closed period.
... |
from couchpotato.core.event import addEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.base import Provider
log = CPLog(__name__)
class TrailerProvider(Provider):
type = 'trailer'
def __init__(self):
addEvent('trailer.search', self.search)
class VFTrailerProvid... |
"""An XBlock providing thumbs-up/thumbs-down voting.
This is a completely artifical test case for the filesystem field type.
Votes are stored in a JSON object in the file system, and up/down arrow PNGs are constructed as files on-the-fly.
"""
import json
import png
from xblock.core import XBlock
from xblock.fields impo... |
"""Higher-level, semantic data types for the datastore. These types
are expected to be set as attributes of Entities. See "Supported Data Types"
in the API Guide.
Most of these types are based on XML elements from Atom and GData elements
from the atom and gd namespaces. For more information, see:
http://www.atomenab... |
from django.utils.translation import ugettext_lazy as _
from horizon import tables
from openstack_dashboard import api
from openstack_dashboard.dashboards.project.routers import tables as r_tables
class DeleteRouter(r_tables.DeleteRouter):
redirect_url = "horizon:admin:routers:index"
policy_rules = (("network",... |
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import Index
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import UniqueConstraint
def upgrade(migrate_engine):
meta = MetaData(bind=migrate_engin... |
from api import *
import re
class RegexpStemmer(StemmerI):
"""
A stemmer that uses regular expressions to identify morphological
affixes. Any substrings that match the regular expressions will
be removed.
"""
def __init__(self, regexp, min=0):
"""
Create a new regexp stemmer.
... |
"""
Minimum cost flow algorithms on directed connected graphs.
"""
__author__ = """Loïc Séguin-C. <loicseguin@gmail.com>"""
__all__ = ['min_cost_flow_cost',
'min_cost_flow',
'cost_of_flow',
'max_flow_min_cost']
import networkx as nx
def min_cost_flow_cost(G, demand = 'demand', capacity ... |
CHROMIUM_SRC=$(realpath $(dirname $(readlink -f $0))/../../../../..)
python3 \
$CHROMIUM_SRC/components/feed/core/v2/tools/textpb_to_binarypb.py \
--direction=reverse --chromium_path="$CHROMIUM_SRC" \
--message=feedwire.Request |
import os
from werkzeug import Response
from werkzeug.utils import import_string
import kay
from kay.conf import settings
from kay.utils.text import javascript_quote
import gettext as gettext_module
NullSource = """
/* gettext identity library */
function gettext(msgid) { return msgid; }
function ngettext(singular, plu... |
import unittest
import chainer
from chainer import flag
from chainer import testing
class TestFlag(unittest.TestCase):
def test_construction(self):
self.assertIs(chainer.ON, chainer.Flag('on'))
self.assertIs(chainer.ON, chainer.Flag('ON'))
self.assertIs(chainer.ON, chainer.Flag(True))
... |
from __future__ import absolute_import
from __future__ import print_function
import datetime
import locale
from twisted.python import log
from twisted.trial import unittest
from buildbot.test.util import validation
from buildbot.util import UTC
class VerifyDict(unittest.TestCase):
def doValidationTest(self, validat... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible import constants as C
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.module_utils._text import to_native, to_text
from ansible.playbook import Playbook
from ansible.template impo... |
"""
Test the constrained cube loading mechanism.
"""
from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa
import six
import iris.tests as tests
import iris
import iris.tests.stock as stock
SN_AIR_POTENTIAL_TEMPERATURE = 'air_potential_temperat... |
{
"name": "Multi-Currency Analytic Second Axis",
"version": "1.0",
"author": "Camptocamp,Odoo Community Association (OCA)",
"category": "Generic Modules/Accounting",
"description":
"""
Add a second analytical axis on analytic lines allowing you to make
reporting on.
Unless the accoun... |
"""Support for custom shell commands to turn a switch on/off."""
import logging
import voluptuous as vol
from homeassistant.components.switch import (
ENTITY_ID_FORMAT,
PLATFORM_SCHEMA,
SwitchEntity,
)
from homeassistant.const import (
CONF_COMMAND_OFF,
CONF_COMMAND_ON,
CONF_COMMAND_STATE,
C... |
import action
import entity
import life
import dynamicObject
import knowledge
import loadDll
import logger
import simulation
import staticObject |
from __future__ import print_function
"""
This module contains custom aggregators for sqlite3
sqlite has the following aggregate functions built-in:
avg(X)
count(X)
count(*)
group_concat(X)
group_concat(X,Y)
max(X)
min(X)
sum(X)
total(X)
The aggregate functions in sqlite are much fas... |
from sub1 import method1 |
"""Various types of useful iterators and generators.
"""
import sys
try:
from email._compat22 import body_line_iterator, typed_subpart_iterator
except SyntaxError:
# Python 2.1 doesn't have generators
from email._compat21 import body_line_iterator, typed_subpart_iterator
def _structure(msg, fp=None, level=0... |
import re
class PtpException(Exception):
def __init__(self, message, source=None):
if source is not None:
message = source + ": " + message
Exception.__init__(self, message)
class EqMixin(object):
def __eq__(self, other):
return (isinstance(other, self.__class__)
... |
import binascii
from Crypto.Cipher import AES
import win32con, win32api
from config.write_output import print_output, print_debug
from config.header import Header
from config.moduleInfo import ModuleInfo
class CoreFTP(ModuleInfo):
def __init__(self):
options = {'command': '-core', 'action': 'store_true', 'dest': 'co... |
"""
Interaction with scipy.sparse matrices.
Currently only includes SparseSeries.to_coo helpers.
"""
from pandas.core.index import MultiIndex, Index
from pandas.core.series import Series
from pandas.compat import OrderedDict, lmap
def _check_is_partition(parts, whole):
whole = set(whole)
parts = [set(x) for x i... |
"""Regresssion tests for urllib"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from test import support
import os
import sys
import tempfile
from nturl2path import url2pathname, pathname2url
from base64 import b64encode
import collectio... |
from nupic.frameworks.opf.expdescriptionhelpers import importBaseDescription
config ={
'modelParams' : {'sensorParams': {'encoders': {u'c0_timeOfDay': None, u'c0_dayOfWeek': None, u'c1': {'name': 'c1', 'clipInput': True, 'n': 275, 'fieldname': 'c1', 'w': 21, 'type': 'AdaptiveScalarEncoder'}, u'c0_weekend': None}}, 's... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: mysql_user
short_description: Adds or removes a user from a My... |
"""Tests for combined DNN + GBDT estimators."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tempfile
from tensorflow.contrib.boosted_trees.estimator_batch import dnn_tree_combined_estimator as estimator
from tensorflow.contrib.boosted_trees.proto i... |
from ....testing import assert_equal
from ..preprocess import Despike
def test_Despike_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='%s',
copyfile=Fals... |
import time
import sys
def application(e, sr):
time.sleep(3)
print("3 seconds elapsed")
sr('200 Ok', [('Content-Type', 'text/html')])
time.sleep(2)
print("2 seconds elapsed")
yield "part1"
try:
time.sleep(2)
except:
print("CLIENT DISCONNECTED !!!")
print("2 seconds el... |
from __future__ import unicode_literals
import gzip
import random
import re
from io import BytesIO
from unittest import skipIf
from django.conf import settings
from django.core import mail
from django.core.exceptions import PermissionDenied
from django.http import (
FileResponse, HttpRequest, HttpResponse, HttpResp... |
"""
=================================================
SVM-Anova: SVM with univariate feature selection
=================================================
This example shows how to perform univariate feature selection before running a
SVC (support vector classifier) to improve the classification scores. We use
the iris d... |
"""
Import related utilities and helper functions.
"""
import sys
import traceback
def import_class(import_str):
"""Returns a class from a string including module and class."""
mod_str, _sep, class_str = import_str.rpartition('.')
__import__(mod_str)
try:
return getattr(sys.modules[mod_str], cla... |
import uuid
import hashlib
from boto.connection import AWSQueryConnection
from boto.regioninfo import RegionInfo
from boto.compat import json
import boto
class SNSConnection(AWSQueryConnection):
"""
Amazon Simple Notification Service
Amazon Simple Notification Service (Amazon SNS) is a web service
that ... |
from . import coupon
from . import coupon_program
from . import sale_order |
"""
Example using MySQL Connector/Python showing:
* dropping and creating a table
* using warnings
* doing a transaction, rolling it back and committing one.
"""
import mysql.connector
def main(config):
output = []
db = mysql.connector.Connect(**config)
cursor = db.cursor()
# Drop table if exists, and c... |
from django.http import HttpResponse
from mysite.missions.base.views import *
from mysite.missions.tar import view_helpers
def reset(request):
''' Resets the state of the Tar mission '''
if request.method == 'POST' and request.POST['mission_parts']:
mission_parts = request.POST['mission_parts'].split(',... |
"""File and Cloud URL representation classes."""
from __future__ import absolute_import
import os
import re
from gslib.exception import InvalidUrlError
PROVIDER_REGEX = re.compile(r'(?P<provider>[^:]*)://$')
BUCKET_REGEX = re.compile(r'(?P<provider>[^:]*)://(?P<bucket>[^/]*)/{0,1}$')
OBJECT_REGEX = re.compile(
r'(?... |
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 library.mo... |
from openerp import SUPERUSER_ID
from openerp.osv import fields, osv
class crm_configuration(osv.TransientModel):
_name = 'sale.config.settings'
_inherit = ['sale.config.settings', 'fetchmail.config.settings']
_columns = {
'generate_sales_team_alias': fields.boolean(
"Automatically gener... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... |
import mock
import oslo_messaging as messaging
from nova import context
from nova import exception
from nova import objects
from nova.scheduler import client as scheduler_client
from nova.scheduler.client import query as scheduler_query_client
from nova.scheduler.client import report as scheduler_report_client
from nov... |
"""
celery.worker.mediator
~~~~~~~~~~~~~~~~~~~~~~
The mediator is an internal thread that moves tasks
from an internal :class:`Queue` to the worker pool.
This is only used if rate limits are enabled, as it moves
messages from the rate limited queue (which holds tasks
that are allowed to be p... |
from __future__ import absolute_import
from celery.states import state
from celery import states
from celery.tests.utils import unittest
class test_state_precedence(unittest.TestCase):
def test_gt(self):
self.assertGreater(state(states.SUCCESS),
state(states.PENDING))
self... |
import pandas as pd
import pytz
from datetime import datetime
from dateutil import rrule
from functools import partial
start = pd.Timestamp('1990-01-01', tz='UTC')
end_base = pd.Timestamp('today', tz='UTC')
end = end_base + pd.datetools.relativedelta(years=1)
def canonicalize_datetime(dt):
# Strip out any HHMMSS or... |
"""OpenNebula plugin for integration tests."""
from __future__ import annotations
import configparser
from ....util import (
display,
)
from . import (
CloudEnvironment,
CloudEnvironmentConfig,
CloudProvider,
)
class OpenNebulaCloudProvider(CloudProvider):
"""Checks if a configuration file has been ... |
from __future__ import division
import numpy as np
import scipy.sparse as sp
import operator
import array
from sklearn.utils import check_random_state
from ._random import sample_without_replacement
__all__ = ['sample_without_replacement', 'choice']
def choice(a, size=None, replace=True, p=None, random_state=None):
... |
from . import account_invoice_line |
from __future__ import print_function
import ctypes
import numpy
c_float_ptr = ctypes.POINTER(ctypes.c_float)
c_int_ptr = ctypes.POINTER(ctypes.c_int)
c_void_p = ctypes.c_void_p
c_int = ctypes.c_int
c_char_p = ctypes.c_char_p
c_float = ctypes.c_float
kaldi = ctypes.cdll.LoadLibrary("libkaldi-python-wrap.so") # this ne... |
"""
******** Models for test_data.py ***********
The following classes are for testing basic data marshalling, including
NULL values, where allowed.
The basic idea is to have a model for each Django data type.
"""
from __future__ import unicode_literals
from django.contrib.contenttypes.fields import (
GenericForeig... |
from django.core.exceptions import ValidationError
from django.db import models
from django.test import SimpleTestCase, TestCase
from django.utils.functional import lazy
from .models import Post
class TestCharField(TestCase):
def test_max_length_passed_to_formfield(self):
"""
CharField passes its ma... |
'''
play back a mavlink log as a FlightGear FG NET stream, and as a
realtime mavlink stream
Useful for visualising flights
'''
import sys, time, os, struct
import Tkinter
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import fgFDM
from optparse import OptionParser
parser = OptionPar... |
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
invoice_is_snailmail = fields.Boolean(string='Send by Post', related='company_id.invoice_is_snailmail', readonly=False) |
from __future__ import absolute_import
import os, signal, subprocess, sys
import re
import platform
import tempfile
import lit.ShUtil as ShUtil
import lit.Test as Test
import lit.util
class InternalShellError(Exception):
def __init__(self, command, message):
self.command = command
self.message = mes... |
from . import company
from . import res_config
from . import account |
from urllib import (urlopen, urlencode, unquote_plus) |
from django.conf import settings
from django.core.cache import cache
from django.utils.cache import get_cache_key, learn_cache_key, patch_response_headers
class CacheMiddleware(object):
"""
Cache middleware. If this is enabled, each Django-powered page will be
cached for CACHE_MIDDLEWARE_SECONDS seconds. Ca... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
url(r'^.*$', 'DjangoApplication.TestApp.views.home', name='home'),
# url(r'^DjangoApplication/', include('DjangoApplication.DjangoApplication.urls')),
# Uncomment the admin/doc line below to enable admin documenta... |
"""Interpolation algorithms using piecewise cubic polynomials."""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import string_types
from . import BPoly, PPoly
from .polyint import _isscalar
from scipy._lib._util import _asarray_validated
from scipy.linalg import... |
"""
USAGE: %(program)s WIKI_XML_DUMP OUTPUT_PREFIX [VOCABULARY_SIZE]
Convert articles from a Wikipedia dump to (sparse) vectors. The input is a
bz2-compressed dump of Wikipedia articles, in XML format.
This actually creates three files:
* `OUTPUT_PREFIX_wordids.txt`: mapping between words and their integer ids
* `OUTPU... |
thing = "hello from testns.othercoll.formerly_testcoll_pkg.thing" |
import unittest
from django.core import validators
from django.core.exceptions import ValidationError
from django.db import IntegrityError, connection, models
from django.test import SimpleTestCase, TestCase
from .models import (
BigIntegerModel, IntegerModel, PositiveIntegerModel,
PositiveSmallIntegerModel, Sm... |
import wx
class Panel(wx.Panel):
def __init__(self, parent, orient=wx.VERTICAL):
wx.Panel.__init__(self, parent)
self._box = wx.BoxSizer(orient)
self._grid = wx.GridBagSizer(5, 5)
self.Add(self._grid)
self.SetSizer(self._box)
def GetWin(self): return self
def Add(self, win):
"""
Add a window to the wx ... |
try:
import machine
except ImportError:
print("SKIP")
import sys
sys.exit()
print(machine.mem8)
try:
machine.mem16[1]
except ValueError:
print("ValueError")
try:
machine.mem16[1] = 1
except ValueError:
print("ValueError")
try:
del machine.mem8[0]
except TypeError:
print("TypeErro... |
from __future__ import unicode_literals
import frappe
def execute():
doctypes = frappe.db.sql(""" select name, autoname from `tabDocType`
where autoname like 'field:%' and allow_rename = 1""", as_dict=1)
for doctype in doctypes:
fieldname = doctype.autoname.split(":")[1]
if fieldname:
frappe.db.sql(""" updat... |
import sys
from zope.interface.advice import addClassAdvisor
from zope.interface.advice import getFrameInfo
my_globals = globals()
def ping(log, value):
def pong(klass):
log.append((value,klass))
return [klass]
addClassAdvisor(pong)
try:
from types import ClassType
class ClassicClass:
... |
try:
from mock import patch
except ImportError:
from unittest.mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
from allauth.utils import get_user_model
SOCIALACCOUNT_PROVIDERS = {'persona':
... |
from __future__ import unicode_literals
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'd F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'd F'
SHORT_DATE_FORMAT = 'd M Y'
SHORT_DATETIME_FORMAT = 'd M Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Pazartesi
DATE_INPUT_FORMATS = (
'%d/%m/%Y', '%d/%m/%y', ... |
import sys
__version__ = '0.1.9'
if sys.version_info[:2] < (2, 4):
raise RuntimeError('PyASN1 requires Python 2.4 or later') |
print(id(1) == id(2))
print(id(None) == id(None))
l = [1, 2]
print(id(l) == id(l))
f = lambda:None
print(id(f) == id(f)) |
from django.conf.urls import patterns, url, include
urlpatterns = patterns('zilencer.views',
url('^feedback$', 'rest_dispatch',
{'POST': 'submit_feedback'}),
url('^report_error$', 'rest_dispatch',
{'POST': 'report_error'}),
url('^endpoints$', 'lookup_endpoints_for_user'),
) |
"""Presubmit script for perf_expectations.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into gcl.
"""
PERF_EXPECTATIONS = 'tools/perf_expectations/perf_expectations.json'
CONFIG_FILE = 'tools/perf_expectations/chromium_perf_expectations.cfg'
def Chec... |
import markdown
class State(list):
""" Track the current and nested state of the parser.
This utility class is used to track the state of the BlockParser and
support multiple levels if nesting. It's just a simple API wrapped around
a list. Each time a state is set, that state is appended to the end of t... |
"""This is a simple HTTP server for manually testing exponential
back-off functionality in Chrome.
"""
import BaseHTTPServer
import sys
import urlparse
AJAX_TEST_PAGE = '''
<html>
<head>
<script>
function reportResult(txt) {
var element = document.createElement('p');
element.innerHTML = txt;
document.body.appendC... |
import re
import os
import sys
from setuptools import setup
name = 'pharmassist-drf'
package = 'pharmassist'
description = 'My fourth year project that aims to build a system that will connect patients to pharmacies near them and give them information on recommended price of the drug and check authenticity of the drug ... |
import pymongo
import pprint
import os
import accordion.adapter.dropbox as dropbox_adapter
conn = pymongo.Connection(os.environ['ACCORDION_MONGO_URI'])
db = conn.test
class FileNotFoundException(Exception): pass
def read(path):
f = _get_file(path)
if f == None:
raise FileNotFoundException()
else:
adapter ... |
"""Test map files generation."""
import os
from django.conf import settings
from django.core.management import call_command
from django.test import TestCase
from modoboa.core.utils import parse_map_file
from modoboa.lib.test_utils import MapFilesTestCaseMixin
class MapFilesTestCase(MapFilesTestCaseMixin, TestCase):
... |
import os
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QMainWindow, QWorkspace, QAction, QFileDialog, QApplication
from pivy.coin import SoInput, SoDB
from pivy.quarter import QuarterWidget
class MdiQuarterWidget(QuarterWidget):
def __init__(self, parent, sharewidget):
QuarterWidget.__... |
'''
____ __ __ ___ ____ ____ ____
( _ \( ) /__\ / __)(_ _)( ___)( _ \
)___/ )(__ /(__)\ \__ \ )( )__) ) /
(__) (____)(__)(__)(___/ (__) (____)(_)\_)
Plaster is an adaptable command-line paste-bin client.
'''
import argparse
import configparser
from sys import stdin
from os import path, isa... |
import unittest
from ..points import NamedPosition, StraightSegment, Position, NP
class NamedPositionTests(unittest.TestCase):
def test_simple(self):
namedpos = NamedPosition(Position(3, 42), ["testname"])
self.assertEqual(namedpos.x, 3)
self.assertEqual(namedpos.y, 42)
self.assertEq... |
from django.contrib import admin
from froide.helper.admin_utils import ForeignKeyFilter
from .models import FoiRequestFollower
class FoiRequestFollowerAdmin(admin.ModelAdmin):
raw_id_fields = (
"user",
"request",
)
date_hierarchy = "timestamp"
list_display = ("user", "email", "request", ... |
import os, sys
sys.path.append(os.getcwd())
from main import db
if __name__ == '__main__':
db.create_all() |
import telepot
from config import TOKEN, CHAT_ID
def dispatch_to_telegram_chat(msg_list):
bot = telepot.Bot(TOKEN)
bot.sendMessage(CHAT_ID, "Hello Here What I found Today")
for msg in msg_list:
bot.sendMessage(CHAT_ID, msg)
bot.sendMessage(CHAT_ID, "See you") |
import time
from IPython.core.display import display
from .model import *
from .view import *
class Tracer(list):
def __init__(self, *arg, **kwargs):
super(Tracer, self).__init__(*arg, **kwargs)
self.delay = 0.25
self.tracer = TracerView(self)
self._observers = []
def __add__(sel... |
"""Unit tests for go.py
To run these: run 'tox' in the root project directory.
"""
import pytest
import cherrypy
from cherrypy.test import helper
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../")
import go
class BasicGoTest(helper.CPWebCase):
"""Test the web service itself."... |
"""
Locator handler module
"""
from coyote_framework.webdriver.webdriverwrapper.support import locator as loc
__author__ = 'justin'
from collections import namedtuple
class LocatorHandler():
"""
Class to handle locators
"""
@staticmethod
def parse_locator(locator):
"""
Parses a valid... |
"""
.. class:: Colorer
Objects passed as the ``colorer`` argument of :class:`.TurksHead` must implement this interface.
More precisely, they must implement **one** of the following methods:
.. py:method:: compute_color_hsv(knot, k, theta, altitude):
Return a tuple ``(h, s, v)`` of the color to be ap... |
from __future__ import print_function
import os
import json
from drive import download_file
import csv
import argparse
import logging
import utils
import time
CONFIG_FILE = os.path.join(os.path.dirname(__file__), "wunderous.config.json")
OUT_DIR = os.path.join(os.path.dirname(__file__), "out")
HABBIT_HEADER = ['Name', ... |
"""add column keep_forever session
Revision ID: 250c6848576f
Revises: 4f80a6b3ffc2
Create Date: 2017-08-28 15:25:20.101394
"""
from alembic import op
import sqlalchemy as sa
revision = '250c6848576f'
down_revision = '4f80a6b3ffc2'
def upgrade():
op.add_column('sessions', sa.Column('keep_forever', sa.Boolean(), null... |
from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import Async... |
FILE_DESTINATION = '.' |
from lettuce import *
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from code import application
from nose.tools import assert_equals
import os
@before.all
def before_all():
world.app = application.app.test_client()
is_travis = 'TRAVIS' in os.environ
if is_travis:
br... |
from django.contrib import admin
from .models import Adherents
admin.site.register(Adherents) |
import django.dispatch
netflix_account_authorized = django.dispatch.Signal()
netflix_account_deauthorized = django.dispatch.Signal() |
from setuptools import setup, find_packages
setup(
name='tc_video',
version='0.1.0',
url='http://github.com/thumbor_community/video',
license='MIT',
author='Thumbor Community',
description='Thumbor community video extensions',
packages=find_packages(),
include_package_data=True,
zip_... |
"""Test the listdescriptors RPC."""
from test_framework.descriptors import (
descsum_create
)
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class ListDescriptorsTest(SyscoinTestFramework):
def set_test_params(sel... |
BOT_NAME = 'myspiders'
SPIDER_MODULES = ['myspiders.spiders']
NEWSPIDER_MODULE = 'myspiders.spiders'
FEED_EXPORT_ENCODING = 'UTF-8'
ROBOTSTXT_OBEY = True
AWS_ACCESS_KEY_ID = 'AKIAJVJVBM4WNP2VF2GQ'
AWS_SECRET_ACCESS_KEY = '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' |
from django.contrib import messages
from django.contrib.auth import login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.template.context_processors import csrf
from django.core.urlresolve... |
from azure.cli.core.commands import CliCommandType
def load_command_table(self, _):
from ..generated._client_factory import cf_bandwidth_schedule
databoxedge_bandwidth_schedule = CliCommandType(
operations_tmpl='azure.mgmt.databoxedge.operations._bandwidth_schedules_operations#BandwidthSchedulesOperatio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.