text stringlengths 4 1.02M | meta dict |
|---|---|
import numpy as np
from numpy.testing import assert_almost_equal
from statsmodels.datasets import cancer
from statsmodels.emplike.originregress import ELOriginRegress
from .results.el_results import OriginResults
class GenRes:
"""
Loads data and creates class instance ot be tested.
"""
@classmethod
... | {
"content_hash": "52f29b9f004e28a316ae27f9c5678947",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 73,
"avg_line_length": 32.77272727272727,
"alnum_prop": 0.5929264909847434,
"repo_name": "bashtage/statsmodels",
"id": "c080b4f5c5ca0c5118eb7b8973229e05e218c8a2",
"size": "... |
from __future__ import absolute_import, unicode_literals
import json
from django import forms
from django.core import mail
from django.core.urlresolvers import reverse
from django.test import TestCase
from wagtail.tests.testapp.models import FormField, FormPage
from wagtail.tests.utils import WagtailTestUtils
from w... | {
"content_hash": "2e2849120a2881c6e1f8c028c72c0f38",
"timestamp": "",
"source": "github",
"line_count": 679,
"max_line_length": 120,
"avg_line_length": 38.734904270986746,
"alnum_prop": 0.6195201703357287,
"repo_name": "quru/wagtail",
"id": "b05d7f95dd3b3c12dd0d2a2d875641a3524084c6",
"size": "26507... |
"""Defining SFC data-model
Revision ID: d2c2dcb6c2d4
Revises: 6185f1633a3d
Create Date: 2017-03-02 15:59:58.430218
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd2c2dcb6c2d4'
down_revision = 'd4d4d7f03b21'
def upgrade():
op.create_table(
'sfc_b... | {
"content_hash": "0c199b6f530571081ae20daa617acb81",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 40.907407407407405,
"alnum_prop": 0.6301493888637393,
"repo_name": "stackforge/networking-bagpipe-l2",
"id": "d319d866b2638ffeeef8e3a06e75b967a2205989"... |
import re
from datetime import datetime
class DriverVersionTimestampBased:
@staticmethod
def get_version(version):
days = (datetime.utcnow() - datetime(2000, 1, 1)).days
now = datetime.now()
seconds_since_midnight = (
now - now.replace(hour=0, minute=0, second=0, microsecon... | {
"content_hash": "0766151ef094ecb62bf6b59bcaf7b4e0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 83,
"avg_line_length": 33.05263157894737,
"alnum_prop": 0.6194267515923567,
"repo_name": "QualiSystems/shellfoundry",
"id": "9178a031a3525578a65cd5f1082d1ab55587baea",
"siz... |
import time, pickle, math
from sklearn.utils import shuffle
from pymongo import MongoClient
start = time.time()
connection = MongoClient('localhost', 27017, connect = False)
db = connection.pgc
pairs = db.pairs
batch_size = 1000
n_pairs = math.floor(pairs.count({'target': 1}) / batch_size) * batch_size
n_batches = i... | {
"content_hash": "bbbef75e2b95da8a4ccd6369ec75c14a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 161,
"avg_line_length": 35,
"alnum_prop": 0.5738095238095238,
"repo_name": "douglas-henrique/pgc-comprec",
"id": "cadcb9771b2f0dd44ad4a915dd9b29d628e1d072",
"size": "1260",... |
import math
from operator import add, sub, mul, div, mod
from django.http import Http404
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from ndproj.ndobject import NDObject
from ndlib.ndtype import *
from nduser.models import Dataset
from webservices.ndwserror import NDWSError
fr... | {
"content_hash": "718f937e02e470d41f5fa5b9b24eb928",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 119,
"avg_line_length": 29.988326848249027,
"alnum_prop": 0.6320228363825094,
"repo_name": "openconnectome/open-connectome",
"id": "abca05a803972dfa06251c385d403c2a61222e49"... |
from django.conf.urls import url, include
from rest_framework_nested import routers
from api import views as api_views
router = routers.DefaultRouter()
router.register(r'user', api_views.UserViewSet)
router.register(r'scene', api_views.MetaSceneViewSet)
router.register(r'revision', api_views.SceneRevisionViewSet)
rout... | {
"content_hash": "17d0037005a07c25a287ee21dd6738d2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.75,
"repo_name": "w23/tool.gl",
"id": "1a5ffc400ee3ee77ba42791b8d7488d83f3b4390",
"size": "560",
"binary": fals... |
import getpass
import json
import os
import requests
IGNORE = (
"archive",
"authorization",
"branch",
"code_frequency",
"commit",
"commit_activity",
"contributor_statistics",
"create_content",
"emails",
"event",
"language",
"legacy_email",
"legacy_issue",
"legac... | {
"content_hash": "4dee9c3666fc40cea679670ffc360872",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 61,
"avg_line_length": 19.36046511627907,
"alnum_prop": 0.5393393393393393,
"repo_name": "sigmavirus24/github3.py",
"id": "bc996672b392a6f7e04c81654db8ef5910e753aa",
"size"... |
import io
# THIRD-PARTY
import numpy as np
from numpy.testing import assert_array_equal
# LOCAL
from astropy.io.votable import converters
from astropy.io.votable import exceptions
from astropy.io.votable import tree
from astropy.io.votable.table import parse_single_table
from astropy.tests.helper import raises, catc... | {
"content_hash": "4027b774497a25d6c827f66255254f84",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 78,
"avg_line_length": 28.574545454545454,
"alnum_prop": 0.6150419954186817,
"repo_name": "stargaser/astropy",
"id": "d9697b614992549739535de05f512752241be10c",
"size": "7... |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WH... | {
"content_hash": "c1fc1201b1da8a364002d7d251060f41",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 96,
"avg_line_length": 34.63703703703704,
"alnum_prop": 0.6223267750213858,
"repo_name": "jeremiedecock/snippets",
"id": "7cb72c2c184e6a52718527aa95ebed11321c0b64",
"size"... |
#!/usr/bin/python3
"""A script to check if all server metrics have documentation snippets."""
import os
import re
import sys
from pathlib import Path
from itertools import chain
from yaml import load, dump, YAMLError
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
# Usage... | {
"content_hash": "d1de89c98e7f9113f100663b477ba156",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 138,
"avg_line_length": 36.467289719626166,
"alnum_prop": 0.5181957970271656,
"repo_name": "graetzer/arangodb",
"id": "aef56a97de3412a07ae1edc3382916e02a2f78f4",
"size": "... |
import os
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
requires = [
'pyramid>=1.5a2',
'python-odesk>=0.5',
'pyramid_redis_sessions>=1.0a1'
]
se... | {
"content_hash": "c28bda99ae662208126c79f776ef9858",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 63,
"avg_line_length": 29.6,
"alnum_prop": 0.6196911196911197,
"repo_name": "kipanshi/pyramid_odesk",
"id": "dd999a07232c437fa786b142e73c50160b44638f",
"size": "1036",
"b... |
"""
Copies configuration files to the destination host and applies appropriate
ownership and permissions.
"""
import argparse
import logging
import os
import shutil
import errno
import pwd
import grp
import subprocess
HOSTCLASS_FILE_PATH = "/opt/wgen/etc/hostclass"
METADATA_FILE_NAME = "acfg.metadata"
def copy_tree... | {
"content_hash": "46e85b7f40e2dff35baa2ebe1bf041ee",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 102,
"avg_line_length": 38.945945945945944,
"alnum_prop": 0.6205412907702984,
"repo_name": "Angakkuit/asiaq-aws",
"id": "bd925fceb8045ef0e4e3b0caa7c138eaae554a89",
"size":... |
from .filters import *
from .project_variables import load_variables
import jinja2
from giant.giant_base.giant_base import BaseGiantServer
import os
class SwaggerGiant(BaseGiantServer):
def custom_variables(self):
variables = load_variables()
return {
'project_guid': variables['pro... | {
"content_hash": "432e02e8d8f9e88fce9dcfb431cc6b5f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 74,
"avg_line_length": 33.68421052631579,
"alnum_prop": 0.6234375,
"repo_name": "lixar/giant",
"id": "109cd6c1dbf6e329a8abb879bf562f4c0907d61f",
"size": "1303",
"binary":... |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from openstack_dashboard.dashboards.infrastructure.resource_management. \
resource_classes.tables import RacksTable
from openstack_dashboard.dashboards.infrastructure.resource_management. \
resource... | {
"content_hash": "150e97963f2101921f1f57527f4c2078",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 75,
"avg_line_length": 33.26865671641791,
"alnum_prop": 0.6437864513234635,
"repo_name": "tuskar/tuskar-ui",
"id": "8f49d94d2c34f12e32c1961cfc6497139629d77a",
"size": "2848... |
import serbus, time
eeprom_addr = 0x50 # I2C slave address of EEPROM
start_msb = 0x00 # High byte of location in EEPROM to write/read
start_lsb = 0x00 # Low byte of location in EEPROM to write/read
data_to_write = range(10)
# Create an I2CDev instance for interfacing to /dev/i2c-2:
bus = serbus.I2CDev(2)
bus.ope... | {
"content_hash": "73200d38941a33aa9091b30869c20b5a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 68,
"avg_line_length": 30.551724137931036,
"alnum_prop": 0.7178329571106095,
"repo_name": "graycatlabs/serbus",
"id": "45eb6b95ce4c792329586c204132a05fce11ebdf",
"size": "9... |
"""Tests for swift.common.utils"""
from __future__ import print_function
from test.unit import temptree, debug_logger, make_timestamp_iter, with_tempdir
import ctypes
import contextlib
import errno
import eventlet
import eventlet.debug
import eventlet.event
import eventlet.patcher
import functools
import grp
import lo... | {
"content_hash": "6a61a1ba90732180b674d8447e83cb1c",
"timestamp": "",
"source": "github",
"line_count": 6506,
"max_line_length": 79,
"avg_line_length": 41.190593298493695,
"alnum_prop": 0.547323367638608,
"repo_name": "nadeemsyed/swift",
"id": "2355d984c37d20915d812f446927d1ee85a5f167",
"size": "26... |
import attr
def stringify(val):
return str(val)
def boolify(val):
return bool(val)
def convert_to_list(val):
if val is None:
return []
if isinstance(val, str):
return [val]
try:
iter(val)
except TypeError:
return [str(val)]
if None in val:
raise ... | {
"content_hash": "3f63f004a3213b65add402af9734fdc1",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 82,
"avg_line_length": 29.027397260273972,
"alnum_prop": 0.61113732892874,
"repo_name": "kvg/dmpy",
"id": "7b04ed115a4c4ae43176a6605bfd2fa34c761071",
"size": "2119",
"bin... |
"""
.. _tut-artifact-regression:
Repairing artifacts with regression
===================================
This tutorial covers removal of artifacts using regression as in Gratton et al.
(1983) :footcite:`GrattonEtAl1983`.
Generally speaking, artifacts that result in time waveforms on the sensors
that are accurately r... | {
"content_hash": "7a5abf97e02a891700e6e3dfeacabe65",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 79,
"avg_line_length": 39.59171597633136,
"alnum_prop": 0.7155881034225079,
"repo_name": "bloyl/mne-python",
"id": "507ae8a60c623047cd5e98bce75117487c769fea",
"size": "671... |
import sublime, sublime_plugin, os
ST3 = int(sublime.version()) >= 3000
class SublimeFileBrowserFixUpPaths(sublime_plugin.TextCommand):
'''
usage: open console and run:
view.run_command('sublime_file_browser_fix_up_paths')
purpose: ensure that all paths end with os.sep
'''
def run(self, ed... | {
"content_hash": "dd91d1774dd623686fc2e2198fb9e0e8",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 118,
"avg_line_length": 41.72,
"alnum_prop": 0.5790987535953979,
"repo_name": "meganlkm/SublimeFileBrowser",
"id": "1d7e34b5d8e332b6bf59e1c3d0afe5a23c915b17",
"size": "1043... |
import numpy as np
from .base import Homogeneous, HomogFamilyAlignment
from functools import reduce
class Affine(Homogeneous):
r"""
Base class for all ``n``-dimensional affine transformations. Provides
methods to break the transform down into its constituent
scale/rotation/translation, to view the ho... | {
"content_hash": "4a60a2696d50e826e1fa82c101b569c7",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 81,
"avg_line_length": 32.887468030690535,
"alnum_prop": 0.5536200326619488,
"repo_name": "grigorisg9gr/menpo",
"id": "a8840898c50d9f195be959299be11d1376e96254",
"size": "... |
"""Abstraction for array data structures."""
from numbers import Integral
import tvm._ffi
from tvm._ffi.base import string_types
from tvm.runtime import Object, convert
from tvm.ir import PrimExpr, PointerType, PrimType
from . import _ffi_api
@tvm._ffi.register_object("tir.Buffer")
class Buffer(Object):
"""Symbo... | {
"content_hash": "bc96010f6f30ae6900bf6a891ef7fc95",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 99,
"avg_line_length": 33.6188679245283,
"alnum_prop": 0.6055674037490179,
"repo_name": "Laurawly/tvm-1",
"id": "6dddd7b119a0f3f1c5e3180a73be4d101c6dd8a5",
"size": "9694",... |
"""
WSGI config for fly_project project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "97b4b8e8e671ba89f2d1e45740f1f676",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.9375,
"alnum_prop": 0.7694235588972431,
"repo_name": "Oinweb/fly-django",
"id": "15781736d3f278cc98ed13a5aedcf62844793a9f",
"size": "399",
"bina... |
"""JKS/JCEKS file format decoder. Use in conjunction with PyOpenSSL
to translate to PEM, or load private key and certs directly into
openssl structs and wrap sockets.
Notes on Python2/3 compatibility:
Whereever possible, we rely on the 'natural' byte string
representation of each Python version, i.e. 'str' in Python2... | {
"content_hash": "498069edf206aec1ff5fb46d0b5b6c0c",
"timestamp": "",
"source": "github",
"line_count": 762,
"max_line_length": 203,
"avg_line_length": 45.42125984251968,
"alnum_prop": 0.6383808615757997,
"repo_name": "kurtbrose/pyjks",
"id": "046b36548e1b9a953868a1d1e0965f358af171af",
"size": "346... |
from mrs.fileformats import LineReader
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
PY3 = sys.version_info[0] == 3
def test_dickens():
with open('tests/data/dickens/split1.txt', 'rb') as f:
reader = LineReader(f)
lines = list(reader... | {
"content_hash": "84b34e0bf3b20c1efc8a05c5c6ae36c0",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 64,
"avg_line_length": 24.878048780487806,
"alnum_prop": 0.5931372549019608,
"repo_name": "kseppi/mrs-mapreduce",
"id": "2929b387afb1d13a527bb491e4a31655aad49215",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('foti', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='foto',
options={'ordering': ('foto_position',),... | {
"content_hash": "f7ea05de47a8bb213001e11bfe148269",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 84,
"avg_line_length": 23.863636363636363,
"alnum_prop": 0.5638095238095238,
"repo_name": "mhotwagner/backstage",
"id": "e7f7e1e18fb6aa00514645c00be8af2193e6ca74",
"size": ... |
"""This module contains the general information for BiosVfAltitude ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class BiosVfAltitudeConsts:
VP_ALTITUDE_1500_M = "1500-m"
VP_ALTITUDE_300_M = "300-m"
VP_ALTITUDE_30... | {
"content_hash": "f8433dc1ed31f1169b75ba3bb3394dc7",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 231,
"avg_line_length": 46.76315789473684,
"alnum_prop": 0.5976364659538548,
"repo_name": "ragupta-git/ImcSdk",
"id": "d6dc2f77bce36e75c217be754cc173f417787dc1",
"size": "3... |
from flask import *
from scrape import *
app=Flask(__name__)
@app.route("/", methods=['GET','POST'])
def index():
if request.method == 'GET':
return render_template('index.html');
if request.method == 'POST':
return returnmarkovised()
if __name__=="__main__":
app.run(debug=True)
| {
"content_hash": "fcb55b371e99f06ba55dbb611f854536",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 19.533333333333335,
"alnum_prop": 0.6348122866894198,
"repo_name": "pranavrc/markoviser",
"id": "d169bebbefebb8088d82255f5e417bf18beb0091",
"size": "... |
import cv2
import numpy as np
import math
###################################################################################################
class PossibleChar:
# constructor #################################################################################
def __init__(self, _contour):
self.contour =... | {
"content_hash": "d675e39ee0332a5a8f66968f31cdaa6d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 110,
"avg_line_length": 30.256410256410255,
"alnum_prop": 0.5957627118644068,
"repo_name": "Anggunasr/plat",
"id": "291126bdf3483cfee713bb03100059e2342a851b",
"size": "1199... |
"""
Tests for Twisted-wrapped Kazoo logging.
"""
from logging import INFO
from mock import Mock
from twisted.trial.unittest import SynchronousTestCase
from txkazoo.log import TxLogger
class TxLoggerTests(SynchronousTestCase):
"""Tests for ``TxLogger``."""
def setUp(self):
self.log = Mock(spec=['msg'... | {
"content_hash": "9839611ad05d62bc9a147040beec3289",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 62,
"avg_line_length": 29.104166666666668,
"alnum_prop": 0.6105941302791696,
"repo_name": "rackerlabs/txkazoo",
"id": "706b8bc43a8b431cacae024714e3db660602766f",
"size": "1... |
from msrest.serialization import Model
class Operation(Model):
"""A Media Services REST API operation.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar name: Operation name: {provider}/{resource}/{operation}
:vartype name: str
:param display: The ... | {
"content_hash": "b652ee44cea3dd36944cc9b60c7323d9",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 27.214285714285715,
"alnum_prop": 0.6220472440944882,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "26a2c1f69a531921459f41a136707618cdeace89",... |
from django.db import models
from konfera.models.abstract import KonferaModel
class EmailTemplate(KonferaModel):
name = models.CharField(max_length=255)
text_template = models.TextField()
html_template = models.TextField()
counter = models.IntegerField(default=0)
def __str__(self):
retur... | {
"content_hash": "b6419484a5105ae69925d03b858915e4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 24.294117647058822,
"alnum_prop": 0.6779661016949152,
"repo_name": "pyconsk/django-konfera",
"id": "67aff6e2fe7294dfecac3da509520fbb74f039fd",
"size"... |
"""List duplicate tracks or albums.
"""
from __future__ import division, absolute_import, print_function
import shlex
from beets.plugins import BeetsPlugin
from beets.ui import decargs, print_, vararg_callback, Subcommand, UserError
from beets.util import command_output, displayable_path, subprocess
from beets.librar... | {
"content_hash": "fcb7344d08cec25f9eef372a1d0495f2",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 79,
"avg_line_length": 39.015527950310556,
"alnum_prop": 0.469553450608931,
"repo_name": "Freso/beets",
"id": "4f03971711a13371c87e71d07dcad0b174cdc767",
"size": "13231",
... |
"""
All in one plugin.
Installs and configures VDSM on the same host as ovirt-engine
"""
import logging
import sys
import os
import os.path
import urllib2
import crypt
import time
import nfsutils
import traceback
import engine_validators as validate
import basedefs
import common_utils as utils
from ovirtsdk.api import... | {
"content_hash": "9310203326087f45a3297b364b62719e",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 146,
"avg_line_length": 40.41304347826087,
"alnum_prop": 0.5954814416352878,
"repo_name": "derekhiggins/ovirt-engine",
"id": "f6fa7ce6845a5f7e63d33ec8015891af9a26ca39",
"s... |
from dataset_generator import *
import tensorflow as tf
from tensorflow.keras.models import Sequential, load_model, save_model
from tensorflow.keras.layers import LSTM, Dropout, Dense, Bidirectional,GRU
from tensorflow.keras.callbacks import TensorBoard,ModelCheckpoint
from tensorflow.keras import optimizers
def write... | {
"content_hash": "bd8b9b6424121d2efe2143d2d05bb64b",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 75,
"avg_line_length": 37.75925925925926,
"alnum_prop": 0.6223639038744483,
"repo_name": "arjo129/uSpeech",
"id": "117f7fae2445c903c863e035925f69693eb15761",
"size": "2039"... |
"""
exceptions.py
=============
This submodule contains custom exceptions to achieve more
informative error messages when something goes wrong.
"""
class CancerApiException(Exception):
"""Base class for Cancer_API exceptions"""
pass
class NotConnectedToDatabase(CancerApiException):
"""A database connect... | {
"content_hash": "446a816055f370a1bb566fcbe1e616b8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 22.47826086956522,
"alnum_prop": 0.7214700193423598,
"repo_name": "brunogrande/cancer_api",
"id": "10d628d8904a8056453ae7b40560f6f410261dd1",
"size":... |
DEBUG=True
MONGODB_URI="localhost:27017"
| {
"content_hash": "db1d422e3dcaa11760e3b1ad6e303f55",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 20.5,
"alnum_prop": 0.8048780487804879,
"repo_name": "dhenderson1/Yaiot",
"id": "7ce3f939bf65a827ed3a2e459f49bc48fd040022",
"size": "113",
"binary":... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VmFailedToRebootGuestEvent(vim, *args, **kwargs):
'''This event records a failure to r... | {
"content_hash": "4d2649a0894869b9861f98b8eea74198",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 124,
"avg_line_length": 36.39393939393939,
"alnum_prop": 0.604496253122398,
"repo_name": "xuru/pyvisdk",
"id": "a4a4755c29e925d8452c9505ae92ec910ffdf285",
"size": "1202",
... |
import urllib, urllib2, xbmcplugin, xbmcaddon, xbmcgui, htmllib, re, xbmcplugin, sys
from bs4 import BeautifulSoup
#import lxml.html
#import socket
from ssl import SSLError
settings = xbmcaddon.Addon(id="plugin.audio.internetarchive")
artbase = 'special://home/addons/plugin.audio.internetarchive/resources/media/'
_add... | {
"content_hash": "f391c7e00b4b6843d396f2f85a336ce1",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 254,
"avg_line_length": 34.4163179916318,
"alnum_prop": 0.6440337973375478,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "93c7aaf9ee57b61745d6613e079f6434a75aaba2",
... |
""" Test cases against convert functions. """
import para.conversion as convert
import unittest
class TestConvert(unittest.TestCase):
def test_decimal_to_ascii(self):
self.assertEqual(convert.DecimalToAscii('123').get_value(), '{')
def test_decimal_to_ascii(self):
self.assertEqual(convert.De... | {
"content_hash": "824e078d727a2c79fd13d23143496225",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 78,
"avg_line_length": 32.81147540983606,
"alnum_prop": 0.6382712965276043,
"repo_name": "Migdalo/para",
"id": "2a94ac502c25572d5a88e3ff98ac04859fcc5037",
"size": "4035",
... |
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
def get_google_sheet():
json_key = json.load(open('access.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope)... | {
"content_hash": "9834e34013471015b8f4c64a50e8a494",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 105,
"avg_line_length": 37.07142857142857,
"alnum_prop": 0.7514450867052023,
"repo_name": "vprnet/summer-festivals",
"id": "03da1117b896be39cd493f9d154ad424d5846b9c",
"size... |
r"""
Contains classes and methods that can be used when simulating the game
Higher-or-Lower and performing statistical analysis on different games.
"""
from hol import (
cards,
constants,
)
from hol._hol import (
generate_all_games,
should_pick_higher,
is_a_winning_game,
generate_win_statist... | {
"content_hash": "34e573a326595c791008db6a75932d38",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 18.166666666666668,
"alnum_prop": 0.7064220183486238,
"repo_name": "AustinTSchaffer/DailyProgrammer",
"id": "8a8bbdd35a1d135f6e6a32befca7b762678940d4",... |
"""
Redis Cluster Plugin
"""
from __future__ import absolute_import
import logging
import os
import random
import redis
from redis.sentinel import Sentinel, MasterNotFoundError
from newrelic_plugin_agent.plugins import base
LOGGER = logging.getLogger(__name__)
class RedisCluster(base.SocketStatsPlugin):
GUID ... | {
"content_hash": "cfc9e6fa76b63eda8dcde76ab7ecb41c",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 84,
"avg_line_length": 36.31818181818182,
"alnum_prop": 0.5409887359198998,
"repo_name": "kevin2seedlink/newrelic-plugin-agent",
"id": "67438abd131bee21af72cbca252699d7e4023d... |
from socket import error as SocketError
import os
import subprocess
import signal
import threading
import time
import atexit
import random
import sys
import logging
from zombie.proxy.client import ZombieProxyClient
__all__ = ['ZombieProxyServer']
class PipeWorker(threading.Thread):
"""
A thread that monitor... | {
"content_hash": "fe6506af5ed51435ca4c39379e164c6d",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 79,
"avg_line_length": 29.106060606060606,
"alnum_prop": 0.5674128058302967,
"repo_name": "ryanpetrello/python-zombie",
"id": "932b01dd0d87acb5bf07dae109e5ed50b37cdb61",
"... |
from AlgorithmImports import *
### <summary>
### Test algorithm using a 'ConstituentsUniverse' with test data
### </summary>
class ConstituentsUniverseRegressionAlgorithm(QCAlgorithm):
def Initialize(self):
self.SetStartDate(2013, 10, 7) #Set Start Date
self.SetEndDate(2013, 10, 11) #Set End D... | {
"content_hash": "42c44d0f60ab97474bdff661a5c85be1",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 135,
"avg_line_length": 50.93421052631579,
"alnum_prop": 0.6088865926117283,
"repo_name": "jameschch/Lean",
"id": "3f937eed8abd045d4f31b38e5bbcb2ed687e9889",
"size": "4559"... |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
# Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'ENGINE': 'django.db.backends.',
# Or path to database file if using sqlite3.
'... | {
"content_hash": "ec35acc53ce3203a7988faba6819fd7f",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 79,
"avg_line_length": 33.07643312101911,
"alnum_prop": 0.6865010591180435,
"repo_name": "SnapSearch/SnapSearch-Client-Python",
"id": "81a537e62d4b908c934cb9490d52c0b451dcdb... |
"""
Various data structures used in query construction.
Factored out from django.db.models.query to avoid making the main module very
large and/or so that they can be used by other modules without getting into
circular import difficulties.
"""
from __future__ import unicode_literals
import inspect
from collections im... | {
"content_hash": "984891f7c6c7f7719c3bdd62705a0a6d",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 108,
"avg_line_length": 36.12937062937063,
"alnum_prop": 0.6319558695441788,
"repo_name": "sergei-maertens/django",
"id": "111ba65f3c320b228b85041501f90c0573b4bda8",
"size... |
"""SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person o... | {
"content_hash": "2fb7db6093700bc42cfb71107705b181",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 187,
"avg_line_length": 42.80118694362018,
"alnum_prop": 0.6672212978369384,
"repo_name": "timj/scons",
"id": "55cf33fffbafc221ddc47dd3cfdf3ab46c3174d9",
"size": "14424",
... |
"""Tests for deepvariant .dashboard_utils."""
import io
from absl.testing import absltest
from absl.testing import parameterized
import altair as alt
import pandas as pd
from deepvariant import dashboard_utils
def sample_chart():
df = pd.DataFrame({'A': [1, 2], 'B': [10, 20]})
return alt.Chart(df).mark_point()... | {
"content_hash": "68de47124597ea4ecf7eb7d61711407b",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 80,
"avg_line_length": 30.90625,
"alnum_prop": 0.6309403437815976,
"repo_name": "google/deepvariant",
"id": "b74a740de435dc62d860a68b2ea212a08f0cc082",
"size": "3500",
"b... |
import errno
import os
import stat
from py_utils import cloud_storage
from dependency_manager import exceptions
class CloudStorageInfo():
def __init__(self, cs_bucket, cs_hash, download_path, cs_remote_path,
version_in_cs=None, archive_info=None):
""" Container for the information needed to down... | {
"content_hash": "0339da24ad6e9899f47aec64470c3e02",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 80,
"avg_line_length": 36.56603773584906,
"alnum_prop": 0.6661506707946336,
"repo_name": "catapult-project/catapult",
"id": "28d1e895a0a6e466a188198820be7878b3726698",
"si... |
import web
import socket, struct
import cloud_utils
from cloud_utils import Command
urls = ("/ipallocator", "ipallocator")
app = web.application(urls, globals())
augtool = Command("augtool")
service = Command("service")
class dhcp:
_instance = None
def __init__(self):
self.availIP=[]
self.router=None
self.n... | {
"content_hash": "1b47e4a204dc56fe6a9dc4d4db124812",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 94,
"avg_line_length": 26.863309352517987,
"alnum_prop": 0.6507766470273165,
"repo_name": "argv0/cloudstack",
"id": "53709d026ddfbb899c9b21ebc53ea10a26f2c861",
"size": "44... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrcidId... | {
"content_hash": "35d58c2e75bc8c4211defc0fccafd03e",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 119,
"avg_line_length": 26.58385093167702,
"alnum_prop": 0.5394859813084112,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "f48cdf273aba1a4ad904003aa424579... |
from __future__ import absolute_import
from django.test.client import RequestFactory
from tests.apidocs.util import APIDocsTestCase
class ProjectIssuesDocs(APIDocsTestCase):
def setUp(self):
self.create_event("a")
self.create_event("b")
self.url = u"/api/0/projects/{}/{}/issues/".format... | {
"content_hash": "5af6ad821abdfa51e1ca3c17c21596ce",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.6454720616570327,
"repo_name": "beeftornado/sentry",
"id": "3a54e7b27f9bc11ca1737e0da407af70456b6cba",
"size": "1... |
import os
import sys
# Add the project directory to system path
proj_dir = os.path.expanduser(os.environ['PROJECT_DIR'])
sys.path.append(proj_dir)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
from django.conf import settings
from django.contrib.sites.models import Site
domain = os.environ['WEBSITE_DOMAIN']
Site... | {
"content_hash": "dba1a89e91672cfb68c3408e49a1bf30",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 28.133333333333333,
"alnum_prop": 0.7796208530805687,
"repo_name": "obulpathi/ansible",
"id": "9455624089c9ed16fbb8e8eec9705f0463a1234c",
"size": "63... |
"""
.. module:: eulerlib.primes
:synopsis: Prime numbers generation functions.
.. moduleauthor:: Sameer Marathe
"""
__all__ = ["prime_gen", "prime_wheel_fact_gen", "primes", "primes_wheel_fact",
"is_prime"]
from itertools import islice as it_islice
from itertools import count as it_count
from itertoo... | {
"content_hash": "8df42dd6c47cdacc2e049d08c7c78594",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 78,
"avg_line_length": 33.86624203821656,
"alnum_prop": 0.5804024826029716,
"repo_name": "transmogrifier/eulerlib",
"id": "a2f52ac37cc0b129d507faf3af4ac676ae707250",
"size... |
import unittest
from doctest import DocTestSuite
from test import test_support
class ThreadingLocalTest(unittest.TestCase):
def test_derived(self):
# Issue 3088: if there is a threads switch inside the __init__
# of a threading.local derived class, the per-thread dictionary
# is created but... | {
"content_hash": "5bc0bd07ced1469cc05024fe26a65cb2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 28.78181818181818,
"alnum_prop": 0.5679090334807327,
"repo_name": "babble/babble",
"id": "a7def9530adcbf9f90405d01990976474707b75a",
"size": "1583",
... |
from __future__ import absolute_import
import urwid
from . import common, signals
from .. import filt, version
footer = [
("heading", 'mitmproxy v%s ' % version.VERSION),
('heading_key', "q"), ":back ",
]
class HelpView(urwid.ListBox):
def __init__(self, help_context):
self.help_context = help... | {
"content_hash": "aff95a661f43ec4a5b69cc528cf5e007",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 118,
"avg_line_length": 31.897435897435898,
"alnum_prop": 0.43944265809217575,
"repo_name": "Endika/mitmproxy",
"id": "0c264ebf652013fe1134ec91c8bf26a90a992f57",
"size": "... |
import time, sys
sys.path.append(".")
sys.path.append("..")
from elm327 import elm327, pids
with elm327.ELM327('/dev/ttyUSB0', debug=0) as elm:
"""
Hopefully will print all Diagnostic Trouble Codes stored on the ECU. Some
manufacturers are shady with this stuff so it doesn't always work.
The fetchDTCs() function... | {
"content_hash": "3a364a20d56ed5dfadec4cce58e79a1d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 83,
"avg_line_length": 32.266666666666666,
"alnum_prop": 0.7427685950413223,
"repo_name": "tpltnt/pyELM327",
"id": "b7822e0b1e6e930c4afeabbbe6468351a30edf0e",
"size": "992"... |
from .views import Admin
from .model_register import register, ModelAdmin
| {
"content_hash": "83e2c11c296d0553bdffa71e278af841",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 48,
"avg_line_length": 37,
"alnum_prop": 0.8243243243243243,
"repo_name": "yesudeep/cmc",
"id": "b598138fe7da12b68a163f6987b57d69e301484a",
"size": "74",
"binary": false,
... |
import sys,os, ConfigParser
class ConfigReader:
"""
Read configuration file in dosini format
"""
conf = 'config'
dotconf = '.SuperOctoChainsaw.conf'
def __init__(self, projectName):
self.projectName = projectName
self.config = None
self.fileLocs = dict()
s... | {
"content_hash": "acd62954cd3102d2b22aa696382efbc1",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 97,
"avg_line_length": 28.90625,
"alnum_prop": 0.5718918918918919,
"repo_name": "sconos/super-octo-chainsaw",
"id": "4a0b3c2df8c3456289794765d16ce26bd4a32c1c",
"size": "925... |
__author__ = 'Jeremy B. Merrill'
__email__ = 'jeremybmerrill@gmail.com'
__license__ = 'Apache'
__version__ = '0.1'
from onpi import is_on_pi
import logging
LOG_FILENAME = '/tmp/buses.log'
if is_on_pi():
try:
logging.basicConfig(filename=LOG_FILENAME,level=logging.DEBUG)
except IOError:
logging.basicConfig(... | {
"content_hash": "fc0ed89dfae8258eaa8676e0dd128fda",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 173,
"avg_line_length": 34.76881720430107,
"alnum_prop": 0.6407917117674347,
"repo_name": "jeremybmerrill/bigappleserialbus",
"id": "21c8f24a82982424576903b2a6a58fa4d28d9094... |
import json
import click
import ray
import ray.experimental.serve as serve
@click.group("serve", help="Commands working with ray serve")
def serve_cli():
pass
@serve_cli.command(help="Initialize ray serve components")
def init():
ray.init(address="auto")
serve.init(blocking=True)
@serve_cli.command(... | {
"content_hash": "4627cfe49b2d58504e4eae19df7d5dfb",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 24.84,
"alnum_prop": 0.6859903381642513,
"repo_name": "stephanie-wang/ray",
"id": "b3830559fd0f2be56705544223088414e212bc3a",
"size": "1242",
"bina... |
from .fields import *
from .widgets import *
| {
"content_hash": "2f574da066f1570ed089348664480c4a",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 22,
"avg_line_length": 22.5,
"alnum_prop": 0.7333333333333333,
"repo_name": "agconti/njode",
"id": "acf9e2bd8447efe2be5badf5a5ac16363ea0d3ac",
"size": "60",
"binary": fals... |
"""Tests for ColorCameraMock and ColorCameraFrameMock."""
import unittest
class TestColorCameraMock(unittest.TestCase):
"""Test the ColorCameraMock."""
def test_color_camera_mock(self) -> None:
"""Test the color camera API."""
pass
class TestColorCameraFrameMock(unittest.TestCase):
"""Test the Color... | {
"content_hash": "133a441cee068f71bd8f70e666709572",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 57,
"avg_line_length": 21.217391304347824,
"alnum_prop": 0.6885245901639344,
"repo_name": "google-research/pyreach",
"id": "1abfb935376e3db45ed8df271c2b61480b5bf594",
"size... |
from google.cloud import contact_center_insights_v1
from google.protobuf import duration_pb2
def create_conversation_with_ttl(
project_id: str,
transcript_uri: str = "gs://cloud-samples-data/ccai/chat_sample.json",
audio_uri: str = "gs://cloud-samples-data/ccai/voice_6912.txt",
) -> contact_center_insight... | {
"content_hash": "ea8bbd86f540ea69ae83c184fb4f32cb",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 84,
"avg_line_length": 36.38181818181818,
"alnum_prop": 0.6821589205397302,
"repo_name": "googleapis/python-contact-center-insights",
"id": "fba2dd0e76e611f228f4fb79b54226317... |
added = ['qty', 'add']
def go(added):
add = input('Enter addition here: ')
qty = input('Enter value here: ')
added.append([0](qty))
again = input('Go again?')
print(added)
if again == 'y':
go(added)
go(added)
| {
"content_hash": "647d6240af900630cdb8bc6b6400ce0c",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 38,
"avg_line_length": 21.545454545454547,
"alnum_prop": 0.5569620253164557,
"repo_name": "electric-blue-green/GSCE-Coursework-GTIN",
"id": "d91405cd06ebfda21454f0a298bfbd7f3... |
"""
Counter (CTR) mode.
"""
__all__ = ['CtrMode']
import struct
from Cryptodome.Util._raw_api import (load_pycryptodome_raw_lib, VoidPointer,
create_string_buffer, get_raw_buffer,
SmartPointer, c_size_t, c_uint8_ptr,
... | {
"content_hash": "c746da5ae27ffa20c5c8aa412baeaae5",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 136,
"avg_line_length": 40.15633423180593,
"alnum_prop": 0.558799838904551,
"repo_name": "cloudera/hue",
"id": "99712d051a168a3dfd9e02bf92ec674151528044",
"size": "15920",... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import dedent
from pants.backend.graph_info.tasks.minimal_cover import MinimalCover
from pants.backend.python.targets.python_library import PythonLibrar... | {
"content_hash": "f73ab10a1c668ac4ddcbbdcdbb8f6af8",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 93,
"avg_line_length": 27.03448275862069,
"alnum_prop": 0.6084183673469388,
"repo_name": "baroquebobcat/pants",
"id": "389ec31be99a56bb3e4a09b1fbe19546c0d19648",
"size": "... |
"""Preprocess the Mech Drone model
The model is available for download from
https://sketchfab.com/models/8d06874aac5246c59edb4adbe3606e0e
The Python Imaging Library is required
pip install pillow
"""
from __future__ import print_function
import json
import os
import zipfile
from PIL import Image
from util... | {
"content_hash": "6f791ce810ed0e371571e337b6e7448d",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 76,
"avg_line_length": 30.848,
"alnum_prop": 0.6275933609958506,
"repo_name": "zauonlok/renderer",
"id": "cb5b6491626541dfdae93212302612e9c3491600",
"size": "3856",
"bin... |
from __future__ import unicode_literals
import unittest
class JSONRPCHelpersTestCase(unittest.TestCase):
def test_(self):
pass
| {
"content_hash": "7b8a635f3ebe7f5790bb4b5887387341",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 48,
"avg_line_length": 17.75,
"alnum_prop": 0.7253521126760564,
"repo_name": "ikrauchanka/flask-jsonrpc",
"id": "22dbfb4e2901db512503ef9498be45cf27285dc9",
"size": "1750",
... |
from se34euca.testcase.testcase_base import *
class testcase_utility(testcase_base):
def change_password(self):
print "=== runTest: Change Password ==="
self.eucaUITester.base.test_ui_login()
self.eucaUITester.utility.test_ui_change_password("testpass1")
self.eucaUITester.utility.t... | {
"content_hash": "daada19c7512a6338b35e8b51b839093",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 72,
"avg_line_length": 29.26086956521739,
"alnum_prop": 0.6537890044576523,
"repo_name": "eucalyptus/se34euca",
"id": "3c19251a285dd9b13064cfaf17bcaeebe45c3b8a",
"size": "6... |
from mpi4py import MPI
import mpiunittest as unittest
import os, tempfile, pathlib
def maketemp(prefix):
fd, name = tempfile.mkstemp(prefix=prefix)
os.close(fd)
return name
class BaseTestFile(object):
COMM = MPI.COMM_NULL
FILE = MPI.FILE_NULL
prefix = 'mpi4py'
def setUp(self):
... | {
"content_hash": "0bbc949ff85a2eee1d95dbab4884a44f",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 73,
"avg_line_length": 30.670833333333334,
"alnum_prop": 0.5772313544355386,
"repo_name": "mpi4py/mpi4py",
"id": "f465710c798c6efddf35c977d01bfe404d81f4f0",
"size": "7361"... |
from __future__ import annotations
import unittest
from unittest import mock
import pytest
from airflow.exceptions import AirflowException
from airflow.providers.amazon.aws.hooks.sagemaker import SageMakerHook
from airflow.providers.amazon.aws.operators import sagemaker
from airflow.providers.amazon.aws.operators.sa... | {
"content_hash": "3052ae62828aaa55a5f342f01cf305d7",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 110,
"avg_line_length": 44.55913978494624,
"alnum_prop": 0.63996138996139,
"repo_name": "apache/airflow",
"id": "98d78bafa8fca5c447da2e5eed9da577ba416b0c",
"size": "4931",
... |
from sklearn_explain.tests.skl_datasets import skl_datasets_test as skltest
skltest.test_class_dataset_and_model("BreastCancer" , "AdaBoostClassifier_1")
| {
"content_hash": "bd757a12e472c8b3557fb5cb73869c88",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 77,
"avg_line_length": 39,
"alnum_prop": 0.8076923076923077,
"repo_name": "antoinecarme/sklearn_explain",
"id": "506e7515e964fb85853207b1d4493616dd98b340",
"size": "156",
... |
import os
import time
from matplotlib.pyplot import *
from raysect.optical import World, translate, rotate, Point3D, d65_white, ConstantSF
from raysect.primitive import Sphere, Box, import_obj
from raysect.optical.observer import PinholeCamera, RGBPipeline2D, RGBAdaptiveSampler2D
from raysect.optical.library import Ro... | {
"content_hash": "e921843587001fc97c8f45265a25548c",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 143,
"avg_line_length": 34.56666666666667,
"alnum_prop": 0.7299903567984571,
"repo_name": "raysect/source",
"id": "7570e1d9ce7f57e5213b09c8786129b164fe2091",
"size": "2075"... |
from intern.service.dvid.versioning import VersioningService
from intern.resource.dvid.resource import DataInstanceResource
import numpy
from requests import HTTPError, PreparedRequest, Response, Session
import unittest
from mock import patch, ANY
import mock
class TestVersioning(unittest.TestCase):
def setUp(sel... | {
"content_hash": "89477989ac07d74cfdd33d21aa9725df",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 91,
"avg_line_length": 31.30921052631579,
"alnum_prop": 0.632695944526161,
"repo_name": "jhuapl-boss/intern",
"id": "9c47447d80d1210049fec573b28efdaf6372bdbc",
"size": "53... |
__version__ = '1.0'
__author__ = 'Liao Xuefeng (askxuefeng@gmail.com)'
'''
Python client SDK for sina weibo API using OAuth 1.0
'''
try:
import json
except ImportError:
import simplejson as json
import time
import hmac
import uuid
import base64
import urllib
import urllib2
import hashlib
import logging
_OAUT... | {
"content_hash": "30031d4f7928b53ab0291e31ac04a0f6",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 128,
"avg_line_length": 34.105714285714285,
"alnum_prop": 0.5597721370528609,
"repo_name": "origingod/sina-weibo-auto-login",
"id": "68fe517dfdfa4a9c939027aca0c45a6d8fb5c2e9... |
from __future__ import print_function
class LinkedList:
class Node:
next_node = None
data = None
def compare_to(self, node):
return node.data == self.data
def __init__(self, data, next_node):
self.data = data
self.next_node = next_node
cl... | {
"content_hash": "a0362538c2badba92d10f3aca0f41ede",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 104,
"avg_line_length": 23.013071895424837,
"alnum_prop": 0.5305310991195683,
"repo_name": "EUNIX-TRIX/al-go-rithms",
"id": "9f1cdc93907d10827d04330bbb03097fdcfb948f",
"si... |
"""Subsystem #5: make the inverted index."""
import sys
import time
import pickle
from math import log10
# modules I've written:
import morphosyntactic
import vector_space
import save_and_load
def make_index(tagged=True, time_it=False):
"""
make_index(tagged=True, time_it=False): Make and return the inverted ... | {
"content_hash": "f2b81d1c8863b66dc6b2ee63b81647b2",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 35.28735632183908,
"alnum_prop": 0.5895765472312704,
"repo_name": "nitsas/simple-web-search-engine",
"id": "64385766cfc23f3605424dd6fb1dddbbad8c4dbb",
... |
'''
Created on 1 Septembre 2013
@author: jyp
OpenEdge backend for Django.
South Apdaptation done 20131102
Extents handling:
-----------------
When this backend is used on 4GL Tables, the fields with extents are seen like char fields where
each extent value is separated from each other with the ";" character.
If th... | {
"content_hash": "22402fb366744fd2006165d9a2500d23",
"timestamp": "",
"source": "github",
"line_count": 621,
"max_line_length": 154,
"avg_line_length": 41.95330112721417,
"alnum_prop": 0.49733236095651173,
"repo_name": "monasysinfo/pyodbcOpenEdge",
"id": "f751ff34cc24b4cf0da023652ae7bac6dafa7342",
... |
'''
Sensors:
analog level sensor, pin AIN0
TMP102 i2c temperature sensor, address 0x48
(if add0 is grounded) or 0x49 (if pulled up)
Outputs:
Analog RGB LED strip
I2C display(?)
Pump Activate/Deactivate (GPIO pin)
Some measurements as of mid-March 2014:
Tank can be pumped for 15 minutes without sun exposure to liqui... | {
"content_hash": "3fc68d5bcbf2e18c728fd6f9c9e0e983",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 103,
"avg_line_length": 32.745222929936304,
"alnum_prop": 0.6396615444466057,
"repo_name": "AKAMEDIASYSTEM/bbb-garden",
"id": "bee9580afb0914d3e505833173094377edba5e0a",
"... |
"""
WSGI config for antieviction project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from whitenoise.django import ... | {
"content_hash": "021720fa34d7ad478376fcdba9481456",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 27.38888888888889,
"alnum_prop": 0.795131845841785,
"repo_name": "wdamon/tenants_talk",
"id": "1223bad16a3411c98ac02975a17b77bb66f4a164",
"size": "49... |
from SMDS.method import Method
from SMDS.content import *
from SMDS.user import *
from SMDS.parameter import *
from SMDS.auth import Auth
from SMDS.faults import *
import SMDS.logger as logger
import traceback
class DeleteContentServer( Method ):
"""
Delete a content server. This method will work either if this... | {
"content_hash": "7d670a1ef6859f31a88478b540083c7a",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 130,
"avg_line_length": 32,
"alnum_prop": 0.6069915254237288,
"repo_name": "jcnelson/syndicate",
"id": "9c01ca2afaa7ef0bc641b37bff76e38ea202ad78",
"size": "1907",
"binary... |
from .render import render_project
from . import render
from .store import store_project_from_dict
from . import store
| {
"content_hash": "1d54729c1483574c38bbd62146172b33",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 42,
"avg_line_length": 20.166666666666668,
"alnum_prop": 0.7851239669421488,
"repo_name": "mattcongy/itshop",
"id": "573d7a700a4e1d70af37f1122430b09d78c3dfb6",
"size": "1144... |
"""
SNMPv2c, custom timeout
+++++++++++++++++++++++
Send a SNMP GET request:
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at 104.236.166.95:161
* wait 3 seconds for response, retry 5 times (plus one initial attempt)
* for an OID in tuple form
This script performs similar to the following Net-SNMP... | {
"content_hash": "fa19d07a0c8e16b852c12f28dbdcec8f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 84,
"avg_line_length": 25.817073170731707,
"alnum_prop": 0.6854038734057629,
"repo_name": "etingof/pysnmp",
"id": "b7e137b3a4382efddb100561b4dd5063bab77795",
"size": "2117"... |
'''
Tests for the MySQL states
'''
# Import python libs
from __future__ import absolute_import
import logging
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath
)
ensure_in_syspath('../../')
# Import salt libs
import integration
impo... | {
"content_hash": "60878b564cc09916ff3283e64ce0ce5b",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 80,
"avg_line_length": 31.576771653543307,
"alnum_prop": 0.5010286141761735,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "e8fb2be36b173ad0fadd1e99a568cab5ae1... |
import argparse
import datetime
import json
import os
import sys
import uuid
import requests
from requests.exceptions import ContentDecodingError
def url_download(url):
"""Attempt to download gene annotation file from a given url
:param url: full url to gene annotation file
:type url: str.
:returns: ... | {
"content_hash": "10f752b9582c6d48d7c97eb6a52d45bf",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 31.27027027027027,
"alnum_prop": 0.5916162489196197,
"repo_name": "blankclemens/tools-iuc",
"id": "7b05850062c7ccc2d594676697756b70a8a9aa9b",
"size":... |
import sublime
import sublime_plugin
import urllib.parse
import urllib.request
import urllib.error
import re
import base64
import json
import os
import webbrowser
import difflib
import codecs
from datetime import datetime
import time
# noinspection PyUnresolvedReferences
def http_call(request):
err = ""
timeo... | {
"content_hash": "4d2bc695a88accb9198c8b6c6863b18e",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 107,
"avg_line_length": 31.40828402366864,
"alnum_prop": 0.6032403918613414,
"repo_name": "salcosta/servicenow-sync",
"id": "5966560c99e4819c9c41b384a65c68b3c3319b93",
"si... |
import logging
from google.appengine.api import channel
from rest_framework import generics
from rest_framework import renderers
from rest_framework import status
from chat_server.serializers import ChatMessageSerializer, ChatSessionSerializer
from chat_server.models import ChatMessage, ChatSession
from rest_framewor... | {
"content_hash": "d5a779ad8e895bdba3fbdc934a2bb4db",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 80,
"avg_line_length": 33.63793103448276,
"alnum_prop": 0.6914402870322911,
"repo_name": "pombredanne/cliques",
"id": "415d4f95f6852810c6666529b0ef04ca11d05b7a",
"size": "1... |
"""Exceptions for generated client libraries."""
class Error(Exception):
"""Base class for all exceptions."""
class TypecheckError(Error, TypeError):
"""An object of an incorrect type is provided."""
class NotFoundError(Error):
"""A specified resource could not be found."""
class UserError(Error):
"""Ba... | {
"content_hash": "fdf26621b3e065ebb798d08161e96455",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 72,
"avg_line_length": 24.68686868686869,
"alnum_prop": 0.7176759410801964,
"repo_name": "Plantain/sms-mailinglist",
"id": "7701d573642d1b5a0e994192cb3118a7653def43",
"size... |
"""
Target Options
"""
from __future__ import print_function, division, absolute_import
from .. import config
class TargetOptions(object):
OPTIONS = {}
def __init__(self):
self.values = {}
def from_dict(self, dic):
for k, v in dic.items():
try:
ctor = self.OPT... | {
"content_hash": "5aa5552022bf08a9c7652c4b8129a48b",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 68,
"avg_line_length": 25.8,
"alnum_prop": 0.5237403100775194,
"repo_name": "jriehl/numba",
"id": "53d17bab86e3c6e247dc10d861ba0214c6741c42",
"size": "2064",
"binary": fa... |
from __future__ import division
import sys
sys.path.append('../../udm/sw')
import udm
from udm import *
import sigma
from sigma import *
udm = udm('COM1', 921600)
print("")
sigma = sigma(udm)
sigma.run_compliance_tests(["RV32I", "RV32M"])
udm.disconnect()
| {
"content_hash": "43df49ac8455f47aa12cf42cac3a1b53",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 46,
"avg_line_length": 13.842105263157896,
"alnum_prop": 0.6806083650190115,
"repo_name": "AntonovAlexander/activecore",
"id": "17ebfee31d938fd384c71816c7881afd62d4ba45",
"... |
import os
from flask import render_template, request, current_app, send_file
from flask.ext.login import login_required, current_user
from . import main
@main.route('/')
@login_required
def index():
return render_template('admin/base.html') | {
"content_hash": "94303bbae622c2f8b6e94310dec7e9e9",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 66,
"avg_line_length": 27.22222222222222,
"alnum_prop": 0.7591836734693878,
"repo_name": "chenke91/ckPermission",
"id": "9573a50ea7fcd99ef2476244de3fa6cd3c214531",
"size": "... |
import unittest
import requests
from random import randint
import sys
import os
target_path = os.path.join(os.path.dirname(__file__), '..', 'tidehunter')
sys.path.append(target_path)
# Test Targets
from stream import Hunter
class DummyQueue(object):
def put(self, var, block=True):
pass
class HunterT... | {
"content_hash": "051b8ea8c13bde3659c30c97c61f6071",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 77,
"avg_line_length": 26.791666666666668,
"alnum_prop": 0.6127527216174183,
"repo_name": "woozyking/tidehunter",
"id": "76b10eacd780826827c93a011672228447b55e25",
"size": ... |
"""Tests for the inputsplitter module."""
from __future__ import print_function
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import unittest
import sys
import nose.tools as nt
from IPython.core import inputsplitter as isp
from IPython.core.inputtransformer im... | {
"content_hash": "32c0070037a6d9f176a8187712f985aa",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 99,
"avg_line_length": 36.27814569536424,
"alnum_prop": 0.5565899963490325,
"repo_name": "bdh1011/wau",
"id": "c657d7f000397884fea067feeec247e2ab76758f",
"size": "21937",
... |
'''
Notes.
From the AST documentation: "The Box class does not define any new attributes beyond those
which are applicable to all Regions.", i.e. for AST, there is nothing special about a box
beyond a specific means to define it, i.e. a corner and center or two corner points.
'''
from __future__ import annotations # ... | {
"content_hash": "dfa994bc3ebe74cd778bb2838eef2db8",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 187,
"avg_line_length": 35.341284403669725,
"alnum_prop": 0.692591246560407,
"repo_name": "demitri/cornish",
"id": "2e6fd8e265a0d52eacbc2bfb8277083e066a76f2",
"size": "192... |
from django import forms
from django.conf import settings
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from django.utils.html import format_html
from fontawesome.utils import get_icon_choices
CHOICES = get_icon_choices()
class IconWidget(forms.Select):
def __init__(... | {
"content_hash": "05803768a74f087e662ff44eb4b00c9d",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 97,
"avg_line_length": 31.893617021276597,
"alnum_prop": 0.5970647098065377,
"repo_name": "scuerda/django-fontawesome",
"id": "55735fe8cf652c508cd44cec5fa85f2222cda98b",
"s... |
from __future__ import print_function
from __future__ import unicode_literals
import argparse, copy, json, sys
__all__ = ('loads', )
def isName(char):
return not ((char == ',') or
(char == '=') or
(char == '"') or
(char == '\'') or
(ch... | {
"content_hash": "8da1f307fbcbe4cbeae28e1922473a34",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 142,
"avg_line_length": 31.015418502202643,
"alnum_prop": 0.4848377245934238,
"repo_name": "gt3389b/python-cson",
"id": "8b5c23b8643d116720bbab91ff10ebf01d0a964f",
"size":... |
""" This module contains functions to determine where configuration and
data/cache files used by Astropy should be placed.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern import six
from ..utils.decorators import wraps
import os
import shu... | {
"content_hash": "d8f15a72771a439d8135846ec286743d",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 99,
"avg_line_length": 34.01273885350319,
"alnum_prop": 0.6113295880149813,
"repo_name": "AustereCuriosity/astropy",
"id": "dd0162150ac97cc418353b1ce77e5bf1a1d14a42",
"siz... |
answer();
say( "This is read using a text to speech engine.")
say( "But this is recorded audio from a URL... http://hosting.tropo.com/35946/www/audio/Hello.wav")
say( "Or you can just play the recorded audio URL...")
say( "http://hosting.tropo.com/35946/www/audio/Hello.wav" )
hangup()
| {
"content_hash": "784abc25a0b3bdb15c2e6d8d24c91127",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 99,
"avg_line_length": 26.454545454545453,
"alnum_prop": 0.697594501718213,
"repo_name": "rogervaas/tropo-samples",
"id": "18a23e0ef038e058bdfcaa19ebdc25991f015b06",
"size"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.