text stringlengths 4 1.02M | meta dict |
|---|---|
"""Test basic application."""
from __future__ import absolute_import, print_function
import logging
import warnings
from os.path import exists, join
import click
import pytest
from click.testing import CliRunner
from flask import Blueprint, Flask, current_app
from mock import patch
from pkg_resources import EntryPoi... | {
"content_hash": "af9e46f3983981a1dec00fac4d4b8556",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 79,
"avg_line_length": 28.54639175257732,
"alnum_prop": 0.635247381726255,
"repo_name": "tiborsimko/invenio-base",
"id": "6f333e9b46e7d406e1b6e18157daee86e149039b",
"size"... |
"""
Use the Python DTrace consumer as a Thread and run a syscall counter DTrace
script.
Created on Oct 10, 2011
@author: tmetsch
"""
import time
from dtrace_ctypes import consumer
SCRIPT = 'syscall:::entry { @num[execname] = count(); }'
def main():
"""
Run DTrace...
"""
dtrace = consumer.DTraceCo... | {
"content_hash": "a16f5f9f1ef0ec87ce63e4bb5d1c0f7f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 16.272727272727273,
"alnum_prop": 0.6219739292364991,
"repo_name": "tmetsch/python-dtrace",
"id": "dc72f00f3cb16730f028a796de628404b81fbc33",
"size":... |
"""
Unit tests for the Scality SOFS Volume Driver.
"""
import errno
import os
import shutil
import tempfile
import mox as mox_lib
from cinder import context
from cinder import exception
from cinder.image import image_utils
from cinder import test
from cinder import units
from cinder import utils
from cinder.volume.d... | {
"content_hash": "70e3d404f7e3441ef698bc401974017f",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 76,
"avg_line_length": 34.380434782608695,
"alnum_prop": 0.5671830540625988,
"repo_name": "spring-week-topos/cinder-week",
"id": "e8efe3003d1f245c416d5feec6d820e9e29a9fd5",
... |
from __future__ import unicode_literals
import re
from nltk.stem.api import StemmerI
from nltk.compat import python_2_unicode_compatible
@python_2_unicode_compatible
class RegexpStemmer(StemmerI):
"""
A stemmer that uses regular expressions to identify morphological
affixes. Any substrings that match the... | {
"content_hash": "3ff1ec69a57a1ae16dcb0d7581948639",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 69,
"avg_line_length": 26.232142857142858,
"alnum_prop": 0.5847515316541865,
"repo_name": "zimmermegan/MARDA",
"id": "ee51cd84862b1908212fa513d8ef7befbda8e4f6",
"size": "17... |
import os
from pickle import FALSE
import pytest
from stingray.fourier import *
curdir = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(curdir, "data")
def compare_tables(table1, table2, rtol=0.001, discard=[]):
for key in table1.meta.keys():
if key in discard:
continue
... | {
"content_hash": "a2d79d75a7fdbe78105528f8ae693130",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 104,
"avg_line_length": 37.95217391304348,
"alnum_prop": 0.5614617940199336,
"repo_name": "StingraySoftware/stingray",
"id": "cabb124b97fc94d2759cb6f151688eeeedfd33fe",
"s... |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'^$', 'simple.views.index', name='index'),
)
| {
"content_hash": "d63e66180594c840a2469a10b3ab6985",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6384615384615384,
"repo_name": "shenek/django-ogra",
"id": "d14b7f454176f2bbfa4d737d2d9546fdbeb5ade0",
"size": "13... |
class Solution:
# @param s, a string
# @return an integer
def longestValidParentheses(self, s):
result, prev, stack = 0, 0, []
# use index to get length information
for i in xrange(0, len(s)):
if s[i] == '(':
stack.append(i)
else:
if len(stack) > 0 and s[stack[-1]] == '(':
... | {
"content_hash": "728162764e389d878317d7e8316a4e45",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 53,
"avg_line_length": 30.93103448275862,
"alnum_prop": 0.5997770345596433,
"repo_name": "yaoxuanw007/forfun",
"id": "618d0a1ee913a01b53a97f5b649789fe3f4a473c",
"size": "96... |
import numpy as np
import scipy.sparse as sp
from pymg.transfer_base import TransferBase
class LinearTransferPeriodic(TransferBase):
"""Implementation of the linear prolongation and restriction operators
Attributes:
I_2htoh (scipy.sparse.csc_matrix): prolongation matrix
I_hto2h (scipy.sparse.... | {
"content_hash": "a9f8b06f78806e683aabd9fe6e9f6441",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 95,
"avg_line_length": 36.101010101010104,
"alnum_prop": 0.576664801343033,
"repo_name": "Parallel-in-Time/pyMG-2016",
"id": "9eed922d35a9c38c3b4c2df3bcd1f077f894ff10",
"si... |
"""Solar CLI api
On create "golden" resource should be moved to special place
"""
import click
from fabric import api as fabric_api
import json
import networkx as nx
import os
import sys
import tabulate
import yaml
from solar.core import actions
from solar.core import resource as sresource
from solar.core import sig... | {
"content_hash": "dc23a234fb7e7e604709000a42769829",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 92,
"avg_line_length": 28.10625,
"alnum_prop": 0.6057371581054036,
"repo_name": "torgartor21/solar",
"id": "e7231ecb7f488ad83e79dcfba67e6521c5f46018",
"size": "5107",
"b... |
from django.core.management.base import BaseCommand, CommandError
from django.core.management import call_command
from django.conf import settings
from django.db import connection
from django.utils.text import slugify
from django.db import IntegrityError
from contactnetwork.cube import compute_interactions
from contac... | {
"content_hash": "7fec217dd571a2307b95f6dd0701ea6c",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 115,
"avg_line_length": 34.97727272727273,
"alnum_prop": 0.5806800952999783,
"repo_name": "protwis/protwis",
"id": "04ccd6c5895f462cfd1e4fa79c8eb35daf429e71",
"size": "461... |
from boto.mashups.interactive import interactive_shell
import boto
import os
import time
import shutil
import StringIO
import paramiko
import socket
import subprocess
class SSHClient(object):
def __init__(self, server,
host_key_file='~/.ssh/known_hosts',
uname='root', ssh_pwd=No... | {
"content_hash": "9293776fb670fee3d055d84229842e22",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 105,
"avg_line_length": 33.45909090909091,
"alnum_prop": 0.5670425213965494,
"repo_name": "kumar303/rockit",
"id": "b21898c02d0c6c1d4a1dadd6a3c2aebeab2605fd",
"size": "846... |
from telapi_helper.rest import TelapiRestClient
def test_client_init():
telapi = TelapiRestClient("AC123", "SECRET")
| {
"content_hash": "a4c5ddfd726233f32cef2594be1fd0bb",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 48,
"avg_line_length": 30.5,
"alnum_prop": 0.7540983606557377,
"repo_name": "kevinburke/telapi-python",
"id": "787881c3e09d61c244e1a0b05ad9f1cfa71e1a49",
"size": "122",
"b... |
"""
Patched version of nose doctest plugin.
See https://github.com/nose-devs/nose/issues/7
"""
from nose.plugins.doctests import *
class _DoctestFix(Doctest):
def options(self, parser, env):
super(_DoctestFix, self).options(parser, env)
parser.add_option('--doctest-options', action="append",
... | {
"content_hash": "7fa68fc95f007e8de2a256f15bf35165",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 78,
"avg_line_length": 39.31944444444444,
"alnum_prop": 0.5148357470858353,
"repo_name": "cortext/crawtextV2",
"id": "f3e318733a481b38fe70db376b6b5a0fd752f5d9",
"size": "5... |
import numpy as np
import pytest
from pandas import DataFrame, SparseArray, SparseDataFrame, bdate_range
data = {'A': [np.nan, np.nan, np.nan, 0, 1, 2, 3, 4, 5, 6],
'B': [0, 1, 2, np.nan, np.nan, np.nan, 3, 4, 5, 6],
'C': np.arange(10, dtype=np.float64),
'D': [0, 1, 2, 3, 4, 5, np.nan, np.nan,... | {
"content_hash": "06f7359e6d0fcaeb4c44bae8ca836b41",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 28.026086956521738,
"alnum_prop": 0.6313993174061433,
"repo_name": "cbertinato/pandas",
"id": "3423260c1720adb1baab1e1267497226c022e0c2",
"size": "3... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class Phrases(Choreography):
def __init__(self, temboo_session):
"""
Create a new i... | {
"content_hash": "956674192fd9fcc3ce29942f640039f1",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 285,
"avg_line_length": 47.706896551724135,
"alnum_prop": 0.6653415251174557,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "dcb8e1d20a930c24190e02b5b0ef53d867903155",
"s... |
"""
Launch containers for quality checks in Seadata
"""
import os
import json
import time
import requests
from seadata.apis.commons.cluster import ClusterContainerEndpoint
from b2stage.apis.commons.endpoint import MISSING_BATCH, NOT_FILLED_BATCH
from b2stage.apis.commons.endpoint import BATCH_MISCONFIGURATION
from sead... | {
"content_hash": "736c70423400adbecf6cd7fd051456ad",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 95,
"avg_line_length": 36.81308411214953,
"alnum_prop": 0.5504781247355505,
"repo_name": "EUDAT-B2STAGE/http-api",
"id": "607b171558715c82d7cc1515860dd35d78db142f",
"size"... |
import numpy as np
# helper methods for printing scores
def get_score_summary(name, scores, weighted_average):
summary = '%.3f-%.3f (avg=%.5f mean=%.5f std=%.5f)' % (min(scores), max(scores), weighted_average,
np.mean(scores), np.std(scores))
score_li... | {
"content_hash": "214cf3d9cdd59628b12a94be3c930363",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 102,
"avg_line_length": 36.294117647058826,
"alnum_prop": 0.5591572123176661,
"repo_name": "udibr/seizure-prediction",
"id": "8264c605f9f0c97cd669d7259761ca3f4396ae42",
"si... |
'''
Created on 23.09.2011
@author: michi
'''
from ems.auth import AuthenticatedUser, AuthGroup, Permission
from ems.auth import UserProvider as BaseProvider
from ems.auth import UserNotFoundError
class SAOrmAuthGroup(AuthGroup):
def __init__(self, sourceObject, adapter):
self.__sourceObject = sourceO... | {
"content_hash": "0799fce4680425c46886074113a7f8f0",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 89,
"avg_line_length": 31.928571428571427,
"alnum_prop": 0.6496644295302013,
"repo_name": "mtils/ems",
"id": "3067c52073ea3c6448779abc2560940f7e70962b",
"size": "4470",
... |
import actualSDN
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller import ofp_event
from ryu.controller.handler import set_ev_cls
import os
import socket
import json
from ryu.lib import hub
SOCKFILE = '/tmp/hello_sock'
class actualSDN_Django_Switch(actualSDN.actualSDN_switch):
def __init__(se... | {
"content_hash": "0825f620b12cf6c277f5313db57caa5c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 74,
"avg_line_length": 25.49019607843137,
"alnum_prop": 0.7023076923076923,
"repo_name": "ray6/sdn",
"id": "23a33671a7d4c9fdadc84d6b9727675af650586d",
"size": "1300",
"bi... |
"""Perform GATK based filtering, perferring variant quality score recalibration.
Performs hard filtering when VQSR fails on smaller sets of variant calls.
"""
import os
import toolz as tz
from bcbio import broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.log import logger
from bcbio... | {
"content_hash": "b935b9077af5826836b985d1c4574034",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 193,
"avg_line_length": 49.08878504672897,
"alnum_prop": 0.6104712041884817,
"repo_name": "mjafin/bcbio-nextgen",
"id": "f1e3649d99cdc3f5e0016e7b79d1000938251dbd",
"size":... |
from deepmonster.machinery.architecture import Architecture
from deepmonster.nnet.activations import Rectifier, Softmax
from deepmonster.nnet.blocks import ConvBlock, FullyConnectedBlock
from deepmonster.nnet.initializations import Initialization, Gaussian
from deepmonster.nnet.extras import Reshape
from deepmonster.nn... | {
"content_hash": "8620d3cb010b4f1208c261cba471f3a9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 85,
"avg_line_length": 39.78378378378378,
"alnum_prop": 0.6331521739130435,
"repo_name": "olimastro/DeepMonster",
"id": "614ed452feca3ca0ee0da91ccbab6dd23803a65e",
"size": ... |
from wsme import types as wtypes
from solum.api.controllers import common_types
from solum.api.controllers.v1.datamodel import types as api_types
class Infrastructure(api_types.Base):
"""Description of an Infrastructure."""
stacks_uri = common_types.Uri
"URI to services."
@classmethod
def sampl... | {
"content_hash": "b536a9c6e1f259e2604d7661cd429358",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 77,
"avg_line_length": 35.224489795918366,
"alnum_prop": 0.6176129779837776,
"repo_name": "stackforge/solum",
"id": "ffa750656ab565025aa6aa023a2b09030cfd7fcf",
"size": "230... |
from gwt.ui.InlineHTML import (
DOM,
Factory,
HTML,
InlineHTML,
)
| {
"content_hash": "a7e8df48cd09931636b024e7caa57aab",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 31,
"avg_line_length": 13.666666666666666,
"alnum_prop": 0.5975609756097561,
"repo_name": "anandology/pyjamas",
"id": "348ae80682ecdba51bf232e0036b12183a9af696",
"size": "82... |
from flask import session
from flask_socketio import emit, join_room, leave_room
from application.extensions import socketio
@socketio.on('joined', namespace='/chat')
def joined(message):
"""Sent by clients when they enter a room.
A status message is broadcast to all people in the room."""
room = session.... | {
"content_hash": "231e22aed0896d12f517c45d8606d9e1",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 86,
"avg_line_length": 35.793103448275865,
"alnum_prop": 0.6628131021194605,
"repo_name": "chenvista/flask-demos",
"id": "508ec2a10bac1b405418e74a4669e3d74bb02429",
"size":... |
from .dummy_data import (
matplotlib_multiple_axes_figures,
matplotlib_with_image,
matplotlib_without_image,
)
from .mock_server import mock_server, default_ctx, create_app, ParseCTX
from .mock_requests import InjectRequests
from .records import RecordsUtil
from .notebook_client import WandbNotebookClient
... | {
"content_hash": "7e13751667d720ec17c4d2395fef6f4d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 71,
"avg_line_length": 21.977777777777778,
"alnum_prop": 0.6572295247724975,
"repo_name": "wandb/client",
"id": "da8b8a309276f8bc38d59496665c4cba1bd37715",
"size": "989",
... |
from random import randint
import uuid
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import serializers as rest_serializers
from rest_framework.authtoken.models import Token
from rest_framework.exceptions import ValidationError
from fallballapp.error_codes import ... | {
"content_hash": "a89d0cd7f4a58d7dee55f3db8731ddbf",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 99,
"avg_line_length": 35.86538461538461,
"alnum_prop": 0.6631367292225201,
"repo_name": "ingrammicro/fallball-service",
"id": "aea3811c41f5ff818bd8bf32a7e422b97a4321b1",
... |
'''-------------------------------------------------------------------------
Copyright IBM Corp. 2015, 2015 All Rights Reserved
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/... | {
"content_hash": "674845354eac8870d5fc923695e3955d",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 145,
"avg_line_length": 48.373333333333335,
"alnum_prop": 0.4985529217199559,
"repo_name": "Open-I-Beam/swift-storlets",
"id": "f6866eb922063bd176eafd5654b9fed17c475f8e",
... |
from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from msrest import Deserializer, Serializer
from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from .. import models
from ._configuration import ApplicationInsightsManagementClientCon... | {
"content_hash": "9a6af87f6550138b2847d9915991f634",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 208,
"avg_line_length": 52.77777777777778,
"alnum_prop": 0.7458373205741626,
"repo_name": "Azure/azure-sdk-for-python",
"id": "37a5b0bb8b58f0547a13c5b34428ad4a9cb04c1a",
"s... |
import logging
import os
import shutil
import sys
import tempfile
import threading
import time
from collections import namedtuple
from pipes import quote
# pylint: disable=redefined-builtin
from devlib.exception import WorkerThreadError, TargetNotRespondingError, TimeoutError
from devlib.utils.csvutil import csvwrite... | {
"content_hash": "82c67bec9eeb4fa3420c7249185072a5",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 99,
"avg_line_length": 34.091575091575095,
"alnum_prop": 0.5532394971526807,
"repo_name": "ARM-software/lisa",
"id": "1e98115422baf69fe30ed5ed508624d450c6c8f0",
"size": "9... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "server_django.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "529534f38af6acb9615e2b839a3f9e07",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 77,
"avg_line_length": 26,
"alnum_prop": 0.7136752136752137,
"repo_name": "kblauer/cs-outreach",
"id": "bf43c1cb011bb2b193bcd4ed794e0d4013815a39",
"size": "256",
"binary":... |
from __future__ import annotations
import sys
import typing
from collections.abc import Sequence
from copy import deepcopy
from itertools import chain
from pathlib import Path
from types import SimpleNamespace as NS
from typing import Any, Iterable, Union
from warnings import warn
import pandas as pd
import matplotli... | {
"content_hash": "64f434f1ce7f401da3680f90c88289bb",
"timestamp": "",
"source": "github",
"line_count": 898,
"max_line_length": 79,
"avg_line_length": 32.34632516703786,
"alnum_prop": 0.569077701655937,
"repo_name": "has2k1/plotnine",
"id": "e78c48e2ca0f9e3a55f2a856509a45d3dcfd06d2",
"size": "29065... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
from mock import ANY
from ansible.module_utils.network.fortios.fortios import FortiOSHandler
try:
from ansible.modules.network.fortios import fortios_extender_controller_extender
except Impo... | {
"content_hash": "b5f019dffbf9499fe3b05b7841f98f09",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 142,
"avg_line_length": 39.1915285451197,
"alnum_prop": 0.5209811569005216,
"repo_name": "thaim/ansible",
"id": "7d3bd9e108c8f030994c37f09a7028ae6c6c07d9",
"size": "21977"... |
from twisted.cred import credentials # pylint: disable=import-error
from twisted.internet import defer, protocol, reactor # pylint: disable=import-error
from twisted.spread import pb # pylint: disable=import-error
from platformio.app import get_host_id
from platformio.clients.account import AccountClient
class Re... | {
"content_hash": "0f315a4c46493e9b3f754c428e1cf384",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 86,
"avg_line_length": 40.763888888888886,
"alnum_prop": 0.6572402044293015,
"repo_name": "platformio/platformio",
"id": "712449d52781115bb6fae0cef1baba4402d71570",
"size":... |
from __future__ import annotations
import pytest
from xarray.backends.common import robust_getitem
class DummyFailure(Exception):
pass
class DummyArray:
def __init__(self, failures):
self.failures = failures
def __getitem__(self, key):
if self.failures:
self.failures -= 1
... | {
"content_hash": "bcd4a780e8b564389514e4d57bd09671",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 86,
"avg_line_length": 24.1875,
"alnum_prop": 0.6524547803617571,
"repo_name": "markelg/xray",
"id": "c7dba36ea5807e90c322f54622bea124925f6ab0",
"size": "774",
"binary": ... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.testbase import TestBase
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-testbase
# USAGE
python package_run_test.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of... | {
"content_hash": "8dee9eeeac7bd90395c194b8eb545609",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 136,
"avg_line_length": 32.44117647058823,
"alnum_prop": 0.7216681776971895,
"repo_name": "Azure/azure-sdk-for-python",
"id": "7f12597aa979b8af435f8dfdcf79adb603ff47fd",
"s... |
from heat.engine import properties
from heat.engine import constraints
from heat.engine import attributes
from heat.common.i18n import _
from avi.heat.avi_resource import AviResource
from avi.heat.avi_resource import AviNestedResource
from options import *
from common import *
from options import *
from controller_pro... | {
"content_hash": "f8950ddd35d369e389e03749474b58e8",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 223,
"avg_line_length": 27.11181434599156,
"alnum_prop": 0.5882032526651623,
"repo_name": "ypraveen/avi-heat",
"id": "40fdffd4e8a74d1ff2d5c325458d8fcba21470d3",
"size": "1... |
"""
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
import pytest
from byceps.services.tourney import (
match_comment_service as comment_service,
match_service,
)
def test_get_comments_for_match(
api_client, api_client_authz_header, match, comment
):... | {
"content_hash": "f3d9b9af70aa5919e6de3ad313c43687",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 77,
"avg_line_length": 33.19444444444444,
"alnum_prop": 0.5110878661087866,
"repo_name": "homeworkprod/byceps",
"id": "70521cbbe197b6dcf029d1b5b966711aa956d349",
"size": "... |
import argparse
import csv
import datetime
import pandas
# pylint: disable=superfluous-parens
# pylint: disable=broad-except
import logging
import os
import sys
from sqlalchemy.orm import aliased
from sqlalchemy import func, update
from rdr_service.code_constants import BASICS_PROFILE_UPDATE_QUESTION_CODES
from rdr_s... | {
"content_hash": "dd941df08d10399a6aba625ab4ceb67d",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 120,
"avg_line_length": 54.64079422382672,
"alnum_prop": 0.5913911003931155,
"repo_name": "all-of-us/raw-data-repository",
"id": "ede18d6778ba6901ea6a96726787be9ceccdef60",
... |
try:
import unittest2 as unittest
except ImportError:
import unittest
import testlib
class ModularInputKindTestCase(testlib.SDKTestCase):
def setUp(self):
super(ModularInputKindTestCase, self).setUp()
self.uncheckedRestartSplunk()
def test_lists_modular_inputs(self):
if se... | {
"content_hash": "257b3b8e228590b958a7cc85b9f173c6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 77,
"avg_line_length": 34.44444444444444,
"alnum_prop": 0.5858064516129032,
"repo_name": "lowtalker/splunk-sdk-python",
"id": "eb0c7811003ed88695b9bafdd4d747c006236cbf",
"s... |
import sys
import logging
from PyQt5.QtCore import Qt, QFile, QIODevice, QCoreApplication
from PyQt5.QtGui import QFontDatabase, QFont, QKeySequence, QColor, QPixmap
from PyQt5.QtWidgets import QApplication, QDialog, QShortcut, QMessageBox, QStyle
from src.model.application_settings import ApplicationSettings
from sr... | {
"content_hash": "682977e757adedf54e23293c948d76dd",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 101,
"avg_line_length": 31.896882494004796,
"alnum_prop": 0.5849184271859259,
"repo_name": "rafaelvasco/SpriteMator",
"id": "8ac1054b88780ca95206fc51623952bcbbf4cecd",
"si... |
"""This code example gets all active activity groups.
To create activity groups, run create_activity_groups.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authenticatio... | {
"content_hash": "7c41514df9f26d65f9b0cf685140cb9a",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 77,
"avg_line_length": 30.982142857142858,
"alnum_prop": 0.669164265129683,
"repo_name": "cctaylor/googleads-python-lib",
"id": "eb8d380e3623b5cf9d2275fcfc68e7f5f2ac0844",
... |
import os
from mypsp import create_app, db
from mypsp.models import TimeRecord
from flask.ext.script import Manager, Shell
from flask.ext.migrate import Migrate, MigrateCommand
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
migrate = Migrate(app, db)
def make_shell_context():
re... | {
"content_hash": "391979654c69f83896204af089aa28e2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 68,
"avg_line_length": 26.35,
"alnum_prop": 0.7381404174573055,
"repo_name": "benmurray/myPSP",
"id": "75aeee6e4df25dbcd9e67c1306f7f55a84f7aead",
"size": "527",
"binary":... |
"""Helper script used for creating a new release branch on GitHub.
ONLY RELEASE COORDINATORS SHOULD USE THIS SCRIPT.
Usage: Run this script from your oppia root folder:
python scripts/cut_release_branch.py --version="x.y.z"
where x.y.z is the new version of Oppia, e.g. 2.5.3.
"""
import argparse
import json
im... | {
"content_hash": "23387738e9d206ba69fa2bf0ceba9a21",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 79,
"avg_line_length": 34.12571428571429,
"alnum_prop": 0.6450100468854655,
"repo_name": "terrameijar/oppia",
"id": "59f8f920675f41aeb4f2b6ac9e4d54003c0fc456",
"size": "65... |
import sys, os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class BestWindow(QWidget):
def __init__(self, listView, bestexplist, path=os.getcwd()):
super(BestWindow, self).__init__()
self.listView = listView
self.resize(680, 110)
self.setWindowFlags(Qt.FramelessWindowHint)
self.setAttribute(Qt.WA... | {
"content_hash": "0bd7b719d5472b357ebfe1435e0bfd81",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 125,
"avg_line_length": 30.01834862385321,
"alnum_prop": 0.7258557457212714,
"repo_name": "earlybackhome/easy-expression",
"id": "05acb5d53d378d59ca89823f65153de7d395c21e",
... |
from __future__ import print_function
import paddle
import paddle.fluid as fluid
import dist_ctr_reader
from test_dist_base import TestDistRunnerBase, runtime_main
IS_SPARSE = True
# Fix seed for test
fluid.default_startup_program().random_seed = 1
fluid.default_main_program().random_seed = 1
class TestDistCTR2x2... | {
"content_hash": "7c3be04aff230755c585f02ab038fae7",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 84,
"avg_line_length": 35.33684210526316,
"alnum_prop": 0.5677688412272862,
"repo_name": "reyoung/Paddle",
"id": "902dc6544ed6858c4cd8d64b14d6af2367059091",
"size": "3970",... |
import asyncio
import collections
import io
import json
import sys
import traceback
import warnings
from http.cookies import CookieError, Morsel
from urllib.request import getproxies
from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
from yarl import URL
from . import hdrs, helpers, http, ... | {
"content_hash": "0a71acb11d3f93a9eed7b532ace8bf03",
"timestamp": "",
"source": "github",
"line_count": 751,
"max_line_length": 79,
"avg_line_length": 32.64846870838881,
"alnum_prop": 0.561727639789551,
"repo_name": "arju88nair/projectCulminate",
"id": "ee810cf45646872aa0f473e447fe6f34301f9021",
"s... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('compounds', '0002'),
]
operations = [
migrations.AddField(
model_name='compound',
name='par... | {
"content_hash": "797535617e0b5bbc4fc3eac899876fd5",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 129,
"avg_line_length": 27.391304347826086,
"alnum_prop": 0.6158730158730159,
"repo_name": "UPDDI/dds-database-server",
"id": "fa2d90c2ac442b5d2be06b36345210eb00fabe86",
"s... |
import hashlib
import random
import datetime
def create_hash(email, secret):
return hashlib.md5(email + secret).hexdigest()
def hash_password(password, salt):
return hashlib.sha256(password + salt).hexdigest()
def create_schedule_time(start, stop):
start_minutes = int(start * 60)
stop_minutes = in... | {
"content_hash": "7ad92763bb87895d34d840ccdc6f967f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 58,
"avg_line_length": 25.615384615384617,
"alnum_prop": 0.5895895895895896,
"repo_name": "cash/happybot",
"id": "bc76975ee6bbf9b0f2d8190ecf4c99e3f8832cb6",
"size": "999",
... |
"""High-level representations of AMQP protocol objects
"""
import struct
from .serialization import AMQPReader, AMQPWriter
from .spec import FrameType, method_t
from .message import Message
class Frame:
"""AMQP frame
A `Frame` represents the lowest-level packet of data specified by the AMQP 0.9.1
wire-l... | {
"content_hash": "3319fca1ba8b47527bde37579b6971f9",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 100,
"avg_line_length": 36.9640522875817,
"alnum_prop": 0.5740429670232517,
"repo_name": "gst/amqpy",
"id": "9bdcec2f3116f834a973c88d0d9ee68b3112cb1a",
"size": "11311",
... |
"""
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [-2,1,-3,4,-1,2,1,-5,4],
the contiguous subarray [4,-1,2,1] has the largest sum = 6.
"""
class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: L... | {
"content_hash": "f425a5f73b0cb7a2caa842fd87b89639",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 104,
"avg_line_length": 25.25925925925926,
"alnum_prop": 0.5542521994134897,
"repo_name": "Vonzpf/LeetCode",
"id": "6c621d159988a1991a4198c1d5cb069ff47e0e24",
"size": "720"... |
from frappe.model.document import Document
class UserSocialLogin(Document):
pass
| {
"content_hash": "144bd5792dd1f423b43ebbc647395f04",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 42,
"avg_line_length": 20.75,
"alnum_prop": 0.8313253012048193,
"repo_name": "almeidapaulopt/frappe",
"id": "80c0c89383dbd4fbc631932405d524aa1964c7bf",
"size": "195",
"bin... |
import os
from flask_script import Manager
from fight_simulator import app
from fight_simulator.database import session, Fighter, History, User, Base
from getpass import getpass
from werkzeug.security import generate_password_hash
from flask_migrate import Migrate, MigrateCommand
manager = Manager(app)
@manager.comma... | {
"content_hash": "fa833110d0e72a38e6c18caa900cf2db",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7262658227848101,
"repo_name": "tydonk/fight_simulator",
"id": "1785f13259e2e8c095c4b7de50f0810e7c5b62fb",
"size"... |
from __future__ import unicode_literals
from django.db import migrations
def migrate_payout_details(apps, schema_editor):
Project = apps.get_model('projects', 'Project')
PlainPayoutAccount = apps.get_model('payouts', 'PlainPayoutAccount')
PayoutDocument = apps.get_model('payouts', 'PayoutDocument')
C... | {
"content_hash": "06b089faab4be1415ca67645ba200aae",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 38.55172413793103,
"alnum_prop": 0.6413237924865832,
"repo_name": "onepercentclub/bluebottle",
"id": "83c190ad2f5d6c8a9c787a1ef8ec4329f6b2aea1",
"siz... |
from pychron.pipeline.editors.audit_editor import AuditEditor
from pychron.pipeline.nodes.base import BaseNode
class AuditNode(BaseNode):
auto_configure = False
name = "Audit"
configurable = False
def run(self, state):
editor = AuditEditor()
editor.set_unks_refs(state.unknowns, state.... | {
"content_hash": "528b0181740e922780f929d3c1d357be",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 65,
"avg_line_length": 25.764705882352942,
"alnum_prop": 0.6073059360730594,
"repo_name": "USGSDenverPychron/pychron",
"id": "b938fe27857f4defb71f3eb56375a257a3a5e532",
"si... |
from mapmanager import MapManager
from visualizer import MapVisualizer | {
"content_hash": "8816c85aeb2130c22729989053a1da6e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 36,
"avg_line_length": 35,
"alnum_prop": 0.9,
"repo_name": "MadeInPierre/RobotOS",
"id": "edeb1adcecfe40efd0fe1cab1217865b2120f7ed",
"size": "70",
"binary": false,
"copi... |
from . import TEST_FILES
import pytest
from qtpy import QtCore
from pdsspect.pdsspect_image_set import PDSSpectImageSet, SubPDSSpectImageSet
from pdsspect.pdsspect_view import (
PDSSpectView,
PDSSpectViewWidget,
PDSSpectViewController
)
from ginga.Bindings import ScrollEvent
class TestPDSSpectViewContr... | {
"content_hash": "06a03e793296217d54b6811492ab4527",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 78,
"avg_line_length": 39.33658536585366,
"alnum_prop": 0.6243799603174603,
"repo_name": "planetarypy/pdsspect",
"id": "eaecf6b2853a7dc16c673d7408a427ef2444440a",
"size": ... |
import asyncio
import logging
from collections import defaultdict
from collections import deque
import re
import fnmatch
from .ami_protocol import AMIProtocol
from . import actions
from . import utils
class Manager:
"""Main object:
.. code-block:: python
>>> manager = Manager(
... host='1... | {
"content_hash": "39c5b49ef5a376765a2150db7c13a0e8",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 86,
"avg_line_length": 35.00319488817891,
"alnum_prop": 0.5692771084337349,
"repo_name": "gawel/panoramisk",
"id": "29e12ce02560debd54cbba3fc55bd0f0ef91626a",
"size": "109... |
import os
from nbgrader.api import Gradebook
from nbgrader.tests import run_command
from nbgrader.tests.apps.base import BaseTestApp
class TestNbGraderAutograde(BaseTestApp):
def test_help(self):
"""Does the help display without error?"""
run_command("nbgrader autograde --help-all")
def tes... | {
"content_hash": "ac405d82c001c25dde429fff00874ff2",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 93,
"avg_line_length": 48.96138996138996,
"alnum_prop": 0.6470309912467471,
"repo_name": "alope107/nbgrader",
"id": "1cf58b2ddf9f1fde0f643965101db14d6a1d0cfa",
"size": "12... |
import h2o
from tests import pyunit_utils
from h2o.estimators.glm import H2OGeneralizedLinearEstimator
EXPECTED_ERROR_MSG = 'Response value for gamma distribution must be greater than 0.'
def pubdev_5495():
glm = H2OGeneralizedLinearEstimator(family='gamma')
frame = h2o.import_file(pyunit_utils.locate("small... | {
"content_hash": "71b5c6dc45e319dc562022499d379020",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 151,
"avg_line_length": 35.5,
"alnum_prop": 0.7140845070422536,
"repo_name": "michalkurka/h2o-3",
"id": "75b2806e510a60b62ec8ab63446d8a22c3099f38",
"size": "710",
"binary... |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', TemplateView.as_view(template_name="index.html")),
url(r'^admin/', include(admin.site.urls)),
)
| {
"content_hash": "8f788b4d74d03c9c70427f9206fd3d7e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 65,
"avg_line_length": 28.363636363636363,
"alnum_prop": 0.7243589743589743,
"repo_name": "eHealthAfrica/dev-track",
"id": "480b60dbf7e8ff4b8bdcea0602e190a97f1b08a4",
"size... |
import atexit
import datetime
from distutils.version import StrictVersion
from os import environ as env
import os
import subprocess
import sys
import seesaw
from seesaw.item import ItemInterpolation, ItemValue
from seesaw.pipeline import Pipeline
from seesaw.project import Project
from seesaw.task import LimitConcurre... | {
"content_hash": "7631e1bea410d1f9cf84eab625fbcbea",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 135,
"avg_line_length": 33.76851851851852,
"alnum_prop": 0.6591719221277762,
"repo_name": "ArchiveTeam/ArchiveBot",
"id": "73abd2d91018430229d91f61779c364a52d9c3af",
"size... |
from canvas import util
from canvas.tests.tests_helpers import CanvasTestCase
class TestUploads(CanvasTestCase):
def _test_upload(self, filename):
f = file("static/img/tests/" + filename, "rb")
http_response = self.post('/api/upload', { "file": f })
response = util.loads(http_response.conte... | {
"content_hash": "b7c4821188842f604fc4097ea67a1746",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 34.5,
"alnum_prop": 0.6634460547504025,
"repo_name": "canvasnetworks/canvas",
"id": "f8f19aa7a6d0bec90be317b8900d9b645211e6a9",
"size": "621",
"bin... |
import unittest
from itest_support import IntegrationTestSupport
from pybuilder.errors import MissingPluginException
class Test(IntegrationTestSupport):
def test(self):
self.write_build_file("""
from pybuilder.core import use_plugin
use_plugin("pypi:thispluginsdoesnotandshouldnotexist")
name = "plugin... | {
"content_hash": "c5221c53feeb1485af42dbbed926eb30",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 71,
"avg_line_length": 24.82758620689655,
"alnum_prop": 0.7,
"repo_name": "paolodedios/pybuilder",
"id": "40830e030494e95a283e45b1df106e7b095ed2f0",
"size": "1354",
"bina... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('adyen', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='adyentransaction',
name='order_number',
... | {
"content_hash": "d4e731a0a834b29dd09d4df2b8acc0b4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 51,
"avg_line_length": 21.22222222222222,
"alnum_prop": 0.5968586387434555,
"repo_name": "oscaro/django-oscar-adyen",
"id": "c54d1a141d6f00d2cf76a1976c79a023df6f34f2",
"siz... |
"""
nodes for scan operations
"""
from __future__ import division, absolute_import
from __future__ import print_function, unicode_literals
import theano
from .. import core
from .. import utils
@core.register_node("scan_input")
class ScanInputNode(core.NodeImpl):
"""
Node that transfroms a sequence-wise ... | {
"content_hash": "03f38137613f26448ef3b94b6bd268c4",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 79,
"avg_line_length": 39.91798107255521,
"alnum_prop": 0.5561877667140825,
"repo_name": "diogo149/treeano",
"id": "9d47f0211cb68b5b27b94baffbe7c8150b762bd1",
"size": "126... |
from flask import Blueprint
import pajbot.web.routes.admin.banphrases
import pajbot.web.routes.admin.commands
import pajbot.web.routes.admin.home
import pajbot.web.routes.admin.links
import pajbot.web.routes.admin.moderators
import pajbot.web.routes.admin.modules
import pajbot.web.routes.admin.playsounds
import pajbot... | {
"content_hash": "5800862c62ca6cb9594edd2ffd3aec92",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 60,
"avg_line_length": 35.172413793103445,
"alnum_prop": 0.7764705882352941,
"repo_name": "pajlada/pajbot",
"id": "274fb871abf6242c9668a6f96365b3fdf5c61c47",
"size": "1020"... |
"""
Command Session
TODO:
- contextmanager to allow caller to set stream preference
- override of environment and cwd
- ParamDict should unpack itself (CommandSession should nto have to)
"""
__all__ = ["CommandError", "CommandSession", "CommandSessionMixin", "ParamDict"]
import os
import sys
import six
im... | {
"content_hash": "02f54bf5605e112d63f398337e4a02c5",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 80,
"avg_line_length": 29.836575875486382,
"alnum_prop": 0.5182576943140323,
"repo_name": "mikewaters/command-session",
"id": "fe1b6398a905e039e3c07297f0bbc8ccc7a66160",
"... |
import os
from django.conf import settings
from django.core.management.base import BaseCommand
from cnntools.utils import add_bkovacs_to_path, add_caffe_to_path
class Command(BaseCommand):
args = '<trainingfile_source_relpath> <weights_source_relpath> <trainingfile_target_relpath> <weights_target_relpath>'
... | {
"content_hash": "faae8c58ad85efb5ded45372c92116ef",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 125,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.5835095137420718,
"repo_name": "kovibalu/cnntools",
"id": "a52581409baa0a2ca89f05ebe5693d6bd69f84c9",
"size": "2... |
import logging
from .common import * # noqa
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
# Raises ImproperlyConfigured exception if DJANGO_SECRET_KEY not in os.environ
SECRET_KEY = env('DJ... | {
"content_hash": "2b3b50abc771ba4a4b499ca67ab0238f",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 98,
"avg_line_length": 32.75496688741722,
"alnum_prop": 0.5646987464617873,
"repo_name": "KlubJagiellonski/poznaj-app-backend",
"id": "3d9029b2ab70806987f446601f6e1305344ce0... |
import itertools
import random
import requests
import logging
registry = {}
class Plugin(type):
def __new__(metacls, name, bases, namespace, **kwargs):
cls = type.__new__(metacls, name, bases, dict(namespace))
if hasattr(cls, "__provider_name__"):
registry[cls.__provider_name__] = c... | {
"content_hash": "cd52642ecfd8e3224d19ed94e5b909b0",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 92,
"avg_line_length": 25.612903225806452,
"alnum_prop": 0.5815491183879093,
"repo_name": "EverythingMe/teleport",
"id": "e70ea4e129a3e568f75a79b67abe376b2482fe54",
"size"... |
"""Event Related PAC."""
import json
with open("../../paper.json", 'r') as f: cfg = json.load(f) # noqa
import numpy as np
from tensorpac import EventRelatedPac
from tensorpac.signals import pac_signals_wavelet
import seaborn as sns
import matplotlib.pyplot as plt
plt.style.use('seaborn-poster')
sns.set_style("whi... | {
"content_hash": "b39058e8bac8dc6d39c7107497e8fe34",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 35.90384615384615,
"alnum_prop": 0.5838243170862346,
"repo_name": "EtienneCmb/tensorpac",
"id": "40bbbd892339c57ab23209785e61db2dbd96a560",
"size": "... |
""" Provides style checking for java and python using checkstyle and pylint. """
import fnmatch
import subprocess
import os
import sys
import re
import xml.etree.ElementTree as ET
CHECKSTYLE_CONFIG = "javastyle.xml"
PYLINT_CONFIG = "pythonstyle.conf"
PYLINT_ERROR_FMT = re.compile(r"""
^(?P<file>.+?):(?P<line>[0-9]+)... | {
"content_hash": "0efd8053307ca887702ad4ed2d066c56",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 80,
"avg_line_length": 28.873015873015873,
"alnum_prop": 0.6263514751695071,
"repo_name": "bmteam/pink-ponies",
"id": "97d3d9c7924d193ab343948a3e5bd876c5767849",
"size": "... |
from tests.utils import pool, storage
from tests.utils.wallet import create_and_open_wallet
from indy import wallet, signus, ledger
from indy.pool import close_pool_ledger
from indy.error import ErrorCode, IndyError
import pytest
import logging
logging.basicConfig(level=logging.DEBUG)
@pytest.fixture(autouse=True)
d... | {
"content_hash": "e4348286f9de7b97c6e420595fb4c425",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 119,
"avg_line_length": 45.95180722891566,
"alnum_prop": 0.6607236497115889,
"repo_name": "MRJCrunch/indy-sdk",
"id": "0d2a59eb89d331c27a81fc8c29f6a34f3316968b",
"size": "3... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Device',
fields=[
... | {
"content_hash": "a6591ee703549c474a0860875010c759",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 114,
"avg_line_length": 41.90384615384615,
"alnum_prop": 0.5488756310234052,
"repo_name": "amillar2/light-django",
"id": "fcc0030da5d1e2e9c434ae671f96207fd3844750",
"size":... |
from git.util import (
LazyMixin,
Iterable,
)
from .symbolic import SymbolicReference
__all__ = ["Reference"]
#{ Utilities
def require_remote_ref_path(func):
"""A decorator raising a TypeError if we are not a valid remote, based on the path"""
def wrapper(self, *args):
if not self.is_remot... | {
"content_hash": "2ee22c887f3cd4ac403a13a5308d8226",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 101,
"avg_line_length": 35.333333333333336,
"alnum_prop": 0.6074551311550851,
"repo_name": "hvnsweeting/GitPython",
"id": "8741ebb958b8dff2120260ac07ab68a2be36734b",
"size... |
from django import forms
from django.apps import apps
from django.contrib.auth import get_permission_codename, get_user_model
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.exceptions import Objec... | {
"content_hash": "9fdc93b37716279d3de441ca48015fd0",
"timestamp": "",
"source": "github",
"line_count": 1365,
"max_line_length": 126,
"avg_line_length": 36.353846153846156,
"alnum_prop": 0.5832980674284102,
"repo_name": "rsalmaso/django-cms",
"id": "44a51fc1436e1f16e60f4c64d22031ae961bef8a",
"size"... |
from rpc import *
class RpcApiNotFound(Exception): pass
class RpcBadParams(Exception): pass
class Client:
def __init__(self, url, keyFile, apis='*', value='60', mode='minu', caller='anonymous'):
self._auth = AutoAuth(caller, url, keyFile, apis, value, mode)
self._cube = AutoAuthApiCube(u... | {
"content_hash": "19f743d363d9449992418a232f90e5c1",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 92,
"avg_line_length": 34.54794520547945,
"alnum_prop": 0.5114988104678826,
"repo_name": "innerr/stars",
"id": "0403404b43722dd61922bca64ec22bc3434327e8",
"size": "2555",
... |
import mock
import pytest
import datetime
from django.utils import timezone
from rest_framework import exceptions
from waffle.testutils import (
override_switch,
)
from osf import features
from osf.utils.permissions import READ
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_ut... | {
"content_hash": "dff0a8db94551c2dee8f5c7ace603666",
"timestamp": "",
"source": "github",
"line_count": 2080,
"max_line_length": 130,
"avg_line_length": 37.792307692307695,
"alnum_prop": 0.5976999796458375,
"repo_name": "brianjgeiger/osf.io",
"id": "5f39087c1cb1223957f70ef96efcc2b0d3a81e3c",
"size"... |
from bittrex import Bittrex
class Market:
def __init__(self):
self.bittrex = Bittrex()
self.update_currencies_raw()
def update_currencies_raw(self):
self.currencies_raw = self.get_crypto_currencies()
self.currencies_list = sorted([c["MarketName"] for c in self.currencies_raw])... | {
"content_hash": "32f931ae673df88d91ffa28f6b25c1a3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 85,
"avg_line_length": 29,
"alnum_prop": 0.6308316430020284,
"repo_name": "r4rdsn/cryptocur",
"id": "e3f40e9928f40cc7cfc63a57d6fbab5db4338ca3",
"size": "493",
"binary": f... |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | {
"content_hash": "067e0e65ce9d4c5bcf581b2765809d5e",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 112,
"avg_line_length": 39.32211538461539,
"alnum_prop": 0.6640787382320578,
"repo_name": "ar4s/django",
"id": "c0e47e0e429c06592a779a071792f7a2621698c1",
"size": "16358",... |
import grpc
from google.cloud.monitoring_v3.proto import notification_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_notification__pb2
from google.cloud.monitoring_v3.proto import notification_service_pb2 as google_dot_cloud_dot_monitoring__v3_dot_proto_dot_notification__service__pb2
from google.protobuf imp... | {
"content_hash": "8fda24f80bc21efa16459cb62121c021",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 172,
"avg_line_length": 64.34334763948497,
"alnum_prop": 0.776747598719317,
"repo_name": "tseaver/gcloud-python",
"id": "69747310a24c43c52b963c298ae7e00be97a3a31",
"size":... |
import inspect
import logging
import requests
import xmltodict
from xml.parsers.expat import ExpatError
from optionaldict import optionaldict
from wechatpy.crypto import WeChatRefundCrypto
from wechatpy.utils import random_string
from wechatpy.exceptions import WeChatPayException, InvalidSignatureException
from wecha... | {
"content_hash": "7167cf5bef9190dfb931dee822696c85",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 109,
"avg_line_length": 32.39510489510489,
"alnum_prop": 0.5626551538046412,
"repo_name": "jxtech/wechatpy",
"id": "f7d2c66fb8a8a18d78e8b33f34f8ce3db25ff1c8",
"size": "988... |
import os
import pkg_resources
from typeguard import check_argument_types
from typing import Any, Dict, Iterable, List, Set, cast
from pkg_resources import Distribution
from logging import getLogger as _logger
from .canonical import name as _name
from .cache import PluginCache
from .loader import traverse
from .tarja... | {
"content_hash": "7366bbe4ed92d64a5182b528944a19ef",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 113,
"avg_line_length": 32.78409090909091,
"alnum_prop": 0.7020797227036395,
"repo_name": "marrow/package",
"id": "cf444084abb183ad2b54e110de531aba787bb07c",
"size": "5780... |
"""
This file is part of the PROPheT tool.
Copyright (C) 2016: MKLab <pmitzias@iti.gr; mriga@iti.gr; skontopo@iti.gr>
http://mklab.iti.gr/project/prophet-ontology-populator
https://github.com/MKLab-ITI/prophet
Licensed under the Apache License, Version 2.0 (the "License").
You may use this file in compliance with th... | {
"content_hash": "9a7d66b77f950cb1c04fd8a2a17c697a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 120,
"avg_line_length": 49.027522935779814,
"alnum_prop": 0.7215568862275449,
"repo_name": "MKLab-ITI/prophet",
"id": "117547a0c56b36300707970cd680620f98f03eed",
"size": "... |
"""
This module instantiates the Flask application and declares the main error
handling function ``make_json_error``.
"""
# IMPORTANT: updates to the following must also be done in setup.py.
__title__ = "My Smart Home"
__version__ = "0.1.0"
__author__ = "Hugues Demers"
__email__ = "hdemers@gmail.com"
__copyright__ = "... | {
"content_hash": "9e491eba2c32595fde6673c69fa69550",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 29.323529411764707,
"alnum_prop": 0.691073219658977,
"repo_name": "hdemers/smrthome",
"id": "254ef1d09449c49ff60fdf0e701c86bdfd3dc2da",
"size": "1994... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('collect', '0009_auto_20211102_1100'),
]
operations = [
migrations.CreateModel(
name='CollectContribution',
fields=[
... | {
"content_hash": "647f5b27eea9c4d6273ec1e0d5961075",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 206,
"avg_line_length": 36.48275862068966,
"alnum_prop": 0.5964083175803403,
"repo_name": "onepercentclub/bluebottle",
"id": "b330de3dff728ba3ad6ba93e65c75862547da673",
"si... |
from game import Agent
from game import Directions
import random
class KeyboardAgent(Agent):
"""
An agent controlled by the keyboard.
"""
# NOTE: Arrow keys also work.
WEST_KEY = 'a'
EAST_KEY = 'd'
NORTH_KEY = 'w'
SOUTH_KEY = 's'
STOP_KEY = 'q'
def __init__( self, index = 0 )... | {
"content_hash": "d205f3cf58088860d32387f421421218",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 120,
"avg_line_length": 33.98571428571429,
"alnum_prop": 0.6145439260193358,
"repo_name": "startupjing/Artificial-Intelligence",
"id": "a3e96ef185586213069e4f33cc8b212ccb1f87... |
from __future__ import absolute_import
import re
from docutils import nodes
from docutils.parsers.rst import directives
from sphinx import addnodes
from sphinx.directives import ObjectDescription
from sphinx.domains import Domain, ObjType
from sphinx.locale import l_
from sphinx.roles import XRefRole
from sphinx.uti... | {
"content_hash": "cbef300275b910cc7f06c7bc67f4460d",
"timestamp": "",
"source": "github",
"line_count": 374,
"max_line_length": 79,
"avg_line_length": 32.3235294117647,
"alnum_prop": 0.5506658946149392,
"repo_name": "sunfishcode/cretonne",
"id": "a03acf11608222024cb94daa6152fb7a710f2138",
"size": "... |
"""Netlink Module
netlink sockets are used to communicate with various kernel subsystems as
an RPC system. `man 7 netlink` for more information.
You can read all about netlink in rfc 3549, but in general the format for
requests is a netlink message header followed by a specific header
(corresponding to type) followe... | {
"content_hash": "2da9cff5cce2d018d61cab9ced7e0fbc",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 79,
"avg_line_length": 32.726618705035975,
"alnum_prop": 0.5585843042426907,
"repo_name": "nuclon/gnlpy",
"id": "285cb8b88c0f1762767c81dc0e67bbe0fb48ae56",
"size": "18492"... |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
################### UNIT TEST ########################
import unittest
from Settings.TestData import TestData
from TestUnits.Test_ma... | {
"content_hash": "d4f6c99963420d77dd7ed93fc9f54109",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 105,
"avg_line_length": 25.822222222222223,
"alnum_prop": 0.6566265060240963,
"repo_name": "hansehe/Wind-Blade-Inspection",
"id": "517bf9e9e3be5b30b3cc5a9b3dd51f2f35a20213",
... |
class Point():
def reset():
pass
# This gives ERROR
p = Point()
p.reset()
| {
"content_hash": "804d0e9549348f8266e42209709768d9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 18,
"avg_line_length": 11.142857142857142,
"alnum_prop": 0.6153846153846154,
"repo_name": "wolfdale/Spaghetti-code",
"id": "09d5c8e60cd1e003a430b1338f7afb36277e63c7",
"size"... |
from .context_dto import ContextDTO
class QnASearchResultContext(ContextDTO):
"""Context object of the QnA.
:param is_context_only: To mark if a prompt is relevant only with a
previous question or not.
true - Do not include this QnA as search result for queries without
context
false - ign... | {
"content_hash": "7ec1653b60a1da99f463ec186a3ed016",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 31.821428571428573,
"alnum_prop": 0.6453423120089786,
"repo_name": "Azure/azure-sdk-for-python",
"id": "a8389973ecb8eabfff724dd1d22a2f382991d40a",
"s... |
import boto3
import pytest
import sure # noqa # pylint: disable=unused-import
from botocore.exceptions import ClientError
from moto import mock_kinesis
@mock_kinesis
def test_record_data_exceeds_1mb():
client = boto3.client("kinesis", region_name="us-east-1")
client.create_stream(StreamName="my_stream", Sha... | {
"content_hash": "4f1ebf36d841d052ca32b0223f9c01bf",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 155,
"avg_line_length": 37.82692307692308,
"alnum_prop": 0.6578546009150992,
"repo_name": "spulec/moto",
"id": "5c5fa3a4d120083390143ad13a25d7cbaa24a0fd",
"size": "1967",
... |
"""
Django settings for c2asm project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... | {
"content_hash": "fc706901a171e355da170bcd70f7e9b4",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 91,
"avg_line_length": 25.587786259541986,
"alnum_prop": 0.6781026252983293,
"repo_name": "vladimir-nazarenko/c2asm",
"id": "79b2f1ae865e3770bc2bd17c0174d0f4b4fedc2d",
"si... |
from rest_framework import serializers
from utils.serializers import resource_read_only
from ..models import Environment
class EnvironmentListSerializer(serializers.ModelSerializer):
class Meta:
model = Environment
field = '__all__'
read_only_fields = resource_read_only
class Environmen... | {
"content_hash": "3d6f4418a3431a84337e23b89cd29249",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 63,
"avg_line_length": 27.5,
"alnum_prop": 0.6989898989898989,
"repo_name": "GuoDuanLZ/sdustoj-judge-webserver",
"id": "a9709261d4a1971352760423d514d68c6af63d74",
"size": "... |
import _plotly_utils.basevalidators
class FillcolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="fillcolor", parent_name="layout.activeshape", **kwargs
):
super(FillcolorValidator, self).__init__(
plotly_name=plotly_name,
paren... | {
"content_hash": "69a668b64caf0d51c43c1f4bafb85bf0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 32.84615384615385,
"alnum_prop": 0.6135831381733021,
"repo_name": "plotly/plotly.py",
"id": "4f95513188bf5a6e2dd14c672c84825765b37b17",
"size": "427"... |
from setuptools import setup, find_packages
version = '2.0a9'
LONG_DESCRIPTION = """
Using django-avatar
===================
Basics
------
To integrate ``django-avatar`` with your site, there are relatively few things
that are required. A minimal integration can work like this:
1. List this application in the `... | {
"content_hash": "8763a9999e98bf712d7726ea86788db7",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 103,
"avg_line_length": 32.45810055865922,
"alnum_prop": 0.6690189328743545,
"repo_name": "TomLottermann/django-avatar",
"id": "04f9aa7a59a21732088f122b9f8292101b466243",
... |
default_app_config = 'microservices.apps.MicroservicesConfig'
| {
"content_hash": "aa36081c117fc3c6a5b398678a864e34",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 61,
"avg_line_length": 62,
"alnum_prop": 0.8387096774193549,
"repo_name": "gabor-boros/django-microservices",
"id": "612c18a260ec50dc690ea45ff50a64e5d806eb01",
"size": "87",... |
"""Tests for SavedModel."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.python.framework import errors
... | {
"content_hash": "6732b85e4ae060b656405267cba8755c",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 80,
"avg_line_length": 42.268115942028984,
"alnum_prop": 0.6650094291102349,
"repo_name": "naturali/tensorflow",
"id": "0e33250e28b4c508851f07a51814d18323d3129f",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations
import stuff.fields
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.RunSQL('CREATE EXTENSION IF NOT EXISTS citext'),
migrations.AlterField(
... | {
"content_hash": "6e0f2817d32c8b1e39629630fb6455a1",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 263,
"avg_line_length": 34.96,
"alnum_prop": 0.6430205949656751,
"repo_name": "Flyingfox646/flyingfox",
"id": "a92626c29b52d44cb85261e535c963c3b1830d83",
"size": "946",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.