text stringlengths 4 1.02M | meta dict |
|---|---|
"""Updates load balancer health check policy"""
from baseCmd import *
from baseResponse import *
class updateLBHealthCheckPolicyCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""ID of load balancer health check policy"""
"""Required"""
self.id = None
... | {
"content_hash": "42b658acf9da8e3ec7b525ca56ff7f0b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 113,
"avg_line_length": 37.36363636363637,
"alnum_prop": 0.6127331711273317,
"repo_name": "MissionCriticalCloud/marvin",
"id": "10c31a33c0f6588ffc322a05a357710ae51a9005",
"... |
from animalia import mollusca_v1
async def sample_method_lro_signatures():
# Create a client
client = mollusca_v1.SnippetsAsyncClient()
# Initialize request argument(s)
my_message = mollusca_v1.MessageWithNesting()
my_message.message.required_string = "required_string_value"
my_message.my_int... | {
"content_hash": "1bc1455a7006311caa1a6e06bf0297ae",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 64,
"avg_line_length": 26.193548387096776,
"alnum_prop": 0.6810344827586207,
"repo_name": "googleapis/gapic-generator-python",
"id": "cc387195b745612d5fd15ff06085535417c86975... |
from contextlib import contextmanager
from soap.common.base import (
DynamicMethods, Comparable, base_dispatcher, dict_merge
)
from soap.common.cache import (
invalidate_cache, cached, cached_property, Flyweight
)
from soap.common.formatting import underline, superscript, indent, code_gobble
from soap.common.p... | {
"content_hash": "583a462c56b32f1024c9c6bfa7bc4d97",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 26.77777777777778,
"alnum_prop": 0.7572614107883817,
"repo_name": "admk/soap",
"id": "e8adc9ad65bd41eeb55cddf606c72c1c7c7be9c7",
"size": "482",
"bi... |
"""
Created on Fri Aug 22 12:01:47 2014
@author: pierre
"""
import urls
import argparse
import urllib.request
import json
import textwrap
import random
max_repos = 3
max_page=33
WIDTH = 79
parser = argparse.ArgumentParser()
def main():
parser.add_argument('-l', '--language', help='Your random Programming Langu... | {
"content_hash": "d7ac6bac57da2fa912832701c6651b7f",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 99,
"avg_line_length": 28.234375,
"alnum_prop": 0.5882678472606531,
"repo_name": "bloodywing/rgithub",
"id": "f32caa4df031520e6f38a3c13e31b018b763e05d",
"size": "1831",
"... |
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 model 'Cohort'
db.create_table('cohort', (
('id', self.gf('django.db.models.fields.AutoField')(primary_... | {
"content_hash": "c2c90786127313a2f105f1d02148ce04",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 192,
"avg_line_length": 80.25078369905957,
"alnum_prop": 0.5519140625,
"repo_name": "chop-dbhi/varify-data-warehouse",
"id": "a1d384f030b17526bb090215dcfca87e3c63bdc8",
"s... |
import unittest
from app.trainer.processing import Processing
from app.trainer.pt_br_mapper import UNICODE_ACCENTED_LETTERS
class TestProcessing(unittest.TestCase):
def test_lower_case(self):
tweet = Processing("Processing CAN Be LoWer Case TweeT").lower_case()
self.assertEqual(tweet, "processing... | {
"content_hash": "9f6f13015ff9915959cb1a2fd4ef2169",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 34.30434782608695,
"alnum_prop": 0.6856780735107731,
"repo_name": "fernandopso/mining-svm-tfidf",
"id": "cfcdc2697f160c22ef52b645e5999def50909908",
"... |
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
# TODO Tiger and later: need to set kWindowApplicationScaledAttribute for DPI
# independence?
from ctypes import *
import string
import math
from sys import byteorder
from pyglet.font import base
import pyglet.image
from pyglet.window.carbon import c... | {
"content_hash": "f20645ecec8aa1873b269b63e382e58e",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 80,
"avg_line_length": 33.03235294117647,
"alnum_prop": 0.6247885317424985,
"repo_name": "gnulinooks/sympy",
"id": "27f27c2d57fb70169dd7e43bd300fd84cca2ff3b",
"size": "129... |
"""
Low-level LAPACK functions (:mod:`scipy.linalg.lapack`)
=======================================================
This module contains low-level functions from the LAPACK library.
The `*gegv` family of routines have been removed from LAPACK 3.6.0
and have been deprecated in SciPy 0.17.0. They will be removed in
a f... | {
"content_hash": "906e02e3d471244f6d953132d0c6324a",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 79,
"avg_line_length": 15.73394495412844,
"alnum_prop": 0.642332361516035,
"repo_name": "josephcslater/scipy",
"id": "b4e422e473f3dffc30043056f009024a94191f89",
"size": "8... |
__all__ = [
'IdentityDecoder',
'ChunkedDecoder',
'DeflateDecoder',
'CompoundDecoder',
]
from kitsu.http.errors import *
from kitsu.http.headers import *
from kitsu.http.parsers import *
class IdentityDecoder(Parser):
def __init__(self, length=None):
self.length = length
def parseR... | {
"content_hash": "01558817105b0fad9f774f8b23976603",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 97,
"avg_line_length": 32.566502463054185,
"alnum_prop": 0.5315383451822719,
"repo_name": "snaury/kitsu.http",
"id": "52c368590af29547715109f7818d83ee179123f8",
"size": "6... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import six
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys, os, re
import traceback, platform
from PyQ... | {
"content_hash": "c56673e44dae0f5caddc3144820eb030",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 123,
"avg_line_length": 31.96904024767802,
"alnum_prop": 0.5568467944993221,
"repo_name": "dabura667/electrum",
"id": "4fb7e0150387c84b588529449eb81bc390d4064d",
"size": "... |
from flask import Flask, render_template, redirect, abort, Response, request
import os
from aura.core import ApplicationDescriptionParser, ApplicationDeployment
import json
from sys import argv
import uuid
from threading import Thread
import logging
from copy import deepcopy
app = Flask("aura")
class AURAContext:
... | {
"content_hash": "8b3aa3735e5335ab597a0a7a2a014a8b",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 193,
"avg_line_length": 32.40714285714286,
"alnum_prop": 0.6473440599515098,
"repo_name": "giagiannis/aura",
"id": "69ae7ae1b170e80083a397208e02fd2b9f023a02",
"size": "455... |
"""Unit tests for instrumentation_test_instance."""
# pylint: disable=protected-access
import collections
import tempfile
import unittest
from pylib.base import base_test_result
from pylib.instrumentation import instrumentation_test_instance
import mock # pylint: disable=import-error
_INSTRUMENTATION_TEST_INSTANC... | {
"content_hash": "9351a665c6aca6c6653545aafa0c296c",
"timestamp": "",
"source": "github",
"line_count": 1182,
"max_line_length": 79,
"avg_line_length": 29.75296108291032,
"alnum_prop": 0.48555505004549593,
"repo_name": "youtube/cobalt_sandbox",
"id": "77918bb3ea5abb5ae74b1b46c25200c774caab67",
"siz... |
import time
import urllib2
from fabric.api import env, run, sudo
from fabric.context_managers import cd, settings as fabric_settings
from fabric.contrib.files import append, contains, sed, uncomment
from fabric.operations import reboot
from fabric.utils import abort
import settings
DISTRO = "ARCH_201208"
SALT_INSTA... | {
"content_hash": "3c5943d2587fd7e6c2e0f044c03fd22f",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 120,
"avg_line_length": 38.16393442622951,
"alnum_prop": 0.6417525773195877,
"repo_name": "rizumu/bootmachine",
"id": "1db53ef9ddbe7dbb3d4aba7dc465b6c2e5c3b3d2",
"size": "... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def PerformanceStatisticsDescription(vim, *args, **kwargs):
'''Data object to capture all ... | {
"content_hash": "8cb6b878f4a33fc941d851156ccb5c6a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 124,
"avg_line_length": 33,
"alnum_prop": 0.6098484848484849,
"repo_name": "xuru/pyvisdk",
"id": "41593bfe27aae9120ccb02e1cf31c4f15c7f586f",
"size": "1057",
"binary": fal... |
"""Classes and constants used to properly handle EXPANDABLES (one property that becomes many, as with 'opacity')
and SHORTHANDS (multiple properties that can be combined into a single one)"""
import skidmarkoutputs
#
# The Objects
#
class ShorthandHandler(object):
"""This object contains classmethods t... | {
"content_hash": "22c485693eaac49d2515a5070ac3cbad",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 118,
"avg_line_length": 30.77591036414566,
"alnum_prop": 0.618640211158642,
"repo_name": "socialwireinc/skidmarkcss",
"id": "f11edd5c57cd2f2d3a341ee8f03a59b9a6c8bb5b",
"si... |
"""Controller module for attenuators.
Sample Config:
"Attenuator": [
{
"address": "192.168.1.12",
"port": 23,
"model": "minicircuits",
"paths": ["AP1-2G", "AP1-5G", "AP2-2G", "AP2-5G"]
},
{
"address": "192.168.1.14",
"port": 23,
"model": "minicircuits... | {
"content_hash": "700d3b04c7394267fef000d4ac4a95f0",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 80,
"avg_line_length": 32.992753623188406,
"alnum_prop": 0.6512189764990116,
"repo_name": "l-meng/mobly",
"id": "02392e4eb6c46586fca1f456fd6a203a53e8c93b",
"size": "5131",... |
import numpy as np
import os
import scipy
VIS_DIR = "vis"
class Visualizer:
def __init__(self):
self.active = False
def begin(self, dest, max_entries):
self.lines = []
self.active = True
self.max_entries = max_entries
self.next_entry = 0
self.dest_dir = os.pat... | {
"content_hash": "a869f9bd51665653482fda4dd1d7e387",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 105,
"avg_line_length": 32.4,
"alnum_prop": 0.5118312757201646,
"repo_name": "jacobandreas/nmn2",
"id": "156946b470a7a457642d3b02e6f6bc4fecddde64",
"size": "1968",
"binar... |
"""
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
... | {
"content_hash": "d1d9a17caade4890683cdfc39912dfd5",
"timestamp": "",
"source": "github",
"line_count": 764,
"max_line_length": 175,
"avg_line_length": 37.8848167539267,
"alnum_prop": 0.5107103372028745,
"repo_name": "stopstalk/stopstalk-deployment",
"id": "aee67c957c89b9a23d347f9a50150c6bf22a3e52",
... |
from django.db import transaction
from django.core.management.base import BaseCommand
from onadata.apps.fieldsight.models import Site
from onadata.apps.fsforms.models import FieldSightXF, FInstance
from onadata.apps.viewer.models.parsed_instance import update_mongo_instance
class Command(BaseCommand):
help = 'De... | {
"content_hash": "495595be42a521f3ae8b81f6ae1a124a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 138,
"avg_line_length": 48.3,
"alnum_prop": 0.598343685300207,
"repo_name": "awemulya/fieldsight-kobocat",
"id": "be3317dc268c07716cecd424d6270f5700a79add",
"size": "1449",... |
import sys
sys.path.append('lib')
from ikalog.utils.ikamatcher2.reference import Numpy_uint8, Numpy_uint8_fast
from ikalog.utils.ikamatcher2.arm_neon import NEON
from lib.ikamatcher2_kernel_hal import HAL
import numpy as np
import time
def generate_img():
img1 = np.random.randint(2, size=(1024, 1024))
img2 = ... | {
"content_hash": "8da723bdf3925c341d28d8a62ca89bbf",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 106,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.6645021645021645,
"repo_name": "hasegaw/IkaLog",
"id": "4216fa23e8881f26ac882165c5e58fa5e111dba2",
"size": "924"... |
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.test.client import Client
from ..highlight import PLAIN_CODE
from ..models import Snippet
class SnippetAPITestCase(TestCase):
def setUp(self):
self.api_url = reverse('dpaste_api_create_snippet')
self.client... | {
"content_hash": "02434e48f98fd61c2e9787023db96c33",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 86,
"avg_line_length": 37.01673640167364,
"alnum_prop": 0.6070984514524698,
"repo_name": "SanketDG/dpaste",
"id": "f47ffa974408794927fd4953c1e3c231741e18dd",
"size": "8890... |
import logging
import string
import pickle
from urllib.parse import urlparse
import time
import redis
import requests
from bs4 import BeautifulSoup
from .. import config
from .. import _json
from ..services.graphite import post_metric
logger = logging.getLogger(__name__)
db = redis.from_url(config.config['REDIS_UR... | {
"content_hash": "8ec9b3f1003cc8423f9ed8d1ac2d5bef",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 93,
"avg_line_length": 33.7891156462585,
"alnum_prop": 0.5739883229313469,
"repo_name": "benjolitz/powerscout",
"id": "bcc14d74a6777018e8b44e46175633bf8e119700",
"size": "... |
import sys
def printf(*s) :
'print + sys.stdout.flush()'
for e in s[:-1] :
print e,
print s[-1]
sys.stdout.flush()
def enterConfirm_prompt(enterMsg) :
stopi = False
while not stopi :
print "====\n At any time you can quit by entering 'quit'\n===="
vali = raw_input(enterMsg)
if vali.lower() == 'quit' :
... | {
"content_hash": "683ded047d57a744ab0ee78623a43bf0",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 74,
"avg_line_length": 21.62857142857143,
"alnum_prop": 0.582562747688243,
"repo_name": "logan169/pyGeno",
"id": "b3d940e04bc01ff7abd91c443edef77a6e17b696",
"size": "757",
... |
"""
Celery tasks used by the World Vision Sri Lanka Nutrition project
Two tasks are executed daily:
* sync_org_units: Synchronize DHIS2 Organization Units with local data
* sync_child_entities: Create new child cases in CommCare for nutrition
tracking, and associate CommCare child cases with DHIS2 child enti... | {
"content_hash": "ba6d4e6202003f1e78576729809b883d",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 115,
"avg_line_length": 42.20723684210526,
"alnum_prop": 0.6487413295923934,
"repo_name": "puttarajubr/commcare-hq",
"id": "dc5b974aeb4e9c64e68f6083ed94d8435e4f3e5d",
"siz... |
"""Setup script for IPython.
Under Posix environments it works like a typical setup.py script.
Under Windows, the command sdist is not supported, since IPython
requires utilities which are not available under Windows."""
#-----------------------------------------------------------------------------
# Copyright (c) 2... | {
"content_hash": "386bba6b1b2d7d01617bbac6f667bdf5",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 96,
"avg_line_length": 36.89965397923876,
"alnum_prop": 0.530570142535634,
"repo_name": "sodafree/backend",
"id": "e061f2353d86bdc1287309d1ff9d44cbcd093a43",
"size": "1071... |
from sys import argv, stderr, exit
from PIL import Image, ImageTk
import Tkinter
import json
import os
import math
import sys
APP = {} # contains global information needed by tkinter functions
REAL_POINTS = []
GUESS_POINTS = []
NEIGHBORS = []
NUM_NEIGHBORS = 4
INDEX = 0
class Point(object):
""" Point Object """... | {
"content_hash": "ff7ccb3841474a3578f1bf8db59eda6c",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 86,
"avg_line_length": 29.333333333333332,
"alnum_prop": 0.5788770053475936,
"repo_name": "TeamSirius/Utilities",
"id": "a16a463c42756c3226e250082ca7475366aebe9b",
"size":... |
"""
Copyright 2016 Load Impact
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, software
di... | {
"content_hash": "755f5e6ef562f7c0f0db5fed1620a13d",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 136,
"avg_line_length": 42.125786163522015,
"alnum_prop": 0.6624365482233503,
"repo_name": "loadimpact/loadimpact-cli",
"id": "76992dc58a1add0b774df43902f797b58331a074",
"... |
import getpass, sys
from imapclient import IMAPClient
try:
hostname, username = sys.argv[1:]
except ValueError:
print('usage: %s hostname username' % sys.argv[0])
sys.exit(2)
c = IMAPClient(hostname, ssl=True)
try:
c.login(username, getpass.getpass())
except c.Error as e:
print('Could not log in:'... | {
"content_hash": "4ddf9ba97cadb37735414ac4b7fcb133",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 57,
"avg_line_length": 24.8,
"alnum_prop": 0.6391129032258065,
"repo_name": "jac2130/BayesGame",
"id": "371ea17e29f26d0cfdcc03d134fbb602d9353df8",
"size": "670",
"binary"... |
import csv
from sys import argv
import networkx as nx
import numpy as np
from numpy import ones, concatenate
from math import ceil, sqrt
import matplotlib.pyplot as plt
def weightFunction(mdx, fdx, similarity_measure, l):
return (1.0 + similarity_measure) * abs(mdx - fdx) * (1.0 + l) ** (abs(mdx - fdx))
def weigh... | {
"content_hash": "d7368263739ebc8a867f2d0dc008a5ac",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 97,
"avg_line_length": 33.63709677419355,
"alnum_prop": 0.6499640374011029,
"repo_name": "chrisfilo/poSSum",
"id": "510ebfbc47d9848665966a5a781090fce5517a5e",
"size": "419... |
import datetime
import random
from random import randint
for i in range(1,50):
somedate=datetime.date(randint(1945,2015),randint(1,12),randint(1,28))
date=somedate+datetime.timedelta(random.randint(1,365))
print date
| {
"content_hash": "a54387f3c69b007c623058fe46a08ec4",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 74,
"avg_line_length": 32.714285714285715,
"alnum_prop": 0.7554585152838428,
"repo_name": "kfaraaz/tests",
"id": "1e368e04a641a5a9b46d2efe044fe5b58010afbb",
"size": "262",
... |
import torch
import torch.nn as nn
import os
from foolbox.models import PyTorchModel
from foolbox.utils import accuracy, samples
def create() -> PyTorchModel:
model = nn.Sequential(
nn.Conv2d(1, 32, 3),
nn.ReLU(),
nn.Conv2d(32, 64, 3),
nn.ReLU(),
nn.MaxPool2d(2),
nn... | {
"content_hash": "8b8847ddda96028490ff555f0ac5bc17",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 85,
"avg_line_length": 28.294117647058822,
"alnum_prop": 0.6101871101871101,
"repo_name": "bethgelab/foolbox",
"id": "59f6cfa1a0fb620e47e8fc4eb5308b8628b0a4a1",
"size": "98... |
print('\nLambda is an assigned or anonymous function in Python')
print('Assigned example name = lambda arg1, arg2, argN : return expression')
multiply = lambda a, b : a * b
print(multiply(2, 10))
def amplifyWrapper(koeff):
return lambda a : a * koeff
amplifyX10 = amplifyWrapper(10)
print(amplifyX10(2))... | {
"content_hash": "5c335b57faf776f16e85447103a986c5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 76,
"avg_line_length": 27,
"alnum_prop": 0.6975308641975309,
"repo_name": "alkryukov/sandbox",
"id": "17ed62858a371d0f9a519e7943cf77fc6b8d0b18",
"size": "324",
"binary": ... |
"""A stateless agent interface."""
import collections
import functools
from typing import Any, Callable, Optional, Tuple
import dm_env
import haiku as hk
from examples.impala import util
import jax
import jax.numpy as jnp
import numpy as np
AgentOutput = collections.namedtuple("AgentOutput",
... | {
"content_hash": "3093bd20acc52115b1550f7b424ddb5c",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 80,
"avg_line_length": 38.136842105263156,
"alnum_prop": 0.6627104609439691,
"repo_name": "deepmind/dm-haiku",
"id": "4be208e5baa32e0877acc23608a4407f16e057f0",
"size": "43... |
import numpy as np
from scipy.signal import argrelmax, detrend
from scipy.integrate import trapz
from scipy.ndimage.filters import gaussian_filter
import peakutils
def get_hyper_peaks(hyper_image, threshold):
"""
Given a Hyperspectral image, computes the average spectrum and finds the
peaks of that spect... | {
"content_hash": "cd4bbf0df71b7340a22ddb8437e40e5c",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 82,
"avg_line_length": 33.543103448275865,
"alnum_prop": 0.6633256232331021,
"repo_name": "kongjy/hyperAFM",
"id": "449957ef8b4789ec36552328db89c51db157fdaf",
"size": "389... |
def main(request, response):
response.headers.set(b"Content-Type", b"text/plain")
response.status = 200
response.content = request.headers.get(b"Content-Type")
response.close_connection = True
| {
"content_hash": "7d0da4929743495ecefbb9afa4b0ee25",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 59,
"avg_line_length": 41.8,
"alnum_prop": 0.7177033492822966,
"repo_name": "scheib/chromium",
"id": "53e1de5b32ded36383c7f1447fbd3126a911c682",
"size": "209",
"binary": f... |
import unittest
from tree_building import Record, BuildTree
class TreeBuildingTest(unittest.TestCase):
"""
Record(record_id, parent_id): records given to be processed
Node(node_id): Node in tree
BuildTree(records): records as argument and returns tree
BuildTree should raise ValueE... | {
"content_hash": "57993a9035e68ae81fee001b0fb1ec19",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 104,
"avg_line_length": 34.26701570680628,
"alnum_prop": 0.5656226126814362,
"repo_name": "exercism/python",
"id": "426ed2b95b37668abebfbaf93e7782a93903e286",
"size": "654... |
from south.v2 import DataMigration
from django.core.management import call_command
class Migration(DataMigration):
def forwards(self, orm):
call_command("loaddata", "account_types.yaml")
def backwards(self, orm):
orm.AccountType.objects.all().delete()
models = {
'webinars.account... | {
"content_hash": "6ffdb39431be8d0873bd0356c856870f",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 157,
"avg_line_length": 77.62359550561797,
"alnum_prop": 0.5442570746182239,
"repo_name": "prior/webinars",
"id": "3ac8d1d8b43bb9ce5276c87bb681bd04cb196c44",
"size": "1383... |
import unittest
import os
from fontTools import afmLib
CWD = os.path.abspath(os.path.dirname(__file__))
DATADIR = os.path.join(CWD, 'data')
AFM = os.path.join(DATADIR, 'TestAFM.afm')
class AFMTest(unittest.TestCase):
def test_read_afm(self):
afm = afmLib.AFM(AFM)
self.assertEqual(sorted(afm.kernpairs()),
... | {
"content_hash": "ad841e215a767fcfb4127c87407015ad",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 99,
"avg_line_length": 28.867924528301888,
"alnum_prop": 0.6509803921568628,
"repo_name": "fonttools/fonttools",
"id": "3e9d9d8819c482b2bdd5f7964e2b43abe1d27824",
"size": "... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.contrib import admin
from apps.core import models
class LayerTagInline(admin.TabularInline):
extra = 0
model = models.LayerTag
class LayerImageInline(admin.TabularInline):
extra = ... | {
"content_hash": "be625720e04442997836fc17d6f8f8c3",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 72,
"avg_line_length": 24.25531914893617,
"alnum_prop": 0.5736842105263158,
"repo_name": "KAPPS-/raster-foundry",
"id": "2f0af50e9d95df837d4f2a3a314694c31eac319f",
"size": ... |
"""
Logging functionality.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011-2012)
"""
import time
from zope.interface import implementer
from twisted.python import log
# almost iso, we dump the T in the middle (makes it more tricky to read imho)
TIME_FORMAT = "%Y-%m-%d %H:%M:%SZ"
@imple... | {
"content_hash": "b0cd8929bfcbbf53e88498674d7cfc13",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 89,
"avg_line_length": 30.29787234042553,
"alnum_prop": 0.6706460674157303,
"repo_name": "NORDUnet/opennsa",
"id": "bfd21fc272bc1c1596249c9d1156a826f889a1a4",
"size": "1424... |
import os
import Configuracoes
from Jogador import Jogador
import Dado
import Tabuleiro
import Acao
def turno(jogador):
os.system("clear")
jogador.mostra_resumo()
dados = [] # Array que contem os valores dos dados
soma_dos_dados = 0
jogador.jogadas -= 1 # Decrementa a quantidade de jogadas
if... | {
"content_hash": "39c6ebee7f1178c9cfa7c971f4d3ba77",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 116,
"avg_line_length": 37.706896551724135,
"alnum_prop": 0.6611796982167353,
"repo_name": "fcrozetta/Text-Based-Monopoly",
"id": "775b86b7b6625fa06201c1840c3c00c7d55354c6",
... |
from fabricate import *
programs = ['test_strided_comm', 'testcount']
def build():
for program in programs:
sources = [program, '../src/clustergis']
compile(sources)
link(sources, program)
def compile(sources):
for source in sources:
run('mpicc -Wall -O3 -I../src/ `geos-config --cflags` -c ' + source + '.c... | {
"content_hash": "e10b8f6f40a00c422ae9d6363429d52e",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 114,
"avg_line_length": 26.227272727272727,
"alnum_prop": 0.6291161178509532,
"repo_name": "nathankerr/clusterGIS",
"id": "59bd85aaeb06e73965d37659457b9598e8c63c73",
"size"... |
from setuptools import setup
setup(
name='pynanowit',
packages=['pynanowit'],
include_package_data=True,
install_requires=['flask', 'waitress'],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)
| {
"content_hash": "9497e963de83105996faf480c4738930",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 43,
"avg_line_length": 23.2,
"alnum_prop": 0.6594827586206896,
"repo_name": "vorjdux/pynanowit",
"id": "81b0f7f19c0d667330496797414df3d8d6ec9394",
"size": "232",
"binary"... |
"""
Various classes for tracking attribute values. Work in progress.
$Id$
"""
__version__='$Revision: 8706 $'
# Note that the tracking classes don't depend on Topographica, but the
# tests do.
import param
def value_printer(**kw):
obj_name = kw['obj'].name if hasattr(kw['obj'],'name') else str(kw['obj'])
... | {
"content_hash": "4f51b8a0f2882b4485411618263e5b62",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 100,
"avg_line_length": 31.056818181818183,
"alnum_prop": 0.5810464690815953,
"repo_name": "ioam/svn-history",
"id": "4cacc23112f01997be4b8d48de5954f46b222f78",
"size": "5... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label = '%s.%s' % (User._meta... | {
"content_hash": "aba7c9f2407ec2cca6be2d34f9ab26da",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 187,
"avg_line_length": 72.89915966386555,
"alnum_prop": 0.5586167146974064,
"repo_name": "google-code-export/evennia",
"id": "674545fc1b01d1a3625320eb3cc1c80a20518c98",
"... |
"""Module for CLI output styling.
This module sets the style of the CLI output
"""
class CLIStyle(object):
"""Class for styling CLI output
This class defines some constants for styling the output of CLI-Scripts
To use this class, simply use the constants in your print() functions.
e.g.: print(CLIStyl... | {
"content_hash": "76bb411a1650896ea8e1f88e240e06ea",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 27.444444444444443,
"alnum_prop": 0.6531713900134952,
"repo_name": "NETHINKS/opennms-docker-env",
"id": "17c556b2093153db25cd93e8ffebeab8773dfaba",
"... |
from rpc.whisperrpc import *
from rpc.factory import *
from rpc.standard_library import *
if __name__ == '__main__':
params = {
'remote_host' : '127.0.0.1',
'remote_port' : 8881,
'admin_pass' : 'test',
}
rpc_conn = RpcConnection(
params.get('remote_host'), port = params.... | {
"content_hash": "51bb63d2adf126f88ef02fc9878c2316",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 75,
"avg_line_length": 40.80434782608695,
"alnum_prop": 0.546972118629018,
"repo_name": "cpopescu/whispercast",
"id": "8840bad9651f51fff972b1ff8129f64b591857d0",
"size": "... |
"""
.. module:: runtests
.. moduleauthor:: Artem Mustafa <artemmus@yahoo.com>
"""
import unittest
import logging
def load_tests(loader, tests, pattern):
return unittest.defaultTestLoader.discover('tests', pattern='test_*.py')
if __name__ == '__main__':
log = logging.getLogger('mysql_executor')
log.setL... | {
"content_hash": "ec7707f5714113bbac355a6c82538e98",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 76,
"avg_line_length": 20,
"alnum_prop": 0.6805555555555556,
"repo_name": "artemmus/mysql_executor",
"id": "b624952a51891c1dae4a407ecc1a305fb4994c11",
"size": "382",
"bin... |
from functools import partial
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QLabel, QVBoxLayout
from electrum_ltc.i18n import _
from electrum_ltc.plugin import hook
from electrum_ltc.wallet import Standard_Wallet
from electrum_ltc.gui.qt.util import WindowModalDialog
from .jade import JadePlugin
fr... | {
"content_hash": "8ac4eb1acbfc855479897e05b1e1f1c3",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 91,
"avg_line_length": 32.659574468085104,
"alnum_prop": 0.6768729641693811,
"repo_name": "pooler/electrum-ltc",
"id": "4b90ff80a624c8b2d3b1d977236ce86dda10c6b9",
"size": "... |
"""Ensure user-defined pretraining & rl configs inherit from base configs."""
from ml_collections import ConfigDict
from .pretrain import get_config as get_pretrain_config
from .rl import get_config as get_rl_config
# Ref: https://github.com/deepmind/jaxline/blob/master/jaxline/base_config.py
def __validate_keys( ... | {
"content_hash": "001e631cddb9c6916d7242603effc23d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 34.717948717948715,
"alnum_prop": 0.6831610044313147,
"repo_name": "google-research/google-research",
"id": "0e862666b944bdc57bcba1bf16c1a0a47c6eae1d",... |
import _plotly_utils.basevalidators
class LegendwidthValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="legendwidth", parent_name="indicator", **kwargs):
super(LegendwidthValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | {
"content_hash": "847b2ca2107f00c8f18c21422cc317fd",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 85,
"avg_line_length": 37.5,
"alnum_prop": 0.6177777777777778,
"repo_name": "plotly/plotly.py",
"id": "8ba5cf55975da0c91cd1cb8be49d8af84667b3b2",
"size": "450",
"binary":... |
__author__ = 'guorongxu'
import re
import os
import sys
import logging
import MatrixPrinter
## Parsing mutation files and return a dictionary of ID and name.
def parse(root_raw_dir, root_expression_dir, tumor_type, release_year, release_month, release_day):
mutation_file_folder = root_raw_dir + "/" + tumor_type +... | {
"content_hash": "125f53477fce4f2110ef6e58c8d0556f",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 105,
"avg_line_length": 39.25443786982248,
"alnum_prop": 0.6097377148025324,
"repo_name": "ucsd-ccbb/Oncolist",
"id": "fdef135e9cc469dc63b3935f3d34ce3a6d4da508",
"size": "... |
import os
import signal
def handle_sigterm(signum, frame):
# do stuff
os._exit(0)
# subprocess
signal.signal(signal.SGITERM, handle_sigterm)
# where to kill subprocess
os.kill(pid, signal.SIGTERM)
| {
"content_hash": "8052a222b1b4e87aa30a3e27b8df908f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 45,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.7307692307692307,
"repo_name": "louistin/fullstack",
"id": "e5867e9f472a7bc07ab26311ef4029267df5d31a",
"size": "2... |
import os
import sys
import math
import numpy as np
from PyQt4 import QtCore
from PyQt4.QtGui import *
from PyQt4.QtCore import Qt, QSize, pyqtSignal
from Orange.canvas.utils import environ
from Orange.widgets import gui
from Orange.widgets.utils import colorbrewer
DefaultRGBColors = [
(0, 0, 255), (255, 0, 0), ... | {
"content_hash": "1c289858d6c2c622f75f330bd0ea9c65",
"timestamp": "",
"source": "github",
"line_count": 928,
"max_line_length": 164,
"avg_line_length": 44.02155172413793,
"alnum_prop": 0.5704494272006266,
"repo_name": "qusp/orange3",
"id": "9f5c2d14fb9d72693bae0ed2ea4565a2113aba20",
"size": "40852"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('goods', '0013_auto_20170907_1846'),
]
operations = [
migrations.AlterModelOptions(
name='goods',
options={'ordering': ['category', '... | {
"content_hash": "2a0113cf26b3297a13ad18fede0fd582",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 115,
"avg_line_length": 23.88235294117647,
"alnum_prop": 0.5960591133004927,
"repo_name": "Beomi/irkshop",
"id": "2c9e82af77422fa9f39d0fc1b02f6ebb2dbfb3e0",
"size": "487",
... |
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = 1000000L
settings = {}
pp = pprint.PrettyPrinter(indent=4)
class BitcoinRPC:
OBJID = 1
def __init__(self, host, port, username, passwo... | {
"content_hash": "2e3f79c2a01881ef0e2fc6c3039fb5c1",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 84,
"avg_line_length": 25.416326530612245,
"alnum_prop": 0.6452545366950377,
"repo_name": "wargo32/NewYorkCoin",
"id": "a79046cc00b2d2462efb2397f467c568189640c9",
"size": ... |
__author__ = 'adeb'
import multiprocessing
def spawn(f):
def fun(q_in, q_out):
while True:
i, x = q_in.get()
if i is None:
break
q_out.put((i, f(x)))
return fun
def parmap(f, x, nprocs=multiprocessing.cpu_count()):
"""
Parallel map that ca... | {
"content_hash": "14a8d129cc1418409cabbc79021ae402",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 117,
"avg_line_length": 25.771428571428572,
"alnum_prop": 0.5742793791574279,
"repo_name": "adbrebs/spynet",
"id": "c4025941b876a799d0375d79cca94d4f8d7b3f15",
"size": "902"... |
import re
from random import randint
markov_data = []
def process_text(text):
markov_data.append(filter(lambda x: x != '', re.split(r'[\.,;\?!\s\"]+', text)))
def markov_chain(length=32, order=2):
chunks = []
for d in markov_data:
for i in range(0, len(d) - order + 1):
chunks.append(d... | {
"content_hash": "9fe9af10f314c77ac2b0c67095e4ab04",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 84,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.5587583148558758,
"repo_name": "erichensley/crapbot",
"id": "c6a3b5ae85bb980159933217537866e16b605011",
"size": "... |
import time
import os
import sys
from multiprocessing import Process
from termcolor import cprint
from probes.osx import MemInfo
from probes.osx import LoadAvg
class Foreman(object):
def __init__(self, diary, args):
self.args = args
self.diary = diary
self.probes = {}
self.worker... | {
"content_hash": "d2524156d076410c2240f2aa722d9228",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 77,
"avg_line_length": 33.41538461538462,
"alnum_prop": 0.5501841620626151,
"repo_name": "diego351/monster",
"id": "d635628d13ac4194a2ed03cd74088c860076cc69",
"size": "2172... |
import argparse, time, sys, os
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/..'))
from rgbmatrix import RGBMatrix
class SampleBase(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super(SampleBase, self).__init__(*args, **kwargs)
self.add_argument("-r", "--rows", act... | {
"content_hash": "618997ac081a97f62a03297d2659d5db",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 157,
"avg_line_length": 40.5,
"alnum_prop": 0.5815240527884206,
"repo_name": "billthefighter/sunrise",
"id": "65a74898b0090845b5414de01ea406885b9c0dc3",
"size": "2349",
"... |
import sys
import os
#Put lib on path, once Google App Engine does not allow doing it directly
sys.path.append(os.path.join(os.path.dirname(__file__), "lib"))
import settings
from tekton.gae import middleware
import webapp2
class BaseHandler(webapp2.RequestHandler):
def get(self):
self.make_convetion()
... | {
"content_hash": "5cae5cb9968494b752e6f463d7f380b2",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 22.041666666666668,
"alnum_prop": 0.7051039697542533,
"repo_name": "renzon/angular",
"id": "2c59b0a903a0569f44d49a6ea8260786babdceea",
"size": "529",... |
'''Tests for base compliance checker class'''
from __future__ import unicode_literals
from unittest import TestCase
from netCDF4 import Dataset
from compliance_checker import base
import os
class TestBase(TestCase):
'''
Tests functionality of the base compliance checker class
'''
def setUp(self):
... | {
"content_hash": "afda282f6da9aa882e9348e6589c52b5",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 138,
"avg_line_length": 41.8125,
"alnum_prop": 0.5683109118086697,
"repo_name": "petejan/compliance-checker",
"id": "11c617985369d6c338df10e5136a37f5ebc7a9d1",
"size": "339... |
from queryset import QuerySet, QuerySetManager
from queryset import DoesNotExist, MultipleObjectsReturned
import sys
import pymongo
_document_registry = {}
def get_document(name):
return _document_registry[name]
class ValidationError(Exception):
pass
class BaseField(object):
"""A base class for fiel... | {
"content_hash": "43a2f9d0299b036541c118aaf26d2e17",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 91,
"avg_line_length": 36.91983122362869,
"alnum_prop": 0.564,
"repo_name": "alex/mongoengine",
"id": "37d58ae9b7da617978ffb7c5b42359a8ba7abbed",
"size": "17500",
"binar... |
"""Function signature objects for callables.
Back port of Python 3.3's function signature tools from the inspect module,
modified to be compatible with Python 2.7 and 3.2+.
"""
#-----------------------------------------------------------------------------
# Python 3.3 stdlib inspect.py is public domain
#
# Backport... | {
"content_hash": "d93bb4d8a732eb269239aaf2b591ddfb",
"timestamp": "",
"source": "github",
"line_count": 823,
"max_line_length": 84,
"avg_line_length": 35.838396111786146,
"alnum_prop": 0.5358196304458382,
"repo_name": "mattvonrocketstein/smash",
"id": "e3e7863adadb3cf050ee4477c47337d8e00ae47c",
"si... |
'''
Receives a live video stream from the robot using ZeroMQ
'''
import io
import socket
import struct
from PIL import Image
import cv2
import numpy as np
import zmq
# Configure the following parameter:
IP_ADDRESS = "192.168.0.56"
cv2.startWindowThread()
cv2.namedWindow('Robot Camera', cv2.WINDOW_NORMAL)
# Setup SU... | {
"content_hash": "59a6fbbd639b6a361771eec740600d48",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 25.08888888888889,
"alnum_prop": 0.662533215234721,
"repo_name": "cosmoharrigan/rc-nfq",
"id": "2c80f8a1929abe88ca5447a867934faf46eb31f9",
"size": "1... |
r"""Script to generate a HTML summary comparing IREE and TFLite latencies and memory usage.
Example usage:
python parse_tflite_benchmarks.py \
--iree_version=20220924.276 \
--tflite_version=20220924.162 \
--platform=server \
--input_csv=server_results.csv \
--output_path=/tmp/server_summary.html
"""
impor... | {
"content_hash": "52fc08fdb1b00108d3630162e365dbba",
"timestamp": "",
"source": "github",
"line_count": 476,
"max_line_length": 91,
"avg_line_length": 34.5,
"alnum_prop": 0.6097917427840701,
"repo_name": "iree-org/iree",
"id": "d08af9797fbfdba7e55fb1ce4b1e103728a27ce7",
"size": "16639",
"binary":... |
"""RequestContext: context for requests that persist through all of openapp."""
import copy
from keystoneclient import auth
from keystoneclient import service_catalog
from oslo_context import context
from oslo_log import log as logging
from oslo_utils import timeutils
import six
from openapp import exception
from op... | {
"content_hash": "625ed68e5b543a37c65252929a935423",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 79,
"avg_line_length": 37.26877470355731,
"alnum_prop": 0.6028210838901262,
"repo_name": "Yusuke1987/openstack_template",
"id": "63ac551fe5f17030c2c2cd3dfc73863fd72ebb05",
... |
import requests
def getForecast(apiObj):
forecast = {}
forecast['high'] = apiObj['high']['celsius']
forecast['low'] = apiObj['low']['celsius']
forecast['dateFor'] = apiObj['date']['epoch']
forecast['humidity'] = apiObj['avehumidity']
return forecast
r = requests.get('http://api.wundergrou... | {
"content_hash": "8d042d7c0904d0c9e88d343344242410",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 99,
"avg_line_length": 32.05263157894737,
"alnum_prop": 0.6847290640394089,
"repo_name": "Pharylon/Weather",
"id": "514d712cf3b874d087ceec065543e11dab157613",
"size": "609"... |
import base64
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
# [END import_libraries]
def do_ocr(photo_file):
"""Run a label request on a single image"""
# [START authenticate]
credentials = GoogleCredentials.get_application_default()
service = discovery.buil... | {
"content_hash": "0d251298d535fcf78754c947864e2516",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 32.52777777777778,
"alnum_prop": 0.5644748078565329,
"repo_name": "lighttiger2505/Religo",
"id": "ed403bde3308a49ee0991a8d719dc31bfbc4579f",
"size": ... |
"""SCons.Tool.lex
Tool-specific initialization for lex.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permiss... | {
"content_hash": "4dbe161240dd54efdb9c78ecf4cd0fc2",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 89,
"avg_line_length": 35.32258064516129,
"alnum_prop": 0.6910197869101978,
"repo_name": "amyvmiwei/chromium",
"id": "cd42f45b42309031c6ebb37ff535b7e5bfa8d8d1",
"size": "32... |
"""
hmmlearn
========
``hmmlearn`` is a set of algorithms for learning and inference of
Hiden Markov Models.
"""
__version__ = "0.2.1"
| {
"content_hash": "5102c3ebacba9af6ea87935191210f61",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 65,
"avg_line_length": 15.222222222222221,
"alnum_prop": 0.6277372262773723,
"repo_name": "aubreyli/hmmlearn",
"id": "e5700a959c23340dfd62dc867eecedcecffb9df3",
"size": "137... |
import argparse
import json
import sys
import gcl
from gcl import query
from gcl import util
def select(dct, path):
for part in path:
if not hasattr(dct, 'keys'):
raise RuntimeError('Value %r cannot be indexed with %r' % (dct, part))
if part not in dct:
raise RuntimeError('Value %r has no key %... | {
"content_hash": "821d1ab301b81c16c86a66dceba5e06a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 130,
"avg_line_length": 32.08163265306123,
"alnum_prop": 0.6354961832061069,
"repo_name": "rix0rrr/gcl",
"id": "f951c01b51251180d96081011f4ea34f9a1fcd1d",
"size": "1572",
... |
"""
Example Airflow DAG that interacts with Google Data Catalog service
"""
from google.cloud.datacatalog_v1beta1 import FieldType, TagField, TagTemplateField
from airflow import models
from airflow.operators.bash import BashOperator
from airflow.providers.google.cloud.operators.datacatalog import (
CloudDataCatal... | {
"content_hash": "6ef484198f5c33d47f04ba3fec4cc6b0",
"timestamp": "",
"source": "github",
"line_count": 434,
"max_line_length": 110,
"avg_line_length": 39.83179723502304,
"alnum_prop": 0.6832301729623417,
"repo_name": "sekikn/incubator-airflow",
"id": "e6e94f2913925aa8adcc635f867c946918f89193",
"si... |
import sublime, sublime_plugin
import os, sys
class JavascriptEnhancementsOpenTermivalViewHereCommand(sublime_plugin.WindowCommand):
def run(self, **args):
window = self.window
view = window.active_view()
paths = args.get("paths") if "paths" in args else []
path = self.get_path(paths)
if not p... | {
"content_hash": "a77ddce5346505842ede6dc10c8885eb",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 136,
"avg_line_length": 30.784313725490197,
"alnum_prop": 0.6280254777070063,
"repo_name": "pichillilorenzo/JavaScriptEnhancements",
"id": "8f982c5dc09a614fa745abf7a9219a86c9... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "d64a45dfc2214e4b822702b5931d4d26",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 148,
"avg_line_length": 42.176991150442475,
"alnum_prop": 0.7262554203385089,
"repo_name": "alexryndin/ambari",
"id": "265e7df9a0a08bab3306e8034c6cfad2c7c14bd9",
"size": "... |
from __future__ import print_function
import logging
from twisted.internet import protocol
from twisted.python import log
from txmsgpackrpc.protocol import MsgpackStreamProtocol
from txmsgpackrpc.handler import SimpleConnectionHandler
class MsgpackServerFactory(protocol.Factory):
protocol = MsgpackStreamProt... | {
"content_hash": "3307e285c721ae4aa1b49b3c77c30c65",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 113,
"avg_line_length": 34.986486486486484,
"alnum_prop": 0.7180378524526845,
"repo_name": "tobixx/txmsgpackrpc",
"id": "d69afa4194f50f988099f2f8ba3588a7c041a3d5",
"size": ... |
"""The Channel class provides a wrapper for interacting with RabbitMQ
implementing the methods and behaviors for an AMQP Channel.
"""
import collections
import logging
import warnings
import uuid
import pika.frame as frame
import pika.exceptions as exceptions
import pika.spec as spec
from pika.utils import is_callabl... | {
"content_hash": "494d490452f007104d818638deb3c607",
"timestamp": "",
"source": "github",
"line_count": 1254,
"max_line_length": 80,
"avg_line_length": 42.33572567783094,
"alnum_prop": 0.5985985797434497,
"repo_name": "hugoxia/pika",
"id": "2bf3b0f0d0b7066ee6779e0bb883da5c3ff91705",
"size": "53089"... |
from __future__ import unicode_literals
from opensearchsdk.service import BaseService
from opensearchsdk.base import Base
from opensearchsdk import log
from opensearchsdk import set_stream_logger
from opensearchsdk.config import Config
__author__ = 'barycenter'
def lazy_prop(fn):
"""
lazy load for query
... | {
"content_hash": "6bf735cf97d3c16097df36b2a8ebd54d",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 116,
"avg_line_length": 32.2491103202847,
"alnum_prop": 0.53774001324211,
"repo_name": "Cicero-Zhao/opensearch-sdk",
"id": "1453527082b0209e43dd9403ea147a28d1455068",
"siz... |
import ConfigParser
import re
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from oslo_config import cfg
from oslo_log import log as logging
from oslo_policy import policy
import daisy.api.policy
from daisy.common import exception
from daisy import i18n
# NOT... | {
"content_hash": "fdb0fc9907902653b25bab09bd42f3f4",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 79,
"avg_line_length": 40.40625,
"alnum_prop": 0.52861562258314,
"repo_name": "OpenDaisy/daisy-api",
"id": "802a7d1db444c562eeeeee83250d34cd1575d18d",
"size": "8363",
"b... |
"""The blocking connection adapter module implements blocking semantics on top
of Pika's core AMQP driver. While most of the asynchronous expectations are
removed when using the blocking connection adapter, it attempts to remain true
to the asynchronous RPC nature of the AMQP protocol, supporting server sent
RPC comman... | {
"content_hash": "037dd796befdd69db56d9b624fd7a61a",
"timestamp": "",
"source": "github",
"line_count": 2498,
"max_line_length": 93,
"avg_line_length": 40.848678943154525,
"alnum_prop": 0.6040670325362603,
"repo_name": "knowsis/pika",
"id": "b83ffa165871b8b082c146645585168498c61c38",
"size": "10204... |
from __future__ import with_statement
import crits.picture_fetcher as picture_fetcher
import os
import urllib
import StringIO
import Image
from django.test import TestCase
from django.core.urlresolvers import reverse
from mock import Mock
class TestPictureFetcher(TestCase):
def _read_test_page(self):
fil... | {
"content_hash": "28a1ac1e83ff0599dfd8834b38331f1a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 83,
"avg_line_length": 34.168539325842694,
"alnum_prop": 0.6395922393949359,
"repo_name": "mop/twit-miner",
"id": "5edda2487677280cacce00fd56f10aa0b210e0e3",
"size": "3041"... |
import sys
import os
# 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('.'))
# -- General conf... | {
"content_hash": "bdc41ae57813c5a57501dd6553d7a9d9",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 80,
"avg_line_length": 32.69415807560137,
"alnum_prop": 0.7044355686356948,
"repo_name": "VLSI-EDA/rc3e-node",
"id": "ea4e9857ceb6fc29676ed87c12e77ad04f8286e6",
"size": "9... |
from setuptools import setup, find_packages
from codecs import open
from os import path, system
import sys
import subprocess
from setuptools.command.install import install
import pkgutil
__version__ = '0.0.10'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.... | {
"content_hash": "b5d28cf81bcbeb56345da7aa0d7c6dab",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 293,
"avg_line_length": 39.91891891891892,
"alnum_prop": 0.6364251861882194,
"repo_name": "ecatkins/xpdf_python",
"id": "b3383b0bae83ac180a31505e2ba4096da237f3d9",
"size": ... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import unittest
from textwrap import dedent
from pants.engine import parser
from pants.engine.objects import Resolvable
from pants_test.engine.examples im... | {
"content_hash": "3d06af2e6f34d65d52095669a808f1d5",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 98,
"avg_line_length": 28.64841498559078,
"alnum_prop": 0.5884719847097878,
"repo_name": "foursquare/pants",
"id": "3f72f1ebf36fe4c8eb98a59fe5c115560759f6d9",
"size": "100... |
import unittest
from chainer.backends import cuda
from chainer import distributions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
import numpy
@testing.parameterize(*testing.product({
'shape': [(3, 2), (1,)],
'is_variable': [True, False],
'sample_shape': ... | {
"content_hash": "fe0f2f1a9168cf644941d5687d4c3c14",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 79,
"avg_line_length": 32.69911504424779,
"alnum_prop": 0.6208389715832205,
"repo_name": "rezoo/chainer",
"id": "6fb513dbf46f114cb138dde7db2247890c0866a4",
"size": "3695",... |
import random
races = [("Dwarf", "+CON;+WIS;-CHA"), ("Elf", "+DEX;+INT;-CON"), ("Gnome", "+CON;+CHA;-STR"), ("Half-Elf", "ANY"), ("Half-Orc", "ANY"), ("Halfling", "+DEX;+CHA;-STR"), ("Human", "ANY")]
class Race():
def __init__(self, inRace):
if inRace == "rand":
self.finalRace, self.raceStats ... | {
"content_hash": "99a9b75b78115e88c490012c2088c20c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 185,
"avg_line_length": 37.07692307692308,
"alnum_prop": 0.5518672199170125,
"repo_name": "laisrael/Game-Tools-NPC-Generator",
"id": "17f8f448c04986790506d5304bdb0641c430dbe6... |
from io_processing.result_interpreter.abst_result_interpreter import AbstractInterpreter, \
InterpreterOptions
from io_processing.surveillance_handler import MonitorTags, \
EventlineHandler
import csv
from io_processing.result_interpreter.checkpoint_interpreter import CPCategory
class EventlineInterpreter(Abst... | {
"content_hash": "163bb97b71bd5db8352264cdd090c381",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 220,
"avg_line_length": 55.20595533498759,
"alnum_prop": 0.6168644372527867,
"repo_name": "PhilippMundhenk/IVNS",
"id": "80462e9cf5daa6915af74640440c962c26dcbf9a",
"size":... |
"""Fichier contenant le paramètre 'montant' de la commande 'questeur'."""
from primaires.interpreteur.masque.parametre import Parametre
class PrmMontant(Parametre):
"""Commande 'questeur montant'.
"""
def __init__(self):
"""Constructeur du paramètre"""
Parametre.__init__(sel... | {
"content_hash": "bdae6ff67ca0c0d2d4282fbef53c4df6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 37.75675675675676,
"alnum_prop": 0.5934144595561919,
"repo_name": "vlegoff/tsunami",
"id": "013bad6f075e88968e59c05d84de0ac743d95dcd",
"size": "2987"... |
from django.forms import ModelForm, forms
from .models import Todo
class TodoForm(ModelForm):
class Meta:
model = Todo
include = ('projectname', 'description', 'deadline')
exclude = ('pk', 'progress', 'created_date')
class TodoUpdateForm(ModelForm):
class Meta:
model = Todo
... | {
"content_hash": "1890d082e8fa71d47ec5b6404e5a7c8d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 27.0625,
"alnum_prop": 0.625866050808314,
"repo_name": "dihmandrake/todo-django",
"id": "b4106831d349abdb3569a08643d335c540ccc04f",
"size": "433",
... |
"""ACME protocol messages."""
import collections
from six.moves.urllib import parse as urllib_parse # pylint: disable=import-error
from acme import challenges
from acme import fields
from acme import jose
class Error(jose.JSONObjectWithFields, Exception):
"""ACME error.
https://tools.ietf.org/html/draft-i... | {
"content_hash": "bc25f92709dff93c9e106c90f34fc054",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 82,
"avg_line_length": 32.15696202531645,
"alnum_prop": 0.663517556290348,
"repo_name": "rugk/letsencrypt",
"id": "970cf4e6e572203e1e5929a67ea9fbd6409ea40b",
"size": "1270... |
from django.conf.urls import re_path
from django.contrib.auth.decorators import login_required
from w0rplib.url import redir
from .feed import LatestArticleFeed
from .views import (
ArticleBanCommenterView,
ArticleDeleteCommentView,
ArticleDetailView,
ArticleEditPageView,
ArticleMonthArchiveView,
... | {
"content_hash": "1ca03755d6693ea208ed1528f149448b",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 72,
"avg_line_length": 27.489583333333332,
"alnum_prop": 0.5589238347859038,
"repo_name": "w0rp/w0rpzone",
"id": "a0dee26bb696a19e335441bb2ef2e82e43345093",
"size": "2639",... |
"""This example adds a responsive display ad to an ad group.
Image assets are uploaded using AssetService. To get ad groups, run
get_ad_groups.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more informat... | {
"content_hash": "81a39299dd2933d0e5a2bfa2f243275d",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 80,
"avg_line_length": 29.25465838509317,
"alnum_prop": 0.5821656050955414,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "c6c5273f3b98f2726dcdb188dab50bed8b04476e",
... |
"""Create / interact with Google Cloud Resource Manager connections."""
from google.cloud import _http
from google.cloud.resource_manager import __version__
_CLIENT_INFO = _http.CLIENT_INFO_TEMPLATE.format(__version__)
class Connection(_http.JSONConnection):
"""A connection to Google Cloud Resource Manager v... | {
"content_hash": "0b9d6825aac90eb22f51ec9cfafaa960",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 31.285714285714285,
"alnum_prop": 0.6952054794520548,
"repo_name": "dhermes/gcloud-python",
"id": "d0118c810385d8b67df5097a88430692ef36e20f",
"size":... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test that using Repository() works even when the Repository has no
SConsignFile() and the source Repository files have their signatures
saved because they're older than the max_drift time.
"""
import TestSCons
test = TestSCons.TestSCons()
test.subdir... | {
"content_hash": "bcf42908c4b4c9eafdee6952ab921770",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 68,
"avg_line_length": 21,
"alnum_prop": 0.6330532212885154,
"repo_name": "datalogics-robb/scons",
"id": "95b1749f3bd98c47a14687f1f7ebb594161b8479",
"size": "2173",
"bina... |
"""
This file contains function to looking for WordPress plugins and versions
"""
import csv
import aiohttp
import asyncio
from datetime import datetime
from functools import partial
from urllib.parse import urlparse
from os.path import join
from .db import DB
from .data import * # noqa
from .exceptions import * #... | {
"content_hash": "258a09b902716b49845ab803abde7f4a",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 108,
"avg_line_length": 40.868852459016395,
"alnum_prop": 0.43414895039443774,
"repo_name": "0ps/plecost",
"id": "ffda53185d73478e5aa2a714c7a60682aae3755a",
"size": "9294"... |
import pymongo, sys, os
from bson.objectid import ObjectId
DB_NAME = "masterSlideList"
DB_COLL = "RawSlideData"
XML_DIR = "/TCGA_MIRROR/TCGA_METADATA/Aperio_XML_Files"
client = pymongo.MongoClient('localhost',27017)
db = client[DB_NAME][DB_COLL]
slides = {}
for root, dirs, files in os.walk(XML_DIR):
for subroot, s... | {
"content_hash": "45934788640813e106343d301177867c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 83,
"avg_line_length": 29.896551724137932,
"alnum_prop": 0.6816608996539792,
"repo_name": "dgutman/ADRCPathViewer",
"id": "44a52357deb08a24b5f5866785c5c2df3d1c52d1",
"size"... |
from tempest import config
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
from manila_tempest_tests import share_exceptions
from manila_tempest_tests.tests.api import base
CONF = config.CONF
class SharesNegativeTest(base.BaseSharesTest):
@classmethod
def ... | {
"content_hash": "413b834da691732dbcc2bc084dccfcff",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 79,
"avg_line_length": 41.77075098814229,
"alnum_prop": 0.598221044663134,
"repo_name": "NetApp/manila",
"id": "7c5619ef8285369526c092ad1fd3417fae1cecd3",
"size": "11197",... |
import types
class SharedInstance:
""" This class merely offers a singelton for the Blockchain Instance
"""
instance = None
config = {}
class AbstractBlockchainInstanceProvider:
""" This is a class that allows compatibility with previous
naming conventions. It will extract 'blockchain_i... | {
"content_hash": "51e7864ffe291c3162cd78947cde01a2",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 82,
"avg_line_length": 32.98347107438016,
"alnum_prop": 0.613881232773741,
"repo_name": "xeroc/python-graphenelib",
"id": "29dcfb0f8ebf1c0bec8d642f2071d875dd8c1753",
"size... |
import threading
import time
import sys
from src import Utils
from src.play.controller.bots.HumanGui import HumanGui
from src.play.model.Game import Game, InvalidMove_Error
from src.play.model.Move import Move
from src.play.controller.GTPengine import GTPengine
class GTPcontroller(threading.Thread):
def __init... | {
"content_hash": "f0da55137e6e9180fdc44ae2aac887ff",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 110,
"avg_line_length": 37.7787610619469,
"alnum_prop": 0.5975638322792223,
"repo_name": "nathbo/GO_DILab",
"id": "57d97b9fb80dec10c45ac76a713af2c8ae643a58",
"size": "4269... |
"""
@package mi.instrument.nortek.aquadopp.playback.driver
@author Pete Cable
@brief Driver for the aquadopp ascii mode playback
Release notes:
Driver for Aquadopp DW
"""
__author__ = 'Pete Cable'
__license__ = 'Apache 2.0'
import re
import datetime
from mi.core.log import get_logger
log = get_logger()
from mi.co... | {
"content_hash": "dc65d8f058b251add53de0509267c145",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 121,
"avg_line_length": 41.46560846560847,
"alnum_prop": 0.6034196758963889,
"repo_name": "ronkyo/mi-instrument",
"id": "c7f8580761f04d11af38cfb1e7cdaaa699aa27ac",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.