text
stringlengths
4
1.02M
meta
dict
""" backend """
{ "content_hash": "8e29b571dac02142153da3369f1226f3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 15, "avg_line_length": 16, "alnum_prop": 0.4375, "repo_name": "yullo/check-it", "id": "b8511b4d5eaeec5cdfc762b3ea153969eb1edae7", "size": "16", "binary": false, "copies"...
import sys sys.path.append("internal/") from wrap_try_accept import apply_fun_to_notebook from glob import glob def comment_pip_install(code): return code.replace("!pip install", "#!pip install") def postprocessing(code): code = code.replace("%pip install ssm", "%pip install git+https://github.com/linderma...
{ "content_hash": "6d992cad56a131f4406b454d472ecb9c", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 120, "avg_line_length": 36.43333333333333, "alnum_prop": 0.6559926806953339, "repo_name": "probml/pyprobml", "id": "5aa9eb2269d0205d05886beefbe8f8b0b7592d3e", "size": "1093...
import autograd.numpy as np class WeightsParser(object): """A helper class to index into a parameter vector.""" def __init__(self): self.idxs_and_shapes = {} self.num_weights = 0 def add_shape(self, name, shape): start = self.num_weights self.num_weights += np.prod(shape) ...
{ "content_hash": "cd6b1c865304c159e1ca8e82a1b927af", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 27.246575342465754, "alnum_prop": 0.5927601809954751, "repo_name": "czhuang/ChordRipple", "id": "4accb21b2de1ed5ddcf18a45b34577bcf8a311a4", "size": "...
"""The Wolf SmartSet Service integration.""" from datetime import timedelta import logging from httpcore import ConnectError, ConnectTimeout from wolf_smartset.token_auth import InvalidAuth from wolf_smartset.wolf_client import WolfClient from homeassistant.config_entries import ConfigEntry from homeassistant.const i...
{ "content_hash": "47402697e1e53a8cfaa58ab14ad30e2f", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 97, "avg_line_length": 33.72380952380952, "alnum_prop": 0.6955662242304433, "repo_name": "sdague/home-assistant", "id": "611fa7da315031b8ecf0dbd56e832372c64e7807", "size":...
from django.contrib import admin import models admin.site.register(models.Spider) admin.site.register(models.Collector) admin.site.register(models.Selector) admin.site.register(models.Result) admin.site.register(models.LocalContent) admin.site.register(models.UserAgent) admin.site.register(models.ProxyServer)
{ "content_hash": "c5b9938cc9cf3e51425170d9435b6a4e", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 40, "avg_line_length": 26.166666666666668, "alnum_prop": 0.8343949044585988, "repo_name": "zniper/django-scraper", "id": "9813c3db3eb22ff03a775bae7e87f733cdfe4805", "size":...
__version__ = '1.0.0' from .algorithms.ICA import ICA from .algorithms.PCA import PCA from .algorithms.NMF import NMF from .algorithms.SVD import SVD
{ "content_hash": "13b6fe27d5c46b9daeb7e275435d233d", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 31, "avg_line_length": 25.166666666666668, "alnum_prop": 0.7549668874172185, "repo_name": "thunder-project/thunder-factorization", "id": "bcd4cd28b4c9dab77586d2505cac0a4163663...
from .base import SingleWindow from .. import drawer, hook, window import six to_superscript = dict(zip(map(ord, six.u('0123456789')), map(ord, six.u('⁰¹²³⁴⁵⁶⁷⁸⁹')))) class TreeNode(object): def __init__(self): self.children = [] self.expanded = True def add(self, node, hint=None): ...
{ "content_hash": "96504f1ba5aa3c85c9da1e0d05c9b135", "timestamp": "", "source": "github", "line_count": 588, "max_line_length": 88, "avg_line_length": 31.57482993197279, "alnum_prop": 0.5414197996337391, "repo_name": "xplv/qtile", "id": "c01434734f8fd572b9cc69e5d6f0ce41d99f93ba", "size": "20054", ...
from trac.db import Table, Column, Index, DatabaseManager def do_upgrade(env, ver, cursor): """Rename the column `sql` in the `report` table for compatibity with MySQL. """ cursor.execute("CREATE TEMPORARY TABLE report_old AS SELECT * FROM report") cursor.execute("DROP TABLE report") table = Table...
{ "content_hash": "1b9c2865d608d829eb81f807b81ff53e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 80, "avg_line_length": 37.63636363636363, "alnum_prop": 0.6473429951690821, "repo_name": "jun66j5/trac-ja", "id": "7e335c9ef4dbccbed1b1c6962f245527bc588727", "size": "1317"...
from __future__ import unicode_literals from ..denoising import GradientAnisotropicDiffusion def test_GradientAnisotropicDiffusion_inputs(): input_map = dict(args=dict(argstr='%s', ), conductance=dict(argstr='--conductance %f', ), environ=dict(nohash=True, usedefault=True, ), ignore_ex...
{ "content_hash": "e36d34949dd9441f20ed2f65ae0722c6", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 67, "avg_line_length": 27.5, "alnum_prop": 0.6458498023715415, "repo_name": "mick-d/nipype", "id": "02df01486d0303e29e85ac55924f16e4e23a4155", "size": "1319", "binary": f...
import vaex as vx import sys import timeit import numpy as np import argparse subspace, dataset, limits = None, None, None def main(argv): global subspace, dataset, limits parser = argparse.ArgumentParser(argv[0]) parser.add_argument("-N", help="run each batch N times (default: %(default)s)", type=int, d...
{ "content_hash": "c905885724ff4576ddcb19c6b2e9cf0d", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 156, "avg_line_length": 43.86486486486486, "alnum_prop": 0.6537276648182379, "repo_name": "maartenbreddels/vaex", "id": "35e166bc5d380f3a2caea0b04327890385c2dd5a", "size": ...
from warnings import catch_warnings import pytest import pandas as pd from pandas import api from pandas.util import testing as tm class Base(object): def check(self, namespace, expected, ignored=None): # see which names are in the namespace, minus optional # ignored ones # compare vs th...
{ "content_hash": "14b39a78ea4bb1622651a4d52f2689b2", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 78, "avg_line_length": 33.90909090909091, "alnum_prop": 0.5474275501085153, "repo_name": "mbayon/TFG-MachineLearning", "id": "b1652cf6eb6dbd995ce62c50a9842ec2744590a5", "s...
import functools def my_filter(predicate, seq): def filter_and_aggregate_as_list(accumulator, current_elt): if predicate(current_elt): accumulator.append(current_elt) return accumulator return functools.reduce(filter_and_aggregate_as_list, seq, []) print("Nombres pairs entre 1 à...
{ "content_hash": "e8d88ba8b5c956a9005e713bf68b46e3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 31.0625, "alnum_prop": 0.6539235412474849, "repo_name": "TGITS/programming-workouts", "id": "cae2adb8d1cf48ec8052adbd3f63ff76bb44c3ab", "size": "499"...
from django.forms import ModelForm from cliente.models import Cliente class ClienteForm(ModelForm): class Meta: model = Cliente exclude = ['']
{ "content_hash": "e2eb012199617f1fde60a2366720809c", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 34, "avg_line_length": 16.77777777777778, "alnum_prop": 0.7483443708609272, "repo_name": "HelioSaraiva/DjangoCRUDsimples", "id": "90a4002597d0dba460e40cee724c91c1c6b87228", ...
from re import compile, escape from ..util import tagre, getPageContent from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter class BackwaterPlanet(_BasicScraper): url = 'http://www.backwaterplanet.com/current.htm' stripUrl = 'http://www.backwaterplanet.com/archive/bwp%s.h...
{ "content_hash": "d458cbff9015265b1af79d56c17eb926", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 122, "avg_line_length": 37.34267912772586, "alnum_prop": 0.60774172019688, "repo_name": "wummel/dosage", "id": "2498acbe44a383dcda8558c12bc93ae317700b47", "size": "12126",...
def foo(): <selection>print "hello"</selection>
{ "content_hash": "0305bd7c36bbdc8e499601f7cf3d6602", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 44, "avg_line_length": 27.5, "alnum_prop": 0.6181818181818182, "repo_name": "consulo/consulo-python", "id": "faee07e103c12f6618a6743dfb68a5ad201503e6", "size": "55", "bina...
from __future__ import division, unicode_literals """ This module defines standard transformations which transforms a structure into another structure. Standard transformations operate in a structure-wide manner, rather than site-specific manner. All transformations should inherit the AbstractTransformation ABC. """ ...
{ "content_hash": "7d2e6a56411ea279a8044f01baffc09f", "timestamp": "", "source": "github", "line_count": 745, "max_line_length": 92, "avg_line_length": 35.50738255033557, "alnum_prop": 0.5882130571201754, "repo_name": "yanikou19/pymatgen", "id": "77f8cf76c9eaaeff3e92add1edc2b93cb960cb60", "size": "2...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('distances', '0016_auto_20170626_1758'), ] operations = [ migrations.AlterField( model_name='dates', name='st...
{ "content_hash": "c8c4e9ed20ef7949c6e0d743bb8a2915", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 93, "avg_line_length": 23.210526315789473, "alnum_prop": 0.6122448979591837, "repo_name": "tkettu/rokego", "id": "54311b0522e276cd15b0990b37b2d4b235018a69", "size": "512", ...
import pytest from tests.utils import async import io import json from http import client import aiohttpretty from waterbutler.core import streams from waterbutler.core import exceptions from waterbutler.providers.dataverse import settings as dvs from waterbutler.providers.dataverse import DataverseProvider from w...
{ "content_hash": "57c7fd2ea4a0235eb553bf3c39f3c0c3", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 138, "avg_line_length": 39.54347826086956, "alnum_prop": 0.6552551351891649, "repo_name": "kwierman/waterbutler", "id": "839ddd296f8a6b59879c30f0ebe6fd707d439be5", "size":...
import unittest import os from test.test_support import TESTFN, run_unittest, unlink, import_module gdbm = import_module('gdbm') filename = TESTFN class TestGdbm(unittest.TestCase): def setUp(self): self.g = None def tearDown(self): if self.g is not None: self.g.close() ...
{ "content_hash": "39c6542a103000e9f0f27537b24748c4", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 80, "avg_line_length": 32.632183908045974, "alnum_prop": 0.5892920042268405, "repo_name": "IronLanguages/ironpython2", "id": "c4a498fec915e84dbd2c659ae3beafa7becb52a8", "si...
from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class VideoPage(page_module.Page): """A test page containing a video. Attributes: use_chrome_proxy: If true, fetches use the data reduction proxy. Otherwise, fetches are sent directly to the orig...
{ "content_hash": "445c28b36e4ba4cb11dfe15cef6e1931", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 74, "avg_line_length": 30.137931034482758, "alnum_prop": 0.6939359267734554, "repo_name": "SaschaMester/delicium", "id": "51f005c2c31ffeafda5de0b3ab3a4c0ca1fbaeaa", "size":...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals import inspect import os import math import socket import subprocess import time # Sometimes it's really hard to get Python extensions to compile, # so fall back to a pure Python implemen...
{ "content_hash": "f48b79a26a0689a7c210a28e3fb7afca", "timestamp": "", "source": "github", "line_count": 1059, "max_line_length": 97, "avg_line_length": 34.01794145420208, "alnum_prop": 0.5890909090909091, "repo_name": "kwlzn/watchman", "id": "5790de5195474aa7792e9f46a9b240655d94f4ff", "size": "3756...
#!/usr/bin/env python __version__ = '0.9.9' import os, sys, subprocess, hashlib #import pythonjs #import pythonjs.pythonjs #import pythonjs.python_to_pythonjs #import pythonjs.pythonjs_to_cpp #import pythonjs.pythonjs_to_verilog #import pythonjs.typedpython as typedpython import tempfile import webbrowser GO_EXE = No...
{ "content_hash": "4bf94b3abf4710cf7cb2afad24b2bbf6", "timestamp": "", "source": "github", "line_count": 1390, "max_line_length": 231, "avg_line_length": 31.523741007194246, "alnum_prop": 0.6126249486512392, "repo_name": "kustomzone/Rusthon", "id": "1739a00f43952126f1d576296e2286aaeb05d7ef", "size":...
from __future__ import unicode_literals import os from django.template import Context, Template from django.test import SimpleTestCase, override_settings from django.utils._os import upath from django.utils.encoding import force_text from django.utils.translation import activate, get_language, trans_real f...
{ "content_hash": "292e99b67de75b41296c7a80c3c3174f", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 114, "avg_line_length": 44.666666666666664, "alnum_prop": 0.6199770378874856, "repo_name": "yephper/django", "id": "b2e3a3f3cde4e2ec92c2d9c5837d14bc470ee5d1", "size": "700...
import datetime import time import re import random import os from copy import deepcopy import json from flask import Flask, render_template, url_for, request, redirect from flask.json import jsonify import pytz import dateutil.parser app = Flask(__name__) def utcnow(): return datetime.datetime.utcnow().replace(...
{ "content_hash": "ae313c6e2632bf53e35aea667e5c6153", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 135, "avg_line_length": 28.32249322493225, "alnum_prop": 0.5997512199789494, "repo_name": "recursecenter/RSVPBot", "id": "18e5d373914315de05fd529bc094d3ea99808c93", "size"...
import asyncio # noqa: F401 import sys from typing import Dict, Optional, Union # noqa from urllib.parse import parse_qsl, urlencode from aiohttp import __version__ as aiohttp_version, StreamReader from multidict import MultiDict from pkg_resources import parse_version from yarl import URL if sys.version_info < (3,...
{ "content_hash": "839ec8c53f8c86ddf43909baa32a91ea", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 73, "avg_line_length": 25.324324324324323, "alnum_prop": 0.6414087513340448, "repo_name": "pnuckowski/aioresponses", "id": "24ad58aaddfd52e3c40a7944c2691dc258008222", "size...
from shell_quoting import ShellQuoted def fbcode_builder_spec(builder): # This API should change rarely, so build the latest tag instead of master. builder.add_option( "facebook/zstd:git_hash", ShellQuoted("$(git describe --abbrev=0 --tags origin/master)"), ) return { "steps": ...
{ "content_hash": "22ccc64e8994ce747a814b5b56a31a77", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 29.958333333333332, "alnum_prop": 0.4631432545201669, "repo_name": "facebook/bistro", "id": "9e2682db7891a4b5c429dc00cd6e54a0cc3b52da", "size": "793"...
import os from setuptools import setup, find_packages def README(): try: import pypandoc return pypandoc.convert('README.md', 'rst') except (IOError, ImportError, OSError): return open('README.md').read() setup( name='django-modalview', version='0.1.6-dev', packages=find_p...
{ "content_hash": "477507d39dd649f38bdc89f98a22ee48", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 71, "avg_line_length": 28.666666666666668, "alnum_prop": 0.6153846153846154, "repo_name": "debianitram/django-modalview", "id": "d21a4dfaded102a9fc7dd83ae8d9c2ae42dd84df", ...
from __future__ import with_statement import sys import os import re import codecs from lxml import etree as ET # How many seconds to wait for a SQLite lock to go away. SQLITE_TIMEOUT = 30.0 # XML tag to use for elements whose text content has been rewritten # by this script. REWRITTEN_TAG = 'n2t-tex' # XML attrib...
{ "content_hash": "134a53ff9dec66448fd8169c87e4cdd9", "timestamp": "", "source": "github", "line_count": 483, "max_line_length": 142, "avg_line_length": 32.89648033126294, "alnum_prop": 0.603373402983196, "repo_name": "spyysalo/nxml2txt", "id": "0e55c114de0adc532b9ce8eb9d9f7c4daeeeb3bf", "size": "16...
import sqlalchemy as sa from collections import defaultdict from holmes.models import Base, JsonType class DomainsViolationsPrefs(Base): __tablename__ = "domains_violations_prefs" id = sa.Column(sa.Integer, primary_key=True) domain_id = sa.Column('domain_id', sa.Integer, sa.ForeignKey('domains.id')) ...
{ "content_hash": "45f644ad631c4eb0bb5df32217b05b42", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 105, "avg_line_length": 30.684615384615384, "alnum_prop": 0.5723238906994235, "repo_name": "marcelometal/holmes-api", "id": "48699b9626767dc16088d66c1cf48349a199ab48", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Post', fields=[ ('id', models.AutoField(auto_create...
{ "content_hash": "c29a414d4260f885d40f821502be8161", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 114, "avg_line_length": 24.40909090909091, "alnum_prop": 0.5623836126629422, "repo_name": "jinto/drftest", "id": "f22b6fe4354bc4558d7ad9704b6ee18022d1fd0e", "size": "609", ...
import bluetooth import random import struct import time from ble_advertising import advertising_payload from micropython import const _IRQ_CENTRAL_CONNECT = const(1 << 0) _IRQ_CENTRAL_DISCONNECT = const(1 << 1) # org.bluetooth.service.environmental_sensing _ENV_SENSE_UUID = bluetooth.UUI...
{ "content_hash": "18bef421a5ca6154c0210c89cdfce18c", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 130, "avg_line_length": 35.056338028169016, "alnum_prop": 0.6287665729208517, "repo_name": "trezor/micropython", "id": "d901e2af1cf1e8583094df46a7080c09f03e0afd", "size": "...
from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), )
{ "content_hash": "72a4a6ed6cdf15c1d13614b96beb72b1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 21, "alnum_prop": 0.7261904761904762, "repo_name": "relrod/pib", "id": "f8bdd55896fc0b2cd78ebff521cbb0923cf7ddf5", "size": "168", "binary": false, ...
import os import mimetypes from qqweibo.binder import bind_api from qqweibo.error import QWeiboError from qqweibo.parsers import ModelParser from qqweibo.utils import convert_to_utf8_bytes class API(object): """Weibo API""" # TODO: remove unsupported params def __init__(self, auth_handler=None, retry_cou...
{ "content_hash": "2a754dbd3b828b96da58e95ec0cd1738", "timestamp": "", "source": "github", "line_count": 954, "max_line_length": 121, "avg_line_length": 33.5, "alnum_prop": 0.5033949748114772, "repo_name": "xlk521/cloudguantou", "id": "c93268fac8dd8cb709d31f4203f9af5ec29f71db", "size": "33590", "b...
""" Name: 'Morph Copy' Blender: 245 Group: 'MESH' Tooltip: 'Copy morph vectors from 1 mesh, to all other selected meshes.' """ __author__ = "Amorilia" __url__ = ("blender", "elysiun", "http://niftools.sourceforge.net/") __version__ = "1.0" __bpydoc__ = """\ Morph Copy This script is used to copy morphs from 1 mesh w...
{ "content_hash": "8d1854552a21c60da6db726268a050db", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 165, "avg_line_length": 37.197101449275365, "alnum_prop": 0.5781968362814619, "repo_name": "nightstrike/blender_nif_plugin", "id": "3806e7f0d626cf8234e070ca5523a046408262ec"...
""" Tests For IronicHostManager """ import mock from nova import db from nova import exception from nova.openstack.common import jsonutils from nova.scheduler import filters from nova.scheduler import host_manager from nova.scheduler import ironic_host_manager from nova import test from nova.tests.scheduler import ir...
{ "content_hash": "a26bcbf0412bfe88a4ba49b94e70d459", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 79, "avg_line_length": 41.03225806451613, "alnum_prop": 0.6159893565553943, "repo_name": "vladikr/nova_drafts", "id": "13ea257a306f382faf5ccb38ff2306f2e5e0a404", "size": "...
import pytest from molecule import config from molecule import core from molecule import state from molecule.driver import vagrantdriver # TODO(retr0h): Test instance create/delete through the vagrant instance. @pytest.fixture() def molecule_instance(temp_files, state_path): c = temp_files(fixtures=['molecule_v...
{ "content_hash": "1688b4e67ff678692a39f986d6b23f8f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 73, "avg_line_length": 25.5125, "alnum_prop": 0.732484076433121, "repo_name": "rjfellman/molecule", "id": "b87f2ac9bed290a6f77a30cb89d1d21ec6963d79", "size": "3155", "bin...
"""Dirac notation for states.""" from __future__ import print_function, division from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt, Tuple) from sympy.core.compatibility import u from sympy.printing.pretty.stringpict import prettyForm, stringPict from sympy.physics.quantum.q...
{ "content_hash": "944fe9d365c43a306577fd38d6e06c71", "timestamp": "", "source": "github", "line_count": 953, "max_line_length": 106, "avg_line_length": 30.343126967471143, "alnum_prop": 0.5460109969913891, "repo_name": "wolfram74/numerical_methods_iserles_notes", "id": "00b371980bfff40b561c2d0a2d7d87...
import theano import theano.tensor as T _stuff_to_print = [] def print_me_this(text, theano_variable): _stuff_to_print.append(theano.printing.Print(text+":")(theano_variable)) def get_the_stuff_to_print(): return _stuff_to_print
{ "content_hash": "15e2c06d6ca549c4cc54eaa5eb59f7c0", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 76, "avg_line_length": 23.9, "alnum_prop": 0.7154811715481172, "repo_name": "317070/kaggle-heart", "id": "fdc86e4c42ff6e62c4a3e435457f65073cdd743c", "size": "239", "binar...
""" Samples for sms client. """ import sys import logging import os if sys.version_info[0] == 2 : reload(sys) sys.setdefaultencoding('utf-8') file_path = os.path.normpath(os.path.dirname(__file__)) sys.path.append(file_path + '/../../') import sms_sample_conf from baidubce.services.sms import sms_client as s...
{ "content_hash": "535d8bc299f6031d302e61e8b24056a3", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 92, "avg_line_length": 38.333333333333336, "alnum_prop": 0.590537084398977, "repo_name": "baidubce/bce-sdk-python", "id": "835e44840e951387df9b0de207e76089ad27a506", "size...
import io import os import sqlite3 BUCKET = "dbp-prod" PREFIX = "arn:aws:s3:::" output = io.open("PermissionsRequest.txt", mode="w", encoding="utf-8") textSet = set() audioSet = set() #input = io.open("metadata/FCBH/dbp_prod.txt", mode="r", encoding="utf-8") input = io.open(os.environ['HOME'] + "/ShortSands/DBL/FCBH/...
{ "content_hash": "00ce3746ac30c29b3a1f188ba44eadb8", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 101, "avg_line_length": 23.939393939393938, "alnum_prop": 0.6443037974683544, "repo_name": "garygriswold/Bible.js", "id": "ffbe1f1c4b12c52981ecefa859bacaa873d7352d", "size"...
import pandas as pd from datetime import timedelta import matplotlib.pyplot as plt import matplotlib import numpy as np from sklearn.cluster import KMeans matplotlib.style.use('ggplot') # Look Pretty # # INFO: This dataset has call records for 10 users tracked over the course of 3 years. # Your job is to find out whe...
{ "content_hash": "2d958a15fa8baffb92b84fd5b9afd0bb", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 128, "avg_line_length": 39.63157894736842, "alnum_prop": 0.6848162903939796, "repo_name": "sly-ninja/python_for_ml", "id": "e2e0d770dc58fbb07eb4d05e13415cc0b34b5aa0", "siz...
"""The tests for the Rfxtrx component.""" # pylint: disable=too-many-public-methods,protected-access import unittest import pytest from homeassistant.bootstrap import _setup_component from homeassistant.components import rfxtrx as rfxtrx from tests.common import get_test_home_assistant @pytest.mark.skipif("os.envir...
{ "content_hash": "48b9b35b7c5931b1855e8913c4ad25a9", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 73, "avg_line_length": 36.79194630872483, "alnum_prop": 0.5220722364100693, "repo_name": "Smart-Torvy/torvy-home-assistant", "id": "b26483c877158d15445051c1b059c72a37706b30"...
from collections import namedtuple from jsonobject import DefaultProperty from dimagi.ext import jsonobject from corehq.apps.app_manager.models import Application from corehq.util.couch import stale_ok SimpleFormInfo = namedtuple('FormInfo', ['app_id', 'xmlns']) class AppInfo(jsonobject.JsonObject): id = json...
{ "content_hash": "a85c9de0c52197c448b25c2be4a70b3c", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 102, "avg_line_length": 31.19047619047619, "alnum_prop": 0.6221374045801527, "repo_name": "dimagi/commcare-hq", "id": "642d6b910a998e8962eefdb97afe29aef78ebf22", "size": "...
import os, string, sys def count_scored(scored_in): old_scored_id = '' lineno = 0 nsentences = 0 while 1: scored_line = scored_in.readline() lineno = lineno+1 if len(scored_line) == 0: nsentences = nsentences+1 break scored_field...
{ "content_hash": "2df91b148cc401b8c4249db3ea952648", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 30.095238095238095, "alnum_prop": 0.5585443037974683, "repo_name": "BLLIP/bllip-parser", "id": "1ce319c5c2704553685f9162f4c90e66082f82a3", "size": "1...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from textwrap import dedent from pants.backend.core.targets.doc import Page, Wiki, WikiArtifact from pants.base.build_environment import get_buildroot from pants.buil...
{ "content_hash": "027f53f8e4c8d96eeffe9ee2479e7bb4", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 104, "avg_line_length": 30.71578947368421, "alnum_prop": 0.6199451679232351, "repo_name": "slyphon/pants", "id": "e7fa105c7d0ce94b9a196bc40d7b45daa0588dd2", "size": "3065",...
import config import utils class Strategy(object): def remove_bot_comments(self, comments): return [comment for comment in comments if '#ignore' not in comment['body']] def get_last_comment(self, comments): sorted(comments, key=lambda comment: comment['created_at']) return comments[-1...
{ "content_hash": "2b13a063ee57bda35e12272e34501392", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 85, "avg_line_length": 38.025, "alnum_prop": 0.653517422748192, "repo_name": "OlivierCoilland/simple-github-bot", "id": "201513dab7f75f15f665c4f1438c93a6396ff0a4", "size": ...
from functools import partial import copy from six import ( with_metaclass, ) from elasticsearch_dsl import DocType from elasticsearch_dsl.utils import AttrList, AttrDict from elasticsearch_dsl.field import InnerObjectWrapper from elasticsearch import helpers from nefertari.json_httpexceptions import ( JHTTPBa...
{ "content_hash": "97e2e1b52de8adacfcb73ebec3b77c2b", "timestamp": "", "source": "github", "line_count": 801, "max_line_length": 77, "avg_line_length": 34.85518102372035, "alnum_prop": 0.5582936351588524, "repo_name": "ramses-tech/nefertari-es", "id": "a894954dadfddbfe481264b348468c29a01f8458", "siz...
""" A scrpit to load entity into Database Author: Ming Usage: usage: load_entities.py [-h] [--source SOURCE] [--start START] [--end END] [--user USER] [--passwd PASSWD] [--db DBNAME] optional arguments: -h, --help show this help message and exit --source SOURCE The source info, which wou...
{ "content_hash": "68c7c46e30394bfebcde8135a1e416e5", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 210, "avg_line_length": 36.45967741935484, "alnum_prop": 0.6361424463614245, "repo_name": "WangWenjun559/Weiss", "id": "241091843cbce194ee94853358cacafbd8e9e738", "size": ...
from django.conf.urls import url from django.views.decorators.cache import cache_page from main import views CACHE_TIME = 60 urlpatterns = [ url( r'^top$', cache_page(CACHE_TIME)(views.TopItemListView.as_view()), name='top_item_list' ), url( r'^trending$', cache_...
{ "content_hash": "50ae3bad8d80a3c42798918c3896bf01", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 69, "avg_line_length": 21.23076923076923, "alnum_prop": 0.5905797101449275, "repo_name": "9dev/django-fb-rank", "id": "543d00868b701549f616e258d78953402d7d63e4", "size": "5...
import logging import re import string from string import Template from builtins_generator import BuiltinsGenerator, WK_lcfirst from builtins_model import Framework, Frameworks from builtins_templates import BuiltinsGeneratorTemplates as Templates log = logging.getLogger('global') class BuiltinsSeparateImplementati...
{ "content_hash": "c33058aa360da9c4ad3edfd853608f41", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 107, "avg_line_length": 40.073170731707314, "alnum_prop": 0.6256847230675593, "repo_name": "hxxft/lynx-native", "id": "d5362bd4b3fa1311bf576d1b68697ba803e63409", "size": "4...
""" Onshape REST API The Onshape REST API consumed by all clients. # noqa: E501 The version of the OpenAPI document: 1.113 Contact: api-support@onshape.zendesk.com Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 import sys # noqa:...
{ "content_hash": "b88eeb4d61d743a1b8f39a2e1232c159", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 115, "avg_line_length": 38.84649122807018, "alnum_prop": 0.5684769109179181, "repo_name": "onshape-public/onshape-clients", "id": "9791fba0372709123676d0402b3aec15e085364c",...
import unittest from airflow.lineage import AUTO from airflow.lineage.entities import File from airflow.models import DAG, TaskInstance as TI from airflow.operators.dummy_operator import DummyOperator from airflow.utils import timezone DEFAULT_DATE = timezone.datetime(2016, 1, 1) class TestLineage(unittest.TestCase...
{ "content_hash": "3e9c7a8f44220ad97cb6ab012488526f", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 98, "avg_line_length": 36.125, "alnum_prop": 0.6133217993079585, "repo_name": "mrkm4ntr/incubator-airflow", "id": "fddf723576cf9c0343f5e3f0da57778839d257e9", "size": "4255"...
from .base import Anchor # noqa from .utils import histogram_entropy from ..lib import Image, ImageChops, ImageDraw, ImageStat class Side(object): TOP = 't' RIGHT = 'r' BOTTOM = 'b' LEFT = 'l' ALL = (TOP, RIGHT, BOTTOM, LEFT) def _crop(img, bbox, sides=Side.ALL): bbox = ( bbox[0] if...
{ "content_hash": "d1658db9a351692872868c76abac3860", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 101, "avg_line_length": 34.86470588235294, "alnum_prop": 0.5851189471908217, "repo_name": "kezabelle/pilkit", "id": "b039d3026659e7b6fec66cd08bd7560b559d2814", "size": "59...
from django.contrib import admin from .models import GroupThread, PrivateThread admin.site.register(GroupThread) admin.site.register(PrivateThread)
{ "content_hash": "db4b0fd84fc761c75f43f4bb67ea721c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 46, "avg_line_length": 24.833333333333332, "alnum_prop": 0.8456375838926175, "repo_name": "olegpshenichniy/truechat", "id": "f94a718bfffb393f36fedb691485be1a180c57e1", "size...
import os, sys, re, string from dvm_permissions_unformatted import PERMISSIONS from permissions_by_hand import PERMISSIONS_BY_HAND BASIC_TYPES = { "byte" : "B", "char" : "C", "double" : "D", "float" : "F", "int" : "I", "long" : "J", "short" : "S", "boolean" : "B", "void" : "V", } ADVANCED_...
{ "content_hash": "5c518fcde1ef486c24b920fa4f595a0a", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 128, "avg_line_length": 32.735537190082646, "alnum_prop": 0.5331986872002019, "repo_name": "subho007/androguard", "id": "51b0badc27d34aa4d4d2184116e6f4b91ec3cebe", "size":...
def probability(k, m, n): """Given a population containing k + m + n organisms: k are homozygous dominant for a factor, m are heterozygous, n are homozygous recessive; Return the probability that two randomly selected mating organisms will produce an individual possessing a dominant allele.""" population = ...
{ "content_hash": "c6a50d99e1fa844e9f24e2abb89efc58", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 73, "avg_line_length": 35.75, "alnum_prop": 0.7395104895104895, "repo_name": "cmalone/rosalind", "id": "754cc934061d7b7f9c36ff8b9e164de86767c568", "size": "572", "binary"...
from django.conf.urls.i18n import i18n_patterns from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = i18n_patterns('', url(r'^admin/', include(admin.site.urls)), url(r'^originalseourl/', include('cmsplugin_seocheck.urls', namespace="cmsplugin_seocheck")), url(...
{ "content_hash": "097489dac02dcce0618410910caf78fa", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 97, "avg_line_length": 35, "alnum_prop": 0.72, "repo_name": "creimers/cmsplugin_seocheck", "id": "46520bb9aa0b6d72d4f5ebc4201638a846a9885d", "size": "350", "binary": fals...
""" generator.py is a simple script that creates a sqlite database of Android device models and its corresponding user-friendly names, e.g.: SM-N910W8, Samsung Galaxy Note4. This is part of AndroidDeviceNames library: https://github.com/tslamic/AndroidDeviceNames :copyright: (c) 2017 by Tadej Slamic (github.com/tslam...
{ "content_hash": "dbc6406f9bc36a1dc377dec80d7453c2", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 75, "avg_line_length": 26.533783783783782, "alnum_prop": 0.6121721415839063, "repo_name": "tslamic/AndroidDeviceNames", "id": "183e1dbaa40ad53bb2de22e1c9f4c46d5218ee41", "...
from __future__ import annotations from typing import Any import functools import logging import click from .hashes import MD5Hasher, SHA1Hasher, SHA256Hasher log = logging.getLogger(__name__) class AttrDict: def __init__(self, **kwargs): self.__dict__.update(kwargs) @click.group() @click.version_op...
{ "content_hash": "1a5ea443f4c9aa733dd3d5ed4e519a9f", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 88, "avg_line_length": 28.14814814814815, "alnum_prop": 0.6128947368421053, "repo_name": "wfscheper/hasher", "id": "f6008140dbd319e55a2af4fe9e57c8724f8227cb", "size": "437...
"""Defines the :class:`Model` class. See :ref:`dev.models`, :doc:`/dev/delete`, :doc:`/dev/disable`, :doc:`/dev/hide`, :doc:`/dev/format` """ import logging ; logger = logging.getLogger(__name__) import copy from django.db import models from django.conf import settings from django.core.exceptions import ValidationE...
{ "content_hash": "7d3e282eaba5e8a0414356ae5fb63423", "timestamp": "", "source": "github", "line_count": 1060, "max_line_length": 123, "avg_line_length": 34.259433962264154, "alnum_prop": 0.5584193859286796, "repo_name": "lino-framework/lino", "id": "e17f6d1fbf51079e4bbe7db01780b2ff59e84672", "size"...
from setuptools import setup setup(name='flier', version='0.1', description='Endpoint for KRL Sky API.', author='Randall Bohn', author_email='flier@rsbohn.com', packages=['flier'], package_dir={'':'src'}, install_requires=[], entry_points=(""" [console_scripts] ff=flier:...
{ "content_hash": "8af8ddbbe0f85df789cda0cf855ba980", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 46, "avg_line_length": 23.066666666666666, "alnum_prop": 0.5924855491329479, "repo_name": "rsbohn/flier", "id": "ba7ea4d4efa4df2b6b472561f0792f155f600e52", "size": "369", ...
import unittest import logging from tests.utils import maprdb_connect class BaseMapRDBTest(unittest.TestCase): """ Base test class, opens connection to MapRDB. """ def setUp(self): try: self.connection = maprdb_connect() except: self.fail("connection() raised un...
{ "content_hash": "4b28b36617a04d7f145c190a487e559e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 22.894736842105264, "alnum_prop": 0.6413793103448275, "repo_name": "mapr-demos/python-bindings", "id": "382c9767addc6029dc2d07432aecbad0da564b92", "s...
"""Generate random NodeReference.""" import d1_common.types.dataoneTypes import d1_test.instance_generator.random_data def generate(prefix="urn:node:", min_len=5, max_len=20): """Generate instance of nodeReference holding a urn:node:<random> string.""" s = generate_bare(prefix, min_len, max_len) return ...
{ "content_hash": "d260f33f2755cb2163b04911a1cfd4f4", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 80, "avg_line_length": 35.285714285714285, "alnum_prop": 0.699055330634278, "repo_name": "DataONEorg/d1_python", "id": "a1ef98f056ab70fd37ad58a546afccaa45aa65d4", "size": "...
import random from agents import Direction from agents import Agent from agents import ReflexVacuumAgent, ModelBasedVacuumAgent, TrivialVacuumEnvironment, compare_agents,\ RandomVacuumAgent random.seed("aima-python") def test_move_forward(): d = Direction("up") l1 = d.move_forward((0, 0))...
{ "content_hash": "5f1d76046259748a52830d4331ec04f2", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 103, "avg_line_length": 30.235294117647058, "alnum_prop": 0.6750972762645915, "repo_name": "SnShine/aima-python", "id": "59ab6bce906611f8d4e3ca42641d234b9df52024", "size":...
from app import app, logging from flask import (request, make_response) @app.route('/api/airtime/dlr/', methods=['POST']) def airtime_dlr_callback(): if request.method == 'POST': # Reads the variables sent via POST from our gateway _from = request.values.get('from', None) to = request.val...
{ "content_hash": "54f687f22a3db93ae23eb1563c04b360", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 60, "avg_line_length": 30.724137931034484, "alnum_prop": 0.5836139169472503, "repo_name": "AfricasTalkingLtd/Outreach", "id": "d1d40641fb854c5df8ccaecc01f07236e48237d9", "s...
"""Test cluster store.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os import os.path as op import numpy as np from numpy.testing import assert_array_equal as ae from numpy.testing i...
{ "content_hash": "faa33b66613e54a9da6e80413587ca43", "timestamp": "", "source": "github", "line_count": 421, "max_line_length": 79, "avg_line_length": 31.97624703087886, "alnum_prop": 0.5418957064329223, "repo_name": "nippoo/phy", "id": "158d7b495ec66b7952346ec40b28207e568de09f", "size": "13487", ...
import os VERSION = None def get_version(): global VERSION if not VERSION: VERSION = os.environ.get('BOOTSTRAPPER_VERSION', 'unspecified') return VERSION
{ "content_hash": "cf61379a466b60c24021b975d2d2d2e3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 19.555555555555557, "alnum_prop": 0.6761363636363636, "repo_name": "remohammadi/coreos-cloud-bootstrapper", "id": "c2c23020ef97e369d4b92a4f8fd2bd981b321...
from invoke import task, Collection @task def z_toplevel(ctx): pass @task def subtask(ctx): pass ns = Collection(z_toplevel, Collection('a', Collection('b', subtask)))
{ "content_hash": "55a0125fad50ac6e5da36abcc519a3ea", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 16.272727272727273, "alnum_prop": 0.6927374301675978, "repo_name": "mkusz/invoke", "id": "cd629d34067a38f901903e288e832fe52381feda", "size": "179", ...
from typing import List from tensorflow import keras @keras.utils.register_keras_serializable(package="keras_nlp") class Tokenizer(keras.layers.Layer): """A base class for tokenizer layers. Tokenizers in the KerasNLP library should all subclass this layer. The class provides two core methods `tokenize()...
{ "content_hash": "62f4ebc3f1bb8abdf6b323b55f28f406", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 80, "avg_line_length": 36.7421875, "alnum_prop": 0.6132256006804168, "repo_name": "keras-team/keras-nlp", "id": "762a6d9d2075d744f332001e108eeeb7ed5b4358", "size": "5289",...
import param import numpy as np import imagen as ig from topo.base.arrayutil import DivideWithConstant, MultiplyWithConstant from topo.base.projection import SheetMask, CircularMask from topo import optimized, projection, sheet from topo.sparse.sparsecf import SparseConnectionField, CFPLF_Hebbian_Sparse,\ ...
{ "content_hash": "cfa0af433e6e7ac39a7fbabe2565ba8d", "timestamp": "", "source": "github", "line_count": 331, "max_line_length": 99, "avg_line_length": 41.090634441087616, "alnum_prop": 0.6234835673847511, "repo_name": "ioam/topographica", "id": "e70d6ddc9932899793ce93eef4a32b0ad3f104fa", "size": "1...
from cloudify import ctx from cloudify.exceptions import NonRecoverableError from cloudify.state import ctx_parameters as inputs import subprocess import os import re import sys import time import threading import platform from StringIO import StringIO from cloudify_rest_client import CloudifyClient from cloudify impor...
{ "content_hash": "0871a2a3447bd012876de517828f9fbe", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 159, "avg_line_length": 45.7967032967033, "alnum_prop": 0.6619676064787042, "repo_name": "victorkeophila/alien4cloud-cloudify3-provider", "id": "18272fc74d86adc3d2e196ea1680...
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload import urllib.parse from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFo...
{ "content_hash": "7e86f8c6da40e0082d4b2e5363b84b9b", "timestamp": "", "source": "github", "line_count": 1019, "max_line_length": 186, "avg_line_length": 44.70461236506379, "alnum_prop": 0.6397242832682092, "repo_name": "Azure/azure-sdk-for-python", "id": "6b400fb48427aa6abd32f714f2b12dd76c96911f", ...
from unittest import mock, TestCase from nose.plugins.attrib import attr from nose.tools import assert_raises import os import shutil from PIL import Image from shiftmedia import Storage, BackendLocal, utils from shiftmedia import exceptions as x from shiftmedia.testing.localstorage_testhelpers import LocalStorageTest...
{ "content_hash": "d77ba0eef2eb19aa8e3e3bf3c9f4fece", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 79, "avg_line_length": 31.93777777777778, "alnum_prop": 0.5645699972168104, "repo_name": "projectshift/shift-media", "id": "0a7034a6cadf0b7b423fd7ea70dab762159a3bbd", "siz...
from streamlink.plugins.tviplayer import TVIPlayer from tests.plugins import PluginCanHandleUrl class TestPluginCanHandleUrlTVIPlayer(PluginCanHandleUrl): __plugin__ = TVIPlayer should_match = [ "https://tviplayer.iol.pt/direto/TVI24", "https://tviplayer.iol.pt/direto/TVI_AFRICA", "ht...
{ "content_hash": "9002f7aa4376ae6a7a73d4e47b5bfa68", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 97, "avg_line_length": 31.375, "alnum_prop": 0.7111553784860558, "repo_name": "chhe/streamlink", "id": "07380331a61c9e78635c163f39d9bf2935e67d4f", "size": "502", "binary"...
from __future__ import absolute_import import csv import decimal import matplotlib.pyplot as plt from PyQt4 import QtCore class GraphRecompensasPromedioWorker(QtCore.QObject): u""" Worker encargado de generar el gráfico correspondiente a las Recompensas Promedio por cada Episodio. """ def __init...
{ "content_hash": "807b3d7556cc97d6f41600e7be73526b", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 149, "avg_line_length": 32.17829457364341, "alnum_prop": 0.5251746567092267, "repo_name": "ssebastianj/ia2013-tpi-rl", "id": "58872fafd9f53c60df27af84b9ad3817f643e232", "s...
## # Import Modules # import os, sys, time from DataType import * ## EdkIIWorkspace # # Collect WorkspaceDir from the environment, the Verbose command line flag, and detect an icon bitmap file. # # @var StartTime: Time of build system starting # @var PrintRunTime: Printable time of build system ...
{ "content_hash": "f26f82c92028a775e5bc302853f35bca", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 158, "avg_line_length": 39.89542483660131, "alnum_prop": 0.6169724770642202, "repo_name": "bitcrystal/buildtools-BaseTools", "id": "d041b35411f20c85d2d2d32cca1e97b682776cf1"...
import unittest from eve.utils import config from tests import BaseTest, SimpleDoc, ComplexDoc class TestHttpDelete(BaseTest, unittest.TestCase): def setUp(self): response = self.client.post('/simpledoc/', data='[{"a": "jimmy", "b": 23}, {"a": "steve", "b": 77}]', content_type='a...
{ "content_hash": "91e9fdb2d562693f5c3ae2f6e5fe2554", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 80, "avg_line_length": 38.26373626373626, "alnum_prop": 0.5950603101665709, "repo_name": "MongoEngine/eve-mongoengine", "id": "daa8a18aae72cf201c52aafb557a89b30efd9dc9", "s...
"""This test covers the vtworker LegacySplitClone command. The vtworker LegacySplitClone should only be used when it is necessary to reshard a table that has textual primary key columns (e.g. VARCHAR). This is the case for the "timestamps" table in this end-to-end test. The reason why only LegacySplitClone supports t...
{ "content_hash": "29a51648198c90084b4a7b815d318cf9", "timestamp": "", "source": "github", "line_count": 621, "max_line_length": 80, "avg_line_length": 46.925925925925924, "alnum_prop": 0.6125733502625167, "repo_name": "pivanof/vitess", "id": "5e9e4e3e09b2ec9e02083100f188430a6b2fa3be", "size": "2987...
"""Tests for subscription management.""" from core.domain import collection_domain from core.domain import collection_services from core.domain import exp_domain from core.domain import exp_services from core.domain import feedback_domain from core.domain import feedback_services from core.domain import rights_manager...
{ "content_hash": "a557ef678e1991db5a70a85b7c9c1a9e", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 119, "avg_line_length": 43.21725239616613, "alnum_prop": 0.6572780365195535, "repo_name": "mit0110/oppia", "id": "7ef7055d7b30e395a03e043aa763b7379d284671", "size": "14150...
from datetime import timedelta import pytest from pycroft.helpers.interval import single, starting_from from pycroft.helpers.user import generate_password, hash_password from pycroft.model.user import IllegalLoginError, Membership, User, UnixAccount from tests import factories class Test_User_Passwords: @pytest...
{ "content_hash": "a781d9f43fe04a88860cbf0fb47af80d", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 97, "avg_line_length": 38.05298013245033, "alnum_prop": 0.6231291333101288, "repo_name": "agdsn/pycroft", "id": "ce1b855db5940ada7da8efdc6c53286c95ffefba", "size": "11700"...
"""Signals.py -- dump a python stacktrace if something bad happens. DO NOT USE THIS MODULE IN PRODUCTION CODE This module has two functions in its public API: - dumpStackOnFatalSignal() This function will install signal handlers that print a stacktrace and then reraise the signal. - resetFatalSignals(...
{ "content_hash": "bc901bc21e1198c9822d83016f0512a0", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 72, "avg_line_length": 29.987179487179485, "alnum_prop": 0.7114151346729372, "repo_name": "ariabuckles/pyobjc-core", "id": "317b6ab531d7b0e7a0597e575e0f37fe7c1468fd", "size...
import re from uamobile.parser.base import UserAgentParser WILLCOM_RE = re.compile(r'^Mozilla/3\.0\((?:DDIPOCKET|WILLCOM);(.*)\)') WILLCOM_CACHE_RE = re.compile(r'^[Cc](\d+)') WINDOWS_CE_RE = re.compile(r'^Mozilla/4\.0 \((.*)\)') class WillcomUserAgentParser(UserAgentParser): def parse(self, useragent): i...
{ "content_hash": "c60c8abab9dc0139428532d63b0b3393", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 106, "avg_line_length": 33.971014492753625, "alnum_prop": 0.5127986348122867, "repo_name": "csakatoku/uamobile", "id": "64b161220ce46b9fa52e1c2594a2b3d98dfeaa17", "size": "...
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
{ "content_hash": "3083b1f1405573930fb86842300d915a", "timestamp": "", "source": "github", "line_count": 4366, "max_line_length": 594, "avg_line_length": 65.47595052679799, "alnum_prop": 0.6119922481704843, "repo_name": "Chiru/NVE_Simulation", "id": "e5dbabfe1aeb394aff0a0fe6df073741e421e12e", "size"...
from django.core import mail from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.conf import settings from model_mommy import mommy from SimpleMooc.courses.models import Course class CourseManagerTestCase(TestCase): def setUp(self): ...
{ "content_hash": "00c610968a2af5866fff82c529bcc004", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 74, "avg_line_length": 30.03125, "alnum_prop": 0.6670135275754423, "repo_name": "andersondss/LearningDjango", "id": "00cbae90eb1dc516fa9019dfb24d6ed0152addb7", "size": "961...
import os import unittest import platform import urwid from urwid.compat import PYTHON3 class EventLoopTestMixin(object): def test_event_loop(self): rd, wr = os.pipe() evl = self.evl out = [] def step1(): out.append("writing") os.write(wr, "hi".encode('asci...
{ "content_hash": "d6cd8fe4658a3365daa704cca656f8e2", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 70, "avg_line_length": 29.476190476190474, "alnum_prop": 0.5771982460189246, "repo_name": "fkolacek/FIT-VUT", "id": "c85bbed4798280c0ab1d6c6dee41f1c20522d453", "size": "43...
import ConfigParser import io sample_config = """ [display] colormap3d: gray """ cfg = ConfigParser.SafeConfigParser() cfg.readfp(io.BytesIO(sample_config))
{ "content_hash": "9b08b303f990b1c1260371083b1bb800", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 37, "avg_line_length": 15.9, "alnum_prop": 0.7547169811320755, "repo_name": "chaubold/hytra", "id": "eba3e2bc93f608aae686b0680aa7131cd086bfc3", "size": "159", "binary": f...
# this file expects local_settings.py to be in the same dir, with statsd host and port information: # # statsd_host = 'localhost' # statsd_port = 8125 # Sends statistics to the stats daemon over UDP class Statsd(object): @staticmethod def timing(stat, time, sample_rate=1): """ Log timin...
{ "content_hash": "3bcf7e8f13e9314644d7a332af9fe5be", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 99, "avg_line_length": 29.229885057471265, "alnum_prop": 0.5218246165945734, "repo_name": "jedi4ever/statsd", "id": "1908362758bbbd70e9c2b7462d0e7fbf99659bea", "size": "262...
__revision__ = "test/TEX/glossary.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Validate that use of \glossary in TeX source files causes SCons to be aware of the necessary created glossary files. Test configuration contributed by Robert Managan. """ import os import TestSCons test = TestSCons.Te...
{ "content_hash": "fafefd259c1f4fc95702d4c80c613a32", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 94, "avg_line_length": 25.9390243902439, "alnum_prop": 0.7273154677950164, "repo_name": "EmanueleCannizzaro/scons", "id": "1e40c7618c8ad6bc06e5fca8ab882e6618c51f6e", "size"...
from django.db import models from django.contrib.auth.models import User from django.utils.encoding import python_2_unicode_compatible from . import constants from .managers import charla @python_2_unicode_compatible class Categoria(models.Model): nombre = models.CharField(max_length=255) def __str__(self)...
{ "content_hash": "17d9b90e57f644d2a288129cf7b96d63", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 79, "avg_line_length": 31.745098039215687, "alnum_prop": 0.6973440395305744, "repo_name": "Scot3004/temii", "id": "b92312bd9697be537d384a8162396566a5f2652b", "size": "1636"...
from django.db import models from django.contrib.auth.models import User UNIT_RANKS = ( (0, 'FLAG'), (1, 'SPY'), (2, 'PRIVATE'), (3, 'SERGEANT'), (4, '2ND LIEUTENANT'), (5, '1ST LIEUTENANT'), (6, 'CAPTAIN'), (7, 'MAJOR'), (8, 'LIEUTENANT COLONEL'), (9, 'COLONEL'), (10, 'ONE ...
{ "content_hash": "2bb6b8e3e4cda83a5ca806e43c6eba95", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 71, "avg_line_length": 25.464285714285715, "alnum_prop": 0.6065918653576438, "repo_name": "hephaestus-dev/salpakan-online", "id": "26e1e1757519373e704671c846750c272fb5ced5", ...
from django.forms.models import ModelForm from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from treatment_sheets.models import TxItem, TxSheet class TxSheetForm(ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = Form...
{ "content_hash": "908d4510d5c56ee047ad62dfa226095b", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 120, "avg_line_length": 31.652173913043477, "alnum_prop": 0.6236263736263736, "repo_name": "onnudilol/vetcalc", "id": "256d7bc0f147a5bcc4a5687b8e59eb4441e3cc9e", "size": "1...
from .model import * from .behavior import * from .util import *
{ "content_hash": "4b6d35d895e65f5b38acd56b70f1f5b7", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 23, "avg_line_length": 21.666666666666668, "alnum_prop": 0.7230769230769231, "repo_name": "markEarvin/sl-contest-tracker", "id": "a2103c44fa24b20e264e3c7b83ddf8eaeae28fc0", ...
""" Ferris' routing utilities """ import os import inspect import webapp2 import logging import ferris from ferris.core import inflector from webapp2 import Route from webapp2_extras import routes def get_true_name_and_argspec(method): """ Drills through layers of decorators attempting to locate the actu...
{ "content_hash": "3c512f2f17a6a065c2402086f5663ec4", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 129, "avg_line_length": 32.196875, "alnum_prop": 0.6228283024361836, "repo_name": "yowmamasita/social-listener-exam", "id": "87e8edbe22a947e7381045f5ac0c5dde138469a0", "si...
from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-i...
{ "content_hash": "97ab89848dc43c3a4a6cbffdd7129901", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 107, "avg_line_length": 51.41935483870968, "alnum_prop": 0.71267252195734, "repo_name": "Azure/azure-sdk-for-python", "id": "d01841a7fb0578b8db8da4a37d063f067f75093a", "siz...
import warnings from django.conf import settings from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe, SafeData def ngettext(singular, plural, number): if number == 1: return singular return plural ngettext_lazy = ngettext def ungettext(singular, plural, number): r...
{ "content_hash": "444f0f8e886d2dc347651adfbd94fa69", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 77, "avg_line_length": 30.321428571428573, "alnum_prop": 0.7267373380447585, "repo_name": "jamespacileo/django-france", "id": "5622c03f551b90bb9d14f5e84de7cd849f82bf93", "s...
"""Support for RFXtrx switches.""" import logging import RFXtrx as rfxtrxmod from homeassistant.components.switch import SwitchEntity from homeassistant.const import CONF_DEVICES, STATE_ON from homeassistant.core import callback from . import ( DEFAULT_SIGNAL_REPETITIONS, DOMAIN, RfxtrxCommandEntity, ...
{ "content_hash": "f3243d5a4b5028c3fe0f3b4a9652bbfe", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 80, "avg_line_length": 28.260563380281692, "alnum_prop": 0.6052828307999003, "repo_name": "jawilson/home-assistant", "id": "21e9e06b802baa15ea553f505e3be412165bfd05", "siz...
from __future__ import absolute_import from __future__ import division from __future__ import print_function # no unicode literals try: import unittest2 as unittest except ImportError: import unittest import os import os.path import subprocess import inspect import glob import re import WatchmanInstance import...
{ "content_hash": "03f5fb0147ede7735c4a33edd0a09bce", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 81, "avg_line_length": 31.93577981651376, "alnum_prop": 0.6130422292444699, "repo_name": "kwlzn/watchman", "id": "5dba2af89f000c6e39e399857839e40a0556d121", "size": "3481"...
from django import http from django.views.decorators.csrf import csrf_exempt from django.utils.decorators import method_decorator from django.utils.cache import add_never_cache_headers from django.utils.translation import ugettext_lazy as _ from hyperadmin.links import Link class ConditionalAccessMixin(object): ...
{ "content_hash": "1c39a6149dea1d365d6f3beff774a766", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 103, "avg_line_length": 37.054794520547944, "alnum_prop": 0.6118299445471349, "repo_name": "zbyte64/django-hyperadmin", "id": "76b8d5f503b1bf702cbb5175fa9866fe6f0c0983", "...
import logging as _logging from lib.utility import misc from lib.aws.webservice import AWSQueryClient from lib.aws.webservice import AWSSignature from lib.aws.exception import AwsErrorCode from lib.aws.exception import AwsServiceException from lib.aws.exception import MissingParameterException from lib.aws.exception i...
{ "content_hash": "fb2905a6f6698f669132ee0a85c9fcfc", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 92, "avg_line_length": 39.108695652173914, "alnum_prop": 0.6288215675375208, "repo_name": "radzhome/AWS-ElasticBeanstalk-CLI", "id": "3c264d7db2cc1d7f79fc9c1296151a3a503ce51...
"""List all global IPs.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting @click.command() @click.option('--ip-version', help='Display only IPv4', type=click.Choice(['v4', 'v6'])) @en...
{ "content_hash": "93900147d31cf9e21cf0d9df70cc4ef8", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 74, "avg_line_length": 29.6, "alnum_prop": 0.5459459459459459, "repo_name": "skraghu/softlayer-python", "id": "ec1b6d846bcdfc4cbf7e6c323dcaf3b079a72046", "size": "1480", ...