text stringlengths 4 1.02M | meta dict |
|---|---|
from functools import wraps
import zipline.api
from zipline.utils.algo_instance import get_algo_instance, set_algo_instance
class ZiplineAPI(object):
"""
Context manager for making an algorithm instance available to zipline API
functions within a scoped block.
"""
def __init__(self, algo_instanc... | {
"content_hash": "d2270149fb47c93bb5572caee2e24b48",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 78,
"avg_line_length": 31.59259259259259,
"alnum_prop": 0.6318874560375146,
"repo_name": "florentchandelier/zipline",
"id": "6757f66bf19c013a63282326b46961cf28fc427d",
"si... |
import testsuite
# Bootstrap the testsuite
testsuite.setup()
from catalogService.rest.models import cloud_types
class CloudsTest(testsuite.TestCase):
def testFreezeThaw(self):
hndlr = cloud_types.Handler()
cloudTypeId = "cId"
cloudType = "ec4"
ctype = cloud_types.CloudType(id = c... | {
"content_hash": "4a8d5d77e553c4195ecf6f178041fcec",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 202,
"avg_line_length": 42.44,
"alnum_prop": 0.6828463713477851,
"repo_name": "sassoftware/catalog-service",
"id": "334bbecad90fdcd513ec9a8716a694255521c3fc",
"size": "2727... |
def Setup(Settings,DefaultModel):
Settings["experiment_name"] = "Number_of_FC_blocks_test"
Settings["graph_histories"] = ['together'] #['all','together',[],[1,0],[0,0,0],[]]
Settings["models"][0]["dataset_name"] = "1200x_markable_299x299"
Settings["models"][0]["number_of_images"] = None
Settings["m... | {
"content_hash": "cac1566f7f9b1e45735900a5a3d23dc3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 86,
"avg_line_length": 39.90909090909091,
"alnum_prop": 0.6142748671222475,
"repo_name": "previtus/MGR-Project-Code",
"id": "f36f0ffffa03dc6ae047a0fcadf82d06b71a2420",
"siz... |
import uuid as __uuid
import argparse
import requests
import json
import os
import sys
from vnc_api.vnc_api import *
from vnc_api.gen.resource_xsd import *
from cfgm_common.exceptions import *
EP_DELIM=','
PUBSUB_DELIM=' '
DEFAULT_HEADERS = {'Content-type': 'application/json; charset="UTF-8"'}
def show_usage():
... | {
"content_hash": "2610f01197b3c8af62fde5951369b4d4",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 92,
"avg_line_length": 30.558333333333334,
"alnum_prop": 0.6014907735660394,
"repo_name": "tcpcloud/contrail-controller",
"id": "3632e8f51ec81845166252e4b859b7beae189adf",
... |
from collections import Counter
__author__ = "Sergey Aganezov"
__email__ = "aganezov(at)cs.jhu.edu"
__status__ = "production"
class KBreak(object):
""" A generic object that can represent any k-break ( k>= 2)
A notion of k-break arises from the bioinformatics combinatorial object BreakpointGraph and is fir... | {
"content_hash": "3d2c00ecf31ececf77424f436aa59321",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 225,
"avg_line_length": 57.865979381443296,
"alnum_prop": 0.6638161411010155,
"repo_name": "aganezov/bg",
"id": "04da680c07bc034bb53917bcea8a1dcb393edf8d",
"size": "5637",
... |
import os
import os.path
import shutil
import time
from dtest import Tester
from tools import sslkeygen
from tools.decorators import since
_LOG_ERR_SIG = "^javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: Certificate signature validation failed$"
_LOG_ERR_IP = "^javax.net.ssl.SSLHandsha... | {
"content_hash": "2b1b4226f8086bbaf3a3e1b986d66e11",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 158,
"avg_line_length": 37.93413173652694,
"alnum_prop": 0.6374112075769535,
"repo_name": "riptano/cassandra-dtest",
"id": "a11a3f4c91875d3bf0eda1be5b6bdf99fb0cb3af",
"siz... |
from ctypes import *
import unittest, sys
from test import support
from ctypes.test import is_resource_enabled, xfail
################################################################
# This section should be moved into ctypes\__init__.py, when it's ready.
from _ctypes import PyObj_FromPtr
###########################... | {
"content_hash": "1743d231efdfb1ea723738971540b199",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 90,
"avg_line_length": 33.20618556701031,
"alnum_prop": 0.6022974231605092,
"repo_name": "timm/timmnix",
"id": "22cbc9157079ffda7768a84905b8d0e8fce680db",
"size": "3221",
... |
from msrest.serialization import Model
class TopologyAssociation(Model):
"""Resources that have an association with the parent resource.
:param name: The name of the resource that is associated with the parent
resource.
:type name: str
:param resource_id: The ID of the resource that is associate... | {
"content_hash": "40118ee1b68ddab4c9d5fe093218c6c7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 78,
"avg_line_length": 37.44827586206897,
"alnum_prop": 0.6593001841620626,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "89b3e60f48f3c7b010e012a2cd328bdca0be2ca7",
... |
"""Canonicalizes continue statements by de-sugaring into a control boolean."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.autograph.core import converter
from tensorflow.python.autograph.pyct import anno
from tensorflow.python.au... | {
"content_hash": "e164423ae752cddca7b95f6c2605c03e",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 78,
"avg_line_length": 34.1,
"alnum_prop": 0.617008797653959,
"repo_name": "theflofly/tensorflow",
"id": "780f837fa3966c68383ab0ba4acdfcb7b221d005",
"size": "5804",
"bin... |
"""Config flow to configure the FRITZ!Box Tools integration."""
from __future__ import annotations
import logging
from typing import Any
from urllib.parse import ParseResult, urlparse
from fritzconnection.core.exceptions import FritzConnectionException, FritzSecurityError
import voluptuous as vol
from homeassistant.... | {
"content_hash": "e598eb38052e11a1cf57c419ba2c7db6",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 88,
"avg_line_length": 34.95114006514658,
"alnum_prop": 0.5820130475302889,
"repo_name": "sander76/home-assistant",
"id": "5ca351cdec15790f2a6c77d0067cc4a56f7cc922",
"size... |
import datetime as date
from com.hhj.pystock.snakecoin.block import Block
def create_genesis_block():
# Manually construct a block with
# index zero and arbitrary previous hash
return Block(0, date.datetime.now(), "Genesis Block", "0")
def next_block(last_block):
this_index = last_block.index + 1
... | {
"content_hash": "113d4b681c59d7d40f830b5da0520835",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 83,
"avg_line_length": 30.675675675675677,
"alnum_prop": 0.6951541850220264,
"repo_name": "hhj0325/pystock",
"id": "6d74fae17eba0aa0998a7dfb6d48373f0e4177b8",
"size": "1135... |
import sys
import unittest
import pymysql
_mysql = pymysql
from pymysql.constants import FIELD_TYPE
from pymysql.tests import base
class TestDBAPISet(unittest.TestCase):
def test_set_equality(self):
self.assertTrue(pymysql.STRING == pymysql.STRING)
def test_set_inequality(self):
self.assert... | {
"content_hash": "a29fb5b6c76d16035cd32ce4b0900c05",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 86,
"avg_line_length": 28.08,
"alnum_prop": 0.6257122507122507,
"repo_name": "PyMySQL/PyMySQL",
"id": "b8d4bb1e6e60c243055e7336f4c77619b2ecdd69",
"size": "2808",
"binary... |
import logging
from .apidriver import APIDriver
log = logging.getLogger('vmaas.main')
class MAASException(Exception):
pass
class MAASDriverException(Exception):
pass
class MAASClient(object):
"""
A wrapper for the python maas client which makes using the API a bit
more user friendly.
"""... | {
"content_hash": "f678fd485d5afae09aa885e7bc388007",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 32.39473684210526,
"alnum_prop": 0.5353371242891958,
"repo_name": "CanonicalBootStack/charm-hacluster",
"id": "70d017a6ba9abf2a70b50da738ba903a42c1f96... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('customer', '0001_initial'),
('product', '0004_auto_20151026_1435'),
]
operations = [
migrations.CreateModel(
name='Order',
... | {
"content_hash": "4c02d1873b63417a56dd014567ea98c7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 114,
"avg_line_length": 32,
"alnum_prop": 0.55875,
"repo_name": "MahdiZareie/PyShop",
"id": "4f65818de3bbbe46e93537a5469b55e0e64447a2",
"size": "824",
"binary": false,
... |
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
setup(
name = 'nimblenet',
packages = find_packages(),
version = '0.2.1',
description = 'Efficient python (NumPy) neural network library.',
long_description = 'This ... | {
"content_hash": "ccd6bdcd0650d42cfd4fae2fcef40f7b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 302,
"avg_line_length": 47.370370370370374,
"alnum_prop": 0.6387802971071149,
"repo_name": "jorgenkg/python-neural-network",
"id": "454ec9be6e65938460dce7754f07eead73897c77",... |
from __future__ import unicode_literals, absolute_import
from ..exception import TigrisException
# import urllib.parse
class Enrollment(object):
""" Tigris Enrollment object """
def __init__(self, enrollment_obj, session):
"""
:param module_obj:
A `dict` of the module data
... | {
"content_hash": "1a7c3c43236c560d666f1ff77df1ba4d",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 80,
"avg_line_length": 29.228346456692915,
"alnum_prop": 0.5363685344827587,
"repo_name": "jogral/tigris-python-sdk",
"id": "50e73f66c35f78e0ff5f0143df3ae30d62d499d2",
"si... |
import unittest
import reactivex
from reactivex import operators as ops
from reactivex.testing import ReactiveTest, TestScheduler
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ... | {
"content_hash": "c14cc5ea618690c5405f8f99853b298b",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 88,
"avg_line_length": 33.21969696969697,
"alnum_prop": 0.6023945267958951,
"repo_name": "ReactiveX/RxPY",
"id": "b7d1b063cc830cc84a77bbf1a2f53b43aaac08c6",
"size": "8770"... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdb import CosmosDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdb
# USAGE
python cosmos_db_database_account_get_metric_definitions.py
Before run the sample, please set the values of ... | {
"content_hash": "57c45d4625208d21dfe6c0c0fb146530",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 168,
"avg_line_length": 34.14705882352941,
"alnum_prop": 0.73557278208441,
"repo_name": "Azure/azure-sdk-for-python",
"id": "a438667d24ca04df91ba68a5d424f455e4b627a6",
"siz... |
"""This example gets all creative sets.
"""
# Import appropriate modules from the client library.
from googleads import ad_manager
def main(client):
# Initialize appropriate service.
creative_set_service = client.GetService(
'CreativeSetService', version='v201811')
# Create a statement to select creativ... | {
"content_hash": "0c5f70184f334b37b09e27572ab06735",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 72,
"avg_line_length": 33.5,
"alnum_prop": 0.697346600331675,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "51bdb6c20f29bb4e114034fff096c6725f2d104f",
"size": "1827"... |
from common_fixtures import * # NOQA
import subprocess
from subprocess import Popen
from os import path
import os
import sys
import pytest
import cattle
import ConfigParser
PROJECTS = []
CERT = '''-----BEGIN CERTIFICATE-----
MIIDJjCCAg4CCQDLCSjwGXM72TANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJB
VTETMBEGA1UECBMKU29tZS1T... | {
"content_hash": "de0d8c9bc03f509d9811a5b403d27bf8",
"timestamp": "",
"source": "github",
"line_count": 2296,
"max_line_length": 79,
"avg_line_length": 30.83493031358885,
"alnum_prop": 0.622060256790542,
"repo_name": "rancherio/rancher-compose",
"id": "76b0879b1d116786730e0b4b06b7b6527d94d5ec",
"si... |
from flask import Blueprint
main = Blueprint('main', __name__)
from . import routes, events
| {
"content_hash": "de3460e603c8477b7422ed2fc26bf711",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 18.8,
"alnum_prop": 0.7127659574468085,
"repo_name": "Yprolic/LinkDragon",
"id": "33ca9f517a2bb124770303bb3e21676d18dbcef5",
"size": "94",
"binary":... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/chemistry/shared_medpack_enhance_constitution_b.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return re... | {
"content_hash": "fbbd56b9aa022a1de9d55a6acecbaf35",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 95,
"avg_line_length": 24.923076923076923,
"alnum_prop": 0.7067901234567902,
"repo_name": "obi-two/Rebelion",
"id": "bbed192db14baca378f03f6246375fd85657634b",
"size": "469... |
import utils
common = utils.utils
class tm1_loading(common):
"""
Please insert comment here!
"""
def __init__(self, tm1Base='http://localhost:8000/api/v1/', tm1AdminName='admin', tm1AdminPW='apple', debugLevel=0):
"""
the default parameters for this class
"""
... | {
"content_hash": "a734d3cc6f38c9dda15988008395a847",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 120,
"avg_line_length": 27.205128205128204,
"alnum_prop": 0.6046182846371347,
"repo_name": "scrumthing/pytm1",
"id": "099ce760ecb9657811ee40ded178232f51e642dc",
"size": "21... |
import json
import asyncio
from statistics import median
from numbers import Number
from electrum.network import filter_protocol, Network
from electrum.util import create_and_start_event_loop, log_exceptions
loop, stopping_fut, loop_thread = create_and_start_event_loop()
network = Network()
network.start()
@log_exc... | {
"content_hash": "e28eec176fe7ae78176b8eab41ec03b7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 92,
"avg_line_length": 31.23076923076923,
"alnum_prop": 0.7142857142857143,
"repo_name": "fujicoin/electrum-fjc",
"id": "76bcc55b54cfd5b6a55eef3f50c4c7e0dbaadbd4",
"size": ... |
"""
Pygal - A python svg graph plotting library
"""
__version__ = '0.13.0'
import sys
from pygal.config import Config
from pygal.ghost import Ghost
from pygal.graph import CHARTS_NAMES
CHARTS = []
CHARTS_BY_NAME = {}
for NAME in CHARTS_NAMES:
_CHART = type(NAME, (Ghost,), {})
CHARTS.append(_CHART)
CHAR... | {
"content_hash": "610014070222ad3db4616686d3286b20",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 21.272727272727273,
"alnum_prop": 0.6495726495726496,
"repo_name": "vineethguna/heroku-buildpack-libsandbox",
"id": "9ec4e4ce6d3eee2b3ba7b88ef9506bfa60... |
import time
import logging
import numpy as np
from copy import deepcopy
from functools import partial
import qcodes.utils.validators as vals
from qcodes.instrument.parameter import ManualParameter
try:
from pycqed.instrument_drivers.physical_instruments.ZurichInstruments. \
ZI_HDAWG_core import ZI_HDAWG_co... | {
"content_hash": "fea73d4899f24410ecd651bc3a3fbdd5",
"timestamp": "",
"source": "github",
"line_count": 676,
"max_line_length": 89,
"avg_line_length": 44.5887573964497,
"alnum_prop": 0.5333421803463606,
"repo_name": "QudevETH/PycQED_py3",
"id": "3a6a34016dfd5e782a4ef08c5b2a5ce79953434e",
"size": "3... |
import argparse
import codecs
import sys
from tree import DepTree
from collections import defaultdict
from itertools import izip
parser = argparse.ArgumentParser(description="Inflect a lemmatized corpus")
parser.add_argument("-t", type=str, default="data/train", help="training data prefix")
parser.add_argument("-d", t... | {
"content_hash": "5fb96c85067bbe8189ba7957095f9c5b",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 135,
"avg_line_length": 48.59090909090909,
"alnum_prop": 0.622778297474275,
"repo_name": "abhambh1/mt_spring_2016",
"id": "a963e894ca42c70aa6d1db3955c0567affa5219a",
"size"... |
from __future__ import unicode_literals
from django.db import migrations
def set_receipt_types(apps, schema_editor):
Contribution = apps.get_model("contributions", "Contribution")
for contribution in Contribution.objects.all():
if not contribution.receipt_type:
if contribution.is_external... | {
"content_hash": "feecba81dc7d9cd24fd84c60fb0a8a67",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 66,
"avg_line_length": 28.08,
"alnum_prop": 0.6509971509971509,
"repo_name": "mayapurmedia/tovp",
"id": "874178fd17c24fb4f815fe03355d4fcb06a28c83",
"size": "726",
"binary... |
from __future__ import unicode_literals
import datetime
import json
from django.core.urlresolvers import reverse
from django.http import HttpResponsePermanentRedirect, JsonResponse
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from ..cart.utils import ... | {
"content_hash": "4cce7e17a2de7806f307691284c9b82e",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 80,
"avg_line_length": 38.563025210084035,
"alnum_prop": 0.659185007626934,
"repo_name": "itbabu/saleor",
"id": "42f4372046f3bb496cb3962d21f5123c8e6c4079",
"size": "4589",... |
"""
Helper functions for creating Form classes from Django models
and database field objects.
"""
from __future__ import unicode_literals
from collections import OrderedDict
from itertools import chain
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError,
)
fro... | {
"content_hash": "47982524d91a2dd15d0450e78d670910",
"timestamp": "",
"source": "github",
"line_count": 1333,
"max_line_length": 116,
"avg_line_length": 41.90772693173293,
"alnum_prop": 0.5882784669638222,
"repo_name": "jarshwah/django",
"id": "f44ce33f6531f118dd48fe1f1b78d237003e6535",
"size": "55... |
"""Layer serialization/deserialization functions."""
import threading
import tensorflow.compat.v2 as tf
from keras.engine import base_layer
from keras.engine import input_layer
from keras.engine import input_spec
from keras.layers import activation
from keras.layers import attention
from keras.layers import convolut... | {
"content_hash": "de489003d81888461cdc562260bee7b5",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 80,
"avg_line_length": 31.75095785440613,
"alnum_prop": 0.6947025461566309,
"repo_name": "keras-team/keras",
"id": "27b928454fd9884ddc02162439248f88a4824366",
"size": "897... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("team", "0001_initial"),
]
operations = [
migrations.AlterModelOptions(
name="team",
options={
"permissions": (("can_... | {
"content_hash": "1c4083456793e803d1861aac63804760",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 22.476190476190474,
"alnum_prop": 0.510593220338983,
"repo_name": "fin/froide",
"id": "2cd066d81b88459b9503a8ef83efb2497e183900",
"size": "545",
"b... |
from twisted.protocols import basic
from twisted.internet import protocol, reactor
class HTTPEchoProtocol(basic.LineReceiver):
def __init__(self):
self.lines = []
def lineReceived(self, line):
self.lines.append(line)
if not line:
self.sendResponse()
def sendResponse(se... | {
"content_hash": "6f22ffee7443aa543398bc11355637ab",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 68,
"avg_line_length": 28.84,
"alnum_prop": 0.6643550624133149,
"repo_name": "r2k0/py-apps",
"id": "bb4cf874d379a18b28b4ac10c53391ee420240f8",
"size": "721",
"binary": fa... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0007_location_non_mandatory'),
]
operations = [
migrations.AddField(
model_name='article',
name='show_day',
... | {
"content_hash": "43ee648e4752f9c0d8e444945828f475",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 52,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.5546605293440736,
"repo_name": "PARINetwork/pari",
"id": "ce1af95c9bd40856b859d8e01c7e1dd41215668f",
"size": "893... |
"""Set category of ALV document revisions.
Revision ID: 22710e6fd2b1
Revises: 4a3debf40b72
Create Date: 2018-03-14 15:35:30.841219
"""
from alembic import op
import sqlalchemy as sa
from app.models.base_model import BaseEntity
from app.enums import FileCategory
from sqlalchemy.ext.declarative import declarative_base... | {
"content_hash": "8c9245255a5b8dd8824a44eb502f1421",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 74,
"avg_line_length": 25.450704225352112,
"alnum_prop": 0.6878804648588821,
"repo_name": "viaict/viaduct",
"id": "ff8d7bf08b192dc00b0746f3126a6cddb14d4674",
"size": "1807"... |
import collections
import http
import logging
import sys
import traceback
import uuid
import flask
import flask_restful
import marshmallow
from tuxedo_mask import repositories, services, resources
app = flask.Flask(__name__)
app.config['PROPAGATE_EXCEPTIONS'] = True
api = flask_restful.Api(app=app)
api.add_resource... | {
"content_hash": "26c91b631805c22c88f1d61b778791cd",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 111,
"avg_line_length": 32.274809160305345,
"alnum_prop": 0.6866130558183539,
"repo_name": "dnguyen0304/tuxedo-mask",
"id": "ff64e6131692741235aaf3617e639b4275fc84a8",
"si... |
"""This API defines FeatureColumn abstraction.
To distinguish the concept of a feature family and a specific binary feature
within a family, we refer to a feature family like "country" as a feature
column. For example "country:US" is a feature which is in "country" feature
column and has a feature value ("US").
Suppo... | {
"content_hash": "d12f9366e58112898a95cf713ea8ed99",
"timestamp": "",
"source": "github",
"line_count": 1653,
"max_line_length": 82,
"avg_line_length": 40.1826981246219,
"alnum_prop": 0.6317033512992684,
"repo_name": "rew4332/tensorflow",
"id": "176757d017b0b9eb8f404365528d431543dae0e1",
"size": "6... |
from __future__ import print_function, unicode_literals
from future.builtins import int, input
from optparse import make_option
from socket import gethostname
from django import VERSION
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth import get_user_model
from django.contrib... | {
"content_hash": "6ab4bf2473a1e63ea2e4622b1308f7a6",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 77,
"avg_line_length": 40.24683544303797,
"alnum_prop": 0.5793363736436546,
"repo_name": "SoLoHiC/mezzanine",
"id": "c064c980007e294fe7b1c059e1c0efef78848525",
"size": "63... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
c... | {
"content_hash": "583efaf75836f3bc5903ba60f16dfa62",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 171,
"avg_line_length": 44.88503253796095,
"alnum_prop": 0.6418905857336169,
"repo_name": "tysonholub/twilio-python",
"id": "9ca37a65a53e3299b1d852b6be553f03bdb21c5f",
"si... |
import logging
import uuid
import pytest
import sdk_auth
import sdk_cmd
import sdk_hosts
import sdk_install
import sdk_marathon
import sdk_security
import sdk_utils
from tests import auth
from tests import config
from tests import test_utils
log = logging.getLogger(__name__)
pytestmark = pytest.mark.skipif(sdk_ut... | {
"content_hash": "83fb3b34ac4e9debcfe60d02f7f3ed93",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 104,
"avg_line_length": 29.399122807017545,
"alnum_prop": 0.5552737580187975,
"repo_name": "vishnu2kmohan/dcos-commons",
"id": "ab7296562565a615157e13fdec7fc8ac5d669969",
... |
from __future__ import print_function
import os
import shutil
from ..utils import in_temporary_directory
from ..utils import assert_cmd_success, assert_cmd_failure
from ..utils import assert_files_exist
from ..workspace_assertions import assert_workspace_initialized
from ..workspace_assertions import assert_no_warni... | {
"content_hash": "6bc5d2371ad062bdb20f168b61ef2f3a",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 78,
"avg_line_length": 39.858333333333334,
"alnum_prop": 0.567844449090529,
"repo_name": "davetcoleman/catkin_tools",
"id": "e51a455e643aa7c7c035d9ed15a9dc5c2e611b4e",
"si... |
import io
import re
from setuptools import setup
with io.open('./xero/__init__.py', encoding='utf8') as version_file:
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file.read(), re.M)
if version_match:
version = version_match.group(1)
else:
raise RuntimeError("Una... | {
"content_hash": "3dc1199fed6949f254ba18f69ac9e82f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 95,
"avg_line_length": 30.865384615384617,
"alnum_prop": 0.5950155763239875,
"repo_name": "jaymcconnell/pyxero",
"id": "cae8d5620751fe34bd97f43416141415c781322e",
"size": "... |
from django.test import TestCase
from django.template import Template, Context
from django.http import HttpRequest
from simple_pagination.utils import(
normalize_page_number,
get_querystring_for_page,
get_page_numbers,
)
from simple_pagination.models import EndlessPage, PageList, ShowItems
from django.http ... | {
"content_hash": "909fab17c101d1c971ac2ebbbd51bd17",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 122,
"avg_line_length": 34.92857142857143,
"alnum_prop": 0.5848670756646217,
"repo_name": "MicroPyramid/django-simple-pagination",
"id": "ab66de2716b2f87e96ea2e5d518f2126072e... |
"""Fichier contenant la fonction noms."""
from primaires.scripting.fonction import Fonction
from primaires.scripting.instruction import ErreurExecution
class ClasseFonction(Fonction):
"""Renvoie une liste de noms de plusieurs informations.
En paramètre de cette fonction doit être précisé le type
d'infor... | {
"content_hash": "8d653aff540a3150bd3e1ba9b45b50d8",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 73,
"avg_line_length": 30.823529411764707,
"alnum_prop": 0.6265903307888041,
"repo_name": "vlegoff/tsunami",
"id": "8c2181472c98a505f3d18689449ed00e24c8b4fd",
"size": "3149... |
"""
Manage communication with child zones and keep state for them.
"""
import datetime
import traceback
from eventlet import greenpool
from novaclient import v1_1 as novaclient
from nova import db
from nova import flags
from nova import log as logging
from nova.openstack.common import cfg
from nova import utils
zo... | {
"content_hash": "edea67846f59bfc78d7e591361d020b5",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 78,
"avg_line_length": 35.08496732026144,
"alnum_prop": 0.5860655737704918,
"repo_name": "russellb/nova",
"id": "b9d021c7561c914e0cea3462449bccfc317c1ae7",
"size": "6003",... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'win32lz.pyd')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| {
"content_hash": "31d64d1ef4f0dc6760fb1d400f9437b6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.5971223021582733,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "c737d1b6c0d5344ae020b575339b049bf60... |
__all__ = [
"release"
]
__doc__ = "Utilities for restarting the optimization"
from Optizelle.Utility import *
from Optizelle.Properties import *
import Optizelle.EqualityConstrained.State
class X_Vectors(list):
"""Holds restart information for the vectors in the vector space X"""
pass
class Y_Vectors(lis... | {
"content_hash": "ef9b5380081a4b723d8b181c82e8c2b7",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 73,
"avg_line_length": 29.20689655172414,
"alnum_prop": 0.7095631641086186,
"repo_name": "OptimoJoe/Optizelle",
"id": "6af712faaf729197b58cac2550a0020f627d176c",
"size": "1... |
"""functions related to modeling"""
import pymel.internal.factories as _factories
import pymel.internal.pmcmds as cmds
import general as _general
def pointPosition(*args, **kwargs):
return _general.datatypes.Point(cmds.pointPosition(*args, **kwargs))
def curve(*args, **kwargs):
"""
Maya Bug Fix:
- name par... | {
"content_hash": "df7ca42f1fdadc89425c4a0d4bebb140",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 74,
"avg_line_length": 28.823529411764707,
"alnum_prop": 0.6673469387755102,
"repo_name": "shrtcww/pymel",
"id": "0c4b8781a745968069d862b54a9725600a7dc89e",
"size": "980",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import ast
import inspect
import linecache
import sys
import textwrap
import tokenize
import warnings
from ast import PyCF_ONLY_AST as _AST_FLAG
from bisect import bisect_right
import py
import six
class Sou... | {
"content_hash": "219800a2a2b5ec32f064f62150433bd1",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 84,
"avg_line_length": 31.865030674846626,
"alnum_prop": 0.5751829033500192,
"repo_name": "hackebrot/pytest",
"id": "887f323f96992f457c64ef160b8e00d8ad7b052d",
"size": "10... |
from sitemap import NewsCategoriesSitemap, NewsSitemap
| {
"content_hash": "1889ddcfaf225f192296be585e8f76a8",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 54,
"avg_line_length": 55,
"alnum_prop": 0.8909090909090909,
"repo_name": "aldryn/aldryn-news",
"id": "2980b7b3a5fb5c4188bad89080f6f6520f577fd5",
"size": "79",
"binary": f... |
import unittest
from django.test import TestCase
from .test_backends import BackendTests
class TestDBBackend(BackendTests, TestCase):
backend_path = 'wagtail.search.backends.db'
# Doesn't support autocomplete
@unittest.expectedFailure
def test_autocomplete(self):
super().test_autocomplete()... | {
"content_hash": "92cd501732ab331274c456538a488add",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 70,
"avg_line_length": 31.39240506329114,
"alnum_prop": 0.707258064516129,
"repo_name": "takeflight/wagtail",
"id": "f03c6fb06185e5ad9ae2ad33cde5fa94c0b916b8",
"size": "248... |
import json
import datetime
import discord
from jshbot import utilities, configurations, plugins, logger
from jshbot.exceptions import ConfiguredBotException
from jshbot.commands import Command, Response
__version__ = '0.1.0'
CBException = ConfiguredBotException('Emoji updater')
uses_configuration = True
@plugins.... | {
"content_hash": "1f9369130514664f23d2dca492f88ccb",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 93,
"avg_line_length": 37.92307692307692,
"alnum_prop": 0.6240703177822853,
"repo_name": "jkchen2/JshBot-plugins",
"id": "cfa8360d5ca70ca7b16df5c10c21d3a511a6d3be",
"size":... |
"""Support for Fjäråskupan fans."""
from __future__ import annotations
from typing import Any
from fjaraskupan import (
COMMAND_AFTERCOOKINGTIMERAUTO,
COMMAND_AFTERCOOKINGTIMERMANUAL,
COMMAND_AFTERCOOKINGTIMEROFF,
COMMAND_STOP_FAN,
State,
)
from homeassistant.components.fan import FanEntity, FanE... | {
"content_hash": "8dab7ae51953b03834c02673173c8689",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 88,
"avg_line_length": 33.40721649484536,
"alnum_prop": 0.6350871779046443,
"repo_name": "mezz64/home-assistant",
"id": "c856a94fa074b2649dfa4444c32925268cbe4c7f",
"size":... |
import os
import numpy as np
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
import shap
import mlflow
from mlflow.tracking import MlflowClient
from mlflow.artifacts import download_artifacts
# prepare training data
X, y = load_iris(return_X_y=True, as_frame=True)
# trai... | {
"content_hash": "5f54e3d196c1616fcf892af2f8a2ddcf",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 84,
"avg_line_length": 27.657894736842106,
"alnum_prop": 0.7554709800190295,
"repo_name": "mlflow/mlflow",
"id": "15934cf675f2f2c6b0187d4a5069a5054539410c",
"size": "1051",... |
"""
Applies tonka-specific mods to CyPhyML_org.xme
..\..\externals\common-scripts\gmepy.exe xme2mga CyPhyML_org.xme
.\tonka_mods.py
..\..\externals\common-scripts\gmepy.exe mga2xme CyPhyML_org.mga
start CyPhyML_org.xme
refresh in CyPhyML.xme, etc
"""
import win32com.client
mods = {
"/@1_Component/@1x_... | {
"content_hash": "3b212fe86a5b3488a260a9f406de9868",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 133,
"avg_line_length": 37.44827586206897,
"alnum_prop": 0.679097605893186,
"repo_name": "pombredanne/metamorphosys-desktop",
"id": "26caf5cc21e7f26106a5ce7716baf79dcc37e674"... |
from keras.datasets import cifar10
from matplotlib import pyplot
from scipy.misc import toimage
import numpy
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers import Flatten
from keras.constraints import maxnorm
from keras.optimizers import SGD
from ke... | {
"content_hash": "6f87d626ca70e3b7f7accd2cd82886d0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 119,
"avg_line_length": 32.68421052631579,
"alnum_prop": 0.7407407407407407,
"repo_name": "RichardLeeK/MachineLearning",
"id": "b537f12cafdc6f23a5a909bf48a7888031ab7704",
"... |
import TrelloWrapper as wrapper
import unittest
class PrimesTestCase(unittest.TestCase):
"""Tests for TrelloWrapper."""
""" TESTS FOR LEVENSHTEIN DISTANCE """
def test_0_levenshtein_distance(self):
"""Is 0 successfully determined in the levenshtein distance?"""
# Two identical words shou... | {
"content_hash": "6dbe13f1ad5e777ba47b9555f43e3a8c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 71,
"avg_line_length": 35.16129032258065,
"alnum_prop": 0.6660550458715596,
"repo_name": "Mymoza/trello-similar-labels",
"id": "1834c118f51a719ab798dc9e554cf14efec3cecf",
"... |
"""
DNSSEC Trust Anchor Tool (dnssec_ta_tool.py)
This tool will extract DNSSEC Trust Anchors from a Trust Anchor XML file
formatted as described in RFC 7958. Validation of the detached signature
over the Trust Anchor XML file is NOT performed by this tool.
"""
import sys
import time
import argparse
import base64
impo... | {
"content_hash": "6f651a904b728dd593a1d5b8d11ca7b4",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 89,
"avg_line_length": 33.47787610619469,
"alnum_prop": 0.5459952418715305,
"repo_name": "kirei/dnssec-ta-tools",
"id": "f61deeb2b4c042705004e5a849ebf5aefd81add4",
"size":... |
import cPickle
import logging
import numpy as np
import sys
import xgboost as xgb
from operator import itemgetter
logging.basicConfig(level=logging.INFO,
format="%(asctime)s [%(levelname)s]: %(message)s")
model_file = 'gbvc_model.pkl'
def train():
logging.info('loading training data')
tr... | {
"content_hash": "a2507c80482a0c77571d61c2d77b1f7b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 79,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.5773322422258592,
"repo_name": "kn45/ClickBaits",
"id": "ecaac769a918594f10e6d77a08a586ce1f6b5774",
"size": "2470... |
from go.conversation.view_definition import ConversationViewDefinitionBase
class ConversationViewDefinition(ConversationViewDefinitionBase):
pass
| {
"content_hash": "18b928d9eb2e08ce608a4b7013d465a0",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 74,
"avg_line_length": 30.4,
"alnum_prop": 0.875,
"repo_name": "praekelt/vumi-go",
"id": "c2a19fdd4225e2d3f003cbce4bdc6186624a6ece",
"size": "152",
"binary": false,
"cop... |
import unittest
class FakeTest(unittest.TestCase):
def test_true(self):
self.assertTrue(True)
| {
"content_hash": "dd59130a03adb7f3a54c242a611fdbf2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 34,
"avg_line_length": 15.571428571428571,
"alnum_prop": 0.6972477064220184,
"repo_name": "citrix-openstack-build/neutron-lbaas",
"id": "1ddb6e95555a92908d02df1bde9396124078c6... |
import os
import setuptools
# third party libraries
pass
# first party libraries
pass
project_name = 'tiny_id'
author = 'Brian J Petersen'
author_email = None
def load_file(fname, default=None):
try:
with open(fname, 'r') as f:
d = f.read()
except:
d = default
return d
readme ... | {
"content_hash": "06eaa9019a04695411ac766217baa6f0",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 68,
"avg_line_length": 23.886363636363637,
"alnum_prop": 0.6470028544243578,
"repo_name": "brianjpetersen/tiny_id",
"id": "6258c2e77a9a787bbd83de624a1b20f3316aece2",
"size"... |
"""
This module implements a clustering approach for OCLC numbers based on
HathiTrust data and data acquired via the OCLC Translation Table.
This version is a re-write to try and speedup the algorithm.
v.2 - removing 'rights' queries, farm out cluster_oclc and cluster_htitem_jn
tables to core memory.
v.3 - re-implem... | {
"content_hash": "8341d03e33decbfcfcaa1c194c20df73",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 115,
"avg_line_length": 32.87818696883853,
"alnum_prop": 0.5496295019817335,
"repo_name": "mlibrary/phdb",
"id": "955b2d7ca65081383cc7ae9296f0d8e74f350cd4",
"size": "11628... |
class Invertible(object):
r"""
Mix-in for invertible transforms. Provides an interface for taking the
`pseudo` or true inverse of a transform.
Has to be implemented in conjunction with :map:`Transform`.
"""
@property
def has_true_inverse(self):
r"""
``True`` if the pseudoin... | {
"content_hash": "d5cad216a28c4c3c6d8c0849b05e4d35",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 32.94827586206897,
"alnum_prop": 0.6232339089481946,
"repo_name": "grigorisg9gr/menpo",
"id": "1e51d368ff947e478dff28f5b39d3ff6e7851eb2",
"size": "19... |
import logging
import time
from .logger import setup_logger, setup_boto_logger
from .dest import S3Dest
class Base:
def __init__(self, **args):
self.args = args
setup_boto_logger()
self.logger = setup_logger(__name__, logging.INFO)
if not hasattr(self, 'dest'):
self.de... | {
"content_hash": "91dd9cccc8a32b3fa941cf5f7338ff63",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 74,
"avg_line_length": 26.639344262295083,
"alnum_prop": 0.5132307692307693,
"repo_name": "uiureo/demae",
"id": "5a0343ba2dbb17f787d065f8028804136897e5f6",
"size": "1625",
... |
# coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this blob except in compliance with the License.
# You may obtain a copy of the License at
#... | {
"content_hash": "050d40ff22359a8c2a1e9eb70d65df70",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 119,
"avg_line_length": 41.25442477876106,
"alnum_prop": 0.6127527216174183,
"repo_name": "jehine-MSFT/azure-storage-python",
"id": "f501999ffa668a1e9ca6bb3a63b61632e40c1271... |
import odf.opendocument
from odf.table import Table, TableRow, TableCell
from odf.text import P
# http://stackoverflow.com/a/4544699/1846474
class GrowingList(list):
def __setitem__(self, index, value):
if index >= len(self):
self.extend([None]*(index + 1 - len(self)))
list.__setitem__(... | {
"content_hash": "7378cac9922e1ef3517ae28c84e5b55a",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 133,
"avg_line_length": 41.44017094017094,
"alnum_prop": 0.5868825409920594,
"repo_name": "marcoconti83/read-ods-with-odfpy",
"id": "a779ed40ed8ed23d1df1ba9c43ec53c24cebe4f5... |
from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
from django.views.decorators.cache import never_cache
from honeypot.decorators import check_honeypot
from sked.views import (SessionList, SessionDetail, CreateSession,
UpdateSession, SingleDayView,... | {
"content_hash": "93a454297ef017bd7453d8dd537ae5d9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 167,
"avg_line_length": 76.68181818181819,
"alnum_prop": 0.6716064018968583,
"repo_name": "sunlightlabs/tcamp",
"id": "018693715f4003ea0ddd22208134a6f1936f6fed",
"size": "1... |
import a10_neutron_lbaas.a10_context as a10_context
from a10_neutron_lbaas.vthunder import keystone as keystone_helpers
class A10Context(a10_context.A10Context):
pass
class A10WriteContext(a10_context.A10WriteContext):
pass
class A10WriteStatusContext(a10_context.A10WriteContext):
def __exit__(self,... | {
"content_hash": "4996794e7f7205a94590ad17ccd1d3b8",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 91,
"avg_line_length": 37.1,
"alnum_prop": 0.6199460916442049,
"repo_name": "a10networks/a10-neutron-lbaas",
"id": "580e47f262b5c33daf987ac233f3029ae0d9582c",
"size": "2485... |
"""Kuler Sky lights integration."""
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .const import DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN
PLATFORMS = [Platform.LIGHT]
async def async_setup_entry(hass: HomeAs... | {
"content_hash": "accc971cd45edebe64c173838c0a96d0",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 83,
"avg_line_length": 31.515151515151516,
"alnum_prop": 0.7278846153846154,
"repo_name": "home-assistant/home-assistant",
"id": "39c0d0a5b8454eecb46c286e5665c7ea7a4001cf",
... |
import contextlib, os.path, re, tempfile
from ..linkers import StaticLinker
from .. import coredata
from .. import mlog
from .. import mesonlib
from ..mesonlib import EnvironmentException, MesonException, version_compare, Popen_safe
"""This file contains the data files of all compilers Meson knows
about. To support a... | {
"content_hash": "bfe0284d8491f6204dd4bdcb7bce305c",
"timestamp": "",
"source": "github",
"line_count": 1048,
"max_line_length": 120,
"avg_line_length": 38.82538167938932,
"alnum_prop": 0.5525572021922387,
"repo_name": "aaronp24/meson",
"id": "579988f06f01f09a6473d5652028933821a91d1f",
"size": "412... |
"""
Copyright (c) 2010-2011 Tyler Kennedy <tk@tkte.ch>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, pub... | {
"content_hash": "b4d1168675b41af0af1cb84520313f1f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 48.08,
"alnum_prop": 0.7936772046589018,
"repo_name": "deathcap/Burger",
"id": "a178d19591f9d4798e8558df6288ca3136b2a066",
"size": "1247",
"binary"... |
import stopwatch
import RPi.GPIO as GPIO
pin = 25
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
print "\n***************************************"
print "*** Welcome to Five Second Stadium! ***"
print "***************************************\n"
print "Press the BUTTON to start and press again to stop after 5 sec!"
p... | {
"content_hash": "03513887d2c08757076acb92b72eb882",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 72,
"avg_line_length": 27.363636363636363,
"alnum_prop": 0.521594684385382,
"repo_name": "nodu/RPiWorkshop",
"id": "ab2dcac4b923e1a50f93513275894f52263d93f7",
"size": "903"... |
from django.contrib.auth.models import User
from django.forms import ModelForm,Textarea
from django import forms
from django.contrib.auth.forms import UserCreationForm
import string
from play.models import *
import constants
import datetime
class IdeaForm(ModelForm):
title=forms.CharField()
description=forms.C... | {
"content_hash": "d089230bc7c398f651f56f3522176534",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 107,
"avg_line_length": 33.66279069767442,
"alnum_prop": 0.6404145077720207,
"repo_name": "fraferra/PlayCity",
"id": "117619347b024d35bb1afc91c0e37f53a9a9fe5c",
"size": "28... |
from model import load_encoders,save_object
from model_export import Exporter
from db_operations import DbOperator
import cPickle as pickle
import argparse
import h5py
import numpy as np
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog='Encoder Exporter')
parser.add_argument('-t','--table',requi... | {
"content_hash": "fbf5984a2e5879ccf109363ebe6219be",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 83,
"avg_line_length": 34.549019607843135,
"alnum_prop": 0.604994324631101,
"repo_name": "bottydim/detect-credit-card-fraud",
"id": "d4ec3c2db7cc7eb971e5a91001ac035157ee8b1b"... |
from sys import argv
import string
import random
import os
# read in command line args
params = list(argv)
# Create dir name
directory = os.path.join(params[1],params[2])
# Create directory
os.makedirs(directory)
print "#@@# " + directory + " #@@#"
| {
"content_hash": "05e97189f67ba8411c5e53b606fbda99",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 45,
"avg_line_length": 16.866666666666667,
"alnum_prop": 0.7035573122529645,
"repo_name": "gkiar/MR-devtools",
"id": "c21d9c1b63ea7f60bd3e01daab61d037ebb8b78b",
"size": "70... |
from __future__ import unicode_literals
import frappe, os
from frappe.utils import touch_file
def make_boilerplate(dest, app_name):
if not os.path.exists(dest):
print "Destination directory does not exist"
return
hooks = frappe._dict()
hooks.app_name = app_name
app_title = hooks.app_name.replace("_", " ").ti... | {
"content_hash": "5de1fca6344e138247822f53f12f9675",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 104,
"avg_line_length": 26.910931174089068,
"alnum_prop": 0.6443508349631413,
"repo_name": "gangadharkadam/vervefrappe",
"id": "419b3f0552d821b37b77d19869cd1f9622faa48e",
... |
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General conf... | {
"content_hash": "036fd03c70fbad214f73724a149c28ae",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 80,
"avg_line_length": 32.70260223048327,
"alnum_prop": 0.7054677731044674,
"repo_name": "vicalloy/lbutils",
"id": "bac96d1116403b0ea479a2b23f16e3fc3db40f56",
"size": "922... |
version = '$VER: ParOpen.py_V1.00.00_(C)15-01-2006_B.Walker_G0LCU.'
# Set up a basic screen, NOTE:- ~print '\f'~ is used as the CLS command.
print '\f'
print ' ',version
print
print ' Parallel Port access on the AMIGA using PAR: as a VOLUME.'
print
print ' Press Ctrl-C to... | {
"content_hash": "b7c353f63d6cf6a05eddc80823ceb4e4",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 93,
"avg_line_length": 39.567567567567565,
"alnum_prop": 0.5307377049180327,
"repo_name": "ActiveState/code",
"id": "74fba8e23e578adf8679d6a07902ff7215e10ef4",
"size": "295... |
from __future__ import absolute_import, print_function
import os.path
from unittest.case import expectedFailure
from commoncode.testcase import FileBasedTesting
from cluecode_assert_utils import check_detection
class TestHolders(FileBasedTesting):
test_data_dir = os.path.join(os.path.dirname(__file__), 'data')
... | {
"content_hash": "850ffdaa3c8c261b5ee67f8d84ce048b",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 114,
"avg_line_length": 37.03492063492064,
"alnum_prop": 0.5961769243956797,
"repo_name": "retrography/scancode-toolkit",
"id": "ce704ae283be33b2e7071554c57d034975112853",
... |
from base import * # noqa
from log_util import init_logger # noqa
| {
"content_hash": "2a8434f181bfaed6947e458f050cc273",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 40,
"avg_line_length": 34,
"alnum_prop": 0.7205882352941176,
"repo_name": "fabrickit/fabkit",
"id": "615875a0902c1492fe05ae183daa702916df2962",
"size": "86",
"binary": fal... |
import math
from BaseInteractor import _BaseInteractor
class RadiusInteractor(_BaseInteractor):
"""
Select an annulus through a 2D plot
"""
def __init__(self, base, axes, color='black', zorder=5, arc1=None,
arc2=None, theta=math.pi / 8):
"""
"""
_BaseInteractor... | {
"content_hash": "9893233d3b5dc8dc86d7d8a79c0e73aa",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 77,
"avg_line_length": 27.0078125,
"alnum_prop": 0.48973098061903386,
"repo_name": "lewisodriscoll/sasview",
"id": "c72d1914810066d07843c83e3062b495bbccd366",
"size": "345... |
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
... | {
"content_hash": "c3a81c2bdae346cbc9fb8dff5b45bd69",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 217,
"avg_line_length": 62.104615384615386,
"alnum_prop": 0.5814011097899326,
"repo_name": "kdaily/altanalyze",
"id": "af27eb1cb7d51cdda9e8ff9b110c9f6e2550b8eb",
"size": "... |
from __future__ import absolute_import
from copy import copy
from itertools import chain
import logging
import os
import re
import sys
import shlex
from tempfile import NamedTemporaryFile
from django.utils.encoding import smart_text
try:
from urllib.request import pathname2url
from urllib.parse import urljoi... | {
"content_hash": "9cf73af20372f540bd7b416cca0b6658",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 119,
"avg_line_length": 35.81163434903047,
"alnum_prop": 0.5761912128712872,
"repo_name": "tclancy/django-wkhtmltopdf",
"id": "9246b8b5ca6f49b28c60d223961af6308e56f18b",
"... |
from .contrib import * # noqa
DATABASES = {
'default': {
# Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
'ENGINE': 'django.contrib.gis.db.backends.postgis',
# Or path to database file if using sqlite3.
'NAME... | {
"content_hash": "ab6783bb6494ec2da44eb87c7182ef5e",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 71,
"avg_line_length": 28.037634408602152,
"alnum_prop": 0.502588686481304,
"repo_name": "AIFDR/inasafe-django",
"id": "758d5cc3a618ff2f42400444513949ccb8e44e1b",
"size": ... |
def simple_print(msg):
print(msg)
def compat_input(msg):
return input(msg)
| {
"content_hash": "aa21f7bfcadf129833e990580dc8380f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 22,
"avg_line_length": 14.166666666666666,
"alnum_prop": 0.6588235294117647,
"repo_name": "danifus/pssepath",
"id": "5f9a3eb66918ec61860102bf02ed13ef95277516",
"size": "85",... |
import numpy as np
class BaseEstimator(object):
X = None
y = None
y_required = True
fit_required = True
def _setup_input(self, X, y = None):
"""
Ensures X and y are stored as numpy ndarrays by converting from an
array-like object if necessary. Enables estimators to define whether
they r... | {
"content_hash": "bff77e75cae430604166a9e633d586aa",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 92,
"avg_line_length": 25.904761904761905,
"alnum_prop": 0.6691176470588235,
"repo_name": "paulmorio/grusData",
"id": "7fd693974be2773a0ead56cc1ed6f694a4068452",
"size": "1... |
import http.server
import http.client
import json
import socketserver
class OpenFDAClient():
OPENFDA_API_URL = "api.fda.gov"
OPENFDA_API_EVENT = "/drug/event.json"
def get_event(self, limit):
conn = http.client.HTTPSConnection(self.OPENFDA_API_URL)
conn.request("GET", self.OPENFDA_API_EVE... | {
"content_hash": "5132b7521b18468305333f0c5f8fbd04",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 118,
"avg_line_length": 32.79245283018868,
"alnum_prop": 0.5164556962025316,
"repo_name": "nakagawamariana/OpenFDA",
"id": "c005ac66c79b933fcac0ed628d5f8fc4f1918eb8",
"siz... |
import itertools
import sys
# Require Python 3.7+ for ordered dictionaries so that the order of the
# generated tests remain the same.
# Usage:
# python3.7 mongos-pin-auto-tests.py > mongos-pin-auto.yml
if sys.version_info[:2] < (3, 7):
print('ERROR: This script requires Python >= 3.7, not:')
print(sys.version... | {
"content_hash": "04a80bcc4dcff92d37b9cb43fa4142a1",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 91,
"avg_line_length": 30.50294117647059,
"alnum_prop": 0.5624337093819304,
"repo_name": "mongodb/node-mongodb-native",
"id": "1072ec29073c0357c0c426b105c5fc649c58110d",
"... |
'''
Copyright 2013 Cosnita Radu Viorel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute... | {
"content_hash": "2843b067d4abbe4d600eb2c32b430953",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 126,
"avg_line_length": 47.74576271186441,
"alnum_prop": 0.7323393681221158,
"repo_name": "rcosnita/fantastico",
"id": "7c5b1a1fc1b90005af0f19dd8ee87fb063925a29",
"size": "... |
from django.contrib.auth.models import User
from django.test import TestCase
from checkouts import util
from checkouts.models import AircraftType
import checkouts.tests.helper as helper
class GetAircraftTypeNamesTests(TestCase):
def test_empty(self):
self.assertEqual(len(util.get_aircrafttype_names... | {
"content_hash": "836ff30ef0b7291df0df0dffea6c5f33",
"timestamp": "",
"source": "github",
"line_count": 597,
"max_line_length": 119,
"avg_line_length": 37.02512562814071,
"alnum_prop": 0.572566051393413,
"repo_name": "eallrich/checkniner",
"id": "8f1f5fd2fd887158885c82439c8fcb0abea6c84a",
"size": "... |
from pyglet.gl import *
from plot_rotation import get_spherical_rotatation
from util import get_model_matrix, get_projection_matrix
from util import get_view_direction_vectors, get_basis_vectors
from util import screen_to_model, model_to_screen
from util import vec_subs, get_direction_vectors
class PlotCamera(object):... | {
"content_hash": "31b67a73c3a88a5a928ca60329bbd879",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 98,
"avg_line_length": 31.008196721311474,
"alnum_prop": 0.5651599259846682,
"repo_name": "jbaayen/sympy",
"id": "14ff564bf4fbfbe92f770c96051311f0d363aea9",
"size": "3783"... |
from oslo_utils import uuidutils
from solum.api.handlers import handler
from solum import objects
class SensorHandler(handler.Handler):
"""Fulfills a request on the sensor resource."""
def get(self, id):
"""Return a sensor."""
return objects.registry.Sensor.get_by_uuid(self.context, id)
... | {
"content_hash": "0235a4aa957e55e0e35af15e12c33ad4",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 71,
"avg_line_length": 31.675675675675677,
"alnum_prop": 0.6006825938566553,
"repo_name": "stackforge/solum",
"id": "e574767df62771d207c800f5e513ffeee337e21b",
"size": "171... |
import unittest
import imath
import IECore
import IECoreScene
import IECoreGL
IECoreGL.init( False )
class InstancingTest( unittest.TestCase ) :
class RandomMeshProcedural( IECoreScene.Renderer.Procedural ) :
def __init__( self, meshes, name="/1", depth=0, maxDepth=8 ) :
IECoreScene.Renderer.Procedural.__in... | {
"content_hash": "c6b1878d2a33fda131b5e8fa4e1d0e1d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 94,
"avg_line_length": 25.6,
"alnum_prop": 0.6317471590909091,
"repo_name": "appleseedhq/cortex",
"id": "5f8f41ac1bb686096060e046e9c7b465c5fc5c37",
"size": "4600",
"bina... |
"""A setup module for the GAPIC Monitoring library.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
from setuptools import setup, find_packages
import sys
install_requires = [
'googleapis-common-protos>=1.3.5, <2.0.0dev',
'google-gax>=0.14.1, <0.15.0dev... | {
"content_hash": "0b6e4f5afca639f64390d5f2b7c79728",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 107,
"avg_line_length": 34.86363636363637,
"alnum_prop": 0.6499348109517601,
"repo_name": "ethanbao/api-client-staging-1",
"id": "1f5bf5082651522bf75cbbf185a57c8921af4fc9",
... |
"""
Stub functions that are used by the Amazon CloudFront unit tests.
When tests are run against an actual AWS account, the stubber class does not
set up stubs and passes all calls through to the Boto3 client.
"""
import datetime
from test_tools.example_stubber import ExampleStubber
class CloudFrontStubber(ExampleS... | {
"content_hash": "f264cf6c082099e7829f910a9623646c",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 99,
"avg_line_length": 43.18279569892473,
"alnum_prop": 0.5323705179282868,
"repo_name": "awsdocs/aws-doc-sdk-examples",
"id": "db54a5c53cde3013be94c5e9b5bc6ad0432b1280",
"... |
import os
import sys
from subprocess import Popen, PIPE
import re
def main():
if len(sys.argv) != 1:
print "wrong number of argments"
else:
executeAll()
def executeAll():
(stdout, stderr) = Popen(["time","./zip/zip30/zip","-r","/tmp/archive.zip","./zip/testes/"],stderr=PIPE,stdout=PIPE).c... | {
"content_hash": "fda7cd4e5f1093d9d337f10f1e37b4cd",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 134,
"avg_line_length": 22.238095238095237,
"alnum_prop": 0.6081370449678801,
"repo_name": "lucashmorais/x-Bench",
"id": "3a4a0df456b113a07ac6d5758794fa128f842467",
"size":... |
from argparse import ArgumentParser
from pathlib import Path
from demisto_sdk.commands.content_graph.interface.neo4j.neo4j_graph import Neo4jContentGraphInterface
from demisto_sdk.commands.common.constants import MarketplaceVersions
from demisto_sdk.commands.content_graph.objects.repository import ContentDTO
from Tests... | {
"content_hash": "c76920414e710f7bddc1249f604e7078",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 118,
"avg_line_length": 43.78125,
"alnum_prop": 0.6973590292648109,
"repo_name": "demisto/content",
"id": "17f24ca08e58703026bb46fdc4276830ef072e3a",
"size": "2802",
"bin... |
from .BaseDestination import BaseDestination
from ..mixins import APIMixin
class APIDestination(APIMixin, BaseDestination):
def backup(self, *args, **kwargs):
print "Hello! This is %s's backup method" % self.__class__.__name__
#raise NotImplementedError
def restore(self, filename):
... | {
"content_hash": "4d04f755e054412086df4ba779636180",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 77,
"avg_line_length": 35.125,
"alnum_prop": 0.6405693950177936,
"repo_name": "gustavomazevedo/tbackup-server",
"id": "a39bffbdd9291654ac025662fdce1a028d215777",
"size": "5... |
from __future__ import annotations
import functools
import json
import os
from poetry.core.spdx.license import License
def license_by_id(identifier: str) -> License:
if not identifier:
raise ValueError("A license identifier is required")
licenses = _load_licenses()
return licenses.get(
... | {
"content_hash": "4c4401859f81f916d26cacfb6a8604ea",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 84,
"avg_line_length": 27.04,
"alnum_prop": 0.6479289940828402,
"repo_name": "python-poetry/poetry-core",
"id": "00d4bc6ea0710da11637187c5274da9a9a2c4474",
"size": "1352",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.