text stringlengths 4 1.02M | meta dict |
|---|---|
import unittest
import sys
import os
import PRESUBMIT
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..', '..'))
from PRESUBMIT_test_mocks import MockInputApi, MockOutputApi, MockAffectedFile
class PresubmitTest(unittest.TestCase):
def testCheckForDoctypeHTML(self):
... | {
"content_hash": "ac705bd1183fe96e3875756773b37f16",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 39.57831325301205,
"alnum_prop": 0.5092846270928463,
"repo_name": "chromium/chromium",
"id": "a4c9603c8919e213c167edb1a0cf0e80e05b9e67",
"size": "344... |
import os
import logging
from collections import OrderedDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.autograd import Variable
from src.data_ops.wrapping import wrap
from src.architectures.nmp.message_passing.vertex_upd... | {
"content_hash": "9962678aab2cd2e03bd8a284b8a43f1d",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 112,
"avg_line_length": 28,
"alnum_prop": 0.564795918367347,
"repo_name": "isaachenrion/jets",
"id": "a89b6ae54a533df8394565f0d775665baf9fe667",
"size": "5880",
"binary"... |
from .logger import Logger
from .metrics_collector import MetricsCollector
from .null import Null
from .statsd import Statsd
__all__ = [Logger, MetricsCollector, Null, Statsd]
| {
"content_hash": "d398821a9c40cfd3a7d5b5273d9f2924",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 50,
"avg_line_length": 29.5,
"alnum_prop": 0.7853107344632768,
"repo_name": "wiki-ai/ores",
"id": "1ceb0a3db3e54293df5fdb35a759130382ab878c",
"size": "177",
"binary": fals... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource ... | {
"content_hash": "709cc3cc31410367e6b6de4483140863",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 138,
"avg_line_length": 36.45813953488372,
"alnum_prop": 0.6270970211137334,
"repo_name": "twilio/twilio-python",
"id": "454b5506c73bdc7e3993aeb4cb70efad3b97c5f5",
"size":... |
from google.cloud import notebooks_v1
async def sample_start_runtime():
# Create a client
client = notebooks_v1.ManagedNotebookServiceAsyncClient()
# Initialize request argument(s)
request = notebooks_v1.StartRuntimeRequest(
name="name_value",
)
# Make the request
operation = cli... | {
"content_hash": "593d6d8bf507e2d2edc89fe523eb7f9f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 24.695652173913043,
"alnum_prop": 0.7147887323943662,
"repo_name": "googleapis/python-notebooks",
"id": "3c457bc93827901c7210b2ee732eed9e75187c24",
"... |
"""Init and utils."""
from zope.i18nmessageid import MessageFactory
_ = MessageFactory('plonetheme.clean_blog')
| {
"content_hash": "9d8614c1be40c1ea003099ab66d1f11d",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 22.8,
"alnum_prop": 0.7543859649122807,
"repo_name": "vikas-parashar/plonetheme.clean_blog",
"id": "19198e19e91e56aeb9c0ba34cdc42c01210ca167",
"size":... |
def title_case(title, minor_words=''):
""" Thanks to 'soapie' from CodeWars """
title = title.capitalize().split()
minor_words = minor_words.lower().split()
return ' '.join(word if word in minor_words else word.capitalize()
for word in title)
| {
"content_hash": "5a6061c3f42c2ed39c8ca811879631ec",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 70,
"avg_line_length": 46.5,
"alnum_prop": 0.6164874551971327,
"repo_name": "the-zebulan/CodeWars",
"id": "130e9dc47d6320d399465200627c101a68c6decd",
"size": "695",
"binar... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('registration', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='registrants',
... | {
"content_hash": "a68225e51e0ed65ab18461fedede14b2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 119,
"avg_line_length": 25.7,
"alnum_prop": 0.6361867704280155,
"repo_name": "asterix135/infonex_crm",
"id": "b280190e7fb69e9b38f6b003e4363762349f725d",
"size": "586",
"b... |
__all__ = ['getDpi', 'getContext', 'getPreset', 'getScreenContext']
import matplotlib as mpl
from math import sqrt
def getDpi():
return 72.27
_screenDpi = 96
_screenFontSize = 12
_goldenRatio = (1 + sqrt(5)) / 2
_presets = {
'revtex12-single': (468, 10.95, None), # Single-column revtex; 12pt.
'mnras': (2... | {
"content_hash": "3c2972bd396aec2e050381165b99bab2",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 91,
"avg_line_length": 29.97196261682243,
"alnum_prop": 0.6239476145930777,
"repo_name": "willvousden/mpltex",
"id": "73d32689a54f12bd0a342848696ad7d22e787b65",
"size": "3... |
import numpy as np
from scipy.fftpack import fft
import math
##################################################################################
##################################################################################
def fourierAn(y):
#aplicar transformada de fourier a los datos
Y = fft(y)
... | {
"content_hash": "a4cdea21370bccddb791e2c62ee3cf26",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 142,
"avg_line_length": 43.68,
"alnum_prop": 0.47802197802197804,
"repo_name": "miltonsarria/dsp-python",
"id": "9b8affaa04afb1aafaec4f50b513169782b95e4d",
"size": "1197",
... |
'''Actions for moving things around based on their velocity and
acceleration.
The simplest usage:
sprite = cocos.sprite.Sprite('ship.png')
sprite.velocity = (100, 100)
sprite.do(Move())
This will move the sprite (100, 100) pixels per second indefinitely.
Typically the sprite would be controlled by the u... | {
"content_hash": "e2f780e3114b53db820c8ebab861383c",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 75,
"avg_line_length": 30.481081081081083,
"alnum_prop": 0.5687178577762014,
"repo_name": "shujunqiao/cocos2d-python",
"id": "77b9335642210eec48ce90e7efe3497d38f93002",
"s... |
from logging.config import dictConfig
from .logging_config import LOGGING
def setup_logger(config=None):
if config is None:
config = LOGGING
dictConfig(config)
| {
"content_hash": "cc43e69a1806d8bf7476b97e143b353f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 37,
"avg_line_length": 19.88888888888889,
"alnum_prop": 0.7262569832402235,
"repo_name": "jheld/diycrate",
"id": "bad320f32beee03ea20fccd9abc468d826853f82",
"size": "179",
... |
"""Export data from Nova database and import through Identity Service."""
import uuid
from keystone.common import logging
from keystone.contrib.ec2.backends import sql as ec2_sql
from keystone.identity.backends import sql as identity_sql
LOG = logging.getLogger(__name__)
def import_auth(data):
identity_api = ... | {
"content_hash": "c428fbda9c316e14bf4878ee1800182a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 73,
"avg_line_length": 34.018348623853214,
"alnum_prop": 0.5744336569579288,
"repo_name": "cbrucks/keystone_ldap",
"id": "01b14d9847fd13269019e388fd5f17cb817523eb",
"size"... |
"""
Concept from:
[1] https://github.com/venidera/otsdb_client/blob/master/otsdb_client/client.py
2017.02, Bikash Agrawal, DNVGL
Insert spark dataframe to opentsdb
Example usage
--------------
>>> import opentsdb
>>> oc = opentsdb()
>>> oc.ts_insert(df)
Note: it works only with spark dataframe.
"""
import requests ... | {
"content_hash": "0256b413a438e2fa8a4d4683ae441571",
"timestamp": "",
"source": "github",
"line_count": 548,
"max_line_length": 129,
"avg_line_length": 38.33759124087591,
"alnum_prop": 0.5189680613070589,
"repo_name": "bikash/opentsdb_spark",
"id": "4ae2235bf7b82619ed23bd58f4360aeadc8b9c14",
"size"... |
from django.contrib import admin
from .models import (Project, License, Team, Resource)
class TeamInline(admin.TabularInline):
model = Team
extra = 1
class ResourceInline(admin.TabularInline):
model = Resource
extra = 1
class ProjectAdm... | {
"content_hash": "01af99843750e6a59ff10de5fd97b109",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 80,
"avg_line_length": 33.130434782608695,
"alnum_prop": 0.46062992125984253,
"repo_name": "nasa/39A",
"id": "f5f20bbb2a6863698163d1572ba59aa552ca416c",
"size": "762",
"b... |
__author__ = 'Edward Hunter'
from nose.plugins.attrib import attr
import gevent
import os
from pyon.util.int_test import IonIntegrationTestCase
from pyon.public import BadRequest, NotFound, IonObject, RT, PRED, OT, CFG, StreamSubscriber, log
from ion.agent.control import AgentControl, StreamingAgentClient
from ion.a... | {
"content_hash": "6d4f5f6cfe581a5084cda489be0d1bc0",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 119,
"avg_line_length": 41.07027027027027,
"alnum_prop": 0.5950250065806791,
"repo_name": "scion-network/scion",
"id": "7e38481de08c2f31d63efa1909e7a6cfcc90099e",
"size": ... |
import numpy as np
from copy import deepcopy
from .nddata_base import NDDataBase
from .nduncertainty import NDUncertainty, UnknownUncertainty
from .. import log
from ..units import Unit, Quantity
from ..utils.metadata import MetaData
__all__ = ['NDData']
_meta_doc = """`dict`-like : Additional meta information about... | {
"content_hash": "29bc62d90dfa3027051522d989e76de5",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 94,
"avg_line_length": 38.0625,
"alnum_prop": 0.586639011321407,
"repo_name": "DougBurke/astropy",
"id": "5759ecc62abd3be87262bf3ed3ba6fb1ee472e6a",
"size": "11685",
"bi... |
import rospy
from monitored_navigation.monitor_state import MonitorState
from std_msgs.msg import Bool
from sensor_msgs.msg import Joy
class MonitorPause(MonitorState):
def __init__(self, is_paused=False):
#if is_paused monitors for resume, else monitors for pause
self.is_paused=is_pa... | {
"content_hash": "8329221a739065ddffb9e7a47732a6b7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 100,
"avg_line_length": 24.682926829268293,
"alnum_prop": 0.6017786561264822,
"repo_name": "strands-project/strands_recovery_behaviours",
"id": "bd7a04a57c99b1cd1f761e1df5579... |
"""This is mostly an example opf how to organize a class for the wavescupltor
motor controller None of this code is tested at all and will likely require
some good work."""
import logging
import struct
def parseWSPacket(rx):
# pack byte array into a string
# this might be the rverse order
lowerArray = st... | {
"content_hash": "492637b49c2dd416e311988bb7c6697c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 84,
"avg_line_length": 33.588235294117645,
"alnum_prop": 0.6701692936368944,
"repo_name": "dilithiumpower/mppt_config",
"id": "70a958550be8d444946d7343d250c9265c15fd68",
"s... |
"""Tests for tfx.dsl.input_resolution.ops.exclude_spans_op."""
import tensorflow as tf
from tfx import types
from tfx.dsl.input_resolution.ops import ops
from tfx.dsl.input_resolution.ops import test_utils
class ArtifactWithoutSpan(types.Artifact):
"""An Artifact without "span" as a PROPERTY."""
TYPE_NAME = 'Ar... | {
"content_hash": "060d3c1f4abe7275fc519ae3afbbe3cd",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 68,
"avg_line_length": 27.08955223880597,
"alnum_prop": 0.6721763085399449,
"repo_name": "tensorflow/tfx",
"id": "1d7d3ebd1e7702b99ba127750f599a587a92a307",
"size": "2411",... |
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
# pylint: disable=too-many-lines
import atexit
import json
import os
import re
import shutil
import subprocess
import ruamel.yaml as yaml
#import yaml
#
## This is here because of a bug that causes yaml
## to incorrectly handle timezone info on t... | {
"content_hash": "095848f5aeb708337a8b751fbfc15847",
"timestamp": "",
"source": "github",
"line_count": 1394,
"max_line_length": 118,
"avg_line_length": 32.82209469153515,
"alnum_prop": 0.5348821960921449,
"repo_name": "appuio/ansible-role-openshift-zabbix-monitoring",
"id": "6d2f1e596f7894deee394511... |
from __future__ import absolute_import, division, print_function, unicode_literals
import itertools
from c7n.utils import local_session, chunks, type_schema
from .core import Filter
class HealthEventFilter(Filter):
"""Check if there are health events related to the resources
Health events are stored as a... | {
"content_hash": "fc674444bd1d9c3adaf3d09515bdc280",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 82,
"avg_line_length": 38.09411764705882,
"alnum_prop": 0.5558987029030266,
"repo_name": "siddartha1992/cloud-custodian",
"id": "12e2e1510bf9e4718e3ba6c36a5996a84da4adcf",
... |
import base64
import datetime
import os
import tornado
import tornado.web
import tornado.gen
import tornado.httpclient
from tornado.auth import GoogleOAuth2Mixin
from oauth2client import GOOGLE_REVOKE_URI, GOOGLE_TOKEN_URI
from oauth2client.client import OAuth2Credentials, _extract_id_token
from handler_base import H... | {
"content_hash": "942a1d409004db4c301b8c6b52882d28",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 103,
"avg_line_length": 39.9264705882353,
"alnum_prop": 0.5731123388581952,
"repo_name": "tanmaykm/pygdrive",
"id": "405cb5363b990da30defe1dca98faf364a849e68",
"size": "271... |
import os
import sys
if sys.version_info[0] < 3: raise Exception("Python 3 or a more recent version is required.")
import pprint
import argparse
import urllib.request
from datetime import datetime
import shutil
from time import sleep
# ==============================================================================
# ==... | {
"content_hash": "75947d10353748cc73bae7843b2d8754",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 129,
"avg_line_length": 38.242553191489364,
"alnum_prop": 0.5115166351396462,
"repo_name": "onqtam/doctest",
"id": "0aaa981a80d9ccb2703df659b16e510e4e2b3554",
"size": "900... |
"""Utility functions for Process invocation and management."""
from __future__ import unicode_literals
import os
import subprocess
import sys
from reviewbot.utils.log import get_logger
logger = get_logger(__name__)
def execute(command,
env=None,
split_lines=False,
ignore_error... | {
"content_hash": "7c2ba2ded4811d632719c58e4d9a2a57",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 78,
"avg_line_length": 29.52972972972973,
"alnum_prop": 0.5731283177741168,
"repo_name": "reviewboard/ReviewBot",
"id": "f03c7190585ab7fd3a490aa71eb24b65c62dca39",
"size":... |
import os
LOG_STDOUT = True
# Maximum number of rows to be returned from Solr
CITATION_HELPER_MAX_HITS = 10000
# Maximum number of bibcodes in input (excess will be ignored)
CITATION_HELPER_MAX_INPUT = 500
# Maximum number allowed in submitted bibcodes
CITATION_HELPER_MAX_SUBMITTED = 100
# Bibcode input list will be sp... | {
"content_hash": "85c20bb7af5c88e42e00690b121b7df4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 86,
"avg_line_length": 33.724137931034484,
"alnum_prop": 0.6273006134969326,
"repo_name": "adsabs/citation_helper_service",
"id": "b278d23db00c081e6543bdf818333daf2e0c4f07",
... |
import numpy as np
def _summarize_peaks(peaks):
"""
merge peaks position if closer than 10
"""
previous = peaks[0]
new_peaks = [previous]
for pos in peaks:
if pos > previous + 10:
new_peaks.add(pos)
previous = pos
return new_peaks
def find_mature(x, y, win=10)... | {
"content_hash": "7e731d9a41950744132b9fa0c9d62c57",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 58,
"avg_line_length": 22.178571428571427,
"alnum_prop": 0.5603864734299517,
"repo_name": "lpantano/seqcluster",
"id": "c22d20f8abedcb296c400a8d3950f4fa9fede511",
"size": "... |
from django.core.management.base import NoArgsCommand, CommandError
from atados_core.models import Nonprofit, Address, City
from optparse import make_option
import csv
import time
class Command(NoArgsCommand):
help = 'Update nonprofit volunteer count'
def handle_noargs(self, **options):
nonprofits = Nonprofit... | {
"content_hash": "5c49eeed753869cc1a0552447b1a3cd8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 28.733333333333334,
"alnum_prop": 0.7470997679814385,
"repo_name": "atados/api",
"id": "c7b87964a3087e5f0b70719f04f040f4a0510b81",
"size": "455",
"... |
from __future__ import unicode_literals
"""
bootstrap client session
"""
import frappe
import frappe.defaults
import frappe.desk.desk_page
from frappe.utils import get_gravatar, get_url
from frappe.desk.form.load import get_meta_bundle
from frappe.utils.change_log import get_versions
def get_bootinfo():
"""build and... | {
"content_hash": "704e89b093acbb293e0a18f96f4cf3c4",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 142,
"avg_line_length": 29.925465838509318,
"alnum_prop": 0.7027812370278124,
"repo_name": "mbauskar/omnitech-demo-frappe",
"id": "6a88bbc0915ae6cf8f3e6954002f2a721a75c55e",... |
import unittest
from image_to_data import *
class TestConstructor(unittest.TestCase):
def setUp(self):
self.td = {}
self.td[0] = {'source':'image_to_data_test/templates/a.jpg', 'output_data':'a'}
self.td[1] = {'source':'image_to_data_test/templates/d.jpg', 'output_data':'d'}
self.... | {
"content_hash": "023ebcfe765a09dad61ab059d29547e0",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 106,
"avg_line_length": 35.78365384615385,
"alnum_prop": 0.5640198844551928,
"repo_name": "kobejohn/BookwormUtility",
"id": "fdaf46c0dc94abef04c0f68c9ee11b03beb42f08",
"si... |
'''
Created on 2. okt. 2010
@author: Yngve
'''
"""Report Renego patched/unpatched based on Alexa ranking only sites with EV certificates"""
import sys,os,subprocess,time,os.path
sys.path.insert(1, os.path.join(".."))
import libinit
from optparse import OptionParser
import probedb.standalone
import probedb.probeda... | {
"content_hash": "b25b8779666d986b913f730a5943e754",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 206,
"avg_line_length": 40.82857142857143,
"alnum_prop": 0.7200839748075577,
"repo_name": "operasoftware/tlsprober",
"id": "897634e2fce87b3c60485c2c3b3c83652527f9e1",
"size... |
#
# sources.py
#
# Convert source code comments to multi-line blocks (library file).
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continui... | {
"content_hash": "d7084f125a7984f6d487279390addd1d",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 76,
"avg_line_length": 33.42439024390244,
"alnum_prop": 0.48839754816112085,
"repo_name": "yapingxin/saturn-gui-lib-workshop",
"id": "edce1a5f327c19c057843265b7e23f7868853b9... |
import json
import os
import shutil
import unittest
from tempfile import mkdtemp
from ..dicts import MissingValue
from ..smush import (config_sources, available_sources, smush_config,
LenientJSONEncoder)
class TestLenientJSONEncoder(unittest.TestCase):
"""Tests for LenientJSONEncoder.
... | {
"content_hash": "1d3c313c42ce471019e96ad21d9dbe0d",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 77,
"avg_line_length": 30.681647940074907,
"alnum_prop": 0.517333984375,
"repo_name": "yola/yoconfigurator",
"id": "2bb9028431a206a29ffdab60fd59e7944b94648b",
"size": "819... |
from __future__ import with_statement, print_function, absolute_import
from setuptools import setup, find_packages, Extension
from distutils.version import LooseVersion
import numpy as np
import os
from os.path import join
# TODO
pcl_ver = "1.8"
vtk_ver = "7.1"
min_cython_ver = '0.19.0'
try:
import Cython
v... | {
"content_hash": "0dbfc6399198ceb32d3cb49d7cb8269e",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 90,
"avg_line_length": 29.954954954954953,
"alnum_prop": 0.5696240601503759,
"repo_name": "r9y9/pypcl",
"id": "92fff32325d457c62a856732797de944312015b2",
"size": "3342",
... |
import os
import rpm
class ConfigurationManager(object):
"""
ConfigurationManager manage a set of configuration
"""
_hdrs = []
_confs = []
_refConf = None
_writeConf = None
@staticmethod
def loadConfigurations(readConfPaths, refConfPath, writeConfPath = None):
"""
... | {
"content_hash": "0353c0f03176504802b7d94862789b0c",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 144,
"avg_line_length": 32.7319587628866,
"alnum_prop": 0.5976377952755906,
"repo_name": "adriengentil/ConfMgr",
"id": "8473abcc21f7e7a58d59b5188144da7b4235da45",
"size": ... |
import time
def main ():
char1 = input ('First Character of Plate: ')
time.sleep(60)
char2 = input ('\nSecond Character of Plate: ')
time.sleep(60)
char3 = input ('\nThird Character of Plate: ')
time.sleep(60)
char4 = input ('\nFourth Character of Plate: ')
time.sleep(60)
char5 = in... | {
"content_hash": "cecc116c68881b2935f76f7420274b67",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 52,
"avg_line_length": 29.894736842105264,
"alnum_prop": 0.6161971830985915,
"repo_name": "hal00alex/SlothLookUp",
"id": "26c7105360bdbe45cb8258f16c3d3bc7a98e1e85",
"size":... |
import itertools
from oslo_log import log as logging
from webtest import TestApp
from designate.api import v2 as api_v2
from designate.api import middleware
from designate.tests.test_api import ApiTestCase
LOG = logging.getLogger(__name__)
INVALID_ID = [
'2fdadfb1-cf96-4259-ac6b-bb7b6d2ff98g',
'2fdadfb1cf... | {
"content_hash": "2443a2bb679e60ccd319adf02429521b",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 79,
"avg_line_length": 33.42028985507246,
"alnum_prop": 0.550520381613183,
"repo_name": "cneill/designate",
"id": "cdfa294bcec7367ffbd09687a2ca0fb3020576ad",
"size": "5267... |
import logging
from marshmallow import fields
from azure.ai.ml._schema.core.fields import ArmStr
from azure.ai.ml._schema.core.schema import PatchedSchemaMeta
from azure.ai.ml.constants._common import AzureMLResourceType
module_logger = logging.getLogger(__name__)
class JobOutputSchema(metaclass=PatchedSchemaMeta)... | {
"content_hash": "fab332b68786af8d02be80a199fc076e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 69,
"avg_line_length": 29.714285714285715,
"alnum_prop": 0.8004807692307693,
"repo_name": "Azure/azure-sdk-for-python",
"id": "806791197e961b0d14196f743bd16e4cc5a7d3a4",
"s... |
"""Pseudo terminal utilities."""
# Bugs: No signal handling. Doesn't set slave termios and window size.
# Only tested on Linux.
# See: W. Richard Stevens. 1992. Advanced Programming in the
# UNIX Environment. Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.
# 2016: Cornelius Diek... | {
"content_hash": "080012fc53d51f5d5cdc906c1f9c5653",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 138,
"avg_line_length": 31.23671497584541,
"alnum_prop": 0.5842870399010207,
"repo_name": "diekmann/tinyrsh",
"id": "0d601b70e2ba7f65535a92d06b9920de55198e78",
"size": "64... |
from datetime import timedelta
from unittest import TestCase
import pandas as pd
import pandas.testing
from fireant.dataset.modifiers import Rollup
from fireant.dataset.totals import scrub_totals_from_share_results
from fireant.tests.dataset.mocks import (
dimx0_metricx2_df,
dimx1_str_df,
dimx1_str_totals... | {
"content_hash": "3f8e03e4293fde18433e0a5cb4a3313c",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 116,
"avg_line_length": 37.38383838383838,
"alnum_prop": 0.6995406646852202,
"repo_name": "kayak/fireant",
"id": "27b3cafa47a0af8c8c15c0cdbc6ee850eb16a562",
"size": "3701",... |
import factory
from factory.django import DjangoModelFactory
from leaflets.models import Leaflet
class LeafletFactory(DjangoModelFactory):
class Meta:
model = Leaflet
title = factory.Sequence(lambda n: "Leaflet %d" % n)
| {
"content_hash": "ae92dd5dfab4f189e19a3a0c6b2c6ffa",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 56,
"avg_line_length": 21.818181818181817,
"alnum_prop": 0.7458333333333333,
"repo_name": "DemocracyClub/electionleaflets",
"id": "5725aad1601797f9b34120d7897cc30e42c5f94c",
... |
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium import webdriver
from billmonster import _element_available
from clint import args
from clint.textui import colored, puts
import keyring, sys
def capitalone(user=None, quit_when_finished=Tr... | {
"content_hash": "ac22b67bfd1480eaa8fe64f1ef42e801",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 103,
"avg_line_length": 29.67105263157895,
"alnum_prop": 0.6660753880266075,
"repo_name": "nicksergeant/billmonster",
"id": "ee113ef5f90f20fe8caf242017406ed14ce4f046",
"siz... |
import datetime
from django.test import TestCase
from django.utils import timezone
from schedule.models import Event, Rule, Calendar
from schedule.utils import EventListManager
class TestEventListManager(TestCase):
def setUp(self):
weekly = Rule.objects.create(frequency="WEEKLY")
daily = Rule.ob... | {
"content_hash": "3ddae84acd082d1685bf1e849c1756df",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 108,
"avg_line_length": 44.97959183673469,
"alnum_prop": 0.6447368421052632,
"repo_name": "nharsch/django-scheduler",
"id": "a2e5675bf72118f12c36daf1781721d27f0a4f8b",
"siz... |
from sqlalchemy import *
from migrate import *
from nova import log as logging
meta = MetaData()
LOG = logging.getLogger(__name__)
networks = Table('networks', meta,
Column("id", Integer(), primary_key=True, nullable=False))
# Add priority column to networks table
priority = Column('priority', Integer())
de... | {
"content_hash": "336491cc62098cd2fe7b555a034d9abf",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 21.066666666666666,
"alnum_prop": 0.6930379746835443,
"repo_name": "russellb/nova",
"id": "6d709e958f344ed41db4f66500baf06753123744",
"size": "1260",... |
"""
Setup file for pyddq.
This file was generated with PyScaffold 2.5.6, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import sys
import os
import glob
import subprocess
from setuptools import setup, Command
class Integrat... | {
"content_hash": "506a962266f604cf800943032c8e1c7d",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 84,
"avg_line_length": 31.193548387096776,
"alnum_prop": 0.5739400206825233,
"repo_name": "FRosner/drunken-data-quality",
"id": "315d76aabe54d5d4d426a65341c4e37f1d691552",
... |
from os.path import dirname
from ipkg.build import Formula, File
class e(Formula):
name = 'e'
version = '1.0'
sources = File(dirname(__file__) + '/../../sources/e-1.0.tar.gz')
platform = 'any'
dependencies = ('d',)
def install(self):
pass
| {
"content_hash": "53f8b7619b6b7d2365f4deca9215fde4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 69,
"avg_line_length": 17.3125,
"alnum_prop": 0.5740072202166066,
"repo_name": "pmuller/ipkg",
"id": "fd43720131a54ef9127b9098a96aff6fd582eccf",
"size": "277",
"binary": ... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('robocrm', '0045_machine_toolbox_id'),
]
operations = [
migrations.AlterField(
model_name='machine',
name='toolbox_id',
... | {
"content_hash": "78b403ab9bcae8b0fb067ff39525b497",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 96,
"avg_line_length": 24.42105263157895,
"alnum_prop": 0.6120689655172413,
"repo_name": "CMU-Robotics-Club/roboticsclub.org",
"id": "235d1474e6d49aef405c2fa1ac3ba3de048664b7... |
import web
import requests
import traceback
from datetime import datetime
from config import setting
from model import user
import urllib
from util import login
from util import oauth
import json
config = setting.config
render = setting.render
db = setting.db
def common_check(post=[],get=[],need_login=True):
""" ... | {
"content_hash": "630af8586d213e825a80a70327e245bb",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 111,
"avg_line_length": 29.54854368932039,
"alnum_prop": 0.5531460489567932,
"repo_name": "supersheep/huixiang",
"id": "e7f5386e4b4bc72a01e838d388f51d34670274a7",
"size": ... |
'''
Simple RPC
Copyright (c) 2013, Joaquin G. Duo
'''
from simplerpc.expose_api.base.QueueCommandBase import QueueCommandBase
class ImagesBrowser(QueueCommandBase):
'''
#TODO: document Class
'''
def getImagesList(self):
''' #TODO: document method'''
images = {}
for img_id in ran... | {
"content_hash": "5352904fa8f50a7d5735ec9b526b3109",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 93,
"avg_line_length": 32.22222222222222,
"alnum_prop": 0.6195402298850575,
"repo_name": "joaduo/python-simplerpc",
"id": "1a615178dfd752f2ac924ff26929f36557f60792",
"size"... |
from google.appengine.ext import ndb
from mcfw.properties import azzert
from mcfw.utils import Enum
from rogerthat.models import Image
from rogerthat.models.apps import EmbeddedApplication
from rogerthat.models.common import NdbModel
from rogerthat.rpc import users
class AssetTypes(Enum):
BANK = u'bank'
ACCO... | {
"content_hash": "61fb69e53dd94a9c32c1504e45703ae5",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 120,
"avg_line_length": 35.98299319727891,
"alnum_prop": 0.6864542962472824,
"repo_name": "our-city-app/oca-backend",
"id": "34fe7eddcab0ce11dad27f042546659f93e2edcc",
"si... |
from optparse import OptionParser
import json
import ipython_md
import potential_function
def parse_constants(constants):
constant_dictionary = {}
if constants is None: return constant_dictionary
for constant in constants:
(key,value) = constant.split(':')
constant_dictionary[key] = float(v... | {
"content_hash": "1a549ff7f81ba987a872537041bccdf9",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 190,
"avg_line_length": 48.839285714285715,
"alnum_prop": 0.6552102376599634,
"repo_name": "olcf/iPython-Molecular-Dynamics",
"id": "c3e263a2370f9a32f84bbf821c1549ccee78ecbe"... |
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
#from config import *
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
db.engine.pool._use_threadlocal = True
from app import views, models
def register_routes(app):
from .views import front, asset
app.register_bl... | {
"content_hash": "efe74dbd7c432ce4111f4adc34b18a46",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 119,
"avg_line_length": 29.566666666666666,
"alnum_prop": 0.7260428410372041,
"repo_name": "spark8103/dlop2",
"id": "3a08ce29d5a24326c80f35d2c9ff64470d2d7c3b",
"size": "887... |
import os
import unittest
from prudentia.domain import Box
from prudentia.vagrant import VagrantProvider, VagrantExt
from prudentia.simple import SimpleProvider
class TestVagrantProvider(unittest.TestCase):
def setUp(self):
self.tests_path = os.path.dirname(os.path.realpath(__file__))
self.provid... | {
"content_hash": "a6a43ba6a64b9b35656a39665100e9e7",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 114,
"avg_line_length": 37.111111111111114,
"alnum_prop": 0.6616766467065869,
"repo_name": "StarterSquad/prudentia",
"id": "115bd966114e117e8d429331f0ead8ad06deddb5",
"size... |
"""
Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.
Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it... | {
"content_hash": "470a83bea6e7dbba27e2944c5b36bc21",
"timestamp": "",
"source": "github",
"line_count": 4116,
"max_line_length": 109,
"avg_line_length": 34.629737609329446,
"alnum_prop": 0.5504995229275411,
"repo_name": "samuelhavron/heroku-buildpack-python",
"id": "f4400c90fd7345d3311f1663c704b0efbd... |
import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self, plotly_name="autocolorscale", parent_name="isosurface", **kwargs
):
super(AutocolorscaleValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "4a8b28cc0a12e938c3ddf9887a5c9184",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 35.357142857142854,
"alnum_prop": 0.6161616161616161,
"repo_name": "plotly/plotly.py",
"id": "686c15e377e8b181307973815d8ab24ea8989fc2",
"size": "495... |
__author__ = 'privat'
from PyQt4.QtGui import QTextCursor
class OutputWriter():
def __init__(self, text_edit):
self.text_edit = text_edit
self.text_edit.setPlainText('')
def write(self, text):
self.text_edit.moveCursor(QTextCursor.End)
self.text_edit.insertPlainText(text) | {
"content_hash": "299538644bedd473a64a1bed93af22da",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 50,
"avg_line_length": 22.642857142857142,
"alnum_prop": 0.6498422712933754,
"repo_name": "sem23/roslab_ide",
"id": "4ce920a441c6715d7b41316536a0a37965687310",
"size": "317... |
"""Tests for genomics.deepvariant.model_eval."""
import os
from unittest import mock
from absl import flags
from absl.testing import absltest
from absl.testing import flagsaver
from absl.testing import parameterized
import six
import tensorflow as tf
from tensorflow import estimator as tf_estimator
from deepvariant... | {
"content_hash": "4249200a17759c31bb0d752b0a67290d",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 80,
"avg_line_length": 36.71264367816092,
"alnum_prop": 0.6476205385097057,
"repo_name": "google/deepvariant",
"id": "3296d72e0c4fbf2d99ed6dba805130dd7a28d833",
"size": "7... |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Symbol(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.mapbox.layer"
_path_str = "layout.mapbox.layer.symbol"
_valid_props = {"icon", "ic... | {
"content_hash": "60ad50e1798a5abe4ad8115d4a69a7c1",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 89,
"avg_line_length": 32.25714285714286,
"alnum_prop": 0.537643932683791,
"repo_name": "plotly/plotly.py",
"id": "dc3ed43c4458c77116537d6e08d4f8ae2e5e74cf",
"size": "1016... |
"""
© 2014 LinkedIn Corp. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... | {
"content_hash": "9433b331fa03ffb4ae896542dafd9631",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 126,
"avg_line_length": 41.908212560386474,
"alnum_prop": 0.675043227665706,
"repo_name": "forever342/naarad",
"id": "41ef4c80636747f1aa391423d43bb09367bce135",
"size": "8... |
from fnmatch import fnmatch
from urlobject import URLObject
from django import template
from django.template import TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.utils.text import get_text_list
import ttag
from sorter.conf impor... | {
"content_hash": "4ad3c6fa6918e451fe8a2d49d45398a6",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 122,
"avg_line_length": 33.35981308411215,
"alnum_prop": 0.6069477517859644,
"repo_name": "caktus/django-sorter",
"id": "a3668b01ff8ae074258b4de181b59248740d8ccc",
"size":... |
import sys
if sys.version_info < (3, 7):
from ._show import ShowValidator
from ._pattern import PatternValidator
from ._fill import FillValidator
from ._count import CountValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
... | {
"content_hash": "161e038c26941ca45895b321c625c05f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 55,
"avg_line_length": 26.15,
"alnum_prop": 0.5697896749521989,
"repo_name": "plotly/python-api",
"id": "c75d5c08248422286705ae018312fc59d84bd4ca",
"size": "523",
"binary... |
"""PyTorch Inference Script
An example inference script that outputs top-k class ids for images in a folder into a csv.
Hacked together by / Copyright 2020 Ross Wightman (https://github.com/rwightman)
"""
import os
import time
import argparse
import logging
import numpy as np
import torch
from timm.models import cre... | {
"content_hash": "23d162a462d91c5c42f86448c3366ef2",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 137,
"avg_line_length": 41.36507936507937,
"alnum_prop": 0.6162701458173446,
"repo_name": "rwightman/pytorch-image-models",
"id": "5fcf1e60245703bb3d360ec7bc523bed06edfda4",... |
from .base import Strategy
class RarityStrategy(Strategy):
def check_rarity(self, length):
rarity = [{'rarity': 0, 'index': i, 'peers': []} for i in range(length)]
for peer in self.pieces:
for index, item in enumerate(rarity):
item['rarity'] += int(self.pieces[peer]['bitfield'][index])
... | {
"content_hash": "7fb85f96efad198f27590fa2f19a2b4e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 76,
"avg_line_length": 35.26470588235294,
"alnum_prop": 0.5988323603002502,
"repo_name": "vtemian/university_projects",
"id": "cf94c7dcb49b4914fb1335f24d7a2c82a6a31a88",
"s... |
from will.plugin import WillPlugin
from will.decorators import respond_to, periodic, hear, randomly, route, rendered_template, require_settings
import string
import requests
import random
WORD_GAME_TOPICS = [
"3-Letter Words", "4-Letter Words", "5-Letter Words", "A Baseball Player's Name",
"A bird", "A boy's n... | {
"content_hash": "b9a49f95dca68f32f466b604f36683ed",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 120,
"avg_line_length": 62.42920353982301,
"alnum_prop": 0.6659578992132681,
"repo_name": "woohgit/will",
"id": "4eedad805ac7c501a6bd00440ae307c80a970ec7",
"size": "14109"... |
import time
import typing
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import TimeoutException
from selenium.types import WaitExcTypes
POLL_FREQUENCY: float = 0.5 # How long to sleep in between calls to the method
IGNORED_EXCEPTIONS: typing.Tuple[typing.Type[Exception... | {
"content_hash": "7beb0a2dcbe21735d037f8a289a6d3e0",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 110,
"avg_line_length": 40.495049504950494,
"alnum_prop": 0.6073349633251833,
"repo_name": "valfirst/selenium",
"id": "12d9990aa7cdbf4b8bd9b95bbbb491dfe609f1d8",
"size": "... |
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import kinow_client
from kinow_client.rest import ApiException
from ... | {
"content_hash": "aea047fc43347bd43d26dd12d80e0162",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 100,
"avg_line_length": 21.75,
"alnum_prop": 0.7091954022988506,
"repo_name": "kinow-io/kinow-python-sdk",
"id": "3de50ea6681a962d9d2549c174b0ee76aa2c7e68",
"size": "887",
... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("plan", "0030_plan_priority")]
operations = [
migrations.RemoveField(model_name="plan", name="priority"),
migrations.AddField(
model_name="plan",
name="queue",
... | {
"content_hash": "0d20973cd3cc4d1a07fbede4398bb4b1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 27.391304347826086,
"alnum_prop": 0.4714285714285714,
"repo_name": "SalesforceFoundation/mrbelvedereci",
"id": "61a2a4fa85a5c0115dfd711b9aa119a5937c4e9... |
"""
The ScikitLearn folder includes different types of Scikitlearn GuassianProcess based ROMs
that are available via RAVEN
"""
| {
"content_hash": "7640f1addb0dbcb4ef344fc83b458d4a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 91,
"avg_line_length": 32.75,
"alnum_prop": 0.7862595419847328,
"repo_name": "joshua-cogliati-inl/raven",
"id": "7a03bb39b52fcf2ff46f3ee2698a6d91d96cb0e8",
"size": "720",
... |
'''
The MIT License (MIT)
https://github.com/robertchase/spindrift/blob/master/LICENSE.txt
'''
from importlib import import_module
import logging
import logging.config
import platform
import signal
from ergaleia.normalize_path import normalize_path
from spindrift.database.db import DB
from spindrift.micro_fsm.handler... | {
"content_hash": "2ba0eef3a916dec48e3869f15df3040a",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 79,
"avg_line_length": 30.723557692307693,
"alnum_prop": 0.5516000312964556,
"repo_name": "robertchase/spindrift",
"id": "4db328fdd3807f750d3deff8a3e2e5f3d829c366",
"size"... |
"""\
================================================
likefile - file-like interaction with components
================================================
likefile is a way to run Axon components with code that is not Axon-aware. It
does this by running the scheduler and all associated microprocesses in a
separate thread... | {
"content_hash": "0555934d255cbfa7555669c3f9879796",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 218,
"avg_line_length": 41.92946058091286,
"alnum_prop": 0.6158832261256804,
"repo_name": "bbc/kamaelia",
"id": "ea8844c1e00940b25bc9b65b0c6f1b198893978f",
"size": "21091"... |
"""Contains ligand-specific objects and functions."""
from collections import Counter
from . import gtop
from . import pdb
from .interactions import Interaction, get_interaction_by_id
from .exceptions import NoSuchLigandError
from .shared import DatabaseLink, strip_html
def get_ligand_by_id(ligand_id):
"""Returns... | {
"content_hash": "bc5763015bc506f798256910f88dcc49",
"timestamp": "",
"source": "github",
"line_count": 802,
"max_line_length": 106,
"avg_line_length": 29.602244389027433,
"alnum_prop": 0.6074301840697528,
"repo_name": "samirelanduk/pygtop",
"id": "e2d3f398bbfa12638f978cfeb0282527b0da0fd1",
"size":... |
from core.notify.plugins import base
import logging
class Plugin(base.Plugin):
subscribe = ['DELETE']
name = 'Cleanup Plugin'
description = 'Cleans the information after deleting an element'
author = 'Slavey Karadzhov <slaff@linux-bg.org>'
version = '0.1'
"""
@param int user
@para... | {
"content_hash": "42b2648297fc76026af3e185aba6ef54",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 68,
"avg_line_length": 29,
"alnum_prop": 0.6656671664167916,
"repo_name": "slaff/attachix",
"id": "72cbf0c29c434c5472c3f807a81288edf5ca902b",
"size": "667",
"binary": fal... |
from __future__ import absolute_import
import theano
import theano.tensor as T
import types
def softmax(x):
return T.nnet.softmax(x)
def time_distributed_softmax(x):
xshape = x.shape
X = x.reshape((xshape[0] * xshape[1], xshape[2]))
return T.nnet.softmax(X).reshape(xshape)
def softplus(x):
return... | {
"content_hash": "69a447def59afeeaec2c519937452040",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 20.38235294117647,
"alnum_prop": 0.6810966810966811,
"repo_name": "aleju/keras",
"id": "a7eb78438238a704c97af0b171f66fe9ca718ed3",
"size": "693",
"... |
from app import app
# The app will spawn twice because of the reloader set this to stop the behaviour
# ref. http://stackoverflow.com/questions/25504149/why-does-running-the-flask-dev-server-run-itself-twice
# app.run(port=5000, debug=True, host='0.0.0.0', use_reloader=False)
# start server and allow binding to loca... | {
"content_hash": "86d3c95be40578b2501bc5e5bbb181de",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 105,
"avg_line_length": 45.916666666666664,
"alnum_prop": 0.7477313974591652,
"repo_name": "Sotera/newman",
"id": "35e29c2c57a97b9137a80f6dddfc5047c7196258",
"size": "570",... |
import re
try:
# Python >=2.6
from functools import reduce
except ImportError:
# Python <2.6
pass
import sys
import operator
_re_trail = re.compile('\((?P<txn_body>[a-z_]*), (?P<filename>[a-z_\-./]*), (?P<lineno>[0-9]*), (?P<txn>0|1)\): (?P<ops>.*)')
_re_table_op = re.compile('\(([a-z]*), ([a-z]*)\)')
_sepera... | {
"content_hash": "698ad97032210369b1c9bbaa1c4f2cf0",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 125,
"avg_line_length": 26.536585365853657,
"alnum_prop": 0.6066176470588235,
"repo_name": "jmckaskill/subversion",
"id": "9717c6cee131ed3005bae728f1df87234ccb0ac9",
"size... |
"""
Extended Api implementation with an application-specific helpers
----------------------------------------------------------------
"""
from six import iteritems
from flask_restplus_patched import Api as BaseApi
from .namespace import Namespace
class Api(BaseApi):
"""
Having app-specific handlers here.
... | {
"content_hash": "dce775706a6ecff19e452dc8ffc3383c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 92,
"avg_line_length": 39.568627450980394,
"alnum_prop": 0.5490584737363726,
"repo_name": "millen1m/flask-restplus-server-example",
"id": "0eae20ce25e5b15a7e2832c41ae6b347143... |
class SeleneException(Exception):
pass
class TemplateLoaderException(SeleneException):
pass
class TopLevelLoaderException(TemplateLoaderException):
pass
class UINotFoundException(SeleneException):
pass
class UINestedCallException(SeleneException):
pass
| {
"content_hash": "2f519f5e60a057f099eb932439c1f104",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 55,
"avg_line_length": 15.61111111111111,
"alnum_prop": 0.7935943060498221,
"repo_name": "whiteclover/Medoly",
"id": "d409c0062bebb460d092b1af3f2b67aa24004d51",
"size": "87... |
import unittest
from katas.kyu_7.truncate_a_string import truncate_string
class TruncateStringTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(truncate_string('pippi', 3), 'pip...')
def test_equal_2(self):
self.assertEqual(truncate_string(
'Peter Piper picked... | {
"content_hash": "ae79b1d6f8b0ead08c32fcbaac04dccf",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.6110436893203883,
"repo_name": "the-zebulan/CodeWars",
"id": "f9c468afa360323808a76bf113452e245cd98a25",
"size": ... |
import copy
import testtools
from testtools.matchers import HasLength
from ironicclient.tests import utils
import ironicclient.v1.chassis
CHASSIS = {'id': 42,
'uuid': 'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
'extra': {},
'description': 'data-center-1-chassis'}
CHASSIS2 = {'id': 43,
... | {
"content_hash": "73474a5b2b1d5390e0a7ccf0a8b6aded",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 74,
"avg_line_length": 29.800884955752213,
"alnum_prop": 0.5232368225686711,
"repo_name": "CiscoUcs/UCS-python-ironicclinet",
"id": "75acb8beafd602323dfa820644c8cf894ce47825... |
import ConfigParser
import os
pkg_dir = os.path.dirname(__file__)
pkg_dir = os.path.join(pkg_dir, os.path.pardir)
pkg_dir = os.path.normpath(pkg_dir)
_default_config_path = os.path.join(pkg_dir, 'etc')
_inspector_default_config_name = 'inspector.conf'
_default_config = os.path.join(
_default_config_path,
_in... | {
"content_hash": "c9e2dbfde8512d41c05f2e9b6111205f",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 70,
"avg_line_length": 26.728813559322035,
"alnum_prop": 0.6176284083703234,
"repo_name": "savex/spectra",
"id": "695c993d7828ace01e3b8065dd98f20aacb2bf71",
"size": "3154"... |
"""
"""
import unittest
from oandapy.api.oanda_base import Core
class TestCore(unittest.TestCase):
"""Test case docstring."""
def setUp(self):
obj = Core(environment="practice", access_token="token")
self.assertIsNotNone(obj)
def tearDown(self):
pass
def test_name(self):
... | {
"content_hash": "c5d4e89557437e7290dc8079012dd7ac",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 64,
"avg_line_length": 15.857142857142858,
"alnum_prop": 0.6216216216216216,
"repo_name": "gustavooferreira/oandaApi",
"id": "11e644546e0cb6099d06d90eb34c855d93280a03",
"si... |
"""\
Dynamic inventory for Terraform - finds all `.tfstate` files below the working
directory and generates an inventory based on them.
"""
from __future__ import unicode_literals, print_function
import argparse
from collections import defaultdict
from functools import wraps
import json
import os
import re
import yaml
... | {
"content_hash": "73030450eff36399c92bcdd445e51a3f",
"timestamp": "",
"source": "github",
"line_count": 866,
"max_line_length": 132,
"avg_line_length": 32.90993071593533,
"alnum_prop": 0.5703157894736842,
"repo_name": "Capgemini/terraform.py",
"id": "b051d569edf83548a45fa3ac3b6c5cca4ddaa737",
"size... |
"""Majordomo Protocol Client API, Python version.
Implements the MDP/Worker spec at http:#rfc.zeromq.org/spec:7.
Author: Min RK <benjaminrk@gmail.com>
Based on Java example by Arkadiusz Orzechowski
"""
import logging
import zmq
import MDP
from zhelpers import dump
class MajorDomoClient(object):
"""Majordomo P... | {
"content_hash": "50612dee0bf4b1e3a30e4b661778e9bf",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 90,
"avg_line_length": 30.065217391304348,
"alnum_prop": 0.5683297180043384,
"repo_name": "krattai/noo-ebs",
"id": "6c43940d663c18e9c695cdcd386c2346eb69b5f4",
"size": "2766... |
import unittest
from p1solution.p1solution import P1Solution
class MyTestCase(unittest.TestCase):
EXPECTED_SUM = 233168
def setUp(self):
self.p1solution = P1Solution()
def test_naive(self):
self.assertEqual(self.p1solution.naive(), self.EXPECTED_SUM)
def test_optimize_using_mem(self... | {
"content_hash": "6f18192dbe2fc74c70d5374e1c28c6c2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 81,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.6887417218543046,
"repo_name": "yong-at-git/fun-math",
"id": "f366729311aa99ad485f02b9f01780ea44001089",
"size": ... |
"""
Allows describing functions, specifically enumerating arguments which
may be passed in a combination of registers and stack values.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import gdb
from capstone impor... | {
"content_hash": "bb9a6d8a5494fe1d3ab8821397bc7b1c",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 100,
"avg_line_length": 26.38118811881188,
"alnum_prop": 0.6055545130418465,
"repo_name": "disconnect3d/pwndbg",
"id": "a3a3603a05c50eca739902982475b1950b6cbbac",
"size": ... |
import os
import six
import json
from requests_oauthlib import OAuth1Session
consumer_key = 'XJCbpn5nHHDNW48NBMx0eg'
consumer_secret = 'gcxv78Aq6kBulp663LFgug'
class Figshare(object):
def __init__(self, consumer_key, consumer_secret, access_token,
access_token_secret):
"""
Connec... | {
"content_hash": "7db404c5c7e61117d95acd5f81421492",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 98,
"avg_line_length": 32.494464944649444,
"alnum_prop": 0.5405405405405406,
"repo_name": "rmcgibbo/figshare",
"id": "a11683145fb86928c6eb6310f9fa0915fdff7511",
"size": "8... |
import os
import sys
import windmill
from windmill.dep import json
import tempfile
if not sys.version.startswith('2.4'):
from urlparse import urlparse
else:
# python 2.4
from windmill.tools.urlparse_25 import urlparse
def get_save_url(suite_name, extension):
url = urlparse(windmill.settings['TEST... | {
"content_hash": "68df20b0d51a2975c47beaeb7186cfed",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 118,
"avg_line_length": 39.73737373737374,
"alnum_prop": 0.6514997458057956,
"repo_name": "windmill/windmill",
"id": "2f1ac3f1e187977708f12db16c5b3649bf1bc47a",
"size": "46... |
import os
import unittest
from tslib.readers import PiXmlReader
DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
class TestPiXmlReader(unittest.TestCase):
def test_parse_pi_xml_01(self):
"""Parse a file."""
source = os.path.join(DATA_DIR, "time_series.xml")
reader = PiXmlReade... | {
"content_hash": "44f6a4bf578e6d2675cb30901db984bb",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 61,
"avg_line_length": 33.68181818181818,
"alnum_prop": 0.5883940620782726,
"repo_name": "nens/tslib",
"id": "d82d73648eecdf614cc2a52e1476871c354a96be",
"size": "4446",
... |
from st2common.models.api.action import ActionAliasAPI
from st2tests.fixturesloader import FixturesLoader
from tests import FunctionalTest
FIXTURES_PACK = 'aliases'
TEST_MODELS = {
'aliases': ['alias1.yaml', 'alias2.yaml']
}
TEST_LOAD_MODELS = {
'aliases': ['alias3.yaml']
}
GENERIC_FIXTURES_PACK = 'generic... | {
"content_hash": "8bd05d96e8e659ad9a4b02a26dd59e34",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 100,
"avg_line_length": 40.92372881355932,
"alnum_prop": 0.6208324704907848,
"repo_name": "peak6/st2",
"id": "8f690a2ae517836f490a2589905f43580a8bd47f",
"size": "5609",
... |
import frappe
from frappe.tests.utils import FrappeTestCase
class TestSequence(FrappeTestCase):
def generate_sequence_name(self) -> str:
return self._testMethodName + "_" + frappe.generate_hash(length=5)
def test_set_next_val(self):
seq_name = self.generate_sequence_name()
frappe.db.create_sequence(seq_name,... | {
"content_hash": "9d1d08d586f1cbe35fc55ae4cd006f7f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 97,
"avg_line_length": 39.857142857142854,
"alnum_prop": 0.7414234511008705,
"repo_name": "StrellaGroup/frappe",
"id": "c6ea0bc8c083a1880fc634afbe7927a54a2fb67a",
"size": "... |
from twisted.internet.defer import inlineCallbacks, maybeDeferred, returnValue
from twisted.internet import reactor, defer
import uuid
import logging
import datetime
from pytz import utc
from telephus.cassandra.ttypes import InvalidRequestException, CfDef, ColumnDef, IndexExpression, IndexOperator
import copy
import ma... | {
"content_hash": "3b93600ab98260b169e490ea6f342926",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 238,
"avg_line_length": 40.45762711864407,
"alnum_prop": 0.609412093283061,
"repo_name": "amorton/Polydorus",
"id": "6f3d3087a138739b69b7fde8dbc24bcdeb1691d4",
"size": "71... |
'''
Created on 2014/03/21
@author: yamashiro-r
'''
import sys
from conv.combined import Combined
from conv.dummy import Dummy
class ConverterFactory(object):
"""
Create Log Converter Factory
Created on 2014/03/21
"""
"""
Initialize
"""
def __init__(self, logFormat = ""):
se... | {
"content_hash": "cb9c119236d049ca66473874fa681a5e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 94,
"avg_line_length": 22.07894736842105,
"alnum_prop": 0.6090584028605482,
"repo_name": "yamashiro0110/converter",
"id": "6946bc6a386de078e4dfef936de995e444746af3",
"size"... |
from Tkinter import *
import ttk
root = Tk()
def printt(msg):
print msg
ttk.Button(root, text="Hello World", command= lambda: printt('ping').grid())
root.mainloop()
| {
"content_hash": "129e8bacf94b01c7569dfcc1eb225283",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 19,
"alnum_prop": 0.6900584795321637,
"repo_name": "erickmusembi/Robot-Project",
"id": "4490d06ccc195e527b0ba88b9d28a12b45c1f7f0",
"size": "171",
"b... |
"""
Example generation for the scikit learn
Generate the rst files for the examples by iterating over the python
example files.
Files that generate images should start with 'plot'
"""
from time import time
import os
import shutil
import traceback
import glob
import sys
from StringIO import StringIO
import matplotli... | {
"content_hash": "2efe3c7681db0706beea69d759ee76d6",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 80,
"avg_line_length": 33.25609756097561,
"alnum_prop": 0.5499083241657499,
"repo_name": "rain1024/sklearn_tutorial",
"id": "40358af3aacfcedd93230a0eabf4b94e230d24af",
"si... |
"""Module for optimizers in Oryx."""
from oryx.experimental.optimizers.optix import adam
from oryx.experimental.optimizers.optix import gradient_descent
from oryx.experimental.optimizers.optix import noisy_sgd
from oryx.experimental.optimizers.optix import optimize
from oryx.experimental.optimizers.optix import rmsprop... | {
"content_hash": "f20c9ae9389a0357025f1866bdda44ac",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 63,
"avg_line_length": 53.142857142857146,
"alnum_prop": 0.8494623655913979,
"repo_name": "jax-ml/oryx",
"id": "d49d2ef4faabffa6d6b94687d8ac085a512b482c",
"size": "954",
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import json
import math
import re
import numpy as np
import six
import tensorflow as tf
class BertConfig(object):
"""Configuration for `BertModel`."""
def __init__(self,
... | {
"content_hash": "3e4c7047a954d511534f9fd0123d4987",
"timestamp": "",
"source": "github",
"line_count": 993,
"max_line_length": 93,
"avg_line_length": 38.37462235649547,
"alnum_prop": 0.6577704298535664,
"repo_name": "google/embedding-tests",
"id": "d4a436aa51e3911c1f68f0350f0aff2b2b01655f",
"size"... |
"""Tests for tensorflow.ops.random_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
class RandomNormalTes... | {
"content_hash": "938188733a94ffe99168e13b08522ac2",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 80,
"avg_line_length": 36.4390243902439,
"alnum_prop": 0.6018518518518519,
"repo_name": "pavlovml/tensorflow",
"id": "2ba4dac3a1a4defe1be93b83e4863299a485fc89",
"size": "8... |
"""Site sources."""
# Copyright (c) 2012-2022 Wibowo Arindrarto <contact@arindrarto.dev>
# SPDX-License-Identifier: BSD-3-Clause
from contextlib import suppress
from dataclasses import dataclass
from datetime import datetime as dt
from functools import cached_property
from pathlib import Path
from typing import cast, ... | {
"content_hash": "81cbb1af98d433a2b2aace85a3be1fa8",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 87,
"avg_line_length": 27.338709677419356,
"alnum_prop": 0.5596853490658801,
"repo_name": "bow/volt",
"id": "1bd8334ecde1e63bcbf9b1aa8280c2e57d5cbb67",
"size": "5085",
"... |
import logging
from typing import Optional
from django.db.models import Q
from django.http import HttpRequest, HttpResponse
from zerver.actions.message_send import (
check_send_private_message,
send_rate_limited_pm_notification_to_bot_owner,
)
from zerver.decorator import webhook_view
from zerver.lib.request ... | {
"content_hash": "7d0f9a153076389878f1e24bfc428a6a",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 100,
"avg_line_length": 38.77852348993289,
"alnum_prop": 0.6588785046728972,
"repo_name": "rht/zulip",
"id": "29eee9ff449aee4a3d296c4e609c024c69411970",
"size": "5814",
... |
import datetime
from django import forms
from django.db import models
class Author(models.Model):
name = models.CharField(max_length=100)
class Meta:
ordering = ('name',)
def __unicode__(self):
return self.name
class BetterAuthor(Author):
write_speed = models.IntegerField()
class Bo... | {
"content_hash": "82a85b3d5cae7b1ffe6ab27b48baad79",
"timestamp": "",
"source": "github",
"line_count": 1230,
"max_line_length": 370,
"avg_line_length": 40.99593495934959,
"alnum_prop": 0.643629152206247,
"repo_name": "alex/django-old",
"id": "1665f62416b0bb4d74830aed1ba95a83311702ac",
"size": "504... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.