text stringlengths 4 1.02M | meta dict |
|---|---|
import numpy as np
from pandas.compat import zip
from pandas.core.dtypes.generic import ABCSeries, ABCIndex
from pandas.core.dtypes.missing import isna, notna
from pandas.core.dtypes.common import (
is_bool_dtype,
is_categorical_dtype,
is_object_dtype,
is_string_like,
is_list_like,
is_scalar,
... | {
"content_hash": "ccfea6db631b3716cff58a9f8c544de7",
"timestamp": "",
"source": "github",
"line_count": 1939,
"max_line_length": 79,
"avg_line_length": 30.999484270242395,
"alnum_prop": 0.5750482464896519,
"repo_name": "DGrady/pandas",
"id": "0b1db0277eee3fc0d7b7d80258333c157a7cf46b",
"size": "6010... |
"""Home of the Sequential model, and the `save_model`/`load_model` functions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import json
import os
import numpy as np
from tensorflow.contrib.keras.python.keras import backend as K
from tens... | {
"content_hash": "9a2d86041d80642492debca962e652ce",
"timestamp": "",
"source": "github",
"line_count": 1218,
"max_line_length": 119,
"avg_line_length": 35.14860426929393,
"alnum_prop": 0.6266380135946369,
"repo_name": "jostep/tensorflow",
"id": "1a0d95c7ff24f3ff658cce7ef86204c04820806b",
"size": "... |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound, PermissionDenied
from framework.auth.oauth_scopes import CoreScopes
from osf.models import AbstractNode, Registration, OSFUser
from api.base import permissions as base_permissions
from a... | {
"content_hash": "6acb15363d5c4d2070361d5a000c58a3",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 150,
"avg_line_length": 40.803863298662705,
"alnum_prop": 0.6965150577182185,
"repo_name": "binoculars/osf.io",
"id": "25d487a64e482fcb96a8edf4a53cf7b2b6b85e95",
"size": "... |
import SimpleXMLRPCServer as xmls
def echo(msg):
print 'Got', msg
return msg
class echoserver(xmls.SimpleXMLRPCServer):
allow_reuse_address = True
server = echoserver(('127.0.0.1', 8001))
server.register_function(echo, 'echo')
print 'Listening on port 8001'
try:
server.serve_forever()
except:
ser... | {
"content_hash": "efee93b31fae91ae9847a66afd43f468",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 42,
"avg_line_length": 21.1875,
"alnum_prop": 0.7138643067846607,
"repo_name": "keobox/yap101",
"id": "7ce16cb7ee2c1e090289468a70fd88401aba8ddc",
"size": "339",
"binary":... |
def find_words(letters):
results = set()
def extend_prefix(w, letters):
if w in WORDS: results.add(w)
if w not in PREFIXES: return
for L in letters:
return extend_prefix(w+L, removed(letters, L))
extend_prefix('', letters)
return results | {
"content_hash": "f320adfb5df820a107a9475880976857",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 22.90909090909091,
"alnum_prop": 0.6944444444444444,
"repo_name": "feredean/cs313",
"id": "758a7c1bb061591a35f644b3c09e4d739c506101",
"size": "254",
... |
import sys
from Bio import SeqIO
# nanocorrect is zero-based, exclusive endpoints
recs = len([rec for rec in SeqIO.parse(open(sys.argv[1]), "fasta")])
batch_size = 50
for n in xrange(0, recs, batch_size):
if (n + batch_size) > recs:
print "%d:%d" % (n, recs)
else:
print "%d:%d" % (n, n + batch_size)
| {
"content_hash": "f7917e92e461e6cf884b86ba45387435",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 25.75,
"alnum_prop": 0.6440129449838188,
"repo_name": "jts/nanocorrect",
"id": "9d8828973c5d9ea67f21e48a7caec8c73471ec30",
"size": "310",
"binary":... |
"""Code to exist off of google.appengine.dist.
Kept in a separate file from the __init__ module for testing purposes.
"""
__all__ = ['use_library']
try:
import distutils.version
except ImportError:
distutils = None
import os
import sys
server_software = os.getenv('SERVER_SOFTWARE')
USING_SDK = not server_so... | {
"content_hash": "1d44853c93d8440c780baf6f58402841",
"timestamp": "",
"source": "github",
"line_count": 435,
"max_line_length": 79,
"avg_line_length": 23.680459770114943,
"alnum_prop": 0.6767304145228619,
"repo_name": "illicitonion/givabit",
"id": "289d8c999b3c67699e99a5cd9b1da47d5d1d523b",
"size":... |
"""manage test imports."""
import unittest
def suite():
"""collect and run all tests for gateway."""
return unittest.TestLoader().discover("gateway.tests", pattern="*.py")
| {
"content_hash": "39e8887ab5542bfda5d20816ae75d76b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 74,
"avg_line_length": 26,
"alnum_prop": 0.6758241758241759,
"repo_name": "davisk/gateway",
"id": "aebce2ad9a15b5b5575a93fe89bb1db1061e02fe",
"size": "182",
"binary": fals... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0004_batchfile_hash_sha512'),
]
operations = [
migrations.AlterField(
model_name='b... | {
"content_hash": "a0ab2a5a150578d76835c06a036a8bc2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 24.57894736842105,
"alnum_prop": 0.6445396145610278,
"repo_name": "aginzberg/crowdsource-platform",
"id": "bcfeb6d4b05fed1caf5d37409625165e0916ffdd",
... |
from __future__ import unicode_literals
import datetime
import inspect
import random
import re
import six
def camelcase_to_underscores(argument):
''' Converts a camelcase param like theNewAttribute to the equivalent
python underscore variable like the_new_attribute'''
result = ''
prev_char_title = Tr... | {
"content_hash": "8aa7d3ed60a88bdf63faddbb9d92094c",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 135,
"avg_line_length": 31.54471544715447,
"alnum_prop": 0.6257731958762887,
"repo_name": "silveregg/moto",
"id": "0b30556acdff49e8d02c5e0dc3a0572f54eb7e72",
"size": "3880... |
import errno
import json
import logging
import math
import time
import unittest
from threading import Event, Thread
import cook.executor as ce
import cook.progress as cp
import tests.utils as tu
class ProgressTest(unittest.TestCase):
def test_match_progress_update(self):
progress_regex_string = '\^\^\^\... | {
"content_hash": "ca0247d01a391c43ebd89915bd258ec4",
"timestamp": "",
"source": "github",
"line_count": 648,
"max_line_length": 120,
"avg_line_length": 46.248456790123456,
"alnum_prop": 0.5708899195835697,
"repo_name": "twosigma/Cook",
"id": "96eae55f594d6552c8fa48b0b2e85dd6a4760124",
"size": "2996... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: redis
short_description: Various redis commands, slave and fl... | {
"content_hash": "5051b7ad042711f75ea225d26d9e3887",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 135,
"avg_line_length": 32.66329966329966,
"alnum_prop": 0.5812802803834656,
"repo_name": "thaim/ansible",
"id": "0a27c4e1b17489833d8f2df5aadbd9ac938753e3",
"size": "9867"... |
""" QiBuild """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
print("this is foo")
| {
"content_hash": "4564fb968bd5174b446c010f87ca6025",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 39,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.7161290322580646,
"repo_name": "aldebaran/qibuild",
"id": "1dba1b80a62ac7991d3a492dbb0296b429eda678",
"size": "352... |
from __future__ import unicode_literals
import re
from math import floor
from django import template
from django.template.loader import get_template
from django.utils.encoding import force_text
from ..bootstrap import css_url, javascript_url, jquery_url, theme_url
from ..html import link_tag
from ..forms import rend... | {
"content_hash": "6c35af5fec9b7677ba07e5c012f25a71",
"timestamp": "",
"source": "github",
"line_count": 527,
"max_line_length": 122,
"avg_line_length": 21.434535104364326,
"alnum_prop": 0.554621104815864,
"repo_name": "rumz/pis-system",
"id": "a13d65500e860fe3acfcf5b54bbef42d35089bc9",
"size": "112... |
import os
import logging
import socket
from dessn.framework.fitter import Fitter
from dessn.framework.models.approx_model import ApproximateModel
from dessn.framework.simulations.snana_bulk import SNANABulkSimulation
from dessn.framework.simulations.selection_effects import lowz_sel, des_sel
if __name__ == "__main__"... | {
"content_hash": "78634515e102d65685799936c6c76afc",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 128,
"avg_line_length": 42.01923076923077,
"alnum_prop": 0.6718535469107552,
"repo_name": "dessn/sn-bhm",
"id": "1c0c8e02edcad0b718dd139edf2affab99db515b",
"size": "2185",
... |
import operator
from datetime import datetime, timedelta
import warnings
from itertools import product, starmap
import numpy as np
import pytest
import pytz
import pandas as pd
import pandas.util.testing as tm
from pandas.compat.numpy import np_datetime64_compat
from pandas.errors import PerformanceWarning, NullFreq... | {
"content_hash": "b75568a75c5218830f1a2473aa6bc80f",
"timestamp": "",
"source": "github",
"line_count": 1864,
"max_line_length": 79,
"avg_line_length": 39.43562231759657,
"alnum_prop": 0.5547967568155847,
"repo_name": "cython-testbed/pandas",
"id": "36bb0aca066fbffda83e038d300115d493081fb5",
"size"... |
"""Tests for Vanderbilt SPC component."""
from unittest.mock import patch, PropertyMock, Mock
from homeassistant.bootstrap import async_setup_component
from homeassistant.components.spc import DATA_API
from homeassistant.const import (STATE_ALARM_ARMED_AWAY, STATE_ALARM_DISARMED)
from tests.common import mock_coro
... | {
"content_hash": "35e661e02b9e78aedc53dfc743cb903f",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 33.78378378378378,
"alnum_prop": 0.6424,
"repo_name": "persandstrom/home-assistant",
"id": "d4bedda4e967e7b1739785b433ba1e43fc2c5305",
"size": "2500"... |
import pymongo
from scrapy.conf import settings
from scrapy.exceptions import DropItem
from scrapy import log
class MongoDBPipeline(object):
def __init__(self):
connection = pymongo.MongoClient(
settings['MONGODB_SERVER'],
settings['MONGODB_PORT']
)
db = connectio... | {
"content_hash": "9800e2ac8391b7b94596d6a974657d98",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 70,
"avg_line_length": 27.714285714285715,
"alnum_prop": 0.6408934707903781,
"repo_name": "Nathx/parental_advisory_ml",
"id": "7f01262fa3a09481d58c1eca876f8fd73c1d3d96",
"s... |
"""This library contains classes for launching graphs and executing operations.
The [basic usage](../../get_started/index.md#basic-usage) guide has
examples of how a graph is launched in a [`tf.Session`](#Session).
## Session management
@@Session
@@InteractiveSession
@@get_default_session
## Error classes
@@OpErr... | {
"content_hash": "b059965facf48466c914b432cce0effd",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 79,
"avg_line_length": 28.15686274509804,
"alnum_prop": 0.8182451253481894,
"repo_name": "awni/tensorflow",
"id": "37f8fe29946bd811440e55305563d0406791a160",
"size": "2146"... |
class AgentGlobals(object):
"""
This class is used for setting AgentGlobals which can be used all throughout the Agent.
"""
GUID_ZERO = "00000000-0000-0000-0000-000000000000"
#
# Some modules (e.g. telemetry) require an up-to-date container ID. We update this variable each time we
# fetch ... | {
"content_hash": "f342e9371e91cb8f09d51af708d5896b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 108,
"avg_line_length": 28.65,
"alnum_prop": 0.6736474694589878,
"repo_name": "Azure/WALinuxAgent",
"id": "dbfda92d9dcfa019126afca1edf603da9c48f3c0",
"size": "1234",
"bin... |
from msrest.paging import Paged
class DataMaskingRulePaged(Paged):
"""
A paging container for iterating over a list of :class:`DataMaskingRule <azure.mgmt.sql.models.DataMaskingRule>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key'... | {
"content_hash": "8807295f0af4e1b91b7a7e82567a93e3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 123,
"avg_line_length": 29.8125,
"alnum_prop": 0.6184486373165619,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "4e1eed7b9f516b90aea2317dc18ce3f9b5552290",
"size":... |
"""
Created on May 17, 2013
@author: tanel
"""
import gi
gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst
GObject.threads_init()
Gst.init(None)
import logging
import thread
import os
logger = logging.getLogger(__name__)
import pdb
class DecoderPipeline2(object):
def __init__(self, conf=... | {
"content_hash": "0b80ca9cb171e8c4201e67690ce3fb62",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 106,
"avg_line_length": 38.18141592920354,
"alnum_prop": 0.6256808436667053,
"repo_name": "claritylab/kaldi-gstreamer-server",
"id": "f70fa4716a8ad9de69464eb03d1b8acc667bcf2... |
from argus.backends import base as base_backend
from argus.backends import windows as windows_backend
from argus import config as argus_config
CONFIG = argus_config.CONFIG
class LocalBackend(windows_backend.WindowsBackendMixin,
windows_backend.BaseMetadataProviderMixin,
base_bac... | {
"content_hash": "e0d867072c6e9d3cf6ca4153c5d56ce3",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 34.74418604651163,
"alnum_prop": 0.5876840696117804,
"repo_name": "micumatei/cloudbase-init-ci",
"id": "673a0f9b7e99e695523e23f8683bdcb67b915743",
"s... |
import os
import re
import sys
import urllib
import gzip
import cStringIO
import subprocess
from debian import deb822
import argparse
destdir="newpkg"
arches=["amd64", "i386"]
REPO="http://repo.steampowered.com/steamrt"
DIST="scout"
COMPONENT="main"
out = open("runtime-generated.nix", "w");
out.write("# This file is... | {
"content_hash": "96814fda9c3132abf9fff89c2e4d960a",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 123,
"avg_line_length": 29.383458646616543,
"alnum_prop": 0.6678607983623337,
"repo_name": "triton/triton",
"id": "3244297084906e7fa19f33ab8154b61cc568c90f",
"size": "4097... |
from google.cloud import retail_v2
async def sample_create_control():
# Create a client
client = retail_v2.ControlServiceAsyncClient()
# Initialize request argument(s)
control = retail_v2.Control()
control.display_name = "display_name_value"
control.solution_types = "SOLUTION_TYPE_SEARCH"
... | {
"content_hash": "976cc18150173ec9b650e34b07a9b8ce",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 62,
"avg_line_length": 26.4,
"alnum_prop": 0.6954545454545454,
"repo_name": "googleapis/python-retail",
"id": "57c27d004ab84376c487972ad987bf6f1bf7c223",
"size": "2045",
... |
from __future__ import (absolute_import, division, print_function,
with_statement)
from Crypto.PublicKey import RSA
import datetime
from podship.models import UserBase
from firenado.config import load_yaml_config_file
from firenado import service
from firenado.util import random_string
from pas... | {
"content_hash": "c94f222f230eb110496819dcedbf75ee",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 79,
"avg_line_length": 36.16279069767442,
"alnum_prop": 0.6113612004287245,
"repo_name": "piraz/diasporapy",
"id": "7006c1f50a06710414fff5e726d918af5c2b913c",
"size": "532... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_naboo_swamhunt_large2.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "91aa2ff4e0a38ab3c314f76d0bdb5f9b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6938110749185668,
"repo_name": "obi-two/Rebelion",
"id": "52fdf87f216fdc1279055d7846c7c199ae4c339f",
"size": "452... |
import unicodedata
__all__ = [
"EmojiData",
]
def get_unicode_data(emoji):
try:
name = [unicodedata.name(ch) for ch in emoji]
category = [unicodedata.category(ch) for ch in emoji]
except ValueError:
# Couldn't find for codepoint
name = [emoji]
category = ["unicode_... | {
"content_hash": "5b3afa450fea9c41e18a0c555508af5d",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 65,
"avg_line_length": 24.576470588235296,
"alnum_prop": 0.49114408808042126,
"repo_name": "strinking/statbot",
"id": "280308ff5b41d8b8272202260178fd44fba3843e",
"size": "2... |
import logging
import threading
import time
import os
import Server
import websocket
import LightSchedule
import PCA9685
import PCA9685_dummy
import Settings
import Channel
from WeatherType import WeatherType
import json
from objdict import ObjDict
from outlet import outlet
DEBUG = True
MAIN_LOOP_TIME = 5
MAIN_LOOP_H... | {
"content_hash": "64e34f4d6a3ee217bf9ea0269d519978",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 101,
"avg_line_length": 33.38505747126437,
"alnum_prop": 0.5407126872095025,
"repo_name": "mike-gracia/whet",
"id": "79dd8375ef5b4420613c6c108daae102d4c4ea4c",
"size": "58... |
from __future__ import absolute_import, print_function
import os
import sys
import tempfile
import numpy
from numpy.testing import TestCase, dec, assert_, run_module_suite
from scipy.weave import inline_tools,ext_tools
from scipy.weave.build_tools import msvc_exists, gcc_exists
from scipy.weave.catalog import unique... | {
"content_hash": "1a64037d5f5d22563ce0dfdb6a083b57",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 77,
"avg_line_length": 28.107142857142858,
"alnum_prop": 0.5519695044472681,
"repo_name": "RobertABT/heightmap",
"id": "2c19ce4f420cb886823caff0532e6014f7aba8a3",
"size": ... |
from .elastic_first_recommender import (
article_recommendations_for_user,
article_search_for_user
)
| {
"content_hash": "c0a89bbad7799d7199bf01fae6841e4a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 40,
"avg_line_length": 27.25,
"alnum_prop": 0.7522935779816514,
"repo_name": "mircealungu/Zeeguu-Core",
"id": "58e76dd9c449932674b14144731d75e96f02babf",
"size": "109",
"b... |
from setuptools import setup
setup(
name='ChannelWorm',
version='0.1',
packages=[
'channelworm',
'channelworm.ion_channel',
'channelworm.digitizer',
'channelworm.account',
'channelworm.web_app',
'channelworm.fitter',
'channelworm.predictor'
],
... | {
"content_hash": "ea048f0c12ec6e5912bba221513e6288",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 46,
"avg_line_length": 22.2,
"alnum_prop": 0.5477477477477477,
"repo_name": "openworm/ChannelWorm",
"id": "624a8dcbf18fb23745f924d767c4e52d8b72f44e",
"size": "555",
"bina... |
"""
Report connected FTDI devices. This may be useful in obtaining
serial numbers to use as the device_id parameter of the Device()
constructor to communicate with a specific device when more than
one is present.
example usage:
$ python pylibftdi/examples/list_devices.py
FTDI:UB232R:FTAS1UN5
FTDI:UM232R U... | {
"content_hash": "3b1c0dde3ad2bd4b71c91b0305a78d51",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 64,
"avg_line_length": 29.11627906976744,
"alnum_prop": 0.6821086261980831,
"repo_name": "claudyus/pylibftdi",
"id": "7fbd9ce518ca995c0a0fcb0fe744966a70f0883e",
"size": "12... |
"""
django_geopostcodes.managers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Django model managers for django-geopostcodes.
"""
from __future__ import absolute_import, print_function, unicode_literals
from django.db.models import QuerySet
from django.db.models.manager import Manager
from django.contrib.gis.db import mod... | {
"content_hash": "2ccf4e7903d3b08ffb7399e176cdf092",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 92,
"avg_line_length": 34.12307692307692,
"alnum_prop": 0.6681695220919748,
"repo_name": "alexhayes/django-geopostcodes",
"id": "a0e0ad416c334b9107dbcad7f3984b03250da299",
... |
import re
import json
from os import listdir
class WD:
def __init__(self):
self.method = []
self.parse()
self.writeOutput()
def parse(self):
self.method = [ WDMethod(f) for f in listdir('.') if re.match('^[a-zA-Z_].*\.json$', f) ]
def writeOutput(self):
wavedromSVH... | {
"content_hash": "72f1bc97871549db2cdbd471c9f2f856",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 114,
"avg_line_length": 29.900584795321638,
"alnum_prop": 0.4971640915313906,
"repo_name": "nosnhojn/svunit-code",
"id": "3d2a444a2de55e55c80f9200e0c8ae4772fed81d",
"size"... |
"""
Presubmit script for the printing backend.
See https://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API.
"""
USE_PYTHON3 = True
def _CheckForStringViewFromNullableIppApi(input_api, output_api):
"""
Looks for all affected lines in CL where one construct... | {
"content_hash": "4e2d3ee55416eff369aa2c3b6a90c57d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 38.395833333333336,
"alnum_prop": 0.7037438958220293,
"repo_name": "ric2b/Vivaldi-browser",
"id": "4ef6bceedf30a869c3ea715ebdf95b0da599d0ce",
"size":... |
from django.template.loaders import app_directories, filesystem
from django.template.base import TemplateDoesNotExist
from django.template.loader import make_origin
from django.conf import settings
from rhinocloud.template.openoffice import OpenOfficeTemplate
import zipfile
def read_openoffice(filepath):
files =... | {
"content_hash": "b4f1b30fc1aeeb514054d3c60ca85779",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 117,
"avg_line_length": 41.21666666666667,
"alnum_prop": 0.63040841083704,
"repo_name": "allanlei/rhinocloud-utils",
"id": "2a29aca4f35ce7f21b99707089983ef3939fb2df",
"size... |
from __future__ import print_function, division, absolute_import
import os
import sys
from nose.tools import raises
from cutadapt.scripts import cutadapt
from .utils import run, files_equal, datapath, cutpath, redirect_stderr, temporary_path
def test_example():
run('-N -b ADAPTER', 'example.fa', 'example.fa')
def ... | {
"content_hash": "a547280209226b70f87910a1aca0c79d",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 148,
"avg_line_length": 33.45014245014245,
"alnum_prop": 0.6816284813900009,
"repo_name": "Chris7/cutadapt",
"id": "34b3c1ab7af3ec9515ccdf8f3d771b1c53ccdee9",
"size": "118... |
import copy
import datetime
from django.contrib.auth.models import User
from django.db import models
from django.db.models.query import Q
from django.utils.datastructures import SortedDict
class RevisionableModel(models.Model):
base = models.ForeignKey('self', null=True)
title = models.CharField(blank=True, ... | {
"content_hash": "4a219004a6b365b59b8c85094b805241",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 176,
"avg_line_length": 39.88135593220339,
"alnum_prop": 0.6784955376115597,
"repo_name": "weigj/django-multidb",
"id": "680917b8ae5c11668642d1970fe7169a05d3e192",
"size":... |
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data without restriction,
# including without limitatio... | {
"content_hash": "f267909eabd6e5b1dd6e2f7aef4d8f18",
"timestamp": "",
"source": "github",
"line_count": 1263,
"max_line_length": 357,
"avg_line_length": 48.53206650831354,
"alnum_prop": 0.49946162881754114,
"repo_name": "pombredanne/metamorphosys-desktop",
"id": "0c79c0463384039ac56edbfe6289f6fa83824... |
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the License, o... | {
"content_hash": "3cf9e5a232cf366f29a9975f21dfd8f6",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 110,
"avg_line_length": 35.39325842696629,
"alnum_prop": 0.6421587301587302,
"repo_name": "hivesolutions/netius",
"id": "887c58341bf97017b891e1e97852c15cc833d41e",
"size":... |
"""Unit tests for modules/questionnaire."""
__author__ = [
'johncox@google.com (John Cox)',
]
from tests.unit import javascript_tests
class JavaScriptTests(javascript_tests.TestBase):
def test_scripts(self):
self.karma_test('modules/questionnaire/javascript_tests')
| {
"content_hash": "52cd9e747fe909bf12b5dc0f0a01b056",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 65,
"avg_line_length": 20.571428571428573,
"alnum_prop": 0.7083333333333334,
"repo_name": "ram8647/gcb-mobilecsp",
"id": "a1d396f579ecf9c9e20ba70ece18428e1a7f138c",
"size":... |
import tinctest
from mpp.gpdb.tests.storage.lib.sql_isolation_testcase import SQLIsolationTestCase
from gppylib.commands.base import Command
from resource_management.runaway_query.runaway_udf import *
from mpp.lib.PSQL import PSQL
def _set_VLIM_SLIM_REDZONEPERCENT(vlimMB, slimMB, activationPercent):
# Set up GUC... | {
"content_hash": "14def84501a07fb6149814a57fd3cd4f",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 213,
"avg_line_length": 51.642105263157895,
"alnum_prop": 0.6718304117407257,
"repo_name": "kaknikhil/gpdb",
"id": "36961f81f271b4e974c08736f4deebc7d465eb27",
"size": "4906... |
from play import Play
from behavior import Behavior
import plays.stopped
import plays.testing.test_coach
import logging
from PyQt5 import QtCore
import main
import evaluation.double_touch
import tactics.positions.goalie
import role_assignment
import traceback
## The RootPlay is basically the python-side of the c++ Ga... | {
"content_hash": "ccf6db3378db6d44c3afd764da807224",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 115,
"avg_line_length": 41.66079295154185,
"alnum_prop": 0.5308237284551126,
"repo_name": "JNeiger/robocup-software",
"id": "5886ab43dd5976d8bb073ef0b3fd859df55af229",
"si... |
'''
Created on 15 Aug 2011
@author: kfuchsbe
'''
class JPyMadGlobals():
java_gateway = None
jmad_service = None
enums = None
| {
"content_hash": "68fc76b17e382b4d06efe0277783ec34",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 23,
"avg_line_length": 15.333333333333334,
"alnum_prop": 0.644927536231884,
"repo_name": "pymad/jpymad",
"id": "38c33def25f377b72067cab7438b65b376ac6d66",
"size": "924",
"... |
"""OS X Launchd process listing test data.
These dicts are python representations of the pyobjc NSCFDictionarys returned by
the ServiceManagement framework. It's close enough to the pyobjc object that we
can use it to test the parsing code without needing to run on OS X.
"""
# Disable some lint warnings to avoid te... | {
"content_hash": "b616f0f588805bbcba3bae39b2cebf44",
"timestamp": "",
"source": "github",
"line_count": 2984,
"max_line_length": 193,
"avg_line_length": 31.373994638069703,
"alnum_prop": 0.5263939329203162,
"repo_name": "google/grr",
"id": "56dceb7f91efbbcaf8a331dd32e8cb0d59fa97de",
"size": "93642"... |
"""Mean shift clustering algorithm.
Mean shift clustering aims to discover *blobs* in a smooth density of
samples. It is a centroid based algorithm, which works by updating candidates
for centroids to be the mean of the points within a given region. These
candidates are then filtered in a post-processing stage to elim... | {
"content_hash": "76baa0c20114779ee35da93df5e57db7",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 88,
"avg_line_length": 35.16367265469062,
"alnum_prop": 0.6329681557586422,
"repo_name": "huzq/scikit-learn",
"id": "e8ece2034d0f0ca5b3c4432aa3c984f7fb038b59",
"size": "17... |
from django.conf.urls import patterns
from django.conf.urls import url
from openstack_dashboard.dashboards.admin.images.images import views
VIEWS_MOD = 'openstack_dashboard.dashboards.admin.images.images.views'
urlpatterns = patterns(VIEWS_MOD,
url(r'^create/$', views.CreateView.as_view(), name='create'),
... | {
"content_hash": "49b3e0b99b893e253d677bb71b348c4b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 96,
"avg_line_length": 40.22222222222222,
"alnum_prop": 0.669889502762431,
"repo_name": "xuweiliang/Codelibrary",
"id": "9832a87df0fd879e2c7c03cc6089ba6378fd2ac9",
"size": ... |
from operator import itemgetter
from typing import Optional, cast
from libsyntyche.widgets import HBoxLayout, Label, Stretch, mk_signal1
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtCore import Qt
from ..common import Settings
class TagInfoList(QtWidgets.QScrollArea):
error = mk_signal1(str)
print_ = mk_... | {
"content_hash": "6d7d534ac8cdd92c74cb724a732dc562",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 41.83653846153846,
"alnum_prop": 0.601241094001379,
"repo_name": "nycz/sapfo",
"id": "c52f6513fdb914611be851b1bfe07db2c811d99e",
"size": "4351",
"... |
from mail_utils.messages import (TemplateMixin, EnvelopeMixin, ImagesMixin,
TemplateMessageMixin, EnvelopedMessageMixin)
| {
"content_hash": "4490e161b2c0d61ba426ce5e09696d56",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 75,
"avg_line_length": 62.5,
"alnum_prop": 0.84,
"repo_name": "koorgoo/django-mail-utils",
"id": "0217dc2e3bc75679521df24d8f6a73d824627d94",
"size": "125",
"binary": false... |
from settings import * # noqa
INSTALLED_APPS += (
'debug_toolbar',
)
DEBUG_TOOLBAR_PATCH_SETTINGS = False # Prevent DDT from patching the settings.
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
def debug_toolbar_enabled(request):
"""Callback used by the Django Debug Toolbar to... | {
"content_hash": "c6eff8e9d730737c7b7e92e0c16d6ec7",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 79,
"avg_line_length": 32,
"alnum_prop": 0.7165178571428571,
"repo_name": "andymckay/addons-server",
"id": "bab9dac761495f9bc3c91c60f2676683f933673d",
"size": "1035",
"bi... |
from __future__ import print_function
import os.path
import platform
import shutil
import sys
try:
from setuptools import setup
except ImportError as e:
from distutils.core import setup
if sys.version_info[0] < 3:
sys.exit('Sorry, Python < 3 is not supported')
# Set to False to disable compiling cython ... | {
"content_hash": "3c8d44d8c01dd18f65e79740f492edb9",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 115,
"avg_line_length": 35.017857142857146,
"alnum_prop": 0.6228964813870475,
"repo_name": "sambayless/monosat",
"id": "acadea8799dd008018e51023401adafa9d775f87",
"size": ... |
from __future__ import absolute_import, division, print_function, \
with_statement
import socket
import logging
import struct
import errno
import random
from shadowsocks import encrypt, eventloop, lru_cache, common, shell
from shadowsocks.common import parse_header, pack_addr
BUF_SIZE = 65536
def client_key(s... | {
"content_hash": "13c34df7717204025571c53a4237885f",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 79,
"avg_line_length": 36.72566371681416,
"alnum_prop": 0.5390361445783133,
"repo_name": "lucienevans/shadowsocks",
"id": "b67770acca1ffe805f6f4ea84f36b45dbbc43a4f",
"size... |
from globus_sdk.tokenstorage.base import FileAdapter, StorageAdapter
from globus_sdk.tokenstorage.file_adapters import SimpleJSONFileAdapter
from globus_sdk.tokenstorage.sqlite_adapter import SQLiteAdapter
__all__ = ("SimpleJSONFileAdapter", "SQLiteAdapter", "StorageAdapter", "FileAdapter")
| {
"content_hash": "96595381d544604b5de2f2176914a4d0",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 85,
"avg_line_length": 58.6,
"alnum_prop": 0.8293515358361775,
"repo_name": "globus/globus-sdk-python",
"id": "9ed982da9b3f09e263dbfadf3c62c39081aec146",
"size": "293",
"b... |
from multiprocessing import Process
import unittest
import numpy as np
import os
from bigdl.ppml.fl import *
from bigdl.ppml.fl.estimator import Estimator
from bigdl.ppml.fl.nn.fl_server import FLServer
from bigdl.ppml.fl.nn.tensorflow.utils import set_one_like_parameter
from bigdl.ppml.fl.nn.fl_context import init_fl... | {
"content_hash": "d0f2cbc3f3722e94dde8523f8ff24853",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 90,
"avg_line_length": 39.1474358974359,
"alnum_prop": 0.5950548550843294,
"repo_name": "yangw1234/BigDL",
"id": "df9f531e19f593f44085f42441756450f1b1b260",
"size": "6694"... |
import asyncio
import os
import sys
if not sys.version >= '3.6':
print('This script requires Python 3.6+')
sys.exit()
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt.async_support as ccxt # noqa: E402
async def poll():
e... | {
"content_hash": "40ceeb2ce067212c2c9d5c6a6ee45b9c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 83,
"avg_line_length": 22.555555555555557,
"alnum_prop": 0.6617405582922824,
"repo_name": "ccxt/ccxt",
"id": "efce406fd5829fd2e0d5971f3bee15d78cceabc3",
"size": "634",
"b... |
"""Progress bars module"""
import time
import datetime
import sys
from qiskit.tools.events.pubsub import Subscriber
class BaseProgressBar(Subscriber):
"""An abstract progress bar with some shared functionality."""
def __init__(self):
super().__init__()
self.type = "progressbar"
self.... | {
"content_hash": "12a04a24326e3c0125fa7d0d031475d6",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 98,
"avg_line_length": 30.81451612903226,
"alnum_prop": 0.5710546977231091,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "dba2ffdd84cf33ff451da162ad15e37345648795",
"size": ... |
from datetime import date
from dateutil.rrule import MONTHLY, rrule
from juriscraper.AbstractSite import logger
from juriscraper.lib.html_utils import get_html5_parsed_text
from juriscraper.lib.string_utils import convert_date_string
from juriscraper.OpinionSite import OpinionSite
class Site(OpinionSite):
def _... | {
"content_hash": "5e12c55a970f27ce9c10ba58fdbbe424",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 78,
"avg_line_length": 33.255102040816325,
"alnum_prop": 0.5556919300398895,
"repo_name": "freelawproject/juriscraper",
"id": "7fd38c8a784bdf2db403365384d154011841911d",
"s... |
import tensorflow as tf
from hanlp.components.tokenizers.tok import NgramConvTokenizer
from hanlp.datasets.tokenization.sighan2005.msr import SIGHAN2005_MSR_TRAIN, SIGHAN2005_MSR_VALID, SIGHAN2005_MSR_TEST
from hanlp.pretrained.word2vec import CONVSEG_W2V_NEWS_TENSITE_CHAR, CONVSEG_W2V_NEWS_TENSITE_WORD_MSR
from tests... | {
"content_hash": "092a3788a17d72660ffaa0f115828ab9",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 118,
"avg_line_length": 46.388888888888886,
"alnum_prop": 0.5293413173652695,
"repo_name": "hankcs/HanLP",
"id": "ed319995a6491de435d1058c902dd3b15633a541",
"size": "1775",... |
from frasco import Feature, action, flash, url_for, hook, lazy_translate
from frasco_users import current_user
from .blueprint import create_blueprint
class TwitterFeature(Feature):
name = "twitter"
requires = ["users"]
blueprints = [create_blueprint]
defaults = {"use_screenname_as_username": False,
... | {
"content_hash": "9e387fb74f9130c187466c14a0653e90",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 94,
"avg_line_length": 44.24324324324324,
"alnum_prop": 0.6499694563225412,
"repo_name": "frascoweb/frasco-twitter",
"id": "547b2d7a5d6b108d7289d6fd6e7494e4d29df855",
"size... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('plea', '0039_auto_20180522_1341'),
]
operations = [
migrations.AlterField(
model_name='courtemailcount',
name='total_guilty_... | {
"content_hash": "f9ee3e3d1d39975572361e7fd228c7ad",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 80,
"avg_line_length": 31.484848484848484,
"alnum_prop": 0.5967276227141483,
"repo_name": "ministryofjustice/manchester_traffic_offences_pleas",
"id": "4a3da0f40f55744fb131ea... |
from django.conf.urls import *
urlpatterns = [
#url(r'', include('apps.api.v2.urls', namespace='default')),
url(r'^v1/', include('apps.api.v1.urls', namespace='v1')),
]
| {
"content_hash": "5849a2aa71302b66b432fd6259043c13",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 64,
"avg_line_length": 29.666666666666668,
"alnum_prop": 0.6292134831460674,
"repo_name": "MySmile/sfchat",
"id": "6aadf5e5cb51c3aea807781d73145b6b2f70adf2",
"size": "178",
... |
# -*- coding: utf-8 -*-
"""
A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__... | {
"content_hash": "eb7f2f1ef0c052878ee47e559c9b0c20",
"timestamp": "",
"source": "github",
"line_count": 837,
"max_line_length": 109,
"avg_line_length": 29.675029868578257,
"alnum_prop": 0.5354295837023915,
"repo_name": "LukeMurphey/splunk-network-tools",
"id": "f747ebd8ee74f27d0ef19098424892a4ca849c3... |
"""Pens for creating UFO glyphs."""
from robofab.objects.objectsBase import MOVE, LINE, CORNER, CURVE, QCURVE, OFFCURVE
from robofab.objects.objectsRF import RContour, RSegment, RPoint
from robofab.pens.pointPen import BasePointToSegmentPen
from robofab.pens.adapterPens import SegmentToPointPen
class RFUFOPen(Segmen... | {
"content_hash": "3c876329d60fbe021168becc22d12bf5",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 91,
"avg_line_length": 32.029126213592235,
"alnum_prop": 0.6938466201879357,
"repo_name": "jamesgk/robofab",
"id": "265d7aea027f0ec0bea6c4f638f1648d51a59620",
"size": "329... |
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('biobee.sitetheme')
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
| {
"content_hash": "106db11e70ce28cf4853b7a37913d43c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 59,
"avg_line_length": 21.77777777777778,
"alnum_prop": 0.7244897959183674,
"repo_name": "a25kk/biobee",
"id": "399b48f69a957abb33fc77689839ede3ae733372",
"size": "220",
"... |
"""Config flow for konnected.io integration."""
import asyncio
import copy
import logging
import random
import string
from urllib.parse import urlparse
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASSES_SCHEM... | {
"content_hash": "914c8bf95b1236ef972b1cbb82daa620",
"timestamp": "",
"source": "github",
"line_count": 824,
"max_line_length": 99,
"avg_line_length": 40.19660194174757,
"alnum_prop": 0.49118410723990097,
"repo_name": "pschmitt/home-assistant",
"id": "f545c5f2f2a26de7da10deddcda7288d831fa20a",
"siz... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'demo.views.index', name='index'),
url(r'^all_events/', 'demo.views.all_events', name='all_events'),
url(r'^admin/', include(admin.site.urls)),
)
| {
"content_hash": "036c9d115bf2edf38ca5a79a622cdad2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 29.09090909090909,
"alnum_prop": 0.66875,
"repo_name": "rodrigoamaral/django-fullcalendar",
"id": "512082b787daa3e4fcabf204381640c2e31b73e2",
"size":... |
"""
APE - a productive environment
"""
from __future__ import print_function
# Tasks specified here are available globally.
#
# WARNING: importing ape.tasks at the module level leads to a cyclic import for
# global tasks in this file, so import it inside the task function.
# The effect is specific to this file - y... | {
"content_hash": "7bf78010dc1e3981c4889c34d91549b6",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 109,
"avg_line_length": 30.394736842105264,
"alnum_prop": 0.6138528138528139,
"repo_name": "henzk/ape",
"id": "42f84c378f4fbfdb40f27677294732afbf7a5afb",
"size": "3465",
... |
"""Tests for prompt generation."""
import unittest
import os
from IPython.testing import tools as tt, decorators as dec
from IPython.core.prompts import PromptManager, LazyEvaluate
from IPython.testing.globalipapp import get_ipython
from IPython.utils.tempdir import TemporaryDirectory
from IPython.utils import py3co... | {
"content_hash": "6760b7a8b2eb1da684ce67650b97b1b2",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 86,
"avg_line_length": 32.027027027027025,
"alnum_prop": 0.5727144866385373,
"repo_name": "WillisXChen/django-oscar",
"id": "7226af1209b16b041496ba57b42f67fed5bf8c05",
"si... |
import csv #! Comma-Separated Values - tabular data in plain text.
import os #! Miscellaneous operating system interfaces.
import sys #! System-specific parameters and functions.
from time import sleep #! Sleep - for command-line animation.
#! Function for printing slowly (... | {
"content_hash": "922e39984a4582c9581dde8bd884f5b5",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 80,
"avg_line_length": 30.23611111111111,
"alnum_prop": 0.6067983463481855,
"repo_name": "eliheuer/FarmigoDataTools",
"id": "8f8002dfb5bb00290639b16e747b2218f697e94d",
"siz... |
from __future__ import absolute_import
from sentry.models import GroupStatus
from sentry.testutils import TestCase
from sentry.search.utils import parse_query
class ParseQueryTest(TestCase):
def test_simple(self):
result = parse_query('foo bar', self.user)
assert result == {'tags': {}, 'query': '... | {
"content_hash": "6fa35040890db6faefaa88bdd820b986",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 82,
"avg_line_length": 39.763636363636365,
"alnum_prop": 0.5925925925925926,
"repo_name": "argonemyth/sentry",
"id": "055cd2a9e9a0c0aae8b5abe70ebbdaf57031501e",
"size": "21... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import schema
from caffe2.python.layers.layers import (
ModelLayer,
)
from caffe2.python.layers.tags import (
Tags
)
import numpy as np
class... | {
"content_hash": "d0fa0cd363f0b81e908d8c6b50daf120",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 28.746031746031747,
"alnum_prop": 0.5681943677526229,
"repo_name": "pietern/caffe2",
"id": "85b1802b5c5c9420683a96da68e38ae09e8edfb1",
"size": "2554"... |
"""Admin application."""
import importlib
import pkgutil
from flask_admin import Admin
from flask_admin.base import AdminIndexView, MenuLink
from flask.ext.admin.contrib.sqla import ModelView
from flask_login import current_user
from raven.contrib.flask import Sentry
from pygotham import factory, filters
__all__ = ... | {
"content_hash": "d06dd5743f03e004faff73d1da836f48",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 72,
"avg_line_length": 31.88135593220339,
"alnum_prop": 0.6608187134502924,
"repo_name": "PyGotham/pygotham",
"id": "7d218855d9b739bbb8f997829c79400842f03488",
"size": "188... |
from ..Qt import QtGui, QtCore, QT_LIB
import matplotlib
if QT_LIB != 'PyQt5':
if QT_LIB == 'PySide':
matplotlib.rcParams['backend.qt4']='PySide'
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
try:
from matplotlib.backends.backend_qt4agg import NavigationT... | {
"content_hash": "dbb3137f577b1af2ad99435ee6acb9ff",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 99,
"avg_line_length": 32.10204081632653,
"alnum_prop": 0.6713286713286714,
"repo_name": "meganbkratz/acq4",
"id": "c5b6c980188d92cf52baec1c331caf9bcb699f94",
"size": "1573... |
import roslib
roslib.load_manifest('faa_image_processing')
import sys
import rospy
import cv
import cv2
import numpy
import os
import copy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
from faa_utilities import FileTools
from faa_actuation.msg import ActuationState
from faa_image_pr... | {
"content_hash": "4f4ec7830a8db37f44313b22aa66a765",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 127,
"avg_line_length": 38.57258064516129,
"alnum_prop": 0.681685134852603,
"repo_name": "JaneliaSciComp/fly-alcohol-assay",
"id": "923854e8f14afd06ec0b2e25537b372fb31fbea2"... |
"""
Component to wake up devices sending Wake-On-LAN magic packets.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wake_on_lan/
"""
from functools import partial
import logging
import voluptuous as vol
from homeassistant.const import CONF_MAC
import h... | {
"content_hash": "1e8947618d9ee4a1ef0a9f35a00ba139",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 75,
"avg_line_length": 30.660377358490567,
"alnum_prop": 0.6750769230769231,
"repo_name": "PetePriority/home-assistant",
"id": "dba99bf7e3d4e693f10cc6556e2592c1083515f0",
"... |
"""Interface Package Interfaces
$Id: interfaces.py 67803 2006-05-01 15:20:47Z jim $
"""
__docformat__ = 'restructuredtext'
from zope.interface import Interface
from zope.interface.interface import Attribute
class IElement(Interface):
"""Objects that have basic documentation and tagged values.
"""
__nam... | {
"content_hash": "9e2ef0a64a1e83629c0de9b2122587cd",
"timestamp": "",
"source": "github",
"line_count": 717,
"max_line_length": 79,
"avg_line_length": 32.62900976290098,
"alnum_prop": 0.6626202179952981,
"repo_name": "GetSomeBlocks/ServerStatus",
"id": "6deac8cb60dc7c95bd9e0a46844612f32a42394b",
"s... |
import imp
import os
import sys
import shutil
import six
from migrate import exceptions
from migrate.versioning import version, repository
from migrate.versioning.script import *
from migrate.versioning.util import *
from migrate.tests import fixture
from migrate.tests.fixture.models import tmp_sql_table
class Test... | {
"content_hash": "93af135241f6e0920ede3777973122b5",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 92,
"avg_line_length": 34.43150684931507,
"alnum_prop": 0.611597374179431,
"repo_name": "watspidererik/testenv",
"id": "954bc0d881050a87fbe93fdd6ae4fb5fe22b9c6a",
"size": ... |
"""
concerts/management/commands/make_matches.py
Uses the Artist.re_string to search for the artist in the
concert lineup (Concert.billing). If a match is found, saves a
ConcertMatch object for lookup later.
"""
import re
import logging
from django.core.management.base import BaseCommand, CommandError
from concerts... | {
"content_hash": "ac21bcbfedb785f26581432ca782cc75",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 97,
"avg_line_length": 37.62068965517241,
"alnum_prop": 0.5962419798350137,
"repo_name": "jravesloot/sift_app",
"id": "9c0d594dd09f1ecf18142dba396a8e69a1f33b84",
"size": "2... |
"""Tracing Protocol for tf.function.
TODO(b/202447704): Briefly describe the tracing, retracing, and how trace types
control it.
"""
from tensorflow.core.function.trace_type.signature_builder import make_function_signature
from tensorflow.core.function.trace_type.signature_builder import SignatureContext
from tensor... | {
"content_hash": "137379a2103d6d891fa43f584dce466f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 89,
"avg_line_length": 36.36363636363637,
"alnum_prop": 0.83,
"repo_name": "Intel-Corporation/tensorflow",
"id": "1e354166515627b8b69d0a759e2bc4a310b4d49b",
"size": "1089",... |
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, PasswordField, TextAreaField
from wtforms.validators import DataRequired, Length, Email, ValidationError
from app.models import User, Post, Page
from app import bcrypt
from unidecode import unidecode
from sqlalchemy import func
import re
cl... | {
"content_hash": "789b631393c62b2045fda8cb778dee52",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 112,
"avg_line_length": 44.18181818181818,
"alnum_prop": 0.5940329218106996,
"repo_name": "jaymickey/jmickey-blog",
"id": "9deba68cf1e6a0026834d83ed312c347f34be8a4",
"size... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Species mapper.
"""
from sqlalchemy.orm import relationship
from everest.repositories.rdb.utils import as_slug_expression
from everest.repositories.rdb.util... | {
"content_hash": "d250e0f005af3c25ead1f27f777fb5c5",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 80,
"avg_line_length": 31.24137931034483,
"alnum_prop": 0.6434878587196468,
"repo_name": "helixyte/TheLMA",
"id": "ee5f901ee342e6d933c9d2ec0a8fa27889013b44",
"size": "906",... |
from __future__ import annotations
from poetry.core.constraints.version import constraint_regions
__all__ = ["constraint_regions"]
| {
"content_hash": "dac694a94df34f90142a01c1f4696a80",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 62,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.7611940298507462,
"repo_name": "python-poetry/poetry-core",
"id": "eabcc06b08b4735b921c04e1795f584964f7b5b1",
"siz... |
import sys, os
import mysql.connector
"""
Example using MySQL Connector/Python showing:
* sending multiple statements and iterating over the results
"""
def main(config):
output = []
db = mysql.connector.Connect(**config)
cursor = db.cursor()
# Drop table if exists, and create it new
stmt_... | {
"content_hash": "be9512200c66da8f2ba5e1b87bdf5c46",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 70,
"avg_line_length": 27.348484848484848,
"alnum_prop": 0.5634349030470914,
"repo_name": "rcosnita/fantastico",
"id": "82e3c2776bac2847801abb289d8f00f65da6cea4",
"size": "... |
"""Testing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=g-bad-import-order
from tensorflow.python.framework import test_util as _test_util
from tensorflow.python.platform import googletest as _googletest
# pylint: disable=unused-i... | {
"content_hash": "6353f5b406c54e021f347dd150c221ce",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 85,
"avg_line_length": 30.698863636363637,
"alnum_prop": 0.6947991856376088,
"repo_name": "petewarden/tensorflow",
"id": "ca48f71b2bbec41f129244890ee732d757099289",
"size"... |
from openerp.osv import fields, osv
class account_move_line_unreconcile_select(osv.osv_memory):
_name = "account.move.line.unreconcile.select"
_description = "Unreconciliation"
_columns ={
'account_id': fields.many2one('account.account','Account',required=True),
}
def action_open_window(self... | {
"content_hash": "f03067d5a6f0ed365143d862eda6435e",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 124,
"avg_line_length": 40.22727272727273,
"alnum_prop": 0.5649717514124294,
"repo_name": "cristianquaglio/odoo",
"id": "31fbeddeea8d74fe71e153fac7e5da6cbe1de022",
"size": ... |
from south.utils import datetime_utils as 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 'Post'
db.create_table('blog_post', (
('id', self.gf('django.db.models... | {
"content_hash": "3f9394be2413bd806ee328059d60c406",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 111,
"avg_line_length": 47,
"alnum_prop": 0.5833745670460169,
"repo_name": "dangerdak/apuniverse",
"id": "bcd70ef1874d58e050acbea82f3d55b24a7a02b8",
"size": "2045",
"bina... |
from django.conf import settings
from django.shortcuts import redirect
from login import auth
class User_Data(object):
def __init__(self):
self.username = ""
self.email = ""
self.default_shipping_address = ""
self.phone_number = ""
self.tw_id = ""
self.real_name = "... | {
"content_hash": "a9aee8f9063d2de3e52c8998dfdde841",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 105,
"avg_line_length": 28.821428571428573,
"alnum_prop": 0.5656753407682775,
"repo_name": "sonicyang/chiphub",
"id": "13ed9b0f21120c0cc8e6b51865901611b5fe6be2",
"size": "1... |
from setuptools import setup
from djangocms_googlemap import __version__
CLASSIFIERS = [
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS I... | {
"content_hash": "34cd55438ddd2a04b823af842d6aa1ee",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 112,
"avg_line_length": 35.06060606060606,
"alnum_prop": 0.6698357821953328,
"repo_name": "mkost/djangocms-googlemap",
"id": "08b3881e0a96b5a354140496002fa0d1b672ae75",
"si... |
import pytest
import torch
from allennlp.common import Params
from allennlp.common.checks import ConfigurationError
from allennlp.data import Vocabulary
from allennlp.modules.text_field_embedders import BasicTextFieldEmbedder
from allennlp.common.testing import AllenNlpTestCase
class TestBasicTextFieldEmbedder(Allen... | {
"content_hash": "6b88fedd623ef61c125912bb6377cdac",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 98,
"avg_line_length": 40.61904761904762,
"alnum_prop": 0.5004559072554383,
"repo_name": "allenai/allennlp",
"id": "7381ac6d246a9ead4833915de046999eaeffae48",
"size": "767... |
import re
import ConfigParser
from devstack import cfg_helpers
from devstack import date
from devstack import env
from devstack import exceptions as excp
from devstack import log as logging
from devstack import settings
from devstack import shell as sh
from devstack import utils
LOG = logging.getLogger("devstack.cfg"... | {
"content_hash": "fc82c94beca4119da48b525da551d89a",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 118,
"avg_line_length": 38.59602649006622,
"alnum_prop": 0.6257721345229924,
"repo_name": "hagleitn/Openstack-Devstack2",
"id": "f7f4e1be58924666f53cea549c8bf28f7173b9f3",
... |
from video_scripts.video_processor import *
step = parse_line('# just a comment')
print('1:', step)
step = parse_line('file path/to/file.avi')
print('2:', step)
if isinstance(step, FileSpec):
print(step.path, step.start, step.end)
step = parse_line('file path/to/file.avi -s 20 -e 44.5')
print('3:', step)
if isi... | {
"content_hash": "f36420c6de7ffdf7bdb961cd9f1b4fab",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 105,
"avg_line_length": 25.897435897435898,
"alnum_prop": 0.6801980198019802,
"repo_name": "patczar/video-scripts",
"id": "407227a15e159fe98eb1f45392a0d1b67087bae4",
"size"... |
import circuits
import rexviewer as r
import naali
import urllib2 #for js_src downloading
"""
first EC handlers were not 'Naali modules' (circuits components),
but apparently they typically need to get Naali events to handle logout etc.
so am making now so that they are registered to the circuits manager automagically... | {
"content_hash": "5d6405920d59bcc81c2e89809746f712",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 159,
"avg_line_length": 32.81818181818182,
"alnum_prop": 0.6421052631578947,
"repo_name": "antont/tundra",
"id": "520193691f3e1a5a2fe70add879b1a7489406577",
"size": "3610"... |
import warnings
import os
########################################################################
# Note: imports must be limited to the maximum here, and under no circumstances
# import a package that creates a background thread at import time. Failure to
# comply will prevent lisa._unshare._do_unshare() to work cor... | {
"content_hash": "d62355529b071c5a797e3a84e5da7bfd",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 35.58064516129032,
"alnum_prop": 0.6473254759746147,
"repo_name": "credp/lisa",
"id": "05c02b5e2d1c68d81aed04abdc13c3257b4a0fdd",
"size": "1128",
"... |
"""
The MIT License (MIT)
Copyright (c) 2015-2019 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, ... | {
"content_hash": "917106bec7317ad5ce8b543e8b5fd9dc",
"timestamp": "",
"source": "github",
"line_count": 1543,
"max_line_length": 122,
"avg_line_length": 34.78483473752431,
"alnum_prop": 0.588508188474652,
"repo_name": "gnmiller/craig-bot",
"id": "3dd28533e1e2a3f35c19104ec49aead65811a7f5",
"size": "... |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['kobuki_noros'],
package_dir={'': 'src'},
)
setup(**setup_args) | {
"content_hash": "862656ce313e6185ddf02a7cabe60129",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 24.8,
"alnum_prop": 0.7338709677419355,
"repo_name": "git-afsantos/kobukium",
"id": "76e9ccfaca39577394f2145cddf9608ed8c8646c",
"size": "311",
"bin... |
"""
Created on Tir 29 Oct 2013.
Uses the Crank Nicolson scheme to solve the time dependent Schrodinger equation
for a center potential spike (delta potential).
Animation is done using the matplotlib.pyplot library.
Usage:
python CrankNicolsonPotentialSpike.py
or equivalent:
./CrankNicolsonPotentialSpike.py
N... | {
"content_hash": "edaec43ecb40c627d664c29ad898f951",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 91,
"avg_line_length": 28.097902097902097,
"alnum_prop": 0.6070184171229467,
"repo_name": "ahye/FYS2140-Resources",
"id": "cd5ef667fd1fb64aede0e8018d637b1c3916286b",
"size... |
try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url
from django.views.generic import TemplateView
from django.core.urlresolvers import reverse
from hyperadmin.apirequests import InternalAPIRequest
import logging
class Client(object):
de... | {
"content_hash": "0744db897278330d7ccf7e580691baa1",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 104,
"avg_line_length": 29.785714285714285,
"alnum_prop": 0.6345323741007194,
"repo_name": "webcube/django-hyperadmin",
"id": "66163af54b1896927aec80322b30839ed6597b2d",
"s... |
"""
One of the most controversial issues in the US educational system is the efficacy of standardized
tests, and whether they are unfair to certain groups. Given our prior knowledge about this topic,
investigating the correlations between SAT scores and demographic factors might be an interesting
angle to take. We coul... | {
"content_hash": "4e6c7398a3138831cb7cb58f584aecef",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 150,
"avg_line_length": 43.225641025641025,
"alnum_prop": 0.7295052793925733,
"repo_name": "tleonhardt/CodingPlayground",
"id": "04311252a6f9b0efcbb1f363596c9bfe7dec5b62",
... |
"""
Class for PXE bare-metal nodes.
"""
import datetime
import os
import jinja2
from oslo.config import cfg
from nova.compute import flavors
from nova import exception
from nova.openstack.common.db import exception as db_exc
from nova.openstack.common import fileutils
from nova.openstack.common.gettextutils import _... | {
"content_hash": "7aa3f1fa42cd07135cfb7d9412e2ba45",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 79,
"avg_line_length": 39.37344398340249,
"alnum_prop": 0.5804615871008536,
"repo_name": "sacharya/nova",
"id": "8e0514167d81a4f3876a316b2f9db5e2bedc8829",
"size": "19718"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.