text stringlengths 4 1.02M | meta dict |
|---|---|
import subprocess
import time
import os
from GlobalRRD import GlobalRRD
from NodeRRD import NodeRRD
class rrd:
def __init__( self
, databaseDirectory
, imagePath
, displayTimeGlobal = "7d"
, displayTimeNode = "1d"
):
self.dbPath = databaseDire... | {
"content_hash": "e23a0eb0ae858831c17ced3ec11f50a0",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 96,
"avg_line_length": 30.017857142857142,
"alnum_prop": 0.6406900654372397,
"repo_name": "FreiFunkMuenster/ffmap-backend",
"id": "36e46821e5d2cb8e58a917c5428ad7befb261cef",
... |
import argparse
import matplotlib.pyplot as plt
import matplotlib.animation
import numpy as np
import os
import sklearn.svm
import sklearn.datasets
def parse_args():
parser = argparse.ArgumentParser(description='Generate svm boundary gif')
# output file related
parser.add_argument('--output_dir', type=str... | {
"content_hash": "011d3c41c89fe2f8867bc5663bbcd1b1",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 119,
"avg_line_length": 34.94615384615385,
"alnum_prop": 0.6346026854501431,
"repo_name": "janvanrijn/openml-pimp",
"id": "06b32497c068c5d187f104ce932407040f5e7954",
"size... |
"""
Custom storage for Documents to allow dynamic MEDIA_ROOT paths
"""
from django.core.files.storage import FileSystemStorage
from django.core.exceptions import SuspiciousOperation
from django.utils._os import safe_join
from maker.core.conf import settings
import os
class FileStorage(FileSystemStorage):
def ... | {
"content_hash": "9fc9f0889b51f10bbe197b4099ee506d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 80,
"avg_line_length": 33.23529411764706,
"alnum_prop": 0.7150442477876107,
"repo_name": "alejo8591/maker",
"id": "db9d3f9ad33dfa67a581bd97a522d603607b31f0",
"size": "677",... |
import numpy as np
from scipy import stats
from scikits.statsmodels.regression.linear_model import OLS
from scikits.statsmodels.tools.tools import add_constant
def qqplot(data, dist=stats.norm, distargs=(), a=0, loc=0, scale=1, fit=False,
line=False):
"""
qqplot of the quantiles of x versus the... | {
"content_hash": "464da690c0f5be0d915dd5f283690a5d",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 85,
"avg_line_length": 33.52803738317757,
"alnum_prop": 0.6034843205574912,
"repo_name": "wesm/statsmodels",
"id": "7eafe6bbe0499722d53024e5d5c9d88d0411dc6c",
"size": "717... |
from __future__ import unicode_literals
import pytest
from marrow.mongo import Document, Field, U, Update
from marrow.mongo.field import Array, Number, String
class TestParametricUpdateConstructor(object):
@pytest.fixture()
def D(self):
class Sample(Document):
field = String()
number = Number('other')
... | {
"content_hash": "04028e39a932c0f8e25dc935c778db61",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 25.776119402985074,
"alnum_prop": 0.5929357266936884,
"repo_name": "marrow/mongo",
"id": "9f5cf269b8d78df237e3d6d13bbf3934610ebcc7",
"size": "1746",
... |
import lcm
def run():
while True:
print 0
# Do your shit here
| {
"content_hash": "41c7a5bec4befba69384f4de296767ef",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 27,
"avg_line_length": 10.625,
"alnum_prop": 0.5176470588235295,
"repo_name": "charleswongzx/sutd-evos",
"id": "485d78c64d3d4101f24ac60dd8c7a6d8feea4326",
"size": "85",
"b... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.jvm.tasks.jvm_task import JvmTask
from pants.backend.jvm.tasks.jvm_tool_task_mixin import JvmToolTaskMixin
from pants.base.target import Target
from... | {
"content_hash": "c71f1a45fe1df6471b94878a4f9b1482",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 96,
"avg_line_length": 45.53061224489796,
"alnum_prop": 0.6943074854325415,
"repo_name": "tejal29/pants",
"id": "b34cbb0941df7a71b6a974b6c231f6139875cf34",
"size": "2378",
... |
from __future__ import absolute_import, division, print_function, \
with_statement
import hashlib
import logging
import binascii
import base64
import time
import datetime
import random
import math
import struct
import hmac
import bisect
import shadowsocks
from shadowsocks import common, lru_cache, encrypt
from sh... | {
"content_hash": "6597cfd87ef64151a9a9fd1ac05ef12e",
"timestamp": "",
"source": "github",
"line_count": 784,
"max_line_length": 149,
"avg_line_length": 40.82397959183673,
"alnum_prop": 0.5565206523776792,
"repo_name": "kaneawk/shadowsocksr",
"id": "58f84a30c1a38687323bffeb4af4334dd0f8f02c",
"size":... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class ListAccountAliases(Choreography):
def __init__(self, temboo_session):
"""
Cre... | {
"content_hash": "6b954b4b533b822904b870de2613cb80",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 179,
"avg_line_length": 44,
"alnum_prop": 0.7039473684210527,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "20277febe718f3d85836aa7a16e220163f122a96",
"size": "4223",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0001_squashed_0021_remove_uuid_null'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='aut... | {
"content_hash": "2ae556c56156e82710b069fa97548305",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 60,
"avg_line_length": 23,
"alnum_prop": 0.6111111111111112,
"repo_name": "praekelt/molo",
"id": "1f8da7552bbbcbfe7b61a02507d5bdf2d16b6e6a",
"size": "488",
"binary": fals... |
from configparser import ConfigParser
import socket, errno, logging, time, os, sys
import requests
import datetime
import signal
TIMEOUT = datetime.timedelta(minutes=3)
class Timeout(Exception):
pass
def timeout(signum, frame):
raise Timeout("Timed out trying to connect to services.")
def wait(host, port):
... | {
"content_hash": "bda1eaece2301cf428caa3833a064ba0",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 111,
"avg_line_length": 31.125,
"alnum_prop": 0.5913654618473896,
"repo_name": "amcat/amcat-docker",
"id": "ad084bf5be9cf7a08203dc1238ffdcc3123fc2e1",
"size": "1992",
"bi... |
import os
import glob
import json
from collections import OrderedDict
from toolset.utils.output_helper import log
from colorama import Fore
class Metadata:
supported_dbs = [
('MySQL',
'One of the most popular databases around the web and in TFB'),
('Postgres',
'An advanced SQL... | {
"content_hash": "67d25b271b2c5f4d2f1cc3f2c502fb5c",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 146,
"avg_line_length": 40.583941605839414,
"alnum_prop": 0.5278177458033573,
"repo_name": "actframework/FrameworkBenchmarks",
"id": "23a1ba96a135292fbcc33d19b3a0064870b386e... |
from .base import Engine
from .interfaces import Connectable
from .interfaces import Dialect
from .. import event
from .. import exc
class ConnectionEvents(event.Events):
"""Available events for :class:`.Connectable`, which includes
:class:`.Connection` and :class:`.Engine`.
The methods here define the n... | {
"content_hash": "c49bb72d4b817c0bdd323292c4365d0d",
"timestamp": "",
"source": "github",
"line_count": 727,
"max_line_length": 79,
"avg_line_length": 41.66437414030261,
"alnum_prop": 0.6410366457576758,
"repo_name": "graingert/sqlalchemy",
"id": "32292c826c38e857488fbaebb1cb4f62a50497b3",
"size": ... |
"""
Input: list type processed data
Output:
Purpose: Remove irrelevant values from main file
Methods (1):
cleaner(1-2 argument(s) type textfile)
"""
import processor as processor
import re
def cleaner(file_to_be_cleaned, noise_file_to_clean_with = []):
# Define contents to be cleaned
file_shiny = pro... | {
"content_hash": "b461baa510f67164093a87d345cdfd07",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 82,
"avg_line_length": 30.258064516129032,
"alnum_prop": 0.6460554371002132,
"repo_name": "tanel3203/blacklistNameMatcher",
"id": "2d0c09b24e8dd0b3c31c62256b850c31758ed87e",
... |
"""Standard pulse ejector."""
from typing import List
import asyncio
from mpf.devices.ball_device.ball_device_ejector import BallDeviceEjector
from mpf.devices.ball_device.default_ball_search import DefaultBallSearch
from mpf.exceptions.config_file_error import ConfigFileError
class PulseCoilEjector(DefaultBallSear... | {
"content_hash": "f3a158f360958cb9c66dabc0e5aae418",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 117,
"avg_line_length": 47.870588235294115,
"alnum_prop": 0.6370115507495699,
"repo_name": "missionpinball/mpf",
"id": "6fa40dd9d8db5fdc9213d6e0fb15b0689fbc7d27",
"size": "... |
import mock
from rally.plugins.openstack.context.sahara import sahara_job_binaries
from tests.unit import test
CTX = "rally.plugins.openstack.context.sahara"
class SaharaJobBinariesTestCase(test.ScenarioTestCase):
def setUp(self):
super(SaharaJobBinariesTestCase, self).setUp()
self.tenants_num ... | {
"content_hash": "ef9e2d7c639f7ad118bf925b895a39f4",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 74,
"avg_line_length": 38.34920634920635,
"alnum_prop": 0.48820364238410596,
"repo_name": "paboldin/rally",
"id": "1d1aab65f222f311dbb74f5173e3a77388800cf5",
"size": "5398... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='username',
field=models.... | {
"content_hash": "be1025e4a72cd5edceacc4c643241087",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 21.555555555555557,
"alnum_prop": 0.5902061855670103,
"repo_name": "arineto/twitter_monitor",
"id": "48d02898c975137b7cf7a38b55234caacf1d770a",
"size... |
"""
Support for switches using GC100.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.gc100/
"""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.gc100 import DATA_GC100, CONF_PORTS
from h... | {
"content_hash": "bb6994f6796a121c6bf98e07ecf60f70",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 74,
"avg_line_length": 29.59722222222222,
"alnum_prop": 0.650398873768184,
"repo_name": "HydrelioxGitHub/home-assistant",
"id": "2a8e7eaa847cc1215173d5212942fb80a3b47250",
... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz DCsync - Full Hashdump',
'Author': ['@gentilkiwi', 'Vincent Le Toux', '@JosephBialek', "@harmj0y", "@monoxgas"],
'Description': ("Runs PowerSp... | {
"content_hash": "fe8c102b35f4318f0c903773d41e01bc",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 113,
"avg_line_length": 35.62280701754386,
"alnum_prop": 0.49544447180497414,
"repo_name": "drshellface/Empire",
"id": "e6226678066243146bdceec5473d67a88ab031b8",
"size": ... |
'''
This script shows how to read temperature/humidity with Sensirion sensors.
Some Sensirion sensors are read using the Sensirion EK-H4 multiplexer box from the evaluation kit. A serial TL has to be used
(http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity/Sensirion_Humidi... | {
"content_hash": "7da304f49b25fc04cdf913bf80065036",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 134,
"avg_line_length": 35.2972972972973,
"alnum_prop": 0.7052067381316999,
"repo_name": "SiLab-Bonn/basil",
"id": "9e7e0fac267c33b953b83254629e7c26563e5fec",
"size": "1523... |
import uuid
from msrest.pipeline import ClientRawResponse
from .. import models
class TaskOperations(object):
"""TaskOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializ... | {
"content_hash": "58b29306e5495f3eed0a1e46585910f6",
"timestamp": "",
"source": "github",
"line_count": 1001,
"max_line_length": 148,
"avg_line_length": 49.0999000999001,
"alnum_prop": 0.6338684408634967,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "f69a36f700c03ae09927379194486564dec5b08b"... |
"""
pyinotify
@author: Sebastien Martini
@license: MIT License
@contact: seb@dbzteam.org
"""
class PyinotifyError(Exception):
"""Indicates exceptions raised by a Pyinotify class."""
pass
class UnsupportedPythonVersionError(PyinotifyError):
"""
Raised on unsupported Python versions.
"""
def _... | {
"content_hash": "846b7abaeabc9c2a397adb2f4c288bf2",
"timestamp": "",
"source": "github",
"line_count": 2299,
"max_line_length": 80,
"avg_line_length": 37.2683775554589,
"alnum_prop": 0.5583916900093371,
"repo_name": "tethr/core",
"id": "739f1e9a5fb1d70c79d590353e06eef60cb63583",
"size": "86867",
... |
"""
testfixtures.user_avatar
~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime
from byceps.database import generate_uuid
from byceps.services.user_avatar.models import Avatar
from byceps.util.image.models import Imag... | {
"content_hash": "e827fe704831803a77dcb9522fd6c024",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 70,
"avg_line_length": 23.321428571428573,
"alnum_prop": 0.6875957120980092,
"repo_name": "m-ober/byceps",
"id": "7b66114e9eae5548237d0cca811638e0bd943685",
"size": "653",
... |
import functools
import tensorflow as tf
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np
import params as prm
import matplotlib.pyplot as plt
import tensorflow.contrib.slim as slim
from tensorflow.examples.tutorials.mnist import input_data
def doublewrap(function):
"""
... | {
"content_hash": "744fcb10eedd948176c36e625c923b1b",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 80,
"avg_line_length": 36.97959183673469,
"alnum_prop": 0.647075055187638,
"repo_name": "attilaborcs/dnn-visualization",
"id": "48db30383e915fe137884b21c31e443c5bb266bc",
"... |
'''Small cd context manger that changes directory for a given operation and
then resotres current directory.
Inspired by Fabric's cd context manager (http://bit.ly/PCBkIW)
'''
from os import getcwd, chdir
class cd:
__doc__ = '''Context manager for changing directories for an operation
>>> print(getcwd())
... | {
"content_hash": "0d55cd9940690a7e546896c71a24598c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 22.393939393939394,
"alnum_prop": 0.5832205683355887,
"repo_name": "tebeka/pythonwise",
"id": "dc95d9e1d97ee72158803b0f7e401fb55f0acd96",
"size": "73... |
import mysqlstmt
class Replace(mysqlstmt.Insert):
"""REPLACE statement.
Examples: ::
>>> q = Replace()
>>> q.into_table('t').set_value('c1', 1).sql()
('REPLACE INTO t (`c1`) VALUES (1)', None)
"""
def __init__(self, **kwargs):
"""Constructor for Replace
Keyw... | {
"content_hash": "5efe67fadfbc1c59a3bc2a6248764076",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 54,
"avg_line_length": 21.318181818181817,
"alnum_prop": 0.5181236673773987,
"repo_name": "lovette/mysqlstmt",
"id": "4988bcc0862564418a595a183f4e8538695599dc",
"size": "49... |
import re
import os
import warnings
import functools
import keyring
from io import BytesIO
import numpy as np
import astropy.units as u
import astropy.io.votable as votable
from astropy import coordinates
from astropy.table import Table
from astroquery import log
from bs4 import BeautifulSoup
from ..query import Que... | {
"content_hash": "5b9c4e519d30c1d7bb9abeb5a86b0e87",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 86,
"avg_line_length": 41.57446808510638,
"alnum_prop": 0.5443193449334698,
"repo_name": "ceb8/astroquery",
"id": "cccb39520a06235a2ed9c975b13c3bd256ecdf3a",
"size": "1960... |
"""XLA LocalClient interface for interacting with TPUs via the TPU driver."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import logging
# Import xla_client to load shared C++ extensions (just CompileOptions at the
# time of writing).
from te... | {
"content_hash": "50072f5beda651ae4a6834551f2daa78",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 96,
"avg_line_length": 38.8,
"alnum_prop": 0.6890034364261168,
"repo_name": "frreiss/tensorflow-fred",
"id": "6d4482af43f4ae5ff644e5b3c8f16f6d22f2f37d",
"size": "2435",
"... |
from hk2.extensions import IExtension
#===========================================================
class Extension(IExtension):
def __init__(self):
self._plugin = None
self._pointName = None
self._className = None
self._params = {}
self._point = None
def plugin(sel... | {
"content_hash": "62706e9735f10642e371495b9c04ee04",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 60,
"avg_line_length": 23.17391304347826,
"alnum_prop": 0.5103189493433395,
"repo_name": "mikhtonyuk/pyhk2",
"id": "d6a12472f69727a648fdaf4497c4a31a30c7a4b3",
"size": "533"... |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
"""Make sure json library being used does not lose precision converting BTC values"""
n = Decimal("20000... | {
"content_hash": "b71abbc1b8f810f30412335d7c362906",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 111,
"avg_line_length": 38.392857142857146,
"alnum_prop": 0.6155038759689923,
"repo_name": "twilightcoin/twilightcoin",
"id": "1b2c9f5b44986b166221ca316c8bf2eb93068ae2",
"... |
import os
import re
import subprocess
from pants.base.build_environment import get_buildroot
from pants.base.exiter import PANTS_SUCCEEDED_EXIT_CODE
from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest
class ProtobufIntegrationTest(PantsRunIntegrationTest):
def test_import_from_buildroot... | {
"content_hash": "07e34340068fa747bd842525abe38f8c",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 99,
"avg_line_length": 38.50588235294118,
"alnum_prop": 0.5116101435991445,
"repo_name": "wisechengyi/pants",
"id": "88e43f95b7ae3d01b38f91b0fbe7317367909022",
"size": "66... |
from concurrent.futures import ThreadPoolExecutor
import requests
from requests import Session
from requests_futures.sessions import FuturesSession
from splunk_eventgen.lib.logging_config import logger
from splunk_eventgen.lib.outputplugin import OutputPlugin
try:
import ujson as json
except:
import json
c... | {
"content_hash": "83edaa8ee9c456887a8aedde06453393",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 94,
"avg_line_length": 36.75609756097561,
"alnum_prop": 0.5485069674850697,
"repo_name": "splunk/eventgen",
"id": "b0fc2a6cba08d5e1d72922879bb67e1a59c5aad9",
"size": "7535... |
"""This file updates code snippets in docs from code in test files.
To use put the following in your md file where you would like the code to be:
<!-- @doxysnippetstart NAME -->
<!-- @doxysnippetend -->
In the CPP (or CC) file include the following wrapped around the code:
/// @doxysnippetstart DocFile.md NAME
/// @d... | {
"content_hash": "a66d1dd76222be609c6ac07852e5bb5b",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 90,
"avg_line_length": 32.53103448275862,
"alnum_prop": 0.6266694933220267,
"repo_name": "google/fplutil",
"id": "5328726dd00aa6a6a79b6fc2721d2c62b934468a",
"size": "5332"... |
import unittest
from ..utils import util
class MyTest(unittest.TestCase):
def test_multiply(self):
self.assertEquals(4, util.multiply(2, 2))
| {
"content_hash": "8304a37cd1ebd835e7174cbb01de27b4",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 45,
"avg_line_length": 21.285714285714285,
"alnum_prop": 0.738255033557047,
"repo_name": "hurricup/intellij-community",
"id": "e16049da0f62a4624cbfba93dbc58f37f459f03b",
"si... |
import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="text", parent_name="streamtube.colorbar.title", **kwargs
):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | {
"content_hash": "8c5d120c059b8050091ae9d4fa5ebfd2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 32.69230769230769,
"alnum_prop": 0.6094117647058823,
"repo_name": "plotly/plotly.py",
"id": "8d512cca5cef528c6c92f14ddd833d4a01cc49d3",
"size": "425"... |
"""Helper binary for absltest_test.py."""
import os
import tempfile
import unittest
from absl import app
from absl import flags
from absl.testing import absltest
FLAGS = flags.FLAGS
_TEST_ID = flags.DEFINE_integer('test_id', 0, 'Which test to run.')
_NAME = flags.DEFINE_multi_string('name', [], 'List of names to pr... | {
"content_hash": "c094e7dd44437ef4d337d93557811bc7",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 80,
"avg_line_length": 32.10606060606061,
"alnum_prop": 0.6503067484662577,
"repo_name": "abseil/abseil-py",
"id": "89b67217987a2b56c4fa8a72806b19a647c6acd5",
"size": "482... |
import pkg_resources
try:
pkg_resources.get_distribution('numpy')
except pkg_resources.DistributionNotFound:
numpyPresent = False
print("Error: Numpy package not available.")
else:
numpyPresent = True
import numpy as np
try:
pkg_resources.get_distribution('pandas')
except pkg_resources.Distri... | {
"content_hash": "72d54fbdfbbdf4053e163d8053143644",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 219,
"avg_line_length": 60.57983193277311,
"alnum_prop": 0.5328062144541545,
"repo_name": "lvphj/epydemiology",
"id": "fdfd7d4c684ccbadf046e1be0a4c15aef1e9d2a0",
"size": "... |
import pytest
from skidl import ERC, Net, Part, generate_netlist, generate_xml, subcircuit, super
from .setup_teardown import setup_function, teardown_function
class Resistor(Part):
def __init__(
self, value, ref=None, footprint="Resistors_SMD:R_0805", tag=None, **kwargs
):
super().__init__(... | {
"content_hash": "14b54e9eb2ae83c71359c82ac867f4a9",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 87,
"avg_line_length": 27.41891891891892,
"alnum_prop": 0.6165598817151307,
"repo_name": "xesscorp/skidl",
"id": "4038d58aad021d9f3e8ea7d8ba31b43ba87c19f4",
"size": "2122",... |
'''serializer_helper.py'''
import heron.common.src.python.pex_loader as pex_loader
from heronpy.api.serializer import PythonSerializer
import heronpy.api.api_constants as constants
class SerializerHelper:
"""Helper class for getting serializer for component"""
@staticmethod
def get_serializer(context):
"""... | {
"content_hash": "3c5087664b9b1077e3b26960f52e6783",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 97,
"avg_line_length": 40.32,
"alnum_prop": 0.7152777777777778,
"repo_name": "huijunwu/heron",
"id": "3004c35887fad42d8b793967e124c852e6a88606",
"size": "1858",
"binary":... |
import sys
import traceback
__author__ = 'xshu'
# global variables
symbolsFound = []
geneSymbol2IDMapping = {}
geneSymbol2SynonymsMapping = {}
def showHelp():
print\
'''
This program creates the initial gene2uniprot by updating aliases in hgncSymbolAlias2Uniprot with NCBI gene-info file
Usage: %s
... | {
"content_hash": "bae55296d6cb2a88c6b3b89b784c46fa",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 121,
"avg_line_length": 36.05511811023622,
"alnum_prop": 0.5699934483511684,
"repo_name": "cancerregulome/gidget",
"id": "24156e2593067a3ad922eb3ec686a38be3636ca1",
"size"... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'SSOUser.primary_character'
db.add_column('sso_ssouser', 'primary_character', self.gf('django.db.models.field... | {
"content_hash": "4b78a787df04cc7fee7fe30319faf5e0",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 190,
"avg_line_length": 80.76756756756757,
"alnum_prop": 0.550461785570874,
"repo_name": "nikdoof/test-auth",
"id": "f1e2c134352535f4560531d84c9098c0dcaf0bfd",
"size": "14... |
import urllib
import csv
from datetime import datetime
import os.path
# To do:
# - Limit to X updates per day
# - Post tweets!
# - Screenshot
# - ???
csvNumber = 1
# deduplicate = True
print "Kicking off"
while csvNumber < 5:
if not os.path.isfile('crest_lite_' + str(csvNumber) + '.csv'):
urllib.urlretr... | {
"content_hash": "997de947ab80c6b5644cb27495c979bb",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 181,
"avg_line_length": 36.77777777777778,
"alnum_prop": 0.5755287009063444,
"repo_name": "MuckRock/API-examples",
"id": "ae5dc1ead40355899c089352bc0dc64b8995d697",
"size":... |
"""
This module defined the client PyScript code to handle the connection
with the Python server.
Further, it defines a (singleton) class that can collects all the
JS/CSS, and provides this client code (HTML/JS/CSS) in diffent ways.
This streamlines the inclusion in Jupyter and our export mechanism.
"""
import os
fro... | {
"content_hash": "8af8cf19bcda8130133697178eb3112f",
"timestamp": "",
"source": "github",
"line_count": 598,
"max_line_length": 95,
"avg_line_length": 34.663879598662206,
"alnum_prop": 0.5242896425297892,
"repo_name": "almarklein/flexx",
"id": "c7e7fa5807173f717c9f854740a55e9051ca664e",
"size": "20... |
from math import sqrt, erf
from numpy import linspace, empty, zeros, vectorize
from .block import BaseBlock
from .points import Point3
def coeff1d_gauss(whs):
""" Evaluate Gauss Blur 1D convolution filter coefficients
for the given window half size.
"""
# pylint: disable=invalid-name
c0 = 3.0 / sqr... | {
"content_hash": "c2179936fb8d4c1a2dfc54eab13bc357",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 31.67543859649123,
"alnum_prop": 0.5859872611464968,
"repo_name": "DREAM-ODA-OS/tools",
"id": "b36586e50c3de09506562b47a50944d8bec4d9d4",
"size": "5... |
'''Anemoi
'''
import os
from distutils.core import setup
from setuptools import find_packages
import numpy as np
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'T... | {
"content_hash": "076d422489b514569e6368203b6d8efb",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 68,
"avg_line_length": 28.106382978723403,
"alnum_prop": 0.6351249053747161,
"repo_name": "uwoseis/anemoi",
"id": "11c9380bce0c06b2dbc7a6c3ff6931f3e1a8d4df",
"size": "1321"... |
"""Package: graph."""
| {
"content_hash": "8af5c774d366c8b8c677665c6eb594c2",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 21,
"avg_line_length": 22,
"alnum_prop": 0.5454545454545454,
"repo_name": "Nachtfeuer/concept-py",
"id": "95d96957fa84cce11776b4d5c5c5eaa212dd0db6",
"size": "22",
"binary"... |
"""
Sample executor showing the result of the stitching & validation methods.
"""
import argparse
import json
import sys
import logging
from networkx.readwrite import json_graph
from stitcher import bidding
from stitcher import evolutionary
from stitcher import iterative_repair
from stitcher import stitch
from stitc... | {
"content_hash": "8be64799a4445801849bc4c792c3258a",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 73,
"avg_line_length": 33.65079365079365,
"alnum_prop": 0.6466981132075472,
"repo_name": "tmetsch/graph_stitcher",
"id": "57e7291ba97c22f79cef34305627064d5af2fac6",
"size":... |
"""
sphinx.builders.latex
~~~~~~~~~~~~~~~~~~~~~
LaTeX builder.
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
from os import path
from docutils import nodes
from docutils.io import FileOutput
from docutils.utils import new_d... | {
"content_hash": "277b724202f443df9e62e90a4e16ba54",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 80,
"avg_line_length": 38.43333333333333,
"alnum_prop": 0.5751662330153223,
"repo_name": "neumerance/cloudloon2",
"id": "3369338c2877420870be029d30279882d52f8d79",
"size":... |
import logging
from .ldapconnection import LdapConnection
logger = logging.getLogger(__name__)
LDAP_SUCCESS_CODE = 97
class HandleLdapConnection(object):
def __init__(self, wrapped):
self.wrapped = wrapped
def __get__(self, instance, owner):
wrapped = self.wrapped.__get__(instance, owner)
... | {
"content_hash": "83638ccd4734c173b5bf2daa7f939bc7",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 79,
"avg_line_length": 34.18181818181818,
"alnum_prop": 0.6143617021276596,
"repo_name": "dusking/ldappy",
"id": "ae69559b0da484ea6d32c0540b1b80ce282acc57",
"size": "1504",... |
"""
Use nose
`$ pip install nose`
`$ nosetests`
"""
from hyde._compat import quote
from hyde.generator import Generator
from hyde.site import Site
from fswrap import File
TEST_SITE = File(__file__).parent.parent.child_folder('_test')
class TestTextlinks(object):
def setUp(self):
TEST_SITE.make()
... | {
"content_hash": "a38efcec27944a62b74b7b7c5706a8b9",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 74,
"avg_line_length": 28.305084745762713,
"alnum_prop": 0.6023952095808384,
"repo_name": "hyde/hyde",
"id": "b6158c6533a7348f8a0640cba0d84ee702eab3a3",
"size": "1670",
"... |
"""Training-related part of the Keras engine.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
from tensorflow.python.data.ops import dataset_ops
from tensorflow.python.data.ops import iterator_ops
from tensorflow.p... | {
"content_hash": "0a669be8d42d6e536147e8f7c420599a",
"timestamp": "",
"source": "github",
"line_count": 2951,
"max_line_length": 114,
"avg_line_length": 43.44459505252457,
"alnum_prop": 0.6427284427284428,
"repo_name": "jhseu/tensorflow",
"id": "3e775c19c21144bea4df3f9d06d88950017a3116",
"size": "1... |
"""Utilities for OAuth.
Utilities for making it easier to work with OAuth 2.0
credentials.
"""
import os
import threading
from oauth2client.client import Credentials
from oauth2client.client import Storage as BaseStorage
class CredentialsFileSymbolicLinkError(Exception):
"""Credentials files must not be symbol... | {
"content_hash": "639b6efb518648662094eb54d60f1a9c",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 70,
"avg_line_length": 23.25,
"alnum_prop": 0.6630824372759857,
"repo_name": "ychen820/microblog",
"id": "9549a2cac2cf1a0b4c668fb66374979f2dd32dd1",
"size": "3109",
"bin... |
"""autogenerated by genpy from rosmln/MLNInterfaceRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import rosmln.msg
class MLNInterfaceRequest(genpy.Message):
_md5sum = "62568d74f21c9322ed52fdd3d72d116d"
_type = "rosmln/MLNInterfaceRequest... | {
"content_hash": "1e4c0e4def537801903dbedf42241028",
"timestamp": "",
"source": "github",
"line_count": 537,
"max_line_length": 91,
"avg_line_length": 31.15270018621974,
"alnum_prop": 0.5793532189610855,
"repo_name": "danielnyga/pracmln",
"id": "ccc2c1a8dc81b25c5263bbc8bb8e370825429187",
"size": "1... |
import dnnet.utils.numcupy as ncp
from dnnet.ext_mathlibs import cp, np
from dnnet.layers.layer import Layer
from dnnet.utils.nn_utils import is_multi_channels_image
from dnnet.utils.nn_utils import asnumpy, prod, flatten, unflatten
class DropoutLayer(Layer):
"""Implement Dropout.
Derived class of Layer.
... | {
"content_hash": "0ea221b6aa79fd4251cdcb1aaec7aa49",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 91,
"avg_line_length": 31.141176470588235,
"alnum_prop": 0.6282584057423498,
"repo_name": "daichi-yoshikawa/dnn",
"id": "d4fed8cb577750070ba07042f93ab476e1b81c4c",
"size": ... |
from datetime import date
from unittest import TestCase
from unittest.mock import patch
from freezegun import freeze_time
from core.utils import NOMINATIM_URL, get_coordinates_for_city, next_deadline
@patch('requests.get')
class GetCoordinatesForCityTest(TestCase):
def test_get_coordinates_for_city(self, mock_g... | {
"content_hash": "3bfd0a570965a25dc2e820358793af35",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 77,
"avg_line_length": 27.285714285714285,
"alnum_prop": 0.5737347294938918,
"repo_name": "patjouk/djangogirls",
"id": "9fb6ed27985b44752e695acd5845c38567700500",
"size": "... |
import re
import sys
import traceback
_UNDERSCORER_1 = re.compile(r"(.)([A-Z][a-z]+)")
_UNDERSCORER_2 = re.compile("([a-z0-9])([A-Z])")
CAMEL_CASE = re.compile(r"(?!^)_([a-zA-Z])")
def get_short_exc_info():
exc_type, exc_value = sys.exc_info()[:2]
return ("".join(traceback.format_exception_only(exc_type, ex... | {
"content_hash": "e523bc70b6c495e1271ec1bd940adb8f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 93,
"avg_line_length": 28.594594594594593,
"alnum_prop": 0.6408317580340265,
"repo_name": "exxeleron/yak",
"id": "cbb3832ab1d58070baa53c78853bf6ecf20be4d0",
"size": "1658",... |
"""Keras training and evaluation routines for eager execution.
"""
# pylint: disable=protected-access
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from tensorflow.python.eager.backprop import GradientTape
from tensorflow.python.framewo... | {
"content_hash": "9b32a25d990cb2b9f8c66ead0a435129",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 83,
"avg_line_length": 35.642857142857146,
"alnum_prop": 0.6461104026234287,
"repo_name": "hfp/tensorflow-xsmm",
"id": "e62dd1ffa8d73dd956b20a7d19c6bf772cc5f0a3",
"size": ... |
from google.cloud import aiplatform_v1beta1
def sample_delete_index_endpoint():
# Create a client
client = aiplatform_v1beta1.IndexEndpointServiceClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.DeleteIndexEndpointRequest(
name="name_value",
)
# Make the request... | {
"content_hash": "0214b3a39e95002144c47eba7ce539bd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 82,
"avg_line_length": 26.08695652173913,
"alnum_prop": 0.73,
"repo_name": "googleapis/python-aiplatform",
"id": "3845074a714211a7ae496b3bf5e1f170076c5a11",
"size": "2015",... |
import argparse
import os.path
import re
import sys
from . import Grammar
argp = argparse.ArgumentParser(description="Generate a testcase from a grammar")
argp.add_argument("input", type=argparse.FileType('r'), help="Input grammar definition")
argp.add_argument("output", type=argparse.FileType('w'), nargs="?", defaul... | {
"content_hash": "c4e8610d96598e9b54b001d8a8225272",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 155,
"avg_line_length": 48.13333333333333,
"alnum_prop": 0.7313019390581718,
"repo_name": "blackberry/ALF",
"id": "903fbc211d9724a9a4b40462344b943dc82f5042",
"size": "1547"... |
import argparse
from neutronclient._i18n import _
from neutronclient.common import exceptions
from neutronclient.common import utils
from neutronclient.neutron import v2_0 as neutronV20
from neutronclient.neutron.v2_0 import availability_zone
from neutronclient.neutron.v2_0 import dns
from neutronclient.neutron.v2_0.q... | {
"content_hash": "86acb723ca841355332167580ce0d171",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 37.56481481481482,
"alnum_prop": 0.5616218880946512,
"repo_name": "rackerlabs/rackspace-python-neutronclient",
"id": "23362e12e725465db22b998440905450... |
from django.conf.urls import patterns, url
from tools import views
urlpatterns = patterns('',
url(r'^errors/$', views.errors),
url(r'^distributions/$', views.distributions),
url(r'^emptytranslations/$', views.emptytranslations),
url(r'^verbvalidationstatus/$', views.verbvalidationstatus),
)
| {
"content_hash": "9c7543a99384cb4871ba6089e598dabb",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 64,
"avg_line_length": 31,
"alnum_prop": 0.7161290322580646,
"repo_name": "aymara/verbenet-editor",
"id": "6fd3d85a9bf52ccbf849c34e9a0f0563dba67abb",
"size": "310",
"bina... |
import datetime
import os
import types
import unittest
import urlparse
from google.appengine.api import apiproxy_stub_map
from google.appengine.api import datastore_errors
from google.appengine.api import datastore_file_stub
from google.appengine.ext import db
from mapreduce import control
from mapreduce import hooks
... | {
"content_hash": "4cf546bba95b190431d2ce4678758138",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 80,
"avg_line_length": 32.16046511627907,
"alnum_prop": 0.6445151493238845,
"repo_name": "bslatkin/8-bits",
"id": "2177dabcd07ec91d3e321fdbdb144df3a35d5dc0",
"size": "1449... |
signupPageSubmissionIds = ['kjh8qh', 'kjz9tt', 'kldjyb', 'klpyd7', 'kme59z', 'kn3nbp', 'knob4v']
signupPageFlaskPort = 8945
challengePageSubmissionId = 'koa8cv'
challengePageFlaskPort = 8946
# thisMonthName = "January"
# nextMonthName = "February"
readAllCommentsWhichCanBeSlower = False
currentMonthTotalDays = 31
curre... | {
"content_hash": "8ffdb9cb68ab8ca878667107ecdd673d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 117,
"avg_line_length": 43.083333333333336,
"alnum_prop": 0.7833655705996132,
"repo_name": "foobarbazblarg/stayclean",
"id": "c1aed94eb62f84ec28e711c4d9cf9631f13efa19",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ComponentLibrary', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='gcomponents',
name='packaging',
... | {
"content_hash": "2f0ccd6c84c20083f1df2a1445ac0588",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 45,
"avg_line_length": 19.647058823529413,
"alnum_prop": 0.6017964071856288,
"repo_name": "sonicyang/chiphub",
"id": "0b54729f5d67740d54ff7fba4c1ab0b29f744626",
"size": "35... |
import datetime
import factory
from factory.alchemy import SQLAlchemyModelFactory
from purchasing.database import db
from purchasing.users.models import User, Role, Department
from purchasing.data.contracts import ContractBase, ContractProperty, ContractType
from purchasing.data.companies import Company
from purchas... | {
"content_hash": "1f9dbc2925fa703783dc3e09253022e4",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 82,
"avg_line_length": 28.653846153846153,
"alnum_prop": 0.7100671140939597,
"repo_name": "CityofPittsburgh/pittsburgh-purchasing-suite",
"id": "82e3458706bb186192e88c36b538... |
from __future__ import annotations
import warnings
from abc import ABC
from typing import TYPE_CHECKING
from airflow.exceptions import RemovedInAirflow3Warning
if TYPE_CHECKING:
from airflow.models.connection import Connection
class BaseSecretsBackend(ABC):
"""Abstract base class to retrieve Connection obj... | {
"content_hash": "dc447dc9e1da451b480218d2ce82f5f3",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 108,
"avg_line_length": 33.39705882352941,
"alnum_prop": 0.6010568031704095,
"repo_name": "cfei18/incubator-airflow",
"id": "cc070cf7e10adb606f820635c4d96de9bcd9c558",
"si... |
"""
This is a collection of monkey patches and workarounds for bugs in
earlier versions of Numpy.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ...extern import six
from ...utils import minversion
__all__ = ['NUMPY_LT_1_8', 'NUMPY_LT_1_9', 'NUMPY... | {
"content_hash": "4704b7c5f896d62b1cdcd1899350faab",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 37.24,
"alnum_prop": 0.6396348012889366,
"repo_name": "joergdietrich/astropy",
"id": "bda721fc3619441b9b7c982333523dbf4d5e8dbd",
"size": "1926",
"b... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import sys
if len(sys.argv) != 3:
print "Usage: python confusion.py <log (Slurm) file> <# classes>"
sys.exit(1)
log_filename = sys.argv[1]
num_classes = int(sys.argv[2])
# Read in last confusion matrix and plot it
cou... | {
"content_hash": "95bbf7831e9b350af78f402348af4efb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 89,
"avg_line_length": 36.55102040816327,
"alnum_prop": 0.6030150753768844,
"repo_name": "atitus5/FastLID-DNN",
"id": "22855fd457c485b771b97d4e2ec07250869c92be",
"size": "1... |
"""
Created on Thu Feb 25 10:43:33 2016
@author: suraj
"""
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.layers.recurrent import LSTM
from keras.models import Graph
from keras.models import mod... | {
"content_hash": "7b277991271c8dbbc5e2c3e49de3e8e7",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 130,
"avg_line_length": 23.327272727272728,
"alnum_prop": 0.7279812938425565,
"repo_name": "suraj-jayakumar/lstm-rnn-ad",
"id": "5ec53da4cace8af7b28ee96a7ce8f9a805809363",
... |
''' Provides ``PropertyCallbackManager`` and ``EventCallbackManager``
mixin classes for adding ``on_change`` and ``on_event`` callback
interfaces to classes.
'''
#-----------------------------------------------------------------------------
# Boilerplate
#---------------------------------------------------------------... | {
"content_hash": "3184858d09f0e394fad21302f78c30bb",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 122,
"avg_line_length": 35.795698924731184,
"alnum_prop": 0.5121658155602283,
"repo_name": "timsnyder/bokeh",
"id": "0b9bb48bc1866b278d8759e31864e900d1ff4a7f",
"size": "69... |
from EyeFeatureFinder import *
from FastRadialFeatureFinder import *
from SubpixelStarburstEyeFeatureFinder import *
from PipelinedFeatureFinder import *
from numpy import *
from scipy import *
from matplotlib import *
from CompositeEyeFeatureFinder import *
from FastRadialFeatureFinder import *
from threading import T... | {
"content_hash": "70b4c9bf14ce6e5d078be4228a7be564",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 81,
"avg_line_length": 33.61490683229814,
"alnum_prop": 0.5515521064301552,
"repo_name": "relisher/ferretextras",
"id": "f7ae242a99f10e9bc49cae380f2e7017c1e31ef3",
"size":... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
author: "Ondrej Famera (@OndrejHome)"
module: pcs_auth
short_description: Module for interactin... | {
"content_hash": "0da74d1a509873861b193d06d8ab502e",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 136,
"avg_line_length": 37.79289940828402,
"alnum_prop": 0.5752309378424926,
"repo_name": "erigones/esdc-ce",
"id": "6083ff9ea8e8605fd44b22edc347ee8b31b5dda7",
"size": "66... |
import unittest
from flask import current_app
from app import create_app, db
class BasicsTestCase(unittest.TestCase):
def setUp(self):
self.app = create_app('testing')
self.app_context = self.app.app_context()
self.app_context.push()
db.create_all()
def tearDown(self):
... | {
"content_hash": "b6cda90905569d38d019b9852ac50a3d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 54,
"avg_line_length": 25.545454545454547,
"alnum_prop": 0.6387900355871886,
"repo_name": "answerrrrrrrrr/myflask",
"id": "c4a599f1b3071c8ba90365f47e92a513c6410de6",
"size"... |
try:
import json
except ImportError:
import simplejson as json
import copy
import datetime
import time
__docformat__ = "epytext"
class Attr(object):
"""
Encapsulates information about an attribute in the JSON encoding of the
object. It identifies properties of the attribute such as whether it's
read-only... | {
"content_hash": "af770815ae63850452fc29ec6fdcf946",
"timestamp": "",
"source": "github",
"line_count": 1316,
"max_line_length": 117,
"avg_line_length": 31.47872340425532,
"alnum_prop": 0.6123931830251533,
"repo_name": "zhuwbigdata/hadoop-admin-utils",
"id": "295f7a82ec791d967b91323332ee4be2a35ef250"... |
import contextlib
import logging
import teuthology.lock.ops
import teuthology.lock.query
import teuthology.lock.util
from teuthology.job_status import get_status
log = logging.getLogger(__name__)
@contextlib.contextmanager
def lock_machines(ctx, config):
"""
Lock machines. Called when the teuthology run fi... | {
"content_hash": "a2b8bf917bcb1160165f5bb668e05313",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.19444444444444,
"alnum_prop": 0.6683636363636364,
"repo_name": "ktdreyer/teuthology",
"id": "d7598719ebde71f921605e425667f7e4416ca241",
"size": "1... |
'''Tests for program runner.'''
from ...core import column as cl
from program_runner import ProgramRunner
from ..helpers_test import createTable, stdoutIO, TableFileHelper, \
TEST_DIR, augmentPythonPath
from api_util import writeObjectToFile
import numpy as np
import os
import shutil
import unittest
# Constants
... | {
"content_hash": "1216c906b96e01e8a1336a4ff9692a01",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 70,
"avg_line_length": 32.256,
"alnum_prop": 0.6319444444444444,
"repo_name": "ScienceStacks/JViz",
"id": "c69c8617185aafcfec4de5c1f111d6dba4b87da4",
"size": "4032",
"bi... |
"""
Contains base classes for modbus request/response/error packets
"""
from pymodbus3.interfaces import Singleton
from pymodbus3.constants import Defaults
from pymodbus3.utilities import rtu_frame_size
import struct
from collections import Callable
# Logging
import logging
_logger = logging.getLogger(__name__)
# re... | {
"content_hash": "ca3c78b884322bc64496bd5e31828b5e",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 79,
"avg_line_length": 29.176706827309236,
"alnum_prop": 0.6360633172746043,
"repo_name": "gregorschatz/pymodbus3",
"id": "24bdf5089f6dc7d39838ece502a446c1d205b310",
"size... |
import time
import redis
from flask import render_template, request, session, jsonify, redirect, url_for
from flask_login import login_required, current_user
from app import db
from app.main import main
from app.models import Activity, User, AcUser
@main.route('/index')
@login_required
def index():
activity = Ac... | {
"content_hash": "dc5d7b2bf273f21f97e1d976e8364a61",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 90,
"avg_line_length": 36.334782608695654,
"alnum_prop": 0.5259064257508675,
"repo_name": "StarInworld/voluntary",
"id": "47fa3657fcecfe73b93559caa2852673d896c48a",
"size"... |
'''
Created on 2011/11/03
@author: tn10
'''
import exceptions
import multitask #@UnresolvedImport
from timeit import itertools
import itertools
from functools import wraps
def main():
pass
#if __name__ == '__main__': main()
def _treatment(pos, element):
return '%d: %s' % (pos, element)
seq = ["one", "two"... | {
"content_hash": "40a9f7afe98f6986f9b20a9ab031ab08",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 80,
"avg_line_length": 20.52707581227437,
"alnum_prop": 0.6111501934576152,
"repo_name": "t10471/python",
"id": "222b49f7a0d852e4211360f8eff0e3423bc92c6b",
"size": "6118",... |
"""
The scheduler used in Fujitsu PRIMEHPC FX100.
Since it seems to be no specific name for the scheduler, actually the scheduler
is a part of the "Technical Computing Suite (TCS)", this module was named as fujitsu.py.
The schedulers used in FX10 and K computer are supposed to be the same as this,
but it has not been t... | {
"content_hash": "301130d25f9da09624a6c9349551c631",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 89,
"avg_line_length": 28.54180602006689,
"alnum_prop": 0.6148347785329271,
"repo_name": "ryokbys/nap",
"id": "627dd792e9643eefa0882529a5b6ec3863382406",
"size": "8558",
... |
from oauth2_provider.models import Application
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from core.models import UserProfile
def create_auth_client(sender, instance=None, created=False, **kwargs):
"""
Creates OAuth2 Application object with
client_id and cl... | {
"content_hash": "bdef8f02ff7f1cf05d43051a5534977c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 31.863636363636363,
"alnum_prop": 0.7275320970042796,
"repo_name": "Mehnen/BOINSO",
"id": "6e4e8ac5efa65bad7ecb0e1da839950290fcbfa2",
"size": "701",
... |
"""User-facing interface to an ADB device.
This module provides the user-facing interface to controlling ADB devices with
this library. See adb_protocol.py for a breakdown of the various layers.
Essentially, this module provides the AdbDevice class, which takes a UsbHandle
and uses the layers in between to provide a ... | {
"content_hash": "a59d04c163b87ded94066d2d7b422ad6",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 79,
"avg_line_length": 34.65145228215768,
"alnum_prop": 0.6932103939647947,
"repo_name": "google/openhtf",
"id": "19eb5f49bcbdd14b5d5e3e1164b166df05089da6",
"size": "8944"... |
"""
.. module:: decorators
:platform: Unix, Windows
:synopis: some decorator tools
.. moduleauthor:: Thomas Lehmann <thomas.lehmann.private@googlemail.com>
=======
License
=======
Copyright (c) 2014 Thomas Lehmann
Permission is hereby granted, free of charge, to any person obtaining a copy of ... | {
"content_hash": "2b4c305895ab711cff736cc6b6e9074b",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 94,
"avg_line_length": 39.93006993006993,
"alnum_prop": 0.6129597197898424,
"repo_name": "ActiveState/code",
"id": "a69622beffe87c5a6911138581b591c62e652c86",
"size": "571... |
import logging
import math
from unittest.mock import MagicMock
import os
from pathlib import Path
import re
from httpx import URL
import pytest
from planet import models
from planet.exceptions import PagingError
LOGGER = logging.getLogger(__name__)
def test_StreamingBody_name_filename():
r = MagicMock(name='re... | {
"content_hash": "1a92b953ef40eb4c2df9851061fcc830",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 75,
"avg_line_length": 31.00558659217877,
"alnum_prop": 0.6108108108108108,
"repo_name": "planetlabs/planet-client-python",
"id": "a95ded703c2aac3266b96ee677ff96043c195a76",... |
"""
Unit-tests for preprocess module
"""
import unittest
from whoami.preprocess import replace_subject, remove_parens, \
get_substitution_str
class TestProcessSubject(unittest.TestCase):
"""Test that replace_subject makes all substitutions correctly"""
def test_no_synonyms(self):
sentence = u"Th... | {
"content_hash": "158e4aa60f8913efe61f4fd951cbdf9c",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 179,
"avg_line_length": 45.28030303030303,
"alnum_prop": 0.6459762422620043,
"repo_name": "infolab-csail/whoami",
"id": "15e3ebbbd1622e6d586f95c35ba47f6c0d9adeb0",
"size":... |
from distutils import log
import distutils.command.register as orig
if "__PEX_UNVENDORED__" in __import__("os").environ:
from setuptools.errors import RemovedCommandError # vendor:skip
else:
from pex.third_party.setuptools.errors import RemovedCommandError
class register(orig.register):
"""Formerly used to... | {
"content_hash": "e2d933aedf10e8ecdb2aa868b7ba80bc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 73,
"avg_line_length": 27.863636363636363,
"alnum_prop": 0.66721044045677,
"repo_name": "pantsbuild/pex",
"id": "327c8a39c39a36991ac97a298cd9dbd45f95e7d5",
"size": "613",
... |
import os, pickle, re
from .. import build
from .. import dependencies
from .. import mesonlib
import json
import subprocess
from ..mesonlib import MesonException
class InstallData():
def __init__(self, source_dir, build_dir, prefix):
self.source_dir = source_dir
self.build_dir= build_dir
s... | {
"content_hash": "78b5bc2383c7e6ffce148a7081d023b1",
"timestamp": "",
"source": "github",
"line_count": 515,
"max_line_length": 116,
"avg_line_length": 43.81747572815534,
"alnum_prop": 0.5653195072232562,
"repo_name": "germandiagogomez/meson",
"id": "4ff15537c4b3835a32b3f0bfc72b2f2e020541ad",
"size... |
import json
from poster.encode import multipart_encode
import urllib2
def getFaces(fliename):
datagen, headers = multipart_encode({"api_key": "Bn7swhGpvtzxS9uMWG-0CkacJY-_gt-4",
"api_secret": 'tNCF8Wd-xjtw-qyQn47yjZh8RzLkVBkU',
"ima... | {
"content_hash": "1caacdebcd0607c8afcc0ac32362704b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 34.51724137931034,
"alnum_prop": 0.5404595404595405,
"repo_name": "jeremykid/FunAlgorithm",
"id": "0daa85982b11679b38eeaa8a75c7e85da6d5ea97",
"size"... |
from __future__ import unicode_literals
from django.apps import AppConfig
class MapConfig(AppConfig):
name = 'Map'
| {
"content_hash": "2913c96469d860a4c09a1f470f02f528",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 17.428571428571427,
"alnum_prop": 0.7377049180327869,
"repo_name": "smarani/InfraShareMobile",
"id": "2f52ddcfdf58643373e0d954acf9a53bc67a7779",
"size... |
"""The tests for the Restore component."""
from datetime import datetime, timedelta
from unittest.mock import patch
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import CoreState, State
from homeassistant.exceptions import HomeAssistantError
from homeassist... | {
"content_hash": "8eb7a95253698130c97d8fb078963818",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 111,
"avg_line_length": 33.222811671087534,
"alnum_prop": 0.6468662674650698,
"repo_name": "FreekingDean/home-assistant",
"id": "d138a5381daa3ed6c224c92c805df5005b3f67d2",
... |
from decimal import Decimal, ROUND_HALF_UP
class AdvancedBoxScoreDeserializerUtils:
default_decimal_value = Decimal("0.0")
def __init__(self):
pass
@staticmethod
def parse_float(float_value):
if float_value is None:
return AdvancedBoxScoreDeserializerUtils.default_decima... | {
"content_hash": "0263b77fb8ae73f85523c762354bb2a0",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 99,
"avg_line_length": 32.10344827586207,
"alnum_prop": 0.6809881847475833,
"repo_name": "jaebradley/nba_data",
"id": "69cc692d7673aa3f81e998aab3c2761defa69270",
"size": "9... |
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
foundinstances = UnwrapElement(IN[0])
booleans = list()
for item in foundinstances:
try:
if item.GetType().Name == 'FamilyInstance':
booleans.append(True)
else:
booleans.append(False)
except:
booleans.append(False)
OUT = booleans | {
"content_hash": "7fb2bd5cd06d1722225db62fdc8651cc",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 45,
"avg_line_length": 21.066666666666666,
"alnum_prop": 0.7373417721518988,
"repo_name": "andydandy74/ClockworkForDynamo",
"id": "fbc509eca0ea7d76f5454abc4b2be40c98f0f278",
... |
class IDAVProvider(object):
"""
+----------------------------------------------------------------------+
| TODO: document this interface |
| For now, see wsgidav.DAVProvider instead. |
+-------------------------------------------... | {
"content_hash": "eaed85afdcf8de103feca20b8db64b7a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 77,
"avg_line_length": 41.78947368421053,
"alnum_prop": 0.4836272040302267,
"repo_name": "tracim/tracim-webdav",
"id": "b73252d5a170bb69bdfe0b48a621235fdf7dbd14",
"size": "... |
"""
Craft, sign and broadcast Worldcoin transactions.
Interface with Worldcoind.
"""
import os
import sys
import binascii
import json
import hashlib
import re
import time
import getpass
import decimal
import logging
import requests
from pycoin.ecdsa import generator_secp256k1, public_pair_for_secret_exponent
from pyc... | {
"content_hash": "7d25e502e9d52290a9b512120d575ad6",
"timestamp": "",
"source": "github",
"line_count": 796,
"max_line_length": 283,
"avg_line_length": 42.87562814070352,
"alnum_prop": 0.5856309883090627,
"repo_name": "Bluejudy/bluejudyd",
"id": "2c4f6e343d3d461e19d20ac2c008f741e9068031",
"size": "... |
"""
The sax module contains a collection of classes that provide a
(D)ocument (O)bject (M)odel representation of an XML document.
The goal is to provide an easy, intuative interface for managing XML
documents. Although, the term, DOM, is used above, this model is
B{far} better.
XML namespaces in suds are represented ... | {
"content_hash": "71ea38fe8956093a008b4b97e102a026",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 68,
"avg_line_length": 29.398373983739837,
"alnum_prop": 0.5887721238938053,
"repo_name": "ghajba/python",
"id": "6fe7a184dc83b41d27337f7ff975199cbee28957",
"size": "4449"... |
from pyvisdk.thirdparty import Enum
VirtualMachineAppHeartbeatStatusType = Enum(
'appStatusGray',
'appStatusGreen',
'appStatusRed',
)
| {
"content_hash": "1e1e5d2b812221f4c8532f089fc3ea69",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 44,
"avg_line_length": 18.5,
"alnum_prop": 0.7432432432432432,
"repo_name": "xuru/pyvisdk",
"id": "493b2e002e937ca63cb6e6e52e1f45b949b97404",
"size": "273",
"binary": fals... |
from trains import TrainTracker
from busses import BusTracker
| {
"content_hash": "3285cb6b3c0b93d93e71e036417ad7ed",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 31,
"avg_line_length": 31,
"alnum_prop": 0.8709677419354839,
"repo_name": "iandees/ctaapi",
"id": "d184c4d0d11bbcd900ea07c15071404955c41fe7",
"size": "62",
"binary": false... |
def ugettext(text):
# TODO
return text
| {
"content_hash": "46773255377adfca0a2a2f450c420c96",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 19,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.6170212765957447,
"repo_name": "flupke/pyflu",
"id": "148f8763dad83f79efc3858cbe87da013c1ef2d3",
"size": "47",
"... |
import pygame, sys, random
from pygame.locals import *
pygame.init()
gamename = pygame.display.set_caption('Pong')
clock = pygame.time.Clock()
FPS = 60
black = (0, 0, 0)
white = (255, 255, 255)
screen = pygame.display.set_mode((800, 800))
screen.fill(black)
line = pygame.draw.line(screen, white, (400, 800), (400,... | {
"content_hash": "aa0cef4091caee4805ca3d9ccd5f7ed2",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 85,
"avg_line_length": 21.789473684210527,
"alnum_prop": 0.5869565217391305,
"repo_name": "piotrbla/pyExamples",
"id": "731307809354439b2c5e7cbce62db45123bd322e",
"size": "... |
from django.contrib import admin
from ..config import get_config
class BatonAdminSite(admin.AdminSite):
site_header = get_config('SITE_HEADER')
site_title = get_config('SITE_TITLE')
index_title = get_config('INDEX_TITLE')
index_template = 'baton/index.html' if get_config(
'ANALYTICS') else 'a... | {
"content_hash": "5d143b7ab363d931cc09931bd06377e4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 72,
"avg_line_length": 32.3448275862069,
"alnum_prop": 0.662046908315565,
"repo_name": "otto-torino/django-baton",
"id": "af64e3f9d6660987911f3f46a0d9507aa1a12664",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.