text
stringlengths
4
1.02M
meta
dict
from __future__ import unicode_literals from ..dti import TrackBallStick def test_TrackBallStick_inputs(): input_map = dict(anisfile=dict(argstr='-anisfile %s', ), anisthresh=dict(argstr='-anisthresh %f', ), args=dict(argstr='%s', ), curveinterval=dict(argstr='-curveinterval %f', requi...
{ "content_hash": "6c5945e13b7ca4994dae5d83b83edada", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 67, "avg_line_length": 25.129411764705882, "alnum_prop": 0.6044007490636704, "repo_name": "mick-d/nipype", "id": "361838512d0cd301771cead57c59dd440b066b34", "size": "2190",...
"""Calculates evaluation scores for a prediction TSV file. The prediction file is produced by predict_main.py and should contain 3 or more columns: 1: sources (concatenated) 2: prediction 3-n: targets (1 or more) """ from __future__ import absolute_import from __future__ import division from __future__ import ...
{ "content_hash": "e13afeb90ec414548ddd6a9dc76c3dee", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 29.254901960784313, "alnum_prop": 0.7037533512064343, "repo_name": "googleinterns/lasertagger", "id": "f6256c5660f4ba5de415a6fd73230df14916e741", "si...
""" Measure resonators, one at a time, with the readout tone centered in the filterbank bin. """ from __future__ import division import time import numpy as np from kid_readout.roach import analog, calculate, hardware_tools from kid_readout.measurement import acquire, basic from kid_readout.equipment import hardware,...
{ "content_hash": "c91c47cf8a839e5b6dfa89bad598b04e", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 118, "avg_line_length": 54.69, "alnum_prop": 0.6518559151581642, "repo_name": "ColumbiaCMB/kid_readout", "id": "001e56b1e7958ab239a4e5e30e4b4e85231e939e", "size": "5469", ...
from .acfun import * from .alive import * from .baidu import * from .bilibili import * from .blip import * from .catfun import * from .cbs import * from .cntv import * from .coursera import * from .dailymotion import * from .douban import * from .douyutv import * from .ehow import * from .facebook import * from .freeso...
{ "content_hash": "9593fca5187e0c43011f37e6a019b4bd", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 26, "avg_line_length": 21.862068965517242, "alnum_prop": 0.7255520504731862, "repo_name": "Red54/you-get", "id": "198bc55b0365537d0d51799296338d3d6cf1195d", "size": "1291",...
# Permission is hereby granted, free of charge, to any person obtaining a # copy of this data, including any software or models in source or binary # form, as well as any drawings, specifications, and documentation # (collectively "the Data"), to deal in the Data without restriction, # including without limitatio...
{ "content_hash": "e7be50a34989c3a2f0f78871f8466869", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 80, "avg_line_length": 45.86178861788618, "alnum_prop": 0.7066123027831944, "repo_name": "pombredanne/metamorphosys-desktop", "id": "43ee6afaf7b7d654a6f54b9b5b5b568594113d4d...
from beritest_tools import BaseBERITestCase class test_raw_sd(BaseBERITestCase): def test_a0(self): '''Test load of stored double word''' self.assertRegisterEqual(self.MIPS.a0, 0xfedcba9876543210, "Load of stored double word failed") def test_a1(self): '''Test signed load of stored pos...
{ "content_hash": "5caa1b6fe678219737c71e3de6b303c9", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 112, "avg_line_length": 46.30769230769231, "alnum_prop": 0.6943521594684385, "repo_name": "8l/beri", "id": "ed70c95fef569bdb777db3b427eb4009ca263d85", "size": "2342", "bi...
import os import sys import re import ast from optparse import OptionParser class PythonTestFinder(object): def find_functions(self, ast_body, matcher): for obj in ast_body: if not matcher(obj): continue if isinstance(obj, ast.FunctionDef): yield ob...
{ "content_hash": "85ff64b05e074615bec00405ed37314f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 75, "avg_line_length": 33.26470588235294, "alnum_prop": 0.5864279398762158, "repo_name": "scorphus/nosecomplete", "id": "59c4fc1e77577f57f1b176639b58ff6fcf476bee", "size":...
import sys from pyasn1.codec.der import decoder from pyasn1.codec.der import encoder from pyasn1_modules import pem from pyasn1_modules import rfc2314 if len(sys.argv) != 1: print("""Usage: $ cat certificateRequest.pem | %s""" % sys.argv[0]) sys.exit(-1) certType = rfc2314.CertificationRequest() certCnt = ...
{ "content_hash": "97b199896ed4fc0874ce3f25dd460aa9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 66, "avg_line_length": 22.83783783783784, "alnum_prop": 0.6497041420118344, "repo_name": "etingof/pyasn1-modules", "id": "385312abf6105a5842ed1f7543fc7621662f444c", "size":...
import os import sys if __name__ == "__main__": # CHANGED manage.py will use development settings by # default. Change the DJANGO_SETTINGS_MODULE environment variable # for using the environment specific settings file. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysana.settings.development") ...
{ "content_hash": "8f14bbb49c1581995c3a92ec33cb5ed9", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 82, "avg_line_length": 35.166666666666664, "alnum_prop": 0.7393364928909952, "repo_name": "triump0870/mysana", "id": "2e7b4d79a36143ecc6989e3386b7c6eac2fbd82d", "size": "44...
import time from typing import TYPE_CHECKING, Dict, List, Optional, Tuple if TYPE_CHECKING: from sydent.sydent import Sydent class JoinTokenStore: def __init__(self, sydent: "Sydent") -> None: self.sydent = sydent def storeToken( self, medium: str, normalised_address: str, roomId: str, s...
{ "content_hash": "12856ec929afd4a052e4236b52ac77a5", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 88, "avg_line_length": 32.388888888888886, "alnum_prop": 0.5450733752620545, "repo_name": "matrix-org/sydent", "id": "8b41770c2eff7cc0832bc1d1b4548afef824c0fb", "size": "5...
from pudzu.charts import * from string import ascii_lowercase as lc df = pd.read_csv("datasets/twoletters.csv") groups = { w : t[0] for t in df.itertuples() for w in t[2].split(' ') } palette = [ "#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec" ] labels = [ "Functional words: //be...
{ "content_hash": "9b084056a68341598af1a6c8c1c03254", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 370, "avg_line_length": 75.36, "alnum_prop": 0.6353503184713376, "repo_name": "Udzu/pudzu", "id": "bf1ebc764efe81cd41dfdfed76ec10adcf21848c", "size": "1885", "binary": fa...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/bio/shared_bio_component_clothing_casual_training_2.iff" result.attribute_template_id = -1 result.stfName("craft_bio_components_n","bio_component_clothing_casual_training_2") #### BEGIN MODIFICATI...
{ "content_hash": "f41e80af2a7f7ff6a7f6e05b8182878e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 102, "avg_line_length": 28.923076923076923, "alnum_prop": 0.726063829787234, "repo_name": "obi-two/Rebelion", "id": "877c0f889eece563290f686bfc114fca996e105e", "size": "521...
"""This module is deprecated. Please use :mod:`airflow.providers.microsoft.azure.transfers.local_to_wasb`.""" from __future__ import annotations import warnings from airflow.providers.microsoft.azure.transfers.local_to_wasb import LocalFilesystemToWasbOperator # noqa warnings.warn( "This module is deprecated. P...
{ "content_hash": "ef9b6493bb55aae1bd0ea4e96f5a85a8", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 109, "avg_line_length": 36.416666666666664, "alnum_prop": 0.7780320366132724, "repo_name": "nathanielvarona/airflow", "id": "60ee64c8b5f52f3fe7df879337d4997670b3e39d", "siz...
import json import os from datetime import datetime from core import parse_network from plugins.mock_plugin import MockPlugin plugins_list = [MockPlugin()] net_map = parse_network('net_map_' + datetime.now().strftime("%d_%m_%y__%H_%M_%S"), plugins_list) net_map_json_data = json.dumps(net_map.to_dict()) print(net_ma...
{ "content_hash": "e90d882cfa7b636a223800ae72fbd167", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 97, "avg_line_length": 27.11764705882353, "alnum_prop": 0.702819956616052, "repo_name": "mordvin-denis/net-parser", "id": "0da7facaba2c484624af6b66d5b8f1f89d0c9400", "size"...
"""The schema module provides the building blocks for database metadata. Each element within this module describes a database entity which can be created and dropped, or is otherwise part of such an entity. Examples include tables, columns, sequences, and indexes. All entities are subclasses of :class:`~sqlalchemy.s...
{ "content_hash": "4c3452edc7bfee906a72d62c68f640f8", "timestamp": "", "source": "github", "line_count": 5261, "max_line_length": 101, "avg_line_length": 37.08648545903821, "alnum_prop": 0.5908913854606584, "repo_name": "j5int/sqlalchemy", "id": "dde665cbde73becf46cf00503992c838c671f289", "size": "1...
""" Snob, 'because it arbitrarily puts things in classes' -- C.S. Wallace. """ import sys from setuptools import setup, find_packages from codecs import open from os import path, system from re import compile as re_compile # For convenience. if sys.argv[-1] == "publish": system("python setup.py sdist upload") ...
{ "content_hash": "4dcda2b9c86a3d5cbbfeca717f2ca1c9", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 78, "avg_line_length": 30.547169811320753, "alnum_prop": 0.6219888820259419, "repo_name": "andycasey/snob", "id": "ef114dd6e0ff4fc23b937b3eafa63a2dc3affab9", "size": "1620"...
from touchdown.tests.stubs.aws import NetworkAclStubber from .fixture import AwsFixture class NetworkAclFixture(AwsFixture): def __init__(self, goal, aws, vpc): super(NetworkAclFixture, self).__init__(goal, aws) self.vpc = vpc def __enter__(self): self.network_acl = self.fixtures.ent...
{ "content_hash": "907a54f3b1ac4c27d7cea4019823a76c", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 81, "avg_line_length": 30.571428571428573, "alnum_prop": 0.6043613707165109, "repo_name": "yaybu/touchdown", "id": "985ae14017557bd60382075b4c0dc4cdbf866e2c", "size": "1220...
from __future__ import print_function from builtins import object from builtins import str from lib.common import helpers class Module(object): def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-CredentialInjection', 'Author': ['@JosephBialek'], ...
{ "content_hash": "936118d903d0964f08fb5ea1b13b7215", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 139, "avg_line_length": 37.80357142857143, "alnum_prop": 0.500236183278224, "repo_name": "byt3bl33d3r/Empire", "id": "1d329559a87e7872bba6385d9dd1e498699b229e", "size": "6...
from core_app import utils from sure import expect def test_url_parse1(): samples = [ ("https://www.google.kz/?gws_rd=" "cr&ei=OowNVaPxIdXdavjsgcgH", "google.kz/"), ("https://www.google.kz", "google.kz/"), ("http://www.google.kz", "google.kz/"), ("http://google.kz", "googl...
{ "content_hash": "125e56ff1035c3724a71aee3ac5e714d", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 30, "alnum_prop": 0.5793650793650794, "repo_name": "giAtSDU/disqus_be", "id": "d98694932e5288290e871c37fe0ecb198bf0edc9", "size": "630", "binary": ...
from __future__ import absolute_import from __future__ import print_function from django.core.management.base import BaseCommand from zerver.models import Realm, get_realm from zerver.lib.actions import do_add_realm_emoji, do_remove_realm_emoji import sys import six class Command(BaseCommand): help = """Manage em...
{ "content_hash": "fda675f362eda6a3c9880a718547a85e", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 165, "avg_line_length": 40.672413793103445, "alnum_prop": 0.5476896990250106, "repo_name": "ryansnowboarder/zulip", "id": "4c9ca8aa008bf1d24295c7cfa135ab7c1c572295", "size"...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) cwd = os.getcwd() paren...
{ "content_hash": "33191b28fc28cf7c0a0bd4eafa4c5e5d", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 80, "avg_line_length": 32.17427385892116, "alnum_prop": 0.7037657982976528, "repo_name": "rcmachado/django-zurb-ink", "id": "70a263aeb1d9b1d64d260fc3ea9fc66b5062303c", "si...
from .weather import Weather from .logdata import LogData
{ "content_hash": "5178460c6cf0c7cebbecaf8c32884c7d", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 28, "avg_line_length": 29, "alnum_prop": 0.8275862068965517, "repo_name": "jackbrucesimpson/forecast", "id": "5860518d0e57dd817c71c4827e17f23fc20f8c3d", "size": "82", "bin...
""" Definitions related to message data specification. :copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. :license: BSD, see LICENSE_BSD_Simple.txt for details. """ from .listener import getArgs as getListenerArgs from .validatedefnargs import MessageDataSpecError from .topicargs...
{ "content_hash": "0f9d92acf8eb327860118970ef714cb8", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 116, "avg_line_length": 37.935064935064936, "alnum_prop": 0.6665525504964054, "repo_name": "ktan2020/legacy-automation", "id": "202c973d6baef4e63d5f42c56fa369a22aee0e91", "...
from tempest_lib import exceptions as lib_exc from tempest.api.object_storage import base from tempest.common.utils import data_utils from tempest import config from tempest import test CONF = config.CONF QUOTA_BYTES = 10 QUOTA_COUNT = 3 class ContainerQuotasTest(base.BaseObjectTest): """Attempts to test the pe...
{ "content_hash": "9fb9669fb747e85a2db7b941a0fdbcd8", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 75, "avg_line_length": 38.50485436893204, "alnum_prop": 0.640695915279879, "repo_name": "liucode/tempest-master", "id": "896352bd2c1001aeb85c6ae2ef1dc65acf3dae90", "size":...
import unittest from producteev import Producteev try: from ConfigParser import ConfigParser import os config = ConfigParser() path = os.path.realpath(os.path.join(os.path.dirname(__file__), os.path.pardir)) conf_file = open(os.path.join(path, 'tests.cfg')) ...
{ "content_hash": "3a0bdc07872d7ec33a7ee6100cdfedb7", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 67, "avg_line_length": 29.327731092436974, "alnum_prop": 0.5931232091690545, "repo_name": "magarcia/python-producteev", "id": "290582b87c0a976af4feeab288c94e4bae1c2d01", "...
from aiakos_client.support_api_client import AiakosSupportApiClient from qautils.http.headers_utils import set_representation_headers from commons.authentication import Authentication as auth __author__ = "Telefonica I+D" __copyright__ = "Copyright 2015" __license__ = " Apache License, Version 2.0" HTTP_REPRESENTATIO...
{ "content_hash": "f77b18165632ffb08d2d95e47feb7bf5", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 108, "avg_line_length": 33.83870967741935, "alnum_prop": 0.6067683508102956, "repo_name": "telefonicaid/fiware-aiakos", "id": "3f13f6f5d146640822fb374666c2d665e6df16dd", "s...
import os from twilio.rest import Client # Initialize the client # To set up environmental variables, see http://twil.io/secure account = os.environ['TWILIO_ACCOUNT_SID'] token = os.environ['TWILIO_AUTH_TOKEN'] client = Client(account, token) # Delete the channel response = client.chat \ .services("I...
{ "content_hash": "3ed1acfa0d5167b6d0f6391a33e37a5b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 29.3125, "alnum_prop": 0.6886993603411514, "repo_name": "TwilioDevEd/api-snippets", "id": "efeccaeec8d5c4d7888c516c207d98c932bf9ad8", "size": "542", ...
"""Wrapper script around TraceEventAdder script.""" import argparse import sys import os from util import build_utils def main(argv): argv = build_utils.ExpandFileArgs(argv[1:]) parser = argparse.ArgumentParser() build_utils.AddDepfileOption(parser) parser.add_argument('--script', requ...
{ "content_hash": "7455a2ef050525b62bba3a7ec4885837", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 77, "avg_line_length": 32.31111111111111, "alnum_prop": 0.6788170563961485, "repo_name": "nwjs/chromium.src", "id": "ec39e5f8313cbe771372e997ad0ff0c13d5d0c69", "size": "161...
from datetime import datetime, timedelta from NodeDefender.db.sql import SQL, PowerModel, GroupModel, iCPEModel from sqlalchemy import func from sqlalchemy.sql import label from itertools import groupby def current(*groups): groups = GroupModel.query.filter(GroupModel.name.in_(*[groups])).all() if not len(grou...
{ "content_hash": "75c5d164f83373e9999dd785cefe73c7", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 84, "avg_line_length": 37.49645390070922, "alnum_prop": 0.5435975033100057, "repo_name": "CTSNE/NodeDefender", "id": "f94186ce6a44435069b66c78aaebf1fe933a25e0", "size": "5...
from PyQt4.QtCore import SIGNAL, SLOT from PyQt4.QtGui import QVBoxLayout, QDialog, QDialogButtonBox, QMessageBox from guidata.dataset.datatypes import DataSet from guidata.dataset.dataitems import (FloatItem, IntItem, BoolItem, ChoiceItem, StringItem) from guidata.dataset.qtwid...
{ "content_hash": "5e6b72fddb51d4d8adf14e47f16248dd", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 88, "avg_line_length": 34.80252100840336, "alnum_prop": 0.563563926113727, "repo_name": "rproepp/spykeviewer", "id": "300908981a8526ca402d776f5d5154f6f67af676", "size": "8...
import json import os import warnings from pathlib import Path from typing import Dict, List, Optional, Sequence, Union, overload from monai.config import KeysCollection, PathLike from monai.data.utils import partition_dataset, select_cross_validation_folds from monai.utils import ensure_tuple @overload def _compute...
{ "content_hash": "d55288d13d2e9ecd6749d2c93de3f679", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 117, "avg_line_length": 40.62083333333333, "alnum_prop": 0.6420145655964714, "repo_name": "Project-MONAI/MONAI", "id": "c1bbabceb9e13adcbc590f783c75d7720e555b81", "size": ...
from __future__ import absolute_import import os import unittest from integration.orquesta import base from st2common.constants import action as ac_const # Those tests hang and time out very often so they are disabled for the timing being until we find # the root cause for the race or run that test separately in i...
{ "content_hash": "ebde524f5b6477ee3fb29af19e1e0681", "timestamp": "", "source": "github", "line_count": 426, "max_line_length": 98, "avg_line_length": 47.394366197183096, "alnum_prop": 0.6615651312530956, "repo_name": "Plexxi/st2", "id": "b6588088ee2d8a5e988c3f78997d0fde8b4f74c8", "size": "20818", ...
""" wechatpy.utils ~~~~~~~~~~~~~~~ This module provides some useful utilities. :copyright: (c) 2014 by messense. :license: MIT, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import string import random import hashlib try: '''Use simplejson if we ca...
{ "content_hash": "6bc31957552364bd9bb8e0b2842235ae", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 77, "avg_line_length": 24.802816901408452, "alnum_prop": 0.6473594548551959, "repo_name": "hunter007/wechatpy", "id": "b3259dda234afebea6927fc5d7b9eaa6c4e4dac7", "size": "...
import json import inspect GB_IN_KB = 1073741824.0 cb_info = { "drive_add": { "bus_name": "org.storaged.Storaged", "signal_name": "InterfacesAdded", "path": None, "dbus_interface": "org.freedesktop.DBus.ObjectManager" }, "drive_remove": { "bus_name": "org.storaged.S...
{ "content_hash": "e20df448a04653b48f945493fc1afe2c", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 79, "avg_line_length": 36.39445628997868, "alnum_prop": 0.4823363993204054, "repo_name": "nnDarshan/dbus_agent", "id": "2753cd0effbd0f898022b711e7b8dd09031d264e", "size": ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: net_l3_interface version_added: "2.4" author: "Ricardo Carril...
{ "content_hash": "8c65917c18830e7a7b0ff80fc16a3d1f", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 93, "avg_line_length": 25.68918918918919, "alnum_prop": 0.6543924250394529, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "db842e504699d9169f9c1b2f271c39b14a921...
import functools import numpy as np from scipy.stats import norm as ndist import regreg.api as rr from selection.tests.instance import gaussian_instance from selection.learning.utils import full_model_inference, pivot_plot from selection.learning.core import normal_sampler, keras_fit from selection.learning.learner...
{ "content_hash": "993a85833ed441c510e9160bd56994bf", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 107, "avg_line_length": 33.255102040816325, "alnum_prop": 0.5105860693464253, "repo_name": "selective-inference/selective-inference", "id": "d11b2be9e3fd63de7a6c7eeba16aba906...
import time import pytest from kervi.application import Application import kervi.utility.nethelper as nethelper APP_READY = False MODULE_LOADED = None def app_ready(module_name): global APP_READY APP_READY = True def module_loaded(value): global MODULE_LOADED MODULE_LOADED = value @pytest.mark.slow ...
{ "content_hash": "d1d4672194ad2f556457b5b8b1ac4b05", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 112, "avg_line_length": 23.5, "alnum_prop": 0.6459574468085106, "repo_name": "kervi/kervi", "id": "7bad9045d60bb86f1a4cfbafc24ee5322fe9ad18", "size": "1175", "binary": fa...
from netforce.controller import Controller from netforce.template import render from netforce.model import get_model from netforce.database import get_connection, get_active_db # XXX: move this from netforce.locale import set_active_locale, get_active_locale from .cms_base import BaseController class Addresses(BaseC...
{ "content_hash": "4f90ee8992820eeaa64a25e7bb38f5d5", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 150, "avg_line_length": 44.94230769230769, "alnum_prop": 0.45856511196690913, "repo_name": "bank-netforce/netforce", "id": "9c2db2d71104651f1ede80335f7e79e003817904", "siz...
import json import os import re class HubMetaData(object): os_info_path = '/etc/os-release' connected_wifi_info_path = 'etc/NetworkManager/system-connections/bluenet' cpu_info_path = '/proc/cpuinfo' @classmethod def _read_from_file(cls, file_path): if not os.path.isfile(file_path): ...
{ "content_hash": "8d3e164505fe3349e210da61edc7b4dd", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 26.794117647058822, "alnum_prop": 0.5433589462129528, "repo_name": "getsenic/senic-hub", "id": "28b46e928f27cab47358fd5197f9ae5deb47c194", "size": "1...
import urllib, shutil, csv from time import time import os parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) os.sys.path.insert(0,parentdir) import summary.summary def findRoutines(fileName): for ln in fileName: url = ln.split(";")[3] routineName = url.split("/")[-1] ...
{ "content_hash": "a00cde4d75afb172278804283c7de09f", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 108, "avg_line_length": 35.11666666666667, "alnum_prop": 0.6098718557190318, "repo_name": "LighthouseHPC/lighthouse", "id": "136a851a998f51cdd2bf4581c0611e37d7bd1c32", "siz...
from flask import render_template def bootstrap(): return render_template('bootstrap.html')
{ "content_hash": "a0c934090bc9a927cd470ecc68e73818", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 44, "avg_line_length": 19.6, "alnum_prop": 0.7551020408163265, "repo_name": "stephanos/subvoc", "id": "606cfc77a57f12502761a00a7a3aa8146e12b6f1", "size": "98", "binary": f...
import unittest if __name__ == '__main__': from main import setup_tincan_path setup_tincan_path() from tincan import InteractionComponent, LanguageMap class InteractionComponentTest(unittest.TestCase): def test_InitEmpty(self): icomp = InteractionComponent() self.assertIsNone(icomp.id) ...
{ "content_hash": "7a3f355f88c31e487d9455f3cad9d677", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 98, "avg_line_length": 39.493506493506494, "alnum_prop": 0.6619533048339362, "repo_name": "jpablo128/TinCanPython", "id": "6e5b5f8e5ea71b787f810be841354d906dc0f2ae", "size...
from .column import Column from typing import List, Union class Date(Column): _allowed_column_types = [ 'DATE', 'DATETIME', 'TIMESTAMP', ] def __init__( self, name: str = '', column_type: str = '', length: Union[str, int] = None, null: bool = ...
{ "content_hash": "4a22137a960543df326309432b7e9527", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 120, "avg_line_length": 37, "alnum_prop": 0.5667359667359667, "repo_name": "cmancone/mygrations", "id": "720ee2fdbf22f8b7f3b468c63ad75aac45429b7c", "size": "2405", "binar...
__author__ = 'jono' import websocket, threading class Session: def __init__(self, agarthon): self.main = agarthon self.ip, self.port = self.main.server_info[0].split(':') self.token = self.main.server_info[1] self.data_in = [] self.running = False self.thread = ...
{ "content_hash": "a4f7f548e24a7bbf5d2ed3bef9a71738", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 96, "avg_line_length": 32.829268292682926, "alnum_prop": 0.5334323922734027, "repo_name": "jonnylin13/agarthon", "id": "545a2f14782aa1ec996788adc3cac9ea1ce6a66b", "size": "...
import os import sys import traceback NO_DEFAULT = object() if __name__ == '__main__': if not os.environ.get("ASFGIT_ADMIN"): print "Invalid server configuration." exit(1) sys.path.append(os.environ["ASFGIT_ADMIN"]) import asfgit.log as log import asfgit.git_multimail as git_multimail ...
{ "content_hash": "45dbc387483655f99f155bcc63eda37a", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 30.382978723404257, "alnum_prop": 0.584733893557423, "repo_name": "apache/infrastructure-puppet", "id": "7ed1a9a8243fb11fee3c098385c61bd244798687", "...
""" Copyright 2015-2016 @_rc0r <hlt99@blinkenshell.org> 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 t...
{ "content_hash": "ffec0ec6532f13188d4a2d01369c53ac", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 120, "avg_line_length": 42.5472972972973, "alnum_prop": 0.5307289185326346, "repo_name": "rc0r/afl-utils", "id": "fc87d62549367a6ff30b3556356046010bf08628", "size": "6297"...
from flask.ext.restful import fields from flask.ext.restful_swagger import swagger from tools import PseudoClasses __author__ = 'Robin Quetin' import ModelDefinitions def gen_message_fields(class_ref): resource_fields = { "session_id": fields.String, "object": fields.Nested(class_ref.resource_fie...
{ "content_hash": "9921d338106189f0ad90944825e60a81", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 99, "avg_line_length": 27.27840909090909, "alnum_prop": 0.7760883149343887, "repo_name": "RobinQuetin/CAIRIS-web", "id": "7f54aeda23fab14653c5cf2fad59bb04070893cf", "size"...
import urllib import sys import os URLs = [ "https://www.google.com/images/srpr/logo11w.png", "http://i.imgur.com/TigwF.jpg", "http://conquest.imslp.info/files/imglnks/usimg/e/ea/IMSLP113136-PMLP01646-FChopin_s_Werke_BH_Band1_Title_Pages.pdf", "http://i.imgur.com/poKTTTq.jpg", "http://upload.wikimedia.org/wikiped...
{ "content_hash": "3b632ccaa35254393aba23aca3dd45a5", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 143, "avg_line_length": 37.43333333333333, "alnum_prop": 0.692787177203918, "repo_name": "ziyuanliu/nyzr", "id": "28b1d190d025521d4cca695269f2dda361910816", "size": "1123",...
import asyncio from unittest import mock import pytest from sqlalchemy import Column, Integer, MetaData, String, Table, func, select from aiopg import sa meta = MetaData() tbl = Table( "sa_tbl2", meta, Column("id", Integer, nullable=False, primary_key=True), Column("name", String(255)), ) @pytest.f...
{ "content_hash": "89d07402d8b5b699b46456a0d5cfbf36", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 78, "avg_line_length": 27.36024844720497, "alnum_prop": 0.6431328036322361, "repo_name": "aio-libs/aiopg", "id": "0fb73a0c60a1b2bf3ad8138ffec64bb6acfb5f97", "size": "13215...
import argparse import os.path import xlrd import xlsxwriter QLANG_PREFIX = 'qlang-' QLANG_SUFFIX = '-qlang' QLANG_WORKSHEET_NAME = 'translations' QLANG_WORKSHEET = 'worksheet' QLANG_ROW = 'row' QLANG_TYPE = 'type' QLANG_LIST_NAME = 'list_name' QLANG_NAME = 'name' QLANG_COLUMN = 'column' ENGLISH = 'English' TRANSLAT...
{ "content_hash": "5c4bba27efd4120f917561d45083c439", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 117, "avg_line_length": 37.02325581395349, "alnum_prop": 0.589572864321608, "repo_name": "jkpr/qlang", "id": "8150353cd131e70e1a8534609a74fc72d016d58f", "size": "15920", ...
import sys # pragma: no cover from remoteappmanager.command_line_config import ( CommandLineConfig) # pragma: no cover from remoteappmanager.environment_config import ( EnvironmentConfig) # pragma: no cover from remoteappmanager.file_config import FileConfig # pragma: no cover from tornado.options impor...
{ "content_hash": "b6f214cb5b39705e79ac4e768caf0f46", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 75, "avg_line_length": 32.54838709677419, "alnum_prop": 0.6897918731417245, "repo_name": "simphony/simphony-remote", "id": "485802e45bea9b5a7dacadd7cbddabf4114330ab", "size...
"""we_are_social URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
{ "content_hash": "9810c4f2712cebf0b0cfe9716829a6d8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 99, "avg_line_length": 43.36734693877551, "alnum_prop": 0.699764705882353, "repo_name": "GunnerJnr/_CodeInstitute", "id": "38456eeff04d9d301c367730f42136a660c4c3fc", "size"...
import diventi.accounts.models from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0199_auto_20190615_1236'), ] operations = [ migrations.AlterModelManagers( name='diventiuser', managers=[ ('object...
{ "content_hash": "f0e1c89cf5ee09afad844c5c1c46f88c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 22.38888888888889, "alnum_prop": 0.5831265508684863, "repo_name": "flavoi/diventi", "id": "7ca4a023b9bb4f5e31ae1570586b4f742dfb7038", "size": "452", ...
from pysnmp.entity.rfc3413 import ntforg from pyasn1.compat.octets import null try: import asyncio except ImportError: import trollius as asyncio def _cbFunWithFuture(snmpEngine, sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, future): if future.cancelled(): ...
{ "content_hash": "567ac6f536fe8e2bc3102e406497220d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 72, "avg_line_length": 30.225, "alnum_prop": 0.5831265508684863, "repo_name": "ww9rivers/pysnmp", "id": "03e927d88761372c777cac5e27fbcf548739b2f3", "size": "2682", "binar...
import socket from subprocess import Popen, PIPE, STDOUT import os import time import string import requests import json import omxplayer class UnsupportedFileTypeException(Exception): '''Raised if the file type is not among the list of supported types''' pass class FileNotFoundException(Exception): '''...
{ "content_hash": "88c48769bd02767b922edbad92d64f14", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 83, "avg_line_length": 29.107142857142858, "alnum_prop": 0.578159509202454, "repo_name": "nakamura9/deploy_ad_server", "id": "4fb991fecdf999ff01e858ce6468528630641d22", "s...
import csv import os from collections import defaultdict base_dir = os.path.dirname(os.path.abspath(__file__)) assets_dir = os.path.join(base_dir, 'assets') pool_file = os.path.join(assets_dir, 'general_class_question_pool.txt') pool_index_file = os.path.join(assets_dir, 'general_class_question_pool_index.txt') poo...
{ "content_hash": "7a56022af3ed67f3b973f1ebef8f2f49", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 120, "avg_line_length": 31.7625, "alnum_prop": 0.568280204643841, "repo_name": "alphachai/fcc_general_licence_study", "id": "13b8eb3a357a18a020b93cede088e66adbf3fc43", "siz...
from participantCollection import ParticipantCollection import re import datetime import pyperclip # EDIT ME! currentMonthTotalDays = 31 currentMonthIndex = datetime.date.today().month currentMonthPenultimateDayIndex = currentMonthTotalDays - 1 currentMonthName = {1: 'January', 2: 'February', 3: 'March', 4: 'April', ...
{ "content_hash": "e1b503b4259a6918d1dfa3d518d19049", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 643, "avg_line_length": 77.55016181229773, "alnum_prop": 0.6980344698076201, "repo_name": "foobarbazblarg/stayclean", "id": "4906ab5a0a3deb3f281afb336499a9b183a5981c", "si...
from cassandra.policies import RetryPolicy class MonascaRetryPolicy(RetryPolicy): def __init__(self, read_attempts, write_attempts, unavailable_attempts): super(MonascaRetryPolicy, self).__init__() self.read_attempts = read_attempts self.write_attempts = write_attempts self.unav...
{ "content_hash": "85177f4b5953c5a3e5d42f5838857f11", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 95, "avg_line_length": 34.39473684210526, "alnum_prop": 0.6342769701606733, "repo_name": "openstack/monasca-persister", "id": "51052099b42f3d36beacfce831798b68112f0868", "s...
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.urls import reverse from mptt.models import TreeForeignKey from netbox.models import ChangeLoggedModel, NestedGroupModel, OrganizationalModel, NetBoxModel...
{ "content_hash": "c7b85745ddaa7e3e3e3c12cb4772377f", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 95, "avg_line_length": 23.152941176470588, "alnum_prop": 0.5962906504065041, "repo_name": "digitalocean/netbox", "id": "75ec9f69c7c6fc01df38e864118942bdf3f3fb56", "size": ...
import httplib # importing beautiful soup for parsing html tags from bs4 import BeautifulSoup as BS # setting up the connecting using get request conn = httplib.HTTPSConnection("www.sslproxies.org") conn.request("GET", "/") # getting the response and storing it in data response = conn.getresponse() data = response.read...
{ "content_hash": "c232c6ac17218c62b4cba724494a8c0f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 96, "avg_line_length": 38.1, "alnum_prop": 0.7493438320209974, "repo_name": "HoussemCharf/FunUtils", "id": "ecdeade0f94f4777bbb39531a081019719fbced9", "size": "787", "bin...
import argparse import json import os import subprocess import sys import typing import cryptography.x509 import os.path import glob from binascii import hexlify, unhexlify from enum import Enum VID_NOT_PRESENT = 0xFFFF PID_NOT_PRESENT = 0x0000 VALID_IN_PAST = "2020-06-28 14:23:43" VALID_NOW = "2022-09-28 14:23:43" V...
{ "content_hash": "2c87d65466bc1ba9bc95aa1c974bbe27", "timestamp": "", "source": "github", "line_count": 1000, "max_line_length": 398, "avg_line_length": 41.915, "alnum_prop": 0.5848502922581414, "repo_name": "project-chip/connectedhomeip", "id": "3fb099d81c0052f93e04c8e6932a2aa868fe6fa4", "size": "...
from SearchBehavior import SearchBehavior from CompositionSearchBehavior import CompositionSearchBehavior import sys class NodeBehaviorGenerator: def generateNodeBehavior(self, entries, nodePopulator): self.__nodeBehavior = '' for entry in entries: value = entry.f...
{ "content_hash": "95ecf5a0627ceecc6a836fff4776a92a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 68, "avg_line_length": 32.17857142857143, "alnum_prop": 0.6037735849056604, "repo_name": "unaguil/hyperion-ns2", "id": "ceb2b913f6a17cd2503f9c62a323c2db5bb4c316", "size": "...
from shellac.server import StreamBuf def test(): print 'Testing StreamBuf...' s = StreamBuf() assert s.ready() == False assert s.closed() == False s.write('Hello') assert s.ready() == True assert s.read() == 'Hello' assert s.read() == 'Hello' s.ack(2) assert s.read() == 'llo' s.ack(3) assert s.read() ...
{ "content_hash": "2375af8f13522cc4fd1dba76f93aab8a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 36, "avg_line_length": 14.790697674418604, "alnum_prop": 0.5911949685534591, "repo_name": "kmacrow/Shellac", "id": "ebbd5696a826d18d21a92b67b671b249c64dd6da", "size": "637"...
__author__ = 'wilmer' # This one corresponds to the AverageOpeningTime.pdf document (first model) try: import mkl have_mkl = True print("Running with MKL Acceleration") except ImportError: have_mkl = False print("Running with normal backends") import pickle import time import socket import numpy as...
{ "content_hash": "ef926433b4cf17849af7770433d3bed1", "timestamp": "", "source": "github", "line_count": 1126, "max_line_length": 216, "avg_line_length": 47.66429840142096, "alnum_prop": 0.5722191168250419, "repo_name": "wilmerhenao/Tomotherapy-Without-Pulse", "id": "01792678997ad13c58252db7709d04dbde...
"""Tests for tensorflow.ops.reverse_sequence_op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import sys import numpy as np from tensorflow.python.client import session from tensorflow.python.framework import constant_op from tensor...
{ "content_hash": "822fe6ca09f7c4e1a8630f00d31a5140", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 80, "avg_line_length": 33.91025641025641, "alnum_prop": 0.635538752362949, "repo_name": "davidzchen/tensorflow", "id": "c16d016f5e394a4cc9c46ecfd70e98e3f40b190c", "size": ...
extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = ...
{ "content_hash": "a7be53a1a4f8c89387048217c0716ccc", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 78, "avg_line_length": 32.19827586206897, "alnum_prop": 0.6704149933065596, "repo_name": "zierler-f/Video-Copy-Manager", "id": "e1068f48569518398dbad404d42ff1e00b1e0d40", ...
"""Test that parsing can fail.""" from pytest import raises from envargs import errors from envargs import parse_dict from envargs import Var def test_parse_fail(): """Simple case that fails to parse.""" args = { 'a_var': Var( use=int, load_from='A_VAR', ), } ...
{ "content_hash": "6a71eeb18dae1405f7d4cead41387585", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 64, "avg_line_length": 20.524590163934427, "alnum_prop": 0.5035942492012779, "repo_name": "cknv/envargs", "id": "8a67ef07b27604a29c35bc8f981347e3af606297", "size": "2504",...
import odoo.tests @odoo.tests.common.at_install(True) @odoo.tests.common.post_install(True) class TestUi(odoo.tests.HttpCase): def test_sale_available(self): # delay is added to be sure that all elements have been rendered properly self.phantom_js( "/", "odoo.__DEBUG__.serv...
{ "content_hash": "d9caf65ac65a6ade1c5cbfca48baf0ef", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 88, "avg_line_length": 35.857142857142854, "alnum_prop": 0.6254980079681275, "repo_name": "it-projects-llc/website-addons", "id": "d0d8aaf3f4255c859de856e7af795823d5dc8cb9", ...
from setuptools import setup setup( name='dns_sync', version='1.2.0', description='Sync a Google Cloud DNS zone with GCE resources', long_description=('Listens for compute engine audit events' 'for load blaancers or instances creation and ' 'deletes or create...
{ "content_hash": "fd416bbd59579201a7cb3f21047d482e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 77, "avg_line_length": 38.25, "alnum_prop": 0.5816993464052288, "repo_name": "GoogleCloudPlatform/professional-services", "id": "791e7de584366ebb562b2946d75be553e39bcb25", ...
from django.contrib import admin from .models import * # Register your models here. class Familia_Inline(admin.TabularInline): model = Familia max_num = 1 can_delete = False class Educacion_Inline(admin.TabularInline): model = Educacion extra = 1 max_num = 10 class TenenciaPropiedad_Inline(admin.TabularInline)...
{ "content_hash": "a2f331da36cc26b3ab6c2c35a044ab5c", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 142, "avg_line_length": 27.79126213592233, "alnum_prop": 0.7680349344978166, "repo_name": "shiminasai/aprocacaho", "id": "4e3369e7961ee7f975ca4e8ecf6b2f3f1f071785", "size"...
from django_filters import FilterSet, ModelMultipleChoiceFilter from django_select2.forms import Select2MultipleWidget from grandchallenge.algorithms.models import Job from grandchallenge.archives.models import Archive from grandchallenge.cases.models import Image from grandchallenge.reader_studies.models import Reade...
{ "content_hash": "2c619b5174a1b624ebb62e8f643d8b25", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 84, "avg_line_length": 34.75925925925926, "alnum_prop": 0.6515716568993074, "repo_name": "comic/comic-django", "id": "ac29a4061a888f2988af6aec4ecbe0113242fec0", "size": "18...
from django.conf import settings from django.contrib.auth import get_user_model, SESSION_KEY, BACKEND_SESSION_KEY from django.contrib.sessions.backends.db import SessionStore from django.core.management import BaseCommand __author__ = 'peter' User = get_user_model() class Command(BaseCommand): def handle(self, ...
{ "content_hash": "81b1366305ff2c2ae8fb660955aa163e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 31.08695652173913, "alnum_prop": 0.7328671328671329, "repo_name": "PeterHo/mysite", "id": "871e3f332ddc5844d7434bc139c8eb91496202d6", "size": "730", ...
import mock from datadog_checks.http_check import HTTPCheck, http_check def test__init__(): # empty values should be ignored init_config = {'ca_certs': ''} # `get_ca_certs_path` needs to be mocked because it's used as fallback when # init_config doesn't contain `ca_certs` with mock.patch('datadog...
{ "content_hash": "04f40bc302d657b2dee568863f7a2975", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 109, "avg_line_length": 34.54545454545455, "alnum_prop": 0.6447368421052632, "repo_name": "DataDog/integrations-core", "id": "5270fbe9ca35fd4cf4201fb1be277045da8e6393", "si...
from .utils import Utils from .parser import Parser from .errors import NotFoundError, NoTitleError, ErrorPageError, HomepageRedirectError, UnknownError import requests as _requests import functools session = _requests.Session() session.headers['User-Agent'] = 'reFill/2 (https://en.wikipedia.org/wiki/User:Zhaofeng_Li/...
{ "content_hash": "b0e216eee79b00d073847ceb46bdde95", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 100, "avg_line_length": 44, "alnum_prop": 0.7534965034965035, "repo_name": "zhaofengli/refill", "id": "246fcd53812b54552d7fe1c07f5fd7b8fb21ef54", "size": "572", "binary":...
""" Tests for go_cli.export_contacts. """ from unittest import TestCase from StringIO import StringIO import json from click.testing import CliRunner from go_http.exceptions import PagedException import go_cli.export_contacts from go_cli.main import cli from go_cli.export_contacts import ( contact_to_csv_dict, ...
{ "content_hash": "40fe05d075bda34c8b601b0d27149aeb", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 79, "avg_line_length": 35.31868131868132, "alnum_prop": 0.5365588052271313, "repo_name": "praekelt/go-cli", "id": "01490092db0b9eac6e7727bbfb14d343c4df9f5c", "size": "6461...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, workspace from caffe2.python.test_util import TestCase import numpy as np import tempfile class TestIndexOps(TestCase): def _test_ind...
{ "content_hash": "91d6f6b9d6f040d3039ef8f56c54ecc7", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 77, "avg_line_length": 34.613138686131386, "alnum_prop": 0.5428089413749473, "repo_name": "sf-wind/caffe2", "id": "7c15f8220e0e55712143029ca80b1280b3f2be61", "size": "5413...
import io from collections import namedtuple from django.db import models, transaction from memoized import memoized from casexml.apps.phone.restore import stream_response from corehq.apps.users.util import raw_username from corehq.blobs import CODES, get_blob_db from corehq.blobs.atomic import AtomicBlobs from cor...
{ "content_hash": "f66e19bbd979556a6f8c2d1985198566", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 100, "avg_line_length": 34.8, "alnum_prop": 0.6284802043422734, "repo_name": "dimagi/commcare-hq", "id": "5b6fd5ef7ef426185f4e712f30d0e32dd15e5abe", "size": "7830", "bin...
from tempest.common import credentials_factory as credentials from tempest import config from tempest import exceptions from tempest.tests import fake_config from tempest.tests.lib import base class TestLegacyCredentialsProvider(base.TestCase): fixed_params = {'identity_version': 'v2'} def setUp(self): ...
{ "content_hash": "fd3c465e16bb14e287d3c61d8263cd6d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 79, "avg_line_length": 37.59090909090909, "alnum_prop": 0.7013301088270859, "repo_name": "HybridF5/tempest", "id": "6fc490e4b271ffa7b877193fae2a9c1e71770ab8", "size": "1461...
from nose.tools import * from cohadar import lexicon, parser def test_parse_sentence(): result = parser.parse_sentence([('verb', 'run'), ('direction', 'north')]) assert_equal(result, parser.Sentence('player', 'run', 'north')) def test_parse_sentence2(): result = parser.parse_sentence([('noun', 'bear'), ('verb', ...
{ "content_hash": "2b72bf96e7ee819d6233280aa3337db3", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 104, "avg_line_length": 32.1875, "alnum_prop": 0.6951456310679611, "repo_name": "cohadar/learn-python-the-hard-way", "id": "5fd29c36eee1d7f6a5162816813a22e6373e7054", "size...
import sqlite3 connection = sqlite3.connect('easy_ticket.db') cursor = connection.cursor() print("Opened database successfully") input_file = open('links.txt', 'r') num_of_lines = int(input_file.readline().strip()) i = 0 while i < num_of_lines: connection_info = input_file.readline().strip().split(';') stati...
{ "content_hash": "b9d5f9da782c81bdf0917a21800f43ea", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 141, "avg_line_length": 36.75, "alnum_prop": 0.6754130223517979, "repo_name": "elailai94/EasyTicket", "id": "71c106227575f7805adf48b54eb3ff1f03407474", "size": "1029", "b...
""" WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All Rights Reserved. See http://4suite.com/COPYRIGHT for license and copyright information """ from xml.dom import Node from FtNode import FtNode class ProcessingInstruction(FtNode): nodeType = Node.PR...
{ "content_hash": "0b20d33d2b606f95077238d2907026b8", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 29.56923076923077, "alnum_prop": 0.558792924037461, "repo_name": "Integral-Technology-Solutions/ConfigNOW", "id": "6f1465d4b7c6175da93c3eacaff62124c072...
from __future__ import absolute_import, division, print_function import errno from contextlib import contextmanager from astropy import units as u from astropy.units import Unit, UnitBase from ..compat.contextlib import suppress from ..compat.math import isclose from .compat import PY33 __all__ = ( 'format_size...
{ "content_hash": "06bc8e9c0a4dd2e1c9d20affe91624e6", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 81, "avg_line_length": 28.83108108108108, "alnum_prop": 0.593156784626201, "repo_name": "python-astrodynamics/astrodynamics", "id": "e7c3782a4ac39639d6cc35d45ea31657e362817b...
def main(j, args, params, tags, tasklet): import yaml args.requestContext.params['breadcrumbdata'] = yaml.load(args.cmdstr) params.result = ('', args.doc) return params def match(j, args, params, tags, tasklet): return True
{ "content_hash": "23a0dff542bfe7779214a06031b3219a", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 73, "avg_line_length": 25.7, "alnum_prop": 0.6459143968871596, "repo_name": "Jumpscale/jumpscale_portal8", "id": "e9dfa31b33d25050d2b126e9308d3aeb2d61a2de", "size": "257", ...
from weibo import APIClient from kafka import KafkaProducer import json import time APP_KEY = "3722673574" APP_SECRET = "3686fea0a65da883b6c2a7586f350425" CALLBACK_URL = 'https://api.weibo.com/oauth2/default.html' client = APIClient(app_key=APP_KEY, app_secret=APP_SECRET, redirect_uri=CALLBACK_URL) with open('t...
{ "content_hash": "47cfe610cb66e947eeb1ba6b51393f6d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 85, "avg_line_length": 27.11111111111111, "alnum_prop": 0.6721311475409836, "repo_name": "Heipiao/weibo", "id": "a089e08b7f647620e93b4e8aaaf69e9ea241e69a", "size": "990", ...
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited 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 o...
{ "content_hash": "eacb1b6f0898a2163ae7088c2c05a632", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 83, "avg_line_length": 30.511363636363637, "alnum_prop": 0.5649906890130354, "repo_name": "wjzhang/pyOCD", "id": "aed049e192e2b339ad1f6b49b8ecbd03c047dc6d", "size": "2685",...
import abc import six from neutron.common import rpc as n_rpc from neutron.db.vpn import vpn_validator from neutron import manager from neutron.openstack.common import log as logging from neutron.plugins.common import constants LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) class VpnDriver(objec...
{ "content_hash": "f369df29be8a5a31daf92d67ab9d9856", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 74, "avg_line_length": 33.0253164556962, "alnum_prop": 0.5990801073208126, "repo_name": "virtualopensystems/neutron", "id": "00ee0e7f51f5764052ad6b746a361ded46a55b77", "siz...
import json import frappe from frappe.tests.utils import FrappeTestCase from frappe.utils import set_request from frappe.website.doctype.web_form.web_form import accept from frappe.website.serve import get_response_content test_dependencies = ["Web Form"] class TestWebForm(FrappeTestCase): def setUp(self): frapp...
{ "content_hash": "3cfb37d1a3142441b2f07abd341980ac", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 87, "avg_line_length": 29, "alnum_prop": 0.7029885057471265, "repo_name": "StrellaGroup/frappe", "id": "5a2269b64de8cdb96d83f14acf98871cf02315a0", "size": "2272", "binary...
"""Tests for XLA JIT compiler.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.compiler.tests.xla_test import XLATestCase from tensorflow.python.framewo...
{ "content_hash": "ac0a51fae3e63eb132905a5918c89b57", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 79, "avg_line_length": 37.357142857142854, "alnum_prop": 0.5679511692896014, "repo_name": "MoamerEncsConcordiaCa/tensorflow", "id": "c96826fd0a64b2d8fb02da22cfdc72edbb674317...
"""Tests for TFGAN losses.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.gan.python.losses.python import losses_impl as tfgan_losses from tensorflow.python.framework import constant_op from tensorflow.python.framework import dty...
{ "content_hash": "1002e4f4f72f6c88890e8c1c411d96fb", "timestamp": "", "source": "github", "line_count": 592, "max_line_length": 83, "avg_line_length": 42.0152027027027, "alnum_prop": 0.6645760463152817, "repo_name": "tornadozou/tensorflow", "id": "3e003dd0f808f80dcc486e78e8e101ac6f198947", "size": ...
"""Data preparation code for DDSP models.""" from ddsp.training.data_preparation import prepare_tfrecord_lib
{ "content_hash": "6160f26f73cddc2d9aa2bc4f28835ff9", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 63, "avg_line_length": 36.666666666666664, "alnum_prop": 0.7909090909090909, "repo_name": "magenta/ddsp", "id": "d768d14677e73da856c2ec50ef7ae2fa447d34b7", "size": "692", ...
from math import ceil from models.raster import Raster import shapefile import random import os class NetworkUtils(object): ''' Utilities for converting road networks into nodes and edges. created: Feb 13, 2017 by abdinoor ''' KPH_TO_MPH = 0.621371 METERS_TO_MPH = KPH_TO_MPH * 0.001 @c...
{ "content_hash": "63c49815c17411836d2046c64743e3cc", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 81, "avg_line_length": 41.602409638554214, "alnum_prop": 0.552128583840139, "repo_name": "wherehouse/wherehouse-sdk-py", "id": "87fc39f859d840b66a20d7318e07410eb14736fd", ...
from unittest import mock from nova import objects from nova.scheduler.filters import aggregate_instance_extra_specs as agg_specs from nova import test from nova.tests.unit.scheduler import fakes @mock.patch('nova.scheduler.filters.utils.aggregate_metadata_get_by_host') class TestAggregateInstanceExtraSpecsFilter(te...
{ "content_hash": "8ce35ecadc18767109bec22934c2d8cb", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 78, "avg_line_length": 42.5, "alnum_prop": 0.6244117647058823, "repo_name": "mahak/nova", "id": "971e1a366ce2bc1a53dc37ff0df14a23e714da74", "size": "3973", "binary": fals...
from read_until import ReadUntil import time import errno from socket import error as socket_error import threading import sys, os, re from Bio import SeqIO from StringIO import StringIO import string import mlpy import sklearn.preprocessing import random import math import csv import numpy as np import array as ar imp...
{ "content_hash": "a7bde229e8e550efca7c127fe48b006b", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 582, "avg_line_length": 49.093525179856115, "alnum_prop": 0.6057297772567409, "repo_name": "mattloose/RUscripts", "id": "8acc16f400bdabd2fb815fdc6e783291b55cf1ef", "size":...
from datetime import timedelta # external from blessed import Terminal # django from django.db import connection from django.db.models import F, Sum from django.utils import timezone from django.utils.translation import gettext as _ from django_q import VERSION, models from django_q.brokers import get_broker # loca...
{ "content_hash": "9ad9971a5b905dd4dc4d393b4ba563aa", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 112, "avg_line_length": 36.36645962732919, "alnum_prop": 0.44469114716766295, "repo_name": "Koed00/django-q", "id": "97404187b5d9d4c1688f3f8cfba492c30d030da4", "size": "17...
import tests.missing_data.test_missing_data_ozone_generic as gen gen.test_ozone_missing_data(None, 'Constant')
{ "content_hash": "e6ca7e62bf32e3a4a96337521b53b872", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 64, "avg_line_length": 37.333333333333336, "alnum_prop": 0.7946428571428571, "repo_name": "antoinecarme/pyaf", "id": "8cb5123d9c76a9c20b141fcadbe7d3aa9519eea0", "size": "112...
""" Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ import unittest import logging import json from cameo.parserForINDIEGOGO import ParserForINDIEGOGO """ 測試 """ class ParserForINDIEGOGOTest(unittest.TestC...
{ "content_hash": "c49b5715a4b8277aa2bc0101abb48a5a", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 72, "avg_line_length": 30.17910447761194, "alnum_prop": 0.7022749752720079, "repo_name": "muchu1983/104_cameo", "id": "aca85249164540db589fb0c564439eb7d403f83f", "size": "2...
"""readcycle.py: model of a stationary bicycle The Cycle class serves two purposes: 1. communication with a Digispark/Arduino microcontroller 2. backend to the cycle UI """ import serial import time import datetime import traceback import sys from hist import History class Cycle: """ Model class for c...
{ "content_hash": "fb95f8eed611b31bf6d7513e4245183c", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 81, "avg_line_length": 27.35820895522388, "alnum_prop": 0.5027277686852155, "repo_name": "imbadatgit/cycleUI", "id": "f1aee60b899269f1c82481a5d8af52bfcd38db84", "size": "3...
from __future__ import absolute_import import six from bitfield import BitField from collections import Sequence from django.db import models from sentry.db.models import ArrayField class ApiScopes(Sequence): project = (("project:read"), ("project:write"), ("project:admin"), ("project:releases")) team = (...
{ "content_hash": "22b68a9dead673d4b128326bc95838c1", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 92, "avg_line_length": 24.861538461538462, "alnum_prop": 0.5860148514851485, "repo_name": "mvaled/sentry", "id": "416b19f21a00f89c2028ae02a4440153be252d76", "size": "1616",...
""" Represent a set of variables in an Element. """ from __future__ import absolute_import, division, print_function, unicode_literals import copy from echomesh.expression import Expression from echomesh.expression import UnitSettings from echomesh.expression.UnitExpression import UnitExpression from echomesh.expres...
{ "content_hash": "88c64d7b8d461746c735e38660e098c3", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 82, "avg_line_length": 31.28985507246377, "alnum_prop": 0.6641963872163038, "repo_name": "rec/echomesh", "id": "0f91a45946d4456428ad1b6d5cd226b213d00de2", "size": "2159", ...
import fileinput sum = 0 for line in fileinput.input(): sum = sum + int(line) print(str(sum))
{ "content_hash": "1bf3b3df2b6f7463ab8295451cc73bc6", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 30, "avg_line_length": 12.625, "alnum_prop": 0.6534653465346535, "repo_name": "trozamon/hadoop-qa", "id": "4faa7e8dfae1d900b9d79e5d1a8a604d6b40de64", "size": "124", "binar...