text stringlengths 4 1.02M | meta dict |
|---|---|
"""empty message
Revision ID: 83b13b4b5717
Revises: e8f30efa9a81
Create Date: 2017-08-02 18:12:38.316902
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '83b13b4b5717'
down_revision = 'e8f30efa9a81'
branch_labels = None
depends_on = None
def upgrade():
# ... | {
"content_hash": "9497ceb3212a58cd5ad4092529c5c436",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 65,
"avg_line_length": 25.058823529411764,
"alnum_prop": 0.676056338028169,
"repo_name": "massgo/league",
"id": "8f9db77e60fc8c00aa3e963be15daecf4b87f651",
"size": "852",
... |
import datetime
import json
from cba import get_request
from django.utils.encoding import force_unicode
from django.utils.functional import Promise
class LazyEncoder(json.JSONEncoder):
"""Encodes django's lazy i18n strings.
"""
def default(self, obj):
if isinstance(obj, Promise):
retur... | {
"content_hash": "188900f66292b3965c9ed909ab3135c6",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 70,
"avg_line_length": 24.796610169491526,
"alnum_prop": 0.6288448393711552,
"repo_name": "diefenbach/django-cba",
"id": "256556a5b41fdbac7631e53b5f31751c3fc48230",
"size":... |
import argparse
import os
import sys
import semantic_version
from requests.exceptions import ConnectionError
from tsuru_unit_agent import heartbeat, tasks
from tsuru_unit_agent.client import Client
TEMP_ENV_FILE = "/tmp/app_envs"
def run_action(args):
client = Client(args.url, args.token)
envs = None
... | {
"content_hash": "3ef79aff0335527bd8dba5d358d3ed58",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 113,
"avg_line_length": 30.53932584269663,
"alnum_prop": 0.6817512877115526,
"repo_name": "tsuru/tsuru-unit-agent",
"id": "995d0be41eae8181d403545c324d52c536b30967",
"size"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: gce
version_added: "1.4"
short_description: create or ter... | {
"content_hash": "d3d00d3484917e32a4225263db8ae83e",
"timestamp": "",
"source": "github",
"line_count": 750,
"max_line_length": 150,
"avg_line_length": 36.757333333333335,
"alnum_prop": 0.6088218224027858,
"repo_name": "SergeyCherepanov/ansible",
"id": "d5bd6abf28008704c878f5221d0b9f2e5c28d216",
"s... |
import pickle
import sys
import os
if __name__ == '__main__':
from peyotl.ott import OTT
multimapping = set()
picklefn = sys.argv[1]
if os.path.exists(picklefn):
sys.exit('{} already exists'.format(picklefn))
ott = OTT()
ncbi2ott = {}
for ott_id, info in ott.ott_id_to_info.items():
... | {
"content_hash": "8e97db1a52aea7c14172fe7b43ba3566",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 99,
"avg_line_length": 33.370370370370374,
"alnum_prop": 0.5338512763596004,
"repo_name": "rvosa/peyotl",
"id": "2e0f44ba5ccf660f96b7a3a48d5185368951a67d",
"size": "923",
... |
import subprocess
import inspect
import os
import urllib3
import re
import threading
import ipaddress
import argparse
import time
import getpass
TDVT_SDK_NAME = "connector-plugin-sdk"
TDVT_SDK_REPO = "https://github.com/tableau/" + TDVT_SDK_NAME
TDVT_SDK_BRANCH = "tdvt-2.1.9"
TDVT_ES_SCHEME = "simple_lower"
TDVT_RUN... | {
"content_hash": "5ac8791e5f31aaa30e0ec037ebc0c590",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 117,
"avg_line_length": 36.54132231404959,
"alnum_prop": 0.5933506728485808,
"repo_name": "nknize/elasticsearch",
"id": "3135e11765bd0d8c208d6d5099456603c79d32f8",
"size":... |
'''
Project: Farnsworth
Author: Karandeep Singh Nagra
'''
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import models
from utils.funcs import convert_to_url
from base.models import UserProfile
class Manager(models.Model):
... | {
"content_hash": "cff51da41f1556efb8f41caedbebf0fc",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 173,
"avg_line_length": 28.746630727762803,
"alnum_prop": 0.5918424753867791,
"repo_name": "knagra/farnsworth",
"id": "0105db7c90be08852dc98cb74589b4e6fe323ef5",
"size": "... |
"""Tests for calculator example."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import random
# import google3
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
from google.protobuf import text_format
from tensorf... | {
"content_hash": "90c7226442ccd073ebe44e6b06dc739f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 76,
"avg_line_length": 36.7962962962963,
"alnum_prop": 0.6552591847005536,
"repo_name": "pklfz/fold",
"id": "8fc85456fd709312e9757a5f718a1b9f7231ff15",
"size": "2584",
"b... |
from __future__ import print_function
import unittest
import numpy as np
import paddle.fluid.core as core
import paddle.fluid as fluid
class TestElementWiseAddOp(unittest.TestCase):
def __assert_close(self, tensor, np_array, msg, atol=1e-4):
self.assertTrue(np.allclose(np.array(tensor), np_array, atol=at... | {
"content_hash": "d8c2f5846af1dbf32d168957ac8bb467",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 80,
"avg_line_length": 40.08791208791209,
"alnum_prop": 0.4925986842105263,
"repo_name": "QiJune/Paddle",
"id": "9f452ffde74ee18d14f155fb5ed53fee57f12f49",
"size": "4261",
... |
'''
Entry point. Init logging, initialize component factory,
start asyncio event loop, manage components lifecycle
'''
import logging
import yaml
import pytoml
import json
import sys
from .loadtest import LoadTest
LOG = logging.getLogger(__name__)
def init_logging(debug=False, filename='bfg.log'):
''' Configur... | {
"content_hash": "3ab7bbe32b45119f39155c2293672bbc",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 75,
"avg_line_length": 29.276315789473685,
"alnum_prop": 0.6368539325842697,
"repo_name": "direvius/bfg",
"id": "6eb729a873c5f0279e5ee022a6e3c3618e3e3968",
"size": "2225",
... |
from __future__ import unicode_literals
import sys
from os.path import abspath, dirname, join
# Make sure we get the version of this copy of Django
sys.path.insert(1, dirname(dirname(abspath(__file__))))
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.pa... | {
"content_hash": "30c883df8820eb54b8563489277ab327",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 105,
"avg_line_length": 32.504347826086956,
"alnum_prop": 0.699215266630997,
"repo_name": "nielsvanoch/django",
"id": "e6ced398e67772e4ebb5b5e39d577364fa27d3fa",
"size": "... |
import fieldmaptrack
import fieldmaptrack.beam as beam
import fieldmaptrack.track as track
import fieldmaptrack.dipole_analysis as analysis
import fieldmaptrack.multipoles as multipoles
import math
import numpy as np
beam_energy = 3 # [GeV]
hard_edge_length = 1000 # [mm]
peak_field = -0.6 # [T]... | {
"content_hash": "59248bf18012a7c7ba2f3fdb8ebc0e37",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 188,
"avg_line_length": 40.92857142857143,
"alnum_prop": 0.6400523560209425,
"repo_name": "lnls-fac/fieldmaptrack",
"id": "651f2d41cd4d70a1bba4e31897a854b13e3e94a8",
"size... |
import logging
import mock
import unittest
from mock import patch
from svc_monitor.svc_monitor import SvcMonitor
from pysandesh.sandesh_base import Sandesh
from vnc_api.vnc_api import ServiceInstance, ServiceInstanceType
from vnc_api.vnc_api import ServiceScaleOutType
from vnc_api.vnc_api import ServiceTemplate, Ser... | {
"content_hash": "a83a0a5221086006b2599bc335d6f3fe",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 77,
"avg_line_length": 40.43037974683544,
"alnum_prop": 0.6255479023168441,
"repo_name": "JioCloud/contrail-controller",
"id": "5a0463af65854c0cf9cff9ed1e936f942f6f312a",
"... |
"""
Script that trains Weave models on Tox21 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import numpy as np
np.random.seed(123)
import tensorflow as tf
tf.set_random_seed(123)
import deepchem as dc
# Load Tox21 dataset
tox21_tasks, tox21_d... | {
"content_hash": "a641baa9db4c8eec7ba6a634e91a01ed",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 79,
"avg_line_length": 29.65625,
"alnum_prop": 0.7276080084299262,
"repo_name": "joegomes/deepchem",
"id": "9d2fe0955f31451e47849dcb760372da1520506f",
"size": "1898",
"bi... |
"""Contains functions for evaluation and summarization of metrics."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import time
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.... | {
"content_hash": "c402ba99f4f25353b11bb45a23db774b",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 90,
"avg_line_length": 38.95075757575758,
"alnum_prop": 0.685694836137314,
"repo_name": "jbedorf/tensorflow",
"id": "35f0b6e26492912c2c80799de2a99d29bf737793",
"size": "10... |
""" Testing predictions uploading from stdin
"""
from bigmler.tests.world import (world, common_setup_module,
common_teardown_module, teardown_class)
import bigmler.tests.basic_tst_prediction_steps as test_pred
import bigmler.tests.stdin_input_steps as stdin
def setup_module():
... | {
"content_hash": "2ced2a937845bc1a9f5c93aeb248e09e",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 162,
"avg_line_length": 38.833333333333336,
"alnum_prop": 0.5631514408338443,
"repo_name": "bigmlcom/bigmler",
"id": "e611724e532c7151d1de00cec4fd5ffd8a9a91b3",
"size": "38... |
'''
Create A Progress Bar for Downloads
Create a progress bar for applications that can keep track of a download in progress. The progress bar will be on a separate thread and will communicate with the main thread using delegates.
'''
import threading
import sys
import urllib.request
import os
class Download(object):
... | {
"content_hash": "ed4ba284ad8b17ba7f9b52eedaf5c2c5",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 190,
"avg_line_length": 29.516666666666666,
"alnum_prop": 0.5499717673630717,
"repo_name": "pragalakis/100-python-projects",
"id": "2e4008e2af1c41f627f571ab4d7669b3bd14b21c",... |
import struct
import time
import io
import cherrypy
from cherrypy._cpcompat import text_or_bytes
from cherrypy.lib import file_generator
from cherrypy.lib import is_closable_iterator
from cherrypy.lib import set_vary_header
def decode(encoding=None, default_encoding='utf-8'):
"""Replace or extend the list of cha... | {
"content_hash": "f4a2fcd7af59a2c466b3f4172f1a9f4e",
"timestamp": "",
"source": "github",
"line_count": 434,
"max_line_length": 79,
"avg_line_length": 37.73271889400922,
"alnum_prop": 0.5244870542256962,
"repo_name": "Safihre/cherrypy",
"id": "54a7a8a8b1365a722b3bef4f0d6ef0ecd0fd0157",
"size": "163... |
def makeList(stop, increment):
i = 0
numbers = []
while i < stop:
numbers.append(i)
i += increment
return numbers
def alt(stop, increment):
return range(0, stop, increment)
print makeList(9, 2)
print alt(9, 2) | {
"content_hash": "a41466160ef0c8b6228df4c7a8c6b811",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 33,
"avg_line_length": 15.785714285714286,
"alnum_prop": 0.6742081447963801,
"repo_name": "vanonselenp/Learning",
"id": "a12a49b26059b59dc1479e8c656e593719a5b355",
"size": ... |
import functools
import threading
from dragonflow.common import exceptions as df_exceptions
from dragonflow.tests import base
class TestDbApi(base.BaseTestCase):
def test_simple_create_get(self):
self.driver.create_table('test_table')
self.addCleanup(self.driver.delete_table, 'test_table')
... | {
"content_hash": "3878c198d2325bfadb202cd99e193bc2",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 45.92857142857143,
"alnum_prop": 0.5977190254017626,
"repo_name": "openstack/dragonflow",
"id": "8658e26be0627c05764a80bfb006576bce2a687a",
"size": "... |
import json
from django.core.urlresolvers import reverse
from tests.models import Foo
from tests.serializers import FooSerializer
from tests.views import FooViewSet
import pytest
pytestmark = pytest.mark.django_db
def test_empty_list(client):
result = {
'prev': '',
'next': '',
'count': 0,... | {
"content_hash": "cd0d29ed8c68a74eb04f0aae2783c05a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 67,
"avg_line_length": 20.770833333333332,
"alnum_prop": 0.5797392176529589,
"repo_name": "WorkHorseIndustries/drf-raw-pagination",
"id": "59438f24d3d51c524724649a7265d1f43cb... |
'''
Copyright(C) 2016 Engineering Department, University of Cambridge, UK.
License
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unles... | {
"content_hash": "6990282dc5e7b60df976131533b36747",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 33.22727272727273,
"alnum_prop": 0.7523939808481532,
"repo_name": "etosha/pulsemodel",
"id": "20a80be14fb781406101d76f212f944217e52c25",
"size": "731... |
from antlr4.IntervalSet import IntervalSet
from antlr4.Token import Token
class ATN(object):
INVALID_ALT_NUMBER = 0
# Used for runtime deserialization of ATNs from strings#/
def __init__(self, grammarType , maxTokenType ):
# The type of the ATN.
self.grammarType = grammarType
# T... | {
"content_hash": "fed6ab3abcaa3e2cc69e0238af9d0ec7",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 89,
"avg_line_length": 43.347457627118644,
"alnum_prop": 0.6596285434995113,
"repo_name": "wjkohnen/antlr4",
"id": "8dad40990c7cfec937205e4144d8d2c6ef8f9062",
"size": "530... |
import os
from .. import env
class RequirementsSpec(object):
'''
Reads depedencies from a requirements.txt file
and returns an Environment object from it.
'''
msg = None
extensions = set(['.txt', ])
def __init__(self, filename=None, name=None, **kwargs):
self.filename = filename
... | {
"content_hash": "0fcd4cef5a4acf90dbfab8f39c7c9f66",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 26.083333333333332,
"alnum_prop": 0.5511182108626198,
"repo_name": "zooba/PTVS",
"id": "cf56aacd0fa0a76c048db80a7971cd0ee4fd7288",
"size": "1351",
... |
"""
Base classes for Messages, provides NodeMessage (base class for message), and Attribute - message attribute descriptor
"""
from foolscap.api import Copyable, RemoteCopy
import sys
import simplejson
class Attribute(object):
"""
Helper class to define Message attributes, to make easy for foolscap to build C... | {
"content_hash": "601eb225101166ff22453ee279a5f6fd",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 118,
"avg_line_length": 26.24852071005917,
"alnum_prop": 0.5047339945897205,
"repo_name": "selfsk/nodeset.core",
"id": "47e5bc12b37da2c5f9ac079e8629d686569cdbae",
"size": ... |
class Machine(object):
"""
.. module:: useful_1
:platform: Unix, Windows
:synopsis: A useful module indeed.
.. moduleauthor:: Andrew Carter <andrew@invalid.com>
"""
def __init__(self):
pass
# def __repr__(self):
# pass
#
# Properties
#
# Thes... | {
"content_hash": "d42d06a26c0c7e36b28aaa10432d96b1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 70,
"avg_line_length": 20.547619047619047,
"alnum_prop": 0.5457705677867902,
"repo_name": "nathanleiby/python-web-hooks",
"id": "0c1842458e9dd0006be215646aed623d7e8eda24",
... |
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['srcName', 'srcTarget', 'srcLevel', 'srcX', 'srcY', 'srcZ', 'dstName', 'dstTarget', 'dstLevel', 'dstX', 'dstY', 'dstZ', 'srcWidth', 'srcHeight', 'srcDepth'])
def glCopyImageSubDataEXT(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLe... | {
"content_hash": "81ad84dcee4ebd430ea571d2c966aa59",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 184,
"avg_line_length": 63.833333333333336,
"alnum_prop": 0.7075718015665796,
"repo_name": "cydenix/OpenGLCffi",
"id": "d93ff236be53398b26e61ed628e2d80c59723a5a",
"size": "3... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='post_title',
field=models... | {
"content_hash": "08960933477620ada9521b9b162efcef",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 21.736842105263158,
"alnum_prop": 0.576271186440678,
"repo_name": "judgegrubb/python-blogging",
"id": "33c72f843ff06f62080bf56551c3b635346901e2",
"si... |
"""Support for SolarEdge-local Monitoring API."""
from __future__ import annotations
from contextlib import suppress
from copy import copy
from dataclasses import dataclass
from datetime import timedelta
import logging
import statistics
from requests.exceptions import ConnectTimeout, HTTPError
from solaredge_local im... | {
"content_hash": "52073708425947d97cd2fa96a21c2197",
"timestamp": "",
"source": "github",
"line_count": 372,
"max_line_length": 87,
"avg_line_length": 32.905913978494624,
"alnum_prop": 0.6435748713340413,
"repo_name": "toddeye/home-assistant",
"id": "d07a95683eb5365ba01ccc9884489456e2c36fa1",
"size... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import login
class BasketInSessionMiddlwareTestCases(TestCase):
"""
'ccbasket.middleware.BasketInSessionMiddleware' must always cr... | {
"content_hash": "6728d748d770916167fda7a9bcb28aee",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 73,
"avg_line_length": 39.317460317460316,
"alnum_prop": 0.6467501009285426,
"repo_name": "designcc/django-ccbasket",
"id": "fd1b3892842d0e37d2af3da56dfac809be58faa1",
"siz... |
"""Convert USDA data to CSV like format.
Copyright 2017 Joshua Powers <mrpowersj@gmail.com>
"""
import argparse
import os
def convert_to_csv(line):
"""Converts a single line of USDA output."""
# Replace the NULLs first
line = line.replace('~~', 'NULL')
line = line.replace('^^', 'NULL')
# Quote th... | {
"content_hash": "4e0e64470a184a05174e2be93481da37",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 26.8,
"alnum_prop": 0.5867537313432836,
"repo_name": "powersj/usda-nnd",
"id": "2acc24d5aa87f46c5bb4ed8746f8caf9709ff5f4",
"size": "1095",
"binary"... |
"""
================================================
ABElectronics IO Pi 32-Channel Port Expander
Version 1.0 Created 29/02/2015
Requires python 3 smbus to be installed with: sudo apt-get install python-smbus
================================================
Each MCP23017 chip is split into two 8-bit ports. port ... | {
"content_hash": "3e2143a0c3d9ce438d62e798ff2d768e",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 85,
"avg_line_length": 37.43523316062176,
"alnum_prop": 0.5904498269896193,
"repo_name": "GentlemanBrewing/ADCLibraries-MCP3424",
"id": "7e8855f3668d464797b95dc82c4148872482... |
"""DialogFlow API Detect Intent Python sample with text inputs.
Examples:
python detect_intent_texts.py -h
python detect_intent_texts.py --project-id PROJECT_ID \
--session-id SESSION_ID \
"hello" "book a meeting room" "Mountain View"
python detect_intent_texts.py --project-id PROJECT_ID \
--session-id SES... | {
"content_hash": "a0c0e3fddc0ebe9c21f0242f6e8da3b5",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 86,
"avg_line_length": 32.21052631578947,
"alnum_prop": 0.6474673202614379,
"repo_name": "googleapis/python-dialogflow",
"id": "01cc2b95d0566f10b895690d7dfa026c12db71dd",
"... |
from openstack.network.v2 import (qos_minimum_bandwidth_rule as
_qos_minimum_bandwidth_rule)
from openstack.tests.functional import base
class TestQoSMinimumBandwidthRule(base.BaseFunctionalTest):
QOS_POLICY_ID = None
QOS_IS_SHARED = False
QOS_POLICY_DESCRIPTION = "QoS p... | {
"content_hash": "3f4b8381a945e5bf9268e1728f9870cc",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 39.56944444444444,
"alnum_prop": 0.6293436293436293,
"repo_name": "stackforge/python-openstacksdk",
"id": "57138c22fa6e3d574c516a9b3c2524a68f2fe014",
... |
class Candidate:
def __init__(self, name):
self.name = name
self.education = []
self.experience = []
self.projects = {}
self.other_experience = []
self.skills = []
def add_education(self, *args):
for arg in args:
self.education.append(arg)
... | {
"content_hash": "e157dee35aa283d6720fc19a685d7e2f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 59,
"avg_line_length": 26.63157894736842,
"alnum_prop": 0.6175889328063241,
"repo_name": "joemarchese/resume",
"id": "74db37d7e74f546dc9ae6c92968de92c6346536b",
"size": "10... |
import os
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils.translation import ugettext_lazy as _
from reviewboard.attachments.mimetypes import MIMETYPE_ICON_ALIAS... | {
"content_hash": "0bfd4f5539bffc465c92c17f92a038ed",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 36.263888888888886,
"alnum_prop": 0.5614707008808886,
"repo_name": "atagar/ReviewBoard",
"id": "dc592a240b53f599da079cc05d0d9bda36761720",
"size": "2... |
from __future__ import unicode_literals, print_function
import sys
from .yugen_core import list_api_keys, get_lambdas, delete_api, \
export_to_swagger, create_api_key, list_apis, \
deploy_custom_domain, delete_api_key, deploy_api
from . import utils
from .gcdt_cmd_dispatcher import cmd
from . import gcdt_lifec... | {
"content_hash": "cd975e1c27a5b99162703122ccc9cce5",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 80,
"avg_line_length": 33.15841584158416,
"alnum_prop": 0.6295909226634816,
"repo_name": "glomex/gcdt",
"id": "b0c4b01806ae814a4b9b9fc6a8651ca585719fc5",
"size": "6744",
... |
from rally.benchmark import context
from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils as rutils
from rally import consts
from rally import osclients
from rally.plugins.openstack.context.cleanup import manager as resource_manager
from rally.plugins.openstack.scenarios... | {
"content_hash": "0687b81aef037c1e1175963fbc5eec6d",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 79,
"avg_line_length": 35.91208791208791,
"alnum_prop": 0.5180538555691554,
"repo_name": "vponomaryov/rally",
"id": "90a18f9582827c040af29b12631d9ab977ef6f6b",
"size": "383... |
import cffi
ffi = cffi.FFI()
ffi.set_source('orcsome._ev', "#include <ev.h>", libraries=['ev'])
ffi.cdef("""
#define EVBACKEND_SELECT ...
#define EV_READ ...
#define EV_WRITE ...
#define EVBREAK_ALL ...
typedef ... ev_loop;
struct ev_loop *ev_loop_new (unsigned int flags);
void ev_loop_destroy (struct ev_loop*);
v... | {
"content_hash": "973de36c00e72f64a7002b429a2fccc6",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 66,
"avg_line_length": 30.818181818181817,
"alnum_prop": 0.6674041297935103,
"repo_name": "baverman/orcsome",
"id": "e006c8fe8e508c290f4b0c3c37fb22b3b9da2125",
"size": "135... |
class SkipRope:
def partners(self, candidates, height):
first = (-1, 200)
second = (-1, 200)
for idx, person in enumerate(candidates):
diff = abs(person - height)
if diff < abs(first[1] - height):
first = (idx, person)
elif... | {
"content_hash": "c9b4fefd76349911e66cdb8227849505",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 76,
"avg_line_length": 31.4,
"alnum_prop": 0.45010615711252655,
"repo_name": "mikefeneley/topcoder",
"id": "88e5f9182f5164898c411583002e87c9c95f8d37",
"size": "943",
"bin... |
import asyncio
import asyncio.events
import functools
import inspect
import os
import re
import sys
import threading
from contextlib import contextmanager
from glob import has_magic
from .callbacks import _DEFAULT_CALLBACK
from .exceptions import FSTimeoutError
from .spec import AbstractFileSystem
from .utils import P... | {
"content_hash": "76874b66c93bb9495c4f7aeebbc4e957",
"timestamp": "",
"source": "github",
"line_count": 749,
"max_line_length": 88,
"avg_line_length": 33.58077436582109,
"alnum_prop": 0.563295165394402,
"repo_name": "intake/filesystem_spec",
"id": "01c949eeddefab7ee05c796295854515e78ef86d",
"size":... |
import sys
import os
import utils
def init():
path = os.getcwd()
text = utils.openFile(path + '/' + sys.argv[1])
if text is not None:
text = utils.stripWhiteSpace(text)
if len(sys.argv) > 2:
subLength = int(sys.argv[2])
else:
subLength = None
result ... | {
"content_hash": "73ef48f457dc9f3ae13b539e1501f5d6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 112,
"avg_line_length": 30.307692307692307,
"alnum_prop": 0.6057529610829103,
"repo_name": "appsol/crypto",
"id": "73d6eb2b78e22266b82f47364adb772a3f4f9b46",
"size": "1201"... |
from django.core.management import call_command
from django.test import TestCase
from rest_framework.test import APIRequestFactory
from api.councils import CouncilViewSet, CouncilCSVViewSet
from councils.tests.factories import CouncilFactory
class CouncilsTest(TestCase):
@classmethod
def setUpTestData(cls):
... | {
"content_hash": "2a7d8052d62212dcc543306bcb8c4b57",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 219,
"avg_line_length": 39.52,
"alnum_prop": 0.5759109311740891,
"repo_name": "DemocracyClub/UK-Polling-Stations",
"id": "695943b0fbab5ccafe6368344e64f30cbb5453cd",
"size"... |
print 'Hello world'
print 'The quick brown fox', 'jumps over', 'the lazy dog'
print '1 + 1 =', 1 + 1
print 'what\'s your name?'
name = raw_input()
print 'Hello', name
| {
"content_hash": "8a206f91e5099c86ac3c6c47d5b8af02",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 57,
"avg_line_length": 18.88888888888889,
"alnum_prop": 0.6352941176470588,
"repo_name": "WellerQu/LearnPython",
"id": "7dba9ab98ba7841a036f51e13fdfcabc821603bb",
"size": "1... |
"""
This module is a functional test of the game_server and game_client
interactions. a game server is spun up in a seperate process space and bound
to localhost on port 5000. The game client is then used to interact with
the game server.
"""
import unittest
from multiprocessing.process import Process
from clueless.... | {
"content_hash": "093e808015b2ad964ddc683be464f0b7",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 78,
"avg_line_length": 39.734939759036145,
"alnum_prop": 0.5933899332929048,
"repo_name": "PyBro-JHU/Clue-Less",
"id": "4adc9e7bbf0c01d07970011ab5904c39a2424bc8",
"size": ... |
'''define URLs patterns for users'''
from django.conf.urls import url
from django.contrib.auth.views import login
from . import views
urlpatterns = [
url(r'^login/$', login,
{'template_name': 'users/login.html'}, name='login'),
url(r'^logout/$', views.logout_view, name='logout'),
url(r'^register/... | {
"content_hash": "bacc219d07da2b151b7a53fd89d58e0b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 61,
"avg_line_length": 27.692307692307693,
"alnum_prop": 0.6583333333333333,
"repo_name": "DoWhatILove/turtle",
"id": "2bac16198a370693fa6107a318d33761044cd96d",
"size": "3... |
"""Declare exceptions and warnings that are specific to PyTables."""
from __future__ import absolute_import
import six
__docformat__ = 'reStructuredText'
"""The format of documentation strings in this module."""
import os
import warnings
import traceback
class HDF5ExtError(RuntimeError):
"""A low level HDF5 op... | {
"content_hash": "33b6e886aa7b4b66fcc700ec8ed835c3",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 82,
"avg_line_length": 29.26259946949602,
"alnum_prop": 0.6528281363306744,
"repo_name": "gdementen/PyTables",
"id": "9306b6af8266358f5bd4e1eee2b99b7e9baf8b6c",
"size": "1... |
from CIM15.IEC61968.Common.Document import Document
class ErpReceiveDelivery(Document):
"""Transaction for an Organisation receiving goods or services that may be used to indicate receipt of goods in conjunction with a purchase order. A receivable is an open (unpaid) item in the Accounts Receivable ledger.Transact... | {
"content_hash": "ebbb37f03e25d2e45b2514ac9bce3c3e",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 439,
"avg_line_length": 40.13636363636363,
"alnum_prop": 0.6993204983012458,
"repo_name": "rwl/PyCIM",
"id": "bf53e5684e3eaccc227803c2b0b9b5bef0746414",
"size": "2866",
"... |
import codecs
from setuptools import setup
with codecs.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name="shadowsocks",
version="2.8.2.1",
license='http://www.apache.org/licenses/LICENSE-2.0',
description="A fast tunnel proxy that help you get through firewalls",
... | {
"content_hash": "6e5b90d8126d64c93a22ed092a597526",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 74,
"avg_line_length": 33.92307692307692,
"alnum_prop": 0.6281179138321995,
"repo_name": "gitchs/shadowsocks",
"id": "bc220355e3b5dec017d20595baa48b6fd6ba5705",
"size": "13... |
"""The Hangouts Bot."""
import logging
from homeassistant.helpers import dispatcher, intent
from .const import (
ATTR_MESSAGE, ATTR_TARGET, CONF_CONVERSATIONS, DOMAIN,
EVENT_HANGOUTS_CONNECTED, EVENT_HANGOUTS_CONVERSATIONS_CHANGED,
EVENT_HANGOUTS_DISCONNECTED, EVENT_HANGOUTS_MESSAGE_RECEIVED,
CONF_MAT... | {
"content_hash": "80abeed190efcda3e66fd48026c558b7",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 79,
"avg_line_length": 40.8014705882353,
"alnum_prop": 0.5633447468012255,
"repo_name": "persandstrom/home-assistant",
"id": "7edc8898c8cf813c37c8b4bb189b8668729c91da",
"s... |
import asyncio
import json
import random
from ctypes import cdll
from time import sleep
import platform
import logging
from demo_utils import file_ext
from vcx.api.connection import Connection
from vcx.api.credential_def import CredentialDef
from vcx.api.issuer_credential import IssuerCredential
from vcx.api.proof im... | {
"content_hash": "a29a6d1ec3b2cef7a512ac71fe1a17b0",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 107,
"avg_line_length": 37.49650349650349,
"alnum_prop": 0.6876165609847072,
"repo_name": "anastasia-tarasova/indy-sdk",
"id": "fad8209e59d18a3f051be4ea7447411adf5350ff",
... |
"""
With these settings, tests run faster.
"""
from .base import * # noqa
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = "!!!SET DJANGO_SECRET_KEY!!!"
# https://docs.djangoproject.com/en/dev/ref... | {
"content_hash": "0f1393aba045f3dfca400739dd0b8bec",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 105,
"avg_line_length": 38.891891891891895,
"alnum_prop": 0.5163307852675469,
"repo_name": "rohithpr/bookmark-manager",
"id": "ef7e68cec1143e3466c5c19d42fd69f6e32cec69",
"s... |
from .Error import *
| {
"content_hash": "0917c8887a927d812c9bf507bc0563b7",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 20,
"avg_line_length": 21,
"alnum_prop": 0.7142857142857143,
"repo_name": "dhxkgozj/DirEngine",
"id": "22380e80915bb73491f7b2cdd5e6d15205d3015e",
"size": "21",
"binary": f... |
"""
Test byteflow.py specific issues
"""
import unittest
from numba.tests.support import TestCase
from numba.core.compiler import run_frontend
class TestByteFlowIssues(TestCase):
def test_issue_5087(self):
# This is an odd issue. The exact number of print below is
# necessary to trigger it. Too m... | {
"content_hash": "af4006efcb0453460311dbce00907728",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 80,
"avg_line_length": 25.80851063829787,
"alnum_prop": 0.39530090684253916,
"repo_name": "numba/numba",
"id": "041e1d65b20f7fcdc49857903748727cecc29a16",
"size": "2426",
... |
from yaml import load
from logging import config
import os
def setup_logger(settings):
"""
Settings object
:param settings: Settings
:type settings: dict
:return:
"""
with open(os.path.join("logging.yaml")) as logging_config:
log_config = load(logging_config)
configure_logs(s... | {
"content_hash": "05fc1ab752a715fde875793e80c0a076",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 70,
"avg_line_length": 20.62,
"alnum_prop": 0.5809893307468477,
"repo_name": "kollad/turbo-ninja",
"id": "79886baeaa3843cc9fd2360f03b754462d9668ce",
"size": "1031",
"bina... |
from flask import Flask
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.admin import Admin
from config import config
db = SQLAlchemy()
login_manager = LoginManager()
login_manager.session_protection = 'strong'
login_manager.login_view = 'manager.login'
admin = Admin... | {
"content_hash": "4b09e5ca71a79a75788b9253f834cb9f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 68,
"avg_line_length": 24.8,
"alnum_prop": 0.7338709677419355,
"repo_name": "realityone/ReBlogger",
"id": "cf91f66ab3d836e1c70c58990c749219c6fbf17a",
"size": "868",
"bina... |
import argparse
import configparser
import os
import re
import stat
class TemplateFragment:
def __init__(self, tpl_global, context, verbatim, expr):
self.context = context
self.verbatim = verbatim
self.expr = expr
self.tpl_global = tpl_global
self.subst = ""
def __appen... | {
"content_hash": "4a02167c2847b7954fdc0b9b37284e21",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 92,
"avg_line_length": 31.083333333333332,
"alnum_prop": 0.5368632707774799,
"repo_name": "edersondisouza/soletta",
"id": "ea26bd5e86bf738f06469e1e474cfacf01d57e97",
"size... |
import pytest
@pytest.mark.plugins
def test_plugin_installed(Command):
assert 'cloud-aws' in Command.check_output(
'sudo /usr/share/elasticsearch/bin/plugin list')
@pytest.mark.plugins
def test_plugin_config(File):
assert File('/etc/elasticsearch/elasticsearch.yml').contains('region')
| {
"content_hash": "775db965a17c8e3f7e17fbf5b45f69e3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 74,
"avg_line_length": 25.5,
"alnum_prop": 0.738562091503268,
"repo_name": "mitodl/elasticsearch-formula",
"id": "04f45292f2591a7bf25136c315aa541c2eec5ea5",
"size": "306",
... |
import requests
BASE_URL = "http://fizzbuzzaas.herokuapp.com"
def fizzbuzz(params):
url = BASE_URL + "/fizzbuzz"
response = requests.get(url, params=params)
response_json = response.json()
return response_json["properties"]["value"]
for number in range(1, 101):
print fizzbuzz({"number": number })... | {
"content_hash": "b016c9d3455970e6398c7e42f931c639",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 47,
"avg_line_length": 26.75,
"alnum_prop": 0.6822429906542056,
"repo_name": "smizell/fizzbuzz-hypermedia-client",
"id": "2d9af54eb52467cb3da534d5cf054056901010ad",
"size":... |
import json
import django_filters
from django.contrib.auth.models import User, Group
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from rest_framework import status
from rest_framework import viewsets, mixins
from rest_framework import filters
from... | {
"content_hash": "a292951468ed8eb9740db92bfb1b682e",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 95,
"avg_line_length": 42.09473684210526,
"alnum_prop": 0.5591397849462365,
"repo_name": "Oinweb/fly-django",
"id": "3158e8ea4aea31c31b7467f2a8002d610996a6c1",
"size": "399... |
"""reST directive for syntax-highlighting ipython interactive sessions.
XXX - See what improvements can be made based on the new (as of Sept 2009)
'pycon' lexer for the python console. At the very least it will give better
highlighted tracebacks.
"""
from __future__ import (absolute_import, division, print_function,
... | {
"content_hash": "24bba1e337b8e5e8ebe9fe33b0164114",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 87,
"avg_line_length": 36.808,
"alnum_prop": 0.5431427950445555,
"repo_name": "daodaoliang/neural-network-animation",
"id": "0ba9cab40307bc8b04b413d68a95cf80666520b9",
"si... |
"""Add node with given data to linked list at a desired position."""
class Node(object):
"""Implement a node class."""
def __init__(self, data, next_node=None):
"""Give node data and next attributes on initialization."""
self.data = data
self.next = next_node
class LinkedList(object)... | {
"content_hash": "5bca26ab3ce0ca223cbec5a9950a2319",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 77,
"avg_line_length": 29.4375,
"alnum_prop": 0.5576786978060864,
"repo_name": "vbenavente/coffee_katas",
"id": "e63343e98d6aff4310f50a3a205c5f8e5d31df4b",
"size": "1413",
... |
"""
This file contains filters for the extracted data, mainly images.
"""
from __future__ import division
import logging
logger = logging.getLogger(__name__)
import config, request
from contextlib import closing
from pkg_resources import resource_filename
import re, PIL
from cStringIO import StringIO
... | {
"content_hash": "5868fc5adcc331087cbf9774c14aa2d3",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 110,
"avg_line_length": 35.01766784452297,
"alnum_prop": 0.5710393541876893,
"repo_name": "svven/summary",
"id": "18220df907bb4f14cfd63b51c8617b2e6115d228",
"size": "9910"... |
from pyqtgraph.Qt import QtCore, QtGui
if not hasattr(QtCore, 'Signal'):
QtCore.Signal = QtCore.pyqtSignal
import weakref
class CanvasManager(QtCore.QObject):
SINGLETON = None
sigCanvasListChanged = QtCore.Signal()
def __init__(self):
if CanvasManager.SINGLETON is not None:
... | {
"content_hash": "14935c84677de402112c2e037213dabf",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 109,
"avg_line_length": 29.2,
"alnum_prop": 0.5949771689497717,
"repo_name": "ZhuangER/robot_path_planning",
"id": "e89ec00f9bb8262bb511d68d3ab74c303eb38171",
"size": "2214... |
from widgets import ImageWithHighlightWidget
from django import forms
"""
Code largely inspired by: http://blog.elsdoerfer.name/2008/01/08/fuzzydates-or-one-django-model-field-multiple-database-columns/
"""
class ImageWithHighlightFormField(forms.ImageField):
"""
A form field to do the image with highlight th... | {
"content_hash": "5ea789a92b3db6da802363c6b2bd7475",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 128,
"avg_line_length": 28.53846153846154,
"alnum_prop": 0.7654986522911051,
"repo_name": "gregplaysguitar/glamkit",
"id": "2568a4c521b62ad5f08c15941a785a7b3a6bf6fd",
"size... |
"""
tcp_message Inline Script Hook API Demonstration
------------------------------------------------
* modifies packets containing "foo" to "bar"
* prints various details for each packet.
example cmdline invocation:
mitmdump --rawtcp --tcp-host ".*" -s examples/complex/tcp_message.py
"""
from mitmproxy.utils import ... | {
"content_hash": "bef37548c19eca77b65fcb27866fc485",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 32.148148148148145,
"alnum_prop": 0.630184331797235,
"repo_name": "ujjwal96/mitmproxy",
"id": "b1311d08ef54f651d8ccb73e1a63e7ab49ee598f",
"size": "86... |
import sys
import signal
import time
from threading import Thread
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
class Handler(BaseHTTPRequestHandler):
#
# POST request handler
#
def do_POST(self):
# Display headers
print "POST request received headers:"
print se... | {
"content_hash": "0bbf2cbb7dfb0226a25521733b780c81",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 105,
"avg_line_length": 35.864197530864196,
"alnum_prop": 0.6013769363166953,
"repo_name": "nishabe/Refresher-OBJC",
"id": "176626010bedf6baae87eb4db9939098718fec8c",
"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):
# Adding model 'Announcement'
db.create_table('announcements_announcement', (
('id', self.gf('django.db.models.f... | {
"content_hash": "86dff35bf3e4525603c6128cb34d8bdc",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 119,
"avg_line_length": 50.63636363636363,
"alnum_prop": 0.5947037701974865,
"repo_name": "hoosteeno/mozillians",
"id": "cb00699b185e165f8ea6bf991287f530e338b4f8",
"size": ... |
from keras import backend as K
from overrides import overrides
from .masked_layer import MaskedLayer
class VectorMatrixSplit(MaskedLayer):
"""
This Layer takes a tensor with K modes and splits it into a tensor with K - 1 modes and a
tensor with K modes, but one less row in one of the dimensions. We call... | {
"content_hash": "f0e15bc4160b09a9462e8fa79ce1e8b6",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 99,
"avg_line_length": 41.55128205128205,
"alnum_prop": 0.6349892008639308,
"repo_name": "allenai/deep_qa",
"id": "825a5923f0ae4396fad6d9451016a6c535351a5f",
"size": "3241"... |
"""
Based on an example provided by Ricardo Reis.
https://github.com/ricardo-reis-1970/colorlog-YAML
This configures the `logging` module from a YAML file, and provides specific
configuration for the loggers named 'application' and 'example'.
"""
import logging.config
import pathlib
import yaml
def config():
"... | {
"content_hash": "e6fd42467482381ef480c7b1b1474b21",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 35.283018867924525,
"alnum_prop": 0.7240641711229947,
"repo_name": "borntyping/python-colorlog",
"id": "ab1f7059f89bd4904481c2e044244b5856469894",
"s... |
from qingcloud.cli.qs_client.actions import key
from qingcloud.cli.qs_client.actions import bucket
from qingcloud.cli.qs_client.actions import service
from qingcloud.cli.qs_client.actions import multipart
class ActionManager(object):
@classmethod
def get_action(cls, action):
for item in cls.action_tab... | {
"content_hash": "f5601b6437e8f6814342b91f1809b977",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 70,
"avg_line_length": 39.41463414634146,
"alnum_prop": 0.656559405940594,
"repo_name": "yunify/qingcloud-cli",
"id": "0b86379e7c567d25fef7ab25c9d6438698946532",
"size": "2... |
""" Defines the backend connection class for MySQL databases. """
from . import statements
from .mysqlconnection import MySQLConnection | {
"content_hash": "0ebd0b7051a8106b6edc0ed3b59f92f1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 65,
"avg_line_length": 34,
"alnum_prop": 0.8014705882352942,
"repo_name": "orb-framework/orb",
"id": "c379627142bf9ee1c2f376087111dd5024613551",
"size": "136",
"binary": f... |
from test_dep_pack_old.mod import func
| {
"content_hash": "b7fbc1a803b2f6c0eb4e2692f02b8a2a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 38,
"avg_line_length": 39,
"alnum_prop": 0.7948717948717948,
"repo_name": "westernx/metatools",
"id": "422fbcdfa8a813117ee786d2e64bde1d7b33e521",
"size": "39",
"binary": f... |
import math
from datetime import datetime
from bottle import jinja2_template as template, request, redirect
from models.cmsmodels import Posts
import admin.session as withsession
app = withsession.app
@withsession.app.app.get('/posts/<page:int>')
@withsession.app.app.get('/posts')
@withsession.issessionactive()
d... | {
"content_hash": "12aa8f903f8b261a15752496132c5d1b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 93,
"avg_line_length": 28.525641025641026,
"alnum_prop": 0.6013483146067415,
"repo_name": "unixxxx/simplecms",
"id": "01f54009122a8bea4674399d43b5e0debfb65d49",
"size": "22... |
from enum import Enum
from typing import List, Set
from russ.syllables import get_syllables
class Stress:
"""
Ударение
"""
class Type(Enum):
ANY = -1
PRIMARY = 0
SECONDARY = 1
def __init__(self, position: int, stress_type: Type=Type.PRIMARY) -> None:
self.position... | {
"content_hash": "ec4ce9a6f304e05adecd708138b181f5",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 100,
"avg_line_length": 29.263157894736842,
"alnum_prop": 0.5908273381294964,
"repo_name": "IlyaGusev/rupo",
"id": "8f1b95ea0c47ad6f208731f9d91c0c210fdd71f9",
"size": "2373... |
"""Loads run-time extensions
These loads components are considered extensions as they extend the underlying
AWS instances to add feature support and state maintenance. This composition
avoids excessively large AWS instance classes as external objects can augment
the AWS instances as needed to retain their information.... | {
"content_hash": "71507684c252289e7cdd5b38c9e807c5",
"timestamp": "",
"source": "github",
"line_count": 597,
"max_line_length": 79,
"avg_line_length": 36.74036850921273,
"alnum_prop": 0.5402571350414881,
"repo_name": "loads/loads-broker",
"id": "04e239daf0911b3be2449aa21f321cb0b1b5936d",
"size": "2... |
"""Tornado forms: simple form validation.
Form fields.
"""
import re
import decimal
from tornforms.requirements import *
from tornforms.utils import FormError, ErrorList, decapitalize
class BaseField(object):
"""Abstract base class for form fields.
"""
def __init__(self, required=False, in_list=False, ... | {
"content_hash": "6ac8a05517bca5241ab9a6119d09e220",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 99,
"avg_line_length": 32.44444444444444,
"alnum_prop": 0.5694520547945205,
"repo_name": "cole/tornforms",
"id": "9b47d1168a9f4791a9b8b7b4c75ef7f9ec7c1253",
"size": "7356"... |
"""
Python program for powering on vms on a host on which hostd is running
"""
from __future__ import print_function
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import argparse
import atexit
import getpass
import sys
def GetArgs():
"""
Supports the command-line arguments ... | {
"content_hash": "cbb9763866430362c4a42f2be98ff6b0",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 130,
"avg_line_length": 34.449367088607595,
"alnum_prop": 0.5812970788168289,
"repo_name": "mat-vmware/vsphere-api-guide-python",
"id": "262b3155208e271c6c4d0738e1161b79ede8... |
"""
desispec.io.fluxcalibration
===========================
IO routines for flux calibration.
"""
from __future__ import absolute_import
import os
from astropy.io import fits
import numpy,scipy
from .util import fitsheader, native_endian, makepath
def write_stdstar_model(norm_modelfile,normalizedFlux,wave,fibers,data... | {
"content_hash": "88327b20ec477361e9a19101a4d10dae",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 84,
"avg_line_length": 35.03636363636364,
"alnum_prop": 0.68188894654904,
"repo_name": "profxj/desispec",
"id": "650f79b53d6b500c3892716649f110aa165bd7da",
"size": "3854",... |
from apps.auth import helpers
NAME = 'instagram'
FIELDS = {
helpers.provider_field_name(NAME, 'consumer_key'): 'Client ID',
helpers.provider_field_name(NAME, 'consumer_secret'): 'Client Secret',
}
OAUTH = {
'base_url': 'https://api.instagram.com/v1',
'request_token_url': None,
'access_token_ur... | {
"content_hash": "e27fa19df38b29a41fd93beb849fd1f1",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 28.105263157894736,
"alnum_prop": 0.6704119850187266,
"repo_name": "gmist/3dhero2",
"id": "94452184470450a391f7c63b5dfae424645816a9",
"size": "550",
... |
"""Utility routines for workflow graphs
"""
from copy import deepcopy
from glob import glob
from collections import defaultdict
import os
import pickle
import pwd
import re
from uuid import uuid1
import numpy as np
from nipype.utils.misc import package_check
package_check('networkx', '1.3')
import json
from socket i... | {
"content_hash": "87c14fdf3f74fb4f79e6bbf2937d2776",
"timestamp": "",
"source": "github",
"line_count": 1352,
"max_line_length": 99,
"avg_line_length": 41.14349112426036,
"alnum_prop": 0.563189875238198,
"repo_name": "FredLoney/nipype",
"id": "5ae82fe77a043d62291c57fbd49d0c0d6d50dd55",
"size": "557... |
import unittest
import sys
import StringIO
import IECore
import Gaffer
import GafferUI
import GafferUITest
class EventSignalCombinerTest( GafferUITest.TestCase ) :
def trueSlot( self, gadget, event ) :
self.trueSlotCalled = True
return True
def falseSlot( self, gadget, event ) :
self.falseSlotCalled = Tr... | {
"content_hash": "fcca96ad1319f3e776f5a3deade85e31",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 62,
"avg_line_length": 24.370786516853933,
"alnum_prop": 0.7224527431996312,
"repo_name": "cedriclaunay/gaffer",
"id": "4665eda475021fb91a283982bcbddd550ce7f168",
"size": "... |
from django.test import TestCase
from django.utils import timezone
from django.db import IntegrityError
from django.core.exceptions import MultipleObjectsReturned
from core.tests.mommy_utils import make_recipe, make_user
from timer.models import Timer
class RunningTimerManagerTestCase(TestCase):
def test_query_... | {
"content_hash": "3c291bafd32e1e67e6a7157aa145e9a1",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 95,
"avg_line_length": 36.714285714285715,
"alnum_prop": 0.682230869001297,
"repo_name": "ministryofjustice/cla_backend",
"id": "bb50ddc7c9fdf4690ca7e9bb60ec4a0df3dd0ba9",
... |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
from .external import ExternalLink
| {
"content_hash": "b292576d0e76343e56d9f5afd9d2d03c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 38,
"avg_line_length": 27.5,
"alnum_prop": 0.7818181818181819,
"repo_name": "kawamon/hue",
"id": "df752945ddb5cf515b4b97e47b4b80fc4117d145",
"size": "110",
"binary": false... |
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from caffe2.python import schema
from caffe2.python.layers.layers import ModelLayer
class FeatureSparseToDense(ModelLayer):
def __init__(
self, model, input_record, input_specs, name="feature_sparse_to_d... | {
"content_hash": "97fa14384501f4b71fe180464c633cdb",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 88,
"avg_line_length": 45.02040816326531,
"alnum_prop": 0.4262617104865518,
"repo_name": "ryfeus/lambda-packs",
"id": "8fd340b195a914b58dd7e14168ed231641b2a07a",
"size": "... |
from sseclient import SSEClient
from Queue import Queue
import requests
import json
import threading
import display
import socket
import sys
#DISPLAY_CLASS = display.BasicDisplay
DISPLAY_CLASS = display.CursesDisplay
URL = 'https://eventsource.firebaseio-demo.com/.json'
class ClosableSSEClient(SSEClient):
"""
... | {
"content_hash": "5594eb447694c849a9feb310e422843f",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 111,
"avg_line_length": 29.864077669902912,
"alnum_prop": 0.5715214564369311,
"repo_name": "googlearchive/EventSource-Examples",
"id": "40eb97c96f58eaab478868e17eeb30f197811... |
import json
import os
import pipes
import shutil
import subprocess
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
nacl_dir = os.path.dirname(script_dir)
root_dir = os.path.dirname(nacl_dir)
sys.path.insert(1, os.path.join(root_dir, 'tools'))
sys.path.insert(0, os.path.join(root_dir, 'tools', 'gyp... | {
"content_hash": "218147d9e4392ddae9586792d7738aba",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 80,
"avg_line_length": 38.05917159763314,
"alnum_prop": 0.6714863184079602,
"repo_name": "CTSRD-SOAAP/chromium-42.0.2311.135",
"id": "feb8d740c6fce782abe8f003edcef67972634a8... |
"""
Analytics service integration for Django
========================================
The django-analytical application integrates analytics services into a
Django_ project. See the ``docs`` directory for more information.
.. _Django: http://www.djangoproject.com/
"""
__author__ = "Joost Cassee"
__email__ = "joost@... | {
"content_hash": "ca0de8bf8ece4a70ada5091bf10c59fc",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 29.933333333333334,
"alnum_prop": 0.6414253897550112,
"repo_name": "ChristosChristofidis/django-analytical",
"id": "9490ae98972bfdd11106228ba231de0273d... |
from keystone import config
from keystone import test
from keystone.common.sql import util as sql_util
from keystone.identity.backends import sql as identity_sql
from keystone.token.backends import sql as token_sql
import test_backend
import default_fixtures
CONF = config.CONF
class SqlIdentity(test.TestCase, test... | {
"content_hash": "67d809da6ee390c136399b861448ed86",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 71,
"avg_line_length": 36.04477611940298,
"alnum_prop": 0.6227743271221532,
"repo_name": "sileht/deb-openstack-keystone",
"id": "4d1da37c34247484b2e9ebbd8e81a1172205ee5b",
... |
ten_things = "Apples Oranges Crows Telephone Light Sugar"
print("Wait there are not 10 things in that list. Let's fix that.")
stuff = ten_things.split(' ')
more_stuff = ["Day", "Night", "Song", "Frisbee", "Corn", "Banana", "Girl", "Boy"]
while len(stuff) != 10:
next_one = more_stuff.pop()
print("Adding:", n... | {
"content_hash": "7df4af12d188568c78104ccf841cdf8d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 26.791666666666668,
"alnum_prop": 0.6236391912908242,
"repo_name": "davvi/Hardway3",
"id": "4fddfcdd0d8f09866b37cdf5ee627b9636b9ad97",
"size": "666",... |
import numpy as np
from PIL import Image
import random
# [1 0] for syn label 1
class dNetData(object):
def __init__(self, batch_size, image_width, image_height):
self.batch_size = batch_size
self.seen = 0
self.fileNames = []
self.labels = []
self.image_height = image_height
... | {
"content_hash": "86eee62acaa0cd8af57323bd985461f4",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 108,
"avg_line_length": 30.758064516129032,
"alnum_prop": 0.5448348190875721,
"repo_name": "huangshiyu13/funnyLittleProgram",
"id": "79ffe6652325f154c0b0d5cb5e2036feb1018b03"... |
def stray(arr):
return reduce(lambda prev, curr: prev ^ curr, arr)
| {
"content_hash": "e0c0e5d216dd2767cb1a2c75dc71d05c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 54,
"avg_line_length": 35.5,
"alnum_prop": 0.676056338028169,
"repo_name": "the-zebulan/CodeWars",
"id": "2947c0a21e039c13a52c661a597ac229fed41e01",
"size": "71",
"binary"... |
"""Support for the OpenWeatherMap (OWM) service."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_API_KEY,
CONF_MONITORED_CONDITIONS,
CONF_NAME,
TEMP_CELSIU... | {
"content_hash": "176272ef75f7e51b47a964c67595ebbe",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 88,
"avg_line_length": 33.50222222222222,
"alnum_prop": 0.5784027593526134,
"repo_name": "fbradyirl/home-assistant",
"id": "85bd1ccb2c6eb03233b4647a00a591d12a34f884",
"siz... |
"""
FILE: chat_client_sample_async.py
DESCRIPTION:
These samples demonstrate create a chat client, get a chat thread client,
create a chat thread, get a chat thread by id, list chat threads, delete
a chat thread by id.
You need to use azure.communication.configuration module to get user access
token... | {
"content_hash": "29cb9bfc3cef4ae8aff99fed8c47cbee",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 117,
"avg_line_length": 39.3525641025641,
"alnum_prop": 0.6709561817885649,
"repo_name": "Azure/azure-sdk-for-python",
"id": "3ff971aa1e46b3f65563c4256af182824198995e",
"s... |
import pandas as pd
import os, sys, time, random
import numpy as np
from scipy import stats
#NORMALIZATION FUNCTIONS
def LibSize_norm(df, normalization_probes=[]):
'''
Expects sample (rows) by gene (cols) pandas DataFrame
'''
if normalization_probes==[]:
normalization_probes = df.columns
... | {
"content_hash": "afe2319720b4851ca44229c8cec0b18f",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 187,
"avg_line_length": 28.558441558441558,
"alnum_prop": 0.6382446566621192,
"repo_name": "erscott/RASLseqTools",
"id": "a85eb8901bae8284679866ec8cf4ea3c49004035",
"size"... |
"""
This paver file is intended to help with the release process, and build sdist,
documentation, release notes, and generate checksums for them.
For details on the release process, see
http://scipy.github.io/devdocs/dev/core-dev/index.html#making-a-scipy-release
Building changelog + notes
==========================
... | {
"content_hash": "cc95806164469d3334f61ae06fa7d243",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 86,
"avg_line_length": 30.416666666666668,
"alnum_prop": 0.6190639269406393,
"repo_name": "matthew-brett/scipy",
"id": "e815a9a745ae8fb56834bb4d004a47a872bb7811",
"size": ... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
Resourc... | {
"content_hash": "5c6346a475d1be174e00647c2a326da6",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 213,
"avg_line_length": 45.009433962264154,
"alnum_prop": 0.6435757702787676,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2b417daeafa63b59050d945e5d1e217b428e2219",
... |
import datetime
from visbeer.services.service_helper import beginning_of_current_day, DEFAULT_CREDITS_PER_DAY
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S"
class DataService:
def __init__(self, flag_service):
self.flag_service = flag_service
def find_person(self, rfid):
return self.flag_service.find... | {
"content_hash": "1dd4a751accdc4c5e3fbedd19438d21d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 104,
"avg_line_length": 35.910714285714285,
"alnum_prop": 0.6618597712580806,
"repo_name": "lukaselmer/vis-beer",
"id": "2a49feae76557da57926fb9671c5608bcf29259b",
"size": ... |
"""Computes rouge scores between two text blobs.
Implementation replicates the functionality in the original ROUGE package. See:
Lin, Chin-Yew. ROUGE: a Package for Automatic Evaluation of Summaries. In
Proceedings of the Workshop on Text Summarization Branches Out (WAS 2004),
Barcelona, Spain, July 25 - 26, 2004.
D... | {
"content_hash": "43e91f50abd03d4f4a08ffe05e778fbc",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 79,
"avg_line_length": 31.58125,
"alnum_prop": 0.6611913714624975,
"repo_name": "google-research/google-research",
"id": "329be65e948ae9b8b2bd8a59954a9e99ea639b40",
"size"... |
import numpy as np
from scipy.spatial import distance
from scipy.sparse import csr_matrix
from scipy.sparse import issparse
from ..utils import check_array
from ..utils import gen_even_slices
from ..utils import gen_batches
from ..utils.extmath import row_norms, safe_sparse_dot
from ..preprocessing import normalize
fr... | {
"content_hash": "db5c44b1b4447c05517bea8162ba3359",
"timestamp": "",
"source": "github",
"line_count": 1215,
"max_line_length": 81,
"avg_line_length": 33.74074074074074,
"alnum_prop": 0.6097816806927674,
"repo_name": "0x0all/scikit-learn",
"id": "3543254b47ef02deb9646b04480f09f73aee5059",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.