text stringlengths 4 1.02M | meta dict |
|---|---|
import random
import trigger
from animation import animate_point
import colors
from compositecore import Leaf
import gametime
from graphic import GraphicChar
import icon
import messenger
from statusflags import StatusFlags
# TODO: Idea replace effect types with spoofchildren and add time to live to spoof children.
... | {
"content_hash": "3c787c566d803d1b87ff0fa6d6ea3c2b",
"timestamp": "",
"source": "github",
"line_count": 575,
"max_line_length": 121,
"avg_line_length": 44.697391304347825,
"alnum_prop": 0.5963581183611533,
"repo_name": "co/TheLastRogue",
"id": "06568ef5454d36e098c9d8f9a7175c503ddb6941",
"size": "25... |
from tournament_of_lulz.database.database import fetchall
from tournament_of_lulz.modules.image.model_image import ModelImage
class ModelTopImages():
def __init__(self, db_connection):
self.db_connection = db_connection
self.top_images = []
def load_top_images(self, start, limit):
sel... | {
"content_hash": "a98c2c91828719bad5ebb75cfc3decf8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 113,
"avg_line_length": 30.892857142857142,
"alnum_prop": 0.5676300578034682,
"repo_name": "xaroth8088/tournament-of-lulz",
"id": "bc9e6097cf017e6d6c621209552a27854fff229d",
... |
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from django.http import HttpResponse
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.views.static import serve
logger = logging.getLogger(_... | {
"content_hash": "d6a1243e3be7c5e30dae2a09e9372a9d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 69,
"avg_line_length": 32.04347826086956,
"alnum_prop": 0.7150610583446404,
"repo_name": "yeleman/snisi",
"id": "29c99a5a075b30b106126159f7316014074389e6",
"size": "816",
... |
"""
This file helps to test graphql queries and verify that the "big picture" works
"""
import string
import random
import pytest
from graphene.test import Client
from BuyBitcoin.graphene_schema import SCHEMA
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from trading.models ... | {
"content_hash": "81820371ebbbad41b9882e70d30ca8ee",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 99,
"avg_line_length": 33.09843400447427,
"alnum_prop": 0.5660696181142277,
"repo_name": "jomivega/ASE4156",
"id": "0b9c40424c394ed6369ed9a479df63ef785afe12",
"size": "147... |
"""Trains the MNIST network using preloaded data in a constant.
Run using bazel:
bazel run -c opt \
<...>/tensorflow/examples/how_tos/reading_data:fully_connected_preloaded
or, if installed via pip:
cd tensorflow/examples/how_tos/reading_data
python fully_connected_preloaded.py
"""
from __future__ import absol... | {
"content_hash": "38431cc6224b1358400d47d7e2f223a3",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 80,
"avg_line_length": 32.96478873239437,
"alnum_prop": 0.6569109164708395,
"repo_name": "petewarden/tensorflow_makefile",
"id": "d08a15433a9c3a99d1cc301d55920170cc1f941f",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import django.db.models.deletion
from django.conf import settings
import common.models.base
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(se... | {
"content_hash": "1c3b7974bbbc789f5f9715461ab13ffd",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 197,
"avg_line_length": 49.58974358974359,
"alnum_prop": 0.6339193381592554,
"repo_name": "MasterFacilityList/mfl_api",
"id": "3db16a983e02c7a006a4d46c809b3e25b5a59a30",
"s... |
import RPi.GPIO as gpio
import time
import sys
import Tkinter as tk
def init():
gpio.setmode(gpio.BOARD)
gpio.setup(7, gpio.OUT)
gpio.setup(11, gpio.OUT)
gpio.setup(13, gpio.OUT)
gpio.setup(15, gpio.OUT)
def forward(tf):
gpio.output(7, False)
gpio.output(11, True)
gpio.output(13, True)... | {
"content_hash": "dfa1b51dddb628cd4a15d4db43392873",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 37,
"avg_line_length": 20.770114942528735,
"alnum_prop": 0.6048699501936912,
"repo_name": "PythonProgramming/Robotics-with-Raspberry-Pi",
"id": "0e64def44a33c5802efb03c3972e8... |
from horizon import views
class IndexView(views.HorizonTemplateView):
template_name = 'admin/plugin_panel/index.html'
page_title = 'Plugin-based Panel'
class TestBannerView(views.HorizonTemplateView):
template_name = 'admin/plugin_panel/header.html'
def get_context_data(self, **kwargs):
con... | {
"content_hash": "5bb67cc5be1352cd7a7757f897c292ea",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 28.25,
"alnum_prop": 0.7079646017699115,
"repo_name": "noironetworks/horizon",
"id": "a5c18fda40ca53826e82d03b5c5b53cbb36617eb",
"size": "1025",
"b... |
"""
:synopsis: Parent crawler module, which supervises all crawlers.
Contains functions for initializing all subsidiary, threaded crawlers.
"""
import logging
import logging.handlers
import os
import Queue
import sys
import time
from threading import Event
from .crawler import GitHubCrawler, BitbucketCrawler
from .i... | {
"content_hash": "bf42976f8a968e9891f4ae907079ed20",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 29.106382978723403,
"alnum_prop": 0.6363304093567251,
"repo_name": "earwig/bitshift",
"id": "fafd017bbc8d8995193fd046b9aabd72e2a85439",
"size": "2736... |
"""OpenGL version 1.3 imaging-handling routines"""
from OpenGL import wrapper, constants, arrays
from OpenGL.raw.GL.VERSION import GL_1_3 as simple
from OpenGL.GL import images, glget
for dimensions in (1,2,3):
for function in ('glCompressedTexImage%sD','glCompressedTexSubImage%sD'):
name = function%(dimen... | {
"content_hash": "af043ecb9705bd9f0bfff864f65b5544",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 85,
"avg_line_length": 35.733333333333334,
"alnum_prop": 0.6315298507462687,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "dd1cb79c9061d1ff3b310d9910ffb9fb307ef8fb... |
#=============================================================================#
# Class definitions for the AST nodes which comprise the type language for
# which types will be inferred
class Lam(object):
"""Lambda abstraction"""
def __init__(self, v, body):
self.v = v
self.body... | {
"content_hash": "08b2cbd279daf8d97d1444ca83a7251a",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 79,
"avg_line_length": 30.268115942028984,
"alnum_prop": 0.5776075333173729,
"repo_name": "silky/hask",
"id": "9dffd3995fba74ba2239b510ef6164ac5068999b",
"size": "13402",
... |
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestError
from os import en... | {
"content_hash": "88af33eb7c4d9e9e262a9534d2348cd7",
"timestamp": "",
"source": "github",
"line_count": 518,
"max_line_length": 134,
"avg_line_length": 36.9034749034749,
"alnum_prop": 0.5551370579619167,
"repo_name": "kbase/feature_values",
"id": "156d02a099a3ee94be10e06ddab8a34e691a390f",
"size": ... |
from django.apps import AppConfig
class CnbetaapisConfig(AppConfig):
name = 'CnbetaApis'
| {
"content_hash": "04531452afa7aa4c60be0157b73abdf7",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 19,
"alnum_prop": 0.7684210526315789,
"repo_name": "kagenZhao/cnBeta",
"id": "fd1a26dd0899443c9ab00a9da5f04a29e14344f9",
"size": "119",
"binary": fa... |
import cv2
import sys
def edge_detect(infile, nogui=False):
# The first argument is the image
image = cv2.imread(infile)
#conver to grayscale
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
#blur it
blurred_image = cv2.GaussianBlur(gray_image, (7,7), 0)
# Use low thresholds
canny = c... | {
"content_hash": "debb07bd3c23176850f0da32bca71575",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 58,
"avg_line_length": 27,
"alnum_prop": 0.6392318244170097,
"repo_name": "shantnu/PyEng",
"id": "a7d9f3a592a2baa08cc885ad3ff7944d36ffe0a6",
"size": "729",
"binary": fals... |
"""Admins for the models of the ``paypal_express_checkout`` app."""
import django
from django.contrib import admin
from . import models
try:
user_model = django.contrib.auth.get_user_model()
except AttributeError:
user_model = django.contrib.auth.models.User
username_field = getattr(user_model, 'USERNAME_FI... | {
"content_hash": "f1933594de239a8a59de50aab2cf6fae",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 77,
"avg_line_length": 29.03157894736842,
"alnum_prop": 0.6388687454677302,
"repo_name": "bitmazk/django-paypal-express-checkout",
"id": "b1ba6dffc2d17d9068b75151cb8af5f047c8... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "13ce1e80dca2707df37cce94db2b7371",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 124,
"avg_line_length": 32.391891891891895,
"alnum_prop": 0.6065915727993325,
"repo_name": "kubernetes-client/python",
"id": "6364b331146f0810cfdbc2b26f2537714fd2c5f3",
"s... |
"""Module for testing the del metacluster command."""
import unittest
if __name__ == "__main__":
import utils
utils.import_depends()
from brokertest import TestBrokerCommand
class TestDelMetaCluster(TestBrokerCommand):
def testdelutmc1(self):
command = ["del_metacluster", "--metacluster=utmc1... | {
"content_hash": "6c72bfc7cba792087de0ca67528a160e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 75,
"avg_line_length": 34.72093023255814,
"alnum_prop": 0.6560616208975217,
"repo_name": "jrha/aquilon",
"id": "d5316e701ffa767fb98727f62a4fbb2c910c57e6",
"size": "3714",
... |
import json
import os
import unittest
from conans.client import tools
from conans.client.runner import ConanRunner
from conans.model.ref import ConanFileReference
from conans.paths import RUN_LOG_NAME
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.test.utils.test_files import temp_folde... | {
"content_hash": "8cc8691bfafbbbfa3a4799857323ddb3",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 99,
"avg_line_length": 47.17424242424242,
"alnum_prop": 0.6157057973341898,
"repo_name": "memsharded/conan",
"id": "7430c6fb1b1d2cf040bb3626edc991356acd8e13",
"size": "622... |
"""Test for the ee.geometry module."""
import unittest
import ee
from ee import apitestcase
class GeometryTest(apitestcase.ApiTestCase):
def testValid_Point(self):
"""Verifies Point constructor behavior with valid arguments."""
self.assertValid(1, ee.Geometry.Point, [1, 2])
self.assertValid(1, ee.G... | {
"content_hash": "20c19e2b08d4668e72336ba68696e4ba",
"timestamp": "",
"source": "github",
"line_count": 495,
"max_line_length": 80,
"avg_line_length": 36.73939393939394,
"alnum_prop": 0.6293852413944793,
"repo_name": "google/earthengine-api",
"id": "95e103e2f4ccb7ed13d1f086ba73f2bb67cf1f81",
"size"... |
"""
An example for wrapping ec based modules.
"""
from ec import interface
import simple # the ec-ed script
interface.setBase(simple)
interface.call('task1 arg2=1', True)
# #Pending: Add example for other interface calls.
| {
"content_hash": "91efe105ce8f43048546cf00cc8fdc3c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 50,
"avg_line_length": 17.46153846153846,
"alnum_prop": 0.7400881057268722,
"repo_name": "Laufire/ec",
"id": "b8a42656723904222c2c95778c615cfdf4e74c29",
"size": "227",
"b... |
"""Use operations learned with learn_bpe.py to encode a new text.
The text will not be smaller, but use only a fixed vocabulary, with rare words
encoded as variable-length sequences of subword units.
Reference:
Rico Sennrich, Barry Haddow and Alexandra Birch (2015). Neural Machine Translation of Rare Words with Subwor... | {
"content_hash": "59f33e9a97c3c22a401c10adea1ed8f6",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 116,
"avg_line_length": 31.57051282051282,
"alnum_prop": 0.6008121827411167,
"repo_name": "yang1fan2/nematus",
"id": "c2a535f3325a3027d5119d96d53532add2593d77",
"size": "4... |
"""
Represents an EC2 Object
"""
from boto.ec2.tag import TagSet
class EC2Object(object):
def __init__(self, connection=None):
self.connection = connection
if self.connection and hasattr(self.connection, 'region'):
self.region = connection.region
else:
self.region =... | {
"content_hash": "c791e09f691dcf7f7a8ca313f3065c90",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 77,
"avg_line_length": 31.7375,
"alnum_prop": 0.5931469082315872,
"repo_name": "drawquest/drawquest-web",
"id": "6e375961ee56d7e5941f23687b84cbeca68e342d",
"size": "3691",
... |
from mi.dataset.driver.metbk_a.dcl.metbk_dcl_a_driver import process, \
TELEMETERED_PARTICLE_CLASS
from mi.core.versioning import version
@version("15.6.1")
def parse(basePythonCodePath, sourceFilePath, particleDataHdlrObj):
process(sourceFilePath, particleDataHdlrObj, TELEMETERED_PARTICLE_CLASS)
return ... | {
"content_hash": "840b56aa162b5e7755d11f2742b77713",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 76,
"avg_line_length": 34,
"alnum_prop": 0.8,
"repo_name": "JeffRoy/mi-dataset",
"id": "829934c027f2ce9c9e32e4cb05f54607d0e05b7e",
"size": "423",
"binary": false,
"copi... |
from .viewport_helpers import compute_view # noqa
from .type_checking import has_geo_interface, is_pandas_df, records_from_geo_interface # noqa
from .color_scales import assign_random_colors # noqa
| {
"content_hash": "e83e8d3b84f0ede6569afc251f730f07",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 94,
"avg_line_length": 67,
"alnum_prop": 0.7810945273631841,
"repo_name": "uber-common/deck.gl",
"id": "e40bbfbd3e35b862bb37ab8bf782e72ea1fee334",
"size": "201",
"binary":... |
"""Tests for options manager for :class:`Poly` and public API functions. """
from sympy.polys.polyoptions import (
Options, Expand, Gens, Wrt, Sort, Order, Field, Greedy, Domain,
Split, Gaussian, Extension, Modulus, Symmetric, Strict, Auto,
Frac, Formal, Polys, Include, All, Gen, Symbols, Method)
from sym... | {
"content_hash": "da6f3bec9442107a7caae72e473ac524",
"timestamp": "",
"source": "github",
"line_count": 477,
"max_line_length": 79,
"avg_line_length": 25.163522012578618,
"alnum_prop": 0.6435057902191119,
"repo_name": "amitjamadagni/sympy",
"id": "06d7c4adcdd6d783592286927418055af570908c",
"size": ... |
import httparchive
import httplib
import httpproxy
import threading
import unittest
import util
class MockCustomResponseHandler(object):
def __init__(self, response):
"""
Args:
response: An instance of ArchivedHttpResponse that is returned for each
request.
"""
self._response = response
... | {
"content_hash": "038bfead32d5664988af7446698af73d",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 80,
"avg_line_length": 34.96035242290749,
"alnum_prop": 0.6622983870967742,
"repo_name": "catapult-project/catapult-csm",
"id": "ff341809d8eb260dee32a96aec7cf0ac11e4e9dc",
... |
import vim, re
import heapq
_escape = dict((c , "\\" + c) for c in ['^','$','.','{','}','(',')','[',']','\\','/','+'])
def CtrlPPyMatch():
items = vim.eval('a:items')
astr = vim.eval('a:str')
lowAstr = astr.lower()
limit = int(vim.eval('a:limit'))
mmode = vim.eval('a:mmode')
aregex = int(vim.e... | {
"content_hash": "486d864555e4c3327a9509b01bd4cb42",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 100,
"avg_line_length": 32.174418604651166,
"alnum_prop": 0.5514998192988797,
"repo_name": "FelikZ/ctrlp-py-matcher",
"id": "a819deae40ec4949823bf3ef798b8efbfb82fecf",
"siz... |
import inspect
import os
import sys
import unittest
import numpy as np
import numpy.testing as nptest
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import statistics
import stubs
import util
class Statistic... | {
"content_hash": "ae9feda43d4e83420b7954dfa9fae5af",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 86,
"avg_line_length": 25.3,
"alnum_prop": 0.7061923583662714,
"repo_name": "c4fcm/WhatWeWatch-Analysis",
"id": "a34c3440109210c279d13e5d7aa17a063019754c",
"size": "759",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
try:
import cPickle as pickle
except:
import pickle
import numpy as np
import scipy.misc
IMAGE_SIZE = 32
def to_one_hot(y, num_label):
"""Converts a one-dimensional label array to a two-dime... | {
"content_hash": "5e1d82b169055961932a666c30d465ee",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 82,
"avg_line_length": 34.10497237569061,
"alnum_prop": 0.6588368702413737,
"repo_name": "cuongdtnguyen/poster-reader",
"id": "3f18295f50e86d1f09b33ca3c15800a55b15f84e",
"... |
import time
from twitter.common import app, log
from twitter.common.app.modules.http import RootServer
from twitter.common.log.options import LogOptions
from twitter.common.metrics import RootMetrics
from twitter.common.examples.pingpong import PingPongServer
app.add_option('--target_host', default='localhost',
... | {
"content_hash": "7d7adfcec85d10af0824dc1a42d3213b",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 69,
"avg_line_length": 28.87878787878788,
"alnum_prop": 0.7429171038824763,
"repo_name": "Yasumoto/commons",
"id": "1f8bb5e17de53bcf3eecd829ca3159550dd9d6be",
"size": "953"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0016_user_background'),
]
operations = [
migrations.RemoveField(
model_name='user',
name='short_description',
),
... | {
"content_hash": "41c640dd4a5446c44524a86909a2e9a6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 42,
"avg_line_length": 19.058823529411764,
"alnum_prop": 0.5895061728395061,
"repo_name": "jamesaud/se1-group4",
"id": "05bcf15f43cbefb249f7935e67155bdc1c0b30e8",
"size": "... |
from django.contrib import admin
# Register your models here.
| {
"content_hash": "5e69319c9e399be1c9cc9beede9c1c5a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 32,
"avg_line_length": 21,
"alnum_prop": 0.7936507936507936,
"repo_name": "wevote/WebAppPublic",
"id": "01c606da7e9775803aa1bd0442c5be2857ee4322",
"size": "147",
"binary":... |
import os
import sys
from os.path import abspath, dirname, join as path_join
from robot import run_cli
CURDIR = abspath(dirname(__file__))
LIBROOT = path_join(CURDIR, 'libs')
ESCAPED_CURDIR = CURDIR.replace(' ', '!')
DEFAULT_ARGS = '--escape space:! --variable PROJECTROOT:{root} {source}'.format(
root=ESCAPED_CU... | {
"content_hash": "a3657bec2b1264818f48671eb3a39293",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 80,
"avg_line_length": 26.347826086956523,
"alnum_prop": 0.6798679867986799,
"repo_name": "aknackiron/testdroid-samples",
"id": "0bba5febe6d335002026488503c021e86fb00405",
... |
import os
import unittest
import numpy
from cclib.bridge import cclib2openbabel
class OpenbabelTest(unittest.TestCase):
"""Tests for the cclib2openbabel bridge in cclib."""
def setUp(self):
self.path = os.path.abspath(os.path.dirname(__file__))
def test_makeopenbabel(self):
try:
... | {
"content_hash": "16c2af2b8a33bbdf0883feab5ed32ce6",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 92,
"avg_line_length": 37.3921568627451,
"alnum_prop": 0.6407970634504457,
"repo_name": "langner/cclib",
"id": "d82a30c5994079d1da24ec39e0d7b444782dcd41",
"size": "2105",
... |
from collections import OrderedDict
import functools
import re
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)
import pkg_resources
from google.api_core.client_options import ClientOptions
from google.api_core import exc... | {
"content_hash": "e6dd2491e3685a95c8ef599b60fad76a",
"timestamp": "",
"source": "github",
"line_count": 1058,
"max_line_length": 171,
"avg_line_length": 41.7069943289225,
"alnum_prop": 0.6156687667135022,
"repo_name": "googleapis/python-datastore",
"id": "bd96febe7643c3ab1c2563d2a055863fdd28f9f0",
... |
from thrift import Thrift
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from storm import Nimbus
from storm.ttypes import *
from storm.constants import *
class StormStatus:
def __init__(self,args):
self.nimbus_connected = False
s... | {
"content_hash": "7bcbc7c7e824b5378773a40fef19726d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 136,
"avg_line_length": 46.44871794871795,
"alnum_prop": 0.6160640353298371,
"repo_name": "keedio/nagios-hadoop",
"id": "288e6868872b57ab52f0064b260d51cac3aaa9e3",
"size": ... |
import json, requests, hmac
class Binance:
"""
Developed by Mark Horner with the intention to show how to use and interact the Binance API within Python
to be able to carry out tasks such as place orders, view orders, view balances and look at symbol depth etc.
As of 2017/10/18 the links to the... | {
"content_hash": "d136b7cade5ca0a5cd3f199f9990ce3c",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 115,
"avg_line_length": 44.59708737864078,
"alnum_prop": 0.5154021987591162,
"repo_name": "markhorner123/BinancePY",
"id": "081792b668d2f01ac4fe5acfa6b262c4a25c9b77",
"siz... |
"""
The Win32 clipboard uses a special format for handling HTML. The basic
problem that the special format is trying to solve is that the user can
select an arbitrary chunk of formatted text that might not be valid HTML.
For instance selecting half-way through a bolded word would contain no </b>
... | {
"content_hash": "883ccf10e4020b27ac53b0b00bee29e8",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 36.23474178403756,
"alnum_prop": 0.5234516714174656,
"repo_name": "tectronics/enso",
"id": "a9adc0ec241ac9550e15409308868d625168c211",
"size": "9263... |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy
from .._version import VERSION
if TYPE_CHECKING:
# pylint: disable=unused-import,ungro... | {
"content_hash": "8520b91d5f95a88955a196edccaf7caa",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 130,
"avg_line_length": 49.753846153846155,
"alnum_prop": 0.717687074829932,
"repo_name": "Azure/azure-sdk-for-python",
"id": "7b9398e33727dc5e69de61b8828116622e9adf94",
"s... |
import argparse
def print_file(input_file):
"""
Function opens a file and prints the
results to stdout.
@param input_file
"""
with open(input_file) as f:
for line in f:
print line
def main():
"""
First function to be run in a command-line program
... | {
"content_hash": "4f420890b3faab8a5c0743f3073209fa",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 90,
"avg_line_length": 27.20689655172414,
"alnum_prop": 0.6311787072243346,
"repo_name": "mikblack/python_introduction",
"id": "9e89b520e2e9be6c43454c4589391c9dc42efaa4",
"... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Font(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "isosurface.colorbar.title"
_path_str = "isosurface.colorbar.title.font"
_valid_props = {"color... | {
"content_hash": "eaa6159bda4bc3444e34297665b54c9f",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 82,
"avg_line_length": 37.54385964912281,
"alnum_prop": 0.5614485981308411,
"repo_name": "plotly/plotly.py",
"id": "7c93d93e3ce30a026c3a4b6c92256e6240b21432",
"size": "856... |
import sys
import unittest
import json
from libcloud.utils.py3 import httplib
from libcloud.dns.base import Record, Zone
from libcloud.dns.drivers.rcodezero import RcodeZeroDNSDriver
from libcloud.dns.types import ZoneDoesNotExistError, ZoneAlreadyExistsError
from libcloud.dns.types import RecordType
from libcloud.t... | {
"content_hash": "54e3a74e6e66a9c3f90cd8792dd36315",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 78,
"avg_line_length": 40.49740932642487,
"alnum_prop": 0.593654042988741,
"repo_name": "Scalr/libcloud",
"id": "a05140bde1e1e32415255e88074b7c3739b0a61d",
"size": "8565",... |
from django.db import models
class Model(models.Model):
created_at = models.DateTimeField(auto_now_add=True)
last_modified = models.DateTimeField(auto_now=True)
def _do_insert(self, manager, *a, **kw):
'''
This is required as part of the `insert...returning` hack.
All it does is r... | {
"content_hash": "568e62cd756b2fd60d6ef013e1650145",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 34.68421052631579,
"alnum_prop": 0.629742033383915,
"repo_name": "joealcorn/berth.cc",
"id": "00333214a9666a1f2aa43cb71330792a8f3afb36",
"size": "659... |
"""Test classes for errors.py"""
import pytest
import re
import sys
from tests import paths
from li.errors import LicenseError
def test_error_message_contains_wanted():
try:
raise LicenseError('foo')
except LicenseError:
_,e,_ = sys.exc_info()
assert hasattr(e, 'message')
ass... | {
"content_hash": "aa48538fd2f3922e5b2e5d416555072d",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 78,
"avg_line_length": 27.390243902439025,
"alnum_prop": 0.6206589492430988,
"repo_name": "goldsborough/li",
"id": "f0407c8e07fd9e5a67ee5a33fa7ae1cf2792d00b",
"size": "1170... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('halfwayapp', '0006_auto_20160224_1904'),
]
operations = [
migrations.AlterField(
model_name='participan... | {
"content_hash": "ddb560ce4ae42dacc90c883db907bc81",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 120,
"avg_line_length": 26.31578947368421,
"alnum_prop": 0.652,
"repo_name": "cszc/meethalfway",
"id": "1cec5f793f021d778b37d34f52ca3c12db061d5e",
"size": "572",
"binary"... |
from .views import ProjectViewSet
from rest_framework.routers import DefaultRouter
router = DefaultRouter()
router.register(r'projects', ProjectViewSet)
urlpatterns = router.urls
| {
"content_hash": "44980b6bdb2f8189bd37555397d50600",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 48,
"avg_line_length": 30,
"alnum_prop": 0.8277777777777777,
"repo_name": "paulsheridan/django-portfolio",
"id": "11616d87a74bba242c8f8f273649e464f7154a2f",
"size": "180",
... |
import _plotly_utils.basevalidators
class TitleValidator(_plotly_utils.basevalidators.TitleValidator):
def __init__(self, plotly_name="title", parent_name="surface.colorbar", **kwargs):
super(TitleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "745f00cde8fe399aa868644920b8ffb9",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 86,
"avg_line_length": 39.74193548387097,
"alnum_prop": 0.5430194805194806,
"repo_name": "plotly/python-api",
"id": "24d70939442383facd39d6184686680f765a9992",
"size": "123... |
import collections
import json
import re
from functools import partial
from itertools import chain
from django.core.exceptions import EmptyResultSet, FieldError
from django.db import DatabaseError, NotSupportedError
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import F, OrderBy, ... | {
"content_hash": "fecefd004380f722f7357c5abafd42c8",
"timestamp": "",
"source": "github",
"line_count": 2065,
"max_line_length": 88,
"avg_line_length": 42.42324455205811,
"alnum_prop": 0.5245879183598923,
"repo_name": "manhhomienbienthuy/django",
"id": "32b88c89604221d0acd49a2cbe112aec71952cfa",
"s... |
from thumbor.handlers import BaseHandler
class HealthcheckHandler(BaseHandler):
async def get(self):
self.set_header("Cache-Control", "no-cache")
self.write("WORKING")
async def head(self):
self.set_header("Cache-Control", "no-cache")
self.set_status(200)
| {
"content_hash": "1794391adf37a9b4a54cb6462c8156da",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 27.181818181818183,
"alnum_prop": 0.6588628762541806,
"repo_name": "gi11es/thumbor",
"id": "3b5b053c0bc38077310ba4a82189034da0b8367c",
"size": "551",... |
"""
This StaticWeb WSGI middleware will serve container data as a static web site
with index file and error file resolution and optional file listings. This mode
is normally only active for anonymous requests. When using keystone for
authentication set ``delay_auth_decision = true`` in the authtoken middleware
configur... | {
"content_hash": "f05a90a1cefc1328f26119a60ca1368a",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 79,
"avg_line_length": 43.90669371196755,
"alnum_prop": 0.5664787951584589,
"repo_name": "mjwtom/swift",
"id": "1bf16405ca4bfdda32102b3a61aff2150018dc43",
"size": "22241",... |
from django.contrib import admin
from .models import Profile
admin.site.register(Profile)
| {
"content_hash": "8f2fbf561065bf5f27c46e725809db37",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 15.5,
"alnum_prop": 0.8064516129032258,
"repo_name": "akoskaaa/dotprofile",
"id": "f045416366b537e869e70fc66a8d4bd40e1317dc",
"size": "93",
"binary"... |
"""
.. module:: mpl_get_data_hst
:synopsis: Returns HST spectral data as a JSON string through Randy's
mast_plot.pl service.
.. moduleauthor:: Scott W. Fleming <fleming@stsci.edu>
"""
import collections
from operator import itemgetter
from data_series import DataSeries
import requests
#--------------------
de... | {
"content_hash": "1e4ece735090016311828aa2ccf992a9",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 39.39,
"alnum_prop": 0.5384615384615384,
"repo_name": "openSAIL/MASTDataDelivery",
"id": "1bf8559141e7c72f1a3f6eb70bb23e41b9711bdd",
"size": "3939",... |
"""
Handles the queries.
"""
from attributes import IntegerField, DateTimeField
import redisco
from redisco.containers import SortedSet, Set, List, NonPersistentList
from exceptions import AttributeNotIndexed
from utils import _encode_key
from attributes import ZINDEXABLE
# Model Set
class ModelSet(Set):
def __ini... | {
"content_hash": "7a9c024d6e5267375c95566e12748f2f",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 79,
"avg_line_length": 32.06,
"alnum_prop": 0.511540860885839,
"repo_name": "iamteem/redisco",
"id": "a4acd1bd933a62a2381620b537886447a40c167c",
"size": "9618",
"binary"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product.has_image'
db.add_column('inventory_product', 'has_image', self.gf('django.db.models.fields.BooleanF... | {
"content_hash": "fe0d98af2fa385a2b2222921bccc36a5",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 181,
"avg_line_length": 77.96323529411765,
"alnum_prop": 0.5434311044044139,
"repo_name": "codepython/CollectorCity-Market-Place",
"id": "7d8313f14fb68f1871fad32f75ddafe91af... |
"""Package to provide compatibility with compat scripts."""
| {
"content_hash": "190c7dddb0ebdcbd92676365dc8dc4f1",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 59,
"avg_line_length": 60,
"alnum_prop": 0.7666666666666667,
"repo_name": "jayvdb/pywikibot-core",
"id": "1f9845bd7eebdc191b241f5849aa12ca7bae4a8b",
"size": "84",
"binary"... |
from __future__ import print_function
import errno
import filecmp
import glob
import os
import random
import re
import shutil
import stat
import subprocess
import sys
import tarfile
import tempfile
import time
import traceback
from color import Coloring
from git_command import GitCommand, git_require
from git_config i... | {
"content_hash": "74d67db47712130257535f4b5d7d155b",
"timestamp": "",
"source": "github",
"line_count": 2823,
"max_line_length": 102,
"avg_line_length": 31.40701381509033,
"alnum_prop": 0.5839480273397848,
"repo_name": "slfyusufu/repo",
"id": "50580880aaa19f1dd18d88d1cb649148e8b15621",
"size": "892... |
"""
Class for PXE bare-metal nodes.
"""
import datetime
import os
from oslo.config import cfg
from nova.compute import flavors
from nova import exception
from nova.openstack.common.db import exception as db_exc
from nova.openstack.common import fileutils
from nova.openstack.common import log as logging
from nova.ope... | {
"content_hash": "719552a1dc58e0fe0b3f9578641b3c03",
"timestamp": "",
"source": "github",
"line_count": 477,
"max_line_length": 79,
"avg_line_length": 38.18867924528302,
"alnum_prop": 0.5789964866051822,
"repo_name": "qwefi/nova",
"id": "21fc2ce47246055a8360cb4bc8e35ac4e12752a7",
"size": "18956",
... |
from yubikit.core import TRANSPORT, YUBIKEY
from yubikit.management import (
CAPABILITY,
FORM_FACTOR,
DeviceInfo,
DeviceConfig,
Version,
)
from yubikit.support import get_name
from typing import cast
def info(form_factor):
return DeviceInfo(
config=cast(DeviceConfig, None),
ser... | {
"content_hash": "7dfe466fbf1928946dd1e647cccdf83c",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 88,
"avg_line_length": 36.044444444444444,
"alnum_prop": 0.6532059186189889,
"repo_name": "Yubico/yubikey-manager",
"id": "a0e3160173c6e6c2892049d16a05e691e4cdad6e",
"size"... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | {
"content_hash": "27aef91c3a259352c7fa6cb8d4feb236",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 209,
"avg_line_length": 41.11864406779661,
"alnum_prop": 0.5946001648804616,
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"id": "a744202d662bc5ed27e1561a19a80dbe... |
from typing import MutableMapping, MutableSequence
from google.protobuf import timestamp_pb2 # type: ignore
import proto # type: ignore
__protobuf__ = proto.module(
package="google.cloud.osconfig.v1",
manifest={
"VulnerabilityReport",
"GetVulnerabilityReportRequest",
"ListVulnerabili... | {
"content_hash": "16eaacccfd432cc7dcf283f39c684b76",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 129,
"avg_line_length": 36.65060240963855,
"alnum_prop": 0.5894696471619548,
"repo_name": "googleapis/python-os-config",
"id": "f0d16b206e2ce96722d558e18778be23fd4d564e",
... |
import serial;
import sys;
AR_1 = 9600
AR_2 = 9601
class lightcontroller:
# Map out the number of the light to
# the channel on one of the two Arduino units.
# 0 -> 11 are the frst Arduino channels
# 20 -> 31 are the second Arduino channels
# The index is the 'light number', the value is the arduino channel
lig... | {
"content_hash": "a6780ff239eb810bba62af692ad23d11",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 102,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6385869565217391,
"repo_name": "KappaEtaKappa/Sound-2-Disco",
"id": "b6580dfe868970ce94fdae30999e803641855199",
... |
import glob
from st2tests.api import FunctionalTest
from st2tests.fixturesloader import get_fixtures_packs_base_path
__all__ = ["PackConfigSchemasControllerTestCase"]
PACKS_PATH = get_fixtures_packs_base_path()
CONFIG_SCHEMA_COUNT = len(glob.glob("%s/*/config.schema.yaml" % (PACKS_PATH)))
assert CONFIG_SCHEMA_COUNT... | {
"content_hash": "d7e09104e02e11caa5a13d8783aceb61",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 84,
"avg_line_length": 35.25,
"alnum_prop": 0.6377068557919622,
"repo_name": "Plexxi/st2",
"id": "a38c278f077d7f73a74e01c45e35384b37870328",
"size": "2320",
"binary": fal... |
import eventlet.queue
from oslo_log import log as logging
import oslo_messaging
from oslo_service import service
from osprofiler import profiler
from heat.common import context
from heat.common.i18n import _LE
from heat.common.i18n import _LI
from heat.common.i18n import _LW
from heat.common import messaging as rpc_m... | {
"content_hash": "3ab32128cd5161b70cb5333c8965617b",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 79,
"avg_line_length": 36.88059701492537,
"alnum_prop": 0.6023876972885471,
"repo_name": "cwolferh/heat-scratch",
"id": "f434b9ff9924a332701f5345ab61e7597fd721e1",
"size":... |
from datadog_checks.base import ConfigurationError
REQUIRED_QUERY_FIELDS = ['stat', 'metric_prefix']
def validate_query(query):
for field in REQUIRED_QUERY_FIELDS:
if field not in query:
raise ConfigurationError("Custom Query: {} missing required field: {}. Skipping".format(query, field))
| {
"content_hash": "205299ed3f25125118107f9cad596007",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 114,
"avg_line_length": 35.22222222222222,
"alnum_prop": 0.7097791798107256,
"repo_name": "DataDog/integrations-core",
"id": "ccbb13b51923703d5307a40ce4e21b36d205a2ed",
"siz... |
"""Test pushbullet integration."""
from collections.abc import Awaitable
from typing import Callable
from unittest.mock import MagicMock, patch
import aiohttp
from pushover_complete import BadAPIRequestError
import pytest
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMAIN
from homeassistant.component... | {
"content_hash": "194e42df1659084d4acaf5e841d0f515",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 87,
"avg_line_length": 31.944444444444443,
"alnum_prop": 0.6828985507246377,
"repo_name": "nkgilley/home-assistant",
"id": "7a8b02c93a0c6ce9225d06e383d48b449b209b09",
"siz... |
import TouchSQL
#theDatabase = TouchSQL.CSqliteDatabase.alloc().initInMemory()
theDatabase = TouchSQL.CSqliteDatabase.alloc().initWithPath_('/Users/schwa/Desktop/test.db')
theDatabase.open_(None)
# theStatement = TouchSQL.CSqliteStatement.alloc().initWithDatabase_string_(theDatabase, 'create table foo (name varchar(1... | {
"content_hash": "ba235c109c8161de0c05ce79ce8382d5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 143,
"avg_line_length": 36.4,
"alnum_prop": 0.7893772893772893,
"repo_name": "favormm/TouchSQL",
"id": "3b2230893f5ff82355db52719afa39316965d08b",
"size": "565",
"binary"... |
import mock
from rally.benchmark.scenarios.glance import utils
from rally.benchmark import utils as butils
from rally import exceptions as rally_exceptions
from rally.openstack.common.fixture import mockpatch
from tests.benchmark.scenarios import test_utils
from tests import fakes
from tests import test
BM_UTILS = 'r... | {
"content_hash": "89b0ee77309af5a831b8bf450761a448",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 46.01111111111111,
"alnum_prop": 0.5790871770103839,
"repo_name": "ytsarev/rally",
"id": "a4c2edbe64abd056707de835489588e3995e7134",
"size": "4739",
... |
from django.utils import timezone
from django.views.decorators.cache import cache_control
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.response import Response
from rest_framework.viewsets import ViewSet
from .scrapers import PharmacyGuardScraper
class PharmacyViewSet(ViewSet)... | {
"content_hash": "791ae02dab327e728b8f5b0ba4cfc1de",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 32.7037037037037,
"alnum_prop": 0.6749716874292185,
"repo_name": "zarautz/pagoeta",
"id": "a3b978edaf9c5dc99c6a356f4996f7f701555474",
"size": "883",
... |
import time
import cv2
import numpy as np
import shm
from vision import options
from vision.vision_common import (
draw_angled_arrow,
get_angle_from_rotated_rect,
Hierarchy,
is_clipping,
)
from vision.modules.base import ModuleBase
from mission.constants.config import bins as constants
CONTOUR_HEURIS... | {
"content_hash": "47d34489bc4ad867b144df11900694b0",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 102,
"avg_line_length": 36.02197802197802,
"alnum_prop": 0.5578096400244051,
"repo_name": "cuauv/software",
"id": "8a8087e84f2656cf44860aa30c2a8e7741491ff9",
"size": "6580... |
"""
Sets the chain ID for a PDB file.
usage: python pdb_chain.py -<chain> <pdb file>
example: python pdb_chain.py -A 1CTF.pdb
Author: {0} ({1})
This program is part of the PDB tools distributed with HADDOCK
or with the HADDOCK tutorial. The utilities in this package
can be used to quickly manipulate PDB files, with ... | {
"content_hash": "e8a830bd4941c97133135feeb3ca2f9b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 82,
"avg_line_length": 28.317307692307693,
"alnum_prop": 0.5456706281833617,
"repo_name": "Adrimel/pdb-tools",
"id": "20c6b37db3e6f59db89e90b7576af22c365dd656",
"size": "2... |
import uuid
from kubernetes_py import K8sNamespace, K8sConfig
from kubernetes_py.K8sExceptions import *
from kubernetes_py.models.v1.Namespace import Namespace
from kubernetes_py.models.v1.NamespaceSpec import NamespaceSpec
from kubernetes_py.models.v1.NamespaceStatus import NamespaceStatus
from kubernetes_py.models.v... | {
"content_hash": "19747e22889e40d20668934472cb3b1a",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 105,
"avg_line_length": 35.96455696202532,
"alnum_prop": 0.535196395889061,
"repo_name": "froch/kubernetes-py",
"id": "8120f69d583c366e54d2ed4aedb11862a40b8168",
"size": "... |
from optparse import OptionParser
from arc_hybrid import ArcHybridLSTM
import pickle, utils, os, time, sys
if __name__ == '__main__':
parser = OptionParser()
parser.add_option("--train", dest="conll_train", help="Annotated CONLL train file", metavar="FILE", default="../data/PTB_SD_3_3_0/train.conll")
parse... | {
"content_hash": "e9848877cdfd54fb3e4bc33ac0175ae2",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 193,
"avg_line_length": 61.18181818181818,
"alnum_prop": 0.6424591381872214,
"repo_name": "elikip/bist-parser",
"id": "5d0f75f4550c734fbc433ead29da82231e249e6b",
"size": "5... |
from django.shortcuts import render, get_object_or_404, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext, loader
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.contrib impor... | {
"content_hash": "21913ed2db01573b385fc2f3f2dd05c0",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 87,
"avg_line_length": 37.016129032258064,
"alnum_prop": 0.6671023965141613,
"repo_name": "cscanlin/munger-builder",
"id": "fa4c531ebafa4155e37baef34ee206262cf2c1ed",
"size... |
"""
Interfaces with Alarm.com alarm control panels.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.alarmdotcom/
"""
import logging
import re
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from ... | {
"content_hash": "40f815a38cb63bdadc912be8ad52ab06",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 32.976,
"alnum_prop": 0.6392527899078118,
"repo_name": "nugget/home-assistant",
"id": "4f2913771b1ee09fab9a3751888da09f6ac3876a",
"size": "4122",
... |
from . import dbapi20
import pymysql
from pymysql.tests import base
import unittest
class test_MySQLdb(dbapi20.DatabaseAPI20Test):
driver = pymysql
connect_args = ()
connect_kw_args = base.PyMySQLTestCase.databases[0].copy()
connect_kw_args.update(
dict(
read_default_file="~/.my.c... | {
"content_hash": "472af7558554827797afb0e8d71e6d1b",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 100,
"avg_line_length": 36.31506849315068,
"alnum_prop": 0.5131396957123098,
"repo_name": "PyMySQL/PyMySQL",
"id": "9ac190f2714ecc79a4d81a8ea2db624726476437",
"size": "795... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import backprop
from tensorflow.python.eager import context
from tensorflow.python.eager import def_function
from tensorflow.python.eager import function
from tensorflow.python.fram... | {
"content_hash": "16123df24901e25bb85e71028533fb27",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 79,
"avg_line_length": 33.01393728222997,
"alnum_prop": 0.6478100263852242,
"repo_name": "jendap/tensorflow",
"id": "2c25ab133b914ddd5209bfcda3a8a80d7c44f505",
"size": "10... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ewsghana', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='EWSExtension',
fields=[
('id', mo... | {
"content_hash": "808a711e15839315c0823435fc3377a9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 114,
"avg_line_length": 31.615384615384617,
"alnum_prop": 0.5559610705596107,
"repo_name": "qedsoftware/commcare-hq",
"id": "b72d76b1a42980111b437be94a1d3d3dbf4ac11a",
"siz... |
import arcpy, os, datetime
import SharedArcNumericalLib as san
# Function Definitions
# Main Function Definition
def temporal_split(in_fc, out_ws, start_time, end_time, time_interval, compactBool=True):
""" This tool will split a feature class into multiple feature classes based on a datetime field based on
... | {
"content_hash": "24651f36d814f8e4e0f2b77dda2436c9",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 117,
"avg_line_length": 50.43396226415094,
"alnum_prop": 0.5785634118967452,
"repo_name": "Holisticnature/ArcNumerical-Tools",
"id": "d5ef933b548a9429dcfd5127ffa220eed8ce273... |
"""
read_length_distribution: returns the length of sequences from a fasta or fastq file
"""
# import libraries
from Bio import SeqIO
import argparse
####################
## Arguments
####################
parser = argparse.ArgumentParser()
parser.add_argument("-f","--inputfile",type=str,help="the fasta or fastq fi... | {
"content_hash": "719630c138d3a172e390a9dc5e1056e3",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 123,
"avg_line_length": 30.305555555555557,
"alnum_prop": 0.6810265811182401,
"repo_name": "BleekerLab/Solanum_sRNAs",
"id": "590d9a9acf8dbaf165ae49a988c9d4f19e8d690d",
"si... |
"""Utility methods for scheduling."""
import sys
from nova.compute import flavors
from nova.compute import utils as compute_utils
from nova import db
from nova import notifications
from nova.objects import base as obj_base
from nova.objects import instance as instance_obj
from nova.openstack.common.gettextutils impor... | {
"content_hash": "44ebbe685e19ef8fe9c92d4c4a0ed82f",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 77,
"avg_line_length": 38.58552631578947,
"alnum_prop": 0.6211423699914749,
"repo_name": "CiscoSystems/nova",
"id": "e3250f12c8e80cff6b339035580bdf2b16fbb644",
"size": "64... |
"""
Compare the various algorithms on a synthetic dataset.
"""
import time
import cPickle
import os
import gzip
import pprint
import numpy as np
from scipy.misc import logsumexp
from scipy.special import gammaln
# Use the Agg backend in running on a server without the DISPLAY variable
if "DISPLAY" not in os.environ:
... | {
"content_hash": "64169fddc018e552816a1276930657b8",
"timestamp": "",
"source": "github",
"line_count": 1009,
"max_line_length": 108,
"avg_line_length": 38.194251734390484,
"alnum_prop": 0.5487570709429653,
"repo_name": "michaelpacer/pyhawkes",
"id": "7170701dfbbd1028c72a7b891eb838555cd3cea4",
"siz... |
"""
This module provide the function :py:func:`summary` that is used for printing
an execution summary at the end of luigi invocations.
See `https://github.com/spotify/luigi/blob/master/examples/execution_summary_example.py` for an example.
"""
import textwrap
import datetime
def _partition_tasks(worker):
"""
... | {
"content_hash": "9f70b5beecad58087e5873d2791480ad",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 199,
"avg_line_length": 41.29329608938548,
"alnum_prop": 0.6024487587093282,
"repo_name": "penelopy/luigi",
"id": "d188bb1819ca200784895d85b9b241c6db8f9427",
"size": "1538... |
"""
tools for expression and count based tasks
"""
import os,sys,csv,gc,re
import numpy as np
def read_RSEM_counts_files(geneFilePath,isoformFilePath):
"""
read the RSEM counts files into a matrix
"""
if not os.path.exists(geneFilePath):
raise Exception("Cannot find gene file\n%s"%(geneFileP... | {
"content_hash": "b51ba957e91ee1f7609fb0c65e875c48",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 115,
"avg_line_length": 29.08823529411765,
"alnum_prop": 0.6048533872598585,
"repo_name": "ajrichards/htsint",
"id": "391448ef16677991707376e6c40a8102d65853ce",
"size": "4... |
"""
Copyright 2017 Andris Zbitkovskis
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 applicable law or agreed t... | {
"content_hash": "3398253eeba1a400a28b7f96abdefeca",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 214,
"avg_line_length": 40.78313253012048,
"alnum_prop": 0.5646233382570163,
"repo_name": "zbitmanis/cmanager",
"id": "c311c3a68a5f1e234fd75f6fffba875609b9a883",
"size": "... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class SearchByCoordinates(Choreography):
def __init__(self, temboo_session):
"""
Cr... | {
"content_hash": "e2fc1c633f2c4783a6f6ca569d0a8364",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 252,
"avg_line_length": 52.56737588652482,
"alnum_prop": 0.6807879114948732,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "cd0cfdad0391af6cc54055008a5c571be3f001fa",
"si... |
from distutils.core import setup
import glob
import os
from DistUtilsExtra.command import *
setup(name='clearcutter',
version='0.2',
description='ClearCutter Log Event Processor',
author='Conrad Constantine',
author_email='conrad@alienvault.com',
url = 'http://code.google.com/p/alienvault... | {
"content_hash": "7448aa4ee8f3232066459d599d892275",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 29.22222222222222,
"alnum_prop": 0.6615969581749049,
"repo_name": "MercenaryLogic/bullwood",
"id": "7976bb5889f94bb0643678d6b117bfb84a95a35d",
"size"... |
import json
import nltk
from nltk.corpus import stopwords
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
def Preprocess(t):
'''
Everything reduced to lower case for ease of processing
'''
t = t.lower()
# Specific case to remove <'> so as to tag properly
t = t.replace('\'','')
... | {
"content_hash": "cb50645c553c3f8c34de325b81d7e719",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 83,
"avg_line_length": 27.65979381443299,
"alnum_prop": 0.5620573984345881,
"repo_name": "anirudhagar13/Zomato-Food-Review",
"id": "b6072f07268978977b2525852c41b8f27f9eacfd",... |
import asyncio
import json
import logging
from urllib.parse import urlparse
import websockets
from google.datacatalog_connectors.qlik.scrape import \
authenticator, constants, engine_api_dimensions_helper, \
engine_api_measures_helper, engine_api_sheets_helper, \
engine_api_visualizations_helper
class E... | {
"content_hash": "e01d58319529331a339d32cdbc0b81f5",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 182,
"avg_line_length": 43,
"alnum_prop": 0.6568475452196383,
"repo_name": "GoogleCloudPlatform/datacatalog-connectors-bi",
"id": "2ffc88f5a5ed34a02ede32015cd82b9f3108f29e",... |
import binascii
import random
from collections import defaultdict, namedtuple
import serial
from terminaltables import AsciiTable
from tools_shared.cmd_line_parser import get_args
from tqdm import tqdm
from vrc_t70.communicator import VrcT70Communicator
from vrc_t70.limitations import MAX_TRUNKS_COUNT
from .share... | {
"content_hash": "4367d2b53a36c63cc974ac5dbc896566",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 107,
"avg_line_length": 32.74384236453202,
"alnum_prop": 0.6464570482924628,
"repo_name": "JFF-Bohdan/vrc_t70",
"id": "ab72c9205197ad24182f9bd3fab4203104016f87",
"size": "... |
"""Wichman-Hill random number generator.
Wichmann, B. A. & Hill, I. D. (1982)
Algorithm AS 183:
An efficient and portable pseudo-random number generator
Applied Statistics 31 (1982) 188-190
see also:
Correction to Algorithm AS 183
Applied Statistics 33 (1984) 123
McLeod, A. I. (1985)
... | {
"content_hash": "dd46d52b7b0e3dad187b643ef682a3f8",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 80,
"avg_line_length": 34.09722222222222,
"alnum_prop": 0.5765784114052953,
"repo_name": "MalloyPower/parsing-python",
"id": "bc0d1a4520eac209807d29e79eac9d329b82c3cb",
"s... |
import unittest
import uuid
import cloudinitd
from cloudinitd.pollables import *
class PollableTests(unittest.TestCase):
def tearDown(self):
cloudinitd.close_log_handlers()
def test_popen_fail(self):
cmd = "/bin/false"
pexe = PopenExecutablePollable(cmd, allowed_errors=0)
p... | {
"content_hash": "a4d6901f265301faaf6e25145b81dd56",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 85,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.5510887772194305,
"repo_name": "nimbusproject/cloudinit.d",
"id": "8ea4bc97092d96dd3ccb354bcc2e318eb79f384c",
"s... |
import os
import re
import cStringIO as StringIO
from random import choice
from PIL import Image
SURVEY_ID = 'sdss'
DATA_DIR = 'data'
FILE_DIR = os.path.dirname(__file__)
DATA_PATH = os.path.join(FILE_DIR, DATA_DIR)
print DATA_PATH
data_index = {} # map from original file to a list of its RGB splits
data_index_r... | {
"content_hash": "34e39b46e5802240e4ab716a32877adf",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 73,
"avg_line_length": 27.276923076923076,
"alnum_prop": 0.6559503666102651,
"repo_name": "ahoym/asterank",
"id": "1bb5b36104d83bbc45301712a6d79a9252fcaacf",
"size": "1866"... |
__author__ = 'waziz'
from itertools import izip
import numpy as np
def scaled_fmap(fmap, scaling=1.0):
"""Returns a feature map scaled by a constant"""
if type(fmap) is dict:
return {k: v*scaling for k, v in fmap.iteritems()}
else:
return {k: v*scaling for k, v in fmap}
def fmap_dot(fma... | {
"content_hash": "6d49dc8dfda2283ecaa6d38e8d97e7d2",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 122,
"avg_line_length": 33.016129032258064,
"alnum_prop": 0.6394723986321446,
"repo_name": "wilkeraziz/chisel",
"id": "6dffa54327bbf8de0bf2ad45f416684a69b2482a",
"size": "2... |
class YamlException(Exception):
def __init__(self, message):
# Call the base class constructor with the parameters it needs
super(YamlException, self).__init__(message)
class YaqlException(Exception):
def __init__(self, message):
# Call the base class constructor with the parameters ... | {
"content_hash": "c48896266bd3576bf530a0af5e0679a6",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 70,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.675392670157068,
"repo_name": "ALU-CloudBand/yaqluator",
"id": "f4894cb51b60203cb365bfee9486d28ae27a0fd7",
"size"... |
from flask import Flask, request, render_template
from collections import defaultdict
app = Flask(__name__)
clients_so_far = defaultdict(dict)
@app.route('/update', methods=['POST'])
def update():
if 'progress' in request.form:
clients_so_far[request.form['uuid']].update({'progress': int(float(request.form['pr... | {
"content_hash": "1e776439e427d91422eb9542e48eca2d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 99,
"avg_line_length": 29.857142857142858,
"alnum_prop": 0.671451355661882,
"repo_name": "jzelinskie/chihaya-demo",
"id": "bda3cf1469706fbee3cffe9e0150d8480d718000",
"size"... |
from __future__ import unicode_literals
import helper
import sys
import unittest
import ops
class PermTestCase(unittest.TestCase):
def test_default(self):
p = ops.perm()
self.assertEqual(p.read, None)
self.assertEqual(p.write, None)
self.assertEqual(p.execute, None)
def te... | {
"content_hash": "600055e3119c3a7ab5947ff7a53753da",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 47,
"avg_line_length": 24.02542372881356,
"alnum_prop": 0.5950617283950618,
"repo_name": "silas/ops",
"id": "769b8dcee9350df0e6ea3b9964c311334bc2f877",
"size": "2835",
"... |
from __future__ import absolute_import
from __future__ import unicode_literals
from django import forms
from django.test import TestCase
from django_filters.filterset import FilterSet
from django_filters.filters import CharFilter
from django_filters.filters import ChoiceFilter
from .models import User
from .models i... | {
"content_hash": "3e5eb919e84a4af76bf01480f5b0c115",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 137,
"avg_line_length": 30.923357664233578,
"alnum_prop": 0.5267319721468193,
"repo_name": "jpadilla/django-filter",
"id": "684b74dedf737fa4ac44269e88525c0cd8a7bbcb",
"siz... |
import json
from pymongo import MongoClient
import os
from launchpad_reporting.db import db
from launchpad_reporting.launchpad.lpdata import LaunchpadAnonymousData
lpdata = LaunchpadAnonymousData(bugs_db=db)
connection = MongoClient()
db = connection["assignees"]
assignees = db.assignees
path_to_data = "/".join(os... | {
"content_hash": "e4920a3d43932acffc10a3e670534efb",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 71,
"avg_line_length": 25.488888888888887,
"alnum_prop": 0.6495204882301656,
"repo_name": "Mirantis/launchpad-reports-summary",
"id": "054a3ce609ed9495d9f1926901c39449b8fe899... |
import gepify
from . import GepifyTestCase
from flask import url_for, session, g
import spotipy
from urllib import parse
from unittest import mock
from gepify.services import spotify
from gepify.providers import songs
from werkzeug.contrib.cache import SimpleCache
import json
import os
import time
class MockResponse:... | {
"content_hash": "73936829aef1cc1ed843e07b28480407",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 87,
"avg_line_length": 41.612099644128115,
"alnum_prop": 0.6199863165996751,
"repo_name": "nvlbg/gepify",
"id": "c2a9ca3a6eca70988379779f9838948618ef660a",
"size": "23388"... |
from IPython import get_ipython
save_get_ipython_system = get_ipython().system
get_ipython().system = lambda x: get_ipython_system(x)
# interactiveshell.py's system_piped() function comment saids:
# "we store the exit_code in user_ns."
# this function check the exit_code and raise exception if it is not 0.
def get_ip... | {
"content_hash": "871df1a1ccecd0081124721557da1438",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 92,
"avg_line_length": 43,
"alnum_prop": 0.7093023255813954,
"repo_name": "NII-cloud-operation/Jupyter-LC_docker",
"id": "5c964c03a45d48b8cac922d01bac898c831b338f",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.