text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
# True if running Python 2.x
IS_PY2 = sys.version_info[0] == 2
# String types per Python version
STR_TYPES = (str, unicode) if IS_PY2 else (bytes, str) # noqa
| {
"content_hash": "9b2caa7db47ea8cb3c980c25491f4532",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 24.714285714285715,
"alnum_prop": 0.6878612716763006,
"repo_name": "grappa-py/grappa",
"id": "a53ffb1f01675eebf681f4abb247e8a959968eee",
"size": "197"... |
USER_COOKIE_NAME = 'user'
| {
"content_hash": "153fba9f684d665cdd10452ebc942331",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.6923076923076923,
"repo_name": "best-coloc-ever/globibot",
"id": "f2b3288a3bf1fa58e6a2687a85ed66cbce5779fd",
"size": "26",
"bina... |
from abc import ABCMeta, abstractmethod
class Field(object, metaclass=ABCMeta):
"""
The "leaf" primitive data type in a schema.
E.g. string, integer, float, etc.
:param description: textual explanation of what the field represents
:param required: True by default. If false - the field is optional... | {
"content_hash": "d5995270f467f655f73374a7e63e1ad9",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 78,
"avg_line_length": 28.01904761904762,
"alnum_prop": 0.5771583956492182,
"repo_name": "gurunars/dict-validator",
"id": "f7602d14aedb36647f33978bde7f3355ca73c94f",
"size... |
from __future__ import division
from __future__ import print_function
import codecs
import pydot_ng as pydot
import pyparsing
import sys
__author__ = ['Michael Krause', 'Ero Carrera']
__license__ = 'MIT'
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
basestring = str
class P_AttrList(object):
def __ini... | {
"content_hash": "9046e3bb49572ba51f700790be4a2296",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 78,
"avg_line_length": 30.48062015503876,
"alnum_prop": 0.5358596134282808,
"repo_name": "pydot/pydot-ng",
"id": "12a97d7aa6605e685c2d2cbc6baedea8beaf25f8",
"size": "16054... |
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('rango', '0001_initial'),
]
operations = [
migrat... | {
"content_hash": "34a6088486440c942607650f6c0780d9",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 31.75,
"alnum_prop": 0.6023622047244095,
"repo_name": "anderscui/django-play",
"id": "edab439ed36106f1dfb851c103dfa4871b117923",
"size": "786",
"b... |
from numpy import eye
from numpy.testing import assert_allclose
from glimix_core.cov import EyeCov
def test_eyecov():
cov = EyeCov(2)
cov.scale = 1.5
assert_allclose(cov.value(), 1.5 * eye(2))
assert_allclose(cov._check_grad(), 0, atol=1e-5)
| {
"content_hash": "ea75567d11aab68512a1a57058813a6b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 23.727272727272727,
"alnum_prop": 0.6819923371647509,
"repo_name": "limix/glimix-core",
"id": "b4102061cf0c623f83944269043594df2649aa5a",
"size": "26... |
class Solution(object):
def minCostII(self, costs):
"""
:type costs: List[List[int]]
:rtype: int
"""
row=len(costs)
if not row: return 0
col=len(costs[0])
premin=presec=0
preidx=-1
for i in xrange(row):
curmin=cursec=1<<31
... | {
"content_hash": "b0937bbeb3dd7f4d905b8469dc3e19b5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 52,
"avg_line_length": 30.5,
"alnum_prop": 0.4364754098360656,
"repo_name": "Tanych/CodeTracking",
"id": "0f0375978d8e2aa08890708de3f97129c22feea3",
"size": "976",
"binar... |
from __future__ import absolute_import, unicode_literals
from google.appengine.ext import ndb
from gaecookie.decorator import no_csrf
from gaeforms import base
from gaeforms.base import Form
from gaeforms.ndb.form import ModelForm
from gaegraph.model import Node
from gaepermission.decorator import login_required
from c... | {
"content_hash": "e22d40b76fcd233e5014e10d345e7d1a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 67,
"avg_line_length": 29.761904761904763,
"alnum_prop": 0.7264,
"repo_name": "ericMayer/tekton-master",
"id": "9a3c4b1e7844fc9a7b76794bf26886c40e678524",
"size": "1274",
... |
import requests
import json
HOSTNAME = "spider-ai.ddns.net"
PORT = "80"
SERVER = "http://" + HOSTNAME + ":" + PORT
TEAM_PASSWORD = ""
TEAM_NAME = ""
def authenticate(name, password):
global TEAM_PASSWORD
TEAM_PASSWORD = password
global TEAM_NAME
TEAM_NAME = name
def validate_credentials(*args):
... | {
"content_hash": "9eeaeb19c91529675adeca67f09314c4",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 96,
"avg_line_length": 28.037974683544302,
"alnum_prop": 0.6117381489841986,
"repo_name": "gzuidhof/aiws-api",
"id": "8d5c8659fc0ee5f0cb0cb4086000dede50f33001",
"size": "22... |
import os
import re
from io import StringIO
from django.contrib.gis.gdal import GDAL_VERSION, Driver, GDALException
from django.contrib.gis.utils.ogrinspect import ogrinspect
from django.core.management import call_command
from django.db import connection, connections
from django.test import SimpleTestCase, TestCase, ... | {
"content_hash": "846138af80285832b7d6e2aa5877f410",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 107,
"avg_line_length": 40.58620689655172,
"alnum_prop": 0.592820730671198,
"repo_name": "koordinates/django",
"id": "932d5bd9ab5a4e1aacf775f4b157337368c57383",
"size": "9... |
from time import time
from functools import wraps
import boto3
import botocore.exceptions
from boto3.session import Session
def required_params(*params):
"""Wrapper to verify that all parameters that are required have been
provided as part of the request. This wrapper should be used by any method
in the... | {
"content_hash": "f7eb9cda9a4918edce89b251c870e3a6",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 79,
"avg_line_length": 40.12676056338028,
"alnum_prop": 0.5926289926289926,
"repo_name": "epoelke/rds-service-broker",
"id": "62461d99a125ba8f807c912cec89adeff1541d1a",
"s... |
import json
from docutils import nodes
from docutils import statemachine
from sphinx.util.compat import Directive
from sphinx.util.nodes import set_source_info
import jsonschema
class jsonschema_node(nodes.Element):
pass
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, se... | {
"content_hash": "e25dfbf0c538af92c1f68cf8aef9b58b",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 83,
"avg_line_length": 29.33157894736842,
"alnum_prop": 0.542077875471021,
"repo_name": "emilyvon/understanding-json-schema",
"id": "64705279d78561c9f87c89d65f254631bab5defc... |
from bambou import NURESTFetcher
class NUZFBRequestsFetcher(NURESTFetcher):
""" Represents a NUZFBRequests fetcher
Notes:
This fetcher enables to fetch NUZFBRequest objects.
See:
bambou.NURESTFetcher
"""
@classmethod
def managed_class(cls):
""" Return... | {
"content_hash": "2d03a43f44b11ebd2228223c04a4024a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 63,
"avg_line_length": 20.4,
"alnum_prop": 0.6039215686274509,
"repo_name": "nuagenetworks/vspk-python",
"id": "402b31ae0255d7f99afb8848f5beb0eb1bb3de72",
"size": "2121",
... |
import logging
import os
import shutil
import sys
import time
from girder_worker.app import app
from girder_worker.utils import girder_job
@girder_job(title='Create a pyramidal tiff using vips', type='large_image_tiff')
@app.task(bind=True)
def create_tiff(self, inputFile, outputName=None, outputDir=None, quality=90... | {
"content_hash": "b360d8c24afb5f0733aec7320120eda7",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 98,
"avg_line_length": 40.494623655913976,
"alnum_prop": 0.6306425916091344,
"repo_name": "girder/large_image",
"id": "595e7183065e8a8842ef7635a1dd29e1e76c8891",
"size": "... |
from __future__ import with_statement
from collections import OrderedDict
import cookielib
import urlparse
from requests import Request
from requests.cookies import cookiejar_from_dict, RequestsCookieJar
from requests.structures import CaseInsensitiveDict
from requests.utils import to_key_val_list
def is_absolute(ur... | {
"content_hash": "8e3ed9747bb61bf694a0431247abef2a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 131,
"avg_line_length": 33.16981132075472,
"alnum_prop": 0.757679180887372,
"repo_name": "akx/stackspy",
"id": "0b3b108b872927d04328e84b213631b0f29f0a7e",
"size": "1782",
... |
import tw2.core as twc
import tw2.jqplugins.select2 as twsel
from tw2.core.validation import Validator
select2_persistence_js = twc.JSSource(src='''
// This function returns the value of the specified GET parameter.
// The code has been found at the following url:
// http://stackoverflow.com/questions/544... | {
"content_hash": "c0b241bebdc9b3bf14c0fedf789e4cb4",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 96,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.4324775353016688,
"repo_name": "pyjobs/web",
"id": "e309e94b0d27cf5469ba0f56242e28cbba888ac2",
"size": "7814",
... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('operation_finance', '0029_auto_20170718_1637'),
]
operations = [
migrations.AlterField(
model_name='invoice',
... | {
"content_hash": "f958b09d426461587c0ea730b695ae7d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 23.68421052631579,
"alnum_prop": 0.6155555555555555,
"repo_name": "michealcarrerweb/LHVent_app",
"id": "3b6ddba8d438550016945bdf7246e9db316ba061",
"s... |
from __future__ import print_function
"""
test_subpipeline.py
Demonstrates the new Ruffus syntax in version 2.6
"""
import os
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, grandparent_dir)
... | {
"content_hash": "7200cd37c76b5d95a2f6d3674f92445e",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 136,
"avg_line_length": 38.435,
"alnum_prop": 0.5792897098998309,
"repo_name": "pombreda/ruffus",
"id": "01a86d775fdd85f62de3035615e43e99ecd20d8a",
"size": "7709",
"bina... |
import xml4h
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(
name=xml4h.__title__,
version=xml4h.__version__,
description='XML for Humans in Python',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
au... | {
"content_hash": "6755a4ea3f8562103c68ac439b3d398f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 60,
"avg_line_length": 30.11627906976744,
"alnum_prop": 0.593050193050193,
"repo_name": "jmurty/xml4h",
"id": "07123c0843a82dff5d01b01c460e55a053ec7701",
"size": "1342",
... |
from oslo_log import log
import oslo_messaging
from sqlalchemy.orm import exc
from neutron.api.rpc.handlers import dvr_rpc
from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.c... | {
"content_hash": "e6115aefe66473ad28ebab0210c3b730",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 78,
"avg_line_length": 44.435344827586206,
"alnum_prop": 0.5405955960810942,
"repo_name": "JioCloud/neutron",
"id": "b9d478cd51a20791cc352b343cec4a86644a41ff",
"size": "10... |
import os,sys
import httplib2,hashlib
http = httplib2.Http()
def l_main(cmd):
if cmd == 'l_version' :return l_version()
if cmd == 'l_update' :return l_update()
if cmd == 'l_pwd' :return l_pwd()
return False
def l_pwd():
return sys.path[0]
def l_version():
return '0.2'
def file_md5(filename):
f = open(filena... | {
"content_hash": "729eb8f46f6e4b4819d9aade3886b52f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 60,
"avg_line_length": 23.185185185185187,
"alnum_prop": 0.6493610223642172,
"repo_name": "selboo/starl-mangle",
"id": "3c286b324f2b6b982e69b7e1b01186905200e21b",
"size": "... |
"""Tests for all code snippets used in public docs."""
import glob
import gzip
import logging
import os
import tempfile
import unittest
import uuid
import apache_beam as beam
from apache_beam import coders
from apache_beam import pvalue
from apache_beam import typehints
from apache_beam.coders.coders import ToStringC... | {
"content_hash": "c0c24569de3aa9e077b021f7a30d5303",
"timestamp": "",
"source": "github",
"line_count": 913,
"max_line_length": 80,
"avg_line_length": 35.989047097480835,
"alnum_prop": 0.6256010712764015,
"repo_name": "dhalperi/incubator-beam",
"id": "f7b51a75e7ebbaad392f81bd249ab7ce45c5c3c7",
"siz... |
<<<<<<< HEAD
<<<<<<< HEAD
"""ParenMatch -- An IDLE extension for parenthesis matching.
When you hit a right paren, the cursor should move briefly to the left
paren. Paren here is used generically; the matching applies to
parentheses, square brackets, and curly braces.
"""
from idlelib.HyperParser import HyperParser
... | {
"content_hash": "3322bf4eefe57e1d721466316769154c",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 79,
"avg_line_length": 37.553703703703704,
"alnum_prop": 0.6227131515360718,
"repo_name": "ArcherSys/ArcherSys",
"id": "68011717f21b6ae7b219ca06305a260205eb36c2",
"size": ... |
from asio.file import File, DEFAULT_BUFFER_SIZE
from asio.interfaces.base import Interface
import sys
import os
if os.name == 'posix':
import select
# fcntl is only required on darwin
if sys.platform == 'darwin':
import fcntl
F_GETPATH = 50
class PosixInterface(Interface):
@classmethod
... | {
"content_hash": "0355d829e27eecd04933b2e7a7a9e737",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 85,
"avg_line_length": 24.128440366972477,
"alnum_prop": 0.5494296577946768,
"repo_name": "pannal/Subliminal.bundle",
"id": "b235c02b951ccff28ea358281fb4118feaf82607",
"si... |
"""Contains the base Layer class, from which all layers inherit."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import inspect # Necessary supplement to tf_inspect to deal with variadic args.
import itertools
import numpy as np
from si... | {
"content_hash": "b17c7955d6e4770e0093a09e9dd32bb0",
"timestamp": "",
"source": "github",
"line_count": 1744,
"max_line_length": 108,
"avg_line_length": 39.747133027522935,
"alnum_prop": 0.6466481051371197,
"repo_name": "hfp/tensorflow-xsmm",
"id": "f7c51f7993116f78fbfb251a766b1f792aebac90",
"size"... |
import shutil
from os.path import exists, getsize
from subfind.utils import get_file_content
from subfind_provider_subscene import SubsceneFactory
from tempfile import mkdtemp
__author__ = 'hiepsimu'
import logging
import unittest
logging.basicConfig(level=logging.DEBUG)
class ScenarioTestCase(unittest.TestCase):
... | {
"content_hash": "57591bf67f2ac82940bc2130d08a03cd",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 92,
"avg_line_length": 31.59259259259259,
"alnum_prop": 0.5615474794841735,
"repo_name": "thongdong7/subfind",
"id": "436f449b5abee2c4c93a266fa4ec58cb6ecc5c10",
"size": "17... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from builtins import * # noqa
from ycmd.responses import ServerError
# Throws an exception if re... | {
"content_hash": "e9401b7ca6c8e6423a58071de76b4f6f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 35.870370370370374,
"alnum_prop": 0.7062467733608673,
"repo_name": "rfguri/vimfiles",
"id": "ff304f97b2091151e4dc87edd33e09b58e480898",
"size": "2614... |
"""Transform meshes to shapes on the screen."""
# Copyright © 2014 Mikko Ronkainen <firstname@mikkoronkainen.com>
# License: MIT, see the LICENSE file.
import numpy as np
from pymazing import color, rasterizer, clipper
def render_meshes(meshes, world, camera, framebuffer, do_frustum_culling=True, do_backfa... | {
"content_hash": "861f2a221d20a1e9c828972f31c37938",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 134,
"avg_line_length": 43.44978165938865,
"alnum_prop": 0.6258291457286432,
"repo_name": "mikoro/pymazing",
"id": "7f3c5e33783e5e7135b6c75ee66a23f74bd5e242",
"size": "995... |
import json
import httpretty
from analyticsclient.tests import ClientTestCase
class StatusTests(ClientTestCase):
@httpretty.activate
def test_alive(self):
"""
Alive status should be True if server responds with HTTP 200, otherwise False.
"""
# Normal behavior
httpret... | {
"content_hash": "7e4485c97cefc2cac1c689a1f161c7ab",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 102,
"avg_line_length": 32.646153846153844,
"alnum_prop": 0.6427898209236569,
"repo_name": "nagyistoce/edx-analytics-data-api-client",
"id": "e45e4ca592e719d19963a5edeaad3303... |
"""
Tests for L{pyflakes.scripts.pyflakes}.
"""
import os
import sys
import shutil
import subprocess
import tempfile
from unittest2 import skipIf, TestCase
from pyflakes.messages import UnusedImport
from pyflakes.reporter import Reporter
from pyflakes.api import (
checkPath,
checkRecursive,
iterSourceCod... | {
"content_hash": "06a0fe4686f8dcf7c9f429c36022b29d",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 80,
"avg_line_length": 32.001782531194294,
"alnum_prop": 0.5760040104717874,
"repo_name": "neumerance/cloudloon2",
"id": "2e78352f704792f94f5bdf2d795e31b2589c0b72",
"size"... |
"""
Exodus Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the h... | {
"content_hash": "61bd8fc16d7285e3f1e1850da5067e97",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 226,
"avg_line_length": 38.0735294117647,
"alnum_prop": 0.5641174198532252,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "b59a708e87cd8b52e1a68c255a13da24676dc2b7",
... |
import unittest
import robocup
import main
import evaluation.opponent
import constants
class TestPassing(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(TestPassing, self).__init__(*args, **kwargs)
self.context = robocup.Context()
def setUp(self):
main.set_context(self.c... | {
"content_hash": "710da6fba67174582c6e07135f434d77",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 88,
"avg_line_length": 39.104,
"alnum_prop": 0.6102700490998363,
"repo_name": "JNeiger/robocup-software",
"id": "417fa5a19bfd5b3fbfdd50d8333bf550abb29992",
"size": "4888",... |
import ShareYourSystem as SYS
#Define
@SYS.PropertiserClass()
class MakerClass(SYS.PrinterClass):
def default_init(self,
_MakingMyFloat={
'DefaultValueType':property,
'PropertyInitVariable':3.,
'PropertyDocStr':'I am doing the thing here'
}
):
SYS.PrinterClass.__init__(self)
#Pri... | {
"content_hash": "780a8d916c3d4010ef7bb8b446164c9f",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 81,
"avg_line_length": 25.42,
"alnum_prop": 0.7293469708890638,
"repo_name": "Ledoux/ShareYourSystem",
"id": "4a43d0e67994803c9d8bde857590875b56e2d7ae",
"size": "1286",
"... |
from oslo_log import log as logging
from heat.common import exception
from heat.common.i18n import _
from heat.common.i18n import _LW
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
LOG = logging.... | {
"content_hash": "77495e7a60742435f444323f30036bea",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 88,
"avg_line_length": 34.82692307692308,
"alnum_prop": 0.590097551997055,
"repo_name": "steveb/heat",
"id": "7872000f37e0468b3ff2d65f4446249ade3654c1",
"size": "6008",
... |
from utils import invert_dict
from sympy import IndexedBase, fibonacci
def fibonacci_numbers(start=0, limit=100, symbolic_keys=True):
f = IndexedBase('f')
return {(f[i] if symbolic_keys else i):fibonacci(i) for i in range(start, limit)}
def fibonacci_numbers_inverted_mapping(**kwds):
if 'start' not in kwd... | {
"content_hash": "0c882cd5302082e1e040d5b1bd9d40d5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 85,
"avg_line_length": 39.2,
"alnum_prop": 0.7142857142857143,
"repo_name": "massimo-nocentini/PhD",
"id": "5a841aa4400ca181530f8629cc8727f3f2b01d71",
"size": "393",
"bin... |
"""
This module fetches the timetable of the bus 230 in Sophia Antipolis
"""
import re
import logging
from datetime import datetime
from datetime import timedelta
from dateutil.parser import parse
from dateutil.tz import gettz
from bs4 import BeautifulSoup
from future.moves.urllib import request
def _get_html_from_cg... | {
"content_hash": "7978b1baf8e604b6e550e680bbd23707",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 100,
"avg_line_length": 32.641666666666666,
"alnum_prop": 0.6180750574419198,
"repo_name": "paraita/sophiabus230",
"id": "95f292c4ee535fa37a6b9609c6761e0aa43a50ee",
"size"... |
"""Module where all interfaces, events and exceptions live."""
from plone.theme.interfaces import IDefaultPloneLayer
from zope.interface import Interface
class IAde25ContactLayer(IDefaultPloneLayer):
"""Marker interface that defines a Zope 3 browser layer."""
class IContactImagesTool(Interface):
""" Respon... | {
"content_hash": "b195faf229f3c6ad83fa2695e73a20e0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 69,
"avg_line_length": 27.03846153846154,
"alnum_prop": 0.7083926031294452,
"repo_name": "ade25/ade25.contacts",
"id": "409505433672f0bdf3612d05fd0cf98ee8b88e26",
"size": "... |
"""PyTables nodes."""
from __future__ import absolute_import
import warnings
from .registry import class_name_dict, class_id_dict
from .exceptions import (ClosedNodeError, NodeError, UndoRedoWarning,
PerformanceWarning)
from .path import join_path, split_path, isvisiblepath
from .utils ... | {
"content_hash": "f8c991669568dcac976ff337104261db",
"timestamp": "",
"source": "github",
"line_count": 926,
"max_line_length": 79,
"avg_line_length": 35.05831533477322,
"alnum_prop": 0.6062407589945786,
"repo_name": "jennolsen84/PyTables",
"id": "315f5e7196510adabd57c59c15ab33020d22037e",
"size": ... |
class Document(object):
def __init__(self, width, height):
self.width = width
self.height = height
| {
"content_hash": "2afacec4088b251553d37b2e384eec50",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 24,
"alnum_prop": 0.5916666666666667,
"repo_name": "michielkauwatjoe/Meta",
"id": "0c26c874e4fb1f6c3f752690dacd8ae84cbe7b37",
"size": "213",
"binary... |
class StackAllocator(object):
"""
Generates a list of variables to load and save on the stack for each instruction.
"""
def __init__(self, instructions, num_args):
self.stack_size = 0
self.non_heap_locals = set()
self.valid_heap_locals = set(range(num_args))
self.saved_he... | {
"content_hash": "498e4e3279f9efea802e99ac678f13b6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 97,
"avg_line_length": 41.28358208955224,
"alnum_prop": 0.5755603759942155,
"repo_name": "shaurz/ome",
"id": "6125c0aa2463119b02332fe86ab058caf5b709b7",
"size": "2863",
"... |
from _pyMICimpl import _pymic_impl_offload_number_of_devices
from _pyMICimpl import _pymic_impl_load_library
# data management functions
from _pyMICimpl import _pymic_impl_buffer_allocate
from _pyMICimpl import _pymic_impl_buffer_release
from _pyMICimpl import _pymic_impl_buffer_update_on_target
from _pyMICimpl import... | {
"content_hash": "020144b3a9082480d00d5126e42c9f88",
"timestamp": "",
"source": "github",
"line_count": 739,
"max_line_length": 119,
"avg_line_length": 40.22868741542625,
"alnum_prop": 0.5332503615997847,
"repo_name": "rochoa85/pyMIC",
"id": "f36706ca4caff2f89e7790cac25a7c6ff1b4bbed",
"size": "3132... |
"""
ltisys -- a collection of classes and functions for modeling linear
time invariant systems.
"""
from __future__ import division, print_function, absolute_import
#
# Author: Travis Oliphant 2001
#
# Feb 2010: Warren Weckesser
# Rewrote lsim2 and added impulse2.
# Apr 2011: Jeffrey Armstrong <jeff@approximatrix.co... | {
"content_hash": "d8c5d30c67527741d3f2f768e506b654",
"timestamp": "",
"source": "github",
"line_count": 3494,
"max_line_length": 81,
"avg_line_length": 33.31511161991986,
"alnum_prop": 0.567201876240303,
"repo_name": "apbard/scipy",
"id": "03eabf0874b355c7d83e64c9ab5fe5b6ba1967d3",
"size": "116403"... |
"""Constants that are relevant to the validation of new structures for Android
app. This file should only contain validations which affect UI display and
general functionality on Android.
"""
from __future__ import annotations
import re
from core.constants import constants
# These are the valid interactions that a... | {
"content_hash": "f0ad85b400ce3d6960e8bb793d2f1fca",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 38.62264150943396,
"alnum_prop": 0.7703957010258915,
"repo_name": "brianrodri/oppia",
"id": "d2c9f3eff57a4f0f49f8589328a6c304ea65cc9d",
"size": "2652... |
from celery.task import task
import loginweibo as Lwb
import jiexi
import file
@task
def write(session, who):
page, who = Lwb.getPage(session, 'http://weibo.com/' + who)
WB_text, WB_time, WB_comefrom, WB_like, WB_pinlun, WB_forward, WB_mid = jiexi.detail(page)
for i in range(0, len(WB_text)):
file.... | {
"content_hash": "ecfda4d18e14af8a23b87109a2001904",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 94,
"avg_line_length": 35.76923076923077,
"alnum_prop": 0.6430107526881721,
"repo_name": "winiceo/weibo",
"id": "b1a3eada426fe8857d863bdd7e23db563cfa31c2",
"size": "548",
... |
from django.views.generic import RedirectView
from django.contrib.auth import authenticate, login
from django.conf import settings
from django.http import Http404
from .models import State
from urllib import urlencode
class LoginStageOneView(RedirectView):
permanent = False
def get_redirect_url(self, **kwa... | {
"content_hash": "226c2831128945d821024332c65b76ac",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 37.2962962962963,
"alnum_prop": 0.6310824230387289,
"repo_name": "siggame/siggame-vote",
"id": "39e0a98a1919b3960c3b9e7a2de1ee0efc35d57e",
"size": "2... |
"""
Functions used for post-docking analysis
"""
from optparse import OptionParser
import prody
from sys import exit
import numpy as np
from math import sin, cos
from subprocess import check_call
import csv
def normalize_list( l ):
m = min( l )
r = max( l ) - m
l = [ ( x - m )/ r for x in l ]
return l
def initi... | {
"content_hash": "041b5547f044704ba2a2e03f6c8b07bb",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 80,
"avg_line_length": 23.30275229357798,
"alnum_prop": 0.6342519685039371,
"repo_name": "flicopter/ppi_feature_trees",
"id": "b83af301895ce4c8676307bfee9165875efebb85",
"... |
"""Add Point
Revision ID: 71de7d079c37
Revises: e6d7560692fe
Create Date: 2016-01-03 13:26:52.977321
"""
# revision identifiers, used by Alembic.
revision = '71de7d079c37'
down_revision = 'e6d7560692fe'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
# comm... | {
"content_hash": "5657f3b625b4f35253af23affed77962",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 63,
"avg_line_length": 25.6,
"alnum_prop": 0.6651785714285714,
"repo_name": "WilliamMayor/scytale.xyz",
"id": "a4201b7357710c384aa8d467c2c8acd6143676aa",
"size": "896",
"... |
'''Backend to allow email login.
From Djangosnippets:
http://djangosnippets.org/snippets/1001/
Classes:
EmailOrUsernameModelBackend: Allow users to login with email or username.
'''
from django.contrib.auth.models import User
class EmailOrUsernameModelBackend(object):
'''Allows users to login with username... | {
"content_hash": "0c7aa5fad32bf92b758166c7d8899521",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 26.923076923076923,
"alnum_prop": 0.6266666666666667,
"repo_name": "nathangeffen/tbonline-old",
"id": "244211764cfc93d27047cacfb70cc6dd9b54e4e0",
"si... |
__author__ = "Rick Sherman"
import unittest2 as unittest
from nose.plugins.attrib import attr
from jnpr.junos.op.lldp import LLDPNeighborTable
@attr('functional')
class TestTable(unittest.TestCase):
@classmethod
def setUpClass(self):
from jnpr.junos import Device
self.dev = Device(host='sta... | {
"content_hash": "41d7b299a1a6d33045f071b7be996e3c",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 78,
"avg_line_length": 31.02857142857143,
"alnum_prop": 0.5893186003683242,
"repo_name": "shermdog/py-junos-eznc",
"id": "e4a060d20b4c14949fbdae7ff01dea78bad2b164",
"size":... |
"""
Offset Codebook (OCB) mode.
OCB is Authenticated Encryption with Associated Data (AEAD) cipher mode
designed by Prof. Phillip Rogaway and specified in `RFC7253`_.
The algorithm provides both authenticity and privacy, it is very efficient,
it uses only one key and it can be used in online mode (so that encryption
... | {
"content_hash": "8cde43aebaecd33be3d2ca474d27dd73",
"timestamp": "",
"source": "github",
"line_count": 495,
"max_line_length": 81,
"avg_line_length": 37.02020202020202,
"alnum_prop": 0.5385538881309686,
"repo_name": "kawamon/hue",
"id": "27c27974a1907a6a0b8a9caf306c6562284c73f9",
"size": "19838",
... |
from flask import Blueprint, render_template
bp = Blueprint('web', __name__)
@bp.route('/')
def index():
return render_template('index.html')
| {
"content_hash": "6f06cad7fd48e5665eb3f823ef97dbd7",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 44,
"avg_line_length": 18.625,
"alnum_prop": 0.6711409395973155,
"repo_name": "jaapverloop/massa",
"id": "77da597b909658dd73decfa7e1a223f914b9ecf4",
"size": "174",
"binary... |
from django.conf.urls import url
from . import views
app_name = 'api'
urlpatterns = [
url(r'^books/$', views.BookList.as_view(), name='books'),
url(r'^books/(?P<slug>[\w-]+)$', views.ChapterList.as_view(), name='chapters'),
]
| {
"content_hash": "11dca3148549065664fda3b5146121c3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 83,
"avg_line_length": 23.7,
"alnum_prop": 0.6286919831223629,
"repo_name": "TheUKDave/audree",
"id": "dea9e8ef5d2f5fab9ae7d5c5cfb4587244532273",
"size": "237",
"binary":... |
import sys
from os.path import basename
from numpy import dtype
from img import (
FormatOptions, ImageFileReader, create_geotiff, DEF_GEOTIFF_FOPT,
Progress, Block, execute, Point2,
)
from img.algs import clip_to_mask
from img.cli import error
def usage():
"""Print a short command usage help."""
exe = ... | {
"content_hash": "2d3a20c5868d746533687c9d2cdb5a04",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 78,
"avg_line_length": 30.465346534653467,
"alnum_prop": 0.5924601884952876,
"repo_name": "DREAM-ODA-OS/tools",
"id": "9c3c352496308c48d6036312f4972790606498c7",
"size": "... |
from icssploit.test import icssploitTestCase
from icssploit.protocols.s7comm import *
class S7commTests(icssploitTestCase):
def setUp(self):
super(S7commTests, self).setUp()
def test_cotp_cr(self):
data = '0300001611e00000000100c0010ac102' \
'0100c2020200'.decode('hex')
... | {
"content_hash": "3bb4214226d668480b888f6e980048dd",
"timestamp": "",
"source": "github",
"line_count": 694,
"max_line_length": 106,
"avg_line_length": 48.20317002881844,
"alnum_prop": 0.6730935939975488,
"repo_name": "dark-lbp/isf",
"id": "d355c067bf9be6b139f6d61e81238e9a67b9f1c4",
"size": "33453"... |
from django.core.management.base import BaseCommand
from django.db import models as registered_models
import re
class Command(BaseCommand):
def handle(self, *args, **options):
for model in registered_models.get_models(include_auto_created=True):
if model._meta.app_label == "bongo" and not re.... | {
"content_hash": "bb4652c177b512f910b0b1cb29a58918",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 95,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.6025179856115108,
"repo_name": "BowdoinOrient/bongo",
"id": "561f7de8839b7ae175d78bf80c35e8fe4b97a6cc",
"size": "... |
"""
Django Modernizr middleware
Some parts borrowed from:
Django Debug Toolbar
Copyright (c) Rob Hudson and individual contributors.
https://github.com/robhudson/django-debug-toolbar
"""
from django.conf import settings
from django.http import HttpResponse, QueryDict
from django.template.loader import render_to_string... | {
"content_hash": "d28cd9abc599dc55cfbda7331c767268",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 115,
"avg_line_length": 39.67619047619048,
"alnum_prop": 0.6586653864618339,
"repo_name": "dgouldin/django-modernizr",
"id": "71ec54088e0c55bca5520e75f92d26436d883e69",
"s... |
"""
Really quick script to build test data for multiple assessments
"""
import requests
import wpVitalsTender as wpvt
import json
# https://en.wikipedia.org/wiki/Wikipedia:Vital_articles/Expanded/Technology#Infrastructure_.2872_articles.29
articles = wpvt.parse_article(wpvt.get_content("Wikipedia:Vital articles/Expa... | {
"content_hash": "296e24604a3513d1b629d81d20d5f139",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 114,
"avg_line_length": 34.21052631578947,
"alnum_prop": 0.6407692307692308,
"repo_name": "mgbennet/wpVitalsTender",
"id": "7460cc551429ac86eed05c2ce1a99537edb93f02",
"size... |
"""
Allows describing functions, specifically enumerating arguments which
may be passed in a combination of registers and stack values.
"""
import gdb
from capstone import CS_GRP_CALL
from capstone import CS_GRP_INT
import pwndbg.abi
import pwndbg.arch
import pwndbg.chain
import pwndbg.color.nearpc as N
import pwndbg.... | {
"content_hash": "2579c2fe4a9448163c7c39a66f231c3a",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 100,
"avg_line_length": 26.748768472906406,
"alnum_prop": 0.6044198895027625,
"repo_name": "anthraxx/pwndbg",
"id": "e92357279e06d41b5d9d65cd9711c8cd44dcdd29",
"size": "54... |
from skyscanner.skyscanner import Flights
from easytravel.Structures import *
from easytravel.arrays import *
import pygame
from urllib.request import urlopen
import io
from json import loads
from webbrowser import open_new_tab
# DO NOT CHANGE api_key OR ENTER A VALID ONE
api_key = 'uc81727115534476264698125... | {
"content_hash": "53f4e7285153a35144122930fd290b90",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 118,
"avg_line_length": 37.21854304635762,
"alnum_prop": 0.5672597864768684,
"repo_name": "BohdanBorkivskyy/EasyTravel",
"id": "6a535ac750646efaa7c10fca902dc5009dbcf9b1",
... |
"""
pyQms
-----
Python module for fast and accurate mass spectrometry data quantification
:license: MIT, see LICENSE.txt for more details
Authors:
* Leufken, J.
* Niehues, A.
* Sarin, L.P.
* Hippler, M.
* Leidel, S.A.
* Fufezan, C.
"""
from __futu... | {
"content_hash": "162f31532a83b4778275c57a9b910f1a",
"timestamp": "",
"source": "github",
"line_count": 2066,
"max_line_length": 127,
"avg_line_length": 38.86108422071636,
"alnum_prop": 0.4685939193144594,
"repo_name": "pyQms/pyqms",
"id": "3a8319fedec4bca8cc0a97ea77610da2619906b7",
"size": "80327"... |
"""
Simultaneous Multithreading (SMT) combiner
==========================================
Combiner for Simultaneous Multithreading (SMT). It uses the results of the following parsers:
:class:`insights.parsers.smt.CpuCoreOnline`,
:class:`insights.parsers.smt.CpuSiblings`.
"""
from insights.core.plugins import combiner... | {
"content_hash": "0446e1290d0298042a6a0c88f65e1dde",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 186,
"avg_line_length": 37.328947368421055,
"alnum_prop": 0.5893549524145224,
"repo_name": "RedHatInsights/insights-core",
"id": "25e5ef7909632c1e924f725b7b065c8a13eb8314",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import random
from ray.rllib.offline.input_reader import InputReader
from ray.rllib.utils.annotations import override, DeveloperAPI
logger = logging.getLogger(__name__)
@DeveloperAPI
class Sh... | {
"content_hash": "38fde2308226a49721343af8a31de470",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 30.822222222222223,
"alnum_prop": 0.6366258111031002,
"repo_name": "ujvl/ray-ng",
"id": "22b4d69415dae8c4a7480c40a0d171cc449e5cc1",
"size": "1387",
... |
"""Wrapper around gsutil.
This takes care of downloading the pinned version we use in chromite.
"""
from __future__ import print_function
import os
import sys
from chromite.lib import gs
assert sys.version_info >= (3, 6), 'This module requires Python 3.6+'
def main(argv):
gsutil = gs.GSContext.GetDefaultGSUti... | {
"content_hash": "d22d38e03d43ee3d6ba1729edd11a881",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 69,
"avg_line_length": 19.210526315789473,
"alnum_prop": 0.7205479452054795,
"repo_name": "endlessm/chromium-browser",
"id": "d59c6daf1cfbab7d904d402956ce146ed57ef644",
"si... |
from django.conf.urls import url, include
from django.contrib import admin
from rest_framework.routers import DefaultRouter
from rest_framework_swagger.views import get_swagger_view
from controk_webservice.assets.views import PlaceOptionsViewSet
from controk_webservice.clients.views import ClientsViewSet
from controk_... | {
"content_hash": "1a363ba32969dfc240208cc22adfeaa7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 76,
"avg_line_length": 39.65384615384615,
"alnum_prop": 0.8089233753637245,
"repo_name": "jourdanrodrigues/controk-webservice",
"id": "900b7beed7a35f620f5924242acf45fbccfa5dd... |
"""
debug.py
Created by Thomas Mangin on 2011-03-29.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
import os
import sys
from exabgp.util.panic import panic
from exabgp.util.panic import footer
def bug_report (type, value, trace):
print panic
import traceback
print "-- Traceback\n\n"
traceback.... | {
"content_hash": "8903733822f74ecdc8a2b4f920f9fd30",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 58,
"avg_line_length": 18.85,
"alnum_prop": 0.7095490716180372,
"repo_name": "lochiiconnectivity/exabgp",
"id": "0608b72200b567597213bdc5e0f7ef84ead56a2e",
"size": "772",
... |
"""
pyQms
-----
Python module for fast and accurate mass spectrometry data quantification
:license: MIT, see LICENSE.txt for more details
Authors:
* Leufken, J.
* Niehues, A.
* Wessel, F.
* Sarin, L.P.
* Hippler, M.
* Leidel, S.A.
* Fufezan... | {
"content_hash": "66d41b7cb660ddbef50db98a6c74269d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 83,
"avg_line_length": 22.595238095238095,
"alnum_prop": 0.6396206533192834,
"repo_name": "pyQms/pyqms",
"id": "b2f33ff9e31e63db8cdf81ff242654c7e515829f",
"size": "989",
... |
"""
@author: ruben
"""
import matplotlib.pyplot as plt
from pastas.read.knmi import KnmiStation
import numpy as np
# How to use it?
# data from a meteorological station
download = True
meteo = True
hourly = False
if hourly and not meteo:
raise(ValueError('Hourly data is only available in meteorological stations'... | {
"content_hash": "b49dff79d7c141263b93200517e58ac1",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 81,
"avg_line_length": 32.9,
"alnum_prop": 0.6165146909827761,
"repo_name": "gwtsa/gwtsa",
"id": "670b15fb7a5c159aec7c5f1ebfcf0a0427ff132f",
"size": "1974",
"binary": fal... |
from django import forms
from django.conf import settings
from django.utils import translation
from django.utils.safestring import mark_safe
from django.utils.html import conditional_escape
from django.contrib.staticfiles import finders
default_date_format = getattr(settings, 'DATE_INPUT_FORMATS', None)
if default_da... | {
"content_hash": "591a78c6ad5f5e69a8ec2d5d27f7e36b",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 99,
"avg_line_length": 32.71584699453552,
"alnum_prop": 0.5889427092032737,
"repo_name": "mediafactory/yats",
"id": "fbe8e3c9454f59359683b47cf555abde06258c7e",
"size": "59... |
import os
import sys
import channels
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = channels.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want to also tag the version now:")
print(" git ... | {
"content_hash": "769fd77ce5cec96527d6760382844d57",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 66,
"avg_line_length": 28.442307692307693,
"alnum_prop": 0.6152805949966194,
"repo_name": "publica-io/django-publica-channels",
"id": "6f8c90a2b0afe986de2be03a41e19afb957f803... |
"""
Created on 12 Apr 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import os
import pytz
import re
from datetime import datetime as dt
from scs_core.sys.filesystem import Filesystem, File
# -----------------------------------------------------------------------------------------------------... | {
"content_hash": "3649e910eda4b25172a98d66089f4930",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 118,
"avg_line_length": 29.83084577114428,
"alnum_prop": 0.42611741160773847,
"repo_name": "south-coast-science/scs_core",
"id": "5bb38042266b8fbe64c6d05b74f8bbcfd2d94639",
... |
from zerver.lib.test_classes import WebhookTestCase
class GrooveHookTests(WebhookTestCase):
STREAM_NAME = 'groove'
URL_TEMPLATE = '/api/v1/external/groove?stream={stream}&api_key={api_key}'
FIXTURE_DIR_NAME = 'groove'
# This test simulates the condition when a new ticket comes.
def test_groove_tic... | {
"content_hash": "f7d9c72679a90183ca5b8d69690d9b1d",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 159,
"avg_line_length": 47.73737373737374,
"alnum_prop": 0.6557342361404994,
"repo_name": "rishig/zulip",
"id": "e8b286e62d1f4c609379f8adac80539757cda910",
"size": "4750",
... |
from django.contrib import admin
# Register your models here.
from main.models import Post
admin.site.register(Post)
| {
"content_hash": "2b61e98daae35870398f120573c4a222",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 19.833333333333332,
"alnum_prop": 0.7983193277310925,
"repo_name": "RodolpheOrg/Rodolphe",
"id": "155863f79da99fbaca2b132a739115bfb1cfef57",
"size": "... |
"""Recursive feature elimination for feature ranking"""
import numpy as np
from ..utils import check_X_y, safe_sqr
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..base import clone
from ..base import is_classifier
from ..cross_validation import _check_cv as check_cv
from ..cross_validatio... | {
"content_hash": "a64c0d8bd674e3dfbb05dedebd854b80",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 79,
"avg_line_length": 38.18324607329843,
"alnum_prop": 0.613739201974496,
"repo_name": "ankurankan/scikit-learn",
"id": "3078215f5eee09ba041c741cb9f51c0ade53c8a1",
"size"... |
"""Support for a ScreenLogic Sensor."""
from screenlogicpy.const import (
CHEM_DOSING_STATE,
DATA as SL_DATA,
DEVICE_TYPE,
EQUIPMENT,
)
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from . import ScreenlogicEntity
from .const import DOMAIN
SUPPORTED_CHEM_SENSORS = (
... | {
"content_hash": "421d0375298aaf83ef0f5850ace5f235",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 87,
"avg_line_length": 32.190751445086704,
"alnum_prop": 0.6160890644639971,
"repo_name": "home-assistant/home-assistant",
"id": "0f2d140f669970a12a708ec420cb3b22cf332c50",
... |
def my_view(request):
return {}
from schema import TopicSchema, MessageSchema, ResponseSchema
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPNotFound, HTTPFound
from pyramid_simpleform import Form
from pyramid_simpleform.renderers import FormRenderer
@view_config(route_name='home', r... | {
"content_hash": "b8bdb5582edc2516ef5e9ab3e8a83e89",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 85,
"avg_line_length": 30.52991452991453,
"alnum_prop": 0.6111422172452408,
"repo_name": "marioidival/pyramid_example_forum",
"id": "d5f6910d369622dfa982a95644a02f80990710ba... |
from __future__ import print_function
import unittest
import numpy as np
import paddle.fluid.core as core
from paddle.fluid.op import Operator
import paddle.fluid as fluid
from paddle.fluid.tests.unittests.op_test import OpTest
from paddle.fluid.framework import grad_var_name
from paddle.fluid.tests.unittests.test_bat... | {
"content_hash": "6c34c014bfd338d866b51d963c597e03",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 147,
"avg_line_length": 40.023529411764706,
"alnum_prop": 0.6499118165784833,
"repo_name": "tensor-tang/Paddle",
"id": "eb12470789ab9a6e416e829832986a11cd576474",
"size": "... |
"""
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | {
"content_hash": "f44c64fcb3fe7e3d5937945d6af8ac37",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 24.607142857142858,
"alnum_prop": 0.7252056119980649,
"repo_name": "bundgus/python-playground",
"id": "7e2ad5e5d4582c5201c747d9cf401b91ff9349f1",
"si... |
"""Ported cmemcached tests"""
# NOTE Don't write new tests here.
# These are ported from cmemcached to ensure compatibility.
import pylibmc
from nose.tools import eq_
from tests import PylibmcTestCase
class TestCmemcached(PylibmcTestCase):
def testSetAndGet(self):
self.mc.set("num12345", 12345)
e... | {
"content_hash": "f3c08b30f84dc94a2ccae212577d47b1",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 77,
"avg_line_length": 31.728813559322035,
"alnum_prop": 0.5694444444444444,
"repo_name": "alcance/blog_ng",
"id": "c89df235ac9475766c3d66ceb4b9a46aa7e41ce1",
"size": "1872... |
import itertools
import json
from .column import (StringColumn, NumberColumn, BooleanColumn,
DateColumn, DatetimeColumn, TimeofdayColumn)
from .options import Options
class GoogleChart(object):
def __init__(self, title=""):
super(GoogleChart, self).__init__()
self.title = tit... | {
"content_hash": "0b53658da8eafad21822ab281fc6a3c4",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 80,
"avg_line_length": 32.28947368421053,
"alnum_prop": 0.5376935615321924,
"repo_name": "msteffeck/pyjsongooglechart",
"id": "2f629b50d1568596e005f5d0dbf4e731c60f6f92",
"... |
import boto3
import os
import pytest
import sure # noqa # pylint: disable=unused-import
import requests
from botocore.client import ClientError
from functools import wraps
from io import BytesIO
from moto.s3.responses import DEFAULT_REGION_NAME
from moto import settings, mock_s3
import moto.s3.models as s3model
fr... | {
"content_hash": "8c2112bd504b466647b67587ff9328bb",
"timestamp": "",
"source": "github",
"line_count": 1011,
"max_line_length": 126,
"avg_line_length": 30.68545994065282,
"alnum_prop": 0.6035199690552171,
"repo_name": "spulec/moto",
"id": "b152c88bad0ca7c8ad9f9c0f336e7200fb92cee4",
"size": "31026"... |
from __future__ import unicode_literals
from django.db import migrations, models
import republisher.models
class Migration(migrations.Migration):
dependencies = [
('newsroom', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Republisher',
fields=[
... | {
"content_hash": "0073137ea1eddb36afeb377d54bc2307",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 181,
"avg_line_length": 42.81818181818182,
"alnum_prop": 0.5700636942675159,
"repo_name": "groundupnews/gu",
"id": "21c90c3e077042c098ac97ba845a6c793fad06b3",
"size": "1908... |
"""Tests for metric utils."""
import numpy as np
import tensorflow as tf
from tensorflow_model_analysis import types
from tensorflow_model_analysis.metrics import metric_types
from tensorflow_model_analysis.metrics import metric_util
from tensorflow_model_analysis.proto import config_pb2
class UtilTest(tf.test.TestC... | {
"content_hash": "96578a8b6d6392c8e01a2fe3d379a7e3",
"timestamp": "",
"source": "github",
"line_count": 845,
"max_line_length": 80,
"avg_line_length": 41.96449704142012,
"alnum_prop": 0.6205865764241398,
"repo_name": "tensorflow/model-analysis",
"id": "aacceed02875ffbbf265e96b98bbeaeabdf721bd",
"si... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("RandomForestRegressor" , "freidman1" , "sqlite")
| {
"content_hash": "6f62354e2c2db95baca4df86b5fb30c1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 68,
"avg_line_length": 34.5,
"alnum_prop": 0.782608695652174,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "b838e4d359fd57ab3b9ea3ae480aaa5cf5059928",
"size": "138"... |
from github import Github
import os
import json
import yaml
import subprocess
import logging
gh = Github(
login_or_token=os.environ.get('GITHUB_USERNAME', None) or os.environ.get('GITHUB_OAUTH_TOKEN', None),
password=os.environ.get('GITHUB_PASSWORD', None),
)
logging.warn("GH API RATE LIMIT: %s/%s" % gh.rate_li... | {
"content_hash": "97c87431830f0637f9d4dd079d185a0f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 105,
"avg_line_length": 35.4,
"alnum_prop": 0.5969868173258004,
"repo_name": "GMOD/jbrowse-registry",
"id": "0cb87e0b035e1f7a162af8b3e1f894553df02302",
"size": "2124",
"b... |
import sys
from pathlib import Path
from git import Repo
from .base import BaseRunInSubprocessBackend
class CurrentEnvironmentBackend(BaseRunInSubprocessBackend):
""" Uses the current Python to run the tasks, however they're launched in a :mod:`subprocess`.
The requirements of the repository are completely... | {
"content_hash": "389f8f5d6b7aed9b15caeb1a75c88042",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 104,
"avg_line_length": 30.5,
"alnum_prop": 0.7194899817850637,
"repo_name": "mikicz/arca",
"id": "9219dccb57b9c99be64219ed05e1d50a0ed1dbb6",
"size": "549",
"binary": fal... |
import os
from setuptools import setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-usuario',
version='0.4',
... | {
"content_hash": "3f14f42c6afae89905f9888a7183167d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 33.44444444444444,
"alnum_prop": 0.6187707641196013,
"repo_name": "dyachan/django-usuario",
"id": "d099bde9a7cf9c42da23e08a5a822885eba35415",
"size":... |
"""
User-related data
"""
from datetime import timedelta
import struct
from fiveserver import log
import util
class Profile:
def __init__(self, index):
self.index = index # 1
self.id = 0 # 4
self.name = '' # 16 bytes
self.favPlayer = 0 # 2 bytes, PES5 only
... | {
"content_hash": "ef0ac63b505984a13ca518d6329ad7fa",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 96,
"avg_line_length": 27.264462809917354,
"alnum_prop": 0.5671415580478933,
"repo_name": "IkeC/evo-league",
"id": "8d951f37380fa3782fc2eab770c663052b4af2b2",
"size": "329... |
"""Tests for next_step.py
Mostly just making sure we can get models without shape mismatches etc.
"""
import unittest
import tensorflow as tf
import models.rnn.next_step as ns
class TestStandardNextStep(unittest.TestCase):
def test_get_model(self):
"""Just make sure we can get a model without errors"""... | {
"content_hash": "eac6144436a62104fd5d60b8274cafc7",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 39.098591549295776,
"alnum_prop": 0.5597982708933718,
"repo_name": "PFCM/generating_sequences",
"id": "03f0b0f406d6ec9086d26399d89d31a759b96028",
"si... |
"""
felix.splitter
~~~~~~~~~~~~~
Simple object that just splits notifications out for IPv4 and IPv6.
"""
import functools
import logging
import gevent
from calico.felix.actor import Actor, actor_message
_log = logging.getLogger(__name__)
class UpdateSplitter(Actor):
"""
Actor that takes the role of message ... | {
"content_hash": "4cd19503df3be251c3e9dd2c8d8eddc9",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 78,
"avg_line_length": 38.145161290322584,
"alnum_prop": 0.6264270613107823,
"repo_name": "alexhersh/calico",
"id": "84af853d4c0a0844d033eaac76a9d8ae0f5d3757",
"size": "53... |
from typing import Callable, Dict, Set, Tuple, Union
import numpy as np
import cirq
from cirq import protocols, value, ops
def to_quil_complex_format(num) -> str:
"""A function for outputting a number to a complex string in QUIL format."""
cnum = complex(str(num))
return f"{cnum.real}+{cnum.imag}i"
@val... | {
"content_hash": "1767ad3061d8d6e78205e1187be0a58c",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 93,
"avg_line_length": 37.53921568627451,
"alnum_prop": 0.5586314964742752,
"repo_name": "balopat/Cirq",
"id": "c60940d3abcb4dcf1066fec390ead93ef9ef72c8",
"size": "8243",
... |
""" a package to manipulate the physical units of JSON data,
via unitschema
jsonextended utilises the pint package to manage physical units.
This was chosen due to its large user-base and support for numpy:
https://socialcompare.com/en/comparison/python-units-quantities-packages-383avix4
"""
from jsonextended.units.... | {
"content_hash": "abf188a14415729eeb0b1488470ca285",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 35.5,
"alnum_prop": 0.7793427230046949,
"repo_name": "chrisjsewell/jsonextended",
"id": "11388dbfa01597e7b24844727421dc4dc777f239",
"size": "470",
... |
import json
import webapp2
import uuid
from google.appengine.ext.webapp import util
from google.appengine.api import users
import mail
from model import InviteToken
import utils
class InviteHandler(webapp2.RequestHandler):
def post(self):
"""Send an invitation mail to the provided email address"""
... | {
"content_hash": "418fa04c278a5dd2e651a2fd87e1d4bb",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 81,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.5763157894736842,
"repo_name": "studyindenmark/newscontrol",
"id": "6b6ac453113c5eec1111925bc045c7f2b11781de",
"s... |
import datetime
import time
# local imports
from shpkpr import exceptions
class DeploymentFailed(exceptions.ShpkprException):
pass
class DeploymentNotFound(exceptions.ShpkprException):
pass
class MarathonDeployment(object):
"""Marathon deployment object.
Allows the caller to check a deployment's... | {
"content_hash": "8fbc9675da6f71c376e7b5a9ae7ec8fc",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 94,
"avg_line_length": 32,
"alnum_prop": 0.6516544117647058,
"repo_name": "shopkeep/shpkpr",
"id": "2d089a3181145a1122b88206f4bfa6ebb7e81f11",
"size": "2193",
"binary": f... |
import BoostBuild
t = BoostBuild.Tester()
t.write("jamroot.jam", """
import rcc ;
""")
t.write("rcc.jam", """
import type ;
import generators ;
import print ;
# Use 'RCC' to avoid conflicts with definitions in the standard rc.jam and
# msvc.jam
type.register RCC : rcc ;
rule resource-compile ( targets * : sources ... | {
"content_hash": "98c990e9d45bf2d28c350cee6cc4ac83",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 19.944444444444443,
"alnum_prop": 0.6601671309192201,
"repo_name": "nicecapj/crossplatfromMmorpgServer",
"id": "8c477a6f2d89688967130d216ace01a47e7f65e... |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("DecisionTreeClassifier" , "BinaryClass_500" , "sqlite")
| {
"content_hash": "7d1173b776a74eb6b6cc2ac86bbed50f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 77,
"avg_line_length": 38.25,
"alnum_prop": 0.7973856209150327,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "7abcae74666526df111cf79d6eb775a01a20f8e5",
"size": "15... |
import os
import time
import unittest
import subprocess
from appium import webdriver
from device_finder import DeviceFinder
from selenium.common.exceptions import WebDriverException
from testdroid_utils import TDUtils
class TestdroidAndroid(unittest.TestCase):
def setUp(self):
#
# IMPORTANT: Set t... | {
"content_hash": "5cd2be6fea3c5125bbaea8aec1ba4160",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 102,
"avg_line_length": 42.15028901734104,
"alnum_prop": 0.6389193636862315,
"repo_name": "bitbar/testdroid-samples",
"id": "d7244256c389777faa9e7242751685b5a3c13ce3",
"si... |
import os.path
import logging
from copy import deepcopy
import numpy
import rmgpy.constants as constants
from rmgpy.kinetics import Arrhenius, ArrheniusEP, ThirdBody, Lindemann, Troe, \
PDepArrhenius, MultiArrhenius, MultiPDepArrhenius, \
Chebyshev, KineticsData
fr... | {
"content_hash": "240538491a5bc9303e0483a42ed922b2",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 163,
"avg_line_length": 49.13111545988259,
"alnum_prop": 0.6049549908388433,
"repo_name": "comocheng/RMG-Py",
"id": "a927abc70909f8892b11f54f22c254cc121af991",
"size": "26... |
import sys, os, re
def get_version():
here = os.path.dirname(__file__)
pardir = [os.path.pardir] * 3
topdir = os.path.join(here, *pardir)
with open(os.path.join(topdir, 'src', '__init__.py')) as f:
m = re.search(r"__version__\s*=\s*'(.*)'", f.read())
return m.groups()[0]
try: from mpi4... | {
"content_hash": "2fc71a83e53a270da9f7823c557f9710",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 80,
"avg_line_length": 32.217213114754095,
"alnum_prop": 0.6943137005470043,
"repo_name": "pressel/mpi4py",
"id": "ea0d0d1d278f54783444caf8b09b795883569151",
"size": "8286... |
"""
This file trains an LDA model based on small word windows (e.g. 11 words per window).
Execute via:
python -m preprocessing/lda --dict --train
List topics of LDA via:
python -m preprocessing/lda --topics
Test on a sentence via:
python -m preprocessing/lda --test --sentence="Jo... | {
"content_hash": "47c8a22bd5504664d3d03c299fd051ba",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 98,
"avg_line_length": 39.01020408163265,
"alnum_prop": 0.6402040282500654,
"repo_name": "aleju/ner-crf",
"id": "9ca59dbe91e9d4abe2f3481547186b4c728524fc",
"size": "7669",... |
"""Useful utilities for higher level polynomial classes. """
from sympy.polys.polyerrors import PolynomialError, GeneratorsNeeded
from sympy.polys.polyoptions import build_options
from sympy.core.exprtools import decompose_power
from sympy.core import S, Add, Mul, Pow
from sympy.assumptions import ask, Q
from sympy.... | {
"content_hash": "a26746cb092a5929d0e6adf9793dd80a",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 106,
"avg_line_length": 26.699404761904763,
"alnum_prop": 0.5455356147586669,
"repo_name": "minrk/sympy",
"id": "00aefd927034aa58524acfae9185638ed8ea19cc",
"size": "8971",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.