text stringlengths 4 1.02M | meta dict |
|---|---|
"""Correctness tests for tf.keras DNN model using DistributionStrategy."""
import numpy as np
import tensorflow.compat.v2 as tf
import keras
from keras import backend
from keras.distribute import keras_correctness_test_base
from keras.distribute import strategy_combinations
from keras.optimizers.optimizer_v2 import (... | {
"content_hash": "2048a836bb62ab38a1169e4357698c02",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 106,
"avg_line_length": 37.748618784530386,
"alnum_prop": 0.6013172338090012,
"repo_name": "keras-team/keras",
"id": "a08b4c7c925eaf2ff0901e2cf68618bfbed22305",
"size": "1... |
import os
from django.db import models
from django.conf import settings
class TunnelConfig(models.Model):
"""
A configuration object for a specific tunnel. This objects encapsulates the
specific configuration file and options for its tunnel.
"""
def get_tunnel_conf_upload_dir(instance, filename):... | {
"content_hash": "4b036e7cba63929b7793dea48444a921",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 106,
"avg_line_length": 37.88461538461539,
"alnum_prop": 0.6148900169204737,
"repo_name": "winhamwr/django-calabar",
"id": "b02b338e2872b654136b60693164183e38e827ca",
"size... |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | {
"content_hash": "ae0c178520d59d2a57efec63f25f7bb5",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 173,
"avg_line_length": 45.018181818181816,
"alnum_prop": 0.5718901453957996,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "df399b0335a00f6e51ee8428f2b03cf9034ba65b",
... |
import re, sys, collections
stopwords = set(open('../stop_words.txt').read().split(','))
words = re.findall('[a-z]{2,}', open(sys.argv[1]).read().lower())
counts = collections.Counter(w for w in words if w not in stopwords)
for (w, c) in counts.most_common(25):
print(w, '-', c)
| {
"content_hash": "1df1889f1713a84845aef270e13939fa",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 40.57142857142857,
"alnum_prop": 0.6408450704225352,
"repo_name": "kranthikumar/exercises-in-programming-style",
"id": "9da618ff787c7c5aba608317b54fd41d... |
from ohno.action.baseaction import BaseAction
class Search(BaseAction):
def __init__(self, ohno, times=1):
super(Search, self).__init__(ohno)
# We're searching the squares adjacent to the tile we're standing on at
# the point of pressing s, not the tile we're standing on the next turn
... | {
"content_hash": "cea68ca21d2a83f3868ea970cf53a04e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 39.69565217391305,
"alnum_prop": 0.6276013143483024,
"repo_name": "helgefmi/ohno",
"id": "7163ac3cd535363802025b1797c1777ead69d320",
"size": "913",
... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('waldur_digitalocean', '0002_extend_description_limits'),
]
operations = [
migrations.AddField(
model_name='droplet',
name='error_traceback',
field=models... | {
"content_hash": "83607dbdc2fd3be38e18204c2fe83416",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 66,
"avg_line_length": 22.5625,
"alnum_prop": 0.5955678670360111,
"repo_name": "opennode/waldur-mastermind",
"id": "224822bebe1f5efc9c69749ddc8c53087cf9c828",
"size": "411"... |
import unittest
from src.graph import Graph
from src.dynamic_programming import max_weighted_independent_set_in_path_graph, \
sequence_alignment, optimal_binary_search_tree, \
binomial_coefficient, maximum_monotone_sequence, min_coins, \
zig_zag, bad_neighbours, linear_p... | {
"content_hash": "e99a40b4b7b0d734f01747c6c5c82452",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 89,
"avg_line_length": 43.79207920792079,
"alnum_prop": 0.5535835405833145,
"repo_name": "topliceanu/learn",
"id": "1b752d3775fcc0e33fd785e712bf24252d632165",
"size": "887... |
class Port:
def __init__(self):
self.vars = []
self.boundaries = []
def add(self, var_dict):
"""
add a new variable to the port
:param var_dict: dictionnary of variables to add. Name as keys, returns values
:return:
"""
for v in var_dict:
... | {
"content_hash": "c3e33b4af6076ffb06f35af393babd5a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 86,
"avg_line_length": 26.044776119402986,
"alnum_prop": 0.4997134670487106,
"repo_name": "adriendelsalle/unsysap",
"id": "68408be067d53b61d2df15448c88b5e07f2f4c49",
"size"... |
"""add fetch values predicate
Revision ID: 732f1c06bcbf
Revises: d6db5a5cdb5d
Create Date: 2017-03-03 09:15:56.800930
"""
# revision identifiers, used by Alembic.
revision = '732f1c06bcbf'
down_revision = 'd6db5a5cdb5d'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('datasources', ... | {
"content_hash": "23b9f94f73872aed50aa979c67c65586",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 103,
"avg_line_length": 27.08695652173913,
"alnum_prop": 0.7319422150882825,
"repo_name": "dmigo/incubator-superset",
"id": "7ad56c7f23b6e1f1eceecef9bb7259d10a5f5067",
"siz... |
"""
Django settings for homeinventory project.
Generated by 'django-admin startproject' using Django 1.11.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
imp... | {
"content_hash": "ab6ccf9ee2f954c8869e8d9e237f433d",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 79,
"avg_line_length": 27.39430894308943,
"alnum_prop": 0.6380768660038582,
"repo_name": "le4ndro/homeinventory",
"id": "a831b97d1ec8544f4082ca0d8a549694da2071ac",
"size":... |
"""
Create a color strip file from a tsv file that has the sequence ids.
"""
import os
import sys
import argparse
def read_labels(lf, col, verbose=False):
"""
Read the labels file and return a dict with tree labels and values
:param lf: labels file
:param col: the column to use
:param verbose: ext... | {
"content_hash": "e00025c69c6f882f3b19fbe011fa954e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 120,
"avg_line_length": 36.670731707317074,
"alnum_prop": 0.6075823079481211,
"repo_name": "linsalrob/EdwardsLab",
"id": "82e2dc817517d353df7ea2a47d7b99fdec00a7fd",
"size":... |
import os
import sys
import subprocess
from os import access, getenv, X_OK
jar_file = 'DamageProfiler-0.4.6.jar'
default_jvm_mem_opts = ['-Xms512m', '-Xmx1g']
# !!! End of parameter section. No user-serviceable code below this line !!!
def real_dirname(path):
"""Return the symlink-resolved, canonicalized directo... | {
"content_hash": "51233a5e82a4fe02934003d312413de7",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 81,
"avg_line_length": 29.123456790123456,
"alnum_prop": 0.6146672318779144,
"repo_name": "rvalieris/bioconda-recipes",
"id": "24e4537c5e6027e0d5b605aad3ed3577d6ae3962",
"s... |
# Copyright (c) 2012 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import re
import glob
from HTMLParser import HTMLParser
import os
import sys
import tempfile
import urllib2
import bsettings
import command
import terminal
(PRIORITY_FULL_PREFIX, PRIORITY_PREFIX_GCC, PRIORITY_PREFIX_GCC_PATH,
P... | {
"content_hash": "31180a54a8f9e8bba803cf0c8df8581d",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 80,
"avg_line_length": 35.74652777777778,
"alnum_prop": 0.5521126760563381,
"repo_name": "guileschool/beagleboard",
"id": "2076323d5d39825f17b0460d09ce3dd383bc50b3",
"size... |
from google.appengine.ext import ndb
def improve(result, identificador = ""): #explota con las sesiones
result["id"] = identificador
for key, value in result.iteritems():
if type(value) is list:
i = 0
for item in value:
if isinstance(item,ndb.Key):
... | {
"content_hash": "f1e3c4ea749d7f72836a5fe04d7b4b32",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 38,
"alnum_prop": 0.5013850415512465,
"repo_name": "hermagrini/pochoclo-system",
"id": "c8033f2d8a1aae64d788ba0638e05bb43e25dc6f",
"size": "722",
"... |
"""Tests for Tradfri setup."""
from unittest.mock import patch
from homeassistant.components import tradfri
from homeassistant.helpers import device_registry as dr
from . import GATEWAY_ID
from tests.common import MockConfigEntry
async def test_entry_setup_unload(hass, mock_api_factory):
"""Test config entry s... | {
"content_hash": "d6876ce96e1af39b12d703fbd2bfd826",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 76,
"avg_line_length": 35.20652173913044,
"alnum_prop": 0.6640938561284347,
"repo_name": "rohitranjan1991/home-assistant",
"id": "2a26391c43f84e1486d86b1ab19bc658a23dbd7b",
... |
"""
Test package for features
"""
| {
"content_hash": "599e155983dac44b59f43277a7a294b2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 25,
"avg_line_length": 11.333333333333334,
"alnum_prop": 0.6470588235294118,
"repo_name": "bossjones/scarlett",
"id": "866151bee385354bcf22f7456ca966fb360d6dd4",
"size": "34... |
from extern import extern
extern("dblookup.py")
| {
"content_hash": "9a7a6568bb165e0775202f95cc704ad1",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 25,
"avg_line_length": 16.333333333333332,
"alnum_prop": 0.7755102040816326,
"repo_name": "esatterly/splunk-cassandra",
"id": "6d193c08fb9c030fed8d73173255be5aadf1a392",
"si... |
import gtaskpool
import random
from datetime import datetime
import json
class Interface(object):
def __init__(self, get_proxy, proxy_feedback, get_useragent):
self.get_proxy = get_proxy
self.proxy_feedback = proxy_feedback
self.get_useragent = get_useragent
def get_useragent_wrapper(user... | {
"content_hash": "a5e40fc47b79997fd942a3493a229b8d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 71,
"avg_line_length": 27.78125,
"alnum_prop": 0.5961754780652418,
"repo_name": "WalnutATiie/google_search",
"id": "d14ca93c2d2b02cce47e6850643da039bbbd375a",
"size": "1815... |
"""
This allows a simple component to be moved around the screen.
"""
from enable.example_support import DemoFrame, demo_main
from traits.api import Float
from enable.api import Component, Pointer, Window
class Box(Component):
"""
The box moves wherever the user clicks and drags.
"""
normal_pointer =... | {
"content_hash": "9042ea607eafef965e5f79d02e474cf3",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 72,
"avg_line_length": 28.813953488372093,
"alnum_prop": 0.5907990314769975,
"repo_name": "tommy-u/enable",
"id": "f3fcf69e3cb6876097156a1bc2b5a4ab92cbe1f4",
"size": "2478"... |
from django.db import migrations, models
import django.db.models.deletion
import taggit.managers
class Migration(migrations.Migration):
replaces = [('proposals', '0001_initial'), ('proposals', '0002_proposaladditionalspeakerthrough'), ('proposals', '0003_remove_under_represented_questions')]
dependencies = ... | {
"content_hash": "97e79741b14eb84e022b5c9f22fe8544",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 297,
"avg_line_length": 68.0721649484536,
"alnum_prop": 0.6259276086627291,
"repo_name": "pydata/conf_site",
"id": "6bd12d844aa5e943685767b37a8a1a81b0dc6dc0",
"size": "6652... |
from metrics_consumer import *
| {
"content_hash": "efa48e1a41d6917a2e5255de3f6c2629",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 31,
"alnum_prop": 0.8064516129032258,
"repo_name": "lmacken/moksha",
"id": "e8f4382ac90585671e9c212a2e397ba8aaad45a8",
"size": "31",
"binary": false... |
from .videos import load, find_image, clip, duration, extract_frame | {
"content_hash": "97e827576274c16096afad4a788f52e9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 67,
"avg_line_length": 67,
"alnum_prop": 0.7910447761194029,
"repo_name": "groupe-sii/ogham",
"id": "0795efc19e81452ab0c8e6fd7de8d634b72bf820",
"size": "67",
"binary": fal... |
from __future__ import division, print_function, absolute_import
import sys
from collections import namedtuple
from turtle import TurtleScreen, RawTurtle, TK
from ninjaturtle.render import BaseRenderer
if sys.version_info[0] < 3:
from Tkinter import Tk, mainloop
else:
from tkinter import Tk
mainloop = Fa... | {
"content_hash": "e2f674b70642cc944793d7186d4895d1",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 77,
"avg_line_length": 29.1875,
"alnum_prop": 0.6216987865810135,
"repo_name": "AllTheWayDown/ninjaturtle",
"id": "d328d72758f6c7f9bf6e482b15a1341eb66e2295",
"size": "1401"... |
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# Ge... | {
"content_hash": "3ab5d963fe2587f7d7f833e063dfa978",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 81,
"avg_line_length": 32.19655172413793,
"alnum_prop": 0.7067580593338332,
"repo_name": "aaronsgithub/djangocms-contact",
"id": "fa3bc433a6ccbfba54aa4ba4d18a564113c373df",
... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Ben Parisi', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'crime',
'USER': 'ben',
'PASSWORD': 'nerRaWhB',
'HOST': '/var/run/mysqld/mysqld.sock'... | {
"content_hash": "8239719c610caa2a5fd3d3f1dac79fc1",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 105,
"avg_line_length": 33.7515923566879,
"alnum_prop": 0.701641819211172,
"repo_name": "OpenData-NC/PoliceReportScraper",
"id": "c1c74ddb1e25da4566f68063b5b269b53d9d1342",
... |
import numpy as np
import random
import itertools
import scipy.misc
import matplotlib.pyplot as plt
class gameOb():
def __init__(self,coordinates,size,intensity,channel,reward,name):
self.x = coordinates[0]
self.y = coordinates[1]
self.size = size
self.intensity = intensity
... | {
"content_hash": "334b445a0be827a7d98469ed91398949",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 100,
"avg_line_length": 34,
"alnum_prop": 0.5342371323529411,
"repo_name": "awjuliani/DeepRL-Agents",
"id": "2ff25f662ea2db5e414f2cfd46679f2ca628db82",
"size": "4352",
"... |
"""Utility to provide submission and comment statistics in a subreddit."""
from __future__ import print_function
import codecs
import re
import sys
import time
import webbrowser
from collections import defaultdict
from datetime import datetime
from praw import Reddit
from praw.errors import ExceptionList, RateLimitExc... | {
"content_hash": "83e56f6c10ad65a66558d172371838ca",
"timestamp": "",
"source": "github",
"line_count": 594,
"max_line_length": 116,
"avg_line_length": 44.02693602693603,
"alnum_prop": 0.548676965432854,
"repo_name": "amici-ursi/prawtools",
"id": "b2e8cf51727c8cd850c77d260241301d61a76f6f",
"size": ... |
{
'!=': '!=',
'!langcode!': 'it',
'!langname!': 'Italiano',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" è un\'espressione opzionale come "campo1=\'nuovo valore\'". Non si può fare "update" o "delete" dei risultati di un JOIN ',
'%(nrows)s... | {
"content_hash": "7e978b6c8868e29995191b8435f2ef74",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 316,
"avg_line_length": 39.73877551020408,
"alnum_prop": 0.6772801972062449,
"repo_name": "vtslab/sensafety-midterm",
"id": "8ba02131dc7aa4928cd6dee8e4b61978593a18ca",
"si... |
from random import choice, randint
from xierpa3.adapters.adapter import Adapter
from xierpa3.contributions.filibuster.blurb import Blurb
class BlurbAdapter(Adapter):
u"""
The Adapter classes connect the templates to Blurb content.
Note that an adapter always returns plain text/content elements (which can ... | {
"content_hash": "d3c24b5c75e29998fe71cd84bbde83bd",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 173,
"avg_line_length": 58.77450980392157,
"alnum_prop": 0.6862385321100918,
"repo_name": "petrvanblokland/Xierpa3",
"id": "780f2ee5be3178f423b87955694d092a58deffc2",
"siz... |
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesktopPage(page_module.Page):
def __init__(self, url, page_set):
super(SkiaBuildbotDesktopPage, self).__init__(
url=url,
page_set=page_set,
credentials_path='data/cre... | {
"content_hash": "2a14aa5ea78fd4aafc5e80215c12e8ac",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 29.857142857142858,
"alnum_prop": 0.6899521531100479,
"repo_name": "scroggo/skia",
"id": "335dc68fa108c83ce67a3e678219e553812db3d7",
"size": "1239",
... |
from sensomatic.sources.utils import data_source
@data_source
class FileContent:
"""
Example of source. Provides file content for the file path specified in the constructor.
"""
provides = 'file_content'
def __init__(self, path):
self.path = path
def __next__(self):
return op... | {
"content_hash": "5ee08c275e04678c9b50e2d5f56c6520",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 92,
"avg_line_length": 21.88888888888889,
"alnum_prop": 0.6243654822335025,
"repo_name": "rrader/sens-o-matic",
"id": "71982913233673ffdd95ec0f4bcdf92eab60ee25",
"size": "3... |
import json
import subprocess
import re
import sys
def addToKnownHosts(hostname):
"""
Sets all hosts given in hostlist as hosts known to Ansible by editing the /etc/ansible/hosts
:param hostname: A hostname to add to the list of known hosts for ansible
:type hostname: str
"""
#run with json
... | {
"content_hash": "b32e7fb636f2998460efb9152ef7fb86",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 132,
"avg_line_length": 34.8421052631579,
"alnum_prop": 0.6518126888217523,
"repo_name": "tumi8/INSALATA",
"id": "1882a01c2f49b2c9a61a35ae02681e1f282a9431",
"size": "1324",... |
import subprocess
from sys import platform
def ping(server, count=10, timeout_in_seconds=1):
''' ping a server on any platform
Returns:
1: server is alive (True)
0: server is not alive (False)
-1: error
'''
if platform.lower().startswith('win'):
return ... | {
"content_hash": "1923f1607dbfc904eb8e7f114c26601a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 141,
"avg_line_length": 33.716981132075475,
"alnum_prop": 0.5769445998880806,
"repo_name": "coderholic/pyradio",
"id": "ef80e45b936067e56eefc1668a9cecc1476803c9",
"size": "... |
import paramiko
import getpass
def ssh_execute(hostname,username,password,cmds=[],port=22):
rt_list=[]
#创建远程ssh对象
ssh=paramiko.SSHClient()
#设定ssh连接方式
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
#连接服务器
ssh.connect(hostname,port,username,password)
for cmd in cmds:
... | {
"content_hash": "a1d4e4622e5e748efea8fee59a6f3b2d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 83,
"avg_line_length": 26.11904761904762,
"alnum_prop": 0.6709206927985415,
"repo_name": "51reboot/actual_09_homework",
"id": "27d299180b7f8ef44e72d2a7eedc8a7cc6a2be5d",
"s... |
from optimus.utils import display_settings
class DummySettings(object):
"""
Empty settings object
"""
def __init__(self):
pass
def test_basic(caplog):
"""
Basic initialize without ressources to sync
"""
conf = DummySettings()
conf.STRING = "ok"
conf.INTEGER = 42
... | {
"content_hash": "6bb9f8696694190ceb427c41dc798d29",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 71,
"avg_line_length": 24.941176470588236,
"alnum_prop": 0.5495283018867925,
"repo_name": "sveetch/Optimus",
"id": "c92fd7f7ddcd94ac83d53a72a22847708de6dd65",
"size": "848"... |
import unittest
import lighter.main as lighter
import lighter.secretary as secretary
import lighter.util as util
class SecretaryTest(unittest.TestCase):
def testAddMasterKey(self):
service = lighter.parse_service('src/resources/yaml/staging/myservice.yml')
self.assertEquals(service.config['env']['M... | {
"content_hash": "865c0f624b108df5ed8961ddc7670edb",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 154,
"avg_line_length": 54.734939759036145,
"alnum_prop": 0.6823684789786485,
"repo_name": "meltwater/lighter",
"id": "a75c875b291d1c006ec4c83562ac9a4908218247",
"size": "4... |
from msrest.serialization import Model
class OfferTermInfo(Model):
"""Describes the offer term.
:param effective_date: Indicates the date from which the offer term is
effective.
:type effective_date: datetime
:param name: Polymorphic Discriminator
:type name: str
"""
_validation = {... | {
"content_hash": "10c8aa057d5d7785a587b6891678309b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 137,
"avg_line_length": 27.413793103448278,
"alnum_prop": 0.6125786163522012,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "58267f0882ed2ea6806a2d3f55515712d6483367",
"s... |
__all__ = ('MapManager')
from pocketthrone.tools.maploader import MapLoader
from pocketthrone.managers.pipe import L
from pocketthrone.managers.filemanager import FileManager
from pocketthrone.managers.eventmanager import EventManager
from pocketthrone.entities.event import *
from pocketthrone.entities.enum import Til... | {
"content_hash": "32f2cd841e5759a3d36544b072e39d83",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 86,
"avg_line_length": 32.024096385542165,
"alnum_prop": 0.6980812641083521,
"repo_name": "herrschr/prey-game",
"id": "b4bf1339ca61d039037c787506fd86004616c463",
"size": "... |
"""Self-test suite for Cryptodome.PublicKey.RSA"""
__revision__ = "$Id$"
import os
import pickle
from pickle import PicklingError
from Cryptodome.Util.py3compat import *
import unittest
from Cryptodome.SelfTest.st_common import list_test_cases, a2b_hex, b2a_hex
class RSATest(unittest.TestCase):
# Test vectors f... | {
"content_hash": "1b0961654760b1aa4ec2340a8507abf2",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 85,
"avg_line_length": 38.13745704467354,
"alnum_prop": 0.6206523697963597,
"repo_name": "chronicwaffle/PokemonGo-DesktopMap",
"id": "8067a6647cc5c75f3eccccbc8f37208cee7f7df... |
""" The abstract interface for all pyface dialogs. """
# Enthought library imports.
from enthought.traits.api import Bool, Enum, Int, Str, Unicode
# Local imports.
from constant import OK
from i_window import IWindow
class IDialog(IWindow):
""" The abstract interface for all pyface dialogs.
Usage: Sub-cla... | {
"content_hash": "553c52e0244abefdb93cba4d1320defb",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 79,
"avg_line_length": 31.08695652173913,
"alnum_prop": 0.49184149184149184,
"repo_name": "enthought/traitsgui",
"id": "78107bcfc7bd45227581de03ffa52dd053be6348",
"size": ... |
"""Generic Node base class for all workers that run on hosts."""
import inspect
import os
import random
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_service import looping... | {
"content_hash": "67670a3f3c81fc3883af080047293939",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 79,
"avg_line_length": 36.949367088607595,
"alnum_prop": 0.5768528034715085,
"repo_name": "tlakshman26/cinder-new-branch",
"id": "54eadb66ce4604cf717e74a71461ec4ed1de3c19",
... |
from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.translation import ugettext as _
from django.utils.log import getLogger
from django.contrib.auth.decorators import login_required, permission_required
from django.views.decorators.http import require_POST
from dja... | {
"content_hash": "49fba4b21f43778cadf5d180a3015dbc",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 163,
"avg_line_length": 41.681614349775785,
"alnum_prop": 0.628294782140936,
"repo_name": "tedwen/tea-scrum",
"id": "051279ee11db622f9334288d3ab1e249e74323d5",
"size": "93... |
import subprocess
import socket
import time
import inspect, os, sys
# From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder
cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"..")))
if cmd_subfolder not in sys.path:
... | {
"content_hash": "f0ac429a153fa3e9be585f6972679b47",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 129,
"avg_line_length": 29.795454545454547,
"alnum_prop": 0.6979405034324943,
"repo_name": "thejinchao/moboair_mosquitto",
"id": "6b4823285428cda3d81749b5fcc6df0707f556b6",
... |
"""Runs a JAXline experiment to perform robust adversarial training."""
import functools
from absl import app
from absl import flags
from jaxline import platform
import tensorflow.compat.v2 as tf
from adversarial_robustness.jax import experiment
if __name__ == '__main__':
flags.mark_flag_as_required('config')
t... | {
"content_hash": "307a35e33fb2ebb7240299242ad9ad31",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 28.5,
"alnum_prop": 0.746588693957115,
"repo_name": "deepmind/deepmind-research",
"id": "26e45d0c18c325b0de07b15ac7fa38076ef3d1b8",
"size": "1108",
... |
__version__ = 'bokpipe_v1.0'
from .bokoscan import BokOverscanSubtract
from .badpixels import build_mask_from_flat
import bokutil
import bokproc
import bokmkimage
import bokphot
import bokastrom
import bokgnostic
import bokpl
| {
"content_hash": "f44bc6cc067449a2b212dd21af545a57",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 43,
"avg_line_length": 19,
"alnum_prop": 0.8201754385964912,
"repo_name": "legacysurvey/rapala",
"id": "7b1502a7180eae41d753ff92126b3b91cda1b782",
"size": "251",
"binary"... |
import xmltool
from xmltool import *
import codetools
from codetools import *
import copy
'''
About this script:
This script was developed to be a magic bullet for taking LAPACK fortran
and LAPACKE C code and documentation and turning it into the
ChaLAPACK and LAPACK interface modules.
It is not intended to be 'g... | {
"content_hash": "db039c26e21f1dbc64c497ba680754da",
"timestamp": "",
"source": "github",
"line_count": 4379,
"max_line_length": 296,
"avg_line_length": 35.955469285224936,
"alnum_prop": 0.5759198216565364,
"repo_name": "chizarlicious/chapel",
"id": "8825060ab58017e21351f882b2d4fee572837d0c",
"size... |
from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid
from lasagne.objectives import crossentropy
from lasagne.init import Uniform, Normal
from lasagne.layers import LSTMLayer, DenseLayer, C... | {
"content_hash": "205a9c97b3d8a3c8111fd156863492ea",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 92,
"avg_line_length": 27.61627906976744,
"alnum_prop": 0.6298947368421053,
"repo_name": "JackKelly/neuralnilm_prototype",
"id": "e6bbeaaa2786710475d28c9ee83bd29804ea4c55",
... |
class TestTemplate:
config = """
templates:
test_series:
series:
test:
- House
settings:
test:
identified_by: ep
tasks:
test:
template: test_series
next_series_episo... | {
"content_hash": "2fa71756eb0b46ea9d87376b48fdd875",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 98,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.519496855345912,
"repo_name": "ianstalk/Flexget",
"id": "73f4cd1584ef4cf084b1624fb468fef9ba7e34ba",
"size": "795"... |
from euler import *
if __name__ == '__main__':
primes = PrimesBelow(8e5)
# Remove terminal 1's and 9's
# Remove beginning 1's and 9's
maybeTruncatable = [prime for prime in primes if prime % 10 not in (1, 9)]
maybeTruncatable = [prime for prime in maybeTruncatable if str(prime)[0] not in ('1', '9... | {
"content_hash": "4c99cb6b18e1ac9e8c2b7ac31626d121",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 95,
"avg_line_length": 29.1,
"alnum_prop": 0.6202749140893471,
"repo_name": "jeffseif/projectEuler",
"id": "0a0f5affacccdefa2af51d7c3841bc1ff0c8ad03",
"size": "1027",
"bi... |
"""
Volume driver for IBM FlashSystem storage systems with iSCSI protocol.
Limitations:
1. Cinder driver only works when open_access_enabled=off.
"""
import random
import threading
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
import six
from cinder import exceptio... | {
"content_hash": "b9c1d9d5eca8a01a266b7b7eed7a12e4",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 79,
"avg_line_length": 37.969849246231156,
"alnum_prop": 0.5548570672313393,
"repo_name": "cloudbase/cinder",
"id": "dc4dd2b9757d2ff9247bf3d2494a1fcd59b1d2e0",
"size": "15... |
import hr_expense_report | {
"content_hash": "64bffc6c3257f776918710254643c7a3",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 24,
"alnum_prop": 0.875,
"repo_name": "vileopratama/vitech",
"id": "7f74fc905a4a69fbcd8e9219748ce3a3080dd092",
"size": "124",
"binary": false,
"co... |
class Disk(GCPResource):
'''Object to represent a gcp disk'''
resource_type = "compute.beta.disk"
# pylint: disable=too-many-arguments
def __init__(self,
rname,
project,
zone,
size,
disk_type='pd-standard', #pd-ssd, l... | {
"content_hash": "864136c697de46481ffaaf6e44cde4ed",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 108,
"avg_line_length": 31.440251572327043,
"alnum_prop": 0.48469693938787756,
"repo_name": "themurph/openshift-tools",
"id": "b9fb967f896ebd5b9344f01978b9595fbb20e4ee",
"... |
import weakref
from .anyQt.QtGui import QCompleter
def get_typestrings0(type_):
if isinstance(type_, str):
return [type_]
elif isinstance(type_, tuple):
ret = [[], [], []]
for t in type_:
if isinstance(t, tuple):
rr1, rr2, rr3 = get_typestrings0(t)
... | {
"content_hash": "613a2d08184e6ecd3df544ec3f259d8c",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 94,
"avg_line_length": 32.027522935779814,
"alnum_prop": 0.47608135204812374,
"repo_name": "agoose77/hivesystem",
"id": "54a4a1d84107b74781a3ac8a488d47492ea20725",
"size":... |
import os
import sys
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
from numpy.testing import assert_array_almost_equal, assert_array_equal
import scipy.sparse as sp
from scipy import linalg, optimize, sparse
import pytest
from sklearn.base import clone
from sklearn.... | {
"content_hash": "fade8561ddec26d0b58f34509b914e32",
"timestamp": "",
"source": "github",
"line_count": 1871,
"max_line_length": 79,
"avg_line_length": 41.667022982362376,
"alnum_prop": 0.5975833450916508,
"repo_name": "xuewei4d/scikit-learn",
"id": "480472504a92b0d208ef10268ab8809a0e48b345",
"size... |
""" Blinks an LED """
from myhdl import *
def top(pins):
@always(pins.clk.posedge)
def count():
""" Increments counter every time the clock rises """
bob.next = 1
return instances()
| {
"content_hash": "ea07d314e1e13009746500f739a524b2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 61,
"avg_line_length": 19.363636363636363,
"alnum_prop": 0.5915492957746479,
"repo_name": "nturley/synthia",
"id": "de72fbf2eb4c60d74a9823c30f42ef4e848c1f11",
"size": "213"... |
from __future__ import division, print_function, absolute_import
from scipy._lib.six import string_types, exec_, PY3
from scipy._lib._util import getargspec_no_self as _getargspec
import sys
import keyword
import re
import types
import warnings
from scipy.misc import doccer
from ._distr_params import distcont, distd... | {
"content_hash": "794c4f82701658f58c835a39e9b61894",
"timestamp": "",
"source": "github",
"line_count": 3430,
"max_line_length": 103,
"avg_line_length": 34.81049562682216,
"alnum_prop": 0.5537102177554439,
"repo_name": "boomsbloom/dtm-fmri",
"id": "4a353bbbb3887a1d57f955580ab39914330fac95",
"size":... |
from django.test import TestCase
from .templatetags import core_tags
class CoreTagsTestCase(TestCase):
def setUp(self):
self.data = [
{
'strs': (
'first error',
'second error',
'third error',
'fo... | {
"content_hash": "4fb58f7dc852ce626076e3211e1889fe",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 90,
"avg_line_length": 29.629032258064516,
"alnum_prop": 0.3538377789874796,
"repo_name": "calendall/calendall",
"id": "9e61b2a609cab493f54c07eb54740a58ce617376",
"size": "... |
import os
from pathlib import Path
from unittest import mock
from airflow_breeze.utils.path_utils import find_airflow_sources_root_to_operate_on
ACTUAL_AIRFLOW_SOURCES = Path(__file__).parents[3].resolve()
ROOT_PATH = Path(Path(__file__).root)
def test_find_airflow_root_upwards_from_cwd(capsys):
os.chdir(Path(_... | {
"content_hash": "cc15958cced44354cf76c66735cef101",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 83,
"avg_line_length": 34.5625,
"alnum_prop": 0.7188065099457505,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "99da5ce04e521549d9b8f18379bbf2435405d71f",
"size": "18... |
class Solution:
# @param s, a string
# @return an integer
def longestValidParentheses(self, s):
stack = []
result = [-1 for i in xrange(len(s))]
maximum = 0
curr = 0
for i in xrange(len(s)):
if s[i] == "(":
stack.append(i)
... | {
"content_hash": "b8404a62dfb8b1951877f7c414321fe1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 52,
"avg_line_length": 26.705882352941178,
"alnum_prop": 0.45044052863436124,
"repo_name": "sureleo/leetcode",
"id": "cf28d85db7c04861ecfd58174f5caf3d8b986067",
"size": "90... |
import asyncio
from demonhunter import DemonHunter
from demonhunter.nodes.honeypots.telnet import TelnetHoneypot, MicrosoftTelnet
from demonhunter.nodes.honeypots.vnc import VNCHoneypot
from demonhunter.nodes.honeypots.http import HTTPHoneypot, Apache
loop = asyncio.get_event_loop()
hp = DemonHunter(loop)
vnc = VNC... | {
"content_hash": "7592ba8f149397daa60564f532c8b7dc",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 87,
"avg_line_length": 24.166666666666668,
"alnum_prop": 0.7655172413793103,
"repo_name": "RevengeComing/DemonHunter",
"id": "4e0583d45d7edfa636189ac851616404157f2f21",
"si... |
"""
This module implements a set of :class:`revscoring.Feature`
for use in scoring revisions. :class:`revscoring.Feature`
lists can be provided to a :func:`revscoring.dependencies.solve`, or
more commonly, to a :class:`revscoring.Extractor` to obtain simple
numerical/boolean values that can be used when modeling revis... | {
"content_hash": "027d481afd633d3060d2ba788d949f0a",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 78,
"avg_line_length": 36.71666666666667,
"alnum_prop": 0.7453472537448933,
"repo_name": "he7d3r/revscoring",
"id": "02e767de0a991e0997704392868080ad5483e592",
"size": "220... |
from types import FunctionType, LambdaType
#--- LIST OPERATIONS ---------------------------------------------------------------------------------
def sorted(list, cmp=None, reversed=False):
""" Returns a sorted copy of the list.
"""
list = [x for x in list]
list.sort(cmp)
if reversed: list.reverse... | {
"content_hash": "db391f441b548473c9cdcecd3ee44cc7",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 102,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.5175644028103045,
"repo_name": "est/nodebox-gl",
"id": "41e39f2ccdda6245c469ce08837ddbd8cd80b509",
"size": "561... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import time
from mcrouter.test.MCProcess import Memcached
from mcrouter.test.McrouterTestCase import McrouterTestCase
class TestModifyExptime(McrouterTestCase):
con... | {
"content_hash": "d1b6872a11c0de196c856d2bfb373e95",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 63,
"avg_line_length": 33.254901960784316,
"alnum_prop": 0.6403301886792453,
"repo_name": "yqzhang/mcrouter",
"id": "d46ed129cf857a2186234bcd95075559aeafb9f9",
"size": "198... |
from __future__ import unicode_literals
from django.dispatch import Signal
local_site_user_added = Signal(providing_args=['user', 'localsite'])
| {
"content_hash": "70b7db6f2ea80d2175c06e6005edea21",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 68,
"avg_line_length": 24.5,
"alnum_prop": 0.7551020408163265,
"repo_name": "davidt/reviewboard",
"id": "7d8be334787697dc963eafce785e060a7ea22fa2",
"size": "147",
"binary"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0005_auto_20160205_0651'),
]
operations = [
migrations.AlterField(
model_name='user',
name='last_login',
... | {
"content_hash": "5ae43829f28908d36a91b7e2a647977f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 89,
"avg_line_length": 26.17391304347826,
"alnum_prop": 0.5880398671096345,
"repo_name": "HyperManTT/ECommerceSaleor",
"id": "6fe664c82f448940a881194b07ab09d6590f5468",
"si... |
"""RNN helpers for TensorFlow models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.fr... | {
"content_hash": "a66fc9baefc2bc56e27230883671004f",
"timestamp": "",
"source": "github",
"line_count": 1362,
"max_line_length": 96,
"avg_line_length": 42.59251101321586,
"alnum_prop": 0.6681491441278378,
"repo_name": "DCSaunders/tensorflow",
"id": "12b0243ae60c531f5f78d88b620c541250aaa5d8",
"size"... |
"""TensorFlow Debugger (tfdbg) Stepper Module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import six
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.debug.lib import debug_data
from tensorflow.python.framework imp... | {
"content_hash": "66e9477f5e6b23d2948ea61fb5db14d2",
"timestamp": "",
"source": "github",
"line_count": 831,
"max_line_length": 83,
"avg_line_length": 35.43321299638989,
"alnum_prop": 0.6547800984887078,
"repo_name": "jjas0nn/solvem",
"id": "47e42efbbbf8fd60ed763736e70669ca539be59c",
"size": "30134... |
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = dict(packages = [], excludes = [])
import sys
base = 'Win32GUI' if sys.platform=='win32' else None
executables = [
Executable('videocompress.py', base=base)
]
setup(name='Videocompr... | {
"content_hash": "34c1b2b55243eced281fa65280549eec",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 99,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.7037735849056603,
"repo_name": "point86/Videocompress",
"id": "0c51540bccdcdf3ff1973bae8f258bda6896ba1d",
"size":... |
"""
Definitions of the GA4GH protocol types.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import json
import inspect
import datetime
import itertools
from cStringIO import StringIO
import avro.io
def convertDatetime(t):
"""
Conv... | {
"content_hash": "1072d933ac5fcce0c51496d57a187ddb",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 78,
"avg_line_length": 32.96590909090909,
"alnum_prop": 0.6288636102493393,
"repo_name": "adamnovak/server",
"id": "5eaca87cae81feabc29a95514a4353c7b7066e7d",
"size": "870... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from tagging.fields import TagField
class Bookmark(models.Model):
""" Simple model for storing bookmarks """
url = models.URLField(_('url'), unique=True)
description = models.TextField(_('description'), )
exte... | {
"content_hash": "2c792bbc44aba27a8f735df7b494b592",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 33.24,
"alnum_prop": 0.641395908543923,
"repo_name": "blampe/M2M",
"id": "3983f2f9bcaf052746907817a801041f080aa1ae",
"size": "831",
"binary": false... |
"""question resources"""
| {
"content_hash": "1a1b2911241027ea069fae49e9f9ba1e",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 25,
"alnum_prop": 0.68,
"repo_name": "nicktimko/Planet-Lab",
"id": "0ceb7500cce2c72d0610c9d394479ca0ee8c3732",
"size": "25",
"binary": false,
"cop... |
"""
Class for representing hierarchical language structures, such as
syntax trees and morphological trees.
"""
from __future__ import print_function, unicode_literals
# TODO: add LabelledTree (can be used for dependency trees)
import re
from nltk.grammar import Production, Nonterminal
from nltk.probability import Pr... | {
"content_hash": "b1025efa82b039926e779474ff2d70b9",
"timestamp": "",
"source": "github",
"line_count": 1592,
"max_line_length": 152,
"avg_line_length": 40.196608040201006,
"alnum_prop": 0.5447939618395762,
"repo_name": "neerajvashistha/pa-dude",
"id": "e697d6fef57442f752dcacfebdbaf6dca7abbdb7",
"s... |
def get_first_object_or_none(queryset):
"""
A shortcut to obtain the first object of a queryset if it exists or None
otherwise.
"""
try:
return queryset[:1][0]
except IndexError:
return None
| {
"content_hash": "5a11793a265f99a1f09aad0c335c729e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.6190476190476191,
"repo_name": "Chilledheart/seahub",
"id": "942f5f91ba97f2b83f8f801577ceedf729a6c747",
"size": "2... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Category.content'
db.add_column('core_category', 'content', self.gf('django.db.models.fields.TextField')(default='',... | {
"content_hash": "3050a3748c44fade1ba2d1220df5f218",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 182,
"avg_line_length": 74.0375,
"alnum_prop": 0.5490460915076819,
"repo_name": "petrlosa/ella",
"id": "441aeceb39766f3b6cb49c7b29c53314473b0c84",
"size": "11864",
"bina... |
"""A command line parsing module that lets modules define their own options.
Each module defines its own options, e.g.,
from tornado.options import define, options
define("mysql_host", default="127.0.0.1:3306", help="Main user DB")
define("memcache_hosts", default="127.0.0.1:11011", multiple=True,
... | {
"content_hash": "61de6e4ce5bc3318b61c61adf5545958",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 77,
"avg_line_length": 33.76047904191617,
"alnum_prop": 0.5693508336289465,
"repo_name": "aljoscha/shot-o-matic",
"id": "1f676ff01479373122341ae1b5ba66f15663a8b5",
"size":... |
import datetime
import hashlib
import itertools
import logging
import random
import signal
import sys
import time
from lockfile import LockTimeout
from hlsclient import helpers
from hlsclient.balancer import Balancer
from hlsclient.combine import get_actions
from hlsclient.consumer import consume_from_balancer
from h... | {
"content_hash": "fa64f05209d3f65c733dcfaf92684e28",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 108,
"avg_line_length": 35.778625954198475,
"alnum_prop": 0.6168124599957329,
"repo_name": "globocom/hlsclient",
"id": "9b73279fbf7d46267e6bd8291f0a30acd1feb7af",
"size": ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import ten... | {
"content_hash": "482bafe8a923c2db970a4818a952549a",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 107,
"avg_line_length": 44.23646209386282,
"alnum_prop": 0.6326355735096095,
"repo_name": "wangheda/youtube-8m",
"id": "64d16f10c5f72b770df0cec986fa0175f952e265",
"size": ... |
from rsqueakvm.plugins.foreign_language.process import W_ForeignLanguageProcess
from rsqueakvm.plugins.python.model import W_PythonObject
from rsqueakvm.plugins.python.objspace import py_space
from rsqueakvm.plugins.python import utils
from pypy.interpreter.argument import Arguments
from pypy.interpreter.error import ... | {
"content_hash": "b80ba576d1abe78f3696d81c66451be4",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 79,
"avg_line_length": 40.96511627906977,
"alnum_prop": 0.5915413000283849,
"repo_name": "HPI-SWA-Lab/RSqueak",
"id": "8804d77181ee02946f2311ae8a2a050a12d4103a",
"size": "3... |
"""
bma2x2 is a micropython module for the Bosch BMA2X2 sensor.
It measures acceleration three axis.
The MIT License (MIT)
Copyright (c) 2016 Sebastian Plamauer [email protected]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Soft... | {
"content_hash": "207356afdf7806188892780d139d3696",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 116,
"avg_line_length": 36.34375,
"alnum_prop": 0.5969045571797077,
"repo_name": "micropython-IMU/micropython-bmx055",
"id": "c582d7555c5f58583c19785a0e8d077006818673",
"s... |
"""
_models.py : modeling routines for determining variable significance
"""
import numpy as np
def logit(x):
return np.log(x/(1-x))
def _get_conditional_scores(dataframe=None, feature=None, target=None,
positive_class=None, print_output=True,
master_dict=N... | {
"content_hash": "68de83b1e11dea485d5efca96b32049c",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 109,
"avg_line_length": 50.067961165048544,
"alnum_prop": 0.589102191196432,
"repo_name": "jmwoloso/avalearn",
"id": "a3e706fbee326c0e1b284eff1d9481470a839005",
"size": "5... |
import sublime
import sublime_plugin
class AmalgamateCommand(sublime_plugin.WindowCommand):
settings = {}
def is_enabled(self):
return self.load_settings()
def is_visible(self):
return True
def description(self):
return None
def load_settings(self):
self.settings = self.window.project_data()
if... | {
"content_hash": "98da0272647ce4779ec0e0a2634deb71",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 74,
"avg_line_length": 19.741935483870968,
"alnum_prop": 0.6584967320261438,
"repo_name": "donteatyellowsnow/amalgamate",
"id": "ddea89587dfc371772f5e8cbb3668e55dd61a1fb",
... |
from django import forms
from django.template import loader
from django.utils.encoding import force_unicode
from django.utils import formats
class CodeEditorWidget(forms.Widget):
'''A widget for using the ACE editor (ace.ajax.org) on the admin page'''
@property
def media(self):
scripts = ["admin/ace/ace.js", "adm... | {
"content_hash": "f85411bf7baf59dbdcd5c911fbd9a714",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 73,
"avg_line_length": 29.82608695652174,
"alnum_prop": 0.6710398445092323,
"repo_name": "RedwoodAdmin/RedwoodFramework",
"id": "af24da230ca3a5c77dc2689757c8b44242bbf046",
... |
from twisted.trial import unittest
from buildslave.test.fake.runprocess import Expect
from buildslave.test.util.sourcecommand import SourceCommandTestMixin
from buildslave.commands import darcs
class TestDarcs(SourceCommandTestMixin, unittest.TestCase):
def setUp(self):
self.setUpCommand()
def tearD... | {
"content_hash": "c1d805c830cf134b2f4532cc2ed333f4",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 75,
"avg_line_length": 30.78688524590164,
"alnum_prop": 0.6765175718849841,
"repo_name": "denny820909/builder",
"id": "e6953e31fb740f2e9cedded3a4bcc5d1a9315902",
"size": "... |
"""Fichier contenant le type viande."""
from .nourriture import Nourriture
class Viande(Nourriture):
"""Type d'objet: viande.
"""
nom_type = "viande"
def __init__(self, cle=""):
"""Constructeur de l'objet"""
Nourriture.__init__(self, cle)
self.nourrissant = 3
| {
"content_hash": "f9227708d76e62ee082b278fccafe605",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 21.133333333333333,
"alnum_prop": 0.5646687697160884,
"repo_name": "stormi/tsunami",
"id": "557feade322947b1b1efcd1e09a7dcd027f92b62",
"size": "1882"... |
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.db import models
from socialregistration.signals import connect
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
class ... | {
"content_hash": "a9e096410a1e232e2283ff7e7d1a67c4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 33.975,
"alnum_prop": 0.7233259749816041,
"repo_name": "kapt/django-socialregistration",
"id": "8506098c8038b24758aab910415b226542cdb125",
"size": "1... |
import sys
import re
from twisted.python import log
from twisted.internet import defer
from twisted.enterprise import adbapi
from buildbot.process.buildstep import LogLineObserver
from buildbot.steps.shell import Test
class EqConnectionPool(adbapi.ConnectionPool):
"""This class works the same way as
twisted.enterp... | {
"content_hash": "7657f5d15028c7f676b683b3267ee357",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 120,
"avg_line_length": 37.70152505446623,
"alnum_prop": 0.6037561398439757,
"repo_name": "denny820909/builder",
"id": "a49b90e2129c5555a2d6fb6205181e5203bc1529",
"size": ... |
import asyncio
import os
import threading
import unittest
from datetime import datetime, timedelta
import pytest
from reactivex.scheduler.eventloop import AsyncIOThreadSafeScheduler
CI = os.getenv("CI") is not None
class TestAsyncIOThreadSafeScheduler(unittest.TestCase):
@pytest.mark.skipif(CI, reason="Flaky t... | {
"content_hash": "b244a8f5e7a6daba49c51bb4d8270db0",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 78,
"avg_line_length": 32.152866242038215,
"alnum_prop": 0.6071711568938193,
"repo_name": "ReactiveX/RxPY",
"id": "18e30d4453d9bbcfeed62dbd078af8341b69cae9",
"size": "5048... |
import os
import pytest
pytestmark = pytest.mark.skipif(
os.environ.get("SKIP_SLOW_TESTS"),
reason="Live test are slow as they need to run chrome",
)
| {
"content_hash": "7575e6d6e000ac435c5756916bd52fe6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 59,
"avg_line_length": 20,
"alnum_prop": 0.70625,
"repo_name": "meine-stadt-transparent/meine-stadt-transparent",
"id": "1ac29915f7aefb1b95a4fadde0153b6381a9dbc9",
"size": "... |
"""
A version of first order predicate logic, built on
top of the typed lambda calculus.
"""
from __future__ import print_function, unicode_literals
import re
import operator
from collections import defaultdict
from functools import reduce
from nltk.util import Trie
from nltk.internals import Counter
from nltk.compat... | {
"content_hash": "6b31fcd9875401c784b2a3bdc329c620",
"timestamp": "",
"source": "github",
"line_count": 1902,
"max_line_length": 122,
"avg_line_length": 35.650893796004205,
"alnum_prop": 0.5841198678621992,
"repo_name": "Edu-Glez/Bank_sentiment_analysis",
"id": "2e38bd1e4ba53c6e5b04525dbcb0d078e9a004... |
import wx
import armid
from BasePanel import BasePanel
import InternalDocument
from InternalDocumentNotebook import InternalDocumentNotebook
class InternalDocumentPanel(BasePanel):
def __init__(self,parent):
BasePanel.__init__(self,parent,armid.EXTERNALDOCUMENT_ID)
self.theId = None
def buildControls(... | {
"content_hash": "6cb799fcd6d8285c4c42c70ea8a67e39",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 107,
"avg_line_length": 36.46666666666667,
"alnum_prop": 0.7687385740402194,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "86e54a44064ec77a118a924e68dce8c552272610",
"size"... |
from __future__ import print_function
import time
import math
import mpu6050
import hmc5883l
import bmp085
import thread
from gpsdData import *
global stop
def fileOpen(fileToWrite,bufferring = 100):
if fileToWrite!=None:
try:
file1 = open(fileToWrite,'w',bufferring)
except:
print('file open f... | {
"content_hash": "1a797980cbd37ad3fb6d1e9e600e084c",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 93,
"avg_line_length": 26.586805555555557,
"alnum_prop": 0.5785555700666057,
"repo_name": "lj8385174/PyComms",
"id": "125a5fb737d4f028f63d7b4a9d15d04745acb4df",
"size": "7... |
command = testtex_command (OIIO_TESTSUITE_IMAGEDIR + "/miplevels.tx",
" -nowarp -res 256 256 -stochastic 1 -widthramp 4 -d uint8 -o out.tif")
outputs = [ "out.tif" ]
| {
"content_hash": "e5ff6399f9f09e7326027156ac0569e3",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 98,
"avg_line_length": 64.33333333333333,
"alnum_prop": 0.5958549222797928,
"repo_name": "lgritz/oiio",
"id": "91cb4344e816bdd9ddc61b726b84e473bcde6525",
"size": "558",
"b... |
"""Ttk wrapper.
This module provides classes to allow using Tk themed widget set.
Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.
Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
ap... | {
"content_hash": "f21956c680e5b2875f6e348a2dc62471",
"timestamp": "",
"source": "github",
"line_count": 1635,
"max_line_length": 80,
"avg_line_length": 34.401223241590216,
"alnum_prop": 0.6066564733492159,
"repo_name": "wdv4758h/ZipPy",
"id": "928e1de781803bed1e8133579bc12d21a11d9a82",
"size": "562... |
"""
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_source... | {
"content_hash": "02c808a70990794a4f433e8c14d0df4a",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 140,
"avg_line_length": 39.65573770491803,
"alnum_prop": 0.614716825134353,
"repo_name": "rimbalinux/MSISDNArea",
"id": "d9577d3299aa37699bf2399d4ccd9821d84fbe6c",
"size": ... |
from .pythons3 import PythonS3
from .pythons3 import PythonS3 as Pythons3 | {
"content_hash": "f44eafaede9c48ddcb930aa08595083d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 36.5,
"alnum_prop": 0.8493150684931506,
"repo_name": "rootcss/pythons3",
"id": "c21709e12d4127f50473cb32b1a73b0e65318212",
"size": "73",
"binary": f... |
''' Client-side interactivity.
'''
from __future__ import absolute_import
from types import FunctionType
from ..core.has_props import abstract
from ..core.properties import Dict, String, Bool, AnyRef
from ..model import Model
from ..util.dependencies import import_required
from ..util.compiler import nodejs_compile,... | {
"content_hash": "44efb6f8e5343ee8547f5c9b3d36cd70",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 102,
"avg_line_length": 37.53191489361702,
"alnum_prop": 0.6522108843537415,
"repo_name": "dennisobrien/bokeh",
"id": "3617970859de12b508a0167de96c77793bdb23b5",
"size": "3... |
import sys
import os
import argparse
import numpy
import logging
from datetime import datetime
path = os.path.join(os.getcwd(), "lib")
sys.path.insert(0, path)
import pirates
import plot_functions as plt
def check_negative(value):
""" check if a value is negative"""
ivalue = int(value)
if ivalue <= 0:
... | {
"content_hash": "8681aab235a56c31de513aefb1ae7a25",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 162,
"avg_line_length": 33.8421052631579,
"alnum_prop": 0.6513219284603421,
"repo_name": "maurogaravello/pirati",
"id": "bb9bc874cfb0cf7a29aef5ba2b188b6dea437065",
"size": ... |
"""Implement the Google Smart Home traits."""
import logging
from homeassistant.components import (
alarm_control_panel,
binary_sensor,
camera,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
)
from homeassi... | {
"content_hash": "8e665552d1efe7b4ba1ac6db34d15288",
"timestamp": "",
"source": "github",
"line_count": 1454,
"max_line_length": 88,
"avg_line_length": 33.77647867950481,
"alnum_prop": 0.5713791207672415,
"repo_name": "postlund/home-assistant",
"id": "b4585ebde033d92f037169dcf772c65ab02cf617",
"siz... |
class A(object): pass
class B(object): pass
class C(object): pass
class D(object): pass
class E(object): pass
class K1(A,B,C): pass
class K2(D,B,E): pass
class K3(D,A): pass
class Z(K1,K2,K3): pass
print(Z.mro())
| {
"content_hash": "4465a240a33f9765c70d2a6b17ae0326",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 23,
"avg_line_length": 21.5,
"alnum_prop": 0.6790697674418604,
"repo_name": "bjpop/berp",
"id": "976e0a4cf2599cb3b77ec24a2df1282a0c0d0fa5",
"size": "467",
"binary": false... |
import unittest
import utils
from testbin import TestBin
class TestBinCocheck(TestBin, unittest.TestCase):
def setUp(self):
self.bin = 'co-check'
self.do_not_test_running = True
def tearDown(self):
pass
| {
"content_hash": "e6cfd8e79858fdf6758a50b886785a4e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 49,
"avg_line_length": 19.833333333333332,
"alnum_prop": 0.6722689075630253,
"repo_name": "ow2-mirrors/compatibleone",
"id": "b4280ce138dcad16414edb3301d167fec5834b8a",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.