text stringlengths 4 1.02M | meta dict |
|---|---|
import numpy as np
import cv2
ym_per_pix = 30/720 # meters per pixel in y dimension
xm_per_pix = 3.7/700 # meters per pixel in x dimension4
# Define source points for perspective transformation
src_points = np.float32([[200,720],[453,547],[835,547],[1100,720]])
# Define 4 destination points for perspective transforma... | {
"content_hash": "b857a2d80487f1b7eadc0233622977c5",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 205,
"avg_line_length": 44.009302325581395,
"alnum_prop": 0.6261889663918834,
"repo_name": "camigord/Self-Driving-Car-Nanodegree",
"id": "c0ad64a2f19daf44c9a5cbafaf9557fe364... |
import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util import get_primary_avatar, User
from avatar.models import Avatar
try:
from PIL import Image
... | {
"content_hash": "3525a377da065740fbacf5be01bfa30e",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 98,
"avg_line_length": 41.53383458646616,
"alnum_prop": 0.6591238233164374,
"repo_name": "marcfro/django-avatar",
"id": "6d233d86bdd1653f885e7cd362d90bab36d4e887",
"size":... |
from __future__ import unicode_literals
from django.db import migrations
def set_null_to_blank(queryset, fields):
for element in queryset:
for field in fields:
value = getattr(element, field)
if value is None:
setattr(element, field, '')
element.save()
de... | {
"content_hash": "ad2a4de9b94c2e0561714edc9358af3f",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 54,
"avg_line_length": 22.565217391304348,
"alnum_prop": 0.5491329479768786,
"repo_name": "rdmorganiser/rdmo",
"id": "38292c851d5d77dd641c39f4402c8e56ccf5647f",
"size": "11... |
"""Implement the inner handling for tr-98/181 ManagementServer."""
__author__ = 'dgentry@google.com (Denton Gentry)'
import copy
import datetime
import math
import random
import re
import socket
import time
import urlparse
import google3
import tornado.ioloop
import cwmpbool
import cwmpdate
# Allow unit tests to o... | {
"content_hash": "658f239be4b3992db587d11708452750",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 79,
"avg_line_length": 31.962848297213622,
"alnum_prop": 0.7026346377373112,
"repo_name": "fengyuanjs/catawampus",
"id": "f4de3584769b2487c71b36709196866f8afd8490",
"size"... |
from platform import machine
from eucaops import Eucaops
import re
import string
from eutester.euinstance import EuInstance
from eutester.eutestcase import EutesterTestCase
from eutester.sshconnection import CommandTimeoutException
class LVMSnapshotUtility(EutesterTestCase):
def __init__(self,extra_args = N... | {
"content_hash": "76f85e36533738bf7fbdcbc33ef76365",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 111,
"avg_line_length": 34.285714285714285,
"alnum_prop": 0.5782738095238096,
"repo_name": "nagyistoce/eutester",
"id": "33e9d02e7dd1be8dad492c5bcd3c443363d7a33e",
"size": ... |
import os
from os import path as op
import shutil
import warnings
import numpy as np
from nose.tools import assert_raises, assert_true, assert_false
from numpy.testing import assert_allclose, assert_array_equal, assert_equal
from mne import pick_types
# from mne.tests.common import assert_dig_allclose
from mne.transf... | {
"content_hash": "3b8e76c25c96c87057ec44fe8b1268d9",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 79,
"avg_line_length": 48.92,
"alnum_prop": 0.5829017897701463,
"repo_name": "nicproulx/mne-python",
"id": "dbfa013f6ebd076cbd79297c8c419cf24c5fddf9",
"size": "11085",
"... |
class Solution(object):
def read(self, buf, n):
"""
:type buf: Destination buffer (List[str])
:type n: Maximum number of characters to read (int)
:rtype: The number of characters read (int)
"""
idx = 0
while n > 0:
# read file to buf4
... | {
"content_hash": "79d6578284e2626c5aa13b5a55c6da94",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 59,
"avg_line_length": 29.136363636363637,
"alnum_prop": 0.43993759750390016,
"repo_name": "rx2130/Leetcode",
"id": "8ac6e61eb3f6ed74cba9c989676f40a47a97628c",
"size": "760... |
class PriorityQueue():
def __init__(self, maxHeap=True):
self.heap = []
self.heapsize = 1
self.heap[0] = maxheap
# move the better of left or right into empty
def better_down(empty, left, right):
if right > len(self.heap):
return
if left > len(self.heap)... | {
"content_hash": "9174b89df649570c99d33924f627aa14",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 71,
"avg_line_length": 32.29824561403509,
"alnum_prop": 0.5258011950027159,
"repo_name": "CharlesGust/data_structures",
"id": "3730ba23f9cba34dae7bbc3bfc298f200da434e4",
"s... |
"""Tokenizer that uses a Hub module."""
from tensorflow.python.eager import monitoring
from tensorflow_text.python.ops import hub_module_splitter
from tensorflow_text.python.ops.tokenization import TokenizerWithOffsets
_tf_text_hub_module_tokenizer_create_counter = monitoring.Counter(
'/nlx/api/python/hub_module_... | {
"content_hash": "a63c11adb82e851bb0169751f3f32b41",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 80,
"avg_line_length": 41.7125,
"alnum_prop": 0.6745579862151633,
"repo_name": "nwjs/chromium.src",
"id": "17dc98303e5f74a809f39036b1db23b75a430d7b",
"size": "3953",
"bin... |
from pyshark import LiveCapture
class RemoteCapture(LiveCapture):
"""A capture which is performed on a remote machine which has an rpcapd service running."""
def __init__(self, remote_host, remote_interface, remote_port=2002, bpf_filter=None, only_summaries=False,
decryption_key=None, encryp... | {
"content_hash": "d5f21b6522d8552541944aba37644a8a",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 125,
"avg_line_length": 75.27027027027027,
"alnum_prop": 0.6664272890484739,
"repo_name": "KimiNewt/pyshark",
"id": "eeb390441c40bd3f4084f3d58dc2d0216e54b651",
"size": "278... |
import time
from ethereum.utils import sha3
import rlp
from rlp.utils import encode_hex
from ethereum import processblock
from synchronizer import Synchronizer
from ethereum.slogging import get_logger
from ethereum.chain import Chain
from ethereum.blocks import Block, VerificationFailed
from ethereum.transactions impor... | {
"content_hash": "b7571fe90a632110563b15fad3e9d290",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 98,
"avg_line_length": 41.11926605504587,
"alnum_prop": 0.6212256433139968,
"repo_name": "heikoheiko/pyethapp",
"id": "b0d5e977c9d8a2a077e5cf4d3ae61592d87c9317",
"size": "... |
"""The standard python Queue.Queue class has the join() method for
blocking until all work is done on the queue (signaled by the
task_done() method). Unfortuntely, if you want to stop early
(e.g. due to a fatal error), there is no way to do this.
This is problematic with multi-threading programs.
To address this, we s... | {
"content_hash": "271d3184cf9be77e9df5b14ce6110eb9",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 104,
"avg_line_length": 39.207612456747405,
"alnum_prop": 0.5469067160886065,
"repo_name": "quaddra/engage-utils",
"id": "cd416571544e923d638a5a30060949ac9501518b",
"size"... |
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"NoiseTexture",
"OpenSimplexNoise",
]
def get_doc_path():
return "doc_classes"
| {
"content_hash": "819cbcffdb87b579c46db4c28e379b19",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 29,
"avg_line_length": 12.941176470588236,
"alnum_prop": 0.5909090909090909,
"repo_name": "Faless/godot",
"id": "90b85dbd70d12440a62314485a569185141f383a",
"size": "220",
... |
"""Utility functions for tag databases."""
import re
from hashlib import sha256
class TaggedSeries(object):
prohibitedTagChars = ';!^='
prohibitedValueChars = ';~'
@classmethod
def validateCharacters(cls, tag, value):
"""validate that there are no prohibited characters in given tag/value"""
for char... | {
"content_hash": "b7479a0f1b8f8e2bf1e8ec017ce6d66d",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 98,
"avg_line_length": 32.438709677419354,
"alnum_prop": 0.6453858392999204,
"repo_name": "mcoolive/graphite-web",
"id": "632cd753f2ea8fe43d8f4ef7ba8a4645b68da2b7",
"size"... |
import logging
from neon import NervanaObject
from neon.backends import Autodiff
logger = logging.getLogger(__name__)
class Layer(NervanaObject):
"""
Top level generic neural network layer class from which all other layer
types inherit.
Arguments:
name (string): Name identifying this layer ... | {
"content_hash": "0d114709c4b8b5e8940d41edd14eb2b5",
"timestamp": "",
"source": "github",
"line_count": 902,
"max_line_length": 98,
"avg_line_length": 37.310421286031044,
"alnum_prop": 0.5977001247994295,
"repo_name": "misko/neon",
"id": "d9674b1c6d2550e9d8ee95263b37ce35b1829901",
"size": "34395",
... |
from setuptools import setup
setup(
# Application name:
name="PyEmailWatcher",
# Version number (initial):
version="0.1",
# Application author details:
author="Jason",
# Packages
packages=['pyemailwatcher'],
# Include additional files into the package
include_package_data=Tr... | {
"content_hash": "5ee9af7f2cc22255ceb1b7426feed080",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 59,
"avg_line_length": 18.35483870967742,
"alnum_prop": 0.632688927943761,
"repo_name": "jasongwartz/PyEmailWatcher",
"id": "8f9f64c182c13e028609f1236ef9c2ea25b7a1d6",
"siz... |
import os
import tempfile
import unittest
from pybel import BELGraph
from pybel.dsl import gene, protein, rna
from pybel.manager import Manager
from pybel.testing.utils import n
HGNC = 'HGNC'
dir_path = os.path.dirname(os.path.realpath(__file__))
class ManagerMixin(unittest.TestCase):
def setUp(self):
... | {
"content_hash": "00448886394ce386180c203180cc2f00",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 75,
"avg_line_length": 27.79591836734694,
"alnum_prop": 0.6209618208516887,
"repo_name": "pybel/pybel-tools",
"id": "0f170e53786416ce388a49232a2d72fbe193d6df",
"size": "54... |
from mininet.net import Mininet
from mininet.topo import Topo
from mininet.cli import CLI
from mininet.node import UserSwitch,RemoteController
from mininet.term import makeTerm
import os, time
class MyTopo( Topo ):
"Simple topology example."
def __init__( self):
"Create custom topo."
# Add default me... | {
"content_hash": "627aee8551d0cb83eb420582256af400",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 137,
"avg_line_length": 33.95454545454545,
"alnum_prop": 0.6207050423917894,
"repo_name": "Tesi-Luca-Davide/ryu",
"id": "f7253f2da62ae21d3ff22ab8085cb80e2d6cdb84",
"size": ... |
from nailgun.errors.base import NailgunException
default_messages = {
# common errors
"InvalidData": "Invalid data received",
"AlreadyExists": "Object already exists",
"DumpRunning": "Dump already running",
# REST errors
"CannotDelete": "Can't delete object",
"CannotCreate": "Can't create ... | {
"content_hash": "3510dcc5da9bf18661c451d749bf0ca0",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 91,
"avg_line_length": 37.908256880733944,
"alnum_prop": 0.6870764762826719,
"repo_name": "SmartInfrastructures/fuel-web-dev",
"id": "08b55f95a0234312098de954dabd4005d04b7f7... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('geo', '0008_auto_20181129_1451'),
('geo', '0008_auto_20180918_1037'),
]
operations = [
]
| {
"content_hash": "78a8aea9d5066d1e2918a12e8255cda3",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 43,
"avg_line_length": 18.357142857142858,
"alnum_prop": 0.622568093385214,
"repo_name": "onepercentclub/bluebottle",
"id": "c7975f5139c44adb12572f0f08eae199ee2a2be9",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('basicviz', '0049_auto_20170216_2228'),
]
operations = [
migrations.CreateModel(
nam... | {
"content_hash": "b537e2d3b2996fd3f9bbc934b4f86017",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 126,
"avg_line_length": 44.3,
"alnum_prop": 0.5801354401805869,
"repo_name": "sdrogers/ms2ldaviz",
"id": "c4b4a193daf997395eb2ecf9e42593876e013da5",
"size": "4500",
"bin... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from lib.rnn_cells.base_cell import BaseCell
from lib import linalg
#***************************************************************
class RNNCell(BaseCell):
""""""
#===========... | {
"content_hash": "ec2a88e85c6939a6c23ea6116324b98a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 66,
"avg_line_length": 31.58974358974359,
"alnum_prop": 0.4602272727272727,
"repo_name": "tdozat/Parser",
"id": "d44584022f8a3adccb9f1ac7d841d4e7f4c37728",
"size": "1860",
... |
""" Unit Testing for Day 1
Markus Foote
2017
Call me like this (runs all tests):
$ python -m unittest discover tests
from the /2017 directory
or (only this file's tests):
$ python -m unittest test1
from the /tests directory with appropriate PYTHONPATH for the day1 file
"""
impor... | {
"content_hash": "71ac3e3e740f7e3505c1ecbad50dbcd5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 34.392857142857146,
"alnum_prop": 0.6645898234683282,
"repo_name": "martakus/advent-of-code",
"id": "48a1f53d566a366724bdea1095c6f01158d0cdee",
"size... |
def test():
abs(False)
int(10)
long(False)
float(False)
complex(False)
divmod(False, False)
divmod(<warning descr="Expected type '_N2', got 'str' instead">'foo'</warning>, <warning descr="Expected type '_N2', got 'unicode' instead">u'bar'</warning>)
pow(False, True)
round<warning des... | {
"content_hash": "4663ade89898232b0abb1bdb16c6caa0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 161,
"avg_line_length": 42.8,
"alnum_prop": 0.6518691588785047,
"repo_name": "leafclick/intellij-community",
"id": "a6bea4418bf88624a68b4300db8107a8e1043527",
"size": "428"... |
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension
from Cython.Distutils import build_ext
#setup(name="fastloop",
# ext_modules=cythonize('fastloop.pyx'),
#)
ext_modules=[
Extension("fastloop",
["fastloop.pyx"],
libraries=... | {
"content_hash": "ccb8b1c2a43285a513a0534b7a3ba0eb",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 88,
"avg_line_length": 23.236842105263158,
"alnum_prop": 0.5685164212910532,
"repo_name": "nealbob/nealbob.github.io",
"id": "551e66d8e155f5424828ecc0e224cb3f98542c73",
"si... |
"""
Bot launcher.
This class is responsible for bootstrapping the bot.
"""
import os
import shutil
import sys
from ruamel import yaml
from joku.core.bot import Jokusoramame
def main():
# Read in the config file.
try:
config = sys.argv[1]
except IndexError:
config = "config.yml"
if n... | {
"content_hash": "7d4103607453932cbcc3f706e11ec244",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 68,
"avg_line_length": 20.571428571428573,
"alnum_prop": 0.6472222222222223,
"repo_name": "MJB47/Jokusoramame",
"id": "c731623d2ae9b437c55ac12c9f46f07de2e6172a",
"size": "7... |
"""PyGlove's built-in early stopping policies."""
# pylint: disable=g-bad-import-order
from pyglove.ext.early_stopping.base import EarlyStopingPolicyBase
from pyglove.ext.early_stopping.base import And
from pyglove.ext.early_stopping.base import Or
from pyglove.ext.early_stopping.base import Not
from pyglove.ext.ear... | {
"content_hash": "d7fbbc46fc3a29e27314ea843ac60bef",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 38,
"alnum_prop": 0.8101503759398496,
"repo_name": "google/pyglove",
"id": "386e76793419270a2bc70ad0ca9c8ca141f609ab",
"size": "1116",
"binary": fa... |
"""
For when multiple database are used to store information. Generally this works well for storage but getting from
both databases is generally discouraged.
"""
from .datastore import DataStore, DataStoreException
class MultiStore(DataStore):
"""
MultiStore performs the same command on all passed DataStore O... | {
"content_hash": "7b8f45517768a40ea6f61a1e5b14ec2a",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 117,
"avg_line_length": 33.19083969465649,
"alnum_prop": 0.5911913523459061,
"repo_name": "intel-ctrlsys/actsys",
"id": "f63b1c4d83ad3683b26f7de6f05f621f5d37fb0d",
"size":... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/armor/shared_arm_corellian_supreme_durasteel.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","arm_corellian_supreme_durasteel_n")
#### BEGIN MODIFICATIONS ####
#### ... | {
"content_hash": "cf500ac95fdf77b42ed22161f8b1e1ce",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 101,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.7257617728531855,
"repo_name": "obi-two/Rebelion",
"id": "5c9170a3d5fe004bcd403e140f25f82a5d7a2baf",
"size": "506... |
"""
Copied+modified from rest_framework.negotiation, which is licensed under the BSD license:
*******************************************************************************
Copyright (c) 2011-2016, Tom Christie
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are p... | {
"content_hash": "f7873c96d2e789b8b71b864065e92c68",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 101,
"avg_line_length": 45.85454545454545,
"alnum_prop": 0.6379857256145915,
"repo_name": "erigones/esdc-ce",
"id": "0b1aef2dfd956947f9e50579a13d2104a600bcc9",
"size": "50... |
import unittest
import numpy
from yann.modules.visualizer import save_images
from yann.modules.visualizer import visualizer as v
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock,patch
class TestVisualizer(unittest.TestCase):
def setUp(self):
self.input_ndarray = numpy.z... | {
"content_hash": "2e294e1d12afa3673c2c37a438fd616f",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 156,
"avg_line_length": 44.164,
"alnum_prop": 0.5826464994112852,
"repo_name": "ragavvenkatesan/Convolutional-Neural-Networks",
"id": "48fa2bc8890165c06dc1a95251d0441caaa840... |
from euca2ools.commands.argtypes import delimited_list
from euca2ools.commands.elasticloadbalancing import ELBRequest
from requestbuilder import Arg
from requestbuilder.mixins import TabifyingMixin
def instance_id(inst_as_str):
return {'InstanceId': inst_as_str}
class DeregisterInstancesFromLoadBalancer(ELBRequ... | {
"content_hash": "59ca6e86b96f72bfe4e072a0216a28f0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 42.666666666666664,
"alnum_prop": 0.671875,
"repo_name": "vasiliykochergin/euca2ools",
"id": "48d0e5be00e413ebf10099a60ad84f3a48447129",
"size": "236... |
from scipy import *
from ephem import *
from astropy import *
from astropy import units
# Vasaant Krishnan
def wave(freq): # Frequency to Wavelength
wavelength = c/freq
return wavelength
def freq(wave): # Wavelength to Frequency
frequency = c/wave
return frequency
# Adaptation of J. ... | {
"content_hash": "c5b50b5368b21b6820bfe0acb306333f",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 24.389830508474578,
"alnum_prop": 0.5865184155663655,
"repo_name": "ekadhanda/bin",
"id": "5309a8b717a7a6da3051b34a06035c10f31244e5",
"size": "1439",... |
from __future__ import absolute_import
import responses
from exam import fixture
from sentry.utils.compat.mock import Mock
from requests.exceptions import SSLError
import sentry.identity
from sentry.identity.oauth2 import OAuth2CallbackView
from sentry.identity.pipeline import IdentityProviderPipeline
from sentry.ide... | {
"content_hash": "21a07a4285df17d8a41b325d633bb8fd",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 93,
"avg_line_length": 37.01428571428571,
"alnum_prop": 0.6719413353917406,
"repo_name": "beeftornado/sentry",
"id": "f94fb777ddbbcd5f92dfdf7e84d6edf5680965e9",
"size": "25... |
"""Test the base functions of the media player."""
import base64
from homeassistant.components import media_player
from homeassistant.components.websocket_api.const import TYPE_RESULT
from homeassistant.setup import async_setup_component
from tests.async_mock import patch
async def test_get_image(hass, hass_ws_clie... | {
"content_hash": "bb241f0fc8eee89e1ad1cd1264838aa1",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 88,
"avg_line_length": 31.155913978494624,
"alnum_prop": 0.6098360655737705,
"repo_name": "tboyce021/home-assistant",
"id": "9434fb1a411e4e7c4a2083cad8b2e07e850ac685",
"si... |
import os
from setuptools import setup
setup_dir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(setup_dir, 'README.rst')) as readme_file:
readme = readme_file.read()
with open(os.path.join(setup_dir, 'HISTORY.rst')) as history_file:
history = history_file.read()
setup(
name='pyope'... | {
"content_hash": "72a80ac9f84e17458d7adef11ace2a03",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 81,
"avg_line_length": 28.516129032258064,
"alnum_prop": 0.6357466063348416,
"repo_name": "rev112/pyope",
"id": "6dc8f2b80068b6f5d81f4d98b4f0f3a3135ed239",
"size": "884",
... |
"""annotate fusion outputs from STAR and Tophat
Supported:
oncofuse: http://www.unav.es/genetica/oncofuse.html
github: https://github.com/mikessh/oncofuse
"""
from __future__ import print_function
import os
import pysam
from bcbio.utils import file_exists
from bcbio.distributed.transaction import file_transaction... | {
"content_hash": "c8f307f963ab006cf6e4cb6511e7d3ba",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 117,
"avg_line_length": 42.58682634730539,
"alnum_prop": 0.6190944881889764,
"repo_name": "Cyberbio-Lab/bcbio-nextgen",
"id": "4891a7adf947a7743b1fcf423ea1bc24d5796475",
"... |
from __future__ import annotations
from dials.command_line import missing_reflections
def test_l_cysteine_4_sweeps_scaled(dials_data, capsys):
data = dials_data("l_cysteine_4_sweeps_scaled", pathlib=True)
missing_reflections.run(
args=[str(data / "scaled_30.expt"), str(data / "scaled_30.refl")]
)... | {
"content_hash": "8ecf9456f28f37ca0e05b4d90b97e13a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 88,
"avg_line_length": 42.303030303030305,
"alnum_prop": 0.6429083094555874,
"repo_name": "dials/dials",
"id": "8059794da12ca2777b2ddd025f35990cd3480a07",
"size": "2795",
... |
from datetime import datetime
from operator import methodcaller
import numpy as np
import pytest
import pandas as pd
from pandas import DataFrame, Series
from pandas.core.indexes.datetimes import date_range
from pandas.core.resample import TimeGrouper
import pandas.util.testing as tm
from pandas.util.testing import a... | {
"content_hash": "e563d09d5968382d4358fc226b1d562b",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 73,
"avg_line_length": 34.80451127819549,
"alnum_prop": 0.581551090948369,
"repo_name": "MJuddBooth/pandas",
"id": "2f330d1f2484b7ffaf5247235862c8180a8f5d5f",
"size": "925... |
from __future__ import unicode_literals
import os
from unittest import TestCase
from tempfile import mktemp
import shutil
import datetime
import time
from httmock import all_requests, response, HTTMock
from mock import patch, Mock
@all_requests
def clld(url, request):
res = {
'/resource/languoid/id/stan1... | {
"content_hash": "1ef19639872567d3abb8f88a9b411ac8",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 96,
"avg_line_length": 42.96,
"alnum_prop": 0.5949720670391061,
"repo_name": "clld/clldclient",
"id": "4a90361805ebd70f8920237aafc15f95e84077b0",
"size": "3237",
"binary"... |
import requests
import json
import logging
import csv
import os
import pdb
from elasticsearch import Elasticsearch
import math
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
CSV_FILE_DIRECTORY = 'csv_files'
JSON_FILE_DIRECTORY = 'json_files'
def get_csv_files():
logger.info("Start d... | {
"content_hash": "0c4ead91c31d4c7d181b5a88cea67d41",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 137,
"avg_line_length": 37.8134328358209,
"alnum_prop": 0.5304914150384843,
"repo_name": "FUUbi/07_BaselStats",
"id": "7dc10cc76398bea1ca1cdafb9825629a11005931",
"size": "... |
import pkg_resources
import plone.testing
import zeit.cms.repository.interfaces
import zeit.cms.testing
import zeit.content.image.image
import zeit.content.image.interfaces
import zeit.content.image.testing
import zeit.imp.tests
import zeit.push.testing
import zeit.workflow.testing
import zope.component
product_confi... | {
"content_hash": "35e47378de911db2904d0c0bc873e64a",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 69,
"avg_line_length": 30.783783783783782,
"alnum_prop": 0.7006145741878841,
"repo_name": "ZeitOnline/zeit.content.gallery",
"id": "9057e058e7154f7fd03d773621d3aa2639be863c",... |
import json
import logging
import os
import tempfile
import capture
import maya.cmds as cmds
from .vendor.Qt import QtCore, QtWidgets, QtGui
from . import lib
from . import plugin
from . import presets
from . import version
from . import tokens
from .accordion import AccordionWidget
log = logging.getLogger("Capture ... | {
"content_hash": "3f9116b83b2728b578620f33d2774473",
"timestamp": "",
"source": "github",
"line_count": 711,
"max_line_length": 79,
"avg_line_length": 31.77496483825598,
"alnum_prop": 0.5846759915014165,
"repo_name": "BigRoy/maya-capture-gui",
"id": "1860b084ba351161c167a1eb90a6c18adc840be0",
"size... |
"""WebElement implementation."""
import os
import zipfile
try:
from StringIO import StringIO
except ImportError: # 3+
from io import StringIO
import base64
from .command import Command
from selenium.common.exceptions import WebDriverException
from selenium.common.exceptions import InvalidSelectorException
f... | {
"content_hash": "fb864834a433f8cee2bbbc1151dbca40",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 104,
"avg_line_length": 35.065693430656935,
"alnum_prop": 0.599188176519567,
"repo_name": "neumerance/deploy",
"id": "0df87c87a40c301b29e51cf9215e3862074b8842",
"size": "1... |
from __future__ import unicode_literals
from rest_framework import generics
from rest_framework import serializers as ser
from api.base import utils
from api.base.exceptions import Conflict
from api.base.exceptions import JSONAPIAttributeException
from api.base.serializers import JSONAPISerializer
from api.base.seria... | {
"content_hash": "f931ef3eb4ce9f79ab93bbf347b3e3d9",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 165,
"avg_line_length": 37.17256637168141,
"alnum_prop": 0.6618259730984407,
"repo_name": "sloria/osf.io",
"id": "70b197e2ca06e70f93532651481e74733b49dda2",
"size": "8425"... |
import copy
import typing
from types import SimpleNamespace
from federatedml.param.base_param import BaseParam
from federatedml.param.cross_validation_param import CrossValidationParam
from federatedml.param.predict_param import PredictParam
from federatedml.param.callback_param import CallbackParam
import json
clas... | {
"content_hash": "f8648f98e80bdf04f5ba01b2480530da",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 114,
"avg_line_length": 34.83783783783784,
"alnum_prop": 0.6069304370312905,
"repo_name": "FederatedAI/FATE",
"id": "ebb3e67c84f93f7bd72130282bc9f45527fc8460",
"size": "83... |
"""Conan recipe package for Google FlatBuffers
"""
import os
from conans import ConanFile, CMake, tools
class FlatbuffersConan(ConanFile):
name = "flatbuffers"
version = "1.8.0"
license = "https://github.com/google/flatbuffers/blob/master/LICENSE.txt"
url = "https://github.com/google/flatbuffers"
... | {
"content_hash": "0a2063f7074053f259a14f01bfd87b44",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 90,
"avg_line_length": 37.04,
"alnum_prop": 0.6328293736501079,
"repo_name": "chenkai036/flatbuffers",
"id": "aac7606d0a5c514514c7302254669c33041c9ae2",
"size": "1899",
"... |
"""A library to generate and store the manifests for cros builders to use."""
from __future__ import print_function
import cPickle
import fnmatch
import glob
import logging
import os
import re
import shutil
import tempfile
from chromite.cbuildbot import constants
from chromite.cbuildbot import repository
from chromi... | {
"content_hash": "d8ec6b7285c438343bc218a3c51232ca",
"timestamp": "",
"source": "github",
"line_count": 920,
"max_line_length": 80,
"avg_line_length": 38.323913043478264,
"alnum_prop": 0.6667422996199444,
"repo_name": "mxOBS/deb-pkg_trusty_chromium-browser",
"id": "3aa28bd3e9e5521573b251e0c00b30ddf54... |
"""
Measurement channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
import logging
import zigpy.zcl.clusters.measurement as measurement
from . import AttributeListeningChannel
from .. import registries... | {
"content_hash": "375305f5a525cb523d7afc876787db6a",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 88,
"avg_line_length": 30.662790697674417,
"alnum_prop": 0.7375805839969662,
"repo_name": "joopert/home-assistant",
"id": "369ecb69aa1020e8f10e33ee540451788dfbc0d1",
"size"... |
from __future__ import print_function, unicode_literals
import unittest
import experiments.ud_xilinx.command as UdBoardCommand
from experiments.ud_xilinx.command import UdBoardSimpleCommand
from experiments.ud_xilinx.command import ChangeSwitchCommand, SetPulseCommand, ClockActivationCommand, ClockDeactivationCommand
... | {
"content_hash": "14d0c674fd7a5b4110f8601f090f1fcf",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 128,
"avg_line_length": 29.437956204379564,
"alnum_prop": 0.5576493925117778,
"repo_name": "weblabdeusto/weblabdeusto",
"id": "7065fdab94e12056998a00067aae5d2a674ffcc1",
"... |
from __future__ import division
import numpy
from ..supervised import svm
from ..supervised.classifier import ctransforms
def expected_impacts(D,labels,U):
'''
EIs = expected_impacts(D,labels,U)
Compute Expected impact for each element of U
Eis[i]: P(label[i] == 1) * IMPACT(label[i] == 1) + P(label... | {
"content_hash": "8e38a84096d0ebf4fa87b8a013378c4e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 96,
"avg_line_length": 33.526315789473685,
"alnum_prop": 0.6365777080062794,
"repo_name": "pombredanne/milk",
"id": "e97b70c9d8482e3067e3386fadd3b91d62f1a0e7",
"size": "243... |
import os
import io
import unittest
import json
from . import chargeitemdefinition
from .fhirdate import FHIRDate
class ChargeItemDefinitionTests(unittest.TestCase):
def instantiate_from(self, filename):
datadir = os.environ.get('FHIR_UNITTEST_DATADIR') or ''
with io.open(os.path.join(datadir, fil... | {
"content_hash": "38b0371d5d5ed3ff0042254e896a339f",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 185,
"avg_line_length": 70.63,
"alnum_prop": 0.7217896078153759,
"repo_name": "all-of-us/raw-data-repository",
"id": "79ef9a423ce71bb7c0c629c8aa96c240fd94dd49",
"size": "7... |
import hashlib
from django.db import models
from django.conf import settings
from django.db.models import signals
from django.contrib.auth.models import User
from django.db.models import Q
from cms.managers import BlogPostManager
from cms.storage import OverwriteStorage
import os
MEMBER_IMAGE_FOLDER = 'member'
def ... | {
"content_hash": "b0bda611bd1268362c74eee83a00a6ec",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 153,
"avg_line_length": 37.97570850202429,
"alnum_prop": 0.6353944562899787,
"repo_name": "ncsu-stars/Stars-CMS",
"id": "96337c156b1cac9d8bfad6aec5b355c40eff1f87",
"size":... |
""" Copyright 2015 Akamai Technologies, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicabl... | {
"content_hash": "af159971a2694292a88a0dbe08a2e8a9",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 91,
"avg_line_length": 30.51578947368421,
"alnum_prop": 0.743704725767506,
"repo_name": "dshafik/api-kickstart",
"id": "17dc4c2565630ca3209095af4f856ea7ee75da32",
"size": "... |
import termcolor
import sys
class StrUtils:
def __init__(self):
pass
@staticmethod
def print_log_row(op_code, url, status_code, documented_reason, body, curlcommand):
if type(curlcommand) == str:
curlstr = curlcommand
else:
curlstr = curlcommand.get()
... | {
"content_hash": "4dcf18dd30770dc60e6f734dfb622ec4",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 105,
"avg_line_length": 34.60606060606061,
"alnum_prop": 0.5674255691768827,
"repo_name": "Teebytes/TnT-Fuzzer",
"id": "833059a12a75ffd4db20c5c7f08885fe705577d2",
"size": "... |
""" This package contains the WorkTree object. """
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import os
import abc
import ntpath
import locale
import operator
import posixpath
import six
import qibuild.config
import qisys.sh
import qisys.qixml
... | {
"content_hash": "5562b44a059406842f142e0af57822c0",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 92,
"avg_line_length": 33.13095238095238,
"alnum_prop": 0.5885734818541143,
"repo_name": "aldebaran/qibuild",
"id": "10dc650a601d7a23ac22b2f51a6ded5e78a23a16",
"size": "11... |
from __future__ import absolute_import
import logging
import os.path
import re
from pip._vendor.packaging.version import parse as parse_version
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib import request as urllib_request
from pip._internal.compat import samefile
f... | {
"content_hash": "149d9e4a4d452fcf59d3e4ad3333a89c",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 79,
"avg_line_length": 36.48867313915858,
"alnum_prop": 0.5551219512195122,
"repo_name": "astaninger/speakout",
"id": "9ee2e012f95b21510e1f2695729db9cbd6bc9eb0",
"size": "... |
def f(x):
import math
return 10*math.e**(math.log(0.5)/5.27 * x)
def f1(x):
import math
return 400*math.e**(math.log(0.5)/3.66 * x)
def radiationExposure(start, stop, step):
'''
Computes and returns the amount of radiation exposed
to between the start and stop times. Calls the
functi... | {
"content_hash": "48ec3559f847b73dc9fb3ab9da0d5bee",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 65,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.6290018832391714,
"repo_name": "ahmedraza007/6.00.1x-Introduction-to-Computer-Science-and-Programming-Using-Python",
... |
import sys
from typing import Any, Optional, Mapping, Union
from .layered_mapping import LayeredMapping
def capture_context(
context: Optional[Union[int, Mapping[str, Any]]] = 0
) -> Optional[Mapping[str, Any]]:
"""
Explicitly capture the context to be used by subsequent formula
materialisations.
... | {
"content_hash": "36bc8e424bae6cebabbd719386a963a2",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 80,
"avg_line_length": 44.54761904761905,
"alnum_prop": 0.6942811330839124,
"repo_name": "matthewwardrop/formulaic",
"id": "a1e4cb4952337f8d3ecc6d499c2483ce0f29cb63",
"size... |
import unittest
import numpy as np
from genda.pysam_callbacks.allele_counter import AlleleCounter
from pysam.calignmentfile import AlignedSegment
def make_read(aligned_read, pos, cigar):
aligned_read.pos = pos
aligned_read.cigar = cigar
return aligned_read
class FakeAlignment(AlignedSegment):
""" ... | {
"content_hash": "6fa0618e315cd7a186adae30e3199fc8",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 79,
"avg_line_length": 27.641025641025642,
"alnum_prop": 0.5709647495361782,
"repo_name": "jeffhsu3/genda",
"id": "47b0084f440c9952a5e364573e66567267e6720f",
"size": "2156"... |
from celery import task
from openpds.core.models import Profile, Notification, Device
from bson import ObjectId
from pymongo import Connection
from django.conf import settings
import time
from datetime import date, timedelta
import json
import pdb
import math
import cluster
from gcm import GCM
from openpds.core.models ... | {
"content_hash": "a4a1ad494baf64edefa290b77d7dc918",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 129,
"avg_line_length": 42.86046511627907,
"alnum_prop": 0.6559956592512208,
"repo_name": "patcon/openPDS",
"id": "e648f0756d6c823b96e972e1dc4615f0be833813",
"size": "3686"... |
"""
Script for generating a log file from the archive.
"""
import argparse
from datetime import datetime, timedelta
import os
import sys
try:
from ArchiverAccess.archive_data_file_creator import ArchiveDataFileCreator
except ImportError:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ... | {
"content_hash": "763fe162d7d01bc9ea287532d8ac5e6f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 120,
"avg_line_length": 46.6865671641791,
"alnum_prop": 0.6835038363171355,
"repo_name": "ISISComputingGroup/EPICS-inst_servers",
"id": "17a4f1be38df4b030a6e1591cadd5aed1e4bd... |
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.shortcuts import redirect
from django.db.models import get_model
from django.contrib.auth import login
from django.contrib.auth.models import User
from django.conf import settings
from la_facebook.la_fb_logging import logge... | {
"content_hash": "e111a39208a0a12e7684340862ea7477",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 137,
"avg_line_length": 45.32380952380952,
"alnum_prop": 0.6604328640470687,
"repo_name": "pydanny/django-la-facebook",
"id": "9652e66db850044e83de6ed197ae8c35688508c3",
"... |
"""
analysis.py
Functions to read and plot figures from the batch simulation results.
Can call readPlotNa() or readPlotNMDA() from __main__() or import analysis and call interactively.
"""
import utils
import json
import matplotlib.pyplot as plt
def plotfINa(dataFolder, batchLabel, params, data):
utils.setPlotF... | {
"content_hash": "680618092c4735c9f4b304c29f209ed2",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 110,
"avg_line_length": 33.313131313131315,
"alnum_prop": 0.6397816858702243,
"repo_name": "Neurosim-lab/netpyne",
"id": "fc11f8567b313ac09ca2d3d0541e4bc288c2afd5",
"size":... |
"""Binary for training translation models and decoding from them.
Running this program without --decode will download the WMT corpus into
the directory specified as --data_dir and tokenize it in a very basic way,
and then start training a model saving checkpoints to --train_dir.
Running with --decode starts an intera... | {
"content_hash": "7f6763c390d47fd926b662c18432b903",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 589,
"avg_line_length": 45.91256830601093,
"alnum_prop": 0.6479409664365627,
"repo_name": "neuralconcept/DrWhoAI",
"id": "83056ca3369b6262a72a38cb1e5fdd3221378b65",
"size"... |
class OutputHandler(object):
'''
Output handler is a class of handler object or function
'''
def __init__(self, cmdapp):
self.cmdapp = cmdapp
def __call__(self, item):
return item
class StdoutOutputHandler(OutputHandler):
def __call__(self, item):
print item | {
"content_hash": "a4b8ef19c9c6566896edfd0ff36ce332",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 24.615384615384617,
"alnum_prop": 0.590625,
"repo_name": "denz/swarm-crawler",
"id": "3ce0f83a75e6c8452171832a94ebf6bb0bcb1212",
"size": "320",
"bi... |
def get_primes(value):
return value
for n in range(20):
if value % n == 0:
return False
else:
return True
print(get_primes(20))
| {
"content_hash": "356e78bbd25e9d64c647e045e4930230",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 22,
"avg_line_length": 13,
"alnum_prop": 0.6363636363636364,
"repo_name": "Erianafranky/andela_bootcamp",
"id": "c5069b19bdbce19fabc5f702575e55b1b7cb8637",
"size": "143",
... |
"""System tests for read_gbq using the BigQuery Storage API."""
import functools
import uuid
import pytest
pytest.importorskip("google.cloud.bigquery", minversion="1.24.0")
@pytest.fixture
def method_under_test(project_id, credentials):
import pandas_gbq
return functools.partial(
pandas_gbq.read_... | {
"content_hash": "4b6643f3e727ed3befe7066825037380",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 95,
"avg_line_length": 27.34246575342466,
"alnum_prop": 0.5420841683366734,
"repo_name": "googleapis/python-bigquery-pandas",
"id": "cfb31ea81a6eb9c2e9ad842e3ca7b1a1ca1199d1"... |
"""add event triggers table
Revision ID: 012
Revises: 011
Create Date: 2016-03-04 09:49:52.481791
"""
# revision identifiers, used by Alembic.
revision = '012'
down_revision = '011'
from alembic import op
import sqlalchemy as sa
from mistral.db.sqlalchemy import types as st
def upgrade():
op.create_table(
... | {
"content_hash": "2829256c1d7b3812c49f8b80914012d1",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 71,
"avg_line_length": 31.98076923076923,
"alnum_prop": 0.5995189416716777,
"repo_name": "openstack/mistral",
"id": "b934543fefe23985b45dab57ef3f1e65b65733da",
"size": "225... |
import unittest
from inspector.src.twitter import Twitter
from inspector.src.geocoder import CachedGeocoder
from datetime import datetime, timedelta
class TestTwitter(unittest.TestCase):
""" Test twitter class """
def setUp(self):
self.twitter = Twitter()
def test_twitter_constants(self):
... | {
"content_hash": "1f4cdf00d70ffcf9ecd537c25061c62a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 102,
"avg_line_length": 37.851063829787236,
"alnum_prop": 0.6430578976953345,
"repo_name": "Samael500/social-inspector",
"id": "9e662571957ed4f7747d1996e336e49e2a54c02b",
"... |
from qtpy import QtCore
class SignalContainer(QtCore.QObject):
data_file_created = QtCore.Signal()
data_file_written = QtCore.Signal()
queue_relinquishing_control = QtCore.Signal()
queue_taking_control = QtCore.Signal()
_signal_container = SignalContainer()
data_file_created = _signal_container.data... | {
"content_hash": "f67d254431e463580fabbdd23ebe0e6d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 75,
"avg_line_length": 33.0625,
"alnum_prop": 0.775047258979206,
"repo_name": "wright-group/PyCMDS",
"id": "2f60db5b133984a387fe852913568326c7fb7262",
"size": "529",
"bin... |
import re
import shortuuid
from enum import Enum
import oa_evidence
from app import db
from app import logger
from pdf_url import PdfUrl
from reported_noncompliant_copies import is_reported_noncompliant_url
from util import clean_doi
from util import is_doi_url
def url_sort_score(url):
url_lower = url.lower()
... | {
"content_hash": "3dfff1fb80bea98711d1a1901b18ec2c",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 131,
"avg_line_length": 27.661073825503355,
"alnum_prop": 0.568239718549072,
"repo_name": "Impactstory/oadoi",
"id": "30641eb54b70c6ce110b15452c9083412792b8de",
"size": "8... |
from wtforms import Form
from wtforms import TextField, SelectField
from wtforms.validators import DataRequired, ValidationError, Required
from ..base import BaseReactForm
class ReactForm(BaseReactForm):
''' Class that creates a Reaction form for the dashboard '''
title = "Heroku: Restart All Dynos"
descri... | {
"content_hash": "fce92583db6c8516dbfb34224f374faa",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 385,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.6629969418960244,
"repo_name": "madflojo/cloudroutes-service",
"id": "0f8b6a4e5968b71fe2ba07015777ce04c764f9fa",
... |
import pexpect
import time
import unittest
import node
LEADER = 1
ROUTER1 = 2
class Cert_5_1_06_RemoveRouterId(unittest.TestCase):
def setUp(self):
self.nodes = {}
for i in range(1,3):
self.nodes[i] = node.Node(i)
self.nodes[LEADER].set_panid(0xface)
self.nodes[LEADER... | {
"content_hash": "dc5d9d88a9c39d6c62ff38a399496b21",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 74,
"avg_line_length": 29.384615384615383,
"alnum_prop": 0.612565445026178,
"repo_name": "JiahuiZHONG/Internship_Thread",
"id": "b43d9015f2161e4d7832d362a72448ea1adb076a",
... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(847, 761)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self... | {
"content_hash": "0978e0f33e962c1f529aa84b8933a284",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 115,
"avg_line_length": 58.99186991869919,
"alnum_prop": 0.7273980154355016,
"repo_name": "cwebber314/pyqt_db",
"id": "797294dcaa0b41fcaa472616bc3b74e212fb604a",
"size": "... |
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.test import SimpleTestCase
from tests.testapp.models import TestModel
from tinymce.widgets import AdminTinyMCE
class TestModels(SimpleTestCase):
def setUp(self):
self.site = AdminSite()
def test_htmlfield(s... | {
"content_hash": "016c6e8f3a32850b629d2f37a743bbca",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 91,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.7574468085106383,
"repo_name": "aljosa/django-tinymce",
"id": "74ccfdca58cd302cadc1343ed93b659239942178",
"size":... |
import sys
import re
import operator
if __name__ == "__main__":
try:
common_tags_filename = sys.argv[1]
tags_file = open(common_tags_filename, "r")
try:
tmp_sequences = {}
pos_general_regex = re.compile(r"((\w+)\\\+)")
for ct in tags_file:
... | {
"content_hash": "93d9ea0cb08f589d5e9db27bbce6c1a5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 103,
"avg_line_length": 43.54,
"alnum_prop": 0.4648598989435002,
"repo_name": "snovd/test-scripts",
"id": "c664eb2ea4596425bf3867da349a3d37a8e69276",
"size": "2196",
"bin... |
import os
from .executable import Executable
def get_tool_path(name):
"""Find the path to one of problemtools' external tools.
Args:
name (str): which tool is wanted (one of [default_grader,
default_validator, interactive, checktestdata, viva.sh])
Returns:
str, path to the too... | {
"content_hash": "bc35870c5a611cba828e914be809b299",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 32.95744680851064,
"alnum_prop": 0.5648805681084571,
"repo_name": "ghamerly/problemtools",
"id": "78408cc2612b21d0ce336e97f7817fde274ac334",
"size": ... |
import _plotly_utils.basevalidators
class ShowspikesValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showspikes", parent_name="layout.xaxis", **kwargs):
super(ShowspikesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_n... | {
"content_hash": "99764e4a550f9bbb6c64a9e293d767f3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 87,
"avg_line_length": 37.72727272727273,
"alnum_prop": 0.636144578313253,
"repo_name": "plotly/plotly.py",
"id": "44f0c8a5c4d91b0dcd3b7a5979460d61cd06e83f",
"size": "415",... |
import sys
PATH_INSTALL = "./"
sys.path.append( PATH_INSTALL )
from androguard.core.bytecodes import dvm, apk
TEST = "../apks/Zitmo.apk"
a = apk.APK( TEST )
a.show()
j = dvm.DalvikVMFormat( a.get_dex() )
# SHOW CLASS (verbose)
#j.show()
| {
"content_hash": "fd7d07bf6c76c49743e0581ebb4b1bc9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 47,
"avg_line_length": 15.25,
"alnum_prop": 0.6598360655737705,
"repo_name": "congthuc/androguard-2.0-custom",
"id": "748d4e980d768115456a314775edd97abd3421e3",
"size": "26... |
"""Benchmark halLodExtract by extracting with a bunch of different
stepsizes then seeing how much smaller they get. Also (optionally)
use mafComparator (https://github.com/dentearl/mafTools) together with
comparatorSummarizer.py (https://github.com/dentearl/mwgAlignAnalysis)
"""
import argparse
import os
import sys
im... | {
"content_hash": "ddcb01456093fc5dba43b20b239e7126",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 89,
"avg_line_length": 39.57,
"alnum_prop": 0.6000758150113723,
"repo_name": "glennhickey/hal",
"id": "11b012fe7e968611b234ebe155c4fef4ce922763",
"size": "8110",
"binary... |
"""
experiment_poincare_1a.py
Poincare map generation on Colluci Nunez
Author: Yuan Wang
"""
from thesis_utils import *
from thesis_defaults import *
from thesis_poincare_utils import *
from thesis_plot_utils import *
import scipy.integrate as integrate
import scipy.special as special
from scipy.integrate import quad... | {
"content_hash": "923243172b5384ed52e1c369284c1475",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 110,
"avg_line_length": 27.268115942028984,
"alnum_prop": 0.5259101780494286,
"repo_name": "yuanagain/seniorthesis",
"id": "c9b8aece9d202af4f104f199a637d13292887f33",
"siz... |
"""
WSGI config for edjango 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | {
"content_hash": "c985a3bdcb4a80d393e4d39961e5fd10",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.4375,
"alnum_prop": 0.7698209718670077,
"repo_name": "sarusso/eDjango",
"id": "3abe3f5ce28d647ab3fbe988daf7d90b7b555743",
"size": "391",
"binary... |
def main():
# Test suite
tests = [
[None, None, None], # Should throw a TypeError
['abcd', 'abcde', 'e'],
['aaabbcdd', 'abdbacade', 'e'],
['abdbacade', 'aaabbcdd', 'e']
]
for item in tests:
try:
temp_result = find_diff(item[0], item[1])
if... | {
"content_hash": "c7610c0bf6b5e3873fc2771dfa29ea24",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 134,
"avg_line_length": 27.863636363636363,
"alnum_prop": 0.5570962479608483,
"repo_name": "HKuz/Test_Code",
"id": "2380ef8fbb0690534d6a375fb9affc8fce7fca07",
"size": "1253... |
import numpy
from .base import Sequence
class Binary(Sequence):
"""Binary sequence."""
# TODO complete docstring.
def __init__(self, picture_time):
bit_planes = 1 # bit depth of the pictures
pic_num = 2 # number of pictures
Sequence.__init__(self, bit_planes, pic_num)
... | {
"content_hash": "82747e3899eb1b7e0ccaec48bf27184c",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 98,
"avg_line_length": 27.5,
"alnum_prop": 0.6012987012987013,
"repo_name": "BaptisteLefebvre/pyalp",
"id": "139643e5ade389bf2976cc4afba1d9bf8d4450b9",
"size": "770",
"bi... |
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="PySysC-SCC",
version="0.0.1",
author="MINRES Technologies GmbH",
author_email="info@minres.com",
description="SCC python modules for intergration in PySysC",
long_de... | {
"content_hash": "e85007192dea4215e03eef455d17929e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 81,
"avg_line_length": 33.70967741935484,
"alnum_prop": 0.6392344497607656,
"repo_name": "Minres/SystemC-Components",
"id": "18780586b95d617ffa67c62a590f4227297b2db6",
"siz... |
import functools
import eventlet
import netaddr
import six
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.openstack.common import jsonutils
def ensure_string_keys(d):
# http://bugs.python.org/issue4978
return dict([(str(k), v) for k, v in d.iteritems()])
# Constants f... | {
"content_hash": "101dfa576472242eb6c053c469697cc9",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 79,
"avg_line_length": 32.719424460431654,
"alnum_prop": 0.5653034300791556,
"repo_name": "ycl2045/nova-master",
"id": "cba086dfca019c65e5e809bd06deb0db3cf203b8",
"size": ... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('twilio', '0002_sms_pub_date'),
]
operations = [
migrations.AlterField(
model_name='sms',
name='pub_date',
... | {
"content_hash": "06ca39d787eecfca648ab885c31af072",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 102,
"avg_line_length": 23.05263157894737,
"alnum_prop": 0.6210045662100456,
"repo_name": "niksolaz/PySms",
"id": "e04b58d4b01aefa60b3d42717c6d07edd378e5d0",
"size": "462",... |
class SystemProperties:
def __init__(self, properties=None):
self.system_properties = {}
if properties:
self.system_properties = properties
def add_property(self, key, value):
self.system_properties.update({key: value})
def to_dict(self):
return self.system_prop... | {
"content_hash": "6959472c593fc4c935a925c976f9ee9d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 51,
"avg_line_length": 29.727272727272727,
"alnum_prop": 0.6330275229357798,
"repo_name": "tbeckham/DeploymentManager",
"id": "e4b790ac372fd34724d96612d16c937e77f3285b",
"s... |
"""
Copyright (c) 2011, The MITRE Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the... | {
"content_hash": "a4be2e28cfcd619a18e509a5e962ac3a",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 77,
"avg_line_length": 32.72727272727273,
"alnum_prop": 0.7095238095238096,
"repo_name": "nemonik/Intellect",
"id": "ed85b1a533b274087bdb6a4cb0039c19161824f2",
"size": "255... |
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
import views
urlpatterns = patterns(
'',
url(r'^$', views.index),
url(r'^donate.html$', TemplateView.as_view(template_name='donate.html')),
url(r'^about.html$', TemplateView.as_view(template_name='about.html')),
... | {
"content_hash": "64bdf10114ee63b1aa22430c6315d73c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 77,
"avg_line_length": 39.05882352941177,
"alnum_prop": 0.6822289156626506,
"repo_name": "leVirve/NTHU_Course",
"id": "a0fa254832f4fc410a641033d78ba905c2a518e3",
"size": "6... |
from django.core.urlresolvers import reverse
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 tabs
from horizon.utils import memoized
from horizon import workflows
from openstack_dashb... | {
"content_hash": "3e69d0305a285765659294ddc0db9e49",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 79,
"avg_line_length": 39.651006711409394,
"alnum_prop": 0.5987643872714963,
"repo_name": "sandvine/horizon",
"id": "5f120e122dd80238f6848ba7b51f8c6a36fcc36a",
"size": "12... |
from __future__ import absolute_import
import copy
import json
import re
from urllib.parse import urlparse
from svtplay_dl.error import ServiceError
from svtplay_dl.fetcher.hds import hdsparse
from svtplay_dl.fetcher.hls import hlsparse
from svtplay_dl.fetcher.http import HTTP
from svtplay_dl.service import OpenGraph... | {
"content_hash": "f5714b648305ecc2f313e3033922d3ba",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 135,
"avg_line_length": 38.734693877551024,
"alnum_prop": 0.5958904109589042,
"repo_name": "olof/svtplay-dl",
"id": "d6eea127711ea16a7d2a8d7b53b3da7af6014624",
"size": "189... |
"""5
Revision ID: 3ec4ff2461dd
Revises: 57ca0cf95e25
Create Date: 2014-03-28 19:48:38.056555
"""
# revision identifiers, used by Alembic.
revision = '3ec4ff2461dd'
down_revision = '57ca0cf95e25'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjus... | {
"content_hash": "5308fd1e3ccb57413a1d40642d752e17",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 63,
"avg_line_length": 19,
"alnum_prop": 0.6821862348178138,
"repo_name": "SuperQuest/v1",
"id": "9112b19857f44e90a264aaa1ac7dde0aa1edf57a",
"size": "494",
"binary": fals... |
from visual_dynamics.envs import Env
class RosEnv(Env):
pass
| {
"content_hash": "161a787506ba53289a2345946d82077d",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 13.4,
"alnum_prop": 0.7313432835820896,
"repo_name": "alexlee-gk/visual_dynamics",
"id": "257e1d1616606a6abf644c17e9d1f47f075bdc33",
"size": "67",
"... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import vim
def GetCurrentBufferNumber():
return vim.current.buffer.number
def BufNumberToName( bufnr ):
return vim.eval( 'bufname({0})'.format( bufnr ) )
de... | {
"content_hash": "a4ea0ce414ac6161761e5af3ec84906a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 23.92753623188406,
"alnum_prop": 0.6608116293155664,
"repo_name": "davits/DyeVim",
"id": "c2bf6707a96e1440e36e842b3ae91d0beb93deaa",
"size": "2796",
... |
"""Interfaces for the quadrature package."""
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from .base_gp import IBaseGaussianProcess # noqa: F401
from .standard_kernels import ( # noqa: F401
IRBF,
IBrownian,
IProductBrownian,
IProduc... | {
"content_hash": "5be2bd68f0e0b2c8f1c88c0bdc4a2e64",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 73,
"avg_line_length": 21.814814814814813,
"alnum_prop": 0.6842105263157895,
"repo_name": "EmuKit/emukit",
"id": "b92d6a366fa4817466b3b5d0c9a00ec8d4ff1713",
"size": "589",
... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from .webfront import dispatcher
from ws4py.websocket import EchoWebSocket
from ws4py.server.wsgiutils import WebSocketWSGIApplication
class WebSocketHandler(EchoWebSocket):
def __init__(self, *args, **kw... | {
"content_hash": "77ad7c35b8d6c293644ba6ca69fd3573",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 63,
"avg_line_length": 29.95,
"alnum_prop": 0.6894824707846411,
"repo_name": "eavatar/ava",
"id": "96a79dbb7b11654de0fc454fa7be5931801a2c40",
"size": "623",
"binary": fal... |
"""
Basic data structures needed to support dialogue system.
"""
from __future__ import print_function, unicode_literals
from collections import defaultdict
#noinspection PyUnresolvedReferences
from random import random, randrange
import textwrap
#todo: complex boolean conditionals
class Condition(object):
"""
... | {
"content_hash": "c65b3517aaa8efee29dee5f376f5407d",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 78,
"avg_line_length": 31.880546075085324,
"alnum_prop": 0.5268172572529708,
"repo_name": "dfuentes/dialogue",
"id": "e359fa77c1e0b01eb69892c39d7c3ffcc367973d",
"size": "9... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "48b5337a5daa2bc93a08913945d09457",
"timestamp": "",
"source": "github",
"line_count": 732,
"max_line_length": 296,
"avg_line_length": 32.83196721311475,
"alnum_prop": 0.715849040902093,
"repo_name": "benfinke/ns_python",
"id": "c7991019deb8cf7c8111cf3390a43f1edc5c872d",
"size": "2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.