text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import sys
exec(open('bitcasa/version.py').read())
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
with open('README.rst') as f:
README = f.read()
setup(
name... | {
"content_hash": "f3e7796c260416f1ef8ebccbcd9e02a4",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 34.265306122448976,
"alnum_prop": 0.5562835020845741,
"repo_name": "2xyo/bitcasa-sdk-python",
"id": "c75c978cab5582e6c9856e3214d07bed432e707d",
"size... |
import unittest
from usig_normalizador_amba.NormalizadorDirecciones import NormalizadorDirecciones
from usig_normalizador_amba.Partido import Partido
from usig_normalizador_amba.Direccion import Direccion
from usig_normalizador_amba.Errors import ErrorCalleInexistente, ErrorCruceInexistente
from usig_normalizador_amb... | {
"content_hash": "88641119ace5c538e1d25f908c757b5f",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 124,
"avg_line_length": 51.388888888888886,
"alnum_prop": 0.6936936936936937,
"repo_name": "usig/normalizador-amba",
"id": "21846205ed24e8b8908f4c28ea442457faab4ea9",
"siz... |
import os
import unittest
import tempfile
import shutil
class TestDirRawLoader(unittest.TestCase):
'''
Test class DirRawLoader
'''
def setUp(self):
from ..dirraw import DirRawLoader
self.DirRawLoader = DirRawLoader
self.tmpdir = tempfile.mktemp(suffix='-test')
# tmp-te... | {
"content_hash": "ac8414579ed375cc3c338d71d61df232",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 35.53846153846154,
"alnum_prop": 0.5676406926406926,
"repo_name": "shmilee/gdpy3",
"id": "28206ef66062d2d801dd74d1f516f3be04ab7a4e",
"size": "1908",
... |
__author__ = 'zieghailo'
import sys
import numpy as np
from scipy.spatial import KDTree
from point import Point
sys.setrecursionlimit(100000)
class SoIGraph():
def __init__(self, points):
self.points = points
self._build_tree()
def _build_tree(self):
data = [tuple(p.p) for p in sel... | {
"content_hash": "4073242fb4882df7f41ac4eec77ef2e5",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 28.75,
"alnum_prop": 0.5545893719806764,
"repo_name": "MihailoIsakov/SMUVI",
"id": "a93366ba131c88647f37a8a22af124ce9838c022",
"size": "2070",
"bin... |
import os
import nose.tools
import angr
test_location = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'binaries', 'tests')
def test_libc_x86():
p = angr.Project(os.path.join(test_location, "i386", "libc-2.27-3ubuntu1.so.6"), auto_load_libs=True)
dl_addr = p.loader.find_symbol('_dl_a... | {
"content_hash": "3beb24e71994ea32bd7cc1c9519ce1a1",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 106,
"avg_line_length": 32.76086956521739,
"alnum_prop": 0.6556071665560717,
"repo_name": "schieb/angr",
"id": "0bf0a1e518665ce53297eff6b0cb58f4e4f2676e",
"size": "1508",
... |
"""Red black tree, a self-balanced binary search tree that supports inserts and
reads in O(log n) time no matter what kind of data is inserted. The main target
of implementation has been speed so no custom keys or compare function is
supported.
The comments in insert and remove refer to Wikipedia article:
- https://en... | {
"content_hash": "62b44424d4b979399c5b4ddaf1f153f5",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 80,
"avg_line_length": 27.995065789473685,
"alnum_prop": 0.514658363198402,
"repo_name": "niemmi/algolib",
"id": "61c46cab95a34ebe2e9c6202b0b4aa07cecd8f89",
"size": "17021... |
"""
This script imports an RMG input file and a species dictionary file and merges them by
adding all of the species in the dictionary to the species list in the input file.
"""
import argparse
from rmgpy.rmg.input import readInputFile
from rmgpy.rmg.main import RMG
from rmgpy.chemkin import loadSpeciesDictionary
if... | {
"content_hash": "765f259e74247967d525a1ccbeee464d",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 86,
"avg_line_length": 31.79591836734694,
"alnum_prop": 0.67201540436457,
"repo_name": "mliu49/RMG-stuff",
"id": "9beab6d2defe9039c66bfea89c7b43a88805e966",
"size": "1599",... |
from google.net.proto import ProtocolBuffer
import array
import dummy_thread as thread
__pychecker__ = """maxreturns=0 maxbranches=0 no-callinit
unusednames=printElemNumber,debug_strs no-special"""
if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'):
_extension_runtime = True
_ExtendablePro... | {
"content_hash": "fdec4b7ab4cfe4f8d9fd48e3d06c072a",
"timestamp": "",
"source": "github",
"line_count": 900,
"max_line_length": 190,
"avg_line_length": 28.423333333333332,
"alnum_prop": 0.6576756186231969,
"repo_name": "undoware/neutron-drive",
"id": "35ed70f6d56df90eb919792c9f53f47673434e22",
"siz... |
"""Middleware related settings."""
MIDDLEWARE_CLASSES = [
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.M... | {
"content_hash": "09d70ec8c5ea96b56ef9392267b3adde",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 43.733333333333334,
"alnum_prop": 0.7820121951219512,
"repo_name": "pythonsingapore/pythonsingapore",
"id": "f88beb597598d47a65009a72801210c32a8bbbb5",... |
from random import randrange
import re
def test_contact_data_on_home_page_from_random_user(app):
contact_list = app.contact.get_contact_list()
index = randrange(len(contact_list))
contact_from_home_page = contact_list[index]
contact_from_edit_page = app.contact.get_contact_info_from_edit_page(index)
... | {
"content_hash": "8c7e3f5a29eab8e2a9e1d617c762d20b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 123,
"avg_line_length": 45.74193548387097,
"alnum_prop": 0.6361071932299013,
"repo_name": "mynameisalexander/python_training",
"id": "8aa1d043b47734c69c9880457d165e2d4796c625... |
'unit test'
__author__ = 'XieYu'
import unittest
from Dict import Dict
class TestDict(unittest.TestCase):
def test_init(self):
d = Dict(a=1, b='test')
self.assertEqual(d.a, 1)
self.assertEqual(d.b, 'test')
self.assertTrue(isinstance(d, dict))
def test_key(self):
d = Dict()
d['key'] = 'value'
self.... | {
"content_hash": "13bad3b5b68614824880a14f84af0233",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 41,
"avg_line_length": 17.52173913043478,
"alnum_prop": 0.6327543424317618,
"repo_name": "xieyufish/note",
"id": "0531658da500e15d80314d5661723b554808a3fb",
"size": "854",
... |
"""Provides DescriptorPool to use as a container for proto2 descriptors.
The DescriptorPool is used in conjection with a DescriptorDatabase to maintain
a collection of protocol buffer descriptors for use when dynamically creating
message types at runtime.
For most applications protocol buffers should be used via modu... | {
"content_hash": "bf4de30e74b53848b0e40db51752c9ec",
"timestamp": "",
"source": "github",
"line_count": 721,
"max_line_length": 80,
"avg_line_length": 35.08599167822469,
"alnum_prop": 0.6711467762975847,
"repo_name": "danakj/chromium",
"id": "20a33701720ee1ed4102a5b8d9906e792f9915cf",
"size": "2692... |
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from .fields import Orde... | {
"content_hash": "86b8c80733b7491797e93a91637468a3",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 104,
"avg_line_length": 27.98936170212766,
"alnum_prop": 0.6826301786393006,
"repo_name": "EssaAlshammri/django-by-example",
"id": "6092b122785a0e39f1e06d1b4f69e15dd10b5139",... |
class WordExclude:
#def __init__(self)
def get_filtered_words(self, unfiltered_words, remove_words, include_words):
filtered_question_words = []
for w in unfiltered_words:
#filter out the words to be removed
if (not w in remove_words) or (w in include_words):
... | {
"content_hash": "ee3f1618f52da9493c4729f11d434482",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 99,
"avg_line_length": 39.833333333333336,
"alnum_prop": 0.6596931659693166,
"repo_name": "fabawi/QuestionAnswering",
"id": "b6f3d9e31ea70407793aaa18ff714c954ed68730",
"siz... |
import os
import sys
import sphinx_rtd_theme
# Source file types:
source_suffix = ['.rst', '.md']
# -*- coding: utf-8 -*-
#
# HiDi documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 10 19:42:17 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
... | {
"content_hash": "b2e9c783d1f5284e44568b2285caf1a3",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 28.668639053254438,
"alnum_prop": 0.6691434468524252,
"repo_name": "VEVO/hidi",
"id": "2e78e5f5b0faae92ffc66d5c1b76e11a55ec6e73",
"size": "4845",
... |
"""
==========================
readthestuff.subscriptions
==========================
Parsing subscriptions from OPML files and storing subscriptions to datastore.
"""
import logging
import operator
import time
from collections import defaultdict
from lxml import etree
from psycopg2 import Error as DatabaseError, P... | {
"content_hash": "b3454a1b2bb25134c292052bbd98475f",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 78,
"avg_line_length": 32.729559748427675,
"alnum_prop": 0.541890853189854,
"repo_name": "playpauseandstop/readthestuff",
"id": "3f7010191e99e108a88393a394fc2254bf01966e",
... |
"""Helper to test significant Lock state changes."""
from typing import Any, Optional
from homeassistant.core import HomeAssistant, callback
@callback
def async_check_significant_change(
hass: HomeAssistant,
old_state: str,
old_attrs: dict,
new_state: str,
new_attrs: dict,
**kwargs: Any,
) ->... | {
"content_hash": "ae631db87aaff626e397482c28c485b7",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 54,
"avg_line_length": 22.65,
"alnum_prop": 0.6754966887417219,
"repo_name": "partofthething/home-assistant",
"id": "59a3b1a95c5a63485c8b19ba5d5333ab576b5ab8",
"size": "453... |
"""Base class for projections' REST calls
https://bigml.com/api/projections
"""
try:
import simplejson as json
except ImportError:
import json
from bigml.api_handlers.resourcehandler import ResourceHandlerMixin
from bigml.api_handlers.resourcehandler import check_resource_type, \
check_resource, get... | {
"content_hash": "85e7d95e04ab544b9835f36200d8248f",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 77,
"avg_line_length": 35.336363636363636,
"alnum_prop": 0.5737072292256239,
"repo_name": "bigmlcom/python",
"id": "a5339d58a323be3c2caae30ac235df825b1fc707",
"size": "452... |
from common import BaseTest
class NotifyTest(BaseTest):
def test_notify(self):
session_factory = self.replay_flight_data(
"test_notify_action", zdata=True)
policy = self.load_policy({
'name': 'instance-check',
'resource': 'ec2',
'filters': [{'tag:Te... | {
"content_hash": "c6c65180f8eae40867fb9e3ee09ad387",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 100,
"avg_line_length": 32.833333333333336,
"alnum_prop": 0.48984771573604063,
"repo_name": "stevenmjo/cloud-custodian",
"id": "93f6043ae42ced71e908a00284e50d9a20d41e56",
"... |
import json
import pandas as pd
from copy import deepcopy
from pextant.lib.geoshapely import *
import numpy as np
import re
import os
pd.options.display.max_rows = 5
from pathlib2 import Path
def loadPointsOld(filename):
parsed_json = json.loads(jsonInput)
waypoints = []
for element in parsed_json: # id... | {
"content_hash": "7fa8fdcc93e3be3ee10a4b1430a9c623",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 117,
"avg_line_length": 41.78030303030303,
"alnum_prop": 0.6335448776065277,
"repo_name": "kezilu/pextant",
"id": "35d579fc5054f739984dd3206e6b77422a7e38a3",
"size": "5515... |
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages',
'sphinxcontrib.napoleon']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple... | {
"content_hash": "fd36e029e5c788c61ed8cf8a0a0b4346",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 79,
"avg_line_length": 30.248366013071895,
"alnum_prop": 0.6838807260155575,
"repo_name": "pleeplee-robot/location",
"id": "e3f5218ace631215425d56a8aa2dda043ebadd27",
"siz... |
"""
COHORTE configuration file parser: converts a parsed configuration file to
beans
:author: Thomas Calmant
:license: Apache Software License 2.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License... | {
"content_hash": "63eb193e33829de7c86ebf95e493ea09",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 140,
"avg_line_length": 37.36658354114713,
"alnum_prop": 0.6031767218366257,
"repo_name": "isandlaTech/cohorte-runtime",
"id": "e3cfacbbc69c71e6d6a2895eb56ea408469c9744",
... |
"""Formatter for PCAP files."""
from plaso.formatters import interface
__author__ = 'Dominique Kilman (lexistar97@gmail.com)'
class PCAPFormatter(interface.ConditionalEventFormatter):
"""Define the formatting PCAP record."""
DATA_TYPE = 'metadata:pcap'
FORMAT_STRING_PIECES = [
u'Source IP: {source_ip... | {
"content_hash": "68c83409d08e962abad813272de9dcc8",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 57,
"avg_line_length": 27.424242424242426,
"alnum_prop": 0.6276243093922652,
"repo_name": "cvandeplas/plaso",
"id": "9e67dbd0943c068c560895442c9f022590e12e0a",
"size": "160... |
from dcim.choices import InterfaceModeChoices
from dcim.models import DeviceRole, Platform, Site
from ipam.models import VRF
from netbox.forms import NetBoxModelCSVForm
from tenancy.models import Tenant
from utilities.forms import CSVChoiceField, CSVModelChoiceField, SlugField
from virtualization.choices import *
from ... | {
"content_hash": "5fe23bfb508c08c8bd0b45f02c71e6c5",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 114,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.6122715404699739,
"repo_name": "digitalocean/netbox",
"id": "eab6fc9e7ba012c6b49e34a84b4f4a64a0e97bc4",
"size": ... |
from cloudfoundry_client.entities import EntityManager
class ServiceBrokerManager(EntityManager):
def __init__(self, target_endpoint, client):
super(ServiceBrokerManager, self).__init__(target_endpoint, client, '/v2/service_brokers')
def create(self, broker_url, broker_name, auth_username, auth_passw... | {
"content_hash": "3cf393e58e4a3183b02426a19301bcd0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 109,
"avg_line_length": 44.6,
"alnum_prop": 0.6382660687593423,
"repo_name": "romain-dartigues/cf-python-client",
"id": "49869eb5562f9f27d950c963c72dae4debadc96a",
"size": ... |
import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="bordercolorsrc", parent_name="scattergl.hoverlabel", **kwargs
):
super(BordercolorsrcValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "0a7f1d0afde2a2e8c46f3cc459a11850",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 88,
"avg_line_length": 34,
"alnum_prop": 0.6266968325791855,
"repo_name": "plotly/plotly.py",
"id": "c3e627140d205adf9d7298d3d7b8b0e00885e1c6",
"size": "442",
"binary": f... |
import argparse
import requests
import bs4
import re
import pg
import utilities
BASE_URL = 'http://www.vauva.fi'
TOPIC_LIST_URL = BASE_URL + '/keskustelu/alue/{subforum}?page={page}'
def get_topic_url(topic_item):
topic_url = topic_item.a['href']
# Remove url parameters
return topic_url.split('?', 1)[0... | {
"content_hash": "09006d3fbf18ef62a5bd4e1745ea6888",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 77,
"avg_line_length": 30.469026548672566,
"alnum_prop": 0.6003485332558814,
"repo_name": "alkukampela/vauvascrape",
"id": "b371eec408d905bea958d6af78f801202a38b5ac",
"siz... |
"""
A Hyper-V Nova Compute driver.
"""
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.virt import driver
from nova.virt.hyperv import hostops
from nova.virt.hyperv import livemigrationops
from nova.virt.hyperv import migrationops
from nova.virt.hyperv import... | {
"content_hash": "492c65c8779ed678b2211813b04c4fa4",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 79,
"avg_line_length": 44.167597765363126,
"alnum_prop": 0.5656463445484442,
"repo_name": "bclau/nova",
"id": "5966913adc28ad8303ac01f254296d4400611901",
"size": "8607",
... |
"""The tests for the Roku remote platform."""
from unittest.mock import MagicMock
from homeassistant.components.remote import (
ATTR_COMMAND,
DOMAIN as REMOTE_DOMAIN,
SERVICE_SEND_COMMAND,
)
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON
from homeassistant.core import Hom... | {
"content_hash": "8fc0130e720bf1f07a75680ca695a559",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 85,
"avg_line_length": 28.955223880597014,
"alnum_prop": 0.6891752577319588,
"repo_name": "GenericStudent/home-assistant",
"id": "f1685609563695b6ba0e688421ab3cbeca4f8bc3",
... |
import sys
import unittest
import compiler_tests
import component_builder_test
import container_builder_test
import k8s_helper_tests
if __name__ == '__main__':
suite = unittest.TestSuite()
suite.addTests(unittest.defaultTestLoader.loadTestsFromModule(compiler_tests))
suite.addTests(unittest.defaultTestLoader.l... | {
"content_hash": "6254831e1ddb3d68ce822a5ec8683ac6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 33.36842105263158,
"alnum_prop": 0.8028391167192429,
"repo_name": "kubeflow/kfp-tekton-backend",
"id": "d851fd17750fdc034f756accfc3950de31d875a0",
"s... |
import unittest
from Orange.data import Table
from Orange.preprocess import ProjectCUR
class TestCURProjector(unittest.TestCase):
def test_project_cur_default(self):
data = Table("ionosphere")
projector = ProjectCUR()
data_cur = projector(data)
for i in xrange(data_cur.X.shape[1])... | {
"content_hash": "c387fa81fedeaf8ee5159690c7400267",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 69,
"avg_line_length": 40.892857142857146,
"alnum_prop": 0.5895196506550219,
"repo_name": "kwikadi/orange3",
"id": "9195f89ff919888f27bb1d38c781ae53ad412f8e",
"size": "1145... |
import pandas as pd
class Portfolio:
def __init__(self, srcCsvPath):
self.df = pd.read_csv(srcCsvPath)
#TODO:delete
print(self.df)
#example)print(self.df['Ticker'][0]) | {
"content_hash": "2ab86fe34a1e4ea1195fc1b9d9fea278",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 44,
"avg_line_length": 25.5,
"alnum_prop": 0.5980392156862745,
"repo_name": "bullbullboy/PortfolioManagement",
"id": "4e057060197a8b718bb4d499c3a12e99a18598a3",
"size": "293... |
import os
import random
import bottle
from bottle import request, redirect, static_file, mako_view as view
import tweedr
from tweedr.lib.text import token_re
from tweedr.ml.crf.classifier import CRF
from tweedr.ml.features import featurize
from tweedr.ml.features.sets import crf_feature_functions
from tweedr.models i... | {
"content_hash": "b399f18e026d847199524d5fbb87ed11",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 99,
"avg_line_length": 31.551724137931036,
"alnum_prop": 0.7067395264116576,
"repo_name": "dssg/tweedr",
"id": "d50c8aed44871bf5371d5040f173887462d080b6",
"size": "2745",
... |
import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2o.decide_if_localhost()
if (localhost):
... | {
"content_hash": "4948249302dfd49762817d7a34d84280",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 129,
"avg_line_length": 37.40625,
"alnum_prop": 0.5559732664995823,
"repo_name": "janezhango/BigDataMachineLearning",
"id": "edc9364f9a88a00feab608c03e6b40341da30225",
"siz... |
"""Load Datasets without reading dataset generation code."""
import os
import typing
from typing import Any, List, Optional, Tuple, Type
from etils import epath
from tensorflow_datasets.core import dataset_builder
from tensorflow_datasets.core import dataset_info
from tensorflow_datasets.core import logging as tfds_l... | {
"content_hash": "c052e9752d5bb6cf97df2dd557c79374",
"timestamp": "",
"source": "github",
"line_count": 458,
"max_line_length": 90,
"avg_line_length": 38.02838427947598,
"alnum_prop": 0.702244933111328,
"repo_name": "tensorflow/datasets",
"id": "4468c32428dc73a8d8114e07eb03814666243fb2",
"size": "1... |
import argparse
import cStringIO
import os
import re
import sys
import fixtures
import mox
import testtools
from testtools import matchers
from neutronclient.common import exceptions
from neutronclient import shell as openstack_shell
DEFAULT_USERNAME = 'username'
DEFAULT_PASSWORD = 'password'
DEFAULT_TENANT_ID = 't... | {
"content_hash": "b23819e244837c3c5a679209f3523631",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 77,
"avg_line_length": 34.394904458598724,
"alnum_prop": 0.6081481481481481,
"repo_name": "ralphwort/chef-repo",
"id": "23f1d2dfc6c0677aad041343ded621669ce9bc52",
"size": ... |
import time
from test_framework.test_framework import DankcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
import binascii
class AddressIndexTest(DankcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "... | {
"content_hash": "c22fcdaa70a36a95503e82b3a19b1176",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 144,
"avg_line_length": 43.167647058823526,
"alnum_prop": 0.6329631396061866,
"repo_name": "dankcoin/dankcoin",
"id": "f147721d22b3b3b1f6d5d41d01af97e43e2a400c",
"size": "... |
from . import Framework
# Replay data forged by adding nulls to PaginatedList.setUp.txt and PaginatedList.testIteration.txt
class Issue278(Framework.TestCase):
def setUp(self):
Framework.TestCase.setUp(self)
self.repo = self.g.get_user("openframeworks").get_repo("openFrameworks")
self.list... | {
"content_hash": "85b4ae67181847214afc01e980eac97b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 99,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.7102803738317757,
"repo_name": "iModels/ffci",
"id": "3c57d708544a06134fc0c29ef8a6d9e6fb5d981e",
"size": "2074",
... |
from scipy import signal
from .utils import get_patient_id
"""
Expects as input a dictionary object
Returns a list of dictionary objects
"""
class RPeakReSample:
def __init__(self, targetSampleRate):
self.targetSampleRate = targetSampleRate
self.timeDelta = -1
self.lastTime = -1
def _... | {
"content_hash": "c3422481057f367b4c7e19a5ab211b05",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 101,
"avg_line_length": 32.81443298969072,
"alnum_prop": 0.5614200439836632,
"repo_name": "ibmkendrick/streamsx.health",
"id": "a3431725ee92472a022a743ffbe9c5441fb5a0ef",
"... |
from unittest.mock import patch
from gitlint import rules
from gitlint.config import LintConfig, LintConfigError, LintConfigGenerator, GITLINT_CONFIG_TEMPLATE_SRC_PATH
from gitlint import options
from gitlint.tests.base import BaseTestCase
class LintConfigTests(BaseTestCase):
def test_set_rule_option(self):
... | {
"content_hash": "10d8ee7f9836edf72d7cd9971b068921",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 119,
"avg_line_length": 44.0253164556962,
"alnum_prop": 0.6441920644048303,
"repo_name": "jorisroovers/gitlint",
"id": "852bf750e9a1a43498fef786f60470c9de918bb1",
"size": ... |
import sys
import os
import shutil
import glob
import socket
import hashlib
import time
import uuid as libuuid
import base64
PY3 = sys.version_info >= (3,)
if PY3:
basestring = str
from .log import LoggerFactory, DEFAULT_LOG_PART
logger = LoggerFactory.create_logger(DEFAULT_LOG_PART)
def b64_into_unicode(b64_s... | {
"content_hash": "26cf358361464cbeab44167ca124b208",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 182,
"avg_line_length": 28.97,
"alnum_prop": 0.6093660108157865,
"repo_name": "naparuba/kunai",
"id": "e930d1599772c7a012867f2603046299e3c1f5cc",
"size": "8691",
"binary... |
"""This module contains functions for computing eSCORE
Install::
pip install barnaba # tested with barnaba==0.1.7
Output::
$ baRNAba ESCORE --pdb ../test/1a9n.pdb --ff /Users/magnus/work/opt/barnaba/barnaba_201128/test/data/1S72.pdb
# your output will be written to files with prefix outfile.ESCORE
# ... | {
"content_hash": "a52481a89c1d2eb9771a781fb3d6e04f",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 127,
"avg_line_length": 32.602409638554214,
"alnum_prop": 0.6326681448632668,
"repo_name": "m4rx9/rna-pdb-tools",
"id": "ba07d7d40e59377d3d2e6200f54368de0ba3b798",
"size": ... |
from openpyxl import Workbook
class Writer(object):
def __init__(self, filename, sheetname="Sheet1"):
self.wb = Workbook()
self.sheet = self.wb.active
self.sheet.title = sheetname
self.filename = filename
self.curr_row = 1
def writerow(self, row):
for col, elem... | {
"content_hash": "a0ea256574da9c2b4074834c862f41fc",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 73,
"avg_line_length": 29.607142857142858,
"alnum_prop": 0.5597104945717732,
"repo_name": "maxdl/Vesicle.py",
"id": "1c4b310545d0e5daec872a9a11f67555a2e35359",
"size": "105... |
import lightevents
Light1 = lightevents.LightObject('192.168.1.3','onset','randflash')
Light2 = lightevents.LightObject('192.168.1.4','onset','randflash')
Light3 = lightevents.LightObject('192.168.1.5','onset','randflash')
Light4 = lightevents.LightObject('192.168.1.6','onset','randflash')
Light5 = lightevents.L... | {
"content_hash": "8d98c84e770ed0ecf6fdcd81b3077de0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 136,
"avg_line_length": 51.7037037037037,
"alnum_prop": 0.7184813753581661,
"repo_name": "jeremywrnr/life-of-the-party",
"id": "1ec67fbcd8183184e5bc505be6281c799cf45b60",
"... |
import os
import tempfile
import six
from django.utils.translation import pgettext_lazy
from horizon.test.settings import * # noqa: F403,H303
from horizon.utils import secret_key
from openstack_dashboard import exceptions
from horizon.utils.escape import monkeypatch_escape
# this is used to protect from client XSS... | {
"content_hash": "11480e3dc11aff4f93166d754c6e4cf3",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 78,
"avg_line_length": 27.758389261744966,
"alnum_prop": 0.6158123791102514,
"repo_name": "BiznetGIO/horizon",
"id": "8b36dfda957b6640c5ac84f839118bd5234fdba8",
"size": "8... |
from django.apps import apps
from django.core.checks import Error
def polymorphic_installed(app_configs, **kwargs):
"""Check that Django Polymorphic is installed correctly."""
errors = []
try:
apps.get_app_config('polymorphic')
except LookupError:
error = Error(
'Django Pol... | {
"content_hash": "4758161c09e00420906f518e51ae2bf3",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 64,
"avg_line_length": 29.058823529411764,
"alnum_prop": 0.6133603238866396,
"repo_name": "Ian-Foote/django-conman",
"id": "4efe37ab87285b11e726996514e7831c4dbb3a4e",
"size... |
"""
Factory for Users
"""
from django.contrib.auth.models import User
from factory import (
Sequence,
SubFactory,
LazyAttribute,
)
from factory.django import DjangoModelFactory
from factory.fuzzy import FuzzyText
from social_django.models import UserSocialAuth
from backends.edxorg import EdxOrgOAuth2
from m... | {
"content_hash": "61f547ebedf0336e19f151ead3785341",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 113,
"avg_line_length": 36.34722222222222,
"alnum_prop": 0.6878104700038211,
"repo_name": "mitodl/micromasters",
"id": "67ce249599bddc5e6c04d38969c325a2fa7a9abe",
"size": "... |
from django.db import models
from djangotoolbox.fields import BlobField
class DJ(models.Model):
user_id = models.CharField(max_length=256)
name = models.CharField(max_length=48)
picture = models.FileField()
class Show(models.Model):
user_id = models.CharField(max_length=256)
dj = models.ForeignKey(DJ, null=True,... | {
"content_hash": "e664e6f1f316d6b2207129daa4a90c83",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 76,
"avg_line_length": 31.78,
"alnum_prop": 0.7671491504090623,
"repo_name": "pwhelan/djshouts",
"id": "30adf7a95bd96598bf98e5d1a816b8c56363154a",
"size": "1589",
"binary... |
import requests
class IA_handler(object):
def __init__(self):
self.enabled = True
self.name = 'The Internet Archive'
self.api_required = False
def push(self, uri_org, p_args=[], session=requests.Session()):
msg = ''
try:
uri = 'https://web.archive.org/save/... | {
"content_hash": "a17e19920d1db519bbb9cd26f57e16be",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 153,
"avg_line_length": 46.39622641509434,
"alnum_prop": 0.49125660837738916,
"repo_name": "oduwsdl/archivenow",
"id": "5880bb841cec2741109f323ae4283a3af93159ef",
"size": "... |
"""Define tests for the SimpliSafe config flow."""
from simplipy.errors import (
InvalidCredentialsError,
PendingAuthorizationError,
SimplipyError,
)
from homeassistant import data_entry_flow
from homeassistant.components.simplisafe import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOUR... | {
"content_hash": "301ea708ab6f32931828c75d30f41989",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 87,
"avg_line_length": 33.2375,
"alnum_prop": 0.6242948476871004,
"repo_name": "tchellomello/home-assistant",
"id": "e3d0b0479c4a099b1087e74c178eb68226912833",
"size": "79... |
from tower_cli.utils.data_structures import OrderedDict
from tests.compat import unittest
class OrderedDictTests(unittest.TestCase):
"""A set of tests to ensure that the OrderedDict subclass that
tower-cli provides works as expected.
"""
def test_dunder_repr(self):
"""Establish that the Order... | {
"content_hash": "f240bde3bfadf6e0963a4135af15f9c3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 31.58823529411765,
"alnum_prop": 0.6238361266294227,
"repo_name": "nitzmahone/tower-cli",
"id": "ab7a29cb7a37eda3e0af6832e6b8e71b9c153036",
"size": "... |
"""
Twitter OAuth support.
This adds support for Twitter OAuth service. An application must
be registered first on twitter and the settings TWITTER_CONSUMER_KEY
and TWITTER_CONSUMER_SECRET must be defined with the corresponding
values.
User screen name is used to generate username.
By default account id is stored in... | {
"content_hash": "7d752f18410129b095c64ad9509815ae",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 35.924731182795696,
"alnum_prop": 0.6587847949715654,
"repo_name": "lovehhf/django-social-auth",
"id": "42d5904c9294b90b32f3abdc5cc0d9e07204affa",
"s... |
"""Provide the class Index which represents an index of photos.
"""
from collections.abc import MutableSequence
import errno
import fcntl
import os
from pathlib import Path
import yaml
from photoidx.idxitem import IdxItem
from photoidx.listtools import LazyList
class AlreadyLockedError(OSError):
def __init__(sel... | {
"content_hash": "6afd1309be698af01a6c1eacf25eb9e7",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 78,
"avg_line_length": 29.921875,
"alnum_prop": 0.5699738903394256,
"repo_name": "RKrahl/photo-tools",
"id": "f96cf3fd74b400d54c862df6e85eddd68bbb1af4",
"size": "3830",
... |
import contextlib
from mitmproxy.test import tflow
import mitmproxy.test.tutils
from mitmproxy import master
from mitmproxy import io
from mitmproxy import proxy
from mitmproxy import http
from mitmproxy import options
class MasterTest:
def cycle(self, master, content):
f = tflow.tflow(req=mitmproxy.t... | {
"content_hash": "d941178dba04a96a7e823d1cc0e15b8e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 74,
"avg_line_length": 25.892857142857142,
"alnum_prop": 0.6317241379310344,
"repo_name": "dwfreed/mitmproxy",
"id": "e3bb3069188a687b8d9e5580fa60d31caf5c78f6",
"size": "14... |
class ForgeError(Exception): pass
class ProjectConflict(ForgeError): pass
class ProjectOverlimitError(ForgeError): pass
class ToolError(ForgeError): pass
class NoSuchProjectError(ForgeError): pass
class NoSuchNeighborhoodError(ForgeError): pass
class NoSuchGlobalsError(ForgeError): pass
class MailError(ForgeError): pas... | {
"content_hash": "5d495b24c2f139d64d1ca011d23a3385",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 62,
"avg_line_length": 38.148148148148145,
"alnum_prop": 0.6378640776699029,
"repo_name": "leotrubach/sourceforge-allura",
"id": "30250f7f67b307d8e457b4c28af30ed61d8a6a7c",
... |
import os
_here = os.path.dirname(__file__)
SNIPPET_DIR = os.path.abspath(os.path.join(
_here, '..', '..', 'docs', 'source', 'snippets'))
def get_snippet_path(snippetfile):
return os.path.join(SNIPPET_DIR, snippetfile)
def execute_snippet(snippetfile):
snippetfile = get_snippet_path(snippetfile)
wi... | {
"content_hash": "9afb4032ab9484d9f83a7c0dd0f61a29",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 27.5625,
"alnum_prop": 0.6507936507936508,
"repo_name": "Pytwitcher/pytwitcherapi",
"id": "59fbcde294a7903c5587bfc5f566fac20bb170a5",
"size": "441",
... |
import unittest
from logging import WARNING
from unittest.mock import Mock, patch
from opentelemetry import baggage
from opentelemetry.baggage.propagation import (
W3CBaggagePropagator,
_format_baggage,
)
from opentelemetry.context import get_current
class TestBaggagePropagation(unittest.TestCase):
def s... | {
"content_hash": "8ac3286b324f72e243eb31c94d9650dc",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 91,
"avg_line_length": 34.14035087719298,
"alnum_prop": 0.5223535457348407,
"repo_name": "open-telemetry/opentelemetry-python",
"id": "466ff3be308b64ad85e5e8381bca13959312a5... |
from django.test import TestCase
from django import forms
from django.contrib.auth.models import User
from mediaviewer.forms import FormlessPasswordReset
import mock
class TestFormlessPasswordReset(TestCase):
def setUp(self):
self.email = 'test@email.com'
self.user = mock.create_autospec(User)
... | {
"content_hash": "01679f91a3082605ae6bf6aa673e3a87",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 64,
"avg_line_length": 36.1875,
"alnum_prop": 0.697754749568221,
"repo_name": "kyokley/MediaViewer",
"id": "e580f71948290229a666b9750a69a99c662917a2",
"size": "1158",
"bi... |
if __name__ == '__main__':
if __package__ is None:
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from Agent import *
from Stream import *
from WindowOperators import window_split
from PrintFunctions import print_streams_recent
def ... | {
"content_hash": "bdebe29b79311ccdb465f5151d17eff3",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 81,
"avg_line_length": 30.962962962962962,
"alnum_prop": 0.562799043062201,
"repo_name": "zatricion/Streams",
"id": "a099a4dc0fd8794b7e8bb4669fd985dff70b4ac6",
"size": "167... |
from flask import Flask, render_template, send_file, redirect
from flask.ext.socketio import SocketIO, send, emit
import threading
import time
import os, shutil, re
from lib import *
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
@socketio.on('connect', namespace='/mir')
def hand... | {
"content_hash": "6b4c4610edb421f6394193f93f1982c4",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 96,
"avg_line_length": 30.453333333333333,
"alnum_prop": 0.5987302977232924,
"repo_name": "AtzeDeVries/master-image-retriever",
"id": "68f6e99fcdac73a7375bf45ad2eb7a162160e3... |
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch
)
from salttesting.helpers im... | {
"content_hash": "1e998124e95dfa3ff6b3f496cd85bd05",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 112,
"avg_line_length": 31.107843137254903,
"alnum_prop": 0.5329341317365269,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "f1b73a713ce5c038a1dbae2a1fcfa516c5... |
"""
Copied and adapted from
https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#a-full-example
"""
from __future__ import absolute_import
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .forms import EmailUserChang... | {
"content_hash": "0ac99e5dc74734b0af862f88d8ee51c6",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 79,
"avg_line_length": 36,
"alnum_prop": 0.6534391534391535,
"repo_name": "theirc/ServiceInfo",
"id": "6dc19a09c4c0e6ace5cc736d79f17e2125665fe1",
"size": "1512",
"binary"... |
from ._IntegerBase import IntegerBase
from Cryptodome.Util.number import long_to_bytes, bytes_to_long
class IntegerNative(IntegerBase):
"""A class to model a natural integer (including zero)"""
def __init__(self, value):
if isinstance(value, float):
raise ValueError("A floating point typ... | {
"content_hash": "cdc87b58caa59675115a05a299c42c48",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 87,
"avg_line_length": 27.322857142857142,
"alnum_prop": 0.5001568545435533,
"repo_name": "cloudera/hue",
"id": "896107fffb0f7cbf5ebaa5cc171b0a3f43e8736e",
"size": "11076"... |
import os
import re
import yaml
import logging
import markdown
import devsiteHelper
from google.appengine.ext.webapp.template import render
SOURCE_PATH = os.path.join(os.path.dirname(__file__), 'src/content/')
UNSUPPORTED_TAGS = [
r'{% link_sample_button .+%}',
r'{% include_code (.+)%}'
]
def getPage(requestPath,... | {
"content_hash": "9ffbbc82d617179349854864e6d3514f",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 159,
"avg_line_length": 45.94805194805195,
"alnum_prop": 0.6095251554550594,
"repo_name": "robdodson/WebFundamentals",
"id": "562ea43ed82cd3cb96af5bccc85138e66c820193",
"s... |
import jwt
import re
import six
import sys
from shopify.utils import shop_url
if sys.version_info[0] < 3: # Backwards compatibility for python < v3.0.0
from urlparse import urljoin
else:
from urllib.parse import urljoin
ALGORITHM = "HS256"
PREFIX = "Bearer "
REQUIRED_FIELDS = ["iss", "dest", "sub", "jti", ... | {
"content_hash": "730192bff9f44fcfa4561b3397663c8a",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 112,
"avg_line_length": 27.642857142857142,
"alnum_prop": 0.7019810508182601,
"repo_name": "Shopify/shopify_python_api",
"id": "91a4970bca8c4b4b927ac82c9db71d91e3980f42",
"... |
import os
import sys
import shlex
from pyinstl.instlMisc import InstlMisc
from configVar import config_vars
from pyinstl.cmdOptions import CommandLineOptions, read_command_line_options
import utils
class CommandListRunner(object):
def __init__(self, initial_vars, options) -> None:
self.initial_vars = ini... | {
"content_hash": "752995a062de8a847484d008dad3ab69",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 153,
"avg_line_length": 37.642857142857146,
"alnum_prop": 0.6299810246679317,
"repo_name": "wavesaudio/instl",
"id": "2d58c1fe1de1683af3c79cd02f6185550c74b842",
"size": "36... |
"""Minimal Python 2 & 3 shim around all Qt bindings
DOCUMENTATION
Qt.py was born in the film and visual effects industry to address
the growing need for the development of software capable of running
with more than one flavour of the Qt bindings for Python - PySide,
PySide2, PyQt4 and PyQt5.
1. Bu... | {
"content_hash": "e33839eae38ca72db9aa65f53ee13234",
"timestamp": "",
"source": "github",
"line_count": 1870,
"max_line_length": 79,
"avg_line_length": 32.13636363636363,
"alnum_prop": 0.5919960063233214,
"repo_name": "getavalon/core",
"id": "b47ef631abf5f8a41df5e40c90d46904a1b0dd88",
"size": "6009... |
import datetime
import hashlib
import json
import logging
import os
import shutil
import subprocess
import tempfile
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.template import Context, loader
from django.test.client impo... | {
"content_hash": "90b620a572c0d54b1a36ab680f7f2b1f",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 79,
"avg_line_length": 35.76323987538941,
"alnum_prop": 0.6185975609756098,
"repo_name": "ingenioustechie/zamboni",
"id": "4718e31b7b3fe8f2b7df11920a01ac8021194341",
"size... |
"""This module allows uploading new assets to a google ads account.
This module allows uploading assets through the assetMG tool, and assigning them
to a list of adgroups utilaizing the mutate module.
"""
import app.backend.mutate as mutate
from app.backend.error_handling import error_mapping
from app.backend.structu... | {
"content_hash": "778b95c5fcd2c6b84d251c40a659db86",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 94,
"avg_line_length": 33.936708860759495,
"alnum_prop": 0.6182394628869825,
"repo_name": "google/assetMG",
"id": "737c21e5ddd9888ebe68e43f7e89087a83af9b6f",
"size": "5938... |
"""
https://github.com/westurner/house_prices/commit/3f586b57ac081a9bef27f43906b3df83a27f0b45
- do_autoclean=True
- do_get_dummies=False
"""
# import numpy as np
from collections import OrderedDict as odict
from datacleaner import autoclean_cv
import pandas as pd
from sklearn.ensemble import ExtraTreesRegressor, ... | {
"content_hash": "cdaf7eacf5a9b981204acaa045f76229",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 170,
"avg_line_length": 40.23255813953488,
"alnum_prop": 0.6146435452793835,
"repo_name": "westurner/house_prices",
"id": "02b538473121d862ffaae914796b944ae076c3a8",
"size... |
from typing import List, Tuple
import itertools
class Word2VecAug:
def __init__(
self, model: str, tokenize: object, type: str = "file"
) -> None:
"""
:param str model: path model
:param object tokenize: tokenize function
:param str type: moodel type (file, binary)
... | {
"content_hash": "782b668b0b4b90546e1bd6c9f1cc06d9",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 74,
"avg_line_length": 32.81967213114754,
"alnum_prop": 0.5369630369630369,
"repo_name": "PyThaiNLP/pythainlp",
"id": "59a68cede7b2e2bb441c9611281bbe4f8ee9c8fe",
"size": "2... |
"""
WSGI config for serverctl_prototype project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(... | {
"content_hash": "d3316fd4b8a6f28d085911a25e8a8f0e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 79,
"avg_line_length": 26,
"alnum_prop": 0.7788461538461539,
"repo_name": "uehara1414/serverctl-prototype",
"id": "f01a783cd1f0e0abb1680c02a5db64f0db816b88",
"size": "416",... |
'''
<TBTAF>
<TestID>2021</TestID>
<Tags>TBTAF,Discoverer,Textbook</Tags>
<Priority>10</Priority>
<Description>Priority above limit.</Description>
</TBTAF>
'''
# '''
# Created on 06/11/2015
# @author: Nander
# '''
from __future__ import absolute_import
from __future__ import print_function
from common.test import TBTes... | {
"content_hash": "1f4267491504b1b2f8219c112e67113d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 76,
"avg_line_length": 27.482142857142858,
"alnum_prop": 0.6211825860948668,
"repo_name": "S41nz/TBTAF",
"id": "0df23f51bdfa3ecb572ccc3e78d3f075957978df",
"size": "1539",
... |
import ovlib.verb
from ovlib.dispatcher import dispatcher, command, Dispatcher
from ovlib.wrapper import ObjectWrapper, ListObjectWrapper, wrapper
from ovirtsdk4.types import Group
from ovirtsdk4.writers import GroupWriter
from ovirtsdk4.services import GroupsService, GroupService
@wrapper(service_class=GroupsServic... | {
"content_hash": "60554a378f45f37ae566dafc2d5f9821",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 101,
"avg_line_length": 25.65625,
"alnum_prop": 0.807551766138855,
"repo_name": "fbacchella/ovirtcmd",
"id": "ff635eef520e9b3a266e762ad9195fd8b28dd023",
"size": "821",
"b... |
from typing import Any
from typing import Dict
from hueber.api._common import Resource
from hueber.api._common import ResourceComposite
class Config(Resource):
"""Metadata about the Bridge and all devices known to it.
The state call is by far the heaviest which is the reason for a lazy switch. If for
som... | {
"content_hash": "60b68077ae2f7f6e7ca6a36bde32e233",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 88,
"avg_line_length": 35.6,
"alnum_prop": 0.6619850187265918,
"repo_name": "mbaltrusitis/hueber",
"id": "cf3c0ab4cff5dee7f36283ad7f93a28034c267fc",
"size": "1069",
"bina... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0010_auto_20170130_2156'),
]
operations = [
migrations.AlterField(
model_name='member',
name='rules_agree',
... | {
"content_hash": "f1103bfb7b96a103b0bd0b52119b7192",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 52,
"avg_line_length": 23.869565217391305,
"alnum_prop": 0.5774134790528234,
"repo_name": "Eigenbaukombinat/ebkmember",
"id": "afb3d2b0db5e75b5c22d994f4f21276c59ed96aa",
"s... |
import asyncio
import functools
import importlib
import inspect
import mimetypes
import re
from collections.abc import Container, Iterable, Mapping, MutableMapping, Sized
from itertools import chain
from pathlib import Path
from typing import Set # noqa
from urllib import parse
import yarl
from aiohttp import hdrs
fr... | {
"content_hash": "153f875ab32720aee7454b25695063e3",
"timestamp": "",
"source": "github",
"line_count": 692,
"max_line_length": 79,
"avg_line_length": 31.710982658959537,
"alnum_prop": 0.5458895370032811,
"repo_name": "aamalev/aiohttp_apiset",
"id": "656c40b0b66c2aa3e43ee5b87999792abec61493",
"size... |
import plotly.plotly as py
from plotly.graph_objs import *
import anydbm, sys
from bs4 import BeautifulSoup
class plot_bot:
def __init__(self,filename):
self.filename = filename
self.cgpa = []
self.sgpa = []
self.roll_no = []
def get_data(self):
file = anydbm.open('data/%s' % self.filename,'r')
for roll... | {
"content_hash": "36bf27dd68c95a1fe16cbc68280b731c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 55,
"avg_line_length": 21.41860465116279,
"alnum_prop": 0.6384364820846905,
"repo_name": "ishankhare07/automated-scrapper",
"id": "a7fb184c485248aa5ab9454f224ef1f1f88dbb69",
... |
from __future__ import unicode_literals
import setuptools
from setuptools import setup, find_packages
import sys
install_requires = [
"Jinja2>=2.7.3",
"boto>=2.36.0",
"boto3>=1.6.16",
"botocore>=1.12.13",
"cryptography>=2.3.0",
"requests>=2.5",
"xmltodict",
"six>1.9",
"werkzeug",
... | {
"content_hash": "3bf9b22952bf2497aebc631f4a2fcd93",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 68,
"avg_line_length": 27.385714285714286,
"alnum_prop": 0.5847678664580073,
"repo_name": "okomestudio/moto",
"id": "a1b8c5daecbeb7f5b2aa2946a2b377d4ffc13df8",
"size": "193... |
"""Utility script to install APKs from the command line quickly."""
import optparse
import os
import sys
import time
from pylib import android_commands
from pylib import constants
from pylib.device import device_utils
def AddInstallAPKOption(option_parser):
"""Adds apk option used to install the APK to the Option... | {
"content_hash": "9012689d8e1da074ac385f8fed0c5f86",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 80,
"avg_line_length": 35.92857142857143,
"alnum_prop": 0.5978415222948026,
"repo_name": "bright-sparks/chromium-spacewalk",
"id": "ac6e5056098737d44618039c10372548200c2f47",... |
"""
IMDb: Queries OMDB database for information about IMDb titles
"""
import supybot
import supybot.world as world
# Use this for the version of this plugin. You may wish to put a CVS keyword
# in here if you're keeping the plugin in CVS or some similar system.
__version__ = "2020.06.01+git"
# XXX Replace this with... | {
"content_hash": "fb82c55664a0dcedc67e182ffdc74835",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 28.454545454545453,
"alnum_prop": 0.737220447284345,
"repo_name": "Alcheri/Plugins",
"id": "8d66a4e497d3702c13732501386ade68f28f862a",
"size": "2891"... |
'''
Copyright (C) 2012-2015 Diego Torres Milano
Created on Dec 1, 2012
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | {
"content_hash": "ba0c4449b66c75ad3982e24247df2a97",
"timestamp": "",
"source": "github",
"line_count": 1111,
"max_line_length": 141,
"avg_line_length": 37.72817281728173,
"alnum_prop": 0.5398654451760664,
"repo_name": "jyx140521/AndroidViewClient",
"id": "bbf689bb6545d3ebaa7fbfea72ae08760d10033e",
... |
from __future__ import unicode_literals
from django.db import migrations
def migrate_cards(apps, schema_editor):
Account = apps.get_model('foobar', 'Account')
Card = apps.get_model('foobar', 'Card')
for account_obj in Account.objects.all():
Card.objects.create(
account=account_obj,
... | {
"content_hash": "5512d3a39ba53b67651f686d765111fd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 49,
"avg_line_length": 23.391304347826086,
"alnum_prop": 0.6245353159851301,
"repo_name": "uppsaladatavetare/foobar-api",
"id": "812614e7d6d219c00bcb4d79537113bd08289e51",
... |
import praw
import time
import datetime
import sqlite3
'''USER CONFIGURATION'''
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights' Newsletter... | {
"content_hash": "5d336d4dc43ce07934833110dd778990",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 150,
"avg_line_length": 30.748031496062993,
"alnum_prop": 0.6845070422535211,
"repo_name": "voussoir/reddit",
"id": "933d16850ccfa2c7d0ccf878fe190973ea91e956",
"size": "39... |
import logging
import pprint
import random
import time
# 3p
from distutils.version import StrictVersion # pylint: disable=E0611,E0401
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
import redis
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest, load_ch... | {
"content_hash": "1035f22a0a6133c42ff3dd85b8e5f9cc",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 123,
"avg_line_length": 34.78453038674033,
"alnum_prop": 0.5714739517153749,
"repo_name": "darnould/integrations-core",
"id": "4a008107f06ba4b5410674f5006075bf7d7ee441",
"... |
'''
Support for Varnish
.. versionadded:: 2014.7.0
.. note::
These functions are designed to work with all implementations of Varnish
from 3.x onwards
'''
from __future__ import absolute_import
# Import python libs
import logging
import re
# Import salt libs
import salt.utils
log = logging.getLogger(__nam... | {
"content_hash": "038bc8203e8c3cf70968deee936b99f0",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 116,
"avg_line_length": 21.3,
"alnum_prop": 0.5837245696400626,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "75050657ccd38828792470eb806a0f460a247c26",
"si... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Violin Memory, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apach... | {
"content_hash": "348b653659d7d0b1dca305471e5bcebc",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 87,
"avg_line_length": 45.0027397260274,
"alnum_prop": 0.6022159990259345,
"repo_name": "rlucio/cinder-violin-driver-icehouse",
"id": "3ed92f6e2d5360446dbcc8f63e9e52af2a258a... |
"""
byceps.services.shop.article.models.article
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime
from decimal import Decimal
from typing import Any, Optional
from Ranger import Range
from Ranger.s... | {
"content_hash": "3c6dee497edb66e6d7dbf30399310145",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 94,
"avg_line_length": 33.422222222222224,
"alnum_prop": 0.6143617021276596,
"repo_name": "m-ober/byceps",
"id": "f07d3edfea4d69b7c294cd8fed4359506cedd542",
"size": "4512"... |
import os
import shutil
import signal
from oslo.config import cfg
from neutron.agent.linux import keepalived
from neutron.agent.metadata import driver as metadata_driver
from neutron.common import constants as l3_constants
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
from neutron.o... | {
"content_hash": "3569c7564edbc1c3b0fce22d93aaec72",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 79,
"avg_line_length": 38.10132158590309,
"alnum_prop": 0.594635217944271,
"repo_name": "Metaswitch/calico-neutron",
"id": "bcc9414955a5ba85afe6d764739cce7958cb6bd9",
"siz... |
from django.conf.urls import patterns, include, url
from django.conf.urls.static import static
import os
import sys
import settings
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
ROOT_PATH = os.path.dirname(os.path.realpath(__file__))
# if sys.platform ... | {
"content_hash": "c4eb60a0a7e66c39ba49b6acf7db9918",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 83,
"avg_line_length": 33.23809523809524,
"alnum_prop": 0.660458452722063,
"repo_name": "TonkWorks/scripts",
"id": "0d4ea1d17ae616b7a589ae2e0dbc989841e9532a",
"size": "1396... |
"""test from_BrunoldrRaman"""
# --- import --------------------------------------------------------------------------------------
import WrightTools as wt
from WrightTools import datasets
# --- test ----------------------------------------------------------------------------------------
def test_LDS821_514nm_80... | {
"content_hash": "dbf2bff8f9d075dc963da3fb8989b74e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 99,
"avg_line_length": 27.35,
"alnum_prop": 0.4460694698354662,
"repo_name": "wright-group/WrightTools",
"id": "c7604d5741dfd3f572f1c75826548a34b26a4196",
"size": "547",
... |
import re
from corehq.apps.api.object_fetch_api import CaseAttachmentAPI
from corehq.apps.api.domainapi import DomainAPI
from corehq.apps.api.redis_assets import RedisAssetsAPI
from corehq.apps.api.resources import v0_1, v0_2, v0_3, v0_4, v0_5
from corehq.apps.commtrack.resources.v0_1 import ProductResource
from coreh... | {
"content_hash": "c5bc7a27cdf3cad7ebdb09da49127f95",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 178,
"avg_line_length": 33.88,
"alnum_prop": 0.6582054309327037,
"repo_name": "gmimano/commcaretest",
"id": "d003be00224b898f7f2ecbff46988206c8e88ff3",
"size": "3388",
"... |
from challenges import Challenge
class HelloFastaChallenge(Challenge):
"""
Given: A DNA strand followed by fasta reads.
Return: The id of the read which the shortest distance to the given strand.
"""
sample = '''
ACCGGTCC
>Fasta1
AGCG
GGCC
>Fasta2
A... | {
"content_hash": "c4e64c5bae96c4702b8dc31ba30660a6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 23.41025641025641,
"alnum_prop": 0.5169769989047097,
"repo_name": "elmar-hinz/Python.Challenges",
"id": "f405be382b2bc7062e969dedaa50c15fa8e6617d",
"... |
#!/bin/python
from glob import glob
from os.path import isdir
from sys import argv
from typing import List
import argparse
from charset_normalizer import detect as tbt_detect
from chardet import detect as chardet_detect
from charset_normalizer.utils import iana_name
def calc_equivalence(content: bytes, cp_a: str, c... | {
"content_hash": "713b3e1de3b623aeb88eb3f53d65129e",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 153,
"avg_line_length": 32.8494623655914,
"alnum_prop": 0.6144026186579378,
"repo_name": "ousret/charset_normalizer",
"id": "03996dad541d67a5d942e93c1c0b69734c37a398",
"siz... |
import unittest
import pyvotune
@pyvotune.tune(direction='output', name='sparse', value=True)
class T1:
def __init__(self):
pass
def test_func(self):
return 2
@pyvotune.sparse_output
class T2:
def __init__(self):
pass
@pyvotune.autotune
class T3:
def __init__(self):
... | {
"content_hash": "ec12b4061561cb38a9febfdc07374052",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 72,
"avg_line_length": 23.62686567164179,
"alnum_prop": 0.5824384080859129,
"repo_name": "aelaguiz/pyvotune",
"id": "b931eeaea8deccb51361d286dc9a2da46333d4e7",
"size": "160... |
__author__ = 'ahmedlawi92@gmail.com'
player_tracking_url = "http://stats.nba.com/stats/leaguedashptstats?PtMeasureType=&Conference=&Country=&DateFrom=&DateTo=&Division=" \
"&DraftPick=&DraftYear=&GameScope=&Height=&LastNGames=0&LeagueID=00&Location=&Month=0&OpponentTeamID=0" \
... | {
"content_hash": "d6190b0102ec0b8893bfa313fd5c86bf",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 140,
"avg_line_length": 88.68571428571428,
"alnum_prop": 0.694909793814433,
"repo_name": "ahmedlawi92/basketball-stats",
"id": "c92a35195137ff596220bc978bb462ab8ccef8ab",
"... |
import numpy
class LinearInterpolator:
def __init__(self, dynamicEntry):
self.__key = dynamicEntry.getAttribute("key")
self.__start = float(dynamicEntry.getAttribute("start"))
self.__end = float(dynamicEntry.getAttribute("end"))
self.__step = float(dynamicEntry.getAttribute("step"))
self.__text = dynamicEnt... | {
"content_hash": "4d4ed580e8099eebb4e6501dc92394ec",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 85,
"avg_line_length": 25.27777777777778,
"alnum_prop": 0.6681318681318681,
"repo_name": "unaguil/hyperion-ns2",
"id": "155e8e7eb4ea295264e625cd81566faa1640c164",
"size": "... |
"""
Support for Flux lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.flux_led/
"""
import logging
import socket
import random
import voluptuous as vol
from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_PROTOCOL
from homeassistan... | {
"content_hash": "53d129ac44d70ff7394c7760fd0bdc23",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 74,
"avg_line_length": 31.353413654618475,
"alnum_prop": 0.5986934802100679,
"repo_name": "LinuxChristian/home-assistant",
"id": "209c3ab772411bed38a2366c5e3d3031a26d369b",
... |
'''
Support for Stormpath.
.. versionadded:: 2015.8.0
'''
# Import python libs
from __future__ import absolute_import
import pprint
def __virtual__():
'''
Only load if the stormpath module is available in __salt__
'''
return 'stormpath.create_account' in __salt__
def present(name, **kwargs):
'... | {
"content_hash": "bb159004e4440f56982f11ae3c711c5e",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 99,
"avg_line_length": 35.16111111111111,
"alnum_prop": 0.582240480328646,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "67798f1473c0de4c6f22923787bb4615a8e17... |
from __future__ import unicode_literals
from collections import OrderedDict
from tablib import Dataset
class Error(object):
def __init__(self, error, traceback=None, row=None):
self.error = error
self.traceback = traceback
self.row = row
class RowResult(object):
IMPORT_TYPE_UPDATE ... | {
"content_hash": "ed82a405dc80975923ea7ca05854c35d",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 69,
"avg_line_length": 30.073529411764707,
"alnum_prop": 0.5731051344743276,
"repo_name": "copperleaftech/django-import-export",
"id": "d7303f4eb7cf32b9c2a2d74396a2ffc0bfd630... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.