text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Reattach URLs/Evidences from Comments to Assessments
Create Date: 2017-01-04 10:04:18.770087
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
# revision identifiers, used by Alembic.
revision = '4aa9f2ee7969'
down_revision =... | {
"content_hash": "d75e0ee0d0b5f74bcbe9dc009dbcc90c",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 38.226890756302524,
"alnum_prop": 0.5990327544515278,
"repo_name": "VinnieJohns/ggrc-core",
"id": "6cc2711e643dcfac20db586c4efe096ff3ef635f",
"size"... |
import os
import ssl
import sys
import logging
import datetime
from tornado import httpserver, ioloop, netutil, web
def start_server(app: web.Application, https_port: int = 443):
""" Try to start an HTTPS server
:param app: tornado.web.Application to use
:param https_port: int the port number to use for ... | {
"content_hash": "ac83516124fa4adda8626dc8ac348aa7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 120,
"avg_line_length": 40.72093023255814,
"alnum_prop": 0.6790405482581382,
"repo_name": "emeric254/CMangosAdminServer",
"id": "c8dc0f3147a71cc17bb68eb346ca4547ab5f8658",
... |
"""This example generates forecast metrics for a keyword plan.
To create a keyword plan, run the add_keyword_plan.py example.
"""
import argparse
import sys
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
# [START generate_forecast_metrics]
def ma... | {
"content_hash": "1206755771a0f0393ee83c88b58ca0a3",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 77,
"avg_line_length": 33.03703703703704,
"alnum_prop": 0.640881913303438,
"repo_name": "googleads/google-ads-python",
"id": "a6691d256c9b3aee61cf90f43d0b70a848460e2a",
"si... |
from django import forms
from django.core.validators import validate_slug
class SubmissionForm(forms.Form):
submission = forms.CharField(
max_length=144,
validators=[validate_slug],
label='Suggest Topic',
required=True,
help_text='144 characters max',
widget=forms.T... | {
"content_hash": "ddc77175fdeb1c93a76037954993caa7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 85,
"avg_line_length": 32,
"alnum_prop": 0.6692708333333334,
"repo_name": "CSUChico-CINS465/CINS465-Fall2016-Lecture-Examples",
"id": "497f43695cbedb08c670534ad2f10a4bbb52375... |
from calvin.runtime.south.async import async
from calvin.runtime.south.async import server_connection
from calvin.runtime.south.async import threads
from calvin.utilities.calvinlogger import get_logger
import pytest
import socket
_log = get_logger(__name__)
def data_available(conn):
first_print = True
while... | {
"content_hash": "0caacdadc8de685aa9df2d72cf3a89e1",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 117,
"avg_line_length": 35.84,
"alnum_prop": 0.5895647321428571,
"repo_name": "EricssonResearch/calvin-base",
"id": "f61580345563b587bcdf508faa855cf18df518f9",
"size": "77... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Event.url'
db.add_column('multilingual_events_event', 'url',
self.gf('django.db.models.fields.... | {
"content_hash": "1d392105494e976ca8ba1052b69e9f5f",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 182,
"avg_line_length": 77.0377358490566,
"alnum_prop": 0.5564535880480039,
"repo_name": "bitmazk/django-multilingual-events",
"id": "6abbeb79bda6392c31fc1fbed8ccbff2b09fab2... |
from flask import Blueprint, render_template, session, redirect, url_for, \
request, flash, g, jsonify, abort, current_app
from flask.ext.principal import identity_changed, identity_loaded, Identity, \
AnonymousIdentity, RoleNeed
from NHDH import app
from NHDH.database import db_session
from NHDH.mode... | {
"content_hash": "ec2dc248cdbea4a23ca257a4bd8a5a8e",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 80,
"avg_line_length": 27.5,
"alnum_prop": 0.6411326378539494,
"repo_name": "monk-ee/NHDH",
"id": "69b43b803ca9def590e5986e858854a3328bab3f",
"size": "3355",
"binary": f... |
import os.path
PROJECT_DIR = os.path.dirname(__file__)
STATIC_DOC_ROOT = os.path.join(PROJECT_DIR, "static")
STATICFILES_DIRS = (os.path.join(PROJECT_DIR, "static"),
)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode... | {
"content_hash": "42e28254ad0312f1171f46feb0a09459",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 224,
"avg_line_length": 34.88148148148148,
"alnum_prop": 0.6893183266086218,
"repo_name": "davebridges/ExperimentDB",
"id": "92d2e33f7e804e203be396f2b9ce0c315c27d4c2",
"si... |
"""
WSGI config for eucapp project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | {
"content_hash": "33b621f4ed7ffd8bc1d8fb8df80e222d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 44.34375,
"alnum_prop": 0.7928118393234672,
"repo_name": "eucalyptus/eucalyptopotamus",
"id": "9442fdfa3cf3a9b93c98402737a0a2128657d524",
"size": "14... |
"""
Application Load Balancers
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import logging
import six
from collections import defaultdict
from c7n.actions import ActionRegistry, BaseAction, ModifyVpcSecurityGroupsAction
from c7n.exceptions import PolicyValidationE... | {
"content_hash": "7649902528f80a5c7234d0deaf5b40bb",
"timestamp": "",
"source": "github",
"line_count": 1023,
"max_line_length": 109,
"avg_line_length": 33.78103616813294,
"alnum_prop": 0.5868105793159326,
"repo_name": "kapilt/cloud-custodian",
"id": "798271a94ad009d3dc4e032a4d86f9ed5de573b4",
"siz... |
import config
import json
import datetime
import time
import hashlib
import atexit
from sets import Set
try:
from flask import Flask
from flask import jsonify, render_template, request
except ImportError:
print '[X] Please install Flask:'
print ' $ pip install flask\n'
exit()
try:
import ser... | {
"content_hash": "036eea2d976742c532079ed136221c63",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 76,
"avg_line_length": 23.551470588235293,
"alnum_prop": 0.5916328442085544,
"repo_name": "fniephaus/SimpleHomeAutomation",
"id": "475e89828eac58d9cb7641cb7d7310baaaf1588b",... |
import discretize
from scipy.constants import mu_0
from SimPEG import maps, tests, utils
from SimPEG.electromagnetics import frequency_domain as fdem
from SimPEG.electromagnetics.utils import omega
try:
from pymatsolver import Pardiso as Solver
except ImportError:
from SimPEG import Solver as SolverLU
import ... | {
"content_hash": "a98d59ab77feec5c0af8c839961e6bba",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 86,
"avg_line_length": 31.116504854368934,
"alnum_prop": 0.5790951638065522,
"repo_name": "simpeg/simpeg",
"id": "aa1a382b7de309fb354f521d3209c2528a3af9b2",
"size": "9660"... |
"""CelebA."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import zipfile
# Dependency imports
from tensor2tensor.data_generators import generator_utils
from tensor2tensor.data_generators import image_utils
from tensor2tensor.utils import reg... | {
"content_hash": "3ffab2320c859197308d3a8c92e421ed",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 97,
"avg_line_length": 35.23391812865497,
"alnum_prop": 0.6582572614107883,
"repo_name": "rsepassi/tensor2tensor",
"id": "7fd3bddb5cea41fb34e96d67b112042fd24cc210",
"size"... |
def extractWwwBlexbinNet(item):
'''
Parser for 'www.blexbin.net'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Loiterous... | {
"content_hash": "4fbd75b1e97660f002c198fa28960dc9",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 25.761904761904763,
"alnum_prop": 0.6229205175600739,
"repo_name": "fake-name/ReadableWebProxy",
"id": "8d8c21dc1200f38ce5c3c1775f5bea6885493e8d",
"... |
from pyduino import *
# Imports Généraux
import time, sched
import os
import threading
import signal
import json
import sys
# Pour la détection d'adresse IP
import socket
import fcntl
import struct
# Pour le serveur de socket
import tornado.httpserver
import tornado.ioloop
from tornado.ioloop import PeriodicCallback... | {
"content_hash": "972b2e57233e83704872ff823046d51e",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 304,
"avg_line_length": 35.120370370370374,
"alnum_prop": 0.6314790403374637,
"repo_name": "3sigma/T-Quad-Quatre-Roues",
"id": "4da9eece7742f5ad2c40408b19edc1903b3af37f",
... |
from PIL import Image
import os
from sklearn import svm, metrics
import numpy as np
def doSVM(img_train, target_train, img_test, target_test):
classifier = svm.SVC(gamma=0.001)
classifier.fit(img_train, target_train)
expected = target_test
predicted = classifier.predict(img_test)
print("Classifi... | {
"content_hash": "80308778ab2fe761661e5dc46f7d076d",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 155,
"avg_line_length": 34.93150684931507,
"alnum_prop": 0.6250980392156863,
"repo_name": "MagicUmom/pattern_recognition_project",
"id": "0134859a510af6bb20bc5e9862b490ff04cd... |
import logging
import sys
import threading
import traceback
logger = logging.getLogger("pykka")
__all__ = ["log_thread_tracebacks"]
def log_thread_tracebacks(*args, **kwargs):
"""Logs at :attr:`logging.CRITICAL` level a traceback for each running
thread.
This can be a convenient tool for debugging dea... | {
"content_hash": "5dfb294d61e6894ab658ec6b7e6555ae",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 78,
"avg_line_length": 35.17741935483871,
"alnum_prop": 0.692801467216873,
"repo_name": "jodal/pykka",
"id": "230baf122a3b3e8bf51a5fa63d23765b2b8cbfb9",
"size": "2181",
"... |
from string import Template
from pyPaSWAS.Core import resource_filename, read_file
class Code(object):
'''
Initializes the CUDA code by setting configuration parameters using the CUDA
templates located in Core/cuda
'''
def __init__(self, logger):
self.logger = logger
self.shared_xy... | {
"content_hash": "4069a7ac260db20967f4f4f1a172a2b6",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 132,
"avg_line_length": 48.854166666666664,
"alnum_prop": 0.5656005685856432,
"repo_name": "swarris/pyPaSWAS",
"id": "b2f871ae14158b1525104b9fe802ca1e1739ab57",
"size": "7... |
import voxie
#
# Copyright (c) 2014-2022 The Voxie Authors
#
# 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, modif... | {
"content_hash": "85796791992a4f3f95b779fb063805d8",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 248,
"avg_line_length": 41.66066066066066,
"alnum_prop": 0.6210624954948462,
"repo_name": "voxie-viewer/voxie",
"id": "dd24bc7dafabc9ebd713406e63de6a3963171135",
"size": "... |
"""
Copyright (c) 2015 Michael Bright and Bamboo HR LLC
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... | {
"content_hash": "65b424ec9a0101263b276cd6d983b63b",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 172,
"avg_line_length": 35.927083333333336,
"alnum_prop": 0.5407364453464772,
"repo_name": "BambooHR/rapid",
"id": "d5b762622348fe933a87ef764adc808376aa1cf1",
"size": "689... |
from msrest.serialization import Model
class EventsResults(Model):
"""An events query result.
:param odatacontext: OData context metadata endpoint for this response
:type odatacontext: str
:param aimessages: OData messages for this response.
:type aimessages: list[~azure.applicationinsights.model... | {
"content_hash": "ca1060b486f69dd3fb67236179c445b0",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 97,
"avg_line_length": 38.52,
"alnum_prop": 0.6542056074766355,
"repo_name": "Azure/azure-sdk-for-python",
"id": "97e9c80082cd921d7d99426ca14d0144cee7f43d",
"size": "1437",... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = r'''
---
module: vmware_host_vmnic_info
short_description: Gathers info about vmnics available on the ... | {
"content_hash": "6e3cdbcb10942a16befb422c048e5432",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 123,
"avg_line_length": 44.512903225806454,
"alnum_prop": 0.5037321545039496,
"repo_name": "thaim/ansible",
"id": "b2e1bc7dea52e33c2517badc946ab7f3214f95fc",
"size": "1406... |
from __future__ import with_statement
import os
import sys
from fabric import api as fab
from fabric.contrib import files as fab_files
from fab_deploy.utils import run_as
from ..base import _, Daemon, Ubuntu
from ..deployment import command
from ..utils import upload_template, upload_first
class Redis(Daemon):
... | {
"content_hash": "bd9ec098f0eb261717616bca25729ad9",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 50,
"avg_line_length": 22.608695652173914,
"alnum_prop": 0.7288461538461538,
"repo_name": "suvit/speedydeploy",
"id": "0f8010d0a5dcdf11018b45183d40ff08869ff1a3",
"size": "5... |
from logging import getLogger
from functools import partial
from operator import attrgetter
from collections import OrderedDict
import gevent
from gevent_tasks.errors import ForeverRuntimeError, TaskKeyError
from gevent_tasks.pool import TaskPool
from gevent_tasks.tasks import Task
from gevent_tasks.timing import Timi... | {
"content_hash": "154aba359d2bc2072d14393c7f9877e9",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 93,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.5446766496626625,
"repo_name": "blakev/gevent-tasks",
"id": "63377c0df561622e6085ea6f4ab55f14b59cbb80",
"size": ... |
"""
.. _l-logreg-example:
Train, convert and predict with ONNX Runtime
============================================
This example demonstrates an end to end scenario
starting with the training of a machine learned model
to its use in its converted from.
.. contents::
:local:
Train a logistic regression
++++++++... | {
"content_hash": "ec3870cbb8e76e8ac43b0bba2dc22b15",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 107,
"avg_line_length": 28.47457627118644,
"alnum_prop": 0.6352678571428572,
"repo_name": "microsoft/onnxruntime",
"id": "b5033b503b3ebf4aff6c5ac6c0c65abf0132036a",
"size"... |
from machine import Pin
from neopixel import NeoPixel
from time import sleep
LED_PIN = 5
NUM_OF_LEDS = 6
PIN = Pin(LED_PIN, Pin.OUT)
NEOPIXEL = NeoPixel(PIN, NUM_OF_LEDS)
def init():
states = {}
leds = list(range(0, NUM_OF_LEDS))
for led in leds:
states[led] = 0
return states, leds
def on_off(states, leds):
w... | {
"content_hash": "1250ab37b5904426cfe7c41fd9f65c81",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 62,
"avg_line_length": 21.06382978723404,
"alnum_prop": 0.6141414141414141,
"repo_name": "kevinpanaro/esp8266_micropython",
"id": "d82f91f6fa336a9d3d834e5a6fd1728690e13803",
... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-Dmoskupols',
# THIS IS IMPO... | {
"content_hash": "29b6a1065b21d27b913452bb85026399",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 79,
"avg_line_length": 31.705263157894738,
"alnum_prop": 0.651394422310757,
"repo_name": "moskupols/image-labeling-benchmark",
"id": "a0ed5ee725dd8585e8ad08bd195fd128e5c646b4... |
from __future__ import unicode_literals
from __future__ import print_function
from ..compat import implements_to_string, text_type
class MoyaRuntimeError(Exception):
def __init__(self):
pass
@implements_to_string
class MissingTemplateError(Exception):
hide_py_traceback = True
error_type = "Miss... | {
"content_hash": "23e97288b1759a4beeed99caf360d7ce",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 178,
"avg_line_length": 23.687074829931973,
"alnum_prop": 0.6122917863296956,
"repo_name": "moyaproject/moya",
"id": "f46b6aa75b708fe8393e057c6f43d444acfe4936",
"size": "3... |
from os import path
import numpy as np
from vispy import app, gloo
from vispy.util.transforms import perspective, translate, rotate
from vispy.io import load_data_file, read_mesh, load_crate
VERT_COLOR_CODE = """
// Uniforms
// ------------------------------------
uniform mat4 u_model;
uniform mat4 u_view;
uniform... | {
"content_hash": "9e7863ab5613222156a2ada4f28b7c1f",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 79,
"avg_line_length": 25.114093959731544,
"alnum_prop": 0.5758952431854624,
"repo_name": "jay3sh/vispy",
"id": "4110d2f784bc95d32ef58e7f05b39aefea565278",
"size": "3743",... |
import lacuna.bc
import lacuna.building
import lacuna.ship
class miningministry(lacuna.building.MyBuilding):
path = 'miningministry'
def __init__( self, client, body_id:int = 0, building_id:int = 0 ):
super().__init__( client, body_id, building_id )
@lacuna.building.MyBuilding.call_returning_meth... | {
"content_hash": "2e3f67a605caad5ec4fd4aec4400d96b",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 82,
"avg_line_length": 35.21705426356589,
"alnum_prop": 0.5694475016508915,
"repo_name": "tmtowtdi/MontyLacuna",
"id": "00704aa20bc107b4810ae63e4e2e598e73a265a0",
"size": ... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ITDB_Main', '0015_musical_numbers'),
]
operations = [
migrations.CreateModel(
name='Musical_Number',
fields=[
... | {
"content_hash": "4a3d81725367d0a03c49bff12c47f0a4",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 114,
"avg_line_length": 29.606060606060606,
"alnum_prop": 0.5445240532241555,
"repo_name": "Plaudenslager/ITDB",
"id": "c0bd1684e4e94fae35eb85f5bad6acff61d85fc7",
"size": "... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "haas.settings.production")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "53bcc80216b0b5f47f557626deffad14",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 79,
"avg_line_length": 26.22222222222222,
"alnum_prop": 0.7161016949152542,
"repo_name": "uranusjr/bbshighlighter",
"id": "02a9c9675961e00ed03095bbba46c2c1c4dccfff",
"size":... |
from globals import *
import life as lfe
import camps
import brain
import logging
def camp_has_raid(camp_id):
if camps.get_camp(camp_id)['raid']:
return True
return False
def create_raid(camp_id, raiders=[], join=None):
_camp = camps.get_camp(camp_id)
if not camp_has_raid(camp_id):
_camp['raid'] = {'st... | {
"content_hash": "34a06993f1b643262a125e079e331f20",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 97,
"avg_line_length": 27.353846153846153,
"alnum_prop": 0.641169853768279,
"repo_name": "flags/Reactor-3",
"id": "691d718a5701170d98da90d4ad0d63375f3532ab",
"size": "1778"... |
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys... | {
"content_hash": "ef8a193208f276167f7813e9fc035271",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 79,
"avg_line_length": 31.949458483754512,
"alnum_prop": 0.703728813559322,
"repo_name": "fillest/sapyens",
"id": "f40bfe0372d051386a4943fd014721d49de2ba62",
"size": "9270... |
from normalization import minmax
import os as os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import PIL.Image as Image
import math as math
def create_font(fontname='Tahoma', fontsize=10):
return { 'fontname': fontname, 'fontsize':fontsize }
def plot_gray(X, sz=None, filename=... | {
"content_hash": "54641467ed2e46a9919ba02d68a95399",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 145,
"avg_line_length": 36.24691358024691,
"alnum_prop": 0.6055858310626703,
"repo_name": "revan/facerecserver",
"id": "70edfb144e5bed2a6f6f00e9f477b7a6313850b1",
"size": "... |
"""
Masked Linear module: A fully connected layer that computes an adaptive binary mask on the fly.
The mask (binary or not) is computed at each forward pass and multiplied against
the weight matrix to prune a portion of the weights.
The pruned weight matrix is then multiplied against the inputs (and if necessary, the ... | {
"content_hash": "d71f5b0d79384c9828620756b8522d2b",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 105,
"avg_line_length": 42.12903225806452,
"alnum_prop": 0.5921388463501787,
"repo_name": "huggingface/pytorch-transformers",
"id": "298c7e5e51de02b3538ff62f2580d2b9b4836bf6"... |
from setuptools import setup, find_packages
import re
module_file = open("teuthology/__init__.py").read()
metadata = dict(re.findall(r"__([a-z]+)__\s*=\s*['\"]([^'\"]*)['\"]", module_file))
long_description = open('README.rst').read()
setup(
name='teuthology',
version=metadata['version'],
packages=find_pa... | {
"content_hash": "6bcf13a035f37d98e4df37e5e32745e6",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 90,
"avg_line_length": 40.63970588235294,
"alnum_prop": 0.5274108919848018,
"repo_name": "dmick/teuthology",
"id": "e595da4a646751bf285d20eb0f00f7cbd6fd29b8",
"size": "552... |
"""Unit tests for cross-language parquet io read/write."""
# pytype: skip-file
from __future__ import absolute_import
from __future__ import print_function
import logging
import os
import re
import unittest
from nose.plugins.attrib import attr
import apache_beam as beam
from apache_beam import coders
from apache_b... | {
"content_hash": "4eca2880afa7c8e89f735be4da6c1cb6",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 30.68,
"alnum_prop": 0.675793133420252,
"repo_name": "iemejia/incubator-beam",
"id": "3c0b6dd3ef04fa44e110238c4b587da0b23ae694",
"size": "3086",
"b... |
from __future__ import absolute_import, division, print_function, unicode_literals
import pure_interface
import unittest
import inspect
import types
from typing import Dict, Any
class IAnimal(pure_interface.PureInterface):
def speak(self, volume):
pass
class IPlant(pure_interface.PureIn... | {
"content_hash": "fe2da01886a0215fbffb828d5e21a2b9",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 89,
"avg_line_length": 31.534591194968552,
"alnum_prop": 0.586158755484643,
"repo_name": "tim-mitchell/pure_interface",
"id": "98cbb83c6a6eb26af856fa3783391b4fb0ce1dc2",
"... |
import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.di... | {
"content_hash": "c013521f3f8a801061ab2a81fcef618e",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 147,
"avg_line_length": 29.31578947368421,
"alnum_prop": 0.5553560742070617,
"repo_name": "mikehulluk/mredoc",
"id": "5eea13c87a6c5849712a92b70c6f387e5671df58",
"size": "16... |
'''
:maintainer: HubbleStack / madchills
:maturity: 2016.7.0
:platform: Windows
:requires: SaltStack
'''
from __future__ import absolute_import
import copy
import csv
import fnmatch
import logging
import salt.utils
import salt.utils.platform
log = logging.getLogger(__name__)
__virtualname__ = 'win_auditpol'
def ... | {
"content_hash": "5cee86863b96f217fa23a5ab4fddb48e",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 146,
"avg_line_length": 39.8421052631579,
"alnum_prop": 0.48252672030743365,
"repo_name": "hubblestack/hubble-salt",
"id": "2c8069979e7e713df6f3742a6c29953c25a74e9d",
"siz... |
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, redirect
from django.template import Template, Context, RequestContext
from django.core.mail import send_mail
from starl.forms import *
from starl.models import *
from starl.views import *
from forms import *
i... | {
"content_hash": "97d9490282bffa3e1cedb73e903f7c87",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 135,
"avg_line_length": 46.770114942528735,
"alnum_prop": 0.6647825018432048,
"repo_name": "selboo/starl-mangle",
"id": "da0958d13fddaf4e2239136c49e0a932b49a83f0",
"size": ... |
'''
------------------------------------------------------------------------------
Copyright (c) 2015 Microsoft Corporation
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... | {
"content_hash": "338fd0b1947472cb228889bbb101f70c",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 96,
"avg_line_length": 38.57258064516129,
"alnum_prop": 0.6583734058122517,
"repo_name": "OneDrive/onedrive-sdk-python",
"id": "d432f721b272f5c2d29ed47ecb2e953f9e498260",
... |
from grafanalib.core import (
BarGauge,
ConstantInput,
DataSourceInput,
GaugePanel,
Heatmap,
HeatmapColor,
RowPanel,
Stat,
Threshold,
YAxis,
)
from grafanalib import formatunits as UNITS
from scalgrafanalib import layout, Tooltip, Target, TimeSeries, Dashboard
STATUS_CODE_2XX ... | {
"content_hash": "d0c20ad6516f61d87949ffe1c00a17c2",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 131,
"avg_line_length": 33.260416666666664,
"alnum_prop": 0.58795281344608,
"repo_name": "scality/backbeat",
"id": "aa65d91d790a2f50824b9641323ba5f1f748e4cb",
"size": "957... |
import os, json, inspect, sys
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.db import models
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from django.views.generic.lis... | {
"content_hash": "5629d08abb39358d9e4525d7f05559f3",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 124,
"avg_line_length": 39.30555555555556,
"alnum_prop": 0.543904593639576,
"repo_name": "fmarco/django-lite",
"id": "5250b7eec79c38a04d5cf5b5b43c494b192c2023",
"size": "1... |
__version__ = "1.0.0"
__author__ = "Akhier Dragonheart"
__license__ = "MIT"
__all__ = ("Manager, SystemTemplate")
from .Manager import Manager
from .SystemTemplate import SystemTemplate
| {
"content_hash": "5f4e58412596ec4c8436615c3d2cf513",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.6898395721925134,
"repo_name": "Akhier/JourneyIntoGostOnol",
"id": "23393c145743c28034d88af987f32bd3a1f7faaf",
"si... |
"""Test for the sqlite3 data connector."""
from unittest import TestCase
from tests.dc.test import AbstractDCTest
from dc.sqlite3.connector import Sqlite3Connector
class DCTest(AbstractDCTest, TestCase):
name = "sqlite3"
connector = Sqlite3Connector
| {
"content_hash": "2e614612fb6754bbad1b5369c25b79f1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 24.181818181818183,
"alnum_prop": 0.7669172932330827,
"repo_name": "v-legoff/pa-poc1",
"id": "4372fd7ae842347f5b2c4f3e5d3f4ae467e67194",
"size": "180... |
"""This module contains the general information for FirmwareBootDefinition ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class FirmwareBootDefinitionConsts:
TYPE_ADAPTOR = "adaptor"
TYPE_BLADE_BIOS = "blade-bios"
... | {
"content_hash": "9802aa4283551ed1865b43b3a8fc7f74",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 284,
"avg_line_length": 49.61538461538461,
"alnum_prop": 0.6142118863049095,
"repo_name": "ragupta-git/ImcSdk",
"id": "157b9fd62ddb89b2f085f663bf6af4a219605024",
"size": "3... |
from django.conf.urls import patterns, include, url
from about.views import MainView
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', MainView.as_v... | {
"content_hash": "90903e7150897b702328a33858f5a65c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 108,
"avg_line_length": 36.12,
"alnum_prop": 0.6699889258028793,
"repo_name": "m-clark/mclarkpw",
"id": "e7cf1bc288901769d3f4ee1a46d2c793d53abd76",
"size": "903",
"binary... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from orcid_api_... | {
"content_hash": "5185f4a282d393dca62da1cfb7d05b21",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 201,
"avg_line_length": 35.452,
"alnum_prop": 0.6224754597765993,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "619a410a2485e1d4b415745c8b55c650cb1e18f1",... |
def extractKtranslations980580331WordpressCom(item):
'''
Parser for 'ktranslations980580331.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
chp_prefixes = [
('Dragon’s Legacy – ', ... | {
"content_hash": "28ff635fa001c28cb7bb3efb8dbbeb33",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 120,
"avg_line_length": 38.86363636363637,
"alnum_prop": 0.6163742690058479,
"repo_name": "fake-name/ReadableWebProxy",
"id": "eac92a702fe7c8e86c315e5d06a28ea1976cb5a1",
"s... |
import asyncio
import json
import base64
from . import AbstractStorage, Session
from Crypto.Cipher import AES
from Crypto import Random
class EncryptedCookieStorage(AbstractStorage):
"""Encrypted JSON storage.
"""
def __init__(self, secret_key, *, cookie_name="AIOHTTP_SESSION",
domain=N... | {
"content_hash": "a2c45d74493a1ad1d23f40344d1ec268",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 73,
"avg_line_length": 36.6551724137931,
"alnum_prop": 0.587958607714017,
"repo_name": "graingert/aiohttp_session",
"id": "5a9f9b6f54d7d8aeee2ce1702eb0d617780261ff",
"size"... |
class HelloWorld(object):
"""
Simple test of the basic architecture of the project.
"""
def __init__(self, text='Hello world!'):
"""
Create an empty HelloWorld object.
@param text: text to print. Set to 'Hello world!' if ommitted.
"""
self._text = text
def p... | {
"content_hash": "2523ee8c2c74a754bde0f6422559d467",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 26.705882352941178,
"alnum_prop": 0.5572687224669604,
"repo_name": "MatthewPeterKelly/numerical-methods-in-python",
"id": "be7039e1d76b4d8842217d4269ce... |
"""Pickle field implementation for Django."""
from copy import deepcopy
from base64 import b64encode, b64decode
from zlib import compress, decompress
try:
from cPickle import loads, dumps
except ImportError:
from pickle import loads, dumps
from django.db import models
from django.utils.encoding import force_u... | {
"content_hash": "e010179a1b8aa58226f0a170758ff00e",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 90,
"avg_line_length": 42.473684210526315,
"alnum_prop": 0.6685254027261462,
"repo_name": "Haikson/virtenviro",
"id": "1ed9d2e6bbad6c52813f636f5a9c639273131b38",
"size": "... |
"""Generates pybind11 bindings code for functions."""
from typing import Generator, List, Optional
from clif.protos import ast_pb2
from clif.pybind11 import utils
I = utils.I
UNARY_OPS = {
'__neg__': ('operator-', '-'),
'__pos__': ('operator+', '+'),
'__inv__': ('operator~', '~'),
'__invert__': ('op... | {
"content_hash": "3f3a64284d49601fc1811166a2d73d23",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 83,
"avg_line_length": 35.663636363636364,
"alnum_prop": 0.600815702268672,
"repo_name": "google/clif",
"id": "9f61e3fed0d4169fe526c364104f8a18acd68534",
"size": "8421",
... |
import sys
import os
import shlex
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
# 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... | {
"content_hash": "ed05c61b4636ada9dc18f11801230e8d",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 79,
"avg_line_length": 31.528301886792452,
"alnum_prop": 0.6817275084779573,
"repo_name": "jojonas/py1090",
"id": "00ddef18be148d14799252ae827be07fa67286c7",
"size": "1048... |
"""models Fastly API concepts
No dependencies on Terraform should be in this module"""
from collections import namedtuple
import re
import os
class FastlyVCL:
@classmethod
def from_string(cls, content):
return cls(content.splitlines())
def __init__(self, lines):
self._lines = lines
... | {
"content_hash": "8bff8d3e93a1cb38fcade9ba98b727e3",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 129,
"avg_line_length": 33.37956204379562,
"alnum_prop": 0.6055106057292805,
"repo_name": "elifesciences/builder",
"id": "9363d059d450eac27b71400b1a06f585f687996b",
"size"... |
from django.conf.urls import url, include
from django.contrib import admin
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name="index.html"), name='Index'),
url(r'^api/v1/', include('contacts.urls')),
url(r'^admin/', admin.site.urls),
]
| {
"content_hash": "d311ce8632ce9083695cad06f2b83f72",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 79,
"avg_line_length": 30.7,
"alnum_prop": 0.7003257328990228,
"repo_name": "topix-hackademy/contact-tools",
"id": "95220854a6e9a509c64bf5d5ea216fc388fa60b7",
"size": "307"... |
import datetime
import os
import sys
sys.path.append(os.path.abspath('../'))
from filer import __version__
# 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... | {
"content_hash": "df2445515c3a562bad8861a91c1a5458",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 84,
"avg_line_length": 32.37155963302752,
"alnum_prop": 0.70242312597421,
"repo_name": "webu/django-filer",
"id": "f8723efad2555c3051f012c4040199f5a9c9dc54",
"size": "7456... |
import asyncio
import logging
import sys
from datetime import datetime
from pathlib import Path
from shutil import rmtree, which
from tempfile import gettempdir
from typing import Any, Union
import click
from black_primer import lib
DEFAULT_CONFIG = Path(__file__).parent / "primer.json"
_timestamp = datetime.now().... | {
"content_hash": "b16e10f31124ba16340214d62f018d8f",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 84,
"avg_line_length": 24.075757575757574,
"alnum_prop": 0.6214600377595972,
"repo_name": "TeamSPoon/logicmoo_workspace",
"id": "5903adc72d4867553c520ed1a9e05b5101c9bda4",
... |
import utaka.src.core.Object as Object
import utaka.src.accessControl.ObjectACP as ObjectACP
import utaka.src.accessControl.BucketACP as BucketACP
import utaka.src.logging.BucketLog as BucketLogging
import utaka.src.exceptions.ForbiddenException as ForbiddenException
def getObject(user, bucket, key, getMetadata, getDa... | {
"content_hash": "0dcfb98f806edd3770a9ffe8a492b3cb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 278,
"avg_line_length": 63.166666666666664,
"alnum_prop": 0.8120052770448549,
"repo_name": "mattmillr/utaka",
"id": "ef88009201e990638d46ddf384486e1d79ba7fd2",
"size": "303... |
import os
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
def main():
init_app(set_backends=True, routes=False)
populate_confere... | {
"content_hash": "3019f508e20266f3454821b4c55731c9",
"timestamp": "",
"source": "github",
"line_count": 702,
"max_line_length": 156,
"avg_line_length": 32.686609686609685,
"alnum_prop": 0.5305935675063191,
"repo_name": "GageGaskins/osf.io",
"id": "de9c4f98b86c9129d8118bad2ebb6a6ed90b3ab5",
"size": ... |
from __future__ import absolute_import
import json
import pprint
import logging
import boto3
import requests
from snooze.constants import GITHUB_HEADERS
try:
basestring
except NameError:
basestring = str
class RepositoryListener(object):
"""Sets up infrastructure for listening to a Github repository."... | {
"content_hash": "b1d877f555daa465cb337471b9f4ef74",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 94,
"avg_line_length": 37.18604651162791,
"alnum_prop": 0.5700437773608505,
"repo_name": "tdsmith/github-snooze-button",
"id": "c213cc874269fc61004ecd9938ae352486858dbf",
... |
from vumi.tests.helpers import VumiTestCase
from go.vumitools.tests.helpers import djangotest_imports
with djangotest_imports(globals()):
from django import forms
from go.apps.rapidsms.view_definition import (
EndpointsField, RapidSmsForm, AuthTokensForm, EditRapidSmsView,
ConversationViewDef... | {
"content_hash": "e9063ae81c33ebac0dfabe2d3d8d08fa",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 73,
"avg_line_length": 33.568,
"alnum_prop": 0.5900857959961868,
"repo_name": "praekelt/vumi-go",
"id": "0c315ae97c15994e827185467f1ef39fa969e3ea",
"size": "4196",
"bina... |
import os
import re
import shutil
import logging
from migrate.versioning import exceptions, pathed, script
log = logging.getLogger(__name__)
class VerNum(object):
"""A version number that behaves like a string and int at the same time"""
_instances = dict()
def __new__(cls, value):
val = str(v... | {
"content_hash": "1e70e49c503fb5c6af8e2296255e1991",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 81,
"avg_line_length": 31.03791469194313,
"alnum_prop": 0.5693999083829593,
"repo_name": "denny820909/builder",
"id": "04445a3b39f331f31bdc9c443ba3ab26345f324d",
"size": "... |
try:
from . import generic as g
except BaseException:
import generic as g
class CreationTest(g.unittest.TestCase):
def setUp(self):
engines = []
if g.trimesh.util.has_module('triangle'):
engines.append('triangle')
if g.trimesh.util.has_module('mapbox_earcut'):
... | {
"content_hash": "fec97d34d5dc6905fd08fabfb0fc50ed",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 77,
"avg_line_length": 36.57236842105263,
"alnum_prop": 0.523295556754812,
"repo_name": "mikedh/trimesh",
"id": "f1e265da1a51d0d72a3489e7313d2df1339cfe0c",
"size": "11118"... |
import pytest
@pytest.fixture(scope="package")
def salt_eauth_account(salt_eauth_account_factory):
with salt_eauth_account_factory as account:
yield account
| {
"content_hash": "ea0f11955aa3453e5c9200af7d41d6de",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 51,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.7426900584795322,
"repo_name": "saltstack/salt",
"id": "48554dda4d8c632e0ba76e877bc9dd46cdf49488",
"size": "171",
... |
import os
from django.core.wsgi import get_wsgi_application
try:
import newrelic.agent
newrelic.agent.initialize()
newrelic.agent.capture_request_params()
except Exception as e:
print("newrelic couldn't be initialized:", e)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web.settings")
application... | {
"content_hash": "3c7b1a71ff2d7d1cd84e219f7fe11021",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 63,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.7485549132947977,
"repo_name": "openstates/openstates.org",
"id": "1511f85206009f70edb021e05f7976f0f071f4ce",
"si... |
print("are you ok?? 11")
import requests
import redis
import os
import random
from instapush_notify import InstaPushNotify
from fav_zhuanlan import Fav
from logger_fun import logger
print("are you ok??")
s = requests.session()
redis_obj = redis.Redis(host='localhost', port=6379, db=0)
class CheckZhuanLanFav(object):
... | {
"content_hash": "b417c3047422c69030182886c903a520",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 101,
"avg_line_length": 36.4320987654321,
"alnum_prop": 0.5218569976279227,
"repo_name": "youqingkui/zhihufav",
"id": "11873b804e82df4edeb8edb583f4b3fb668c88e3",
"size": "2... |
"""Data utils."""
from typing import Dict, List, Sequence, Tuple
from absl import logging
import numpy as np
import seqio
# A tuple of all possible intent label names to be used by NALUE task.
_NALUE_INTENT_NAMES = (
'AIName', 'APR', 'ATM', 'Accent', 'Accept', 'Account', 'Activate',
'Activity', 'Affirm', 'Age... | {
"content_hash": "2a5d0de852b947a894bcb95c5a157ad9",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 80,
"avg_line_length": 51.07738095238095,
"alnum_prop": 0.6670551217806783,
"repo_name": "google/uncertainty-baselines",
"id": "af657e2d8c85b6f51bbbd2d37eaf86e513687a04",
... |
from scrapy.item import Item, Field
class Quote(Item):
# define the fields for your item here like:
# name = Field()
text = Field()
author = Field()
book = Field()
| {
"content_hash": "b78bc96d895380063d219f40b0693011",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 48,
"avg_line_length": 23.125,
"alnum_prop": 0.6216216216216216,
"repo_name": "s1na/darkoob",
"id": "bfa4f77dff09ffbaab0817f941042271ced8bba8",
"size": "302",
"binary": fa... |
import _plotly_utils.basevalidators
class OrientationValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="orientation", parent_name="isosurface.colorbar", **kwargs
):
super(OrientationValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "bf01f972ed6987af7a696d59c3670a2a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 84,
"avg_line_length": 35.142857142857146,
"alnum_prop": 0.6036585365853658,
"repo_name": "plotly/plotly.py",
"id": "7ac5b2a5c7ce2e96efefd4eb5aed38a6773e0dcf",
"size": "492... |
"""
.. moduleauthor:: Gabriel Martin Becedillas Ruiz <[email protected]>
"""
import datetime
from pyalgotrade import strategy
from pyalgotrade.broker import backtesting
from pyalgotrade import bar
from pyalgotrade import logger
from pyalgotrade.barfeed import membf
class TestBarFeed(membf.BarFeed):
d... | {
"content_hash": "05c4c5c46a6877fd128f152fd50eb622",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 95,
"avg_line_length": 25.416666666666668,
"alnum_prop": 0.6918032786885245,
"repo_name": "cgqyh/pyalgotrade-mod",
"id": "72652014fc6b8c26a68374f452e0b803d72f4a9a",
"size":... |
import logging
import ConfigParser
class RequestResponder(object):
def __init__(self, configFilePath):
#logging.debug('config: '+configFilePath)
self._configuration = ConfigParser.RawConfigParser()
self._configuration.read(configFilePath)
self.requestHandler = None
def get(self... | {
"content_hash": "78eee8d06b733aebca8cd604c8708eb3",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.7039106145251397,
"repo_name": "dataplumber/edge",
"id": "5d27c48b360b0e28adf661118d544c2c365d1f4c",
"size": "716... |
import core
from core import *
class DMIDE_MenuBar(wx.MenuBar):
def __init__(self, window=None):
wx.MenuBar.__init__(self, wx.MB_DOCKABLE)
self.installMenuService()
def installMenuService(self):
""" Build a MenuBar for the top-level window as read from an XML file """
if os.path.exists(os.path.join(wx.Get... | {
"content_hash": "52d5f51e2fca695231110ba8d56a3765",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 137,
"avg_line_length": 35.41975308641975,
"alnum_prop": 0.6451725339839666,
"repo_name": "nyov/dmide",
"id": "38d37bcd38fdcd92280fc816e57694e3f8e20827",
"size": "8607",
... |
"""
Apply the style rules to the source.
"""
import argparse
import os
import sys
import time
from yapf.yapflib.yapf_api import FormatFile
try:
from .common import get_stash_dir
except (ImportError, ValueError):
from common import get_stash_dir
def apply_to_file(fp, sp, in_place=False):
"""
Apply th... | {
"content_hash": "f8edc9f5892b6d60fdd8cf823a93a7ee",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 123,
"avg_line_length": 34.25,
"alnum_prop": 0.6004325493376588,
"repo_name": "ywangd/stash",
"id": "36d7882a55d96302161eff0b121ac3be70ba3917",
"size": "3723",
"binary":... |
import setuptools
setuptools.setup(
version="0.0.1",
license='mit',
name='py-pool',
python_requires='>=3.6',
author='nathan todd-stone',
author_email='[email protected]',
url='http://github.com/nathants/py-pool',
packages=['pool'],
description='process and thread pools',
)
| {
"content_hash": "243986f7f846a6d18426a3c009e12db3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 45,
"avg_line_length": 23.76923076923077,
"alnum_prop": 0.6343042071197411,
"repo_name": "nathants/pool",
"id": "db693a4dce853e657ad0d3d1bedd88c587ef33a6",
"size": "309",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'ProductTypeIcon', fields ['product_type']
db.delete_unique('cmsplugin_configurableproduct_p... | {
"content_hash": "bc73fa9d63350a85b5a05ec908b501a4",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 254,
"avg_line_length": 74.13571428571429,
"alnum_prop": 0.6011176413912709,
"repo_name": "airtonix/cmsplugin-configurableproduct",
"id": "37dcff9fa1f4534fd241032e978869d576... |
import hashlib
import pytest
from django.contrib.auth.models import User
from django.core import mail
from factories import SecretaryFactory, AdministratorFactory
from users.models import Employee
from users.models import Administrator
from users.models import Secretary
from django.core.exceptions import ObjectDoesNo... | {
"content_hash": "272c3687038c5011b5a5b028ab49b448",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 100,
"avg_line_length": 43.26315789473684,
"alnum_prop": 0.5429845904298459,
"repo_name": "amigos-do-gesiel/iespv-administrativo",
"id": "41b18dc166a67108227498f471d345c775ba... |
"""Compute a streaming estimation of the mean of submitted tensors."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
class StreamingMean(object):
"""Compute a streaming estimation of the mean of submitted tensors."""
def __i... | {
"content_hash": "a56e24cc7ff1f0421317da1972493452",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 33.77358490566038,
"alnum_prop": 0.6726256983240223,
"repo_name": "google-research/batch-ppo",
"id": "3f620fe37a45dac8e9d980e638178ee5c5732871",
"siz... |
"""PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | {
"content_hash": "bc03fdd35a174a4ed701b3ea0d7b6182",
"timestamp": "",
"source": "github",
"line_count": 1085,
"max_line_length": 100,
"avg_line_length": 36.02396313364055,
"alnum_prop": 0.5577188763240035,
"repo_name": "ppyordanov/HCI_4_Future_Cities",
"id": "d76c2c0e4384c8d851212192a340cd5589b8ed24"... |
import numpy as np
from pysb.integrate import Solver
from matplotlib import pyplot as plt
from indra import bel, biopax, trips
from indra.util import plot_formatting as pf
from indra.assemblers import PysbAssembler
# 1. TEXT
# User defines text:
text = ('MEK1 phosphorylates ERK2 on threonine 185 and tyrosine 187.')
#... | {
"content_hash": "0df353bbf1c739b0e9f4c7e2e25feabb",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 72,
"avg_line_length": 30.790697674418606,
"alnum_prop": 0.6812688821752266,
"repo_name": "jmuhlich/indra",
"id": "87b21ab4d4656c6dc9ae5b7a38492ca2a117a149",
"size": "1324"... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from .. import models
class DeletedWebAppsOperations(object):
"""DeletedWebAppsOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
... | {
"content_hash": "d16e794da118af964a228776919bcc14",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 144,
"avg_line_length": 39.234042553191486,
"alnum_prop": 0.6252711496746204,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "dadbb2822b872876fef8f4292e69c6116aaf3152",
... |
"""
PyFilm
~~~~~~
"""
__version__ = "1.1"
__author__ = "JamieJackHerer"
__email__ = "[email protected]"
__source__ = "TBA"
__license__ = '''
New BSD License
Copyright (c) 2016, Jamie Lindsey aka JamieJackHerer
All rights reserved.
Redistribution and use in source and binary forms, with or without
modi... | {
"content_hash": "65bcb0039a91154d8f89b7e4cec0b52f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 42.17948717948718,
"alnum_prop": 0.780547112462006,
"repo_name": "jamiejackherer/pyFilm",
"id": "07ee62b74587a4cbb42f405da34a343688894d9e",
"size": "... |
from __future__ import absolute_import, division, print_function
import copy
from datetime import datetime
from distutils.version import LooseVersion
import time
import sys
import traceback
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.k8s.common import AUTH_ARG_SPEC, COMMON_AR... | {
"content_hash": "7e9ccb1f7ce446cadeec3db4bfa02ece",
"timestamp": "",
"source": "github",
"line_count": 445,
"max_line_length": 140,
"avg_line_length": 45.970786516853934,
"alnum_prop": 0.5673852471036809,
"repo_name": "SergeyCherepanov/ansible",
"id": "80659f23a646b9afe94eb156db9fa9c121a0a0c5",
"s... |
"""Provide models for new modmail."""
from ...const import API_PATH
from .base import RedditBase
class ModmailConversation(RedditBase):
"""A class for modmail conversations.
**Typical Attributes**
This table describes attributes that typically belong to objects of this
class. Since attributes are dy... | {
"content_hash": "e7f39014717562eb72df5727c5f58fc2",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 79,
"avg_line_length": 37.096774193548384,
"alnum_prop": 0.5781739130434783,
"repo_name": "13steinj/praw",
"id": "2461efa305eafbdb3e922cd50d9464b0475e3159",
"size": "11500... |
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more infomation.
"""
from __future__ import print_function
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
from . import ptime
from numpy import nd... | {
"content_hash": "07f08c75b23a4014f305dae5c4bbe55f",
"timestamp": "",
"source": "github",
"line_count": 1207,
"max_line_length": 161,
"avg_line_length": 33.70091135045568,
"alnum_prop": 0.5272758561349166,
"repo_name": "pmaunz/pyqtgraph",
"id": "61ae9fd51e5366677d369731aa6595b9154f9cc0",
"size": "4... |
from __future__ import print_function, unicode_literals
import fnmatch
import logging
import marshal
import os
import re
import six
import socket
import stat
import string
import subprocess
from rbtools.clients import SCMClient, RepositoryInfo
from rbtools.clients.errors import (AmendError,
... | {
"content_hash": "2ad6919a88bb38d0cb7760100a7b59e9",
"timestamp": "",
"source": "github",
"line_count": 1514,
"max_line_length": 79,
"avg_line_length": 39.47886393659181,
"alnum_prop": 0.5279817971926185,
"repo_name": "beol/rbtools",
"id": "80e497456af12737826d853725e3f7c7e4793ab5",
"size": "59771"... |
"""Support for UPC ConnectBox router."""
import asyncio
import logging
import aiohttp
from aiohttp.hdrs import REFERER, USER_AGENT
import async_timeout
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import C... | {
"content_hash": "52b1fc273feb8bccc3edd1d9a3660e23",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 77,
"avg_line_length": 32.99230769230769,
"alnum_prop": 0.5868500816041036,
"repo_name": "fbradyirl/home-assistant",
"id": "3355c33ab2a182b2d4e40cdb6150e049ad5d74dd",
"siz... |
import pybullet as p
import math
import time
dt = 1./240.
p.connect(p.GUI)#SHARED_MEMORY_GUI)
p.loadURDF("r2d2.urdf",[0,0,1])
p.loadURDF("plane.urdf")
p.setGravity(0,0,-10)
radius=5
t = 0
p.configureDebugVisualizer(shadowMapWorldSize=5)
p.configureDebugVisualizer(shadowMapResolution=8192)
while (1):
t+=dt
p.conf... | {
"content_hash": "f1856e26cfadc4304674fd7210cf6343",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 85,
"avg_line_length": 20.857142857142858,
"alnum_prop": 0.7442922374429224,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "e1d755708d9d600cc0b4700a5b3ca77065e48d1c",
"size": "... |
from django.test import SimpleTestCase
from cbmail.mixins import MailingListMixin
class MixinsTest(SimpleTestCase):
class NokObject(MailingListMixin):
""" """
def test_mixin_nok(self):
result = self.NokObject()
self.assertRaises(NotImplementedError, result.get_mailing_list)
| {
"content_hash": "ecd755c7ed8e5baa18e3f5986b80f8a2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 24,
"alnum_prop": 0.717948717948718,
"repo_name": "dipcode-software/django-mailings",
"id": "6ce602bec8bce139a0df7e4634e5b3f8785393fa",
"size": "312"... |
from datetime import datetime
from kitsune.announcements.models import Announcement
from kitsune.announcements.tests import AnnouncementFactory
from kitsune.sumo.tests import TestCase
from kitsune.sumo.urlresolvers import reverse
from kitsune.users.tests import UserFactory, add_permission
from kitsune.wiki.tests impor... | {
"content_hash": "f9e420ee63e0ccec940f88cba403cde4",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 72,
"avg_line_length": 33.89,
"alnum_prop": 0.6332251401593391,
"repo_name": "mozilla/kitsune",
"id": "e1b0a10766eb19bf7b6e8f4bd2c09e89bae2df62",
"size": "3389",
"binary... |
FIND_MODE_MODULE = "module"
FIND_MODE_CONFIG = "config"
FIND_MODE_NONE = "none"
FIND_MODE_BOTH = "both"
| {
"content_hash": "2f900058955e8ff5f70ffa3bfb233b36",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 27,
"avg_line_length": 26,
"alnum_prop": 0.6923076923076923,
"repo_name": "conan-io/conan",
"id": "8b6329c26ed8fd7a49ef6d9c4c5f23a8fe977351",
"size": "104",
"binary": fals... |
import json
class BuilderDict:
def __init__(self):
self._dict = dict()
def add(self, key, val):
self._dict[key] = val
return self
def to_string(self):
return json.dumps(self._dict)
@staticmethod
def create_update_lease():
response = BuilderDict()
... | {
"content_hash": "77acfffceae28b0711752886975d7867",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 20.94736842105263,
"alnum_prop": 0.5778894472361809,
"repo_name": "aazizyan/playlist-core",
"id": "3a7634190606ea99692cd5e8d84783e8f902dd93",
"size":... |
"""
Routes and views for the bottle application.
"""
import os
import json
from bottle import route, view, static_file
from datetime import datetime
config = { "secret_key" : "my developer secret value" }
if os.getenv("MY_CONFIG"): # you can define the setting in your Azure Web App
# by s... | {
"content_hash": "9ed2f3c7ea449f1c7bcc4ccc8520e3dd",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 77,
"avg_line_length": 25.358490566037737,
"alnum_prop": 0.6257440476190477,
"repo_name": "ernstbaslerpartner/bottle-azure-boilerplate",
"id": "b7291431a8ef4f084271d1e8523e74... |
from behave import *
from behave_webdriver.transformers import matcher_mapping
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
if 'transform-parse' not in matcher_mapping:
use_step_matcher('re')
else:
use_step_matcher('transform-re')
@given('the element "([^"]... | {
"content_hash": "31e40b126d8bb0c4f3a8cf75ba94bc65",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 153,
"avg_line_length": 40.74174174174174,
"alnum_prop": 0.6220977371563352,
"repo_name": "spyoungtech/behave-webdriver",
"id": "7ab1d1ba38c44395f9a365d73e053cd70bef40b8",
... |
from fractions import Fraction
def parse_sexp(string):
"""
Parses an S-Expression into a list-based tree.
parse_sexp("(+ 5 (+ 3 5))") results in [['+', '5', ['+', '3', '5']]]
"""
sexp = [[]]
word = ''
in_str = False
for c in string:
if c == '(' and not in_str:
sexp.append([])
elif c... | {
"content_hash": "472aa31fd29daa5e9ff6fd4e1519be41",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 81,
"avg_line_length": 36.19183673469388,
"alnum_prop": 0.6605390774782903,
"repo_name": "luisenp/mdp-lib",
"id": "95848127737bf75fd485239db909b58129decd2c",
"size": "8867... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: vmware_local_role_info
short_description: Gather info about local roles on an ESXi ho... | {
"content_hash": "c599f23f76aca242050cc8f964d18a68",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 116,
"avg_line_length": 29.81954887218045,
"alnum_prop": 0.5718608169440242,
"repo_name": "thaim/ansible",
"id": "6918297f6fd032c2c556d934b2f8ddc6422d707c",
"size": "4166"... |
import sys
import time
# for python 3 runbook execution in a python2 runtime of Sandbox we need to use httpclient and jrdsclient of python3 automation worker
if sys.version_info[0] == 3:
AUTOMATIONWORKER_PATH = "/opt/microsoft/omsconfig/modules/nxOMSAutomationWorker/DSCResources/MSFT_nxOMSAutomationWorkerResource... | {
"content_hash": "a79b76704acee4e9f19237035ece2264",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 160,
"avg_line_length": 39.31060606060606,
"alnum_prop": 0.6781653497783774,
"repo_name": "MSFTOSSMgmt/WPSDSCLinux",
"id": "8f9185765faf26cc07188ee073b629b67b1df9f6",
"siz... |
from msrest import Serializer, Deserializer
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, Resourc... | {
"content_hash": "00736314d52c4f045d73d29210002deb",
"timestamp": "",
"source": "github",
"line_count": 790,
"max_line_length": 146,
"avg_line_length": 61.029113924050634,
"alnum_prop": 0.6971563686142742,
"repo_name": "Azure/azure-sdk-for-python",
"id": "b703caa3df4af5cc164a9354204b2287da4251e6",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.