text stringlengths 4 1.02M | meta dict |
|---|---|
from setuptools import setup
setup(
name='multitables',
version='2.0.1',
url='https://github.com/ghcollin/multitables',
description='High performance parallel reading of HDF5 files using PyTables, multiprocessing, and shared memory.',
long_description=open("README.rst").read(),
long_description... | {
"content_hash": "e82322bf5114ef443c7b7637e67b4a93",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 118,
"avg_line_length": 37.888888888888886,
"alnum_prop": 0.6363636363636364,
"repo_name": "ghcollin/multitables",
"id": "260aaebe440176ac10eaa43ae74575aa34086802",
"size":... |
import time
from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class Base(TorrentProvider):
urls = {
'test': 'http://scenefz.net... | {
"content_hash": "e49debe58f891df8b2cae39051a02d35",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 96,
"avg_line_length": 36.05952380952381,
"alnum_prop": 0.5057774843182569,
"repo_name": "valentinolaru/couchpotato-searchers-plugins",
"id": "a121045575dc253e31bf43918560197... |
import random
import string
import zmq
import numpy as np
import weakref
from .ringbuffer import RingBuffer
from .streamhelpers import all_transfermodes
from ..rpc import ObjectProxy
from .arraytools import fix_struct_dtype, make_dtype
default_stream = dict(
protocol='tcp',
interface='127.0.0.1',
port='*... | {
"content_hash": "088edba5b8484ac836f53b1f8f03ff84",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 139,
"avg_line_length": 39.33756345177665,
"alnum_prop": 0.5875217755984257,
"repo_name": "pyacq/pyacq",
"id": "c3354c62169834a024a2c7ee8cc02cd44e36a1f9",
"size": "15670",... |
import pytest
from src.str_permutations import helper_perm, str_permutation
def test_helper_perm1():
all_perm = set()
assert helper_perm('abc', 2, all_perm) == set(['abc'])
def test_helper_perm2():
all_perm = set()
assert helper_perm('abc', 1, all_perm) == set(['abc', 'acb'])
def test_helper_perm3... | {
"content_hash": "4f3a60f5b049fdc1ffdcde817b42f368",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 65,
"avg_line_length": 22.634146341463413,
"alnum_prop": 0.5969827586206896,
"repo_name": "tanyaweaver/code-katas",
"id": "7b6238194ebc51bb6ee63900f0a3def51244a76b",
"size"... |
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = False
TEMPLATE_DEBUG = DEBUG
FEATURES = {
'ENABLE_DJANGO_ADMIN_SITE': True,
'ADMIN_LIB': 'xadmin', # 可以在 xadmin, admin中选择,admin
# 二者不能同时使用,admin的用法看文档
# xadmin的Admin集成自objec... | {
"content_hash": "29462fff3f1f4fffa81c8e5b8ecd68a9",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 112,
"avg_line_length": 32.994805194805195,
"alnum_prop": 0.6804691805085413,
"repo_name": "duoduo369/django-scaffold",
"id": "ac58327b9de9333e7b812404bdb9a3ffe85fc1b2",
"... |
from __future__ import absolute_import
from injector import exceptions, graph, injector
class Dependencies(object):
""" A factory for setting up and building an Injector instance. """
def __init__(self):
self._factories = dict()
def register_value(self, name, value):
"""
Bind a v... | {
"content_hash": "45ff309c60b8ce5026bfd42b0d799042",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 89,
"avg_line_length": 40.355932203389834,
"alnum_prop": 0.6551868962620747,
"repo_name": "jmikkola/dep_injector",
"id": "cc6931bfb24cca213a19455fdd829d20a2dde0d4",
"size":... |
import itertools
from django.contrib.admin.utils import NestedObjects
from django.db import router
def related_objects(obj):
collector = NestedObjects(using=router.db_for_write(obj))
collector.collect([obj])
def flatten(elem):
if isinstance(elem, list):
return itertools.chain.from_it... | {
"content_hash": "102cfb68f99c93f17de6cd87f793fbe2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 26.88235294117647,
"alnum_prop": 0.6673960612691466,
"repo_name": "AccentDesign/Accent_SoftDelete",
"id": "79bae60db035d8f967dfc5055e18707f807eb859",
... |
BOT_NAME = 'tbp_scraper'
SPIDER_MODULES = ['tbp_scraper.spiders']
NEWSPIDER_MODULE = 'tbp_scraper.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'tbp_scraper (+http://www.yourdomain.com)'
# Obey robots.txt rules
ROBOTSTXT_OBEY = True
# Configure maximum conc... | {
"content_hash": "9618c69c517cb13027a7d2fe9e840dc5",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 109,
"avg_line_length": 34.58227848101266,
"alnum_prop": 0.7675695461200586,
"repo_name": "nathanpucheril/CalExam",
"id": "db4004ab86dae3df6b84a177164f318e42be00ae",
"size"... |
import os
import pytest
import re
import uuid
from subprocess import call
from tests.common.test_vector import TestDimension
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.skip import SkipIfS3, SkipIfIsilon
# Number of tables to create per thread
NUM_TBLS_PER_THREAD = 10
# Each client wi... | {
"content_hash": "764e1c4bb425a8ddd03671579086e998",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 90,
"avg_line_length": 44.015151515151516,
"alnum_prop": 0.6919104991394148,
"repo_name": "scalingdata/Impala",
"id": "76309fdfa4624e2c5b5d2c087738d04abd925fda",
"size": "3... |
import requests
url = "https://api.pdf.co/v1/file/upload/url"
# You can also upload your own file into PDF.co and use it as url. Check "Upload File" samples for code snippets: https://github.com/bytescout/pdf-co-api-samples/tree/master/File%20Upload/
payload = {'name': 'sample.pdf',
'url': 'https://bytescout-com.... | {
"content_hash": "724cd0f240cc0b647d5c92aa691db5c7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 192,
"avg_line_length": 33.64705882352941,
"alnum_prop": 0.7027972027972028,
"repo_name": "bytescout/ByteScout-SDK-SourceCode",
"id": "c483a174bffac529464fd0461d8ee8205fc390f... |
import re
import typing
from collections import defaultdict
import hermes.language as lng
from hermes.tag.pos import PartOfSpeech
from hermes.types import TOKEN, PART_OF_SPEECH, LANGUAGE
from .span import Span
def return_none():
"""
Simple method that returns None for defaultdict to allow pickling
:retur... | {
"content_hash": "3f9d56e69a5146a3e8590ce850b7119a",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 115,
"avg_line_length": 30.602272727272727,
"alnum_prop": 0.5930189379873747,
"repo_name": "dbracewell/pyHermes",
"id": "b171b1b1ec2a4dfe5f6cd3396b09b729bacecc0c",
"size":... |
"""
Test the output of `frame diagnose` for calling virtual methods
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestDiagnoseVirtualMethodCall(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
... | {
"content_hash": "3c85c6bfdd075633243f54b111ad2bfa",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 101,
"avg_line_length": 33.8,
"alnum_prop": 0.6840236686390533,
"repo_name": "endlessm/chromium-browser",
"id": "7ea42dea49c147962841443bc13d327e2c141f11",
"size": "845",
... |
import unittest
import sys
import os
ROOT_PATH = os.path.dirname(__file__)
if __name__ == '__main__':
if 'GAE_SDK' in os.environ:
SDK_PATH = os.environ['GAE_SDK']
sys.path.insert(0, SDK_PATH)
import dev_appserver
dev_appserver.fix_sys_path()
tests = unittest.TestLoader().d... | {
"content_hash": "fc00f3e17768ae405a3e7773afdb7f02",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 20.818181818181817,
"alnum_prop": 0.6157205240174672,
"repo_name": "renzon/gaecookie",
"id": "3adc1ec8e4b62082301006d70b43e2cb3a522217",
"size": "497... |
from django.test import TestCase
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.users.analytics import update_analytics_indexes, get_count_of_active_commcare_users_in_domain, \
get_count_of_inactive_commcare_users_in_domain, get_active_commcare_users_in_domain, \
get_inactive_commcare_u... | {
"content_hash": "24168fa384729acd3f7ff3d9ee5e92bf",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 113,
"avg_line_length": 39.432432432432435,
"alnum_prop": 0.6559287183002056,
"repo_name": "qedsoftware/commcare-hq",
"id": "4cb04973b4f1c36bace243a85f1ddabe175de282",
"siz... |
import matplotlib.pyplot as plt
from permeability.functions import savitzky_golay
from matplotlib.ticker import LogLocator, MultipleLocator, FormatStrFormatter
from matplotlib.ticker import LogFormatter
import numpy as np
import pdb
#import matplotlib
#matplotlib.rc('font', family='Arial')
def plot_forces(z_windows,... | {
"content_hash": "863811ce38608b152ecb8e31bd48bbd8",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 97,
"avg_line_length": 38.5990099009901,
"alnum_prop": 0.6138258304476081,
"repo_name": "tcmoore3/permeability",
"id": "1b6c72045d0a508ce85f566e92f479dd19f52a35",
"size": ... |
"""
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": "eae0bd82f91d7c32c83a54f91c794daa",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 84,
"avg_line_length": 33.58169934640523,
"alnum_prop": 0.5895289996107435,
"repo_name": "onshape-public/onshape-clients",
"id": "3be2e802decf4bf03819a3afa2f65b2631413fb1",
... |
from alembic import util, command, config
import argparse
import inspect
class AlembicCommandLine(object):
prog = None
description = None
allowed_commands = None
def __init__(self, prog=None, description=None, allowed_commands=None):
if prog is not None:
self.prog = prog
i... | {
"content_hash": "81830fd95d4b225923d39e31ac7e3820",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 77,
"avg_line_length": 39.359154929577464,
"alnum_prop": 0.4877437824297728,
"repo_name": "SandyWalsh/stacktach-winchester",
"id": "74315d90853ccb50d6e8d6018b567f14aa463a3b"... |
"""Tools for using Python's :mod:`json` module with BSON documents.
This module provides two helper methods `dumps` and `loads` that wrap the
native :mod:`json` methods and provide explicit BSON conversion to and from
json. This allows for specialized encoding and decoding of BSON documents
into `Mongo Extended JSON
... | {
"content_hash": "1036a28a634abaf800a520825e2956d0",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 176,
"avg_line_length": 36.75308641975309,
"alnum_prop": 0.581793752099429,
"repo_name": "llvtt/mongo-python-driver",
"id": "5ac43c36786a8405de3d87a971d5ddf23cd25950",
"si... |
import logging
import os
from test import LisaTest
TESTS_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
TESTS_CONF = os.path.join(TESTS_DIRECTORY, "smoke_test.config")
class SFreq(LisaTest):
"""Tests for SchedFreq framework"""
@classmethod
def setUpClass(cls, *args, **kwargs):
super(SFr... | {
"content_hash": "137c97223dad82e4ff18e4cfb5cec85f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 63,
"avg_line_length": 25.75,
"alnum_prop": 0.6776699029126214,
"repo_name": "JaviMerino/lisa",
"id": "a6cc83cce691c7e203c0fe1c40decf872908452b",
"size": "1152",
"binary"... |
from newsfeedsDataLayer.models import Artical
from newsfeedsDataLayer.models import User_id
#import os
#User_id().insertUser(1)
#User_id().updateKeywords(1, "iPhone 苹果 谷歌 鲍尔默 长角 ZDNetXPVistaMaryJoFoley15 小米 电商 互联网 百度 永福 易信")
#User_id().updateKeywords(11, "百度 永福 易信 ")
#RelatedReading().insertRelatedReading("1461be38528d... | {
"content_hash": "771a00a6190c5715cf139faedf7c9c35",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 116,
"avg_line_length": 38.03125,
"alnum_prop": 0.6803615447822514,
"repo_name": "zhaishuai/NewsfeedsService",
"id": "69dcb103d936dc77b5bec90e5209438b0c7a9c82",
"size": "13... |
from p4app import P4Mininet
from camus import CamusApp
from camus_topo import SingleSwitchTopo, FatTreeTopo, getPort
import subprocess
import sys
import time
K = 4
itch_app = CamusApp('spec.p4', ingress_name='MyIngress')
itch_app.generateQueryPipeline('itch_camus.p4')
topo = FatTreeTopo(K)
topo.subscribe('h_0_0_0', ... | {
"content_hash": "58c3a913722ad37493512f3f5ce8a5e8",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 145,
"avg_line_length": 37.1025641025641,
"alnum_prop": 0.6120709513936881,
"repo_name": "theojepsen/p4app",
"id": "1e620eb5948ed177a431c0731d2300e94650aa67",
"size": "434... |
"""cell.bin.cell"""
from kombu import Connection
from .base import Command, Option
from cell import Agent
from cell.utils import instantiate
__all__ = ['cell', 'main']
DEFAULT_BROKER_URL = 'amqp://guest:guest@localhost:5672//'
class cell(Command):
args = '<agent object names>'
option_list = (
Option('-... | {
"content_hash": "b42017a664af0f8e8296148d5f09193f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 72,
"avg_line_length": 29.551020408163264,
"alnum_prop": 0.5994475138121547,
"repo_name": "celery/cell",
"id": "67edb6079bd6ea06e0fcfc7b02530295eb2baf56",
"size": "1448",
... |
import socket
s = socket.socket()
host = socket.gethostname()
port = 1024
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print 'Got connection from', addr
c.send('Thank you for connecting')
c.close()
| {
"content_hash": "eaf90f23c1beea336b3cbb16786dd6ae",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 38,
"avg_line_length": 17,
"alnum_prop": 0.6470588235294118,
"repo_name": "Great-Li-Xin/PythonDev",
"id": "2521609265559ef5dfde86d3fab65cb5bb08485b",
"size": "238",
"bina... |
"""Tests for ceilometer/storage/impl_mongodb.py
.. note::
In order to run the tests against another MongoDB server set the
environment variable CEILOMETER_TEST_MONGODB_URL to point to a MongoDB
server before running the tests.
"""
from ceilometer.alarm.storage import impl_mongodb as impl_mongodb_alarm
from cei... | {
"content_hash": "47e31c765cfa0483264aee61f8e3aa10",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 42.59154929577465,
"alnum_prop": 0.5283289241622575,
"repo_name": "yanheven/ceilometer",
"id": "28f6776cae32931ac253b65213fcd41366cc55f3",
"size": "... |
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 'Link.subscribe'
db.delete_column('projects_link', 'subscribe')
# Deleting field 'Link.subscriptio... | {
"content_hash": "4dbad13b3c960cfe2a287dcff2fe1fae",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 195,
"avg_line_length": 72.6910569105691,
"alnum_prop": 0.5558662342019909,
"repo_name": "mozilla/betafarm",
"id": "b06677dd07958d8023da0c3d5fbbe36da85808a5",
"size": "895... |
from __future__ import unicode_literals
from django.utils.html import format_html, format_html_join
from wagtail.core.blocks import CharBlock
from wagtail.core.blocks.list_block import ListBlock
from omni_blocks.blocks.struct_blocks import BasicCardBlock, FlowBlock
class BasicCardGridBlock(ListBlock):
"""Block ... | {
"content_hash": "7336aaabe7c70eb67b4be8d7371d062c",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 87,
"avg_line_length": 29.948979591836736,
"alnum_prop": 0.6149914821124361,
"repo_name": "omni-digital/omni-blocks",
"id": "b9cd89a2c51493e311ddda8119b1631ef2f556aa",
"siz... |
import logging
import os
import re
from webkitpy.common.memoized import memoized
from webkitpy.common.system.deprecated_logging import log
from webkitpy.common.system.executive import Executive, ScriptError
from .commitmessage import CommitMessage
from .scm import AuthenticationError, SCM, commit_error_handler
from .... | {
"content_hash": "dddf61a851bb56b537d5352c761e5fad",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 189,
"avg_line_length": 47.8372591006424,
"alnum_prop": 0.6335720680393913,
"repo_name": "leighpauls/k2cro4",
"id": "f68823871ff4f766d640b3658b771322e7a7fc39",
"size": "23... |
"""Fast Gradient Boosting decision trees for classification and regression."""
# Author: Nicolas Hug
from abc import ABC, abstractmethod
from collections.abc import Iterable
from functools import partial
from numbers import Real, Integral
import warnings
import numpy as np
from timeit import default_timer as time
fro... | {
"content_hash": "74b7f4e9f92a5a820ecaf5152e57411c",
"timestamp": "",
"source": "github",
"line_count": 1953,
"max_line_length": 88,
"avg_line_length": 40.48489503328213,
"alnum_prop": 0.5829106959920067,
"repo_name": "lesteve/scikit-learn",
"id": "470020dbd492bb827640ebe3ee2aef737afade5e",
"size":... |
"""
Database level utilities for PyTimeline.
"""
from pymongo.database import Database as PymongoDatabase
from pytimeline.collection import Collection
class Database(PymongoDatabase):
"""
A Mongo database.
"""
def __getattr__(self, name):
"""
Get a collection of this database.
... | {
"content_hash": "d4eca83193ffb8e8377649abaa63f872",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 62,
"avg_line_length": 21.266666666666666,
"alnum_prop": 0.6394984326018809,
"repo_name": "tadasv/pytimeline",
"id": "9af135e987de3bd3251b80acb95bcac9fe39ca64",
"size": "63... |
import sys
from airflow.hooks.mssql_hook import MsSqlHook
from airflow import configuration
from airflow import models
from airflow.utils import db
from hovertools import command_line
from .hooklib.basehooktest import BaseHookTest
# This catches sys.exit() calls, which are called by the Click library.
# If this is n... | {
"content_hash": "d610a2dc584c64bf48d276b119e629ad",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 82,
"avg_line_length": 34.2,
"alnum_prop": 0.6030701754385965,
"repo_name": "gtoonstra/airflow-hovercraft",
"id": "9199fb3282f426f98c0b59a9f38cb3d00a6eb2a5",
"size": "1935"... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'trucoGemSite.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^', include('truco.urls'), name... | {
"content_hash": "4f93578d7401f4160ceb357d6379f483",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 57,
"avg_line_length": 30.181818181818183,
"alnum_prop": 0.6355421686746988,
"repo_name": "emmanuel-santos/GEM",
"id": "8ed953443b3dcb134cace959149910e0bc5bf522",
"size": "... |
import argparse
import _pickle as pickle
import io
import os
import brica1
import cherrypy
import msgpack
import numpy as np
from PIL import Image
from PIL import ImageOps
from cognitive import interpreter
from ml.cnn_feature_extractor import CnnFeatureExtractor
from config import BRICA_CONFIG_FILE
from config.model... | {
"content_hash": "07213e4e04b06d801226419e899e1cc0",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 114,
"avg_line_length": 34.65734265734266,
"alnum_prop": 0.6684826472962067,
"repo_name": "tosanai/wbai_hackathon_2017",
"id": "8a35a908ebefd75634308e54874e5b8f262e5c26",
... |
""" PyTorch {{cookiecutter.modelname}} model. """
{% if cookiecutter.is_encoder_decoder_model == "False" %}
import math
import os
import torch
import torch.utils.checkpoint
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
from typing import Optional, Tuple, Union
from ...activ... | {
"content_hash": "372520643969b2bcd861805bd11c9c55",
"timestamp": "",
"source": "github",
"line_count": 3338,
"max_line_length": 390,
"avg_line_length": 46.27471539844218,
"alnum_prop": 0.6340077040106173,
"repo_name": "huggingface/transformers",
"id": "9e2154901aa6967409478415d102bfeb16be48ad",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Inc',
fields=[
('id', models.AutoField(auto_created=True, serialize=Fal... | {
"content_hash": "ec5e06451f8d5197d5d35692ae667d43",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 114,
"avg_line_length": 23.954545454545453,
"alnum_prop": 0.5351043643263758,
"repo_name": "matthewbentley/counter",
"id": "4cf4fc5c31642eaffbca983832ed7408679abacc",
"size... |
"""Constants for the Toon integration."""
from datetime import timedelta
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_PROBLEM,
)
from homeassistant.components.sensor import DEVICE_CLASS_POWER, DEVICE_CLASS_TEMPERATURE
from homeassistant.const import (
ATTR_DE... | {
"content_hash": "a3b80c251d5c3589e610128e2c87063d",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 88,
"avg_line_length": 33.708333333333336,
"alnum_prop": 0.6051091882983106,
"repo_name": "mKeRix/home-assistant",
"id": "d7f403f70132b833798dd6b167336953d095a4e1",
"size"... |
'''
A class for finding a vertex cut. A vertex cut is a a set of nodes, ideally the smallest number, that when removed yields a disconnected graph.
Apparently this is np-hard, so we settle for the following heuristic: iteratively remove the node that has the most edges until the graph is disconnected.
Examples:
... | {
"content_hash": "7467307b01afdcb8f2a178d75c805fa6",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 154,
"avg_line_length": 36.65094339622642,
"alnum_prop": 0.585070785070785,
"repo_name": "MicrosoftGenomics/FaST-LMM",
"id": "8487add61654dd80e0ed7f3cab0bab24f4af76cb",
"s... |
import numpy as np
import matplotlib.pyplot as plt
from sys import argv
# Bit-reversal function
# def _bit_reverse(n):
# return int(bin(n)[:1:-1], 2)
def _bit_reverse(n, width=8):
b = '{:0{width}b}'.format(n, width=width)
return int(b[::-1], 2)
# bit_reverse = np.frompyfunc(_bit_reverse, 1, 1)
bit_revers... | {
"content_hash": "2c3d8753aa3e9c25cb9315ec626a8973",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 110,
"avg_line_length": 35.75609756097561,
"alnum_prop": 0.6091405184174625,
"repo_name": "decarlof/timbir",
"id": "296c04d4efcc77f67b59d9ed6f89b5e8a8995bff",
"size": "2932... |
import collections
import copy
import warnings
from io import BytesIO, StringIO
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits.card import _pad
from astropy.io.fits.header import _pad_length
from astropy.io.fits.util import encode_ascii
from astropy.io.fits.verify import VerifyError... | {
"content_hash": "f7c11e82cfa7f42c99ccbf9a9a3d703b",
"timestamp": "",
"source": "github",
"line_count": 3096,
"max_line_length": 103,
"avg_line_length": 38.3640180878553,
"alnum_prop": 0.5529867396337613,
"repo_name": "larrybradley/astropy",
"id": "5488733e8e216a9caf02f7a6830e2a90fe724a0d",
"size":... |
import os
import logging
import urlparse
import simplejson as json
import itertools
from os.path import join
from uuid import uuid4
from zipfile import ZipFile
from datetime import datetime
from lxml import etree
from shutil import rmtree
from django.utils.functional import cached_property
from .config import DATETI... | {
"content_hash": "b3d4d2fe8b0db10eb6f248d48c1f0c7e",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 78,
"avg_line_length": 31.99074074074074,
"alnum_prop": 0.6005788712011577,
"repo_name": "zniper/django-scraper",
"id": "1114702b02f6d56fec807550d65a2d2c911a1cf1",
"size":... |
"""
This is a REST API to simulate a bowling algorithm.
Example::
from requests import post, put, get, delete
games = get('http://localhost:5000/v1/games').json()
Returns a list of games currently in the system. For more examples and the full api, see :py:mod:`app.resources.game`
"""
from flask import Flask
... | {
"content_hash": "04d0184bbc8da4c05b7cd6a8a6c59185",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 118,
"avg_line_length": 23.42222222222222,
"alnum_prop": 0.6821631878557874,
"repo_name": "xuru/bowling",
"id": "02e1be1d9804a0520e4c60e10021c3dbbe712135",
"size": "1054",
... |
from .dateAndTime import *
from .sections import *
from .subsections import * | {
"content_hash": "fda2b319b509733e38c86117d60b4260",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.7792207792207793,
"repo_name": "saraivaufc/jornalEletronico",
"id": "f52f2d3db90d92064d7ac10d70bc57d17a520e6b",
"s... |
#!/usr/bin/env python3
from distutils.core import setup
setup(
name='dg',
version='1.1.0+git',
description='A programming language for the CPython VM',
author='pyos',
author_email='pyos100500@gmail.com',
url='https://github.com/pyos/dg.git',
packages=['dg'],
package_dir={'dg': '.'},
... | {
"content_hash": "6f7a85efa0c5a134859c15a024f14380",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 27.071428571428573,
"alnum_prop": 0.5963060686015831,
"repo_name": "pyos/dg",
"id": "47fd51f739a6b644a799826a63304b06ace6b6c6",
"size": "379",
"bin... |
import socket
#system_ip = socket.gethostbyname(socket.getfqdn())
system_ip = "127.0.0.1"
peer_client_ip = system_ip
super_server_ip = system_ip
peer_server_ip = system_ip
super_client_ip = system_ip
debug = True #Print all activity on screen
peer_server_port = 2220 #Receiveing port for statistics data
super_reques... | {
"content_hash": "2abf68ea1a7c508164ba4f5d0e8205dc",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 95,
"avg_line_length": 41.911764705882355,
"alnum_prop": 0.7536842105263157,
"repo_name": "cloudbansal/p2p_health",
"id": "675ce8ac287e015c6b0ebdf99fecf244bd3fcc94",
"size"... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 5, transform = "Fisher", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "f32eb1130ea89f8fc02553ee9df584c3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 162,
"avg_line_length": 37.42857142857143,
"alnum_prop": 0.7022900763358778,
"repo_name": "antoinecarme/pyaf",
"id": "d0416b12a2d00df65915d4d2c51dd3cd9667e019",
"size": "262... |
import os
cpth = os.path.join('temp', 't005')
# make the directory if it does not exist
if not os.path.isdir(cpth):
os.makedirs(cpth)
def test_modflow_unstructured():
import flopy
mf = flopy.modflow.Modflow(version='mfusg', structured=False,
model_ws=cpth)
assert isinst... | {
"content_hash": "d46ab12ee8813798d347dfbdbbb7088b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 32.345454545454544,
"alnum_prop": 0.6554243957279371,
"repo_name": "aleaf/flopy",
"id": "2e6a766b527d8b9066e20b78632ce431d1ef54ee",
"size": "1817",
... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.timezone import now
from rapidsms.backends.kannel import KannelBackend
from rapidsms.backends.kannel.forms import KannelForm
from rapidsms.backends.kannel.models import DeliveryReport
from rapidsms.tests.harness import Rapi... | {
"content_hash": "b47e610e180e1a4ebbaee3954657479b",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 79,
"avg_line_length": 43.19277108433735,
"alnum_prop": 0.5736401673640167,
"repo_name": "peterayeni/rapidsms",
"id": "6f62924ad21b8ee0686b486fbbdb76c65c7c26f6",
"size": "... |
import json
from django.urls import reverse
from api.models import CreditCard, Income, Overdraft, PayType
from api.utils import serialize_money
from .base import APIBaseTest
class DebtTests(APIBaseTest):
url = reverse('get-debts')
def test_get_debts(self):
credit_card = CreditCard.objects.create(
... | {
"content_hash": "27fa84e0a67f02798f0724c9f461e1a7",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 88,
"avg_line_length": 30.71818181818182,
"alnum_prop": 0.5292986090559337,
"repo_name": "Siecje/debt",
"id": "3765eef48c8430ac6844a809d1ba57acba375c3b",
"size": "6758",
... |
import copy
import logging
import os
import PIL.Image
import tempfile
import threading
from handlers.handler_troll_response import HandlerTrollResponse
cached_get_image_lock = threading.Lock()
def cached_get_image(source, width, height):
cached_get_image_lock.acquire()
path = os.path.join(
os.path.dir... | {
"content_hash": "2a7e2b7943a3f09a450ab576a00c8aba",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 101,
"avg_line_length": 35.796875,
"alnum_prop": 0.5975556525534701,
"repo_name": "kazetkazet/trollproxy",
"id": "15284b108aac5e1fb60c65823379c375f8438923",
"size": "2291",... |
"""
This module contains the class `CKDio`.
"""
__all__ = ['CKDio']
from pathlib import Path, PosixPath
import h5py
import numpy as np
import xarray as xr
from moniplot.image_to_xarray import h5_to_xr
# - local functions ------------------------------
def reject_row257(xarr):
"""
Remove row 257 from DataAr... | {
"content_hash": "d7ce8f7ec14abde3ffaf1a184c4ef0d9",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 79,
"avg_line_length": 35.328638497652584,
"alnum_prop": 0.5128682170542636,
"repo_name": "rmvanhees/pys5p",
"id": "b9ff41d6a8458a7d603e64f7129ff466f7c8d68b",
"size": "227... |
"""Create a shop with article and order sequences.
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.shop.sequence.service import create_sequence
from byceps.services.shop.sequence.transfer.models import Purpose
from byceps.services.shop... | {
"content_hash": "b0afeacc7b49c583bbd27f11a04dbdde",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 30.885714285714286,
"alnum_prop": 0.7419056429232193,
"repo_name": "m-ober/byceps",
"id": "cdafe642d2d56b5e9efc3a390a3747abfd7fb57c",
"size": "1104",... |
from unittest import TestCase
from django.template import Context, Engine
from django.template.base import TextNode, VariableNode
from django.utils import six
class NodelistTest(TestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine()
super(NodelistTest, cls).setUpClass... | {
"content_hash": "0b78b8b594d6f22f765a6d452489ea7a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 97,
"avg_line_length": 38.172413793103445,
"alnum_prop": 0.5245408009635651,
"repo_name": "yephper/django",
"id": "7786ef2a4a28499c20a575f036f404752610ec0d",
"size": "3321"... |
bind = "127.0.0.1:8000"
workers = 5
worker_class = 'gevent'
# worker_class = 'egg:gunicorn#gevent'
# Logging
loglevel = 'critical'
acces_logfile = "access.log"
error_logfile = "error.log"
# enable_stdio_inheritance = True
timeout = 360
| {
"content_hash": "04fde0c4ee762f3b9307f0608116ede9",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 38,
"avg_line_length": 23.6,
"alnum_prop": 0.7076271186440678,
"repo_name": "geodashio/geodash-server",
"id": "a8e55067ba8761d6e80e34db5d717c2d6150f116",
"size": "236",
"... |
"""Render library code for accessing tf_mesh_renderer.
"""
import geometry
import ops
import render_utils
import tensorflow as tf
import tensorflow_addons as tfa
from tf_mesh_renderer.mesh_renderer import rasterize_triangles
def sobel_fg_alpha(idepth, beta=5.0):
"""Computes foreground alpha with sobel edges.
Alp... | {
"content_hash": "f03e7579a4421cda35c3d8f4c82b4230",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 87,
"avg_line_length": 36.38931297709924,
"alnum_prop": 0.6981329976924691,
"repo_name": "google-research/google-research",
"id": "4ecd1e5796407e8f202a9eced209e6ecd7f04b90",... |
from .test_sandpaper import (SandPaperTest,)
from .rules import *
| {
"content_hash": "1553727ddba8edee8656aa4af49a6e5b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 44,
"avg_line_length": 33,
"alnum_prop": 0.7727272727272727,
"repo_name": "stephen-bunn/sandpaper",
"id": "2d5868eca97aab15d6a4b2da677398e59eee6452",
"size": "221",
"binar... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('joins', '0007_auto_20170111_1359'),
]
operations = [
migrations.AddField(
model_name='join',
name='ref_if',
fiel... | {
"content_hash": "f35d9aad224cfdb4f3ddaa37f48d9bae",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 21.61111111111111,
"alnum_prop": 0.5861182519280206,
"repo_name": "micbuz/project2",
"id": "df04697a7121ffd06b985ba053adc6ea6f616eac",
"size": "462",... |
from google.cloud import aiplatform_v1
async def sample_create_hyperparameter_tuning_job():
# Create a client
client = aiplatform_v1.JobServiceAsyncClient()
# Initialize request argument(s)
hyperparameter_tuning_job = aiplatform_v1.HyperparameterTuningJob()
hyperparameter_tuning_job.display_name ... | {
"content_hash": "85f5e339846ca73d2c9c6ce868fbb41b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 107,
"avg_line_length": 44.38709677419355,
"alnum_prop": 0.7630813953488372,
"repo_name": "googleapis/python-aiplatform",
"id": "edf9bcc23060b6353bc8da3570b7a37aa8f51836",
... |
import io
import os
import sys
from typing import TextIO
import pytest
from _pytest.store import StoreKey
fault_handler_stderr_key = StoreKey[TextIO]()
def pytest_addoption(parser):
help = (
"Dump the traceback of all threads if a test takes "
"more than TIMEOUT seconds to finish.\n"
"N... | {
"content_hash": "04845d59fee6ae433a73f2e011c2a873",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 94,
"avg_line_length": 34.91150442477876,
"alnum_prop": 0.6524714828897339,
"repo_name": "alfredodeza/pytest",
"id": "8d723c206cb8d9f9a3a5f02e116a89a937cc6cbe",
"size": "3... |
import os
import subprocess
def test_native():
p = subprocess.Popen(['make', '-B'], cwd=os.path.dirname(__file__))
assert p.wait() == 0 # systems which have `make` have SUCCESS==0
| {
"content_hash": "35850270745367aad74601108a9febcb",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 71,
"avg_line_length": 24,
"alnum_prop": 0.6354166666666666,
"repo_name": "bjodah/chemreac",
"id": "0af575cd9a05349440b096816e0d6b3f51d99c13",
"size": "217",
"binary": fal... |
try:
from osgeo import osr, ogr, gdal
except ImportError:
import osr, ogr, gdal
import string
import sys
#############################################################################
def GeomType2Name( type ):
if type == ogr.wkbUnknown:
return 'wkbUnknown'
elif type == ogr.wkbPoint:
r... | {
"content_hash": "ebd862380ad11a1783fbc76c09056d03",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 85,
"avg_line_length": 31.037037037037038,
"alnum_prop": 0.497464200477327,
"repo_name": "tilemapjp/OSGeo.GDAL.Xamarin",
"id": "b28304050f8be714dc772d777905244cd562d2e6",
... |
from unittest.mock import patch
import pytest
import sys
from Hologram.Network.Modem.BG96 import BG96
from UtilClasses import ModemResult
sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")
def mock_write(modem, message):
return True
def mock_read(modem):
return True
def mock_readline(mo... | {
"content_hash": "29e8e371dc7cf0ea13b50af3674a69df",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 90,
"avg_line_length": 27.818181818181817,
"alnum_prop": 0.7151416122004357,
"repo_name": "hologram-io/hologram-python",
"id": "681d1e09a44984bd8e35cf8ea50c17933b8856e2",
"... |
import argparse
from lib.httplog import HTTPLog, LogError, InitError, ConfigError
from lib.filter import Filter, InitErr, ConfErr
from datetime import datetime
__title__ = "httpdefender"
__author__ = "Leslie.A.Cordell"
__version__ = "1.0"
__year__ = datetime.now().year
def arguments():
"""
Set up command-line... | {
"content_hash": "4906c20aa0a30cff47b916c47c8932a2",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 118,
"avg_line_length": 34.46987951807229,
"alnum_prop": 0.6011883956658511,
"repo_name": "nonapod/httpdefender",
"id": "39a1cbd898f21df89ed3734120aea110d3276352",
"size": ... |
import urllib
import urllib2
import smtplib
from sys import argv
import socket
import threading
import time
username = argv[2]
password = argv[3]
# Flags to represent what color the user wants to be notified about
BLACK_FLAG = False
GRAY_FLAG = False
# URLs to the product page
black_url = "https://play.google.com/st... | {
"content_hash": "beb11119533b95e56e6cc857ead08340",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 117,
"avg_line_length": 27.6875,
"alnum_prop": 0.7069977426636569,
"repo_name": "jonsimington/moto360_notifier",
"id": "d0cb69ccceb7ac7a6b4a0595d492d1ef2735571e",
"size": "... |
"""
This module is written in a DynamicProtocol style and caring for our WEB Server configuration
"""
from zope.interface import implementer
from NetCatKS.Config.api.interfaces import IWeb
from NetCatKS.Config.api.implementers.configuration.mixin import MixinSharedConfig
from NetCatKS.Components.common.factory impor... | {
"content_hash": "ee2a361b91372138598a185c3e7bca8c",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 93,
"avg_line_length": 20.202247191011235,
"alnum_prop": 0.5939933259176863,
"repo_name": "dimddev/NetCatKS",
"id": "ca088c878ff860e3993f8c03eef6200bb7c5de40",
"size": "179... |
"""
The STS Job Manager.
This tool creates STS Jobs and records each job's state.
"""
import argparse
import json
import logging
import os
import time
from datetime import datetime
from typing import Dict, List, Optional
from google.cloud import bigquery, monitoring_v3
from constants import schemas
from constants.st... | {
"content_hash": "c6b40381935373f59ebfd0af65255552",
"timestamp": "",
"source": "github",
"line_count": 683,
"max_line_length": 136,
"avg_line_length": 33.84040995607614,
"alnum_prop": 0.5910093886557348,
"repo_name": "GoogleCloudPlatform/professional-services",
"id": "c8b8b377f5ebc8879cf9ed9ed656270... |
def MoveBodyRandomize():
if MoveBodyRandom==1:
i01.setHandSpeed("left", 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
i01.setHandSpeed("right", 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
i01.setArmSpeed("right", 0.5, 0.5, 0.5, 0.5)
i01.setArmSpeed("left", 0.5, 0.5, 0.5, 0.5)
i01.setHeadSpeed(0.5, 0.5)
rollneck.setSpeed(... | {
"content_hash": "9f78d15577608aa3bc60ac507ef50937",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 164,
"avg_line_length": 48.888888888888886,
"alnum_prop": 0.7227272727272728,
"repo_name": "MyRobotLab/pyrobotlab",
"id": "82cc56de1f847f4572035ed445a71fbca3477abd",
"size"... |
import logging
import pytest
import shlex
import time
from tests.common.test_result_verifier import *
from subprocess import call
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.test_vector import *
from tests.common.test_dimensions import ALL_NODES_ONLY
from tests.common.impala_test_s... | {
"content_hash": "c50ced179d43207e6222d115431c6168",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 89,
"avg_line_length": 41.4375,
"alnum_prop": 0.6993464052287581,
"repo_name": "scalingdata/Impala",
"id": "906c94bec99904418fe4b9795363107299e1e303",
"size": "4599",
"bi... |
from __future__ import division
__author__ = 'Christoph Statz'
import logging
from maui.backend import context
from visitor import ParallelVisitInstrumentation, VisitInstrumentation
from .adapter import InSituDataAdapter
class MauiInSitu(object):
def __init__(self, fields, identifier, *args, **kwargs):
... | {
"content_hash": "e5de4e4b7aaa64a4a49622ccf686f0fb",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 191,
"avg_line_length": 44.78350515463917,
"alnum_prop": 0.6406537753222836,
"repo_name": "cstatz/maui-insitu",
"id": "f5899e9777e6825beeefdcfa344025d1bcf8e563",
"size": "4... |
BOT_NAME = 'ScrapySVGTodoJuegos'
SPIDER_MODULES = ['ScrapySVGTodoJuegos.spiders']
NEWSPIDER_MODULE = 'ScrapySVGTodoJuegos.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'ScrapySVGTodoJuegos (+http://www.yourdomain.com)'
# Obey robots.txt rules
ROBOTSTXT_OBEY ... | {
"content_hash": "0d4b8faf602fb45102b5bad2e6965c50",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 109,
"avg_line_length": 35.620253164556964,
"alnum_prop": 0.7768301350390903,
"repo_name": "lKaza/VideoJuegosFisicosChile",
"id": "75a697aa7423b727fd6284e5064f2ddbdc79d800",
... |
from __future__ import unicode_literals
import django
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError, models, transaction
from django.db.models.query import QuerySet
from django.template.defaultfilters import slugify as default_slugify
f... | {
"content_hash": "c41f0f42d7ea23e9d2c92b94d422adc0",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 83,
"avg_line_length": 30.722466960352424,
"alnum_prop": 0.5891884141095498,
"repo_name": "eugena/django-taggit",
"id": "e38428f23fdc605286fc6b3cda083c907ab90e6f",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('argus', '0013_client'),
]
operations = [
migrations.AddField(
model_name='astu',
name='is_online',
field=models.... | {
"content_hash": "cd6375211fd2f0e0e6a5d5e86a61ea05",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.5819672131147541,
"repo_name": "dehu4ka/lna",
"id": "312cd3231e7cfa47154646e6d5448080590e7750",
"size": "439",
... |
from datetime import datetime
import getpass
import sys
import os
root_dir = os.path.dirname(os.path.abspath(__file__))
proj_name = os.path.split(root_dir)[1]
if os.path.isfile(os.path.normpath(root_dir + os.path.sep + 'version.txt')):
open('version.txt', 'w').close()
f = open('version.txt', 'w')
f.write('Version... | {
"content_hash": "58adafc663bd4f8367b8b36f30eeaf0b",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 101,
"avg_line_length": 37.10526315789474,
"alnum_prop": 0.6553191489361702,
"repo_name": "lowitty/xtool",
"id": "fb6f23f68a2450db152c0f789bef4bab2f2fb320",
"size": "749",
... |
from django.views.generic import TemplateView
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(template_name='contest/index.html'),
name='index'),
url(r'rules$', TemplateView.as_view(template_name='cont... | {
"content_hash": "4f0558e2754fedc7cfaf26ff110b7cb8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 76,
"avg_line_length": 39.69230769230769,
"alnum_prop": 0.6472868217054264,
"repo_name": "Motiejus/tictactoe",
"id": "1f172fbd915e24e098d31e7f01ddce10cda0d33a",
"size": "10... |
'''
Configuration object
====================
The :class:`Config` object is an instance of a modified Python ConfigParser.
See the `ConfigParser documentation
<http://docs.python.org/library/configparser.html>`_ for more information.
Kivy has a configuration file which determines the default settings. In
order to cha... | {
"content_hash": "920af4fb2fff595f342b51c43435b999",
"timestamp": "",
"source": "github",
"line_count": 807,
"max_line_length": 79,
"avg_line_length": 38.69268897149938,
"alnum_prop": 0.6201441152922338,
"repo_name": "vitorio/kivy",
"id": "b478ae7d4bc0bed305b7ffa0728603ff8b27de0e",
"size": "31225",... |
from __future__ import unicode_literals
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from .models import Category, Forum, TopicType, Topic
from .models import Post, LBForumUserProfile
admin.site.register(Category)
def update_forum_state_info(modeladmin, request, queryset... | {
"content_hash": "9757dc072a0d0f89b4ea910bcad2e873",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 102,
"avg_line_length": 32.711711711711715,
"alnum_prop": 0.6722665932250069,
"repo_name": "JiaruZhang/Five",
"id": "186ffb8e2664f60a8964a3a953fb120dba30c0b2",
"size": "36... |
import _plotly_utils.basevalidators
class CandlestickValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name="candlestick", parent_name="layout.template.data", **kwargs
):
super(CandlestickValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "655d45bd9649ecf66d397a9442093dfb",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 85,
"avg_line_length": 31.22222222222222,
"alnum_prop": 0.5640569395017794,
"repo_name": "plotly/python-api",
"id": "4444c316e253fd8a3e08f605687915585520a455",
"size": "562... |
"""rockmylight URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class... | {
"content_hash": "2cf7a22742b142fabbd0cf81fcdf98a9",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 38.62068965517241,
"alnum_prop": 0.65625,
"repo_name": "RockMyLight/django-rml",
"id": "b50f1a749c8d189bb98e6415a8cd83c7faa4e52a",
"size": "1120",
... |
import unittest
import pytest
import json
import os
import vodka.config
import vodka.log
import vodka.bartender
import vodka.plugins
import vodka.app
import vodka
from click.testing import CliRunner
HOME = os.path.join(os.path.dirname(__file__), "resources", "test_bartender_app")
@vodka.plugin.register("test_barte... | {
"content_hash": "37dc6e7e8ea40074d745bab6f5bb34aa",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 88,
"avg_line_length": 27.222929936305732,
"alnum_prop": 0.5744033692091718,
"repo_name": "20c/vodka",
"id": "27b5d12f129d1912245556fd4227175f6577fc23",
"size": "4274",
... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# pandas display options
pd.options.display.max_rows = 1000
pd.options.display.max_columns = 25
pd.options.display.width = 1000
######################################################################
# data
########################################... | {
"content_hash": "7cff70c10a5e63edacaf837e2b8dfe03",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 97,
"avg_line_length": 28.2027027027027,
"alnum_prop": 0.6473406804024916,
"repo_name": "timestocome/Test-stock-prediction-algorithms",
"id": "688e817c5a2cc288ddc9342d70db566... |
from faint import *
#start
bindk(key.arrow_up, zoom_in, mod.ctrl) # Binds zoom_in to the Ctrl+Up
bindk(key.arrow_down, zoom_out, mod.ctrl) # Binds zoom_out to Ctrl+Down
bindk(key.backspace, auto_crop) # Binds auto_crop to back-space
| {
"content_hash": "3d9911b332b89e649625f9f9413678aa",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 71,
"avg_line_length": 40,
"alnum_prop": 0.7166666666666667,
"repo_name": "lukas-ke/faint-graphics-editor",
"id": "21ae13709d2bf89cc4548bf90b356208bad07431",
"size": "240",
... |
'''
Individual stages of the pipeline implemented as functions from
input files to output files.
The run_stage function knows everything about submitting jobs and, given
the state parameter, has full access to the state of the pipeline, such
as config, options, DRMAA and the logger.
'''
from utils import safe_make_d... | {
"content_hash": "9586b6d08e49f85b220f750fa3fbeab3",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 165,
"avg_line_length": 52.52,
"alnum_prop": 0.682025894897182,
"repo_name": "bjpop/twin_ion_pipeline",
"id": "364784bec9b2ab59e3425afb2534c492b196c0da",
"size": "2626",
... |
import time
from ._timer import Timer
class AsyncTimer(Timer):
"""A timer instance, which awaits the wrapped function."""
def _wrapped_factory(self, func):
"""Report an execution time for each function run.
:param func (function): A function to wrap for measurement.
:returns functi... | {
"content_hash": "f2a2065ab825658b6319a3e4bc7b5cc1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 27.40909090909091,
"alnum_prop": 0.6019900497512438,
"repo_name": "Intel471/prom-stats",
"id": "6cd18cddae079e3df01f35fd4f1af7e250604bd5",
"size": "6... |
"""This is a script for fixing XGBoost boosting trees which have negative scores.
We calculate the most negative leaf value, and append one more tree to the model
which adds the abs() of this smallest value, meaning we always get a positive score,
but relatively the scores will not change.
"""
import json
... | {
"content_hash": "d906fe95aac23a809b9d7a02c8ee0cc5",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 101,
"avg_line_length": 31.461038961038962,
"alnum_prop": 0.5700722394220846,
"repo_name": "o19s/elasticsearch-learning-to-rank",
"id": "ddf4564077f327e04e11981c9a78548bb234... |
import pytest
import kevlar
from kevlar.readgraph import ReadGraph
from kevlar.tests import data_file
@pytest.mark.parametrize('partfile,edges,strictedges', [
('connectivity-1311.augfastq', 30, 11),
('connectivity-1541.augfastq', 31, 12),
])
def test_populate(partfile, edges, strictedges):
with kevlar.ope... | {
"content_hash": "1f2233232a1b2d2a847303f4c2e4c351",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 64,
"avg_line_length": 31.681818181818183,
"alnum_prop": 0.6857962697274032,
"repo_name": "dib-lab/kevlar",
"id": "fb629e6497a684f23caf2641690922cf68a11ba2",
"size": "1068"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fmovies.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is rea... | {
"content_hash": "6a805daa4f47e2c19d5572e3744761b7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6206896551724138,
"repo_name": "pieromarini/fmovies",
"id": "8cf0ec16df65f9e7eac022001af4fdbed3525a97",
"size": "... |
def extractNightwaterBar(item):
'''
Parser for 'nightwater.bar'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous'... | {
"content_hash": "9247477acd596551ac57e0e891f1031d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 25.714285714285715,
"alnum_prop": 0.6240740740740741,
"repo_name": "fake-name/ReadableWebProxy",
"id": "b1446d3219986bed89a950f17942c9ce8d2fddf7",
"... |
class Shell:
"""
Executor of shell commands on OpenWRT instances via an RPC Proxy
"""
def __init__(self, rpc_proxy):
self._rpc = rpc_proxy
def execute(self, command):
"""
Executes a shell command and captures its standard output and returns it as a str.
"""
... | {
"content_hash": "e73e5606aa44962c580964053ba27ac0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 90,
"avg_line_length": 27.57894736842105,
"alnum_prop": 0.5877862595419847,
"repo_name": "Jumpscale/openwrt-remote-manager",
"id": "2702f85357624753c5584ccb458fd94ede63f392",... |
from django.core import serializers
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators.http import require_http_methods
from django.views.generic import ListView
from models import *
# Create your views here.
def index(request):
locations = Location.objects.all()
... | {
"content_hash": "b33dd69c1d6ca4ee3c5c344b0c533e93",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 61,
"avg_line_length": 34.15384615384615,
"alnum_prop": 0.7905405405405406,
"repo_name": "ColusLife/ColusLifeDemo",
"id": "634954141c423eb9eb0125a62b849122d7ba69c7",
"size"... |
from django.shortcuts import render
from django.views import generic
import fetcher
class TopSubmissions(generic.ListView):
template_name = 'redditreader/top.html'
context_object_name = 'submissions'
def get_query_set(self):
return fetcher.top()
def top(request, subreddit):
if subreddit.startswith('r/'):
... | {
"content_hash": "554b61075769af2135a2ba17a294bbfb",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 40,
"avg_line_length": 22,
"alnum_prop": 0.7593582887700535,
"repo_name": "orlenko/FBBot",
"id": "9c0d92905ecbf67016fb65dfa14b156247a86f0e",
"size": "374",
"binary": fals... |
import ast
import sys
def astppdump(node):
def _format(node, indent):
#print node, len(indent)
if isinstance(node, ast.AST):
namelen = " "*(len(node.__class__.__name__)) + " "
fields = []
for a,b in ast.iter_fields(node):
fieldlen = len(a)*" "
... | {
"content_hash": "d3c4eee2c5ebd8befbcd1fffbf489200",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 124,
"avg_line_length": 43.18518518518518,
"alnum_prop": 0.5497427101200686,
"repo_name": "ArcherSys/ArcherSys",
"id": "579b018c246d8710996cec6318310e7615d35841",
"size": "... |
def fancy(string):
return '=== %s ===' % string.capitalize()
| {
"content_hash": "f676c07a0a443b4a30aa17ba43a83557",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 45,
"avg_line_length": 32.5,
"alnum_prop": 0.5692307692307692,
"repo_name": "Thom1729/YAML-Macros",
"id": "4dd678f78f5bf9a6b2dbe28db8d5ae769701917a",
"size": "65",
"binary... |
import datetime
import flask
import pytest
from webargs import fields
from webargs.flaskparser import parser
from filteralchemy import operators
from filteralchemy import formatters
from filteralchemy import Filter, FilterSet
@pytest.fixture
def app():
return flask.Flask(__name__)
class TestFilters:
@pytes... | {
"content_hash": "979f5918eda51a7405318351900b21d0",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 88,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.5843434343434344,
"repo_name": "jmcarp/filteralchemy",
"id": "458164541ddab37ffded0d606a360ac3b54bfee8",
"size":... |
"""Test Fully Kiosk Browser services."""
from unittest.mock import MagicMock
from homeassistant.components.fully_kiosk.const import (
ATTR_URL,
DOMAIN,
SERVICE_LOAD_URL,
)
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_re... | {
"content_hash": "a772510d81be7adf390aa594d2a1d602",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 77,
"avg_line_length": 27.11111111111111,
"alnum_prop": 0.6997950819672131,
"repo_name": "nkgilley/home-assistant",
"id": "e3b63dad341a8d4425da9a60af7ec390ca86a614",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
import pyconde.attendees.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_conten... | {
"content_hash": "8b569361a60e10233c7f2647affa159a",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 303,
"avg_line_length": 61.46606334841629,
"alnum_prop": 0.5899587750294464,
"repo_name": "pysv/djep",
"id": "7a5820ad668075aee39623ff10ffc9c58d7c35f4",
"size": "13608",
... |
"""
Views for managing volumes.
"""
import json
import re
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon import tabs
... | {
"content_hash": "2b5acbbca796cff2f890e2141caed82a",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 99,
"avg_line_length": 36.80108991825613,
"alnum_prop": 0.5915148822745446,
"repo_name": "xuweiliang/Codelibrary",
"id": "f2db258a14150a6ddcaa0d79168f1e76638ba18c",
"size"... |
import sqlalchemy
from datetime import datetime
from ml_buff.database import DeclarativeBase
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.orm import relationship
from ml_buff.models.feature import Feature
class FeatureValue(DeclarativeBase):
__tablename__ = 'feature_values'
id = sqlalchemy.Col... | {
"content_hash": "61b49350375639a8957a4333849917b7",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 98,
"avg_line_length": 41.208333333333336,
"alnum_prop": 0.7775530839231547,
"repo_name": "tinenbruno/ml-buff",
"id": "b00ff6991e44beccfe0729478ecd9e769ecb1c18",
"size": "9... |
""" Cisco_IOS_XR_shellutil_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR shellutil package configuration.
This module contains definitions
for the following management objects\:
host\-names\: Container Schema for hostname configuration
Copyright (c) 2013\-2016 by Cisco Systems, Inc.
... | {
"content_hash": "d745569d4ff96f669c75c1dabc94ef9a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 87,
"avg_line_length": 20.492537313432837,
"alnum_prop": 0.6649672250546249,
"repo_name": "111pontes/ydk-py",
"id": "97dd50049c1a2077d1b04eebe960b32944608245",
"size": "137... |
import numpy as np
import pysam
import re
from collections import defaultdict
from Bio import SeqIO
import time
class State:
on_on = 0
on_off = 1
off_on = 2
off_off = 3
def make_freq_csv_perc(freq_dict, read_max, ref_max, out):
#print(freq_dict)
freq_cnt = np.zeros(shape=(ref_max + 1, read_max + 1), dtype=float... | {
"content_hash": "cf5ec8756d3ed357b2dfc84dca8bc296",
"timestamp": "",
"source": "github",
"line_count": 437,
"max_line_length": 103,
"avg_line_length": 26.931350114416475,
"alnum_prop": 0.5989463845696321,
"repo_name": "lucka318/master_thesis",
"id": "6be7aeb0f3725b78667d02909bb7b377d885be65",
"siz... |
"""
This script will test highgui's cvWaitKey(int) function
"""
# name of this test and it's requirements
TESTNAME = "cvWaitKey"
REQUIRED = ["cvShowImage"]
# needed for sys.exit(int) and .works file handling
import os
import sys
import works
# path to imagefiles we need
PREFIX=os.environ["top_srcdir"]+"/tests/python... | {
"content_hash": "3d26ac1179c7a533aeee2908932a60f7",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 76,
"avg_line_length": 24.622222222222224,
"alnum_prop": 0.7445848375451264,
"repo_name": "guc-cs/Campus-Vision",
"id": "760d6b4fc1e75bc9e4ee3a91c8602d9c4ca53ffd",
"size": ... |
from django.urls import path, include
from rest_framework import routers
from . import api_views
api_router = routers.DefaultRouter()
api_router.register(
r'tracked_words',
api_views.TrackedWordsViewSet,
basename='tracked-words')
urlpatterns = [
path(r'', include(api_router.urls)),
]
| {
"content_hash": "59ecedd0c9edfa71e387d080a2a727b9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 40,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.7245901639344262,
"repo_name": "aehlke/manabi",
"id": "5f83ebf965c1541f788ba46bd70cfc713d4a069e",
"size": "305",
... |
import pandas
from qstkutil import DataAccess as da
import numpy as np
import math
import qstkutil.qsdateutil as du
import datetime as dt
import qstkutil.DataAccess as da
"""
Accepts a list of symbols along with start and end date
Returns the Event Matrix which is a pandas Datamatrix
Event matrix has the following st... | {
"content_hash": "baf3459b0b14943a4909d2514840f606",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 104,
"avg_line_length": 36.82608695652174,
"alnum_prop": 0.6505312868949232,
"repo_name": "avistous/QSTK",
"id": "3552a4a00af3fc55ddf36333ef0320e4ef985320",
"size": "2069",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.