text stringlengths 4 1.02M | meta dict |
|---|---|
from flocker.node.agents.blockdevice import (
VolumeException, AlreadyAttachedVolume,
UnknownVolume, UnattachedVolume,
IBlockDeviceAPI, _blockdevicevolume_from_dataset_id,
BlockDeviceVolume
)
from uuid import uuid4, UUID
from zope.interface import implementer
from twisted.python.filepath import FilePat... | {
"content_hash": "5553dfc3a39206771f2e1d39aaa35b3e",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 78,
"avg_line_length": 36.831491712707184,
"alnum_prop": 0.5795394884872122,
"repo_name": "huaweistorage/huawei-oceanstor-flocker-plugin",
"id": "e1ac600aaa28c04ab2049308bd5... |
from app import app, db, models
from flask import jsonify
available_regions = ['Nelson', 'Dunedin', 'Hamilton', 'Christchurch', 'Gisborne', 'Greymouth', 'Wanganui', 'Tekapo', 'Wellington', 'Turangi', 'Whangarei', 'Alexandra', 'Auckland', 'Rotorua', 'Havelock Nth']
@app.route('/region')
def return_available():
ret... | {
"content_hash": "86f85911b629be9d2fa430beeb31f104",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 206,
"avg_line_length": 34.05263157894737,
"alnum_prop": 0.6723338485316847,
"repo_name": "herrjemand/WaterGo2016",
"id": "0e37a88587ad88444f262acdee5e5063568a3e7f",
"size"... |
from stupid.chatbot import ChatBot, trigger
from stupid.quotes import QuotesDatabase
from stupid.utils import weekday
class QuoteBot(ChatBot):
def __init__(self, *args, **kwargs):
super(QuoteBot, self).__init__(*args, **kwargs)
self.schedule.every().day.at("9:25").do(self.post_quote)
self.... | {
"content_hash": "d6ef8a2aec415c4870036c08e852da23",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 64,
"avg_line_length": 30.727272727272727,
"alnum_prop": 0.6331360946745562,
"repo_name": "peterdemin/stupid",
"id": "50d7b7f7d624d8f2f4cc9cc038a35ca50db6ed1f",
"size": "67... |
"""
sinecosine.py
Author: Payton
Credit: Morgan, Mr. Dennison
Assignment:
In this assignment you must use *list comprehensions* to generate sprites that show the behavior
of certain mathematical functions: sine and cosine.
The sine and cosine functions are provided in the Python math library. These functions are us... | {
"content_hash": "548019941ab5ef10b330a64c961d859c",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 124,
"avg_line_length": 36.69230769230769,
"alnum_prop": 0.7714884696016772,
"repo_name": "phstearns/Sine-Cosine",
"id": "a8077565b0ddd4b3946bb8f3020ef8e17d75d576",
"size":... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
no_dry_run = True
def forwards(self, orm):
"""
Plugin Data migrations are done in 0010. This will test that the
mi... | {
"content_hash": "320a272170893f17a808ffde4cc1048c",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 211,
"avg_line_length": 80.2304347826087,
"alnum_prop": 0.5693383189725247,
"repo_name": "spladug/cabot",
"id": "fc0d02fe2bb378e1d46616a13c1d34efac358d0b",
"size": "18477"... |
import json
import logging
import requests
from tornado.options import options
from model import TextMessage
class IFTTT(object):
def __init__(self, key):
self.key = key
self.logger = logging.getLogger("ifttt")
def url(self, event):
return 'https://maker.ifttt.com/trigger/{0}/with/... | {
"content_hash": "adc2995545c148976398f387e4a2b115",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 96,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.551219512195122,
"repo_name": "senghoo/operator",
"id": "8d9fe41dd4199677d4e09d913b930adc28715c32",
"size": "1230... |
import MySQLdb
import xlsxwriter
import mysql.connector
import datetime
import logging
import sys
from xml.dom import minidom
doc = minidom.parse("mykong.xml")
majors = doc.getElementsByTagName("major")
get_user = doc.getElementsByTagName("user")[0]
get_pwd = doc.getElementsByTagName("password")[0]
get_db = d... | {
"content_hash": "285552da29ec2d3e885012f4a76da5e6",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 85,
"avg_line_length": 27.872,
"alnum_prop": 0.5473593570608496,
"repo_name": "atharva1996/squareinch",
"id": "9f96550cefc60a36c964405cc48701e99e9c4e8a",
"size": "3484",
... |
import murano.dsl.murano_object as murano_object
class AttributeStore(object):
def __init__(self):
self._attributes = {}
def set(self, tagged_object, owner_type, name, value):
if isinstance(value, murano_object.MuranoObject):
value = value.object_id
key = (tagged_object.o... | {
"content_hash": "9fedb8ca71fabee4b77be4186abb3d9e",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 71,
"avg_line_length": 30.727272727272727,
"alnum_prop": 0.5650887573964497,
"repo_name": "chenyujie/hybrid-murano",
"id": "dd5038bde346f863f0ceb449056b33c6c453365d",
"size... |
"""
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": "0e0f786386c0d0e3c6511589cc58c150",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 93,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.7672018348623854,
"repo_name": "arenadata/ambari",
"id": "cc51784ba8c6a5e363cffc83c81ee7d837b4d185",
"size": "174... |
"""TraceEventImporter imports TraceEvent-formatted data
into the provided model.
This is a port of the trace event importer from
https://code.google.com/p/trace-viewer/
"""
from __future__ import division
from __future__ import absolute_import
import collections
import six
import telemetry.timeline.async_slice as tra... | {
"content_hash": "7f58d927d2d3db135842d5bdd549dbcf",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 80,
"avg_line_length": 38.1881390593047,
"alnum_prop": 0.5883045946235408,
"repo_name": "catapult-project/catapult",
"id": "cdfae607c598bf908ceb3ed5eef92d2aa11d4c00",
"siz... |
"""Support for MyQ-Enabled lights."""
from pymyq.errors import MyQError
from homeassistant.components.light import LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeA... | {
"content_hash": "122f3f1f6effd7d569ea0d08d7002b2d",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 81,
"avg_line_length": 30.589041095890412,
"alnum_prop": 0.6466636811464398,
"repo_name": "rohitranjan1991/home-assistant",
"id": "d3f6c6de36bdf42d71a7eb0872fc644f2e4d7ae2",
... |
from xierpa3.adapters.adapter import Adapter
#from xierpa3.toolbox.database.sql.sqldatastore import SqlDatastore
#from xierpa3.toolbox.database.base.defaultmodels import Item
#from xierpa3.toolbox.database.base.selector import Selector
class Selector():
# @@@ Under development
pass
class SqlDatastore():
... | {
"content_hash": "1e202811f14b827a8044f23e44a73998",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 120,
"avg_line_length": 38.901234567901234,
"alnum_prop": 0.6296413836877182,
"repo_name": "petrvanblokland/Xierpa3",
"id": "46abb92ebbada68a6886ace6ab44f1c9313935ed",
"siz... |
'a string contains extra whitespaces'
| {
"content_hash": "eb5ebd2d896f3b71af02210f1c1adfbe",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 37,
"avg_line_length": 38,
"alnum_prop": 0.8157894736842105,
"repo_name": "ssato/python-anyconfig",
"id": "22f1dd18d845593cef968fa0837413bfd8c5e75c",
"size": "38",
"binary... |
import argparse
import datetime
from distroinfo import info
from distroinfo import query
from rdoutils import review_utils
from rdoutils import releases_utils
rdoinfo_repo = ('https://raw.githubusercontent.com/'
'redhat-openstack/rdoinfo/master/')
def parse_args():
parser = argparse.ArgumentParse... | {
"content_hash": "1fe99da0cc44641e01744d8335de9b27",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 38.59322033898305,
"alnum_prop": 0.5344751866490997,
"repo_name": "rdo-infra/releng",
"id": "7a83c4a6d598bd032860996ffc4c14ff09b071b5",
"size": "2278... |
import sys
# 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 configuration ... | {
"content_hash": "e63104e3007979a3ed027c7e45606e90",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 32.222707423580786,
"alnum_prop": 0.7017211004201112,
"repo_name": "JuliaPackageMirrors/MPFI.jl",
"id": "f2a493ca70377dff38841613d46fa8f36af5e9be",
... |
"""
Concurrent-learning controller derived for
a two-linkage robotic manipulator. Includes
repetitive learning if the path to track
is cyclical.
"""
################################################# DEPENDENCIES
from __future__ import division
import numpy as np
import numpy.linalg as npl
from collections import deq... | {
"content_hash": "bf29819252db9539b235014f1dbced5f",
"timestamp": "",
"source": "github",
"line_count": 469,
"max_line_length": 190,
"avg_line_length": 33.66737739872068,
"alnum_prop": 0.607726409119696,
"repo_name": "jnez71/adaptive_control",
"id": "7826ab4385b3d9e837446af882716b297a4b1aea",
"size... |
import numpy as np
import os
import tensorflow as tf
from tensorflow.contrib.session_bundle import exporter
import time
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_integer("batch_size", 10, "The batch size to train")
flags.DEFINE_integer("epoch_number", 10, "Number of epochs to run trainer")
flags.DEFINE_int... | {
"content_hash": "8a2e2cfc1a82658f1ffe859db220a339",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 85,
"avg_line_length": 34.90909090909091,
"alnum_prop": 0.6618303571428571,
"repo_name": "tobegit3hub/deep_recommend_system",
"id": "5094a741ad4b7747c9d56467cc3af05cf2fae3c2"... |
import requests
from urllib.parse import urlencode, urljoin
from collections import namedtuple
from .exceptions import BankIdError
Token = namedtuple('Token', ['access_token', 'refresh_token', 'expires_in', 'token_type'])
class BaseBankIdClient(object):
"""
Base BankID client class, which contains common f... | {
"content_hash": "cfccb7b7f9bb440398a509213b889396",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 112,
"avg_line_length": 41.935483870967744,
"alnum_prop": 0.64,
"repo_name": "dchaplinsky/badparking.in.ua",
"id": "444cd8d544d8f5364cc23ccb3778185d8ce8129c",
"size": "3900... |
"""Various classes representing distributed values."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
import weakref
import six
from tensorflow.python.distribute import device_util
from tensorflow.python.distribute imp... | {
"content_hash": "4f1b99cb9d662144cae7abb302ceae74",
"timestamp": "",
"source": "github",
"line_count": 1789,
"max_line_length": 108,
"avg_line_length": 36.2023476802683,
"alnum_prop": 0.6741500169842202,
"repo_name": "ghchinoy/tensorflow",
"id": "0b5678d4cf935676706ee92190a703c48567eb4c",
"size": ... |
"""Constants for the ecobee integration."""
import logging
from homeassistant.components.weather import (
ATTR_CONDITION_CLOUDY,
ATTR_CONDITION_FOG,
ATTR_CONDITION_HAIL,
ATTR_CONDITION_LIGHTNING_RAINY,
ATTR_CONDITION_PARTLYCLOUDY,
ATTR_CONDITION_POURING,
ATTR_CONDITION_RAINY,
ATTR_CONDI... | {
"content_hash": "52c0b3b9e4d77f384e371b8d7e09c683",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 90,
"avg_line_length": 26.285714285714285,
"alnum_prop": 0.6798418972332015,
"repo_name": "GenericStudent/home-assistant",
"id": "50dd606ad254f5b6b20fb995be2089aa2e2bfb8f",
... |
from __future__ import annotations
import datetime as dt
from psycopg2.extensions import connection
from gargbot_3000 import pictures
from tests import conftest
def assert_valid_returns(url: str, timestamp: dt.datetime, description: str) -> None:
assert url.startswith("https")
assert type(timestamp) == dt.... | {
"content_hash": "042852db137da2ed4b924fff6eed0980",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 88,
"avg_line_length": 39.94117647058823,
"alnum_prop": 0.681230567828506,
"repo_name": "eirki/gargbot_3000",
"id": "fabaa84193df29daeb4f669d3f965be4c5196dcf",
"size": "61... |
import warnings
import numpy
from chainer import backend
from chainer.backends import cuda
from chainer import configuration
from chainer import function
from chainer.functions.normalization import batch_normalization
from chainer.utils import type_check
def _xhat(x, mean, std, expander):
x_mu = x - mean[expand... | {
"content_hash": "ecf07ea7d972648707eab2f356c34a08",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 82,
"avg_line_length": 36.84158415841584,
"alnum_prop": 0.5704111797903789,
"repo_name": "jnishi/chainer",
"id": "701ded49a9def1494b6f27b91d230ca5138dc869",
"size": "7442"... |
import datetime
from django.conf import settings
from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.encoding import force_unicode
from django.utils.functional import cached_property
from django.utils.translation import ugettext as _
fro... | {
"content_hash": "da29a3361b12ec19917fdde0fa7770d8",
"timestamp": "",
"source": "github",
"line_count": 665,
"max_line_length": 126,
"avg_line_length": 34.090225563909776,
"alnum_prop": 0.5911777679752978,
"repo_name": "mitar/django",
"id": "6964624516dc97b80f350ed8ee60f39411c1056b",
"size": "22670... |
from axiom.scripts.axiomatic import AxiomaticCommand, AxiomaticSubCommand
from twisted.python.filepath import FilePath
from jumpmaplist.items import Author
def steamidTo64(steamid):
steamid = steamid[8:]
y, z = map(int, steamid.split(':'))
return str(z * 2 + y + 76561197960265728)
class AddSuperuser... | {
"content_hash": "478d0302f11ce1643dd0e3867eb7975d",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 92,
"avg_line_length": 27.396825396825395,
"alnum_prop": 0.6349942062572422,
"repo_name": "jsza/jump-map-list",
"id": "271324e4c60ee078a0e0e0caa2b1ede21cca43bc",
"size": "1... |
"""Auto-generated file, do not edit by hand. CC metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_CC = PhoneMetadata(id='CC', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[01]\\d{2}', possible_length=(3,)),
... | {
"content_hash": "df5fff5135951d9cd794547806550616",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 110,
"avg_line_length": 69.875,
"alnum_prop": 0.7477638640429338,
"repo_name": "gencer/python-phonenumbers",
"id": "ade5c03ba59deb55e21374959638834c8d2a5d02",
"size": "559",... |
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
f... | {
"content_hash": "0e104fa91da177e28364048143aba917",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 233,
"avg_line_length": 45.11848341232228,
"alnum_prop": 0.6376050420168067,
"repo_name": "Azure/azure-sdk-for-python",
"id": "a5177e26ee70e6db2a7c27a03a36337d71594c10",
"... |
"""
This script collects statistics about userscripts usage in Russian Wikipedia and
publishes it at [[Участник:NapalmBot/Самые используемые скрипты]]. Script can
detect only importScript functions and do not count cross-wiki script imports.
"""
import re
from collections import Counter
import pywikibot
def ucfirst(st... | {
"content_hash": "8450478fb2540b7914cde485c0f8e14d",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 141,
"avg_line_length": 34.54929577464789,
"alnum_prop": 0.6159804321239298,
"repo_name": "Facenapalm/NapalmBot",
"id": "d5750e482e928749de613ec8f3ed604db837db9f",
"size": ... |
"""
First test... just import something...
"""
import pytest
import sys
from pyhaystack.client.niagara import Niagara4HaystackSession
@pytest.mark.skipif(sys.version_info < (3, 4), reason="requires python3 or higher")
def test_conversion_of_str():
unescape = Niagara4HaystackSession.unescape
dct = {
"... | {
"content_hash": "3217e2e857cc301b888fc9f0a2134ad3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 96,
"avg_line_length": 27.941176470588236,
"alnum_prop": 0.6863157894736842,
"repo_name": "ChristianTremblay/pyhaystack",
"id": "ccc0dbbabb39d3236cf3c2a2f8981da2984bb148",
... |
import sys
from flask import Flask, request
import telepot
from telepot.loop import OrderedWebhook
"""
$ python2.7 flask_skeleton.py <token> <listening_port> <webhook_url>
Webhook path is '/webhook', therefore:
<webhook_url>: https://<base>/webhook
"""
def on_chat_message(msg):
content_type, chat_type, chat_id ... | {
"content_hash": "0713fbbae365d22f09386c0c09b11643",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 89,
"avg_line_length": 30.73015873015873,
"alnum_prop": 0.643595041322314,
"repo_name": "nickoala/telepot",
"id": "4b9bbfc1afb50e4c7947e8979267d27174e969e2",
"size": "1936"... |
"""Provides device triggers for Shelly."""
from __future__ import annotations
from typing import Any, Final
import voluptuous as vol
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHE... | {
"content_hash": "3747c088e6b584bebfdca9dd3bb0ae3c",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 82,
"avg_line_length": 30.075757575757574,
"alnum_prop": 0.646095717884131,
"repo_name": "Danielhiversen/home-assistant",
"id": "eae2953e5b82b7cf6b169707d92e0ae44810de4b",
... |
import urllib
import datetime
import github.GithubObject
import github.PaginatedList
import github.Branch
import github.IssueEvent
import github.ContentFile
import github.Label
import github.GitBlob
import github.Organization
import github.GitRef
import github.Issue
import github.Repository
import github.PullRequest
... | {
"content_hash": "5da604785daf84be3187d98a20b05e56",
"timestamp": "",
"source": "github",
"line_count": 2163,
"max_line_length": 312,
"avg_line_length": 39.78363384188627,
"alnum_prop": 0.6119788035141542,
"repo_name": "ARMmbed/yotta_osx_installer",
"id": "f57a1aa30fda37637ea6fbf0ece180f1510478cd",
... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v11.enums",
marshal="google.ads.googleads.v11",
manifest={"ManagerLinkStatusEnum",},
)
class ManagerLinkStatusEnum(proto.Message):
r"""Container for enum describing possible status of a manager
and client lin... | {
"content_hash": "943f2bd98f43436ef070c117b69f0ac0",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 66,
"avg_line_length": 21.857142857142858,
"alnum_prop": 0.6176470588235294,
"repo_name": "googleads/google-ads-python",
"id": "54540293cfe240d8ac8d964e7fbb09b044d08441",
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.proto import caffe2_pb2
def gen_do_gradient(op, g_output):
"""
Generates gradient Do operator, given forward Do op and a list
of gradient blobs ... | {
"content_hash": "3b7ffca34fa01c420ca9677908caa29f",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 84,
"avg_line_length": 40.73695198329854,
"alnum_prop": 0.6330651360631374,
"repo_name": "pietern/caffe2",
"id": "3efbf86869c961c8dd2dbf16e8bf121775024e71",
"size": "20253... |
import time
import unittest
import config
import mle
import node
LEADER = 1
ROUTER = 2
SNIFFER = 3
class Cert_5_1_13_RouterReset(unittest.TestCase):
def setUp(self):
self.nodes = {}
for i in range(1, 3):
self.nodes[i] = node.Node(i)
self.nodes[LEADER].set_panid(0xface)
... | {
"content_hash": "1efb75faf85178e762c0add398cdbf02",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 111,
"avg_line_length": 36.784,
"alnum_prop": 0.6718138321009134,
"repo_name": "GiedriusM/openthread",
"id": "b9e3743a4f5707257bfb5761c4772ca73dd66cdb",
"size": "6198",
... |
from nltk.stem import SnowballStemmer
import nltk
#Creates tokens
def makeTokensList(text):
tokens=nltk.word_tokenize(text)
return tokens
#Gets tokens stems
def appendTokensStem(tokensList):
#To get stem associated to word
stemmedTokens=[]
stemmer=SnowballStemmer("spanish")
#To count tokens an... | {
"content_hash": "fa9355583aca281771ca9713ad560322",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 23.10810810810811,
"alnum_prop": 0.6362573099415205,
"repo_name": "CesarCardam/CesarCardam.github.io",
"id": "e6ec368f0dd0df1e17bb2e6b9973e32ff344f92e"... |
"""
tests for default credential manager using gitconfig
"""
import os
import unittest
import tempfile
from cirrus.plugins.creds.default import Default
from cirrus._2to3 import ConfigParser
class DefaultCredsTests(unittest.TestCase):
"""
test default plugin gitconfig access
"""
def setUp(self):
... | {
"content_hash": "cacff8bcf3a6c2bea12f68ee5d0115ed",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 67,
"avg_line_length": 30.897959183673468,
"alnum_prop": 0.6274768824306473,
"repo_name": "evansde77/cirrus",
"id": "33de35248b96be4e0051f16ac9456f11e355c64a",
"size": "153... |
import os
def numCPUs():
if not hasattr(os, 'sysconf'):
raise RuntimeError('No sysconf detected.')
return os.sysconf('SC_NPROCESSORS_ONLN')
bind = '0.0.0.0:8001'
workers = 4
# backlog = 2048
# worker_class = 'sync'
worker_class = 'gevent'
debug = True
daemon = True
pidfile = '/tmp/gunicorn.pid'
logfi... | {
"content_hash": "7000173c0e557e9f11a7ab7a4d4a12e3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 50,
"avg_line_length": 20.473684210526315,
"alnum_prop": 0.6735218508997429,
"repo_name": "8thmatyr/evnt-web",
"id": "cc664ea3d4b7d2628c64a0a4e85cc5a5a407db99",
"size": "41... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('movielists', '0022_auto_20150422_1227'),
]
operations = [
migrations.AddField(
model_name='movie',
name='total_rating',
... | {
"content_hash": "08acec4e1f7ba4c2c886f4a0d63e7b27",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 50,
"avg_line_length": 22,
"alnum_prop": 0.5909090909090909,
"repo_name": "kiriakosv/movie-recommendator",
"id": "bbab7dabf6105623948d7f3be957121923ff7e00",
"size": "442",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'AnswerGroup.answer'
db.delete_column(u'questionnaire_answergroup', 'answer_id')
# Adding M2M table for fi... | {
"content_hash": "9fe0f642dda39a0c1b6987f7f51690a5",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 188,
"avg_line_length": 79.49532710280374,
"alnum_prop": 0.5694215847636962,
"repo_name": "testvidya11/ejrf",
"id": "27801d86da2e3b435b4dad9efb3cfac797e98d31",
"size": "17... |
"""
Webhook endpoint for Senlin v1 ReST API.
"""
from webob import exc
from senlin.api.common import util
from senlin.api.common import wsgi
from senlin.common import consts
from senlin.common.i18n import _
from senlin.common import utils
class ReceiverData(object):
"""The data accompanying a POST request to cr... | {
"content_hash": "d86f0f0b51286946b1d4081038a44bcf",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 35.18333333333333,
"alnum_prop": 0.571293225959261,
"repo_name": "tengqm/senlin-container",
"id": "581f567d663fc912e1e98bfc031212e0a6bbef8b",
"size"... |
"""A Network is a composition of Layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os
import weakref
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.keras imp... | {
"content_hash": "7554cbf5810dc697de52cd8ef2554304",
"timestamp": "",
"source": "github",
"line_count": 1013,
"max_line_length": 80,
"avg_line_length": 42.91806515301086,
"alnum_prop": 0.6677937252737143,
"repo_name": "ghchinoy/tensorflow",
"id": "363e2191c3dfd5cf19b938dbf5d13e2cd4e55cdf",
"size": ... |
"""
This is an example dag for using the WinRMOperator.
"""
from __future__ import annotations
# --------------------------------------------------------------------------------
# Load The Dependencies
# --------------------------------------------------------------------------------
import os
from datetime import dat... | {
"content_hash": "1d3b519e9b5a4a9534091a52cf00fd51",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 93,
"avg_line_length": 33.292307692307695,
"alnum_prop": 0.6058225508317929,
"repo_name": "apache/airflow",
"id": "85e64caed1d6f599a8a4fc452968202e40cdfe9e",
"size": "2951"... |
from sqlalchemy import text
from yuuhpizzakebab import db
def get_toppings():
result = db.engine.execute('select * from Topping')
toppings = []
for r in result:
toppings.append(Topping(r[0], r[1], r[2]))
return toppings
def get_topping(id):
t = text('select * from Topping where id = :t... | {
"content_hash": "4def8a06b9a179864479205ac95e9877",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 81,
"avg_line_length": 22.802325581395348,
"alnum_prop": 0.5879653238143804,
"repo_name": "lex/yuuh-pizza-kebab",
"id": "931a80beabe13d7fe3527e03e9e23d587aea7a5e",
"size": ... |
"""Copies AWS EBS snapshots into AWS S3."""
import threading
import time
from typing import Any, Optional, Type, List
import boto3
from libcloudforensics.providers.aws import forensics
from libcloudforensics.providers.aws.internal import account
from libcloudforensics.errors import ResourceCreationError
from dftimewo... | {
"content_hash": "5190e2fddb7f50385e3346f488829ab1",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 78,
"avg_line_length": 33.48557692307692,
"alnum_prop": 0.6811198851399857,
"repo_name": "Onager/dftimewolf",
"id": "cd2e88174776b9ce385a852346bf791eb2094295",
"size": "69... |
"""
Support for showing random numbers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.random/
"""
import asyncio
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor i... | {
"content_hash": "4d3fab926109e9c1b0fd88bc065a51d1",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 29.246913580246915,
"alnum_prop": 0.6821443647108485,
"repo_name": "ct-23/home-assistant",
"id": "b908324521886adcaf12b57036bbbc3452f28058",
"size": ... |
import urllib2
from threading import Thread,Lock
from Queue import Queue
import time
from BeautifulSoup import BeautifulSoup
class Fetcher:
def __init__(self,threads):
self.opener = urllib2.build_opener(urllib2.HTTPHandler)
self.lock = Lock() #线程锁
self.q_req = Queue() #任务队列
self.q... | {
"content_hash": "9cfa601f2c0cc4163d4a035c03544059",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 78,
"avg_line_length": 26.797101449275363,
"alnum_prop": 0.5251487290427258,
"repo_name": "Guzi219/Python",
"id": "3d83c5c7b56a77757652b05cf017b7cd18646811",
"size": "1944"... |
"""
A script to export Flocker log files and system information.
"""
from gzip import open as gzip_open
import os
from platform import dist as platform_dist
import re
from shutil import copyfileobj, make_archive, rmtree
from socket import gethostname
from subprocess import check_call, check_output
from uuid import uui... | {
"content_hash": "9d8fa5db72db8d928d1014d343b64557",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 78,
"avg_line_length": 32.65408805031446,
"alnum_prop": 0.5792565485362096,
"repo_name": "wallnerryan/flocker-profiles",
"id": "0170ef9f96b4ced6aa087011548c305bf5d648ab",
... |
'''Recipes for more efficient work with linalg using classes
intended for use for multivariate normal and linear regression
calculations
x is the data (nobs, nvars)
m is the moment matrix (x'x) or a covariance matrix Sigma
examples:
x'sigma^{-1}x
z = Px where P=Sigma^{-1/2} or P=Sigma^{1/2}
Initially assume po... | {
"content_hash": "2b24c08916b8b15298da87bb2b6220fe",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 80,
"avg_line_length": 26.864864864864863,
"alnum_prop": 0.6134585289514867,
"repo_name": "wesm/statsmodels",
"id": "ff1b7bc3395a905beb77ca279455757614c9c403",
"size": "89... |
import json
import os
from flask import current_app as app
from werkzeug.utils import secure_filename
from app import get_db, s3_client
@app.context_processor
def get_furnitures():
def _get_furnitures():
return list(get_db().furnitures.find({}, {"_id": False}))
return dict(get_furnitures=_get_furni... | {
"content_hash": "27c5dc42d3d8384c6e8e75f9ab21d8b9",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 135,
"avg_line_length": 23.694736842105264,
"alnum_prop": 0.6246112838738338,
"repo_name": "ForumOrganisation/forumorg",
"id": "01d692a856a930b9e1b364f706e046c80c47eede",
"... |
from django.core.urlresolvers import reverse
from django import http
from mox import IsA # noqa
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
class HypervisorViewTest(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('extension_supported',
... | {
"content_hash": "3b8c7d327360d036ae839eaaeedc9c45",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 45.851351351351354,
"alnum_prop": 0.632773356911288,
"repo_name": "nvoron23/avos",
"id": "a854405fbf25999264744f19384f77b37cba0a07",
"size": "4001",
... |
from unittest import TestCase
from wtforms.compat import text_type
from wtforms.validators import (
StopValidation, ValidationError, email, equal_to,
ip_address, length, required, optional, regexp,
url, NumberRange, AnyOf, NoneOf, mac_address, UUID,
input_required, data_required
)
from functools import ... | {
"content_hash": "060c3b32928971220add46eba523ce88",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 124,
"avg_line_length": 53.35245901639344,
"alnum_prop": 0.6468735596865878,
"repo_name": "jmagnusson/wtforms",
"id": "216705037138db45b8ebc78e2eb5167947916a88",
"size": "... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('imagr', '0006_auto_20141111_1324'),
]
operations = [
migrations.AlterField(
model_... | {
"content_hash": "067f9e72854dc996f04d7ee6863e7b54",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 141,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.6363636363636364,
"repo_name": "miracode/django-imagr",
"id": "6c1fb2c534bbd68cc4b40a24b99e805db11a4515",
"size"... |
import collections
import ctypes
from unittest import mock
import ddt
import six
from os_win import _utils
from os_win import constants
from os_win import exceptions
from os_win.tests.unit import test_base
from os_win.utils.storage.initiator import iscsi_utils
from os_win.utils.winapi import constants as w_const
from... | {
"content_hash": "c6fe025f02fd11955119dad9551699bc",
"timestamp": "",
"source": "github",
"line_count": 833,
"max_line_length": 79,
"avg_line_length": 43.6062424969988,
"alnum_prop": 0.5985574275960798,
"repo_name": "openstack/os-win",
"id": "31c25146797a8294bb4871db29737ea690af918b",
"size": "3696... |
"""
Support for Xiaomi Mi Temp BLE environmental sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mitemp_bt/
"""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers... | {
"content_hash": "374751023a6e56991902fd29e0166789",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 79,
"avg_line_length": 32.45348837209303,
"alnum_prop": 0.6377642422070943,
"repo_name": "tinloaf/home-assistant",
"id": "15e225fd2c0eda9948ac71c65172246b43ebdc3d",
"size"... |
from __future__ import unicode_literals
import webnotes
import webnotes.widgets.query_builder
from webnotes.utils import cstr
from startup.query_handlers import standard_queries
# this is called when a new doctype is setup for search - to set the filters
@webnotes.whitelist()
def getsearchfields():
sf = webnotes.conn... | {
"content_hash": "0bb474369928d154731ee6a3a3a9fa7e",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 198,
"avg_line_length": 34.54430379746835,
"alnum_prop": 0.6504213997801392,
"repo_name": "gangadhar-kadam/mtn-wnframework",
"id": "34907a788312c993f54a3424212140f730c8d37f"... |
"""Beam fn API log handler."""
# pytype: skip-file
# mypy: disallow-untyped-defs
import logging
import math
import queue
import sys
import threading
import time
import traceback
from typing import TYPE_CHECKING
from typing import Iterable
from typing import Iterator
from typing import List
from typing import Union
fr... | {
"content_hash": "10ecc54476c1d2efca8a128f7458a45d",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 80,
"avg_line_length": 36.60621761658031,
"alnum_prop": 0.6767162066525124,
"repo_name": "robertwb/incubator-beam",
"id": "75cdcf5fb85ffb57ae9de4bde0076ec1fa4cc80b",
"size... |
from allthepairs.all_pairs2 import all_pairs2 as all_pairs
"""
Demo of filtering capabilities
"""
# sample parameters are is taken from
# http://www.stsc.hill.af.mil/consulting/sw_testing/improvement/cst.html
parameters = [ [ "Brand X", "Brand Y" ]
, [ "98", "NT", "2000", "XP"]
, [ "Intern... | {
"content_hash": "f138ff3fe97066c67ab8669676c67f28",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 72,
"avg_line_length": 28.434782608695652,
"alnum_prop": 0.5756880733944955,
"repo_name": "devalbo/allthepairs",
"id": "2db2e603282c30c7f992865433226551c4c8ad92",
"size": "... |
"""Implement a hash table of a given size"""
class HashTable(object):
def __init__(self, size):
if int(size) != size:
raise TypeError(u"size must be an integer")
self.size = size
self.hlist = []
for i in range(size):
self.hlist.append([])
def get(self,... | {
"content_hash": "f0f57f7088cb23a3a3c13a32a5c69176",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 55,
"avg_line_length": 25.9375,
"alnum_prop": 0.5144578313253012,
"repo_name": "miracode/data-structures",
"id": "d673c0c5cfbbd3f3ab7790bc1a87311a780371a6",
"size": "830",
... |
import requests
SCHEMAS_BASE_PATH='./schemas/'
#: runtime schema cache to avoid net/disk I/O
SCHEMAS = {}
def do_get_schema(endpoint, name):
'''
Download and cache schema ``name`` in memory.
'''
if name in SCHEMAS:
return SCHEMAS['name']
url = endpoint+name
print "Downloading schema"... | {
"content_hash": "fc130cf4b448419f8814a42f4beb159c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 25.033333333333335,
"alnum_prop": 0.62982689747004,
"repo_name": "yadutaf/ovh-cli",
"id": "0ec22dc4655114df6bac604aff9b6920b981b9f3",
"size": "778",
... |
"""
Copyright (c) 2009 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | {
"content_hash": "271f91e7380cd71cef5554d606b98695",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 74,
"avg_line_length": 25.894039735099337,
"alnum_prop": 0.669309462915601,
"repo_name": "sushi-irc/tekka",
"id": "6b1c772202da12a0329f1c356eb91029e8551622",
"size": "7820... |
"""
RFB protocol implementattion, client side.
Override RFBClient and RFBFactory in your application.
See vncviewer.py for an example.
Reference:
http://www.realvnc.com/docs/rfbproto.pdf
(C) 2003 cliechti@gmx.net
MIT License
"""
import sys
import math
from struct import pack, unpack
import pyDes
from twisted.pytho... | {
"content_hash": "c7fbe20a78fa1c74ebdd487408a1c59f",
"timestamp": "",
"source": "github",
"line_count": 683,
"max_line_length": 154,
"avg_line_length": 36.58565153733529,
"alnum_prop": 0.5641107731711221,
"repo_name": "f0r34chb3t4/vncdotool",
"id": "3709c187e19caf7da1d1d9ad91573b05b32522f5",
"size"... |
from __future__ import print_function
import sys
from pycoin.tx import Tx
from pycoin.tx.script.tools import disassemble
def main():
tx = Tx.tx_from_hex(sys.argv[1])
print('Input Scripts:')
for inp in tx.txs_in:
print(' - ' + disassemble(inp.script))
print('Output Scripts:')
for out in tx.... | {
"content_hash": "778817299771ba2884ee5fcfbadd3daa",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 46,
"avg_line_length": 24.41176470588235,
"alnum_prop": 0.6168674698795181,
"repo_name": "bit-oasis/multisig-core",
"id": "d9538b4a56978621197577ca7a375af3e605bb54",
"size"... |
from django import forms
from meadery.models import Product
from inventory.models import Warehouse, Row, Shelf, Bin, Crate, Jar
class WarehouseAdminForm(forms.ModelForm):
class Meta:
model = Warehouse
exclude = ["slug"]
class RowAdminForm(forms.ModelForm):
warehouse = forms.ModelChoiceField(... | {
"content_hash": "a90782e4664dbc01511b6336319750a0",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 67,
"avg_line_length": 21.693877551020407,
"alnum_prop": 0.6688617121354656,
"repo_name": "mathuin/pyment",
"id": "48fa4863d037de15ba5c7577d6d9d6a2c1c8abea",
"size": "1063"... |
''' Incremental-Classifier Learning
Authors : Khurram Javed, Muhammad Talha Paracha
Maintainer : Khurram Javed
Lab : TUKL-SEECS R&D Lab
Email : 14besekjaved@seecs.edu.pk '''
import matplotlib
import matplotlib.pyplot as plt
plt.switch_backend('agg')
MEDIUM_SIZE = 18
font = {'family': 'sans-serif',
'wei... | {
"content_hash": "e5a138f3672e720828c4920b66829fa7",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 114,
"avg_line_length": 32.75,
"alnum_prop": 0.5857043719639139,
"repo_name": "Khurramjaved96/Recursive-CNNs",
"id": "9aff5238fc545dc436a2ab25c8dfb7e66600d023",
"size": "28... |
"""Classes supporting unit and lesson editing."""
__author__ = 'John Orr (jorr@google.com)'
import cgi
import logging
import random
import urllib
import messages
import yaml
from common import safe_dom
from common import tags
from common import utils as common_utils
from common.schema_fields import FieldArray
from ... | {
"content_hash": "26fbed808849448cd7cf1896d8dc158e",
"timestamp": "",
"source": "github",
"line_count": 1814,
"max_line_length": 80,
"avg_line_length": 39.428886438809265,
"alnum_prop": 0.5700324366646161,
"repo_name": "wavemind/mlgcb",
"id": "093918a4fa8ab77f42a66b856a0c0feae1fbba77",
"size": "721... |
"""
A reactor for integrating with U{CFRunLoop<http://bit.ly/cfrunloop>}, the
CoreFoundation main loop used by MacOS X.
This is useful for integrating Twisted with U{PyObjC<http://pyobjc.sf.net/>}
applications.
"""
__all__ = [
'install',
'CFReactor'
]
import sys
from zope.interface import i... | {
"content_hash": "1f152da6fb5f85932bbfacc609d091c2",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 79,
"avg_line_length": 35.74096385542169,
"alnum_prop": 0.5991909657845946,
"repo_name": "timkrentz/SunTracker",
"id": "490e6e70bf4644edc2f6ccafa2798f9991f3817d",
"size": ... |
"""
COCO Keypoints 2016 process functions.
"""
from __future__ import print_function, division
import os
from collections import OrderedDict
import numpy as np
import progressbar
from dbcollection.datasets import BaseTask
from dbcollection.utils.string_ascii import convert_str_to_ascii as str2ascii
from dbcollection... | {
"content_hash": "ee97e7c075f9133bb208311a8a456cca",
"timestamp": "",
"source": "github",
"line_count": 514,
"max_line_length": 100,
"avg_line_length": 39.87743190661479,
"alnum_prop": 0.4968044104015222,
"repo_name": "farrajota/dbcollection",
"id": "4a48ebe82db260adcb7e8820fe798a1ef97a6fb0",
"size... |
from org.myrobotlab.image import Util
# start a opencv service
opencv = Runtime.start("opencv","OpenCV")
#gui.setActiveTab("opencv")
# add python as a listener to OpenCV data
# this tells the framework - whenever opencv.publishOpenCVData is invoked
# python.onOpenCVData will get called
python = Runtime.start("python"... | {
"content_hash": "d249d4a0a7a39d9ef1986ad4e9f8f3d5",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 82,
"avg_line_length": 27.988636363636363,
"alnum_prop": 0.7401542833942347,
"repo_name": "MyRobotLab/pyrobotlab",
"id": "834922ae5140f6aa57b17c54841c1d84d46aa301",
"size":... |
"""
Test SBType for ObjC classes.
"""
from __future__ import print_function
import os
import time
import re
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ObjCSBTypeTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)... | {
"content_hash": "05603acfc6d86d099320833a39341eb2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 31.93243243243243,
"alnum_prop": 0.6326703343207787,
"repo_name": "youtube/cobalt_sandbox",
"id": "fd3bfa858e1253c840259a013d2d29d1def19ed2",
"size":... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0004_product_status'),
]
operations = [
migrations.AlterField(
model_name='product',
name='status',
fiel... | {
"content_hash": "6c9c260614de7627655c837ff08b43f0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 67,
"avg_line_length": 22.31578947368421,
"alnum_prop": 0.5872641509433962,
"repo_name": "vitorfs/sea-serpent",
"id": "b0ea1df7fdcce0b76b091d822d37ddcc3e73bcf0",
"size": "4... |
import math
def make(filename):
file = open(filename, "r")
linenum = 0
verts = 0
edges = 0
graph = None
for line in file:
# print ("line " + line)
values = line.split("\t")
# print ("values " + str(values))
# strip the wack n if present
... | {
"content_hash": "cbaa35d3efe0d0136f5a07e93234119f",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 106,
"avg_line_length": 29.818181818181817,
"alnum_prop": 0.45454545454545453,
"repo_name": "jeremy24/494-graph-algos",
"id": "7a6ce82b1d18736ccb5d2f10bd7b784f01c075a5",
"... |
import sys
import logging
from io import BytesIO
from casacore.measures import measures
from tkp.utility.coordinates import unix2julian
from tkp.utility.redirect_stream import redirect_stream
logger = logging.getLogger(__name__)
targets = { 'CasA': {'ra' : 6.123487680622104, 'dec' : 1.0265153995604648},
... | {
"content_hash": "8b310ea2fedd00fcccda1b62606931b1",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 38.97530864197531,
"alnum_prop": 0.6430155210643016,
"repo_name": "transientskp/tkp",
"id": "cf46ccda12242a85365a14c9c5bba24a33aad53c",
"size": "3157... |
"""Tests for ceilometer/publisher/messaging.py
"""
import datetime
import eventlet
import mock
from oslo.config import fixture as fixture_config
import oslo.messaging
import oslo.messaging._drivers.common
from oslo.utils import netutils
import testscenarios.testcase
from ceilometer import messaging
from ceilometer.op... | {
"content_hash": "bacf1c1f287feaa2125a631633d38b90",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 79,
"avg_line_length": 40.78260869565217,
"alnum_prop": 0.562544420753376,
"repo_name": "luogangyi/Ceilometer-oVirt",
"id": "7eecca6054783aaf8176a6fed68dc4eb699aa662",
"si... |
import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self,
plotly_name="value",
parent_name="sunburst.marker.colorbar.tickformatstop",
**kwargs,
):
super(ValueValidator, self).__init__(
plotly_... | {
"content_hash": "7a2e4eb7c15d74523d3ac29bb6c38144",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 67,
"avg_line_length": 29.1875,
"alnum_prop": 0.588865096359743,
"repo_name": "plotly/plotly.py",
"id": "44239fd2d5992347f51d6c71b0fe7726de6409b8",
"size": "467",
"binary... |
from setuptools import setup, find_packages
from codecs import open
from os import path, environ
import sys
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'docs/description.rst'), encoding='utf-8') as f:
long_description = f.read()
with... | {
"content_hash": "4969effa1132ba9ed318836f19e01bb8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 82,
"avg_line_length": 32.56043956043956,
"alnum_prop": 0.6483293958825515,
"repo_name": "mzbenami/pyeapi",
"id": "3048963bbc28bdf87a1228a9571e1e4761b3f0f5",
"size": "2963"... |
from setuptools import setup, find_packages
from RPi import __author__, __version__, __license__
setup(
name='RPi',
version=__version__,
description='RPi.GPIO emulator',
license=__license__,
author=__author__,
author_email='nosix@funmake.jp',
url='http://nosix.github.io/raspberry-gpio-emul... | {
"content_hash": "3755fff9bb3692c438772bed59c886c4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 27.25,
"alnum_prop": 0.658256880733945,
"repo_name": "nosix/raspberry-gpio-emulator",
"id": "c6e82d2ce04667ed0574c267f02f86fddf71b084",
"size": "436"... |
"""
vcoptparse is short for Value-Centric Option Parser. It's a tiny argument parsing library. It has
less features than optparse or argparse, but it kicks more ass.
optparse and argparse allow the client to specify the flags that should be parsed, and as an
afterthought specify what keys should appear in the options ... | {
"content_hash": "9c990fc805e2643e3fefc0a62b70ca6a",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 126,
"avg_line_length": 34.02768166089965,
"alnum_prop": 0.5840959934919666,
"repo_name": "robertjpayne/rethinkdb",
"id": "c1b7eb5f18bf50f7e157cea4e8f9177ef3abbbfa",
"size... |
import datetime
import decimal
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils.translation import ugettext_lazy as _
import random
from ..pricing import Price
from ..product.models import Variant
from ..util import countri... | {
"content_hash": "586a8d9eb21d5876b24b6f79090f9003",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 83,
"avg_line_length": 43.83743842364532,
"alnum_prop": 0.5624227441285538,
"repo_name": "fusionbox/satchless",
"id": "a1856ff7a0c3c967fb6a406256cef452334d0162",
"size": "... |
import string
import types
import cStringIO
## json.py implements a JSON (http://json.org) reader and writer.
## Copyright (C) 2005-2007 Patrick D. Logan, Ville H. Tuulos
## Contact mailto:patrickdlogan@stardecisions.com
##
## Slightly modified by Ville H. Tuulos for PyS60
##
## This library is free so... | {
"content_hash": "377fb25e61156938006966c735285f52",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 136,
"avg_line_length": 33.98066298342541,
"alnum_prop": 0.4806926266157223,
"repo_name": "yonggang985/Sniper",
"id": "b0977d717f0cac0b5eda5f30f47eb4b7478c70dc",
"size": "... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "cd10ca6726263e2cd24f3538e1e7f2ac",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 137,
"avg_line_length": 30.497584541062803,
"alnum_prop": 0.7110723903057183,
"repo_name": "atopuzov/nitro-python",
"id": "29d6026ec9e5b5f7a87f856eedda40b89e2a56ae",
"size... |
class Shell(object):
"""Represents an abstract Mojo shell."""
def ServeLocalDirectory(self, local_dir_path, port=0,
additional_mappings=None):
"""Serves the content of the local (host) directory, making it available to
the shell under the url returned by the function.
The ser... | {
"content_hash": "f2985fa143c5e65b3c00bff789b17506",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 80,
"avg_line_length": 35.5,
"alnum_prop": 0.6901408450704225,
"repo_name": "chinmaygarde/mojo",
"id": "bb22ea41ca90917ed2a6054f78376a55bc6d6835",
"size": "2081",
"binary... |
from django import temlpate
from datetime import date, timedelta
register = template.Library()
@register.filter
def to_class_name(value):
return value.__class__.__name__
| {
"content_hash": "de8dbd4cbcb794b8336cf92d18670281",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 36,
"avg_line_length": 21.625,
"alnum_prop": 0.7572254335260116,
"repo_name": "per7inac1ousQ/Directories",
"id": "8f100ca9d235481648efdcdcc1efc29a195f0089",
"size": "173",
... |
import time;
from time import strftime;
import urllib2;
import sys;
#prettyfull welcome message
print("***Welcome to LegendCraft HeartbeatSaver***\n");
print("...:: This program is designed to send ::...\n ....:: a Heartbeat to ClassiCube.net! ::.... \n");
print(".::.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.::.\n");
#var... | {
"content_hash": "8ed6b48e0631027b65a1fcd51072b491",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 320,
"avg_line_length": 35.476190476190474,
"alnum_prop": 0.6089485458612975,
"repo_name": "LeChosenOne/LegendCraft",
"id": "19d6b8db77c771c1f38dd08dd84bf7ed1037515d",
"siz... |
from __future__ import unicode_literals
import datetime
import os
from decimal import Decimal
from unittest import skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from djang... | {
"content_hash": "dd899fe53becf62f6f79873c8e55b268",
"timestamp": "",
"source": "github",
"line_count": 2827,
"max_line_length": 120,
"avg_line_length": 40.77325787053414,
"alnum_prop": 0.5962989953672375,
"repo_name": "Endika/django",
"id": "a2e7c664192c505848e302185fde72c885a55ba3",
"size": "1152... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 0); | {
"content_hash": "559fef244ca36f25c7e5075119932c8d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 165,
"avg_line_length": 37.857142857142854,
"alnum_prop": 0.7056603773584905,
"repo_name": "antoinecarme/pyaf",
"id": "7d8b2e93827c5fe3fb08a1513dd2b3de139a7366",
"size": "26... |
import os
import GafferUI
bookmarks = GafferUI.Bookmarks.acquire( application )
bookmarks.setDefault( os.getcwd() )
bookmarks.add( "Home", os.path.expandvars( "$HOME" ) )
bookmarks.add( "Desktop", os.path.expandvars( "$HOME/Desktop" ) )
fontBookmarks = GafferUI.Bookmarks.acquire( application, category="font" )
fontB... | {
"content_hash": "2d59261f00c8e26b30e452eb6835584b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 38.21739130434783,
"alnum_prop": 0.7656427758816837,
"repo_name": "chippey/gaffer",
"id": "e999092be3749204a8f88127039d21dedd9ae161",
"size": "2682",... |
"""First simple sklearn classifier"""
from __future__ import division # 1/2 == 0.5, as in Py3
from __future__ import absolute_import # avoid hiding global modules with locals
from __future__ import print_function # force use of print("hello")
from __future__ import unicode_literals # force unadorned strings "" to b... | {
"content_hash": "dd8025788cac8c22d65a1860a72d7061",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 111,
"avg_line_length": 49.092592592592595,
"alnum_prop": 0.6529611467370804,
"repo_name": "ianozsvald/social_media_brand_disambiguator",
"id": "ae2c2cff993a55bd7984b0a26d6c8... |
from __future__ import unicode_literals
from __future__ import print_function
from ...command import SubCommand
from ...wsgi import WSGIApplication
from ...console import Cell
import sys
class Libs(SubCommand):
"""List libraries installed in the project"""
help = "get library information"
def add_argu... | {
"content_hash": "0dd12027d827b5fbb73d6938b015d1da",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 86,
"avg_line_length": 28.885057471264368,
"alnum_prop": 0.4998010346199761,
"repo_name": "moyaproject/moya",
"id": "d4c04946ddec82b20b426d547a7f019e73314408",
"size": "251... |
"""backend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | {
"content_hash": "5e2cec616ac5091cd11a033cfb0d83de",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 79,
"avg_line_length": 39.96296296296296,
"alnum_prop": 0.6746987951807228,
"repo_name": "krayevidi/IBANapp",
"id": "960391b616df3bc9c5b2053d04603ad616202792",
"size": "107... |
"""
Coin Toss Odds Ratio
--------------------
Figure 5.1
Odds ratio for two models, :math:`O_{21}`, describing coin tosses (eq. 5.26).
Out of N tosses (left: N = 10; right: N = 20), k tosses are heads. Model 2 is
a one-parameter model with the heads probability determined from data
(:math:`b^0 = k/N`), and model 1 cla... | {
"content_hash": "25e2db5c3159642a544fc35e9c7484ce",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 34.25609756097561,
"alnum_prop": 0.6169455322178711,
"repo_name": "nhuntwalker/astroML",
"id": "701ba2849796d9e6132d1a7b9ec07ff5c0537335",
"size": "2... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import matplotlib
matplotlib.use('Agg')
from matplotlib import pyplot as plt
import numpy as np
import tensorflow as tf
def _plot_item(W, name, full_name, nspaces):
plt.figure()
if W.shape == ():
print... | {
"content_hash": "f7bdaf7d52487b94cff131e23b5a9934",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 79,
"avg_line_length": 35.89903846153846,
"alnum_prop": 0.6215347529128163,
"repo_name": "unnikrishnankgs/va",
"id": "b4ebba9f489b38de4b4f1dd69bcae45206c9fbf6",
"size": "8... |
from django.conf.urls import patterns, include, url
from employee import views
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'hrms.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.dashboard.as_view(), name='dashboard'),
url(r'^requisition$', vie... | {
"content_hash": "e4fdc6e027d5da6c6ff1bf2dab35ad41",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 45.375,
"alnum_prop": 0.6363636363636364,
"repo_name": "vjega/pyhrms",
"id": "17b1e928b7b2a9f93f8b8da900a409279c15837e",
"size": "726",
"binary": f... |
from django.contrib import admin
from servicerating.models import (
Contact, Conversation, Response, UserAccount, Extra)
from control.actions import export_select_fields_csv_action
class ContactAdmin(admin.ModelAdmin):
actions = [export_select_fields_csv_action(
"Export selected objects as CSV file",
... | {
"content_hash": "a3a54b49cb99cab82d6220c7f9ca2065",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 59,
"avg_line_length": 28.3768115942029,
"alnum_prop": 0.54902962206333,
"repo_name": "praekelt/ndoh-control",
"id": "e6c2847d852031e079bedd7999d089bde4bef853",
"size": "19... |
def get_lastday_visit_voluem():
pass
def get_last7day_visit_tendency_img():
pass | {
"content_hash": "44faf7abd93bd6460dfc1c966475b28a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 15,
"alnum_prop": 0.6888888888888889,
"repo_name": "lwz7512/logtoeye",
"id": "3d42268e4d6169af3442e4b7fa6af757ee705afe",
"size": "141",
"binary": fa... |
"""
Temporal propagation of the component: Take a component at birth time
(time 0) and propagate it for its age t to the current position.
trace_epicyclic_orbit traces a 6D point
trace_epicyclic_covmatrix traces covariance matrix
"""
import numpy as np
def convert_cart2curvilin(data, ro=8., vo=220.):
"""
C... | {
"content_hash": "4fbcbc0715bcb6fcc714f3e9594b2938",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 149,
"avg_line_length": 31.505567928730514,
"alnum_prop": 0.6117630425561996,
"repo_name": "mikeireland/chronostar",
"id": "0de4d9bd0a1e91696ec7d3f7449c5a0a4be23450",
"siz... |
import abc
import os
import uuid
from oslo_config import cfg
import six
from sahara import conductor as c
from sahara import context
from sahara.service.edp import base_engine
from sahara.service.edp.binary_retrievers import dispatch
from sahara.service.edp import hdfs_helper as h
from sahara.service.edp import job_u... | {
"content_hash": "f200533dfd54ec0abe0d8687c495d139",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 79,
"avg_line_length": 40.334426229508196,
"alnum_prop": 0.5645423508372622,
"repo_name": "zhangjunli177/sahara",
"id": "fa8f7d487e721238b5314881a79ff1337d8ee466",
"size":... |
"""Test mempool re-org scenarios.
Test re-org scenarios with a mempool that contains transactions
that spend (directly or indirectly) coinbase transactions.
"""
from test_framework.blocktools import create_raw_transaction
from test_framework.test_framework import BitSendTestFramework
from test_framework.util import a... | {
"content_hash": "43a36b5fb031ca466b32f831c3e6025c",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 109,
"avg_line_length": 45.149532710280376,
"alnum_prop": 0.6472779962740633,
"repo_name": "LIMXTEC/BitSend",
"id": "81afebd1adb32d0c6a9574f68ba55bb98822a444",
"size": "50... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8444")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| {
"content_hash": "1d6ea472c8f9a5e496ae93ea36ec7c54",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 46,
"avg_line_length": 39.5,
"alnum_prop": 0.759493670886076,
"repo_name": "scificrypto/Darsek",
"id": "da9355c52974af006fdaef84eb4fb0f410ee3fbf",
"size": "158",
"binary":... |
"""GeoJSON source for VTEC event"""
import json
import datetime
from pymemcache.client import Client
import psycopg2.extras
from paste.request import parse_formvars
from pyiem.util import get_dbconn, html_escape
ISO = "%Y-%m-%dT%H:%M:%SZ"
def run_lsrs(wfo, year, phenomena, significance, etn, sbw):
"""Do great t... | {
"content_hash": "3bfea499b6e5b036710d04353263fbfa",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 79,
"avg_line_length": 30.63819095477387,
"alnum_prop": 0.5282926029194686,
"repo_name": "akrherz/iem",
"id": "86cacf2fca3c909d724edb29904b294db8ccde55",
"size": "6097",
... |
from robotide.version import VERSION
import docutils.core
docutils.core.publish_file(
source_path="../doc/releasenotes/ride-"+".".join([str(x) for x in VERSION.split('.')[:2]]).replace('v','')+".rst",
destination_path="../src/robotide/application/release_notes.html",
writer_name="html")
# Replace { by &#... | {
"content_hash": "9edfb77dadc26588cd4843ed9948bfa9",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 118,
"avg_line_length": 35,
"alnum_prop": 0.6819047619047619,
"repo_name": "robotframework/RIDE",
"id": "091b943fe1bd537f602ae45f8f16cbfb07b97740",
"size": "1050",
"binar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.