text
stringlengths
4
1.02M
meta
dict
""" We have four main abstractions: Users, Collections, Memberships, and Roles. Users represent people, like students in a school, teachers for a classroom, or volunteers setting up informal installations. There are two main user types, ``FacilityUser`` and ``DeviceOwner``. A ``FacilityUser`` belongs to a particular f...
{ "content_hash": "7b1e0df970e21a1aa5470c448592a24e", "timestamp": "", "source": "github", "line_count": 1087, "max_line_length": 144, "avg_line_length": 42.889604415823364, "alnum_prop": 0.6760901739559426, "repo_name": "rtibbles/kolibri", "id": "a45e96a3989e5172e2d50394d15f08111186a721", "size": "...
class PageViewCount: __slots__ = ('project', 'page_name', 'views', 'bytes_returned') def __init__(self, project, page_name, views, bytes_returned): self.project = str(project) self.page_name = str(page_name) self.views = int(views) self.bytes_returned = int(bytes_returned) ...
{ "content_hash": "170f04c7368fe9c9862ab7d71f4b70fc", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 35.291666666666664, "alnum_prop": 0.5844155844155844, "repo_name": "mediawiki-utilities/python-mwviews", "id": "adee3a9bae8385cead92c919c4c0b012ed6ba1e...
""" kombu.common ============ Common Utilities. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from __future__ import with_statement import socket import sys from collections import defaultdict, deque from functools import partial f...
{ "content_hash": "7b57fb6680bff260621e0bf89a6753fb", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 77, "avg_line_length": 33.56, "alnum_prop": 0.6195470798569725, "repo_name": "kumar303/rockit", "id": "f16c38832b0050f116782077291827e5d279384b", "size": "8390", "binary...
import os import copy import glob import json import logging from pupa.exceptions import DuplicateItemError from pupa.utils import get_pseudo_id, combine_dicts, utcnow from opencivicdata.models import LegislativeSession from pupa.exceptions import UnresolvedIdError, DataImportError def omnihash(obj): """ recursiv...
{ "content_hash": "a89b036a9d591135a7165a0249d141c0", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 99, "avg_line_length": 37.87771739130435, "alnum_prop": 0.5343998852141474, "repo_name": "influence-usa/pupa", "id": "bcae2a113fea3cdd9f3c7f6db4308e862d98287c", "size": "1...
""" IxNetwork package tests that require actual IxNetwork chassis and active ports. Note that in many places there are (relatively) long delays to make sure the tests work in all setups. Test setup: Two IXN ports connected back to back. @author yoram@ignissoft.com """ import json import time from ixnetwork.test.t...
{ "content_hash": "5aaf2041808646494abe2129677ec4b8", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 110, "avg_line_length": 35.50413223140496, "alnum_prop": 0.6277932960893855, "repo_name": "shmir/IxNetwork", "id": "a2df99880b661f904e108e5bda5a01ebc756b586", "size": "429...
import eventlet import errno import imp import logging import os import os.path import sys from daemon.daemon import DaemonContext from daemon.runner import DaemonRunner, make_pidlockfile from django.conf import settings as django_settings from django.core.management import call_command from eventlet import wsgi from ...
{ "content_hash": "a69b71ed896298caf1046b66091fae26", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 111, "avg_line_length": 37.242753623188406, "alnum_prop": 0.609981515711645, "repo_name": "m0sth8/django-sentry", "id": "a2b9c3fcf925b0f3e4fac62ea181de530c2b979d", "size":...
from collections import OrderedDict import copy import pytest from zenconf import MergedConfig, walk_recursive class TestMergedConfig(object): PREFIX = "TEST" DEFAULTS = { 'logging': { 'version': 1, 'loggers': { 'MYAPP': { '-handlers': ['sy...
{ "content_hash": "ec9de1b0b3781dfa6088e0316a3b6360", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 80, "avg_line_length": 33.153153153153156, "alnum_prop": 0.4922554347826087, "repo_name": "nws-cip/zenconf", "id": "0d8990eac10413a98279b94089f65ca7d3b0b87a", "size": "736...
"""List changes starred by one's account""" # pylint: disable=invalid-name import argparse import logging from libpycr.exceptions import PyCRError from libpycr.gerrit.client import Gerrit from libpycr.meta import GerritAccountBuiltin from libpycr.pager import Pager from libpycr.utils.commandline import expect_accoun...
{ "content_hash": "e92ed772a08589d88b2dc74748928c99", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 74, "avg_line_length": 27.670731707317074, "alnum_prop": 0.6535918907007492, "repo_name": "JcDelay/pycr", "id": "53187548a310b4b3c0356f53dfc466d1f55efafd", "size": "2269", ...
from module_kits.vtk_kit.utils import DVOrientationWidget import operator import vtk import wx class OverlaySliceViewer: """Class for viewing 3D binary masks in a slice-view. Supports arbitrary number of overlays in user-definable colours. """ has_active_slices = False def __init__(...
{ "content_hash": "32828c31898ca0f2ba12259e8af1db84", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 144, "avg_line_length": 38.96071428571429, "alnum_prop": 0.5276377303144193, "repo_name": "nagyistoce/devide", "id": "f780c1402a4620c42ac9c26c5ea83a9d40346d80", "size": "1...
""" Mesh stuff. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from ext_utils.meshzoo import iso_sphere import pdb def create_sphere(n_subdivide=3): # 3 makes 642 verts, 1280 faces, # 4 makes 2562 verts, 5120 faces verts...
{ "content_hash": "c1714c2f4f106934211a8445a103ff4e", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 113, "avg_line_length": 37.07818930041152, "alnum_prop": 0.5918978912319645, "repo_name": "google/lasr", "id": "9472b90da036114e6517a35686473f94c73cc0e7", "size": "10169",...
from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.ofproto import ofproto_v1_3 from ryu.lib.packet import packet from ryu.lib.packet import ethernet class SimpleSwitch13(app_...
{ "content_hash": "0202344f84cce6a2cefaf4590f0123cb", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 39.554455445544555, "alnum_prop": 0.5932415519399249, "repo_name": "luigiponti/laureatriennale", "id": "9f412ebd4249c31fb14db848103614cf0d361cb1", "...
''' Created on Feb 24, 2013 @author: nino ''' import unittest from marx.workflow.context import DefaultContext, Field from marx.workflow.exceptions import InvalidContextAssignment import nose.tools class TestField(unittest.TestCase): def test1(self): class Context(DefaultContext): user = Fiel...
{ "content_hash": "84b56467333da2ef76b6b14db1ddef1e", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 84, "avg_line_length": 25.20754716981132, "alnum_prop": 0.5860778443113772, "repo_name": "escherba/marx", "id": "ad6e6a6240fda5fe5445207d1a561b112d5536c1", "size": "1336", ...
import pytest from osf_tests.factories import SubjectFactory class ProviderMixinBase(object): @property def provider_class(self): raise NotImplementedError @pytest.mark.django_db class ProviderExistsMixin(ProviderMixinBase): # Regression for https://openscience.atlassian.net/browse/OSF-7621 @...
{ "content_hash": "f93818d5b92c4d9c3701d9966fbff21a", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 108, "avg_line_length": 32.24688796680498, "alnum_prop": 0.5472559994852988, "repo_name": "icereval/osf.io", "id": "8f19f53f1d00a8b43b5ad9293f669c20414b3aae", "size": "155...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # 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...
{ "content_hash": "e393329a310c364565472138788c4da3", "timestamp": "", "source": "github", "line_count": 1234, "max_line_length": 176, "avg_line_length": 39.78606158833063, "alnum_prop": 0.5868502525664006, "repo_name": "googleapis/python-apigee-registry", "id": "3cde044c65e927f31ad7be42c10a13a3bdb91c...
import re from bs4 import BeautifulSoup from hashlib import md5 from database import Database from config import MONGO_SETTINGS # Spider Factory def spider(): def callback(webPage): url, pageSource = webPage.getDatas() soup = BeautifulSoup(pageSource) #tmp var _ = '' #more ...
{ "content_hash": "290a92cf9a7554c2da8e3c974cece5c6", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 92, "avg_line_length": 28.271604938271604, "alnum_prop": 0.5139737991266375, "repo_name": "zhkzyth/a-super-fast-crawler", "id": "a205ecc783609a20fcf2b9beffbb3ac7b5f6900b", ...
from __future__ import absolute_import from __future__ import unicode_literals from setuptools import find_packages from setuptools import setup import codecs with codecs.open('LICENSE.txt', 'r', 'utf8') as lf: license_str = lf.read() with codecs.open('README.rst', 'r', 'utf8') as rf: long_description_str =...
{ "content_hash": "f773060cfe02d8e39a8f712fe7b4b72d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 26.114285714285714, "alnum_prop": 0.6695842450765864, "repo_name": "selassid/canopener", "id": "6aba69452602c04f999876366f02ddf58f2c1587", "size": "9...
import datetime from oslo_utils import fixture as utils_fixture from nova.api.openstack.compute import instance_usage_audit_log as v21_ial from nova import context from nova import test from nova.tests.unit.api.openstack import fakes from nova.tests.unit.objects import test_service service_base = test_service.fake_...
{ "content_hash": "055b8b2092459799c7ee918ed4655d74", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 79, "avg_line_length": 41.50877192982456, "alnum_prop": 0.6238377007607777, "repo_name": "openstack/nova", "id": "9ff09bd40c45bc9223bfe8fe6304012948369819", "size": "7738"...
""" homeassistant.keyboard ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to emulate keyboard presses on host machine. """ import logging from homeassistant.const import ( SERVICE_VOLUME_UP, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE, SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PREV_TRACK, SERVICE_MED...
{ "content_hash": "717694e128f989a61f6d089e57ed1191", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 75, "avg_line_length": 30.151162790697676, "alnum_prop": 0.6209024296182029, "repo_name": "Jaidan/jaidan-hab-home-assistant", "id": "8e820856c343cb16845aa731c649ec9fdb9e0d9d"...
""" Net graph. """ import networkx as nx __all__ = [ 'pn_graph', ] def _make_input_arc_label(arc_name, arc_config): arc_class = arc_config["class"] if arc_class == "Variable": return arc_config["name"] elif arc_class == "VariableTest": return "[{}]".format(arc_config["name"]) eli...
{ "content_hash": "1fc569f05c68a9258448437c57d62602", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 85, "avg_line_length": 31.246376811594203, "alnum_prop": 0.5960111317254174, "repo_name": "simone-campagna/pnets", "id": "0edda9e6b4398baa6cb5dfd0f0ab60161a85731c", "size":...
import urlparse from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker def parse_pgurl(db_url): """ Given a SQLAlchemy-compatible Postgres url, return a dict with keys for user, password, host, port, and database. """ parsed = urlparse.urlsplit(db_url) return { '...
{ "content_hash": "73f2450f061a27b71ef551670fb46ee7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 27.272727272727273, "alnum_prop": 0.66, "repo_name": "yougov/mettle", "id": "c60c34cc13420259b6bdb71a4a56fcf77406fa54", "size": "600", "binary": fa...
''' Test script for security-check.py ''' import subprocess import unittest def write_testcode(filename): with open(filename, 'w', encoding="utf8") as f: f.write(''' #include <stdio.h> int main() { printf("the quick brown fox jumps over the lazy god\\n"); return 0; } '''...
{ "content_hash": "4a5ce30069a0515a6c8e972a2969dfac", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 158, "avg_line_length": 48.41891891891892, "alnum_prop": 0.6089868825006978, "repo_name": "ahmedbodi/vertcoin", "id": "e2a8154f16da62c7d7364b55fefc53731d940945", "size": "3...
import os, requests, json, string, datetime, csv import randr, nlc # ------------------------------------------------ # GLOBAL VARIABLES (Set from ENV Variables)------- # Dialog and classifier # -- defaults for testing DIALOG_ID = 'xxxx' DIALOG_USERNAME = 'xxxx' DIALOG_PASSWORD = 'xxxx' # -- overwrites by env variable...
{ "content_hash": "78aadd24dc6576b19e7998d4cfefa90b", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 106, "avg_line_length": 39.68421052631579, "alnum_prop": 0.6489832007073386, "repo_name": "cackerso/virual-agent-lab", "id": "f5f9dee801587cf683923285ac211eea24dab8e2", "si...
from functools import wraps import inspect import sys from .dogpile import cache_get from .dogpile import cache_set PY3 = sys.version_info[0] == 3 def default_key_fun_impl(fun, *args, **kwargs): name = fun.__name__ mod = fun.__module__ call_args = inspect.getcallargs(fun, *args, **kwargs) return "%...
{ "content_hash": "d93362592774e35dcd7be616c6231a93", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 76, "avg_line_length": 26.2, "alnum_prop": 0.5290076335877862, "repo_name": "ryankanno/django-utilities", "id": "53ea8f91c30fb8d5fc6d5f87f3e29f7051d2f29c", "size": "1310", ...
from panda3d.core import NodePath, TextNode from direct.interval.IntervalGlobal import LerpFunctionInterval from direct.gui.DirectGui import DirectLabel, DirectFrame, DGG from direct.showbase.PythonUtil import bound as clamp from toontown.toonbase import ToontownGlobals import CogdoUtil import CogdoFlyingGameGlob...
{ "content_hash": "67f07f733c5b7679381b7aa001e349ca", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 375, "avg_line_length": 41.00990099009901, "alnum_prop": 0.6243360695316272, "repo_name": "DedMemez/ODS-August-2017", "id": "75a0694be35da704601464c9b136baa62895a9df", "si...
from __future__ import unicode_literals from kivy.uix.screenmanager import Screen from kivy.adapters.dictadapter import DictAdapter from kivy.uix.listview import ListView from kivy.uix.textinput import TextInput from ..data_provider import load_stations class SelectStationWindow(Screen): def __init__(self, **kwa...
{ "content_hash": "5eccd60652c697c471fcfae811ea53f9", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 133, "avg_line_length": 37.35087719298246, "alnum_prop": 0.6171911695631752, "repo_name": "vitaliibaz/uz-train-schedule", "id": "1737472fb3daf863788703f05679b7cb412512d5", ...
""" Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] is at most t and the difference between i and j is at most k. """ class Solution: # @param {integer[]} nums # @param {integer} k # @param {integer} t ...
{ "content_hash": "b098a65fa5c3f826451daf782dbc06a7", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 77, "avg_line_length": 32.03703703703704, "alnum_prop": 0.5572254335260116, "repo_name": "fantuanmianshi/Daily", "id": "0c82031847fd9c3b2c49a43f13081b33c0b75dd0", "size": "...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_container_plain_s04.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "750232cc65866c3fa2e7155bd4540e28", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 23.384615384615383, "alnum_prop": 0.6907894736842105, "repo_name": "anhstudios/swganh", "id": "853788b11bfa2c91095cd2850bf29c7225ba5e7b", "size": "44...
import argparse from collections import OrderedDict from datetime import datetime import json import os import subprocess import sys from bs4 import BeautifulSoup import requests import yaml CONFIG_PATH = "{}/.config/track/config.yaml".format(os.environ['HOME']) USER_AGENT = 'Mozilla/5.0 (X11; Linux x86_64; rv:47.0) ...
{ "content_hash": "b8ed69643a7b64f3ec96b5462d939e9a", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 76, "avg_line_length": 30.519031141868513, "alnum_prop": 0.5471655328798186, "repo_name": "justinledford/track", "id": "cf5f135c0c991960f6afee0a666113b4fb121d27", "size": ...
"""Verifies that instance_links are being retrieved properly from LINKS. Verifies that app_data.json.j2 contains the instance link information""" from unittest import mock from foremast.app import SpinnakerApp @mock.patch('foremast.app.spinnaker_app.LINKS', new={'example1': 'https://example1.com'}) def test_default_i...
{ "content_hash": "a20a1cb1fbbb69f671df93a9193c7dcc", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 103, "avg_line_length": 37.21621621621622, "alnum_prop": 0.7015250544662309, "repo_name": "gogoair/foremast", "id": "61334ccbd7ea65d457b9387ece9b9b626c9994b5", "size": "137...
""" Perform Levenberg-Marquardt least-squares minimization, based on MINPACK-1. AUTHORS The original version of this software, called LMFIT, was written in FORTRAN as part of the MINPACK-1 package by XXX. Craig Markwardt converted the FORTRAN code to IDL. The information for the IDL version is: ...
{ "content_hash": "bb2ea70924ef59d924b99f17f8522949", "timestamp": "", "source": "github", "line_count": 2341, "max_line_length": 96, "avg_line_length": 33.497650576676634, "alnum_prop": 0.6661735825958326, "repo_name": "richardseifert/Hydra_pipeline", "id": "7943e581c7b4cb8342d4adc829fca8ec929a1b99",...
"""Support for (EMEA/EU-based) Honeywell TCC climate systems. Such systems include evohome, Round Thermostat, and others. """ from __future__ import annotations from datetime import datetime as dt, timedelta from http import HTTPStatus import logging import re from typing import Any import aiohttp.client_exceptions ...
{ "content_hash": "c09a6ac625484f56c07011a6d93d5eed", "timestamp": "", "source": "github", "line_count": 688, "max_line_length": 90, "avg_line_length": 36.303779069767444, "alnum_prop": 0.6061977018857349, "repo_name": "w1ll1am23/home-assistant", "id": "9c46ff430323593dc3575a82f7866c57ff8645d4", "si...
import pytest import os from test_index import CORPUSES import tempfile import shutil import pipes import ujson as json import subprocess def _validate_txt_graph(webgraph_dir): # We collect(1) so there should be only one partition webgraph_files = [f for f in os.listdir(os.path.join(webgraph_dir, "out")) if ...
{ "content_hash": "f2dc3a09aeebc1ac703b82f27842132c", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 220, "avg_line_length": 34.450819672131146, "alnum_prop": 0.6354984534856055, "repo_name": "commonsearch/cosr-back", "id": "956978bfc33aef31b81df7fc665bd8950caf25fe", "siz...
"""General purpose metrics writer interface.""" from absl import logging try: from tensorboardX import SummaryWriter # type: ignore finally: pass class Writer: """General purpose metrics writer.""" def __init__(self, logdir=''): self._writer = SummaryWriter(logdir=logdir) def __enter__(self): ...
{ "content_hash": "0301c871d68da96fc31e7d33e20412f1", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 62, "avg_line_length": 24.513513513513512, "alnum_prop": 0.619625137816979, "repo_name": "google/brax", "id": "23b0da74e3f440540dbb55acf57ac5314156e017", "size": "1491", ...
""" Author: Thomas G. Close (tclose@oist.jp) Copyright: 2012-2014 Thomas G. Close. License: This file is part of the "NineLine" package, which is released under the MIT Licence, see LICENSE for details. """ # from pype9.utils.mpi import mpi_comm import os.path import nineml import ninemlcatalog from ar...
{ "content_hash": "38a78b41d975a57795dc9fdc1039eea2", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 30.685714285714287, "alnum_prop": 0.6126629422718808, "repo_name": "tclose/PyPe9", "id": "bb58a4185990257feb95127ec72b887524c732fb", "size": "2148", ...
__author__ = 'JMwill' __contact__ = 'jmlsphere@gmail.com'
{ "content_hash": "b2363efefc849ad4a80bf8c80067ebb6", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 35, "avg_line_length": 29, "alnum_prop": 0.6206896551724138, "repo_name": "JMwill/wiki", "id": "bfaa92873c9df12a292c08ae25929016c229bd66", "size": "58", "binary": false, ...
"""Configuration parameters for the server side subsystems.""" import grr from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib.rdfvalues import crypto as rdf_crypto VERSION = grr.version() config_lib.DEFINE_integer("Source.version_major", VERSION["major"], "Major version...
{ "content_hash": "9103ce57fd463c11e9d924cefdc01d9d", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 80, "avg_line_length": 41.02893890675241, "alnum_prop": 0.6409090909090909, "repo_name": "pidydx/grr", "id": "be509d673f88d5e085c9be7bc16f2b1f1d1ef9af", "size": "12782", ...
"""Test i18n module.""" # # (C) Pywikibot team, 2007-2014 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' import sys import pywikibot from pywikibot import i18n, bot, plural from tests.aspects import unittest, TestCase, DefaultSite...
{ "content_hash": "67d4b7d0a5805044a5d1f066cc59960b", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 100, "avg_line_length": 40.65952380952381, "alnum_prop": 0.5705334660654682, "repo_name": "icyflame/batman", "id": "9ff591355bf217b0d3607b4ff167cbfdcb1c99cf", "size": "171...
""" Monitors an obiwan production run using qdo """ import os import numpy as np from glob import glob import re from collections import defaultdict from obiwan.common import dobash,writelist,get_rsdir import qdo QDO_RESULT= ['running', 'succeeded', 'failed'] def get_interm_dir(outdir,brick,rowstart, ...
{ "content_hash": "fb3e37ca52749254c9456261ac034bae", "timestamp": "", "source": "github", "line_count": 332, "max_line_length": 195, "avg_line_length": 43.29216867469879, "alnum_prop": 0.546441243999165, "repo_name": "legacysurvey/obiwan", "id": "586e2b8b673a506cd5647a761f0e5c6a8e40943a", "size": "...
import argparse import logging import psycopg2 import fplusdbinsmatch import fumlocxmlmatches import fplusdbschedulechkgroup class Script(fplusdbschedulechkgroup.Script): SQL_LAST_GROUP = 'SELECT max(group_id) from main.tournament;' def __init__(self, dsn, **kwargs): super().__init__(dsn, None, **kwargs...
{ "content_hash": "2d052d04e96d3e521640a7d19f252c0e", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 63, "avg_line_length": 22.964912280701753, "alnum_prop": 0.6562261268143621, "repo_name": "FUMBBLPlus/fplusdb_main", "id": "05a6aae806bb85c87f4d45281d292200be8f9f69", "size...
import pytest from integration_tests import AgentlessTestCase from integration_tests.tests.utils import get_resource as resource pytestmark = pytest.mark.group_dsl @pytest.mark.usefixtures('mock_workflows_plugin') @pytest.mark.usefixtures('testmockoperations_plugin') class OperationMappingTest(AgentlessTestCase): ...
{ "content_hash": "314ba35c0b30881cb8eb7f0c363e245c", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 79, "avg_line_length": 44.628571428571426, "alnum_prop": 0.6658130601792573, "repo_name": "cloudify-cosmo/cloudify-manager", "id": "940c415a88764813be6ba5b492314a77af042fa0",...
def read_config(): import os import ConfigParser config_file = os.path.join(os.environ["HOME"], ".genomicoderc") assert os.path.exists(config_file), "File not found: %s" % config_file # Read the configuration. config = ConfigParser.ConfigParser() config.optionxform = str # use case s...
{ "content_hash": "160173e68782025ef7b195ad68cf6c09", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 74, "avg_line_length": 29.6, "alnum_prop": 0.6594594594594595, "repo_name": "jefftc/changlab", "id": "56acd5ebdad28a40641751110b6f46a9c33b7442", "size": "962", "binary": ...
from predikto.client import logger # Logging logger = logger # Credential api_key_id = None # "AN_API_KEY_ID" base_url = 'http://localhost:5000' workspace_id = 'Nw6jxvZxdLy9' project_id = 'NQEaxOkxYR2l' workspace_name = 'Hamburg'
{ "content_hash": "2f060da008d50960b9683ba2d82b7e34", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 36, "avg_line_length": 15.733333333333333, "alnum_prop": 0.7161016949152542, "repo_name": "predikto/python-sdk", "id": "d9267b16ac7a7f3d76ca79cadd043b688063ae46", "size": "...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('accounts', '0016_auto_20150814_1727'), migrations.swappable_dependency(settings.AUTH_USER_MODEL...
{ "content_hash": "1821fa4632bfd0086e07f7a46c78c648", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 201, "avg_line_length": 48.07692307692308, "alnum_prop": 0.5623578947368421, "repo_name": "bharathramh92/easy-ecom", "id": "0941e983371434ed17413d80f20dc64b832e95f4", "siz...
import logging.config from pymongo.connection import Connection from tornado.options import define import tornado.httpserver import tornado.ioloop import tornado.options from pushservices.apns import * from pushservices.gcm import GCMClient from pushservices.wns import WNSClient from pushservices.mpns import MPNSClie...
{ "content_hash": "a34b5dfdb8cdad5906b17cd1f02af673", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 122, "avg_line_length": 36.88715953307393, "alnum_prop": 0.5740506329113924, "repo_name": "imolainformatica/airnotifier", "id": "f036dc33d87511d94ec4e409dd0b884ed41c6a12", ...
import itertools from collections import defaultdict import numpy as np import networkx as nx from pgmpy.factors import TabularCPD from pgmpy.base import DirectedGraph, UndirectedGraph class DynamicBayesianNetwork(DirectedGraph): def __init__(self, ebunch=None): """ Base class for Dynamic Bayesi...
{ "content_hash": "a2a6681e78ab47de7c50becee8c8c413", "timestamp": "", "source": "github", "line_count": 437, "max_line_length": 116, "avg_line_length": 39.77345537757437, "alnum_prop": 0.507910937230309, "repo_name": "pratyakshs/pgmpy", "id": "dbcbf9a8d840aa79fe1363b88fe7bc3828a8b73b", "size": "173...
from .base_settings import * # Network settings ALLOWED_HOSTS = ['api.axiologue.org', '104.236.76.8', 'api.mindful.click'] # DEBUG Tools DEBUG = False # Email settings SITE_ID = 2 EMAIL_BACKEND = 'postmark.django_backend.EmailBackend' POSTMARK_API_KEY = SECRETS['POSTMARK_KEY'] POSTMARK_SENDER = 'admin@axiologue.org'...
{ "content_hash": "05e434b6d0035597d3c94176c75a0768", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 74, "avg_line_length": 24.07894736842105, "alnum_prop": 0.5934426229508196, "repo_name": "Axiologue/AxiologueAPI", "id": "b51b566be60af8bb6b47b4bd146e67ebde1173a4", "size":...
"""This module is deprecated. Please use `airflow.gcp.operators.translate_speech`.""" import warnings # pylint: disable=unused-import from airflow.gcp.operators.translate_speech import GcpTranslateSpeechOperator # noqa warnings.warn( "This module is deprecated. Please use `airflow.gcp.operators.translate_speech...
{ "content_hash": "d6730dd5a9ed0d25459d5f73a4a75ee0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 86, "avg_line_length": 33.09090909090909, "alnum_prop": 0.7802197802197802, "repo_name": "Fokko/incubator-airflow", "id": "e84d25faf9b9e0e88007b81fdf1bb59fea135c21", "size"...
import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from news import settings as news_settings from djangobb_forum.util import convert_text_to_html from specialfields import FramedImageField class NewsItem(models.Model): ...
{ "content_hash": "9dd2988b3f3f00ec6cafe311350702df", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 189, "avg_line_length": 35.40983606557377, "alnum_prop": 0.687037037037037, "repo_name": "jokey2k/ShockGsite", "id": "17d2dd1f36b189b80e288e479775f5fd50e91cbd", "size": "21...
"""Tests for recommendation task.""" import os from absl.testing import parameterized import tensorflow.compat.v2 as tf from tensorflow_examples.lite.model_maker.core.data_util import recommendation_dataloader as _dl from tensorflow_examples.lite.model_maker.core.data_util import recommendation_testutil as _testutil ...
{ "content_hash": "dd40c55eaeb43e12b5d8079915fa141a", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 100, "avg_line_length": 35.51020408163265, "alnum_prop": 0.6853448275862069, "repo_name": "tensorflow/examples", "id": "2ec249ddccabc1f00128fb09f99b923a4871944e", "size": "...
from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Account', fields=[ ('id', models.AutoField...
{ "content_hash": "c7faac3ca1407121332c4e709a4b30ec", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 115, "avg_line_length": 40.18181818181818, "alnum_prop": 0.5708898944193062, "repo_name": "tacitia/ThoughtFlow", "id": "38b19fbbefd1b50293dda3b514b97d8a9e9b0ead", "size": "...
from threading import Thread from time import time, sleep from pymodbus.constants import Defaults from thingsboard_gateway.connectors.modbus.constants import * from thingsboard_gateway.connectors.connector import log from thingsboard_gateway.connectors.modbus.bytes_modbus_uplink_converter import BytesModbusUplinkConv...
{ "content_hash": "996e34f4ec1bfd345a530c18490d6cd5", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 112, "avg_line_length": 41.271844660194176, "alnum_prop": 0.5982121853681487, "repo_name": "thingsboard/thingsboard-gateway", "id": "9c48018a71f7889a6ca9135eaad54989fbff85b9...
""" :maintainer: Alberto Planas <aplanas@suse.com> :platform: Linux """ import salt.modules.freezer as freezer from salt.exceptions import CommandExecutionError from tests.support.mixins import LoaderModuleMockMixin from tests.support.mock import MagicMock, patch from tests.support.unit import TestCase clas...
{ "content_hash": "2f1f560b55ca071b82bd28544bf9639a", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 76, "avg_line_length": 35.83168316831683, "alnum_prop": 0.5392834116238372, "repo_name": "saltstack/salt", "id": "436ec4b7446f6369d1a4d09389248ec59c96358a", "size": "10857...
import json import time import urlparse from datetime import datetime, timedelta from django.conf import settings from django.core import mail from django.core.files import temp from django.core.files.base import File as DjangoFile from django.utils.datastructures import SortedDict from django.test.utils import overri...
{ "content_hash": "46cc27830efa00735d5ebdc51eb9b7b9", "timestamp": "", "source": "github", "line_count": 2863, "max_line_length": 79, "avg_line_length": 38.24449877750611, "alnum_prop": 0.5823058797742342, "repo_name": "mrrrgn/olympia", "id": "9413cd9bd9a6415ddeaf0d8c171e331d5481100c", "size": "1095...
from .constants import FIFF from .tag import find_tag, has_tag from .write import (write_int, start_block, end_block, write_float_matrix, write_name_list) from ..utils import logger, verbose def _transpose_named_matrix(mat): """Transpose mat inplace (no copy)""" mat['nrow'], mat['ncol'] = ...
{ "content_hash": "0e218f8c00a77a133656c52a57677ca9", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 78, "avg_line_length": 35.20634920634921, "alnum_prop": 0.5606402164111812, "repo_name": "alexandrebarachant/mne-python", "id": "e636a65975786aaf56b3a8f8bbbf61cebabd5a2f", ...
class Foo(object): @property def value(self): return 'foo' class Bar(object): def __init__(self, foo): self._foo = foo @property def value(self): return self._foo.value + 'bar' class Baz(object): @property def value(self): return 'baz' class Qux(object)...
{ "content_hash": "c9322639bba0ffadbf40f87cc3a97769", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 74, "avg_line_length": 17.901785714285715, "alnum_prop": 0.5476309226932669, "repo_name": "refinery29/chassis", "id": "809457e8779d010324010632a98f91b7d01364be", "size": "...
"""Quantized distribution.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import check_ops from tensorflow.python.ops ...
{ "content_hash": "0309cb8738e3468580bbf76de6fc61fd", "timestamp": "", "source": "github", "line_count": 562, "max_line_length": 83, "avg_line_length": 35.15124555160142, "alnum_prop": 0.6109339407744875, "repo_name": "lukeiwanski/tensorflow", "id": "ef3bdfa75fcaa8df17db1238ceadadf788601356", "size"...
import os, sys import logging as log from optparse import OptionParser import numpy as np import unsupervised.util import unsupervised.rankings # -------------------------------------------------------------- def main(): parser = OptionParser(usage="usage: %prog [options] reference_rank_file test_rank_file1 test_ran...
{ "content_hash": "1b9168526e8d66155ae6503d655f5465", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 175, "avg_line_length": 45.644067796610166, "alnum_prop": 0.662086891942072, "repo_name": "akiratu/topic-stability", "id": "773a4bcd8265dd75ddbc8c4b44c4237e92cb3265", "size...
import copy import unittest from typing import Optional, List, Union from slack_sdk.errors import SlackObjectFormationError from slack_sdk.models import JsonObject, JsonValidator from slack_sdk.models.blocks import ( ConfirmObject, MarkdownTextObject, Option, OptionGroup, PlainTextObject, ) from sl...
{ "content_hash": "8635639b7c1e680444dc0b51e5d9461f", "timestamp": "", "source": "github", "line_count": 578, "max_line_length": 88, "avg_line_length": 34.21453287197232, "alnum_prop": 0.537671925566343, "repo_name": "slackapi/python-slackclient", "id": "f04057ee64183c665507232a47b3bb69b6dd05df", "s...
import ldns import sys import os import inspect class_name = "ldns_resolver" method_name = None error_detected = False temp_fname = "tmp_resolver.txt" def set_error(): """ Writes an error message and sets error flag. """ global class_name global method_name global error_detected erro...
{ "content_hash": "299a5d4e3bb2d8c9b872175e5ed1d5f5", "timestamp": "", "source": "github", "line_count": 1741, "max_line_length": 157, "avg_line_length": 25.9075244112579, "alnum_prop": 0.5575878505708901, "repo_name": "mbuij/ldns-cga-tsig", "id": "274a4d87364f225a3b75e9158affc090c494da77", "size": ...
"""Nodes for PPAPI IDL AST""" # # IDL Node # # IDL Node defines the IDLAttribute and IDLNode objects which are constructed # by the parser as it processes the various 'productions'. The IDLAttribute # objects are assigned to the IDLNode's property dictionary instead of being # applied as children of The IDLNodes, so ...
{ "content_hash": "501cf9b11985e94673ac7d2966ee14f1", "timestamp": "", "source": "github", "line_count": 450, "max_line_length": 79, "avg_line_length": 29.031111111111112, "alnum_prop": 0.6396968769136558, "repo_name": "junmin-zhu/chromium-rivertrail", "id": "34c4d22d4190e60442596fcf87d7c87f58346395",...
import visa from re import match class Agilent81150: def __init__(self, gpib): ''' Initialize device ''' self.device = visa.instrument("GPIB::%d" %(gpib)) if (not self.__TestConnection()): print "No function generator on this GPIB channel..." return None ...
{ "content_hash": "3db3cb510614bdd6440dc8c0a1cb90c6", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 70, "avg_line_length": 27.083333333333332, "alnum_prop": 0.5241025641025641, "repo_name": "imrehg/labhardware", "id": "6ac3e9dd43e8ee449b8517fb4626c8e770fc6363", "size": "9...
from snovault import ( AuditFailure, audit_checker, ) from .formatter import ( audit_link, path_to_text, ) @audit_checker('Annotation', frame='object') def audit_annotation_organism(value, system): ''' Annotations need their organism to be specified This should eventually go to required sc...
{ "content_hash": "604fed279eede5aeb0477b6366040ade", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 123, "avg_line_length": 38.14545454545455, "alnum_prop": 0.6101048617731173, "repo_name": "ENCODE-DCC/encoded", "id": "a26f7ce0790a46c756a5827d2cfa994838b6bef5", "size": "2...
import pandas as pd import io import unittest from collections import OrderedDict from skbio import TabularMSA, Protein, DNA, RNA from skbio.io import StockholmFormatError from skbio.io.format.stockholm import (_stockholm_to_tabular_msa, _tabular_msa_to_stockholm, ...
{ "content_hash": "5b5940e906d6bba951fcc5941b2425bb", "timestamp": "", "source": "github", "line_count": 899, "max_line_length": 79, "avg_line_length": 46.23692992213571, "alnum_prop": 0.460268963360358, "repo_name": "gregcaporaso/scikit-bio", "id": "665ca30ea391362d5b18398a5bd971a77239192e", "size"...
from twisted.trial.unittest import TestCase from twisted.python.versions import Version from twisted.python.deprecate import _getDeprecationWarningString from twisted.python.deprecate import DEPRECATION_WARNING_FORMAT from axiom.store import Store from axiom.item import Item from axiom.attributes import integer, text...
{ "content_hash": "daafd9398342e9274969cb622c07f553", "timestamp": "", "source": "github", "line_count": 433, "max_line_length": 83, "avg_line_length": 27.74364896073903, "alnum_prop": 0.6203279780238076, "repo_name": "fusionapp/methanal", "id": "979bd470bc7562016af22f3c8bc996ffa660bc87", "size": "1...
from functools import wraps from django.db.models import Max from tars.api.utils import str2bool, convert_status from tars.deployment.constants import HALTED, SUCCESS from tars.deployment.models import TarsDeployment, TarsFortDeployment def fort_batch(param='fort_batch'): def decorator(func): @wraps(fun...
{ "content_hash": "e2e9f7e0cc625817a5d6e748fd59dc4c", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 93, "avg_line_length": 34.082901554404145, "alnum_prop": 0.5717543326238979, "repo_name": "ctripcorp/tars", "id": "d201dde4d9e313f01e30c43651bd32a417b2ef8e", "size": "6578...
import uuid from django.db import models class UrlconfRevision(models.Model): revision = models.CharField(max_length=255) class Meta: app_label = 'cms' def save(self, *args, **kwargs): """ Simply forces this model to be a singleton. """ self.pk = 1 super(...
{ "content_hash": "fa4df3b23f879fec47fd35327aef7378", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 60, "avg_line_length": 26.384615384615383, "alnum_prop": 0.5782312925170068, "repo_name": "datakortet/django-cms", "id": "38ef465ebc63688b4f8fd6e0ff91bb247dcae9dd", "size":...
from distutils.core import setup setup( name='py-noembed', version='0.2', description='Python Wrapper over NoEmbed', author='Jacob Haslehurst', author_email='jacob@haslehurst.net', url='https://github.com/gizmag/py-noembed', packages=['noembed'], install_requires=['requests'] )
{ "content_hash": "b523889d4e37ee4b08216775d34c0aac", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 47, "avg_line_length": 26, "alnum_prop": 0.6730769230769231, "repo_name": "gizmag/py-noembed", "id": "1789ff8115fe2b127469311f631607cad90cb6fc", "size": "335", "binary": ...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function try: from thread import get_ident as _get_ident except ImportError: from dummy_thread import get_ident as _get_ident try: from _abcoll import KeysView, Valu...
{ "content_hash": "a2a9c67dbf6131f8882bc347393c547f", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 87, "avg_line_length": 34.301886792452834, "alnum_prop": 0.5522552255225522, "repo_name": "bhardesty/qpid-dispatch", "id": "3d676123249db53a06ca752cd702c52842f60b83", "siz...
from locustfile import CourseDiscoveryLocust
{ "content_hash": "05d5d8494b92946342886fa3f6416ef9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 44, "avg_line_length": 45, "alnum_prop": 0.9111111111111111, "repo_name": "edx/edx-load-tests", "id": "5db6acc3537c688dcdd76bf139120a04afc5c00c", "size": "45", "binary": f...
import sys from nose.plugins.skip import SkipTest sys.path[0:0] = [""] import datetime import unittest import uuid import math import itertools import re try: import dateutil except ImportError: dateutil = None from decimal import Decimal from bson import Binary, DBRef, ObjectId from mongoengine import * ...
{ "content_hash": "5b3c68344eddb94a97fca93c583c5e51", "timestamp": "", "source": "github", "line_count": 4060, "max_line_length": 113, "avg_line_length": 32.217487684729065, "alnum_prop": 0.5825325107222311, "repo_name": "larsbutler/mongoengine", "id": "dbba6f9fb505c8380aac0e25e7e7c28cdcc5aa60", "si...
import BoostBuild t = BoostBuild.Tester() # Create the needed files. t.write("jamroot.jam", """ using testing ; lib helper : helper.cpp ; unit-test test : test.cpp : <library>helper ; """) t.write("test.cpp", """ void helper(); int main() { helper(); } """) t.write("helper.cpp", """ void #if defined(_WIN32) __decls...
{ "content_hash": "0c755bd8438c03969365f3d44d4e2090", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 63, "avg_line_length": 16.821428571428573, "alnum_prop": 0.6602972399150743, "repo_name": "goldcoin/gldcoin", "id": "94575ad3190a968bc3280656d227c02d8485e72d", "size": "700...
"""Tests for unix_events.py.""" import collections import gc import errno import io import os import pprint import signal import socket import stat import sys import tempfile import threading import unittest from unittest import mock if sys.platform == 'win32': raise unittest.SkipTest('UNIX only') import asynci...
{ "content_hash": "784c1fdb938f9d62a4cc3bf2f2436d02", "timestamp": "", "source": "github", "line_count": 1582, "max_line_length": 78, "avg_line_length": 33.554993678887485, "alnum_prop": 0.6104475924949138, "repo_name": "OptimusGitEtna/RestSymf", "id": "e397598222d8867af8d79011206a9af529605075", "si...
from __future__ import print_function import unittest import numpy as np from op_test import OpTest class TestFusionSquaredMatSubOp(OpTest): def setUp(self): self.op_type = 'fusion_squared_mat_sub' self.m = 11 self.n = 12 self.k = 4 self.scalar = 0.5 self.set_conf(...
{ "content_hash": "b17f2f8ebd5c54f3a2962b1326f08dd4", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 76, "avg_line_length": 24.333333333333332, "alnum_prop": 0.5721812434141201, "repo_name": "baidu/Paddle", "id": "a097d3d9a20f0b4b5dddf286f064d5698de35b5f", "size": "1562", ...
from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_mesos', [dirname(__file__)]) except ImportError: import _mesos ...
{ "content_hash": "a808ce890d67e94f0b19ec3fa1a59e68", "timestamp": "", "source": "github", "line_count": 543, "max_line_length": 125, "avg_line_length": 52.95580110497237, "alnum_prop": 0.6868718483741958, "repo_name": "charlescearl/VirtualMesos", "id": "fb4ef7ecb1497f2b3a9433781d22e598f59d3fa6", "s...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('account', '0004_auto_20170511_2207'), ] operations = [ migrations.AddField( model_name='accountuser', ...
{ "content_hash": "640936dd8449877b3d5f47699834d931", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 114, "avg_line_length": 25.75, "alnum_prop": 0.6330097087378641, "repo_name": "fxer/cujo", "id": "adedb185672d278cddfc0c0a30b5ea44f5773cde", "size": "588", "binary": fals...
import os import sys import Image, ImageDraw, ImageStat import numpy as np import matplotlib.pyplot as plt from matplotlib.offsetbox import OffsetImage, AnnotationBbox imagepath = sys.argv[1] # The image to build the histogram of histHeight = 120 # Height of the histogram histWidth = 256 # W...
{ "content_hash": "a46c54f240fe3add69c64380ec7866f8", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 83, "avg_line_length": 28.058252427184467, "alnum_prop": 0.6391003460207613, "repo_name": "amirchohan/HDR", "id": "d2035d37f5656ac9a4380b87954374e7365889e1", "size": "3159...
QUASIMODE_START_KEY = "KEYCODE_RCONTROL" QUASIMODE_END_KEY = "KEYCODE_RETURN" QUASIMODE_CANCEL_KEY1 = "KEYCODE_ESCAPE" QUASIMODE_CANCEL_KEY2 = "KEYCODE_RCONTROL" # Whether the Quasimode is actually modal ("sticky"). IS_QUASIMODE_MODAL = True # Amount of time, in seconds (float), to wait from the time # that the quasi...
{ "content_hash": "082b3f509177fd56bb1b1d6ba6907076", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 76, "avg_line_length": 39.822784810126585, "alnum_prop": 0.7256834075015893, "repo_name": "tartakynov/enso", "id": "1eeaa4d171fbc904502608212faf6eb42b9941f5", "size": "3462...
""" Define various entities and populate them """ import re import sys import numpy as np from collections import defaultdict, OrderedDict from datetime import datetime from ngi_reports.utils import statusdb class Sample: """Sample class """ def __init__(self): self.customer_name = '' sel...
{ "content_hash": "3de321b65e6fd40bb21c0cb548004746", "timestamp": "", "source": "github", "line_count": 560, "max_line_length": 258, "avg_line_length": 50.72678571428571, "alnum_prop": 0.5255394797057064, "repo_name": "NationalGenomicsInfrastructure/ngi_reports", "id": "b5de82f183062da6bc5f66e92f3f7d...
from __future__ import absolute_import import re from collections import deque import six class Token: def __init__(self, **kwds): self.buffer = None self.__dict__.update(kwds) def __str__(self): return self.__dict__.__str__() def regexec (regex, input): matches = regex.match(input)...
{ "content_hash": "fe7c39c7075294bca0104e28f6d51e66", "timestamp": "", "source": "github", "line_count": 451, "max_line_length": 128, "avg_line_length": 34.310421286031044, "alnum_prop": 0.46807548145275946, "repo_name": "glennyonemitsu/muhJade", "id": "e5d766737521880e10b77c4689fce60cb19f7689", "si...
import click """ Command Line Interface for the cage package. """ # This is only used to make '-h' a shorter way to access the CLI help CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help']) @click.group(context_settings=CONTEXT_SETTINGS) def main(): """ Python tools for studying cage-like anions for ...
{ "content_hash": "b83e0190874b3156b368a8877fe1e3a6", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 79, "avg_line_length": 31.747767857142858, "alnum_prop": 0.6491598115728046, "repo_name": "mbercx/cage", "id": "54b5e391e11c167e4d5377ebf2dfb4ec33bdb5ce", "size": "14223",...
import os import django # Django settings for conf project. settings_dir = os.path.dirname(__file__) PROJECT_ROOT = os.path.abspath(os.path.dirname(settings_dir)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { ...
{ "content_hash": "dbbf35a7a5b63f25d2878673c590dd52", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 108, "avg_line_length": 32.015306122448976, "alnum_prop": 0.7024701195219123, "repo_name": "adw0rd/django-addendum-inline", "id": "fe406d63546f099a9e917adc074ef2cacf8aecff",...
from django.conf import settings from django.core import exceptions from django.utils.importlib import import_module CLASS_PATH_ERROR = 'django-shop is unable to interpret settings value for %s. '\ '%s should be in the form of a tupple: '\ '(\'path.to.models.Class\', \'app_label\...
{ "content_hash": "301709dbca78193c02c4dc86187584f6", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 80, "avg_line_length": 35.59782608695652, "alnum_prop": 0.5804580152671756, "repo_name": "thenewguy/django-shop", "id": "2b6358e9fe0cea95ce9169a714f8c79225b3a6ad", "size": ...
from gevent import monkey monkey.patch_all() import sys import click from bottle import static_file, Bottle, run, view from bottle import TEMPLATE_PATH as T from bottle.ext.websocket import GeventWebSocketServer from bottle.ext.auth.decorator import login from gevent.pywsgi import WSGIServer from geventwebsocket.han...
{ "content_hash": "c8337d4700eda385c5d33ba9ff3db78a", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 76, "avg_line_length": 27.025862068965516, "alnum_prop": 0.6883572567783094, "repo_name": "AndrzejR/mining", "id": "5dd64ba67de1b1ede48710cf7fafc04d5665b225", "size": "318...
import xyz class Gettext(xyz.Package): pkg_name = 'gettext' configure = xyz.Package.host_lib_configure rules = Gettext
{ "content_hash": "07d8283ca7f1b7905c418cc18e1976d1", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 46, "avg_line_length": 18.428571428571427, "alnum_prop": 0.7131782945736435, "repo_name": "BreakawayConsulting/xyz", "id": "aca89f87b5073edc45e1185d5d8f37c51b580380", "size"...
import asyncio import diffusion from diffusion.features.control.metrics.topic_metrics import TopicMetricCollectorBuilder server_url = "ws://localhost:8080" principal = "admin" credentials = diffusion.Credentials("password") # Because Python SDK for Diffusion is async, all the code needs to be # wrapped inside a coro...
{ "content_hash": "59315eff64c6d740d4fb91688fc1d367", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 104, "avg_line_length": 36.67142857142857, "alnum_prop": 0.5987534086482275, "repo_name": "pushtechnology/diffusion-examples", "id": "77edaa0187d8fce93164a1b8a9000958337da7de...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: katello short_description: Manage Katello Resources deprec...
{ "content_hash": "9e8b35209ac923c0655acd018d7055f3", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 154, "avg_line_length": 33.458536585365856, "alnum_prop": 0.6076687563784808, "repo_name": "thaim/ansible", "id": "e0974201884eb0ba5e6f7e27cc4af869e1dd002f", "size": "2077...
from fudge.inspector import * def test_import_all(): assert "arg" in globals()
{ "content_hash": "de9433820dd7b84cbf5e985b23853253", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 29, "avg_line_length": 20.75, "alnum_prop": 0.6987951807228916, "repo_name": "fudge-py/fudge", "id": "6df21b4ae236be341d588e64fb64a96d6c6786a3", "size": "84", "binary": fa...
ENRICH_METADATA_OPTION = 'enrich_metadata' BASE_METADATA_QUERY_FILENAME = 'base_metadata_query_filename' REFRESH_OPTION = 'refresh_metadata_tables' ROW_COUNT_OPTION = 'sync_row_counts' # Metadata config keys ASSET_NAME_KEY = 'name' TABLE_CONTAINER_DEF_KEY = 'table_container_def' TABLE_DEF_KEY = 'table_def' COLUMN_DEF_...
{ "content_hash": "549813740a77277377a73b55848d9406", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 75, "avg_line_length": 31.579710144927535, "alnum_prop": 0.7581459385039009, "repo_name": "GoogleCloudPlatform/datacatalog-connectors-rdbms", "id": "f1481ce738b932b3bb21bf82d...
"""Support for Daikin AC sensors.""" from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( CONF_DEVICE_CLASS, CONF_ICON, CONF_NAME, CONF_TYPE, CONF_UNIT_OF_MEASUREMENT, ) from . import DOMAIN as DAIKIN_DOMAIN, DaikinApi from .const import ( ATTR_COOL_ENERGY,...
{ "content_hash": "cf34406fc280dab89bc01547a8a8cc96", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 88, "avg_line_length": 32.77622377622377, "alnum_prop": 0.6554299125240025, "repo_name": "kennedyshead/home-assistant", "id": "a5b515ea918946832b1fe868947f01bc94e0b5cb", "...
from __future__ import absolute_import, division, print_function import unittest from blaze.py2help import skipIf from blaze.datadescriptor import data_descriptor_from_cffi, dd_as_py from datashape import dshape try: import cffi ffi = cffi.FFI() except ImportError: cffi = None class TestCFFIMemBufData...
{ "content_hash": "eb4f59349d0863ccab87811d8f431d08", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 68, "avg_line_length": 38.6578947368421, "alnum_prop": 0.5987066031313819, "repo_name": "mwiebe/blaze", "id": "a820cbb0a295b81def745fdde843b16ce32bb9f8", "size": "2938", ...
"""The WattTime integration.""" from __future__ import annotations from datetime import timedelta from aiowatttime import Client from aiowatttime.emissions import RealTimeEmissionsResponseType from aiowatttime.errors import InvalidCredentialsError, WattTimeError from homeassistant.config_entries import ConfigEntry f...
{ "content_hash": "5263cc597697974ac4cd276f4aac0c97", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 88, "avg_line_length": 33.93103448275862, "alnum_prop": 0.7157859078590786, "repo_name": "mezz64/home-assistant", "id": "cac73f597f6b7f72d4988f94435422142df421cd", "size": ...
from sys import argv import numpy from gensim import corpora, models, similarities from gensim.corpora import MmCorpus from nltk.corpus import stopwords import os from pprint import pprint from numpy import median # Enables ease of recall in the future modelFile = '.' + os.sep + 'ToxicologyModel' os.makedirs(modelFil...
{ "content_hash": "6f23367055300a5bc5dc34163865f468", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 134, "avg_line_length": 37.51282051282051, "alnum_prop": 0.7081339712918661, "repo_name": "MasterofKnuth/Nanoinformatics", "id": "ea720b469464cc9e37d662f453eb977484a5c6a8", ...
import copy import os import re import mxnet as mx import numpy as np from common import models from mxnet.test_utils import discard_stderr import pickle as pkl def test_symbol_basic(): mlist = [] mlist.append(models.mlp2()) for m in mlist: m.list_arguments() m.list_outputs() def test_symb...
{ "content_hash": "8365de462fdb38550cca6e9a5db554cf", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 108, "avg_line_length": 37.44017094017094, "alnum_prop": 0.6268690788722748, "repo_name": "stefanhenneking/mxnet", "id": "c570325a6b66a84c73161ff056d000d8f1d7479d", "size"...
__author__ = 'fahadadeel' import jpype import os.path from WorkingWithTables import AddImage asposeapispath = os.path.join(os.path.abspath("../../../"), "lib") print "You need to put your Aspose.Slides for Java APIs .jars in this folder:\n"+asposeapispath jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.ext.dirs=%s...
{ "content_hash": "e6cc52fd2489eb06a0b26c1784298798", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 95, "avg_line_length": 29.923076923076923, "alnum_prop": 0.7377892030848329, "repo_name": "aspose-slides/Aspose.Slides-for-Java", "id": "734beacab59ac38eb8904332b72711b46c690...
""" Exceptions for logger. """ class LogProcessError(Exception): """Log Process Error""" pass
{ "content_hash": "b1944db5d99d669b4287900e806d5dfa", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 33, "avg_line_length": 12.11111111111111, "alnum_prop": 0.6146788990825688, "repo_name": "OctavianLee/Cytisas", "id": "a29c1e8164d27ac2d126e811ab5b0228a3463e61", "size": "10...
import re import copy import numpy as np from numpy.testing import assert_allclose, assert_equal, assert_array_equal import pytest from scipy.linalg import hilbert, svd from scipy.sparse import csc_matrix, isspmatrix from scipy.sparse.linalg import LinearOperator, aslinearoperator from scipy.sparse.linalg import svds...
{ "content_hash": "698f92007167c268689e0eb4150bdaa6", "timestamp": "", "source": "github", "line_count": 637, "max_line_length": 79, "avg_line_length": 39.55102040816327, "alnum_prop": 0.5727157259665, "repo_name": "matthew-brett/scipy", "id": "cac2531a4767f95555f880f69255bcc2ad442add", "size": "251...
""" This module contains errors/exceptions and warnings of general use for astropy. Exceptions that are specific to a given subpackage should *not* be here, but rather in the particular subpackage. """ class AstropyWarning(Warning): """ The base warning class from which all Astropy warnings should inherit. ...
{ "content_hash": "4911a2b8e181c59bf7d9c4b731a55595", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 82, "avg_line_length": 26.642857142857142, "alnum_prop": 0.7238605898123325, "repo_name": "DougBurke/astropy", "id": "1b4ca299e079bf85e6ff9c28bb77dd875752a167", "size": "15...
import numpy as np import multiprocessing as mp import sys global inputStr def grabLine(positions): global inputStr if positions[-1] != 'end': return inputStr[positions[0]:positions[1]] else: print inputStr[positions[0]:] return inputStr[positions[0]:] def wrap(inputStr='',width=60...
{ "content_hash": "129d5dbc4ca2ec577580eabc130aa57f", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 55, "avg_line_length": 23.522727272727273, "alnum_prop": 0.5584541062801932, "repo_name": "jlevy44/Joshua-Levy-Synteny-Analysis", "id": "8975d116d1a426fea8c6f79a057555e1d450d...
from __future__ import absolute_import from itertools import izip import six from sentry.api.serializers import Serializer, register, serialize from sentry.constants import LOG_LEVELS from sentry.models import (GroupTombstone, User) @register(GroupTombstone) class GroupTombstoneSerializer(Serializer): def get_a...
{ "content_hash": "9885b0ced361b4936f85dc16ae42072d", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 91, "avg_line_length": 31.75, "alnum_prop": 0.6003937007874016, "repo_name": "jean/sentry", "id": "f33631fcae730aa5949c2a0d77b79cca9f2fda2e", "size": "1016", "binary": fa...
from python.decorators import euler_timer from python.functions import get_data def translate(message, key): len_key = len(key) result = message[:] for i in range(len_key): for j in range(i, len(result), len_key): result[j] = result[j] ^ key[i] result = ''.join(chr(val) for val i...
{ "content_hash": "266d276efe1b3eb801faefa5b3500d04", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 69, "avg_line_length": 29.148936170212767, "alnum_prop": 0.5525547445255474, "repo_name": "dhermes/project-euler", "id": "ef235e9538233a52b4c430bdba8c1b013772cebc", "size":...