text stringlengths 4 1.02M | meta dict |
|---|---|
import pytest
from baluster import Baluster, placeholders
class CompositeRootCase(Baluster):
_value = 0
_closed = False
_closed_resources = None
place = placeholders.value()
place_with_default = placeholders.value(1)
place_with_callable = placeholders.value(lambda: 1)
@placeholders.fa... | {
"content_hash": "90c849fe83caca80bd377bbaa7887af1",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 56,
"avg_line_length": 25.029411764705884,
"alnum_prop": 0.5967097532314923,
"repo_name": "palankai/baluster",
"id": "913a6e2f7120460145669d7cfc28137b509c6108",
"size": "4... |
"""Tests for process_profiles.py."""
import collections
import unittest
import process_profiles
from test_utils import (ProfileFile,
SimpleTestSymbol,
TestSymbolOffsetProcessor,
TestProfileManager)
class ProcessProfilesTestCase(unittest.TestCas... | {
"content_hash": "b9372c93e2ccc5711e2552dbc9f82efe",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 79,
"avg_line_length": 43.390946502057616,
"alnum_prop": 0.6067905918057663,
"repo_name": "ric2b/Vivaldi-browser",
"id": "5c07797d50848ffd9f7017f2734949ba102b5372",
"size"... |
"""Stuff that everybody else needs to know about."""
PLATFORM_WINDOWS_STARTS_WITH = 'win32'
PLATFORM_LINUX_STARTS_WITH = 'linux'
PLATFORM_MACOS_STARTS_WITH = 'darwin'
SEPRTR = ':' # Delimiter between library:component, distributor:field, etc.
# Default language used by GUI and spreadsheet generation and number pres... | {
"content_hash": "f76445366390b649ae1f7426cf24df27",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 95,
"avg_line_length": 41.22857142857143,
"alnum_prop": 0.6465696465696466,
"repo_name": "hildogjr/KiCost",
"id": "b3dd191bac1943bb3b45865b6e5124bdf5dae78f",
"size": "5495... |
def extractTheabyssdreamsBlogspotCom(item):
'''
Parser for 'theabyssdreams.blogspot.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
... | {
"content_hash": "1491907a8f3b8a964f5df40b99088fc9",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 26.904761904761905,
"alnum_prop": 0.6389380530973451,
"repo_name": "fake-name/ReadableWebProxy",
"id": "131ae392887c6d395cf4873fda15bb456be94dfb",
"... |
import os
import gym
import numpy as np
import tensorflow as tf
from gym import spaces
from collections import deque
def sample(logits):
noise = tf.random_uniform(tf.shape(logits))
return tf.argmax(logits - tf.log(-tf.log(noise)), 1)
def cat_entropy(logits):
a0 = logits - tf.reduce_max(logits, 1, keep_dim... | {
"content_hash": "8a2c4b6838ca4a6de4179f7ee4263e01",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 148,
"avg_line_length": 37.666666666666664,
"alnum_prop": 0.5880270692347735,
"repo_name": "feiwang3311/baseline",
"id": "c80f4d412a5dc49eab8629af9f8cd17b223cc317",
"size"... |
"""
Option Parser sorting module.
This module implements a sorting method for options in a
configuration file.
"""
from operator import itemgetter, attrgetter, methodcaller
class Options:
"""
Collection of options.
"""
def __init__(self):
self.options = []
def insert(self, option):
... | {
"content_hash": "959f1ada5df2f72b8fe3328f0bfe207e",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 68,
"avg_line_length": 26.055555555555557,
"alnum_prop": 0.5540156361051883,
"repo_name": "josrolgil/exjobbCalvin",
"id": "a7ff09acaa9696ef8176ce3ba8ff4f3de2cc24ac",
"size... |
"""Internal information about the audio plugin."""
from tensorboard.compat.proto import summary_pb2
from tensorboard.plugins.audio import plugin_data_pb2
PLUGIN_NAME = "audio"
# The most recent value for the `version` field of the `AudioPluginData`
# proto.
PROTO_VERSION = 0
# Expose the `Encoding` enum constants.... | {
"content_hash": "e000573d75a3fd2edfbe5eed83d6e1bf",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 72,
"avg_line_length": 29.017857142857142,
"alnum_prop": 0.696,
"repo_name": "tensorflow/tensorboard",
"id": "5ab35efb162b36b60e99681a5b3b1a92dbda9462",
"size": "2314",
"... |
import sys
input_file = sys.argv[1]
##### FASTA File
if (input_file.endswith('fastq')):
from fastAQ.fastqInfo import FastqParser
out = FastqParser(input_file)
### Print sequence names
def seqNames():
return out.seqNames()
## Get sequences for the names in the file.
def seq():
try:
nameFile = open(sys.a... | {
"content_hash": "a4e0be7372bb6463b3da7b9d46f16c39",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 124,
"avg_line_length": 22.322916666666668,
"alnum_prop": 0.6768548763415773,
"repo_name": "Jverma/fastAQ",
"id": "bcd833f8c03c55493f2d08236980c63ff6c22f86",
"size": "4286... |
MAX_MAP_ASYNC_THREADS = 20
try:
import Queue
except ImportError:
import queue as Queue
import sys
import threading
try:
import eventlet
import eventlet.greenpool
import eventlet.tpool
import eventlet.patcher
_has_eventlet = True
import eventlet.debug
eventlet.debug.hub_exceptions... | {
"content_hash": "d01f8843739791aefd91d1a7986db93e",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 120,
"avg_line_length": 32.12232415902141,
"alnum_prop": 0.5632140137090632,
"repo_name": "vrsource/mapproxy",
"id": "f0e98c0a0018e3a24d140d81e4c972a246a0aea7",
"size": "1... |
from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union
from msrest import Serializer
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import Pipelin... | {
"content_hash": "e04b9b472dc536e616bc49f9a3325037",
"timestamp": "",
"source": "github",
"line_count": 597,
"max_line_length": 216,
"avg_line_length": 42.93634840871022,
"alnum_prop": 0.6424921000273085,
"repo_name": "Azure/azure-sdk-for-python",
"id": "ec3d2a7980104cff01c152a1c6741b71820705ef",
"... |
from django import template
from django.conf import settings
from django.db import models
from django.contrib.comments import Comment, CommentForm
import re
from datetime import datetime
import urllib
from django.utils.html import conditional_escape
from django.utils.safestring import mark_safe
Post = models.get_mo... | {
"content_hash": "bc144eeb4e114e1ed9ebffca3a51f449",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 109,
"avg_line_length": 30.331550802139038,
"alnum_prop": 0.5424894217207334,
"repo_name": "HM2MC/Webfront",
"id": "76a5fabd42ddcfeeded3942c1fc1b523bf0dfd12",
"size": "567... |
import argparse
import os
import logging
import platform
import re
import subprocess
import urllib2
import json
from core import path_util
from telemetry import benchmark
from telemetry.core import discover
from telemetry.util import command_line
from telemetry.util import matching
CHROMIUM_CONFIG_FILENAME = 'tools... | {
"content_hash": "40c66e971ecf880e23bee930ec114546",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 80,
"avg_line_length": 36.676537585421414,
"alnum_prop": 0.6371032855102168,
"repo_name": "was4444/chromium.src",
"id": "79a009b501bbb822672c66e58ad3292efcef5aa1",
"size":... |
"""
:codeauthor: Mike Place <mp@saltstack.com>
"""
import errno
import logging
import os
import threading
import pytest
import salt.config
import salt.exceptions
import salt.ext.tornado.gen
import salt.ext.tornado.ioloop
import salt.ext.tornado.testing
import salt.transport.ipc
import salt.utils.platform
from s... | {
"content_hash": "c9a09d4e2f664abcb926fc81c814f69a",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 85,
"avg_line_length": 29.10967741935484,
"alnum_prop": 0.5966312056737588,
"repo_name": "saltstack/salt",
"id": "21ffb6aeecc281f9e3b104b6293de7670fd3c9c0",
"size": "4512"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wooey', '0043_update_model_protection'),
]
operations = [
migrations.AlterField(
model_name='scriptparameter',
name='choices',
field=models.TextField(bla... | {
"content_hash": "844fac94c7a77d73e7550cac0b903dc0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 22.375,
"alnum_prop": 0.5893854748603352,
"repo_name": "wooey/Wooey",
"id": "5ec89bd9bd5a542450a4c8d1fe710bfd3cfd64ff",
"size": "407",
"binary": fa... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "9a58ce0adb56cfbfddb5e06dea4262eb",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 123,
"avg_line_length": 31.814285714285713,
"alnum_prop": 0.7260889088459811,
"repo_name": "mahabs/nitro",
"id": "64d52a2fd61285596c84762930b1e59c7158ba28",
"size": "2841",... |
import json
import mock
import os
import tempfile
import testtools
from glanceclient.common import utils
from glanceclient.v2 import shell as test_shell
class ShellV2Test(testtools.TestCase):
def setUp(self):
super(ShellV2Test, self).setUp()
self._mock_utils()
self.gc = self._mock_glance_... | {
"content_hash": "ccb978f09d8818b7725b5f2cdd483eab",
"timestamp": "",
"source": "github",
"line_count": 1083,
"max_line_length": 79,
"avg_line_length": 43.43582640812558,
"alnum_prop": 0.5021364341744435,
"repo_name": "mmasaki/python-glanceclient",
"id": "d5868055c1ead07b807826581f1aa1277b13fc13",
... |
from numpy import *
import theano
import theano.tensor as T
import theano.typed_list as tl
import theano.sparse as sparse
from scipy.misc import logsumexp
from scipy.optimize import fmin_ncg
import scipy.sparse as sp
import time
"""
Explore how to implement custom theano ops.
For now Python only
"""
class MySoftmax(t... | {
"content_hash": "632e731a50f5ede7a5bbd298bcaa1deb",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 126,
"avg_line_length": 26.064935064935064,
"alnum_prop": 0.672645739910314,
"repo_name": "yjk21/theano-hsm",
"id": "f8726fcbdda1ef9c008edc9a5c67af19eec33ecb",
"size": "200... |
from bingads.v13.bulk.entities import *
from bingads.service_client import _CAMPAIGN_OBJECT_FACTORY_V13
from bingads.v13.internal.bulk.entities.single_record_bulk_entity import _SingleRecordBulkEntity
from bingads.v13.internal.bulk.mappings import _SimpleBulkMapping
from bingads.v13.internal.bulk.string_table import _S... | {
"content_hash": "61da2b70b6335438c67f2dc79c9d5b29",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 117,
"avg_line_length": 43.68421052631579,
"alnum_prop": 0.6913253012048193,
"repo_name": "bing-ads-sdk/BingAds-Python-SDK",
"id": "483455318348a35df7f18d33e94f9f5c0ca92c4f",... |
__author__ = 'Tom Schaul, tom@idsia.ch and Daan Wiertra, daan@idsia.ch'
from scipy import zeros, array, mean, randn, exp, dot, argmax
from pybrain.datasets import ReinforcementDataSet, ImportanceDataSet, SequentialDataSet
from pybrain.supervised import BackpropTrainer
from pybrain.utilities import drawIndex
from pybr... | {
"content_hash": "a5734508f5251d16181e5e4c837cc608",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 99,
"avg_line_length": 36.88844621513944,
"alnum_prop": 0.5258667242682795,
"repo_name": "rbalda/neural_ocr",
"id": "9bf200924e774ac46f783861cf1d549e47b9a7b3",
"size": "92... |
import time
from os import environ
from twisted.internet import reactor
from twisted.internet.defer import DeferredList
from autobahn.twisted.wamp import ApplicationSession, ApplicationRunner
class Component(ApplicationSession):
"""
An application component using the time service.
"""
def onJoin(se... | {
"content_hash": "c2f551f34aadb61ac0beb2362413dd0a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 71,
"avg_line_length": 26.6875,
"alnum_prop": 0.6057767369242779,
"repo_name": "dash-dash/AutobahnPython",
"id": "47042523aab52d11c6fb38a1d22969612c46ed03",
"size": "2558",... |
from mysql_sqlalchemy_class import *
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import backref, mapper, relation, sessionmaker
from elixir import *
from sqlalchemy import *
from AnagraficaDb ... | {
"content_hash": "263add5d3bca1a9d9093d0e82cc2632c",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 178,
"avg_line_length": 27.2442996742671,
"alnum_prop": 0.7158058345289335,
"repo_name": "arpho/mmasgis5",
"id": "0de42fbf371b84da6711eff689abd4b91a92bdcc",
"size": "8412"... |
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
from urllib.parse import parse_qs, urljoin, urlparse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
m... | {
"content_hash": "30ccf7475c25c593b6a0114279a3a6a2",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 252,
"avg_line_length": 44.04081632653061,
"alnum_prop": 0.6459263627938326,
"repo_name": "Azure/azure-sdk-for-python",
"id": "573200dfc939987d2082c22cab4ce5292471cd17",
"... |
"""
server config.
"""
from basinboa.system.loader import YamlLoader
class Config(object):
"""docstring for Config"""
def __init__(self, name):
super(Config, self).__init__()
self.name = name
self.items = 0
def __repr__(self):
return "Config: %s, items: %s" % \
... | {
"content_hash": "250d419919d8b5cf207df34275abb66f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 57,
"avg_line_length": 24.2,
"alnum_prop": 0.5572609208972845,
"repo_name": "marlboromoo/basinboa",
"id": "6fd650639d92b5fe43e5c213088ad9b263e80566",
"size": "869",
"bina... |
"""Test for a simple Mifare NFC Authentication"""
# Pynfc is a python wrapper for the libnfc library
# Copyright (C) 2009 Mike Auty
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; eithe... | {
"content_hash": "41da2cf54352e6fb60bc1d64fbdd589d",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 116,
"avg_line_length": 44.18808777429467,
"alnum_prop": 0.5554767309875142,
"repo_name": "kikiorg/TikiBot",
"id": "f6291ab7490d5caf2387884fb03a15f0db5f2932",
"size": "140... |
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import versioneer
if sys.version_info[:2] < (2, 7):
sys.exit("conda is only meant for Python 2.7, with experimental support "
"for python 3. current version: %d.%d" % sys.version_info[:2])
ve... | {
"content_hash": "651d1dc7b43102169fb41ee2d1a7c989",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 77,
"avg_line_length": 30.88888888888889,
"alnum_prop": 0.6145083932853717,
"repo_name": "takluyver/conda-build",
"id": "2e002ed496e08e597816575c4c839914739771ea",
"size": ... |
import rospy
from std_msgs.msg import String
def callback(data):
rospy.loginfo(rospy.get_name() + ': I heard {}'.format(data.data))
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber('chatter', String, callback)
rospy.spin()
if __name__ == '__main__':
listener()
| {
"content_hash": "b1300e7fbfb1867a93d8ca15a2060a88",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 70,
"avg_line_length": 20.933333333333334,
"alnum_prop": 0.6496815286624203,
"repo_name": "wkentaro/beginner_tutorials",
"id": "7416dfe18872dde4dcf52588a08b64ab1d528842",
"... |
def scale_dataset(x_train):
return x_train
def build_model(weights_path=None):
import os
from keras.models import Sequential
from keras.layers import Dense, Embedding
from keras.layers import LSTM
model = Sequential()
model.add(Embedding(20000, 128, input_length=80))
model.add(LSTM(12... | {
"content_hash": "878b25d255af1994a3178ecf8b277644",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 82,
"avg_line_length": 28.82608695652174,
"alnum_prop": 0.6666666666666666,
"repo_name": "plaidml/plaidml",
"id": "2e77525dec60d270b8573eb63fa6c9a62e74e0b8",
"size": "1244"... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import itertools
import os
import sys
from abc import abstractmethod
from contextlib import contextmanager
from hashlib import sha1
from twitter.common.collections.or... | {
"content_hash": "d777581084c2607076d2fbc6159f949a",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 119,
"avg_line_length": 42.84057971014493,
"alnum_prop": 0.6940544654939107,
"repo_name": "megaserg/pants",
"id": "84dac0b281a79c8960805931b40a0096f54027af",
"size": "2379... |
import sys
#This works just like /bin/false, but Windows users might not have that
sys.exit(1)
| {
"content_hash": "9c2820b72766008c59911e6220320962",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 14.142857142857142,
"alnum_prop": 0.7373737373737373,
"repo_name": "tdyas/pants",
"id": "384035975266c2a5dac5171047f6b24b8984b291",
"size": "231",
"... |
"""Python abstract syntax node definitions
This file is automatically generated.
"""
from types import TupleType, ListType
from consts import CO_VARARGS, CO_VARKEYWORDS
def flatten(list):
l = []
for elt in list:
t = type(elt)
if t is TupleType or t is ListType:
for elt2 in flatten(... | {
"content_hash": "524d9afd482f57b5f76d0821153c70be",
"timestamp": "",
"source": "github",
"line_count": 1241,
"max_line_length": 162,
"avg_line_length": 25.7767929089444,
"alnum_prop": 0.5731970364812904,
"repo_name": "MalloyPower/parsing-python",
"id": "8d69da6d9907f55e8cefd7031e0a03a67aa0dc8d",
"... |
import asyncio
from collections import defaultdict
from contextlib import suppress
import logging
import uuid
from .client import Client
from .utils import log_errors, TimeoutError
from .worker import get_worker
from .utils import parse_timedelta
logger = logging.getLogger(__name__)
class EventExtension:
""" An... | {
"content_hash": "33ecadee70e8ce708f59d34d1f1bd5d8",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 86,
"avg_line_length": 33.24701195219124,
"alnum_prop": 0.5823846614739365,
"repo_name": "blaze/distributed",
"id": "75661654b86f104cab19da67ce734d5d5a029b0d",
"size": "83... |
from __future__ import unicode_literals
import sys
import django
__all__ = [
'json',
'BufferIO',
'urlopen',
'urlparse',
'quote',
'quote_plus',
'URLError',
'force_unicode', 'text_type'
]
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
# Django version
if django.VERSION... | {
"content_hash": "c40e23e1c9a9bbf8c0fae9b10822446b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 65,
"avg_line_length": 22.82278481012658,
"alnum_prop": 0.6783139212423738,
"repo_name": "Resmin/sorl-thumbnail",
"id": "4c328dc1f3bfb858d910b84c4703fb7e41d38f14",
"size": ... |
import base64
import errno
import os
from oslo.config import cfg
from kds.common import exception
from kds.openstack.common.crypto import utils as cryptoutils
CONF = cfg.CONF
KEY_SIZE = 16
class CryptoManager(object):
def __init__(self):
self.crypto = cryptoutils.SymmetricCrypto(enctype=CONF.kds.encty... | {
"content_hash": "1d03937acfb5afd15d025ecf4a769df6",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 77,
"avg_line_length": 31.84426229508197,
"alnum_prop": 0.5675675675675675,
"repo_name": "jamielennox/openstack-kds",
"id": "0e5236df6e069e0c4d4ded897aa59f2934f1fe9b",
"si... |
import csv
count = 0
with open('submissions.csv', 'rb') as count_file:
csv_reader = csv.reader(count_file)
for row in csv_reader:
count += 1
print count | {
"content_hash": "894486bb8b4a8498d3424920e03859b6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 49,
"avg_line_length": 21.125,
"alnum_prop": 0.650887573964497,
"repo_name": "akshaynagpal/competitive-programming",
"id": "e1ce423afc0399644fdb124c096165d86d3d7e8e",
"size"... |
""" A script to manage development tasks """
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
from os import path as p
from manager import Manager
from subprocess import call
manager = Manager()
_basedir = p.dirname(__file__)
@manager.command
def clean()... | {
"content_hash": "638f1959debc4f3ad32dcc66f1146914",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 78,
"avg_line_length": 22.948979591836736,
"alnum_prop": 0.6456202756780791,
"repo_name": "reubano/ckanutils",
"id": "5df51241f3779a341f4edc80a540324d0fb0c7da",
"size": "22... |
"""
This script can be used to create a source distribution, binary distribution
or Windows executable files. The output is put in dist/
See
https://github.com/google/transitfeed/wiki/BuildingPythonWindowsExecutables
for help on creating Windows executables.
"""
from distutils.core import setup
import glob
import os.... | {
"content_hash": "4a20440be13f27ada09ccca79f02d1b8",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 80,
"avg_line_length": 43.577235772357724,
"alnum_prop": 0.692723880597015,
"repo_name": "avilaton/transitfeed",
"id": "732936ba8dfb841c84e38ff19e4706ec92f065e5",
"size": ... |
import subprocess
import praw
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringIO
from base64 import b64encode
from base64 import b64decode
from ConfigParser import ConfigParser
import OAuth2Util
import os
import markdown
import bleach
# e... | {
"content_hash": "4534aa5c42fa586b16d96a30a65a1d2a",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 129,
"avg_line_length": 41.58247422680412,
"alnum_prop": 0.6736085285731994,
"repo_name": "foobarbazblarg/stayclean",
"id": "a6640f99f18febc20cde2ad8eacff0ebba1404e4",
"si... |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "selected_points_publisher"
PROJECT_SPACE_DIR = "/home/mike/catkin_ws/devel"
PROJECT_VERSION = ... | {
"content_hash": "f2aa90ef52e38e83d3271bafa7ff847a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 46.857142857142854,
"alnum_prop": 0.6402439024390244,
"repo_name": "mikewrock/phd_backup_full",
"id": "4b62648c7f89454c920aa73ba684d9c6d587665e",
"siz... |
"""
Types used in the opt_einsum package
"""
from typing import Any, Collection, FrozenSet, List, Optional, Tuple, Union
PathType = Collection[Tuple[int, ...]]
ArrayType = Any # TODO
ArrayIndexType = FrozenSet[str]
TensorShapeType = Tuple[int, ...]
ContractionListType = List[Tuple[Any, ArrayIndexType, str, Optional[... | {
"content_hash": "f10e353864b05cc20f80055166810acd",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 104,
"avg_line_length": 32.45454545454545,
"alnum_prop": 0.7198879551820728,
"repo_name": "dgasmith/opt_einsum",
"id": "3fb22ce375f146861ab345d3950099301a9d12ce",
"size": "... |
from __future__ import print_function
import os
import pipes
import string
import sys
GDB_RUNNER_SCRIPT = string.Template("""#!/usr/bin/env python
import os
env = ${b64env}
for k, v in env.items():
os.environ[k] = v
os.system("${gdb} --fullname --args ${test_args}")
""")
if __name__ == '__main__':
gdb = sys.a... | {
"content_hash": "ef5e0017c3325900b8bc68d412e3e7d6",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 93,
"avg_line_length": 25.90625,
"alnum_prop": 0.6332931242460796,
"repo_name": "dnoe/envoy",
"id": "a23d19fa6c5755ffcaf061bd85ad519cac8c1e2a",
"size": "1163",
"binary": ... |
import os
import json
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
CONFIG_FILE_NAME = '/etc/randomcab/main.ini'
INSTALL_DIR = ""
from configparser import RawConfigParser
config = RawConfigParser()
if os.path.exists(CONFIG_FILE_NAME):
DEBUG = False
config.read(CONFIG_FILE_NAME)
INSTALL_DIR = conf... | {
"content_hash": "b7f448db39666bf227851b5fbcfd5218",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 88,
"avg_line_length": 25.345070422535212,
"alnum_prop": 0.666851903306474,
"repo_name": "bjarnoldus/randomcab",
"id": "79e61f2ef1a42b10dee5c1eb00333711c4ed751c",
"size": ... |
import triton as TT
from arybo.tools import tritonast2arybo
TT.setArchitecture(TT.ARCH.X86_64)
TT.convertRegisterToSymbolicVariable(TT.REG.RAX)
TT.convertRegisterToSymbolicVariable(TT.REG.RBX)
inst = TT.Instruction()
inst.setOpcodes("\x48\x31\xd8") # xor rax, rbx
TT.processing(inst)
rax_ast = TT.buildSymbolicRegis... | {
"content_hash": "96d24c2184c20c6730be1cf6884421e8",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 48,
"avg_line_length": 23.5,
"alnum_prop": 0.7801418439716312,
"repo_name": "quarkslab/arybo",
"id": "6ea7d8d7fc20e8ff1cdbd4a34e3d835466c63c63",
"size": "423",
"binary": ... |
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import codecs
import doctest
import os
import re
import shutil
import sys
import tempfile
import time
import traceback
from extra.beep.beep import beep
from lib.controller.controller import start
f... | {
"content_hash": "14b76fc9123db6ed709fb6d595b09081",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 129,
"avg_line_length": 32.171171171171174,
"alnum_prop": 0.5890973583496686,
"repo_name": "JeyZeta/Dangerous",
"id": "d09fd486c71fb1c29d25ff43efe0c9e014896226",
"size": "... |
def normalize_doc(doc):
if isinstance(doc, str):
if doc == '':
return NIL
return doc
return doc.normalize()
class Doc:
"""The base class for all Docs, except for plain ``str`` s which
are unboxed.
A Doc is a tree structure that represents the set of all possible
la... | {
"content_hash": "71bc789093040cbf3e5984b9e387a80b",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 69,
"avg_line_length": 24.71559633027523,
"alnum_prop": 0.5567928730512249,
"repo_name": "tommikaikkonen/peprint",
"id": "d3deb88a4708bb22e1ebb102bcf98641b43fb391",
"size"... |
import json
import logging
import re
import time
from nose.plugins.skip import SkipTest
from nose.tools import assert_equal, assert_true
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from desktop.lib.i18n import smart_str
from desktop.lib.django_test_util import make_logged... | {
"content_hash": "6e302ad809b1129d57908495aae870ae",
"timestamp": "",
"source": "github",
"line_count": 840,
"max_line_length": 187,
"avg_line_length": 40.43571428571428,
"alnum_prop": 0.5809927574633457,
"repo_name": "todaychi/hue",
"id": "6761b5d1e6c5a768930f13366fc65ea02d465641",
"size": "34796"... |
"""RNN helpers for TensorFlow models.
@@bidirectional_dynamic_rnn
@@dynamic_rnn
@@raw_rnn
@@static_rnn
@@static_state_saving_rnn
@@static_bidirectional_rnn
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import context
from... | {
"content_hash": "a5463d2eb41718fa86202448d72d0222",
"timestamp": "",
"source": "github",
"line_count": 1442,
"max_line_length": 80,
"avg_line_length": 41.237864077669904,
"alnum_prop": 0.6630286723282603,
"repo_name": "dyoung418/tensorflow",
"id": "21c7ed361dc8d613d3332905ded1952dfe34681c",
"size"... |
from jacket.tests.compute.unit.volume.encryptors import test_base
from jacket.compute.volume.encryptors import nop
class NoOpEncryptorTestCase(test_base.VolumeEncryptorTestCase):
def _create(self, connection_info):
return nop.NoOpEncryptor(connection_info)
def test_attach_volume(self):
self.e... | {
"content_hash": "d1f5a139dd48c0663ba2e825b03e63f7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 32.53846153846154,
"alnum_prop": 0.75177304964539,
"repo_name": "HybridF5/jacket",
"id": "ddf4651cc9ad95d444ce1b7001182c338b3e7361",
"size": "1098",
... |
from setuptools import setup
setup(
name='netscramble',
version='0.1',
description='Simple logic puzzle game',
url='http://tomdryer.com',
author='Tom Dryer',
author_email='tomdryer.com@gmail.com',
license='BSD',
packages=['netscramble'],
entry_points= {
"console_scripts": ["... | {
"content_hash": "da2be0f4719820a5cdd14efce55681ee",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 25.210526315789473,
"alnum_prop": 0.6325678496868476,
"repo_name": "tdryer/netscramble",
"id": "4457f2926b5e40dcffa3636659eed43ed690070d",
"size": "4... |
import datetime
import sys
"""
Prints the Xth day on the Yth week of the current month.
For example, to print the 2nd Sat of the current month:
./xth_day_of_yth_week.py 2 5
"""
week_num = int(sys.argv[1])
day_num = int(sys.argv[2])
day = datetime.datetime.now()
# 1st day in the current month
day = day.replace(day=1)... | {
"content_hash": "3ddb50c886b19b960b034384b5c4b54b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 26.045454545454547,
"alnum_prop": 0.6963350785340314,
"repo_name": "vmiklos/vmexam",
"id": "8f4a7b2f6424baf5a4405c92f0ddc4425cbf4902",
"size": "597",... |
import sys
from os import mkdir,sep,path
#import numpy as np
#from cv2 import *
#from hand_grabber import PyOpenNIHandGrabber
#from pose_recognizer import PyPoseRecognizer
import thread
import xml.etree.ElementTree as ET
#import Image
from random import *
import time
#from my_fun import *
#from sklearn.externals import... | {
"content_hash": "275eee465d8b84efd9d076ee38a2fa31",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 100,
"avg_line_length": 34.96296296296296,
"alnum_prop": 0.548728813559322,
"repo_name": "parloma/Prensilia",
"id": "145fc73e020cebe952dc49c000d57cff6475d182",
"size": "57... |
"""
=============
Keypress demo
=============
This example demonstrates the different keypress-gathering techniques available
in the ExperimentController class.
"""
# Author: Dan McCloy <drmccloy@uw.edu>
#
# License: BSD (3-clause)
from expyfun import ExperimentController, building_doc
import expyfun.analyze as ea
p... | {
"content_hash": "b50096d59121b623962d5a0175f32cdd",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 79,
"avg_line_length": 38.214285714285715,
"alnum_prop": 0.5468847352024923,
"repo_name": "LABSN/expyfun",
"id": "c0f657aa9864edba64f4ec58f7f2bc8082542403",
"size": "6420"... |
import grpc
from google.cloud.automl_v1.proto import (
annotation_spec_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_annotation__spec__pb2,
)
from google.cloud.automl_v1.proto import (
dataset_pb2 as google_dot_cloud_dot_automl__v1_dot_proto_dot_dataset__pb2,
)
from google.cloud.automl_v1.proto import (... | {
"content_hash": "9953e24c2fbd4094b2733769d4c6fd5f",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 138,
"avg_line_length": 52.46265060240964,
"alnum_prop": 0.7044828219731766,
"repo_name": "tswast/google-cloud-python",
"id": "0ad90914659506e5cfc7cdfc810949f61da02ec3",
"... |
import Chirp, getopt
import paho.mqtt.client as mqtt
import sys, time
import logging
class ChirpConnect:
def __init__(self, bus=1, addr=0x20, host="localhost", port=2337, ssl=True, topic="sensors/Chirp", interval=60):
self.bus_num = bus
self.bus_addr = addr
self.mqtt_host = host
sel... | {
"content_hash": "c9f38241e56bfd3306aee528999c75c5",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 136,
"avg_line_length": 33.40594059405941,
"alnum_prop": 0.5610551274451689,
"repo_name": "mapero/ChirpConnect",
"id": "71fb6112935191ecb485ebccbc5e3fa6a349e2f0",
"size": ... |
"""Sana mDS Django admin interface
:Authors: Sana dev team
:Version: 2.0
"""
from django.contrib import admin
from .models import *
def mark_voided(modeladmin,request,queryset):
queryset.update(voided=True)
mark_voided.short_description = "Mark selected voided"
class DeviceAdmin(admin.ModelAdmin):
readonly... | {
"content_hash": "759da85e51b02ca80771fbe1b297d46e",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 81,
"avg_line_length": 29.370786516853933,
"alnum_prop": 0.6966335118592196,
"repo_name": "rryan/sana.mds",
"id": "e95a6a428db65c070da1286bc8b0c5619f2a0846",
"size": "2614"... |
""":mod:`ShopWizard` -- Provides an interface for searching with the Shop Wizard
.. module:: ShopWizard
:synopsis: Provides an interface for searching with the Shop Wizard
.. moduleauthor:: Joshua Gilman <joshuagilman@gmail.com>
"""
from neolib.exceptions import invalidSearch
from neolib.exceptions import invalidU... | {
"content_hash": "6a57ad1215adfb32c2e782bdd566fd08",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 121,
"avg_line_length": 36.883720930232556,
"alnum_prop": 0.5712484237074401,
"repo_name": "jmgilman/Neolib",
"id": "c3385970e06c99adc982f23670bfcd9f6b1c32e6",
"size": "79... |
"""
USAGE: %(program)s TEXT_INPUT WORD2VEC_OUTPUT TEXT_OUTPUT
Example script for training a word2vec model. Parameters for word2vec should be
optimized per language. TEXT_OUTPUT, true of false, if vectors should be outputted to a text file.
"""
import logging
import multiprocessing
import os
import sys
from gensim.mo... | {
"content_hash": "0ebc62863b8c3b84c4e2b3f23e40dff9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 98,
"avg_line_length": 29,
"alnum_prop": 0.6337931034482759,
"repo_name": "hgrif/wiki-word2vec",
"id": "2bd9c8ac9ca64ef37b9aaeb60594c7e21c806a59",
"size": "1497",
"binary... |
"""
Implements UMAP visualizations of documents in 2D space.
"""
##########################################################################
## Imports
##########################################################################
import warnings
import numpy as np
from collections import defaultdict
from yellowbrick.dr... | {
"content_hash": "fda4a030c175e0b9baf3f270fa78d89b",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 88,
"avg_line_length": 35.138666666666666,
"alnum_prop": 0.611747742278212,
"repo_name": "DistrictDataLabs/yellowbrick",
"id": "276257b6227f931a8ea743ade974ffda46a90609",
... |
from django.conf.urls import url
from .views import (EveLogin, EveCallback,
Dashboard, DisplayTopic,
LogOffSafely, Settings,
session_required,
DiscordCallback, DiscordLogin,
CreateTopic, CreateComment)
urlpatterns = [
... | {
"content_hash": "d959bad68b52934cf1904ce378b1109b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 38.935483870967744,
"alnum_prop": 0.6006628003314002,
"repo_name": "prusya/midas22",
"id": "868ba81037ffae103672c2c0c68cdd0ebc152a5c",
"size": "1207"... |
"""
The wrapper of the RHN Satellite/Spacewalk's mod_python handler
adding the coverage collecting functionality.
"""
from spacewalkcoverage.spacewalkcoverage import SpacewalkCoverage
# Import the decorated server
import spacewalk.server.apacheServer
cov = SpacewalkCoverage()
def HeaderParserHandler(req):
cov... | {
"content_hash": "3ffc193c505dffdaca56dad8254a2d9f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 69,
"avg_line_length": 23.08823529411765,
"alnum_prop": 0.7605095541401274,
"repo_name": "vlki/spacewalk-xmlrpc-tests",
"id": "47005ae9b66faf157080b04244bfee298399f273",
"s... |
import unittest
from unittest import TestCase
from contextlib import contextmanager
from posix import stat_result, statvfs_result
import array
from swift.common import ring, utils
from shutil import rmtree
import os
import mock
from swift import __version__ as swiftver
from swift.common.swob import Request
from swift.... | {
"content_hash": "d69b049f64f467d5208614a78da74fcf",
"timestamp": "",
"source": "github",
"line_count": 1073,
"max_line_length": 79,
"avg_line_length": 44.071761416589005,
"alnum_prop": 0.5246040305356425,
"repo_name": "dpgoetz/swift",
"id": "66e97c3088f18fcfe469fd8e51391f8187b2bba3",
"size": "4788... |
import logging
from collections import defaultdict
import networkx
from .. import SIM_PROCEDURES
from .. import options as o
from ..knowledge_base import KnowledgeBase
from ..errors import AngrError, AngrCFGError
from ..manager import SimulationManager
from ..misc.graph import shallow_reverse
from . import Analysis, ... | {
"content_hash": "7c69ceebd6749153c1ebbcd2542ab25c",
"timestamp": "",
"source": "github",
"line_count": 624,
"max_line_length": 129,
"avg_line_length": 40.44070512820513,
"alnum_prop": 0.5793936992272637,
"repo_name": "f-prettyland/angr",
"id": "b4359276d05401ca166813b39485e29f6c5565f5",
"size": "2... |
import re
import warnings
from datetime import datetime, timedelta
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
import haystack
from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, log_query
from haystack.constants import (
DEFAULT_OPERATOR,
... | {
"content_hash": "3fc690fa4708a65979432fc00006d006",
"timestamp": "",
"source": "github",
"line_count": 1146,
"max_line_length": 118,
"avg_line_length": 34.75130890052356,
"alnum_prop": 0.4937853107344633,
"repo_name": "reviewboard/reviewboard",
"id": "8101b3b8a3605603bcb5e4fd3b0889d3f1666714",
"si... |
""" Test cases for .boxplot method """
import itertools
import string
import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import (
DataFrame,
MultiIndex,
Series,
date_range,
timedelta_range,
)
import pandas._testing as tm
from pandas.tests.plotting.common impor... | {
"content_hash": "1c53844282bd341df8d4c6393db26f76",
"timestamp": "",
"source": "github",
"line_count": 561,
"max_line_length": 88,
"avg_line_length": 38.288770053475936,
"alnum_prop": 0.5299348230912476,
"repo_name": "rs2/pandas",
"id": "dbceeae44a493316eb58bddfc9c74d4a5c2f4a3b",
"size": "21480",
... |
import pytest
from sovrin_client.test import waits
from stp_core.loop.eventually import eventually
from sovrin_client.test.cli.helper import checkConnectedToEnv, prompt_is
@pytest.fixture(scope="module")
def alice(aliceCLI):
return aliceCLI
def test_disconnect_when_not_connected(alice, be, do):
be(alice)
... | {
"content_hash": "33f52fe3fcff1d8af182830a4721054a",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 76,
"avg_line_length": 29.630434782608695,
"alnum_prop": 0.7109317681584739,
"repo_name": "keenondrums/sovrin-node",
"id": "257271ec3a5cacb8242693247b72e630b6df8b37",
"size... |
import unittest
from entities import *
class TestField(unittest.TestCase):
def test_make_default(self):
field = Field(default=None, null=True)
self.assertEqual(field.make_default(), None)
field = Field(default=lambda: 1, null=True)
self.assertEqual(field.make_default(), 1)
... | {
"content_hash": "a88c2bb505086cf053150c3fa6e68484",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 78,
"avg_line_length": 29.74074074074074,
"alnum_prop": 0.6141256004269703,
"repo_name": "eseraygun/python-entities",
"id": "94151876369f57fae8a1c19021cd725b707cb11b",
"si... |
from __future__ import with_statement
import codecs
import datetime
import os
import re
from stat import *
import sys
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
from jinja2.utils import open_if_exists
try:
import markdown
except ImportError:
markdown = None
try:
from t... | {
"content_hash": "f5ee6edb17f380b695fe28758d5595cc",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 105,
"avg_line_length": 33.2695652173913,
"alnum_prop": 0.525265725736191,
"repo_name": "arnaudsj/couchdbkit",
"id": "ea538bfaa3e277362cf1787cffda8f352ee7a797",
"size": "1... |
'''
Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n.
Note: 1 <= k <= n <= 10^9.
Example:
Input:
n: 13 k: 2
Output:
10
Explanation:
The lexicographical order is [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9], so the second smallest number is 10.
'''
'''
A solution e... | {
"content_hash": "f963815517818907630f624371418e0c",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 110,
"avg_line_length": 24.943396226415093,
"alnum_prop": 0.5597579425113465,
"repo_name": "shub0/algorithm-data-structure",
"id": "2bd661e73d5ec60b0313f2409b19ead6d939eaab",... |
from slacker import Slacker
import yaml
config = yaml.load(file('rtmbot.conf', 'r'))
api_token = config["SLACK_TOKEN"]
slack = Slacker(api_token)
# Send a message to #general channel
slack.chat.post_message('#bot_test', 'Hello fellow slackers!', as_user=True)
# Upload a file
slack.files.upload('carrot.png', channels... | {
"content_hash": "2501b12acf6d742b27a03a45f1ad3d9f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 76,
"avg_line_length": 27.833333333333332,
"alnum_prop": 0.7245508982035929,
"repo_name": "martinpeck/peckbot",
"id": "6b91518d21bcb11e82cd0d47e0249dfffb5b2579",
"size": "3... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'TagTranslation'
db.create_table('aldryn_news_tag_translation', (
('id', self.gf('django.db.models.fields... | {
"content_hash": "b1b8cd8af2eab84f703be2742befbe58",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 191,
"avg_line_length": 78.8609865470852,
"alnum_prop": 0.5620948481746844,
"repo_name": "aldryn/aldryn-news",
"id": "0047c5dda061065f1291b609c298893938bcf933",
"size": "1... |
"""
Create and delete FILES_PER_THREAD temp files (via tempfile.TemporaryFile)
in each of NUM_THREADS threads, recording the number of successes and
failures. A failure is a bug in tempfile, and may be due to:
+ Trying to create more than one tempfile with the same name.
+ Trying to delete a tempfile that doesn... | {
"content_hash": "4e5eddd20d9d77a936fd4400bc863fe0",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 76,
"avg_line_length": 32.09230769230769,
"alnum_prop": 0.6255992329817833,
"repo_name": "Jeff-Tian/mybnb",
"id": "245fdd1c91b1187d27b26af3f8445949eca96079",
"size": "2086"... |
from anodos.models import Log
from catalog.models import *
class Runner:
name = 'Перерасчет розничных цен и количества'
alias = 'recalculate'
def __init__(self):
self.updater = Updater.objects.take(alias = self.alias, name = self.name)
def run(self):
products = Product.objects.va... | {
"content_hash": "9233c61f9b2221b8298e22d268d80bdc",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 109,
"avg_line_length": 30.5,
"alnum_prop": 0.550351288056206,
"repo_name": "anodos-ru/catalog",
"id": "67077fb74333a8c66bc26df7631763d262d52bb1",
"size": "887",
"binary"... |
import json
import urllib, urllib2
from keys import BING_API_KEY
def run_query(search_terms):
# Specify the base
root_url = 'https://api.datamarket.azure.com/Bing/Search/'
source = 'Web'
# Specify how many results we wish to be returned per page.
# Offset specifies where in the results list to sta... | {
"content_hash": "cc215da37da859a89b9d9f74ff065ae0",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 33.721518987341774,
"alnum_prop": 0.6358858858858859,
"repo_name": "leifos/tango_with_tests",
"id": "b531757136faf106fd1fca970422c1032c8f386c",
"size... |
"""
GPLv3 license (ASTRA toolbox)
Note that the TomoPhantom package is released under Apache License, Version 2.0
* Script to generate 3D analytical phantoms and their projection data using TomoPhantom
* Projection data is also generated numerically and reconstructed using
* tomobar/ ASTRA TOOLBOX
>>>>> Dependencie... | {
"content_hash": "9ed4dbbf36cd8c99d63658f41e27745c",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 111,
"avg_line_length": 37.70967741935484,
"alnum_prop": 0.6928999144568007,
"repo_name": "dkazanc/TomoPhantom",
"id": "dc737a7b52357e206b9a6391155a91f0c22974de",
"size": ... |
__docformat__ = 'reStructuredText'
# Import Psyco if available
try:
import psyco
psyco.full()
except ImportError:
pass
import sys
import os
import tempfile
import re
import string
import types
from os.path import abspath, dirname, expanduser, join
from urlparse import urljoin, urlparse, urlunparse
from co... | {
"content_hash": "c5af9775334cdecaaa4d89e250a8bb33",
"timestamp": "",
"source": "github",
"line_count": 2410,
"max_line_length": 117,
"avg_line_length": 40.28423236514523,
"alnum_prop": 0.5249317608281403,
"repo_name": "thomaspurchas/rst2pdf",
"id": "051a7a88de5ac8f5b6b8d15355cb6d12f80eae65",
"size... |
"""Module defining statements supported by parser."""
import cx_Logging
import cx_OracleUtils
class Statement(object):
message = None
def __init__(self, sql, lineNumber):
self.sql = sql
self.lineNumber = lineNumber
def __repr__(self):
return "<%s>" % self.__class__.__name__
... | {
"content_hash": "173c168a86e511d2e2dcaf30cf41202c",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 79,
"avg_line_length": 26.664670658682635,
"alnum_prop": 0.6173366269930384,
"repo_name": "marhar/cx_OracleTools",
"id": "5a062c627b69936440395c08ecd8c3009921b6d0",
"size"... |
from __future__ import unicode_literals
import six
import inspect
from .requires import Requires
from .dsl import build_requirements_factory as default_build_requirements_factory, init_transformer, init_parser
from .exceptions import DecoratorError
class Validate(object):
def __init__(self, callables_dict=None... | {
"content_hash": "e87be851b58b2f8068dafb6944f3f194",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 120,
"avg_line_length": 37.904761904761905,
"alnum_prop": 0.6187185929648241,
"repo_name": "shezadkhan137/required",
"id": "282cc97bdc813bb79460742a28b35060cf163f5c",
"size... |
class SimpleEngagementCalculator(object):
def calculate_user_engagement_score(self, user, start_date, end_date):
return 0
ROOT_URLCONF=None
DATABASE_ENGINE='sqlite3'
DATABASE_NAME=':memory:'
DATABASE_SUPPORTS_TRANSACTIONS=False
INSTALLED_APPS=[
'django.contrib.auth',
'django.contrib.contenttypes',... | {
"content_hash": "c1cba690914d6c8ab314b903bdb0c8c7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 74,
"avg_line_length": 29.59090909090909,
"alnum_prop": 0.7311827956989247,
"repo_name": "uhuramedia/django-lean",
"id": "3432b5425e3dac0f0c4807ed6632aa6fcb6fa41d",
"size":... |
"""
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | {
"content_hash": "8b3c44ca17ae43e6f6727c291f4c070f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 208,
"avg_line_length": 40.6,
"alnum_prop": 0.7549261083743842,
"repo_name": "jeffmcnd/tfrs",
"id": "eb139075bcf9a1e6f2facb7e86c0a5a30be1e38e",
"size": "1624",
"binary": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='LoginMethod',
fields=[
('id', models... | {
"content_hash": "c06625da28d9c8ac7a4f24c3daa3e420",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 114,
"avg_line_length": 29.03846153846154,
"alnum_prop": 0.5642384105960265,
"repo_name": "mikkokeskinen/tunnistamo",
"id": "0d44c21b4928cd47d564cb801f1428d7f41105f7",
"siz... |
import re
from ..count_symbols import count_symbols
from ..stream.id_generator import IdGenerator
class Compiler(object):
def __init__(self, id_generator=None):
self.id_generator = id_generator
if self.id_generator is None:
self.id_generator = IdGenerator()
def compile(self, gher... | {
"content_hash": "7cde1e0f1d73a4644af6d587e269635a",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 142,
"avg_line_length": 40.382198952879584,
"alnum_prop": 0.5078438999092442,
"repo_name": "cucumber/gherkin",
"id": "07f5ca91fb45e666a3e82c714e3a70799c05d032",
"size": "7... |
from django import template
from django.utils.html import escape
register = template.Library()
@register.filter('github_title')
def github_title(title):
if title:
repo = title.split('/')
if len(repo) == 2:
return '{0}/<strong>{1}</strong>'.format(escape(repo[0]), escape(repo[1]))
... | {
"content_hash": "870117e4ca855351182bee31f063a747",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 86,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.6366366366366366,
"repo_name": "vitorfs/woid",
"id": "19c4647a789e3b7cbea244b977e4bc654987c5f9",
"size": "350",
... |
import random
import sys
import gdb
# List of colors used for printing messages
RED = "\033[1;31m"
BLUE = "\033[1;34m"
CYAN = "\033[1;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"
BOLD = "\033[;1m"
REVERSE = "\033[;7m"
def error_output(massage):
"""Print out a red output"""
sys.stdout.write(BOLD + RED)
p... | {
"content_hash": "f400e3a418a38a038ce7ca83c8ed8998",
"timestamp": "",
"source": "github",
"line_count": 512,
"max_line_length": 118,
"avg_line_length": 39.15625,
"alnum_prop": 0.57127893056664,
"repo_name": "timtian090/Playground",
"id": "03f3bce3579004a113c157f55313982205b58e7f",
"size": "20048",
... |
from django.shortcuts import render, render_to_response, redirect, get_object_or_404
from django.contrib.auth import authenticate, login , logout
from .models import Course, Department, User, Student, ExamPaper, Material, Announcement, CourseAllotment, Bookmark, Feedback, Contributor, Stat
from .forms import RegisterFo... | {
"content_hash": "c39bc4ad18c3b44ae9e0462c614d380a",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 186,
"avg_line_length": 45.384126984126986,
"alnum_prop": 0.6158365976496922,
"repo_name": "rajexp/collegeassist",
"id": "65c52e3273d9ac7c9f857a5730f07e699cca87b0",
"size"... |
from dep import *
from dep.helpers import *
def command_branch(args):
tree = dependency.Tree()
tree.branch_dependency_tree(args.name, args.startpoint, vars(args))
parser_branch = opts.subparsers.add_parser("branch",
help="Branch all dependencies to new branch",
... | {
"content_hash": "6af4c74b466bc329fa71dfbfd90e191d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 126,
"avg_line_length": 46.05882352941177,
"alnum_prop": 0.632183908045977,
"repo_name": "harveyt/dep",
"id": "052b270b6717e228ddbda1023a6fcd41d10a599f",
"size": "837",
"... |
""" Various kinds of layout components.
"""
from __future__ import absolute_import
import logging
logger = logging.getLogger(__name__)
from ..core import validation
from ..core.validation.warnings import EMPTY_LAYOUT, BOTH_CHILD_AND_ROOT
from ..core.properties import abstract
from ..core.properties import Int, Insta... | {
"content_hash": "5d67eafb61dc62ab8bfc0b9966a95907",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 91,
"avg_line_length": 28.770114942528735,
"alnum_prop": 0.6532161406312426,
"repo_name": "pombredanne/bokeh",
"id": "5a1a13216caf5e75646057305926cf09df44d4d2",
"size": "25... |
import GencodeGTFParser
__author__ = 'Guorong Xu<g1xu@ucsd.edu>'
import re
import sys
def merge_all_sample_count(workflow, project_name, sample_list):
gencode_gtf_file = "/shared/workspace/software/gencode/gencode.v19.annotation.gtf"
localpath = "/shared/workspace/data_archive/RNASeq/" + project_name + "/" ... | {
"content_hash": "36ede801dc8c5f21c30b4ece98a0bfae",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 109,
"avg_line_length": 34.17857142857143,
"alnum_prop": 0.5357018460466736,
"repo_name": "ucsd-ccbb/jupyter-genomics",
"id": "6db45db82265c85aa7e9ae8728a2210551a46cb9",
"s... |
"""NASNet-A models for Keras.
NASNet refers to Neural Architecture Search Network, a family of models
that were designed automatically by learning the model architectures
directly on the dataset of interest.
Here we consider NASNet-A, the highest performance model that was found
for the CIFAR-10 dataset, and then ext... | {
"content_hash": "e7e5d6bafefbe4017bcfa8bd2734ee8e",
"timestamp": "",
"source": "github",
"line_count": 801,
"max_line_length": 87,
"avg_line_length": 37.25717852684145,
"alnum_prop": 0.5810072713869249,
"repo_name": "frreiss/tensorflow-fred",
"id": "2650af29cfe7033c50b1dc9900a64e3b073ac56a",
"size... |
from pylab import *
linewidth = 2
#markers= ['+', ',', 'o', '.', 's', 'v', 'x', '>', '<', '^']
#markers= [ 'x', '+', 'o', 's', 'v', '^', '>', '<', ]
markers = ['s', 'o', 'v', '^', '+', 'x', '>', '<', ]
markersize = 8
def get_values(filename):
sizes = []
values = []
for line in Path(filename).read_text().... | {
"content_hash": "7782f5fc58d7e19416c9c3d2664232e4",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 259,
"avg_line_length": 36.732638888888886,
"alnum_prop": 0.48700255222610833,
"repo_name": "avalentino/PyTables",
"id": "ca1ecf14da7a0630db4210e3e0e20f26945a5c29",
"size"... |
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from salttesting.helpers imp... | {
"content_hash": "c4385dfeb2c461b2073eeb015af843c8",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 97,
"avg_line_length": 43.925233644859816,
"alnum_prop": 0.4553191489361702,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "3457ecb48f8edf530504a824fdb1b801588... |
from __future__ import absolute_import
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
String,
)
from openpyxl.descriptors.excel import Relation
class Hyperlink(Serialisable):
tagname = "hyperlink"
ref = String()
location = String(allow_none=True)
t... | {
"content_hash": "90c27d034717cb1e02a329f437ff6eed",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 63,
"avg_line_length": 25.02777777777778,
"alnum_prop": 0.5715871254162043,
"repo_name": "aragos/tichu-tournament",
"id": "cdc3cfcbec9f9cf46989c9d3585c3f4be5a69b96",
"size"... |
from functools import partial
class Solver(object):
"""
Solver class taking a NEQSys instance as input
"""
abstol = 1e-6
reltol = 1e-6
logger = None
solve_args = {} # speical keyword arguments to run in subclasses
def set_neqsys(self, neqsys):
self._neqsys = neqsys
def... | {
"content_hash": "e61423e2d28d5e45d7cbc1cb78cb6071",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 69,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.5675675675675675,
"repo_name": "bjodah/symneqsys",
"id": "236f669ce6ec42851c1c551b7fc507fc4164e1f4",
"size": "135... |
"""Fichier contenant le module secondaire navigation."""
# Configuration des loggers
type(importeur).man_logs.creer_logger("navigation", "ordres", "ordres.log")
type(importeur).man_logs.creer_logger("navigation", "monstres", "monstres.log")
import os
from random import randint
from vector import *
from abstraits.mo... | {
"content_hash": "593c41b95543fc0825106700a107799b",
"timestamp": "",
"source": "github",
"line_count": 997,
"max_line_length": 80,
"avg_line_length": 37.945837512537615,
"alnum_prop": 0.5899503066187355,
"repo_name": "stormi/tsunami",
"id": "a168110aee0f3bb821984e40bf8d141a2586970e",
"size": "3966... |
import contextlib
import datetime
import uuid
import mock
import testscenarios
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_utils import importutils
from oslo_utils import timeutils
from sqlalchemy.orm import query
from neutron.common import constants
from neutron.common import topic... | {
"content_hash": "63bc09558bce77e32f2be6b9d36e9777",
"timestamp": "",
"source": "github",
"line_count": 1742,
"max_line_length": 79,
"avg_line_length": 42.8329506314581,
"alnum_prop": 0.554915231521812,
"repo_name": "Stavitsky/neutron",
"id": "c08991aafe29989ca4a10f9d43d4c29a9683ec70",
"size": "752... |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | {
"content_hash": "cca72530447b685f77c205bbe6ac916f",
"timestamp": "",
"source": "github",
"line_count": 707,
"max_line_length": 80,
"avg_line_length": 33.408769448373405,
"alnum_prop": 0.624428450465707,
"repo_name": "nmayorov/scikit-learn",
"id": "9bd8ca273a8dc4a0a9b611938650cd8c4324e84c",
"size":... |
from __future__ import division
import argparse
import functools
import multiprocessing
import numpy as np
import random
import six
import chainer
from chainer.dataset.convert import _concat_arrays
from chainer.dataset.convert import to_device
import chainer.links as L
from chainer.training import extensions
from ch... | {
"content_hash": "c69414ce3157075f9bf7f10b918c4483",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 109,
"avg_line_length": 34.23673469387755,
"alnum_prop": 0.6329279923700525,
"repo_name": "chainer/chainercv",
"id": "f5b126c6e8072cf5f6af9613f1d78ddc18fbfdf1",
"size": "8... |
"""website_1 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | {
"content_hash": "4ef690eb0240bb525f1c075523be324c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 37.375,
"alnum_prop": 0.6800445930880713,
"repo_name": "indoorConstructionMan/Django",
"id": "e763a009e80e8e87fdccc967fb584404a179e4e6",
"size": "897... |
from doorman import permissions
def register(name_or_test_func=None):
if callable(name_or_test_func):
permissions.register(name_or_test_func.__name__, name_or_test_func)
return name_or_test_func
else:
def decorator(test_func):
permissions.register(name_or_test_func, test_fu... | {
"content_hash": "d69887e672af6cfac32f5b40d17c435f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 75,
"avg_line_length": 31.5,
"alnum_prop": 0.6507936507936508,
"repo_name": "seanbrant/django-doorman",
"id": "a4f8db5ac4050617b043491d6861ef4b4687600d",
"size": "378",
"... |
import pyximport; pyximport.install()
import packet_counter
import sys
packet_counter.main(sys.argv[1])
| {
"content_hash": "f418e92fc86926bafdccb2cfd9b909c3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 37,
"avg_line_length": 15.285714285714286,
"alnum_prop": 0.7850467289719626,
"repo_name": "High-Hill/bachelor_dap_gw",
"id": "a492e583b9fabedeb4f7f9df73b904a4aafbc8f8",
"siz... |
"""Common code for converting proto to other formats, such as JSON."""
# pylint:disable=wildcard-import
from apitools.base.py.encoding_helper import *
import apitools.base.py.extra_types # pylint:disable=unused-import
# pylint:disable=undefined-all-variable
__all__ = [
'CopyProtoMessage',
'JsonToMessage',
... | {
"content_hash": "61f70743fda92d197e0a8dedaa9b4af0",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 26.5,
"alnum_prop": 0.7186963979416809,
"repo_name": "endlessm/chromium-browser",
"id": "25b02d3bfc05a3a0bc9d48828815a5b7a5bf3365",
"size": "1183",
... |
from micropython import const
import time, machine, bluetooth
TIMEOUT_MS = 5000
_IRQ_CENTRAL_CONNECT = const(1)
_IRQ_CENTRAL_DISCONNECT = const(2)
_IRQ_PERIPHERAL_CONNECT = const(7)
_IRQ_PERIPHERAL_DISCONNECT = const(8)
_IRQ_GATTC_SERVICE_RESULT = const(9)
_IRQ_GATTC_SERVICE_DONE = const(10)
UUID_A = bluetooth.UUID(... | {
"content_hash": "097d369cc0997199ed7bfe5f44ba7a4a",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 27.66346153846154,
"alnum_prop": 0.6388599235314564,
"repo_name": "kerneltask/micropython",
"id": "e746b87458e1b59aaf3f941a80cc6b633bd3966f",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.