text stringlengths 4 1.02M | meta dict |
|---|---|
"""JSON-L parser plugin for Azure application gateway access log files."""
from dfdatetime import time_elements as dfdatetime_time_elements
from plaso.containers import events
from plaso.parsers import jsonl_parser
from plaso.parsers.jsonl_plugins import interface
class AzureApplicationGatewayAccessEventData(events... | {
"content_hash": "c5c927c920f1ad3d6cfb0595870f3cf8",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 80,
"avg_line_length": 43.17142857142857,
"alnum_prop": 0.7080300022060446,
"repo_name": "log2timeline/plaso",
"id": "f0715908d84f226ee58199479c5a77c87b8c6886",
"size": "9... |
import sys
from mpi4py import MPI
from pySDC.helpers.stats_helper import get_sorted
from pySDC.implementations.controller_classes.controller_MPI import controller_MPI
from pySDC.implementations.problem_classes.HeatEquation_ND_FD import heatNd_unforced
from pySDC.implementations.sweeper_classes.generic_implicit impor... | {
"content_hash": "5da7f4bd9215755cd9ca9db3c3c58cc9",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 104,
"avg_line_length": 34.097744360902254,
"alnum_prop": 0.6584343991179713,
"repo_name": "Parallel-in-Time/pySDC",
"id": "0ac55bcaf8eee380276818e288fd366ce49dc04e",
"siz... |
import sys, 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 configurat... | {
"content_hash": "e0e3bdd416f1143fd44e12f923e52390",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 86,
"avg_line_length": 32.19650655021834,
"alnum_prop": 0.7022921470229214,
"repo_name": "Prezto/Shopr",
"id": "87e17925ff5aff4f4d8c289a2c9409ca63ea40be",
"size": "7790",
... |
import collections
import copy
import os
import random
import shutil
import abc
import numpy as np
import librosa
from spych import data
from spych.audio import signal
from spych.utils import naming
class DatasetBase(metaclass=abc.ABCMeta):
"""
Defines the base interface for an audio dataset.
"""
... | {
"content_hash": "65bde6ffaf4fb9074d8f79ed25ebe8a9",
"timestamp": "",
"source": "github",
"line_count": 728,
"max_line_length": 151,
"avg_line_length": 36.28434065934066,
"alnum_prop": 0.6085936021200076,
"repo_name": "ynop/spych",
"id": "b104e832a3929501f588d8bffee97ae779aca51e",
"size": "26415",
... |
__author__ = 'Ahmed Hani Ibrahim'
import pandas as pnd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sb
def get_train_data():
training_data = pnd.read_csv("./train.csv", header=0, parse_dates=['Dates'])
#training_data = pnd.read_csv("./train.csv", header=0)
return training_data
de... | {
"content_hash": "cb129f9b060378cd0b77bcdbc3e551de",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 111,
"avg_line_length": 50.26865671641791,
"alnum_prop": 0.6802256532066508,
"repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions",
"id": "954238c96bcc1e26ca87cafe631... |
from functools import partial
import os.path as op
from ...utils import verbose
from ..utils import (has_dataset, _data_path, _get_version, _version_doc,
_data_path_doc)
has_brainstorm_data = partial(has_dataset, name='brainstorm')
_description = u"""
URL: http://neuroimage.usc.edu/brainstorm/T... | {
"content_hash": "9f67c4ab4168628b511813cf4a1d071d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 79,
"avg_line_length": 32.26086956521739,
"alnum_prop": 0.6030997304582211,
"repo_name": "jniediek/mne-python",
"id": "ab10b63ce1a3012e8509684339376771ebe108b1",
"size": "1... |
from __future__ import absolute_import, division, print_function
from .version import __version__ # noqa
from .xnat_BIDS import * # noqa
| {
"content_hash": "ce780bf3bd6a5f3da49160793a167a12",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 64,
"avg_line_length": 46.333333333333336,
"alnum_prop": 0.7266187050359713,
"repo_name": "HBClab/xnat_BIDS",
"id": "e3e46e1b542518669b547e946ae5ae2c522991ec",
"size": "139"... |
from msrest.paging import Paged
class USqlCredentialPaged(Paged):
"""
A paging container for iterating over a list of USqlCredential object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[USqlCredential]'}
}
d... | {
"content_hash": "f1362fffc0037d80931238d6a37e58f6",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 26.5,
"alnum_prop": 0.5966981132075472,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "0d1e2a26e39af8f7aabd144b3a1dfab82f644091",
"size": "898"... |
""" Test case for the GraphWidget"""
from tempfile import mkdtemp
from pySUMOQt import MainWindow
import pysumo
import shutil
"""
Steps:
1. Open pySUMO
2. Open TextEditor
3. Open Merge.kif
4. Choose Merge.kif
5. Collapse Line 288
6. Collapse Line 136
7. Collapse Line 134
8. Uncollapse Line 134
9. Uncollapse Line 288
1... | {
"content_hash": "6fddf032f7d9e344776cff8a86e31111",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 45,
"avg_line_length": 19.46153846153846,
"alnum_prop": 0.7154150197628458,
"repo_name": "pySUMO/pysumo",
"id": "2cf843dc69610804d8c14cf03713829988197bf6",
"size": "506",
... |
""" Sahana Eden Situation Model
@copyright: 2009-2014 (c) Sahana Software Foundation
@license: MIT
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, inc... | {
"content_hash": "e28c3f289f6503758ffdc3c5353c2ebc",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 80,
"avg_line_length": 37.576687116564415,
"alnum_prop": 0.43444897959183676,
"repo_name": "julianprabhakar/eden_car",
"id": "6bfeb003f6c33ec6871f90b64ae8c3e4ff2dbcee",
"s... |
import jinja2
import os
# Supports an incomplete SPEC of DNS Zone entrys
class Zone(object):
# TODO: Add Validation
# TODO: Compare with RFC
def __init__(self):
self.contents = {
'A': [],
'AAAA': [],
'CAA': [],
'CERT': [],
'CNAME': [],
... | {
"content_hash": "14c0d936fd63049489f273cb5650f6a2",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 78,
"avg_line_length": 29.490322580645163,
"alnum_prop": 0.49332749945307375,
"repo_name": "chuckbutler/DNS-Charm",
"id": "dc4f6e2bfe18f680cca94ea6ba873d4492a9649f",
"size... |
from .hash_lookup import HashLookup
from .pg_trigram import PgTrigramCharField, PgTrigramTextField
from .range import DateRangeField, DateTimeRangeField, FloatRangeField, \
BigIntegerRangeField, IntegerRangeField
from .pg_ltree import PgLtreeField
| {
"content_hash": "791b1282a2c47b3fd9c1a5c84ac857b0",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 73,
"avg_line_length": 50.4,
"alnum_prop": 0.8452380952380952,
"repo_name": "RedMadRobot/rmr_django",
"id": "7980cd10b362ce9bf1edd3c61d46e9fc537e374b",
"size": "252",
"bin... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_r5_crafted_space.iff"
result.attribute_template_id = 9
result.stfName("droid_name","r5_base")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "072cf37c59b9984b757b3b3607d71747",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 22.307692307692307,
"alnum_prop": 0.6862068965517242,
"repo_name": "obi-two/Rebelion",
"id": "1469dcc7586ae3173d43d36858d578e25b546d44",
"size": "435... |
"""Provide the ReplyableMixin class."""
from ....const import API_PATH
class ReplyableMixin(object):
"""Interface for RedditBase classes that can be replied to."""
def reply(self, body):
"""Reply to the object.
:param body: The markdown formatted content for a comment.
:returns: A :c... | {
"content_hash": "28d7f795c022ce24cb642e68fb0457e1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 32.0625,
"alnum_prop": 0.6374269005847953,
"repo_name": "nmtake/praw",
"id": "2e103fc87e61a8f49e90d16aeb86383fb37690a5",
"size": "513",
"binary": f... |
from __future__ import absolute_import, division, print_function
from toolz import curry, pipe, partial
from .optimize import fuse, cull
import multiprocessing
import psutil
import dill
import pickle
from .async import get_async # TODO: get better get
def get(dsk, keys, optimizations=[fuse]):
""" Multiprocessed ... | {
"content_hash": "836dca1452e6bbb02d9245e5445492be",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 27.627906976744185,
"alnum_prop": 0.664983164983165,
"repo_name": "PeterDSteinberg/dask",
"id": "a9c1ec768a13c5a62c30bce147381654ea2a70c8",
"size": "... |
import dilap.core.model as dmo
import dilap.core.tools as dpr
import dilap.core.vector as dpv
import pdb,math
class stairs(dmo.model):
def __init__(self,*args,**kwargs):
dmo.model.__init__(self,*args,**kwargs)
self._def('steps',8,**kwargs)
self._def('l',10,**kwargs)
self._def('w',... | {
"content_hash": "ec41f477ecf5bab2238d0c46bbbc7434",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 35.236363636363635,
"alnum_prop": 0.5851393188854489,
"repo_name": "ctogle/dilapidator",
"id": "a4a26aa0ffe78526babdc2caa3ae39b3bc8485b5",
"size": "1... |
'''
'''
import json
import threading
USE_SSL = False
PORT=8000
SERVER = None
from pwebsocket_server import WebsocketServer
class WSServer(WebsocketServer):
def sendMessageToAllClients(self, msg):
msgBuf = json.dumps(msg)
self.send_message_to_all(msgBuf)
def serveforever(self):
sel... | {
"content_hash": "c0267d61a6de3613269a4aa04d9816c2",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 66,
"avg_line_length": 24.29230769230769,
"alnum_prop": 0.6871437618746041,
"repo_name": "WorldViews/Spirals",
"id": "f288b6154c45b8ce3ad55c11df09887f8149a732",
"size": "15... |
import addressbook_pb2
import sys
# Iterates though all people in the AddressBook and prints info about them.
def ListPeople(address_book):
for person in address_book.person:
print "Person ID:", person.id
print " Name:", person.name
if person.HasField('email'):
print " E-mail address:", person.em... | {
"content_hash": "1236f183f1b5e84e459d18533ddfb41a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 75,
"avg_line_length": 31.08823529411765,
"alnum_prop": 0.6821192052980133,
"repo_name": "google/shipshape",
"id": "d470349a8bf34559391d682cdaf300c66b1aa118",
"size": "1139... |
"""The tests for the person component."""
from unittest.mock import Mock
import pytest
from homeassistant.components.device_tracker import (
ATTR_SOURCE_TYPE, SOURCE_TYPE_GPS, SOURCE_TYPE_ROUTER)
from homeassistant.components.person import (
ATTR_SOURCE, ATTR_USER_ID, DOMAIN, PersonManager)
from homeassistant... | {
"content_hash": "00c6fe8100211a885f0fff7eb4b42587",
"timestamp": "",
"source": "github",
"line_count": 625,
"max_line_length": 79,
"avg_line_length": 34.9312,
"alnum_prop": 0.6418559912055698,
"repo_name": "DavidLP/home-assistant",
"id": "cde7633b1a3890e1c29c63e012998984860ff47e",
"size": "21832",... |
from random import randint
import re
import hearthbreaker
import hearthbreaker.constants
import hearthbreaker.game_objects
import hearthbreaker.cards
import hearthbreaker.game_objects
import hearthbreaker.proxies
class ReplayException(Exception):
def __init__(self, message):
super().__init__(message)
c... | {
"content_hash": "1617c59b362b8046577f25350f8098dc",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 119,
"avg_line_length": 34.571776155717764,
"alnum_prop": 0.5623196565557042,
"repo_name": "anuragpapineni/Hearthbreaker-evolved-agent",
"id": "7f9500b2f0a4831f5cb6b9cfe7a5c... |
from django.conf.urls import patterns, include, url
import views
urlpatterns = patterns('',
url(r'^(\d+)', views.generate_thumbnails),
)
| {
"content_hash": "92de92d9f53a5f717c31ce5d07044982",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.704225352112676,
"repo_name": "caa/django-galleries",
"id": "1cbe33d8e525d512661b4f41bcd603794931b821",
"size": "1... |
import sys
import asyncio
import dscframework
import json
async def on_connect(cli):
print("subbing", flush=True)
await cli.subscribe("test", testsub)
# Guid is created by the sensor that first broadcasts this data
# TODO implement it, to track predictions etc
# TODO maybe the node server should add the pytho... | {
"content_hash": "95173caa25de5b46f2d3be333767026b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 101,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.7067039106145251,
"repo_name": "dscplatform/dscframework",
"id": "5c8c311844e5cc3272fbe7bfb1b2b4e3efbfedcd",
"siz... |
import datetime
import os.path
import subprocess
from django.db import models
from django.core.files.base import ContentFile
from django.utils.translation import ugettext as _
from django.utils.hashcompat import md5_constructor
from django.utils.encoding import smart_str
from django.contrib.auth.models import User
t... | {
"content_hash": "99be53bbca71b55638ed43c0ff6e76eb",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 92,
"avg_line_length": 36.69078947368421,
"alnum_prop": 0.5854402008248162,
"repo_name": "dgouldin/django-avatar",
"id": "801b89996ea8c6461bf4f320135ac31da4729580",
"size"... |
import sys
from sc_stats import WartsStats, basic, obj_type
def print_trace(flags, ips, rtts, meta):
print "traceroute from %s to %s" % (flags['srcaddr'], flags['dstaddr'])
for i, ip in enumerate(ips):
ttl = i+1
print "%2d %s" % (ttl, ip),
if ttl in rtts:
print " %2.3f ms" % (rtts[ttl]),
... | {
"content_hash": "40ae2ea4fac512077eea01c9cc9f3022",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 94,
"avg_line_length": 32.55172413793103,
"alnum_prop": 0.5715042372881356,
"repo_name": "cmand/scamper",
"id": "4a457532e96fdfe4c645b2b0906ab9de9fb841ee",
"size": "2046",
... |
from election_office_measure.models import CandidateCampaign
from organization.models import Organization
from position.models import PositionEntered
from rest_framework import serializers
class CandidateCampaignSerializer(serializers.ModelSerializer):
class Meta:
model = CandidateCampaign
fields ... | {
"content_hash": "3db663ccaaee2c3e796a5f40d4ca376f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 119,
"avg_line_length": 42.12,
"alnum_prop": 0.6837606837606838,
"repo_name": "wevoteeducation/WeVoteBase",
"id": "a24389fbdb87e1429de899729554e9aa5017f11d",
"size": "1146"... |
import importlib
from sacred.utils import modules_exist
from sacred.utils import get_package_version, parse_version
def optional_import(*package_names):
try:
packages = [importlib.import_module(pn) for pn in package_names]
return True, packages[0]
except ImportError:
return False, None... | {
"content_hash": "533b9ca8db00c079655e99c8c3c66f8d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 29.46153846153846,
"alnum_prop": 0.683420365535248,
"repo_name": "IDSIA/sacred",
"id": "3ca6e9aa92117e2b497a669c38676d861d6877c2",
"size": "1570",
... |
"""Module containing class for AWS's Glue Crawler."""
import json
from typing import Any, Dict, Optional, Tuple
from absl import flags
from perfkitbenchmarker import data_discovery_service
from perfkitbenchmarker import providers
from perfkitbenchmarker import vm_util
from perfkitbenchmarker.providers.aws import util... | {
"content_hash": "d7caa77e0572a2ad4d088229ca74d443",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 80,
"avg_line_length": 30.465686274509803,
"alnum_prop": 0.6275140788415124,
"repo_name": "GoogleCloudPlatform/PerfKitBenchmarker",
"id": "4ebee8041b28358fd8eb2eb4615bbd6023... |
X, y = preprocess(data, shuffle=False, n_samples=1000, normalization=None)
from sklearn.manifold import LocallyLinearEmbedding
lle = LocallyLinearEmbedding(n_neighbors=15,
n_components=3, method='modified')
X_proj = lle.fit_transform(X)
three_component_plot(X_proj[:, 0], X_proj[:, 1], X_p... | {
"content_hash": "7ebc7846f2e072451eb2ab81bf183647",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 93,
"avg_line_length": 45.25,
"alnum_prop": 0.6823204419889503,
"repo_name": "vtesin/sklearn_tutorial",
"id": "616693ca5a8ca773cd230a088e1e483b320221f3",
"size": "372",
"b... |
from httplib import HTTPSConnection, HTTPException
from urllib import urlencode
from ssl import SSLError
import sickbeard
from sickbeard import logger, common
class PushalotNotifier:
def test_notify(self, pushalot_authorizationtoken):
return self._sendPushalot(pushalot_authorizationtoken, event="Test", m... | {
"content_hash": "69916f09d591bd1308f6696444e05979",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 156,
"avg_line_length": 44.921875,
"alnum_prop": 0.6281739130434782,
"repo_name": "Branlala/docker-sickbeardfr",
"id": "3d3d634d16ed24ff4463f151d7c3af284049bfff",
"size": "... |
import time
import png
import numpy as np
from math import sqrt
def save_fig(pixels=[]):
pixels = np.array(pixels)
pixels = pixels.reshape(int(sqrt(len(pixels))), int(sqrt(len(pixels))))
pixels = pixels.tolist()
s = map(lambda x: map(int, x), pixels)
name = str(time.time()) + '.png'
f = open('... | {
"content_hash": "f6e7e51a8603d85be27a9f79b5d58be7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 75,
"avg_line_length": 27.75,
"alnum_prop": 0.6148648648648649,
"repo_name": "ZebTech/geneticExperiment",
"id": "782b45a3e073f64303258bb0a0a7e45bfcd12608",
"size": "469",
... |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from openstack_dashboard.dashboards.project.routers.extensions.routerrules\
import rulemanager
from horizon import tables
LOG = logging.getLogger(__name__)
class AddRouterRule(tables.LinkAction)... | {
"content_hash": "39a98bf408de79bc768330beef161bc5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 75,
"avg_line_length": 33.06,
"alnum_prop": 0.6563823351482153,
"repo_name": "hep-gc/glint-horizon",
"id": "903e5b8d4152890b7534e8846380183ac7108ae6",
"size": "2317",
"bi... |
import base64
import json
import logging
import os
from collections import defaultdict
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.shortcuts import render
from django.templatet... | {
"content_hash": "a43e610c56a05ba349ca4762c2b93a41",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 77,
"avg_line_length": 33.8562874251497,
"alnum_prop": 0.6818181818181818,
"repo_name": "b12io/orchestra",
"id": "89e4b15e24bb7ab9708b009d08f4dc365fcb4608",
"size": "11308... |
import numpy as np
import torch
from PIL import Image
from argparse import ArgumentParser
from torch.optim import SGD, Adam
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision.transforms import Compose, CenterCrop, Normalize
from torchvision.transforms import ToTensor, ToPILIm... | {
"content_hash": "820f2ff607fea1196314cfbd82860e45",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 79,
"avg_line_length": 33.355828220858896,
"alnum_prop": 0.6051131138495494,
"repo_name": "bodokaiser/piwise",
"id": "2accfabc8a11170b3bb35e7ae06e996db626f682",
"size": "5... |
import sys
sys.path.insert(1, "../../")
import h2o, tests
def varimp_test(ip,port):
train = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
# Run GBM
my_gbm = h2o.gbm(y=train["class"], x=train[1:4], ntrees=50, learn_rate=0.1, distribution="multinomial")
should_be_none = ... | {
"content_hash": "5bf08484722901ed9b11e6a2751c7a5e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 120,
"avg_line_length": 42.47826086956522,
"alnum_prop": 0.6151484135107472,
"repo_name": "bospetersen/h2o-3",
"id": "5a67a866754a797d127c1d480c9a3b2eb7ed983a",
"size": "97... |
from typing import Optional, Tuple, Type
from sortedcontainers import SortedKeyList
from types import TracebackType
import asyncio
class _AcquireManager:
def __init__(self, ws: 'WeightedSemaphore', n: int):
self._ws = ws
self._n = n
async def __aenter__(self) -> '_AcquireManager':
awa... | {
"content_hash": "7a28afb65819abb0e0a1634c35980c40",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 97,
"avg_line_length": 28.862745098039216,
"alnum_prop": 0.5441576086956522,
"repo_name": "hail-is/hail",
"id": "d899c0779dd04e73c440abd6c42da3aaddbdd170",
"size": "1472",
... |
from django.conf import settings
from django.core import mail
from django.test import TestCase
from django.test.utils import captured_stdout
from django.test.utils import override_settings
from smsish.sms import send_sms
from smsish.sms import send_mass_sms
from smsish.sms.message import SMSMessage
VALID_FROM_NUMBER ... | {
"content_hash": "34a21bfb80ad51d109d58f3e98c206a7",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 119,
"avg_line_length": 31.139423076923077,
"alnum_prop": 0.7096649683495445,
"repo_name": "RyanBalfanz/django-smsish",
"id": "64e3865eb023943de97beddc5dd941909e462c5d",
"... |
import collections
from .base import Logger
class Dynamic(Logger):
'''Dynamic logger allowing delayed computation of values.'''
def __getitem__(self, key):
'''Return value referenced by *key*.
If the value is a callable, then call it and return the result. In
addition store the comp... | {
"content_hash": "e4a4d3b5a80c19e6504eef433ff93155",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 25.5,
"alnum_prop": 0.6294117647058823,
"repo_name": "4degrees/sawmill",
"id": "76d3bd4f95693f4d25cb06f4ee10663bffc31962",
"size": "615",
"binary":... |
from datetime import datetime
import logging
import sqlparse
from past.builtins import basestring
import pandas as pd
from sqlalchemy import (
Column, Integer, String, ForeignKey, Text, Boolean,
DateTime,
)
import sqlalchemy as sa
from sqlalchemy import asc, and_, desc, select
from sqlalchemy.sql.expression i... | {
"content_hash": "3f13bcf84901ef9cd8998f5dd35d32bd",
"timestamp": "",
"source": "github",
"line_count": 715,
"max_line_length": 86,
"avg_line_length": 36.546853146853145,
"alnum_prop": 0.5465156327733344,
"repo_name": "lina9527/easybi",
"id": "6dccdf874ad1ce17c9d38134b364aa7b49da3765",
"size": "261... |
from os.path import exists
from setuptools import setup
setup(name='strategies',
version='0.2.1',
description='Strategic Programming in python',
url='http://github.com/logpy/strategies',
author='Matthew Rocklin',
author_email='mrocklin@gmail.com',
install_requires=open('requirements... | {
"content_hash": "58f9cb8bbedf15de4d4deab97910b838",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.6590038314176245,
"repo_name": "mrocklin/strategies",
"id": "992044d5039d474b6a142d30f05442e271b37ea1",
"size": "... |
import unittest
import re
import sys
import os
import glob
import helper
from mockable_test_result import MockableTestResult
from runner import path_to_enlightenment
from libs.colorama import init, Fore, Style
init() # init colorama
class Sensei(MockableTestResult):
def __init__(self, stream):
unittest.T... | {
"content_hash": "005180c41346bba3c76197cd0ef754d3",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 87,
"avg_line_length": 37.523809523809526,
"alnum_prop": 0.5310913705583756,
"repo_name": "aishraj/pykons_solution",
"id": "fb93e817b5979c4599d6e1c80068cd223acd9b43",
"siz... |
from PyQt5.QtCore import pyqtSignal, QTextStream, Qt
from PyQt5.QtWidgets import QApplication
from PyQt5.QtNetwork import QLocalSocket, QLocalServer
class QtSingleApplication(QApplication):
messageReceived = pyqtSignal(str)
def __init__(self, id, *argv):
super(QtSingleApplication, self).__init__(*a... | {
"content_hash": "0ffb2e86801bf7ba5b1e442985fe292c",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 78,
"avg_line_length": 32.36585365853659,
"alnum_prop": 0.6239638281838734,
"repo_name": "narthollis/eve-mcl",
"id": "51aa596f864c89709aae0256c25df9483cf0c2f5",
"size": "27... |
"""
Adds support for Nest thermostats.
"""
import logging
from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, TEMP_CELCIUS)
REQUIREMENTS = ['python-nest==2.4.0']
# pylint: disable=unused-argument
def setup_platform(hass, config, add_devices... | {
"content_hash": "00d0bf679ebef75178df785260606ad1",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 77,
"avg_line_length": 28.3,
"alnum_prop": 0.5888440181726401,
"repo_name": "EricRho/home-assistant",
"id": "1de729b590d93b51501cd2e08883af34034af500",
"size": "3962",
"... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.trafficmanager import TrafficManagerManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-trafficmanager
# USAGE
python endpoint_get_external_with_geo_mapping.py
Before run the sample, please set the val... | {
"content_hash": "800b055ade65fb239304e607a04e46a7",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 163,
"avg_line_length": 36.94285714285714,
"alnum_prop": 0.748646558391338,
"repo_name": "Azure/azure-sdk-for-python",
"id": "57c927263d592256ab75ad32f94ac4a860a727e4",
"si... |
from __future__ import annotations
from poetry.core.spdx.helpers import license_by_id
def test_classifier_name() -> None:
license = license_by_id("lgpl-3.0-or-later")
assert (
license.classifier_name
== "GNU Lesser General Public License v3 or later (LGPLv3+)"
)
def test_classifier_nam... | {
"content_hash": "69a78ffc121a1270cd8afe6a4079ebf4",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 71,
"avg_line_length": 25.372881355932204,
"alnum_prop": 0.6686706746826987,
"repo_name": "python-poetry/poetry-core",
"id": "6cada0735db9dac55acb94093aad386ff3e6ab4b",
"si... |
ALIASES = {
'esri/basemaps': 'esriBasemaps',
'esri/config': 'esriConfig',
'esri/graphic': 'Graphic',
'esri/IdentityManager': 'esriId',
'esri/kernel': 'esriNS',
'esri/lang': 'esriLang',
'esri/map': 'Map',
'esri/request': 'esriRequest',
'esri/undoManager': 'UndoManager',
'esri/arcg... | {
"content_hash": "c50fa1a32a9f96beacae12c8712e1a71",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 53,
"avg_line_length": 36.10344827586207,
"alnum_prop": 0.6418338108882522,
"repo_name": "agrc/AmdButler",
"id": "c04ad5e3053d6c2874b4d589ae780f7c655d55e7",
"size": "1160",... |
import _plotly_utils.basevalidators
class DtickrangeValidator(_plotly_utils.basevalidators.InfoArrayValidator):
def __init__(
self,
plotly_name="dtickrange",
parent_name="barpolar.marker.colorbar.tickformatstop",
**kwargs
):
super(DtickrangeValidator, self).__init__(
... | {
"content_hash": "cdd663084f68af36a6255b45f8793152",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 31.875,
"alnum_prop": 0.5058823529411764,
"repo_name": "plotly/python-api",
"id": "3d500b8a8f117f4f3ec5adf764b88e2c102d2725",
"size": "765",
"binar... |
'''
Imaging B and C configs together. Also using Arecibo data as the input model.
Optional feathering of Arecibo and combine VLA image together.
'''
import os
from tasks import *
from taskinit import *
import casac
# vis_path = 'VLA/archival/'
vis = "M33_b_c.ms"
out_root = 'M33_206_b_c'
# mod_path = 'Arecibo/'
mo... | {
"content_hash": "6a5ef05ac14b51c7ceb40106e8e3e6e3",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 87,
"avg_line_length": 37.04255319148936,
"alnum_prop": 0.6147807773310358,
"repo_name": "e-koch/canfar_scripts",
"id": "a2a0835c15a8d48447d9e6e2a3221399fd877689",
"size":... |
import ConfigParser
import os
import rdflib
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
try:
HUMFREY_CONFIG_FILE = os.environ['HUMFREY_CONFIG_FILE']
except KeyError:
raise RuntimeError('You need to provide a HUMFREY_CONFIG_FILE environment variable pointing to an ini file')
config = ... | {
"content_hash": "9c210005f9702c8c8c3b87394ba8fa78",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 119,
"avg_line_length": 36.54708520179372,
"alnum_prop": 0.7012269938650306,
"repo_name": "ox-it/humfrey",
"id": "f84c54d8108584851b8a009fb79467f412196bf7",
"size": "8207"... |
from collections import defaultdict
from luigi import six
import luigi
import subprocess
import sys
class WikiJpTitles(luigi.ExternalTask):
def output(self):
return luigi.LocalTarget('data/jawiki-20141017-page.csv')
class WikiJpLangLinks(luigi.ExternalTask):
def output(self):
return luigi.LocalTarget('dat... | {
"content_hash": "18c9d05219903ff4df06d13173b62fee",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 130,
"avg_line_length": 35.47154471544715,
"alnum_prop": 0.6704102681641073,
"repo_name": "colspan/wikipedia-kanji-hanja-analysis",
"id": "ae3049c771d2bb70975f47e25201fc4334... |
from pydantic import BaseModel
from typing import List, Optional, Union
from sqlalchemy.sql.sqltypes import Enum
class AnimParam(BaseModel):
name: str
data_type: Union[str, int, bool, float]
value: Union[str, int, bool, float]
default_value: Optional[Union[str, int, bool, float]]
class AnimationPar... | {
"content_hash": "ffd100ed00eee0d592664ddd691f095a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 57,
"avg_line_length": 25.375,
"alnum_prop": 0.7315270935960592,
"repo_name": "skypanther/clc",
"id": "b1a72e39c268c10b80e56a5b945c452d192837fd",
"size": "406",
"binary":... |
"""This example adds a text add that uses advanced features of upgraded URLS.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of our READM... | {
"content_hash": "3d95ee48819a2f24c98ea747c23d7e74",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 79,
"avg_line_length": 34.785714285714285,
"alnum_prop": 0.612496333235553,
"repo_name": "cctaylor/googleads-python-lib",
"id": "a3032cb26e530e826aefb60b385e7e106942a249",
... |
from django.http import HttpResponse, HttpRequest, HttpResponseRedirect
from django.template import RequestContext, Template, Context
from django.shortcuts import render_to_response
from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_exempt
from django.core.urlresolvers import ... | {
"content_hash": "3144968addbe34f11788d9b876388d9a",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 341,
"avg_line_length": 42.36009174311926,
"alnum_prop": 0.6331690941577779,
"repo_name": "chasetb/sal",
"id": "d2a749daceae5b4d0a516bf8bc1f36e905345c3e",
"size": "18469",... |
from django.shortcuts import render_to_response, render
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib import auth, messages
from sms.models import *
import logging
import traceback
from django_twilio.decorators import twilio_view
from django.contrib.auth.decorators import login_required... | {
"content_hash": "b21e7a5f185b9649d37a9d959c21bcba",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 123,
"avg_line_length": 33.023809523809526,
"alnum_prop": 0.6256669069935111,
"repo_name": "cauanicastro/smssurveytools",
"id": "3c67bc73eb5492af36938e2752ad64cc066ad72e",
... |
import mmap
import sys
import warnings
import numpy as np
from astropy.io.fits.header import Header
from astropy.io.fits.util import (
_is_dask_array,
_is_int,
_is_pseudo_integer,
_pseudo_zero,
)
from astropy.io.fits.verify import VerifyWarning
from astropy.utils import isiterable, lazyproperty
from ... | {
"content_hash": "0f062bae185b67d6429e5e62821d045c",
"timestamp": "",
"source": "github",
"line_count": 1308,
"max_line_length": 89,
"avg_line_length": 36.85703363914373,
"alnum_prop": 0.5550001037150739,
"repo_name": "pllim/astropy",
"id": "dfaa4273371d96a0fd43ce874d44811353b8a4f5",
"size": "48273... |
import unittest
import re
import pytest
import fiona
from .conftest import WGS84PATTERN
@pytest.mark.usefixtures("unittest_path_coutwildrnp_shp")
class ReadingTest(unittest.TestCase):
def setUp(self):
self.c = fiona.open(self.path_coutwildrnp_shp, "r")
def tearDown(self):
self.c.close()
... | {
"content_hash": "71d48cf7d615e0545e542d5bda66b30c",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 90,
"avg_line_length": 27.83606557377049,
"alnum_prop": 0.5459363957597173,
"repo_name": "Toblerity/Fiona",
"id": "5fc567b8b86ab28e90e51a5793c5c0d4a2b76f11",
"size": "5132... |
import sys, 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 configurat... | {
"content_hash": "0f0b49b9a0b2abc2aa4dc0bf221d6c13",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 80,
"avg_line_length": 32.14468085106383,
"alnum_prop": 0.7017474185861795,
"repo_name": "renatopp/psi-robotics",
"id": "34832bc4ca3cc0c5fab1a8742bc30e704fa2f4c0",
"size":... |
import os
import platform
import re
import pytest
from conans.client.tools.oss import detected_os
from conans.model.info import ConanInfo
from conans.model.ref import ConanFileReference, PackageReference
from conans.paths import CONANFILE_TXT, CONANINFO
from conans.test.utils.tools import TestClient, GenConanfile
fr... | {
"content_hash": "59ce97fa3ffdf5f55d0e2377d51a8e1f",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 122,
"avg_line_length": 43.61574074074074,
"alnum_prop": 0.6868697590489332,
"repo_name": "conan-io/conan",
"id": "442a58a5ca45f70949aac0aee7e8e2ff32907816",
"size": "9421... |
import functools
import logging
import os
import sys
import traceback
CURRENT_SCRIPT_NAME = os.path.splitext(os.path.basename(__file__))[0]
LOG_FORMAT = ('[%(asctime)s PID %(process)s '
'%(filename)s:%(lineno)s - %(funcName)s()] '
'%(levelname)s -> \n'
'%(message)s\n... | {
"content_hash": "fd295832b7133779434805f6060811a8",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 93,
"avg_line_length": 30.346938775510203,
"alnum_prop": 0.5965030262273033,
"repo_name": "tiagoprn/experiments",
"id": "5f62f3d75d725d103e36b7590f7ea1926d8e08cc",
"size": ... |
import types
import inspect
import functools
from pytoad import Connection
from groundhogday import GroundhogDayClass
class AirbrakeNotifier(object):
def __init__(self, **kwargs):
self.environment = kwargs.get('environment', 'production')
self.additional_information = kwargs['additional_inform... | {
"content_hash": "3cb430bf976c889ba25ee3f8e4b87918",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 144,
"avg_line_length": 39.78378378378378,
"alnum_prop": 0.6569293478260869,
"repo_name": "bcoe/groundhogday",
"id": "751b770b9f0820dbbf92254d988b8be3ecf9e440",
"size": "14... |
from abc import ABCMeta
from abc import abstractmethod
from abc import abstractproperty
class NvpApiClient(object):
'''An abstract baseclass for all NvpApiClient implementations.
This defines the interface and property structure for synchronous and
coroutine-based classes.
'''
__metaclass__ = AB... | {
"content_hash": "63d797405b7a9d3f6adfc351ec12951a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 73,
"avg_line_length": 18.901960784313726,
"alnum_prop": 0.6535269709543569,
"repo_name": "aristanetworks/arista-ovs-quantum",
"id": "e3cc9d1d0d86f3515382fcc26cd99e84135e5f4a... |
from __future__ import unicode_literals
from prompt_toolkit.contrib.completers import WordCompleter
from prompt_toolkit.contrib.telnet.application import TelnetApplication
from prompt_toolkit.contrib.telnet.server import TelnetServer
from prompt_toolkit.shortcuts import create_prompt_application
from prompt_toolkit.ap... | {
"content_hash": "a59abbcf8b4f5091153c70f97ce4cffd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 78,
"avg_line_length": 36.212765957446805,
"alnum_prop": 0.663924794359577,
"repo_name": "melund/python-prompt-toolkit",
"id": "60fdf5cf7f4c32469d57c9e75e510b7ad4118a44",
"... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... | {
"content_hash": "90114d324feba7e43df006d5fec01f4f",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 155,
"avg_line_length": 41.68759124087591,
"alnum_prop": 0.6766704020170893,
"repo_name": "SergeyCherepanov/ansible",
"id": "082d6972fde887f6e8ef9d79111c8688c33b50ce",
"si... |
from .frame import *
from .protocol import *
| {
"content_hash": "936f49f3c79f5635860ce674d09edbf8",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 23,
"avg_line_length": 22.5,
"alnum_prop": 0.7333333333333333,
"repo_name": "fimad/mitmproxy",
"id": "1c143919211a70cd6145a48e2d96d1c99a26912e",
"size": "45",
"binary": fa... |
"""TODO(tsitsulin): add headers, tests, and improve style."""
from typing import List
import numpy as np
import scipy.sparse
def subgraph(graph, seed, n_neighbors): # pylint: disable=missing-function-docstring
total_matrix_size = 1 + np.cumprod(n_neighbors).sum()
picked_nodes = {seed}
last_layer_nodes = {see... | {
"content_hash": "81b2037279270e38d1e2b00b69cecb48",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 85,
"avg_line_length": 42.95161290322581,
"alnum_prop": 0.641381900112655,
"repo_name": "google-research/google-research",
"id": "329d83d7ba2854fb2ecf4b8ae87bf111f584e4cc",
... |
import os
import sys
import django
from django.conf import settings
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
"formly"
# "formly.tests",
],
MIDDLEWARE_CLASSES=[],
DATABASES={
... | {
"content_hash": "df0c2ece9a5214366e2f5e292c53a14f",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 55,
"avg_line_length": 18.76595744680851,
"alnum_prop": 0.564625850340136,
"repo_name": "eldarion/formly",
"id": "dfaab825893ff9395286c4719b0070e4f774b220",
"size": "904",
... |
from pipes.pipe import Pipe
import numpy as np
from math import sin, pi
# Legt einen Regenbogen-Filter über das Bild
# Von Luca Schimweg (@lucaschimweg)
class RainbowPipe(Pipe):
def __init__(self):
self.initialized = False
def getSinVal(self, x, offset):
return (sin((((x - offset) * pi)
... | {
"content_hash": "b017103215894618027b682cb7b6e7e2",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 73,
"avg_line_length": 32.35897435897436,
"alnum_prop": 0.5174326465927099,
"repo_name": "jstriebel/webcam-effects",
"id": "1ac5b2723d6862e8ff893eee1932db0fb81961ca",
"size... |
from helpers import unittest
from luigi.mock import MockTarget, MockFileSystem
from luigi.format import Nop
class MockFileTest(unittest.TestCase):
def test_1(self):
t = MockTarget('test')
p = t.open('w')
print('test', file=p)
p.close()
q = t.open('r')
self.assert... | {
"content_hash": "17ab0cee98508c926e10d08d220582c2",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 90,
"avg_line_length": 27.353535353535353,
"alnum_prop": 0.568685376661743,
"repo_name": "riga/luigi",
"id": "7f51cd2378ec6f6f7e04b4aedcd9903b1f377953",
"size": "3312",
"... |
import os.path
import subprocess
import tempfile
import rasterio
with rasterio.drivers():
with rasterio.open('tests/data/RGB.byte.tif') as src:
b, g, r = (src.read_band(k) for k in (1, 2, 3))
meta = src.meta
tmpfilename = os.path.join(tempfile.mkdtemp(), 'decimate.tif')
meta.update(
... | {
"content_hash": "3c06352ea58fc13b4f9d7fc51b6fb743",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 23.806451612903224,
"alnum_prop": 0.5880758807588076,
"repo_name": "clembou/rasterio",
"id": "12b2d1a2cdcfb9e0a102821fa27ca22fcde36377",
"size": "738... |
import os
import logging
import dill
import numpy as np
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.learn as learn
from scipy.stats import entropy
from deeptext.models.base import Base
from deeptext.utils.graph import freeze_graph, load_graph
from deeptext.utils.csv import read_csv
from dee... | {
"content_hash": "2eaf965189114e4a2146d7a4df8ea9f3",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 182,
"avg_line_length": 44.127272727272725,
"alnum_prop": 0.6259785743716523,
"repo_name": "ybbaigo/deeptext",
"id": "be64d15e81d47786e399a4a5890f36a4317171bb",
"size": "9... |
from CGATReport.Tracker import SingleTableTrackerRows
from CGATReport.Tracker import SingleTableTrackerHistogram
from MappingReport import MappingTracker
class MappingSummary(MappingTracker, SingleTableTrackerRows):
table = "view_mapping"
class PairedMappingSummary(MappingTracker, SingleTableTrackerRows):
t... | {
"content_hash": "3c55c8fff8d91a72fd0b2e63de1fb5fd",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 77,
"avg_line_length": 28.095588235294116,
"alnum_prop": 0.7390735409578645,
"repo_name": "CGATOxford/CGATPipelines",
"id": "7db383475c0c320b1f6d45c6d3df78378427a818",
"si... |
import os
import numpy
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('datasets', parent_package, top_path)
config.add_data_dir('data')
config.add_data_dir('descr')
config.add_data_dir('images')
config.add_data_d... | {
"content_hash": "cedc6bb8bd6c479ce4d035abb82e1172",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 28.608695652173914,
"alnum_prop": 0.6306990881458967,
"repo_name": "DailyActie/Surrogate-Model",
"id": "793cd2972e828445bd3837a691a1faef448d36e2",
"s... |
import json
import os
from argparse import ArgumentParser
from collections import Counter
from time import sleep, time
from uuid import uuid4
import requests
from capella.dedicated.CapellaAPI import CapellaAPI as CapellaAPIDedicated
from capella.serverless.CapellaAPI import CapellaAPI as CapellaAPIServerless
from fabr... | {
"content_hash": "31a18709a3bf189ca4c97a64f2dceee7",
"timestamp": "",
"source": "github",
"line_count": 1322,
"max_line_length": 100,
"avg_line_length": 39.80105900151286,
"alnum_prop": 0.5440637056464641,
"repo_name": "couchbase/perfrunner",
"id": "d24660071b897af8a1883f1c77614c413a60aed6",
"size"... |
"""Projects manager (empower class)."""
| {
"content_hash": "aec80fb9759d68e5015fd4a11aa72696",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 39,
"avg_line_length": 40,
"alnum_prop": 0.675,
"repo_name": "5g-empower/empower-runtime",
"id": "609791498a9a097db5573d1e450a37fb9ee501b9",
"size": "649",
"binary": false... |
"""
Tests for Block Device utility functions.
"""
from nova import block_device
from nova import exception
from nova import objects
from nova import test
from nova.tests.unit import fake_block_device
from nova.tests.unit import matchers
from nova.tests import uuidsentinel as uuids
class BlockDeviceTestCase(test.NoDB... | {
"content_hash": "8bdbcf5b3d668a56fc02c1f214035f65",
"timestamp": "",
"source": "github",
"line_count": 657,
"max_line_length": 79,
"avg_line_length": 43.3455098934551,
"alnum_prop": 0.541821757145867,
"repo_name": "jianghuaw/nova",
"id": "859c43280b4c77084d4c0e553c995bcd1cd0e903",
"size": "29108",... |
import synapseclient
import synapseclient.utils as utils
from synapseclient.exceptions import *
from synapseclient import Activity
from synapseclient import Project, Folder, File
from synapseclient import Evaluation, Submission, SubmissionStatus
from synapseclient import Wiki
from synapseclient import Column
from synap... | {
"content_hash": "a36ba3fb955b01e05c57a83f7154922b",
"timestamp": "",
"source": "github",
"line_count": 614,
"max_line_length": 158,
"avg_line_length": 40.4413680781759,
"alnum_prop": 0.6511215818936007,
"repo_name": "Sage-Bionetworks/U4CChallenge",
"id": "549c76c703cec834b9ff2f14d5f390ae44323ddd",
... |
class Demo:
@classmethod
def klassmeth(*args):
return args
@staticmethod
def statmeth(*args):
return args
print(Demo.klassmeth())
print(Demo.klassmeth('spam'))
print(Demo.statmeth())
print(Demo.statmeth('spam')) | {
"content_hash": "f3ad14d94ccc47052202fa3e8b0520c7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 29,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.6598360655737705,
"repo_name": "stoneflyop1/fluent_py",
"id": "626c9fcf8c8783a790ebe902cfcc921054f5fbc8",
"size":... |
import asyncio
try:
import selectors
except ImportError:
import asyncio.selectors as selectors
import tkinter
import sys
if sys.platform == 'win32':
raise ImportError('%s is not available on your platform'.format(__name__))
class _TkinterSelector(selectors._BaseSelectorImpl):
def __init__(self):
... | {
"content_hash": "70ab631606f51db4c97f554f807817bb",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 82,
"avg_line_length": 31.482758620689655,
"alnum_prop": 0.6024096385542169,
"repo_name": "montag451/aiotkinter",
"id": "e66b3028cff211ef1f7333d4611c0e6fc5c6c697",
"size": ... |
'''Precise framerate calculation, scheduling and framerate limiting.
Measuring time
==============
The `tick` and `get_fps` functions can be used in conjunction to fulfil most
games' basic requirements::
from pyglet import clock
while True:
dt = clock.tick()
# ... update and render ...
... | {
"content_hash": "0d18666d061ed63ec51b7f9eed244c26",
"timestamp": "",
"source": "github",
"line_count": 958,
"max_line_length": 80,
"avg_line_length": 34.233820459290186,
"alnum_prop": 0.5934565190876936,
"repo_name": "AustinRoy7/Pomodoro-timer",
"id": "e51db2bbcd674978d6487ed4a123094332fb072a",
"s... |
from base import *
import telnetlib
from nsenter import Namespace
class QuaggaTelnetDaemon(object):
TELNET_PASSWORD = "zebra"
TELNET_PORT = 2605
def __init__(self, ctn):
self.ns = Namespace(ctn.get_pid(), 'net')
def __enter__(self):
self.ns.__enter__()
self.tn = telnetlib.Tel... | {
"content_hash": "7fa1836f340f128788d9ae966fea87fd",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 89,
"avg_line_length": 37.77290836653386,
"alnum_prop": 0.4880286889568611,
"repo_name": "h-naoto/gobgp",
"id": "e76c7a8b18bd2c359e7bed9e5444032aa0eba31a",
"size": "10094"... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
from future.utils import with_metaclass
standard_library.install_aliases() # NOQA
from abc import ABCM... | {
"content_hash": "4e62b4f77d13c91f6e48be07406cdc47",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 96,
"avg_line_length": 32.580213903743314,
"alnum_prop": 0.6165777595404186,
"repo_name": "toslunar/chainerrl",
"id": "61f1d217f36f2579d00beacfa20e0ef6c9730e5d",
"size": "... |
from contextlib import contextmanager
import nlp_playground.path
from nlp_playground.data import resolve_data_filename
@contextmanager
def swap_base_path(new_path):
"""
Temporarily changes the base path for unit tests.
"""
nlp_playground.path.CUSTOM_PATH = new_path
yield
nlp_playground.path.C... | {
"content_hash": "e8ae9d67a6650bb9695ee513ace9bc25",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 26.5,
"alnum_prop": 0.6895368782161235,
"repo_name": "jamesmishra/nlp-playground",
"id": "1d11643ff3553bcabd90fa29cd33425e5eb4df8a",
"size": "583",
... |
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
import os
from os import path
import shutil
import codecs
import random
import plac
import re
import spacy.util
from spacy.en import English
from spacy.tagger import Tagger
from spacy.syntax.util import Co... | {
"content_hash": "a15453ad5cc1c465e7be35a89b4c5edc",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 91,
"avg_line_length": 36.35057471264368,
"alnum_prop": 0.5829249011857708,
"repo_name": "lukw00/spaCy",
"id": "9cd8cc011eaf47dcd7a95f5ab1836f5f48571cda",
"size": "6347",
... |
"""Tests for compute service."""
import base64
import contextlib
import datetime
import operator
import sys
import testtools
import time
import traceback
import uuid
import mock
import mox
from oslo.config import cfg
from oslo import messaging
import six
from testtools import matchers as testtools_matchers
import no... | {
"content_hash": "fdb52b1ace837971b959fa6c86183e7b",
"timestamp": "",
"source": "github",
"line_count": 10802,
"max_line_length": 79,
"avg_line_length": 44.46000740603592,
"alnum_prop": 0.5684081647950993,
"repo_name": "nkrinner/nova",
"id": "7f47f7d7888c7645d3038426722a3e48d570c8ae",
"size": "4810... |
import asyncio
import logging
import os
import ssl
import threading
import traceback
from urllib.parse import urlparse
from typing import Any, Dict, List, Optional, Tuple
# TODO(bashi): Remove import check suppressions once aioquic dependency is resolved.
from aioquic.buffer import Buffer # type: ignore
from aioquic.... | {
"content_hash": "fe6ac18887c212e63d3b31f1f5d4c9bd",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 135,
"avg_line_length": 40.59668508287293,
"alnum_prop": 0.6056976955180547,
"repo_name": "scheib/chromium",
"id": "1ff5ca8b6ca56f869878571f9f76492200af2f1c",
"size": "220... |
import datetime
from operator import attrgetter
from django.core.exceptions import FieldError
from django.db import models
from django.test import SimpleTestCase, TestCase, skipUnlessDBFeature
from django.test.utils import isolate_apps
from django.utils import translation
from .models import (
Article, ArticleIde... | {
"content_hash": "de125467dd81c4d98100fcc6dc0129c1",
"timestamp": "",
"source": "github",
"line_count": 484,
"max_line_length": 100,
"avg_line_length": 42.55165289256198,
"alnum_prop": 0.6214615197863559,
"repo_name": "atul-bhouraskar/django",
"id": "72d50cad6b2321efeca4ba9d6155a374fdf5622c",
"size... |
from se_benefactor.tests.tests_models import *
| {
"content_hash": "d9150a1df69c904fbb9dd1cd9a86d2ad",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 46,
"avg_line_length": 47,
"alnum_prop": 0.8085106382978723,
"repo_name": "francisl/django-search-engine-tools",
"id": "66c8f28fffbb393840a86962b3e176b848175e4d",
"size": "4... |
from pyvows import Vows, expect
# TEST DATA
STRINGS = {
'that_are_files': (
__file__,
unicode(__file__),
),
'that_are_not_files': (
__doc__,
)
}
# HELPERS
isafile = lambda topic: expect(topic).to_be_a_file()
isnotafile = lambda topic: expect(topic).not_to_be_a_file()
... | {
"content_hash": "cf072611ebff631b5ca9c2e4daf79113",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 65,
"avg_line_length": 30.22680412371134,
"alnum_prop": 0.5545702592087313,
"repo_name": "marcelometal/pyvows",
"id": "92499227637f89251cdf4f2cb23af9df6e208c5b",
"size": "3... |
import discord_logging
log = discord_logging.get_logger()
import counters
from praw_wrapper import ReturnType
import utils
def send_queued_notifications(reddit, database):
count_pending_notifications = database.get_count_pending_notifications()
counters.queue.set(count_pending_notifications)
notifications_sent ... | {
"content_hash": "c4061de36b3c529334b4e57d4e740d72",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 117,
"avg_line_length": 37.10144927536232,
"alnum_prop": 0.759375,
"repo_name": "Watchful1/RedditSubsBot",
"id": "e1d6daacc4f43844962ba83dafbe522be53191ce",
"size": "2560",... |
import numpy
import math
import pygame
import time
from PIL import Image
from pygame.color import THECOLORS
from copy import copy
from nupic.research.spatial_pooler import SpatialPooler
DEBUG = 0
class SPViewer(object):
'''
This class provides a PyGame window that visualizes the behavior of the
Numenta Spatial... | {
"content_hash": "34f20a27c201e81647430da60f017296",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 80,
"avg_line_length": 29.14351851851852,
"alnum_prop": 0.6062748212867355,
"repo_name": "iandanforth/spviewer",
"id": "feefb06d22d0a0f3f41fba1adc3ef731e3d75712",
"size": ... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("desecapi", "0025_alter_token_max_age_alter_token_max_unused_period"),
]
operations = [
migrations.RemoveField(
model_name="domain",
name="replicated",
),
mig... | {
"content_hash": "9986653246751b5423339df9f9b8f20a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 79,
"avg_line_length": 22.736842105263158,
"alnum_prop": 0.5671296296296297,
"repo_name": "desec-io/desec-stack",
"id": "0a1cc5c7f86fc73824f30fc01245fec368032db2",
"size": ... |
"""
Results handler for a multiprocessing setup of unittest.py
"""
import enum
import warnings
import operator
import queue
import threading
import time
import unittest
import unittest.case
import unittest.result
from nitpycker.excinfo import FrozenExcInfo
__author__ = "Benjamin Schubert, ben.c.schubert@gmail.com"... | {
"content_hash": "4fd6133cbde5daab7f76a8ef24cfb265",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 114,
"avg_line_length": 33.25079365079365,
"alnum_prop": 0.6125644452931067,
"repo_name": "BenjaminSchubert/NitPycker",
"id": "e9f572de577953c025532dc91d637c8e0f553d04",
"... |
from unittest import mock
from oslo_config import cfg
from requests import exceptions
import yaml
from heat.common import exception
from heat.common import identifier
from heat.common import template_format
from heat.common import urlfetch
from heat.engine import api
from heat.engine import node_data
from heat.engine... | {
"content_hash": "ade54a17bf6ce664580e71cff6f31f8d",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 78,
"avg_line_length": 34.069377990430624,
"alnum_prop": 0.6192683098097044,
"repo_name": "openstack/heat",
"id": "33a9ab9fd99f55120632eb40c99e615df60d16a8",
"size": "1481... |
import collections
import os
import re
import sys
import textwrap
import traceback
from datetime import datetime
from itertools import chain
from urlparse import urljoin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import ... | {
"content_hash": "1b96a94054e58bc004f4f1d08f450da6",
"timestamp": "",
"source": "github",
"line_count": 630,
"max_line_length": 79,
"avg_line_length": 39.96031746031746,
"alnum_prop": 0.5485203574975174,
"repo_name": "harikishen/addons-server",
"id": "f9ab9821069cc8ab0af8f2345a206f34fd7e96bc",
"siz... |
from nba import enums
from nba.utils import clean_locals
from nba.endpoints.baseendpoint import BaseEndpoint
class Homepage(BaseEndpoint):
def leaders(
self,
idx_data,
league_id=enums.LeagueID.Default,
stat_category=enums.StatCategory.Default,
season=enums.Season.Default,
... | {
"content_hash": "967bdca0c07be7b5a6576500f14d422c",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 103,
"avg_line_length": 47.670967741935485,
"alnum_prop": 0.5509541209906618,
"repo_name": "rozzac90/nba",
"id": "501800f1558b64dfc66189845b605ce456ed2688",
"size": "7389"... |
from __future__ import print_function, division, absolute_import
import os
import re
import phrasedml
try:
import tesedml as libsedml
except ImportError:
import libsedml
class phrasedmlImporter(object):
def __init__(self, sbml_map={}):
""" Constructor. """
self.sedml_str = None
s... | {
"content_hash": "31940bb7fcdf92061e253a6c3406a189",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 113,
"avg_line_length": 39.99130434782609,
"alnum_prop": 0.5412046096977604,
"repo_name": "kirichoi/tellurium",
"id": "9dff5327f613bf80f46794bbe70f30bd60897414",
"size": "... |
"""\
Minimum spanning tree by kruskal
jill-jenn vie et christoph durr - 2014-2018
"""
from math import sqrt
import random
# snip{ union-find
class UnionFind:
"""Maintains a partition of {0, ..., n-1}
"""
def __init__(self, n):
self.up_bound = list(range(n))
self.rank = [0] * n
def f... | {
"content_hash": "c4ab27c5cb17851b544581b4d28c8be7",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 75,
"avg_line_length": 29.883495145631066,
"alnum_prop": 0.5425601039636128,
"repo_name": "jilljenn/tryalgo",
"id": "61c5cc198d20671c0f4535499ea8846440ef6b32",
"size": "31... |
"""DAL's Select2 and django-tagging extension."""
| {
"content_hash": "e1c7acba71455ebfeb68a22b9e9b431c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 49,
"avg_line_length": 50,
"alnum_prop": 0.72,
"repo_name": "yourlabs/django-autocomplete-light",
"id": "528680999be3571117414a997b931bdc97d1bbab",
"size": "50",
"binary":... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from datacheck.core import (validate, Validator, Type, List,
Required, Optional, Dict)
__all__ = [
'validate',
'Validator',
'Type',
'List',
... | {
"content_hash": "3c189d19a68f8ffb8242226ba9b7f637",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 60,
"avg_line_length": 21.470588235294116,
"alnum_prop": 0.547945205479452,
"repo_name": "csdev/datacheck",
"id": "ff9a497107590b6ec2b32983a87544d5423effd7",
"size": "365",... |
"""
Created on July 2017
@author: JulienWuthrich
"""
import pandas as pd
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
from sklearn.metrics import mean_absolute_error, accuracy_score, r2_score
from sklearn.model_selection import train_test_split
from sklearn.ensemble import ExtraTreesClassi... | {
"content_hash": "728b44781a917250f255dbf3cd4490a1",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 149,
"avg_line_length": 34.88505747126437,
"alnum_prop": 0.742998352553542,
"repo_name": "Jwuthri/Mozinor",
"id": "618403ce157025beff23f5dc15817c9a743b2bc1",
"size": "3060"... |
import pbr.version
PROJECT_NAME = __package__
__version__ = pbr.version.VersionInfo(PROJECT_NAME).version_string()
__all__ = ['__version__', 'PROJECT_NAME']
| {
"content_hash": "d80a0d111cfdb97d1d9ad84de3de7fe1",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 68,
"avg_line_length": 26.5,
"alnum_prop": 0.6729559748427673,
"repo_name": "shad7/tvrenamer",
"id": "b511ea3800823c8a5c2f0b04180176e9397edc1b",
"size": "159",
"binary": f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.