text
stringlengths
4
1.02M
meta
dict
import sys; sys.path.append('..') # help python find open_bci_v3.py relative to scripts folder import open_bci_v3 as bci import os import logging import time def printData(sample): #os.system('clear') print "----------------" print("%f" %(sample.id)) print sample.channel_data print sample.aux_data print "-------...
{ "content_hash": "1ed55c075bab2a04eb0aca78965b7b7c", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 112, "avg_line_length": 28.75, "alnum_prop": 0.6596273291925466, "repo_name": "jfrey-xx/OpenBCI_Python", "id": "230a2ff690408f09c15beda497f405421311a847", "size": "805", ...
import os import signal import subprocess import logging import string import traceback import errno import itertools import shlex from collections import OrderedDict # Ordered JSON, , read & write json, internal from yotta.lib import ordered_json # Pack, , common parts of Components/Targets, internal from yotta.lib i...
{ "content_hash": "333f3c95a5bc06245189d65499a537cb", "timestamp": "", "source": "github", "line_count": 831, "max_line_length": 138, "avg_line_length": 40.25150421179302, "alnum_prop": 0.5523632993512512, "repo_name": "ARMmbed/yotta", "id": "7a6b8249803ef8048126d466d0a3ca7ea65cb7be", "size": "33599...
from typing import Any, Dict, Optional from django.db.models import Q from django.utils.timezone import now as timezone_now from zerver.models import UserStatus def get_user_info_dict(realm_id: int) -> Dict[int, Dict[str, Any]]: rows = UserStatus.objects.filter( user_profile__realm_id=realm_id, ...
{ "content_hash": "61d945b458113e8b1bb322d4d881a1af", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 67, "avg_line_length": 25.135593220338983, "alnum_prop": 0.5697909642616318, "repo_name": "synicalsyntax/zulip", "id": "da4aa90f39f5b958434d98d3b21e776de13c87d9", "size": "...
from pymongo import MongoClient class Mongo(): def __init__(self): self.client = MongoClient() self.db = self.client.test def populate(self): self.db.things.remove() things = [ {"name": "Vishnu"}, {"name": "Lakshmi"}, {"name": "Ganesha"}, ...
{ "content_hash": "ef6bde80adf66a4aece3f5b5d32e18f1", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 37, "avg_line_length": 21.703703703703702, "alnum_prop": 0.4948805460750853, "repo_name": "Varsha-Arun/sample_python_mongodb", "id": "86f4cdab69d458d82a2df164cf5e99b954c139e5...
VAGRANT_IP = '192.168.66.77' EC2_IP = '54.179.183.245' # Simple Tasks def hello(): print 'Hello ThaiPy!' def hi(name='Kan'): print 'Hi ' + name # Local Commands from fabric.api import local, lcd def deploy_fizzbuzz(): with lcd('fizzbuzz'): local('python fizzbuzz_test.py') local('gi...
{ "content_hash": "4eacc892a560a96a8426d690e2587e67", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 72, "avg_line_length": 17.586666666666666, "alnum_prop": 0.6050037907505686, "repo_name": "zkan/fabric-workshop", "id": "5998b07176575ddc8b34361d9543a78bf7c488b0", "size": ...
''' Created on 2015-11-18 @author: dell ''' import sys import ConfigParser reload(sys) sys.setdefaultencoding("utf8") import matlab.engine import jieba jieba.initialize() from TimeRecognition import * regexFilePath = '/home/shin/DeepLearning/MemoryNetwork/QA/Interface/date.regex' TimeR = TimeRecognition(regexFil...
{ "content_hash": "73d276cf11707250e0a27956c71c4b60", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 133, "avg_line_length": 31.876923076923077, "alnum_prop": 0.6121299871299871, "repo_name": "shincling/MemNN_and_Varieties", "id": "e502866c9cbf6107ce5fccb64453579ed4a4f1f7",...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "aa2c8d23b58938ec260c92f876f46f5d", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 484, "avg_line_length": 36.78225806451613, "alnum_prop": 0.7261565446174084, "repo_name": "benfinke/ns_python", "id": "0f58240453e9875af723d5ca9608157ff272333c", "size": "...
import unittest2 class TestIterator(unittest2.TestCase): def _getTargetClass(self): from gcloud.iterator import Iterator return Iterator def _makeOne(self, *args, **kw): return self._getTargetClass()(*args, **kw) def test_ctor(self): connection = _Connection() PA...
{ "content_hash": "c50639bcee59bb5659fd0bf8bf01d8ef", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 77, "avg_line_length": 36.09615384615385, "alnum_prop": 0.5963416799857929, "repo_name": "GrimDerp/gcloud-python", "id": "83be77266703dc510f2de45d574da53b6c9d6809", "size"...
from typing import ( Any, List, Optional, Sequence, Union, cast, TYPE_CHECKING, Mapping, ) import pyspark.sql.connect.proto as proto from pyspark.sql.connect.column import ( Column, Expression, SortOrder, ) if TYPE_CHECKING: from pyspark.sql.connect._typing import Colu...
{ "content_hash": "d39824fc9a514127cd4fa427e5a1feab", "timestamp": "", "source": "github", "line_count": 1022, "max_line_length": 99, "avg_line_length": 32.03816046966732, "alnum_prop": 0.5360535076199493, "repo_name": "zzcclp/spark", "id": "9a22d6ea38ecc6b488ce657d2ddeaaad861d6e2c", "size": "33528"...
import os import re from oslo_serialization import jsonutils import six from nova import test from nova.tests.functional import integrated_helpers PROJECT_ID = "6f70656e737461636b20342065766572" class NoMatch(test.TestingException): pass def pretty_data(data): data = jsonutils.dumps(jsonutils.loads(data)...
{ "content_hash": "fdf4370ba411b000b96a979e95616bc4", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 78, "avg_line_length": 41.52183406113537, "alnum_prop": 0.5139086080875006, "repo_name": "CEG-FYP-OpenStack/scheduler", "id": "f008d0cac7af454ea7983c2a18ae14b785a650a6", "...
from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['lg_lock'], package_dir={'': 'src'}, scripts=[], requires=[] ) setup(**d)
{ "content_hash": "3e27f65f34ea5c1030ac443edbf0d047", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 20.545454545454547, "alnum_prop": 0.668141592920354, "repo_name": "EndPointCorp/lg_ros_nodes", "id": "e42e7f8b862a425965e881438e513bd85bd3c4e1", "siz...
__author__ = 'root' pyg = 'ay' original = raw_input('Enter a word:') word = original.lower() first = word[0] new_word = word[1:len(word)] + first + pyg if len(original) > 0 and original.isalpha(): print new_word else: print 'empty'
{ "content_hash": "16fd4317faf45604a051be11122ec33f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 44, "avg_line_length": 21.90909090909091, "alnum_prop": 0.6348547717842323, "repo_name": "SpAiNiOr/mystudy", "id": "babc167d17523c75b142289cb3b400297df183be", "size": "241"...
""" Tests for apyori.filter_ordered_statistics. """ from nose.tools import eq_ from apyori import OrderedStatistic from apyori import filter_ordered_statistics TEST_DATA = [ OrderedStatistic(frozenset(['A']), frozenset(['B']), 0.1, 0.7), OrderedStatistic(frozenset(['A']), frozenset(['B']), 0.3, 0.5), ] de...
{ "content_hash": "62ffd6c2de7f997582b1ab016375a81f", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 67, "avg_line_length": 22.26829268292683, "alnum_prop": 0.624315443592552, "repo_name": "VictorQuintana91/Thesis", "id": "b7820edbb7c6646fbea1798bac337116459f673f", "size":...
import sys import yaml import numpy as np from astropy.table import Table, vstack from astropy.io import fits import argparse from ..utils import create_mask def main(): usage = "usage: %(prog)s [config files]" description = "Merge FITS tables." parser = argparse.ArgumentParser(usage=usage,description=des...
{ "content_hash": "571b15692282d22f717db7656eadc74c", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 76, "avg_line_length": 27.056338028169016, "alnum_prop": 0.5616866215512754, "repo_name": "woodmd/haloanalysis", "id": "9e8db929851e4eb8647fa06b04cb11fbe74cfb51", "size": "...
from starcluster.clustersetup import ClusterSetup from starcluster.logger import log class ControlFREECInstaller(ClusterSetup): def run(self, nodes, master, user, user_shell, volumes): for node in nodes: log.info("Installing Control-FREEC 7.2 on %s" % (node.alias)) node.ssh.execute('wget -c -P /opt/software/c...
{ "content_hash": "1e8e1bd207e09544e1b6f3daec9f0f82", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 132, "avg_line_length": 73.8, "alnum_prop": 0.7515808491418248, "repo_name": "meissnert/StarCluster-Plugins", "id": "667e74432e0438472038796e03e8ea6598a82e8b", "size": "110...
""" Publication test """ # standard modules import os import sys # yael modules # TODO find a better way to do this PROJECT_DIRECTORY = os.path.dirname( os.path.dirname(os.path.dirname(os.path.realpath(sys.argv[0])))) sys.path.append(PROJECT_DIRECTORY) from yael import DC from yael import MediaType from yael impo...
{ "content_hash": "80b604df672745fea4b456cb56a36d73", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 142, "avg_line_length": 39.064655172413794, "alnum_prop": 0.6397440141233587, "repo_name": "gabalese/yael", "id": "94140ebe72428977fa2c4523b50230cfbb7cb488", "size": "9082...
from test.test_support import TestFailed, TESTFN, unlink from types import ClassType import warnings import sys, traceback, os print '5. Built-in exceptions' # XXX This is not really enough, each *operation* should be tested! # Reloading the built-in exceptions module failed prior to Py2.2, while it # should act the ...
{ "content_hash": "b97df74588954d5f50a912315d5ded21", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 78, "avg_line_length": 22.204761904761906, "alnum_prop": 0.6594467081278147, "repo_name": "loongson-community/EFI-MIPS", "id": "f44b591690c58142c35d72fbac7204c3aaae75e7", ...
from unittest import mock from nova import test from nova.tests import fixtures as nova_fixtures from nova.tests.functional import fixtures as func_fixtures from nova.tests.functional import integrated_helpers class HypervisorError(Exception): """This is just used to make sure the exception type is in the fault....
{ "content_hash": "979b824540873471e77278a44ceea3e0", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 48.5625, "alnum_prop": 0.6527241527241527, "repo_name": "mahak/nova", "id": "edc3c3b377f9b69f0c71d4a97ac8e86226d101bd", "size": "5208", "binary": f...
import sys from os.path import join from setuptools import setup import versioneer # note that we don't explicitly version numpy, # let menpo handle that install_requires = [ 'docopt>=0.6,<0.7', 'menpofit>=0.5,<0.6', 'menpodetect>=0.5,<0.6', 'numpy' ] if sys.version_info.major == 2: install_requir...
{ "content_hash": "e01c9bb0c5dc57c74771c21b404ec67a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 27.107142857142858, "alnum_prop": 0.6482213438735178, "repo_name": "menpo/menpocli", "id": "16efbebf1815c9fb4798fab498eb1b1fbc601612", "size": "759",...
import unittest import pytest import azure.cosmos.cosmos_client as cosmos_client import azure.cosmos.documents as documents import azure.cosmos.errors as errors from requests.exceptions import ConnectionError from azure.cosmos.http_constants import HttpHeaders, StatusCodes, SubStatusCodes import azure.cosmos.retry_util...
{ "content_hash": "994ec157b44c67c05f2c685035fa0ac3", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 159, "avg_line_length": 57.42962962962963, "alnum_prop": 0.7190764865213466, "repo_name": "Azure/azure-documentdb-python", "id": "65b1c45fff86618a4a2808227af7b6d7a99d2347", ...
import argparse import collections import time import ipaddr from maas_common import get_auth_ref from maas_common import get_keystone_client from maas_common import get_nova_client from maas_common import metric from maas_common import metric_bool from maas_common import print_output from maas_common import status_er...
{ "content_hash": "c54388d688e5e894f96e199948434b9a", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 32.78947368421053, "alnum_prop": 0.5861958266452648, "repo_name": "cfarquhar/rpc-maas", "id": "79e9f4105c58c3257d0f392aa5e03ba971860d61", "size": "37...
""" 2016-10-21: Modified version of balbuzard application for AL, original code found here: https://github.com/decalage2/balbuzard """ """ balbuzard - v0.20 2014-06-29 Philippe Lagadec Balbuzard is a tool to quickly extract patterns from suspicious files for malware analysis (IP addresses, domain names, known file hea...
{ "content_hash": "b165bb9db5da95c64434bf0c1088c6fe", "timestamp": "", "source": "github", "line_count": 639, "max_line_length": 127, "avg_line_length": 39.06103286384977, "alnum_prop": 0.5842548076923076, "repo_name": "maliceio/malice-pdf", "id": "65e29ad60f0ac8684e68d336be112864867c0222", "size": ...
from __future__ import division import collections import copy import time import os import sys from heapq import heappush, heappop from itertools import count import pandas as pd import numpy as np import networkx as nx import geopandas as gp from matplotlib import pyplot as plt import matplotli...
{ "content_hash": "619c7090ce1203e8a6914b5d2bfcc994", "timestamp": "", "source": "github", "line_count": 1828, "max_line_length": 124, "avg_line_length": 35.21498905908096, "alnum_prop": 0.5607319839062961, "repo_name": "bramkaarga/transcrit", "id": "fc1cb0fd560d4d898cef10124f9b2bedca137ea0", "size"...
from .amqp_exchange import PulsarExchange from .util import filter_destination_params def get_exchange(url, manager_name, params): connect_ssl = parse_amqp_connect_ssl_params(params) exchange_kwds = dict( manager_name=manager_name, connect_ssl=connect_ssl, publish_kwds=parse_amqp_publi...
{ "content_hash": "6d9fccdcf1712f6251025cca15e739f8", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 33.5609756097561, "alnum_prop": 0.6584302325581395, "repo_name": "jmchilton/pulsar", "id": "df26f8f58536bb405bfa862ab1b1fbb8c205645f", "size": "1376"...
import json import logging import urllib2 class SpectatorClient(object): """Helper class for pulling data from Spectator servers.""" SERVICE_PORT_MAP = { 'clouddriver': 7002, 'echo': 8089, 'fiat': 7003, 'front50': 8080, 'gate': 8084, 'igor': 8088, 'orca': 8083, 'rosco': 8087, } ...
{ "content_hash": "255bfd5b823a7f546435638c03204ab9", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 86, "avg_line_length": 31.171875, "alnum_prop": 0.6210526315789474, "repo_name": "imosquera/spinnaker", "id": "61089cfa4e1952f62247190ecf594c7696745b21", "size": "4027", ...
from django.db import models from models import MODERATION_STATUS_APPROVED class MetaManager(type(models.Manager)): def __new__(cls, name, bases, attrs): return super(MetaManager, cls).__new__(cls, name, bases, attrs) class ModeratorManagerFactory(object): @staticmethod def get(bases): ...
{ "content_hash": "868ea71e7b01ce4fd297deddd7f5700d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 82, "avg_line_length": 29.379310344827587, "alnum_prop": 0.6596244131455399, "repo_name": "mpyatishev/djmoderator", "id": "84abdb516deea652e8adcc52057468fa4bfaba4c", "size"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/weapon/shared_blacksun_light_weapon_s06.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### retur...
{ "content_hash": "f0c5b8c3a3d6cc6d3b3a9e84a153810a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 96, "avg_line_length": 25.23076923076923, "alnum_prop": 0.7103658536585366, "repo_name": "obi-two/Rebelion", "id": "eb62d6f07ce4f22d0cfbf9cc3b8797a0445ff3fb", "size": "473"...
import OutputStream import InputStream import SequenceFile import ArrayFile import MapFile import SetFile from Writable import * from IntWritable import * from BytesWritable import * from Text import * import WritableUtils import compress from hadoop.typedbytes import *
{ "content_hash": "326d5ee2284e8a8c9203563249eaae84", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 31, "avg_line_length": 16.176470588235293, "alnum_prop": 0.8327272727272728, "repo_name": "igorgatis/hadoop-tools", "id": "699a48f3aaa524ca37736c9fac1700dcfa1a19dc", "size"...
import pandas as pd df=pd.read_hdf('bigDataFrame.H5')
{ "content_hash": "ac443a0a4ea4e52933bec7e1299a52b1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 18, "alnum_prop": 0.7592592592592593, "repo_name": "uqyge/combustionML", "id": "91e5cdc7efa536aeba71f3c7e4a4fb23781175dd", "size": "54", "binary": f...
import redis from redis.exceptions import ConnectionError class Redis(object): def __init__(self, agentConfig, checksLogger, rawConfig): self.agentConfig = agentConfig self.checksLogger = checksLogger self.rawConfig = rawConfig def run(self): info = {'running': 0} tr...
{ "content_hash": "ad3240113cc2153e44e55a9768adb342", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 75, "avg_line_length": 25.488888888888887, "alnum_prop": 0.5527462946817786, "repo_name": "MWers/sd-redis-plugin", "id": "1ff9fd16cd72edc46451ee564883db72d9cd3b9a", "size":...
""" Verifies *_wrapper in environment. """ import os import sys import TestGyp test_format = ['ninja'] os.environ['CC_wrapper'] = 'distcc' os.environ['LINK_wrapper'] = 'distlink' os.environ['CC.host_wrapper'] = 'ccache' test = TestGyp.TestGyp(formats=test_format) old_env = dict(os.environ) os.environ['GYP_CROSSCOM...
{ "content_hash": "2e09c6aaba6cf37167513b605733c571", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 28.571428571428573, "alnum_prop": 0.607, "repo_name": "brson/gyp", "id": "09470e1ff59023dc7d1b49b4cb60150a10d77ba0", "size": "1180", "binary": fals...
from gerencianet import Gerencianet from credentials import CREDENTIALS gn = Gerencianet(CREDENTIALS) params = { 'id': 1 } body = { 'description': 'This carnet is about a service' } response = gn.create_carnet_history(params=params, body=body) print(response)
{ "content_hash": "f9bc5e568e1180104d23bced3bb0d969", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 18.2, "alnum_prop": 0.7289377289377289, "repo_name": "dannielhugo/gn-api-sdk-python-dev", "id": "72ccf9e51af941c850a47b29c7d80ac5ebf7bae1", "size": "...
"""This module contains the general information for ComputeServerNode ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class ComputeServerNodeConsts: ADMIN_POWER_BMC_RESET_DEFAULT = "bmc-reset-default" ADMIN_POWER_BMC_RE...
{ "content_hash": "d32bc2b30ba284336126eeb4f5af2e99", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 744, "avg_line_length": 65.00671140939598, "alnum_prop": 0.6317365269461078, "repo_name": "ragupta-git/ImcSdk", "id": "3fec7a0c3ca48a2a1fd3f42df9f184f33397c452", "size": "...
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 index on 'CronJobLog', fields ['end_time'] db.create_index(u'django_cronium_cronjoblog', ['end_time']) # Adding in...
{ "content_hash": "ba6426f25e347e8a01b852803fab1cbf", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 174, "avg_line_length": 49.48, "alnum_prop": 0.597413096200485, "repo_name": "philippeowagner/django-cronium", "id": "e04d504cbdc588cff4ebaaa353d69e11b0ea32fd", "size": "24...
from apertures_additions_lib import Add_quad_apertures_to_lattice from apertures_additions_lib import Add_bend_apertures_to_lattice from apertures_additions_lib import Add_rfgap_apertures_to_lattice from apertures_additions_lib import GetLostDistributionArr from apertures_additions_lib import AddScrapersAperturesToLatt...
{ "content_hash": "55806294b6d6bd7674ae2e3232f3ce28", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 95, "avg_line_length": 55.58536585365854, "alnum_prop": 0.8306274681878016, "repo_name": "PyORBIT-Collaboration/py-orbit", "id": "6d0fde621a7ae2a072a36c90efcc06f4292c951c", ...
""" WSGI config for shoreline project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "shoreline.settings") from django.co...
{ "content_hash": "d88bac63e80413c4abbd0c948e8f0eb8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 28.071428571428573, "alnum_prop": 0.7786259541984732, "repo_name": "Eylrid/shoreline", "id": "f9b32d2a2a4b7c14318b8aaf3f2fbaf3d66f5b37", "size": "393...
import os import shutil import StringIO import subprocess import tempfile import testtools from os_testr.tests import base DEVNULL = open(os.devnull, 'wb') class TestReturnCodes(base.TestCase): def setUp(self): super(TestReturnCodes, self).setUp() # Setup test dirs self.directory = temp...
{ "content_hash": "d23c01af34de545713eea95685a7e929", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 78, "avg_line_length": 38.28888888888889, "alnum_prop": 0.6329077190946024, "repo_name": "mtreinish/os-testr", "id": "591e4dd9d54a3a4cb2640f5838101bdff61859bd", "size": "40...
import barrister from bottle import run, post, request from store import Store, RecordNotFound, UserDataInvalid, MaxTodosExceeded from functools import wraps import sys class TodoManager(object): def __init__(self, store): self.store = store def readTodos(self): return self.store.get_all() def createT...
{ "content_hash": "737b1f31e393a67f4817cdf8322b0351", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 24.4, "alnum_prop": 0.7259953161592506, "repo_name": "laser/polyglot-distributed-systems", "id": "41b66f6808265a2e520bc6b9ba65ed4088a15ba3", "size": ...
class Time(object): def __init__(self, hour, minute, second): self.hour = hour self.minute = minute self.second = second def __str__(self): return str(self.hour) + ":"+str(self.minute)+":"+str(self.second) def __add__(self, other): return Time(str(self.hour+other.hour...
{ "content_hash": "bc3df86e2737c13d7069fed93ebc7cb2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 121, "avg_line_length": 29.736842105263158, "alnum_prop": 0.6017699115044248, "repo_name": "bensk/CS9", "id": "cf4ed55d2a3a6c2ed64adbd5d2d970a4a6919203", "size": "565", "...
"""Module for baked spitfire utility functions.""" try: from spitfire.runtime import _baked # pylint: disable=g-import-not-at-top except ImportError: _baked = None class _SanitizedPlaceholder(str): """Class that represents an already sanitized string. SanitizedPlaceholder wraps another value to let ...
{ "content_hash": "7c7a301b96f9ffde12ba7bf535d15826", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 78, "avg_line_length": 30.027397260273972, "alnum_prop": 0.6747262773722628, "repo_name": "nicksay/spitfire", "id": "bfc99482efdecf92c38c9ab240181ca21a6449ad", "size": "235...
from django.conf.urls import patterns, url urlpatterns = patterns('', # users API url(r'^download/$', 'django_irods.views.download'), url(r'^list/$', 'django_irods.views.list'), )
{ "content_hash": "febe5b81be88758c887d633bb129d941", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 55, "avg_line_length": 21.555555555555557, "alnum_prop": 0.6494845360824743, "repo_name": "hydroshare/hydroshare_temp", "id": "5ff59bb749c15c7282d2589e18746eabbffcd8ac", "si...
from tempest.api.compute import base from tempest import config from tempest import test CONF = config.CONF class FixedIPsTestJson(base.BaseV2ComputeAdminTest): @classmethod def skip_checks(cls): super(FixedIPsTestJson, cls).skip_checks() if CONF.service_available.neutron: msg = ...
{ "content_hash": "7476a519394d4d3dbdbf8461cb5274b4", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 71, "avg_line_length": 33.76470588235294, "alnum_prop": 0.6236933797909407, "repo_name": "yamt/tempest", "id": "a65fda61fc38017f215b5f503da5224ab8f428ad", "size": "2346", ...
error = { 'not_implemented': { 'err_code': 'not_implemented', 'err_description': 'Method is not implemented', 'err_resolution': 'Check your request.' }, 'not_json': { 'err_code': 'not_json', 'err_description': 'Request contains data in other than JSON format.', ...
{ "content_hash": "67ed400aff823a2b4a9232d5bba5539c", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 37.11904761904762, "alnum_prop": 0.6016677357280308, "repo_name": "zverevalexei/trex-http-proxy", "id": "001c1173d78d3d284b0bf298879b2a7b226790a6", ...
"""Tests for the diagnostics data provided by the PVOutput integration.""" from aiohttp import ClientSession from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entry async def test_diagnostics( hass: HomeAssis...
{ "content_hash": "a237666d2c55ec926951ecf70f9c41e6", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 30.142857142857142, "alnum_prop": 0.6682464454976303, "repo_name": "GenericStudent/home-assistant", "id": "529e9b4e575b2c5ee77490caeffe894910c5f97d", ...
import math import imath import IECore import Gaffer import GafferDispatch class Wedge( GafferDispatch.TaskContextProcessor ) : Mode = IECore.Enum.create( "FloatRange", "IntRange", "ColorRange", "FloatList", "IntList", "StringList" ) def __init__( self, name = "Wedge" ) : GafferDispatch.TaskContextProcessor._...
{ "content_hash": "a48ca9ae69d68722af15c16f0ac3ee51", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 106, "avg_line_length": 26.153846153846153, "alnum_prop": 0.6444117647058824, "repo_name": "ivanimanishi/gaffer", "id": "b01e9fdae339c560bf340abc5d655463f713dc02", "size":...
from collections import defaultdict from proboscis.asserts import Check from proboscis.asserts import assert_equal from proboscis.asserts import assert_not_equal import unittest from trove.common import utils from trove.tests.config import CONFIG from proboscis.dependencies import SkipTest MESSAGE_QUEUE = defaultdict...
{ "content_hash": "1d5cc7ec00bda40f7de2b94c53031512", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 30.696969696969695, "alnum_prop": 0.6643632773938796, "repo_name": "citrix-openstack-build/trove", "id": "4a784e28ea780b5b619036da36f2fff926851122", ...
"""storage plugin.""" import gettext from otopi import plugin, util from ovirt_engine_setup import constants as osetupcons from ovirt_engine_setup import dialog from ovirt_engine_setup.engine import constants as oenginecons from ovirt_engine_setup.engine import vdcoption from ovirt_engine_setup.engine_common import...
{ "content_hash": "0d070bcf389b7c6f288241461d1a411e", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 73, "avg_line_length": 30.127906976744185, "alnum_prop": 0.6171362408336549, "repo_name": "yapengsong/ovirt-engine", "id": "1eb509dbc5561151372ec808fa19c08401be7f59", "size...
from absl import logging import tensorflow as tf import tensorflow_datasets as tfds from cold_posterior_flax.cifar10 import train from cold_posterior_flax.cifar10.configs import default class TrainTest(tf.test.TestCase): """Test cases for CIFAR10.""" def test_train_sgmcmc(self): config = default.get_config(...
{ "content_hash": "23fefa5a31ac693058a6603caf8348b6", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 29.785714285714285, "alnum_prop": 0.7014388489208633, "repo_name": "google-research/google-research", "id": "ff1f5520cda2f4c3f2cc065bcc89cc0a588e80b3",...
import os import json from datetime import datetime from urlparse import urlparse from urllib2 import unquote from peewee import Field, Model, Proxy, PrimaryKeyField, CharField,\ ForeignKeyField, BooleanField, IntegerField, SelectQuery, DateTimeField from tornado.web import HTTPError from ..extension import task...
{ "content_hash": "d43ba0897e92329ba3d8d8386ebc0bef", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 79, "avg_line_length": 34.90415335463259, "alnum_prop": 0.5522196796338673, "repo_name": "exherb/tvee", "id": "d0d8c8062f71d5b4c785cb76c1e7e4a4a7c074f1", "size": "10969", ...
"""This example gets all teams that you belong to. The statement retrieves up to the maximum page size limit of 500. To create a team, run create_team.py.""" __author__ = 'api.shamjeff@gmail.com (Jeff Sham)' # Locate the client library. If module was installed via "setup.py" script, then # the following two lines are...
{ "content_hash": "11c7387d516aa2eb869c987a1d18a1ed", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 31.363636363636363, "alnum_prop": 0.6855072463768116, "repo_name": "donspaulding/adspygoogle", "id": "6195e383d4e10d04275083d102c5e09316710c68", "siz...
import unittest import pickle import sys from test import support py_operator = support.import_fresh_module('operator', blocked=['_operator']) c_operator = support.import_fresh_module('operator', fresh=['_operator']) class Seq1: def __init__(self, lst): self.lst = lst def __len__(self): retur...
{ "content_hash": "5af0d5dfe15126770955ebb781d1acfe", "timestamp": "", "source": "github", "line_count": 600, "max_line_length": 83, "avg_line_length": 38.16833333333334, "alnum_prop": 0.585083620802585, "repo_name": "juanyaw/python", "id": "da9c8ef34f772280c58ad06c013b28f8b52caaad", "size": "22901"...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CourseDeadlines.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "5c418dddf9c6fc5873b3325dada22e6b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 26.22222222222222, "alnum_prop": 0.7203389830508474, "repo_name": "RedBulli/CourseDeadlines", "id": "0452af3fb55c7b8de99a691b782ea87c0dac802c", "size"...
"""Main module.""" import sys from dependency_injector.wiring import inject, Provide from .services import UserService, AuthService, PhotoService from .containers import Container @inject def main( email: str, password: str, photo: str, user_service: UserService = Provide[Container....
{ "content_hash": "1c9fd022b0c1d4f3a1c9c056e0daa736", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 71, "avg_line_length": 26.64516129032258, "alnum_prop": 0.6803874092009685, "repo_name": "rmk135/objects", "id": "87ccf71532e07b2b88b0b53062561cfd2b400d49", "size": "826", ...
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) GPIO.output(18, True)
{ "content_hash": "9e7658b130d3709335cb63495b84b668", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 24, "avg_line_length": 19, "alnum_prop": 0.7473684210526316, "repo_name": "Erfa/sprak", "id": "3f7f8e4998c617ab2730aac26d1b67c9dc877801", "size": "95", "binary": false, ...
from unittest import TestCase from .util import ( connect_db, destroy_db, create_model ) from .models import SimpleTestModel class DatabaseCreationTestCase(TestCase): def setUp(self): self.connection = connect_db() def tearDown(self): destroy_db(self.connection) def test_ta...
{ "content_hash": "5d380306b79d9404301eb7e21f3c4695", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 41, "avg_line_length": 18.652173913043477, "alnum_prop": 0.6386946386946387, "repo_name": "sethdenner/djangocassandra", "id": "43a0e1679985a9859e4ef8f012f485bab4da5aeb", "s...
from twisted.internet import defer import re import base class BaseXmppParser(base.BaseParser): def formatResult(self, request, result): if not isinstance(result, dict): return 'ERROR. Parser has got a strange shit from handler.' ok = result.get('ok') if ok is None: ...
{ "content_hash": "67667f29cb88644f350df62fe4c3139d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 71, "avg_line_length": 28.56, "alnum_prop": 0.5224089635854342, "repo_name": "ojab/bnw", "id": "f779d7206f199a52a24127b5eaf48382c35f6789", "size": "739", "binary": false,...
from .child_package import *
{ "content_hash": "2c32dae6254edc56e5e28aaca12e1506", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 28, "avg_line_length": 29, "alnum_prop": 0.7586206896551724, "repo_name": "kayhayen/Nuitka", "id": "3de394cc75628d7547322633a7275eb4ef2ccf25", "size": "798", "binary": fal...
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import os, time import multiprocessing as mp import logging import logging.config import Queue from Queue import Empty import json import cgi # for parsing form-data # ---------------------------------------------------------------------...
{ "content_hash": "b0d58b3f7e4b244b580f5e7b1169a6a7", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 129, "avg_line_length": 39.13966480446928, "alnum_prop": 0.5650870682272338, "repo_name": "hdj666/maaps", "id": "8dc59d1a524d24c2731bc58d057ed2479983b20d", "size": "7125",...
from django.contrib.auth.models import AnonymousUser import commonware.log from rest_framework.authentication import BaseAuthentication log = commonware.log.getLogger('z.api') class OAuthError(RuntimeError): def __init__(self, message='OAuth error occured.'): self.message = message class RestOAuthAut...
{ "content_hash": "453e9733cfaf2db365a1268ddcdc2f2b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 73, "avg_line_length": 31.076923076923077, "alnum_prop": 0.6856435643564357, "repo_name": "jinankjain/zamboni", "id": "6980049eec5e772d79737a3da5ea55cfec96a770", "size": "1...
import env import futures import mongoengine import redis import rq import setproctitle import tornadoredis import tornadotinyfeedback from tornado import ioloop, web from tornado.options import define, options, parse_command_line import api config = env.prefix('ORL_') print(config) if config['debug'] == 'True': ...
{ "content_hash": "5e197994aab92cecf0c2da1bea29704f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 67, "avg_line_length": 23.547169811320753, "alnum_prop": 0.7011217948717948, "repo_name": "JsonChiu/openrunlog", "id": "2de877a12d7c6b47f91fddd61f0601667420ef54", "size": "...
import numpy as np import csv, os, random from collections import Counter def dirty_pairtree(htid): period = htid.find('.') prefix = htid[0:period] postfix = htid[(period+1): ] if '=' in postfix: postfix = postfix.replace('+',':') postfix = postfix.replace('=','/') dirtyname = prefi...
{ "content_hash": "9cf746b87ddca57099ba28ae9c84bd95", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 122, "avg_line_length": 30.026041666666668, "alnum_prop": 0.6256721595836947, "repo_name": "tedunderwood/GenreProject", "id": "576eefda28f5a21842e0c80f82ccb22096cf464f", "...
import re import html from socket import * from threading import * class IRCClient: def __init__(self, nickname, channel): self.__nickname = nickname self.__channel = channel self.__socket = socket() self.__jokes = self.__get_jokes() def __del__(self): self.__send("QUI...
{ "content_hash": "1b1c90e515334a3fc853aee34b25c887", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 92, "avg_line_length": 33.08910891089109, "alnum_prop": 0.4874326750448833, "repo_name": "MaKToff/SPbSU_Homeworks", "id": "4902e0c0919e446f02b9639f8628e2b39c306ee1", "size...
import re from micawber.providers import Provider class ImageProvider(Provider): """ Simple little hack to render any image URL as an <img> tag, use with care Usage: pr = micawber.bootstrap_basic() pr.register(ImageProvider.regex, ImageProvider('')) """ regex = 'http://.+?\.(jpg|gif|png...
{ "content_hash": "1e9aaa0c73ac7c4957576a2d02329d57", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 162, "avg_line_length": 27.661290322580644, "alnum_prop": 0.5206997084548105, "repo_name": "HiroIshikawa/21playground", "id": "ac8de53518fba8019a052f032a1cee595eebefab", "s...
import collections import json import logging import sys import django from django.conf import settings from django.forms import widgets from django import http import django.test from django.test.utils import override_settings from django.urls import reverse from django.utils.http import urlencode import mock import ...
{ "content_hash": "bf8ae26bd2a91787bb811b52d4113b25", "timestamp": "", "source": "github", "line_count": 5573, "max_line_length": 79, "avg_line_length": 45.740534720976136, "alnum_prop": 0.5644967675119257, "repo_name": "noironetworks/horizon", "id": "d2bbcfdad9bbe2cac9e027acd39d2c8c671a3bcb", "size...
import unittest from app import app from app.models import Todo from werkzeug.exceptions import HTTPException class TodoTestCase(unittest.TestCase): def setUp(self): self.app = app.test_client() def tearDown(self): # clear data for each test todos = Todo.objects.all() for tod...
{ "content_hash": "c7b5cd70f916e97eb3523fb782cac7c0", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 68, "avg_line_length": 27.80327868852459, "alnum_prop": 0.5772405660377359, "repo_name": "dangger/awesome-flask-todo", "id": "3d59aa2e2720910253940f0e529ee8b1e4c6a519", "si...
from oslo_log import log as logging import oslo_messaging from neutron._i18n import _LE from neutron.api.rpc.callbacks.consumer import registry from neutron.api.rpc.callbacks import events from neutron.api.rpc.callbacks import resources from neutron.services.trunk.drivers.openvswitch.agent import ovsdb_handler from ne...
{ "content_hash": "b625992e7b465e29b71b276a4435662f", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 41.97222222222222, "alnum_prop": 0.6542025148908008, "repo_name": "cloudbase/neutron", "id": "68fa78b8708a2ebbd4650ec5286edc2690175ba1", "size": "356...
import random from locust import task, HttpUser, TaskSet products = [ '0PUK6V6EV0', '1YMWWN1N4O', '2ZYFJ3GM2N', '66VCHSJNUP', '6E92ZMYYFZ', '9SIQT8TOJO', 'L9ECAV7KIM', 'LS4PSXUNUM', 'OLJCESPC7Z'] currencies = [ 'EUR', 'USD', 'JPY', 'GBP', 'TRY', 'CAD'] # De...
{ "content_hash": "b850e703df141bbd343f1a798532ccd2", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 80, "avg_line_length": 20.666666666666668, "alnum_prop": 0.5978994748687172, "repo_name": "GoogleCloudPlatform/cloud-ops-sandbox", "id": "d0d1d1e1d49d85658f5c6f3ef1f5b7aab76...
import hashlib def hashmd5(handler, s): return hashlib.md5(s).hexdigest()
{ "content_hash": "944c2f644b890238b73793f198966a96", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 37, "avg_line_length": 15.8, "alnum_prop": 0.7215189873417721, "repo_name": "codeskyblue/bootstrap-tornado", "id": "85c6e6e27c4642f174380f5896d05b5c193d6322", "size": "98", ...
""" Django settings for project project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) im...
{ "content_hash": "9d7c82e821c9efae4787936c6e08438a", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 71, "avg_line_length": 25.627659574468087, "alnum_prop": 0.7251971772519717, "repo_name": "GroupwareStartup/Norisuke", "id": "efd09787ba914392fa7fd3d686c746477d072f94", "si...
import mock import os import pkg_resources import trove import ConfigParser as config_parser from trove.common import extensions from trove.extensions.routes.account import Account from trove.extensions.routes.mgmt import Mgmt from trove.extensions.routes.mysql import Mysql from trove.extensions.routes.security_group...
{ "content_hash": "aad814af65c33252e6443e648d64e886", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 79, "avg_line_length": 36.5, "alnum_prop": 0.6767123287671233, "repo_name": "fabian4/trove", "id": "e2023861afd47d5b7201859657a374a787c1c3b9", "size": "3888", "binary": f...
import unittest import numpy as np import os import shutil import subprocess from rmgpy import getPath from rmgpy.qm.main import QMCalculator from rmgpy.molecule import Molecule from rmgpy.qm.mopac import Mopac, MopacMolPM3, MopacMolPM6, MopacMolPM7 executablePath = Mopac.executablePath if not os.path.exists(executa...
{ "content_hash": "a08d4b403cfd99aa83669ad43c0666f0", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 114, "avg_line_length": 42.04524886877828, "alnum_prop": 0.6467929401635816, "repo_name": "nickvandewiele/RMG-Py", "id": "13e340222f0d729769e40a9614f91167fb445fb3", "size"...
import os import sys sys.path.append('..') import python_common as common def _expected_keys_and_values_of_cluster_query_rec( xroad_message_id, security_server_address): return [ ("messageId", xroad_message_id), ("serviceSecurityServerAddress", security_server_address), ] def run(clie...
{ "content_hash": "350fa3720e8afc154b5dbea6d84cf57c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 94, "avg_line_length": 39.64102564102564, "alnum_prop": 0.6811125485122898, "repo_name": "vrk-kpa/X-Road", "id": "b80d4d6bf21fa7769a2c3be30f1e9a5ca5013a30", "size": "6199"...
import abc import re import typing # This module defines the abstraction of a Test (of JSON data) # and several specific test classes. # A Test can be used multiple times, even concurrently. # Data is the type of Python data that corresponds to JSON values. Data = typing.Union[int, float, str, bool, typing.Tuple['Dat...
{ "content_hash": "9b2bcc984771d5bbe4b7db6f1bd1429f", "timestamp": "", "source": "github", "line_count": 596, "max_line_length": 147, "avg_line_length": 35.85906040268456, "alnum_prop": 0.6033595358412877, "repo_name": "mit-ll/python-keylime", "id": "30a92ac33d7d4fd170905a36b9a1e27cfca578b0", "size"...
""" tests specific to "pip install --user" """ import os import textwrap import pytest from os.path import curdir, isdir, isfile from pip.compat import uses_pycache, cache_from_source from tests.lib.local_repos import local_checkout from tests.lib import pyversion def _patch_dist_in_site_packages(script): site...
{ "content_hash": "7feca14c185f24a9a84bcf8055e63b45", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 79, "avg_line_length": 39.061016949152545, "alnum_prop": 0.6039225896034018, "repo_name": "jythontools/pip", "id": "eda5fb8fa015438ed5491706ad6768efb8ff9a9d", "size": "115...
"""Helper utilities module to compute various statistics for the current AOI. :copyright: (c) 2013 by Tim Sutton :license: GPLv3, see LICENSE for more details. """ import os import sys import getpass from tempfile import mkstemp import xml import time from datetime import date, timedelta import zipfile from reporter i...
{ "content_hash": "c6a75fc67e78011e7e990c0c695c8152", "timestamp": "", "source": "github", "line_count": 676, "max_line_length": 83, "avg_line_length": 31.51775147928994, "alnum_prop": 0.6194499202102695, "repo_name": "meomancer/field-campaigner", "id": "56f5a68aec2b27d72f1afba17604c1b3256cf4f4", "s...
from __future__ import print_function import argparse import sys import gzip import os import csv def linecount(fname): i = 0 if os.path.isfile(fname): f = gzip.open(fname) if fname.endswith('.gz') else open(fname) for i, l in enumerate(f): pass return i + 1 # Parse command lin...
{ "content_hash": "ae795e5a75d2b968b3b36e39b7d92f8e", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 172, "avg_line_length": 41.80612244897959, "alnum_prop": 0.5223334146936783, "repo_name": "tobiasrausch/ATACseq", "id": "17824483f83f30c1a3299f5533ca97fa24223db4", "size": ...
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "f9e71911772d241cb6c9ff87bd74df96", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 106, "avg_line_length": 37.25765306122449, "alnum_prop": 0.7053748716193085, "repo_name": "radicalbit/ambari", "id": "c9a7fbe8659b362ccdb9464aba4a3e5f10fb9bb7", "size": "1...
import saga ctx = saga.Context("ssh") ctx.user_id = "molu8455" session = saga.Session() session.add_context(ctx) outfile_src = 'sftp://login/lustre/janus_scratch/molu8455/webapi/rengers.out' handle = saga.filesystem.File(url=outfile_src, session=session) print handle.get_size() print handle.is_file() #data = hand...
{ "content_hash": "657cb3481ed1fed24a42bfe113b715cf", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 77, "avg_line_length": 17.846153846153847, "alnum_prop": 0.7306034482758621, "repo_name": "srinathv/myhat", "id": "123c022a024b7d76e6f089cd21ae507409d3629d", "size": "464",...
import os import csv from django.utils.dateparse import parse_datetime from django.core.urlresolvers import reverse from tempfile import NamedTemporaryFile from odk_logger.models.xform import XForm from main.tests.test_base import MainTestCase from odk_logger.xform_instance_parser import xform_instance_to_dict from odk...
{ "content_hash": "b310d3141894023996189081bcf17840", "timestamp": "", "source": "github", "line_count": 716, "max_line_length": 149, "avg_line_length": 40.39664804469274, "alnum_prop": 0.5484372839164707, "repo_name": "SEL-Columbia/formhub", "id": "4e0bf7594c751d8123e17f4e051a51be7f42d389", "size":...
"""Taiga integration for Zulip. Tips for notification output: *Text formatting*: if there has been a change of a property, the new value should always be in bold; otherwise the subject of US/task should be in bold. """ from typing import Any, Dict, List, Mapping, Optional, Tuple from django.http import HttpRequest, ...
{ "content_hash": "f70dc962dab6c98d4ddd4bd774821426", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 102, "avg_line_length": 45.23076923076923, "alnum_prop": 0.565374149659864, "repo_name": "timabbott/zulip", "id": "d4f61a7ef910d585261a20f37e4cd651032c03be", "size": "1470...
""" Processor class define for Scan and Session.""" import logging import re import os import json import itertools import requests from uuid import uuid4 from datetime import date from . import XnatUtils, task from . import assessor_utils from . import processor_parser from . import yaml_doc from .errors import Aut...
{ "content_hash": "affa3bb86d52adb6e2b311f9344cefbd", "timestamp": "", "source": "github", "line_count": 883, "max_line_length": 108, "avg_line_length": 37.731596828992075, "alnum_prop": 0.5418254944923012, "repo_name": "VUIIS/dax", "id": "ca4067f6b7aeb4b9971a27ffdf9cb8398d793ded", "size": "33317", ...
from unittest import mock from django.core.urlresolvers import reverse from taiga.projects import services from taiga.base.utils import json from .. import factories as f import pytest pytestmark = pytest.mark.django_db def test_get_members_from_bulk(): data = [{"role_id": "1", "email": "member1@email.com"}, ...
{ "content_hash": "83a97348747727ffcdd9443e0e1443ac", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 112, "avg_line_length": 37.33413461538461, "alnum_prop": 0.6821840190586569, "repo_name": "curiosityio/taiga-docker", "id": "c878bd458dd4ccad000fee84e0b06e0f80bbf07a", "si...
from gluuwebui import app from flask import request, redirect, url_for, Response import json import requests import os import datetime api_base = app.config["API_SERVER_URL"] class APIError(Exception): """Raise an exception whenever the API returns an error code""" def __init__(self, msg, code, reason, para...
{ "content_hash": "96cabbbe34572444f3e6d8c4964fd65b", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 79, "avg_line_length": 34.12852664576803, "alnum_prop": 0.6047579682189768, "repo_name": "GluuFederation/gluu-webui", "id": "405fdb3a6517706dac4506faf713894b608489c4", "si...
"""Auto-generated file, do not edit by hand. AI metadata""" from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata PHONE_METADATA_AI = PhoneMetadata(id='AI', country_code=1, international_prefix='011', general_desc=PhoneNumberDesc(national_number_pattern='[2589]\\d{9}', possible_number_pattern='\...
{ "content_hash": "4dc9e33dd9921713fa3da7b095e3c95b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 190, "avg_line_length": 83.10526315789474, "alnum_prop": 0.7042431918936035, "repo_name": "vicky2135/lucious", "id": "e301ab97370ae618820ddb5145c6c6e11b16ce3b", "size": "15...
import unittest import gevent from scales.asynchronous import AsyncResult class AsyncUtilTestCase(unittest.TestCase): def testWhenAllSuccessful(self): ar1 = AsyncResult() ar2 = AsyncResult() ar_agg = AsyncResult.WhenAll((ar1, ar2)) self.assertEqual(ar_agg.ready(), False) ar1.set(1) gevent...
{ "content_hash": "b38885bfcec26f260e49c39261274c2d", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 48, "avg_line_length": 23.426829268292682, "alnum_prop": 0.6496616345653305, "repo_name": "steveniemitz/scales", "id": "c783033ed855620f3a4aca6d53a8ab64c1d8e4da", "size": "...
from app import app
{ "content_hash": "8e45c2bc11f28661a4f137fc5cf84df8", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 20, "alnum_prop": 0.8, "repo_name": "kumaranzone/myflaskblogger", "id": "dc0fb4e4f7b842558ae6d600bb5f4b4a622f6bcf", "size": "39", "binary": false, ...
"""Support for sensors.""" from __future__ import annotations from fjaraskupan import Device, State from homeassistant.components.number import NumberEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import TIME_MINUTES from homeassistant.core import HomeAssistant from homeassistant...
{ "content_hash": "bc3105aea110041b3cf75bfb3e6505ec", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 87, "avg_line_length": 33.289855072463766, "alnum_prop": 0.6861123204179365, "repo_name": "GenericStudent/home-assistant", "id": "eecb0b3b8e1bb61e46bb715127bdd46f185e1ccf", ...
import email.utils import traceback import hashlib import logging import json import requests from datapackage import DataPackage from tableschema_sql import Storage from os_api_cache import get_os_cache from .callbacks import * from .model_registry import ModelRegistry from .config import get_engine from .fdp_utils ...
{ "content_hash": "8922d5ae661b3a9ddb3e9e963bee4fc7", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 102, "avg_line_length": 41.310344827586206, "alnum_prop": 0.5355221665739195, "repo_name": "openspending/babbage.fiscal-data-package", "id": "93b138d32c8fa1b1ca8e3bcb4f759e7...
"""The tests for Arcam FMJ Receiver control device triggers.""" import pytest from homeassistant.components.arcam_fmj.const import DOMAIN import homeassistant.components.automation as automation from homeassistant.components.device_automation import DeviceAutomationType from homeassistant.setup import async_setup_comp...
{ "content_hash": "7aa815d7b034a45f4a0f73499adbdbff", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 85, "avg_line_length": 31.10909090909091, "alnum_prop": 0.581531268264173, "repo_name": "rohitranjan1991/home-assistant", "id": "fe2507e3d8e8d982d25493cc398662894b3f7f8e", ...
from bee import * from bee.segments import * import libcontext from libcontext.socketclasses import * from libcontext.pluginclasses import * from Spyder import Coordinate class setPos(worker): setPos = antenna("push", "Coordinate") pos = variable("Coordinate") connect(setPos, pos) @modifier def d...
{ "content_hash": "7476da8ae3d811247eeddddcd8cc0d7f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 101, "avg_line_length": 27.423076923076923, "alnum_prop": 0.6760168302945302, "repo_name": "agoose77/hivesystem", "id": "c63ea469c737be90cadb385493de4595d3918276", "size": ...
import numpy as np import Html class MatrixDiagnosticWebpage: def __init__(self, solv, lyr, mesh): self.html = '' self.solver = solv self.lyr = lyr self.mesh = mesh self.maxWebPageSize = 100 def createWebPage(self): matrixSize= self.mesh.solveTemperatureNodeCount() if matrixSize...
{ "content_hash": "11b0f5cd6650a587f915f4b74513e2b2", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 123, "avg_line_length": 41.3859649122807, "alnum_prop": 0.6020912816165042, "repo_name": "tomacorp/thermapythia", "id": "34705dc10ed2eee8c20e29e3422d501fa98909fa", "size":...
from flask import render_template class DreamCtl: def __init__(self): pass @staticmethod def index(): return render_template('dream/index.html')
{ "content_hash": "410b5ac993e5eff1bfb16862da08b6c0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 50, "avg_line_length": 16.09090909090909, "alnum_prop": 0.6271186440677966, "repo_name": "jhbez/ProjectV", "id": "f76a7f8ac59c5f7a1b5c032f89fd063566d89ec0", "size": "800", ...
"""Signals that the given finalized deal is ready to serve. By default, deals are set ready to serve as soon as they're finalized. For programmatic guaranteed deals, bidders can opt out of this feature by asking their account manager. This is recommended for programmatic guaranteed deals in order to ensure that bidder...
{ "content_hash": "98e23aecf3079cd0d60dd4babe4b894d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 79, "avg_line_length": 35.394366197183096, "alnum_prop": 0.6812574612017509, "repo_name": "googleads/authorized-buyers-marketplace-api-samples", "id": "65795fb4841b6a9727b8ea...
import asyncio import datetime import sqlite3 import unittest import uuid from cloudhands.burst.agent import message_handler from cloudhands.burst.membership import AcceptedAgent import cloudhands.common from cloudhands.common.connectors import initialise from cloudhands.common.connectors import Registry from cloudha...
{ "content_hash": "4b3d30f0948534197042b87e54df2ef0", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 76, "avg_line_length": 36.21212121212121, "alnum_prop": 0.6532217573221757, "repo_name": "cedadev/cloudhands-burst", "id": "75deba414460f6c764a9329603ead416c6eaf4bd", "siz...
from django.test import TestCase from django.core.exceptions import ValidationError from lists.models import Item, List class ItemModelTest(TestCase): def test_default_text(self): item = Item() self.assertEqual(item.text, '') def test_item_is_related_to_list(self): list_ = List.object...
{ "content_hash": "3ea0a687b14ab6984782cbb5afaac48d", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 78, "avg_line_length": 32.8448275862069, "alnum_prop": 0.6062992125984252, "repo_name": "rocity/the-testing-goat", "id": "c519967de8a096cf6aa8a3851135805cfc5f96ca", "size":...
from nova.tests.image import fake from nova.tests.integrated.v3 import api_sample_base class ServersSampleBase(api_sample_base.ApiSampleTestBaseV3): def _post_server(self): subs = { 'image_id': fake.get_valid_image_id(), 'host': self._get_host(), 'glance_host': self._ge...
{ "content_hash": "5a5724ccc7ddb3a3e7d082e752d8e26a", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 77, "avg_line_length": 34.51578947368421, "alnum_prop": 0.5611466910643489, "repo_name": "imsplitbit/nova", "id": "d807490cba8d1275f5cd949b98c0778e74ee42dc", "size": "3955"...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import pymc3 as pm from scipy.stats import mode, chisquare from sklearn.metrics import confusion_matrix, accuracy_score import lasagne from utils import load_dataset import theano from utils import run_advi sns.set_style('whit...
{ "content_hash": "236f415f6592e2d1e0b1c041ab7246fe", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 117, "avg_line_length": 32.203539823008846, "alnum_prop": 0.6361637812585875, "repo_name": "guilherme-pombo/Bayesian-Deep-Learning", "id": "e8cc675c3b0cd1b6cd84d200f0fe3feca...
"""Tests for tensorflow.python.ops.op_def_library.""" from absl.testing import parameterized import numpy as np from google.protobuf import text_format from tensorflow.core.framework import attr_value_pb2 from tensorflow.core.framework import tensor_pb2 from tensorflow.core.framework import types_pb2 from tensorflow...
{ "content_hash": "2c2838c5de619d2308cef7c7acf3bb64", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 78, "avg_line_length": 38.725, "alnum_prop": 0.5879061760275447, "repo_name": "Intel-Corporation/tensorflow", "id": "84be0a37f907d271f583da62540467f697e73fac", "size": "53...
""" Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.25 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from kubernete...
{ "content_hash": "4418127dc5644ab3ba77f87fd2741be1", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 174, "avg_line_length": 29.181372549019606, "alnum_prop": 0.5696287586091047, "repo_name": "kubernetes-client/python", "id": "5ca1277c96abe0a11d807eb425300736a5fb34f0", "s...
import sys from optparse import OptionParser from cbagent.collectors.active_tasks import ActiveTasks from cbagent.collectors.iostat import IO from cbagent.collectors.latency import Latency from cbagent.collectors.observe import ObserveLatency from cbagent.collectors.net import Net from cbagent.collectors.ns_server imp...
{ "content_hash": "d0fc190dece9144778ee1211547a71cc", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 96, "avg_line_length": 37.34065934065934, "alnum_prop": 0.6486168334314303, "repo_name": "EricACooper/perfrunner", "id": "3c21f59d67548a8e22bde9a7210300558f7a1988", "size":...