text
stringlengths
4
1.02M
meta
dict
from django.conf.urls import patterns, url urlpatterns = patterns( 'eventi.subscriptions.views', url(r'^$', 'subscribe', name='subscribe'), url(r'^(\d+)/$', 'detail', name='detail'), )
{ "content_hash": "3863e8b26e73c32082a3715a9c0332a4", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 24.875, "alnum_prop": 0.628140703517588, "repo_name": "klebercode/lionsclub", "id": "365d562125a795d1bd721b231c0a80c723f29e53", "size": "215", "bina...
""" systemundertest.py: Contains the SystemUnderTest class. A SystemUnderTest instance is an abstraction of an actual computing system. For instance, a system may be the Open Stack compute service (nova), or it may be the Linux networking stack, or a software application. A SystemUnderTest instance will be mapped ...
{ "content_hash": "605af1fc9f6c81e7ccd645143a392790", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 77, "avg_line_length": 33.745098039215684, "alnum_prop": 0.6612434631028472, "repo_name": "bahadley/dtest-controller", "id": "37680c7b0d4f8b95c16f951d882c45c8facd67ce", "si...
""" This module provides a command line client for the aptdaemon """ # Copyright (C) 2008-2009 Sebastian Heinlein <sevel@glatzor.de> # # Licensed under the GNU General Public License Version 2 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License...
{ "content_hash": "d1fe4cae248a7f031ceb214bb863c187", "timestamp": "", "source": "github", "line_count": 691, "max_line_length": 79, "avg_line_length": 44.38929088277858, "alnum_prop": 0.5256414436149056, "repo_name": "yasoob/PythonRSSReader", "id": "91a25cc77bc30dfaae6eb433db21c73f60d850ad", "size"...
import os from sauron.metrics import Metric, MetricException class DiskMetric(Metric): def __init__(self, name, path, **kwargs): Metric.__init__(self, name, **kwargs) self.reconfig(name, path, **kwargs) def reconfig(self, name, path, **kwargs): Metric.reconfig(self, name, **kwargs) ...
{ "content_hash": "80db07df72e4451debcea32d7c16b6a5", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 90, "avg_line_length": 39.24242424242424, "alnum_prop": 0.505019305019305, "repo_name": "wutali/sauron", "id": "e9aeed212a1abd7d85d3a70b7fa06e7ec537f455", "size": "1295", ...
from scipy.cluster import hierarchy from scipy.spatial import distance import logging from .all_genes import all_genes from . import cdr3s_human logger = logging.getLogger('util.py') def get_rep( gene, organism ): assert gene.startswith('TR') vj = gene[3] if vj == 'V': rep = cdr3s_human.all_loops...
{ "content_hash": "442dec2c0ba5e5a56cdda8c64b0af78e", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 166, "avg_line_length": 39.748717948717946, "alnum_prop": 0.5471552057798994, "repo_name": "phbradley/tcr-dist", "id": "27bd85d225415a9008e7388d4d054a17c820c261", "size": ...
"""Unit tests for book models/database.""" import pytest from store.book.models import Book @pytest.mark.usefixtures('db') class TestBook: """Book test.""" def test_get_by_isbn13(self): """Test can retrieve by isbn.""" book = Book("book0", "Lalala", "Alvin Tan", "Penguin Books", ...
{ "content_hash": "603895956c90ef5157ed4ddd186fb8cb", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 110, "avg_line_length": 40.49438202247191, "alnum_prop": 0.5640954495005549, "repo_name": "boomcan90/store", "id": "21fa92c10829ccf02bd174bce4ddefc2ca358561", "size": "3604...
from openpathsampling.high_level.network import FixedLengthTPSNetwork from openpathsampling.high_level.transition import FixedLengthTPSTransition import openpathsampling as paths class PartInBFixedLengthTPSTransition(FixedLengthTPSTransition): """Fixed length TPS transition accepting any frame in the final state. ...
{ "content_hash": "ca2a8cf0007127ada85867093cab2072", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 75, "avg_line_length": 37.660714285714285, "alnum_prop": 0.6804172593646278, "repo_name": "dwhswenson/openpathsampling", "id": "01eaa863b016d99fb7436867fb08fed76b5f191d", "...
from Firefly import logging from Firefly.helpers.conditions import Conditions from Firefly.helpers.events import Command from Firefly import scheduler class Action(object): def __init__(self, ff_id, command, source, conditions=None, force=False, **kwargs): self._ff_id = ff_id self._command = command sel...
{ "content_hash": "9c7be5b57157f30fecf2a6bafc70db96", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 94, "avg_line_length": 26.830985915492956, "alnum_prop": 0.6671916010498687, "repo_name": "Firefly-Automation/Firefly", "id": "0a8d833d6f7d79ac52fb19d558454fbf72bb2984", "s...
import math import multiprocessing import numpy import os import torch from pathlib import Path from onnx import numpy_helper, TensorProto from gpt2_helper import Gpt2Helper from benchmark_helper import create_onnxruntime_session NON_ZERO_VALUE = str(1) ZERO_VALUE = str(0) def environ_setting_nodes(node_name_filter=...
{ "content_hash": "262dcb8dc504d3aef07fc7086fc99f98", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 120, "avg_line_length": 42.41085271317829, "alnum_prop": 0.6104916834216779, "repo_name": "ryfeus/lambda-packs", "id": "c83d947138067b03e06f9286e1cf651b48e576fa", "size": ...
from __future__ import unicode_literals import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('home', '0014_auto_20161026_0217'), ] operations = [ migration...
{ "content_hash": "d1a00ffd32eb66d8f1e306f1c6497ed9", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 111, "avg_line_length": 28.59259259259259, "alnum_prop": 0.6230569948186528, "repo_name": "maxwallasaurus/arboretum", "id": "7ec6c613e60a63c560f0af1b26d6a4891abdcce2", "siz...
import logging import time import re import json import inspect import hashlib from abc import ABCMeta, abstractmethod import six import __main__ as main from .assignment import Assignment from .interpreter import Interpreter # decorator for methods that assume assignments have been made def requires_assignment(f): ...
{ "content_hash": "01e6c92dc0fb2366ef0f1e3f14a4b2b1", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 99, "avg_line_length": 32.433846153846154, "alnum_prop": 0.6119912721753155, "repo_name": "cudbg/planout", "id": "48da357f50f40808a546cf1af480f1558bfd796e", "size": "10829...
import logging logger = logging.getLogger(__name__) class Services(object): """ High-level base class for Benchmark(), MemoryMonitoring() and Analytics() classes. """ def __init__(self, *args): """ Init function. :param args: """ pass
{ "content_hash": "97997565d8fdd58448803fbed23d745a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 86, "avg_line_length": 17.41176470588235, "alnum_prop": 0.5506756756756757, "repo_name": "PalNilsson/pilot2", "id": "dd1c09f8fbb9975eedceedc7e5e0881b0d97fe71", "size": "641...
"""\ Code for reading/writing Matlab file formats This program is part of the PyQuante quantum chemistry program suite. Copyright (c) 2004, Richard P. Muller. All Rights Reserved. PyQuante version 1.2 and later is covered by the modified BSD license. Please see the file LICENSE that is part of this distribut...
{ "content_hash": "7a87f1b230d06a8afbd3dd3455261c0b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 70, "avg_line_length": 25.32, "alnum_prop": 0.5884676145339652, "repo_name": "berquist/PyQuante", "id": "26b86096275180c1c59cd252b40e0c66bca23236", "size": "1266", "binar...
""" Cloud-provider: base-classes Copyright (c) 2010-2012 Mika Eloranta See LICENSE for details. """ from . import errors class NoProviderMethod(NotImplementedError): def __init__(self, obj, func): name = (obj if isinstance(obj, type) else obj.__class__).__name__ NotImplementedError.__init__(self...
{ "content_hash": "beb4396dacdaa78f066e2a4db9a1100e", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 94, "avg_line_length": 33.11971830985915, "alnum_prop": 0.6249202636614927, "repo_name": "ohmu/poni", "id": "0a67bd907f14776aa679802c0f0f3424dc1e8bd5", "size": "4703", "...
import json import responses import logging from datetime import datetime from django.contrib.auth.models import User from django.test import TestCase from django.db.models.signals import post_save from django.core.exceptions import ValidationError from django.core.exceptions import MultipleObjectsReturned from rest_fr...
{ "content_hash": "a873671131845cf435c526a6523e7ce2", "timestamp": "", "source": "github", "line_count": 1542, "max_line_length": 79, "avg_line_length": 37.02918287937743, "alnum_prop": 0.5564720923308639, "repo_name": "praekelt/ndoh-control", "id": "2033c1db38822b4f07776752aca6acbaee97b01d", "size"...
from modules.scrapers.overgg import Overgg from modules.scrapers.owl import OWL class Scraper: @classmethod def scrape_event_start_time(cls, event): if 'scrape_method' in event: if event['scrape_method'] == 'overgg': return Overgg.scrape_match_time(event['start_match_url']) ...
{ "content_hash": "373a488d4f5a8e196c38694b4e64e9cb", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 73, "avg_line_length": 31.727272727272727, "alnum_prop": 0.545367717287488, "repo_name": "Jawoll/automatchthreads", "id": "47a07c0532864640f5c8ebccaa7d31f95916342f", "size"...
__author__ = 'mike' import sys class Cell: type = 0 isborder = False def __init__(type = 0, border = False): type = type isborder = border def print(grid): for level in grid: for cell in level: print(("X" if cell.isborder else " ")) print("\n") def makelevel() args = sys.argv width = int(args[1])*...
{ "content_hash": "f44fe7c3dbe552905968184311f683eb", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 41, "avg_line_length": 15.1875, "alnum_prop": 0.6152263374485597, "repo_name": "mersinvald/SUAI-1441-Labs", "id": "cc38930ff83a9da15677712f4618a88d79708871", "size": "486",...
from django.db.models.signals import post_save from django.dispatch import receiver from mezzanine.utils.models import get_user_model from mezzanine.accounts import get_profile_model, get_profile_user_fieldname # Signal for ensuring users have a profile instance. Profile = get_profile_model() User = get_user_model()...
{ "content_hash": "f3226d2bcf1fbb98cff9576ce010e047", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 32.11764705882353, "alnum_prop": 0.7509157509157509, "repo_name": "eRestin/Mezz", "id": "2798e30f9df125a3eb875e9f2633fa2bf7cf80ae", "size": "546", ...
''' simpleoauth.utils ----------------- SimpleOAuth utilities. ''' from simpleoauth.compat import is_basestring, quote_plus FORM_URLENCODED = 'application/x-www-form-urlencoded' OPTIONAL_OAUTH_PARAMS = ('oauth_callback', 'oauth_verifier', 'oauth_version') def ensure_encoding(s): ''' Ensures a g...
{ "content_hash": "5028cda9ebce6c6af11f06600e20acdd", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 77, "avg_line_length": 23.558139534883722, "alnum_prop": 0.5873642645607108, "repo_name": "maxcountryman/simpleoauth", "id": "ab226687f202cb4e151d4af3503d2494d3b02c2b", "si...
import datetime from multiprocessing import Manager from pale import Endpoint, PatchEndpoint, PutResourceEndpoint from pale.arguments import BooleanArgument, IntegerArgument, StringArgument from pale.resource import DebugResource, NoContentResource from pale.errors.api_error import APIError from tests.example_app.mod...
{ "content_hash": "ac700ba6ec555bdd5e1c3f9c3cba1488", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 75, "avg_line_length": 28.262931034482758, "alnum_prop": 0.6397742870215037, "repo_name": "Loudr/pale", "id": "e83269eac3db51affaf47af8c7751e4cac19e7a3", "size": "6557", ...
import mechanize import time from hq_settings import init_browser, User, HQTransaction class Transaction(HQTransaction): def run(self): br = init_browser() start_timer = time.time() user = User(self.username, self.password, br) user.ensure_logged_in() latency = time.time() ...
{ "content_hash": "f61f7786daefe1ef381e6711c380a6c3", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 73, "avg_line_length": 29.333333333333332, "alnum_prop": 0.6164772727272727, "repo_name": "SEL-Columbia/commcare-hq", "id": "69fabbcab4b0f5469e74c4de52d617b50f4b64c2", "siz...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest from collections import deque import numpy as np import numpy.testing as npt from gym import spaces from reinforceflow.envs import ObservationStackWrap from reinforceflow.envs import Vectorize...
{ "content_hash": "4ac6f6ec9c875a89ffc4638233bbbd15", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 98, "avg_line_length": 37.110169491525426, "alnum_prop": 0.6318794245261475, "repo_name": "dbobrenko/reinforceflow", "id": "cee6517e57de93c83386b13267e9caec1b32016f", "siz...
import csv def loadTourneyData(): # Fields: Season, Daynum, Wteam, Wscore, Lteam, Lscore, Wloc, Numot games = {} with open("data/TourneyCompactResults.csv") as t: tourneyResults = csv.reader(t, dialect='excel') fields = tourneyResults.next() for line in tourneyResults: g...
{ "content_hash": "787d6f85ed10bbf89162f64e2ecfe568", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 34.294117647058826, "alnum_prop": 0.5557461406518011, "repo_name": "mpsonic/MarchMadnessRandomForest", "id": "abd4a66ddad6b6db752f38a0b953342ab04f3951"...
"""Support for Wink fans.""" import logging from homeassistant.components.fan import ( SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SUPPORT_DIRECTION, SUPPORT_SET_SPEED, FanEntity) from . import DOMAIN, WinkDevice _LOGGER = logging.getLogger(__name__) SPEED_AUTO = 'auto' SPEED_LOWEST = 'lowest' SUPPORTED_FEATURES =...
{ "content_hash": "b92ecc73db0ec5235286594d01d8bd59", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 79, "avg_line_length": 32.14736842105263, "alnum_prop": 0.6195153896529142, "repo_name": "MartinHjelmare/home-assistant", "id": "3fb06abc1457267b26f5e8ef739f732f3011e464", ...
"""Test KNX events.""" from homeassistant.components.knx import CONF_KNX_EVENT_FILTER from homeassistant.core import HomeAssistant from .conftest import KNXTestKit from tests.common import async_capture_events async def test_knx_event(hass: HomeAssistant, knx: KNXTestKit): """Test `knx_event` event.""" tes...
{ "content_hash": "95a31ec8290539346c179ad804c260ad", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 70, "avg_line_length": 32.81927710843374, "alnum_prop": 0.6156387665198237, "repo_name": "FreekingDean/home-assistant", "id": "6a9e021ff53af6620d48a99d20babe50b6c4f1fc", "s...
__author__ = 'Tomasz J. Kotarba <tomasz@kotarba.net>' __copyright__ = 'Copyright (c) 2014, Tomasz J. Kotarba. All rights reserved.' from django.test import TestCase from fm.forms import AreaForm, FacilityForm, ContactForm, RoleForm from fm.models import Area, AREA_TYPES from fm.models import Facility from fm.models ...
{ "content_hash": "4bdf879f219818cdddb37065cd634f31", "timestamp": "", "source": "github", "line_count": 530, "max_line_length": 80, "avg_line_length": 40.64905660377359, "alnum_prop": 0.525807649461567, "repo_name": "thanasio/connect", "id": "cb616ccc67f808a8c04e9caf4408142a12fe54aa", "size": "2154...
""" Test suite for repoze.who-x509 """ from dateutil.relativedelta import relativedelta from dateutil.tz import tzutc from datetime import datetime import unittest import locale class TestX509Base(unittest.TestCase): """Base class for testing X509 predictes""" def generate_dn(self, **kwargs): return...
{ "content_hash": "f9862c3e93c9ac36224a7f4a05882eaf", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 80, "avg_line_length": 37.11764705882353, "alnum_prop": 0.5789751716851559, "repo_name": "arturosevilla/repoze.who-x509", "id": "aa5a1e4ed3dae17f5f023bd9d80b14f5753394d6", ...
"""Permutation importance for estimators""" import numpy as np from joblib import Parallel from joblib import delayed from ..metrics import check_scoring from ..utils import Bunch from ..utils import check_random_state from ..utils import check_array from ..utils.validation import _deprecate_positional_args def _cal...
{ "content_hash": "a570b52ad78e9446bb024751ad763283", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 42.63636363636363, "alnum_prop": 0.651795965228801, "repo_name": "bnaul/scikit-learn", "id": "8aa8766b727aae5a059e1900fb9bb2afe577af16", "size": "60...
from neutron_lib import constants as const from neutron_lib.db import api as db_api from neutron_lib.objects import common_types from neutron_lib.objects import utils as obj_utils from oslo_utils import versionutils from oslo_versionedobjects import fields as obj_fields from sqlalchemy import func from neutron.agent.c...
{ "content_hash": "341c749f72090bf27b4a93d426d20329", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 79, "avg_line_length": 46.23717948717949, "alnum_prop": 0.6161098017468459, "repo_name": "openstack/neutron", "id": "62b7daea14b9100b668880d91b884a923037d6b1", "size": "78...
""" Collection of query wrappers / abstractions to both facilitate data retrieval and to reduce dependency on DB-specific API. """ from __future__ import print_function, division from datetime import datetime, date, time import warnings import traceback import re import numpy as np import pandas.lib as lib import pa...
{ "content_hash": "cb196f7d1e4c7cda5bad30ec98c8c458", "timestamp": "", "source": "github", "line_count": 1717, "max_line_length": 79, "avg_line_length": 36.63191613278975, "alnum_prop": 0.587484299728127, "repo_name": "BigDataforYou/movie_recommendation_workshop_1", "id": "324988360c9fe8f79ceef4996dce...
from setuptools import setup import os import re base_path = os.path.dirname(__file__) fp = open(os.path.join(base_path, 'pycalq', '__init__.py')) VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(fp.read()).group(1) fp.close() version = VERSION def read(fname): try: pa...
{ "content_hash": "94fd68c466c1708df3eaf89bb89a37de", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 61, "avg_line_length": 27.5, "alnum_prop": 0.5965034965034965, "repo_name": "FriedrichK/pyCalq", "id": "d0e89dd9b2f54f7dc631dee0c98511d440b040cf", "size": "1453", "binary...
""" Dependency-less LDAP filter parser for Python :author: Thomas Calmant :copyright: Copyright 2016, Thomas Calmant :license: Apache License 2.0 :version: 0.6.4 .. Copyright 2016 Thomas Calmant Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complianc...
{ "content_hash": "e7d7107337c6052db06f9bf861247ae1", "timestamp": "", "source": "github", "line_count": 950, "max_line_length": 80, "avg_line_length": 28.521052631578947, "alnum_prop": 0.5562280863627975, "repo_name": "isandlaTech/cohorte-devtools", "id": "b1bb71680351a27b46ae156b1c82f63be1a80232", ...
from plenum.common.exceptions import NotConnectedToAny from indy_common.identity import Identity class Caching: """ Mixin for agents to manage caching. Dev notes: Feels strange to inherit from WalletedAgent, but self-typing doesn't appear to be implemented in Python yet. """ def getClient(se...
{ "content_hash": "9d55ac5afa5fe9cf57597c9b462b93c6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 29.375, "alnum_prop": 0.6425531914893617, "repo_name": "TechWritingWhiz/indy-node", "id": "35ceb04c0e893548233954a32d5b90fa14605afd", "size": "705", ...
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.time package provides functionality for manipulating times and dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in astr...
{ "content_hash": "5bfa4e300df40b2d0b31d69a3cf27972", "timestamp": "", "source": "github", "line_count": 1726, "max_line_length": 93, "avg_line_length": 39.90961761297798, "alnum_prop": 0.5627286452586958, "repo_name": "tbabej/astropy", "id": "d54d842f6ece686325f40e60d776790e5c3acf20", "size": "6888...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.codegen.jaxb.jaxb_library import JaxbLibrary from pants.base.deprecated import deprecated_module deprecated_module('1.5.0dev0', 'Use pants.backend...
{ "content_hash": "6a240d0698c808e40ca0c05aa264433d", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 93, "avg_line_length": 37.1, "alnum_prop": 0.7520215633423181, "repo_name": "lahosken/pants", "id": "726d8be7917c0b4b0c11ca07edf36546b08873a0", "size": "518", "binary": f...
""" Python implementation of the io module. """ from __future__ import (print_function, unicode_literals) import os import abc import codecs import warnings import errno # Import thread instead of threading to reduce startup cost try: from thread import allocate_lock as Lock except ImportError: from dummy_thr...
{ "content_hash": "6d48824b59c874c7c12f51ff70b0a499", "timestamp": "", "source": "github", "line_count": 2005, "max_line_length": 81, "avg_line_length": 34.12369077306733, "alnum_prop": 0.5762810956181121, "repo_name": "azoft-dev-team/imagrium", "id": "d5114338fad37808883881cd63658569fd3da36a", "siz...
''' ## License The MIT License (MIT) GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi. Copyright (C) 2015 Dexter Industries Jetduino for the Jetson TK1/TX1: an open source platform for connecting Grove Sensors to the Jetson embedded supercomputers. Copyright (C...
{ "content_hash": "1738e65f0d8ce1348610f793fa542ab6", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 103, "avg_line_length": 36.898305084745765, "alnum_prop": 0.7629765732659624, "repo_name": "NeuroRoboticTech/Jetduino", "id": "6c5f804b3b5e947c187546e684130bc4cda8fe05", "s...
import time from pymongo import MongoClient #from subprocess import Popen, PIPE import FindVid as fv from sys import argv, exit import hashlib import os import subprocess, shlex def hashFile(filename, blocksize=65536): hash = hashlib.sha1() # File not found error is thrown up(wards) with open(filename, 'rb') as f: ...
{ "content_hash": "7dd9b3ebbd52fb0ce57a2fecdae3efaa", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 125, "avg_line_length": 28.806451612903224, "alnum_prop": 0.7015677491601344, "repo_name": "findvid/main", "id": "00358b9493cc1d6a492778ac8f9ce7a79372e012", "size": "3594"...
""" Created on Aug 23, 2015 @author: jrm """ import enaml from enaml.qt.qt_application import QtApplication import enamlx if __name__ == "__main__": enamlx.install() with enaml.imports(): from tree_view import Main app = QtApplication() view = Main() view.show() app.start()
{ "content_hash": "8a958a6d4d10f16fe30ef5ea83073c4e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 16.36842105263158, "alnum_prop": 0.6237942122186495, "repo_name": "frmdstryr/enamlx", "id": "1a1cc1bca5b11f75456907c6076d9cd035612545", "size": "335"...
from .trace import ( GetTraceRequest, ListTracesRequest, ListTracesResponse, PatchTracesRequest, Trace, Traces, TraceSpan, ) __all__ = ( "GetTraceRequest", "ListTracesRequest", "ListTracesResponse", "PatchTracesRequest", "Trace", "Traces", "TraceSpan", )
{ "content_hash": "0f72a5cd352b32c0688b30b796fe204f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 25, "avg_line_length": 16.42105263157895, "alnum_prop": 0.6217948717948718, "repo_name": "googleapis/python-trace", "id": "ea3865326a7f45f3143bf91eab99494032d70604", "size"...
"""Django settings for tests.""" import os import django BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # Quick-start development settings - unsuitable for production SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890' INTERNAL_IPS = ['127.0.0.1'] LANGUAGE_CODE = 'en' LANGUAGES = ( ('en', 'English'),...
{ "content_hash": "ab6dff87b5672e572613ee17338f5c94", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 76, "avg_line_length": 21.84, "alnum_prop": 0.6843711843711844, "repo_name": "Christophe31/django-tickets", "id": "5fc40bcbbfe369a87cb1c2ea0298dd2d7c07b8f3", "size": "1638"...
import win32api, win32con import actionFunctions #An Example GameAI with sample values #All Values should be replaced and defined for a real game """ All coordinates assume a screen resolution of 1280x1024, and Chrome maximized with the Bookmarks Toolbar enabled. Down key has been hit 4 times to center play area in ...
{ "content_hash": "eff1623a989d14609e125e02851b3880", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 99, "avg_line_length": 27.844444444444445, "alnum_prop": 0.7525937749401437, "repo_name": "cmsc471-swagbag/ScoreAttackBot", "id": "f4bf5e93fd16d1c0345c92078fcfc0a58bacc3dd", ...
import json import requests class KeyardClient(object): def __init__(self, keyard_host): self.keyard_host = keyard_host + "/keyard" def _make_request(self, method, data): requests_method = getattr(requests, method.lower()) kwargs = { 'headers': {'content-type': 'applicati...
{ "content_hash": "7468d1a7ebfd101b3fb198226b28d370", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 79, "avg_line_length": 32.35087719298246, "alnum_prop": 0.5629067245119306, "repo_name": "rzanluchi/keyard-client", "id": "6596d61fd26867051fbba55235ee9c16ff2c1a6c", "size"...
import os, sys #=================================================================================================== # ToStr #=================================================================================================== def ToStr(o): if hasattr(o, 'ToStr'): return o.ToStr() return str(o) def Con...
{ "content_hash": "e86b00056fe78c25a6f7982db0ece9a7", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 100, "avg_line_length": 33.966921119592875, "alnum_prop": 0.39718330961120685, "repo_name": "ArcherSys/ArcherSys", "id": "cff6ed1175aedbd0d75a1456593b313ac1242b62", "size"...
""" Managed variant For potentially causative variants that are not yet in ClinVar and have yet not been marked causative in any existing case. """ from datetime import datetime from scout.utils.md5 import generate_md5_key class ManagedVariant(dict): """ # required primary fields chromosome=st...
{ "content_hash": "21c50d1299925d4883bb751169f3f035", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 98, "avg_line_length": 29.03448275862069, "alnum_prop": 0.5435471100554236, "repo_name": "Clinical-Genomics/scout", "id": "d9277ea1f79de8f391fc962fee015ed13aa1cce4", "size"...
from __future__ import absolute_import from .. import QROOT from ..decorators import snake_case_methods from .base import Plottable from ..base import NameOnlyObject import six __all__ = [ 'F1', 'F2', 'F3', ] class BaseFunction(object): class ParProxy(object): def __init__(self, fcn, idx): ...
{ "content_hash": "ed99d5be318a766be1b4f86769ee1915", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 76, "avg_line_length": 26.939393939393938, "alnum_prop": 0.567679040119985, "repo_name": "rootpy/rootpy", "id": "87478457e9d7f6474522534745cb909e6f9d643d", "size": "2667", ...
"""The tests for generic camera component.""" import unittest from unittest import mock import requests_mock from werkzeug.test import EnvironBuilder from homeassistant.bootstrap import setup_component from homeassistant.components.http import request_class from tests.common import get_test_home_assistant class Te...
{ "content_hash": "0385f8299597f44c3ea3fcf3bf83b900", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 74, "avg_line_length": 35.87826086956522, "alnum_prop": 0.5935530780416869, "repo_name": "leoc/home-assistant", "id": "df80b48e36bc8c6c07bc1ad8bd77776735f6b6cf", "size": "...
"""Script to create demonstration sets from our trained policies. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function # pylint: disable=g-import-not-at-top,g-bad-import-order import platform if int(platform.python_version_tuple()[0]) < 3: import cPickle a...
{ "content_hash": "b17cefa30aeecabdd16f5349400246cb", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 77, "avg_line_length": 32.95575221238938, "alnum_prop": 0.7027389903329753, "repo_name": "google-research/google-research", "id": "209d2714798b3d22b297f957fdaaeef707fdf647",...
import mpi4py.MPI as mpi master = mpi.Comm.Get_parent() intra = master.Merge() print('ouvrier: %d/%d' % (intra.Get_rank(), intra.Get_size())) intra.Disconnect() master.Disconnect()
{ "content_hash": "c49e027a138de590f875ed66c291e71b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 12.666666666666666, "alnum_prop": 0.6684210526315789, "repo_name": "rboman/progs", "id": "d34e253b0cfe1cf9ed33c5ccbd3168ba83f552b5", "size": "252", ...
"""Environment variables, to track the state of libpb and the ports.""" from __future__ import absolute_import import os __all__ = [ "CPUS", "CONFIG", "DEPEND", "MODE", "PKG_MGMT", "STAGE", "TARGET", "env", "master", "flags", ] CPUS = os.sysconf("SC_NPROCESSORS_ONLN") PORTSDIR = "/usr/ports" PK...
{ "content_hash": "8e84c2ef088a9cf376b116171e4dd5a1", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 80, "avg_line_length": 45.05769230769231, "alnum_prop": 0.5840802390098164, "repo_name": "DragonSA/portbuilder", "id": "cab36ff4982c0ad9f8c41af60e920a22f28a09b5", "size": ...
""" Tts API Description # noqa: E501 The version of the OpenAPI document: 2.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from t...
{ "content_hash": "2e8e3ebd709d136bcd1f39b6c92925c2", "timestamp": "", "source": "github", "line_count": 1852, "max_line_length": 122, "avg_line_length": 46.56425485961123, "alnum_prop": 0.5668564537263587, "repo_name": "Telestream/telestream-cloud-python-sdk", "id": "455b8837344252df1ab044d7b8e2a2f64...
'''@file trainer.py neural network trainer environment''' import os from abc import ABCMeta, abstractmethod from time import time, sleep import tensorflow as tf import numpy as np class Trainer(object): '''General class outlining the training environment of a classifier.''' __metaclass__ = ABCMeta def __...
{ "content_hash": "02d50423841715826c5889f82fbca677", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 80, "avg_line_length": 40.48471615720524, "alnum_prop": 0.5031460108582317, "repo_name": "JeroenBosmans/nabu", "id": "6777ab2b583e63a3a3e59cf58ccbb3d1faa945b6", "size": "2...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: docker_secret short_description: Manage docker secrets. v...
{ "content_hash": "d4f458fd3925377aa6ccfa45de4cac15", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 137, "avg_line_length": 29.94463667820069, "alnum_prop": 0.6067714351744858, "repo_name": "SergeyCherepanov/ansible", "id": "2554d90ac0143bd13315f59ef7050b43f4581262", "si...
import _plotly_utils.basevalidators class FillcolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="fillcolor", parent_name="layout.newshape", **kwargs ): super(FillcolorValidator, self).__init__( plotly_name=plotly_name, parent_n...
{ "content_hash": "93e98eb96f783d3896ef006e7a980401", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 32.61538461538461, "alnum_prop": 0.6108490566037735, "repo_name": "plotly/plotly.py", "id": "8ccefafa0b710bac093b9f9a7a856982b0dc35e5", "size": "424"...
import click @click.command() def main(args=None): """Console script for langevin_dynamics""" click.echo("Replace this message by putting your code into " "langevin_dynamics.cli.main") click.echo("See click documentation at http://click.pocoo.org/") if __name__ == "__main__": main()
{ "content_hash": "621ec0e480d46e9055dcae325bcc3ee1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 68, "avg_line_length": 26.583333333333332, "alnum_prop": 0.6394984326018809, "repo_name": "arosenstein/langevin_dynamics", "id": "82c0bffb576215a33686840459cf5e188dececf2", ...
import subprocess import sys import typer from typer.testing import CliRunner from docs_src.parameter_types.bool import tutorial004 as mod runner = CliRunner() app = typer.Typer() app.command()(mod.main) def test_help(): result = runner.invoke(app, ["--help"]) assert result.exit_code == 0 assert "-d" ...
{ "content_hash": "f28e63815dd4c009e359e82d9ab50aa3", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 74, "avg_line_length": 22.27659574468085, "alnum_prop": 0.6494746895893028, "repo_name": "tiangolo/typer", "id": "a01034d6ebc9ea421fead77236236e55734a7ad9", "size": "1047",...
"""Tests for the album art fetchers.""" import _common from _common import unittest from beetsplug import fetchart from beets.autotag import AlbumInfo from beets import library from beets import importer import os import shutil import StringIO class MockHeaders(object): def __init__(self, typeval): self.t...
{ "content_hash": "a6d08d4fe49024efa1616d7de37bd778", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 128, "avg_line_length": 38.54416961130742, "alnum_prop": 0.6365969930326366, "repo_name": "aspidites/beets", "id": "37ffc176fb606d0b82bb6233b2ba0e9e51f059e9", "size": "115...
r"""Run the Rust ELO calculator on all original images. Filters out evaluations for each of the original images and runs the Rust ELO calulator on each original image to create ELO results for all distortions per original. """ import argparse import json import os import subprocess import sys import tempfile parser ...
{ "content_hash": "d1864660f0b13a2d24d240501781aee8", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 75, "avg_line_length": 34.33898305084746, "alnum_prop": 0.6692991115498519, "repo_name": "google-research/google-research", "id": "5584098aef9eeb4015b5c16ea3f612acdc00132d", ...
import argparse import fcntl import logging import os import subprocess import sys import time BASE_DIR = os.environ.get('OS_REFRESH_CONFIG_BASE_DIR', '/opt/stack/os-config-refresh') PHASES = ['pre-configure', 'configure', 'migration', 'post-configure'] def mai...
{ "content_hash": "13b0df82eb6cf21c0ef2f9f739b70d01", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 79, "avg_line_length": 34.93181818181818, "alnum_prop": 0.5757970071567989, "repo_name": "ccrouch/os-refresh-config", "id": "d2393edfd938fdb7d4b8e73181815afc1c8af513", "siz...
import os import re import socket import stat import time from ironic.common import exception from ironic.common import utils from ironic.openstack.common import excutils from ironic.openstack.common import log as logging from ironic.openstack.common import processutils LOG = logging.getLogger(__name__) # All func...
{ "content_hash": "917ee4acea4767435b49678b4dd53cee", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 79, "avg_line_length": 35.04089219330855, "alnum_prop": 0.5854020793549756, "repo_name": "JioCloud/ironic", "id": "bad64584774f9095451b3d2052fb0948781ceaed", "size": "1006...
from subprocess import call from os import path import hitchpostgres import hitchselenium import hitchpython import hitchserve import hitchredis import hitchtest import hitchsmtp # Get directory above this file PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..')) class ExecutionEngine(hitchtest...
{ "content_hash": "fa5f9d722c09b224659b4e62739c7deb", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 114, "avg_line_length": 34.36486486486486, "alnum_prop": 0.6112858828155722, "repo_name": "reuf/de_pedia_ba", "id": "f9c99424d06b775048c0fb3ae5ebefd6157b700c", "size": "50...
from config import config import pycurl, cStringIO buf = cStringIO.StringIO() fields = { 'token': config['api_token'], 'content': 'file', 'action': 'export', 'record': 'f21a3ffd37fc0b3c', 'field': 'file_upload', 'event': 'event_1_arm_1' } ch = pycurl.Curl() ch.setopt(ch.URL, config['api_url']...
{ "content_hash": "09cf8c6d3ddd36c4cc2a5955d23f0ede", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 38, "avg_line_length": 19.91304347826087, "alnum_prop": 0.6550218340611353, "repo_name": "KevinDufendach/VandAID", "id": "87dc5d82b74fbf99da21a088f93479a89de98394", "size":...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('resource', '0001_initial'), ] operations = [ migrations.AlterField( model_name='logicalresource', name='id', field=models.BigAutoField(auto_created=True,...
{ "content_hash": "495ad86f9065a703532abd3fb4e19665", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 111, "avg_line_length": 33.903225806451616, "alnum_prop": 0.5946717411988582, "repo_name": "Semprini/cbe", "id": "274d7d36c98ac73ac5fd69bcd40a2f4763939af6", "size": "1100",...
"""accounts user forms.""" from django import forms from django.contrib import auth from accounts.models import CustomUser class CustomUserCreationForm(auth.forms.UserCreationForm): """A form to create users.""" #https://groups.google.com/forum/?fromgroups=#!topic/django-users/kOVEy9zYn5c def clean_us...
{ "content_hash": "bfa6fdcbb678da930515e0df86679b3d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 81, "avg_line_length": 29.939393939393938, "alnum_prop": 0.6973684210526315, "repo_name": "juliotrigo/django-accounts", "id": "82d79f3ba6eed84d3cbdddf0bf4f971baa51736a", "s...
"""The tests for the Netgear Arlo sensors.""" from collections import namedtuple from unittest.mock import patch import pytest from homeassistant.components.arlo import DATA_ARLO, sensor as arlo from homeassistant.const import ( ATTR_ATTRIBUTION, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, PERCEN...
{ "content_hash": "2e2fa85a1f4b167d9b268a0baf508bed", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 85, "avg_line_length": 29.8068669527897, "alnum_prop": 0.666234701223902, "repo_name": "kennedyshead/home-assistant", "id": "b8389d1903fb8019d472f95695e80bdfb69349c3", "si...
import os import logging from google.appengine.dist import use_library use_library('django', '1.1') APP_ROOT_DIR = os.path.abspath(os.path.dirname(__file__)) #Stashboard version VERSION = "1.1.4" # If we're debugging, turn the cache off, etc. # Set to true if we want to have our webapp print stack traces, etc DEBUG...
{ "content_hash": "2eb53ba5fe418d55ee1ab5aa70416dc4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 88, "avg_line_length": 34.206896551724135, "alnum_prop": 0.6875, "repo_name": "progrium/stashboard", "id": "ab3d48f33f5c8dd57d1c69c3b986e5ca1b34fd56", "size": "2086", "bi...
"""KNL Spirits Spider implementation. Example: $ scrapy runspider knl_spirits_spider.py -o output.json """ import datetime import logging import scrapy class KnLSpiritsSpider(scrapy.Spider): """Simple extension of scrapy.Spider for KnL. """ name = "knlSpiritsSpider" download_delay = 1 custo...
{ "content_hash": "fbd06c28e271d219ece425312f1cb1c5", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 104, "avg_line_length": 31.22093023255814, "alnum_prop": 0.4465549348230912, "repo_name": "wriggityWrecked/WebScraping", "id": "2300cd9cf6ef539256d8f6424b876f2386070612", "...
from django.contrib import admin from suite.models import * # Register your models here. #class TestModelAdmin(admin.ModelAdmin): # pass #admin.site.register(TestModel, TestModelAdmin) # user class UserAdmin(admin.ModelAdmin): pass admin.site.register(User, UserAdmin) # account class AccountAdmin(admin.ModelAd...
{ "content_hash": "6c2994d9e3fa0e84b7cad0bc6d6ce83a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 50, "avg_line_length": 17.660714285714285, "alnum_prop": 0.7735085945399394, "repo_name": "fsxfreak/club-suite", "id": "deaed7df77a22d8b9dc575f785a225b8c35aa553", "size": "...
import os import cgi import utilities import ujson as json from datetime import datetime def lookupFiles(urlIdentifier): sqlCmd = """select globalId from meetingRegistry where urlIdentifier = %s""" sqlData = (urlIdentifier) resultList = utilities.dbExecution(sqlCmd, sqlData) globalId = resultList[2][0][0] g...
{ "content_hash": "97d4f2cb61255480d437dd243e50eb57", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 52, "avg_line_length": 20.246376811594203, "alnum_prop": 0.7072297780959198, "repo_name": "google/gov-meetings-made-searchable", "id": "d5513e26c972487ed0f61a76204a0005077f02...
from django.contrib.auth.models import AbstractUser class SalesRep(AbstractUser): USERNAME_FIELD = 'username'
{ "content_hash": "c3ffde4366778c0cef4a557270282f4b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 51, "avg_line_length": 23.2, "alnum_prop": 0.7844827586206896, "repo_name": "PreppyLLC-opensource/django-advanced-filters", "id": "b1b7eadf180e30975f796bcc894dde900c500fb0", ...
from copy import copy, deepcopy import pytest from pandas import MultiIndex import pandas.util.testing as tm def assert_multiindex_copied(copy, original): # Levels should be (at least, shallow copied) tm.assert_copy(copy.levels, original.levels) tm.assert_almost_equal(copy.codes, original.codes) # ...
{ "content_hash": "5db325d212602f025e6309ff26d9f594", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 79, "avg_line_length": 27.043956043956044, "alnum_prop": 0.6156034132466477, "repo_name": "cbertinato/pandas", "id": "17e81a348f186571af612955dde5ffa397da2722", "size": "24...
from __future__ import print_function from __future__ import division import unittest import numpy as np import paddle.fluid.core as core from op_test import OpTest import paddle.fluid as fluid def adaptive_start_index(index, input_size, output_size): return int(np.floor(index * input_size / output_size)) def...
{ "content_hash": "e3ef5ee5fedc5aea97522090b8090e78", "timestamp": "", "source": "github", "line_count": 1231, "max_line_length": 94, "avg_line_length": 31.751421608448418, "alnum_prop": 0.5600214910709717, "repo_name": "chengduoZH/Paddle", "id": "d5cc142b2a856cce93c8f8ef8f1bdf47f3a8e9d7", "size": "...
import os from datetime import datetime from django import forms from django.conf import settings from django.core.files.storage import default_storage as storage from django.forms.formsets import BaseFormSet, formset_factory from django.utils.translation import ugettext, ugettext_lazy as _, ungettext import six impo...
{ "content_hash": "47d3ded6332ce93f22c9b0169f5c9f7f", "timestamp": "", "source": "github", "line_count": 709, "max_line_length": 78, "avg_line_length": 38.44569816643159, "alnum_prop": 0.5974759703573262, "repo_name": "aviarypl/mozilla-l10n-addons-server", "id": "762a1b2a72791ff8f220a3b9eb73a60bab9588...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0007_organization_slug'), ] operations = [ migrations.AlterField( model_name='organization', name='slug', field=models.SlugField(unique=True), ...
{ "content_hash": "f8384f64345ba8da06d64d00617abcbf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 48, "avg_line_length": 20.9375, "alnum_prop": 0.573134328358209, "repo_name": "CobwebOrg/cobweb-django", "id": "1381a2ba075f79902e9149f929273bda80fd3170", "size": "384", ...
import os import yaml IDF_PATH = os.getenv("IDF_PATH") if not IDF_PATH: print("Please set IDF_PATH before running this script") raise SystemExit(-1) GITLAB_CONFIG_FILE = os.path.join(os.getenv("IDF_PATH"), ".gitlab-ci.yml") def check_artifacts_expire_time(): with open(GITLAB_CONFIG_FILE, "r") as f: ...
{ "content_hash": "805c5e86a5e4e335484112af23147a07", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 92, "avg_line_length": 25.02127659574468, "alnum_prop": 0.5756802721088435, "repo_name": "krzychb/rtd-test-bed", "id": "3eb06c177c6ec5fd7af2425e4fceca51b9cc131f", "size": "...
"""Loads all local server plugins.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals
{ "content_hash": "bd224fd349fea05b0d33454a171a93fd", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 39, "avg_line_length": 30, "alnum_prop": 0.74, "repo_name": "dunkhong/grr", "id": "490487f27a0bc08bac264d774170733aa3615c6d", "size": "172", "binary": false, "copies": "...
import argparse def main(): parser = argparse.ArgumentParser(description='Creates a file and writes into it.') parser.add_argument('file_name', help='File name to be written to.') parser.add_argument('contents', help='A string to be written into the file.') args, unknown_args = parser.parse_known_arg...
{ "content_hash": "5b7d67b217f176b3e144d521891fa8a1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 86, "avg_line_length": 28.933333333333334, "alnum_prop": 0.6589861751152074, "repo_name": "BD2KGenomics/slugflow", "id": "4fbdb045f49b9b03a0b83597af2517bb73ffb94a", "size":...
"""Utilities and helper functions.""" import threading from oslo_config import cfg from oslo_utils import timeutils ROOTWRAP_CONF = "/etc/ceilometer/rootwrap.conf" OPTS = [ cfg.StrOpt('rootwrap_config', default=ROOTWRAP_CONF, help='Path to the rootwrap configuration file to ' ...
{ "content_hash": "785ce59174caeecc4e2809651f91d0c6", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 65, "avg_line_length": 23.8, "alnum_prop": 0.6395891690009337, "repo_name": "openstack/ceilometer", "id": "a86ebeee0b68b235fe77e34d143a4050e5035e33", "size": "1842", "bin...
"""Install Pegasus.""" import setuptools # Get the long description from the README file. with open('README.md') as fp: _LONG_DESCRIPTION = fp.read() setuptools.setup( name='pegasus', version='0.0.1', description='Pretraining with Extracted Gap Sentences for Abstractive Summarization with Sequence-to-s...
{ "content_hash": "454f4c135d344576b990a3f66c005aa8", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 121, "avg_line_length": 30.57777777777778, "alnum_prop": 0.6293604651162791, "repo_name": "google-research/pegasus", "id": "918d4b5c70679a372ff5b37c8706670c7b38b9bd", "size...
from __future__ import unicode_literals import os import stat import sys import tempfile from django.core.management import execute_from_command_line from django.test.simple import DjangoTestSuiteRunner import nose try: import cProfile as profile except ImportError: import profile try: # Make sure to pre...
{ "content_hash": "ba0853ef914a1bd640edf9013bde8df0", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 32.73376623376623, "alnum_prop": 0.5863915889704424, "repo_name": "bkochendorfer/reviewboard", "id": "b684ed5f5227ecb33d070ee9eaea80f3d6d7bbfb", "si...
"""Various helpers to handle config entry and api schema migrations.""" import logging from aiohue import HueBridgeV2 from aiohue.discovery import is_v2_bridge from aiohue.v2.models.device import DeviceArchetypes from aiohue.v2.models.resource import ResourceTypes from homeassistant import core from homeassistant.co...
{ "content_hash": "a87f8c73613140ae5f6b6c96d30d86c2", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 96, "avg_line_length": 41.806306306306304, "alnum_prop": 0.5691197069281327, "repo_name": "jawilson/home-assistant", "id": "9891cc65b0cc308c0162dc1b066ec4d94eb7a56d", "siz...
""" Generic GeoRSS events service. Retrieves current events (typically incidents or alerts) in GeoRSS format, and shows information on events filtered by distance to the HA instance's location and grouped by category. """ from datetime import timedelta import logging from georss_client import UPDATE_OK, UPDATE_OK_NO_...
{ "content_hash": "31e53b5200c40d4e552a4153ecd750a3", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 92, "avg_line_length": 31.011904761904763, "alnum_prop": 0.6214971209213052, "repo_name": "pschmitt/home-assistant", "id": "5a11136fd43131165e3be702ec9b4391e1ff7211", "siz...
import os import vision_batch_annotate_files RESOURCES = os.path.join(os.path.dirname(__file__), "resources") def test_sample_batch_annotate_files(capsys): file_path = os.path.join(RESOURCES, "kafka.pdf") vision_batch_annotate_files.sample_batch_annotate_files(file_path=file_path) out, _ = capsys.read...
{ "content_hash": "cdaaa0b8cf6565aab3852be06021526e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 80, "avg_line_length": 24.8125, "alnum_prop": 0.7128463476070529, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "f8dbe7329165b2c84ae103adecd9140ce041a1e1", ...
import argparse import pandas as pd import matplotlib.pyplot as plt from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() def read_json(fname): df = pd.read_json(fname, lines=True, convert_dates=['time'], date_unit='ms') df['conference_id'] = df['conf_name'] + df['conf_cr...
{ "content_hash": "91ab8097029d69b6049bdcd3c8043f0c", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 168, "avg_line_length": 38.701492537313435, "alnum_prop": 0.6171744440159403, "repo_name": "jitsi/jitsi-videobridge", "id": "60f602b9bb6b6baa712f7a75e98c89801342abf1", "si...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): operations = [ migrations.CreateModel( name='NestedModel', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=Tru...
{ "content_hash": "442f739891a5583b5687bd8e524f0389", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 114, "avg_line_length": 26.3125, "alnum_prop": 0.5748218527315915, "repo_name": "jimlyndon/django-activity-stream", "id": "45faf01215cd0304a09c9b6af6745edb3f80ffee", "size"...
"""Test result related classes.""" from collections import OrderedDict import shard_util import time from result_sink_util import ResultSinkClient _VALID_RESULT_COLLECTION_INIT_KWARGS = set(['test_results', 'crashed']) _VALID_TEST_RESULT_INIT_KWARGS = set( ['attachments', 'duration', 'expected_status', 'test_log...
{ "content_hash": "c916249e458453676fd169cc3ddae2b1", "timestamp": "", "source": "github", "line_count": 408, "max_line_length": 125, "avg_line_length": 36.50735294117647, "alnum_prop": 0.6598858677408527, "repo_name": "scheib/chromium", "id": "08c0a5ce817f3fb6c87ed1a874e74711bd60d9b6", "size": "150...
"""Wrappers to make getting and using hosts simpler.""" from aquilon.exceptions_ import NotFoundException, ArgumentError from aquilon.aqdb.model import Machine from aquilon.aqdb.model.dns_domain import parse_fqdn def hostname_to_host(session, hostname): # When the user asked for a host, returning "machine not f...
{ "content_hash": "eef89da3ac42d24c15715eec16684ccd", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 87, "avg_line_length": 33.0722891566265, "alnum_prop": 0.6262295081967213, "repo_name": "jrha/aquilon", "id": "0dba4f060e4c64ba4e1166a9bfd16f5947f51ad3", "size": "3453", ...
import numpy as np import matplotlib.pylab as plt from openmdao.api import Group, Problem, IndepVarComp from hyperloop.Python import tube_and_pod # def create_problem(component): # root = Group() # prob = Problem(root) # prob.root.add('comp', component) # return prob # class PressureTradeStudy(object...
{ "content_hash": "fee84be2a5c80e8a2107c1e51f4bfb09", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 152, "avg_line_length": 47.296551724137935, "alnum_prop": 0.6415864683581219, "repo_name": "andipeng/MagnePlane", "id": "1888072f4b7958e837e78c0113389304e4495c8c", "size":...
import re def to_list(input): if isinstance(input, (list, tuple)): return list(input) else: return [input] def resource_to_bytes(resource_str): if not resource_str: return resource_str matched = re.compile("([0-9]+)([a-z]+)?").match(resource_str.lower()) fraction_matched ...
{ "content_hash": "ff6309ac953e00a54f3cd7c70a66df30", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 91, "avg_line_length": 30.19148936170213, "alnum_prop": 0.5553206483439042, "repo_name": "intel-analytics/analytics-zoo", "id": "ce699dabee440b96a002420470e9efe244079a47", ...
from django.contrib import admin from .models import Recipe class RecipeAdmin(admin.ModelAdmin): model = Recipe admin.site.register(Recipe, RecipeAdmin)
{ "content_hash": "15db2d93e8f1a78f729cdad38b7c7d80", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 40, "avg_line_length": 17.88888888888889, "alnum_prop": 0.782608695652174, "repo_name": "talpor/recipe-search-hackathon", "id": "942a24315ac446e5f2b1ec9fec41be84beff1807", "...
import subprocess import sys import spiceutils # a generic gate # has a logical effort # has a parasitic delay class Gate: def __init__(self, **kwargs): pass def get_le(self): pass def get_gamma(self): pass def get_input_load(self): pass def set_size(self): ...
{ "content_hash": "71796facf01f7bc7972ce240807eb04f", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 82, "avg_line_length": 28.81578947368421, "alnum_prop": 0.5627853881278538, "repo_name": "subhasis256/cache_spice", "id": "48aa75945a0ee93ac3b1aaae195ec89f8bea25b9", "size...
from unittest import skipUnless from django.core.management.color import no_style from django.db import connection from django.test import TestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from .models import Article, ArticleTranslation, IndexTogetherSingleList @ignore_warnings...
{ "content_hash": "a037e8b0f59514b6a6fe2cd1dfdb41bf", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 98, "avg_line_length": 44.62626262626262, "alnum_prop": 0.6727025803531009, "repo_name": "pquentin/django", "id": "1d60f215fec6a9f109a0f49eefc2ae66bc380450", "size": "4418"...
from django.apps import apps as global_apps from django.contrib.contenttypes.management import create_contenttypes from django.db import models, migrations from django.utils.timezone import now MARKER = '.. Migrated from django_comments_xtd.Comment model.\n\n' comments_app_name = 'django_comments_xtd' content_type = ...
{ "content_hash": "87eabd4d3dc96983661faf93fab14336", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 88, "avg_line_length": 35.732394366197184, "alnum_prop": 0.6621994481671265, "repo_name": "python/pythondotorg", "id": "ba9d78d4fcbddb60aef21ad9817004b5a2afec22", "size": "...
from xml.etree import ElementTree as ET if __name__ == '__main__': infile = '/etc/tomcat5.5/tomcat-users.xml' tomcat_users = ET.parse(infile) for user in [e for e in tomcat_users.findall('./user') if e.get('name') == 'tomcat']: print (user.attrib)
{ "content_hash": "8308cfa6131a1a73c8942c08bd3e21a8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 62, "avg_line_length": 31, "alnum_prop": 0.5985663082437276, "repo_name": "lluxury/P_U_S_A", "id": "0dd1132f4a72538ea19ca3c4092d51bea5956c08", "size": "302", "binary": fal...
''' fantastic Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in th...
{ "content_hash": "5556d3134de3d2848dd1c4a962d9039e", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 165, "avg_line_length": 34.34108527131783, "alnum_prop": 0.5374717832957111, "repo_name": "TheWardoctor/Wardoctors-repo", "id": "9719f27558df728675e4e40ccc04dd5e49643191", ...
"""engine.SCons.Tool.f03 Tool-specific initialization for the generic Posix f03 Fortran compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2...
{ "content_hash": "980f272587240d045ceb7750d3e62e65", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 119, "avg_line_length": 32.714285714285715, "alnum_prop": 0.7428432799611839, "repo_name": "sftd/scons", "id": "258db7066cb53713c6b414a904a18720d9d7033b", "size": "2061", ...
from .server import * from .async import asyncweb, webcoroutine notify = asyncweb.notify notify_after = asyncweb.notify_after
{ "content_hash": "685a3c8983030bb403aa89cff6a0358d", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 41, "avg_line_length": 25.2, "alnum_prop": 0.8015873015873016, "repo_name": "jtackaberry/stagehand", "id": "935afc248a886a58f7ad6911542c22a93170f518", "size": "126", "bina...
from abc import ABCMeta def _make_delegator_method(name): def delegator(self, *args, **kwargs): return getattr(self.__delegate__, name)(*args, **kwargs) # pragma: no cover # todo: consider using __call__() instead of __delegate__ # in Python delegates are objects with __call__ method.. ...
{ "content_hash": "5ac09587177b8981a272f14a2d3f1057", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 119, "avg_line_length": 35.47540983606557, "alnum_prop": 0.6164510166358595, "repo_name": "SergeyPirogov/selene", "id": "4790afe07c99445354df0a84235383f75387a69b", "size": ...
import Adafruit_BBIO.ADC as ADC import time ADC.setup() sensor1 = "P9_40" # left infrared sensor sensor2 = "P9_39" sensor3 = "P9_38" # middle infrared sensor sensor4 = "P9_37" sensor5 = "P9_36" # right infrared sensor while True: #reading1 = ADC.read(sensor1) #reading2 = ADC.read(sensor2) #reading3 = ...
{ "content_hash": "d2cb71ab25db9aa80305cec8595358e6", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 42, "avg_line_length": 24.095238095238095, "alnum_prop": 0.6620553359683794, "repo_name": "kohloderso/quickbot_bbb", "id": "2332ee61b8959fb70e63a033ce9c6851040b1305", "size...
from main import db from datetime import datetime import pytz from sqlalchemy import orm class Reservation(db.Model): END_BEFORE_START_ERROR_MESSAGE = "End date cannot be before start date" __tablename__ = 'reservations' id = db.Column(db.Integer, primary_key=True) startTime = db.Column(db.DateTime) ...
{ "content_hash": "abcc39bc48de8a20bbbb2e7f4f4909ae", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 100, "avg_line_length": 37.529411764705884, "alnum_prop": 0.646551724137931, "repo_name": "patklaey/ZermattReservationAPI", "id": "652dbd42d91f07467313e5213a190a9213a3337c", ...