code stringlengths 1 199k |
|---|
def read(filename):
dic=[]
with open(filename,'r') as fp:
while True:
lines = fp.readlines(10000)
if not lines :
break
for line in lines:
#line = line.strip('\n')
dic.append(line)
return dic
def Write(file,dic):
... |
from collections import deque
from proboscis import test
from proboscis import asserts
from proboscis import after_class
from proboscis import before_class
from trove.tests.config import CONFIG
from trove.tests.api.instances import instance_info
from trove.tests.api.instances import VOLUME_SUPPORT
from trove.tests.util... |
testRecipe1 = """\
class TestRecipe1(PackageRecipe):
name = 'testcase'
version = '1.0'
clearBuildReqs()
owner = 'root'
group = 'root'
withBinary = True
withUse = False
changedconfig = '%(sysconfdir)s/changedconfig'
unchangedconfig = '%(sysconfdir)s/unchangedconfig'
changed = '%(d... |
import tensorflow as tf
from tensorforce import TensorforceError
from tensorforce.core import TensorDict, TensorSpec, TensorsSpec, tf_function, tf_util
from tensorforce.core.optimizers import UpdateModifier
from tensorforce.core.optimizers.solvers import solver_modules
class LinesearchStep(UpdateModifier):
"""
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hackerspace', '0009_verbal_subcategory'),
]
operations = [
migrations.RemoveField(
model_name='programmingquestion',
name='op1',
... |
from .base import Base
from .helper import select_item_by_user
from .actions import Actions
from .browser import Browser
__all__ = ['select_item_by_user', 'Base', 'Actions', 'Browser'] |
from __future__ import division
import os
import sys
import time
import csv
import shutil
import threading
import errno
import tempfile
import collections
import re
from distutils.version import LooseVersion
try:
import pandas as pd
except ImportError:
pd = None
from wlauto import Instrument, Parameter, Iterati... |
_base_ = './cascade_mask_rcnn_r50_fpn_mstrain_3x_coco.py'
model = dict(
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=8,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=False),
s... |
__author__ = 'maxim'
import os
from models import *
from util import *
class ModelInfo(object):
def __init__(self, path, model_class, model_params, run_params):
self.path = path
self.model_class = model_class
self.model_params = model_params
self.run_params = run_params
def is_available(self):
r... |
'''
Created on Apr 30, 2012
@author: h87966
'''
from unit5.blog_datastore_memory import BlogMemoryDataStore
from unit5.blog_datastore_appengine import BlogAppengineDataStore
class BlogDataStoreFactory():
'''
classdocs
'''
storage_implementations = {'memory':BlogMemoryDataStore(),
... |
"""ACME protocol messages."""
import collections
import six
from acme import challenges
from acme import errors
from acme import fields
from acme import jose
from acme import util
OLD_ERROR_PREFIX = "urn:acme:error:"
ERROR_PREFIX = "urn:ietf:params:acme:error:"
ERROR_CODES = {
'badCSR': 'The CSR is unacceptable (e.... |
from django.conf.urls import patterns
from django.conf.urls import url
from a10_horizon.dashboard.a10networks.a10appliances import views
urlpatterns = patterns(
'a10_horizon.dashboard.a10networks.a10appliances.views',
url(r'^$', views.IndexView.as_view(), name='index')
# url(r'^deleteappliance$', views.Dele... |
import os
import random
import time
import json
from locust import HttpLocust, TaskSet, task
from lib.baseTaskSet import baseTaskSet
from lib.openstack.keystone import get_auth_token
from lib.openstack.nova import list_servers
from lib.openstack.nova import list_servers_detail
from lib.openstack.nova import list_server... |
"""Base class for IKEA TRADFRI."""
from __future__ import annotations
from collections.abc import Callable
from functools import wraps
import logging
from typing import Any
from pytradfri.command import Command
from pytradfri.device import Device
from pytradfri.device.air_purifier import AirPurifier
from pytradfri.devi... |
import urllib
import twython
def Crowd_twitter(query):
consumer_key = '*****';
consumer_secret = '*****';
access_token = '******';
access_token_secret = '******';
client_args = {'proxies': {'https': 'http://10.93.0.37:3333'}}
t = twython.Twython(app_key=consumer_key,
app_secret=consu... |
"""
Copyright 2013 Shine Wang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... |
"""Top-level presubmit script for V8.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into gcl.
"""
import sys
def _V8PresubmitChecks(input_api, output_api):
"""Runs the V8 presubmit checks."""
import sys
sys.path.append(input_api.os_path.... |
"""Converts the serialized examples to TFRecords for putting into a model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import json
import os
import random
from absl import app
from absl import flags
import apache_beam as beam
from la... |
from polyaxon import settings
from polyaxon.proxies.schemas.base import clean_config
from polyaxon.proxies.schemas.buffering import get_buffering_config
from polyaxon.proxies.schemas.charset import get_charset_config
from polyaxon.proxies.schemas.error_page import get_error_page_config
from polyaxon.proxies.schemas.gzi... |
import collections
import copy
import netaddr
from neutron_lib import exceptions
from oslo_log import log as logging
from oslo_policy import policy as oslo_policy
from oslo_utils import excutils
import six
import webob.exc
from neutron._i18n import _, _LE, _LI
from neutron.api import api_common
from neutron.api.v2 impo... |
import logging
import os
import json
import shutil
import sys
import datetime
import csv, math
from tld import get_tld
from collections import OrderedDict
from utils import Util
from components.data.data import Data
from components.iana.iana_transform import IanaTransform
from components.nc.network_context import Netwo... |
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
from app import db
import os.path
db.create_all()
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO):
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository')
api.version_control(SQLALCHEMY_DATABASE_... |
from google.cloud import pubsublite_v1
async def sample_compute_time_cursor():
# Create a client
client = pubsublite_v1.TopicStatsServiceAsyncClient()
# Initialize request argument(s)
request = pubsublite_v1.ComputeTimeCursorRequest(
topic="topic_value",
partition=986,
)
# Make t... |
import unittest
from biothings_explorer.registry import Registry
from biothings_explorer.user_query_dispatcher import SingleEdgeQueryDispatcher
from .utils import get_apis
reg = Registry()
class TestSingleHopQuery(unittest.TestCase):
def test_disease2protein(self):
"""Test gene-protein"""
seqd = Sin... |
"""iWorkflow® Device Groups (shared) module for CM Cloud Managed Devices
REST URI
``http://localhost/mgmt/shared/resolver/device-groups/cm-cloud-managed-devices``
"""
from f5.iworkflow.resource import Collection
from f5.iworkflow.resource import OrganizingCollection
from f5.iworkflow.resource import Resource
class ... |
'''
Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
'''
from netmiko import ConnectHandler
from getpass import getpass
from routers import pynet_rtr1, pynet_rtr2, pynet_jnpr_srx1
def main():
'''
Use Netmiko to execute 'show arp' on pynet-rtr1, pynet-rtr2, and juniper-srx.
'''
... |
""" From a list of folders, export msd documents from existing mxds, ArcGIS 10
"""
import os
from glob import glob
from arcpy import mapping
from symbologyFromArcMapDoc import MxdExtras
folders = [r'F:\Projects\NationalAtlas\ArcGIS_Server\Server', r'F:\Projects\NationalAtlas\ArcGIS_Server\Server\biodiversity']
searchPa... |
"""
gspread
~~~~~~~
Google Spreadsheets client library.
"""
__version__ = '0.2.1'
__author__ = 'Anton Burnashev'
from .client import Client, login
from .models import Spreadsheet, Worksheet, Cell
from .exceptions import (GSpreadException, AuthenticationError,
SpreadsheetNotFound, NoValidUrlKeyF... |
"""
:mod:`nova` -- Cloud IaaS Platform
===================================
.. automodule:: nova
:platform: Unix
:synopsis: Infrastructure-as-a-Service Cloud platform.
.. moduleauthor:: Jesse Andrews <jesse@ansolabs.com>
.. moduleauthor:: Devin Carlen <devin.carlen@gmail.com>
.. moduleauthor:: Vishvananda Ishaya <... |
import pytest |
from steps.bdd_test_util import cli_call
def after_scenario(context, scenario):
if 'doNotDecompose' in scenario.tags:
print("Not going to decompose after scenario {0}, with yaml '{1}'".format(scenario.name, context.compose_yaml))
else:
if 'compose_yaml' in context:
print("Decomposing with yaml '{0}' after scen... |
import functools
import urllib
from tornado.web import HTTPError
from tornado.options import options
from poweredsites.libs import cache # cache decorator alias
def admin(method):
"""Decorate with this method to restrict to site admins."""
@functools.wraps(method)
def wrapper(self, *args, **kwargs):
... |
"""
Problem Statement
Samantha and Sam are playing a game. They have 'N' balls in front of them, each ball numbered from 0 to 9, except the
first ball which is numbered from 1 to 9. Samantha calculates all the sub-strings of the number thus formed, one by one.
If the sub-string is S, Sam has to throw 'S' candies into a... |
from functools import update_wrapper
from django.http import Http404, HttpResponseRedirect
from django.contrib.admin import ModelAdmin, actions
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth import logout as auth_logout, REDIRECT_FIELD_NAME
from django.contrib.contenttypes impor... |
from __future__ import absolute_import
import fixtures
import jsonschema
import os
import requests
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.... |
import json
import logging
import os
import re
import time
from datetime import datetime
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.utils.functional import wraps
from django.utils.translation import ugettext as _
from django.core.urlresolvers import reverse
from d... |
from __future__ import unicode_literals
import c3nav.mapdata.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Announcement',
fields=[
('id'... |
from collections import OrderedDict
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from google.api_core import client_options as client_options_lib
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials... |
from __future__ import absolute_import, division, print_function, \
with_statement
import sys
import os
import socket
import struct
import re
import logging
from shadowsocks import common, lru_cache, eventloop, shell
CACHE_SWEEP_INTERVAL = 30
VALID_HOSTNAME = re.compile(br"(?!-)[_A-Z\d-]{1,63}(?<!-)$", re.IGNORECAS... |
if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
n = int(input())
L = [[a,b,c] for a in range(x+1) for b in range(y+1) for c in range(z+1)]
L = list(filter(lambda x : sum(x) != n, L))
print(L) |
from django import forms
from captcha.fields import CaptchaField
class CaptchaTestForm(forms.Form):
myfield = AnyOtherField()
captcha = CaptchaField()
def some_view(request):
if request.POST:
form = CaptchaTestForm(request.POST)
# Validate the form: the captcha field will automatically
... |
import pickle
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import ImageGrid
import numpy as np
import tensorflow as tf
from tensorflow.contrib.layers import flatten
from sklearn.utils import shuffle
class Data:
def __init__(self):
training_file = 'data/train.p'
validation_file= 'data... |
DOCUMENTATION = '''
---
module: softlayer_vs_ip
short_description: Retrieves instance ip addresses from Softlayer
description:
- Retrieves instance ip addresses of all adapters from Softlayer
- the result is stored in the "result" dict entry of he registered variable
requirements:
- Requires SoftLayer pytho... |
"""Bitcoin information service that uses blockchain.info."""
from datetime import timedelta
import logging
from blockchain import exchangerates, statistics
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_CURRENCY, CONF_DISPLAY_O... |
from six import iteritems, iterkeys
import pandas as pd
from . utils.protocol_utils import Enum
from zipline.finance.trading import with_environment
from zipline.utils.algo_instance import get_algo_instance
DATASOURCE_TYPE = Enum(
'AS_TRADED_EQUITY',
'MERGER',
'SPLIT',
'DIVIDEND',
'TRADE',
'TRAN... |
"""
COHORTE configuration file parser: converts a parsed configuration file to
beans
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
... |
import six
from opencensus.common import utils
def _format_attribute_value(value):
if isinstance(value, bool):
value_type = 'bool_value'
elif isinstance(value, int):
value_type = 'int_value'
elif isinstance(value, six.string_types):
value_type = 'string_value'
value = utils.g... |
import argparse
import pydot
import os
__author__ = 'Shamal Faily'
def dotToObstacleModel(graph,contextName,originatorName):
goals = []
goalNames = set([])
obstacles = []
acs = {}
for node in graph.get_nodes():
nodeShape = node.get_shape()
nodeStyle = str(node.get_style())
if nodeShape == 'box' an... |
"""BIG-IP® Network tunnels module.
REST URI
``http://localhost/mgmt/tm/net/tunnels``
GUI Path
``Network --> tunnels``
REST Kind
``tm:net:tunnels:*``
"""
from f5.bigip.resource import Collection
from f5.bigip.resource import OrganizingCollection
from f5.bigip.resource import Resource
class TunnelS(Organizing... |
'''
Extract reads which aren't mapped from a SAM or SAM.gz file.
Behavior for PE:
-Write out PE only if both do not map (if either of the pair maps, neither is retained)
Behavior for SE:
-Write out SE if they don't map
Iterate over a SAM or SAM.gz file. take everything where the 3rd and
4th flag bit are set to 1 an... |
from ionotomo import *
import numpy as np
import pylab as plt
def test_turbulent_realisation(plot=True):
xvec = np.linspace(-100,100,100)
zvec = np.linspace(0,1000,1000)
M = np.zeros([100,100,1000])
TCI = TriCubic(xvec,xvec,zvec,M)
print("Matern 1/2 kernel")
cov_obj = Covariance(tci=TCI)
sig... |
from tempest.test import attr
from tempest_lib import exceptions
from murano_tempest_tests.tests.api.application_catalog import base
from murano_tempest_tests import utils
class TestEnvironmentsNegative(base.BaseApplicationCatalogTest):
@attr(type='negative')
def test_delete_environment_with_wrong_env_id(self):... |
from ..images.get import get_image
from ..images.list import list_images
def test_list_images():
images = list_images("debian-cloud")
for img in images:
assert img.kind == "compute#image"
assert img.self_link.startswith(
"https://www.googleapis.com/compute/v1/projects/debian-cloud/gl... |
from functools import wraps
from itertools import chain
from django.db.models import Prefetch, Q
from django.urls import Resolver404, resolve
from django.utils.functional import cached_property
from django.utils.translation import ugettext_lazy as _
from rest_framework.authentication import SessionAuthentication
from r... |
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine.resources.openstack.neutron import neutron
from heat.engine import support
class QoSPolicy(neutron.NeutronResource):
"""A resource for Neutron QoS Policy.
Thi... |
import ssl
import remi.gui as gui
from remi import start, App
class Camera(App):
def __init__(self, *args, **kwargs):
super(Camera, self).__init__(*args)
def video_widgets(self):
width = '300'
height = '300'
self.video = gui.Widget(_type='video')
self.video.style['overflo... |
import asyncio
import json
import os
from discord.ext import commands
from cogs.utils import checks
from cogs.utils.dataIO import fileIO
ban_message = "``Omae wa mou shindeiru.``"
joinleave_path = 'data/sentry/joinleave.json'
bans_path = 'data/sentry/bans.json'
def is_int(s):
"""Checks whether the input is an integ... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
import unittest, time, ... |
"""
Augmenting Directory Service
"""
__all__ = [
"AugmentedDirectoryService",
]
import time
from zope.interface import implementer
from twisted.internet.defer import inlineCallbacks, returnValue, succeed
from twistedcaldav.directory.augment import AugmentRecord
from twext.python.log import Logger
from twext.who.dir... |
import sys
from common import find_target_items
if len(sys.argv) != 3:
print("Find the value keyword in all pairs")
print(("Usage: ", sys.argv[0], "[input] [keyword]"))
exit(1)
find_target_items(sys.argv[1], sys.argv[2]) |
def makeYqlQuery(req):
result = req.get("result")
parameters = result.get("parameters")
city = parameters.get("geo-city")
if city is None:
return None
return "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='" + city + "') and u='c'" |
from __future__ import unicode_literals
import datetime
import django
from django.utils.timezone import now
from django.test import TransactionTestCase
from mock import call, patch
from job.seed.metadata import SeedMetadata
from source.configuration.source_data_file import SourceDataFileParseSaver
from storage.models i... |
from tempest.api.image import base
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
class BasicOperationsImagesAdminTest(base.BaseV2ImageAdminTest):
@decorators.related_bug('1420008')
@decorators.idempotent_id('646a6eaa-135f-4493-a0af-12583021224e')
def test_create_image_ow... |
import tensorflow as tf
from tensorflow.contrib import layers
from tensorflow.contrib.framework import arg_scope
from tensormate.graph import TfGgraphBuilder
class ImageGraphBuilder(TfGgraphBuilder):
def __init__(self, scope=None, device=None, plain=False, data_format="NHWC",
data_format_ops=(layer... |
__author__ = 'sianwahl'
from string import Template
class NedGenerator:
def __init__(self, number_of_channels):
self.number_of_channels = number_of_channels
def generate(self):
return self._generate_tuplefeeder_ned(), self._generate_m2etis_ned()
def _generate_tuplefeeder_ned(self):
t... |
"""Resources for mapping between user emails and host usernames/owners."""
from upvote.gae import settings
def UsernameToEmail(username):
if '@' in username:
return username
return '@'.join((username, settings.USER_EMAIL_DOMAIN))
def EmailToUsername(email):
return email.partition('@')[0] |
"""Class to hold all camera accessories."""
import asyncio
from datetime import timedelta
import logging
from haffmpeg.core import HAFFmpeg
from pyhap.camera import (
VIDEO_CODEC_PARAM_LEVEL_TYPES,
VIDEO_CODEC_PARAM_PROFILE_ID_TYPES,
Camera as PyhapCamera,
)
from pyhap.const import CATEGORY_CAMERA
from home... |
from ConfigParser import ConfigParser
ConfigFile = r'config.ini' # 读取配置文件
config = ConfigParser()
config.read(ConfigFile)
de_infos = config.items(r'deploy_server') # 远程部署服务器信息
redeploy_server_info = {}
appinfo = {}
print de_infos
for (key, value) in de_infos:
redeploy_server_info[key] = value
print redeploy_serve... |
__author__="Scott Hendrickson"
__license__="Simplified BSD"
import sys
import datetime
import fileinput
from io import StringIO
try:
import ujson as json
except ImportError:
try:
import json
except ImportError:
import simplejson as json
gnipError = "GNIPERROR"
gnipRemove = "GNIPREMOVE"
gnipD... |
from django.conf.urls import include, url
from django.views.generic.base import RedirectView
from cms.models import *
from cms.views import show
urlpatterns = [
url(r'^$', show,{'slug':"/%s"%settings.HOME_SLUG}, name='cms.home'), # contenido definido en home slug
url(r'^%s/$'%settings.HOME_SLUG, Redire... |
import platform
import pytest
import math
import numpy as np
import dartpy as dart
def test_solve_for_free_joint():
'''
Very simple test of InverseKinematics module, applied to a FreeJoint to
ensure that the target is reachable
'''
skel = dart.dynamics.Skeleton()
[joint0, body0] = skel.createFre... |
'''
Project: Farnsworth
Author: Karandeep Singh Nagra
'''
from django.contrib.auth.models import User, Group, Permission
from django.core.urlresolvers import reverse
from django.db import models
from base.models import UserProfile
class Thread(models.Model):
'''
The Thread model. Used to group messages.
''... |
from __future__ import unicode_literals
class MorfessorException(Exception):
"""Base class for exceptions in this module."""
pass
class ArgumentException(Exception):
"""Exception in command line argument parsing."""
pass
class InvalidCategoryError(MorfessorException):
"""Attempt to load data using a... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Feed.title'
db.alter_column('feedmanager_feed', 'title', self.gf('django.db.models.fields.TextField')())
def back... |
import os
import random
import string
from django.utils import functional
from django.utils.http import urlencode
def rand_string(numOfChars):
"""
Generates a string of lowercase letters and numbers.
That makes 36^10 = 3 x 10^15 possibilities.
If we generate filenames randomly, it's harder for people to... |
import django
from django.db import router
from django.db.models import signals
try:
from django.db.models.fields.related import ReverseManyRelatedObjectsDescriptor
except ImportError:
from django.db.models.fields.related import ManyToManyDescriptor as ReverseManyRelatedObjectsDescriptor
from ..utils import cached... |
from setuptools import find_packages, setup
from auspost_pac import __version__ as version
setup(
name='python-auspost-pac',
version=version,
license='BSD',
author='Sam Kingston',
author_email='sam@sjkwi.com.au',
description='Python API for Australia Post\'s Postage Assessment Calculator (pac).'... |
import io
import sys
import mock
import argparse
from monolith.compat import unittest
from monolith.cli.base import arg
from monolith.cli.base import ExecutionManager
from monolith.cli.base import SimpleExecutionManager
from monolith.cli.base import BaseCommand
from monolith.cli.base import CommandError
from monolith.c... |
import numpy as np
from .tod import TOD
from .noise import Noise
from ..op import Operator
from .. import timing as timing
class AnalyticNoise(Noise):
"""
Class representing an analytic noise model.
This generates an analytic PSD for a set of detectors, given
input values for the knee frequency, NET, ex... |
from JumpScale import j
import JumpScale.baselib.watchdog.manager
import JumpScale.baselib.redis
import JumpScale.lib.rogerthat
descr = """
critical alert
"""
organization = "jumpscale"
enable = True
REDIS_PORT = 9999
redis_client = j.clients.credis.getRedisClient('127.0.0.1', REDIS_PORT)
def escalateL1(watchdogevent):... |
import tornado.web
import json
from tornado_cors import CorsMixin
from common import ParameterFormat, EnumEncoder
class DefaultRequestHandler(CorsMixin, tornado.web.RequestHandler):
CORS_ORIGIN = '*'
def initialize(self):
self.default_format = self.get_argument("format", "json", True)
self.show_... |
from ._stub import *
from ._fluent import *
from ._matchers import * |
from steamstoreprice.exception import UrlNotSteam, PageNotFound, RequestGenericError
from bs4 import BeautifulSoup
import requests
class SteamStorePrice:
def normalizeurl(self, url):
"""
clean the url from referal and other stuff
:param url(string): amazon url
:return: string(url cle... |
import common.config
import common.messaging as messaging
import common.storage
import common.debug as debug
from common.geo import Line, LineSet
from common.concurrency import ConcurrentObject
from threading import Lock, RLock
import tree.pachinko.message_type as message_type
import tree.pachinko.config as config
impo... |
from django.test import override_settings
from incuna_test_utils.testcases.api_request import (
BaseAPIExampleTestCase, BaseAPIRequestTestCase,
)
from tests.factories import UserFactory
class APIRequestTestCase(BaseAPIRequestTestCase):
user_factory = UserFactory
def test_create_request_format(self):
... |
from django.forms import ModelForm
from bug_reporting.models import Feedback
from CoralNet.forms import FormHelper
class FeedbackForm(ModelForm):
class Meta:
model = Feedback
fields = ('type', 'comment') # Other fields are auto-set
#error_css_class = ...
#required_css_class = ...
def ... |
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
from streamlink.utils.parse import parse_json
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r"https?://(?:www\.)?livestream\.com/"
))
class L... |
import time
import threading
import PyTango
import numpy
import h5py
THREAD_DELAY_SEC = 0.1
class HDFwriterThread(threading.Thread):
def __init__(self, parent_obj, filename_in, trg_start, trg_stop):
threading.Thread.__init__(self)
self._alive = True
self.myState = PyTango.DevState.OFF
self.filename = fil... |
from rknfilter.targets import BaseTarget
from rknfilter.db import Resource, Decision, CommitEvery
from rknfilter.core import DumpFilesParser
class StoreTarget(BaseTarget):
def __init__(self, *args, **kwargs):
super(StoreTarget, self).__init__(*args, **kwargs)
self._dump_files_parser = DumpFilesParse... |
from quex.engine.generator.languages.address import Address
from quex.blackboard import E_EngineTypes, E_AcceptanceIDs, E_StateIndices, \
E_TransitionN, E_PostContextIDs, E_PreContextIDs, \
... |
from setuptools import setup, find_packages
from setuptools.command.install import install as stdinstall
import codecs
import os
import re
import sys
def find_version(*file_paths):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *file_paths), 'r', 'latin1') as f:
... |
import re, csv
header_end = re.compile("\s+START\s+END\s+")
five_data_re = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(\d\d\/\d\d\/\d\d\d\d)\s*(.+?)\s+([\d\.\-\,]+)\s*\Z")
five_data_missing_date = re.compile("\s*([\w\d]+)\s+(\d\d\/\d\d\/\d\d\d\d)\s+(.*?)\s{10,}(.*?)\s+([\d\.\-\... |
from django.views.generic import ListView
from models import Project
class ListProjectView(ListView):
model = Project
template_name = 'cmsplugin_vfoss_project/project_list.html' |
""" Common utility
"""
import logging
import time
def measure(func, *args, **kwargs):
def start(*args, **kwargs):
begin = time.time()
result = func(*args, **kwargs)
end = time.time()
arg = args
while not (isinstance(arg, str) or isinstance(arg, int) or isinstance(arg, float))... |
from __future__ import (absolute_import, print_function, division)
class NotImplementedException(Exception):
pass |
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from model_utils import Choices
from model_utils.models import TimeStampedModel
from crate.web.packages.mo... |
from south.utils import datetime_utils as 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 'TtTrip.shape'
db.add_column(u'timetable_tttrip', 'shape',
self... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0005_queue_name'),
]
operations = [
migrations.AlterField(
model_name='media',
name='medi... |
def display_summary():
print("{:<13}{}".format( 'rm', "Removes a previously copied SCM Repository" ))
USAGE="""
Removes a previously 'copied' repository
===============================================================================
usage: evie [common-opts] rm [options] <dst> <repo> <origin> <id>
evie [comm... |
"""
DU task for ABP Table: doing jointly row BIESO and horizontal cuts
block2line edges do not cross another block.
The cut are based on baselines of text blocks.
- the labels of horizontal cuts are SIO (instead of SO in previous version)
Copyright Naver Labs Europe(C) 2018 JL Meunier
Developed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.