text stringlengths 4 1.02M | meta dict |
|---|---|
import sub1.file1
# Alternative
#from sub1 import file1
def main():
print('/top')
sub1.file1.foo()
main()
| {
"content_hash": "46a08a4bea727b01a52431d971f4fd31",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 23,
"avg_line_length": 11.7,
"alnum_prop": 0.6495726495726496,
"repo_name": "myriasofo/CLRS_exercises",
"id": "dcaa9a2e364dd082cc8769c636046ad7cf8ca13d",
"size": "117",
"... |
import os
""" IMPORTANT: Not sure how to use this lib? Check out the "example.py" file :) """
Version="0.2"
class Handler:
""" Alfred.Handler, this class is responsible for handling Alfred! """
def __init__(self, args=[], query="", use_no_query_string=True):
""" Create a new handler
Keyword arguments:
args... | {
"content_hash": "1ad964e6b4df8566cd1bd33686c1eaed",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 96,
"avg_line_length": 24.20625,
"alnum_prop": 0.6395558998192615,
"repo_name": "kasoki/hue",
"id": "b384d440108d096e8d3b5de694f16cad1dff7997",
"size": "5056",
"binary":... |
import sys
import mock
from oslo_config import cfg
import testtools
from webob import exc
import webtest
from neutron.api import extensions
from neutron.common import config
from neutron.common import constants
from neutron.common import exceptions
from neutron import context
from neutron.db import quota_db
from neut... | {
"content_hash": "8e8d234b149a946c0348999d47ffc168",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 78,
"avg_line_length": 43.50454545454546,
"alnum_prop": 0.5452930728241563,
"repo_name": "antonioUnina/neutron",
"id": "af87c4a76992005957478c3e1ed383a2602b14d4",
"size": ... |
from django.views.generic import ListView
from django.db.models import Q
from ..professors.models import Professor
class SearchView(ListView):
queryset = Professor.objects.all().order_by('-first_name', 'last_name')
template_name = 'search.html'
def get_context_data(self):
context = super(SearchV... | {
"content_hash": "d4bac24a4ef1ca7413c1a22da4162c5b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 28.413793103448278,
"alnum_prop": 0.6140776699029126,
"repo_name": "Jpadilla1/notaso",
"id": "be8058d17d52fcbef2dd9bd78ac1e9f967be9a83",
"size": "824... |
import sys, 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 configurat... | {
"content_hash": "58e153e2d17307038220bf75af1b716e",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 80,
"avg_line_length": 31.444444444444443,
"alnum_prop": 0.6956082786471479,
"repo_name": "jedisct1/MLVPN",
"id": "d27e431c65f673f8f277dfab499c7e6a03dd6cb5",
"size": "8340... |
"""Controllers for interactive and non-interactive widgets."""
__author__ = 'sll@google.com (Sean Lip)'
import collections
from core.controllers import base
from core.domain import widget_registry
class WidgetRepositoryHandler(base.BaseHandler):
"""Populates the widget repository pages."""
def get(self, w... | {
"content_hash": "bfba089e11e3b27212e77904f75215a4",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 71,
"avg_line_length": 28.150943396226417,
"alnum_prop": 0.6327077747989276,
"repo_name": "openhatch/oh-missions-oppia-beta",
"id": "8040d650c6f799a13e653a100d133a3c9b16a0f9"... |
from flask import Flask, request, render_template, session, flash, redirect, \
url_for, jsonify, make_response
app = Flask(__name__)
@app.route('/')
def index():
import datetime
import io
import random
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotl... | {
"content_hash": "578491a549fe5d50d5d3449131ca6b27",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 25.846153846153847,
"alnum_prop": 0.6527777777777778,
"repo_name": "stepbot/resiliant-trader",
"id": "f7f1b98014f7cd5f0dc9e5daa8005336963e4b7a",
"siz... |
import bot
class Module(bot.Module):
index = "msg"
def register(self):
self.addcommand(self.say, "say", "Send a message to a channel.",
["[-notice]", "channel", "message..."])
self.addcommand(self.do, "do", "Send a /me message to a channel.",
... | {
"content_hash": "23548d9d6eb96833eb11f57a426e1f70",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 36.774193548387096,
"alnum_prop": 0.5666666666666667,
"repo_name": "shacknetisp/vepybot",
"id": "cc9a673c845d771402f8fa57676a0ebb590795d5",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('imager_images', '0002_auto_20170125_0218'),
]
operations = [
migrations.AlterField(
model_name='albums',
name='date_modified... | {
"content_hash": "e934cea187667ccde02251e72bd21765",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 65,
"avg_line_length": 29.46511627906977,
"alnum_prop": 0.5524861878453039,
"repo_name": "AveryPratt/django-imager",
"id": "ea5b034a53fdf9a117ca9edd1e85c6918b051a09",
"size... |
"""Job registries."""
from core.domain import activity_jobs_one_off
from core.domain import collection_jobs_one_off
from core.domain import exp_jobs_one_off
from core.domain import feedback_jobs_one_off
from core.domain import feedback_jobs_continuous
from core.domain import stats_jobs_continuous
from core.domain impo... | {
"content_hash": "a32bc62a5c73e83443cae55c2b26eb11",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 44.84615384615385,
"alnum_prop": 0.7886792452830189,
"repo_name": "terrameijar/oppia",
"id": "24a9813b3cde23d38b836498f4a66046ca53f8d5",
"size": "353... |
from copy import copy
from types import GeneratorType
from unittest import TestCase
try:
from unittest import mock
except:
import mock
from rl.pool import MemoryPool
class MemoryPoolTest(TestCase):
def setUp(self):
self.pool = MemoryPool(5000)
self.test_data = {
0: {
... | {
"content_hash": "666b278c32cfd8680077b4136cfd1a3a",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 88,
"avg_line_length": 32.101010101010104,
"alnum_prop": 0.5412208936438011,
"repo_name": "evan176/rl",
"id": "ab95bb3ea7086000f00cde7a83efb829f1982f6f",
"size": "3224",
... |
from itertools import chain, combinations, permutations
class RankedPairsResult:
def __init__(self, tallies, winners):
self.tallies = tallies
self.winners = winners
def results(responses):
"""
Returns the list of ranked-pairs winners based on responses.
Takes as input a list of ranki... | {
"content_hash": "5a2ddf3d75321b30744bc3c128cc0b64",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 39.01851851851852,
"alnum_prop": 0.5472235405790223,
"repo_name": "ASCIT/donut-python",
"id": "92e60176fca3aa634281667dd047a9d0b1a49cbf",
"size": "21... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import datetime
import logging
from google.appengine.api import datastore_errors
from google.appengine.datastore import datastore_query
from google.appengine.ext import deferred
from dashboard.api import api_... | {
"content_hash": "3028f2412240d7ccf3e8729a258845fb",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 80,
"avg_line_length": 29.246575342465754,
"alnum_prop": 0.7030444964871194,
"repo_name": "endlessm/chromium-browser",
"id": "98fb120fb6106bab74655ad12cb258eba7278926",
"si... |
from __future__ import unicode_literals
import errno
import json
import logging
import os
__author__ = 'Jakub Plichta <jakub.plichta@gmail.com>'
logger = logging.getLogger(__name__)
class DashboardExporter(object):
def process_dashboard(self, project_name, dashboard_name, dashboard_data):
pass
clas... | {
"content_hash": "857c4a8da839d2cd48864e2cbf8d2072",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 101,
"avg_line_length": 35.73529411764706,
"alnum_prop": 0.6353909465020576,
"repo_name": "jakubplichta/grafana-dashboard-builder",
"id": "d01aceb2140c1e6c994a6f7334188db811c... |
"""URLs for the ``task_list`` app."""
from django.conf.urls.defaults import include, patterns, url
urlpatterns = patterns(
'',
url(r'^', include('task_list.urls.simple')),
url(r'^', include('task_list.urls.ctype')),
)
| {
"content_hash": "f1d05a733df303e828a68a2a1a049af8",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 60,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.6336206896551724,
"repo_name": "bitmazk/django-task-list",
"id": "d1a85e5942d708a89ecd052e81c7d6e5f1a8da5f",
"size"... |
from .solver import model
from .dao import localDAO
from .logger import Logger
def irt(data_src,
dao_type='memory',
theta_bnds=[-4, 4], num_theta=11,
alpha_bnds=[0.25, 2], beta_bnds=[-2, 2], in_guess_param={},
model_spec='2PL',
max_iter=10, tol=1e-3, nargout=2,
is_paral... | {
"content_hash": "9eda65d1388dfe1b1d713fc7bd6cf110",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 80,
"avg_line_length": 29.56140350877193,
"alnum_prop": 0.5910979228486647,
"repo_name": "17zuoye/pyirt",
"id": "7bf3fd971e56d0aa0895d0941eaa3ee66d18a832",
"size": "1706",
... |
from simple_graph import Graph
import pytest
DFT_A = [u'A', u'E', u'C', u'G', u'B', u'F', u'D']
BFT_A = [u'A', u'B', u'C', u'E', u'D', u'F', u'G']
@pytest.fixture(scope='function')
def empty_graph():
''' Define an empty graph. '''
return Graph()
@pytest.fixture(scope='function')
def non_empty_graph():
... | {
"content_hash": "dd89999f1f0867b07774a049eb3afc66",
"timestamp": "",
"source": "github",
"line_count": 389,
"max_line_length": 74,
"avg_line_length": 25.704370179948587,
"alnum_prop": 0.6025602560256026,
"repo_name": "constanthatz/data-structures",
"id": "22268f027cdf7add57d87ced3c0f046a775957bc",
... |
import random
def setup_cats(num_cats):
cat_names = ["Fluffles", "Enzo", "Lisa", "Berto", "Jillian", "Amy",
"Bella", "Moe", "Tibby"]
foods = ["vinegar", "vegemite", "vanilla", "acorn squash",
"Canadian bacon", "alligator", "cayenne pepper", "adobo",
"almond butter",... | {
"content_hash": "a40683d61006d8b57f3abbdb2b9b42f8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 71,
"avg_line_length": 25.375,
"alnum_prop": 0.5024630541871922,
"repo_name": "keeppythonweird/catinabox",
"id": "bfefbb495df84777a8a82ef55fc4e6d6cc3cc1d0",
"size": "609",
... |
from __future__ import division, print_function, unicode_literals
# This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.actions import *
# A color layer is a Layer with the a color att... | {
"content_hash": "ffc4de0c096e162b2866087bd21c9feb",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 89,
"avg_line_length": 34.49315068493151,
"alnum_prop": 0.6338363780778395,
"repo_name": "dangillet/cocos",
"id": "5dda25ec6ef0a27e6c7f10acbcc5d0782064a049",
"size": "2561"... |
from importlib import import_module
def import_from_path(path):
parts = path.split(".")
module_path = ".".join(parts[:-1])
attribute_name = parts[-1]
module = import_module(module_path)
attribute = getattr(module, attribute_name)
return attribute
| {
"content_hash": "07126ecf4c3b8c18651517f614c0b6d9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 21.23076923076923,
"alnum_prop": 0.6630434782608695,
"repo_name": "wiki-ai/ores",
"id": "e8a3d15b9d23d3f16cc4350871cef00603cb5f3e",
"size": "276",
... |
import unittest
import numpy as np
from numpy.testing import assert_allclose
import theano
from keras.layers import core
class TestLayerBase(unittest.TestCase):
def test_input_output(self):
nb_samples = 10
input_dim = 5
layer = core.Layer()
# As long as there is no input, an erro... | {
"content_hash": "3ad553655d089645400c87f43c71f68f",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 84,
"avg_line_length": 31.02013422818792,
"alnum_prop": 0.5822154911293812,
"repo_name": "zhangxujinsh/keras",
"id": "9d7bbd536e9c021683a39f5cb4aeabf85c938757",
"size": "4... |
import json
from contextlib import closing
from typing import Any, Dict, Optional
from flask_babel import gettext as __
from superset.commands.base import BaseCommand
from superset.databases.commands.exceptions import (
DatabaseOfflineError,
DatabaseTestConnectionFailedError,
InvalidEngineError,
Inval... | {
"content_hash": "58a217c182c4cb754a987c67421b6f51",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 87,
"avg_line_length": 38.97674418604651,
"alnum_prop": 0.5763723150357996,
"repo_name": "airbnb/caravel",
"id": "a9f1633a181443e7d7c5d980f40cc384f5f5b67a",
"size": "5813"... |
from concurrent import futures
import itertools
import sys
import re
import pygraphviz as gv
import ply.lex as lex
import ply.yacc as yacc
from functools import lru_cache as memoize
diagnostic_header_pattern = re.compile(r'[^ ]+\.[^ ]+:[0-9]+:[0-9]+: ([^ ]*): (.*)')
in_file_included_from_pattern = re.compile('In file... | {
"content_hash": "30c834b756b9cbb5b3eaa31c3ead3720",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 200,
"avg_line_length": 43.084468664850135,
"alnum_prop": 0.6386288894510498,
"repo_name": "google/fruit",
"id": "247b18def31094837dee2f5c18d9e968cbdcfa73",
"size": "16434... |
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from wagtail.admin.forms.collections import CollectionViewRestrictionForm
from wagtail.admin.modal_workflow import render_modal_workflow
from wagtail.models import Collection, CollectionViewRestriction
from wagtail.permi... | {
"content_hash": "ab4e63452146ab1eb07416679f8a7bf6",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 87,
"avg_line_length": 38.860759493670884,
"alnum_prop": 0.6055374592833876,
"repo_name": "thenewguy/wagtail",
"id": "9fe5c3f0f6ad0071a775983252569cbb1bb06419",
"size": "30... |
from flask import Flask
import json
from cow_mq.client import Client as CowMQClient
import threading
import logging
SERVER_DOMAIN = 'www.hcy.com'
app = Flask(__name__)
app.config['SECRET_KEY'] = 'cow_mq_2017'
config = {}
config['cow_mq_ip'] = '192.168.159.114'
#config['cow_mq_ip'] = 'your_mqtt_ip'
config['cow_mq_po... | {
"content_hash": "9b85b199362bb30346e670cb1853120e",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 77,
"avg_line_length": 29.725806451612904,
"alnum_prop": 0.6625067824199674,
"repo_name": "duncanHsu/CowMQ-Python",
"id": "05049e076dd55aafe626e32cf7c14f58024b7093",
"size"... |
import socket
from unittest import mock
import pytest
from aiohttp.tcp_helpers import tcp_nodelay
has_ipv6: bool = socket.has_ipv6
if has_ipv6:
# The socket.has_ipv6 flag may be True if Python was built with IPv6
# support, but the target system still may not have it.
# So let's ensure that we really hav... | {
"content_hash": "c29996ca74ac7212e065bbdd68922d63",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 83,
"avg_line_length": 33.082191780821915,
"alnum_prop": 0.6935817805383023,
"repo_name": "KeepSafe/aiohttp",
"id": "2b468ba470a14c6a96bd785134e07ab4c3677e1a",
"size": "241... |
import requests
url = "http://mockbin.com/har"
response = requests.request("PROPFIND", url)
print(response.text)
| {
"content_hash": "20eae1e211272449b98953ceba464625",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 44,
"avg_line_length": 16.571428571428573,
"alnum_prop": 0.7327586206896551,
"repo_name": "restlet/httpsnippet",
"id": "8a848a56dae919ed297b91cb84a2cb1a0ac337b0",
"size": "1... |
ACCOUNT_NAME = 'Office Spot'
| {
"content_hash": "417b3b9dad6580f87ffd69323cf317ca",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.7241379310344828,
"repo_name": "ddy88958620/lib",
"id": "4a0d360a8ba3f784ca2b472096a8acd6b66c95fb",
"size": "29",
"binary": fals... |
import numpy as np
import xgboost as xgb
import time
# path to where the data lies
dpath = '../../demo/data'
# load in training data, directly use numpy
dtrain = np.loadtxt( dpath+'/training.csv', delimiter=',', skiprows=1, converters={32: lambda x:int(x=='s') } )
dtrain = np.concatenate((dtrain, np.copy(dtrain)))
dt... | {
"content_hash": "8d6eec66072e544ec95d5296f1f0bc54",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 111,
"avg_line_length": 33.29032258064516,
"alnum_prop": 0.6671511627906976,
"repo_name": "RPGOne/Skynet",
"id": "fc76d98b266b82c0588abb6c416fcf80051c7c91",
"size": "2170",... |
def includeme(config):
# We need to get the value of the Warehouse and Forklift domains, we'll use
# these to segregate the Warehouse routes from the Forklift routes until
# Forklift is properly split out into it's own project.
warehouse = config.get_settings().get("warehouse.domain")
# General Adm... | {
"content_hash": "28d8cef26cf5500a27ba433285e88999",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 42.611111111111114,
"alnum_prop": 0.6792698826597132,
"repo_name": "alex/warehouse",
"id": "22af85df6120351a4416097ad7201346233e74a0",
"size": "1309"... |
from typing import Dict, Iterable
from flask_babel import LazyString, lazy_gettext
from c3bottles.model import drop_point
class Category:
"""
A category of drop points for different stuff, e.g. bottles, trash, etc.
Different categories of drop points allow different teams or specialized
groups with... | {
"content_hash": "6146414b72b29880b93ca4749ec5c998",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 78,
"avg_line_length": 31.94736842105263,
"alnum_prop": 0.6820428336079077,
"repo_name": "der-michik/c3bottles",
"id": "9828b52dbd2a7dcb9c1ca2d0bdea0ca19fc934e6",
"size": "... |
from buildbot.buildslave import BuildSlave
from buildbot.buildslave.ec2 import EC2LatentBuildSlave
# using simplejson instead of json since Twisted wants ascii instead of unicode
import simplejson as json
slaves = []
# Load slaves from external file, see slaves.json.sample
for slave in json.load(open("slaves.json"))... | {
"content_hash": "e68eb146752d7e4cf42a88dc04694792",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 33.76,
"alnum_prop": 0.6101895734597157,
"repo_name": "chfast/ethereum-buildbot",
"id": "5d7acfe1cf43e3e7f0f1ea9ac66b46f228f71edc",
"size": "1250",
... |
from heapq import nsmallest
total = 0
with open('input.txt') as fp:
data = fp.read()
for dimensions in data.split('\n'):
length, width, height = dimensions.split('x')
length = int(length)
width = int(width)
height = int(height)
a, b = nsmallest(2, (length, width, heigh... | {
"content_hash": "3f7462350c5225f76932811dd478089f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 24.470588235294116,
"alnum_prop": 0.5552884615384616,
"repo_name": "graemeglass/adventofcode",
"id": "7c706064ab49638ea5262e6cd96483042bc654a7",
"siz... |
import os
from datetime import datetime, timedelta
from airflow.models import DAG
try:
from airflow.operators.empty import EmptyOperator
except ModuleNotFoundError:
from airflow.operators.dummy import DummyOperator as EmptyOperator # type: ignore
from airflow.providers.microsoft.azure.operators.data_factory... | {
"content_hash": "7c3a22f8624d1ee115c663ba5710d6fa",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 106,
"avg_line_length": 35.31944444444444,
"alnum_prop": 0.7027133307117578,
"repo_name": "danielvdende/incubator-airflow",
"id": "03a1a71d63313e0219312cb15caea3f61fc8ca89",
... |
"""
The MatchMaker classes should accept a Topic or Fanout exchange key and
return keys for direct exchanges, per (approximate) AMQP parlance.
"""
from oslo.config import cfg
from designate.openstack.common import importutils
from designate.openstack.common import log as logging
from designate.openstack.common.rpc im... | {
"content_hash": "8c3110df38ec52c20a019ab5f062c930",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 79,
"avg_line_length": 32.276923076923076,
"alnum_prop": 0.6024785510009533,
"repo_name": "NeCTAR-RC/designate",
"id": "4b0fe2085508c0daaed8a014cb390c80d66744f6",
"size": ... |
import unittest
from chainer import backend
from chainer.backends import cuda
from chainer import initializers
from chainer import testing
from chainer.testing import attr
import numpy
@testing.parameterize(*testing.product({
'dtype': [numpy.float16, numpy.float32, numpy.float64],
}))
class TestIdentity(unittest... | {
"content_hash": "7eafc9b2a0a23ffb45ccfafdb9420445",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 71,
"avg_line_length": 30.227642276422763,
"alnum_prop": 0.6387842926304464,
"repo_name": "tkerola/chainer",
"id": "84e559eb770d5aae1fc998effc0b4a9e4db906d4",
"size": "371... |
import asposebarcodecloud
from asposebarcodecloud.BarcodeApi import BarcodeApi
from asposebarcodecloud.BarcodeApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
import ConfigParser
config = Config... | {
"content_hash": "43680e75dd04105e345d5ba8b67697dd",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 199,
"avg_line_length": 33.890625,
"alnum_prop": 0.6975564776394652,
"repo_name": "farooqsheikhpk/Aspose.BarCode-for-Cloud",
"id": "8da48c308039214b24fc4b45939bcb236c6de607",... |
import markupsafe
from django.db import models
from addons.base import exceptions
from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings,
BaseStorageAddon)
from addons.bitbucket.api import BitbucketClient
from addons.bitbucket.serializer import BitbucketSerialize... | {
"content_hash": "84014474cae71b1102f254a432183e90",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 122,
"avg_line_length": 33.63876651982379,
"alnum_prop": 0.57124148768989,
"repo_name": "Johnetordoff/osf.io",
"id": "b9f22b79ce2e3c1ac23b9db85da026ba6efbb945",
"size": "1... |
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foundation, either version 2.0 of the License, o... | {
"content_hash": "7f0650372f8b8d6f570dfc2dde3c0082",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 29.8,
"alnum_prop": 0.6644295302013423,
"repo_name": "hivesolutions/netius",
"id": "82eb7f39ae2383efeb67ce43813a58cc0a0ec913",
"size": "1685",
"bin... |
import os
import sys
import math
import time
import codecs
import random
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.nn import init
import torch.autograd as autograd
from torch.autograd import Variable
from random import shuffle
parser = argparse.Argum... | {
"content_hash": "58d948e4897012114863c2263610339e",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 140,
"avg_line_length": 36.01510574018127,
"alnum_prop": 0.5474372955288986,
"repo_name": "hjpwhu/Python",
"id": "e9f52354ad473aa1deab2b8c32a80f85200fad23",
"size": "11921... |
from django.conf.urls import url
from profile import views
urlpatterns = [
url(r'^$', views.login, name='login'),
url(r'^login/', views.login, name='login'),
]
| {
"content_hash": "da389d7b6ef1d1bc659ef382efce9d11",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 47,
"avg_line_length": 24.142857142857142,
"alnum_prop": 0.6568047337278107,
"repo_name": "quangnguyen-asnet/python-django",
"id": "a6f13f8e4daeaf28e4446bffc0ccc4081da83de7",
... |
import jingo
from pyquery import PyQuery as pq
from olympia.amo.tests import TestCase
from olympia.addons.models import Addon
from olympia.amo.urlresolvers import reverse
from olympia.reviews.models import ReviewFlag
from olympia.reviews.forms import ReviewForm
class HelpersTest(TestCase):
def render(self, s, c... | {
"content_hash": "a905f2af9995d245e0b0339cde86be76",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 78,
"avg_line_length": 39.743801652892564,
"alnum_prop": 0.5485547930962779,
"repo_name": "andymckay/olympia",
"id": "290da0d3a3f13fce221c39bb9b39d134cd82d210",
"size": "4... |
import datetime
from django.core.urlresolvers import reverse
from django import http
from django.utils import timezone
from mox import IsA # noqa
from horizon.templatetags import sizeformat
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
from openstack_dashboard import usag... | {
"content_hash": "ecdd990d155bb6792ceb8be1dc8b85b0",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 78,
"avg_line_length": 46.71917808219178,
"alnum_prop": 0.5405365782143381,
"repo_name": "neudesk/neucloud",
"id": "2dda328498c200ae8befc9c3dae1ab41c4f21202",
"size": "763... |
"""Functionality to support interacting with an OnRamp Database
"""
import os
import json
import exceptions
class Database():
# JJH TODO Need a reverse lookup
pce_states = { 0 : "Running",
1 : "Establishing Connection",
2 : "Down",
-1 : "... | {
"content_hash": "e747c956648e5295b8c4591ec83e3689",
"timestamp": "",
"source": "github",
"line_count": 963,
"max_line_length": 135,
"avg_line_length": 33.56697819314642,
"alnum_prop": 0.5292807424593967,
"repo_name": "koepked/onramp",
"id": "aa97a2d206d2772fa05641434f43ee1639ac66f4",
"size": "3232... |
"""Openstack logging handler.
This module adds to logging functionality by adding the option to specify
a context object when calling the various log methods. If the context object
is not specified, default formatting is used. Additionally, an instance uuid
may be passed as part of the log message, which is intended ... | {
"content_hash": "adfc3bfe0dd65eadcaaab9af26c2dc04",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 78,
"avg_line_length": 35.47126436781609,
"alnum_prop": 0.5876307749282473,
"repo_name": "ntymtsiv/tempest",
"id": "7bebfdbacc51db898cc85000496c4fffbc501321",
"size": "223... |
from __future__ import unicode_literals
from django import forms
from .models import Alias
class AliasEditForm(forms.ModelForm):
"""Alias for Alias"""
class Meta:
"""Meta for ModelForm"""
model = Alias
fields = ('name', 'url')
| {
"content_hash": "788a60560330d2deae4203bc0bf04f69",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.6264150943396226,
"repo_name": "genonfire/bbgo",
"id": "7b81ab589bc98476d0d56a40a6aa218cbe4239b3",
"size": "289",... |
import os, sys # low level handling, such as command line stuff
import string # string methods available
import re # regular expressions
import getopt # comand line argument handling
import math # match functions
from low import * # custom functions, written by myself
# =================... | {
"content_hash": "1a970bcc5d9bd96d6698ea588adfc1c2",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 97,
"avg_line_length": 33.54320987654321,
"alnum_prop": 0.48325358851674644,
"repo_name": "lotharwissler/bioinformatics",
"id": "a7121bf365a898910be047c8dcbf9d2210dd8fa2",
... |
"""This module contains the Sponsor Model."""
__authors__ = [
'"Pawel Solyga" <pawel.solyga@gmail.com>',
]
import soc.models.group
class Sponsor(soc.models.group.Group):
"""Sponsor details."""
pass
| {
"content_hash": "6a9170be6a1b31373236fc5690b1c1da",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 15,
"alnum_prop": 0.6619047619047619,
"repo_name": "MatthewWilkes/mw4068-packaging",
"id": "cac53a3164f7d0dfd09c6db922249db76cf38793",
"size": "822",... |
from __future__ import print_function, division, absolute_import
import imgaug as ia
import imgaug.augmenters as iaa
def main():
aug = iaa.Cutout(fill_mode=["gaussian", "constant"], cval=(0, 255),
fill_per_channel=0.5)
image = ia.data.quokka()
images_aug = aug(images=[image] * 16)
... | {
"content_hash": "876aacb19e5f5406e927e4d666c34b2d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 71,
"avg_line_length": 27.533333333333335,
"alnum_prop": 0.6150121065375302,
"repo_name": "aleju/imgaug",
"id": "c99df7b680b7a927f6750cda79332e938774303c",
"size": "413",
... |
from collections import MutableMapping
try:
from thread import get_ident
except ImportError:
try:
from threading import _get_ident as get_ident
except ImportError:
from threading import get_ident
def _recursive_repr(fillvalue='...'):
'Decorator to make a repr function return fillvalue f... | {
"content_hash": "e240b6319d4f4f0b6a2f081f71c2fda4",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 97,
"avg_line_length": 33.62043795620438,
"alnum_prop": 0.5822839774207555,
"repo_name": "GoogleCloudPlatform/python-compat-runtime",
"id": "2e28de848f4577123e4a94e7a23ad8d6... |
import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("php-yii2/app/index.php", "localhost", ""+ args.database_host +"")
setup_util.replace_text("php-yii2/deploy/nginx.conf", "root .*\/FrameworkBenchmarks/php-yii2", "root " + args.troot)
try:
if ... | {
"content_hash": "b873c2b3e3e01404d6a0f95f3effdae1",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 178,
"avg_line_length": 55.29032258064516,
"alnum_prop": 0.7170361726954493,
"repo_name": "ratpack/FrameworkBenchmarks",
"id": "1dda2f1631b7d0ab76906f509647d2b888d0798b",
"... |
import sys
import os
import logging
topdir = os.path.dirname(os.path.realpath(__file__)) + "../.."
topdir = os.path.realpath(topdir)
sys.path.insert(0, topdir)
from execformat.executor import execUtils, OperationFailed
from vyos_session import utils
logger = logging.getLogger(__name__)
utils.init_logger(logger)
... | {
"content_hash": "5476f8cf32c4f413f5b1b497f13969b3",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 62,
"avg_line_length": 23.352941176470587,
"alnum_prop": 0.5852225020990764,
"repo_name": "jiahaoliang/group-based-policy",
"id": "849124a9a2a9631eaa995a7b0a1781787a472da7",
... |
"""
Clever API
The Clever API
OpenAPI spec version: 2.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SectionResponse(object):
"""
NOTE: This class is auto generated by the swagger code gener... | {
"content_hash": "b3ebb9a0956f5b8bb37348b20f124c67",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 77,
"avg_line_length": 23.5327868852459,
"alnum_prop": 0.5043538836642285,
"repo_name": "Clever/clever-python",
"id": "2be7a3477ba40e35cbd110745eedba381d6c2372",
"size": "... |
"""
Add external identity tables.
Revision ID: 24ab8d11f014
Revises: 2bb1ba973f0b
Create Date: 2011-11-10 23:18:19.446844
"""
from __future__ import unicode_literals
import sqlalchemy as sa # noqa: F401
from alembic import op # noqa: F401
# Revision identifiers, used by Alembic.
# pylint: disable=C0103,invalid-nam... | {
"content_hash": "36d43b345cae57515f8b5999401e1abb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 37.32432432432432,
"alnum_prop": 0.5467052860246199,
"repo_name": "Ouranosinc/Magpie",
"id": "4a8a0db94a690a07f5c3b92623c56f873d376597",
"size": "138... |
'''
OpenShiftCLI class that wraps the oc commands in a subprocess
'''
# pylint: disable=too-many-lines
from __future__ import print_function
import atexit
import copy
import json
import os
import re
import shutil
import subprocess
import tempfile
# pylint: disable=import-error
try:
import ruamel.yaml as yaml
ex... | {
"content_hash": "9f02cdf5a7b84b415ad460421c6ecf9b",
"timestamp": "",
"source": "github",
"line_count": 1850,
"max_line_length": 118,
"avg_line_length": 33.23567567567567,
"alnum_prop": 0.5317145366424877,
"repo_name": "DG-i/openshift-ansible",
"id": "308f454880b6ccc4a55c0cc4aaf8e468f20e3444",
"siz... |
"""
This module contains Google Search Ads sensor.
"""
from typing import Dict, Optional
from airflow.providers.google.marketing_platform.hooks.search_ads import GoogleSearchAdsHook
from airflow.sensors.base_sensor_operator import BaseSensorOperator
from airflow.utils.decorators import apply_defaults
class GoogleSea... | {
"content_hash": "94b227c1316f1354b4c5ec0f4fcc1c7d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 107,
"avg_line_length": 35.81666666666667,
"alnum_prop": 0.6626337831549558,
"repo_name": "mtagle/airflow",
"id": "1853825941ffdc46058a8b081d99c810f56a9496",
"size": "2936"... |
ProgramName = 'getCpGoe.py'
LastUpdated = '10/16/14'
By = 'Groves Dixon'
VersionNumber = '1.0'
print "\nRunning Program {}...".format(ProgramName)
VersionString = '{} version {} Last Updated {} by {}'.format(ProgramName, VersionNumber, LastUpdated, By)
Description = '''
Description:
This program reads though a set of... | {
"content_hash": "a2d93e26c4bb015ec9dd8faf95a742fe",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 201,
"avg_line_length": 40.04040404040404,
"alnum_prop": 0.6321897073662966,
"repo_name": "grovesdixon/CpGoe",
"id": "8f5a54c3e2f1ced7b290e810e3e0ad565ca26317",
"size": "40... |
from unittest.mock import patch, sentinel, MagicMock
from qcat.tests import TestCase
from summary.parsers.questionnaire import QuestionnaireParser
from summary.renderers.summary import SummaryRenderer, GlobalValuesMixin
class SummaryDataProviderTest(TestCase):
def test_summary_type(self):
with self.asser... | {
"content_hash": "0535fbbe9b4b8d1d72c832ce8917ac08",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 87,
"avg_line_length": 33.464285714285715,
"alnum_prop": 0.6061899679829242,
"repo_name": "CDE-UNIBE/qcat",
"id": "1f5e87ce167ae4f99b3b6b2c7dc7048a5cc87861",
"size": "1874"... |
import logging
import re
from telemetry import decorators
from telemetry.timeline import trace_data as trace_data_module
from telemetry.core.backends.chrome_inspector import devtools_http
from telemetry.core.backends.chrome_inspector import inspector_backend
from telemetry.core.backends.chrome_inspector import tracing... | {
"content_hash": "caf920b80f8531aae26083670ca99d21",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 79,
"avg_line_length": 38.00487804878049,
"alnum_prop": 0.6923373122834039,
"repo_name": "hefen1/chromium",
"id": "4dc7f755b5684ff3e83df506e1f0eef14f454bb2",
"size": "7954... |
from ebird.api.constants import DEFAULT_BACK
from tests.mixins.base import BaseMixin
class BackTestsMixin(BaseMixin):
def test_back_is_sent(self):
query = self.api_call(back=10)[1]
self.assertEqual(query["back"], 10)
def test_default_back_is_not_sent(self):
query = self.api_call(back=... | {
"content_hash": "faa4e8fb99a6bac22877ce6f162f880d",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 51,
"avg_line_length": 32.5,
"alnum_prop": 0.675,
"repo_name": "ProjectBabbler/ebird-api",
"id": "a82054bcbbc93091d6cde0c3bba2fa420fc0e4b0",
"size": "520",
"binary": fals... |
"""Create and parse 'send'-type messages."""
import struct
from . import (util, config, exceptions, bitcoin, util)
FORMAT = '>QQ'
LENGTH = 8 + 8
ID = 0
def validate (db, source, destination, asset, quantity):
problems = []
if asset == config.BTC: problems.append('cannot send saffroncoins') # Only for par... | {
"content_hash": "fdcb4e8f29c2e6aae8817ddbfa098a9d",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 120,
"avg_line_length": 33.32673267326733,
"alnum_prop": 0.6173499702911468,
"repo_name": "saffroncoin/csfrd",
"id": "f5e70552a86fbfd0ef5edc18842337dc94569b44",
"size": "3... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:6479")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) | {
"content_hash": "d3f5f07247c6d62fac6fe49afd91557a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 46,
"avg_line_length": 39.25,
"alnum_prop": 0.7643312101910829,
"repo_name": "CarpeDiemCoin/CarpeDiemLaunch",
"id": "cf3e0e5be54a70eb32a567c1f234697b5eaa6602",
"size": "157"... |
import clr
import sys
clr.AddReference('ZyGames.Framework.Common')
clr.AddReference('ZyGames.Framework')
clr.AddReference('ZyGames.Framework.Game')
clr.AddReference('ZyGames.Tianjiexing.Model')
clr.AddReference('ZyGames.Tianjiexing.BLL')
clr.AddReference('ZyGames.Tianjiexing.Lang')
clr.AddReference('ZyGames.Ti... | {
"content_hash": "e81325cc20db9cb73274b2cd6899a9cd",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 93,
"avg_line_length": 34.29032258064516,
"alnum_prop": 0.7083725305738476,
"repo_name": "wenhulove333/ScutServer",
"id": "77787befa3355a88bcc15beb50348476d8995099",
"size"... |
from .model_base import ModelBase
class Template(ModelBase):
""" Object model for TestRail Templates
To get all templates for a project:
.. code-block:: python
target_project = traw_client.project(12) # Get project with id 12
templates_for_project = list(traw_client.template(target_pro... | {
"content_hash": "092579dcd1867006c0a7cae0a26d0d40",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 74,
"avg_line_length": 25.695652173913043,
"alnum_prop": 0.6294416243654822,
"repo_name": "levi-rs/traw",
"id": "c368456ae40ab5392e60730e0f502c79b18359ac",
"size": "591",
... |
"""
Make a new dump file with a specified max number of timesteps and reorders atoms.
"""
from __future__ import print_function
import os
import sys
import argparse
import numpy as np
from md_utils.md_common import (InvalidDataError, create_out_fname, warning, process_cfg,
find_dump_se... | {
"content_hash": "01d2724cbe183850974bcde1758c193c",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 118,
"avg_line_length": 35.19112627986348,
"alnum_prop": 0.5529046649209582,
"repo_name": "team-mayes/md_utils",
"id": "f019c212c8e8e9a274864997e60c9d8498338952",
"size": ... |
from __future__ import unicode_literals
def send_text(text, frm, to, fail_silently=True, status_report=False):
"""A convenient helper to quickly access the application features.
Returns a :class:`~djsms.models.TextMessage` object.
Required parameters:
:param text: the text message body. It's length... | {
"content_hash": "2f5a360a2d1a1813e835709355e4e717",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 35.78125,
"alnum_prop": 0.7048034934497817,
"repo_name": "thibault/django-simple-sms",
"id": "8ad60c6201bab93b9a8947bb32977dcdbe6ab5da",
"size": "117... |
def extractBierutranslationsHomeBlog(item):
'''
Parser for 'bierutranslations.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
... | {
"content_hash": "4436c0a3d428a6c1dde54a04eb7372fd",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 26.904761904761905,
"alnum_prop": 0.6389380530973451,
"repo_name": "fake-name/ReadableWebProxy",
"id": "ba1cce940083a1e90b7891cd1938ab449ef8d4d3",
"... |
import cPickle as pickle
from argparse import ArgumentParser
import numpy as np
import cv2
parser = ArgumentParser()
parser.add_argument('file_path')
options = parser.parse_args()
def data_uri_to_cv2_img(uri):
encoded_data = uri.split(',')[1]
np_arr = np.fromstring(encoded_data.decode('base64'), np.uint8)
... | {
"content_hash": "a29f4489dc7a561ff355d352f8a1e64e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 22.08695652173913,
"alnum_prop": 0.7106299212598425,
"repo_name": "GXIC-Real-Intelligence-Team/surveillance-core",
"id": "d38981d842aabfa47ecf2f0b12b11... |
from quex.engine.misc.file_in import write_safely_and_close
from quex.blackboard import setup as Setup
import quex.output.cpp.source_package as source_package
import quex.blackboard as blackboard
from quex.engine.generator.action_info ... | {
"content_hash": "a8283d0e660254d2149e1853d44f20f1",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 114,
"avg_line_length": 45.23267326732673,
"alnum_prop": 0.6061070373207836,
"repo_name": "coderjames/pascal",
"id": "7335d7759e4f585f9e7e2fde4dfda681f3a19559",
"size": "9... |
from numpy import array, einsum, exp
from .constants import ASEC2RAD
from .earthlib import compute_limb_angle, refract, terra
from .functions import from_polar, length_of, to_polar, rot_x, rot_y, rot_z
from .chaining import Body, Segment
from .timelib import takes_julian_date
from .units import (Distance, Velocity, An... | {
"content_hash": "a19bd7ec88ff81a7e21ddbb7ed0d6db1",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 79,
"avg_line_length": 41.68041237113402,
"alnum_prop": 0.5711105614642592,
"repo_name": "exoanalytic/python-skyfield",
"id": "05fc6afa4ad1179c45f228f5d0123fb66c5e2fb7",
"s... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.plugin import PluginError
log = logging.getLogger('list_add')
class ListAdd(objec... | {
"content_hash": "71180237a1f027ea1a3de37adebd49f0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 119,
"avg_line_length": 38.76271186440678,
"alnum_prop": 0.574989068648885,
"repo_name": "qk4l/Flexget",
"id": "595e12407a3ea80165ed2d2691b1f3755dc20205",
"size": "2287",
... |
"""Sensor platform support for yeelight."""
import logging
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import DA... | {
"content_hash": "5bf4ed937825438887a8f1f6f9acb752",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 87,
"avg_line_length": 34.26923076923077,
"alnum_prop": 0.6812570145903479,
"repo_name": "jawilson/home-assistant",
"id": "89eb910f942393fd89fee61c8d97c5ee819069f7",
"size"... |
import logging
from datetime import datetime
from constants import *
import handlers
class WarmupHandler(handlers.BaseRequestHandler):
def get(self):
logging.info("Warmup Request")
class Monthly(handlers.BaseRequestHandler):
def get(self):
pass
class AdminDigest(handlers.BaseRequestHandle... | {
"content_hash": "a17e08654fdf9d3af85a61aab0780137",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 49,
"avg_line_length": 17.8,
"alnum_prop": 0.7247191011235955,
"repo_name": "onejgordon/action-potential",
"id": "fb0335ec3908fd86869b1e5abeddb59ed615971e",
"size": "356",
... |
''' A bar chart based on simple Python lists of data. This example demonstrates
automatic colormapping.
.. bokeh-example-metadata::
:apis: bokeh.plotting.figure.vbar, bokeh.transform.factor_cmap
:refs: :ref:`ug_basic_bars_filled`, :ref:`ug_basic_bars_filled_colors`
:keywords: bar, colormap, legend, palette... | {
"content_hash": "92a1af9ba250797bb96cd5d48d02cdc6",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 93,
"avg_line_length": 34.645161290322584,
"alnum_prop": 0.7262569832402235,
"repo_name": "bokeh/bokeh",
"id": "9553e9df2beed8acf05c636292e94c606c6f5628",
"size": "1074",
... |
"""
William Dreese 2017
Developement
Takes a list of nodes and uses Naive Bayes machince learning
to predict test cases. Handles 1 file currently.
-add Laplace smoothing
-add pitcher analysis
-add streak analysis
"""
from nodeGeneral import Node, teamDict
class nodeBayes:
def __init__(self, nodeList):
s... | {
"content_hash": "16e3cebbf03093ceba7fb55ec0103695",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 80,
"avg_line_length": 27.630434782608695,
"alnum_prop": 0.5656963021243115,
"repo_name": "Dreeseaw/BaseballNodes",
"id": "935b742c5d5024940f77fd1d3cb6892745672c63",
"size"... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
# For Python 2 compatibility
# from __future__ import print_function
from builtins import open
from builtins import str
from future import standard_library
standard_libra... | {
"content_hash": "b7241d49b96e3ea2e587f48a05c0312f",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 155,
"avg_line_length": 32.24609375,
"alnum_prop": 0.5699576014536645,
"repo_name": "draperjames/qtpandas",
"id": "060c8ed71878b34f86670eeafe5e1259673927ea",
"size": "8255... |
"""Generate a square wave in an .aiff audio file."""
import aifc
import struct
samples_per_second = 44100
C3_Hz = 261.63
samples_high = int(samples_per_second / C3_Hz * 0.5)
samples_low = int(samples_per_second / C3_Hz * 0.5)
amplitude = 2**14 # Leave some headroom
output_file_name = 'square_C3.aiff'
f = aifc.open(ou... | {
"content_hash": "9e993a6670d108d4a008f11a6b47d823",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 63,
"avg_line_length": 27.75,
"alnum_prop": 0.6632882882882883,
"repo_name": "wsnook/sandbox",
"id": "d854baae3e51dbf3fc4661d14c4379c4fa1c46f2",
"size": "888",
"binary": ... |
from rockstar import RockStar
lua_code = "print 'hello world!'"
rock_it_bro = RockStar(days=400, file_name='helloworld.lua', code=lua_code)
rock_it_bro.make_me_a_rockstar()
| {
"content_hash": "b2292a39ce1005b9c7d25f3e4d5ba84a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 75,
"avg_line_length": 34.8,
"alnum_prop": 0.735632183908046,
"repo_name": "Endika/rockstar",
"id": "80ef0fd6c18d740460eb7e912eb6df7a5ce9490a",
"size": "174",
"binary": fa... |
EAT_PLUGIN = 1
EAT_HEXCHAT = 2
EAT_ALL = 3
EAT_NONE = None
PRI_HIGHEST = 9
PRI_HIGH = 8
PRI_NORM = 7
PRI_LOW = 6
PRI_LOWEST = 5
import re
import traceback
import threading
import socket
import os
import os.path
import sys
locky = threading.RLock()
cmd_pattern = re.compile(r'eg: /(.+)', re.MULTILINE)
def parse(yo):
... | {
"content_hash": "63183c02c77c33d5cc7969e47782413e",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 114,
"avg_line_length": 28.978494623655912,
"alnum_prop": 0.5233766233766234,
"repo_name": "necessary129/my-hexchat-addons",
"id": "f192c61fae5138b845e773a50ae0b8d70a0ef608"... |
import re
import logging
import json as simplejson
from google.appengine.api import channel
from wins import Wins
#from match_results import setMatchResults
from matchmaker_results import setMatchMakerResults
#from deactivate_player import deactivatePlayer
class GameUpdater():
game = None
def __init__(self,... | {
"content_hash": "06652d66b25e0f4b3358853dcbe99222",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 123,
"avg_line_length": 36.975,
"alnum_prop": 0.5215235519495154,
"repo_name": "LeetCoinTeam/lc_tactoe",
"id": "7a24e63833d312a6adb0c7373b9dcd09890ff35c",
"size": "4437",
... |
"""
Creates an RSS feed from HackerNews because there isn't a good one out there.
COPYRIGHT NOTICE
---------------
Copyright 2016-2017 David Lowry-Duda
You are free to redistribute and/or modify HNRSS under the
terms of the MIT License. A copy of this license should be made available with
the source.
I'm happy if yo... | {
"content_hash": "de3e01a3803a9a9246ca3c8860d3ef1e",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 85,
"avg_line_length": 37.0503144654088,
"alnum_prop": 0.531318961127143,
"repo_name": "davidlowryduda/hnrss",
"id": "e07d5565be7fea874611f874bc229bb8ea5973c1",
"size": "5... |
import random
import time
class RandomDelayModel:
"""
This model cause random delay after each test step between min and max value
"""
def __init__(self, min_delay, max_delay):
"""
:param min_delay: minimum delay in seconds
:param max_delay: maximum delay in seconds
""... | {
"content_hash": "173e81947a77a22855e315448d28b012",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 24.476190476190474,
"alnum_prop": 0.5992217898832685,
"repo_name": "OPpuolitaival/pyosmo",
"id": "199193a31e57e3f2b629f330bedd3fc526623d87",
"size": ... |
'''OpenGL extension NV.pixel_data_range
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_NV_pixel_data_range'
_DEPRECATED = False
GL_WRITE_PIXEL... | {
"content_hash": "b6e495a592be3004a65dee8d79026b00",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 106,
"avg_line_length": 43.73809523809524,
"alnum_prop": 0.773543821448013,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "b6df09bab59c473be980d6451f3acbcca569f61e"... |
import unittest
import env
from src.BoardCubePool import BoardCubePool
from src import Enums
from src.MediatorResource import MediatorResource
#Unit testing framework will automatically consider any method starting with test as
#We use this and put all unit tests in a single class to use the setup feature
class TestB... | {
"content_hash": "6aabc20b8092f7477a9c8003ea9613b2",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 89,
"avg_line_length": 30.916083916083917,
"alnum_prop": 0.6534720651436327,
"repo_name": "coderjz/pypandemic",
"id": "486867b151b581cb9e7ef9bccbe2537c4525d1c5",
"size": "... |
from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource
from lasagne.nonlinearities import sigmoid
from lasagne.objectives import crossentropy
"""
Setup:
* in_to_cell init weights are now Normal(1.0)
* output all appliances
* boolean targets
Changes:
* fix bug in RealApplianceS... | {
"content_hash": "e883fb137c79cde393028e45340ba071",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 63,
"avg_line_length": 23.3125,
"alnum_prop": 0.707774798927614,
"repo_name": "mmottahedi/neuralnilm_prototype",
"id": "12c8af74e6845ebd410636fbaaf00dc106899893",
"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": "6c9164ca99ab8a8e6809fbb79bc54677",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 211,
"avg_line_length": 30.268571428571427,
"alnum_prop": 0.7128563337738343,
"repo_name": "benfinke/ns_python",
"id": "cbbdd3fff82d9ad2f8216482e84978cc1c41b382",
"size": ... |
import re
from amazonproduct.contrib.cart import Cart, Item
from amazonproduct.errors import AWSError
from amazonproduct.processors import BaseResultPaginator, BaseProcessor
from amazonproduct.processors import ITEMS_PAGINATOR, RELATEDITEMS_PAGINATOR
from amazonproduct.utils import import_module
implement... | {
"content_hash": "7c67c591248cfa97274335d0ec670002",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 91,
"avg_line_length": 33.75,
"alnum_prop": 0.5713159968479118,
"repo_name": "knittledan/Location_Search_Prediction",
"id": "8e549aa9d82f913c4ae2da40c8b137f98366a04d",
"si... |
import logging
from tempest.api.orchestration import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class StacksTestJSON(base.BaseOrchestrationTest):
@classmethod
def setUpClass(cls):
super(S... | {
"content_hash": "e255e9ed3083070a8f8057975e33bd2b",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 47.42567567567568,
"alnum_prop": 0.5798546801538681,
"repo_name": "Mirantis/tempest",
"id": "a97c5615272ad36e08f88e2bd04ce496ccb1b9e5",
"size": "759... |
import sys
import os
# 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 ------------------------------------------------
# If your documentat... | {
"content_hash": "77c2d71125e2b6c5da314e80dd06e62d",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 79,
"avg_line_length": 31.678030303030305,
"alnum_prop": 0.7039339949778788,
"repo_name": "josh-t/OpenRange",
"id": "e09f4bc9d537002127ef488aa5bfabbe79dfa61b",
"size": "87... |
import sys
import os
import getpass
import urllib.request, urllib.parse
import http.cookiejar
import html.parser
# =============================================================================================================================================================
# ============================================... | {
"content_hash": "e3860ae828650be888ece59064a35b28",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 159,
"avg_line_length": 47.695035460992905,
"alnum_prop": 0.4422304832713755,
"repo_name": "Zahnstocher/OsmAnd-ios",
"id": "27f7b14adbd0dc7c37237518da163a7d4857363b",
"siz... |
import os, time, codecs, yaml, requests
from optparse import OptionParser
from BeautifulSoup import BeautifulSoup
from random import choice
parser = OptionParser(usage='usage: %prog [options] output')
parser.add_option('-v', action='count', dest='verbosity', default=0, help='increase output verbosity')
parser.add_opti... | {
"content_hash": "3cf827699394438ff381de3a7275b3ef",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 145,
"avg_line_length": 48.62264150943396,
"alnum_prop": 0.5941016686069073,
"repo_name": "telemundo/msn-crawler",
"id": "c2d590d09c4a405e836a7abaec673923db77030c",
"size"... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/destructible/shared_destructible_item_barrel.iff"
result.attribute_template_id = -1
result.stfName("container_name","debris")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "0e184e4d7a8540151bede5f9fc66ce4a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.7060702875399361,
"repo_name": "anhstudios/swganh",
"id": "53bc1dd994338628d2394040d14777c613a15b43",
"size": "45... |
"""
Test Program Creator role
"""
from integration.ggrc import TestCase
from ggrc.models import get_model
from ggrc.models import all_models
from integration.ggrc.api_helper import Api
from integration.ggrc.generator import Generator
from integration.ggrc.generator import ObjectGenerator
class TestCreator(TestCase):... | {
"content_hash": "486501cc0c8654fd1779b1cb56f9a051",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 79,
"avg_line_length": 37.17768595041322,
"alnum_prop": 0.580971434922752,
"repo_name": "plamut/ggrc-core",
"id": "ffd78d84375b84fcbf2ce8c86426200c74668ba2",
"size": "9110... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['Lag1Trend'] , ['Seasonal_Hour'] , ['MLP'] ); | {
"content_hash": "8cefae5f671d3232333156c7eb4a8e01",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 80,
"avg_line_length": 38.25,
"alnum_prop": 0.6993464052287581,
"repo_name": "antoinecarme/pyaf",
"id": "6ace72d07f35cccb9f6cd16635d1e8e1f5b4117b",
"size": "153",
"binary"... |
from __future__ import annotations
import pytest
def generate_image(xsize, ysize):
from scitbx.array_family import flex
image = flex.random_double(xsize * ysize)
image.reshape(flex.grid(ysize, xsize))
return image
def generate_mask(xsize, ysize):
from scitbx.array_family import flex
mask ... | {
"content_hash": "67ecb4d3ab367a03a9f03b7782f5289c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 68,
"avg_line_length": 27.350649350649352,
"alnum_prop": 0.5470085470085471,
"repo_name": "dials/dials",
"id": "45d2fca7581538bef3f73cc24bb1853bd987fe0e",
"size": "2106",
... |
from create import create
from delete import delete
from list import list
from usage import usage
__all__ = [
'create',
'delete',
'list',
'usage'
]
| {
"content_hash": "80314d0c3a184da1fe92e036b827f0aa",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 25,
"avg_line_length": 15,
"alnum_prop": 0.6424242424242425,
"repo_name": "absalon-james/randomload",
"id": "2264e22a0e674fb53a100c90c4b0d5caaca43eaf",
"size": "165",
"bi... |
"""distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""
import sys, os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
fro... | {
"content_hash": "374cb2b1eda96d3bf21a91c0829a3318",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 91,
"avg_line_length": 43.21883656509695,
"alnum_prop": 0.5351237020894757,
"repo_name": "Suwmlee/XX-Net",
"id": "f419da98bcb37abffc91414aba68441b38322205",
"size": "15602... |
import uuid, time, hashlib, shutil, random, os, sys
from M2Crypto import Rand, RSA, BIO, EVP
from twisted.internet import defer
from zeitcoindb import hashtable
from twisted.web.client import getPage
from twisted.internet import reactor
ADDRESS='127.0.0.1'
FNAME='zeitcoin'
PORT=1234
class utility:
def __init__(self... | {
"content_hash": "221991704f8b471fe7f08b36828c073d",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 106,
"avg_line_length": 29.997596153846153,
"alnum_prop": 0.7067072682105938,
"repo_name": "mmgrant73/zeitcoin",
"id": "f763aea951998a20bf354e48c18cda28593201c6",
"size": ... |
"""Read and cache directory listings.
The listdir() routine returns a sorted list of the files in a directory,
using a cache to avoid reading the directory more often than necessary.
The annotate() routine appends slashes to directories."""
import os
cache = {}
def listdir(path):
"""List directory contents, usi... | {
"content_hash": "47081dcdd83a27936e9b54e343576a8b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 72,
"avg_line_length": 26.405405405405407,
"alnum_prop": 0.6028659160696008,
"repo_name": "MalloyPower/parsing-python",
"id": "a35e16d1bc6ad5366e9c84c04fb47c1f0ca98f3c",
"s... |
"""
MAX31855_test.py
Alexander Hiam - 12/2012
Example program for PyBBIO's MAX31855 library.
Reads the temerature from the MAX31855 thermocouple
amplifier using software SPI.
This example program is in the public domain.
"""
from bbio import *
from bbio.libraries.MAX31855 import *
# Set variables for the p... | {
"content_hash": "697fc88a7c5be7327948be894081aa6b",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 57,
"avg_line_length": 22.86111111111111,
"alnum_prop": 0.7035236938031592,
"repo_name": "ims-tyler/PyBBIO",
"id": "8666897f79e8e674a74023c72ea73c404e9b5091",
"size": "823"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.