text
stringlengths
1
927k
#!/usr/bin/python # # Copyright (c) 2018 Juniper Networks, Inc. All rights reserved. # # This file contains code to support the RMA devices feature # from builtins import object from builtins import str import sys import traceback from job_manager.job_utils import JobVncApi sys.path.append("/opt/contrail/fabric_ansi...
from cvtk.io import load_json from cvtk.transforms.mmdet import RandomCrop, Resize from mmdet.datasets import CocoDataset as _CocoDataset class CocoDataset(_CocoDataset): def load_annotations(self, ann_file): cats = load_json(ann_file)["categories"] self.CLASSES = [cat["name"] for cat in cats] ...
import pytest from flask import g, session from flaskr.db import get_db def test_register(client, app): assert client.get('/auth/register').status_code == 200 response = client.post( '/auth/register', data = {'username': 'a', 'password': 'a'} ) assert 'http://localhost/auth/login' == response.h...
"""Tests for OpenTSDB datasource""" import grafanalib.core as G from grafanalib.opentsdb import ( OpenTSDBFilter, OpenTSDBTarget, ) from grafanalib import _gen import sys if sys.version_info[0] < 3: from io import BytesIO as StringIO else: from io import StringIO def test_serialization_opentsdb_targ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2014-2020, Lars Asplund lars.anders.asplund@gmail.com # # pylint: disable=too-many-public-methods, too-...
#!/usr/bin/env python import rospy from sensor_msgs.msg import Joy from geometry_msgs.msg import Twist global vel def callback(data): vel.linear.x = data.axes[1] * 0.4 vel.angular.z = data.axes[2] * 1 if __name__ == '__main__': pub = rospy.Publisher('cmd_vel', Twist, queue_size=10) rospy.Subscriber('joy', Joy...
""" Problem 67 By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. Find the maximum total from top to bottom in triangle.txt (right click and 'Save Link/Target As...'), a 15K text...
from torch.optim.lr_scheduler import _LRScheduler from torch.optim.lr_scheduler import ReduceLROnPlateau class GradualWarmupScheduler(_LRScheduler): """ Gradually warm-up(increasing) learning rate in optimizer. Proposed in 'Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour'. Args: optimi...
import nlmod import test_001_model def test_get_recharge(): # model with sea model_ds = test_001_model.test_get_model_ds_from_cache('sea_model_grid') # add knmi recharge to the model dataset model_ds.update(nlmod.read.knmi.get_recharge(model_ds)) return model_ds def test_get_recharge_steady_...
import subprocess, os import tempfile, qiime2 from q2_pepsirf.format_types import PepsirfContingencyTSVFormat, PepsirfDemuxDiagnosticFormat, PepsirfDemuxFastqFmt, PepsirfDemuxFifFmt, PepsirfDemuxIndexFmt, PepsirfDemuxLibraryFmt, PepsirfDemuxSampleListFmt # Name: demux # Process: runs pepsirf's demux module (currently ...
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Tests for BigQuery output plugin.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import gzip import os from absl import app from future.builtins import range from future.builtins import str from futur...
""" Django settings for app project. Generated by 'django-admin startproject' using Django 2.1.7. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ import os # Bui...
''' projects app config ''' from django.apps import AppConfig class ProjectsConfig(AppConfig): ''' project apps, currently everything that is not home or resume ''' name = 'projects'
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from encoder import * from utils import * class DyRep(nn.Module): def __init__(self, node_embeddings, # n_event_types, N_nodes, A_initial=None, ...
"""engine.SCons.Options.BoolOption This file defines the option type for SCons implementing true/false values. Usage example: opts = Options() opts.Add(BoolOption('embedded', 'build for an embedded system', 0)) ... if env['embedded'] == 1: ... """ # # Copyright (c) 2001, 2002, 2003, 2004 The SCons Found...
"""Test the API's checkout process over full digital orders.""" import graphene import pytest from ....account.models import Address from ....checkout import calculations from ....checkout.error_codes import CheckoutErrorCode from ....checkout.models import Checkout from ....checkout.utils import add_variant_to_checko...
# uncompyle6 version 3.4.1 # Python bytecode 2.7 (62211) # Decompiled from: Python 2.7.16 (v2.7.16:413a49145e, Mar 2 2019, 14:32:10) # [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] # Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/SL_MkIII/mes...
from datetime import datetime from typing import Optional from sqlalchemy import TEXT, Boolean, Column, Date, Integer from sqlalchemy.orm import backref, relationship from sqlalchemy.schema import ForeignKey from app.models import ArxivQueryModel, BaseModel class PaperModel(BaseModel): """ PaperModel ""...
# Copyright (c) 2011-2020 Eric Froemling # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish,...
# -*- coding: utf-8 -*- # # 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, software ...
import numpy as np import sys import os from netCDF4 import Dataset from datetime import datetime, timedelta quick = True quick = False #theight = 3000.0 theight = 2000.0 # UTC stime = datetime( 2020, 8, 24, 7, 0 ) etime = datetime( 2020, 9, 7, 0, 0 ) # Figure x range stime_ = datetime( 2020, 8, 25, 0, 0 ) ...
''' wake_snow.py Wake with 'Hey Nala' keyword using snowboy and python2. Python3 wrapper for python2 with os module. ''' import os os.system('python snowboy.py Nala.pmdl')
#!/usr/bin/env python3 import os from subprocess import run run(["py", "tools/bobby/build.py", "Enki", "-C", "-V3.3"]) print("Running Steam") run([r"C:\Program Files (x86)\Steam\Steam.exe", "-applaunch", "2300"])
import logging from logging.handlers import RotatingFileHandler from flask import Flask, session from flask_session import Session from flask_sqlalchemy import SQLAlchemy from flask_wtf import CSRFProtect from flask_wtf.csrf import generate_csrf from redis import StrictRedis from config import config # 初始化db from in...
#!/usr/bin/env python # coding: utf-8 # In[ ]: from tkinter import * window = Tk() window.title("Remote Scren Viewer Taking SS") window.geometry('220x430') #heading k lie....................... lbl = Label(window, text="Welcome to Remote Screen Viewer", font=("Arial Bold", 50)) lbl.grid(column=3, row=7) ...
from nostr.event import Event def test_event_id(): e = Event("1q", "asd", created_at=1641819738) assert e.id == "bbe84e5f88993ad461f0ee82f746ed5f1aa023c53187185c54d95561deb2651f"
# 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 ...
# Copyright 2019,2020,2021 Sony Corporation. # # 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...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 2 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_7_2 from isi...
from setuptools import setup setup(name='iosxr_grpc', version='1.3', description='gRPC library for IOS-XR > 6.1.1', url='https://github.com/cisco-grpc-connection-libs/ios-xr-grpc-python', author='Karthik Kumaravel', authoer_email='srirudrankumaravel@gmail.com', licencse='Apache 2.0...
""" Python logger for the telnet server. """ from __future__ import unicode_literals import logging logger = logging.getLogger(__package__) __all__ = ( 'logger', )
import serial import time class TakasagoKX100L: def __init__(self, com, baudrate, timeout=0.1, target_index=1): if baudrate not in (2400, 9600, 38400): baudrate = 9600 if baudrate == 2400: self.tx_wait = 0.2 elif baudrate == 9600: self.tx_wait = 0.05 ...
# python3 # pylint: disable=g-bad-file-header # Copyright 2021 DeepMind Technologies Limited. 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...
# pip install mysql-connector-python-rf # https://stackoverflow.com/questions/10757169/location-of-my-cnf-file-on-macos import mysql.connector from mysql.connector import Error def run(): try: print('*'*50) connection = mysql.connector.connect(host='localhost', ...
import pytest from multidict import MultiDict from google.rpc.error_details_pb2 import ResourceInfo from grpclib.const import Status from grpclib.events import listen, RecvRequest, RecvMessage, SendMessage from grpclib.events import SendInitialMetadata, SendTrailingMetadata from grpclib.exceptions import GRPCError fr...
# list is using [], but tuple is using () # list can create, delete and modify values, but tuple cannot modify values that are already declared. t1 = () t2 = (1,) t3 = (1,2,3) t4 = 1,2,3 t5 = ('a', 'b', ('ab', 'cd')) print(t1); print(t2); print(t3); print(t4); print(t5); # () # (1,) # (1, 2, 3) # (1, 2, 3) # ('a', 'b...
ACS = { 'article': { 'author': [], 'title': [], 'volume': [], 'issued': [], 'volume': [], 'page': [], 'doi': [], }, 'book': { 'author': [], 'title': [], 'issued': [] }, 'inproceedings': { 'author': [], 't...
def extractWwwTealnovelCom(item): ''' Parser for 'www.tealnovel.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('Loiterous', 'Loite...
import os import socket import sys import gc import struct from threading import Thread from Rpyc.Connection import Connection from Rpyc.Stream import SocketStream, PipeStream from Rpyc.Channel import Channel from Discovery import UDP_DISCOVERY_PORT, MAX_DGRAM_SIZE, QUERY_MAGIC DEFAULT_PORT = 18812 # # utilities # c...
""" Даны длины сторон треугольника. Вычислите площадь треугольника. Формат ввода Вводятся три положительных действительных числа. """ a = float(input()) b = float(input()) c = float(input()) p = (a + b + c) / 2 s = ((p * (p - a) * (p - b) * (p - c)) ** 0.5) print(s)
import sys from xml.etree import ElementTree as ET import requests def run(solr_url, query_terms_file): successes = 0 failures = 0 tested = 0 with open(query_terms_file, 'r') as query_terms: for i, row in enumerate(query_terms): row = row.strip() if row == '': continue ...
from torch.utils.data import Dataset from jtnn.mol_tree import MolTree import numpy as np class MoleculeDataset(Dataset): def __init__(self, data_file): with open(data_file) as f: self.data = [line.strip("\r\n ").split()[0] for line in f] def __len__(self): return len(self.data) ...
from flask import render_template from app.errors import bp @bp.app_errorhandler(404) def not_found_error(error): return render_template('404.html'), 404 @bp.app_errorhandler(500) def internal_error(error): return render_template('500.html'), 500
class INestedContainer(IContainer,IDisposable): """ Provides functionality for nested containers,which logically contain zero or more other components and are owned by a parent component. """ def __enter__(self,*args): """ __enter__(self: IDisposable) -> object Provides the implementation of __enter__ for...
""" OpenAI Gym environments with predicted state vector of specified VisionToState model (data_id, model_name) as state @Author: Steffen Bleher """ from gym import spaces from gym_brt.data.config.configuration import FREQUENCY import numpy as np from gym_brt.envs.reinforcementlearning_extensions.vision_wrapping_clas...
from flask import Flask from flask_bootstrap import Bootstrap from config import config_options from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager from flask_uploads import UploadSet, configure_uploads, IMAGES from flask_mail import Mail from flask_simplemde import SimpleMDE login_manager = ...
# coding: utf-8 """ LUSID API FINBOURNE Technology # noqa: E501 The version of the OpenAPI document: 0.11.3923 Contact: info@finbourne.com Generated by: https://openapi-generator.tech """ try: from inspect import getfullargspec except ImportError: from inspect import getargspec as getf...
from typing import List, Tuple, Any import numpy as np from collections import defaultdict from e2cnn.gspaces import * from e2cnn.nn import FieldType from e2cnn.nn import GeometricTensor from ..equivariant_module import EquivariantModule import torch from torch.nn import Parameter __all__ = ["GatedNonLinearity1...
import datetime from email.headerregistry import Address from typing import Any, Dict, Iterable, List, Mapping, Optional, TypeVar, Union from unittest import mock import orjson from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError...
# -*- coding: utf-8 -*- """ clikraken.api.public.ohlc This module queries the OHLC method of Kraken's API and outputs the results in a tabular format. Licensed under the Apache License, Version 2.0. See the LICENSE file. """ import argparse from collections import OrderedDict import clikraken.global_vars as gv fr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import pyrotein as pr import givens as gv from display import plot_dmat, plot_singular, plot_left_singular, plot_coeff import multiprocessing as mp from loaddata import load_gpcrdb_xlsx import colorsimple as cs def reverse_sign(u, vh, rank, index_from...
from lamport import LamportTimestamp from vectorclock import VectorClock def exam_vector(ts): ts.sendMesg(4, 3, "m9") ts.halfSend(1, "m1") ts.halfSend(3, "m8") ts.halfSend(4, "m10") ts.halfSend(1, "m2") ts.halfRecv(2, "m8") ts.halfRecv(3, "m1") ts.sendMesg(1, 4, "m3") ts.halfSend(2,...
from pages.checks import page_templates_loading_check from django.test import TestCase from django.core.checks import Warning from django.template import TemplateSyntaxError class PageTemplatesLoadingCheckTestCase(TestCase): def test_check_detects_unexistant_template(self): unexistant = ('does_not_exists...
from datetime import datetime import unittest from emma import exceptions as ex from emma.model.account import Account from emma.model.search import Search from emma.model import SERIALIZED_DATETIME_FORMAT from emma.model.member import Member from tests.model import MockAdapter class SearchTest(unittest.TestCase): ...
# -*- coding: utf-8 -*- # Copyright 2020 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...
import subprocess import argparse import re from datetime import datetime, timedelta from time import sleep import socket import requests import scapy.all as scapy from concurrent.futures import ThreadPoolExecutor MONITOR_INTERVAL = 60 DISCOVERY_INTERVAL = 300 parser = argparse.ArgumentParser(description="Host Monito...
import logging from typing import Any, Awaitable, Callable, Dict, Optional from aiogram import BaseMiddleware from aiogram.dispatcher.event.handler import HandlerObject from aiogram.types import TelegramObject, User from aiolimiter import AsyncLimiter logger = logging.getLogger(__name__) class ThrottlingMiddleware(...
import pytest from nonebug import App from utils import load_plugin, make_fake_event, make_fake_message @pytest.mark.asyncio async def test_matcher(app: App, load_plugin): from plugins.matcher.matcher_process import ( test_got, test_handle, test_preset, test_combine, test_...
#!/usr/bin/env python # Copyright (c) 2016 The Khronos Group Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and/or associated documentation files (the # "Materials"), to deal in the Materials without restriction, including # without limitation the rights to use...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 27 10:09:57 2019 @author: xjc """ import math import numpy as np import fire import os import time import torch import torch.nn as nn import torch.nn.functional as F from torchvision import models, transforms from Dataset_folder import Dataset_f...
import logging from great_expectations.exceptions import InvalidKeyError logger = logging.getLogger(__name__) from ...core.id_dict import BatchKwargs from .renderer import Renderer class SlackRenderer(Renderer): def __init__(self): super().__init__() def render( self, validation_result=Non...
# Import complete functionality from package from .trainer import *
# Copyright (c) 2006-2009 The Trustees of Indiana University. # All rights reserved. # # Redistribution and use in source and binary forms, with or without ...
from .plugins.tarsier_checker_base import TarsierCheckerPlugin from .plugins.tarsier_input_base import TarsierInputPlugin from .plugins.tarsier_output_base import TarsierOutputPlugin class Executor: def __init__(self, input_plugin: TarsierInputPlugin, checker_plugin: TarsierCheckerPlugin, output_...
import json import os from .tf_doc_setup import TFDocSetup from .dashing import DASHING class TFManualDocSetup(TFDocSetup): """ This class is designed to create DocSet for all versions of TensorFlow 2.x automatically.""" def __init__(self, md_dir_path, html_dir_path, version=''): """ Initiali...
#!/usr/bin/env python # After sort it O(nlogn) # For every iteration, fix the first number. # Then the problem reduces to find 2 numbers whose sum is closest to a new target # Then it's same as given a 2-D array, columns rows are all sorted, check if k is inside # For example: # 1, 2, 3, 4 # 1 3 4 5 # 2 5...
#The computer will take determine the age at which you start your occupation, the age at which you quit your job, and and what your occupation might be. import random def agecalculations(Currentage, Finishschool, Thinkstartwork): return (Currentage * Finishschool) // Thinkstartwork def oldoryoung(Currentage): if int...
import subprocess import os import click import statistics import scrapy import codespeedinfo class commandoption(object): def __init__(self, n_runs, only_result, upload_result, book_url, vmprof, set): self.n_runs = n_runs self.only_result = only_result self.upload_result = upload_result...
__all__ = ['Arima_model, LSTM_Keras_predict_main, montecarlo'] from Arima_Model import arima_model from montecarlo import montecarlo_model from LSTM_Keras_predict_main import keras_calc
"""This module contains an enum with names of supported chains.""" from enum import Enum class Chains(Enum): """Blockchains supported by the Amberdata API.""" BTC = 1 BCH = 2 BSV = 3 ETH = 4 ETH_RINKEBY = 5 LTC = 6 ZEC = 7
#!/usr/bin/env python3 # # Copytright 2021 Graviti. Licensed under MIT License. # # pylint: disable=invalid-name # pylint: disable=missing-module-docstring import os from typing import Callable, Dict import numpy as np from tensorbay.dataset import Data, Dataset from tensorbay.label import InstanceMask from tensorba...
# pylint: disable=invalid-name """Helper utility to save parameter dicts.""" import tvm _save_param_dict = tvm.get_global_func("tvm.relay._save_param_dict") _load_param_dict = tvm.get_global_func("tvm.relay._load_param_dict") def save_param_dict(params): """Save parameter dictionary to binary bytes. The resu...
""" Copyright (c) 2018-2021, UChicago Argonne, LLC See LICENSE file. """ import seabreeze.spectrometers as sb from PyQt5.QtCore import QObject import numpy as np from time import sleep import _thread as thread from pypressruby.logic import make_dummy, fit_data, calculate_pressure class LogicWidgets(QObject): d...
from config._config import _vault as options from config._config import parse_env_variables, parse_json_variables
from typing import Union, List class Entry: def __init__(self, data: str) -> None: self.name = '' self.folder = '' self.username = '' fields = data.split('\t') self.name = fields[1] self.folder = fields[0] self.length = len(self.name) + len(self.folder) + ...
from model.group import Group class GroupHelper: def __init__(self, app): self.app = app def open_groups_page(self): wd = self.app.wd if not (wd.current_url.endswith("group.php") and len(wd.find_elements_by_name("new")) > 0): wd.find_element_by_link_text("groups").click()...
"""InVEST Nutrient Delivery Ratio (NDR) module.""" from __future__ import absolute_import import pickle import itertools import logging import os from osgeo import gdal from osgeo import ogr import numpy import taskgraph import pygeoprocessing import pygeoprocessing.routing from .. import validation from .. import ut...
sm.flipDialoguePlayerAsSpeaker() sm.sendNext("There's no question that I... have been erased from everyone's memories. But if it's just me, then they must have holes in their memories. They would know that at least SOMEONE was there.") sm.setPlayerAsSpeaker() if sm.sendAskAccept("If it's not just that my existence is b...
from __future__ import print_function import os import time import glob import numpy as np import matplotlib.pyplot as plt import sys sys.path.insert(0, os.path.join( os.path.dirname(os.path.realpath(__file__)), "../")) from pyAudioAnalysis import utilities from pyAudioAnalysis import audioBasicIO from pyAudioAnaly...
# Copyright 2014 Cisco Systems, Inc. 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 requir...
#!/usr/bin/env python3 # Copyright (C) 2020-2020 Michael Kuyper. All rights reserved. # # This file is subject to the terms and conditions defined in file 'LICENSE', # which is part of this source code package. from typing import Optional import aioserial import asyncio import click import functools from perso impo...
""" Perform Levenberg-Marquardt least-squares minimization, based on MINPACK-1. AUTHORS The original version of this software, called LMFIT, was written in FORTRAN as part of the MINPACK-1 package by XXX. Craig Markwardt converted the FORTRAN code to IDL. The information for ...
#!/usr/bin/env python # ROS imports import rospy from sensor_msgs.msg import Image from cv_bridge import CvBridge, CvBridgeError # Custom ROS imports from av_msgs.msg import Mode, States from prius_msgs.msg import Control # Python imports import cv2 class Visualizer: def __init__(self): # Front camera...
#!/usr/bin/env python import sys, os, json, requests, configparser, colorama from termcolor import colored from datetime import datetime colorama.init() def makeSettingsFile(): config = configparser.ConfigParser() config.add_section('settings') while True: path = input(colored("Input a base ...
PARSING_SCHEME = { 'name': 'a', 'games_played': 'td[data-stat="g"]:first', 'wins': 'td[data-stat="wins"]:first', 'losses': 'td[data-stat="losses"]:first', 'win_percentage': 'td[data-stat="win_loss_perc"]:first', 'points_for': 'td[data-stat="points"]:first', 'points_against': 'td[data-stat="p...
# Copyright 2020 BlueCat Networks (USA) Inc. and its affiliates # # 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 appli...
# Copyright (c) 2017 FlashX, LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distrib...
# 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 ...
# import json # import os # import random # # from dateutil.parser import parse # from django.core.urlresolvers import reverse # from django.contrib.auth.models import User, Permission # from django.test import TestCase, RequestFactory # from django.utils import timezone # import reversion # # from birth_registration.a...
"""Arguments Parser.""" import argparse class ArgumentsParser(object): """Arguments parser""" def __init__(self, params=[]): """Constructor""" self.params = params self.parser = argparse.ArgumentParser() for arg, msg, choices in self.params: if not choices: ...
#!/usr/bin/python3 import string, pprint, Checksum, iplib, random, platform, sys, datetime class DataHandler: def __init__(self, charset, le): self.raw_data = "" # raw data from client self.raw_headers = "" # raw headers from client self.raw_lheaders = "" # raw headers from client converte...
"""Tuya based cover and blinds.""" from zigpy.profiles import zha from zigpy.zcl.clusters.general import Basic, Groups, Identify, OnOff, Ota, Scenes, Time from zhaquirks.const import ( DEVICE_TYPE, ENDPOINTS, INPUT_CLUSTERS, MODELS_INFO, OUTPUT_CLUSTERS, PROFILE_ID, ) from zhaquirks.tuya import...
from django.test import TestCase from django.contrib.auth.models import User, Group, Permission from django.contrib.contenttypes.models import ContentType from wagtail.images.tests.utils import get_test_image_file, Image from molo.core.models import ( Main, SiteLanguageRelation, Languages, ArticlePage, Reactio...
'search stuff' import sys import os import pickle import itertools as it import numpy as np from collections import defaultdict from xbin import XformBinner from homog import hinv, hrot from concurrent.futures import ProcessPoolExecutor from .worms import Segment, Segments, Worms from .criteria import CriteriaList, Cy...
import cv2 import os import numpy as np from skimage.metrics import mean_squared_error from skimage.metrics import peak_signal_noise_ratio from skimage.metrics import structural_similarity def get_PSNR(img1, img2): # MSE = mean_squared_error(img1, img2) PSNR = peak_signal_noise_ratio(img1, img2) # print('M...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """Downloads all the ERA5 data via the Climate Data Store (CDS) API and saves it to the location as specified in config.py. First `install CDS API key`_. The data used for this analysis is not listed in the CDS download data web form. ECMWF MARS keywords are used to reque...
# -*- coding: utf-8 -*- # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. ######################################################################## class KibanaSavedSearch: # ------------------------------------------------------------------...
'''This file contains functions that help to analyze and plot data related to the convergence analysis. ''' import numpy import pickle from matplotlib import pyplot, rcParams def pickleload(pickle_file): '''Loads a pickle file and assins it to a variable. ''' with open(pickle_file, 'rb') as f: dic...
from typing import List, Tuple, Union from flask import current_app import pandas as pd import numpy as np from pandas.tseries.frequencies import to_offset from pyomo.core import ( ConcreteModel, Var, RangeSet, Param, Reals, Constraint, Objective, minimize, ) from pyomo.environ import U...
nome = input('Qual é o seu nome?') idade = input('Quantos anos você tem?') peso = input ('Quantos quilos você pesa?') print(nome, idade, peso)