text stringlengths 4 1.02M | meta dict |
|---|---|
INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.contenttypes',
'django.contrib.messages',
'django.contrib.auth',
'django.contrib.admin',
'adminplus',
)
SECRET_KEY = 'adminplus'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db... | {
"content_hash": "8a2dfd35d570c7cf7bd9f0d39634aadd",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 47,
"avg_line_length": 19.35,
"alnum_prop": 0.6098191214470284,
"repo_name": "drdaeman/django-adminplus",
"id": "de4d0a1199c0aad874bf157f1454f7516135a2a6",
"size": "387",
... |
"""
iSCSI Cinder Volume driver for Fujitsu ETERNUS DX S3 series.
"""
import six
from cinder.i18n import _LI
from cinder import interface
from cinder.volume import driver
from cinder.volume.drivers.fujitsu import eternus_dx_common
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
@interface.volum... | {
"content_hash": "03b33d51a1651c98fe43c59d918b3b02",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 79,
"avg_line_length": 37.078125,
"alnum_prop": 0.5693215339233039,
"repo_name": "cloudbase/cinder",
"id": "ca878227780b5fda0e321b38fa9c11d7448ab5e2",
"size": "7836",
"b... |
from unittest import TestCase
import logging
from webtest import TestApp
from slamon_afm.app import create_app
from slamon_afm.models import db
# Log everything during tests
logging.basicConfig(level=logging.DEBUG)
class AFMTest(TestCase):
AFM_CONFIG = {
'SQLALCHEMY_DATABASE_URI': 'sqlite://'
}
... | {
"content_hash": "efc2ee0bb923cb0db27c9292c3ffb65d",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 53,
"avg_line_length": 21.413793103448278,
"alnum_prop": 0.6586151368760065,
"repo_name": "StealthyLoner/slamon-agent-fleet-manager",
"id": "00463067b132d93deea9150b21315438a... |
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.codegen.thrift.java.apache_thrift_java_gen import ApacheThriftJavaGen
from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary
from pants.build_graph.build_file_aliases import BuildFileAlias... | {
"content_hash": "bb0ab924d2fa83749d0154dba59d92d6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 88,
"avg_line_length": 33.77777777777778,
"alnum_prop": 0.78125,
"repo_name": "twitter/pants",
"id": "a6d5d929c22bf092ad9ce64f8c39c8ded7c2b555",
"size": "755",
"binary": ... |
from indy_client.test import waits
from stp_core.loop.eventually import eventually
from anoncreds.protocol.types import SchemaKey, ID
def test_send_proof_works(aliceAgent, aliceAcceptedFaber, aliceAcceptedAcme,
acmeAgent, emptyLooper):
# 1. request Claims from Faber
faberLink = alice... | {
"content_hash": "1d9c1ed74f37df313a0aeeb3a12d2c13",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 85,
"avg_line_length": 39.869565217391305,
"alnum_prop": 0.7050163576881134,
"repo_name": "TechWritingWhiz/indy-node",
"id": "512576c79a8e6ee73f1a8b40e7afa42ec9455627",
"si... |
from test import test_banter, test_config, test_crucible, test_dict2xml, test_patch, test_utils
| {
"content_hash": "5740e2dd16f98c40d443e47c9e5ce209",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 95,
"avg_line_length": 96,
"alnum_prop": 0.7916666666666666,
"repo_name": "spookylukey/banter",
"id": "d3fab0fa1b3db5ac046aa87eae81ae5d926d4ce8",
"size": "96",
"binary": f... |
"""Example of DNNClassifier for Iris plant dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import urllib
import tensorflow as tf
# Data sets
IRIS_TRAINING = 'iris_training.csv'
IRIS_TRAINING_URL = 'http://download.tensorflow.org/data... | {
"content_hash": "20c3323d145a3ae96b6b84a9b2e4f6d2",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 33.39,
"alnum_prop": 0.6744534291704103,
"repo_name": "ArtsiomCh/tensorflow",
"id": "0a50b3ba87d70a58794bc35009dc76de2cb71d1e",
"size": "3954",
"b... |
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
import os
from nipype.interfaces.base import (CommandLineI... | {
"content_hash": "13e3c9d8197f0aff41286c05dcce82b3",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 648,
"avg_line_length": 48.61578044596912,
"alnum_prop": 0.6298909783720849,
"repo_name": "mick-d/nipype_source",
"id": "2721be7fba5789ee820177bcc7a26d3fc7541084",
"size":... |
import os
import shutil
import json
from django.core.management.base import BaseCommand
from django.conf import settings
from twiggy_goodies.threading import log
from twiggy_goodies.django import LogMixin
from allmychanges.downloaders import guess_downloaders
from allmychanges.models import (
Changelog)
from allm... | {
"content_hash": "75d0e67b30763aaf78524c420561ea5a",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 98,
"avg_line_length": 30.687830687830687,
"alnum_prop": 0.5251724137931034,
"repo_name": "AllMyChanges/allmychanges.com",
"id": "fff920cd843bd58e2479817b6c7e8f87021a18c7",
... |
"""
Import Haringey
note: this script takes quite a long time to run
"""
from django.contrib.gis.geos import Point
from data_collection.management.commands import BaseAddressCsvImporter
from data_finder.helpers import geocode_point_only, PostcodeError
class Command(BaseAddressCsvImporter):
"""
Imports the Pol... | {
"content_hash": "9de0ad2ab7fe00ed1de792334ed4019a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 90,
"avg_line_length": 34.27272727272727,
"alnum_prop": 0.5870910698496905,
"repo_name": "andylolz/UK-Polling-Stations",
"id": "dcaac01137bbc76b84ffd3a8d344f081afa4d3c7",
"... |
from kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, MasteryLog, UserSessionLog
from rest_framework import serializers
class ContentSessionLogSerializer(serializers.ModelSerializer):
class Meta:
model = ContentSessionLog
fields = ('pk', 'user', 'co... | {
"content_hash": "bac591f4bbd843139fc9ccfd3b6ff07c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 141,
"avg_line_length": 40.515151515151516,
"alnum_prop": 0.6802543006731488,
"repo_name": "jayoshih/kolibri",
"id": "2df69e0d7ad063546f6c985678127090e15c15af",
"size": "26... |
from django.conf import settings
def ae_vars(request):
p = {
'FUSIONTABLE_ID': settings.FUSIONTABLE_ID,
}
return p | {
"content_hash": "f75d8d6783c9af3edd0492622a5a9608",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 17.5,
"alnum_prop": 0.6142857142857143,
"repo_name": "devsar/ae-people",
"id": "44d401a9ed277d3bec8c616e6da518831b750cae",
"size": "141",
"binary": ... |
import datetime
from dateutil.parser import parse
from decimal import Decimal
import re
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from django.utils import datetime_safe, importlib
from tastypie.bundle import Bundle
from tastypie.exceptions import ApiFieldError, NotFound
from tastypi... | {
"content_hash": "f5b24351e0cc05ddd7980a35f6ef82d1",
"timestamp": "",
"source": "github",
"line_count": 805,
"max_line_length": 181,
"avg_line_length": 34.64099378881988,
"alnum_prop": 0.5980778885462239,
"repo_name": "rbraley/django-tastypie",
"id": "0ccf3c25aeed7c827367610abec79c7c4df23f89",
"siz... |
import hashlib
import json
from tempest.api.object_storage import base
from tempest.common import custom_matchers
from tempest.common.utils import data_utils
from tempest import exceptions
from tempest import test
# Each segment, except for the final one, must be at least 1 megabyte
MIN_SEGMENT_SIZE = 1024 * 1024
c... | {
"content_hash": "41392cd8484f358464aa74bf8114f32d",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 78,
"avg_line_length": 39.096385542168676,
"alnum_prop": 0.5793528505392912,
"repo_name": "nikolay-fedotov/tempest",
"id": "159ad5cd567f3dca7cfeed28a4dfaf2c94c80663",
"siz... |
"""Model Definitions"""
# flake8: noqa
# first-party
from tcex.api.tc.ti_transform.model.transform_model import (
AttributeTransformModel,
DatetimeTransformModel,
GroupTransformModel,
IndicatorTransformModel,
MetadataTransformModel,
SecurityLabelTransformModel,
TagTransformModel,
TiTrans... | {
"content_hash": "dc5adc2042b8988bedc6b0d50de62733",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 60,
"avg_line_length": 25.214285714285715,
"alnum_prop": 0.7592067988668555,
"repo_name": "ThreatConnect-Inc/tcex",
"id": "48a201b3cb543ccb79708d3424477476f16cc71e",
"size"... |
from .widget import ChartWidget
from .item import CandleItem, VolumeItem
| {
"content_hash": "35d5f095d4daabc540af8bf4379d813a",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 40,
"avg_line_length": 36.5,
"alnum_prop": 0.8356164383561644,
"repo_name": "bigdig/vnpy",
"id": "4d090ff441196dcf03af89402e9ab51a2cf83c74",
"size": "73",
"binary": false,... |
import _plotly_utils.basevalidators
class Error_YValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="error_y", parent_name="histogram", **kwargs):
super(Error_YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "1b4a332b9936041bc37cdbc460285f19",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 81,
"avg_line_length": 42.04225352112676,
"alnum_prop": 0.5360134003350083,
"repo_name": "plotly/python-api",
"id": "cb02b5a25e17827db6d11cb04b5a45a35b32d7b3",
"size": "298... |
'''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class HotelUpdateRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.address = None
self.city = None
self.country = None
self.decorate_time = None
sel... | {
"content_hash": "7dddc471a2675d42f210af83f8271221",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 55,
"avg_line_length": 23.741935483870968,
"alnum_prop": 0.6589673913043478,
"repo_name": "CooperLuan/devops.notes",
"id": "3e69c3f4b6953645691c402ec94d3c3193a51457",
"size... |
"""sqlalchemy_postgresql_json
Adds JSON support to SQLAlchemy, with magic helpers to keep things mutable
And now adds LTREE support as well
"""
from setuptools import setup, find_packages
VERSION = (0, 5, 0)
VERSION_STRING = ".".join(map(str, VERSION))
setup(name='sqlalchemy-postgresql-json',
author="Franklyn... | {
"content_hash": "00229c699ed56a0c07831c7b077fd7e0",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 110,
"avg_line_length": 32.84615384615385,
"alnum_prop": 0.6873536299765808,
"repo_name": "DisruptiveLabs/sqlalchemy_postgresql_json",
"id": "fb5c99b70edccbc09dcd5f154ecb9708... |
""" This module provides the fixtures for the PYTEST runs.
"""
import numpy as np
import tempfile
import pytest
import os
@pytest.fixture(scope='function')
def set_seed():
""" Each test is executed with the same random seed.
"""
np.random.seed(1223)
@pytest.fixture(scope='function')
def fresh_directory(... | {
"content_hash": "10cb5610890e8014b5a9e811474d77d8",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 58,
"avg_line_length": 19.857142857142858,
"alnum_prop": 0.6834532374100719,
"repo_name": "restudToolbox/package",
"id": "33670f7fe2b49c4ea1d5d1dbb03b111adf32e998",
"size":... |
#|##############################################################################
#|Copyright (c) 2009, The Green-Span Project. All rights reserved. This code is
#|Open Source Free Software - redistribution and use in source and binary forms,
#|with or without modification, are permitted under the Two Clause BSD Li... | {
"content_hash": "c976ecc6d9dd04a957afc887ea7ad0a8",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 121,
"avg_line_length": 44.5,
"alnum_prop": 0.6212461695607763,
"repo_name": "green-span/green-mail",
"id": "062fefef3eee3a95b102c77eee9db8f0259fbfc7",
"size": "19580",
... |
"""Utility classes and methods for use with simplejson and appengine.
Provides both a specialized simplejson encoder, GqlEncoder, designed to simplify
encoding directly from GQL results to JSON. A helper function, encode, is also
provided to further simplify usage.
GqlEncoder: Adds support for GQL results and prope... | {
"content_hash": "22ffb31d31bd42a099bad068467fc8ed",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 80,
"avg_line_length": 28.08974358974359,
"alnum_prop": 0.6713829301688726,
"repo_name": "ashleyjsands/think-mind-map-web-app",
"id": "0011c45e2ed0447bab4b1813894f6a05e59e52b... |
from .treedict import TreeDict, getTree, treeExists, HashError
| {
"content_hash": "c9f78f569d04756d319ce079461d921e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 62,
"avg_line_length": 32,
"alnum_prop": 0.8125,
"repo_name": "hoytak/treedict",
"id": "f58fcabe18ff769e54fe21d61cdc0120b19bcb66",
"size": "64",
"binary": false,
"copies... |
import luigi, os, json
import os, requirements as reqq, simplejson, datetime, pickle, cPickle as pickle
from pypideps import PyPiDeps, _clean_requirements
class GetRepoRequirements(luigi.Task):
package = luigi.Parameter()
def run(self):
ppd = PyPiDeps(self.package)
with self.output().open... | {
"content_hash": "7202398c880c2e3bac04de21dc2624bc",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 114,
"avg_line_length": 36.63636363636363,
"alnum_prop": 0.5230217810862973,
"repo_name": "adamgilman/python-popular",
"id": "b301164d4e438e0cf9621c8a2ffad7a1f8cf9f86",
"si... |
"""Private module full of compatibility hacks.
Primarily this is for downstream redistributions of requests that unvendor
urllib3 without providing a shim.
.. warning::
This module is private. If you use it, and something breaks, you were
warned
"""
import sys
import requests
try:
from requests.package... | {
"content_hash": "0c0e17f7928e6c85566823bd4e8b82cc",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 30.53395061728395,
"alnum_prop": 0.5911250379055898,
"repo_name": "catapult-project/catapult",
"id": "622e77fa198e80cc4efdfdad2e8596c1b2c712f0",
"si... |
"""Test the Philips TV config flow."""
from unittest.mock import ANY, patch
from haphilipsjs import PairingFailure
from pytest import fixture
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.philips_js.const import CONF_ALLOW_NOTIFY, DOMAIN
from . import (
MOCK_CONFIG,
... | {
"content_hash": "bc0fb4abfd824e1f7aef239f5e2d4beb",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 83,
"avg_line_length": 29.713043478260868,
"alnum_prop": 0.6391571553994733,
"repo_name": "rohitranjan1991/home-assistant",
"id": "ace6219511564bcb95ae897120eb44a2b83968c8",... |
__author__ = 'yuens'
################################### PART1 IMPORT ######################################
import logging
import ConfigParser
import time
################################### PART2 CLASS && FUNCTION ###########################
class InitializationAndLoadParameter(object):
def __init__(self, log_dat... | {
"content_hash": "5bdb2a74a983b20c3b72ce618026f83e",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 178,
"avg_line_length": 50.726027397260275,
"alnum_prop": 0.6257088846880907,
"repo_name": "ysh329/spam-msg-classifier",
"id": "37745a1d7b4ed3e70fe835f770dec25b8950b591",
"... |
from io import BytesIO
import numpy as np
import warnings
from .. import Variable
from ..conventions import cf_encoder
from ..core.pycompat import iteritems, basestring, unicode_type, OrderedDict
from ..core.utils import Frozen, FrozenOrderedDict
from ..core.indexing import NumpyIndexingAdapter
from .common import A... | {
"content_hash": "4c1c385a541322912469179efedcd752",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 38.28481012658228,
"alnum_prop": 0.6263845263679947,
"repo_name": "kjordahl/xray",
"id": "872c55fe2ce9602942c3b296e1d9b1a26f8a0988",
"size": "6049",... |
from asyncio import get_event_loop, set_event_loop_policy
from pathlib import Path
from cyrandom import uniform, randint, choice
from argparse import ArgumentParser
try:
from uvloop import EventLoopPolicy
set_event_loop_policy(EventLoopPolicy())
except ImportError:
pass
import time
import logging
import s... | {
"content_hash": "437618076c3ac91ca2841b3aea4f6768",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 68,
"avg_line_length": 21.367521367521366,
"alnum_prop": 0.6712,
"repo_name": "sebast1219/Monocle",
"id": "23ee344f98af491d15b46b95d064d9e2ba8b2d9e",
"size": "2525",
"bi... |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', TemplateView.as_view(template_name='base.html')),
# Examples:
#... | {
"content_hash": "ebbd301790d5456f41394de4a112588c",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 85,
"avg_line_length": 35.65,
"alnum_prop": 0.7096774193548387,
"repo_name": "tayyabano1/icecreamratings_project",
"id": "f4acae3fd796f7a924ca7acc1f91cf439ef6a6ae",
"size":... |
from sys import stdin
from src.classes.sockets import Socket
__author__ = 'Aldo Roman Nurena'
def __main__():
client_socket()
def client_socket():
"""
Receive text from user and sends to main server.
:return:
"""
print "Write some text: (line by line)"
while True:
s = Socket.g... | {
"content_hash": "81c92720ee6c45248862dd7568610b2a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 52,
"avg_line_length": 17.939393939393938,
"alnum_prop": 0.5489864864864865,
"repo_name": "aldo-roman/python_samples",
"id": "ce0c66be1dc5c571bd426c8715cf1eb509352015",
"si... |
"""
Copied from Chrome's src/tools/valgrind/memcheck/PRESUBMIT.py
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details on the presubmit API built into gcl.
"""
import os
import re
import sys
def CheckChange(input_api, output_api):
"""Checks the memcheck suppressions files fo... | {
"content_hash": "8ffc0d152cd805862eee17f4106878e8",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 80,
"avg_line_length": 38.8,
"alnum_prop": 0.5735967926689576,
"repo_name": "wangscript/libjingle",
"id": "116f20d1188a0940263b9acd5e211feba71b60b0",
"size": "4952",
"bin... |
from __future__ import absolute_import, unicode_literals, division
import gzip as _gzip
__all__ = ["gzip"]
def gzip(original, compressed, *gzip_args, **gzip_kwargs):
orig = comp = None
try:
orig = open(original, "rb")
comp = _gzip.open(compressed, "wb", *gzip_args, **gzip_kwargs)
co... | {
"content_hash": "500fdab4d140c35f6f77403fb671f623",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 23,
"alnum_prop": 0.5697940503432495,
"repo_name": "za-creature/gulpless",
"id": "71deffa7b220c7ee4464e058544111e6ae075db8",
"size": "452",
"binary... |
first_name = ['Helena', 'Ben', 'Jake', 'Bella', 'Viktor', 'Ville', 'Molly']
last_name = ["O'Donnell", "Flygare", ]
for first in first_name:
for last in last_name:
print(first+last)
if first_name is ('Helena', 'Viktor'):
print()
#fam_names = ('Ben', 'Helena', 'Jake', 'Bella', 'Viktor', 'Vill... | {
"content_hash": "a2fbd3df50d01244d755de0a767c7317",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 75,
"avg_line_length": 28.2,
"alnum_prop": 0.574468085106383,
"repo_name": "BIMobject-Ben/test",
"id": "87d51065e6917ac6e9c06dcfc6eb23964250174a",
"size": "423",
"binary"... |
"""
Example ussage of the read_multi_vars function
This was tested against a S7-319 CPU
"""
import ctypes
import snap7
from snap7.common import check_error
from snap7.types import S7DataItem, S7AreaDB, S7WLByte
client = snap7.client.Client()
client.connect('10.100.5.2', 0, 2)
data_items = (S7DataItem * 3)()
data_... | {
"content_hash": "f107168758413286ddfb44b9c927b102",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 67,
"avg_line_length": 30.308823529411764,
"alnum_prop": 0.7083939835031539,
"repo_name": "gijzelaerr/python-snap7",
"id": "fd7c2e31c09ca789d752aa0db946c42bbaa6a09e",
"size... |
"""
Support for myStrom switches.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/switch.mystrom/
"""
import logging
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (C... | {
"content_hash": "49d86498d8eae244207dc05e71ccb506",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 75,
"avg_line_length": 29.938144329896907,
"alnum_prop": 0.6260330578512396,
"repo_name": "shaftoe/home-assistant",
"id": "e813da43dfae8fdac3d6111808bfef1af3d7bb15",
"size"... |
"""Sparse Tensor Representation. See the @{$python/sparse_ops} guide.
@@SparseTensor
@@SparseTensorValue
@@sparse_to_dense
@@sparse_tensor_to_dense
@@sparse_to_indicator
@@sparse_merge
@@sparse_concat
@@sparse_reorder
@@sparse_reshape
@@sparse_slice
@@sparse_split
@@sparse_retain
@@sparse_reset_shape
@@sparse_fill_emp... | {
"content_hash": "b81d57e52a1935cf4737f677b3df1396",
"timestamp": "",
"source": "github",
"line_count": 2165,
"max_line_length": 80,
"avg_line_length": 37.558429561200924,
"alnum_prop": 0.6476621491993999,
"repo_name": "eaplatanios/tensorflow",
"id": "c580052c32c8b61467b857af3d237be41718c1a1",
"siz... |
"""Custom template tags."""
| {
"content_hash": "74f9fc99bfe75ec71f09985c63c0f7c7",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 27,
"avg_line_length": 28,
"alnum_prop": 0.6428571428571429,
"repo_name": "Moliholy/cvmfs-browser",
"id": "926ec359ff7cdee4fdb0f63c27771beae21b410f",
"size": "28",
"binary... |
from django.db import migrations, models
def add_new_data_variant(apps, schema_editor):
DataVariant = apps.get_model('extrequests', 'DataVariant')
dv = "Library data (e.g. MARC, XML, RDF, JSON)"
DataVariant.objects.create(name=dv, unknown=False)
class Migration(migrations.Migration):
dependencies =... | {
"content_hash": "a96bb9eff68961a3a435c03821174b03",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 62,
"avg_line_length": 25.5,
"alnum_prop": 0.6710239651416122,
"repo_name": "pbanaszkiewicz/amy",
"id": "a14833c8c1d208205b32ea323a26524e90c9a1fe",
"size": "508",
"binary... |
"""
Java
====
Installs Java, currently restricted to version 7.
**Fabric environment:**
.. code-block:: yaml
blueprints:
- blues.java
"""
from fabric.decorators import task
from refabric.api import run, info
from refabric.context_managers import sudo
from . import debian
__all__ = ['setup']
@task
de... | {
"content_hash": "7b5586a2722f648c2b4b0d4830da9369",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 92,
"avg_line_length": 19.565217391304348,
"alnum_prop": 0.5866666666666667,
"repo_name": "adisbladis/blues",
"id": "7eab32fdb760c885e47c9e883bc0943beb2a352d",
"size": "900... |
"""
File: base64.h
--------------
This file defines a set of functions for encoding and decoding binary data
in the base64 format. See:
http://en.wikipedia.org/wiki/Base64
It is a lightweight wrapper around the builtin base64 library that ships with
Python.
"""
import base64 as _base64
def encode(b):
"""Encod... | {
"content_hash": "1bef3677bba587af4c140600fee43526",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 114,
"avg_line_length": 29.243243243243242,
"alnum_prop": 0.6746765249537893,
"repo_name": "SarahPythonista/acmpy",
"id": "c05378fddfe20c3de99c08f566e2b1d142cc0dec",
"size"... |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.mininode import ToHex, CTransaction, NetworkThread
from test_framework.blocktools import create_coinbase, create_block
from test_framework.comptool import TestInstance, TestManager
from test_framework... | {
"content_hash": "85f4dc24dd51c6d305a66af36416846e",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 172,
"avg_line_length": 50.78838951310861,
"alnum_prop": 0.6240920320047196,
"repo_name": "SartoNess/BitcoinUnlimited",
"id": "93746f78afd4622b8229b935e6469d13cc6f4df9",
"... |
import inspect
from p1tr.helpers import clean_string, pretty_list
from p1tr.plugin import *
@meta_plugin
class Help(Plugin):
"""Provides help for all plugins by accessing their docstrings."""
@command
def help(self, server, channel, nick, params):
"""
Usage: help PLUGIN [COMMAND] - prints ... | {
"content_hash": "4f280b91056b3f167e341f594a25bf57",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 80,
"avg_line_length": 44.35,
"alnum_prop": 0.5505449079293498,
"repo_name": "howard/p1tr-tng",
"id": "39ec70071a1616395ce4f0bd1f7cb5083b31612a",
"size": "2661",
"binary"... |
from setuptools import setup
# version_tuple = __import__('xadmin.version').VERSION
# version = ".".join([str(v) for v in version_tuple])
setup(
name='django-xadmin',
version='0.4.2',
description='Drop-in replacement of Django admin comes with lots of goodies, fully extensible with plugin support, pretty ... | {
"content_hash": "c55285d30b5f898535bcd22ef4deb002",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 158,
"avg_line_length": 37.51162790697674,
"alnum_prop": 0.6150030998140111,
"repo_name": "jneight/django-xadmin",
"id": "aa862e3c49ede49cb7032161d15b7a9578b1cef2",
"size":... |
'''A setuptools script to install strip_recipes
'''
from setuptools import setup
setup(
name='strip_recipes',
version='1.0.0',
description='Create recipes for the LSPE/Strip tester software',
long_description='''
Python library to easily create complex recipes to be used with the LSPE/Strip
tester sof... | {
"content_hash": "91d947fee9b3c8d1684964ecd653315a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 83,
"avg_line_length": 38.86666666666667,
"alnum_prop": 0.7015437392795884,
"repo_name": "lspestrip/strip_recipes",
"id": "3f9d875763e29ee9e3b9a97d467a246be05efa5e",
"size"... |
import pytest
import re
from .module import SnapshotModule, SnapshotTest
from .diff import PrettyDiff
from .reporting import reporting_lines, diff_report
def pytest_addoption(parser):
group = parser.getgroup("snapshottest")
group.addoption(
"--snapshot-update",
action="store_true",
de... | {
"content_hash": "3b0f8f38d40f9b9a7d9b2bfdca56a30a",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 87,
"avg_line_length": 27.717391304347824,
"alnum_prop": 0.6450980392156863,
"repo_name": "syrusakbary/snapshottest",
"id": "b820e1a0620928d903b4094aeb4f9f1d6c9d592b",
"siz... |
"""
ZSNES Save State Parser (v143 only currently)
Author: Jason Gorski
Creation date: 2006-09-15
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, StaticFieldSet,
UInt8, UInt16, UInt32,
String, PaddingBytes, Bytes, RawBytes)
from hachoir_core.endian import LITTLE_ENDIAN
class ZS... | {
"content_hash": "1ec449554da31bf4d9a5cc35f4190199",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 127,
"avg_line_length": 53.7,
"alnum_prop": 0.6216759776536313,
"repo_name": "Yukinoshita47/Yuki-Chan-The-Auto-Pentest",
"id": "a8f7550614f12b584ec1418284355e7e3b5bf7c7",
... |
def extractMoriitranslatesWordpressCom(item):
'''
Parser for 'moriitranslates.wordpress.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": "f5dcbcef00932aa704c10fb64158dc9f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 27.095238095238095,
"alnum_prop": 0.6414762741652021,
"repo_name": "fake-name/ReadableWebProxy",
"id": "42452c381d3afc9894605c5b56535a66ddd19268",
"... |
from pyramid.config import Configurator
from pyramid.renderers import JSON
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.add_renderer('json', JSON(indent=4))
config.add_static_view('static', 'hexserver... | {
"content_hash": "f4fde2537e48f78dc3b2c622b063a009",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 94,
"avg_line_length": 41,
"alnum_prop": 0.6778805719091674,
"repo_name": "cproctor/hex",
"id": "0e3ca36ce2e8245ed026d20c76f4ba4128528d4e",
"size": "1189",
"binary": fals... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""
Update default topics list
"""
update_theme_title_list = [
("Native m... | {
"content_hash": "2bd12e191681a14494bf9b5978e6beeb",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 195,
"avg_line_length": 60.69090909090909,
"alnum_prop": 0.543139604553625,
"repo_name": "michelesr/coding-events",
"id": "43fc7615dcae80d8d4f0740b655a315b45074433",
"size... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
import pdb
import sys
import traceback
import gdb
import pwndbg.color.message as message
import pwndbg.config
import pwndbg.memoize
import pwndbg.stdio... | {
"content_hash": "31bbfb2d2dcf76c827c4cf8437abaf02",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 139,
"avg_line_length": 31.36,
"alnum_prop": 0.6549744897959183,
"repo_name": "cebrusfs/217gdb",
"id": "069642eafc65a95afc57e95bdaf61ed251bbb04f",
"size": "3182",
"binar... |
import pickle
import json
import gzip
import math
from sniffles import sv
class SNFile:
def __init__(self,config,handle,filename=None):
self.config=config
self.handle=handle
self.filename=filename
self.blocks={}
self.index={}
self.total_length=0
def store(self,... | {
"content_hash": "d8ca2df8360d4a468123063f703e708f",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 172,
"avg_line_length": 35.208695652173915,
"alnum_prop": 0.6033588540380341,
"repo_name": "fritzsedlazeck/Sniffles",
"id": "6fea3235a9339384e120560b7d9b2bbcd3b4b38d",
"si... |
from django.core.files.base import File
from django.core.files.storage import FileSystemStorage, Storage
from django.utils.deconstruct import deconstructible
@deconstructible
class DummyExternalStorage(Storage):
def __init__(self, *args, **kwargs):
self.wrapped = FileSystemStorage(*args, **kwargs)
de... | {
"content_hash": "477f9e40ed0676a5e7604cc30cf48fda",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 124,
"avg_line_length": 31.08,
"alnum_prop": 0.6653796653796654,
"repo_name": "torchbox/wagtail",
"id": "b9dcca47e16ebd568b325f44a0c39b9d2ce3db76",
"size": "2723",
"binar... |
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse
from django.views.generic.simple import direct_to_template
from django.utils.datastructures import MultiValueDictKeyError
try:
from django.views.decorators.csrf import csrf_exempt
except ImportError:
from django.cont... | {
"content_hash": "328ad9b7edc934d8b9d481d984387290",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 97,
"avg_line_length": 35.68181818181818,
"alnum_prop": 0.6828025477707006,
"repo_name": "noxan/django-admin-tools",
"id": "9e836828289cab84e8d6cef8893d0a4004b706ce",
"size... |
"""Page object models for the info widget of the object"""
from lib import base
from lib.constants import locator
from lib.element import widget_info
class Widget(base.Widget):
"""Abstract class for all info widgets"""
_locator = None
_dropdown_settings_cls = None
def __init__(self, driver):
# wait tha... | {
"content_hash": "9cfdb39dab3a9229ed64b0ce003ba675",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 74,
"avg_line_length": 29.149019607843137,
"alnum_prop": 0.7095385443293422,
"repo_name": "andrei-karalionak/ggrc-core",
"id": "413d454a01c2a2c23c26a7bc8f9f0e8df8731038",
... |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.fields
import olympia.amo.models
import olympia.amo.validators
import olympia.users.models
class Migration(migrations.Migration):
... | {
"content_hash": "ff6475fff3a0343f19b3808b3da02ea2",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 333,
"avg_line_length": 59.0625,
"alnum_prop": 0.6055796055796056,
"repo_name": "mozilla/olympia",
"id": "9462eb238b1a9ebc675e6ec7db616f080ef058d9",
"size": "10444",
"bi... |
"""
Extension to Python Markdown for Embedded Audio.
Basic Example:
>>> import markdown
>>> text = "[podcast]https://archive.org/download/Rebeldes_Stereotipos/rs20120609_1.mp3[/podcast]"
>>> html = markdown.markdown(text, [PodcastExtension()])
>>> print(html)
<p><audio controls=""><source src="https://archive.org/dow... | {
"content_hash": "d909d9341424ef768c933f920be81b4f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 142,
"avg_line_length": 32.55555555555556,
"alnum_prop": 0.6535836177474402,
"repo_name": "okin/nikola",
"id": "5ffcb210f2ba78c0f428eaf644ab59fbebf4d5ca",
"size": "3641",
... |
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from flask import request
#from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask_login import UserMixin,AnonymousUserMixin
from app import login_manager
from app import db
from datetime import datetime
... | {
"content_hash": "3d196c7318977e28bba6e38a0b092252",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 170,
"avg_line_length": 34.927083333333336,
"alnum_prop": 0.6974351327169699,
"repo_name": "sumedh123/debatify",
"id": "a14e060617ed1a5276ddc95bb31de8b1d10ce84b",
"size": ... |
"""Tests for Beautiful Soup's tree traversal methods.
The tree traversal methods are the main advantage of using Beautiful
Soup over just using a parser.
Different parsers will build different Beautiful Soup trees given the
same markup, but all Beautiful Soup trees can be traversed with the
methods tested here.
"""
... | {
"content_hash": "06dd8741fa832418be5445a27cdf105f",
"timestamp": "",
"source": "github",
"line_count": 1694,
"max_line_length": 118,
"avg_line_length": 38.31404958677686,
"alnum_prop": 0.5646339208677431,
"repo_name": "yarray/inkpress",
"id": "cc573edef30a03b51c9aba88df197b6947a9fca6",
"size": "64... |
from c7n_gcp.provider import resources
from c7n_gcp.query import QueryResourceManager, TypeInfo
import jmespath
@resources.register('cloudbilling-account')
class CloudBillingAccount(QueryResourceManager):
class resource_type(TypeInfo):
service = 'cloudbilling'
version = 'v1'
component = ... | {
"content_hash": "f998dde4504c514f808bde8ef373ca01",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 91,
"avg_line_length": 33.92307692307692,
"alnum_prop": 0.6439909297052154,
"repo_name": "capitalone/cloud-custodian",
"id": "443694fc4c5bbccfa221b82476f15858abce352b",
"si... |
import warnings as _warnings
from saml2.cryptography.symmetric import AESCipher as _AESCipher
_deprecation_msg = (
'{name} {type} is deprecated. '
'It will be removed in the next version. '
'Use saml2.cryptography.symmetric instead.'
).format(name=__name__, type='module')
_warnings.warn(_deprecation_msg,... | {
"content_hash": "b92d56cead355b8feb1c4ec31a0623bc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 28,
"alnum_prop": 0.7388392857142857,
"repo_name": "cloudera/hue",
"id": "6f37fb336824406f5261f4c2c514f9554b503e5f",
"size": "448",
"binary": false... |
import argparse
import collections
import logging
import os
import shutil
import signal
import StringIO
import subprocess
import sys
import tempfile
import threading
import time
import cdec
import aligner
import decoder
import util
# Dummy input token that is unlikely to appear in normalized data (but no fatal errors... | {
"content_hash": "ea1a7f458efa29a61bc270e6fb71faec",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 132,
"avg_line_length": 41.51633986928105,
"alnum_prop": 0.580132241813602,
"repo_name": "pks/cdec-dtrain-legacy",
"id": "70ed0c3c67ba5e717723bacb87e8716b6b030f79",
"size"... |
"""
.. module: security_monkey.views.audit_scores
:platform: Unix
.. version:: $$VERSION$$
.. moduleauthor:: Bridgewater OSS <opensource@bwater.com>
"""
from security_monkey.views import AuthenticatedService
from security_monkey.views import AUDIT_SCORE_FIELDS
from security_monkey.views import ACCOUNT_PATTERN_AU... | {
"content_hash": "cfebfc86d0fa3e203d6fff4e418cabeb",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 112,
"avg_line_length": 30.76068376068376,
"alnum_prop": 0.5085671945910901,
"repo_name": "stackArmor/security_monkey",
"id": "e12d57434ed7e13891cf44cc17efbc8f3c8affb5",
"... |
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.utils.annotations import override
from ray.rllib.utils.framework import try_import_tf
_, tf, _ = try_import_tf()
class NoopModel(TFModelV2):
... | {
"content_hash": "87514c53e5f0f0236ea0891d0b7683f6",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 65,
"avg_line_length": 32.2962962962963,
"alnum_prop": 0.7282110091743119,
"repo_name": "pcmoritz/ray-1",
"id": "4dba83b9d4d4954c2b6b4755deabf17b4c23d886",
"size": "872",
... |
"""Test the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when
its preconditions are met, and returns appropriate errors in other cases.
This module consists of around a dozen individual test cases implemented in the
top-level functions named as test_<test_case_description>.... | {
"content_hash": "9d3a3192834f2adefe92c401ceb54f4d",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 175,
"avg_line_length": 48.7953125,
"alnum_prop": 0.6813218482820456,
"repo_name": "kallewoof/bitcoin",
"id": "2ee3e00a7b5ceae7f86b50023bae3473a55b8f45",
"size": "31443",
... |
import time
import config
import util.cryptography
from linkr import db
class Link(db.Model):
"""
Model representing a link entry.
"""
__tablename__ = 'link'
link_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
user_id = db.Column(db.Integer, index=True, default=None)
s... | {
"content_hash": "dc6b3e0befc7dbc2be5976dac61c3bb1",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 96,
"avg_line_length": 34.509433962264154,
"alnum_prop": 0.6134499726626572,
"repo_name": "LINKIWI/linkr",
"id": "c4d340a7324117356731629ded8d84b075276001",
"size": "3658"... |
"""distutils.command
Package containing implementation of all the standard Distutils
commands."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: __init__.py 71272 2009-04-05 21:21:05Z georg.brandl $"
__all__ = ['build',
'build_py',
'build_ext',
... | {
"content_hash": "68c5569f583fd4da4a9cab6b5bdaf6c6",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 27.142857142857142,
"alnum_prop": 0.4747368421052632,
"repo_name": "babyliynfg/cross",
"id": "def882e6ec07f0fa05d6a3420624828cdc71275c",
"size": "950... |
from django.conf import settings
from django.http import JsonResponse
from datetime import (datetime, timedelta)
from business.models import BusinessModel
from offer.models import OfferModel
from offer.forms import (OfferRegForm, OfferUpdateForm)
from base.apputil import (App_Render, App_LoginRequired, App_PostRequire... | {
"content_hash": "95d2bea278e665d0dfc63e2ed656b7ff",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 102,
"avg_line_length": 30.391025641025642,
"alnum_prop": 0.6344653026787598,
"repo_name": "amitdhiman000/MyOffers",
"id": "610e41ba2bb161a6e2cc19820d94ae0fe87419a6",
"siz... |
from rest_framework.serializers import (
HyperlinkedIdentityField,
ModelSerializer,
SerializerMethodField
)
from rest_framework import serializers
from comments.api.serializers import CommentSerializer
from posts.models import Post
from comments.models import Comment
post_detail_url = HyperlinkedIdentityField(vi... | {
"content_hash": "eb256962fde5ef3224481ce415d3602c",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 94,
"avg_line_length": 20.43243243243243,
"alnum_prop": 0.7129629629629629,
"repo_name": "aminhp93/learning_python",
"id": "d2350729dcfc63300a153ff318cd2b4f69147314",
"size... |
from django.conf.urls import patterns, include, url
#from rest_framework import routers
from Inventory_Management import views
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
#router = routers.DefaultRouter()
#router.register(r'Equip', views.UserViewSet)
#rout... | {
"content_hash": "62eace0b9ccc433a57f2efc7d980628d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 84,
"avg_line_length": 38.71875,
"alnum_prop": 0.6844229217110573,
"repo_name": "faxandu/Inventory-Management",
"id": "d663924e464da8863d0c1ea10e9f4c7c20abfe5e",
"size": "1... |
from django.contrib import messages
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.utils.cryp... | {
"content_hash": "5006a87822f86d87a1ca999219d4559d",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 80,
"avg_line_length": 38.627450980392155,
"alnum_prop": 0.682233502538071,
"repo_name": "consideratecode/csrf_example",
"id": "325ef6a0c2f8b6b9ff9524bc072e73581d73890e",
"... |
"""Utilities for comparing files and directories.
Classes:
dircmp
Functions:
cmp(f1, f2, shallow=1) -> int
cmpfiles(a, b, common) -> ([], [], [])
"""
import os
import stat
from itertools import ifilter, ifilterfalse, imap, izip
__all__ = ["cmp","dircmp","cmpfiles"]
_cache = {}
BUFSIZ... | {
"content_hash": "4be5223d8915938a6233b8f2e381e23a",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 84,
"avg_line_length": 33.2135593220339,
"alnum_prop": 0.5559297815880792,
"repo_name": "emilk/sproxel",
"id": "8f677c5fd6e0252df6612e99ff3e22b2704601cf",
"size": "9798",
... |
"""
Lightweight asynchronous framework.
This module defines the protocol used for asynchronous operations in udiskie.
It is based on ideas from "Twisted" and the "yield from" expression in
python3, but more lightweight (incomplete) and compatible with python2.
"""
import traceback
from functools import partial
from s... | {
"content_hash": "dd71178bfd788a253bcbb27b6c303e21",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 79,
"avg_line_length": 29.00854700854701,
"alnum_prop": 0.6306717737183265,
"repo_name": "coldfix/udiskie",
"id": "9005f9fc97b84c23ed8a2630ae05647c9540764a",
"size": "6788... |
import os
import unittest
import six
from conans.paths import BUILD_INFO, CONANFILE
from conans.test.utils.tools import TestClient
from conans.util.files import load, mkdir
class SourceTest(unittest.TestCase):
def test_conanfile_removed(self):
# https://github.com/conan-io/conan/issues/4013
con... | {
"content_hash": "9a96770497169580bf5022656d61948e",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 100,
"avg_line_length": 36.92526690391459,
"alnum_prop": 0.611603700848111,
"repo_name": "memsharded/conan",
"id": "c29e768ea76f987cfa0973f77b2711e98925fe49",
"size": "103... |
from twisted.internet.error import getConnectError
from twisted.internet import defer
from twisted.python.util import FancyEqMixin
from zope.interface import implementer
from twisted.internet.interfaces import IAddress, IStreamClientEndpoint
@implementer(IAddress)
class SerialAddress(FancyEqMixin, object):
"""
... | {
"content_hash": "51d75b2972df67cd51d5bf3d8f9ef2c2",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 31.23611111111111,
"alnum_prop": 0.6411738550466874,
"repo_name": "keturn/txOpenBCI",
"id": "c5508bc8b8fd5b465b621a4e3f54435097019cb4",
"size": "2427... |
from django.conf import settings
from olympia.constants.promoted import RECOMMENDED
import olympia.core.logger
from olympia import amo
from olympia.amo.utils import attach_trans_dict
from olympia.amo.celery import create_chunked_tasks_signatures
from olympia.amo.utils import to_language
from olympia.constants.search i... | {
"content_hash": "fd568455ab8ce295bcda7e1ea5ca89b7",
"timestamp": "",
"source": "github",
"line_count": 752,
"max_line_length": 88,
"avg_line_length": 38.817819148936174,
"alnum_prop": 0.4501044842588469,
"repo_name": "wagnerand/addons-server",
"id": "20e305e440ca905d74eec8f060d7ae78963d77ef",
"siz... |
"""
@authors: Sergei Garbuzov
@status: Development
@version: 1.1.0
"""
import time
from pybvc.controller.controller import Controller
from pybvc.openflowdev.ofswitch import (OFSwitch,
FlowEntry,
Match,
... | {
"content_hash": "bfea6e5b9fa120a5b446b3a187d797c8",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 78,
"avg_line_length": 32.64159292035398,
"alnum_prop": 0.5259590619493019,
"repo_name": "jebpublic/pybvc",
"id": "6c8ae20369d1276bd0bfe0df3762ba9e002a9b96",
"size": "8951... |
from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.cl.forms import CLRegionSelect, CLRutField
class CLLocalFlavorTests(SimpleTestCase):
def test_CLRegionSelect(self):
f = CLRegionSelect()
out = '''<select name="foo">
<option value="RM">Regi\xf3n Metro... | {
"content_hash": "8064f11f9e65808d2f38f0f0dc821d55",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 91,
"avg_line_length": 39.706896551724135,
"alnum_prop": 0.6100738167607469,
"repo_name": "agustin380/django-localflavor",
"id": "2ad9909e2a019620c347c24a9a1a41e6432057c4",
... |
"""TensorFlow impl of Spatial Softmax layers. (spatial soft arg-max).
TODO(T2R_CONTRIBUTORS) - consider replacing with contrib version.
"""
import gin
import numpy as np
from six.moves import range
import tensorflow.compat.v1 as tf
import tensorflow_probability as tfp
@gin.configurable
def BuildSpatialSoftmax(featu... | {
"content_hash": "f8a0fb13651750cbe6d30e283ee8d973",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 77,
"avg_line_length": 40.54794520547945,
"alnum_prop": 0.6608108108108108,
"repo_name": "google-research/tensor2robot",
"id": "c755858357b5468ff2f05bb0b145e20c92612ecf",
"... |
"""Imports modules that should be scanned during API generation.
This file should eventually contain everything we need to scan looking for
tf_export decorators.
"""
# go/tf-wildcard-import
# pylint: disable=wildcard-import,g-bad-import-order,g-import-not-at-top
# pylint: disable=unused-import,g-importing-member
# Pr... | {
"content_hash": "f1e439eceb012236046bd3cc9a493fe3",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 92,
"avg_line_length": 41.65060240963855,
"alnum_prop": 0.8009835117153601,
"repo_name": "gautam1858/tensorflow",
"id": "8681a2c6327a34c9230ae109ac680a45b290da28",
"size": ... |
from enum import Enum
import onnx
from onnx import OperatorSetIdProto, TensorProto, helper
opsets = []
onnxdomain = OperatorSetIdProto()
onnxdomain.version = 12
onnxdomain.domain = "" # The empty string ("") or absence of this field implies the operator set that is defined as part of the ONNX specification.
opsets.a... | {
"content_hash": "59cb5d6f839fa9f4b95ff0ae6690a1bf",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 148,
"avg_line_length": 36.63636363636363,
"alnum_prop": 0.5624483043837882,
"repo_name": "microsoft/onnxruntime",
"id": "7e48164d5161a882e733fdec88b751510243f4d4",
"size":... |
import pytest
import main
# Note: samples that do end-user auth are difficult to test in an automated
# way. These tests are basic confidence checks.
@pytest.fixture
def client():
main.app.testing = True
return main.app.test_client()
def test_index_wo_credentials(client):
r = client.get('/')
asser... | {
"content_hash": "9ab029e780e91ca91733198a90f54e91",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 75,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.6971830985915493,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "5e8e07296249b3f829f519e8f782574dfe... |
INSTANCE_TYPES = {
"a1.2xlarge": {
"bandwidth": 10,
"disk": 0,
"extra": {
"availabilityzone": "NA",
"classicnetworkingsupport": "false",
"clockSpeed": "2.3 GHz",
"currentGeneration": "Yes",
"dedicatedEbsThroughput": "Up to 3500 Mbps... | {
"content_hash": "1c435af4f0c605691956462986d428b1",
"timestamp": "",
"source": "github",
"line_count": 16003,
"max_line_length": 111,
"avg_line_length": 37.751984002999436,
"alnum_prop": 0.49710086154813826,
"repo_name": "mistio/libcloud",
"id": "6b36b6ee0a236bf163a9d08a27a785b279365408",
"size": ... |
"""
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import threading
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import DEFAULT_DB_ALIAS
from django.db.backends.base.base import BaseDatabase... | {
"content_hash": "e0b24f296657d719ad37a3d2e1c3cd86",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 113,
"avg_line_length": 39.172661870503596,
"alnum_prop": 0.6157024793388429,
"repo_name": "mattseymour/django",
"id": "a3b293ee366ad1f73275f778e9a3348385d94335",
"size": ... |
"""
This module does hyper parameters optimization -- find the best parameters for estimator using different optimization models.
"""
# TODO think of pareto-optimization
from __future__ import division, print_function, absolute_import
from itertools import islice
from collections import OrderedDict
import logging
fr... | {
"content_hash": "1866e96330f8e30c755ebd116bee0bcd",
"timestamp": "",
"source": "github",
"line_count": 558,
"max_line_length": 125,
"avg_line_length": 44.261648745519715,
"alnum_prop": 0.6326423192161309,
"repo_name": "nickcdryan/rep",
"id": "4c274142944a6f94303cb7a46fe3fb65a3fd78fc",
"size": "246... |
matplotlib bug
| {
"content_hash": "7678c44f3d3b65f54f1d0875335e8011",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 14,
"avg_line_length": 8,
"alnum_prop": 0.8125,
"repo_name": "rsignell-usgs/notebook",
"id": "dc646367a7cded1224f09a4727b6243ac9433b83",
"size": "82",
"binary": false,
"... |
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import itertools
import numpy as np
import sklearn.datasets
import sklearn.cross_validation
import sklearn.metrics
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import treeano.sa... | {
"content_hash": "854e1bfccf32436576c775a01354a6d8",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 78,
"avg_line_length": 31.275510204081634,
"alnum_prop": 0.6110929853181076,
"repo_name": "diogo149/treeano",
"id": "c01c08a98d822b20eeaaef21843257fcebdec789",
"size": "306... |
""" A little example script showing a Capture-Game tournament between
- a random player
- a kill-on-sight player
- a small-network-player with random weights
"""
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.rl.environments.twoplayergames import CaptureGame
from pybrain.rl.environments.twoplayergames.captur... | {
"content_hash": "75e3122f51f595db1f32495a7e6cbfb1",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 126,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.7868421052631579,
"repo_name": "hassaanm/stock-trading",
"id": "1145977118928319cc1f14cd594a3f64cc7ee6eb",
"size... |
"""
This script extracts surrounding buildings of the zone geometry from Open street maps
"""
import math
import os
import numpy as np
import osmnx.footprints
import pandas as pd
from geopandas import GeoDataFrame as gdf
from geopandas.tools import sjoin as spatial_join
import cea.config
import cea.inputlocator
from... | {
"content_hash": "e0164d6edaf0985495f1fcf48bb61e3c",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 115,
"avg_line_length": 46.36407766990291,
"alnum_prop": 0.6866296722856245,
"repo_name": "architecture-building-systems/CityEnergyAnalyst",
"id": "bbc134c1069b7a2d4253a47a8... |
print "|--------------------------------------------|"
print "| Starting Tutorial 3 |"
print "|--------------------------------------------|"
print 'media path = ' + scene.getMediaPath()
# Add asset paths
assetManager = scene.getAssetManager()
assetManager.addAssetPath('motion', 'ChrBrad')
... | {
"content_hash": "9150f67910e0852981612c62fe5493c0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 54,
"avg_line_length": 33.583333333333336,
"alnum_prop": 0.5955334987593052,
"repo_name": "gsi-upm/SmartSim",
"id": "1fa44af9b9ee1d39f5a16da526cc7073346f1070",
"size": "806... |
from __future__ import with_statement
import IECore
import Gaffer
import GafferUI
class ParameterValueWidget( GafferUI.Widget ) :
def __init__( self, plugValueWidget, parameterHandler, **kw ) :
assert( isinstance( plugValueWidget, GafferUI.PlugValueWidget ) )
GafferUI.Widget.__init__( self, plugValueWidge... | {
"content_hash": "5713022cf1fbbb2262af20ec79dcb21c",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 105,
"avg_line_length": 32.16083916083916,
"alnum_prop": 0.7323331158947597,
"repo_name": "davidsminor/gaffer",
"id": "412431acb8a76ea00188a9754ae94b001266b834",
"size": "... |
"""Outputs the current date and time information as a key-value file
appropriate for use with template_replace.py.
"""
import datetime
import logging
import optparse
import os
import re
import sys
# Use the GIT helper functions from 'lastchange.py'.
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
impo... | {
"content_hash": "a318f8584ff02829f4aa515ae4c3f594",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 30.38157894736842,
"alnum_prop": 0.6396708531831962,
"repo_name": "sebmarchand/syzygy",
"id": "7b75a7ca0307e3ae00a1a757b83a70c04b4ed759",
"size": "29... |
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path
from .views import decorated, roundtrip, undecorated
app_name = "tests"
urlpatterns = [
path("admin/", admin.site.urls),
path("decorated/$", decorated, name="decorated"),
... | {
"content_hash": "bdd54d8db0d974e984ff07b2933b8c02",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.738,
"repo_name": "yunojuno/django-expiring-links",
"id": "1bb7daa838672a155ae95cd156adc8852fb58b15",
"size": "50... |
from django.test import TestCase
from django.utils.encoding import force_text
from fluent_contents.plugins.markup.models import LANGUAGE_MODEL_CLASSES
from fluent_contents.tests.factories import create_content_item
from fluent_contents.tests.utils import render_content_items
class MarkupPluginTests(TestCase):
""... | {
"content_hash": "921399cb08fb635e83f0a21759e95d89",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 117,
"avg_line_length": 28.296296296296298,
"alnum_prop": 0.675392670157068,
"repo_name": "edoburu/django-fluent-contents",
"id": "e69e287c7cc92c3302644e21b32d98a933981f61",
... |
import os
def _(path):
# Make sure the path contains only the correct separator
return path.replace('/', os.sep).replace('\\', os.sep)
| {
"content_hash": "24e2aaa67d01fd55b02163eff5975873",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 60,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.6418918918918919,
"repo_name": "hyperoslo/django-pipeline",
"id": "6224dba85bd8b41e616714a8438e53fb1d8992bd",
"siz... |
import os
import datetime
import model
from datetime import datetime, date, time, timedelta
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp.util import login_required
from google.appengine.api import u... | {
"content_hash": "94554ca8125ec3aa87ea24901f716233",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 99,
"avg_line_length": 34.45,
"alnum_prop": 0.4395258829221093,
"repo_name": "wengzhiwen/Your-Vehicle-Status",
"id": "214121cb28e2be4355bac10a3738726a7484c323",
"size": "4... |
import logging
# import numpy as np
import pystella.model.sn_eve as sneve
import pystella.rf.light_curve_plot as lcp
from pystella import phys
try:
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
mpl_logger = logging.getLogger('matplotlib')
mpl_logger.setLevel(logging.ERROR)
except ... | {
"content_hash": "e4163cb8e756e1a1177f7eea9f995a88",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 120,
"avg_line_length": 40.45842696629214,
"alnum_prop": 0.48472561652966006,
"repo_name": "baklanovp/pystella",
"id": "27475c5cac0b70d2fb54bb6599246755f8dbe565",
"size": ... |
from CMash import MinHash as MH
import numpy as np
import scipy as sp
from scipy.io import loadmat
import pandas as pd
import os
import timeit
from collections import Counter
# First, read in the sketches of just the appropriate critters
#cmash_out_file = '/home/dkoslicki/Data/MiCOPMinHash/Test/test.csv'
#training_bas... | {
"content_hash": "3023c04262ce5ddef52178ab662ff30d",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 175,
"avg_line_length": 47.5921052631579,
"alnum_prop": 0.7380425767210396,
"repo_name": "dkoslicki/CMash",
"id": "acb42ad8b34be97652b84b2b5b629e765db94d79",
"size": "7466... |
from RGT.XML.SVG.basicSvgNode import BasicSvgNode
from xml.dom.minidom import Node
class BaseScriptNode(BasicSvgNode):
def __init__(self, ownerDoc, tagName):
BasicSvgNode.__init__(self, ownerDoc, tagName)
self.allowAllSvgNodesAsChildNodes = True
def setData(self, data):
if... | {
"content_hash": "c7753a5f14a15e1344fe2987fe5ee250",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 117,
"avg_line_length": 37.92,
"alnum_prop": 0.5617088607594937,
"repo_name": "danrg/RGT-tool",
"id": "82be2ad85987afde315c34785969bc461fe01179",
"size": "1896",
"binary"... |
import RPi.GPIO as GPIO
import time
# blinking function
def blink(pin):
GPIO.output(pin, GPIO.HIGH)
time.sleep(1)
GPIO.output(pin, GPIO.LOW)
time.sleep(1)
return
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(11, GPIO.OUT)... | {
"content_hash": "c1a52e1dbfe3e8699181399998a47eff",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 39,
"avg_line_length": 23.11764705882353,
"alnum_prop": 0.6717557251908397,
"repo_name": "songbird175/ReFilament",
"id": "0797120cdb43b503dfb80293610171073be900d9",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.