text stringlengths 4 1.02M | meta dict |
|---|---|
AuthorizedException = (
BufferError,
ArithmeticError,
AssertionError,
AttributeError,
EnvironmentError,
EOFError,
LookupError,
MemoryError,
ReferenceError,
RuntimeError,
SystemError,
TypeError,
ValueError
)
| {
"content_hash": "e623c5271fd39080a953114fae340619",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 25,
"avg_line_length": 20.733333333333334,
"alnum_prop": 0.5627009646302251,
"repo_name": "ainafp/nilearn",
"id": "ee45bba416bd22f2e0e5332db3823938709bed53",
"size": "311",... |
from __future__ import absolute_import, unicode_literals
__version__ = '0.39'
__license__ = 'MIT'
import re
import os
import sys
import time
import logging
import marshal
import tempfile
import threading
from math import log
from hashlib import md5
from ._compat import *
from . import finalseg
if os.name == 'nt':
... | {
"content_hash": "91f83599b50145eb3e4445c4a4017385",
"timestamp": "",
"source": "github",
"line_count": 598,
"max_line_length": 109,
"avg_line_length": 31.777591973244146,
"alnum_prop": 0.502604851865495,
"repo_name": "gumblex/jieba",
"id": "60bbfd6ab34fbf5cad893570814a079d172d1c5d",
"size": "19003... |
import StringIO
from django.utils.html import escape
def __dump_value(t, value, tag, file):
if t == str or t == unicode:
file.write('<%s>%s</%s>' % (tag, escape(value), tag))
elif t == bool:
file.write('<%s>%s</%s>' % (tag, str(value).lower(), tag))
else:
file.write('<%s>%s</%s>' ... | {
"content_hash": "7d753f9bfe70a8a5166a8ee79fc0a0c4",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 69,
"avg_line_length": 28.169811320754718,
"alnum_prop": 0.4996651038178165,
"repo_name": "symmetricapi/django-symmetric",
"id": "e83a83a2176040075db5bd719de2e223f0f1c3bf",
... |
from __future__ import print_function, absolute_import
__all__ = ['Worker', 'Manager', 'make_log', 'Timeout']
__version__ = '0.1'
import os
import sys
import time
import signal
import logging
from .process import pid_exists, wait_pid
default_log = logging.getLogger(__name__)
is_exit = False
class TimeoutException(... | {
"content_hash": "1a0420ae83826e54bb3cce34322d8f7c",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 116,
"avg_line_length": 32.10032362459547,
"alnum_prop": 0.5221292468998892,
"repo_name": "limodou/uliweb",
"id": "552995dff194d85f3c7449bf1b25233286961d22",
"size": "1010... |
"""
Created on Jun 20, 2011
@author: Bilel Msekni
@contact: bilel.msekni@telecom-sudparis.eu
@author: Houssem Medhioub
@contact: houssem.medhioub@it-sudparis.eu
@organization: Institut Mines-Telecom - Telecom SudParis
@license: Apache License, Version 2.0
"""
import pyocni.pyocni_tools.config as config
# getting the ... | {
"content_hash": "657cb15cf478a4388bb2b963c6309839",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 121,
"avg_line_length": 33.16216216216216,
"alnum_prop": 0.6821515892420538,
"repo_name": "jordan-developer/pyCMBS",
"id": "1299fa542564f0a0aa6f4ab347f3395d0569566c",
"size... |
import pytest
import hashlib
from django.core import exceptions
from django.db.utils import IntegrityError
from share.models import RawData
@pytest.mark.django_db
class TestRawData:
def test_doesnt_mangle_data(self, share_source):
rd = RawData(source=share_source, app_label='foo', data=b'This is just s... | {
"content_hash": "f702fcc5cb4bc1f0b3177b76abe0c1f9",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 461,
"avg_line_length": 41.77777777777778,
"alnum_prop": 0.6614741641337386,
"repo_name": "zamattiac/SHARE",
"id": "5e33c9947d940ae7ee9c7b122afd32810b25f37e",
"size": "2632... |
from flask import Response
import time, datetime
import config
import json
def ApiResponse(data, mimetype=config.MIMETYPE, **kwargs):
return Response(
json.dumps(data) if type(data) in [dict, list] else data,
mimetype=mimetype,
**kwargs
)
def to_timestamp(dt):
"""
Converts ... | {
"content_hash": "888df123bee6be10453b995358e5f564",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 65,
"avg_line_length": 21.875,
"alnum_prop": 0.59,
"repo_name": "tiranacode/jap-jete-admin",
"id": "dda2e50c81b33298a14a3458f7ffdd687add16cd",
"size": "700",
"binary": fa... |
"""
Conditions represent a build configuration under which to disable a test.
This file contains a canonical list of conditions and their properties, and code
for composing, parsing, and simplifying them. This is independent of their
representation within any particular test format.
"""
import collections
import funct... | {
"content_hash": "f6d9949f292c037cb5b6c46356e002db",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 80,
"avg_line_length": 35.5828729281768,
"alnum_prop": 0.6855057837124446,
"repo_name": "scheib/chromium",
"id": "616dc19eb1cb51bd8342f85b262c27ff22f633b1",
"size": "13043... |
from django.utils.translation import ugettext_noop as _
_('Page %(page)s of %(pages)s')
| {
"content_hash": "dc855e2296aa798a1d7e01ce3fde0c82",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 55,
"avg_line_length": 29.666666666666668,
"alnum_prop": 0.7078651685393258,
"repo_name": "avastjohn/maventy_new",
"id": "f38f07121c77e1a27861ba550a4d0c89f085cf54",
"size": ... |
"""
@package mi.dataset.parser
@file mi-dataset/mi/dataset/parser/utilities.py
@author Joe Padula, vipul lakhani
@brief Utilities that can be used by any parser
Release notes:
initial release
"""
from datetime import datetime
import time
import ntplib
import calendar
from mi.core.log import get_logger
__author__ = ... | {
"content_hash": "a4d4a1e16be4fc7931f4ae176ce2e1ea",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 101,
"avg_line_length": 33.407407407407405,
"alnum_prop": 0.6515823422697037,
"repo_name": "danmergens/mi-instrument",
"id": "e24477e16939085b8ddace2c408f62a53d67aa91",
"s... |
'''Views tests for the OSF.'''
from __future__ import absolute_import
import unittest
import json
import datetime as dt
import mock
import httplib as http
from nose.tools import * # noqa PEP8 asserts
from tests.test_features import requires_search
from modularodm import Q
from dateutil.parser import parse as parse_... | {
"content_hash": "bbf862d8b0506f26945ef09418990865",
"timestamp": "",
"source": "github",
"line_count": 4107,
"max_line_length": 184,
"avg_line_length": 39.16264913562211,
"alnum_prop": 0.5890164821158784,
"repo_name": "GaryKriebel/osf.io",
"id": "0909bb2589fcdfd44dcf30e7325f44ff33905abd",
"size": ... |
import os
import getpass
import sys
import datetime
import time
import smtplib
import yaml
from optparse import OptionParser
from dateutil import parser
if __name__ =='__main__':
optparser = OptionParser()
optparser.add_option('-f', '--file', dest='file',
help='YAML file with cluster data... | {
"content_hash": "6cac5bd45e5d6445e12b0cdeaf0e2146",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 107,
"avg_line_length": 39,
"alnum_prop": 0.5154280747501087,
"repo_name": "sadsfae/openstack-lab-tools",
"id": "5eaf7079aea6810e10fb7f0fced729c96038b6d7",
"size": "2486",
... |
import requests
import json
from django.conf import settings
try:
import rados
import rbd
WITH_RADOS = True
except ImportError:
WITH_RADOS = False
class CephClient():
def __init__(self):
if WITH_RADOS:
try:
self._ceph_cluster = rados.Rados(
... | {
"content_hash": "7570044488987567afea51e760ae6b6f",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 80,
"avg_line_length": 36.6875,
"alnum_prop": 0.44804088586030666,
"repo_name": "CiscoSystems/CephEWS",
"id": "bae4c8fbb22f09b84281143729dd6c7d5ea99375",
"size": "11729",
... |
"""Utilities related to FeatureColumn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.framework.python.framework import checkpoint_utils
from tensorflow.contrib.framework.python.framework import experimental
from tensorflow.contr... | {
"content_hash": "657c273ddab14edf037f85e0f425fc90",
"timestamp": "",
"source": "github",
"line_count": 866,
"max_line_length": 109,
"avg_line_length": 41.495381062355655,
"alnum_prop": 0.6514540141922917,
"repo_name": "tongwang01/tensorflow",
"id": "16ecd92e6705afd360f18198e33abbd702569ed1",
"size... |
from django.db import models
from professional.models import Professional
from titles.models import Adaptation
from character.models import Character
class Role(models.Model):
title = models.ForeignKey(Adaptation)
character = models.ForeignKey(Character, null=True)
ROLE_CHOICES = [
'Director',... | {
"content_hash": "8ab2e8309a41eee712a8308156749d4a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 58,
"avg_line_length": 30.26923076923077,
"alnum_prop": 0.5984752223634053,
"repo_name": "vivyly/fancastic_17",
"id": "667c286578ebe338ac2b567acb88a1777f5f76b1",
"size": "7... |
from setuptools import setup, Extension
mdbsmodule = Extension(
'mdbs',
sources=['mdbsmodule.c'])
setup(
ext_modules=[mdbsmodule])
| {
"content_hash": "91795078958bb5f6f22bd0dc8c4d456a",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 39,
"avg_line_length": 18.125,
"alnum_prop": 0.6896551724137931,
"repo_name": "cheeseywhiz/cheeseywhiz",
"id": "6b7566b32288c5c36172612e34911d57cb39d511",
"size": "145",
"... |
import mock
import six
from sahara.plugins.cdh.v5_3_0 import edp_engine
from sahara.plugins.cdh.v5_3_0 import versionhandler
from sahara.tests.unit import base
class VersionHandlerTestCase(base.SaharaTestCase):
plugin_path = "sahara.plugins.cdh.v5_3_0."
cloudera_utils_path = plugin_path + "cloudera_utils.Cl... | {
"content_hash": "0246fb33d160049d453fef78e16dc43e",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 42.112,
"alnum_prop": 0.6221504559270516,
"repo_name": "shakamunyi/sahara",
"id": "61daf64543ce46ba03d9567d9c277d3c5c6d184f",
"size": "5852",
"bin... |
import logging
import os
import re
import shutil
from cloudException import CloudRuntimeException, CloudInternalException, formatExceptionInfo
from configFileOps import configFileOps
from networkConfig import networkConfig
from utilities import writeProgressBar, bash
class serviceCfgBase(object):
def __init__(se... | {
"content_hash": "5d7c1e17e8bbadf37a72a5ef4d5d0e68",
"timestamp": "",
"source": "github",
"line_count": 741,
"max_line_length": 172,
"avg_line_length": 36.75978407557355,
"alnum_prop": 0.5652924116156981,
"repo_name": "remibergsma/cosmic",
"id": "7f33cc3c23e0e5949ff8db4cded9eb3921b963dd",
"size": "... |
import sys
import os
import py
import re
import subprocess
import inspect
class Interpreters:
def __init__(self):
self.name2executable = {}
self.executable2info = {}
def get_executable(self, name):
""" return path object to the executable for the given
name (e.g. python2.6, pyt... | {
"content_hash": "5cd92e5cd07d4d36aeddaf01916c48b6",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 72,
"avg_line_length": 32.22093023255814,
"alnum_prop": 0.5743413929989174,
"repo_name": "msabramo/tox",
"id": "e225fcc13515ea33e48c4e32f1d9b8fab26ba05b",
"size": "5542",
... |
"""
Geometry factories based on the geo interface
"""
from .point import Point, asPoint
from .linestring import LineString, asLineString
from .polygon import Polygon, asPolygon
from .multipoint import MultiPoint, asMultiPoint
from .multilinestring import MultiLineString, asMultiLineString
from .multipolygon import Mul... | {
"content_hash": "c67715285e2519740a5a595aa1ef6e6d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 77,
"avg_line_length": 35.890243902439025,
"alnum_prop": 0.6540944614339109,
"repo_name": "l00py/KML_Lookup",
"id": "96f301c8c1cc2975668eb1598774dfb71d70386b",
"size": "294... |
"""
Request object
==============
This module implements a request object.
"""
__author__ = u"Andr\xe9 Malo"
__docformat__ = "restructuredtext en"
import itertools as _it
import re as _re
from wtf import httputil as _httputil
class CookieCodecFactoryInterface(object):
""" Interface for cookie codec factories "... | {
"content_hash": "4e231e7f4ee341fa607489f8608d73b0",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 79,
"avg_line_length": 24.808917197452228,
"alnum_prop": 0.5609756097560976,
"repo_name": "wontfix-org/wtf",
"id": "c6fb98fc10e732f198e0829b7db5453e147dcb51",
"size": "453... |
import os
from subprocess import Popen, STDOUT, PIPE
pwd = os.path.dirname(__file__)
def setup():
# Change directory
os.putenv('PWD', pwd)
os.chdir(pwd)
def test_run():
# Run the simulation
proc = Popen([pwd + '/../../src/openmc'], stderr=STDOUT, stdout=PIPE)
returncode = proc.wait()
# ... | {
"content_hash": "b2322bb2cc78228bf57f8e3fbc973f44",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 73,
"avg_line_length": 23.967741935483872,
"alnum_prop": 0.6339165545087483,
"repo_name": "keadyk/openmc_mg_prepush",
"id": "d858aec2d9f3e6cad83ae6a26a7b842618ab984d",
"siz... |
from __future__ import annotations
import os
import signal
from datetime import datetime, timedelta
from tempfile import NamedTemporaryFile, TemporaryDirectory
from time import sleep
from unittest import mock
import pytest
from parameterized import parameterized
from airflow.exceptions import AirflowException, Airfl... | {
"content_hash": "e10b36758f7d88d815a603ae16dbd7a5",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 109,
"avg_line_length": 38.95876288659794,
"alnum_prop": 0.5861338978565758,
"repo_name": "apache/airflow",
"id": "9efad3bab83c4cfd5b644e4dd2fea4643fcb4707",
"size": "8345... |
from __future__ import print_function
from ..data import DataBlock
from ..preprocess import PreProcess
import pandas as pd
import numpy as np
from sklearn.datasets import load_iris
from random import sample
#####################################################################
##### TESTS FOR DATABLOCK
#############... | {
"content_hash": "8835d2a3f70fb7885f1fa27642aa4640",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 69,
"avg_line_length": 31.804878048780488,
"alnum_prop": 0.5820552147239264,
"repo_name": "aarshayj/easyML",
"id": "201c13266070803088b5eee33e10562fdb79a614",
"size": "1475... |
def install(job):
prefab = job.service.executor.prefab
data = job.service.model.data
# create a pool for the images and virtual disks
pool = prefab.virtualization.kvm.storage_pools.create(name=data.name)
data.path = pool.poolpath
job.service.model.actions['uninstall'].state = 'new'
job.ser... | {
"content_hash": "19ed457546f2b8b54bf50628eb1f0bf3",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 78,
"avg_line_length": 29.708333333333332,
"alnum_prop": 0.6928471248246845,
"repo_name": "Jumpscale/ays9",
"id": "5cdead3565c4d3f36b9f2e7201ec4d8c6236811b",
"size": "713",... |
"""This module contains Splittable DoFn logic that's common to all runners."""
import uuid
import apache_beam as beam
from apache_beam import pvalue
from apache_beam.coders import typecoders
from apache_beam.pipeline import AppliedPTransform
from apache_beam.pipeline import PTransformOverride
from apache_beam.runners... | {
"content_hash": "5ca082dc9d4c328857c4a0fbdfa0c44d",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 80,
"avg_line_length": 32.980132450331126,
"alnum_prop": 0.7224899598393574,
"repo_name": "jbonofre/incubator-beam",
"id": "a7d80ac8b180cdb17bb6e42433dfe1385ca48e64",
"siz... |
class StateException(BaseException):
def __init__(self, state):
self.state = state
def __str__(self):
return '{} {:x} exception'.format(
self.state.id, self.state.ip)
class EmulationFinished(StateException):
pass
class InstructionNotTranslated(StateException):
pass
cl... | {
"content_hash": "8571743258aedc20f65ad07272c32ecd",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 72,
"avg_line_length": 26.80246913580247,
"alnum_prop": 0.545601105481345,
"repo_name": "c01db33f/concolica",
"id": "4325cf04bff2abd3d34ccb322489f68a01963c88",
"size": "52... |
"""
Subclass of Simulation that contains additional methods to construct database.
"""
import sys
import logging
from reader import Simulation
class Constructor(Simulation):
def commit(self):
"""
commits database changes
"""
self.conn.commit()
def create_table(self, table,... | {
"content_hash": "62535189af3c0fa0617b86c06d73dd92",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 97,
"avg_line_length": 29.65024630541872,
"alnum_prop": 0.5103837846818409,
"repo_name": "cavestruz/L500analysis",
"id": "95037535b309dd879579897683463d594189a321",
"size"... |
import logging
import psycopg2
import psycopg2.extensions
from google.cloud.sqlcommenter import add_sql_comment
from google.cloud.sqlcommenter.flask import get_flask_info
from google.cloud.sqlcommenter.opencensus import get_opencensus_values
from google.cloud.sqlcommenter.opentelemetry import get_opentelemetry_values
... | {
"content_hash": "c60e95d893c401eafca9d3e26b8267d4",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 39.478873239436616,
"alnum_prop": 0.6518016410988227,
"repo_name": "google/sqlcommenter",
"id": "28c26453bc69749921bd2dd8754b35ed9824d559",
"size": "... |
from django.conf import settings
from django.core.files import File
from sfmmanager.models import *
from sfmmanager.storage_utils import ResourceData, UserData
from sfmmanager.tasks import *
import sfmmanager #needed for mocking parts of it
from .base import *
import mock
import StringIO
import shutil
import os
impo... | {
"content_hash": "c757b8abd50a345b46a6c60465c27db6",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 107,
"avg_line_length": 43.29032258064516,
"alnum_prop": 0.6523845007451565,
"repo_name": "qwattash/uclvr-backend",
"id": "196318125df7cbbf5479a0ee34687cf39d68c689",
"size"... |
import cirq
import qflexcirq.interface.data_storage_interface as tmpi
from qflexcirq.ordering import order_circuit_simulation as auto_order
class QFlexOrder():
def __init__(self,
qflex_order_strings=None,
cirq_circuit=None,
qubits=None):
if (qflex_ord... | {
"content_hash": "eef9865ef2ec77d49a780dd34d3b7a95",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.6032,
"repo_name": "ngnrsaa/qflex",
"id": "518aa4f21216e0d643bafae2b2b6915cf58ba095",
"size": "1875",
"binary": ... |
import os.path
import shutil
import invoke
@invoke.task
def build():
# Build our CSS files
invoke.run("compass compile -c compass.rb --force")
# Clean existing directories
for directory in {"css", "fonts", "js"}:
shutil.rmtree(os.path.join("warehouse/static", directory))
# Run wake to g... | {
"content_hash": "dd0e4f8969f99fd6ad82efefed0bf4dc",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 66,
"avg_line_length": 20.23076923076923,
"alnum_prop": 0.6463878326996197,
"repo_name": "mattrobenolt/warehouse",
"id": "b5829d5013a7fb2116aba568393b9ba5910e8485",
"size":... |
from abc import ABCMeta, abstractmethod
class Person:
def __init__(self, name, gender, marital_status):
self.name = name
self.gender = gender
self.marital_status = marital_status
def get_name(self):
return self.name
def get_gender(self):
return self.gender
d... | {
"content_hash": "b6048020aa205fbdb407b5949a9fe4c0",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 78,
"avg_line_length": 26.192,
"alnum_prop": 0.6362248014660965,
"repo_name": "kkaushik24/python-design-patterns",
"id": "d925a36dc256bfb9953c17c29d686ee863ff4a7f",
"size"... |
"""Realize a Pi-shaped fuzzy set"""
__revision__ = "$Id: PiFunction.py,v 1.19 2010-03-28 18:44:46 rliebscher Exp $"
from fuzzy.set.Function import Function
from fuzzy.set.SFunction import SFunction
from fuzzy.set.ZFunction import ZFunction
class PiFunction(Function):
r"""
Realize a Pi-shaped fuzzy set::
... | {
"content_hash": "1be6404e53afdd3dcf4402899c957243",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 113,
"avg_line_length": 29.378048780487806,
"alnum_prop": 0.5325861353258613,
"repo_name": "avatar29A/pyfuzzy",
"id": "cb3e992adbad8e2235f66ae2528e238e2227160d",
"size": "3... |
"""
Test utility class which simplifies construction of token streams.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import unittest
from spreadflow_core.script import Context, NoContextError
class ContextTestCase(unittest.TestCase):
"""
U... | {
"content_hash": "0e2a4c1b5972e748825e7f693082eca9",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 66,
"avg_line_length": 26.40983606557377,
"alnum_prop": 0.6014897579143389,
"repo_name": "spreadflow/spreadflow-core",
"id": "3f32a4a70006a7a4c6d468fe7e15667e35374f8b",
"si... |
"""Test for the retaliate strategy."""
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestRetaliate(TestPlayer):
name = "Retaliate (0.1)"
player = axelrod.Retaliate
expected_classifier = {
'memory_depth': float('inf'), # Long memory
... | {
"content_hash": "76f0feabf48c36aed48a8d78d0f2e3f4",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 32.91919191919192,
"alnum_prop": 0.585455661245781,
"repo_name": "ranjinidas/Axelrod",
"id": "4dcb033db0af59f4902caf1b5e2ff5c494cf1258",
"size": "325... |
import os
PROJECT_ROOT = os.path.normpath(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgr... | {
"content_hash": "00cbb1e23f0b4673fdd2596adbdee411",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 122,
"avg_line_length": 33.98837209302326,
"alnum_prop": 0.6886760177899418,
"repo_name": "uroslates/django-allauth",
"id": "a4ffd66bbb458417e41390f8545105e5db9253e0",
"si... |
import argparse
import io
from operator import itemgetter
import os.path
import six
import socket
from string import Template
import sys
import lxml.etree
from requestbuilder import Arg
import requestbuilder.auth.aws
from requestbuilder.exceptions import ArgumentError, AuthError, ClientError
from requestbuilder.mixins... | {
"content_hash": "7d1d28475998cad657c740a02cdaa246",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 80,
"avg_line_length": 46.06825938566553,
"alnum_prop": 0.5431545414135428,
"repo_name": "jhajek/euca2ools",
"id": "c332d6e630760bfbd6ba3121de465140b93e3e5c",
"size": "283... |
"""
The implementation of the NNLM model with only local context.
"""
from model_util import *
import io_read_ngram
import codecs
import theano
import theano.tensor as T
import numpy as np
class ModelNNLM(object):
def __init__(self, context_size, in_vocab_size, emb_dim, hidden_sizes, act_func, n_out, pretrain_fi... | {
"content_hash": "fbcfd1e11c69c360ec59c3043f0fc37d",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 159,
"avg_line_length": 36.92934782608695,
"alnum_prop": 0.5736571008094187,
"repo_name": "yuhaozhang/nnjm-global",
"id": "506c5f90cf299232faced882f0ecdaf228e1959d",
"size... |
import os, random
import numpy as np
from PIL import Image, ImageDraw
from printing import print_error
def normalize(data, std):
'''
Data patch is constrast normalized by this method. The second argument std should be the standard deviation of
the patch dataset.
'''
m = np.mean(data)
data = (da... | {
"content_hash": "c9882ce07960d69e41ede32c96374531",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 114,
"avg_line_length": 35.06711409395973,
"alnum_prop": 0.6120574162679426,
"repo_name": "olavvatne/CNN",
"id": "ca1c5e5c3d4f9a9440e0b19c3bcdfd217b1874d2",
"size": "5225"... |
import numpy as np
import pandas
import matplotlib as mpl
import matplotlib.pyplot as plt
import sys
import glob
myColors = ["b", "g", "r", "c", "m", "y", "k", "b", "k", "c"]
argv = sys.argv
if len(argv) < 2:
print ("direcrory name required")
exit()
name_dir = argv[1]
max_x = 0
max_y = 0
legends = []
files = glob... | {
"content_hash": "93efd61acabb74012468443fa894d504",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 142,
"avg_line_length": 36.22727272727273,
"alnum_prop": 0.7023212045169385,
"repo_name": "undertherain/vsmlib",
"id": "a9b74f43cad84b51256acbd1fc8b34b865c8f8ec",
"size": "... |
"""This file contains various utility classes used by GRR."""
import errno
import functools
import getpass
import io
import os
import pathlib
import pipes
import queue
import random
import re
import shutil
import socket
import struct
import tarfile
import tempfile
import threading
import time
from typing import Generi... | {
"content_hash": "7c5874b12e034dc4277c6989b41f349e",
"timestamp": "",
"source": "github",
"line_count": 1349,
"max_line_length": 97,
"avg_line_length": 27.7175685693106,
"alnum_prop": 0.6564146452354844,
"repo_name": "google/grr",
"id": "b9e33671b8a65e552bc1272972c712ae2ce47543",
"size": "37413",
... |
import objgraph
import arcpy
class MemUsage(object):
def __init__(self, f):
self.f = f
def __call__(self):
print("---objects at start---")
objgraph.show_growth(limit=3)
self.f()
print("---objects at end---")
objgraph.show_growth()
@MemUsage
def search():
... | {
"content_hash": "9c6013f8ce125645b6c6eaebd17c32ab",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 96,
"avg_line_length": 20.625,
"alnum_prop": 0.5196969696969697,
"repo_name": "phillipsj/py-profilig-presentation-2014",
"id": "64fa16d20cffe33a54261133502d1812f42defe5",
"... |
"""
Schedule Primitives in TVM
==========================
**Author**: `Ziheng Jiang <https://github.com/ZihengJiang>`_
TVM is a domain specific language for efficient kernel construction.
In this tutorial, we will show you how to schedule the computation by
various primitives provided by TVM.
"""
from __future__ impo... | {
"content_hash": "3d7ea0cd60838a5ab9aeeca861391ea5",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 79,
"avg_line_length": 36.130208333333336,
"alnum_prop": 0.5645091538128875,
"repo_name": "sxjscience/tvm",
"id": "eb48dc218cdda18cd6e1bca2dd1ff1d6d5eea23f",
"size": "7722... |
import os
import sys
import codecs
import platform
try:
from setuptools import setup, find_packages, Command
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages, Command
import djcelery_email as distmeta
class RunTests(Command):
de... | {
"content_hash": "34453aae18c69117174196e78b62653f",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 83,
"avg_line_length": 29.435897435897434,
"alnum_prop": 0.6276132404181185,
"repo_name": "andresriancho/django-celery-email",
"id": "ab0e8d0072f29a316c8611c2a6086f0973faabbb... |
from django.db import models
from django.db.models import Q
from django.urls import reverse
from django_extensions.db.models import (ActivatorModel,
TimeStampedModel)
from djgeojson.fields import PointField
from tagulous.models import TagField
from market.apps.core.models impo... | {
"content_hash": "6bd4d6899b504d9fec41e737bf45a817",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 90,
"avg_line_length": 30.914285714285715,
"alnum_prop": 0.640018484288355,
"repo_name": "justinbot/sdd-farmers",
"id": "9e59d803fef5ce9b6a368e2595fd959e6206ea21",
"size": ... |
from __future__ import absolute_import, unicode_literals
import datetime
from django.conf import settings
from django.forms import *
from django.forms.extras import SelectDateWidget
from django.forms.util import ErrorList
from django.test import TestCase
from django.utils import translation
from django.utils.encoding... | {
"content_hash": "9e6f9b97fdaf5989e1262f1d2ef7c030",
"timestamp": "",
"source": "github",
"line_count": 780,
"max_line_length": 175,
"avg_line_length": 41.52051282051282,
"alnum_prop": 0.6348422157722473,
"repo_name": "azurestandard/django",
"id": "28b6c12453019e53a2736dc08349c1e5348a7768",
"size":... |
"""
Scheduler Service
"""
import eventlet
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_utils import excutils
from oslo_utils import importutils
import six
from cinder import context
from cinder import db
from cinder import exception
from cinder import fl... | {
"content_hash": "ffcdb64cc84b8cd87cdffd32eb22cb2d",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 79,
"avg_line_length": 42.45387453874539,
"alnum_prop": 0.5280312907431551,
"repo_name": "potsmaster/cinder",
"id": "352db2376aee8044894a910c751aecc267f936f2",
"size": "12... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('adoffice', '0026_category_items_title'),
]
operations = [
migrations.AddField(
model_name='category',
name='items_title_en',... | {
"content_hash": "0a11693da77c112e63ec9b31597b0a96",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 123,
"avg_line_length": 30.26086956521739,
"alnum_prop": 0.6063218390804598,
"repo_name": "kobox/achilles.pl",
"id": "74fb17ace75fa1d6d9f094df061673b370a978af",
"size": "72... |
import sys
import re
def main():
for filename in sys.argv[1:]:
try:
f = open(filename, 'r')
except IOError as msg:
print(filename, ': can\'t open :', msg)
continue
with f:
line = f.readline()
if not re.match('^#! */usr/local/bin/p... | {
"content_hash": "231c0f8a0923c4d6d43913be54955992",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 28.03846153846154,
"alnum_prop": 0.4663923182441701,
"repo_name": "batermj/algorithm-challenger",
"id": "725300e56a27db4a7a413b11cd074210c51881eb",
"... |
import os
from thumblr.dto import ImageMetadata
from thumblr.models import Image, ImageSize
from thumblr.utils.hash import file_hash
def create_image(uploaded_file, image_metadata):
assert isinstance(image_metadata, ImageMetadata)
image = Image()
image.file_name = image_metadata.file_name
image.site... | {
"content_hash": "94b158392db211b786388fdaf626e0c3",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 96,
"avg_line_length": 30.246575342465754,
"alnum_prop": 0.708786231884058,
"repo_name": "unisport/thumblr",
"id": "bdb915cc08671d18662ec1d20e4ccb73bb622ddc",
"size": "2208... |
from setuptools import find_packages, setup
import os
dir_path = os.path.dirname(os.path.realpath(__file__))
long_description = """
Pipelign
--------
An automated pipeline for multiple sequence alignment.
"""
setup(
name='pipelign',
version='0.1',
author='Mukarram Hossain',
author_email='asmmh2@cam.... | {
"content_hash": "d98dd937415d5732da6249e38574280b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 55,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.64,
"repo_name": "asmmhossain/pipelign",
"id": "5943b0cc9bfa9b5cb9c164e96232d6512ba0e5cd",
"size": "700",
"bina... |
from typing import List
class BaseParseError(ValueError):
pass
class ParseResultError(BaseParseError):
pass
class ParseError(BaseParseError):
pass
class ParseActionError(BaseParseError):
def __init__(self, expr: str, tokens: List, string: str, **kwargs):
tpl = kwargs.pop('tpl', (
... | {
"content_hash": "491ae81cee1db0004a4eeb14662d3e06",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 23.26086956521739,
"alnum_prop": 0.5981308411214953,
"repo_name": "RulersOfAsgard/alamo-common",
"id": "51177bd0d7bd043312b1a72275cea52eec28365d",
"s... |
"""
Created on Mon Oct 2 22:42:37 2017
@author: Ameen
"""
from django.shortcuts import render
def pathfinder(request):
return render(request, 'pathfinder.html') | {
"content_hash": "1a6ad546a7173a544446941564bd260b",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 16.8,
"alnum_prop": 0.7202380952380952,
"repo_name": "mdameenh/elysia",
"id": "de7231ee311ebba6bbb9ba19311cca7a37cb31bc",
"size": "192",
"binary": ... |
"""
Django settings for django_db project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | {
"content_hash": "c6a354c3a98a66b0e89f7ddfb333a672",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 71,
"avg_line_length": 24.158536585365855,
"alnum_prop": 0.7218576476527007,
"repo_name": "wfarn/scratchpad",
"id": "bff21f5e506780e8c85bb49e35b6a49dc8d1e864",
"size": "198... |
_q_exports = [
'_q_index',
'query',
]
from quixote.errors import AccessError
from canary.qx_defs import NotLoggedInError
from canary.ui.stats import stats_ui
_q_index = stats_ui._q_index
query = stats_ui.query
def _q_access (request):
if request.session.user == None:
raise NotLoggedInError('... | {
"content_hash": "e74c8cb40f71d4231045cced9cffd968",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 64,
"avg_line_length": 27.3,
"alnum_prop": 0.6794871794871795,
"repo_name": "dchud/sentinel",
"id": "4b8d3c5eace5c9f7aa995c74dc3e24f7d55b864e",
"size": "554",
"binary": f... |
def return_truey():
return True
def return_falsey():
return False
| {
"content_hash": "a9b7c8db0955f2aff49ec8fbdad266ba",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 20,
"avg_line_length": 12.666666666666666,
"alnum_prop": 0.6578947368421053,
"repo_name": "ealonas/Markus",
"id": "337e50d52395046400d3d6b67c515510f694fade",
"size": "76",
... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cfehosts.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is re... | {
"content_hash": "f714d4b4b56897e80618b6ed90c4a63a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.6211734693877551,
"repo_name": "codingforentrepreneurs/CFE-Django-Hosts",
"id": "8634ef8a96fa3c94a643199c84f096df78... |
#!/usr/bin/env python
# coding=utf-8
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs strace or dtrace on a test and processes the logs to extract the
dependencies from the source tree.
Automat... | {
"content_hash": "cb2ecf85ee2415dc42951e8e4621ed64",
"timestamp": "",
"source": "github",
"line_count": 1451,
"max_line_length": 83,
"avg_line_length": 32.48793935217092,
"alnum_prop": 0.5901569792108613,
"repo_name": "gx1997/chrome-loongson",
"id": "f0e9b17c145439ac530a21b8c278a5ba95c9b0bd",
"size... |
from django.shortcuts import render, redirect
from django.urls import reverse
from django.contrib import messages
from django.forms.formsets import formset_factory
from django.http import JsonResponse
from django.views.generic import (
ListView,
CreateView,
UpdateView
)
from django.db.models import Value
fr... | {
"content_hash": "1b807ff71a98698f50eab26ac3be4c16",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 144,
"avg_line_length": 41.99603174603175,
"alnum_prop": 0.6586979117452518,
"repo_name": "luisen14/treatment-tracking-project",
"id": "f2193c3ecffb65c28bfea6481b332d141ea7c... |
class RemotePHPUnitSettings:
PLUGIN_FOLDER = 'remote-phpunit'
def __init__(self, sublime):
self._settings_file = self.PLUGIN_FOLDER + '.sublime-settings'
self._sublime = sublime
@property
def root(self):
return self._get('root')
@property
def cl_options(self):
... | {
"content_hash": "74e3ae929426846f5b41e79b36994dab",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 70,
"avg_line_length": 23.612903225806452,
"alnum_prop": 0.6092896174863388,
"repo_name": "ldgit/remote-phpunit",
"id": "c20d8b086b1600eb706221417a985e2272bf7887",
"size": ... |
__author__ = 'Alex Bo'
__email__ = 'bosha@the-bosha.ru'
from torhandlers.templating.base import BaseTemplater
class TornadoTemplater(BaseTemplater):
"""
Dummy class for support base tornado template engine
"""
| {
"content_hash": "b5fa8a3fe5dcc83e9371e0faa03f9f12",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 24.88888888888889,
"alnum_prop": 0.7098214285714286,
"repo_name": "bosha/torhandlers",
"id": "c977b1ee512cf84df7b47213d17e342a90a787db",
"size": "248"... |
from __future__ import absolute_import
import os
from celery import Celery
from django.conf import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hydroshare.settings')
os.environ.setdefault('PYTHONPATH', '/hydroshare/hydroshare')
app = Celery('hydroshare', backend='amqp://')
app.config_from_object('djang... | {
"content_hash": "84fef9f435de5b127a92eb67a674841c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 28.58823529411765,
"alnum_prop": 0.7613168724279835,
"repo_name": "FescueFungiShare/hydroshare",
"id": "b04b29661818adae2c741f81c4e8f8c2c3dfc00f",
"s... |
from django.core.exceptions import ImproperlyConfigured
from django.db.models.fields import CharField, DecimalField
from django.utils.translation import gettext_lazy as _
from phonenumber_field.modelfields import PhoneNumberField
from oscar.core import validators
from oscar.forms import fields
from oscar.models.fields... | {
"content_hash": "5974565592e1f17641310dae207060b1",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 127,
"avg_line_length": 32.582089552238806,
"alnum_prop": 0.6266605588639487,
"repo_name": "django-oscar/django-oscar",
"id": "d1e4920db44c51f5b31223a9f5ceda25e8ef2454",
"... |
import sys
from alembic.testing import TestBase, config, mock
from sqlalchemy import MetaData, Column, Table, Integer, String, \
ForeignKeyConstraint
from alembic.testing import eq_
py3k = sys.version_info >= (3, )
from ._autogen_fixtures import AutogenFixtureTest
class AutogenerateForeignKeysTest(AutogenFixtu... | {
"content_hash": "8538475bfa93e212538b8a9ef478d6f8",
"timestamp": "",
"source": "github",
"line_count": 900,
"max_line_length": 78,
"avg_line_length": 31.82777777777778,
"alnum_prop": 0.4754756502007331,
"repo_name": "chishaku/alembic",
"id": "0a5b1de2ccb7af36d98ae1a14d2ba1b16a932877",
"size": "286... |
import argparse
import logging
import os
import random
import uuid
from datetime import datetime
from time import sleep
from client import Tutor
class ExampleTutor(Tutor):
def __init__(self, entity_id, api_key, logger=None, run_once=None, args = None):
super().__init__(entity_id, api_key, self.main_callba... | {
"content_hash": "9c5e8cf096094c8611284dc8fa619d14",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 26.939393939393938,
"alnum_prop": 0.6017997750281214,
"repo_name": "adlnet/HPIT-python-client",
"id": "0ba6e9536d8f69804647ced3ed26713ccf89fccc",
"si... |
"""This sample application demonstrates the app class way to use configman."""
# there are two ways to invoke this app:
# .../generic_app.py --admin.application=demo3.Demo3App
# .../demo3.py
# this demo differs from demo2.py in the manner in which it works with
# configman. Rather than being a linear procedure, t... | {
"content_hash": "963085599906200ce22f8cd6379126de",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 38.74025974025974,
"alnum_prop": 0.6842105263157895,
"repo_name": "twobraids/configman_orginal",
"id": "bfbfa01fca9689c71fb40614814e8d02622a4a27",
"s... |
from __future__ import print_function
import getopt
import os
import shutil
import sys
from Command import CommandRunner, Usage
all_versions = [
'2.3.7',
'2.4.5',
#'2.5.2',
'2.6',
]
def main(argv=None):
if argv is None:
argv = sys.argv
all = False
downloads_dir = 'Downloads'
... | {
"content_hash": "b8603a47a1ac03cc02972922fabeac27",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 94,
"avg_line_length": 28.28440366972477,
"alnum_prop": 0.5296788842036977,
"repo_name": "timj/scons",
"id": "5c947ac85011f4c3481ac2cb531e17e6ff2a555a",
"size": "3402",
... |
from test_framework.test_framework import DeuscoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
import binascii
COIN = 100000000
MAX_REPLACEMENT_LIMIT = 100
def satoshi_round(amount):
return Decimal(amount).quantize(Decimal('0.00000001'),... | {
"content_hash": "63d842305b50ddb812e6c2f6f7617b37",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 105,
"avg_line_length": 37.337907375643226,
"alnum_prop": 0.5825523704520397,
"repo_name": "deuscoin-org/deuscoin-core",
"id": "ed9cc845b8ac05266d055cf00b9b47bb855343af",
... |
""" Settings for my_project """
from .base import *
try:
from .local import *
except ImportError, exc:
exc.args = tuple(
['%s (did you rename settings/local-dist.py?)' % exc.args[0]])
raise exc
| {
"content_hash": "f1d9bc02a106ef4963081c57cc0d7563",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 23.88888888888889,
"alnum_prop": 0.6139534883720931,
"repo_name": "jangeador/django_sample",
"id": "e95bdbeec67b6aa0384c541c51fd569d2b83c2ff",
"size":... |
"""Constants for the Risco integration."""
from homeassistant.const import (
CONF_SCAN_INTERVAL,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
)
DOMAIN = "risco"
RISCO_EVENT = "risco_event"
DATA_COORDINATOR = "risco"
EVENTS_COORDINATOR = "risco_events"
DEFAULT_SCAN_INTERVAL = 30
TYPE_LOCAL = "local"... | {
"content_hash": "0b2636782e9ef9be04c7aadf2550cf5a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 86,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.7046875,
"repo_name": "w1ll1am23/home-assistant",
"id": "9f0e71701c65b915c8e2c8cfa56c595681fea100",
"size": "1280... |
import os
import sys
import shutil
class NoDirectoriesError(Exception):
"Error thrown when no directories starting with an underscore are found"
class DirHelper:
def __init__(self, is_dir, list_dir, walk, rmtree):
self.is_dir = is_dir
self.list_dir = list_dir
self.walk = walk
... | {
"content_hash": "8b568ef136ba3cfbee7a83882edf4225",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 79,
"avg_line_length": 29.380782918149468,
"alnum_prop": 0.5868459302325582,
"repo_name": "quantmind/lux",
"id": "c2b23c562f9277afb04fb53c65cc5c7987c9694b",
"size": "8256"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from pybullet_envs.minitaur.envs import minitaur_raibert_controller
from pybullet_envs.minitaur.envs import minitaur_gym_env
flags = tf.app.flags
FLAGS = tf.app.flags.FLAGS
flags.DEFIN... | {
"content_hash": "776ddab04b682e01cb3764e0b0c6a7f0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 99,
"avg_line_length": 36.74576271186441,
"alnum_prop": 0.5641143911439115,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "40e6b4799990843078bcfbe037c9da218e69ac79",
"size": "2... |
from django.apps import AppConfig
class SongsArtistsConfig(AppConfig):
name = 'songs_artists'
| {
"content_hash": "b56f26e383cc01cb382f50f3ca789c9f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 20,
"alnum_prop": 0.77,
"repo_name": "forever-Agriculture/lyrics_site",
"id": "a405cb29a4a6d5faed09ea2ed20051e186fb8ddd",
"size": "100",
"binary": f... |
"""
Tests for the sprockets.clients.cassandra package
"""
import os
import socket
import time
from cassandra.cluster import Cluster
from cassandra.protocol import SyntaxException
from tornado.testing import AsyncTestCase, gen_test
from sprockets.clients.cassandra import CassandraConnection
class TestCassandraConne... | {
"content_hash": "88e119a1cf83aef3142355e8bca59d66",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 75,
"avg_line_length": 34.52564102564103,
"alnum_prop": 0.6435202376531749,
"repo_name": "sprockets/sprockets.clients.cassandra",
"id": "5ad5460bb626ab1efd8a0d4f0b18b08c15135... |
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns(
'post.views',
url(r'^list/$', 'object_list', name='post_object_list'),
url(r'^(?P<slug>[\w-]+)/$', 'object_detail', name='post_object_detail'),
)
| {
"content_hash": "e7d28e7e76e9fc88e95cbfc5bc36e2fb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 76,
"avg_line_length": 33.57142857142857,
"alnum_prop": 0.6340425531914894,
"repo_name": "praekelt/panya-post",
"id": "7142d6cb0f311262a2c471568469797edca38ff7",
"size": "23... |
import datetime as dt
from collections import OrderedDict
from collections.abc import Iterable, Mapping
from decimal import Decimal
from itertools import chain as iter_chain
from .typing import DSet, DObject, DSetBase
from .metaclass import DObjectMetaClass
# from ._reshape import ReshapeOperator
class dobject(DObje... | {
"content_hash": "17593ab5eff0dcdbf6f64ec7fbc4ed36",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 36.61244019138756,
"alnum_prop": 0.5065342394145321,
"repo_name": "lcgong/domainics",
"id": "e4eb98f18e9297abb5b509d5710a351942c71aa0",
"size": "767... |
__author__ = 'phithon'
import tornado.web
from controller.base import BaseHandler
from tornado import gen
import time, pymongo, os, uuid
from bson.objectid import ObjectId
from util.function import random_str, hash, intval
class AdminHandler(BaseHandler):
def initialize(self):
super(AdminHandler, self).ini... | {
"content_hash": "c2581778cc384d17a51c7b5b7b45d14e",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 111,
"avg_line_length": 37.63,
"alnum_prop": 0.5079723624767473,
"repo_name": "resec/superhero",
"id": "4465b4b2a6e6300a3499e2f1c3b07da1051876ab",
"size": "7804",
"binar... |
import json
import collections
Edge = collections.namedtuple("Edge",["source","dest","type"])
class GraphHelper( object ):
def __init__(self):
self.counters = collections.defaultdict(lambda: 0)
self.nodes = set()
self.edges = set()
def dumps(self):
return json.dumps({
... | {
"content_hash": "29e432da4c7d8e9d0d165aaad023901c",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 138,
"avg_line_length": 33.142857142857146,
"alnum_prop": 0.5641163793103449,
"repo_name": "hexahedria/gated-graph-transformer-network",
"id": "6f1acc4e46efb29be693dd2736204... |
''' A grouped bar chart using a cleaned up version of the `Auto MPG dataset`_.
This examples demonstrates automatic handing of Pandas GroupBy objects and
colormapping nested factors with ``factor_cmap``. A hover tooltip displays
information for each bar.
.. bokeh-example-metadata::
:sampledata: autompg
:apis: ... | {
"content_hash": "4ba0cb9d7747cb4edb271455f9dab22b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 107,
"avg_line_length": 35.875,
"alnum_prop": 0.7205574912891987,
"repo_name": "bokeh/bokeh",
"id": "7288c3e324e483d3a7af20ea138cec3fe1930cae",
"size": "1435",
"binary": ... |
from django import forms
from django.conf import settings
from django.utils import timezone
from django.utils.translation import gettext as _
from django.utils.translation import ngettext
from wagtail.admin import widgets
from wagtail.core.models import Page, PageViewRestriction
from .models import WagtailAdminModelF... | {
"content_hash": "328c0420520a9ea5fa14c0fc0490f2fb",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 156,
"avg_line_length": 45.51445086705202,
"alnum_prop": 0.6176022352044704,
"repo_name": "mixxorz/wagtail",
"id": "1a6b83f38f369d4da40bedc1d537b9a3648cb426",
"size": "787... |
def permutations(string):
permutations = []
return perm_helper(string, permutations, 0)
def perm_helper(string, perm, index):
if len(string) == index:
return []
else:
current_perm = perm_helper(string, perm, index + 1)
print index
return generate_perm(string[index], current_perm... | {
"content_hash": "626ba9ed84024d227c6ed2d059f0b521",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 66,
"avg_line_length": 26.133333333333333,
"alnum_prop": 0.5994897959183674,
"repo_name": "howardwkim/ctci",
"id": "216cb370e039135b6d376fd41b7edb83997577a0",
"size": "785"... |
"""`Trainable` interface."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
class Trainable(object):
"""Interface for objects that are trainable by, e.g., `Experiment`.
"""
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def fit(sel... | {
"content_hash": "c78b4f0ad446fc528757429c6e7ab88c",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 80,
"avg_line_length": 44.7962962962963,
"alnum_prop": 0.6614303431169904,
"repo_name": "martinwicke/tensorflow",
"id": "095d22f41f7445f94d31e7fcbb0e196f14f86ab6",
"size": ... |
import sys
import os
import shutil
import getopt
from pyarm import fig
from pyarm import clock as clock_mod
## Lionel's old format
#COMMAND_SLICE = slice(8, 14)
#ANGLES_SLICE = slice(2, 4)
#VELOCITIES_SLICE = slice(0, 2)
# Lionel's new format
COMMAND_SLICE = slice(18, 24)
ANGLES_SLICE = slice(10, 12)
VELOCITIES_SLIC... | {
"content_hash": "a45031a1422350d228d30becb6d632be",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 162,
"avg_line_length": 28.14814814814815,
"alnum_prop": 0.5342105263157895,
"repo_name": "jeremiedecock/pyarm",
"id": "b3857c7abee48b5c696642a208715e7e022bd9c6",
"size": ... |
import climate
import numpy as np
import os
import scipy.io.wavfile
import segmentaxis
logging = climate.get_logger('extract-windows')
# relatively prime window sizes, primes < 2**k (window size in ms):
# [3 7 13 31 61] 127 (7.94) 251 (15.68) 509 (31.81) 1021 (63.81)
@climate.annotate(
width=('generate windows ... | {
"content_hash": "9d4f20ab804ebafe34a78dcc6b03a09b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 80,
"avg_line_length": 34.23809523809524,
"alnum_prop": 0.6161335187760779,
"repo_name": "lmjohns3/speech-experiment",
"id": "9ecce2748a66034ee5d9d675be43c4d114e328d9",
"si... |
"""Tests for the PAM config checks."""
from absl import app
from grr_response_core.lib.parsers import linux_pam_parser
from grr_response_server.check_lib import checks_test_lib
from grr.test_lib import test_lib
class PamConfigTests(checks_test_lib.HostCheckTest):
@classmethod
def setUpClass(cls):
super(Pam... | {
"content_hash": "82d81a058cc631c66ed6679165e07cef",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 80,
"avg_line_length": 42.984042553191486,
"alnum_prop": 0.6593243410469002,
"repo_name": "google/grr",
"id": "bdc357d23d7e159107e3febf5c89951b7138ce08",
"size": "8129",
... |
from Tkinter import *
import random, sys, time
root = Tk()
root.wm_title("Flappy Bird")
width = 500
height = 500
canvas = Canvas(root, width = width, height = height, bg = "light blue")
canvas.pack()
pipe_speed = 5.0
player_jump = False
score = 0
player_pos = [20, height / 2, 40, height / 2 + 20]
canvas.create_rectan... | {
"content_hash": "d92f8fc64ca9d96fff39ad437015d5e2",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 147,
"avg_line_length": 31.638297872340427,
"alnum_prop": 0.6183591123066577,
"repo_name": "ananyacleetus/15-112",
"id": "23aaeb7b328c2f0dc457d8f662e8cb09de665bb8",
"size":... |
'''
Copyright 2016 University of Auckland
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 agre... | {
"content_hash": "1d1e28bf6e8093a3a7e10a9af730feb8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 75,
"avg_line_length": 31.076923076923077,
"alnum_prop": 0.7091584158415841,
"repo_name": "alan-wu/neon",
"id": "dd9d7f832061b95c30312421c0b2097bdeadc82a",
"size": "808",
... |
"""CRUD = Create Read Update Delete"""
import json
import pytest
import responses
from globus_sdk._testing import load_response_set, register_response_set
@pytest.fixture(autouse=True, scope="session")
def _register_group_responses():
group_id = "efdab3ca-cff1-11e4-9b86-123139260d4e"
register_response_set(
... | {
"content_hash": "384b064bebd7b8915fd5c2cc2ad263d2",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 83,
"avg_line_length": 36.87044534412956,
"alnum_prop": 0.4513011968815197,
"repo_name": "globus/globus-cli",
"id": "b012a0a4c1ef4e8591661b52f02392801d335658",
"size": "91... |
import cv2
import cv2.cv as cv
import numpy as np
import signal, os, subprocess, sys
import time
import threading
import requests
import io
from picamera.array import PiRGBArray
from picamera import PiCamera
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
from fractions import Fraction
#
GPIO.setup(18, GPIO.OUT)
ca... | {
"content_hash": "0076188615c656417af8ad169c72c029",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 97,
"avg_line_length": 29.392,
"alnum_prop": 0.5713119216113228,
"repo_name": "Cornell-iGEM/iGEM-Detection",
"id": "df9008a1f9ce85430ff822c105d6b8d865384ff5",
"size": "367... |
from setuptools import setup, find_packages
setup(
name="vumi",
version="0.5.21",
url='http://github.com/praekelt/vumi',
license='BSD',
description="Super-scalable messaging engine for the delivery of SMS, "
"Star Menu and chat messages to diverse audiences in "
"em... | {
"content_hash": "989402a85fc77188dd3e2c7590158617",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 75,
"avg_line_length": 30.74576271186441,
"alnum_prop": 0.5529217199558986,
"repo_name": "vishwaprakashmishra/xmatrix",
"id": "8a31a7f9cb698df0074de29f0a9746370deb942b",
"s... |
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import is_sequence
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.core.mul import Mul
from sympy.core.relational import Equality, Relational
from sympy.core.singleton import... | {
"content_hash": "445d571c332d49a66e933c43c7a087a7",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 94,
"avg_line_length": 34.957328385899814,
"alnum_prop": 0.5341789618936419,
"repo_name": "kaushik94/sympy",
"id": "1a7241d7be4a83bbfd98f63b406c7e9555229f13",
"size": "188... |
import datetime as dt
import os
from mock import patch
from decimal import Decimal
from io import StringIO
from django.core import mail
from django.test import TestCase
from apps.plea.models import Court, Case, CaseOffenceFilter
from .models import Result, ResultOffenceData, ResultOffence
from .management.commands.p... | {
"content_hash": "17e045bf3025a44e9db71a9ae78165d1",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 100,
"avg_line_length": 30.82045929018789,
"alnum_prop": 0.6141028246291405,
"repo_name": "ministryofjustice/manchester_traffic_offences_pleas",
"id": "9499c5b515bfe42904064... |
"""Composes one or more `LinearOperators`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.linalg.python.ops import linear_operator
from tensorflow.python.framework import common_shapes
from tensorflow.python.framework import dtyp... | {
"content_hash": "d866a857fab460802b1dcfcca1aaf796",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 80,
"avg_line_length": 36.252873563218394,
"alnum_prop": 0.6716339040372015,
"repo_name": "chenjun0210/tensorflow",
"id": "b1557769b222cf5b1d4ce11210b2fb4ddebecacb",
"size... |
from django.test import TestCase
from django.contrib.auth.models import User
from django.shortcuts import reverse
from django.utils import timezone
import datetime
import decimal
from .models import Budget, BudgetCategory, Wallet, Transaction
class WalletViewsTests(TestCase):
def setUp(self):
# Create a... | {
"content_hash": "a0d79c13656e5688171b80a80074baed",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 161,
"avg_line_length": 40.18796992481203,
"alnum_prop": 0.5779232927970065,
"repo_name": "zcking/Pynny",
"id": "68a993fd0ed1142f9b4cef7888c7c9e5b9697927",
"size": "5345",... |
import unittest
from cubes.browser import *
from cubes.errors import *
from .common import CubesTestCaseBase
class CutsTestCase(CubesTestCaseBase):
def setUp(self):
super(CutsTestCase, self).setUp()
self.workspace = self.create_workspace(model="browser_test.json")
self.cube = self.works... | {
"content_hash": "9f5aba234bad47d280dc089b605bec85",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 86,
"avg_line_length": 37.207692307692305,
"alnum_prop": 0.5801116394459376,
"repo_name": "she11c0de/cubes",
"id": "878c3ef66d0cafcfb6f7ba0f4e2e5f5e5d3f4cf4",
"size": "967... |
from .admins import ReadonlyAdmin
from .models import CustomModelPage
| {
"content_hash": "2f76612d2aeca852fe07033a1c915f2d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 35,
"avg_line_length": 35,
"alnum_prop": 0.8571428571428571,
"repo_name": "idlesign/django-etc",
"id": "8e2ed62cf5c7ff2c8781bf65ada26e0c427627d5",
"size": "70",
"binary": ... |
import socket
import fcntl
import struct
import sl_metro
import time
def param(ifname):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
return socket.inet_ntoa(fcntl.ioctl(
s.fileno(),
0x8915, # SIOCGIFADDR
struct.pack('256s', ifname[:15])
)[20... | {
"content_hash": "225e4f0847a252e32ca255a87f0154d3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 60,
"avg_line_length": 19.90909090909091,
"alnum_prop": 0.578386605783866,
"repo_name": "DiamondOhana/jphacks",
"id": "6f5a64f2ff6f505850482f5c74e7691c650283dc",
"size": "8... |
from django.db.models import get_model, get_models
from django.http import HttpResponse
from django.core.urlresolvers import reverse as _reverse
from serializers import ModelSerializer, Field, RelatedField
mime_types = {
'json': 'application/json',
'xml': 'application/xml',
'yaml': 'application/yaml',
... | {
"content_hash": "4d02324a05c2e22ae027cb6f2b469294",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 74,
"avg_line_length": 31.858585858585858,
"alnum_prop": 0.6537729866835764,
"repo_name": "tomchristie/django-auto-api",
"id": "a6595fb3e7db572699aba90e53d813428ea8f966",
"... |
"""
The Ironic Management Service
"""
import logging
import sys
from oslo_config import cfg
from oslo_log import log
from oslo_service import service
from ironic.common import service as ironic_service
CONF = cfg.CONF
def main():
# Pase config file and command line options, then start logging
ironic_servi... | {
"content_hash": "c5c0bddcce779e53a69e8b54b318fe83",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 23,
"alnum_prop": 0.6507246376811594,
"repo_name": "naterh/ironic",
"id": "2867d3e2c3e9796cb5925d7465293fcb882e4d64",
"size": "1375",
"binary": fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.