text stringlengths 4 1.02M | meta dict |
|---|---|
"""Check that the voiceHAT audio input and output are both working."""
import os
import subprocess
import sys
import tempfile
import textwrap
import time
import traceback
sys.path.append(os.path.realpath(os.path.join(__file__, '..', '..')) + '/src/')
import aiy.audio # noqa
CARDS_PATH = '/proc/asound/cards'
VOICEH... | {
"content_hash": "3a44dbc6770610e362215f94956c6494",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 95,
"avg_line_length": 26.192090395480225,
"alnum_prop": 0.6285591026747196,
"repo_name": "hanmy75/voice-recognizer",
"id": "80a7710e43f23f73c17425b74a9fe7dc204d12a9",
"si... |
"""Version-independent api tests"""
import httplib2
from oslo.serialization import jsonutils
from glance.tests import functional
class TestRootApi(functional.FunctionalTest):
def test_version_configurations(self):
"""Test that versioning is handled properly through all channels"""
# v1 and v2... | {
"content_hash": "9c02e7ea932f76e1f44252c8261fd468",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 78,
"avg_line_length": 37.85906040268456,
"alnum_prop": 0.5108136855167523,
"repo_name": "sigmavirus24/glance",
"id": "ca0ee7be3b74527ae9164b37cba0b9c98a61e7bc",
"size": "... |
import errno
import os
import re
import subprocess
import sys
# these strings will be replaced by git during git-archive
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
# these strings are filled in when 'setup.py versioneer' creates _version.py
tag_prefix = "txrecaptcha-"
parentdir_prefix = "txrecaptcha-"
vers... | {
"content_hash": "ae51dcaf5bb37c5cb26918a43ecb0c73",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 78,
"avg_line_length": 37.86026200873363,
"alnum_prop": 0.595040369088812,
"repo_name": "isislovecruft/txrecaptcha",
"id": "433fae93fed7838905f4093109ad4a9511a60011",
"siz... |
import requests
import xmltodict
try:
# python 3
from urllib.parse import urlparse, urlunparse, urlencode
except ImportError:
from urlparse import urlparse, urlunparse
from urllib import urlencode
from .error import ZillowError
from .place import Place
class ValuationApi(object):
"""
A pytho... | {
"content_hash": "46c9c1e1b61b6e5a14035d870c6e6037",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 207,
"avg_line_length": 41.385113268608414,
"alnum_prop": 0.6133875508289021,
"repo_name": "seme0021/python-zillow",
"id": "56dca5becc87e7178727798c741f664df47d5420",
"siz... |
"""
Created on Mon Mar 02 08:59:22 2015
@author: Konstantin
"""
import configparser, csv
from fabric.api import env, execute, task, parallel, sudo, run, put
import cuisine
@task
def update(package=None):
if package:
cuisine.package_update(package)
else:
sudo('apt-get -y --all... | {
"content_hash": "d13e8fa28ea8e996faa47407028eae9b",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 164,
"avg_line_length": 32.365671641791046,
"alnum_prop": 0.6117131657827992,
"repo_name": "icclab/vm-reliability-tester",
"id": "7927fe15e31e2e8cb7840b9c02218838fe35cfb4",
... |
"""
gpd_lite_toolboox setup file
"""
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
from Cython.Build import cythonize
import gpd_lite_toolbox
ext = Extension("gpd_lite_toolbox.cycartogram",
["gpd_lite_toolbox/cycartogram.pyx"], ["."]... | {
"content_hash": "59b7ddc04a3fe9c5f71b639470efc22a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 64,
"avg_line_length": 25.75,
"alnum_prop": 0.6925566343042071,
"repo_name": "mthh/gpd_lite_toolbox",
"id": "1e3c47b642946d55ea1e9237021104ac62cb6673",
"size": "642",
"bi... |
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='direct_logs',
type='direct')
severity = sys.argv[1] if len(sys.argv) > 1 else 'info'
message = ' '.join(sys.argv... | {
"content_hash": "c4152d4bef1078b6a0e2166f5f9bee45",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 63,
"avg_line_length": 31.41176470588235,
"alnum_prop": 0.6329588014981273,
"repo_name": "jefersonm/sandbox",
"id": "27e71c5f2aae560cde391090b4bb55d9d9c9dff5",
"size": "534... |
from selenium.webdriver import Remote
import nerodia
class Screenshot(object):
def __init__(self, browser):
if isinstance(browser, Remote):
nerodia.logger.deprecate('Initializing `Screenshot` with a `selenium.webdriver` '
'instance', 'a `nerodia.browser` ... | {
"content_hash": "be321fa0ac2c00a0247bc1ba564771ff",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 26.019607843137255,
"alnum_prop": 0.5621703089675961,
"repo_name": "lmtierney/watir-snake",
"id": "5f86eb38b1aa53288131bf3ffe4d022914b570f0",
"size":... |
import wolframalpha
import sys
from time import sleep
from Adafruit_CharLCDPlate import Adafruit_CharLCDPlate
# Initialize the LCD plate. Should auto-detect correct I2C bus. If not,
# pass '0' for early 256 MB Model B boards or '1' for all later versions
lcd = Adafruit_CharLCDPlate()
# Clear display and show greet... | {
"content_hash": "4d8eb6a39c6642b34cf60934aa2bded0",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 25.133333333333333,
"alnum_prop": 0.6861184792219275,
"repo_name": "stevenkword/PiCurious",
"id": "f69d8d070d83f4ec3ea754230944ea296f7daf99",
"size":... |
import track_common
class active_applications:
''' the data model which holds all application usage data for one
day. That is:
app_data: {app_id: application}
minutes: {i_min => [app_id], i_cat}
where
application: (i_secs, i_cat, s_title, s_process)
model_... | {
"content_hash": "62307df86441c6b1f913d8b77657fb17",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 86,
"avg_line_length": 31.315315315315317,
"alnum_prop": 0.48130034522439585,
"repo_name": "itf/track",
"id": "fd5ae9668941cf6765a6b3be28b0f598f7a410bb",
"size": "7000",
... |
import os
#Read barcode sequecnes from disk
barcode1 = open(snakemake.input["barcode1"]).readline().rstrip()
barcode2 = open(snakemake.input["barcode2"]).readline().rstrip()
#Construct the full i7 and i5 primer sequences
primer1 = "CTGTCTCTTATACACATCTCCGAGCCCACGAGAC" + barcode1 + "ATCTCGTATGCCGTCTTCTGCTTGAAAAAAAAAA"
... | {
"content_hash": "951ee0cf339ce1f5ee6cc75c3e1b66c1",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 96,
"avg_line_length": 44.4,
"alnum_prop": 0.7627627627627628,
"repo_name": "kauralasoo/Blood_ATAC",
"id": "3074ea2d431b2f91aa0221b65374a7808399ef01",
"size": "666",
"bin... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.append(os.path.abspath('.'))
# -- General configuration... | {
"content_hash": "dbb47197b67da74db310e549b6a8f7c1",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 101,
"avg_line_length": 33.149171270718234,
"alnum_prop": 0.7135,
"repo_name": "hugwijst/pocl",
"id": "367151e3d30971bd3571bad745096e4f2579491c",
"size": "6445",
"binary... |
from opbeat.instrumentation.packages.base import AbstractInstrumentedModule
from opbeat.traces import trace
from opbeat.utils import default_ports
from opbeat.utils.compat import urlparse
def get_host_from_url(url):
parsed_url = urlparse.urlparse(url)
host = parsed_url.hostname or " "
if (
parsed... | {
"content_hash": "339cd461c4c8b317c73f3b3991ae63a1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 27.973684210526315,
"alnum_prop": 0.6312323612417686,
"repo_name": "patrys/opbeat_python",
"id": "e94bff864d4a72351ce8097de68844bae0fb24bc",
"size": ... |
""" YES, oor no? """
import datetime
import os
import sys
import json
import logging
from urllib.request import urlopen
import tweepy
from device_detector import DeviceDetector
from jsondiff import diff
from flask import request
from flask import Flask, render_template, make_response
from google.cloud import storage
i... | {
"content_hash": "5c73093e854c42ce6d45c9c6457594f6",
"timestamp": "",
"source": "github",
"line_count": 612,
"max_line_length": 131,
"avg_line_length": 31.751633986928105,
"alnum_prop": 0.6044668587896254,
"repo_name": "martbhell/wasthereannhlgamelastnight",
"id": "4c103c7b068d1e0ad9e25ca4a8f8665609c... |
from CGvsPhoto import Model
# to change to your favorite database
database_path = '/work/smg/v-nicolas/level-design_raise_100_color/'
# database_path = '/work/smg/v-nicolas/face_DB_100_2/'
database_path = '/home/nicolas/Database/level-design_raise_100_color/'
# to change to the format of your image
image_size = 100
... | {
"content_hash": "4c8db4c87be8b0330aaef891258254ef",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 81,
"avg_line_length": 34.69565217391305,
"alnum_prop": 0.6704260651629073,
"repo_name": "NicoRahm/CGvsPhoto",
"id": "21f041fa621821ac955c4946927b4fc3e077ffbb",
"size": "79... |
import praw
import smtplib
import requests
import parsel
import re
import io
import json
import os
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from argparse import ArgumentParser
from premailer import Premailer
HEADERS = requests.utils.default_he... | {
"content_hash": "1b09c3b9ae258b3fbcca2dca61a609c8",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 117,
"avg_line_length": 36.35664335664335,
"alnum_prop": 0.597422581265628,
"repo_name": "thelostt/reddit-weekly",
"id": "98cc6d6a8f112861f00832568d7927409117c59f",
"size"... |
from file_util import *
import os
import re
import shutil
import string
import sys
import textwrap
import time
import itertools
import hashlib
class cef_api_hash:
""" CEF API hash calculator """
def __init__(self, headerdir, debugdir = None, verbose = False):
if headerdir is None or len(headerdir) ==... | {
"content_hash": "a4dbca3b179748d725516f302345c103",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 147,
"avg_line_length": 34.553719008264466,
"alnum_prop": 0.5287012676393207,
"repo_name": "denzp/cef3",
"id": "36c71010ac8aaae2458f66305ad5ed8ec07bd249",
"size": "8548",
... |
import os
from glob import glob
from ..templates.admin.updatehistory import selectfile, updatehistorysummary, updatehistoryspace
from ..templates.admin.updatedatabase import restoreprogress
import sqlite3
class UpdateHistory:
__dispatch__ = 'resource'
__resource__ = 'updatehistory'
def __init__(self, cont... | {
"content_hash": "cdc0601994e983b9c6e18cf1094d8817",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 143,
"avg_line_length": 44.93478260869565,
"alnum_prop": 0.6289308176100629,
"repo_name": "bmillham/djrq2",
"id": "f496e17dfa0a85324b686d23170127577a3b15ca",
"size": "2086"... |
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
class BaseViewTests(TestCase):
def test_shouldHideLoginAndSignup_AndHideLogout_WhenUserLoggedIn(self):
# Given
user = User.objects.create_user(username="someusername", password... | {
"content_hash": "6483068382fc6cdaebaccad96ca51dcc",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 114,
"avg_line_length": 39.964285714285715,
"alnum_prop": 0.5871313672922251,
"repo_name": "Aigrefin/py3learn",
"id": "485122dc8df141bb7fcc4ab48e5f004ef7e60860",
"size": "1... |
from linqy import utils
class Comparison(object):
def __init__(self, key):
self.key = key
def __eq__(self, other):
return self.key == other.key
def __ne__(self, other):
return self.key != other.key
def __lt__(self, other):
return self.key < other.key
def __le__(s... | {
"content_hash": "37c13f204549e6bbb7945994e2248663",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 42,
"avg_line_length": 22.741935483870968,
"alnum_prop": 0.5460992907801419,
"repo_name": "mashiro/linqy",
"id": "84facc067333e512991059f713e7dd3c5c4f24ab",
"size": "751",
... |
import logging
logging.basicConfig(level=logging.WARNING)
logger1 = logging.getLogger('package1.module1')
logger2 = logging.getLogger('package2.module2')
logger1.warning('This message comes from one module')
logger2.warning('This comes from another module')
| {
"content_hash": "558f341624141d0e80ec72c5586f329b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 26.2,
"alnum_prop": 0.7977099236641222,
"repo_name": "jasonwee/asus-rt-n14uhp-mrtg",
"id": "9770288675e97bb160d2d8670e325aeb95f60eab",
"size": "262",... |
import re
import numpy as np
from Orange.data import Table, Domain, DiscreteVariable
ANNOTATED_DATA_SIGNAL_NAME = "Data"
ANNOTATED_DATA_FEATURE_NAME = "Selected"
def _get_next_name(names, name):
"""
Returns next 'possible' attribute name. The name should not be duplicated
and is generated using name para... | {
"content_hash": "317df3351fa3c225c1eec9a96d053431",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 34.787234042553195,
"alnum_prop": 0.6593272171253822,
"repo_name": "cheral/orange3",
"id": "1f7d477d66e198f6b6705958fbc397ff8faa92fe",
"size": "1635"... |
#!/usr/bin/python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
import base64
import logging
import os
import threading
import struct
import time
import unittest
from vtdb import keyrange_constants
import env... | {
"content_hash": "393619bbb8b1ec425e726c84410bae27",
"timestamp": "",
"source": "github",
"line_count": 711,
"max_line_length": 185,
"avg_line_length": 43.479606188466946,
"alnum_prop": 0.6087856634534515,
"repo_name": "apmichaud/vitess-apm",
"id": "a6a4a27c338d72571b068f6989b675d110824e16",
"size"... |
import os
import platform
import subprocess
_ON_WINDOWS = (platform.system().lower() == 'windows')
def _determine_number_of_cpus():
"""
Number of virtual or physical CPUs on this system, i.e.
user/real as output by time(1) when called with an optimally scaling
userspace-only program
"""
# Py... | {
"content_hash": "d7931ee00eadcb25f33eb8fc7090afd1",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 86,
"avg_line_length": 23.114035087719298,
"alnum_prop": 0.5555977229601518,
"repo_name": "koborit/SpaceSwitcherSample",
"id": "c6d5323bdf59bcb2054805a716f2c6d062c9952e",
... |
"""Python Dataflow error classes."""
# pytype: skip-file
from __future__ import absolute_import
class BeamError(Exception):
"""Base class for all Beam errors."""
class PipelineError(BeamError):
"""An error in the pipeline object (e.g. a PValue not linked to it)."""
class PValueError(BeamError):
"""An erro... | {
"content_hash": "e5c67ce737c4214bc138b8b6411ba0ef",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 24.393939393939394,
"alnum_prop": 0.7192546583850932,
"repo_name": "iemejia/incubator-beam",
"id": "3165842e481a807c04c0bc0f56bad5b979e04f23",
"size"... |
import unittest
from pyrep.const import ObjectType
from tests.core import TestCore
from pyrep.objects.shape import Shape
from pyrep.objects.dummy import Dummy
from pyrep.objects.object import Object
from pyrep.objects.vision_sensor import VisionSensor
import numpy as np
class TestObjects(TestCore):
def setUp(s... | {
"content_hash": "84fa768e24a1de726d74807a6c49bfec",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 91,
"avg_line_length": 38.63192182410423,
"alnum_prop": 0.6398819561551433,
"repo_name": "stepjam/PyRep",
"id": "82ee444a4ad8bd2d9711366ed6eeaa100c4adc47",
"size": "11860"... |
from pygw.config import geowave_pkg
from ..statistic import FieldStatistic
from ..statistic_type import FieldStatisticType
from ...base import GeoWaveObject
from ...base.java_transformer import JavaTransformer
from ...base.type_conversions import PrimitiveDoubleArrayType, PrimitiveLongArrayType
class FixedBinNumericH... | {
"content_hash": "f41cf813d83e0337cd8a03142b3fb016",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 117,
"avg_line_length": 39.02272727272727,
"alnum_prop": 0.7052999417588818,
"repo_name": "ngageoint/geowave",
"id": "0e5ac059e7647d2e46592a3be0e32dc3affbd806",
"size": "39... |
'''
An "Always Approved" eauth interface to test against, not intended for
production use
'''
def auth(username, password):
'''
Authenticate!
'''
return True
| {
"content_hash": "9cb48f610c99856b1d7776dc7cc45f90",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 16,
"alnum_prop": 0.6534090909090909,
"repo_name": "MadeiraCloud/salt",
"id": "592b96beff434291e849c79b6cba3eafa24e9182",
"size": "200",
"binary": ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from aspen.simplates import pagination
#SPLIT TESTS
############
def check_page_content(raw, comp_pages):
'''
Pattern function. Splits a raw, then checks the nu... | {
"content_hash": "30dd212810076fcaa27246549be2c45a",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 114,
"avg_line_length": 27.44375,
"alnum_prop": 0.5953085857435664,
"repo_name": "jaraco/aspen",
"id": "e5c9e3c5da4e0f2a0f26c62dc46c9a167f7782ed",
"size": "4391",
"binar... |
"""Tests for Santa log parser."""
from __future__ import unicode_literals
import unittest
from plaso.parsers import santa
from tests.parsers import test_lib
class SantaUnitTest(test_lib.ParserTestCase):
"""Tests for Santa log parser."""
def testParse(self):
"""Tests the Parse function."""
parser = sa... | {
"content_hash": "8f577b33b7aa63a3ade0cc1043efe08c",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 80,
"avg_line_length": 36.95412844036697,
"alnum_prop": 0.7025819265143992,
"repo_name": "rgayon/plaso",
"id": "5739a76f60b8e6b599acca5a4e06bbb6dba2fa62",
"size": "4070",
... |
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.environment.adapters.indexentries import IndexEntries
from sphinx.writers.html5 import HTML5Translator
class DPYHTML5Translator(HTML5Translator):
def visit_section(self, node):
self.section_level += 1
self.body.append(
s... | {
"content_hash": "fadb6e43eb2444563d175754a61af8d5",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 100,
"avg_line_length": 39.22077922077922,
"alnum_prop": 0.6201986754966887,
"repo_name": "Harmon758/discord.py",
"id": "3f2b2594501946e4e3d507068315d676c49029f2",
"size": ... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os, sys, warnings
if six.PY3:
warnings.warn(
"The gtk* backends have not been tested with Python 3.x",
ImportWarning)
try:
import gobject
import gtk; gdk = gtk.g... | {
"content_hash": "029f69e28c18ebc08002681153b6a55b",
"timestamp": "",
"source": "github",
"line_count": 1031,
"max_line_length": 166,
"avg_line_length": 35.00581959262852,
"alnum_prop": 0.5684519686348397,
"repo_name": "louisLouL/pair_trading",
"id": "45dd67442611c27e8d55f87ded37abca63bba0b7",
"siz... |
from pyglfw.libapi import *
if __name__ == '__main__':
@GLFWkeyfun
def InputKey(window, key, scancode, action, mods):
print(window, key, scancode, action, mods)
def show_error(code, message):
print(code, message)
def _utf(obj):
if bytes is str:
return... | {
"content_hash": "36cdd6f8d7aaab243a6af5386ad806ef",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 74,
"avg_line_length": 26.261904761904763,
"alnum_prop": 0.5906618313689936,
"repo_name": "lhl/vrdev",
"id": "b758d56ca840fed4fd542b608a8b6d3fc0356beb",
"size": "2244",
"... |
from django.contrib import admin
from models import Page, TPage, Content, TContent
class PageAdmin(admin.ModelAdmin):
exclude = ['posted']
#fields = ['posted', 'title']
list_display = ('title', 'posted', 'slug')
prepopulated_fields = {'slug': ('title',)}
class TPageAdmin(admin.ModelAdmin):
list_di... | {
"content_hash": "e2cf98f5399395c996431fc021533d59",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 57,
"avg_line_length": 34.357142857142854,
"alnum_prop": 0.6704781704781705,
"repo_name": "vollov/isda.ca",
"id": "8fcddfaed81f00d794d68d4c51ff780007aa6a7b",
"size": "962",... |
"""Functions for computing Fleiss's kappa (𝜅), a measure of inter-annotator
agreement between several (more than 2) annotators."""
import numpy as np
def kappa(data):
"""Computes Fleiss's 𝜅 coefficient given a matrix of subject ratings.
The data must be an N x M matrix where N is the number of subject... | {
"content_hash": "0adeb392dd349d0bf6fbb4d8528f0131",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 80,
"avg_line_length": 37.074074074074076,
"alnum_prop": 0.623043623043623,
"repo_name": "zyocum/IAA",
"id": "36e225ef67f7f3d75fdd2ec7c01a54487a50007c",
"size": "3086",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('game', '0006_auto_20160214_2303'),
]
operations = [
migrations.AlterField(
model_name='room',
name='exits',
fiel... | {
"content_hash": "212499c67e79648d89ca0996e66ab68b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.5945273631840796,
"repo_name": "josh-perry/venture",
"id": "5b8467dfc1365003eaca7fa1d87529ff69f82603",
"size": "4... |
import os.path
from .. import bundle as bmod
from .common import fake_file_system
from nbx.tools import assert_items_equal
def wrap_bundles(td, cls):
bundles = ['second.ipynb', 'test.ipynb']
bundles = (cls(os.path.join(td, name)) for name in bundles)
bundles = {bundle.name: bundle for bundle in bundles}... | {
"content_hash": "f0b281088debfcd41c04ad1f60a5b5f0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 71,
"avg_line_length": 30.49122807017544,
"alnum_prop": 0.5627157652474108,
"repo_name": "dalejung/nbx",
"id": "5f3572c1fe6d2a127aa1528690c0eb22b66d87f2",
"size": "1738",
... |
from __future__ import division
from plugin import plugin
@plugin('timeconv')
class timeconv():
"""
timeconv Documentation.
timeconv is a time converter.
Supports: picosecond, nanosecond, microsecond, millisecond, second, minute, hour, day, week, month, year
Usage: The input time measurement units... | {
"content_hash": "c7c9e8a3c38524a988ae9ac16f147bba",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 108,
"avg_line_length": 27.711409395973153,
"alnum_prop": 0.5073867764591911,
"repo_name": "appi147/Jarvis",
"id": "1e05b9293268825101d49c9dc3e5f31f6c8ee235",
"size": "412... |
r"""
==========================================================
Create a new coordinate class (for the Sagittarius stream)
==========================================================
This document describes in detail how to subclass and define a custom spherical
coordinate frame, as discussed in :ref:`astropy:astropy-c... | {
"content_hash": "17299910f538dbdc0ddfc451b334dc06",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 98,
"avg_line_length": 43.82572614107884,
"alnum_prop": 0.6618064760462034,
"repo_name": "StuartLittlefair/astropy",
"id": "1c5724d4e121ecebcf258121e9d99c0299b3222f",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beekeepers', '0009_apiary_uniquetogether'),
]
operations = [
migrations.RemoveField(
model_name='usersurvey',
name='email',
... | {
"content_hash": "035779857b0a8963b779dcc5d70414b5",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 375,
"avg_line_length": 43.68421052631579,
"alnum_prop": 0.5967871485943775,
"repo_name": "project-icp/bee-pollinator-app",
"id": "c69fffbed9436cd38fc40e7db01713bb9d1f8401",
... |
from statistics import mean
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
import random
style.use('ggplot')
# xs = np.array([1, 2, 3, 4, 5], dtype=np.float64)
# ys = np.array([5, 4, 6, 5, 6], dtype=np.float64)
def create_dataset(hm, variance, step=2, correlation=False):
val = 1
... | {
"content_hash": "c119b50d90b4dab346f5b50c25476eae",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 73,
"avg_line_length": 30.42105263157895,
"alnum_prop": 0.6349480968858131,
"repo_name": "mtdx/ml-algorithms",
"id": "7fdbce9a682654f27bd37389fb4dd23c0401e24f",
"size": "17... |
import gdspy
import numpy as np
from phidl.geometry import (
Device,
DeviceReference,
_merge_floating_point_errors,
_parse_layer,
Polygon,
_offset_polygons_parallel,
)
import pp
def offset(
elements,
distance=0.1,
join_first=True,
precision=1e-4,
num_divisions=[1, 1],
... | {
"content_hash": "1dc6faaaedaa2021e1fda61c7a21065d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 68,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.5774225774225774,
"repo_name": "psiq/gdsfactory",
"id": "37ff66a5c6ee054eaa4d7276922c936a3c70f727",
"size": "2002... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'DMUserProfile.klass'
db.add_column('accounts_dmuserprofile', 'klass', self.gf('django.db.models.fi... | {
"content_hash": "10b7ad7c98736b3fa642533335141189",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 182,
"avg_line_length": 72.32323232323232,
"alnum_prop": 0.5409217877094972,
"repo_name": "team-xue/xue",
"id": "c960d22719c1000d0690814f0419c020628fdf2a",
"size": "7179",
... |
"""
WSGI config for biolabs project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "biolabs.settings")
from django.core.w... | {
"content_hash": "7671787a3cfe89781d9ec7f469e92c10",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7737789203084833,
"repo_name": "romgar/django-biolabs",
"id": "888a6242fdd03e96d5afeca86a61aea74eede2e7",
"size":... |
import re
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from horizon import tabs
from horizon.utils import memoized
from horizon import workflows
from openstack_dashboard ... | {
"content_hash": "e0d5d8cd2bcdef79bd184e7259c0150f",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 78,
"avg_line_length": 35.94871794871795,
"alnum_prop": 0.6136132056246179,
"repo_name": "AlexOugh/horizon",
"id": "947f619e4eb91d14b61c963c195c8d70a233581e",
"size": "104... |
__all__ = ['registry_status']
# http://blog.codepainters.com/2012/11/20/gevent-monkey-patching-versus-
# sniffer-nose/
# if 'threading' in sys.modules:
# raise Exception('threading module loaded before patching!')
import gevent.monkey
gevent.monkey.patch_all()
import socket
import sys
from . import storage
from ... | {
"content_hash": "9d0a15a3dff809c7cc93137c6e3bafaa",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 72,
"avg_line_length": 29.416666666666668,
"alnum_prop": 0.615675165250236,
"repo_name": "glenux/contrib-docker-registry",
"id": "01268671ae7d92c86a681beece80aed77305305c",
... |
import sys
import os
import pkg_resources
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.... | {
"content_hash": "d2b7ae2a25db6f77f038d2b614c7a6e9",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 80,
"avg_line_length": 31.027522935779817,
"alnum_prop": 0.7032328011038833,
"repo_name": "RUNDSP/luigi-swf",
"id": "83cf2569b0e7248eefb537d0b8b1e4dd47ab9b9e",
"size": "10... |
from bs4 import BeautifulSoup
class Reader:
def __init__(self):
self.file = open("qald_5.txt","r+")
content_temp = self.file.read()
self.content =content_temp.replace("\n"," ")
self.soup = BeautifulSoup(self.content)
self.file.close()
def get_parsed_queries(self):
triple = []
for question in self.soup... | {
"content_hash": "30773efe1fb83ebf13b6df697b399e0a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 49,
"avg_line_length": 25.8125,
"alnum_prop": 0.648910411622276,
"repo_name": "geraltofrivia/natural-language-queries-classification",
"id": "39643e0491da4309f81b622e72f73aeb... |
from setuptools import setup, find_packages
'''
Created on 2014/12/02
@author: user
'''
setup(
name='mona_gui_pool',
version='draft',
license='The MIT License (MIT)',
description='',
author="Muramasa. K. Fujiwara",
author_email='',
url='',
packages=find_packages(),
)
| {
"content_hash": "e9745ed6e6ddfc2571d4729eccab4361",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 43,
"avg_line_length": 17.764705882352942,
"alnum_prop": 0.6192052980132451,
"repo_name": "GitHub-of-Muramasa/mona-gui-pool",
"id": "59f9d296c7af5b7728a2f1678ff5c5e09c93afe6"... |
from collections import defaultdict
import kevlar
from kevlar.intervalforest import IntervalForest
import sys
def populate_index_from_bed(instream):
index = IntervalForest()
for line in instream:
if line.startswith('#') or line.strip() == '':
continue
values = line.strip().split()
... | {
"content_hash": "162409e0ac3cc0966fe0926ebc898f42",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 37.22857142857143,
"alnum_prop": 0.6193399846508059,
"repo_name": "dib-lab/kevlar",
"id": "1e25e9fe5e5a6d10fd19d9ca6f3d08ce0832a5f2",
"size": "2972",... |
from __future__ import absolute_import, division, print_function
from abc import ABCMeta, abstractproperty, abstractmethod
import numpy as np
from glue.external import six
from glue.core.exceptions import IncompatibleAttribute
from glue.core.layer_artist import MatplotlibLayerArtist, ChangedTrigger
__all__ = ['Hist... | {
"content_hash": "2a75a5cadb3c5d64445d4f201aebcc7e",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 84,
"avg_line_length": 30.091549295774648,
"alnum_prop": 0.5642405803884858,
"repo_name": "saimn/glue",
"id": "8b8231fea05d25661473edf27480de61f8522a2e",
"size": "4273",
... |
import unittest
from Src.BioAnalyzer.GenePrioritization.Steps.DifferentialAnalysis.Measurers.LocalBetaValueMeasurer import \
LocalBetaValueMeasurer
from Src.BioDataManagement.CrossCutting.DTOs.DnaMethylationLevelStatusDto import DnaMethylationLevelStatusDto
class LocalBetaValueMeasurerTest(unittest.TestCase):
... | {
"content_hash": "a69635234cbea2f56e303ba2347abc13",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 109,
"avg_line_length": 42,
"alnum_prop": 0.7387057387057387,
"repo_name": "cemarchi/biosphere",
"id": "03402433a5d38e19ea2fb166fc889a55de642348",
"size": "1638",
"binary... |
#!/usr/bin/python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of ... | {
"content_hash": "f4adf8c608483988da4c81d43dfe6023",
"timestamp": "",
"source": "github",
"line_count": 5052,
"max_line_length": 97,
"avg_line_length": 39.54117181314331,
"alnum_prop": 0.6374886114476227,
"repo_name": "vianuevm/cppStyle",
"id": "99403b8480a9ebdb72b00f87dcc5676b2df4c331",
"size": "2... |
"""Tests for `tanh.py`."""
from absl.testing import absltest
from absl.testing import parameterized
import chex
from distrax._src.bijectors import sigmoid
from distrax._src.bijectors import tanh
import jax
import jax.numpy as jnp
import numpy as np
from tensorflow_probability.substrates import jax as tfp
tfb = tfp.b... | {
"content_hash": "0dd7f8d0166cbd442a2dde319a047776",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 72,
"avg_line_length": 33.3109756097561,
"alnum_prop": 0.6749038989566173,
"repo_name": "deepmind/distrax",
"id": "2c049541284fa4332e77880cd717ed0563322aee",
"size": "6159... |
'''
Non-relativistic Unrestricted Kohn-Sham
'''
import numpy
from pyscf import lib
from pyscf.lib import logger
from pyscf.scf import uhf
from pyscf.dft import rks
def get_veff(ks, mol=None, dm=None, dm_last=0, vhf_last=0, hermi=1):
'''Coulomb + XC functional for UKS. See pyscf/dft/rks.py
:func:`get_veff` f... | {
"content_hash": "8c40878d6387372360e8c4a3d86d71e0",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 87,
"avg_line_length": 34.53757225433526,
"alnum_prop": 0.5834309623430962,
"repo_name": "sunqm/pyscf",
"id": "49fdf0c54feb18e447c16dce4e84202d6bc8d916",
"size": "6657",
... |
import os.path
import argparse
import subprocess
import json
from spinalcordtoolbox.utils.sys import printv
from spinalcordtoolbox.utils.fs import extract_fname
required_minc_cmdline_tools = ['mincinfo', 'minctoraw']
def console_log(message):
printv(message)
def cmd(command):
return subprocess.check_outpu... | {
"content_hash": "5f157f771a7f979d1f98fc639734cab6",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 133,
"avg_line_length": 30.455445544554454,
"alnum_prop": 0.6375162548764629,
"repo_name": "neuropoly/spinalcordtoolbox",
"id": "7cede09423b1435c3cc1fd7479f01bdabf2c7a05",
... |
import argparse
from dirbalak import describe
from dirbalak import discover
from dirbalak import cleanbuild
from dirbalak import setoperation
from dirbalak import repomirrorcache
from dirbalak import unreferencedlabels
from dirbalak import traverse
from dirbalak import scriptolog
from upseto import gitwrapper
import lo... | {
"content_hash": "129b0785c2b337081fb135758fc0a694",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 98,
"avg_line_length": 43.5632183908046,
"alnum_prop": 0.7295514511873351,
"repo_name": "Stratoscale/dirbalak",
"id": "749f82bcc692687850d892324100dcddf181ebf4",
"size": "... |
"""
Indexer.py
Calls tools.helpers.build_index()
"""
from tools import *
if __name__ == "__main__":
build_index()
| {
"content_hash": "5e1841d9dc608ee900a7c44d40967ee7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 33,
"avg_line_length": 12.1,
"alnum_prop": 0.5867768595041323,
"repo_name": "visualdensity/nltk-tools",
"id": "7db3ced192820977fd8134c598c2d2dcd8118617",
"size": "162",
"... |
from YSeq import YSeq
from YRules import YRules
from YConstants import YConstants
class YDNA(YSeq):
"""
En: This class represents a DNA sequence
Ru: Данный класс инкапсулирует последовательность ДНК
"""
__list_of_nucleotides = ['A', 'T', 'C', 'G', '_']
def __init__(self, dna_sequence):
... | {
"content_hash": "0dee2da3902d25302e0f013e5b2b0bff",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 83,
"avg_line_length": 28.907894736842106,
"alnum_prop": 0.5653163404642695,
"repo_name": "YuriShporhun/YBio",
"id": "7066a1413162500a584a9d10fbb122e89eb7dffa",
"size": "23... |
import py.path
from _pytest.config import Config, PytestPluginManager, default_plugins
try:
# pytest >= 3.4
from _pytest.nodes import FSCollector
except ImportError:
# pytest < 3.4
from _pytest.main import FSCollector
class GraftedSubSession(FSCollector):
"""
Collects test files from outside ... | {
"content_hash": "ff72c8243843901539c2626113172dc2",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 90,
"avg_line_length": 31.18867924528302,
"alnum_prop": 0.6530550514216575,
"repo_name": "elliterate/capybara.py",
"id": "7383250699e1eb24ab87b2c4be7626eb97e8c7f9",
"size"... |
def extractTurtleandHareTranslations(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'Time (对的时间对的人)' in item['title'] or 'Time (对的时间对的人)' in item['tags']:
return buildReleaseMessageWithT... | {
"content_hash": "896a10f52c458081f3feb051d923d556",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 88,
"avg_line_length": 39,
"alnum_prop": 0.7128205128205128,
"repo_name": "fake-name/ReadableWebProxy",
"id": "bd12e98c410c563abd7e8f5a4791149fbba66a9a",
"size": "418",
"... |
"""Python Stub implementation of tiger"""
from concurrent import futures
import time
from subprocess import Popen, PIPE
import grpc
from tiger import cart_pb2, cart_pb2_grpc
from tiger import search_pb2, search_pb2_grpc
_ONE_DAY_IN_SECONDS = 60 * 60 * 24
class CartManager(cart_pb2_grpc.CartManagerServicer):
... | {
"content_hash": "48236b578e245da95fef3b1c737c1357",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 82,
"avg_line_length": 23.974025974025974,
"alnum_prop": 0.6598049837486457,
"repo_name": "dillonhicks/gotham",
"id": "3157dab3b9e594ac3bce3c5f3286a6ee7008420f",
"size": "1... |
import amsoil.core.pluginmanager as pm
import amsoil.core.log
logger=amsoil.core.log.getLogger('dhcpgeniv3delegate')
GENIv3DelegateBase = pm.getService('geniv3delegatebase')
geni_ex = pm.getService('geniv3exceptions')
dhcp_ex = pm.getService('dhcpexceptions')
class DHCPGENI3Delegate(GENIv3DelegateBase):
"""
"... | {
"content_hash": "c656c626f18fbd4d414b66735a7a4ab7",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 151,
"avg_line_length": 53.02575107296137,
"alnum_prop": 0.6246054229057062,
"repo_name": "motine/Ohouse",
"id": "2f0a46db075b59a0058566161f2cbdb453030916",
"size": "12356... |
"""Tests for field serialization."""
from collections import namedtuple, OrderedDict
import datetime as dt
import itertools
import decimal
import uuid
import ipaddress
import math
import pytest
from marshmallow import Schema, fields, missing as missing_
from tests.base import User, ALL_FIELDS, central, GenderEnum, H... | {
"content_hash": "14fafe865a1f21eda2f9eb8eb1a41322",
"timestamp": "",
"source": "github",
"line_count": 1014,
"max_line_length": 128,
"avg_line_length": 37.37376725838264,
"alnum_prop": 0.6115259783096287,
"repo_name": "mwstobo/marshmallow",
"id": "51671ddf6e4e405209c5ad9ca61db3c32917075e",
"size":... |
class DjangoShardingException(Exception):
pass
class ShardedModelInitializationException(DjangoShardingException):
pass
class InvalidMigrationException(DjangoShardingException):
pass
class NonExistentDatabaseException(DjangoShardingException):
pass
| {
"content_hash": "cade2e0c620bddb08265deaa81d70a2d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 19.357142857142858,
"alnum_prop": 0.8302583025830258,
"repo_name": "jwadden/django-sharding",
"id": "2121883028e8271bef8b096974b5d1e145c7c9a0",
"size... |
"""These are job parameters that are common to every type of Jenkins job.
Example:
.. literalinclude:: /../../tests/yamlparser/fixtures/general-example-001.yaml
:Job Parameters:
* **project-type**:
Defaults to "freestyle", but "maven" as well as "multijob" or "flow"
can also be specified.
* **d... | {
"content_hash": "74f6e73dba8ed5f7e2445da34bec1f3f",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 41.53378378378378,
"alnum_prop": 0.6198145436798438,
"repo_name": "therootcause/jenkins-job-builder",
"id": "e3c694e8f5f8fa4c45121722648d79aa20c10a9b"... |
import re
import struct
try:
exec("from . import png", globals(), locals())
except (SyntaxError, ValueError):
# On Python < 2.5 relative import cause syntax error
# Also works when running outside of package
import png
def pdskey(s, k):
"""
Lookup key `k` in string `s`.
Returns value (as ... | {
"content_hash": "e79723fbfb88e3e44f8c276b0f270b22",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 78,
"avg_line_length": 29.574074074074073,
"alnum_prop": 0.5848465873512837,
"repo_name": "Scondo/purepng",
"id": "bd460a6502393d8e8446d055d4f51125dd636c64",
"size": "3252... |
"""
Quicksort is a divide and conquer algorithm which relies on a partition
operation: to partition an array an element called a pivot is selected. All
elements smaller than the pivot are moved before it and all greater elements are
moved after it. This can be done efficiently in linear time and in-place. The
lesser an... | {
"content_hash": "07c2f66ceaba290c972db1dc1179b66c",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 87,
"avg_line_length": 35.33783783783784,
"alnum_prop": 0.7204588910133843,
"repo_name": "rahulnadella/Sort_Algorithms",
"id": "aac9d53b1ef029fea07b604e1b63adb353d98f4c",
"... |
import sys
import warnings
from django.core.mail import mail_admins
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = '[DEPRECATED] Send args as a one-shot email to the admins.'
def add_arguments(self, parser):
parser.add_argument(
'message',
... | {
"content_hash": "346992776772a9a569ddcd95728348ed",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 112,
"avg_line_length": 34.371428571428574,
"alnum_prop": 0.6118038237738986,
"repo_name": "dimagi/commcare-hq",
"id": "7a07db1fa5526598af64d4216e1a2b0b72791e4b",
"size": "... |
from .commands.general import (Author, Uptime)
from .commands.sc2cm import (Top, Player, ClanWar)
from .commands import help as help_command
from .commands.teamliquid import TeamLiquidFeed
# Configuration for AlphaGG
# Auth token
BOT_TOKEN = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
COMMAND_PREFI... | {
"content_hash": "8ec5b391c127e6c2e504d3bd82715666",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 73,
"avg_line_length": 21.545454545454547,
"alnum_prop": 0.7489451476793249,
"repo_name": "pundurs/alpha-gg",
"id": "1fbbabdd556042bb743817a69521630ef15d22c1",
"size": "493... |
from __future__ import absolute_import, division, print_function
import re
import pytest
import responses
import dosagelib.cmd
import httpmocks
def cmd(*options):
"""'Fake' run dosage with given options."""
assert dosagelib.cmd.main(("--allow-multiple",) + options) == 0
@pytest.mark.usefixtures("nosleep"... | {
"content_hash": "b674ce607b6d619a8e44a2ac60696a0b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 26.862068965517242,
"alnum_prop": 0.6649550706033376,
"repo_name": "peterjanes/dosage",
"id": "4cadf8ed7a0a0f6cbf470c7bc6e3872f3a989a80",
"size": "84... |
from __future__ import absolute_import
from distutils import log
from distutils.command.upload import upload as _upload
from pkg_resources import iter_entry_points
class BundleCommand(_upload):
user_options = _upload.user_options + [
# - from 'register'
("strict", None,
"Will stop if th... | {
"content_hash": "d0ae40fe4a923c836a9a673ce1f40c64",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 77,
"avg_line_length": 31.89189189189189,
"alnum_prop": 0.5991525423728814,
"repo_name": "ask/bundle",
"id": "93c9ad5c96e2d897a0c11b472a5e51bbfd5ca95a",
"size": "2360",
"... |
from scipy.io.wavfile import read
from scipy.fftpack import fft,ifft,dct
from scipy.signal import get_window
import numpy as np
from pdb import set_trace
from os.path import join,split
from glob import glob
from SignalProcessor import Signal
# linear scale to mel scale
def mel_scale(f):
return 1127.0 * np.log(1 + ... | {
"content_hash": "105db048c07304646a2a32d8dc9b849b",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 134,
"avg_line_length": 30.881481481481483,
"alnum_prop": 0.6013432477812425,
"repo_name": "RockmanZheng/Digital-Speech-Recognizer",
"id": "eed4717d8af84864c88b6f6d5aed8b46d... |
__author__ = 'charlie'
import numpy as np
import os, sys, inspect
import random
from six.moves import cPickle as pickle
from tensorflow.python.platform import gfile
import glob
utils_path = os.path.abspath(
os.path.realpath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0], "..")))
if utils_pa... | {
"content_hash": "7bee7e1ebfbef4e7256e0182c536a996",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 106,
"avg_line_length": 36.705357142857146,
"alnum_prop": 0.6521527608854293,
"repo_name": "kunrenzhilu/GAN",
"id": "67c09292a3dbfc94b9a6914c75104a41144732fa",
"size": "41... |
import MySQLdb
import functools
from .config import (
db,
)
def memoize(obj):
cache = obj.cache = {}
@functools.wraps(obj)
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in cache:
cache[key] = obj(*args, **kwargs)
retur... | {
"content_hash": "e6ef5730484735246e115fef76d78fc3",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 152,
"avg_line_length": 29.197802197802197,
"alnum_prop": 0.625705683101242,
"repo_name": "alekslt/powerusageanalysis",
"id": "7b30b10992d8395d62d20a126d11e73411781d7c",
"... |
from bs4 import BeautifulSoup
import urllib
from scraper import *
import re, json
class Galaxy(Scraper):
def get_planets(self, galaxy, system):
"""
Get planets in the given galaxy and system
"""
self.logger.info('Getting data from system %s:%s' % (galaxy, system))
url = sel... | {
"content_hash": "532ed3fce643bc87115a82bfe32e9de2",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 111,
"avg_line_length": 37.95049504950495,
"alnum_prop": 0.5554396034437777,
"repo_name": "yosh778/OG-Bot",
"id": "e7ea2c097185d8d2da655642947e994638c25901",
"size": "3833... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_web_proxy_debug_url
except ImportError:
... | {
"content_hash": "5e99ad24d2313567a32973bf250574f7",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 142,
"avg_line_length": 36.201877934272304,
"alnum_prop": 0.6285825444170665,
"repo_name": "thaim/ansible",
"id": "75247b23a9c3c7ad9f2886c6c4b163d125e3d82e",
"size": "8407... |
"""Unit tests for abc.py."""
import unittest
import abc
import _py_abc
from inspect import isabstract
def test_factory(abc_ABCMeta, abc_get_cache_token):
class TestLegacyAPI(unittest.TestCase):
def test_abstractproperty_basics(self):
@abc.abstractproperty
def foo(self): pass
... | {
"content_hash": "af423a72d6bdfb95bed488179ab2c94a",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 93,
"avg_line_length": 34.8600583090379,
"alnum_prop": 0.49284937693401354,
"repo_name": "brython-dev/brython",
"id": "1e7a0351db489d13c9577b42229b6aa239bcfbf6",
"size": "... |
import bz2, json, importScheduledMonuments, os, web
import poidatabase
import xml.parsers.expat
if __name__=="__main__":
curdir = os.path.dirname(__file__)
db = web.database(dbn='sqlite', db=os.path.join(curdir, 'data.db'))
t = db.transaction()
inFi = bz2.BZ2File("LB.kml.bz2", "r")
dbInt = poidatabase.DbInt(db... | {
"content_hash": "d406f6bfb7e1d402a5639c4abd13bb5b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 69,
"avg_line_length": 21.03846153846154,
"alnum_prop": 0.6837294332723949,
"repo_name": "TimSC/POIware-server",
"id": "573bd6733cc26068d95df908cb1eb5390fb52567",
"size": "... |
"""Test for the sqlite3 data connector."""
from unittest import TestCase
from tests.dc.test import AbstractDCTest
from tests.dc.query_manager import AbstractQMTest
from dc.yaml.connector import YAMLConnector
class DCTest(AbstractDCTest, AbstractQMTest, TestCase):
name = "yaml"
connector = YAMLConnector
| {
"content_hash": "518c3e214496f6a473b34b2dce926820",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7879746835443038,
"repo_name": "v-legoff/pa-poc3",
"id": "6f8e875b7b545f487e9fd0aa0d26cd3040af6452",
"size": "185... |
people = 30
cars = 40
buses = 15
if cars > people:
print "We should take the cars."
elif cars <people:
print "We should not take the cars."
else:
print "We can't bloody decide!"
if buses > cars:
print "That's too many buses!"
elif buses < cars:
print "Maybe we could take the buses."
else:
print "We still ... | {
"content_hash": "00eff846a18dd5930622a787d4d73e87",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 45,
"avg_line_length": 20.90909090909091,
"alnum_prop": 0.6782608695652174,
"repo_name": "nchristiny/python",
"id": "c3c4c4753f8afbe8f0c861b34204a29470ffa515",
"size": "460... |
"""Sample file configuration for celery_app worker
This file is intended only for a sample.
Please copy it as celeryconfig.py so it can be read
"""
import os
__copyright__ = "Copyright 2018, The InaSAFE Project"
__license__ = "GPL version 3"
__email__ = "[email protected]"
__revision__ = '$Format:%H$'
broker_url = ... | {
"content_hash": "b81fa6ef6490cc5247fbda4f853629c3",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 80,
"avg_line_length": 31.434782608695652,
"alnum_prop": 0.7076994006454588,
"repo_name": "AIFDR/inasafe-django",
"id": "2e6e312309eb0a4864742924ae3078fc3427d479",
"size": ... |
import sys
from PyQt5.QtCore import Qt, QVariant
from PyQt5.QtGui import QStandardItemModel, QStandardItem
from PyQt5.QtWidgets import QApplication, QTreeView
if __name__ == '__main__':
app = QApplication(sys.argv)
tree_view = QTreeView()
###
model = QStandardItemModel(None)
row1 = [QStandardI... | {
"content_hash": "393a39facc51b62b1dc43f79d660f8b6",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 123,
"avg_line_length": 31.048780487804876,
"alnum_prop": 0.6684996072270227,
"repo_name": "jeremiedecock/snippets",
"id": "1fe0429f7b33f2b9167e026f9d8849571aabb5be",
"size... |
"""UniFi Controller abstraction."""
import asyncio
import async_timeout
from aiohttp import CookieJar
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
from homeassistant.helpers import aiohttp_client
from .const import CONF_CONTROLLER, CONF_POE_CONTROL, LOGGER
from .errors import A... | {
"content_hash": "da3228348c8d4fcf075cbd0ed669914a",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 79,
"avg_line_length": 32.274809160305345,
"alnum_prop": 0.619678334910123,
"repo_name": "PetePriority/home-assistant",
"id": "11529cbe171abb420ce6d37bf149a0369238be5c",
"... |
import glob
import os
from PyQt4 import QtCore, QtGui
from bmconfigparser import BMConfigParser
import paths
class LanguageBox(QtGui.QComboBox):
languageName = {"system": "System Settings", "eo": "Esperanto", "en_pirate": "Pirate English"}
def __init__(self, parent = None):
super(QtGui.QComboBox, self... | {
"content_hash": "5b9cf0dd23df79e3d7b2477697e1dcd7",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 107,
"avg_line_length": 42.71052631578947,
"alnum_prop": 0.6315465187923598,
"repo_name": "hb9kns/PyBitmessage",
"id": "552e0350449b4f40aaa58b2b983a7ad297ddd766",
"size": "... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "1c785e6591b15df7a1004711efd0595a",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 638,
"avg_line_length": 32.86854460093897,
"alnum_prop": 0.6851878303099557,
"repo_name": "AlgorithmLover/OJCodes",
"id": "30dc4ee852e3225b46969ad7e45b11d6d2735686",
"size... |
import json
import os
import hashlib
import rinocloud
CHUNK_SIZE = 6 * 1024 * 1024
class Object(object):
def __init__(self, **kw):
"""
Initialise a bunch of variables
"""
# these are some rinocloud variables we dont mind showing to the users
self.id = None
self.c... | {
"content_hash": "e26d76676790a146d6df1e5dffbe46a0",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 119,
"avg_line_length": 33.30705394190871,
"alnum_prop": 0.5751837548274573,
"repo_name": "rinocloud/rinocloud-python",
"id": "892dd658dfffb0799dfed9b447e082aac7913f2c",
"... |
from sqlalchemy import Table, Column, Integer, String, BigInteger, Boolean, ForeignKeyConstraint
from cassiopeia.data import Platform
from cassiopeia.dto.spectator import CurrentGameInfoDto
from cassiopeia.dto.common import DtoObject
from .common import metadata, SQLBaseObject, map_object, foreignkey_options
class ... | {
"content_hash": "bc10f88eb984b9b2d6e27ea016ee8696",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 114,
"avg_line_length": 39.472527472527474,
"alnum_prop": 0.5807349665924276,
"repo_name": "meraki-analytics/cassiopeia-datastores",
"id": "943addc0d0b92b2ef3dba7cda8a15daa2d... |
'''
Created on May 20, 2013
@author: aryaveer
'''
from django import forms
import pickle
from django.forms.util import ErrorList
from django.utils import timezone
from django.forms import widgets
from utils.archives import Archive
from utils.filetypes import is_valid, VALID_EXTENSIONS_COMPILERS, VALID_EXTENSIONS_INTER... | {
"content_hash": "a64e4d9b4b3ac9f062bc77000d0d4e01",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 208,
"avg_line_length": 50.23380726698262,
"alnum_prop": 0.5727089754072583,
"repo_name": "kartikshah1/Test",
"id": "a694efb411a9a29e12bde8f04d639d1e6f56b4ca",
"size": "31... |
import csv
import os
"""
Parsing model sate output file to csv with following headers:
doc source pos typeindex type topic
"""
fread = open("out-state", "r+")
fwrite = open("out-state.csv", "w+")
# writer = csv.writer(fwrite, delimiter = ',', quotechar = '"')
str = fread.readline()
str = ','.join(str.replace("#", ""... | {
"content_hash": "5ba64b210879531f761fa7d17e1f1b02",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 64,
"avg_line_length": 20.92,
"alnum_prop": 0.6367112810707457,
"repo_name": "satybald/twitter-modeling-lda",
"id": "66ed270fce2ce32315ff6cddf2efc0f1d316e024",
"size": "523... |
from django.urls import path
from django_cradmin.apps.cradmin_register_account.views import register_account
urlpatterns = [
path('',
register_account.RegisterAccountView.as_view(),
name="cradmin-register-account"),
]
| {
"content_hash": "d55f6b037e17c44004a16d6bcfc5ead6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 79,
"avg_line_length": 30.125,
"alnum_prop": 0.7219917012448133,
"repo_name": "appressoas/django_cradmin",
"id": "2967c93a59d62969ff829872f978c9d2ebcedf9f",
"size": "241",
... |
from django import forms
from django.conf import settings
from flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
from ckeditor_uploader.widgets import CKEditorUploadingWidget
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100,... | {
"content_hash": "5a89a9a66ad244919fcc8f672a6c5e45",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 94,
"avg_line_length": 37.08888888888889,
"alnum_prop": 0.597363690832834,
"repo_name": "rit-sailing/website",
"id": "e52a4def019226ffc17c882db0d892333b65df54",
"size": "16... |
from selenium.webdriver.common.by import By
class LearningCircleCreationPageLocators(object):
FIRST_COURSE_BUTTON = (By.CSS_SELECTOR, ".course:nth-child(1) a.btn:nth-child(2)")
FIRST_COURSE_TITLE = (By.CSS_SELECTOR, ".course:nth-child(1) .card-title")
REMOVE_COURSE_SELECTION_LINK = (By.LINK_TEXT, "Remove s... | {
"content_hash": "76020ec8ea7bc121761008e6a7eeaee8",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 86,
"avg_line_length": 53.50877192982456,
"alnum_prop": 0.6675409836065573,
"repo_name": "p2pu/learning-circles",
"id": "f1fb574c988346213de0a240e5394ef31fad90bb",
"size": ... |
import unittest
from brew.utilities.efficiency import calculate_brew_house_yield
from fixtures import recipe
class TestEfficiencyUtilities(unittest.TestCase):
def setUp(self):
self.recipe = recipe
def test_calculate_brew_house_yield(self):
out = calculate_brew_house_yield(
recipe... | {
"content_hash": "72065142e4e727777da862cbe4057259",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 30,
"alnum_prop": 0.7111111111111111,
"repo_name": "chrisgilmerproj/brewday",
"id": "bd3169b772ecbfacb4278241d9c69a39bfe57166",
"size": "474",
"bin... |
"""
Created on Wed Aug 28 11:04:48 2013
@author: Craig
"""
# standard modules
import os.path
import logging
import zipfile
from zipfile import ZipFile
# site modules
from boto.s3.connection import S3Connection
from boto.s3.key import Key as S3Key
# local modules
# CONSTANTS
class S3access(object):
def __init... | {
"content_hash": "d7301cccd6a498f304779941b6a770c0",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 27.64864864864865,
"alnum_prop": 0.5498533724340176,
"repo_name": "SkyTruth/scraper",
"id": "88789d8043667d2bf70d9998c0904a43c14736ef",
"size": "2070... |
"""Contains private utilities used mainly by the base Layer class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
from tensorflow.python import tf2
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.p... | {
"content_hash": "e2ae5a6b203ba1a5ddf7ac348b0d7972",
"timestamp": "",
"source": "github",
"line_count": 781,
"max_line_length": 106,
"avg_line_length": 37.26888604353393,
"alnum_prop": 0.6844401690315044,
"repo_name": "jhseu/tensorflow",
"id": "fc5c851426ca40f436dd5fcb70ff7d6a1efcdbe9",
"size": "29... |
import os
from flask import Flask, render_template, request
from BSParser import wiki
app = Flask(__name__)
@app.route('/', methods=["GET", "POST"])
def login_page():
try:
if request.method == "POST":
page = request.form['page']
return wiki(page)
else:
error = ... | {
"content_hash": "c20f68555cc728c20caee8e1edc0b70e",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.5809859154929577,
"repo_name": "jack-cast/HackPrinceton",
"id": "f47fcaaf5296bf474b28242615c0221443aa0e88",
"size... |
"""
Get a notification ``email`` flavour
"""
# @mark.steps
# ----------------------------------------------------------------------------
# STEPS:
# ----------------------------------------------------------------------------
from behave import when, then
from ipteller.mailer import Mailer
@when('I want to send an e... | {
"content_hash": "b0b1821b2b10ac7478d431381db2841d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 102,
"avg_line_length": 31.91304347826087,
"alnum_prop": 0.5449591280653951,
"repo_name": "Saphyel/ipteller",
"id": "8be5d82bebe4502a924e2615e0864175ba1440ea",
"size": "734... |
from __future__ import with_statement
import os
from os import getcwd, chdir
from os.path import join, exists, dirname
from warnings import warn
import atexit
from logging import getLogger
from threading import Lock
logger = getLogger('pystacia.api')
def dll_template(osname, abi):
if osname == 'macos':
... | {
"content_hash": "1e57f7b70bfd5be4750bce8fc8aabd3a",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 78,
"avg_line_length": 26.95798319327731,
"alnum_prop": 0.5743453865336658,
"repo_name": "squeaky-pl/pystacia",
"id": "dca33982ff8934badf09f13de4dde70d5dcd15e9",
"size": "... |
from __future__ import print_function
import argparse
import collections
import os
import shutil
import subprocess
import sys
import tempfile
from oslo_utils import fileutils
import os_client_config
import pkg_resources as pkg
import six
import yaml
from sahara_tests.scenario import utils
from sahara_tests.scenario i... | {
"content_hash": "9230d49c24c2f78b71f498d29a07bd30",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 79,
"avg_line_length": 36.475935828877006,
"alnum_prop": 0.5874505204515467,
"repo_name": "openstack/sahara-scenario",
"id": "a9ffa745e17a8bc3ca08658a88ca784192562ebb",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.