text stringlengths 4 1.02M | meta dict |
|---|---|
import threading
import time
from datetime import datetime
from ginga.misc import Bunch, Datasrc, Callback, Future
class ChannelError(Exception):
pass
class Channel(Callback.Callbacks):
"""Class to manage a channel.
Parameters
----------
name : str
Name of the channel.
fv : `~ginga.... | {
"content_hash": "817c9c6c605b84cb6cf304b4166676c6",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 80,
"avg_line_length": 32.959715639810426,
"alnum_prop": 0.5413041915306636,
"repo_name": "stscieisenhamer/ginga",
"id": "f1c79a9fd38ed446cddfa861ef40f5b43086dfcb",
"size"... |
"""This file contains the USBStor keys plugins."""
import logging
from plaso.events import windows_events
from plaso.lib import eventdata
from plaso.parsers import winreg
from plaso.parsers.winreg_plugins import interface
__author__ = 'David Nides (david.nides@gmail.com)'
class USBStorPlugin(interface.KeyPlugin):... | {
"content_hash": "4d9141345f28c2489439d973bb3bd9e6",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 38.69724770642202,
"alnum_prop": 0.6645329540066383,
"repo_name": "cvandeplas/plaso",
"id": "1fc820277d981bb9c586ad116d0e0dc082d6c0a9",
"size": "491... |
import os
import tempfile
import collections
try: # pragma: no cover
from collections import OrderedDict # NOQA
except ImportError: # pragma: no cover
from ordereddict import OrderedDict # NOQA
import six
from six.moves import configparser
try: # pragma: no cover
from urllib import urlretrieve # NOQA... | {
"content_hash": "843c7b3165762aefffd3a7af7c04bd91",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 118,
"avg_line_length": 32.9051724137931,
"alnum_prop": 0.5939219282158763,
"repo_name": "domenkozar/mr.bob",
"id": "17b0750116d04a24c76ce5f0a0ce34d63706d602",
"size": "38... |
import collections
import sys
import json
import psycopg2
def organizer(funkcja, pelnaLinia):
"""make new admin"""
if pelnaLinia[funkcja]["secret"] == "d8578edf8458ce06fbc5bb76a58c5ca4":
try:
cur = conn.cursor()
cur.execute("""SELECT count(*) from con_user where login = '{0}' ... | {
"content_hash": "6e3663676af54024a942ffa97826eff2",
"timestamp": "",
"source": "github",
"line_count": 1152,
"max_line_length": 113,
"avg_line_length": 32.146701388888886,
"alnum_prop": 0.46150730429616826,
"repo_name": "iCarrrot/Current_university",
"id": "139dd5a12fadd3f287f628f43fbfe11c9ff33d76",... |
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regularization parameter.
"""
p... | {
"content_hash": "53c4fff32ccb99f436b3d70807c30d64",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 26.307692307692307,
"alnum_prop": 0.702729044834308,
"repo_name": "bnaul/scikit-learn",
"id": "06d4c94bbed70501c7051d5a4513e1e24e9ae5e4",
"size": "10... |
import os
import subprocess
number_of_subjects = 5
subjects_data = [filename.split('.')[0].split('_') for filename in os.listdir('corpora/RAVDESS') if filename.endswith('.wav')]
dummy_files = ["should_be_ignored.txt"]
for id, emotion, scenario, repitition in subjects_data:
subject_number = int(id[len('RAVDESS')... | {
"content_hash": "a94d8fa467fe6c40ad9d381c51d7e079",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 126,
"avg_line_length": 34.9,
"alnum_prop": 0.6762177650429799,
"repo_name": "coopie/lazychef",
"id": "0f8b559b928d23b7d409ded00ed6932e085b5b67",
"size": "698",
"binary":... |
from save_beer import save_beer
from lookup_beer import lookup_beer | {
"content_hash": "59d8c18dd9e315883a3b88e85ac79808",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 35,
"avg_line_length": 33.5,
"alnum_prop": 0.835820895522388,
"repo_name": "stormpython/brewmaster",
"id": "38b3dd136911f4288f1b4dc88054c2215fd8b97a",
"size": "67",
"binar... |
from msrest.serialization import Model
class TemplateLink(Model):
"""
Entity representing the reference to the template.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar uri: URI referencing the template. Default value:
"https://azuresdkci.blob.c... | {
"content_hash": "25262f6bb3c383471015fbedda16841c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 111,
"avg_line_length": 31,
"alnum_prop": 0.6602822580645161,
"repo_name": "BurtBiel/azure-cli",
"id": "859cb6718b5276db510b491f8a654b963a91e324",
"size": "1680",
"binary... |
from itertools import count
__author__ = 'litleleprikon'
import json
class FrequencyCounter:
def __init__(self):
self.letters = {}
self.sorted = None
def count_from_file(self, file_name):
with open(file_name) as file:
self.count(file.read())
def add(self, letter):
... | {
"content_hash": "5345fb113faa2caebd122f9481aa6ee5",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 65,
"avg_line_length": 22.796296296296298,
"alnum_prop": 0.5767668562144598,
"repo_name": "litleleprikon/information_security_labs",
"id": "8f2aed8a51408e7fac0b0651ea7034ddfc... |
from django import template
register=template.Library()
@register.filter
def autowidth(lst, total=100.0):
if hasattr(lst, '__len__'): lst=lst.__len__()
if not isinstance(lst, float): lst=float(lst)
if lst<1: lst=1
return round(total/lst, 1)
| {
"content_hash": "43a5a50804c1d0fc7c2f0466fe58402f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 28.22222222222222,
"alnum_prop": 0.6811023622047244,
"repo_name": "kensonman/webframe",
"id": "237ba8a204e1a51da828b2ee48f009a44ba429a6",
"size": "254... |
import _plotly_utils.basevalidators
class YpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="ypad", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(YpadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | {
"content_hash": "86c4791589ed283d4f39574343639277",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 83,
"avg_line_length": 33.86666666666667,
"alnum_prop": 0.5846456692913385,
"repo_name": "plotly/python-api",
"id": "f2f9d76e9e4deb26f94bbe531ffe4300778ac0c6",
"size": "508... |
"""
On the long term this will implement several methods to make videos
out of VideoClips
"""
import subprocess as sp
import os
import numpy as np
try:
from subprocess import DEVNULL # py3k
except ImportError:
DEVNULL = open(os.devnull, 'wb')
from moviepy.config import get_setting
from moviepy.tools import ... | {
"content_hash": "58f580a2b20f2152a4196a599065242e",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 90,
"avg_line_length": 32.85660377358491,
"alnum_prop": 0.5457677730561618,
"repo_name": "jonathanlurie/timelapseComposer",
"id": "948a355efb82d792e348ddf00c97b2d3efdd4219",... |
from __future__ import unicode_literals
from .models import elbv2_backends
from ..core.models import base_decorator
elb_backend = elbv2_backends["us-east-1"]
mock_elbv2 = base_decorator(elbv2_backends)
| {
"content_hash": "9db1738d0b8568b1830e99b3343fdde8",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 43,
"avg_line_length": 33.833333333333336,
"alnum_prop": 0.7783251231527094,
"repo_name": "william-richard/moto",
"id": "61c4a37ff9dda5a345b7096e1773480ca0947980",
"size": "... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
while True:
pin = int(input("pin"))
state = int(input("state"))
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, state)
| {
"content_hash": "93fe5329338f95a4fe4b4d33f98db82f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 31,
"avg_line_length": 17.454545454545453,
"alnum_prop": 0.6510416666666666,
"repo_name": "gideontong/RaspiRobot",
"id": "7066f2ed6d50cab14ca2b43e106e8639ad9b8a9c",
"size":... |
'''
Written by JT Fuchs, UNC.
PURPOSE: This program takes ZZ Ceti observations with Goodman and runs the full pipeline on a night. Uses ReduceSpec.py, spectral_extraction.py, Wavelenght_Calibration.py, continuum_normalization.py, flux_calibration.py, and diagnostics.py (and all dependencies therein).
DIRECTORY FILES... | {
"content_hash": "f66d0accd0772485436ea253f353518c",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 271,
"avg_line_length": 33.493975903614455,
"alnum_prop": 0.6440647482014389,
"repo_name": "joshfuchs/ZZCeti_pipeline",
"id": "2d42938697ecedcb1ae85977539025d90b599607",
"... |
import json
from pprint import pprint
from flask import Response
import requests
from urllib.parse import quote_plus, unquote_plus, urlencode
from .base_class import ZmirrorTestBase
from .utils import *
class TestVerification(ZmirrorTestBase):
"""testing using https://httpbin.org/"""
class C(ZmirrorTestBase... | {
"content_hash": "5180df690f0e2fe24757fbad3d2923fc",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 100,
"avg_line_length": 35.944250871080136,
"alnum_prop": 0.5368359829391237,
"repo_name": "Aploium/EasyWebsiteMirror",
"id": "7c8a40f7e783b823edb4e85efc2d85892151683a",
"... |
import os.path
from flask import Blueprint, render_template
from werkzeug.exceptions import NotFound
from browsepy import stream_template, get_cookie_browse_sorting, \
browse_sortkey_reverse
from browsepy.file import OutsideDirectoryBase
from .playable import PlayableFile, PlayableDirectory, \
... | {
"content_hash": "ecd2a04aa898cdfbbaf874228df5638d",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 27.486486486486488,
"alnum_prop": 0.6157817109144543,
"repo_name": "ergoithz/browsepy",
"id": "357b8bca3da26320f887bff4864a0362285475bc",
"size": "4... |
from collections import defaultdict
from glob import glob
import os
import time
try:
from xml.etree.ElementTree import ElementTree
except ImportError:
try:
from elementtree import ElementTree
except ImportError:
pass
from monasca_agent.collector.checks import AgentCheck
from monasca_agent.... | {
"content_hash": "aad85fb322c53fed3cd6e671b8a1b3fa",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 100,
"avg_line_length": 38.13286713286713,
"alnum_prop": 0.5332844305886668,
"repo_name": "sapcc/monasca-agent",
"id": "c5876fd0f3db795e249e3212f1abda79d4c46c21",
"size": ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
from pants.backend.core.tasks.task import Task
from pants.base.payload_field import DeferredSourcesField
from pants.build_graph.address_lookup_error im... | {
"content_hash": "f442ce4aafc3b0ce70c1e21f5bb18a48",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 98,
"avg_line_length": 42.405797101449274,
"alnum_prop": 0.7115516062884484,
"repo_name": "megaserg/pants",
"id": "d68c55cf07f1036c86712b29774d81d2a3e7cb59",
"size": "3073"... |
"""
Helper for looping over sequences, particular in templates.
Often in a loop in a template it's handy to know what's next up,
previously up, if this is the first or last item in the sequence, etc.
These can be awkward to manage in a normal Python loop, but using the
looper you can get a better sense of the context.... | {
"content_hash": "826e71e0dbf1d844a190fe5fc58791d2",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 74,
"avg_line_length": 25.478527607361965,
"alnum_prop": 0.5463520346737298,
"repo_name": "ravenac95/virtstrap",
"id": "ee47adb5a8b94b30e219e637dae26cdf0e8a1ab2",
"size": ... |
from CIM15.IEC61970.Wires.RegulatingControl import RegulatingControl
class TapChangerControl(RegulatingControl):
"""TapChangerControl discribe behaviour specific to tap changers, e.g. how the voltage at the end of a line varies with the load level and compensation of the voltage drop by tap adjustment.TapChangerCo... | {
"content_hash": "32b9ad56fd94eade609ebb653017cb01",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 381,
"avg_line_length": 51.94202898550725,
"alnum_prop": 0.705078125,
"repo_name": "rwl/PyCIM",
"id": "7cca9a04e0f1d7903280b382b83f86e67c6705a9",
"size": "4684",
"binary"... |
import unittest
from abelfunctions.differentials import (
mnuk_conditions,
recenter_curve,
differentials_numerators,
differentials,
validate_differentials,
Differential
)
from abelfunctions.riemann_surface import RiemannSurface
from abelfunctions.tests.test_abelfunctions import AbelfunctionsTes... | {
"content_hash": "422309dcea8a93ccc3ccc25c1b1fc1e8",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 79,
"avg_line_length": 32.52046783625731,
"alnum_prop": 0.5641071749685308,
"repo_name": "abelfunctions/abelfunctions",
"id": "3c331153284c27ddaca01cfb9fefa9b8ff7fcc41",
"... |
from __future__ import unicode_literals
from datetime import date, datetime, timedelta
from smtplib import SMTPException
from slacker import Error as SlackerError
import icalendar
from django.contrib.auth import models as auth_models
from django.contrib.auth.models import Group
from django.contrib.staticfiles.templat... | {
"content_hash": "44f8aee81ce79f68600aa99c59f92638",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 93,
"avg_line_length": 35.19845360824742,
"alnum_prop": 0.6302262575968368,
"repo_name": "patjouk/djangogirls",
"id": "0e593ca72ef8deed8e20787d3f5ff2e3e44f9c46",
"size": "... |
import simplejson
import json
import urllib
import time
import re
import BeautifulSoup
from BeautifulSoup import BeautifulStoneSoup
import hashlib
import nose
from nose.tools import assert_equals
import sys
import os
import ConfigParser
# This hack is to add current path when running script from command line
sys.path.... | {
"content_hash": "0f601e239bf8477e86d9e9a2bf522cc8",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 247,
"avg_line_length": 39.18407960199005,
"alnum_prop": 0.6253174200101574,
"repo_name": "figshare/Total-Impact",
"id": "36b10267dbcb2fcea3841af07d831baad6e7704e",
"size"... |
"""Support for Melnor RainCloud sprinkler water timer."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import ATTR_ATTRIBUTION, CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
from . import (
... | {
"content_hash": "5422a3316f294a20f0446cd3973cb39c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 75,
"avg_line_length": 35.674698795180724,
"alnum_prop": 0.6511313745356299,
"repo_name": "molobrakos/home-assistant",
"id": "e320a956f118006e791f196a16239dff934d7472",
"si... |
import sys
import traceback
import pytimeparse
from ast import literal_eval
from distutils.util import strtobool
from flask import current_app
from .base import db
class Setting(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(64))
value = db.Column(db.Text())
defa... | {
"content_hash": "53f5f9857007b9c72c6f69f557541e22",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 89,
"avg_line_length": 34.557993730407524,
"alnum_prop": 0.5122460087082729,
"repo_name": "ngoduykhanh/PowerDNS-Admin",
"id": "a46cfb6bb067a3f758b31d57c7dc3c2e5d229692",
"... |
from __future__ import print_function
from tables.tests import common
from tables.tests.common import verbose
from tables.tests.common import unittest
from tables.tests.common import PyTablesTestCase as TestCase
# Check indexes from PyTables version 2.0
class IndexesTestCase(common.TestFileMixin, TestCase):
def... | {
"content_hash": "402a519583f1fa0153b45a22aac1e116",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 79,
"avg_line_length": 32.44444444444444,
"alnum_prop": 0.5870583994232156,
"repo_name": "jack-pappas/PyTables",
"id": "fc188bd42172f7a50b1e5744983f5e4d7e9e19c1",
"size": ... |
from __future__ import absolute_import
from __future__ import unicode_literals
from app import app
import unittest
class BaseTestCase(unittest.TestCase):
__test__ = False
def setUp(self):
# Load testing configuration
app.config.from_object('config.TestingConfig')
self.app = app.test_... | {
"content_hash": "ae2d06977715f352049843cdf06a01c5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 54,
"avg_line_length": 24.294117647058822,
"alnum_prop": 0.6755447941888619,
"repo_name": "pipex/gitbot",
"id": "254c743e8b17477de89ce2a7cf802469ab70b93f",
"size": "413",
... |
def unique(iterable, key=None):
seen = set()
if key is None:
# Optimize the common case
for item in iterable:
if item in seen:
continue
seen.add(item)
yield item
else:
for item in iterable:
keyitem = key(item)
... | {
"content_hash": "f85ef161c0fbcc3f1564c1749f1db3f2",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 87,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.5304812834224599,
"repo_name": "ActiveState/code",
"id": "74304e46567a4e2cd24dfbc36c6b25fededb61fc",
"size": "935... |
import numpy as np
from ..base import BaseEstimator
from ._base import SelectorMixin
from ..utils.sparsefuncs import mean_variance_axis, min_max_axis
from ..utils.validation import check_is_fitted
class VarianceThreshold(SelectorMixin, BaseEstimator):
"""Feature selector that removes all low-variance features.
... | {
"content_hash": "8dd97e7cd2cd02ea4ceb30297d775774",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 79,
"avg_line_length": 33.46,
"alnum_prop": 0.5777047220561865,
"repo_name": "ryfeus/lambda-packs",
"id": "39892876a6478f9d326bd62775e87d742c4f1684",
"size": "3395",
"bi... |
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
# basically check if the number can be divided by 4
return n&3 != 0
| {
"content_hash": "7519bfb0cfb0f55f2307ef227a7e250f",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 59,
"avg_line_length": 25.25,
"alnum_prop": 0.504950495049505,
"repo_name": "tedye/leetcode",
"id": "90e1076fa09e9db3bb2e67c3d76e6facf87a4d79",
"size": "202",
"binary": fa... |
"""
lighting.py
--------------
Hold basic information about lights.
Forked from the light model in `pyrender`:
https://github.com/mmatl/pyrender
"""
import numpy as np
from .. import util
from .. import visual
from .. import transformations
# default light color
_DEFAULT_RGBA = np.array([60, 60, 60, 255], dtype=np... | {
"content_hash": "b6fdcc330a10800a9ce13a707ef77468",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 83,
"avg_line_length": 32.47653429602888,
"alnum_prop": 0.6159404179635394,
"repo_name": "mikedh/trimesh",
"id": "83c90ca3cf76dd6be041873bcd320b9f03dee08a",
"size": "8996"... |
import re
import logging
from datetime import datetime
from xml.etree import ElementTree as etree
from unidecode import unidecode
class Result(object):
def __init__(self, xml):
logging.info(xml)
tree = etree.fromstring(bytes(xml))
self.root = tree
@property
def success(self):
... | {
"content_hash": "d60d269b0c596459ffd28b9a7baaad71",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 138,
"avg_line_length": 34.791489361702126,
"alnum_prop": 0.6103228962818004,
"repo_name": "thijsmie/tantalus",
"id": "54f5abd17a4304cf08f097c57ac0809eab49148a",
"size": "... |
""" CircuitDict class """
# pylint: disable=no-member
from chartingperformance import db_session
from chartingperformance.models import Circuits
from flask import jsonify
class CircuitDict(object):
""" Helper query and response methods. Used for circuits endpoint and in ViewUsage class. """
def __init__(self,... | {
"content_hash": "1cb5d1c7be3897989b3f116239ac5946",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 97,
"avg_line_length": 31.5,
"alnum_prop": 0.6299603174603174,
"repo_name": "netplusdesign/home-performance-flask-api",
"id": "e20b517823f7fd9297078795c9b44d1183bde916",
"s... |
from __future__ import unicode_literals, division, absolute_import, print_function
import ctypes
from ctypes.util import find_library
from ctypes import c_void_p, c_char_p, c_uint32, POINTER, c_long
cf_path = find_library('CoreFoundation')
CoreFoundation = ctypes.CDLL(cf_path, use_errno=True)
CFIndex = c_long
CFSt... | {
"content_hash": "5abaf11ab23db2dff56100f61a995bca",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 108,
"avg_line_length": 30.19191919191919,
"alnum_prop": 0.7433924389427903,
"repo_name": "alvarolm/GoRename",
"id": "110f92e758ea0d89911b673bef72aa4095b0ff0f",
"size": "30... |
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG)
logger = logging.getLogger('spyne.test.interop.server.soap_http_basic')
from spyne.server.wsgi import WsgiApplication
from spyne.test.interop.server._service import services
from spyne.application i... | {
"content_hash": "47cb044b7fab388d12210f25733f922a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 31.72222222222222,
"alnum_prop": 0.6935201401050788,
"repo_name": "deevarvar/myLab",
"id": "27fe6f037ee71d5bef4f7cf523c0ece1fc3fafae",
"size": "1938"... |
"""Walkers based on an actuated jumping ball."""
import os
from dm_control import composer
from dm_control import mjcf
from dm_control.locomotion.walkers import legacy_base
import numpy as np
_ASSETS_PATH = os.path.join(os.path.dirname(__file__),
'assets/jumping_ball')
class JumpingBall... | {
"content_hash": "9ad81740f78e86b7b81805a1d5ac83b7",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 80,
"avg_line_length": 36.06993006993007,
"alnum_prop": 0.6392012407910043,
"repo_name": "deepmind/dm_control",
"id": "058ee472ccdcb321d319154b86334b0a325fe51a",
"size": "... |
import unittest
from mock import MagicMock
from mock import call
from alvi.client.containers.tree import Tree
from alvi.client.api import Pipe
class TestTree(unittest.TestCase):
def setUp(self):
self.pipe = Pipe("test_scene")
self.pipe.send = MagicMock()
def create_sample_tree(self):
... | {
"content_hash": "386fe9fce511a2a269dea7762e51f780",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 108,
"avg_line_length": 38.90625,
"alnum_prop": 0.5887550200803213,
"repo_name": "alviproject/alvi",
"id": "d5d7d78642b3b2671a81b73c55e56af2965dac79",
"size": "2490",
"bi... |
from __future__ import absolute_import
from __future__ import print_function
## =======[ IMPORT & CONSTANTS ]========= ##
import errno
import fnmatch
import os
import pip
import re
import shutil
import sys
import time
import zipfile
__version__ = 2.0
__author__ = 'Cashiuus'
VERBOSE = 1
DEBUG = 0
# ====================... | {
"content_hash": "5cd25d4852eda148933a83176678c46c",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 140,
"avg_line_length": 37.848684210526315,
"alnum_prop": 0.5548409525464975,
"repo_name": "Cashiuus/penprep",
"id": "82d0d93d912d4a4214ea5c834f788f2feec1e5f2",
"size": "1... |
"""Example: A Simple class to get & read FaceDetected Events"""
import argparse
import sys
import time
import qi
IP_ADDR = "192.168.0.107"
PORT = 9559
class HumanGreeter(object):
"""
A simple class to react to face detection events.
"""
def __init__(self, app):
"""
Initialisation of... | {
"content_hash": "468c7a5312a0b218f54eaf036d28567f",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 125,
"avg_line_length": 34.271028037383175,
"alnum_prop": 0.591764385055904,
"repo_name": "pban1993/naoqi_robot",
"id": "0be4a3d09808305b681f4fabb9edf6942a918ea1",
"size":... |
from .. import hook, bar
from . import base
class WindowName(base._TextBox):
"""
Displays the name of the window that currently has focus.
"""
def __init__(self, width=bar.STRETCH, **config):
base._TextBox.__init__(self, width=width, **config)
def _configure(self, qtile, bar):
... | {
"content_hash": "369f74f5e2d6b997e47ae1e11897ad51",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 69,
"avg_line_length": 29.766666666666666,
"alnum_prop": 0.5599104143337066,
"repo_name": "kiniou/qtile",
"id": "c690d54ab6fc854b70c23a7014e34ef805a26d04",
"size": "2187",
... |
import itertools as it
from computation.split_and_merge.util.node_border_iterator import iterate_node_border
class MergeGroup(object):
"""
Class that collects a group of homogenous nodes. Groups that are divided by the periodic border can be
organized in subgroups.
The object is intended to be used in... | {
"content_hash": "9584819f5ce94eeeb500be36d888e255",
"timestamp": "",
"source": "github",
"line_count": 522,
"max_line_length": 120,
"avg_line_length": 44.553639846743295,
"alnum_prop": 0.5854581416347766,
"repo_name": "sciapp/pyMolDyn",
"id": "e1aa621cd032cacb09c9e8e63f1192e55109449c",
"size": "23... |
import tests.periodicities.period_test as per
per.buildModel((360 , 'T' , 50));
| {
"content_hash": "1cfd5474ca732f4d8026c0531e2479e4",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 20.5,
"alnum_prop": 0.7073170731707317,
"repo_name": "antoinecarme/pyaf",
"id": "beb916976c6c3f7575fb9970e8713d1fad8b5685",
"size": "82",
"binary": ... |
"""Automated tests (as opposed to human-verified test patterns)
It was tempting to mock out curses to get predictable output from ``tigetstr``,
but there are concrete integration-testing benefits in not doing so. For
instance, ``tigetstr`` changed its return type in Python 3.2.3. So instead, we
simply create all our t... | {
"content_hash": "34ce004844b9edfdcc4ad572bf3c07a8",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 92,
"avg_line_length": 32.34538152610442,
"alnum_prop": 0.6247827166625279,
"repo_name": "sgml/popcorn_maker",
"id": "817e766573e4920459357d6a24d8ade3a9ef717d",
"size": "8... |
"""pyrflink - Python implementation of the RFlink SerialGateway."""
import time
import threading
import logging
import pickle
import os
import json
import socket
import select
import re
from queue import Queue
from importlib import import_module
import serial
LOGGER = logging.getLogger(__name__)
class Gateway(object... | {
"content_hash": "664d41d7517ebd4a9025bb298ca44654",
"timestamp": "",
"source": "github",
"line_count": 569,
"max_line_length": 79,
"avg_line_length": 36.797891036906854,
"alnum_prop": 0.5446078899608368,
"repo_name": "matt2005/pyrflink",
"id": "1525f8e3380c6653e00f89627ade09dac1f523bc",
"size": "2... |
import warnings
from functools import partial
from logging import getLogger
from django.conf import settings
from django.contrib import messages
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.core.urlresolvers import NoRev... | {
"content_hash": "6fbde69b89f1863bba7fff72a26ff826",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 86,
"avg_line_length": 39.74764150943396,
"alnum_prop": 0.5914080579125378,
"repo_name": "jproffitt/django-cms",
"id": "d5f73eeac90ac07b424f61465d62c0c383a0563a",
"size": ... |
import contextlib
import mock
from neutron.common import constants as l3_const
from neutron import context
from neutron.db import l3_dvr_db
from neutron.extensions import l3
from neutron import manager
from neutron.openstack.common import uuidutils
from neutron.tests.unit import testlib_api
_uuid = uuidutils.generate... | {
"content_hash": "16ee133db502220ee4e89d4f4953c0c4",
"timestamp": "",
"source": "github",
"line_count": 503,
"max_line_length": 79,
"avg_line_length": 40.60039761431412,
"alnum_prop": 0.5633630398589756,
"repo_name": "rdo-management/neutron",
"id": "2b7fab9355375b32abc20f05feee9ccbf71c8329",
"size"... |
import unittest
class SanityTest(unittest.TestCase):
def setUp(self):
pass
def test_true_eq_true(self):
self.assertEqual(True, True)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "1c3fdd547b4bc480bb78710402951857",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 36,
"avg_line_length": 20.6,
"alnum_prop": 0.616504854368932,
"repo_name": "timBrockman/fsnd-p2-mublog",
"id": "661269962384425c6679b37a456a0224a38e275f",
"size": "206",
... |
from unittest import TestCase
from grapher import errors
from grapher.settings import Testing
class GrapherErrorTest(TestCase):
def test_internal_error(self):
e = errors.GrapherError()
self.assertEqual(e.status_code, 500)
response = e.as_api_response()
self.assertIn('INTERNAL_ERR... | {
"content_hash": "341aee5c2811b6bd692c7649dc7dc505",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 61,
"avg_line_length": 28.852941176470587,
"alnum_prop": 0.6126401630988787,
"repo_name": "lucasdavid/grapher",
"id": "75258512ec53ade35226f8284abdbc15974f48e5",
"size": "9... |
from twisted.conch.ssh import transport
from twisted.python import log
class HonsshServer(transport.SSHServerTransport):
def connectionMade(self):
"""
Called when the connection is made to the other side. We sent our
version and the MSG_KEXINIT packet.
"""
self.transport.wr... | {
"content_hash": "f728830421fb65cb28341d2bb681a7af",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 96,
"avg_line_length": 41.9344262295082,
"alnum_prop": 0.5527756059421423,
"repo_name": "coolhacks/docker-hacks",
"id": "cd574b13e43de0f2db6cbc23cd965d096a9fe43d",
"size": ... |
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
INTERNAL_IPS = ('127.0.0.1',)
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
container = os.environ['GRIMA_DB'] + os.sep + 'grima.db'
DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'... | {
"content_hash": "fc25cc93ef752c11e91bfa4f14660d87",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 101,
"avg_line_length": 30.489795918367346,
"alnum_prop": 0.6877510040160643,
"repo_name": "cdsi/grima",
"id": "0ace6d1f98d401a55729f343bc27667e030eb5b0",
"size": "3026",
... |
"""Manages Google Cloud Key Management resources.
See https://cloud.google.com/kms/docs/
"""
import base64
from typing import Optional, List
from googleapiclient import discovery
from googleapiclient import errors
from google.auth import credentials
class CloudKmsError(Exception):
"""An error raised when faile... | {
"content_hash": "62d6fdd161548d4c1c14bca04567174d",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 80,
"avg_line_length": 40.004329004329,
"alnum_prop": 0.5730981495509144,
"repo_name": "GoogleCloudPlatform/django-cloud-deploy",
"id": "2c42fff7643f076d82605ff9312df06ad834... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('openstack', '0021_volume_instance'),
]
operations = [
migrations.AddField(
model_name='volume',
... | {
"content_hash": "e64aab699fec0150df670588a997f8cd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 259,
"avg_line_length": 32.31578947368421,
"alnum_prop": 0.6498371335504886,
"repo_name": "opennode/nodeconductor-openstack",
"id": "a9ad019f58201c52ef9814185af314ad8aa26b98"... |
import asyncio
import datetime
import json
import re
from unittest import mock
import pytest
from multidict import CIMultiDict
from aiohttp import HttpVersion, HttpVersion10, HttpVersion11, hdrs, signals
from aiohttp.test_utils import make_mocked_request
from aiohttp.web import ContentCoding, Response, StreamResponse... | {
"content_hash": "9fca9f3b8cd87e69b71777d3dfd3dbf3",
"timestamp": "",
"source": "github",
"line_count": 1041,
"max_line_length": 78,
"avg_line_length": 26.6926032660903,
"alnum_prop": 0.6487926008565157,
"repo_name": "AraHaanOrg/aiohttp",
"id": "6a407cbdcd110831b051a61ffe14e48fa1efc0f1",
"size": "2... |
import time
from queue import Queue
from . import Peer
from threading import Thread
from pubsub import pub
class PeerSeeker(Thread):
def __init__(self, new_peers_queue, torrent, peer_manager):
Thread.__init__(self)
self.stop_requested = False
self.peer_manager = peer_manager
self.n... | {
"content_hash": "3ffff7b4c2d4f5c3ff487221152eb72b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 92,
"avg_line_length": 34.07692307692308,
"alnum_prop": 0.5680963130173062,
"repo_name": "AcademicTorrents/python-r-api",
"id": "cd3bc3712b9932ae4c15c9f7d325a79af14e5d8b",
... |
from __future__ import print_function
import re as _re
from pyzdde.utils.pyzddeutils import _prettifyCodeDesc, _boldifyText, _prettifyText, _print_mod
class _Buttons(object):
"""ZEMAX 3-letter buttons. Note ZPL Macro codes are not included.
The list of button codes were compiled from ZEMAX Version 13.0404, 201... | {
"content_hash": "13eabf9d3e11f0a97584e19d94faaf28",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 95,
"avg_line_length": 32.59836065573771,
"alnum_prop": 0.5993630039393177,
"repo_name": "ng110/PyZDDE",
"id": "2d6f62d7e9de14100f05eaa149b2fd398414588b",
"size": "12422",... |
import sys
import unittest
import glob
import os
import shutil
import pandas as pd
import numpy as np
from subprocess import call
from margin.utils import getFastaDictionary
SIGNALALIGN_ROOT = "../"
ZYMO_C_READS = SIGNALALIGN_ROOT + "tests/minion_test_reads/C/"
ZYMO_REFERENCE = SIGNALALIGN_ROOT + "tests/test_sequence... | {
"content_hash": "91f9c0f55d99c6755bc1bb193ab43001",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 139,
"avg_line_length": 46.0919540229885,
"alnum_prop": 0.5463840399002494,
"repo_name": "mitenjain/signalAlign",
"id": "7519d350768c60977ec4dc53a41c0b8a5c0be13d",
"size":... |
import sys
from m5.defines import buildEnv
from m5.params import *
from m5.proxy import *
from Bus import CoherentBus
from InstTracer import InstTracer
from ExeTracer import ExeTracer
from MemObject import MemObject
default_tracer = ExeTracer()
if buildEnv['TARGET_ISA'] == 'alpha':
from AlphaTLB import AlphaDTB... | {
"content_hash": "218cdc4f1f7123618cb1a76b90e5d317",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 78,
"avg_line_length": 39.663101604278076,
"alnum_prop": 0.6224888769044088,
"repo_name": "xiaoyaozi5566/DynamicCache",
"id": "c27fd1c27db4812728a65715f536c4a52e3212db",
"... |
"""Utilities that are distro specific for use on SUSE 12."""
import os
import subprocess
from google_compute_engine import constants
from google_compute_engine.distro_lib import helpers
from google_compute_engine.distro_lib import ip_forwarding_utils
from google_compute_engine.distro_lib import utils
class Utils(ut... | {
"content_hash": "0279ba900fef6a70390ffa4909d9e125",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 35.90291262135922,
"alnum_prop": 0.6898323418063819,
"repo_name": "rjschwei/compute-image-packages",
"id": "a8bd48648a40587dc12d7175fa9aaa5226374399",... |
from __future__ import print_function
from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.pca import H2OPrincipalComponentAnalysisEstimator as H2OPCA
def pca_scoring():
print("Importing arrests.csv data...")
arrestsH2O = h2o.upload_... | {
"content_hash": "7ec360cc91b8eec4b92187af0d11d3bd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 87,
"avg_line_length": 23.529411764705884,
"alnum_prop": 0.7175,
"repo_name": "michalkurka/h2o-3",
"id": "2c94395f6681c3949bd25cdf409e7c2bba0c1a8f",
"size": "800",
"binar... |
"""
Panflute: pandoc filters made simple
====================================
Panflute is a Python package that makes `Pandoc <http://pandoc.org/>`_
filters fun to write. (`Installation <install.html>`_)
"""
from .utils import debug
from .containers import ListContainer, DictContainer
from .base import Element, Blo... | {
"content_hash": "0041b6ac3fc06905fb19d27f826f406d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 31.714285714285715,
"alnum_prop": 0.7214714714714715,
"repo_name": "sergiocorreia/panflute",
"id": "f3de3a6dbfb295c5c4fdffcd8f86ede8e65eb456",
"size"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from ray.rllib.policy.policy import Policy
def _sample(probs):
return [np.random.choice(len(pr), p=pr) for pr in probs]
class KerasPolicy(Policy):
"""Initialize the Keras Policy.... | {
"content_hash": "027397923b40494d8e0aa86a790671b2",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 31.246153846153845,
"alnum_prop": 0.5947808961102905,
"repo_name": "atumanov/ray",
"id": "3008e133c1c6dfff8f427a18a4273d817efbf020",
"size": "2031",
... |
"""
Description: Bounding box utilities for localization and detection
Author = "Olalekan Ogunmolu"
Adapted from http://www.pyimagesearch.com/2016/11/07/intersection-over-union-iou-for-object-detection/
Date: May 04, 2017
"""
def bb_intersection_over_union(boxA, boxB):
# determine the (x, y)-coordinates of the int... | {
"content_hash": "daa1a9f39d2fd8326ede98a451926f76",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 102,
"avg_line_length": 31.90625,
"alnum_prop": 0.693437806072478,
"repo_name": "lakehanne/ensenso",
"id": "de3f7b6539cdc4ea2145959980a5f5f376bf029b",
"size": "1021",
"bi... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('recipe_book', '0014_auto_20161110_0115'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='name',
... | {
"content_hash": "d42db99b5b96fafebef1593ccc0c4fc2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.5923076923076923,
"repo_name": "jneuendorf/what-should-i-eat",
"id": "5e64abc05104e9f2facef2e1828050675d2c6474",
... |
'''
------------------------------------------------------------------------------
Copyright 2016 Esri
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.... | {
"content_hash": "f2bd813bbd240870afe53392e554bc23",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 105,
"avg_line_length": 35.386138613861384,
"alnum_prop": 0.5506435366536094,
"repo_name": "Esri/military-tools-geoprocessing-toolbox",
"id": "5b086171a86361977f4f2f66384f68... |
import logging
import ailment
from .atoms import Register, Tmp, MemoryLocation
from .constants import OP_BEFORE, OP_AFTER
from .dataset import DataSet
from .external_codeloc import ExternalCodeLocation
from .undefined import Undefined
from ...engines.light import SimEngineLightAIL, RegisterOffset, SpOffset
from ...er... | {
"content_hash": "f3e16b3b3c76ee4ed381f910923c0cd5",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 117,
"avg_line_length": 38.544401544401545,
"alnum_prop": 0.590904537714114,
"repo_name": "tyb0807/angr",
"id": "6cba3a894f42a4267af99e724972ed29de01500c",
"size": "9983",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Bot', '0002_auto_20170421_1449'),
]
operations = [
migrations.AddField(
model_name='day',
name='week_day_id',
fi... | {
"content_hash": "e35775e5e33f02de215590150415c758",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.5895522388059702,
"repo_name": "leoniknik/PartyBot",
"id": "53e8accab648bc40fb88fc5b72af4a0f4a9d2122",
"size": "4... |
import datetime
import pickle
import re
import pandas as pd
import pytest
import ibis
import ibis.common.exceptions as com
import ibis.config as config
import ibis.expr.analysis as L
import ibis.expr.api as api
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
import ibis.expr.types as ir
from ibis.... | {
"content_hash": "2a8a33c359b5b37e7b5684eac6277d1e",
"timestamp": "",
"source": "github",
"line_count": 1406,
"max_line_length": 79,
"avg_line_length": 27.77524893314367,
"alnum_prop": 0.6227593977261088,
"repo_name": "cloudera/ibis",
"id": "8d452b2262b972e94365c564ce6f3042a8291fad",
"size": "39052... |
from pylons import Response, c, g, cache, request, session
from pylons.controllers import WSGIController, XMLRPCController
from pylons.controllers.util import abort, redirect_to, etag_cache
from pylons.decorators import jsonify, validate
from pylons.templating import render, render_response
from pylons.i18n import N_, ... | {
"content_hash": "36498009d92ab1c84ba99bd8b415ed4e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 79,
"avg_line_length": 47.526315789473685,
"alnum_prop": 0.7220376522702104,
"repo_name": "santisiri/popego",
"id": "2df549eee7079d4da5da289b90249ad59ea80aff",
"size": "903... |
"""
FILE: sample_translation_with_glossaries_async.py
DESCRIPTION:
This sample demonstrates how to translate documents and apply custom glossaries to the translation.
To set up your containers for translation and generate SAS tokens to your containers (or files)
with the appropriate permissions, see the R... | {
"content_hash": "8e5bb9ddf2364d1a3bd9b163397ec40a",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 113,
"avg_line_length": 41.11842105263158,
"alnum_prop": 0.69408,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d22828cd63510d7cdd9a00e0d3cc4b59408bce63",
"size": "3277... |
"""
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
"""
import primes
primeNumbers = primes.create_primes(20)
primeFactors = {}
def get_prime_factors(number):... | {
"content_hash": "78d83426bbc8f5ec73af7ba57d1054cd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 106,
"avg_line_length": 22.382978723404257,
"alnum_prop": 0.6349809885931559,
"repo_name": "pgrm/project-euler",
"id": "062217e57b17407209834c8d5dd68d816b984039",
"size": "... |
import os, sys, time, platform, random
import re, json, cookielib
# requirements
import requests, termcolor
requests = requests.Session()
requests.cookies = cookielib.LWPCookieJar('cookies')
try:
requests.cookies.load(ignore_discard=True)
except:
pass
class Logging:
flag = True
@staticmethod
d... | {
"content_hash": "51d1baf260213a45f7c4b23bd203a2b2",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 130,
"avg_line_length": 32.36725663716814,
"alnum_prop": 0.5797676008202324,
"repo_name": "richardGaoPy/NetSpider",
"id": "705ade66936f5182e59c10c304e8abbfe2206de2",
"size... |
"""Interfaces for LPDDR5 memory devices
These memory "interfaces" contain the timing,energy,etc parameters for each
memory type and are usually based on datasheets for the memory devices.
You can use these interfaces in the MemCtrl object as the `dram` timing
interface.
"""
from m5.objects import DRAMInterface
cla... | {
"content_hash": "b28bdf1893b61ca059a423e0d7fbd53a",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 75,
"avg_line_length": 28.50314465408805,
"alnum_prop": 0.6407766990291263,
"repo_name": "gem5/gem5",
"id": "f35bef15aeba463ed15de2abaf0c14e944aac5cf",
"size": "11306",
... |
import submodules
import pretty
class User:
def __init__(self,username):
self.username = username
def load(self,depth='all'):
"""Calls all the necessary submodules to generate
user's contribution history.
Depth is used to specify how detailed the history
should be. 'all' (default), 'key' (only key events... | {
"content_hash": "8f77758fdf059da312b1e7b20b042897",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 90,
"avg_line_length": 27.62162162162162,
"alnum_prop": 0.7172211350293543,
"repo_name": "theopolisme/wikitimeline",
"id": "cef6fbf7f2e33f412f50d360dc5b0cc1e504206d",
"size... |
from jupyter_packaging import (
wrap_installers,
npm_builder,
get_data_files
)
from pathlib import Path
from setuptools import setup
HERE = Path(__file__).parent.resolve()
IS_REPO = (HERE.parent / '.git').exists()
JS_DIR = HERE / 'src'
data_files_spec = [(
'share/jupyter/nbextensions/jupyter-js-widget... | {
"content_hash": "67341053e6a32bc446face824e68f6f5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 99,
"avg_line_length": 25.464285714285715,
"alnum_prop": 0.664796633941094,
"repo_name": "ipython/ipywidgets",
"id": "05b6c335a404cc1f398d5966415a9b215354ac2f",
"size": "88... |
from dry_rest_permissions.generics import DRYPermissionsField
from rest_framework_json_api import serializers
# Local
from .models import Assignment
from .models import Contest
from .models import Entry
from .models import Session
class AssignmentSerializer(serializers.ModelSerializer):
permissions = DRYPermiss... | {
"content_hash": "719cda6c7b70f8bb9cc8ecdf69930350",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 76,
"avg_line_length": 21.145833333333332,
"alnum_prop": 0.43842364532019706,
"repo_name": "barberscore/barberscore-api",
"id": "f2527d2c041808f92839094fbf566d91c0d39343",
... |
""" CLI to process imagery products to tiles and index in database
"""
from collections import defaultdict
import concurrent.futures
import logging
import os
import click
import six
# TODO: hide many of these imports to improve CLI startup speed
from . import cliutils, options
from .. import multiprocess, products
fr... | {
"content_hash": "c8d226327df05914fe5f55eede2751e6",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 79,
"avg_line_length": 42.07070707070707,
"alnum_prop": 0.5368547418967587,
"repo_name": "ceholden/landsat_tile",
"id": "6d14dcd9c8e4e5b3304fc6e93a1ae3311d817534",
"size":... |
"""Wrappers for primitive Neural Net (NN) Operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numbers
import os
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.framework import con... | {
"content_hash": "69850ef12d085cab88415d5ff27045ba",
"timestamp": "",
"source": "github",
"line_count": 5000,
"max_line_length": 116,
"avg_line_length": 40.3668,
"alnum_prop": 0.6527740618528097,
"repo_name": "jhseu/tensorflow",
"id": "e4a477ecda4953180d91e802378e39954af56057",
"size": "202523",
... |
from __future__ import print_function, absolute_import
import sys
from subprocess import check_call, check_output
import subprocess
import tempfile
import os
import re
from collections import namedtuple
from numba import config
from numba.roc.hsadrv import devices
from .common import AMDGCNModule
from .config import RO... | {
"content_hash": "0f339fdc957f7705242e123829aeb5d1",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 88,
"avg_line_length": 32.649180327868855,
"alnum_prop": 0.5280176742317735,
"repo_name": "jriehl/numba",
"id": "cd370ede30bea7104598bff616ad00f5bceb6e4e",
"size": "10064"... |
urlpatterns = []
| {
"content_hash": "bac8bc9121b5871dab66b4746daafe2b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 16,
"avg_line_length": 17,
"alnum_prop": 0.6470588235294118,
"repo_name": "codingjoe/django-vies",
"id": "2f424ae76b1fad5d49b5d28c58fb9d8724800261",
"size": "41",
"binary"... |
try:
from setuptools import setup
except ImportError:
from distutils import setup
setup(
name="Dynomite",
version="0.1",
packages=['dynomite'],
tests_require=['nose>=0.11.0.dev', 'boto']
)
| {
"content_hash": "aab4b50ea041dea0c621acee67ce3209",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 46,
"avg_line_length": 19.818181818181817,
"alnum_prop": 0.6330275229357798,
"repo_name": "seabirdzh/dynomite",
"id": "bbda5e32472125af973789b96bd3a45fbe6973d3",
"size": "2... |
__author__ = 'redwards'
from .edit_distance import edit_distance
from .gapped_alignment import gap_alignment
from .dna_alignment import dna_gapped_alignment, dna_score_alignment
from .gapped_alignment2 import gapped_alignment, score_alignment
from local_alignment import local_alignment
| {
"content_hash": "90ce49af4d61f8e4f4d224447bcefb8b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 68,
"avg_line_length": 36.125,
"alnum_prop": 0.8131487889273357,
"repo_name": "linsalrob/bioinformatics",
"id": "0da3132e3a2c94dbf383527a948b97405be03f39",
"size": "289",
... |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... | {
"content_hash": "16e13e5cc816d4435242f9664190675c",
"timestamp": "",
"source": "github",
"line_count": 499,
"max_line_length": 120,
"avg_line_length": 42.37274549098196,
"alnum_prop": 0.6339860007567159,
"repo_name": "chrisfranzen/django",
"id": "f24df93bf4f581cdfeea171e417182992c1521cf",
"size": ... |
"""
Provided to you by Emlid Ltd (c) 2014.
twitter.com/emlidtech || www.emlid.com || info@emlid.com
Example: Get pressure from MS5611 barometer onboard of Navio shield for Raspberry Pi
To run this example navigate to the directory containing it and run following commands:
sudo python Barometer_example.py
"""
import ... | {
"content_hash": "28b5b5fe51f472ea713fc1d7a1cdc1c3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 87,
"avg_line_length": 23.764705882352942,
"alnum_prop": 0.7524752475247525,
"repo_name": "shawn1231/snowflakex-iii",
"id": "6e9480e0cb8295cf7cb7375b7434a362f2718bc3",
"siz... |
"""Ce fichier définit le contexte-éditeur 'SelectionTags'."""
from primaires.interpreteur.editeur.selection import Selection
from primaires.format.fonctions import supprimer_accents
class SelectionTags(Selection):
"""Contexte-éditeur pour la sélection de tags."""
nom = "editeur:tags:selection"
def __in... | {
"content_hash": "a5b81b502458230bb5e9f44354119b25",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 71,
"avg_line_length": 36.4,
"alnum_prop": 0.5642857142857143,
"repo_name": "vlegoff/tsunami",
"id": "68c568577a26f19133a00cdb7bac2cb4621686fd",
"size": "3399",
"binary":... |
"""Test the wallet balance RPC methods."""
from decimal import Decimal
import struct
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE as ADDRESS_WATCHONLY
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
conn... | {
"content_hash": "661e348795a218c7d8bbd4892011d70f",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 147,
"avg_line_length": 48.20095693779904,
"alnum_prop": 0.6475084375620409,
"repo_name": "UdjinM6/dash",
"id": "15bb7a268b104e900729500b49bb0f00afe62ae6",
"size": "10283"... |
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import TTLocalizer
class DistributedBankMgr(DistributedObject.DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedBankMgr')
neverDisable = 1
def __ini... | {
"content_hash": "093a54b848ba199ca24d59a37f7f1a52",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 32.2,
"alnum_prop": 0.7070393374741201,
"repo_name": "ksmit799/Toontown-Source",
"id": "7a086ebcbe1a6141ffb38cd921764a6fda75fddd",
"size": "966",
"... |
import json,traceback,prop,copy,lrilog
immutable_props=["urn:lri:property_type:guid",
"urn:lri:property_type:timestamp",
"urn:lri:property_type:creator"]
class prop(object):
def __init__(self,rec={},entity_guid=None,entity=None,creator=None,proptype=None,value=None,db=None,guid... | {
"content_hash": "2b0bd0ac629b2d3a4ff0a8c04848d099",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 157,
"avg_line_length": 38.507407407407406,
"alnum_prop": 0.5229393094161777,
"repo_name": "bollacker/lri-b",
"id": "227f37fae31f8021e747b4de7b104e3ce56ddfe7",
"size": "11... |
from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from main import views
from main.forms import CaptchaPasswordResetForm
from main.views import ProfileView
app_name = 'main'
urlpatterns = [
url(r'^$', views.index, name='i... | {
"content_hash": "6af2e2c46d73b6888afbdb1a84b4c007",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 117,
"avg_line_length": 58.333333333333336,
"alnum_prop": 0.6589010989010989,
"repo_name": "NBajanca/django-non-profit",
"id": "49fc718f0ca2a445d1c78ad06d4440ee2987820e",
"... |
""" A script to build specific fasta databases """
from __future__ import print_function
import collections
import sys
Sequence = collections.namedtuple('Sequence', ['header', 'sequence'])
def FASTAReader_gen(fasta_filename):
with open(fasta_filename) as fasta_file:
line = fasta_file.readline()
... | {
"content_hash": "6c86858bd37e123141ff904fed3189b0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 74,
"avg_line_length": 29.54385964912281,
"alnum_prop": 0.578978622327791,
"repo_name": "TGAC/earlham-galaxytools",
"id": "b60d6707fb9323dfb723e7e12cecdb53610a4555",
"size"... |
from twisted.application.service import ServiceMaker
CustomInterpreter = ServiceMaker(
"Twisted Manhole with custom interpreter",
"mypkg.interp",
("An interactive remote debugger service accessible via telnet "
"and ssh and providing syntax coloring and basic line editing "
"functionality."),
... | {
"content_hash": "18f4ba18cbdfc1c3f709d4f63d52b84e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 68,
"avg_line_length": 33.2,
"alnum_prop": 0.7379518072289156,
"repo_name": "oubiwann/carapace",
"id": "a2d1f9636bfbf0bed2dc1d4e1c2dc702fde548b4",
"size": "332",
"binary"... |
"""Code for setting up the property system."""
import redis
import time
import livetech.prop.prop as prop
import sys
r = redis.Redis(host="localhost", port=6379, db=0)
h = prop.RedisPropertyHierarchy(r)
ranges = {
1: "1-25",
2: "26-50",
3: "51-75",
4: "76-100",
5: "101-105"
}
de... | {
"content_hash": "2b782de1795d590e76c7b8e3ab9a2fe9",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 146,
"avg_line_length": 36.21739130434783,
"alnum_prop": 0.6398559423769508,
"repo_name": "JSund/videogrid",
"id": "ca9f011c0dd29310c9c2e4f1bff9fe33fa078270",
"size": "855"... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
import frappe.utils
from frappe.utils.xlsutils import get_xls
from frappe.utils.csvutils import to_csv
max_reports_per_user = 3
class AutoEmailReport(Document):
def autoname(self):
self.name = _(se... | {
"content_hash": "7e5ec35c6af02c6eef3f0b3b5cb8d96a",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 158,
"avg_line_length": 29.43262411347518,
"alnum_prop": 0.6780722891566265,
"repo_name": "elba7r/builder",
"id": "a99c90d2d66c4acbc5fa62ed88e3f4e4f3ac7c4b",
"size": "4284... |
"""Generators for classes of graphs used in studying social networks."""
import itertools
import math
import random
import networkx as nx
# Copyright(C) 2011, 2015 by
# Ben Edwards <bedwards@cs.unm.edu>
# Aric Hagberg <hagberg@lanl.gov>
# Konstantinos Karakatsanis <dinoskarakas@gmail.com>
# All rights re... | {
"content_hash": "5e9cca13769332d46824847b9d45b539",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 79,
"avg_line_length": 29.324034334763947,
"alnum_prop": 0.5830954994511526,
"repo_name": "andnovar/networkx",
"id": "a54cc8e48bf24f74de930cb84ade6f5c21dbb122",
"size": "1... |
import os as os
from enum import Enum
from inspect import getframeinfo, currentframe
import cv2
import numpy as _np
from bot.providers.predefined import Predefined
from bot.shared import nox_current_version, tupletodict
duel_variant_v = {
'v1' : (800, 800),
'v2-duel' : (640, 800),
'v2-autoduel... | {
"content_hash": "d805d3f23e9de576401057d8af315f34",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 166,
"avg_line_length": 27.07792207792208,
"alnum_prop": 0.5566746602717826,
"repo_name": "will7200/Yugioh-bot",
"id": "be29306c404c225b26c66a75a4aaedf809279fab",
"size": ... |
__author__ = 'srio'
import sys
import numpy
import scipy.constants as codata
from oasys.widgets import widget
from orangewidget import gui
from PyQt4 import QtGui
from crystalpy.util.PolarizedPhotonBunch import PolarizedPhotonBunch
from crystalpy.util.PolarizedPhoton import PolarizedPhoton
from crystalpy.util.Vecto... | {
"content_hash": "ae21fc6ccf2186d8a9bf927d5c5862e6",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 137,
"avg_line_length": 34.19396551724138,
"alnum_prop": 0.5584268246564982,
"repo_name": "edocappelli/oasys-crystalpy",
"id": "6733c105af28ff9e5ac3b4934293702d66695e34",
... |
import six
from agate.data_types.base import DataType
class Text(DataType):
"""
Data representing text.
:param cast_nulls:
If :code:`True`, values in :data:`.DEFAULT_NULL_VALUES` will be
converted to `None`. Disable to retain them as strings.
"""
def __init__(self, cast_nulls=Tru... | {
"content_hash": "bc138d4c733a4cfaf8be505eb6a7295b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 73,
"avg_line_length": 26.441176470588236,
"alnum_prop": 0.5517241379310345,
"repo_name": "wireservice/agate",
"id": "6bd210eac27ee4bfc4586872c3ee8be6f26143bf",
"size": "92... |
import random
import sys
random.seed(42)
# sys.setrecursionlimit(2000)
print "use pypy"
DEBUG = False
class Node(object):
"""
a node with `num_channels` actively opens half of them with other nodes
and has `deposit`.
The other half is reserved for other nodes connecting.
"""
def __init__(self... | {
"content_hash": "dce3d49b6fca0cdecc8b8e3a2f8778ca",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 97,
"avg_line_length": 35.955621301775146,
"alnum_prop": 0.5610960256726734,
"repo_name": "tomashaber/raiden",
"id": "860028451da12da916103a85c63764597c893e6f",
"size": "1... |
from .boostaroota import *
| {
"content_hash": "9811540b30cc083f852132496b95d8e8",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 26,
"avg_line_length": 27,
"alnum_prop": 0.7777777777777778,
"repo_name": "ZRiddle/BoostARoota",
"id": "7f821f75cbb530d1df1f9259e75b850fd36d55a9",
"size": "28",
"binary": ... |
"""
The MIT License (MIT)
Copyright (c) 2015 Christian Uhsat <christian@uhsat.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to u... | {
"content_hash": "dcd89bc35b5af8670b2edf787e2653c1",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 78,
"avg_line_length": 29.365079365079364,
"alnum_prop": 0.5293693693693694,
"repo_name": "cuhsat/tinycrypt",
"id": "f5ddb801438d28f078f2a2bdcb41fe70563b1739",
"size": "55... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.