text stringlengths 4 1.02M | meta dict |
|---|---|
"""
This is a secrete schema conversion func for zon metrics migration.
We have two types of metrics need to migrate which should follow our
new metric schema pattern.
"""
| {
"content_hash": "4a3cee790bc3fb732cd5b3aa3ee08530",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 24.857142857142858,
"alnum_prop": 0.7701149425287356,
"repo_name": "yunstanford/metrics-migration",
"id": "3387bde5b600e469694aa4f857d044a0b9ae3f22",
... |
from six import string_types
from pypif.obj.common.pio import Pio
class FileReference(Pio):
"""
Information about a file.
"""
def __init__(self, relative_path=None, mime_type=None, sha256=None, md5=None, tags=None, **kwargs):
"""
Constructor.
:param relative_path: String with... | {
"content_hash": "0c04442a6bdab772cd94a518c0f11a30",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 105,
"avg_line_length": 27.567901234567902,
"alnum_prop": 0.6112852664576802,
"repo_name": "kjaym/pypif",
"id": "29fdb0ed0c90f5dfbbb1e5dceea1593676c91c6c",
"size": "2233",
... |
"""
Volume interface (1.1 extension).
"""
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
import six
from cinderclient import base
class Volume(base.Resource):
"""A volume is an extra block level storage to the OpenStack instances."""
def __repr__(self):
... | {
"content_hash": "5eae3fdccf40784687715284ad568277",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 78,
"avg_line_length": 32.610619469026545,
"alnum_prop": 0.5536861148801447,
"repo_name": "tylertian/Openstack",
"id": "9c870cb30a1db778e017e5db56ab1725d1c41a9a",
"size": ... |
from . import PelicanPluginTestCase
class Gh(PelicanPluginTestCase):
def __init__(self, *args, **kwargs):
super().__init__(__file__, '', *args, **kwargs)
def test(self):
self.run_pelican({
'PLUGINS': ['m.htmlsanity', 'm.gh']
})
self.assertEqual(*self.actual_expecte... | {
"content_hash": "5ed1ec922c64ff903b87c6c2a778dc61",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 69,
"avg_line_length": 28.75,
"alnum_prop": 0.5739130434782609,
"repo_name": "mosra/m.css",
"id": "091ce3a36e34fe4f0b68d0cf69a62e7ae974f6b0",
"size": "1575",
"binary": fa... |
from __future__ import (division, print_function, absolute_import,
unicode_literals)
__all__ = ["MPIPool"]
# On some systems mpi4py is available but broken
# we avoid crashes by importing it only when
# an MPI Pool is explicitly created.
#Still make it a global to avoid messing up other things... | {
"content_hash": "0a95eaf82e3b8fee3008f75048296b36",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 78,
"avg_line_length": 35.008,
"alnum_prop": 0.5324497257769653,
"repo_name": "elizabethswann/RR_fitter",
"id": "021e13a7f72ee31c1711acb35a77aa22c3b1307f",
"size": "8799",... |
"""
head_tracker.py - Version 2.0 2013-08-23
Move the head to track an object pose published on the /target PoseStamped topic.
Works with either the dynamixel_motor and abotix package.
Created for the Pi Robot Project: http://www.pirobot.org
Copyright (c) 2013 Patrick Goebel. All rig... | {
"content_hash": "edbe95e55ee9730698485b1e8cf84ecd",
"timestamp": "",
"source": "github",
"line_count": 522,
"max_line_length": 124,
"avg_line_length": 43.35057471264368,
"alnum_prop": 0.5660435724070882,
"repo_name": "fujy/ROS-Project",
"id": "cb05e1aba30b28cab6f9b5c7326ede909dfeefa9",
"size": "22... |
from os.path import splitext
import numpy as np
import matplotlib.pylab as plt
import seaborn as sbn
# enumerate results files
result_files = np.loadtxt('result_filenames.np', dtype=str)
model_tech_time = {}
# plot and save results to png
for result_filename in result_files:
# save ave k-fold cpu time to diction... | {
"content_hash": "21ea0dbb47134fe90487b26603c33409",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 26.91304347826087,
"alnum_prop": 0.7075928917609047,
"repo_name": "jvpoulos/cs289-project",
"id": "79c1123cbdce8a23d1a36be7a18e14ecc415636b",
"size":... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['Lag1Trend'] , ['Seasonal_DayOfWeek'] , ['NoAR'] ); | {
"content_hash": "c15f84f7af843f2976daf8966b9ec1a7",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 84,
"avg_line_length": 39.25,
"alnum_prop": 0.7070063694267515,
"repo_name": "antoinecarme/pyaf",
"id": "f55d9f4a3089fe7c3b040c86d477de961d8a542e",
"size": "157",
"binary"... |
"""
Unified Volume driver for IBM XIV and DS8K Storage Systems.
"""
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from cinder import exception
from cinder.volume import driver
from cinder.volume.drivers.san import san
xiv_ds8k_opts = [
cfg.StrOpt(
'xiv... | {
"content_hash": "82152f002a59747c69a79d44a865aa75",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 79,
"avg_line_length": 35.93469387755102,
"alnum_prop": 0.6497046796910495,
"repo_name": "CloudServer/cinder",
"id": "93a24e206e46aa77cce034a121174092d233ceb8",
"size": "9... |
"""
Contains helper classes for conversion between different NF-FG representations.
"""
import json
import logging
import re
import sys
from escape.util.virtualizer_helper import _res_parser
try:
# Import for ESCAPEv2
from escape.nffg_lib.nffg import AbstractNFFG, NFFG, NodeSAP, NFFGToolBox, \
VERSION as N_VE... | {
"content_hash": "0da33b43d518466e3f8b92360c3fedf2",
"timestamp": "",
"source": "github",
"line_count": 2956,
"max_line_length": 81,
"avg_line_length": 43.68335588633288,
"alnum_prop": 0.5763351093488631,
"repo_name": "hsnlab/escape",
"id": "36ed2ce679e3e827719617b1dd27897dadb05963",
"size": "12974... |
from django.db import IntegrityError, transaction
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .fields import MyWrapper
from .models import Bar, Business, CustomAutoFieldModel, Employee, Foo
class BasicCustomPKTests(TestCase):
@classmethod
def setUpTestData(cls):
cls.da... | {
"content_hash": "26d3db21d56927166e17f08695631b2f",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 88,
"avg_line_length": 33.75454545454546,
"alnum_prop": 0.5861836789657958,
"repo_name": "manhhomienbienthuy/django",
"id": "47838714ca7a965e968300a7d74b9ac650dcbf65",
"si... |
from splinter import Browser
class UreportApplication:
def __init__(self):
self.browser = Browser()
def close(self):
self.browser.quit()
def navigate_to_home_page(self):
return HomePage(self.browser).load()
class HomePage():
def __init__(self, browser):
self.brows... | {
"content_hash": "07e9fe0b6b9ec54d033b007614eb4b64",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 21.925925925925927,
"alnum_prop": 0.6199324324324325,
"repo_name": "mbanje/ureport_uganda",
"id": "642ae785b424367e77b57edd92786aecb78055d6",
"size":... |
from pyjamas.ui.Sink import Sink, SinkInfo
from pyjamas.ui.MenuBar import MenuBar
from pyjamas.ui.MenuItem import MenuItem
from pyjamas import Window
from pyjamas.ui.HTML import HTML
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas import DOM
from pyjamas.ui.ContextMenuPopupPanel import ContextMenuPopupP... | {
"content_hash": "580e17a0eb5eb9128710877e5a4bb2a4",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 134,
"avg_line_length": 34.906666666666666,
"alnum_prop": 0.627196333078686,
"repo_name": "pombredanne/pyjs",
"id": "1d354575453140312373aaa815cd18a057572f81",
"size": "261... |
from toontown.estate.DistributedClosetAI import DistributedClosetAI
from toontown.toon.ToonDNA import ToonDNA, HAT, GLASSES, BACKPACK, SHOES
from direct.distributed.ClockDelta import globalClockDelta
import ClosetGlobals
class DistributedTrunkAI(DistributedClosetAI):
notify = directNotify.newCategory('Distributed... | {
"content_hash": "1058fc21d606869264d5b58057029965",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 191,
"avg_line_length": 47.71345029239766,
"alnum_prop": 0.6240960902071332,
"repo_name": "silly-wacky-3-town-toon/SOURCE-COD",
"id": "80e4beca5da83a4bb8872855e686ac9fb215a3... |
import re
import os
import six
from builtins import zip
from gevent import subprocess
def _pattern2re(pattern):
"""Transforms a GA pattern to a regular expression."""
i = 0
escaped = False
regex = ''
# Keep track of the index where the character class started, None if we're not
# currently parsing a cha... | {
"content_hash": "78e9e1d66c230bc7514dc0f51fa5e305",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 80,
"avg_line_length": 34.48412698412698,
"alnum_prop": 0.6271576524741082,
"repo_name": "luci/recipes-py",
"id": "298d05d84386fd456767ae76e454f275308a3eb5",
"size": "8864... |
from __future__ import absolute_import
from django.test import TestCase
from django.core.cache import cache
from django.core import mail
from model_mommy import mommy
from system.models import Configuration
from dbaas.tests.helpers import DatabaseHelper
class EmailBaseTest(TestCase):
action = 'update_ssl'
... | {
"content_hash": "c64fa7c2b68fb240113736f722cd2895",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 62,
"avg_line_length": 27.41860465116279,
"alnum_prop": 0.5869380831212893,
"repo_name": "globocom/database-as-a-service",
"id": "85ccb44c9336c71f6dba05380189864467d5243e",
... |
"""
Entry point for raw requests. Can be used to compute queries of API parts for which specific methods have not been yet implemented, and still benefit from the core methods.
for instance, client.raw()
"""
def raw(client, url, extra_params=None, verbose=False, multipage=None, page_limit=10, count_per_page=100):
... | {
"content_hash": "d9575757556c076c306b689fda278d2c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 172,
"avg_line_length": 47.083333333333336,
"alnum_prop": 0.7380530973451327,
"repo_name": "leonardbinet/navitia_client",
"id": "cf70face3c7a912f22254fb707ac7338c8f28bec",
... |
"""Support for the Philips Hue system."""
import ipaddress
import logging
from aiohue.util import normalize_bridge_id
import voluptuous as vol
from homeassistant import config_entries, core
from homeassistant.components import persistent_notification
from homeassistant.const import CONF_HOST
from homeassistant.helper... | {
"content_hash": "bf3c1bbabc4604d5e83c0d2112941e7b",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 171,
"avg_line_length": 33.05701754385965,
"alnum_prop": 0.6221308212816771,
"repo_name": "titilambert/home-assistant",
"id": "1131d68baeccc8d9e569d9e412e5f5f4bac3884b",
"... |
my_<caret>
from source import *
| {
"content_hash": "dc6b567f9c81a85b3fbc093adf8f1960",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 20,
"avg_line_length": 11,
"alnum_prop": 0.696969696969697,
"repo_name": "smmribeiro/intellij-community",
"id": "f077e8e6c4e027e1175bbf2e0df81d5893d9d417",
"size": "33",
"... |
import controller
# bool that specifies wheter it is a development environment
DEBUG = True
# list of controller modules
CONTROLLERS = [controller]
| {
"content_hash": "422795ffe4131f357e39b56388a6cbf2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 60,
"avg_line_length": 21.428571428571427,
"alnum_prop": 0.7933333333333333,
"repo_name": "ral99/weppy",
"id": "1931ce10aa7de26248d50ab62a6f36e9267e7771",
"size": "150",
"... |
""" Event views for editorial app.
editorial/views/eventviews.py
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from actstream import action
from braces.views import LoginRequiredMixin, FormMessagesMixin
from django.conf import settings
from django.shortcuts import redirect, ge... | {
"content_hash": "12804af2eed47ba7f44cff47aee41cfc",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 97,
"avg_line_length": 36.51327433628319,
"alnum_prop": 0.6572144126676361,
"repo_name": "ProjectFacet/facet",
"id": "6120a4f308a0759a91db29726469fe5be4d040dc",
"size": "1... |
"""Test the DuckDNS component."""
import asyncio
from datetime import timedelta
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import duckdns
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed
DOMAIN = 'bla'
TOKEN = 'abcdefgh'... | {
"content_hash": "f2c3caaa8358df6252b071fe8b002388",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 69,
"avg_line_length": 26.92452830188679,
"alnum_prop": 0.6320953048353188,
"repo_name": "stefan-jonasson/home-assistant",
"id": "d64ffbca81f0da2024edd1ddffb6230d32a858a6",
... |
from __future__ import print_function
import argparse, datetime, json, multiprocessing, os, platform, shutil, subprocess, sys, traceback, tempfile
# Find physical core count of the machine.
if platform.system() == 'Linux':
lines = subprocess.check_output(['lscpu', '--parse=core'])
physical_cores = len(set(line... | {
"content_hash": "1f869b3b2e7c1f964eb44e1b578ea74b",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 135,
"avg_line_length": 41.76654411764706,
"alnum_prop": 0.5844373046960961,
"repo_name": "sdalton1/legion",
"id": "548e72f852729c5b8e8405899c258764bdd9ae1c",
"size": "233... |
from django.contrib import admin
from shipping.models import Country
class CountryAdmin(admin.ModelAdmin):
list_display = ('__str__', 'full_name', 'code', 'code_a2', 'code_a3')
search_fields = ['name', 'full_name', 'code', 'code_a2', 'code_a3']
admin.site.register(Country) | {
"content_hash": "444c5be43efde268f49ea0f83ff6569a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.6795774647887324,
"repo_name": "juntatalor/qexx",
"id": "560c7dd910f7dcc2db3b0ad54c5fbaf78862fe51",
"size": "284",... |
import os
import platform
import sys
from distutils import sysconfig
from distutils.command import build
from distutils.command.build_ext import build_ext
from distutils.spawn import spawn
from setuptools import Extension, find_packages, setup
import versioneer
_version_module = None
try:
from packaging import ve... | {
"content_hash": "50f31465ccbe60cfbedcd909ab9a8ba4",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 80,
"avg_line_length": 38.832946635730856,
"alnum_prop": 0.525840951185995,
"repo_name": "cpcloud/numba",
"id": "298b3695f6b49575fd3d30a7fa88914ecc64bb8e",
"size": "16737"... |
"""
Module morphdemo -- Demonstrations
-------------------------------------------------------------------
morphdemo is a set of Demonstrations for pymorph package
-------------------------------------------------------------------
airport() -- Detecting runways in satellite airport imagery.
... | {
"content_hash": "3922bc5d95bfa2cec96714674f8d87a3",
"timestamp": "",
"source": "github",
"line_count": 3628,
"max_line_length": 104,
"avg_line_length": 30.318632855567806,
"alnum_prop": 0.41563329575620933,
"repo_name": "luispedro/pymorph",
"id": "c33028f4db3911ef30c892a5f05172a36cea711c",
"size":... |
"""
Created on Wed May 01 11:44:49 2013
@author: Martin Siggel <[email protected]>
"""
import sys, os, shutil, glob
filepath = os.path.dirname(os.path.realpath(__file__))
tixipath = filepath + '/../..'
sys.path.append(tixipath + '/bindings')
import bindings_generator.matlab_generator as MG
import bindings_genera... | {
"content_hash": "bc8c65ba9d65c9c4793be0e4d600ab12",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 93,
"avg_line_length": 28.414634146341463,
"alnum_prop": 0.6686695278969957,
"repo_name": "melven/tixi",
"id": "298b32ff16587b34a14d9b1c3630115825c9d810",
"size": "1190",
... |
import os
import socket
import sys
import ssl
from mock import Mock, patch
import requests_mock
from libcloud.test import unittest
from libcloud.common.base import Connection, CertificateConnection
from libcloud.http import LibcloudBaseConnection
from libcloud.http import LibcloudConnection
from libcloud.http import... | {
"content_hash": "01f0d746bd486e64a5657ad5c74d6f3d",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 77,
"avg_line_length": 37.08791208791209,
"alnum_prop": 0.5980740740740741,
"repo_name": "pquentin/libcloud",
"id": "147f5b4ad07bfac3c0ddb988d32cafcc2cf38548",
"size": "14... |
import codecs
import csv
from datetime import date
from django.db import models
from django.utils.http import urlquote
from election.models import ElectionManager
from electoral_district.controllers import electoral_district_import_from_xml_data
from exception.models import handle_exception
from import_export_ctcl.cont... | {
"content_hash": "32862beb3aad803c01a80ec014ffeb84",
"timestamp": "",
"source": "github",
"line_count": 5211,
"max_line_length": 123,
"avg_line_length": 56.09710228363078,
"alnum_prop": 0.5920936501529136,
"repo_name": "jainanisha90/WeVoteServer",
"id": "54765af5d9169cd310f3971f8d2dd581dea7514b",
"... |
import Network
from time import sleep
from threading import Thread
CALL_ROOMLIST = 0
CALL_WEAPLIST = 1
CALL_PLAYERLIST = 2
CALL_NEWPLAYER = 3
CALL_PLAYERLEFT = 4
CALL_CHAT = 5
CALL_PLAYERDAT = 6
CALL_ROOMSTAT = 7
CALL_LEAVEROOM = 8
CALL_SHOOT = 9
CALL_SCORE = 10
class GameClient(Network.Client):
CONNECTING = 0
... | {
"content_hash": "3b2960327859e8f5f4c3e70a8d20564c",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 140,
"avg_line_length": 31.458677685950413,
"alnum_prop": 0.6105346118481545,
"repo_name": "nemothekid/Colosseum--Year-3XXX",
"id": "8ded432cc003bf959695cc37486f79259b3c92b0... |
from corehq.apps.linked_domain.keywords import create_linked_keyword, update_keyword
from corehq.apps.app_manager.models import Module
from corehq.apps.linked_domain.tests.test_linked_apps import BaseLinkedAppsTest
from corehq.apps.reminders.models import METHOD_SMS
from corehq.apps.sms.models import Keyword, KeywordAc... | {
"content_hash": "f1f1cdb2e7193f4a26b730575d36d7ab",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 99,
"avg_line_length": 40.8448275862069,
"alnum_prop": 0.6699029126213593,
"repo_name": "dimagi/commcare-hq",
"id": "3ad1af7b15607a62235237d6e36ad6a84ec6a28f",
"size": "236... |
from blueice.test_helpers import *
from blueice.inference import *
from blueice.likelihood import UnbinnedLogLikelihood as LogLikelihood
def test_fit_minuit():
# Single rate parameter
lf = LogLikelihood(test_conf())
lf.add_rate_parameter('s0')
lf.set_data(lf.base_model.simulate())
fit_result, ll =... | {
"content_hash": "4fa55a4608f8515114cf36567656352b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 112,
"avg_line_length": 35.67768595041322,
"alnum_prop": 0.6492934908501274,
"repo_name": "JelleAalbers/blueice",
"id": "3859d8eb3bfc9d0a4c0a79c73e7a885ff62acdba",
"size":... |
import pdb
import math
import numpy as np
import time
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import cuda
from util import gaussian_kl_divergence_standard
from util import gaussian_logp
from util import gaussian_logp0
from util import bernoulli_logp
class VAE(chainer.Cha... | {
"content_hash": "15554a8d136f01b3213804d1114b3387",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 116,
"avg_line_length": 33.534351145038165,
"alnum_prop": 0.5788754837241066,
"repo_name": "ashwindcruz/dgm",
"id": "0432ccd00c24420aed177a8ff53def36ad36bca1",
"size": "43... |
from __future__ import absolute_import
from typing import Optional
from typing import List
from collections import OrderedDict
from oslo_config import cfg
import six
from mongoengine import ValidationError
from st2common import log as logging
from st2common.constants.action import (
LIVEACTION_STATUSES,
LIV... | {
"content_hash": "332503de584f0c9b0199c847d52d0cb7",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 98,
"avg_line_length": 29.72279792746114,
"alnum_prop": 0.6354920247537698,
"repo_name": "nzlosh/st2",
"id": "e6ae0fe4301977695aee78259a905f0691024aaa",
"size": "12101",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import imp
import os
import sys
import types
import gdb
import pwndbg
import pwndbg.commands
import pwndbg.events
import pwndbg.memoize
try:
from __builtins__ impo... | {
"content_hash": "3b65169b74d6674d6f34c945dbcc56ce",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 78,
"avg_line_length": 20.892857142857142,
"alnum_prop": 0.67008547008547,
"repo_name": "0xddaa/pwndbg",
"id": "9d397b7ffbf7c21d5f48549411d6102b3c6cb624",
"size": "1216",
... |
from __future__ import print_function
import os
import argparse
import sys
import threading
import shutil
import glob
import tempfile
import platform
# make sure scripts/internal is on the pythonpath.
sys.path = [os.path.abspath(os.path.dirname(sys.argv[0])) + "/internal"] + sys.path
# for ExitProgram and RunCommand... | {
"content_hash": "0af42049ca04f139dcedca8be8a454e7",
"timestamp": "",
"source": "github",
"line_count": 616,
"max_line_length": 143,
"avg_line_length": 48.19805194805195,
"alnum_prop": 0.5660828561805321,
"repo_name": "wantee/pocolm",
"id": "ac0fe0aee7eee6b3eda4a89d4cff7fa1210e211a",
"size": "29785... |
"""Copy number detection with CNVkit with specific support for targeted sequencing.
http://cnvkit.readthedocs.org
"""
import copy
import os
import sys
import tempfile
import pybedtools
import numpy as np
import toolz as tz
from bcbio import install, utils
from bcbio.bam import ref
from bcbio.distributed.multi import... | {
"content_hash": "29db8ce56fd1e7caaf91445840f97c6a",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 120,
"avg_line_length": 45.705673758865245,
"alnum_prop": 0.5970983008767166,
"repo_name": "guillermo-carrasco/bcbio-nextgen",
"id": "85eac7d490279cb0b16ff4887d91b1999a331f6... |
from django.template.loader import render_to_string
from courant.core.mailer.models import MessageJob
try:
from apps.email_subscriptions.models import EmailSubscription
except:
pass
from courant.core.profiles.models import UserProfile
from models import *
def send_email_update(subject, from_address, from_... | {
"content_hash": "e5236ed20744b1ce3d7d64b3a38e80c6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 104,
"avg_line_length": 42,
"alnum_prop": 0.6721611721611722,
"repo_name": "maxcutler/Courant-News",
"id": "371afa6ef42005d2511a13bd9efa18988662504f",
"size": "1092",
"bi... |
class Solution:
def searchMatrix(self, matrix: List[List[int]], target: int) -> bool:
if len(matrix) == 0 or len(matrix[0]) == 0:
return False
low = 0
high = len(matrix) * len(matrix[0])
while low < high:
mid = (low + high) // 2
row = mid // len(m... | {
"content_hash": "19f85c7689233b13b394ba8b9a3163ad",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 73,
"avg_line_length": 30.94736842105263,
"alnum_prop": 0.44387755102040816,
"repo_name": "jiadaizhao/LeetCode",
"id": "dfb75259be7a56650be8978e3c09140dedc04875",
"size": "... |
import black
import isort
def black_format_import_section(
contents: str, extension: str, config: isort.settings.Config
) -> str:
"""Formats the given import section using black."""
if extension.lower() not in ("pyi", "py"):
return contents
try:
return black.format_file_contents(
... | {
"content_hash": "a5b2c641689a61a4c2911f7ffacd6196",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 25.043478260869566,
"alnum_prop": 0.5729166666666666,
"repo_name": "PyCQA/isort",
"id": "f63b817e8ddb2a56ad2d8afa3324430d25dfcb36",
"size": "576",
... |
default_app_config='voxel_globe.order.visualsfm.apps.VisualSfmConfig' | {
"content_hash": "be8f61791de252d3433b95b64ea70048",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 69,
"avg_line_length": 69,
"alnum_prop": 0.855072463768116,
"repo_name": "andyneff/voxel-globe",
"id": "52fc114c3306425c5e1a971e224a6e4895100228",
"size": "69",
"binary": ... |
from flask import Flask, request, g, url_for
from flaskext.auth import Auth, AuthUser, logout, Permission, Role, \
permission_required
app = Flask(__name__)
auth = Auth(app, login_url_name='index')
user_create = Permission('user', 'create')
user_view = Permission('user', 'view')
roles = {
'admin': Role('... | {
"content_hash": "0da322d7f767571e5141fd4982b70da8",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 76,
"avg_line_length": 33.863157894736844,
"alnum_prop": 0.5999378302766553,
"repo_name": "thedekel/flask-auth",
"id": "6b0923db4e206ba7777a5baa103d3045f1e41d8d",
"size": "... |
"""Encryption module for crypto-cookie package
"""
__author__ = "@philipkershaw"
__date__ = "09/07/15"
__copyright__ = "(C) 2015 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "[email protected]"
__revision__ = '$Id$'
import os
from crypto... | {
"content_hash": "8495c362e92996dc42b0d5eeee9cacab",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 76,
"avg_line_length": 36.52,
"alnum_prop": 0.5819642205184374,
"repo_name": "philipkershaw/crypto-cookie",
"id": "0d3fab6f1a0ae3ba20fafae1e042f23954fbda10",
"size": "2739"... |
""" Neo4j GraphDB flask connector """
import socket
import neo4j
from neomodel import db, config
from flask_ext import BaseExtension, get_logger
from rapydo.utils.logs import re_obscure_pattern
log = get_logger(__name__)
class NeomodelClient():
def __init__(self, db):
self.db = db
def cypher(self,... | {
"content_hash": "ed63e535df05fa8a1d6e51422c11566f",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 76,
"avg_line_length": 27.045454545454547,
"alnum_prop": 0.5591036414565826,
"repo_name": "EUDAT-B2STAGE/http-api-base",
"id": "8b30d0dfd45dadcf5a3fd67d433191b86f458381",
"... |
from __future__ import unicode_literals
from django.apps import AppConfig
class UserpermConfig(AppConfig):
name = 'userperm'
| {
"content_hash": "9e88c6807d196f0613672b2e27c17f80",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 18.857142857142858,
"alnum_prop": 0.7575757575757576,
"repo_name": "wxmgcs/devops",
"id": "453667e9f8ee63fadfa1d8842f1d639adbc6be65",
"size": "132",
... |
import robocup
import constants
import play
import enum
import behavior
import main
import skills.move
import plays.testing.line_up
import time
# A simple binary clock in the form of a Soccer Play,
# using robots to display the current minute in binary
class BinaryClock(play.Play):
# Setting up global class vari... | {
"content_hash": "daaa737f37ab22b2fc10ccd5f12ab090",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 88,
"avg_line_length": 37.56666666666667,
"alnum_prop": 0.5371191955042887,
"repo_name": "JNeiger/robocup-software",
"id": "b39efad549457256be696f46fd05660f5ecd371e",
"size... |
'''Generates Go source files from a mojom.Module.'''
from itertools import chain
import os
import re
from mojom.generate.template_expander import UseJinja
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom.generate.pack as pack
class KindInfo(object):
def __init__(self... | {
"content_hash": "6f1514a484e887e85d3f603fbde8e73d",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 79,
"avg_line_length": 38.550898203592816,
"alnum_prop": 0.6777726001863933,
"repo_name": "sgraham/nope",
"id": "cb5a16e7f2a847be87d0cea2d6fd34dc6ccc54df",
"size": "13039"... |
from twisted.internet.protocol import Factory
from twisted.internet import reactor
from twisted.protocols import basic
from xcaplib.green import XCAPClient
from eventlet.twistedutil import deferToGreenThread
from eventlet.twistedutil import join_reactor
class LineOnlyReceiver(basic.LineOnlyReceiver):
def lineRe... | {
"content_hash": "03612d7d3084c60cb4e0504ab2e522f7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 85,
"avg_line_length": 33.774193548387096,
"alnum_prop": 0.6838586437440306,
"repo_name": "2013Commons/HUE-SHARK",
"id": "77073d7f926e6fbb98e2094da04d6688f98db1b3",
"size":... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Quantization'] , ['LinearTrend'] , ['Seasonal_Minute'] , ['ARX'] ); | {
"content_hash": "c2621daaee716ec790e8bee3431cbacf",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 90,
"avg_line_length": 40.75,
"alnum_prop": 0.7177914110429447,
"repo_name": "antoinecarme/pyaf",
"id": "388304d1df3f2e883082f9a2de3b32f0faffc8c2",
"size": "163",
"binary"... |
import paddle.trainer_config_helpers.networks as conf_nw
import inspect
from config_base import __convert_to_v2__
__all__ = []
def __initialize__():
for each_subnetwork in conf_nw.__all__:
if each_subnetwork in ['inputs', 'outputs']:
continue
func = getattr(conf_nw, each_subnetwork)
... | {
"content_hash": "3a6e9f97432f02dae6f055f51d38fac7",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 75,
"avg_line_length": 33.21875,
"alnum_prop": 0.587958607714017,
"repo_name": "cxysteven/Paddle",
"id": "9e6644196c8242cc3fed7a4fb1503697e5b59ffb",
"size": "1673",
"bina... |
import copy
from oslo_serialization import jsonutils
import six
import yaml
from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import sign... | {
"content_hash": "474c0bc94679e3ba7c6f57e96c4b97c8",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 79,
"avg_line_length": 44.36424957841484,
"alnum_prop": 0.5008742587805991,
"repo_name": "cwolferh/heat-scratch",
"id": "7821e6c50317266d25b85567f4bbed10d59a7b3c",
"size":... |
"""
=============================================================
Online Latent Dirichlet Allocation with variational inference
=============================================================
This implementation is modified from Matthew D. Hoffman's onlineldavb code
Link: http://www.cs.princeton.edu/~mdhoffma/code/onli... | {
"content_hash": "b703977eb1d3deaeb6aceaa63ba677f1",
"timestamp": "",
"source": "github",
"line_count": 709,
"max_line_length": 79,
"avg_line_length": 37.44005641748942,
"alnum_prop": 0.571294029007346,
"repo_name": "nmayorov/scikit-learn",
"id": "42bef1968fd9023b1d3a95533f418e9e27c4651a",
"size": ... |
"Memcached cache backend"
import pickle
import re
import time
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.functional import cached_property
class BaseMemcachedCache(BaseCache):
def __init__(self, server, params, library, value_not_found_exception):
super().__... | {
"content_hash": "1f8d0f56028e8682775b5353fcdc5764",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 108,
"avg_line_length": 39.885,
"alnum_prop": 0.629058543312022,
"repo_name": "simonw/django",
"id": "8202005045d359d3788fa86a443ff40d5e9b9f1f",
"size": "7977",
"binary"... |
"""
Sphinx plugins for Django documentation.
"""
import docutils.nodes
import docutils.transforms
import sphinx
import sphinx.addnodes
import sphinx.directives
import sphinx.environment
import sphinx.roles
from docutils import nodes
def setup(app):
app.add_crossref_type(
directivename="setting",
... | {
"content_hash": "ea3536fa78cce7113908ece2879db8d1",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 78,
"avg_line_length": 33.3125,
"alnum_prop": 0.6228893058161351,
"repo_name": "chrisspen/django-feeds",
"id": "b817a4f67793ccc95ef4d8c464c28f9eba8b4c96",
"size": "3731",
... |
import sys
import numpy
from numexpr import interpreter, expressions, use_vml, is_cpu_amd_intel
from numexpr.utils import CacheDict
# Declare a double type that does not exist in Python space
double = numpy.double
typecode_to_kind = {'b': 'bool', 'i': 'int', 'l': 'long', 'f': 'float',
'd': 'doubl... | {
"content_hash": "73e8c18578e7858ee2490da5ba561a2a",
"timestamp": "",
"source": "github",
"line_count": 690,
"max_line_length": 81,
"avg_line_length": 34.7463768115942,
"alnum_prop": 0.5675495307612096,
"repo_name": "jsalvatier/numexpr",
"id": "b077fcc9cdaa9b38c312b30f2445ac8cceda1820",
"size": "23... |
from conans import ConanFile, CMake
import os
channel = os.getenv("CONAN_CHANNEL", "testing")
username = os.getenv("CONAN_USERNAME", "memsharded")
class ZMQTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "libzmq/4.2.0@%s/%s" % (username, channel)
generators = "cmake"
... | {
"content_hash": "da9ff787215edb86272792a086f4ace0",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 82,
"avg_line_length": 31.93103448275862,
"alnum_prop": 0.5907127429805615,
"repo_name": "memsharded/conan-zmq",
"id": "7489e1ca1ab14ba3067ea6e8f3a9946266279dea",
"size": "... |
try:
import json
except ImportError:
import sys
sys.path.append('simplejson-2.3.3')
import simplejson as json
try:
import urllib2
from urllib2 import URLError, HTTPError
import httplib
import urlparse
import httplib2
from ConfigParser import ConfigParser
except ImportError:
... | {
"content_hash": "58f8b7bb01c7a59c5ddd240dc6949075",
"timestamp": "",
"source": "github",
"line_count": 705,
"max_line_length": 79,
"avg_line_length": 37.91205673758865,
"alnum_prop": 0.48443579766536965,
"repo_name": "aitatanit/metatlas",
"id": "0b9b3a7c1f32e2bb71c9802c5b1d4d22b87872a5",
"size": "... |
"""
Defines classes related to date ranges.
"""
import datetime
try:
import pytz
except ImportError:
pytz = None
from django.db import models
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy as pgettext
from django.core... | {
"content_hash": "57b826312998d9ad07256699345f9a6a",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 80,
"avg_line_length": 31.113960113960115,
"alnum_prop": 0.5925281567622013,
"repo_name": "lino-framework/lino",
"id": "26fbbbce868c4807144aa0e35a28e2b6f2c14106",
"size": ... |
from runner.koan import *
class AboutDeletingObjects(Koan):
def test_del_can_remove_slices(self):
lottery_nums = [4, 8, 15, 16, 23, 42]
del lottery_nums[1]
del lottery_nums[2:4]
self.assertEqual([4, 15, 42], lottery_nums)
def test_del_can_remove_entire_lists(self):
lot... | {
"content_hash": "39b903da9980c5e11677bb31d1b6b83d",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 74,
"avg_line_length": 27.537190082644628,
"alnum_prop": 0.5120048019207684,
"repo_name": "sourabhv/python-koans-solutions",
"id": "c92a39a5a8868c64af52ab9764e68e33b22cbfae"... |
from .compiler import COLLECT_CARTESIAN_PRODUCTS # noqa
from .compiler import FROM_LINTING # noqa
from .compiler import NO_LINTING # noqa
from .compiler import WARN_LINTING # noqa
from .expression import Alias # noqa
from .expression import alias # noqa
from .expression import all_ # noqa
from .expression import... | {
"content_hash": "8af593e0783591d457837e60336b3c20",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 63,
"avg_line_length": 35.082644628099175,
"alnum_prop": 0.7451118963486455,
"repo_name": "jam-py/jam-py",
"id": "488717041dadb38b06317d41d6893b4785deac75",
"size": "4481"... |
from twisted.internet import defer
import tests.unittest
import tests.utils
USER_ID = "@user:example.com"
class EventPushActionsStoreTestCase(tests.unittest.TestCase):
@defer.inlineCallbacks
def setUp(self):
hs = yield tests.utils.setup_test_homeserver()
self.store = hs.get_datastore()
... | {
"content_hash": "853c567e60c7e98755468c418082b163",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 29.076923076923077,
"alnum_prop": 0.6785714285714286,
"repo_name": "TribeMedia/synapse",
"id": "e9044afa2e195d94eb40919586e972202e0fca89",
"size": "1... |
from pg_requests.tokens import CommaValue
class Function(object):
"""Basic function implementation. Use this for aggregation functions"""
def __init__(self, name):
self.name = name
# NOTE: python 3 syntax only
# def __call__(self, *args, alias=None):
def __call__(self, *args, **kwargs):
... | {
"content_hash": "c8667153a9a76b665171499848df30af",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 76,
"avg_line_length": 29.477272727272727,
"alnum_prop": 0.5643793369313801,
"repo_name": "prawn-cake/pg_query",
"id": "cc1af7aa33a2a32bdab31f714a0a4681ac61a356",
"size": "... |
"""setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
# This module should be kept compatible with Python 2.3
import os, re, sys
from setuptools import Command
from distutils.errors import *
from distutils import log
from setuptools.command.sdist import sdist
from setuptools.compa... | {
"content_hash": "6ce1d5158bb66869f55ec4a64dc6effb",
"timestamp": "",
"source": "github",
"line_count": 458,
"max_line_length": 80,
"avg_line_length": 31.366812227074234,
"alnum_prop": 0.5821383822915216,
"repo_name": "bobeirasa/virtualenvs",
"id": "a0ba530590b5020bef9489c396a59f4d7d0754f7",
"size"... |
"""
Axislines includes modified implementation of the Axes class. The
biggest difference is that the artists responsible to draw axis line,
ticks, ticklabel and axis labels are separated out from the mpl's Axis
class, which are much more than artists in the original
mpl. Originally, this change was motivated to support... | {
"content_hash": "a36e08ba6486f67d0841374acd5e499b",
"timestamp": "",
"source": "github",
"line_count": 895,
"max_line_length": 92,
"avg_line_length": 29.214525139664804,
"alnum_prop": 0.5340956897540827,
"repo_name": "andyraib/data-storage",
"id": "5b9ff70cd1bff27d47e241886c8c0e5063b9a7c1",
"size"... |
import sys
import socket
import serial
import serial.threaded
import time
import datetime
class SerialToNet(serial.threaded.Protocol):
"""serial->socket"""
def __init__(self):
self.socket = None
def __call__(self):
return self
# callback function
# this is called by the ReaderTh... | {
"content_hash": "d05de8f0fe8ba1db3bb7050ccfda5d18",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 112,
"avg_line_length": 33.982142857142854,
"alnum_prop": 0.5478192327903311,
"repo_name": "BITPlan/can4eve",
"id": "5e18f067a71f2d0ff9f93ca48617f7a8be5f9811",
"size": "78... |
import time
import traceback
import commands
import threading
import json
import pdb
from datetime import datetime
from collections import defaultdict
# Assumes that there are no empty dependencies
# in the graph. E.g. Foo -> []
def dfs(graph, visit):
nodes = graph.keys()
edge_nodes = set()
for n in nodes:
edge... | {
"content_hash": "4c0f569c0900935afbbd5f4caea756b2",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 70,
"avg_line_length": 20.24742268041237,
"alnum_prop": 0.6430753564154786,
"repo_name": "xmaruto/mcord",
"id": "c0ec779912d5a21476afcc4e322cf1449a0432f9",
"size": "1987",
... |
import webapp2
import datetime
import os
from google.appengine.ext.webapp import template
import alarm
import gae_util
class IndexPage(webapp2.RequestHandler):
def get(self):
utcnow = datetime.datetime.utcnow()
jstTime = gae_util.Utility.convert_jst_time(utcnow)
... | {
"content_hash": "8e1495aa86557a3577def78ce9cba1e9",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 107,
"avg_line_length": 39.47530864197531,
"alnum_prop": 0.3605942142298671,
"repo_name": "thinkAmi/9784798123028_GAE",
"id": "13ff9878364fb092d95bf5c7b9269318ae8c78ad",
"... |
import os
import sys
import shutil
import os.path as osp
import json
import time
import datetime
import tempfile
LOG_OUTPUT_FORMATS = ['stdout', 'log', 'json']
DEBUG = 10
INFO = 20
WARN = 30
ERROR = 40
DISABLED = 50
class OutputFormat(object):
def writekvs(self, kvs):
"""
Write key-value pairs
... | {
"content_hash": "355cea1de7f728ca8009a9c5a9bbb857",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 122,
"avg_line_length": 27.996815286624205,
"alnum_prop": 0.5573882379706518,
"repo_name": "pcchenxi/baseline",
"id": "981c4b2a0625534e76b90efaae5c836988f2dea1",
"size": "... |
"""autoresizelist.py - list wrapper that automatically expands the list when
indices outside its current range are accessed """
__author__ = 'caleb'
__date__ = "2015-02-17"
class AutoResizeList:
def __init__(self, initial_data=None, fill=None):
if initial_data is None:
self._data = []
... | {
"content_hash": "da69f7039fc21c6e33d5a15731053869",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 82,
"avg_line_length": 27.574468085106382,
"alnum_prop": 0.5632716049382716,
"repo_name": "calebmadrigal/algorithms-in-python",
"id": "3697957b39844926357a064af8d6f8d4a81fd06... |
"""Script for migrating the contents of celery_taskmeta into etl_task."""
import traceback
from sqlalchemy import create_engine
from sqlalchemy.exc import IntegrityError, ProgrammingError
from plenario.settings import DATABASE_CONN
engine = create_engine(DATABASE_CONN)
def main():
rp = engine.execute("""
... | {
"content_hash": "650bbfdb2f58163ed188808271d0c6a8",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 95,
"avg_line_length": 27.264705882352942,
"alnum_prop": 0.5868392664509169,
"repo_name": "UrbanCCD-UChicago/plenario",
"id": "b1f0809fef4d5d144a1dbe8c435368a2dc141ef7",
"s... |
from flask import Blueprint
profile = Blueprint('profile', __name__)
from . import views
| {
"content_hash": "d12e4f5b071c29b18896c3edc888b867",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 18.2,
"alnum_prop": 0.7252747252747253,
"repo_name": "ludolatin/ludolatin",
"id": "a66f70a35397aae40607fb70a35a140c5d5c0d5a",
"size": "91",
"binary"... |
import logging
import numpy as np
from packaging import version
import ray.ray_constants as ray_constants
class RayParams:
"""A class used to store the parameters used by Ray.
Attributes:
redis_address (str): The address of the Redis server to connect to. If
this address is not provided... | {
"content_hash": "ee8dbe5a8eecf85846993a2c50ef058e",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 79,
"avg_line_length": 46.93087557603687,
"alnum_prop": 0.605164964650432,
"repo_name": "stephanie-wang/ray",
"id": "f4750e71dc2b3904bebc8f368af735040aaa54c8",
"size": "10... |
"""Support for SCSGate covers."""
import logging
from scsgate.tasks import (
HaltRollerShutterTask,
LowerRollerShutterTask,
RaiseRollerShutterTask,
)
import voluptuous as vol
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverEntity
from homeassistant.const import CONF_DEVICES, CONF_NAME
imp... | {
"content_hash": "196084079b674deab96db872d8c8da73",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 85,
"avg_line_length": 28.27659574468085,
"alnum_prop": 0.627915726109857,
"repo_name": "mKeRix/home-assistant",
"id": "0c7d057316cad64c5d7af889752d004e7b8393f5",
"size": "... |
"""
Definitions for GraphStore abstract base class and type descriptors for labels and vertex/edge IDs.
"""
from typing import NewType, Hashable, Any, Optional, Iterator, NamedTuple, Union
__all__ = [
'GraphStore',
'VertexID',
'EdgeID',
'DirectedEdgeID',
'UndirectedEdgeID',
'Label',
]
Vert... | {
"content_hash": "dc4539a3c5959a6c13d4bf9258d825ad",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 120,
"avg_line_length": 38.08794788273616,
"alnum_prop": 0.643376379030189,
"repo_name": "hosford42/vert",
"id": "c14c701bad3bb09619442b579caf67e239730ea1",
"size": "11799... |
"""Main entry point for distributed next-gen sequencing pipelines.
Handles running the full pipeline based on instructions
"""
import abc
from collections import defaultdict
import copy
import os
import sys
import resource
import tempfile
import yaml
from bcbio import log, heterogeneity, structural, utils
from bcbio... | {
"content_hash": "020c81b01a50c5b38e6275cc09e97e62",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 121,
"avg_line_length": 50.75,
"alnum_prop": 0.6011171710063336,
"repo_name": "fw1121/bcbio-nextgen",
"id": "d17084d2c71ce30414bfd433371e1c5f322e97a6",
"size": "22736",
... |
"""Tests for pix2pix."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from nets import pix2pix
class GeneratorTest(tf.test.TestCase):
def _reduced_default_blocks(self):
"""Returns the default blocks, scaled down to make t... | {
"content_hash": "f2eb7abb1e4e28a303801f5d76e7dbab",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 75,
"avg_line_length": 37.190140845070424,
"alnum_prop": 0.6502556334027646,
"repo_name": "cshallue/models",
"id": "ab5acb5c1979d7b9ab21d5a164055e8ebfc3232b",
"size": "596... |
"""
Forms and validation code for user registration.
Note that all of these forms assume Django's bundle default ``User``
model; since it's not possible for a form to anticipate in advance the
needs of custom user models, you will need to write your own forms if
you're using a custom model.
"""
try:
from djang... | {
"content_hash": "c68290325c168bd5ef66100cb4020438",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 141,
"avg_line_length": 36.13178294573643,
"alnum_prop": 0.6337695773439176,
"repo_name": "gone/django-registration",
"id": "72850268764bc1ea365a2e325f052c744ea5397b",
"si... |
""" Finetuning the library models for sequence classification on GLUE."""
# You can also adapt this script on your own text classification task. Pointers for this are left as comments.
import json
import logging
import os
import sys
from dataclasses import dataclass, field
from typing import Optional
import numpy as ... | {
"content_hash": "300a112b2bd6f1ccb0f3aecdf9be97ba",
"timestamp": "",
"source": "github",
"line_count": 571,
"max_line_length": 131,
"avg_line_length": 42.8353765323993,
"alnum_prop": 0.6108589885113864,
"repo_name": "huggingface/transformers",
"id": "1a373ef364cda41e196ff63cc29d67249b807e0b",
"siz... |
import os
import sys
import time
import fuse
import errno
import logging
import argparse
from relfs.sftp_utils import SFTPFileReader
# ------------------------------------------------------------------------------
class RoSFuseItem(object):
# -------------------------------------------------------------------------... | {
"content_hash": "517f6b8b2d26cbc53fbb223e996be756",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 80,
"avg_line_length": 35.06645569620253,
"alnum_prop": 0.34238787113076435,
"repo_name": "matus-chochlik/various",
"id": "71856fb55d1e6c329f661aec1754d5ffe2dbc70e",
"size... |
import asyncio
import random
import threading
from time import sleep
import warnings
import dask
from dask import delayed
import pytest
from distributed import (
worker_client,
Client,
as_completed,
get_worker,
wait,
get_client,
)
from distributed.metrics import time
from distributed.utils_tes... | {
"content_hash": "a58b276707d72608851e30658cddb614",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 83,
"avg_line_length": 25.92429022082019,
"alnum_prop": 0.5715502555366269,
"repo_name": "blaze/distributed",
"id": "09ae20e8f203153d5ac89210ca8857288813dce3",
"size": "82... |
from Orange.widgets import widget, gui
from Orange.widgets.settings import Setting
class OWWidgetName(widget.OWWidget):
name = "Widget Name"
id = "orange.widgets.widget_category.widget_name"
description = ""
icon = "icons/Unknown.svg"
priority = 10
category = ""
keywords = ["list", "of", "k... | {
"content_hash": "7b58af77717a435c2a9b5d9776618f52",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 53,
"avg_line_length": 23.307692307692307,
"alnum_prop": 0.6006600660066007,
"repo_name": "qPCR4vir/orange3",
"id": "d035825951f00920018ba074ad6c46fc39a7ec03",
"size": "606... |
from .copy_source import CopySource
class SapCloudForCustomerSource(CopySource):
"""A copy activity source for SAP Cloud for Customer source.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
:param... | {
"content_hash": "e8249646c9da923dddb5ff036f2075b5",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 176,
"avg_line_length": 43.12820512820513,
"alnum_prop": 0.6504161712247325,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "771684a97c5669b5f57dcedaa1b231168ba6c0f6",
... |
"""
Fab commands for ffs
"""
from fabric.api import task, hosts, local, lcd, cd, run
from fabric import operations
deadpan = '[email protected]'
@task
def test():
"""
Run our unittests
"""
local('python -m pytest test')
@task
def make_docs():
"""
Rebuild the documentation
""... | {
"content_hash": "96d1291f461f75889482e0386248377e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 98,
"avg_line_length": 22.13888888888889,
"alnum_prop": 0.6273525721455459,
"repo_name": "davidmiller/letter",
"id": "d4bfb0c2c2be2c35bc930fc2113c6753263323a2",
"size": "79... |
from model import *
from gym_torcs import TorcsEnv
from ReplayBuffer import ReplayBuffer
from utils import *
from collections import deque
import tensorflow as tf
def discrete_reinforce():
# initialization
tf.python.control_flow_ops = tf
env = TorcsEnv(vision = True,throttle = False,gear_change = False)
buff = Repl... | {
"content_hash": "3b6283f39479440b45869ace6f126a18",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 101,
"avg_line_length": 31.048076923076923,
"alnum_prop": 0.6847321152059461,
"repo_name": "travistang/late_fyt",
"id": "f3c80228673eded1f65527315dfcf5348d0c613d",
"size":... |
"""
This script is used to generate all the possible reactions involving a given
set of reactants, including pressure-dependent effects if desired. This is
effectively the first step in the RMG rate-based mechanism generation algorithm.
The input file is a subset of that used with regular RMG jobs.
"""
import os.pat... | {
"content_hash": "58496598685486556dda476d762bf24e",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 99,
"avg_line_length": 36.739837398373986,
"alnum_prop": 0.6999336136313343,
"repo_name": "nickvandewiele/RMG-Py",
"id": "e9b703eb2fe6e38494e39bf03ae731be962e401d",
"size"... |
from sympy import Symbol, Dummy, sympify, latex, diff, sqrt as sym_sqrt
from sympy.utilities.lambdify import lambdify
import numpy as np
from importlib import import_module
from errorpro.units import parse_unit, convert_to_unit
from errorpro.dimensions.simplifiers import dim_simplify
from errorpro.dimensions.solvers... | {
"content_hash": "787974023370cc6981baaaef208b32ae",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 94,
"avg_line_length": 31.373873873873872,
"alnum_prop": 0.6113424264178033,
"repo_name": "benti/Error-Pypagation",
"id": "e3c3dcf8d3fe7d22c4b18ac2261f537021f8c311",
"size... |
from __future__ import division
import av
from .common import MethodLogger, TestCase, fate_suite
from .test_encode import assert_rgb_rotate, write_rgb_rotate
try:
from cStringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
class NonSeekableBuffer:
def __init__(self, data):
... | {
"content_hash": "838fe20e94570c350508cfb058b8e23e",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 93,
"avg_line_length": 28.836734693877553,
"alnum_prop": 0.6047416843595188,
"repo_name": "mikeboers/PyAV",
"id": "f622bdb65f56ebbdfba3c4e96f4c4af73aa05c2e",
"size": "2826"... |
"""Switch platform for Sensibo integration."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Any
from pysensibo.model import SensiboDevice
from homeassistant.components.switch import (
SwitchDeviceClass,
SwitchEntity,
... | {
"content_hash": "b948b87705e16d40d5c321dd51fbb50c",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 99,
"avg_line_length": 35.989583333333336,
"alnum_prop": 0.6542691751085383,
"repo_name": "w1ll1am23/home-assistant",
"id": "f57d72e5fb356f5e692d364af21306da6aaf2b28",
"si... |
""" A secret, a symmetric cryptographic key. """
from abc import ABCMeta, abstractmethod
class Secret(metaclass=ABCMeta):
""" A secret, a symmetric cryptographic key. """
@property
@abstractmethod
def algorithm(self): # -> str
""" Return the name of the algorithm, for example, "aes". """
| {
"content_hash": "ecff503a7e99b89d105ef04f605fb630",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 69,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.65,
"repo_name": "jddixon/xlattice_py",
"id": "e22502102b3ca525b689dbdc4e990569f3aaa325",
"size": "354",
"binar... |
"""
ASGI entrypoint file for default channel layer.
Points to the channel layer configured as "default" so you can point
ASGI applications at "multichat.asgi:channel_layer" as their channel layer.
"""
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "multichat.sett... | {
"content_hash": "9637fe0c4fcca9ab2ba28576080b6c0e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 75,
"avg_line_length": 33,
"alnum_prop": 0.7851239669421488,
"repo_name": "sarthak-srivastava/chat",
"id": "5732f3090d2761471016b52e13aa07880da12949",
"size": "363",
"bin... |
from rally.common import log as logging
from rally import consts
from rally.plugins.openstack.scenarios.sahara import utils
from rally.task.scenarios import base
from rally.task import validation
LOG = logging.getLogger(__name__)
class SaharaJob(utils.SaharaScenario):
"""Benchmark scenarios for Sahara jobs."""
... | {
"content_hash": "d55b18b0e9a58af5918733053b13bd2e",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 78,
"avg_line_length": 41.36363636363637,
"alnum_prop": 0.5703296703296703,
"repo_name": "shdowofdeath/rally",
"id": "1840688555c9aef1034369849bd94f835d21c2e9",
"size": "5... |
import yaml
import json
import datetime
from twisted.trial import unittest
from twisted.internet import defer, reactor
from rhumba import service, client
from rhumba.backends import zk
from .plugin import sleep
test_config = {
'noexpire': True,
'backend': 'rhumba.backends.zk',
'queues': [{
'id... | {
"content_hash": "fb5a19dd11281e089c3ca2ae0cd2bcf4",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 94,
"avg_line_length": 28.288888888888888,
"alnum_prop": 0.6394344069128044,
"repo_name": "calston/rhumba",
"id": "34afffe59fd149fe54aad1c774df005b2ec0bac0",
"size": "3819... |
from flask import Flask
app = Flask(__name__)
app.config.from_object(__name__)
| {
"content_hash": "39a63200f3a9588cb741d8ac51b2c88c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 20,
"alnum_prop": 0.6875,
"repo_name": "wallarelvo/SmallCartography",
"id": "3893c01fd3fda6bb83b28b06d50f248aa7add8b0",
"size": "81",
"binary": fals... |
import operator
if not hasattr(operator, "div"):
operator.div = operator.truediv
opnames = {
operator.add : "+",
operator.sub : "-",
operator.mul : "*",
operator.div : "/",
operator.floordiv : "//",
operator.mod : "%",
operator.pow : "**",
operator.xor : "^",
operator.lshift :... | {
"content_hash": "c98f61f52f38cf481b5a8b45146833d6",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 83,
"avg_line_length": 31.828025477707005,
"alnum_prop": 0.5717430458274965,
"repo_name": "gkonstantyno/construct",
"id": "b62efb964b063608675b6dafa3df0b47ae305d5b",
"size... |
from __future__ import absolute_import, unicode_literals
import environ
env = environ.Env(DEBUG=(bool, False),) # set default values and casting
ROOT_DIR = environ.Path(__file__) - 3 # (/a/b/myfile.py - 3 = /)
APPS_DIR = ROOT_DIR.path('housing_reviews')
DEBUG = env('DEBUG')
TEMPLATE_DEBUG = DEBUG
# Raises Impro... | {
"content_hash": "20b355476b07c70ff8e33639468fbea1",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 79,
"avg_line_length": 28.692737430167597,
"alnum_prop": 0.7202102803738317,
"repo_name": "borfast/housing-reviews",
"id": "78796b1d9456a6c84212579b49df3bf2f813ab87",
"siz... |
"""
Remove caveats to permissions
Revision ID: 84262e097c26
Revises: f345394c444f
Create Date: 2022-04-05 18:35:57.325801
"""
from alembic import op
revision = "84262e097c26"
down_revision = "f345394c444f"
def upgrade():
op.alter_column("macaroons", "caveats", new_column_name="permissions_caveat")
def downgr... | {
"content_hash": "00ad00790e9da70d232718365b223738",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 81,
"avg_line_length": 20.45,
"alnum_prop": 0.7334963325183375,
"repo_name": "pypa/warehouse",
"id": "9bee3f5df6fae8474a99c1948a8b996a9ad8b4a1",
"size": "949",
"binary": ... |
import unittest
import sys
# automake build dir
sys.path.insert(0, '..')
sys.path.insert(0, '../.libs')
# cmake build dir
sys.path.insert(0, '../../../build/bindings/python')
from pywsman import *
class TestSequenceFunctions(unittest.TestCase):
def test_enum_release(self):
# set_debug(1) # enable to print loggi... | {
"content_hash": "7ae1ba92d95f51485c514a54d347afea",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 89,
"avg_line_length": 32.68421052631579,
"alnum_prop": 0.6940418679549114,
"repo_name": "steakknife/openwsman",
"id": "fee16051de987f44ad9b35654d38633d75fc6ece",
"size": "... |
"""
WSGI config for sciweather 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "fdb42d9a626ee614224129785003c9ed",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.875,
"alnum_prop": 0.7738693467336684,
"repo_name": "wasit7/tutorials",
"id": "91a24a5fe21cd3f3ae7dc70f8c35943cd64c1a52",
"size": "398",
"binary... |
from vispy import scene, io
from vispy.testing import (requires_application, TestingCanvas,
run_tests_if_main)
from vispy.testing.image_tester import assert_image_approved
@requires_application()
def test_perspective_render():
with TestingCanvas(size=(300, 200)) as canvas:
grid... | {
"content_hash": "6d0f9e6649107b03325fc99f95631871",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 39.11538461538461,
"alnum_prop": 0.5147492625368731,
"repo_name": "hronoses/vispy",
"id": "6fb47980507d6305fced2bf5f6201175995379ef",
"size": "2359",... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ctdata', '0031_dataacademyabstractevent'),
]
operations = [
migrations.CreateModel(
name='DataAcademyLi... | {
"content_hash": "5220e6f53d697ea5b1acf740d33371c4",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 226,
"avg_line_length": 35.64705882352941,
"alnum_prop": 0.608085808580858,
"repo_name": "CT-Data-Collaborative/ctdata-wagtail-cms",
"id": "9288e601b6565a740051563770b9b39b36... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.