text stringlengths 4 1.02M | meta dict |
|---|---|
from tests.wot import WotTestCase
class WOTGlobalWarTestCase(WotTestCase):
def setUp(self):
super(WOTGlobalWarTestCase, self).setUp()
self.map_id = 'globalmap'
self.clan_id = 1000000001
self.account_id = 1000000000
self.province_id = 'US_01'
def test_clans(self):
... | {
"content_hash": "8cb57ba4e3ea6699c29eee12c1434167",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 82,
"avg_line_length": 33.95348837209303,
"alnum_prop": 0.6267123287671232,
"repo_name": "therocode/python-wargaming",
"id": "8b3bcca8d908f0d4efa08c0661caed01649a1108",
"si... |
from six.moves import xrange
from django.conf import settings
from django.test import TestCase
from django_sharding_library.routing_read_strategies import RoundRobinRoutingStrategy, PrimaryOnlyRoutingStrategy
class RoundRobinBucketingStrategyTestCase(TestCase):
databases = '__all__'
def test_is_cyclic(self... | {
"content_hash": "abbc8fb4a58e7478b11a62773006d3ac",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 113,
"avg_line_length": 36.93333333333333,
"alnum_prop": 0.6979542719614922,
"repo_name": "JBKahn/django-sharding",
"id": "ac43d551c406ce79b05ed98dcc0a1039e7dd9523",
"size"... |
"""Uniform replay buffer in Python with compressed storage.
PyHashedReplayBuffer is a flavor of the base class which
compresses the observations when the observations have some partial overlap
(e.g. when using frame stacking).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ i... | {
"content_hash": "fecdc8fa171ca27b4c2e0e7fb79d4e4f",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 79,
"avg_line_length": 32.540880503144656,
"alnum_prop": 0.6990722844994202,
"repo_name": "tensorflow/agents",
"id": "cdaf603e7f7fae22ba6a9477595f552d85a6e041",
"size": "5... |
from django.db import models
from django.contrib.auth.models import AbstractUser
class User(AbstractUser,models.Model):
AbstractUser._meta.get_field('email')._unique = True
confirmation_code = models.CharField(max_length=34,null = True,blank = True)
REQUIRED_FIELDS = ('email','first_name')
USERNAM... | {
"content_hash": "fbd8479ca36c4d74faeb6ab219bdbbf9",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 28.31578947368421,
"alnum_prop": 0.6394052044609665,
"repo_name": "28harishkumar/django-diary",
"id": "1f06c66c7e574fe2587c93beb10d081f37c82951",
"si... |
"""
クロージャのサンプルです。
"""
from typing import Callable
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr
class Sample(SampleBase):
def exec(self):
#
# クロージャとは、他の関数によって動的に生成される関数
# その関数の外で作られた変数の値を覚えていて、変更したりできるもの
#
closure1 = Sample.ma... | {
"content_hash": "c9573aee217b9465bcd468ecb9f95950",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 70,
"avg_line_length": 22.107142857142858,
"alnum_prop": 0.5920840064620355,
"repo_name": "devlights/try-python",
"id": "63b68413d1a13cad44f64b4414902263c607831b",
"size": ... |
"""
CorpusReader for reviews corpora (syntax based on Customer Review Corpus).
- Customer Review Corpus information -
Annotated by: Minqing Hu and Bing Liu, 2004.
Department of Computer Sicence
University of Illinois at Chicago
Contact: Bing Liu, [email protected]
http://www.cs.uic.edu/~liub
Distribute... | {
"content_hash": "c4f5b62d40be030ed5c3643ceb3fff7d",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 125,
"avg_line_length": 38.26479750778816,
"alnum_prop": 0.6064479361719449,
"repo_name": "hollabaq86/haikuna-matata",
"id": "d8a32d4c269d6d61ba1a9243fa1e62173f6f07b0",
"s... |
try:
# python 2.7 defaults comes with collections module
from collections import OrderedDict
except Exception as e:
try:
# In python 2.2 to 2.6, user need to install ordereddict via pip
from ordereddict import OrderedDict
except Exception as e:
print(e, "No module found to import... | {
"content_hash": "e25f85bb543f78f675a3e76ca6e29bc2",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 86,
"avg_line_length": 35.333333333333336,
"alnum_prop": 0.6792452830188679,
"repo_name": "atvKumar/open-tamil",
"id": "1535dfef2dcebc79483054a99cfa9a2d54e74c54",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('myresume', '0002_auto_20160802_2217'),
]
operations = [
migrations.RenameModel(
old_name='Skills',
new_name='Skill',
),
... | {
"content_hash": "789d7cb78c02f6bb07c722ce2e11b6dc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 18.941176470588236,
"alnum_prop": 0.5838509316770186,
"repo_name": "italomandara/mysite",
"id": "c6e55b4c373aac5eae1b81a03c776c7488e49258",
"size": "... |
class Dimension:
def __init__(self, line, coln, width, height):
self.line = line
self.coln = coln
self.width = width
self.height = height | {
"content_hash": "2533ed14a8a40fa0350c10359db41be4",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 50,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.5664739884393064,
"repo_name": "pencilcheck/pttbbs-py",
"id": "511e5a49a3fa135c51075d4c42358bccc17173bb",
"size": ... |
from transfert import Resource
from transfert.resources import FileResource
def test_resource():
r = Resource('file:///foo/bar')
assert r.url.scheme == 'file'
assert r.url.path == '/foo/bar'
assert isinstance(r, FileResource)
| {
"content_hash": "9ec2ee525a4535363fe0a5bc92bf5ced",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 44,
"avg_line_length": 27.11111111111111,
"alnum_prop": 0.6967213114754098,
"repo_name": "rbernand/transfert",
"id": "ede62f2b9ad5a98f80f8737f82649d599ee47027",
"size": "244... |
import os
import time
import socket
import shutil
import subprocess
from distutils.spawn import find_executable
import testtools
import click.testing as clicktest
from serv import utils
import serv.serv as serv
from serv import init
def _invoke_click(func, args=None, opts=None):
args = args or []
opts = o... | {
"content_hash": "7241e7b694c90a632021760db4fa711f",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 79,
"avg_line_length": 33.728,
"alnum_prop": 0.5583491461100569,
"repo_name": "nir0s/logrotated",
"id": "70c60be5d3dc70d957eb884a51fdc7821fe14759",
"size": "8432",
"bina... |
"""
The GA4GH data model. Defines all the methods required to translate
data in existing formats into GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import atexit
import base64
import collections
import glob
import json
import os
... | {
"content_hash": "45c49e8a3b92b7638a714652a339c55b",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 78,
"avg_line_length": 35.22384937238494,
"alnum_prop": 0.6401971847716339,
"repo_name": "pansapiens/server",
"id": "cf48744d40d0a07571eaba63c952f1d00e6c4d2e",
"size": "16... |
from test_framework.test_framework import BitsendTestFramework
from test_framework.util import *
from test_framework.mininode import sha256, ripemd160, CTransaction, CTxIn, COutPoint, CTxOut
from test_framework.address import script_to_p2sh, key_to_p2pkh
from test_framework.script import CScript, OP_HASH160, OP_CHECKSI... | {
"content_hash": "70b3b50228a99ae06addd7224134ffe2",
"timestamp": "",
"source": "github",
"line_count": 650,
"max_line_length": 213,
"avg_line_length": 60.58307692307692,
"alnum_prop": 0.6607582721755251,
"repo_name": "madzebra/BitSend",
"id": "c43e7377ea7e6deab670ac7c8cbcdc785fcf67b0",
"size": "39... |
from operator import itemgetter, attrgetter
import random
import sys
import os
import math
import re
# GLOBAL VARIABLES
genetic_code = {
'0000':'0',
'0001':'1',
'0010':'2',
'0011':'3',
'0100':'4',
'0101':'5',
'0110':'6',
'0111':'7',
'1000':'8',
'1001':'9',
'1010':'+',
'1011':'-',
'1100':'*'... | {
"content_hash": "145533966236524bcb6cdbd7e07d6a33",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 154,
"avg_line_length": 29.673992673992675,
"alnum_prop": 0.6485619059375386,
"repo_name": "ActiveState/code",
"id": "4e49c91308855d2dce2fc72bf86b80d736eb7fd8",
"size": "8... |
from setuptools import setup
setup(name='moviemon',
version='1.0.11',
description='Everything about your movies within the command line.',
url='https://github.com/iCHAIT/moviemon',
author='Chaitanya Gupta',
author_email='[email protected]',
license='MIT',
packages=['moviemon... | {
"content_hash": "30bc6b7897ff9193bf870a47fd9f5ea6",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 35.74285714285714,
"alnum_prop": 0.5507593924860112,
"repo_name": "iCHAIT/moviemon",
"id": "eab65aee694cd35e8a4d445d3556c5bf163ecc69",
"size": "1251"... |
import cv2
import numpy as np
from object_detector.scanner import ImageScanner
import helpers
def test_build_image_pyramid():
# Given one sample image (100,100) and the following parameters
image = helpers.get_one_sample_image()
parameters = {"scale": 0.5, "min_y": 20, "min_x": 20}
# W... | {
"content_hash": "fc4987a372c948378db0300de338ae4e",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 152,
"avg_line_length": 36.35064935064935,
"alnum_prop": 0.5794926759556984,
"repo_name": "penny4860/object-detector",
"id": "659b7ce6487b502b4cbb257c657a4449df38fde2",
"si... |
"""The version number defined here is read automatically in setup.py."""
__version__ = "0.14.1.dev20220804"
| {
"content_hash": "797382b335859c1a96b752cf39a392d7",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 72,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.7064220183486238,
"repo_name": "quantumlib/qsim",
"id": "6bd197070705a05fe787c4fd173298b72b3b0ab1",
"size": "109",... |
from argparse import ArgumentParser
import json
import gzip
from collections import defaultdict
from sys import stderr
from morph_seg.preprocessing.token import Token
def parse_args():
p = ArgumentParser()
p.add_argument('input_file', nargs='+', type=str)
return p.parse_args()
def collect_corpus_stats(... | {
"content_hash": "8a36ab8ee80869684a77081b34e12fa7",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 94,
"avg_line_length": 29.62121212121212,
"alnum_prop": 0.5529411764705883,
"repo_name": "juditacs/morph-segmentation-experiments",
"id": "107646fa1de588f5eecf26f4a33c33815d6... |
__author__ = 'andreasveit'
__version__ = '1.3'
# Interface for evaluating with the COCO-Text dataset.
# COCO-Text is a large dataset designed for text detection and recognition.
# This is a Python API that assists in evaluating text detection and recognition results
# on COCO-Text. The format of the COCO-Text... | {
"content_hash": "83cd36eae511321ed70ad85f2fc58eef",
"timestamp": "",
"source": "github",
"line_count": 352,
"max_line_length": 174,
"avg_line_length": 37.39204545454545,
"alnum_prop": 0.6511168515423188,
"repo_name": "NehaTelhan/CompVisionFinalProj",
"id": "94c4100b96e7e70565c072c2192e90b779a52ede",... |
"""Population controller and base classes for online hparam modification."""
import abc
import hashlib
import os
import pickle
import threading
import time
from typing import Any, MutableMapping, Optional, Sequence, Tuple, MutableSequence
import uuid
from absl import logging
import flax
from learned_optimization impor... | {
"content_hash": "43c09097c1f22473f6b1d52623b356a9",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 82,
"avg_line_length": 33.60586319218241,
"alnum_prop": 0.6419501793156925,
"repo_name": "google/learned_optimization",
"id": "0329d18b991c24462a49c032cb8f16b860226be2",
"... |
import sys
from dataclasses import dataclass
from getpass import getpass
from typing import Optional, Iterable, Dict
@dataclass
class Field:
name: str
label: Optional[str]
value: str
sensitive: bool
required: bool
default: str
@staticmethod
def build(name: str, label: Optional[str] = ... | {
"content_hash": "66bc033001780c417f28fe1e113dcebd",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 153,
"avg_line_length": 32.44827586206897,
"alnum_prop": 0.5706695005313497,
"repo_name": "shiroyuki/gallium",
"id": "ce4c06da192218c2532eeab263dcffb366d82dce",
"size": "18... |
from openerp import tools
from openerp.osv import osv, fields
from openerp.osv.orm import except_orm
from openerp.tools import pickle
EXCLUDED_FIELDS = set((
'report_sxw_content', 'report_rml_content', 'report_sxw', 'report_rml',
'report_sxw_content_data', 'report_rml_content_data', 'search_view', ))
#: Possi... | {
"content_hash": "fda4738efd27da6b0e18ba5701819eb3",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 137,
"avg_line_length": 52.387163561076605,
"alnum_prop": 0.5546377899853773,
"repo_name": "lbk0116/NTDP",
"id": "5204e691fd6c69247226b3b5de648aceb70880c0",
"size": "26282... |
from ..core import WesternCalendar
from ..registry_tools import iso_register
@iso_register('FR')
class France(WesternCalendar):
'France'
# Christian holidays
include_easter_monday = True
include_ascension = True
include_whit_monday = True
include_all_saints = True
include_assumption = Tru... | {
"content_hash": "2915d212a33a72c71a7d8b3cc4abf1ca",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 55,
"avg_line_length": 23.964285714285715,
"alnum_prop": 0.6616989567809239,
"repo_name": "novafloss/workalendar",
"id": "b596d67066efa36e48f98d5c47567938579684db",
"size":... |
import bpy
import bmesh
from mathutils import Vector
import numpy as np
import json
import sys
from pathlib import Path
UTILS_PATH = Path.home() / "Documents/python_workspace/data-science-learning"
sys.path.append(str(UTILS_PATH))
import importlib
import ds_utils.blender_utils
importlib.reload(ds_utils.blender_utils... | {
"content_hash": "f4bc2589a4b851f93626e04143c2c9e7",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 113,
"avg_line_length": 30.973214285714285,
"alnum_prop": 0.6584029979821274,
"repo_name": "5agado/data-science-learning",
"id": "069a1bf9a7fe28ee148c4de2cbbe9b244edcfe4e",
... |
""" Lazymq is UDP-semantic over TCP """
import asyncio
import socket
import time
from . import const
from .struct import Connection, Message
from .protocol import Protocol
from .log import l
from .crypt import LinkEncryption
from .tasks import Cleanup
# TODO: test reuse
# TODO: bandwidth limit
... | {
"content_hash": "833c7f1659099aa09d373ada091aa0ac",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 79,
"avg_line_length": 32.82835820895522,
"alnum_prop": 0.5402364173675835,
"repo_name": "ganwell/dht3k",
"id": "44055babc2b5543dc7099c05f8b3b0712834586b",
"size": "8836",... |
from ddapp.consoleapp import ConsoleApp
from ddapp.debugVis import DebugData
import ddapp.visualization as vis
# initialize application components
app = ConsoleApp()
view = app.createView()
view.showMaximized()
# create a sphere primitive
d = DebugData()
d.addSphere(center=(0,0,0), radius=0.5)
# show the sphere in t... | {
"content_hash": "a29df36d10a30cbc177304325c17fc0d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 52,
"avg_line_length": 24.789473684210527,
"alnum_prop": 0.7664543524416136,
"repo_name": "manuelli/director",
"id": "8cfe9f7cdf0edbc7a23eb75be9f3cf9d941511a3",
"size": "47... |
import sys
import gdb
import os
import os.path
pythondir = '/home/build/work/GCC-4-8-build/install-native/share/gcc-arm-none-eabi'
libdir = '/home/build/work/GCC-4-8-build/install-native/arm-none-eabi/lib/armv7-ar/thumb/softfp'
# This file might be loaded when there is no current objfile. This
# can happen if the us... | {
"content_hash": "a319fee7a0756629a2506240517fddd5",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 96,
"avg_line_length": 38.65909090909091,
"alnum_prop": 0.702527924750147,
"repo_name": "marduino/stm32Proj",
"id": "274c522fb798389f55a0430d6437ff34ae4e1044",
"size": "241... |
from __future__ import absolute_import
import os
import subprocess
import sys
import lit.Test
import lit.TestRunner
import lit.util
from lit.formats.base import TestFormat
kIsWindows = sys.platform in ['win32', 'cygwin']
class GoogleBenchmark(TestFormat):
def __init__(self, test_sub_dirs, test_suffix, benchmark_... | {
"content_hash": "22db6cc0f4a4b05a6e67e0729cac22b9",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 84,
"avg_line_length": 38.75409836065574,
"alnum_prop": 0.5617597292724196,
"repo_name": "endlessm/chromium-browser",
"id": "e531cba0b36818e3745d01b94411992d6def086f",
"si... |
import cPickle as pckl
import codecs
import argparse
VOCAB_PATH = "../rsc/vocab.pickle"
def main():
""" Main method. """
argument_parser = init_argument_parser()
args = argument_parser.parse_args()
print args
# Save vocabulary to a pickle file
if args.write:
args_dict = vars(args)
... | {
"content_hash": "e76401ae6a34097ce17cd138aaec4ba5",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 69,
"avg_line_length": 22.436018957345972,
"alnum_prop": 0.5817490494296578,
"repo_name": "Kaleidophon/doppelmoppelbot",
"id": "bd60cf9e4e4bcc117a9f735147e4cc566df7e95b",
... |
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
import FishGlobals
from toontown.fishing import DistributedPondBingoManager
from pandac.PandaModules import Vec3
from direct.task im... | {
"content_hash": "ba66a10b9096508e76d173f763b3affb",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 102,
"avg_line_length": 32.785714285714285,
"alnum_prop": 0.6509319777293634,
"repo_name": "ToontownUprising/src",
"id": "dd2db7bfb69a22ef5884d4aa02f4d076179cd0c7",
"size"... |
from __future__ import unicode_literals
from gevent.server import StreamServer
from http_server import parse_and_respond, make_ERROR_bytestring,\
make_OK_bytestring
from http_server import HttpServer
def generate_response(conn, addr):
# Mostly identical to HttpServer.listen_and_respond,
# but has differ... | {
"content_hash": "c739613b84a2db1465eb0b47dba149a5",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 75,
"avg_line_length": 31.653846153846153,
"alnum_prop": 0.6373025516403402,
"repo_name": "jbbrokaw/network-tools",
"id": "8536f7a8708c90257f76fb91f5b45dfd3925bd22",
"size"... |
from pkg_resources import get_distribution
__version__ = get_distribution("cloud-pso-hive-bigquery").version
| {
"content_hash": "4602984d34751761f1a9e5671ee0eb89",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 65,
"avg_line_length": 27.75,
"alnum_prop": 0.7747747747747747,
"repo_name": "GoogleCloudPlatform/professional-services",
"id": "30105056d22f6fa7d9b98c2fd20f0e6e20930669",
"... |
class CertificatesManager(object):
"""Manager for certificates."""
def __init__(self, client):
self._client = client
def get_ca_certificate(self):
"""Get CA certificate.
:returns: PEM-formatted string.
:rtype: str
"""
resp, body = self._client.get('/certi... | {
"content_hash": "c8b9ff3367176637e7d578587fe0e2d5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 24.178571428571427,
"alnum_prop": 0.5583456425406204,
"repo_name": "magic0704/python-keystoneclient",
"id": "b8d2573f0e206ad3a40d1e0787037da082944a40",... |
'''
New Integration Test for VM vga mode.
@author: quarkonics
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.config_operations as conf_ops
import zstackwoodpecker.test_util as test_util
test_stub = test_lib.lib_get_test_stub()
_config_ = {
'timeout' : 360,
... | {
"content_hash": "5788d6b975ae89d9ed17968b8522cd95",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 91,
"avg_line_length": 28.78048780487805,
"alnum_prop": 0.638135593220339,
"repo_name": "zstackorg/zstack-woodpecker",
"id": "3d592562d46effbb212ca75f3e40746656073ea6",
"si... |
import argparse
import asyncio
import os
import time
import csv
import functools
from collections import namedtuple
from random import randint
from jsonpickle import json
from stp_core.loop.looper import Looper
from stp_core.common.log import getlogger
from plenum.common.types import HA
from plenum.common.util import... | {
"content_hash": "fe2a5fcdab9f40abde14c50e15fe2db1",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 88,
"avg_line_length": 32.3710407239819,
"alnum_prop": 0.5646491473301649,
"repo_name": "spivachuk/sovrin-node",
"id": "eb2d16eb1331408b166d92d4fc283d946ba9b76b",
"size": ... |
''' LICENSE
Copyright (c) 2010--2015, Deep Learning Tutorials Development Team
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
... | {
"content_hash": "d41a6f4817b0e7b5dfbf82ba8185f204",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 112,
"avg_line_length": 40.09004739336493,
"alnum_prop": 0.6011348859203216,
"repo_name": "jasonbunk/BunkNeuralNets",
"id": "99c64f37a36cd7521e395703ecbb9f8fb0727f49",
"si... |
from collections import deque
import random
import time
def play(buttons=3, speed=5, itr=10):
gen_Order = deque(maxlen = itr)
for i in xrange(itr):
nextIn = random.randint(1,buttons)
gen_Order.append(nextIn)
print nextIn
time.sleep(0.75/speed)
while True:
userIn = int(raw_input())
if(not userIn == gen... | {
"content_hash": "50d6aaffa8b4aedf3c3ca32a358b96dc",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 40,
"avg_line_length": 15.03125,
"alnum_prop": 0.6548856548856549,
"repo_name": "SeismicPi/SeismicPi",
"id": "ca36851f3e7f7163e2e8be5177f27b272e2215ff",
"size": "481",
"b... |
"""Serve pre-compressed static content from GridFS with aiohttp.
Requires Python 3.5 or later and aiohttp 3.0 or later.
Start a MongoDB server on its default port, run this script, and visit:
http://localhost:8080/fs/my_file
"""
# -- include-start --
import asyncio
import gzip
import tempfile
import aiohttp.web
fr... | {
"content_hash": "bd6ce4aaa9b774742e5962d1ec73ac95",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 96,
"avg_line_length": 28.61111111111111,
"alnum_prop": 0.7126213592233009,
"repo_name": "mongodb/motor",
"id": "b0dddc6557d5dcc9ccd076d8f284cdf2cd352e1b",
"size": "1545",
... |
THEMES = ["classic", "vim", "dark vim", "midnight", "solarized", "agr-256"]
from pudb.py3compat import execfile, raw_input
import urwid
def get_palette(may_use_fancy_formats, theme="classic"):
if may_use_fancy_formats:
def add_setting(color, setting):
return color+","+setting
else:
... | {
"content_hash": "375ae4758719f6e53f8776caf5c1c00f",
"timestamp": "",
"source": "github",
"line_count": 675,
"max_line_length": 91,
"avg_line_length": 37.69037037037037,
"alnum_prop": 0.49353405919578636,
"repo_name": "amigrave/pudb",
"id": "6eca6caff9e3a16a36db958017624b7d1283db82",
"size": "25441... |
import logging
import os
from gensim.corpora import Dictionary
from gensim.models import TfidfModel, LsiModel
from clustering_system.model.ModelABC import ModelABC
class Lsa(ModelABC):
"""Represent news articles as vectors using Latent Semantic Indexing."""
def __init__(self, dictionary: Dictionary, corpus... | {
"content_hash": "13b04b2be910c15e096bf546c1a1c038",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 116,
"avg_line_length": 33.4264705882353,
"alnum_prop": 0.6234051913770348,
"repo_name": "vanam/clustering",
"id": "5a9b06af03bb0bfd6bd329ba2ead1380d65fd098",
"size": "2273... |
"""
Copyright 2016 ElasticBox All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | {
"content_hash": "3546a7e229e12b86306a19d0e4cf05a1",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 101,
"avg_line_length": 27.186915887850468,
"alnum_prop": 0.63733241663802,
"repo_name": "ElasticBox/elastickube",
"id": "497e7fd35ec4244c657e073595253285fbdc89e6",
"size"... |
from django.shortcuts import render, redirect
from django.views import generic
from .models import CmisServer
class ServerList(generic.ListView):
model = CmisServer
class ServerCreate(generic.edit.CreateView):
model = CmisServer
fields = ['server_name', 'server_address']
success_url = '/'
... | {
"content_hash": "0fb70fe000eeeae88206a7ea762b37de",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 62,
"avg_line_length": 30.68421052631579,
"alnum_prop": 0.6483704974271012,
"repo_name": "wandss/ExportingTool",
"id": "508b5d6e5cd34f07812ba74a6f127ddd2ffb6c93",
"size": "... |
import asyncio
import asyncio_redis
from elude import config
from elude.servers import BaseServer
REDIS_REQUEST_WIP_KEY = '_elude:request_wip'
class RedisServer(BaseServer):
def __init__(self, proxy_gatherer, serialize_func, deserialize_func):
super().__init__(proxy_gatherer)
self.serialize = ser... | {
"content_hash": "cd3cebf023b126aa4835b87d6abae5f3",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 201,
"avg_line_length": 38.476190476190474,
"alnum_prop": 0.6386138613861386,
"repo_name": "leonth/elude",
"id": "265b9cba52e81f4f871ca6176fcfa13e57dde3b2",
"size": "1616",... |
"""All core functions functionalities tests"""
# =============================================================================
# IMPORTS
# =============================================================================
from corral import core, VERSION
import mock
from .base import BaseTest
# ======================... | {
"content_hash": "41c0be42ba8d32eab12d67bb9bc847a2",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 30.129032258064516,
"alnum_prop": 0.4207708779443255,
"repo_name": "toros-astro/corral",
"id": "7a80ecc593d53ee3f44a38022cb4ff9fe2622c00",
"size": "2... |
{
'name': 'Warning Messages and Alerts',
'version': '1.0',
'category': 'Tools',
'description': """
Module to trigger warnings in OpenERP objects.
==============================================
Warning messages can be displayed for objects like sale order, purchase order,
picking and invoice. The messag... | {
"content_hash": "70a2ee9db152922765f12edb2498206d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 32.78947368421053,
"alnum_prop": 0.6035313001605136,
"repo_name": "cristianquaglio/odoo",
"id": "b1b4165d4d98147050eaf2a94bc6c4e768de8fb8",
"size": "... |
"""Tests for ceilometer/storage/impl_log.py
"""
from ceilometer.openstack.common import test
from ceilometer.storage import impl_log
class ConnectionTest(test.BaseTestCase):
def test_get_connection(self):
conn = impl_log.Connection(None)
conn.record_metering_data({'counter_name': 'test',
... | {
"content_hash": "9eefde83c5e17b1b26b6d92187192950",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 33.285714285714285,
"alnum_prop": 0.5493562231759657,
"repo_name": "nttdata-osscloud/ceilometer",
"id": "10062c87825f17b66cb53ff23920142e8a1071dc",
"... |
import unittest
from robot.utils.asserts import *
from robot.utils.text import cut_long_message, _count_line_lengths, \
_MAX_ERROR_LINES, _MAX_ERROR_LINE_LENGTH, _ERROR_CUT_EXPLN,\
get_console_length, pad_console_length
class NoCutting(unittest.TestCase):
def test_empty_string(self):
self._asse... | {
"content_hash": "96e383904c77ae231f4c9234b580f318",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 93,
"avg_line_length": 37.85454545454545,
"alnum_prop": 0.6288824847902658,
"repo_name": "kyle1986/robortframe",
"id": "74ef2249b7c414e5f45dabc91ab6fdc1c9006cc9",
"size": ... |
import atexit
import collections
import contextlib
import ctypes
import logging
import os
import platform
import re
import socket
import struct
import subprocess
import sys
import time
import zipfile
from telemetry.core import exceptions
from telemetry.core.platform import desktop_platform_backend
from telemetry.core.... | {
"content_hash": "57e28de508abb14a77223479e6f174b6",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 80,
"avg_line_length": 34.43532338308458,
"alnum_prop": 0.6626453803366322,
"repo_name": "Fireblend/chromium-crosswalk",
"id": "938414e87d3a1a52238cae6f992d01393fd3491c",
... |
import json
class AttrProp(object):
def __init__(self, name):
self.name = name
def __get__(self, obj, objtype):
return getattr(obj, self.name)
def __set__(self, obj, value):
attr_name = self.name.lstrip('_')
old = getattr(obj, self.name)
setattr(obj, self.name, value... | {
"content_hash": "9403ee15148d0a076fca351811ed1150",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 35.885245901639344,
"alnum_prop": 0.5367747830059388,
"repo_name": "nocarryr/AWS-Identity-Manager",
"id": "7b4e3986188003decace18860d6df2203e55a0da",
... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, ButtonHolder, Submit
from plugin_manager.hosts import models
from django.contrib.auth.models import Group
class HostCreateForm(forms.ModelForm):
jenkins_password = forms.CharField(widget=forms.PasswordInpu... | {
"content_hash": "c4453eceebaf1e92905407c359679d25",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 128,
"avg_line_length": 32.81773399014779,
"alnum_prop": 0.5780546382467727,
"repo_name": "ahharu/plugin-manager",
"id": "147c882cda1e6cfff18b78ff5b6bf1338288a7ac",
"size"... |
from __future__ import unicode_literals
from ..dcmstack import GroupAndStack
def test_GroupAndStack_inputs():
input_map = dict(dicom_files=dict(mandatory=True,
),
embed_meta=dict(),
exclude_regexes=dict(),
force_read=dict(usedefault=True,
),
include_regexes=dict(),
out_ext=dict(usedefa... | {
"content_hash": "8981e7f8e308bcd4728af35d818a69cb",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 67,
"avg_line_length": 28,
"alnum_prop": 0.6428571428571429,
"repo_name": "mick-d/nipype",
"id": "208869f6676eafac682f1e7c4a3cbeb969a71b85",
"size": "950",
"binary": fals... |
import tkinter as tk
from tkinter import ttk
from tkinter.filedialog import askopenfilename
from PIL import Image, ImageTk
import os
import Detachment as dt
import Application
TITLE_FONT_STYLE = 'Helvetica 18 bold underline'
HEADER_FONT_STYLE = 'Helvetica 14 bold'
HEADER_DATA_FONT_STYLE = 'Helvetica 12 bold'
timebl... | {
"content_hash": "f89675c6a3b2c18ee05408ae9ced7711",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 202,
"avg_line_length": 42.80952380952381,
"alnum_prop": 0.5790560940727792,
"repo_name": "jphaupt/understanding-busy-cops",
"id": "3c98ec222978e75836e9a43d1a5edc354a7c1933"... |
"""
Unit tests for references
"""
import unittest
from morbo import *
connection.setup('morbotests')
class TestRelationships(unittest.TestCase):
def setUp(self):
for c in connection.database.collection_names():
try:
connection.database.drop_collection(c)
... | {
"content_hash": "ff339433b51a51a416b39d25e42a46be",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 97,
"avg_line_length": 28.858719646799116,
"alnum_prop": 0.45926719192228255,
"repo_name": "elishacook/morbo",
"id": "db166b47a6c623daa2cbb387baaeb8f69b7e67b0",
"size": "1... |
from __future__ import unicode_literals
from reparse.config import pattern_max_recursion_depth
from reparse.expression import Group, AlternatesGroup, Expression
from reparse.util import separate_string
class ExpressionGroupNotFound(Exception):
pass
class Function_Builder(object):
"""
Function Builder is... | {
"content_hash": "2dd74952c7d7f0a64ba0ed44ad8cf44b",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 111,
"avg_line_length": 39.40425531914894,
"alnum_prop": 0.5860331173506119,
"repo_name": "andychase/reparse",
"id": "8b6fec64934dfc01c2d5f3d126d065887b62af10",
"size": "5... |
from tempest.api.volume import base
from tempest import config
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
CONF = config.CONF
class VolumeSnapshotQuotasNegativeTestJSON(base.BaseVolumeAdminTest):
force_tenant_isolation = True
@classmethod
def skip_checks(cls):
... | {
"content_hash": "37dc57c3b15a0598aab2b7ceee9353b2",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 41.68852459016394,
"alnum_prop": 0.6421549351160047,
"repo_name": "Juniper/tempest",
"id": "0f4e90fd3f2df85a142908f4f23abfe9308a2498",
"size": "3179"... |
import json
from boxsdk.object.terms_of_service_user_status import TermsOfServiceUserStatus
from boxsdk.config import API
def test_get(test_terms_of_service_user_status, mock_box_session):
created_at = '2016-05-18T17:38:03-07:00'
expected_url = f'{API.BASE_API_URL}/terms_of_service_user_statuses/{test_terms_... | {
"content_hash": "e491ad0761a62a6e4cd4ee02982931bd",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 117,
"avg_line_length": 55.48076923076923,
"alnum_prop": 0.7265164644714038,
"repo_name": "box/box-python-sdk",
"id": "0c4362dd2b34f9640df3bc2ebf65d4f8caa6f7c4",
"size": "2... |
from setuptools import setup
from mycroft.util.setup_base import (
find_all_packages,
required,
get_version,
place_manifest
)
place_manifest('mycroft-base-MANIFEST.in')
setup(
name="mycroft-core",
version=get_version(),
install_requires=[required('requirements.txt')],
packages=find_al... | {
"content_hash": "2af9bfee9e59022074e557845701ec95",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 32.1875,
"alnum_prop": 0.6563106796116505,
"repo_name": "aatchison/mycroft-core",
"id": "dc716ef5e8173edff246b71c23e08f54abf73d2a",
"size": "1610",
... |
import logging
import numpy as np
import nibabel as nib
import scipy.ndimage as ndimage
from six import string_types
from .check import check_img
from nilearn._utils import check_niimg
from nilearn.image.image import new_img_like, _fast_smooth_array
log =... | {
"content_hash": "031eb22ac1b40621c73b446892b58e24",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 101,
"avg_line_length": 31.45945945945946,
"alnum_prop": 0.6212414089347079,
"repo_name": "Neurita/boyle",
"id": "aa2ccc987c8d6e6a30249b8af51cd79fc2b7b4d0",
"size": "9313"... |
import os
class Processes():
PIDFILE = "git-events.pid"
def register_process(self):
pidfile = open(self.PIDFILE, 'w')
pidfile.write(str(os.getpid()))
pidfile.close()
def unregister_process(self):
try:
os.remove(self.PIDFILE)
except Exception as fileExc... | {
"content_hash": "b7b621a6ddf3e23df0e0550b8713d75a",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 44,
"avg_line_length": 21.73170731707317,
"alnum_prop": 0.5622895622895623,
"repo_name": "iddl/git-events",
"id": "23983b0e486d8b41df3e08da8448e9a1480aebc6",
"size": "891",... |
"""Test for the TF-IDF example."""
import logging
import os
import re
import tempfile
import unittest
import apache_beam as beam
from apache_beam.examples.complete import tfidf
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that
from apache_beam.testing.util imp... | {
"content_hash": "758a5894628d7b8a04127ce0797f4e70",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 33.27272727272727,
"alnum_prop": 0.6182669789227166,
"repo_name": "peihe/incubator-beam",
"id": "b6f88255887cb432d74eb0880a341004fef91a16",
"size": "... |
import heapq
def funnel(k, numbers):
if k == 0:
return []
heap = numbers[:k]
# heapify: Transform list into a heap, in-place, in linear time.
heapq.heapify(heap)
for num in numbers[k:]:
# heappushpop: Push item on the heap, then pop and return the smallest item from the heap.
... | {
"content_hash": "e33a1dbeef143845e0c6cbb9ddf46234",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 98,
"avg_line_length": 31.82608695652174,
"alnum_prop": 0.6024590163934426,
"repo_name": "gengwg/leetcode",
"id": "95332a4d8d001a9a9b4b51654545c6b354f8dffc",
"size": "997",... |
from horizon.test import helpers as test
class FivecircleTests(test.TestCase):
# Unit tests for AppCatalog.
def test_me(self):
self.assertTrue(1 + 1 == 2)
| {
"content_hash": "1f9065e7ca1230e74bd9c7411a5e2250",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 24.714285714285715,
"alnum_prop": 0.6820809248554913,
"repo_name": "kfox1111/apps-catalog-ui",
"id": "5736aaee519abe344e1f4f6ee6ff14d34187edfb",
"size... |
import json
import mock
from oslotest import mockpatch
from tempest.cmd import verify_tempest_config
from tempest import config
from tempest.tests import base
from tempest.tests import fake_config
class TestGetAPIVersions(base.TestCase):
def test_url_grab_versioned_nova_nossl(self):
base_url = 'http://... | {
"content_hash": "354a9500e81bf866b4970c637efecf6e",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 79,
"avg_line_length": 49.44378698224852,
"alnum_prop": 0.5569052178075634,
"repo_name": "eggmaster/tempest",
"id": "b9afd5e97cb21996817d67cf127fcbfd4f64e2ad",
"size": "17... |
from AccessControl import ClassSecurityInfo
from Products.ATContentTypes.lib.historyaware import HistoryAwareMixin
from Products.Archetypes.public import *
from Products.Archetypes.references import HoldingReference
from Products.CMFCore.permissions import View, ModifyPortalContent
from Products.CMFCore.utils import ge... | {
"content_hash": "b537ba3976efb399930ec70e72abf6b7",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 100,
"avg_line_length": 36.64824120603015,
"alnum_prop": 0.6266282736870972,
"repo_name": "hocinebendou/bika.gsoc",
"id": "835d67b379fb71973c47c66ec8b7990b3914319b",
"size... |
from pyxl.codec.register import pyxl_decode
from pyxl.codec.tokenizer import PyxlParseError
from pyxl.codec.parser import ParseError
#import pyxl.codec.register
import os
import subprocess
passing_cases_path = os.path.dirname(os.path.abspath(__file__))
error_cases_path = os.path.join(passing_cases_path, 'error_cases'... | {
"content_hash": "2c488853cb17e736f447b66dce23992a",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 31.975609756097562,
"alnum_prop": 0.6231884057971014,
"repo_name": "lez/pyxl3",
"id": "e76be65e7ab1b383c95e98c60968d84c1d4d4f19",
"size": "1311",
"... |
""" BVT tests for Snapshots
"""
#Import Local Modules
import marvin
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from integration.lib.utils import *
from integration.lib.base import *
from integration.lib.common import *
from marvin import remoteSSHClient
class Services:
"""Test Snap... | {
"content_hash": "b833fa34c51ea3d04f4abfa845c640d9",
"timestamp": "",
"source": "github",
"line_count": 1146,
"max_line_length": 141,
"avg_line_length": 41.54275741710297,
"alnum_prop": 0.3910897328180138,
"repo_name": "argv0/cloudstack",
"id": "510db0cfd359644461e8fbf1789da57dd6fa131f",
"size": "4... |
import sys, os
try:
from djangotribune import __version__ as djangotribune_version
except ImportError:
djangotribune_version = "last repository version"
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the... | {
"content_hash": "7192e57f2af39792e372199a9b862967",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 80,
"avg_line_length": 32.62980769230769,
"alnum_prop": 0.7101812288198026,
"repo_name": "cible/djangotribune",
"id": "75363dea76ec28aae59ca37b043a0e10ad459daf",
"size": "... |
"""
Created on Thu Jul 27 01:08:03 2017
@author: jacob
"""
import numpy as np
from generate_dataset import Song
import matplotlib.pyplot as plt
max_tempo = 1500000
max_beats = 1500
num_notes = 128
def load_item(value):
return value[0].toarray()
def unique_notes(value):
notes = np.transpose(load_item(va... | {
"content_hash": "4dc2c6ec615d93069fd9158098ff0623",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 164,
"avg_line_length": 39.77333333333333,
"alnum_prop": 0.6765001676164935,
"repo_name": "jacob-ruth/RuthNote",
"id": "6ae3bfab234f8abeb0e750f0eded9b41dea6a576",
"size": "... |
from __future__ import absolute_import, division, print_function
import os
import invoke
import fabric.api
import fabric.contrib.files
from .utils import cd, ssh_host
SALT_MASTER = "192.168.5.1"
@invoke.task(name="sync-changes")
def sync_changes():
# Push our changes to GitHub
# TODO: Determine what orig... | {
"content_hash": "0c352f84d57e2bd75db422912a1205d3",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 79,
"avg_line_length": 35.10236220472441,
"alnum_prop": 0.6078959174517721,
"repo_name": "dstufft/psf-salt",
"id": "b68bfd98e536d417d2d9765cb44ee75e8feab959",
"size": "445... |
import wx
import armid
from DimensionListCtrl import DimensionListCtrl
from Environment import Environment
class EnvironmentPropertiesPanel(wx.Panel):
def __init__(self,parent,dp):
wx.Panel.__init__(self,parent,armid.ENVIRONMENT_PANELENVIRONMENTPROPERTIES_ID)
self.theEnvironmentPanel= parent
mainSizer =... | {
"content_hash": "2b57d8a48990bb3fb96dee43537e5fea",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 215,
"avg_line_length": 42.30769230769231,
"alnum_prop": 0.7412121212121212,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "b91b50cacf0837685616cc26b047d06f67c6d307",
"size... |
from .export import *
from .html import HTMLExporter
from .slides import SlidesExporter
from .exporter import Exporter
from .latex import LatexExporter
from .markdown import MarkdownExporter
from .python import PythonExporter
from .rst import RSTExporter
| {
"content_hash": "486cfcec93382f4a9e82e6e7d31363de",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 38,
"avg_line_length": 31.875,
"alnum_prop": 0.8392156862745098,
"repo_name": "marcoantoniooliveira/labweb",
"id": "c4eb2cb163f3639a8efc9956e580c05632d5a78f",
"size": "255",... |
"""
Objects for dealing with Laguerre series.
This module provides a number of objects (mostly functions) useful for
dealing with Laguerre series, including a `Laguerre` class that
encapsulates the usual arithmetic operations. (General information
on how this module represents and works with such polynomials is in th... | {
"content_hash": "8f86a8ea0a78a7746c2b9603e05934aa",
"timestamp": "",
"source": "github",
"line_count": 1146,
"max_line_length": 76,
"avg_line_length": 29.397033158813265,
"alnum_prop": 0.5770132684258957,
"repo_name": "stefanv/numpy",
"id": "1a75d4af48210c3a7eebb61af88829313dde06c3",
"size": "3368... |
"""
Useful expressions common to many neural network applications.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from th... | {
"content_hash": "bd432e6cb87840d866754a48aad8aa69",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 72,
"avg_line_length": 25.26388888888889,
"alnum_prop": 0.6531061022539857,
"repo_name": "shiquanwang/pylearn2",
"id": "c4eae80138611d9916da34d51dfbd468448f692b",
"size": "... |
import logging
import unittest
import apache_beam as beam
from apache_beam.runners.portability import fn_api_runner
from apache_beam.runners.portability import maptask_executor_runner_test
class FnApiRunnerTest(
maptask_executor_runner_test.MapTaskExecutorRunnerTest):
def create_pipeline(self):
return bea... | {
"content_hash": "ac0d8281a866d8357a1097793787f38b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 25.48,
"alnum_prop": 0.7551020408163265,
"repo_name": "wtanaka/beam",
"id": "91590351e99ef7aaaffbaa7ead6c65e1194ec8ce",
"size": "1422",
"binary": f... |
import abc
from selenium.webdriver.support.event_firing_webdriver import EventFiringWebElement
from robot.api import logger
class Event:
@abc.abstractmethod
def trigger(self, *args, **kwargs):
pass
def _unwrap_eventfiring_element(element):
"""Workaround for Selenium 3 bug.
References:
h... | {
"content_hash": "b550f300e8b8c0bcee9f85b7324b1dd5",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 87,
"avg_line_length": 27.727272727272727,
"alnum_prop": 0.7180327868852459,
"repo_name": "rtomac/robotframework-selenium2library",
"id": "a190c702a64d4f9b0de03d84cdfc6f708af... |
"""Support for Spider thermostats."""
import logging
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
STATE_COOL, STATE_HEAT, STATE_IDLE, SUPPORT_FAN_MODE,
SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE)
from homeassistant.const import ATTR_TE... | {
"content_hash": "bfac8317b781138b33c46bbc6619b49d",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 26.807947019867548,
"alnum_prop": 0.6395750988142292,
"repo_name": "jamespcole/home-assistant",
"id": "3b612441a8846633d9dbc82b3343bb221d48bdd0",
"s... |
"""Util for modifying the GRR server configuration."""
import argparse
import ConfigParser
import getpass
import json
import os
import re
# importing readline enables the raw_input calls to have history etc.
import readline # pylint: disable=unused-import
import sys
import urlparse
# pylint: disable=unused-import,... | {
"content_hash": "605b6c0e513c2426c8be84d2448f8dce",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 80,
"avg_line_length": 36.46797153024911,
"alnum_prop": 0.6843620395218346,
"repo_name": "simsong/grr-insider",
"id": "fb8650fa28f9c0de1d1b556731102d1692df8ce0",
"size": "... |
import sys
from fetch_data import FetchData
from markov_python.cc_markov import MarkovChain
"""
Goofy first attempt at a Python application that uses the Codecademy
markov_python module to create fun/dumb/whatever responses based on
data pulled from various web locations.
Pretty lame, but I didn't want to spend ... | {
"content_hash": "111d26a9eee2363e4b595405c7c1eee3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 90,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.6967320261437908,
"repo_name": "omnifice/markov_chain",
"id": "fdaa6e19eca87fadb0f5b0cda80f52d1043772f7",
"size":... |
import os
from google.cloud import storage
import pytest
import requests
import generate_signed_urls
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
GOOGLE_APPLICATION_CREDENTIALS = os.environ['GOOGLE_APPLICATION_CREDENTIALS']
@pytest.fixture
def test_blob():
"""Provides a pre-existing blob in the test bucket."""
... | {
"content_hash": "2ee5a477c3e66bf12d097fb5dce7f26c",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 77,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.7282608695652174,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "2f3c426a6f6c7c889fc5bc1d56bbb0dd38... |
__author__ = 'gjp'
"""File with Constants used in fiware-facts project.
"""
# HTTP CONSTANTS
CONTENT_HEADER = u'content-type'
JSON_TYPE = u'application/json'
REMOTE_ADDR = u'REMOTE_ADDR'
REMOTE_PORT = u'REMOTE_PORT'
# ORION CONSTANTS
CONTEXT_RESPONSES = u'contextResponses'
CONTEXT_ELEMENT = u'contextElement'
CONTEXT... | {
"content_hash": "ef24edd13d1b887f7e6aa2638fc3aa07",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 52,
"avg_line_length": 24.58823529411765,
"alnum_prop": 0.7464114832535885,
"repo_name": "Fiware/cloud.Facts",
"id": "258cb438b0ad4aff50c79289700c05cb0f17495c",
"size": "12... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('passive_data_kit', '0038_auto_20180821_1414'),
]
operations = [
migrations.AddField(
model_name='dataservermetadatum',
name='last_updated',
field=models.... | {
"content_hash": "fc388700752caace5727f43a5d367e8f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 23.4375,
"alnum_prop": 0.6,
"repo_name": "audaciouscode/PassiveDataKit-Django",
"id": "7093d628f7e1098541a8fbd43dcb62719c417d80",
"size": "472",
"b... |
import collections
import logging
import sys
from telemetry.core.backends.chrome_inspector import inspector_backend
from telemetry.core import exceptions
def DebuggerUrlToId(debugger_url):
return debugger_url.split('/')[-1]
class InspectorBackendList(collections.Sequence):
"""A dynamic sequence of active Inspe... | {
"content_hash": "608c95fd1eb07de624e8d06537c68ff9",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.6788874841972187,
"repo_name": "fujunwei/chromium-crosswalk",
"id": "89a7ada251cb34d720d6e15958438ca41c37e353",
"... |
"""Schemas for user profiles and preferences."""
from flask_babelex import lazy_gettext as _
from marshmallow import Schema, ValidationError, fields
def validate_visibility(value):
"""Check if the value is a valid visibility setting."""
if value not in ["public", "restricted"]:
raise ValidationError... | {
"content_hash": "7d880a4a9c97c166efd9c3d788ed32ad",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.7028423772609819,
"repo_name": "inveniosoftware/invenio-accounts",
"id": "05654acb3ff4772c116cbe9d15e553fd0af6a47d"... |
import abc
import fixtures
import netaddr
import six
from neutron.agent.linux import bridge_lib
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
from neutron.common import constants as n_const
from neutron.openstack.common import uuidutils
from neutron.tests import base as tests_base
fro... | {
"content_hash": "bdc4875e0dd290b70b94662c232072fa",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 79,
"avg_line_length": 28.116731517509727,
"alnum_prop": 0.6397730417935233,
"repo_name": "waltBB/neutron_read",
"id": "4ccf06d2007ffddc54ebb45c31080a5fa763ae77",
"size": ... |
from datetime import datetime
from flask import Blueprint, render_template, current_app
<% if ((package.services.mongodb && package.flask.mongoengine) || package.flask.sqlalchemy) { %>
from <%= package.pythonName %>.models.user import User
<% } %>
mod = Blueprint('index', __name__)
@mod.route("/")
def index():
... | {
"content_hash": "5365177d3a546e8dbb093f7a2d3e645d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 104,
"avg_line_length": 31.136363636363637,
"alnum_prop": 0.6335766423357664,
"repo_name": "heynemann/generator-flask-app",
"id": "7cda31a1d909a8c1ab5415a105ea465c3a58ac61",
... |
import os.path
import shutil
import fixtures
import stubout
from glance.api.middleware import context
from glance.common import config
from glance.tests import utils as test_utils
class TestPasteApp(test_utils.BaseTestCase):
def setUp(self):
super(TestPasteApp, self).setUp()
self.stubs = stubou... | {
"content_hash": "fb0fc41579d23f5179d9344a66d68a8e",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 75,
"avg_line_length": 37.51807228915663,
"alnum_prop": 0.5764290301862556,
"repo_name": "tanglei528/glance",
"id": "e1c772253b55564e7635543c67d8bce37259691b",
"size": "375... |
from Quartz import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestCAEmitterLayer (TestCase):
@min_os_level('10.6')
def testMethods10_6(self):
self.assertResultHasType(CAEmitterLayer.emitterPosition, CGPoint.__typestr__)
self.assertArgHas... | {
"content_hash": "9e53fe14da51642779e99d7660a2ea90",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 89,
"avg_line_length": 43.3,
"alnum_prop": 0.7482678983833718,
"repo_name": "albertz/music-player",
"id": "89e619434d860df4b15a2fe33d6445eccc79b493",
"size": "1732",
"bin... |
class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | {
"content_hash": "2b2d09c728bb260cf638b0e7bd788050",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 76,
"avg_line_length": 28.316831683168317,
"alnum_prop": 0.6447552447552447,
"repo_name": "coursemdetw/reeborg_tw",
"id": "c580e98b3b1fce1991da1a7e1ba2eb93312ec2de",
"size... |
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 M2M table for field numerator_options on 'Formula'
db.create_table(u'survey_formula_numerator_options', (
('id'... | {
"content_hash": "16ca5f4367b913fa268e3fd45c5d78f7",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 229,
"avg_line_length": 90.31343283582089,
"alnum_prop": 0.5716410510659395,
"repo_name": "unicefuganda/mics",
"id": "76136f69d0dff758d80ac8912ed4f32923cc0f85",
"size": "3... |
import sys
import os
import os.path
import subprocess
import sphinx_rtd_theme
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import sphinx_rtd_theme
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, s... | {
"content_hash": "fb8f3cf7548be8177e198c5d24f53793",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 104,
"avg_line_length": 31.563953488372093,
"alnum_prop": 0.6422913980475226,
"repo_name": "timkpaine/lantern",
"id": "0e574b3461361ae4d2c6d52484caa58fc9b397ae",
"size": "... |
import json
import logging
from threading import RLock, Thread
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import unquote_plus, urlparse
from websocket import ABNF, STATUS_NORMAL, WebSocketApp, enableTrace
from streamlink.logger import TRACE, root as rootlogger
from streamlink.session... | {
"content_hash": "3bbd59f097afe847a00d79a5b1890426",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 107,
"avg_line_length": 34.44378698224852,
"alnum_prop": 0.5753306991925786,
"repo_name": "gravyboat/streamlink",
"id": "515fc6e46b1c1c3323d5eeb4b8137cdd76791f76",
"size":... |
from os import listdir, remove
from os.path import exists, join
from .output import generate_output, generate_output_name
def process_queue(source_directory, destination_directory, queue_directory, encoding_profile):
queue = listdir(queue_directory)
for queued_name in queue:
source_file = jo... | {
"content_hash": "131b3114cc07e865c4367b876b91ac17",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 94,
"avg_line_length": 43.23529411764706,
"alnum_prop": 0.6761904761904762,
"repo_name": "kbarnes3/MKVtoMP4",
"id": "3bf40963e53ed4145778a9d40ba42777be0fd0bb",
"size": "735... |
import unittest
from Change import *
class ChangeTest(unittest.TestCase):
def setUp(self):
self.change = Change()
def test_zero_cents(self):
self.assertEqual(self.change.makeChange(0), {})
def test_one_cent(self):
self.assertEqual(self.change.makeChange(1), {'p':1})
def test_four_cents(self... | {
"content_hash": "d70abd984dc92555f860fdb0f3b17634",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 85,
"avg_line_length": 28.3953488372093,
"alnum_prop": 0.6502866502866503,
"repo_name": "Bjornkjohnson/makeChangePython",
"id": "72e1a02a5b8e77f23a9b756be2951466409cf819",
... |
import frappe, subprocess, os
from six.moves import input
def setup_database(force, source_sql=None, verbose=False):
root_conn = get_root_connection()
root_conn.commit()
root_conn.sql("DROP DATABASE IF EXISTS `{0}`".format(frappe.conf.db_name))
root_conn.sql("DROP USER IF EXISTS {0}".format(frappe.conf.db_name))
... | {
"content_hash": "aaf6caae6c7a4baabe3d5c2cf83eae49",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 102,
"avg_line_length": 39.94444444444444,
"alnum_prop": 0.7204450625869263,
"repo_name": "vjFaLk/frappe",
"id": "1dc1ea4c97b1c4e90550beda73af1922e4244502",
"size": "2157",... |
''' Generate a changelog for JupyterLab from the GitHub releases '''
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import re
import requests
import dateutil.parser
# Get the list of releases.
r = requests.get('https://api.github.com/repos/jupyterlab/jupyterlab/r... | {
"content_hash": "01a0d223ba740c829b50519586640420",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 37.25806451612903,
"alnum_prop": 0.5567099567099567,
"repo_name": "jupyter/jupyterlab",
"id": "1259e289c4436ba89f3e2040d6203da96b2d8c59",
"size": "11... |
import inspect
import pydoc
import re
from django.utils.datastructures import SortedDict
def get_arguments(method):
args, varargs, keywords, defaults = inspect.getargspec(method)
if args[0] in ('self', 'cls'):
args = args[1:]
else:
args = list(args)
kwargs = {}
defaults = list(d... | {
"content_hash": "26e368adf233c40ca94829e73eac1915",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 111,
"avg_line_length": 28.47945205479452,
"alnum_prop": 0.5473785473785474,
"repo_name": "apn-online/django-xmlrpc-wp",
"id": "d26c5794c4dbd47930c9958c6be2bae90b662a6d",
"... |
import asyncio
import json
import signal
import sys
import aiohttp
loop = asyncio.get_event_loop()
client = aiohttp.ClientSession(loop=loop)
async def get_json(client, url):
async with client.get(url) as response:
assert response.status == 200
return await response.read()
async def get_reddit_... | {
"content_hash": "e0b7b0b9f2666b03719e15d43531e2e6",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 112,
"avg_line_length": 25.38095238095238,
"alnum_prop": 0.648217636022514,
"repo_name": "sparky952/Dashie",
"id": "6af24956ba3a24dac2029d48c1d593099e869364",
"size": "1066... |
from tempest.api.volume import base
from tempest import config
from tempest.lib import decorators
CONF = config.CONF
class VolumesSnapshotListTestJSON(base.BaseVolumeTest):
@classmethod
def skip_checks(cls):
super(VolumesSnapshotListTestJSON, cls).skip_checks()
if not CONF.volume_feature_ena... | {
"content_hash": "be568d7495b2cce120403b3135a39f92",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 47.22784810126582,
"alnum_prop": 0.6554543017957652,
"repo_name": "cisco-openstack/tempest",
"id": "f4f039c3cc188fa699ff82f728894f6fe9f4898c",
"size... |
import random
from django.utils.encoding import smart_unicode
import jinja2
from jingo import register, env
from tower import ugettext as _
import amo
@register.function
def emaillink(email, title=None, klass=None):
if not email:
return ""
fallback = email[::-1] # reverse
# inject junk somewh... | {
"content_hash": "ed7250c14380ed123f94d8f4522ac74e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 78,
"avg_line_length": 27.00854700854701,
"alnum_prop": 0.6186708860759493,
"repo_name": "anaran/olympia",
"id": "25949e56f2e4653b469054947715edb16cde31e0",
"size": "3160"... |
from django import forms
from django.http import HttpResponse
from django.template import Context, Template
from django.views.generic.edit import UpdateView
from .models import Article
class ArticleForm(forms.ModelForm):
content = forms.CharField(strip=False, widget=forms.Textarea)
class Meta:
model... | {
"content_hash": "ee3862efe27cce0bc7895ad5f6ada630",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 65,
"avg_line_length": 24.06896551724138,
"alnum_prop": 0.6948424068767909,
"repo_name": "takis/django",
"id": "b03472824d1a7bc2d8b03b219e44ce9461d1359b",
"size": "698",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.