text
stringlengths
4
1.02M
meta
dict
import unittest from unittest.mock import ANY, MagicMock, Mock, PropertyMock, patch import pytest from google.api_core.gapic_v1.method import DEFAULT from parameterized import parameterized from airflow.exceptions import AirflowException from airflow.providers.google.cloud.operators.text_to_speech import CloudTextToS...
{ "content_hash": "e3e5dddfe9140bd8b6069f76029a8609", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 103, "avg_line_length": 39.95876288659794, "alnum_prop": 0.6457688338493293, "repo_name": "Acehaidrey/incubator-airflow", "id": "6acbd60d250141b3b48b1619565596d900faa5c5", ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "instapix.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # issue is re...
{ "content_hash": "190a7e3182de3adf73a7418c24e004db", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 77, "avg_line_length": 37.333333333333336, "alnum_prop": 0.6211734693877551, "repo_name": "peromo93/instapix", "id": "26516d08c8c232d585fbb3287d389e2054a4a77f", "size": "80...
import pytest from plenum.test.delayers import ppDelay, icDelay from plenum.test.freshness.helper import has_freshness_instance_change from plenum.test.helper import freshness from plenum.test.stasher import delay_rules from stp_core.loop.eventually import eventually FRESHNESS_TIMEOUT = 5 @pytest.fixture(scope="mod...
{ "content_hash": "12746709c4ba7204a3b62c1bbffc0a1a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 43.416666666666664, "alnum_prop": 0.663147792706334, "repo_name": "evernym/zeno", "id": "eb1b57f304c5e31048dadf29317df3cd428f5ad5", "size": "2084", ...
''' Basic processing procedures for analog signals (e.g., performing a z-score of a signal, or filtering a signal). :copyright: Copyright 2014-2015 by the Elephant team, see AUTHORS.txt. :license: Modified BSD, see LICENSE.txt for details. ''' from __future__ import division, print_function import numpy as np import ...
{ "content_hash": "5e5fa9921d185c894f2ff360d68f40d7", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 111, "avg_line_length": 38.78389830508475, "alnum_prop": 0.6317054517644488, "repo_name": "btel/elephant", "id": "f138cf5721ba8388cf6e918ba793b0c1f4cd725a", "size": "9153"...
import argparse import os from stawebg.data import Project, version if __name__ == "__main__": parser = argparse.ArgumentParser(description="static website generator") parser.add_argument("directory", nargs="?", default=os.getcwd(), help='the web project root directory') parser.add_...
{ "content_hash": "5e8a398ab32a1ab137414b9ec0aa91ca", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 42.68421052631579, "alnum_prop": 0.5881627620221949, "repo_name": "svenhertle/stawebg", "id": "9ce3e4d6c50fca87a5d883581460d0710a9e2c04", "size": "83...
""" This module provides a simple task monitoring capability to track usage statistics for tasks. """ import re import os import datetime try: import simplejson as json except ImportError: import json from focus.plugin import base from focus import common, errors MINS_IN_HOUR = 60 MINS_IN_DAY = MINS...
{ "content_hash": "b63de7a630be02abf375c5d21bc45c62", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 76, "avg_line_length": 28.95571955719557, "alnum_prop": 0.4515101312603543, "repo_name": "xtrementl/focus", "id": "254fd560cabcd35086e3ee9a0292977b3ad534cf", "size": "7847...
import clr import rpw from rpw.ui.forms import Button, ComboBox, FlexForm, CheckBox, Label, TextBox, Separator from rpw import doc import os clr.AddReference("RevitAPI") import Autodesk from Autodesk.Revit.DB import SaveAsOptions, Transaction, IFamilyLoadOptions def get_family_parameter_value(familydoc, name): f...
{ "content_hash": "176000cf4bf1a753e9dc8af86fd18e10", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 113, "avg_line_length": 43.89808917197452, "alnum_prop": 0.6353743470690656, "repo_name": "htlcnn/pyrevitscripts", "id": "190d4b8cf9bd45698a4b22595df19f73043de8a7", "size"...
from scipy.special import binom print(int(binom(20 + 20, 20)))
{ "content_hash": "8634b5faf9db1c11071240de53405911", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 31, "avg_line_length": 31.5, "alnum_prop": 0.7301587301587301, "repo_name": "EndlessDex/euler", "id": "c5d492c071aa910f88d22c32a9f572b66a059a2a", "size": "63", "binary": f...
from zoo.tfpark.tfnet import TFNet from zoo.tfpark.tf_optimizer import BigDLMetric, TFModel from zoo.pipeline.api.keras import metrics as zmetrics def to_bigdl_metric(metric): metric = metric.lower() if metric == "accuracy" or metric == "acc": return zmetrics.Accuracy() elif metric == "top5accurac...
{ "content_hash": "0eb8115fa9c2339ef7b2d594f98c4c8b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 99, "avg_line_length": 37.161764705882355, "alnum_prop": 0.5587653343886031, "repo_name": "intel-analytics/analytics-zoo", "id": "605338f2b0638df442a9f17dcb4a5337898fc222", ...
class foo(): def __str__(self): return "hello" if str(foo()) != "hello": print "str(foo()) should have been 'hello', not", str(foo())
{ "content_hash": "24629ca301674277027bf65b94b291e2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 62, "avg_line_length": 23.833333333333332, "alnum_prop": 0.5664335664335665, "repo_name": "sburnett/seattle", "id": "76a134e21d9c62ab8966108ebd7bd754bd32e18e", "size": "157"...
""" Date: 29 Feburary 2016 Author: James Boocock Description: Main NGaDNAP script. """ import argparse try: import ConfigParser except: import configparser as ConfigParser import logging import os import sys from ngadnap.create_ngadnap_graph import CreateNGaDNAPGraph from ngadnap.dependency_grap...
{ "content_hash": "0787c80fba7af7ad9765ed13862d55cb", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 159, "avg_line_length": 49.7007299270073, "alnum_prop": 0.6243207519459539, "repo_name": "theboocock/NGaDNAP", "id": "96d22db7361128f0a9e536004b2f51dfb9ebf9fe", "size": "6...
from content_plugin import ContentPlugin from gluon import URL, XML, CAT, I import os import json class ContentPhotoset(ContentPlugin): """ Photo set item """ def get_icon(self): return I(_class="fa fa-object-group") def get_name(self): return self.T('Photo Set') def create...
{ "content_hash": "41744fecb4c827839ff47c86a7378163", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 31.263157894736842, "alnum_prop": 0.553030303030303, "repo_name": "ybenitezf/nstock", "id": "7b4e8721cc07f53c1fa8c6658f3c4e44f4ae905b", "size": "2400...
""" Useful constants """ import logging, os, sys from logging.handlers import RotatingFileHandler # Basic Configuration APPNAME = 'PKMeter' VERSION = '0.7' CONFIGDIR = os.path.join(os.getenv('HOME'), '.config', 'pkmeter') CONFIGPATH = os.path.join(CONFIGDIR, 'config.json') STATUSFILE = os.path.join(CONFIGDIR, 'status...
{ "content_hash": "2e7cc4a6a0e9f52a0c036d07e1fa7578", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 98, "avg_line_length": 33.27272727272727, "alnum_prop": 0.7531876138433515, "repo_name": "mjs7231/pkmeter", "id": "1e263b0e46f4e9a3c2d924a50ae5f6208b32af19", "size": "1122"...
import json import os import sys import getopt from os import listdir from os.path import join, isfile, exists _verbose = False _helpMessage = ''' Usage: khooshe_output.py [-d <dir of JSON files with Tika locations>] [-o <output directory for sample_pts.csv>] Operation: -o --outdir Output directory for sample_p...
{ "content_hash": "fe375a2708770ba796191ddb09e167a2", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 112, "avg_line_length": 30.066666666666666, "alnum_prop": 0.5432372505543237, "repo_name": "chrismattmann/memex-autonomy", "id": "ddc8f78d5b217edd54019e179b36cdb11725e862", ...
"""Decorator service for the media_player.play_media service.""" import logging import voluptuous as vol from homeassistant.components.media_player import ( MEDIA_PLAYER_PLAY_MEDIA_SCHEMA) from homeassistant.components.media_player.const import ( ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, DOMAIN as M...
{ "content_hash": "eecbb2646d667679df64ccd9e3ba98bc", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 77, "avg_line_length": 33.17791411042945, "alnum_prop": 0.6037352071005917, "repo_name": "DavidLP/home-assistant", "id": "e6456401ba4db0c1559561e5ee4ed410cece8d2a", "size"...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
{ "content_hash": "56eb9fa182a787ac2c74f99ed4f3ec8b", "timestamp": "", "source": "github", "line_count": 608, "max_line_length": 152, "avg_line_length": 39.370065789473685, "alnum_prop": 0.5883778251242846, "repo_name": "bridadan/pyOCD", "id": "50b9f915f40a3a53c5dab7ac20373fb9d2376277", "size": "239...
import ioc import os class Extension(ioc.component.Extension): def load(self, config, container_builder): path = os.path.dirname(os.path.abspath(__file__)) loader = ioc.loader.YamlLoader() loader.load("%s/resources/config/wkhtmltopdf.yml" % path, container_builder) container_build...
{ "content_hash": "61982b3e9f2c68449edc47cec46f6304", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 152, "avg_line_length": 40.90909090909091, "alnum_prop": 0.7066666666666667, "repo_name": "rande/python-element", "id": "42ae716feadf7b1142da5c8a6668aaff27fdb8e1", "size": ...
from PyQt5 import QtCore, QtWidgets class TableFitMixin(object): DEFAULT_SCROLLBAR_EXTRA_SPACE = (16, 16) def __init__(self, size_hint_only=False, scrollbar_extra_space=None): if scrollbar_extra_space is None: self._scrollbar_extra_space = TableFitMixin.DEFAULT_SCROLLBAR_EXTRA_SPACE ...
{ "content_hash": "e8aa1c153a69bd92cb66f72bb1a7b69d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 118, "avg_line_length": 50.074074074074076, "alnum_prop": 0.6826923076923077, "repo_name": "sciapp/pyMolDyn", "id": "a4c9f2879575d6a9c56e1396ed0ea125f57a82de", "size": "137...
import sys from plantcv.plantcv import _version from plantcv.plantcv import params def deprecation_warning(warning): """Print out deprecation warning Inputs: warning = warning message text :param warning: str """ version = _version.get_versions() warning_msg = f"DeprecationWarning: {warni...
{ "content_hash": "8aba3595273e91bd878da11a75e89a73", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 126, "avg_line_length": 29.75, "alnum_prop": 0.7058823529411765, "repo_name": "danforthcenter/plantcv", "id": "2186ae2592b38a999e3cdcdbe01ade5111e94122", "size": "500", "...
import unittest from numpy.testing import assert_almost_equal from tick.prox import ProxElasticNet, ProxL1, ProxL2Sq from tick.prox.tests.prox import TestProx class ProxElasticNetTest(object): def test_ProxElasticNet(self): """...Test of ProxElasticNet """ coeffs = self.coeffs.copy().ast...
{ "content_hash": "b00bdb98092b4415e9f2fb882397ace4", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 76, "avg_line_length": 33.5, "alnum_prop": 0.6073082861554298, "repo_name": "Dekken/tick", "id": "963f493dcd8892da8ba46fca01ab20166a155d5d", "size": "1968", "binary": fal...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('sites', '0015_auto_20170429_1525'), ] operations = [ migrations.RemoveField( model_name='site', name='domain_old', ), ]
{ "content_hash": "9b32706113cfb76b5b2f632e5c09f950", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 45, "avg_line_length": 18.823529411764707, "alnum_prop": 0.58125, "repo_name": "tjcsl/director", "id": "c0b01c507ecaab5a119844d1e9e919ebb143e03c", "size": "393", "binary"...
import repeat print repeat.repeat("qwerty",1,4,5) try: print repeat.repeat(1,4,5,6) except Exception as ex: print ex try: print repeat.repeat("qwerty",1,4,5,6) except Exception as ex: print ex
{ "content_hash": "9b6dc8964abb8c5f39bc90ac02e31472", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 41, "avg_line_length": 16.307692307692307, "alnum_prop": 0.6792452830188679, "repo_name": "AlexAsh/pycembed15", "id": "c274be51a8b31d504524524b21f3d6a183f6a438", "size": "2...
import sys import time from django.conf import settings from django.utils.datastructures import DictWrapper # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific d...
{ "content_hash": "679d3722cb357ea303db58696345e4e4", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 148, "avg_line_length": 44.57905138339921, "alnum_prop": 0.5851842000265993, "repo_name": "spawnedc/MeCanBlog", "id": "9adbf2a7e31cb7d624361d615c78cafe6013acbd", "size": "...
""" Neutron Plug-in for PLUMgrid Virtual Networking Infrastructure (VNI) This plugin will forward authenticated REST API calls to the PLUMgrid Network Management System called Director """ from plumgridlib import plumlib from neutron.openstack.common import log as logging LOG = logging.getLogger(__name__) class Pl...
{ "content_hash": "907a5ba5af5a301c13c855ccac490ba3", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 37.096385542168676, "alnum_prop": 0.6576810652809354, "repo_name": "vbannai/neutron", "id": "8e2607e857bfb62fb25c029bca2b79d6bf5b1669", "size": "3815...
"""Helpers functions to run log-running tasks.""" from web import utils from web import webapi as web def background(func): """A function decorator to run a long-running function as a background thread.""" def internal(*a, **kw): web.data() # cache it tmpctx = web._context[threading.currentThr...
{ "content_hash": "3bc361dd888c8b66b1922e2c328c221d", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 85, "avg_line_length": 32.372093023255815, "alnum_prop": 0.5510057471264368, "repo_name": "minixalpha/SourceLearning", "id": "8dee9d227356d24f3c6ccee0f7512f5da384b72a", "si...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: skippy callback_type: stdout requirements: - set as main display callback short_description: Ansible screen output that ignores skipped status version_added: "2.0" extends...
{ "content_hash": "a04d706a83ebe7ce5bf7c6000bab8176", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 108, "avg_line_length": 28.142857142857142, "alnum_prop": 0.7025380710659899, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "92076cc146efd46c0fadb6094123eca483d...
import ctypes import os import time from urllib.request import urlopen, urlretrieve from xml.etree import ElementTree from gi.repository import Gio BING_MARKET = "zh-cn" SCREEN_RESOLUTION = "UHD" GALLERY_FOLDER_PATH = os.path.join(os.environ["HOME"], "Pictures/Bing Gallery") WAITING_TIME_WHEN_SUCCESSFUL = 600 WAITING...
{ "content_hash": "68e3c5053ccbcb3ca52c70974ebb809c", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 96, "avg_line_length": 34.28, "alnum_prop": 0.5918319719953326, "repo_name": "nixingyang/Miscellaneous-Projects", "id": "9a092c2918e0a417d982f25afd01c44f5ac65a30", "size":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0002_auto_20160624_1922'), ] operations = [ migrations.AddField( model_name='status_jiraissue', name='status_particul...
{ "content_hash": "827bdc40aed9f3060ae26e745dde7a9c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 57, "avg_line_length": 24.791666666666668, "alnum_prop": 0.5798319327731093, "repo_name": "sunnytambi/QuickScrum", "id": "3d1dd198ef632b5713e112fb546c7cafee28d11f", "size":...
"""Tests for Python ops defined in sparse_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.framework import ...
{ "content_hash": "b5fc5173e2450055d7605430400afa71", "timestamp": "", "source": "github", "line_count": 1054, "max_line_length": 80, "avg_line_length": 40.70967741935484, "alnum_prop": 0.6191619278456232, "repo_name": "asimshankar/tensorflow", "id": "7598991489ce6019352e19cb6c50819d91085b0d", "size...
"""This code example gets all premium rates. To create premium rates, run create_premium_rates.py. Tags: PremiumRateService.getPremiumRatesByStatement """ __author__ = 'Nicholas Chen' # Import appropriate modules from the client library. from googleads import dfp def main(client): # Initialize appropriate servi...
{ "content_hash": "0c78604000d14d104a145707e95322cf", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 73, "avg_line_length": 30.727272727272727, "alnum_prop": 0.6420118343195266, "repo_name": "coxmediagroup/googleads-python-lib", "id": "f1cf5d7c67a7bc34934dd6f794eda086cbd9ad0...
import numpy as np import copy from ..io.pick import pick_types from ..viz.decoding import plot_gat_matrix, plot_gat_times from ..parallel import parallel_func, check_n_jobs class _DecodingTime(dict): """A dictionary to configure the training times that has the following keys: 'slices' : ndarray, shape (n_c...
{ "content_hash": "5964db9302fb68b232093f17fc4accc4", "timestamp": "", "source": "github", "line_count": 1238, "max_line_length": 113, "avg_line_length": 39.899030694668824, "alnum_prop": 0.5639234740358335, "repo_name": "trachelr/mne-python", "id": "211bb0407dc8189da534dec374371fb8787217dd", "size"...
from kolibri.auth.models import Collection, FacilityUser def get_members_or_user(collection_kind, collection_id): if 'user' == collection_kind: return FacilityUser.objects.filter(pk=collection_id) else: # if not user, then it must be a collection return Collection.objects.filter(kind=collecti...
{ "content_hash": "d5a0acb29803ce072f52c83705dba085", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 98, "avg_line_length": 45.625, "alnum_prop": 0.736986301369863, "repo_name": "benjaoming/kolibri", "id": "c82c83f7269f848ff27a3fceeca2f17ef78653b1", "size": "365", "binary...
import inspect import logging from oslo_config import cfg from oslo_utils import importutils from oslo_messaging._drivers.zmq_driver.matchmaker import base from oslo_messaging._drivers.zmq_driver import zmq_address from retrying import retry redis = importutils.try_import('redis') redis_sentinel = importutils.try_im...
{ "content_hash": "e0745c4ef71f31a92582b8da830f7fd6", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 79, "avg_line_length": 35.68674698795181, "alnum_prop": 0.5854152599594868, "repo_name": "dukhlov/oslo.messaging", "id": "0d0ce8bca7cd96edd2c1dede67bb0a92d3ef2c79", "size"...
from .. import ConfigIncluder, ConfigIncluderFile, ConfigIncluderURL, \ ConfigIncluderClasspath class FullIncluder(ConfigIncluder, ConfigIncluderFile, ConfigIncluderURL, ConfigIncluderClasspath): pass
{ "content_hash": "fd6325b73d150b5d47e984c3bc876cb2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 73, "avg_line_length": 31.857142857142858, "alnum_prop": 0.7847533632286996, "repo_name": "chris-martin/hocon-python", "id": "94365eb11f73e802a5320652a5c7e0b3e226c311", "siz...
import argparse import logging import textwrap from tripleo_common.cmd.utils import _clients as clients from tripleo_common.cmd.utils import environment from tripleo_common import updates def parse_args(): description = textwrap.dedent(""" Run stack update. """) parser = argparse.ArgumentParser( ...
{ "content_hash": "6f5a63dac87e2b17ab86ba02de17d3ef", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 34.075471698113205, "alnum_prop": 0.6079734219269103, "repo_name": "jprovaznik/tripleo-common", "id": "a8139ffcff4ab830ecf7cba4637b1477f983feaf", "si...
import os from fontbakery.callable import check from fontbakery.checkrunner import ERROR, FAIL, INFO, PASS, WARN, Section # used to inform get_module_profile whether and how to create a profile from fontbakery.fonts_profile import profile_factory # NOQA pylint: disable=unused-import from .shared_conditions import is_va...
{ "content_hash": "25ef3889372a9feed1088cbef107a517", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 105, "avg_line_length": 42.93636363636364, "alnum_prop": 0.6035358882066483, "repo_name": "graphicore/fontbakery", "id": "094f6886187fc69523c6b16c80345aea6179036e", "size"...
from SimpleCV import Image import time # Get the template and image goBoard = Image('go.png') black = Image('go-black.png') black.show() time.sleep(3) goBoard.show() time.sleep(3) # Find the matches and draw them matches = goBoard.findTemplate(black) matches.draw() # Show the board with matches print the number goB...
{ "content_hash": "f607d169aba49ddfc61d7b12c4918610", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 46, "avg_line_length": 18.52173913043478, "alnum_prop": 0.7323943661971831, "repo_name": "vizcacha/practicalcv", "id": "eb49a22c12fe775d96e2d8f25bfbb4bcff74782b", "size": "...
import numpy from setuptools import setup, find_packages, Extension with open('README.rst') as f: readme = f.read() with open('LICENSE') as f: lic = f.read() with open('requirements.txt') as f: required = f.read().splitlines() # Obtain the numpy include directory. This logic works across numpy versio...
{ "content_hash": "11163f718075d58318a8768acb36073f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 136, "avg_line_length": 27.22, "alnum_prop": 0.6443791329904482, "repo_name": "usajusaj/sga_utils", "id": "4bc330d4df3b7b9d978109c04cdece62973fc1c8", "size": "1386", "bin...
class MerkleTree: @property def root(self): return self._root class MerkleNode: """Simple node structure for the MerkleTree.""" def __init__(self): self._children = [] self._offset = None self._hash = None @property def offset(self): return self._offs...
{ "content_hash": "dd4c32c7146f228837613bb944686018", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 51, "avg_line_length": 17.566666666666666, "alnum_prop": 0.5673624288425048, "repo_name": "jarretraim/pymerkle", "id": "856cb5566739883f18bd1fe58acaafeaa225124d", "size": "...
import cPickle as pickle import csv import glob import os import time import numpy as np import theano import theano.tensor as T import data_loader import postprocess import utils import paths METADATAS_LOCATION = 'metadatas.pkl' RELOAD_METADATAS = False DO_XVAL = True PREDICTIONS_PATH = paths.INTERMEDIATE_PREDICTION...
{ "content_hash": "3a9ecb7b3228672643ba1d99cf4d7ff3", "timestamp": "", "source": "github", "line_count": 521, "max_line_length": 122, "avg_line_length": 41.046065259117086, "alnum_prop": 0.613514145429039, "repo_name": "317070/kaggle-heart", "id": "b5830ee682e5e7916b59518e8e53e03e6bc687e1", "size": ...
""" Reference GENI GCH Clearinghouse, for talking to the GENI Clearinghouse via xmlrpc instead of smime (its native interface) Run from gcf-gch.py Will produce signed user credentials from a GID, return a list of aggregates read from a config file, and create a new Slice Credential. """ from __future__ import absolute...
{ "content_hash": "82014be6cb68993faffd2cec78622252", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 133, "avg_line_length": 40.87012987012987, "alnum_prop": 0.5861667196271582, "repo_name": "ahelsing/geni-tools", "id": "9dcba4517714e658454f92b668b243133b0d313d", "size": ...
import os import tempfile from typing import List, Any, Optional from py4j.java_gateway import JavaObject from pyflink.common import WatermarkStrategy from pyflink.common.execution_config import ExecutionConfig from pyflink.common.job_client import JobClient from pyflink.common.job_execution_result import JobExecuti...
{ "content_hash": "789654944925204105b2d8fc079d4c32", "timestamp": "", "source": "github", "line_count": 925, "max_line_length": 100, "avg_line_length": 45.99351351351351, "alnum_prop": 0.6622320421210982, "repo_name": "tillrohrmann/flink", "id": "a83796ef04fab4075695cbc81c873cafb50a6a36", "size": "...
import unittest from ..pyjsongooglechart import GoogleChart from ..pyjsongooglechart import (StringColumn, NumberColumn) class GoogleChartTests(unittest.TestCase): def test_base(self): # Verify we can create a new chart g = GoogleChart("Test") self.assertEqual(g.title, "Test") sel...
{ "content_hash": "2c5a1dfab404ae91727b3d8217cb4a09", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 71, "avg_line_length": 35.171875, "alnum_prop": 0.494002665482008, "repo_name": "msteffeck/pyjsongooglechart", "id": "e0471df941da824cb487f42d201beff5742ad26d", "size": "22...
from . import constants as c from . import control from . import setup from . states import commonarea from . states import mainmenu import sys import traceback def main(): setup.start() states = { c.StateName.MAINMENU: mainmenu.MainMenu(), c.StateName.COMMONAREA: commonarea.CommonArea(), ...
{ "content_hash": "20f4149b09cdcf4db855edbe372c1bfc", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 75, "avg_line_length": 20.63888888888889, "alnum_prop": 0.6514131897711979, "repo_name": "revainisdead/garden", "id": "6fe4899ea9eccb6e3fdaffd64b7f23554c4da119", "size": "7...
"""Operations for linear algebra.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.ops import array_ops from tensorflow.python.ops import gen_linalg_ops from tensorflow.python.ops import l...
{ "content_hash": "ba66d74a7129caabfe3b7c0211248054", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 33.306930693069305, "alnum_prop": 0.6914387633769322, "repo_name": "av8ramit/tensorflow", "id": "d5bd916f80d8a03e5423c43d1ca039bc4dceff5e", "size": ...
""" haproxyadmin.exceptions ~~~~~~~~~~~~~~~~~~~~~~~ This module contains the set of haproxyadmin' exceptions with the following hierarchy:: HAProxyBaseError ├── CommandFailed ├── HAProxyDataError │   ├── IncosistentData │   └── MultipleCommandResults └── HAProxySocketError ├── SocketAp...
{ "content_hash": "b8f3f75335b04b0e620a84a2c1db6a56", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 28.961165048543688, "alnum_prop": 0.6798524974857526, "repo_name": "unixsurfer/haproxyadmin", "id": "c83386d681dd364d69cd9fe6222ac9328fc68842", "siz...
""" .. module:: django_core_models.location.tests.test_validation :synopsis: location application validation unit test module. *location* application validation unit test module. """ from __future__ import print_function from django.core.exceptions import ValidationError from django_core_utils.tests.test_utils i...
{ "content_hash": "3ac13bb45f9f6caacd1bd1fb1c9fe593", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 77, "avg_line_length": 37.02, "alnum_prop": 0.6600036016567621, "repo_name": "ajaniv/django-core-models", "id": "7b96c2436d0110a8e44b9488d0581760d3bf1076", "size": "5553",...
from selenium.webdriver.common.by import By from pages.base import Page class Message(Page): _type_locator = (By.CSS_SELECTOR, 'span.sprite') _body_locator = (By.CSS_SELECTOR, 'p') _platform_locator = (By.CSS_SELECTOR, '.meta li:nth-child(3) a') _locale_locator = (By.CSS_SELECTOR, '.meta li:nth-chil...
{ "content_hash": "27d3db4f0360f9849a2b1979ad0375da", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 31.07547169811321, "alnum_prop": 0.6484517304189436, "repo_name": "staranjeet/fjord", "id": "4828ee9e548a65899e519adc627fd12ef6dd9ad4", "size": "1870...
import numpy as np import collections import scipy.stats as stats import matplotlib.pyplot as plt x = [1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 5, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9] #calculate frequency c = collections.Counter(x) #print(c) # calculate the number of instances in the list count_sum = ...
{ "content_hash": "cbf55746f01f2e4e3ca2f4a76e82133d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 100, "avg_line_length": 23.055555555555557, "alnum_prop": 0.6650602409638554, "repo_name": "ttglennhall/simple_data_analysis_python", "id": "2a0239d69295f1e8bcb2c92a22eaf3ccd...
import os import subprocess import sys import tempfile from contextlib import contextmanager from pathlib import Path import easyargs import nbconvert @contextmanager def _tmpnotebook(data, fname="notebook"): filepath = "" try: fid, filepath = tempfile.mkstemp(suffix=".py", prefix=f"{fname}_") ...
{ "content_hash": "eaad771bfae9532a954ca389c13568d4", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 74, "avg_line_length": 29.52, "alnum_prop": 0.5934959349593496, "repo_name": "ocefpaf/notebooks_demos", "id": "1671664cfe3807bfb8d8cd4bc3934953712d17a2", "size": "2214", ...
from autobahn.twisted.websocket import WebSocketClientFactory, \ WebSocketClientProtocol class EchoClientProtocol(WebSocketClientProtocol): """ Example WebSocket client protocol. This is where you define your application specific protocol and logic. """ def sendHello(self): self.send...
{ "content_hash": "9b11f86697ef9b35955e5bc9ce14188e", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 131, "avg_line_length": 29.859154929577464, "alnum_prop": 0.6698113207547169, "repo_name": "RyanHope/AutobahnPython", "id": "e053a0bfa0c2cc39e251cbc9708e0978c24a6068", "siz...
from coffee_machine_control.srv import * import rospy, time import RPi.GPIO as GPIO import pickle # capsule type: (dispenser position, capsule count) coffee_capsule_dispenser={ 'coffee_type: chocolate':(1,10), 'coffee_type: caramel':(2,10), 'coffee_type: christmas':(3,10), 'coffee_type: vanilla':(4,10)...
{ "content_hash": "ff30ba53e171c3aa0e8fe97372aba0c4", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 148, "avg_line_length": 33.77037037037037, "alnum_prop": 0.677780214959421, "repo_name": "Barista-Bot/coffee-machine-control", "id": "b3c1dbfd7e87045d53dd22297b39bc3635b85ef...
"""Prepares the views for point scoreboard widget.""" import datetime from apps.managers.challenge_mgr import challenge_mgr from apps.managers.player_mgr import player_mgr from apps.managers.team_mgr import team_mgr def supply(request, page_name): """Supply the view_objects content for this widget, which is all t...
{ "content_hash": "9c18a6b82eb26a366188ca135b590e7b", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 98, "avg_line_length": 42.4, "alnum_prop": 0.6066763425253991, "repo_name": "yongwen/makahiki", "id": "1ecf601755badb88fd9e93e0cbab1a104523def6", "size": "2756", "binary"...
from __future__ import absolute_import, division, print_function import inspect from functools import wraps from collections import OrderedDict from contextlib import contextmanager import copy import tensorflow as tf from tfutils.crossdevice_batchnorm import crossgpu_batch_norm, CRTPUBatchNormalization import numpy a...
{ "content_hash": "e427cda99a231db1dd8e6012a7073edc", "timestamp": "", "source": "github", "line_count": 808, "max_line_length": 132, "avg_line_length": 38.01980198019802, "alnum_prop": 0.49261067708333334, "repo_name": "neuroailab/tfutils", "id": "eb3db7c4fd84b6660cc99edad33a07a0c3dfee10", "size": ...
import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='Flask-Bootstrap', version='3.0.0.2.dev1', url='http://github.com/mbr/flask-bootstrap', license='BSD', author='Marc Brinkmann', author_email='git@marcbr...
{ "content_hash": "0bc1fc8971f967734b141b2ca1df5b54", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 74, "avg_line_length": 29.02777777777778, "alnum_prop": 0.6220095693779905, "repo_name": "miguelgrinberg/flask-bootstrap", "id": "5c42da9bec839d472036f6f410ffc52136324257", ...
""" Copyright (c) Bojan Mihelac and individual contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this lis...
{ "content_hash": "0f46b1bb06d6fc2f0d0d73028a9edf20", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 122, "avg_line_length": 28.54824561403509, "alnum_prop": 0.6543247810723614, "repo_name": "takeflight/wagtail", "id": "a56f1a82861be323d23ec08743810cdce734dfa0", "size": "...
# -*- encoding: utf-8 -*- from __future__ import unicode_literals import io import os import re import shutil import sys import time from unittest import SkipTest, skipUnless import warnings from django.conf import settings from django.core import management from django.core.management import execute_from_command_lin...
{ "content_hash": "03bdcf2516bf7608ebd0eb5872bef051", "timestamp": "", "source": "github", "line_count": 713, "max_line_length": 194, "avg_line_length": 45.859747545582046, "alnum_prop": 0.6322099210960915, "repo_name": "szopu/django", "id": "3081776d96a269eaa1f1ba604645c78aa9cc936e", "size": "32710...
""" Provides utility classes to develop REST-like API and to simplify the routing of HTTP requests. :author: Thomas Calmant :copyright: Copyright 2020, Thomas Calmant :license: Apache License 2.0 :version: 1.0.1 .. Copyright 2020 Thomas Calmant Licensed under the Apache License, Version 2.0 (the "License");...
{ "content_hash": "acd334d25e91665e344aa7da1a0c2db2", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 81, "avg_line_length": 30.707373271889402, "alnum_prop": 0.5396563367599609, "repo_name": "tcalmant/ipopo", "id": "3d43dfe3e526efd1467880c6dc520b3f3e70e40e", "size": "1338...
import os import os.path def get_boolean(arg): if isinstance(arg, bool): return arg elif isinstance(arg, str): if arg.lower() in ['true']: return True elif arg.lower() in ['false']: return False else: raise ValueError('%s (string) cannot be pa...
{ "content_hash": "45a6e1e090b1449e0a960dbaad21b94f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 82, "avg_line_length": 26.375, "alnum_prop": 0.5529225908372828, "repo_name": "IS-ENES-Data/esgf-pid", "id": "64022d96bd295b0559536a6ad0dad3bfb4316142", "size": "633", "b...
import fnmatch import os import lxml.html # Get all missing images on FS from nav's htmls # ================================= # just some fancy colors for output HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' ENDC = '\033[0m' BOLD = "\033[1m" def disable(): H...
{ "content_hash": "dd51dc66a95cb2fb216d55d5a4a27c7e", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 104, "avg_line_length": 29.029850746268657, "alnum_prop": 0.5465295629820052, "repo_name": "therealmarv/epub-validator", "id": "75d9b66b5009dfc17c3611090a245138cbe9509b", "...
from google.cloud import automl_v1beta1 as automl def import_dataset( project_id="YOUR_PROJECT_ID", dataset_id="YOUR_DATASET_ID", path="gs://YOUR_BUCKET_ID/path/to/data.csv", ): """Import a dataset.""" client = automl.AutoMlClient() # Get the full path of the dataset. dataset_full_id = cli...
{ "content_hash": "cd334b788348accd3030528ee7e0ce91", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 82, "avg_line_length": 34.75, "alnum_prop": 0.6786570743405276, "repo_name": "GoogleCloudPlatform/python-docs-samples", "id": "d091061557cc0127302e85d7672898189934c11a", "s...
from tempest_lib.common.utils import data_utils from tempest.api.compute import base from tempest import test class MultipleCreateTestJSON(base.BaseV2ComputeTest): _name = 'multiple-create-test' def _generate_name(self): return data_utils.rand_name(self._name) def _create_multiple_servers(self,...
{ "content_hash": "48061b538bb3241f70053f512e2a1c63", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 41.743589743589745, "alnum_prop": 0.5939803439803439, "repo_name": "eggmaster/tempest", "id": "eed3be8c01d1c93c350f5978847e19b20af0b26a", "size": "22...
"""Support for iOS push notifications.""" import logging import requests from homeassistant.components import ios from homeassistant.components.notify import ( ATTR_DATA, ATTR_MESSAGE, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, BaseNotificationService, ) from homeassistant.const import HTTP_...
{ "content_hash": "c5cdfe673b0d37b76bb5ab23d5f75e48", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 86, "avg_line_length": 31.84259259259259, "alnum_prop": 0.6027915091596394, "repo_name": "sander76/home-assistant", "id": "a096a43ac85d4aad75cf80421093023494cc614f", "size...
import autocomplete_light from models import Client, RelationType # This will generate a PersonAutocomplete class autocomplete_light.register(Client, # Just like in ModelAdmin.search_fields search_fields=['^first_name', 'last_name'], attrs={ # This will set the input placeholder attribute: ...
{ "content_hash": "5630ca600a86d6cd94028c5ca3e97e5c", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 74, "avg_line_length": 36.095238095238095, "alnum_prop": 0.679419525065963, "repo_name": "delphcf/sis", "id": "702f4875416f58b1d84b1fbd1f1d361541f957e6", "size": "1516", ...
import unittest2 from uuid import uuid4 from .data import \ InMemoryDatabase, UserSpecifiedIdProvider, FileSystemDatabase, \ StringDelimitedKeyBuilder import shutil class InMemoryDatabaseTest(unittest2.TestCase): def setUp(self): self.db = InMemoryDatabase() def set(self, k, v): flo =...
{ "content_hash": "b6b75c71503b578744d446a5123f9be3", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 72, "avg_line_length": 30, "alnum_prop": 0.6003831417624521, "repo_name": "JohnVinyard/featureflow", "id": "1e5e9a316a1b648fa5f47698e5199191d05e95c6", "size": "2610", "bi...
from behave import given @given(u'🎸') def step_impl(context): """Step implementation example with emoji(s).""" pass
{ "content_hash": "2c35d06abcbf21930c95542282dc401c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 52, "avg_line_length": 18, "alnum_prop": 0.6666666666666666, "repo_name": "jenisys/behave", "id": "381d2bbdf29035b2bdb535ea63f17f2b64879d7e", "size": "195", "binary": fals...
import json import glob import os from tornado.httpclient import AsyncHTTPClient from vizydrop.sdk.source import SourceFilter from vizydrop.fields import * class FileChooserFilter(SourceFilter): def get_file_options(account, **kwargs): # note that this function will be run as a Tornado coroutine (see gen...
{ "content_hash": "98d98bf680d134815eb34bbddc01e2e4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 94, "avg_line_length": 39.05263157894737, "alnum_prop": 0.6846361185983828, "repo_name": "vizydrop/vizydrop-python-sdk", "id": "23966a1d705852f715b5faa7a0138b766d88d9d5", "...
"""cavelanguage URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
{ "content_hash": "118e40301434370672316b062f8e7531", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 91, "avg_line_length": 39.4375, "alnum_prop": 0.6465927099841522, "repo_name": "Axilent/cave-language", "id": "00092841f207797599baa7196c31b36500a37d9a", "size": "1262", ...
from gevent import monkey; monkey.patch_all() import os VERSION = (0, 1, 'alpha') def get_version(version=None): version = version or VERSION assert(len(version) == 3) return '%s.%s %s' % version # The file path will have `metis.zip` in it if its being run on Spark workers. # In that case we don't want to r...
{ "content_hash": "e84777c2c46403f191e4a9097b8315fb", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 24.821428571428573, "alnum_prop": 0.6834532374100719, "repo_name": "Locu/chronology", "id": "98ea3e2bf7ae377468dfaf39696c2325c7dd37e1", "size": "695"...
from setuptools import setup, find_packages setup( name='remix', version='1.0', description='Collection of scripts', author='Samar', author_email='samar@enstino.com', packages = find_packages(), license = 'MIT', package_dir = {'': '.'}, classifiers=[ 'Development Status :: 4...
{ "content_hash": "00dee501da2db2e481fef138ea107fb5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 49, "avg_line_length": 29.625, "alnum_prop": 0.5822784810126582, "repo_name": "samar-agrawal/remix", "id": "00c96b71b10790b9e093afcb521f1f780c123daf", "size": "711", "bin...
import mock from neutron.agent.linux import bridge_lib from neutron.tests import base class BridgeLibTest(base.BaseTestCase): """A test suite to exercise the bridge libraries """ _NAMESPACE = 'test-namespace' _BR_NAME = 'test-br' _IF_NAME = 'test-if' def setUp(self): super(BridgeLibTest,...
{ "content_hash": "e4f2624be828fbafac24ad138c991107", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 38.67741935483871, "alnum_prop": 0.6105087572977481, "repo_name": "cloudbase/neutron", "id": "10b8d2cfe69274c47b5b130bb0efc0d93997ad1e", "size": "435...
from __future__ import absolute_import import responses from django.core.urlresolvers import reverse from django.utils.http import urlencode from sentry.testutils import APITestCase from sentry.utils import json class SentryAppInstallationExternalRequestsEndpointTest(APITestCase): def setUp(self): self....
{ "content_hash": "33a5d563b8fcd638d9afeecef6af8bf5", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 103, "avg_line_length": 37.108695652173914, "alnum_prop": 0.5837727006444053, "repo_name": "beeftornado/sentry", "id": "9203053e149be606468f0561b67c8320f2792568", "size": "...
"""Utility for eagerly executing operations in parallel on multiple devices.""" import threading import weakref from tensorflow.python import _pywrap_parallel_device from tensorflow.python.distribute import device_util from tensorflow.python.eager import context from tensorflow.python.framework import composite_tenso...
{ "content_hash": "301a3c32edda0ccbca1fb80af9f97dfe", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 80, "avg_line_length": 42.41379310344828, "alnum_prop": 0.6797909407665506, "repo_name": "Intel-Corporation/tensorflow", "id": "6da7c2fd078dc75e1a75481a499765bb8f61629c", ...
import datetime import logging import simplejson from oauth import oauth from django.conf import settings from django.core import mail from google.appengine.api import images from common import api from common import exception from common import mail as common_mail from common import models from common import oauth_...
{ "content_hash": "735c09972b9f7823c8aedb50b1665808", "timestamp": "", "source": "github", "line_count": 1391, "max_line_length": 108, "avg_line_length": 39.48598130841121, "alnum_prop": 0.6202275830678198, "repo_name": "jimpick/jaikuengine", "id": "b3c82369c9b417a4528cbfdd8337fbd6b0fd40c2", "size":...
from __future__ import absolute_import, print_function, division from contextlib import contextmanager from petl.compat import string_types from petl.errors import ArgumentError from petl.util.base import Table, iterpeek, data from petl.io.numpy import infer_dtype def fromhdf5(source, where=None, name=None, condi...
{ "content_hash": "ed626778b8f285cd0e95d144dca063a9", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 90, "avg_line_length": 31.400523560209425, "alnum_prop": 0.506294289287203, "repo_name": "psnj/petl", "id": "841110d6a3aa5c587984191022d25e13abc93925", "size": "12019", ...
from oslo.config import cfg from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.common import constants as const from neutron.common import topics from neutron.openstack.common import importutils from neutron.openstack.common import rpc from neutron.plugins.nicira.common import config from neutr...
{ "content_hash": "3c98d97d20c2876d026a6cf9ead18067", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 79, "avg_line_length": 45.88405797101449, "alnum_prop": 0.6295009475679091, "repo_name": "rickerc/neutron_audit", "id": "150d0feecd8361cb06ac68c416981e8515da7a51", "size": ...
""" WSGI config for chatdemo project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chatdemo.settings") from django.core...
{ "content_hash": "23b30b16945b17fd2d89644fb480842b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.928571428571427, "alnum_prop": 0.7749360613810742, "repo_name": "Thinker-ru/sepiida-chat", "id": "a76a4f46fb210fbbfa911560c1275f133730b64c", "size...
def orientation_from_dcm_header(header): # borrowed from hcp xnat dicom juggling java # get and check the base values if not header: raise ValueError("didn't get a header") o = getattr(header, "ImageOrientationPatient", None) o = [float(a) for a in o] if not o: raise ValueError("...
{ "content_hash": "1f2b29200d108f2cb76a163a8df4e4e7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 30.142857142857142, "alnum_prop": 0.5761679079214624, "repo_name": "beOn/hcpre", "id": "f030b32fa77755897204410757ac9b98918dd7f3", "size": "1477", ...
from __future__ import print_function from kivy.config import Config from kivy.logger import Logger from zipfile import ZipFile import subprocess import shutil import sys import os # Avoid kivy log spam when importing main Config.set('kivy', 'log_level', 'error') try: os.chdir('mmplayer/') sys.path.append(os.g...
{ "content_hash": "ce6328462814f8398abe718f1cab8a12", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 76, "avg_line_length": 34.56666666666667, "alnum_prop": 0.6125843780135005, "repo_name": "Bakterija/mmplayer", "id": "d8ccb79f78735921c2ee6da36849ea4a01e0ee15", "size": "4...
import subprocess import os def _find_matching_file(filename): """Finds a matching filename, defaults to the original filename if it exists. If it doesn't exist, try to find a file with the same name but different extension Args: filename(str): The filename to match includes name and extension...
{ "content_hash": "f2d593955940166bc35b29fd93e83254", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 112, "avg_line_length": 30.54736842105263, "alnum_prop": 0.618538938662991, "repo_name": "tpcstld/youtube", "id": "d12beb74c3495210a9f76746f69ea54f391a9b51", "size": "2902"...
import datetime import os from sqlalchemy.exc import IntegrityError from sqlalchemy import func from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask import Flask, flash, redirect, render_template, request, url_for import redis from rq import Queue import requests from urllib.parse impo...
{ "content_hash": "ee71d163a326d0f906f6564c9e902ead", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 89, "avg_line_length": 31.989690721649485, "alnum_prop": 0.5978085723493394, "repo_name": "openaddresses/esri-indexer", "id": "3a744c857f77871839d4bfe09e9c5d46b22ac843", "...
"""The tests for the signal_messenger platform.""" import os import tempfile import unittest from pysignalclirestapi import SignalCliRestApi import requests_mock import homeassistant.components.signal_messenger.notify as signalmessenger from homeassistant.setup import async_setup_component from tests.async_mock imp...
{ "content_hash": "15be81f2fb026f4a8409c74f17dd4158", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 141, "avg_line_length": 35.72357723577236, "alnum_prop": 0.5914883932635412, "repo_name": "robbiet480/home-assistant", "id": "a44be249f223858aba226b1f90d6a01e446b9e87", "s...
import time from ...protobuf import * from ...protobuf import gt_req_pb2 from ...payload.APNPayload import APNPayload, DictionaryAlertMsg class BaseTemplate: def __init__(self): self.appKey = "" self.appId = "" self.pushInfo = gt_req_pb2.PushInfo() self.pushInfo.invali...
{ "content_hash": "f44fad6a226a73f5d6b77094425de5b1", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 101, "avg_line_length": 37.44, "alnum_prop": 0.5737179487179487, "repo_name": "jerryjobs/thirdpartPushSystem", "id": "d62ae6ad019363c34c291c3e0ea6e547a27a4bad", "size": "3...
import numpy as np import sys, os from PIL import Image, ImageFilter sys.path.append(os.path.abspath("./")) from storage import ParamStorage from interface import command ''' This tool loads the model weight configuration stored in ./results/params.pkl and visualize the weights in the first layer. The weight configura...
{ "content_hash": "8dda1e8ecc9c59ac59690fe45bdc5d1f", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 123, "avg_line_length": 34.07936507936508, "alnum_prop": 0.6422915696320447, "repo_name": "olavvatne/CNN", "id": "f3b0c55bdc26dcd5c2d543c5a02d4b60f930d83e", "size": "2147",...
from __future__ import absolute_import import six from collections import defaultdict from django.db.models import Q from django.db.models.aggregates import Count from sentry.api.serializers import register, serialize, Serializer from sentry.models import ( Project, ProjectBookmark, ProjectOption, ProjectPlatfor...
{ "content_hash": "a681a121f935e0345aa3601c483cec7b", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 83, "avg_line_length": 34.576470588235296, "alnum_prop": 0.5592038108200068, "repo_name": "JackDanger/sentry", "id": "65043e89dedecbf3918bd782ebb506e9683943ce", "size": "5...
from __future__ import unicode_literals # import frappe from frappe.model.document import Document class SessionDefault(Document): pass
{ "content_hash": "b2d9d7ddded34eda6cd04abdca405fa2", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 42, "avg_line_length": 23, "alnum_prop": 0.8043478260869565, "repo_name": "vjFaLk/frappe", "id": "8a8db46ff1a6622847371c9344ac77324fce750b", "size": "272", "binary": false...
from Tkinter import * import subprocess class GUI(Tk): def __init__(self, binary): Tk.__init__(self) self.bin = "./"+binary # value holders self.A = IntVar() self.B = IntVar() self.GD = IntVar() self.GE = IntVar() self.GM = IntVar() ...
{ "content_hash": "d233e92e0277e04eb4b87e645157c080", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 94, "avg_line_length": 32.44, "alnum_prop": 0.5095561035758323, "repo_name": "CleverChuk/ices", "id": "d7555904e931716585c8322b56294070b613e23c", "size": "3294", "binary...
"""LCM type definitions This file automatically generated by lcm. DO NOT MODIFY BY HAND!!!! """ try: import cStringIO.StringIO as BytesIO except ImportError: from io import BytesIO import struct class crazyflie_pos_t(object): __slots__ = ["timestamp", "x", "y", "z", "roll", "pitch", "yaw"] def __init...
{ "content_hash": "64a8a46d381a4dd89e926b4fde9d9559", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 121, "avg_line_length": 32.84126984126984, "alnum_prop": 0.6143064282261962, "repo_name": "peteflorence/crazyflie-tools", "id": "6d9300119a588197157e2426f7fa0e9701518fee", ...
from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.Landing.as_view(), name='landing'), url(r'^patient/$', views.PatientDashboard.as_view(), name='patient-dashboard'), url(r'^patient/history/$', views.PatientHistory.as_view(), name='patient-history'), url(r'^patient/hi...
{ "content_hash": "e4ade9c39b739f79ebcdac64b81abf9c", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 114, "avg_line_length": 61.07142857142857, "alnum_prop": 0.6994152046783626, "repo_name": "marcin-pwr/isrp", "id": "557766637048846e4401cae274f7f02b0cf5f1c0", "size": "855"...
from six.moves import range from congress.datasources import datasource_driver def d6service(name, keys, inbox, datapath, args): """Create a dataservice instance. This method is called by d6cage to create a dataservice instance. There are a couple of parameters we found useful to add to that call, ...
{ "content_hash": "d3ad6ba33419c55f7acc2c15dc1666f6", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 79, "avg_line_length": 37.326530612244895, "alnum_prop": 0.6112629852378348, "repo_name": "ekcs/congress", "id": "5faf56b7f61e11e81e37b267381ba422d89b6287", "size": "2403",...
from django.contrib import admin from django.contrib.contenttypes import generic from django.db import models from pennyblack import settings from pennyblack.options import NewsletterReceiverMixin, JobUnitMixin, JobUnitAdmin from django.utils.timezone import now class NewsletterSubscriberManager(models.Manager): ...
{ "content_hash": "c2b190d22043dfe603e5c42db213547f", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 88, "avg_line_length": 30.401360544217688, "alnum_prop": 0.6464533452673976, "repo_name": "nickburlett/pennyblack", "id": "0499f4207de10cf68954232fd8e37962a0a8a304", "size...
from PyQt4.QtGui import QDialog from PyQt4.QtGui import QVBoxLayout from PyQt4.QtGui import QHBoxLayout from PyQt4.QtGui import QLabel from PyQt4.QtGui import QPixmap from PyQt4.QtCore import Qt from bii_ide.common.style.icons import GUI_ICON_SUDO_128 class SudoError(QDialog): def __init__(self, parent=None): ...
{ "content_hash": "9f36b772d14a8aac16d9538c9f0423df", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 75, "avg_line_length": 29.766666666666666, "alnum_prop": 0.671892497200448, "repo_name": "ArduinoIDE/Arduino-PyQt-IDE", "id": "7e8d71451a773e41896142a0bf33c024829fca44", "s...
""" Test cases for twisted.names. """ from __future__ import nested_scopes import socket, operator, copy from twisted.trial import unittest from twisted.internet import reactor, defer, error from twisted.internet.defer import succeed from twisted.names import client, server, common, authority, hosts, dns from twiste...
{ "content_hash": "d774669c642803dd77594c3cc0f2ba9c", "timestamp": "", "source": "github", "line_count": 649, "max_line_length": 110, "avg_line_length": 34.58859784283513, "alnum_prop": 0.569627583749109, "repo_name": "santisiri/popego", "id": "768626cd68e0eb70263b29fad7ac49b0bd143c17", "size": "225...
import os import dill import matplotlib.ticker as ticker import numpy as np import pySDC.helpers.plot_helper as plt_helper from pySDC.helpers.stats_helper import get_sorted from pySDC.implementations.controller_classes.controller_nonMPI import controller_nonMPI from pySDC.implementations.problem_classes.AllenCahn_1D...
{ "content_hash": "a1d1f3414693cacc5b509ff5fca725c0", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 118, "avg_line_length": 36.43195266272189, "alnum_prop": 0.6391911645281793, "repo_name": "Parallel-in-Time/pySDC", "id": "2977b2afe487a041b2cac2657237b9bf36f27080", "size...
import requests import json import hashlib import hmac import urllib import uuid import sys import logging import time from random import randint from tqdm import tqdm from . import config from .api_photo import configurePhoto from .api_photo import uploadPhoto from .api_photo import downloadPhoto from .api_video imp...
{ "content_hash": "4f4f69c84cda7ac20ef59473fedf0cf3", "timestamp": "", "source": "github", "line_count": 610, "max_line_length": 115, "avg_line_length": 37.842622950819674, "alnum_prop": 0.5609079882169468, "repo_name": "Diapostrofo/instabot", "id": "22133ad7bdc8f558ddbe6e0b82d27978a89581e6", "size"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/food/crafted/shared_dessert_felbar.iff" result.attribute_template_id = 5 result.stfName("food_name","felbar") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "4799a8853c6a004a98cb1a919e053794", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 75, "avg_line_length": 23.153846153846153, "alnum_prop": 0.6976744186046512, "repo_name": "anhstudios/swganh", "id": "27709f2e02c86e6c2dcec3e3296f3db60b586ba1", "size": "44...
import sensor, image, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. c...
{ "content_hash": "39f4f4297f6f7b3f1188ab3c12c248b9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 93, "avg_line_length": 50.125, "alnum_prop": 0.628428927680798, "repo_name": "kwagyeman/openmv", "id": "467b462861e09518798cf219e327143d92cf4744", "size": "936", "binary"...
import argparse from opensfm import commands import data_generation def run_command(command, args): parser = argparse.ArgumentParser() command.add_arguments(parser) parsed_args = parser.parse_args(args) command.run(parsed_args) def test_run_all(tmpdir): data = data_generation.create_berlin_test...
{ "content_hash": "0a7bd4829fcecdde7a3f3ea14713c3b6", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 60, "avg_line_length": 25.5, "alnum_prop": 0.6801470588235294, "repo_name": "kkkarthik6/Lol", "id": "00623fd1ab9d2039982908ac285672fd13274dda", "size": "816", "binary": f...
import numpy as np from scipy.sparse import issparse from scipy.sparse import coo_matrix from scipy.sparse import csc_matrix from scipy.sparse import csr_matrix from scipy.sparse import dok_matrix from scipy.sparse import lil_matrix from sklearn.utils.multiclass import type_of_target from sklearn.utils.testing impor...
{ "content_hash": "2a43eba4a7b61f15ec2099737555bcb4", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 79, "avg_line_length": 36.227184466019416, "alnum_prop": 0.5568955351878652, "repo_name": "zorroblue/scikit-learn", "id": "4f64fc6b4638c20a99bfa183d3a8799861e85bf0", "size...
from io import BytesIO from threading import Condition class FrameSplitter: def __init__(self): self.frame = None self.output = BytesIO() self.condition = Condition() def write(self, buffer): if buffer.startswith(b'\xff\xd8'): # New frame, copy the existing buffer'...
{ "content_hash": "8d35249def0d2c7362d6a543fcc181f1", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 74, "avg_line_length": 27.043478260869566, "alnum_prop": 0.5868167202572347, "repo_name": "misalcedo/RapBot", "id": "ada3649dd744c6617acfd3965636c7cde679d26f", "size": "622...