text stringlengths 4 1.02M | meta dict |
|---|---|
import os
from alembic import command as alembic_cmd
from alembic import config as alembic_cfg
from alembic import util as alembic_u
from oslo_config import cfg
from sahara.i18n import _
CONF = cfg.CONF
def do_alembic_command(config, cmd, *args, **kwargs):
try:
getattr(alembic_cmd, cmd)(config, *args, ... | {
"content_hash": "2fde8393405e855f3ebfd9032462692a",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 76,
"avg_line_length": 30.78723404255319,
"alnum_prop": 0.6389080856945404,
"repo_name": "shakamunyi/sahara",
"id": "79d25a16ba268789a0f91b031998f9bac6573953",
"size": "347... |
import kivy
kivy.require('1.9.0')
from kivy.clock import Clock
from kivy.uix.image import Image
from kivy.properties import BooleanProperty
from ammo import Shot
class Shooter(Image):
reloaded = True
alife = False
def on_touch_down(self, touch):
if self.parent.collide_point(*touch.pos):
... | {
"content_hash": "63d2e239ed50ec757a7d543bca21a276",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 68,
"avg_line_length": 29.338461538461537,
"alnum_prop": 0.5568956476140535,
"repo_name": "pimier15/PyGUI",
"id": "26840250dac7dfd2f275de8c8dcb613511f6c8a7",
"size": "1931"... |
from oslo_utils import uuidutils as uid
from rally.benchmark.scenarios import base
from rally.common import log as logging
from rally.plugins.openstack.wrappers import network as network_wrapper
LOG = logging.getLogger(__name__)
class NeutronScenario(base.Scenario):
"""Base class for Neutron scenarios with basi... | {
"content_hash": "efa19fb8c1b5ed09545700ea7dce7ded",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 78,
"avg_line_length": 38.82846715328467,
"alnum_prop": 0.5976125575712004,
"repo_name": "vponomaryov/rally",
"id": "0fe7fab7aa45ef8fc3c5881c66b2f32161a86189",
"size": "11... |
"""Handles all requests relating to volumes."""
import collections
import datetime
import functools
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import timeutils
from oslo_utils import uuidutils
import six
from cinder.api import common
from cinder i... | {
"content_hash": "11c06addc42067a723be5a8c89a1bd04",
"timestamp": "",
"source": "github",
"line_count": 1708,
"max_line_length": 79,
"avg_line_length": 45.24882903981265,
"alnum_prop": 0.5339716633240603,
"repo_name": "takeshineshiro/cinder",
"id": "3b8cfece435bdda280e80602125d7690faced2f8",
"size"... |
from .database import create_database_pool, Database, transaction
from .session import setup_aiohttp_session
from .auth import userdata_from_web_request, userdata_from_rest_request, \
web_authenticated_users_only, web_maybe_authenticated_user, rest_authenticated_users_only, \
web_authenticated_developers_only, ... | {
"content_hash": "13624ba54c892899daf0b6d45c46dcea",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 96,
"avg_line_length": 36.4,
"alnum_prop": 0.7241758241758242,
"repo_name": "danking/hail",
"id": "20b58d424da4dc5587381f2fc6f11c1bc8e62309",
"size": "910",
"binary": fal... |
import unittest
import utils
from threading import Lock
from LogicaNegocios import *
import Globales
Globales.material_lock = Lock()
class PruebasUnitarias(unittest.TestCase):
@classmethod
def setUpClass(cls):
print "============Guardando copia tablas y estableciendo escenario de datos=============="
... | {
"content_hash": "b1301d8819242b83cd5564bd765b12eb",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 132,
"avg_line_length": 34.914529914529915,
"alnum_prop": 0.621297429620563,
"repo_name": "andres-hurtado-lopez/naranjaverdeprod",
"id": "3d98eb1c80831703535a32d71a6e81b3fa4... |
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.preprocessing import sequence
from keras.optimizers import RMSprop
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten... | {
"content_hash": "b0e3188d10de3de74e6690f83d300ffe",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 123,
"avg_line_length": 34.4078947368421,
"alnum_prop": 0.7131931166347992,
"repo_name": "rajegannathan/grasp-lift-eeg-cat-dog-solution-updated",
"id": "54096ab5601ee52b342f0... |
from django import forms
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.contrib import admin
from django.contrib.auth.models import Group
from django_messages.utils import get_user_model
User = get_user_model()
if "notification" in settings.INSTALLED_APPS:
from... | {
"content_hash": "bac240075c861aedf62dcd033a670d3a",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 89,
"avg_line_length": 34.872727272727275,
"alnum_prop": 0.5664754953076121,
"repo_name": "michaelmior/django-messages",
"id": "d9b88e1d15783f98c55a6d6f7ec6096d4e0015a0",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from shipments.db_views import drop_views, add_views
class Migration(migrations.Migration):
dependencies = [
('shipments', '0013_merge'),
]
operations = [
migrations.RunPython(drop_views, add_views),
... | {
"content_hash": "2a590cc608f9e34b7fd64be69799d1c5",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 58,
"avg_line_length": 28.43243243243243,
"alnum_prop": 0.5826996197718631,
"repo_name": "stbenjam/CTS",
"id": "b70c5d5ceb4a69a9238ee8affb1fe28fddf58b3e",
"size": "1076",
... |
import re
import time
from gcp_common import BaseTest, event_data
from googleapiclient.errors import HttpError
class InstanceTest(BaseTest):
def test_instance_query(self):
factory = self.replay_flight_data('instance-query')
p = self.load_policy(
{'name': 'all-instances',
... | {
"content_hash": "26a95830683797f134393ff3b19667fb",
"timestamp": "",
"source": "github",
"line_count": 433,
"max_line_length": 100,
"avg_line_length": 38.33718244803695,
"alnum_prop": 0.5328915662650603,
"repo_name": "capitalone/cloud-custodian",
"id": "f67d00050b63a3b8dd919e55d9a5f66dde0af538",
"... |
import micropython
# these functions are not always available
if not hasattr(micropython, "mem_info"):
print("SKIP")
else:
micropython.mem_info()
micropython.mem_info(1)
micropython.qstr_info()
micropython.qstr_info(1)
| {
"content_hash": "6d9de9d81701b3085fc441d015f83f3e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 42,
"avg_line_length": 24,
"alnum_prop": 0.7125,
"repo_name": "pramasoul/micropython",
"id": "9df341fbb833484f7b85f2055ec6ba1f578bccdc",
"size": "289",
"binary": false,
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('imager_profile', '0005_merge_20170119_1241'),
('imager_profile', '0007_auto_20170124_1644'),
]
operations = [
]
| {
"content_hash": "1901164bc38804bbd899b1c7ebccaede",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 55,
"avg_line_length": 20,
"alnum_prop": 0.6464285714285715,
"repo_name": "clair3st/django-imager",
"id": "08c3b9c50faf53ee68d5e536c0589ce43a573d80",
"size": "353",
"bina... |
"""Python utilities required by Keras."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import binascii
import codecs
import marshal
import os
import re
import sys
import time
import types as python_types
import numpy as np
import six
from tensorflow.pyt... | {
"content_hash": "148d489ac84d5c7955e9000549b0116e",
"timestamp": "",
"source": "github",
"line_count": 547,
"max_line_length": 80,
"avg_line_length": 31.427787934186473,
"alnum_prop": 0.6157873305799546,
"repo_name": "xodus7/tensorflow",
"id": "2e56fa2dc5474678ba3ef765bc148f09c4665ec0",
"size": "1... |
import pickle
import weakref
from uuid import uuid4, UUID
import numpy as np
import pyarrow as pa
import pytest
class IntegerType(pa.PyExtensionType):
def __init__(self):
pa.PyExtensionType.__init__(self, pa.int64())
def __reduce__(self):
return IntegerType, ()
class UuidScalarType(pa.Ex... | {
"content_hash": "b9045d26b9429465c75aec887186239b",
"timestamp": "",
"source": "github",
"line_count": 942,
"max_line_length": 77,
"avg_line_length": 31.03184713375796,
"alnum_prop": 0.6408388067870826,
"repo_name": "icexelloss/arrow",
"id": "96e995c64181971fb8d61e317a58f99a3539a6c2",
"size": "300... |
import uuid
from lxml import etree
import mock
import paramiko
import six
from jacket.storage import exception
from jacket.storage import ssh_utils
from jacket.storage import test
from jacket.tests.storage.unit.volume.drivers.netapp.dataontap.client import (
fakes as fake_client)
from jacket.tests.storage.unit.vo... | {
"content_hash": "e004c1fb8fd9aff85fa295582ac92403",
"timestamp": "",
"source": "github",
"line_count": 1271,
"max_line_length": 83,
"avg_line_length": 40.83398898505114,
"alnum_prop": 0.5668208092485549,
"repo_name": "HybridF5/jacket",
"id": "88a8b0c0185f0ff86850d2989ee10a4f7ade508f",
"size": "527... |
import sys
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.c... | {
"content_hash": "c9236f977544887ebf3d569e7f1b08b1",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 201,
"avg_line_length": 44.205882352941174,
"alnum_prop": 0.6754491017964072,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d2a8e768d80ed75e1dace307da988268e3a4406f",
... |
import os
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
import sys
import codecs
import commands
import shutil
reload(sys)
sys.setdefaultencoding('utf-8')
def GenerateTxt2Pic(files):
"""
将文本文件转换成图片
请注意,使用此功能会将在windows文件格式转换成linux的utf-8,直接覆盖源文件
你可以备份一下
"""
# fileName =... | {
"content_hash": "141ff8b601db45e52fdcb611c216fdaa",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 106,
"avg_line_length": 27.53488372093023,
"alnum_prop": 0.5717905405405406,
"repo_name": "lichengshuang/createvhost",
"id": "135df6e760e6477b446c781e60a36eb008f9508b",
"si... |
from feedbackserver.models import *
from django.contrib import admin
admin.site.register(CI_ResponsibleParty)
admin.site.register(Tags)
admin.site.register(GVQ_UserRoleCode)
admin.site.register(CI_Date)
admin.site.register(CI_Citation)
admin.site.register(CI_Contact)
admin.site.register(MD_Identifier)
admin.site.regis... | {
"content_hash": "9f8f41614b490913459a28d9886e4347",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 49,
"avg_line_length": 32.29032258064516,
"alnum_prop": 0.8321678321678322,
"repo_name": "mvdbroek/geo-userfeedback",
"id": "b58f23667048cad6f20de72d4e5e674c8c2b5b41",
"siz... |
from __future__ import annotations
# This file is released into the public domain. Generated by
# versioneer-0.17 (https://github.com/warner/python-versioneer)
"""Git implementation of _version.py."""
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the ... | {
"content_hash": "1cf8e986ecabee1d47d862291f2ac315",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 88,
"avg_line_length": 32.959706959706956,
"alnum_prop": 0.5722938430762392,
"repo_name": "dask/distributed",
"id": "a37b7c1e8d45f4819fcc603c8c088f84bbfa01c7",
"size": "18... |
test.assert_equals(is_opposite('ab', 'AB'), True)
test.assert_equals(is_opposite('aB', 'Ab'), True)
test.assert_equals(is_opposite('aBcd', 'AbCD'), True)
test.assert_equals(is_opposite('AB', 'Ab'), False)
test.assert_equals(is_opposite('', ''), False)
| {
"content_hash": "fa3bee13b69ff43c71321615df60f810",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 53,
"avg_line_length": 50.4,
"alnum_prop": 0.6825396825396826,
"repo_name": "RevansChen/online-judge",
"id": "8c1be713e30444176fa43af43ee61a38f375ba76",
"size": "270",
"bi... |
import unittest
import boto3
import moto
@moto.mock_s3()
def setUpModule():
bucket = boto3.resource('s3').create_bucket(Bucket='mybucket')
bucket.wait_until_exists()
@moto.mock_s3()
def tearDownModule():
resource = boto3.resource('s3')
bucket = resource.Bucket('mybucket')
try:
bucket.d... | {
"content_hash": "7c29ea5ee907a3b4038cda7375136674",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 22.975609756097562,
"alnum_prop": 0.6454352441613588,
"repo_name": "mpenkov/smart_open",
"id": "da0c3fef4c663bd53b02dec42c12cb205c567e2c",
"size": "9... |
import logging
log = logging.getLogger(__name__)
class I2C_CommunicationError(Exception):
error_texts = {
# 0: 'success',
1: 'data too long to fit in transmit buffer',
2: 'received NACK on transmit of address',
3: 'received NACK on transmit of data',
4: 'other error',
}... | {
"content_hash": "4f78049554b79fffd38ddb1b72acc031",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 185,
"avg_line_length": 27.37272727272727,
"alnum_prop": 0.5715709066755231,
"repo_name": "nanpy/nanpy",
"id": "dd1eaa8b343cea60fa07654debb02f06b4eb5d35",
"size": "3011",
... |
import argparse
import glob
import os
import os.path as op
import sys
import time
try:
from PyQt4 import QtGui, QtCore
except ImportError:
from PySide import QtGui, QtCore
Qt = QtCore.Qt
import numpy as np
import pyqtgraph
from pyqtgraph import dockarea
import mt
import utils
def respfunc_viewer(path):
... | {
"content_hash": "b12716e21b2a604edc036aa608fe511c",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 125,
"avg_line_length": 35.08791208791209,
"alnum_prop": 0.6260569996868149,
"repo_name": "kinverarity1/mtwaffle",
"id": "8fa26d8bb36a293adc8b74ff73f850fdf09304e2",
"size"... |
import re
__all__ = ["Data"]
class Data:
"""Store data from an individual line received on IRC."""
def __init__(self, my_nick, line, msgtype):
self._my_nick = my_nick.lower()
self._line = line
self._msgtype = msgtype
self._is_private = self._is_command = False
self._m... | {
"content_hash": "db3b34217973364708d7732284e54512",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 84,
"avg_line_length": 34.036199095022624,
"alnum_prop": 0.5382876894442967,
"repo_name": "earwig/earwigbot",
"id": "a89d9b9e489d0aaf41a92cb11861a7227479bf04",
"size": "86... |
from sqlalchemy import Column, String, Integer, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from db import engine
Base = declarative_base()
class TiceCache(Base):
__tablename__ = 'tice'
cardnum = Column(Integer, primary_key=True)
text = Column(String(4096), nullable=False)
date ... | {
"content_hash": "f10cc5f30b21c1dde285bfe9530d4328",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 58,
"avg_line_length": 27.733333333333334,
"alnum_prop": 0.7211538461538461,
"repo_name": "HeraldStudio/webservice-py",
"id": "0127ce3d084837625a419c28cb39c9fec626d5c2",
"s... |
class Solution:
def numberOfSteps (self, num: int) -> int:
steps = 0;
while num is not 0:
num = num - 1 if num&1 else int(num/2)
steps += 1
return steps
| {
"content_hash": "b02d0fd5e30ce589a4d09d36cb527220",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 25.75,
"alnum_prop": 0.5,
"repo_name": "AHJenin/acm-type-problems",
"id": "3e953dc790552a32f42e8195f54f77963032f4a7",
"size": "206",
"binary": false... |
"""
Tests For Cells Utility methods
"""
import inspect
import random
from nova.cells import utils as cells_utils
from nova import db
from nova import test
class CellsUtilsTestCase(test.TestCase):
"""Test case for Cells utility methods."""
def test_get_instances_to_sync(self):
fake_context = 'fake_con... | {
"content_hash": "04d15b8373e81751e0aadb6587a4cac3",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 40.337078651685395,
"alnum_prop": 0.6094707520891365,
"repo_name": "sridevikoushik31/nova",
"id": "337556282122659f0166cd5cd345b1b240a05fba",
"size":... |
from google.cloud import datacatalog
from google.datacatalog_connectors.commons import prepare
from google.datacatalog_connectors.looker.prepare import constants
class DataCatalogTagTemplateFactory(prepare.BaseTagTemplateFactory):
__BOOL_TYPE = datacatalog.FieldType.PrimitiveType.BOOL
__DOUBLE_TYPE = datacat... | {
"content_hash": "c548967f6c3615bb9694ae2275050cb5",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 79,
"avg_line_length": 45.334310850439884,
"alnum_prop": 0.49401643055825084,
"repo_name": "GoogleCloudPlatform/datacatalog-connectors-bi",
"id": "93b762c203524d9f34bdc2a7f9... |
import numpy as np
import cirq
import cirq.contrib.quimb as ccq
def test_tensor_density_matrix_1():
q = cirq.LineQubit.range(2)
c = cirq.Circuit(cirq.YPowGate(exponent=0.25).on(q[0]))
rho1 = cirq.final_density_matrix(c, qubit_order=q, dtype=np.complex128)
rho2 = ccq.tensor_density_matrix(c, q)
n... | {
"content_hash": "55f3d36253d6b83758abd300721b3b21",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 90,
"avg_line_length": 36.86153846153846,
"alnum_prop": 0.6878130217028381,
"repo_name": "balopat/Cirq",
"id": "2112de986da44a32d5a0f7331a5e4b41b64fbf68",
"size": "2396",
... |
from conan.packager import ConanMultiPackager
import platform
if __name__ == "__main__":
builder = ConanMultiPackager(args="--build missing")
builder.add_common_builds()
builder.run() | {
"content_hash": "5040835edcfdf0cf619b723eeeb91e69",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 24.625,
"alnum_prop": 0.700507614213198,
"repo_name": "sunxfancy/CodeFactory",
"id": "ce24ba3a8615ccf0bffb9776e25ccdfbf174503c",
"size": "197",
"bin... |
import itk
ImageType = itk.Image[itk.UL, 3]
image = ImageType.New()
print("ITK Hello World!")
print(image)
| {
"content_hash": "ea85819166c17b3df8f7fff8951861c1",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 32,
"avg_line_length": 15.571428571428571,
"alnum_prop": 0.7064220183486238,
"repo_name": "InsightSoftwareConsortium/ITKExamples",
"id": "ee831f22754029f92d5d65024649867cb81dd... |
from sqlalchemy import MetaData, Table, func, select
from sqlalchemy.sql import and_
from jacket.compute import exception
from jacket.i18n import _
def upgrade(migrate_engine):
meta = MetaData(migrate_engine)
instances = Table('instances', meta, autoload=True)
sysmeta = Table('instance_system_metadata', ... | {
"content_hash": "061e874b1ea8f1baa9ca95741ed0a92d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 44.69565217391305,
"alnum_prop": 0.6400778210116731,
"repo_name": "HybridF5/jacket",
"id": "89c995c16fbcdbc12e2492f3cbe3b0130f5e9f98",
"size": "1601"... |
"""
Memory Backend
--------------
Provides a simple dictionary-based backend.
"""
from dogpile.cache.api import CacheBackend, NO_VALUE
class MemoryBackend(CacheBackend):
"""A backend that uses a plain dictionary.
There is no size management, and values which
are placed into the dictionary will remain
... | {
"content_hash": "195364d33156c563f4b3bb87fbb10238",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 53,
"avg_line_length": 23.029411764705884,
"alnum_prop": 0.5804597701149425,
"repo_name": "dprince/dogpile.cache",
"id": "e606beab519f2e44519756c5dd30f62f2a1d5473",
"size":... |
from Stack import Stack
def divideBy2(decNumber):
remstack = Stack()
while decNumber > 0:
rem = decNumber % 2
remstack.push(rem)
decNumber = decNumber // 2
binString = ""
while not remstack.empty():
binString = binString + str(remstack.pop())
return binString
if _... | {
"content_hash": "493997222dc4d8635425be2a874c7208",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 51,
"avg_line_length": 21.58823529411765,
"alnum_prop": 0.5967302452316077,
"repo_name": "NiuXWolf/Introduction-to-Algorithms",
"id": "c6300451ed7ebd3a2139041dfbe0267949ef926... |
'''
Basic tests for instantiating the main object
'''
import pytest
from tourbillon import Tourbillon
def test_tourbillon():
tb = Tourbillon()
| {
"content_hash": "b440cb600380a4b8c473a1bff2b6f006",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 14.7,
"alnum_prop": 0.7482993197278912,
"repo_name": "adamgilman/tourbillon",
"id": "a79524aaa41b1a67c8a531ca9151e07b4c88ce3c",
"size": "147",
"bin... |
"""
Convert json to tsv from stdin by extracting the specified objects.
e.g., cat my.json | json2tsv id user.name
"""
import argparse
import json
import sys
from . import util
def main():
parser = argparse.ArgumentParser(
description='Convert json to tsv from stdin by extracting the ' +
... | {
"content_hash": "c216edb15daa26f8d58917e1026112b7",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 77,
"avg_line_length": 28.69047619047619,
"alnum_prop": 0.5568464730290457,
"repo_name": "tapilab/json2tsv",
"id": "2a0fc4070215c87dc1069863adda838a5c656dbb",
"size": "2432... |
import neuroml_via_xsl_core
import neuroml_via_xsl_neuron
| {
"content_hash": "c5abfa7c2dea8997d47d721e34147c77",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 29,
"alnum_prop": 0.8275862068965517,
"repo_name": "mikehulluk/morphforge",
"id": "920d9065a28f314980e02381fc70df7390308a62",
"size": "1597",
"binar... |
"""Support for Ring Doorbell/Chimes."""
from __future__ import annotations
import asyncio
from datetime import timedelta
from functools import partial
import logging
from pathlib import Path
from oauthlib.oauth2 import AccessDeniedError
import requests
from ring_doorbell import Auth, Ring
from homeassistant.const im... | {
"content_hash": "9c433de6a41600cd05be76b6a77c23d1",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 96,
"avg_line_length": 31.857142857142858,
"alnum_prop": 0.5758681822922098,
"repo_name": "Danielhiversen/home-assistant",
"id": "a8196b30302f6ebc48587ac8a8e55828ac8e01b8",
... |
"""
Norwegian-specific Form helpers
"""
from __future__ import absolute_import, unicode_literals
import re
import datetime
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_l... | {
"content_hash": "76cd2d5d835564dfdc0ddac76c678dd1",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 119,
"avg_line_length": 33.33644859813084,
"alnum_prop": 0.5834034202410989,
"repo_name": "zarelit/django-localflavor",
"id": "9b4dc8e9d37d21be793fc1dc2637b3039cf87759",
"... |
import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
BASE_DIR = PACKAGE_ROOT
DEBUG = True
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "dev.db",
}
}
ALLOWED_HOSTS ... | {
"content_hash": "b76df16e07964b0d072080942cdb7c4b",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 82,
"avg_line_length": 31.489247311827956,
"alnum_prop": 0.6779921461499061,
"repo_name": "GuildLeader/interfaces",
"id": "d950ca88d4873911d193ea2e31432572e9e01bf7",
"size... |
"""
Test the regressor influence visualizers.
"""
##########################################################################
## Imports
##########################################################################
import pytest
import numpy as np
import matplotlib.pyplot as plt
from tests.base import VisualTestCase
fro... | {
"content_hash": "1e2f6c078d5819a9dd9e4b200500e710",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 82,
"avg_line_length": 29.044303797468356,
"alnum_prop": 0.5434735236434953,
"repo_name": "pdamodaran/yellowbrick",
"id": "339179f32c16085df780de7e684b623fec848f33",
"size... |
"""
imshows.py: wrappers around matplotlib.pyplot.imshow with saner
defaults for 3D scientific images.
"""
import numpy as np
from matplotlib import pyplot as plt, cm, colors
from skimage import color
def cshow(im):
"""Show an image (or cross-section) with the cubehelix colormap.
Parameters
----------
... | {
"content_hash": "acec767a11671053f1e301af57757813",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 78,
"avg_line_length": 25.985915492957748,
"alnum_prop": 0.5552845528455285,
"repo_name": "jni/vis",
"id": "e9a861f85efa74b4837ccd082f39501cecc186db",
"size": "3690",
"b... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('products', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
mig... | {
"content_hash": "bcc6a88b5b684aa1a20ba10c2c041fab",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 39.361111111111114,
"alnum_prop": 0.5758645024700071,
"repo_name": "codingforentrepreneurs/marketplace",
"id": "bc65bd7103d1a1b836b0c64473e5910bbf37b3... |
"""
============================
Experiment with eye-tracking
============================
Integration with Eyelink functionality makes programming experiments
using eye-tracking simpler.
"""
# Author: Eric Larson <larsoner@uw.edu>
#
# License: BSD (3-clause)
import numpy as np
from expyfun import ExperimentControll... | {
"content_hash": "ce09ea2df2c8b4ea29750a0c8c583e19",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 79,
"avg_line_length": 37.984375,
"alnum_prop": 0.5857671740024681,
"repo_name": "Eric89GXL/expyfun",
"id": "e1270600fa48da65d8ef6b2666a299e00fee62ba",
"size": "2431",
"b... |
from netCDF4 import Dataset
import json
# In[ ]:
# Assume that /projects/CHARIS is sshfs mounted on this machine, and
# that the user has write permission
fid = Dataset('~/projects/CHARIS/snow_cover/modice.v0.4/min05yr_nc/MODICE.v0.4.1test.nc', 'w', format='NETCDF4')
fid.Conventions = "CF-1.6"
fid = Dataset('/home/v... | {
"content_hash": "90c4243e6c56ad1e8a00f9f56da11076",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 234,
"avg_line_length": 56.775862068965516,
"alnum_prop": 0.698451260249013,
"repo_name": "mjbrodzik/ipython_notebooks",
"id": "e3fcfcaabac86a0213b86b5859e734bfd4a0d2f2",
"... |
import os, sys
import numpy as np
from optparse import OptionParser
from py_paddle import swig_paddle, DataProviderConverter
from paddle.trainer.PyDataProvider2 import integer_value_sequence
from paddle.trainer.config_parser import parse_config
"""
Usage: run following command to show help message.
python predict.py ... | {
"content_hash": "01f0b8deef2a75566a0bf0922e5c20df",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 83,
"avg_line_length": 30.057142857142857,
"alnum_prop": 0.5715304182509505,
"repo_name": "livc/Paddle",
"id": "64c78e0d6b9297e7a321a4f070517593b0bfe332",
"size": "4818",
... |
import pytest
from ipaqe_dyndir.builtin.repos import (
UpdatesTestingRepositoryPlugin,
COPRPlugin
)
from ipaqe_dyndir.plugin.base import PluginConfigError
test_host = dict(name='test.example.com', role='master')
host_updates_enabled = {'enable_updates_testing': True}
host_updates_disabled = {'enable_updates... | {
"content_hash": "21deeebd6401ec601a8f7add915de7b0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 75,
"avg_line_length": 27.88135593220339,
"alnum_prop": 0.6802431610942249,
"repo_name": "apophys/ipaqe-dyndir",
"id": "fbd4e6e0f17a7101e2812bb4d7632ae2e17745b1",
"size": "... |
from functools import partial
import pytest
from plenum.common.util import getNoInstances
from stp_core.common.util import adict
from plenum.test import waits
from plenum.test.malicious_behaviors_node import makeNodeFaulty, \
delaysPrePrepareProcessing, \
changesRequest
from plenum.test.node_request.node_requ... | {
"content_hash": "105e4b5d9c44cf4dedb5d61edd8beb47",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 85,
"avg_line_length": 31.574074074074073,
"alnum_prop": 0.6774193548387096,
"repo_name": "evernym/zeno",
"id": "cd871a536885c5fe4239dbbd5379ee901e9de2a7",
"size": "1705",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('wagtailcore', '0033_remove_golive_expiry_help_text'),
]
operations = [
migrations.CreateModel(
... | {
"content_hash": "0d646b44c55be56f10b053f8d23e0dd2",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 151,
"avg_line_length": 36.724137931034484,
"alnum_prop": 0.6028169014084507,
"repo_name": "UWKM/uwkm_streamfields",
"id": "33b00ba1b482e4c47df32e5b8ecc0d5e69b6d460",
"size... |
from feedin.engine import Engine
from feedin.model import Context
from elasticsearch import Elasticsearch
import time
import datetime
import uuid
if __name__ == '__main__':
setting_file = 'sina.xml'
engine = Engine()
es = Elasticsearch()
job = engine.create(setting_file)
page = 0
while True:
... | {
"content_hash": "e6defdf678d031e9665924997c939673",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 30.77777777777778,
"alnum_prop": 0.5752105896510229,
"repo_name": "lyssym/crawler",
"id": "5d384abcf1f98a8968119581838f175282a2f9d4",
"size": "855",
... |
import os
import webob.dec
import webob.exc
from traffic.api.openstack import wsgi
from traffic import context
from traffic import flags
from traffic.openstack.common import log as logging
from traffic import wsgi as base_wsgi
LOG = logging.getLogger(__name__)
FLAGS = flags.FLAGS
flags.DECLARE('use_forwarded_for', '... | {
"content_hash": "a30bdb1bc073640fc6609916e51531ad",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 38.458333333333336,
"alnum_prop": 0.5861321776814734,
"repo_name": "fengkaicnic/traffic",
"id": "3d7b9483f704c04e1dd46c11bface68353f2afa0",
"size": "... |
import os
from slackly import SlackClient, SlackAPI, SlackEventParsed
from slackly.client.response_factory import SlackAPIObjectResponse
import slackly.schema.endpoints
def main():
client = SlackClient(
token=os.environ['SLACK_TOKEN'],
response_factory=SlackAPIObjectResponse,
)
slack = Sl... | {
"content_hash": "57bf0769c44a7cfe880cb4733e8fd175",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 66,
"avg_line_length": 23.6875,
"alnum_prop": 0.712401055408971,
"repo_name": "huntcsg/slackly",
"id": "3d31b9731e11e710804b05da4b098b39742d5dbe",
"size": "379",
"binary"... |
import json
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render_to_response, get_object_or_404, render, redirect
from django.views import generic
from .forms import *
from .models import *
from django.contrib.auth.models import User, Group
from foraliving.recording ... | {
"content_hash": "232e5e617289f0f04bdccbaa81670ce2",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 173,
"avg_line_length": 32.83574879227053,
"alnum_prop": 0.5848168309548331,
"repo_name": "foraliving/pilot",
"id": "a31a70e71980ae4bd42bc31a6c9813d4ca660bbe",
"size": "67... |
from plone.indexer import indexer
from zope.interface import Interface
import plone.api
@indexer(Interface)
def customer_role(obj):
"""Index users and groups with ``Customer`` role directly on the context.
Don't index inherited `Customer` role. Groups are prefixed with ``group:``
"""
users = obj.use... | {
"content_hash": "2468f0a56e7eb068c09d7b6b538368c9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 33.5,
"alnum_prop": 0.7014925373134329,
"repo_name": "TheVirtualLtd/bda.plone.orders",
"id": "4ca2a589a3826e22fcf54987c0b1f250a2e85469",
"size": "493... |
"""FastAPI framework, high performance, easy to learn, fast to code, ready for production"""
__version__ = "0.87.0"
from starlette import status as status
from .applications import FastAPI as FastAPI
from .background import BackgroundTasks as BackgroundTasks
from .datastructures import UploadFile as UploadFile
from ... | {
"content_hash": "e6405db42184a48999d7295f07f158c0",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 92,
"avg_line_length": 43.2,
"alnum_prop": 0.8277777777777777,
"repo_name": "tiangolo/fastapi",
"id": "afdc94874c4f38e59302e74893d35fa8e1640836",
"size": "1080",
"binary"... |
""" This file is a modified version of rlcompleter.py from the Python
project under the Python Software Foundation License 2:
https://github.com/python/cpython/blob/master/Lib/rlcompleter.py
https://github.com/python/cpython/blob/master/LICENSE
The only changes made were to modify the regular expression in attr_matche... | {
"content_hash": "502b6fd31aeff25d5a10c1892adcdd6c",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 94,
"avg_line_length": 30.281690140845072,
"alnum_prop": 0.6789147286821705,
"repo_name": "Vector35/binaryninja-api",
"id": "9a33659b1d0e9083425bad3ae14fac62797cd7a7",
"si... |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extension... | {
"content_hash": "cac74b8544d8c8149cefb07018cd24a5",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 78,
"avg_line_length": 29.047619047619047,
"alnum_prop": 0.660655737704918,
"repo_name": "billy-yoyo/RainbowSixSiege-Python-API",
"id": "1c7f3cbb2b08d8da59b9a61293e27b49ac45... |
import socket
from unittest import mock
import pytest
from aiohttp.tcp_helpers import CORK, tcp_cork, tcp_nodelay
has_ipv6 = socket.has_ipv6
if has_ipv6:
# The socket.has_ipv6 flag may be True if Python was built with IPv6
# support, but the target system still may not have it.
# So let's ensure that we... | {
"content_hash": "c4b3467b1a337874de0c815aefa07967",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 75,
"avg_line_length": 32.4,
"alnum_prop": 0.6828437633035335,
"repo_name": "rutsky/aiohttp",
"id": "70f7357a01800c5ed5166d84cae6755fe96808d9",
"size": "4698",
"binary":... |
from ccxt.async.base.exchange import Exchange
import base64
import hashlib
import math
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import InvalidNonce
from ccxt.base.errors import InvalidOrder
class kucoin (Exchange):
def describe(... | {
"content_hash": "e8567ea31620a3055a08ef45c5e82b68",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 126,
"avg_line_length": 37.87429643527204,
"alnum_prop": 0.4495962748303364,
"repo_name": "tritoanst/ccxt",
"id": "8ade41163c5d5253c4aeeaf254f10842d1b50050",
"size": "2021... |
"""
Tests of neo.io.stimfitio
"""
import sys
import unittest
from neo.io import StimfitIO
from neo.test.iotest.common_io_test import BaseTestIO
try:
import stfio
except Exception:
HAS_STFIO = False
else:
HAS_STFIO = True
@unittest.skipIf(sys.version_info[0] > 2, "not Python 3 compatible")
@unittest.sk... | {
"content_hash": "43ceffca87b47bd16ded7e603d07904f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 68,
"avg_line_length": 20.763157894736842,
"alnum_prop": 0.6425855513307985,
"repo_name": "apdavison/python-neo",
"id": "c3a1d76c829800840254283a3b1c6e13e5aa0287",
"size": ... |
"""
Structure connectivity class.
"""
import collections
import logging
import networkx as nx
import numpy as np
from monty.json import MSONable, jsanitize
from pymatgen.analysis.chemenv.connectivity.connected_components import (
ConnectedComponent,
)
from pymatgen.analysis.chemenv.connectivity.environment_nodes... | {
"content_hash": "d9444261d29aca1383ca85153feed94b",
"timestamp": "",
"source": "github",
"line_count": 396,
"max_line_length": 115,
"avg_line_length": 41.25757575757576,
"alnum_prop": 0.5198310686742563,
"repo_name": "richardtran415/pymatgen",
"id": "190ef9fa191ea5fb67cba450e0717e20eda591c6",
"siz... |
"""
Tests for L{twisted.application.app} and L{twisted.scripts.twistd}.
"""
import signal, inspect, errno
import os, sys, cPickle, StringIO
try:
import pwd, grp
except ImportError:
pwd = grp = None
from zope.interface import implements
from twisted.trial import unittest
from twisted.application import serv... | {
"content_hash": "8170257220b365472a8ad61b9abe136e",
"timestamp": "",
"source": "github",
"line_count": 1279,
"max_line_length": 84,
"avg_line_length": 31.773260359655982,
"alnum_prop": 0.625227619469462,
"repo_name": "GetSomeBlocks/ServerStatus",
"id": "eb00d1bcc57fdd71ad5934d0e8babf30b744bc29",
"... |
# =================================================================
#
# Authors: Ricardo Garcia Silva <ricardo.garcia.silva@gmail.com>
#
# Copyright (c) 2017 Ricardo Garcia Silva
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the... | {
"content_hash": "099b84b72a21c7bc2915aefe804b028b",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 110,
"avg_line_length": 31.918478260869566,
"alnum_prop": 0.5893069981270219,
"repo_name": "geopython/pycsw",
"id": "49329027d2a03daeca6b708bd93c9a0450625783",
"size": "11... |
import os
WERCKER_FOLDER_NAME = '.wercker'
WERCKER_CREDENTIALS_FILE = 'credentials'
def get_global_wercker_path():
return os.path.join(os.environ['HOME'], WERCKER_FOLDER_NAME)
def get_global_wercker_filename():
return os.path.join(get_global_wercker_path(), WERCKER_CREDENTIALS_FILE)
def check_or_create_p... | {
"content_hash": "d1e55374ec695937522b3d3bcf0e3cd4",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 27.209302325581394,
"alnum_prop": 0.6461538461538462,
"repo_name": "wercker/wercker-cli",
"id": "50ce6f6c4943559d2475c180a3c05d6720288d95",
"size": "... |
from mock import patch, Mock, call
from ...testcases import DustyTestCase
from dusty.commands.status import _has_active_container, get_dusty_status
from dusty.schemas.base_schema_class import DustySchema
from ..utils import get_app_dusty_schema, get_bundle_dusty_schema, get_lib_dusty_schema
class TestStatusCommands(D... | {
"content_hash": "f41c259ebb5d26a8ea49bc193a8899a3",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 205,
"avg_line_length": 63.80582524271845,
"alnum_prop": 0.6367924528301887,
"repo_name": "gamechanger/dusty",
"id": "2cdbdc43a6f9fe1e2fbc0e42b941e72a584fc3cc",
"size": "6... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing M2M table for field pages_new on 'Response'
db.delete_table(db.shorten_name('responses_pages_new'))
def backwards(s... | {
"content_hash": "a0446913004b08065e5b9887c275507f",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 198,
"avg_line_length": 80.68484848484849,
"alnum_prop": 0.5532937730038309,
"repo_name": "shh-dlce/pulotu",
"id": "86ebb93c7902c7c1733955125bf49b198d614ab6",
"size": "133... |
from django.conf.urls import include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = [
# Examples:
# url(r'^$', 'apply.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^accounts/login/$', 'django.contrib.auth.views.login'),
url(r'^accounts/logout/$', 'dj... | {
"content_hash": "25bcaa3f1da22c939ca683e26e531af4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 84,
"avg_line_length": 28.625,
"alnum_prop": 0.6397379912663755,
"repo_name": "neonsoftware/yard",
"id": "1a52f424989c72e33b359b4b87374d9cf76ad836",
"size": "458",
"binar... |
import unittest
from ..test import TestCase
from .multipart_builder import MultipartBuilder
class MockPlatform:
def create_url(self, url, add_server):
if add_server:
return 'http://example.com/' + url
return url
class TestMultipartBuilder(TestCase):
def test_add(self):
mb ... | {
"content_hash": "8aea626892b0659ee7144503de7c2a1b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 94,
"avg_line_length": 31.093023255813954,
"alnum_prop": 0.5804038893044129,
"repo_name": "grokify/ringcentral-python",
"id": "84207013588483d20972a938daac44fd0440ea02",
"s... |
import time
from lib.sensors import OctopusDeploySensor
class NewDeploymentSensor(OctopusDeploySensor):
def __init__(self, sensor_service, config=None, poll_interval=None):
super(NewDeploymentSensor, self).__init__(
sensor_service=sensor_service,
config=config,
poll_in... | {
"content_hash": "19a8bde924cfb2ff5188d096b447d464",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 82,
"avg_line_length": 38.65882352941176,
"alnum_prop": 0.5602556299452222,
"repo_name": "psychopenguin/st2contrib",
"id": "1572da0a85cf9b99e533b6ce7eba2cdbee6a31f7",
"size... |
import collections.abc
from datetime import datetime
from math import ceil
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models.functions import Substr
from django.test import TestCase, skipUnlessDBFeature
from .models import (
Articl... | {
"content_hash": "60e8a9d683395c60d6cb7d57e8250ecf",
"timestamp": "",
"source": "github",
"line_count": 927,
"max_line_length": 118,
"avg_line_length": 45.678532901833876,
"alnum_prop": 0.5614254675987153,
"repo_name": "charettes/django",
"id": "666fadf262f53dc823649755bd7c308c636e0289",
"size": "4... |
from rally.common.i18n import _
from rally.common import logging
from rally.common import utils as rutils
from rally import consts
from rally import osclients
from rally.plugins.openstack.cleanup import manager as resource_manager
from rally.plugins.openstack.cleanup import resources as res_cleanup
from rally.plugins.o... | {
"content_hash": "ed2268d9a4aedb4df44f407738324c34",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 41.19607843137255,
"alnum_prop": 0.5437886720609234,
"repo_name": "eonpatapon/rally",
"id": "dd288650a51320d6e45cea6f0b6b59962c5b10c0",
"size": "480... |
"""
Created on Mon Feb 15 11:28:53 2016
@author: ih3
Wave class.
Core functions and classes that solve across a wave, or wave section.
"""
from __future__ import division
import numpy
from scipy.optimize import brentq
from scipy.integrate import odeint
from copy import deepcopy
from .state import State
def rarefact... | {
"content_hash": "7a1d46acfafe9081bbd50b6bc7590442",
"timestamp": "",
"source": "github",
"line_count": 948,
"max_line_length": 136,
"avg_line_length": 35.151898734177216,
"alnum_prop": 0.5547353258912495,
"repo_name": "harpolea/r3d2",
"id": "ae8c39abd64eacb41655609f66a3377c63cc2f5b",
"size": "3334... |
import json
import pytest
HEALTH_PATH = '/management/health'
@pytest.mark.parametrize("https", [True, False])
def test_get_health(client, https):
base_url = '%s://localhost' % ('https' if https else 'http')
# Invalid credentials
response = client.get(
HEALTH_PATH,
base_url=base_url
... | {
"content_hash": "ea09c11afc861fa91c141eb2f9f54032",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 64,
"avg_line_length": 22.3,
"alnum_prop": 0.647982062780269,
"repo_name": "EclecticIQ/OpenTAXII",
"id": "2577e2f2a6c6859a8fecd94fe7ef8fc6055799e9",
"size": "446",
"binar... |
import agol
import ags
from security import *
from common import *
import _abstract
import web
import manageorg
import manageags
import manageportal
import hostedservice
#import webmap
from geometryservice import *
__version__ = "2.0.100" | {
"content_hash": "a52a10bda971203e409e73e774e5db9a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 29,
"avg_line_length": 18.307692307692307,
"alnum_prop": 0.8067226890756303,
"repo_name": "achapkowski/ArcREST",
"id": "ecd74a438371f9e0b406f2cb1df136bfb1a4c955",
"size": "... |
from __future__ import annotations # isort:skip
import pytest ; pytest
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
import re
import warnings
# Bokeh imports
from bok... | {
"content_hash": "ba3e6f23acfc39ad00d5f73597dcd6a8",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 85,
"avg_line_length": 38.41121495327103,
"alnum_prop": 0.5630170316301704,
"repo_name": "bokeh/bokeh",
"id": "913899e8c201e399bcb73202df63a3bc2ae14a94",
"size": "4614",
... |
"""
core
~~~~
Core functionality shared between the extension and the decorator.
:copyright: (c) 2022 by Ashley Sommer (based on flask-cors by Cory Dolphin).
:license: MIT, see LICENSE for more details.
"""
import re
import logging
import collections
from datetime import timedelta
from typing impor... | {
"content_hash": "201fcd88e31dc10dd31c5261c8356cc1",
"timestamp": "",
"source": "github",
"line_count": 406,
"max_line_length": 112,
"avg_line_length": 37.57881773399015,
"alnum_prop": 0.6366258111031002,
"repo_name": "ashleysommer/sanic-cors",
"id": "fbe53d781d4cbe9f30650306188d9ed9580166a8",
"siz... |
import furnitureList as fl
import random
import warnArea
import constants
from vector import *
def addPlacedFurniture(placedFurniture, furniture, warnAreas):
placedFurniture.append(furniture)
#Add a warn area for the furniture
warnArea.addWarnArea( warnAreas,
(
fl.getCorne... | {
"content_hash": "b8f131bded08b534c23d7035a6ea74c9",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 111,
"avg_line_length": 31.427906976744186,
"alnum_prop": 0.5680035518721326,
"repo_name": "TheZoq2/VRHack",
"id": "83ea964fc9d5e4ab59a2491e5fd69e1903f912cb",
"size": "675... |
""" Title: Ch3LpfVarIt - Chapter 3: Low-pass filter: Resulution vs. Iterations
Author: Ricardo Alejos
Date: 2016-09-20
Description: Runs optimizations over the LPF varying its resolution and the
Simulated Annealing's iterations.
Version: 1.0.0
Comments: -
"""
# Import Py... | {
"content_hash": "b48bbcc33bb7deb2f5983f67ede072ea",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 98,
"avg_line_length": 35.656565656565654,
"alnum_prop": 0.5487252124645893,
"repo_name": "ricardoalejos/RalejosMsrElcDsn",
"id": "8192248725fbb8fdba60bc7fe39ba122d01d8634",
... |
"""
A simple renderer for HTML to plain text. It knows about <p>, <div>,
and <blockquote>; all other markup is ignored.
Paragraphs are collected and wrapped. Blockquotes are indented.
Paragraphs cannot be nested at this time. HTML entities are
substituted. Usually this should only be used with markup that is
inten... | {
"content_hash": "c72ca18ce2f1139eb7708c81225e9baa",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 72,
"avg_line_length": 30.415151515151514,
"alnum_prop": 0.518581249377304,
"repo_name": "kevinrenskers/django-generic-mail",
"id": "7cd2fdb92d5b1e2740b8337cf432b55e2e89d852... |
"""Sample integration test module."""
# pylint: disable=no-self-use,missing-docstring
# from cf_predict import create_app
| {
"content_hash": "6e0c906136b8875cee2485d105b39fa0",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 47,
"avg_line_length": 30.75,
"alnum_prop": 0.7560975609756098,
"repo_name": "ronert/cf-predict",
"id": "28521fdc7a4fdc946687837b1c0ccb6ed445d099",
"size": "123",
"binary"... |
import sys
import io
import paramiko
import os
import re
from config import (ConfigSectionMap)
my_ssh_client = None
def open_ssh_client():
ssh_host = ConfigSectionMap("Backup")['sshhost']
ssh_port = ConfigSectionMap("Backup")['sshport']
ssh_username = ConfigSectionMap("Backup")['sshusername']
print "... | {
"content_hash": "ba8b75c355151e52f3be83af57cbdff6",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 135,
"avg_line_length": 33.10204081632653,
"alnum_prop": 0.6329634196465269,
"repo_name": "JayanthyChengan/dataverse",
"id": "3355b9cffb20656ff74871d2306c796a0514bc4a",
"s... |
import edl.batch
def test_chunk_size_calcs():
assert edl.batch.calculateChunkSize(100,100,10) == 10
assert edl.batch.calculateChunkSize(1000,100,10) == 100
assert edl.batch.calculateChunkSize(100,100,9) == 12
assert edl.batch.calculateChunkSize(1000,1000,9) == 112
| {
"content_hash": "431c0a6f078958d6ae857bde63b5a201",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 59,
"avg_line_length": 36,
"alnum_prop": 0.7152777777777778,
"repo_name": "jmeppley/py-metagenomics",
"id": "aa2694ba5f761b01473899358f1cff00eebfe852",
"size": "288",
"bin... |
import os
import sys
import subprocess
from datetime import datetime
# third-party imports
import six
import psutil
# using psutil.Process.wait() in unconventional manner
from psutil import TimeoutExpired as ProcessNotFinished
def source(script, old_env=None):
"""Emulates source in bash and returns the resulting... | {
"content_hash": "34e92228eb597bcf958dcdb85161044e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 111,
"avg_line_length": 33.96621621621622,
"alnum_prop": 0.6150785756912671,
"repo_name": "davidchall/nrtest",
"id": "66ae6160e070dd57ae423c56782df2a913147be1",
"size": "5... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# @lint-avoid-pyflakes2
# @lint-avoid-pyflakes3
import unittest
import math
from thrift.protocol import TSimpleJSONProtocol
from thrift.transport.TTransport import TMem... | {
"content_hash": "aa28b279c702e2acb2007abdb1813a82",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 76,
"avg_line_length": 38.75694444444444,
"alnum_prop": 0.5826912739652392,
"repo_name": "getyourguide/fbthrift",
"id": "9e55f1f6063b96281250c1646f351ee9589b20cd",
"size":... |
import urllib2
import json
from time import time
from plugins.plugin import Plugin
from bytebot_config import BYTEBOT_HTTP_TIMEOUT, BYTEBOT_HTTP_MAXSIZE
from bytebot_config import BYTEBOT_PLUGIN_CONFIG
class fuel(Plugin):
def __init__(self):
pass
def registerCommand(self, irc):
irc.registe... | {
"content_hash": "cb5e2957aa95b481f73ab71493c4b127",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 31.07070707070707,
"alnum_prop": 0.49479843953185954,
"repo_name": "petrk94/Bytebot",
"id": "60a6eea1f9dadca8c23e2d7cf54c7feea8829514",
"size": "3124... |
import numpy as np
def shaped_range(*shape, dtype=np.float32):
r = np.arange(np.prod(shape))
r = r.reshape(shape)
return r
def _increasing_impl(*shape, dtype=np.float32, negative=True, bias=0):
r = shaped_range(*shape, dtype=dtype)
if negative:
r -= r.size // 2
if dtype in (np.float3... | {
"content_hash": "5ca02034d51263ed2b137738bf0935fe",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 77,
"avg_line_length": 31.26086956521739,
"alnum_prop": 0.631432545201669,
"repo_name": "pfnet/chainer",
"id": "0d4010c91a6282ab8acbbb9e0ecb92b0ad06f6e2",
"size": "2876",
... |
def test_spam(spam):
assert spam == "spamspam"
| {
"content_hash": "817272b88d5647f3242ecc7f7096e02f",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 25.5,
"alnum_prop": 0.6470588235294118,
"repo_name": "kawamon/hue",
"id": "65690c49f23153fdd3c631e6c9a08825fe222c8a",
"size": "75",
"binary": false,... |
from nose.tools import (assert_false, assert_equal, assert_in, assert_true)
import mock
import pytest
import unittest
import httplib as http
from addons.base.tests.views import OAuthAddonConfigViewsTestCaseMixin
from addons.dataverse.models import DataverseProvider
from addons.dataverse.tests.utils import (
crea... | {
"content_hash": "95f4ad3601f712abc9a0cd9724c22a57",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 102,
"avg_line_length": 41.226229508196724,
"alnum_prop": 0.6550819150628281,
"repo_name": "cwisecarver/osf.io",
"id": "1ae817c80de1794831fecf68909d8ca3bbb81d3b",
"size": ... |
import base64
import json
import logging
import re
import StringIO
import urllib
from avro import datafile, io
from django.utils.translation import ugettext as _
from desktop.lib.django_util import JsonResponse, render
from hbase import conf
from hbase.settings import DJANGO_APPS
from hbase.api import HbaseApi
from... | {
"content_hash": "51b40c60a5462c6f684c36de80156c66",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 111,
"avg_line_length": 30.048,
"alnum_prop": 0.6094249201277955,
"repo_name": "azureplus/hue",
"id": "9477efc9d12cf54586174af2ff13246e5a31e075",
"size": "4549",
"binary... |
import unittest
from pushalot.factory import PushalotFactory
from pushalot.apis import APILatest
from pushalot.transport import HTTPTransport
class DummyAPI(object):
pass
class DummyTransport(object):
pass
class FactoryTests(unittest.TestCase):
def test_without_token_raises_exception(self):
wit... | {
"content_hash": "a052622aa3b7779f922817caf0f13e66",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 81,
"avg_line_length": 29.050847457627118,
"alnum_prop": 0.6306884480746792,
"repo_name": "bosha/pypushalot",
"id": "b11b398339ed5c092ec103fd1d341a1eb1c49e49",
"size": "171... |
''' Document Bokeh named colors.
The ``bokeh-color`` directive accepts a named color as its argument:
.. code-block:: rest
.. bokeh-color:: aliceblue
and generates a labeled color swatch as output.
.. bokeh-color:: aliceblue
The ``bokeh-color`` direction may be used explicitly, but it can also be used
in ... | {
"content_hash": "8351562ac1e7e73593bfdf4a1f1c525c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 84,
"avg_line_length": 30.404761904761905,
"alnum_prop": 0.3962411902897416,
"repo_name": "timsnyder/bokeh",
"id": "b35e9419b1313cb93e771c358ec55caba717b3da",
"size": "2885... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/squill/shared_lair_squill.iff"
result.attribute_template_id = -1
result.stfName("lair_n","squill")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "e5b50a74109032c2b089bf5702d070ae",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 22.692307692307693,
"alnum_prop": 0.688135593220339,
"repo_name": "obi-two/Rebelion",
"id": "d9ac81d2ead3571600979d95b951db53fa1f60e8",
"size": "440"... |
from cms.tests.static_analysis import StaticAnalysisTest # nopyflakes
from cms.tests.admin import * # nopyflakes
from cms.tests.api import * # nopyflakes
from cms.tests.apphooks import * # nopyflakes
from cms.tests.docs import * # nopyflakes
from cms.tests.extensions import * # nopyflakes
from cms.tests.forms imp... | {
"content_hash": "83b3901089f3fa62992c7ce35b61b47d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 47.2,
"alnum_prop": 0.7660075329566854,
"repo_name": "SurfasJones/icecream-info",
"id": "057e126a9c094c334f0320697b4715a0209ccf63",
"size": "2149",
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import time
from .termcolor import TermColor
from . import printer_console
prcolor = printer_console.prcolor
def plog(tag, msg, showtime = True, showdate = False,
prefix = '', suffix = '', fg = TermColor.... | {
"content_hash": "fc49f6c62d9a027d060b7ee475d5b600",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6540350877192982,
"repo_name": "liuycsd/bypy",
"id": "8f9575e1cc01f69c902ebf43631b1324cade102d",
"size": "1556",
... |
import unittest
import fern
from fern.ast import NameRef
class BasicNameref(unittest.TestCase):
'''Sans actual name lookups'''
def setUp(self):
self.nr = fern.ast.NameRef('name')
def testNameMatches(self):
self.assertEqual(self.nr.name, 'name')
class SimpleLookup(unittest.TestCase):
de... | {
"content_hash": "a95687e108935f5512b212f6e3fcb5ad",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 71,
"avg_line_length": 33.44444444444444,
"alnum_prop": 0.5804461319411486,
"repo_name": "andrewf/fern",
"id": "a0d2356b8f3583c0ae5b54c875904879cc061301",
"size": "2107",
... |
import os
import tempfile
import logging
import datetime
from azure.storage.blob import blockblobservice
from luigi.format import get_default_format
from luigi.target import FileAlreadyExists, FileSystem, AtomicLocalFile, FileSystemTarget
logger = logging.getLogger('luigi-interface')
class AzureBlobClient(FileSyst... | {
"content_hash": "d5ca2e0c561289414982c8b51492445c",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 160,
"avg_line_length": 46.123636363636365,
"alnum_prop": 0.640807316304005,
"repo_name": "jamesmcm/luigi",
"id": "20de24224a4670810a2e5a5f8b7d258b25111828",
"size": "1330... |
"""Symbolic configuration API of MXNet."""
from __future__ import absolute_import as _abs
try:
from __builtin__ import slice as py_slice
except ImportError:
from builtins import slice as py_slice
from array import array
import ctypes
import warnings
from numbers import Number
import numpy as _numpy
from ..at... | {
"content_hash": "bb2d0db68e24ccffd848192e2ea7ff34",
"timestamp": "",
"source": "github",
"line_count": 3088,
"max_line_length": 100,
"avg_line_length": 36.21794041450777,
"alnum_prop": 0.553902415035631,
"repo_name": "dmlc/mxnet",
"id": "0c0a0a1e3c885a5f6dff1b773be049d2da574503",
"size": "112778",... |
import unittest
from autothreadharness.harness_case import HarnessCase
class Commissioner_8_1_1(HarnessCase):
role = HarnessCase.ROLE_COMMISSIONER
case = '8 1 1'
golden_devices_required = 1
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "612b1eefe0fe8945195f7389f264f11a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 19.25,
"alnum_prop": 0.6688311688311688,
"repo_name": "turon/openthread",
"id": "32b09f7407b5f03a3ae0a5805d6b53dacb1f75a5",
"size": "1890",
"binary... |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv('Churn_Modelling.csv')
X = dataset.iloc[:, 3:13].values
y = dataset.iloc[:, -1].values
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
labelEncoder_X_1 = LabelEncoder()
X[:,1] = labelEnco... | {
"content_hash": "209ad5a4653a4e08772bab4cde13b97a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 92,
"avg_line_length": 29.681159420289855,
"alnum_prop": 0.74169921875,
"repo_name": "jigargandhi/UdemyMachineLearning",
"id": "05e33ce45e6065acf2a353f5f55c045a3fd39334",
"... |
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='AnonymEmail',
fields=[
... | {
"content_hash": "dd7168a749d14decc061c902de8d7a82",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 31.724137931034484,
"alnum_prop": 0.5489130434782609,
"repo_name": "cjlee112/socraticqs2",
"id": "1255022853acecbb3ebc15bcb0cbb55950fa3bd6",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.