text stringlengths 4 1.02M | meta dict |
|---|---|
import argparse
import os
import sys
import npdocstring
if __name__ == "__main__":
parser = argparse.ArgumentParser(
prog="npdocstring",
description=(
"generate missing numpy docstrings automatically "
"in Python source files."
),
)
parser.add_argument(
... | {
"content_hash": "7dc0a3164347a0fd03fac21503a1075b",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 70,
"avg_line_length": 33.18032786885246,
"alnum_prop": 0.4925889328063241,
"repo_name": "tgy/npdocstring",
"id": "8a94d321aa40802525abac9c3858f93e4c7b5aaf",
"size": "2024"... |
"""Cudnn RNN operators."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.contrib.checkpoint.python import split_dependency
from tensorflow.contrib.rnn.python.ops import lstm_ops
from tensorflow.python.framework import dtypes
from ... | {
"content_hash": "5639760ff0fa56119768313eae0147ea",
"timestamp": "",
"source": "github",
"line_count": 1796,
"max_line_length": 103,
"avg_line_length": 40.99777282850779,
"alnum_prop": 0.6313423511516731,
"repo_name": "ageron/tensorflow",
"id": "7d848e2ec2d99cd2a78ff3e813207c0cd5bb97cf",
"size": "... |
"""
Copyright 2013 Steven Diamond
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... | {
"content_hash": "bf7c80b6989a706c67f741a3cfe6323e",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 80,
"avg_line_length": 32.350332594235034,
"alnum_prop": 0.5725839616175462,
"repo_name": "merraksh/cvxpy",
"id": "f0e999385c3fddc18a3e34eb05246504199812c0",
"size": "1459... |
from pytz import timezone
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.template import loader
from rest_framework.response import Response
from add2cal import Add2Cal
from accelerator_abstract.models.base_user_utils import is_employee
from accelerator.models import (
... | {
"content_hash": "7d02248b01484552658e37b30d67d9f3",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 79,
"avg_line_length": 38.86486486486486,
"alnum_prop": 0.5684109874826148,
"repo_name": "masschallenge/impact-api",
"id": "5564355ae1147b0b9fb8552654b9ced22488095b",
"siz... |
'''
Created on Apr 10, 2013
@author: Mark V Systems Limited
(c) Copyright 2013 Mark V Systems Limited, All rights reserved.
'''
import time
from arelle import ModelXbrl, XbrlConst, XmlValidate
from arelle.ModelObject import ModelObject
from arelle.ModelDtsObject import ModelAttribute, ModelConcept, ModelType
from arel... | {
"content_hash": "7c3d0fd70fcf463df22d578c01689dcb",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 123,
"avg_line_length": 55.3046875,
"alnum_prop": 0.559824834016104,
"repo_name": "sternshus/Arelle",
"id": "acd471436187f7c356378b18b8752731a678c599",
"size": "7079",
"... |
import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-league',
vers... | {
"content_hash": "80c9757ade5f4420af7328d1892800fa",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 37.111111111111114,
"alnum_prop": 0.6302395209580839,
"repo_name": "mgawrys1/django-league",
"id": "a92dfd4a5cc4d44f79b671ccc68a4e73c2323066",
"size"... |
from setuptools import setup, find_packages
setup(
name='pyem410x',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='1.0.0',
descripti... | {
"content_hash": "484b74c6b13f85dd0ea4d876aea28b95",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 35.3968253968254,
"alnum_prop": 0.647085201793722,
"repo_name": "yrjyrj123/pyem410x",
"id": "dc07a36e8a43703a8e216b9f34d72379fbd226f8",
"size": "2230... |
"""
lassie.api
~~~~~~~~~~
This module implements the Lassie API.
"""
from .core import Lassie
def fetch(url, **kwargs):
"""Constructs and sends a :class:`Lassie <Lassie>`
Retrieves content from the specified url, parses it, and returns
a beautifully crafted dictionary of important information about tha... | {
"content_hash": "6df3dd96cbf36c64b6fa7e6520a1ed25",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 165,
"avg_line_length": 40.707317073170735,
"alnum_prop": 0.695026962252846,
"repo_name": "michaelhelmick/lassie",
"id": "07cd2a2cc825c4b1f2535a6926bf959ebb5e208d",
"size":... |
"""ROS node for drawing boxes over tip detection results.
"""
import itertools
import cv2
import rospy
from tip_detection import image_to_array, array_to_image
# Import the ROS message type(s) we'll be using.
from sensor_msgs.msg import Image
from tip_detection_msgs.msg import Tips, Tip
class TipHighlighter(object... | {
"content_hash": "a2409df11be87583861f3a72be82b308",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 81,
"avg_line_length": 32.54032258064516,
"alnum_prop": 0.6173482032218092,
"repo_name": "sigproc/robotic_surgery",
"id": "61aa76cc5bf1ef6d6dc2a93a7ec57649ff71647c",
"size... |
from django.db.models import Lookup, Transform
class PostgresSimpleLookup(Lookup):
def as_sql(self, qn, connection):
lhs, lhs_params = self.process_lhs(qn, connection)
rhs, rhs_params = self.process_rhs(qn, connection)
params = lhs_params + rhs_params
return '%s %s %s' % (l... | {
"content_hash": "6687626e231b1283fe10ccb2f6db051a",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 61,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.6319845857418112,
"repo_name": "yephper/django",
"id": "6976d1d8f1c170a464f6d5fd5fd4c0061363140e",
"size": "1038"... |
"""Pyramid bootstrap environment. """
from alembic import context
from pyramid.paster import get_appsettings, setup_logging
from sqlalchemy import engine_from_config
from amnesia.db.meta import metadata
config = context.config
setup_logging(config.config_file_name)
settings = get_appsettings(config.config_file_name... | {
"content_hash": "ceb7cede280276b6a2411ce5e9553fec",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 64,
"avg_line_length": 25.103448275862068,
"alnum_prop": 0.7012362637362637,
"repo_name": "silenius/amnesia",
"id": "dc571bfcc912b1a5d5846c45c944478792a8ef3a",
"size": "145... |
from .method import wrap_method
from .attribute import Attribute
from .device import Device
from .pausableDevice import PausableDevice
from .runnableDevice import DState, DEvent, RunnableDevice
| {
"content_hash": "ae1378b7da54bf290eaa25a25047ccfc",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 58,
"avg_line_length": 38.8,
"alnum_prop": 0.845360824742268,
"repo_name": "ulrikpedersen/malcolm",
"id": "1f73096c1baa4d5882f4159c5a66eb60c9b8c49a",
"size": "194",
"binar... |
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.jo... | {
"content_hash": "0a17e904df2b2f3ff86d1f4de8a64dc6",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 102,
"avg_line_length": 43.6551724137931,
"alnum_prop": 0.717219589257504,
"repo_name": "iglstone/catkin_hrg",
"id": "b6d70a7590fdbac5c68f430337227eb9376c1df5",
"size": "12... |
from twisted.test import proto_helpers
from twisted.trial import unittest
from joker.bot import JokerBotFactory
def _common_setup(self):
self.factory = JokerBotFactory()
self.bot = self.factory.buildProtocol(('127.0.0.1', 0))
self.fake_transport = proto_helpers.StringTransport()
self.bot.makeConnecti... | {
"content_hash": "abca09a49a0f1837f5666bd3e5e3a789",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 182,
"avg_line_length": 36.57575757575758,
"alnum_prop": 0.6992543496271748,
"repo_name": "rennerocha/joker",
"id": "ad5fbd8a1134712bb3483571b26dddf462060659",
"size": "123... |
import sys
import os
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(project_root)
import matplotlib as mpl
mpl.use("Agg")
import argparse
import h5py
import itertools
import numpy
import pylru
from multiprocessing import Process, Array, Queue
import ctypes
import arl.test_... | {
"content_hash": "0aaa3c5ebd8a18ff4fd6283fbe7c876e",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 85,
"avg_line_length": 29.986486486486488,
"alnum_prop": 0.6566020730058585,
"repo_name": "SKA-ScienceDataProcessor/crocodile",
"id": "208254f71b0ad593f1b0789baf476db554c9c05... |
"""
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too.
You need to find the shortest such subarray and output its length.
Example 1:
Input: [2, 6, 4, 8, 10, 9, 15]
Output: 5
Explanation: ... | {
"content_hash": "91a2037f390afb3cefb9250e32dd648a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 181,
"avg_line_length": 28.5531914893617,
"alnum_prop": 0.53725782414307,
"repo_name": "Vonzpf/LeetCode",
"id": "c4d95a6ca23c7bf26a7b880fd64b970709943113",
"size": "1380",
... |
""" Logging utility"""
import os, errno
import logging
from logging.handlers import RotatingFileHandler
DEFAULT_FORMAT = logging.Formatter('%(asctime)s - '
'%(filename)s:%(funcName)s '
'%(levelname)s - '
'%(lineno)d:\t'
... | {
"content_hash": "8a5d0038e263f9e9abb35ee6fcd0f2b5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 93,
"avg_line_length": 23.941176470588236,
"alnum_prop": 0.6253071253071253,
"repo_name": "yumyai/ksiga",
"id": "22b642e354a8d8a172702eb06cd87406d9c46412",
"size": "1653",
... |
import os
import numpy
import glob
import shutil
import codecs
import time
import sys
os.environ['GLOG_minloglevel'] = '2'
import caffe
from caffe.proto import caffe_pb2
from google.protobuf import text_format
from scipy.misc import imresize, imread
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.... | {
"content_hash": "4c3488446739d1e2415ba502884e3ef9",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 99,
"avg_line_length": 33.77220077220077,
"alnum_prop": 0.5735680804847376,
"repo_name": "bonyuta0204/NetDissec",
"id": "850cfe36de8899f1d2b3a9a407814d9837c8aa1d",
"size":... |
from __future__ import absolute_import
import binascii
import datetime
import graphene
from graphene.types.datetime import Date, Time, DateTime
from graphene.utils.str_converters import to_camel_case
from graphql.language import ast
def factory_type(operation, _type, *args, **kwargs):
if operation == "output":
... | {
"content_hash": "2f498a8e92f519d0f9494da6d7407ef8",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 88,
"avg_line_length": 32.627027027027026,
"alnum_prop": 0.568754141815772,
"repo_name": "eamigo86/graphene-django-extras",
"id": "e78c47de35bc691199c1737c46db8d1a5cc625a1",... |
from PyQt4.QtCore import *
a = QString("apple")
b = unicode("baker")
print(a + b)
print(type(a + b)) | {
"content_hash": "f95075a42e53ad7b9359f4a04ed241e7",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 26,
"avg_line_length": 20,
"alnum_prop": 0.65,
"repo_name": "quanhua92/learning-notes",
"id": "64d8665c7ba9ed2801132f930aed8f8a3cec44ae",
"size": "100",
"binary": false,
... |
"""The security groups extension."""
from oslo_log import log as logging
from oslo_serialization import jsonutils
from webob import exc
from jacket.api.compute.openstack import common
from jacket.api.compute.openstack.compute.schemas import security_groups as \
schema_... | {
"content_hash": "f3995f14b0b862e4a7423e8a6fe59769",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 79,
"avg_line_length": 43.53875968992248,
"alnum_prop": 0.5838155434879373,
"repo_name": "HybridF5/jacket",
"id": "6c348ade07454cd56ade385ecf7f3d2917734001",
"size": "2314... |
"""Ivmech PID Controller is simple implementation of a Proportional-Integral-Derivative (PID) Controller at Python Programming Language.
More information about PID Controller: http://en.wikipedia.org/wiki/PID_controller
"""
import time
class PID:
"""PID Controller
"""
def __init__(self, P=0.2, I=0.0, D=0.... | {
"content_hash": "06acbc3cd079514cafa41daea3ab3c6a",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 136,
"avg_line_length": 33.72549019607843,
"alnum_prop": 0.6052325581395349,
"repo_name": "faturita/ShinkeyBot",
"id": "5e3dfaeb07eee845f4e8d41e08dfb0823db709f3",
"size": ... |
import os
import subprocess
import sys
from subprocess import PIPE
import requests
import time
def serviceRaise(relativePath, healthUrl, serverName):
os.chdir(relativePath)
with open('./run-out.txt', 'w') as f:
p = subprocess.Popen('mvn spring-boot:run -P dev-standalone', shell=True, stdout=f, stderr=f)
t... | {
"content_hash": "f6ac86c2567b30cd541cc3c341d02be3",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 97,
"avg_line_length": 30.865384615384617,
"alnum_prop": 0.6623052959501557,
"repo_name": "MarcinMilewski/sqap",
"id": "16186ef3ef4b087e9fa1bc682f18e2938cbf95a3",
"size": "... |
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
context = {'title': 'Home Page'}
return render(request, 'index.html', context)
| {
"content_hash": "027d2b5774734cccbd54ee7bae281133",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 26,
"alnum_prop": 0.7307692307692307,
"repo_name": "Rut0/RutoApp",
"id": "faf20550d225b49922f141f9edc1bc1d6526412a",
"size": "182",
"binary": false,... |
"""Tests for distutils.sysconfig."""
import contextlib
import os
import subprocess
import sys
import pathlib
import pytest
import jaraco.envs
import path
from jaraco.text import trim
import distutils
from distutils import sysconfig
from distutils.ccompiler import get_default_compiler # noqa: F401
from distutils.unix... | {
"content_hash": "4f72e2b5ee2c707c0d685e77c79cdd70",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 88,
"avg_line_length": 38.070234113712374,
"alnum_prop": 0.5922867433892647,
"repo_name": "pypa/setuptools",
"id": "66f92c2ae00e855deea818411334b99b077bc84e",
"size": "113... |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from googl... | {
"content_hash": "9d3d963eb3e292c17b549dee29c152a9",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 108,
"avg_line_length": 44.166392092257,
"alnum_prop": 0.6222164198590026,
"repo_name": "googleapis/python-dialogflow-cx",
"id": "65d597d22d6eefaed14872f0b2ba9aff4ec2b011",
... |
'''Database module, including the SQLAlchemy database object and DB-related
mixins.
'''
from .extensions import db
class CRUDMixin(object):
"""Mixin that adds convenience methods for CRUD (create, read, update, delete)
operations.
"""
__table_args__ = {'extend_existing': True}
id = db.Column(db.... | {
"content_hash": "817bdc4c6a7311975ae28f9e9f320854",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 82,
"avg_line_length": 28.127659574468087,
"alnum_prop": 0.5885022692889561,
"repo_name": "Nikola-K/fpage",
"id": "3578531cd88b6cd5aa3ba8550cf772d0fdddc6bb",
"size": "1346"... |
from sidomo import Container
def say_hello(to):
"""Just say it."""
with Container(
'ubuntu',
stderr=False
) as c:
for line in c.run(
'echo hello %s' % to
):
yield line
if __name__ == '__main__':
for line in say_hello("world"):
print(lin... | {
"content_hash": "9b4ce9c564b1698ec21b1c8609f51029",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 35,
"avg_line_length": 17.944444444444443,
"alnum_prop": 0.47987616099071206,
"repo_name": "suchkultur/sidomotest",
"id": "e54a87da0d63956a39d2ca5e73b636acac0e4579",
"size"... |
import logging
import os
import sys
import cv2
import numpy as np
logging.basicConfig(level=logging.INFO)
log = logging.getLogger(__name__)
_MYDIR = os.path.realpath(os.path.dirname(__file__))
DATADIR = os.path.join(_MYDIR, "dataset")
WINDOW_SIDE = 50
WINDOW_SHAPE = np.array((WINDOW_SIDE, WINDOW_SIDE))
def clean... | {
"content_hash": "6a4e9476fb0ddace15a290953d831dd2",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 80,
"avg_line_length": 28.754601226993866,
"alnum_prop": 0.5818220610198421,
"repo_name": "xa4a/shredsim",
"id": "78e3cf161df00846daca2c8a9c02d4aaf5df8363",
"size": "4687"... |
import pyregion
import numpy as np
import pyspeckit
from astropy import table
import spectral_cube
from paths import (h2copath, mergepath, figurepath, regpath, analysispath,
mpath, hpath, tpath)
import os
from pyspeckit_fitting import simplemodel, simple_fitter, simple_fitter2
try:
from pyspeckit... | {
"content_hash": "8095ddbffb0d7389e05ec861bae6a7af",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 104,
"avg_line_length": 40.6398891966759,
"alnum_prop": 0.5564037897893804,
"repo_name": "adamginsburg/APEX_CMZ_H2CO",
"id": "ac8bb523fa81480985d19135df395a0f5579738d",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('movielists', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='movie',
name='image',
field=mo... | {
"content_hash": "fd922cd47c71c8190002f6184951f16c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 22.526315789473685,
"alnum_prop": 0.5934579439252337,
"repo_name": "kiriakosv/movie-recommendator",
"id": "d829412099e71dc1855b7ad8410a3635df8e5be4",
... |
from __future__ import absolute_import, with_statement
import logging
from urllib import urlencode
from mom.functional import select_dict, map_dict
from pyoauth._compat import urljoin
from pyoauth.constants import OPENID_MODE_CHECK_AUTHENTICATION, \
HEADER_CONTENT_TYPE, HTTP_POST, OAUTH_VALUE_CALLBACK_OOB, \
... | {
"content_hash": "bff617e1ee099ce630326bc779ceba2a",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 97,
"avg_line_length": 39.882075471698116,
"alnum_prop": 0.6043761088113542,
"repo_name": "gorakhargosh/pyoauth",
"id": "e452808e4183bf0d6fd90606fc5bbfe778b7c6d2",
"size":... |
'''OpenGL extension EXT.cull_vertex
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_EXT_cull_vertex'
_DEPRECATED = False
GL_CULL_VERTEX_EXT = c... | {
"content_hash": "23f67b157b7ae6a67c24200837803305",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 102,
"avg_line_length": 37.027027027027025,
"alnum_prop": 0.7846715328467153,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "0d18503f724997348429c6215d3bf45225cadd5... |
import sys
import os
import argparse
import numpy as np
import pickle
import chainer
from chainer import serializers
import chainer.links as L
import chainer.functions as F
from chainer import cuda
from Model import CNNModel
from parameters import Parameters
from read_file import get_data
if __name__ == u'__main__'... | {
"content_hash": "cbfa27d7f45f1a45f846302793e0e731",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 106,
"avg_line_length": 27.927272727272726,
"alnum_prop": 0.61328125,
"repo_name": "takat0m0/test_code",
"id": "95ce742ea6ca4082d9c70c3555cd877d13957265",
"size": "1560",
... |
class ShellTemplate(object):
def __init__(
self,
name,
description,
repository,
min_cs_ver,
standard=None,
standard_version=None,
params=None,
):
self.name = name
self.description = description
self.repository = repository
... | {
"content_hash": "7767e0f0d8183afe53aceaa29e34c859",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 54,
"avg_line_length": 26.61111111111111,
"alnum_prop": 0.5532359081419624,
"repo_name": "QualiSystems/shellfoundry",
"id": "8c431977f44a9fd0d5e3cb6a52b7e1b5b17092bb",
"siz... |
from labels import LabelsPlugin
from electrum.plugins import hook
class Plugin(LabelsPlugin):
@hook
def load_wallet(self, wallet, window):
self.window = window
self.start_wallet(wallet)
def on_pulled(self, wallet):
self.print_error('on pulled')
self.window._trigger_update_... | {
"content_hash": "6aa4f5c46cdb8db20d746498f08bd3d4",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 23.642857142857142,
"alnum_prop": 0.6737160120845922,
"repo_name": "fireduck64/electrum",
"id": "1a4b31f1738cd8decc9061e9050ddaf9c3c0d91a",
"size": "... |
"""
PHYLIP multiple sequence alignment format (:mod:`skbio.io.phylip`)
==================================================================
.. currentmodule:: skbio.io.phylip
The PHYLIP file format stores a multiple sequence alignment. The format was
originally defined and used in Joe Felsenstein's PHYLIP package [1]_,... | {
"content_hash": "12aa1c1efaa789a4c8e998b8da9ae745",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 79,
"avg_line_length": 42.857723577235774,
"alnum_prop": 0.6813051313667836,
"repo_name": "Achuth17/scikit-bio",
"id": "886359c6e71ccbe02a9198870903daa6ae68f70c",
"size": ... |
from baidupush import BaiduPush, BaiduPushError
__all__ = ( 'BaiduPush', 'BaiduPushError', )
| {
"content_hash": "b5132b56f9ed09b977049337186f8b40",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 47,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.723404255319149,
"repo_name": "quatanium/python-baidu-push-server",
"id": "3aba2a1364b30260936ce7bf1a905bf58f16569b"... |
import os
import sys
import time
import unittest
import vk
import utils
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
# copy to test_props.py and fill it
USER_LOGIN = '' # user email or phone number
USER_PASSWORD = '' # user password
APP_ID = '' # aka API/Client ID
from te... | {
"content_hash": "5400f485ebf5ce551965d22916f47dfc",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 104,
"avg_line_length": 29.982758620689655,
"alnum_prop": 0.6233467510063255,
"repo_name": "chibisov/vk",
"id": "8b4a2ab050c3e4224ddd10da6eb3779a9103b139",
"size": "1777",
... |
'''Utility functions to search, filter, and manipulate output data of Chrome's event tracer'''
import tkinter
from tkinter.filedialog import askopenfilename
import json
import csv
import os;
def findFile():
#Gets rid of a GUI element native to tkinter
root = tkinter.Tk();
root.withdraw();
... | {
"content_hash": "90dd710d7524adb10e0ddb6b61b9e5a1",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 94,
"avg_line_length": 30.630769230769232,
"alnum_prop": 0.6052235057759919,
"repo_name": "benjaminy/Charcoal",
"id": "355ea47dedb98060c50c3399268c6d023a3fbca7",
"size": "1... |
class Dispenser(object):
def __init__(self):
self.placebos = {}
def __call__(self, name=None):
return Placebo(name)
def __getattr__(self, name):
return self.placebos.setdefault(name, Placebo(name))
def __enter__(self):
return self
def __exit__(self... | {
"content_hash": "749b88264641e78f3801b8975530d576",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 91,
"avg_line_length": 32.14728682170543,
"alnum_prop": 0.53315649867374,
"repo_name": "wilkes/expectorant",
"id": "39dd246e5cc7834c6de2fbf152673c0b7af1f946",
"size": "414... |
"""\
Tests against <https://github.com/mnooner256/pyqrcode/issues/50>
"""
from __future__ import unicode_literals
from nose.tools import eq_
from segno_mimos import pyqrcode
class FakeString(str):
'''
Create a mock class that *acts* like a string as far as needed for the
QRCode constructor, but raises an ... | {
"content_hash": "69d9791f9f7a4c6b58ed40da6db19cf2",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 32.6551724137931,
"alnum_prop": 0.6842661034846885,
"repo_name": "heuer/segno-mimos",
"id": "61af14236aad07ab97f00ff1014499dc5ea88376",
"size": "971"... |
import settings
from ast import literal_eval
STACK_TRACE_ITEM_POSITION_LINE_NUMBER = 1
STACK_TRACE_ITEM_POSITION_FUNCTION_CALL = 3
class ExecutedInstructionsGroup(object):
def __init__(self):
self.function_caller = None
self.function_callees = []
self.function_call_line = None
self... | {
"content_hash": "8e11133bd091368290d0c990916bca7e",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 178,
"avg_line_length": 46.52095808383233,
"alnum_prop": 0.6637919938215987,
"repo_name": "skyylex/Luminous-proof-of-concept",
"id": "73d42b1235f585acbd81eb439283f6a8c1e9b55... |
from django import test
from django.core.management import call_command
from django.db import connection
from django.db.migrations.loader import MigrationLoader
class MigrationTestCase(test.TransactionTestCase):
"""
Test case for a Django database migration.
Example::
class TestSomeMigrations(Mi... | {
"content_hash": "e6bb5f06c798f579ee417a12594f0932",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 117,
"avg_line_length": 40.63157894736842,
"alnum_prop": 0.6040155440414507,
"repo_name": "appressoas/ievv_opensource",
"id": "262a0672972e327d6c7b898583d36a15bae0673e",
"... |
from smtplib import SMTP as smtp
from os import listdir
from os import remove
def is_listed(email):
is_a_member = False
fp = open('/foodcoop/members', 'r')
for eachline in fp:
if email == eachline.strip():
is_a_member = True
fp.close()
return is_a_member
def email_re(list_of_wo... | {
"content_hash": "df404e8ad186400b4304e8c8e5fd5a43",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 104,
"avg_line_length": 29.27710843373494,
"alnum_prop": 0.5452674897119342,
"repo_name": "rupertsmall/food_coop",
"id": "85ea6be225598d2921845b8a88ad542d8e67b73a",
"size":... |
"""Calculate the number of qubits of a DAG circuit."""
from qiskit.transpiler.basepasses import AnalysisPass
class NumQubits(AnalysisPass):
"""Calculate the number of qubits of a DAG circuit.
The result is saved in ``property_set['num_qubits']`` as an integer.
"""
def run(self, dag):
"""Run... | {
"content_hash": "e922f20c5b651a7d98e9104c8d3b8482",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 72,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.6650485436893204,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "ed3fbe41f086daa9edca858d68a4d62cf183bd3c",
"size": ... |
"""empty message
Revision ID: 808d8916868
Revises: 33fec8aa1b6
Create Date: 2016-04-08 21:07:08.499000
"""
# revision identifiers, used by Alembic.
revision = '808d8916868'
down_revision = '33fec8aa1b6'
from alembic import op
import sqlalchemy as sa
import geoalchemy2
from sqlalchemy_utils import URLType
from sql... | {
"content_hash": "2de4c0a276e409728875467a11049dc8",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 104,
"avg_line_length": 57.542857142857144,
"alnum_prop": 0.6931479642502483,
"repo_name": "ryanbaumann/athletedataviz",
"id": "9fd5281228ff3d7f13479ee9412e968f8e2ea3fd",
... |
import urllib2
import cookielib
import requests
import re
import json
import codecs
import os
import datetime
import random
import time
import mysql.connector
import variable
import facebook_variable
class User(object):
def __init__(self):
super(User, self).__init__()
self.data = {
'pr... | {
"content_hash": "947eb869d2d2009a46e90b8c6085f01e",
"timestamp": "",
"source": "github",
"line_count": 750,
"max_line_length": 152,
"avg_line_length": 35.568,
"alnum_prop": 0.5761358524516419,
"repo_name": "lifei96/Medium_Crawler",
"id": "00b2fa7b3da5aec216accfeabee057c850c8621a",
"size": "26701",... |
import re
import json
from urlparse import urlparse
from scrapy.selector import Selector
try:
from scrapy.spiders import Spider
except:
from scrapy.spiders import BaseSpider as Spider
from scrapy.utils.response import get_base_url
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors.sgml im... | {
"content_hash": "3d7809a5456478baff1a87be9deeb2dd",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 86,
"avg_line_length": 34.41875,
"alnum_prop": 0.5091701470855275,
"repo_name": "geekan/scrapy-css-rule-spider",
"id": "72ef7e3fe53f5fb3f49dd3762341f40a81d86061",
"size": ... |
import re
from collections import OrderedDict
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from model_utils.models import TimeStampedModel
class Base(TimeStampedModel):
class Meta:
abstract = True
... | {
"content_hash": "684b988f87ef85db93a6e69ad609f936",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 119,
"avg_line_length": 27.048128342245988,
"alnum_prop": 0.6352313167259787,
"repo_name": "sheepeatingtaz/xwingoverlayer",
"id": "dfb3e47bc893f54d8fbed59df40a6fee43493f1c",... |
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
__all__ = ['catalog', 'testing', 'http_util']
| {
"content_hash": "e19d1fa39b7b2dccc69b99b0a9911d48",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 27.8,
"alnum_prop": 0.6618705035971223,
"repo_name": "MoonRaker/siphon",
"id": "6cabd7ddcd421258105ed9bfecddb459f7296fb1",
"size": "329",
"binary": ... |
from __future__ import unicode_literals, print_function
import pytest
import os
from oar.lib import (db, AdmissionRule)
from oar.lib.submission import (parse_resource_descriptions, add_micheline_jobs, set_not_cli)
@pytest.yield_fixture(scope='function', autouse=True)
def minimal_db_initialization(request):
db.d... | {
"content_hash": "693ac9508d54bdc92e2fdfed21365745",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 98,
"avg_line_length": 30.706293706293707,
"alnum_prop": 0.5650193577772717,
"repo_name": "fr0uty/oartm",
"id": "7c740d0e4e9222bd96ae19daba1fa713f80d5548",
"size": "4407",... |
import os
import numpy as np
from ludwig.constants import *
from ludwig.decoders.sequence_decoders import DECODER_REGISTRY
from ludwig.encoders.sequence_encoders import ENCODER_REGISTRY as SEQUENCE_ENCODER_REGISTRY
from ludwig.encoders.text_encoders import *
from ludwig.features.base_feature import InputFeature
from ... | {
"content_hash": "370605355e891b9e1dccefd87f2427c6",
"timestamp": "",
"source": "github",
"line_count": 500,
"max_line_length": 91,
"avg_line_length": 39.74,
"alnum_prop": 0.5587317564167086,
"repo_name": "uber/ludwig",
"id": "513b7fc929cc69b4f3e0590c9f90bd4ea5b743c5",
"size": "20580",
"binary": ... |
from bawt.subsystems.irrigation import Irrigation
import sys
if __name__ == "__main__":
zone = int(sys.argv[1])
state = sys.argv[2]
run_time = 0
if len(sys.argv) >= 4:
run_time = int(sys.argv[3])
irrigation = Irrigation()
if state == 'on':
irrigation.start(zone)
elif stat... | {
"content_hash": "3cb4493982fb3cd73f516cf3b4cb2635",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 22.842105263157894,
"alnum_prop": 0.5783410138248848,
"repo_name": "DoriftoShoes/bawt",
"id": "34b638c303473b2977a6433d0159692fe4110a50",
"size": "43... |
from subprocess import call
import os
sitePath = os.path.normpath(os.path.dirname((os.path.join(os.getcwd(),os.path.dirname(__file__) ) ) ) )
siteDir = os.path.join(sitePath,"www")
# Copy Notebooks to the user space (leaving originals unchanged)
# Make symlinks for Data and Documentation so that these are visible
# t... | {
"content_hash": "12fc8d991046b3b7e585de1eccf64cb3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 103,
"avg_line_length": 44.44444444444444,
"alnum_prop": 0.70875,
"repo_name": "lmoresi/UoM-VIEPS-Intro-to-Python",
"id": "800388858358d8a50c9d74fa3ac4c3607e979bd2",
"size"... |
import numpy as np
import cv2
img = cv2.imread("frclogo.jpg")
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
# define range of blue color in HSV
lower_lim = np.array([0,155,155])
upper_lim = np.array([179,255,255])
# Threshold the HSV image to get highly saturated image
mask = cv2.inRange(hsv, lower_lim, upper_lim)
# f... | {
"content_hash": "2bcca09ab9118d34277900234eeb8dc7",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 89,
"avg_line_length": 28.689655172413794,
"alnum_prop": 0.6923076923076923,
"repo_name": "Burtt/IllumicatsVision",
"id": "ef41f94b0fd7f6b64d65f87b3a16978a1a21c334",
"size"... |
__all__ = ['soundcloud_download', 'soundcloud_download_by_id']
from ..common import *
import json
import urllib.error
client_id = 'WKcQQdEZw7Oi01KqtHWxeVSxNyRzgT8M'
def soundcloud_download_by_id(id, title=None, output_dir='.', merge=True, info_only=False):
assert title
url = 'https://api.soundcloud.com/track... | {
"content_hash": "60a0602d4833988be35d742f6ff716fa",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 100,
"avg_line_length": 37.5,
"alnum_prop": 0.6653968253968254,
"repo_name": "zmwangx/you-get",
"id": "1a4061ffd0d7072d0f501586ef2dc702b5b5d37e",
"size": "1598",
"binary"... |
import setuptools
from setuptools.command.install import install
# Install Necessary R packages
class CustomInstallPackages(install):
"""Customized setuptools install command - runs R package install one-liner."""
def run(self):
import subprocess
import shlex
print "Attempting to insta... | {
"content_hash": "5daa6c71e0fad8c5cffb8fa1f27a29d9",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 234,
"avg_line_length": 37.72549019607843,
"alnum_prop": 0.6626819126819127,
"repo_name": "twbattaglia/koeken",
"id": "37c17e101a38eff26bced363e8d7e0fe93fe0876",
"size": "1... |
import pytest
@pytest.mark.xfail
def test_get_bookmark():
raise NotImplementedError
| {
"content_hash": "2d428d5ed8bde34b0166af8f1b3d9430",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 29,
"avg_line_length": 15,
"alnum_prop": 0.7666666666666667,
"repo_name": "globus/globus-sdk-python",
"id": "ed3c08e4424510aa90d722edb14de5788c45392d",
"size": "90",
"bina... |
"""
https://leetcode.com/problems/most-common-word/
https://leetcode.com/submissions/detail/150204402/
"""
class Solution:
def mostCommonWord(self, paragraph, banned):
"""
:type paragraph: str
:type banned: List[str]
:rtype: str
"""
wordAcc = dict()
for wor... | {
"content_hash": "76c85c5af93a2e6ba3127a1a09fba9fe",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 152,
"avg_line_length": 25.704545454545453,
"alnum_prop": 0.5057471264367817,
"repo_name": "vivaxy/algorithms",
"id": "cbdeba17a3cde7ee95f6b5010683d5e9c96cb7b7",
"size": "1... |
from watson.auth.providers import abc
class Provider(abc.Base):
defaults = {}
def _validate_configuration(self, config):
super(Provider, self)._validate_configuration(config)
def handle_request(self, request):
if not hasattr(request, 'user'):
request.user = None
if n... | {
"content_hash": "fa364b67f425da5b93f9661a59dc0a62",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 61,
"avg_line_length": 28.962962962962962,
"alnum_prop": 0.6048593350383632,
"repo_name": "watsonpy/watson-auth",
"id": "6110c73cc373c5f2b550eba2d90db01b775fad45",
"size": ... |
from unittest import TestCase
def calcular_frequencias(s):
dct = {}
for char in s:
dct[char] = dct.get(char, 0) + 1
return dct
def gerar_arvore_de_huffman(s):
dct = calcular_frequencias(s)
folhas = []
for folha in dct:
folhas.append(Folha(folha, dct[folha]))
folhas.sort(k... | {
"content_hash": "be3f486ce02ee26d2aa011258d32bec8",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 108,
"avg_line_length": 27.748898678414097,
"alnum_prop": 0.5680266709001429,
"repo_name": "juancanuto/estrutura-de-dados",
"id": "3e70e8447a87a9ece4d36b1e25736acd942e7d73",... |
import re
__src__ = file('lib/__init__.py').read()
__doc__ = re.search('^(["\']{3})(.*?)\\1', __src__, re.M|re.S).group(2).strip()
__version__ = re.search('^__version__\s*=\s*(["\'])(.*?)\\1\s*$', __src__, re.M).group(2).strip()
options = dict(
minver = '2.6', # Min Python version required.
maxver = None, ... | {
"content_hash": "91d1f2d3d6afd37607d8454f7969eca0",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 107,
"avg_line_length": 31.942028985507246,
"alnum_prop": 0.5628402903811253,
"repo_name": "salsita/flask-mime-encoders",
"id": "ab6d77557ef718e099826c752200800439f4ddc2",
... |
"""
Slacker's adisp library wrapper.
Removes the need to call 'adisp.async(proceed)' manually on yield for Slacker
and Postponed objects: they can now be yielded directly.
"""
from slacker.adisp._adisp import CallbackDispatcher, async
from slacker.postpone import Postponed, Slacker
class _SlackerCallbackDispatcher(... | {
"content_hash": "4c7233841fd8292fe3fc2f7b9846cf1d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 77,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.6797687861271676,
"repo_name": "kmike/tornado-slacker",
"id": "a48478d0dbb78047b94b485a23e255bf2f5f9098",
"size":... |
"""@file crossentropy_multi_loss.py
contains the CrossEntropyMultiLoss"""
import tensorflow as tf
import loss_computer
from nabu.neuralnetworks.components import ops
class CrossEntropyMultiLoss(loss_computer.LossComputer):
"""A loss computer that calculates the loss"""
def __call__(self, targets, logits, seq_leng... | {
"content_hash": "cc6f4552ec1e856ba8fc696b477aaabc",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 112,
"avg_line_length": 29.14814814814815,
"alnum_prop": 0.7058449809402796,
"repo_name": "JeroenZegers/Nabu-MSSS",
"id": "bb4baad0aff5417a075ffb95dfa8a49ed845ef47",
"size"... |
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from django.core.mail import send_mail
from django.forms.models import BaseModelFormSet, modelformset_factory
from django.template import loader
from django.utils.crypto import get_random_string
from django.utils.translation im... | {
"content_hash": "43fb022788dd8856c08b216de34bb9ab",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 83,
"avg_line_length": 38.81818181818182,
"alnum_prop": 0.5663265306122449,
"repo_name": "littleweaver/django-argus",
"id": "97e48fc68bf25882512f9f131c675d0a9f321ad9",
"si... |
"""
Platform for the Daikin AC.
For more details about this component, please refer to the documentation
https://home-assistant.io/components/daikin/
"""
import asyncio
from datetime import timedelta
import logging
from socket import timeout
import async_timeout
import voluptuous as vol
from homeassistant.config_ent... | {
"content_hash": "77ced524e44570745d18984cc9da78c9",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 79,
"avg_line_length": 29.45205479452055,
"alnum_prop": 0.6404651162790698,
"repo_name": "tinloaf/home-assistant",
"id": "86ad6c0a1601ece94146953c76e8c310051f000f",
"size"... |
"""
Created on Wed Dec 3 15:01:34 2014
@author: Matti Ropo
@author: Henrik Levämäki
"""
from pyemto.utilities.utils import *
| {
"content_hash": "2903e0639d50a0f23cd6ead5e17c6fb6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 36,
"avg_line_length": 16,
"alnum_prop": 0.7109375,
"repo_name": "hpleva/pyemto",
"id": "1ac0a5832ed3dfc0109f28ef1870098664b3c5a8",
"size": "154",
"binary": false,
"copi... |
"""Gauge watcher implementations."""
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2017 The Contributors
#
# Licensed under the Ap... | {
"content_hash": "c524001ed9ee85088819bf99c63d9889",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 120,
"avg_line_length": 37.111111111111114,
"alnum_prop": 0.6175149700598802,
"repo_name": "byllyfish/faucet",
"id": "7e3f22b8fba9fce2af20e494c654712aef985bb0",
"size": "5... |
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 field 'Author.slug'
db.add_column(u'articles_author', 'slug',
self... | {
"content_hash": "eafc5ece711b61e2225ce83c8935f31e",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 194,
"avg_line_length": 75.32631578947368,
"alnum_prop": 0.553381777529346,
"repo_name": "AmandaCMS/amanda-cms",
"id": "86be4bdb8ff661ec9152c281c6eedd261592cb0e",
"size": "... |
import logging
from random import shuffle
from unittest.mock import MagicMock
# # TODO? Stop mocking (See blame commit message and possibly PR for
# # discussion.)
# from aqt import mw
mw = MagicMock()
from mamba import describe, it, context
from crowd_anki.config.config_settings import ConfigSettings, NoteSortingMe... | {
"content_hash": "50e2d216dec33fa2251b0aa1ec4bbe89",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 118,
"avg_line_length": 36.72666666666667,
"alnum_prop": 0.6331457614812126,
"repo_name": "Stvad/CrowdAnki",
"id": "859798b2190891cd4f05302ea324c4f0a6d481a2",
"size": "550... |
from __future__ import unicode_literals
from ..preprocess import Normalize12
def test_Normalize12_inputs():
input_map = dict(affine_regularization_type=dict(field='eoptions.affreg',
),
apply_to_files=dict(copyfile=True,
field='subj.resample',
),
bias_fwhm=dict(field='eoptions.biasfwhm',
),... | {
"content_hash": "c22b84d6aa7bff02426399adf5979082",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 77,
"avg_line_length": 26.66216216216216,
"alnum_prop": 0.633046122655854,
"repo_name": "mick-d/nipype",
"id": "9d537e34b11ec4b6cf91494ca23b6278d98c182b",
"size": "2027",
... |
from oslo_db.sqlalchemy import models
from oslo_utils import timeutils
from oslo_utils import uuidutils
import sqlalchemy as sa
from sqlalchemy.ext import declarative
from nca47.objects import attributes as attr
class Nca47Base(models.ModelBase,
models.SoftDeleteMixin,
models.ModelIte... | {
"content_hash": "7705e0e0814f380ed46d22a02cbf1c85",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 30.928571428571427,
"alnum_prop": 0.5815242494226328,
"repo_name": "willowd878/nca47",
"id": "38a822eef2aeac8aaa418a13f1008649afa85a20",
"size": "216... |
import py
import pkg_resources
class PyCodeCheckItem(py.test.collect.Item):
def __init__(self, ep, parent):
py.test.collect.Item.__init__(self, ep.name, parent)
self._ep = ep
def runtest(self):
c = py.io.StdCapture()
mod = self._ep.load()
found_errors, out, err = c.ca... | {
"content_hash": "8496619b64f601024461c1f482227660",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 26.641025641025642,
"alnum_prop": 0.6227141482194418,
"repo_name": "c0710204/mirrorsBistu",
"id": "f7eb30c3ebf600667a8fc4b733c72094b70aebbe",
"size":... |
from trayjenkins.event import Event
from pyjenkins.job import JobStatus
class IModel(object):
def status_changed_event(self):
"""
Event arguments: (status:str, message:str)
@rtype: trayjenkins.event.IEvent
"""
class IView(object):
def set_status(self, status, message):
... | {
"content_hash": "8b0aebd73b13ea1f1538cf374d4d2b58",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 87,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.574468085106383,
"repo_name": "coolhandmook/trayjenkins",
"id": "ee47b9b62137d55548506e7838475460c9885904",
"siz... |
class 123SeguroComPipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "c110835f6afdc2583d1c461d7923b49e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7040816326530612,
"repo_name": "hanjihun/Car",
"id": "c1326e4c6df01b3fbda789d02d1948faa9a4d161",
"size": "292",
... |
from mock import Mock, patch
from nose.tools import assert_equal
from pylons import app_globals as g
from alluratest.controller import setup_unit_test
from allura.model.repository import Commit
from forgesvn.model.svn import SVNImplementation
class TestSVNImplementation(object):
def setUp(self):
setup_u... | {
"content_hash": "3650a45d42514ac123b3bce5d2646017",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 79,
"avg_line_length": 42,
"alnum_prop": 0.5966505246166263,
"repo_name": "heiths/allura",
"id": "216255d1bfd8720272b3fc2378bfdc6fff692b82",
"size": "5826",
"binary": fa... |
from .rest import * | {
"content_hash": "87887e1e8e0c3a78ead78d82a6f646a3",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 19,
"avg_line_length": 19,
"alnum_prop": 0.7368421052631579,
"repo_name": "NeillHerbst/bitfinex-python",
"id": "be4ee0f6ccce2e64eb2c86c140166dd1c79fdeea",
"size": "19",
"b... |
"""Directives that mark task and configurable topics for the LSST Science
Pipelines documentation.
"""
__all__ = (
"ConfigurableTopicDirective",
"TaskTopicDirective",
"ConfigTopicDirective",
)
from docutils import nodes
from docutils.parsers.rst import Directive
from sphinx.errors import SphinxError
from ... | {
"content_hash": "600604791aaa3a10f1c75be108bb8e6a",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 79,
"avg_line_length": 30.314814814814813,
"alnum_prop": 0.6298106291997556,
"repo_name": "lsst-sqre/sphinxkit",
"id": "e9738499f5271492fa006ddec592674d9ca1c265",
"size": ... |
import os
import re
import requests
bing_key = os.environ.get('BING_API_KEY')
tomtom_key = os.environ.get('TOMTOM_API_KEY')
here_app_id = os.environ.get('HERE_APP_ID')
here_app_code = os.environ.get('HERE_APP_CODE')
geonames_username = os.environ.get('GEONAMES_USERNAME')
opencage_key = os.environ.get('OPENCAGE_API_KE... | {
"content_hash": "5e9f732022ca423448418638a98814c2",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 35.317460317460316,
"alnum_prop": 0.642247191011236,
"repo_name": "DenisCarriere/geocoder",
"id": "6d42c2d9d38e1dce96ee8882ca10dd3d68a114c7",
"size":... |
from functions import *
| {
"content_hash": "bb13f4dd3aafd9490101b3bd50c7e6f3",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 23,
"avg_line_length": 24,
"alnum_prop": 0.7916666666666666,
"repo_name": "kevink1986/my-first-blog",
"id": "d71d12f98db759126cfc6aab25d8fd9c3137a57b",
"size": "24",
"bina... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
import views
urlpatterns = patterns('',
url(r'^viewall_contest/(?P<group_id>\d+)/$', views.get_running_contest, name='viewall_contest'),
url(r'^viewall_archive/(?P<group_id>\d+)/$', views.get_ended_contest, name='viewall_archi... | {
"content_hash": "33f237f7a71e585edc888a52d145429d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 100,
"avg_line_length": 51.5,
"alnum_prop": 0.636615811373093,
"repo_name": "drowsy810301/NTHUOJ_web",
"id": "23a436796bd988898a39862fd70df09d20166492",
"size": "721",
"b... |
import os
import gc
import argparse
from time import time
from contextlib import contextmanager
from spec_data import CleanSpectra, write_spectra_file
@contextmanager
def timeit(message):
if message:
print(message)
t = time()
yield
print(" {0:.2g} sec".format(time() - t))
def process_fil... | {
"content_hash": "4ffec0e7288844dd64a801a08e3caa13",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 29.044117647058822,
"alnum_prop": 0.5893670886075949,
"repo_name": "jakevdp/spec_data",
"id": "88d79d6ce3ba53f11217a371be9fe5ef5d7bc98e",
"size": "19... |
import json
total = 0
def sumer(s):
global total
total += int(s)
data = {}
with open('../inputs/12.txt') as f:
data = json.load(f, parse_int=sumer)
print total
| {
"content_hash": "d63f0fddb9459e00addf725db539f55e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 13.307692307692308,
"alnum_prop": 0.6184971098265896,
"repo_name": "opello/adventofcode",
"id": "311d5c0f5043c81bbff6792b4ec71d5bcace6280",
"size": "... |
from .pcollector import *
from .rpredictor_schedule import *
from .rpredictor import *
from .train import *
| {
"content_hash": "c8d927417a70e8903c7acd26ff6aec6f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 27,
"alnum_prop": 0.7685185185185185,
"repo_name": "vacancy/TensorArtist",
"id": "ae06411a3b10abd123a4cc635e52233dfb89ca23",
"size": "271",
"binary"... |
def get_amino_masses(input_file):
return dict(line.strip().split() for line in input_file)
def get_string_mass(string, masses_dict):
return sum(map(lambda ch: float(masses_dict[ch]), string))
def main():
with open("Amino_masses.txt", "r") as input_file:
mass_dict = get_amino_masses(input_file)
string = "SKADYE... | {
"content_hash": "128e6da21437feeb63cddc56b6e88b40",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.7058823529411765,
"repo_name": "Daerdemandt/Learning-bioinformatics",
"id": "cc1136a338e3ef3f92796613daa7135b6aaa2c... |
"""Common settings module."""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
APPEND_SLASH = True
# Django settings
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = os.environ.get("DJANGO_SECRET_KEY", "w;ioufpwqofjpwoifwpa09fuq039uq3u4uepoivqnwjdfvlwdv")
INSTALLED... | {
"content_hash": "2abdbcf617638c1899b3b11bae3b34d0",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 119,
"avg_line_length": 32.265625,
"alnum_prop": 0.7034705407586763,
"repo_name": "monty5811/apostello",
"id": "f9ff1a2af39e69692583a88581ac8c1e7c9945eb",
"size": "6195",
... |
'''
The MIT License (MIT)
Copyright (c) 2015 @ CodeForBirmingham (http://codeforbirmingham.org)
@Author: Marcus Dillavou <[email protected]>
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... | {
"content_hash": "3fdce050056363146f7acb2d80520d18",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 46.38461538461539,
"alnum_prop": 0.7993366500829188,
"repo_name": "CodeforBirmingham/Birmingham-CoalbolMiner",
"id": "74aa7e7b479b6cf7d711ae2df47e3b22a... |
"""
Adapted from Cython/Compiler/Visitor.py, see this module for detailed
explanations.
"""
import inspect
miniast = None # avoid circular import AttributeError for sphinx-apidoc
import treepath
class TreeVisitor(object):
"""
Non-mutating visitor. Subclass and implement visit_MyNode methods.
A user can t... | {
"content_hash": "b4642f70c3669cfbddfe542ce045edae",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 81,
"avg_line_length": 30.591133004926107,
"alnum_prop": 0.5758454106280193,
"repo_name": "markflorisson/minivect",
"id": "15eabba1a5b2ef537ca0a8bf0110a52db3cb4a0f",
"size... |
from JumpScale import j
from .Params import ParamsFactory
j.base.loader.makeAvailable(j, 'core')
j.core.params = ParamsFactory()
| {
"content_hash": "f22f85d319b1fb946ba8e1e904fc97ba",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 26,
"alnum_prop": 0.7846153846153846,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "b36a1963defccd7bb0b4596bcdce736825ccd93d",
"size": "130",
"bi... |
class Unit():
def __init__(self,request,data):
pass
def text(self):
pass | {
"content_hash": "ae094bcca417d466ebed57594ef6fb42",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 19.2,
"alnum_prop": 0.5208333333333334,
"repo_name": "yubang/urlHander",
"id": "2edafd82abe28af9002b2bcd5e16b9dc2d5bba8f",
"size": "111",
"binary": ... |
"""This module implements plugin test."""
from __future__ import absolute_import
import os
import types
from swak.config import get_exe_dir
from swak.plugin import iter_plugins, import_plugins_package, TextInput,\
Parser, get_plugins_dir, Output
# from swak.util import test_logconfig
from swak.const import PLUGIN... | {
"content_hash": "4a69b81569c686f531dc49644bd8629e",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 73,
"avg_line_length": 27.1,
"alnum_prop": 0.6478064780647806,
"repo_name": "haje01/swak",
"id": "2b6ad54938edfe9a1da30058a6f1f23ff370701c",
"size": "2439",
"binary": fal... |
from time import sleep
from selenium import webdriver
class PyTest2():
def test(self):
xx = webdriver.Firefox()
xx.get("http://172.31.95.220/ranzhi/")
sleep(3)
xx.refresh()
sleep(3)
xx.find_element_by_css_selector('#account').send_keys("admin")
xx.find_el... | {
"content_hash": "89a7730a573da9504ed3fe3256bccee2",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 21.28,
"alnum_prop": 0.5657894736842105,
"repo_name": "lintyleo/seleniumpro",
"id": "d9ef1b0e88b54a20ae4294be36203cc0a656afc6",
"size": "532",
"bin... |
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.conf import settings
from django_openid.registration import RegistrationConsumer
from intranet_account.forms import OpenIDSig... | {
"content_hash": "41187d77efca180ca38e9f9e39120454",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 39.86206896551724,
"alnum_prop": 0.7474048442906575,
"repo_name": "ingenieroariel/pinax",
"id": "ee235e0aa4b665417f37d3f2ab05c306ccef9883",
"size": "... |
__all__ = ['MirroredDict', 'RelationalDict', 'ManyToManyDict', 'BidirectionalDict', 'BiDict', 'TwoWayDict']
__title__ = 'reflections'
__version__ = '1.0.1'
__author__ = 'Jared Suttles'
__license__ = 'Modified BSD'
__copyright__ = 'Copyright 2013 Jared Suttles'
from .mirroreddict import MirroredDict
from .relationaldi... | {
"content_hash": "6cc10396cc8ef91748d1ef512c20250f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 107,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.7398190045248869,
"repo_name": "jaredks/reflections",
"id": "43e93f72ef1d7e826d8d8af9309764db32f02fbe",
"size": ... |
"""Given user GO ids and parent terms, group user GO ids under one parent term.
Given a group of GO ids with one or more higher-level grouping terms, group
each user GO id under the most descriptive parent GO term.
Each GO id may have more than one parent. One of the parent(s) is chosen
to best represent... | {
"content_hash": "d3c70a4df2cbca66c80ec0fc673b6c3d",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 100,
"avg_line_length": 45.30573248407644,
"alnum_prop": 0.6184451005201743,
"repo_name": "tanghaibao/goatools",
"id": "6705019149ef26a195071d328a334f89611c64df",
"size": ... |
import urllib2
import sys
import os
import time
'''Download "Entire Issue" of the Congressional Record for the period May 1 - 31 2014.'''
month = 5 # set month to May
# make an archive/ directory if it doesn't already exist
if not os.path.exists(os.getcwd() + "/archive"):
os.mkdir(os.getcwd() + "/archive")
# tr... | {
"content_hash": "91159137d8152dfa401ac4647dd70acc",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 89,
"avg_line_length": 30.575757575757574,
"alnum_prop": 0.6788899900891973,
"repo_name": "jasonjensen/Montreal-Python-Web",
"id": "b8acddcb728bde73440dfb38441b0f888f6e959c",... |
"""
Objects for dealing with Laguerre series.
This module provides a number of objects (mostly functions) useful for
dealing with Laguerre series, including a `Laguerre` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in th... | {
"content_hash": "848d1613802d106a0b7a6d0643b8c7a9",
"timestamp": "",
"source": "github",
"line_count": 1799,
"max_line_length": 79,
"avg_line_length": 31.223457476375764,
"alnum_prop": 0.5924231364939203,
"repo_name": "bringingheavendown/numpy",
"id": "387d986fab606eca6efbe216c391dc4a05f63b81",
"s... |
import _plotly_utils.basevalidators
class ShowValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="show", parent_name="volume.caps.z", **kwargs):
super(ShowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "a54091ad2a5bd2211cec2268ca3c6796",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 82,
"avg_line_length": 35.90909090909091,
"alnum_prop": 0.6151898734177215,
"repo_name": "plotly/plotly.py",
"id": "c99ded1cc672a4bc9863562873531fe84392a0ff",
"size": "395"... |
import tkinter
import tkinter.filedialog
import tkinter.messagebox
from functools import partial
from tkinter import ttk
from odk_tools.gui.wrappers import generate_images, generate_xform, \
validate_xform, generate_editions
from odk_tools.gui import preferences
class ODKToolsGui:
def __init__(self, master=N... | {
"content_hash": "5b1f1a761002614cde22c270f6cb452a",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 80,
"avg_line_length": 45.92,
"alnum_prop": 0.6394972623195619,
"repo_name": "lindsay-stevens/odk_tools",
"id": "e5cd476aa0d7267b4e4364015a7350060cbd3404",
"size": "16072"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.