text stringlengths 4 1.02M | meta dict |
|---|---|
"""ActiveMaster definition."""
from config_bootstrap import Master
class PDFiumTryserver(Master.Master4a):
project_name = 'PDFiumTryserver'
master_port = 21405
slave_port = 31405
master_port_alt = 26405
buildbot_url = 'https://build.chromium.org/p/tryserver.client.pdfium/'
buildbucket_bucket = 'master.try... | {
"content_hash": "73f8f3843b43962e04097920db206c78",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 72,
"avg_line_length": 34.083333333333336,
"alnum_prop": 0.7603911980440098,
"repo_name": "eunchong/build",
"id": "2c1c703712ecdfcaf6bb0b5b7beeb0f276c9eaa4",
"size": "744",... |
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from io import StringIO
from test import support
class StdIOBuffer(StringIO):
pass
class TestCase(unittest.TestCase):
def assertEqual(self, obj1, obj2):
if obj1... | {
"content_hash": "139eec5e7e65a33303fdc4055b44bbdb",
"timestamp": "",
"source": "github",
"line_count": 4429,
"max_line_length": 112,
"avg_line_length": 32.567848272747796,
"alnum_prop": 0.5293289795691992,
"repo_name": "MalloyPower/parsing-python",
"id": "03c95fade4125e27d49f68e232f878295a292b2b",
... |
from django.contrib.auth.models import User
from djblets.webapi.errors import PERMISSION_DENIED
from reviewboard.reviews.models import ScreenshotComment
from reviewboard.webapi.resources import resources
from reviewboard.webapi.tests.base import BaseWebAPITestCase
from reviewboard.webapi.tests.mimetypes import (
s... | {
"content_hash": "8a39d82b08d8eb42b4ef125f4e14f4ec",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 79,
"avg_line_length": 41.2,
"alnum_prop": 0.6084142394822006,
"repo_name": "reviewboard/reviewboard",
"id": "009cedcaf3a143df5553829d3b4754b09e6bab4e",
"size": "16686",
... |
from __future__ import absolute_import
from ..client import MultiClient
from ..shell import MultiShell
class MultiSwift(MultiClient):
def __init__(self):
super(MultiSwift, self).__init__()
self.default_executable = 'swift'
self.prefix_list += ["swift_", "swiftclient_"]
def main_client(... | {
"content_hash": "f8629a1ef3312048c8a259ac0c562256",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 54,
"avg_line_length": 23.705882352941178,
"alnum_prop": 0.6699751861042184,
"repo_name": "testeddoughnut/multistack",
"id": "e13ae039d8e42e30d85422c61dcb9613c5a98cbf",
"si... |
"""
File: functional/test_email_validation.py
Creator: MazeFX
Date: 25-7-2016
1st functional test construct written by following the book
'Test Driven Development with Python' by Harry Percival.
Thanks Harry for giving me a guideline to becoming a good developer.
User description:
-----------------
Name: Dave
Occupa... | {
"content_hash": "d73450904bcc09659201cdb92548e3a5",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 84,
"avg_line_length": 39.25609756097561,
"alnum_prop": 0.6784715750232991,
"repo_name": "MazeFX/cookiecutter_website_project",
"id": "781b1dc8f52480a50232e5e101d28911d5022df... |
from couchdb import design
class CouchView(design.ViewDefinition):
def __init__(self):
params = {
'design': '_design/ctx',
'name': self.view_name,
'language': 'python',
}
if hasattr(self, 'map_fun'):
params['map_fun'] = self.map_fun
... | {
"content_hash": "f217f0dc046776f7560d0f9d8306e5d5",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 60,
"avg_line_length": 21.711111111111112,
"alnum_prop": 0.5496417604912999,
"repo_name": "kevinjqiu/ctx",
"id": "5c267bbda56117ec7a654b9e3743e003db7e232d",
"size": "977",
... |
"""Utils to run ipmitool for data collection"""
from oslo_concurrency import processutils
from ceilometer.i18n import _
from ceilometer.ipmi.platform import exception as ipmiexcept
from ceilometer import utils
# Following 2 functions are copied from ironic project to handle ipmitool's
# sensor data output. Need code... | {
"content_hash": "575e9fa8bcf4d084d5cfb14c72bd636d",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 79,
"avg_line_length": 33.00847457627118,
"alnum_prop": 0.6030808729139923,
"repo_name": "Juniper/ceilometer",
"id": "3aefddd9764fa862a29d50f0c21cf921aab5e2c0",
"size": "4... |
import os
from twilio.rest import Client
# Initialize the client
# To set up environmental variables, see http://twil.io/secure
account = os.environ['TWILIO_ACCOUNT_SID']
token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account, token)
credential = client.chat \
.credentials("CRXXXXXXXXXXXXXXXXXXXXXXXXXXXX... | {
"content_hash": "3d433f75325aeb34af1b1cff04cf975a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 32.07142857142857,
"alnum_prop": 0.7594654788418709,
"repo_name": "TwilioDevEd/api-snippets",
"id": "ca76dac563ae8b40b6f8a7405d5d8f3fb63e89b8",
"size... |
import datetime
from osmaxx.user_messaging.interaction import add_user_message
from django.conf import settings
from django.contrib import messages
from django.core import mail
from django.core.cache import cache
from django.utils.translation import gettext as _
class Emissary:
def __init__(self, recipient):
... | {
"content_hash": "08136a0713ccab2789ce648ef99dbbd8",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 119,
"avg_line_length": 34.16279069767442,
"alnum_prop": 0.6221919673247107,
"repo_name": "geometalab/osmaxx",
"id": "c55194228621227862cdfefbc9335550d337ce6a",
"size": "29... |
from kfp import compiler
from kfp import dsl
from kfp.dsl import component
@component
def flip_coin_op() -> str:
"""Flip a coin and output heads or tails randomly."""
import random
result = 'heads' if random.randint(0, 1) == 0 else 'tails'
return result
@component
def print_op(msg: str):
"""Prin... | {
"content_hash": "988f76138601d7e3a7afd4a0a9b00727",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 72,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.6226611226611226,
"repo_name": "kubeflow/pipelines",
"id": "febd3b6744d9910cc22b2e5adc93f6a8b66f9bca",
"size": "1... |
"""Helpers for config validation using voluptuous."""
from __future__ import annotations
from collections.abc import Callable, Hashable
import contextlib
from datetime import (
date as date_sys,
datetime as datetime_sys,
time as time_sys,
timedelta,
)
from enum import Enum
import inspect
import logging... | {
"content_hash": "e91c8fe0baba3573ba33346371adf8dc",
"timestamp": "",
"source": "github",
"line_count": 1820,
"max_line_length": 106,
"avg_line_length": 28.42197802197802,
"alnum_prop": 0.5970654191153727,
"repo_name": "w1ll1am23/home-assistant",
"id": "35191d7704245eed70b2994392ef42492dd455c7",
"s... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.webpubsub import WebPubSubManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-webpubsub
# USAGE
python web_pub_sub_list_keys.py
Before run the sample, please set the values of the client ID, tenant ID ... | {
"content_hash": "c40a49daff09af86650d53a443d5efee",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 147,
"avg_line_length": 34.18181818181818,
"alnum_prop": 0.7375886524822695,
"repo_name": "Azure/azure-sdk-for-python",
"id": "05ad703ad8f9ff51f23c43f3993167bbf6cf4d19",
"s... |
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
def cross_entropy2d(input, target, weight=None, size_average=True):
n, c, h, w = input.size()
log_p = F.log_softmax(input)
log_p = log_p.transpose(1, 2).transpose(2, 3).contiguous().view(-1, c)
log_p = log_p[target.v... | {
"content_hash": "f56a2428ee9519cfe6c2cfe0f1feefe1",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 30.57894736842105,
"alnum_prop": 0.6247848537005164,
"repo_name": "ibadami/pytorch-semseg",
"id": "b1bd325392fc6fdc30ab870dfc2dd66ad198b1e0",
"size":... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Food',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fa... | {
"content_hash": "dd56285bbb0dfb9a433b6a04065a0d0c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 114,
"avg_line_length": 31.94871794871795,
"alnum_prop": 0.5008025682182986,
"repo_name": "kevinharvey/fridge",
"id": "babf3d90ccb20104aaf30621c52c7bdd5be27c89",
"size": "1... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import json
from oslo_db import exception as oslo_db_exc
import sqlalchemy as sa
from sqlalchemy.orm import exc as db_exc
from congress.db import api as db
from congress.db import model_base
from congress.db ... | {
"content_hash": "bc104c947543274eb29a1f77ed02e4d4",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 78,
"avg_line_length": 34.09836065573771,
"alnum_prop": 0.6139423076923077,
"repo_name": "openstack/congress",
"id": "8b6750a56b9c8ab92c799ce6cdb569f73c395e22",
"size": "4... |
class LandingPage(object):
BUTTON_LOGIN = "Login"
PROGRAM_INFO_TAB = "Program Info"
class PageHeader(object):
# dropdown toggle
PROPLE_LIST_WIDGET = "Admin Dashboard"
class LhnMenu(object):
# create new program
DATE_FORMATTING = "%d/%m/%Y"
OBJECT_REVIEW = "Object Review"
PRIVATE_PROGRAM = "Private P... | {
"content_hash": "cdfeb19dbc6fa9d873498f5a5d7187f6",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 72,
"avg_line_length": 24.405797101449274,
"alnum_prop": 0.6876484560570071,
"repo_name": "jmakov/ggrc-core",
"id": "d19d57bee42de7cdc0c304805e9308456ec27027",
"size": "192... |
import time
from pulsar import HttpException, MethodNotAllowed, ImproperlyConfigured
from pulsar.apps.wsgi import Json
from lux import Parameter
from ..views import RestRouter, AuthenticationError
try:
import jwt
except ImportError:
jwt = None
from .. import AuthBackend
from ..forms import LoginForm
class... | {
"content_hash": "259d6a3444f663e9769327af68e5956e",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 78,
"avg_line_length": 32.42028985507246,
"alnum_prop": 0.5809119356280733,
"repo_name": "tazo90/lux",
"id": "18dbf6935c21c48b802f756891fce7e30f59ec50",
"size": "4474",
... |
"""This module contains Google Compute Engine links."""
from __future__ import annotations
from typing import TYPE_CHECKING
from airflow.models import BaseOperator
from airflow.providers.google.cloud.links.base import BaseGoogleLink
if TYPE_CHECKING:
from airflow.utils.context import Context
COMPUTE_BASE_LINK =... | {
"content_hash": "943449b2e6c5f0dbb01261a720d0efb7",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 107,
"avg_line_length": 30.210526315789473,
"alnum_prop": 0.6327526132404181,
"repo_name": "apache/airflow",
"id": "c2f15b273004bdbd54f19e317d82dfad3a7482a6",
"size": "3657... |
"""
gcd and lcm.
A fact that helped me -
If two numbers have no prime factors in common, the lowest common multiple will be equal to the product of the two numbers
Ref:
Comments:
1) Compute the Lowest Common Multiple (LCM) of A.
2) Compute the Greatest Common Divisor (GCD) of B.
If x is 'between' A and B, then it will... | {
"content_hash": "46555c23f12446a9a78f10517d02ed9d",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 440,
"avg_line_length": 56.473684210526315,
"alnum_prop": 0.7199440820130475,
"repo_name": "MFry/pyAlgoDataStructures",
"id": "3a0b04c7a8391c67c89afd0400de4679aee3ee04",
"s... |
import os
from setuptools import setup
from launchkey import SDK_VERSION
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
requires = [
'setuptools >= 40.4.3',
'requests >= 2.5.1, < 3.0.0',
'pyt... | {
"content_hash": "10aaae16414b42111d0ceff34beb9ca9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 90,
"avg_line_length": 35.2112676056338,
"alnum_prop": 0.562,
"repo_name": "LaunchKey/launchkey-python",
"id": "10d49d568d0b041216117109080d0a11d7119c6c",
"size": "2500",
... |
"""A hook for modifying parameter values read from the WMT client."""
def execute(env):
env['model_output__opt_time_interval'] = env['_update_time_step']
| {
"content_hash": "ce8110953489fb50e66fe3fe3135e9ff",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 69,
"avg_line_length": 39.75,
"alnum_prop": 0.6981132075471698,
"repo_name": "csdms/wmt-metadata",
"id": "6692692dc9dd6512bc7b1cf937c662895913dcb0",
"size": "159",
"binary... |
"""
byceps.blueprints.admin.shop.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from ....util.framework.blueprint import create_blueprint
blueprint = create_blueprint('shop_admin', __name__)
| {
"content_hash": "7154f162d6a724776244e4410d2eb466",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 57,
"avg_line_length": 23.75,
"alnum_prop": 0.6596491228070176,
"repo_name": "m-ober/byceps",
"id": "9c565e84343f2292b985a3c5785e272535074045",
"size": "285",
"binary": f... |
import sure
from django.test import TestCase
from tasks.const import STATUS_SUCCESS
from ..coverage import coverage_violation
from .base import get_content
class CoverageViolationCase(TestCase):
"""Coverage violation case"""
def test_result(self):
"""Test coverage violation result"""
data = {... | {
"content_hash": "3ee562bd29650aedc16945b51d2ad062",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 59,
"avg_line_length": 35.041666666666664,
"alnum_prop": 0.6563614744351962,
"repo_name": "nvbn/coviolations_web",
"id": "a2e13d042756b740ee1a2ff8e75745d92f9d7034",
"size":... |
import datetime
import math
import RPi.GPIO as GPIO
class TriggerService:
_gewAbstand = float
_timeLastBang = datetime.datetime
_startTime = datetime.datetime
_vMeanSinceLastBang = []
def __init__(self,GuiService,GpsImportService):
self.GuiService = GuiService
self.GpsImportService... | {
"content_hash": "2e2439a77a725a82ad618972785f5fdb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 33.5,
"alnum_prop": 0.628731343283582,
"repo_name": "madzing/T-Box",
"id": "6d6cab3560579d73febaf4c50ad8d67baf2073a8",
"size": "1810",
"binary": fa... |
from .config import Config
from .pusher import Pusher
__all__ = [
'Config',
'Pusher',
]
| {
"content_hash": "23993cea0b8f19ab0369ba2abb651374",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 26,
"avg_line_length": 13.857142857142858,
"alnum_prop": 0.6082474226804123,
"repo_name": "pusher/pusher-python-rest",
"id": "9a313d7f1c2cac2897bfa5ed4492e34572351808",
"siz... |
from lxml import etree as et
arights = ('read-only', 'read-write', 'write-only', 'writeOnce', 'read-writeOnce')
__version__ = '1.0.1'
default_xml = ('<device><name>NEW_DEVICE</name>'
'<version>1.0</version>'
'<description>Default CMSIS device</description>'
'<addressUnitB... | {
"content_hash": "99861e5f5ff829fff9e66b1ab5f32576",
"timestamp": "",
"source": "github",
"line_count": 591,
"max_line_length": 126,
"avg_line_length": 31.68020304568528,
"alnum_prop": 0.5402980291619933,
"repo_name": "dmitrystu/svd_editor",
"id": "9a06046dc73b24afd976561fa6bdf866c0be87be",
"size":... |
import logging
import os
from pip._internal.utils.subprocess import runner_with_spinner_message
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Optional
from pip._vendor.pep517.wrappers import Pep517HookCaller
logger = logging.getLogger(__name__)
d... | {
"content_hash": "0af74dd07d64707d6382afa8565b78af",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 31.02127659574468,
"alnum_prop": 0.6419753086419753,
"repo_name": "nataddrho/DigiCue-USB",
"id": "d25f9c42f627a63a738c3bb8916c21d8e02a5c6e",
"size": ... |
from flask import Module, jsonify, render_template
from doodie import pagerduty_apikey, pagerduty_subdomain
from doodie.lib.pagerduty import Pagerduty
frontend = Module(__name__)
@frontend.route("/incidents")
def quick():
return render_template("incidents.html")
@frontend.route("/incidents/count/", defaults={"s... | {
"content_hash": "7ac6c51368ead8860961d4419b0e00f4",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 64,
"avg_line_length": 28.761904761904763,
"alnum_prop": 0.7168874172185431,
"repo_name": "ohlol/doodie",
"id": "99ead386eb84d7d6e9e1174bf19a79e913e0e936",
"size": "604",
... |
from __future__ import absolute_import
import six
from .common import ObjectMeta, LocalObjectReference
from ..base import Model
from ..fields import Field, ListField, RequiredField
class ContainerPort(Model):
name = Field(six.text_type)
hostPort = Field(int)
containerPort = Field(int)
protocol = Fie... | {
"content_hash": "0b90199538ce40bd16fef79015403501",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 67,
"avg_line_length": 24.527522935779817,
"alnum_prop": 0.7106788853562745,
"repo_name": "fiaas/k8s",
"id": "d589fe8a7f4a3ecacb6736c5fcaa8c034e2ba833",
"size": "5978",
... |
from mxconsole.summary.summary import *
from mxconsole.summary.writer.writer import FileWriter
| {
"content_hash": "dab51e6d817142bd014f56ac075efa83",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 54,
"avg_line_length": 47.5,
"alnum_prop": 0.8526315789473684,
"repo_name": "bravomikekilo/mxconsole",
"id": "b6bfe274228f45ea7c9b937dc66aeb82ca6e6cad",
"size": "95",
"bin... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: aci_epg_to_domain
short_description: Bind EPGs to Domains on... | {
"content_hash": "fec44ccbd5e9a5c689054c3cbbf4740c",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 146,
"avg_line_length": 36.81553398058252,
"alnum_prop": 0.6391086497890295,
"repo_name": "e-gob/plataforma-kioscos-autoatencion",
"id": "e7ad960c2aef70c4189e5b0f290cba2e686... |
from minicps.devices import PLC
from utils import *
import random
import time
import logging
import signal
import sys
SENSOR_ADDR = IP['lit101']
LIT101 = ('LIT101', 1)
class Lit101(PLC):
def sigint_handler(self, sig, frame):
print "I received a SIGINT!"
global reader
reader = 0
sys.exit(0)
def pre_loop(se... | {
"content_hash": "d2c3906599d20c1c6ba7d7eb0d3c606e",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 131,
"avg_line_length": 28.65753424657534,
"alnum_prop": 0.6854684512428298,
"repo_name": "afmurillo/ICS-SDN",
"id": "821cfe15d0fb2c88f23d60ca3af76b45823762a0",
"size": "20... |
from conduit.database import (Model, SurrogatePK, db,
reference_col, relationship)
from flask_jwt import current_identity
followers_assoc = db.Table("followers_assoc",
db.Column("follower", db.Integer, db.ForeignKey("userprofile.user_id")),
... | {
"content_hash": "7d06c5b015f992e467e9e69fb432e043",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 102,
"avg_line_length": 33.15873015873016,
"alnum_prop": 0.5969363331737674,
"repo_name": "mohamed-aziz/realworld-flask",
"id": "0bcdf0cd4cd7e16cffaa99605757e384cba6e67a",
... |
import os
import subprocess
import re
# Create a dictionary that maps number to the stand of the read
strand = {}
strand['1'] = 'F'
strand['2'] = 'R'
# ATACseq data
# Create dictionary mapping ATACseq Barcodes to Experimental Samples
ATACmap = {}
regex = re.compile('(P\d+)\s+(A\d)\s+(\wD)\s+(\d)')
with open('/bio/lil... | {
"content_hash": "54c176135eb554e1d382705e6fb1cc8f",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 285,
"avg_line_length": 57.07142857142857,
"alnum_prop": 0.6614518147684606,
"repo_name": "matilian26/EE283",
"id": "c7318e3f35ca2aec28080791e22e2d83b6affbe3",
"size": "319... |
'''
Copyright 2017, Fujitsu Network Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | {
"content_hash": "f4876a10ef88b95eb3f307cebf7d7bb1",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 139,
"avg_line_length": 56.836879432624116,
"alnum_prop": 0.5786124282505615,
"repo_name": "warriorframework/warriorframework",
"id": "22ec2f98e4f1c92649405c20bdc8515bdced1d... |
import os
import sys
import time
import supybot
import supybot.conf as conf
from supybot import commands
import supybot.utils as utils
from supybot.commands import *
import supybot.ircdb as ircdb
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callb... | {
"content_hash": "a8288ec7df20bb29e1d46fe84c91024c",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 81,
"avg_line_length": 43.4030612244898,
"alnum_prop": 0.5143999059597978,
"repo_name": "buildbot/supybot",
"id": "c4c93e15a8502c4183056aeb02378e2d6f446085",
"size": "1863... |
from ShareYourSystem.Standards.Classors.Representer import _print
from ShareYourSystem.Standards.Objects import Applyier
#</ImportSpecificModules>
#Print a version of the class
_print(dict(Applyier.ApplyierClass.__dict__.items()))
#Print a version of this object
_print(Applyier.ApplyierClass())
#Print a version of h... | {
"content_hash": "adf6395d204918082d59a78604f2f5f4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 29.933333333333334,
"alnum_prop": 0.779510022271715,
"repo_name": "Ledoux/ShareYourSystem",
"id": "33050d44061579a1b46e022dbcc7fdea39aab21a",
"size":... |
import os
import pep8
import testtools
import sst
import sst.selftests
class Pep8ConformanceTestCase(testtools.TestCase):
packages = [sst, sst.scripts, sst.tests, sst.selftests]
def test_pep8_conformance(self):
pep8style = pep8.StyleGuide(show_source=True)
for package in self.packages:
... | {
"content_hash": "1c0a667a212e4e53a2db7ac50051e297",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 24.894736842105264,
"alnum_prop": 0.6955602536997886,
"repo_name": "DramaFever/sst",
"id": "418773c71189765b9b3154a321474e4b8eee4f80",
"size": "1183"... |
import requests
class Google(object):
def __init__(self):
pass
def get_homepage_html(self):
response = requests.get('https://www.google.com')
print response.text
| {
"content_hash": "9a76fd51b943a8ec90c5d0274e5b8279",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 51,
"avg_line_length": 16,
"alnum_prop": 0.6875,
"repo_name": "tjlee0909/tj-testing-python-packaging",
"id": "097528f5c4d362b26e2d0770e41ac6fc7bafc301",
"size": "176",
"b... |
"""This module detects whether third-party libraries, utilized by third-party
drivers, are present on the system. If they are not, it mocks them and tinkers
with sys.modules so that the drivers can be loaded by unit tests, and the unit
tests can continue to test the functionality of those drivers without the
respective... | {
"content_hash": "4c1b04077dcc686bd819273cfe4e3a40",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 78,
"avg_line_length": 43.614285714285714,
"alnum_prop": 0.7252975215634895,
"repo_name": "NaohiroTamura/ironic",
"id": "7d3934cdefd93e1ad139e6bcd8110f6f218a79e7",
"size":... |
import os
import sys
import re
import logging
import traceback
from typing import Optional
from PyQt5 import QtWidgets, QtCore
from PyQt5 import QtPrintSupport
import sas.qtgui.Utilities.GuiUtils as GuiUtils
import sas.qtgui.Utilities.ObjectLibrary as ObjectLibrary
from sas.qtgui.Utilities.Reports.UI.ReportDialogUI ... | {
"content_hash": "51468923760edcc0424afe06a0581048",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 88,
"avg_line_length": 34.40625,
"alnum_prop": 0.599636693914623,
"repo_name": "SasView/sasview",
"id": "de64d606403dd9efda36a7b85b608f48b3469695",
"size": "5505",
"bina... |
from cinder.api.openstack import wsgi
from cinder.api.v3.views import clusters as clusters_view
from cinder import exception
from cinder.i18n import _
from cinder import objects
from cinder import utils
CLUSTER_MICRO_VERSION = '3.7'
REPLICATION_DATA_MICRO_VERSION = '3.26'
class ClusterController(wsgi.Controller):
... | {
"content_hash": "1c114c7609f65cc38e9dd73b3dc87027",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 39.9140625,
"alnum_prop": 0.630456057936974,
"repo_name": "ge0rgi/cinder",
"id": "120f1e6a106f20eefee083c207fb0b99d1a07da1",
"size": "5741",
"bina... |
from typing import List # noqa: F401
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, Key, Screen
from libqtile.lazy import lazy
from libqtile.utils import guess_terminal
mod = "mod4"
terminal = guess_terminal()
keys = [
# Switch between windows in current stack pane
... | {
"content_hash": "77f2bae051b214f384bf290217f56f7a",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 83,
"avg_line_length": 34.796052631578945,
"alnum_prop": 0.6141047456986197,
"repo_name": "tych0/qtile",
"id": "106dfd79e9fb4463ba61e8bd829384e38de6d599",
"size": "6583",
... |
"""CacheControl import Interface.
Make it easy to import from cachecontrol without long namespaces.
"""
__author__ = 'Eric Larson'
__email__ = 'eric@ionrock.org'
__version__ = '0.12.0'
from .wrapper import CacheControl
from .adapter import CacheControlAdapter
from .controller import CacheController
| {
"content_hash": "3761291af0db3750d7e1be05b000e65b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 65,
"avg_line_length": 27.454545454545453,
"alnum_prop": 0.7549668874172185,
"repo_name": "sigmavirus24/pip",
"id": "a486fa25fb44eb6814fc55dd809fdd56b080c9ca",
"size": "302... |
from setuptools import setup, find_packages
setup(
name = 'c2c.recipe.cssmin',
version = '0.6',
license = 'MIT License',
author = 'Frederic Junod',
author_email = 'frederic.junod@camptocamp.com',
url = 'https://github.com/camptocamp/c2c.recipe.cssmin',
description = 'A buildout recipe to... | {
"content_hash": "edbd6436d9779992aa24cea66281a37f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 84,
"avg_line_length": 32.81481481481482,
"alnum_prop": 0.6297968397291196,
"repo_name": "camptocamp/c2c.recipe.cssmin",
"id": "4c52e1fb9aaf08aceb03195e1685d63895362541",
"... |
import numpy as np
from skimage.measure import regionprops
from copy import deepcopy
PROP_SAVE = ['area', 'cell_id', 'convex_area', 'corr_x', 'corr_y', 'cv_intensity',
'eccentricity', 'equivalent_diameter', 'euler_number', 'extent', 'filled_area',
'major_axis_length', 'max_intensity', 'mean_i... | {
"content_hash": "df110d64486b0e09f553a6378ddc0076",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 92,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.5749445676274945,
"repo_name": "braysia/covertrack",
"id": "ac013ca4f9dce6d87c9c17ece985b2f080d1fe07",
"size": "... |
import re
from conary.dbstore import idtable
_cacheRe = {}
def checkTrove(pattern, trove):
global _cacheRe
if pattern == 'ALL' or trove is None:
return True
regExp = _cacheRe.get(pattern, None)
if regExp is None:
regExp = _cacheRe[pattern] = re.compile(pattern + '$')
if regExp.matc... | {
"content_hash": "df02aadf8a4e92e03ed42665e36038f0",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 82,
"avg_line_length": 38.51578947368421,
"alnum_prop": 0.5714676141022137,
"repo_name": "fedora-conary/conary",
"id": "f80ecf003bb7d6c659bbf891f8141019deeb683c",
"size": "... |
import base64
from typing import List, Tuple
from google.cloud import aiplatform
from google.cloud.aiplatform.gapic.schema import predict
import requests
from train_model import with_retries
def run(
project: str, region: str, model_endpoint_id: str, image_file: str
) -> List[Tuple[str, float]]:
"""Sends an... | {
"content_hash": "2a9c2adc2ada680deadaa623628aece8",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 89,
"avg_line_length": 29.41304347826087,
"alnum_prop": 0.6178861788617886,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "9b50d05940977c36ce2ee741ff74bb3ef7f... |
"""
Tests that work on both the Python and C engines but do not have a
specific classification into the other test modules.
"""
from io import StringIO
import pytest
from pandas import (
DataFrame,
Series,
concat,
)
import pandas._testing as tm
def test_iterator(all_parsers):
# see gh-6607
data ... | {
"content_hash": "ca2c9e9a216d5f8316fff6eee1574fe3",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 88,
"avg_line_length": 24.833333333333332,
"alnum_prop": 0.5943325876211782,
"repo_name": "gfyoung/pandas",
"id": "5ae1d80589df9a77d2d2abf2414efebbb64601e2",
"size": "2682... |
"""Module for loading various file formats."""
import glob
import json
import os
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Dict, Iterator, List, Tuple, Union
from .exceptions import NoCompatibleLoaderFoundError
from .fragment import Fragment
try:
import tomli
except Imp... | {
"content_hash": "4adc97f1f0d933f0d6c212b3d356e848",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 90,
"avg_line_length": 28.82198952879581,
"alnum_prop": 0.6257947320617621,
"repo_name": "daviskirk/climatecontrol",
"id": "2d6797370b0fd45c79c740af194ee160b549f85d",
"siz... |
"""Use unique constraints instead of unique indices
Revision ID: 1350
Revises: 1340
Create Date: 2019-07-10 12:43:28.461996
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '1350'
down_revision = '1340'
def upgrade():
# ### commands auto generated by Alem... | {
"content_hash": "4c32d0ff94ff5a5bff476d1d1d26defa",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 119,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.698936170212766,
"repo_name": "alphagov/digitalmarketplace-api",
"id": "ad5383ac1391f851a750ba8813922d4d0596273e",... |
import os
import hashlib
from sys import stdout
from os.path import join, getsize
from collections import Counter, defaultdict
rootdir = os.getcwd()
print('[i] using ' + rootdir + ' as root directory')
stdout.flush()
files = []
# XXX in case you have circular symlinks, we'll loop forever
for dirpath, dirnames, filen... | {
"content_hash": "7c67a52e25266fa6cbeb7c704ecafffb",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 72,
"avg_line_length": 32.81967213114754,
"alnum_prop": 0.6118881118881119,
"repo_name": "bomsi/dotfiles",
"id": "ec83ad904370ff04bb886c0b39c9bffdee2e45a9",
"size": "2026",... |
from __future__ import unicode_literals
from django.http import HttpResponse
from django.utils.timezone import is_aware
from django.utils.functional import Promise
from django.utils import six
import json
import datetime
import decimal
import uuid
class DjangoJSONEncoder(json.JSONEncoder):
"""
JSONEncoder su... | {
"content_hash": "7194ce90beb17ace71b5b3234f10a4e7",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 85,
"avg_line_length": 33.527272727272724,
"alnum_prop": 0.5905639913232104,
"repo_name": "allisson/django-tiny-rest",
"id": "aa70f18f62065ba0d985b2913f4dac668529cff6",
"si... |
import copy
import mock
import six
from heat.common import exception
from heat.common import identifier
from heat.common import template_format
from heat.engine.cfn import functions as cfn_functions
from heat.engine import check_resource as cr
from heat.engine import environment
from heat.engine import function
from h... | {
"content_hash": "27641a647bf039814af0c9ab55aff7b1",
"timestamp": "",
"source": "github",
"line_count": 2800,
"max_line_length": 79,
"avg_line_length": 40.36392857142857,
"alnum_prop": 0.5334589759244021,
"repo_name": "cwolferh/heat-scratch",
"id": "b6280b90f0ca6c31fa7304a90ea3d0346dcf3cda",
"size"... |
import sys
import os
import time
import json
from socket import gethostname
from subprocess import call
import logging
from mpi4py import MPI
from jobdescription import JobDescription
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
max_rank = comm.Get_size()
logger = logging.getLogger('Rank {0}'.format(rank))
logger.set... | {
"content_hash": "f508a8e46dee29dfeafca38f9562005b",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 88,
"avg_line_length": 31.25,
"alnum_prop": 0.6565517241379311,
"repo_name": "PanDAWMS/panda-harvester",
"id": "eba9a55cbba10bf58ee23406ff1b7bf1c1e4af4e",
"size": "3647",
... |
"""Invokes git bisect to find culprit commit inside Chromium repository."""
from __future__ import print_function
import json
import re
from chromite.cli import flash
from chromite.cros_bisect import git_bisector
from chromite.lib import cros_logging as logging
from chromite.lib import git
from chromite.lib import g... | {
"content_hash": "2480192f3bdc8312255662ac230028d8",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 79,
"avg_line_length": 36.78217821782178,
"alnum_prop": 0.6633467922835352,
"repo_name": "endlessm/chromium-browser",
"id": "e34efba675014040b1f9670c744fac1495ccbc57",
"si... |
"""Analytic policy gradient training."""
import functools
import time
from typing import Callable, Optional, Tuple
from absl import logging
from brax import envs
from brax.envs import wrappers
from brax.training import acting
from brax.training import pmap
from brax.training import types
from brax.training.acme impor... | {
"content_hash": "e57ba51b050ebdba81753c55f285ba96",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 80,
"avg_line_length": 35.28333333333333,
"alnum_prop": 0.6726499763816722,
"repo_name": "google/brax",
"id": "666dd6174e1860596dbe8e61084ce13ae50b2198",
"size": "9050",
... |
import numpy as np
import os
import ntpath
import time
from . import util
from . import html
import scipy.misc
from io import BytesIO
def save_images(webpage, visuals, image_path, win_size=512):
image_dir = webpage.get_image_dir()
short_path = ntpath.basename(image_path[0])
name = os.path.splitext(short_path)[0]... | {
"content_hash": "76e87371fd9a7148707a6b44671a49ad",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 60,
"avg_line_length": 25.060606060606062,
"alnum_prop": 0.6723095525997581,
"repo_name": "google/tim-gan",
"id": "117383a0b92d5b2084b9f6d9093f315d7ed4bad1",
"size": "1501"... |
"""
Create a aggregation service.
"""
from twisted.application import service
from twisted.python import usage
from twisted.words.protocols.jabber.jid import JID
from wokkel import component, pubsub
from wokkel.generic import FallbackHandler
from wokkel.iwokkel import IXMPPHandler
from mimir.aggregator import aggreg... | {
"content_hash": "5cc30c7c7de09733a7c12c8dc34e8252",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 78,
"avg_line_length": 30.1625,
"alnum_prop": 0.6692913385826772,
"repo_name": "ralphm/mimir",
"id": "c62c94826a52d289a67f33cd6a666ef3ad85dbf8",
"size": "2479",
"binary":... |
import codecs
import datetime
import json
import os.path
import requests
import subprocess
import time
def generate(data):
team = data['player']['team']['name']
code = data['player']['spotcode']
qr_url = "http://fusiongame.tk/s/%s" % data['player']['touchcode']
pngpath = "spotter_printer/gen/%s.png" ... | {
"content_hash": "56381d5605ea1188fe011582a135bacb",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 101,
"avg_line_length": 30.0125,
"alnum_prop": 0.5610162432319866,
"repo_name": "mahfiaz/spotter_irl",
"id": "547536fb7fc8cdb956114dc440dfb87511c33ae0",
"size": "2449",
"... |
from morphforge.morphology.errors import MorphologyFrameworkRegistrationError
class MorphologyExporter(object):
method_name_prefix = 'to'
@classmethod
def register(cls, method_name, export_functor, from_type, allow_override=False):
if not isinstance(method_name, basestring):
raise M... | {
"content_hash": "ddfdf13ced68010e2093a02642e998a0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 115,
"avg_line_length": 39.291666666666664,
"alnum_prop": 0.7020148462354189,
"repo_name": "mikehulluk/morphforge",
"id": "8b7dcd470dd628e9987fdb5e96fe3941e25ef150",
"size"... |
import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="layout.xaxis.title", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "7b95118dfc25068343d1511455bc8d4c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 87,
"avg_line_length": 36.36363636363637,
"alnum_prop": 0.62,
"repo_name": "plotly/plotly.py",
"id": "d1d6cb26336feecd2a7024d2ff2f61cce0b443ce",
"size": "400",
"binary": ... |
from __future__ import print_function, absolute_import
import os
import six
import subprocess
from .base import CapPA
from .enums import IS_MAC
class YarnG(CapPA):
def __init__(self, *flags):
super(YarnG, self).__init__(*flags)
self.name = 'yarn'
self.friendly_name = 'yarn'
def _in... | {
"content_hash": "1344043db4a0fd27fdabd942dc173b6a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 111,
"avg_line_length": 30.02857142857143,
"alnum_prop": 0.570884871550904,
"repo_name": "Captricity/cappa",
"id": "907cbccf9d71e64f8dad9188a7ee27e6fbe6257e",
"size": "1051... |
from datetime import datetime, timedelta
from django.db import models
from django.utils.timezone import now
from categories.models import Category
class Timer(models.Model):
category = models.ForeignKey(Category)
name = models.CharField(
verbose_name='Name',
max_length=100,
)
acti... | {
"content_hash": "b34e7c52fe372f2a0a035c7d03458341",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 67,
"avg_line_length": 21.625,
"alnum_prop": 0.5348747591522158,
"repo_name": "peap/arzeit",
"id": "e23378f9b485a05485bccbcbced971f4d5c034e1",
"size": "2595",
"binary": ... |
from django.core.management import BaseCommand
from django.conf import settings
import os, datetime, time
from account.models import PhoneUserProfile
from excel.models import Excel
from django.contrib.auth.models import User
from django.core.files import File
from excel.views import index_excel
from excel.models imp... | {
"content_hash": "9a4308af39cd293240489ce7e32c313d",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 64,
"avg_line_length": 28.902439024390244,
"alnum_prop": 0.6092827004219409,
"repo_name": "stone5495/zebra",
"id": "4ba9ee2b2297147dfd2a756440727ff4a9b277bd",
"size": "1224... |
from django.db.transaction import atomic
from api import status as scode
from api.fields import get_boolean_value
from api.utils.db import get_listitem
from api.utils.request import set_request_method
from api.exceptions import OperationNotSupported
from api.task.response import SuccessTaskResponse, FailureTaskRespons... | {
"content_hash": "5ecb62d970399ab9ef97fdb28862c00a",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 119,
"avg_line_length": 39.1219512195122,
"alnum_prop": 0.6200124688279302,
"repo_name": "erigones/esdc-ce",
"id": "1dbaf091721e7fa9db8af0653642046ad4da3c12",
"size": "641... |
import argparse
import os
import locale
from pyp2rpm.convertor import Convertor
from pyp2rpm import settings
def main():
parser = argparse.ArgumentParser(description = 'Convert PyPI package to RPM specfile.')
parser.add_argument('-n',
required = False,
help = 'N... | {
"content_hash": "b0aed461113ca8003f6cbd648cc6ab1d",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 191,
"avg_line_length": 51.883720930232556,
"alnum_prop": 0.498655311519498,
"repo_name": "henrysher/spec4pypi",
"id": "a3692d455bc31c6c26f23251e93866992bc6feec",
"size": "... |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('subscriptions', '0012_subscription_purchase_date'),
]
operations = [
migrations.AlterField(
model_name='subscri... | {
"content_hash": "8bc5e34c2320ccaa9f779c93fd46b9e0",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 129,
"avg_line_length": 28.11111111111111,
"alnum_prop": 0.6679841897233202,
"repo_name": "aehlke/manabi",
"id": "61cad80997c558371c61a4d6f3c1b2bff8880fb7",
"size": "553",
... |
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_version(*file_paths):
"""Retrieves the version from frame_logging/__init__.py"""
filename = os.path.join(os.path.dirname(__file__), *file_paths)
version_file = open(filena... | {
"content_hash": "de666739ffebf8ac533697015c09e4e0",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 70,
"avg_line_length": 29.91891891891892,
"alnum_prop": 0.6016260162601627,
"repo_name": "ItsfBisounours/frame_logging",
"id": "495ed22f2262cbcba3422991f7a8bf25bc8d953c",
"... |
import datetime
import pandas as pd
class QuandlFetcher(object):
API_URL = 'http://www.quandl.com/api/v1/'
def __init__(self, auth_token=None):
self.auth_token = auth_token
def _append_query_fields(self, url, **kwargs):
field_values = ['{0}={1}'.format(key, val)
... | {
"content_hash": "1b71c4a42f5e5730782bbedf7c091a6a",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 142,
"avg_line_length": 37.60215053763441,
"alnum_prop": 0.5827852444952817,
"repo_name": "humdings/pynance-legacy",
"id": "0d5ff77ebbceb84ab2bbd909b757ee1f34623bc4",
"size... |
from gearman.client import GearmanClient
client = GearmanClient(['localhost'])
URL = 'http://ifcb-data.whoi.edu/feed.json'
client.submit_job('spider', URL)
| {
"content_hash": "82bccfb3c4b8649ba1ce32eb870b641c",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 43,
"avg_line_length": 20,
"alnum_prop": 0.7375,
"repo_name": "hsosik/ifcb-analysis",
"id": "c96dec800a1c78b9b68cc8c896a79cae38eb2832",
"size": "179",
"binary": false,
"... |
BASE_QUOTE_CHARS = '\'"'
class CScanSplit:
"""Split a string into words using the specified separator,
but respecting quotes and escape characters.
Special support for / at start of line (to allow /search).
Python rules for " and '.
Result is:
self.words: list o... | {
"content_hash": "3cf2a3c12034f8cb065ac09350197e2e",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 37.85964912280702,
"alnum_prop": 0.4594531974050046,
"repo_name": "njr0/fish",
"id": "280f31ac6e66e08a1095228c2ebd54781db73d68",
"size": "4316",
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import json
import os
import sys
import ray
import ray.rllib.ppo as ppo
import ray.rllib.es as es
import ray.rllib.dqn as dqn
import ray.rllib.a3c as a3c
parser = argparse.ArgumentParser(
... | {
"content_hash": "8f9b2cb931a877ff561da2115a2e2feb",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 37.365591397849464,
"alnum_prop": 0.6083453237410072,
"repo_name": "alanamarzoev/ray",
"id": "0bfb37efed32e6e4e8df317cedd50cfc4073fce1",
"size": "349... |
from fobi.helpers import validate_submit_value_as
from .conf import get_setting
__title__ = 'fobi.contrib.plugins.form_elements.fields.' \
'select_model_object.settings'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.... | {
"content_hash": "4d001f329908b072d1dee8cadd7f8ef5",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 32.0625,
"alnum_prop": 0.7037037037037037,
"repo_name": "mansonul/events",
"id": "94922c8b61662123c7221ff75ebb31d3c2f7c96d",
"size": "513",
"binary... |
import networkx as nx
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from itertools import product
import random
import math
from functools import wraps
import pandas as pd
from .information import mutual_information
def compose(f, g):
"""
:param f: Second function to apply
:param g... | {
"content_hash": "8913336540a39c61d1833b8de767ae5b",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 130,
"avg_line_length": 32.22857142857143,
"alnum_prop": 0.6030585106382979,
"repo_name": "DLunin/bayescraft",
"id": "04d3b456ea51e04fb94acf0c5f9af49571dd3bca",
"size": "1... |
"""Adds total income to all public figures."""
import six
# String to prefix log messages with:
LOG_PREFIX = '[post_process_income] '
INCOME = 'income'
COMPENSATIONS = 'compensations'
OTHER_INCOME = 'other_income'
ALL_INCOMES = (INCOME, COMPENSATIONS, OTHER_INCOME)
SK_TO_EUR = 30.126
CURRENCY_SK = "Sk"
def parse_m... | {
"content_hash": "a29404bcfb53ea64f0b00f2ec1352449",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 82,
"avg_line_length": 28.52173913043478,
"alnum_prop": 0.6082317073170732,
"repo_name": "verejnedigital/verejne.digital",
"id": "3000ba27f127064b47c961fb69abe5c96131b6e0",
... |
__all__ = ['Distribution']
import re
from distutils.core import Distribution as _Distribution
from setuptools.depends import Require
from setuptools.command.install import install
from setuptools.command.sdist import sdist
from setuptools.command.install_lib import install_lib
from distutils.errors import Dist... | {
"content_hash": "3ff30fe5a25413f099a4bd8e6e863d93",
"timestamp": "",
"source": "github",
"line_count": 817,
"max_line_length": 97,
"avg_line_length": 38.09791921664627,
"alnum_prop": 0.5964788279894622,
"repo_name": "diego-d5000/MisValesMd",
"id": "5c17b5e83ac4f1a46e42f2c11f14a566beefd627",
"size"... |
from distutils.core import setup
VERSION = 'v0.2'
setup(
name='pydialog',
version=VERSION,
author='Nic Roland',
author_email='nicroland9@gmail.com',
packages=['pydialog'],
description="Command line dialogs made easy.",
url = 'https://github.com/nicr9/pydialog',
... | {
"content_hash": "1ea04febc209c77afc06aa3327788f63",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 36.38461538461539,
"alnum_prop": 0.5560253699788583,
"repo_name": "nicr9/pydialog",
"id": "b9daa883cdec2a1615a6fb5446cc0231e02f0dd9",
"size": "946",
... |
import os
import subprocess
import sys
# Pull out navbar from custom index.html page
f = open('/srv/projects/intro_programming/intro_programming/html_resources/index.html', 'r')
lines = f.readlines()
f.close()
navbar_string = ''
in_navbar = False
num_open_divs = 0
num_closed_divs = 0
for line in lines:
# Navbar i... | {
"content_hash": "9952da0b816467cfe537ae726d60b3d3",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 92,
"avg_line_length": 29.735294117647058,
"alnum_prop": 0.6097922848664689,
"repo_name": "chenleo/ipynotebook",
"id": "fc58b17602744d35643a5589873a829188bb4e95",
"size": "... |
import io
import json
import os
import pickle
import tempfile
import uuid
from django.core.management import call_command
from django.test import TestCase
from django.test import TransactionTestCase
from mock import call
from mock import MagicMock
from mock import Mock
from mock import patch
from sqlalchemy import cre... | {
"content_hash": "203d6bcc4884414127d8429397d52516",
"timestamp": "",
"source": "github",
"line_count": 686,
"max_line_length": 120,
"avg_line_length": 38.50874635568513,
"alnum_prop": 0.6695688382480978,
"repo_name": "mrpau/kolibri",
"id": "1004245db12184d74247e0bea9be353f8203dd6f",
"size": "26417... |
"""
Digital clock implemented in GTK2.
"""
# STDLIB IMPORTS
from math import pi
# THIRD PARTY IMPORTS
from gtk import main
from gtk.gdk import color_parse
import gtk
# LOCAL IMPORTS
from _BasePyClock import BasePyClock
# TUPLE CONTAING DICTIONARIES DETAILING WHICH SEGMENTS WILL NEED TO BE
# 'ON' TO DISPLAY A NUMB... | {
"content_hash": "30e3bfbf762ee0446c310ceebe396ec5",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 77,
"avg_line_length": 31.50326797385621,
"alnum_prop": 0.4978215767634855,
"repo_name": "dummyload/PyClock",
"id": "c3cc141fba8f654b95d4c1233915c03b21eddcb5",
"size": "96... |
from pyflann import *
from copy import copy
from numpy import *
from numpy.random import *
import unittest
class Test_PyFLANN_nn(unittest.TestCase):
def setUp(self):
self.nn = FLANN()
class Test_PyFLANN_nn_index(unittest.TestCase):
def testnn_index_save_kdtree_1(self):
self.run_nn_inde... | {
"content_hash": "50824ef4fff6171e84e562fda013c7ee",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 110,
"avg_line_length": 32.40384615384615,
"alnum_prop": 0.627893175074184,
"repo_name": "piskvorky/flann",
"id": "9e15df009eb9c248a55877984d93d1280bc7c772",
"size": "3393... |
import plugins
from messenger import Messenger
| {
"content_hash": "740e8e0e16859cdbbdf7a2a14ce89e37",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 23.5,
"alnum_prop": 0.8723404255319149,
"repo_name": "beck/clean-py-app",
"id": "d79f266e326bfe3bf544be001c8b68daab3e2424",
"size": "47",
"binary": ... |
from django.template import Library, Node, Template, TemplateSyntaxError, \
Variable
from django.utils.translation import ugettext as _
from userprofile.models import Avatar, AVATAR_SIZES
from django.contrib.auth.models import User
from django.conf import settings
try:
from PIL import Im... | {
"content_hash": "36cf64947c44c5636ded9de458e1f41e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 90,
"avg_line_length": 34.69512195121951,
"alnum_prop": 0.6165202108963093,
"repo_name": "jazzido/django-profile",
"id": "2ac437d34997afc4daef986871f52674772b10c6",
"size":... |
"""
.. module: lemur.users.models
:platform: unix
:synopsis: This module contains all of the models need to create a user within
lemur
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
""... | {
"content_hash": "7b8eb1d1fc34b7c22843e20e07a1b913",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 121,
"avg_line_length": 29.929411764705883,
"alnum_prop": 0.6560534591194969,
"repo_name": "nevins-b/lemur",
"id": "a92753e4c525ea2b2e68cb6e313275c1ede7d3f5",
"size": "2544... |
import os
import unittest
from telemetry import page as page_module
from telemetry.page import page_set
from telemetry import value
from telemetry.value import none_values
from telemetry.value import scalar
class TestBase(unittest.TestCase):
def setUp(self):
ps = page_set.PageSet(base_dir=os.path.dirname(__fil... | {
"content_hash": "072f3936c670da0a236bc8af2944e86c",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 78,
"avg_line_length": 31.524475524475523,
"alnum_prop": 0.6404170363797693,
"repo_name": "SaschaMester/delicium",
"id": "8bd7a53661ba8c101b6d83cd14b3ad68567846f4",
"size"... |
from __future__ import absolute_import
import io
from builtins import *
from lxml import etree
from lxml import objectify
import json
import sys
sys.path.append('..')
import pyreqif.pyreqif
from pprint import pprint
import re
def pretty(d, indent=0):
for key, value in d.items():
print('\t' * indent + s... | {
"content_hash": "944966f9c548f85fcc9597398968ca88",
"timestamp": "",
"source": "github",
"line_count": 670,
"max_line_length": 186,
"avg_line_length": 46.58955223880597,
"alnum_prop": 0.5665865769662022,
"repo_name": "ebroecker/pyreqif",
"id": "440989e217f36e852c1252417ae39a1ab328a15f",
"size": "3... |
import gym
import numpy as np
import random
import time
import unittest
from collections import Counter
import ray
from ray.rllib.agents.pg import PGTrainer
from ray.rllib.agents.a3c import A2CTrainer
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.evaluation.metrics import collect_metrics... | {
"content_hash": "fb9b8b7c58fcf40d619b2e5875916cec",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 79,
"avg_line_length": 35.56192660550459,
"alnum_prop": 0.563818123186069,
"repo_name": "stephanie-wang/ray",
"id": "8cc52f3dc34903c711e36687be6a539bebce6e58",
"size": "15... |
from flask.ext.restful import Resource, reqparse
class Test(Resource):
def __init__(self):
self.parser = reqparse.RequestParser()
self.parser.add_argument('id', type=int)
super(AccountAPI, self).__init__()
def get(self):
return {'id': id}
def post(self):
pass
... | {
"content_hash": "0beb748ec498d6958726c29d971e19b3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 48,
"avg_line_length": 19.25,
"alnum_prop": 0.5688311688311688,
"repo_name": "chenke91/ckPermission",
"id": "59089f3e817e631a2c324dff33bf47d4b0baa3b9",
"size": "403",
"bi... |
"""
Univariate lowess function, like in R.
References
----------
Hastie, Tibshirani, Friedman. (2009) The Elements of Statistical Learning: Data Mining, Inference, and Prediction, Second Edition: Chapter 6.
Cleveland, W.S. (1979) "Robust Locally Weighted Regression and Smoothing Scatterplots". Journal of the American... | {
"content_hash": "566d889eb62bc613bdde192c89c3fb88",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 154,
"avg_line_length": 27.53280839895013,
"alnum_prop": 0.5989513822688275,
"repo_name": "pprett/statsmodels",
"id": "bf1d675f6f2c43f5ebabf38a3c3a0df7ab5b3838",
"size": "... |
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def get_metadata():
import re
with open(os.path.join("filechooser", "__init__.py")) as f:
return dict(re.findall("__([a-z]+)__ = ['\"]([^'\"]+)['\"]", f.read()))
metadata = get_metadata... | {
"content_hash": "7790d54b3c96e6fc330f4b433ca37bb2",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 106,
"avg_line_length": 32.266666666666666,
"alnum_prop": 0.6146694214876033,
"repo_name": "martinvw/django-filechooser",
"id": "eb99481ac391149e288aade45927a659aa44b911",
... |
"""Implementation of paginate query."""
import sqlalchemy
from cinder import exception
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
# copied from glance/db/sqlalchemy/api.py
def paginate_query(query, model, limit, sort_keys... | {
"content_hash": "68c5837312936d43006de914f0c37281",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 37.30275229357798,
"alnum_prop": 0.6276438760452533,
"repo_name": "github-borat/cinder",
"id": "f2c5f4534bb655e7900b65b9c14dabfb9bf73f4b",
"size": "... |
"""Functional operations."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.core.framework import attr_value_pb2
from tensorflow.python.eager import context
from tensorflow.python.framework import auto_control_deps_utils as acd
from tensorf... | {
"content_hash": "e6a84f93cab2f4a4499bb97bf782b44d",
"timestamp": "",
"source": "github",
"line_count": 1214,
"max_line_length": 91,
"avg_line_length": 38.766062602965405,
"alnum_prop": 0.6687773575283669,
"repo_name": "aldian/tensorflow",
"id": "6e285d6681d1574eb8098c121d2e1e360d3b8034",
"size": "... |
import concurrent
import time
import testtools
from testscenarios import load_tests_apply_scenarios as load_tests # noqa
import openstack
import openstack.cloud
from openstack.cloud import meta
from openstack import exceptions
from openstack.tests import fakes
from openstack.tests.unit import base
from openstack.tes... | {
"content_hash": "ab4afcc9ddf254e38fa683a8370db89f",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 79,
"avg_line_length": 38.3046875,
"alnum_prop": 0.5510095859677748,
"repo_name": "stackforge/python-openstacksdk",
"id": "66345e27badc62e6ef0852694ac4a7d444797bad",
"size... |
from elasticsearch_parse import Search, Q
s = Search(index="my-index") \
.filter("term", blog="xiaorui.cc") \
.query("match", author="ruifengyun") \
.query(~Q("match", face="good"))
s.aggs.bucket('per_tag', 'terms', field='tags')
print s.execute()
| {
"content_hash": "af59dd1d296db4c26cda1d877ffee9fc",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 47,
"avg_line_length": 24.181818181818183,
"alnum_prop": 0.6240601503759399,
"repo_name": "rfyiamcool/elasticsearch_parse",
"id": "5baae9341ed4a061f1f22d89e532d9ea7ef14ae5",
... |
import nomad
import pytest
import tests.common as common
@pytest.fixture
def nomad_setup():
n = nomad.Nomad(host=common.IP, port=common.NOMAD_PORT, verify=False, token=common.NOMAD_TOKEN)
return n
@pytest.fixture
def nomad_setup_with_namespace():
n = nomad.Nomad(host=common.IP, port=common.NOMAD_PORT, ver... | {
"content_hash": "df877437fb4bd082a14a98fdd735e134",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 133,
"avg_line_length": 31.076923076923077,
"alnum_prop": 0.7524752475247525,
"repo_name": "jrxFive/python-nomad",
"id": "a871f3b3a0eecc12db5a0ea5d6fa5d47312556cf",
"size":... |
"""Capturing a single image from webcam
In Linux there are the following methods:
METHOD 1: RTSP protocol
avconv -i rtsp://<user>:<pass>@<local_ip>:<port>/video.mjpg -vframes 1 -r 1 -s 640x480 image.jpg
METHOD 2: HTTP protocol
avconv -i http://<user>:<pass>@<local_ip>:<port>/video.mjpg -vframes 1 -r 1 -s 640x480 ima... | {
"content_hash": "6586d6890fcf41ec58cb68dbd714e051",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 128,
"avg_line_length": 34.364583333333336,
"alnum_prop": 0.6489845407699303,
"repo_name": "corerd/camshot",
"id": "355f2169dd1774e8bf533094039ea150edd6551b",
"size": "4442... |
"""Test the RPC call related to the uptime command.
Test corresponds to code in rpc/server.cpp.
"""
import time
from test_framework.test_framework import VergeTestFramework
class UptimeTest(VergeTestFramework):
def set_test_params(self):
self.num_nodes = 1
self.setup_clean_chain = True
def... | {
"content_hash": "3015d4ed227ec0c9f988162e9ff28c7b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 63,
"avg_line_length": 22.53846153846154,
"alnum_prop": 0.6416382252559727,
"repo_name": "vergecurrency/VERGE",
"id": "adda324e2854f106cbb49100e6e7bd9f4bb54442",
"size": "7... |
import logging
bm_logger = None
def setup_logging(logfile):
"""\brief Sets up a simple logger and exposes it globally
\param logfile (\c string) The path to the file to log to
"""
global bm_logger
bm_logger = logging.getLogger()
hdlr = logging.FileHandler(logfile)
formatter = logging.Forma... | {
"content_hash": "dc21c9c84e696fd433e169e21ad4b8de",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 74,
"avg_line_length": 31.133333333333333,
"alnum_prop": 0.69593147751606,
"repo_name": "cnplab/blockmon",
"id": "f0bee594c5b009e01ebd5e6f5f40e76f531979ce",
"size": "2283",... |
"""Utility functions for plotting M/EEG data
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# ... | {
"content_hash": "4a77a27f91035b87c7d9be3a09949b43",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 79,
"avg_line_length": 35.244505494505496,
"alnum_prop": 0.5478992906695768,
"repo_name": "jaeilepp/eggie",
"id": "88c5e5b5f4f252969e4c1d9b809b02277b79e9b0",
"size": "1282... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.