text stringlengths 4 1.02M | meta dict |
|---|---|
from google.cloud import api_keys_v2
async def sample_update_key():
# Create a client
client = api_keys_v2.ApiKeysAsyncClient()
# Initialize request argument(s)
request = api_keys_v2.UpdateKeyRequest(
)
# Make the request
operation = client.update_key(request=request)
print("Waiting... | {
"content_hash": "28cadaf8b1e129732f8895f42c34747c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 52,
"avg_line_length": 22.454545454545453,
"alnum_prop": 0.694331983805668,
"repo_name": "googleapis/python-api-keys",
"id": "1aa1d4b0a9d5c9139ef5d856e50c1e986fec0216",
"si... |
"""SCons.Tool.Packaging.targz
The targz SRC packager.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, includin... | {
"content_hash": "d67f31a28e1dd7998d80cf67aaff9d64",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 114,
"avg_line_length": 40.38636363636363,
"alnum_prop": 0.7540799099606078,
"repo_name": "pzajda/eloquence",
"id": "d0c80dbfeb412f48bc8610de7a79c5e24b342c0e",
"size": "177... |
from ragendja.settings_post import *
add_uncombined_app_media(globals(), 'django_aep_export.admin_media')
| {
"content_hash": "db07d1916477c766676d165b15eaff5f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 68,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.7757009345794392,
"repo_name": "tallstreet/jaikuenginepatch",
"id": "ab7cb650ba3e4411d774ef7f4a5d869eabfda1ec",
"s... |
"""Provides agency object."""
from __future__ import absolute_import
from .. import t1types
from ..entity import Entity
class Agency(Entity):
"""Agency entity."""
collection = 'agencies'
resource = 'agency'
_relations = {
'organization', 'billing_contact', 'sales_contact',
'traffic_co... | {
"content_hash": "b12eb076d3192cbf8f1bc24243db9ec5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 70,
"avg_line_length": 28.904761904761905,
"alnum_prop": 0.5634266886326195,
"repo_name": "MediaMath/t1-python",
"id": "8df74a9e3ee595ac47bec430148d5640d38c0c15",
"size": "... |
from __future__ import absolute_import, division, unicode_literals
from future.builtins import int, open, str
from hashlib import md5
import os
try:
from urllib.parse import quote, unquote
except ImportError:
from urllib import quote, unquote
from django.apps import apps
from django.contrib import admin
from ... | {
"content_hash": "22e830af9ce7ca1f80e0acf0ffa7c38c",
"timestamp": "",
"source": "github",
"line_count": 693,
"max_line_length": 79,
"avg_line_length": 35.58152958152958,
"alnum_prop": 0.6091734933895693,
"repo_name": "geodesign/mezzanine",
"id": "f9027b6e00f98b33dafe78fd83975d0b27368c0d",
"size": "... |
#!/usr/bin/env python
# PythonJS to JavaScript Translator
# by Amirouche Boubekki and Brett Hartshorn - copyright 2013
# License: "New BSD"
import os, sys
from types import GeneratorType
import ast
from ast import Str
from ast import Name
from ast import Tuple
from ast import parse
from ast import Attribute
from ast... | {
"content_hash": "1c4a403509d6db67bbbf9d79332da45d",
"timestamp": "",
"source": "github",
"line_count": 1568,
"max_line_length": 220,
"avg_line_length": 29.821428571428573,
"alnum_prop": 0.6116766467065868,
"repo_name": "kustomzone/Rusthon",
"id": "17844624e72bcda8789e45a3083ee150db942035",
"size":... |
import logging
from restlib2.http import codes
from restlib2.params import Parametizer, BoolParam, StrParam
from modeltree.tree import MODELTREE_DEFAULT_ALIAS, trees
from avocado.events import usage
from avocado.query import pipeline
from serrano.conf import settings
from .base import FieldBase
from ...links import rev... | {
"content_hash": "7b5a51b9aa5aceb1108b014392dd911e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 73,
"avg_line_length": 32.828947368421055,
"alnum_prop": 0.6032064128256514,
"repo_name": "chop-dbhi/serrano",
"id": "46abdd1e8654a1a05d6d7206521a20a1c61e7ba5",
"size": "24... |
from __future__ import absolute_import
import os.path
def join_file_paths(path1, path2):
path1_abs = os.path.abspath(path1)
path1_dir = os.path.dirname(path1_abs)
path = os.path.join(path1_dir, path2)
path = os.path.normpath(path)
return path
| {
"content_hash": "f34c6ca969f34359feeb5d82db0a2e11",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 42,
"avg_line_length": 18,
"alnum_prop": 0.674074074074074,
"repo_name": "AoiKuiyuyou/AoikTopDownParser",
"id": "55c148347a811e95f73e1f699c98021af5faf019",
"size": "286",
... |
import tensorflow as tf
from tensorflow.python.layers.normalization import BatchNormalization as TFBatchNorm
from .template import BaseLayer
from tensorflow.python.ops import init_ops
class L2_Normalize(BaseLayer):
@BaseLayer.init_name_scope
def __init__(self, dim):
'''dim (int or list of ints): dimen... | {
"content_hash": "9e24537bc1e8e214931374c5f15244f5",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 105,
"avg_line_length": 50.4593023255814,
"alnum_prop": 0.5945385413066021,
"repo_name": "hycis/TensorGraph",
"id": "c0d3e14df3058399c93400f919b36527cc1ec2a6",
"size": "86... |
import os
from unittest.mock import patch
import pytest
from elizabeth.core.providers import Path
from elizabeth.intd import (
PROGRAMMING_LANGS,
FOLDERS,
PROJECT_NAMES
)
@pytest.fixture
def path():
return Path()
def test_root(path):
platform_patcher = patch('sys.platform', 'win32')
platfo... | {
"content_hash": "aca3a545df0a723d7fae28854b40d6c4",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 57,
"avg_line_length": 23.71014492753623,
"alnum_prop": 0.6668704156479217,
"repo_name": "wikkiewikkie/elizabeth",
"id": "45d5c778d6886cf04f79ec11c05b9bbd07557fc1",
"size":... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from wagtail.wagtailsearch import index
from wagtail.wagtailsnippets.models import register_snippet
# AlphaSnippet and ZuluSnippet are for testing ordering of
# snippets when registering. They are named as such to ensure
# t... | {
"content_hash": "e39f4dd71a8b3ff9d4d420b8b8ac341e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 85,
"avg_line_length": 25.4,
"alnum_prop": 0.7559055118110236,
"repo_name": "inonit/wagtail",
"id": "dbb8a274bd0064d213a3cb10b1bbfa72d87386fd",
"size": "1397",
"binary": ... |
import logging
import os
import api
from common import database_connector, verify_parameters
import storage
logging = logging.getLogger(__name__)
def ensure_data(sessions):
try:
sessions().query(storage.Monitoring).first()
sessions.remove()
except Exception as ex:
logging.critical('C... | {
"content_hash": "3ad4048bee4c435d5ef841b7d973bbcd",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 67,
"avg_line_length": 21.82758620689655,
"alnum_prop": 0.6966824644549763,
"repo_name": "eve-basil/watches",
"id": "c71994e665fe6e649fb285d5397148239dd65227",
"size": "633... |
from setuptools import setup
setup(name='streampy',
version='1.2',
description='Java like stream pipelines, supports parallel operations',
url='https://github.com/tolsac/streampy.git',
author='Camille Tolsa',
author_email='camille.tolsa@gmail.com',
license='MIT',
packages=['.'... | {
"content_hash": "bd714c745ff567c99c21d833ea45d0a9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 31.363636363636363,
"alnum_prop": 0.6492753623188405,
"repo_name": "tolsac/streampy",
"id": "ad094fadd5314a7afd43166523b70e23010d4958",
"size": "345"... |
"""
Module defining user interface for the application.
"""
import cmd
import fnmatch
from io import StringIO
import shlex
from maxify.metrics import ParsingError, Duration
from termcolor import colored
from maxify.config import (
import_config,
ImportStrategy,
ProjectConflictError,
ConfigError
)
fro... | {
"content_hash": "b43e612afdd33147862089e7e11f4e20",
"timestamp": "",
"source": "github",
"line_count": 609,
"max_line_length": 86,
"avg_line_length": 33.160919540229884,
"alnum_prop": 0.5215152265412231,
"repo_name": "rossbayer/maxify",
"id": "fae281817e7a5dc193e5c19001169630e6da766b",
"size": "20... |
"""
Django settings for fauxra project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | {
"content_hash": "71d8b09a53f8af838025252945ade567",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 71,
"avg_line_length": 23.61320754716981,
"alnum_prop": 0.7267279264882142,
"repo_name": "mpgarate/OST-fauxra",
"id": "ce626fc0ee39e5b0cbbe298dc1fcea3ea0fd510f",
"size": "... |
from gwt.ui.HorizontalSplitPanel import (
Factory,
HorizontalSplitPanel,
SplitPanel,
)
| {
"content_hash": "7adac3278aab73ca396941b440fbb0cd",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 41,
"avg_line_length": 19.8,
"alnum_prop": 0.7272727272727273,
"repo_name": "anandology/pyjamas",
"id": "f4911516878dd7fd2e5571479be39089c8485c0f",
"size": "99",
"binary":... |
from oslo.config import cfg
from oslo import messaging
from oslo.utils import excutils
from oslo.utils import importutils
from oslo_concurrency import processutils
import six
from nova import context
from nova.db import base
from nova import exception
from nova.i18n import _LE, _LI, _LW
from nova.network import rpcapi... | {
"content_hash": "faf27520e557c87727d205ddc888a855",
"timestamp": "",
"source": "github",
"line_count": 689,
"max_line_length": 79,
"avg_line_length": 45,
"alnum_prop": 0.5580067731011127,
"repo_name": "mgagne/nova",
"id": "bf9e16a61cbc60e1312bef7910ba68a6a92803ca",
"size": "31799",
"binary": fal... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('versions', '0018_alter_license_some_rights'),
]
operations = [
migrations.CreateModel(
name='DeniedInstallOrigin',
fields=[
('id', models.AutoField(a... | {
"content_hash": "f01c17bc875a7affedb8430e188da708",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 207,
"avg_line_length": 40.473684210526315,
"alnum_prop": 0.6332899869960988,
"repo_name": "wagnerand/addons-server",
"id": "76e36d3ef4adc9c698e20d14c950436724403532",
"siz... |
"""
Pubsub envelope publisher
Author: Guillaume Aubert (gaubert) <guillaume(dot)aubert(at)gmail(dot)com>
"""
import time
import zmq
def main():
"""main method"""
# Prepare our context and publisher
context = zmq.Context()
publisher = context.socket(zmq.PUB)
publisher.bind("tcp://*:5563"... | {
"content_hash": "76938ff30174ccab477b7b5fd8df2c3f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 22.35483870967742,
"alnum_prop": 0.6248196248196248,
"repo_name": "soscpd/bee",
"id": "005bd8ce2f4cb0f732810220ad4eb2848567d715",
"size": "693",
"b... |
from __future__ import absolute_import
import binascii
from twisted.python import log
from twisted.internet.protocol import Factory
from twisted.protocols.basic import Int32StringReceiver
from twisted.internet.error import ConnectionDone
from autobahn.twisted.util import peer2str
from autobahn.wamp.exception import ... | {
"content_hash": "e4dd38bc24f59625168d17055850b576",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 206,
"avg_line_length": 37.046875,
"alnum_prop": 0.5901166877548151,
"repo_name": "iffy/AutobahnPython",
"id": "56458d087bdbfb2e93800da757b224228f63b01e",
"size": "15503",... |
"""Permission database operations."""
from compass.db.api import database
from compass.db.api import utils
from compass.db import exception
from compass.db import models
SUPPORTED_FIELDS = ['name', 'alias', 'description']
RESP_FIELDS = ['id', 'name', 'alias', 'description']
class PermissionWrapper(object):
def ... | {
"content_hash": "f0292fb2231c401789786ecf4447d0d2",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 71,
"avg_line_length": 32.93577981651376,
"alnum_prop": 0.6573816155988857,
"repo_name": "kidchang/compassv2-api",
"id": "3e3166263964b9c08aa64620e797566033ffbea8",
"size"... |
import json
import os
from flask import Flask
from flask import jsonify
from flask import render_template
from flask import request
from flask import url_for
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
credentials = GoogleCredentials.get_application_default()
api = discove... | {
"content_hash": "b8d8b32cb24923563eb1a74194e6c461",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 77,
"avg_line_length": 29.318181818181817,
"alnum_prop": 0.6790697674418604,
"repo_name": "GoogleCloudPlatform/training-data-analyst",
"id": "c23497fc60a47b1686ca9ccb5292101e... |
from django.forms import widgets
from rest_framework import serializers
from inventory.models import InventoryItem
from server.models import *
class InventoryItemSerializer(serializers.ModelSerializer):
class Meta:
model = InventoryItem
exclude = ('machine',)
class BusinessUnitSerializer(serialize... | {
"content_hash": "d76c8760b63c45cd4f1f2a63afce04f6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 83,
"avg_line_length": 30.1875,
"alnum_prop": 0.7301587301587301,
"repo_name": "chasetb/sal",
"id": "48321da7f3a72c42298c668b65a7f09cf44c2411",
"size": "1449",
"binary": ... |
from django.views.generic import ListView, DetailView, View
from django.views.generic.detail import SingleObjectMixin
from core.views import ObjectApiMixin
from puzzles.models import Puzzle, Source
# Mixins
# Classes
class PuzzleListView(ListView):
model = Puzzle
class PuzzleDetailView(DetailView):
context... | {
"content_hash": "715b5a58288b7e9f9791ee4d3128775a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 74,
"avg_line_length": 23.6,
"alnum_prop": 0.7146892655367232,
"repo_name": "kpeatt/wordmist",
"id": "e152a81adac482b5b01c6ece9ccb77c8107c8745",
"size": "708",
"binary": ... |
from __future__ import absolute_import
import itertools
import json
import os
import re
import shutil
import tempfile
import time
import unittest
import urllib
# Find the best implementation available
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from bs4 import Beauti... | {
"content_hash": "446c69940678eb11d68499d78e724354",
"timestamp": "",
"source": "github",
"line_count": 1192,
"max_line_length": 121,
"avg_line_length": 34.27768456375839,
"alnum_prop": 0.5811449129934654,
"repo_name": "dongjoon-hyun/DIGITS",
"id": "5ab2f427575d42f32eaac25e5497ea7995ab094e",
"size"... |
from reportlab.tools.docco.rl_doc_utils import *
heading1("Exposing PDF Special Capabilities")
disc("""PDF provides a number of features to make electronic
document viewing more efficient and comfortable, and
our library exposes a number of these.""")
heading2("Forms")
disc("""The Form feature lets you creat... | {
"content_hash": "936c24d2d07a6247d0706fe99b9db3b1",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 227,
"avg_line_length": 37.483636363636364,
"alnum_prop": 0.6961583236321304,
"repo_name": "alexissmirnov/donomo",
"id": "074683d590bb4a3fb5f8ad348028296e22c5eea2",
"size"... |
from .resource import Resource
class LocalNetworkGateway(Resource):
"""A common class for general resource information.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: ... | {
"content_hash": "01e0cccadc38a43e199217989210b525",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 213,
"avg_line_length": 43.378787878787875,
"alnum_prop": 0.6423332169053441,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "5ca47b12cb69e97fe1b59f17db2cf48304c01663",
... |
import abc
import datetime
from enum import Enum
from collections.abc import Awaitable
from asyncio_mongo import bson
from dateutil.parser import parse
from wdim.orm import query
class Field(metaclass=abc.ABCMeta):
def __init__(self, index=False, unique=False, required=True):
if unique:
ind... | {
"content_hash": "6b165851d28d1d72eac90820fa0e3c6d",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 89,
"avg_line_length": 23.426136363636363,
"alnum_prop": 0.5891341256366723,
"repo_name": "chrisseto/Still",
"id": "e5af186dde20832c71e2295e309a3dfe77277999",
"size": "412... |
"""Unique operator"""
import tvm
from tvm import te, tir
from ...te import hybrid
from .scan import cumsum
from .sort import sort, argsort
from ..utils import ceil_div
def _get_max_threads(batch_size):
target = tvm.target.Target.current()
max_threads = tvm.target.Target.current(allow_none=False).max_num_threa... | {
"content_hash": "f5021b641f2a205156c78082575ff2d3",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 99,
"avg_line_length": 40.32835820895522,
"alnum_prop": 0.6042437700468789,
"repo_name": "dmlc/tvm",
"id": "8f78cc5fb9246ca815d0c2e93db4bf204b5b7e66",
"size": "17028",
"... |
import ctypes
import json
import os
from binascii import hexlify, unhexlify
import pytest
from pyasn1.codec.ber.decoder import decode as ber_decode
from pyasn1.codec.der.decoder import decode as der_decode
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1.type import namedtype, univ
class EcSigna... | {
"content_hash": "493c6e090cd307d9e27cb9d65249d8df",
"timestamp": "",
"source": "github",
"line_count": 720,
"max_line_length": 87,
"avg_line_length": 29.5125,
"alnum_prop": 0.5962162925314133,
"repo_name": "trezor/trezor-crypto",
"id": "c449b29c8a73dd3687e3b0d103378af0fb9a4c28",
"size": "21271",
... |
"""
The :mod:`surprise.accuracy` module provides with tools for computing accuracy
metrics on a set of predictions.
Available accuracy metrics:
.. autosummary::
:nosignatures:
rmse
mae
fcp
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals... | {
"content_hash": "d8a84649b83dff3acf29956c95d2d53d",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 78,
"avg_line_length": 28.517482517482517,
"alnum_prop": 0.5897498773908779,
"repo_name": "charmoniumQ/Surprise",
"id": "1e9e4855bd229e5188ed9b790d6099eb0ab5ec3c",
"size":... |
import pytest
from fixture.application import Application
import json
import os.path
import importlib
import jsonpickle
from fixture.db import DbFixture
fixture = None
target = None
def load_config(file):
global target
if target is None:
config_file = os.path.join(os.path.dirname(os.path.abspath(__fi... | {
"content_hash": "7eff90786ea1f8c66be4a66d55e059f5",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 100,
"avg_line_length": 30.580246913580247,
"alnum_prop": 0.6729915220024223,
"repo_name": "yupasik/python_training",
"id": "4653f66bd51ec30d9c1d82d823dc63c0a6e76cd0",
"siz... |
from paver.easy import *
from paver.setuputils import setup, find_package_data, find_packages
from paver.setuputils import install_distutils_tasks
from moksha.lib.paver_tasks import *
install_distutils_tasks()
options(
setup=Bunch(
name="moksha.metrics",
version="0.1",
release="1",
... | {
"content_hash": "33c36423e3827986b61d55f391bfc0d5",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 102,
"avg_line_length": 39,
"alnum_prop": 0.6106141920095408,
"repo_name": "ralphbean/moksha",
"id": "97bebf04281fd87ba627c05bcc694d332b622d0e",
"size": "1677",
"binary":... |
from google.cloud import aiplatform
def create_entity_type_sample(
project: str,
featurestore_id: str,
entity_type_id: str,
description: str = "sample entity type",
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The ... | {
"content_hash": "4d94653b748bc35a6e469de6b08663b0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 89,
"avg_line_length": 45.58064516129032,
"alnum_prop": 0.7317763623496107,
"repo_name": "googleapis/python-aiplatform",
"id": "d650b396ccddd9155894bbcf1fa1cfe92bee41f9",
"... |
import re
from collections import defaultdict
from .dialect import Dialect
from .errors import NoSuchLanguageException
KEYWORD_PREFIX_BULLET = '^(\\s*[*+-]\\s*)'
KEYWORD_PREFIX_HEADER = '^(#{1,6}\\s)'
class GherkinInMarkdownTokenMatcher(object):
LANGUAGE_RE = re.compile(r"^\s*#\s*language\s*:\s*([a-zA-Z\-_]+)\s*$... | {
"content_hash": "a84f8c0e18601b7252fd414d87c4412b",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 237,
"avg_line_length": 40.34199134199134,
"alnum_prop": 0.6069320742568945,
"repo_name": "cucumber/gherkin-python",
"id": "31720018058a3d21679b69ae1e911ff95b420381",
"siz... |
import time
import pymongo
from base import *
import bnw.core.bnw_objects as objs
def get_user_bl(request, use_bl=False):
"""Return authed user blacklist or simply an empty list
if user not authed.
:param use_bl: default False. Whether we should return actual
blacklist or just empty ... | {
"content_hash": "1f78253c2f8393e6d6772e579e81c67f",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 149,
"avg_line_length": 38.16872427983539,
"alnum_prop": 0.5633423180592992,
"repo_name": "un-def/bnw",
"id": "bd0cd375c64104514b8ae8e2f0bd9b2ec0e376da",
"size": "9373",
... |
"""Correctness tests for tf.keras CNN models using DistributionStrategy."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.contrib.distribute.python import combinations
from tensorflow.contrib.distribute.python import ker... | {
"content_hash": "e741cfb2a4adff578b9fbfc16fd7157b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 39.22784810126582,
"alnum_prop": 0.6615037108744757,
"repo_name": "ageron/tensorflow",
"id": "3c2961456b2eede9570ce29f7a8900834f2ccfb7",
"size": "378... |
"""
Scrapes the cancer wait times at
http://www.england.nhs.uk/statistics/statistical-work-areas/cancer-waiting-times/
and
http://www.england.nhs.uk/statistics/category/statistics/commissioner-waiting-cancer/
"""
import calendar
import datetime
import re
from lxml.html import fromstring, tostring
import requests
impo... | {
"content_hash": "0d363c57998db0a18adf82654d998eb5",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 142,
"avg_line_length": 30.185393258426966,
"alnum_prop": 0.6205099571933743,
"repo_name": "nhsengland/publish-o-matic",
"id": "76b4bc0c18cbddb589dd390e346af9e61f4d431b",
... |
import datetime
import inspect
import typing
import marshmallow
from dateutil import relativedelta
from marshmallow import Schema, fields, validate
from marshmallow_oneofschema import OneOfSchema
from airflow.models.mappedoperator import MappedOperator
from airflow.serialization.serialized_objects import SerializedBa... | {
"content_hash": "6a56f50127f666d8c3266134102dc075",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 97,
"avg_line_length": 28.653333333333332,
"alnum_prop": 0.6537924616100512,
"repo_name": "bolkedebruin/airflow",
"id": "1c10421ea201ce4caebb17f10a71423e3fc3aa7d",
"size":... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_armor_module_3.iff"
result.attribute_template_id = -1
result.stfName("craft_droid_ingredients_n","armor_module_3")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retu... | {
"content_hash": "b1b96415b06f5d4a8b4be75fda1f73b1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.7051671732522796,
"repo_name": "anhstudios/swganh",
"id": "fc770aa70f1b203a58a1bc3173af4a75318bfd02",
"size": "47... |
from .uwsgi import UWSGIProvider
from .supervisor import SupervisorProvider
from ...app import blueprint
def get_provider(name):
"""
Get provider instance by name.
:param name: Provider name (blueprint)
:return: <provider>
"""
if name == 'uwsgi':
return UWSGIProvider()
elif name =... | {
"content_hash": "89cfd117e2604f88e400e9a20d95bd66",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 90,
"avg_line_length": 30.785714285714285,
"alnum_prop": 0.6716937354988399,
"repo_name": "adisbladis/blues",
"id": "16eea8a2c96c062346ad4aab6357765db1464dc7",
"size": "172... |
"""
Tests For HostManager
"""
from oslo.config import cfg
from cinder import db
from cinder import exception
from cinder.openstack.common.scheduler import filters
from cinder.openstack.common import timeutils
from cinder.scheduler import host_manager
from cinder import test
from cinder.tests.scheduler import fakes
... | {
"content_hash": "960d50472260827fb0bd19a5f46fef6f",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 76,
"avg_line_length": 41.83116883116883,
"alnum_prop": 0.6093345751836904,
"repo_name": "ntt-sic/cinder",
"id": "01bc85904150f3a50f2e3c1655c9370a0892f870",
"size": "10302... |
import os
import random
import re
from collections import OrderedDict
from dataclasses import dataclass
from typing import Any, Dict, Optional
from django.conf import settings
from django.http import HttpRequest, HttpResponse, HttpResponseNotFound
from django.template import loader
from django.views.generic import Tem... | {
"content_hash": "7b407080831bd69b9937503ef290087c",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 100,
"avg_line_length": 42.32218844984803,
"alnum_prop": 0.6312122953174375,
"repo_name": "rht/zulip",
"id": "6c4641a000d014a80dae2814a7a9e7225fc63ee8",
"size": "13924",
... |
import os
import sys
from tempfile import TemporaryFile
from subprocess import Popen, call, STDOUT
import Selenium2Library
WEBSERVER = "target/server.py"
OUTDIR = "output"
def start_web_server():
Popen(['python', WEBSERVER, 'start'], stdout=TemporaryFile(), stderr=STDOUT)
def stop_web_server():
call(['pytho... | {
"content_hash": "2ac73ebc12d5ae6f30bc5af9349c089c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 24.6,
"alnum_prop": 0.6585365853658537,
"repo_name": "maartenvds/robot-framework-examples",
"id": "57cf4fbce15604eb640cc7687ee8ae273631d679",
"size":... |
import re
# Valid values of result type.
RESULT_TYPES = {'unimportant': 'RESULT ',
'default': '*RESULT ',
'informational': ''}
def _EscapePerfResult(s):
"""Escapes |s| for use in a perf result."""
# Colons (:) and equal signs (=) are not allowed, and we chose an arbitrary
# lim... | {
"content_hash": "1127815f9e93919af1869323a4ff3a57",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 80,
"avg_line_length": 32.776119402985074,
"alnum_prop": 0.6397996357012751,
"repo_name": "keishi/chromium",
"id": "193442ede9dd1df3783defe5fbe1cac45856404e",
"size": "2363... |
from __future__ import absolute_import
from __future__ import unicode_literals
import contextlib
import logging
import socket
from textwrap import dedent
from docker.errors import APIError
from requests.exceptions import ConnectionError as RequestsConnectionError
from requests.exceptions import ReadTimeout
from reque... | {
"content_hash": "983718ea4011cce22e71050a508a98e1",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 98,
"avg_line_length": 28.085714285714285,
"alnum_prop": 0.6833672431332655,
"repo_name": "denverdino/compose",
"id": "89a7a9492b11ba97f581b012187e54775a1c1b03",
"size": "... |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
def binop_eq():
iris = h2o.import_file(path=pyunit_utils.locate("smalldata/iris/iris_wheader.csv"))
rows, cols = iris.dim
iris.show()
#frame/scaler
res = iris == 4.7
res_rows, res_cols = res.dim
... | {
"content_hash": "a4a882a0b0b11797264a58c867b71f16",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 87,
"avg_line_length": 26.630434782608695,
"alnum_prop": 0.6020408163265306,
"repo_name": "h2oai/h2o-dev",
"id": "bd4c05fd2d273ba63252eb5e53cf200c44d911bc",
"size": "2450",... |
"""Parse a KeyStore in PKCS#12 format
Using openssl, it is possible to dump the certificates and private keys from
a PKCS#12 keystore:
openssl pkcs12 -info -passin pass:changeit -nodes -in store.p12
Nevertheless this command does not show the bags with type "secretBag", that
contain secret keys for symmetric enc... | {
"content_hash": "ed783fd34153f1a430ecc274e69504fb",
"timestamp": "",
"source": "github",
"line_count": 540,
"max_line_length": 182,
"avg_line_length": 45.422222222222224,
"alnum_prop": 0.6267123287671232,
"repo_name": "fishilico/shared",
"id": "fa61571b377cc972e48e399ea32c03d8a211070c",
"size": "2... |
"""Tests of grpc.channel_ready_future."""
import threading
import unittest
import grpc
import grpc_gcp
from grpc_gcp_test.unit.framework.common import test_constants
from grpc_gcp_test.unit import _thread_pool
class _Callback(object):
def __init__(self):
self._condition = threading.Condition()
... | {
"content_hash": "b631f70411d089ef600780aaf910cade",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 78,
"avg_line_length": 36.642857142857146,
"alnum_prop": 0.6491228070175439,
"repo_name": "GoogleCloudPlatform/grpc-gcp-python",
"id": "612e2a79262ca9f810d11d1c8b3b1f0109a080... |
"""Tests for Python ops defined in sparse_ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ... | {
"content_hash": "15f0a84050eb1c2fb97d1223c00a9758",
"timestamp": "",
"source": "github",
"line_count": 967,
"max_line_length": 80,
"avg_line_length": 41.23267838676318,
"alnum_prop": 0.6134881621187801,
"repo_name": "dancingdan/tensorflow",
"id": "79efee3f5b87c6aa1e4b3adf24862bd496027e33",
"size":... |
from copy import deepcopy
from mycroft.package_cls import Package
from mycroft.services.service_plugin import ServicePlugin
class PackageService(ServicePlugin):
def __init__(self, rt):
super().__init__(rt)
self._package = Package()
def add_struct(self, struct):
"""
Register a... | {
"content_hash": "87aeaa63248dc52f224285e0d82d41db",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 32.30555555555556,
"alnum_prop": 0.5778159931212382,
"repo_name": "MatthewScholefield/mycroft-simple",
"id": "dabb026a15c9dc7d62a658ca13ea00b60fc70e56"... |
from os.path import join
import pathlib
import numpy as np
def _is_32bit():
return np.intp(0).itemsize < 8
def check_propack_submodule():
if not (pathlib.Path(__file__).parent / 'PROPACK/README').exists():
raise RuntimeError("Missing the `PROPACK` submodule! Run "
"`git s... | {
"content_hash": "c67de5b5f23a3d5a5dd776aa7d18743c",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 77,
"avg_line_length": 37.09411764705882,
"alnum_prop": 0.5331430383761497,
"repo_name": "vigna/scipy",
"id": "b593cbca99d73954c851b6e30bfc04a077bd49a7",
"size": "3153",
... |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'testproject/test.db3'
}
}
INSTALLED_APPS = ["django_auth_ldap",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.admin",
"djang... | {
"content_hash": "67db1361c78346a4cebc75673938c881",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 48,
"avg_line_length": 29.125,
"alnum_prop": 0.5064377682403434,
"repo_name": "pexip/os-django-auth-ldap",
"id": "9092f80dfcb4a29a2bdb77b595bcce7d005aa6a7",
"size": "466",
... |
import collections
AccessToken = collections.namedtuple('AccessToken', ['access_token', 'expires_in'])
class LinkedInRecipient(object):
def __init__(self, member_id, email, first_name, last_name):
assert member_id or email, 'Either member ID or email must be given'
if member_id:
... | {
"content_hash": "4525d17a27dd5258b7af664b28b28573",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 83,
"avg_line_length": 31.462365591397848,
"alnum_prop": 0.525974025974026,
"repo_name": "marshallhumble/python-linkedin",
"id": "4d12267ce244ad6e284b24cf3fd18cb41c8ac1f9",
... |
"""empty message
Revision ID: 4c363bf9af2
Revises: 575dde6b846
Create Date: 2015-03-24 16:15:16.721300
"""
# revision identifiers, used by Alembic.
revision = '4c363bf9af2'
down_revision = '575dde6b846'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - plea... | {
"content_hash": "f0916bd94dc1ebcf17ca6774880ff950",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 95,
"avg_line_length": 30.026315789473685,
"alnum_prop": 0.684487291849255,
"repo_name": "PythonClutch/python-clutch",
"id": "b0a243c3df03f48f4c8e1240c94867fa768c2611",
"si... |
import numpy
from chainer.backend import cuda
from chainer import distribution
from chainer.functions.array import repeat
from chainer.functions.array import reshape
from chainer.functions.array import transpose
from chainer.functions.math import prod
from chainer.functions.math import sum as sum_mod
from chainer.util... | {
"content_hash": "77a2d33feab90d04ee1bdfa77174bc24",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 82,
"avg_line_length": 35.33734939759036,
"alnum_prop": 0.6126832594613024,
"repo_name": "okuta/chainer",
"id": "8d12501d465fd46b9220b391c43bc6d56dfe44c1",
"size": "8799",... |
import json
import os.path
from robot.running import ArgInfo
from robot.errors import DataError
from .datatypes import EnumMember, TypedDictItem, TypeDoc
from .model import LibraryDoc, KeywordDoc
class JsonDocBuilder:
def build(self, path):
spec = self._parse_spec_json(path)
return self.build_f... | {
"content_hash": "c76889dc79ebfc4004fb05b1548141ca",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 91,
"avg_line_length": 42.2,
"alnum_prop": 0.5319341006544798,
"repo_name": "robotframework/robotframework",
"id": "2a8657862f50b7ed2988baf6f3cf7a6a99cfeead",
"size": "507... |
import pickle
import tensorflow as tf
import numpy as np
from keras.layers import Input, Flatten, Dense
from keras.models import Model
flags = tf.app.flags
FLAGS = flags.FLAGS
# command line flags
flags.DEFINE_string('training_file', '', "Bottleneck features training file (.p)")
flags.DEFINE_string('validation_file',... | {
"content_hash": "350f824bf8c83b5491b046330e37d510",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 129,
"avg_line_length": 31.9,
"alnum_prop": 0.6739811912225705,
"repo_name": "DavidObando/carnd",
"id": "fba0bd1a3972a9a7acb428909bdfe51c04d7ad98",
"size": "1914",
"binar... |
"""Test manipulate.py for vimiv's test suite."""
import os
import shutil
from unittest import main
from vimiv_testcase import (VimivTestCase, compare_files, compare_pixbufs,
refresh_gui)
class ManipulateTest(VimivTestCase):
"""Manipulate Tests."""
@classmethod
def setUpClass... | {
"content_hash": "a4dbc2a5e0abbd188e010835ea621858",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 78,
"avg_line_length": 42.2,
"alnum_prop": 0.6322274881516587,
"repo_name": "karlch/vimiv",
"id": "4f3adaa6171f692081fc32ebff02d5bf64957691",
"size": "6380",
"binary": f... |
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.mgobe.v20201014 import models
class MgobeClient(AbstractClient):
_apiVersion = '2020-10-14'
_endpoint = 'mgobe.tencentclo... | {
"content_hash": "0865583866bd20237b69640cb09a50bd",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 121,
"avg_line_length": 40.29385964912281,
"alnum_prop": 0.602590617176445,
"repo_name": "tzpBingo/github-trending",
"id": "bd5cb15f641fc3e5d80acdcf37966d719ea92738",
"siz... |
import hashlib
from multiprocessing import Pool
import unittest
from unittest import TestCase
from echoback_server import EchobackIPCServer, EchobackIPCClient
from .. import IPCAvailable
__author__ = 'matheus2740'
from .. import BaseIPCServer, BaseIPCClient
class IPCServerTests(TestCase):
def setUp(self):
... | {
"content_hash": "52ce64384e84f10085330f0cbc73d165",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 64,
"avg_line_length": 21.25,
"alnum_prop": 0.5952941176470589,
"repo_name": "s1mbi0se/s1ipc",
"id": "2b51b612192113b03d8ec01e3ae21597b0facea4",
"size": "1715",
"binary":... |
"""
Collection: database interface class.
These classes provide an interface between the database and the top-level
ingest algorithm (AbstractIngester and its subclasses). They also provide
the implementation of the database and tile store side of the ingest
process. They are expected to be independent of the structur... | {
"content_hash": "991d44059c269e396ddc36a84c809350",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 78,
"avg_line_length": 35.54183266932271,
"alnum_prop": 0.6199977580988678,
"repo_name": "sixy6e/agdc",
"id": "0a6be4f6ef87abcdf787a1e875e6b6b15967da84",
"size": "19591",
... |
import time
import threading
class Switch(object):
"""Button like component with two stable states"""
def __init__(self, pin):
"""
:param pin: A instance of DigitalPin
"""
self.pin = pin
self.pin.mode = 'IN'
self.polling_task = None
self._up_callback = ... | {
"content_hash": "8c1b1d5c430e51aca69d9eef8b3c39f8",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 62,
"avg_line_length": 29.8,
"alnum_prop": 0.5508518327310273,
"repo_name": "pingo-io/pingo-py",
"id": "ddc362c49c7d2b4ba3f5d6dd35be0018e183ecc8",
"size": "1937",
"binary... |
import unittest
import pandas as pd
import qiime2.metadata as metadata
import qiime2.core.type.primitive as primitive
import qiime2.core.type.grammar as grammar
class TestIntersectTwoRanges(unittest.TestCase):
def assertIntersectEqual(self, a, b, exp):
r1 = a & b
r2 = b & a
self.assert... | {
"content_hash": "e3238c45d286ada38de902cab562bad0",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 29.785714285714285,
"alnum_prop": 0.6350119904076739,
"repo_name": "biocore/qiime2",
"id": "774868ba5181cf7c75aa471100c5a8c73bc8b955",
"size": "2435"... |
"""TcEx Framework Webhook Service Trigger module."""
# standard library
import base64
import json
import traceback
from typing import Any, Callable, Optional, Union
from .common_service_trigger import CommonServiceTrigger
class WebhookTriggerService(CommonServiceTrigger):
"""TcEx Framework Webhook Service Trigge... | {
"content_hash": "01ccc1de3c5ed98855011262ce22d397",
"timestamp": "",
"source": "github",
"line_count": 415,
"max_line_length": 99,
"avg_line_length": 38.602409638554214,
"alnum_prop": 0.5592384519350811,
"repo_name": "kstilwell/tcex",
"id": "53e9b3b350d54ffaa7122002cc6ee66a2d61f59b",
"size": "1602... |
import _plotly_utils.basevalidators
class ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="scatter3d.projection.x", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | {
"content_hash": "1a5427f83136ea61bd5da01ccb1b8ea3",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 81,
"avg_line_length": 33.13333333333333,
"alnum_prop": 0.5774647887323944,
"repo_name": "plotly/plotly.py",
"id": "8f945191c8633b704861cf82171a16b2250a0be5",
"size": "497"... |
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from publish.admin import PublishableAdmin, PublishableTabularInline, PublishableStackedInline
from publish.admin import Publishable
from press.forms import ArticleAdminForm
from press.models import Article, Section, ArticleSeo
cl... | {
"content_hash": "a71811b1d44d19b5ab01bbb1cf9cc943",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 94,
"avg_line_length": 28.674418604651162,
"alnum_prop": 0.7039740470397404,
"repo_name": "petry/django-press",
"id": "04cee21f1689e7b28f496f8e2ab5ca27fe90e55a",
"size": "1... |
import asyncio
import functools
import time
import unittest
__all__ = []
def export(f):
__all__.append(f.__name__)
return f
@export
def run_until_complete(fn):
'''Decorator to run an async test synchronously.
Use with AsyncTestBase.
'''
@functools.wraps(fn)
def wrapper(self, *a, **k... | {
"content_hash": "f722979ce4185e3834a5748bc0981240",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 69,
"avg_line_length": 22.621052631578948,
"alnum_prop": 0.598417868776175,
"repo_name": "groner/alternator.py",
"id": "18f166f879d7aa140adce369c2c02ede3491e422",
"size": "... |
"""Manages the spawning of mpi processes to send to the various solvers.
"""
import os
import functools
import numpy as np
from .slepc_linalg import (
eigs_slepc, svds_slepc, mfn_multiply_slepc, ssolve_slepc,
)
from ..core import _NUM_THREAD_WORKERS
# Work out if already running as mpi
if ('OMPI_COMM_WORLD_SIZE... | {
"content_hash": "2e0522f7ed0562a75e8b1cdd78bb64b1",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 79,
"avg_line_length": 33.40909090909091,
"alnum_prop": 0.5834920634920635,
"repo_name": "jcmgray/quijy",
"id": "ca0577eff39da4ec2ada9ff19c76e2ba63d50581",
"size": "11025"... |
def add_native_methods(clazz):
def dispose____(a0):
raise NotImplementedError()
def setFillMode__int__(a0, a1):
raise NotImplementedError()
def beginPath____(a0):
raise NotImplementedError()
def beginSubpath__float__float__(a0, a1, a2):
raise NotImplementedError()
... | {
"content_hash": "49ae9ebf62571ead674e45e22fcb9842",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 123,
"avg_line_length": 33.983870967741936,
"alnum_prop": 0.6312292358803987,
"repo_name": "laffra/pava",
"id": "8ffc2cc9dd5aaee3b088b4444e1ae2d632da12ef",
"size": "2107",
... |
__author__ = 'Matt Clarke-Lauer'
__email__ = 'matt@clarkelauer.com'
__credits__ = ['Matt Clarke-Lauer']
__date__ = 8 / 1 / 13
__version__ = '0.1'
__status__ = 'Development'
import log
name = "libraryApisUsed"
description = "Gets the used library apis"
result = []
def getName():
"return analysis name"
retur... | {
"content_hash": "238ffa778ffac567841aa97fdf0b0947",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 43,
"avg_line_length": 20.612903225806452,
"alnum_prop": 0.6697965571205008,
"repo_name": "mclarkelauer/AndroidAnalyzer",
"id": "fa9c030a23dd9b71dbc24636bc6f7d7a738a82eb",
... |
from CIM15.CDPSM.Asset.IEC61968.Assets.AssetInfo import AssetInfo
class TransformerEndInfo(AssetInfo):
"""Transformer end data.
"""
def __init__(self, ratedU=0.0, endNumber=0, phaseAngleClock=0, emergencyS=0.0, ratedS=0.0, shortTermS=0.0, r=0.0, insulationU=0.0, connectionKind="Z", TransformerTankInfo=Non... | {
"content_hash": "10a40d0aeb3c004f582bf5ec9e080072",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 265,
"avg_line_length": 52.450980392156865,
"alnum_prop": 0.685607476635514,
"repo_name": "rwl/PyCIM",
"id": "2e8275128f347ba0c4dab0579e34e5bdb3f3e210",
"size": "6450",
... |
from mopidy import config
def test_core_schema_has_cache_dir():
assert "cache_dir" in config._core_schema
assert isinstance(config._core_schema["cache_dir"], config.Path)
def test_core_schema_has_config_dir():
assert "config_dir" in config._core_schema
assert isinstance(config._core_schema["config_d... | {
"content_hash": "a00490f6e3baaed5cded512f18874be4",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 34.65217391304348,
"alnum_prop": 0.7289836888331243,
"repo_name": "kingosticks/mopidy",
"id": "b34a9b6907c960c3ecc99ef031d41b48573eeb57",
"size": "79... |
import mido
# This is the default sysex header for launchpad MK2
# It will translate to [F0, 00, 20, 29, 02, 18]
default_header = [0,32,41,2,24]
def note_on(midiout, note, velocity = 100):
message = mido.Message('note_on', note=note, velocity = velocity)
midiout.send(message)
def note_off(midiout, note):
... | {
"content_hash": "4bbba2b1adafe77ea8fb7852b3fb7ddd",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 82,
"avg_line_length": 33.484848484848484,
"alnum_prop": 0.6506787330316742,
"repo_name": "danodic/pianopad",
"id": "b07f8acc1e46c0328fd067ea83cd3f65c93924b1",
"size": "110... |
"""Support for Toon van Eneco devices."""
import logging
from typing import Any, Dict
from functools import partial
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, CONF_SCAN_INTERVAL
from homeassistant.helpers import config_validation as c... | {
"content_hash": "eaa4a8d31d24a22e7c4d019499ded1eb",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 86,
"avg_line_length": 32.90526315789474,
"alnum_prop": 0.6242269140541693,
"repo_name": "fbradyirl/home-assistant",
"id": "4a3afb9b87b408106047bc3f2f1d93f1262409d4",
"siz... |
from flask import (
abort, current_app, g, redirect, render_template, request, session,
url_for
)
from application.blueprint import admin as bp
from model import Admin
from server_global import db
import service
from application.admin.view import account, general, plan, stripe
@bp.before_request
def admin... | {
"content_hash": "8367578e516badb6a1aedc1bba495697",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 72,
"avg_line_length": 27.533333333333335,
"alnum_prop": 0.6335754640839386,
"repo_name": "glennyonemitsu/MarkupHiveServer",
"id": "3686ff46c4a15db39745b29dc709adb9aa3e6544",... |
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext as _build_ext
import os
includes = ['pypesq']
try:
import numpy as np
includes += [os.path.join(np.get_include(), 'numpy')]
except:
pass
extension = Extension("pesq_core",
... | {
"content_hash": "a720ab032db4a654b4de3c77e5e8076a",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 91,
"avg_line_length": 32.61904761904762,
"alnum_prop": 0.5678832116788322,
"repo_name": "vBaiCai/python-pesq",
"id": "71a1f31a45bb7a167df3ac7d5857218ee1e52ebb",
"size": "1... |
import sys
import os
# Modify our path so Python knows where to find verify_util and file_util modules.
sys.path.append(os.path.join(os.path.dirname(__file__), '../web2py/applications/cqg/question'))
import file_util
template_string = '''\
product_family = 'caesar'
question_type = 'caesar'
plaintext = $p
key = $k
h... | {
"content_hash": "a808f7ae6551dbb8ca6bf05a7986449b",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 95,
"avg_line_length": 26.57777777777778,
"alnum_prop": 0.6989966555183946,
"repo_name": "stryder199/RyarkAssignments",
"id": "056fe96237c558d11039461ff28a95006503ea3a",
"s... |
""" tests for MetatasDataset """
# pylint: disable=missing-function-docstring,protected-access,unused-argument,too-many-arguments
import datetime
import logging
import os
import time
import pandas as pd
import pytest
import traitlets
from metatlas.datastructures import metatlas_dataset as mads
from metatlas.datastru... | {
"content_hash": "fe83426d617323bbbe90755130f77143",
"timestamp": "",
"source": "github",
"line_count": 670,
"max_line_length": 109,
"avg_line_length": 37.55223880597015,
"alnum_prop": 0.7043720190779015,
"repo_name": "biorack/metatlas",
"id": "5c7f7fbae0d7d06c516acec0444ca8d2773e06c2",
"size": "25... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'ifilter.pyd')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| {
"content_hash": "0ae3ac009e7015969d8d124f7eb54af6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.5971223021582733,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "e6811d66a173249f632dd71311731bbe4db... |
from pathlib import Path
ADDON_ID = __package__
ADDON_DIR = Path(__file__).parent
CONFIG_DIR = ADDON_DIR / ".config"
if not CONFIG_DIR.exists():
import sys
if sys.platform == "win32":
CONFIG_DIR = Path.home() / "AppData" / "Roaming" / "Blender Foundation" / "Blender" / "JewelCraft"
elif sys.plat... | {
"content_hash": "22ab4a0249e89fbded68ba7731c6e2c2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 106,
"avg_line_length": 36.92307692307692,
"alnum_prop": 0.6552083333333333,
"repo_name": "mrachinskiy/blender-addon-jewelcraft",
"id": "478a1267ec8bc744359baa42998771883f4ed... |
from django.conf.urls import patterns, url
from django.views.decorators.csrf import csrf_exempt
from oscar.core.application import Application
from accounts.api import views, decorators
class APIApplication(Application):
name = None
accounts_view = views.AccountsView
account_view = views.AccountView
... | {
"content_hash": "8d565c26655501616357a17fad190497",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 68,
"avg_line_length": 36.68627450980392,
"alnum_prop": 0.5943345804382683,
"repo_name": "amsys/django-account-balances",
"id": "1cf52c842e20f8826e1532e98270fee595b5a585",
... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cs_cluster
short_description: Manages host clusters on Apache CloudStack based clouds.
description:
- Create, update and remove cluster... | {
"content_hash": "8bd3c20d761162108dd89a384153ff7c",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 125,
"avg_line_length": 29.425587467362924,
"alnum_prop": 0.6157054125998226,
"repo_name": "thaim/ansible",
"id": "f171fbe8461c62a2c0f1df9aaf17bbc09fa8bdf5",
"size": "1145... |
from collections import defaultdict
from positioning.entities import Sample
from positioning.links.base import Base
class ToFullSamples(Base):
def __init__(self, ap_data_dao, **kwargs):
self.ap_data_dao = ap_data_dao
def to_sample(self, stamp):
ap_datas = self.ap_data_dao.get_for_time_range(... | {
"content_hash": "9ab9dbe9a774c082fe6a616b7d4ffee8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 99,
"avg_line_length": 34.31578947368421,
"alnum_prop": 0.6733128834355828,
"repo_name": "maveron58/indiana",
"id": "dc61572c26d3cda914c9a9511bba2278fd62ea5d",
"size": "652... |
from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..constant import CANCEL, NO, OK, YES
from ..gui import GUI
from ..toolkit import toolkit_object
from ..window import Window
ModalDialogTester = toolkit_object('util.modal_dialog_tester:ModalDialogTester')
n... | {
"content_hash": "07dc26c56720902dd52af772f6d758e2",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 80,
"avg_line_length": 39.16470588235294,
"alnum_prop": 0.6631120456593572,
"repo_name": "geggo/pyface",
"id": "f322d396a81e49636ed24b44014c14f7833ae7c9",
"size": "6658",
... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_shirt_field_09.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "666d61d00446ef05fd7126a4e3261aa8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 24.307692307692307,
"alnum_prop": 0.6993670886075949,
"repo_name": "obi-two/Rebelion",
"id": "cd5915edb1192150b55d7a551435ba579212eac0",
"size": "461... |
import unittest
"""
Given a string, find the minimum number of characters to be inserted to convert it to palindrome.
Input: ab
Output: 1 (bab)
Input: aa
Output: 0
Input: abcd
Output: 3 (dcbabcd)
Input: abcda
Output: 2 (adcbcda) which is same as insertions for bcd.
"""
"""
Approach 1:
1. Let min_insertions(str, start... | {
"content_hash": "476fd95871033f928e14a71ae5f7f030",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 109,
"avg_line_length": 29.50877192982456,
"alnum_prop": 0.6135552913198573,
"repo_name": "prathamtandon/g4gproblems",
"id": "5e4d341292ec892c3fce990030d4df35a6a2bbc6",
"si... |
import os
import os.path
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from handlers import base
from handlers import websockets
from ui import modules
from panoptes.utils import database
from panoptes.utils.config.client import get_config
from panopt... | {
"content_hash": "162fedf2d649c231f25b3208bc29ebe3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 85,
"avg_line_length": 34.042857142857144,
"alnum_prop": 0.6441460344104071,
"repo_name": "panoptes/PAWS",
"id": "9d609a2495bcaccd4781725e631373187067f3b1",
"size": "2383",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('notifications', '0011_remove_gcmmessage_registrations_ids'),
]
operations = [
migrations.AddField(
model_name='gcmmessage',
... | {
"content_hash": "94ecebc92151d81c3179998c615b71eb",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 111,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6413502109704642,
"repo_name": "tndatacommons/tndata_backend",
"id": "812e75867dda42f61e33a919eebc7a3e97d32cc1",
... |
"""
oer_data_split.py
using files from oer_processing, and from RadTiltCorr, split files into daily and monthly files for
easier analysis.
"""
#System Stack
import datetime
import argparse
import csv
#Science Stack
import numpy as np
import ephem
__author__ = 'Shaun Bell'
__email__ = 'shaun.bell@noaa.g... | {
"content_hash": "720c1bf3d0c625b8961bd1c5045a638b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 218,
"avg_line_length": 46,
"alnum_prop": 0.5640732265446224,
"repo_name": "NOAA-PMEL/EcoFOCI_ENGR_Testing",
"id": "0726899b9b720144b37ac8e7346d0412ecf29480",
"size": "3519... |
"""
Usage: macresolve [options]
Options:
-h --help Show this help.
--version Show the version.
-a n --address n The MAC Address to get information on.
--update Check for an update to the database.
"""
__author__ = 'Cory Shay (cshay237@gmail.com)'
__copyright__ = 'Copyr... | {
"content_hash": "03db2c10ee375207ca56e50ad746b9ba",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 26.1,
"alnum_prop": 0.578544061302682,
"repo_name": "ccsplit/Macresolve",
"id": "88b1337bff881ed6e45df76dc09d52e20f9213e6",
"size": "1090",
"binary... |
"""Support for the Italian train system using ViaggiaTreno API."""
import asyncio
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION
import homeassistant.helpers.config_validation as c... | {
"content_hash": "2d9a990c56eb12416f4ae583b1ef8404",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 78,
"avg_line_length": 30.570621468926554,
"alnum_prop": 0.5965625577527259,
"repo_name": "aequitas/home-assistant",
"id": "704cb77f5c8fc0688acc6e894a7a34bd04fe693d",
"siz... |
"""Decorators for the Task API.
"""
__authors__ = [
'"Daniel Hans" <daniel.m.hans@gmail.com>',
'"Lennard de Rijk" <ljvderijk@gmail.com>',
]
import logging
import pickle
from functools import wraps
from google.appengine.ext import db
from soc.tasks import responses as task_responses
def task(func):
"""Ta... | {
"content_hash": "0615dea7f203b69f3b8d4ed88ef655de",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 78,
"avg_line_length": 27.49532710280374,
"alnum_prop": 0.6519374575118967,
"repo_name": "MatthewWilkes/mw4068-packaging",
"id": "06d241531c0f284b8f25dd5ec0cb345a7713f27c",
... |
from distutils.core import setup
import survey
setup(
name='djaodjin-survey',
version=survey.__version__,
author='The DjaoDjin Team',
author_email='support@djaodjin.com',
packages=['survey',
'survey.api',
'survey.templatetags',
'survey.urls',
... | {
"content_hash": "2b0a83f6ef77e1845c6c5d298c021e2a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 30.96551724137931,
"alnum_prop": 0.5679287305122495,
"repo_name": "djaodjin/djaodjin-survey",
"id": "b76c24f2ef74ee0dd1817d0ab3fd99a6a4e2b40a",
"size... |
from data_collection.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = 'E07000109'
addresses_name = 'May 2017 - new data/Gravesham2polling_station_export-2017-04-06.csv'
stations_name = 'May 2017 - new data/Gravesham2polling_station_export-2017-... | {
"content_hash": "4d8d1e3ce293ca137b0f046adc9368d1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 91,
"avg_line_length": 41.09090909090909,
"alnum_prop": 0.6814159292035398,
"repo_name": "chris48s/UK-Polling-Stations",
"id": "8df30b374a4af2d5a16c8e3f9b61142a9548c6a2",
"... |
# -*- coding: utf-8 -*-
from .grammar import SchemaGrammar
class SQLiteSchemaGrammar(SchemaGrammar):
_modifiers = ['unsigned', 'nullable', 'default', 'increment']
_serials = ['big_integer', 'integer']
def compile_rename_column(self, blueprint, command, connection):
"""
Compile a rename... | {
"content_hash": "ba1ea361b9c6aaf2b7a606229bfe5507",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 78,
"avg_line_length": 28.462184873949578,
"alnum_prop": 0.568743233933668,
"repo_name": "Hanaasagi/sorator",
"id": "8df91c6b34032c0d6f4c0950b4b4025e8db29746",
"size": "10... |
from sys import stdout
from django.core.management.base import BaseCommand
from frano.quotes.models import Quote
from frano.quotes.models import refresh_price_history
class Command(BaseCommand):
help = 'Refreshes the price history for all quotes'
def handle(self, *args, **options):
quotes = Quote.objects.al... | {
"content_hash": "9d584d42ab42a2460052f0ae5536aabe",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 92,
"avg_line_length": 32.578947368421055,
"alnum_prop": 0.7269789983844911,
"repo_name": "fxdemolisher/frano",
"id": "313f2dceea9850c1469f2a84b35885ac9b4ca631",
"size": "7... |
"""
This module holds functions for users, most notably
* creating users
* logging in as a user (and persisting state with sessions)
"""
import json
import requests
import sys
from constants import BASE_API_URL, BASE_URL, HEADERS
def create_user(user_info):
"""
Create a user from the provided parameters.... | {
"content_hash": "b1b0c64214a653d8afed7aa41cffd61a",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 103,
"avg_line_length": 30.91176470588235,
"alnum_prop": 0.6082302568981922,
"repo_name": "RealMassive/SimpleInventoryDemo",
"id": "be4e154ae6f7cc0f84000087b4060191644d0871"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('structure', '0014_remove_customer_type'),
('marketplace_checklist', '0006_answer_project_remove'),
]
operations = [
migrations.AddField(
model_name='checklist',
... | {
"content_hash": "e144941bb4b09aaecc96a2e342136387",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 66,
"avg_line_length": 25.058823529411764,
"alnum_prop": 0.6032863849765259,
"repo_name": "opennode/nodeconductor-assembly-waldur",
"id": "3603dd1a790bef765fa3044cc8d4a53f64a... |
import contextlib
from taskflow.persistence import backends
from taskflow.persistence.backends import impl_memory
from taskflow import test
from taskflow.tests.unit.persistence import base
class MemoryPersistenceTest(test.TestCase, base.PersistenceTestMixin):
def setUp(self):
super(MemoryPersistenceTest,... | {
"content_hash": "76ec38dd2a0bcee446854bde5e2ac1c2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 32.96153846153846,
"alnum_prop": 0.7036172695449242,
"repo_name": "citrix-openstack-build/taskflow",
"id": "a4d02c44dfa2d82b00e4f61508fa5490738b9591",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.