text stringlengths 4 1.02M | meta dict |
|---|---|
import myhdl
from myhdl import (Signal, ResetSignal, intbv, always_seq, always,
always_comb)
@myhdl.block
def blinky(led, clock, reset=None):
assert len(led) >= 2
nled = len(led)
maxcnt = int(clock.frequency)
cnt = Signal(intbv(0,min=0,max=maxcnt))
toggle = Signal(bool(0))
... | {
"content_hash": "4f04ccb9ba4d92aab66886de8479e811",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 66,
"avg_line_length": 23.414634146341463,
"alnum_prop": 0.5385416666666667,
"repo_name": "cfelton/rhea",
"id": "9b9b5f8828aaa597674c4505c52409497e95a231",
"size": "961",
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ahjo', '0009_auto_20160420_1528'),
]
database_operations = [
migrations.AlterModelTable('comment', 'comments_comment'),
]
state_operations = [
... | {
"content_hash": "20392fb678577e883b74c763c78c03ba",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 66,
"avg_line_length": 21.692307692307693,
"alnum_prop": 0.6205673758865248,
"repo_name": "okffi/decisions",
"id": "bc6b9016670e5c01876a78156d4c488d02ac50ed",
"size": "636"... |
import traceback
import multiprocessing
import numpy as np
from numba import cuda
from numba import unittest_support as unittest
from numba.cuda.testing import skip_on_cudasim
try:
from concurrent.futures import ThreadPoolExecutor
except ImportError:
has_concurrent_futures = False
else:
has_concurrent_futu... | {
"content_hash": "4049969329553bce6e815cd3869e6453",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 26,
"alnum_prop": 0.6348788198103267,
"repo_name": "stefanseefeld/numba",
"id": "2adca399a0481cf2255f4f38443e98319d0d989f",
"size": "1898",
"binary... |
import numpy as np
from nn.base import NNBase
from nn.math import softmax, make_onehot
from misc import random_weight_matrix
##
# Evaluation code; do not change this
##
from sklearn import metrics
def full_report(y_true, y_pred, tagnames):
cr = metrics.classification_report(y_true, y_pred,
... | {
"content_hash": "512650ab08dc115f24c8eed784f98a57",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 89,
"avg_line_length": 32.54385964912281,
"alnum_prop": 0.5525606469002695,
"repo_name": "kingtaurus/cs224d",
"id": "c2e0ca0951d7e86438e5052284ef658f4e796268",
"size": "55... |
import os
import os.path
class File:
def __init__(self, path):
self.path = path
self.name = os.path.basename(path)
def rename(self, new_name):
new_path = os.path.join(os.path.dirname(self.path), new_name)
os.rename(self.path, new_path)
# Simple class for working with directori... | {
"content_hash": "3f6c1183f3245c0c7f9e494dd80317be",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 69,
"avg_line_length": 26.107142857142858,
"alnum_prop": 0.5841313269493844,
"repo_name": "VoxelDavid/bard",
"id": "259a9f5d11d26e86bd9cb68e9a7dd835fab523e9",
"size": "731"... |
from collections import Counter
from datetime import datetime, timedelta
from tornado import gen
from whoosh.query import Every, DateRange
from whoosh.qparser import MultifieldParser, OrGroup, QueryParser, WildcardPlugin
from whoosh.qparser.dateparse import DateParserPlugin
from whoosh.sorting import MultiFacet
from ... | {
"content_hash": "fec209446fe6aff959184111a88ed0ea",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 97,
"avg_line_length": 36.9,
"alnum_prop": 0.659741041854863,
"repo_name": "blakev/sowing-seasons",
"id": "3c4cc893ab965c1cc7ba0aecbad10f6ee74c6f6a",
"size": "3321",
"bin... |
from msrest.serialization import Model
class HostingEnvironmentDeploymentInfo(Model):
"""Information needed to create resources on an App Service Environment.
:param name: Name of the App Service Environment.
:type name: str
:param location: Location of the App Service Environment.
:type location... | {
"content_hash": "9f5ad08fed57eb8bf767776872c5bf06",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 76,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.6401869158878505,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "c625f9361fb94ef10cfeec99093c2713782d10af",
... |
"""Simple-to-use Python interface to The TVDB's API (www.thetvdb.com)
Example usage:
>>> from tvdb_api import Tvdb
>>> t = Tvdb()
>>> t['Lost'][4][11]['episodename']
u'Cabin Fever'
"""
__author__ = "dbr/Ben"
__version__ = "1.6.4"
import os
import urllib
import urllib2
import StringIO
import tempfile
import warnings
... | {
"content_hash": "7aefb8fad6dd45ff035a492b21145d40",
"timestamp": "",
"source": "github",
"line_count": 816,
"max_line_length": 130,
"avg_line_length": 36.93014705882353,
"alnum_prop": 0.5613406338145014,
"repo_name": "yaymuffins/ypautopony",
"id": "b12fbd820425fa539444e6e17d5f7d4d33c584d5",
"size"... |
from setuptools import setup, find_packages
setup(
name='django-userprofile',
version='0.0.6',
description='Django user profile app.',
long_description = open('README.rst', 'r').read() + open('AUTHORS.rst', 'r').read() + open('CHANGELOG.rst', 'r').read(),
author='Praekelt Foundation',
author_em... | {
"content_hash": "385ce9b9fb1100f27c643a0fce4f59b4",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 124,
"avg_line_length": 33.371428571428574,
"alnum_prop": 0.6121575342465754,
"repo_name": "praekelt/django-userprofile",
"id": "4c29419f7ee95b3d79d25f5d6e4efb428f8a1125",
... |
preco = float(input("Digite o preço: "))
p_desconto = float(input("Digite o % de desconto: "))
desconto = preco * p_desconto / 100
preco_final = preco - desconto
print("Desconto R$%5.2f" % desconto)
print("Preço final R$%5.2f" % preco_final)
| {
"content_hash": "b9180a8adeba7beec2069bf627c21b65",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 53,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.6818181818181818,
"repo_name": "laenderoliveira/exerclivropy",
"id": "d608db6466e2876548662ef02892a902d335ac7f",
"... |
"""
Solve a constant pressure ignition problem where the governing equations are
implemented in Python.
This demonstrates an approach for solving problems where Cantera's reactor
network model cannot be configured to describe the system in question. Here,
Cantera is used for evaluating thermodynamic properties and kin... | {
"content_hash": "18dcbc834d3258ac734475e60476379d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 80,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6624386252045826,
"repo_name": "Heathckliff/cantera",
"id": "51f3e6c48662a36512c8bd850d5a46f210cd188c",
"size": "... |
from collections import namedtuple
import logging
from operator import itemgetter
from django.conf import settings
from django.utils.translation import gettext_lazy as _
from horizon import exceptions
from openstack_dashboard import api
LOG = logging.getLogger(__name__)
def flavor_list(request):
"""Utility met... | {
"content_hash": "72b35ac989b2618b40a65dfa911b6c63",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 79,
"avg_line_length": 35.1203007518797,
"alnum_prop": 0.6001926782273603,
"repo_name": "openstack/horizon",
"id": "710cbe7c31877cd6a02c25b7b35bb2672fc5e8ce",
"size": "988... |
"""
AMQP management client for Qpid dispatch.
"""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import qpid_dispatch_site
import proton
from proton import Url
from .error import * # import all error symbols f... | {
"content_hash": "5c98f27a439ee300436145daec74d0c8",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 106,
"avg_line_length": 40.29700272479564,
"alnum_prop": 0.6034890797214145,
"repo_name": "irinabov/debian-qpid-dispatch",
"id": "81c03d3e926388d1b1e8b35af202f6a7a6621e8c",
... |
from math import log
from app.dataformats import peptable as peptabledata
from app.dataformats import prottable as prottabledata
from app.dataformats import mzidtsv as mzidtsvdata
from app.actions.psmtopeptable import evaluate_peptide
from app.readers import fasta
def generate_bestpep_proteins(peptides, scorecol, m... | {
"content_hash": "cfebf6b0bc87d39be388f057a808b85c",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 92,
"avg_line_length": 39.32876712328767,
"alnum_prop": 0.6289330082433531,
"repo_name": "glormph/msstitch",
"id": "fb88260b590409bb11fb67b38cbb21b8226adcfe",
"size": "861... |
import sqlalchemy
class Approvable(object):
"""Mixin for items that must be approved before becoming usable."""
@sqlalchemy.ext.declarative.declared_attr
def approver_id(cls):
return sqlalchemy.Column(
'approvedid',
sqlalchemy.ForeignKey('member.memberid'),
null... | {
"content_hash": "002f932b05e2a17575d708906b822b59",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 74,
"avg_line_length": 29.08108108108108,
"alnum_prop": 0.6059479553903345,
"repo_name": "UniversityRadioYork/lass-pyramid",
"id": "d7ec85cf5d9d1e185cf9db52800dbb1f393f07e2",... |
import sys
from django.db import models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from cms.models.managers import PageModeratorStateManager
from cms.models.pagemodel import Page
# NOTE: those are not just numbers!! we will do binary AND on them,
# so pay atte... | {
"content_hash": "585a637cdb59f43f78ae56263e724037",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 100,
"avg_line_length": 34.475806451612904,
"alnum_prop": 0.6355555555555555,
"repo_name": "pbs/django-cms",
"id": "ccb635bbee3a65cf915464823ce2f21b6152b2ee",
"size": "429... |
from __future__ import print_function
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... | {
"content_hash": "63dd747efc44c6a161284df5efbefb00",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 83,
"avg_line_length": 30.742857142857144,
"alnum_prop": 0.631837493361657,
"repo_name": "reanahub/reana-job-controller",
"id": "fdc4009f1cd354ea3ccb0e05896fbdab10cd80f4",
... |
'''More Goodness of fit tests
contains
GOF : 1 sample gof tests based on Stephens 1970, plus AD A^2
bootstrap : vectorized bootstrap p-values for gof test with fitted parameters
Created : 2011-05-21
Author : Josef Perktold
parts based on ks_2samp and kstest from scipy.stats
(license: Scipy BSD, but were completely... | {
"content_hash": "6f58724e8d246a575f387bc4d377dab1",
"timestamp": "",
"source": "github",
"line_count": 704,
"max_line_length": 148,
"avg_line_length": 31.676136363636363,
"alnum_prop": 0.6109865470852018,
"repo_name": "ChadFulton/statsmodels",
"id": "d4c450adaf9e387abc9f8f7087c45254bfcf3d79",
"siz... |
import mimetypes
import uuid
from io import BytesIO
from StringIO import StringIO
from os import path
from urlparse import urlparse, urlunparse
from urllib import urlencode
from twisted.internet.interfaces import IProtocol
from twisted.internet.defer import Deferred
from twisted.python.components import proxyForInte... | {
"content_hash": "ff550ad150fef83cfbd93861580d8549",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 75,
"avg_line_length": 29.735915492957748,
"alnum_prop": 0.5855535820011841,
"repo_name": "alex/treq",
"id": "47e5c65c777bc49d57949c93de1f2ae574c9c289",
"size": "8445",
... |
from initdotpy import auto_import_contents
auto_import_contents()
| {
"content_hash": "51275ffed17be5272ef86ac2de6757e9",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 33,
"alnum_prop": 0.8333333333333334,
"repo_name": "burrowsa/initdotpy",
"id": "049a2750d0796262dce0c68ccf84bde1cce79d7a",
"size": "66",
"binary": f... |
import random
from django.conf import settings
class ReadReplicaRouter(object):
def db_for_read(self, model, **hints):
# Reads go to a randomly-chosen replica.
return random.choice(settings.READ_REPLICAS)
def db_for_write(self, model, **hints):
# Writes always go to default.
re... | {
"content_hash": "63e12752cd17d58dbed847defbc64cdf",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 76,
"avg_line_length": 35.526315789473685,
"alnum_prop": 0.6622222222222223,
"repo_name": "npinchot/djangocon_2015_talk",
"id": "6cb2d4fda19b685df22a96f0e1bb0a41205df82b",
... |
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
worker_sid = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client = Client(account_sid, auth_token... | {
"content_hash": "db03a86e01d7206840a8555ed5fafa23",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 31.428571428571427,
"alnum_prop": 0.7954545454545454,
"repo_name": "teoreteetik/api-snippets",
"id": "7a007218516bfc455e2b6723c77b072de011e0bb",
"siz... |
from unittest import TestCase
from chatterbot.logic import TimeLogicAdapter
from chatterbot.conversation import Statement
class TimeAdapterTests(TestCase):
def setUp(self):
self.adapter = TimeLogicAdapter()
def test_positive_input(self):
statement = Statement("Do you know what time it is?")
... | {
"content_hash": "6715f2f885bb95f7238c830496caa766",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 67,
"avg_line_length": 31.208333333333332,
"alnum_prop": 0.7022696929238985,
"repo_name": "davizucon/ChatterBot",
"id": "58b2d77f58dd7ad5cc4901711386619e4724fee4",
"size": ... |
import six
import os
import re
import time
from datetime import datetime, timedelta
from tenable_io.api.models import Scan, ScanSettings, Template
from tenable_io.api.scans import ScansApi, ScanCreateRequest, ScanExportRequest, ScanImportRequest, ScanLaunchRequest
from tenable_io.exceptions import TenableIOException
... | {
"content_hash": "1827a21405f1431dc2eabea161b72543",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 120,
"avg_line_length": 38.81186440677966,
"alnum_prop": 0.5943490982138958,
"repo_name": "codeparticle/Tenable.io-SDK-for-Python",
"id": "946513bd7cb8bb16203b59a25b927b52bc... |
__author__ = 'Daniel Zhang (張道博)'
__copyright__ = 'Copyright (c) 2014, University of Hawaii Smart Energy Project'
__license__ = 'https://raw.github' \
'.com/Hawaii-Smart-Energy-Project/Maui-Smart-Grid/master/BSD' \
'-LICENSE.txt'
import sys
from msg_configer import MSGConfiger
from msg_db_c... | {
"content_hash": "d72feaa7465b63c83f59ceebe94b66cf",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 80,
"avg_line_length": 31.386473429951693,
"alnum_prop": 0.578112975219332,
"repo_name": "Hawaii-Smart-Energy-Project/Maui-Smart-Grid",
"id": "cd75da5f73432d67e9cf44189417b7... |
"""
The MIT License (MIT)
Copyright (c) 2015 Alexey Nikitin
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, merg... | {
"content_hash": "c2244de513befe0e40611589eab72607",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 119,
"avg_line_length": 31.492537313432837,
"alnum_prop": 0.6287519747235387,
"repo_name": "nikialeksey/VisualAI",
"id": "01b330ba94e8413afa0aeaef74c402fdf34c275a",
"size"... |
import socket
def get_py():
target_host = "153.121.43.113"
target_port = 80
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((target_host,target_port))
client.send("GET / \r/ Host/1.1\r\n\r\n")
response = client.recv(8096)
print (respons... | {
"content_hash": "e3e4a4ec488f9a721d26b21d311a9214",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 66,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.5868263473053892,
"repo_name": "nwiizo/workspace_2017",
"id": "37e2988ba8375fb5eaaead127c373545ac8504bc",
"size":... |
from django.apps import AppConfig
class IhoConfig(AppConfig):
name = 'iho'
| {
"content_hash": "de5e8cbb4981ae74fd4232985cdd300b",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 16.2,
"alnum_prop": 0.7283950617283951,
"repo_name": "iho/42cc",
"id": "28f81d9d54dd918c45a2070bd83ca21c26351c50",
"size": "81",
"binary": false,
... |
"""
mbed SDK
Copyright (c) 2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | {
"content_hash": "ecbabc7f873553d36f1391a54b0e79ea",
"timestamp": "",
"source": "github",
"line_count": 889,
"max_line_length": 159,
"avg_line_length": 43.70528683914511,
"alnum_prop": 0.5583466309775056,
"repo_name": "theotherjimmy/mbed",
"id": "7a1150b40f40c03b790fba314eb76ee50156da1d",
"size": "... |
from unittest import TestCase
import os
import signal
import socket
import sys
from zktraffic.base.sniffer import Sniffer, SnifferConfig
from scapy.sendrecv import sniff
import mock
class TestSniffer(TestCase):
def setUp(self):
self.zkt = Sniffer(SnifferConfig())
@mock.patch('os.kill', spec=os.kill)
@mock... | {
"content_hash": "3468df857e7090272c37fff3358653fb",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 93,
"avg_line_length": 34.103896103896105,
"alnum_prop": 0.6706016755521707,
"repo_name": "rgs1/zktraffic",
"id": "bee8af22426e41ceec59bb22493ff5c315a39c3b",
"size": "3527"... |
"""
NodeMap application.
"""
import argparse
import functools
import itertools
import json
import random
import os
import sys
from collections import defaultdict
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt, QCoreApplication, pyqtSignal, QObject, QPoint
from PyQt5.QtGui import QIcon, QFont... | {
"content_hash": "00ec5c50f68fc48dd316aac93f3b9246",
"timestamp": "",
"source": "github",
"line_count": 870,
"max_line_length": 89,
"avg_line_length": 31.27471264367816,
"alnum_prop": 0.5579771399169392,
"repo_name": "amt386/nodemap",
"id": "b4c4abd5230f5ef199681395f311991c1c73d5cf",
"size": "27228... |
from ._base import SQLBaseStore
from synapse.util.caches.descriptors import cachedInlineCallbacks
from twisted.internet import defer
import logging
import simplejson as json
logger = logging.getLogger(__name__)
class PushRuleStore(SQLBaseStore):
@cachedInlineCallbacks()
def get_push_rules_for_user(self, use... | {
"content_hash": "317d912ccc4cec35e945effe8601e62e",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 85,
"avg_line_length": 31.03041825095057,
"alnum_prop": 0.54331577012621,
"repo_name": "iot-factory/synapse",
"id": "5305b7e1227a2ff8e5a16e1033ee7a16af8f3166",
"size": "87... |
from django.contrib.auth.models import User
from django.db import models
class FacebookUser(models.Model):
facebook_id = models.CharField(max_length=100, unique=True)
contrib_user = models.OneToOneField(User)
contrib_password = models.CharField(max_length=100)
| {
"content_hash": "8e856dbad27489ad7545be44ebfabb63",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 67,
"avg_line_length": 36.375,
"alnum_prop": 0.7285223367697594,
"repo_name": "teebes/django-facebookconnect",
"id": "1f5a549d5764cc50c7e686c8fdb601ca6c4f52cd",
"size": "291... |
from __future__ import print_function
from keras.datasets import mnist
from keras.layers import Input, Dense, Reshape, Flatten, merge
from keras.layers import BatchNormalization, Activation, ZeroPadding2D, Lambda, concatenate
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional impor... | {
"content_hash": "f6fb1ed4865ed934c805ad6f72779ae6",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 115,
"avg_line_length": 33.602787456445995,
"alnum_prop": 0.5461426793861468,
"repo_name": "sofiane87/lasagne-GAN",
"id": "6f7a6cdae9b2a2d44e44de98f07a3323ee11ee73",
"size... |
"""Query an exported model. Py2 only. Install tensorflow-serving-api."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from oauth2client.client import GoogleCredentials
from six.moves import input # pylint: disable=redefined-builtin
from tenso... | {
"content_hash": "be27f7dbcfe16fc39b7ed519f450e52b",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 83,
"avg_line_length": 32.59340659340659,
"alnum_prop": 0.7147673634524613,
"repo_name": "vthorsteinsson/tensor2tensor",
"id": "7d89d3c7e87390afca17bf2a0c53c75fdb6b6d61",
"... |
import distribute_setup
import svm_specializer
distribute_setup.use_setuptools()
from setuptools import setup
import glob
setup(name="svm_specializer",
version=svm_specializer.__version__,
description="This is a SEJITS (selective embedded just-in-time specializer) for Support Vector Machines, built on the... | {
"content_hash": "81c1dd7e302c107cd2ec56b7f7dd945f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 140,
"avg_line_length": 34.55263157894737,
"alnum_prop": 0.6344249809596344,
"repo_name": "egonina/svm",
"id": "6f78b941fa9e4af9afa0240d9c255c2a296a0cad",
"size": "1413",
... |
from setuptools import setup, find_packages
with open("README.rst") as f:
readme = f.read()
setup(
name="flmakesetup",
version="0.0.8",
author="takahrio iwatani",
author_email="taka.05022002@gmail.com",
description="easy create setup.py",
long_description=readme,
url="https://github.c... | {
"content_hash": "e75a395900b7e6dc0071da059aafea89",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 51,
"avg_line_length": 26.06896551724138,
"alnum_prop": 0.6097883597883598,
"repo_name": "float1251/flmakesetup",
"id": "2ad278f52da07ef1afef2b1af75575d4a3d9e4c6",
"size": ... |
import json
import pytz
from unittest import skipIf
from datetime import date, datetime
from django.test import TestCase
from myuw.dao.calendar import get_events
TRUMBA_PREFIX = 'http://www.trumba.com/calendar/5_current'
class TestCalendar(TestCase):
def setUp(self):
self.now = datetime(2013, 4, 15, 0, ... | {
"content_hash": "b3e644d9a955ba0abae50d19d51688be",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 77,
"avg_line_length": 40.06741573033708,
"alnum_prop": 0.606842400448682,
"repo_name": "uw-it-aca/myuw",
"id": "2d51987221d368bafc9a9ce2ef1d314bb1e9bd21",
"size": "3654",
... |
""" Cisco_IOS_XR_infra_rmf_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR infra\-rmf package operational data.
This module contains definitions
for the following management objects\:
redundancy\: Redundancy show information
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All rights r... | {
"content_hash": "f0659cb2fabd05e724bbce22e79fcf1f",
"timestamp": "",
"source": "github",
"line_count": 586,
"max_line_length": 196,
"avg_line_length": 30.457337883959045,
"alnum_prop": 0.4498543254146123,
"repo_name": "abhikeshav/ydk-py",
"id": "8602e1f4d1c8aad7924312dffbc67445927ac5d8",
"size": "... |
import os
import demistomock as demisto
RETURN_ERROR_TARGET = 'DocumentationAutomation.return_error'
def test_get_yaml_obj(mocker):
from DocumentationAutomation import get_yaml_obj
return_error_mock = mocker.patch(RETURN_ERROR_TARGET)
# sanity
file_path = os.path.join('test_data', 'ANYRUN_yml.txt')... | {
"content_hash": "9b122386076751573f3d4902224417ad",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 117,
"avg_line_length": 35.097744360902254,
"alnum_prop": 0.5974721508140531,
"repo_name": "VirusTotal/content",
"id": "3cd0b1b6151010d85a8b0157c32e9b0a650d26b7",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("advicer", "0011_auto_20150725_1213")]
operations = [
migrations.AlterField(
model_name="advice",
name="issues",
field=models.ManyToManyField(
to="advi... | {
"content_hash": "e8c6c4cf7215b4304e60b1f4714f517f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 69,
"avg_line_length": 25.41176470588235,
"alnum_prop": 0.5694444444444444,
"repo_name": "rwakulszowa/poradnia",
"id": "cf590ba31c44ff61e40dfba99edd2d1b435e34ae",
"size": "... |
"""BenchlingAPI."""
from .__version__ import __authors__
from .__version__ import __homepage__
from .__version__ import __repo__
from .__version__ import __title__
from .__version__ import __version__
from benchlingapi.models import schema # must import schema before session
from benchlingapi.session import Session
| {
"content_hash": "4a4424a653aba9e82c6494332478756c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 75,
"avg_line_length": 39.75,
"alnum_prop": 0.7138364779874213,
"repo_name": "klavinslab/benchling-api",
"id": "0fef73b020a0dcc1e72b0a9fbd3111f88fd36f7e",
"size": "318",
"... |
import os
import setuptools
import textwrap
from ceilometer.openstack.common import setup as common_setup
requires = common_setup.parse_requirements(['tools/pip-requires'])
depend_links = common_setup.parse_dependency_links(['tools/pip-requires'])
project = 'ceilometer'
version = common_setup.get_version(project, '20... | {
"content_hash": "2175e5b92a8334f5960f553035cf2f43",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 76,
"avg_line_length": 36.56923076923077,
"alnum_prop": 0.6989903239377366,
"repo_name": "shootstar/ctest",
"id": "dad7f219f3da04c6923e0afc3b25cc5a542da637",
"size": "5453... |
import mysql.connector
import time
from insert_channel_table import get_channel_url_id_dict, get_channel_id_from_url
class YoutubeVideoCrawlerPipeline(object):
def __init__(self):
self.conn = mysql.connector.connect(user='taloscar', password='taloscar', database='taloscar', host='10.161.23.57')
... | {
"content_hash": "0365b055a076af248dbd137a3074f052",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 123,
"avg_line_length": 35.8,
"alnum_prop": 0.5543140906269398,
"repo_name": "eric-huo/youtube_video_crawler",
"id": "162d099da0e377bd4ae1fb0310b44ad957d9cf04",
"size": "16... |
from celery import task
from celery.exceptions import SoftTimeLimitExceeded
from celery.utils.log import get_task_logger
from go_http import HttpApiSender
from go_http.send import HttpApiSender as sendHttpApiSender
import csv
from .models import Message, Subscription
from django.conf import settings
from django.db impo... | {
"content_hash": "a7829990896a679de334e63423181a07",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 103,
"avg_line_length": 40.822857142857146,
"alnum_prop": 0.5816069428891377,
"repo_name": "westerncapelabs/django-messaging-subscription",
"id": "9e599446c6c00b783655f1450c... |
"""
Utility functions and classes for classifiers.
"""
from __future__ import print_function, division
import math
#from nltk.util import Deprecated
import nltk.classify.util # for accuracy & log_likelihood
from nltk.util import LazyMap
######################################################################
#{ Helper... | {
"content_hash": "b2750f68a3c025a9ae1449ad1f02d28b",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 86,
"avg_line_length": 37.76315789473684,
"alnum_prop": 0.6040940766550522,
"repo_name": "sfrenza/test-for-bot",
"id": "47419483ec6da8a1ef5a5304775535290ef1151e",
"size": ... |
"""
The photo module contains the :class:`Photo` class, which is used to track
image objects (JPG, DNG, etc.).
.. moduleauthor:: Jaisen Mathai <jaisen@jmathai.com>
"""
import imghdr
import os
import pyexiv2
import re
import subprocess
import time
from elodie import constants
from media import Media
from elodie impor... | {
"content_hash": "5007b38ad3cf15dfbf6614337fcf6930",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 143,
"avg_line_length": 31.655172413793103,
"alnum_prop": 0.5796763149704326,
"repo_name": "zserg/elodie",
"id": "bd6ddb29ee6dd315a60a3f619926a2aa67449b1d",
"size": "6426"... |
from weakref import WeakValueDictionary
import wx
import wx.lib.newevent
from atom.api import Int, Typed
from enaml.widgets.action import ProxyAction
from .wx_toolkit_object import WxToolkitObject
#: An event emitted when a wxAction has been triggered by the user. The
#: payload of the event will have an 'IsCheck... | {
"content_hash": "05acf17de699e0cf8fa1981a0fe4b567",
"timestamp": "",
"source": "github",
"line_count": 523,
"max_line_length": 79,
"avg_line_length": 26.803059273422562,
"alnum_prop": 0.5226137822799258,
"repo_name": "ContinuumIO/ashiba",
"id": "6e206d7b5f203a1827464060a3421e92c736e59b",
"size": "... |
""" Friendly Dates and Times """
__version__ = '0.4.0'
# Disable pylint's invalid name warning. 'tz' is used in a few places
# and it should be the only thing causing pylint to include the warning.
# pylint: disable-msg=C0103
import calendar
import datetime
import locale
import os
import random
import pytz
# Some ... | {
"content_hash": "8e5d31ca80697cc590b56176fcd8cd91",
"timestamp": "",
"source": "github",
"line_count": 771,
"max_line_length": 80,
"avg_line_length": 32.86381322957198,
"alnum_prop": 0.6217144210277055,
"repo_name": "dirn/When.py",
"id": "1acf979a29c395a7751ca51847808ee490a4b050",
"size": "25363",... |
from distutils.core import setup
version = '1.0.2'
setup(name='pyactiveresource',
version=version,
description='ActiveResource for Python',
author='Jared Kuolt',
author_email='me@superjared.com',
url='http://code.google.com/p/pyactiveresource/',
packages=['pyactiveresource'],
... | {
"content_hash": "6d524956e9148d9bfa5c006f40a13d2f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 82,
"avg_line_length": 38.541666666666664,
"alnum_prop": 0.5697297297297297,
"repo_name": "PiratenBayernIT/pyactiveresource",
"id": "33b92a6de5c048182686284a1768df3b7f08e684"... |
import gettext
import pycountry
from flask import request
from flask_login import login_required
from . import bp
from ..decorators import jsonify
@bp.route('/currencies/')
@login_required
@jsonify()
def get_currencies():
def prepare_currency(currency):
return {
'symbol': currency.letter,
... | {
"content_hash": "c4b82a4edbbc3e69372537d8c0a95f02",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 90,
"avg_line_length": 24.866666666666667,
"alnum_prop": 0.6568364611260054,
"repo_name": "monetario/core",
"id": "8371c15512dd6fe9af3b90a759c60bacb3d835c9",
"size": "747",... |
"""
Module to set up run time parameters for Clawpack -- classic code.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#------------------------------
def setrun(claw_pkg='classic'):
#--------------------------... | {
"content_hash": "73ff167a0ab33a7c8e752f412f811219",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 92,
"avg_line_length": 31.986607142857142,
"alnum_prop": 0.5589672016748081,
"repo_name": "amath574w2015/am574-class",
"id": "07cccc8cc7aea878f2487c02e8d755dd9bae83e2",
"s... |
"""
BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21).
Adapted from wsgiref.simple_server: http://svn.eby-sarna.com/wsgiref/
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. Don't use it for production use.
"""
from BaseHTTPSe... | {
"content_hash": "cdb7c2aaaa730307379e3e03cfbf5a33",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 94,
"avg_line_length": 36.73520249221184,
"alnum_prop": 0.6002798507462687,
"repo_name": "jonaustin/advisoryscan",
"id": "80a0bf6a91c66ef16d17f90b5bd1ad5081dcdf44",
"size"... |
import versioneer
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Read long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="tohu",
... | {
"content_hash": "1db3f8ccbd28549ffd627692b673f9a3",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 123,
"avg_line_length": 37,
"alnum_prop": 0.6448948948948949,
"repo_name": "maxalbert/tohu",
"id": "ac9974ddeeb82d17d5e9f85e567b8f163a7ba675",
"size": "1332",
"binary": f... |
import importlib
import json
import numpy as np
import os
import sys
import time
import uuid
import copy
from hypergan.discriminators import *
from hypergan.distributions import *
from hypergan.generators import *
from hypergan.inputs import *
from hypergan.samplers import *
from hypergan.trainers import *
import hyp... | {
"content_hash": "2c220c6b6500f6bc1384bb7919980b1d",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 138,
"avg_line_length": 35.66795366795367,
"alnum_prop": 0.5830266291405066,
"repo_name": "255BITS/HyperGAN",
"id": "2d771d478ecdbfbaa1d335861d6ae0418eff7727",
"size": "92... |
from __future__ import unicode_literals
import os
import sys
import re
import contextlib
import subprocess
import signal
import math
from time import time
from . import basecase
from os.path import join, normpath
def is_win():
return sys.platform in ("cygwin", "win32")
if is_win():
from .winpty import WinPt... | {
"content_hash": "812a7c7aff678ee4ee047416072bb17e",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 109,
"avg_line_length": 33.389380530973455,
"alnum_prop": 0.5614453573637247,
"repo_name": "szhou1234/cassandra",
"id": "cd14b7fd5718915af38f2653eb72629e07f94294",
"size":... |
import json
import os
import textwrap
import unittest
from six import StringIO
from conans import __version__
from conans.client.cache.editable import EDITABLE_PACKAGES_FILE
from conans.client.migrations import migrate_plugins_to_hooks, migrate_to_default_profile, \
migrate_editables_use_conanfile_name, remove_bu... | {
"content_hash": "690cfe5383777937bbca19b6f24a6573",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 99,
"avg_line_length": 43.01090909090909,
"alnum_prop": 0.6440649306729793,
"repo_name": "conan-io/conan",
"id": "7f01599df6aefa9c03808c5be8c5ed69b25a4f8f",
"size": "11828... |
import os
import re
import time
import uuid
from datetime import timedelta
from inspect import signature
import click
from fate_test._client import Clients
from fate_test._config import Config
from fate_test._io import LOGGER, echo
from fate_test._parser import BenchmarkSuite
from fate_test.scripts._options import Sha... | {
"content_hash": "0addf434ad7b5fb14cf1f44ba211c1e1",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 120,
"avg_line_length": 50.691275167785236,
"alnum_prop": 0.5947305706341851,
"repo_name": "FederatedAI/FATE",
"id": "f814cc5876c6d37709209e720d0ad066ebe46b37",
"size": "7... |
import sys
if len(sys.argv)==1:
print "Usage: main.py cfg_file [cfg_site]"
print "Example:"
print " main.py cfg_gnu"
print " main.py cfg_gnu custom_cfg_site"
sys.exit(1)
args = []
args.extend(sys.argv)
args.remove(args[1])
args.remove(args[0])
cfg_file = __import__(sys.argv[1])
builders = cfg_... | {
"content_hash": "35ed17ea1e07f938e4d4ce86d2515858",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 46,
"avg_line_length": 19.7,
"alnum_prop": 0.6522842639593909,
"repo_name": "yuezhou/telephony2",
"id": "8a99371455696255e816d28378f4ca63806ceb4d",
"size": "1229",
"binar... |
from __future__ import absolute_import
from __future__ import absolute_import
import six
from ..exceptions import ValidationError
class BaseProperty(object):
"""
The base class for properties in Datastore. Instances of this class may be added to subclasses of `Entity` to store
data.
A property has ... | {
"content_hash": "fa4dcc6c71c55c664bfa84a7acaa0dda",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 120,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.6446570972886763,
"repo_name": "Kapiche/gcloud-datastore-oem",
"id": "1ec6f62205736dca95595ff1e55a83d31a3c6216",
... |
from SakaiPy import SakaiSession
class WebContent(object):
"""
Contains logic for the Sakai WebContent tool.
More information about the RESTful interface can be found at:
https://trunk-mysql.nightly.sakaiproject.org/webcontent/news/describe
"""
def __init__(self, sess):
"""
C... | {
"content_hash": "26b81519154fba6b63b53bb412c4d00a",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 95,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.656599552572707,
"repo_name": "willkara/SakaiPy",
"id": "aea0c192ad2d2f0ea412ba8f4d673516f3f0b9a0",
"size": "936"... |
"""
An interactive, stateful AJAX shell that runs Python code on the server.
"""
from __future__ import print_function
from gluon._compat import ClassType, pickle, StringIO
import logging
import new
import sys
import traceback
import types
import threading
locker = threading.RLock()
# Set to True if stack traces shoul... | {
"content_hash": "709e4312a7e0120674a2dce9897b8894",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 86,
"avg_line_length": 34.611570247933884,
"alnum_prop": 0.6224928366762178,
"repo_name": "xiang12835/python_web",
"id": "638d3c81864cb26451671434bc41069dbb9445c4",
"size"... |
from django.db.models.signals import pre_save
from django.db import models
from django.utils.translation import ugettext_lazy as _
from social_graph.signals import object_visited
from content_interactions.signals import (
item_liked,
item_disliked,
item_rated,
item_rate_modified,
item_marked_as_favo... | {
"content_hash": "5356f9afda13e2a93c20edefda57073e",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 117,
"avg_line_length": 31.899280575539567,
"alnum_prop": 0.6409562471808751,
"repo_name": "suselrd/django-content-interactions",
"id": "80315cdf6bab47e47558d24d8194777aac0b... |
from __future__ import print_function
import sys
import numba.unittest_support as unittest
from numba import jit, testing
class TestClosure(unittest.TestCase):
def run_jit_closure_variable(self, **jitargs):
Y = 10
def add_Y(x):
return x + Y
c_add_Y = jit('i4(i4)', **jitargs... | {
"content_hash": "9298777b065f90689abacf6b177e5d0e",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 82,
"avg_line_length": 27.814814814814813,
"alnum_prop": 0.5855525965379494,
"repo_name": "GaZ3ll3/numba",
"id": "6439b6ee83064118c28dc18e52e4eabd12dbef81",
"size": "3004"... |
"""
Support for Rain Bird Irrigation system LNK WiFi Module.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.rainbird/
"""
import logging
import voluptuous as vol
from homeassistant.components.rainbird import DATA_RAINBIRD
import homeassistant.h... | {
"content_hash": "72d215f2f05d3667cac1d3dcf9cadadc",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 75,
"avg_line_length": 29.7625,
"alnum_prop": 0.6707265854682907,
"repo_name": "ewandor/home-assistant",
"id": "875e9c37bd3206974ab61801c8a621aa0c2e2c3a",
"size": "2381",
... |
from __future__ import unicode_literals
import uuid
from django.conf import settings
from django.core.paginator import Paginator
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from wagtail_embed_videos.edit_handlers import EmbedVideoChooserPanel
from wagtail.wagtailadmin.ed... | {
"content_hash": "af9279feabb5e280d8cab9e683ee3e32",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 89,
"avg_line_length": 27.479674796747968,
"alnum_prop": 0.7304733727810651,
"repo_name": "PaulWGraham/ExampleSite",
"id": "7d4d64f5634bc0b17d4b3cdb97bf8239f971fddb",
"siz... |
def main(request, response):
if request.method == "OPTIONS":
response.headers.set(b"Access-Control-Allow-Origin", b"*")
response.headers.set(b"Access-Control-Allow-Headers", b"*")
response.status = 200
elif request.method == "GET":
response.headers.set(b"Access-Control-Allow-Orig... | {
"content_hash": "c0d648879025d1e5985d6caa5adfcbc1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 67,
"avg_line_length": 43.833333333333336,
"alnum_prop": 0.6083650190114068,
"repo_name": "scheib/chromium",
"id": "87d36160dffaa6401c95b5bfcac38506f2273ef5",
"size": "526"... |
from uuid import uuid4
from preggy import expect
from tornado import gen
from level.config import Config
from level.extensions.pubsub.redis import PubSub
from tests.unit.base import TestCase, async_case
class RedisPubSubTestCase(TestCase):
def setUp(self):
self.config = Config(
REDIS_HOST='... | {
"content_hash": "9945e8f427434215bee30ab4cc1b3af1",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 56,
"avg_line_length": 26.245283018867923,
"alnum_prop": 0.5880661394680087,
"repo_name": "heynemann/level",
"id": "daeeb0997960facebe37486bb227ff22d06242b5",
"size": "304... |
from __future__ import absolute_import
import re
import copy
import xml.etree.ElementTree as ET
from svtplay_dl.service import Service, OpenGraphThumbMixin
from svtplay_dl.utils import get_http_data, is_py2_old
from svtplay_dl.log import log
from svtplay_dl.fetcher.rtmp import RTMP
class Qbrick(Service, OpenGraphThum... | {
"content_hash": "0465c01063d445af77bc0f932a7650d7",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 118,
"avg_line_length": 36.54237288135593,
"alnum_prop": 0.5584415584415584,
"repo_name": "OakNinja/svtplay-dl",
"id": "f61e39a358aea2e00106da61074cb181c65855bb",
"size": "... |
"""
WSGI config for testing project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
import envvars
envvars_file = os.path.join('env')
if os.path.exists(envvars_file):
... | {
"content_hash": "77b2401db4b9f54284009bf816b65909",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 24.22222222222222,
"alnum_prop": 0.7591743119266054,
"repo_name": "mattseymour/django-skeleton",
"id": "7d214410fed86eb278318916482abb88c17165d0",
"s... |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.economics import CurrencyType
log = logging.getLogger(__name__)
class TestCurrencyType(unittest.TestCase):
def setUp(self):
self.fd, self.path = tempfile.mkstemp()
... | {
"content_hash": "95c5fe90166ebb421ac3a302ca520df7",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 80,
"avg_line_length": 23.789473684210527,
"alnum_prop": 0.6438053097345132,
"repo_name": "rbuffat/pyidf",
"id": "139cfa28ac0b9a76d5c8cb96e0abcd7947a1b28f",
"size": "904",
... |
"""Implements admin interface for page tags content"""
from django.contrib import admin
from pages.conf import settings
if settings.PAGES_PAGE_USE_EXT_CONTENT_TYPES:
from pagesext.models.pagetagscontent import PageTagsContent
class PageTagsContentAdmin(admin.ModelAdmin):
list_display = ('__str__', '... | {
"content_hash": "19f5ce98a4e35df6ebe394a37e0ddb83",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 101,
"avg_line_length": 31.564102564102566,
"alnum_prop": 0.5207148659626321,
"repo_name": "dlancer/django-pages-cms-extensions",
"id": "b0a0a937c45e12679955cac928b061cef6770... |
""" Creating multimodel predictions
"""
from .world import world, setup_module, teardown_module
from . import create_source_steps as source_create
from . import create_dataset_steps as dataset_create
from . import create_model_steps as model_create
from . import create_ensemble_steps as ensemble_create
from . import c... | {
"content_hash": "2c30615a23398c353bb7ee807569c673",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 194,
"avg_line_length": 55.825688073394495,
"alnum_prop": 0.5704190632703369,
"repo_name": "mmerce/python",
"id": "d8e404c332e7290161c2f6d12b14c814978fff5a",
"size": "6687... |
from tests import SpecTestSuite
from marko import Markdown
from marko.ext.gfm import gfm
class TestCommonMark(SpecTestSuite):
@classmethod
def setup_class(cls):
cls.markdown = Markdown()
def test_greedy_consume_prefix(self):
md = "> 1. Item 1\n> ```code\n> indented code\n> ```... | {
"content_hash": "d14095d5fb4392bcc3fa5248a857919c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 111,
"avg_line_length": 27.133333333333333,
"alnum_prop": 0.5733005733005733,
"repo_name": "frostming/marko",
"id": "6a67e28415fcca25cf25ce0a007adfd0c02e53f7",
"size": "122... |
"""Configure the tests for :mod:`astropy.cosmology`."""
from astropy.cosmology.tests.helper import clean_registry # noqa: F401, F403
from astropy.tests.helper import pickle_protocol # noqa: F401, F403
| {
"content_hash": "566d7866b6a69a5157b4fc687ccb047b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 77,
"avg_line_length": 51,
"alnum_prop": 0.7598039215686274,
"repo_name": "StuartLittlefair/astropy",
"id": "aefa9a5da9ca6ce95d4646fea020b19298e65527",
"size": "269",
"bin... |
from django.contrib.auth.models import AnonymousUser
from django.http import HttpRequest
import mock
from nose.tools import assert_false
import mkt
import mkt.site.tests
from mkt.site.fixtures import fixture
from mkt.webapps.models import Webapp
from mkt.users.models import UserProfile
from .acl import (action_allow... | {
"content_hash": "15e94d5564204aec629198d54442a49e",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 78,
"avg_line_length": 35.78947368421053,
"alnum_prop": 0.6364705882352941,
"repo_name": "shahbaz17/zamboni",
"id": "3d8266011a05437596ef38d168d9b8cff966feef",
"size": "68... |
class Solution:
def levelOrderBottom(self, root: TreeNode) -> List[List[int]]:
levels = []
if not root:
return levels
def helper(node, level):
# Starting a new level
if len(levels) == level:
levels.append([])
# Append t... | {
"content_hash": "9331cb116f1e26770f1e8f407bfd4d4d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 68,
"avg_line_length": 30.37837837837838,
"alnum_prop": 0.44928825622775803,
"repo_name": "saisankargochhayat/algo_quest",
"id": "d7ce77084f6bf5dff6f80b260ca5d4b2e417e6a1",
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# Examples:
# url(r'^$', 'tweetnotes.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url('', include('social.apps.django_app.urls', namespace='so... | {
"content_hash": "cdfaa851caef8e76af820254ad9994ed",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 31.352941176470587,
"alnum_prop": 0.626641651031895,
"repo_name": "3quarterstack/tweetnotes",
"id": "db71caa7f05759938c4494f0bece28bb98ba3d28",
"size... |
from .resource import Resource
class LocalNetworkGateway(Resource):
"""A common class for general resource information.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: ... | {
"content_hash": "6eb8f79385ec88c8c01d5efd80c8c983",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 167,
"avg_line_length": 42.53030303030303,
"alnum_prop": 0.6441040256501603,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "235072053cb5dc2992b422e96dcd672ae2a0669f",... |
from django.utils.html import escape
from djblets.markdown import markdown_escape, markdown_unescape
from djblets.webapi.resources.mixins.forms import (
UpdateFormMixin as DjbletsUpdateFormMixin)
from reviewboard.reviews.markdown_utils import (markdown_set_field_escaped,
... | {
"content_hash": "cb6c7873c7d0a0bb2de8fd1a8a1de163",
"timestamp": "",
"source": "github",
"line_count": 531,
"max_line_length": 79,
"avg_line_length": 39.772128060263654,
"alnum_prop": 0.5828874473223163,
"repo_name": "reviewboard/reviewboard",
"id": "dcbbf7ac04af3fb0f0250c2469c80e0292dffbd7",
"siz... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("wagtailcore", "0032_add_bulk_delete_page_permission"),
]
operations = [
migrations.AlterField(
model_name="page",
name="expire_at",
field=models.DateTime... | {
"content_hash": "e1074c919567f477d81fcef9b994503f",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 71,
"avg_line_length": 26.44,
"alnum_prop": 0.5340393343419062,
"repo_name": "wagtail/wagtail",
"id": "fb5fd1913e230ba3b6e4fd91d853e8251c55a873",
"size": "734",
"binary":... |
import getopt
import os
import re
import sys
import subprocess
def usage():
print >> sys.stderr, """
Usage:
python test_harness.py [ -c config_file ] [ -t gtestfile ] [ -p path_to_gtestfile ]
where:
config_file: test_harness config file; default: test_harness.conf
gtestfile: name of gtest... | {
"content_hash": "4198fa43d66dbb1154dfcdf97201103e",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 102,
"avg_line_length": 33.29050279329609,
"alnum_prop": 0.4576271186440678,
"repo_name": "ADVANTECH-Corp/node-alljoyn",
"id": "bb3fec9afd75903c97e44a2246894671e8f2b9c2",
... |
"""CLI for Server Density.
"""
import os
import json
import math
import datetime
import requests
import urlparse
URL_SD = 'https://api.serverdensity.io'
PATH_TOKEN = '~/.sd_token'
def parse_response(response):
try:
data = json.loads(response.text)
except ValueError:
data = {}
if respon... | {
"content_hash": "b239ad3adfd301d6c91cf1d3eeef8b6e",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 79,
"avg_line_length": 23.3943661971831,
"alnum_prop": 0.5127934978928357,
"repo_name": "bahadir/sd-cli",
"id": "420c6417d3c935b02d5bf510130d6f8fde482d15",
"size": "6680",... |
"""
WSGI config for protwis project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "protwis.settings")
from django.core.w... | {
"content_hash": "0035ecb289df96e781f3deb0f9f79640",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.785714285714285,
"alnum_prop": 0.7737789203084833,
"repo_name": "protwis/protwis",
"id": "6278f5eb3a5ff92161944ae33724b8690de2b4c3",
"size": "389"... |
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
''' IMPORTS '''
import base64
import json
import traceback
''' CLIENT CLASS '''
class Client(BaseClient):
def __init__(self, base_url, *args, **kwarg):
super().__init__(base_url, *args, **kwarg)
def get_des... | {
"content_hash": "611aa7aef3af68bb3a5e908b0393dc73",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 152,
"avg_line_length": 37.51383399209486,
"alnum_prop": 0.6584132335897166,
"repo_name": "VirusTotal/content",
"id": "1cd32965aacb101023559460d813a8feb402a73a",
"size": "... |
"""This module contains special query helper class for query API."""
from ggrc.builder import json
from ggrc.converters.query_helper import QueryHelper
from ggrc.utils import benchmark
# pylint: disable=too-few-public-methods
class QueryAPIQueryHelper(QueryHelper):
"""Helper class for handling request queries for... | {
"content_hash": "f5792a79918714730e7ae13bfb13ba74",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 78,
"avg_line_length": 38.96470588235294,
"alnum_prop": 0.6271135265700483,
"repo_name": "selahssea/ggrc-core",
"id": "5a55688e68ecf07871b72690274fe760efd70c63",
"size": "3... |
__author__ = 'rhoerbe'
import json, sys
jdata = json.load(sys.stdin)
for k in jdata:
print k["id"]
| {
"content_hash": "f45c9d4e9624451a66d0469a16df31a8",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 28,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.6346153846153846,
"repo_name": "rohe/saml2test",
"id": "a7e59c16d43f4708203c419dbbf7c6a79833ab36",
"size": "273",
... |
"""A setuptools based setup module."""
from os.path import join
from pathlib import Path
from setuptools import setup, find_namespace_packages
with open(Path(__file__).parent / "README.md", encoding="utf-8") as f:
long_description = f.read()
setup(
name="gem5art-run",
version="1.4.0",
description="A... | {
"content_hash": "4685b04d93f0549d46380a512be2706b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 70,
"avg_line_length": 31.8,
"alnum_prop": 0.639937106918239,
"repo_name": "gem5/gem5",
"id": "98ff18038631d261e0bd1207fca38777b45b0dc9",
"size": "2828",
"binary": false,... |
from selenium.common.exceptions import StaleElementReferenceException, NoSuchElementException, InvalidSelectorException, WebDriverException
from . import exceptions
from .identifier import Identifier
from .locator import locator_to_by_value
from .waiter import Waiter
class Context:
def __init__(self):
se... | {
"content_hash": "9c26877bfdbe7c72e5952d2733772ea1",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 143,
"avg_line_length": 42.34172661870504,
"alnum_prop": 0.5889898904086314,
"repo_name": "KarlGong/easyium-python",
"id": "6473f41dfa7f4461f5a610965974c539fe1ab1b1",
"siz... |
from django import VERSION as django_version
from django.contrib import admin
from django.contrib import messages
from django.template.defaultfilters import (
linebreaksbr, removetags
)
from django.contrib.humanize.templatetags.humanize import naturalday
from django.contrib.contenttypes.models import ContentType
fr... | {
"content_hash": "60e466ac683bce447f0028c0755ebf6d",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 99,
"avg_line_length": 40.77064220183486,
"alnum_prop": 0.594059405940594,
"repo_name": "lvm/django-jot",
"id": "922cedaaba6e60a6bceeaef1c54cf3ef0ff88d5b",
"size": "4444",... |
import academictorrents as at
import sys
import argparse
parser = argparse.ArgumentParser(description='AT Simple command line tool')
parser.add_argument('-hash', type=str, nargs='?', required=True, help='Hash of torrent to download')
parser.add_argument('-datastore', type=str, nargs='?', default=".", help='Location wh... | {
"content_hash": "aa70bbded38e3f0eea5900cfa4503251",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 109,
"avg_line_length": 36.916666666666664,
"alnum_prop": 0.7471783295711061,
"repo_name": "AcademicTorrents/python-r-api",
"id": "13304f8de07817a0284d6df02b6d5698d8934df1",
... |
class AWSBasic():
REGION = 'ap-southeast-2'
ZONE = 'ap-southeast-2a'
RESERVED_ZONE = 'ap-southeast-2b'
conn = False
def __init__(self, aws_access_key_id, aws_secret_access_key, region=False):
if region:
self.REGION = region
self.connect(aws_access_key_id, aws_secret_... | {
"content_hash": "368cd4c52709b86fde8d56b98f13d852",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 79,
"avg_line_length": 25.41176470588235,
"alnum_prop": 0.625,
"repo_name": "idooo/pancake-campfire-bot",
"id": "8baf555e471ab441842ba5c272298d3aa29ac154",
"size": "457",
... |
"""Template script to analyze the coverage of a sample or multiple samples from the .gff file"""
# define search paths manually
import sys
# dependency dirs
sys.path.append('C:/Users/dmccloskey-sbrg/Documents/GitHub/sequencing_analysis')
sys.path.append('C:/Users/dmccloskey-sbrg/Documents/GitHub/io_utilities')
sys.pat... | {
"content_hash": "244e09bd0b69f7b1cdd1efbd0b06e180",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 195,
"avg_line_length": 64.88888888888889,
"alnum_prop": 0.7541095890410959,
"repo_name": "dmccloskey/sequencing_analysis",
"id": "5ea6e27f98e9445436f705df9037cdefbfed93e0",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "3d503206603ca585db9ba42951e695a4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 34,
"alnum_prop": 0.6066176470588235,
"repo_name": "diefenbach/django-lfs",
"id": "ea28828a71a09eb907d9509ac0beee4d0baf6cc0",
"size": "840",
"bina... |
from datetime import datetime, timedelta
from crispy_forms.layout import Submit
from lmgtfy.models import Domain, DomainSearch, TLD
from lmgtfy.tasks import search_bing_task
class CleanSubmitButton(Submit):
field_classes = 'btn btn-default'
def search_bing(domain):
domain_db_record, _created = Domain.object... | {
"content_hash": "5727fbee3260be959ed6f78fb9118476",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 91,
"avg_line_length": 33.54838709677419,
"alnum_prop": 0.7038461538461539,
"repo_name": "todrobbins/lmgtdfy",
"id": "1c33a6f0962c8eedbd246029b47627afbe7bdab3",
"size": "10... |
import sys
from pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam'
subscribe_key = len(sys.argv) > 2 and sys.argv[2] or 'pam'
secret_key = len(sys.argv) > 3 and sys.argv[3] or 'pam'
cipher_key = len(sys.argv) > 4 and sys.argv[4] or ''
ssl_on = len(sys.argv) > 5 and bool(sys.argv[5]) or False... | {
"content_hash": "8330f9337b984daf5c219a074016b8f8",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 126,
"avg_line_length": 58.093023255813954,
"alnum_prop": 0.7185748598879104,
"repo_name": "teddywing/pubnub-python",
"id": "f63e6d2458e50129bae064f55309c10b147f3cc1",
"siz... |
import socket
from threading import Thread
import os
import copy
import time
import subprocess
import json, zmq
import library.utils.utils as UT
import library.constants as CO
class ClABCHandler(object):
def __init__(self, connection):
self.connectionManager = connection
Thread(target=self.__receive).start()
... | {
"content_hash": "6a1db86f3d10b335adce837458308870",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 116,
"avg_line_length": 27.56279069767442,
"alnum_prop": 0.6211609854876814,
"repo_name": "crest-centre/ABC4GSD",
"id": "b9d7c358da365e608fdcf2e59d83cdcdbee624be",
"size":... |
"""This example updates rule based first party audience segments.
To determine which audience segments exist, run get_all_audience_segments.py.
"""
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
# Import appropriate modules from the client library.
from googleads import dfp
AUDIENCE_SEGMENT_ID = 'IN... | {
"content_hash": "102bff0cdfca14942611e58546412418",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 79,
"avg_line_length": 32.24242424242424,
"alnum_prop": 0.6555451127819549,
"repo_name": "dietrichc/streamline-ppc-reports",
"id": "db92594ebd0fe34a8c95f37f0281183384c10f5b",... |
try:
enumerate, exec
except:
print("SKIP")
raise SystemExit
def get_stop_iter_arg(msg, code):
try:
exec(code)
print("FAIL")
except StopIteration as er:
print(msg, er.args)
class A:
def __iter__(self):
return self
def __next__(self):
raise StopIter... | {
"content_hash": "7ea9ef77a9e77eacb8336e3537053496",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 54,
"avg_line_length": 20.737704918032787,
"alnum_prop": 0.6055335968379446,
"repo_name": "adafruit/circuitpython",
"id": "d4719c9bc35ec0b5002f68a5e946d4379af7c1e2",
"size"... |
"""
Context processors used by Horizon.
"""
import logging
from django.conf import settings
from horizon import api
LOG = logging.getLogger(__name__)
def horizon(request):
""" The main Horizon context processor. Required for Horizon to function.
Adds three variables to the request context:
``author... | {
"content_hash": "0a81040402304ab969fdd01554e932aa",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 78,
"avg_line_length": 32.47692307692308,
"alnum_prop": 0.6485078162008526,
"repo_name": "rcbops/horizon-buildpackage",
"id": "c2c582aa43b1bc82b0d85a28142a39eef6eeb178",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.