text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import absolute_import, division, print_function, unicode_literals
import ast
import os
import os.path
import re
from UserDict import DictMixin
from UserList import UserList
BUILD_TARGET_PATTERN = re.compile(r"^(?P<cell>.*)?//(?P<path>[^:]+)?:(?P<name>.*)$")
__buck_files = {}
def get_buck_file(path... | {
"content_hash": "abddef2c5181aa8af0f248ab642797c3",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 99,
"avg_line_length": 31.882978723404257,
"alnum_prop": 0.534034034034034,
"repo_name": "rmaz/buck",
"id": "ff329c22efd6d0349629c2b6daaf523d1786c0f7",
"size": "6581",
"... |
from interfaces import *
from api import *
from api import _
import declarative
__all__ = ['Schema']
class Schema(FancyValidator):
"""
A schema validates a dictionary of values, applying different
validators (be key) to the different values. If
allow_extra_fields=True, keys without validators will ... | {
"content_hash": "8a9765d23c37cc0bce32ba358962154a",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 136,
"avg_line_length": 36.02145922746781,
"alnum_prop": 0.5498034076015728,
"repo_name": "Kussie/HTPC-Manager",
"id": "624349c305b7a3dcf164d34010e16a0e385e3a70",
"size": ... |
from __future__ import unicode_literals
import frappe, re, os
def delete_page_cache(path):
cache = frappe.cache()
groups = ("website_page", "page_context")
if path:
for name in groups:
cache.hdel(name, path)
else:
for name in groups:
cache.delete_key(name)
def find_first_image(html):
m = re.finditer(""... | {
"content_hash": "9e844ae37fa7085ea05bb40af1975a24",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 104,
"avg_line_length": 25.93719806763285,
"alnum_prop": 0.6436952877630844,
"repo_name": "Amber-Creative/amber-frappe",
"id": "c4d78696c723ecc647e5dd85e57c1ae2e2361a2b",
... |
import sys
from typing import TYPE_CHECKING
if sys.version_info < (3, 7) or TYPE_CHECKING:
from ._ysrc import YsrcValidator
from ._yperiodalignment import YperiodalignmentValidator
from ._yperiod0 import Yperiod0Validator
from ._yperiod import YperiodValidator
from ._yhoverformat import Yhoverforma... | {
"content_hash": "881ca4a22dba5efdeac86b28332dab0e",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 60,
"avg_line_length": 43.033112582781456,
"alnum_prop": 0.6728224068944291,
"repo_name": "plotly/plotly.py",
"id": "974f47eb14bae28faf4dc4190a8bd4f0d4c6a79f",
"size": "64... |
import glob
import os
import random
import string
import requests
from dashboard_config import HTML_REPORTS, OUTPUT_FILENAME, SEARCH_DIR
def get_output_path():
"""
Get a full path to the output file on disk.
The path is mapped to a public URL on the preview website.
"""
return os.path.join(HTML_... | {
"content_hash": "75a1e34e28a151458e545be2840c3c3a",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 120,
"avg_line_length": 27.264957264957264,
"alnum_prop": 0.6275862068965518,
"repo_name": "Rfam/rfam-production",
"id": "9eb72d508941fa52c0ef547b5b96c40e498248d4",
"size"... |
"""
Provides utilities for reading the sharding configuration from JSON and parsing
it into the corresponding allocation of tests to shards.
"""
import os
import json
SHARDING_CONFIG_FILE = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'sharding_configuration.json')
class ShardingTestConfig(object):... | {
"content_hash": "0ee70ceff98a914eb0a23caebd5e3f7e",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 34.84,
"alnum_prop": 0.6836969001148105,
"repo_name": "youtube/cobalt_sandbox",
"id": "c96bfd32a4b2c74eee907697becc8b2bef7eeb93",
"size": "2366",
"... |
import sys
import os
import os.path as path
import collections
import re
import datetime
import argparse
# Note, is_dst=None is used below so ambiguous dst situations result in error
class MatchError(argparse.ArgumentTypeError):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
date_p... | {
"content_hash": "faaf2b6d9f44e6aabe1b6af17f141f00",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 108,
"avg_line_length": 35.45783132530121,
"alnum_prop": 0.5261071469022539,
"repo_name": "northWind87/pystudentfetcher",
"id": "5cf9084e6b637aaf7a27b056a57a30cdaa61edc3",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import sys
import tensorflow as tf
def training(H, loss, global_step):
"""Sets up the training Ops.
Creates a summarizer to track the loss over time in TensorBoard.
Creates an opt... | {
"content_hash": "417bb144b7d54b57becf645a19520ed2",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 78,
"avg_line_length": 36.707317073170735,
"alnum_prop": 0.6897009966777409,
"repo_name": "TensorVision/MediSeg",
"id": "d56454a2045f2305a7257dc9476a4b043e6fae6d",
"size": ... |
"""
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": "913fdc25c03d82b48f8185d87d8d45b0",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 30.783783783783782,
"alnum_prop": 0.6479367866549605,
"repo_name": "liosha2007/temporary-groupdocs-python3-sdk",
"id": "479e1b13c061e35665861fd8b9a4613... |
"""
====================================
ndrive
====================================
What is ndrive
==============
ndrive is a Naver Ndrive wrapper for python
Getting started
===============
git clone https://github.com/carpedm20/pyndrive.git
Copyright
=========
Copyright 2014 Kim Tae Hoon
"""
import os, ... | {
"content_hash": "2208fb7a741b429abcfc4a39a76f0cc2",
"timestamp": "",
"source": "github",
"line_count": 877,
"max_line_length": 258,
"avg_line_length": 32.55530216647662,
"alnum_prop": 0.5198416868060663,
"repo_name": "carpedm20/ndrive",
"id": "6340fed73cfe6a42feb2f9ad51899774bea30144",
"size": "28... |
class tr_suffix(str):
VOWELS = u"aıoöuüei"
FRONT_VOWELS = u"aıou"
BACK_VOWELS = u"eiöü"
HARD_CONSONANTS = u"fstkçşhp"
DISCONTINIOUS_HARD_CONSONANTS = u"pçtk"
SOFTEN_DHC = u"bcdğ"
DISCONTINIOUS_HARD_CONSONANTS_AFTER_SUFFIX = u"pçk"
SOFTEN_DHC_AFTER_SUFFIX = u"bcğ"
MINOR_HARMONY = {
... | {
"content_hash": "78c150cecff4ea1fefbe1a61f02b12d1",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 259,
"avg_line_length": 39.416,
"alnum_prop": 0.5145795277721399,
"repo_name": "miklagard/django-turkish-suffix-library",
"id": "e82118276418f7c45cb546f7ce7a0dd3086ab4c4",
... |
from __future__ import print_function
# Note
# To run this script GNU Tools ARM Embedded must be installed,
# along with python for the same architecture. The program
# "arm-none-eabi-gdb-py.exe" requires python for the same
# architecture (x86 or 64) to work correctly. Also, on windows
# the GNU Tools ARM Embed... | {
"content_hash": "025abf457c348bc8b6c856aeedfa5946",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 112,
"avg_line_length": 33.42138364779874,
"alnum_prop": 0.62382386149793,
"repo_name": "pyocd/pyOCD",
"id": "fce0edce45ee932797559f93ceea3c1b186e2841",
"size": "5948",
... |
from xml.sax.handler import ContentHandler
import xml.sax
class countHandler(ContentHandler):
def __init__(self):
self.tags={}
def startElement(self, name, attr):
if not self.tags.has_key(name):
self.tags[name] = 0
self.tags[name] += 1
parser = xml.sax.make_parser()
handler... | {
"content_hash": "f839d2049129b77a2e08aa0055068380",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 42,
"avg_line_length": 26,
"alnum_prop": 0.6730769230769231,
"repo_name": "ActiveState/code",
"id": "c03b319d1624719ebeeaf45467bfb03b3a62cdba",
"size": "416",
"binary": f... |
"""
HTTP Title
==========
The ``httptitle`` plugin will print the ``<title>`` HTML element of every
linked posted.
Options
-------
- None
"""
import logging
import re
from lala.compat import html_unescape
from lala.util import regex, msg
from six.moves import html_parser
from twisted.web.client import getPage
from ... | {
"content_hash": "5f2911072e1a859a9cf77dc9a0571ff2",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 73,
"avg_line_length": 23.26086956521739,
"alnum_prop": 0.597196261682243,
"repo_name": "mineo/lala",
"id": "8bedcaa44387c262f33b4dff56da6cfa39da42ca",
"size": "1070",
"b... |
"""
routerid.py
Created by Thomas Mangin on 2012-07-17.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
"""
from exabgp.protocol.ip import IPv4
# ===================================================================== RouterID
#
class RouterID (IPv4):
@classmethod
def unpack (cls,data):
return cls('.'.... | {
"content_hash": "77ccce42ba2b13efc6d3ec02421a32a1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 22.375,
"alnum_prop": 0.5614525139664804,
"repo_name": "lochiiconnectivity/exabgp",
"id": "8ae5c99670b6af8170e58efe4c88987dbc6affb4",
"size": "376",
... |
"""A common interface to vxlapi functions."""
import logging
from sys import exit
from os import path
from glob import glob
from platform import architecture
from ctypes import WinDLL, c_char_p
vxl_base_path = r'C:\Users\Public\Documents\Vector\XL Driver Library'
xl_libs = glob(f'{vxl_base_path}*')
if ... | {
"content_hash": "2d26c81a41366c4ee48d73f4b966a570",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 79,
"avg_line_length": 34.6243654822335,
"alnum_prop": 0.6589942823632898,
"repo_name": "cmcerove/pyvxl",
"id": "aead40c748e8b8ba2360a80d6036aaf4d0908d72",
"size": "6844",... |
import json
import struct
import unittest
from mock import patch
from kiel.compression import snappy
@unittest.skipUnless(snappy.snappy_available, "requires python-snappy")
class SnappyCompressionTests(unittest.TestCase):
@patch.object(snappy, "snappy_available", False)
def test_compress_runtime_error_if_s... | {
"content_hash": "127af31d750f0331b3f630ef4f45dbe9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 28.56,
"alnum_prop": 0.5910364145658263,
"repo_name": "wglass/kiel",
"id": "8508ea2ca574d197a8cf2394c5738c526d7861ea",
"size": "1428",
"binary": fa... |
from __future__ import unicode_literals
from django.apps import AppConfig
class TaobaoConfig(AppConfig):
name = 'taobao'
# verbose_name_plural = '古董街'
verbose_name = '古董街'
| {
"content_hash": "31bb83a080e7bda30b0cf15fd4558cc3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 39,
"avg_line_length": 18.7,
"alnum_prop": 0.6951871657754011,
"repo_name": "lichengshuang/python",
"id": "94108003a501d02c96d8df84c91ee670b7234c20",
"size": "223",
"bina... |
import random
import time
from textcom import COVER_FLANKED, COVER_FULL, COVER_HALF, COVER_NONE, \
globals_hack_init
import textcom
from textcom.actions import AdvanceAction, \
EndTurnAction, \
... | {
"content_hash": "b438f72db4ceef138dcfc490a0c8c282",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 79,
"avg_line_length": 37.98198198198198,
"alnum_prop": 0.5121758380771664,
"repo_name": "flimberger/textcom",
"id": "a817d2a661ff17604ef1b198204ff48628ccef94",
"size": "1... |
import _plotly_utils.basevalidators
class X0Validator(_plotly_utils.basevalidators.AnyValidator):
def __init__(self, plotly_name="x0", parent_name="box", **kwargs):
super(X0Validator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop... | {
"content_hash": "805084f58be93d8ee8426bbc339ae982",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 35.45454545454545,
"alnum_prop": 0.6128205128205129,
"repo_name": "plotly/plotly.py",
"id": "7a3522b1a466ce1f55e4387302e8772ae8a5f994",
"size": "390"... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('foirequest', '0003_foirequest_reference'),
]
operations = [
migrations.AddField(
model_name='foirequest',
name='is_blocked',... | {
"content_hash": "8a66a8476aff95e01211bf5220c74ec1",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 77,
"avg_line_length": 23.11111111111111,
"alnum_prop": 0.6153846153846154,
"repo_name": "stefanw/froide",
"id": "e8c60b62fa169e5a99de7194eee00b320def6add",
"size": "440",
... |
from copy import deepcopy
from typing import Any, Dict, List
from ..utils.access_permissions import BaseAccessPermissions
from ..utils.auth import async_has_perm, async_in_some_groups
class MotionAccessPermissions(BaseAccessPermissions):
"""
Access permissions container for Motion and MotionViewSet.
"""
... | {
"content_hash": "ae30c5607bb06d5d95060c03c1a8516f",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 102,
"avg_line_length": 34.50335570469799,
"alnum_prop": 0.5915191596965571,
"repo_name": "emanuelschuetze/OpenSlides",
"id": "7e4a20bc5732b2bb05e7c65e0feea89737b4041e",
"... |
"""
Module test_creoconfig
UnitTest framework for validating CreoConfig
"""
import os
import base64
import unittest
from mock import patch
from creoconfig import Config
from creoconfig.storagebackend import (
MemStorageBackend,
XmlStorageBackend as FileStorageBackend
)
from creoconfig.exceptions import (
I... | {
"content_hash": "3cf17dfeb44e41dce1f90a8046783037",
"timestamp": "",
"source": "github",
"line_count": 713,
"max_line_length": 105,
"avg_line_length": 35.58485273492286,
"alnum_prop": 0.5936071259656314,
"repo_name": "patrickglass/creo",
"id": "50934297d547134a06ebe1419579447318ef1677",
"size": "2... |
import unittest
class TestContractParser(unittest.TestCase):
def test(self):
self.assertTrue(1)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "1eaa3dcbfc8d2b7b8c7f82dbf4e6e6d8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 44,
"avg_line_length": 15.9,
"alnum_prop": 0.6352201257861635,
"repo_name": "bahrmichael/eve-pos-taxer",
"id": "d2f9fdd789834403d54a8f892d2649cb0ca4fa3a",
"size": "159",
... |
"""
file : import LabelFindEngine
Функции поиска
создает карту главных меток
эталонная метка
_xxx<:><;()/t< >;русские буквы>
Форматирование можно сделать как callback
"""
import re
# own
from constants import *
from _label_purgers import purge_node
from _label_purgers import pur... | {
"content_hash": "97fc363fbd4995dd0fb1b9a7afe354d0",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 124,
"avg_line_length": 32.483050847457626,
"alnum_prop": 0.5830941821027915,
"repo_name": "zaqwes8811/micro-apps",
"id": "2c6f3bec6b4ea8db504cf809672fcede573c5f2b",
"size... |
import itertools
from typing import Optional, Tuple
import torch
from torch import Tensor
from .. import settings
from ..utils.broadcasting import _matmul_broadcast_shape
from ..utils.memoize import cached
from .lazy_tensor import LazyTensor
class BatchRepeatLazyTensor(LazyTensor):
def __init__(self, base_lazy_... | {
"content_hash": "9228317e9a645e1947596435c4a728de",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 119,
"avg_line_length": 47.52173913043478,
"alnum_prop": 0.6198888028714196,
"repo_name": "jrg365/gpytorch",
"id": "2f5bb5b577113575b27f21fb0f76c3558e8a7d67",
"size": "142... |
"""
Author : Syed Faizan ( 3rd Year IIIT Pune )
Github : faizan2700
Purpose : You have one function f(x) which takes float integer and returns
float you have to integrate the function in limits a to b.
The approximation proposed by Thomas Simpsons in 1743 is one way to calculate
integration.
( read article : https://... | {
"content_hash": "802ec92f7bc3d6dd525ff830e95255a2",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 86,
"avg_line_length": 31.436507936507937,
"alnum_prop": 0.6536228225195657,
"repo_name": "wuweilin/python",
"id": "da0e1cffde024490ee0b1d27750089a15a4c8cf3",
"size": "396... |
import sqlalchemy as sa
def upgrade(migrate_engine):
meta = sa.MetaData(bind=migrate_engine)
meter = sa.Table('meter', meta, autoload=True)
index = sa.Index('idx_meter_rid_cname', meter.c.resource_id,
meter.c.counter_name)
index.create(bind=migrate_engine)
def downgrade(migrate_... | {
"content_hash": "b15efa90032576432c945f5e5abded34",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 64,
"avg_line_length": 33.411764705882355,
"alnum_prop": 0.6549295774647887,
"repo_name": "tanglei528/ceilometer",
"id": "754eee7d6c309e46ae775aba133396feea7286dc",
"size":... |
import ctypes
import importlib
import logging
import os
import shutil
import click
import yaml
from context import Context
logging.basicConfig(format="%(asctime)-15s %(levelname)s: %(message)s")
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
class ElevationHelper:
@staticmethod
def assert_ele... | {
"content_hash": "81af1d45158b1f3a7c41aaba1c6a7c66",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 118,
"avg_line_length": 38.13793103448276,
"alnum_prop": 0.6300180831826402,
"repo_name": "sverhagen/backup-tool",
"id": "af8c79315af5a7e2213968ee7cf73509714bd043",
"size"... |
"""Client (Connection)."""
from __future__ import absolute_import, unicode_literals
import os
import socket
import sys
from collections import OrderedDict
from contextlib import contextmanager
from itertools import count, cycle
from operator import itemgetter
try:
from ssl import CERT_NONE
ssl_available = T... | {
"content_hash": "cb0b16994f41f2617f78cc05ab205e5d",
"timestamp": "",
"source": "github",
"line_count": 1011,
"max_line_length": 79,
"avg_line_length": 37.075173095944606,
"alnum_prop": 0.5833044313422084,
"repo_name": "kawamon/hue",
"id": "33090588ec129ecc8d30cd03a384790690f167e2",
"size": "37483"... |
from django.conf.urls import url
from django.utils.translation import gettext_lazy as _
from . import views
urlpatterns = [
url(_(r'^create/(?P<pk>[0-9]+)$'), views.order_create, name='order_create'),
url(r'^admin/order/(?P<order_id>\d+)/$', views.admin_order_detail,
name='admin_order_detail'),
] | {
"content_hash": "a0783455443d967ee447d22af54c76d2",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 77,
"avg_line_length": 30.3,
"alnum_prop": 0.6864686468646864,
"repo_name": "pauljherrera/avantiweb",
"id": "9f4093a85643e1be013ba5f36874cee3e2e28f41",
"size": "303",
"bi... |
import histopy
import datetime
import random
import json
import calendar
import re
import collections
import os
import sys
import argparse
def _to_int(input):
bc = re.compile(' BC\Z')
bce = re.compile(' BCE\Z')
slash = re.compile('/')
if (bc.search(input)):
return int(input[0:-3])
if (bce.s... | {
"content_hash": "fd07a93ae3ad465596932ac2902899cc",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 126,
"avg_line_length": 33.73913043478261,
"alnum_prop": 0.6662371134020618,
"repo_name": "mercer/histopy",
"id": "c3bfc53d5e6b0c7f5eb069e6c2beb5124690c3b0",
"size": "2372"... |
__author__ = 'auxiliary-character'
from wpilib.command import Command
import wpilib
import math
class Turn(Command):
"""Does some turning based on math, the navX, and a PID controller."""
def __init__(self, robot, angle):
super().__init__()
self.robot = robot
self.angle = angle
... | {
"content_hash": "ceb9e4b1b9cdd3c43dff5abf28a05337",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 98,
"avg_line_length": 32.36538461538461,
"alnum_prop": 0.6339869281045751,
"repo_name": "DenfeldRobotics4009/2015_Lopez_Jr",
"id": "deef7c7e38221264502bc36dd90dda72c5e4f1ae"... |
"""Handles parsing of Python code.
Parsing to AST is done via _ast on Python > 2.5, otherwise the compiler
module is used.
"""
from mako import exceptions, util, compat
from mako.compat import StringIO, arg_stringname
import operator
if compat.py3k:
# words that cannot be assigned to (notably
# smaller than ... | {
"content_hash": "9cfdaa4c96b4bad9f737acf4d36e1d1f",
"timestamp": "",
"source": "github",
"line_count": 566,
"max_line_length": 79,
"avg_line_length": 33.63604240282685,
"alnum_prop": 0.5169660678642715,
"repo_name": "talhajaved/nyuadmarket",
"id": "75301cc3b070b8bf5f4d1c31d03b41602b81f8c3",
"size"... |
from drdump import load
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def add_arguments(self, parser):
super(Command, self).add_arguments(parser)
parser.add_argument(
'manifest',
nargs='?',
default='./dumps/drdump.manifest',
... | {
"content_hash": "5df266994c647ae61549a01fcf1e6205",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 51,
"avg_line_length": 23.88888888888889,
"alnum_prop": 0.6093023255813953,
"repo_name": "emencia/dr-dump",
"id": "7d7e9f7c75542d79a50dc758585ba540e8d2a844",
"size": "455",... |
import DeepFried2 as df
import unittest
import numpy as np
class TestBackwardsConvolutionCUDNN(unittest.TestCase):
def testFwdBwd(self):
# Let's try fuzz-testing for that one, I hear good things about it!!
randint = np.random.randint
for _ in range(100):
B = randint(1, 10)
... | {
"content_hash": "28b58eee4c2055ec1cc13d770d957e7f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 165,
"avg_line_length": 39.18604651162791,
"alnum_prop": 0.571513353115727,
"repo_name": "lucasb-eyer/DeepFried2",
"id": "037e186ae7d3e8449a755ea6e820fff186ba1470",
"size":... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import range
from future import standard_library
standard_library.install_aliases()
import sys
PYTHON_VERSION = sys.version_info[:3]
PY2 = (PYTHON_VERSION[0... | {
"content_hash": "353299d7ceff352e99413553eec3735c",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 105,
"avg_line_length": 29.06122448979592,
"alnum_prop": 0.5962078651685393,
"repo_name": "ufcg-lsd/python-hpOneView",
"id": "01cb95f9cb41fba2a3c6ffc784a2e011021c1f03",
"si... |
import json
from django.http import HttpRequest
from django.test.utils import override_settings
from testcases import TestCaseWithFixture
class ViewsTestCase(TestCaseWithFixture):
def test_gets(self):
resp = self.client.get('/api/v1/', data={'format': 'json'})
self.assertEqual(resp.status_code, ... | {
"content_hash": "bfe2a7d2727c96d76ad9f88a15b82d2d",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 221,
"avg_line_length": 46.851985559566785,
"alnum_prop": 0.5833718600708891,
"repo_name": "Perkville/django-tastypie",
"id": "3ac3b7616799c37f0688c7a0d1a50d20f7b60212",
"... |
from __future__ import absolute_import
from .inverse_covariance import InverseCovarianceEstimator
from .quic_graph_lasso import (
quic,
QuicGraphLasso,
QuicGraphLassoCV,
QuicGraphLassoEBIC,
QuicGraphicalLasso,
QuicGraphicalLassoCV,
QuicGraphicalLassoEBIC,
)
from .metrics import log_likelihoo... | {
"content_hash": "4b0163d82cd6c023a43adf12f6c12733",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 27.62857142857143,
"alnum_prop": 0.7321613236814891,
"repo_name": "skggm/skggm",
"id": "67e15ef9d13003e0602862771f7d846de5a695ab",
"size": "967",
"... |
import sys
import os
import subprocess
from six import StringIO
import numpy as np
import pandas
import matplotlib
matplotlib.rcParams['text.usetex'] = False
import seaborn.apionly as seaborn
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
from matplotlib.testing.decorators import image_compariso... | {
"content_hash": "9cd963358920741380e809b30e0b9f2a",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 98,
"avg_line_length": 31.832460732984295,
"alnum_prop": 0.6359375,
"repo_name": "lucashtnguyen/wqio",
"id": "0b9bcebd25c9472e1972d89572a7a3b192845a2d",
"size": "12160",
... |
from __future__ import unicode_literals
from django.utils.six import StringIO
import sys
from django.apps import apps
from django.conf import settings
from django.core import checks
from django.core.checks import Error, Warning
from django.core.checks.registry import CheckRegistry
from django.core.checks.compatibilit... | {
"content_hash": "9b4416c1f542bae7f66abd63a992e37e",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 118,
"avg_line_length": 37.32706766917293,
"alnum_prop": 0.6205055896867762,
"repo_name": "liavkoren/djangoDev",
"id": "af407f5c7e34b334ede5c22f6abdb95e536c0762",
"size": ... |
import unittest
from conans.client.profile_loader import _load_profile
from conans.model.profile import Profile
from collections import OrderedDict
class ProfileTest(unittest.TestCase):
def profile_settings_update_test(self):
prof = '''[settings]
os=Windows
'''
new_profile, _ = _load_profile(pro... | {
"content_hash": "d0a945137116ea878105ca9fcc1e8bf4",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 115,
"avg_line_length": 41.52577319587629,
"alnum_prop": 0.547914597815293,
"repo_name": "tivek/conan",
"id": "51a00dfdc269ba34185f610daf4d5f95c6842cf5",
"size": "4028",
... |
import os
import sys
from importlib.abc import MetaPathFinder
from importlib.machinery import PathFinder
# Remove the first entry, because it's simply a directory entry that equals
# this directory.
del sys.path[0]
def _get_paths():
# Get the path to jedi.
_d = os.path.dirname
_jedi_path = _d(_d(_d(_d(_d... | {
"content_hash": "1ea3975e173697ff11ead783d5a43555",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 29.175,
"alnum_prop": 0.6658097686375322,
"repo_name": "glenngillen/dotfiles",
"id": "e1554334866beec20b714d1fcd2020dbc38646de",
"size": "1167",
"b... |
import logging
import socket
import sys
import json
from collections import defaultdict
from gevent import monkey, sleep
from volttron.platform.agent import utils
from volttron.platform.vip.agent import Agent, Core, RPC
from volttron.platform.scheduling import periodic
monkey.patch_socket()
utils.setup_logging()
log =... | {
"content_hash": "84f4a202be8d33fb921877b3a0366f12",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 123,
"avg_line_length": 37.96633663366337,
"alnum_prop": 0.5775830595107704,
"repo_name": "VOLTTRON/volttron-applications",
"id": "6c9662c77b4c594f7bee1cc2522d4884a881d8e6",... |
import json
import os
import requests
import sys
import django
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "museum.settings")
django.setup()
from django.contrib.auth.models import User
from museum_site.models import * # noqa: E402
fro... | {
"content_hash": "0f553f2b0f9ab5cd05a32bf841cfafe9",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 287,
"avg_line_length": 37.24074074074074,
"alnum_prop": 0.6556439582297364,
"repo_name": "DrDos0016/z2",
"id": "33e8e9d55a92c2f0d6b2d36ba0b3011e8a7a9a0e",
"size": "4022",... |
"""Performance metric in flops/cycle metric."""
from __future__ import division
def metric(data, **kwargs):
"""Performance in floating-point operations (flops) per cycle.
Computed as:
flops / cycles
flops: minimal required mathematical flop count
cycles: execution time in cycles (from time... | {
"content_hash": "8d1b7dc825191dd4ba4771b0d3137a09",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 25.285714285714285,
"alnum_prop": 0.664783427495292,
"repo_name": "elmar-peise/ELAPS",
"id": "aeb58e23948450be358aca7e07fc97b069ea0a15",
"size": "531... |
"""Tests for handling accessories on a Hue bridge via HomeKit."""
from tests.common import assert_lists_same, async_get_device_automations
from tests.components.homekit_controller.common import (
Helper,
setup_accessories_from_file,
setup_test_accessories,
)
async def test_hue_bridge_setup(hass):
"""... | {
"content_hash": "661b0ba0d5f493037557f08bb1171db8",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 87,
"avg_line_length": 37.93939393939394,
"alnum_prop": 0.6373801916932907,
"repo_name": "tchellomello/home-assistant",
"id": "67b7508eb94a87d403d4440505ac00100c71a676",
"s... |
from . import DictSource
class Defaults(DictSource):
def __init__(self, defaults=None, **kwargs):
"""
This source is initialized with a dict.
:param defaults: A dict with configuration keys and values. If
any values are dicts, these are turned into
... | {
"content_hash": "393599ca9b238b685868077c08d41b1f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 35,
"alnum_prop": 0.5563025210084034,
"repo_name": "staffanm/layeredconfig",
"id": "c7eef49c2d6f48d2664805a416ddf48f23581019",
"size": "595",
"bina... |
from pyvisdk.thirdparty import Enum
HostActiveDirectoryInfoDomainMembershipStatus = Enum(
'clientTrustBroken',
'inconsistentTrust',
'noServers',
'ok',
'otherProblem',
'serverTrustBroken',
'unknown',
)
| {
"content_hash": "002a0506c8b40555d58ff1664b62a2d3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 53,
"avg_line_length": 19.25,
"alnum_prop": 0.696969696969697,
"repo_name": "xuru/pyvisdk",
"id": "0222c64ebee2c09e0dd53eb216b1be9f49e5c4f3",
"size": "356",
"binary": fal... |
"""
Copyright (c) Bojan Mihelac and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this lis... | {
"content_hash": "385db5e595f3c4bee8327f2614c1311e",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 120,
"avg_line_length": 28.3,
"alnum_prop": 0.6540175142110923,
"repo_name": "gasman/wagtail",
"id": "1bf7778c97f8960afdbdd7112f596a301a87a5be",
"size": "6509",
"binary"... |
"""Unit tests for projection view."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import os
import numpy as np
import numpy.random as rnd
import pandas as pd
from kwiklib.dataio import Kluste... | {
"content_hash": "92eb40e841b80b58d044343db0f7656f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 35.51111111111111,
"alnum_prop": 0.5250312891113892,
"repo_name": "c-wilson/klustaviewa",
"id": "5dcb9ee3c02d1b95be9983e7803676e846efd813",
"size": "... |
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = 1000000L
settings = {}
pp = pprint.PrettyPrinter(indent=4)
class BitcoinRPC:
OBJID = 1
def __init__(self, host, port, username, passwo... | {
"content_hash": "0a9c93aa4868baed783ef8199d66f6a7",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 84,
"avg_line_length": 25.412244897959184,
"alnum_prop": 0.6451975586251205,
"repo_name": "Enticed87/Decipher",
"id": "e35e7a68a8f2c455e9f3f26cfc7ead891d46f5d5",
"size": "... |
import urllib2
from bs4 import BeautifulSoup
import sqlite3 as lite
import sys
soup = BeautifulSoup(urllib2.urlopen("http://www.truenorthhockey.com/asp_pages/Team.aspx?team_id=17178").read())
schedCount = range(1,len(soup.find_all('table')[10]) - 2)
gameSheets = []
# for i in schedCount:
# #Get the score sheets
#... | {
"content_hash": "b077db97e8cd6fc72316e19ed440d68b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 146,
"avg_line_length": 39.25,
"alnum_prop": 0.7038216560509554,
"repo_name": "ahosking/TrueNorthHockey",
"id": "5e8eac38cf549e5ddbd2a2b617be9101df3cf19e",
"size": "1256",
... |
import json
class DockerVolumes:
def __init__(self, docker):
self.docker = docker
async def list(self):
data = await self.docker._query_json("volumes")
return data
async def create(self, config):
config = json.dumps(config, sort_keys=True).encode("utf-8")
data = a... | {
"content_hash": "651fc933ec9e1fd74afd7081dfa6c3ef",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 85,
"avg_line_length": 27.058823529411764,
"alnum_prop": 0.5956521739130435,
"repo_name": "paultag/aiodocker",
"id": "0f954de4ed0675a5b318f8a99414f1ff879f1173",
"size": "92... |
from __future__ import absolute_import, division, print_function, unicode_literals
import importlib
import jmespath
from .core import ValueFilter, OPERATORS
class RelatedResourceFilter(ValueFilter):
schema_alias = False
RelatedResource = None
RelatedIdsExpression = None
AnnotationKey = None
F... | {
"content_hash": "d409b4e44cbacd5b97011344d8f1d5f7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 100,
"avg_line_length": 35.22549019607843,
"alnum_prop": 0.5894795435569162,
"repo_name": "kapilt/cloud-custodian",
"id": "5e0f78ffaa8cc8487f88f7725abc05d4f8a3cd77",
"size... |
from botty_mcbotface import log
from botty_mcbotface.botty.api import get_all_channels, get_all_users
from botty_mcbotface.botty.db import db_update_row, Channel, User
from botty_mcbotface.task_runner import bot_routine
HOURLY: int = 60 * 60
DAILY: int = 60 * 60 * 24
@bot_routine(DAILY, delay=15)
def populate_chann... | {
"content_hash": "2e0aab385bf6917c38d5a67c2d2a2a80",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 98,
"avg_line_length": 34.125,
"alnum_prop": 0.5714285714285714,
"repo_name": "ColumbiaSC-Tech/botty_mcbotface",
"id": "7087f39d3180a38f2e953ece0af4c254d29d2fb2",
"size": "... |
"""
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Usually you will have th... | {
"content_hash": "97ec4386544c1c6afdddbc1c12718ce7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 42.26923076923077,
"alnum_prop": 0.7998180163785259,
"repo_name": "thachhoang/log",
"id": "a2c9726a202ec232b8e6ec1dc804ef203cb9f462",
"size": "1099",... |
"""
A container format for storing k-mers, counts and associated information.
The container format of the container is a ZIP file. A container always
containts at least the two following files:
`__meta__`
which is a pickle format dictionary of meta-data. The user level
container object represents this at runti... | {
"content_hash": "ac2fccdabe023d60f29005781d0a19b8",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 73,
"avg_line_length": 28.787610619469028,
"alnum_prop": 0.6012911158930219,
"repo_name": "drtconway/pykmer",
"id": "6c546ee2c1c50ecf62df213da56b61d182bcab36",
"size": "32... |
import time
import numpy
import libopf_py
from scikits.learn import datasets, svm, metrics
digits = datasets.load_digits()
# To apply an classifier on this data, we need to flatten the image, to
# turn the data in a (samples, feature) matrix:
n_samples = len(digits.images)
data = digits.images.reshape((n_samples, -... | {
"content_hash": "a41c19172bed282e4852ef5468c8ccad",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 108,
"avg_line_length": 28.54054054054054,
"alnum_prop": 0.6586174242424242,
"repo_name": "victormatheus/LibOPF",
"id": "4cc14459d421055231ff33f4f44bb7110f8ff8ae",
"size": ... |
import pandas as pd
import os,subprocess,json
from igf_data.utils.fileutils import copy_remote_file,get_temp_dir,remove_dir,copy_local_file
from ehive.runnable.IGFBaseJobFactory import IGFBaseJobFactory
from igf_data.igfdb.collectionadaptor import CollectionAdaptor
class SeqrunFileFactory(IGFBaseJobFactory):
def par... | {
"content_hash": "2e42067b90083667eeec244813a8757b",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 133,
"avg_line_length": 41.47715736040609,
"alnum_prop": 0.5269856810671888,
"repo_name": "imperial-genomics-facility/data-management-python",
"id": "c6df83d61b4eb9997adc906... |
import os
import logging
import zmq
from common.logging_extra import SwagLogger, SwagFormatter
class LogMessageHandler(logging.Handler):
def __init__(self, formatter):
logging.Handler.__init__(self)
self.setFormatter(formatter)
self.pid = None
def connect(self):
self.zctx = zmq.Context()
sel... | {
"content_hash": "afe7e6b35adeaa8a434e25560148331d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 58,
"avg_line_length": 23.31578947368421,
"alnum_prop": 0.6805869074492099,
"repo_name": "heidecjj/openpilot",
"id": "012bb9380616fbc281a29dd0377a48a2cb853900",
"size": "88... |
import collections
class WordFilter(object):
def __init__(self, words):
"""
:type words: List[str]
"""
_trie = lambda: collections.defaultdict(_trie)
self.__trie = _trie()
for weight, word in enumerate(words):
word += '#'
for i in xrange(le... | {
"content_hash": "2a44b7179c723af26b44db05199f5aa3",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 111,
"avg_line_length": 28.25,
"alnum_prop": 0.48,
"repo_name": "kamyu104/LeetCode",
"id": "8c2eb8b23490c59a6b1d6fdd77f329d7be6cc8f4",
"size": "3712",
"binary": false,
... |
"""
Plugin-based system for enumerating available reactors and installing one of
them.
"""
from zope.interface import Interface, Attribute, implements
from twisted.plugin import IPlugin, getPlugins
from twisted.python.reflect import namedAny
class IReactorInstaller(Interface):
"""
Definition of a reactor wh... | {
"content_hash": "dff53ff64ea5684c3958135a6b66d681",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 78,
"avg_line_length": 24.354430379746834,
"alnum_prop": 0.685031185031185,
"repo_name": "normanmaurer/autobahntestsuite-maven-plugin",
"id": "6bae985b23e85a882e8c6e4af0d8a46... |
"""empty message
Revision ID: 2e3402f5e486
Revises: 133fb6418e26
Create Date: 2016-10-03 23:04:55.861848
"""
# revision identifiers, used by Alembic.
revision = '2e3402f5e486'
down_revision = '133fb6418e26'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"content_hash": "b256e5299da304907f105e481920dc5c",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 80,
"avg_line_length": 35.735849056603776,
"alnum_prop": 0.5575501583949314,
"repo_name": "liam-middlebrook/open-container",
"id": "38dbc35928af75b7c27448f292f28c25510237cc"... |
from api import load_forecast
| {
"content_hash": "95cb98753df6db0fa05af94754e0cc69",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 29,
"avg_line_length": 30,
"alnum_prop": 0.8333333333333334,
"repo_name": "vIiRuS/pisst.es",
"id": "af639911152b571ad0bf298695f30bc73023d19c",
"size": "30",
"binary": fals... |
import argparse
import copy
import sys
from ros_buildfarm.argument import add_argument_build_name
from ros_buildfarm.argument import add_argument_config_url
from ros_buildfarm.argument import \
add_argument_distribution_repository_key_files
from ros_buildfarm.argument import add_argument_distribution_repository_ur... | {
"content_hash": "5f8656ec951c9ef2fe5c36123ebb4030",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 76,
"avg_line_length": 36.829787234042556,
"alnum_prop": 0.7452339688041595,
"repo_name": "mistoll/ros_buildfarm",
"id": "7adfaa4cf580642d3dfdd6e05c45702625992518",
"size":... |
"""
Две модели биноминального распределения (N=2 и N=40)
Запуск:
python ./binominal.py
Пример визуализации возникновения событий в соответствии с биноминальным распределением.
Биномиальное распределение представляется как сумма исходов событий, которые следуют распределению Бернулли. Его параметры – n (в модели... | {
"content_hash": "c02488389f451be71a70d60d7c2e502f",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 196,
"avg_line_length": 26.954887218045112,
"alnum_prop": 0.707670850767085,
"repo_name": "vpv11110000/pyss",
"id": "24c0589a3e3bca528f9ca669986c6d7f68b51854",
"size": "42... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from django_registration.forms import RegistrationFormTermsOfService
class CustomUserForm(RegistrationFormTermsOfService):
"""Custom form to require users to add their first and last names when registering,
and t... | {
"content_hash": "3612080c9736256b577623fe034e41d8",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 98,
"avg_line_length": 44.888888888888886,
"alnum_prop": 0.7054455445544554,
"repo_name": "Signbank/FinSL-signbank",
"id": "33d2ef1f8559b44070ff64744d342bebb2456a5b",
"size... |
from glareclient.exc import * # noqa
| {
"content_hash": "7d71fb768a4a7c8258e46cbcb25b0326",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 37,
"avg_line_length": 38,
"alnum_prop": 0.7368421052631579,
"repo_name": "dshakhray/python-glareclient",
"id": "ef07de36421bcd614d97f288886dcabd06a35c96",
"size": "180",
... |
import logging
from django.core.management.base import BaseCommand, CommandError
from td_biblio.utils.loaders import BibTeXLoader
class Command(BaseCommand):
help = "Import entries from a BibTex file"
def _get_logger(self):
logger = logging.getLogger("td_biblio")
return logger
def add_... | {
"content_hash": "fe5ce3bd4ef309300cbcb2ef5c4f6cfe",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 83,
"avg_line_length": 30.06896551724138,
"alnum_prop": 0.6594036697247706,
"repo_name": "TailorDev/django-tailordev-biblio",
"id": "d73964a02cb7592396eb1acd791297919f72fe61"... |
from JumpScale import j
import JumpScale.baselib.key_value_store
import JumpScale.baselib.taskletengine
import JumpScale.baselib.specparser
import codegentools
import docgenerator
import docpreprocessor
import portal
import html
import portalloaders
from .macrolib import imagelib
| {
"content_hash": "89d43b8eeff2c157b93a5b2476e1b768",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 40,
"avg_line_length": 21.76923076923077,
"alnum_prop": 0.8692579505300353,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "6b5b63513fb260e5a48f6c261bd67909b86285dd",
"siz... |
import numpy as np
def beamsearch(predict, end, k=1, maxsample=400):
"""return k samples (beams) and their NLL scores, each sample is a sequence of labels,
all samples starts with an `empty` label and end with `eos` or truncated to length of `maxsample`.
You need to supply `predict` which returns the label prob... | {
"content_hash": "6e3c334aec66335c457b42e97b6605e9",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 106,
"avg_line_length": 42.875,
"alnum_prop": 0.6681243926141885,
"repo_name": "milankinen/c2w2c",
"id": "d28bc034bbb5332e337bef88f1c9c98e415b9c6a",
"size": "2223",
"bina... |
"""Test for tcrm.cloud_env_setup."""
import argparse
import os
import unittest
import mock
from gps_building_blocks.cloud.utils import cloud_api
from gps_building_blocks.cloud.utils import cloud_auth
from gps_building_blocks.cloud.utils import cloud_composer
from gps_building_blocks.cloud.utils import cloud_storage
... | {
"content_hash": "e70024778b66087b80a37dfd285be142",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 80,
"avg_line_length": 36.58181818181818,
"alnum_prop": 0.7102385685884692,
"repo_name": "google/TaglessCRM",
"id": "0cddd4daff07b294114066cf90d906d6577dc029",
"size": "46... |
from django.test.client import Client
from ..documents import Test001Parent
from ..forms import (Test002StringFieldForm, Test003FormFieldOrder,
Test004StringFieldForm)
from testprj.tests import MongoengineTestCase
class MongoformsRegressionTests(MongoengineTestCase):
def test001_possible_changes_loose_in_R... | {
"content_hash": "f39ba4f0654d3e8101d4d1da8e9280e0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 76,
"avg_line_length": 37.11864406779661,
"alnum_prop": 0.6547945205479452,
"repo_name": "stephrdev/django-mongoforms",
"id": "e98504dcce9eced83a929c2abd583af1e8b9e5af",
"s... |
from kid_readout.interactive import *
from kid_readout.equipment import hardware
from kid_readout.measurement import acquire
from kid_readout.roach import analog
from kid_readout.equipment import agilent_33220
import time
fg = agilent_33220.FunctionGenerator(addr=('192.168.0.202', 5025))
fg.set_load_ohms(1000)
fg.set_... | {
"content_hash": "6d4602d98920ea09e3e1f5d97bfd680a",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 124,
"avg_line_length": 38.544444444444444,
"alnum_prop": 0.6200634188526953,
"repo_name": "ColumbiaCMB/kid_readout",
"id": "953fa49b2d43db0c408b24ad8679a5c0bd7ea998",
"siz... |
from .air_temperature import AirTemperatureParser
from .cloudiness import CloudinessParser
from .sun import SunshineParser
from .precipitation import PrecipitationParser
from .wind import WindParser
from .soil_temperature import SoilTemperatureParser
from .pressure import PressureParser
from .solar import SolarRadiatio... | {
"content_hash": "d622150bf51f93719b2eb112143e3766",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 90,
"avg_line_length": 30.479166666666668,
"alnum_prop": 0.6500341763499659,
"repo_name": "mfelsche/dwd_weather_data",
"id": "5ee501d3d71bc6eca62125dcc799b4a40be891a4",
"si... |
"""
Command-line interface to the Neutron APIs
"""
from __future__ import print_function
import argparse
import getpass
import inspect
import itertools
import logging
import os
import sys
from keystoneclient.auth.identity import v2 as v2_auth
from keystoneclient.auth.identity import v3 as v3_auth
from keystoneclient... | {
"content_hash": "bea5b028c6d49dfe3c4a4061df17d7d4",
"timestamp": "",
"source": "github",
"line_count": 1009,
"max_line_length": 79,
"avg_line_length": 42.7998017839445,
"alnum_prop": 0.6188954498089615,
"repo_name": "roaet/python-neutronclient",
"id": "9c3a804c06233e7ee3c1d0bf386abe5959c32156",
"s... |
""" Bayesian Representational Similarity Analysis (BRSA)
This implementation is based the work in [Cai2016]_.
.. [Cai2016] "A Bayesian method for reducing bias in neural
representational similarity analysis",
M.B. Cai, N. Schuck, J. Pillow, Y. Niv,
Advances in Neural Information Processing Systems 29... | {
"content_hash": "a581b147d35a492ef9c0c779cf1bb0bb",
"timestamp": "",
"source": "github",
"line_count": 4183,
"max_line_length": 123,
"avg_line_length": 50.555343055223524,
"alnum_prop": 0.5634525447693086,
"repo_name": "IntelPNI/brainiak",
"id": "3c912309d6be2eac35f16a1095b77a60516bb211",
"size": ... |
import unittest
import mock
from requests import models, exceptions
from ballast import ping, Service, LoadBalancer
from ballast.util import UrlBuilder
from ballast.discovery import Server
from ballast.discovery.static import StaticServerList
from ballast.exception import (
BallastException,
NoReachableServers,... | {
"content_hash": "346913efd568a5307adf9ff3e5545623",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 93,
"avg_line_length": 42.98322147651007,
"alnum_prop": 0.6810055429775939,
"repo_name": "thomasstreet/ballast",
"id": "d893d1d8b322862003f5cf6747075332ae76fa0f",
"size": ... |
from troveclient import base
from troveclient import databases
from troveclient.common import check_for_exceptions
from troveclient.common import limit_url
from troveclient.common import Paginated
from troveclient.common import quote_user_host
import urlparse
class User(base.Resource):
"""
A database user
... | {
"content_hash": "a898c67dd85bdf561616a64dd08815b5",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 78,
"avg_line_length": 38.984848484848484,
"alnum_prop": 0.6020209871745045,
"repo_name": "citrix-openstack/build-python-troveclient",
"id": "f77a8c93026ba3bc74cf5767ccd7b8c... |
import sys
import pdb
import psycopg2
from sqlalchemy import create_engine
from sqlalchemy.pool import NullPool
from datetime import datetime, date, timedelta
from datetime import time as dttime
from collections import deque, defaultdict
from dateutil.parser import parse as dateparse
from browser.auth import *
from s... | {
"content_hash": "0e5fc9119390fd330e43f991ff15775d",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 112,
"avg_line_length": 26.690140845070424,
"alnum_prop": 0.6237467018469657,
"repo_name": "datahuborg/datahub",
"id": "74e6efa1b5d9454cda09fa067de97b1d256f2cd1",
"size": "... |
import binascii
import sys
import pynats
import json
import Adafruit_PN532 as PN532
# Setup how the PN532 is connected to the Raspbery Pi/BeagleBone Black.
# It is recommended to use a software SPI connection with 4 digital GPIO pins.
# Configuration for a Raspberry Pi:
CS = 17 # GPIO 17, Pin# 11
MOSI = 27 # GP... | {
"content_hash": "aa8229794e337ce86a567ae81e1d1e43",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 89,
"avg_line_length": 28.875,
"alnum_prop": 0.6470418470418471,
"repo_name": "project-humix/humix-sense-nfc",
"id": "4fce28a3c42878103d1db0d72becba6da00dca20",
"size": "4... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | {
"content_hash": "8d3cb33704ff1e7618a7848671f6587a",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 126,
"avg_line_length": 36.73684210526316,
"alnum_prop": 0.5545715029955718,
"repo_name": "Quikling/gpdb",
"id": "62632d07fbec61396b9f199a3518e46ccf03463e",
"size": "7678"... |
from .subscription import Subscription
from .events import Events
| {
"content_hash": "b2dd489d3f2a4801fdf3b01fe315dc55",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 38,
"avg_line_length": 33,
"alnum_prop": 0.8484848484848485,
"repo_name": "ringcentral/ringcentral-python",
"id": "d3f597c524664ec6dd37681639d6e9f1409e04d5",
"size": "107",
... |
from __future__ import unicode_literals
from ..model import FitGLM
def test_FitGLM_inputs():
input_map = dict(TR=dict(mandatory=True,
),
drift_model=dict(usedefault=True,
),
hrf_model=dict(usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
mask=dict(),
... | {
"content_hash": "a9490ba7ea95e576a5d7834b2385c4c4",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 67,
"avg_line_length": 24.254901960784313,
"alnum_prop": 0.6151980598221504,
"repo_name": "mick-d/nipype",
"id": "5c3f881179fac9ab6ac52179f8373d5562ad9ddf",
"size": "1291",... |
"""
sqmpy.job.constants
~~~~~~~~~~~~~~~~
Constants to be used in job package
"""
from enum import Enum, unique
import saga
__author__ = 'Mehdi Sadeghi'
JOB_MANAGER = 'sqmpy.job.manager'
# TODO Could be replaced with Enum class in python 3.4 (is back ported)
class JobStatus(object):
"""
Represe... | {
"content_hash": "4171a11c66f020f308bf9d8a2e10ea4a",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 18.25423728813559,
"alnum_prop": 0.6146703806870938,
"repo_name": "mehdisadeghi/sqmpy",
"id": "dc4391b5058752599e46e0975e808497cb9f05b0",
"size": "10... |
import os
import subprocess
import unittest
from glob import glob
from shutil import move
from tempfile import mkdtemp
from airflow.utils import db as db_utils
from airflow import models, AirflowException, LoggingMixin
from airflow.utils.timezone import datetime
from tests.contrib.utils.gcp_authenticator import GcpAut... | {
"content_hash": "ad4d5c2b664a35dbec25bcd90f8476f2",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 89,
"avg_line_length": 40.93801652892562,
"alnum_prop": 0.6037145452710205,
"repo_name": "adamhaney/airflow",
"id": "d4b0359d949225a3d7c1aa0294cc6d5e19dc1fa7",
"size": "10... |
def log_message(func):
def func_wrapper(name):
f = open("tmp/temp.txt","w")
f.write(name)
f.close()
return func_wrapper
@log_message
def get_text(name):
return "lorem ipsum, {0} dolor sit amet".format(name)
get_text("John")
# Outputs <p>lorem ipsum, John dolor sit amet</p> | {
"content_hash": "05893f4b3067abf8503aa2313d7a00aa",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 56,
"avg_line_length": 20.466666666666665,
"alnum_prop": 0.6286644951140065,
"repo_name": "vinitraj10/Java",
"id": "581e75268c73d5e7be84139f3805dc1bc820ea9a",
"size": "307"... |
"""
Cache driver that uses xattr file tags and requires a filesystem
that has atimes set.
Assumptions
===========
1. Cache data directory exists on a filesytem that updates atime on
reads ('noatime' should NOT be set)
2. Cache data directory exists on a filesystem that supports xattrs.
This is optional, but hi... | {
"content_hash": "5d17ed764e0e62636b6a05be96ce48a2",
"timestamp": "",
"source": "github",
"line_count": 490,
"max_line_length": 79,
"avg_line_length": 33.09183673469388,
"alnum_prop": 0.5820536540240518,
"repo_name": "tanglei528/glance",
"id": "eef892ce3365fc1b94fcdaf264073d2f3339511a",
"size": "16... |
from flask import session, request, jsonify, abort
import json
import csv
from os import path
from math import floor
data = None
data_path = None
base_route = "/api/classification/"
def load(opts):
if opts.input_data != None:
preserve_fields = set()
# check to see if a data field has been defined... | {
"content_hash": "031a5a0f028f8116fd280f9b679308ab",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 97,
"avg_line_length": 30.202898550724637,
"alnum_prop": 0.5683781190019194,
"repo_name": "jghibiki/corpusaurus",
"id": "ce0cf1c4c2776cac3b931d00aca95e517441a5d9",
"size":... |
from django.conf.urls.defaults import *
from django.conf import settings
# Guidy views
urlpatterns = patterns('guidy.views',
url(r'^$', 'guidy_default', name='guidy-default'),
url(r'^login/$', 'guidy_login', name='guidy-login'),
url(r'^logout/$', 'guidy_logout', name='guidy-logout'),
url(r'^guidy/$', '... | {
"content_hash": "4194e7ac2675d7bf36e98be9c92dc26d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 83,
"avg_line_length": 39.291666666666664,
"alnum_prop": 0.6574761399787911,
"repo_name": "prabhu/invoicy",
"id": "fe3be45a420ecbecda11ebc805309442df717b7d",
"size": "943",... |
'''OpenGL extension SGI.depth_pass_instrument
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_SGI_depth_pass_instrument'
_DEPRECATED = False
GL... | {
"content_hash": "ccfda97414f6374c443844b6f46769ee",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 110,
"avg_line_length": 43.77777777777778,
"alnum_prop": 0.7868020304568528,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "28633fbe72795b107acc53700fd2df930b9cc4f2... |
from django.http import HttpResponse
from django.shortcuts import render
from django_nose.tools import (
assert_equal,
assert_code,
)
from mock import patch
from pontoon.base.tests import (
LocaleFactory,
ResourceFactory,
TranslationFactory,
)
from pontoon.base.tests.test_views import ViewTestCa... | {
"content_hash": "22e36f8bdae81d9fa10e2b6c0bbab31f",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 93,
"avg_line_length": 32.91860465116279,
"alnum_prop": 0.6103850229600848,
"repo_name": "mastizada/pontoon",
"id": "556e82a5890137c77a11f8938032a697de25fe76",
"size": "283... |
"""
Scrapes tool headers for documentation.
"""
import importlib
from pathlib import Path
with open('index.md', 'w') as handle:
with open('index.md.template') as template:
print(template.read(), file=handle)
import pdbtools
modfile = Path(pdbtools.__file__)
for f in sorted(list(modfile.paren... | {
"content_hash": "4c89de60f3dc173b81efca9deba4c3a8",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 97,
"avg_line_length": 33.61818181818182,
"alnum_prop": 0.5646295294753921,
"repo_name": "haddocking/pdb-tools",
"id": "b47a66c787f26374f270349a8ea1e7ed5de497f1",
"size": "... |
import gc
import platform
import time
import threading
import pytest
from kafka import KafkaConsumer, KafkaProducer, TopicPartition
from kafka.producer.buffer import SimpleBufferPool
from test.testutil import env_kafka_version, random_string
def test_buffer_pool():
pool = SimpleBufferPool(1000, 1000)
buf1 ... | {
"content_hash": "35357e74b2cb1160f0aaa3a6585113d8",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 100,
"avg_line_length": 33.4014598540146,
"alnum_prop": 0.615166083916084,
"repo_name": "wikimedia/operations-debs-python-kafka",
"id": "9605adf58ab3a58059b94d75ac0152ea9817... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Static(A10BaseClass):
"""Class Description::
static ARP Commands.
Class static supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param vlan: {"description": "VLAN ... | {
"content_hash": "061502c131f46a2322dc69cc90c9a9e3",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 168,
"avg_line_length": 40.43478260869565,
"alnum_prop": 0.6059139784946237,
"repo_name": "amwelch/a10sdk-python",
"id": "f7e200517a33fe72f9283fc1363f4e5b656e1a0b",
"size":... |
from django.utils import timezone
from django.db.models import Max
from django.core.exceptions import ValidationError
from breach.analyzer import decide_next_world_state
from breach.backtracking_analyzer import decide_next_backtracking_world_state
from breach.models import Target, Round, SampleSet
from breach.sniffer ... | {
"content_hash": "58cef1b6b2804273e6730b548048d838",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 143,
"avg_line_length": 41.23481116584565,
"alnum_prop": 0.6203806944886907,
"repo_name": "dionyziz/rupture",
"id": "c68d2c3f6810c792931702abbb0380c918ff30f7",
"size": "25... |
import inspect
import logging
import traceback
import cactus
from cactus.tasks import BaseTask
import re
import os
import sys
def import_tasks():
imported_tasks = {}
basedir = os.path.dirname(__file__)
plugindir = os.path.join(basedir, "tasks")
parentmodule = "cactus.tasks"
if os.path.isdir(plugin... | {
"content_hash": "d1d4890b212d380e691f2231c4ee08de",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 31.61111111111111,
"alnum_prop": 0.476713532513181,
"repo_name": "randomknowledge/Cactus_Refactored",
"id": "c0322133315887093b716e23160cc06dce3e1ed2",... |
r"""
======================
CIA XML-RPC Notifier
======================
This notifier delivers a notification message in XML format
to a `CIA server`_\. The data delivered
contains in particular:
- The timestamp of the revision
- Information about the generator (svnmailer)
- Information about the project (``cia_proj... | {
"content_hash": "afafd82057da331edf8905b4ab4036b1",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 78,
"avg_line_length": 30.773364485981308,
"alnum_prop": 0.5528813301951256,
"repo_name": "m-tmatma/svnmailer",
"id": "2a02440f4d10e4637dad066a7ecd5321cc7f7092",
"size": "... |
from collections import defaultdict
import json
import io
from cadnano.document import Document
from cadnano.enum import LatticeType, StrandType
from cadnano.color import Color
import cadnano.preferences as prefs
from cadnano import setBatch, getReopen, setReopen
from cadnano.part.refresholigoscmd import RefreshOligos... | {
"content_hash": "bb82ebbf80e1e80484e9f53b972ab3b3",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 99,
"avg_line_length": 40.907120743034056,
"alnum_prop": 0.5748883675168395,
"repo_name": "JMMolenaar/cadnano2.5",
"id": "39a1fb2a5db673a311971d6a05d8f77dd4ad7e21",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.