text stringlengths 4 1.02M | meta dict |
|---|---|
"""Python implementation of 'Mountain Car' environment.
An underpowered car must drive up a hill, to succeed you must go back/forth.
This is a classic environment in RL research, first described by:
A Moore, Efficient Memory-Based Learning for Robot Control,
PhD thesis, University of Cambridge, 1990.
"""
from typ... | {
"content_hash": "f09e8d4e6db95ff1838cea0f1a24930a",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 32.14942528735632,
"alnum_prop": 0.6571326421165534,
"repo_name": "deepmind/bsuite",
"id": "4eb3e7d91f269285ea0cda25940aaf7f91f8e780",
"size": "3527"... |
'''
A demo of Kivy Properties and why they rule
'''
from kivy.app import App
from kivy.properties import ObjectProperty
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.animation import Animation, AnimationTransition
Builder.load_string('''
<ButtonBox>:
b1: b1
b2: b2
b3: b3
... | {
"content_hash": "eb496164ccf7b8ee4f0b3fd6c730b9a8",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 76,
"avg_line_length": 25.028985507246375,
"alnum_prop": 0.5715112912565142,
"repo_name": "Zen-CODE/kivybits",
"id": "0e9b8f0d255d874b4f07878fb8418ad5b3bad471",
"size": "17... |
from conure.libs.db import db
from .user import UserAccesser
# user <-> sites
class Sub(db.Document,UserAccesser):
feedsite = db.ReferenceField("FeedSite")
#counter = db.IntField(default=0)
unread_counter = db.IntField(default=0)
start_date = db.DateTimeField()
... | {
"content_hash": "6fd60b00e0586e2f42a0dac9a6918b56",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 105,
"avg_line_length": 28.165354330708663,
"alnum_prop": 0.586525020967291,
"repo_name": "zhy0216/google-read-clone",
"id": "26f44d8c5b749a3bc3992490bf677f0cca94e548",
"s... |
import json
import logging
import ssl
import threading
import websocket
from ..compat import queue
from .event_factory import SlackEventDict
def send_messages(q, websocket, keep_alive=True, donotdie=True):
logger = logging.getLogger(__name__)
ping_msg = json.dumps({'type': 'ping'}).encode('utf-8')
while... | {
"content_hash": "960a0ab267253933fd633130ae18ee0c",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 150,
"avg_line_length": 32.21656050955414,
"alnum_prop": 0.582839066824832,
"repo_name": "huntcsg/slackly",
"id": "18e7d631360ffe470d42fc5ab4ecbf832ad66379",
"size": "5058... |
from math import sqrt, acos, pi
from decimal import Decimal, getcontext
getcontext().prec = 30
class Vector(object):
CANNOT_NORMALIZE_ZERO_VECTOR_MESG = 'Cannot normalize the zero vector'
def __init__(self, coordinates):
try:
if not coordinates:
raise ValueError
... | {
"content_hash": "5b045545b8a24a5dcaecb733f0bbdb27",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 29.51851851851852,
"alnum_prop": 0.5943120033458804,
"repo_name": "famunity/deep-learning-term1",
"id": "4067d024ba4b34e20928db9e26b05f314c05b5e4",
"... |
"""
This module defines the FeffInputSet abstract base class and a concrete
implementation for the Materials Project. The basic concept behind an input
set is to specify a scheme to generate a consistent set of Feff inputs from a
structure without further user intervention. This ensures comparability across
runs.
"""
... | {
"content_hash": "efd27d0cebe957badd8a7188c402bf24",
"timestamp": "",
"source": "github",
"line_count": 571,
"max_line_length": 116,
"avg_line_length": 33.486865148861646,
"alnum_prop": 0.5665498666387742,
"repo_name": "fraricci/pymatgen",
"id": "d4c36025dd65b4e702c6c405cd520d7ee39b131f",
"size": "... |
import copy as cp
import numpy as np
from scipy import linalg
from .mixin import TransformerMixin
from ..cov import _regularized_covariance
class CSP(TransformerMixin):
"""M/EEG signal decomposition using the Common Spatial Patterns (CSP).
This object can be used as a supervised decomposition to estimate
... | {
"content_hash": "c3188da5342b9e260c7745eab337e67e",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 79,
"avg_line_length": 47.17420814479638,
"alnum_prop": 0.5776221763944175,
"repo_name": "yousrabk/mne-python",
"id": "e1dd3f803bab4a9fda86aa09705045edd9f6897e",
"size": "... |
import os
from django.core.management.base import BaseCommand
from parkmap.models import Park, Neighborhood
class Command(BaseCommand):
help = 'Assigns intersecting neighborhoods to parks.'
def handle(self, *args, **options):
parks = Park.objects.all()
for park in parks:
neighbo... | {
"content_hash": "72a45a1aa9394f210e3ceedf7ba542fc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 91,
"avg_line_length": 31.5,
"alnum_prop": 0.6904761904761905,
"repo_name": "MAPC/bostonparks",
"id": "37395a9927499aeb165254e33507bdcd90f6e901",
"size": "504",
"binary":... |
"""
State Space Representation, Kalman Filter, Smoother, and Simulation Smoother
Author: Chad Fulton
License: Simplified-BSD
"""
import numpy as np
from .kalman_smoother import KalmanSmoother
from .cfa_simulation_smoother import CFASimulationSmoother
from . import tools
SIMULATION_STATE = 0x01
SIMULATION_DISTURBANCE... | {
"content_hash": "0143181d88eda17478cb9cb55fa2acae",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 79,
"avg_line_length": 38.05911330049261,
"alnum_prop": 0.6167917853136595,
"repo_name": "jseabold/statsmodels",
"id": "c79db92ce8df975ae8e5e89a41ffb1595b67535f",
"size": ... |
import asyncio
import datetime
import time
from enum import IntEnum, Enum
from typing import List, Optional, Union
import discord
from necrobot.util.necrodancer import level as necrolevel
from necrobot.config import Config
from necrobot.race.raceconfig import RaceConfig
from necrobot.race.raceinfo import RaceInfo
fro... | {
"content_hash": "1b4e1caf342422c37dc3c3f1cc9f7e38",
"timestamp": "",
"source": "github",
"line_count": 757,
"max_line_length": 120,
"avg_line_length": 40.038309114927344,
"alnum_prop": 0.6104457421887888,
"repo_name": "incnone/necrobot",
"id": "c3601bca0809f4c4aace8f911faed05b3caf147f",
"size": "3... |
from mock import ANY, patch
from cell.actors import Actor
from cell.agents import dAgent
from cell.exceptions import CellError, NoReplyError
from cell.results import AsyncResult
from cell.tests.utils import Case, Mock, with_in_memory_connection
from kombu.utils import uuid
__author__ = 'rumi'
class A(Actor):
pas... | {
"content_hash": "072c8b3b8d8d7942fd441f7ccf0f5cb1",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 76,
"avg_line_length": 32.845283018867924,
"alnum_prop": 0.5807674632352942,
"repo_name": "celery/cell",
"id": "e3e5382492cebd16f8fbdccf8583aa6d0a68baeb",
"size": "8704",
... |
import unittest
from PIL import Image
from ric_encoder import ric_encode, ric_decode
class TestRicEncoder(unittest.TestCase):
def testEncoder(self):
img = open("samples/crop.jpg","rb").read()
options = [ { "imgwidth": 200, "crop": [210, 120, 510, 420]}, { "imgwidth": 400, "crop": [180, 90, 720, 480... | {
"content_hash": "e3fcf520ae09a31f59ae31c139faa52c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 120,
"avg_line_length": 28.56,
"alnum_prop": 0.5574229691876751,
"repo_name": "yoavweiss/Responsive-Image-Container",
"id": "869a4852213ec515488eab4eb9c8620da9681726",
"siz... |
from setuptools import setup # , find_packages
import os
import sys
def use_package(package):
if not package:
return False
if package.startswith(('#', 'git+')):
return False
if sys.version_info.major > 2 and 'python_version <' in package:
return False
if sys.version_info.major... | {
"content_hash": "e6fbfadbb9d7ef69d25eefe2e494df35",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 129,
"avg_line_length": 36.148148148148145,
"alnum_prop": 0.6082650273224044,
"repo_name": "pricingassistant/mrq",
"id": "7f90e2519f7e2e37402b64656b6e56b76de4e2bf",
"size":... |
from __future__ import unicode_literals
from django import template
from django.test import TestCase
from django.test.client import RequestFactory
from django.test.utils import override_settings
from labJS.base import Labjs
from labJS.templatetags.labjs import LabjsNode, Wait
class FakeNode(object):
def render... | {
"content_hash": "cb60e7e12d33cba0da09cdafd2bbd03d",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 76,
"avg_line_length": 31.64761904761905,
"alnum_prop": 0.626241348179356,
"repo_name": "ashwoods/django-labjs",
"id": "b837f9a44e043facc5a89b356b712f558634ae87",
"size": ... |
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class AccessPolicyUpdateKind(str, Enum, metaclass=CaseInsensitiveEnumMeta):
ADD = "add"
REPLACE = "replace"
REMOVE = "remove"
class CertificatePermissions(str, Enum, metaclass=CaseInsensitiveEnumMeta):
GET = "get"
LIST = "list... | {
"content_hash": "85c6af05bb8962b1e79fdb051c40934e",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 100,
"avg_line_length": 26.597122302158272,
"alnum_prop": 0.67243711117122,
"repo_name": "Azure/azure-sdk-for-python",
"id": "c32d9677a80bb0f2d7f838c16edb9af927017e1c",
"s... |
VERSION = '0.1.0.dev1'
def ensure_str(arg):
return type(arg) == Str and arg or Str(arg)
def return_str(func):
""" ensure to return Str """
def method(*args, **kwargs):
return ensure_str(func(*args, **kwargs))
return method
class Str(str):
@classmethod
def is_str(cls, s):
"""
... | {
"content_hash": "387042bb58d2dcf8d88a2c4aca6ec40e",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 111,
"avg_line_length": 24.60096153846154,
"alnum_prop": 0.5194449872972445,
"repo_name": "pyseed/overstr",
"id": "85edf47bd1e91c89277ce155f2fe3aa73f822b9c",
"size": "5164... |
import unittest
import logging, sys
from time import sleep
# Need a serial communication component for this test
from SerialCommunication import SerialCommunication
from CmdResponseDefinitions import *
import comm_packet_pb2
# Define a list of way-points for the purpose of testing
test_way_point_1 = comm_packet_pb2.C... | {
"content_hash": "e1eb4b59ec6d0f3b0352044a901f729c",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 99,
"avg_line_length": 42.39316239316239,
"alnum_prop": 0.7030241935483871,
"repo_name": "mike-moore/wheel_bot",
"id": "6b333ff072eec57855b5617e71b6cbffef145856",
"size": ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'RevisionDate.day'
db.add_column(u'parsr_revisiondate', 'day',
self.gf('django.db.models.fields... | {
"content_hash": "362489237d1c41af1ac45cc41062b6ed",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 150,
"avg_line_length": 53.3421052631579,
"alnum_prop": 0.5421805624074988,
"repo_name": "frontendphil/analyzr",
"id": "4a98a1c02c1a97fc01d974beb0ee5cde58066fc8",
"size": "... |
'''Example settings/local.py file.
These settings override what's in website/settings/defaults.py
NOTE: local.py will not be added to source control.
'''
from . import defaults
DB_PORT = 27017
DEV_MODE = True
DEBUG_MODE = True # Sets app to debug mode, turns off template caching, etc.
SEARCH_ENGINE = 'elastic'
US... | {
"content_hash": "cf3c05c896ff41837854a49762db5f40",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 19.64864864864865,
"alnum_prop": 0.7097661623108665,
"repo_name": "AndrewSallans/osf.io",
"id": "a6d1f23710f892cf839bc89d459f2860bbfb4786",
"size": "... |
import os
from emuvim.api.openstack.resources.net import Net
from emuvim.api.osm.kafka import Kafka
from emuvim.api.osm.lcm import LCM
from emuvim.api.osm.mongo import Mongo
from emuvim.api.osm.mysql import Mysql
from emuvim.api.osm.nbi import NBI
from emuvim.api.osm.ro import RO
from emuvim.api.osm.zookeeper import Z... | {
"content_hash": "c88b81f8e3956264157d91792e98f703",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 111,
"avg_line_length": 38.024096385542165,
"alnum_prop": 0.6023447401774398,
"repo_name": "mpeuster/son-emu",
"id": "f4de8b9121240ada25fa21dcd3a62a1e98f02308",
"size": "37... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0038_profile_theme'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='reports_allowed',
),
]
| {
"content_hash": "2b12d0902180dd1e82a02e5097f99894",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 43,
"avg_line_length": 19,
"alnum_prop": 0.5684210526315789,
"repo_name": "healthchecks/healthchecks",
"id": "7165c48020fd790050be4824e8c9b2522a90e3e6",
"size": "334",
"b... |
from __future__ import absolute_import, print_function, division
import warnings
import numpy as np
import astropy.units as u
__all__ = ["_get_x_in_wavenumbers", "_test_valid_x_range"]
def _get_x_in_wavenumbers(in_x):
"""
Convert input x to wavenumber given x has units.
Otherwise, assume x is in wavene... | {
"content_hash": "babfa0cece9cd249ee9a1a7fc165d50d",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 27,
"alnum_prop": 0.595276435856146,
"repo_name": "karllark/dust_extinction",
"id": "d6f51717f6d85bbd094c6a0b9c312827f6d8db70",
"size": "1863",
"bi... |
import pprint
import webob.dec
@webob.dec.wsgify
def echo_app(request):
"""A WSGI application that echoes the CGI environment to the user."""
return webob.Response(content_type='application/json',
body=pprint.pformat(request.environ, indent=4))
def echo_app_factory(global_conf, **l... | {
"content_hash": "2992068e82b07b9530f6ece99e4c385a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 27.076923076923077,
"alnum_prop": 0.6846590909090909,
"repo_name": "jamielennox/keystonemiddleware-echo",
"id": "6488ce39db8d647c175f882502671ab10e69b2... |
import contextlib
import xcffib
import xcffib.xproto
from . import command
from . import hook
from . import window
from . import utils
from .log_utils import logger
class _Group(command.CommandObject):
"""A container for a bunch of windows
Analogous to workspaces in other window managers. Each client window... | {
"content_hash": "2863ec58ffce78fa0df46091ee9fac8f",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 79,
"avg_line_length": 33.99761904761905,
"alnum_prop": 0.5457665102598221,
"repo_name": "de-vri-es/qtile",
"id": "116d9377b891c61ca946fe5438ed7428ee69e011",
"size": "1563... |
import collections
import gc
import re
import traceback
from operator import itemgetter
import diesel
address_stripper = re.compile(r' at 0x[0-9a-f]+')
def print_greenlet_stacks():
"""Prints the stacks of greenlets from running loops.
The number of greenlets at the same position in the stack is displayed
... | {
"content_hash": "343564a6b2b2222c7c6e008eec07da52",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 75,
"avg_line_length": 29.166666666666668,
"alnum_prop": 0.638095238095238,
"repo_name": "dieseldev/diesel",
"id": "b4c720ce8e97ef050c5aae03f7826988817ccdb7",
"size": "1050... |
"""Module for numerical treatment of piece-wise continuous reservoir models.
An abstract
:class:`~.smooth_reservoir_model.SmoothReservoirModel` is
filled with life by giving initial values, a parameter set, a time grid,
and potentially additional involved functions to it.
The model can then be run and as long as t... | {
"content_hash": "ff7b50a67b737bb3ed1c66e8ea7dd164",
"timestamp": "",
"source": "github",
"line_count": 4422,
"max_line_length": 179,
"avg_line_length": 37.12618724559023,
"alnum_prop": 0.5366262212801208,
"repo_name": "MPIBGC-TEE/CompartmentalSystems",
"id": "70910d3b0a96ee67770aaa3f4ec2e251a593418e... |
import os
import sys
import random
import time
import json
import copy
import errno
import traceback
import operator
import math
from functools import partial
from collections import defaultdict
from numbers import Number
from decimal import Decimal
from typing import TYPE_CHECKING, List, Optional, Tuple, Union, NamedT... | {
"content_hash": "68a974b66a378fba81389f8143f061b6",
"timestamp": "",
"source": "github",
"line_count": 3399,
"max_line_length": 150,
"avg_line_length": 41.79082082965578,
"alnum_prop": 0.5836307700972213,
"repo_name": "wakiyamap/electrum-mona",
"id": "40aaa6630e97d7edb65ed335a333aed488f09fe4",
"si... |
"""
This file is part of python-webuntis
:copyright: (c) 2012 by Markus Unterwaditzer.
:license: BSD, see LICENSE for more details.
"""
from webuntis import utils, objects, errors
from webuntis.utils import result_wrapper, log, rpc_request
from webuntis.utils.userinput import unicode_string
class JSONRPC... | {
"content_hash": "cdc0b7e37c75fccef70919e09c2a3dca",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 103,
"avg_line_length": 34.38550247116969,
"alnum_prop": 0.6063146799540053,
"repo_name": "maphy-psd/python-webuntis",
"id": "50a862d3032f7b7b9440654552754240ee2b86e0",
"s... |
"""Provides a variety of device interactions with power.
"""
# pylint: disable=unused-argument
import collections
import contextlib
import csv
import logging
from pylib import constants
from pylib.device import decorators
from pylib.device import device_errors
from pylib.device import device_utils
from pylib.utils im... | {
"content_hash": "4bd53e6d2b2f597c85f12d7730301f99",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 80,
"avg_line_length": 35.7580372250423,
"alnum_prop": 0.6503099417971893,
"repo_name": "SaschaMester/delicium",
"id": "7c106a97ff3ceb512b278c462143664fb1c5b941",
"size": ... |
import urllib
from datetime import datetime, timedelta
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.core.mail import send_mail
from django.core.urlresolvers import reverse, reverse_lazy
from django.db import models
from django.template.loader import render_to_str... | {
"content_hash": "567d1f2779fa2ef8acfb7d440c4c0697",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 81,
"avg_line_length": 34.326530612244895,
"alnum_prop": 0.6236623067776457,
"repo_name": "perror/hackingweek",
"id": "7e654b4bed83f903f008ced5fd23a13ca4d627c3",
"size": "... |
import elastictools.elasticclient
import elastictools.request
| {
"content_hash": "8655c87367d9cff877e12eb8902d4c3a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 33,
"avg_line_length": 21,
"alnum_prop": 0.8888888888888888,
"repo_name": "skyhound/elastic-tools",
"id": "e0904f29500b23ac0ea5cd4020d7acc73ac74b4f",
"size": "63",
"binary... |
from typing import Any, Callable, Dict, List, Optional, TypeVar
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.p... | {
"content_hash": "25f8f8c40a00e8ca8b834a944a1e9fca",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 242,
"avg_line_length": 43.958230958230956,
"alnum_prop": 0.6497121457716171,
"repo_name": "Azure/azure-sdk-for-python",
"id": "eb3ff6e4aff7256d9cbafd97a59274d15bc82a4d",
... |
from nose.plugins.attrib import attr
import unittest
#from pyon.ion.endpoint import ProcessRPCClient
from pyon.public import log, IonObject, RT, PRED, BadRequest
from pyon.util.int_test import IonIntegrationTestCase
from pyon.agent.agent import ResourceAgentClient
from pyon.util.context import LocalContextMixin
from ... | {
"content_hash": "8c8ed6732fe654c90a529f2e646b22b5",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 230,
"avg_line_length": 46.55806451612903,
"alnum_prop": 0.6950045035682118,
"repo_name": "ooici/coi-services",
"id": "6d4d9c3849cf24b8614b36d94858b39a7623fb71",
"size": "... |
import asyncio
import logging
import signal
from contextlib import AsyncExitStack
from typing import Any
from urllib.parse import SplitResult
import __main__
from asgiref.sync import async_to_sync, sync_to_async
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError, Command... | {
"content_hash": "fe40f6caf44580e7a8b8503fba62e17a",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 89,
"avg_line_length": 37.744680851063826,
"alnum_prop": 0.6110484780157835,
"repo_name": "zulip/zulip",
"id": "e74ea0d96980e389d3f0b2b52d61432145d7865f",
"size": "5322",
... |
import requests
import begin
def search(seq, threshold=1):
url = "http://api.bigsi.io/search?threshold=%f&seq=%s" % (
float(threshold), seq)
results = requests.get(url).json()
samples = []
for i, j in list(results.values())[0]["results"].items():
samples.append(i)
return samples
... | {
"content_hash": "b6a5faf0788e45ce8d0025f89c63a171",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 62,
"avg_line_length": 21.9,
"alnum_prop": 0.6187214611872146,
"repo_name": "Phelimb/cbg",
"id": "37f1d652b4505dd2537ac308d562079d76849da3",
"size": "438",
"binary": fals... |
from .__version__ import __version__
from tensorx.layers import *
from tensorx.random import *
from tensorx.ops import *
from tensorx.math import *
from tensorx.metrics import *
from tensorx.train import *
from tensorx.init import *
from tensorx.loss import *
from tensorx.activation import *
from tensorx.logic import ... | {
"content_hash": "ac1fb87ac1e50f8d4cca40ecb6bf0b9e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 36,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.7701863354037267,
"repo_name": "davidenunes/tensorx",
"id": "1a81ae9d0c79a0f816eef308ac80df3b71502616",
"size": "... |
__author__ = 'Shinichi Nakagawa'
from configparser import ConfigParser
from boto3.session import Session
import glob
import os
class Storage(object):
def __init__(self, config_file):
"""
init
:param config_file: Application config file
:return:
"""
self.config = Co... | {
"content_hash": "011ca8b26f3c3ff9c89fd083134797bd",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 113,
"avg_line_length": 35.41304347826087,
"alnum_prop": 0.576427255985267,
"repo_name": "Shinichi-Nakagawa/xp2015_baseball_tools",
"id": "436707bf7535d9db139410a2ebd3f1a5f2b... |
import json
import platform
import textwrap
import warnings
from datetime import datetime
from . import config
from .compat import binary_type, string_types
from .exceptions import (
APIError, BadGateway, BadRequest, ConnectionError, Forbidden,
InternalError, MethodNotAllowed, NotFound, ServiceUnavailable,
... | {
"content_hash": "756837b13a1db77fb153bf633463a40d",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 78,
"avg_line_length": 33.96616541353384,
"alnum_prop": 0.5117874930824571,
"repo_name": "ivelum/cub-python",
"id": "8853591ec2e7aceb240f45c6e0c498fb76563ca9",
"size": "90... |
""" smashlib.plugins.prefilter_url
"""
from smashlib.util.ipy import register_prefilter
from smashlib.prefilters.url import URLChecker, URLHandler
from smashlib.plugins import Plugin
from smashlib.util.ipy import uninstall_prefilter
class URLPlugin(Plugin):
""" installs the IPython prefilter which handles urls "... | {
"content_hash": "10d0755d86b71706625ae4ef2040a2ed",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 61,
"avg_line_length": 25.689655172413794,
"alnum_prop": 0.7167785234899329,
"repo_name": "mattvonrocketstein/smash",
"id": "f30f0547bc8a95b1781c0f5466fc8ada7ca0c22d",
"siz... |
import numpy as np
from cs231n.layers import *
from cs231n.layer_utils import *
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network with ReLU nonlinearity and
softmax loss that uses a modular layer design. We assume an input dimension
of D, a hidden dimension of H, and perform classific... | {
"content_hash": "75a5e287f6409502ad1d2577f8ed1838",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 111,
"avg_line_length": 47.84415584415584,
"alnum_prop": 0.5273479913137894,
"repo_name": "HrWangChengdu/CS231n",
"id": "f57cf30d4eebb42e58dd29f3254655ccb10cc4f0",
"size":... |
"""
Main storage of Dynamic Protocol API
"""
from NetCatKS.DProtocol.api.interfaces.storage import IProtocolStogareInterface
from zope.interface import implementer
__author__ = 'dimd'
@implementer(IProtocolStogareInterface)
class ProtocolStorageImplementor(object):
"""
This storage having implement a singl... | {
"content_hash": "f0312afb7735abda4fb135e2c2c3656d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 112,
"avg_line_length": 23.47222222222222,
"alnum_prop": 0.693491124260355,
"repo_name": "dimddev/NetCatKS",
"id": "d63e3d340cef68bb02df0ac64ad2e5e41bb64926",
"size": "845"... |
from django.db import models
from django.utils import timezone
from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
class News_post(models.Model):
'''
Model contains all news articles.
'''
title = models.CharField(max_length=200)
image = RichTextUpl... | {
"content_hash": "7630abe54f1d19952a4cdb854bee62cd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 64,
"avg_line_length": 25.46938775510204,
"alnum_prop": 0.5993589743589743,
"repo_name": "maistrovas/News_app",
"id": "5c401436f736f52a837df1f28f09f318a1adc928",
"size": "1... |
class Publication():
def __init__(self, topic_id, id, client):
self.topic_id = topic_id
self.id = id
self.client = client
# Get all publications for the associated Topic. Requires authorization of **read_any_publications**, or **read_application_publications**.
# '/api/topics/:topic_id/publications' GET
#
... | {
"content_hash": "96cb637bfda0b9567c61bff67b09c124",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 204,
"avg_line_length": 44.622950819672134,
"alnum_prop": 0.7046289493019838,
"repo_name": "cwadding/sensit-python",
"id": "835eef73bc469db005dae190762a17675f720ebf",
"size... |
"""Prints all histogram names."""
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import tempfile
try:
from StringIO import StringIO # for Python 2
except ImportError:
from io import StringIO # for Python 3
sys.path.append(os.path.join(os.path.dirname(__file__), '.... | {
"content_hash": "4eabc496dbc2c91d078b0e4d8a550eb6",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 29.719298245614034,
"alnum_prop": 0.6992325855962219,
"repo_name": "ric2b/Vivaldi-browser",
"id": "2d8aba3dcf55944b63cc7158714db9c5baf0757a",
"size"... |
from __future__ import absolute_import
import datetime
from django.conf import settings
from django.http import HttpResponse
from django.test import TestCase
from django.utils import timezone
from mock import patch, MagicMock
from zerver.lib.test_helpers import MockLDAP
from confirmation.models import Confirmation
f... | {
"content_hash": "60923e77069a4c7b4ffece1ae48c9f1f",
"timestamp": "",
"source": "github",
"line_count": 1614,
"max_line_length": 114,
"avg_line_length": 43.013011152416354,
"alnum_prop": 0.5822998141826196,
"repo_name": "jainayush975/zulip",
"id": "49f32fbe5bba8cbaf03af9c6a9e603be94cfd356",
"size":... |
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
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... | {
"content_hash": "03912b0b089058cc31e88a4ce09b8474",
"timestamp": "",
"source": "github",
"line_count": 465,
"max_line_length": 145,
"avg_line_length": 36.74623655913979,
"alnum_prop": 0.5377772575642301,
"repo_name": "JeyZeta/Dangerous",
"id": "e9ef550c3af7bfa5385ba788a6a71ab971c588e8",
"size": "1... |
"""
Wrapper for the ssh program.
Provides get_ssh, ssh_command, and scp functions.
"""
import sys, os
from pycopia import proctools
from pycopia import expect
SSH = proctools.which("ssh")
SCP = proctools.which("scp")
KEYGEN = proctools.which("ssh-keygen")
KEYSCAN = proctools.which("ssh-keyscan")
class SSHRetry(Run... | {
"content_hash": "dec1127003cb39a9e23e81cd9f193ddf",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 112,
"avg_line_length": 31.070257611241217,
"alnum_prop": 0.5869450516318685,
"repo_name": "kdart/pycopia",
"id": "91ded8469ebc2c35e195d9df68a3e92605c15236",
"size": "1390... |
"""autogenerated by genpy from mapping_dlut/Grid.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class Grid(genpy.Message):
_md5sum = "d1e632170b3f559b23311a8f8cc60632"
_type = "mapping_dlut/Grid"
_has_header = False #flag to mark the presence ... | {
"content_hash": "06718c6c1c3256ef399482457b9a54ea",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 123,
"avg_line_length": 31.484375,
"alnum_prop": 0.6610421836228287,
"repo_name": "WuNL/mylaptop",
"id": "e805ba2e3c95de25d9b27ee809e83c66174914e4",
"size": "4030",
"bin... |
"""
TutorialWorld - basic objects - Griatch 2011
This module holds all "dead" object definitions for
the tutorial world. Object-commands and -cmdsets
are also defined here, together with the object.
Objects:
TutorialObject
Readable
Climbable
Obelisk
LightSource
CrumblingWall
Weapon
WeaponRack
"""
from future.utils... | {
"content_hash": "161b13d9f3c369a722025ccd5f0fed42",
"timestamp": "",
"source": "github",
"line_count": 1079,
"max_line_length": 119,
"avg_line_length": 37.76367006487489,
"alnum_prop": 0.5837239551378015,
"repo_name": "feend78/evennia",
"id": "3859de7d2d0d318426c68ba2129620f299224bcc",
"size": "40... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0029_unicode_slugfield_dj19'),
('events', '0017_auto_20... | {
"content_hash": "74fd0c4eeef27b7b00d1a7b00b6b1c38",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 191,
"avg_line_length": 33.21621621621622,
"alnum_prop": 0.5947925142392189,
"repo_name": "davidjrichardson/uwcs-zarya",
"id": "1bb7987d29636b51901706a7ddc82ec1fd77b71d",
"... |
import os
from jetee.base.config_factory import AnsiblePreTaskConfigFactory
from jetee.runtime.configuration import project_configuration
class PipRequirementsAnsiblePreTaskConfigFactory(AnsiblePreTaskConfigFactory):
template = {
u'name': u'Install PIP requirements',
u'pip': {
u'chdir... | {
"content_hash": "fff44cf7d18573d7bca94476d7919b0a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 109,
"avg_line_length": 32.285714285714285,
"alnum_prop": 0.6651917404129793,
"repo_name": "WhackoJacko/Jetee",
"id": "bbd86c0b42a209e82d25656737871553087e1cc3",
"size": "6... |
""" This document contain the responsible
methods to write and parse the GrAF files.
The parser use the ContentHandler from
SAX Xml module.
"""
from __future__ import absolute_import, unicode_literals
import abc
import codecs
import os
from xml.etree.ElementTree import tostring
from xml.dom import min... | {
"content_hash": "5c80901227ccb27bdf6b050a25d242cf",
"timestamp": "",
"source": "github",
"line_count": 577,
"max_line_length": 80,
"avg_line_length": 30.85095320623917,
"alnum_prop": 0.5675523846974889,
"repo_name": "cidles/poio-api",
"id": "c1167c7d4a924ca9006ec14d6bb82e5d81b8090d",
"size": "1802... |
from __future__ import print_function
import time
from copy import deepcopy
from pymanopt.solvers.linesearch import LineSearchBackTracking
from pymanopt.solvers.solver import Solver
class SteepestDescent(Solver):
"""
Steepest descent (gradient descent) algorithm based on
steepestdescent.m from the manop... | {
"content_hash": "c1f43195b35584292e7ed690854ecf80",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 78,
"avg_line_length": 36.242990654205606,
"alnum_prop": 0.574780814853017,
"repo_name": "j-towns/pymanopt",
"id": "b8732db070e732ab76c22832ca7a73a461843824",
"size": "387... |
from pylab import plot,grid,title,subplot,xlabel,ylabel,text,subplots_adjust,fill_between,mean,connect,show
import shogun as sg
import util
util.set_title('ROC example')
util.DISTANCE=0.5
subplots_adjust(hspace=0.3)
pos=util.get_realdata(True)
neg=util.get_realdata(False)
features=util.get_realfeatures(pos, neg)
labe... | {
"content_hash": "b59e5e6e93f4c2a66bee7a9f045027ed",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 107,
"avg_line_length": 25.464285714285715,
"alnum_prop": 0.7005610098176718,
"repo_name": "shogun-toolbox/shogun",
"id": "be3bf06e0e73a83372756a346f5dc5a59452be9a",
"size"... |
import sys
from autosar.parser.parser_base import ElementParser
import autosar.datatype
class DataTypeParser(ElementParser):
def __init__(self,version=3.0):
super().__init__(version)
if self.version >= 3.0 and self.version < 4.0:
self.switcher = {'ARRAY-TYPE': self.parseArrayT... | {
"content_hash": "2114729f6973bed964718f69c96e84ef",
"timestamp": "",
"source": "github",
"line_count": 528,
"max_line_length": 158,
"avg_line_length": 47.58143939393939,
"alnum_prop": 0.5892608366835171,
"repo_name": "cogu/autosar",
"id": "5e5b34726b56d28dd624fc828ec672fc765350df",
"size": "25123"... |
from zeep import Client, xsd
from zeep.plugins import HistoryPlugin
from zeep.exceptions import Fault
import zeep.cache
import zeep.transports
from .mappings import query_type_mapping, cvd_field_mapping, layer_field_mapping, collection_field_mapping, pending_device_field_mapping, policy_field_mapping, volume_field_mapp... | {
"content_hash": "4bb0e72038d40a657760589b4821028f",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 180,
"avg_line_length": 35.47826086956522,
"alnum_prop": 0.5879629629629629,
"repo_name": "jay-tuckey/python-vmwaremirage",
"id": "edc177d6755178663a767ee839202261d5d7fbd5",... |
"""Support for RainMachine devices."""
import asyncio
from datetime import timedelta
from functools import partial
from regenmaschine import Client
from regenmaschine.controller import Controller
from regenmaschine.errors import RainMachineError
from homeassistant.config_entries import ConfigEntry
from homeassistant.... | {
"content_hash": "0a7ee7466a85865d2e61aa56d6d8718d",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 86,
"avg_line_length": 32.366533864541836,
"alnum_prop": 0.6392171344165436,
"repo_name": "turbokongen/home-assistant",
"id": "98fbdbcf4015e9f42dfcc2e55bd0b10066ea025b",
"... |
import weakref
import Gaffer
import GafferUI
from GafferUI.PlugValueWidget import sole
from Qt import QtCore
class ColorPlugValueWidget( GafferUI.PlugValueWidget ) :
def __init__( self, plugs, **kw ) :
self.__column = GafferUI.ListContainer( GafferUI.ListContainer.Orientation.Vertical, spacing = 4 )
GafferU... | {
"content_hash": "14f4a27ab12a261bfbd845eb155c338e",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 116,
"avg_line_length": 31.69178082191781,
"alnum_prop": 0.7220661335638643,
"repo_name": "hradec/gaffer",
"id": "6e4ac3e25d1629de22b5c5ed28bc031c77be53ce",
"size": "6497"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0095_auto_20200603_2208'),
]
operations = [
migrations.AddField(
model_name='programmingchallenge',
name='testing_examples',
field=models.TextF... | {
"content_hash": "a42ccd98f7128a15f2c7ff7559efc1fe",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 47,
"avg_line_length": 22.1875,
"alnum_prop": 0.5859154929577465,
"repo_name": "uccser/cs-unplugged",
"id": "9da0a9145b4271066eebd69066d964c66f584eef",
"size": "405",
"bi... |
import core.social.Objects.User
from ..Mongo import Mongo
import facebook
# from .User import User
from .Comment import Comment
from .Likes import Likes
from ..configurations import Config
import re
import json
import ast
class Post:
def __init__(self, **kwargs):
post_fields = ["created_time", "_id", "id... | {
"content_hash": "49248d9c14cfaf8e18225a7c4e92dc36",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 128,
"avg_line_length": 28.00943396226415,
"alnum_prop": 0.5405860559110812,
"repo_name": "euronmetaliaj/MarketAnalyzer",
"id": "de04d435e5d8fce9c7687725ee7802ea0f941a12",
... |
from django.core.files import File
from django.core.management.base import BaseCommand
from django.shortcuts import get_list_or_404
from employees.models import Employee
class Command(BaseCommand):
help = 'Set default avatar image for all employees, suggested use on development environments'
def get_employee... | {
"content_hash": "e66b48fa14637f7490bb830afe0c590c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 98,
"avg_line_length": 34.833333333333336,
"alnum_prop": 0.7145135566188198,
"repo_name": "belatrix/BackendAllStars",
"id": "2ac9702b2294af1b7054bea06f439393c0df4a76",
"siz... |
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import Property
from gravur.common.labelbox import LabelBox # NOQA
from gravur.utils import load_widget
@load_widget
class TransactionPreview(BoxLayout):
txid = Property(None)
timestamp = Property("loading")
delta = Property("loading")
d... | {
"content_hash": "84a8172872b341a35a8f63c243455275",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 30.25,
"alnum_prop": 0.71900826446281,
"repo_name": "F483/gravur",
"id": "141d3b22d1d8707b9d86b0ad077e838e491df4c8",
"size": "599",
"binary": false... |
import collections
import functools
def filter_and_text_type_assertions(func):
"""Decorates all functions with the filter and text signature to confirm the types of """
@functools.wraps(func)
def decorator(*args, **kwargs):
try:
args = list(args)
filters = args[0]
... | {
"content_hash": "44ea648ebca1740a811bc203ee920853",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 181,
"avg_line_length": 45.851851851851855,
"alnum_prop": 0.635702746365105,
"repo_name": "52inc/python-naughty-words",
"id": "97cef6e90e427be3bdc099e86f0d5cd5ca6ec46e",
"s... |
import sys, os
try:
import sphinx_rtd_theme
except ImportError:
_RTD_THEME = False
pass
else:
_RTD_THEME = True
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path... | {
"content_hash": "4c8807fe0d22912fbd177fcaf0981d0c",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 122,
"avg_line_length": 31.812244897959182,
"alnum_prop": 0.6986143187066974,
"repo_name": "pombredanne/bitmath",
"id": "fd082bb251fe56728a407d7073080e85b8762f4b",
"size":... |
from pytos.securechange.xml_objects.restapi.step.initialize import *
from pytos.securechange.xml_objects.restapi.step.access_request.designer import DesignerResult
from pytos.securechange.xml_objects.restapi.step.step import Binding, SlimRuleWithMetadata, SlimRule
logger = logging.getLogger(XML_LOGGER_NAME)
class Ru... | {
"content_hash": "c71b31b6abb4b91c86dd7ae19cb7a4e2",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 120,
"avg_line_length": 44.308411214953274,
"alnum_prop": 0.6396329888209239,
"repo_name": "Tufin/pytos",
"id": "e7a38fce3a36f06bd87bf21b5496191749e5497a",
"size": "9482",... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.utils.compatibility import python_2_unicode_compatible
from . import filemodels
@python_2_unicode_compatible
class Clipboard(models.Model):
use... | {
"content_hash": "8d591dfdf4667b62cfcbbdd54ab9ca88",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 95,
"avg_line_length": 33.30434782608695,
"alnum_prop": 0.6481723237597912,
"repo_name": "django-leonardo/django-leonardo",
"id": "ebcaa623f0df3dc87959b69d93af4a84f3781a9b",
... |
"""
This script uses yum and rpm to generate in-toto material provenance and
writes the resulting JSON to stdout or to argv[0] if provided.
"""
import dnf
import json
import sys
import urllib.parse
in_toto_data = list()
in_toto_fmt = "pkg:rpm/{origin}/{name}@{epoch}{version}-{release}?arch={arch}"
with dnf.Base() as... | {
"content_hash": "6f9e20eb37bf80fda80ce4034ed0e10c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 31.956521739130434,
"alnum_prop": 0.5027210884353741,
"repo_name": "PowerDNS/pdns-builder",
"id": "507ccb606f88909ca2c37da9d45fd443140de5ed",
"size":... |
import os
import re
import sys
import tempfile
import textwrap
import fixtures
import mock
import pkg_resources
import six
from testtools import matchers
from pbr import git
from pbr import packaging
from pbr.tests import base
class TestRepo(fixtures.Fixture):
"""A git repo for testing with.
Use of TempHom... | {
"content_hash": "1a5c6a9d17d2ee8f6fd0aee7cdc7c32f",
"timestamp": "",
"source": "github",
"line_count": 475,
"max_line_length": 79,
"avg_line_length": 37.64,
"alnum_prop": 0.5846523854801723,
"repo_name": "rosudrag/Freemium-winner",
"id": "32e9f562e0297ae4f80c780ba0d5a9b421db6a0f",
"size": "19731",... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
Resourc... | {
"content_hash": "3021ff4ec7df392bb7436219dc793190",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 203,
"avg_line_length": 44.018181818181816,
"alnum_prop": 0.61737574005232,
"repo_name": "Azure/azure-sdk-for-python",
"id": "f2d3a0e416f32d2a6e455422a588caf8dd7d7a0a",
"s... |
from collections import deque
import numpy as np
import argparse
import imutils
import cv2
import time
import socket
from internetcheck import ServerConnection
# construct the argument parse and parse the arguments
# v4l2-ctl --set-ctrl brightness=130
#cmd commands:
#source ~/.profile
#workon cv
#python '/home/pi/Docum... | {
"content_hash": "6e5f5ff7aa640a1203a0e56e545b8a94",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 120,
"avg_line_length": 29.873626373626372,
"alnum_prop": 0.5655692477469193,
"repo_name": "SachinKonan/Windows-RPI-Vision-Framework",
"id": "fa42d304684f220248434357306c143... |
import os
# 3rd party
# Flask
from flask_appbuilder.security.manager import AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH
basedir = os.path.abspath(os.path.dirname(__file__))
# Your App secret key
SECRET_KEY = '\2\1thisismyscretkey\1\2\e\y\y\h'
# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_... | {
"content_hash": "4216fb63facfbbf8dc9f0405ee7e4c70",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 104,
"avg_line_length": 33.50925925925926,
"alnum_prop": 0.6145344017684443,
"repo_name": "approximatelylinear/trans-passports-docker",
"id": "b033240afd2ad1ebb152d42451acb9... |
"""
Copyright (c) 2013, G Roberts
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the follo... | {
"content_hash": "ee3fc2e6c13bc83bd07c66705a29abde",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 113,
"avg_line_length": 31.38192419825073,
"alnum_prop": 0.5674470457079153,
"repo_name": "HarryR/HyperStats",
"id": "3b7b6860a8e22a4f874bf31a9ec5df6d4e0552af",
"size": "1... |
from pants.backend.jvm.targets.jar_dependency import JarDependency
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants_test.tasks.task_test_base import TaskTestBase
from squarepants.plugins.link_resources_jars.targets.resources_jar import ResourcesJar
from squarepants.plugins.link_resources_jars.ta... | {
"content_hash": "c4c90df005fc7d5fe97717c000ac2bdb",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 95,
"avg_line_length": 42.85,
"alnum_prop": 0.7736289381563594,
"repo_name": "ericzundel/mvn2pants",
"id": "a0b4e94b3b4a3e4439a5b84940a160611b866816",
"size": "1063",
"bi... |
from robot.utils import is_string, py2to3, PY3
from .comments import Comment
if PY3:
unicode = str
@py2to3
class Setting(object):
def __init__(self, setting_name, parent=None, comment=None):
self.setting_name = setting_name
self.parent = parent
self._set_initial_value()
sel... | {
"content_hash": "95f98efc60545e4390408709232432c5",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 80,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.5860199152124618,
"repo_name": "alexandrul-ci/robotframework",
"id": "fb51cd3cf88cb31dc0566a8c25ee0f4053b8a144",
... |
from ensetuptools.utilities import *
import unittest
import os, sys
class FindEggsTest(unittest.TestCase):
def test_find_eggs_in_scipy(self):
# a 'hard' download page to parse
url = 'http://sourceforge.net/project/showfiles.php?group_id=27747&package_id=19531'
# should be something here
... | {
"content_hash": "18bc9c6f7f21494d4ecaec5ab2f226ad",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 32.30769230769231,
"alnum_prop": 0.6714285714285714,
"repo_name": "cournape/ensetuptools",
"id": "6ef1b38468e4b13a6b47d7b20857bde2682bb05d",
"size": ... |
import webtest
from .. common import BaseTest, WPS_TEST_SERVICE, dummy_request
from twitcher.store import ServiceStore
class FunctionalTest(BaseTest):
def test_app(self):
app = webtest.TestApp(
self.config.make_wsgi_app(),
extra_environ={'db.session': self.session, 'tm.active': T... | {
"content_hash": "b718f875ca5272ddc2e7d6c4ea918891",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 74,
"avg_line_length": 28.96969696969697,
"alnum_prop": 0.5575313807531381,
"repo_name": "bird-house/pywps-proxy",
"id": "1b4bb6a143643603b374cc2a8e73cf35c669c386",
"size":... |
import csv
import pkg_resources
import re
from lxml import etree
import StringIO
LEFT_WHITE_SPACE_RE = re.compile('\A[ \n\t].*\Z', re.DOTALL)
RIGHT_WHITE_SPACE_RE = re.compile('\A.*[ \n\t]\Z', re.DOTALL)
INNER_XML_RE = re.compile(u'\A[ \n\t]*<[^>]+?>(?P<body>.*)</[^>]+?>[ \n\t]*\Z')
def strip_text(text):
"""
... | {
"content_hash": "d559fe72f45e3be149466670b960a1f1",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 165,
"avg_line_length": 28.390134529147982,
"alnum_prop": 0.573053230137419,
"repo_name": "creativecommons/cc.license",
"id": "6266fa99d97b4d4b3e712247ba41dbdea0bf5391",
"... |
"""
ulid/providers/provider
~~~~~~~~~~~~~~~~~~~~~~~
Contains provider abstract classes.
"""
import abc
import typing
from .. import hints
#: Type hint that defines a two item tuple of bytes returned by the provider.
TimestampRandomnessBytes = typing.Tuple[hints.Bytes, hints.Bytes] # pylint: disable=inva... | {
"content_hash": "3df0c53912bc2c07d37f32a447bd0c74",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 97,
"avg_line_length": 30.07843137254902,
"alnum_prop": 0.6421121251629727,
"repo_name": "ahawker/ulid",
"id": "7fe6758ad241681372db552183fde39f6520a99a",
"size": "1534",
... |
__author__ = 'Patrizio Tufarolo'
__email__ = 'patrizio.tufarolo@studenti.unimi.it'
from testagent.probe import Probe
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), "Search-Scan/"))
print("PROXY:" , os.getenv("http_proxy"));
_searchscan = __import__('Search-scan', globals(), locals(), [], -1); ... | {
"content_hash": "b088ce9f2569e7661032122ec93cdabe",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 187,
"avg_line_length": 44.333333333333336,
"alnum_prop": 0.6229462545252019,
"repo_name": "SESARLab/mooncloud_probe_vuln",
"id": "6780c0afdc0490cc5ec45eb823be83c8609a7cf0",
... |
from distutils.core import setup
try:
from setuptools import setup
except:
pass
setup(
name = "pev",
version = "0.1.0",
author = "Stanislav Feldman",
description = ("Python EVenter library"),
url = "https://github.com/stanislavfeldman/pev",
keywords = "eventer pubsub publish subscribe",
p... | {
"content_hash": "b5ef2c28c72f04d9abde4fab8f7c37b2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 52,
"avg_line_length": 22.444444444444443,
"alnum_prop": 0.6435643564356436,
"repo_name": "stanislavfeldman/pev",
"id": "86fd2908dcdfe9b1ab2012cd1772f839f4344141",
"size": ... |
import replace as r
import re
# rename files first, REMEMBER to refer to them later as their new names
r.rename_file('chromium.spec', 'chromium-browser.spec');
r.rename_file('chromium.changes', 'chromium-browser.changes');
# change the master_preferences file to use SLEish settings instead of
# openSUSEish settings
r... | {
"content_hash": "acc40fe97420a6438a231cd1bdbe1570",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 39.48780487804878,
"alnum_prop": 0.6195182211241507,
"repo_name": "bgmerrell/novellium",
"id": "6bf620b87b12b6368866474885d06f8fd25e397a",
"size": "1... |
import logging
import os.path
from ask_amy.core.exceptions import FileExistsError
logger = logging.getLogger()
class CodeGenerator(object):
def __init__(self, skill_name, aws_role='', intent_schema=None):
self._skill_name = skill_name
self._aws_role = aws_role
self._intent_schema = intent_... | {
"content_hash": "817d5277cd376ce9dbcec3e4da67cca5",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 122,
"avg_line_length": 44.64204545454545,
"alnum_prop": 0.48911798396334477,
"repo_name": "dphiggs01/ask_amy",
"id": "db27c569c893b59511b55ef2b8579abc3241848e",
"size": "... |
import rwdb
def test_basic():
class Test(rwdb.Document):
pass
# TODO write actual tests
| {
"content_hash": "d251b49bd3c21e43be88605123d21edd",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 33,
"avg_line_length": 18.166666666666668,
"alnum_prop": 0.6146788990825688,
"repo_name": "FlorianLudwig/rwdb",
"id": "08593479c9645ec81c050c213050755b8b3e3539",
"size": "10... |
subreddit = 'ChristmasCake'
t_channel = '@r_christmascake'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| {
"content_hash": "0955098602db522a41752d2ff392967e",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 22,
"alnum_prop": 0.7348484848484849,
"repo_name": "Fillll/reddit2telegram",
"id": "0ddd98148fd93bae192b19f406477a0a2a8b294e",
"size": "149",
"binar... |
"""
Support the ISY-994 controllers.
For configuration details please visit the documentation for this component at
https://home-assistant.io/components/isy994/
"""
import logging
from future.moves.urllib.parse import urlparse
from homeassistant.const import (
CONF_HOST, CONF_PASSWORD, CONF_USERNAME,
EVENT_HO... | {
"content_hash": "5fbe1b5283b521675ede04f9d412a72a",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 29.12037037037037,
"alnum_prop": 0.6049284578696343,
"repo_name": "Julian/home-assistant",
"id": "c224303f8d0502c7ed7859c450949e46dceb8547",
"size":... |
from __future__ import print_function, unicode_literals
from string import Template
__author__ = "danishabdullah"
ITEM_JSON = Template("""{"name": "$name", "type": "$type", "mode": "$mode"}""")
RECORD_JSON = Template("""{"name": "$name", "type": "RECORD", "mode": "$mode", "fields":[$fields]}""")
TABLE_JSON = Template... | {
"content_hash": "a128d700384cc0447d944c5f23a17acf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 130,
"avg_line_length": 36.375,
"alnum_prop": 0.6666666666666666,
"repo_name": "danishabdullah/BigSchema",
"id": "cec660fefd0bea97c35a60d05062a32a60bc42f2",
"size": "1164",... |
from setuptools import setup
from odk_aggregation_tool import __version__
setup(
name="odk_aggregation_tool",
version=__version__,
description="A tool for aggregating ODK XML data.",
url="https://github.com/lindsay-stevens/",
author="Lindsay Stevens",
author_email="lindsay.stevens.au@gmail.com"... | {
"content_hash": "46a7828856a1a5cea7825bab6425b363",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 55,
"avg_line_length": 28.541666666666668,
"alnum_prop": 0.635036496350365,
"repo_name": "lindsay-stevens/odk_aggregation_tool",
"id": "1b56ddb10d157b036182f70fd4626a063dab6a... |
import numpy as np
# import dynamicalModels.models
from dynamicalModels.models.MarkovCRF import MarkovCRF
from dynamicalModels.models.MarkovSemiMarkovCRF import MarkovSemiMarkovCRF
from dynamicalModels.models.SemiMarkovCRF import SemiMarkovCRF
from dynamicalModels.models.CRF_Functions import *#msm_preprocess_train, msm... | {
"content_hash": "752d2f7e9ef47fe562f5caf4d2f9a814",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 191,
"avg_line_length": 46.234042553191486,
"alnum_prop": 0.7200490872833256,
"repo_name": "colincsl/StructuredModels",
"id": "820b2b97fd5e929f4eb8b57d1b720996717ecd90",
"... |
import errno
import logging
import os
from paramiko.client import SSHClient, AutoAddPolicy
from paramiko.ssh_exception import AuthenticationException, SSHException, \
NoValidConnectionsError
import pytest
import requests
import shutil
def _create_or_update_symplink(target, link_name):
"""
Create or updat... | {
"content_hash": "c8cc50ffaa227a74f6b19255402f6dde",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 78,
"avg_line_length": 30.205555555555556,
"alnum_prop": 0.6277358837594261,
"repo_name": "infOpen/ansible_customer",
"id": "69ac24ec27302e9aebc0f263bb026b7ddae97397",
"si... |
from factory import Sequence, PostGenerationMethodCall
from factory.alchemy import SQLAlchemyModelFactory
from snapface.user.models import User
from snapface.database import db
class BaseFactory(SQLAlchemyModelFactory):
class Meta:
abstract = True
sqlalchemy_session = db.session
class UserFacto... | {
"content_hash": "ba6fab37c740ff389ae5015980c3f449",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 26.363636363636363,
"alnum_prop": 0.7275862068965517,
"repo_name": "krekle/snapface",
"id": "ce1de8d9ec686a4e789b375f565b906b3a0efac0",
"size": "604"... |
GENOMES_DIR = '/home/cmb-panasas2/skchoudh/genomes'
OUT_DIR = '/staging/as/skchoudh/rna/Feb_02_2017_Radiation_GBM_EBV_Sept2017_ribo'
SRC_DIR = '/home/cmb-panasas2/skchoudh/github_projects/clip_seq_pipeline/scripts'
RAWDATA_DIR = '/home/cmb-06/as/skchoudh/dna/Luiz_radiation_data/Penalva_08242016_Run160902/Penalva_082420... | {
"content_hash": "c102bf30eaa750ec8562f17d7f7432d1",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 145,
"avg_line_length": 63.36666666666667,
"alnum_prop": 0.7006838506049448,
"repo_name": "saketkc/ribo-seq-snakemake",
"id": "3e28218ef6f76c1be4cf5dd5f17bd636968b794b",
"s... |
''' This package contains functionality exterior to the core. This is where higher level tools, which depend on the
core live. ''' | {
"content_hash": "d851dea462ddf0bf2d121f61293810d6",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 115,
"avg_line_length": 67,
"alnum_prop": 0.746268656716418,
"repo_name": "rectangletangle/nlplib",
"id": "553b32021c8d92b2549990df12658aa644f5ea72",
"size": "134",
"binar... |
from pycqed.measurement.waveform_control_CC import waveform as wf
try:
from qcodes import Instrument
except ImportError:
print('could not import qcodes Instrument')
def mock_control_pulse_prepare(command, **kwargs):
'''
Mock function for testing purposes returns the kwargs
'''
# printing to b... | {
"content_hash": "ca840dd4db3919bc24663dddaf56d24f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 65,
"avg_line_length": 24.61111111111111,
"alnum_prop": 0.6715575620767494,
"repo_name": "DiCarloLab-Delft/PycQED_py3",
"id": "c33f6af2bdaa1ad28e96ed5ff69d98ecd2370acd",
"s... |
import bioinf
from numpy import array, dot, arccos, rad2deg, ndarray, cross
from numpy.linalg import norm
from constants import *
from collections import OrderedDict, namedtuple
class PDBATOMFileReader(object):
def __init__(self, file_or_path):
self._parse_atom_lines(file_or_path)
self._set_residue... | {
"content_hash": "005e3fda1801bd9e19cf046d9d7b2717",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 84,
"avg_line_length": 37.24797843665768,
"alnum_prop": 0.6053983645705189,
"repo_name": "jruhym/intrapeptideContacts",
"id": "5126b8640adea1e7cabeed61f00028533816ecb6",
"... |
from elephunk.database import Row
class Bloat(Row):
@property
def table_id(self):
return (self.schemaname, self.tablename)
@property
def full_table_name(self):
return "%s.%s" % self.table_id
@staticmethod
def sql():
return """
SELECT
schemaname,
tablename,
reltu... | {
"content_hash": "c423efaf3e06cac68e6fab24c8e91d30",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 159,
"avg_line_length": 37.521126760563384,
"alnum_prop": 0.6482732732732732,
"repo_name": "pitluga/elephunk",
"id": "039e9e9163a1403dfc8d92d1a794b0d22ce79e99",
"size": "26... |
"""A module for the main curvature optimizer class."""
from typing import Any, Callable, Iterator, Mapping, Optional, Sequence, Tuple, Union
import jax
import jax.lax as lax
import jax.numpy as jnp
import jax.random as jnr
from kfac_ferminet_alpha import estimator
from kfac_ferminet_alpha import tag_graph_matcher as ... | {
"content_hash": "33609bb019e87564e8b754bdd99469b4",
"timestamp": "",
"source": "github",
"line_count": 597,
"max_line_length": 104,
"avg_line_length": 43.32998324958124,
"alnum_prop": 0.6567960414411629,
"repo_name": "deepmind/deepmind-research",
"id": "9f1973cf180501b62c8bb6daa265897c267d6c2e",
"... |
import datetime
import pytz
from feedgen.feed import FeedGenerator
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
thecodingloveurl = "http://thecodinglove.com/rss"
pubdate = datetime.datetime(2017, 8, 7, 21, 0, 0, 0, pytz.UTC)
fg = FeedGenerator()
fg.title('The coding lov... | {
"content_hash": "5dc44078a8baddbf409268b358e811dc",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 66,
"avg_line_length": 22.838709677419356,
"alnum_prop": 0.653954802259887,
"repo_name": "chrillux/thecodingloverss",
"id": "4fa7ac9826573d84c912d5030eb4c43dccf36598",
"siz... |
import django
import pytest
from django.http import Http404
from ninja import NinjaAPI, Schema
from ninja.testing import TestAsyncClient, TestClient
api = NinjaAPI()
class CustomException(Exception):
pass
@api.exception_handler(CustomException)
def on_custom_error(request, exc):
return api.create_response... | {
"content_hash": "48c5d0eb77a61d06fc6a42cd8ecb7b4a",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 90,
"avg_line_length": 24.97029702970297,
"alnum_prop": 0.654639175257732,
"repo_name": "vitalik/django-ninja",
"id": "839863b6d9c596cc8d5e1ed069acc41712a7cf07",
"size": "... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
import urllib.parse
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
Resourc... | {
"content_hash": "d48bf90ce0024294663d3293dacb42f6",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 222,
"avg_line_length": 43.43601895734597,
"alnum_prop": 0.6454991816693945,
"repo_name": "Azure/azure-sdk-for-python",
"id": "bd96444d7e33e1f5b7bca48106fd99c92bff9b58",
"... |
from .bins import SimpleBin, NumberBin, VolumeError
from .fit import Fit, BinReduction, BinOrdering
| {
"content_hash": "4d662b36ffdbdd2ebef7da0bc985b4e8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 51,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.8118811881188119,
"repo_name": "ibigpapa/bin_packing_problem",
"id": "885dc836609f4c3a74202636155cea8d9da37087",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.