text stringlengths 4 1.02M | meta dict |
|---|---|
"""Access tool command lines, handling back compatibility and file type issues.
Abstracts out
"""
import subprocess
from bcbio.pipeline import config_utils
def get_tabix_cmd(config):
"""Retrieve tabix command, handling new bcftools tabix and older tabix.
"""
try:
bcftools = config_utils.get_progra... | {
"content_hash": "a8db6384247fc035856d9455159537f9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 95,
"avg_line_length": 38.34146341463415,
"alnum_prop": 0.6412213740458015,
"repo_name": "verdurin/bcbio-nextgen",
"id": "2214b7ff65496e607926dc38f8b5c5b618b6d215",
"size":... |
import hexchat
import re
import sys
import twitch.hook, twitch.jtvmsghandler, twitch.user, twitch.channel
import twitch.normalize, twitch.commands, twitch.exceptions, twitch.topic
import twitch.logger, twitch.settings
from twitch import irc
log = twitch.logger.get()
# regex for extracting time from ban message
ban_msg... | {
"content_hash": "1b697417ee83feb037df6bfad13c0a4a",
"timestamp": "",
"source": "github",
"line_count": 380,
"max_line_length": 76,
"avg_line_length": 30.652631578947368,
"alnum_prop": 0.6689560439560439,
"repo_name": "RenaKunisaki/hexchat-twitch",
"id": "6b4b77ba6fa6cda5c4846aa32f41ef86645fbd4e",
... |
from __future__ import print_function, division
from collections import defaultdict
from sympy.core.core import C
from sympy.core.compatibility import reduce
from sympy.core.singleton import S
from sympy.core.operations import AssocOp
from sympy.core.cache import cacheit
from sympy.core.numbers import ilcm, igcd
from... | {
"content_hash": "9560970f20ebaf709455707f57ff1679",
"timestamp": "",
"source": "github",
"line_count": 882,
"max_line_length": 79,
"avg_line_length": 33.116780045351476,
"alnum_prop": 0.490910335855387,
"repo_name": "lidavidm/sympy",
"id": "b27309fb4ea52af2a9e9b592fde9632fce7422e5",
"size": "29209... |
"""
Hidden Markov Models (HMMs) largely used to assign the correct label sequence
to sequential data or assess the probability of a given label and data
sequence. These models are finite state machines characterised by a number of
states, transitions between these states, and output symbols emitted while in
each state.... | {
"content_hash": "23359228af9bbfa52b6d62103e6ca3fd",
"timestamp": "",
"source": "github",
"line_count": 1317,
"max_line_length": 101,
"avg_line_length": 36.84662110858011,
"alnum_prop": 0.5891359449378697,
"repo_name": "nltk/nltk",
"id": "060337f9bc8a7d59ae6e61a28ad363008967a41f",
"size": "49020",
... |
from .numberedcanvas import NumberedCanvas
from .autocompletecid import AutoCompleteCid
from .autocompleteexam import AutoCompleteExam
from .autocompletepatient import AutoCompletePatient
from .autocompleterecommendation import AutoCompleteRecommendation
from .openprescriptionview import OpenPrescriptionView
from .auto... | {
"content_hash": "45df92d2c1344d6d32dc4cdac7a0b324",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 52,
"alnum_prop": 0.9001831501831502,
"repo_name": "fga-gpp-mds/2017.2-Receituario-Medico",
"id": "9ec979efc4a7b8af04afd76092028bd3fef9492b",
"size":... |
import sys
import unittest
from mock import Mock
from sure import expect
from social.utils import sanitize_redirect, user_is_authenticated, \
user_is_active, slugify, build_absolute_uri, \
partial_pipeline_data
PY3 = sys.version_info[0] == 3
class SanitizeRedirect... | {
"content_hash": "a29f6e9b5fc5fb9494115f2e53524c6c",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 76,
"avg_line_length": 33.308724832214764,
"alnum_prop": 0.6018537175095708,
"repo_name": "tutumcloud/python-social-auth",
"id": "bb591395605e31730442954300de0c4217268903",
... |
"""
Helpers and utils functions
:copyright: (c) 2013 by Andrew Mleczko and Tomasz Jezierski (Tefnet)
:license: BSD, see LICENSE for more details.
"""
import collections
from eve.utils import config
def dict_update(d, u):
for k, v in u.items():
if isinstance(v, collections.Mapping):
... | {
"content_hash": "db8bb168bfcdfa87788ed8f11c846f05",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 72,
"avg_line_length": 25.419354838709676,
"alnum_prop": 0.567258883248731,
"repo_name": "nicolaiarocci/eve-sqlalchemy",
"id": "c46c76266adc8d6a48eee9eecdd9c37832757a57",
"... |
from __future__ import absolute_import, division, print_function, unicode_literals
from c7n.manager import resources
from c7n.query import QueryResourceManager
@resources.register('directory')
class Directory(QueryResourceManager):
class resource_type(object):
service = "ds"
enum_spec = ("descri... | {
"content_hash": "530c3e698e733f211b96e6a4661b28c7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 82,
"avg_line_length": 28.192307692307693,
"alnum_prop": 0.679399727148704,
"repo_name": "siddartha1992/cloud-custodian",
"id": "5f0e5f55fd5da95a5b2269f90e23f0bd3003e5b0",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user_managements', '0028_auto_20180503_1802'),
('user_managements', '0026_auto_20180213_1803'),
('user_managements', '0027_merge'),
('user_ma... | {
"content_hash": "360f188f164c2b6884a967b1ff4fd1e3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 24.5,
"alnum_prop": 0.6352040816326531,
"repo_name": "I-sektionen/i-portalen",
"id": "7612385d986c7a66954648001c764ad364f2588b",
"size": "416",
"bi... |
import sys
if sys.version_info[0] > 2:
import tkinter
else:
import Tkinter as tkinter
from PIL import Image, ImageTk
#
# an image viewer
class UI(tkinter.Frame):
def __init__(self, master, im, value=128):
tkinter.Frame.__init__(self, master)
self.image = im
self.value = value
... | {
"content_hash": "4061cf5496349df312132baa9af0515a",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 25.591549295774648,
"alnum_prop": 0.5674188222344524,
"repo_name": "BassantMorsi/finderApp",
"id": "66ca259b86840d995e7b9a2a62371a82d6f12036",
"size"... |
n=int(raw_input())
x=map(int,raw_input().split(' '))
# don't know why greedy.. just try
x.sort() # ascending
pilelist=[[]]
''' Actually it's not necessary to store the specific value of pile element,
the size of each pile is enough. Well, this is more general.
'''
for xi in x:
# targetFound=False
for pile in pi... | {
"content_hash": "d1475c414c549dacbe3bf27010f02a85",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 23.08695652173913,
"alnum_prop": 0.6760828625235404,
"repo_name": "SnowOnion/CodeForcesLee",
"id": "5f25c268acb1bb8f7ec1d2c2422b5792231f6502",
"size"... |
"""Feature extractor class for OwlViT."""
from typing import List, Optional, Union
import numpy as np
from PIL import Image
from transformers.image_utils import PILImageResampling
from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin
from ...image_transforms import center_to_corners_format
fr... | {
"content_hash": "61a16a5e90a5ec927cf66139b3ddf526",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 136,
"avg_line_length": 45.151898734177216,
"alnum_prop": 0.6138912251191477,
"repo_name": "huggingface/transformers",
"id": "0bbb8c3105769afb4319d5b7eb5813a353cd5c4b",
"s... |
"""
Copyright 2012 GroupDocs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | {
"content_hash": "69c601d9777ddf8f9bda47f6b08725cf",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.6197552447552448,
"repo_name": "liosha2007/temporary-groupdocs-python-sdk",
"id": "3e12e589dcb298a316f2164116328940... |
import logging
import os.path
import subprocess
import digg.dev.hackbuilder.target
import digg.dev.hackbuilder.plugin_utils
from digg.dev.hackbuilder.plugins import build_file_targets
from digg.dev.hackbuilder.plugin_utils \
import normal_dep_targets_from_dep_strings
from digg.dev.hackbuilder.plugin_utils impo... | {
"content_hash": "cbaa0495a8e1758899738ae1799373bb",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 82,
"avg_line_length": 40.098214285714285,
"alnum_prop": 0.59541304831886,
"repo_name": "wt/repo-digg-dev-hackbuilder",
"id": "687c9e8e8a398e024601f5ce6657ec850650923c",
"... |
import pytest
import random
import ray
from ray import workflow
def generate_chain(length=10):
@ray.remote(num_cpus=0.01)
def inc(n):
return n + 1
n = inc.bind(0)
for _ in range(length):
n = inc.bind(n)
return n
def generate_continuation(depth=10):
@ray.remote(num_cpus=0.01... | {
"content_hash": "ff36af3cd359eef42b18137190543d01",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 66,
"avg_line_length": 23.436781609195403,
"alnum_prop": 0.6007846983815596,
"repo_name": "ray-project/ray",
"id": "467ed137075b7091cdf00e90cffbfec8d7b9c5c1",
"size": "2039... |
import time
import argparse
import os
import sys
from collections import Counter
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from trace_utils import parse_event_trace, Stats
from pretty_print_input_trace import default_fields, field_formatters
import sts.replay_event as replay_events
from sts.datap... | {
"content_hash": "1c1591b10505444a55b4f60be72cb33c",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 69,
"avg_line_length": 30.746268656716417,
"alnum_prop": 0.6344660194174757,
"repo_name": "ucb-sts/sts",
"id": "7cf51bb9913108c69ba5dc1b9323383511c5b4bf",
"size": "2141",
... |
import re
import os
import json
import binascii
import hashlib
import time
import base58
from datetime import datetime
import logging
import apsw
import pprint
pp = pprint.PrettyPrinter(indent=2)
# import flask web microframework
from flask import Flask
from flask import request
from flask import abort
# import from... | {
"content_hash": "c01f0984f2266cec5ed64c529bf5c077",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 126,
"avg_line_length": 25.753968253968253,
"alnum_prop": 0.5745249101181304,
"repo_name": "jgarzik/bc-hashfs",
"id": "3a69cae44376c353ec044483ba0f0c32552d63c7",
"size": "... |
from typing import Optional
from parlai.core.opt import Opt
from parlai.core.teachers import DialogTeacher
from parlai.core.params import ParlaiParser
from .build import build
from collections import defaultdict
import jsonlines
from parlai.utils.data import DatatypeHelper
import random
import copy
import os
RANDOM_SE... | {
"content_hash": "08616ba729843586e8a54f13fc474323",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 296,
"avg_line_length": 39.09893992932862,
"alnum_prop": 0.5543605964753728,
"repo_name": "facebookresearch/ParlAI",
"id": "0a6251d6f690f563b2f8dda9613cea3fb6ea1067",
"siz... |
'''
Created on 24 Jan 2017
@author: muth
'''
import os
import RPi.GPIO as GPIO
import threading
import time
import pygame
from Adafruit_Thermal import *
from time import sleep
from PIL import Image
from PIL import ImageOps
from PIL import ImageEnhance
from PIL import ImageDraw
from PIL import ImageFo... | {
"content_hash": "7738ea2d64ee09cff36bc6a333ac9df0",
"timestamp": "",
"source": "github",
"line_count": 346,
"max_line_length": 98,
"avg_line_length": 33.86705202312139,
"alnum_prop": 0.5762928827444956,
"repo_name": "pierre-muth/polapi-zero",
"id": "6a04d3edc62a9e1faa070e9fcfcd215f27bcddec",
"size... |
from collections import OrderedDict
from .errors import InvalidData, InvalidDataSize, InvalidModelDeclaration
from .fields import BaseFieldInstructor, DefaultByteOrder
__all__ = (
'InstructorModel',
)
class Opts(object):
pass
class MetaInstructor(type):
def __new__(cls, name, bases, attrs):
d... | {
"content_hash": "6ba81e6747ba6d6a911002188e2349c4",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 118,
"avg_line_length": 30.022222222222222,
"alnum_prop": 0.5518134715025906,
"repo_name": "pikhovkin/instructor",
"id": "950cebde6f9d980b7da030afc556f6b70650c909",
"size":... |
"""Write a decorator called debug that prints
its functions inputs and outputs"""
def debug(f):
def wrapper(*args, **kwargs):
print "[] Debug: args=%s; kwargs=%s" % (args, kwargs)
res = f(*args, **kwargs)
print "[] Done: %s" % res
return res
return wrapper
def sum_dig... | {
"content_hash": "efc5d77053aa5c67c6be7e2bc860368a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 61,
"avg_line_length": 19.291666666666668,
"alnum_prop": 0.572354211663067,
"repo_name": "ynonp/python-examples",
"id": "0e15a0b992816b57c748ae5921288095110fc6d8",
"size": ... |
"""
This library for transformations partly derived and was re-implemented from the
following online resources:
* http://www.lfd.uci.edu/~gohlke/code/transformations.py.html
* http://www.euclideanspace.com/maths/geometry/rotations/
* http://code.activestate.com/recipes/578108-determinant-of-matrix-of-any-o... | {
"content_hash": "e31c02be90cb18bf9cd22f59899dbdf8",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 115,
"avg_line_length": 34.02216066481994,
"alnum_prop": 0.5947728382999512,
"repo_name": "compas-dev/compas",
"id": "623d95c9ad5fe897a1f72a6ab245578c856f7fe8",
"size": "1... |
"""Support for representing current time of the day as binary sensors."""
from datetime import datetime, timedelta
import logging
import pytz
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorDevice
from homeassistant.const import (
CONF_AFTER,
CONF_BEFOR... | {
"content_hash": "4cefefe07aaf194056f318ff82ea6bdc",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 88,
"avg_line_length": 37.06224066390042,
"alnum_prop": 0.6199059561128527,
"repo_name": "postlund/home-assistant",
"id": "72507b3d1481c3f528b2547e6bc38ec7078b8b5f",
"size... |
"""Tags related QA tests.
"""
from ganeti import constants
from qa import qa_rapi
from qa_utils import AssertCommand
_TEMP_TAG_NAMES = ["TEMP-Ganeti-QA-Tag%d" % i for i in range(3)]
_TEMP_TAG_RE = r'^TEMP-Ganeti-QA-Tag\d+$'
_KIND_TO_COMMAND = {
constants.TAG_CLUSTER: "gnt-cluster",
constants.TAG_NODE: "gnt-n... | {
"content_hash": "8df5bb6abfd480885557dc52ea53c2cd",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 64,
"avg_line_length": 20.514285714285716,
"alnum_prop": 0.665041782729805,
"repo_name": "ganeti/ganeti",
"id": "7daaafb9c5af8885b5ca7a05e5e9dc68a4825d56",
"size": "2778",
... |
import json, cgi, sys
from settings import *
from datetime import datetime, timedelta
from core.core import *
from urllib import *
from math import *
from copy import deepcopy
from uuid import uuid4
from libs.contents.contents import *
from libs.perm.perm import is_admin, user_has_permission
# from libs.perm.perm im... | {
"content_hash": "8d01b72f08f017b2516d24f2e57de32d",
"timestamp": "",
"source": "github",
"line_count": 1089,
"max_line_length": 191,
"avg_line_length": 39.08080808080808,
"alnum_prop": 0.6186940482624121,
"repo_name": "alikzao/tao1",
"id": "73b7d8f33a2236c3633f4250eb6978a35c398849",
"size": "46213... |
import logging
import numpy as np
logger = logging.getLogger(__name__)
class sample_from:
"""Specify that tune should sample configuration values from this function.
Arguments:
func: An callable function to draw a sample from.
"""
def __init__(self, func):
self.func = func
def ... | {
"content_hash": "6efffbf81fd05c5eeba80739b1f919bf",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 79,
"avg_line_length": 26.564705882352943,
"alnum_prop": 0.6284322409211692,
"repo_name": "stephanie-wang/ray",
"id": "bb8c9cb5567033df39a9e8dbab0ad7b1a15df97b",
"size": "2... |
import pprint
import ipaddr
import netaddr
from neutronclient.common import exceptions as neutron_exc
from neutronclient.v2_0 import client as neutron_client
from cloudferrylib.base import network
from cloudferrylib.os.identity import keystone as ksresource
from cloudferrylib.utils import utils as utl
LOG = utl.get... | {
"content_hash": "027206005a406f33e803e017aebea948",
"timestamp": "",
"source": "github",
"line_count": 1375,
"max_line_length": 79,
"avg_line_length": 42.703272727272726,
"alnum_prop": 0.4923957286646116,
"repo_name": "archyufa/CloudFerry",
"id": "5e183bceb90c754caf30bd460996cc484794ee5e",
"size":... |
import unittest
import numpy as np
from chainer import testing
from chainercv.transforms import flip_point
class TestFlipPoint(unittest.TestCase):
def test_flip_point_ndarray(self):
point = np.random.uniform(
low=0., high=32., size=(3, 12, 2))
out = flip_point(point, size=(34, 32),... | {
"content_hash": "a8a16a606052663b9e3f94e499478e68",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 62,
"avg_line_length": 31.977272727272727,
"alnum_prop": 0.5621890547263682,
"repo_name": "chainer/chainercv",
"id": "50ec5036ff4db4fb08a95b74acf78b6d67ed52df",
"size": "14... |
from userena.contrib.umessages.tests.fields import *
from userena.contrib.umessages.tests.forms import *
from userena.contrib.umessages.tests.managers import *
from userena.contrib.umessages.tests.models import *
from userena.contrib.umessages.tests.views import *
| {
"content_hash": "31178754376c3497c1457829456e5519",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 54,
"avg_line_length": 53,
"alnum_prop": 0.8301886792452831,
"repo_name": "clione/django-kanban",
"id": "ff367dd3679a71c878c8050451aba5440a429917",
"size": "265",
"binary"... |
"""Functional test for optimizer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class OptimizerTest(tf.test.TestCase):
def testBasic(self):
for dtype in [tf.half, tf.float32]:
with self.test_session():
var0 ... | {
"content_hash": "b0701be23bbe0df0e6a4a55ba619ccd9",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 39.883495145631066,
"alnum_prop": 0.5822784810126582,
"repo_name": "peterbraden/tensorflow",
"id": "54d400a51c06b4f893cf86ada0a1ba405e351699",
"size... |
import logbook
from ...ut.bunch import Bunch
from .. import DatabaseFixture
g = DatabaseFixture()
def setup_module():
g.setup()
def teardown_module():
g.teardown()
| {
"content_hash": "ccb6f7a331d399e172d8eafa62abd50b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 30,
"avg_line_length": 12.714285714285714,
"alnum_prop": 0.6853932584269663,
"repo_name": "Answeror/torabot",
"id": "6edcdb553a1f39389672ba9100d4396162e5f2b4",
"size": "178... |
"""
boutique, a tiny ecommerce solution you already know how to use.
Create folders to create product categories, subcategories, and products.
If a product belongs to multiple categories, simply create a shortcut to it.
"""
import os
import jinja2
import webapp2
__title__ = 'boutique'
__version__ = '1.0'
__auth... | {
"content_hash": "137b56e3d8fb81b5e483314f5e06ad6b",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 77,
"avg_line_length": 23.59633027522936,
"alnum_prop": 0.6932348367029549,
"repo_name": "jhadjar/boutique",
"id": "2b02b02b5993ffaddf730ac11792a6c152e81854",
"size": "259... |
from sqlalchemy import Column, Integer, String, Sequence
from sunpower.database import Base
class Distributor(Base):
__tablename__ = "distributor"
id = Column(Integer, Sequence('distributor_id_sequence'), primary_key=True)
username = Column(String(80), unique=True)
email = Column(String(120), unique=T... | {
"content_hash": "674a3a43b38fc731bdfe3f5fd6bf9d1a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 33.833333333333336,
"alnum_prop": 0.6732348111658456,
"repo_name": "ianjuma/sunpower",
"id": "f014d5bb1eacac6737ed07670bafc73ab802e47a",
"size": "609... |
import herbpy
import os
import numpy
import sys # exit()
# get the location of some objects (you'll need the pr_ordata package)
from catkin.find_in_workspaces import find_in_workspaces
package_name = 'pr_ordata'
directory = 'data/objects'
objects_path = find_in_workspaces(
search_dirs=['share'],
project=packag... | {
"content_hash": "febef68dbd0f85aba63d8450ef09552a",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 89,
"avg_line_length": 32.597938144329895,
"alnum_prop": 0.6410499683744465,
"repo_name": "personalrobotics/herbpy",
"id": "acaf70138c1cf1ab19a2b35bf69e73c4eff0e76e",
"size... |
""" Authentication exceptions """
class AuthenticationFailed(Exception):
""" Authentication failure
"""
pass # pragma: no cover
| {
"content_hash": "408b84d8b5e199c13eef45038ed0f793",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 38,
"avg_line_length": 16.11111111111111,
"alnum_prop": 0.6620689655172414,
"repo_name": "SANKUAI-IT/python-zimbra",
"id": "969dca4429a697f02d79f9034f5d7031eb5ebf0a",
"size"... |
#!/usr/bin/env python
#
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This test simulates the first time a database has to be split:
# - we start with a keyspace with a single shard and a single table
# - we ad... | {
"content_hash": "3832bfb5adf7d8e5989cb3cb942dff81",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 80,
"avg_line_length": 41.05615942028985,
"alnum_prop": 0.6117018929532718,
"repo_name": "aaijazi/vitess",
"id": "96f5a82b3407a5d8947ad561ee9a330789889711",
"size": "22663... |
from custom.ilsgateway.tanzania.reminders.reminder import Reminder
from custom.ilsgateway.models import SupplyPointStatusTypes, SupplyPointStatus
from custom.ilsgateway.tanzania.reminders import REMINDER_SUPERVISION
class SupervisionReminder(Reminder):
def get_message(self):
return REMINDER_SUPERVISION
... | {
"content_hash": "bf8e945ca56c7d0bb5dcbc774b6b3f59",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 78,
"avg_line_length": 34.35,
"alnum_prop": 0.7467248908296943,
"repo_name": "qedsoftware/commcare-hq",
"id": "4b7be21b6ef623f49b76c228b565b97e7fe26ecc",
"size": "687",
"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Product.isenabled'
db.delete_column(u'catalog_product', 'isenabled')
# Adding field 'Product.disabled'
... | {
"content_hash": "1606f42c19203b7c2cc35cd5ecb9cc7d",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 260,
"avg_line_length": 70.53196930946291,
"alnum_prop": 0.5577271738342157,
"repo_name": "Makeystreet/makeystreet",
"id": "cc9d8e425f4d5dcf6e15172e654b18d535488214",
"siz... |
from __future__ import unicode_literals
from django.db import migrations
import django.db.models.deletion
import sentry.db.models.fields.foreignkey
class Migration(migrations.Migration):
# This flag is used to mark that a migration shouldn't be automatically run in
# production. We set this to True for opera... | {
"content_hash": "e04d9846879955cefa5b04dc31c2e98d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 170,
"avg_line_length": 43.567567567567565,
"alnum_prop": 0.7084367245657568,
"repo_name": "beeftornado/sentry",
"id": "4d82cf40adb86c7ff5dc25d07a68eb2d13ff187b",
"size": "... |
from custodian.vasp.validators import VasprunXMLValidator
import os
import unittest
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
cwd = os.getcwd()
class VasprunXMLValidatorTest(unittest.TestCase):
def test_check_and_correct(self):
os.chdir(os... | {
"content_hash": "c41fc47e064eb09310fb6390d4e8470f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 26.424242424242426,
"alnum_prop": 0.6169724770642202,
"repo_name": "alberthxf/custodian",
"id": "75cd01750516fe2fa7893ea8237e8f0393e4e745",
"size": "... |
"""
Tests for tomlgun, a Python parser for TOML
"""
__author__= 'elssar <elssar@altrawcode.com>'
from os import path
from yaml import load
import tomlgun
base= path.dirname(path.abspath(__file__))
with open(path.join(base, 'example.yaml'), 'r') as y:
yaml= load(y)
with open(path.join(base, 'example.toml'), 'r'... | {
"content_hash": "fe27ec8de372150e2d9fc5c1a58f1269",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 96,
"avg_line_length": 32.66153846153846,
"alnum_prop": 0.557230334432407,
"repo_name": "elssar/tomlgun",
"id": "5f23d54dff7de5e860864f9d3f7f0baa231711ad",
"size": "2171",
... |
from cinder import exception
from cinder import flags
from cinder import test
from cinder.volume import xiv
FLAGS = flags.FLAGS
FAKE = "fake"
VOLUME = {
'size': 16,
'name': FAKE,
'id': 1
}
CONNECTOR = {
'initiator': "iqn.2012-07.org.fake:01:948f189c4695",
}
class XI... | {
"content_hash": "211fb17eb8ffec2543ae1e4cac4c7325",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 34.0316742081448,
"alnum_prop": 0.6061693923680361,
"repo_name": "rnirmal/cinder",
"id": "842cda4bee5ea3c5dc2fffca0eb35942258ebac1",
"size": "8319",... |
JSON = 'application/json'
KML = 'application/vnd.google-earth.kml+xml'
KMZ = 'application/vnd.google-earth.kmz'
| {
"content_hash": "365225ad0be8f1adc6497a05ded6ec34",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.75,
"repo_name": "underbluewaters/marinemap",
"id": "65cd62ed47279c92ec1698056e741c4df66c94a2",
"size": "112",
"... |
import datetime
from django.test.client import RequestFactory
from nose.tools import eq_, ok_
from fjord.base.tests import TestCase, reverse
from fjord.base.utils import (
actual_ip_plus_context,
instance_to_key,
key_to_instance,
smart_bool,
smart_date,
smart_int,
smart_str,
smart_tim... | {
"content_hash": "bb37c8ed7efe54ed1e77b97ff04dc3f4",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 79,
"avg_line_length": 28.38961038961039,
"alnum_prop": 0.5710582494663007,
"repo_name": "DESHRAJ/fjord",
"id": "7ce5eb33d51d92394ebe9492b92aa3283c375b3b",
"size": "6591",... |
import os
from git import Repo
class Project:
def __init__(self, path, name=None, git=None, lang=None, license=None):
self.path = path
self.name = name
self.git = git
self.lang = lang
self.license = license
def create(self):
path = os.path.join(self.path, self.n... | {
"content_hash": "567b930fa2138ed0bb65950f3d1eb0aa",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 75,
"avg_line_length": 27.741935483870968,
"alnum_prop": 0.5406976744186046,
"repo_name": "mame98/ShipYard",
"id": "7ad1a094e08b92889e90fb8d677d902fcda5ced0",
"size": "860"... |
from django.test import TestCase
# class ClienTest(TestCase):
# """docstring for ClienTest"""
# def setUp(self):
# pass | {
"content_hash": "20328d94f494601944cbbbadb8925f05",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 35,
"avg_line_length": 19.285714285714285,
"alnum_prop": 0.6444444444444445,
"repo_name": "ojengwa/reportr",
"id": "3487f171cd01289eb1c587fc25e724f57cac40fb",
"size": "135",... |
"""test_fonoapi.py - general tests of the fonoapi package.
"""
import fonoapi
import pandas as pd
import pytest
################################################################################
# Ensure that an exception is raised when giving a bad API token
###########################################################... | {
"content_hash": "8843deeae29c7b6b95c7fe351f99882b",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 122,
"avg_line_length": 36.5,
"alnum_prop": 0.554337899543379,
"repo_name": "jakesherman/fonoapi",
"id": "9e0bd2776fff72e4e785b088a3cf8b4781d9b01f",
"size": "7683",
"bin... |
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
Index,
Interval,
IntervalIndex,
Timedelta,
Timestamp,
date_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.core.arrays import IntervalArray
@pytest.fixtu... | {
"content_hash": "88752514b7e6ca46d105ea7d41b7659a",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 85,
"avg_line_length": 32.90120481927711,
"alnum_prop": 0.6068551340266588,
"repo_name": "datapythonista/pandas",
"id": "2a6bea325534295db37c837265a52a9bccf57440",
"size":... |
from bot import command, msg
class HelloCmd(command.BotCommand):
def run(self, dest, contents):
return msg.BotMsg('Hello there.')
command_instance = HelloCmd(bindings = ['hello'], name = 'hello')
| {
"content_hash": "c568ddef49c5341d13974230d9fbcd6c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 65,
"avg_line_length": 25.25,
"alnum_prop": 0.7178217821782178,
"repo_name": "federicotdn/python-tgbot",
"id": "aa454912aa9eef11054329bcd49d457a0b77bdb5",
"size": "202",
"... |
'''
fasta2goi.py
=============
:Author: Nick Ilott
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
get fasta sequences for genes of interest specified
as a list
Usage
-----
Example::
python fasta2goi.py
Type::
python fasta2goi.py --help
for command line help.
Command line options
----------... | {
"content_hash": "2e700e880407484deb4777b6fcc88b24",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 111,
"avg_line_length": 20.227848101265824,
"alnum_prop": 0.581351689612015,
"repo_name": "CGATOxford/proj029",
"id": "1546e3006671984a8ed73de1cfb7f41bd6d88443",
"size": "1... |
import dash
dash.register_page(__name__)
# page with no layout
| {
"content_hash": "feecf971448a7adcfd45dc4ebd4af0ad",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 28,
"avg_line_length": 11,
"alnum_prop": 0.696969696969697,
"repo_name": "plotly/dash",
"id": "16c810063c5bce083b82efa2a383c519f4ce8adc",
"size": "66",
"binary": false,
... |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from pip._vendor.six.moves import http_client, urllib
import codecs
import re
from io import BytesIO, StringIO
from pip._vendor import webencodings
from .constants import EOF, spaceCharacters, asciiLetters, asci... | {
"content_hash": "e716f4c4f5738ffd252c179bac601d37",
"timestamp": "",
"source": "github",
"line_count": 918,
"max_line_length": 433,
"avg_line_length": 35.24291938997821,
"alnum_prop": 0.5690044199919636,
"repo_name": "TeamSPoon/logicmoo_workspace",
"id": "e0bb37602c8e2f1f808ba8fdcb1b7f63451fa4f5",
... |
from itertools import repeat
from .pandas_vb_common import *
import scipy.sparse
from pandas import SparseSeries, SparseDataFrame
class sparse_series_to_frame(object):
goal_time = 0.2
def setup(self):
self.K = 50
self.N = 50000
self.rng = np.asarray(date_range('1/1/2000', periods=sel... | {
"content_hash": "8a27d2ecf0d166edc4cd33ec31f56120",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 103,
"avg_line_length": 34.939189189189186,
"alnum_prop": 0.6230903113517695,
"repo_name": "nmartensen/pandas",
"id": "7259e8cdb7d614c3f90c9d3b72f006047d5e4056",
"size": "... |
import os
import sys
import argparse
import json
import logging
import subprocess
import re
from collections import OrderedDict
# defaults
base_layers = OrderedDict([
('meta-oe', 'meta-openembedded/meta-oe'),
('meta-efl', 'meta-openembedded/meta-efl'),
('meta-gpe', ... | {
"content_hash": "b7ba6cafb861a908ab8caac74c842477",
"timestamp": "",
"source": "github",
"line_count": 510,
"max_line_length": 119,
"avg_line_length": 35.68627450980392,
"alnum_prop": 0.5806043956043956,
"repo_name": "khronos666/oebb-py",
"id": "58a6bd6d70175b558246b7e20131e962c89d0fa1",
"size": "... |
"""
Utility class for VM related operations.
Based on the "root/virtualization/v2" namespace available starting with
Hyper-V Server / Windows Server 2012.
"""
import sys
import uuid
if sys.platform == 'win32':
import wmi
from oslo.config import cfg
from nova.openstack.common.gettextutils import _
from nova.open... | {
"content_hash": "3548e7f639664001c4148482b8e1eb0d",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 79,
"avg_line_length": 38.48728813559322,
"alnum_prop": 0.6190685896730155,
"repo_name": "petrutlucian94/nova_dev",
"id": "f366b7650ba2d5f13db467898a1a628ddecad54c",
"size... |
from twisted.trial import unittest
from specter import service, client
class WhateverObject(object):
def __init__(self, **kw):
for k,v in kw.items():
setattr(self, k, v)
def fakeRequest(path, method, headers):
def getRawHeaders(x):
if x in headers:
return [headers[x]]
... | {
"content_hash": "dd00bfcd4161f5d91d5da80140e764b8",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 74,
"avg_line_length": 25.86842105263158,
"alnum_prop": 0.5890132248219736,
"repo_name": "praekelt/specter",
"id": "847030435f3ec768fc0c596acfa49daa54830004",
"size": "983"... |
from __future__ import annotations
from textwrap import dedent
import pytest
from pants.backend.python.goals.publish import PublishToPyPiFieldSet, PublishToPyPiRequest, rules
from pants.backend.python.macros.python_artifact import PythonArtifact
from pants.backend.python.target_types import PythonDistribution, Pytho... | {
"content_hash": "ac1607d3e500ca05f9cee5eccbdfb59c",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 97,
"avg_line_length": 30.62874251497006,
"alnum_prop": 0.5857282502443792,
"repo_name": "patricklaw/pants",
"id": "e10cc7cd70ebe422076d533f3c95a442a900a0cc",
"size": "524... |
from django.db import models
from django.conf import settings
from tenant_schemas.models import TenantMixin
LEGAL_PERSON = 'PJ'
NATURAL_PERSON = 'PF'
ENTITY_CHOICES = (
(LEGAL_PERSON, 'Legal Person'),
(NATURAL_PERSON, 'Natural Person')
)
class Client(TenantMixin):
name = models.CharField(max_length=180)
... | {
"content_hash": "173dd698025e886b7e1eb61fe7686f7b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 73,
"avg_line_length": 32.62162162162162,
"alnum_prop": 0.6578293289146645,
"repo_name": "pa-siirja/shopcode",
"id": "ed40ae806343eadd3c9fe1f2100571048a6b7b59",
"size": "12... |
"""
Fast Weights Cell.
Ba et al. Using Fast Weights to Attend to the Recent Past
https://arxiv.org/abs/1610.06258
"""
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import init_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import nn_ops
from tensorflow.python.ops im... | {
"content_hash": "a909130c807bd41f8277123689b00e6d",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 114,
"avg_line_length": 34.31111111111111,
"alnum_prop": 0.6297495682210709,
"repo_name": "jxwufan/AssociativeRetrieval",
"id": "bed5f79473f2f9024393b9267a83bda31ea445cc",
... |
"""
Definitions of the scaling algorithm.
"""
from __future__ import annotations
import itertools
import json
import logging
import time
from libtbx import Auto
from dials.algorithms.scaling.observers import (
ScalingHTMLContextManager,
ScalingSummaryContextManager,
)
from dials.algorithms.scaling.scale_and... | {
"content_hash": "61e7068d68ef2c52b6a080644c0fc8f2",
"timestamp": "",
"source": "github",
"line_count": 647,
"max_line_length": 140,
"avg_line_length": 40.18238021638331,
"alnum_prop": 0.6126240480036926,
"repo_name": "dials/dials",
"id": "5019c61c9ef1e885c9f73e9bc4de3e022157ffe5",
"size": "25998",... |
from requests import Request
from six.moves.urllib_parse import urlencode
import json
import six
class TraktRequest(object):
def __init__(self, client, **kwargs):
self.client = client
self.configuration = client.configuration
self.kwargs = kwargs
self.request = None
# Par... | {
"content_hash": "61a81fbc21124362af3d45d990e80c25",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 115,
"avg_line_length": 29.7196261682243,
"alnum_prop": 0.5849056603773585,
"repo_name": "timbooo/traktforalfred",
"id": "33a4b855bacffe81577ea6ff04408db1b9a772a2",
"size"... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import uuid
class Migration(migrations.Migration):
dependencies = [("auth", "0001_initial")]
operations = [
migrations.CreateModel(
name="Profile",
fields=[
... | {
"content_hash": "8c67f57476bc5e51e307c20fce2a459f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 87,
"avg_line_length": 30.423076923076923,
"alnum_prop": 0.3912768647281922,
"repo_name": "arocks/edge",
"id": "6cd6f7fac631936267366ef207d39e72d3679b60",
"size": "1606",
... |
"""
DEPRICATED USE clustering2.py
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from six.moves import range
import utool as ut
import sys
import numpy as np
import scipy.sparse as spsparse
import vtool_ibeis.nearest_neighbors as nn
(print, rrr, profile) = ut.inject2(__name__)
... | {
"content_hash": "6ef3ef9c330ced4c98b085c89c62216e",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 121,
"avg_line_length": 43.48943661971831,
"alnum_prop": 0.6100720589425958,
"repo_name": "Erotemic/vtool",
"id": "53cf4ce8b1406dbbb829962572a1ed898b29057f",
"size": "1238... |
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
import webapp2
from google.appengine.api import app_identity
from google.appengine.api import mail
from conference import ConferenceApi
from models im... | {
"content_hash": "d4f402b38e6b32bb6d8fb212c0eee1bf",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 78,
"avg_line_length": 31.639344262295083,
"alnum_prop": 0.6601036269430052,
"repo_name": "olala7846/udacity_fullstack_p4",
"id": "690de870e9a092b3fcf3c884ac1911e8983fc3f6",
... |
from django.db import models
from .course import CC
from .student import Student
from .term import Period
class AttendanceCode(models.Model):
dcid = models.IntegerField(primary_key=True)
id = models.IntegerField(unique=True)
presence_status_code = models.CharField(max_length=10, db_column='presence_status_... | {
"content_hash": "d7a4ae2d005fa11771b127c4050011ec",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 90,
"avg_line_length": 37.25925925925926,
"alnum_prop": 0.7037773359840954,
"repo_name": "IronCountySchoolDistrict/powerschool_apps",
"id": "e69819698feb2d576af6271b8e9a7b3b6... |
import sys
import cProfile
import signal
import subprocess
import logging
from marrow.io.ioloop import IOLoop
from marrow.script import execute, script, describe
from marrow.server.http import HTTPServer
def hello(request):
return b'200 OK', [(b'Content-Length', b'13'), (b'Content-Type', b'text/plain')], [b'Hel... | {
"content_hash": "f9dd8004171d32c1052cfb8a26b7e7ae",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 106,
"avg_line_length": 31.25,
"alnum_prop": 0.6306666666666667,
"repo_name": "marrow/server.http",
"id": "db5be4f568911ced0c15488dc28baec45eb43e91",
"size": "2291",
"bin... |
import os
import re
import sys
REGEX_IN_MSG_RE = re.compile('^\[(.+)\] *(.+)$', flags=re.DOTALL)
IS_WORD_RE = re.compile('^\w+$')
def match_program_or_subcommand(msg, alert=False, cli_args=None):
"""
Look for messages that starts with "[program|sub-command] message" and search the program or sub-command against... | {
"content_hash": "717d7746d5a73f1bc64e91d44311633f",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 114,
"avg_line_length": 29.242424242424242,
"alnum_prop": 0.6621761658031088,
"repo_name": "maxzheng/clicast",
"id": "89b4fa0fbb005bee7b2c9802ca5131fde13a06cb",
"size": "19... |
from __future__ import with_statement
from contextlib import closing
import httplib
# urllib2 doesn't support timeouts for python 2.5
def request(method, url, data=None, headers={}, timeout=None):
host_port = url.split('/')[2]
timeout_set = False
try:
connection = httplib.HTTPSConnection(host_port... | {
"content_hash": "2a071d4839106b1d7dd6d7d25d11b07f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 31.958333333333332,
"alnum_prop": 0.6610169491525424,
"repo_name": "imposeren/yandex-maps",
"id": "0510459ef5bc1c2a8f1934c2534732cf19c72cce",
"size":... |
if __name__ == "__main__":
import os, sys
current_path = os.path.dirname(os.path.abspath(__file__))
root_path = os.path.abspath( os.path.join(current_path, os.pardir))
data_path = os.path.join(root_path, 'data')
noarch_lib = os.path.join(root_path, 'lib', 'noarch')
sys.path.append(noarch_lib)
... | {
"content_hash": "66c46709e35098e3f15acffa625877f7",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 109,
"avg_line_length": 38.42483660130719,
"alnum_prop": 0.5958496342915461,
"repo_name": "Suwmlee/XX-Net",
"id": "5b737197edcb7187d023a09e4c3cf5e3b8a905d5",
"size": "5962... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union, cast
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,... | {
"content_hash": "4ab1657d5fd6bc8a1a29cce1270e348e",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 116,
"avg_line_length": 46.0177304964539,
"alnum_prop": 0.6236032981428682,
"repo_name": "Azure/azure-sdk-for-python",
"id": "e80eccd0083a04f429852dcd7f57c1abcde382ef",
"s... |
import click
from ghutil.showing import print_json
from ghutil.types import Gist
@click.command()
@click.option("-v", "--verbose", is_flag=True, help="Show full response body")
@Gist.argument_list("gists")
def cli(gists, verbose):
"""Show gist details"""
print_json(gists, verbose)
| {
"content_hash": "82d69a50a51c6eae9244c11c8f2b50d9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 78,
"avg_line_length": 26.545454545454547,
"alnum_prop": 0.7123287671232876,
"repo_name": "jwodder/ghutil",
"id": "82d197658211a09054cb8157bc379abce3e7caac",
"size": "292",... |
import string
import re
# removes all entries equal to x from list l
def removeAll(l, x):
while True:
try:
l.remove(x)
except:
return l
class SimpleState:
def __init__(self, stateName, alphabet=["_", "1", "H", "E"]):
self.stateName = stateName
self.nextStateDict = {}
self.headMoveDict = {}
self.wr... | {
"content_hash": "fe8a2acaec5edc9d9051142be937db7e",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 98,
"avg_line_length": 29.334719334719335,
"alnum_prop": 0.6866761162296244,
"repo_name": "adamyedidia/parsimony",
"id": "44e02792f97c3669522b6b51568408af3eca5da7",
"size"... |
"""
Utility functionality (:mod:`skbio.util`)
=========================================
.. currentmodule:: skbio.util
This package provides general exception/warning definitions used throughout
scikit-bio, as well as various utility functionality, including I/O and
unit-testing convenience functions.
Testing functio... | {
"content_hash": "adfdcd72bb371c8f809fc8d2948f75c5",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 78,
"avg_line_length": 27.072289156626507,
"alnum_prop": 0.6279483756119271,
"repo_name": "xguse/scikit-bio",
"id": "bdb9738fcbd59b8d003851dfe3de54f4f1a85e05",
"size": "224... |
__author__ = 'chenzhao'
# import os
# import glob
# __all__ = [os.path.basename(f)[:-3] for f in glob.glob(os.path.dirname(__file__)+"/*.py")]
# from base import *
from geo import *
from user import *
from trace import *
from payment import *
from attachment import *
from crowdsourcing import *
from campaign import ... | {
"content_hash": "732e7c641042865d8d0b08e4d656648f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 92,
"avg_line_length": 19.22222222222222,
"alnum_prop": 0.6791907514450867,
"repo_name": "gmission/gmission",
"id": "123d6c16941d214cc6617e31b3d4a7e46caf3dad",
"size": "346... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse # noqa
from django import http
from mox import IsA # noqa
from designatedashboard import api
from openstack_dashboard.test import helpers as test
from designatedashboard.dashboards.project.dns_domains import forms
DOMAIN_ID = ... | {
"content_hash": "f06fcfe8124aa8d8471ee7a7565f6387",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 78,
"avg_line_length": 32.107226107226104,
"alnum_prop": 0.6215333236532598,
"repo_name": "kiall/designate-py3",
"id": "5dbed17a026d10944a849206457aff0b5aa65135",
"size": ... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix... | {
"content_hash": "a74a26d4acc551dec2900ca8964395c3",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 88,
"avg_line_length": 33.291044776119406,
"alnum_prop": 0.708361353956512,
"repo_name": "h3/django-cablegate",
"id": "6f9a34fefe14603d2efcc236d3ac944f60c8c830",
"size": "... |
from uplink.retry.retry import retry
from uplink.retry.when import RetryPredicate
from uplink.retry.backoff import RetryBackoff
__all__ = ["retry", "RetryPredicate", "RetryBackoff"]
| {
"content_hash": "34cdaa8b469c70a573a99d9ebbfe7779",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 53,
"avg_line_length": 36.6,
"alnum_prop": 0.7868852459016393,
"repo_name": "prkumar/uplink",
"id": "f3d4c4cccaece4e6c703903d06728a720e30a82b",
"size": "183",
"binary": fa... |
"""Tools for creating transform & filter expressions with a python syntax"""
# flake8: noqa
from .core import datum, Expression
from .funcs import *
from .consts import *
| {
"content_hash": "2666e0e89d03a0a272c82a5d10a678de",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 76,
"avg_line_length": 34.2,
"alnum_prop": 0.7543859649122807,
"repo_name": "altair-viz/altair",
"id": "8390b992a65164d801fb42c51705a5b4c2604025",
"size": "171",
"binary":... |
import unittest
from QGL import *
from QGL.tools.matrix_tools import *
from QGL.tools.clifford_tools import *
import QGL.config
try:
from helpers import setup_test_lib
except:
from .helpers import setup_test_lib
class EulerDecompositions(unittest.TestCase):
def setUp(self):
self.N1 = 24 #number of si... | {
"content_hash": "8028e6b725871c6fd5e6a07dc840b20c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 65,
"avg_line_length": 31.58974358974359,
"alnum_prop": 0.6022727272727273,
"repo_name": "BBN-Q/QGL",
"id": "ecd01649f8c75431de41c9469f884eda44930aa2",
"size": "1232",
"b... |
from swift.common.utils import config_true_value
class Config(dict):
def __init__(self, base=None):
if base is not None:
self.update(base)
def __getattr__(self, name):
if name not in self:
raise AttributeError("No attribute '%s'" % name)
return self[name]
... | {
"content_hash": "c61bc1e917a10b65031bd24c69e47f96",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 68,
"avg_line_length": 28.51923076923077,
"alnum_prop": 0.5670937289278489,
"repo_name": "tumf/swift3",
"id": "c474e19f9dff60bc1c113f7ff59f4d566d5f06e0",
"size": "2074",
... |
from __future__ import print_function
"""
This tool scans the calendar store to analyze organizer/attendee event
states to verify that the organizer's view of attendee state matches up
with the attendees' views. It can optionally apply a fix to bring the two
views back into line.
In theory the implicit scheduling mo... | {
"content_hash": "3c0bd9307e8f833f2f7ecfd901001b1f",
"timestamp": "",
"source": "github",
"line_count": 2715,
"max_line_length": 184,
"avg_line_length": 40.846040515653776,
"alnum_prop": 0.5703490626437144,
"repo_name": "red-hood/calendarserver",
"id": "087c4fa90f72197eccfa418bcc83353fc39ae7c2",
"s... |
"""
userdata_script.py - control an aws instance from a sqs queue
Run this guy on startup as a userdata script and he will connect to
s3 to download code to a directory, and run commands in it that are
provided by an SQS queue, one job at a time per core
Processing as a string template, we replace the following keys ... | {
"content_hash": "de040d83515e52c7708aed475ae598b1",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 80,
"avg_line_length": 35.19626168224299,
"alnum_prop": 0.6842804036112586,
"repo_name": "cdw/multifil",
"id": "1c5593ca5b72a4b38d91bfbba0cc010fa97b8a42",
"size": "3807",
... |
import sys, os, random, math, pygame
width = 600;
height = 600;
def save_data( samples, filename ):
'''Save sampled spheres. Write data to a file'''
file2write = open( filename, 'w' );
formattedData = "";
for sphere in samples:
for i in range(0, 2):
formattedData += str( sphere[i] ) + "\t";
formattedData ... | {
"content_hash": "2067a62bf0235e1619d06fa1e7df9a2b",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 80,
"avg_line_length": 23.97530864197531,
"alnum_prop": 0.635427394438723,
"repo_name": "Yinan-Zhang/RichCSpace",
"id": "48b8cce0284fe41644fdc4aa1d8b6f23e2de58e5",
"size": ... |
from __future__ import print_function
import sys, os
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def h2o_H2OFrame_col_names():
"""
Python API test: h2o.frame.H2OFrame.col_names(), h2o.frame.H2OFrame.columns()
Copied from pyunit_colnames.py
"""
iris_wheader = h2o.import... | {
"content_hash": "cf0499abd16fa0090ff2976ac6a2912a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 98,
"avg_line_length": 36.73684210526316,
"alnum_prop": 0.6919770773638968,
"repo_name": "michalkurka/h2o-3",
"id": "eb538cec462993b19aeb4bc64499188820eda290",
"size": "698... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Logit'] , ['Lag1Trend'] , ['Seasonal_Minute'] , ['LSTM'] ); | {
"content_hash": "03bba4ba43293963907591a99c41cf89",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 82,
"avg_line_length": 38.75,
"alnum_prop": 0.7032258064516129,
"repo_name": "antoinecarme/pyaf",
"id": "2c2dc3517e0332335a5c452a0ed99daa9bbcb889",
"size": "155",
"binary"... |
from django.core.urlresolvers import reverse
from django.template import Template, Context
from django.test import TestCase
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from dialogos.forms import CommentForm
from dialogos.models import Comment
class login(ob... | {
"content_hash": "8f5c22b76a0647753163d1e3a4f431cc",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 89,
"avg_line_length": 34.576719576719576,
"alnum_prop": 0.5687834736036725,
"repo_name": "rizumu/dialogos",
"id": "b4bee5f3908bbff77eb4f557bded6635264f4129",
"size": "653... |
from .widget_svg_layout import SVGLayoutBox
from .widget_fullscreen import FullscreenBox | {
"content_hash": "aa4694149f051ec55587e3ed3f47cd0a",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 44,
"avg_line_length": 44,
"alnum_prop": 0.8636363636363636,
"repo_name": "openseat/ipylayoutwidgets",
"id": "e7fb6fd717b1d365f4e95d528d0d183bd1b1bccb",
"size": "88",
"bin... |
from cno import cnodata
from cno.feeder import Feeder
from nose.plugins.attrib import attr
@attr('skip_travis')
def test_feeder():
f = Feeder()
pknmodel = cnodata("PKN-ToyMMB.sif")
midas = cnodata("MD-ToyMMB.csv")
f.run(model=pknmodel, data=midas)
f.newlinks
print(f)
f.plot()
| {
"content_hash": "a7d0396d9cfac152f55a76ab34378f7f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 40,
"avg_line_length": 20.533333333333335,
"alnum_prop": 0.6688311688311688,
"repo_name": "cellnopt/cellnopt",
"id": "6348c1818e895a5c68fcab5e3d8b8b636e88c6b6",
"size": "30... |
import maya.cmds as cmds
class HUD(object):
## signals
def __init__(self):
super(HUD, self).__init__()
def getAllHUD(self):
return cmds.headsUpDisplay(listHeadsUpDisplays = True)
| {
"content_hash": "6f4a56b63c92676578a69c85e13f2d08",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 62,
"avg_line_length": 19.181818181818183,
"alnum_prop": 0.6208530805687204,
"repo_name": "jamesbdunlop/defaultMayaLibrary",
"id": "a485184c4a7647b448b10953b79b0a907330b2e5",... |
from rest_framework.test import APITestCase
from django.core.urlresolvers import reverse
from rest_framework import status
from . import models
from . import serializers
from pdc.apps.common.test_utils import TestCaseWithChangeSetMixin
from pdc.apps.release import models as release_models
class RepositorySerializerT... | {
"content_hash": "6e4f263dbefcfa06b16cdca4168d5804",
"timestamp": "",
"source": "github",
"line_count": 702,
"max_line_length": 108,
"avg_line_length": 49.15099715099715,
"alnum_prop": 0.5706874565267795,
"repo_name": "maxamillion/product-definition-center",
"id": "980a71b5729684e113af18a7dea67feec5a... |
'Apply database-changes scripts.'
from datetime import datetime
from glob import glob
import os
import sys
from sqlalchemy import Column, String, DateTime
from .database import Session, Base
here = os.path.dirname(__file__)
root = os.path.join(here, 'sql', 'changes')
# The database migration models
class AppliedCh... | {
"content_hash": "bfee74838ae155c76d6b7b084af398e0",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 76,
"avg_line_length": 24.276315789473685,
"alnum_prop": 0.6130081300813008,
"repo_name": "kirkeby/empty-flask",
"id": "6fe49fedb2b7714ad623f74600728ca190f36aa5",
"size": "... |
import cpp_ast as cpp
import python_ast as ast
import scala_ast as scala
try:
from asp.util import *
except Exception,e:
pass
def is_python_node(x):
return isinstance(x, ast.AST)
def is_cpp_node(x):
return isinstance(x, cpp.Generable)
def is_scala_node(x):
return isinstance(x, scala... | {
"content_hash": "440be91ab07e8a0f3f0d809b50d82199",
"timestamp": "",
"source": "github",
"line_count": 618,
"max_line_length": 189,
"avg_line_length": 36.18446601941748,
"alnum_prop": 0.5489222788659333,
"repo_name": "pbirsinger/aspNew",
"id": "c6f9b7b93f857ebc9ea1bb59a8f2596e38e72b59",
"size": "2... |
from django import template
from satchmo.shop.utils import is_multihost_enabled
from satchmo.shop.models import Config
from satchmo.utils import url_join
from django.core import urlresolvers
register = template.Library()
def admin_site_views(view):
"""Returns a formatted list of sites, rendering for view, if any"... | {
"content_hash": "c390819904be454b55c0d22beadc6e6c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 72,
"avg_line_length": 25.636363636363637,
"alnum_prop": 0.6335697399527187,
"repo_name": "sankroh/satchmo",
"id": "179dc9fcdf1c3cbe2dffcee72e80331e476795f3",
"size": "846"... |
import re
import textwrap
import pytest
from ravel.types import Pos
from ravel.utils import strings
class TestStripOuterWhitespace:
def test_it_should_strip_blank_lines_before_and_after(self):
text = " \n\n \n \n Foo\n \n\nBar \n \n \n\n"
result = strings.strip_outer_whitespace(... | {
"content_hash": "68dfd8672198cc2c8fa1449f26bc7e73",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 73,
"avg_line_length": 29.305555555555557,
"alnum_prop": 0.5985781990521327,
"repo_name": "eykd/ravel",
"id": "dd1cbcd201f6c97c3d40dccace3fa10e051ca74c",
"size": "2110",
... |
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import functools
import sys
import threading
import time
from tornado.escape import utf8
from tornado.httpclient import HTTPRequest, HTTPResponse, _RequestProxy, HTTPError, HTT... | {
"content_hash": "46ebed1dbf9f60fa66c53f4ba7a23855",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 94,
"avg_line_length": 38.72286821705426,
"alnum_prop": 0.6109804314098394,
"repo_name": "Nirlendu/Dummy-Search-Engine",
"id": "569ea872e1b0b83b9c1a4de406fa394210ea83e9",
... |
"""Runs a linking command and optionally a strip command.
This script exists to avoid using complex shell commands in
gcc_toolchain.gni's tool("link"), in case the host running the compiler
does not have a POSIX-like shell (e.g. Windows).
"""
import argparse
import os
import subprocess
import sys
import wrapper_util... | {
"content_hash": "62c876b3480c366d2a60b9f397c30656",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 35.14492753623188,
"alnum_prop": 0.6280412371134021,
"repo_name": "endlessm/chromium-browser",
"id": "8892f14bfe237223590681c35598a3b570b26138",
"siz... |
from django.contrib import admin
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext_noop, ungettext
from faq.settings import DRAFTED, PUBLISHED, REMOVED, STATUS_CHOICES
from faq.models import Topic, Question
from faq.forms ... | {
"content_hash": "27e2e95fac0c11f4184f13ca69885175",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 77,
"avg_line_length": 35.05172413793103,
"alnum_prop": 0.6650270536153468,
"repo_name": "benspaulding/django-faq",
"id": "9171e048e391f316e3074d11c9d3f8f3c28013ef",
"size... |
from __future__ import print_function
import sys, re
from m5.util import code_formatter
if len(sys.argv) != 4:
print("Error: need 3 args (file names)")
sys.exit(0)
header_code = code_formatter()
decoder_code = code_formatter()
exec_code = code_formatter()
###############
#
# Generate file prologs (includes... | {
"content_hash": "2a71c37bcf8d20130aaecee1c792c127",
"timestamp": "",
"source": "github",
"line_count": 877,
"max_line_length": 80,
"avg_line_length": 29.155074116305588,
"alnum_prop": 0.6135945871954319,
"repo_name": "TUD-OS/gem5-dtu",
"id": "23ce02e87c9471b1fdb92506d17eda7e78fba48f",
"size": "272... |
import sklearn_dt_utils as utils
from sklearn.tree import export_graphviz
import os
# In[2]:
q_src_dir = os.getenv('Q_SRC_ROOT')
if not q_src_dir:
print("'Q_SRC_ROOT' is not set")
exit(-1)
csv_file_path = "%s/ML/KNN/data/cancer/b_cancer/cancer_data.csv" % q_src_dir
graphviz_gini = "graphviz_gini.txt"
graphv... | {
"content_hash": "ffba92de68fe9dc630ce4ef04672b229",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 132,
"avg_line_length": 15.98989898989899,
"alnum_prop": 0.689829437776374,
"repo_name": "NerdWalletOSS/Q",
"id": "3998b56691b2cb73a6637eacca5ebd7774e98d02",
"size": "1612"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import multiprocessing
import os
import shutil
import six
import socket
import threading
import time
import unittest
from tempfile import m... | {
"content_hash": "b62025c5651d0ac1e74b7f3ee95ade4d",
"timestamp": "",
"source": "github",
"line_count": 2957,
"max_line_length": 119,
"avg_line_length": 35.56611430503889,
"alnum_prop": 0.5751314550865749,
"repo_name": "jhsenjaliya/incubator-airflow",
"id": "ba08fd62f8fc6104bde40e5b35e18131ac16cd00",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.