text stringlengths 4 1.02M | meta dict |
|---|---|
"""
sentry
~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from .runner import main
main()
| {
"content_hash": "3e358721e94debf8bd375ec8bbb157a4",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 70,
"avg_line_length": 17.2,
"alnum_prop": 0.6802325581395349,
"repo_name": "mitsuhiko/sentry",
"id": "418225eb7804ce3918e5fa1aa84f9778b160c37b",
"size": "172",
"binary":... |
from google.cloud import aiplatform
from google.protobuf import json_format
from google.protobuf.struct_pb2 import Value
def create_training_pipeline_tabular_regression_sample(
project: str,
display_name: str,
dataset_id: str,
model_display_name: str,
target_column: str,
location: str = "us-ce... | {
"content_hash": "50603122d3680b5055c8efc6b791d8ac",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 123,
"avg_line_length": 42.793103448275865,
"alnum_prop": 0.6220789685737309,
"repo_name": "sasha-gitg/python-aiplatform",
"id": "02607c2788afc68b295c6cd0d96f16ee267ffb48",
... |
#Created on 2013-8-17
#Copyright 2013 nuoqingyun xuqifeng
import socket
from oslo.config import cfg
CONF = cfg.CONF
def _get_my_ip():
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.connect(('8.8.8.8',80))
(addr, port) = sock.getsockname()
sock.c... | {
"content_hash": "a7f8d8b981e3fd7f0abeaee4f35d4811",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 63,
"avg_line_length": 23.939393939393938,
"alnum_prop": 0.5341772151898734,
"repo_name": "homhei/glance",
"id": "8ef1feec2ccc7a95f532d8cbb59e87e3f99a283e",
"size": "872",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('gwasdb', '0011_auto_20170809_0946'),
]
operations = [
migrations.AddField(
model_name='study',
... | {
"content_hash": "7890e06340293ff3b39b6c2cd90982d4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 93,
"avg_line_length": 26.72,
"alnum_prop": 0.6017964071856288,
"repo_name": "1001genomes/AraGWAS",
"id": "9029f734622dd2da649142a21c43721c399f9088",
"size": "741",
"bina... |
from typing import Iterable
from typing import Union
from cleo.formatters.formatter import Formatter
from .output import Output
from .output import Type
from .output import Verbosity
class NullOutput(Output):
@property
def verbosity(self) -> Verbosity:
return Verbosity.QUIET
def is_decorated(se... | {
"content_hash": "938261c41d7f0fde23fee3cd3b312bbb",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 67,
"avg_line_length": 21.540983606557376,
"alnum_prop": 0.5974124809741248,
"repo_name": "sdispater/cleo",
"id": "5382514ce65180ed70fde0f1c1e674f9398825cc",
"size": "1314"... |
"""Email templates """
from email.mime.text import MIMEText
from hal.internet.email.utils import get_email_content
class EmailTemplate:
"""Default email template"""
def __init__(self,
recipient,
subject,
content_file,
footer_file, extra_ar... | {
"content_hash": "92f589bffca30dbc2814bbfd4e8307d2",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 73,
"avg_line_length": 30.178571428571427,
"alnum_prop": 0.5739644970414202,
"repo_name": "sirfoga/hal",
"id": "fc13d1001097531f4c8a2f6858ad28da68973e5e",
"size": "1715",
... |
import communication_app.models
def get_my_pets(request):
if not request.user:
return []
return communication_app.models.Pet.objects.filter(
user=request.user)
| {
"content_hash": "29a380d02aff7acafcc0371669f4c62b",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 23.25,
"alnum_prop": 0.6881720430107527,
"repo_name": "petwitter/petwitter",
"id": "0f8160a01ee7685c9e453be4831281f12fdb8799",
"size": "186",
"binar... |
'''
Created on May 11, 2015
@author: yunli
'''
#### ================================================================
#### ================================================================
#### OpenClos Error Code
#### ================================================================
#### ==... | {
"content_hash": "b3060444733608704906c2df905d095d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 100,
"avg_line_length": 53.794871794871796,
"alnum_prop": 0.4659199237368923,
"repo_name": "Juniper/OpenClos",
"id": "a2408e7e95a77f1eff9c96557fffdab2dbef3101",
"size": "41... |
""" Support for toolset definition.
"""
import sys
import feature, property, generators, property_set
import b2.util.set
import bjam
from b2.util import cached, qualify_jam_action, is_iterable_typed, is_iterable
from b2.util.utility import *
from b2.util import bjam_signature, sequence
from b2.manager import get_mana... | {
"content_hash": "06dbff6d04f03e6dcbe5d295366ff9e5",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 96,
"avg_line_length": 39.23039215686274,
"alnum_prop": 0.6121454454579532,
"repo_name": "keichan100yen/ode-ext",
"id": "cf2b24b2e79a122afc9d4461244d97c1d14e42fc",
"size":... |
from __future__ import unicode_literals
from setuptools import setup, find_packages
install_requires = [
"Jinja2>=2.8",
"boto>=2.36.0",
"httpretty==0.8.10",
"requests",
"xmltodict",
"six",
"werkzeug",
"pytz",
"python-dateutil",
]
extras_require = {
# No builtin OrderedDict befo... | {
"content_hash": "cc8a1af38eefef21e3f6e4339ac03cf5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 67,
"avg_line_length": 26.8,
"alnum_prop": 0.5850746268656717,
"repo_name": "silveregg/moto",
"id": "bfd8bbb87d308f110c69958a367cfd8950995296",
"size": "1362",
"binary": ... |
LB_METHOD_ROUND_ROBIN = 'ROUND_ROBIN'
PROTOCOL_TERMINATED_HTTPS = 'TERMINATED_HTTPS'
PROTOCOL_HTTP = 'HTTP'
PROTOCOL_TCP = 'TCP'
PROTOCOL_HTTPS = 'HTTPS'
# Statuses for a10 objects (certificate bindings)
STATUS_CREATING = 0
STATUS_CREATED = 1
STATUS_DELETING = 2
| {
"content_hash": "33e3479650c0d035178006f515254ca2",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 49,
"avg_line_length": 26.4,
"alnum_prop": 0.75,
"repo_name": "hthompson6/a10-neutron-lbaas",
"id": "54a911eb19ccd83762247357e178407cc16accad",
"size": "838",
"binary": f... |
from __future__ import unicode_literals
from .common import *
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":test:",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
}
PASSWORD_HASHERS = (
... | {
"content_hash": "6d684ad0a937cf32d3709c09325394db",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 52,
"avg_line_length": 19.63157894736842,
"alnum_prop": 0.5254691689008043,
"repo_name": "stepanovsh/project_template",
"id": "c676e9b06db3c1bb55a57837f56c185898680f53",
"s... |
import re, email, html, sys
html_hack_re = re.compile(r"<!\w{1,8}>")
html_tag_re = re.compile(r"<.*?>")
word_re = re.compile(r"\w(?:[\w']+)\w")
banned_attrs = {"src":None, "href":None, "alt":None,
"id":None, "action":None, "background":None}
def unique(i):
u = {}
for t in i:
if t not i... | {
"content_hash": "adf36a7b60f2cade2d98e842893aa920",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 82,
"avg_line_length": 33.24,
"alnum_prop": 0.47924187725631767,
"repo_name": "mizerlou/hammer",
"id": "fd2f727a7112b5d4efc3b141e9836281f938a97c",
"size": "3324",
"binar... |
__author__ = 'mpetyx'
import xlrd
import csv
import json
def csv_from_excel():
wb = xlrd.open_workbook('SampleData.xls')
names = wb.sheet_names()
sh = wb.sheet_by_name(names[0])
your_csv_file = open('your_csv_file.csv', 'wb')
wr = csv.writer(your_csv_file, quoting=csv.QUOTE_ALL)
for rownum i... | {
"content_hash": "0f387403a49559e1bf06dacd3839cae7",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 129,
"avg_line_length": 24.377777777777776,
"alnum_prop": 0.6071103008204193,
"repo_name": "Suite5/DataColibri",
"id": "60746f715d3741a92f3106b845869bbca6e10c41",
"size": "... |
##
## Server for TCP octet trickling tests.
##
from twisted.internet import reactor, protocol
class TricklingServerProtocol(protocol.Protocol):
def __init__(self):
pass
def connectionMade(self):
print "client accepted"
self.transport.setTcpNoDelay(True)
self.stats = {}
... | {
"content_hash": "aa04924ad3452764a60f34dc552b3b2d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 59,
"avg_line_length": 20.782608695652176,
"alnum_prop": 0.6098326359832636,
"repo_name": "operasoftware/presto-testo",
"id": "2456411db6cdfb0539da4964129b58724b28f6fb",
"s... |
"""
The :ref:`aiomysql` connector for MySQL/MariaDB databases.
"""
import asyncio
import logging
import typing
import aiomysql
import pymysql
from asyncqlio.backends.base import BaseConnector, BaseResultSet, BaseTransaction, DictRow
from asyncqlio.exc import DatabaseException, IntegrityError
logger = logging.getLogg... | {
"content_hash": "1a9aeacf3ef240b96fd03b66fbdc2834",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 100,
"avg_line_length": 30.466666666666665,
"alnum_prop": 0.5998990069011951,
"repo_name": "SunDwarf/asyncqlio",
"id": "db07814a718ebc093bdc50e72cd03ad7ad36c16a",
"size": ... |
"""Run through the python agents tutorial as a user would.
"""
import sys
import unittest
import os
import subprocess
import yaml
from integration.test import geopm_test_launcher
from integration.test import util
@util.skip_unless_do_launch()
@util.skip_unless_stressng()
class TestIntegration_tutorial_python_agents(... | {
"content_hash": "808294be4d476078e7ce12bf9109a65a",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 92,
"avg_line_length": 42.198113207547166,
"alnum_prop": 0.6078694388553544,
"repo_name": "geopm/geopm",
"id": "50111bcc52332b11fa9e407af73fc40e6dcea8bf",
"size": "4589",
... |
"""Control Flow Operations. See the @{python/control_flow_ops} guide.
@@identity
@@tuple
@@group
@@no_op
@@count_up_to
@@cond
@@case
@@while_loop
@@logical_and
@@logical_not
@@logical_or
@@logical_xor
@@equal
@@not_equal
@@less
@@less_equal
@@greater
@@greater_equal
@@where
@@is_finite
@@is_inf
@@is_nan
@@verify_tenso... | {
"content_hash": "a8286d47e193230689ed8466e1b33ba6",
"timestamp": "",
"source": "github",
"line_count": 2973,
"max_line_length": 90,
"avg_line_length": 38.76589303733603,
"alnum_prop": 0.6573391987922014,
"repo_name": "jjas0nn/solvem",
"id": "9a1b38dd28d785cedefdfc0b9c599e38e085d626",
"size": "1159... |
from msrest.serialization import Model
class ValidateResponse(Model):
"""Describes the result of resource validation.
:param status: Result of validation.
:type status: str
:param error: Error details for the case when validation fails.
:type error: ~azure.mgmt.web.models.ValidateResponseError
... | {
"content_hash": "ed5daed1c3b4e7c68f2ed227acc09aaa",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 67,
"avg_line_length": 29.1,
"alnum_prop": 0.6374570446735395,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "1ca74d062b7f34b6944c3cdae7a32f91ee579183",
"size": "10... |
from controller import WORKER_SCRIPT
from launch_instance import launch
from upload_download_s3 import upload_to_s3, download_from_s3, remove_s3_bucket
from utils import timestring
from boto import sqs, ec2, s3
from boto import Config
import json
from time import sleep, time
import os
# Assuming that the testing syst... | {
"content_hash": "b06b4b5b6fd6665ff27983ad0edff7bc",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 84,
"avg_line_length": 30.057142857142857,
"alnum_prop": 0.594106463878327,
"repo_name": "Astroua/aws_controller",
"id": "6024d96ebc00bd02665ba6f1ed3ff71d76c491dc",
"size"... |
import inspect
from datetime import datetime
from django.db import models
from django.test import SimpleTestCase
from dimagi.ext.couchdbkit import Document
from dimagi.utils.couch.migration import (
SyncCouchToSQLMixin,
SyncSQLToCouchMixin,
)
class ModelAttrEqualityHelper(SimpleTestCase):
"""
Helper... | {
"content_hash": "c29e395a9d48254d5cd0678d96bc09eb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 96,
"avg_line_length": 29.306122448979593,
"alnum_prop": 0.6866295264623955,
"repo_name": "dimagi/commcare-hq",
"id": "7de9af2c122e788579df0325a23a06a4add91ae3",
"size": "1... |
"""
Module used to define H5 queries.
"""
from __future__ import print_function
from __future__ import absolute_import
import tables
import numpy as np
def get_data(h5file, **kwargs):
"""
Get raw data from an h5file meeting given criteria.
Parameters
----------
h5file: string or open pytables fi... | {
"content_hash": "14ba9342ab46b9dd5d5705093ffb9524",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 79,
"avg_line_length": 29.063758389261746,
"alnum_prop": 0.5632144094215449,
"repo_name": "metabolite-atlas/metatlas",
"id": "9a2255e1800334de219a8b6587c7052d975812fb",
"s... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('job_board', '0013_siteconfig_twitter'),
]
operations = [
migrations.RemoveField(
model_name='siteconfig',
name='twitter',
... | {
"content_hash": "3b9db828f0fad95c91a0123d007df7f6",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 158,
"avg_line_length": 31.952380952380953,
"alnum_prop": 0.5774962742175856,
"repo_name": "wfhio/tramcar",
"id": "2f78acc7d1095a239abca59a22feebbc63903a8b",
"size": "1415"... |
"""
WSGI config for blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWh... | {
"content_hash": "cf9543cbd14860fb6f2291f26e1ef1d1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 25.818181818181817,
"alnum_prop": 0.7869718309859155,
"repo_name": "divyamodi128/My-Story-The-Blogging-App",
"id": "faeb489d586ec40657dcf2ac14bc1b49418... |
import unittest
from expressy.quotes import split_quoted, process_unquoted
class SplitQuotedTest(unittest.TestCase):
def test_trivial(self):
self.assertEqual(split_quoted(""), [""])
self.assertEqual(split_quoted("a"), ["a"])
def test_splits(self):
self.assertEqual(split_quoted("''"), ... | {
"content_hash": "52c208cb45cc822b7d0e34a2de46f2bc",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 70,
"avg_line_length": 32.255319148936174,
"alnum_prop": 0.5507915567282322,
"repo_name": "timedata-org/expressy",
"id": "ee6a6d9fa05102034cdd2020beab26459f9d3d9b",
"size":... |
"""
The-O-Kay-Blog utility functions
:Copyright: (c) 2009 Victor Goh <victorgoh@gmail.com>,
All rights reserved.
:license: BSD, see LICENSE for more details.
"""
import re
import logging
import blog.config as config
from kay.utils import render_to_string
# Some helper methods
def slugify(s):
... | {
"content_hash": "52cea70adc0bb94ce8aef1156a7f06a0",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 132,
"avg_line_length": 31.603960396039604,
"alnum_prop": 0.5667293233082706,
"repo_name": "calvinchengx/O-Kay-Blog-wih-Kay-0.10.0",
"id": "e9af98a81b77fe199a5a28b85ef194fe9... |
import gzip
import os
import pysam
from TestUtils import TABIX_DATADIR
FN_COMPRESSED = "example.bed.gz"
FN_UNCOMPRESSED = "example.bed"
FN_LARGE_COMPRESSED = "example_large.bed.gz"
FN_LARGE_UNCOMPRESSED = "example_large.bed"
def read_python_compressed(fn):
'''iterate through with python.'''
with gzip.open(f... | {
"content_hash": "73b63482b36ce7903cbfb163278947b5",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 79,
"avg_line_length": 29.083333333333332,
"alnum_prop": 0.686341929321872,
"repo_name": "pysam-developers/pysam",
"id": "ce7077de2cfe2f8fc173fdd85b3d00d48272e64a",
"size"... |
import functools
from django import http
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
import commonware.log
from addons.models import Addon
log = commonware.log.getLogger('mkt.purchase')
def addon_view(f, qs=Addon.objects.all):
@functools.wraps(f)
def w... | {
"content_hash": "08407ada78410567d0a5040e368084b5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 76,
"avg_line_length": 35.205882352941174,
"alnum_prop": 0.6299081035923141,
"repo_name": "jinankjain/zamboni",
"id": "1d4607271e14416130af43b056ff9b8fbbe22957",
"size": "2... |
from inspect import getargspec
import sys
import import_string
def configure_extension(name, **kwargs):
configurator = import_string(name)
args = getargspec(configurator).args
configurator(**{key: val for key, val in kwargs.items() if key in args})
def configure_extensions(app, admin=None):
"""Confi... | {
"content_hash": "8c56f940c886816a93636e80d8ebcff2",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 29.454545454545453,
"alnum_prop": 0.6805555555555556,
"repo_name": "abnerpc/quokka",
"id": "4e155e8b05b4ebe313aa267d0e89066f6591ee32",
"size": "664",... |
import unittest
import tempfile
import io
import os
from unittest.mock import patch
from helper_util import relpath, do_long_tests
from ppci.cli.hexutil import hexutil
def new_temp_file(suffix):
""" Generate a new temporary filename """
handle, filename = tempfile.mkstemp(suffix=suffix)
os.close(handle)
... | {
"content_hash": "404b2860e3966e06bf323eefeb845c5b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 78,
"avg_line_length": 37.53731343283582,
"alnum_prop": 0.6381709741550696,
"repo_name": "windelbouwman/ppci-mirror",
"id": "c8a0c618d957991f7b1ce086f2ac3f6ebfaedc1d",
"siz... |
'''
Richards
'''
# based on a Java version:
# Based on original version written in BCPL by Dr Martin Richards
# in 1981 at Cambridge University Computer Laboratory, England
# and a C++ version derived from a Smalltalk version written by
# L Peter Deutsch.
# Java version: Copyright (C) 1995 Sun Microsystems, Inc.... | {
"content_hash": "cf639fcc4a9514b5fed3e4aff2ab721f",
"timestamp": "",
"source": "github",
"line_count": 456,
"max_line_length": 99,
"avg_line_length": 23.06578947368421,
"alnum_prop": 0.6402357862711542,
"repo_name": "secureosv/pythia",
"id": "4a678845c4da590a5a118d6d2ae980f72eb65a72",
"size": "105... |
import m5
from m5.objects import *
# both traffic generator and communication monitor are only available
# if we have protobuf support, so potentially skip this test
require_sim_object("TrafficGen")
require_sim_object("CommMonitor")
# even if this is only a traffic generator, call it cpu to make sure
# the scripts ar... | {
"content_hash": "8b8185dc5fe26a00bed86a2e602b6be8",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 76,
"avg_line_length": 36.53658536585366,
"alnum_prop": 0.6475300400534045,
"repo_name": "lokeshjindal15/pd-gem5",
"id": "be700ac7af8daa29e028fa2f218d5ce0e8fe0264",
"size":... |
import boto3
import json
print('Loading function')
dynamo = boto3.client('dynamodb')
VOUCHES_PER_POINT = 3
def respond(err, res=None):
return {
'statusCode': '400' if err else '200',
'body': json.dumps(str(err) if err else res),
'headers': {
'Content-Type': 'application/json'... | {
"content_hash": "1f3018a2e522e1cf2e742727a01e951a",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 106,
"avg_line_length": 31.49230769230769,
"alnum_prop": 0.6072300928187592,
"repo_name": "nicolaes/apt-points",
"id": "67cf6065aab33fd22cda287807ee53b7fc74e8ea",
"size": ... |
"""Utility module for optimization."""
import copy
from typing import Any, Dict, Iterable, List, Sequence
# Amount of space to leave between product data and appended attributes
_SEPARATOR_LENGTH = len(' ')
def optimization_exclusion_specified(entry: Dict[str, Any],
optimizer_par... | {
"content_hash": "9b9d44d12e406b1fff1cccd06c11362a",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 110,
"avg_line_length": 40.651041666666664,
"alnum_prop": 0.6757206918641896,
"repo_name": "google/shoptimizer",
"id": "4a01def2fcce75a792e2864f45c843ad0e791959",
"size": ... |
from highton.models import HightonModel
from highton.highton_constants import HightonConstants
from highton import fields
from highton import call_mixins
class Task(
HightonModel,
call_mixins.CreateCallMixin,
call_mixins.DetailCallMixin,
call_mixins.DeleteTagCallMixin,
call_mixins.UpdateCallMixin,... | {
"content_hash": "90b9aaeeba118980a0bfde93c6579092",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 103,
"avg_line_length": 40.645390070921984,
"alnum_prop": 0.6728319664979934,
"repo_name": "seibert-media/Highton",
"id": "b810ce3ec13e8acc300b2828a207b22b8a686603",
"size... |
from tkinter import Tk,Frame,Label,Entry,StringVar,Button,Checkbutton,IntVar,Canvas,Text,Toplevel
from tkinter import LEFT,RIGHT,BOTH,NW,BOTTOM,TOP,X,Y,END
from PIL import Image,ImageTk,ImageDraw
from sys import argv
from time import time
from numpy import log10,array,apply_along_axis,hstack,vstack,lib,whe... | {
"content_hash": "af7e65d3fae1b81213fd1d9231928f1c",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 116,
"avg_line_length": 39.671388101983005,
"alnum_prop": 0.5444158811768066,
"repo_name": "uperetz/AstroTools",
"id": "a0fa9b20a55add4152741ed7342ddc23066344d0",
"size": ... |
import unittest
import numpy
import scipy
from mockredis import MockRedis as Redis
import mongomock
from future.builtins import range
from future.builtins import zip
from nearpy.storage import MemoryStorage, RedisStorage, MongoStorage
class StorageTest(unittest.TestCase):
"""
Base class for storage tests.
... | {
"content_hash": "7ca7cf434eff78f023fd7a7feee1bdda",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 77,
"avg_line_length": 33.5,
"alnum_prop": 0.6051883439943141,
"repo_name": "pixelogik/NearPy",
"id": "8f5750d1923fd2cf1294a62e9e1e61a49c79c45a",
"size": "6749",
"binary... |
import sys
import traceback
import logging
from __init__ import *
def main(argv):
try:
command = command_manager.parse_command_args(argv)
root_logger = logging.getLogger()
handler = logging.StreamHandler()
root_logger.addHandler(handler)
if command_manager.verbose:
... | {
"content_hash": "3c7e16307e829dfb510f93ba8da73b11",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 86,
"avg_line_length": 37.34090909090909,
"alnum_prop": 0.5556908094948265,
"repo_name": "quaddra/engage",
"id": "67d33c0680d106b80b397a54f36d8c0e4a297536",
"size": "1747",... |
import sys
import os
# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "88d89ae9a3ff3bcd3c20e6ebdbc80c01",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 79,
"avg_line_length": 31.425101214574898,
"alnum_prop": 0.7039422829167741,
"repo_name": "google/ohmu",
"id": "504211a209330c3295c25d16d4fc50da450d9542",
"size": "8179",
... |
from flask import Flask
from datetime import datetime
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World! " + str(datetime.utcnow())
| {
"content_hash": "15221697b4c909e800e8c54a96a678c6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 17.77777777777778,
"alnum_prop": 0.66875,
"repo_name": "filemakergarage/zeroclient",
"id": "1777baaa1b74e12195c36c7fc5c5d3dbbe8c984f",
"size": "189",
... |
from django.views import generic
from . import forms, models
class BookCreateView(generic.CreateView):
model = models.Book
form_class = forms.BookForm
success_url = "/"
| {
"content_hash": "4be50398f34af43e7febcb8e4b8d628b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 41,
"avg_line_length": 20.444444444444443,
"alnum_prop": 0.717391304347826,
"repo_name": "applegrew/django-select2",
"id": "4bd094285da8cffff0a3499c5443927d2edb41f3",
"size"... |
__all__ = (
'Mock',
'MagicMock',
'patch',
'sentinel',
'DEFAULT',
'ANY',
'call',
'create_autospec',
'FILTER_DIR',
'NonCallableMock',
'NonCallableMagicMock',
'mock_open',
'PropertyMock',
'seal',
)
__version__ = '1.0'
import inspect
import pprint
import sys
impor... | {
"content_hash": "d7991db34322b9fd214c8456f4dfef4c",
"timestamp": "",
"source": "github",
"line_count": 2436,
"max_line_length": 85,
"avg_line_length": 33.024220032840724,
"alnum_prop": 0.575447188832399,
"repo_name": "Microsoft/PTVS",
"id": "382696d6c7e9c6d9542207b369962a4848d3e2a6",
"size": "8061... |
import numpy as np
import scipy
import matplotlib.pyplot as plt
def plot_residuals(turnstile_weather, predictions):
'''
Using the same methods that we used to plot a histogram of entries
per hour for our data, why don't you make a histogram of the residuals
(that is, the difference between the original... | {
"content_hash": "d28be5fd44a799c90922c7cc1d04a051",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 94,
"avg_line_length": 36.1578947368421,
"alnum_prop": 0.7263464337700145,
"repo_name": "KellyChan/Python",
"id": "a873dfef6bf06a475753d79e36e38c5753ceec12",
"size": "687",... |
from __future__ import division
import commonfate as cf
import numpy as np
import pytest
import itertools
import operator
@pytest.fixture(params=[0.5])
def length(rate, request):
return request.param * rate
@pytest.fixture
def signal(channels, length):
return np.random.random((length, channels))
@pytest.f... | {
"content_hash": "2a32d0065080b0f7b4bd2c32556b5962",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 72,
"avg_line_length": 21.880597014925375,
"alnum_prop": 0.6787175989085948,
"repo_name": "aliutkus/commonfate",
"id": "e5f1ab89f35280cd32690d5686ae1e5f185ec4f1",
"size": "... |
"""JSONwriter
Writes events to JSON files, segmenting on max size"""
import os, pathlib, shutil
import logging
import time
from datetime import datetime
from . import json_quick
from . import merge_test
TEMP_DIRECTORY = "/tmp/synth_json_writer/" # We build each file in a temporary directory, then move when it's fini... | {
"content_hash": "4ec5662d7879c025630563f7277a523b",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 217,
"avg_line_length": 38.4375,
"alnum_prop": 0.5951219512195122,
"repo_name": "DevicePilot/synth",
"id": "e91a03766d22491202365f050c0468a54cf924e4",
"size": "4305",
"b... |
from google.appengine.ext import ndb
from UserModel import UserModel
class LikeModel(ndb.Model):
"""Like Model"""
palette_id = ndb.StringProperty(required=True)
added_by = ndb.UserProperty()
added_by_id = ndb.StringProperty(required=True)
timestamp = ndb.DateTimeProperty(auto_now_add=True)
@st... | {
"content_hash": "724b57a0b8886642c404759155669896",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 56,
"avg_line_length": 30.523809523809526,
"alnum_prop": 0.6271450858034321,
"repo_name": "rsyvarth/Schemify",
"id": "511186d8af4a8b37b47f4eacc3a47b8b3cc38ad6",
"size": "64... |
"""
Copyright (c) 2011, 2012, Regents of the University of California
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 l... | {
"content_hash": "906fa61d123f4dce92b8635712671482",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 80,
"avg_line_length": 38.689655172413794,
"alnum_prop": 0.6085561497326203,
"repo_name": "SoftwareDefinedBuildings/smap",
"id": "3006650ee8bebb5c3f37c11dc03069a3fbb2f2f9",
... |
import gzip
import os
import pathlib
import sys
from functools import partial
from time import sleep
import cloudpickle
import pytest
from fsspec.compression import compr
from fsspec.core import open_files
from fsspec.implementations.local import LocalFileSystem
from tlz import concat, valmap
from dask import compute... | {
"content_hash": "0daf6f418c344d39ca3a99997b68eae8",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 88,
"avg_line_length": 32.45609065155807,
"alnum_prop": 0.5734485467399842,
"repo_name": "blaze/dask",
"id": "2c2804ee43a3cf0167e545579c81b5a884d5c547",
"size": "11457",
... |
from docutils.languages import get_language as get_language
from .log import log
def get_language_silent(lang):
"""Docutils get_language() with patches for older versions."""
try:
return get_language(lang)
except TypeError as err: # Docutils 0.8.1
if 'get_language() takes exactly 2 argum... | {
"content_hash": "681319378dff108fa30aa0e52809602b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 72,
"avg_line_length": 34.976190476190474,
"alnum_prop": 0.572498298162015,
"repo_name": "rst2pdf/rst2pdf",
"id": "68fcaa2d0f70967b05ef730461c8395336e4add5",
"size": "1532"... |
from django.db.models import Max, Min
from models import Flag, DiskFlag, Disk, FlagRange, IOStat
from django.core.exceptions import ObjectDoesNotExist
def generate_disk_flag(disk,flag,value,time):
range_match = None
for level in FlagRange.WARNING_LEVEL_CHOICES:
try:
range = f... | {
"content_hash": "1949918128bfe2b04c0ac4b2f10ea149",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 141,
"avg_line_length": 46.703125,
"alnum_prop": 0.5369688859150218,
"repo_name": "amschaal/maestor",
"id": "c735591383fe9b6ce7d034431c8de0009d1f869b",
"size": "2989",
"b... |
import pytest
from integration_tests import AgentTestCase
from integration_tests.tests.usage_collector_base import TestUsageCollectorBase
pytestmark = pytest.mark.group_usage_collector
class TestUsageCollectorWithAgent(AgentTestCase, TestUsageCollectorBase):
def setUp(self):
super(AgentTestCase, self).s... | {
"content_hash": "9275454803acbc04e38edc706e913e3a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 33.13793103448276,
"alnum_prop": 0.6243496357960457,
"repo_name": "cloudify-cosmo/cloudify-manager",
"id": "4a6054d7c538ba8a4cbfa2879db8fb2332a4e327",
... |
"""WSGI tools for use with gate."""
import errno
import os
import signal
import time
import mimetools
from itertools import chain
from StringIO import StringIO
import eventlet
import eventlet.debug
from eventlet import greenio, GreenPool, sleep, wsgi, listen
from paste.deploy import loadapp, appconfig
from eventlet.g... | {
"content_hash": "fd4f654d06af5a3708f7e0006a1d47f1",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 78,
"avg_line_length": 38.62303664921466,
"alnum_prop": 0.6000406669377796,
"repo_name": "vindeka/gate",
"id": "f8c8e0c0cb9f5c9325fd11f8d26d1301f8f25c80",
"size": "15337",... |
from . import auth, config, crud, hgrid, hooks, widget, repos # noqa | {
"content_hash": "dde1d1c6686f66ff18efa455861b59b5",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 69,
"avg_line_length": 69,
"alnum_prop": 0.7101449275362319,
"repo_name": "AndrewSallans/osf.io",
"id": "2855280de2e9a200b50b96bb75b7dfcfd4b0fb41",
"size": "69",
"binary":... |
import os
import six
def flatten_list(node, prefix=None):
for v in node:
for kid in flatten_dict(v, prefix):
yield kid
def flatten_dict(node, prefix=None):
"""
This is an iterator that returns a list of flattened env
vars based on the conf file supplied
"""
for k, v in si... | {
"content_hash": "621339f1ff2330f47f5cfd9e53ef6846",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 60,
"avg_line_length": 23.676470588235293,
"alnum_prop": 0.5726708074534161,
"repo_name": "ionrock/withenv",
"id": "42fc9bf9708cf53cc8430750520ae948579d2f46",
"size": "805"... |
import time
def main(request, response):
key = request.GET.first(b"key")
if request.method == u"POST":
# Received result data from target page
request.server.stash.put(key, request.body, u'/scroll-to-text-fragment/')
return u"ok"
else:
# Request for result data from test pa... | {
"content_hash": "d9f602d2e66700432db60dead84c84f3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 32.38461538461539,
"alnum_prop": 0.6389548693586699,
"repo_name": "nwjs/chromium.src",
"id": "f66f32ad8dbcdd34dd4ff61d5983e889a741e007",
"size": "421... |
"""
WSGI config for core project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | {
"content_hash": "9c16cf9aed8f7f7e886e73dc866eb135",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 90,
"avg_line_length": 28.55,
"alnum_prop": 0.7425569176882661,
"repo_name": "hadrianpaulo/project_deathstar",
"id": "fe65937b48c559a3a4bd17d7b601f3cb2b0cc622",
"size": "57... |
"""
VirtualBox Driver Modules
"""
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from ironic.common import boot_devices
from ironic.common import exception
from ironic.common.i18n import _
from ironic.common.i18n import _LE
from ironic.common.i18n import _LW
from ir... | {
"content_hash": "bfa92a6d3bdc965cdf0ab90dc20f50be",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 79,
"avg_line_length": 41.710997442455245,
"alnum_prop": 0.6223557544913851,
"repo_name": "devananda/ironic",
"id": "b58319d3c6e12b754531c2642fce6985b81c5666",
"size": "16... |
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_csgraph', [dirname(__file__)])
except ImportError:
import _csgraph
... | {
"content_hash": "96e2f5f4ffe40389cfbf84bf20c7a27b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 90,
"avg_line_length": 30.686567164179106,
"alnum_prop": 0.6021400778210116,
"repo_name": "ominux/scikit-learn",
"id": "4efad4c6b66d68759719827dd5025bcc345e912c",
"size": "... |
"""Test the lander.ext.parser.discovery module."""
from lander.ext.parser._discovery import ParsingPlugins
from lander.parsers.article import ArticleParser
def test_discovery() -> None:
plugins = ParsingPlugins.load_plugins()
assert "article" in plugins.names
assert plugins["article"] == ArticleParser
| {
"content_hash": "aeb14fd9eda5e290fbe9f87fc62b4f02",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 55,
"avg_line_length": 29,
"alnum_prop": 0.7523510971786834,
"repo_name": "lsst-sqre/lander",
"id": "98d69f551df8721973e9e78d2e3983b8888e4221",
"size": "319",
"binary": f... |
# Copyright 2015 Dejan D. M. Milosavljevic
#
# 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 appl... | {
"content_hash": "7a1d5ad9cf03890ac60ff249600279dd",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 111,
"avg_line_length": 28.866666666666667,
"alnum_prop": 0.6058506543494996,
"repo_name": "dmilos/nucleotide",
"id": "c446e396e424b6994df9340bc4c274742dc93773",
"size": "1... |
"""
Firewall configuration plugin for AIO.
"""
import gettext
from otopi import plugin, util
from ovirt_engine_setup import constants as osetupcons
from ovirt_engine_setup.engine import constants as oenginecons
def _(m):
return gettext.dgettext(message=m, domain='ovirt-engine-setup')
@util.export
class Plugi... | {
"content_hash": "dfe1eae487a867d1f5e5b026ca8667d6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 25.377777777777776,
"alnum_prop": 0.6453590192644484,
"repo_name": "eayun/ovirt-engine",
"id": "bc974a29009731652254afd8012c857127b31d86",
"size": "1... |
class XMLRPCHandler():
pass
| {
"content_hash": "10506b7c3df0f86c56d19ef25aface72",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 22,
"avg_line_length": 15,
"alnum_prop": 0.7333333333333333,
"repo_name": "briansan/rams",
"id": "4ae6a274d0f1b2c8b64e407ed081d5436265ed80",
"size": "131",
"binary": false... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0005_auto_20170306_0419'),
]
operations = [
migrations.AddField(
model_name='post',
name='member_Name',
... | {
"content_hash": "ce6772780ac85b51ed15ad46c87a6418",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 95,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.607981220657277,
"repo_name": "R-Wolf/CFD_A_library",
"id": "76d9000a17fa80395abb728b9cc24033f746109d",
"size": "... |
import re
text = 'This is some text -- with punctuation.'
pattern = 'is'
print('Text :', text)
print('Pattern :', pattern)
m = re.search(pattern, text)
print('Search :', m)
s = re.fullmatch(pattern, text)
print('Full match :', s)
| {
"content_hash": "7343d9d03f0605bd8cbba3c3ccbe6d6c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 19,
"alnum_prop": 0.6153846153846154,
"repo_name": "jasonwee/asus-rt-n14uhp-mrtg",
"id": "ec2074dcc483e68b959fce635cf6e03e0462833d",
"size": "247",
... |
import unittest
from mlabns.db import model
from mlabns.db import client_signature_fetcher
from mlabns.db import sliver_tool_fetcher
from mlabns.util import lookup_query
from mlabns.util import message
from mlabns.util import resolver
import mock
def _createSliverTool(tool_id,
site_id=None,
... | {
"content_hash": "8327e3bfe5ac39403243b05d41e26d4b",
"timestamp": "",
"source": "github",
"line_count": 833,
"max_line_length": 80,
"avg_line_length": 42.71788715486195,
"alnum_prop": 0.59375,
"repo_name": "m-lab/mlab-ns",
"id": "fac9f1ee4cce6c4678623d0e57b296aa33e2a63c",
"size": "35584",
"binary... |
import sys
import os
from eventlet.support import greenlets as greenlet
from eventlet import patcher
try:
# try and import pkg_resources ...
import pkg_resources
except ImportError:
# ... but do not depend on it
pkg_resources = None
__all__ = ["use_hub", "get_hub", "get_default_hub", "trampoline"]
t... | {
"content_hash": "dedbff64c2027145ecd154d57d677c40",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 90,
"avg_line_length": 32.0625,
"alnum_prop": 0.6076023391812866,
"repo_name": "neumerance/cloudloon2",
"id": "9b4c2b7e203b5d0c59b2a80d6026058e33ffe3c7",
"size": "5130",
... |
from django.contrib import admin
from django.contrib.admin import register
from .models import MailChimpList
@register(MailChimpList)
class MailChimpListModelAdmin(admin.ModelAdmin):
list_display = ('slug', 'enabled', 'mailchimp_list_id')
| {
"content_hash": "fb0e0f7f3657d9f65b3988cc65ff0aba",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 59,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.7886178861788617,
"repo_name": "sussexstudent/falmer",
"id": "cbeceec1619d7adf4869a95dde90f66925d15ceb",
"size": "... |
def fibonacci(limit):
a, b, c = 0, 1, 1
series = ['1']
for i in range(1, limit):
c = a + b
a, b = b, c
series.append(str(c))
return series
def main(limit: ('upper limit for calculations', 'positional', None, int)):
series = ', '.join(fibonacci(limit))
print(f'The first ... | {
"content_hash": "e86024610d3fd5d6eed0d9a07115c6f9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 75,
"avg_line_length": 22.318181818181817,
"alnum_prop": 0.5376782077393075,
"repo_name": "alexgurrola/induction",
"id": "c52a30f569540a9e6ca1f79081565a373cffde38",
"size":... |
import operator
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas.core.dtypes.common import is_dtype_equal
import pandas as pd
import pandas._testing as tm
from pandas.core.arrays.string_arrow import ArrowStringArray, ArrowStringDtype
skip_if_no_pyarrow = td.skip_if_no("pyarrow... | {
"content_hash": "224c1b80659d29320333a404f928962b",
"timestamp": "",
"source": "github",
"line_count": 575,
"max_line_length": 88,
"avg_line_length": 32.37913043478261,
"alnum_prop": 0.6211193468686218,
"repo_name": "jreback/pandas",
"id": "53659292135037cf6dab31d1352016883e6dec5f",
"size": "18618... |
import jsondiff
from pytest_regressions.data_regression import DataRegressionFixture
import gdsfactory as gf
from gdsfactory.cross_section import cross_section
gdspath = gf.PATH.gdsdir / "mzi2x2.gds"
def test_read_gds_hash2() -> gf.Component:
c = gf.import_gds(gdspath)
h = "bfc84eea02b07fa0e167223e0fdedc8e... | {
"content_hash": "edf27fdaf0942f6cdc6acea565df1416",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 81,
"avg_line_length": 25.697674418604652,
"alnum_prop": 0.648868778280543,
"repo_name": "gdsfactory/gdsfactory",
"id": "4fc67b27632f0bf30809f8159062037e4bc4f087",
"size": ... |
from biicode.server.model.user import User
from biicode.server.model.block import Block
from biicode.common.model.content import ContentDeserializer
from biicode.common.model.cells import CellDeserializer
from biicode.common.model.id import ID
from biicode.server.store.mongo_store import MongoStore
from biicode.server.... | {
"content_hash": "477da4f90737120a4bf02b3736753611",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 94,
"avg_line_length": 46.37614678899082,
"alnum_prop": 0.6354104846686449,
"repo_name": "bowlofstew/bii-server",
"id": "95ef8bd4b605e2aa508a409290b30135e82360bc",
"size":... |
from RobotAppEyes import RobotAppEyes
from version import VERSION
_version_ = VERSION
class RobotAppEyes(RobotAppEyes):
"""
Robot-AppEyes is a visual verfication library for Robot Framework that leverages
the Eyes-Selenium and Selenium2 libraries.
"""
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
| {
"content_hash": "d761920a13c2ffec358f76fd9e8d4975",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 25.5,
"alnum_prop": 0.7483660130718954,
"repo_name": "NaviNet/Robot-AppEyes",
"id": "44e687861bda88462ba5b8110294d5e2f05e103c",
"size": "921",
"bin... |
import datetime
import unittest
import mock
from touchdown.core.datetime import parse_datetime, utc
class TestDateTime(unittest.TestCase):
def test_5m_ago(self):
with mock.patch("touchdown.core.datetime.datetime") as mock_dt:
mock_dt.utcnow.return_value = datetime.datetime(
2... | {
"content_hash": "18a815de7e9238840f87d47c486c6fa4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 29.5,
"alnum_prop": 0.6,
"repo_name": "yaybu/touchdown",
"id": "6c68736c8cb1ca73524ec98f64da6884e9839ae2",
"size": "1168",
"binary": false,
"copi... |
import os
import sys
import time
from source.k3d_directives.plot import K3D_Plot
import shutil
import json
sys.path.insert(0, os.path.abspath('../..'))
# -- Project information -----------------------------------------------------
project = 'K3D-jupyter'
author = u'Artur Trzęsiok, Marcin Kostur, Tomasz Gandor, Thoma... | {
"content_hash": "c13e1b152680bc6ba4ad85734c36d1e9",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 88,
"avg_line_length": 29.52212389380531,
"alnum_prop": 0.5974220623501199,
"repo_name": "K3D-tools/K3D-jupyter",
"id": "819b004536d97263044ceca29faa20f4377e55c5",
"size":... |
import pandas as pd
import numpy as np
import SimpleRegression as SR
sales = None
train_data = None
test_data = None
# load data from csv files
def loaddata():
global sales, train_data, test_data
train_data = pd.read_csv('../Datafiles/kc_house_train_data.csv')
test_data = pd.read_csv('../Datafiles/kc_hou... | {
"content_hash": "3410c1da6dcea3d144868c5fd72fb783",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 100,
"avg_line_length": 30.47826086956522,
"alnum_prop": 0.68188302425107,
"repo_name": "nonlining/SimpleML",
"id": "41b6a5c8464ae3c77a09e755c6832b2dcc0823ec",
"size": "173... |
from concurrent.futures import ThreadPoolExecutor
from rx.core import Scheduler
from .newthreadscheduler import NewThreadScheduler
class ThreadPoolScheduler(NewThreadScheduler):
"""A scheduler that schedules work via the thread pool."""
class ThreadPoolThread:
"""Wraps a concurrent future as a thre... | {
"content_hash": "63d40127352ec35c13726fe8e71e9532",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 70,
"avg_line_length": 30.25,
"alnum_prop": 0.6714876033057852,
"repo_name": "ChemiKhazi/Sprytile",
"id": "0ac08b3f5e365aadd3b9f11ee4f258f6f3cf4085",
"size": "968",
"bina... |
"""
Example of spatial graph
"""
import geoplotlib
from geoplotlib.utils import read_csv
data = read_csv('./data/flights.csv')
geoplotlib.graph(data,
src_lat='lat_departure',
src_lon='lon_departure',
dest_lat='lat_arrival',
dest_lon='lon_arrival',
... | {
"content_hash": "8d0909b7fc3b514584a6ee40ef04d58d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 41,
"avg_line_length": 25,
"alnum_prop": 0.5247058823529411,
"repo_name": "lucciano/geoplotlib",
"id": "61574d69d92aef926d2b9114eb3f3964a5b73dbd",
"size": "425",
"binary"... |
"""## Functions for copying elements from one graph to another.
These functions allow for recursive copying of elements (ops and variables)
from one graph to another. The copied elements are initialized inside a
user-specified scope in the other graph. There are separate functions to
copy ops and variables.
There is a... | {
"content_hash": "8e901b99ead94e7d7c268872f8f7ec00",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 79,
"avg_line_length": 33.84274193548387,
"alnum_prop": 0.6457762421065173,
"repo_name": "laszlocsomor/tensorflow",
"id": "d060eda0a74010db10d9506b2a1c2345b2731709",
"size... |
"""deck2pdf utilities
"""
import os
import hashlib
def gen_md5(filepath):
"""Return MD5 hex digest from file
:param filepath: target file path
:type filepath: str
:return: md5 digest (hex)
:rtype: str
"""
if not os.path.exists(filepath):
raise Exception()
hash_ = hashlib.md5()... | {
"content_hash": "a3fd16148698161409f2c6564fe1f273",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 53,
"avg_line_length": 22.476190476190474,
"alnum_prop": 0.6080508474576272,
"repo_name": "attakei/slide2pdf",
"id": "abf17057d88a63374064802ad3787295730d4476",
"size": "49... |
from pyrep.errors import PyRepError
from pyrep.backend import sim
from typing import Any
class Signal(object):
"""Signals can be seen as global variables.
Four types of signals are currently supported:
integer-, floating-, double-, and string-type signals.
Signals can be defined, redefined, read and ... | {
"content_hash": "00fd269d62ec61ba371f874148814286",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 71,
"avg_line_length": 25.46078431372549,
"alnum_prop": 0.6037735849056604,
"repo_name": "stepjam/PyRep",
"id": "c1513af427023d395880eee081c47e0e371396f0",
"size": "2597",... |
import codecs
import struct
import discord
from bs4 import BeautifulSoup
from cogs.guildwars2.utils.db import prepare_search
from discord import app_commands
from discord.app_commands import Choice
class MiscMixin:
@app_commands.command()
@app_commands.describe(
language="The language of the wiki to... | {
"content_hash": "402d2db9a94a43cf078f8a7e07b333a6",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 131,
"avg_line_length": 43.34158415841584,
"alnum_prop": 0.5150199885779555,
"repo_name": "Maselkov/GW2Bot",
"id": "760e357019d215cd18b4385e483e9d929fc57e37",
"size": "875... |
from __future__ import print_function
import argparse
import json
import os
import sys
import urlparse
from hooks import install
from paste import fileapp
from paste import httpserver
import webapp2
from webapp2 import Route, RedirectHandler
from dashboard_build import dashboard_dev_server_config
from tracing_buil... | {
"content_hash": "e3960aeff33734ed49c0d2415b908072",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 77,
"avg_line_length": 32.02395209580838,
"alnum_prop": 0.6454749439042633,
"repo_name": "endlessm/chromium-browser",
"id": "d109f2c8f8cd4d3bd61bfe306bdea7faebc817f3",
"si... |
import glob
import os
import platform
import subprocess
import sys
from setuptools import setup, Command, Extension
from setuptools.command.test import test as TestCommand
def define_extensions(file_ext):
return [Extension("lightfm.lightfm_fast",
['lightfm/lightfm_fast%s' % file_ext],
... | {
"content_hash": "59e9b66c5ce29fabc2c081923b273cc5",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 88,
"avg_line_length": 25.942622950819672,
"alnum_prop": 0.5769352290679305,
"repo_name": "shaunstanislaus/lightfm",
"id": "fc49366a79eb0ebbb5d228f8da4be132685d458c",
"siz... |
import threading
import time
class Box(object):
lock = threading.RLock()
def __init__(self):
self.total_items = 0
def execute(self,n):
Box.lock.acquire()
self.total_items += n
Box.lock.release()
def add(self):
Box.lock.acquire()
self.execute(1)
Bo... | {
"content_hash": "a2224477afae9928f6c04751e0a521fa",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 65,
"avg_line_length": 24.19607843137255,
"alnum_prop": 0.5745542949756888,
"repo_name": "IdiosyncraticDragon/Reading-Notes",
"id": "7130a7a44fb2155484fc188a8ede8da8cef3e33a"... |
from horizon.test.settings import * # noqa: F403,H303
from openstack_dashboard.test.settings import * # noqa: F403,H303
# Update the dashboards with magnum_ui
import magnum_ui.enabled
import openstack_dashboard.enabled
from openstack_dashboard.utils import settings
# pop these keys to avoid log warnings about depre... | {
"content_hash": "9ebae4930429f2623d0557eda00b7d4c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 72,
"avg_line_length": 30.083333333333332,
"alnum_prop": 0.7617728531855956,
"repo_name": "openstack/magnum-ui",
"id": "37d1997ef0e4db66ed9cb8d89a8b41f29080230b",
"size": "... |
r"""
==================================
Constants (:mod:`scipy.constants`)
==================================
.. currentmodule:: scipy.constants
Physical and mathematical constants and units.
Mathematical constants
======================
================ ===========================================================... | {
"content_hash": "2c09221126f80717035b698356db78c0",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 94,
"avg_line_length": 35.86470588235294,
"alnum_prop": 0.4261112022306052,
"repo_name": "lhilt/scipy",
"id": "b1010cb1698c729df2738026e0283b457b33f869",
"size": "12194",
... |
import platform as sysinfo
import base64 as encoder
import json
nl = '\n'
EI = sysinfo.platform() + nl + sysinfo.machine() + nl + sysinfo.processor() + nl + sysinfo.system() + ' ' + sysinfo.version()
file = open(".sysinfo", "w+")
file.write(EI)
file.close()
print (encoder.b64encode(bytes(EI, "utf-8"), altchars=None... | {
"content_hash": "5f00894ca9d95e1a950d7652063d27e4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 125,
"avg_line_length": 24.846153846153847,
"alnum_prop": 0.6718266253869969,
"repo_name": "L1b3r4t0r/CodeWisard-string-tools",
"id": "0574eb7a09db339443af8d36d2f4ff3257fc364... |
from __future__ import absolute_import
# Import Salt Libs
from salt.states import win_dism as dism
# Import Salt Testing Libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,
patch
)
ensure_in_syspath('../../')
dism.__salt__ = {}
di... | {
"content_hash": "6b504507efe19c9d4e23859af9b8fe97",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 75,
"avg_line_length": 34.14147286821706,
"alnum_prop": 0.5015609922234205,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "9d2811ff10fcb367f0d5f63c6c11fb3ff510... |
"""A notebook manager that uses the local file system for storage.
Authors:
* Brian Granger
* Zach Sailer
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in... | {
"content_hash": "764c483be03ecc5f21af3a0ac5971942",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 115,
"avg_line_length": 38.002079002079,
"alnum_prop": 0.5568685376661743,
"repo_name": "omni5cience/django-inlineformfield",
"id": "c9d4a32a0c43dd5af1efd0b3ab84063b7f8f4370... |
from __future__ import absolute_import, unicode_literals
import unittest
from django.core.files.base import ContentFile
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.six import b
from wagtail.tests.utils import WagtailT... | {
"content_hash": "9609d01115498e3a7b8624f9346dddd2",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 104,
"avg_line_length": 35.39473684210526,
"alnum_prop": 0.6510532837670384,
"repo_name": "iansprice/wagtail",
"id": "715b3452090d892b5c2bc80923fd6c2b72fcffa7",
"size": "4... |
from tastypie.contrib.contenttypes.fields import GenericForeignKeyField
from tastypie.resources import ModelResource
from content_gfk.models import Note, Quote, Definition, Rating
class DefinitionResource(ModelResource):
class Meta:
resource_name = 'definitions'
queryset = Definition.objects.all(... | {
"content_hash": "3dd18a035fc1832b9f6261e3af4b29b1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 71,
"avg_line_length": 25.12121212121212,
"alnum_prop": 0.6960193003618818,
"repo_name": "11craft/django-tastypie",
"id": "47c3c49dbb93f7f10ead5aed5d10b20dec3769e9",
"size"... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "c26b935e6fd251aabb60855718f01e2c",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 110,
"avg_line_length": 39.54913294797688,
"alnum_prop": 0.5594855305466238,
"repo_name": "plaid/plaid-python",
"id": "e2dc6586dfc86c0eebdaf5b41a28caaa685250bf",
"size": "... |
"""This module is used on every CLI operation"""
import os
import sys
import inspect
import imp
from symautomata.alphabet import createalphabet
sys.path.insert(1, imp.find_module('lightbulb')[1]+'/core/modules')
moduleNames = [name[:-3] for name in os.listdir(imp.find_module('lightbulb')[1]+'/core/modules')
... | {
"content_hash": "66f38291e5619beff1a8cfbd4ef83285",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 96,
"avg_line_length": 34.63265306122449,
"alnum_prop": 0.6529169121979964,
"repo_name": "lightbulb-framework/lightbulb-framework",
"id": "20632be18c94983af28e17338246a08ea9d... |
"""Test for nrf24l01 module. Portable between MicroPython targets."""
import usys
import ustruct as struct
import utime
from machine import Pin, SPI
from nrf24l01 import NRF24L01
from micropython import const
# Slave pause between receiving data and checking for further packets.
_RX_POLL_DELAY = const(15)
# Slave pa... | {
"content_hash": "55a4013981ffc8eab432e3dec36b9c94",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 95,
"avg_line_length": 32.24,
"alnum_prop": 0.5583126550868487,
"repo_name": "henriknelson/micropython",
"id": "56bdb6e26eb9c1277783c1410dbc6a5d99f9903c",
"size": "4836",
... |
import numpy as np
from sklearn import cross_validation
from sklearn import tree
from sklearn.neighbors import KNeighborsClassifier
from data_processing_ml import *
def ten_fold_CV(classifier, x_train, y_train):
""" This function takes three arguments:
1) classifier, an just initialized classifier we ... | {
"content_hash": "88a2efe57dad979b2bd0cdd9ae524d18",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 101,
"avg_line_length": 36.36842105263158,
"alnum_prop": 0.6570188133140377,
"repo_name": "maggieli96/35-Final-Project",
"id": "9f777979ea5b1d148d21dbfd7be5a5be94ba27c2",
... |
"""Helper functions for model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import REDACTED.transformer_lingvo.lingvo.compat as tf
from REDACTED.transformer_lingvo.lingvo.core import py_utils
import six
from six.moves import range
def ComputeSplits(... | {
"content_hash": "b23c2a1adb9d3f46f47b8b70096ca77e",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 80,
"avg_line_length": 30.767857142857142,
"alnum_prop": 0.6642484039466048,
"repo_name": "mlperf/training_results_v0.7",
"id": "e37de1c27e55738f1c8c97b1b599987f1d2eed44",
... |
import sys
import numpy as np
from itertools import izip
BINARYMATFILENAME = sys.argv[1]
MATERNALFASTAFILENAMELISTFILENAME = sys.argv[2]
PATERNALFASTAFILENAMELISTFILENAME = sys.argv[3]
OUTPUTSEQUENCESMATFILENAMEPREFIX = sys.argv[4] # Should not end with .
OUTPUTSEQUENCESPATFILENAMEPREFIX = sys.argv[5] # Should not end... | {
"content_hash": "c3a05d78a94cc72706f6d87fcfc035dc",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 199,
"avg_line_length": 50.76335877862596,
"alnum_prop": 0.783609022556391,
"repo_name": "imk1/IMKTFBindingCode",
"id": "b55a4b07e72168dea51646a307a065629c551187",
"size":... |
import numpy as np
from robosuite.models.objects import PrimitiveObject
from robosuite.utils.mjcf_utils import get_size
class CapsuleObject(PrimitiveObject):
"""
A capsule object.
Args:
size (2-tuple of float): (radius, half-length) size parameters for this capsule object
"""
def __init... | {
"content_hash": "bc838cdee23044a3003a55af15d6f44a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 94,
"avg_line_length": 25.544117647058822,
"alnum_prop": 0.5561312607944733,
"repo_name": "ARISE-Initiative/robosuite",
"id": "4aec85713c51b4485371077746130b6b2d56aea4",
"s... |
"""
Defines methods for generating features with Kaldi.
"""
from os import path,remove
from shutil import copy2
from string import strip
from subprocess import Popen
from tempfile import NamedTemporaryFile
from skip.util import (KaldiObject, _randFilename, _getCachedObject,
_cacheObject, _refreshRequired, KaldiErro... | {
"content_hash": "0e5c010e571f4f9bf3b6404f46220ddb",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 113,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.670492587278814,
"repo_name": "mrfalcone/skip",
"id": "04d0d4c8a7d5d68af5829de6dfb86f2c04e4a112",
"size": "6913... |
''' analyzeData provides data analysis and storage through the DataSet class for the Geiger-Counter lab
in Columbia's W3081 Intermediate Physics Laboratory Course'''
import scipy as sp
import scipy.io.wavfile as wav
import pickle
import csv
# All times must be in seconds
class DataSet:
''' The DataSet class c... | {
"content_hash": "4868a39333d2e8a32d0afa96239a7206",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 164,
"avg_line_length": 49.805882352941175,
"alnum_prop": 0.6479272469587811,
"repo_name": "samkohn/Geiger-Counter",
"id": "899aba66b1766a9b199344b9442f01829ec0501d",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.