text stringlengths 4 1.02M | meta dict |
|---|---|
DEV = False
DEBUG = True
| {
"content_hash": "a9de7a28d726a2b74cf4f0405f9af0cf",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 12,
"avg_line_length": 12.5,
"alnum_prop": 0.68,
"repo_name": "iamsudip/he-clog",
"id": "ae41be76eeb500522621688ea0f3033ebce5afb1",
"size": "113",
"binary": false,
"copi... |
import os
import json
import signal
from ducktape.utils.util import wait_until
from ducktape.services.background_thread import BackgroundThreadService
from kafkatest.directory_layout.kafka_path import KafkaPathResolverMixin
from ducktape.cluster.remoteaccount import RemoteCommandError
class TransactionalMessageCopier... | {
"content_hash": "28c505e81a38d8bb8d2734bf8ff13784",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 139,
"avg_line_length": 46.36787564766839,
"alnum_prop": 0.5924684322270645,
"repo_name": "lindong28/kafka",
"id": "675c7d71531f3bc380587b949e82842f10e1ca18",
"size": "973... |
from sys import argv
from os.path import exists
script, from_file, to_file = argv
print"Copying from %s to %s" % (from_file, to_file)
# we could do these two on one line too, how?
input= open(from_file)
indata = input.read()
print "The input file is %d bytes long" % len(indata)
print "Does the output file exist? %... | {
"content_hash": "e3e0bb1b972d19ceaafe480fee782db8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 56,
"avg_line_length": 21.458333333333332,
"alnum_prop": 0.7029126213592233,
"repo_name": "AisakaTiger/Learn-Python-The-Hard-Way",
"id": "dcfe0164c33018a2f5d9e1a58412172187c5... |
import numpy as np
import scipy.sparse
import logging
import modest
import matplotlib.pyplot as plt
try:
import petsc4py
petsc4py.init()
from petsc4py import PETSc
except ImportError:
print(
'could not import PETSc. '
'PETSc can be installed by following the instructions at '
'https://www.mcs.anl.go... | {
"content_hash": "fb957bd9b54ebd50eb829ac7c68be52e",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 90,
"avg_line_length": 29.94814814814815,
"alnum_prop": 0.6871135295572595,
"repo_name": "treverhines/ModEst",
"id": "241cb9bb41e700f078c5b90d18f9484b6c64f567",
"size": "4... |
"""
Stomatogastric ganglion Central Pattern Generator:
generates pyloric rhythm of the lobster
Network model translated from:
Prinz, Bucher, Marder, Nature Neuroscience, 2004;
STG neuron models translated from:
Prinz, Billimoria, Marder, J.Neurophys., 2003.
Translated into MOOSE by Aditya Gilra, Bangalore, 2013, rev... | {
"content_hash": "d770c530d0220e5345ccc7d9eacec54e",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 89,
"avg_line_length": 35.464516129032255,
"alnum_prop": 0.6490813170820448,
"repo_name": "h-mayorquin/camp_india_2016",
"id": "a668fc136b50341597abf4f8d8693ac4af927fff",
... |
"""
dyn_pages/signup.py
Author: Trey Stout
Date Added: ?
Give us yo money.
"""
## STD LIBS
## OUR LIBS
from zoto_base_page import zoto_base_page
## 3RD PARTY LIBS
class signup(zoto_base_page):
local_js_includes = [
"select_box.lib.js",
"lookahead.lib.js",
"tag_cloud.lib.js",
"globber.lib.js",
"albums.... | {
"content_hash": "c86b9c3757de5f30e5bcf0dfd1f3bbcb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 44,
"avg_line_length": 15.81081081081081,
"alnum_prop": 0.6547008547008547,
"repo_name": "kordless/zoto-server",
"id": "3fd1816df9161533f19da113de024d6729b5e311",
"size": "... |
"""Support for the yandex speechkit tts service."""
import asyncio
from http import HTTPStatus
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider
from homeassistant.const import CONF_API_KEY
from homeassistant.help... | {
"content_hash": "3defb5e74bdc9ee26af10ec03ff17cc9",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 87,
"avg_line_length": 28.75,
"alnum_prop": 0.6044653349001176,
"repo_name": "aronsky/home-assistant",
"id": "ec0868b244396eb2bfcd1fd7218bb6b3ad21ac15",
"size": "4255",
... |
from django import template
from django.urls import reverse
from django.utils.safestring import mark_safe
from bson.objectid import ObjectId
from mongoengine import Document
from mongoengine.fields import URLField
register = template.Library()
@register.simple_tag()
def get_document_value(document, key):
'''
... | {
"content_hash": "7eadbba7174c49debb1896fd7bf94bd6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 31,
"alnum_prop": 0.6441837732160313,
"repo_name": "pydanny/django-mongonaut",
"id": "a77ef3784094304ec866162831261d07b14a51c0",
"size": "1048",
"b... |
import doppelbot.cli
doppelbot.cli.main()
| {
"content_hash": "4c46bf622033298bc7115bc9056639ad",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 20,
"avg_line_length": 21,
"alnum_prop": 0.8095238095238095,
"repo_name": "michaeljoseph/doppelbot",
"id": "cca0eba241457afc9b3cd063fdbcc28a74e29e79",
"size": "43",
"binar... |
from .certificate_verification_description import CertificateVerificationDescription
from .certificate_body_description import CertificateBodyDescription
from .certificate_properties import CertificateProperties
from .certificate_description import CertificateDescription
from .certificate_list_description import Certif... | {
"content_hash": "abc2ede496811fa3dcb964ab80d4b6f3",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 105,
"avg_line_length": 40.01652892561984,
"alnum_prop": 0.8139198678232136,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "c0dc0016be9984ce2ebe44823f58813e2f47e5d1"... |
"""
A lightweight wrapper around Python's sqlite3 database, with a dict-like interface
and multi-thread access support::
>>> mydict = SqliteDict('some.db', autocommit=True) # the mapping will be persisted to file `some.db`
>>> mydict['some_key'] = any_picklable_object
>>> print mydict['some_key']
>>> print len(mydict)... | {
"content_hash": "46d997449c8cd921ce8880623fb03dd9",
"timestamp": "",
"source": "github",
"line_count": 536,
"max_line_length": 133,
"avg_line_length": 38.58582089552239,
"alnum_prop": 0.591238758340586,
"repo_name": "naparuba/kunai",
"id": "39f7c7c82d3af733a09676c7f92eff77946e0224",
"size": "21037... |
""" cythonize
Cythonize pyx files into C files as needed.
Usage: cythonize [root_dir]
Default [root_dir] is 'dismalpy'.
Checks pyx files to see if they have been changed relative to their
corresponding C files. If they have, then runs cython on these files to
recreate the C files.
The script thinks that the pyx f... | {
"content_hash": "69679a60f6b4d5ec103b01573e9a065e",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 105,
"avg_line_length": 30.548223350253807,
"alnum_prop": 0.6010302426055167,
"repo_name": "dismalpy/dismalpy",
"id": "1d256f35bc18e927ef4bf95c0a42155ea4ba1a1e",
"size": "... |
import unittest
from flask import url_for, session
from app import create_app, db
from app.models import Article, Comment, Tag
class TestAdmin(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_context.push()
db... | {
"content_hash": "d92022d3de53e697a09e463069efd155",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 117,
"avg_line_length": 39.215053763440864,
"alnum_prop": 0.5744447491088566,
"repo_name": "WillSkywalker/blog",
"id": "dd02d200d1d07583c4b4acfef96d7a9df1144c00",
"size": "... |
"""Axis-related chart objects."""
from pptx.dml.chtfmt import ChartFormat
from pptx.enum.chart import (
XL_AXIS_CROSSES,
XL_CATEGORY_TYPE,
XL_TICK_LABEL_POSITION,
XL_TICK_MARK,
)
from pptx.oxml.ns import qn
from pptx.oxml.simpletypes import ST_Orientation
from pptx.shared import ElementProxy
from pptx.... | {
"content_hash": "e6d0f0d764f96725cc764cbdba47973f",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 88,
"avg_line_length": 33.17658349328215,
"alnum_prop": 0.624703500144634,
"repo_name": "scanny/python-pptx",
"id": "66f325185d9f648f9dc36936ab8536df91b0bf86",
"size": "17... |
"""
sentry.runner.commands.repair
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import os
import click
import six
from contextlib import contextmanager
from d... | {
"content_hash": "101a0096e909d017a407b021622ce144",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 77,
"avg_line_length": 30.947712418300654,
"alnum_prop": 0.6166842661034847,
"repo_name": "alexm92/sentry",
"id": "6e748b12fff5d89c594c44da9ff1aefdf8256679",
"size": "4735... |
import BaseHTTPServer, SimpleHTTPServer
import ssl
import sys
from SimpleHTTPServer import SimpleHTTPRequestHandler
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
print "send header"
self.send_re... | {
"content_hash": "de1a267028245b070346f6455e561c2a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 84,
"avg_line_length": 33.326530612244895,
"alnum_prop": 0.6387017758726271,
"repo_name": "felipehuici/telerobot",
"id": "0bb4e2aa923e0c25bdc460f5ed27ce65078d64aa",
"size":... |
import os
from fab_deploy2 import functions
from fab_deploy2.tasks import ContextTask
from fabric.api import run, sudo
class HiRedisSetup(ContextTask):
"""
Setup hiredis
"""
context_name = 'hiredis'
default_context = {
'package_name' : 'libhiredis-dev'
}
name = "setup"
def r... | {
"content_hash": "a6e936915aa8baf6bf61e7dd146f3214",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 90,
"avg_line_length": 20.227272727272727,
"alnum_prop": 0.6696629213483146,
"repo_name": "ff0000/red-fab-deploy2",
"id": "e19b0a94962eeecd39ef3dc5bc30022b7a54acc1",
"size"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testapp.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "5eb93d717d7562efb5b2cf627c874e27",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 71,
"avg_line_length": 22.9,
"alnum_prop": 0.7074235807860262,
"repo_name": "kevana/django-test",
"id": "e1e33e37ffac922e6e31f51e3f93d0b498efc6a2",
"size": "252",
"binary... |
import unittest
from twork import utils
from twork.web.server import TApplication
@utils.common.singleton
class _Base(object):
pass
class Base(object):
pass
class Derived(Base):
pass
class WebApplication(TApplication):
pass
class SingletonTest(unittest.TestCase):
def setUp(self):
... | {
"content_hash": "eae94269d9ec8c548286da245c92791f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 52,
"avg_line_length": 15.64516129032258,
"alnum_prop": 0.6824742268041237,
"repo_name": "bufferx/twork",
"id": "27c299813e5647a44668db59578dfcbc3f59d90a",
"size": "485",
... |
import numpy as nm
from sfepy.base.base import assert_, OneTypeList, Container, Struct
class Functions(Container):
"""Container to hold all user-defined functions."""
def from_conf(conf):
objs = OneTypeList(Function)
for key, fc in conf.iteritems():
fun = Function(name = fc.name,
... | {
"content_hash": "bea348d9e6ecae3934727964d0f851d2",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 79,
"avg_line_length": 34.53719008264463,
"alnum_prop": 0.5116056472840392,
"repo_name": "RexFuzzle/sfepy",
"id": "f4dda6e59fcdbd8b4cee22074b6436554165567e",
"size": "4179... |
__all__ = ['exporter','serializer', 'dictionary', 'duolingo', 'yandex', 'user']
from memlingo.dictionary import WordDictionary
from memlingo.user import User
| {
"content_hash": "7ee1d16aa7d253ec5021c264adb5e16d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 79,
"avg_line_length": 20.375,
"alnum_prop": 0.7177914110429447,
"repo_name": "pedroallenrevez/MemLinguo",
"id": "9ef2999f640979371ddd89e6548105089a5c2207",
"size": "163",
... |
from __future__ import print_function
import hashlib
prefix = 'yzbqklnj'
prefix_m = hashlib.md5(prefix)
def find_tail(startstring):
tail = 0
while True:
curr_m = prefix_m.copy()
curr_m.update(str(tail))
md5_hash_hex = str(curr_m.hexdigest())
if md5_hash_hex[:len(startst... | {
"content_hash": "d1340b8f03831a8f87de398a56ab20f9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 58,
"avg_line_length": 23.157894736842106,
"alnum_prop": 0.6022727272727273,
"repo_name": "v-ek/advofcode",
"id": "7d4e53fe3758d1a17c135a63ec8a44584cc0c373",
"size": "440",... |
'''
Class to cache songs into local storage.
'''
from singleton import Singleton
import threading
import subprocess
from const import Constant
from config import Config
import os
import logger
import signal
log = logger.getLogger(__name__)
class Cache(Singleton):
def __init__(self):
if hasattr(self, '_i... | {
"content_hash": "03311f052ae806d7ece693ff58c409c1",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 114,
"avg_line_length": 30.819277108433734,
"alnum_prop": 0.5312744331508992,
"repo_name": "miuc/musicbox",
"id": "32c466e8aefb9b97a178f32ed29ccbaa53ee7671",
"size": "2625"... |
from pybrain.tools.shortcuts import buildNetwork
class Brain:
def __init__(self):
self.move_network = buildNetwork(9, 3, 2, bias=True)
def process_input(self, input):
a = self.move_network.activate(input)
return a[0], a[1]
| {
"content_hash": "449b613471214fc2238826c75ee0f6ba",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 18.714285714285715,
"alnum_prop": 0.6297709923664122,
"repo_name": "nlowery/org-sandbox",
"id": "b1e56c171229bf14b9d585db47deb5de7b002ad5",
"size": "... |
from .request import req
def follow(url_token):
"""Follow a user.
Args:
url_token: The url token (or slug) of the user.
"""
url = '/api/v4/members/%s/followers' % url_token
return req.post(url)
def unfollow(url_token):
"""Unfollow a user.
Args:
url_token: The url token ... | {
"content_hash": "32af5f4f4b7af6f5de84ca9859978d42",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 94,
"avg_line_length": 22.5,
"alnum_prop": 0.5664646464646464,
"repo_name": "syaning/zhihuapi-py",
"id": "fe10a13f1cfbd814da4c00b970e4f20823943a9d",
"size": "2475",
"bin... |
from os.path import abspath, dirname, join
from shutil import which
from preggy import expect
from tests.base import TestCase
from thumbor.config import Config
from thumbor.context import RequestParameters, ServerParameters
from thumbor.engines.gif import Engine
from thumbor.importer import Importer
STORAGE_PATH = a... | {
"content_hash": "6a78563fe8ade90db8f56604f233e764",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 88,
"avg_line_length": 34.878787878787875,
"alnum_prop": 0.631624674196351,
"repo_name": "scorphus/thumbor",
"id": "0f78169a151762c05705c6240f65b555369f9a19",
"size": "3705... |
"""Get status of disk."""
from status_base import mongo_collection
from status_base import mongo_database
from status_base import save
from status_base import schedule_log
from status_base import setup_environment
from status_base import get_parameters
from urllib.request import urlopen
setup_environment()
def stat... | {
"content_hash": "d3840e8b8bbaaba1942701fd3222b883",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 68,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.5503194888178914,
"repo_name": "CornerstoneLabs/service-dashboard",
"id": "827bbb6a78264c33a0c0a88e79a05b62de39a6cf... |
from app import app
from app import manager
if __name__ == "__main__":
manager.run()
| {
"content_hash": "f4bfdab0250eb5d3845f7a1195cf4c39",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 26,
"avg_line_length": 15.166666666666666,
"alnum_prop": 0.6153846153846154,
"repo_name": "VincentTide/vincenttide",
"id": "84a5c8439938d832d5e4b8c1b92216bdf831ab40",
"size"... |
"""Test the avoid_reuse and setwalletflag features."""
from test_framework.test_framework import SyscoinTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_raises_rpc_error,
)
def reset_balance(node, discardaddr):
'''Throw away all owned coins by the node so it gets a b... | {
"content_hash": "d0aa3e3fa334916cde6a548e155e654c",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 132,
"avg_line_length": 44.43287671232877,
"alnum_prop": 0.6400295967443581,
"repo_name": "syscoin/syscoin",
"id": "738b5cadbb2c3a38dcc79cebcc4a47946fd5e55d",
"size": "164... |
import errno
import json
import logging
import os
import platform
import shutil
import stat
import socket
import subprocess
import time
import tempfile
try:
from subprocess import DEVNULL
except ImportError:
DEVNULL = open(os.devnull, 'wb')
from bottle import request
from mongo_orchestration.common import DE... | {
"content_hash": "b94bd0d6beb9568e4ba0e67acf33eeda",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 120,
"avg_line_length": 33.593333333333334,
"alnum_prop": 0.5909902758483826,
"repo_name": "agilemobiledev/mongo-orchestration",
"id": "f50d2d1e4ccbae842e48986fe1da58262a886... |
from sklearn.externals import joblib
from preprocessData import getDataXY, get_accuracy
trainX, trainY, testX, testY, validX, validY = getDataXY()
print type(trainY)
models = ['Models/dt0.58.pkl', 'Models/NB0.59.pkl', 'Models/NC0.57.pkl',
'Models/NNP0.61.pkl', 'Models/sgd0.54.pkl']
all_pre = []
for model ... | {
"content_hash": "4066724a864ebea45d11322f69c0284c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 83,
"avg_line_length": 21.372093023255815,
"alnum_prop": 0.6235038084874864,
"repo_name": "TheaGao/SklearnModel",
"id": "f678b30434cfbcab5a3a8a898d0a71ec304355f1",
"size": ... |
"""Test ACL."""
import datetime
import json
import webtest
from ceilometer.api import app
from ceilometer.api.controllers import v2 as v2_api
from ceilometer.openstack.common import timeutils
from ceilometer.publisher import utils
from ceilometer import sample
from ceilometer.tests import api as acl
from ceilometer.... | {
"content_hash": "6b78446bf6490f81f60ad3a3182e48b4",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 42.051643192488264,
"alnum_prop": 0.4510438762978676,
"repo_name": "tanglei528/ceilometer",
"id": "0cd27b3ed00505ef65db09a613286b898496ad97",
"size"... |
try:
import progressbar
progressbar_loaded = True
except ImportError:
progressbar_loaded = False
import threading
class WrappedProgressBar:
"""Set up the command-line progress bar with max_value
Wraps the progressbar.py tool to avoid LGPL'ing this code
"""
def __init__(self, max_value):
... | {
"content_hash": "4fef1dedabf5749c851a338ed86af6d2",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 81,
"avg_line_length": 29.363636363636363,
"alnum_prop": 0.5675954592363261,
"repo_name": "timothy-king/telescope-exec",
"id": "52ae440babf2ad5f83c3fa8bae7fe76b5e55b34b",
"... |
from __future__ import print_function
import argparse
import datetime
import errno
import os
import string
import subprocess
import sys
from json import dumps, loads
DEFAULT_DATA_TABLE_NAMES = ["mentalist_databases"]
def mentalist_download_enterobase( data_manager_dict, kmer_size, scheme, type, params, target_dir... | {
"content_hash": "f2eb21ceb9ce568a323400b35939df50",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 149,
"avg_line_length": 41.324675324675326,
"alnum_prop": 0.650534255185418,
"repo_name": "WGS-TB/MentaLiST",
"id": "59986ec079a4c7f858a46798d2e6aeb79e41243a",
"size": "320... |
"""Dataset snapshot and related functionality."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.py... | {
"content_hash": "e2fc046caf6e34c8a7b24ccbf927520e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 80,
"avg_line_length": 39.95652173913044,
"alnum_prop": 0.6817192600652884,
"repo_name": "alsrgv/tensorflow",
"id": "9581f73748000a8e7285e9ad441b1859ce9f943e",
"size": "436... |
import os
from taxinet import TaxiNet, TaxiCombinerNet
import torch
import pandas as pd
import numpy as np
from datetime import datetime
from math import sin, cos, sqrt, atan2, radians
from torch.autograd import Variable
from random import random
from sklearn.decomposition import PCA
from sklearn.cluster import MiniBat... | {
"content_hash": "58dae4188e5d2a86eab87b52b6356f2b",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 117,
"avg_line_length": 42.07936507936508,
"alnum_prop": 0.6491889852885704,
"repo_name": "deo1/deo1",
"id": "1328f57366ebcaf29f8866c25fa8ddeba19ec9c5",
"size": "13648",
... |
import os
import collections
import time
import datetime
import threading
import copy
import pickle
import traceback
if os.name=='nt': # Windows
import _winreg as winreg
elif os.name=='posix': # Linux
import glob
import json
from SmartMeshSDK import sdk_version
from SmartMeshSDK.uti... | {
"content_hash": "f2cc197dc781d5cf12da34471be283a9",
"timestamp": "",
"source": "github",
"line_count": 1063,
"max_line_length": 111,
"avg_line_length": 35.12605832549389,
"alnum_prop": 0.4304614478159565,
"repo_name": "realms-team/solmanager",
"id": "a6ec75398ca688b85753b2fcfece7df7508bb32e",
"siz... |
from django.db import models
from paigow.models import PGGame
from pgtile import PGTile
class PGDeal( models.Model ):
# make sure the DB table name is what we want
class Meta:
app_label = 'paigow'
# This 32-character hex string defines the deal
deck = models.CharField( max_length = 32 )
# it's ... | {
"content_hash": "7064e3eb12fa8badc79ab087634180ba",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 76,
"avg_line_length": 26.454545454545453,
"alnum_prop": 0.6269568537609774,
"repo_name": "rudisherry666/paigow",
"id": "a677642b2e5bab50ced408d855218890e68c6704",
"size": ... |
"""Contains main loop for the AI"""
from board_functions import pp
from board_functions import make_board
from board_functions import num_empty
from board_functions import rand_tile
from board_functions import move
from brain import get_dir
BOARD = make_board()
#Main loop
while True:
pp(BOARD)
EMPTY = num_e... | {
"content_hash": "ca5813ec1e0cbb7769b1bde25ac84b6d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 69,
"avg_line_length": 17.575757575757574,
"alnum_prop": 0.646551724137931,
"repo_name": "DavidGrey/2048_Python-AI",
"id": "f034028c266842c32caba8b896860e923bbf1617",
"size... |
import hycohanz as hfss
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to create a new project.>')
oProject = hfss.new_project(oDesktop)
raw_input('Press "Enter" to insert a new DrivenModal design named HFSSDesign1.>')
oDesign =... | {
"content_hash": "1decab2b9e682a83c397de6fb34000b7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 112,
"avg_line_length": 30.853658536585368,
"alnum_prop": 0.7051383399209487,
"repo_name": "Dr-Drive/hycohanz",
"id": "c5a13d6fd1c76a8fe3a1992b8225bc609be92630",
"size": "1... |
"""Tests for tensorflow.ops.image_ops."""
import colorsys
import contextlib
import functools
import itertools
import math
import os
import time
from absl.testing import parameterized
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.client import session
from tensorflow.python... | {
"content_hash": "fd9c442da543fde452d167307ae1f7dc",
"timestamp": "",
"source": "github",
"line_count": 6405,
"max_line_length": 80,
"avg_line_length": 39.546604215456675,
"alnum_prop": 0.6046167329922304,
"repo_name": "tensorflow/tensorflow-experimental_link_static_libraries_once",
"id": "e229dd6525... |
"""
"""
import json
import pdb
from policy_util import PolicyError, HostStruct, HostAddr, PolicyAppConnectionMgr, is_ipv6_enabled
"""
Entity implementing the business logic of user connection/access policy.
"""
#
#
class PolicyKeys(object):
"""
String constants
"""
# Common key words
KW_IGNORED_... | {
"content_hash": "e6abd2046b357c5293581730a5d5e719",
"timestamp": "",
"source": "github",
"line_count": 699,
"max_line_length": 464,
"avg_line_length": 45.43919885550787,
"alnum_prop": 0.5688873496631195,
"repo_name": "lulf/qpid-dispatch",
"id": "4f176e0ce55c3fc67e1eb000253464707b555a70",
"size": "... |
from flask import Flask
from flask import render_template
app = Flask(__name__)
app.config['DEBUG'] = True
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def main():
return render_template('index.html', posts={})
@app.route(... | {
"content_hash": "01d583100143ef0021af2753656ba31f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 24.59090909090909,
"alnum_prop": 0.6913123844731978,
"repo_name": "ikeralbeniz/leafletcast",
"id": "e4538208b72cdb6279a898d0ad28e25aab61c799",
"size"... |
import matplotlib.pyplot as plt
import numpy as np
angles = []
# row, prowtch, yaw
for row in range(36):
for pitch in range(36):
for yaw in range(36):
row *= 10; pitch *= 10; yaw *= 10
angles.append([row,pitch,yaw])
print angles[0]
plt.plot(angles[0,:],angles[1,:])
plt.show()
| {
"content_hash": "6fc9171b60c294c7d09f802ea69ad056",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 22.5,
"alnum_prop": 0.5968253968253968,
"repo_name": "nickvazz/Trick-Identifier",
"id": "cdf32cd55cd454aa2345d25c651bb8d2c8bc072a",
"size": "315",
... |
import rope.base.codeanalyze
import rope.base.evaluate
import rope.base.builtins
import rope.base.oi.soi
import rope.base.pyscopes
from rope.base import (pynamesdef as pynames, exceptions, ast,
astutils, pyobjects, fscommands, arguments, utils)
from rope.base.pyobjects import *
class PyFunction... | {
"content_hash": "166dd7d5867928376f7f3c03276e0e72",
"timestamp": "",
"source": "github",
"line_count": 537,
"max_line_length": 80,
"avg_line_length": 35.26070763500931,
"alnum_prop": 0.57818853974122,
"repo_name": "wezhang/vim-setup",
"id": "50b243607b45f45f77768fa74609270ae5618066",
"size": "1893... |
import functools
import logging
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.conf import settings
import requests
logger = logging.getLogger(__name__)
def api_token_required(f):
@functools.wraps(f)
@login_required
def requirer(request, *args,... | {
"content_hash": "fc879b74d78cf40a06f9dacf488dcab7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 89,
"avg_line_length": 32.4078947368421,
"alnum_prop": 0.6447421843280552,
"repo_name": "LocalBitcoins/lbtcex",
"id": "c622f9ea783a874c53112926bc8b9809717d232a",
"size": "2... |
import calendar
DEPS = [
'recipe_engine/file',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
'recipe_engine/time',
'gsutil',
'vars',
]
DM_JSON = 'dm.json'
VERBOSE_LOG = 'verbose.log'
def RunSteps(api):
api.vars.setup()
revision = api.properties['... | {
"content_hash": "947b63ef44dc4ad23ff753026c13e6a5",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 31.38095238095238,
"alnum_prop": 0.5768841679312089,
"repo_name": "youtube/cobalt_sandbox",
"id": "3e8bfe4474079d944d1fd1724f88fad679c38b3e",
"size"... |
import os
from abc import *
from . import build
import pynja.tc
class CppTask(build.BuildTask):
def __init__(self, project, sourcePath, outputPath, workingDir):
super().__init__(project)
self.sourcePath = sourcePath
self.outputPath = outputPath
self.workingDir = workingDir
... | {
"content_hash": "7e995570ea5c635392953c0a501b2c9b",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 134,
"avg_line_length": 37.713903743315505,
"alnum_prop": 0.6321871676710387,
"repo_name": "fifoforlifo/pynja",
"id": "760a9469817f7ca0d6b2dbf41aff2899a61de040",
"size": "... |
VALID_QUERY_PARAMS = "query"
SEARCH_TYPE = "type"
SEARCH_DATABASE = "d"
SEARCH_FORMULA = "f"
SEARCH_TEXT = "t"
SEARCH_LIMIT = 50
AUTHENTICATION_FAIL = "You must be an admin to perform database manipulation."
FORMULA_CREATION_SUCCESS = "Formula creation is successful!"
FORMULA_CREATION_FAIL = "Formula creation failed... | {
"content_hash": "d03ab45f7c3b23c06edf8028d89072f0",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 46.574074074074076,
"alnum_prop": 0.7137176938369781,
"repo_name": "deka108/mathqa-server",
"id": "9636cd837c4323197fc7ed8b6704cf70d5f45ec8",
"size":... |
from setuptools import setup, find_packages
from kite.version import get_version
setup(
name='kite-string',
description='command-line HTTP request wrapper for takosan .',
version=get_version(),
packages=find_packages(),
include_package_data=True,
install_requires=[
'requests',
... | {
"content_hash": "9491c4c2b4f4a5727c470b9b7bd4546f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 66,
"avg_line_length": 25.258064516129032,
"alnum_prop": 0.6015325670498084,
"repo_name": "laughk/kite-string",
"id": "41aab1accc686202a128a05b5172dddd0f6f582d",
"size": "8... |
from south.utils import datetime_utils as 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 'Boostrap3ButtonPlugin.page_link'
db.add_column(u'aldryn_bootstrap3_boostrap3butto... | {
"content_hash": "4226af6efcdc8eca2a0b449585358686",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 196,
"avg_line_length": 80.8258064516129,
"alnum_prop": 0.5743135376756067,
"repo_name": "intip/aldryn-bootstrap3",
"id": "928c3ffce98e83e9bb90e5fa32f8875184df147b",
"size... |
import unittest
import chainer
import numpy
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
@testing.parameterize(*testing.product({
'shape': [(3, 2), ()],
'dt... | {
"content_hash": "87a2c091308ef25e3822aa5325c72b48",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 77,
"avg_line_length": 35.20454545454545,
"alnum_prop": 0.6214762212179901,
"repo_name": "anaruse/chainer",
"id": "ad968eec8b789a1627723f1e12ef6aa8b7cc6baf",
"size": "4647... |
from direct.task.Task import Task
from panda3d.core import *
from panda3d.direct import *
from DistributedNPCToonBaseAI import *
from toontown.quest import Quests
class DistributedNPCSpecialQuestGiverAI(DistributedNPCToonBaseAI):
def __init__(self, air, npcId, questCallback = None, hq = 0):
DistributedNPC... | {
"content_hash": "42e22a3b0151dee2b228cd631b063432",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 119,
"avg_line_length": 37.97345132743363,
"alnum_prop": 0.6243299930086227,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "ca1f76929d08ea72ab2a3ee35b0ec38647fc04... |
from qpid.messaging import *
from qpid.tests.messaging import Base
from qpidtoollibs.broker import EventHelper
import math
class EventTests (Base):
"""
Test various qmf events
"""
def setup_connection(self):
return Connection.establish(self.broker, **self.connection_options())
def setup_se... | {
"content_hash": "22ef6f51d25248ed8a84c89a25f0a87c",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 102,
"avg_line_length": 34.40625,
"alnum_prop": 0.6475930971843779,
"repo_name": "irinabov/debian-qpid-python",
"id": "7ab7b0a1ac80919668517598c4e4be6f01db8dfe",
"size": "2... |
from typing import Any, cast, Dict, Optional
from pyre_extensions import none_throws
from backend.common.consts.award_type import AwardType
from backend.common.consts.notification_type import NotificationType
from backend.common.models.event import Event
from backend.common.models.notifications.notification import No... | {
"content_hash": "f9567def54062d7f5b6028470e824eef",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 83,
"avg_line_length": 35.68181818181818,
"alnum_prop": 0.5872611464968153,
"repo_name": "the-blue-alliance/the-blue-alliance",
"id": "09497b2d06b68ce68b8ec746f073a7a34f6baf2... |
'''
test alarm Image and custom sns text template with email
@author: Ronghao.zhou
'''
import time as time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.zwatch_operations as zwt_ops
import zstackwoodpecker.test_state as test_state
import... | {
"content_hash": "d6611edbba72337519ba69986eec4378",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 116,
"avg_line_length": 54.15483870967742,
"alnum_prop": 0.5450917321896592,
"repo_name": "zstackorg/zstack-woodpecker",
"id": "5d39155b84cd5be893522e2c7dcfb1c149fab983",
... |
from datatypes import Record
from datatypes import Zone
from request import Request
from helpers import parse
class Database:
__logger = None
container = None
database_type = None
def __init__(
self,
container,
database_type,
logger=None
):
self.__logger ... | {
"content_hash": "61709dd6bab57d97d13cc55124eb8610",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 213,
"avg_line_length": 32.212987012987014,
"alnum_prop": 0.5617642315755523,
"repo_name": "Baza207/CloudKitPy",
"id": "482867baab02aac256fb34f0a704ba7d16b1e967",
"size": ... |
from google.cloud import notebooks_v1
async def sample_register_instance():
# Create a client
client = notebooks_v1.NotebookServiceAsyncClient()
# Initialize request argument(s)
request = notebooks_v1.RegisterInstanceRequest(
parent="parent_value",
instance_id="instance_id_value",
... | {
"content_hash": "627736d465fed342dbcea96416f2c4b5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 25.625,
"alnum_prop": 0.7105691056910569,
"repo_name": "googleapis/python-notebooks",
"id": "c638b8d882ad28914c00b7df2ef73e460b5cd97c",
"size": "2013... |
from __future__ import absolute_import, unicode_literals
from django.http import HttpResponseBadRequest
from django.shortcuts import render_to_response
from django.views.decorators.csrf import csrf_exempt
from debug_toolbar.panels.sql.forms import SQLSelectForm
@csrf_exempt
def sql_select(request):
"""Returns t... | {
"content_hash": "b40e0a8dde26c8ec2d159c9acaea81d4",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 97,
"avg_line_length": 35.4054054054054,
"alnum_prop": 0.6040712468193384,
"repo_name": "mvaled/sentry",
"id": "f91f0c7b8e689d66ff3d2eab9b6497ca2b127145",
"size": "3930",
... |
"""Support for the Swedish weather institute weather service."""
import asyncio
from datetime import timedelta
import logging
from typing import Dict, List
import aiohttp
import async_timeout
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION, ATTR_FORECAST_PRECIPITATION, ATTR_FORECAST_TEMP,
... | {
"content_hash": "fd08b7377f581bcd21d71f92d6435b1d",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 79,
"avg_line_length": 30.32034632034632,
"alnum_prop": 0.6045117075956596,
"repo_name": "jamespcole/home-assistant",
"id": "fc3399f755ccc5bdbc32ca45f85fc6c2873f9f92",
"si... |
from msrest.serialization import Model
class EffectiveNetworkSecurityGroup(Model):
"""Effective network security group.
:param network_security_group: The ID of network security group that is
applied.
:type network_security_group: :class:`SubResource
<azure.mgmt.network.v2017_06_01.models.SubRe... | {
"content_hash": "7cb76877fb1994c7b96c577350d92938",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 112,
"avg_line_length": 46.89655172413793,
"alnum_prop": 0.7308823529411764,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "09ab5b1a9ffe9d92d73b0f619163b84ee3ff6da5",
"si... |
from __future__ import unicode_literals
import re
from xml.sax.saxutils import unescape
import html5lib
from html5lib.constants import namespaces
from html5lib.filters import sanitizer
from html5lib.serializer import HTMLSerializer
from bleach.encoding import force_unicode
from bleach.utils import alphabetize_attribu... | {
"content_hash": "9be675790304376caaf6e50e4429282a",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 92,
"avg_line_length": 32.90217391304348,
"alnum_prop": 0.5678064089857945,
"repo_name": "nitin-cherian/LifeLongLearning",
"id": "539711ac10faf92384fa04776bd16f1d5c5c5558",
... |
import MySQLdb
import papercut.settings
settings = papercut.settings.CONF()
class Papercut_Auth:
"""
Authentication backend interface
"""
def __init__(self):
self.conn = MySQLdb.connect(host=settings.dbhost, db=settings.dbname, user=settings.dbuser, passwd=settings.dbpass)
self.cursor... | {
"content_hash": "c46cf6ae90d87ef188745977505e103c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 123,
"avg_line_length": 32.26470588235294,
"alnum_prop": 0.5587967183226983,
"repo_name": "jgrassler/papercut",
"id": "26913858e40f35678c631d07b3f94bc6be1c1db0",
"size": "1... |
import socket
import logging as log
import hashlib
import struct
STARTBYTE = '\x00'
ENDBYTE = '\xff'
HTTP_101_RESPONSE = 'HTTP/1.1 101 Web Socket Protocol Handshake\x0D\x0A'
HTTP_UPGRADE = 'Upgrade: WebSocket\x0D\x0A'
HTTP_CONNECTION = 'Connection: Upgrade\x0D\x0A'
HTTP_ORIGIN = 'WebSocket-Origin: %s\x0D... | {
"content_hash": "9170d5b47a10078a5f6ad18d9e4bc775",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 116,
"avg_line_length": 39.43127962085308,
"alnum_prop": 0.5598557692307692,
"repo_name": "fos/fos-legacy",
"id": "9c9d0fc2fcb37f074c6d0cf9ebab313268e82b5c",
"size": "8320... |
import logging
class Game(object):
def __init__(self, stype, sid, sip, sport):
self.type = stype
self.id = sid
self.ip = sip
self.port = sport
class GameManager(object):
def __init__(self):
self.gamemap = {}
def AddGame(self, stype, sid, sip, sport):
logg... | {
"content_hash": "3ec451f6598d9b74d326357c5b2e0ca1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 87,
"avg_line_length": 27.435897435897434,
"alnum_prop": 0.5373831775700935,
"repo_name": "xiexiangwei/xGame",
"id": "c2359d6169c53cfc6ccb474b3ecd1ceaf4f31fba",
"size": "10... |
from twisted.internet.defer import inlineCallbacks
from twisted.names import client
from twisted.python.modules import getModule
from twisted.trial import unittest
from twistedcaldav.stdconfig import config
from txdav.caldav.datastore.scheduling.ischedule import utils
from txdav.caldav.datastore.scheduling.ischedule.de... | {
"content_hash": "29be20348a0ef5d2b33daa7bbaf461ed",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 110,
"avg_line_length": 39.40350877192982,
"alnum_prop": 0.7061442564559216,
"repo_name": "red-hood/calendarserver",
"id": "56c286d7c31a7779f98a521e16bd3d29b73a7ac7",
"size... |
"""
This is my module brief line.
This is a more complete paragraph documenting my module.
- A list item.
- Another list item.
This section can use any reST syntax.
"""
A_CONSTANT = 1000
"""This is an important constant."""
YET_ANOTHER = {
'this': 'that',
'jam': 'eggs',
'yet': {
'things': [1, 2... | {
"content_hash": "a8c0a728b50e91ec46e1b246ebb61f76",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 22.513513513513512,
"alnum_prop": 0.6198479391756703,
"repo_name": "carlos-jenkins/autoapi",
"id": "3889f0eee287e55150f13f5d96f58db0850d0be6",
"size... |
"""
Tests for the backported class:`str` class.
"""
from __future__ import absolute_import, unicode_literals, print_function
from future.builtins import *
from future import utils
from future.tests.base import unittest, expectedFailurePY2
import os
TEST_UNICODE_STR = u'ℝεα∂@ßʟ℮ ☂ℯṧт υηḯ¢☺ḓ℮'
class TestStr(unittest... | {
"content_hash": "9f74bc2d12ef1ef8ab0e0c2b967f9da2",
"timestamp": "",
"source": "github",
"line_count": 568,
"max_line_length": 85,
"avg_line_length": 33.53697183098591,
"alnum_prop": 0.5465903721980157,
"repo_name": "NcLang/vimrc",
"id": "7e37a62fca6cd5bbbb111055d5ee3a73071e38d7",
"size": "19107",... |
"""
WSGI config for printer project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "printer.settings")
from django.core.w... | {
"content_hash": "94a0c6582a40d8360da9c865b504af99",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7737789203084833,
"repo_name": "3DRPP/printer",
"id": "9c9157422a85e56ffe1b001f024e02e6bdbd1be0",
"size": "389",
... |
from .features import no_op, gradient, gaussian_filter, daisy, dsift
from .predefined import fast_daisy, fast_dsift
from .base import ndfeature, imgfeature
| {
"content_hash": "e96808692ca58ebca4423c5091c1aa2c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 68,
"avg_line_length": 52,
"alnum_prop": 0.8012820512820513,
"repo_name": "jalabort/menpofast",
"id": "1850f7f0030770b575b66428c9db6a2570b849cd",
"size": "156",
"binary": ... |
import sys
import bisect
import contextlib
import warnings
import pkg_resources
import numpy
from PyQt4.QtGui import (
QWidget, QButtonGroup, QGroupBox, QRadioButton, QSlider,
QDoubleSpinBox, QComboBox, QSpinBox, QListView,
QVBoxLayout, QHBoxLayout, QFormLayout, QSpacerItem, QSizePolicy,
QCursor, QIco... | {
"content_hash": "d314889994aece5dae6470e76bef5e82",
"timestamp": "",
"source": "github",
"line_count": 1922,
"max_line_length": 95,
"avg_line_length": 32.89542143600416,
"alnum_prop": 0.5947647291419533,
"repo_name": "kwikadi/orange3",
"id": "722e4d78d23a761f637a24a2e9e686c95eb94d01",
"size": "632... |
def task(*fn, **kwargs):
# decorator without parameters
if fn:
function = fn[0]
function.task_metadata = {}
return function
# decorator with parameters
def wrap(function):
function.task_metadata = kwargs
return function
return wrap
@task
def simple():
... | {
"content_hash": "9c5dacff0825b92571bac21a9a5f50ef",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 21.742857142857144,
"alnum_prop": 0.6005256241787122,
"repo_name": "pydoit/doit",
"id": "a33448a7c8406c38cf82749fec19c97dd7e13b1d",
"size": "761",
... |
from __future__ import absolute_import
from __future__ import division
import click
from guild import click_util
@click.command()
@click.argument(
"packages",
metavar="PACKAGE...",
nargs=-1,
required=True,
autocompletion=click_util.completion_filename,
)
@click.option(
"-U",
"--upgrade",... | {
"content_hash": "72e3773cd8a24d4b01568e22cc5cb34a",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 25.3953488372093,
"alnum_prop": 0.674908424908425,
"repo_name": "guildai/guild",
"id": "93bf3518add5a04100ba2cdcfa56b808b7e78e29",
"size": "1673",
... |
import altair as alt
from . import plotting, themes
from ._core import FramePlotMethods, SeriesPlotMethods
from .plotting import scatter_matrix, andrews_curves, parallel_coordinates, lag_plot
__version__ = '0.2.01.dev0'
| {
"content_hash": "2fcf6ea59eb325d1d376939bbf9ec42d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 84,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.7828054298642534,
"repo_name": "jakevdp/pdvega",
"id": "7e5fa9c8ae14f4c267c8f0abc285fcf5b93c7de6",
"size": "236",
... |
import asyncio
import atexit
from contextlib import suppress
import logging
import gc
import os
import signal
import sys
import warnings
import click
import dask
from dask.system import CPU_COUNT
from distributed import Nanny, Security
from distributed.cli.utils import check_python_3, install_signal_handlers
from dist... | {
"content_hash": "b8fb4fd6895e916ee9f7786deab3cdca",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 95,
"avg_line_length": 28.008849557522122,
"alnum_prop": 0.6191943127962085,
"repo_name": "blaze/distributed",
"id": "fcb10b510922562a3c57f8793f08b9cf5e3fd9f0",
"size": "1... |
from __future__ import unicode_literals
from future.builtins import str
from future.utils import with_metaclass
from json import loads
try:
from urllib.request import urlopen
from urllib.parse import urlencode
except ImportError:
from urllib import urlopen, urlencode
from django.contrib.contenttypes.gener... | {
"content_hash": "8c6469734d3c03fe36401b8552acc782",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 78,
"avg_line_length": 35.885311871227366,
"alnum_prop": 0.6113821138211382,
"repo_name": "cccs-web/mezzanine",
"id": "2d7fe212e394b340bb62efc14e7e85d5f7e45765",
"size": "... |
"""Default configuration for the Airflow webserver."""
from __future__ import annotations
import os
from airflow.www.fab_security.manager import AUTH_DB
# from airflow.www.fab_security.manager import AUTH_LDAP
# from airflow.www.fab_security.manager import AUTH_OAUTH
# from airflow.www.fab_security.manager import AU... | {
"content_hash": "bd75a2af77d3b21f25de13d14d458e89",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 106,
"avg_line_length": 35.017699115044245,
"alnum_prop": 0.6467020470053071,
"repo_name": "apache/airflow",
"id": "ac999a0deafb65b1f5985e1e38a7432ddc0800cc",
"size": "474... |
import gym
import numpy as np
from typing import (
cast,
Dict,
List,
Tuple,
Type,
Union,
)
from ray.rllib.algorithms import AlgorithmConfig
from ray.rllib.algorithms.crr.torch import CRRModel
from ray.rllib.algorithms.ddpg.noop_model import TorchNoopModel
from ray.rllib.models.catalog import M... | {
"content_hash": "8bdfb1303afa97f3a0f07a06470c6580",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 88,
"avg_line_length": 37.479166666666664,
"alnum_prop": 0.5854487060712742,
"repo_name": "ray-project/ray",
"id": "82e9b682fc9a5ec14421d00f6d0de059fc753ddf",
"size": "161... |
import json
import sys
import rethinkdb as r
from dateutil import parser
from elasticsearch import Elasticsearch
def convert_data(raw_data):
return dict(
id=raw_data["id"],
message=raw_data.get("message", ""),
picture=raw_data.get("picture", ""),
updated=parser.parse(raw_data["updated_time"]... | {
"content_hash": "dfbc7c8c660e1ba68c169c6371ae176b",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 22.867469879518072,
"alnum_prop": 0.624868282402529,
"repo_name": "streed/facebookGroupArchive",
"id": "75bc427364ef109548836b1334d6488b36a6a2f2",
"s... |
import warnings
def get_conf():
"""Parses various PETSc configuration/include files to get data types.
precision, indices, complexscalars = get_conf()
Output:
precision: 'single', 'double', 'longlong' indicates precision of PetscScalar
indices: '32', '64' indicates bit-size of PetscInt
... | {
"content_hash": "1ce797364f6b7812865c22d11980a0bf",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 83,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.6185300207039337,
"repo_name": "patemotter/trilinos-prediction",
"id": "ba06dc3026f205399fae94736238ef08779e4eaf",
... |
import base64
import xml.etree.ElementTree as ET
from functools import partial
from urllib.parse import urlencode
from geopy.exc import ConfigurationError, GeocoderQueryError
from geopy.geocoders.base import DEFAULT_SENTINEL, Geocoder
from geopy.location import Location
from geopy.util import logger
__all__ = ("IGNFr... | {
"content_hash": "432599a9a91c44cc807d99e3cc6c8e08",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 81,
"avg_line_length": 36.41532258064516,
"alnum_prop": 0.5445687077842986,
"repo_name": "jmb/geopy",
"id": "702238ce0158cb1842c946ccdf174b72bbfcd76a",
"size": "18062",
... |
import socket
import sys
import threading
import time
SERVERADDRESS = (socket.gethostname(), 6000)
s = socket.socket(type=socket.SOCK_DGRAM)
username=''
class Chat():
def __init__(self, host=socket.gethostname(), port=5000):
try:
s.settimeout(0.5)
s.bind((host, port))
s... | {
"content_hash": "c0321516bbfaf02d2e268fa0f833c221",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 110,
"avg_line_length": 34.645833333333336,
"alnum_prop": 0.4760974143114853,
"repo_name": "Diab0lix/Chat",
"id": "b5997730e822b1808276ee5ff9e49afeb436a34f",
"size": "6787... |
import os
import logging
logger = logging.getLogger('LW')
logger.setLevel(logging.INFO)
handler = logging.FileHandler(os.path.expanduser('~/.lw/lw.log'), mode='w')
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s:%(levelname)s:%(message)s')
handler.setFormatter(formatter)
logger.addHandler(... | {
"content_hash": "6d8b1920456cabb460c6cde9a8c5fbbe",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 75,
"avg_line_length": 25.23076923076923,
"alnum_prop": 0.7652439024390244,
"repo_name": "paeronskruven/lw",
"id": "85f25795dc7ee9defa367ce13fc9459a4cd25a69",
"size": "328"... |
from flask import redirect, render_template, render_template_string, Blueprint, jsonify
from flask import request, url_for
from flask_user import current_user, login_required, roles_accepted, roles_required
from app import app, db
from app.core.models import UserProfileForm, FeatureRequest, User, Product, UsersRoles, R... | {
"content_hash": "9ecbe6ff9a4f5cb7580f10f6f8233db0",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 137,
"avg_line_length": 37.34530386740332,
"alnum_prop": 0.5988608624898292,
"repo_name": "walidham/iws2",
"id": "acf22efadf749b0422ed182a04401aae6bf1fd21",
"size": "13620... |
import numpy as np
# Generally, you want at least a few walkers for each dimension you may be exploring. To start with we are only using `4`, but you may want to eventually increase this to `8` or `10` if you have more cores available for computation. For the **vertical** model, there are 13 parameters.
nparam = 13
... | {
"content_hash": "c66bd058c31e5683c596d4bd4e55b682",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 285,
"avg_line_length": 52.903225806451616,
"alnum_prop": 0.6359756097560976,
"repo_name": "iancze/JudithExcalibur",
"id": "68138b66818fd7e8810adb2b0663cc107b1f5312",
"size... |
import unittest
import json
import os
from subprocess import Popen, PIPE
from genson import SchemaBuilder
BASE_SCHEMA = {"$schema": SchemaBuilder.DEFAULT_URI}
FIXTURE_PATH = os.path.join(os.path.dirname(__file__), 'fixtures')
SHORT_USAGE = """\
usage: genson [-h] [--version] [-d DELIM] [-e ENCODING] [-i SPACES]
... | {
"content_hash": "31c3b3c2a6121c6ff3703edd3c611a38",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 79,
"avg_line_length": 33.3,
"alnum_prop": 0.5645645645645646,
"repo_name": "wolverdude/GenSON",
"id": "acee10f74ad817c183f684f451bbe45cca173d0b",
"size": "4662",
"binar... |
"""Unit tests for gclient.py.
See gclient_smoketest.py for integration tests.
"""
import Queue
import copy
import logging
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import gclient
import gclient_utils
from testing_support import trial_dir
d... | {
"content_hash": "229e869aeb7a5eafd3c9f679806207df",
"timestamp": "",
"source": "github",
"line_count": 878,
"max_line_length": 80,
"avg_line_length": 32.424829157175395,
"alnum_prop": 0.5437844673153255,
"repo_name": "yetu/repotools",
"id": "aff9174e167757c896be49855bf630e432c6ecfc",
"size": "2865... |
from flask import Flask
from flask.ext.assets import Environment, Bundle
from flask_site.helpers import read_yaml, read_env
from flask_site.errors import HTTPMethodNotImplementedError, ControllerNotFoundError, ConfigNotFoundError
import importlib
import os.path
main_config = read_yaml('flask_site/config/config.yml... | {
"content_hash": "3f993e3df4d9ed497c1ce5f461979ada",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 113,
"avg_line_length": 36.6875,
"alnum_prop": 0.6495497688001947,
"repo_name": "dpraul/flask-continuous-env",
"id": "8313bfa245bff0063a83d6c483bd4f87cb1b4a2f",
"size": "4... |
__author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["Dan, Pat"]
class Observable(object):
"""
Describes an Observable object.
includes methods to notify all observers
and to add/delete them
Attributes:
observer_list: the list of registered obser... | {
"content_hash": "d788397b81357b7999d725c293db31b9",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 75,
"avg_line_length": 27.473684210526315,
"alnum_prop": 0.5986590038314177,
"repo_name": "PaulieC/sprint1_Council",
"id": "8003ce840c0e9ed4c38f0f2dd26a8a23d4f0f01e",
"size... |
import sys, os
from ConfigParser import SafeConfigParser
import os.path as op
# Get distribution configuration
dist_root = op.join(op.dirname(__file__), '..')
setup_cfg = op.join(dist_root, 'setup.cfg')
dist_config = SafeConfigParser()
dist_config.read(setup_cfg)
sys.path.append(dist_root)
from pyesgf import __versio... | {
"content_hash": "9b4421a7cc532a57d6e60c89bf173cd3",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 80,
"avg_line_length": 32.130801687763714,
"alnum_prop": 0.7033486539724229,
"repo_name": "stephenpascoe/esgf-pyclient",
"id": "0a5be6021f1177db1f3437786cb60f560d67599b",
... |
from syft.core.node.common.node_table import Base # noqa
| {
"content_hash": "53eb1fa6e24a5b1a068a932ab697837a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 57,
"avg_line_length": 58,
"alnum_prop": 0.7758620689655172,
"repo_name": "OpenMined/PySyft",
"id": "ef9f1337cbbdf6bd0d632d6c690f85cb87bbf1a9",
"size": "138",
"binary": fa... |
from pymongo import MongoClient
from dataservice import DataService
import operator
import math
import time
class Helper(object):
@classmethod
def cosine_similarity(cls, app_list1, app_list2):
return float(cls.__count_match(app_list1, app_list2) / math.sqrt(len(app_list1) * len(app_list2)))
@clas... | {
"content_hash": "5ec28584fe9c1ab19552059b26a3414f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 122,
"avg_line_length": 32.45652173913044,
"alnum_prop": 0.630609511051574,
"repo_name": "brucexiejiaming/App_store",
"id": "7baea4b987f75ae7ff33d5d8b43607ae52e542ec",
"siz... |
import mock
from rally.plugins.common.runners import serial
from tests.unit import fakes
from tests.unit import test
class SerialScenarioRunnerTestCase(test.TestCase):
def setUp(self):
super(SerialScenarioRunnerTestCase, self).setUp()
@mock.patch("rally.task.runner._run_scenario_once")
def test... | {
"content_hash": "daf9c48a8375b073fb865cc188001d8b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 67,
"avg_line_length": 39.833333333333336,
"alnum_prop": 0.5839808726838015,
"repo_name": "shdowofdeath/rally",
"id": "1ae4a8464ce3ee17666fb91ffd3a9724d6dceb1c",
"size": "2... |
import numpy as np
from tilitools.profiler import profile
class MKLWrapper:
"""Lp-norm Multiple Kernel Learning Wrapper for convex semi-supervised anomaly detection
Note:
- p-norm mkl supported
- dual solution is supported.
Written by: Nico Goernitz, TU Berlin, 2013/14
"""
... | {
"content_hash": "b87ca17fe7ce28d9e9f3029952c270a5",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 120,
"avg_line_length": 34.51219512195122,
"alnum_prop": 0.5833922261484099,
"repo_name": "nicococo/tilitools",
"id": "12144d9064e292c1bb160fe1d90d824931bf7360",
"size": "2... |
"""
Copyright (c) 2017 Nico Gräf (nicograef.de, github.com/nicograef)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, mo... | {
"content_hash": "a16a8a1ed08533e91e50cc24e8a9ce44",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 126,
"avg_line_length": 43.439655172413794,
"alnum_prop": 0.6368327049017662,
"repo_name": "graefnico/ai",
"id": "61c8838ab8ab6d7e6bb874974d74e4a912739c23",
"size": "5040"... |
import os
from building import *
def ExtendPackageVar(package, var):
v = []
if var not in package:
return v
for item in package[var]:
v = v + [item]
return v
def BuildPackage(package):
import json
f = open(package)
package_json = f.read()
# get package.json path
... | {
"content_hash": "24b3ddbb53f488270c55040008b6edd8",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 105,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.5859709153122327,
"repo_name": "RT-Thread/rt-thread",
"id": "e9c43b66b7c4361eeb7d82bdf5cfbd3a505eef9e",
"size": ... |
"""This module contains all custom errors."""
import MySQLdb as mdb
class BadRequestError(Exception):
pass
class MySQLPoolSizeError(mdb.DatabaseError):
pass
| {
"content_hash": "f79938044d423d4279f8e4057fa45d78",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 16.9,
"alnum_prop": 0.7514792899408284,
"repo_name": "andjey/status-tracker",
"id": "c2da2423c184cd953f29b2e31aae71a17e86a113",
"size": "169",
"bin... |
import re
from functools import wraps
import json
import inspect
import threading
import six
from funcy import memoize
from .cross import md5hex
import django
from django.db import models
from django.http import HttpRequest
from .conf import redis_client
# NOTE: we don't serialize this fields since their values cou... | {
"content_hash": "8509420161333f3c734b4c625358d877",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 97,
"avg_line_length": 30.772151898734176,
"alnum_prop": 0.6394487865076101,
"repo_name": "th13f/django-cacheops",
"id": "1807a0833e3998707dbd1a9adb3fa750b12c6000",
"size"... |
import json
import mock
import os
from oslo.config import cfg
from heat.common import exception as heat_exception
from heat.common import identifier
from heat.common import policy
from heat.openstack.common import rpc
from heat.common.wsgi import Request
from heat.rpc import api as rpc_api
from heat.api.aws import ex... | {
"content_hash": "d01b94d50df2ceb2c3b1eeb3ff78f2e3",
"timestamp": "",
"source": "github",
"line_count": 1704,
"max_line_length": 79,
"avg_line_length": 44.21948356807512,
"alnum_prop": 0.5228268082282681,
"repo_name": "ntt-sic/heat",
"id": "8b95df1eaa5b2fb9b14141e6ae0c959068028bbb",
"size": "75968"... |
"""Extensions to the Python standard library."""
import sys
__all__ = [
'safe_hasattr',
'try_import',
'try_imports',
]
# same format as sys.version_info: "A tuple containing the five components of
# the version number: major, minor, micro, releaselevel, and serial. All
# values except releaselevel ar... | {
"content_hash": "83bb8e6a17394f89ea9f3f754fa72a23",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 81,
"avg_line_length": 38.648148148148145,
"alnum_prop": 0.6669861044561571,
"repo_name": "testing-cabal/extras",
"id": "e453bc9b3310ec813f6128c6bd14e62b14473059",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.