text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function import optparse import lldb import re import shlex # Print the frame number, pc, frame pointer, module UUID and function name # Returns the SBModule that contains the PC, if it could be found def backtrace_print_frame(target, frame_num, addr, fp): process = target.GetProces...
{ "content_hash": "40edba7b48804d5069fa2b760269b5cb", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 174, "avg_line_length": 44.86644951140065, "alnum_prop": 0.48874691447655, "repo_name": "endlessm/chromium-browser", "id": "db3ff1952f33585bacade73ce9e0c9a2eaebde39", "siz...
"""Tests for the compute extra resources framework.""" from oslo.config import cfg from stevedore import extension from stevedore import named from nova.compute import resources from nova.compute.resources import base from nova.compute.resources import vcpu from nova import context from nova.objects import flavor as...
{ "content_hash": "a02da68f6bf7b87708e6f73c1ac7a8e2", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 79, "avg_line_length": 32.85670731707317, "alnum_prop": 0.6061983854504964, "repo_name": "mgagne/nova", "id": "bf3d6349833a4d6da144176a750d28587946b9dd", "size": "11438", ...
import pytest import asyncio import vaex.jupyter.utils vaex.jupyter.utils._test_delay = 0.01 @pytest.fixture() def flush_guard(): assert not vaex.jupyter.utils._debounced_execute_queue, "oops, stuff was left in the queue" yield assert not vaex.jupyter.utils._debounced_execute_queue, "oops, stuff was left...
{ "content_hash": "dfa6d039465190f56f81603fdb07496d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 137, "avg_line_length": 26.513513513513512, "alnum_prop": 0.6880733944954128, "repo_name": "maartenbreddels/vaex", "id": "9a2357bbd2f15e5e36cd6c687bee96e29e99fbfd", "size":...
from alembic import op import sqlalchemy as sa """Add Port Profile delete table for UCSM plugin Revision ID: 203b495958cf Revises: b29f1026b281 Create Date: 2017-01-03 16:25:03.426346 """ # revision identifiers, used by Alembic. revision = '203b495958cf' down_revision = 'b29f1026b281' def upgrade(): op.creat...
{ "content_hash": "bc9ef8417e253b8623d9906c4d960266", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 70, "avg_line_length": 24.652173913043477, "alnum_prop": 0.708994708994709, "repo_name": "noironetworks/networking-cisco", "id": "f9e1f2f7d97034b90133205e7fb16068d41f4812", ...
import os import math import unittest import IECore import IECoreScene import imath class TestTriangulateOp( unittest.TestCase ) : def testSimple( self ) : """ Test TriangulateOp with a single polygon""" verticesPerFace = IECore.IntVectorData() verticesPerFace.append( 4 ) vertexIds = IECore.IntVectorData...
{ "content_hash": "abb7bddb252e1de2eec7b925146bdd34", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 183, "avg_line_length": 28.889273356401382, "alnum_prop": 0.6840340160498263, "repo_name": "appleseedhq/cortex", "id": "cff83a44a40ae7d8fbd5e8c523053ee2dfdd61e7", "size": ...
import httplib2 from apiclient import discovery, errors from rest_framework.viewsets import ViewSet from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework import status from csp import settings from crowdsourcing import models from apiclient.http import ...
{ "content_hash": "9c6a8a5f691f6f667c49176744bd286f", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 119, "avg_line_length": 40.08071748878924, "alnum_prop": 0.5883866636831506, "repo_name": "shirishgoyal/crowdsource-platform", "id": "d635e78a3a28894d921abe370a62bd27277ec4c...
""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.page import Page cl...
{ "content_hash": "53ba91804e62fb55d3bc8392d9c716c8", "timestamp": "", "source": "github", "line_count": 423, "max_line_length": 119, "avg_line_length": 38.22458628841608, "alnum_prop": 0.6117261426185912, "repo_name": "angadpc/Alexa-Project-", "id": "dd260f701aabb543b1cf460c0daa4c1d34a35761", "size...
from setuptools import setup import os import sys on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if on_rtd: if sys.version_info < (3,3): requires = ['mock'] # for python2 and python < 3.3 else: requires = [] # for >= python3.3 else: # Place install_requires into the text file "re...
{ "content_hash": "8c2779b9a851c5cf53843792106590a5", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 30.84, "alnum_prop": 0.62905317769131, "repo_name": "jrising/computer", "id": "62669192bb5e6848f00d7edbca681f5c42f00033", "size": "771", "binary": ...
from Queue import Queue from threading import _Event, Thread from urlparse import urlparse from functools import partial from socketIO_client import SocketIO, SocketIONamespace, EngineIONamespace from exceptions import HeimdallrClientException from utils import timestamp, for_own_methods, on_ready from settings import...
{ "content_hash": "c1357c0580f28fcc23691a5606eebcb2", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 78, "avg_line_length": 30.94776119402985, "alnum_prop": 0.5775862068965517, "repo_name": "ElementRobot/py-heimdallr-client", "id": "5c94f39e8ab9a11719332ed96050488fd831080a"...
""" Class for doing model selection for BNMF, minimising the BIC, AIC, or MSE. We expect the following arguments: - classifier - a class for BNMF, with methods: __init__(R,M,K,priors), initialise(initUV), run(iterations), quality(me...
{ "content_hash": "4f07d2c6825a23e92a63359c9be10a7b", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 91, "avg_line_length": 41.87640449438202, "alnum_prop": 0.567748859672659, "repo_name": "ThomasBrouwer/BNMTF", "id": "22d23e1a78daa3c09758174956d8a0d6c52415a2", "size": "37...
from storm.locals import * from mdcorpus.orm import * from mdcorpus.parser import * parser = Parser() f = open("sample_raw_script_urls.txt") line = f.readline() while line: print "=== parse this line ===" print line list = parser.raw_script_urls(line) script_url = RawScriptUrl(list[-1]) print scri...
{ "content_hash": "6c814ef43f0d9795871a7d4bc2acb73d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 39, "avg_line_length": 20.944444444444443, "alnum_prop": 0.6578249336870027, "repo_name": "sosuke-k/cornel-movie-dialogs-corpus-storm", "id": "ba45f34e58d11b0ef63ac32bbb25f50...
ogp_types = {} def ogp_type(cls): type = cls.__name__.lower() ogp_types[type] = cls() return cls class OGP: def __init__(self, doc): self.doc = doc self.prefixes = [] og = doc.meta.namespaces.get('og') if og: type = og.get('type') if type: ...
{ "content_hash": "c205afd2912c6ac43aedbc52419b5d67", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 72, "avg_line_length": 26.76, "alnum_prop": 0.5115844544095666, "repo_name": "quantmind/lux", "id": "ab9b3f50aaf6fca151ff7827d3c24668c1bcad6a", "size": "2677", "binary":...
"""Binary to run Stable Baselines 3 agents on meltingpot substrates.""" import gym import stable_baselines3 from stable_baselines3.common import callbacks from stable_baselines3.common import torch_layers from stable_baselines3.common import vec_env import supersuit as ss import torch from torch import nn import torch...
{ "content_hash": "80601800445787b43c859ee1e31e19a5", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 80, "avg_line_length": 32.53488372093023, "alnum_prop": 0.6561829878484632, "repo_name": "deepmind/meltingpot", "id": "8f5d56e7347cf1b503cd3c61f335bf9d1ceed18a", "size": "...
"""Removed unused files.""" import os PROJECT_DIRECTORY = os.path.realpath(os.path.curdir) def remove_file(file_name): """Remove file.""" if os.path.exists(file_name): os.remove(file_name) if '{{ cookiecutter.use_travis }}'.lower() != 'y': remove_file(os.path.join(PROJECT_DIRECTORY, '.travis.yml...
{ "content_hash": "202d416f95feeea8c8029e3694dfc637", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 63, "avg_line_length": 28, "alnum_prop": 0.6540178571428571, "repo_name": "inventivehack/cookiecutter-django-ihk", "id": "678b05b92f464825d47a2e28871a74cc5b1b1344", "size":...
from __future__ import division import os import shelve import logging from collections import OrderedDict from datetime import datetime from copy import copy from pymongo import MongoClient, ASCENDING from pymongo.errors import ConnectionFailure from vnpy.event import Event from vnpy.trader.vtGlobal import globalSe...
{ "content_hash": "f18e57b861a645f34d5670e514562197", "timestamp": "", "source": "github", "line_count": 1069, "max_line_length": 123, "avg_line_length": 35.43966323666979, "alnum_prop": 0.44104526857595355, "repo_name": "wisfern/vnpy", "id": "86168da35eca739d9e96d7f4a0a3c3b6b54fef83", "size": "4079...
from apps.base.views import BaseView from contracts.story import STORY_ID from apps.base.views import _base_request from logics.story.logic import StoryServiceAgent from apps.story.mappers import (GetStoryRequestSchema, GetStoryResponseSchema, DetailStoryRequestSchema, DetailStoryRespons...
{ "content_hash": "61f06df96023566a6c8f192ae7b79d92", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 84, "avg_line_length": 47.72, "alnum_prop": 0.5456831517183571, "repo_name": "tuanquanghpvn/rest_exam", "id": "c5b92c19ca1be50652e77321a31e53241a97050e", "size": "2386", ...
import time import globus_sdk from globus_cli.login_manager import ( LoginManager, get_client_login, internal_auth_client, is_client_login, token_storage_adapter, ) from globus_cli.parsing import command from globus_cli.termio import display, print_command_hint @command( "show", short_he...
{ "content_hash": "be555636264b5f8f95edeb0671b0e6d6", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 87, "avg_line_length": 30.04950495049505, "alnum_prop": 0.6494233937397035, "repo_name": "globus/globus-cli", "id": "769ac1fc4b6ccc1b25136926ba0f98e2b94be4cf", "size": "30...
"""SCons.Tool.hplink Tool-specific initialization for the HP linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation...
{ "content_hash": "932843c70ba6d57ab3f621951ec0ea45", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 89, "avg_line_length": 32.014084507042256, "alnum_prop": 0.7232732072151342, "repo_name": "amyvmiwei/chromium", "id": "da04010122edd3b2500250ad6add54b548af65c2", "size": "2...
""" tests a test set of data using a specified, pre0trained model and weights """ from __future__ import absolute_import, division, print_function from ibeis_cnn import utils import utool as ut import six # NOQA print, rrr, profile = ut.inject2(__name__, '[ibeis_cnn.test]') def test(data_fpath, model, weights_fpath,...
{ "content_hash": "6d297caa37b14051544f091ba55562ba", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 92, "avg_line_length": 29.82089552238806, "alnum_prop": 0.591091091091091, "repo_name": "bluemellophone/ibeis_cnn", "id": "74a2f1bb7dbb74776f65ca9135c0e0d26cd2c6ea", "size"...
import os import unittest from nose.plugins.attrib import attr from mi.core.log import get_logger from mi.dataset.dataset_driver import ParticleDataHandler from mi.dataset.driver.velpt_ab.dcl.resource import RESOURCE_PATH from mi.dataset.driver.velpt_ab.dcl.velpt_ab_dcl_recovered_driver import parse __author__ = 'Joe...
{ "content_hash": "7de986e256521c56063120b55ce504c6", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 84, "avg_line_length": 28.393939393939394, "alnum_prop": 0.7075773745997865, "repo_name": "petercable/mi-dataset", "id": "253eb9592c31dc62afd36b0a56773e10d462957d", "size":...
from azure.identity import DefaultAzureCredential from azure.mgmt.apimanagement import ApiManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-apimanagement # USAGE python api_management_delete_api_diagnostic.py Before run the sample, please set the values of the clie...
{ "content_hash": "1879f712a214f0749efeb001956873d6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 155, "avg_line_length": 33.52777777777778, "alnum_prop": 0.7257663628831814, "repo_name": "Azure/azure-sdk-for-python", "id": "fed262e8b393ab4251c160f1bcc1fb83ec7afdc6", "s...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'pagepermission' db.delete_table('pages_pagepermission') def backwards(self, orm): #...
{ "content_hash": "e259a440d8d30f47773b93ddb5e47c23", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 182, "avg_line_length": 71.98, "alnum_prop": 0.5543206446235065, "repo_name": "pombredanne/django-page-cms-1", "id": "174f299cbd6ad8692c6badd51a50c2ffa8e4279d", "size": "7...
from .config import get_config from .models import IssueThread from .utils import bugzilla_login, get_bugzilla_bug, validate_list class Migrator: def __init__(self, config_path): self.conf = get_config(config_path) def migrate(self, bug_list): """ Migrate a list of bug ids from Bugzil...
{ "content_hash": "50a1bccd1f2d9ce94b5f67960802ad57", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 80, "avg_line_length": 33.370370370370374, "alnum_prop": 0.6293007769145395, "repo_name": "xmun0x/bugzilla2gitlab", "id": "b1e565be887e6ff03724b4bfbb511ca607567475", "size"...
from neutron_lib.db import constants as db_const from neutron_lib.db import model_base import sqlalchemy as sa class AddressScope(model_base.BASEV2, model_base.HasId, model_base.HasProject): """Represents a neutron address scope.""" __tablename__ = "address_scopes" name = sa.Column(sa.String(db_const.NA...
{ "content_hash": "b038fcf0b4eef0714e50b86595180ec2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 35.38461538461539, "alnum_prop": 0.7304347826086957, "repo_name": "noironetworks/neutron", "id": "e3f08e668ef1403c01caf0b9d4e22d9858ebdddb", "size": ...
import os import sys root_dir = os.path.join('/', 'home', 'igor', 'Projects', 'python', 'forum') os.chdir(root_dir) sys.path.append(root_dir) import functools import json import logging import threading import tornado.web import tornado.gen import tornado.ioloop from tornado.options import define, options from api...
{ "content_hash": "b48be6361a32849d7eb26aa89c1c75fb", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 88, "avg_line_length": 24.016, "alnum_prop": 0.6242504996668887, "repo_name": "igorcoding/forum-api", "id": "3f6e1da16f8296e2c89c461d783f3bfc9d9a8b08", "size": "3020", "...
from ._phone_numbers_client import PhoneNumbersClient try: from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import except ImportError: _patch_all = [] from ._patch import patch_sdk as _patch_sdk __all__ = ["PhoneNumbersClient"] __all__.exten...
{ "content_hash": "2908c2e64a7439279d95bc600509d772", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 29.307692307692307, "alnum_prop": 0.6745406824146981, "repo_name": "Azure/azure-sdk-for-python", "id": "962219d02796e6e45567842cebad432abd90ab1a", "s...
"""Tests for parallel client.py Authors: * Min RK """ #------------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this soft...
{ "content_hash": "5d7909d047145d1dc3a1d7a272ae34bc", "timestamp": "", "source": "github", "line_count": 555, "max_line_length": 113, "avg_line_length": 37.14054054054054, "alnum_prop": 0.56173288701305, "repo_name": "EricCline/CEM_inc", "id": "06aefd303b480b525708d27fd38cac0021c37054", "size": "206...
"""Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable name...
{ "content_hash": "0a495a5749afbf13565ecafcd59208f0", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 88, "avg_line_length": 32.89579524680073, "alnum_prop": 0.5689674335889741, "repo_name": "csdms/bmi-python", "id": "4cfe5bf7c555eb6f4e9c330ea2ddb997b0cdd727", "size": "184...
from django.contrib import admin from solo.admin import SingletonModelAdmin from . import models admin.site.register(models.SiteConfiguration, SingletonModelAdmin)
{ "content_hash": "d373bc4af6f66fff61e69de65093d006", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 66, "avg_line_length": 33, "alnum_prop": 0.8545454545454545, "repo_name": "Arlefreak/ApiArlefreak", "id": "b7876eba61c0b0f2ddc5dff3b0a6c9a89b68a55b", "size": "165", "binar...
import popen2 import os def explainStatus(statusCode): signal = statusCode & 0xFF exitCode = statusCode >> 8 if signal == 0: return 'exit %d' % exitCode else: return 'signal %d' % signal repos = ['/etc', '/proc', '/var'] # launch 3 async calls: procs = [popen2.Popen3(r'ls -l %s > %s.lo...
{ "content_hash": "9aac68a7aacf3194c726a213441c5d5b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 92, "avg_line_length": 28.9, "alnum_prop": 0.629757785467128, "repo_name": "aclisp/large-scale", "id": "cc2142ed7b17ffb88a4add29ab24846a473d5b7e", "size": "601", "binary"...
"""ann.py: Experiments with neural networks""" import numpy as np from scipy import optimize # Whole Class with additions: class NeuralNetwork(object): def __init__(self): # Define Hyperparameters self.inputLayerSize = 2 self.outputLayerSize = 1 self.hiddenLayerSize = 2 #...
{ "content_hash": "38a21b8a8e1815ab48c44bb5d49d057f", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 77, "avg_line_length": 31.34710743801653, "alnum_prop": 0.5792248879514896, "repo_name": "DrigerG/IIITB-ML", "id": "41052c279ecb9ffa784fcc90094432117fe4519b", "size": "381...
class FixQueue(list) : def __init__(self, queue_size) : self.queue_size = queue_size print ("Initializing - FixQueue (Queue Size : %s) " % (self.queue_size)) def append(self, data) : list.append(self, data) if len(self) > self.queue_size : del self[0] def clear(self) : del self[:] def pop(self, inde...
{ "content_hash": "541ebcf5f518769a520255e35b271a8f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 74, "avg_line_length": 19.3, "alnum_prop": 0.6373056994818653, "repo_name": "minoku/FixQueue", "id": "2c9bfafa7a3ad08ecddc883cb297ab9cccb402e6", "size": "387", "binary": ...
""" None """ """ The read4 API is already defined for you. @param buf, a list of characters @return an integer def read4(buf): # Below is an example of how the read4 API can be called. file = File("abcdefghijk") # File is "abcdefghijk", initially file pointer (fp) points to 'a' buf = [' '] * 4 # Create...
{ "content_hash": "fbf8bd1e86407e0ea3c6d117f4923776", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 93, "avg_line_length": 28.525, "alnum_prop": 0.5205959684487291, "repo_name": "franklingu/leetcode-solutions", "id": "8798c606e9cab7902fb3c09ddfe39e7c4d8d9502", "size": "11...
""" raven.contrib.django.raven_compat.middleware.wsgi ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from raven.contrib.django.middleware.wsgi import * # NOQA
{ "content_hash": "3bfd2780b3b26c8e72fddefd2e916619", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 29.1, "alnum_prop": 0.6185567010309279, "repo_name": "collective/mr.poe", "id": "e8cb865edf45189571f95203a6902c96a47e9227", "size": "291", "binary"...
from __future__ import absolute_import # Local module from .structure import Chain, Atom from .PDB import PDB # Conditional import try: import MDAnalysis except ImportError: IS_MDANALYSIS = False else: IS_MDANALYSIS = True # Create the __all__ keyword according to the conditional import __all__ = ['chai...
{ "content_hash": "930e63af62188fa719470dd3e842835e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 64, "avg_line_length": 27.21153846153846, "alnum_prop": 0.6303886925795052, "repo_name": "jbarnoud/PBxplore", "id": "570523acf5f462dde78f16811bc5cf0f0c7f3ec5", "size": "146...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/intangible/pet/shared_malkloc_hue.iff" result.attribute_template_id = -1 result.stfName("","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "43eff905f6675612aefdb7f4a065ff24", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 65, "avg_line_length": 21.46153846153846, "alnum_prop": 0.6774193548387096, "repo_name": "obi-two/Rebelion", "id": "62faa4006940ce57a79561e06ea578c730ea30ba", "size": "424"...
from setuptools import setup setup( name="aiogremlin", version="0.1.0", url="", license="MIT", author="davebshow", author_email="davebshow@gmail.com", description="Python 3 driver for TP3 Gremlin Server built on Asyncio and aiohttp", long_description=open("README.txt").read(), pack...
{ "content_hash": "fe06a001be970101acd1040b9a32daf6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 86, "avg_line_length": 29.896551724137932, "alnum_prop": 0.5963091118800461, "repo_name": "platinummonkey/trolliusgremlin", "id": "57496da39ab1fa20f3e649c1ca8eb555b7e585ba", ...
"""Setup file for our unittest demo application""" from setuptools import setup if __name__ == "__main__": setup(use_scm_version={"version_scheme": "no-guess-dev"})
{ "content_hash": "9a1112d7b4245d943aaaca937d22adbe", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 61, "avg_line_length": 28.5, "alnum_prop": 0.6666666666666666, "repo_name": "blue-yonder/pyscaffold", "id": "53084423a135aabb6588bf0692e3029017bfbbb1", "size": "193", "bin...
import re import subprocess import time import sys from location import Location from measurement import ipsec_status, restart_ipsec from notifier import pusher from settings import PROWL_NOTIFY_API_KEYS, CHECK_INTERVAL, SENDGRID_API_KEY def check_settings(): try: assert len(PROWL_NOTIFY_API_KEYS) > 0, "...
{ "content_hash": "14b00d40e78c1b0ad047ddab58403570", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 113, "avg_line_length": 36.6283185840708, "alnum_prop": 0.5332205846822904, "repo_name": "rliebi/physio_vpn_checker", "id": "5ec65b9d29a2e8d3b7dc3fe71d9a8e4752b90b6f", "si...
from scapy.all import * import re import hashlib from termcolor import colored import os md5 = hashlib.md5 def get_packets(port, iface, count): packets = sniff(filter="port "+str(port)+"", count=count, iface=str(iface)) return packets def parse_packets(port, iface, count): packets="" packet="" user="" nonce=""...
{ "content_hash": "d77ba3372cecb4ec2d260dcab7d6df0a", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 87, "avg_line_length": 27.063492063492063, "alnum_prop": 0.6205278592375366, "repo_name": "torque59/Nosql-Exploitation-Framework", "id": "a76eaedd89a32a472bb6b5a2ea0562b41e68...
__author__ = 'liam' from flask_login import UserMixin from flask import session from .. import db from ..helpers.google_helper import get_plus_profile class User(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) google_id = db.Column(db.Unicode(40), nullable=True) google_data = db.Column...
{ "content_hash": "f8dbf65b842419379af3bcae5ad9e9b3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 56, "avg_line_length": 27.416666666666668, "alnum_prop": 0.601823708206687, "repo_name": "OldGermanTrick/oldgermantrick", "id": "a50b34dec1557186336c0447400e2a6fb8dcaa38", ...
""" Corpus loading worker --------------------- """ from __future__ import annotations import multiprocessing as mp import os from queue import Empty, Queue from typing import Dict, Optional, Union import sqlalchemy import sqlalchemy.engine from sqlalchemy.orm import Session from montreal_forced_aligner.corpus.class...
{ "content_hash": "9bb2e3749c0b0cef54f689f02006dde2", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 124, "avg_line_length": 36.94444444444444, "alnum_prop": 0.5499132446500867, "repo_name": "MontrealCorpusTools/Montreal-Forced-Aligner", "id": "c878121d7af0dd6b5268bd7e6c90f...
import json from redact.model import dump from redact.model import load from redact.model import save from redact.db import get_redis_conn from fixtures import model from fixtures import saved_model from fixtures import TestModel from fixtures import TestMigratedModel from fixtures import TestRemoteModel ### Tests ...
{ "content_hash": "10f23531fab07ca6e9ee1521dbafad8f", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 81, "avg_line_length": 37.945205479452056, "alnum_prop": 0.7090252707581227, "repo_name": "df3n5/redact-py", "id": "c1c0ee35d7d48659b44d7686f7996eb3f2353742", "size": "2770...
from django.core.management.base import BaseCommand from app.models import Forwarding import datetime class Command(BaseCommand): help = "Trigger IPtables retention." def add_arguments(self, parser): parser.add_argument('tunnel', nargs='*', type=int) parser.add_argument('--time', default=(60...
{ "content_hash": "6b77a53ffd620273386290a26124de3a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 32.041666666666664, "alnum_prop": 0.599479843953186, "repo_name": "dimrozakis/vpn-proxy", "id": "323016df9d1a6b648193cc01e1677db8c5a8afc2", "size": "...
import io from PIL import Image import nose.tools as nt from datadog.util.compat import url_lib # For Python3 compat try: xrange except NameError: xrange = range def read_image_as_raster(img_url): """ Reads image data from URL in raster format.""" img = url_lib.urlopen(img_url) image_file = io....
{ "content_hash": "5330b2ed79a803272d4c2df9b1305175", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 79, "avg_line_length": 29.674418604651162, "alnum_prop": 0.6261755485893417, "repo_name": "jofusa/datadogpy", "id": "33cc20d92aab4c1e37f12b4d970adf33b04bc34c", "size": "127...
from typing import Optional from antlr4.Token import CommonToken from cleo.styles import OutputStyle class SDocVisitor: """ Parent visitor for SDoc level 1 & 2. """ # ------------------------------------------------------------------------------------------------------------------ def __init__(s...
{ "content_hash": "98555aeaedeeded412f04e869eadf6bd", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 120, "avg_line_length": 33.407407407407405, "alnum_prop": 0.4229490022172949, "repo_name": "SDoc/py-sdoc", "id": "065cd3b233165573fb67c3575abbecee79e6781b", "size": "1925",...
""" Simulate the output from Pyneal Scanner During a real-time scan, Pyneal Scanner will send data to pyneal over a socket connection. Each transmission comes in 2 phases: first a json header with metadata about the volume, then the volume itself. This tool will emulate that same behavior You can either supply real 4...
{ "content_hash": "fe6f8f9911946fb3a60391bf52734059", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 92, "avg_line_length": 31.27358490566038, "alnum_prop": 0.5779788838612367, "repo_name": "jeffmacinnes/pyneal", "id": "85b09441b8cc7c777057d8b7e6b727691fa37d47", "size": "...
""" Lonely Planet Models """ from __future__ import absolute_import
{ "content_hash": "1a2e931e3a1aeac2b594215b6467ea69", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 17, "alnum_prop": 0.7058823529411765, "repo_name": "jricardo27/travelhelper", "id": "a73e55be645c8b5009c8ff58104f87daf5b3ccba", "size": "68", "binar...
{% block meta %} name: ReadTopicState description: SMACH state that reads data from a ROS topic. language: Python framework: SMACH type: State tags: [core] includes: [] extends: - WaitForMsgState variables: - input_keys: description: Other than the 'topic' input_key, which specifies the topic to be read, ...
{ "content_hash": "82edde205aa0f7abad0d5d2decf62081", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 148, "avg_line_length": 35.8962962962963, "alnum_prop": 0.6246388774246802, "repo_name": "ReconCell/smacha", "id": "ab33d1124c91c1d8c6cca637161e169d203359e8", "size": "484...
from __future__ import print_function import os import sys import tempfile import numpy as np import tables from tables import ( StringCol, BoolCol, FloatCol, ComplexCol, EnumCol, Int8Col, UInt8Col, Int16Col, UInt16Col, Int32Col, UInt32Col, Int64Col, Float32Col, Float64Col, Time64Col ) from tables.tests i...
{ "content_hash": "8c4e9e05f13c824c5f5cc390f5d31558", "timestamp": "", "source": "github", "line_count": 1407, "max_line_length": 79, "avg_line_length": 36.42786069651741, "alnum_prop": 0.5587661450813595, "repo_name": "jack-pappas/PyTables", "id": "68646870ece478ecdb51f37614c331b0206bda7a", "size":...
from __future__ import absolute_import from mock import patch from hashlib import sha1 from django.core.urlresolvers import reverse from django.core.files.base import ContentFile from sentry.models import ApiToken, FileBlob, File, FileBlobIndex, FileBlobOwner from sentry.models.debugfile import ProjectDebugFile from...
{ "content_hash": "1bd2a6ed596516385e7499728f296994", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 100, "avg_line_length": 39.97551020408163, "alnum_prop": 0.6197672044108637, "repo_name": "mvaled/sentry", "id": "27f65e2063d9517192cde9750f2a343606e9d2e7", "size": "9794"...
import math import MIDI from Control import Control, ignore_cc_zero from mappings import mappings class GlobalControl(Control): def __init__(self, c_instance, selected_track_controller): Control.__init__(self, c_instance, selected_track_controller) self.show_message('Global controls initialized') ...
{ "content_hash": "0d4f9355c3a6a73141277f4539419f45", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 106, "avg_line_length": 38.282051282051285, "alnum_prop": 0.5841546263515454, "repo_name": "nandordevai/MPD218_TotalControl", "id": "a7fd78103e9664c6eb3a9c0d9c744f627a4501d4...
""" Decorators which can be used for validating arguments passed into decorated functions """ from functools import wraps from inspect import signature def non_empty(*parameter_names): """ Enforces arguments to parameters passed in have len > 0 """ def _decorator(f): sig = signature(f) ...
{ "content_hash": "272e16b648c2f80dcd01936712aee936", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 85, "avg_line_length": 28.870967741935484, "alnum_prop": 0.5586592178770949, "repo_name": "econ-ark/HARK", "id": "792832abc180b3dc364c6e2d82b55e67d6a647b5", "size": "895", ...
"""Perform ensemble calling of structural variants using MetaSV. https://github.com/chapmanb/metasv http://dx.doi.org/10.1093/bioinformatics/btv204 """ import os import sys from bcbio import utils from bcbio.provenance import do from bcbio.pipeline import datadict as dd from bcbio.structural import shared from bcbio....
{ "content_hash": "506fdc20cd3b6c6275d706b5de842dea", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 108, "avg_line_length": 50.293103448275865, "alnum_prop": 0.5779910867329449, "repo_name": "lpantano/bcbio-nextgen", "id": "95ce143db71ab609a825a6ee5f8a1a0c94e04dda", "size...
import string import os import numpy from scipy import io as spio # This code is from: # http://stackoverflow.com/questions/7008608/ # scipy-io-loadmat-nested-structures-i-e-dictionaries def loadmat(filename): '''This function should be called instead of direct spio.loadmat as it cures the problem of not prop...
{ "content_hash": "5a0e4f331af07c2b670bf42cfff5c3bf", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 78, "avg_line_length": 32.01851851851852, "alnum_prop": 0.6460381723539619, "repo_name": "google/makani", "id": "b4c89df5a822cd4239ca09aa0d45a55362e205bf", "size": "2337", ...
from JumpScale.clients.racktivity.energyswitch.modelfactory.models.common.Power_0_0_5_29 import Model as ModelClass class Model(ModelClass): pass
{ "content_hash": "90acd304af908f55b0253054a5120e28", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 115, "avg_line_length": 30.4, "alnum_prop": 0.8092105263157895, "repo_name": "Jumpscale/jumpscale_core8", "id": "2e062511f1e3233b2b6a3da354bec4f4038a76e0", "size": "152", ...
from io import BytesIO import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw def text_to_png(text, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 500): REPLACEMENT_CHARACTER = 'nlnlnl' NEWLINE_REPLACEMENT_STRING = ' ' +...
{ "content_hash": "f63fd327098c7f57c9f7026f2a937611", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 140, "avg_line_length": 30.88679245283019, "alnum_prop": 0.6707391569945022, "repo_name": "fake-name/ReadableWebProxy", "id": "46d2d755b3b9f9fe6899241d6abf9092c8a75b10", "s...
from __future__ import annotations import ast import os from collections import defaultdict from functools import lru_cache from pathlib import Path from typing import NamedTuple from jinja2 import BaseLoader, Environment from rich.console import Console if __name__ not in ("__main__", "__mp_main__"): raise Syst...
{ "content_hash": "e146f65435dbb908bc34bab13170e2cb", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 110, "avg_line_length": 37.766169154228855, "alnum_prop": 0.6693452773020683, "repo_name": "cfei18/incubator-airflow", "id": "8fbe8290a3882ccf953d2297e2b50c1daf1ceb6a", "s...
""" DailyMotion OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/dailymotion.html """ from .oauth import BaseOAuth2 class DailymotionOAuth2(BaseOAuth2): """Dailymotion OAuth authentication backend""" name = 'dailymotion' EXTRA_DATA = [('id', 'id')] ID_KEY = 'us...
{ "content_hash": "5e54b8467dbbee69703c3ed6e7abf2d0", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 81, "avg_line_length": 37.166666666666664, "alnum_prop": 0.6603139013452914, "repo_name": "tobias47n9e/social-core", "id": "8f908bef3bc5d2c2a558d2ad07e7b2b26a099a85", "size...
import json import os import unittest from datetime import timedelta import openprocurement.tender.twostage.tests.base as base_test from openprocurement.api.models import get_now from openprocurement.api.tests.base import PrefixedRequestClass from openprocurement.tender.twostage.tests.tender import BaseTenderWebTest f...
{ "content_hash": "91730f182087ea4c138c09cd71f2bb12", "timestamp": "", "source": "github", "line_count": 1621, "max_line_length": 218, "avg_line_length": 52.69956816779766, "alnum_prop": 0.5818369114789408, "repo_name": "rialto-px/openprocurement.tender.twostage", "id": "3c1d6d98693e97fb9512c794afc79e...
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='classdirectory', ver...
{ "content_hash": "c4627138399d0e651f6dbeff23c8c589", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 32.25, "alnum_prop": 0.6346899224806202, "repo_name": "bsdlp/classdirectory", "id": "19942877a03d76d6f264f10cf4057eeec74e3f6f", "size": "1055", "bi...
from datetime import datetime, timedelta from django.contrib.auth.models import User from models import (Node, Subject, Period, Assignment, AssignmentGroup, Candidate, Deadline, Delivery, StaticFeedback, FileMeta) from deliverystore import MemoryDeliveryStore from django.core.exceptions import Valid...
{ "content_hash": "1e0bf0b1071e5bafafae429f01b8210a", "timestamp": "", "source": "github", "line_count": 797, "max_line_length": 125, "avg_line_length": 40.10288582183187, "alnum_prop": 0.5913272010512484, "repo_name": "vegarang/devilry-django", "id": "f663407636ad79968c015e49069f32c1f3d420be", "siz...
"""Module for shared interface of every model server runners.""" import abc from typing import Optional class BaseModelServerRunner(abc.ABC): """Shared interface of all model server runners. Model server runner is responsible for managing the model server job and relevant resources in the serving platform. Fo...
{ "content_hash": "9bc392ea79c4109bbb65dc919e72abae", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 80, "avg_line_length": 38.234375, "alnum_prop": 0.6653044544340008, "repo_name": "tensorflow/tfx", "id": "ea5ed1aefbc0e1a491bcdf5c7e78f999a4375dbf", "size": "5490", "bin...
import logging import json from typing import NamedTuple, Optional from urllib.parse import urlunsplit import six from blinkpy.common.memoized import memoized from blinkpy.common.net.luci_auth import LuciAuth _log = logging.getLogger(__name__) # These characters always appear at the beginning of the RPC response. R...
{ "content_hash": "f63c3272cb5df9f21e68628c8fce5de6", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 136, "avg_line_length": 37.70397111913358, "alnum_prop": 0.5465338950593642, "repo_name": "nwjs/chromium.src", "id": "421672bddb1cc1c2638ac95f40d8bdcf6df7c67f", "size": "1...
import os from django.conf.urls import url from . import views from . import plugins from .utils import plugin_urlpatterns DUMMY_OBSCURE_URL = 'this_should_be_in_env_var' OBSCURE_URL = os.environ.get('OBSCURE_URL', DUMMY_OBSCURE_URL) DIGITA_URL = os.environ.get('DIGITA_URL', DUMMY_OBSCURE_URL) SENTILO_URL = os.environ...
{ "content_hash": "3789e90213dec605cc0a9f48933d10ed", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 94, "avg_line_length": 44.064516129032256, "alnum_prop": 0.7254758418740849, "repo_name": "aapris/IoT-Web-Experiments", "id": "71b54707c497f3455b259a5cc70fa4ec67b9501d", "s...
"""Description Usage: dx_skel.py () [--engine <identifier> | --all] [--debug] [--parallel <n>] [--poll <n>] [--config <path_to_file>] [--logdir <path_to_file>] dx_skel.py -h | --help | -v | --version Description Examples: Options: --engine <type> ...
{ "content_hash": "74740273c9e82c0d931a48cea43c4461", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 80, "avg_line_length": 35.79333333333334, "alnum_prop": 0.5569938536040231, "repo_name": "mcbrune/delphixpy-automation", "id": "521605296919413b77281370218baa95a278fdba", ...
""" recipe_custom_ps.py Template with sample code creating for custom Postscript PS files. Sample code is a business card based on Levenger's personalized 3x5 card. Ghostscript provides easiest way to view PS output, but not essential. Utilities included. Download Ghostscript: http://www.ghostscript.com/download/gsd...
{ "content_hash": "8f1c483f47f7e2a832a77fb3236e1a78", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 82, "avg_line_length": 27.19889502762431, "alnum_prop": 0.5621572212065814, "repo_name": "ActiveState/code", "id": "deca16c036a44334841dc8651185110361957b61", "size": "984...
from msrest.serialization import Model class NextHopResult(Model): """The information about next hop from the specified VM. :param next_hop_type: Next hop type. Possible values include: 'Internet', 'VirtualAppliance', 'VirtualNetworkGateway', 'VnetLocal', 'HyperNetGateway', 'None' :type next_ho...
{ "content_hash": "a08d5f3705644ab62137d36bd9426f44", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 90, "avg_line_length": 41.483870967741936, "alnum_prop": 0.661741835147745, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "645ae73c45193a76a70ef822e89b726efe2b7286", ...
"""This example displays all available content categories. Tags: contentCategories.list """ __author__ = ('api.jimper@gmail.com (Jonathon Imperiosi)') import argparse import sys from apiclient import sample_tools from oauth2client import client # Declare command-line flags. argparser = argparse.ArgumentParser(add_...
{ "content_hash": "98a2462cdb5330088de378316513bb78", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 29, "alnum_prop": 0.6811971372804164, "repo_name": "vanant/googleads-dfa-reporting-samples", "id": "49bc8730adc882d0417850298bcac447dc68dc02", "size"...
import numpy as np import itertools from gym import Env from gym.spaces import Box from gym.spaces import Discrete from collections import deque class ProxyEnv(Env): def __init__(self, wrapped_env): self._wrapped_env = wrapped_env self.action_space = self._wrapped_env.action_space self.ob...
{ "content_hash": "104751587cd230695f47dc7c05e7b325", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 77, "avg_line_length": 32.680473372781066, "alnum_prop": 0.585732391816042, "repo_name": "vitchyr/rlkit", "id": "ba83fe95cb66fdcdc8d209d69688052784225e87", "size": "5523",...
import logging import os import time from typing import Optional import unittest from slack_sdk.web.slack_response import SlackResponse from slack_sdk.errors import SlackApiError from integration_tests.env_variable_names import ( SLACK_SDK_TEST_CONNECT_INVITE_SENDER_BOT_TOKEN, SLACK_SDK_TEST_CONNECT_INVITE_REC...
{ "content_hash": "dfca7d8c075517ee2a80ee86ef43b556", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 108, "avg_line_length": 42.541666666666664, "alnum_prop": 0.6297747306562194, "repo_name": "slackapi/python-slackclient", "id": "740b7201afd1d3addab4f2dfa94f5793fce2b2ad", ...
from gtd.utils import cached_property from strongsup.executor import Executor, Denotation from strongsup.rlong.value import RLongStateValue from strongsup.rlong.state import RLongObject ################################ # Denotation class RLongDenotation(tuple, Denotation): """A pretty lightweight class represen...
{ "content_hash": "ade68966cc8100ca84d35e36ee372a76", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 94, "avg_line_length": 39.645933014354064, "alnum_prop": 0.5806179097272508, "repo_name": "kelvinguu/lang2program", "id": "19b9a65e4dce0757b670b94f952c772c49ba4cea", "size...
import glob import sys from pythonwarrior.units.base import UnitBase from pythonwarrior.units.golem import Golem class Warrior(UnitBase): def __init__(self, level=None): super(Warrior, self).__init__() self.level = level self.player_attr = None self.name_attr = None self....
{ "content_hash": "83d9fca184857bc5ada78a4a1ff3bafb", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 62, "avg_line_length": 23.92105263157895, "alnum_prop": 0.5737073707370737, "repo_name": "arbylee/python-warrior", "id": "ddb958f708b095de85a71e897a06b9d49c124f9d", "size":...
from riskytt import RiskyTT from charm.toolbox.pairinggroup import PairingGroup,GT,G1,G2,pair import util import random import time from multiprocessing.dummy import Pool as ThreadPool def avg_measurement(n, m, num_threads, measure, fn, rand_args): pool = ThreadPool(num_threads) f = lambda x: measure(fn, *(ra...
{ "content_hash": "8a8640552bbeb7c75c1e075fdd3312dd", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 116, "avg_line_length": 27.47826086956522, "alnum_prop": 0.5882120253164557, "repo_name": "ahrussell/riskytraitortracing", "id": "ceb5391978d37a79cff168f2de4ff54574eb4cba", ...
"""Diagnostics support for Coinbase.""" from homeassistant.components.diagnostics import async_redact_data from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY, CONF_API_TOKEN, CONF_ID from homeassistant.core import HomeAssistant from . import CoinbaseData from .const impo...
{ "content_hash": "558e582d2081534ebefbc8a6f9fbd25b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 26.818181818181817, "alnum_prop": 0.6915254237288135, "repo_name": "mezz64/home-assistant", "id": "54d4168776c52fbd2341c18902a80fcbac91eb5b", "size":...
from carrot.messaging import Consumer from conductor.task import Task __all__ = ["ConsumerTask"] class ConsumerTask(Task): def __init__(self, bus=None): Task.__init__(self, bus) def start(self): Task.start(self) start.priority = 12 def stop(self): Task.start(self) sto...
{ "content_hash": "56d1f350465b5def3344bd5912a6f357", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 68, "avg_line_length": 28, "alnum_prop": 0.6243386243386243, "repo_name": "Lawouach/conductor", "id": "c1ba0625e6755b8a2c53eead24a3e847bd14d2b8", "size": "780", "binary":...
import matplotlib.pyplot as plt import numpy as np import cv2 from utils.data_management import get_class_names from utils.preprocessing import substract_mean from utils.inference import detect from utils.inference import plot_detections class VideoDemo(object): def __init__(self, prior_boxes, dataset_name='VOC2...
{ "content_hash": "60cece068d4d639f02414a5bc6f8d6e1", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 38.61538461538461, "alnum_prop": 0.6151394422310758, "repo_name": "oarriaga/single_shot_multibox_detector", "id": "fc036e6cbbc1eb326aa502e2df63bfd262c8...
"""Create / interact with Google Cloud Translation connections.""" from google.cloud import _http from google.cloud.translate_v2 import __version__ _CLIENT_INFO = _http.CLIENT_INFO_TEMPLATE.format(__version__) class Connection(_http.JSONConnection): """A connection to Google Cloud Translation API via the JSON...
{ "content_hash": "ed1254a06ad9898489e181458cf9326c", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 30.275862068965516, "alnum_prop": 0.6799544419134397, "repo_name": "tartavull/google-cloud-python", "id": "dedb17ec9e14cdbfedc99b8653ebc2e56e033998", ...
"""Python wrapper for the Cloud Datastore emulator.""" __author__ = 'eddavisson@google.com (Ed Davisson)' import logging import os import shutil import socket import subprocess import tempfile import time import zipfile from googledatastore import connection import httplib2 import portpicker _DEFAULT_EMULATOR_OPT...
{ "content_hash": "f7fcea260a60dad9b328c87cc5bf6e49", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 80, "avg_line_length": 30.986175115207374, "alnum_prop": 0.6420285544318858, "repo_name": "eddavisson/google-cloud-datastore", "id": "4fe1b5e0aa17b7d3b1c07ec43aace23eb4f947e...
""" Hydrometeor Classification (HMC) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. autosummary:: :nosignatures: :toctree: generated/ {} """ __all__ = ["msf_index_indep", "trapezoid", "fuzzyfi", "probability", "classify"] __doc__ = __doc__.format("\n ".join(__all__)) import numpy as np pr_types = { 0: ("LR", "...
{ "content_hash": "a8a78477a900afb01dafd4e9d8de127a", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 88, "avg_line_length": 31.246231155778894, "alnum_prop": 0.5968156963653908, "repo_name": "wradlib/wradlib", "id": "a646887d21f0f75d0bb0d4d431a17b76052c1fe8", "size": "635...
"""Test Axis device.""" from copy import deepcopy from unittest import mock from unittest.mock import Mock, patch import axis as axislib from axis.event_stream import OPERATION_INITIALIZED import pytest import respx from homeassistant.components import axis, zeroconf from homeassistant.components.axis.const import ( ...
{ "content_hash": "3e84c341c8b6e5fe69e94c198ff4013c", "timestamp": "", "source": "github", "line_count": 519, "max_line_length": 245, "avg_line_length": 32.626204238921005, "alnum_prop": 0.6473749483257545, "repo_name": "rohitranjan1991/home-assistant", "id": "cca62babbb59d66fcc6c24ea31ab844977b7146d"...
from indy import ledger import json import pytest @pytest.mark.asyncio async def test_build_get_nym_request_works(): identifier = "Th7MpTaRZVRYnPiabds81Y" destination = "FYmoFw55GeQH7SRFa37dkx1d2dZ3zUF8ckg7wmL7ofN4" expected_response = { "identifier": identifier, "operation": { ...
{ "content_hash": "7e43747819d82146f19988ec79699ae2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 86, "avg_line_length": 25.285714285714285, "alnum_prop": 0.6685499058380414, "repo_name": "korsimoro/indy-sdk", "id": "369d55cbf2f156053c3c3edd826bf6ced3c6ce2e", "size": "5...
import ai import controllers import entities import ui import net import audio import particles import traceback from direct.showbase.DirectObject import DirectObject from pandac.PandaModules import * from direct.task import Task from direct.filter.CommonFilters import CommonFilters from direct.actor.Actor import Act...
{ "content_hash": "49ad52a508a2370051e326a0a6d6408d", "timestamp": "", "source": "github", "line_count": 1052, "max_line_length": 467, "avg_line_length": 35.70342205323194, "alnum_prop": 0.6960330138445154, "repo_name": "etodd/a3p", "id": "c7546d5760a12ba79c117162194ecfbe0546cdaa", "size": "37560", ...
import os, re, json from django.utils.encoding import smart_str from django.utils import six from protoExt.utils.utilsConvert import slugify2 def compare_dictionaries(dict1, dict2): """ Object (dict) comparaison """ # return 0 if x==y else (-1 if x<y else 1) if dict1 == None or dict2 == No...
{ "content_hash": "a345ca9a5e639efb807d085c8279988e", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 121, "avg_line_length": 24.68811881188119, "alnum_prop": 0.5658712652897534, "repo_name": "DarioGT/docker-carra", "id": "72d82c22c867a5db81b86fd808f7898ca781da93", "size":...
from django.core.exceptions import ImproperlyConfigured from django.shortcuts import render_to_response from django.template.context import RequestContext from django.http import HttpResponse from django.utils.encoding import smart_unicode import csv from cStringIO import StringIO from xml.etree import ElementTree as E...
{ "content_hash": "de3f3c7ccbc260ad15c41931493fc69c", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 99, "avg_line_length": 37.34027777777778, "alnum_prop": 0.6440394271898828, "repo_name": "dmpayton/django-reportengine", "id": "a3258c0a38413de1f89387ee512459f54a3582d1", ...
from __future__ import absolute_import from mock import Mock, patch from sentry.models import EventTag, TagKey, TagValue from sentry.testutils import TestCase from sentry.tasks.merge import merge_group from sentry.tasks.post_process import index_event_tags, post_process_group class PostProcessGroupTest(TestCase): ...
{ "content_hash": "a8376139e2141a3e8920aa25e91e9021", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 74, "avg_line_length": 29.875, "alnum_prop": 0.5690376569037657, "repo_name": "mitsuhiko/sentry", "id": "f649c898c66fd737100f5a02127270c0f8023935", "size": "3610", "bina...
"""Real NVP bijector.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import constant_op from tensorflow.python.framework import ops from tensorflow.python.layers import core as layers from tensorflow.python.ops import ar...
{ "content_hash": "6a5cdc81b42d29235fc5f0dce184f41c", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 80, "avg_line_length": 40.07835820895522, "alnum_prop": 0.6692114328274835, "repo_name": "av8ramit/tensorflow", "id": "2840f52e742eac5e9e37a576bf7f6d6f05a07a35", "size": "...
''' Reads the automatically generated Hadoop pom file, removes the "optional" flag from dependencies so that they could be included transitively into other projects such as HBase, and removes certain dependencies that are not required and could even break the code (e.g. an old version of xerces). Writes the modified pr...
{ "content_hash": "3c2a3ab1a0eb3cc7e00827c1bbacc1bd", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 95, "avg_line_length": 30.869158878504674, "alnum_prop": 0.670299727520436, "repo_name": "shakamunyi/hadoop-20", "id": "ef15718601e9f185b60c2219cb251f354d75a939", "size": ...
import typing from decimal import Decimal from logging import NullHandler, getLogger from knowit.core import Rule logger = getLogger(__name__) logger.addHandler(NullHandler()) class AtmosRule(Rule): """Atmos rule.""" def __init__(self, config: typing.Mapping[str, typing.Mapping], name: str, ...
{ "content_hash": "564165acc1b4239c3ba1c76898d7f219", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 91, "avg_line_length": 31.682692307692307, "alnum_prop": 0.5450682852807284, "repo_name": "ratoaq2/knowit", "id": "b35d36437044f616df733d43900cc6f958896e0f", "size": "3295...
"""Bridges transform the state from the encoders so they fit the decoder Inspired by OpenNMT & google/seq2seq ## Available bridges @@NoBridge @@ZeroBridge @@DenseBridge """ import tensorflow as tf import tensorflow.keras as keras class Bridge: """Transforms the state from the encoders so they fit the decoder""...
{ "content_hash": "6c0e04f0275f9315a5dde38d9124beef", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 81, "avg_line_length": 28.3, "alnum_prop": 0.6378091872791519, "repo_name": "jpbottaro/anna", "id": "7f8d3f66b0ef5ef0af70bbc809ee13ad062126a2", "size": "1698", "binary": ...
USAGE = """robot.libdoc -- Robot Framework library documentation generator Version: <VERSION> Usage: python -m robot.libdoc [options] library output_file or: python -m robot.libdoc [options] library list|show|version [names] Libdoc tool can generate keyword documentation in HTML and XML formats both for test l...
{ "content_hash": "1865120db17a2c2848beab94ad03048c", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 84, "avg_line_length": 38.63870967741936, "alnum_prop": 0.6842544665219569, "repo_name": "Senseg/robotframework", "id": "cbc208f8cf995cc86c5e459559d05f31c9db5096", "size":...
"""Mask-RCNN (via ResNet) model definition. Uses the ResNet model as a basis. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import anchors from object_detection import balanced_positive_negative_sampler from mlperf_compliance...
{ "content_hash": "53b4b96483140e516c6046dc6d571ffd", "timestamp": "", "source": "github", "line_count": 1835, "max_line_length": 181, "avg_line_length": 42.23978201634878, "alnum_prop": 0.6402399690362534, "repo_name": "mlperf/training_results_v0.5", "id": "02fe59ed78cd478b9d4e18a5649331f190a28502", ...
from SimpleXMLRPCServer import SimpleXMLRPCServer from threading import Thread import socket import logging from .utils import install_locale, parse_temperature_report install_locale('pronterface') RPC_PORT = 7978 class ProntRPC(object): server = None def __init__(self, pronsole, port = RPC_PORT): ...
{ "content_hash": "d47cb92caf636c0758d5d50a0cdfe279", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 95, "avg_line_length": 32.42857142857143, "alnum_prop": 0.5345080763582967, "repo_name": "Autonomi/limn", "id": "8bdd5aec560836c2e3d9ca2ef9c9121d96be4265", "size": "2711", ...
import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling from .. import models class ApplicationGatewaysOperations(object): """ApplicationGatewaysOperations ...
{ "content_hash": "b013ade93f642f33ba63f7867296f7e3", "timestamp": "", "source": "github", "line_count": 1014, "max_line_length": 199, "avg_line_length": 48.234714003944774, "alnum_prop": 0.6574933551420977, "repo_name": "lmazuel/azure-sdk-for-python", "id": "7723e995d21312a9544433999eb1478841f72a5e",...
import logging import json import unittest import time import uuid import os import urllib.parse as urlparse from operators import DelayedTupleSourceWithLastTuple from requests import exceptions from streamsx.topology.tester import Tester from streamsx.topology import topology, schema from streamsx.topology.context im...
{ "content_hash": "e4684882dcd2de4f344de5d11ea124ff", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 117, "avg_line_length": 36.01846153846154, "alnum_prop": 0.6325815820946523, "repo_name": "IBMStreams/streamsx.topology", "id": "c3fa302ad5d542fccafb6d92e357c2c5dfaee52e", ...
from sqlalchemy.ext.declarative import declared_attr from sqlalchemy import (Column, Integer, Float, String, Boolean, ForeignKey, DateTime, Sequence, and_) class UserDirichletMixin(object): """ Field of this class contains information necessary for spam detection according to dirichlet...
{ "content_hash": "caeac88d05f9542a50731aced3df2c84", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 28.944444444444443, "alnum_prop": 0.6299850714438047, "repo_name": "mshavlovsky/mannord", "id": "b5d640dc16a26f13ad722f56edb3ce2634e75ee6", "size": ...
from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from compiler.ast import Node from compiler.ast import Stmt import compiler import copy import gyp.common import optparse import os.path import re import shlex impo...
{ "content_hash": "5e3e702d963cc9fa1239bf6413dde5f2", "timestamp": "", "source": "github", "line_count": 2244, "max_line_length": 80, "avg_line_length": 40.86096256684492, "alnum_prop": 0.6521724905117131, "repo_name": "leighpauls/k2cro4", "id": "54e24665456c0fa5233edf5cc65cee4788b53fde", "size": "9...
from __future__ import print_function import os import ast __author__ = 'Matteo Danieli' def load_env(print_vars=False): """Load environment variables from a .env file, if present. If an .env file is found in the working directory, and the listed environment variables are not already set, they will be s...
{ "content_hash": "1f3acfccbd6cef6fb62eb415207cb802", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 82, "avg_line_length": 34.96875, "alnum_prop": 0.516532618409294, "repo_name": "BendingSpoons/envious", "id": "a7fcd86659439a49467ed7f37c48d4001bfe1e39", "size": "1119", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import hickle as hkl import numpy as np np.random.seed(2 ** 10) from keras import backend as K K.set_image_dim_ordering('tf') from keras.layers import Dropout from keras.models import Sequential from keras.lay...
{ "content_hash": "e323da0d8dc0ca0575f0bc2eea884695", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 116, "avg_line_length": 36.839622641509436, "alnum_prop": 0.5980153649167733, "repo_name": "pratikgujjar/DeepIntent", "id": "bf3143ddd689358b48768af40f30084525c54f98", "si...
from django.urls import re_path from . import views urlpatterns = [ re_path(r'extra_2/$', views.extra_view, {'message': 'test included urlconf'}, name='extra_second'), ]
{ "content_hash": "1fac50a4165192d00f1594ab548bae3a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 103, "avg_line_length": 25.142857142857142, "alnum_prop": 0.6818181818181818, "repo_name": "rsalmaso/django-cms", "id": "bae71666ba174d0de323970e75de903892bce39a", "size": "...