text
stringlengths
1
927k
# Created By: Virgil Dupras # Created On: 2011-05-29 # Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.hardcoded.net/licens...
# This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild from pkg_resources import parse_version import kaitaistruct from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO if parse_version(kaitaistruct.__version__) < parse_version('0.9'): raise Exception("Incompati...
"""Shares relation Revision ID: 3bed7b8d8720 Revises: b86d7b60fbef Create Date: 2019-09-30 10:21:56.725664 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '3bed7b8d8720' down_revision = 'b86d7b60fbef' branch_labels = None depends_on = None def upgrade(): ...
import numpy as np from scipy.linalg import LinAlgError from scipy.signal import lfilter, lfilter_zi, hilbert from scipy.interpolate import interp1d import h5py from tqdm import tqdm from ecogdata.util import input_as_2d from ecogdata.util import nextpow2 def h5mean(array, axis, rowmask=(), start=0, stop=None): "...
import cbpro import pandas as pd from base64 import b64encode class Coinbase: def __init__(self, API_KEY, API_SECRET, API_PASS, ENV_URL="https://api-public.sandbox.pro.coinbase.com"): self.API_KEY = API_KEY self.API_SECRET = API_SECRET self.API_PASS = API_PASS self.ENV_URL = ENV_URL self.client = cbpro.Auth...
from setuptools import setup with open("README.md", "r") as fh: long_description = fh.read() setup(name="frappymongocontent", version="1.0.0", description="Store Implementation for Content in MongoDB", long_description=long_description, long_description_content_type="text/markdown", ...
# model settings model = dict( type='Recognizer3D', backbone=dict( type='ResNet3dCSN', pretrained2d=False, pretrained= # noqa: E251 '/home/notebook/data/personal/mmaction2_task1/data/ircsn_from_scratch_r152_ig65m_20200807-771c4135.pth', # noqa: E501 depth=152, w...
import pulumi import pulumi.runtime from ... import tables class ClusterRoleList(pulumi.CustomResource): """ ClusterRoleList is a collection of ClusterRoles """ def __init__(self, __name__, __opts__=None, items=None, metadata=None): if not __name__: raise TypeError('Missing resourc...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt NbrOfNodes = 35 keygnra = ' TIME: GANDRA STEP: 80.000 FRAME: 1.000' keystent = ' TIME: STENT STEP: 1.000 FRAME: 1.000' keygnrb = ' TIME: GANDRB STEP: 100.000 FRAME: 1.000' # File for gain paramete...
from conans.model import Generator from conans.paths import BUILD_INFO_QMAKE class DepsCppQmake(object): def __init__(self, cpp_info): def multiline(field): return " \\\n ".join('"%s"' % p.replace("\\", "/") for p in field) self.include_paths = multiline(cpp_info.include_paths) ...
#!/usr/bin/env python3 import unittest import os import shutil from src.data.VideoItem import VideoItem from src.data.MetaDataItem import MetaDataItem from src.executor.FaceBlurrer import FaceBlurrer from numpy.testing import assert_array_equal, assert_raises class TestAnonymizationExecutor(unittest.TestCase): TE...
from django.contrib import admin from .models import Order class TodoAdmin(admin.ModelAdmin): list_display = ('dishes', 'paid', 'completed', 'timestamp', 'user') # Register your models here. admin.site.register(Order, TodoAdmin)
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import contextlib import os import platform import re import tempfile import shutil import subprocess import sys import urllib import urlparse # Copied fro...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from time import sleep import pytest from .common import PROCESSES, PROCESSES_BY_STATE_BY_ITERATION, STATUSES, SUPERVISOR_VERSION # Mark all tests in this file as integration tests pytestmark = [pytest...
# coding=utf-8 # Copyright 2019 The Tensor2Tensor Authors. # # 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...
"""Explain proset classifier trained on wine classification data. Copyright by Nikolaus Ruf Released under the MIT license - see LICENSE file for details """ from copy import deepcopy import gzip import os import pickle import matplotlib.pyplot as plt import numpy as np import shap import proset.utility as utility ...
#!/usr/bin/env python if __name__ == '__main__': import sys import fsleyes.main as main sys.exit(main.main())
from django.shortcuts import render from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.contrib.auth import logout from dogowner.models import DogOwner from daycare.models import DayCare from dogowner.views import dog_owner_home from daycare.views import daycare_...
from __future__ import absolute_import from sentry.incidents.models import IncidentSuspectCommit from sentry.signals import release_commits_updated @release_commits_updated.connect(weak=False) def handle_release_commits_updated(removed_commit_ids, added_commit_ids, **kwargs): from sentry.incidents.tasks import c...
import glob from pathlib import Path from cffi import FFI with open(Path(__file__).resolve().parent.joinpath("ffi.h")) as f: header = f.read() ffibuilder = FFI() ffibuilder.cdef(header) ffibuilder.set_source( "tracedump._pt", None, sources=glob.glob("*.cpp"), extra_comp...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved. # # Powered by the Bokeh Development Team. # # The full license is in the file LICENSE.txt, distributed with this software. #---------------------------------------------------...
# pylint: disable=W0614,W0611,W0622 # flake8: noqa # isort:skip_file # Parsing from .parsing.csv import isotherm_from_csv from .parsing.csv import isotherm_to_csv from .parsing.bel_dat import isotherm_from_bel from .parsing.excel import isotherm_from_xl from .parsing.excel import isotherm_to_xl from .parsing.isodb imp...
import sys import json from urllib.request import urlopen # sys.path.append('../') # from api import * SERVER_URL = 'http://localhost:5000/' def test_get_servers(): url = SERVER_URL + 'servers' response = urlopen(url).read() assert response.decode("utf-8") == json.dumps([{"server": "localhost"}, {"serve...
from deeply.datasets.util import image_mask from tensorflow_datasets.core import ( Version, GeneratorBasedBuilder ) _DATASET_HOMEPAGE = "https://polyp.grand-challenge.org/CVCClinicDB/" _DATASET_KAGGLE = "achillesrasquinha/cvcclinicdb" _DATASET_DESCRIPTION = """ CVC-ClinicDB is a database of frames ext...
import datetime import json from billy.scrape.events import Event, EventScraper class VTEventScraper(EventScraper): jurisdiction = 'vt' def scrape(self, session, chambers): year_slug = session[5: ] url = 'http://legislature.vermont.gov/committee/loadAllMeetings/{}'.\ format(y...
import os from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import TimeoutException from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as ...
import pytest from dagster import ( DependencyDefinition, InputDefinition, Int, Nothing, Output, OutputDefinition, PipelineDefinition, SolidDefinition, composite_solid, execute_pipeline, lambda_solid, pipeline, solid, ) from dagster.core.definitions.decorators.hook im...
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
# -*- coding: utf-8 -*- """ gc3-query.__init__.py [9/13/2018 4:01 PM] ~~~~~~~~~~~~~~~~ <DESCR SHORT> <DESCR> """ ################################################################################ ## Standard Library Imports import sys, os ###########################################################################...
""" WSGI config for juniorPython 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/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_...
import json import inspect import requests import os import boto3 from urllib import parse ASYNC = 'async' token = None slash_handlers = [] event_handlers = [] def slash(command, conditional=lambda text: True): def fn(f): slash_handlers.append([conditional, command, f, None]) return f return f...
#!/usr/bin/python3 """ Given an array of prices [p1,p2...,pn] and a target, round each price pi to Roundi(pi) so that the rounded array [Round1(p1),Round2(p2)...,Roundn(pn)] sums to the given target. Each operation Roundi(pi) could be either Floor(pi) or Ceil(pi). Return the string "-1" if the rounded array is impossi...
class Value: def __init__(self, _foo_bar): self._foo_bar = _foo_bar @property def foo_bar(self): return self._foo_bar @staticmethod def decode(data): f_foo_bar = data["FooBar"] if not isinstance(f_foo_bar, unicode): raise Exception("not a string") return Value(f_foo_bar) def e...
from flask import Blueprint from flask_api import FlaskAPI URL_SOURCE = "http://grupozap-code-challenge.s3-website-us-east-1.amazonaws.com/sources/source-2.json" blueprint = Blueprint("eng_zap_challenge_python", __name__) def create_app(config="dev"): app = FlaskAPI(__name__) app.register_blueprint(bluepri...
import argparse import logging import numpy as np import os import sbi.utils as utils from sbi.inference.base import infer from sbi import analysis as analysis from sbi.inference import SMCABC, SNRE_A, simulate_for_sbi, prepare_for_sbi from sklearn.linear_model import LinearRegression import statsmodels.api as sm impor...
import gevent import structlog from eth_utils import is_binary_address, is_hex, to_bytes, to_checksum_address from gevent import Greenlet import raiden.blockchain.events as blockchain_events from raiden import waiting from raiden.constants import ( GENESIS_BLOCK_NUMBER, RED_EYES_PER_TOKEN_NETWORK_LIMIT, SE...
# -*- coding: utf-8 -*- r""" Integer partitions A partition `p` of a nonnegative integer `n` is a non-increasing list of positive integers (the *parts* of the partition) with total sum `n`. A partition can be depicted by a diagram made of rows of cells, where the number of cells in the `i^{th}` row starting from the ...
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 filter_stats, sort_stats from pySDC.implementations.collocation_classes.gauss_radau_right import CollGaussRadau_Right from pySDC.implementations.controller_...
from src import count_customer_states EXPECTED_RESULT = 11 def test_count_customer_countries() -> None: tested_result = count_customer_states.count_usa_customer_states() assert tested_result == EXPECTED_RESULT
# Copyright (c) 2018, Curious AI Ltd. All rights reserved. # # This work is licensed under the Creative Commons Attribution-NonCommercial # 4.0 International License. To view a copy of this license, visit # http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to # Creative Commons, PO Box 1866, Mountain View...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 0, transform = "Quantization", sigma = 0.0, exog_count = 100, ar_order = 12);
""" Classes for querying the information in a test coverage report. """ from email import message import itertools import os import os.path import re from collections import defaultdict from dcov import util from dcov.command_runner import run_command_for_code from dcov.git_path import GitPathTool from dcov.violation...
import logging from collections import defaultdict import pyvex from ....errors import AngrError, SimError from ....blade import Blade from ....annocfg import AnnotatedCFG from .... import sim_options as o from .... import BP, BP_BEFORE from ....surveyors import Slicecutor from .resolver import IndirectJumpResolver ...
#!/usr/bin/env python import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, Pose from styx_msgs.msg import TrafficLightArray, TrafficLight from styx_msgs.msg import Lane from sensor_msgs.msg import Image from cv_bridge import CvBridge from light_classification.tl_classifier import TLCla...
import compute_distance_and_align.compute_levenshtein_distance as compute_dist def align_strings(seq1, seq2): ''' Calculates minimum edit distance between str1 and str2 and saves backpointers to retrieve the allignments :param srt seq1: from this s®tring :param srt seq2: into this string :ret...
from graphgallery.sequence import FullBatchSequence from graphgallery import functional as gf from graphgallery.gallery.nodeclas import TensorFlow from graphgallery.gallery import Trainer from graphgallery.nn.models import get_model @TensorFlow.register() class DenseGCN(Trainer): """ Implementation of Den...
# Copyright (c) 2009-2019 Simon van Heeringen <simon.vanheeringen@gmail.com> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. """Parallel prediction of sequence motifs """ # Python imports import sys...
# Copyright (C) 2018-2021 The Xaya developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Basic framework for integration tests of Xaya games. """ from . import game from . import premine from . import xaya import argpar...
from typing import ( Type, ) from lahja import ( BaseEvent, BaseRequestResponseEvent, ) class NetworkIdResponse(BaseEvent): def __init__(self, network_id: int) -> None: self.network_id = network_id class NetworkIdRequest(BaseRequestResponseEvent[NetworkIdResponse]): @staticmethod ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-06-15 22:45 from __future__ import unicode_literals from django.db import migrations from delibere.models import Settore # this migration rebuilds the tree object # into the mptt representation, after migrating # from a flat table def rebuild_objects(apps,...
from Utilities import MENU, resources from art import logo print(logo) shop_open_and_ingredients_available = True pay = 0 Water = resources["water"] Milk = resources["milk"] Coffee = resources["coffee"] espresso_water = MENU["espresso"]["ingredients"]["water"] espresso_coffee = MENU["espresso"]["ingredients"]["coffe...
from typing import Union import torch from torch import nn from ..composition import AdapterCompositionBlock, parse_composition from ..model_mixin import InvertibleAdaptersMixin, ModelAdaptersMixin from .bert import BertEncoderAdaptersMixin, BertModelHeadsMixin, BertOutputAdaptersMixin, BertSelfOutputAdaptersMixin ...
import numpy as np import pytest import pandas as pd import pandas._testing as tm from pandas.arrays import BooleanArray from pandas.core.arrays.boolean import coerce_to_array @pytest.fixture def data(): return pd.array( [True, False] * 4 + [np.nan] + [True, False] * 44 + [np.nan] + [True, False], ...
import copy import json import os from pathlib import Path import pickle import shutil import time import re import fire import numpy as np import torch from google.protobuf import text_format import second.data.kitti_common as kitti import torchplus from second.builder import target_assigner_builder, voxel_builder f...
import pickle import numpy as np import pyriemann import sklearn import scipy import matplotlib as mpl mpl.use('Qt5Agg') # for using pyplot (pip install pyqt5) import matplotlib.pyplot as plt from scipy import signal from scipy.signal import butter, filtfilt, sosfiltfilt # Pyriemann with OV Python scripting plugin ---...
# Colleen Josephson, 2013 # This file attempts to implement the SampleRate bit rate selection algorithm # as outlined in the JBicket MS Thesis. from __future__ import division from random import choice from rates import ieee80211_to_idx import rates npkts = 0 #number of packets sent over link nsuccess = 0 #number ...
import os, glob, json, codecs F_SEARCH = sorted(glob.glob("search_data/*")) def load_word_file(f): with codecs.open(f,'r','utf-8') as FIN: js = json.loads(FIN.read()) return js for f in F_SEARCH: js = load_word_file(f) try: js["items"] = [item["full_name"] for item in js["items"]] ...
# pylint: disable-msg=W0613,W0612,W0212,W0511,R0912,C0322,W0704 # W0511 = XXX (my own todo's) """ cli.py ====== Desc: Command-line tool for listing Python packages installed by setuptools, package metadata, package dependencies, and querying The Cheese Shop (PyPI) for Python package release information s...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
x = "awesome" print("Python is " + x) # Author: Bryan G
import json from django.http import HttpResponse, HttpResponseRedirect from django.views.generic.base import View from django.conf import settings from django.db.models import get_model from haystack.query import SearchQuerySet from haystack import views from purl import URL Product = get_model('catalogue', 'Product'...
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
import simplejson as json from tornado.gen import coroutine from tornado.web import RequestHandler from tornado_cors import CorsMixin from utility import utility """ @api {get} /repos data related to repos @apiName data related to repos @apiGroup all @apiParam org organization name @apiPermission logged-in @apiParam...
import re from urllib.parse import urlsplit, urlunsplit from django.http.request import QueryDict from django.urls import reverse from rest_framework import exceptions, serializers import olympia.core.logger from olympia import activity, amo from olympia.accounts.serializers import ( BaseUserSerializer, User...
import argparse import base64 from datetime import datetime import os import shutil import numpy as np import socketio import eventlet import eventlet.wsgi from PIL import Image from flask import Flask from io import BytesIO from keras.models import load_model import h5py from keras import __version__ as keras_versio...
import os, tempfile, unittest, shutil, subprocess, datetime, time from s3ts.filestore import LocalFileStore from s3ts.s3filestore import S3FileStore from s3ts.config import TreeStoreConfig, readInstallProperties, S3TS_PROPERTIES from s3ts.treestore import TreeStore from s3ts.utils import datetimeFromIso from s3ts.pack...
import sys import selectors import json import io import struct request_search = { "morpheus": "Follow the white rabbit. \U0001f430", "ring": "In the caves beneath the Misty Mountains. \U0001f48d", "\U0001f436": "\U0001f43e Playing ball! \U0001f3d0", } class Message: def __init__(self, selector, sock...
""" Entry point for evaluating/rendering a trained policy. """ import argparse import json import os import numpy as np import time import datetime from rltime.general.config import load_config from rltime.general.utils import deep_dictionary_update from rltime.general.type_registry import get_registered_type from rl...
# -*- coding: utf-8 -*- """ Cell Card main module """ __author__ = 'Kanru Xie' import globalvar as glv from input_file_creator.write_cell_card import (objective_cell, air_cell, baseplate_cell, jaws_cell, mlc_cell) def cell_card(): c_card = '' mlc_state = glv.get_value('mlc state') if mlc_state == 'no mlc...
# -*- coding:utf-8 -*- from __future__ import division import numpy as np import os import cPickle as Pickle import pynlpir from math import log from numpy import linalg as LA iter_r = 0.685 iter_a = 0.9 tmax = 1 def F(rhoM, proDict): # 目标函数 # print rhoM res = 0 for pm in proDict: print proDict[pm] P...
from . import abstracthook from . import commandinput from . import provider from . import utils from .phfsystem import PHFSystem __all__ = ["abstracthook", "commandinput", "provider", "utils", "PHFSystem"]
print(bytearray(b'Hi!'))
import abc import pickle import time from collections import OrderedDict from copy import deepcopy import gtimer as gt import numpy as np from rlkit.core import logger, eval_util from rlkit.data_management.env_replay_buffer import EnvReplayBuffer from rlkit.data_management.path_builder import PathBuilder from rlkit.p...
try: __import__('pkg_resources').declare_namespace(__name__) except ImportError: from pkgutil import extend_path __path__ = extend_path(__path__, __name__) # Ignore all exceptions so that this doesn't cause package installation # to fail if pkg_resources can't find neurokernel: try: from version import...
from .clustering import * from .decomposition import *
"""Token validation utilities""" from mytoyota.const import TOKEN_LENGTH from mytoyota.exceptions import ToyotaInvalidToken def is_valid_token(token: str) -> bool: """Checks if token is the correct length""" if token and len(token) == TOKEN_LENGTH and token.endswith("..*"): return True raise Toyo...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ Simplest example of how to use the prefix_stack_trace decorator. """ from shrike.compliant_logging.exceptions import prefix_stack_trace # Output will be: # SystemLog: Traceback (most recent call last): # SystemLog: File ".\hello-world.py...
from __future__ import print_function, unicode_literals, absolute_import, division import logging logger = logging.getLogger(__name__) import os import numpy as np from gputools import OCLArray, OCLProgram, get_device from gputools.core.ocltypes import assert_bufs_type from gputools.utils.tile_iterator import tile_i...
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" import re from setuptools import find_packages, setup # Utilities with open("README.rst") as readme_file: readme = readme_file.read() with open("NEWS.rst") as history_file: history = history_file.read() history = history.replace("\n-----...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() with open(os.path.join('cdoslom', '__init__.py')) as ver_file: for ...
# coding: utf-8 import json import datetime import hashlib import webapp2 from google.appengine.api import users, memcache from google.appengine.ext import ndb import sil_model import split_pgn CHUNK_SIZE = 10 """ Make sample opening PGN parse_stm verkar inte klara kommentarer (med åäö?) --- LATER --- Memorize gam...
""" Detect the conventional style. guidelines: angular: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit atom: https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages ember: https://github.com/emberjs/ember.js/blob/master/CONTRIBUTING.md#pull-requests esli...
import FWCore.ParameterSet.Config as cms from CondCore.DBCommon.CondDBCommon_cfi import * PoolDBESSourcebtagMuJetsWp0612 = cms.ESSource("PoolDBESSource", CondDBCommon, toGet = cms.VPSet( # # working points # cms.PSet( record = cms.string(...
""" :codeauthor: Pedro Algarvio (pedro@algarvio.me) ==================================== Custom Salt TestCase Implementations ==================================== Custom reusable :class:`TestCase<python2:unittest.TestCase>` implementations. """ import errno import io import json import loggi...
import os import logging import asyncio import sqlite3 import platform from binascii import hexlify from collections import defaultdict from dataclasses import dataclass from contextvars import ContextVar from typing import Tuple, List, Union, Callable, Any, Awaitable, Iterable, Dict, Optional from datetime import date...
# MGEAR is under the terms of the MIT License # Copyright (c) 2016 Jeremie Passerin, Miquel Campos """Guide Foot banking 01 module""" from functools import partial import pymel.core as pm from mgear.shifter.component import guide from mgear.core import transform, pyqt from mgear.vendor.Qt import QtWidgets, QtCore f...
import math import torch from torch import nn as nn from torch.distributions import Normal from robolearn.torch.core import PyTorchModule from robolearn.torch.utils.pytorch_util import np_ify from torch.nn.modules.normalization import LayerNorm import robolearn.torch.utils.pytorch_util as ptu from robolearn.models.poli...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
from fastapi import FastAPI, Path from typing import Optional from pydantic import BaseModel app = FastAPI() class Item(BaseModel): name: str price: float brand: Optional[str] = None class UpdateItem(BaseModel): name: Optional[str] = None price: Optional[float] = None brand: Optional[str] = N...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool limiting together/eviction with the wallet.""" from test_framework.test_framework import ...
from django.contrib.auth.models import User from nose.tools import eq_ from kitsune.sumo.tests import TestCase from kitsune.users.utils import suggest_username class UtilsTestCase(TestCase): def test_suggest_username(self): eq_("someuser", suggest_username("someuser@test.com")) User.objects.crea...
''' coded_distributed_computing This module contains functions related to a study of the coded distributed computing model. ''' import numpy as np def encode_matrix(A: np.matrix, G: np.matrix) -> np.matrix: ''' encode_matrix Parameters: --- A: np.matrix, input matrix to code. G: np.matrix, generat...
#!/usr/bin/env python3 # Copyright (c) 2014-2017 Wladimir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the dir...
# -*- coding: utf-8 -*- """The app module, containing the app factory function.""" from flask import Flask, render_template import commands, public, user, plots, admin from .assets import assets from .extensions import bcrypt, cache, csrf_protect, db, debug_toolbar, login_manager, migrate, api, flask_admin from .setti...
from setuptools import setup, convert_path main_ns = {} ver_path = convert_path('able/version.py') with open(ver_path) as ver_file: exec(ver_file.read(), main_ns) setup( name='able', version=main_ns['__version__'], packages=['able', 'able.android'], description='Bluetooth Low Energy for Android',...
# -*- coding: utf-8 -*- from django.db import models from django.core.validators import MinValueValidator from decimal import Decimal from django.core.urlresolvers import reverse_lazy from django.template.defaultfilters import date import locale locale.setlocale(locale.LC_ALL, '') STATUS_CONTA_SAIDA_ESCOLHAS = ( ...
""" Tests for file.rename state function """ # nox -e pytest-zeromq-3.8(coverage=False) -- -vvv --run-slow --run-destructive tests\pytests\functional\states\file\test_rename.py import pytest import salt.utils.path pytestmark = [ pytest.mark.windows_whitelisted, ] @pytest.fixture(scope="module") def file(states)...
from django.apps import AppConfig class CustomisingAdminConfig(AppConfig): name = 'customising_admin'
###################################################################### # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # SPDX-License-Identifier: MIT-0 # ###################################################################### import json import base64 def utf_...