text stringlengths 4 1.02M | meta dict |
|---|---|
from tastypie.resources import ModelResource, ALL
from gopher.models import RequestAirtimeSend, AirtimeApplication
from tastypie import fields
from tastypie.authorization import Authorization
class AirtimeApplicationResource(ModelResource):
"""
To get the required app id
GET:
/api/v1/request/applicati... | {
"content_hash": "952047caff934234401ec6a4c98ba966",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 71,
"avg_line_length": 29.74468085106383,
"alnum_prop": 0.6022889842632332,
"repo_name": "westerncapelabs/django-grs-gatewaycms",
"id": "68b37957e8e8f0d16355269343e2ef03c9a03... |
from sklearn.utils.estimator_checks import check_estimator
from PLN import BasePLN, PLNR, PLNC
def test_estimator():
return check_estimator(PLNR)
def test_classifier():
return check_estimator(PLNC)
def test_base():
return check_estimator(BasePLN)
| {
"content_hash": "46edd9892af751139a12689f8e1272a1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 18.928571428571427,
"alnum_prop": 0.7471698113207547,
"repo_name": "rohitrawat/PLN_NumPy",
"id": "0a95339811cd95bd75c08ee55a9519c717e9466b",
"size": ... |
"""Support for ZHA covers."""
import asyncio
import functools
import logging
from typing import List, Optional
from zigpy.zcl.foundation import Status
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_POSITION,
DEVICE_CLASS_DAMPER,
DEVICE_CLASS_SHADE,
DOMAIN,
CoverEntity... | {
"content_hash": "3c6e8683eef9e943d6d7ed400ed8aeaf",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 87,
"avg_line_length": 33.770967741935486,
"alnum_prop": 0.6102779635113191,
"repo_name": "partofthething/home-assistant",
"id": "e202def46c5ab7e807a38eb994c92573b7321b6c",
... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['None'] , ['Lag1Trend'] , ['Seasonal_Second'] , ['SVR'] ); | {
"content_hash": "b6b62d79f0c2212a5447b661022d7168",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 80,
"avg_line_length": 38.25,
"alnum_prop": 0.6993464052287581,
"repo_name": "antoinecarme/pyaf",
"id": "f7979e7be5370388176c3ffcc176c7996ad9a85a",
"size": "153",
"binary"... |
import math
import numpy as np
from bitbots_msgs.action import Kick
from geometry_msgs.msg import Quaternion
from tf_transformations import quaternion_from_euler
from dynamic_stack_decider.abstract_action_element import AbstractActionElement
class AbstractKickAction(AbstractActionElement):
def pop(self):
... | {
"content_hash": "e7acd043eb9c677d3e24caf0aa96c2a2",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 132,
"avg_line_length": 45.134453781512605,
"alnum_prop": 0.5907652206293055,
"repo_name": "bit-bots/bitbots_behaviour",
"id": "7d7873eadcd32fb4cc84dbd18ab74ce1c8b900ce",
... |
def indentshell(context,allcontent):
'''
indentshell indents each line between <shell>...</shell> tags by 12 spaces
attention: this function only works if:
1. the shell tag is present once or not at all in allcontent
2. <shell> must not be at the first position
:param context:
:param... | {
"content_hash": "1cbf7a2a1306de2e1bfb5938be2f6d8c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 78,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.602803738317757,
"repo_name": "icclab/disco",
"id": "88e5f456424f5b77475b68e075b2073727e186e0",
"size": "1656",
... |
"""Script for registration against AzureAutomation agent service."""
import datetime as datetime
import hashlib
import base64
import json
import hmac
import socket
import argparse
import requests
import requests.packages.urllib3
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from OpenSSL impor... | {
"content_hash": "14db2292722be5722f2d1cc0843df0d0",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 117,
"avg_line_length": 43.343283582089555,
"alnum_prop": 0.6113980716253443,
"repo_name": "MSFTOSSMgmt/WPSDSCLinux",
"id": "76ebaf3a4903ed47507f54c43d907d58a1e66b0b",
"si... |
"""
Extend numpy's decorators to use nipy's gui and data labels.
"""
from numpy.testing.decorators import *
from nipy.utils import templates, example_data, DataError
def make_label_dec(label, ds=None):
"""Factory function to create a decorator that applies one or more labels.
Parameters
----------
... | {
"content_hash": "e0010079c60078ccae31d8d8bbc3315b",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 80,
"avg_line_length": 24.789473684210527,
"alnum_prop": 0.6245576786978061,
"repo_name": "bthirion/nipy",
"id": "f729adff411c08326f2854fc947ba36427d1bbb2",
"size": "2940"... |
from sahara import conductor
from sahara import context
from sahara.tests.unit import base
from sahara.utils import general as gu
SAMPLE_CLUSTER = {
'plugin_name': 'test_plugin',
'hadoop_version': 'test_version',
'tenant_id': 'tenant_1',
'name': 'test_cluster',
'user_keypair_id': 'my_keypair',
... | {
"content_hash": "53faed98d51c20641db5efc671ca3ef7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 75,
"avg_line_length": 29.980392156862745,
"alnum_prop": 0.5676913015042512,
"repo_name": "citrix-openstack-build/sahara",
"id": "43205e0ce9be0cbb99f1c8cd747f92c99a7588e0",
... |
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | {
"content_hash": "bb6de89c0e56acbb5ea69e3e872f3c83",
"timestamp": "",
"source": "github",
"line_count": 1082,
"max_line_length": 158,
"avg_line_length": 43.6460258780037,
"alnum_prop": 0.41511911064055057,
"repo_name": "thaim/ansible",
"id": "825ab88bb65b9ed4ba705baa91eee6cf869017b3",
"size": "4724... |
from __future__ import print_function, division
import argparse
from pprint import pprint
import myhdl
from myhdl import Signal, intbv, ConcatSignal, always_comb, concat
from rhea.system import Global, Clock, Reset
from rhea.cores.misc import io_stub
from rhea.cores.comm import prbs_generate
from rhea.cores.comm imp... | {
"content_hash": "0fc96ef8e92623015b967b6575d79863",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 74,
"avg_line_length": 28.34862385321101,
"alnum_prop": 0.6300970873786408,
"repo_name": "cfelton/rhea",
"id": "9e3c114050b4dd73e16f55753933e5b7cfd6bdd8",
"size": "3091",
... |
"""
This module is for bundled packages when we don't always want to use the bundled version.
"""
from __future__ import absolute_import
try:
import ktlxml
except ImportError as e:
from . import ktlxml
def get_gui():
"""Function to delay import of GUI"""
try:
import GUI
except ImportError ... | {
"content_hash": "98e112003c71157ea5031f4c5e0caf6a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 89,
"avg_line_length": 21.04,
"alnum_prop": 0.6577946768060836,
"repo_name": "alexrudy/Cauldron",
"id": "4a3acfffdfc21d5f5b716e560a08a09f43f1f271",
"size": "526",
"binary... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
import pytest
from tests.utils.dockerized import dockerized_case
from tests.image_builder.distributions.ubuntu import UbuntuBuilder
@pytest.mark.usefixtures("agent_environment")
@dockerized_case(
... | {
"content_hash": "7bc00e2341d91d8014bf4b224860fcf1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 66,
"avg_line_length": 24.434782608695652,
"alnum_prop": 0.7330960854092526,
"repo_name": "imron/scalyr-agent-2",
"id": "7d126ca05e5cac08cd31c14c34c76221da1c5303",
"size": ... |
from distutils.core import setup
from setuptools import find_packages
setup(
name='spock',
description='A pure python framework that implements the 1.8 Minecraft '
'protocol for building Minecraft clients',
license='MIT',
long_description=open('README.rst').read(),
version='0.1.2',... | {
"content_hash": "93f950c4c9303fd2fdf558de3576baee",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 76,
"avg_line_length": 28.19047619047619,
"alnum_prop": 0.6317567567567568,
"repo_name": "txomon/SpockBot",
"id": "d6c4ce465a502ab1fa931066e674bdc1750e39b4",
"size": "592",... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This module connects to the EMDN as a subscriber and writes all the changes in the MongoDB database.
"""
import logging
import os
import simplejson
import time
import traceback
import zlib
from pwd import getpwnam
import pymongo
import zmq
from daemon import runner
#Se... | {
"content_hash": "0a19043c12265aa309045448a0cef220",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 112,
"avg_line_length": 34.436440677966104,
"alnum_prop": 0.6052663959640704,
"repo_name": "Shtong/CmdrCompanion",
"id": "117240e733f72db971fc188eade4a2d635639720",
"size"... |
import os
from unittest.mock import patch
import matplotlib.pyplot as plt
import pytest
from astropy import units as u
from astropy.io import fits
from astropy.utils.data import get_pkg_data_filename
from astropy.visualization.wcsaxes.core import WCSAxes
from astropy.wcs import WCS
MSX_HEADER = fits.Header.fromtextf... | {
"content_hash": "2eb975cab8ed3e2f5a1ec2864302afc2",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 27.10924369747899,
"alnum_prop": 0.6636701797892126,
"repo_name": "lpsinger/astropy",
"id": "4a6933e5d3b2fe4955de43578f3688cc39cc9b8e",
"size": "329... |
"""Model for an Oppia exploration."""
import datetime
from constants import constants
import core.storage.base_model.gae_models as base_models
import core.storage.user.gae_models as user_models
import feconf
from google.appengine.ext import ndb
class ExplorationSnapshotMetadataModel(base_models.BaseSnapshotMetadat... | {
"content_hash": "fb133a7d81d7d338c720f8f328c3044b",
"timestamp": "",
"source": "github",
"line_count": 601,
"max_line_length": 102,
"avg_line_length": 42.818635607321134,
"alnum_prop": 0.6600217610942721,
"repo_name": "himanshu-dixit/oppia",
"id": "fc6904492f8c74bfaacecc708cc13e25be9adf5f",
"size"... |
import sys
import json
import socket
import board
import game_state
#
# Create and parse messages for passing to and from the server
#
# in_XXX: parses a message from the server
# out_XXX: creates a message to send to the server
#
name = "This is an albatrocity!"
def out_handshake():
return {'me' : name}
def i... | {
"content_hash": "c86aabcfa5527e5ce88bfbe3f324859d",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 82,
"avg_line_length": 25.01851851851852,
"alnum_prop": 0.5845053047125586,
"repo_name": "estansifer/icfpc2017",
"id": "61eba281000091f01b2a82ae139226cb8be2d85b",
"size": ... |
import zagoload
def download(source):
def info(ss):
import sys ;sys.stdout.write(ss + u'\n')
def onDownload(fileSize,downSize, downSpeed):
info( u'{0:3}% - {1:8}/{2}, {3:4.0f}kb/s'.format(int(100*downSize/fileSize), downSize, fileSize, downSpeed/1024))
ff = zagoload.load(source,onDownload=onDownload)
if... | {
"content_hash": "165ecaa73f148a57f032539290710f2c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 117,
"avg_line_length": 42,
"alnum_prop": 0.6726190476190477,
"repo_name": "napuzba/zagoload",
"id": "afb176df6f12587a768d893c26fad58592554500",
"size": "504",
"binary": ... |
'''
Created on Mar 16, 2011
@author: cgueret
'''
from Resources import Museum, Painting
if __name__ == '__main__':
#a = Museum('altesnational')
#print a.to_rdfxml()
b = Painting('altesnational/woman-at-a-window')
print b.to_rdfxml() | {
"content_hash": "16ca2ded790d775db64efaad4768b9b6",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 51,
"avg_line_length": 20.833333333333332,
"alnum_prop": 0.632,
"repo_name": "cgueret/GoogleArt-wrapper",
"id": "535dff94450db55d653f2a96215821cd92ba98fc",
"size": "250",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('SscData', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Host',
fields=[
('id', models.Auto... | {
"content_hash": "bd2265863817b5d6f89d09dcb846de2e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 28.966666666666665,
"alnum_prop": 0.5132336018411968,
"repo_name": "jakdor/SSCAndroidApp",
"id": "58bcf2569d9f50b7bcae8481bcd147da960aed6b",
"size":... |
"""Generate a PDF using the DocRaptor url style."""
from docraptor import DocRaptor
def main():
"""Generate a PDF with specified url."""
docraptor = DocRaptor()
print("Create test_basic_url.pdf")
with open("test_basic_url.pdf", "wb") as pdf_file:
pdf_file.write(
docraptor.create(
... | {
"content_hash": "22e857af1a2a6edaeab9469e991019f0",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 24.36842105263158,
"alnum_prop": 0.5637149028077754,
"repo_name": "jkeyes/python-docraptor",
"id": "a40765656659541fa8c4225d56bf3745ee6dff1b",
"size"... |
from setuptools import setup, find_packages
console_scripts = ['eth=pyethereum.eth:main',
'pyethtool=tools.pyethtool_cli:main']
setup(name="pyethereum",
version='0.0.1',
packages=find_packages("."),
install_requires=[
'six', 'leveldb', 'bitcoin', 'pysha3',
'min... | {
"content_hash": "f4282e9910cf37146ec59ec5568ac892",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 57,
"avg_line_length": 32.30769230769231,
"alnum_prop": 0.6047619047619047,
"repo_name": "ebuchman/daoist_protocol",
"id": "d94b7d908e3695f906e172e8829983e3f5184206",
"size... |
"""Tests common to all coder implementations."""
from __future__ import absolute_import
import logging
import math
import sys
import unittest
from builtins import range
import pytest
from apache_beam.coders import proto2_coder_test_messages_pb2 as test_message
from apache_beam.coders import coders
from apache_beam.i... | {
"content_hash": "e62f0841380ca337d032d8efe6f36942",
"timestamp": "",
"source": "github",
"line_count": 479,
"max_line_length": 80,
"avg_line_length": 37.46764091858038,
"alnum_prop": 0.6197136011589681,
"repo_name": "RyanSkraba/beam",
"id": "122cbfd2842b9449bd5430ee29f5f4f94ea17319",
"size": "1873... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import permute.data as data
from numpy.testing import assert_equal
def test_botulinum():
""" Test that "Botulinum" data can be loaded. """
botulinum = data.botulinum()
assert_equal((botulinum.size... | {
"content_hash": "f5ae8a752d405f0ee50ec8d38efa673c",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 73,
"avg_line_length": 26.773722627737225,
"alnum_prop": 0.6303162486368593,
"repo_name": "kellieotto/permute",
"id": "5a2abe2c343b2dfb19572415620b28fdc2ffd8ee",
"size": "... |
from django.test import TestCase
from django.core.management import call_command
from django.core.management.base import CommandError
from ..utils import writeParamsToJson
class TestManagementCommands(TestCase):
def test_print_map(self):
params = {
'bbox': [-2, -2, 2, 2], 'layout': 'test_lay... | {
"content_hash": "826b2bbc699ca08146803875c4e9e0ac",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 73,
"avg_line_length": 29.6875,
"alnum_prop": 0.5989473684210527,
"repo_name": "candela-it/sunlumo",
"id": "dbea98fb5dd5f6783b66739f00340973a604464e",
"size": "974",
"bin... |
import pytest
from tornado import web
from tornadose.handlers import EventSource, WebSocketSubscriber
@pytest.fixture
def app():
return web.Application()
def test_add_eventsource_handler(app, dummy_store):
app.add_handlers(".*$", [(r"/stream", EventSource, dict(store=dummy_store))])
def test_add_websocke... | {
"content_hash": "c150725a43bde20a0ac0d8ed9634999e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 24,
"alnum_prop": 0.7039473684210527,
"repo_name": "mivade/tornadose",
"id": "546e4bf479a7628fb0fc5916a7bce1d916917a47",
"size": "456",
"binary": f... |
'''
'''
import os
import re
import sys
import phpass
import MySQLdb
import argparse
def auth(username,password):
UserDict = GetWPuser()
try:
password_hash = UserDict[username][2]
except KeyError:
return None
if len(password_hash) <= 32:
return None
... | {
"content_hash": "ac3d64dc9897cf3c91ef82c0335e8a72",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 113,
"avg_line_length": 22.08695652173913,
"alnum_prop": 0.5232283464566929,
"repo_name": "interactiveinstitute/NoderedWordpressAuth",
"id": "525b25fa6fc85a405613f878438858c... |
from .fetchers import NUDeploymentFailuresFetcher
from .fetchers import NUPermissionsFetcher
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUBGPNeighbor(NURESTObject):
""" Represents a BGPNeighbor in the VSD
Notes:
... | {
"content_hash": "d71dd31b391825705ee453548ee10365",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 296,
"avg_line_length": 30.147169811320754,
"alnum_prop": 0.5724120665915634,
"repo_name": "nuagenetworks/vspk-python",
"id": "c8bcd1e52ab5c10cce69332fabdd37ce8485aa90",
"... |
import os
import re
from . import product
from .. import shell
from .. import targets
def get_os_spelling(os):
return {
'macosx': 'macOS',
'iphonesimulator': 'iOS',
'appletvsimulator': 'tvOS',
}[os]
class PlaygroundSupport(product.Product):
@classmethod
def product_source_na... | {
"content_hash": "d7e82074e796de43f807efb5442925ea",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 38.55,
"alnum_prop": 0.5546044098573282,
"repo_name": "aschwaighofer/swift",
"id": "81d53d841664b2b8e928a19e8509f2404e91f91b",
"size": "4362",
"bi... |
"""This module contains various utility functions regarding unit conversion and
solc integration."""
import binascii
import json
import sys
import os
from pathlib import Path
from subprocess import PIPE, Popen
from ethereum.abi import encode_abi, encode_int, method_id
from ethereum.utils import zpad
from mythril.exce... | {
"content_hash": "6c86a8f1a28f759cc7c330679975ab33",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 117,
"avg_line_length": 24.555555555555557,
"alnum_prop": 0.5523190045248869,
"repo_name": "b-mueller/mythril",
"id": "0ec4e645262e4a3741bc9129040d04025f265928",
"size": "... |
r"""
speaklater
~~~~~~~~~~
A module that provides lazy strings for translations. Basically you
get an object that appears to be a string but changes the value every
time the value is evaluated based on a callable you provide.
For example you can have a global `lazy_gettext` function that retu... | {
"content_hash": "753c7a938a6e4ab93bf08151fdfe6159",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 78,
"avg_line_length": 25.985148514851485,
"alnum_prop": 0.5999237950085731,
"repo_name": "quokkaproject/speaklater",
"id": "249359e3127232ca1f3175e72d3455c9197ff148",
"si... |
import numpy as np
import scipy.sparse as sp
import cvxpy.interface as intf
import cvxpy.settings as s
from cvxpy.error import SolverError
from cvxpy.reductions.solution import Solution, failure_solution
from cvxpy.reductions.solvers.qp_solvers.qp_solver import QpSolver
class OSQP(QpSolver):
"""QP interface for ... | {
"content_hash": "d1f1309ee735c84e6eb7310808ceeb3e",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 83,
"avg_line_length": 38.38181818181818,
"alnum_prop": 0.5378967314069162,
"repo_name": "merraksh/cvxpy",
"id": "cdbcb5b759d3ff294b0f87596a2d3d81e9efe99a",
"size": "4222"... |
#!/usr/bin/env impala-python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (... | {
"content_hash": "38762bcdf4f3c62758d0dd9323210c3b",
"timestamp": "",
"source": "github",
"line_count": 2423,
"max_line_length": 90,
"avg_line_length": 44.59141560049525,
"alnum_prop": 0.6645564348188255,
"repo_name": "cloudera/Impala",
"id": "b400650973a2e479835e02c8b0c24cc201c1fb80",
"size": "108... |
import FWCore.ParameterSet.Config as cms
process = cms.Process("ANA")
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
process.load("Configuration.StandardSequences.Services_cff")
process.load("GeneratorInterface.HydjetInterface.hydjetDefault_cfi")
process.maxEvents = cms.untracked.PSet(input = cms.untracked.... | {
"content_hash": "79101381754efdc837043eb6a8fe729d",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 89,
"avg_line_length": 35.375,
"alnum_prop": 0.6127208480565371,
"repo_name": "tuos/FlowAndCorrelations",
"id": "54a23fe2abf8338a6192ca2ee9111bb9624d719d",
"size": "1415",
... |
from compiler.ast import flatten
from transformers import camxes_morphology
from structures.gensuha import BuLetteral, ZeiLujvo, Tosmabru, Slinkuhi
class Transformer(object):
def transform(self, parsed):
return Visitor().visit(parsed)
def default_serializer(self):
return lambda x: x.as_json(... | {
"content_hash": "7cecf9c2161dad3b2258e4b2450e3adf",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 29.9,
"alnum_prop": 0.7224080267558528,
"repo_name": "teleological/camxes-py",
"id": "7156532135acafdff5bd05b580b83560d961b957",
"size": "960",
"bi... |
r"""Code to clone the github repository, download the checkpoint and generate the frozen graph.
The frozen VGGish checkpoint will be saved to `/tmp/mediapipe/vggish_new.pb`.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
from abs... | {
"content_hash": "d804d1bc414153955a98ab4b4fa60ae5",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 95,
"avg_line_length": 27.403508771929825,
"alnum_prop": 0.6901408450704225,
"repo_name": "google/mediapipe",
"id": "786e2a6e7894ed6c81c6feb441c78fc22b532405",
"size": "214... |
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
# MNIST data를 불러오고, one-hot encoding을 합니다.
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("./mnist/data/", one_hot=True)
# Parameter setting
total_epoch = 30
batch_size =100
learning_rate = 0.0002
... | {
"content_hash": "2c414eec7daa60396be3d69fe04af10c",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 88,
"avg_line_length": 29.10377358490566,
"alnum_prop": 0.6722852512155592,
"repo_name": "Wonjuseo/Project101",
"id": "4bdcfd49bd6e063aa391584887265180018ef82e",
"size": "... |
from main import utils
from main import utils_coordinates
# This file is part of https://github.com/cpina/science-cruise-data-management
#
# This project was programmed in a hurry without any prior Django experience,
# while circumnavigating the Antarctic on the ACE expedition, without proper
# Internet access, with 1... | {
"content_hash": "80a35d9500c4a316f350ef6cf88c6a63",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 200,
"avg_line_length": 55.895161290322584,
"alnum_prop": 0.6696003462703795,
"repo_name": "cpina/science-cruise-data-management",
"id": "c7b26a020e4f1c113154ecbca9620ae4131... |
"""
Mapping intervals between pairs of congruent segments
The IntervalMapper class is at the heart of mapping between aligned sequences. An instance
of :class:`uta.tools.intervalmapper.IntervalMapper` is constructed with an ordered list of
:class:`uta.tools.intervalmapper.IntervalPair` instances, each of which consis... | {
"content_hash": "eaea60c9488f9324be3f843a48f5190c",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 118,
"avg_line_length": 39.83111111111111,
"alnum_prop": 0.6226288774827048,
"repo_name": "biocommons/hgvs",
"id": "240e91c7f6cfd3bc7fb2687ab5666c00b4399317",
"size": "898... |
from .dates import *
from .structs import *
from .logging import *
from .stopwatch import *
from .growl import *
from .text import *
from .shell import *
from .network import *
from .reflection import Reflector
from fuze.utilities.clipboard import Clipboard | {
"content_hash": "8438e56a001da4aece74881046400984",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 46,
"avg_line_length": 25.7,
"alnum_prop": 0.77431906614786,
"repo_name": "MagicWishMonkey/fuze",
"id": "e1fd0f67d86f518d2a2b0aa46a457924d2a4fd59",
"size": "257",
"binary... |
from berth.job.models import Job
from berth.job import constants
from berth.utils.test import TestCase
class TestJobNumbers(TestCase):
def test_job_number_increments(self):
project = self.project
job1 = Job.objects.create(
project=self.project,
state=constants.BUILD_STATUS_... | {
"content_hash": "6eb26dd9747943d7e586607252bfc499",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 56,
"avg_line_length": 29.022727272727273,
"alnum_prop": 0.586530931871574,
"repo_name": "joealcorn/berth.cc",
"id": "1dfdb786b53c0eda4d680917e90be8dbd937cefc",
"size": "12... |
def remove_adjacent(nums):
uniq = []
for num in nums:
if num not in uniq:
uniq.append(num)
return uniq
# +++your code here+++
##return
# E. Given two lists sorted in increasing order, create and return a merged
# list of all the elements in sorted order. You may modify the passed i... | {
"content_hash": "00127803a9a8f99445959ec8dc184d3f",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 31.305084745762713,
"alnum_prop": 0.6253383865728208,
"repo_name": "apcrumbleton/google-python-exercises",
"id": "330ae06d16e393c43ba2511576273f66cfc94... |
import sys
import os
import shlex
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.p... | {
"content_hash": "baacdad428d7ba2d18dcc62edb8caae9",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 80,
"avg_line_length": 31.245283018867923,
"alnum_prop": 0.6970324361628709,
"repo_name": "montefra/dodocs",
"id": "7e1368588d106ef1d9e1b2c945e6b67dfb04ca92",
"size": "120... |
"""Gradient Boosted Regression Trees
This module contains methods for fitting gradient boosted regression trees for
both classification and regression.
The module structure is the following:
- The ``BaseGradientBoosting`` base class implements a common ``fit`` method
for all the estimators in the module. Regressio... | {
"content_hash": "083bdd75b25ddae8c4fff8d4ffaccfd1",
"timestamp": "",
"source": "github",
"line_count": 1824,
"max_line_length": 91,
"avg_line_length": 38.422697368421055,
"alnum_prop": 0.5829944494385229,
"repo_name": "ryfeus/lambda-packs",
"id": "ff324e286fa73b06aabb47140451c9e62acc0410",
"size":... |
from beritest_tools import BaseBERITestCase
from nose.plugins.attrib import attr
class test_raw_fpu_cvt_paired(BaseBERITestCase):
@attr('floatpaired')
def test_convert_ps_to_s(self):
'''Test we can convert paired single to single'''
self.assertRegisterEqual(self.MIPS.a0, 0x33333333, "Didn't ex... | {
"content_hash": "1d6e0d7a2df2e4662cac70e30fbe4aa0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 90,
"avg_line_length": 43.3,
"alnum_prop": 0.7297921478060047,
"repo_name": "8l/beri",
"id": "aabee0dfd2e6d9cf8743c9ec69f36a891835f21f",
"size": "1752",
"binary": false,
... |
print 'I could have code like this.' # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print ("This won't run")
print 'This will run.'
| {
"content_hash": "b0f5060f5704ce11cd2e3db4fa8c005b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 29.428571428571427,
"alnum_prop": 0.6796116504854369,
"repo_name": "Herne/pythonplayground",
"id": "d578160a63f2920d8dc09e96b9b25fad4d1a57f3",
"size":... |
from ..structure import *
from ..utils import *
class GibbsAll(MCMC):
def __init__(self, problem, verbose_int = 100, N = 1000, T = 10000, record_start = 3000):
MCMC.__init__(self, problem, "Gibbs (All)", verbose_int, N, T, record_start)
def particle_to_tuple(self, p):
return p
def init_pa... | {
"content_hash": "0ee148d8957dd8e08028eea6b6c56d61",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 96,
"avg_line_length": 34.05263157894737,
"alnum_prop": 0.624420401854714,
"repo_name": "SsnL/amcmc",
"id": "a8fe2cb901963a709e25a297771b0c0fc58b93a8",
"size": "647",
"bi... |
import os
import re
import sys
import unittest
from importlib import import_module
import settings
from base import Schema
from parser import PlSqlParser
from dbgate import OraConnection
sys.path.append(settings.PLSQL_SCHEMA_ROOT)
TEST_PACKAGE = 'plsqlparsertestpackage'
class TestParser(unittest.TestCase):
"""
... | {
"content_hash": "8a346266078d6179387c65a39b96028e",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 92,
"avg_line_length": 32.54010695187166,
"alnum_prop": 0.637633525061627,
"repo_name": "mshogin/django-plsql",
"id": "cad9cfbd0c15ca726ac4d826c18a9b3595902338",
"size": "... |
""" Cisco_IOS_XR_subscriber_ipsub_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR subscriber\-ipsub package operational data.
This module contains definitions
for the following management objects\:
ip\-subscriber\: IP subscriber operational data
Copyright (c) 2013\-2016 by Cisco Syste... | {
"content_hash": "929c5ad2306a9e95de4609dece197d8a",
"timestamp": "",
"source": "github",
"line_count": 3311,
"max_line_length": 301,
"avg_line_length": 42.614919963757174,
"alnum_prop": 0.38632723355398374,
"repo_name": "111pontes/ydk-py",
"id": "efa0f8c8824e3373fa8cbb148f37b80151182f15",
"size": ... |
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 0.3, s, t 0.5, s, t 1, s, q"
tags = "Ripple3D"
import pyglet
from pyglet.gl import glColor4ub, glPushMatrix, glPopMatrix
import summa
from summa.director import director
from summa.actions import *
class Backg... | {
"content_hash": "c2e581b385747a039f7ec95bd85df4e8",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 66,
"avg_line_length": 24.09090909090909,
"alnum_prop": 0.6254716981132076,
"repo_name": "shackra/thomas-aquinas",
"id": "a1662e5c1fb1e1239924f9c989c807b3df6ac377",
"size":... |
import json
class BaseProcessor(object):
"""
Base class for processing lists of scraped Items and inserting them into the database
Subclasses should implement a process method
"""
def __init__(self, items_file_path, job=None):
self.items_file_path = items_file_path
self.job = job ... | {
"content_hash": "3abc96f07676892bb0fc73e69b2b8bd7",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 89,
"avg_line_length": 23.852941176470587,
"alnum_prop": 0.5955610357583231,
"repo_name": "legco-watch/legco-watch",
"id": "12bd6ec3c5b2886de6ada753822cd53ea10f7d22",
"size... |
"""
=====================================
Create a minimalistic user interface
=====================================
DIPY allows to create a minimalistic interface using widgets.
In this example we will create: a) two parallel steamtubes, b) add some buttons
which will change the opacity of these tubes and c) move th... | {
"content_hash": "899dd6e453a0a1bbca7bbbf7365e51c1",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 79,
"avg_line_length": 26.920289855072465,
"alnum_prop": 0.5800807537012113,
"repo_name": "StongeEtienne/dipy",
"id": "54459ea441366b3b229f4e3c4d9407a3bd126dd7",
"size": "... |
import logging
import pymongo
from bson import ObjectId
from bson.errors import InvalidId
from flask import flash
from flask.ext.admin._compat import string_types
from flask.ext.admin.babel import gettext, ngettext, lazy_gettext
from flask.ext.admin.model import BaseModelView
from flask.ext.admin.actions import acti... | {
"content_hash": "a78785a0e9b49a9128d0879b06b9d205",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 102,
"avg_line_length": 28.21727019498607,
"alnum_prop": 0.5045409674234945,
"repo_name": "pawl/flask-admin",
"id": "c21e9e8983d3915b58f68ae5284b9bed163c75d9",
"size": "10... |
from setuptools import setup, Command
import sys
sys.path.insert(0, '.')
import injector
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
errno = subprocess.call([sys.executa... | {
"content_hash": "e5cb6e02382dc14bc821d034b5e65708",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 79,
"avg_line_length": 25.178571428571427,
"alnum_prop": 0.6567375886524822,
"repo_name": "rutsky/injector",
"id": "08cc59c97a9f517929a242155d9ff9b2df76d58e",
"size": "1410... |
"""Tests for classifier services"""
import os
from core.domain import classifier_registry
from core.domain import classifier_services
from core.domain import exp_services
from core.tests import test_utils
import feconf
import utils
class ClassifierServicesTests(test_utils.GenericTestBase):
"""Test reader.classif... | {
"content_hash": "369a5d5174594e6b477f3cd997141f14",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 40.95774647887324,
"alnum_prop": 0.6468363136176066,
"repo_name": "jestapinski/oppia",
"id": "dbf79d8a4a8998edd65dca990b597b26dcbb5672",
"size": "351... |
"""
Tests for django.utils.
"""
from __future__ import absolute_import
from .archive import TestBzip2Tar, TestGzipTar, TestTar, TestZip
from .baseconv import TestBaseConv
from .checksums import TestUtilsChecksums
from .crypto import TestUtilsCryptoMisc, TestUtilsCryptoPBKDF2
from .datastructures import (DictWrapperTes... | {
"content_hash": "4aced7e9d708ce34e0bca48d6e3c9593",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 77,
"avg_line_length": 40.75757575757576,
"alnum_prop": 0.8535315985130112,
"repo_name": "mammique/django",
"id": "726df3d979c3d28af899e1aa9cdc3780f40ca338",
"size": "1345"... |
class PeptideRecord:
def __init__(self, peptide, matches=[]):
self.peptide = peptide
self.peptide_parameters = None
self.matches = matches
def __str__(self):
if len(self.matches) != 0:
return received_peptide_record_to_string(self)
return missed_peptide_recor... | {
"content_hash": "c62629d48d644f4a25eefb7f1beb9e67",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 93,
"avg_line_length": 31.4,
"alnum_prop": 0.6133757961783439,
"repo_name": "zedrian/shkoma",
"id": "14674b1915c26475b3b0bde037617f05bb1e3049",
"size": "1570",
"binary": ... |
"""Kodi service that is injected into the omnilauncher client"""
import xbmcgui
import xbmcplugin
from resources.lib.log import getLogger
log = getLogger(__name__)
class KodiService(object):
def __init__(self, handle):
log.info("KodiService handle %d", handle)
self.handle = handle
def getS... | {
"content_hash": "5e2fff945726907539435fa127210253",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 32.34285714285714,
"alnum_prop": 0.6528268551236749,
"repo_name": "lpenz/script.omnilauncher",
"id": "efe47fd9ffb1365450623ac49360461ac4af9334",
"siz... |
class Buffer(object):
def __init__(self):
self.dict = dict()
self._lastTime = 0
def add (self, timestamp, Message):
if timestamp not in self.dict:
self.dict[timestamp] = []
self.dict[timestamp].append(Message)
return
def list(self, timestamp):
x = self.dict[timestamp]
del(self.dict[timestamp])
... | {
"content_hash": "0132e12198a20cf793ef8e591b432f7f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 48,
"avg_line_length": 20.25,
"alnum_prop": 0.6388888888888888,
"repo_name": "allanedgard/pdss",
"id": "19a6c59a956ea5d5af193ed60975556380c2fe11",
"size": "648",
"binary"... |
"""
A context manager for handling sys.displayhook.
Authors:
* Robert Kern
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the fi... | {
"content_hash": "fd46f912327e64e0d61d329ec700fd62",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 78,
"avg_line_length": 30.28985507246377,
"alnum_prop": 0.4904306220095694,
"repo_name": "mattvonrocketstein/smash",
"id": "37fc847103c71cb3c4b7014e93e02bf86a666b90",
"size... |
from base import base_view
from teacher import teacher_view
from student import student_view
from subject import subject_view
from homework import homework_view
from schedule import schedule_view | {
"content_hash": "afc61b2fa1e7e28571ff6b20f663fa6f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 34,
"avg_line_length": 32.5,
"alnum_prop": 0.8512820512820513,
"repo_name": "hsw5138/bis",
"id": "55664b5a6a169daac8c42b30a53790de31bba2c8",
"size": "195",
"binary": false... |
class DatahubException(Exception):
"""
There was an base exception class that occurred while handling your request to tordatahub server.
"""
def __init__(self, status_code, request_id, error_code, error_msg):
super(DatahubException, self).__init__(error_msg)
self.status_code = status_cod... | {
"content_hash": "c6d3e4c52b9d2b1396597b0b7156b8e4",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 108,
"avg_line_length": 42.292307692307695,
"alnum_prop": 0.6831575118224809,
"repo_name": "jasonz93/python-tordatahub",
"id": "d37803cddc936cc3cf1b2740b67f2b9d29a7425c",
"... |
"""Generate YouTube variants."""
from __future__ import print_function, absolute_import
from collections import namedtuple
import json
import re
from bs4 import BeautifulSoup as BS
from common import (
datapath, log,
mkdata, mkvariant, sanitise_ws,
)
cachepath = datapath('YouTube.html')
SEARCH_URL = ('htt... | {
"content_hash": "18133f95e2bd77b8e5e93a53c0381ed5",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 67,
"avg_line_length": 24.475,
"alnum_prop": 0.5633299284984679,
"repo_name": "deanishe/alfred-searchio",
"id": "1d71fca10d4e96a3cce13d309054456c8c23b04b",
"size": "2139",
... |
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.utils.datetime_safe
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Carro',
... | {
"content_hash": "2a2a0b628b9ba0f60a4103395401f12d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 114,
"avg_line_length": 32.25925925925926,
"alnum_prop": 0.6096440872560276,
"repo_name": "jhonatanlteodoro/CrudDjango",
"id": "cb0de1e1e54a30a42c5fa30f3d660c3496023ced",
"... |
from settings import *
import os
import sys
BASE_PATH = os.path.dirname(__file__)
DEBUG = False
TEMPLATE_DEBUG = False # on production this should be disabeled
SERVER_EMAIL = '[email protected]'
DEFAULT_FROM_EMAIL = '[email protected]'
ADMINS = (
('ReindeR Rustema', '[email protected]'),
... | {
"content_hash": "245e7f5a6b82e0d60116c1755c2b4b51",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 88,
"avg_line_length": 31.614285714285714,
"alnum_prop": 0.7049254405784003,
"repo_name": "spreeker/democracygame",
"id": "85963c7319f4e6aed92c483a4a4bf743363e7dbd",
"size"... |
"""Format and output columns of data."""
__all__ = [
'Columnar',
'Formats',
]
import csv
import enum
import logging
from g1.bases.assertions import ASSERT
logging.getLogger(__name__).addHandler(logging.NullHandler())
class Formats(enum.Enum):
CSV = enum.auto()
TEXT = enum.auto()
class Columnar:
... | {
"content_hash": "98c7419af27c1c55c49d7351c7caed99",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 74,
"avg_line_length": 28.063291139240505,
"alnum_prop": 0.5570590888588183,
"repo_name": "clchiou/garage",
"id": "a9b86fbf7ee1917e48276d59579ad75aabc0ec23",
"size": "2217"... |
import argparse
import logging
import utils
class CtxWithLogger(object):
logger = logging.getLogger('internal-ssl-certs-logger')
utils.ctx = CtxWithLogger()
parser = argparse.ArgumentParser()
parser.add_argument('--metadata', default=utils.CERT_METADATA_FILE_PATH,
help='File containing the... | {
"content_hash": "ca224752a753b6ffea8c08e42a65070e",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 38.096774193548384,
"alnum_prop": 0.6545300592718035,
"repo_name": "cloudify-cosmo/cloudify-manager-blueprints",
"id": "60b7fa2bd52d1b274ad615a1037ba5c... |
from lxml import html
import requests
import re
def scrape(url):
page = requests.get(url)
tree = html.fromstring(page.text)
div = tree.xpath('/html/body/div[3]/div/div[2]/div[6]/text()')
lyrics = ''.join([re.sub('[,""()\[\]]', '', x).rstrip() for x in div])
lyrics = 'BEGIN NOW ' + lyrics.replace('\... | {
"content_hash": "f40d01987b34df6e3af779ebd4e66cab",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 74,
"avg_line_length": 32.36363636363637,
"alnum_prop": 0.5870786516853933,
"repo_name": "Sieniawsky/based-markov",
"id": "ee6db20a48f6d4a3d89349ec247b19d2685c7816",
"size"... |
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import Site
from django.utils.encoding import python_2_unicode_compatible
from django.db.models import Model
from cms.models import CMSPlugin
from adminsortable.models ... | {
"content_hash": "09a3ca0fd669c612211d8dc1923eee6a",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 119,
"avg_line_length": 36.828947368421055,
"alnum_prop": 0.6170060735977134,
"repo_name": "arteria/cmsplugin-contact-plus",
"id": "3cc960a4cc249f2f59c390b43188615b8e0fa7d2"... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('editor', '0048_themeaccess'),
]
operations = [
migrations.AlterField(
model_name='projectaccess',
name='project',
field=... | {
"content_hash": "1bf3d17bde788f8a89267d100d92c550",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 132,
"avg_line_length": 26.58823529411765,
"alnum_prop": 0.6371681415929203,
"repo_name": "numbas/editor",
"id": "3065f696eba7e1bd2ae474e5fafaf822c5434a5e",
"size": "499",
... |
import datetime
import errno
import fnmatch
import functools
import os
import re
import subprocess
import sys
import threading
import time
import hashlib
class cached_property(object):
def __init__(self, func):
functools.update_wrapper(self, func)
self.func = func
def __get__(self, i... | {
"content_hash": "1d8c5d16eed8f43cc3f2852d8cc40212",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 93,
"avg_line_length": 31.14,
"alnum_prop": 0.5427103403982017,
"repo_name": "westernx/vee",
"id": "f264441f046cc5822ebd9103a193e4aa74468509",
"size": "4689",
"binary": ... |
from metrics_reporter import MetricsReporter
__version__ = '1.0.0'
| {
"content_hash": "c4027f423a6449d40b2bf749ce21cf79",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.7352941176470589,
"repo_name": "smartcat-labs/smartcat-os-metrics",
"id": "7cfe657722cbeea127c0ecdf379f633a1c03857c"... |
'''
COPYRIGHT and LICENSE:
---------------------
The MIT License (MIT)
Copyright (C) 2016 Sundar Nagarajan
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without li... | {
"content_hash": "be5e582b579115f122c942c35433e26f",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 80,
"avg_line_length": 38.125290023201856,
"alnum_prop": 0.6189143135345667,
"repo_name": "sundarnagarajan/py23compat",
"id": "d73cf359914b7c24f2b6a3ec9827bb76b4160e0b",
"... |
"""Support for Velbus devices."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_PORT
from homeassistant.helpers.discovery import load_platform
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['... | {
"content_hash": "f8c54d483e6d311262206db4d4ae7bc1",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 69,
"avg_line_length": 29.563106796116504,
"alnum_prop": 0.5855500821018063,
"repo_name": "HydrelioxGitHub/home-assistant",
"id": "38d8b6c3f1cc52d1bf4e68c19cab193f8019adab",... |
import re
import sys
from .base import BaseMatcher
from .path import PathMatcher
from .query import QueryMatcher
from ..regex import isregex
if sys.version_info < (3,): # Python 2
from urlparse import urlparse
else: # Python 3
from urllib.parse import urlparse
# URI protocol test... | {
"content_hash": "86ce588b859dacb6e23f058f9f1a48c0",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 71,
"avg_line_length": 26.64,
"alnum_prop": 0.5790790790790791,
"repo_name": "h2non/pook",
"id": "8939a55eb176bd844d734cbf4f5fe90b648363f2",
"size": "1998",
"binary": fal... |
"""Interfaces for launching and remotely controlling Web browsers."""
# Maintained by Georg Brandl.
import os
import shlex
import sys
import stat
import subprocess
import time
__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
class Error(Exception):
pass
_browsers = {} # Dictio... | {
"content_hash": "6ed3357d8417feee07f20a68e750d97c",
"timestamp": "",
"source": "github",
"line_count": 705,
"max_line_length": 98,
"avg_line_length": 32.40709219858156,
"alnum_prop": 0.5643191666301921,
"repo_name": "cthlo/exoduscli",
"id": "1be332e5a87fd7d5ef0b9b43f3d1104c38084b74",
"size": "2287... |
"""Manage evidence codes as reported by the Gene Ontology Consortium."""
__copyright__ = "Copyright (C) 2016-2019, DV Klopfenstein, H Tang. All rights reserved."
__author__ = "DV Klopfenstein"
import sys
import collections as cx
# pylint: disable=line-too-long
class EvidenceCodes(object):
"""From http://geneont... | {
"content_hash": "fff76345d237ac0453ae911ad5752276",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 147,
"avg_line_length": 49.447513812154696,
"alnum_prop": 0.6244692737430168,
"repo_name": "tanghaibao/goatools",
"id": "cc49d50318d93f518b767023d1347bcc412310a5",
"size":... |
import subprocess
import socket
import ssl
import sys
import time
if sys.version < '2.7':
print("WARNING: SSL not supported on Python 2.6")
exit(0)
if ssl.OPENSSL_VERSION_NUMBER < 0x10000000:
print("WARNING: TLS-PSK not supported on OpenSSL < 1.0")
exit(0)
import inspect, os, sys
# From http://stack... | {
"content_hash": "0e8beb415af56c293bb8888b29cab986",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 129,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.641566265060241,
"repo_name": "zhkzyth/better-mosquitto",
"id": "8d839e2f95ccd411582bc873ff5d928ce6704703",
"siz... |
import re
from random import randrange
from model.contact import Contact
def test_contact_data_on_home_page(app):
check_contact_list_is_not_empty(app)
contacts_list = app.contact.get_contact_list()
index = randrange(len(contacts_list))
contact_from_home_page = contacts_list[index]
contact_from_edit... | {
"content_hash": "221589c900a5bb5eda698b79f3da69e2",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 128,
"avg_line_length": 57.5,
"alnum_prop": 0.6514492753623189,
"repo_name": "tzvezda/python_training",
"id": "ec6a295429abfcbeec99bf69b28aad466654fb8f",
"size": "2760",
... |
"""
CLI interface for nova management.
"""
from __future__ import print_function
import argparse
import functools
import re
import sys
import traceback
from dateutil import parser as dateutil_parser
import decorator
from keystoneauth1 import exceptions as ks_exc
import netaddr
from oslo_config import cfg
from oslo... | {
"content_hash": "66b01c1aff5e481757307731c66e8041",
"timestamp": "",
"source": "github",
"line_count": 2341,
"max_line_length": 79,
"avg_line_length": 45.58393848782571,
"alnum_prop": 0.5767298897968364,
"repo_name": "gooddata/openstack-nova",
"id": "dc87e3f7ee115d02f7869c9294a2a8b466091f2d",
"siz... |
import os
from django.conf import settings
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.template import Context, Template
from django.test import TestCase
from .models import OriginalImage, ResizedImage
from .utils import get_sized_image, get_sized_i... | {
"content_hash": "d646d3f5255b641579a840598b45feb3",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 124,
"avg_line_length": 38.95406360424028,
"alnum_prop": 0.5737481857764877,
"repo_name": "ConvectiveSoftware/django-responsive-images",
"id": "77aba5f1b8ca4b375056c0bc6822a... |
from functools import lru_cache, wraps
from os.path import isfile, join as join_paths
from pickle import dumps as pickle_dumps, loads as pickle_loads
from ines import DEFAULT_RETRY_ERRNO, lazy_import_module, MARKER, NEW_LINE_AS_BYTES, NOW_TIME
from ines.cleaner import clean_string
from ines.convert import make_sha256,... | {
"content_hash": "2135d15acb90c2efa7dfc236054cde2c",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 118,
"avg_line_length": 33.648910411622275,
"alnum_prop": 0.57832625746564,
"repo_name": "hugobranquinho/ines",
"id": "130c4a2701d373d802834da4494664c8cb65c2c7",
"size": "... |
import sys
import requests
import json
import re
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
def get_wapiurl(niosip, niosuser, niospw):
# Determine the WAPI version and get the WAPI URL
docurl = 'https://%s/wapidoc/' % niosip
r = requests.get(docur... | {
"content_hash": "9378ab60989e207834aef1827199e50d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 96,
"avg_line_length": 36.05357142857143,
"alnum_prop": 0.7102526002971769,
"repo_name": "brampling/infoblox-gcp-poc",
"id": "9c76ce2877687516845f7cd180ea9279d09d345a",
"si... |
"""Contains very basic functions
"""
import os
import shutil
import numpy as np
from pyproj import CRS, Transformer
def get_result_paths(folder_path):
"""Joins results subfolders to ``folder_path`` and returns a dict
Arguments
---------
folder_path : str
Path of scenario run results
Retur... | {
"content_hash": "624912362d2a2d3b7a9fd3ce1b9111b8",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 97,
"avg_line_length": 24.484615384615385,
"alnum_prop": 0.578594617237407,
"repo_name": "nismod/energy_demand",
"id": "fafe13cdd0a1b4f5ab0b5ac73e21cb537ebf58c2",
"size": ... |
import unittest
from os.path import join
from unittest import TestCase
from devilry.utils.importutils import get_staticdir_from_appname
@unittest.skip('Is this in use? If so TestImportUtils should be fixed.')
class TestImportUtils(TestCase):
def test_get_staticdir_from_appname(self):
staticdir = get_stat... | {
"content_hash": "9bc9d2a6a2f8d408247b74b88910f120",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 88,
"avg_line_length": 45.4,
"alnum_prop": 0.6093979441997063,
"repo_name": "devilry/devilry-django",
"id": "2fad5f083970176a95054d43b9f53598ab6aa0df",
"size": "681",
"bi... |
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API documentation... | {
"content_hash": "154bd2b77ff2b95c9c0432a34599f942",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 409,
"avg_line_length": 34.81578947368421,
"alnum_prop": 0.7301587301587301,
"repo_name": "wavefrontHQ/python-client",
"id": "3c00d3aecccddce5db69db0546f17d8e7e819cb6",
"si... |
from pennyblack.models import Newsletter
from pennyblack.content.richtext import TextOnlyNewsletterContent, \
TextWithImageNewsletterContent
Newsletter.register_templates({
'key': 'base',
'title': 'Generic Newsletter',
'path': 'pennyblack/base_newsletter.html',
'regions': (
('main', 'Main R... | {
"content_hash": "1677837e09a1c3ed435f319cfad645b3",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 31.266666666666666,
"alnum_prop": 0.7334754797441365,
"repo_name": "nickburlett/pennyblack",
"id": "da062e0f04ac48c080d560ae1dd693cd088efe20",
"size"... |
""" Dataframe optimizations """
from __future__ import absolute_import, division, print_function
from .io import dataframe_from_ctable
from ..optimize import cull, fuse_getitem, fuse_selections
from .. import core
def fuse_castra_index(dsk):
from castra import Castra
def merge(a, b):
return (Castra.... | {
"content_hash": "9481b4189968c5599f09ab86efcce40f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 72,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.657608695652174,
"repo_name": "jeffery-do/Vizdoombot",
"id": "24980def973ddd0f6d493e34e3e708342210a0e9",
"size": ... |
import os
import glob
import sys
import platform
import subprocess
import difflib
import filecmp
from optparse import OptionParser
#
# Get standard testsuite test arguments: srcdir exepath
#
srcdir = "."
tmpdir = "."
path = "../.."
# Options for the command line
parser = OptionParser()
parser.add_option("-p", "--p... | {
"content_hash": "c4ddab543f52d2212fa6428ccce9b4b4",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 104,
"avg_line_length": 35.910071942446045,
"alnum_prop": 0.5721726935790844,
"repo_name": "scott-wilson/oiio",
"id": "501ac76d3d222b6b1d55247d22023d96693d0e3f",
"size": "... |
from myhvac_web.myhvac_service import factory
import logging
LOG = logging.getLogger(__name__)
def get_system_state():
service = factory.get_service_module()
return service.get_system_state() | {
"content_hash": "4231bfc8c1488e9a235a01483df88ba4",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 45,
"avg_line_length": 18.545454545454547,
"alnum_prop": 0.7303921568627451,
"repo_name": "alanquillin/myhvac_web",
"id": "288593f0aba24ae9c8c87fd652c84f0ef2820b60",
"size"... |
"""Test parsing a reset action."""
import io
import textwrap
from launch.actions import ResetLaunchConfigurations, SetLaunchConfiguration
from launch.frontend import Parser
from launch.launch_context import LaunchContext
def test_reset():
yaml_file = \
"""\
launch:
- let:
... | {
"content_hash": "73816e6bf0794e57e4a1e86357b31d87",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 76,
"avg_line_length": 31.68421052631579,
"alnum_prop": 0.5991140642303433,
"repo_name": "ros2/launch",
"id": "27eb260da5bcc53d6793d6daf39a78e40ff274ad",
"size": "2408",
... |
import sys
import os
import numpy as np
from scipy import interpolate
import matplotlib.pyplot as plt
from cage.landscape import LandscapeAnalyzer
from cage.core import Facet
"""
Plot the landscape of connected edges. This is some damn illegible code, but
improving it would require thinking, and ain't nobody got time... | {
"content_hash": "195c6a2d53f2ce9f1f873014f64e3732",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 79,
"avg_line_length": 30.530516431924884,
"alnum_prop": 0.6295555897278179,
"repo_name": "mbercx/cage",
"id": "7d04810df7709cd210358cc135b571a8614174f9",
"size": "6522",
... |
"""
@brief test log(time=1s)
"""
import unittest
import inspect
import ast
from pyquickhelper.loghelper import fLOG
from pysqllike.translation.node_visitor_translator import CodeNodeVisitor
from pysqllike.translation.translation_class import TranslateClass
from pysqllike.translation.translation_to_python import Tr... | {
"content_hash": "2f6d8a909fdfad9cd08205da60bf2b4a",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 29.07777777777778,
"alnum_prop": 0.5475735575085976,
"repo_name": "sdpython/pysqllike",
"id": "3ca60c7d3eaf08ccb7f0af718503864dfb1498e1",
"size": "26... |
class ButtonElement:
def __init__(self, type, title, url=None, payload=None):
# TODO: raise an exception if 'url' is provided with type='postback' and vice versa
self.json = {k: v for k, v in locals().items() if v is not None}
del self.json['self']
for k, v in self.json.items():
... | {
"content_hash": "62e3887fd0802f018828be252812f5ee",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 91,
"avg_line_length": 48.625,
"alnum_prop": 0.570694087403599,
"repo_name": "Elishanto/HarryBotter",
"id": "2c1b7340f14d0bdb76a1241f42affd47922003ac",
"size": "389",
"bin... |
import copy
import datetime
import mock
import pytest
from elastalert.ruletypes import AnyRule
from elastalert.ruletypes import BaseAggregationRule
from elastalert.ruletypes import BlacklistRule
from elastalert.ruletypes import CardinalityRule
from elastalert.ruletypes import ChangeRule
from elastalert.ruletypes impo... | {
"content_hash": "12fae68bc3e41a7cc77aed02f8c30aeb",
"timestamp": "",
"source": "github",
"line_count": 1096,
"max_line_length": 187,
"avg_line_length": 38.16332116788321,
"alnum_prop": 0.583976857054056,
"repo_name": "jetyang2005/elastalert",
"id": "39a637ec675b83baf4c41d8f51557e1da33ef0b2",
"size... |
import sys, os
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..'))
import pyeq2
import numpy
numpy.seterr(over = 'raise', divide = 'raise', invalid = 'raise', under = 'ignore') # numpy raises warnings, convert... | {
"content_hash": "fe117c98a63a13a44861953ecde04d45",
"timestamp": "",
"source": "github",
"line_count": 1120,
"max_line_length": 146,
"avg_line_length": 38.049107142857146,
"alnum_prop": 0.68060542062654,
"repo_name": "JMoravec/unkRadnet",
"id": "3fdb96b8f068100499adb41a9bf9c2c7d39722b8",
"size": "... |
raise DeprecationWarning(
"Ray SGD has been deprecated as of Ray 1.13. For distributed "
"deep learning on Ray please use Ray AI Runtime (Ray AIR) "
"instead ("
"https://docs.ray.io/en/master/ray-air/getting-started.html)."
)
| {
"content_hash": "f719970eca67525c7b0947871b0a6aac",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 40.333333333333336,
"alnum_prop": 0.6900826446280992,
"repo_name": "ray-project/ray",
"id": "969f57a7cf749695b1efd1db15bb4002c1ff74fe",
"size": "242",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('symposion_sponsorship', '0003_auto_20170813_1730'),
]
operations = [
migrations.AddField(
model_name='sponsorlevel',
name='a... | {
"content_hash": "5f6a745169d072dcd270957616976ef6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 23.77777777777778,
"alnum_prop": 0.6214953271028038,
"repo_name": "pyohio/symposion",
"id": "b93dc093c392cd445a69544e137f9c7df029c782",
"size": "501"... |
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:[email protected]/FurnitoData?charset=utf8'
json_store = '/home/boyang/Documents/furnitures' | {
"content_hash": "e2a25b3cd6c0b3a382bd0cacc7b346f6",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 92,
"avg_line_length": 51.333333333333336,
"alnum_prop": 0.7792207792207793,
"repo_name": "Informationretrieval2016/Furnito_web",
"id": "1557530a9c53127b877d15aac864b96ca40456... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.