text stringlengths 4 1.02M | meta dict |
|---|---|
import time
def knows_how_to_generate(output_file, another_input_dep):
f = open(output_file, "w")
print >>f, "#define GENERATED \"%s\"" % (time.ctime(), )
print >>f, "#define ANOTHER_GENERATED \"%s\"" % (open(another_input_dep).read().strip(), )
f.close()
| {
"content_hash": "c12bc8279389bb4d8a77e6adbf0953ae",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 94,
"avg_line_length": 39,
"alnum_prop": 0.608058608058608,
"repo_name": "da-x/crumb",
"id": "dcbe8d4ea46690bfc7377499956623325b598878",
"size": "273",
"binary": false,
... |
import json
import random
import string
from flask import Flask, request, jsonify
from flask.ext.pymongo import PyMongo
from pymongo.errors import DuplicateKeyError
from crossdomain import crossdomain
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'kasm'
mongo = PyMongo(app)
@app.route('/alias/test')
def hello_... | {
"content_hash": "006433917fc47c27ddacc1f53a98fe42",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 73,
"avg_line_length": 28.74137931034483,
"alnum_prop": 0.5944811037792441,
"repo_name": "clayadavis/OpenKasm",
"id": "62b9e75f048a39ddbbc70d3e4a619598339344bb",
"size": "1... |
import ctypes
import platform
import os
print(platform.system())
if platform.system() == "Linux":
testlib = ctypes.CDLL("./libRunningDict.so")
else:
if platform.architecture()[0] == '64bit':
dllpath = "libRunningDict64.dll"
else:
dllpath = "libRunningDict32.dll"
print("Loading: " + dllp... | {
"content_hash": "272e855d936b8b3bb13985893c423361",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 29.043478260869566,
"alnum_prop": 0.6931137724550899,
"repo_name": "kracejic/runningDict",
"id": "a2bb6ede00236be341359fc1c489808c5186899f",
"size": ... |
from msrest.serialization import Model
class ConnStringValueTypePair(Model):
"""Database connection string value to type pair.
:param value: Value of pair.
:type value: str
:param type: Type of database. Possible values include: 'MySql',
'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'Ser... | {
"content_hash": "14a8d76e1d5bbd603f3243afa55d6de8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 30.678571428571427,
"alnum_prop": 0.6030267753201397,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "a06aab9a003c21fe5a1382a8e7bed3f307b49f0e",
... |
import twitter
import urllib2
import time
import re
import gdbm
opener = urllib2.build_opener()
urllib2.install_opener(opener)
api = twitter.Api(consumer_key="", consumer_secret="",access_token_key="", access_token_secret="",proxy ={})
def get_proxy_urllib(Proxy=None):
if not Proxy:
proxy = urllib2.Proxy... | {
"content_hash": "819c48d83ba3dc5fab2b0fbc6a792cbd",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 169,
"avg_line_length": 41.892561983471076,
"alnum_prop": 0.6406260274873413,
"repo_name": "jayrambhia/Twitter-Data-Mining",
"id": "009128085d0ad2a9e56593fad0baf46174d911f5"... |
"""
Testing the rst files generator
"""
from __future__ import division, absolute_import, print_function
import pytest
from sphinx.errors import ExtensionError
import sphinx_gallery.backreferences as sg
from sphinx_gallery.py_source_parser import split_code_and_text_blocks
from sphinx_gallery.gen_rst import _sanitize_... | {
"content_hash": "add9995da59a3f448b63298fe9fe5036",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 78,
"avg_line_length": 27.304878048780488,
"alnum_prop": 0.5290308173291648,
"repo_name": "Eric89GXL/sphinx-gallery",
"id": "5afb819a5044b1c6c9d498e471b735e90752113c",
"si... |
"""
A cross-platform library to retrieve the current user's special folders (like
Images, Documents, Videos etc.).
"""
import sys
import locale
VERSION = '0.1.0'
__encoding__ = locale.getdefaultlocale()[1]
if sys.platform.startswith("win"):
from win32com.shell import shell, shellcon
__mapping__ = {
'... | {
"content_hash": "265f5712f91f6df42aace55d2ca30328",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 77,
"avg_line_length": 24.62142857142857,
"alnum_prop": 0.5590368436321439,
"repo_name": "mediaodyssee/specialfolders",
"id": "6ee22b4a2d23d1c277a36c94e0259e2264b31eec",
"... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "8c61d3711a231869f1e97df3300a5a42",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 734,
"avg_line_length": 39.95854922279793,
"alnum_prop": 0.7244553941908713,
"repo_name": "CurleySamuel/PyBase",
"id": "d6e84432601f1fbd26a12e70d4d878b4a66eceeb",
"size": ... |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(13, GPIO.OUT)
GPIO.output(13, False)
time.sleep(5)
GPIO.cleanup() | {
"content_hash": "512dcb4232059867e7d68b522a155eb6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 24,
"avg_line_length": 14,
"alnum_prop": 0.75,
"repo_name": "EchoFUN/raspi",
"id": "1b6d95af3a89d8772b3dfd220670e486ed2a07bc",
"size": "317",
"binary": false,
"copies":... |
import os
import re
from django import template
from django.conf import settings
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.templatetags.staticfiles import static
register = template.Library()
DEFAULT_HTML_TAGS = {
'.css': '<link rel="stylesheet" href="{}">',
'.js': '<scri... | {
"content_hash": "19da8b6983828f59884a2005e364f01e",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 81,
"avg_line_length": 37.71578947368421,
"alnum_prop": 0.5819145967066703,
"repo_name": "tino/django-grunted-assets",
"id": "208e7e136bf199588824cdeb8a9015b9af97c97f",
"si... |
"""
Utility methods for working with WSGI servers
"""
import errno
import json
import logging
import os
import signal
import sys
import time
import eventlet
from eventlet.green import socket
from eventlet.green import ssl
import eventlet.greenio
import eventlet.wsgi
from oslo_config import cfg
import oslo_i18n
from o... | {
"content_hash": "ee4a884da6678d74ca0e5bb36bb18827",
"timestamp": "",
"source": "github",
"line_count": 753,
"max_line_length": 79,
"avg_line_length": 35.26029216467464,
"alnum_prop": 0.6104854807728523,
"repo_name": "tengqm/senlin",
"id": "b747791c605ffc43c676be3a22cdc2e503af5566",
"size": "27312"... |
with open("primes.txt") as f:
primes = f.readlines();
total = 0
for prime in primes:
total += int(prime)
print(total)
| {
"content_hash": "ff890212b62157735f04ba1fff8d4438",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 29,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.6136363636363636,
"repo_name": "bobismijnnaam/bobe-euler",
"id": "b6f6d4d7255fb69c41cc47633dba00dba7a920c3",
"size... |
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_databas... | {
"content_hash": "d7694716704cd9596109ffe4ce071fe1",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 767,
"avg_line_length": 47.2,
"alnum_prop": 0.7183380414312618,
"repo_name": "luci/luci-py",
"id": "17dfa59e75f765e66891cf07362f1b658e82f3dd",
"size": "8629",
"binary": ... |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import cts
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
#... | {
"content_hash": "95c71424e3a10bee890e9683b580aafa",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 80,
"avg_line_length": 28.208588957055216,
"alnum_prop": 0.6854066985645934,
"repo_name": "mgbellemare/SkipCTS",
"id": "aa5f8cbc6e95f34d2709bc7ae9cf768dea10b234",
"size": ... |
DOCUMENTATION = '''
Bifrost Inventory Module
========================
This is a dynamic inventory module intended to provide a platform for
consistent inventory information for Bifrost.
The inventory currently supplies two distinct groups:
- localhost
- baremetal
The localhost group is required for Bifrost ... | {
"content_hash": "ee67b1cf7e0ba290799649acf9792883",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 78,
"avg_line_length": 36.15632754342432,
"alnum_prop": 0.5707226683137739,
"repo_name": "bcornec/bifrost",
"id": "276371cf0a452b35fc1a12b5e51a7f73992a2496",
"size": "1520... |
__author__ = "Mike Belov"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__maintainer__ = "Mike Belov"
__email__ = "dedm@nginx.com"
def import_class(qualname):
module_name, class_name = qualname.rsplit('.', 1)
module = import_module(module_name)
return getattr(module, cl... | {
"content_hash": "4e1c7deac6e0f7946c2d5c3997994163",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 26.157894736842106,
"alnum_prop": 0.6257545271629779,
"repo_name": "nginxinc/nginx-amplify-agent",
"id": "c56bd85997c482875a9a71c39faf9a597c33b45f",
... |
bl_info = {
"name": "Bonsai",
"author": "Dolf Veenvliet",
"version": 1,
"blender": (2, 5, 6),
"api": 31847,
"location": "object > Bonsai ",
"description": "Build a bonsai",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Object"}
"""
Usage:
Launch from Object menu
Add... | {
"content_hash": "2d641a5d3bdc8c9076a0486363f45178",
"timestamp": "",
"source": "github",
"line_count": 1481,
"max_line_length": 459,
"avg_line_length": 28.491559756921,
"alnum_prop": 0.5921177362783202,
"repo_name": "kellpossible/VoxelEditor",
"id": "f9bc5bc61c4d8edc573bbe34821bb4def14c7ee0",
"siz... |
"""Scenic trainer for zero-shot text-based visual classification evaluation.
Note this "trainer" doesn't actually train but just evaluates.
"""
from collections.abc import Mapping
import functools
from typing import Optional
from absl import logging
from clu import metric_writers
from flax import jax_utils
import fl... | {
"content_hash": "d375ac9daa7c4f00c92da77e154d926c",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 84,
"avg_line_length": 35.948805460750854,
"alnum_prop": 0.6733124465964113,
"repo_name": "google-research/scenic",
"id": "97532146644126fc6d7c7053960ebb1daacb8e0f",
"size... |
"""Render a CSV file using d3.js."""
from __future__ import absolute_import, print_function
import csv
from flask import current_app, render_template
from ..proxies import current_previewer
from ..utils import detect_encoding
previewable_extensions = ['csv', 'dsv']
def validate_csv(file):
"""Return dialect i... | {
"content_hash": "a00da8668ed58fc3bcb23fb25afc372e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 30.5,
"alnum_prop": 0.6125683060109289,
"repo_name": "inveniosoftware/invenio-previewer",
"id": "80349d5b7de34359029f6aa39e2969c1cb2cfcf5",
"size": "... |
import matplotlib.pyplot as plt
import argparse
import json
from pr_json_common import *
from json_dict_common import *
scalings = { 'constant' : (lambda x, y : 1.),
'lineard' : (lambda x, y : float(x) / y),
'lineari' : (lambda x, y : float(y) / x),
'quadraticd' : (lambda x, y : flo... | {
"content_hash": "ac432d641fb8727a6f18f87c3b64ae28",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 118,
"avg_line_length": 38.544444444444444,
"alnum_prop": 0.6274142404151052,
"repo_name": "arm-hpc/allinea_json_analysis",
"id": "7b0af33cecd90da883763cfcfe52c84d8a267617",... |
import pandas as pd
# TODO: move your MINT.com transactions.csv into this project directory
# / the directory where you are running jupyter notebook
PATH_TO_YOUR_TRANSACTIONS = "transactions.csv"
df = pd.DataFrame.from_csv(PATH_TO_YOUR_TRANSACTIONS)
## Create a Dataframe view for only 2016 year transactions
# the ... | {
"content_hash": "b6abdf47ee4b8a459ce9c47da10bf4b0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 102,
"avg_line_length": 43.52777777777778,
"alnum_prop": 0.7370772176132737,
"repo_name": "wilsonqin/pandas-mint-taxes",
"id": "20f40ef376264c52842c0c96bae9f2d8780d58d4",
"... |
"""
UserBot module
Copyright 2015-2016, Ismael R. Lugo G.
"""
import glob
import posixpath
import builder
reload(builder)
for name in glob.glob('mods/ubmod/ubmod/*.ini'):
builder.ubmodule(posixpath.basename(name))
| {
"content_hash": "910da1184b48fb937a6ed7693a712e71",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 48,
"avg_line_length": 17,
"alnum_prop": 0.7375565610859729,
"repo_name": "IsmaelRLG/UserBot",
"id": "edf85a177b7182bb1f74c2fe046242a31569527c",
"size": "245",
"binary": ... |
import sys, inspect
import numpy as np
from copy import deepcopy
from collections.abc import Iterable
from ..mfbase import MFDataException, FlopyException
from .mfstructure import DatumType
from ...utils.datautil import PyListUtil, DatumUtil
import struct
def iterable(obj):
return isinstance(obj, Iterable)
def ... | {
"content_hash": "8d9131dad7be029d5c0e8ad7a4267e2b",
"timestamp": "",
"source": "github",
"line_count": 822,
"max_line_length": 79,
"avg_line_length": 34.20559610705596,
"alnum_prop": 0.5255895010136217,
"repo_name": "aleaf/flopy",
"id": "530533c5d394c4f55e3d2f41c95d735fcdd468da",
"size": "28117",
... |
"""SAC tests."""
import pickle
from absl.testing import absltest
from absl.testing import parameterized
from brax import envs
from brax.training.acme import running_statistics
from brax.training.agents.sac import networks as sac_networks
from brax.training.agents.sac import train as sac
import jax
class SACTest(par... | {
"content_hash": "a4ff0d970a4ea69067362752eb2161d3",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 79,
"avg_line_length": 31.725806451612904,
"alnum_prop": 0.6634468734112863,
"repo_name": "google/brax",
"id": "7ae0fdd7325890b7aff17b9ce263bfabe094a4e9",
"size": "2549",
... |
from __future__ import unicode_literals
from vulyk.models.task_types import AbstractTaskType
from vulyk_tagging.models.tasks import TaggingAnswer, TaggingTask
class TaggingTaskType(AbstractTaskType):
"""
Tagging Task to work with Vulyk.
"""
answer_model = TaggingAnswer
task_model = TaggingTask
... | {
"content_hash": "c620398ec2a33a303740028dc18a6867",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 65,
"avg_line_length": 30.558823529411764,
"alnum_prop": 0.631376323387873,
"repo_name": "hotsyk/vulyk-tagging",
"id": "1746dad5f278c79bfdc3686e547c9621785ab6e4",
"size": "... |
"""
SQLAlchemy-JSONAPI
Flask Adapter
Colton J. Provias
MIT License
"""
import datetime
import json
import uuid
from functools import wraps
from blinker import signal
from flask import make_response, request
from .errors import BaseError, MissingContentTypeError
from .serializer import JSONAPI
try:
from enum imp... | {
"content_hash": "04d2227caa31bc5211f6c8c941849419",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 78,
"avg_line_length": 34.86617100371747,
"alnum_prop": 0.5641326367416569,
"repo_name": "emilecaron/sqlalchemy-jsonapi",
"id": "4b432840d28ff6d7841122198d5aabd4f3ad2a67",
... |
""" Setup file """
from setuptools import setup, find_packages
import os
import re
HERE = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(HERE, 'README.rst')).read()
CHANGES = open(os.path.join(HERE, 'CHANGES.rst')).read()
# Remove custom RST extensions for pypi
CHANGES = re.sub(r'\(\s*:(issue|... | {
"content_hash": "f6a56015061bc63a047db8f5102ce30e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 78,
"avg_line_length": 31.26595744680851,
"alnum_prop": 0.547465124191902,
"repo_name": "rubikloud/pypicloud",
"id": "ef2c67a5f94ac00e81d69f26c9d2d2f965f749de",
"size": "29... |
import numpy as np
from pySDC.implementations.problem_classes.HeatEquation_1D_FD_periodic import heat1d_periodic
from pySDC.implementations.datatype_classes.mesh import mesh
from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right
from pySDC.implementations.sweeper_classes.generic_i... | {
"content_hash": "0981f6ffe258451252208c04d5a1dc91",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 117,
"avg_line_length": 40.31896551724138,
"alnum_prop": 0.6886893307675861,
"repo_name": "danielru/pySDC",
"id": "384ce2bb9ac1e563124dfd9c3e1a03a583eb1d43",
"size": "4677... |
from restbasetest import *
from common.rest.storage_helper import VolumeHelper, VolumeSnapshotHelper
class TestVolumeSnapshotRequests(RESTBaseTest):
@classmethod
def setup_class(cls):
super(TestVolumeSnapshotRequests, cls).setup_class()
cls.vhelper = VolumeHelper(cls.utils)
cls.shelp... | {
"content_hash": "9c548e4fb59107b328f8fd13f235a907",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 102,
"avg_line_length": 39.490196078431374,
"alnum_prop": 0.6708043694141013,
"repo_name": "paypal/aurora",
"id": "854bf10855f6abc83466d97f1b2797b86e2be538",
"size": "2014"... |
import test.test_support
from test.test_support import verbose
import random
import re
import sys
import threading
import thread
import time
import unittest
import weakref
from test import lock_tests
# A trivial mutable counter.
class Counter(object):
def __init__(self):
self.value = 0
def inc(self):
... | {
"content_hash": "eeb521f90d0120b8cb2a80addda6ee4b",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 84,
"avg_line_length": 35.998062015503876,
"alnum_prop": 0.5584387617765815,
"repo_name": "DecipherOne/Troglodyte",
"id": "054df7ba69b6a16adba7f8902aa6cb8c7d1923e7",
"size... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import abel
from . import basex
from . import dasch
from . import daun
from . import direct
from . import hansenlaw
from . import linbasex
from . impor... | {
"content_hash": "26e60b216826a76146a14c53d8875cdc",
"timestamp": "",
"source": "github",
"line_count": 839,
"max_line_length": 79,
"avg_line_length": 37.156138259833135,
"alnum_prop": 0.5255982549560532,
"repo_name": "stggh/PyAbel",
"id": "9d4145723630196e479a29e7693e441b7fedfc0d",
"size": "31230"... |
"""Tests for listener subprocesses."""
# pylint: disable=protected-access,no-self-use
from unittest import TestCase
import inputs
from tests.constants import mock, PYTHON
if PYTHON == 3:
mock._magics.add('__round__')
RAW = ""
# Mocking adds an argument, whether we need it or not.
# pylint: disable=unused-argume... | {
"content_hash": "78c7a3c2906b864461eaabbcafa8550b",
"timestamp": "",
"source": "github",
"line_count": 930,
"max_line_length": 78,
"avg_line_length": 36.240860215053765,
"alnum_prop": 0.6017089959648706,
"repo_name": "zeth/inputs",
"id": "9501d13915265f9de2bed50fbb9f497be2eb93d8",
"size": "33704",... |
import pytest
from ezdxf.entities.hatch import Hatch
from ezdxf.lldxf.tagwriter import TagCollector, basic_tags_from_text
from ezdxf.lldxf import const
HATCH = """0
HATCH
5
0
330
0
100
AcDbEntity
8
0
62
1
100
AcDbHatch
10
0.0
20
0.0
30
0.0
210
0.0
220
0.0
230
1.0
2
SOLID
70
1
71
0
91
0
75
1
76
1
98
1
10
0.0
20
0.0
""... | {
"content_hash": "8c4122da9a9e92c628c4887c58538c86",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 69,
"avg_line_length": 17.757575757575758,
"alnum_prop": 0.658703071672355,
"repo_name": "mozman/ezdxf",
"id": "3fa2938226741fefd4937e8c19fef364db41d0da",
"size": "2408",
... |
from rest_framework import serializers
from .models import User
class AuthenticatedUserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id', 'name', 'email')
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id... | {
"content_hash": "703e17f4e2e29a7788fd0f500b31d0e4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 63,
"avg_line_length": 22.066666666666666,
"alnum_prop": 0.6706948640483383,
"repo_name": "FreeMusicNinja/api.freemusic.ninja",
"id": "b94bd247ec9052413ac31250cd89046a215e56e... |
"""
Sizun - Software Quality Inspection
MIT License
(C) 2015 David Rieger
"""
"""
Instantiates a parser accd. to the parameter
passed to the constructor
"""
class ParserFactory():
concrete_parser = {'JAVA': JavaParser, 'PY': PyParser}
def create(self, language):
return self.concrete_parser[language... | {
"content_hash": "aa67966230cc921a0cc580b92ee33353",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 58,
"avg_line_length": 18,
"alnum_prop": 0.691358024691358,
"repo_name": "FrontSide/Sizun",
"id": "9562fcd4d17325ccdec4babbd3a56f4fefcce945",
"size": "325",
"binary": fal... |
import sys
import json
import shlex
import select
import threading
import contextlib
import subprocess
from try_leela import names
def close_(fd):
try:
fd.close()
except:
pass
class Session(object):
def __init__(self, exe, tree):
self.exe = exe
self.tree = tree
... | {
"content_hash": "0ed97ef1275afb49fff90cf7d9335f42",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 102,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.4646433041301627,
"repo_name": "locaweb/leela",
"id": "0b4783c1837ff418ae5602612f91abf00b818487",
"size": "3221... |
STEPSIZE = 8
TABSIZE = 8
EXPANDTABS = 0
import os
import re
import sys
next = {}
next['if'] = next['elif'] = 'elif', 'else', 'end'
next['while'] = next['for'] = 'else', 'end'
next['try'] = 'except', 'finally'
next['except'] = 'except', 'else', 'end'
next['else'] = next['finally'] = next['def'] = next['class'] = 'end'... | {
"content_hash": "cdba8f7ac9fe1e19808f95a7a085a2af",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 98,
"avg_line_length": 31.401727861771057,
"alnum_prop": 0.4971456083637114,
"repo_name": "OS2World/APP-INTERNET-torpak_2",
"id": "39cdcc8b469dcaf0bb06208d0edd06a279f93319",... |
from .compat import callable, cmp, reduce, \
threading, py3k, py33, py2k, jython, pypy, cpython, win32, \
pickle, dottedgetter, parse_qsl, namedtuple, next, WeakSet, reraise, \
raise_from_cause, text_type, string_types, int_types, binary_type, \
quote_plus, with_metaclass, print_, itertools_filterfalse... | {
"content_hash": "f69f90df4196cb83b5aff22c13136b05",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 74,
"avg_line_length": 53,
"alnum_prop": 0.7577766445690974,
"repo_name": "sauloal/PiCastPy",
"id": "739caefe034d799f184059afaed0f7552d7317ec",
"size": "2196",
"binary": ... |
from django.db import models
from django.utils import timezone
class Post(models.Model):
author = models.ForeignKey('auth.User')
title = models.CharField(max_length=200)
text = models.TextField()
created_date = models.DateTimeField(default=timezone.now)
published_date =... | {
"content_hash": "0bf93a1c48bee2df7258a58555ca2663",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 64,
"avg_line_length": 29.555555555555557,
"alnum_prop": 0.650375939849624,
"repo_name": "raytung/DjangoGirls",
"id": "5c4502ce8c46a38865dc4b44bf3a762c6d011fdf",
"size": "5... |
__all__ = ['msetting','get_machine','set_machines','outerpath']
class msetting:
def __init__(self,
engine = 'sqlite3', #'postgresql_psycopg2',
host = '',
port = '', # 5432 for postgresql (usually)
tempdir = '... | {
"content_hash": "aeb244b76239424d298610a1da0f3390",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 26.976744186046513,
"alnum_prop": 0.44913793103448274,
"repo_name": "lsbardel/flow",
"id": "e389ba3a09c9a1c0dc4464f981bba23958dafd89",
"size": "1160"... |
from __future__ import annotations
from collections import defaultdict
import itertools
from typing import (
Hashable,
Iterable,
)
import numpy as np
from pandas._libs.sparse import IntIndex
from pandas._typing import NpDtype
from pandas.core.dtypes.common import (
is_integer_dtype,
is_list_like,
... | {
"content_hash": "fb9b2cfe7739501dafaef4b5006623ab",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 87,
"avg_line_length": 33.24574669187145,
"alnum_prop": 0.554045601865014,
"repo_name": "pandas-dev/pandas",
"id": "7e45e587ca84a45bda899356b8d0efc979331a00",
"size": "175... |
import numpy as np
from cs231n import optim
class Solver(object):
"""
A Solver encapsulates all the logic necessary for training classification
models. The Solver performs stochastic gradient descent using different
update rules defined in optim.py.
The solver accepts both training and validatai... | {
"content_hash": "994a28c9388f39f4ca1ead11884a9632",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 83,
"avg_line_length": 41.10236220472441,
"alnum_prop": 0.5912835249042145,
"repo_name": "machinelearningnanodegree/stanford-cs231",
"id": "911524673819f809939cca052fab55c7f... |
import logging
import json
from flask import Blueprint, request, jsonify, current_app
from sqlalchemy.exc import IntegrityError
from .core import db
from .services import (
UserGroupService, PermissionService, UserGroupMemberService,
UserPermissionService, UserGroupPermissionService,
VerificationService,
)
... | {
"content_hash": "15c0d4ad28c816bf38cb6085901b848c",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 106,
"avg_line_length": 38.53250773993808,
"alnum_prop": 0.6933954684235899,
"repo_name": "soasme/flask-perm",
"id": "4beaf95bcc690e289a8edceb56332b0f03dc26f1",
"size": "1... |
"""
Tool to figure find the USB device that a board is available at.
This is a complicated process as the FX2 is software configurable and hence
could end up under many different VID:PID names based on what firmware is
currently loaded onto it.
"""
import logging
import os
import os.path
import sys
import time
import... | {
"content_hash": "596b2b270534ac552f5d4582af1bf413",
"timestamp": "",
"source": "github",
"line_count": 599,
"max_line_length": 104,
"avg_line_length": 32.97662771285476,
"alnum_prop": 0.5969726117551765,
"repo_name": "timvideos/HDMI2USB-mode-switch",
"id": "a65434f6693d6744559c8edc8a48b28f967fb1c1",... |
import os
import time
import sys
import uuid
from threading import Thread
import yaml
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import libtorrent as lt
from pytvdbapi import api as TVDB
from tpb import TPB, ORDERS as TPB_ORDERS
from ui.mainWindow import Ui_MainWindow
from libs.progress import Progress
c... | {
"content_hash": "ed9439a4be5ccd30f7bdb5a29d2a1506",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 115,
"avg_line_length": 35.74935400516796,
"alnum_prop": 0.5825804119985544,
"repo_name": "lecler-i/ZTShows",
"id": "16b9fba6c8dee6e9fc27a2f2a70d41ee0d505338",
"size": "13... |
import pandas as pd
import numpy as np
import cv2
import sys
import os
from keras.models import Sequential
from keras.callbacks import Callback, ModelCheckpoint
from keras.layers import (Flatten, Dense, Convolution2D, MaxPool2D,
BatchNormalization, Dropout, Activation, Cropping2D, Lambda)
from keras.optimizers import... | {
"content_hash": "f38ba26ad44fa22bd83d732a23cc240e",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 165,
"avg_line_length": 35.89568345323741,
"alnum_prop": 0.6119851688545946,
"repo_name": "ssarangi/self_driving_cars",
"id": "34f2bd06dcaeeca76c827c30ef2928e4d545c833",
"... |
class Problem(object):
def __init__(self, filename, line, message, linter,
is_error=True, has_line_change=False):
self.filename = filename
self.line = line
self.message = message
self.linter = linter
self.is_error = is_error
self.has_line_change = has... | {
"content_hash": "9a0d435c6003d520e54555b5f6b9347c",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 93,
"avg_line_length": 28.848101265822784,
"alnum_prop": 0.4646774901272488,
"repo_name": "bosondata/badwolf",
"id": "5295572949f01339d3cbdd65eb3b11e88e2c295d",
"size": "23... |
import sys
import os
import sphinx_rtd_theme
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.napoleon'
]
# Napoleon settings
napoleon_google_docstring = True
nap... | {
"content_hash": "8ba43d389adfa13c00b56a3bcf6cc60c",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 76,
"avg_line_length": 29.85239852398524,
"alnum_prop": 0.703584672435105,
"repo_name": "bprinty/gems",
"id": "6f7837cf689ab510c9ea4456228f8f4bc03000e9",
"size": "8529",
... |
from firehose.model import (Analysis, Generator, Metadata,
DebianBinary, DebianSource)
from ethel.commands import PLUGINS, load_module
from ethel.client import get_proxy, checkout
from contextlib import contextmanager
from ethel.utils import tdir, cd, run_command
from ethel.config import lo... | {
"content_hash": "2418eb75070e13a08103ca9255e24c96",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 106,
"avg_line_length": 34.11347517730496,
"alnum_prop": 0.5594594594594594,
"repo_name": "paultag/ethel",
"id": "0ebe2fe0d961ef53592d79981535f22db730f8b4",
"size": "4810"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import kpcc_backroom_handshakes.custom_fields
class Migration(migrations.Migration):
dependencies = [
('election_registrar', '0003_resultsource_ready_to_build'),
('newscast', '0006_r... | {
"content_hash": "6bcc8034fe6135e995f5706fbf572fed",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 141,
"avg_line_length": 53.87096774193548,
"alnum_prop": 0.6431137724550898,
"repo_name": "SCPR/kpcc_backroom_handshakes",
"id": "268c31d3b43219a3264af7fd8fa75adc558a7e2e",
... |
from __future__ import absolute_import
from agms.exception.unexpected_exception import UnexpectedException
class Response():
"""
A class representing AGMS Response objects.
"""
def __init__(self, response, op):
self._response = response
self._op = op
self._mapping = None
... | {
"content_hash": "0a47c2b9ec6e466c2f399bd3218ca102",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 91,
"avg_line_length": 32.1219512195122,
"alnum_prop": 0.5504935459377372,
"repo_name": "agmscode/agms_python",
"id": "67b1a0542bbcf187a05056dd7127a12a9c6090c9",
"size": "1... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "msd.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "7d3bc165c74ba10f59367ea2b19886eb",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 67,
"avg_line_length": 24.88888888888889,
"alnum_prop": 0.7053571428571429,
"repo_name": "bigbugbb/MSD",
"id": "6104c38bf68569afda38815fdd2829557ff54b54",
"size": "246",
"... |
import subprocess
from airflow.hooks.base_hook import BaseHook
from airflow.exceptions import AirflowException
class SparkSqlHook(BaseHook):
"""
This hook is a wrapper around the spark-sql binary. It requires that the
"spark-sql" binary is in the PATH.
:param sql: The SQL query to execute
:type ... | {
"content_hash": "7670f9a3e97d25c616a31e93ee3973af",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 89,
"avg_line_length": 36.30718954248366,
"alnum_prop": 0.5598559855985599,
"repo_name": "owlabs/incubator-airflow",
"id": "b12f355aaa47bad275b479fced8fbaa7a6e8b756",
"siz... |
"""
File used for testing of API calls on tweepy before extending them.
http://docs.tweepy.org/en/v3.5.0/code_snippet.html
Goals for testing:
Write test data to JSON files in var.
tweepy offers ._json method
Get 200 tweets for a user.
Get all locations.
Get 50 trends a for a location.
Ge... | {
"content_hash": "77c6c2eb2a18e961f73eab2562ba5e4f",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 447,
"avg_line_length": 23.5929203539823,
"alnum_prop": 0.6305326331582896,
"repo_name": "MichaelCurrin/twitterverse",
"id": "c573bd6687f93c0d4ba384413a59677a01d1eed5",
"s... |
import sys
import os
import tarfile
import argparse
from os.path import dirname, join, abspath
from shutil import copy, copytree, rmtree
from subprocess import check_call
from contextlib import closing
parser = argparse.ArgumentParser(
description='Build dynamic cluster RPM',
)
parser.add_argument('bui... | {
"content_hash": "3a0b98e412eb85da5d77ecb028d4f248",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 103,
"avg_line_length": 31.553571428571427,
"alnum_prop": 0.6502546689303905,
"repo_name": "eResearchSA/dynamiccluster",
"id": "beb39f873114b3e99edd5283b079f8fc6eadfdbc",
"... |
from eventlet.green import zmq
context = zmq.Context(1)
buffer = []
for i in range(10000):
buffer.append('Hello, world: %s\n' % str(i))
# Socket to talk to server
print("Connecting to hello world server ...")
global socket
socket = context.socket(zmq.PUSH)
socket.connect("tcp://localhost:5555")
def send(sock, ... | {
"content_hash": "954c24bb3714b448648a9cbf5eefdeb9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 66,
"avg_line_length": 28.68,
"alnum_prop": 0.6248256624825662,
"repo_name": "li-ma/homework",
"id": "68493f83cd971b04b68f06ca4960cbcae3d34366",
"size": "853",
"binary": ... |
# -*- coding: utf-8 -*-
EXPERIMENTAL_STUFF = True
MAXNFILES = 1000
if EXPERIMENTAL_STUFF:
if is_mobile:
response.view = response.view.replace('default/', 'default.mobile/')
response.menu = []
import re
from gluon.admin import *
from gluon.fileutils import abspath, read_file, write_file
from gluon... | {
"content_hash": "03ff7525ed971fbb9aa9c911b72a7730",
"timestamp": "",
"source": "github",
"line_count": 1944,
"max_line_length": 187,
"avg_line_length": 36.88786008230453,
"alnum_prop": 0.5398270812996793,
"repo_name": "Titosoft/ferry-boat",
"id": "547d6c947950cd4c9e93f2c4c16483d8ed376ce0",
"size":... |
# Copyright (c) 2009-2014, Mario Vilas
# 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 notice,
# this list o... | {
"content_hash": "787123b86da5b52118f993fda7ac0185",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 102,
"avg_line_length": 36.625974025974024,
"alnum_prop": 0.6408765335791787,
"repo_name": "glenngillen/dotfiles",
"id": "34b791c77647807ecf0a60f7270bcdd0559d7f8d",
"size"... |
import sys
import decorator
import fnmatch
import os
import glob
@decorator.target("android_resource")
def gen_android_res(name, in_deps, is_res, is_assets):
export_deps = []
deps = []
name = name + "_res"
print "name = '%s'," % name
print "package = 'com.tencent.mm',"
if is_res:
print ... | {
"content_hash": "de1f1d053d893f47232e6e91186f4d52",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 319,
"avg_line_length": 32.07258064516129,
"alnum_prop": 0.5993210963037465,
"repo_name": "simpleton/eclipse2buck",
"id": "124395fc801d6294ee70d48e014640ec2be4c029",
"size... |
import datetime
from django.template import defaultfilters
class Column(object):
"""
This class represents a table column. It is responsible for holding
metadata, and rending table cells. Like Django model/fields, columns
are usually created within the table class which they are bound to.
"""
... | {
"content_hash": "d3072fa42d43a970aa924ad87d5e9c42",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 151,
"avg_line_length": 31.844444444444445,
"alnum_prop": 0.6120027913468249,
"repo_name": "dimagi/djtables",
"id": "1275ee2cb80805a4fd419a7829c7b29a16df9914",
"size": "72... |
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):
# Deleting field 'Template.date_added'
db.delete_column('scribe_template', 'date_added')
... | {
"content_hash": "289feb496ac68aa53953ce209ec1f244",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 140,
"avg_line_length": 49.04597701149425,
"alnum_prop": 0.5847199437543942,
"repo_name": "DArtagan/thoth",
"id": "ac109b093ce1f545a9f48b6e69a98360baf0593f",
"size": "4291"... |
import pymel.core as pm
import logging
log = logging.getLogger("ui")
class BaseTemplate(pm.ui.AETemplate):
def addControl(self, control, label=None, **kwargs):
pm.ui.AETemplate.addControl(self, control, label=label, **kwargs)
def beginLayout(self, name, collapse=True):
pm.ui.AETe... | {
"content_hash": "1e46646ac2e3762f227f5e814063501b",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 102,
"avg_line_length": 39.12,
"alnum_prop": 0.6467280163599182,
"repo_name": "haggi/OpenMaya",
"id": "48228fdbb237cf9ef7fd466c112998fb76dffc90",
"size": "1956",
"binary"... |
import os
from perf_insights import corpus_driver
from perf_insights.mre import file_handle
def _GetFilesIn(basedir):
data_files = []
for dirpath, dirnames, filenames in os.walk(basedir, followlinks=True):
new_dirnames = [d for d in dirnames if not d.startswith('.')]
del dirnames[:]
dirnames += new_d... | {
"content_hash": "46ce51636605b839d042661e93def1fa",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 73,
"avg_line_length": 26.831460674157302,
"alnum_prop": 0.6792294807370184,
"repo_name": "SummerLW/Perf-Insight-Report",
"id": "21400e38ddeec7dabe9f0f85989c0d989a8a2a99",
... |
import aiocoap.resource as resource
import aiocoap
import asyncio
import http.client
from SERVCONFIG import SERVER_HOST,SERVER_PORT
COMMAND_ALIVE = 'alive'
COMMAND_BUTTON = 'button'
GLOBAL_HOST = SERVER_HOST
GLOBAL_PORT = SERVER_PORT
def send_http_request(host, pport, kit, cmd, payload):
print('Building request... | {
"content_hash": "84a6f6b74079bafd3bc62a589a752f2f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 106,
"avg_line_length": 31.313432835820894,
"alnum_prop": 0.6501429933269781,
"repo_name": "hackerspace-ntnu/coap-iot",
"id": "65c08c1115abe37f1e689e5ed8185df00beeb47a",
"s... |
from numpy.testing import assert_array_equal
from astropy.modeling import powerlaws
from astropy.io.misc.asdf.tags.transform.basic import TransformType
from . import _parameter_to_value
__all__ = ['PowerLaw1DType', 'BrokenPowerLaw1DType',
'SmoothlyBrokenPowerLaw1DType', 'ExponentialCutoffPowerLaw1DType',
... | {
"content_hash": "4dd5825b41e40729aebea29141a4b3c8",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 81,
"avg_line_length": 40.84705882352941,
"alnum_prop": 0.5849654377880185,
"repo_name": "saimn/astropy",
"id": "0c3a5ab9f55c58c329bd8114c7498a61dd8ef6e3",
"size": "7032",... |
"""Represent an air purifier."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, cast
from pytradfri.command import Command
from homeassistant.components.fan import (
SUPPORT_PRESET_MODE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassistant.config_entries im... | {
"content_hash": "bb5436375d4f57c5c8fdbac60a4125d9",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 88,
"avg_line_length": 29.649425287356323,
"alnum_prop": 0.6105834464043419,
"repo_name": "home-assistant/home-assistant",
"id": "845d5e6d9c3b5f61ff9b4052aff026def4ff6354",
... |
"""
Usage:
Press Ctrl-C on the command line or send a signal to the process to stop the
bot.
"""
import random as rd
import logging, spotipy
from spotipy.oauth2 import SpotifyClientCredentials
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, Job)
# API Authorization for Spotify
client_crede... | {
"content_hash": "06bc00c8d45f1d07aa908edbaf972e92",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 149,
"avg_line_length": 43.379746835443036,
"alnum_prop": 0.6153341114677561,
"repo_name": "rogerscristo/BotFWD",
"id": "c7feb4a34eec7d611261fc87e4a8cf907fe5a2bc",
"size":... |
from __future__ import annotations
import tokenize
from dataclasses import dataclass
from io import BytesIO
from pants.engine.internals.parser import ParseError
@dataclass(frozen=True)
class FixBUILDFileRequest:
path: str
content: bytes
@property
def lines(self) -> list[str]:
return self.co... | {
"content_hash": "06abd97cb7e8e52f3b2bbfa3b91aa1fd",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 24.03448275862069,
"alnum_prop": 0.6987087517934003,
"repo_name": "pantsbuild/pants",
"id": "b06f43733b9b2ebac6fecb6fed20f78ef7e82b90",
"size": "829"... |
from bempy import block
from bempy.django import uses
from bempy.blocks import b
@block()
def guideline(*sections):
def process_content_item(content):
# content can be either a single item or tuple of
# two items where first one is description of the
# example and second one is a block
... | {
"content_hash": "e65555fa7f8ce07beb49c60a83d99321",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 57,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.6328502415458938,
"repo_name": "svetlyak40wt/bempy",
"id": "0a73556146de85deb4e6f4878a6d35efd1a2bc98",
"size": "8... |
# 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
# By converting each letter in a word to a number corresponding to its
# alphabetical position and adding these values we form a word value. For
# example, the word value for SKY is 19 + 11 + 25 = 55 = t10. If the word
# value is a triangle number then we shall call the wor... | {
"content_hash": "2593e31737088c0ee58a9ea6d3399d85",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 36.91304347826087,
"alnum_prop": 0.6566548881036514,
"repo_name": "6112/project-euler",
"id": "d4af2375a257e296c59f1453cf2dbc8106f02668",
"size": "18... |
"""
Copyright 2013, Ahmet Emre Aladağ, AGMLAB
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 writing, ... | {
"content_hash": "292e3f92ec5cee22531d1ff5edcd5aaf",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 87,
"avg_line_length": 32.9485294117647,
"alnum_prop": 0.6476232983708994,
"repo_name": "AGMLab/python-nutch2",
"id": "5f73f1913dcb863b161cd9bda5866c3dd2fd393e",
"size": "... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('recipe_app', '0001_initial'),
... | {
"content_hash": "f63aeb6d579e8780eb23a466b79b94df",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 134,
"avg_line_length": 34.625,
"alnum_prop": 0.6401925391095066,
"repo_name": "mpollachek/Recipe_website_project",
"id": "07769db6117b3c2037a79d69aad3dc4beda05763",
"size"... |
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
from kolibri.core.content.utils.sqlalchemybridge import get_default_db_string
from kolibri.core.content.utils.sqlalchemybridge import SharingPool
def django_connection_engine():
if get_default_db_string().startswith("sqlite"):
retu... | {
"content_hash": "47f665c77b8487746cbfc122ead1b85a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.7420560747663552,
"repo_name": "mrpau/kolibri",
"id": "976c149a63b70f286901b2de9d66ce4143e802b7",
"size": "535",
... |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.maxDiff = None
filename = 'button04.xlsx'
... | {
"content_hash": "6556cccc4f07b290273a421385cf0d18",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 68,
"avg_line_length": 25.88888888888889,
"alnum_prop": 0.628755364806867,
"repo_name": "jkyeung/XlsxWriter",
"id": "66b0b9ea081a3312bbf2c6d71546a62de5440e67",
"size": "110... |
from time import sleep
import RPi.GPIO as GPIO
import picamera
import picamera.array
import glob
#set up camera
camera = picamera.PiCamera()
camera.hflip = True
camera.brightness = 50
camera.resolution = (500,500)
camera.framrate = 1
camera.iso = 200
camera.zoom = (0,0,1,1)
sleep(1.5)
camera.shutter_speed = camera.ex... | {
"content_hash": "e5ef2a29ce789cf5b9f8f30dbe780f41",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 20.98507462686567,
"alnum_prop": 0.6884779516358464,
"repo_name": "dilloncyh/photometric_stereo",
"id": "df9f7e8d88bb88ce759e709b42277cc041dde162",
"... |
from pandarus.maps import Map, DuplicateFieldID
from rtree import Rtree
import fiona
import os
import pandarus
import pytest
dirpath = os.path.abspath(os.path.join(os.path.dirname(__file__), "data"))
grid = os.path.join(dirpath, "grid.geojson")
duplicates = os.path.join(dirpath, "duplicates.geojson")
raster = os.path... | {
"content_hash": "680d82b6b92f26ea9ee230bc78ddccfd",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 89,
"avg_line_length": 24.519083969465647,
"alnum_prop": 0.5762764632627646,
"repo_name": "cmutel/pandarus",
"id": "5509d4951067a0b96f550b17ac4895407189ab42",
"size": "321... |
from datetime import date, timedelta
from typing import Any
from django.core.management.base import BaseCommand, CommandParser
from django.utils.timezone import now as tz_now
from django.utils.translation import gettext_lazy as _lazy
from request_profiler.models import ProfilingRecord
from request_profiler.settings i... | {
"content_hash": "f02a83a9737d91f4e2f61b236fd10f40",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 87,
"avg_line_length": 37.46551724137931,
"alnum_prop": 0.5954901058444547,
"repo_name": "yunojuno/django-request-profiler",
"id": "0d020b07ee2ade26547d8c23b3f5352df2b724c7",... |
import asyncio
import bisect
import collections
import itertools
import os
import sys
from progressbar import ProgressBar, AnimatedMarker, Timer, Bar, Percentage, Widget
import pgpy
from pgpy.packet import Packet
from pgpy.types import Exportable
ascfiles = [ os.path.abspath(os.path.expanduser(f)) for f in sys.argv... | {
"content_hash": "905271c10b427c28ab7d609039c7c1d8",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 203,
"avg_line_length": 34.050632911392405,
"alnum_prop": 0.5962825278810409,
"repo_name": "SecurityInnovation/PGPy",
"id": "1d9cf59f331d0ffb933df88be9ae91d610c573b6",
"si... |
class Player(object):
def __init__(self, nome, pontos, carta1, carta2, carta3, ident):
self.nome = nome
self.pontos = pontos
self.carta1 = carta1
self.carta2 = carta2
self.carta3 = carta3
self.ident = ident
| {
"content_hash": "d050f40550dffd946342bf491bef8de7",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 65,
"avg_line_length": 27.875,
"alnum_prop": 0.6771300448430493,
"repo_name": "gabrielpapke/truco-py",
"id": "258f6b124f9f1c109fa8b3353f1f52498517183a",
"size": "223",
"bi... |
"""
$Id$
$URL$
Copyright (c) 2010 foption
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, modify, merge, publish, distr... | {
"content_hash": "3a9927f4f2a3a745303f582e9954a3bb",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 77,
"avg_line_length": 37.266666666666666,
"alnum_prop": 0.7915921288014311,
"repo_name": "msteinhoff/foption-bot",
"id": "1f310377bb0fb15ca1259f65e04363d9790c8c9a",
"size"... |
from .parallel import Parallel
from .build import build_parallel
| {
"content_hash": "f6ba3a6f3e2e0db2cda33f28aab4e2f0",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 33,
"avg_line_length": 32.5,
"alnum_prop": 0.8307692307692308,
"repo_name": "alphatwirl/alphatwirl",
"id": "9c5c114741a5a2d1a4340c160a1b74303397e2aa",
"size": "65",
"binar... |
import string, re, os
import sys
# Execute git log with the desired command line options.
command="git log --summary --stat --no-merges --date=short "
if len(sys.argv) < 2:
print "Please specify a tag."
sys.exit(1)
command += sys.argv[1] + ".."
fin = os.popen(command, 'r')
# Create a ChangeLog file in the current... | {
"content_hash": "25141731659efef42a05bbec34be60f6",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 32.97080291970803,
"alnum_prop": 0.5514722160726145,
"repo_name": "arm-hpc/papi",
"id": "ae131e43900b53045cbd2e11a1ffac8692b49a83",
"size": "4666",
... |
"""Test suite for XenAPI."""
import ast
import base64
import contextlib
import functools
import os
import re
from oslo.config import cfg
from nova.compute import api as compute_api
from nova.compute import instance_types
from nova.compute import power_state
from nova.compute import task_states
from nova.compute impo... | {
"content_hash": "7e08bf4b746e398ffc8c9b989d4ed60d",
"timestamp": "",
"source": "github",
"line_count": 3238,
"max_line_length": 79,
"avg_line_length": 42.69456454601606,
"alnum_prop": 0.554739773590365,
"repo_name": "yrobla/nova",
"id": "8141e7527dbae1ac0a4fea135820b046a4e41670",
"size": "138910",... |
from __future__ import unicode_literals
import biplist
import os.path
application = defines.get('app', 'sireum-v3/distros/idea/mac/Sireum.app')
appname = os.path.basename(application)
def icon_from_app(app_path):
plist_path = os.path.join(app_path, 'Contents', 'Info.plist')
plist = biplist.readPlist(plist_p... | {
"content_hash": "0c1c4fedd3658ecf4f86737ae98c742a",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 87,
"avg_line_length": 27.123376623376622,
"alnum_prop": 0.6183864017237252,
"repo_name": "sireum/v3",
"id": "ff140881987f0e9261ddf18b51e060d9b47c91db",
"size": "4201",
... |
from settings import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'tests.sqlite', # Or path to database file if using sqlite3.
'USER': '', # N... | {
"content_hash": "c81c7eea4f4d1e8acc31232edc401eed",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 122,
"avg_line_length": 42.375,
"alnum_prop": 0.5103244837758112,
"repo_name": "Floppy/kepler-explorer",
"id": "e42b2ccc7f2bb64e28ad08d5380d4ac00e0d24d4",
"size": "678",
... |
"""This module tests the cros build command."""
from __future__ import print_function
from chromite.cli import command
from chromite.cli import command_unittest
from chromite.cli.cros import cros_build
from chromite.lib import chroot_util
from chromite.lib import cros_build_lib
from chromite.lib import cros_test_lib
... | {
"content_hash": "bdb0e2142253b3e724f2b139d404e267",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 80,
"avg_line_length": 40.424528301886795,
"alnum_prop": 0.6802800466744457,
"repo_name": "guorendong/iridium-browser-ubuntu",
"id": "12a468c6c80f86c625eabc7de16e77c948a8649... |
import os
import sys
sys.path.insert(0, os.path.abspath("../"))
print("***** CWD {}".format(os.getcwd()))
# -- Project information -----------------------------------------------------
project = "Least Squares Anomaly Detection"
copyright = "2019, John Quinn"
author = "John Quinn"
# The full version, including alp... | {
"content_hash": "72dacc97a1d1af01ab3246e57bf9762d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 32.8,
"alnum_prop": 0.6490514905149052,
"repo_name": "lsanomaly/lsanomaly",
"id": "31eda5a38d4f822675e91991901cecce5e57cf08",
"size": "2029",
"bina... |
import copy
import datetime
import json
from unittest import mock
import sqlalchemy as sa
from mistral.api.controllers.v2 import resources
from mistral.db.v2 import api as db_api
from mistral.db.v2.sqlalchemy import models as db
from mistral import exceptions as exc
from mistral.tests.unit.api import base
from oslo_u... | {
"content_hash": "fb22c03f0b577240066e6b74ebbd522e",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 78,
"avg_line_length": 32.82006920415225,
"alnum_prop": 0.6484976278334212,
"repo_name": "openstack/mistral",
"id": "425082065f3f23e78c84a1c178330f6e7ad6e1a9",
"size": "10... |
from preggy import expect
from tornado.testing import gen_test
from tests.fixtures.watermark_fixtures import (
POSITIONS,
RATIOS,
SOURCE_IMAGE_SIZES,
WATERMARK_IMAGE_SIZES,
)
from thumbor.config import Config
from thumbor.context import Context
from thumbor.filters import watermark
from thumbor.importe... | {
"content_hash": "f77ab8aa7b86663929ea9a374456bab9",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 87,
"avg_line_length": 36.540983606557376,
"alnum_prop": 0.5423956931359354,
"repo_name": "thumbor/thumbor",
"id": "49fe8c06200650656430c8f2dc2bbcbe6f0eaa05",
"size": "113... |
'''
Created on Sep 30, 2016
@author: dj
'''
class ContextManager(object):
def __init__(self):
self.entered = False
print("ContextManager.init.entered =", self.entered)
def __enter__(self):
self.entered = True
print("ContextManager.enter.entered =", self.entered)
retu... | {
"content_hash": "4442f417c41c2fa7ed612f0e2b17dcc8",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 79,
"avg_line_length": 27.14516129032258,
"alnum_prop": 0.6084373143196673,
"repo_name": "djsilenceboy/LearnTest",
"id": "daf9c7801f7406554c0b2fe31241b517ea31f601",
"size"... |
"""Autograd for NDArray."""
from __future__ import absolute_import
from __future__ import division
import ctypes
from .base import _LIB, check_call, string_types
from .base import mx_uint, NDArrayHandle, c_array
from .ndarray import NDArray
from .symbol import _GRAD_REQ_MAP
def set_recording(is_recording):
"""Se... | {
"content_hash": "b55a220b5ab2bf375b07e475f7c9800b",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 87,
"avg_line_length": 29.941798941798943,
"alnum_prop": 0.6260823467043647,
"repo_name": "hesseltuinhof/mxnet",
"id": "2f33052e663e534d83749096a5b3f10cef07dac7",
"size": ... |
from __future__ import print_function, division, absolute_import
# This file defines the AngleFormatterLocator class which is a class that
# provides both a method for a formatter and one for a locator, for a given
# label spacing. The advantage of keeping the two connected is that we need to
# make sure that the form... | {
"content_hash": "bd2875fc8102dc31e08f08e317c2a02b",
"timestamp": "",
"source": "github",
"line_count": 464,
"max_line_length": 114,
"avg_line_length": 33.877155172413794,
"alnum_prop": 0.5241427571728482,
"repo_name": "AustereCuriosity/astropy",
"id": "31cbb8a552648e6bfc08236004c0d83c46db0caa",
"s... |
from django.contrib import admin
from .models import Temperature, Door, Lamp, Light, Window, Humidity, Alarm
from django.contrib.sessions.models import Session
admin.site.register(Temperature)
admin.site.register(Door)
admin.site.register(Lamp)
admin.site.register(Light)
admin.site.register(Window)
admin.site.regist... | {
"content_hash": "7341f019b0dc8ddc2e15204e346d7dd8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 75,
"avg_line_length": 26,
"alnum_prop": 0.8128205128205128,
"repo_name": "BornToDebug/homeStruction",
"id": "9800fc5e4705738815b855371cd45019c06678c7",
"size": "390",
"b... |
from argparse import ArgumentParser
import os
import sys
from cytomine import Cytomine
from cell_counting.cytomine_software import InstallSoftware
__author__ = "Rubens Ulysse <urubens@uliege.be>"
__copyright__ = "Copyright 2010-2017 University of Liège, Belgium, http://www.cytomine.be/"
def install_ET_ObjectCounte... | {
"content_hash": "38a85459731487645dce887ec6a0bac3",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 118,
"avg_line_length": 47.85507246376812,
"alnum_prop": 0.6735311932162326,
"repo_name": "urubens/CellCounting",
"id": "823cae1d821dd011f18ec3a837848e7e68a00f39",
"size": ... |
import sys, os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, create_engine, MetaData
from sqlalchemy import Table, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy.dialects.postgresql import *
from sqlalchemy.sql.expression import update
... | {
"content_hash": "c7df72a0472aa5ccd15e973f4262334e",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 134,
"avg_line_length": 38.987730061349694,
"alnum_prop": 0.6508261211644375,
"repo_name": "bibsian/database-development",
"id": "183157d6637581e36ab2b7dd47b6d93e937946e3",
... |
"""GridFS is a specification for storing large objects in Mongo.
The :mod:`gridfs` package is an implementation of GridFS on top of
:mod:`pymongo`, exposing a file-like interface.
.. mongodoc:: gridfs
"""
from gridfs.errors import (NoFile,
UnsupportedAPI)
from gridfs.grid_file import (Grid... | {
"content_hash": "c84fecfb26652da4f9cb750a89ce261e",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 79,
"avg_line_length": 36.87017543859649,
"alnum_prop": 0.5847925390178911,
"repo_name": "mburakergenc/Malware-Detection-using-Machine-Learning",
"id": "9b92e89272432c0fec45... |
"""
Gerador de senhas aleatória fáceis de serem lembradas pelos usuários
"""
from random import randint
import easygui
def gerarSenha():
"""
gerarSenha() -> senha: str
Gera uma senha composta por um substantivo seguido de um adjetivo, ambos concordando em genêro, seguido também
de um numero de dois a três di... | {
"content_hash": "a2c1082a538c80a4c56b811c8c14ac7a",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 159,
"avg_line_length": 31.485714285714284,
"alnum_prop": 0.7091651542649727,
"repo_name": "thiagopnobre/senha_aleatoria_facil",
"id": "01afc4eda7661d212c94c9616e52e9fb93f6f5... |
from snimpy.manager import Manager as M
from snimpy.manager import load
from lablog.interfaces.snmp import SNMP
from lablog import messages
from datetime import datetime, timedelta
class UPS(SNMP):
exchange = messages.Exchanges.energy
measurement_key = "energy.ups"
run_delta = timedelta(seconds=30)
d... | {
"content_hash": "c1c10d1a60209b4fdff5218ec68c3b59",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 78,
"avg_line_length": 33.52238805970149,
"alnum_prop": 0.5525378450578807,
"repo_name": "NationalAssociationOfRealtors/LabLog",
"id": "5b7919c35a689990f3ca9b510c5d2787729bde... |
import pytest
import numpy as np
from numpy.testing import assert_allclose
from keras.utils.test_utils import layer_test
from keras_contrib.layers import recurrent
from keras.layers import embeddings
from keras.models import Sequential
from keras import regularizers
from keras.utils.test_utils import keras_test
from ... | {
"content_hash": "be96acd364858f3dd7759d9acdaffb98",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 96,
"avg_line_length": 33.38,
"alnum_prop": 0.6231276213301378,
"repo_name": "stygstra/keras-contrib",
"id": "9601983ab8707e51ce48a6328dbdd1767e09679e",
"size": "5007",
... |
def mock_get_workflow_execution_history(*args, **kwargs):
override_data = kwargs.pop('override_data', {})
response = {
"events": [
{
'eventId': 1,
'eventType': 'WorkflowExecutionStarted',
'workflowExecutionStartedEventAttributes': {
... | {
"content_hash": "3909169d6831b7ab8ba71a93d4cabb53",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 60,
"avg_line_length": 32.75,
"alnum_prop": 0.40610687022900765,
"repo_name": "botify-labs/python-simple-workflow",
"id": "3b860595942913951d140734bf900e4484b14d58",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.