text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Python script create_data_libraries
Created by Anne Pajon under user 'pajon01' on 14/03/2016
Install bioblend
$ virtualenv venv
$ source venv/bin/activate
$ pip install bioblend
$ python create_data_libraries.py
"""
from bioblend import galaxy
import os
gi = galaxy.GalaxyInstance('http://52.55.43.141/', '3b8a7d... | {
"content_hash": "91d9f353a0b0eacb22d6bd9f295d0dcb",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 201,
"avg_line_length": 41.745098039215684,
"alnum_prop": 0.6965711601690935,
"repo_name": "galaxycam/galaxy-intro",
"id": "fef6e8b3e298685859403d98fc440e8db40b6bd7",
"size... |
__author__ = 'marvinsmith'
# Python Libraries
import curses, logging
# --------------------------------- #
# - Base Window Type - #
# --------------------------------- #
class Base_Window_Type(object):
# Window Title
window_title = ''
# Window render screen
screen = None
# Cur... | {
"content_hash": "9a6a3661488654b5f823679339a0286e",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 94,
"avg_line_length": 27.512345679012345,
"alnum_prop": 0.46017500560915414,
"repo_name": "marvins/LLNMS",
"id": "b6f875cb56f98710910fef4e9c65d11b0ca498d6",
"size": "4457... |
import os.path
import sublime
import sublime_plugin
PREF = "Preferences"
PREF_EXT = ".sublime-settings"
PREF_USER = PREF + PREF_EXT
PREF_SKIN = "Skins" + PREF_EXT
def decode_resource(name):
"""Load and decode sublime text resource.
Arguments:
name - Name of the resource file to load.
returns... | {
"content_hash": "dcb9a9d32413e1dc63c083fd7c3f3aa7",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 79,
"avg_line_length": 37.00982800982801,
"alnum_prop": 0.5513509924981743,
"repo_name": "deathaxe/sublime-skins",
"id": "ed714b184c442d3fde59bfd63af30c5a245f7d54",
"size"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('servico', '0039_eventodestatus_init'),
]
operations = [
migrations.RenameModel(
old_name='NumeroDocumento',
new_name='Documento',
... | {
"content_hash": "2bfa377db95b0773f7e589f246e54481",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 19.705882352941178,
"alnum_prop": 0.6029850746268657,
"repo_name": "anselmobd/fo2",
"id": "361b4a5617879e0525e35765ae4acf6156eada92",
"size": "409",
... |
import copy
from oslo_log import log as logging
from tempest_lib.services.identity.v2.token_client import TokenClientJSON
from tempest_lib.services.identity.v3.token_client import V3TokenClientJSON
from tempest.common import cred_provider
from tempest.common import negative_rest_client
from tempest import config
from... | {
"content_hash": "967917a8fe22641489392523dca8d8ab",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 79,
"avg_line_length": 48.947136563876654,
"alnum_prop": 0.6653766537665377,
"repo_name": "dkalashnik/tempest",
"id": "c0d45857c3485fded19be64d80be0265d7f584d7",
"size": "... |
import os.path as op
import warnings
import inspect
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
from nose.tools import assert_true, assert_raises, assert_equal
from mne import find_events, pick_types
from mne.io import read_raw_egi
from mne.io.tests.test_raw import _test_raw_reade... | {
"content_hash": "fb8a67cfa5f04d39f6fa46a939d98ad8",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 75,
"avg_line_length": 37.270270270270274,
"alnum_prop": 0.6316171138506164,
"repo_name": "jaeilepp/mne-python",
"id": "90af188772ee4d2617f87c3d8a98a8c9cc9d95af",
"size": ... |
from keystone.common import environment
from keystone import config
from keystone import tests
CONF = config.CONF
class IPv6TestCase(tests.TestCase):
@classmethod
def setUpClass(cls):
cls.skip_if_no_ipv6()
def setUp(self):
super(IPv6TestCase, self).setUp()
self.load_backends()
... | {
"content_hash": "56c4fff37b81fce9a588780beae98924",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 74,
"avg_line_length": 33.06060606060606,
"alnum_prop": 0.5811182401466545,
"repo_name": "townbull/keystone-dtrust",
"id": "e55847da2de1c3daae0395278a94aa460aea7ffb",
"size... |
from __future__ import division
import numpy
from python_speech_features import sigproc
from scipy.fftpack import dct
def mfcc(signal,samplerate=16000,winlen=0.025,winstep=0.01,numcep=13,
nfilt=26,nfft=512,lowfreq=0,highfreq=None,preemph=0.97,ceplifter=22,appendEnergy=True,
winfunc=lambda x:numpy.one... | {
"content_hash": "7924b6ff9679396e58132a7b4b5715e8",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 137,
"avg_line_length": 56.74731182795699,
"alnum_prop": 0.7019422074846045,
"repo_name": "ybdarrenwang/python_speech_features",
"id": "fa902a351a1f979727d5b0414bc9198038f5c... |
"""
Visitor doing some postprocessing on the astroid tree.
Try to resolve definitions (namespace) dictionary, relationship...
"""
from __future__ import print_function
import collections
import os
import traceback
import astroid
from astroid import bases
from astroid import exceptions
from astroid import manager
from... | {
"content_hash": "2cbf493620296e03aa8d62bae486c7f4",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 79,
"avg_line_length": 33.896067415730336,
"alnum_prop": 0.5849838402254082,
"repo_name": "mith1979/ansible_automation",
"id": "4fd86b8a1e5eae9d6c6e14f8aae69dbb3a2130ff",
... |
"""Support to help onboard new users."""
from typing import TYPE_CHECKING
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.storage import Store
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from . import views
from .const import (
D... | {
"content_hash": "11d754b235f1f2bc6bd71c084bc88906",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 88,
"avg_line_length": 28.710843373493976,
"alnum_prop": 0.6500209819555183,
"repo_name": "w1ll1am23/home-assistant",
"id": "c36f19fd28d9219941b6607f910ff5a356958d55",
"siz... |
from vt_manager.communication.geni.v3.tests.mockers.resource import ResourceMocker
class VTAMDriverMocker():
def __init__(self):
pass
def get_specific_server_and_vms(self, urn):
resources = list()
for i in range(0,10):
r = ResourceMocker()
r.set_component_id("t... | {
"content_hash": "dcb16c98f77b7e35b9b1965a4d049759",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 82,
"avg_line_length": 27.558441558441558,
"alnum_prop": 0.553722902921772,
"repo_name": "dana-i2cat/felix",
"id": "9ad59378d39b403a3c9f9eec29db1f12cc4849bd",
"size": "2122... |
import signal
import socket
from time import monotonic
import stomp
from stomp.listener import TestListener
from .testutils import *
@pytest.fixture()
def testlistener():
yield TestListener("123", print_to_log=True)
@pytest.fixture()
def conn(testlistener):
conn = stomp.Connection11(get_default_host())
... | {
"content_hash": "ecd9ea65ce18d8582d0506fb4a61cd03",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 101,
"avg_line_length": 37.05416666666667,
"alnum_prop": 0.6439896547846621,
"repo_name": "jasonrbriggs/stomp.py",
"id": "75147ca7c1918f6022ca1dc233d8dfc32d7f5790",
"size"... |
from os import path
from json import dumps
from flask import Flask, redirect, request
from flask.ext.autodoc import Autodoc
app = Flask(__name__)
app.debug = True
auto = Autodoc(app)
users = []
posts = []
class User(object):
def __init__(self, username):
self.username = username
users.append(... | {
"content_hash": "a273854249d3087dc08b90863fc44033",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 124,
"avg_line_length": 22.654867256637168,
"alnum_prop": 0.613671875,
"repo_name": "acoomans/flask-autodoc",
"id": "f32436c897d00d4004ea25ee06a1db13a37ede43",
"size": "25... |
"""
Circular Date & Time Picker for Kivy
====================================
(currently only time, date coming soon)
Based on [CircularLayout](https://github.com/kivy-garden/garden.circularlayout).
The main aim is to provide a date and time selector similar to the
one found in Android KitKat+.
Simple usage
--------... | {
"content_hash": "fe3221aa9d144b85d4291a9c215e0c7f",
"timestamp": "",
"source": "github",
"line_count": 768,
"max_line_length": 120,
"avg_line_length": 34.946614583333336,
"alnum_prop": 0.5836283020976937,
"repo_name": "cruor99/KivyMD",
"id": "fbc739546c9d6799da2785e8439def6741de204a",
"size": "268... |
import unittest
import transaction
from pyramid import testing
from .models import DBSession
from .assets import (
get_current_time,
convert_to_utc_seconds,
convert_to_datetime,
)
class TestTunerSetup(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
from sqlalchemy... | {
"content_hash": "95b8e5282e87b0b6e0be02ac32aba248",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 80,
"avg_line_length": 29.651724137931033,
"alnum_prop": 0.5384347017095011,
"repo_name": "demophoon/dvr",
"id": "4b37c06a38356f962cb70b9b53923e28c4bf1e36",
"size": "8599"... |
import datetime
import json
import logging
import re
from typing import Literal, Optional
import requests
from backend.common.models.keys import Year
from backend.common.sitevars.fms_api_secrets import FMSApiSecrets
TCompLevel = Literal["qual", "playoff"]
class FRCAPI:
STORAGE_BUCKET_PATH = "tbatv-prod-hrd.a... | {
"content_hash": "6ea78eb979bdc021990b9577bf3fb5fe",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 97,
"avg_line_length": 37.14418604651163,
"alnum_prop": 0.5954169797145004,
"repo_name": "the-blue-alliance/the-blue-alliance",
"id": "14604026d0c5319e2df34a618e68640c211922... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stein', '0040_auto_20171105_1439'),
]
operations = [
migrations.AlterField(
model_name='quizanswer',
name='feedback_correct',
field=models.CharField(blan... | {
"content_hash": "30fc5837525a8f2a940a3a16f5ff554f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 124,
"avg_line_length": 36.903225806451616,
"alnum_prop": 0.6118881118881119,
"repo_name": "GeoMatDigital/django-geomat",
"id": "492659b4fc6193e63ccecdd23ff64e0fdfd35ff0",
... |
'''
whoisLib.py
.checks for PKL/CSV existence, if not notifies user and gives
chance to cancel, then performs the full scrape of tld/whois pairings
-u --update runs updateTLD to update and then export
-w --whois runs getWhoisServer to find tld passed, if not found, scrapes
iana for the TLD, adds it t... | {
"content_hash": "ca6e0fe89eb26abc0c6a06aafd776d80",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 111,
"avg_line_length": 25.497041420118343,
"alnum_prop": 0.6109306103504293,
"repo_name": "teekayzed/whopys",
"id": "9f3fb7cec185a95a971e99983e6fd8621aa835ec",
"size": "9... |
"""This module contains all of the core logic for beets' command-line
interface. To invoke the CLI, just call beets.ui.main(). The actual
CLI commands are implemented in the ui.commands module.
"""
from __future__ import print_function
import locale
import optparse
import textwrap
import sys
from difflib import Sequen... | {
"content_hash": "2007dbbfbb76d379a8599c54322d40d2",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 88,
"avg_line_length": 33.56879606879607,
"alnum_prop": 0.5959377859103385,
"repo_name": "google-code-export/beets",
"id": "488974deec487f6cf05aac1cefeecbc40036d7a0",
"siz... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
from datetime import date, datetime, timedelta
def get_sql_engine(db_dict):
import sqlalchemy
connection_str = 'mysql://{0}:{1}@{2}/{3}'\
.format(db_dict['user'], db_dict['... | {
"content_hash": "01a2b5f1b645f0a137a24151f9ff3afe",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 70,
"avg_line_length": 30.64,
"alnum_prop": 0.5502610966057441,
"repo_name": "bowen0701/python_handson",
"id": "90a1021cfe399f5925d6e13067a724ca47343699",
"size": "1532",
... |
import os
import unittest
from telemetry.internal.results import base_test_results_unittest
from telemetry.internal.results import page_test_results
from telemetry import page as page_module
from telemetry.page import page_set
from telemetry.timeline import trace_data
from telemetry.value import failure
from telemetry... | {
"content_hash": "cb86dd7fb765732b88a34d166162a254",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 80,
"avg_line_length": 38.16265060240964,
"alnum_prop": 0.6951854775059195,
"repo_name": "SaschaMester/delicium",
"id": "dcfbb6488950331d4472d9e4482f6ef4f54f1710",
"size":... |
from asyncio import iscoroutinefunction
from typing import Any, Callable
__all__ = ("VirtualStep",)
class VirtualStep:
def __init__(self, orig_step: Callable[..., None]) -> None:
self._orig_step = orig_step
@property
def name(self) -> str:
return self._orig_step.__name__
def is_coro... | {
"content_hash": "dd79df21895c1a329e23dcc1915cfd59",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 86,
"avg_line_length": 29.28,
"alnum_prop": 0.5819672131147541,
"repo_name": "nikitanovosibirsk/vedro",
"id": "6f5893ce9f46511622327e72f288653fc5f653e4",
"size": "732",
"... |
import sys, os,getopt,shutil
from subprocess import call, Popen, PIPE
def precompile():
mydir = os.getcwd();
os.chdir('../data.common')
if not os.path.isfile('lineNumber100000h2.csv.gz'):
print 'File does not exist, creating.'
sys.path.append(os.getcwd())
amp = __import__('ampFile')... | {
"content_hash": "13f2f574db4bf2d89c8b08e731b2f2de",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 30.3125,
"alnum_prop": 0.6144329896907217,
"repo_name": "hildrum/streamsx.fastcsv",
"id": "cd80ab03dd72c6dc86d827e10ffa0b0c3a6ff9fe",
"size": "507",
... |
import numpy as np
from .base import LinearClassifierMixin, SparseCoefMixin
from ..feature_selection.from_model import _LearntSelectorMixin
from ..svm.base import BaseLibLinear
class LogisticRegression(BaseLibLinear, LinearClassifierMixin,
_LearntSelectorMixin, SparseCoefMixin):
"""Logis... | {
"content_hash": "70b9b655066de68800f078350e860dfb",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 78,
"avg_line_length": 37.98571428571429,
"alnum_prop": 0.6572019556224145,
"repo_name": "treycausey/scikit-learn",
"id": "e347c37dc4deb45a9bcf697e0f41be33c9845ce0",
"size... |
"""A widget to select a file path.
The widget stores previously selected paths in QSettings
Example
-------
def func(t):
print(t)
from cmt.widgets.filepathwidget import FilePathWidget
widget = FilePathWidget(label='My File',
file_mode=FilePathWidget.existing_file,
... | {
"content_hash": "794de0ea875e027d29c1991bd4df017a",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 86,
"avg_line_length": 31.06,
"alnum_prop": 0.605494741360807,
"repo_name": "chadmv/cmt",
"id": "c854000d13861c4fb4c8bb2156618c2531949cb8",
"size": "4659",
"binary": fal... |
import abc
import collections
import threading
import queue
import os
import time
import types
from nltk import BlanklineTokenizer, PunktSentenceTokenizer, WhitespaceTokenizer
from xml.dom.minidom import Node, parseString
import re
class ComparableMixin(object):
"""
This mixin is meant to make implementing t... | {
"content_hash": "e5ecc5345782c509c0e484b066284035",
"timestamp": "",
"source": "github",
"line_count": 472,
"max_line_length": 119,
"avg_line_length": 35.692796610169495,
"alnum_prop": 0.6010565679349439,
"repo_name": "bbc/ebu-tt-live-toolkit",
"id": "00b3bc09c832a879cc405ed6a093f0d85faaf6dd",
"si... |
"""
Test the analysis code for the model chat task.
"""
import glob
import json
import os
import re
from typing import Any, Dict, List
import pytest
from pytest_regressions.file_regression import FileRegressionFixture
import parlai.utils.testing as testing_utils
try:
from parlai.crowdsourcing.tasks.model_chat... | {
"content_hash": "04da2051ee2a517b26e4d27fd2126d6b",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 88,
"avg_line_length": 37.457317073170735,
"alnum_prop": 0.4956861468337946,
"repo_name": "facebookresearch/ParlAI",
"id": "d2d2a1c3a85a886eab6c0fb8ff0dab3983ab4da4",
"siz... |
from ._deepgram import Deepgram
| {
"content_hash": "c82e34df62ad7229299a9d992f2d912f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.8125,
"repo_name": "crdunwel/deepgram-python-wrapper",
"id": "3e2f101f2c02b72433fd50ee2ac203afb4ec4d25",
"size": "32",
"binary":... |
"""
Rename status field values
Create Date: 2016-04-22 14:38:04.330718
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from alembic import op
# revision identifiers, used by Alembic.
revision = "5599d1769f25"
down_revision = "33459bd8b70d"
TRANSLAT... | {
"content_hash": "3074e5d8b449805b243aaf571b237eff",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 27.953846153846154,
"alnum_prop": 0.6461199779856907,
"repo_name": "prasannav7/ggrc-core",
"id": "4f3dde67cf0f9f051661b9493261ae2fa464336b",
"size": ... |
class User:
def __init__(self, _id, username, password):
self.id = _id
self.username = username
self.password = password | {
"content_hash": "2bc12a89240b8622a71aaa0ae6027439",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 29.6,
"alnum_prop": 0.581081081081081,
"repo_name": "ysabel31/Python",
"id": "17acc43870e95b70f043da89141fcf572457ad78",
"size": "148",
"binary": fa... |
import codecs
import lzma
import argparse
import sys
def main(wordmap,infile,outfile,wordsep):
wordmap = {p.split()[0]: p.strip().split(None,1)[1] for p in wordmap}
wordmap["<s>"] = "<s>"
wordmap["</s>"] = "</s>"
for line in infile:
parts = line.strip().split()
if parts[0] != "<s>... | {
"content_hash": "60903c1e18ccdcf491879c81a06fff40",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 146,
"avg_line_length": 33.029411764705884,
"alnum_prop": 0.6073018699910953,
"repo_name": "psmit/kaldi-recipes",
"id": "1105f1089ada9a2a777a63aceafe86b2994ccb7b",
"size": ... |
from pyspark.mllib.classification import NaiveBayes
from pyspark.mllib.regression import LabeledPoint
from numpy import array
from pyspark import SparkContext, SparkConf
import sys
import timeit
appName = "DDE"
# Setup Spark configuration
conf = SparkConf().setAppName(appName).setMaster("local")
sc = SparkContext(conf... | {
"content_hash": "71d61a1b7d94f886c32fa332bc6eac3d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 91,
"avg_line_length": 25.431818181818183,
"alnum_prop": 0.7363717605004468,
"repo_name": "monkeyGoCrazy/cloudComputing",
"id": "0e478b7c9ec5b7af9cafdd1f8ed3192ac45d0775",
... |
import yaml
def format_assignment_yaml(content):
return '---\n' + yaml.safe_dump(content, default_flow_style=False)
| {
"content_hash": "f36943c52577d1c31846a0d67732cd82",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 70,
"avg_line_length": 24.4,
"alnum_prop": 0.7131147540983607,
"repo_name": "StoDevX/cs251-toolkit",
"id": "18f4406086583b471a59b2f6a19b670433d2d1ea",
"size": "122",
"bina... |
"""Here is defined the EArray class."""
import numpy
from tables.utils import convert_to_np_atom2, SizeType
from tables.carray import CArray
from tables._past import previous_api, previous_api_property
# default version for EARRAY objects
# obversion = "1.0" # initial version
# obversion = "1.1" # support for... | {
"content_hash": "313c58a32890cf12e6ea8ef9cff36838",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 78,
"avg_line_length": 37.963855421686745,
"alnum_prop": 0.6004443033957474,
"repo_name": "tp199911/PyTables",
"id": "82b6e987673d7139d145cf1bb1613477330a5c54",
"size": "9... |
"""
Django settings for django-example project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Bui... | {
"content_hash": "116e669ee56cbf39cd26c8d1e8c269e3",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 71,
"avg_line_length": 25.980392156862745,
"alnum_prop": 0.6916981132075471,
"repo_name": "madron/django-example",
"id": "19903519cc05ef23a2f768d796540783b87335b3",
"size"... |
'''
Created on Apr 3, 2014
@author: tangliuxiang
'''
from SmaliEntry import SmaliEntry
class SmaliClass(SmaliEntry):
'''
classdocs
'''
def getSimpleString(self):
return "%s %s" %(self.getType(), self.getClassName())
| {
"content_hash": "66954da044ecbb3bf79dd807050833e9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 16.6,
"alnum_prop": 0.6265060240963856,
"repo_name": "HackerTool/tools",
"id": "8188e6fb6badfd896579a2e32ad290ed0fa48c2b",
"size": "249",
"binary":... |
import pygame
from core import addVectors
from math import pi as Pi, sin, cos, hypot, atan2
from surface import screen, width, height
#-- PARTICLE DEFINITION ---------------------------->>>
class Particle:
'''
All you need to is a coordinate tuple and a radius to instantiate.
e.g. particle = Particl((50,... | {
"content_hash": "cb36f6be115b5d334be8b2aeea0e7224",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 103,
"avg_line_length": 33.743589743589745,
"alnum_prop": 0.540273556231003,
"repo_name": "withtwoemms/pygame-explorations",
"id": "82c7110887f1572929f177ee2de731cd1bb57ced",... |
"""A model representing configuration config."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from google.appengine.api import memcache
from google.appengine.ext import ndb
from loaner.web_app.backend.lib import utils
_CONFIG_NOT_FOUND_MSG =... | {
"content_hash": "5941ee6cc26f2675288b8f32ea714b74",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 33.94957983193277,
"alnum_prop": 0.6915841584158415,
"repo_name": "google/loaner",
"id": "8df1a27fb56245a5e1a955ae55a56c12b955f91f",
"size": "4637",... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from setuptools import setup
setup(
name='pyddp',
version='0.4.0',
description='Distributed Data Protocol (DDP)',
author='Peter Sutton',
author_email='foxxy@foxdogstudios.com',
url='ht... | {
"content_hash": "9f4d270b9d5d0b05391507b98fb11dc2",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 26.58139534883721,
"alnum_prop": 0.5870516185476815,
"repo_name": "foxdog-studios/pyddp",
"id": "ea55b4825398d32f3987043514a61a85df1d9421",
"size": "... |
import shelve
import random
import textwrap
from time import sleep, time
from collections import namedtuple
from bearlibterminal import terminal as term
import spaceship.strings as strings
from spaceship.scene import Scene
from spaceship.screen_functions import *
import spaceship.tools as tools
import spaceship.action ... | {
"content_hash": "251be27750b0478ab51561dfc5c51507",
"timestamp": "",
"source": "github",
"line_count": 1252,
"max_line_length": 109,
"avg_line_length": 36.3370607028754,
"alnum_prop": 0.4568514529388491,
"repo_name": "whitegreyblack/Spaceship",
"id": "b158cb30e708401ab0b90507dc0cab654e542745",
"si... |
from mayavi import mlab
from BDSpace.Coordinates import Cartesian
from BDSpace.Curve.Parametric import Line
import BDSpaceVis as Visual
coordinate_system = Cartesian()
fig = mlab.figure('CS demo', bgcolor=(0, 0, 0))
line = Line(name='Line', coordinate_system=coordinate_system, a=1, b=2, c=0, start=0, stop=1)
line_vis... | {
"content_hash": "6e99757f2f9ec92440273d74d9a8af6d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 36.23076923076923,
"alnum_prop": 0.7494692144373672,
"repo_name": "bond-anton/Space",
"id": "3c11a12bbe1b989121b542cd98d8c5f872c9729e",
"size": "471"... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('chart_blank05.xlsx')
self.ignore_el... | {
"content_hash": "21eb4f709df87eb3cb2f98e5f41fc663",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 25.84,
"alnum_prop": 0.5820433436532507,
"repo_name": "jmcnamara/XlsxWriter",
"id": "344f183fa7125ecf8dea2f21162d41513c1756a7",
"size": "1505",
"bi... |
"""
FVCproductions
Print your name out using the print function.
The print function is called through print().
You will also need quotation marks around your name.
"""
name = "FVCproductions"
major = "Computer Science"
print (name, major) | {
"content_hash": "0ac6f1d4569776f2584aa37523dad161",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 53,
"avg_line_length": 15.75,
"alnum_prop": 0.7222222222222222,
"repo_name": "fvcproductions/BITS",
"id": "15550f67746147ab38a09c1259df4f9c548128e1",
"size": "252",
"bina... |
import argparse
import base64
import json
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
import time
from PIL import Image
from PIL import ImageOps
from flask import Flask, render_template
from io import BytesIO
from keras.models import load_model
from keras.preprocessing.image import ImageD... | {
"content_hash": "c4c3b62c6d95997c70ccb002efc96c52",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 112,
"avg_line_length": 29.7027027027027,
"alnum_prop": 0.7056414922656961,
"repo_name": "brianz/udacity-sdc-p3",
"id": "a80f21ee84d5257b5b013f5509de92f0ac807157",
"size": ... |
"""
flask_security.views
~~~~~~~~~~~~~~~~~~~~
Flask-Security views module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import Blueprint, after_this_request, current_app, redirect, request
from flask_login import current_user
from werkzeug.local ... | {
"content_hash": "83322fa545b51848f22d90e195b55f38",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 79,
"avg_line_length": 31.14801444043321,
"alnum_prop": 0.613467779323134,
"repo_name": "inveniosoftware/flask-security-fork",
"id": "6ba8ada5f7ba789f052c0239cc35cca0ebfea96... |
import unittest
from conans.test.utils.tools import TestClient
class BasicTest(unittest.TestCase):
def help_test(self):
conan = TestClient()
conan.run("")
self.assertIn('Conan commands. Type $conan "command" -h', conan.user_io.out)
| {
"content_hash": "537b5e2930cc89eaf769f21aaaab3e30",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 84,
"avg_line_length": 26.3,
"alnum_prop": 0.6768060836501901,
"repo_name": "mropert/conan",
"id": "79f06fae072132960dc0df461295e8362a522193",
"size": "263",
"binary": fa... |
import sys, math, re, argparse
from xml.dom import minidom
from multiprocessing import Process, Queue
from graph import *
import shapely.ops
from shapely.geometry import LineString
import svg.path
import kdtree
try:
import silhouette
units = silhouette.units
except ImportError:
sys.stderr.write("Warning: ... | {
"content_hash": "5328470233e6214ad609fc69283d139d",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 105,
"avg_line_length": 30.056497175141242,
"alnum_prop": 0.5714285714285714,
"repo_name": "pklaus/silhouette",
"id": "91f84e7a22581febbbe38a712e7a128f894c79f9",
"size": "... |
"""A helper class for reading in and dealing with tests expectations
for layout tests.
"""
from collections import defaultdict
import logging
import re
from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter
_log = logging.getLogger(__name__)
# Test expectation and specifier constan... | {
"content_hash": "df4654ecdda9afa8698fa4022bc53a96",
"timestamp": "",
"source": "github",
"line_count": 1125,
"max_line_length": 171,
"avg_line_length": 45.04,
"alnum_prop": 0.6371817643576081,
"repo_name": "Workday/OpenFrame",
"id": "a3f161ed5d72b8917cafca6cbe1de62e11691e41",
"size": "52200",
"b... |
'''
Helloworld Modular Input Script
Copyright (C) 2012 Splunk, Inc.
All Rights Reserved
'''
import sys,logging
import xml.dom.minidom, xml.sax.saxutils
#set up logging
logging.root
logging.root.setLevel(logging.ERROR)
formatter = logging.Formatter('%(levelname)s %(message)s')
#with zero args , should go to STD ERR
... | {
"content_hash": "b35a218da1bdb63d57521de0c838cfa8",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 109,
"avg_line_length": 32.7909604519774,
"alnum_prop": 0.5947622329427981,
"repo_name": "damiendallimore/SplunkModularInputsPythonFramework",
"id": "cc1bf82e46857de05b5fe0c... |
from django import forms
from django.utils.translation import gettext as _
from dcim.models import DeviceRole, Platform, Region, Site, SiteGroup
from extras.forms import LocalConfigContextFilterForm
from ipam.models import VRF
from netbox.forms import NetBoxModelFilterSetForm
from tenancy.forms import ContactModelFilt... | {
"content_hash": "eefa8442781a55ebc2a31e4151e560fc",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 116,
"avg_line_length": 30.03553299492386,
"alnum_prop": 0.6200777420990367,
"repo_name": "digitalocean/netbox",
"id": "2f386e8893a1287b56f224a5b374fa6112b9634e",
"size": ... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "1f84bd06e3cb57ff873effc7025d7bab",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 312,
"avg_line_length": 31.898230088495577,
"alnum_prop": 0.6035511166597309,
"repo_name": "kubernetes-client/python",
"id": "1c7f957dfc5005233e681674283e3f80e13e632b",
"s... |
from abc import ABC, abstractmethod
import torch
# x is between 0 and 1
from hanlp_common.configurable import AutoConfigurable
def linear_growth_weight_scheduler(x):
return x
def linear_decay_weight_scheduler(x):
return 1 - x
def constant_temperature_scheduler(logits_S, logits_T, base_temperature):
... | {
"content_hash": "5164a403226fe6a8a17c9acc55306de0",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 116,
"avg_line_length": 28.71311475409836,
"alnum_prop": 0.6257493576934057,
"repo_name": "hankcs/HanLP",
"id": "44c725f1adc20660176567841baa80899ee31d92",
"size": "3585",... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django_bundles.conf import default_settings
class SettingsHelper(object):
def __init__(self, user_settings, default_settings, optional_defaults):
self.user_settings = user_settings
self.default_settings ... | {
"content_hash": "23ae5f0b3e05455178dd7a2465999e4e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 88,
"avg_line_length": 30.352941176470587,
"alnum_prop": 0.6957364341085271,
"repo_name": "sdcooke/django_bundles",
"id": "ad23fdcd1592ab959fda7cb053ddadc7a1ed92ca",
"size"... |
from tcga_encoder.utils.helpers import *
from tcga_encoder.data.data import *
#from tcga_encoder.data.pathway_data import Pathways
from tcga_encoder.data.hallmark_data import Pathways
from tcga_encoder.definitions.tcga import *
#from tcga_encoder.definitions.nn import *
from tcga_encoder.definitions.locations import *
... | {
"content_hash": "cb401fe13b161b4203b16f14aa0efb52",
"timestamp": "",
"source": "github",
"line_count": 497,
"max_line_length": 140,
"avg_line_length": 31.52112676056338,
"alnum_prop": 0.6123452061789864,
"repo_name": "tedmeeds/tcga_encoder",
"id": "0f5fdba6b57eb5aa017ee96bbbc7f660c18da7fb",
"size"... |
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_datastore
short_description: Manage a datastore on ESXi host
description:
... | {
"content_hash": "31cc15315d80bc6972716805dd2f79a8",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 121,
"avg_line_length": 41.33228840125392,
"alnum_prop": 0.6166856276071293,
"repo_name": "SergeyCherepanov/ansible",
"id": "1d15985e8b75f5fd134b3abd41a585b39ea5a483",
"si... |
from . import gates
from .util import Pos, as_bin, from_bin
from .connectable import Connectable
from .connectable_registry import ConnectableRegistry
from .exceptions import NoSuchComponentType
@ConnectableRegistry.register
class HeaderConnectable(Connectable):
ttype = 'header'
def __init__(self, name, args... | {
"content_hash": "91dc25b18d0b3858e0d7c6ef863a6d39",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 77,
"avg_line_length": 25.48085106382979,
"alnum_prop": 0.5818303273213092,
"repo_name": "Mause/circuitry",
"id": "715e58ef89791cfd7b75a0e5726d7672473058e1",
"size": "5988... |
from setuptools import setup, Extension
import numpy as np
import platform
version = '0.1.1'
ext_modules = []
setup (name = 'droneapi',
zip_safe=True,
version = version,
description = 'Python language bindings for the DroneApi',
long_description = '''Python language bindings for the Drone... | {
"content_hash": "cbb3b8799ff26d28101cfb1191a87b6d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 40.733333333333334,
"alnum_prop": 0.5638297872340425,
"repo_name": "mrpollo/droneapi-python",
"id": "3910c9c9efe20030ca5b2d3446ede36938f25e2c",
"siz... |
from .cloudwatch_event import *
| {
"content_hash": "8458e22cf1c08ec752fb3608ac0c34e8",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.78125,
"repo_name": "gogoair/foremast",
"id": "9ac45dce626a4677a53a70a8667ad15a9cc28f5c",
"size": "660",
"binary": false,
"cop... |
import random
import opties
def main():
o = opties.list
print random.choice(o)
if __name__ == '__main__':
main() | {
"content_hash": "8702c40af1c6f80995fd3b3e771ea9bf",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 26,
"avg_line_length": 9.384615384615385,
"alnum_prop": 0.6065573770491803,
"repo_name": "ArtezGDA/text-IO",
"id": "7a97ce16c82d74dcdce2d079e7a1be4dc8cbe857",
"size": "122"... |
from collections import namedtuple
import os
import posixpath
import errno
import math
try:
import urlparse as url_parser
except ImportError:
import urllib.parse as url_parser
from m3u8 import parser
class M3U8(object):
'''
Represents a single M3U8 playlist. Should be instantiated with
the conte... | {
"content_hash": "f7440cd981ff947ef21a07881e62c8cb",
"timestamp": "",
"source": "github",
"line_count": 658,
"max_line_length": 112,
"avg_line_length": 33.243161094224924,
"alnum_prop": 0.5876382920362073,
"repo_name": "cristina0botez/m3u8",
"id": "c30650578cdde3558dc1f5dba35f8c92f5d1a155",
"size":... |
"""
@author: letian
@homepage: http://www.letiantian.me
@github: https://github.com/someus/
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import networkx as nx
import numpy as np
from . import util
from .Segmentation import Segmentation
class Tex... | {
"content_hash": "6c882773286b8e19ecc76419941f7aa9",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 109,
"avg_line_length": 35.58064516129032,
"alnum_prop": 0.5170746449078272,
"repo_name": "someus/TextRank4ZH",
"id": "6e14c2596d0571c66c41aa21f2dc6947b3880474",
"size": "3... |
from __future__ import absolute_import
import re
import logging
from django.db import IntegrityError, transaction
from six import BytesIO
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.project import ProjectEndpoint, ProjectReleasePermission
from sentry.api.c... | {
"content_hash": "23928825b21b664a1387e8bff9d7f2f1",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 99,
"avg_line_length": 38.108108108108105,
"alnum_prop": 0.6009929078014185,
"repo_name": "mvaled/sentry",
"id": "2c5640ab24aa81f5bfe759d8fd88bd5b4079a407",
"size": "7050"... |
from __future__ import annotations
from textwrap import dedent
import pytest
from pants.backend.codegen.thrift import thrift_parser
from pants.backend.codegen.thrift.target_types import ThriftSourceField
from pants.backend.codegen.thrift.thrift_parser import ParsedThrift, ParsedThriftRequest
from pants.engine.addres... | {
"content_hash": "61ba60588ab39f98719d4e9a4b683654",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 91,
"avg_line_length": 27.892857142857142,
"alnum_prop": 0.5953905249679897,
"repo_name": "benjyw/pants",
"id": "25e2b2b4d7b26b2b478b520d8a46baf1869ad8f1",
"size": "2491",
... |
from messente.api.sms import api
from messente.api.sms.constants import VERSION
from messente.api.sms.messente import Messente
__all__ = ["api", "VERSION", "Messente"]
| {
"content_hash": "f18b472009fea18ead57d65e48e6516f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 46,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.7529411764705882,
"repo_name": "messente/messente-python",
"id": "6cf74495d13a31c74f334d23f6982b0912dd5018",
"size... |
import uuid
import json
import logging
import unittest
import bus
import server
import repository
import rangevoting
class SpyBus:
def __init__(self):
self.last_command = None
def execute(self, command):
self.last_command = command
return bus.Result()
class SpyQueryDispatcher:
... | {
"content_hash": "4a615bcc14345c850cd289cd67e0cb96",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 136,
"avg_line_length": 40.794117647058826,
"alnum_prop": 0.6250901225666907,
"repo_name": "guillaumevincent/rangevoting",
"id": "e8205d74861d98128a8555105d07277edbdefc9b",
... |
from Connector import CoreConnector
from m5.params import *
from m5.proxy import *
class X86Connector(CoreConnector):
type = 'X86Connector'
cxx_header = "mem/dtu/connector/x86.hh"
irq_master_port = MasterPort("Port to send the IRQs to")
| {
"content_hash": "b52488256c7be85feeb174705dcc7242",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 31.25,
"alnum_prop": 0.736,
"repo_name": "TUD-OS/gem5-dtu",
"id": "f57bbd3f11e0ec4d5841d9c044e96bcc7b136f6e",
"size": "1811",
"binary": false,
"co... |
from django.contrib import admin
from django.utils.translation import ugettext_noop as _
from transurlvania.defaults import *
admin.autodiscover()
urlpatterns = lang_prefixed_patterns('garfield.views',
url(r'^$', 'home'),
url(r'^admin/', include(admin.site.urls)),
(r'^garfield/', include('garfield.urls')... | {
"content_hash": "9af49c026125ea5e7660a1c654871b84",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 56,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.6701244813278008,
"repo_name": "trapeze/transurlvania",
"id": "c143f1e512e62a50c3a4c52aa2300f55f97fccec",
"size": ... |
import sys
import os
import unittest
import json
sys.path.append(os.path.join(os.path.dirname(__file__), '../lib'))
from testlib import get_fixture, random_string, function, random_int
from testlib import EapiConfigUnitTest
import pyeapi.api.interfaces
INTERFACES = ['Ethernet1', 'Ethernet1/1', 'Vlan1234', 'Manageme... | {
"content_hash": "0f48bc00a118d31650efdd94efe217ab",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 79,
"avg_line_length": 41.6710182767624,
"alnum_prop": 0.6025062656641604,
"repo_name": "SivagnanamCiena/pyeapi",
"id": "e7d8cbe3b9183c11bf2432e2901614dc63c7bd93",
"size":... |
"""
Policy engine for neutron. Largely copied from nova.
"""
import itertools
import re
from oslo.config import cfg
from neutron.api.v2 import attributes
from neutron.common import exceptions
import neutron.common.utils as utils
from neutron import manager
from neutron.openstack.common import importutils
from neutro... | {
"content_hash": "c9209a19aba731fd3c99f1d675c539b4",
"timestamp": "",
"source": "github",
"line_count": 407,
"max_line_length": 78,
"avg_line_length": 41.75921375921376,
"alnum_prop": 0.5951988703224288,
"repo_name": "citrix-openstack-build/neutron",
"id": "a129813a2139dad48e17633ce25e791c51effe5c",
... |
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pp... | {
"content_hash": "2c9b63b17a33370e69eab897ca15072d",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 140,
"avg_line_length": 41.266881028938904,
"alnum_prop": 0.6749259778712794,
"repo_name": "docusign/docusign-python-client",
"id": "f3b6a25abe6c7f2f0788baac964f78f2ad5d0d72... |
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
from nipype.interfaces.base import CommandLineInputSpec, C... | {
"content_hash": "f19a425856e5d7b654459944aa22b390",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 230,
"avg_line_length": 52.32900432900433,
"alnum_prop": 0.6780277961614825,
"repo_name": "christianbrodbeck/nipype",
"id": "580cdaae1aeed6fd0cd4dab01c1b2abf03ff0d19",
"si... |
import paho.mqtt.client as mqtt
import ssl
ROOT_CA = "<PATH_TO_ROOT_CERT>"
CERTIFICATE = "<PATH_TO_YOUR_CERT>"
PRIVATE_KEY = "<PATH_TO_PRIVATE_KEY>"
AWS_IOT_TOPIC = "<YOUR_IOT_TOPIC>"
AWS_IOT_ENDPOINT = "<YOUR_IOT_ENDPOINT>"
def on_connect(client, userdata, flags, rc):
print("Connected with result code "+str(rc))
c... | {
"content_hash": "0b398da62ba5cbe8e2199a30b0aa4899",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 45,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.7090643274853801,
"repo_name": "awslabs/simplerobotservice",
"id": "33312659c48ca2f5fd883c4371b74d885b18dffd",
"s... |
"""
gh_lists.py MILESTONE
Functions for Github API requests.
"""
from __future__ import print_function, division, absolute_import
import os
import re
import sys
import json
import collections
import argparse
from urllib2 import urlopen
Issue = collections.namedtuple('Issue', ('id', 'title', 'url'))
def main():
... | {
"content_hash": "47eabb0c5692184264d2d732f3cee7d1",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 113,
"avg_line_length": 28.613793103448277,
"alnum_prop": 0.5473608098336948,
"repo_name": "holgern/pyyawt",
"id": "1a4ef35c706acb82c5c6b8c3a11ce6c999eb7248",
"size": "419... |
import os
import sys
import RTIMU
import schedule
import GeneralSettings
from Utility.abstract_process import processAbstract
import time
class imuHandler(processAbstract):
#SETTINGS_FILE = GeneralSettings.IMU_SETTINGS_FILE
def __init__(self, antenna_data):
processAbstract.__init__(self)
self... | {
"content_hash": "e925537210ff483f638e637c27bb6654",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 67,
"avg_line_length": 28.695652173913043,
"alnum_prop": 0.6098484848484849,
"repo_name": "Dronolab/antenna-tracking",
"id": "815f0ccb3127d24cbf98ae82ab925cb70c580cf9",
"si... |
import numpy as np
import six
from six.moves import range
from ..core.utils import make_optional_arg_into_id_array
from .structured_quad import links as squad_links
def neighbor_active_link_at_cell(grid, inds, *args):
"""neighbor_active_link_at_cell(grid, link_ids [, cell_ids])
Return an array of the active... | {
"content_hash": "45ccba05dc900dc606c5262395bc825b",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 78,
"avg_line_length": 31.019493177387915,
"alnum_prop": 0.5888895871300195,
"repo_name": "csherwood-usgs/landlab",
"id": "00f9066fb39a57da260a08039df05018796b7b51",
"size... |
import string
def ispangram(sentence, alphabet=string.ascii_lowercase):
alphaset = set(alphabet)
return alphaset <= set(sentence.lower())
| {
"content_hash": "3656527f04e6d054ac49486ce10c21ff",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 57,
"avg_line_length": 29.4,
"alnum_prop": 0.7414965986394558,
"repo_name": "serge-sans-paille/pythran",
"id": "cb5aa5a632136c34347c1b46d569b657259a791d",
"size": "358",
"... |
"""
keychain
==============
"""
from setuptools import setup, find_packages
setup(
name='keychain',
version='0.14.2.0',
url='https://github.com/blockstack/keychain-manager-py',
license='MIT',
author='Blockstack Developers',
author_email='support@blockstack.com',
description="""Library for... | {
"content_hash": "ccef062f5fbbc8a0e39e47d78c737a6d",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 88,
"avg_line_length": 28.939393939393938,
"alnum_prop": 0.6230366492146597,
"repo_name": "blockstack/keychain-manager-py",
"id": "81d84a44a69d96d7594d4086d2f0516c1410bf3e",
... |
from django.contrib import admin
from cms.admin.forms import PageUserForm, PageUserGroupForm
from cms.admin.permissionadmin import GenericCmsPermissionAdmin
from cms.exceptions import NoPermissionsException
from cms.models import PageUser, PageUserGroup
from cms.utils.compat.dj import get_user_model
from cms.utils.com... | {
"content_hash": "b5e2461c64c7466a1b84ede214cf20da",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 90,
"avg_line_length": 35.47826086956522,
"alnum_prop": 0.7236519607843137,
"repo_name": "astagi/django-cms",
"id": "501ca0ae3f68ed7e44984e655fda371285929ea4",
"size": "165... |
"""The test for sensor device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.device_automation import DeviceAutomationType
from homeassistant.components.sensor import DOMAIN, SensorDeviceClass
from homeassistant.compon... | {
"content_hash": "3da62d4cdaf6ea519de663095e01f929",
"timestamp": "",
"source": "github",
"line_count": 475,
"max_line_length": 87,
"avg_line_length": 33.58526315789474,
"alnum_prop": 0.5106876449570613,
"repo_name": "rohitranjan1991/home-assistant",
"id": "e37b0e9470fb97f10017b6d77db254c14183cc66",
... |
"""
This module implements the functionality to take any Python expression as a
string and fix all numbers and other things before evaluating it,
thus
1/2
returns
Integer(1)/Integer(2)
We use the Python ast module for that, which is in python2.6 and later. It is
well documented at docs.python.org.
Some tips to und... | {
"content_hash": "5895db40ad91ff825d449317c847303b",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 34.13725490196079,
"alnum_prop": 0.5924755887421023,
"repo_name": "KevinGoodsell/sympy",
"id": "aab972f9f6547a03ba7024ded6b390ebb6e1fcc0",
"size": "... |
from MidiOutStream import MidiOutStream
class MidiOutPassThrough(MidiOutStream):
"""
This class i mainly used for testing the event dispatcher. The
methods just returns the passed parameters as a tupple.
"""
#####################
## Midi channel events
def note_on(self, channel, no... | {
"content_hash": "b60fadbc47ebc0c6eeb035ffdc3d69a9",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 77,
"avg_line_length": 19.13186813186813,
"alnum_prop": 0.5921883974727168,
"repo_name": "pymir3/pymir3",
"id": "39f4f553c6ea93711dcaa8e831c4cdf48397a9bb",
"size": "3482",... |
import os
import sys
dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
sys.path.append(os.path.join(dir, 'app'))
# testing
import mock
import unittest
from mock import patch
# program
import app.scrape.scrape as Scraper
class TestScraperFunctions(unittest.TestCase):
'''Unit tests for testing if ... | {
"content_hash": "bc2df6f79b6babf8ac3bdd67a76e30db",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.7078313253012049,
"repo_name": "luiscape/hdxscraper-opennepal",
"id": "92cd27c7bf1578a1e6e0744369b20261e8d0ab08",
... |
from __future__ import absolute_import
from __future__ import unicode_literals
from django.conf import settings
DEFAULT_REALM = 'DJANGO'
def get_setting(setting_name, default=None):
if hasattr(settings, setting_name):
return getattr(settings, setting_name)
else:
return default
def get_backend... | {
"content_hash": "e9c264ed23d37889ef742a012953b4be",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 90,
"avg_line_length": 34.94117647058823,
"alnum_prop": 0.6355218855218855,
"repo_name": "dimagi/django-digest",
"id": "1611c7e5050a61d2fd4c79cfb3758ff8cdb755b7",
"size": "... |
MRINAME = 'MRI'
MRI_HOME = 'http://extensions.services.openoffice.org/project/MRI'
MRI_ID = 'mytools.mri'
MRI_DIR = None
def set_mri_dir(ctx):
global MRI_DIR
import mytools_Mri.tools
MRI_DIR = mytools_Mri.tools.get_extension_dirurl(ctx, MRI_ID)
class ConfigNames(object):
config_node = '/mytools.Mri.Co... | {
"content_hash": "c30d635d2991a4d1a56e1437dc058e36",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 145,
"avg_line_length": 30.21153846153846,
"alnum_prop": 0.6817313812858052,
"repo_name": "hanya/MRI",
"id": "19b17e4112ee97c8b25fae19b3d541a795ba8217",
"size": "2160",
"... |
"""State recorders for BPN states."""
import collections
import chains
import numpy
import logging
logger = logging.getLogger('bpn.mcmcbpn.recorders')
from bpn import structures
from defaults import (SUPERDEBUG, SUPERDEBUG_MODE, OUTPUT_BUFFER_SIZE,
TRANSITIONS_BUFFER_SIZE)
# This is a bit of a hack to redu... | {
"content_hash": "9fc7b929720b6b03bb679df42ce9fc17",
"timestamp": "",
"source": "github",
"line_count": 1169,
"max_line_length": 96,
"avg_line_length": 37.885372112917025,
"alnum_prop": 0.587518063583815,
"repo_name": "gotgenes/BiologicalProcessNetworks",
"id": "9f14480a7dabc5d08ef3cd09be943bf145dff2... |
"""A cache for immutable values (functions, constants, and classes).
These are immutable for a given interpreter, but may possibly change
if we run multiple Interpreters in sequence. This logic allows the
JIT-compiled machine code to quickly check if we're in the common
case of seeing the same value as previously.
"""... | {
"content_hash": "738d47360ddc5e2fb0eab148d3b3580c",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 75,
"avg_line_length": 34.990990990990994,
"alnum_prop": 0.6207518022657055,
"repo_name": "xhava/hippyvm",
"id": "78eb466be036c8c6f146a234c8f344fc16d54469",
"size": "3884"... |
from __future__ import absolute_import
import sys
from django import forms
from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import get_resolver
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render_to_response, render
from django.template impor... | {
"content_hash": "082eb6c1cd0db84ec70c5bebda5507c3",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 91,
"avg_line_length": 35.37826086956522,
"alnum_prop": 0.6410224898611282,
"repo_name": "mixman/djangodev",
"id": "f2b4e79322cd66cad8004a8a98176956f9fa160d",
"size": "813... |
"""
Copyright (C) 2017 SunSpec Alliance
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge... | {
"content_hash": "9f149731517cc7342b65c2d15e5e7531",
"timestamp": "",
"source": "github",
"line_count": 830,
"max_line_length": 144,
"avg_line_length": 34.42409638554217,
"alnum_prop": 0.5532689346213076,
"repo_name": "jbm950/pysunspec",
"id": "d8fe710f796c1c0cefc1338c32227edfdc68a29d",
"size": "28... |
from .dump import dump
from .toBytes import toBytes
#=============================================================================
| {
"content_hash": "d044019e418da9a2631fde7adde3d221",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 78,
"avg_line_length": 33,
"alnum_prop": 0.3181818181818182,
"repo_name": "TD22057/T-Home",
"id": "f8205b845bfb773fbab42cc3071f32aefc265223",
"size": "323",
"binary": fals... |
import FWCore.ParameterSet.Config as cms
import pickle
process = pickle.load(open('PSet.pkl', 'rb'))
| {
"content_hash": "d468f5cc90ff3211c3acab4bb5a2abc3",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 45,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.7623762376237624,
"repo_name": "avkhadiev/bbtoDijet",
"id": "5fd923dd7eea775860f317b4b06d7c24d971e59e",
"size": "1... |
"""Test the listtransactions API."""
from decimal import Decimal
from io import BytesIO
from test_framework.messages import COIN, CTransaction
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_array_result,
assert_equal,
hex_str_to_bytes,
)
def tx_from... | {
"content_hash": "5c85c2c0f9cb0394e1dc89718afe46e9",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 150,
"avg_line_length": 52.02857142857143,
"alnum_prop": 0.5797181036060772,
"repo_name": "rnicoll/dogecoin",
"id": "45e7bd69f8cfc6b79d099f3bbf41f88039dc7445",
"size": "11... |
from tests import TestBase, db_config, app_config
from tests import dbhelper
from test_models.core import Partner, Customer, User, Language
from hoops.utils import OutputFormat
from hoops import create_api
class ModelsTestBase(TestBase):
def populate_helper(self, lang=True, partner='test', customers=['test'], us... | {
"content_hash": "fe91941900a2c13e3dbfb66c3dc9be22",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 42.5,
"alnum_prop": 0.6086274509803922,
"repo_name": "jfillmore/hoops",
"id": "2e522d87a2c744c96cb4ba2fa2ebbc82bac53077",
"size": "1275",
"binary"... |
import unittest
import warnings
from twilio.base.obsolete import deprecated_method
class DeprecatedMethodTest(unittest.TestCase):
def test_deprecation_decorator(self):
@deprecated_method
def old_method():
return True
with warnings.catch_warnings(record=True) as caught_warni... | {
"content_hash": "784e5ddbc0be4b274abb0c4519ced1f8",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 87,
"avg_line_length": 34.857142857142854,
"alnum_prop": 0.6263661202185792,
"repo_name": "twilio/twilio-python",
"id": "96927e13fb95cd25c5cc180f7fdaf02f53b274df",
"size": ... |
import ldap
import ldap.modlist
from keystone import exception
from oslo_log import log as logging
from oslo_config import cfg
LOG = logging.getLogger('nova.%s' % __name__)
def _getLdapInfo(attr, conffile="/etc/ldap.conf"):
try:
f = open(conffile)
except IOError:
if conffile == "/etc/ldap.c... | {
"content_hash": "adad2c66cc0f94b81ee207283a81c3f9",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 87,
"avg_line_length": 34.65625,
"alnum_prop": 0.6205075357464898,
"repo_name": "wikimedia/mediawiki-vagrant",
"id": "e77067d08f53b512879f4ee8f1c409d8ea7c5b9f",
"size": "8... |
import os
import flask_sqlalchemy as fsa
import pytest
from flask import Flask
from flask.testing import FlaskClient
from flask_resty.testing import ApiClient
# -----------------------------------------------------------------------------
@pytest.fixture
def app():
app = Flask(__name__)
app.testing = True
... | {
"content_hash": "64606c33cc2cb998cac42d9e2db9c01e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 19.853658536585368,
"alnum_prop": 0.6277641277641277,
"repo_name": "taion/flask-jsonapiview",
"id": "d8d52e0db6c1e93e775b8b9b50555cd30b6faac6",
"size... |
from dateutil.parser import parse
import os
import json
"""
We must prevent CashupUrlGenerator from being imported when we only want to
generated documentation of the classes in this file.
"""
if not os.environ.get('DOC'):
from kounta.cashup import CashupUrlGenerator
class BaseObject:
"""
Used as the par... | {
"content_hash": "63a4f3a37fb7ae81ed1df4dc1528f5e2",
"timestamp": "",
"source": "github",
"line_count": 1361,
"max_line_length": 85,
"avg_line_length": 20.351212343864805,
"alnum_prop": 0.504837894432811,
"repo_name": "elliotchance/kounta-python",
"id": "3376d853a7593554d82729f89f0df0842097e813",
"... |
import unittest
from . import test_ajax_jsf
from . import test_default_server
from . import test_google
from . import test_i18n
import sys
def suite():
return unittest.TestSuite((\
unittest.makeSuite(test_i18n.TestI18n),
))
if __name__ == "__main__":
result = unittest.TextTestRunner(verbosity=... | {
"content_hash": "955963302b4c3c4f8767b968ec967451",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 25.133333333333333,
"alnum_prop": 0.6843501326259946,
"repo_name": "dbo/selenium",
"id": "e45b8a2b1d6e649acc9225f140dd0bd57ef5cfec",
"size": "1185",
... |
import unittest
import numpy as np
import paddle
from paddle.fluid.data_feeder import convert_dtype
import paddle.fluid.core as core
from paddle.static import program_guard, Program
class TestEmptyLikeAPICommon(unittest.TestCase):
def __check_out__(self, out):
data_type = convert_dtype(out.dtype)
... | {
"content_hash": "5ba39c3a3e86414e5878f2500ed42115",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 75,
"avg_line_length": 29.445026178010473,
"alnum_prop": 0.5869487908961594,
"repo_name": "luotao1/Paddle",
"id": "82ad72e11e5f2b2bf7ee8a8aa0316823a5703c31",
"size": "6236... |
"""
A collection of small helper functions for generating small pieces of datatable output in custom
methods on a view.
Because of uncontrolled external use of ``preload_record_data()`` by the view, each of these utility
functions allows for generic ``*args`` to pass through to the function, even though they aren't us... | {
"content_hash": "507fee6c073d0d4f0872a93ef57907b2",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 100,
"avg_line_length": 39.54875283446712,
"alnum_prop": 0.6204346081073333,
"repo_name": "pivotal-energy-solutions/django-datatable-view",
"id": "23d4922649fc7d084e10057816... |
from sqlalchemy import column
from superset.db_engine_specs.pinot import PinotEngineSpec
from tests.db_engine_specs.base_tests import TestDbEngineSpec
class TestPinotDbEngineSpec(TestDbEngineSpec):
""" Tests pertaining to our Pinot database support """
def test_pinot_time_expression_sec_one_1m_grain(self):
... | {
"content_hash": "d6f0b09414376e86f9bef93fc6e68932",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 88,
"avg_line_length": 36.11764705882353,
"alnum_prop": 0.6775244299674267,
"repo_name": "airbnb/superset",
"id": "973282737b2def511bde20d332e6ff9a99bdd626",
"size": "1399"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.