text stringlengths 4 1.02M | meta dict |
|---|---|
"""
This reader opens images taken using an Eiger detector at NSLS-II.
It expects a "master file" and a "data file" in the same directory.
It requires h5py and the hdf5-lz4 library from Dectris. The latter
has been packaged for conda and is available on the NSLS-II internal
conda channels and externally from:
conda i... | {
"content_hash": "df338b14b6b20aacdfe865fe92ddda3c",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 36.53846153846154,
"alnum_prop": 0.5970526315789474,
"repo_name": "brunoseivam/chxtools",
"id": "00975413b29cac52f1973a9dfd08f6299284ef32",
"size": "... |
import Axon
import Axon.Ipc as Ipc
import re
class Sandbox(Axon.Component.component):
"""\
Component Sandbox
Rather likea kind of graphline where components can be added and removed at runtime
by sending commands to the inbox.
("ADD", "importpath:factorycmd", ...)
("DEL", id)
("... | {
"content_hash": "d7039a6c80b83203b4db91b7325aba7f",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 107,
"avg_line_length": 33.645833333333336,
"alnum_prop": 0.5021671826625387,
"repo_name": "sparkslabs/kamaelia",
"id": "542bf6357a2d6653f5c708ffde76247e3e2bf153",
"size":... |
"""
Views for blob-migrator tool.
"""
import os
import json
import cloudstorage
import jinja2
from google.appengine.api import app_identity
from google.appengine.api import modules
from google.appengine.api import users
import webapp2
from app import config
from app import migrator
from app import progress
from app i... | {
"content_hash": "f52f71b2027cb2dff39a11211b57d4f3",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 79,
"avg_line_length": 29.74074074074074,
"alnum_prop": 0.6514855008005693,
"repo_name": "squee1945/appengine-blobstoremigrator-python",
"id": "9106ac969a03f118696bf642ed599... |
"""
Integrat HTTP USSD API.
"""
from vumi.transports.integrat.integrat import IntegratTransport
__all__ = ['IntegratTransport']
| {
"content_hash": "7f1913b7d573c53fa812283d775651ab",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 63,
"avg_line_length": 16.375,
"alnum_prop": 0.732824427480916,
"repo_name": "vishwaprakashmishra/xmatrix",
"id": "f1f6d7514c5b77eb26f8ae124ad54cdd6273e796",
"size": "131",
... |
__author__ = 'nuok'
from location import Location
class City(Location):
def __init__(self, config):
Location.__init__(self, config)
self.inventory_price = config['inventory_price']
self.extra_price = config['extra_price']
def sell(self, player):
player_inventory = player.get_i... | {
"content_hash": "99d788ddd5231810eceb684bbab648da",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 90,
"avg_line_length": 32.270270270270274,
"alnum_prop": 0.5862646566164154,
"repo_name": "chaiso-krit/reinforcement_learning",
"id": "3bf6bb3a4831e402a7e738ea679c8a753cd31b7... |
"""
idx2numpy package provides a tool for converting files from IDX format to
numpy.ndarray. You can meet files in IDX format, e.g. when you're going
to read the MNIST database of handwritten digits provided by Yann LeCun at
http://yann.lecun.com/exdb/mnist/
The description of IDX format also can be found on this page.... | {
"content_hash": "9450f91df8a654d1ba925e1f0e0d2d4e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 35.578947368421055,
"alnum_prop": 0.7751479289940828,
"repo_name": "ivanyu/idx2numpy",
"id": "9a9c38871d60de966b73f47339ca108d651f8be2",
"size": "701... |
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm['samples.Cohort'].objects.filter(autocreated=True, batch__isnull=False).delete()
def backwar... | {
"content_hash": "842ede7f3ff82263fdda618fdbc95447",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 192,
"avg_line_length": 86.05166051660517,
"alnum_prop": 0.5438679245283019,
"repo_name": "chop-dbhi/varify-data-warehouse",
"id": "e5c457a1438df79cd84354e742d32674686998a7"... |
import os
# import sys
# sys.path.append("..")
from source.mySpider import XJTUSpider
if __name__ == '__main__':
mySpider = XJTUSpider('ssfw')
if mySpider.login(username=os.environ.get('username'), password=os.environ.get('password')) == 0:
mySpider.schedule('20162')
mySpider.logout()
| {
"content_hash": "b59a53aa86daabba281de4c1809fd974",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 101,
"avg_line_length": 31.1,
"alnum_prop": 0.6527331189710611,
"repo_name": "Macsnow14/XJTU-API",
"id": "dabe6c2da58224013bfe34eca16ff6cd4dfac056",
"size": "459",
"binar... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
C... | {
"content_hash": "69a4346e738fee682f5150552fbb8a75",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 105,
"avg_line_length": 43.96666666666667,
"alnum_prop": 0.6838514025777104,
"repo_name": "dinhkute/Incisive-AIESEC",
"id": "12c2fe20b17e100ea5bb61619e9c0779be67cac2",
"siz... |
from flask import url_for
from psi.app import const
from psi.app.utils import db_util
from tests import fixture
from tests.base_test_case import BaseTestCase
from tests.object_faker import object_faker
from tests.views.organization.base_organization_test import BaseOrganizationTestCase
class TestEditOrganization(Bas... | {
"content_hash": "d27e484945fc6c2b0f4476fad749030a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 84,
"avg_line_length": 36.05882352941177,
"alnum_prop": 0.5492115280043501,
"repo_name": "betterlife/psi",
"id": "f9d0d66e14302d571b0d57df96e0068923722fac",
"size": "1854",... |
import pytest
from pyconll import load_from_string, load_from_file, iter_from_string, iter_from_file
from tests.util import fixture_location
from tests.unit.util import assert_token_members
def test_load_from_string():
"""
Test that a CoNLL file can properly be loaded from a string.
"""
with open(fix... | {
"content_hash": "eb21fbdef8ed872979b3e5ce74ccbb5b",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 86,
"avg_line_length": 30.904761904761905,
"alnum_prop": 0.599768875192604,
"repo_name": "pyconll/pyconll",
"id": "29c6d39dd18483f9f96673bd3c5fa878d225b353",
"size": "2596"... |
from automat import MethodicalMachine
class Door(object):
def unlock(self):
print("Opening the door so you can get your food.")
def lock(self):
print("Locking the door so you can't steal the food.")
class Light(object):
def on(self):
print("Need some food over here.")
def off... | {
"content_hash": "b7b92fcba3de65e49cd4478bbf6990b3",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 76,
"avg_line_length": 25.544776119402986,
"alnum_prop": 0.5761028337715455,
"repo_name": "dingzhi86/zim",
"id": "1ffc1e2c0503486f3b8cfc0e5374887d113a8a34",
"size": "3423"... |
import json
import optparse
import os
import polib
import re
import string
import sys
parser = optparse.OptionParser(usage="usage: %prog [options] pofile...")
parser.add_option("--callback", default="_.setTranslation", dest="callback", help="callback function to call with data")
parser.add_option("--quiet", action="st... | {
"content_hash": "1efead2c2d10924b2d88db7a43159d7c",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 126,
"avg_line_length": 25.6875,
"alnum_prop": 0.6853203568532036,
"repo_name": "ToureNPlaner/tourenplaner-web",
"id": "9cb477852e933518dd329a94b4d8f6c336558c90",
"size": "... |
from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='NGINX',
icon='globe',
dependencies=[
PluginDependency('webserver_common'),
BinaryDependency('nginx'),
],
)
def init():
import main
| {
"content_hash": "09648ad516d030489419673c3b8de95b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 45,
"avg_line_length": 15.6875,
"alnum_prop": 0.6215139442231076,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "91779a597a80ccbe35629ab6c489a8d0fa7c21ea",
"size": "251",
... |
"""Add activity tables
Revision ID: 19f590834366
Revises: 43cda5e14cf0
Create Date: 2012-11-14 23:31:56.202053
"""
# revision identifiers, used by Alembic.
revision = '19f590834366'
down_revision = '43cda5e14cf0'
from alembic import op
import sqlalchemy as db
def upgrade():
op.create_table('activities',
... | {
"content_hash": "4795d3983cfa4d7a9b93a77f1d403b87",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 95,
"avg_line_length": 40.0609756097561,
"alnum_prop": 0.634703196347032,
"repo_name": "chenmingd/ScriptFan.com",
"id": "013bbc325df37f57f6df4410d882d16ca0d95e1d",
"size": ... |
from w1thermsensor import W1ThermSensor
def get_temperature_celsius():
sensor = W1ThermSensor()
return sensor.get_temperature() | {
"content_hash": "155f173baac67f499f4998e9734c1090",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 39,
"avg_line_length": 27.2,
"alnum_prop": 0.7720588235294118,
"repo_name": "Andruschenko/lora-remote-server",
"id": "9efd55fc9def0f2c375154f9d58f414499cf7b8a",
"size": "136... |
def sqlQuery_StyleWithInventory():
import sqlalchemy,sys
orcl_engine = sqlalchemy.create_engine('oracle+cx_oracle://prod_team_ro:9thfl00r@borac101-vip.l3.bluefly.com:1521/bfyprd11')
connection = orcl_engine.connect()
query_marketplace_inprog ="""select
distinct POMGR.PRODUCT_COLOR.id as CO... | {
"content_hash": "7694e7895775b08c98e9d7157211a253",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 128,
"avg_line_length": 38.56172839506173,
"alnum_prop": 0.6252601248599328,
"repo_name": "relic7/prodimages",
"id": "7b0de93b0254b57e31712bfd2f4d393c0239d581",
"size": "6... |
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import logout
from django.c... | {
"content_hash": "a31881acce300d1ab7b1606b96057c69",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 103,
"avg_line_length": 33.95033860045147,
"alnum_prop": 0.5626994680851064,
"repo_name": "extertioner/django-mailchimp",
"id": "c1bc6001814304ef7c9838ef20c7767a2473ff97",
... |
from traitlets import Unicode
from .base import BasePlugin
from ..api import MissingEntry
class ExportPlugin(BasePlugin):
"""Base class for export plugins."""
to = Unicode("", config=True, help="destination to export to")
def export(self, gradebook):
"""Export grades to another format.
... | {
"content_hash": "acb7853719685729e07f7d4819225c3f",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 80,
"avg_line_length": 34.46534653465346,
"alnum_prop": 0.514220051709279,
"repo_name": "ellisonbg/nbgrader",
"id": "a7cce9a386633ec46e30b73f6aba14e24c9e4e9c",
"size": "34... |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="sunburst.hoverlabel.font", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | {
"content_hash": "86a2c11ff8e130e74f7cc5d5598d7010",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 83,
"avg_line_length": 34.46666666666667,
"alnum_prop": 0.5880077369439072,
"repo_name": "plotly/python-api",
"id": "1ceab2c94fbebf24bd5e3b202bad5b555fcdf414",
"size": "517... |
from __future__ import unicode_literals
import json
import io
import zipfile
from decimal import Decimal
import boto
import boto.cloudformation
import boto.datapipeline
import boto.ec2
import boto.ec2.autoscale
import boto.ec2.elb
from boto.exception import BotoServerError
import boto.iam
import boto.rds
import boto.... | {
"content_hash": "2b56dded4b802a3e54601ebcdd4c68d9",
"timestamp": "",
"source": "github",
"line_count": 2902,
"max_line_length": 99,
"avg_line_length": 36.936250861474846,
"alnum_prop": 0.5476028323801883,
"repo_name": "william-richard/moto",
"id": "43248669fcedd83d82b83d886dee1894e358dba5",
"size"... |
"""Tests for email dashboard handler."""
from core.domain import config_services
from core.platform import models
from core.tests import test_utils
import feconf
(user_models,) = models.Registry.import_models([models.NAMES.user])
taskqueue_services = models.Registry.import_taskqueue_services()
class EmailDashboar... | {
"content_hash": "00084403a2d58eb6bddeb2b95f3a27c3",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 80,
"avg_line_length": 42.161904761904765,
"alnum_prop": 0.5861757397786311,
"repo_name": "edallison/oppia",
"id": "449c572455284a0cb1eeae219bc760859c3f16e6",
"size": "503... |
"""Widget Pool for the ``django-metrics-dashboard`` app."""
from django.core.exceptions import ImproperlyConfigured
from django_load.core import load
from metrics_dashboard.exceptions import WidgetAlreadyRegistered
from metrics_dashboard.widget_base import DashboardWidgetBase
class DashboardWidgetPool(object):
... | {
"content_hash": "3565559ee507939b08e6d6a235ee92c2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 30.743243243243242,
"alnum_prop": 0.6426373626373626,
"repo_name": "bitmazk/django-metrics-dashboard",
"id": "784c05b0fd36e7a19fed852cc4d1bc0b3f693703"... |
import re
def is_hex_string(s):
pattern = "0x([0-9a-fA-F]+)$"
return bool(re.match(pattern, s))
def validate_proof_response_fields(res):
for o in res:
for s in o["proofArray"]:
assert is_hex_string(s)
assert is_hex_string(o["rootHash"])
assert is_hex_string(o["leaf"])... | {
"content_hash": "92dda4e194592deaa2ea400a28a85a18",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 47,
"avg_line_length": 25.151515151515152,
"alnum_prop": 0.6096385542168675,
"repo_name": "cardstack/cardstack",
"id": "58ba2c0d46414489eeb22d9c4286073a7b666e62",
"size": "... |
import os
import sys
import math
import optparse
import dukutil
def read_unicode_data(unidata, catsinc, catsexc, filterfunc):
"Read UnicodeData.txt, including lines matching catsinc unless excluded by catsexc or filterfunc."
res = []
f = open(unidata, 'rb')
def filter_none(cp):
return True
... | {
"content_hash": "b1ada1fc05cbd34f11434292cf61b022",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 123,
"avg_line_length": 26.842391304347824,
"alnum_prop": 0.5355335088074509,
"repo_name": "markand/duktape",
"id": "861fc930aa5601262acf488d5d2fff111070bb03",
"size": "10... |
from __future__ import absolute_import, print_function, unicode_literals
import os
import io
import unittest
import subprocess
import tempfile
import shutil
import re
from vcstools.svn import SvnClient
class SvnClientTestSetups(unittest.TestCase):
@classmethod
def setUpClass(self):
self.root_directo... | {
"content_hash": "69afe0c1c4c7ea2131044728cc63fafe",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 812,
"avg_line_length": 44.177570093457945,
"alnum_prop": 0.6110288414075171,
"repo_name": "k-okada/vcstools",
"id": "342a441892b0e9c8c9224c24e7a358417f772105",
"size": "1... |
import logging
ROUTER_STATIC_FILE = 'file'
ROUTER_STATIC_FILES = 'files'
ROUTER_STATIC_DIR = 'dir'
ROUTER_HEADER = 'headers'
ROUTER_PATH = "path"
ROUTER = 'routes'
logger = logging.getLogger('pfrock.static')
| {
"content_hash": "388e095fba135c5efe8dd3588d0875e5",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 43,
"avg_line_length": 19.181818181818183,
"alnum_prop": 0.7203791469194313,
"repo_name": "knightliao/pfrock",
"id": "f2257d76c2271fafc6a17681f2d6e866ac596461",
"size": "24... |
from netforce.model import Model, fields, get_model
class ServiceType(Model):
_name = "service.type"
_string = "Service Type"
_key = ["code"]
_fields = {
"name": fields.Char("Name", required=True, search=True),
"code": fields.Char("Code", search=True),
"description": fields.Tex... | {
"content_hash": "341266d755e63a438db5ccff4d2643f8",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 29.0625,
"alnum_prop": 0.6129032258064516,
"repo_name": "bank-netforce/netforce",
"id": "c104f5831a8f4185d9272efa4f7aaa1c32014e19",
"size": "1570",
... |
from theano import function, config, shared, sandbox
import theano.tensor as T
import numpy
import time
vlen = 10 * 30 * 768 # 10 x #cores x # threads per core
iters = 1000
rng = numpy.random.RandomState(22)
x = shared(numpy.asarray(rng.rand(vlen), config.floatX))
f = function([], T.exp(x))
print(f.maker.fgraph.topo... | {
"content_hash": "2b3ade62ffa4feefb44fbeaa8bc3ae4d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 80,
"avg_line_length": 28.40909090909091,
"alnum_prop": 0.672,
"repo_name": "gabrielilharco/sketch-bot",
"id": "985e28c4e2958039c9e84c023445cf2fd64c24b5",
"size": "625",
... |
"Base queue class"
# Things to think about:
# - timeout/visibility timeout (boto)
class BaseQueue(object):
"""
Abstract base class for queue backends.
"""
def read(self):
raise NotImplementedError
def write(self, message):
raise NotImplementedError
def __len__(self):
... | {
"content_hash": "b6f90e4cf21703db9eb2a6feb5693f39",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 43,
"avg_line_length": 18.62962962962963,
"alnum_prop": 0.6739562624254473,
"repo_name": "danner/queues",
"id": "f5777647e0df5c6ce1dd319cc21d8bf38f238401",
"size": "503",
... |
import os
from flask import Flask,render_template,url_for,request,session,redirect
from flask_login import LoginManager
from flask_bootstrap import Bootstrap
from flask_script import Manager,Shell
from flask_sqlalchemy import SQLAlchemy
from flask_mail import Mail
from flask_moment import Moment
from flask_socketio imp... | {
"content_hash": "a9735eefc6ff4807441825a5f2811599",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 117,
"avg_line_length": 32.62068965517241,
"alnum_prop": 0.7563424947145877,
"repo_name": "sumedh123/debatify",
"id": "89d78b1a48e585a5353b33fa5344659ba9f8770a",
"size": "1... |
import os
import imath
import IECore
import IECoreScene
import IECoreVDB
import GafferTest
import GafferScene
import GafferVDB
import GafferVDBTest
class LevelSetToMeshTest( GafferVDBTest.VDBTestCase ) :
def setUp( self ) :
GafferVDBTest.VDBTestCase.setUp( self )
self.sourcePath = os.path.join( self.dataDir, "... | {
"content_hash": "e88713dbb54cf2ed2ee8a25af59194db",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 108,
"avg_line_length": 36.103092783505154,
"alnum_prop": 0.7264420331239292,
"repo_name": "GafferHQ/gaffer",
"id": "a8d9bf23f2359d8d638368b1aa99dd38276a4847",
"size": "531... |
from optparse import OptionParser
import myjson
from verbose import set_v
if __name__ == "__main__":
parser = OptionParser()
parser.add_option("-g", "--get", dest="get", default=None, help="get data from myjson.com")
parser.add_option("-u", "--update", dest="update", default=None, help="put data from myjs... | {
"content_hash": "84a1ee5aa2a9c258513bdef7cbf76c0f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 111,
"avg_line_length": 44.75,
"alnum_prop": 0.5782122905027933,
"repo_name": "lowrey/myjsonstore",
"id": "0c978d2e2502da9393bb9fbfae5918a298ed1ed0",
"size": "1107",
"bin... |
from __future__ import unicode_literals
import logging, os, sets
from rapid_app import settings_app
from rapid_app.models import ManualDbHandler, PrintTitleDev
log = logging.getLogger(__name__)
class UpdateTitlesHelper( object ):
""" Manages views.update_production_easyA_titles() work. """
def __init__(sel... | {
"content_hash": "d644c1674d292f0cc30a4ee3da61a639",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 253,
"avg_line_length": 56.41142857142857,
"alnum_prop": 0.5842787682333873,
"repo_name": "birkin/rapid_exports",
"id": "9b2e8749d8a19e01eb7c453d5d7bbcbf8392e699",
"size":... |
from urllib.request import urlopen
from bs4 import BeautifulSoup
import datetime
import random
import re
import json
random.seed(datetime.datetime.now())
def getLinks(articleUrl):
html = urlopen("http://en.wikipedia.org"+articleUrl)
bsObj = BeautifulSoup(html,'html5lib')
return bsObj.find("div", {"id":"bodyCont... | {
"content_hash": "874590d28f491d69f7b4f2c1de308e19",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 111,
"avg_line_length": 31.21153846153846,
"alnum_prop": 0.7147258163894024,
"repo_name": "ChenBooming/python_pycharm",
"id": "37232253dbf75fbbb26ca5800a5cb8c7f866dea5",
"s... |
import sys
try:
import boto3
except ImportError:
name = 'django_distill.backends.amazon_s3'
pipm = 'boto3'
sys.stdout.write('{} backend requires {}:\n'.format(name, pipm))
sys.stdout.write('$ pip install {}\n\n'.format(pipm))
raise
from django_distill.errors import DistillPublishError
from d... | {
"content_hash": "532a1c28cea4b58706cc483e7c4d9e54",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 84,
"avg_line_length": 31.29850746268657,
"alnum_prop": 0.6237482117310443,
"repo_name": "mgrp/django-distill",
"id": "9a327b2263365afce8e751123e9c42e43c032ad8",
"size": "2... |
"""
set_fake_passwords.py
Reset all user passwords to a common value. Useful for testing in a
development environment. As such, this command is only available when
setting.DEBUG is True.
"""
from typing import List
from django.conf import settings
from django.contrib.auth import get_user_model
from djang... | {
"content_hash": "97a254b1a9c55ce276a69fe6db1c6080",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 112,
"avg_line_length": 32.22222222222222,
"alnum_prop": 0.6408045977011494,
"repo_name": "django-extensions/django-extensions",
"id": "1d03fe037bb5c661038efc581fc7f1090e66d4... |
# Copyright 2021 Google LLC. All Rights Reserved.
#
# 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 a... | {
"content_hash": "8afaa719e41a36197894a0b372e9dbee",
"timestamp": "",
"source": "github",
"line_count": 587,
"max_line_length": 123,
"avg_line_length": 35.310051107325386,
"alnum_prop": 0.6213634389926184,
"repo_name": "google/security-testbeds",
"id": "eff0b4ab5e34947fce49ca9e9868731b03a3154b",
"s... |
"""
Feature extractor class for LayoutLMv3.
"""
from ...utils import logging
from .image_processing_layoutlmv3 import LayoutLMv3ImageProcessor
logger = logging.get_logger(__name__)
LayoutLMv3FeatureExtractor = LayoutLMv3ImageProcessor
| {
"content_hash": "b8abedef26f960a07493729e6c561f7e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 65,
"avg_line_length": 20,
"alnum_prop": 0.7958333333333333,
"repo_name": "huggingface/transformers",
"id": "d742c068fc730753a25d6b7dc5d1714ca9d30b2a",
"size": "845",
"bi... |
from ._models_py3 import ActionDetail
from ._models_py3 import ActionGroupList
from ._models_py3 import ActionGroupPatchBody
from ._models_py3 import ActionGroupResource
from ._models_py3 import ArmRoleReceiver
from ._models_py3 import AutomationRunbookReceiver
from ._models_py3 import AzureAppPushReceiver
from ._model... | {
"content_hash": "98bed2a52e68756093563ded109454a0",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 32.77358490566038,
"alnum_prop": 0.7576280944156591,
"repo_name": "Azure/azure-sdk-for-python",
"id": "c2c49e9b3b64eead95c99699a3daa7ac109fc660",
"si... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('futuschedule', '0007_auto_20180227_1126'),
]
operations = [
migrations.AddField(
model_name='futuuser',
name='personio_id',
... | {
"content_hash": "5d3fe6cb0ca6cd81e7f0de252bca9b84",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 22.88888888888889,
"alnum_prop": 0.6092233009708737,
"repo_name": "futurice/schedule",
"id": "24a53f32e39e8836ed11535a13b1e8ac2bd1f10e",
"size": "436... |
import warnings
import torch
from ..constraints import Positive
from ..lazy import MatmulLazyTensor, RootLazyTensor
from .kernel import Kernel
class LinearKernel(Kernel):
r"""
Computes a covariance matrix based on the Linear kernel
between inputs :math:`\mathbf{x_1}` and :math:`\mathbf{x_2}`:
.. ma... | {
"content_hash": "e464c342c9248c0264b3acd59577afc8",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 120,
"avg_line_length": 38.265306122448976,
"alnum_prop": 0.6181333333333333,
"repo_name": "jrg365/gpytorch",
"id": "aa1633a1f35c35128bf943e3b285926d966c256f",
"size": "377... |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_adafruitms1438 as upmAdafruitms1438
def main():
# Import header values
I2CBus = upmAdafruitms1438.ADAFRUITMS1438_I2C_BUS
I2CAddr = upmAdafruitms1438.ADAFRUITMS1438_DEFAULT_I2C_ADDR
M12Motor = upmAdafruitms1438... | {
"content_hash": "033a30b656a47ae544f68aacc17c8ab9",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 75,
"avg_line_length": 30.606060606060606,
"alnum_prop": 0.7207920792079208,
"repo_name": "g-vidal/upm",
"id": "543c535d36dd1f8830dfeb58e9d386220f4d016c",
"size": "3180",
... |
'''Module containg Abstract Syntax Tree (AST) constructors.'''
from abc import ABCMeta, abstractmethod
from math import exp, log, cos, sin, tan, factorial
from operator import add, sub, mul, truediv, pow, neg
# Binary operation lookup table (prevents looking at cases later).
bin_ops = {
'+': add,
... | {
"content_hash": "e57a30592749f445c3941c164e89a6d7",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 80,
"avg_line_length": 29.906474820143885,
"alnum_prop": 0.5828722636516719,
"repo_name": "artemmavrin/pycalc",
"id": "498be53db4e4a88501f54eef613cf3cec4c83faa",
"size": "... |
import contextlib
import mock
import webob.exc as wexc
from neutron.api.v2 import base
from neutron.common import constants as n_const
from neutron import context
from neutron.extensions import portbindings
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.plugins.common imp... | {
"content_hash": "0e70e41ebb4cd00d6245affe267d8229",
"timestamp": "",
"source": "github",
"line_count": 700,
"max_line_length": 79,
"avg_line_length": 42.90857142857143,
"alnum_prop": 0.5775402849913437,
"repo_name": "onecloud/neutron",
"id": "55717ebe2cc1820da24180dd857eb9b4d4efb81d",
"size": "306... |
"""Social network login test."""
from urllib.parse import urlparse, parse_qs
import transaction
from pyramid import testing
from mock import MagicMock
from velruse import AuthenticationComplete
from pyramid_fullauth.views.social import SocialLoginViews
from pyramid_fullauth.models import User
from tests.views.conft... | {
"content_hash": "53793264723ae8c8c1f3de87259c20c6",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 116,
"avg_line_length": 35.47653429602888,
"alnum_prop": 0.6487229062786202,
"repo_name": "fizyk/pyramid_fullauth",
"id": "ef12a6df2e37c25188bd52001e3a1798543a9856",
"size... |
import os
import gzip
import logging
import logging.handlers
class CompressedRotatingFileHandler(logging.handlers.RotatingFileHandler):
""" compress old files
from http://roadtodistributed.blogspot.com/2011/04/compressed-rotatingfilehandler-for.html
"""
def __init__(self, filename, mode='a', maxBytes... | {
"content_hash": "7bd4e2770b763657af1e511ae843ee7e",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 115,
"avg_line_length": 36.924528301886795,
"alnum_prop": 0.5074092999489014,
"repo_name": "Apkawa/yas3fs",
"id": "b3fb3baf2e11d8acfff569cfc13a87ecc6bb90f2",
"size": "1981"... |
from django.test import TestCase
from django.core.exceptions import ValidationError
from oscar.apps.catalogue.models import (Product, ProductClass,
ProductAttribute,
AttributeOptionGroup,
Attribut... | {
"content_hash": "d087ce3938ad2d0df9d25dc74d3af8db",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 102,
"avg_line_length": 38.31958762886598,
"alnum_prop": 0.6088243206887275,
"repo_name": "Idematica/django-oscar",
"id": "453f21e50332594e65db8ebc82022d433f34c15a",
"size"... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V2alpha1C... | {
"content_hash": "34dad851b6400692690eb8f1bad9fb92",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 196,
"avg_line_length": 34.51700680272109,
"alnum_prop": 0.6310603074497438,
"repo_name": "mbohlool/client-python",
"id": "55652a4e4074a32d9db8fcb7f598afdd3efe514f",
"size... |
"""Part of the Keras training engine related to plain array data.
"""
# pylint: disable=protected-access
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.... | {
"content_hash": "e80d0b27fedc046ffc938cc6855489ec",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 80,
"avg_line_length": 38.25974025974026,
"alnum_prop": 0.6470468431771894,
"repo_name": "Bismarrck/tensorflow",
"id": "e4f91fa18a75d0783d625f4ff572ef9922bcde61",
"size": ... |
import collections
from typing import Optional
import tensorflow as tf
from official.modeling import tf_utils
from official.nlp.keras_nlp import layers
from etcmodel import feature_utils as etc_feature_utils
from etcmodel import layers as etc_layers
_NUM_OTHER_RELATIVE_IDS = 3
class MmtEncoder(tf.keras.Model):
... | {
"content_hash": "1922648f6ee25dbcb4e32d91a08e3a45",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 177,
"avg_line_length": 39.72623574144487,
"alnum_prop": 0.6521822358346095,
"repo_name": "googleinterns/multimodal-long-transformer-2021",
"id": "a195a394ac569a681457da9173... |
"""add simple_identifier
Revision ID: 508864cbfc71
Revises: 35388de3b2c1
Create Date: 2017-04-21 08:16:09.841511
"""
# revision identifiers, used by Alembic.
revision = '508864cbfc71'
down_revision = '35388de3b2c1'
import sqlalchemy as sa
from alembic import op
def upgrade():
op.create_table('SimpleIdentifier... | {
"content_hash": "b7cc213440b90175280fbd06148130de",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 112,
"avg_line_length": 26.892857142857142,
"alnum_prop": 0.6812749003984063,
"repo_name": "NMGRL/pychron",
"id": "51162530811fce9d447b33f8fcef68427466262a",
"size": "753",... |
from setuptools import setup, find_packages
version = '1.13.8'
package_name = "ropper"
package_dir = "ropper"
package_description = """Show information about files in different file formats and find gadgets to build rop chains for different architectures.
""".strip()
packages = find_packages()
valid_packages = []
fo... | {
"content_hash": "b9a8ee4026986bc4b837b7c9e9cc5d09",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 145,
"avg_line_length": 28.068181818181817,
"alnum_prop": 0.6615384615384615,
"repo_name": "sashs/Ropper",
"id": "6213f3c446016a8219be1f12aef70d807928bb03",
"size": "1235",... |
import os
import os.path
import sys
import time
import urllib2
import urlparse
import lxml.etree
import lxml.html
debug = False
def main():
site_url = 'http://sites.google.com/site/bmaupinwiki'
#dest_path = '%s/Documents/misc/bmaupinwiki' % (home)
dest_path = '{0}/Desktop/bmaupinwiki'.format(os.getenv('H... | {
"content_hash": "b2a23557ba16169ba47c5fdd25e885af",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 109,
"avg_line_length": 29.585106382978722,
"alnum_prop": 0.5719165767709457,
"repo_name": "bmaupin/junkpile",
"id": "2f9e2d8d41da1d0fe6261d2a7723cca6bd941f86",
"size": "5... |
from __future__ import unicode_literals
import re
try:
from html.parser import HTMLParser # py3
except ImportError:
from HTMLParser import HTMLParser # py2
from django.core.exceptions import ImproperlyConfigured
from django.forms import widgets
from django.utils.html import format_html
from django.utils.tran... | {
"content_hash": "7971ce5a7d2bfe6e6aaadce231ee703b",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 118,
"avg_line_length": 45.40860215053763,
"alnum_prop": 0.6643381482358512,
"repo_name": "rfleschenberg/djangocms-cascade",
"id": "84b70421613018094433add65d670da98a1795b8"... |
"""
Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
See https://llvm.org/LICENSE.txt for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Prepares language bindings for LLDB build process. Run with --help
to see a description of the supported command line argu... | {
"content_hash": "e24abafcc54de530dec2e460620ce863",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 96,
"avg_line_length": 30.37313432835821,
"alnum_prop": 0.6496314496314496,
"repo_name": "llvm-mirror/lldb",
"id": "c233e046ba757dc59e76e9e77860e51fc1a8b12d",
"size": "2035... |
import logging
import os
import subprocess
from ..config import as_dict, as_pargs, as_path, decode
from .call_decorator import CallDecorator
logger = logging.getLogger(__name__)
class SubprocessPropertyDecorator(CallDecorator):
"""
Decorator for SUT calls to extend issues with an arbitrary property where
... | {
"content_hash": "ebe58c8ccd5866ca9b250f8cfc5387c9",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 135,
"avg_line_length": 39.3855421686747,
"alnum_prop": 0.5591924135821352,
"repo_name": "renatahodovan/fuzzinator",
"id": "4d4944fea7b854c3675fc673569f0e119ab16821",
"size... |
from __future__ import print_function
import os
import Pyro4
@Pyro4.expose
class Thingy(object):
def message(self, arg):
print("Message received:", arg)
return "Roger!"
if os.path.exists("example_unix.sock"):
os.remove("example_unix.sock")
with Pyro4.Daemon(unixsocket="example_unix.sock") ... | {
"content_hash": "ca508ae4757fcfb544af96e329c6faed",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 55,
"avg_line_length": 21.7,
"alnum_prop": 0.6705069124423964,
"repo_name": "irmen/Pyro4",
"id": "cec7e952d3aa6202578c67767e645ee2394c5fa5",
"size": "434",
"binary": fals... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import range
from future import standard_library
standard_library.install_aliases()
import sys
PYTHON_VERSION = sys.version_info[:3]
PY2 = (PYTHON_VERSION[0... | {
"content_hash": "0eb9be2e38de67696b1fde3d9a940947",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 84,
"avg_line_length": 38.38743455497382,
"alnum_prop": 0.5366884888161484,
"repo_name": "miqui/python-hpOneView",
"id": "aedd950eb9b7ff3942bd733052f87f0eb2ba468e",
"size"... |
import Numberjack
from origen import seven_segment
from origen import seven_segment_data
class AccessPuzzle(object):
def __init__(self, goal, num_boards):
self.model = Numberjack.Model()
self.goal = _make_access_matrix('goal')
self._set_goal(goal)
self.key = _make_access_matrix('key')
self.boar... | {
"content_hash": "0a99f565ba3098d63e185364211533be",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 71,
"avg_line_length": 27.476190476190474,
"alnum_prop": 0.6504910456383594,
"repo_name": "PhilHarnish/forge",
"id": "13b4d2cec1a3e58a18b5f7a193214ffc0cc094e6",
"size": "17... |
"""
A simple class to read a binary lamms file
"""
import struct
class lammps_trj(object):
def __init__(self, filename):
self.variables_order = ['timestep', 'ndump', 'triclinic',
'xlo-flag', 'xhi-flag', 'ylo-flag', 'yhi-flag',
'zlo-flag', 'zh... | {
"content_hash": "3584a757704f3be1b0c4bc228930e849",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 109,
"avg_line_length": 36.58620689655172,
"alnum_prop": 0.5169651272384543,
"repo_name": "andersle/suspicious-trick",
"id": "a0b4e36b74c5a05934e991923878c56035c0d1ce",
"si... |
from ironic.api.controllers.v1 import versions
from ironic.tests.unit.api import base
class TestRoot(base.BaseApiTest):
def test_get_root(self):
response = self.get_json('/', path_prefix='')
# Check fields are not empty
[self.assertNotIn(f, ['', []]) for f in response]
self.asser... | {
"content_hash": "ef83d3ef674f501f3e7f84f9e24de868",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 41.13157894736842,
"alnum_prop": 0.6327575175943698,
"repo_name": "dims/ironic",
"id": "2aa4e25baadbcb8fb1d9bd5d6c20940c9fc13378",
"size": "2192",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label = '%s.%s' % (User._meta.... | {
"content_hash": "ab0a6882a073fd5318c74b84d2d43008",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 187,
"avg_line_length": 72.62406015037594,
"alnum_prop": 0.5707630189460606,
"repo_name": "google-code-export/evennia",
"id": "e34c0f32233930aec4c61d1cc9b08e25323d8e61",
"... |
"""
Integration test for Google Cloud Pub/Sub.
"""
from __future__ import absolute_import
import logging
import unittest
import uuid
from hamcrest.core.core.allof import all_of
from nose.plugins.attrib import attr
from apache_beam.io.gcp import pubsub_it_pipeline
from apache_beam.io.gcp.pubsub import PubsubMessage
f... | {
"content_hash": "04db1040ca2b68417c0b8862fc4c7927",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 80,
"avg_line_length": 41.51063829787234,
"alnum_prop": 0.6524859046642747,
"repo_name": "RyanSkraba/beam",
"id": "2c4378657c4a58527cde3cb6b7127d7a3547a4c3",
"size": "8588... |
"""
.. module:: dj-stripe.contrib.rest_framework.urls.
:synopsis: URL routes for the dj-stripe REST API.
.. moduleauthor:: Philippe Luickx (@philippeluickx)
Wire this into the root URLConf this way::
url(
r'^api/v1/stripe/',
include('djstripe.contrib.rest_framework.urls', namespace="rest_djs... | {
"content_hash": "8913a9cb18a21d4cb72a16d89a3938b5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 21.694444444444443,
"alnum_prop": 0.6632522407170295,
"repo_name": "jleclanche/dj-stripe",
"id": "87acee17e79df9f60f8cf8f6affb70953d7e09e3",
"size": ... |
import collections
import ctypes
import re
import numpy as np
from numba.core import errors, types
from numba.core.typing.templates import signature
from numba.np import npdatetime_helpers
from numba.core.errors import TypingError
# re-export
from numba.core.cgutils import is_nonelike # noqa: F401
numpy_version ... | {
"content_hash": "119b228417c842f407f5637758101160",
"timestamp": "",
"source": "github",
"line_count": 731,
"max_line_length": 84,
"avg_line_length": 34.808481532147745,
"alnum_prop": 0.6048732560424445,
"repo_name": "numba/numba",
"id": "025f9a89e51a444779816354f092cbc86d7a0a01",
"size": "25445",... |
"""Namespace for registering numpy_extension ops for imperative programming."""
from ..ndarray import numpy_extension as _mx_nd_npx
from ..util import set_module
__all__ = ['softmax', 'log_softmax', 'masked_softmax', 'masked_log_softmax',
'activation', 'batch_norm', 'fully_connected', 'pick', 'convolution... | {
"content_hash": "4cb20de89f4473468600ad3eb54c0348",
"timestamp": "",
"source": "github",
"line_count": 1391,
"max_line_length": 112,
"avg_line_length": 41.123652048885695,
"alnum_prop": 0.6195129626068563,
"repo_name": "DickJC123/mxnet",
"id": "d2818304ca4755d97bf784e1a6d85b744cef8b5e",
"size": "5... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[
[TestAction.create_mini_vm, 'vm1', 'cluster=cluster1'],
[TestAction.destroy_vm, 'vm1'],
[TestAction.recover_vm, ... | {
"content_hash": "c8f26e1b88b3d72a19ad5341137d16d1",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 104,
"avg_line_length": 41.96923076923077,
"alnum_prop": 0.6946480938416423,
"repo_name": "zstackio/zstack-woodpecker",
"id": "9901d36e02eb60b6c8af9c961fc00b38aca4c96a",
"s... |
__author__ = 'Daan Wierstra and Tom Schaul'
from scipy import size, zeros, ndarray, array
from numpy.random import randn
from pybrain.structure.evolvables.evolvable import Evolvable
class ParameterContainer(Evolvable):
""" A common interface implemented by all classes which
contains data that can change dur... | {
"content_hash": "7a69ec645dda9c077af3122e8b4c9804",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 100,
"avg_line_length": 35.72222222222222,
"alnum_prop": 0.5968895800933126,
"repo_name": "rbalda/neural_ocr",
"id": "13538c1e5a4a93564bd5d09e2eea5170a3abd8ca",
"size": "32... |
"""
Main module from which the application is started and the web interface mounted
To start the application directly using the python web server, you can just do
::
python web.py
Refer to server installation documentation for more details how to deploy in production.
"""
from octopus.core import app, initialis... | {
"content_hash": "ec9b3274be214d1351ecbd82c289a88b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 164,
"avg_line_length": 32.74418604651163,
"alnum_prop": 0.6910511363636364,
"repo_name": "JiscPER/jper-oaipmh",
"id": "fe3a319fb8b805172465d6fa5c0b1525d9ff1f01",
"size": "... |
import sqlalchemy as sa
from sqlalchemy import orm
from neutron.api.v2 import attributes
from neutron.db import db_base_plugin_v2
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import portbindings_base
from neutron.extensions import portbindings
class PortBindingPort(model_base.BA... | {
"content_hash": "4a45ad0e9aff8cc97ab9de0610da2d56",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 75,
"avg_line_length": 39.39047619047619,
"alnum_prop": 0.6160541586073501,
"repo_name": "CingHu/neutron-ustack",
"id": "1f94f83974b796d216ffabec91c91c14466a353d",
"size":... |
import datetime
import re
import time
import urllib
from typing import Any, Dict, List, Optional, Sequence
from unittest.mock import MagicMock, patch
from urllib.parse import urlencode
import orjson
from django.conf import settings
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.cont... | {
"content_hash": "e1c730c6f191d590de7f1fe5d4f16559",
"timestamp": "",
"source": "github",
"line_count": 5362,
"max_line_length": 175,
"avg_line_length": 41.98508019395748,
"alnum_prop": 0.6206312965299124,
"repo_name": "punchagan/zulip",
"id": "08f5c2f3e901b179a61bda19b895967fd777526b",
"size": "22... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 7, transform = "None", sigma = 0.0, exog_count = 100, ar_order = 12); | {
"content_hash": "fd298600bd02bfe749c00a9fa187afb6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 160,
"avg_line_length": 37.142857142857146,
"alnum_prop": 0.7,
"repo_name": "antoinecarme/pyaf",
"id": "34ad00a7d19ed321c5c50eae52396a2fc3a64895",
"size": "260",
"binary":... |
import os, base64, getpass
from suds.client import Client
defaultModelOptions = {"title":"Default Title", "desc":"Default Description",
"view_state":2, "tags":"model,auto-upload",
"has_color":0, "scale":1, "markup":0}
class Shapeways(object):
def __init__(self, use... | {
"content_hash": "3374c684710bac13d838fe2f8b78d7ac",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 122,
"avg_line_length": 42.872727272727275,
"alnum_prop": 0.6361323155216285,
"repo_name": "meawoppl/shapewaysAPI",
"id": "60e4a3f8b8c1bf606036f279deca2d50f3ad8de4",
"size"... |
"""Simple parsers for registry keys and values."""
import re
import logging
from grr.lib import artifact_lib
from grr.lib import parsers
from grr.lib import rdfvalue
from grr.lib import type_info
from grr.lib import utils
SID_RE = re.compile(r"^S-\d-\d+-(\d+-){1,14}\d+$")
class CurrentControlSetKBParser(parsers.... | {
"content_hash": "134a44582d76aab3dee83baaa1fba0b7",
"timestamp": "",
"source": "github",
"line_count": 517,
"max_line_length": 80,
"avg_line_length": 36.684719535783366,
"alnum_prop": 0.6269640409153222,
"repo_name": "ksmaheshkumar/grr",
"id": "31643a8c4e82da621e86c69e342dd55e6a1192bd",
"size": "1... |
import sys
import os
import time
#variables for alphabetic characters
a_ = 65
z_ = 90
A_ = 97
Z_ = 122
#variables for accessing word_analysis list
WORDCOUNT = 0
LINENUMBERS = 1
IWORDINTEXT = 2
ICHARONLINE = 3
#variables for user input options in text_step and word_step functions
ENTER = ''
W_NEXT_INST = '>'
W_PRE... | {
"content_hash": "fd11dd3eba70dc5deb18d6427d379945",
"timestamp": "",
"source": "github",
"line_count": 1213,
"max_line_length": 161,
"avg_line_length": 41.37757625721352,
"alnum_prop": 0.551035046123807,
"repo_name": "KTRosenberg/Text-Analyzer-and-Step-through-Viewer",
"id": "fc7452c926b2649417315e8... |
from os.path import dirname, isdir, isfile, join
from os import makedirs
from tempfile import mkdtemp
from mock import Mock, patch
from jig.tests.testcase import (
CommandTestCase, PluginTestCase,
cd_gitrepo, cwd_bounce, result_with_hint)
from jig.tests.mocks import MockPlugin
from jig.tools import NumberedDi... | {
"content_hash": "56aa228273a2c47cf6f98e0a299665fc",
"timestamp": "",
"source": "github",
"line_count": 626,
"max_line_length": 80,
"avg_line_length": 31.98083067092652,
"alnum_prop": 0.5548451548451548,
"repo_name": "robmadole/jig",
"id": "63368b12aac420f637f726903abeccd34cb58c66",
"size": "20043"... |
from proteus import *
from redist_p import *
from dambreak_Ubbink_coarse import *
tolFac = 0.0
nl_atol_res = rd_nl_atol_res
linTolFac = 0.01
l_atol_res = 0.01*rd_nl_atol_res
useEisenstatWalker = False
if redist_Newton:
timeIntegration = NoIntegration
stepController = Newton_controller
maxNonlinearIts = 5... | {
"content_hash": "0e3c95e500ce10d08d31722ad1d5497a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 127,
"avg_line_length": 26.46268656716418,
"alnum_prop": 0.7326565143824028,
"repo_name": "erdc-cm/air-water-vv",
"id": "ad8b0520e4c4470c8e1be9cd19a4039226f44ea7",
"size": ... |
__author__ = "Danilo S. Carvalho <danilo@jaist.ac.jp>"
import json
import argparse
def main(args):
print "Loading DB..."
with open(args.ifilepath, "r") as wiktdb_file:
db = json.load(wiktdb_file)
langs = args.langs.split(",")
selected = []
print "Filtering..."
for doc in db:
e... | {
"content_hash": "bd67a52232654525f8b2ed800767baee",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 203,
"avg_line_length": 32.89795918367347,
"alnum_prop": 0.5694789081885856,
"repo_name": "dscarvalho/tdv",
"id": "dea4845f7770bd999afa5a7e95bd1e820a2a99b6",
"size": "1659"... |
from tornado.web import url
from functools import reduce
class Route(object):
_routes = {}
def __init__(self, pattern, kwargs=None, name=None, host='.*$'):
self.pattern = pattern
self.kwargs = kwargs if kwargs else {}
self.name = name
self.host = host
def __call__(self, ... | {
"content_hash": "7135eef84bcc9b8701460b5e3abcf72a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 88,
"avg_line_length": 28.06896551724138,
"alnum_prop": 0.6056511056511057,
"repo_name": "blackmatrix7/apizen-tornado",
"id": "e0d7eb5db5d958cc06413b41fb297c26c52f06a7",
"s... |
import math
from decimal import Decimal
from django.db.models import DecimalField
from django.db.models.functions import Sqrt
from django.test import TestCase
from django.test.utils import register_lookup
from ..models import DecimalModel, FloatModel, IntegerModel
class SqrtTests(TestCase):
def test_null(self):... | {
"content_hash": "1714176aa8f427aaad244a522bfc9ada",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 77,
"avg_line_length": 41.1578947368421,
"alnum_prop": 0.6572890025575447,
"repo_name": "pauloxnet/django",
"id": "b7751d929e3f0adf93986163d138cb2a2f1e30e8",
"size": "2346"... |
import time
import gevent
from util import RateLimit
# Time is around limit +/- 0.05 sec
def around(t, limit):
return t >= limit - 0.05 and t <= limit + 0.05
class ExampleClass(object):
def __init__(self):
self.counted = 0
self.last_called = None
def count(self, back="counted"):
... | {
"content_hash": "4b97676429ad54a39a50f76a764b9b2b",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 129,
"avg_line_length": 37.297872340425535,
"alnum_prop": 0.6041072447233314,
"repo_name": "kustomzone/Fuzium",
"id": "b0a91ba06b50e54cdfb2c13a84a4946161f780cb",
"size": "3... |
"""
=============================================
Density Estimation for a mixture of Gaussians
=============================================
Plot the density estimation of a mixture of two gaussians. Data is
generated from two gaussians with different centers and covariance
matrices.
"""
import numpy as np
import py... | {
"content_hash": "40ab6ae74d53e5045a67bb0c799491fe",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 67,
"avg_line_length": 26.07894736842105,
"alnum_prop": 0.5973763874873865,
"repo_name": "kmike/scikit-learn",
"id": "ec690c8adfaab0e141c40b86183d2a0a9e17aa23",
"size": "99... |
import urlparse
from lxml import etree
from tempest.common import http
from tempest.common.rest_client import RestClientXML
from tempest.services.compute.xml.common import Document
from tempest.services.compute.xml.common import Element
from tempest.services.compute.xml.common import xml_to_json
XMLNS = "http://docs... | {
"content_hash": "1f5d51087d628947ad9ebe7635981052",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 39.94565217391305,
"alnum_prop": 0.5706122448979591,
"repo_name": "armando-migliaccio/tempest",
"id": "e211ceeeb7ff246b106d51ed321da597a239faad",
"si... |
from __future__ import absolute_import
import numpy as np
from pyti import catch_errors
from pyti.function_helper import fill_for_noncomputable_vals
from six.moves import range
def true_range(close_data, period):
"""
True Range.
Formula:
TRt = MAX(abs(Ht - Lt), abs(Ht - Ct-1), abs(Lt - Ct-1))
"""... | {
"content_hash": "8f224c32a2924326194c3f5ac73404c0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 33.5,
"alnum_prop": 0.6094527363184079,
"repo_name": "kylejusticemagnuson/pyti",
"id": "fbf6acd14ddeee309e3aec8c09ae2f90947eb0be",
"size": "804",
"... |
from copy import deepcopy
import numpy as np
from scipy import linalg
from .constants import FIFF
from .proj import _has_eeg_average_ref_proj, make_eeg_average_ref_proj
from .proj import setup_proj
from .pick import pick_types, pick_channels, pick_channels_forward
from .base import BaseRaw
from ..evoked import Evoked
... | {
"content_hash": "f2b39e1ffed589289ac4387f009eae86",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 79,
"avg_line_length": 40.00811359026369,
"alnum_prop": 0.5956702494423038,
"repo_name": "cjayb/mne-python",
"id": "42645d67ba98f41e8e15f7c43a5743fa87e324e2",
"size": "199... |
import numpy as np
import tensorflow as tf
from agents import TabularQAgent, capacities
class TabularQERAgent(TabularQAgent):
"""
Agent implementing tabular Q-learning with experience replay.
"""
def set_agent_props(self):
super(TabularQERAgent, self).set_agent_props()
self.er_batch_s... | {
"content_hash": "aae4f05e97b8f101ed6b8bb995a3e0d8",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 133,
"avg_line_length": 36.634408602150536,
"alnum_prop": 0.5444672732609334,
"repo_name": "morgangiraud/openai-rl",
"id": "cd84682dfe6b501f9ed35612d21980de194dbb05",
"size... |
"""Endpoint action implementations"""
import logging
from osc_lib.command import command
from osc_lib import exceptions
from osc_lib import utils
from openstackclient.i18n import _
from openstackclient.identity import common
LOG = logging.getLogger(__name__)
class CreateEndpoint(command.ShowOne):
_descriptio... | {
"content_hash": "475eeb89f27717a228da17d800409347",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 78,
"avg_line_length": 32.63636363636363,
"alnum_prop": 0.5463324048282265,
"repo_name": "openstack/python-openstackclient",
"id": "57906ddff6356506fb27a58eb1395fb14af771d9"... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.targets.jvm_target import JvmTarget
from pants.base.deprecated import deprecated_conditional
from pants.base.exceptions import TargetDefinitionE... | {
"content_hash": "492f5b7c5355aa7cf071ae6aa7cf7dae",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 99,
"avg_line_length": 38.120370370370374,
"alnum_prop": 0.675491863007044,
"repo_name": "fkorotkov/pants",
"id": "b453952383393a3bb0e2133dacc28b94bad6604e",
"size": "4264... |
from diogenis.tests import *
class SchoolTestCase(DiogenisTestCase):
def test_lessons_count_for_informatics(self):
self.assertEqual(self.school_1.lessons.all().count(), 2)
def test_schools_count_for_second_lesson(self):
self.assertEqual(self.lesson_2.school_set.all().count(), 2)
... | {
"content_hash": "2bf0566d1b578b00d9193a4df251a246",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 67,
"avg_line_length": 32.8,
"alnum_prop": 0.6676829268292683,
"repo_name": "gtsiokos/diogenis",
"id": "1cce7e85960aaf6237556d8d6b7d9aa6f7ddf31d",
"size": "352",
"binary"... |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^idptest/', include('idptest.foo.urls')),
# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
... | {
"content_hash": "3db49c08b44730e5ab55ec462c46ab20",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 30.17391304347826,
"alnum_prop": 0.6729106628242075,
"repo_name": "anentropic/django-saml2-idp",
"id": "9ded19fa13195daf893c52df70546e7858463b25",
"s... |
import os
import hashlib
from io import BytesIO
from tests.utils import driver
from onitu_webdav.wd import get_WEBDAV_client, create_dirs
from onitu.utils import get_random_string, b, dirname
class Driver(driver.Driver):
def __init__(self, *args, **options):
options['hostname'] = os.getenv(
... | {
"content_hash": "278b8bf82654e7d1b5e26f25a1be83eb",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 27.75,
"alnum_prop": 0.6164058795637744,
"repo_name": "onitu/onitu",
"id": "3f24ee25b87bb644ac66e74af91d3fa94a233baf",
"size": "2109",
"binary": fa... |
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | {
"content_hash": "7ee3870c0f690e16f8b243273be2b8f6",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 100,
"avg_line_length": 35.08163265306123,
"alnum_prop": 0.4639060764715215,
"repo_name": "SergeyCherepanov/ansible",
"id": "a9bbbdfd40056fd5b7d6b5764f4a83330c046fb5",
"si... |
from oslo_log import log as logging
from trove.cluster import models as cluster_models
import trove.common.apischema as apischema
from trove.common import cfg
from trove.common import exception
from trove.common.i18n import _
from trove.common import notification
from trove.common.notification import StartNotification... | {
"content_hash": "6a669a8a5191aca77eda2caaa297b26a",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 79,
"avg_line_length": 44.20347394540943,
"alnum_prop": 0.5859436398338386,
"repo_name": "openstack/trove",
"id": "50b4138b994b3c4471f4333aa825734d633c3ce3",
"size": "1843... |
import time
def RateLimited(maxPerSecond):
minInterval = 1.0 / float(maxPerSecond)
def decorate(func):
lastTimeCalled = [0.0]
def rateLimitedFunction(*args,**kargs):
elapsed = time.clock() - lastTimeCalled[0]
leftToWait = minInterval - elapsed
if leftToWait>0... | {
"content_hash": "8f3ede59eb40802216311e061df6b0c3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 61,
"avg_line_length": 29.56,
"alnum_prop": 0.591339648173207,
"repo_name": "voidabhi/python-scripts",
"id": "098a57975a29841881307544041530ccaa225a37",
"size": "739",
"b... |
import logging
import json
import six
import copy
import datetime
from django.http import HttpResponse
from django.utils.decorators import method_decorator, classonlymethod
from django.views.generic import View
from elasticsearch.exceptions import ElasticsearchException
from casexml.apps.case.models import CommCareCa... | {
"content_hash": "7d317ae20f279c1c3ba7b08fe23e2080",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 208,
"avg_line_length": 38.807575757575755,
"alnum_prop": 0.5589739585366806,
"repo_name": "qedsoftware/commcare-hq",
"id": "90ea3d1624d36c242f5c54fb178f487f3d5dc93b",
"si... |
"""
Merge runs of KLEE. Optionally merging coverage and bug replay
information
"""
import argparse
import logging
import pprint
import copy
import os
import sys
import yaml
from load_klee_analysis import add_kleeanalysis_to_module_search_path
from load_klee_runner import add_KleeRunner_to_module_search_path
add_kleean... | {
"content_hash": "0c55e2e3ab0aaa466508024ea5b5e4ec",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 108,
"avg_line_length": 40.12865497076023,
"alnum_prop": 0.6250850092295736,
"repo_name": "delcypher/klee-runner",
"id": "4cd66121c05c002fd3b793f2c6db0ebaf352add4",
"size"... |
import os
import sys
### Make sure to find the Spirit modules
### This is only needed if you did not install the package
spirit_py_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), "../core/python"))
sys.path.insert(0, spirit_py_dir)
### Import Spirit modules
from spirit import state
from spirit import ... | {
"content_hash": "676fbe819587895f6e6c8a52adac984e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 92,
"avg_line_length": 32.1,
"alnum_prop": 0.7175493250259606,
"repo_name": "spirit-code/spirit",
"id": "37aafc2bfe27d5fe8f207d5d041d18d37c8e8f82",
"size": "963",
"binary... |
from oslo.serialization import jsonutils
from oslo_config import cfg
from oslo_log import log as logging
import six
import webob.exc
from wsme.rest import json
from daisy.api import policy
from daisy.api.v2 import metadef_namespaces as namespaces
from daisy.api.v2.model.metadef_object import MetadefObject
from daisy.a... | {
"content_hash": "8386e91e5a2f7585377ba442d5c707cc",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 78,
"avg_line_length": 37.030959752321984,
"alnum_prop": 0.6148315358247638,
"repo_name": "OpenDaisy/daisy-api",
"id": "aed3d8c1c8d9b8286869487276acfa5e04170cb6",
"size": ... |
"""Adds config flow for Tibber integration."""
import asyncio
import logging
import aiohttp
import tibber
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOM... | {
"content_hash": "69fc15867b0691a09b73eb8b21e71c5c",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 88,
"avg_line_length": 33.13235294117647,
"alnum_prop": 0.6284953395472703,
"repo_name": "mKeRix/home-assistant",
"id": "b0115d84e2c8afead73189b1678cd574c576fac4",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.