text
stringlengths
4
1.02M
meta
dict
""" Simple trigrams-based text generation """ __version__ = '0.1.0' import re import json from random import sample class TrigramsDB(object): """ A trigrams database. It has two main methods: ``feed``, to initialize it with some existing text, and ``generate``, to generate some new text. The more te...
{ "content_hash": "75b4174aee374d388a502a4a90646bf3", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 79, "avg_line_length": 28.857142857142858, "alnum_prop": 0.5162659123055162, "repo_name": "bfontaine/trigrams", "id": "486202bb9ba2e51cc44966f872d3cf1675034fcf", "size": "...
import errno import hashlib import io import logging import os from pprint import pformat import re from six.moves.urllib.parse import quote import time import xml.etree.ElementTree as XML import jenkins from jenkins_jobs.alphanum import AlphanumSort from jenkins_jobs.cache import JobCache from jenkins_jobs.constants...
{ "content_hash": "0d5a0b75e7b7ae393c84b8ed24c32612", "timestamp": "", "source": "github", "line_count": 487, "max_line_length": 79, "avg_line_length": 35.64065708418891, "alnum_prop": 0.5277409690614737, "repo_name": "gforcada/jenkins-job-builder", "id": "60685a9583d36ea4308ac85e96aa0d313f6fdaa8", ...
r"""Tool to inspect a model.""" import os from absl import app from absl import flags from absl import logging import numpy as np from PIL import Image import tensorflow as tf import hparams_config import utils from tf2 import infer_lib flags.DEFINE_string('model_name', 'efficientdet-d0', 'Model.') flags.DEFINE_enu...
{ "content_hash": "b6ed18526dcde2f8a182187b3067cca0", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 80, "avg_line_length": 40.70652173913044, "alnum_prop": 0.6443257676902536, "repo_name": "google/automl", "id": "ae0112686cedbe81f07da9fc803a0893731d08df", "size": "8172",...
"""slotview is an interactive tool to analyze slotmode data. The input for the file is either the same input into slotphot or the output from slotphot """ # Ensure python 2.5 compatibility from __future__ import with_statement import time, math import numpy as np import scipy as sp from pyraf import iraf from pyraf....
{ "content_hash": "075672b0ad7fe5954299ffdff4124586", "timestamp": "", "source": "github", "line_count": 858, "max_line_length": 155, "avg_line_length": 34.616550116550115, "alnum_prop": 0.5812598902393858, "repo_name": "crawfordsm/pysalt", "id": "b55cac0ff9fbd8fcaf6aeedef9e36d284a7168c6", "size": "...
import numpy as np import pandas as pd import matplotlib.pyplot as plt #import sys #(just for version number) #import matplotlib #(just for version number) #print('Python version ' + sys.version) #print('Pandas version ' + pd.__version__) #print('Matplotlib version ' + matplotlib.__version__) # In[ ]: file_na...
{ "content_hash": "59cd0cc4084e53d420e7a20371db86ff", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 114, "avg_line_length": 19.294117647058822, "alnum_prop": 0.6504065040650406, "repo_name": "mirams/PyHillFit", "id": "10a6c8d96c3675a7b145309c06a21c2867f37d1a", "size": "10...
from django import template from django.template import Node, TemplateSyntaxError, Variable from django.template.base import render_value_in_context from django.utils import six from django.utils.safestring import SafeData, mark_safe from wagtailsystemtext.utils import systemtext from wagtailsystemtext.models import S...
{ "content_hash": "c5d5e4972c55e590ffcec7082ec378a4", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 93, "avg_line_length": 35.662921348314605, "alnum_prop": 0.5979836168872086, "repo_name": "Frojd/wagtail-systemtext", "id": "8e93be570703b88f55e60d7d50c981f9bda6e0c1", "siz...
"""Integrates Native Apps to Home Assistant.""" from homeassistant import config_entries from homeassistant.const import CONF_WEBHOOK_ID from homeassistant.components.webhook import async_register as webhook_register from homeassistant.helpers import device_registry as dr, discovery from homeassistant.helpers.typing im...
{ "content_hash": "79126a77a40b70f90961a92d4f4eec3c", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 35.00833333333333, "alnum_prop": 0.6393715781956677, "repo_name": "jamespcole/home-assistant", "id": "a4ae78959cf3675e9ea22373c887ffd07aaf2e38", "si...
"""Add ``is_encrypted`` column to variable table Revision ID: 1968acfc09e3 Revises: bba5a7cfc896 Create Date: 2016-02-02 17:20:55.692295 """ from __future__ import annotations import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = '1968acfc09e3' down_revision = 'bba5a7cfc...
{ "content_hash": "14cbb33e43a06866177f47765359b8dc", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 83, "avg_line_length": 21.423076923076923, "alnum_prop": 0.7289048473967684, "repo_name": "nathanielvarona/airflow", "id": "61e660361bcd04554cc2590498e61540b9c9037e", "size...
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import copy import gyp.common...
{ "content_hash": "3fda62a2c7538206a0a12ecd0b7a467d", "timestamp": "", "source": "github", "line_count": 1677, "max_line_length": 191, "avg_line_length": 39.97376267143709, "alnum_prop": 0.6623456053463811, "repo_name": "adobe/brackets-shell", "id": "2dec19e5d6fb548bd2002c37f88dbcf0086eecab", "size"...
from django.db import models from django.utils.encoding import python_2_unicode_compatible from django_pandas.managers import DataFrameManager, PassThroughManager @python_2_unicode_compatible class MyModel(models.Model): index_col = models.CharField(max_length=1) col1 = models.IntegerField() col2 = models...
{ "content_hash": "2488ca962b2e8539cbb73ffa4a2ccb88", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 75, "avg_line_length": 25.25438596491228, "alnum_prop": 0.6262591177492185, "repo_name": "perpetua1/django-pandas", "id": "3bd96f364693e077c4e93f06e6e8c56727a81491", "size...
__author__ = 'Stavros Korokithakis' __email__ = '[email protected]' __version__ = '0.1.0' from .requests_guard import guard, guard_iter
{ "content_hash": "b520b8605ccd49275e5e549f5e929d35", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 45, "avg_line_length": 26.6, "alnum_prop": 0.6616541353383458, "repo_name": "skorokithakis/requests-guard", "id": "7ee073bd1084b5e6fa063fcaf3ba5799a42d0670", "size": "158", ...
"""Decorators to provide authorization for the cloud datastore admin service. """ from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules def can_perform_cron_tasks(handler): """Decorator to ensure that the handl...
{ "content_hash": "d73a099f155585068e9c9a5e89ceef19", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 78, "avg_line_length": 32.583333333333336, "alnum_prop": 0.6325660699062233, "repo_name": "prasanna08/oppia", "id": "ec69d372b0fee702ef784e8e470d0b1c9f7c7524", "size": "179...
"""Support for MQTT climate devices.""" import functools import logging import voluptuous as vol from homeassistant.components import climate from homeassistant.components.climate import ( PLATFORM_SCHEMA as CLIMATE_PLATFORM_SCHEMA, ClimateEntity, ) from homeassistant.components.climate.const import ( ATT...
{ "content_hash": "94d94ff2a78a1d5bec71ae4632e2b4a1", "timestamp": "", "source": "github", "line_count": 895, "max_line_length": 87, "avg_line_length": 36.3050279329609, "alnum_prop": 0.6236420152032746, "repo_name": "lukas-hetzenecker/home-assistant", "id": "fb19c5e7038777a07d8af4551c8627aa63aa2a7d",...
""" ./examples/label/bdd/bdd_label.rst """ from hamcrest import assert_that from allure_commons_test.report import has_test_case from allure_commons_test.label import has_epic from allure_commons_test.label import has_feature from allure_commons_test.label import has_story def test_single_bdd_label(executed_docstrin...
{ "content_hash": "aee5d1bf564966e8d3308a7564d7861f", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 62, "avg_line_length": 40.96774193548387, "alnum_prop": 0.5007874015748032, "repo_name": "allure-framework/allure-python", "id": "28d72275d7c04e689916a9acafdd3e169181ab45", ...
"""Example search service that uses a general db file of populated locations. This service provides: A) a function that registers the service. B) a search service object that inherits from this class with 2 methods: 1) KmlSearch: a method for getting kml search results. 2) JsonSearch: a method for getting ...
{ "content_hash": "514882238f7b1f6ddae4af8b33152c59", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 77, "avg_line_length": 33.80327868852459, "alnum_prop": 0.6665858389912707, "repo_name": "tst-mswartz/earthenterprise", "id": "2ba00e6659096a6a2809259412d6eae9d39cde21", "...
import time, sys, os, config from comodit_client.api import Client from comodit_client.api.exceptions import PythonApiException from comodit_client.api.collection import EntityNotFoundException from comodit_client.rest.exceptions import ApiException from comodit_client.api.host import Host from helper import create_h...
{ "content_hash": "74d7a6d238c15916483f5b7c4c474c75", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 109, "avg_line_length": 31.966216216216218, "alnum_prop": 0.6045233565842316, "repo_name": "comodit/demos", "id": "5c824825c7a5e83151c2fe8031ace0ce1c06fbce", "size": "4754...
''' For User collection ''' import json import tornado.web from config import CMS_CFG from torcms.core import tools from torcms.core.base_handler import BaseHandler from torcms.core.tools import logger from torcms.model.collect_model import MCollect class CollectHandler(BaseHandler): ''' For User collectio...
{ "content_hash": "c81656e448a8834e9d2bf9dd32d8370e", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 83, "avg_line_length": 29.285714285714285, "alnum_prop": 0.5289198606271777, "repo_name": "bukun/TorCMS", "id": "a0a2d9a006ad4444cfe0382bb657c4f070e80752", "size": "2893", ...
""" Track resources like memory and disk for a compute host. Provides the scheduler with useful information about availability through the ComputeNode model. """ import collections import copy from oslo_log import log as logging from oslo_serialization import jsonutils from nova.compute import claims from nova.compu...
{ "content_hash": "bcef6122998cec4450f53270ad9f4115", "timestamp": "", "source": "github", "line_count": 1139, "max_line_length": 79, "avg_line_length": 44.57682177348551, "alnum_prop": 0.6044551237862643, "repo_name": "Juniper/nova", "id": "e5a57101d809f8ff67458fa61efc805afc48574a", "size": "51413"...
""" Functions for conic geometry implemented for use with the `sympy` symbolic math module. Generally, for use in testing and validation. """ from sympy import Matrix def center(conic): ec = conic[:-1,:-1].inv() eo = -conic[:-1,-1] return ec*eo def dual(conic): return conic.inv() def polar_plane(ell,...
{ "content_hash": "c1fcf887a239ada9f2fb27073e505f84", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 58, "avg_line_length": 22.541666666666668, "alnum_prop": 0.6451016635859519, "repo_name": "davenquinn/Attitude", "id": "84782206801cb8685d9324c916bf593c93539cf4", "size": "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/components/reactor/shared_rct_kessel_rebel_mandal_modified_gorax.iff" result.attribute_template_id = 8 result.stfName("space/space_item","rct_kessel_rebel_mandal_modified_gorax_n") #### BEGIN MODIFICAT...
{ "content_hash": "876692ca217e9360e1b8ea99161cd549", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 110, "avg_line_length": 29, "alnum_prop": 0.726790450928382, "repo_name": "anhstudios/swganh", "id": "93082f959db67ec832e91e869655215bdb2afcbd", "size": "522", "binary": ...
"""Fetches the Universal Dependencies. Visit: http://universaldependencies.org""" import os import anna.data.utils as utils UD_URL = "https://lindat.mff.cuni.cz/repository/xmlui/bitstream/handle/11234/" UD_LINKS = { "1.0": UD_URL + "1-1464/universal-dependencies-1.0.tgz", "1.1": UD_URL + "LRT-1478/ud-treeba...
{ "content_hash": "11cc409700ffe57e9d845b43cf14c5c6", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 78, "avg_line_length": 29.34, "alnum_prop": 0.6271301976823449, "repo_name": "jpbottaro/anna", "id": "97724cb07b87fc1e3c67135a25cabcb071dff18d", "size": "1467", "binary":...
import sys import logging import requests import time import traceback import html.parser import urllib.parse from ray.new_dashboard.tests.conftest import * # noqa import pytest import ray from ray.test_utils import ( format_web_url, wait_until_server_available, ) logger = logging.getLogger(__name__) class...
{ "content_hash": "26f99cc5b64b03e8583b0b565ee2e25a", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 78, "avg_line_length": 31.34234234234234, "alnum_prop": 0.5536073584363322, "repo_name": "richardliaw/ray", "id": "f92e11032bb5094a97feb15df73f9192d9cb74ef", "size": "3479...
# Form implementation generated from reading ui file '.\ImageLoad.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets import FileDialog import ImDiffMod import cv2 import ImDiff class Ui_MainWindow(object): ...
{ "content_hash": "a96f68b3fc73d4f78dda3e64865f3dcb", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 101, "avg_line_length": 37.77018633540373, "alnum_prop": 0.6341062325275448, "repo_name": "SoumyajitPal/YinYang", "id": "12fbda67529fc6566bc419384a332909b60ecb7b", "size":...
__all__ = ['ArpWatchLogging', 'ArpData','RosAPI']
{ "content_hash": "df0ec671a61d90c24423b9da990a75f1", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 49, "avg_line_length": 50, "alnum_prop": 0.62, "repo_name": "davidnutter/mikrotik-arpwatch", "id": "76bf930f9bcb9a4e975d4c576705c162d7d39818", "size": "1700", "binary": fa...
from django.apps import AppConfig class SchedulerConfig(AppConfig): name = 'scheduler'
{ "content_hash": "e27c254c829b4932e93ce4e006cd93c8", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 18.6, "alnum_prop": 0.7634408602150538, "repo_name": "saketbairoliya2/salescheduler", "id": "60fb286a921fd77afb7998faa0e3ce26da4478f9", "size": "93", ...
__author__ = 'Traphix' import sys import time error_log_file = '/ms/msc/logs/msc_error.log' class ErrorLogger(object): def __init__(self): self.terminal = sys.stderr self.log = file(error_log_file, "a+") self.log.write('\n*********************************\n' + \ 'MS...
{ "content_hash": "d904ae05c133034fb93cfd714c141295", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 87, "avg_line_length": 27.818181818181817, "alnum_prop": 0.49836601307189543, "repo_name": "halexan/msc", "id": "24c744f2344cc598a1a08563383f2200b98eef5b", "size": "637", ...
import itertools import json import logging import re from django.utils.translation import ugettext as _ from desktop.lib.django_util import JsonResponse from desktop.lib.exceptions_renderable import PopupException from search.models import Collection from controller import CollectionManagerController from utils imp...
{ "content_hash": "d04fdbce066cf1769ef18db6b5ef0be4", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 149, "avg_line_length": 32.883720930232556, "alnum_prop": 0.6333097595473833, "repo_name": "mapr/hue", "id": "d4e6acd9b2967768e64362792b942b254c3f5887", "size": "9276", ...
from unittest import main from qiita_pet.test.tornado_test_base import TestHandlerBase class TestLogEntryViewerHandler(TestHandlerBase): def test_get(self): response = self.get('/admin/error/') self.assertEqual(response.code, 403) def test_post(self): response = self.post('/admin/erro...
{ "content_hash": "6a41304c96fcca276ff1f6c2fcd59320", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 28.526315789473685, "alnum_prop": 0.6494464944649446, "repo_name": "biocore/qiita", "id": "803f521d3144d4b8bff3b1c4927ec375d7a0032d", "size": "893", ...
import numba import numpy as np @numba.jit(nopython=True, parallel=True) def _average_visibilities(vis, weight, flag, timeav, chanav, flagav): # Workaround for https://github.com/numba/numba/issues/2921 flag_u8 = flag.view(np.uint8) # Compute shapes n_time, n_chans, n_bl = vis.shape av_n_time = n...
{ "content_hash": "9989b27a579497100e396ee12ac0cdff", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 106, "avg_line_length": 44.70503597122302, "alnum_prop": 0.586578693273254, "repo_name": "ska-sa/katdal", "id": "22aecea2f50f176712d2168c2ba82a3997dab775", "size": "6980",...
""" [1] - Attention Is All You Need - Vaswani, Jones, Shazeer, Parmar, Uszkoreit, Gomez, Kaiser - Google Brain/Research, U Toronto - 2017. https://arxiv.org/pdf/1706.03762.pdf [2] - Stabilizing Transformers for Reinforcement Learning - E. Parisotto et al. - DeepMind - 2019. https://arxiv.org/pdf/1910....
{ "content_hash": "d196197a8ad0430321ee87853665cb50", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 79, "avg_line_length": 42.095115681233935, "alnum_prop": 0.5725801526717558, "repo_name": "pcmoritz/ray-1", "id": "0a48bd91e8ce3040f764616961ce273c6399d1ca", "size": "1637...
"""Library with common functions for training and eval.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import tensorflow as tf from tensorflow.contrib.slim.nets import resnet_v2 def default_hparams(): """Returns default hyperparameters....
{ "content_hash": "ca051df764591566db8a5a2e64c9e66f", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 79, "avg_line_length": 33.47126436781609, "alnum_prop": 0.6639766483516484, "repo_name": "tombstone/models", "id": "1499a378ea1ba6511122ebe54ceed1226d38d649", "size": "650...
''' RGZcatalog is a pipeline that takes all of the completed RGZ subjects and creates a Mongo database containing consensus matching information, radio morphology, IR counterpart location, and data from corresponding AllWISE and SDSS catalogs. ''' import logging, urllib2, time, json, os, datetime import pymongo import...
{ "content_hash": "08eb9300bda31fd5e2ce446c3729805f", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 148, "avg_line_length": 37.48692810457516, "alnum_prop": 0.6460639874466044, "repo_name": "willettk/rgz-analysis", "id": "533cf6669d5e46d70924ee05b9da94b72bc11f0a", "size"...
""" Django settings for compass project. Generated by 'django-admin startproject' using Django 1.8.6. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
{ "content_hash": "e3fefaed742a043a890654bdcb60c228", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 72, "avg_line_length": 25.784, "alnum_prop": 0.6472230840831523, "repo_name": "patrickspencer/django_jinja_test_repo", "id": "2e8c440f6d64b887751ddea17a49383f4e4d0319", "s...
''' 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": "0a771c56a0fe804d712c2ddfdb2d2156", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 84, "avg_line_length": 35.35443037974684, "alnum_prop": 0.7178660938059435, "repo_name": "pluradj/incubator-tinkerpop", "id": "6ec3b46a7377d73d49d4bf490309fd1934a2a7a2", "s...
from pandas.compat import range import numpy as np from pandas.core.api import Series, Categorical import pandas as pd import pandas.core.algorithms as algos import pandas.util.testing as tm import pandas.hashtable as hashtable class TestMatch(tm.TestCase): _multiprocess_can_split_ = True def test_ints(sel...
{ "content_hash": "23c5ce76dd9713716f5b11c0e8e521bd", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 99, "avg_line_length": 39.72115384615385, "alnum_prop": 0.5862987170176712, "repo_name": "bdh1011/wau", "id": "c80cea3ab7a7da18c59dae3f979af9b49e208a12", "size": "12417", ...
"""Test class for common methods used by iLO modules.""" import tempfile import mock from oslo_config import cfg from ironic.common import boot_devices from ironic.common import exception from ironic.common.glance_service import service_utils from ironic.common import image_service from ironic.common import images f...
{ "content_hash": "8ec7cab3558a4ad54f46cba24d6a14f7", "timestamp": "", "source": "github", "line_count": 1207, "max_line_length": 79, "avg_line_length": 53.40016570008285, "alnum_prop": 0.5802587892140131, "repo_name": "rdo-management/ironic", "id": "f44e532b933dd7aa6edf15c82cd0216e87bea33c", "size"...
import os from sys import path from os.path import join from django.core.urlresolvers import reverse_lazy # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) path.append(join(BASE_DIR, 'apps')) ALLOWED_HOSTS = [] DJANGO_APPS...
{ "content_hash": "8b51623653e28746fa4fab9cc60a6825", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 91, "avg_line_length": 27.10655737704918, "alnum_prop": 0.66253401874811, "repo_name": "migcruz/dota2analytics", "id": "94af59d64c9db787bd1909221bcca32fe7cbacd9", "size": ...
from awxkit.api import pages, client, resources # NOQA from awxkit.config import config # NOQA from awxkit import awx # NOQA from awxkit.ws import WSClient # NOQA
{ "content_hash": "dbe8db5bace4e6ef85ab4432ca853a6e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 54, "avg_line_length": 40.75, "alnum_prop": 0.7852760736196319, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "23e059823727ea67da6ad34bf28131b42ee6bfc1",...
import sublime import sublime_plugin from Vintageous.state import State from Vintageous.vi.utils import IrreversibleTextCommand class ViCommandMixin(object): ''' Provides functionality needed by most vim commands. Intended to be used with TextCommand and WindowCommand classes. ''' @property ...
{ "content_hash": "246268f06e3a38d8f4aee1a7b5444017", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 94, "avg_line_length": 30.583333333333332, "alnum_prop": 0.5887829246139873, "repo_name": "gerardroche/Vintageous", "id": "8d56db51d8b1eea77ba5962bf180e55b40e06a98", "size...
import burnGPIO as IO from time import sleep import sys, termios, atexit from intelhex import IntelHex from select import select from CpuPIC18F import PIC18F from mydelay import mydelay class PIC18FXXK80(PIC18F): WriteBufferSize =64 EraseBufferSize =64 #cpu List dict. CpuId [Name , IdMask, Revision Mask, Block...
{ "content_hash": "c7023388412726b636db298566090d41", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 109, "avg_line_length": 29.353562005277045, "alnum_prop": 0.6332584269662921, "repo_name": "danjperron/burnLVP", "id": "b11801bc164e4181440053fcbafb9af2587aca59", "size": ...
from etraining_course_finder.model import CourseOperation from flask import Flask, request, render_template from flask import redirect, url_for app = Flask(__name__) app.config.from_object('etraining_course_finder.publishconf') @app.route('/', methods=['GET', 'POST']) def index(): if request.method == 'POST' and r...
{ "content_hash": "1842ef5dcb06ece39a4d4fa3ca2c05bc", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 77, "avg_line_length": 31.608695652173914, "alnum_prop": 0.7152682255845942, "repo_name": "hansliu/etraining-course-finder-heroku", "id": "95cf647a404d7220cbe9c745d4845375374...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import time from warnings import warn import platform import os import sys from . import basex from . import dasch from . import daun from . import di...
{ "content_hash": "73095c0da4725573b5232e1255fdda45", "timestamp": "", "source": "github", "line_count": 785, "max_line_length": 99, "avg_line_length": 39.163057324840764, "alnum_prop": 0.6014051979312364, "repo_name": "stggh/PyAbel", "id": "aae623e9c665b470ed36e476d7e5ae1b90ebcfa2", "size": "30844"...
""" Implementation of the class of ProphetStor DPL storage adapter of Federator. # v2.0.1 Consistency group support # v2.0.2 Pool aware scheduler # v2.0.3 Consistency group modification support # v2.0.4 Port ProphetStor driver to use new driver model """ import base64 import errno import json import ra...
{ "content_hash": "6a7bbd3527521877fcdee7b1434d66e4", "timestamp": "", "source": "github", "line_count": 1483, "max_line_length": 79, "avg_line_length": 41.80512474713419, "alnum_prop": 0.4914270045324774, "repo_name": "bswartz/cinder", "id": "4c5c9ca5c633f2aba0f4eca0dd9d3ce510839757", "size": "6263...
from pyparsing import oneOf, OneOrMore, printables, StringEnd test = "The quick brown fox named 'Aloysius' lives at 123 Main Street (and jumps over lazy dogs in his spare time)." nonAlphas = [ c for c in printables if not c.isalpha() ] print("Extract vowels, consonants, and special characters from this test string:")...
{ "content_hash": "fd726c3af658a406f498dc3ee29f3003", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 116, "avg_line_length": 35.022222222222226, "alnum_prop": 0.758248730964467, "repo_name": "nzavagli/UnrealPy", "id": "241876c5faf4c6d13e3685794c9dcf9e9a33b0b6", "size": "17...
from __future__ import with_statement from cms.api import create_page, add_plugin from cms.models import Page from cms.models.placeholdermodel import Placeholder from cms.models.pluginmodel import CMSPlugin from djangocms_text_ckeditor.models import Text from cms.tests.plugins import PluginsTestBaseCase from cms.test_...
{ "content_hash": "7a5516ed4db69ab3956c1e1b06643faf", "timestamp": "", "source": "github", "line_count": 911, "max_line_length": 119, "avg_line_length": 51.23051591657519, "alnum_prop": 0.589102440487669, "repo_name": "11craft/django-cms", "id": "431063e4d88b8066611f136094c6e21a408792b9", "size": "4...
"""Utility functions to parse specific values, usually from JSON responses.""" import re def parse_timestamp(string): """Parse the timestamp that should be written in the standard format.""" timeformat = '%Y-%m-%dT%H:%M:%S.%f' return datetime.datetime.strptime(string, timeformat) def parse_float_value_f...
{ "content_hash": "a39122ef0b5a5d00d869891aa20e823a", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 35.73529411764706, "alnum_prop": 0.6255144032921811, "repo_name": "jpopelka/fabric8-analytics-common", "id": "6be6351efca69fb71909ce669fe43df0148220ff"...
from uw_sws.section import (get_sections_by_instructor_and_term, get_sections_by_delegate_and_term, get_sections_by_curriculum_and_term, get_sections_by_building_and_term, get_changed_sections_by_term, get_se...
{ "content_hash": "c25db94f4d889615ac0ff7861ce3d634", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 67.44444444444444, "alnum_prop": 0.4958813838550247, "repo_name": "uw-it-aca/uw-restclients", "id": "fda0e9f7dadb32052fd7ed752dee3857fd9abb0c", "size"...
"""The VLC media player Telnet integration.""" from aiovlc.client import Client from aiovlc.exceptions import AuthError, ConnectError from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, Platform from homeassistant.core import HomeAssistant from home...
{ "content_hash": "44af2d3cd4bdab71cd65bf1ebcb4176b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 82, "avg_line_length": 29.70149253731343, "alnum_prop": 0.6914572864321608, "repo_name": "toddeye/home-assistant", "id": "9fe3b97ab3167dd5d2ac68a63d5e0d9d3e38a574", "size":...
import sys, os, subprocess, errno, re from os.path import exists TOOl_PATH = "/usr/bin/ipmitool" try: from subprocess import check_call from subprocess import CalledProcessError except ImportError: def check_call(*popenargs, **kwargs): import subprocess retcode = subprocess.call(*popen...
{ "content_hash": "ec00e3642b993f874a347f8d4d257131", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 112, "avg_line_length": 26.695876288659793, "alnum_prop": 0.5558988221664414, "repo_name": "jcshen007/cloudstack", "id": "c9e9a66d4f801bbe1047b1a7629b7ba345aff465", "size"...
from __future__ import unicode_literals from django.db import models, migrations import cobra.models.fields.bounded class Migration(migrations.Migration): dependencies = [ ('project', '0001_initial'), ] operations = [ migrations.AddField( model_name='project', na...
{ "content_hash": "fdf34741325ad2045d8dbced2e285098", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 142, "avg_line_length": 32.21052631578947, "alnum_prop": 0.579248366013072, "repo_name": "lyoniionly/django-cobra", "id": "7b091ea6e67138ef3e1d656b5e83737bb0986326", "size"...
import sys import subprocess import time import unittest if sys.version_info[0] == 2: _unicode_prefix = 'u' else: _unicode_prefix = '' class ExamplesTest(unittest.TestCase): def test_helloworld(self, example="helloworld.py"): p = subprocess.Popen([example], stderr=subprocess.STDOUT, stdout=subpro...
{ "content_hash": "bde4e83d1480bdffcdccec44b940f0ef", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 131, "avg_line_length": 45.083333333333336, "alnum_prop": 0.5844395899848764, "repo_name": "Karm/qpid-proton", "id": "3d97b97aff906d5e67e578ad092906600eecbd29", "size": "6...
from haas.test_common import config_testsuite, config_merge, \ fresh_database from haas.config import load_extensions from haas.flaskapp import app from haas.model import db from haas.migrations import create_db from haas.ext.network_allocators.vlan_pool import Vlan import pytest @pytest.fixture def configure(): ...
{ "content_hash": "548b29816606e3341645bba596d3c81b", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 31.708333333333332, "alnum_prop": 0.640604467805519, "repo_name": "henn/haas", "id": "7e86d2fbc940c9c5dc986f17541a15e86212df56", "size": "1522", "b...
import sys, os # 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.append(os.path.abspath('.')) # -- General configuration...
{ "content_hash": "977d67f7788d470a740ec04a6ee85392", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 81, "avg_line_length": 33.197916666666664, "alnum_prop": 0.7091308440539692, "repo_name": "redhataccess/redhat-support-lib-python", "id": "48ed2e18065907233bd309ad6cfaa9520b...
import vaex import numpy as np def plot2d_tensor(self, x, y, vx, vy, shape=16, limits=None, delay=None, show=False, normalize=False, selection=None, facecolor='green', alpha=0.5, edgecolor='black', scale=1., min_count=0): import matplotlib.pylab as plt shape = vaex.dataset._expand_shape(shap...
{ "content_hash": "55ce24a3236f458011b4cb63f10cef35", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 117, "avg_line_length": 40.27450980392157, "alnum_prop": 0.5418695228821812, "repo_name": "maartenbreddels/vaex", "id": "6d2c909731cf810d4dca214c1c5b9035b813e62d", "size":...
from __future__ import unicode_literals import copy import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings from django.core import management, signals from django.core.cache import ( DEFAULT_CACHE_ALIAS, CacheKeyWarning, cach...
{ "content_hash": "ee4bee4c46c8365548d2aa338763f9b9", "timestamp": "", "source": "github", "line_count": 2106, "max_line_length": 121, "avg_line_length": 39.6951566951567, "alnum_prop": 0.6262470394028565, "repo_name": "devops2014/djangosite", "id": "c6e76c417c6841369d96f34fc4f60e3bfdccb658", "size"...
import argparse import pdb import traceback from dataclasses import dataclass from typing import Dict, List, Optional, Tuple @dataclass class Instruction: name: str reg: Optional[str] offset: Optional[int] def __str__(self) -> str: if self.name in ["hlf", "tpl", "inc"]: return f"{...
{ "content_hash": "d03f3e42ee37587bc4ab963a4063256e", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 95, "avg_line_length": 29.276785714285715, "alnum_prop": 0.5114364135407137, "repo_name": "BrendanLeber/adventofcode", "id": "ca437d905b6c26a81af3fb014e39b7bd82767d8b", "s...
""" EasyBuild support for iqacml compiler toolchain (includes Intel compilers, QLogicMPI, ACML, BLACS, ScaLAPACK and FFTW). @author: Kenneth Hoste (Ghent University) """ from easybuild.toolchains.compiler.inteliccifort import IntelIccIfort from easybuild.toolchains.fft.fftw import Fftw from easybuild.toolchains.linal...
{ "content_hash": "d3f26e5abc13d3b00fd771e1ff78e08a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 119, "avg_line_length": 39.375, "alnum_prop": 0.8, "repo_name": "ULHPC/modules", "id": "9529746985d5c02f46c2b4310f6c8feec8fe7245", "size": "1688", "binary": false, "cop...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/space/reverse_engineering/shared_booster_analysis_tool.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### re...
{ "content_hash": "94bb91396ebf3394907b27bca49328f3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 102, "avg_line_length": 25.46153846153846, "alnum_prop": 0.7099697885196374, "repo_name": "anhstudios/swganh", "id": "ad347f5b445420f2fc4f6a65d936cd02d6d94407", "size": "47...
""" The Plaid API The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from plaid.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal...
{ "content_hash": "f1c916ee920435fce5eb21bb293ae293", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 338, "avg_line_length": 43.72727272727273, "alnum_prop": 0.5752338877338877, "repo_name": "plaid/plaid-python", "id": "04405642bce60b0d1e6f78483818ad6709b81331", "size": "...
from bokeh.layouts import column from bokeh.models.widgets import Div from bokeh.models import HoverTool, ColumnDataSource, PrintfTickFormatter from bokeh.models import LinearColorMapper, ColorBar from dashboard.bokeh.plots.descriptors.table import Table from dashboard.bokeh.plots.descriptors.title import Title from...
{ "content_hash": "acd521056ee46febead23d27abb8f653", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 89, "avg_line_length": 33.93877551020408, "alnum_prop": 0.6632591701743836, "repo_name": "desihub/qlf", "id": "acc40831c175fce738067372ca956f256f92cac9", "size": "1663", ...
from sqlalchemy.engine import Connection from time import time from thread import get_ident from weakref import ref thread_query_logs = {} def _time(fn): start = time() fn() end = time() return end - start # wrap _cursor_execute, _cursor_executemany w/ timing code o1, o2 = Connection._cursor_execute,...
{ "content_hash": "a52d694ffea0c99a0509d2b8a52f1ad2", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 77, "avg_line_length": 33.40677966101695, "alnum_prop": 0.6484018264840182, "repo_name": "NetShepsky/Ferrox", "id": "f2442fe4d9e8519aa887c91d62ddbf3562041955", "size": "206...
""" This is an example dag for using `ImapAttachmentToS3Operator` to transfer an email attachment via IMAP protocol from a mail server to S3 Bucket. """ from datetime import datetime from os import getenv from airflow import DAG from airflow.providers.amazon.aws.transfers.imap_attachment_to_s3 import ImapAttachmentTo...
{ "content_hash": "48a62b97884f761f6516ca0c772ca1f3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 102, "avg_line_length": 34.470588235294116, "alnum_prop": 0.7090443686006825, "repo_name": "Acehaidrey/incubator-airflow", "id": "357d92a6f5694d9cf749d0263708a61d15d12650", ...
"""OpenGL-ctypes setup script (setuptools-based) """ import sys, os extra_commands = {} try: from setuptools import setup except ImportError: from distutils.core import setup if sys.hexversion >= 0x3000000: try: from distutils.command.build_py import build_py_2to3 extra_commands['build_py']...
{ "content_hash": "2f32e5bc96ad76437f00acde54cd3476", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 63, "avg_line_length": 29.52112676056338, "alnum_prop": 0.5906488549618321, "repo_name": "frederica07/Dragon_Programming_Process", "id": "e6f076cd45e8da3ffc96e7b244d1df769511...
from django import forms from django.contrib.auth import get_user_model from django.contrib.sites.models import get_current_site from django.utils.translation import ugettext_lazy as _ from .models import Hub, HubUser from .utils import create_hub from .backends import InvitationBackend class HubForm(forms.ModelForm...
{ "content_hash": "c05fa9ebf648212a5606df3e3ec05fb7", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 78, "avg_line_length": 36.201388888888886, "alnum_prop": 0.5996547093803951, "repo_name": "toolhub/toolhub.co", "id": "99dd6df47935821ca9c6c5454c84e78fe8cac4b7", "size": "...
from __future__ import absolute_import import sys from apscheduler.executors.base import BaseExecutor, run_job try: import gevent except ImportError: # pragma: nocover raise ImportError('GeventExecutor requires gevent installed') class GeventExecutor(BaseExecutor): """ Runs jobs as greenlets. ...
{ "content_hash": "a5db953394dc42fc9082093130382c11", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 87, "avg_line_length": 25.433333333333334, "alnum_prop": 0.6068152031454783, "repo_name": "171121130/SWI", "id": "a12b806af3825d739bce9e8c3905c9f7a08b3448", "size": "763", ...
""" Client side of the compute RPC API. """ from oslo.config import cfg from nova import exception from nova.objects import base as objects_base from nova.openstack.common.gettextutils import _ from nova.openstack.common import jsonutils from nova import rpcclient rpcapi_opts = [ cfg.StrOpt('compute_topic', ...
{ "content_hash": "4a3ce0301b05bc399814da4452461584", "timestamp": "", "source": "github", "line_count": 936, "max_line_length": 79, "avg_line_length": 46.97115384615385, "alnum_prop": 0.5887182986466507, "repo_name": "rickerc/nova_audit", "id": "5784f67ba65126c49ce273d7024b2c362d75092e", "size": "4...
import argparse from sys import argv from vang.bitbucket.get_branches import do_get_branches from vang.bitbucket.utils import get_repo_specs def has_branch(repo_specs, branch): for spec in repo_specs: branches = [ b["displayId"] for spec, bs in do_get_branches((spec,), branch) for b in bs ...
{ "content_hash": "d70b6cb770206680e375704127c6c687", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 87, "avg_line_length": 29.646153846153847, "alnum_prop": 0.5760249091852621, "repo_name": "bjuvensjo/scripts", "id": "6bc603a88279009240b9372730ee3866559c7d68", "size": "19...
prefixes = ["", "lookup", "look up", "who is", "who has", "tell me who", "give me the name of", ("who", "is"), ("tell me who", "is")] bodies = [ "{CallSignA} {CallSignB} {CallSignC}", "{CallSignA} {CallSignB} {CallSignC} {CallSignD}", "{CallSignA} {CallSignB} {CallSignC} {CallSignD} {CallSignE}", "{Call...
{ "content_hash": "ef49b7d9951a2b01dadf7c1e7e53d6ac", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 133, "avg_line_length": 42.294117647058826, "alnum_prop": 0.5744089012517385, "repo_name": "maihde/alexa-qrz", "id": "967cbc0c987bf0ac2f54d12d25f7dde7c8d7b698", "size": "73...
import re import subprocess import sys from .source import Source from .configuration import Configuration from itertools import chain import io import codecs class PDFKit(object): """ Main class that does all generation routine. :param url_or_file: str - either a URL, a path to a file or a string contai...
{ "content_hash": "21b257abc451cb6dee2fc2c187f94646", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 135, "avg_line_length": 37.90867579908676, "alnum_prop": 0.548662972777644, "repo_name": "phobson/python-pdfkit", "id": "a3318c930a9a36215d316f0faab2ac95e18f11e9", "size":...
""" Practica 8-9 - Magicians Make a list of magician’s names. Pass the list to a function called show_magicians(), which prints the name of each magician in the list .""" def show_messages(mensaje): for mensaje in mensaje: print(mensaje) mensaje = ["Hola soy el mensaje 1", "Hi i am the message ...
{ "content_hash": "f12de8ee8cc9d8f24138c08cec70b5c2", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 90, "avg_line_length": 31.416666666666668, "alnum_prop": 0.6870026525198939, "repo_name": "AnhellO/DAS_Sistemas", "id": "28c884430c01a1ea0606c067de9c126f225436c2", "size": ...
from dbSetup.tinyDbSetup import db import tinydb PATH = 'tinydb.json' TEST_DATA = [ {'name': 'John', 'age': 40}, {'name': 'Ringo', 'age': 79}, {'name': 'Paul', 'age': 77}, {'name': 'George', 'age': 58} ] def test_basic(): """ simplest possible test to verify the import works """ db(PATH).pur...
{ "content_hash": "97fce8b756b774481f90cc2e025f08b7", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 61, "avg_line_length": 25.194444444444443, "alnum_prop": 0.5788313120176406, "repo_name": "chrisbrake/PythonSandbox", "id": "e5343e935f4a694ccce57e6585427e9d264a23fd", "siz...
import matplotlib.pyplot as plt from mpl_toolkits.axes_grid.axislines import Subplot fig = plt.figure(1, (3,3)) ax = Subplot(fig, 111) fig.add_subplot(ax) ax.axis["right"].set_visible(False) ax.axis["top"].set_visible(False) plt.show()
{ "content_hash": "286e5c9007bf7853e7fe6768ff7589eb", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 18.53846153846154, "alnum_prop": 0.7219917012448133, "repo_name": "yavalvas/yav_com", "id": "68d42677cd5415afc578dfa14d4c72467b8e4abe", "size": "241"...
""" To make use of recursive calls, this function must return two things: 1) Length of LIS ending with element arr[n-1]. We use max_ending_here for this purpose 2) Overall maximum as the LIS may end with an element before arr[n-1] max_ref is used this purpose. The value of LIS of full array of size n is stored in...
{ "content_hash": "be07bff7b360b9aaa6aaad7e9767bff4", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 67, "avg_line_length": 26.689655172413794, "alnum_prop": 0.6479328165374677, "repo_name": "churrizo/Algorithms_Example", "id": "8aebbb5df088dc9f6f56d33ef689860ba0b3658b", "...
from datetime import datetime from django.http import HttpResponse, HttpResponseBadRequest from custom.apps.wisepill.models import WisePillDeviceEvent from corehq.apps.sms.handlers.keyword import handle_structured_sms from corehq.apps.sms.models import CommConnectCase from corehq.apps.reminders.models import SurveyKeyw...
{ "content_hash": "1527d7da073e176d5fbd6ffeafc422e7", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 143, "avg_line_length": 40.875, "alnum_prop": 0.6339012669287899, "repo_name": "SEL-Columbia/commcare-hq", "id": "5d0c0dfa58962b9a803721382cc52a85067649bf", "size": "2289",...
import copy import datetime import os import pickle import time import unittest import warnings from django.test.utils import IgnoreDeprecationWarningsMixin from django.utils.deprecation import RemovedInDjango19Warning # Swallow the import-time warning to test the deprecated implementation. with warnings.catch_warni...
{ "content_hash": "6b4d4b038a6a1aa6dfc0fb9f59c5cce4", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 92, "avg_line_length": 38.32967032967033, "alnum_prop": 0.648795871559633, "repo_name": "szopu/django", "id": "4d1af62f0a787832a4bc23379fcd24a8a01b5ebc", "size": "3488", ...
import numpy as np import pandas as pd from bokeh.plotting import * from bokeh.objects import Range1d # Define some categories categories = [ 'ousia', 'poson', 'poion', 'pros ti', 'pou', 'pote', 'keisthai', 'echein', 'poiein', 'paschein', ] # Create data N = 10 data = { cat : np.random.randint(10, 100, size=N...
{ "content_hash": "65fea2296687e2f75e44d3732d8ab92b", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 89, "avg_line_length": 32.5625, "alnum_prop": 0.6602687140115163, "repo_name": "sahat/bokeh", "id": "057c4a78e2e3b1fe25f063d999a9aa13836ccb4f", "size": "2085", "binary": ...
import testtools from testtools import matchers from tempest.api.volume import base from tempest.common.utils import data_utils from tempest.common import waiters from tempest import config from tempest import test CONF = config.CONF class VolumesV2GetTest(base.BaseVolumeTest): @classmethod def setup_clien...
{ "content_hash": "52e4e2cfe80ca0ee64606d0142edd12e", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 78, "avg_line_length": 44.381294964028775, "alnum_prop": 0.6156589398605933, "repo_name": "HybridF5/tempest_debug", "id": "5d83bb01a8380bb29f6bd4f8ee8a4c90dd17900f", "size...
from dataclasses import dataclass from simple_parsing import ArgumentParser, choice from simple_parsing.helpers import Serializable # import tensorflow as tf class GAN: @dataclass class HyperParameters(Serializable): """Hyperparameters of the Generator and Discriminator networks.""" learnin...
{ "content_hash": "dcd93909164ecbc4968e79058c8348f3", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 154, "avg_line_length": 30.672131147540984, "alnum_prop": 0.6825227151256013, "repo_name": "lebrice/SimpleParsing", "id": "9dca0fa191165422ad562fb2bfa37f690cde6aaa", "size"...
import logging from dbtracker.cli import Cli import argparse def main(argv=None): parser = argparse.ArgumentParser( description="Queries MySQL and PostgreSQL for stats") parser.add_argument( "-S", "--save", action="store_true", help="generate and save database stats") parse...
{ "content_hash": "a519042229d35f724d079616ca3cb356", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 117, "avg_line_length": 31.155555555555555, "alnum_prop": 0.5977175463623395, "repo_name": "PSU-OIT-ARC/dbtracker", "id": "ffd3783d4e01d384aaf349259e989af3fe4dbf2f", "size"...
import argparse import shutil import icqsol_utils # Parse Command Line. parser = argparse.ArgumentParser() parser.add_argument('--input', dest='input', help='Shape dataset selected from history') parser.add_argument('--input_file_format_and_type', dest='input_file_format_and_type', help='Input file format and type') ...
{ "content_hash": "0593382a320984c16360357a25f2828a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 126, "avg_line_length": 52.86046511627907, "alnum_prop": 0.7149142102947647, "repo_name": "pletzer/galaxy-csg", "id": "5fc759df960330bd7cdd974985e143765937e328", "size": "2...
from wtforms import validators from werkzeug.datastructures import FileStorage import wtforms def validate_required_iff(**kwargs): """ Used as a validator within a wtforms.Form This implements a conditional DataRequired Each of the kwargs is a condition that must be met in the form Otherwise, no v...
{ "content_hash": "26bf9edf812485e627e904fb4a4b4469", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 156, "avg_line_length": 36.35602094240838, "alnum_prop": 0.6038306451612904, "repo_name": "semisight/DIGITS", "id": "4660cd0218a42ad136b60922147f226a94f5b9b7", "size": "70...
import os from flask import Flask app = Flask(__name__) with app.app_context(): app.config.from_object(app.name + '.config.DefaultConfig') if 'APP_CONFIG' in os.environ: app.config.from_envvar('APP_CONFIG') from .views import app_bp from .models import * app.register_blueprint(app_bp, url...
{ "content_hash": "c67a12b23fd7abec5b2ae0193593235b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 82, "avg_line_length": 29.071428571428573, "alnum_prop": 0.6683046683046683, "repo_name": "0xquad/flask-app-template", "id": "1607cde4444700375d53227152603985562c9a20", "si...
import mock import unittest from vnc_api.vnc_api import * from svc_monitor.virtual_machine_manager import VirtualMachineManager from svc_monitor.config_db import * import test_common_utils as test_utils class VirtualMachineManagerTest(unittest.TestCase): def setUp(self): VirtualMachineSM._cassandra = mock....
{ "content_hash": "c5496a90d1e6d866e4f98b62401cf19c", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 104, "avg_line_length": 48.58267716535433, "alnum_prop": 0.63354943273906, "repo_name": "sajuptpm/contrail-controller", "id": "861cd0f638433f1fbc7ed04a173aa73b1be78cd9", "...
from __future__ import print_function import sys # Just the print statement... def msg(s): print(s) def dashes(): msg(40*'-') def msgt(s): dashes(); msg(s); dashes() def msgx(s): msgt(s); sys.exit(0)
{ "content_hash": "4bd9d4dc880549e16456a632b7193dce", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 39, "avg_line_length": 22.444444444444443, "alnum_prop": 0.6485148514851485, "repo_name": "jperelli/redmine2github", "id": "f93a83cf14909ec22afc86db7eaa9b8f79d58f79", "size"...
from jinja2 import nodes import pytest from jinja2schema import InvalidExpression from jinja2schema.config import Config from jinja2schema.core import parse from jinja2schema.visitors.expr import (Context, visit_getitem, visit_cond_expr, visit_test, visit_getattr, visit_compare,...
{ "content_hash": "3c57179c473c87f7fdfe3f8d958e287c", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 92, "avg_line_length": 32.30416666666667, "alnum_prop": 0.5775828711466529, "repo_name": "aromanovich/jinja2schema", "id": "204fa68fe161ad83504a079c9cc7a91b40db2b4f", "siz...
import logging from nefertari.utils import snake2camel, maybe_dotted log = logging.getLogger(__name__) # All actions names(view method names) supported by nefertari ACTIONS = [ 'index', # Collection GET 'create', # Collection POST 'update_many', # Collection PATCH/PU...
{ "content_hash": "f69bd92727d0e77d1954274279bfe1f6", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 79, "avg_line_length": 33.709511568123396, "alnum_prop": 0.5777472736978571, "repo_name": "postatum/nefertari", "id": "93c8d6be774db62e072b29e0794decdd5dc1c05b", "size": "...
import os from subprocess import Popen def popen_bloom_script(cmd, **kwargs): this_location = os.path.abspath(os.path.dirname(__file__)) bin_location = os.path.join(this_location, '..', 'bin') cmd = "%s%s%s" % (bin_location, os.path.sep, cmd) proc = Popen(cmd, **kwargs) return proc
{ "content_hash": "ead8c2be07bf7c045c5bfa2060fd8ff9", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 62, "avg_line_length": 30.5, "alnum_prop": 0.6426229508196721, "repo_name": "nayomal/bloom", "id": "686ebf39476c1bb56568465098c05f7a25b93ab9", "size": "305", "binary": fa...
import os import subprocess import sqlite3 import pytest from django.conf import settings from django.db import connection from django.db import transaction from .compat import force_text from .app.models import Item DB_NAME = settings.DATABASES['default']['NAME'] if DB_NAME == ':memory:': TEST_DB_NAME = DB_NA...
{ "content_hash": "0b8581e42fabb13d40cc0b1cdce57d6f", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 80, "avg_line_length": 30.35514018691589, "alnum_prop": 0.5897475369458128, "repo_name": "felixonmars/pytest-django", "id": "f7460fce596d8c252c27b572138a0d488c8a0852", "si...
import traceback from oslo.config import cfg import taskflow.engines from taskflow.patterns import linear_flow from taskflow.utils import misc from cinder import exception from cinder import flow_utils from cinder.image import glance from cinder.openstack.common import log as logging from cinder.openstack.common impo...
{ "content_hash": "d36a45a74bbae1ac9ab22fca5580e4d9", "timestamp": "", "source": "github", "line_count": 694, "max_line_length": 79, "avg_line_length": 45.48414985590778, "alnum_prop": 0.5678261420515744, "repo_name": "NeCTAR-RC/cinder", "id": "f573ccbab6d2a9ecc9fcfa8cfe7c99fc9e0f6908", "size": "321...
from .unidecode import unidecode
{ "content_hash": "53a27871c530d8b6cd141bad0745a4cf", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 32, "avg_line_length": 33, "alnum_prop": 0.8484848484848485, "repo_name": "redvasily/isounidecode", "id": "6607ba61bdb069cc45818888d44b50d0bb4542d8", "size": "33", "binary...
"""Module for tests of the resources application."""
{ "content_hash": "60ea5b01f936a5e289a5e9bd869455ec", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 52, "avg_line_length": 53, "alnum_prop": 0.7358490566037735, "repo_name": "uccser/cs-unplugged", "id": "dc3501825dbe6276b977d3517f83214ff9ba5c83", "size": "53", "binary": ...
__all__ = ['floquet_modes', 'floquet_modes_t', 'floquet_modes_table', 'floquet_modes_t_lookup', 'floquet_states', 'floquet_states_t', 'floquet_wavefunction', 'floquet_wavefunction_t', 'floquet_state_decomposition', 'fsesolve', 'floquet_master_equation_rates', 'floquet_collaps...
{ "content_hash": "a8dd0eff27c6f23bd2a1314333b55216", "timestamp": "", "source": "github", "line_count": 957, "max_line_length": 79, "avg_line_length": 29.244514106583072, "alnum_prop": 0.5739807767892235, "repo_name": "zasdfgbnm/qutip", "id": "e3b1a1df93414b5e455f875571ec8657f07caf75", "size": "298...
''' Copyright 2015 Planet Labs, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...
{ "content_hash": "e2a3e0188d659f46118aecca9ae346b7", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 79, "avg_line_length": 49.068548387096776, "alnum_prop": 0.5707946421234283, "repo_name": "planetlabs/radiometric_normalization", "id": "83ae97638ec625bdc652240365688ace0ab6...
import numpy as np np.maximum_sctype("S8") np.maximum_sctype(object) np.issctype(object) np.issctype("S8") np.obj2sctype(list) np.obj2sctype(list, default=None) np.obj2sctype(list, default=np.string_) np.issubclass_(np.int32, int) np.issubclass_(np.float64, float) np.issubclass_(np.float64, (int, float)) np.issubs...
{ "content_hash": "491756e71a928083b57b6ff5c6fbe303", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 57, "avg_line_length": 20.70212765957447, "alnum_prop": 0.7194244604316546, "repo_name": "simongibbons/numpy", "id": "5af0d171ca0482bb6e1ad73b9b3e7277b635aec9", "size": "97...
from beritest_tools import BaseBERITestCase class test_raw_dli(BaseBERITestCase): def test_reg_values(self): '''Test dli instruction across all general-purpose registers''' for i in range(32): self.assertRegisterExpected(i, i, "Register load immediate failed")
{ "content_hash": "d58a1585af933ba3d5b7cec44d325d17", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 79, "avg_line_length": 42, "alnum_prop": 0.7074829931972789, "repo_name": "8l/beri", "id": "8e9c94bae00e06d098fc9275b52198c290bdf4fe", "size": "1432", "binary": false, "...
import cv2 import numpy as np #Face Recognization identifiers face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml') # Starts Video Camera # 0 stands for front camera cap = cv2.VideoCapture(0) while True: ret, img = cap.read() gray = cv...
{ "content_hash": "d514e70f8ad9916c0dc91bdde922319d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 32, "alnum_prop": 0.7002314814814815, "repo_name": "Ansonmathew/Python-Cracks", "id": "88ddc30de19aa10d6111214444b692d01a67e6dd", "size": "864", "b...
""" QUESTION: You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones. Both of you are very clever and have optimal ...
{ "content_hash": "ae531bcf810f42195de313320dd35690", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 119, "avg_line_length": 32.12903225806452, "alnum_prop": 0.7008032128514057, "repo_name": "tktrungna/leetcode", "id": "f7132ac51bb2b362f81e9375f1c545a508edbfd2", "size": "9...
""" Creating controllers based on renderer There are 2 types of rendering, stdout and urwid. This is triggered by passed a '-y' on the cli to trigger a headless (stdout) vs non-headless (urwid). Each controller will contain 2 modules, TUI (stdout) and GUI (urwid). Both TUI() and GUI() should provide at least an entr...
{ "content_hash": "10ee0652e9253b8aaf728d302b6b252c", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 79, "avg_line_length": 35.005102040816325, "alnum_prop": 0.6640431423990671, "repo_name": "conjure-up/conjure-up", "id": "1b321a6238d98ecf2b2d244f1c8527cb0fad4126", "size"...
"""Reinforcement learning models and parameters.""" import collections import functools import operator # Dependency imports import gym from tensor2tensor.layers import common_hparams from tensor2tensor.utils import registry import tensorflow as tf @registry.register_hparams def ppo_base_v1(): """Set of hyperpa...
{ "content_hash": "1c1412453af7c15bc626be0c7ec6146c", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 79, "avg_line_length": 37.374149659863946, "alnum_prop": 0.6747360757189661, "repo_name": "rsepassi/tensor2tensor", "id": "7433026b0c696596e50c51fde0ea1adf31132470", "size...
from __future__ import division import contextlib from distutils import version import functools from oslo_log import log as logging from oslo_utils import fnmatch from oslo_utils import units import six from cinder import exception from cinder.i18n import _ from cinder.volume import utils as vol_utils from cinder.vo...
{ "content_hash": "f76193a3042e01a7fe91b6eec1a6f6e3", "timestamp": "", "source": "github", "line_count": 282, "max_line_length": 78, "avg_line_length": 32.0709219858156, "alnum_prop": 0.6000663423264042, "repo_name": "j-griffith/cinder", "id": "8d22d01129f18c2bf27d210b611e9ee18d353b90", "size": "966...