text stringlengths 4 1.02M | meta dict |
|---|---|
from testbase import TestBase
from influxparawrite import InfluxParaWrite
class test_307(TestBase):
def run(self):
self.env.sendSingleMetric(1,self.name,1)
self.env.sendSingleMetric(2,self.name,2)
self.env.sendSingleMetric(3,self.name,3)
if self.env.countMetrics(1,self.name) != 3:
... | {
"content_hash": "5ff38c7c9efa058dce9cb3b3542ed7a7",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 89,
"avg_line_length": 43.5,
"alnum_prop": 0.581473968897904,
"repo_name": "hpcloud-mon/monasca-perf",
"id": "b535dd4ae1b4bcf4a0af94c3890f50146dc16320",
"size": "1479",
"... |
from quadtree import QuadTree
from strtree import STRtree | {
"content_hash": "57462b5ab419cd56f2dcbb6341ea2618",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 28.5,
"alnum_prop": 0.8771929824561403,
"repo_name": "geoscript/geoscript-py",
"id": "58b5576e998c592175a800020d5513a699e3fc2a",
"size": "57",
"bina... |
import re
from gym import error
import glob
# checkpoints/KerasDDPG-InvertedPendulum-v0-20170701190920_actor.h5
weight_save_re = re.compile(r'^(?:\w+\/)+?(\w+-v\d+)-(\w+-v\d+)-(\d+)(?:_\w+)?\.(\w+)$')
def get_fields(weight_save_name):
match = weight_save_re.search(weight_save_name)
if not match:
raise erro... | {
"content_hash": "6d1c02fec8bb8df3b9642f7ce2b194fc",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 158,
"avg_line_length": 42,
"alnum_prop": 0.6948853615520282,
"repo_name": "benelot/bullet-gym",
"id": "1ccedce5ccd0f5715cdfa97c6c6277426bf85885",
"size": "1135",
"binary... |
from builtins import str
import logging
from bq_data_access.v1.gnab_data import GNABFeatureProvider
from bq_data_access.v1.utils import DurationLogged
from django.conf import settings
SEQPEEK_FEATURE_TYPE = 'SEQPEEK'
class SeqPeekDataProvider(GNABFeatureProvider):
def __init__(self, feature_id, **kwargs):
... | {
"content_hash": "cdda9f5c5b0707e17c87a8d36c2264fe",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 144,
"avg_line_length": 43.80281690140845,
"alnum_prop": 0.5569131832797428,
"repo_name": "isb-cgc/ISB-CGC-Webapp",
"id": "b2b1e97a87e484398e4dad2933948f730ad9263d",
"size"... |
import mock
import six
from heat.common import exception as exc
from heat.common import template_format
from heat.engine.resources.openstack.heat import software_component as sc
from heat.engine import stack
from heat.engine import template
from heat.tests import common
from heat.tests import utils
class SoftwareCom... | {
"content_hash": "1daa061c4f259dcad035a02dc86a6e7d",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 79,
"avg_line_length": 36.088235294117645,
"alnum_prop": 0.4721882640586797,
"repo_name": "dims/heat",
"id": "d59044768560a6fb1229bf2a699635af2aafbcd3",
"size": "10391",
... |
from corehq.apps.app_manager.models import Application
from corehq.apps.userreports.specs import TypeProperty
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors, FormAccessors
from dimagi.ext.jsonobject import JsonObject, StringProperty
STATUSES = {
(1, 0): "Improved",
(0, 1): "**Declined*... | {
"content_hash": "471769e25901235c069131f6927626a0",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 115,
"avg_line_length": 37.70068027210884,
"alnum_prop": 0.5364489354023818,
"repo_name": "qedsoftware/commcare-hq",
"id": "56dfb486d00bc577d9900e3fafa689db2a63b6ad",
"siz... |
"""
=========================================
SVM: Maximum margin separating hyperplane
=========================================
Plot the maximum margin separating hyperplane within a two-class
separable dataset using a Support Vector Machine classifier with
linear kernel.
"""
print(__doc__)
import numpy as np
impor... | {
"content_hash": "463fe8541ed6ac910fa05e1317ac9523",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 28.711111111111112,
"alnum_prop": 0.641640866873065,
"repo_name": "clemkoa/scikit-learn",
"id": "9fdbcc785ed2bd55f2ab0e9e47b2b2e108b1052c",
"size": "... |
from __future__ import absolute_import
import unittest
from xosgenx.generator import XOSProcessor, XOSProcessorArgs
from helpers import XProtoTestHelpers
def policy_output_enforcer(x, y):
"""
eliminating warnings arising due to the missing policy_output_enforcer,
which is generated and loaded dynamically.... | {
"content_hash": "3d716d648fc3f1370322637b2f418d06",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 208,
"avg_line_length": 36.64248704663213,
"alnum_prop": 0.5866798642533937,
"repo_name": "opencord/xos",
"id": "b75f3c78677e523b76b7d0daf0fb7a98b576ae49",
"size": "7667",... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def HostDhcpServiceConfig(vim, *args, **kwargs):
'''This data object type describes the co... | {
"content_hash": "fc31fac1ea17b87e4d45507cad40ba2e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 124,
"avg_line_length": 33.88235294117647,
"alnum_prop": 0.6206597222222222,
"repo_name": "xuru/pyvisdk",
"id": "2a6a5d4739c3abb05c6e7343109237815af00620",
"size": "1153",
... |
from __future__ import unicode_literals
import logging
from django.utils import timezone
from rest_framework import serializers
from .models import Driver, Order
from .tasks import find_drivers
logger = logging.getLogger()
class DriverSerializer(serializers.ModelSerializer):
'''
Driver
'''
class... | {
"content_hash": "6b33f82a18316562f167166f4cdcc3c9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 74,
"avg_line_length": 21.01818181818182,
"alnum_prop": 0.606401384083045,
"repo_name": "rombr/agile-fusion-test-task",
"id": "e8a2ad84e34e3c964a77eef504358a3e272ab203",
"s... |
"""
test_arpspoof
----------------------------------
Tests for `arpspoof` module.
"""
import unittest
from arpspoof import arpspoof
class TestArpspoof(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
if __name__ == '__main__':... | {
"content_hash": "cbf7ab98597738f205af8799acbb432c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 38,
"avg_line_length": 13.6,
"alnum_prop": 0.5529411764705883,
"repo_name": "byt3bl33d3r/arpspoof",
"id": "2de84fc83420ce3a7d49119c8f2b1ac54306f76a",
"size": "387",
"bina... |
from datetime import datetime, timedelta
import argparse
import pytest
from ding import ding
def test_time_parser_relative_1s():
parser = ding.TimeParser(['1s'], relative=True)
assert parser.get_seconds() == 1
def test_time_parser_relative_1m():
parser = ding.TimeParser(['1m'], relative=True)
assert ... | {
"content_hash": "b1fac21641c4fb3776eba6f2034d1495",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 91,
"avg_line_length": 34.43055555555556,
"alnum_prop": 0.6680112948769665,
"repo_name": "liviu-/ding",
"id": "75b3dfe2690d0992c298fa6a30c6524e72109425",
"size": "2479",
... |
import ness6rest as nessrest
import os
import re
import sys
import time
import datetime
class Scan(object):
'''
Scan interface
'''
def __init__(self,name,
scanner=None,
url="",
login="",
password="",
... | {
"content_hash": "2c96e525b56debb235294c61444ccc6d",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 121,
"avg_line_length": 38.079734219269106,
"alnum_prop": 0.5094224393648578,
"repo_name": "attritionorg/nessrest",
"id": "d33daab41bd997b70c4744048765adddc3af7074",
"size... |
"""Tests for streams.py"""
import asyncio
import unittest
from unittest import mock
from aiohttp import helpers, streams, test_utils
class TestStreamReader(unittest.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(self):
self.time_service = None
self.loop = asyncio.new_event_loop()
... | {
"content_hash": "52760abaa318921d406a549f7fea6bb1",
"timestamp": "",
"source": "github",
"line_count": 1096,
"max_line_length": 78,
"avg_line_length": 31.256386861313867,
"alnum_prop": 0.6170125813702309,
"repo_name": "Eyepea/aiohttp",
"id": "d233b3e456468dfb11960f38162d4c14c88abaa2",
"size": "342... |
import os
import regex as re
from errors import ContentTypeMismatch,FileNotFound
import utils
import base64
class Context(object):
def __init__(self,environment,logical_path,pathname):
self.environment = environment
self._logical_path = logical_path
self.pathname = pathname
self.line = None
self.object_id... | {
"content_hash": "8e09c70f106bea047f901d990d0a0346",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 101,
"avg_line_length": 29.007462686567163,
"alnum_prop": 0.7134036532029843,
"repo_name": "OiNutter/rivets",
"id": "4648aff3b3d87248582900bd40357f20da0315fd",
"size": "38... |
__author__ = 'Michael'
from gensim.models import Word2Vec
import EmotionSynsets
import numpy as np
#Get the most likely emotion for a given word vector:
def get_most_likely_emotion(vector_synsets, emotion_labels, word_vector, strategy='average'):
if strategy == 'average':
dist = float('Inf')
curre... | {
"content_hash": "fdc99bbb3cadfc37980cef7de5c7392c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 124,
"avg_line_length": 31.529411764705884,
"alnum_prop": 0.6305970149253731,
"repo_name": "MichSchli/EmoticonSynonyms",
"id": "b4f7db6ab1fe33e0cc6f0c5c46536cdc2f5d0835",
"... |
from datetime import datetime
from functools import wraps, update_wrapper
from flask import abort, make_response
from flask_login import current_user
from .models import Permission
def permission_required(permission):
'''检查一般权限'''
def decorator(func):
@wraps(func) # 将传入函数的 __name__ 等属性复制到 decorated_f... | {
"content_hash": "257602025c5405e2ad69429909ee3873",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 36.6,
"alnum_prop": 0.6639344262295082,
"repo_name": "1dot75cm/flasky",
"id": "4f2cb186708c4c81efe212080d3681a7ff8e0ca4",
"size": "1608",
"binary":... |
"""Testing malloovia hybrid model"""
from typing import Tuple
import pytest # type: ignore
import ruamel.yaml
from jsonschema import validate
from pulp import COIN, PulpSolverError # type: ignore
yaml = ruamel.yaml.YAML(typ="safe")
yaml.safe_load = yaml.load
from malloovia.model import (
LimitingSet,
Insta... | {
"content_hash": "5249baf6dc2b13ce88b9bc2aacbf9c51",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 89,
"avg_line_length": 33.59241706161137,
"alnum_prop": 0.5955135440180587,
"repo_name": "asi-uniovi/malloovia",
"id": "baf025c6db92dec558654f7c2f41fbe21ac74fa4",
"size": ... |
import json
import os
import shutil
from subprocess import check_output, check_call, CalledProcessError
import tempfile
import urllib
import psutil
from .. import constants
from ..daemon import close_client_connection, clean_up_socket, shut_down_http_server
from ..log import log_to_client
from ..payload import daemon... | {
"content_hash": "10f4e75faaf9e689691536d96eb39fef",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 133,
"avg_line_length": 41.763440860215056,
"alnum_prop": 0.6985066941297632,
"repo_name": "gamechanger/dusty",
"id": "5fd8c5ebb0496428c089dbf6e3f7f90a1d4a6437",
"size": "3... |
"""
Methods to extend functionality of the VBase4 class
"""
def pPrintValues(self):
"""
Pretty print
"""
return "% 10.4f, % 10.4f, % 10.4f, % 10.4f" % (self[0], self[1], self[2], self[3])
Dtool_funcToMethod(pPrintValues, VBase4)
del pPrintValues
def asTuple(self):
"""
Returns the vector as a t... | {
"content_hash": "14fb5598d42046ffcdc41725ad6a560e",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 107,
"avg_line_length": 24.476190476190474,
"alnum_prop": 0.6614785992217899,
"repo_name": "jjkoletar/panda3d",
"id": "8b7c022593c0deec97a225a73b81c3af22640cad",
"size": "5... |
"""Manul Integration"""
import os
import subprocess
import shutil
from fuzzers import utils
from fuzzers.afl import fuzzer as afl_fuzzer
def build():
"""Build benchmark and copy fuzzer to $OUT."""
afl_fuzzer.prepare_build_environment()
utils.build_benchmark()
# Move manul base to /out.
shutil.move... | {
"content_hash": "17b7548288c347533861b4b0b76fb6fd",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 80,
"avg_line_length": 32.88235294117647,
"alnum_prop": 0.6556350626118068,
"repo_name": "google/fuzzbench",
"id": "34af755b76a7e14097b04f7fe45f07fc2941b82c",
"size": "1688... |
""" public toolkit API """
from pandas.api import (
extensions,
indexers,
interchange,
types,
)
__all__ = [
"interchange",
"extensions",
"indexers",
"types",
]
| {
"content_hash": "833f950bd16c75de73592b990ab4e291",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 26,
"avg_line_length": 13.785714285714286,
"alnum_prop": 0.5492227979274611,
"repo_name": "pandas-dev/pandas",
"id": "9d4f721225d93aab3bd00a9eeac11ec8eacf118b",
"size": "19... |
import itertools, os, re
from time import gmtime, strftime
# django imports
from django.shortcuts import render_to_response, HttpResponse
from django.template import RequestContext as Context
from django.http import HttpResponseRedirect
from django.contrib.admin.views.decorators import staff_member_required
from djang... | {
"content_hash": "63d36302770a30de365399a9342bcd66",
"timestamp": "",
"source": "github",
"line_count": 490,
"max_line_length": 186,
"avg_line_length": 39.679591836734694,
"alnum_prop": 0.5992902329887363,
"repo_name": "dwaiter/django-filebrowser-old",
"id": "18ce01918a3a1eb7cb84f9083847069c53256d08"... |
import logging
from pajbot.managers.adminlog import AdminLogManager
from pajbot.managers.db import DBManager
from pajbot.models.command import Command
from pajbot.models.command import CommandExample
from pajbot.models.module import Module
from pajbot.models.user import User
from pajbot.modules import BaseModule
from ... | {
"content_hash": "e4562b1bf1067db184ef52655822db48",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 171,
"avg_line_length": 37.332155477031804,
"alnum_prop": 0.5699006152389967,
"repo_name": "pajlada/pajbot",
"id": "d81314865dcaa15cd588c98e36593314279f8ff4",
"size": "105... |
"""Tests scenario for microvms with max vcpus(32)."""
import host_tools.network as net_tools # pylint: disable=import-error
MAX_VCPUS = 32
def test_max_vcpus(test_microvm_with_api, network_config):
"""
Test if all configured guest vcpus are online.
@type: functional
"""
microvm = test_microvm_w... | {
"content_hash": "734ecd64a9d60d6b13295425040b540e",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 28.5,
"alnum_prop": 0.6707152496626181,
"repo_name": "firecracker-microvm/firecracker",
"id": "8c88eda13701f9a3aacc7ea94c21e26613796238",
"size": "85... |
from __future__ import unicode_literals
from requests.compat import is_py3
from requests.utils import to_native_string
from oauthlib.common import extract_params
from oauthlib.oauth1 import (Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER)
CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded'
CONTENT_T... | {
"content_hash": "ff816b98cfac36cacd52a3a647e06bb8",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 80,
"avg_line_length": 38.43076923076923,
"alnum_prop": 0.6369095276220976,
"repo_name": "collabspot/muninn",
"id": "1ad189318d0ba2478c949dc975ea936e6fa60ff0",
"size": "252... |
from contact_form.forms import ContactForm as BaseContactForm
class ContactForm(BaseContactForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['name'].label = 'Nome'
self.fields['email'].label = 'Email'
self.fields['body'].label = 'Mensagem'
... | {
"content_hash": "9ff4fddcb710a8578a8356af403d3a45",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 67,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.6214953271028038,
"repo_name": "caioariede/openimob",
"id": "593913bbebac82940d15d28d2759799039f4cb2f",
"size": "... |
import gi
# import GStreamer and GLib-Helper classes
gi.require_version('Gtk', '3.0')
gi.require_version('Gst', '1.0')
gi.require_version('GstVideo', '1.0')
gi.require_version('GstNet', '1.0')
from gi.repository import Gtk, Gdk, Gst, GstVideo
import signal
import logging
import sys
import os
sys.path.insert(0, '.')
f... | {
"content_hash": "bff3f49ae10f6061e4335d3c5600fd5a",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 124,
"avg_line_length": 29.965317919075144,
"alnum_prop": 0.6313657407407407,
"repo_name": "voc/voctomix",
"id": "994a1e1fcd359465ca97c359031637fc38b19387",
"size": "5207"... |
mode = 'IFS' # Telescope observing modes: 'IFS', 'Imaging'
lammin = 0.3 # Minimum wavelength (um)
lammax = 2.0 # Maximum wavelength (um)
resolution = 70. # Spectral resolution (lambda / delta-lambda)
throughput = 0.2 # Telescope throughput
diameter = 8.0 # Telescope diameter (m)
Ts... | {
"content_hash": "3067a481e4056a35e71f620ab6504db3",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 66,
"avg_line_length": 46.333333333333336,
"alnum_prop": 0.6115107913669064,
"repo_name": "jlustigy/coronagraph",
"id": "5374265494fbed2c0866a843fce903bca9d40dd6",
"size": ... |
from random import choice
from django.db.utils import IntegrityError
from django.template.defaultfilters import slugify
from django.core.management.base import BaseCommand, CommandError
from servo.models import Customer, Order, User, Location, GsxAccount
class Command(BaseCommand):
def handle(self, *args, **opti... | {
"content_hash": "34b0ae8d973d3ba736ed14b0ab9acba1",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 71,
"avg_line_length": 45.27160493827161,
"alnum_prop": 0.5674938641941641,
"repo_name": "filipp/Servo",
"id": "86738469be76cbcf3a25f8d02667c5cd17f40ee7",
"size": "5045",
... |
try:
import unittest2 as unittest
except ImportError: # pragma NO COVER
import unittest # noqa
from crabpy.client import (
capakey_factory
)
from crabpy.gateway.capakey import (
CapakeyGateway,
Gemeente,
Afdeling,
Sectie,
Perceel
)
def run_capakey_integration_tests():
from test... | {
"content_hash": "93a32cbb3bb14b1035e8d6b6e19b401a",
"timestamp": "",
"source": "github",
"line_count": 601,
"max_line_length": 113,
"avg_line_length": 34.51414309484193,
"alnum_prop": 0.6003471050474859,
"repo_name": "kmillet/crabpytest",
"id": "4cee8b631899755173d5079ec958c5038161b4c1",
"size": "... |
import random
import pygame
from pygame.locals import *
from gamelib.palette import *
from gamelib.gamemodels import *
CHEAT = True
def DrawForeground(Surface, State, ScreenSize):
fgRect = Rect(0,int(ScreenSize[1]/2),ScreenSize[0],int(ScreenSize[1]/2))
SectorDetails = State.GetSectorsAhead()
pri... | {
"content_hash": "c9bb60be6c442a46cb5ac0014884ad7a",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 98,
"avg_line_length": 35.895833333333336,
"alnum_prop": 0.6014703037337976,
"repo_name": "daftspaniel/daftpyweek17",
"id": "15ecde47552a64a5dbb54d8775094956ac44a975",
"si... |
import re
import json
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseBadRequest
from django.shortcuts import get_object_or_404
from nduser.models import Dataset, Project, Token, Channel
from stats.models import Histogram
import stats.tasks
from ndstats.histio import loadHistogram, loadHistogram... | {
"content_hash": "0bff500c6b2579b742e8afdd283bd79a",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 143,
"avg_line_length": 37.042821158690174,
"alnum_prop": 0.6593227254181967,
"repo_name": "neurodata/ndstore",
"id": "2cc675592ed7d70c16bf5397d4d0c0798fc121f8",
"size": "... |
"""An example functional test
The module-level docstring should include a high-level description of
what the test is doing. It's the first thing people see when they open
the file and should give the reader information about *what* the test
is testing and *how* it's being tested
"""
# Imports should be in PEP8 orderin... | {
"content_hash": "e318c7d79dafd3458c68a19eacd83974",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 133,
"avg_line_length": 40.84976525821596,
"alnum_prop": 0.6671646937133663,
"repo_name": "syscoin/syscoin2",
"id": "dc6a091a8e287043926c5fe0f3d4d7cab66fc9bb",
"size": "89... |
import numpy as np
from math import factorial
from openmdao.lib.datatypes.api import List, Bool, Array, Instance, Int, Float
from fusedwind.turbine.geometry_vt import Curve
from fusedwind.lib.distfunc import distfunc
from fusedwind.lib.geom_tools import calculate_length
from fusedwind.lib.cubicspline import NaturalCu... | {
"content_hash": "9e94caf419eeaea6be7965aba0848b31",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 78,
"avg_line_length": 28.44871794871795,
"alnum_prop": 0.5434880576836413,
"repo_name": "mrosemeier/fusedwind",
"id": "fefadff82902c3c94ae0cb8bae3c2fb09837126d",
"size": "... |
from django.http import HttpResponse
from django.template import RequestContext
from django.shortcuts import render_to_response
from nltkapp.models import Document, Corpus
import logging
logger = logging.getLogger('nltksite.nltkapp')
def index(request):
logger.debug("index requested.")
corpora = Corpus.objects.all(... | {
"content_hash": "12fa68392aaf97da82f2bb73db22d2c1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 112,
"avg_line_length": 36.166666666666664,
"alnum_prop": 0.804147465437788,
"repo_name": "wtamu-cisresearch/nltksite",
"id": "473172d5bbb98ae0b30524ec488c808730e0e467",
"s... |
import os
import time
import RPi.GPIO as GPIO
#Change this to whatever temperature you want the fan to kick on at.
maxTemp = 45 #Celsius
#Sets the time to wait in between checks
waitTime = 5 #seconds
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(8, GPIO.OUT)
while(True):
temperature = os.popen('vcge... | {
"content_hash": "049dec1cace9c2ec42225fac2368537a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 71,
"avg_line_length": 27.25,
"alnum_prop": 0.691743119266055,
"repo_name": "andrewkarch/Eleduino-Fan-Controller",
"id": "009a37c35bb91d70ec101fe829d04d8e1f4171b3",
"size":... |
from distutils.core import setup
from runcmd import __version__ as runcmd_version
setup(
name='runcmd',
version=runcmd_version,
packages=[''],
url='https://github.com/wschang/RunCmd',
license='MIT',
author='Wen Shan Chang',
author_email='shan.and.android@gmail.com',
description='Run com... | {
"content_hash": "44ea35647a86856edd13a6d62cf84030",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 52,
"avg_line_length": 27,
"alnum_prop": 0.6837606837606838,
"repo_name": "wschang/RunCmd",
"id": "2905a5a8ca8ce771931bb8da959945eaa7baa8d5",
"size": "351",
"binary": fal... |
"""
Holds a base class for frontend modules used in the SATOSA proxy.
"""
from ..attribute_mapping import AttributeMapper
class FrontendModule(object):
"""
Base class for a frontend module.
"""
def __init__(self, auth_req_callback_func, internal_attributes, base_url, name):
"""
:type ... | {
"content_hash": "1b287391d994339c837f11cef8fbf313",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 112,
"avg_line_length": 35.94186046511628,
"alnum_prop": 0.6311873180200582,
"repo_name": "its-dirg/SATOSA",
"id": "52840a85c6c446623a0c8ca6952c69f3ab2c119a",
"size": "3091... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_thune_grassland_guardian.iff"
result.attribute_template_id = 9
result.stfName("monster_name","thune")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "528bc4a28b9a9bdd30bdb934b6cc3bac",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 70,
"avg_line_length": 22.923076923076923,
"alnum_prop": 0.697986577181208,
"repo_name": "obi-two/Rebelion",
"id": "1cbc058dfdd89d51276fd3b7c37b9667d985a0e0",
"size": "443"... |
from mininet.net import Mininet, CLI
from scapy.all import *
import os
host_mac = "02:00:00:00:00:02"
echoer_mac = "02:00:00:00:00:01"
echoer_iface_name = "echoer-eth0"
PAX = None
try:
PAX = os.environ['PAX']
except KeyError:
print "PAX environment variable must point to path where Pax repo is cloned"
exit(1)
... | {
"content_hash": "28eaf4c1dfeb422ff40de19cafc5b85e",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 135,
"avg_line_length": 26.2,
"alnum_prop": 0.707742639040349,
"repo_name": "niksu/pax",
"id": "6af0d1e54d5ce279dba1c71dd313d8514428fab0",
"size": "1110",
"binary": false... |
import os,sys
curr_path = os.getcwd()
gerkin_path = os.path.split(curr_path)[0]
olfaction_prediction_path = os.path.split(gerkin_path)[0]
sys.path.append(olfaction_prediction_path) | {
"content_hash": "55a1baab7b350ad93606ba02ca843a05",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 57,
"avg_line_length": 36,
"alnum_prop": 0.7666666666666667,
"repo_name": "dream-olfaction/olfaction-prediction",
"id": "0f8e2d6f0af7061409bbb3a92bc2d9c577792711",
"size": "... |
from collections import OrderedDict
import os
import shutil
import tempfile
import unittest2
import git
from normalize import Property
from normalize import Record
from normalize.identity import record_id
from unique.store import Commit
from unique.store import Page
from unique.store import Tree
from testclasses imp... | {
"content_hash": "7502c0dc1956d8f217b11ee2af835efa",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 69,
"avg_line_length": 32.22330097087379,
"alnum_prop": 0.5896354323591443,
"repo_name": "samv/unique",
"id": "a8a514493bcd2f09309a3a1f398e2af61795a05d",
"size": "3320",
... |
import os
import sys
import pygame
from common import mvc
import minimenu
from common.constants import *
from client.constants import *
from common.util.rect import Rect
class Model(mvc.Model):
def __init__(self):
super(Model, self).__init__()
tempRect = Rect( (50, 50), (200, 0) )
menuO... | {
"content_hash": "640513fc66bbcc2143afee049e363c9b",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 25.608695652173914,
"alnum_prop": 0.5568760611205433,
"repo_name": "Wopple/fimbulvetr",
"id": "18761968397a38e37564340c479b9095b00a0cd5",
"size": "11... |
from django_sqlalchemy.test import *
from django_sqlalchemy.backend import metadata
from django.db.models.manager import EmptyManager
class AnonymousUser(object):
id = None
username = ''
is_staff = False
is_active = False
is_superuser = False
groups = EmptyManager()
def __unicode__(self):
... | {
"content_hash": "0c5ea7004457965e40bc5c98f8b22be5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 49,
"avg_line_length": 21.4,
"alnum_prop": 0.6728971962616822,
"repo_name": "brosner/django-sqlalchemy",
"id": "2dfc91c8b948affb8362b25394728ff3f7992e15",
"size": "535",
... |
from twisted.application import internet
from twisted.application.service import IServiceMaker
from twisted.internet import endpoints
from twisted.plugin import IPlugin
from twisted.python import reflect, usage
from zope.interface import implementer
from zope.interface.verify import verifyClass
DEFAULT_ENDPOINT = "tcp... | {
"content_hash": "3e7d1fa40e2415a99945fc4edf78b092",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 106,
"avg_line_length": 35.84313725490196,
"alnum_prop": 0.7177242888402626,
"repo_name": "johnpaulett/txHL7",
"id": "96be799fcf259434a8e8589995646dbfda71713a",
"size": "18... |
import requests
import json
# Given a government issued ID card from the UAE (emirates). Extract the holder's face and d aisplay all scanned fields.
#
# PixLab recommend that you connect your AWS S3 bucket via your dashboard at https://console.pixlab.io/
# so that any cropped face or MRZ crop is stored automatically o... | {
"content_hash": "1df569695ece4ccd044234936bc8fff6",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 174,
"avg_line_length": 50.935483870967744,
"alnum_prop": 0.7181760607979734,
"repo_name": "symisc/pixlab",
"id": "7dccc556896f69c10fcc42c8e3f3e23a232d5579",
"size": "1579"... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import re
from pants.backend.core.tasks.console_task import ConsoleTask
from pants.base.build_environment import get_scm
from pants.base.exceptions import TaskError
f... | {
"content_hash": "56b5d3214c6191894720d1fdad8f3d45",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 113,
"avg_line_length": 42.76646706586826,
"alnum_prop": 0.6535984318118174,
"repo_name": "pgroudas/pants",
"id": "bc29f6ab99814373435db9fce3f2cb533dfffd85",
"size": "7289... |
"""
firval
======
a netfilter firewall rules generator designed
to be easy to read, write and maintain
How to use
==========
Write a yaml configuration file and feed it to firval,
it will produce a iptables-restore compatible rule file
it means you can do this:
cat rules.yaml | firval | iptables-restore
Confi... | {
"content_hash": "4c00dfd96355dd67fd7b6f59ac201016",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 165,
"avg_line_length": 33.795698924731184,
"alnum_prop": 0.47638743693468477,
"repo_name": "nlm/firval",
"id": "4fd39cc573bab2a39ab3b8fa5fd70c2041143481",
"size": "22001"... |
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
# layout.py
# ---------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educati... | {
"content_hash": "27857031d0b45f7985d41411a49ca1b6",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 119,
"avg_line_length": 34.81666666666667,
"alnum_prop": 0.5674166267751716,
"repo_name": "rlpy/rlpy",
"id": "e5b8f3ce9f1718aaddebb4223d76f28929a9b768",
"size": "6267",
... |
from __future__ import print_function, unicode_literals, division, absolute_import
import sys
from dxpy import DXHTTPRequest
from dxpy.utils import Nonce
def analysis_add_tags(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /analysis-xxxx/addTags API method.
For more info, see:... | {
"content_hash": "cfd0e9549e3998d1f6d34b2aad7de11a",
"timestamp": "",
"source": "github",
"line_count": 1372,
"max_line_length": 158,
"avg_line_length": 47.96355685131196,
"alnum_prop": 0.7071087742759019,
"repo_name": "jhuttner/dx-toolkit",
"id": "49d7ee2af7ac0cd28502121d41a4257ae9b93574",
"size":... |
import base64
import calendar
import hashlib
import hmac
import json
import time
from libsaas import parsers, http, port
from libsaas.services import base
from . import resources
class Mozscape(base.Resource):
EXPIRES = 300
timesource = time.gmtime
def __init__(self, access_id, secret_key):
""... | {
"content_hash": "361997f5e514aa4b8c9bb2cdf0cf4c3a",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 88,
"avg_line_length": 30.406593406593405,
"alnum_prop": 0.6277556920852909,
"repo_name": "ducksboard/libsaas",
"id": "280349895d3964ea7fc92a871bd056a64b57efe4",
"size": "2... |
from django import forms
class QuestionForm(forms.Form):
question_text = forms.CharField(
widget=forms.Textarea,
max_length=300,
label='Ask something!',
required=True
)
anonymous = forms.BooleanField(
widget=forms.CheckboxInput,
label='Ask Anonymously',
... | {
"content_hash": "2a406bdd22582e77ee6899a413953494",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 62,
"avg_line_length": 26.142857142857142,
"alnum_prop": 0.6229508196721312,
"repo_name": "shakib609/AskFmClone",
"id": "291a014034b7c1b32c57398a8959f5dae1323310",
"size": ... |
"""Multimodal block environments for the XArm."""
import collections
import math
from typing import Dict, List, Optional, Union
import gin
from gym import spaces
from gym.envs import registration
from ibc.environments.block_pushing import block_pushing
from ibc.environments.block_pushing import metrics as block_pushi... | {
"content_hash": "a38f6008d4c110e579df93e160ef0606",
"timestamp": "",
"source": "github",
"line_count": 476,
"max_line_length": 91,
"avg_line_length": 37.32142857142857,
"alnum_prop": 0.650661412890515,
"repo_name": "google-research/ibc",
"id": "75dc66a3e971a8c199eae1dd5c6e6bd6d25c866e",
"size": "1... |
"""
Tests of ``jedi.api.Interpreter``.
"""
from ..helpers import TestCase
import jedi
from jedi._compatibility import is_py33
class TestInterpreterAPI(TestCase):
def check_interpreter_complete(self, source, namespace, completions,
**kwds):
script = jedi.Interpreter(sour... | {
"content_hash": "deb0c3fe5320ceab4e42e20d633f831e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 77,
"avg_line_length": 37.548780487804876,
"alnum_prop": 0.44624878207210134,
"repo_name": "turiphro/dockerfiles",
"id": "36d85ecbae4216230de0462e25d46de1705f420e",
"size":... |
"""Tracker server for hosting .track torrent files.
"""
__license__ = "MIT"
__docformat__ = 'reStructuredText'
import socket
import socketserver
import threading
import sys
import os
import os.path
import urllib.parse
from ipaddress import IPv4Address,AddressValueError
import fcntl
import trackerfile
import apiut... | {
"content_hash": "837dd5de6459f8b935379c9511e4bc32",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 80,
"avg_line_length": 34.520782396088016,
"alnum_prop": 0.5358028188965224,
"repo_name": "skgrush/py-mstorrent",
"id": "c8a2a81e4650de0d415d5d668f821e1076d3da41",
"size":... |
from models import User
from templates import TextTemplate
from utilities import send_message
def send_campaign():
message = TextTemplate(text="NEW FEATURE: SUBSCRIPTIONS \n\n"+
"Hi there, this week a new feature is coming out and that is SUBSCRIPTIONS.\n\n"+
... | {
"content_hash": "0a181e05872630f5d6f0085f9ce0ceb4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 128,
"avg_line_length": 64.34615384615384,
"alnum_prop": 0.5845786013150029,
"repo_name": "mayukh18/BlindChat",
"id": "8cedb6c30c4a274e9b70b889cc519816f07bef9a",
"size": "1... |
"""Home Assistant command line scripts."""
from __future__ import annotations
import argparse
import asyncio
from collections.abc import Sequence
import importlib
import logging
import os
import sys
from homeassistant import runner
from homeassistant.bootstrap import async_mount_local_lib_path
from homeassistant.conf... | {
"content_hash": "bfd561578806830cb43e6861c468f825",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 84,
"avg_line_length": 29.962025316455698,
"alnum_prop": 0.6556822982678496,
"repo_name": "kennedyshead/home-assistant",
"id": "b31fc7181731f0462e1090890025bcaa92c79d40",
"... |
import os
from harmony.settings.common import *
DEBUG = False
ALLOWED_HOSTS = ['.fas.harvard.edu'] # Required when Debug=False
FORCE_SCRIPT_NAME = None
STATIC_URL = '/static/'
# Configuration specific to shared hosting PROD/DEV environments
# PRODUCTION
if os.environ.get('SERVER_NAME') == 'harmonylab.fas.harvard.edu'... | {
"content_hash": "6debd7f42b06cad843f682a5e3a69a75",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 89,
"avg_line_length": 36.542857142857144,
"alnum_prop": 0.7185301016419078,
"repo_name": "Harvard-ATG/HarmonyLab",
"id": "6a71ec809890947c3cf7a276f84b88eedd55536f",
"size"... |
from __future__ import unicode_literals
import copy
import sys
from functools import update_wrapper
from django.utils.six.moves import zip
import django.db.models.manager # Imported to register signal handler.
from django.conf import settings
from django.core.exceptions import (ObjectDoesNotExist,
MultipleObject... | {
"content_hash": "cf83eb506cc4a13bf3290da25a0f0eff",
"timestamp": "",
"source": "github",
"line_count": 1024,
"max_line_length": 166,
"avg_line_length": 43.7890625,
"alnum_prop": 0.5698037466547725,
"repo_name": "eltonsantos/django",
"id": "7a8eece462d7e4c48e5f1d777e7034c6935d23d7",
"size": "44840"... |
from __future__ import print_function
import collections
import contextlib
import six
import sys
__all__ = ['generate', 'switch', 'guard']
class UniqueNameGenerator(object):
"""
Generate unique name with prefix.
Args:
prefix(str): The generated name prefix. All generated name will be
... | {
"content_hash": "5be6fc730fa0ee8909ef9763c13ee21f",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 74,
"avg_line_length": 22.984615384615385,
"alnum_prop": 0.6258366800535475,
"repo_name": "reyoung/Paddle",
"id": "b9957a699e597898bee75ce0e7283f7224293f0c",
"size": "2107"... |
"""
Test suite for pptx.oxml.__init__.py module, primarily XML parser-related.
"""
from __future__ import print_function, unicode_literals
import pytest
from lxml import etree
from pptx.oxml import (
oxml_parser, parse_xml, register_element_cls
)
from pptx.oxml.ns import qn
from pptx.oxml.xmlchemy import BaseOx... | {
"content_hash": "ddda3f2a7b1bc71f93a534c154f11c53",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 77,
"avg_line_length": 28.607142857142858,
"alnum_prop": 0.630461922596754,
"repo_name": "kevingu1003/python-pptx",
"id": "28c5f9bc51b660a5570df4db52f0eca81a70d458",
"size... |
import tests.periodicities.period_test as per
per.buildModel((60 , 'T' , 200));
| {
"content_hash": "dd31180970b43340631f5a650af97279",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 20.5,
"alnum_prop": 0.7073170731707317,
"repo_name": "antoinecarme/pyaf",
"id": "d3f9a449ae8d60bcc388d2c4d71341684c7561c3",
"size": "82",
"binary": ... |
import os
import twisted
import six
from twisted.trial import unittest
from twisted.protocols.policies import WrappingFactory
from twisted.python.filepath import FilePath
from twisted.internet import reactor, defer, error
from twisted.web import server, static, util, resource
from twisted.web.test.test_webclient impor... | {
"content_hash": "dfbdd669235e7221bf23c177e38d1a13",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 119,
"avg_line_length": 40.97704918032787,
"alnum_prop": 0.6443831012962074,
"repo_name": "yarikoptic/scrapy",
"id": "d2a349b40fa863abeba79d67419c3ec224498457",
"size": "2... |
from django.contrib import admin
from oscar.core.loading import get_model
from treebeard.admin import TreeAdmin
AttributeOption = get_model('catalogue', 'AttributeOption')
AttributeOptionGroup = get_model('catalogue', 'AttributeOptionGroup')
Category = get_model('catalogue', 'Category')
Option = get_model('catalogue',... | {
"content_hash": "45b918a1ff67953e4c294e0529646157",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 76,
"avg_line_length": 31.337349397590362,
"alnum_prop": 0.7627835447904652,
"repo_name": "kapt/django-oscar",
"id": "130054aaa1a211eba14e5df86a89990c79986240",
"size": "26... |
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str
import logging, sys, signal, subprocess, types, time, os, codecs, platform
string_types = str,
global logger
global stdout
global stderr
global timing
global log_command
logger = None
stdout = False
stderr = False
... | {
"content_hash": "a700be8bcf1614181191ec4bb7b9d03b",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 154,
"avg_line_length": 39.76851851851852,
"alnum_prop": 0.5443538998835855,
"repo_name": "babsey/sumatra",
"id": "a2123083f30d18e407eb74263f146d72fa55507c",
"size": "8679... |
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | {
"content_hash": "db548de4699cea9720065ac87454cf0e",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 77,
"avg_line_length": 26.074074074074073,
"alnum_prop": 0.5577651515151515,
"repo_name": "jlongever/redfish-client-python",
"id": "58aea6b2092cea8aeb131e266951331de6ccc3c6"... |
from django.template import Library
import math
register = Library()
@register.filter
def absolute(x):
return abs(x)
@register.filter
def subtract(x, y):
return x - y
@register.filter
def multiply(x, y):
return x * y
@register.filter
def divide(x, y):
return x / y
@register.filter
def idivid... | {
"content_hash": "15c8ae6d90b422908868a8b0cd6f81cb",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 35,
"avg_line_length": 12.46938775510204,
"alnum_prop": 0.5810147299509002,
"repo_name": "dezede/dezede",
"id": "7c04efa58ff49157a6ad04d398e01e2591e61e67",
"size": "611",
... |
import sys
sys.path.insert(1, "../../../")
import h2o
def binop_star(ip,port):
iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader.csv"))
rows, cols = iris.dim
iris.show()
#frame/scaler
res = iris * 99
res_rows, res_cols = res.dim
assert res_rows == rows and res_... | {
"content_hash": "9d5cefb1b1646fdf0ef8260ae1d29a57",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 97,
"avg_line_length": 28.2,
"alnum_prop": 0.5859247135842881,
"repo_name": "PawarPawan/h2o-v3",
"id": "0ee89400aebba6deff9b8fe725d1f144bd77d7a0",
"size": "1833",
"binary... |
import chainer
import chainer.testing
import chainer.utils
import mpi4py.MPI
import numpy
import pytest
from chainermn.communicators.naive_communicator import NaiveCommunicator
from chainermn.communicators.pure_nccl_communicator import PureNcclCommunicator
from chainermn.links import MultiNodeBatchNormalization
from c... | {
"content_hash": "e49a426d91cc329caf7c2602390c3ee7",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 79,
"avg_line_length": 35.881410256410255,
"alnum_prop": 0.629477445288075,
"repo_name": "keisuke-umezawa/chainer",
"id": "df7b0c6d4ea0ac7ca3df9372f24853952d820e09",
"size... |
from testutils import mock
import errno
import sys
from rbuild_test import rbuildhelp
from rbuild.internal import main
from rbuild import handle
from rbuild import errors
from rbuild import rbuildcfg
from rmake import errors as rmakeerrors
class MainTest(rbuildhelp.RbuildHelper):
def testExceptions(self):
... | {
"content_hash": "a48f09afc07d2034b39c847316f32af5",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 312,
"avg_line_length": 40.239766081871345,
"alnum_prop": 0.6068885336433658,
"repo_name": "fedora-conary/rbuild",
"id": "0722b21c25fe327fe1b03725942be1bc5c68aad6",
"size"... |
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound
from framework.auth.oauth_scopes import CoreScopes
from website.project.model import Q, Node
from api.base import permissions as base_permissions
from api.base.views import JSONAPIBaseVie... | {
"content_hash": "a3af75c67ea757a7a8d157a22c52e937",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 130,
"avg_line_length": 43.095238095238095,
"alnum_prop": 0.6713812154696133,
"repo_name": "billyhunt/osf.io",
"id": "5f3499b917fb48f43b86dd8157c8f74816296219",
"size": "1... |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_batch_iv_analysis(object):
def setupUi(self, batch_iv_analysis):
batch_iv_analysis.setObjectName("batch_iv_analysis")
batch_iv_analysis.resize(847, 809)
self.centralwidget = QtWidgets.QWidget(batch_iv_analysis)
self.centralwidget.s... | {
"content_hash": "fac775860942f8a622ac295a771b478a",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 208,
"avg_line_length": 67.61309523809524,
"alnum_prop": 0.71564398274496,
"repo_name": "greysAcademicCode/batch-iv-analysis",
"id": "b05c65fbbc38d0d6e7c65d3bd119b404ce68c02... |
from abc import abstractmethod
class RiverDriver(object):
def __init__(self, workflow, wokflow_object_class, field_name):
self.workflow = workflow
self.wokflow_object_class = wokflow_object_class
self.field_name = field_name
self._cached_workflow = None
@abstractmethod
de... | {
"content_hash": "9787a1295758fe122f5827f3d11c9f65",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 28.428571428571427,
"alnum_prop": 0.6809045226130653,
"repo_name": "javrasya/django-river",
"id": "b22cee213236ef79258346396b9b0e640017d870",
"size":... |
from tempest.api.compute import base
from tempest import exceptions
from tempest.test import attr
class ServicesAdminV3TestJSON(base.BaseV3ComputeAdminTest):
"""
Tests Services API. List and Enable/Disable require admin privileges.
"""
_interface = 'json'
@classmethod
def setUpClass(cls):
... | {
"content_hash": "9f5e396b7ceafe17913f446304ba1b73",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 75,
"avg_line_length": 39.333333333333336,
"alnum_prop": 0.6375488917861799,
"repo_name": "eltonkevani/tempest_el_env",
"id": "67f9947ce6b5155e613b28445a4900acbef3a6e5",
"... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | {
"content_hash": "8549f2aac0a09a8537c3fb65e1ebffc1",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 207,
"avg_line_length": 44.90350877192982,
"alnum_prop": 0.6454385622191834,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d27783f71dc1fe5a1b53d2ff6174c181d61ccae4",
"... |
from __future__ import unicode_literals
from django.db import models
# Create your models here.
from pygments.lexers import get_all_lexers
from pygments.styles import get_all_styles
from pygments.lexers import get_lexer_by_name
from pygments.formatters.html import HtmlFormatter
from pygments import highlight
LEXERS... | {
"content_hash": "64bd5eaac7c987f8951093825d8b9424",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 93,
"avg_line_length": 39.90243902439025,
"alnum_prop": 0.6839853300733496,
"repo_name": "Yogi1994/django-rest-tutorial",
"id": "2b184e7b9242fe94f2edf36d4c7f5b6554bb6001",
... |
"""
a routine to run a nested sampling class
"""
import cPickle as pickle
import copy
def save_replicas_to_binary(fout, ns):
checkpoint = {}
checkpoint['replicas'] = ns.replicas
checkpoint['iter_number'] = ns.iter_number
checkpoint['failed_mc_walks'] = ns.failed_mc_walks
checkpoint['_mc_niter'] = n... | {
"content_hash": "4b20fbc0581d1e5639ace7723cebe71b",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 84,
"avg_line_length": 31.54368932038835,
"alnum_prop": 0.6183441058787319,
"repo_name": "js850/nested_sampling",
"id": "d7b42b9023ec8e8a8e9ff721c6a8ab43f31c8fd8",
"size":... |
import json
import urllib
import datetime
import sys
import base64
from pprint import pprint
from bs4 import BeautifulSoup
from nltk.corpus import stopwords
reload(sys)
sys.setdefaultencoding("utf-8")
html = urllib.urlopen('http://theguardian.co.uk')
soup = BeautifulSoup(html)
spans = soup.find_all('div', attrs={'c... | {
"content_hash": "4af6bc570e5b16bc65161f4264e80e88",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 98,
"avg_line_length": 23.08,
"alnum_prop": 0.6880415944540728,
"repo_name": "maddyloo/miniBibServer",
"id": "e53d8f7936033ea21aa584836df493005183d8ae",
"size": "617",
"b... |
##########################################################################
#
# Copyright 2011 Jose Fonseca
# Copyright 2008-2010 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... | {
"content_hash": "6ddc4455501de7301cda0bb32a8c61e9",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 122,
"avg_line_length": 35.716,
"alnum_prop": 0.5627729868966289,
"repo_name": "PeterLValve/apitrace",
"id": "568eb1a129ad3db1d8d38e806c87abbe1efddd68",
"size": "8929",
... |
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... | {
"content_hash": "1541a3b15587a719002b93d8c33b0fb2",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 76,
"avg_line_length": 26.236842105263158,
"alnum_prop": 0.5577983951855566,
"repo_name": "mwhooker/jones",
"id": "1dc604f2766e318347b301a785f986da9cfb787f",
"size": "7976... |
from django.core.exceptions import ValidationError
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtail.wagtailsnippets.models import register_snippet
@register_sni... | {
"content_hash": "9b695c737f019c99d757abc75e3e7b90",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 107,
"avg_line_length": 35.92857142857143,
"alnum_prop": 0.6481113320079522,
"repo_name": "apihackers/wapps",
"id": "15f28daaf1f01188f93ac95b36b9c9540493745f",
"size": "150... |
from . import core as html5
@html5.tag
class Label(html5.Label):
_parserTagName = "ignite-label"
def __init__(self, *args, **kwargs):
super(Label, self).__init__(style="label ignt-label", *args, **kwargs)
@html5.tag
class Input(html5.Input):
_parserTagName = "ignite-input"
def __init__(self, *args, **kwargs... | {
"content_hash": "e3819451cb4d33e589bd3960a81aee38",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 104,
"avg_line_length": 25.643243243243244,
"alnum_prop": 0.6736930860033726,
"repo_name": "erezsh/lark",
"id": "61c10a068eeffcd6b5751ab1b079e1d1a5fd7f59",
"size": "4768",... |
''' Provides the ``ServerSession`` class.
'''
from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
import time
from tornado import gen, locks
from ..util.tornado import yield_for_all_futures
from .callbacks import _DocumentCallbackGroup
def current_time():
'''Return the tim... | {
"content_hash": "4a4cbf479bef89bc9f9529f301b12285",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 152,
"avg_line_length": 37.01327433628319,
"alnum_prop": 0.6411237298266587,
"repo_name": "aiguofer/bokeh",
"id": "4ecf24bef33efa78993713c6c7292570a4ce30df",
"size": "8365... |
import sys
import json
import requests
import socket
import md5
from os.path import getmtime
from time import time
from tempfile import gettempdir
nodeName = socket.gethostname()
#print nodeName
url = 'http://127.0.0.1:8500/v1/health/node/{0}'.format(nodeName)
#print url
CACHE_TIMEOUT=60
TEMP_FILE_NAME="{}/consul-z... | {
"content_hash": "23adc19c682ca890e806791fb4410979",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 72,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.6094377510040161,
"repo_name": "Zoomdata/zoomdata-tools",
"id": "edff39d50deb8ae74378544f0a072a742a010b66",
"size"... |
"""Data generators for translation data-sets."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.data_generators import problem
from tensor2tensor.data_generators import text_encoder
from tensor2tensor.data_generators import text_problems
... | {
"content_hash": "27b37362b627b805dc5def741f0d010e",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 125,
"avg_line_length": 27.401785714285715,
"alnum_prop": 0.7194525904203324,
"repo_name": "tensorflow/tensor2tensor",
"id": "f4a7f2199e69372822379d693a88509932d66f18",
"s... |
import logging
from django.contrib.auth import authenticate
from rest_framework.exceptions import AuthenticationFailed
from tsbp import consts
from tsbp_auth import models
from tsbp_core import models as core, exceptions
from tsbp_core.processors import AbstractProcessor
signup_logger = logging.getLogger('tsbp_auth.... | {
"content_hash": "11289a0aa03c05867bb7717124dd9799",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 110,
"avg_line_length": 46.12765957446808,
"alnum_prop": 0.7260147601476015,
"repo_name": "lvercelli/pytsbp",
"id": "358fedeb4970b0330e9116858fcd3e73ef53a87a",
"size": "217... |
class StopCommand(RuntimeError):
"""
An exception that can be raise to halt the execution of a command, marking
a user error somewhere.
"""
pass
class StopCommandWithHelp(StopCommand):
"""
A convinience StopCommandException which contains the plugin help as the
message.
"""
def... | {
"content_hash": "f715af53bb7fc0fe1acd326f487726eb",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 25.866666666666667,
"alnum_prop": 0.654639175257732,
"repo_name": "Cyanogenoid/smartbot",
"id": "4bf3f45b35facd724a3a2057fb6ccc2df1d1ddc7",
"size": "... |
"""Sends the password over a socket to askpass.
"""
import errno
import getpass
import os
import socket
import sys
import tempfile
import textwrap
from psshlib import psshutil
class PasswordServer(object):
"""Listens on a UNIX domain socket for password requests."""
def __init__(self):
self.sock = N... | {
"content_hash": "ee8a41c6f4fd6e45e6e9a5dd5e9b78b6",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 76,
"avg_line_length": 30.020833333333332,
"alnum_prop": 0.5700902151283831,
"repo_name": "krig/parallel-ssh",
"id": "a2f38d3cf764fc29ede27921b8dc6f505e352c6b",
"size": "29... |
"""
This module implements error handlers for Nwchem runs. Currently tested only
for B3LYP DFT jobs.
"""
from pymatgen.io.nwchem import NwInput, NwOutput
from custodian.ansible.interpreter import Modder
from custodian.custodian import ErrorHandler
from custodian.utils import backup
class NwchemErrorHandler(ErrorHan... | {
"content_hash": "8abde67d106a1157c190cf00628b15ad",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 90,
"avg_line_length": 34.955555555555556,
"alnum_prop": 0.5432294977749523,
"repo_name": "materialsproject/custodian",
"id": "8fc789a47974444f5b7a6cdad95d4593ba7a3f22",
"s... |
from __future__ import print_function
import json
import os.path
import time
from datetime import datetime, timedelta
import soco
from MusicLogging import MusicLogging
def str2bool(v):
return v in ("yes", "true", "t", "1", "Yes", "True", True)
class SonosController(object):
def __init__(self, dayVol=25, ni... | {
"content_hash": "2b338a7946974289f84a57e2af25c778",
"timestamp": "",
"source": "github",
"line_count": 444,
"max_line_length": 134,
"avg_line_length": 35.13513513513514,
"alnum_prop": 0.5527564102564102,
"repo_name": "clemenstyp/music-on-blocks",
"id": "4708d0cb4db19fa51a56e7acf142c03990e0bb9f",
"... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Moniter
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Specials.Simulaters.Populater"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Representer"
SYS.setSubModule(... | {
"content_hash": "0f333c2e276515bd1a3be1fd761e6d55",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 84,
"avg_line_length": 22.582089552238806,
"alnum_prop": 0.729676140118969,
"repo_name": "Ledoux/ShareYourSystem",
"id": "1ea462b9cfc2af201b965b3330803a65cbce3eff",
"size":... |
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires... | {
"content_hash": "e148654ab7539407a3b535e7a2e66b2e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 68,
"avg_line_length": 26.5,
"alnum_prop": 0.7169811320754716,
"repo_name": "dwmarshall/pycontribs-jira",
"id": "405bf85f98d53998b964ed906b02fc1eac99d63c",
"size": "393",
... |
import boto3
import time
class EC2:
def __init__(self, access_key_id, secret_access_key, region_name='sa-east-1', **kwargs):
self._client = boto3.client(
'ec2',
region_name=region_name,
aws_access_key_id=access_key_id,
aws_secret_access_key=secret_access_... | {
"content_hash": "1b890576f48c0dd27674390d7ab0f5e7",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 92,
"avg_line_length": 35.78125,
"alnum_prop": 0.597962154294032,
"repo_name": "w2srobinho/aws-curioh",
"id": "17d01a50772a85dab5bc90cc754247448670ed6c",
"size": "3435",
... |
"""
Implementation of an auto-vivified dict.
"""
class AutovivifiedDict(dict):
'''
Implementation of an auto-vivified dict.
Auto-vivified objects will automatically create a new object of type(self)
when a user queries for a missing key.
Based on: http://stackoverflow.com/a/6781411/577199
>... | {
"content_hash": "3cb28e669d61eac80971aa1bbe4f26e5",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 78,
"avg_line_length": 23.862068965517242,
"alnum_prop": 0.596820809248555,
"repo_name": "Ceasar/trees",
"id": "4295f60e5309de48bc01520181aea4d1639d95db",
"size": "692",
... |
"""
Django settings for ocrDoacao project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | {
"content_hash": "053c986dd60c9160dbb26d70f2337e39",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 75,
"avg_line_length": 26.61320754716981,
"alnum_prop": 0.6816731655441333,
"repo_name": "ocr-doacao/ocr",
"id": "423574660b73da84b07afdaee3a75c05e4593770",
"size": "2821"... |
from .base import SimIRExpr
class SimIRExpr_ITE(SimIRExpr):
def _execute(self):
cond = self._translate_expr(self._expr.cond)
expr0 = self._translate_expr(self._expr.iffalse)
exprX = self._translate_expr(self._expr.iftrue)
self.expr = self.state.se.If(cond.expr == 0, expr0.expr, exp... | {
"content_hash": "745fb73e95824d43332432327cb3410e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 76,
"avg_line_length": 36.55555555555556,
"alnum_prop": 0.6595744680851063,
"repo_name": "axt/angr",
"id": "3237f0b541bc0eaa55d416f7d163bdffecbc67b4",
"size": "329",
"bina... |
"""
Estimate pi using a Monte Carlo method with distarray.
"""
from __future__ import division, print_function
from util import timer
from distarray.globalapi import Context, Distribution, hypot
from distarray.globalapi.random import Random
context = Context()
random = Random(context)
@timer
def calc_pi(n):
... | {
"content_hash": "2d8aec05e11f179b9dadbfd0c31040e3",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 71,
"avg_line_length": 26.5609756097561,
"alnum_prop": 0.6437098255280074,
"repo_name": "RaoUmer/distarray",
"id": "5a9e657a0b127310ecf77c5ca65a7b19c924f9c6",
"size": "1406... |
import unittest
import pybles
import os
class ParseTableTest(unittest.TestCase):
def test_parse_table(self):
pyble = pybles.PybleParser()
self.assertRaises(pybles.ParseError, pyble.parse_string, "")
config = "filter {}"
pyble.parse_string(config)
config = "filter ... | {
"content_hash": "1913e43150ca4a5536d057418e7ea993",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 118,
"avg_line_length": 32.19642857142857,
"alnum_prop": 0.5867997781475319,
"repo_name": "abates/pybles",
"id": "c90437a196a4f769cf76fcc2d59f331cff74a144",
"size": "2380",... |
import numpy as np
import cv2
def all_structures(data):
""" Calculates all structures for the principal component projections. Runs k-means a number of times and
saves the result with lowest distortion.
:param data: Data set.
"""
images, pc_projections, pcs = data.pca.load()
pc_projectio... | {
"content_hash": "bb249c8e00642e9798b9c2efef0bc35e",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 115,
"avg_line_length": 33,
"alnum_prop": 0.6732323232323232,
"repo_name": "oscarlorentzon/repstruct",
"id": "1644d3991188b36f8d13b8f7248ef0f398a6c5f2",
"size": "1980",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.