text
stringlengths
4
1.02M
meta
dict
"""Wrapper around 'git rev-list'.""" # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # phlgit_revlist # # Public Functions: # commits # # ---------------------------------------------------------...
{ "content_hash": "726d90a721a64fe00cdc7a05f65394f7", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 79, "avg_line_length": 38.11363636363637, "alnum_prop": 0.5241502683363148, "repo_name": "bloomberg/phabricator-tools", "id": "8a7b3616030d9e3a19ddc0155e637c364a5ca49b", "s...
DEBUG_MODE = True # Ordered List of Coin Symbol Dictionaries COIN_SYMBOL_ODICT_LIST = [ { 'coin_symbol': 'btc', 'display_name': 'Bitcoin', 'display_shortname': 'BTC', 'blockcypher_code': 'btc', 'blockcypher_network': 'main', 'currency_abbr...
{ "content_hash": "0fa13778a74c18900ed27806e4033fca", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 92, "avg_line_length": 39.26605504587156, "alnum_prop": 0.561214953271028, "repo_name": "wizardofozzie/blockcypher-python", "id": "d1e20a463f1bc7c765ad59bcb48cb24717c757af",...
"""SQLite parser plugin for Google Chrome cookies database files.""" from __future__ import unicode_literals from dfdatetime import webkit_time as dfdatetime_webkit_time from plaso.containers import events from plaso.containers import time_events from plaso.lib import definitions # Register the cookie plugins. from ...
{ "content_hash": "fad4ca4b49ab44838d48c14f5a99acd4", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 79, "avg_line_length": 37.774647887323944, "alnum_prop": 0.6692766592095452, "repo_name": "rgayon/plaso", "id": "0583f433be4aa055bc5e39d93ade44336a1605d2", "size": "8070",...
import os import pytest from .common import * # NOQA RANCHER_CLEANUP_PROJECT = os.environ.get("RANCHER_CLEANUP_PROJECT", "True") namespace = {"p_client": None, "ns": None, "cluster": None, "project": None, "testclient_pods": [], "workload": None} DNS_RESOLUTION_DEFAULT_SECONDS = \ os.environ.get("R...
{ "content_hash": "f30bc48ead92419063a81ffc8a7e01c3", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 79, "avg_line_length": 33.779620853080566, "alnum_prop": 0.622728867064188, "repo_name": "sabiodelhielo/rancher-validation", "id": "07b93e5982da3bb084d3ffdb6bdb7e92e6cbb989"...
from jinja2 import utils import frappe from frappe import _ from frappe.core.utils import html2text from frappe.utils import sanitize_html from frappe.utils.global_search import web_search def get_context(context): context.no_cache = 1 if frappe.form_dict.q: query = str(utils.escape(sanitize_html(frappe.form_dic...
{ "content_hash": "3537a68025479cf25361d8e22ee34d41", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 95, "avg_line_length": 24.238095238095237, "alnum_prop": 0.6542239685658153, "repo_name": "yashodhank/frappe", "id": "d8a939cb157d2b065af794d4f922e72ac7f97b15", "size": "15...
import xml.etree.ElementTree as ET import timeHelper RESPONSE_TEXT_TEMPLATE = ''' <xml> <ToUserName><![CDATA[{TO_USER}]]></ToUserName> <FromUserName><![CDATA[{FROM_USER}]]></FromUserName> <CreateTime>{TIME_STEMP}</CreateTime> <MsgType><![CDATA[text]]></MsgType> <Content><![CDATA[{RESPONSE_CONTENT}]]></Content> </xml>...
{ "content_hash": "fd2199093e4c46eeda7a9a135fe2af2b", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 109, "avg_line_length": 31.73381294964029, "alnum_prop": 0.5771933801858989, "repo_name": "hizhangqi/simpleweixinservicer", "id": "45c783bcacc66c8ca943b1ca44cef8584b45cff6",...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('myapp', '0006_auto_20150629_1628'), ] operations = [ migrations.AddField( model_name='buildingcounter', name='ape_kwh', ...
{ "content_hash": "a3e25cee098c0905a855fe1f6827d785", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 87, "avg_line_length": 38.95752895752896, "alnum_prop": 0.5646184340931616, "repo_name": "mpetyx/energagement", "id": "0d86dca1e5dc79a662fcb16a40161961ab7a4260", "size": "...
from testsuite_generator import Tool
{ "content_hash": "529b7e9094bacb60a7e3e80275c966bb", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 36, "alnum_prop": 0.8888888888888888, "repo_name": "xcgspring/XSTAF", "id": "1e4be0d28f0836d9883dd5dd85ae7558b6d81d18", "size": "36", "binary": fals...
import os import imghdr from collections import namedtuple from io import BytesIO import numpy as np from .. import io, img_as_ubyte from ..transform import resize from ..color import color_dict from ..io.util import file_or_url_context, is_url import six from six.moves.urllib_parse import urlparse from six.moves.url...
{ "content_hash": "dfb11aff96b03a2104d9e57add11c7f6", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 79, "avg_line_length": 29.11066398390342, "alnum_prop": 0.5739563173901023, "repo_name": "warmspringwinds/scikit-image", "id": "24c2ff0ea63c8bd7df6fa9229317bf8ea630c29d", ...
"""Decorador auxiliar Debe instalarse 'graphviz' en el sistema para que funcione. Ubuntu: sudo apt-get install graphviz Mac: brew install graphviz """ from __future__ import unicode_literals from __future__ import print_function from __future__ import with_statement import os import sys import vcr from func...
{ "content_hash": "827556f2cf29a16257504c5fe1034e4e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 77, "avg_line_length": 28.657894736842106, "alnum_prop": 0.6758494031221304, "repo_name": "datosgobar/pydatajson", "id": "844e4ea26c85b5247afe6d073dcce27b6d3c43b9", "size":...
from settings import * import sys if '%d' in MEDIA_URL: MEDIA_URL = MEDIA_URL % MEDIA_VERSION if '%s' in ADMIN_MEDIA_PREFIX: ADMIN_MEDIA_PREFIX = ADMIN_MEDIA_PREFIX % MEDIA_URL TEMPLATE_DEBUG = DEBUG MANAGERS = ADMINS # You can override Django's or some apps' locales with these folders: if os.path.exists(os....
{ "content_hash": "8d194f5d3ded0a245c5be417224a5960", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 35.583333333333336, "alnum_prop": 0.5987509758001561, "repo_name": "lstoll/tetherme", "id": "ae2271402277f6636c542ea77b17db70ae3fd875", "size": "386...
from hpnnet import nips2011_dbn from hyperopt.pyll.stochastic import sample from functools import partial #import numpy as np import hyperopt #from hyperopt import pyll from hyperopt.fmin import fmin_pass_expr_memo_ctrl from hpnnet.skdata_learning_algo import eval_fn from skdata.larochelle_etal_2007.view import Rect...
{ "content_hash": "bf84f4b5035ade70d5ee6bc3157daebe", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 63, "avg_line_length": 23.548387096774192, "alnum_prop": 0.7178082191780822, "repo_name": "hyperopt/hyperopt-nnet", "id": "2230a47f2e161229370d54bff93ea9a0011fa99d", "size"...
from invisibleroads_macros.log import get_log from threading import Thread, Event from .exceptions import ConnectionError, TimeoutError L = get_log(__name__) class HeartbeatThread(Thread): daemon = True def __init__( self, send_heartbeat, relax_interval_in_seconds, hur...
{ "content_hash": "401112709ba6567e57a389b327ce23c6", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 73, "avg_line_length": 27.87272727272727, "alnum_prop": 0.5616438356164384, "repo_name": "purduerov/XX-Core", "id": "a039e73b1a0f9e5aac95e113f2cd6f62b21e6f92", "size": "153...
from ..exceptions import InvalidChoiceError from .base import MarathonObject class MarathonContainer(MarathonObject): """Marathon health check. See https://mesosphere.github.io/marathon/docs/native-docker.html :param docker: docker field (e.g., {"image": "mygroup/myimage"})' :type docker: :class:`ma...
{ "content_hash": "cc6c7466f2065c0d12cb423f75e76854", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 112, "avg_line_length": 34.80769230769231, "alnum_prop": 0.6599447513812154, "repo_name": "fengyehong/marathon-python", "id": "3e88558fc269f76221a8b8198620dfe09dad6800", "...
import os from bokeh.core.properties import Int, String from bokeh.embed import file_html from bokeh.models import Tool from bokeh.resources import CDN from bokeh.util.compiler import JavaScript fn = __file__ fn = os.path.join(os.path.dirname(fn), "export_tool.js") with open(fn) as f: JS_CODE = f.read() class ...
{ "content_hash": "c454a8c91ff7a9d4c43c4f57d5c2c41f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 56, "avg_line_length": 26, "alnum_prop": 0.6510989010989011, "repo_name": "blaze/distributed", "id": "d93d21b881b59af35623189b8722adddc9f738f1", "size": "728", "binary": ...
from google.cloud import osconfig_v1alpha def sample_delete_os_policy_assignment(): # Create a client client = osconfig_v1alpha.OsConfigZonalServiceClient() # Initialize request argument(s) request = osconfig_v1alpha.DeleteOSPolicyAssignmentRequest( name="name_value", ) # Make the re...
{ "content_hash": "a95a2be4eefc9198af793621d7f38316", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 85, "avg_line_length": 26.695652173913043, "alnum_prop": 0.7328990228013029, "repo_name": "googleapis/python-os-config", "id": "7d2ab42d088be84f47789de35469b2311aa10414", "...
"""Classes for exporting data from AFF4 to the rest of the world. Exporters defined here convert various complex RDFValues to simple RDFValues (without repeated fields, without recursive field definitions) that can easily be written to a relational database or just to a set of files. """ import hashlib import json im...
{ "content_hash": "6294c57a8cdddce0bc030d35c1de6c1d", "timestamp": "", "source": "github", "line_count": 1450, "max_line_length": 80, "avg_line_length": 35.296551724137935, "alnum_prop": 0.6593005080109418, "repo_name": "ahojjati/grr", "id": "a7c5ef8dfcd336e1be68cb05a225dd7f95d478aa", "size": "51202...
"""Tests that step_data can accept multiple specs at once.""" from recipe_engine import post_process from recipe_engine.recipe_api import composite_step PYTHON_VERSION_COMPATIBILITY = 'PY2+3' DEPS = [ ] # note that the frames from composite_step are omitted in the stack during # training. @composite_step def my_fun...
{ "content_hash": "3e55a7d49a53af3eca23a15d5301eb69", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 23.296296296296298, "alnum_prop": 0.6931637519872814, "repo_name": "luci/recipes-py", "id": "6896997a40bf8c8b3afc5d3a820fa124c8f9cdb4", "size": "803"...
class ainput: # We can't use input as it is a existent function name, so we use AInput for Advance Input ''' This class will create a object with a simpler coding interface to retrieve console input''' def __init__(self,msg=""): ''' This will create a instance of ainput object''' self.data = "" # ...
{ "content_hash": "4b1cfb07a943f3a41a74b1a5425d081f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 127, "avg_line_length": 38.90625, "alnum_prop": 0.6160642570281124, "repo_name": "kwminnick/kwmqueues", "id": "770a10787bfbba22f97ca0027e0b6d83e8e264eb", "size": "1245", ...
""" RSyncBackup - Wrapper to perform backup management using rsync. -------------------------------------------------------------------- Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted p...
{ "content_hash": "ccd35b57342e1aff25790ebb35a9043b", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 110, "avg_line_length": 39.98393574297189, "alnum_prop": 0.6856167135395741, "repo_name": "mick-t/RSyncBackup", "id": "f81af9266043cecbabebf1fe0526d8060d652bee", "size": "...
import logging from common import http from galaxy import wrapper from bootstrap import settings from console.taskgroup import helper from console.service import decorator as s_decorator from console.taskgroup import decorator as t_decorator from django.db import transaction from django.views.decorators.csrf import csr...
{ "content_hash": "edac79121c982d308ac9e84e217908c2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 97, "avg_line_length": 36.63380281690141, "alnum_prop": 0.6478277585544021, "repo_name": "leoYY/galaxy", "id": "436d155ba60a7dbfd801c3d0d4256a2ba926d135", "size": "2835", ...
import math, sys def cross_track_distance(d_13, theta_13, theta_12): """Calculate distance from great circle path (1 -> 2) to point (3). Adapted from http://www.movable-type.co.uk/scripts/latlong.html This implementation does not produce a great-circle distance but a mere straight-line (through the e...
{ "content_hash": "5a8c92f7236bedede295f74298f78a60", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 38.3, "alnum_prop": 0.6997389033942559, "repo_name": "mauzeh/formation-flight", "id": "f7f2580df28ff22c0b3fe69e1019736f306d236f", "size": "766", "b...
from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^', include('polls.urls')), url(r'^admin/', admin.site.urls), ]
{ "content_hash": "fc56282417e066d1306cd040000556bb", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 41, "avg_line_length": 24.285714285714285, "alnum_prop": 0.6764705882352942, "repo_name": "megancoyle/polling_app", "id": "a8025fe0570765c4579572470ed252741d1c3bb1", "size":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('meas_models', '0012_formula_formula'), ] operations = [ migrations.CreateModel( name='FormulaIndex', fields=[ ...
{ "content_hash": "92dc1f2764d50823106df11abb840e86", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 123, "avg_line_length": 29.586206896551722, "alnum_prop": 0.5617715617715617, "repo_name": "deka108/meas_deka", "id": "eb5078c79ed702f357bc69ebdd00796104a7b896", "size": "9...
"""Module containing nginx installation functions.""" from perfkitbenchmarker import errors RHEL_REPO = ('[nginx]\n' 'name=nginx repo\n' 'baseurl=https://nginx.org/packages/rhel/$releasever/$basearch/\n' 'gpgcheck=0\n' 'enabled=1') def YumInstall(vm): """Install...
{ "content_hash": "f7fdee6f62cae39e419965b4db266d2c", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6153846153846154, "repo_name": "GoogleCloudPlatform/PerfKitBenchmarker", "id": "75c278713662b3a3cdef8e3c6bcb71260a9...
import django_filters from django.contrib.auth import get_user_model from .models import Task, Sprint User = get_user_model() class NullFilter(django_filters.BooleanFilter): """Filter on a field set as null or not.""" def filter(self, qs, value): if value is not None: isnullKey = "{}_...
{ "content_hash": "d40021d09bba3e93cd4ddb30eeb08850", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 70, "avg_line_length": 26.127659574468087, "alnum_prop": 0.6148208469055375, "repo_name": "mezklador/lightweight-django", "id": "5b897c79940bc5dee0ae93cb25db56e52b98ce7e", ...
INPUT_DATASET_DOES_NOT_RESOLVE_TO_FILENAME = \ "Input OPeNDAP Dataset: URL {} does not resolve to a filename." INPUT_DATASET_URL_MALFORMED = \ "Input OPeNDAP Dataset: URL {} is malformed or references inaccessible " \ "data." INPUT_DATASET_GENERIC_ERROR = \ "Input OPeNDAP Dataset: URL {}: {}." INPUT_FI...
{ "content_hash": "1b4f66620f18c4191f3a5c29dc07f312", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 85, "avg_line_length": 40.026315789473685, "alnum_prop": 0.702827087442472, "repo_name": "pshowalter/solutions-geoprocessing-toolbox", "id": "6b7e7c0382260b6ca3cf3868d244869e...
"""Tests for Google Life Sciences Run Pipeline operator """ import unittest from unittest import mock from airflow.providers.google.cloud.operators.life_sciences import LifeSciencesRunPipelineOperator TEST_BODY = {"pipeline": {"actions": [{}], "resources": {}, "environment": {}, "timeout": '3.5s'}} TEST_OPERATION =...
{ "content_hash": "c5e077c8f477647f25bbe870df395f83", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 98, "avg_line_length": 38.53658536585366, "alnum_prop": 0.6879746835443038, "repo_name": "mrkm4ntr/incubator-airflow", "id": "cc08e13ff8ff850f07379c3de3a0bd275c708da6", "si...
"""Qt dock window.""" # ----------------------------------------------------------------------------- # Imports # ----------------------------------------------------------------------------- from collections import defaultdict from functools import partial import logging from .qt import ( QApplication, QWidget...
{ "content_hash": "d30986e79cfbeab0203a8c1efd9feb38", "timestamp": "", "source": "github", "line_count": 826, "max_line_length": 99, "avg_line_length": 33.246973365617436, "alnum_prop": 0.5612846842910203, "repo_name": "kwikteam/phy", "id": "947aac5ef043730916d4c150d30dd6ac7e650dfa", "size": "27489"...
desc = 'Noise with a color bar' # phash = 'f54b0ba50bb10bf4' phash = 'fd5a0bb503f50354' def plot(): from numpy.random import randn from matplotlib import pyplot as plt import numpy as np # Make plot with vertical (default) colorbar fig = plt.figure() ax = fig.add_subplot(111) np.random.s...
{ "content_hash": "060a167b3a3245c361ede538d3c46d50", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 57, "avg_line_length": 26.74074074074074, "alnum_prop": 0.6551246537396122, "repo_name": "dougnd/matplotlib2tikz", "id": "200672ba7b076f251a9a2c7bb61871cfcc50f941", "size":...
""" This script changes all the queues within a VPN affecting the reject-msg-to-sender-on-discard setting. """ import sys sys.path.append("/opt/pipeline") import logging import libsolace.settingsloader as settings from libsolace.SolaceAPI import SolaceAPI from libsolace.SolaceXMLBuilder import SolaceXMLBuilder from ...
{ "content_hash": "86fad7b2fb1a61e101ad7b5ab94e688a", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 136, "avg_line_length": 38.31428571428572, "alnum_prop": 0.609992542878449, "repo_name": "unixunion/python-libsolace", "id": "5f405dcc287b5062934221cde6ea9520cb5ed6b8", "s...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: vmware_host_ssl_info short_description: Gather info of ESXi host system about SSL des...
{ "content_hash": "47c715232abd2f89e92eeef5b27bbbfb", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 109, "avg_line_length": 31.153846153846153, "alnum_prop": 0.621773288439955, "repo_name": "thaim/ansible", "id": "b76414a0fe413fa9266876d578c8e2f9cc6cdc8f", "size": "4654"...
from django.contrib.auth.models import User, Group from rest_framework import serializers from rest_auth.models import TokenModel class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ('url', 'username', 'email', 'groups') class GroupSerializer(serializers...
{ "content_hash": "4ca5f7cbd75ba995af548938cbf05b63", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 62, "avg_line_length": 30.041666666666668, "alnum_prop": 0.6907073509015257, "repo_name": "willy-claes/django-react", "id": "5a6b812e03e31747828b954ed47360bded88efb2", "siz...
import numpy import unittest from annoy import AnnoyIndex class MultithreadedBuildTest(unittest.TestCase): def _test_building_with_threads(self, n_jobs): n, f = 10000, 10 n_trees = 31 i = AnnoyIndex(f, 'euclidean') for j in range(n): i.add_item(j, numpy.random.normal(si...
{ "content_hash": "05428adb0d0b77aa120275d3e1f4b0e3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 56, "avg_line_length": 28.807692307692307, "alnum_prop": 0.6328437917222964, "repo_name": "spotify/annoy", "id": "0fc9f24f7ec7d74735b68da81a2117d5718a4587", "size": "749", ...
from puck.backend import echo_backend from puck.parser import parse_requirement def test_parse_req(): expected = { 'name': 'foo', 'pinned_version': '1.2.3', 'latest_version': 'foo', 'source': None } assert parse_requirement( 'foo==1.2.3', None, backe...
{ "content_hash": "85fc15490780e016d90f155d93bded87", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 41, "avg_line_length": 20.473684210526315, "alnum_prop": 0.5308483290488432, "repo_name": "NativeInstruments/puck", "id": "03e00f994436b612a899fbb4a7f2f38994e07ce9", "size"...
import contextlib import hashlib import os import re import tarfile import urlparse from anvil import colorizer from anvil import downloader as down from anvil import importer from anvil import log from anvil import shell as sh from anvil import utils LOG = log.getLogger(__name__) # Extensions that tarfile knows how...
{ "content_hash": "33931e1feced2fb03b5ef6af1e657732", "timestamp": "", "source": "github", "line_count": 469, "max_line_length": 138, "avg_line_length": 39.07036247334755, "alnum_prop": 0.5544640908098668, "repo_name": "pombredanne/anvil", "id": "02dc593540ed4161c0335a65beef3a7c7ce2dfc9", "size": "1...
import json import logging from typing import Any import requests from zerver.lib.cache import cache_with_key from zerver.lib.outgoing_http import OutgoingSession logger = logging.getLogger(__name__) class GithubSession(OutgoingSession): def __init__(self, **kwargs: Any) -> None: super().__init__(role=...
{ "content_hash": "27942533b8606a8450ba469d8fa9145c", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 97, "avg_line_length": 32.523809523809526, "alnum_prop": 0.6715470961444607, "repo_name": "andersk/zulip", "id": "08397c3ff30b8846baf7f407e52703a59997430c", "size": "2049",...
from .Factor import Factor, factor_product, factor_divide, State from .FactorSet import FactorSet, factorset_product, factorset_divide from .CPD import TabularCPD from .JointProbabilityDistribution import JointProbabilityDistribution __all__ = ['Factor', 'State', 'factor_product', 'fac...
{ "content_hash": "63fae86a36539f20254b8513798a61db", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 70, "avg_line_length": 34.857142857142854, "alnum_prop": 0.6495901639344263, "repo_name": "liquidmetal/pgmpy", "id": "39e63b935dde2aa83228c0ef17b6112166796588", "size": "48...
from __future__ import with_statement from typing import Optional from typing import List from libcloud.common.base import ConnectionUserAndKey, BaseDriver from libcloud.container.types import ContainerState __all__ = [ "Container", "ContainerImage", "ContainerCluster", "ClusterLocation", "Conta...
{ "content_hash": "8689f2681f3fd8c83e60f06865774b24", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 86, "avg_line_length": 28.428260869565218, "alnum_prop": 0.5726848665596085, "repo_name": "mistio/libcloud", "id": "38c53d33c629fe832b6845635d4562bf8522c493", "size": "138...
from style import * class Agent(object): def __init__(self,name): self.name = name def __str__(self): return Style.RED + self.name + Style.END
{ "content_hash": "bbcf811c32c06c65eae704a6bdca90ff", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 48, "avg_line_length": 23.857142857142858, "alnum_prop": 0.5868263473053892, "repo_name": "thomvangessel/inquisitive-action-models", "id": "7816d5629ec588bc92ce217c94f3ce2191e...
from api.lib.testutils import BaseTestCase import api.companies.unittest class TestDeleteCompany(BaseTestCase): def test_delete_company(self): resp = self.app.delete('/companies/deerwalk', headers={'content-type': 'application/json'}) self.assertEqual(resp.status_code, ...
{ "content_hash": "1df2c529a01134d91eb2da2717ca687d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 74, "avg_line_length": 35.416666666666664, "alnum_prop": 0.6541176470588236, "repo_name": "girisagar46/flask_restipy", "id": "33b672e0bae7d943c61e0cb15701baf0e0908297", "si...
import numpy as np import matplotlib.pyplot as plt maze = np.fromfile("../build/test.dat", dtype=np.int32) maze1 = maze.reshape(1001,1001) plt.figure() plt.imshow(maze1) plt.show()
{ "content_hash": "da46045ba89c5a37e082c72852a77182", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 55, "avg_line_length": 22.75, "alnum_prop": 0.7362637362637363, "repo_name": "thomasgt/labyrinth", "id": "78e0d14ea12aa9d558d6b1956e4eb0871a571bfb", "size": "182", "binary...
import json def index(): envObject = request.env envJSON = {} for key in envObject: value = envObject[ key ] if isinstance( value, dict ) or \ isinstance( value, list ) or isinstance( value, tuple ) or \ isinstance( value, str ) or isinstance( value, unicode ) or \ isinstance( value, int ) or isi...
{ "content_hash": "20958ab77f7d9e978438259be613cf5c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 93, "avg_line_length": 31.87878787878788, "alnum_prop": 0.6606463878326996, "repo_name": "uwdata/termite-data-server", "id": "a90d1b740c876e419b23233a82cd256f14caa526", "si...
import logging import click from flask.cli import with_appcontext from scout.server.extensions import store LOG = logging.getLogger(__name__) @click.command("panels", short_help="Display gene panels") @click.option("-i", "--institute", help="institute id") @with_appcontext def panels(institute): """Show all ge...
{ "content_hash": "8f9c94d220ac30ee9d28e6fbacdc8ccc", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 91, "avg_line_length": 28.97222222222222, "alnum_prop": 0.5915627996164909, "repo_name": "Clinical-Genomics/scout", "id": "c7ccad7814f7dbcef74b90854757b4c18da61528", "size"...
""" Copyright [2011] [y42sora] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
{ "content_hash": "df358f843efe1c34787ec8810a30d8d9", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 75, "avg_line_length": 24.458333333333332, "alnum_prop": 0.6448040885860307, "repo_name": "y42sora/Twitter4Py3", "id": "1f9cf967748da974fe6168f9cb4dd9a9b48e0c0c", "size": "...
import falcon import os from sqlalchemy.exc import SQLAlchemyError from db import session import model import util class EvalCode(object): def _file_or_error(self, fn): if not os.path.isfile(fn): return "Soubor %s neexistuje." % (fn) with open(fn, "r") as f: return f.rea...
{ "content_hash": "a5a0a2a8a9b0fb7f97bb36b14a59f0ac", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 34.34065934065934, "alnum_prop": 0.448, "repo_name": "fi-ksi/web-backend", "id": "3f74c659e36304822013bc8cd239f7cb846ce81a", "size": "3135", "binar...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/space/asteroid/shared_asteroid_small_01.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "d481f3b6513bbc72757942212a069a57", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 23.615384615384617, "alnum_prop": 0.6938110749185668, "repo_name": "obi-two/Rebelion", "id": "0022dd7d2dbef31d3deb4528dd9f0371655186c6", "size": "452...
""" Sahana Eden Module Automated Tests - INV002 Receive Items @copyright: 2011-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwar...
{ "content_hash": "31ab8fb679fbf9f95b9e28fb195e48e5", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 110, "avg_line_length": 36.751633986928105, "alnum_prop": 0.46505424150809177, "repo_name": "flavour/rgims_as_diff", "id": "fc6ebd49c07cbcf9d87e34110e31929be6dd88e9", "siz...
import struct from .exceptions import AMQPError from datetime import datetime, timezone def rethrow_as(expected_cls, to_throw): def decorator(f): def wrapper(*args, **kwargs): try: return f(*args, **kwargs) except expected_cls as e: raise to_throw fr...
{ "content_hash": "cb33b7d5a9ac42da633dfc8a39f52a55", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 98, "avg_line_length": 24.582386363636363, "alnum_prop": 0.6229053507454062, "repo_name": "socketpair/asynqp", "id": "694a369ff088a8a0fd70baa0a97f7fee2cb7dea0", "size": "8...
from django.conf import settings from django.contrib import messages from django.utils.translation import ugettext as _ from django.shortcuts import render, redirect, get_object_or_404 from servo.models.rules import * def get_data(request): pass def list_rules(request): title = _('Rules') object_list =...
{ "content_hash": "341046e3656ee68856ccece6b7202b28", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 64, "avg_line_length": 25.2, "alnum_prop": 0.5962962962962963, "repo_name": "filipp/Servo", "id": "ec193a897b806b51af3b8dd227debce94473b5e1", "size": "3268", "binary": fa...
from __future__ import print_function from awips.dataaccess import DataAccessLayer as DAL from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint from awips.test.dafTests import baseDafTestCase from awips.test.dafTests import params import unittest # # Test DAF support for buf...
{ "content_hash": "21b6658af07ddf08f2de54566d002394", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 112, "avg_line_length": 42.0547263681592, "alnum_prop": 0.6488820537087424, "repo_name": "mjames-upc/python-awips", "id": "5c3f6ffae453b669aea4faa5a7e1ec5ab995fac5", "size...
from os.path import exists from setuptools import setup setup(name='castra', version='0.1.2', description='On-disk partitioned store', url='http://github.com/Blosc/Castra/', maintainer='Matthew Rocklin', maintainer_email='mrocklin@gmail.com', license='BSD', keywords='', ...
{ "content_hash": "e77c909f588bab847d97623984749ee6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 35.294117647058826, "alnum_prop": 0.6016666666666667, "repo_name": "mrocklin/castra", "id": "d0c97b6114c2b688cba4749bd5d0ca0433f201cc", "size": "623"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/components/droid_interface/shared_ddi_rss_enhanced_imperial_1.iff" result.attribute_template_id = 8 result.stfName("space/space_item","ddi_rss_enhanced_imperial_1_n") #### BEGIN MODIFICATIONS #### ###...
{ "content_hash": "38514ede8ab7dc5e243ca85a12f5d744", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 107, "avg_line_length": 27.923076923076923, "alnum_prop": 0.71900826446281, "repo_name": "obi-two/Rebelion", "id": "822277147d39aed9c3d78a479680c491311ea00c", "size": "508"...
extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8' # The master toctree document. master_doc = 'index' # General information abou...
{ "content_hash": "754f3717ae59a682fe1900330eb57da1", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 80, "avg_line_length": 31.711764705882352, "alnum_prop": 0.714153218326841, "repo_name": "imakin/pysar-payments", "id": "90151137f0c3eb977b67ca23f496fe497fb4e291", "size":...
"""This code example gets all line item creative associations (LICA) for a given line item id. To create LICAs, run create_licas.py.""" __author__ = ('Nicholas Chen', 'Joseph DiLallo') # Import appropriate modules from the client library. from googleads import dfp # Set the id of the line item to get ...
{ "content_hash": "9f55334105169ac6fd6456354c4ddc2f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 80, "avg_line_length": 30.653846153846153, "alnum_prop": 0.6386449184441656, "repo_name": "coxmediagroup/googleads-python-lib", "id": "130e8c3b0a350c9eadb671432335e6248d4720c...
from collections import defaultdict from functools import reduce import math import operator import random from flax.component import Breakable, IPhysics, Empty import flax.entity as e from flax.entity import ( Entity, CaveWall, Floor, Tree, Grass, CutGrass, Salamango, Armor, Potion, StairsDown, StairsUp, ...
{ "content_hash": "92e8a3d708b4491781921a14d04d89da", "timestamp": "", "source": "github", "line_count": 894, "max_line_length": 120, "avg_line_length": 39.75167785234899, "alnum_prop": 0.5864426810737802, "repo_name": "eevee/flax", "id": "c18e48ac9b3156731c8d2a3b65f885a73ccbfc8c", "size": "35545", ...
""" @author Joelmir Ribacki 2015 """ from lxml import etree def incorporate_imports(tags, location,imports): ''' Get file's tags to incorporate on the base xsd file. ''' xsd_doc = etree.XML(open(location).read()) for import_tag in xsd_doc.iter(): #No import 'Comments' elements ...
{ "content_hash": "d5388669ab0a3226a971fb8beaebaa91", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 116, "avg_line_length": 31.666666666666668, "alnum_prop": 0.6173684210526316, "repo_name": "joelmir/validate-xml-from-multiple-xsd-schema", "id": "4863dc83e6412dd52d484a35ac5...
import logging import os from okonomiyaki.versions import EnpkgVersion from simplesat.constraints import PrettyPackageStringParser, Requirement from simplesat.dependency_solver import DependencySolver from simplesat.errors import NoPackageFound, SatisfiabilityError from simplesat.pool import Pool from simplesat.reposi...
{ "content_hash": "25acdca2ca0655399e744d1e0a2a6be8", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 94, "avg_line_length": 35.87683284457478, "alnum_prop": 0.5279548798430603, "repo_name": "lowRISC/fusesoc", "id": "fc6f299a680b335b666ae47a11f893fd73f297ed", "size": "1237...
def split_and_join(line): # write your code here line = line.split() return '-'.join(line) if __name__ == '__main__': line = input() result = split_and_join(line) print(result)
{ "content_hash": "993e48dcea5406fc7205a7a24c207158", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 33, "avg_line_length": 22.444444444444443, "alnum_prop": 0.5693069306930693, "repo_name": "avtomato/HackerRank", "id": "e0cb14bb0d4cbb6873cc0ab46a7295389d561b81", "size": "2...
from pybluetooth import HCIThread from pybluetooth.address import * from scapy.layers.bluetooth import * try: from unittest.mock import MagicMock except ImportError: from mock import MagicMock def _create_patched_hci_thread(): h = HCIThread(MagicMock()) h.sent_packets = [] def send_cmd(scapy_pa...
{ "content_hash": "f71b6bfd1dbb9d763caf70f438b5c90a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 55, "avg_line_length": 26.275862068965516, "alnum_prop": 0.6811023622047244, "repo_name": "pebble/pybluetooth", "id": "8e0d8ebfe86ba0b906aabdd0e135be52a63e28d2", "size": "7...
import os import socket import sys sys.path.insert(0, os.getcwd()) from dynamite.message import Message def main(): s = None try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("127.0.0.1", 8888)) message = Message() s.send(message.to_bytes()) finally: ...
{ "content_hash": "a47c16f54ea3a54032e4a3f13d289a2a", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 61, "avg_line_length": 19.51851851851852, "alnum_prop": 0.523719165085389, "repo_name": "svisser/dynamite", "id": "d2f7105347ddc44e21d8f562cf9e84aee324311b", "size": "527",...
import sqlite3 as sql import pandas as pd from DataGeneration.MapLocation import MapLocation class DatabaseHandler: def __init__(self, db_file_name='db.sqlite3', full=True): if full: self.conn = sql.connect(db_file_name) self.initialize_db() def initialize_db(self): s...
{ "content_hash": "5e1001c490b68cdf1775c88d6ee4a7da", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 80, "avg_line_length": 39.44387755102041, "alnum_prop": 0.5496054844134006, "repo_name": "skorasaurus/RTAHeatMap", "id": "f5cf79ed3b42972b11c8eac8cc46844522479734", "size"...
''' Created on 2016年2月12日 @author: root ''' import xlstool import os,sys parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) tempdir=parentdir+'/../../' dirpath=tempdir.replace('\\','/') sys.path.insert(0,dirpath) from tool import SQLTool,config import uuid def loadteacher(path): data=xl...
{ "content_hash": "365c80bb74aebf1b98d4153e2dc641ed", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 167, "avg_line_length": 28.21951219512195, "alnum_prop": 0.6784788245462403, "repo_name": "sherwel/Behavior_culture", "id": "0bc1065441542a6cef3c95945c440cb8d00fbc7d", "siz...
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 field 'UserProfile.points_progress' db.delete_column('accounts_userprofile', 'points_progress') # Adding...
{ "content_hash": "c10dcaf98478e8d5bcbd7ae99276030d", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 182, "avg_line_length": 74.58677685950413, "alnum_prop": 0.5585595567867035, "repo_name": "SushiTee/teerace", "id": "d3fe94f09b131580fb8a209995cb5f3e5525d2c8", "size": "90...
import calendar import reversion import base64 from django.contrib.auth.decorators import login_required, permission_required from django.contrib.sites.models import Site from django.shortcuts import render, get_object_or_404, redirect from django.utils.translation import ugettext as _ from django.core.mail import sen...
{ "content_hash": "c1d9b69ff62fb3fa6c68543954a6ea46", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 129, "avg_line_length": 38.80555555555556, "alnum_prop": 0.6957766642806013, "repo_name": "Hackfmi/Diaphanum", "id": "f83ded9251b927c16ac2485dde7353459d7420b2", "size": "5...
""" Like the old south.modelsparser, but using introspection where possible rather than direct inspection of models.py. """ import datetime import re import decimal from south.utils import get_attribute, auto_through from django.db import models from django.db.models.base import ModelBase, Model from django.db.model...
{ "content_hash": "a42350629e4ba3ba76257f78a0676963", "timestamp": "", "source": "github", "line_count": 388, "max_line_length": 129, "avg_line_length": 36.11082474226804, "alnum_prop": 0.5934622796374277, "repo_name": "mcr/ietfdb", "id": "0f7fd467fcb4ea19cbee08ead0e92518467ddd7d", "size": "14011", ...
import os import sys sys.path.insert(0, os.path.abspath("..")) from automatedbrewery.AlarmControl import AlarmController import time import RPi.GPIO as GPIO print("Turning the alarm off and on every 5 seconds") Alarm = AlarmController() time.sleep(5) try: while True: Alarm.alarm = 1 time.sleep(5...
{ "content_hash": "f9ba4c8083b4438a2b1e027b9b719897", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 57, "avg_line_length": 18.88, "alnum_prop": 0.6716101694915254, "repo_name": "Bobstin/AutomatedBrewery", "id": "b3e27ece6c73ab822ffa34e96f18b9a7f625d4c5", "size": "472", ...
"""Tests for transformer-based text encoder network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np import tensorflow as tf from tensorflow.python.keras import keras_parameterized # pylint: dis...
{ "content_hash": "cd752d9c566f48236c07bb1b2e33f6e3", "timestamp": "", "source": "github", "line_count": 632, "max_line_length": 101, "avg_line_length": 36.76898734177215, "alnum_prop": 0.6490231517342284, "repo_name": "tombstone/models", "id": "664bccd08e11720918e0060458dc934350d2d594", "size": "23...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_HTTPError from ..utils import ( determine_ext, float_or_none, int_or_none, smuggle_url, try_get, unsmuggle_url, ExtractorError, ) class LimelightBaseIE(InfoExtractor): _PLA...
{ "content_hash": "e32d0026afcbc64a0db74840b39bde72", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 163, "avg_line_length": 41.661064425770306, "alnum_prop": 0.48961204867881397, "repo_name": "yasoob/youtube-dl-GUI", "id": "39f74d2822bc7296df8a5c16e5edfce3298e82ab", "siz...
import os from datetime import datetime, timedelta from re import sub import praw from pytz import UTC from icfwp import app, PUNCTUATION, STRIPPABLE_PUNCTUATION from markov.model import TransitionTable USERAGENT = "Writingprompts title scraper by /u/reostra" def now(): result = datetime.utcnow() result.r...
{ "content_hash": "8f0db512e3f4135f4501a5d721a61d1d", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 68, "avg_line_length": 25.07894736842105, "alnum_prop": 0.64900314795383, "repo_name": "atiaxi/itcamefromwritingprompts", "id": "8f4fe434e2b88352d64aab506641768c88ead9de", ...
from typing import Dict, Union from merakicommons.cache import lazy_property from merakicommons.container import searchable from ...data import Region, Platform from ..common import CoreData, CassiopeiaGhost, provide_default_region, ghost_load_on from ...dto.staticdata import realm as dto ############## # Data Type...
{ "content_hash": "77d2192c6f6c5762aab9d9dd07a907c3", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 101, "avg_line_length": 28.221153846153847, "alnum_prop": 0.6432708688245315, "repo_name": "10se1ucgo/cassiopeia", "id": "54f8ee9922f2435218297d37b638a549656ef6ab", "size"...
"""This is the main executable of Maraschino. It parses the command line arguments, does init and calls the start function of Maraschino.""" import sys import os # Check if frozen by py2exe def check_frozen(): return hasattr(sys, 'frozen') def get_rundir(): if check_frozen(): return os.path.abspath...
{ "content_hash": "2f1b5ac50bd65efb1bce0130e99c23b0", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 140, "avg_line_length": 27.651515151515152, "alnum_prop": 0.6160730593607306, "repo_name": "robweber/maraschino", "id": "77fa1ebe40fd8d525800a15f0c16ac9dac56bc42", "size":...
""" Import sample data for recommendation engine """ import predictionio import argparse import random ITEM_ACTIONS_DELIMITER = "|" RATE_ACTIONS_DELIMITER = "\t" SEED = 3 GENRES = ["unknown", "action", "adventure", "animation", "children's", "comedy","crime", "documentary", "drama", "fantasy", "film-noir",...
{ "content_hash": "5b1e1adc3aa493aeb659fc9d44d2b448", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 116, "avg_line_length": 28.333333333333332, "alnum_prop": 0.6204793028322441, "repo_name": "pferrel/PredictionIO", "id": "643f4dbb5422df2afb81c56c8d6572fd3afd9275", "size":...
from Root import application import unittest class test1(unittest.TestCase): def test_one(self): self.assertEqual(application.foo(),1) def test_two(self): self.assertEqual(application.foo(),2) def test_three(self): self.assertEqual(application.foo(),1) if __name__ == '__main__': unittest.main()
{ "content_hash": "0c1c462f3ecb8fce884be3b362f6e343", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 39, "avg_line_length": 27.818181818181817, "alnum_prop": 0.7222222222222222, "repo_name": "codeboardio/kali", "id": "ae909bcfff066a87b37b1b20bd8d84025bdf982f", "size": "306...
from __future__ import division from collections import deque from copy import deepcopy import colorsys import warnings import time import math import random import tween from envelope import ADSREnvelope, EnvelopeSegment # from scene import SceneManager from birdfish.colors import DIYC_DIM from birdfish.output.base i...
{ "content_hash": "6f680dedacfd3d6506b8b777e495c424", "timestamp": "", "source": "github", "line_count": 968, "max_line_length": 79, "avg_line_length": 37.43285123966942, "alnum_prop": 0.577093969918587, "repo_name": "ptone/BirdFish", "id": "84f0374ac9e1d2c3288686f1cd776613ffa93887", "size": "36235"...
import random import nest from .lib import paramify def simulate(data): print('Simulate %s' % data.get('id', None)) # print(data) # print('Set kernel') nest.ResetKernel() random.seed(int(data.get('random_seed', 0))) local_num_threads = int(data['kernel'].get('local_num_threads', 1)) nest...
{ "content_hash": "73f6c02ddcf10f3ab1855c59cf832fce", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 86, "avg_line_length": 34.76271186440678, "alnum_prop": 0.5463188688444661, "repo_name": "babsey/nest-server-simulation", "id": "b75e39aa1459bec244edf3c1c57b7c302f774a86", ...
""" Utils has nothing to do with models and views. """ import json import math from bson import json_util import string import uuid import base64 import time import random import datetime import os import subprocess import sys from functools import partial import pytz from flask import session, request, url_for, ...
{ "content_hash": "100169a3c38b9c71b62d402198beffcf", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 93, "avg_line_length": 23.794117647058822, "alnum_prop": 0.5797280593325093, "repo_name": "seasonstar/bibi", "id": "de93df64a3a2cf2d2ec4221642b60830f15032bd", "size": "105...
from django.conf.urls import url from fir_articles import views urlpatterns = [ url(r'^$', views.list_articles, name='list'), url(r'^(?P<article_id>\d+)/$', views.details, name='details'), url(r'^new/$', views.new_article, name='new'), url(r'^(?P<article_id>\d+)/comment/$', views.comment, name='commen...
{ "content_hash": "e6cab4129ecbf85df5db25de3e9db773", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 123, "avg_line_length": 58.470588235294116, "alnum_prop": 0.635814889336016, "repo_name": "gcrahay/fir_articles_plugin", "id": "76ff976aa05c0173fb64e6e0c8bef56b6471be7c", "...
import numpy as np from pyspark import keyword_only from pyspark.ml import Estimator, Model, Transformer, UnaryTransformer from pyspark.ml.evaluation import Evaluator from pyspark.ml.param import Param, Params, TypeConverters from pyspark.ml.param.shared import HasMaxIter, HasRegParam from pyspark.ml.classification im...
{ "content_hash": "7c7baa446038172a1431b5660b157803", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 96, "avg_line_length": 34.18884120171674, "alnum_prop": 0.6416018076826513, "repo_name": "milliman/spark", "id": "d6edf9d64af49465c1cd82f3357a49f8e0cdccf8", "size": "8748"...
from datadog.dogshell.common import report_errors, report_warnings, find_localhost from datadog import api class MetricClient(object): @classmethod def setup_parser(cls, subparsers): parser = subparsers.add_parser('metric', help="Post metrics.") verb_parsers = parser.add_subparsers(title='Ver...
{ "content_hash": "a5671ea999cf1c77f13e4b15c4100fa8", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 93, "avg_line_length": 44.48837209302326, "alnum_prop": 0.5734448510193414, "repo_name": "percipient/datadogpy", "id": "d44b2a0238a608d353815b6cd106c57a28b2dc03", "size": "...
"""Unit tests for DB API.""" import mock from oslo.config import cfg from oslo.utils import importutils from oslo.db import api from oslo.db import exception from tests import utils as test_utils sqla = importutils.try_import('sqlalchemy') if not sqla: raise ImportError("Unable to import module 'sqlalchemy'.") ...
{ "content_hash": "0e1e634225998f359a10b2c53e8b5dca", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 36.39506172839506, "alnum_prop": 0.5851424694708277, "repo_name": "varunarya10/oslo.db", "id": "2168cd5a96486d329229dabdef4aba0927c2bae9", "size": "...
import py from rpython.rtyper.lltypesystem import lltype from rpython.rtyper.rmodel import inputconst from rpython.tool.ansi_print import ansi_log from rpython.translator.simplify import get_graph log = py.log.Producer("backendopt") py.log.setconsumer("backendopt", ansi_log) def graph_operations(graph): for bl...
{ "content_hash": "b6da1b3c1cbd4bd454df03b2624387ed", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 104, "avg_line_length": 32.6015625, "alnum_prop": 0.5940570333093698, "repo_name": "jptomo/rpython-lang-scheme", "id": "0f9b0202b16365908909fa077eaced77cb6c20bf", "size": ...
""" Bokeh comes with a number of interactive tools. There are five types of tool interactions: .. hlist:: :columns: 5 * Pan/Drag * Click/Tap * Scroll/Pinch * Actions * Inspectors For the first three comprise the category of gesture tools, and only one tool for each gesture can be active at a...
{ "content_hash": "18652914f3704602559735f7c58a6ede", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 90, "avg_line_length": 33.67438016528926, "alnum_prop": 0.6669120895302606, "repo_name": "pombredanne/bokeh", "id": "381eecd59b5c2c44f432153a14316eb5a87a1e13", "size": "20...
""" homeassistant.components.device_tracker.snmp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Device tracker platform that supports fetching WiFi associations through SNMP. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.snmp/ """ import lo...
{ "content_hash": "0fbe728df02ddda138c038920e340bc7", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 79, "avg_line_length": 30.82051282051282, "alnum_prop": 0.6156405990016639, "repo_name": "badele/home-assistant", "id": "868f701673a575a7906caebdd509dac3111d7b3e", "size":...
from cached import cached
{ "content_hash": "ce679fe68140491d1ad862ed95f87149", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 25, "avg_line_length": 26, "alnum_prop": 0.8461538461538461, "repo_name": "caryt/utensils", "id": "db741c453b6d82390962f306f1eaa9b0b3fe74dc", "size": "26", "binary": false...
"""Heat API exception subclasses - maps API response errors to AWS Errors.""" from oslo_utils import reflection import webob.exc from heat.common.i18n import _ from heat.common import serializers class HeatAPIException(webob.exc.HTTPError): """webob HTTPError subclass that creates a serialized body. Subcl...
{ "content_hash": "9421ea76171f8d7d15d99ded39af7371", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 79, "avg_line_length": 30.20186335403727, "alnum_prop": 0.692133676092545, "repo_name": "openstack/heat", "id": "90366f8611cfa467fc224c40c53196f93cb4b6d5", "size": "10436"...
import codecs import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument('n', type=int, help='Keep points from the first n frames') parser.add_argument('mdf_filename', help='File to process') args = parser.parse_args() f = codecs.open(args.mdf_filename, 'r', 'mac-roman') ...
{ "content_hash": "eb5b78d5c535a39a30c666bed3f5ca2b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 87, "avg_line_length": 28.25925925925926, "alnum_prop": 0.580602883355177, "repo_name": "tdsmith/migrationscripts", "id": "1f008454da30f5b449ee602424f3365cd03e353c", "size"...
from core.domain import widget_domain from extensions.value_generators.models import generators class Link(widget_domain.BaseWidget): """Definition of a widget. Do NOT make any changes to this widget definition while the Oppia app is running, otherwise things will break. This class represents a widg...
{ "content_hash": "99ac76ed8f633228479123649b0f7b79", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 79, "avg_line_length": 37.793103448275865, "alnum_prop": 0.6733576642335767, "repo_name": "mindpin/mindpin_oppia", "id": "82b07adea7cec0e096a0a797af8c3deccda9c4e3", "size":...
"""Test the Whirlpool Sixth Sense init.""" from unittest.mock import AsyncMock, MagicMock import aiohttp from homeassistant.components.whirlpool.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from . import init_integration async def test_s...
{ "content_hash": "2e4266fb407be270166f10666d247bcc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 83, "avg_line_length": 37.05084745762712, "alnum_prop": 0.7456541628545288, "repo_name": "w1ll1am23/home-assistant", "id": "619c2c783b7f4691c14d314b9d8b32067a213315", "size...
import ConfigParser CONFIG_FILE = '/etc/ci-scoreboard/ci-scoreboard.conf' CONFIG_SECTION = 'scoreboard' class Config: def __init__(self): self._cfg = ConfigParser.ConfigParser() self._cfg.read(CONFIG_FILE) def _value(self, option): if self._cfg.has_option(CONFIG_SECTION, option): ...
{ "content_hash": "e0f4b0996c9c2c8bb9633b373f25a397", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 61, "avg_line_length": 27.8, "alnum_prop": 0.6194244604316547, "repo_name": "stackforge/third-party-ci-tools", "id": "39612b341250312c017f334aa0bf4749db2398ac", "size": "13...
"""Support for EnOcean devices.""" import logging from enocean.communicators.serialcommunicator import SerialCommunicator from enocean.protocol.packet import Packet, RadioPacket from enocean.utils import combine_hex import voluptuous as vol from homeassistant.const import CONF_DEVICE import homeassistant.helpers.conf...
{ "content_hash": "d35a2941b5336a7351e5a87bef3b2d63", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 88, "avg_line_length": 31.946236559139784, "alnum_prop": 0.6741837765062269, "repo_name": "robbiet480/home-assistant", "id": "90ab408775414a39b38e5de7525f40d4c32e7b78", "si...
from django.conf.urls.defaults import * from oscar_gocardless import views urlpatterns = patterns('', url(r'^redirect/', views.RedirectView.as_view(), name='gocardless-redirect'), url(r'^confirm/', views.ConfirmView.as_view(), name='gocardless-response'), url(r'^cancel/', views.CancelView.as_view(), name...
{ "content_hash": "4c855f8fdfbe29c7aaa10b9b66b4da1d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 81, "avg_line_length": 34.5, "alnum_prop": 0.7072463768115942, "repo_name": "django-oscar/django-oscar-gocardless", "id": "eabe35a589b5498c675c42f3dcfd0a25294580a5", "size"...
"""Tests for grr.lib.rdfvalues.checks.""" import os import yaml from grr.lib import config_lib from grr.lib import test_lib from grr.lib.checks import checks as checks_lib from grr.lib.checks import filters from grr.lib.rdfvalues import anomaly from grr.lib.rdfvalues import checks from grr.parsers import linux_cmd_par...
{ "content_hash": "a6701aaccf21112ffb55500394270351", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 35.43438914027149, "alnum_prop": 0.6743710892606308, "repo_name": "ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert", "id": "18e0b1ab8f64f07e422f3...
"""Integration with pytorch profiler.""" import os from pkg_resources import parse_version import wandb from wandb.errors import Error, UsageError from wandb.sdk.lib import telemetry PYTORCH_MODULE = "torch" PYTORCH_PROFILER_MODULE = "torch.profiler" def torch_trace_handler(): """Creates a trace handler for tra...
{ "content_hash": "8001d1d5d0f6a5315139ba30c64e432e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 99, "avg_line_length": 30.894736842105264, "alnum_prop": 0.6490630323679727, "repo_name": "wandb/client", "id": "c035faa85e467c252f95f0f65e2106558de5ea45", "size": "2348", ...
""" Support for Netgear routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.netgear/ """ import logging import threading from datetime import timedelta import voluptuous as vol import homeassistant.helpers.config_validation as cv fro...
{ "content_hash": "f4701f2438f3e5bf2dada8f191577d75", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 75, "avg_line_length": 28.923809523809524, "alnum_prop": 0.6608495225551531, "repo_name": "happyleavesaoc/home-assistant", "id": "b3ec442198ebf145564edec0e3eeb634d08f9b84", ...
import sys import os # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # Get the proje...
{ "content_hash": "776da83e8e24c736030985d868b4f685", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 76, "avg_line_length": 30.634615384615383, "alnum_prop": 0.7026993094789705, "repo_name": "stuarteberg/blockflow", "id": "29286afbff5403aa91c2adcb505b06dfea092a8a", "size"...
""" :copyright: 2010-2015 by Ronny Pfannschmidt :license: MIT """ import os import sys from .utils import trace from .version import format_version from .discover import find_matching_entrypoint PYTHON_TEMPLATE = """\ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control ve...
{ "content_hash": "73c8f3dad6297b6bf9ea835fe12f3d89", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 67, "avg_line_length": 26.46969696969697, "alnum_prop": 0.6044647967945048, "repo_name": "untitaker/setuptools_scm", "id": "d1ec09c6ba956fcc15fd3bed5b57ba7f74c5a9d6", "size...
import os from os.path import join import sys import json import csv import subprocess import shutil import itertools from django.views.generic import ListView, DetailView from django.views.generic.base import ContextMixin from django.views.generic.edit import CreateView, DeleteView, UpdateView from django.contrib.mes...
{ "content_hash": "a10cc8d4dc11b1e291d0d0541820533d", "timestamp": "", "source": "github", "line_count": 336, "max_line_length": 96, "avg_line_length": 38.023809523809526, "alnum_prop": 0.5973700688791485, "repo_name": "memex-explorer/memex-explorer", "id": "096da8c001d85d80efa949a85e2bc2cb27942b57", ...
import json import mock import pytest from pyetcd import EtcdResult, EtcdKeyNotFound from etcdb import IntegrityError from etcdb.execute.dml.insert import insert, get_pk_field from etcdb.lock import WriteLock from etcdb.resultset import Column from etcdb.sqlparser.sql_tree import SQLTree @mock.patch('etcdb.execute....
{ "content_hash": "af7131fd59d2edb49137033e138241b1", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 77, "avg_line_length": 32.416666666666664, "alnum_prop": 0.5923613661402864, "repo_name": "box/etcdb", "id": "0598ed3c470fa902d08ce80be5a51fa8896209d0", "size": "2723", "...
def extractNinetysevenkoiWordpressCom(item): ''' Parser for 'ninetysevenkoi.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ...
{ "content_hash": "ef465667b078f4b286a6ccfd7bb99b37", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 27, "alnum_prop": 0.6402116402116402, "repo_name": "fake-name/ReadableWebProxy", "id": "7022f6592028f10360f2c4a24601f61a699eb4e9", "size": "568", ...