text stringlengths 4 1.02M | meta dict |
|---|---|
import pytest
blueprint_list = []
@pytest.fixture(scope='function', params=blueprint_list)
def blueprint_examples(**_):
pass
def test_blueprints(blueprint_examples):
assert blueprint_examples is None
| {
"content_hash": "8efa4f7fe234ab76c4e646992d9948b8",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 17.75,
"alnum_prop": 0.7370892018779343,
"repo_name": "cloudify-cosmo/cloudify-diamond-plugin",
"id": "c7e25259c6ce1ef8a08d27ff5b21772326fbb298",
"si... |
from argparse import ArgumentParser
from sonLib.bioio import popenCatch
parser = ArgumentParser()
parser.add_argument('halPath')
parser.add_argument('outputTsv')
opts = parser.parse_args()
genomes = popenCatch("halStats --genomes %s" % (opts.halPath)).split()
outFile = open(opts.outputTsv, 'w')
for genome in genomes:... | {
"content_hash": "66bf70273c7df6ca0cb595ea3cc4c4ee",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 70,
"avg_line_length": 34.07692307692308,
"alnum_prop": 0.7358916478555305,
"repo_name": "joelarmstrong/analysis-purgatory",
"id": "98bf6a91ad1e3fced3c564387d4dfaf755eb155d",... |
class Null(object):
"""
Object is a Harsh Null.
Object can be assigned and initialised.
Will the always raise TypeError.
"""
def __init__(self, *args, **kwargs):
return
# object calling
def __call__(self, *args, **kwargs):
raise TypeError("Object is Null.")
... | {
"content_hash": "2b535a77c2cd8416ee821c3284018d55",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 43,
"avg_line_length": 24.830188679245282,
"alnum_prop": 0.5303951367781155,
"repo_name": "AugustusLongeye/Technic-Script-2",
"id": "a7336771a302f73cdb3764932326ccbc639291e6"... |
from google.appengine.ext import ndb
class Secret(ndb.Model):
value = ndb.StringProperty()
| {
"content_hash": "61bf3c08664e8356a32a4db2976ea434",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 19.4,
"alnum_prop": 0.7422680412371134,
"repo_name": "Yelp/love",
"id": "cc6b7fa06f65dad33b11b9f027867cb9aa221765",
"size": "121",
"binary": false,
... |
from workshops.models import Tag
from workshops.tests.base import TestBase
class TestTagManager(TestBase):
def setUp(self):
super()._setUpTags()
def test_main_tags(self):
# Arrange
expected = [
Tag.objects.get(name="DC"),
Tag.objects.get(name="ITT"),
... | {
"content_hash": "bf45a6b187e090fcfe491c0066585f0b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 67,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.5368509212730318,
"repo_name": "pbanaszkiewicz/amy",
"id": "5d3d77c7f64a19e4b08a9bfbf8616c4de71ef1ce",
"size": "1... |
import mock
from rally.plugins.openstack.scenarios.murano import environments
from tests.unit import test
MURANO_SCENARIO = ("rally.plugins.openstack.scenarios.murano."
"environments")
class MuranoEnvironmentsTestCase(test.ScenarioTestCase):
def _get_context(self):
self.context.updat... | {
"content_hash": "fba89c2e43a7868fbc5f4bf7c1a9e3cd",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 78,
"avg_line_length": 48.608695652173914,
"alnum_prop": 0.4525939177101968,
"repo_name": "vganapath/rally",
"id": "5e432ed925f3b7dddce3829b2fb6ff0f80a1d127",
"size": "622... |
from datetime import datetime
import logging
import random
import time
from google.appengine.api import memcache
_MEMCACHE_MASTER_DOWNLOAD_LOCK = 'master-download-lock-%s'
_MEMCACHE_MASTER_DOWNLOAD_EXPIRATION_SECONDS = 60 * 60
_DOWNLOAD_INTERVAL_SECONDS = 10
def WaitUntilDownloadAllowed(
master_name, timeout_s... | {
"content_hash": "24f496bc7e59e72086dc15f7869e6de8",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 31.84,
"alnum_prop": 0.6633165829145728,
"repo_name": "nicko96/Chrome-Infra",
"id": "be4cbd4b55cb7d657c5c5d4be9a2d4ee4ba14642",
"size": "1755",
"bi... |
import requests
from BeautifulSoup import BeautifulSoup
import random,time,re
from Queue import Queue
from threading import Thread,Lock
import config
from basic import save
class Linkedin (Thread):
def __init__(self,account='',password='',session = None,ip = '',queue=None, thread_name = '',thread_id = None,term='',out... | {
"content_hash": "202f7137ac261c38b2b455153b62d385",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 241,
"avg_line_length": 32.50515463917526,
"alnum_prop": 0.6806216301934666,
"repo_name": "hanhaohh/cvhelper",
"id": "fa42dd7b2b61c079648baa5290cf57f89ecfc1b0",
"size": "31... |
import sys
if sys.platform == "win32":
import psutil
print("psutil", psutil.Process().memory_info().rss)
else:
# Note: if you execute Python from cygwin,
# the sys.platform is "cygwin"
# the grading system's sys.platform is "linux2"
import resource
print("ram usage in MB :", resource.getrusa... | {
"content_hash": "9ed5d5889f6efc2c3681812ef65eeacb",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 89,
"avg_line_length": 36.3,
"alnum_prop": 0.6831955922865014,
"repo_name": "pk-python/basics",
"id": "388a03c03b1d30572f78ce257e557e1188e1a91a",
"size": "363",
"binary":... |
from typing import Dict, Optional, Text
import ujson
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
from zerver.models import Message
class GithubV1HookTests(WebhookTestCase):
STREAM_NAME = None # type: Optional[Text]
URL_TEMPLATE = u"/api/v1/external/g... | {
"content_hash": "1265811c6bdc9508433bc2a3a8c36d61",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 379,
"avg_line_length": 61.66417910447761,
"alnum_prop": 0.6466174512888782,
"repo_name": "mahim97/zulip",
"id": "19964bac5476e09a71da7f39a1345f1808e354d9",
"size": "16526... |
"""Module for compile error visualization.
Attributes:
log (logging): this module logger
"""
import logging
import sublime
from os import path
from ..completion.compiler_variant import LibClangCompilerVariant
from ..settings.settings_storage import SettingsStorage
from ..utils.subl.row_col import ZeroIndexedRowCo... | {
"content_hash": "d16b2c21b422799aaac46a1e5758561a",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 79,
"avg_line_length": 37.53515625,
"alnum_prop": 0.5872619419294411,
"repo_name": "niosus/EasyClangComplete",
"id": "b9cff1e9bcdd04313655cdf87e2611b003b4b041",
"size": "9... |
import atexit
from monopyly import *
from collections import Counter
import random
# keep a list of possible deals - reconstruct after each deal, auction, bankruptcy, etc. and at start of game
# keep a track of offers made and refused
# keep a track of the behaviour of other players
# offer different amounts of cas... | {
"content_hash": "9b0e2dc60cb97dfc0008ed02172c44c1",
"timestamp": "",
"source": "github",
"line_count": 573,
"max_line_length": 156,
"avg_line_length": 42.57242582897033,
"alnum_prop": 0.5897761744691318,
"repo_name": "richard-shepherd/monopyly",
"id": "67805f722ae326a5c7f4b72749c5c84711b10533",
"s... |
from __future__ import unicode_literals
import datetime
import pytz
import re
import sys
from .row import Row
__all__ = ['get_parser']
ERROR_VALUE = 99.99
ERROR_TOLERANCE = sys.float_info.epsilon
class Parser():
def __init__(self, f):
self._fobj = f
def get(self):
for line in self._fobj:
... | {
"content_hash": "e4868187ebf97969f8154ce6dde84da6",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 26.317073170731707,
"alnum_prop": 0.6167747914735866,
"repo_name": "sealevelresearch/tide-wrangler",
"id": "59fc41a0274e7b37af223534ff2ae2cacbcde111",
... |
from Pots import Pots
from Isdn import Isdn
from G3 import G3
| {
"content_hash": "6e74f1c03bd53dffb7553f8554c169ac",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 21,
"avg_line_length": 15.75,
"alnum_prop": 0.7936507936507936,
"repo_name": "philuu12/PYTHON_4_NTWK_ENGRS",
"id": "5392fbdac025d24130c2f047c432877ec78e3d6a",
"size": "63",
... |
from yamlize.attributes import Attribute, MapItem, KeyedListItem
from yamlize.yamlizing_error import YamlizingError
class AttributeCollection(object):
__slots__ = ('order', 'by_key', 'by_name')
def __init__(self, *args, **kwargs):
# let's assume the order things were defined is the order we want to
... | {
"content_hash": "9b633cab34b8876b84efa93edc63853b",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 93,
"avg_line_length": 32.984848484848484,
"alnum_prop": 0.5594855305466238,
"repo_name": "SimplyKnownAsG/yamlize",
"id": "a7c60f9d19bcbf37f540085f7e4f50d79486dbfe",
"size... |
"""A lightweight buffer for maintaining tensors."""
import tensorflow.compat.v1 as tf
class TensorBuffer(object):
"""A lightweight buffer for maintaining lists.
The TensorBuffer accumulates tensors of the given shape into a tensor (whose
rank is one more than that of the given shape) via calls to `append`. Th... | {
"content_hash": "3d7fdb666e2634a7bad1d06a547a50e3",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 80,
"avg_line_length": 35.440677966101696,
"alnum_prop": 0.6209947393591583,
"repo_name": "tensorflow/privacy",
"id": "c9558bcf8d40bfd412698b9f0c6b8162479a55af",
"size": "... |
from config import TRANSACTION_MODE
from exception import MonSQLException
from table import Table
from queryset import DataRow
import abc
class Database:
"""
Database wrapper for interaction with specific database
"""
def __init__(self, db, mode=TRANSACTION_MODE.DEFAULT):
self.__db = db
... | {
"content_hash": "aa6d2dad88e29a7ea63889d301340521",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 129,
"avg_line_length": 28.818181818181817,
"alnum_prop": 0.5860085359064762,
"repo_name": "firstprayer/monsql",
"id": "a6591450047da3ae9496076440a770bfcb7967b1",
"size": ... |
EVENT_TYPES_TO_LEVEL = {'success': 4, 'error': 2, 'warning': 3, 'information': 4}
# Audit success and audit failure events do not correspond to a specific level but can instead be queried
# by using specific keywords.
# https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.eventing.reader.standardeventkeyword... | {
"content_hash": "86f52d17d5b386c4e36f7ce765e43e43",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 124,
"avg_line_length": 74.66666666666667,
"alnum_prop": 0.765625,
"repo_name": "DataDog/integrations-core",
"id": "608862b9cecdf681a05701055470a9967111c3ce",
"size": "1147"... |
import re
import urlparse
import formencode
from formencode import htmlfill, validators
class BaseForm(formencode.Schema):
allow_extra_fields = True
filter_extra_fields = True
form_errors = {}
params = {}
#_xsrf = validators.PlainText(not_empty=True, max=32)
def __init__(self, handle... | {
"content_hash": "8cfefcf05e5ad56abea6b04e0d288a5a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 80,
"avg_line_length": 28.423076923076923,
"alnum_prop": 0.5453315290933695,
"repo_name": "feilaoda/FlickBoard",
"id": "cc9983294701e47b929eb57fe7dd6a3561de2a11",
"size": "... |
from typing import Union
from types import ModuleType
import mxnet as mx
from mxnet import nd, sym
from rl_coach.architectures.embedder_parameters import InputEmbedderParameters
from rl_coach.architectures.mxnet_components.embedders.embedder import InputEmbedder
from rl_coach.architectures.mxnet_components.layers impo... | {
"content_hash": "0d9064a7cbccc79050626964bd0f5557",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 119,
"avg_line_length": 38.80281690140845,
"alnum_prop": 0.6192377495462795,
"repo_name": "NervanaSystems/coach",
"id": "4a36357247a0e50173226a493336e13165a3d73a",
"size": ... |
from flask import Flask, render_template, request
import unirest
app = Flask(__name__)
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'GET':
return render_template('index.html')
elif request.method == 'POST':
response = unirest.post('https://github.com/login/oauth... | {
"content_hash": "ee9caff8eef274136ca4ccba927babb3",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 118,
"avg_line_length": 34.45454545454545,
"alnum_prop": 0.5329815303430079,
"repo_name": "gucheen/github-starring",
"id": "8721f6a468e60951903fc23a71a82e893378c3ee",
"size... |
from rest_framework import renderers
from rest_framework.parsers import BaseParser
from rest_framework.exceptions import ParseError
from django.conf import settings
from django.utils import six
import bson
class MongoJSONParser(BaseParser):
"""
Parses JSON-serialized data.
"""
media_type = 'applicati... | {
"content_hash": "05003e246321637610c9703dce95322b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.6798642533936652,
"repo_name": "martinrusev/amonone",
"id": "86ce2d4fa90ec10d0e95a37e6faf3a0dce0a7711",
"size": "... |
from __future__ import print_function, division
import argparse
import hashlib
import inspect
import os
import serial
import struct
import sys
import time
import base64
import zlib
import shlex
__version__ = "2.0.1"
MAX_UINT32 = 0xffffffff
MAX_UINT24 = 0xffffff
DEFAULT_TIMEOUT = 3 # timeout for most flash ope... | {
"content_hash": "8e97b6397b9b4125df70dd8f9ade89e6",
"timestamp": "",
"source": "github",
"line_count": 2394,
"max_line_length": 161,
"avg_line_length": 45.0187969924812,
"alnum_prop": 0.6440176293203433,
"repo_name": "husigeza/pycom-micropython-sigfox",
"id": "590b920fbda11ad3ffe861ce8946740dbc146f4... |
from pywikibot import family
from pywikibot.tools import deprecated
class Family(family.Family):
def __init__(self):
family.Family.__init__(self)
self.name = 'kontu'
self.langs = {
'fi': 'kontu.wiki',
# A list of valid language codes is needed for the
#... | {
"content_hash": "a80aa3ab2f000bbfbf007f567423c7c9",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 28.060606060606062,
"alnum_prop": 0.490280777537797,
"repo_name": "hperala/kontuwikibot",
"id": "f2104ea63e3c15626046468771bf830ba0e24738",
"size": "... |
from datetime import *
from flask.ext.restful import Resource, marshal, reqparse
from flask import request, abort, g, url_for
from ..services import user_papers
from ..core import auth
from ..helpers.linkheader import composeLinkHeader
from .fields import paper_fields, full_paper_fields
class PaperListAPI(Resource)... | {
"content_hash": "77c4788800f9dea847951e887479587f",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 99,
"avg_line_length": 33.940677966101696,
"alnum_prop": 0.5915106117353308,
"repo_name": "dedalusj/PaperChase",
"id": "c937d5fbde5ccf932b53340fc033583949f9c855",
"size": ... |
from __future__ import print_function
import contextlib
import time
import unittest
from astroid import builder
from astroid import nodes
from astroid import parse
from astroid import transforms
@contextlib.contextmanager
def add_transform(manager, node, transform, predicate=None):
manager.register_transform(no... | {
"content_hash": "9e3b21a412bcaa66fc39121f833d1d7e",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 77,
"avg_line_length": 34.3640350877193,
"alnum_prop": 0.585067007019783,
"repo_name": "lucidmotifs/auto-aoc",
"id": "b6b7c9d86d147b9a457f247aeb392881df575fbf",
"size": "8... |
"""Support for Arlo Alarm Control Panels."""
import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
PLATFORM_SCHEMA,
AlarmControlPanelEntity,
)
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
... | {
"content_hash": "70c30a8b9b0a86d26f7111c9edf03805",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 88,
"avg_line_length": 30.17721518987342,
"alnum_prop": 0.631501677852349,
"repo_name": "adrienbrault/home-assistant",
"id": "dd899cbd04ff279e67ed2fd06e4521b0cab04365",
"s... |
from __future__ import print_function
import re
import sys
import json
import errno
import select
import threading
import traceback
import multiprocessing
# Python 2/3 compatibility layer.
# Six is not available out of the box on GDB 7.4 so we roll our own.
if sys.version_info[0] == 3:
import socketserver
de... | {
"content_hash": "08d48aba168a7ff1b14d448e36244089",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 113,
"avg_line_length": 33.65395894428153,
"alnum_prop": 0.5588184036249564,
"repo_name": "detunized/Judas",
"id": "ac4b862e5d39a2db1fb549df9dc454e749134594",
"size": "114... |
from gchaos.config.datastore import CONFIG as DATASTORE_CONFIG
DATASTORE = 'datastore'
DEFAULT_CONFIG = {
DATASTORE: DATASTORE_CONFIG
}
__all__ = [DEFAULT_CONFIG]
| {
"content_hash": "c4328a7d9a7df20e5c37f27f0889ce52",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 15.636363636363637,
"alnum_prop": 0.7267441860465116,
"repo_name": "RealKinetic/gchaos",
"id": "a72352576d8b3271068c69b4d1149cd825cf08bd",
"size": "1... |
import collections
import json
import os
import sys
import hashlib
import logging
from .utils import cached_property, get_resource
from .graphics import Image
def load_json(filename):
try:
with open(filename, 'r') as fp:
result = json.load(fp)
if not isinstance(result, dict):
... | {
"content_hash": "86ce9d486109b4e530d89a49cabf2f88",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 125,
"avg_line_length": 29.231638418079097,
"alnum_prop": 0.5947042906841902,
"repo_name": "furbrain/tingbot-python",
"id": "c8cd0ca301fcc495d44e5f87e6900eb6cb14c9d9",
"si... |
"""
Views for managing Neutron Subnets.
"""
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from horizon.utils import memoized
from horizon import workflows
from openstack_dashboard import api
from openstack_... | {
"content_hash": "d47e881db48889bac0b69c463048becd",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 77,
"avg_line_length": 38.30434782608695,
"alnum_prop": 0.6131019944867845,
"repo_name": "coreycb/horizon",
"id": "4066e96673e29818bda14be8f2802a100ab09167",
"size": "6775... |
from growcut import growcut_python
from numba import autojit
benchmarks = (
("growcut_numba",
autojit(growcut_python.growcut_python)),
)
| {
"content_hash": "27bef9b7d4de1a4b651862c66c985f8e",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 45,
"avg_line_length": 18.5,
"alnum_prop": 0.722972972972973,
"repo_name": "numfocus/python-benchmarks",
"id": "31e9e1a295df5c8184ce463517222d3229503332",
"size": "148",
"... |
from __future__ import annotations
from typing import overload
import warnings
import numpy as np
from pandas._libs import (
iNaT,
lib,
missing as libmissing,
)
from pandas._typing import (
ArrayLike,
AstypeArg,
Dtype,
DtypeObj,
npt,
)
from pandas.compat.numpy import function as nv
fr... | {
"content_hash": "b9c9f6c09d7d6b96ef192b19a999a0cc",
"timestamp": "",
"source": "github",
"line_count": 587,
"max_line_length": 85,
"avg_line_length": 28.66609880749574,
"alnum_prop": 0.5931538598680691,
"repo_name": "dsm054/pandas",
"id": "e62a2f95b0340264142d9f2f58a03d3d9506656c",
"size": "16827"... |
'''Public section, including homepage and signup.'''
import time
import datetime
import urllib2
import json
from flask import (
render_template, jsonify, current_app, send_from_directory, request
)
from purchasing.extensions import cache
from purchasing.users.models import User
from purchasing.public.models impor... | {
"content_hash": "22d9c4d65eb297b8709b1fdf0c801730",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 107,
"avg_line_length": 32.123456790123456,
"alnum_prop": 0.617217524980784,
"repo_name": "CityofPittsburgh/pittsburgh-purchasing-suite",
"id": "51d9a04a517fd4175c828735f566d... |
my_name = "Josh Nemmers"
print "Let's talk about %s" % my_name
my_age = 16
print "I am %d years old" % my_age
| {
"content_hash": "90af8d751354aedfe5c1051726f8bb28",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 37,
"avg_line_length": 22.2,
"alnum_prop": 0.6396396396396397,
"repo_name": "chrisortman/CIS-121",
"id": "3f5aeff31d85e1deffb79edcecce983c202db463",
"size": "111",
"binary... |
from flask.ext.wtf import Form
from wtforms import IntegerField, StringField, validators, FileField, BooleanField, SelectField
from .models import Team
class TeamForm(Form):
number = IntegerField("Number", [validators.DataRequired(),
validators.NumberRange(min=1, max=99999)])
... | {
"content_hash": "fc4ff77703ce066956a7c9e39850d03f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 133,
"avg_line_length": 37.513513513513516,
"alnum_prop": 0.6347262247838616,
"repo_name": "rtfoley/scorepy",
"id": "27cf5f5faee9cb22cdaa7dc19dfa1701f231ec74",
"size": "138... |
from module import Module
from PyQt5 import QtWidgets, QtGui
class SubMod0(Module):
#Constructor
def __init__(self, frame):
Module.__init__(self, frame, 'submod0')
self.label = QtWidgets.QLabel()
#self.label.setGeometry(10,10,100,200)
grid = QtWidgets.QGridLayout()
self.setLayout(grid)
grid.addWidget(s... | {
"content_hash": "51b00105d9d12885432ae726ec86d3c6",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 45,
"avg_line_length": 25.454545454545453,
"alnum_prop": 0.7178571428571429,
"repo_name": "Saucyz/explode",
"id": "93ab5ff994155c253dfca8002944bb54e55c97a7",
"size": "560",... |
from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class ShopifyAccount(ProviderAccount):
pass
class ShopifyProvider(OAuth2Provider):
id = 'shopify'
name = 'Shopify'
a... | {
"content_hash": "27c29b0a5c51cafac62c98d7031168b8",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 29.485714285714284,
"alnum_prop": 0.6792635658914729,
"repo_name": "wli/django-allauth",
"id": "6d4999a3901ef3a5be82b95c4d561a1e4733f9bb",
"size": "1... |
"""Setup file for data structures/ linkedlist file."""
from setuptools import setup
setup(
name="linked_list",
description="A project to create and instantiate linked lists.",
version=0.1,
author="Reggie & Rachael",
author_email="rachael.wisecarver@gmail.com",
license="MIT",
py_modules=['... | {
"content_hash": "438e06476618b3b42778e6bf39a1f384",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 26.454545454545453,
"alnum_prop": 0.5979381443298969,
"repo_name": "rwisecar/data-structures",
"id": "129a616a3ac5be67b1af37235d5750da06f3b776",
"siz... |
import numpy
import logging
import pprint
import operator
import itertools
import theano
import theano.tensor as TT
from theano import pp
from theano.ifelse import ifelse
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from groundhog.layers import\
Layer,\
MultiLayer,\
So... | {
"content_hash": "b84b6bd187ccf951a8642c48d8d607f7",
"timestamp": "",
"source": "github",
"line_count": 1544,
"max_line_length": 120,
"avg_line_length": 39.88665803108808,
"alnum_prop": 0.5460745311358285,
"repo_name": "sjtufs/GroundHog",
"id": "076386baa4d6bb036f4a86745bf7a6aca03525d5",
"size": "6... |
'''
Select values of dict of a numpy arrays, shape (1,) only based on a range
(python tuple), range is inclusive (excluding is open).
Usage:
dictrestrict.py [options] <input> <var> <range>
Options:
--output=OUTPUT -o OUTPUT Output to OUTPUT instead of stdout.
--exclude -x Exclude range instea... | {
"content_hash": "324998c985accb6bb45e268ba101e290",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 73,
"avg_line_length": 25.38235294117647,
"alnum_prop": 0.6060254924681344,
"repo_name": "noobermin/lspreader",
"id": "52cbbc7577b46c0ccf3ff36081f77c578649b3cd",
"size": "8... |
import sys
import urllib
import urllib2
from lxml import html
import os
import glob
from pyquery import PyQuery
from hurry.filesize import size
reload(sys)
sys.setdefaultencoding("utf-8")
fileYml = '../_data/library.yml'
fileDir = '../assets/pdf/library/'
url = 'http://www.the-blockchain.com/docs/'
listUrl = url + 'i... | {
"content_hash": "bf62ca2dd9d2ac50f665c694f0a58b61",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 89,
"avg_line_length": 29.055555555555557,
"alnum_prop": 0.5769598470363289,
"repo_name": "sunnankar/wucorg",
"id": "55920d2d63b11c24206e833880ad6a982f6a0c19",
"size": "257... |
from functools import reduce
def factorial(x):
try:
result = reduce(lambda i, j: i*j, range(1,x+1))
return result
except (RuntimeError, TypeError, NameError):
return 0
def gamma(x):
return factorial(x-1)
| {
"content_hash": "5fc2b6ad7d0c24a29691ebeb4f5c800e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 19.545454545454547,
"alnum_prop": 0.7069767441860465,
"repo_name": "peterhogan/python",
"id": "79ac4209b4e2904e1a6d729b44ab3f838a684ed7",
"size": "21... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='FeedDownloaded',
fields=[
('id', models.AutoField(verbose_name='ID', se... | {
"content_hash": "465044d18998de3d7fdb44c2524fc9dc",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 114,
"avg_line_length": 29.24,
"alnum_prop": 0.5567715458276333,
"repo_name": "MiiRaGe/miilibrary",
"id": "861a45ec65c37c8c7c8e95882bd19cf91c169ea4",
"size": "755",
"bina... |
"""
APIs for extending the python social auth pipeline
"""
import logging
from django.shortcuts import redirect
from django_redis import get_redis_connection
from rolepermissions.checkers import has_role
from social_core.exceptions import AuthException, AuthFailed
from backends.base import BaseEdxOAuth2
from backends... | {
"content_hash": "5cb6bac61be32c9fcf6f3e289eef53b1",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 118,
"avg_line_length": 34.74251497005988,
"alnum_prop": 0.6849362288865908,
"repo_name": "mitodl/micromasters",
"id": "601f1b2ff7f34da767460c7b10d049f92ba42e89",
"size": ... |
from multiprocessing import Pool
import numpy as np, pandas as pd
import os
import pandas as pd
# Set defaults
dataDir = '/afs/cbs.mpg.de/projects/mar005_lsd-lemon-surf/probands'
fsDir = '/afs/cbs.mpg.de/projects/mar004_lsd-lemon-preproc/freesurfer'
subjects_file = '/scr/liberia1/data/individual_dist_label/subjects_re... | {
"content_hash": "c27f5cf4c45818684e19cbca91c860df",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 185,
"avg_line_length": 44.95744680851064,
"alnum_prop": 0.5512811845040904,
"repo_name": "soligschlager/topography",
"id": "5831299dfbd14c90d0fc81e6a561bd407c95acda",
"si... |
"""Generate test data
Generate data needed for unit tests, i.e. certificates, keys, and CRLSet.
"""
import argparse
import subprocess
import sys
from datetime import datetime, timedelta
from typing import List, Tuple
from cryptography import x509
from cryptography.hazmat.primitives import hashes
from cryptography.ha... | {
"content_hash": "1511b44a7a7e47d18d74ede44a405c32",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 80,
"avg_line_length": 32.756554307116104,
"alnum_prop": 0.616624742739538,
"repo_name": "google/pigweed",
"id": "ba609096f72c1e86a6c26103be4cd391f4d33820",
"size": "9330"... |
import os
import sys
if __name__ == "__main__":
if os.environ.get('DJANGO_SETTINGS_MODULE'):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", os.environ.get('DJANGO_SETTINGS_MODULE'))
else:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", 'imgret.settings')
from django.core.management import ... | {
"content_hash": "ed3395c0cde3a54e7edb9bcb99a83511",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 97,
"avg_line_length": 38.6,
"alnum_prop": 0.6994818652849741,
"repo_name": "internetmosquito/django-celery-task-scheduler",
"id": "ee54d1b981ed832a72db51ee30f2a6261c34d131",... |
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
import setup as _setup
import datetime as dt
# Mock out certain modules while building documentation
class Mock(object):
__all__ = []
def __init__(self, *args, **kw):
... | {
"content_hash": "c8d252e3138369773c0538ddb54983f2",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 91,
"avg_line_length": 27.446927374301676,
"alnum_prop": 0.5800936291471606,
"repo_name": "tfroehlich82/picamera",
"id": "10599e1223709381215d54ce78466e6ab0b4fb52",
"size"... |
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import mysql.connector
import math
import matplotlib.pyplot as plt
import matplotlib.colors
import matplotlib.cm as cm
from matplotlib import dates
import calendar
#database connection
cnx = ... | {
"content_hash": "45d47f139a8c970653bc1c60a0b72698",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 140,
"avg_line_length": 29.71657754010695,
"alnum_prop": 0.6841821126507108,
"repo_name": "annahs/atmos_research",
"id": "2b099c611f475dd44ad65fd44e579f78f4bd9fff",
"size"... |
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
from suas import session, auth_handlers
HOME_VIEW = template.Template("""
<head><title>Home</title></head>
<body>
<h3>Demo app for <a href="http://github.com/aht/suas/">suas</a></h3>
... | {
"content_hash": "a8dc5a62ee36f5e84334c007a2ae5df8",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 24.46153846153846,
"alnum_prop": 0.6572327044025157,
"repo_name": "aht/suas",
"id": "73c7f98b1b04c6df28b3d98c0e2dc3b8ce819de5",
"size": "1004",
"bi... |
"""Base classes for our unit tests.
Allows overriding of CONF for use of fakes, and some black magic for
inline callbacks.
"""
import copy
import logging
import os
import uuid
import fixtures
import mock
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_config import fixture as config_fix... | {
"content_hash": "c5b96772070d5d1ca682bed44f1450b0",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 80,
"avg_line_length": 36.712158808933005,
"alnum_prop": 0.5877661372085163,
"repo_name": "Nexenta/cinder",
"id": "a9faef66faac6e2665a13f7bb6782d2fb9cd012f",
"size": "1552... |
import RPi.GPIO as GPIO
import time
from threading import Thread
from buzzerJukeBox import BuzzerJukeBox
_ledPins = [18, 23, 24]
_buttonPin = 25
_buzzerPin = 22
_cleaned = False
_jukeBox = BuzzerJukeBox(_buzzerPin)
_holdOffThread = None
_holdOffPeriodSecs = 15
def holdOffTimer():
print("Hold off begun")
time.... | {
"content_hash": "823b2236d785796b893b8aa063b90ea1",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 98,
"avg_line_length": 24.53846153846154,
"alnum_prop": 0.6355799373040752,
"repo_name": "tomntech/BigRedButton",
"id": "e3425da5ec7a8e7bdcb8e18dc9c7d10c0b22a437",
"size":... |
import pytest
from pgcli.packages.parseutils import (
is_destructive,
parse_destructive_warning,
BASE_KEYWORDS,
ALL_KEYWORDS,
)
from pgcli.packages.parseutils.tables import extract_tables
from pgcli.packages.parseutils.utils import find_prev_keyword, is_open_quote
def test_empty_string():
tables =... | {
"content_hash": "9b0b0710a1b436b7c446f91b0866b043",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 86,
"avg_line_length": 32.061290322580646,
"alnum_prop": 0.5940235436160579,
"repo_name": "dbcli/pgcli",
"id": "349cbd021af4a25e7ef26d35f23c34587cae3005",
"size": "9939",
... |
import mock
import netaddr
from oslo_config import cfg
import webob
from jacket.api.compute.openstack.compute import floating_ips_bulk \
as fipbulk_v21
from jacket.api.compute.openstack.compute.legacy_v2.contrib import floating_ips_bulk \
as fipbulk_v2
from jacket import context
from jacket.compute imp... | {
"content_hash": "c8e94cb094c4c810b671bb149d896068",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 86,
"avg_line_length": 37.22171945701358,
"alnum_prop": 0.5962800875273523,
"repo_name": "HybridF5/jacket",
"id": "50d1a366724bb8397facb237e85722e22be45d7c",
"size": "8828... |
from typing import Callable, Optional, Sequence, Tuple, Union
import equinox.internal as eqxi
import jax
import jax.numpy as jnp
from ..custom_types import Array, Int, PyTree, Scalar
from ..solution import RESULTS
from ..term import AbstractTerm
from .base import AbstractStepSizeController
class ConstantStepSize(Ab... | {
"content_hash": "220458854ee6575b4644593d63d4e74e",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 87,
"avg_line_length": 32.9171974522293,
"alnum_prop": 0.5789473684210527,
"repo_name": "patrick-kidger/diffrax",
"id": "7eaf5605c593cef35f65bcd4a911e573e51aa415",
"size":... |
from flask_wtf import Form
from wtforms.validators import DataRequired
from wtforms import TextAreaField, IntegerField
from wtforms.validators import DataRequired, NumberRange
class WorkReviewForm(Form):
score = IntegerField('Score',validators=[DataRequired(), NumberRange(min=0, max=100)])
comment = TextAreaFi... | {
"content_hash": "ee743bf9495a9b627f00da9f530c1225",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 90,
"avg_line_length": 35.72222222222222,
"alnum_prop": 0.6936236391912908,
"repo_name": "B-O-P/innovator",
"id": "5c338bf91ac8e5161b299910dde89cca99d43c69",
"size": "667",... |
r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.
If all you want is a unique ID, you should probably call uuid1() ... | {
"content_hash": "f6f8defbd531c7e437d90358ca9f23ba",
"timestamp": "",
"source": "github",
"line_count": 634,
"max_line_length": 78,
"avg_line_length": 38.782334384858046,
"alnum_prop": 0.587156336424272,
"repo_name": "andela-earinde/bellatrix-py",
"id": "4a64801d0f7893cbcbac8cbc3086c7b4c68b3b47",
"... |
import sys, os, re, platform
from os.path import exists, abspath, dirname, join, isdir
try:
# Allow use of setuptools so eggs can be built.
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
from distutils.extension import Extension
from distutils.errors im... | {
"content_hash": "8e8e0defcf4f13bcc14c831c4c7060ab",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 119,
"avg_line_length": 34.496753246753244,
"alnum_prop": 0.5899294117647059,
"repo_name": "Bjwebb/pyodbc",
"id": "e5dd1643861454f214a05571f7ddba4def41e32d",
"size": "1064... |
__author__ = 'Eric'
#SEE LICENSE.txt for this program's licensing
import subprocess
import os
import main_html
#main method of class
#PARAM -- path, which is the current path that will be passed into the html injector,
# --- along with the path/directory to look for additional subdirectories to inject into
#RE... | {
"content_hash": "492fe4442b9cf0811aa2d3eff9268503",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 99,
"avg_line_length": 28.955555555555556,
"alnum_prop": 0.6884113584036838,
"repo_name": "albmin/html_injector",
"id": "732c96e9465e639bd93f8104e859178398b3ff84",
"size": ... |
from django import template
from django.urls import reverse
from oauth.oauthmanager import get_oauth_apps
register = template.Library()
@register.inclusion_tag('oauth/oauth_applications.html')
def load_oauth_applications(request):
applications = get_oauth_apps()
if applications:
baseurl = reverse('o... | {
"content_hash": "b1bce27fd008bb066148cf11f8ea2d03",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 95,
"avg_line_length": 28.045454545454547,
"alnum_prop": 0.6596434359805511,
"repo_name": "liangliangyy/DjangoBlog",
"id": "7b687d5892fa97c8f0467a8ad68342b60a9d8063",
"size... |
"""
uploadComp.py is uploads the results of cross_graphs.py
Ussage:
uploadComp.py url filename
where url is the instance of inspectra to upload to and filename is the path to the comp to upload.
"""
import sys
import os
import httplib
import urllib
import urlparse
import exceptions
import socket
supporttls = True
t... | {
"content_hash": "3706551611c377861a0f21a0bc2a8801",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 118,
"avg_line_length": 32.82786885245902,
"alnum_prop": 0.6184769038701623,
"repo_name": "cancerregulome/inspectra",
"id": "17f2c8aeeaf1acfeef8cc50d2513947c59b7ac17",
"si... |
import os
#DEBUG = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'intertrace', ... | {
"content_hash": "dbe383cfb1a9968884ceae2ed0c7eb33",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 127,
"avg_line_length": 33.11464968152866,
"alnum_prop": 0.6868628582419696,
"repo_name": "INRIA/intertrace",
"id": "0c422c23797f5349d5776eac60cffa3c6603279c",
"size": "52... |
raise NotImplementedError("tty is not yet implemented in Skulpt")
| {
"content_hash": "d32a9f056f72465061cf4778d3aa2153",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 65,
"avg_line_length": 66,
"alnum_prop": 0.8181818181818182,
"repo_name": "ArcherSys/ArcherSys",
"id": "86b30a795fc232874f1027986324aacc17ee0e0c",
"size": "66",
"binary": ... |
__all__ = ['startClient', 'startServer']
from twisted.internet import reactor
import autobahn
from autobahn.websocket import connectWS, listenWS
from autobahn.websocket import WebSocketProtocol
from autobahn.websocket import WebSocketClientFactory, \
WebSocketClientProto... | {
"content_hash": "095da86c1cc91b0022a4c1b08f7cb541",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 157,
"avg_line_length": 33.18604651162791,
"alnum_prop": 0.6743167484232656,
"repo_name": "normanmaurer/autobahntestsuite-maven-plugin",
"id": "12534115e59acd2c3f232641a161f... |
from twilio import IpMessagingGrant
endpoint = 'https://some.endpoint'
service_sid = 'ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ipm_grant = IpMessagingGrant(
endpoint_id=endpoint,
service_sid=service_sid,
push_credential_sid='CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
)
| {
"content_hash": "249fc8bbfa9e98edfc290d934243f037",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 27.2,
"alnum_prop": 0.7867647058823529,
"repo_name": "teoreteetik/api-snippets",
"id": "fbd37cb7f0655c8ef83f4937af216744af7f363d",
"size": "272",
"... |
import urwid
class FancyListBox(urwid.LineBox):
def get_listbox(self, items):
class _FancyListBox(urwid.ListBox):
def keypress(_self, size, key):
key = super(_FancyListBox, _self).keypress(size, key)
self.update_corners(_self.ends_visible(size))
... | {
"content_hash": "1187b2cea9f4a881e202c69f71925d51",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 82,
"avg_line_length": 30.934782608695652,
"alnum_prop": 0.5351370344342937,
"repo_name": "dustinlacewell/console",
"id": "6d74f3e3de16e80cc4bc07bdd9ae33192142f619",
"size"... |
from collections import Counter
__author__ = "LaughDonor"
#Get the Counter of all letters, then get the counter of how many times they appear based on odd/even.
#If any odd values appear more than once, then it can't be a palindrome
print ["YES", "NO"][Counter(i % 2 for i in Counter(raw_input()).values())[1] > 1] | {
"content_hash": "fa56d8316187042dc63c9f2a2fec3c40",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 102,
"avg_line_length": 62.8,
"alnum_prop": 0.7229299363057324,
"repo_name": "LaughDonor/hackerrank",
"id": "aa3cfb4d756fcfe4dc654d0a919f14e849e2b3f8",
"size": "314",
"bin... |
"""
Example experiment. Train HMMs with PC 1 to 8, k=3..20.
"""
from judgmentHMM import Experiment
arg = {"ratedTurns":'../data/complete_april_2014.csv',
"validationMethod":"lolo",
"quantizationLevel":"parameters"}
models = {"hmm_multi":{}}
args = list()
for k in xrange(3,21):
for total in xrange(2... | {
"content_hash": "fc692aaff4a6e8bb7689b8bb8dc0005d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 56,
"avg_line_length": 24.96,
"alnum_prop": 0.592948717948718,
"repo_name": "phihes/judgmentHMM",
"id": "b89b00807a430b36f7ae7b55f5a7e14f8c23042c",
"size": "648",
"binary... |
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.preprocessing import MultiLabelBinarizer
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import LinearSVC
from sklearn.svm import SVC
import numpy
CVectorizer = Coun... | {
"content_hash": "6124b2ef2455fd3a8ed9ed4159586eb3",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 91,
"avg_line_length": 28.365853658536587,
"alnum_prop": 0.7162510748065348,
"repo_name": "rahulsrma26/code-gems",
"id": "8c27655a263e3b2870a6daea31077abfd28b26cb",
"size":... |
import dateutil.relativedelta
from django.utils import timezone
import mock
from nose.tools import * # noqa:
import pytest
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from api_tests.nodes.views.test_node_draft_registration_list import DraftRegistrationTestCase
from api_tests.subjects... | {
"content_hash": "d8cb024904a34449e299733488cadafb",
"timestamp": "",
"source": "github",
"line_count": 1413,
"max_line_length": 200,
"avg_line_length": 39.174097664543524,
"alnum_prop": 0.5753437031416545,
"repo_name": "mattclark/osf.io",
"id": "05f7dc777c1a2d3a540987f58ae87ebc3ee8aac8",
"size": "... |
"""Package contenant les actions.
Du point de vue du codeur, une action est une classe héritée de Action.
Chaque action se trouve séparée dans un nom de fichier .py qui est le nom de
l'action. Par exemple, 'donner_xp.py' contiendra l'action donner_xp.
Toutes les classes héritées d'Action doivent avoir pour nom
Classe... | {
"content_hash": "541fdc84cb6260e79503957a3590d6f7",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 76,
"avg_line_length": 30.363636363636363,
"alnum_prop": 0.7664670658682635,
"repo_name": "stormi/tsunami",
"id": "0b525336d94bff85d91e57e94ec817e8ff20de39",
"size": "1905"... |
import pymysql as sql
con = sql.connect('mysqltest.cyzy5ereqqzd.us-east-1.rds.amazonaws.com', user, password, port=3306)
| {
"content_hash": "3569d6715c92d9c793899031201e7454",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 98,
"avg_line_length": 40.666666666666664,
"alnum_prop": 0.7704918032786885,
"repo_name": "marcoikeda/etl_ga",
"id": "69cf994d5fdb27623f3750e1868b851038de71a1",
"size": "164... |
import os
import channels.asgi
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "stormtrooper.settings")
channel_layer = channels.asgi.get_channel_layer()
| {
"content_hash": "1482605ba284645ba00172077b7e8ddb",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 72,
"avg_line_length": 26,
"alnum_prop": 0.7948717948717948,
"repo_name": "CompileInc/stormtrooper",
"id": "586e368c0db42ca5ec5a6c1885622763801630e6",
"size": "156",
"bina... |
from django import forms
from djblets.auth.forms import RegistrationForm as DjbletsRegistrationForm
from djblets.recaptcha.mixins import RecaptchaFormMixin
from djblets.siteconfig.models import SiteConfiguration
from reviewboard.accounts.mixins import PolicyConsentFormMixin
class RegistrationForm(RecaptchaFormMixin,... | {
"content_hash": "913f093299db01e603aab510036700c2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 33.1025641025641,
"alnum_prop": 0.7095274980635167,
"repo_name": "reviewboard/reviewboard",
"id": "21d5004e3a9a6fc6728376ff9e2895cb2a996b80",
"size":... |
import os
from datetime import datetime
import flask
from flask import Flask,render_template,request, redirect, flash, session,url_for,send_from_directory, Response
from dbfunctions import AuthDatabase
app = Flask(__name__)
database = AuthDatabase('exel.db')
app.secret_key = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
@app... | {
"content_hash": "27e09050cf15d80d87528177a2f0194e",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 111,
"avg_line_length": 21.71641791044776,
"alnum_prop": 0.7243986254295532,
"repo_name": "anthonyc1/excelsior-hack",
"id": "fbc5740062814c33d97dea9232b678fe4361aa95",
"siz... |
import re
total = 0
reVowels = r'[aeiou]'
vowelCount = 3
reDoubleLetters = r'.*([a-z])\1.*'
reBadStrings = r'(ab|cd|pq|xy)'
doubleLetters = re.compile(reDoubleLetters)
with open('../inputs/05.txt') as f:
for line in f:
vowels = re.findall(reVowels, line)
if len(vowels) < vowelCount:
continue... | {
"content_hash": "476edd748363ba45c3331ae350daea7b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 49,
"avg_line_length": 18.88888888888889,
"alnum_prop": 0.615686274509804,
"repo_name": "opello/adventofcode",
"id": "f103175e0ffaf64a7639577ef05194558ff38c4d",
"size": "53... |
"""
rna
Contains extensions to the blender data model
"""
import bpy
_edm_matTypes = (
("def_material", "Default", "Default"),
("glass_material","Glass", "Glass"),
("self_illum_material","Self-illuminated", "Self-illuminated"),
("transparent_self_illum_material","Transparent Self-illuminated", "Transparent... | {
"content_hash": "45165549e2f64d6afac808fa98b16ac7",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 133,
"avg_line_length": 37.567796610169495,
"alnum_prop": 0.7029099932325739,
"repo_name": "ndevenish/Blender_ioEDM",
"id": "10894c75bf66ee47fe332abb89ece66e3e5a4d3e",
"si... |
"""
Unified object oriented interface for interacting with file system objects.
File system operations in python are distributed across modules: os, os.path,
fnamtch, shutil and distutils. This module attempts to make the right choices
for common operations to provide a single interface.
"""
import codecs
from datetim... | {
"content_hash": "96203e71d637f456bec4ee760405370c",
"timestamp": "",
"source": "github",
"line_count": 652,
"max_line_length": 81,
"avg_line_length": 29.271472392638035,
"alnum_prop": 0.5611212994498297,
"repo_name": "laurentb/fswrap",
"id": "a1254f35ecabee23188a1610ec608295a6652b35",
"size": "191... |
from smart_server.smart.utils.startup import check_environment
import os
# check_environment()
| {
"content_hash": "b9a3ce9a5a5c6514d89658bb35cf1ac8",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 62,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.8210526315789474,
"repo_name": "smart-classic/smart_server",
"id": "6510416a175b928f2d0b37920ea60b0ca2b09b0a",
"si... |
"""
The system for scheduling tasks and executing them in order.
Deals with dependencies, priorities, resources, etc.
The :py:class:`~luigi.worker.Worker` pulls tasks from the scheduler (usually over the REST interface) and executes them.
See :doc:`/central_scheduler` for more info.
"""
import collections
try:
imp... | {
"content_hash": "86871365cda43aaa763c46a6e3358d5f",
"timestamp": "",
"source": "github",
"line_count": 983,
"max_line_length": 149,
"avg_line_length": 40.28891149542218,
"alnum_prop": 0.5906726593273407,
"repo_name": "laserson/luigi",
"id": "bbd00efa6a01e9b66c8d1c500a11d99f948c447c",
"size": "4020... |
"""Test hassbian config."""
import asyncio
import os
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.components.config.hassbian import (
HassbianSuitesView, HassbianSuiteInstallView)
def test_setup_check_env_... | {
"content_hash": "b43123a842149a2f96b7682dccf90699",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 77,
"avg_line_length": 39.279411764705884,
"alnum_prop": 0.6712841632347435,
"repo_name": "persandstrom/home-assistant",
"id": "85fbf0c2e5a899875326d714c12a04d8f54c2d53",
"... |
from ....testing import assert_equal
from ..utils import MRIsCalc
def test_MRIsCalc_inputs():
input_map = dict(action=dict(argstr='%s',
mandatory=True,
position=-2,
),
args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
... | {
"content_hash": "f4da256ae42ee3c05eb72b4244278f9c",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 24.363636363636363,
"alnum_prop": 0.5917910447761194,
"repo_name": "carolFrohlich/nipype",
"id": "d7160510a73a28f4cecd414c00e289efa8c8fd54",
"size": ... |
__author__ = 'PAY.ON'
from . import abstract_payments_test_case | {
"content_hash": "4e220369d0a89f666ceaabd277013da3",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 41,
"avg_line_length": 31.5,
"alnum_prop": 0.7142857142857143,
"repo_name": "OpenPaymentPlatform/python",
"id": "d1189b4daf8fba9b27922642c2c35864c40d27ec",
"size": "63",
"... |
from string import Template
from datetime import date
grumpycoinDir = "./";
inFile = grumpycoinDir+"/share/qt/Info.plist"
outFile = "GrumpyCoin-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = grumpycoinDir+"grumpycoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = li... | {
"content_hash": "f0b267aa600bfde2ad51582889664a80",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.791666666666668,
"alnum_prop": 0.7166416791604198,
"repo_name": "grumpycoin/grumpycoin-v.1.2",
"id": "06d905fbec706e1f6ba21d3dc31e8b00163c5e9d",
"... |
from django.test import TestCase
class webeditTest(TestCase):
"""
Tests for django-webedit
"""
def test_webedit(self):
pass | {
"content_hash": "cc631d2abcc92b57805645d2571fbddb",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 32,
"avg_line_length": 16.555555555555557,
"alnum_prop": 0.6375838926174496,
"repo_name": "callowayproject/django-webedit",
"id": "b333d5196a9b5ba33f4a54639af120dad7cc30a2",
... |
"""The command group for the RuntimeConfig CLI."""
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA)
class RuntimeConfig(base.Group):
"""Manage runtime configuration resources."""
| {
"content_hash": "ad0ad2888eea317448f815e9179a791a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 27.625,
"alnum_prop": 0.7828054298642534,
"repo_name": "KaranToor/MA450",
"id": "9221ede20ddee3d1a1a70de40e79bad4c62b850c",
"size": "817",
"binary":... |
from office365.entity import Entity
class DirectoryAudit(Entity):
"""Represents the directory audit items and its collection."""
pass
| {
"content_hash": "26370d286b4847fe36badfd2687d0764",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 24,
"alnum_prop": 0.75,
"repo_name": "vgrem/Office365-REST-Python-Client",
"id": "309097984b7b1099204ad33d92516403d514dc68",
"size": "144",
"binary"... |
from devinclude import *
# from bustime.models import *
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from twisted.internet.endpoints import serverFromString
from autobahn.wamp import types
from autobahn.twisted import wamp, websocket
import zmq
import zerorpc
PORT = 9002
RC... | {
"content_hash": "5dac81d413c1ea80a92876661182b90a",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 78,
"avg_line_length": 26.943181818181817,
"alnum_prop": 0.6296921130324757,
"repo_name": "norn/bustime",
"id": "709c5ae89e07d80580621d698f0dc1da98888d67",
"size": "2417",
... |
import asyncio
import socket
import threading
import typing
from asyncpg import cluster
class StopServer(Exception):
pass
class TCPFuzzingProxy:
def __init__(self, *, listening_addr: str='127.0.0.1',
listening_port: typing.Optional[int]=None,
backend_host: str, backend_por... | {
"content_hash": "921dc3a1e2fe6aa9113c42078d18ef27",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 75,
"avg_line_length": 32.070234113712374,
"alnum_prop": 0.5471894879549484,
"repo_name": "MagicStack/asyncpg",
"id": "887456462fffd0dd028dd54335c9964ac319683c",
"size": "... |
from .prod import *
from ._admin import *
| {
"content_hash": "bd574d03f92a94d9144cdd4b436ba20c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 21,
"avg_line_length": 21,
"alnum_prop": 0.6904761904761905,
"repo_name": "sunForest/AviPost",
"id": "6184fcb15e7959d8294566eb0b65f8877451858e",
"size": "42",
"binary": fa... |
''' main '''
import argparse
import json
import logging
import os
import pkgutil
import re
import sys
import time
import uuid
from httplib import HTTPConnection
from ..common import status
from heron.common.src.python.utils import log
# The location of default configure file
DEFAULT_TEST_CONF_FILE = "integration_test... | {
"content_hash": "0d18d20e11e16b129f439716aad7698f",
"timestamp": "",
"source": "github",
"line_count": 435,
"max_line_length": 99,
"avg_line_length": 44.53793103448276,
"alnum_prop": 0.6770930112521937,
"repo_name": "ashvina/heron",
"id": "f5d4d1cad10d4cf3ddd0aa179fc1ab3f4ac4de0b",
"size": "19374"... |
"""
NFINDR function
"""
import math
import random
import numpy as np
import scipy as sp
from . import eea
def NFINDR(data, q, transform=None, maxit=None, ATGP_init=False):
"""
N-FINDR endmembers induction algorithm.
Parameters:
data: `numpy array`
Column data matri... | {
"content_hash": "536b1fd366bbcb1413aded98e471bde7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 30.941176470588236,
"alnum_prop": 0.5541825095057035,
"repo_name": "ctherien/pysptools",
"id": "2cafdf288548f6a8b8a9e7a04145c453d3e28993",
"size": "... |
from project.models.fields.Field import Field
from project.models.fields.exceptions import FieldValidException
MESSAGE_MIN_LENGTH = 0
MESSAGE_MAX_LENGTH = 10000
class MessageField(Field):
def __init__(self, message):
self.set(message)
def set(self, message):
if not isinstance(message, str):
... | {
"content_hash": "b517729f717bbaeba61bd5277607ab15",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 108,
"avg_line_length": 32.857142857142854,
"alnum_prop": 0.6666666666666666,
"repo_name": "AbramovVitaliy/Abramov-RIS-13",
"id": "5780223f015aa093acc0f661a872620074a446d5",
... |
"""Generates default implementations of operator<< for enum types."""
import codecs
import os
import re
import string
import sys
_ENUM_START_RE = re.compile(r'\benum\b\s+(class\s+)?(\S+)\s+:?.*\{(\s+// private)?')
_ENUM_VALUE_RE = re.compile(r'([A-Za-z0-9_]+)(.*)')
_ENUM_END_RE = re.compile(r'^\s*\};$')
_ENUMS = {}
... | {
"content_hash": "5894e154ac46e21a4585b2c57fc5c991",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 91,
"avg_line_length": 29.277173913043477,
"alnum_prop": 0.5832559866344904,
"repo_name": "treadstoneproject/artinst",
"id": "f666ad154b592ed0ab757ea7435a3297efcdd2d5",
"s... |
def extractFalinmer(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
match = re.search('(\\d+)\\-(\\d+)', item['title'])
if not vol and match:
vol = match.group(1)
chp = match.group(2)
if... | {
"content_hash": "5ff4ee0a2b637fb165ad3013fd557c19",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 102,
"avg_line_length": 37,
"alnum_prop": 0.6718146718146718,
"repo_name": "fake-name/ReadableWebProxy",
"id": "0b5c1187b2fc2b7ba2dffac7c726b303d0478940",
"size": "518",
... |
'''
Copyright (c) 2009, Patrick Maupin, Austin, Texas
A wrapper around subprocess that performs two functions:
1) Adds non-blocking I/O
2) Adds process killability and timeouts
Currently only works under Linux.
'''
import sys
import subprocess
import select
import os
import time
import textwrap
from signal impo... | {
"content_hash": "34aaa918b1732fced97506d5d15b7ae1",
"timestamp": "",
"source": "github",
"line_count": 380,
"max_line_length": 81,
"avg_line_length": 32.286842105263155,
"alnum_prop": 0.5513896813106203,
"repo_name": "lamby/pkg-rst2pdf",
"id": "5fc863061f415958a8abb00c21038ae785eee788",
"size": "1... |
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
def set_next(self, next):
self.next = next
def return_next(self):
return self.next
def set_data(self, data):
self.data = data
def return_data(self):
return self.data
... | {
"content_hash": "ffe63856ff8bcf94e68fda7b67da2700",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 58,
"avg_line_length": 27.282608695652176,
"alnum_prop": 0.48167330677290837,
"repo_name": "miki4920/Python-Projects",
"id": "1439a50db722c505d8861ec6d835ade9afd7e54f",
"si... |
"""MPSSE.py: A python wrapper for the FTDI-provided libMPSSE DLL (I2C only)
__author__ = "Jason M. Battle"
"""
import ctypes
from collections import OrderedDict
dll_loc = r'C:\Python27\Lib\site-packages\libMPSSE.dll'
try:
dll = ctypes.CDLL(dll_loc)
except:
print '%s not found' % dll_loc.split('... | {
"content_hash": "f87c52096a157018da5688d912b783ee",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 269,
"avg_line_length": 59.8562091503268,
"alnum_prop": 0.6088665647521293,
"repo_name": "jmbattle/pyMPSSE",
"id": "0aa3ad985c669da10fc2dc535bd0e31f16626ce0",
"size": "183... |
"""
sphinx.errors
~~~~~~~~~~~~~
Contains SphinxError and a few subclasses (in an extra module to avoid
circular import problems).
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from typing import Any
class SphinxError(Exception):... | {
"content_hash": "6965f0d76098b4379274344d46d1cbd6",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 94,
"avg_line_length": 26.977443609022558,
"alnum_prop": 0.6340579710144928,
"repo_name": "sonntagsgesicht/regtest",
"id": "d84d8c4c676902c00f89baab1e57182758f0167d",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.