text
stringlengths
4
1.02M
meta
dict
from nose.tools import raises, eq_ from mhctools import NetMHC, NetMHC3, NetMHC4 from mhcnames import normalize_allele_name def run_class_with_executable(mhc_class, mhc_executable): alleles = [normalize_allele_name("HLA-A*02:01")] predictor = mhc_class( alleles=alleles, program_name=mhc_execu...
{ "content_hash": "2cfb18b2cb70407ff02225104f230f92", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 57, "avg_line_length": 30.338983050847457, "alnum_prop": 0.6502793296089385, "repo_name": "hammerlab/mhctools", "id": "ac806fd742be433566bffbe8000c04643c9832d7", "size": "1...
"""This module contains functions for compiling circuits to prepare Slater determinants and fermionic Gaussian states.""" import numpy from openfermion.ops import QuadraticHamiltonian from openfermion.ops._givens_rotations import ( fermionic_gaussian_decomposition, givens_decomposition) def gaussian_state_prepa...
{ "content_hash": "ca4491d19aa3bb391a817c65e5d2c589", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 80, "avg_line_length": 42.67039106145251, "alnum_prop": 0.6492537313432836, "repo_name": "jarrodmcc/OpenFermion", "id": "31a9f862b7897546aa2da5316a89d1cd58e3b0fc", "size":...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons _python_ = TestSCons._python_ _exe = TestSCons._exe test = TestSCons.TestSCons() test.write('myrpcgen.py', """ import getopt import sys cmd_opts, args = getopt.getopt(sys.argv[1:], 'chlmo:x', []) for opt, arg in cmd_opts: if opt ==...
{ "content_hash": "b75ffc7ab133cc334792dd472792e9c8", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 69, "avg_line_length": 25.317460317460316, "alnum_prop": 0.613166144200627, "repo_name": "azatoth/scons", "id": "7cf0144bda4c0bd5486c2b5d40468f1ca6cb717c", "size": "2697", ...
import re from setuptools import setup, find_packages REQUIRES = ( 'marshmallow>=2.0.0b1', 'SQLAlchemy>=0.7', ) def find_version(fname): """Attempts to find the version number in the file names fname. Raises RuntimeError if not found. """ version = '' with open(fname, 'r') as fp: ...
{ "content_hash": "8e3c0a5a89b24193450ce77831dd1a1d", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 88, "avg_line_length": 29.442622950819672, "alnum_prop": 0.6119153674832962, "repo_name": "jmcarp/marshmallow-sqlalchemy", "id": "ec79dbdc3aab405816ecfbe9d9a26d1d6b6e2adb", ...
from __future__ import unicode_literals ''' Cellaret v0.1.3 Markdown Browser & Editor preferences.py ''' ''' Copyright 2014 Roman Verin 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...
{ "content_hash": "062f9acf49ac251aa9de6e7ce31e7daa", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 238, "avg_line_length": 43.68181818181818, "alnum_prop": 0.6918140825528963, "repo_name": "cellabyte/Cellaret", "id": "1421ebed36ff1cb1bf7fa19aa82023e55142610f", "size": "...
__author__ = 'Alexander Grießer, Markus Holtermann' __email__ = 'gieser@bitigheimer-htc.de, info@markusholtermann.eu' __version__ = '0.0.0'
{ "content_hash": "c8e72a06698d04927af62356f05a7d43", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 65, "avg_line_length": 46.666666666666664, "alnum_prop": 0.6928571428571428, "repo_name": "MarkusH/berlin-school-data", "id": "25501aa0e56ee7724fef4770c44d7bae90f59cef", "si...
""" GPLv3 license (ASTRA toolbox) Note that the TomoPhantom package is released under Apache License, Version 2.0 Script to generate 2D analytical phantoms and their sinograms with added noise and artifacts Sinograms then reconstructed using ASTRA TOOLBOX >>>>> Dependencies (reconstruction): <<<<< 1. ASTRA toolbox: ...
{ "content_hash": "6b56edfb825478b8579077235f7d9658", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 107, "avg_line_length": 40.50950570342205, "alnum_prop": 0.6466116012765158, "repo_name": "dkazanc/TomoPhantom", "id": "624be080e454eac0374e62c6bedb7ee9fbfa9ed0", "size": ...
import sys import numpy as np import lxmls.classifiers.linear_classifier as lc from lxmls.util.my_math_utils import * class Mira(lc.LinearClassifier): def __init__(self, nr_rounds=10, regularizer=1.0, averaged=True): lc.LinearClassifier.__init__(self) self.trained = False self.nr_rounds =...
{ "content_hash": "07c1b8b69c4988e9aabf050f4d7d9cc8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 110, "avg_line_length": 37.492753623188406, "alnum_prop": 0.5048318515655199, "repo_name": "LxMLS/lxmls-toolkit", "id": "bf6ee44ea827a1182c5d57751c24dc0b4dafef38", "size": ...
from sqlalchemy import Table, Column, MetaData, Integer from nova import log as logging new_columns = [ Column('free_ram_mb', Integer()), Column('free_disk_gb', Integer()), Column('current_workload', Integer()), Column('running_vms', Integer()), ] def upgrade(migrate_engine): # Upgrade oper...
{ "content_hash": "4439808623b406e0888b904731fe6d8e", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 63, "avg_line_length": 26.64516129032258, "alnum_prop": 0.6767554479418886, "repo_name": "rcbops/nova-buildpackage", "id": "2b5dd09ad42a7efc566496d0d75eb713f91bc8a6", "size...
""" Copyright 2015 SYSTRAN Software, Inc. All rights reserved. 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...
{ "content_hash": "dd18e4cf4a7fa3c947e3ba997aed6996", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 101, "avg_line_length": 32.450980392156865, "alnum_prop": 0.6259818731117824, "repo_name": "SYSTRAN/nlp-api-python-client", "id": "6004b9a3ed7b4fdc7972b691bbd58d925dd79259", ...
from corehq.preindex import CouchAppsPreindexPlugin CouchAppsPreindexPlugin.register('mvp_apps', __file__)
{ "content_hash": "d6020f7d14b4f84fe01f52cbc28872de", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 54, "avg_line_length": 36, "alnum_prop": 0.8240740740740741, "repo_name": "SEL-Columbia/commcare-hq", "id": "667a49b03295a5ac1c0a390c61a6f4918478df14", "size": "108", "bin...
from vilya.libs import api_errors from quixote.errors import TraversalError from vilya.views.api.utils import jsonize from ellen.utils import JagareError class FileResolveUI(object): _q_exports = [] def __init__(self, ret): self._ret = ret def __call__(self, request): return self._ret ...
{ "content_hash": "5822d520c2d1d21397fd360d2f38427f", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 88, "avg_line_length": 30.252747252747252, "alnum_prop": 0.5412277515437705, "repo_name": "douban/code", "id": "98ab886e74802abce750ed3fc106cfde9d0c616c", "size": "2753", ...
import sys import os from ratings import * # import builtin # urls = [ "http://127.0.0.1:%d/ratings" % port for port in [ 8001 ] ] class ratingsListener (object): def __init__(self, start): self.start = start def onFuture(self, future): end = os.times()[4] elapsed = (end - start) * 1000 print("...
{ "content_hash": "5a48c94fe1e6bcd4a8d0a6ee72fcd2ef", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 24.72340425531915, "alnum_prop": 0.6445783132530121, "repo_name": "datawire/datawire-connect", "id": "e49b5592f47ea7cc25b3e4b427293d2d61443de6", "siz...
import asyncio import pytest from spinach.queuey import Queuey def test_sync(): q = Queuey(2) q.put_sync(1) q.put_sync(2) assert len(q._items) == 2 assert len(q._putters) == 0 assert len(q._getters) == 0 assert q.get_sync() == 1 assert q.get_sync() == 2 assert len(q._items) == 0...
{ "content_hash": "ce2c3058e7d519e25bd16a409e61cba9", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 54, "avg_line_length": 22.323529411764707, "alnum_prop": 0.6047430830039525, "repo_name": "NicolasLM/spinach", "id": "934ef30abe66a70acdf1e53a5e58f3f5b94dae58", "size": "2...
import copy import mock from nose import tools from pylcp import api from pylcp.crud import offers from tests.crud import base as test_base class TestOfferSetCRUD(object): def setup(self): self.mock_client = mock.create_autospec(api.Client) self.offer_set_crud = offers.OfferSet(self.mock_client)...
{ "content_hash": "4b3ee9573ffce6f5804d286897d29f9d", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 112, "avg_line_length": 46.95275590551181, "alnum_prop": 0.5217172564145565, "repo_name": "bradsokol/PyLCP", "id": "753ce1bed2a12902f68777db9ae0b2a09cc03237", "size": "596...
import SCons.SConf hdf5_fortran_prog_src = """ program HDF5_Test use hdf5 end program HDF5_Test """ def CheckProg(context, prog_name): """ This function is from the latest version of SCons to support older SCons version. Configure check for a specific program. Check whether program prog_name e...
{ "content_hash": "18aa96542b2777a6f8a1bbb8ab8cb90b", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 100, "avg_line_length": 31.86013986013986, "alnum_prop": 0.5581650570676031, "repo_name": "TUM-I5/XdmfWriter", "id": "ac726532cd3aadf27b13349b9837e2489d7bc65a", "size": "6...
from localq import LocalQServer, Status from arteria.web.state import State as arteria_state class JobRunnerAdapter: """ Specifies interface that should be used by jobrunners. """ def start(self, cmd, nbr_of_cores, run_dir, stdout=None, stderr=None): """ Start a job corresponding to cm...
{ "content_hash": "db99b712c2945eb17d244484cec16c6f", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 88, "avg_line_length": 33.09615384615385, "alnum_prop": 0.6194073213248111, "repo_name": "johandahlberg/arteria-bcl2fastq", "id": "ae4952c5e8727ebde49ef2d881c14dfb5cf6063a",...
'''common utility modules''' __all__ = ['metrics', 'misc', 'topology', 'config', 'tracker_access', 'system_constants', 'system_config', 'tuple', 'proc', 'log']
{ "content_hash": "643fa02fa43db9b4d72b7649f52fbc56", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 71, "avg_line_length": 57, "alnum_prop": 0.5847953216374269, "repo_name": "mycFelix/heron", "id": "223a4dd3b3a02b19a390923b133373c66e2b07c0", "size": "956", "binary": fals...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from examples.concerts.policy import ConcertPolicy from rasa_core.agent import Agent from rasa_core.policies.memoization import MemoizationPolicy if __na...
{ "content_hash": "aaf53233266c6efed862ca228a87152c", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 66, "avg_line_length": 28.533333333333335, "alnum_prop": 0.6682242990654206, "repo_name": "deepak02/rasa_core", "id": "abfb823b920a3b34c658c5f15ed8e082cec22b83", "size": "8...
import torch from torch import nn from pose_format.torch.masked.tensor import MaskedTensor from pose_format.torch.masked.torch import MaskedTorch class DistanceRepresentation(nn.Module): def distance(self, p1s: MaskedTensor, p2s: MaskedTensor) -> MaskedTensor: diff = p1s - p2s # (..., Len, Dims) ...
{ "content_hash": "1e98e9b0f4d218fb1f790301ae9a7f05", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 77, "avg_line_length": 36.40909090909091, "alnum_prop": 0.66167290886392, "repo_name": "AmitMY/pose-format", "id": "b839b138dae806f31e7189778d6e3d782a474e8e", "size": "801"...
import socket import time from api_tools.device import Device from api_tools.ini_parser import Config def backup(): # Get data from config general = Config().get_general() ftp = Config().get_ftp() devices = Config().get_devices() for dev in devices: device = Device(dev['host'], 8728, d...
{ "content_hash": "ef5d4d293aafc3c834fb62b6a48c67f5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 93, "avg_line_length": 29.120689655172413, "alnum_prop": 0.4997039668442866, "repo_name": "voronovim/mikrotik-api-tools", "id": "3b34ac2246b0d43a9390f69685059f8036ff1e65", ...
''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-03-06 Last_modify: 2016-03-06 ****************************************** ''' ''' Given a binary tree, find its maximum depth. The maximum depth is the number of nodes a...
{ "content_hash": "6e2e2605bed931320fd19aca045c7df7", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 24.242424242424242, "alnum_prop": 0.535, "repo_name": "zhlinh/leetcode", "id": "27aed58214bdc2a6c91e3e639e77bf298cbbaacb", "size": "846", "binary":...
from openerp import tools from openerp import models,fields,api from openerp.tools.translate import _ class is_comparatif_tarif_facture(models.Model): _name='is.comparatif.tarif.facture' _order='invoice_id,product_id' _auto = False invoice_id = fields.Many2one('account.invoice', '...
{ "content_hash": "38f7c56beb2fc6f5dd8854cee164b075", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 121, "avg_line_length": 38.643478260869564, "alnum_prop": 0.5378037803780378, "repo_name": "tonygalmiche/is_plastigray", "id": "fc1dd57fcecf27a645bb9d1518a66c579de00e0f", ...
from __future__ import print_function, unicode_literals try: unicode except NameError: basestring = unicode = str # Python 3 import six class DoesNotExist(Exception): "The requested object does not exist" silent_variable_failure = True class MultipleObjectsReturned(Exception): "More than one ...
{ "content_hash": "345a193a68103ab63be5423ac0602e26", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 76, "avg_line_length": 30.686567164179106, "alnum_prop": 0.5429636835278858, "repo_name": "dmr/Ldtools", "id": "4d98f08148918e90181c188dd61e670090ebf376", "size": "6192", ...
from __future__ import unicode_literals import pytest from cz_urnnbn_api.api_structures import DigitalInstance from ..test_xml_composer import data_context # Fixtures ==================================================================== @pytest.fixture def dig_inst_xml(): return data_context("digital_instances....
{ "content_hash": "b10ba254ed13c58d66a1c54d7d1fe448", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 94, "avg_line_length": 30.475728155339805, "alnum_prop": 0.6294998407136031, "repo_name": "edeposit/cz-urnnbn-api", "id": "f87e772fdb5ee6d7742ec538aad66d0edad75d80", "size...
from __future__ import absolute_import, division, print_function import pytest from .. import message as msg def test_invalid_subset_msg(): with pytest.raises(TypeError) as exc: msg.SubsetMessage(None) assert exc.value.args[0].startswith('Sender must be a subset') def test_invalid_data_msg(): ...
{ "content_hash": "2412854bc62eb9f37bbdacd0987b6741", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 74, "avg_line_length": 28.347826086956523, "alnum_prop": 0.7147239263803681, "repo_name": "saimn/glue", "id": "4660b825bf1a5e031627c3620c78b68944deb5c7", "size": "652", "...
"""This module contains AWS SQS hook""" from __future__ import annotations from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook class SqsHook(AwsBaseHook): """ Interact with Amazon Simple Queue Service. Additional arguments (such as ``aws_conn_id``) may be specified and are passed dow...
{ "content_hash": "d1a09ede76973b6509af77c5f15a7d4c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 103, "avg_line_length": 38.196969696969695, "alnum_prop": 0.6322887742959143, "repo_name": "apache/airflow", "id": "2d3fd9de20e0f235f5a2f21f65c3d14a04871f88", "size": "3308...
from __future__ import absolute_import import theano import theano.tensor as T from theano.tensor.signal import downsample from .. import activations, initializations from ..utils.theano_utils import shared_zeros from ..layers.core import Layer class Convolution1D(Layer): def __init__(self, nb_filter, stack_siz...
{ "content_hash": "2c170bcbde0ea6d6bd4722010e8d4e74", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 97, "avg_line_length": 33.61875, "alnum_prop": 0.6055028815765012, "repo_name": "aleju/keras", "id": "6d4db99ec74835212fb9c4c29fdcf75cb716e379", "size": "5403", "binary"...
import pyrtcdc import base64 def on_channel(peer, channel): print 'new channel %s created' %(channel.label) channel.on_message = on_message def on_candidate(peer, candidate): print 'local candidate sdp:\n%s' %(candidate) def on_message(channel, datatype, data): print 'received data from channel %s: %s' %(cha...
{ "content_hash": "ccfb3ce769fa00a1f86036e5fa0c4f3b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 96, "avg_line_length": 29.214285714285715, "alnum_prop": 0.7123064384678076, "repo_name": "saghul/librtcdc", "id": "738c6c679baf3a97c32ab25974c41783e01db12f", "size": "1250...
from __future__ import print_function, division, absolute_import from odin import nnet as N, backend as K @N.Model def gender(X, f, **kwargs): nb_gender = kwargs.get('nb_gender', 4) if f is None: f = N.Sequence([ N.Dimshuffle(pattern=(0, 1, 2, 'x')), N.Conv(num_filters=32, fil...
{ "content_hash": "eab2718dc0a828ede1d322d034ba68de", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 87, "avg_line_length": 35.89655172413793, "alnum_prop": 0.5581171950048031, "repo_name": "imito/odin", "id": "5a38b2edef6fb937adabe0f1ace7c2b88796c583", "size": "1041", "...
import json
{ "content_hash": "3b35ff97ae5bf6f29cd06575d2f4489e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 11, "avg_line_length": 4.666666666666667, "alnum_prop": 0.7142857142857143, "repo_name": "xiaoyongaa/ALL", "id": "ac6262d423e19cd6cd81b0fb5c60e46ad70c4856", "size": "347", ...
""" OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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.a...
{ "content_hash": "07eb19a84bfc03fc628d9a1aaba27634", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 179, "avg_line_length": 34.54854368932039, "alnum_prop": 0.6415624560910496, "repo_name": "ftl-toolbox/lib_openshift", "id": "49f76c746f5e71d142d3abf9103ad6c2cf8e83cf", "s...
import cv2 import numpy as np import matplotlib.pyplot as plt # Load the data, converters convert the letter to a number data= np.loadtxt('testdata.data', dtype= 'float32', delimiter = ',', converters= {0: lambda ch: ord(ch)-ord('A')}) # split the data to two, 10000 each for train and test train, ...
{ "content_hash": "5a8d0a2b4848a0e5c1a51c17cc97a080", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 68, "avg_line_length": 30.807692307692307, "alnum_prop": 0.7153558052434457, "repo_name": "emschorsch/projector-hangman", "id": "d099cdb32c1133451a4b88419354d5efec2df9a7", ...
from __future__ import unicode_literals import requests from django.db import transaction from api.files.serializers import get_file_download_link from osf.models import ChronosJournal from osf.models import ChronosSubmission from osf.utils.workflows import ChronosSubmissionStatus, ReviewStates from website.settings ...
{ "content_hash": "593b03e868f47cc201ca4fe673d20740", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 131, "avg_line_length": 35.5928338762215, "alnum_prop": 0.5876269790427382, "repo_name": "pattisdr/osf.io", "id": "6e9df29c774e97cba151f09c1f24903533ec501a", "size": "1092...
import os import sys import tempfile import warnings from typing import Union, List, Tuple, Iterable from py4j.java_gateway import get_java_class, get_method from pyflink.common.configuration import Configuration from pyflink.datastream import StreamExecutionEnvironment from pyflink.table.sources import TableSource ...
{ "content_hash": "98ff4b95c8d2c63d12b8136aea98dd8b", "timestamp": "", "source": "github", "line_count": 2030, "max_line_length": 100, "avg_line_length": 45.74729064039409, "alnum_prop": 0.6035405472342167, "repo_name": "godfreyhe/flink", "id": "544b796bd0c5b391a229b6e1e72484b8eae62d56", "size": "93...
"""Support for WaterHeater devices of (EMEA/EU) Honeywell TCC systems.""" from __future__ import annotations import logging from homeassistant.components.water_heater import ( SUPPORT_AWAY_MODE, SUPPORT_OPERATION_MODE, WaterHeaterEntity, ) from homeassistant.const import PRECISION_TENTHS, PRECISION_WHOLE,...
{ "content_hash": "7965ffe53a4a6464295438c097cb4584", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 87, "avg_line_length": 35.328125, "alnum_prop": 0.6318000884564352, "repo_name": "FreekingDean/home-assistant", "id": "495df9e697e2f25026a5a22bdd0567dd3e1a7c9b", "size": "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('apies', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='api', name='active', ), ]
{ "content_hash": "2489f2d2e539e8d9521204113eab11c2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 40, "avg_line_length": 18.352941176470587, "alnum_prop": 0.5737179487179487, "repo_name": "Sult/daf", "id": "abfbf672c0c16f20cd8c1b23aa9de665c1917ec6", "size": "336", "bi...
from __future__ import unicode_literals from django.conf import settings from django.db import models, migrations def update_site_forward(apps, schema_editor): """Set site domain and name.""" Site = apps.get_model("sites", "Site") Site.objects.update_or_create( id=settings.SITE_ID, defaul...
{ "content_hash": "76a4c2190878c2a7ff2d1526cd9aca82", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 23.615384615384617, "alnum_prop": 0.5928338762214984, "repo_name": "gvlproject/gvldash", "id": "66c40443c25fe3cd57e20df44b4f04675daf884b", "size": "9...
import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define,options define("port",default=8000,help="run on the given port",type=int) class IndexHandler(tornado.web.RequestHandler): def get(self): greeting = self.get_argument('greeting','Hello') ...
{ "content_hash": "2b648dc3fe933b8b3b0fddb284d13ed1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 68, "avg_line_length": 29.28, "alnum_prop": 0.744535519125683, "repo_name": "xiongerqi/enki", "id": "e436f8b2cb4f17e379ee7d5b109baf8b648716e5", "size": "756", "binary": f...
from datetime import datetime from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import redirect, render from djview.forms import CategoryForm, PageForm, UserForm, UserPr...
{ "content_hash": "09931bcd9d5e376172cd517d64218392", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 74, "avg_line_length": 26.942857142857143, "alnum_prop": 0.6163308589607636, "repo_name": "rklabs/djaaks", "id": "bceca65ba7a7457e2e2ee6bfa77689a1a23475f8", "size": "4715"...
from __future__ import print_function import logging import os import signal import sys import time import re our_dir = os.path.dirname(os.path.abspath(__file__)) # For dev setups, we can find the API in the repo itself. if os.path.exists(os.path.join(our_dir, '../api/zulip')): sys.path.insert(0, '../api') from...
{ "content_hash": "e0525cd7b663009c8658945fe1dd9d6c", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 104, "avg_line_length": 33.62406015037594, "alnum_prop": 0.575134168157424, "repo_name": "aakash-cr7/zulip", "id": "52d45b1454c527aeadc43656b5de4a2accad7f1d", "size": "447...
import os import copy import subprocess from testlib.test import TestFunction from testlib.suite import TestSuite from testlib.helper import log_call from testlib.config import constants, config from fixture import TempdirFixture, Gem5Fixture, VariableFixture import verifier def gem5_verify_config(name, ...
{ "content_hash": "bbeee45825a72edbfd389a7469ef5097", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 78, "avg_line_length": 37.333333333333336, "alnum_prop": 0.5990079365079365, "repo_name": "TUD-OS/gem5-dtu", "id": "47cf421e16b83df92b8b3a3cb5873f5baccfb420", "size": "660...
''' Change Return Program The user enters a cost and then the amount of money given in dollars. The program will figure out the change and the number of quarters, dimes, nickels, pennies needed for the change. ''' import sys from decimal import * coins = ['quarters', 'dimes', 'nickels', 'pennies'] values = {'qua...
{ "content_hash": "ec1ba1619a7c41727b9eb7cecfdc6fb1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 86, "avg_line_length": 29.03448275862069, "alnum_prop": 0.6377672209026128, "repo_name": "mkmathur/Projects", "id": "c9c2842e152544c60d08af8123d8ae8bd9ba15f9", "size": "842...
from typing import MutableMapping, MutableSequence import proto # type: ignore __protobuf__ = proto.module( package="google.cloud.batch.v1alpha", manifest={ "Volume", "NFS", "PD", "GCS", }, ) class Volume(proto.Message): r"""Volume describes a volume and parameters f...
{ "content_hash": "66f163a32e9d781fba10c662c35ff393", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 110, "avg_line_length": 28.724550898203592, "alnum_prop": 0.5776526996039191, "repo_name": "googleapis/python-batch", "id": "a379dfc23cc621fed40a6effd5ac8513bff109b0", "si...
import os import sys import inspect __version__ = 'git' #{ Initialization def _init_externals(): """Initialize external projects by putting them into the path""" sys.path.append(os.path.join(os.path.dirname(__file__), 'ext', 'gitdb')) try: import gitdb except ImportError: raise ImportError("'gitdb' could n...
{ "content_hash": "5cf864a623fe860f3e9df6201f267016", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 73, "avg_line_length": 19.75, "alnum_prop": 0.6635021097046413, "repo_name": "qwinner/GitPython", "id": "0658c3306964ff16f0b9f7c72fe824ee78b3651f", "size": "1169", "binar...
import macropy.activate import testFunctions import testSanitization
{ "content_hash": "a9dd785434790b022253867ad0922302", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 23, "avg_line_length": 23, "alnum_prop": 0.8985507246376812, "repo_name": "jeanqasaur/jeeves", "id": "d3f3c270fd4865ff901fe2b92a5582e3a1cbec92", "size": "69", "binary": fa...
""" do the unit tests! """ import os import re import sys import unittest from optparse import OptionParser import paramiko import threading from paramiko.py3compat import PY2 sys.path.append('tests') from tests.test_message import MessageTest from tests.test_file import BufferedFileTest from tests.test_buffered_pip...
{ "content_hash": "aa5feb1c61f807df1d51e8dda6608b3f", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 107, "avg_line_length": 40.443661971830984, "alnum_prop": 0.6430437053804632, "repo_name": "mytliulei/DCNRobotInstallPackages", "id": "2b3d4ed47e64a64ec9ea3e5dc379771f89b57e...
"""Functionality to check for the availability and version of dependencies.""" from __future__ import print_function import re # Keep urllib2 here since we this code should be able to be used # by a default Python set up. import urllib2 # The dictionary values are: # module_name: minimum_version LIBYAL_DEPENDENCIES ...
{ "content_hash": "a73dc5f0a99f092b91de9689be2580f5", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 80, "avg_line_length": 32.54112554112554, "alnum_prop": 0.6515232140481575, "repo_name": "8u1a/plaso", "id": "f1ed0466ea1f7df71d541a87b4173f85e5dc1905", "size": "15058", ...
"""A wrapper of Session API which runs monitors.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six from tensorflow.contrib.learn.python.learn.wrapped_session import WrappedSession from tensorflow.python.framework import ops class MonitoredSes...
{ "content_hash": "71b6fdc03ba020386437f8168d337cac", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 80, "avg_line_length": 36.443548387096776, "alnum_prop": 0.6565611861031202, "repo_name": "natanielruiz/android-yolo", "id": "e4fbf606276961c60bd8ec8eefafd4bf2da91d66", "s...
""" Functions are intended as helpers to be used in conjunction with the "getLinks.py" script to collect links to movie pages on box office mojo so that you can scrape data from the individual movie's pages expected usage: from src.lib import mojoScrapeLinks """ def harvestMovieLinks(candidateURL, iYear, iType, ...
{ "content_hash": "fe486fd4aab06fcf397276b385cd41ad", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 130, "avg_line_length": 29.620689655172413, "alnum_prop": 0.6583236321303841, "repo_name": "lachlandeer/bom-scraper", "id": "0c4424c2952f46457d7d766edb8fbdc0034db1aa", "si...
import logging import shlex from typing import Any, List, Optional import wandb from wandb.errors import LaunchError from .abstract import AbstractRun, AbstractRunner from .local_container import _run_entry_point from .._project_spec import get_entry_point_command, LaunchProject from ..builder.build import get_env_va...
{ "content_hash": "6b0d87c4c522faab9a143a318fb8c214", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 86, "avg_line_length": 33.90425531914894, "alnum_prop": 0.6209601506118607, "repo_name": "wandb/client", "id": "40ea7c611a7b6bef5353d7d30e524f028cf356bd", "size": "3187", ...
"""Provides FCO API Client and decorator.""" from functools import wraps from fcoclient.exceptions import (NonRecoverableError, RecoverableError) import requests import json from requests import codes as rsc from time import sleep # REST Client default settings REST_RETRY_COUNT = 5 REST_RETRY_DELAY = 30 REST_FAILU...
{ "content_hash": "5332d21b65273e868f1033d1dffcc3ca", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 79, "avg_line_length": 36.60071942446043, "alnum_prop": 0.5585257985257985, "repo_name": "b-77/cloudify-flexiant-plugin", "id": "eee57c9c719417a6db6c4be9156076b23a4e7f19", ...
import urllib ###################################################### # This script will load the oculus & # the inmoov arms so that you can teleoperate # kwatters # Env specific config ###################################################### leftCameraIndex = 1 leftCameraAngle = 180 rightCameraIndex = 0 right...
{ "content_hash": "0ad2cfcea41a0f043c006efc6f1af3f4", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 99, "avg_line_length": 37.632183908045974, "alnum_prop": 0.6487477092241906, "repo_name": "MyRobotLab/pyrobotlab", "id": "6ed50093c9f1c2dc7505ba956b527bd06c01bda7", "size":...
from __future__ import division, print_function from functools import partial from itertools import product import numpy as np import scipy.sparse as sp from sklearn.datasets import make_multilabel_classification from sklearn.preprocessing import LabelBinarizer from sklearn.utils.multiclass import type_of_target fro...
{ "content_hash": "6e03d5ad4ae270a596f1239d79e7a42f", "timestamp": "", "source": "github", "line_count": 1121, "max_line_length": 79, "avg_line_length": 39.410347903657446, "alnum_prop": 0.6076190045044025, "repo_name": "zorroblue/scikit-learn", "id": "e68f4024b24af0f72dc1023806ecc7207ba9d78a", "siz...
import os import sys import warnings import time import socket import re import urllib2 import types import SocketServer import threading import tempfile import zipfile import pickle import glob #for directory scanning import abc #abstract base class import colorsys import logging import pygame as pg import scipy.ndima...
{ "content_hash": "f65aa4943882d6b1970f252da37d1e17", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 119, "avg_line_length": 27.651972157772622, "alnum_prop": 0.6505286121832522, "repo_name": "jayrambhia/SimpleCV2", "id": "43b4ce7eaf27325a1ab72de10989f456b1559365", "size"...
import os import sys from mic import chroot, msger from mic.utils import cmdln, misc, errors, fs_related from mic.imager import fs from mic.conf import configmgr from mic.plugin import pluginmgr from mic.pluginbase import ImagerPlugin class FsPlugin(ImagerPlugin): name = 'fs' @classmethod @cmdln.option("...
{ "content_hash": "d254a8bd32be976020ef3fa9f630649d", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 127, "avg_line_length": 35.80952380952381, "alnum_prop": 0.5290336879432624, "repo_name": "marcosbontempo/inatelos", "id": "6bcaf007290183b24235db07bd42605179352ffd", "siz...
from abc import ABC, abstractmethod from typing import TypeVar, Generic, Union from apache_beam.coders import PickleCoder from pyflink.datastream.state import ListState, MapState from pyflink.fn_execution.coders import from_proto from pyflink.fn_execution.internal_state import InternalListState, InternalMapState from...
{ "content_hash": "98cc8963eddc453f2279654c3cb4f640", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 100, "avg_line_length": 34.22027972027972, "alnum_prop": 0.6532134464085011, "repo_name": "tillrohrmann/flink", "id": "44e7fac57e8282349c634bea455c88246dfd7504", "size": "...
import rabit import numpy as np rabit.init(lib='mock') rank = rabit.get_rank() n = 10 nround = 3 data = np.ones(n) * rank version, model, local = rabit.load_checkpoint(True) if version == 0: model = np.zeros(n) local = np.ones(n) else: print '[%d] restart from version %d' % (rank, version) for i in xrang...
{ "content_hash": "e393827a95c1a093cf8350312ef1d8bb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 58, "avg_line_length": 22.416666666666668, "alnum_prop": 0.6263940520446096, "repo_name": "bssrdf/rabit", "id": "e35bd31775c28a04a4f46fe1b84db1ea60228500", "size": "556", ...
import mock from neutron.common import log as call_log from neutron.tests import base class TargetKlass(object): @call_log.log def test_method(self, arg1, arg2, *args, **kwargs): pass class TestCallLog(base.BaseTestCase): def setUp(self): super(TestCallLog, self).setUp() self.k...
{ "content_hash": "9747e2291c0252b91dc2e34cc9c4a2d8", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 78, "avg_line_length": 34.325581395348834, "alnum_prop": 0.5724932249322493, "repo_name": "mandeepdhami/neutron", "id": "b6ed65b43a346661349a5ccf82e35d31dabc92b7", "size": ...
from django.contrib import admin from djangobaselibrary.sample.models import Spam, Type admin.site.register([Spam, Type])
{ "content_hash": "5cadca59b5c22b22422c2696d30b5ec3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 54, "avg_line_length": 24.8, "alnum_prop": 0.8064516129032258, "repo_name": "ella/django-base-library", "id": "ef11b994851fe073b3e0043ffd86d1ebeb89fdb5", "size": "124", "b...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( float_or_none, parse_iso8601, update_url_query, int_or_none, determine_protocol, unescapeHTML, ) class SendtoNewsIE(InfoExtractor): _VALID_URL = r'https?://embed\.sendtonews\.com/pla...
{ "content_hash": "c574a5b4568689064c277f64cac3ed9a", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 170, "avg_line_length": 36.70192307692308, "alnum_prop": 0.5074665968037726, "repo_name": "bosstb/HaberPush", "id": "9d9652949bb64ca2a15c02b3e0733dd9b7f42493", "size": "38...
import json # 3rd-party modules from flask import Flask from flask import render_template from flask import request from flask import Response import arrow # local modules from mass.monitor import swf app = Flask(__name__) def response(status_code, data): return Response(json.dumps(data), s...
{ "content_hash": "d864578764f96df5531aa075cb0f8ff6", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 86, "avg_line_length": 27.577464788732396, "alnum_prop": 0.6057201225740552, "repo_name": "KKBOX/mass", "id": "8166afd4d347d15b88ed8f2ee2b3b45c698a628e", "size": "2024", ...
import numpy as np from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid from bokeh.models.markers import Diamond from bokeh.io import curdoc, show N = 9 x = np.linspace(-2, 2, N) y = x**2 sizes = np.linspace(10, 20, N) source = ColumnDataSource(dict(x=x, y=y, sizes=sizes)) xdr = DataRange1...
{ "content_hash": "d511e75efefc315ff6b8cd6d8adb5a61", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 96, "avg_line_length": 25.571428571428573, "alnum_prop": 0.7162011173184357, "repo_name": "percyfal/bokeh", "id": "803161c816ccf35e5982b879c3cb7e20f74de2a5", "size": "895",...
from __future__ import absolute_import import framework import importlib import json import logging import os import thread from collections import OrderedDict import django from api.caching import listeners # noqa from django.apps import apps from framework.addons.utils import render_addon_capabilities from framewo...
{ "content_hash": "c9afebd7e88737378473ffe743d097d5", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 99, "avg_line_length": 37.54545454545455, "alnum_prop": 0.7204321102626188, "repo_name": "erinspace/osf.io", "id": "b3b43e0c19e18992507366c2f7d6d5f13d4e16f7", "size": "539...
from .base import BaseCommand class NodesInfoCommand(BaseCommand): command_name = "elasticsearch:nodes-info" def is_enabled(self): return True def run_request(self): options = dict() return self.client.nodes.info(**options)
{ "content_hash": "a2163f84ba7fb637627fb63c6a74da27", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 22, "alnum_prop": 0.6666666666666666, "repo_name": "KunihikoKido/sublime-elasticsearch-client", "id": "f1ea6fd6d885fa3628f9995971a24e5a35a15849", "si...
import os import pickle from datetime import datetime from typing import ( Dict, Optional, Mapping, Callable, Any, List, Type, Union, MutableMapping ) import dbt.exceptions import dbt.flags from dbt import deprecations from dbt.adapters.factory import get_relation_class_by_name from dbt.helper_types import PathSe...
{ "content_hash": "0c33b61c85fc52a8fd13b3e125cbe562", "timestamp": "", "source": "github", "line_count": 641, "max_line_length": 79, "avg_line_length": 34.83151326053042, "alnum_prop": 0.6219375643839298, "repo_name": "fishtown-analytics/dbt", "id": "60ef395fdbdbe1d5ca790577b08f52a4419e650f", "size"...
import requests import urllib from datetime import datetime from test_base import TestBase class TestClass(TestBase): def __init__(self, *args, **kwargs): super(TestClass, self).__init__(*args, **kwargs) def plan_trip(self, test): return None
{ "content_hash": "06a2ce885faa65d379a6154a26d7f9bf", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 56, "avg_line_length": 19.428571428571427, "alnum_prop": 0.6691176470588235, "repo_name": "plannerstack/testset", "id": "d439b7a578e29d941d009efe3c9cc40592e35b9b", "size": ...
from __future__ import absolute_import from .setup_reflective_engine import setup_reflective_engine
{ "content_hash": "bff24c64def7f2f2483757025738fb40", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 60, "avg_line_length": 50, "alnum_prop": 0.82, "repo_name": "jackfirth/sqlalchemy-fp", "id": "5e7b64ada1793779f7094bcdf5de0fdf8e177c60", "size": "100", "binary": false, ...
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Redirect', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=F...
{ "content_hash": "de434f063e226a0340d8c72f37b2ee15", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 124, "avg_line_length": 35.67857142857143, "alnum_prop": 0.5195195195195195, "repo_name": "sussexstudent/falmer", "id": "9eab9cfbe6d90f241213efd19d86ec69d7d51c84", "size": ...
import sys python3 = sys.version_info[0] == 3 python2 = sys.version_info[0] == 2 def main(verbose): basenames = [ "test_template", "test_engine", "test_preprocess", "test_htmlhelper", "test_main", "test_encoding", "test_users_guide", "test_faq", ...
{ "content_hash": "5bce40bed32565c721d644e725295f12", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 82, "avg_line_length": 23.333333333333332, "alnum_prop": 0.53125, "repo_name": "mikedougherty/tenjin", "id": "d46aa37aee4a09172ece8775eacd5b05db27852e", "size": "1215", "...
# This code is part of CMPL # # Copyright (C) 2007, 2008, 2009, 2010, 2011 # Thomas Schleiff - Halle(Saale), Germany and # Mike Steglich - Technical University of Applied Sciences # Wildau, Germany # # CMPL is a project of the Technical University of # Applied Sciences Wildau and the Institute for Ope...
{ "content_hash": "4fbe319acdc8c9adb64b8c6334abb127", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 91, "avg_line_length": 25.926666666666666, "alnum_prop": 0.6052969915145282, "repo_name": "Mangara/ArboralExplorer", "id": "6d3d7ae8af90e397dc906def258af9314dc16be5", "siz...
import logging from odoo import api, fields, models, _ from odoo.exceptions import ValidationError logger = logging.getLogger(__name__) try: from py3o.formats import Formats except ImportError: logger.debug('Cannot import py3o.formats') class IrActionsReportXml(models.Model): """ Inherit from ir.actions...
{ "content_hash": "d7f208c6d035936d0cd1a22432c017ea", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 77, "avg_line_length": 35.78021978021978, "alnum_prop": 0.5985872235872236, "repo_name": "vileopratama/vitech", "id": "cfbfeb41fc8523d56b12c6dfb0211e798c3a341b", "size": "3...
"""EmPOWER Runtime.""" import socket import fcntl import struct import tornado.ioloop from construct import Container from construct import Struct from construct import UBInt16 from construct import Bytes from sqlalchemy.exc import IntegrityError from empower.datatypes.etheraddress import EtherAddress from empower....
{ "content_hash": "f79649a8cd5f3c0b28ec619c3dc6ec65", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 78, "avg_line_length": 30.697142857142858, "alnum_prop": 0.5217330603127327, "repo_name": "Panagiotis-Kon/empower-runtime", "id": "76158ce0eb820260fb4120d140b1ff321bfc2be3",...
"""Utilities for downloading data from WMT, tokenizing, vocabularies.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import codecs import collections import math import os import re import numpy as np import tensorflow as tf # Special vocabulary symbol...
{ "content_hash": "8ba7b01ef012e32f5095712f24f4df10", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 80, "avg_line_length": 29.107382550335572, "alnum_prop": 0.632234263315656, "repo_name": "giancds/attentive_lm", "id": "1b65f30a8390502c42b5125371a038a43e97b33f", "size": ...
import os import json import hashlib from threading import Lock from ethereum import _solidity from ethereum.abi import event_id, normalize_name, ContractTranslator from raiden.utils import get_contract_path __all__ = ( 'CONTRACT_MANAGER', 'CONTRACT_CHANNEL_MANAGER', 'CONTRACT_ENDPOINT_REGISTRY', '...
{ "content_hash": "b8df698bd36086c802d62f7a14edc8f1", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 87, "avg_line_length": 31.659685863874344, "alnum_prop": 0.6389945427484703, "repo_name": "tomashaber/raiden", "id": "6697032082909b27f5238c4171e322b176f2dab8", "size": "6...
from miniworld.model.network.backends.bridged.iproute2 import IPRoute2Commands from miniworld.model.singletons.Singletons import singletons from miniworld.model.network.backends.bridged.Connection import Connection def ConnectionIproute2(): class ConnectionIproute2(Connection()): def _tap_link_up(self, t...
{ "content_hash": "25d6f0bb59917e3a5fc3ee60277ec428", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 102, "avg_line_length": 42.8125, "alnum_prop": 0.7372262773722628, "repo_name": "miniworld-project/miniworld_core", "id": "ebf0b23a9b78b72f5bb01b1a2460b54603af8e42", "size"...
""" Support gahtering system information of hosts which are running glances. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.glances/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.co...
{ "content_hash": "3aef54aab38782a213d3e04284eb347d", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 74, "avg_line_length": 34.94736842105263, "alnum_prop": 0.5900267737617135, "repo_name": "leoc/home-assistant", "id": "51a8ac4d46fa996b16c27cec08f6a1f1a76fb48a", "size": "...
from .brane import Brane from .tracks import Target
{ "content_hash": "3a16e9505f3e39bf083a6e49845348ab", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 26, "alnum_prop": 0.8076923076923077, "repo_name": "krosenfeld/scatterbrane", "id": "d42db6d4750d8763f47d114261a210fa35938713", "size": "52", "binar...
import numpy as np from sklearn.metrics import average_precision_score from sklearn.metrics import confusion_matrix from tensorflow.core.framework import summary_pb2 import matplotlib import matplotlib.pyplot as plt import itertools def add_summary(tf_writer, tag, raw_value, global_step): value = summary_pb2.Summary...
{ "content_hash": "af2d0d23f82698b04bd450eb1515b498", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 111, "avg_line_length": 32.970873786407765, "alnum_prop": 0.6484098939929329, "repo_name": "UCSB-VRL/action_recognition", "id": "eb0c4048c0d7521a931e5f0db83a81fb7d624a3d", ...
import click from functional import seq from collections import namedtuple Edge = namedtuple('Edge', 'u v cap') @click.command() @click.argument('source_file') @click.argument('destination_file') def cli(source_file, destination_file): with open(source_file, 'r') as f: meta = f.readline().split() ...
{ "content_hash": "22e90b372180ea0067f236afeab91128", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 95, "avg_line_length": 34.666666666666664, "alnum_prop": 0.5536858974358975, "repo_name": "EntilZha/max_flow", "id": "866c698e926b48599fdc7ca900c97c8d9ac97c06", "size": "12...
from setuptools import setup setup( name='pg-table-markdown', version='1.0.4', author='Vokal', author_email='pypi@vokal.io', description='A command line tool that generates markdown documentation for Postgres tables in a given schema', url='https://github.com/vokal/pg-table-markdown', pack...
{ "content_hash": "7ece47019db7ddb9594179e61fad4fa5", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 114, "avg_line_length": 26.80952380952381, "alnum_prop": 0.6269982238010657, "repo_name": "projectweekend/pg-table-markdown", "id": "58ce9ffed2215cbffe2760e93d2dc67c64ed6ed9"...
from allauth.account.models import EmailAddress from allauth.socialaccount import providers from allauth.socialaccount.providers.base import (ProviderAccount, AuthAction) from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider from allauth.socialaccou...
{ "content_hash": "9fd0b1ff0e3ad370decb2cb212069d65", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 74, "avg_line_length": 30.887096774193548, "alnum_prop": 0.6067885117493472, "repo_name": "nimbis/django-allauth", "id": "0e66930adcb25a5aa2cb98047548ed37ea9448f9", "size":...
'Parse main CHANGELOG.md from stdin outputing on stdout the ubuntu changelog' import sys,re, datetime on_block=False for line in sys.stdin.readlines(): line = line.strip() if line.startswith('# ') or len(line) == 0: continue if line.startswith('## '): if on_block: print '\n -- ...
{ "content_hash": "da940172459d733c1d0e3f0fb9b5e0a1", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 35.285714285714285, "alnum_prop": 0.5843454790823212, "repo_name": "DuCalixte/docker", "id": "d19a3424e1bb2cfab3bf7e69581e5eb438d95407", "size": "764...
from camera import StereoCamera if __name__ == "__main__": print "testing stereo camera..." cam = StereoCamera("/dev/video0", "/dev/video1", (320,240)) print "click.." cam.capture("/home/pi/fishpi/imgs") print "click.." cam.capture("/home/pi/fishpi/imgs") print "click.." cam.capture("/h...
{ "content_hash": "8dd82b2e7963b6500645e9b7e97b8d22", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 29.666666666666668, "alnum_prop": 0.5786516853932584, "repo_name": "FishPi/FishPi-POCV---Command---Control", "id": "a13130632fac3d875bdb7117808f1070f4a...
from setuptools import setup import sys setup( name='iron-worker', py_modules=["iron_worker"], packages=["testDir"], version='1.3.8', install_requires=["iron_core >= 1.1.0", "python-dateutil"], description='The Python client for IronWorker, a cloud service for background processing.', autho...
{ "content_hash": "3f7478ce00d4b8b281bd0d77ae42f1e9", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 116, "avg_line_length": 39.85, "alnum_prop": 0.6537013801756587, "repo_name": "iron-io/iron_worker_python", "id": "88a986e10dcddee56ec5e8a64cf8e3aeecf7fb25", "size": "1594"...
from __future__ import annotations import json import os import random import string from contextlib import contextmanager import pytest from airflow.exceptions import AirflowException from airflow.models import Connection from airflow.providers.microsoft.azure.hooks.fileshare import AzureFileShareHook from airflow....
{ "content_hash": "8e2df2e3a7d0fc7c6654d25e032c5c7a", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 107, "avg_line_length": 37.25, "alnum_prop": 0.67535953978907, "repo_name": "cfei18/incubator-airflow", "id": "752115ce5f2c540e9e8df48f2ff68f3067dc41bf", "size": "6000", ...
import sh from sh_verbose import ShVerbose def get_git(path=None): return sh.git.bake(_tty_out=False, _cwd=path) def get_grep(): return sh.grep.bake(_tty_out=False) class OriginalBranch(object): def __init__(self, git=None): self.git = git or get_git() self.original_branch = None ...
{ "content_hash": "d210190ac1b3f9403501f31ad52d4b0a", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 78, "avg_line_length": 30.335766423357665, "alnum_prop": 0.563041385948027, "repo_name": "SEL-Columbia/commcare-hq", "id": "af84108dbe127ee2c06b5665ca9e1c8ce7be3a19", "siz...
import sys sys.path.append('/notebooks') import wave import re import struct import glob import params as par from scipy import fromstring, int16 import numpy as np import os.path from keras.models import Sequential, load_model from keras.layers import Dense, LSTM, Dropout from keras.callbacks import Callback from ker...
{ "content_hash": "434ccbb6554511d0a7b3938916adb1b5", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 69, "avg_line_length": 27.80392156862745, "alnum_prop": 0.6558533145275035, "repo_name": "niisan-tokyo/music_generator", "id": "09441da049385db82953d8f418787e4b4474a2bd", "...
"""Support for Matrix notifications.""" import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import (ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService, ...
{ "content_hash": "c7c269eb9a638d25a750f716d6e1bd78", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 30.674418604651162, "alnum_prop": 0.6413949962092494, "repo_name": "auduny/home-assistant", "id": "de2ac3bda2a0b07de0ba3f2dfdc06c63b148e992", "size":...
"""Test mempool limiting together/eviction with the wallet.""" from decimal import Decimal from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_greater_than, assert_raises_rpc_error, create_confirmed_utxos, create_lots_of_big_transactions, gen_return_txou...
{ "content_hash": "6f0a553ad3c241775d1897ead2ada6c3", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 166, "avg_line_length": 46.94285714285714, "alnum_prop": 0.6463785757760194, "repo_name": "yenliangl/bitcoin", "id": "1b1ac23024782c585c18215ef570f85fcdd931ba", "size": "35...
""" This subpackage contains developer-oriented utilities used by Astropy. Public functions and classes in this subpackage are safe to be used by other packages, but this subpackage is for utilities that are primarily of use for developers or to implement python hacks. This subpackage also includes the ``astropy.util...
{ "content_hash": "d6200975aaca49c6ad701794e6c6f538", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 39.45, "alnum_prop": 0.7807351077313055, "repo_name": "saimn/astropy", "id": "04e269bc8c19ca85c6aac1bcc919ebb5c3395ff6", "size": "853", "binary": f...
""" A lightweight Python WMI module wrapper built on top of `pywin32` and `win32com` extensions. **Specifications** * Based on top of the `pywin32` and `win32com` third party extensions only * Compatible with `Raw`* and `Formatted` Performance Data classes * Dynamically resolve properties' counter types * Hold...
{ "content_hash": "34169653dc9cc582d4c13543a6f29f75", "timestamp": "", "source": "github", "line_count": 542, "max_line_length": 105, "avg_line_length": 34.45387453874539, "alnum_prop": 0.5411802506158295, "repo_name": "indeedops/dd-agent", "id": "4bd32cc9f93bc17bd0266f9098e200be12b9b287", "size": "...
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() iz_dnevnika = Table('iz_dnevnika', post_meta, Column('id', Integer, primary_key=True, nullable=False), Column('ime_i_prezime', String(length=50)), Column('razred', String(length...
{ "content_hash": "c310546edc4a0226cc751a423bfd4c75", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 68, "avg_line_length": 29.79310344827586, "alnum_prop": 0.6967592592592593, "repo_name": "knadir/IIIgimnazija80", "id": "2b5663740e81ee55c2d472e5c0b5b75925a8df64", "size": ...
from typing import Callable, Dict, Any, List, Union, Tuple class Type: def __init__(self, atomic_type: str): ... @staticmethod def pointer(other: 'Type') -> 'Type': ... @staticmethod def reference(other: 'Type') -> 'Type': ... @staticmethod def rvalue_reference(other: 'Type') -> 'Type': ...
{ "content_hash": "06e903907403fea0e375e733696a3388", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 103, "avg_line_length": 34.19444444444444, "alnum_prop": 0.586515028432169, "repo_name": "google/tmppy", "id": "484337dd9a65e7b7b62c86f39f200cfa4f711d6b", "size": "1830", ...
""" 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": "8c6d1b6bd377817eb460a0058c3fae8a", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 405, "avg_line_length": 51.54297407912688, "alnum_prop": 0.7378311849871628, "repo_name": "arenadata/ambari", "id": "e767bd09a2571933b3e46e893479aded22137eed", "size": "37...
""" Device Manager monitor logger """ from sandesh_common.vns.ttypes import Module from cfgm_common.vnc_logger import ConfigServiceLogger from db import BgpRouterDM, PhysicalRouterDM from sandesh.dm_introspect import ttypes as sandesh class DeviceManagerLogger(ConfigServiceLogger): def __init__(self, args=None...
{ "content_hash": "1ee1f6c21aa1c625d61f7061219a92e2", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 76, "avg_line_length": 41.229729729729726, "alnum_prop": 0.6181579809898394, "repo_name": "nischalsheth/contrail-controller", "id": "8c333d5745ce9930338bd02df562f635d6850f25"...
import click from arrow.cli import pass_context from arrow.decorators import custom_exception, dict_output @click.command('addKey') @click.argument("key") @click.option( "--metadata", help="" ) @pass_context @custom_exception @dict_output def cli(ctx, key, metadata=""): """TODO: Undocumented Output: ...
{ "content_hash": "5b6b01f99233d3bd51d2597c521bcf3e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 59, "avg_line_length": 17.863636363636363, "alnum_prop": 0.6895674300254453, "repo_name": "erasche/python-apollo", "id": "8d2844b11d3e77a754e18a929ea9f60ed42edaf8", "size":...
from thrift.Thrift import TType, TMessageType, TException, TApplicationException import sentry_common_service.ttypes import sentry_policy_service.ttypes from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = N...
{ "content_hash": "6bc0ab04e72d28677e705128a8798db0", "timestamp": "", "source": "github", "line_count": 3055, "max_line_length": 188, "avg_line_length": 34.732896890343696, "alnum_prop": 0.6424525723548427, "repo_name": "jayceyxc/hue", "id": "b728d50c16b461165b5fd50bdb3e6be013123761", "size": "1062...
import json from google.cloud import pubsub_v1 class PubsubApiService(object): """This class handles retrieving and verifying pubsub messages""" project = '' subscription = '' messages = None def __init__(self, credentials): """Construct a PubsubApiService instance. Args: credentials: A jso...
{ "content_hash": "6853b81e3ea5d918b35bd28828bbcf92", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 73, "avg_line_length": 31.966101694915253, "alnum_prop": 0.6484623541887593, "repo_name": "chromium/chromium", "id": "639071d37bd63be819616d7e596f9ef7e0cc6e03", "size": "20...
import argparse import zmq def run(args): ctx = zmq.Context() dealer = ctx.socket(zmq.DEALER) router = ctx.socket(zmq.ROUTER) if args.sp == args.cp: print 'ERROR: service port must be different from client port' return dealer.bind('tcp://*:%s' % args.sp) router.bind('tcp://*:...
{ "content_hash": "8196dae93d87577444fd0e2288820615", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 77, "avg_line_length": 24.310344827586206, "alnum_prop": 0.5985815602836879, "repo_name": "disenone/zsync", "id": "3fdd1d45de5c7a2598baf8ffb5f473648a559cf5", "size": "730",...