text stringlengths 4 1.02M | meta dict |
|---|---|
def test_hello_world(workspace):
workspace.src('pom.xml', r'''
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>... | {
"content_hash": "61a870735974070cd349a7fab78e707c",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 112,
"avg_line_length": 27.972972972972972,
"alnum_prop": 0.5990338164251208,
"repo_name": "imsardine/learning",
"id": "0ddfb41f73a8d1f812f28efc88f88a1a23ad591e",
"size": "... |
"""
Ex. 7: Write a python program that creates a list. One of the elements of the list
should be a dictionary with at least two keys. Write this list out to a file
using both YAML and JSON formats. The YAML file should be in the expanded form.
Creates a list. One of the elements of the list is a dictionary with two k... | {
"content_hash": "dc34c10373bf8b44e453ee35be5ba32c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 88,
"avg_line_length": 24.595744680851062,
"alnum_prop": 0.634083044982699,
"repo_name": "jrslocum17/pynet_test",
"id": "4c0495ea9db8deac963b706997d02993225c2cb4",
"size": ... |
from pagediterator import PagedIterator
from unittest import TestCase
from mock import MagicMock, call
class PagedIterator1(PagedIterator):
def __init__(self):
PagedIterator.__init__(self)
self.fetch_page(0)
@property
def total_size(self):
return self._total_size
@property
... | {
"content_hash": "d68812a844208873579b786a44eb12cf",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 72,
"avg_line_length": 33.29838709677419,
"alnum_prop": 0.6224267377088883,
"repo_name": "elliotchance/pagediterator-python",
"id": "b0e7c367853b25e447aa12fee34c7049c9c8e9cd... |
from __future__ import division
from vistrails.core.bundles.pyimport import py_import
from vistrails.core.modules.vistrails_module import ModuleError
from ..common import get_numpy, TableObject, Table
def get_xlrd():
try:
return py_import('xlrd', {
'pip': 'xlrd',
... | {
"content_hash": "d362b6ac9d63a7f0cefa81063fb656b6",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 79,
"avg_line_length": 38.3862660944206,
"alnum_prop": 0.48669499105545616,
"repo_name": "hjanime/VisTrails",
"id": "9dcfd6c2a1a82a2f9d39de384bae0804ed3561a3",
"size": "10... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['Lag1Trend'] , ['Seasonal_DayOfMonth'] , ['SVR'] ); | {
"content_hash": "87f0736102bd8e4f8199b08d61afa15f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 86,
"avg_line_length": 39.75,
"alnum_prop": 0.710691823899371,
"repo_name": "antoinecarme/pyaf",
"id": "90e7dc5c9c6696e98170384be44352032a9dc698",
"size": "159",
"binary":... |
"""Commands for reading and manipulating users."""
from googlecloudsdk.calliope import base
@base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA)
class Users(base.Group):
"""Read and manipulate Google Compute Engine users."""
Users.detailed_help = {
'brief': 'Read and manipulate Google Compute ... | {
"content_hash": "89b0941ca9b2ef8d9e8a3a865e1e1994",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 28.083333333333332,
"alnum_prop": 0.7566765578635015,
"repo_name": "KaranToor/MA450",
"id": "eed7cc43924f7c62987c13955afd53bc7751c135",
"size": "932"... |
from __future__ import annotations
import numpy as np
from progressivis.core.module import Module, ReturnRunStep
from progressivis.core.slot import SlotDescriptor
from progressivis.core.bitmap import bitmap
from progressivis.core.utils import indices_len
from ..io import Variable
from ..stats import Min, Max
from ..u... | {
"content_hash": "691b619c7ab35fb5aabdeefaa39a7760",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 87,
"avg_line_length": 35.68181818181818,
"alnum_prop": 0.5668040464593481,
"repo_name": "jdfekete/progressivis",
"id": "23550942289a2395eaaa486953a05c9838345539",
"size":... |
from ioant_mysqlhelper.db import db
from ioant import utils
import sys
import logging
logger = logging.getLogger(__name__)
def main( configFile, schemaFile ):
configuration = utils.fetch_json_file_as_dict( configFile )
schema = utils.fetch_json_file_as_dict( schemaFile )
db_host = configuration['mysqlDat... | {
"content_hash": "ec7e52e1157dcd4ee2963a3133b8cbdd",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 66,
"avg_line_length": 31.6,
"alnum_prop": 0.581374321880651,
"repo_name": "ioants/ioant",
"id": "221818ee6fd694c324f1aab48e99b4af5e1c00d1",
"size": "1344",
"binary": fal... |
"""Tests for the RC4 decrypter object."""
import unittest
from dfvfs.encryption import rc4_decrypter
from tests.encryption import test_lib
class RC4DecrypterTestCase(test_lib.DecrypterTestCase):
"""Tests for the RC4 decrypter object."""
def testInitialize(self):
"""Tests the __init__ method."""
decryp... | {
"content_hash": "40bfd391bcf76221d23255f220f15a48",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 27.225806451612904,
"alnum_prop": 0.7085308056872038,
"repo_name": "joachimmetz/dfvfs",
"id": "e5f1f0c3cfb8bb7841a4a0f4b8efc665075bdd04",
"size": "89... |
import argparse
import calendar
import json
import os
import sys
import time
import uuid
gcp_utils_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), '../../gcp/utils'))
sys.path.append(gcp_utils_dir)
import big_query_utils
_PROJECT_ID='grpc-testing'
def _upload_netperf_latency_csv_to_bigquery(dat... | {
"content_hash": "2167eeaf428ffb65af7112c50563b2e3",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 103,
"avg_line_length": 36.864285714285714,
"alnum_prop": 0.6688626235225732,
"repo_name": "andrewpollock/grpc",
"id": "2a99499843adccc35bf50a33a018eb717fe76c12",
"size": ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.option.arg_splitter import GLOBAL_SCOPE
class OptionsError(Exception):
"""An options system-related error."""
pass
class RegistrationError(OptionsEr... | {
"content_hash": "ed1b7787563fcdcf58f54c0ff31fa46b",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 100,
"avg_line_length": 45.97959183673469,
"alnum_prop": 0.7141588992454505,
"repo_name": "dturner-tw/pants",
"id": "59c703fc674aede0941b38ffcbe4abc2bdf296a2",
"size": "240... |
import pandas as pd
df = pd.read_csv("train_ridership_one_month.csv")
df.head()
# In[64]:
# Below code removes unwanted passenger activity codes for parking
valid_codes = [1, 9, 10, 11, 12]
df = df[df.use_type != 13 ]
df = df[df.use_type != 14 ]
clean_df = df[df.use_type != 15 ]
cols = ["transit_day", "transit_tim... | {
"content_hash": "fa59050353b12fb3ad0fb68c5e4695d9",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 82,
"avg_line_length": 27,
"alnum_prop": 0.6803840877914952,
"repo_name": "loren138/martaOptimize",
"id": "bf160a6c342fc58c7a9df775ccbe1e53a785c716",
"size": "1466",
"bin... |
"""
__ParIndexed.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: gehan
Modified: Sat Aug 30 18:23:40 2014
____________________________________________________________________
"""
from ASGNode import *
from ATOM3Type import *
from... | {
"content_hash": "a5d3b9dc611b5fa35e71671bd0c6d381",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 90,
"avg_line_length": 37.13978494623656,
"alnum_prop": 0.6048060220034742,
"repo_name": "levilucio/SyVOLT",
"id": "3737e03509d8d6775452f2c8c70c39a0ac181660",
"size": "3454... |
import sys
import pymongo
def connect(uri):
client = pymongo.MongoClient(uri)
db = client.get_default_database()
return db
def insert(db, documentName, dataArray):
document = db[documentName]
val = document.insert(dataArray)
if (val):
print("Successed!")
else:
print("Some... | {
"content_hash": "1a8b9dbe589e9fd39800d8424dc07548",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 40,
"avg_line_length": 19.153846153846153,
"alnum_prop": 0.606425702811245,
"repo_name": "hasa93/DroneMap",
"id": "92503d8824548e2a3fc1208cc6828bf10afc73ba",
"size": "498",... |
"""Accuracy tests for ICRS transformations, primarily to/from AltAz.
"""
import numpy as np
from astropy import units as u
from astropy.tests.helper import assert_quantity_allclose as assert_allclose
from astropy.time import Time
from astropy.coordinates import (
EarthLocation, ICRS, CIRS, AltAz, HADec, SkyCoord... | {
"content_hash": "d33ba57a01c47f403b38be70c366211f",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 76,
"avg_line_length": 36.77922077922078,
"alnum_prop": 0.695268361581921,
"repo_name": "aleksandr-bakanov/astropy",
"id": "23150b7ca6fba39a983666ff8f89113a6eba4fa4",
"size... |
"""autogenerated by genpy from aruco/marker_info.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class marker_info(genpy.Message):
_md5sum = "e5991c0caab369f6cfa37dfa3bc945ad"
_type = "aruco/marker_info"
_has_header = False #flag to mark the pr... | {
"content_hash": "c0e5e9658a5d89bcc412c7368a7f18bb",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 153,
"avg_line_length": 33.55613577023499,
"alnum_prop": 0.6022408963585434,
"repo_name": "miguelolivaresmendez/ArUco_ROS-QR-code-detection",
"id": "29d7020c85fab897bfdbac97... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_sindra_lintikoor_q2_needed.iff"
result.attribute_template_id = -1
result.stfName("loot_rori_n","sindra_lintikoor_q2_needed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ... | {
"content_hash": "5dcf12ff75824441279f5f057df63c54",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 26.307692307692307,
"alnum_prop": 0.7105263157894737,
"repo_name": "obi-two/Rebelion",
"id": "b3ddec384c790683510548cc55199e92bef5cc38",
"size": "487... |
import logging
import queue
import time
logger = logging.getLogger()
def process_queue(q, pool, func):
""" Process a priority queue based on time
The priority within the queue is the time at which the item can execute.
Continually poll the queue, popping an item only when the current time
is greater... | {
"content_hash": "2fea66f373d3bf387d70daaa8470b5be",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 77,
"avg_line_length": 29.70149253731343,
"alnum_prop": 0.550251256281407,
"repo_name": "curtisalexander/fc",
"id": "a4706b6c7dbd302890d095803d3e8e91de57dc64",
"size": "200... |
import sys
#variables
new_input = sys.argv[1]
counter = 0
#initialize for loop
for i in new_input:
if counter % 2:
fun = int(new_input[counter]) * new_input[counter - 1]
sys.stdout.write(fun)
counter += 1
print("")
| {
"content_hash": "2eeee609377b70030d3f2d4d000a7893",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 17.153846153846153,
"alnum_prop": 0.672645739910314,
"repo_name": "Ca2Patton/PythonStuff",
"id": "f9243ae637c914b0933c220a5173d9e3a7afb4c8",
"size": ... |
import os
import dj_database_url
here = lambda * x: os.path.join(os.path.abspath(os.path.dirname(__file__)), *x)
PROJECT_ROOT = here("..")
root = lambda * x: os.path.join(os.path.abspath(PROJECT_ROOT), *x)
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Kim Desrosiers', 'kimdesro@gmail.com'),
)
MANAGERS = ADM... | {
"content_hash": "00c43c6d44d4bf71b84fb2b77b6d5e7b",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 88,
"avg_line_length": 30.69148936170213,
"alnum_prop": 0.6960138648180243,
"repo_name": "kimond/miamm",
"id": "0fc4ecf8654f437f197b0b944ac7739541447d57",
"size": "5813",
... |
import base64
import hashlib
import re
import urllib2
from PyQt4 import QtCore
from urlparse import urlparse
class MessageRenderer(QtCore.QThread):
MESSAGES = {
"alert": u'<div class="alert"><span class="time">[{time}]</span> <span class="author">{user}</span>: {message}</div>',
"image": u'<span ... | {
"content_hash": "d596abb51f9689c08669c69ab5ec5959",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 248,
"avg_line_length": 44.38990825688074,
"alnum_prop": 0.5489304536529916,
"repo_name": "mariano/snakefire",
"id": "6f0918d095cdb7def616ba2fd20d0b14cae4d327",
"size": "9... |
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
__all... | {
"content_hash": "2faf62f39dda2f45ba1008e536727ddd",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 84,
"avg_line_length": 33.57333333333333,
"alnum_prop": 0.6076747418586179,
"repo_name": "Kamik423/uni_plan",
"id": "eede5e8406b1ca60fbbde30a4346465dc188e581",
"size": "20... |
import os
import pytest
import pushbullet
from binascii import a2b_base64
API_KEY = os.environ["PUSHBULLET_API_KEY"]
def test_decryption():
pb = pushbullet.Pushbullet(API_KEY, encryption_password="hunter2")
pb._encryption_key = a2b_base64("1sW28zp7CWv5TtGjlQpDHHG4Cbr9v36fG5o4f74LsKg=")
test_data = "MSfJ... | {
"content_hash": "3ef750b695e6758dd578ed1eeb5a348b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 83,
"avg_line_length": 27.6875,
"alnum_prop": 0.7471783295711061,
"repo_name": "Saturn/pushbullet.py",
"id": "7221dcdcccef4b6acec15560657134c03682d92d",
"size": "443",
"b... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('mooc', '0007_lesson_order'),
]
operations = [
migrations.CreateModel(
name='Classification',
... | {
"content_hash": "2eb35640abea22055d96aab92cba3c67",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 149,
"avg_line_length": 31.296296296296298,
"alnum_prop": 0.6011834319526628,
"repo_name": "Zing22/Moogle",
"id": "294cd2383665770fa7c4aa3ae3638960ddd23330",
"size": "915",... |
__author__ = "Simone Campagna"
__all__ = [
'RubikTestInputOutput',
]
import numpy as np
from rubik.cubes import api as cb
from rubik.shape import Shape
from ...rubik_test_case import RubikTestCase, testmethod
class RubikTestStats(RubikTestCase):
METHOD_NAMES = []
def impl_stats_random... | {
"content_hash": "18d0375910433ab399bb384b7fa5945c",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 106,
"avg_line_length": 40.34117647058824,
"alnum_prop": 0.6259842519685039,
"repo_name": "simone-campagna/rubik",
"id": "4cf5adeefe6ba19c99f10388ce1e42be9476d3e0",
"size"... |
"""Invertible 1x1 Convolution used in GLOW."""
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.bijectors import bijector
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import parameter_properties
from tensorflow_probability.python.intern... | {
"content_hash": "af8b4603268eef7b5b4738e45d044354",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 92,
"avg_line_length": 35.83157894736842,
"alnum_prop": 0.6555033294163729,
"repo_name": "tensorflow/probability",
"id": "28f48d2bdff459aead1de6af4f565eeae513f4f9",
"size"... |
from __future__ import print_function
try: # Python 3
import http.client as httplib
except ImportError: # Python 2
import httplib
import json
import re
import base64
import sys
import os
import os.path
settings = {}
##### Switch endian-ness #####
def hex_switchEndian(s):
""" Switches the endianness of a hex ... | {
"content_hash": "9a8a7fa25e39d654da8142f1ee57007e",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 90,
"avg_line_length": 28.91891891891892,
"alnum_prop": 0.666588785046729,
"repo_name": "ionomy/ion",
"id": "14c6524140edc438ad1601ca08aed2c33a900730",
"size": "4630",
"... |
import re
import requests
from bs4 import BeautifulSoup
from metro.parser.base import BaseRuDataProvider
class DataProvider(BaseRuDataProvider):
metro_data_src = "http://ru.wikipedia.org/wiki/\
Список_станций_Киевского_метрополитена"
def download_all(self):
self.parse_usual_bi... | {
"content_hash": "0b228197210709b09b16a93019d8cd76",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 25.384615384615383,
"alnum_prop": 0.7121212121212122,
"repo_name": "xfenix/django-metro",
"id": "6e9556c73586ebcd994983242e80f2c48181a987",
"size": "... |
"""FDTD cell phantom with tilted axis of rotation
The *in silico* data set was created with the
:abbr:`FDTD (Finite Difference Time Domain)` software `meep`_. The data
are 2D projections of a 3D refractive index phantom that is rotated
about an axis which is tilted by 0.2 rad (11.5 degrees) with respect
to the imaging... | {
"content_hash": "ee4b4927fbcaf9187b92196dea23b455",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 71,
"avg_line_length": 37.1865671641791,
"alnum_prop": 0.6449929761188039,
"repo_name": "paulmueller/ODTbrain",
"id": "c5238e9ab45131c890005bb4bfc93793b03d11be",
"size": "... |
import os
from oslo_privsep import capabilities as c
from oslo_privsep import priv_context
capabilities = [c.CAP_SYS_ADMIN]
# On virtual environments libraries are not owned by the Daemon user (root), so
# the Daemon needs the capability to bypass file read permission checks in
# order to dynamically load the code ... | {
"content_hash": "3f21be46a810e5e38dce1e873c5d94da",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 30.136363636363637,
"alnum_prop": 0.7405731523378583,
"repo_name": "openstack/os-brick",
"id": "c41ff533c2a4b16d28ca70710a1fbe94fdbe60d6",
"size": "1... |
from cliff import show
from gnocchiclient import utils
class CliCapabilitiesList(show.ShowOne):
"""List capabilities."""
def take_action(self, parsed_args):
caps = utils.get_client(self).capabilities.list()
return self.dict2columns(caps)
| {
"content_hash": "d87eeab8145711af5a0b2c55dde38f8c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 57,
"avg_line_length": 24.181818181818183,
"alnum_prop": 0.7105263157894737,
"repo_name": "gnocchixyz/python-gnocchiclient",
"id": "bc22dd9b89113f40de4b60b82fe712a4adbe1177",... |
def parse_args():
""" Parsing commandline arguments. """
from argparse import ArgumentParser
parser = ArgumentParser("./cluster.py")
parser.add_argument("input", help="input file")
parser.add_argument("output",
nargs="?",
help="output file",
... | {
"content_hash": "b940170b6f39e781d2b7838e71a58c43",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 75,
"avg_line_length": 30.456521739130434,
"alnum_prop": 0.5438972162740899,
"repo_name": "akullpp/ClusterPy",
"id": "dc5529defee43d430266ec3f6b6cda309f65a18a",
"size": "14... |
"""
@package mi.dataset.driver.pco2w_abc.imodem
@file mi-dataset/mi/dataset/driver/pco2w_abc/imodem/pco2w_abc_imodem_recovered_driver.py
@author Mark Worden
@brief Driver for the pco2w_abc_imodem instrument
Release notes:
Initial Release
"""
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.datas... | {
"content_hash": "b0932ffc4ce60922559fc523b77b2906",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 102,
"avg_line_length": 38.732394366197184,
"alnum_prop": 0.7232727272727273,
"repo_name": "JeffRoy/mi-dataset",
"id": "5f1479526d8c661c2495a177096ae9970017575f",
"size": "... |
from nose.tools import *
from game.bin.map import *
def test_room():
gold = Room("GoldRoom",
"""This room has gold in it you can grab. There's a
door to the north.""")
assert_equal(gold.name, "GoldRoom")
assert_equal(gold.paths, {})
def test_room_paths():
center = Room(... | {
"content_hash": "9e43afaf0672ba1038ef2b4f3ad3bbe1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 67,
"avg_line_length": 34.21052631578947,
"alnum_prop": 0.6161538461538462,
"repo_name": "pwittchen/learn-python-the-hard-way",
"id": "6f69602289dda57334178dce9d8c58b3f4d4eb0... |
"""
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, ordered from lowest
order term to highest. For example, a... | {
"content_hash": "1f11cf024934b300412120b3c85d834d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 42.22222222222222,
"alnum_prop": 0.7736842105263158,
"repo_name": "ryfeus/lambda-packs",
"id": "ae5b1f078dd71da24bd974ca97c11f9ad362903a",
"size": "1... |
ID = "chatevent"
permission = 3
privmsgEnabled = False
def timer(self, channels):
self.sendChatMessage(self.send, channels[0], "pong")
def chatEvent(self, channels, userdata, message, currChannel):
#print channels
#print currChannel
if channels != False:
if currChannel in channels:
... | {
"content_hash": "5583291cf43aa9db92b6e4cfdd3af3db",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 102,
"avg_line_length": 42.03846153846154,
"alnum_prop": 0.6052150045745655,
"repo_name": "NightKev/Renol-IRC",
"id": "a5e6824fd987336aff9007f95e0d05b73a9b4e3f",
"size": "2... |
from __future__ import absolute_import
from __future__ import print_function
from spdx import checksum
from spdx import document
from spdx import utils
import hashlib
class FileType(object):
SOURCE = 1
BINARY = 2
ARCHIVE = 3
OTHER = 4
class File(object):
"""Representation of SPDX file.
Fie... | {
"content_hash": "1f3f685b6021c72269f4732aee2559db",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 119,
"avg_line_length": 35.593333333333334,
"alnum_prop": 0.6210900917774864,
"repo_name": "bmwcarit/spdx-tools-python",
"id": "5613ea6835e49313639063f81e6e24f4ce170d5b",
... |
import numpy as np
class run:
def __init__(self,
instance):
#begin
print ' '
print 'normalize_by_negative_delay_points script running'
#create array to hold averages
positive_delay_averages = np.zeros(len(instance.xi))
... | {
"content_hash": "b3ba9a141d608e52625b6cb75a502c9e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 82,
"avg_line_length": 33.4,
"alnum_prop": 0.49326347305389223,
"repo_name": "untzag/datplot",
"id": "68ba5c8e62260287f890987775935656d70a8c32",
"size": "1526",
"binary":... |
from setuptools import setup, find_packages
setup(
name='wilmu-linux-toolkit',
version='0.0.14',
description='Linux toolkit for Wilmington University',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2... | {
"content_hash": "1081f0142bec9085fdf25706b8178a26",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 98,
"avg_line_length": 34.03333333333333,
"alnum_prop": 0.6209598432908913,
"repo_name": "jpwhite3/wilmu-linux-toolkit",
"id": "f0bf74b5cab4f104fe6cb7dcbabb1dde2da291cb",
"... |
from ._models_py3 import ElasticSan
from ._models_py3 import ElasticSanList
from ._models_py3 import ElasticSanOperationDisplay
from ._models_py3 import ElasticSanOperationListResult
from ._models_py3 import ElasticSanRPOperation
from ._models_py3 import ElasticSanUpdate
from ._models_py3 import Error
from ._models_py3... | {
"content_hash": "2080a08cfe8c0a95c40949af986f164d",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 78,
"avg_line_length": 32.32911392405063,
"alnum_prop": 0.7533281127642913,
"repo_name": "Azure/azure-sdk-for-python",
"id": "760d42042c24a6d77f223fcfa56058c288e567b2",
"si... |
import lintreview.github as github
import logging
log = logging.getLogger(__name__)
class GithubRepository(object):
"""Abstracting wrapper for the
various interactions we have with github.
This will make swapping in other hosting systems
a tiny bit easier in the future.
"""
def __init__(sel... | {
"content_hash": "cce24cb359fe1d66f9f6558842234217",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 72,
"avg_line_length": 26.64566929133858,
"alnum_prop": 0.5750591016548463,
"repo_name": "adrianmoisey/lint-review",
"id": "3fba7c2aa718316640ab61895515aff4a6a0294d",
"siz... |
import logging, time
from logic.smboolmanager import SMBoolManagerPlando as SMBoolManager
from logic.smbool import SMBool, smboolFalse
from logic.helpers import Bosses
from rom.romloader import RomLoader
from rom.rom_patches import RomPatches
from graph.graph import AccessGraphSolver as AccessGraph
from utils.utils im... | {
"content_hash": "2b37010992bd1d3c356398b4973a25b6",
"timestamp": "",
"source": "github",
"line_count": 882,
"max_line_length": 202,
"avg_line_length": 47.39229024943311,
"alnum_prop": 0.5842822966507177,
"repo_name": "theonlydude/RandomMetroidSolver",
"id": "34f9140ce2bcb2c6f30a69f6107b4607ceb64ff8"... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
import re
import os
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
def get_require... | {
"content_hash": "bc51844229cd0e3085397daf6799f321",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 94,
"avg_line_length": 35.36283185840708,
"alnum_prop": 0.6504004004004004,
"repo_name": "cstb/conan-package-tools",
"id": "74ce48c93da3749095d0121774c3b1e15963e3e8",
"siz... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hermes.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "bcca9b79cf14bc1f879ae88cb8acda1c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7092511013215859,
"repo_name": "renanalencar/hermes",
"id": "7cf771168dd44a5266e11a98d049e2a60c256d52",
"size": "24... |
import re
import traceback
class Interpreter:
def __init__(self):
self._inblock = False
self._last_empty = False
self._aggregate = []
self._environment = dict()
self.comments = re.compile(r'#.*$', re.MULTILINE)
self.identifier = re.compile(r'(?:^|\s)((?:[^\d\W]\w*\.... | {
"content_hash": "3a29324e18d15a1e04b5885b82b5c075",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 83,
"avg_line_length": 32.74603174603175,
"alnum_prop": 0.5053320407174018,
"repo_name": "paberr/ppython",
"id": "2c0c863fde781b1e6c251cc3e564435a95a975a2",
"size": "4126"... |
import os
import random
import logging
import stat
_logger = logging.getLogger("cwltool")
def abspath(src, basedir):
if src.startswith("file://"):
ab = src[7:]
else:
ab = src if os.path.isabs(src) else os.path.join(basedir, src)
return ab
class PathMapper(object):
"""Mapping of files ... | {
"content_hash": "ea8368f8b7faff8cd71a579cbdfd880f",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 93,
"avg_line_length": 30.6375,
"alnum_prop": 0.507547939616483,
"repo_name": "brainstorm/common-workflow-language",
"id": "ef739cf85d3a615bad5b3f982e2e35d655698e8b",
"size... |
import random
import numpy
from matplotlib import pyplot ## == import matplotlib.pyplot
## Hive + Enemy
num_bees = 1000
num_warrior =numpy.random.randint(1,num_bees+1)
num_worker= num_bees - num_warrior
alert=False
print "num warrior", num_warrior
print "num worker", num_worker
print "\n"
class Queen_Bee:
... | {
"content_hash": "565b62a60ca9d4b182b2512480da3a17",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 89,
"avg_line_length": 20.347058823529412,
"alnum_prop": 0.6082682856316854,
"repo_name": "omsktransmash/ScientificPythonTutorial",
"id": "7566cf85d72e67ba7994350523f5da633b... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
import sys
import lockfile
import psutil
from lockfile import pidlockfile
logger = logging.getLogger(__name__)
class OwnerPrintingPIDLockFile(pidloc... | {
"content_hash": "526abffa7ac515cfd73343bfd68f7afb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 99,
"avg_line_length": 31.89189189189189,
"alnum_prop": 0.6754237288135593,
"repo_name": "tejal29/pants",
"id": "2f7780dc51a1834ee64e407b01bc94147a3186a0",
"size": "1327",
... |
"""
Test the parallel module.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2010-2011 Gael Varoquaux
# License: BSD Style, 3 clauses.
import time
try:
import cPickle as pickle
PickleError = TypeError
except:
import pickle
PickleError = pickle.PicklingError
fr... | {
"content_hash": "3cb2dbeae44b1d828630694525b405ee",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 80,
"avg_line_length": 30.067357512953368,
"alnum_prop": 0.5121488885059452,
"repo_name": "ominux/scikit-learn",
"id": "2599acb393439c3a178716305fcaa0591e02449e",
"size": ... |
import time
from oslo_log import log as logging
from oslo_service import loopingcall
from cinder import coordination
from cinder import exception
from cinder.i18n import _
from cinder.volume.drivers.dell_emc.vmax import utils
LOG = logging.getLogger(__name__)
WRITE_DISABLED = "Write Disabled"
UNLINK_INTERVAL = 15
U... | {
"content_hash": "27a6170ffc5a6fb0b07e72158a389cda",
"timestamp": "",
"source": "github",
"line_count": 772,
"max_line_length": 78,
"avg_line_length": 42.6800518134715,
"alnum_prop": 0.5756472123584935,
"repo_name": "phenoxim/cinder",
"id": "b356bbd4ca2719990a8da6ae8986c6d81ea62209",
"size": "33599... |
import argparse
import re
import sys
import os
import difflib
import const
def main(argv):
# define return code const value
const.CheckPassFail = 1
const.CheckPassOK = 0
const.GeneralError = -1
const.UnknownArguments = -2
const.MissingResult = -3
# Parse the command line
parser = a... | {
"content_hash": "1884a5b8b647f01eec8041cdb4954bfa",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 107,
"avg_line_length": 39.214285714285715,
"alnum_prop": 0.581056466302368,
"repo_name": "libengu/llilc",
"id": "7336c6e1eb2aae34f51cb3ee36bcaeac1c6e6cf0",
"size": "4974",... |
import numpy as np
import tvm
from tvm import relay
from tvm.relay import transform
def run_opt_pass(expr, opt_pass):
assert isinstance(opt_pass, transform.Pass)
mod = relay.Module.from_expr(expr)
mod = opt_pass(mod)
entry = mod["main"]
return entry if isinstance(expr, relay.Function) else entry.... | {
"content_hash": "43c0b6be18c13005db9a6f0f8fb2107c",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 72,
"avg_line_length": 30.985507246376812,
"alnum_prop": 0.5762394761459307,
"repo_name": "Huyuwei/tvm",
"id": "97b20c6b9219a91ec21f2076a681a84b1f5fd1a5",
"size": "5061",
... |
import os, platform
import dynamixel
import time
import options
import math
import serial
ticks_per_rad = 4096.0/(math.pi*2)
############################################
# _______ __ ______ __
# /_ __(_)_ _ / // / __ \_ _____ ________/ /
# / / / / ' \ / _ / /_/ / |/|/ / _ `/ __... | {
"content_hash": "76f3fae479463a7d15e9a840bb7e7d10",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 181,
"avg_line_length": 33.004329004329,
"alnum_prop": 0.6798268625393494,
"repo_name": "skyleradams/tim-howard",
"id": "65d9f24001b36ba44760cb925e4fd74451e9073b",
"size":... |
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.binding.datatypes as xs
import pyxb.binding.basis
import pyxb.utils.domutils
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.or... | {
"content_hash": "d085b759fb0a47b4f7d6d3da86a791ec",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 104,
"avg_line_length": 40.80612244897959,
"alnum_prop": 0.6799199799949988,
"repo_name": "jonfoster/pyxb-upstream-mirror",
"id": "0c06be75895c8c0e80ac308190077614d1cf0f16",
... |
import os
from django.http import FileResponse
from wsgiref.util import FileWrapper
from settings.static import MEDIA_URL
# from django.core.servers.basehttp import FileWrapper
from django.views.generic import TemplateView
from django.shortcuts import render_to_response, render, redirect, get_object_or_404
from django.... | {
"content_hash": "9e82a8819166fd3d58452cc7ce540c64",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 109,
"avg_line_length": 30.664596273291924,
"alnum_prop": 0.6631557626088718,
"repo_name": "skylifewww/pangolin-fog",
"id": "bcd55a954f444fac9d69945cc831a2aa6b45537a",
"si... |
"""Helpers used to render lists.
"""
__authors__ = [
'"Daniel Hans" <daniel.m.hans@gmail.com>',
'"Chen Lunpeng" <forever.clp@gmail.com>',
'"Sverre Rabbelier" <sverre@rabbelier.nl>',
'"Pawel Solyga" <pawel.solyga@gmail.com>',
]
from django.utils import simplejson
from soc.logic import dicts
URL_PATTERN =... | {
"content_hash": "c0b197e214df7ad8ee9f00fa27aa2d42",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 78,
"avg_line_length": 24.014749262536874,
"alnum_prop": 0.6552020636285468,
"repo_name": "SRabbelier/Melange",
"id": "7fab20130bb619b796330a2ccb81e75c20b79c31",
"size": "... |
import logging
import os
import tempfile
from os.path import dirname, exists, join
from shutil import copy
from easyprocess import EasyProcess
from entrypoint2 import entrypoint
from PIL import Image # type: ignore
from eagexp import __version__
from eagexp.cmd import EagleError, command_eagle
from eagexp.util impor... | {
"content_hash": "797c6c631d52a3b8bc22da49ba9eac10",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 122,
"avg_line_length": 30.878260869565217,
"alnum_prop": 0.5775837792171219,
"repo_name": "ponty/eagexp",
"id": "4146100ad9d19cb20a3d502752661017a021ac80",
"size": "3551"... |
import sys
import os
from glob import glob
import platform
def running_under_virtualenv():
if hasattr(sys, 'real_prefix'):
return True
elif sys.prefix != getattr(sys, "base_prefix", sys.prefix):
return True
if os.getenv('VIRTUAL_ENV', False):
return True
return False
if os.en... | {
"content_hash": "3cbae3eba688723c8de4e27ea3395d06",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 76,
"avg_line_length": 32.80921052631579,
"alnum_prop": 0.5564467615801083,
"repo_name": "gg7/diamond",
"id": "0c4f2df06630896aaa0064db6c1ec6d3dd07de17",
"size": "5025",
... |
session.journalOptions.setValues(replayGeometry=COORDINATE,recoverGeometry=COORDINATE)
#-----------------------------------------------------
# Create a model.
modelName='GuoxiSuspensionBridge'
myModel = mdb.Model(name=modelName)
#-----------------------------------------------------
import GuoxiPackage.CreatePar... | {
"content_hash": "282630538427eb795b0e8fb84217794e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 86,
"avg_line_length": 26.5625,
"alnum_prop": 0.5129411764705882,
"repo_name": "zjkl19/AbaqusPython",
"id": "d1be97c7ff9fef4aa20d5064d8ce2a0a80bc8912",
"size": "627",
"bi... |
import os
import shutil
import subprocess
import sys
import tempfile
def setup_git_repo(worktree=False):
git_repo_dir = tempfile.mkdtemp()
to_rm = [git_repo_dir]
try:
subprocess.check_output(["git", "init", "."], cwd=git_repo_dir)
with open(f"{git_repo_dir}/committed", "w") as committed_f... | {
"content_hash": "ee3f85b9c144076d30d96ba9d158ba56",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 97,
"avg_line_length": 31.75977653631285,
"alnum_prop": 0.55584872471416,
"repo_name": "tqchen/tvm",
"id": "6080a4193dc0d169d3c95783cf2bb1fac79a84da",
"size": "6471",
"b... |
from __main__ import vtk, qt, ctk, slicer
import string
import collections
import FeatureWidgetHelperLib
class CheckableTabWidget(qt.QTabWidget):
def __init__(self, parent=None):
super(CheckableTabWidget, self).__init__(parent)
self.featureClassFeatureWidgets = collections.OrderedDict()
# hack ( QT... | {
"content_hash": "5d0c4640b4f6a410dd9b92b0c590d9af",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 163,
"avg_line_length": 38.58024691358025,
"alnum_prop": 0.70304,
"repo_name": "vnarayan13/Slicer-OpenCAD",
"id": "7b39afd50fd70b46cd2d7ef963752e86da8fa42a",
"size": "6250... |
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O errors
Functions:
cert_time_to_seconds -- convert time string used for certificate
notBefo... | {
"content_hash": "1831a4641dfc50fd1fadcfb45a24b397",
"timestamp": "",
"source": "github",
"line_count": 1034,
"max_line_length": 116,
"avg_line_length": 36.09090909090909,
"alnum_prop": 0.6124926309019776,
"repo_name": "franekp/millandict",
"id": "60703808793345f08ad3f4b71b61a47bba837ce4",
"size": ... |
from __future__ import print_function
from numpy import pi, arange, sin
import numpy as np
import time
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.glyphs import Circle
from bokeh.objects import (
Plot, DataRange1d, DatetimeAxis,
ColumnData... | {
"content_hash": "7a73c61087ce9ae6f66480c854ae96bb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 79,
"avg_line_length": 26.26530612244898,
"alnum_prop": 0.6985236985236986,
"repo_name": "jakevdp/bokeh",
"id": "30132385802ae5f0c02e2c34fb856423422f4476",
"size": "1287",
... |
"""Create pidstore branch."""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "f615cee99600"
down_revision = None
branch_labels = ("invenio_pidstore",)
depends_on = "dbdbc1b19cf2"
def upgrade():
"""Upgrade database."""
def downgrade():
"""Downgrade databa... | {
"content_hash": "488ccc909e6a78d57417828841ef7f0e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 40,
"avg_line_length": 18.166666666666668,
"alnum_prop": 0.7003058103975535,
"repo_name": "inveniosoftware/invenio-pidstore",
"id": "500943ad5553fc16af108949cca820b79db84e19"... |
from __future__ import print_function
from optparse import OptionParser
from os import path
import pipes
from sys import stderr
from util import check_output
def mvn(action):
return ['mvn', '--file', path.join(root, 'fake_pom_%s.xml' % action)]
def mvn(action):
return ['mvn', '--file', path.join(root, 'fake_pom_... | {
"content_hash": "dfc55a842d699cc13aba4d806fb4f254",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 27.569444444444443,
"alnum_prop": 0.6392947103274559,
"repo_name": "JulienGenoud/gitiles",
"id": "107db609da7a5b0f546758f5420e5b55005e5924",
"size": ... |
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) block height
1351.
"""
from test_framework.blocktools import create_coinbase, create_block, create_transaction
from test_framework.messages import CTransaction, msg_block, ToHex
from test_framework.p2p import P2PIn... | {
"content_hash": "840a79612debd108f09db18969da36a4",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 179,
"avg_line_length": 40.782051282051285,
"alnum_prop": 0.6468091795033009,
"repo_name": "litecoin-project/litecoin",
"id": "07ee6e61e28fcde478ebf240118cb66e9d372e8b",
"... |
from oslo_log import log as logging
from f5_openstack_agent.lbaasv2.drivers.bigip import resource_helper
from f5_openstack_agent.lbaasv2.drivers.bigip import ssl_profile
from requests import HTTPError
from f5_openstack_agent.lbaasv2.drivers.bigip import exceptions as f5_ex
LOG = logging.getLogger(__name__)
class L... | {
"content_hash": "50cdef07fc3e78df91dfa54e9f549869",
"timestamp": "",
"source": "github",
"line_count": 386,
"max_line_length": 79,
"avg_line_length": 40.012953367875646,
"alnum_prop": 0.5467788928455811,
"repo_name": "F5Networks/f5-openstack-agent",
"id": "ebb49a64e5b83af05fbe67d25b3b1c78e432409e",
... |
from django.db import models
from django.contrib.auth.models import User
class BlogPost(models.Model):
post_date = models.DateTimeField(auto_now_add=True)
update_date = models.DateTimeField(auto_now=True)
edited = models.BooleanField()
draft = models.BooleanField()
author = models.ForeignKey(User)
... | {
"content_hash": "245ec5c34752a795835ba41355d83921",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 55,
"avg_line_length": 36.09090909090909,
"alnum_prop": 0.7355163727959698,
"repo_name": "d3matt/d3matt.com",
"id": "78c1b4ce0ce334876860ae6dcf0fdd7c272d2910",
"size": "397... |
from .users import *
from .departments import *
from .auth import * | {
"content_hash": "5dcc04231b0b64e3d0687ae9cf8cf3a0",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.746268656716418,
"repo_name": "MishaGarbuz/WinVault",
"id": "542b26ac771a46f2c3bf9c32ed45dfd24dafecfd",
"size": "6... |
class SanicMeta(type):
@classmethod
def __prepare__(metaclass, name, bases, **kwds):
cls = super().__prepare__(metaclass, name, bases, **kwds)
cls["__slots__"] = ()
return cls
| {
"content_hash": "ec6209f530dcbe77daaed8f58055544d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 65,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.5528846153846154,
"repo_name": "ashleysommer/sanic",
"id": "2c6870c2598422fb8e2588d725a10a2e4bce0744",
"size": "20... |
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User
from django.core.paginator import ObjectPaginator, InvalidPage
import re
import urlparse
from datetime import datetime, timedelta
from gabaluu.form_choices import COMMENT_TYPES
class Site(object):
pass
class T... | {
"content_hash": "2d7cc7585ebf110a954d4ad513d5c74f",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 106,
"avg_line_length": 35.090395480225986,
"alnum_prop": 0.5378360972468201,
"repo_name": "CarlosGabaldon/zenopsis",
"id": "35656abf2b1b7e5d755289bbd91a38189a027842",
"si... |
from setuptools import setup
with open("README.rst") as f:
long_description = f.read()
version = "0.0.1"
setup(
name="lunar",
version=version,
packages=["lunar"],
author="jasonlyu",
author_email="jasonlvhit@gmail.com",
description="lunar is a WSGI based webframework in pure Python, withou... | {
"content_hash": "3d57ade3c2508ccf093954571ac8c24f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 105,
"avg_line_length": 30.125,
"alnum_prop": 0.6445366528354081,
"repo_name": "jasonlvhit/lunar",
"id": "15b0ffca935f94cc34d96048d77affbafab8d84c",
"size": "723",
"binar... |
import numpy as np
import pandas as pd
from scipy.stats.distributions import chi2, norm
from statsmodels.graphics import utils
def _calc_survfunc_right(time, status, weights=None, compress=True,
retall=True):
"""
Calculate the survival function and its standard error for a single
... | {
"content_hash": "b4ba3a5303fa153f58914aa649c6d7f9",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 120,
"avg_line_length": 31.227340267459137,
"alnum_prop": 0.5614293871336125,
"repo_name": "yl565/statsmodels",
"id": "abe0a84425292fedd864afd3040deb771a8391f6",
"size": "... |
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
from cryptography.hazmat.primitives import hashes
@utils.register_interface(hashes.HashContext)
class _HashContext(object):
def __init__(self, backen... | {
"content_hash": "4f7c9548ac9ab28f8cee9f059d56e434",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 40.92982456140351,
"alnum_prop": 0.5885126446635234,
"repo_name": "zlsun/XX-Net",
"id": "2c8fce1a43c5442c895303d7e060b83c0a5aa515",
"size": "2514",
... |
"""
Tests of neo.io.asciispiketrainio
"""
# needed for python 3 compatibility
from __future__ import absolute_import, division
import unittest
from neo.io import AsciiSpikeTrainIO
from neo.test.iotest.common_io_test import BaseTestIO
class TestAsciiSpikeTrainIO(BaseTestIO, unittest.TestCase, ):
ioclass = Ascii... | {
"content_hash": "8557b558f109b89019a7a7f1b86ef4b5",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 61,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.7331932773109243,
"repo_name": "rgerkin/python-neo",
"id": "b796ca607e1d88da80e94b3e37010c6c54f1ec54",
"size": "5... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Culture.abvdcode'
db.delete_column('cultures', 'abvdcode')
def backwards(... | {
"content_hash": "d8f63e7c1e82631c292170816dae67fd",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 195,
"avg_line_length": 73.86138613861387,
"alnum_prop": 0.5459785522788204,
"repo_name": "shh-dlce/pulotu",
"id": "b428739fa08df42392b920904cafbf6b6b6895bf",
"size": "748... |
import code
##
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U.
# This file is part of openmano
# 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
#
# ... | {
"content_hash": "ba6e90e533b895522e195f5014cc4c0b",
"timestamp": "",
"source": "github",
"line_count": 1620,
"max_line_length": 244,
"avg_line_length": 47.42345679012346,
"alnum_prop": 0.5566344727045531,
"repo_name": "me-ankur/openmano",
"id": "7d0ccac99606f0a546335d2c7043110845fad00a",
"size": "... |
import time
from weakref import ref
class Engines(object):
"""
Static collector for engines to register against.
"""
def __init__(self):
self._engines = {}
def register(self, engine):
self._engines[engine.__name__] = engine
self._engines[engine.name] = engine
def __ge... | {
"content_hash": "3b884c3e0de35570440bcafe0e5b0458",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 73,
"avg_line_length": 23.626666666666665,
"alnum_prop": 0.6032731376975169,
"repo_name": "wagnerrp/pytmdb3",
"id": "11019551cbf3ce8d5c84c169a1ff4ec321808023",
"size": "200... |
"""
Input file writer for SES3D 4.0.
:copyright:
Lion Krischer (krischer@geophysik.uni-muenchen.de), 2013
:license:
GNU General Public License, Version 3
(http://www.gnu.org/copyleft/gpl.html)
"""
EARTH_RADIUS = 6371 * 1000
import numpy as np
import obspy
import os
from wfs_input_generator import rotation... | {
"content_hash": "42b74ccdca76a83de7dc62050d26feac",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 79,
"avg_line_length": 43.182072829131656,
"alnum_prop": 0.5212765957446809,
"repo_name": "rafiqsaleh/VERCE",
"id": "510746e30d928bd4d0bf18714e1cd1e642703fe1",
"size": "15... |
"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '65fc9ede4746'
down_revision = None
branch_l... | {
"content_hash": "fa4555d11b008a88d22291201d54a5c5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 125,
"avg_line_length": 34.138888888888886,
"alnum_prop": 0.6834825061025224,
"repo_name": "luozhanxin/redash-docker",
"id": "91398a1574ddaea6162b96ce2e6e4e17673688e2",
"si... |
from django.apps import AppConfig
class CompanyConfig(AppConfig):
name = 'company'
verbose_name = 'Company'
| {
"content_hash": "6e6a87c4c9866eedeb10b02f123ae226",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 33,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.7203389830508474,
"repo_name": "roks0n/nomadboard",
"id": "7cd18217481c256a1c6621c1c95e4029ebaff436",
"size": "118... |
import os
import json
import datetime
from django import forms
from django.conf import settings
from django.db import transaction
from django.db import models
from apps.game.models import Game
from apps.team.models import Team
from django.contrib.auth.models import User
import utils.files.logics as fileLogics
impor... | {
"content_hash": "7373e14a1f924ee48a19aa18b7ec238a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 23.571428571428573,
"alnum_prop": 0.8212121212121212,
"repo_name": "zWingz/webbasketball",
"id": "a65b559e2134f7f370eb1834ed83f061fd3aaad2",
"size": ... |
import sys
import time
import numpy as np
import pytest
import ray
from ray.test_utils import get_other_nodes
import ray.ray_constants as ray_constants
@pytest.mark.skip(reason="No reconstruction for objects placed in plasma yet")
@pytest.mark.parametrize(
"ray_start_cluster",
[{
# Force at least on... | {
"content_hash": "2606b4fe56130adf9f6f78095ee18376",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 79,
"avg_line_length": 33.7888198757764,
"alnum_prop": 0.616360294117647,
"repo_name": "richardliaw/ray",
"id": "3dc65be557c14ed7fba2e533c493d9151475d12e",
"size": "5440",... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('activities', '0002_auto_20160527_0932'),
]
operations = [
migrations.RemoveField(
model_name='projectactivity',
name='allowed_submis... | {
"content_hash": "7dfaa86ea69ba202a1a21ed7e3a6affe",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 50,
"avg_line_length": 20.294117647058822,
"alnum_prop": 0.6115942028985507,
"repo_name": "zurfyx/simple",
"id": "a862679a4ec6f71e781fe440a0c8c3af61634b21",
"size": "417",
... |
"""
Created on Tue May 17 01:01:31 2016
@author: Ghareeb
"""
from PythonStarterApp import app
import os
if 'VCAP_APP_PORT' in os.environ:
appPort = os.environ['VCAP_APP_PORT']
else:
appPort = 5000
if 'VCAP_APP_HOST' in os.environ:
appHost = os.environ['VCAP_APP_HOST']
else:
appHost = '0.0.0.0'
... | {
"content_hash": "f566f43886aa68120cc3974d6b1a866c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.6513317191283293,
"repo_name": "YDnepr/practicalcourse",
"id": "f7e1754dee410196b1a84683110ad00db87d8e77",
"size"... |
import operator
import numpy as np
def l1_min_c(X, y, loss='l2', fit_intercept=True, intercept_scaling=1.0):
"""
Return the maximum value for C that yields a model with coefficients
and intercept set to zero for l1 penalized classifiers,
such as LinearSVC with penalty='l1' and linear_model.LogisticReg... | {
"content_hash": "6b236713c68e63838f58f95a0372545f",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 75,
"avg_line_length": 30,
"alnum_prop": 0.5781746031746032,
"repo_name": "ominux/scikit-learn",
"id": "b5fb30ef03fe3c0bed97adb1934dc01f9d136bc3",
"size": "2520",
"binary... |
import re
import pickle
import copy
import traceback
from collections import OrderedDict
from OpenGL.GL import *
from OpenGL.GL.shaders import *
from OpenGL.GL.shaders import glDeleteShader
import numpy as np
from PyEngine3D.Common import logger
from PyEngine3D.Utilities import Attributes, Logger
from PyEngine3D.App... | {
"content_hash": "dde018f7e7289676a1bc10a16d1a7a96",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 144,
"avg_line_length": 42.93421052631579,
"alnum_prop": 0.6086423536622739,
"repo_name": "ubuntunux/GuineaPig",
"id": "4e15d252c897513e7c98d17a7185cc3c96b40d97",
"size": ... |
horovod = "/home/wozniak/proj/horovod"
execfile(horovod+"/examples/keras_mnist.py")
| {
"content_hash": "1de5af91e12d0b259be772e5387987b8",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 44,
"avg_line_length": 42,
"alnum_prop": 0.7619047619047619,
"repo_name": "ECP-CANDLE/Supervisor",
"id": "cddb5c20dadf4fba259eecb09de4a97ccb480f58",
"size": "84",
"binary"... |
import tkinter
import math
import logging
import os
import logika_igre
import clovek
import racunalnik
import alfabeta
###########################################################################
# KONSTANTE #
###############################################... | {
"content_hash": "fefceb4b254a1302a2a02e60648815f1",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 149,
"avg_line_length": 40.894285714285715,
"alnum_prop": 0.5639628309928038,
"repo_name": "PircK/six",
"id": "ad14d249e9a39f9995c800b6f357caf7b5cd4e52",
"size": "14357",
... |
from setuptools import setup
setup(
name = "bibulous",
py_modules = ['bibulous', 'bibulous_test', 'bibulous_authorextract'],
version = "1.3.2",
description = "BibTeX replacement and enhancement",
author = "Nathan Hagen",
author_email = "and.the.light.shattered@gmail.com",
url = "https://git... | {
"content_hash": "63f7fcd07f29bfd31144739e49482e08",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 91,
"avg_line_length": 46.355555555555554,
"alnum_prop": 0.6922339405560882,
"repo_name": "ghareth/bibulous",
"id": "f5984ef2d132faa20bb6f6e9b5d0541cef6c10ca",
"size": "214... |
import pytest
from bayes_opt.bayesian_optimization import Queue
def test_add():
queue = Queue()
assert len(queue) == 0
assert queue.empty
queue.add(1)
assert len(queue) == 1
queue.add(1)
assert len(queue) == 2
queue.add(2)
assert len(queue) == 3
def test_queue():
queue =... | {
"content_hash": "750c3eb65c259be25a15a1fcfd98e50f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 49,
"avg_line_length": 15.63265306122449,
"alnum_prop": 0.5718015665796344,
"repo_name": "fmfn/BayesianOptimization",
"id": "0aba7b747bb261b395869a6b5e92640d28739f29",
"siz... |
from django import forms
from models import *
class ChoiceField(forms.ChoiceField):
def __init__(self, choices=(), empty_label=None, required=True, widget=None, label=None,
initial=None, help_text=None, *args, **kwargs):
# prepend an empty label if it exists (and field is not required!)
... | {
"content_hash": "fbc6f6c5ecb6604595761dabe1259de3",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 184,
"avg_line_length": 58.676923076923075,
"alnum_prop": 0.6604614577871002,
"repo_name": "inkasjasonk/rs",
"id": "7f461c15163dea98a7794afc7eccd0e0d32236b0",
"size": "3814... |
import numpy as np
import scipy.stats
from scipy.interpolate import interp1d, UnivariateSpline
NFILES = 5
FILENAME = "omw_" # prefix for files followed by filenumber
class Prior_class(object):
'''Prior class'''
def __init__(self,priorname,hyperparams):
'''Input:
prio... | {
"content_hash": "fb1c88f52c9cafb31f30e623baf57ef2",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 143,
"avg_line_length": 49.44047619047619,
"alnum_prop": 0.5294967493378281,
"repo_name": "EliseJ/astroABC",
"id": "a0cdc22d63c8168222c07305e7842bca240718f5",
"size": "4153... |
from rest_framework import serializers
from permabots.models import TelegramUser, TelegramChat, TelegramMessage, TelegramUpdate, TelegramCallbackQuery
from datetime import datetime
import time
class UserSerializer(serializers.HyperlinkedModelSerializer):
id = serializers.IntegerField()
class Meta:
mo... | {
"content_hash": "b5d1b40f3ae71c0198c1eed9eda20574",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 111,
"avg_line_length": 34.8421052631579,
"alnum_prop": 0.6623867069486404,
"repo_name": "jlmadurga/permabots",
"id": "970a5a46fafcae5bbc6c304e8016cbed6548e44f",
"size": "2... |
import datetime as dt
from operator import attrgetter
from random import Random
from .base import TohuBaseGenerator, SeedGenerator
from .logging import logger
from .primitive_generators import as_tohu_generator, Constant, Date, Timestamp as TimestampPrimitive
from .spawn_mapping import SpawnMapping
from .utils import... | {
"content_hash": "73a438d5e1cb4e348329f45fe138d8f4",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 137,
"avg_line_length": 36.137291280148425,
"alnum_prop": 0.6247047951535065,
"repo_name": "maxalbert/tohu",
"id": "208c0d93d46c8b6596283d30cdd31a0fd80db364",
"size": "194... |
import socket as socketlib
from _udt import *
import _udt
class socket(_udt.socket):
def connect(self, addr):
conn_addr = self._get_addr(addr)
return _udt.socket.connect(self, conn_addr)
def bind(self, addr):
bind_addr = self._get_addr(addr)
return _udt.socket.bind(self, bind_a... | {
"content_hash": "078832d59938330a352458bb3b0b0c7e",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 68,
"avg_line_length": 26.551020408163264,
"alnum_prop": 0.5541890853189854,
"repo_name": "beano/udt_py",
"id": "e6dff33b0395afeb4c167f25a3644b9a9fe270cc",
"size": "1357",
... |
import sys
import logging
import argparse
import getpass
from drf_client.connection import Api as RestApi, DEFAULT_HEADERS
from drf_client.exceptions import HttpClientError
LOG = logging.getLogger(__name__)
class BaseMain(object):
parser = None
args = None
api = None
options = {
'DOMAIN': No... | {
"content_hash": "5bb94fb2300afdb8e69b7cbf9de69579",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 89,
"avg_line_length": 30.38095238095238,
"alnum_prop": 0.5715778474399164,
"repo_name": "dkarchmer/django-rest-framework-client",
"id": "bc9af33e00b604d54a13cad007e7788d2e2... |
from rip.schema.base_field import FieldTypes
from rip.schema.integer_field import IntegerField
class IdField(IntegerField):
def __init__(self, entity_attribute='id'):
super(IdField, self).__init__(field_type=FieldTypes.READONLY,
required=False,
... | {
"content_hash": "4478c92d7b0759aea3f4ca44d7a8a17e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 71,
"avg_line_length": 42.09090909090909,
"alnum_prop": 0.509719222462203,
"repo_name": "Aplopio/rip",
"id": "0cebc72982f2adcd30d21c2d241e20a3d76e19fb",
"size": "463",
"b... |
import _plotly_utils.basevalidators
class ExponentformatValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="exponentformat", parent_name="carpet.baxis", **kwargs
):
super(ExponentformatValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "841514c363f45573b3f107841dd05076",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 37.8,
"alnum_prop": 0.5873015873015873,
"repo_name": "plotly/python-api",
"id": "48096e5970f9bb6efb36f727f9ca27822d939c7f",
"size": "567",
"binary"... |
from __future__ import unicode_literals
import base64
import codecs
import datetime
import distutils.util
from email import message_from_file
import hashlib
import imp
import json
import logging
import os
import posixpath
import re
import shutil
import sys
import tempfile
import zipfile
from . import __version__, Dis... | {
"content_hash": "5f4872ed7d001e87017142e29328cabb",
"timestamp": "",
"source": "github",
"line_count": 952,
"max_line_length": 82,
"avg_line_length": 40.00525210084034,
"alnum_prop": 0.4843376657476697,
"repo_name": "cjerdonek/pip",
"id": "5a161409c1e151827a97440de9d6fe12975be52d",
"size": "38268"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.