text stringlengths 4 1.02M | meta dict |
|---|---|
import json
from cloudify.workflows import parameters, ctx
output_path = parameters.output_path
with open(output_path, 'w') as f:
f.write(json.dumps({
'retries': ctx._task_retries,
'retry_interval': ctx._task_retry_interval,
'thread_pool_size': ctx._local_task_thread_pool_size
}))
| {
"content_hash": "839d30fc8c7eb0e1207a7e19208ed451",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 60,
"avg_line_length": 26.416666666666668,
"alnum_prop": 0.6656151419558359,
"repo_name": "dankilman/clash",
"id": "49f6331cb39352932ef4aa72fdd07ed97ed243e3",
"size": "317"... |
"""Test the ZMQ API."""
import configparser
import os
import struct
from test_framework.test_framework import IonTestFramework, SkipTest
from test_framework.util import *
class ZMQTest (IonTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 4
port = 28332
def setup_n... | {
"content_hash": "80fcb0e57bc0914c64f996b3a523bb26",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 121,
"avg_line_length": 34.68571428571428,
"alnum_prop": 0.5881383855024712,
"repo_name": "aspaas/ion",
"id": "d57027ca605e19e56aa4db4023b98998beb0a983",
"size": "3856",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('developers', '0005_auto_20150827_1230'),
]
operations = [
migrations.RemoveField(
model_name='preloadtestplan',
name='addon'... | {
"content_hash": "84a97f2f33a206ef4ed7e678e23ff264",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 50,
"avg_line_length": 20.9,
"alnum_prop": 0.583732057416268,
"repo_name": "washort/zamboni",
"id": "8c1496f7aa5cacf6821f016e07a322114d9543c7",
"size": "442",
"binary": f... |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import pyblogit
import pyblogit.blogger
import pyblogit.database_handler
| {
"content_hash": "24c17c99505d8d482a936b1377e33925",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 41,
"avg_line_length": 17.25,
"alnum_prop": 0.782608695652174,
"repo_name": "jamalmoir/pyblogit",
"id": "37fa9689ecf1d75641d93ca7c4633904c04431a7",
"size": "138",
"binary"... |
"""
Unit tests for L{benchmark}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.usage import UsageError
from benchmark import BenchmarkOptions
class BenchmarkOptionsTests(TestCase):
"""
Tests for L{benchmark.BenchmarkOptions}.
"""
def setUp(self):
"""
Create a L... | {
"content_hash": "39f1950eac916dd77387b70d10d73c44",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 97,
"avg_line_length": 35.1948051948052,
"alnum_prop": 0.5701107011070111,
"repo_name": "macosforge/ccs-calendarserver",
"id": "a48c684abd702137bc0deeffc312ff63ece1b2e5",
... |
"""
pyboard interface
This module provides the Pyboard class, used to communicate with and
control a MicroPython device over a communication channel. Both real
boards and emulated devices (e.g. running in QEMU) are supported.
Various communication channels are supported, including a serial
connection, telnet-style net... | {
"content_hash": "d8b4234a863f0a9455c2e7f9b8eeada6",
"timestamp": "",
"source": "github",
"line_count": 758,
"max_line_length": 105,
"avg_line_length": 32.84696569920845,
"alnum_prop": 0.5410876375612499,
"repo_name": "adafruit/circuitpython",
"id": "a43a4d0574857cf0f2b2cecdaeb7e1fdb7186b29",
"size... |
import lmfit
import numpy as np
from collections import OrderedDict
from pycqed.analysis import fitting_models as fit_mods
from pycqed.analysis import analysis_toolbox as a_tools
import pycqed.analysis_v2.base_analysis as ba
from pycqed.analysis.tools.plotting import SI_val_to_msg_str
from copy import deepcopy
class ... | {
"content_hash": "8ac6e158b77e81b39a8a4c37e21b8f61",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 97,
"avg_line_length": 42.32017543859649,
"alnum_prop": 0.5513524717587315,
"repo_name": "DiCarloLab-Delft/PycQED_py3",
"id": "2f801dd8ffc7bd2d571ce22e806fd6657a8d5e6e",
"... |
from msrest.serialization import Model
class OperationPropertiesFormatServiceSpecification(Model):
"""Specification of the service.
:param metric_specifications: Operation service specification.
:type metric_specifications:
list[~azure.mgmt.network.v2018_01_01.models.MetricSpecification]
:param ... | {
"content_hash": "9b9751d526cc0871cc2f2f7594b988ce",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 98,
"avg_line_length": 43.04347826086956,
"alnum_prop": 0.7191919191919192,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "aa8bf97f45644c0ab2febdda2234a65f006fd7a5",
"... |
"""Common functionality for the application object model
The object model must be initialized at service start via
solum.objects.load()
and all objects should be retrieved via
solum.objects.registry.<class>
in application code.
"""
from oslo.config import cfg
from solum.objects import registry
from solum.ope... | {
"content_hash": "75681da5bd5058ed0fea9da7af1b5eab",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 67,
"avg_line_length": 24.37735849056604,
"alnum_prop": 0.6896284829721362,
"repo_name": "gilbertpilz/solum",
"id": "f9ff06099ccfa39023ee1edb62658c1390160d7f",
"size": "187... |
"""An example of persistence for a directed graph structure. The
graph is stored as a collection of edges, each referencing both a
"lower" and an "upper" node in a table of nodes. Basic persistence
and querying for lower- and upper- neighbors are illustrated::
n2 = Node(2)
n5 = Node(5)
n2.add_neighbor(n... | {
"content_hash": "b5b66c9664f4e0faac539f2999718791",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 32.63636363636363,
"alnum_prop": 0.7103064066852368,
"repo_name": "rclmenezes/sqlalchemy",
"id": "629808abe91ffede9e5354bc74da686701357f99",
"size": ... |
"""Implementation of the convolutional neural net."""
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.optimizers import SGD
from keras.callbacks import ModelCheckpoint, TensorBoard
import os
import numpy as np
from ... | {
"content_hash": "d4e2a7abc25ff67c916145b4cb00c8c6",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 90,
"avg_line_length": 32.53691275167785,
"alnum_prop": 0.614480198019802,
"repo_name": "treigerm/WaterNet",
"id": "2f8e59fdb6e497ac7fc7924bcbd05608180fbb5a",
"size": "484... |
from __future__ import unicode_literals
from django.db import migrations
ROLE_DUPLICATES_QUERY = """
SELECT id FROM (
SELECT
id, ROW_NUMBER() OVER (
PARTITION BY github_user, github_repo
ORDER BY modified DESC) AS rnum
FROM main_role) temp
WHERE temp.rnum > 1;
"""
def drop_role_duplicates(apps,... | {
"content_hash": "945e4ae574506a31206394616c985be2",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 75,
"avg_line_length": 33.785714285714285,
"alnum_prop": 0.6152219873150105,
"repo_name": "chouseknecht/galaxy",
"id": "5501a36fc1e0ac2e21dbd40adc6a90d317dfdd23",
"size": "... |
INGRESS_DIR = 'ingress'
EGRESS_DIR = 'egress'
STATUS_BUILDING = 'building'
STATUS_ACTIVE = 'active'
STATUS_ERROR = 'error'
STATUS_DELETING = 'deleting'
SERVICE_CHAIN = 'servicechain'
SERVICECHAIN_TOPIC = 'q-servicechain-plugin'
SERVICECHAIN_AGENT_TOPIC = 'q-servicechain-agent'
AGENT_TYPE_SERVICECHAIN = 'Service chai... | {
"content_hash": "7a112972224f6a293b31f9d01e3908b3",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 23.68421052631579,
"alnum_prop": 0.7444444444444445,
"repo_name": "nash-x/hws",
"id": "cc7fc006107fa9f41fddc5a5bd46eba7e8c5c99b",
"size": "1125",
"... |
import re
import threading
from django.conf import settings
from django.core.exceptions import MiddlewareNotUsed, ImproperlyConfigured
from django.core.urlresolvers import set_urlconf
from .utils import from_dotted_path
_thread_local = threading.local()
class SubdomainMiddleware(object):
"""
Adjust incoming... | {
"content_hash": "091dab1e8e5e764086ba033044592c77",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 79,
"avg_line_length": 36.05392156862745,
"alnum_prop": 0.6420122365737594,
"repo_name": "playfire/django-dynamic-subdomains",
"id": "974a754ac97f8b88c6ae050c6f99bed50e3670d... |
"""
Django settings for jobvisualization project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# B... | {
"content_hash": "8e9899b49458bbfccf53219ef6e8f9c2",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 74,
"avg_line_length": 27.40495867768595,
"alnum_prop": 0.6975271411338962,
"repo_name": "nmccrory/job-visualization",
"id": "61eeb09a909f06509380f195d42bf2a0e8d7cff6",
"s... |
from a10sdk.common.A10BaseClass import A10BaseClass
class MacAddress(A10BaseClass):
""" :param static_list: {"minItems": 1, "items": {"type": "static"}, "uniqueItems": true, "array": [{"required": ["mac", "vlan"], "properties": {"dest": {"default": 0, "optional": true, "type": "number", "description": "Tr... | {
"content_hash": "4046b67ce8906dcdbc3c3aa5d408388b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 965,
"avg_line_length": 51.68571428571428,
"alnum_prop": 0.6301824212271974,
"repo_name": "amwelch/a10sdk-python",
"id": "a35f80524bb17fcfa3b62d8797a4c76e6d70095f",
"size":... |
import smbus
from time import *
class i2c_device:
def __init__(self, addr, port=1):
self.addr = addr
self.bus = smbus.SMBus(port)
# Write a single command
def write_cmd(self, cmd):
self.bus.write_byte(self.addr, cmd)
sleep(0.0001)
# Write a command and argument
def write_cmd_arg(s... | {
"content_hash": "bf6eb3d12e90d7f25cef89dd229d462c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 53,
"avg_line_length": 24.676470588235293,
"alnum_prop": 0.6436233611442194,
"repo_name": "jaschawilcox/raspi-lockout",
"id": "95fff2fa70b550b7edfbb5a8f72de276f011dd56",
"s... |
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):
def forwards(self, orm):
# Note: Don't use "from appname.models import ModelName".
# Use orm.ModelName to refer to models in t... | {
"content_hash": "8f645566249a5297feac495aabcb5955",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 195,
"avg_line_length": 82.63924050632912,
"alnum_prop": 0.552806923489316,
"repo_name": "pebble/cloudpebble",
"id": "7ffe3e1d9e0a3ea502d02600af8bd3905c3f177b",
"size": "1... |
class FDSObjectSummary(object):
"""
The FDS Object Summary class.
"""
def __init__(self):
self.bucket_name = None
self.object_name = None
self.owner = None
self.size = None
| {
"content_hash": "c3ff4a421a8ae8cf32c12e88973dcaf1",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 31,
"avg_line_length": 19.8,
"alnum_prop": 0.6212121212121212,
"repo_name": "XiaoMi/galaxy-fds-sdk-python",
"id": "158f0ec7b02ace82e04ec11f02dacf040acaa064",
"size": "198",... |
import unittest
import array
from Crypto.Cipher import AES
from Crypto.Protocol.KDF import PBKDF2
from Crypto import Random
class SimpleAESException(Exception):
pass
class PaddingError(SimpleAESException):
pass
class SimpleAES(object):
'''
AES CBC PKCS#7
Note that arguments `salt` an... | {
"content_hash": "d4968ef307e4d9db0410585259c905cf",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 79,
"avg_line_length": 29.436781609195403,
"alnum_prop": 0.5355329949238579,
"repo_name": "kristerhedfors/paddingoracle",
"id": "3a732f6426f8c49e94fc90cdea5dae98558ff56d",
... |
import sys, os
from distutils.core import setup, Extension
# Below ROOT, we expect to find include, include/libxml2, lib and bin.
# On *nix, it is not needed (but should not harm),
# on Windows, it is set by configure.js.
ROOT = r'/opt/opscode/embedded'
# Thread-enabled libxml2
with_threads = 1
# If this flag is s... | {
"content_hash": "3de4e81409285e9ff93bf01e182b9f81",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 78,
"avg_line_length": 27.827731092436974,
"alnum_prop": 0.619507775932357,
"repo_name": "jtimberman/omnibus",
"id": "085e863be4b1f6fd910bb76c420daf2409aa6442",
"size": "6... |
DOCUMENTATION = '''
---
module: group
author: Stephen Fromm
version_added: "0.0.2"
short_description: Add or remove groups
requirements: [ groupadd, groupdel, groupmod ]
description:
- Manage presence of groups on a host.
options:
name:
required: true
description:
- Name of the group... | {
"content_hash": "33f1dd74b9419934d22ce4cb68b12bf2",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 105,
"avg_line_length": 29.376744186046512,
"alnum_prop": 0.536811272957568,
"repo_name": "mith1979/ansible_automation",
"id": "51254f4ef76aa3ca3ea1f1c0e0522f0cf3a55ae0",
... |
import logging
try:
import psycopg2 as Database
except ImportError, e:
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
from librdbms.server.rdbms_base_lib import BaseRDBMSDataTable, BaseRDBMSResult, BaseRDMSClient
LOG = logging.... | {
"content_hash": "c93a806d133ef3d27834c5826020b404",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 106,
"avg_line_length": 31.008196721311474,
"alnum_prop": 0.6402326196140629,
"repo_name": "jayceyxc/hue",
"id": "ec9a29b919bb1acfb1e66b91c47af4970c602b9c",
"size": "4575"... |
from silopub import util
from silopub.ext import db
from silopub.models import Account, Tumblr
from flask import Blueprint, current_app, redirect, url_for, request, flash
from flask import session
from requests_oauthlib import OAuth1Session, OAuth1
import html
import requests
import sys
REQUEST_TOKEN_URL = 'https://w... | {
"content_hash": "f513fe928c5aef38e123d47dfbb0763c",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 86,
"avg_line_length": 37.85990338164251,
"alnum_prop": 0.6265152481817022,
"repo_name": "kylewm/feverdream",
"id": "deb6e62e7b034abfcd13e8841b055a5aacbbb0e8",
"size": "78... |
import os
import re
import csv
import generate_task_summaries
emails_by_task = {}
email_to_name = {}
DO_NOT_INCLUDE = ["bigbench@googlegroups.com"]
def get_name_for_email(line, email):
# Match: My Name (myemail@gmail.com)
match = re.search(r"([\w\s\.,<>/-]+)\s+\(?\[?'?`?" + re.escape(email), line)
if n... | {
"content_hash": "586a0d4e7979c5288e76f4e5a32891b4",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 94,
"avg_line_length": 38.504347826086956,
"alnum_prop": 0.46160794941282746,
"repo_name": "google/BIG-bench",
"id": "23930ff156b5f107dc8865ece53aa20c117a9d6d",
"size": "5... |
import numpy as np
import matplotlib.pyplot as plt
import pyeparse as pp
fname = '../pyeparse/tests/data/test_raw.edf'
raw = pp.read_raw(fname)
# visualize initial calibration
raw.plot_calibration(title='5-Point Calibration')
# create heatmap
raw.plot_heatmap(start=3., stop=60.)
# find events and epoch data
event... | {
"content_hash": "b9f7a0a9cb4f377d0f75ad53e5784c9d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 69,
"avg_line_length": 27.68888888888889,
"alnum_prop": 0.6990369181380417,
"repo_name": "drammock/pyeparse",
"id": "a8d4d348ca415ef24037df093d1f3905ba41e84d",
"size": "132... |
"""Define tests for the Ambient PWS config flow."""
import json
from unittest.mock import patch
import aioambient
import pytest
from homeassistant import data_entry_flow
from homeassistant.components.ambient_station import CONF_APP_KEY, DOMAIN, config_flow
from homeassistant.config_entries import SOURCE_USER
from hom... | {
"content_hash": "e8ea5a1830988bd1a7e5d5dc5e7e650b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 88,
"avg_line_length": 34.04807692307692,
"alnum_prop": 0.7048856255295114,
"repo_name": "FreekingDean/home-assistant",
"id": "806d31b5386b6d2c9aebfee336e6a6c8c822625e",
"... |
import importlib
import io
import operator
import pkgutil
import traceback
import types
from docutils import nodes
from docutils.parsers import rst
from docutils import utils
TAG = ':yaql:'
def _get_modules_names(package):
"""Get names of modules in package"""
return sorted(
map(operator.itemgette... | {
"content_hash": "af1b9e9128747bc9b88d621c27a70451",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 78,
"avg_line_length": 30,
"alnum_prop": 0.5585,
"repo_name": "openstack/yaql",
"id": "caba4023ea8c6d21f56afb0a65efc74ea01211df",
"size": "6611",
"binary": false,
"cop... |
import unittest
import os
import comm
import commands
class TestCrosswalkApptoolsFunctions(unittest.TestCase):
def test_list_target_platforms(self):
comm.setUp()
os.chdir(comm.TEMP_DATA_PATH)
cmd = "crosswalk-app platforms"
status = os.popen(cmd).readlines()
self.assertEqu... | {
"content_hash": "0abaa592f544889100d8b127ac10979d",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 61,
"avg_line_length": 25.88888888888889,
"alnum_prop": 0.6394849785407726,
"repo_name": "crosswalk-project/crosswalk-test-suite",
"id": "6bef381d188c5770e4c847d1246e9e987cd7... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base.page import Page
c... | {
"content_hash": "2d4d4f3596fde60206ef26e4fec6f692",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 171,
"avg_line_length": 44.71145374449339,
"alnum_prop": 0.6399330016256959,
"repo_name": "twilio/twilio-python",
"id": "bd28b4bf57860908edecb2576259ccd45b5e93f8",
"size":... |
from kivy.properties import ObjectProperty
from kivy.uix.boxlayout import BoxLayout
class HelpDialog(BoxLayout):
'''HelpDialog, in which help will be displayed from help.rst.
It emits 'on_cancel' event when 'Cancel' button is released.
'''
rst = ObjectProperty(None)
'''rst is reference to `kiv... | {
"content_hash": "51ccca2d8264b9ec29086833cde7a251",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 74,
"avg_line_length": 26.4,
"alnum_prop": 0.6420454545454546,
"repo_name": "aron-bordin/kivy-designer",
"id": "9266a4258c078608467cf75e82843deade83977a",
"size": "528",
... |
import pytest
from pysagereader.sage_ii_reader import SAGEIILoaderV700
import os
def test_loader():
sage = SAGEIILoaderV700(os.path.join(os.path.dirname(__file__), 'data'))
data = sage.load_data(min_date='1984', max_date='1985')
assert len(data.time) == 238
if __name__ == '__main__':
test_loader() | {
"content_hash": "64a921f373bf53b2c5f3259ab81eaccd",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 76,
"avg_line_length": 22.785714285714285,
"alnum_prop": 0.664576802507837,
"repo_name": "LandonRieger/pySAGE",
"id": "9700f7b2d0a1533effb082ae792bd6a676fca498",
"size": "3... |
import json
from indy import IndyError
from indy import did
import pytest
from indy.error import ErrorCode
@pytest.mark.asyncio
async def test_store_their_did_works(wallet_handle, did_my):
await did.store_their_did(wallet_handle, json.dumps({"did": did_my}))
@pytest.mark.asyncio
async def test_store_their_di... | {
"content_hash": "e5a44380b749fd45d3aa3d36e58ca212",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 96,
"avg_line_length": 34.891304347826086,
"alnum_prop": 0.735202492211838,
"repo_name": "anastasia-tarasova/indy-sdk",
"id": "0292f6164cf444a272395a05f22064ee294e3227",
"s... |
"""The functions to handle the main function"""
from argparse import ArgumentParser, SUPPRESS
from ORCSchlange.command.fetch import FetchReporeter
from ORCSchlange.command.db import DbCommand
__version__ = "0.7.1"
"""The version of the package"""
def main():
"""The main function that loads the commands."""
... | {
"content_hash": "a605cb63c6adf990e1594eab8bea64a7",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 120,
"avg_line_length": 50.55714285714286,
"alnum_prop": 0.6134501271545635,
"repo_name": "ScaDS/ORC-Schlange",
"id": "24d76fdeae4a9c5e08860fe002bc43b770a3c659",
"size": "... |
import logging
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
import re
import requests
import StringIO
import tempfile
import app_config
from plugins.base import CarebotPlugin
from util.analytics import GoogleAnalytics
from util.chart import ChartTools
from util.models import Story
from util.... | {
"content_hash": "e17641d55174e6bb383290423a135897",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 257,
"avg_line_length": 33.14963503649635,
"alnum_prop": 0.5600572498073324,
"repo_name": "thecarebot/carebot",
"id": "0cd3437d0e7d6af7a7d83f4e6d8230f1d7b54d7c",
"size": "... |
"""Unit tests for the metadata package."""
from __future__ import with_statement
import path_initializer
path_initializer.InitSysPath()
import copy
import os
import tempfile
from google.apputils import app
import gflags as flags
import unittest
from gcutil_lib import metadata
FLAGS = flags.FLAGS
class Metad... | {
"content_hash": "155605b807abe2e1ca3e0a20de13ae9a",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 78,
"avg_line_length": 31.61627906976744,
"alnum_prop": 0.6778227289444648,
"repo_name": "ychen820/microblog",
"id": "02d449e5cfcca91b281cdb5b937fab371e339257",
"size": "33... |
from __future__ import unicode_literals
import requests
import datetime
import json
try:
basestring
except NameError:
basestring = (str, bytes)
class AccessError(Exception):
def __init__(self, response):
self.status_code = response.status_code
data = response.json()
super(AccessErr... | {
"content_hash": "fe45c4b7465d33e0b1dceb985f6912f1",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 112,
"avg_line_length": 34.61739130434783,
"alnum_prop": 0.5787490580256217,
"repo_name": "wronglink/mstranslator",
"id": "5aa20576a2cb4d6e0e51371168468931c0e4a12b",
"size... |
'''
TabbedPanel
===========
.. image:: images/tabbed_panel.jpg
:align: right
.. versionadded:: 1.3.0
.. warning::
This widget is still experimental, and its API is subject to change in a
future version.
The `TabbedPanel` widget manages different widgets in tabs, with a header area
for the actual tab bu... | {
"content_hash": "6f338341c17fc54639519468d818fdf9",
"timestamp": "",
"source": "github",
"line_count": 823,
"max_line_length": 82,
"avg_line_length": 34.72904009720535,
"alnum_prop": 0.6006927436848366,
"repo_name": "hansent/kivy",
"id": "59b0dc9b96e24245595a65d53ae34d7aa1097f5f",
"size": "28582",... |
"""
Session Handling for SQLAlchemy backend
"""
from sqlalchemy import create_engine
from sqlalchemy import pool
from sqlalchemy.orm import sessionmaker
from nova import exception
from nova import flags
FLAGS = flags.FLAGS
_ENGINE = None
_MAKER = None
def get_session(autocommit=True, expire_on_commit=False):
... | {
"content_hash": "1ed2ed60c2ef08894011e6822f18beec",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 67,
"avg_line_length": 28.394736842105264,
"alnum_prop": 0.6070435588507878,
"repo_name": "superstack/nova",
"id": "4a9a28f4300981850a86db30330745b633e480a6",
"size": "1855... |
"""End-to-end test for the streaming wordcount example with debug."""
# pytype: skip-file
import logging
import unittest
import uuid
import pytest
from hamcrest.core.core.allof import all_of
from apache_beam.examples import streaming_wordcount_debugging
from apache_beam.io.gcp.tests.pubsub_matcher import PubSubMess... | {
"content_hash": "4d305ea734b21e8d8367293d6e15088d",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 80,
"avg_line_length": 34.41818181818182,
"alnum_prop": 0.6925515055467512,
"repo_name": "robertwb/incubator-beam",
"id": "b0c041c05ca0cbb6565c4296f7971ad4e6d7d1ef",
"size... |
from django.forms.fields import BooleanField
from django.test.client import RequestFactory
from django.utils.safestring import SafeText
from django.utils.translation import ugettext_lazy as _
import mock
from nose.tools import eq_, ok_
import mkt
import mkt.site.tests
from mkt.comm.models import CommunicationNote
fro... | {
"content_hash": "f887514f2501607a717c5685f0f7f763",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 79,
"avg_line_length": 38.47909967845659,
"alnum_prop": 0.5912091585192613,
"repo_name": "jasonthomas/zamboni",
"id": "d1e5824a066af97cf6a7356cc042282548b74888",
"size": "... |
import pyjd
from pyjamas.ui.RootPanel import RootPanel
from pyjamas import DOM
from pyjamas.ui.Anchor import Anchor
from pyjamas.ui.Hyperlink import Hyperlink
from pyjamas import Window
from pyjamas.ui.HTML import HTML
from pyjamas.ui.HTMLPanel import HTMLPanel
from pyjamas.ui.Label import Label
from pyjamas.ui.Image i... | {
"content_hash": "ddc1055ab06fba83b1c1626e4aa32f84",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 125,
"avg_line_length": 36.465753424657535,
"alnum_prop": 0.6450037565740045,
"repo_name": "pombredanne/pyjs",
"id": "e96303a0201aed63324cd4c0e2e4b539ebf08199",
"size": "26... |
"""
We need this module when storing files in S3 as the S3BotoStorage backend
always uses the bucket name as the root by default, but we don't want to create
two separate buckets for static and media files.
We basically want:
/bucket-name/media/ for media files
/bucket-name/static/ for static files
Source: ht... | {
"content_hash": "23884dc2a423b7711a9802466c04a42a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.7696476964769647,
"repo_name": "jcalazan/glucose-tracker",
"id": "ccac8b2538ad3e16392d337e1a849894ed9b72b6",
"siz... |
import os
import logging
import urllib.request
DOWNDIR = os.path.join(os.path.dirname(__file__), 'downloadedpapers')
URL = {
'bg-8-515-2011.pdf': 'https://www.biogeosciences.net/8/515/2011/bg-8-515-2011.pdf',
'esd-4-11-2013.pdf': 'https://www.earth-syst-dynam.net/4/11/2013/esd-4-11-2013.pdf',
'esd-4-11-20... | {
"content_hash": "46acdaf8204c818585ee25749cde833c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 110,
"avg_line_length": 23.595744680851062,
"alnum_prop": 0.648331830477908,
"repo_name": "perrette/myref",
"id": "86b60ff9c97f9c8e1ca2ca34680bf9750dc503b0",
"size": "1128"... |
"""Functionality for inspecting jax tracers."""
from .. import errors
import jax
def current_trace():
"""Returns the innermost Jax tracer."""
return jax.core.find_top_trace(())
def trace_level(main):
"""Returns the level of the trace of -infinity if it is None."""
if main:
return main.level
return fl... | {
"content_hash": "3907f3f163ff1c3c937d57a9f2fa3ed5",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 21.40909090909091,
"alnum_prop": 0.6878980891719745,
"repo_name": "google/flax",
"id": "db35e43e27f62b1ae8e753c01611da0f7b489eac",
"size": "1053",
... |
import supriya
def test_unaggregated_anonymous(server):
with supriya.SynthDefBuilder(frequency=440) as builder:
source = supriya.ugens.SinOsc.ar(frequency=builder["frequency"])
supriya.ugens.Out.ar(bus=0, source=source)
synthdef = builder.build()
assert synthdef not in server
with serv... | {
"content_hash": "02d025b606022b3a85eae478e941faf3",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 85,
"avg_line_length": 36.90728476821192,
"alnum_prop": 0.6624798133859681,
"repo_name": "Pulgama/supriya",
"id": "ef3ee57528ac71b4d611ab36d01ae74f83483b6c",
"size": "5573... |
"""
Wrapper to be used to apply a fixed delay to any `ChannelModel` by modifying the
'cm-delay' annotation.
Revision Info
=============
* $LastChangedBy: mandke $
* $LastChangedDate: 2011-09-06 16:44:24 -0500 (Tue, 06 Sep 2011) $
* $LastChangedRevision: 5121 $
:author: Ketan Mandke <kmandke@mail.utexas.edu>
:copyrig... | {
"content_hash": "b96e44a0ea1212a329c36abeaaa5fc7e",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 80,
"avg_line_length": 35.3125,
"alnum_prop": 0.6783185840707965,
"repo_name": "reidlindsay/wins",
"id": "7b0fd3c148eca7494202d051bda664e35da31c43",
"size": "2285",
"bina... |
"""
Settings for the text item.
"""
from django.conf import settings
# Allow the "cross site" feature in shared content:
FLUENT_SHARED_CONTENT_ENABLE_CROSS_SITE = getattr(settings, "FLUENT_SHARED_CONTENT_ENABLE_CROSS_SITE", True)
| {
"content_hash": "b1f69fc46d9154d19d6fc1ee3fdbb118",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 108,
"avg_line_length": 33,
"alnum_prop": 0.7619047619047619,
"repo_name": "ixc/django-fluent-contents",
"id": "f1ddcd34c71f1f4535739192760fd2d30f8075ab",
"size": "231",
"... |
{% extends "cmd_target_tmpl.py" %}
| {
"content_hash": "78d211623f84d77eaab130b9fe515a25",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 35,
"alnum_prop": 0.6285714285714286,
"repo_name": "grbd/GBD.Build.BlackJack",
"id": "32947778e1bedbb7b9d9557d6412309d86b9b08f",
"size": "35",
"bina... |
"""`Dependency` provider example."""
import abc
import dataclasses
from dependency_injector import containers, providers
class DbAdapter(metaclass=abc.ABCMeta):
...
class SqliteDbAdapter(DbAdapter):
...
class PostgresDbAdapter(DbAdapter):
...
@dataclasses.dataclass
class UserService:
database:... | {
"content_hash": "fd28761337b113170ed6853f493fe194",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 76,
"avg_line_length": 23.022222222222222,
"alnum_prop": 0.7306949806949807,
"repo_name": "ets-labs/dependency_injector",
"id": "e53b6dc4705eb4fa3536a773f283e9f7ad317dd1",
... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Prefere... | {
"content_hash": "f70b01e7457158c7de13b1c9d5051061",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 129,
"avg_line_length": 29.617391304347827,
"alnum_prop": 0.5325895478567234,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "af813807c3d7eec02b7f204c84dd9e... |
"""
This is a simple example where I(Q,E) data is already in the form
of a histogram, reduced from the raw experimental data.
All this script does is to convert I(Q,E) to Density of States
by performing multiphonon correction.
"""
import histogram.hdf as hh, os, numpy as np
# when the system is headless, do not plot
... | {
"content_hash": "ee41f49972b0477388d8295c14aa1452",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 77,
"avg_line_length": 29.78723404255319,
"alnum_prop": 0.7057142857142857,
"repo_name": "sns-chops/multiphonon",
"id": "48740d85cc4c94f56cc6a69682aca4de082ae740",
"size": ... |
import socket, os, sys, binascii, time, datetime, threading, logging, importlib
import re
"""
Rcon protocol class.
Used to establish the connection and to send keep-alive packages
Also it provides some default commands, like kickAll, sendChat , lockServer, etc...
The module loader <loadmodule(name, class)> allows the... | {
"content_hash": "8ff62d8f09cbf912fae85c2cd53b58ec",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 132,
"avg_line_length": 32.1986301369863,
"alnum_prop": 0.5747004183507055,
"repo_name": "Au1st3in/au1st3in.net",
"id": "f4514662afb6bbd06a36971f172820cf31501830",
"size":... |
import weechat as w
import time
SCRIPT_NAME = "buffer_autoclose"
SCRIPT_AUTHOR = "xt <xt@bash.no>"
SCRIPT_VERSION = "0.4"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "Automatically close inactive private message buffers"
settings = {
'interval': '1', # How often in minutes to check
'age_limit': '30',... | {
"content_hash": "2f011b83d0c532976aba199fa0ef76cf",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 106,
"avg_line_length": 37.73737373737374,
"alnum_prop": 0.5784261241970021,
"repo_name": "deepredsky/dotfiles",
"id": "303f5b37cc84bf11242b4cee905fe82261ecd124",
"size": "... |
from horizon.test import helpers as test
class ActionsTests(test.TestCase):
# Unit tests for add_provider.
def test_me(self):
self.assertTrue(1 + 1 == 2)
| {
"content_hash": "ddce853149fc7608100c59cb912bcdb9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.6744186046511628,
"repo_name": "emitrom/integra-openstack-ui",
"id": "6a1b3f7b473643b30877263203a9d65a0f8ea81e",
"... |
from msrest.paging import Paged
class SBAuthorizationRulePaged(Paged):
"""
A paging container for iterating over a list of :class:`SBAuthorizationRule <azure.mgmt.servicebus.models.SBAuthorizationRule>` object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'cu... | {
"content_hash": "c11b5622fa116696fc8513d80a007fce",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 138,
"avg_line_length": 31.5,
"alnum_prop": 0.6388888888888888,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "24c4f71b00015fc2e14a090315a6c198e44792c8",
"size": "978"... |
"""
Window arrangement.
This contains the data structure for the tab pages with their windows and
buffers. It's not the same as a `prompt-toolkit` layout. The latter directly
represents the rendering, while this is more specific for the editor itself.
"""
from __future__ import unicode_literals
from six import string_... | {
"content_hash": "92aed50fa6e32e1d16feffbc94760628",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 99,
"avg_line_length": 32.935543278084715,
"alnum_prop": 0.5747036457168418,
"repo_name": "tianzhihen/pyvim",
"id": "2315752dae068a17f6dd731fe7f838256f5bda9d",
"size": "17... |
"""Attribute implementation for _Dispatch classes.
The various listener targets for a particular event class are represented
as attributes, which refer to collections of listeners to be fired off.
These collections can exist at the class level as well as at the instance
level. An event is fired off using code like th... | {
"content_hash": "453b66fb5e68f266ffd82f707c71204a",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 77,
"avg_line_length": 30.82125603864734,
"alnum_prop": 0.5983542319749217,
"repo_name": "wujuguang/sqlalchemy",
"id": "9dfa89809dc985d5504055c2260f58ed93b50baf",
"size": ... |
def extractKuromarutranslationsHomeBlog(item):
'''
Parser for 'kuromarutranslations.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": "6552f0ddf65e1b27cc1654ec4b82b712",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 27.19047619047619,
"alnum_prop": 0.6427320490367776,
"repo_name": "fake-name/ReadableWebProxy",
"id": "5c946ed920425c4b70d36c0c9554e2b83b8da626",
"s... |
from rapidsms.backends.base import BackendBase as RapidBackendBase
class BackendBase(RapidBackendBase):
"""
Backend that overrides the default RapidSMS backend to keep threads
from starting.
"""
def start(self):
""" Override BackendBase.start(), which never returns """
self._runni... | {
"content_hash": "472173db692417551209dadf6eb8394d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 27.5,
"alnum_prop": 0.693939393939394,
"repo_name": "caktus/rapidsms-threadless-router",
"id": "f9b93a6f7dab159899b3088cdb0cf3f604ade6cc",
"size": "3... |
import numpy as np
import pytest
import pandas as pd
import pandas.util.testing as tm
@pytest.fixture
def sparse_df():
return pd.SparseDataFrame({0: {0: 1}, 1: {1: 1}, 2: {2: 1}}) # eye
@pytest.fixture
def multi_index3():
return pd.MultiIndex.from_tuples([(0, 0), (1, 1), (2, 2)])
@pytest.mark.filterwarn... | {
"content_hash": "015435991517261473a3cb311e6df91e",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 83,
"avg_line_length": 31.767441860465116,
"alnum_prop": 0.6793557833089312,
"repo_name": "kushalbhola/MyStuff",
"id": "bb5232f065a0496aeba1720672529d8e076beb73",
"size": "... |
'''
@Autor: Esperanza Ramirez Armijos
@Tema: Pronosticador del Futbol Ecuatoriano
@Descripcion: Contiene la clase info_liga para procesar y almacenar la información sobre las estadísticas contenida en los distintos archivos .txt:
'''
import sys
import os
# CLASE INFO_LIGA
class info_liga:
#Constructor que solo ... | {
"content_hash": "57e1670c73c28b9f346e4374ec0a1283",
"timestamp": "",
"source": "github",
"line_count": 435,
"max_line_length": 147,
"avg_line_length": 32.52183908045977,
"alnum_prop": 0.5270375344596028,
"repo_name": "mariaesperanza/Pronosticador",
"id": "b13c4e51d4b3117d98b37b4d885dede1b0487694",
... |
"""Provides an API for generating Event protocol buffers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import time
import warnings
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import summary_pb2
from t... | {
"content_hash": "4aaf7d3ac234782e3dd57c74cc9c94b1",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 83,
"avg_line_length": 39.51558752997602,
"alnum_prop": 0.6844277218108994,
"repo_name": "adit-chandra/tensorflow",
"id": "9757ed7db4f4c52582ee59084cf045693f23211a",
"size... |
"""Rename ``concurrency`` column in ``dag`` table to`` max_active_tasks``
Revision ID: 30867afad44a
Revises: e9304a3141f0
Create Date: 2021-06-04 22:11:19.849981
"""
from __future__ import annotations
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '30867afad44a'
d... | {
"content_hash": "5251af9466a27df4fcd70dcf368fdc02",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 88,
"avg_line_length": 27.319148936170212,
"alnum_prop": 0.617601246105919,
"repo_name": "cfei18/incubator-airflow",
"id": "44c74778362467a7371f23e27a76f6c4586c2cf5",
"size... |
from test.vim_test_case import VimTestCase as _VimTest
from test.constant import *
from test.util import running_on_windows
class _ExpandTabs(_VimTest):
def _extra_vim_config(self, vim_config):
vim_config.append("set sw=3")
vim_config.append("set expandtab")
class RecTabStopsWithExpandtab_Simple... | {
"content_hash": "e8e6a884c605f4436ec415537f8b0981",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 121,
"avg_line_length": 30.1523178807947,
"alnum_prop": 0.6479244454206018,
"repo_name": "khatchad/vimrc",
"id": "8c5c3152d76aa0742eb697c1f673b7f15363e469",
"size": "4553"... |
"""
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print(df.format('jS F Y H:i'))
7th October 2003 11:39
>>>
"""
from __future__ import unicode_literals
import calendar
import datetime... | {
"content_hash": "d257cddc6e4682b0ca3c2459ae33b42e",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 102,
"avg_line_length": 32.07774798927614,
"alnum_prop": 0.5370664437944004,
"repo_name": "yephper/django",
"id": "2f6ad431f60e0154db1c2cd63cb57c30205e8739",
"size": "1196... |
class UdacityPipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "f7662107a07e31ddd9a0f4007131c7b4",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 31,
"alnum_prop": 0.6881720430107527,
"repo_name": "cdhekne/Masters_Thesis",
"id": "10d6761318c86a7c4afccb0eed2ea490358bc992",
"size": "287",
"binar... |
import sys
import random
import string
import pycurl
import json
#STEP 2 INIT BOOLS
josh = False
bcheap = False
ncheap = False
decided = False
#STEP 3 CHECK ARGS, WARN FOR SHIT INPUT
if len(sys.argv) > 2:
if (sys.argv[1] == 'cheap' and sys.argv[2] == 'ncheap') or (sys.argv[1] == 'ncheap' and sys.argv[2] == 'cheap'):
... | {
"content_hash": "bb402a5f8130ae9af7afa029160868b1",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 113,
"avg_line_length": 25.472727272727273,
"alnum_prop": 0.7009279086366881,
"repo_name": "packetracer/lunch",
"id": "41a299d4ab02273f421729fa4c84beff5a10a1f1",
"size": "... |
from backend.common.consts.award_type import AwardType
class DistrictPointValues:
"""
A class that contains various district point constants over the years:
Documents containing point systems:
- 2016: same as 2015
- 2015: http://www.firstinspires.org/sites/default/files/uploads/resource_library/... | {
"content_hash": "0612eccef2aed7a821e59d7ebb2505bd",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 148,
"avg_line_length": 34.422360248447205,
"alnum_prop": 0.6086250451100685,
"repo_name": "the-blue-alliance/the-blue-alliance",
"id": "767443f515835cbcbdfab1204610c60401f3... |
""" Garret's python vs panda comparison of speed for matching N**2 problem"""
# `list(enumerate(sents))` and `dict(map(lambda x: x[::-1], enumerate(sents))`
import pandas as pd
| {
"content_hash": "351da8da15e38564293b962df706028c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 78,
"avg_line_length": 59,
"alnum_prop": 0.7005649717514124,
"repo_name": "hobson/hobson.github.io",
"id": "d83ce2be4b647c62e4d34d973644d1606f92659d",
"size": "177",
"bina... |
problem = """
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are not sums they are not included.
"""
from math import factorial
from itertools import takewhile, count, combinations_with... | {
"content_hash": "56ef54f7fba6462f24886e1a6b01e8d4",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 113,
"avg_line_length": 32.15151515151515,
"alnum_prop": 0.6654099905749293,
"repo_name": "lorenyu/project-euler",
"id": "782b5f9f6f1300262d14e90adef9c45518404e36",
"size":... |
"""
Package for script API properties tests.
"""
__version__ = "$Revision-Id:$"
| {
"content_hash": "27abb1be2f72f829425be25659a9dade",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 40,
"avg_line_length": 14.166666666666666,
"alnum_prop": 0.6,
"repo_name": "DLR-SC/DataFinder",
"id": "298ff964c7d2122ceca1ba1f61a52e51b10d1735",
"size": "1781",
"binary":... |
"""Manifest validation."""
from typing import Dict
import voluptuous as vol
from voluptuous.humanize import humanize_error
from .model import Integration
MANIFEST_SCHEMA = vol.Schema({
vol.Required('domain'): str,
vol.Required('name'): str,
vol.Optional('config_flow'): bool,
vol.Optional('zeroconf')... | {
"content_hash": "e6c0d0fb3c4eb58a50ad06efb071e32a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 75,
"avg_line_length": 30.294117647058822,
"alnum_prop": 0.6394822006472491,
"repo_name": "jabesq/home-assistant",
"id": "3e25ab31712c6c9fe20fc37f4a2ad4716c0131d6",
"size":... |
from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404
from fly_project import settings
from api.models import Badge, Me, Notification
@login_required(... | {
"content_hash": "4bf55008a648c543b49cdc2afcd30e88",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 32.44827586206897,
"alnum_prop": 0.6726886291179596,
"repo_name": "evan-rusin/fly-project",
"id": "4d8e3e0ce506a3da81bc0acd1ec60103be0a12f8",
"size":... |
""" Startup script for the server."""
import argparse
import sys
import tornado.web
import socket
import tornado.options
from metadatastore.mds import MDS, MDSRO
from metadataservice.server.engine import (RunStartHandler, RunStopHandler,
EventDescriptorHandler,
... | {
"content_hash": "42251e202182d0f73c8c92d79614ff13",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 85,
"avg_line_length": 44.934065934065934,
"alnum_prop": 0.595255563707508,
"repo_name": "NSLS-II/metadataservice",
"id": "90234328c80d3e8e9777954e6a6f24eeed27acfa",
"size"... |
"""Support for Dyson Pure Cool Link Sensors."""
from libpurecool.dyson_pure_cool import DysonPureCool
from libpurecool.dyson_pure_cool_link import DysonPureCoolLink
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ICON,
ATTR_UNIT_OF_MEASUREM... | {
"content_hash": "007f5963d44efec095d440f1d852dd4c",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 91,
"avg_line_length": 33.693548387096776,
"alnum_prop": 0.6376256582096697,
"repo_name": "FreekingDean/home-assistant",
"id": "be83a7e43735b192b7a8ae6e8d16ed0ef2b6b39a",
... |
from joommf.energies.baseenergy import energy
import textwrap
class Exchange(energy):
def __init__(self, A):
energy.__init__(self, "Exchange")
self.A = A
def get_mif(self):
exchange_mif = textwrap.dedent("""\
Specify Oxs_UniformExchange {{
... | {
"content_hash": "12cf7036ec6a2532ec585e7932aa34fc",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 24.294117647058822,
"alnum_prop": 0.5060532687651331,
"repo_name": "ryanpepper/oommf-python",
"id": "d00b0f89300a64f55570cce841d952bb394e96ed",
"size... |
import sys
sys.path.insert(1, "../../")
import h2o, tests
def varimp_test():
train = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
# Run GBM
my_gbm = h2o.gbm(y=train["class"], x=train[1:4], ntrees=50, learn_rate=0.1, distribution="multinomial")
should_be_none = my_gbm.... | {
"content_hash": "4c247a8bad7683b55b01f850da47e53f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 120,
"avg_line_length": 42.17391304347826,
"alnum_prop": 0.6134020618556701,
"repo_name": "junwucs/h2o-3",
"id": "96cf0380e8b29fa865c8f094cd5432ea234f382d",
"size": "970",
... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
# Create one-input, one-output, no-fee transaction:
class RawTransactionsTest(BitcoinTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_cl... | {
"content_hash": "a3f7ae2f79ca43acffb313de2cb7eb28",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 147,
"avg_line_length": 42.05343511450382,
"alnum_prop": 0.6169903793791977,
"repo_name": "krzysztofwos/BitcoinUnlimited",
"id": "40c9fa252154a01ae3f619614d9f6cb5b076eda7",
... |
from itsdangerous import BadSignature, BadTimeSignature
from sqlalchemy.exc import IntegrityError
from flask_jsonschema import ValidationError
from app.api.decorators import json_response
from app.api.errors import forbidden
from app.api.errors import not_acceptable # noqa
from . import auth
@auth.errorhandler(Integ... | {
"content_hash": "2d2100a064c4ef8ea1e9f327c671edfd",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 78,
"avg_line_length": 27.973684210526315,
"alnum_prop": 0.7281279397930386,
"repo_name": "certeu/do-portal",
"id": "22e874fa73f3b2b5f3ba76f8b6fcd84526f3a4b3",
"size": "106... |
'''OpenGL extension NV.texture_expand_normal
This module customises the behaviour of the
OpenGL.raw.GL.NV.texture_expand_normal to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a remapping mode where unsigned texture
components (in the range [0,1]) can be treated as though ... | {
"content_hash": "624b09d35578a42e0b7cc75d33677aa9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 37.7037037037037,
"alnum_prop": 0.7966601178781926,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "e96e6b741eb038a0a15713c4b308feca821b2216",... |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| {
"content_hash": "d8d5e0425d9fe7703e6188c153a83b35",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 37.5,
"alnum_prop": 0.6533333333333333,
"repo_name": "gds-attic/backdrop-collector",
"id": "2d8a5192bd299b1c73745faff499ab517be7249c",
"size": "143",
... |
'''HiFive1-specific (flash only) runner.'''
from os import path
from runners.core import ZephyrBinaryRunner, RunnerCaps
class HiFive1BinaryRunner(ZephyrBinaryRunner):
'''Runner front-end for the HiFive1 board, using openocd.'''
def __init__(self, cfg):
super().__init__(cfg)
self.openocd_con... | {
"content_hash": "03f1d4a8e7c7ead22d0246b567c39d2e",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 80,
"avg_line_length": 29.86046511627907,
"alnum_prop": 0.5919003115264797,
"repo_name": "finikorg/zephyr",
"id": "1a72d3018e114c28891b67b600291e592aedb8f8",
"size": "1359"... |
import arcpy, pythonaddins
import os, urllib2, json, zipfile
class dl2012(object):
"""Implementation for dl2012.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = "Rectangle"
def onMouseDown(self, x, y, button, shift):
pass
def onMouseDow... | {
"content_hash": "9f49252bcdcea120775db633558534a6",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 275,
"avg_line_length": 49.013698630136986,
"alnum_prop": 0.6260480715483511,
"repo_name": "RowanGeolab/arcgisPythonAddins",
"id": "eca3b9ad512a02e9226b2e1d51e1a21ceb29bfb3"... |
from marshmallow import Schema, fields
from api.tags.schemas import TagSchema
class FileSchema(Schema):
tags = fields.Nested(TagSchema, attribute="tags", many=True)
class Meta:
fields = ("sha1",
"sha256",
"md5",
"timestamp_first_scan",
... | {
"content_hash": "d9f55123ecca4681f007d18bb75362e1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 27,
"alnum_prop": 0.49074074074074076,
"repo_name": "quarkslab/irma",
"id": "0476926dd071d28586f1cee277db303785db8227",
"size": "957",
"binary": fa... |
"""
ncurses interface
"""
import sys
import curses
import sys_backlight
from .. import backlight
keys = {
'esc': 27,
'q': 113,
'up': 259,
'down': 258,
'left': 260,
'right': 261
}
alias = {
'esc': 'quit',
'q': 'quit',
'up': 'inc',
'down': 'dec',
'left': 'min',
'right':... | {
"content_hash": "fdb580f9b9f338940be177a4efe244a2",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 78,
"avg_line_length": 21.919354838709676,
"alnum_prop": 0.5349521707137601,
"repo_name": "hamgom95/sys_backlight",
"id": "46ed581296d892e5e725d1f9999dd9020b754b2e",
"size"... |
import unittest
from airflow.models import Connection
from airflow.providers.apache.spark.hooks.spark_jdbc import SparkJDBCHook
from airflow.utils import db
class TestSparkJDBCHook(unittest.TestCase):
_config = {
'cmd_type': 'spark_to_jdbc',
'jdbc_table': 'tableMcTableFace',
'jdbc_driver... | {
"content_hash": "b68b8b628de81dfda23fa3adbd020adc",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 88,
"avg_line_length": 30.896296296296295,
"alnum_prop": 0.5202589307120594,
"repo_name": "DinoCow/airflow",
"id": "bd80bccdd8072ae4f945a648b7cab74d61644831",
"size": "496... |
"""quick and dirty test"""
import unittest
import subprocess
import os
class MyTest(unittest.TestCase):
"""RNA Alignment test"""
def test_rna_align_find_seq_in_alignment(self):
print('----------------------------------------------------------------------')
cmd = "./rna_align_find_seq_in_alignm... | {
"content_hash": "077a807facf68517f5ebc942e4c3679c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 128,
"avg_line_length": 39.6271186440678,
"alnum_prop": 0.47005988023952094,
"repo_name": "m4rx9/rna-pdb-tools",
"id": "69a2660db0cd799535ce47a311053fcbf675a571",
"size": "... |
'''tzinfo timezone information for Etc/GMT0.'''
from pytz.tzinfo import StaticTzInfo
from pytz.tzinfo import memorized_timedelta as timedelta
class GMT0(StaticTzInfo):
'''Etc/GMT0 timezone definition. See datetime.tzinfo for details'''
zone = 'Etc/GMT0'
_utcoffset = timedelta(seconds=0)
_tzname = 'GMT'... | {
"content_hash": "0f302215c9bd6619ea509f2310d2aa0a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 28.083333333333332,
"alnum_prop": 0.7210682492581603,
"repo_name": "gauribhoite/personfinder",
"id": "ce857ca06d75d61b938df871d594ff243eebc962",
"siz... |
"""
Functions for provisioning environments with fabtools (eat shit puppet!)
"""
# standard library
import sys
import copy
import os
from distutils.util import strtobool
# 3rd party
import fabric
from fabric.api import env, task, local, run, settings, cd, sudo, lcd
import fabtools
from fabtools.vagrant import vagrant_... | {
"content_hash": "09322f7f837832d7218d0c2366cf8b17",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 72,
"avg_line_length": 28.795454545454547,
"alnum_prop": 0.6566692975532754,
"repo_name": "bjlange/revenge",
"id": "0bc4dcb4fe2bb8069846bfbe293a614fb4dc3a7a",
"size": "380... |
import logging
import sys
import xml.dom.minidom
from pysnmp.entity.rfc3413.oneliner import cmdgen
from snmputils import print_validation_error, splunk_escape
__author__ = 'John Oxley'
class SnmpStanza:
"""
A class to represent a SNMP stanza in inputs.conf
"""
def __init__(self):
self.conf... | {
"content_hash": "c9edc0c9ad6348dd1917b33b21465e28",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 110,
"avg_line_length": 39.36054421768708,
"alnum_prop": 0.5782924300034566,
"repo_name": "liquidtelecom/splunk-snmpmod",
"id": "fe5cd7af53d96ab428b7a527cb2bcdb6a37eff4f",
... |
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from collections import OrderedDict
from django.utils import timezone
from snisi_web.views.upload import (
handle_report_upload as original_handle_report_upload)
from snisi_nutrition.xls_imp... | {
"content_hash": "1fb02e8d34363ea096a39bfafb4473d0",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 78,
"avg_line_length": 36.91379310344828,
"alnum_prop": 0.6510976179355441,
"repo_name": "yeleman/snisi",
"id": "04cc80fcf0b9843a3bd1479afaecfbe8b7d1e61e",
"size": "4362",... |
from bisect import bisect_left
from whoosh.compat import iteritems, xrange
from whoosh.filedb.compound import CompoundStorage
from whoosh.filedb.fieldcache import FieldCache, DefaultFieldCachingPolicy
from whoosh.matching import FilterMatcher
from whoosh.reading import IndexReader, TermNotFound
from whoosh.store impor... | {
"content_hash": "639e2e54271f20b2afc64099a977e3c6",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 79,
"avg_line_length": 36.06837606837607,
"alnum_prop": 0.6022116903633491,
"repo_name": "mozilla/popcorn_maker",
"id": "9c63691af2ec247482474d49f715174bdafa25c2",
"size":... |
from __future__ import absolute_import
__author__ = 'chad nelson'
__project__ = 'blowdrycss'
# TODO: Consider what it would take to handle shorthand property 'font'.
class FontParser(object):
""" **Features:**
- Parses unquoted font families.
Unquoted Font-Family References:
| http://www.cssf... | {
"content_hash": "6c6c48f18aa88be54a5ed5a3a431456f",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 120,
"avg_line_length": 38.56410256410256,
"alnum_prop": 0.5784574468085106,
"repo_name": "nueverest/BlowDryCSS",
"id": "afc2cd8ea75ebde9a1f7e884a9b77d47cd44a69a",
"size": ... |
"""
This script is for creating download reports for a given folder, recursively.
Examples:
girder audit-logs-report
--folder=57557fac8d777f68be8f3f49
--start-date=2018-09-10T13:55:34.847Z
--end-date=2018-09-13T13:55:34.847Z
--output report.csv
girder audit-logs-report -f 57557f... | {
"content_hash": "99ed5ae64a0054d62cdcdec6a76c2fe9",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 99,
"avg_line_length": 31.20731707317073,
"alnum_prop": 0.6307151230949589,
"repo_name": "girder/girder",
"id": "f00fd82e2c463c1d9a87076037e877605ed7d014",
"size": "2559",
... |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem363.py
#
# Bézier Curves
# =============
# Published on Sunday, 18th December 2011, 10:00 am
#
# A cubic Bézier curve is defined by four points: P0, P1, P2 and P3.
import projecteuler as pe
def main():
pass
if __name__ == "__main__":
main()
| {
"content_hash": "98e49f855818231fdc4a28b6045c0e9e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 19.375,
"alnum_prop": 0.6129032258064516,
"repo_name": "olduvaihand/ProjectEuler",
"id": "3fa3fccf761986dbac3e06927d3aea743bbf1c1e",
"size": "314",
... |
"""
An APF auth plugin to provide SSH key info.
"""
import base64
import logging
import os
import traceback
# Does not need to be a thread because it doesn't need to perform asynch actions.
class SSH(object):
"""
Container for SSH account info.
Works with provided filepaths.
Work with ... | {
"content_hash": "14dd7ca6b62089b05e52dd5d9ee1d166",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 103,
"avg_line_length": 36.25179856115108,
"alnum_prop": 0.5562611629291526,
"repo_name": "btovar/autopyfactory",
"id": "f6d882bee6e7bba6c3adcc2e4c0f4bd3fc34ca36",
"size":... |
import re
from django.urls import reverse_lazy
from django.http import HttpResponseRedirect
from django.contrib import messages
from django.conf import settings
from core import models
EXEMPT_URLS = [re.compile(expr) for expr in settings.LOGIN_EXEMPT_URLS]
EXEMPT_URLS += [re.compile(expr) for expr in settings.ROOT_C... | {
"content_hash": "0e8db1ea450c69a40342303ff3d0ea2b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 32.16,
"alnum_prop": 0.7052238805970149,
"repo_name": "telminov/ca",
"id": "d3d38fab10a65df1ce6914234061ddefe775dff1",
"size": "804",
"binary": fal... |
from __future__ import absolute_import
import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone()
df = b1.mPastData
#df.tail(10)
#df[:-10].tail()
#df[:-10:-1]
#df.describe()
lEngine = autof.cForecastEngine()
lEngine
H = b1.mHorizon;
#... | {
"content_hash": "0d4056358256298dff25c135805a7b26",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 83,
"avg_line_length": 25.280701754385966,
"alnum_prop": 0.7244968771686329,
"repo_name": "antoinecarme/pyaf",
"id": "58642401d7e5d4ecf471bd62f2b3231ebe32a1bb",
"size": "14... |
"""
Sliding-window-based job/task queue class (& example of use.)
May use ``multiprocessing.Process`` or ``threading.Thread`` objects as queue
items, though within Fabric itself only ``Process`` objects are used/supported.
"""
from __future__ import with_statement
import time
import Queue
from collections import deq... | {
"content_hash": "818dfb9aad71601cb0aced07b0eaea0b",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 98,
"avg_line_length": 33.755639097744364,
"alnum_prop": 0.5425993985967257,
"repo_name": "getsentry/fabric",
"id": "41476709da7627abb03e9e3256af917b82ac4bab",
"size": "89... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.