text
stringlengths
4
1.02M
meta
dict
from CIM15.IEC61968.Metering.EndDeviceFunction import EndDeviceFunction class GasMeteringFunction(EndDeviceFunction): """Functionality performed by a gas meter. It's entirely possible that the metering system would carry information to/from gas meters even though it was built primarily to carry the higher-value el...
{ "content_hash": "f143bc361ddb83f7f81c982ebc9e0157", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 431, "avg_line_length": 44.89473684210526, "alnum_prop": 0.7057444314185228, "repo_name": "rwl/PyCIM", "id": "bd596cef9ba149198baf803373195292b5b9ede9", "size": "1953", "...
from flask import Blueprint from flask import abort, current_app, g, make_response, jsonify from todo.models import Task todo = Blueprint('todo', __name__) @todo.errorhandler(404) def not_found(error): return make_response(jsonify({'error': 'Not found'}), 404) @todo.route('/', methods=['GET']) def check_heal...
{ "content_hash": "5073ec841963aa261ca5f8ca08b93b0a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 64, "avg_line_length": 23.482758620689655, "alnum_prop": 0.657856093979442, "repo_name": "IamGianluca/todo", "id": "540233156c7af32e6f20f79043da887db3d5bfe4", "size": "681"...
''' PartsGenie (c) University of Manchester 2017 PartsGenie is licensed under the MIT License. To view a copy of this license, visit <http://opensource.org/licenses/MIT/>. @author: neilswainston ''' import json import sys import time from parts_genie.parts import PartsThread from pathway_genie.pathway import Pathw...
{ "content_hash": "ae8ef70c52b33ac72ed7d2d839e6b21f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 76, "avg_line_length": 28.813333333333333, "alnum_prop": 0.5659416936603424, "repo_name": "synbiochem/PathwayGenie", "id": "7ac66e624cb52bc0c37383cc484917fe64de3b75", "size...
import sys import time import subprocess from subprocess import Popen from subprocess import PIPE import json import os import re import base64, uuid, io, codecs, mimetypes import shutil import shlex import xml.dom.minidom try: from urllib2 import Request, urlopen from urllib2 import URLError, HTTPError from httplib...
{ "content_hash": "f6775e67c1fd302e6338fddd2074466f", "timestamp": "", "source": "github", "line_count": 968, "max_line_length": 253, "avg_line_length": 41.836776859504134, "alnum_prop": 0.708430045928194, "repo_name": "emanuelbadaceanu/Thoth", "id": "a4b540427bb311a2df6ada85c647cafe519d2fed", "size...
import datetime import sys import os # Add flask_velox to the Path root = os.path.abspath( os.path.join( os.path.dirname(__file__), '..', ) ) sys.path.append(os.path.join(root, 'doit')) now = datetime.datetime.utcnow() year = now.year version = open(os.path.join(root, 'VERSION')).read().splitl...
{ "content_hash": "d20ddf0d93326f79abd42d298685a64f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 73, "avg_line_length": 22.78, "alnum_prop": 0.6321334503950834, "repo_name": "spacedogXYZ/Flask-Store", "id": "ac77ccf502dd694bbfe5e380276dc9f8c3e6d5ee", "size": "1164", ...
""" Program to test hdf5 functionality. It works. """ import numpy as np import h5py import matplotlib.pyplot as plt import subprocess, os def writeHdf5(filename): f=h5py.File(filename, "w") sampleValues= np.array([1.1,17.0,6.2]) f["sampleValues"]= sampleValues f.close() def dumpHdf5(filename): """Method t...
{ "content_hash": "f6fda5ea9a387494f3a7b2272a7e9b48", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 48, "avg_line_length": 18.674418604651162, "alnum_prop": 0.6911581569115816, "repo_name": "tomacorp/thermapythia", "id": "e2ec15e296eb0681b55c9ccf6b051b48b91db58f", "size":...
import script_chdir from evaluation.eval_script import evaluate_models_xval, print_results, EvalModel from hybrid_model.dataset import get_dataset # Get dataset dataset = get_dataset('ml100k') # dataset = get_dataset('ml1m') models = [] # Hybrid Model from hybrid_model.hybrid import HybridModel from hybrid_model.con...
{ "content_hash": "68a889d4c31b4d6f28890567d7256f23", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 81, "avg_line_length": 24.583333333333332, "alnum_prop": 0.7231638418079096, "repo_name": "sbremer/hybrid_rs", "id": "67a3c37e2e839c6b169426079a37258bf35dc37c", "size": "89...
from datetime import datetime, timedelta from disco.bot.command import CommandError UNITS = { 's': lambda v: v, 'm': lambda v: v * 60, 'h': lambda v: v * 60 * 60, 'd': lambda v: v * 60 * 60 * 24, 'w': lambda v: v * 60 * 60 * 24 * 7, } def parse_duration(raw, source=None, negative=False, safe=Fal...
{ "content_hash": "0c88aae207d39d0478c020f66661674a", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 86, "avg_line_length": 27.986486486486488, "alnum_prop": 0.5364558184451955, "repo_name": "ThaTiemsz/jetski", "id": "1c0f80997d12ddd8f7fd81893657ae289a1e5cb2", "size": "207...
""" Data structures for sparse float data. Life is made simpler by dealing only with float64 data """ # pylint: disable=E1101,E1103,W0231 import numpy as np import warnings from pandas.core.dtypes.missing import isna, notna from pandas.core.dtypes.common import is_scalar from pandas.core.common import _values_from_o...
{ "content_hash": "8bb4f5c5ac6b4b0b47b8af1f22a09108", "timestamp": "", "source": "github", "line_count": 869, "max_line_length": 79, "avg_line_length": 34.64326812428078, "alnum_prop": 0.5387477163261917, "repo_name": "zfrenchee/pandas", "id": "8a38b1054a1f5cdb38c469a0c242459e7953f81b", "size": "301...
from __future__ import unicode_literals import copy import logging import sys import warnings from django.conf import compat_patch_logging_config, LazySettings from django.core import mail from django.test import TestCase, RequestFactory from django.test.utils import override_settings from django.utils.encoding impor...
{ "content_hash": "4759dff93a14d7ee44ec54535d019d01", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 116, "avg_line_length": 32.812849162011176, "alnum_prop": 0.6129224482846685, "repo_name": "dvliman/jaikuengine", "id": "a498510cfe5b8fb40d7bfa4f2b9b18aefd31d43c", "size":...
from __future__ import unicode_literals import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # sys.path.insert(0...
{ "content_hash": "c9677964d0f4e5a267602eba0fed6909", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 80, "avg_line_length": 31.70940170940171, "alnum_prop": 0.6902964959568734, "repo_name": "EliotBerriot/tempo", "id": "6308a53b36c51096809a6e9c809171535cb437b5", "size": "7...
import os import sys import subprocess import relpath import optparse import jsshells from collections import defaultdict base_path = os.path.split(os.path.abspath(__file__))[0] pass_file = os.path.join(base_path, "pass") fail_file = os.path.join(base_path, "fail") skip_file = os.path.join(base_path, "skip") default...
{ "content_hash": "88020e30fac57ee1998d6d4d8d86e602", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 109, "avg_line_length": 27.494949494949495, "alnum_prop": 0.5756796473181485, "repo_name": "Ms2ger/presto-testo", "id": "8212e06a840597fb092cf400a6e7ac09d5f32df8", "size":...
import warnings warnings.warn("Module is deprecated.", DeprecationWarning) import numpy from traits.api import Float from traitsui.api import View, Item from distribution import Distribution class Constant(Distribution): """ A constant distribution where all values are the same """ value = Float traits...
{ "content_hash": "f9b8afb98209792071097f959dba0d26", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 65, "avg_line_length": 23.38888888888889, "alnum_prop": 0.7268408551068883, "repo_name": "enthought/etsproxy", "id": "d224d650169bb568a9b1838f6ef768fa5064b312", "size": "10...
class Basis(BaseBuiltin): __slots__ = () GD_TYPE = lib.GODOT_VARIANT_TYPE_BASIS @staticmethod def _copy_gdobj(gdobj): return godot_basis_alloc(gdobj[0]) @classmethod def build_from_rows(cls, row0, row1, row2): cls._check_param_type('row0', row0, Vector3) cls._check_para...
{ "content_hash": "298d3c575ad8c0c00040eea7a7d84f30", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 147, "avg_line_length": 35.01149425287356, "alnum_prop": 0.6012803676953381, "repo_name": "razvanc-r/godot-python", "id": "dd245502f406354f44444835767c1ad2a3b9ad0c", "size...
import json from datetime import datetime from typing import Dict, List from croniter import croniter import frappe from frappe.model.document import Document from frappe.utils import get_datetime, now_datetime from frappe.utils.background_jobs import enqueue, get_jobs class ScheduledJobType(Document): def autonam...
{ "content_hash": "c0091e67d064e126fa65f83d919ab55d", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 137, "avg_line_length": 30.427835051546392, "alnum_prop": 0.6845671692359817, "repo_name": "mhbu50/frappe", "id": "1a795bab82588807cf95ffcc4900599dcfe7bd37", "size": "5991...
from appannie.util import format_request_data class FeaturesMetadata(object): CATEGORIES_ENDPOINT = '/meta/feature/categories' TYPES_ENDPOINT = '/meta/feature/types' def __init__(self, http_client, market): self.http_client = http_client self.market = market def categories(self, coun...
{ "content_hash": "b5372327b52073f58d63935c36b7c5c3", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 75, "avg_line_length": 34.6, "alnum_prop": 0.6748554913294798, "repo_name": "webhue/appannie", "id": "5dc1468294f63c5994f4227fae8999e4f2c09b58", "size": "692", "binary": ...
"""Convenience classes for configuring Vizier Study Configs and Search Spaces. This module contains several classes, used to access/build Vizier StudyConfig protos: * `StudyConfig` class is the main class, which: 1) Allows to easily build Vizier StudyConfig protos via a convenient Python API. 2) Can be init...
{ "content_hash": "1a297e107134ef142da95276bb471ced", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 90, "avg_line_length": 39.65562913907285, "alnum_prop": 0.647851258071699, "repo_name": "googleapis/python-aiplatform", "id": "0314e1442f587854c1b12853ece67b8c59f54531", "...
""" Class definitions to represent a molecular system and its chemical components .. todo:: * Create MoleculeImage, ParticleImage, AtomImage, VirtualSiteImage here. (Or ``MoleculeInstance``?) * Create ``MoleculeGraph`` to represent fozen set of atom elements and bonds that can used as a key for compression *...
{ "content_hash": "02a50f66d55d5e63f468c9ff2df6a885", "timestamp": "", "source": "github", "line_count": 2973, "max_line_length": 203, "avg_line_length": 36.883619239825094, "alnum_prop": 0.5848980894624048, "repo_name": "open-forcefield-group/openforcefield", "id": "6fa418aab99291d121e4c7187327900001...
from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Entry.pingback_enabled' db.add_column('zinnia_entry', 'pingback_enabled', self.gf('django.db.models.fields.BooleanField')(default=True, blank=True)) def ba...
{ "content_hash": "3ecd6a793b2eb34870e583ed2c420a32", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 178, "avg_line_length": 71.54444444444445, "alnum_prop": 0.5544339183102966, "repo_name": "westinedu/newertrends", "id": "91fd15c108c1144f1e03a0accf4bd638ea55fa3a", "size":...
"""Constants for the sia integration.""" from homeassistant.const import Platform PLATFORMS = [Platform.ALARM_CONTROL_PANEL, Platform.BINARY_SENSOR] DOMAIN = "sia" ATTR_CODE = "last_code" ATTR_ZONE = "last_zone" ATTR_MESSAGE = "last_message" ATTR_ID = "last_id" ATTR_TIMESTAMP = "last_timestamp" TITLE = "SIA Alarm o...
{ "content_hash": "7f5a80b1e5656791e6e1eb3b4c753f50", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 26.75, "alnum_prop": 0.684913217623498, "repo_name": "home-assistant/home-assistant", "id": "183b3422f784d007faf357b0e13f1a148f97741b", "size": "749"...
import hashlib import hmac import time from six.moves.urllib import parse as urlparse from tempest_lib.common.utils import data_utils from tempest.api.object_storage import base from tempest import test class ObjectFormPostTest(base.BaseObjectTest): metadata = {} containers = [] @classmethod def r...
{ "content_hash": "b497dd04df77a526f473dbec75ba1f3d", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 75, "avg_line_length": 35.0990990990991, "alnum_prop": 0.574435318275154, "repo_name": "yamt/tempest", "id": "ce587d74eceda2530dbc08f0fc419cf82c1fe4ba", "size": "4503", ...
""" Module containing a preprocessor that removes cells if they match one or more regular expression. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from traitlets import Set, Unicode from . import ClearOutputPreprocessor class TagRemovePreprocessor(ClearOut...
{ "content_hash": "ed556e4a478af24456bbce0cf56a3268", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 82, "avg_line_length": 39.426086956521736, "alnum_prop": 0.559108954565505, "repo_name": "nitin-cherian/LifeLongLearning", "id": "99869253cc398b7bc6d1e0b9abe24ebb7ae0c311", ...
from __future__ import unicode_literals import datetime from .base import OccurrenceDataTestCase from ..models import Occurrence, Notification from ..tasks import generate_occurrences, send_occurrence_notifications class OccurrenceAppTestCase(OccurrenceDataTestCase): "Integration test for larger SMS workflow." ...
{ "content_hash": "d6cfff6b72a73ed2574a301bfc4437fa", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 111, "avg_line_length": 51.16831683168317, "alnum_prop": 0.6989164086687306, "repo_name": "ewheeler/rapidsms-timelines", "id": "a5ee9524e58910a47fea27712d3ff911458c1f5d", ...
import _plotly_utils.basevalidators class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="ticktextsrc", parent_name="indicator.gauge.axis", **kwargs ): super(TicktextsrcValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "df1bb121dd2f966a919cb5d086b55705", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 85, "avg_line_length": 34.07142857142857, "alnum_prop": 0.6037735849056604, "repo_name": "plotly/python-api", "id": "f690812d0b4f52d3058243b8e8df2cc4ab5de3c5", "size": "477...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:24776") else: access = Se...
{ "content_hash": "c01be7e67a8596132c082816c4e53976", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 79, "avg_line_length": 24.19753086419753, "alnum_prop": 0.6618622448979592, "repo_name": "studio666/Speedcoin", "id": "7b7ec9e08543241c19790e72fa11da84dceebecb", "size": "...
""" :mod:`trove` -- Cloud PaaS Database Platform =================================== .. automodule:: trove :platform: Unix :synopsis: Platform-As-A-Service Database Cloud .. moduleauthor:: Michael Basnight <mbasnight@gmail.com> """
{ "content_hash": "e958008efe9f50e6c4cf2a817d263b6a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 56, "avg_line_length": 26.555555555555557, "alnum_prop": 0.5983263598326359, "repo_name": "citrix-openstack/build-trove", "id": "b3bc3ec742d7f5a6a75187d7faa60f1bed33b428", "...
import ShareYourSystem as SYS #Definition a Pymongoer MyPymongoer=SYS.PymongoerClass( ).pymongo( **{ 'FolderingPathVariable':SYS.Pymongoer.LocalFolderPathStr } ) #remove MyPymongoer.PymongoneClientVariable['MyDatabase'] MyPymongoer.PymongoneClientVariable.MyDatabase.ThingsCollection.remove({}) MyPymongoer.P...
{ "content_hash": "1363367c9a0ec071ddb0ecba5d324b75", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 89, "avg_line_length": 23.333333333333332, "alnum_prop": 0.792063492063492, "repo_name": "Ledoux/ShareYourSystem", "id": "5c997dc9cf3951469970345e553652c3b70a6db1", "size":...
from unittest.mock import patch from typing import Any from zerver.lib.test_classes import WebhookTestCase class BeeminderHookTests(WebhookTestCase): STREAM_NAME = 'beeminder' URL_TEMPLATE = u"/api/v1/external/beeminder?api_key={api_key}&stream={stream}" @patch('zerver.webhooks.beeminder.view.time.time') ...
{ "content_hash": "108f2e80052a33b3e44d58b448af0b6f", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 96, "avg_line_length": 48.15384615384615, "alnum_prop": 0.5548455804046858, "repo_name": "dhcrzf/zulip", "id": "5272cb9a49b08530eb97362f2fd59f703966c748", "size": "1902", ...
from __future__ import print_function import sys def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs)
{ "content_hash": "d491f2e56f2cd7991823fcda8036c6cf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 43, "avg_line_length": 17.857142857142858, "alnum_prop": 0.68, "repo_name": "wilima/herocomp", "id": "18075f9427c8badb507180e5a8fdc8564ca67e8f", "size": "125", "binary": f...
import logging from sqlalchemy.engine import Engine from fedlearner_webconsole.composer.models import OptimisticLock from fedlearner_webconsole.db import get_session class OpLocker(object): def __init__(self, name: str, db_engine: Engine): """Optimistic Lock Args: name: lock name sh...
{ "content_hash": "1e00ca9f6f2a02ab1663ee9d0ef22546", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 79, "avg_line_length": 34.4125, "alnum_prop": 0.5219760261532873, "repo_name": "bytedance/fedlearner", "id": "8b0bdd40437963ae08e22625e24dbd3c04c9a22a", "size": "3379", "...
import nltk nltk.download()
{ "content_hash": "af71c921f858798e49f5fb14cb4980ec", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 15, "avg_line_length": 13.5, "alnum_prop": 0.8148148148148148, "repo_name": "b09dan/universities_sentiment", "id": "3ff3043ee5a059f9b94ac7303173b56346b00c7f", "size": "27", ...
import os import subprocess import sys from watchman.integration.lib import WatchmanInstance from watchman.integration.lib import WatchmanTestCase @WatchmanTestCase.expand_matrix class TestWatchmanWait(WatchmanTestCase.WatchmanTestCase): def requiresPersistentSession(self) -> bool: return True def s...
{ "content_hash": "ca0c8cb9859bbc6708e3c5e3e5d5d363", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 85, "avg_line_length": 34.35849056603774, "alnum_prop": 0.599121361889072, "repo_name": "nodakai/watchman", "id": "9cac023edd8a8231906a54ad0ff12c0dd521a695", "size": "3823...
import os import os.path import re import time import jinja2 import robot.utils import cumulusci from cumulusci.core.exceptions import TaskOptionsError from cumulusci.core.tasks import BaseTask from cumulusci.core.utils import process_glob_list_arg from cumulusci.robotframework import PageObjects from robot.libdocpkg...
{ "content_hash": "da82e77096f837cdb6a3e8da756d2016", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 92, "avg_line_length": 38.92045454545455, "alnum_prop": 0.5651094890510949, "repo_name": "SalesforceFoundation/CumulusCI", "id": "58d94fdf12110fa2a8ae773fd15cb522d8ce94de", ...
""" Django settings for recloud project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ """ import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'h9w5qat*mdxuwjrn+z3=$s3c_f1_aDelk...
{ "content_hash": "185d0983759f14d1c7e43e9393751109", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 109, "avg_line_length": 23.615384615384617, "alnum_prop": 0.6449511400651465, "repo_name": "jparicka/recloud", "id": "2fe7ec3993a67d723861dfda23168be0c201ac97", "size": "2...
import numpy as np import unittest from pylearn2.testing.skip import skip_if_no_data import pylearn2.datasets.icml07 as icml07 # Basic tests to see if data is loadable def test_MNIST_rot_back(): skip_if_no_data() data = icml07.MNIST_rotated_background(which_set='train') data = icml07.MNIST_rotated_backgr...
{ "content_hash": "7b2ff38ed9f17a04d1a18b4703d201fb", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 96, "avg_line_length": 36.067796610169495, "alnum_prop": 0.6828007518796992, "repo_name": "KennethPierce/pylearnk", "id": "6fbd1ad10d941c458ccabcf3c74cce38caf26987", "size"...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'FinancialAidReviewData.paired_with' db.add_column(u'finaid_financialaidreviewdata', 'paired_with', ...
{ "content_hash": "2c92e752bf8763493c8a603519bb6375", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 187, "avg_line_length": 68.5158371040724, "alnum_prop": 0.5982036719059569, "repo_name": "alex/pycon", "id": "54af990bb11e6e89fc49ff8bbedd09a1a1f9f988", "size": "15166", ...
from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name=...
{ "content_hash": "b710fc134aa177a18f49c1f801191e84", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 137, "avg_line_length": 40.96296296296296, "alnum_prop": 0.5922242314647378, "repo_name": "kpi-petitions/project-y", "id": "a9a84bc9ce4a706adc14d805f0ea9c0544f7d046", "size...
import ipaddress from netaddr import IPNetwork from spiderfoot import SpiderFootEvent, SpiderFootPlugin class sfp_abusix(SpiderFootPlugin): meta = { 'name': "Abusix Mail Intelligence", 'summary': "Check if a netblock or IP address is in the Abusix Mail Intelligence blacklist.", 'flags':...
{ "content_hash": "44596fea6f5b5169105f29aa6c01dea1", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 162, "avg_line_length": 38.19565217391305, "alnum_prop": 0.5688673875924872, "repo_name": "smicallef/spiderfoot", "id": "d55400901b27c2496dd21ade40b7c2a7ff95b32b", "size":...
from __future__ import absolute_import from traitsui.api import View, Item from pychron.hardware.core.abstract_device import AbstractDevice # ============= standard library imports ======================== # ============= local library imports ========================== class PidController(AbstractDevice): de...
{ "content_hash": "d129fd74cde76e7c4567b7269c6cc420", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 65, "avg_line_length": 27.023255813953487, "alnum_prop": 0.5567986230636833, "repo_name": "USGSDenverPychron/pychron", "id": "efeb7156032f44d0755c525370dcad129103521a", "si...
from __future__ import absolute_import from django.conf import settings from sentry.utils.services import LazyServiceWrapper from .base import BaseTSDB # NOQA from .dummy import DummyTSDB backend = LazyServiceWrapper( BaseTSDB, settings.SENTRY_TSDB, settings.SENTRY_TSDB_OPTIONS, (DummyTSDB, ) ) backend.expose(...
{ "content_hash": "23ecff30f2f2cd6a57951e5c80a215d3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 25.384615384615383, "alnum_prop": 0.7848484848484848, "repo_name": "jean/sentry", "id": "744c246b0fdda6fb94502644cca26af10f6aeaa1", "size": "330", ...
import subprocess import os from time import sleep from datetime import datetime import yaml class StartupMinion: def __init__(self, conf_file='config.yml'): with open(conf_file, 'r') as f: conf = yaml.safe_load(f) self.servers_path = os.path.join( conf['base_path'], ...
{ "content_hash": "85e56335cb3cdf4d51964f32e931b80f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 33.98701298701299, "alnum_prop": 0.5303782957585021, "repo_name": "tlake/mc_server_scripts", "id": "63c20ddc6c52f710fcf75e42596030f5b1e84cac", "size"...
from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('ordenes', '0001_initial'), ]...
{ "content_hash": "b421a1008251fa1835bfbf8984ca896c", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 140, "avg_line_length": 33.21951219512195, "alnum_prop": 0.5976505139500734, "repo_name": "zaresdelweb/tecnoservicio", "id": "8427047582161bc9e3d6e49a8994cfb9c0e913a9", "si...
import numpy as np from numpy.testing import assert_almost_equal from numpy.testing import assert_allclose from scipy.optimize import newton from scipy.special import logit from sklearn.utils import assert_all_finite from sklearn.utils.fixes import sp_version, parse_version import pytest from sklearn.ensemble._hist_gr...
{ "content_hash": "0b0d3465d0226e8442cb143108c2ac57", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 79, "avg_line_length": 42.98198198198198, "alnum_prop": 0.6636624048068189, "repo_name": "bnaul/scikit-learn", "id": "221b94183a7ffd79994ba83f9d221297993df611", "size": "1...
from __future__ import unicode_literals, division, print_function """ Created on Fri Mar 8 23:14:02 CET 2013 """ import os.path import collections from pymatgen.util.testing import PymatgenTest from pymatgen.io.abinitio.pseudos import * _test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..", ...
{ "content_hash": "abafd461f86e8f63b5a05df75fe48301", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 88, "avg_line_length": 32.293785310734464, "alnum_prop": 0.5472358292512246, "repo_name": "sonium0/pymatgen", "id": "078b80906054c45737694993fdfb79b6db41e51f", "size": "58...
import pytest import unittest from modules.sfp_searchcode import sfp_searchcode from sflib import SpiderFoot from spiderfoot import SpiderFootEvent, SpiderFootTarget @pytest.mark.usefixtures class TestModuleIntegrationCodesearch(unittest.TestCase): @unittest.skip("todo") def test_handleEvent(self): ...
{ "content_hash": "37491cdf056f69e2b2f86198221c87ce", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 27.28125, "alnum_prop": 0.6769759450171822, "repo_name": "smicallef/spiderfoot", "id": "ba27394d4e0700701f52e7e4051f657d2bd4124c", "size": "873", "...
"""Tests for features.""" import copy import pickle from absl.testing import absltest from absl.testing import parameterized import numpy from pysc2.lib import actions from pysc2.lib import features from pysc2.lib import point from google.protobuf import text_format from s2clientprotocol import sc2api_pb2 as sc_pb ...
{ "content_hash": "af43e7040ec01fb56ca3be18fe03d06f", "timestamp": "", "source": "github", "line_count": 576, "max_line_length": 115, "avg_line_length": 36.66840277777778, "alnum_prop": 0.6882723355901709, "repo_name": "deepmind/pysc2", "id": "4a924fcf7af01bb8eb2987dcd22cc53b3dbc4573", "size": "2173...
from __future__ import print_function from abc import ABCMeta, abstractmethod from BeautifulSoup import BeautifulSoup as BS from argparse import ArgumentParser from unidecode import unidecode import itertools import urllib2 import urllib import json import xmltodict import os import sys # -----------------------------...
{ "content_hash": "0d4e1742ff84de75ae50911ec0223f65", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 148, "avg_line_length": 38.35858585858586, "alnum_prop": 0.5815668202764976, "repo_name": "rjullman/pubminer", "id": "039e88f1666c72f493c2b76eab05f92d7ac84b01", "size": "7...
from south.db import db from django.db import models from mypage.pages.models import * import datetime MOVE_SQL = ''' UPDATE `%(table)s` tbl SET tbl.`%(to)s` = tbl.`%(from)s`; ''' class Migration: def forwards(self, orm): table_name = 'pages_userpage' db.add_column(table_...
{ "content_hash": "3e8b9e8d9ff3eadd3c3d994e8ae12717", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 112, "avg_line_length": 37.9622641509434, "alnum_prop": 0.49726640159045726, "repo_name": "ella/mypage", "id": "2f1b8bf0f6988d990991860ab60abd0ffca7c9c1", "size": "4024", ...
""" Example to show usage of AutoLockRenewer asynchronously: 1. Automatically renew locks on messages received from non-sessionful entity 2. Automatically renew locks on the session of sessionful entity """ import os import asyncio from azure.servicebus import ServiceBusMessage from azure.servicebus.aio impor...
{ "content_hash": "7a67eb827111da294cf899dd45ed482d", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 120, "avg_line_length": 48.203252032520325, "alnum_prop": 0.6549165120593692, "repo_name": "Azure/azure-sdk-for-python", "id": "e83c3fea5953ef576f392c30d2629b86f94c5eb4", ...
import max7219.led as led import time from max7219.font import proportional, SINCLAIR_FONT, TINY_FONT, CP437_FONT from random import randrange device = led.matrix(cascaded=4) device.orientation(90) device.scroll_up(ord('A'))
{ "content_hash": "fdf1e9ceeee76ea0863e707b750520a7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 23.8, "alnum_prop": 0.7521008403361344, "repo_name": "mB-PiBox/max7219-examples", "id": "44c7bf4e5281b9129b9c7ed5e22614ee77c8d171", "size": "261", ...
import logging from django.forms import ValidationError # noqa from django import http from django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables # noqa from horizon import exceptions from horizon import forms from horizon import messages from horizon.utils...
{ "content_hash": "fa21842a91904bb8e5e205d04d98872e", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 78, "avg_line_length": 42.43010752688172, "alnum_prop": 0.5496705524581855, "repo_name": "rd37/horizon", "id": "89a2b7cfac076b9188665dd0c6096638644d375f", "size": "8701", ...
import numpy as np from sklearn.feature_selection import SelectKBest from sklearn.linear_model import LogisticRegressionCV from sklearn.metrics import accuracy_score from sklearn.metrics import make_scorer from sklearn.model_selection import GroupKFold, cross_validate from sklearn.pipeline import make_pipeline N, M = ...
{ "content_hash": "9ef4b61c51cce92868f5d60618f06a80", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 62, "avg_line_length": 35.785714285714285, "alnum_prop": 0.7844311377245509, "repo_name": "scikit-learn/enhancement_proposals", "id": "26c1d6a1bad2dc0d1cb49b1694273513498580b...
''' Nereid User user.py ''' from trytond.pool import Pool, PoolMeta from nereid import route, request, abort from werkzeug.contrib.atom import AtomFeed __all__ = ['NereidUser'] __metaclass__ = PoolMeta class NereidUser: __name__ = 'nereid.user' def serialize(self, purpose=None): """ ...
{ "content_hash": "9367ffac9efd63eac4d62ae0e0f63a2a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 79, "avg_line_length": 25.392857142857142, "alnum_prop": 0.5464135021097046, "repo_name": "fulfilio/nereid-cms", "id": "07ccf09d8d3d83efc016709af47ec4ebb35a9fc6", "size": "...
import os, send2trash def deleteunuse(folder): folder = os.path.abspath(folder) for foldername, subfolders, filenames in os.walk(folder): for filename in filenames: file = os.path.join(folder, foldername, filename) filesize = os.path.getsize(file) if filesize >= 1000...
{ "content_hash": "bf95b2dd68383fb34f072ef3f2576557", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 61, "avg_line_length": 28.5, "alnum_prop": 0.6365914786967418, "repo_name": "sallyyoo/ced2", "id": "ae94f89be2c03e9bdbdd4315ab98f6263b3cdb74", "size": "399", "binary": fa...
"""Unit test cases for the COT.add_disk.COTAddDisk class.""" import filecmp import os.path import re import mock from COT.commands.tests.command_testcase import CommandTestCase from COT.commands.add_disk import COTAddDisk from COT.data_validation import InvalidInputError, ValueMismatchError from COT.data_validation i...
{ "content_hash": "90aa3a6ffffe56ef834daca6e4f8aa52", "timestamp": "", "source": "github", "line_count": 859, "max_line_length": 79, "avg_line_length": 46.67986030267753, "alnum_prop": 0.6451693351289342, "repo_name": "glennmatthews/cot", "id": "a5798c110726d5c3570a7af10307e4e1b21bfde8", "size": "40...
''' This program demonstrates a problem I've encountered with the PySide QListWidget class, using PySide 1.2.1, Qt 4.8.5, and Mac OS X 10.8.5. To see the problem: 1. Run the program. 2. Scroll down the list. 3. Click on a list item to select it. 4. Press the "Delete" button. When the item is deleted, the list scroll...
{ "content_hash": "ff42455a5c8abbe99761f646c5130550", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 76, "avg_line_length": 24.85185185185185, "alnum_prop": 0.6348733233979136, "repo_name": "HaroldMills/Maka", "id": "3d2e1fa349e66922937818b7b91a6fa03e2c49de", "size": "2013...
import logging from oslo.config import cfg from jumpgate.common import hooks cfg.CONF.register_opts([cfg.StrOpt('admin_token', secret=True, default='ADMIN')], group='DEFAULT') LOG = logging.getLogger(__name__) @hooks.requ...
{ "content_hash": "34e131c3cf5e5ed03629ae58914d4003", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 65, "avg_line_length": 30.36, "alnum_prop": 0.5915678524374176, "repo_name": "wpf710/app-proxy", "id": "b21051a097b6219b98248d0ca0f747d5fccca1af", "size": "759", "binary"...
import inspect import importlib from pickle import dumps, loads class Job(object): @classmethod def create(cls, func, args=None, kwargs=None): if args is None: args = () if kwargs is None: kwargs = {} assert isinstance(args, tuple), "%r is not a valid args list"...
{ "content_hash": "7d21d1cbf08aac9a69e4d2aa5d336812", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 88, "avg_line_length": 30.381818181818183, "alnum_prop": 0.5529622980251346, "repo_name": "huhuchen/asyncqueue", "id": "1ff634dea9ffabdad0228b234389343cde8c2817", "size": "...
import re import warnings from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) from django.utils.deprecation import RemovedInDjango21Warning field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') def get_field_size(name): """ Extract the size ...
{ "content_hash": "c72948d5eb1e1465b96d07ca4081a9ec", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 112, "avg_line_length": 42.103092783505154, "alnum_prop": 0.5535422788116225, "repo_name": "mattseymour/django", "id": "730793879d85b2d164eb0d6c077423d9c97323fa", "size": ...
from __future__ import unicode_literals import django from django.conf import settings from django.utils.encoding import force_text from unidecode import unidecode from pybb import defaults if defaults.PYBB_USE_DJANGO_MAILER: from mailer import send_html_mail, send_mail else: from django.core.mail import send...
{ "content_hash": "7a739795ec3fd96e1dfc75ba0a36fec0", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 97, "avg_line_length": 30.181818181818183, "alnum_prop": 0.6696787148594378, "repo_name": "hovel/pybbm", "id": "5ffa8efb1c41ebea6ec1503edb0dbdd163c0d511", "size": "3999", ...
""" Registry's Client API """ import json import os from oslo.config import cfg from glance.common import exception import glance.openstack.common.log as logging from glance.registry.client.v1 import client LOG = logging.getLogger(__name__) registry_client_ctx_opts = [ cfg.BoolOpt('send_identity_headers', defa...
{ "content_hash": "24a0eaaf1c8d3de7b4a240dec3afae85", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 79, "avg_line_length": 33.41847826086956, "alnum_prop": 0.6615709871523825, "repo_name": "cloudbau/glance", "id": "b31d832fe8c678c610e4693c948526250276dbb8", "size": "6835...
from __future__ import unicode_literals from django.apps import AppConfig from django.utils.translation import ugettext_lazy as _ class SitemapsConfig(AppConfig): name = 'yepes.contrib.sitemaps' verbose_name = _('Sitemaps')
{ "content_hash": "0b86857dfaeb8b1d44ee7657e71740cd", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 55, "avg_line_length": 23.6, "alnum_prop": 0.75, "repo_name": "samuelmaudo/yepes", "id": "6e782b90756d5825e7aa3b8e6773e3d360addee1", "size": "260", "binary": false, "co...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "ebbdc8384fa93b84dd91e491bd570a92", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 170, "avg_line_length": 59.18181818181818, "alnum_prop": 0.6811742618194231, "repo_name": "justinleet/incubator-metron", "id": "36cec7cc9df199ae59100b29bfe3f479ed5f1550", ...
from __future__ import print_function, division import json import struct import re import os import base64 import httplib import sys import hashlib import datetime import time from collections import namedtuple settings = {} def uint32(x): return x & 0xffffffffL def bytereverse(x): return uint32(( ((x) << 24) | (...
{ "content_hash": "0ac1ab7a55cb269acb0c54eb08e4bbd3", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 108, "avg_line_length": 28.682758620689654, "alnum_prop": 0.6710747775907671, "repo_name": "my-first/octocoin", "id": "939bba3b34a3ef9c3d80d1f34d7e6379598e6ebf", "size": "...
def parseFVexception(e): import re try: r = re.findall("!!(.*?)!!",str(e)) except Exception,a: return str(e) if r: return r[0] else: return str(e) class startAggregateException(Exception): def __init__(self, slice, agg): self.value = value def __str__(self): re...
{ "content_hash": "ffdecdcc1101c19f368a45eec57990b2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 93, "avg_line_length": 25.625, "alnum_prop": 0.5853658536585366, "repo_name": "avlach/univbris-ocf", "id": "da282208871a0227bc7157d5ed8b5c3516a85379", "size": "535", "bin...
""" upload.py - module for the upload command """ import config import os import shutil import sys import zipfile def main(arguments): """ main routine for upload command """ # pull out arguments package = arguments.package version = arguments.version filepath = arguments.file # read configu...
{ "content_hash": "dc36df35f82c8ac9ac461197521a95c4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 73, "avg_line_length": 27.428571428571427, "alnum_prop": 0.65625, "repo_name": "rmkraus/zippy", "id": "61d785e2c039731ae848498436fc97a00069212b", "size": "1344", "binary"...
""" Sahana Eden Patient Model @copyright: 2009-2016 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, inclu...
{ "content_hash": "c846a86ef265625743dbdd3cbf0c5fc0", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 208, "avg_line_length": 40.86572438162544, "alnum_prop": 0.42343277129269347, "repo_name": "flavour/ifrc_qa", "id": "6e4368865f3941c0c5f26e63db46958fd326f482", "size": "11...
""" Author: Ang Ming Liang Please run the following command before running the script wget -q https://raw.githubusercontent.com/sayantanauddy/vae_lightning/main/data.py or curl https://raw.githubusercontent.com/sayantanauddy/vae_lightning/main/data.py > data.py Then, make sure to get your kaggle.json from kaggle.com...
{ "content_hash": "500178905b424cc876d076607d4b75d2", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 119, "avg_line_length": 36.39837398373984, "alnum_prop": 0.6047948775221502, "repo_name": "probml/pyprobml", "id": "deadf65b98d99c11e834c74b7e59c24564fb3bda", "size": "134...
from __future__ import unicode_literals from django.db import models, migrations import enumfields.fields import shop.models import shop.enums import djmoney.models.fields from decimal import Decimal import uuid class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations...
{ "content_hash": "81cfd0f0f458a269d603f0b88421e856", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 177, "avg_line_length": 45.22857142857143, "alnum_prop": 0.5726468730259002, "repo_name": "uppsaladatavetare/foobar-api", "id": "fc387a5d11c60175df09186f1b54ac461d7c2f80", ...
"""Remove deprecated tables Revision ID: 235b7b9989be Revises: 2b1ba26f2123 Create Date: 2014-08-04 20:34:04.786894 """ # revision identifiers, used by Alembic. revision = '235b7b9989be' down_revision = '2b1ba26f2123' from alembic import op import sqlalchemy as sa def upgrade(): # Drop now-unneeded tables ...
{ "content_hash": "9173c909d67aed75b323e0df1615a800", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 40, "avg_line_length": 17.84, "alnum_prop": 0.7197309417040358, "repo_name": "uskudnik/ggrc-core", "id": "388cc831da3505e152e1b93ef1c4f50bfd83a9d1", "size": "447", "binar...
from django.views.generic import DetailView from eventex.subscriptions.forms import SubscriptionForm from eventex.subscriptions.mixins import EmailCreateView from eventex.subscriptions.models import Subscription new = EmailCreateView.as_view(model=Subscription, form_class=SubscriptionForm, ...
{ "content_hash": "28d1f0ca361143fcada0fe331eff06b7", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 78, "avg_line_length": 41.4, "alnum_prop": 0.7898550724637681, "repo_name": "Golker/wttd", "id": "808f92513e91da1d044a1481093bbd80a7ae7411", "size": "418", "binary": fals...
from django.core.urlresolvers import NoReverseMatch from django.http import HttpResponse from tastypie import http from tastypie.resources import Resource from tastypie.exceptions import InvalidSortError, ImmediateHttpResponse class dict_object(object): def __init__(self, dict): self.dict = dict def ...
{ "content_hash": "5e4765b173e607906ca66e8047fb185b", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 233, "avg_line_length": 38.362637362637365, "alnum_prop": 0.6499570323689488, "repo_name": "puttarajubr/commcare-hq", "id": "1a23eb14771864b7b42371b6a4ca38ebebce987e", "si...
from toee import * import char_class_utils ################################################### def GetConditionName(): return "Horizon Walker" def GetCategory(): return "Core 3.5 Ed Prestige Classes" def GetClassDefinitionFlags(): return CDF_CoreClass def GetClassHelpTopic(): return "TAG_HORIZON_WALKERS" clas...
{ "content_hash": "4abf421d5ad83850fad9830d3ba65077", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 232, "avg_line_length": 19.281690140845072, "alnum_prop": 0.7027027027027027, "repo_name": "GrognardsFromHell/TemplePlus", "id": "607b836bc9c15aefd66ecf585ec5c0c80c0f6016", ...
from __future__ import absolute_import import mxnet as mx import numpy as np # coding: utf-8 """TensorBoard functions that can be used to log various status during epoch.""" import logging class LogMetricsCallback(object): def __init__(self, logging_dir, prefix=None): self.prefix = prefix self.i...
{ "content_hash": "bafd884cdf1740aea2fe44611d5c673c", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 116, "avg_line_length": 36.891666666666666, "alnum_prop": 0.531737067991868, "repo_name": "BitTiger-MP/DS502-AI-Engineer", "id": "9d5225745e46c72a4ab07174d199ce3ceb526820", ...
"""Functional test for GradientDescent.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf class GradientDescentOptimizerTest(tf.test.TestCase): def testBasic(self): for dtype in [tf.half, tf.float32, tf.fl...
{ "content_hash": "ff917033fc4701a5add64edc5bee72e2", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 42.865546218487395, "alnum_prop": 0.589100176435993, "repo_name": "HaebinShin/tensorflow", "id": "67d4718adee626f02d04b71caeae9e86fa1e29fe", "size":...
""" Created on Mon May 30 15:51:22 2016 Constellation object. @author: Forrest """ import numpy as np import pandas as pd import struct import skyfield.api from skyfield.units import Angle from astropy import units as u import csv class Constellation: """Constellation object which holds constellation name, abb...
{ "content_hash": "08702f0872b061245ec051e40ca47c5d", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 82, "avg_line_length": 29.5, "alnum_prop": 0.5601912212081703, "repo_name": "EP-Guy/VisPe", "id": "c0f50d9cf5f385ad31353c605ee0693599fc5e58", "size": "2325", "binary": fa...
import fastpinball ports = [('\\.\COM10', 921600), ('\\.\COM11', 921600), ('\\.\COM12', 921600)] # dmd, net, led portAssignments = (1, 0, 2) dev = fastpinball.fpOpen(ports, portAssignments) fastpinball.fpTimerConfig(dev, 100000) fast_events = fastpinball.fpGetEventObject() tick = 0 while True: fastpinball.fpEv...
{ "content_hash": "29a071daadd2cf1900f35b69eadfc62f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 94, "avg_line_length": 25.35, "alnum_prop": 0.6765285996055227, "repo_name": "spierepf/mpf", "id": "f30e41bf1482f963e613fd77b99319cf434f6a7c", "size": "507", "binary": fa...
"""Unit tests for the Quobyte volume driver module.""" import os import mock from oslo_concurrency import processutils from oslo_utils import fileutils from nova import exception from nova import test from nova.tests.unit.virt.libvirt.volume import test_volume from nova import utils from nova.virt.libvirt import uti...
{ "content_hash": "d482bf8b1e0bc516fbe0cff5013d8e88", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 78, "avg_line_length": 44.822535211267606, "alnum_prop": 0.5356963298139769, "repo_name": "rajalokan/nova", "id": "d99dda0310946c3358473c0f5c9706ac1ae353f7", "size": "1654...
from __future__ import print_function import os import yaml from rospkg import RosPack, RosStack, ResourceNotFound BASE_URL = 'https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml' PYTHON_URL = 'https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml' def get_test_dir(): return os.path.abspath(o...
{ "content_hash": "1d58c575a37cc59a39a71a76c6f81225", "timestamp": "", "source": "github", "line_count": 610, "max_line_length": 193, "avg_line_length": 42.21147540983606, "alnum_prop": 0.6423938793739563, "repo_name": "ros-infrastructure/rosdep", "id": "176abd0d00f5dbfcb81fb1a8fcb60ebf133c89c7", "s...
from django import forms from django.contrib.comments.forms import CommentForm from django.conf import settings from django.utils.translation import ugettext_lazy as _ from threadedcomments.models import ThreadedComment class ThreadedCommentForm(CommentForm): parent = forms.IntegerField(required=False, widget=for...
{ "content_hash": "4da4398d4c6e808394295852f3f9c3ad", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 125, "avg_line_length": 38.86666666666667, "alnum_prop": 0.6809605488850772, "repo_name": "Afnarel/django-threadedcomments", "id": "91c1300d5017974efcb797fe4ebb6226a78b3514",...
import os import os.path as path def getfiles(directory,extension=None): if not os.path.isdir(directory): raise StandardError("not valid dir") files = [] for f in os.listdir(directory): if extension == None or f.endswith(extension): files.append(path.abspath(path.join(directory,...
{ "content_hash": "bc169951673ac3a3bc88fb36b6d1d179", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 62, "avg_line_length": 25.375, "alnum_prop": 0.6157635467980296, "repo_name": "yskflute/exputils", "id": "8a9d4bc3062094d2ca9c7e644ccaf14d45d98faf", "size": "609", "binar...
from __future__ import print_function import copy import ntpath import os import posixpath import re import subprocess import sys from collections import OrderedDict import gyp.common import gyp.easy_xml as easy_xml import gyp.generator.ninja as ninja_generator import gyp.MSVSNew as MSVSNew import gyp.MSVSProject as...
{ "content_hash": "c9edbea341d00771ecfc5d60f73f6e43", "timestamp": "", "source": "github", "line_count": 3571, "max_line_length": 134, "avg_line_length": 37.95407448893867, "alnum_prop": 0.6424439624005784, "repo_name": "enclose-io/compiler", "id": "933042c7113c59b1bd45f50a2b48e66073b7bc02", "size":...
from django.core.urlresolvers import reverse_lazy from django.views.generic import CreateView, DetailView, DeleteView, ListView, UpdateView from braces.views import LoginRequiredMixin from ..forms import RegistrationForm from ..models import get_application_model class ApplicationOwnerIsUserMixin(LoginRequiredMixin...
{ "content_hash": "459927daafe8c1cc1ab40552d8e3b5be", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 95, "avg_line_length": 33.125, "alnum_prop": 0.7382075471698113, "repo_name": "svetlyak40wt/django-oauth-toolkit", "id": "2d6ef617f495e650ab5e034559ffb034e79093b7", "size":...
from __future__ import annotations import datetime from functools import partial from textwrap import dedent from typing import TYPE_CHECKING import warnings import numpy as np from pandas._libs.tslibs import Timedelta import pandas._libs.window.aggregations as window_aggregations from pandas._typing import ( Ax...
{ "content_hash": "88a1348c523d44e2e0f4a89defb01c71", "timestamp": "", "source": "github", "line_count": 893, "max_line_length": 88, "avg_line_length": 33.836506159014554, "alnum_prop": 0.5512973259200423, "repo_name": "gfyoung/pandas", "id": "ee99692b85432c4cc1d87a83d9c77366b74546d2", "size": "3021...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import paddle import paddle.fluid as fluid import math __all__ = ["ResNet", "ResNet50", "ResNet101", "ResNet152"] train_parameters = { "input_size": [3, 224, 224], "input_mean": [0.485, 0.456, 0.406], ...
{ "content_hash": "2fb1b0317565ce3d684688ccacc3b6d0", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 92, "avg_line_length": 31.016393442622952, "alnum_prop": 0.5118921775898521, "repo_name": "kuke/models", "id": "def99db6d84673b77582cf93374f4cb2f00e9ac5", "size": "3784", ...
from __future__ import absolute_import import os from celery import Celery from django.conf import settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings") app = Celery('myproject') CELERY_TIMEZONE = 'UTC' app.config_from_object('django.conf:settings') app.autodiscover_tasks(lambda: settings...
{ "content_hash": "090bb36f365fd64fc5dd691f688e78f6", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 69, "avg_line_length": 22.4, "alnum_prop": 0.7827380952380952, "repo_name": "ilonajulczuk/docker-django-celery", "id": "3d25be1a4c2f30da9f8c22b06e853543848f2419", "size": "...
import pytest pytestmark = [pytest.mark.setone, pytest.mark.working] @pytest.fixture def ontology_term_1(so_ont, award, lab): return{ "schema_version": '1', "term_id": 'SO:0001111', "term_name": 'so_term', "source_ontology": so_ont['@id'] } def test_ontology_term_1_2( ...
{ "content_hash": "7f39809169775d2d6eaa0276d9a1d368", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 103, "avg_line_length": 27.181818181818183, "alnum_prop": 0.6187290969899666, "repo_name": "hms-dbmi/fourfront", "id": "b85f4419b531490a1f189c9143fd6d571b665fca", "size": "...
"""pycodestyle support.""" from pycodestyle import BaseReport, Checker, StyleGuide, get_parser from pylama.context import RunContext from pylama.lint import LinterV2 as Abstract class Linter(Abstract): """pycodestyle runner.""" name = "pycodestyle" def run_check(self, ctx: RunContext): # noqa ...
{ "content_hash": "1d761f361aa104e8ebb1b0bfffd071c4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 81, "avg_line_length": 30.489795918367346, "alnum_prop": 0.5850066934404283, "repo_name": "klen/pylama", "id": "1b5f99ff1ef9a70fe42a97cbce5844dc110efe6b", "size": "1494", ...
import collections import functools import re import warnings from itertools import chain from django.core.exceptions import EmptyResultSet, FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryW...
{ "content_hash": "19683e5f6b46079c55b2e0975fe84762", "timestamp": "", "source": "github", "line_count": 1400, "max_line_length": 118, "avg_line_length": 44.95928571428571, "alnum_prop": 0.5572660978980983, "repo_name": "mlavin/django", "id": "f92df8c996c207cddf64b75020b667e35796aa0a", "size": "6294...
""" Python client for InfluxDB """ from functools import wraps import json import socket import time import threading import random import requests import requests.exceptions from sys import version_info from influxdb.line_protocol import make_lines from influxdb.resultset import ResultSet from .exceptions import Inf...
{ "content_hash": "707d16126cbbbe69015cb522d1ff5e7d", "timestamp": "", "source": "github", "line_count": 955, "max_line_length": 79, "avg_line_length": 34.48062827225131, "alnum_prop": 0.5516717786753318, "repo_name": "savoirfairelinux/influxdb-python", "id": "8146d68d4eaced71b22d2db5941c4227bf971610"...
import md5 import sys import os from datetime import datetime from datetime import timedelta import platform class CSV(): """docstring for CSV""" def __init__(self, file_name, mode='w+', separador=','): try: self.file=open(file_name,mode) except Exception: windows=platfo...
{ "content_hash": "bf0208d94f165ff5a6fcaa3b5ae36c85", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 103, "avg_line_length": 32.103092783505154, "alnum_prop": 0.5963391136801541, "repo_name": "Mecajun/CdA", "id": "884317f30eda16737d359390464753a07ce4a22e", "size": "3139", ...
import logging import os import yaml import subprocess import tempfile RUNTIME_BUCKET = 'runtime-builders' RUNTIME_BUCKET_PREFIX = 'gs://{0}/'.format(RUNTIME_BUCKET) MANIFEST_FILE = RUNTIME_BUCKET_PREFIX + 'runtimes.yaml' SCHEMA_VERSION = 1 def copy_to_gcs(file_path, gcs_path): command = ['gsutil', 'cp', file_...
{ "content_hash": "9719cfa06294956c766c7176c6e8c53b", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 75, "avg_line_length": 30.071428571428573, "alnum_prop": 0.6342042755344418, "repo_name": "priyawadhwa/runtimes-common", "id": "32a0c00eba29bfedc86477177ff628b22d64ef3f", "...
"""napalm.eos package.""" from napalm.eos.eos import EOSDriver __all__ = ("EOSDriver",)
{ "content_hash": "99e9193e828416594f0d0bcc6e6c115f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 36, "avg_line_length": 22.25, "alnum_prop": 0.6629213483146067, "repo_name": "spotify/napalm", "id": "032ff1787964bf96a5c79a300bad851c879dd35b", "size": "714", "binary": f...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/droid/component/shared_droid_motive_system_advanced.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### retur...
{ "content_hash": "75ff2c9e55909dd3f296aac806e7da18", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 99, "avg_line_length": 25.23076923076923, "alnum_prop": 0.7073170731707317, "repo_name": "obi-two/Rebelion", "id": "875493ec5f5de29cb9ec79a6dc31f8385fd322b6", "size": "473"...
import os import unittest import pytest from sparknlp.annotator import * from sparknlp.base import * from test.util import SparkContextForTest @pytest.mark.slow class DeBertaForSequenceClassificationTestSpec(unittest.TestCase): def setUp(self): self.data = SparkContextForTest.spark.read.option("header",...
{ "content_hash": "c1861fe01a689d4e23d99df38039f3f9", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 109, "avg_line_length": 28.62162162162162, "alnum_prop": 0.6336166194523135, "repo_name": "JohnSnowLabs/spark-nlp", "id": "7621535fdcdece2cd560392682ba06de40e3f48f", "size"...
from datetime import timedelta, datetime import dateutil from django.core.cache import cache from django.core.urlresolvers import reverse import operator import pytz from casexml.apps.case.models import CommCareCaseGroup from corehq.apps.groups.models import Group from corehq.apps.reports import util from corehq.apps.r...
{ "content_hash": "7d0846da7a47a3e9ad812b737eb765a0", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 115, "avg_line_length": 32.49322493224932, "alnum_prop": 0.6275229357798165, "repo_name": "gmimano/commcaretest", "id": "4bc6860c630df0a1e60d8e882b41deced05db3ef", "size":...
from aleph.model import Document from aleph.logic.documents import crawl_directory from aleph.tests.util import TestCase class IngestTestCase(TestCase): def setUp(self): super(IngestTestCase, self).setUp() self.collection = self.create_collection() def test_crawl_sample_directory(self): ...
{ "content_hash": "e01c7d3086d88a0b48a335b94c8e4b79", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 66, "avg_line_length": 35.214285714285715, "alnum_prop": 0.7079107505070994, "repo_name": "pudo/aleph", "id": "3cdc15bd62c05d2a3a6b4e128ddf419425112b6d", "size": "537", "...
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def open_group_page(self): wd = self.app.wd if not(wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new")) > 0): # self.app.wait.until(lambda driver: driver.find_el...
{ "content_hash": "c4819f14e8cd04781699c776d7e5be28", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 107, "avg_line_length": 36.7319587628866, "alnum_prop": 0.6053887173730003, "repo_name": "elenagradovich/python_training", "id": "c214a4fd5b4123d23e4033d6a87e20b85440fd99", ...
''' JSON related utilities. This module provides a few things: 1) A handy function for getting an object down to something that can be JSON serialized. See to_primitive(). 2) Wrappers around loads() and dumps(). The dumps() wrapper will automatically use to_primitive() for you if needed. 3) Th...
{ "content_hash": "77ebd453e8be77d60bbde3c2745acc22", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 79, "avg_line_length": 36.16969696969697, "alnum_prop": 0.6261729222520107, "repo_name": "frossigneux/python-kwstandbyclient", "id": "473bfa9247befd08d7b3b5d164ddca13c29738e...
"""Query databases for reference metadata.""" import hashlib import json import sys import urllib import mendeley.models.catalog import requests import requests.auth from .core import Entry from .rc import rc def search(query, m_id, m_secret): mend = mendeley.Mendeley(m_id, m_secret) session = mend.start_cl...
{ "content_hash": "fefda0621a06b0803f927f3962b79fc8", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 30.488372093023255, "alnum_prop": 0.5873379099923722, "repo_name": "tbekolay/refs", "id": "33d92e2c28882a02cc26f6f55d7c9aed40e72365", "size": "2622",...