text
stringlengths
2
999k
# coding: utf-8 """ Module defining a FileStore that enables accessing files in a local directory using typical maggma access patterns. """ import hashlib import warnings from pathlib import Path from datetime import datetime, timezone from typing import Dict, List, Optional, Union, Iterator, Callable from pymongo i...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from onmt.utils.logging import init_logger from onmt.utils.misc import split_corpus from onmt.translate.translator import build_translator import onmt.opts as opts from onmt.utils.parse import ArgumentParser def translate(opt): ...
import numpy as np import cv2 calibration_state = 0 debug_state = 1 running_state = 2 state = calibration_state calibration_frame_max = 100 calibration_frame_current = 0 Hmin, Hmax, Hmean, Hstdv = 0, 0, 0, 0 Smin, Smax, Smean, Sstdv = 0, 0, 0, 0 lower_bound, upper_bound = 0, 0 beta_1 = 2.5 beta_2 = 2....
import omg, sys if (len(sys.argv) < 3): print "\n Omgifol script: merge WADs\n" print " Usage:" print " merge.py input1.wad input2.wad ... [-o output.wad]\n" print " Default output is merged.wad" else: w = omg.WAD() for a in sys.argv[1:]: if a == "-o": ...
# Copyright 2019-2021 Canaan 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 writ...
import torch import torch.nn as nn import torch.nn.functional as F from .BasePIFuNet import BasePIFuNet from .SurfaceClassifier import SurfaceClassifier from .DepthNormalizer import DepthNormalizer from .HGFilters import * from ..net_util import init_net class HGPIFuNet(BasePIFuNet): ''' HG PIFu network uses ...
# There is a party at SoftUni. Many guests are invited, and there are two types of them: Regular and VIP. When a guest comes, check if they exist in any of the two reservation lists. # On the first line, you will receive the number of guests – N. On the following N lines, you will be receiving their reservation codes. ...
import os from typing import Union import click from plantumlcli import LocalPlantuml from .base import _check_plantuml, _click_exception_with_exit_code def _additional_info_for_local(plantuml: LocalPlantuml, duration: float): click.echo('Java executable : {path}'.format(path=os.path.abspath(plantuml.java))) ...
import json import shutil from sepal_ui import sepalwidgets as sw import ipyvuetify as v from component.message import cm from component import parameter as cp from component import widget as cw from component import scripts as cs from .gwb_tile import GwbTile class AccTile(GwbTile): def __init__(self, io): ...
import asyncio import io import userbot.plugins.sql_helper.pmpermit_sql as pmpermit_sql from telethon.tl.functions.users import GetFullUserRequest from telethon import events, errors, functions, types from userbot import ALIVE_NAME, LESS_SPAMMY from userbot.utils import admin_cmd PM_WARNS = {} PREV_REPLY_MESSAGE = {} ...
from __future__ import absolute_import from __future__ import print_function import sys import os # the next line can be removed after installation sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname( os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))) from veriloggen import * import ve...
from unittest import TestCase from models.product import Product from models.sell_order import SellOrder from models.user import User class TestSellOrder(TestCase): def test___set_profitability_great(self): client = User('Lucas') product = Product('Product 1', 100.0, 0) sell_order = SellO...
import logging import pytest from pcdsdevices.ref import ReflaserL2SI logger = logging.getLogger(__name__) @pytest.mark.timeout(5) def test_ref_disconnected(): logger.debug('test_ref_disconnected') ReflaserL2SI('TST:WFS', name='tst')
from django.db import models from django.utils import timezone import datetime import uuid from cpovc_registry.models import (RegPerson, RegOrgUnit, AppUser) from cpovc_main.models import (SchoolList, SetupLocation) from cpovc_ovc.models import (OVCHouseHold, OVCFacility) # Create your models here. class OVCBursary(m...
# -*- coding: utf-8 -*- import os import tempfile from collections import namedtuple import mock import py import pytest import yaml from django.test import TestCase from django.test.utils import override_settings from django_dynamic_fixture import get from mock import patch from readthedocs.builds.models import Vers...
import http.server import socketserver from settings import PORT, TITLE, AUTHOR, DESCRIPTION from logic import get_post_titles from utils import date_to_str posts = [f'<p><a href="">{date_to_str(e["date"])} - {e["title"]}</a></p>' for e in get_post_titles()] main_template = f""" <!doctype html> <html lang="en"> <h...
class Solution: def minSpeedOnTime(self, dist: List[int], hour: float) -> int: ans = -1 l = 1 r = int(1e7) def time(speed: int) -> float: sum = 0 for i in range(len(dist) - 1): sum += ceil(dist[i] / speed) return sum + dist[-1] / speed while l <= r: m = (l + r) //...
# Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ Code repository package is used as a repository of C++/Python classes/functions. Those classes/functions solve problems, th...
from django.contrib import admin from django.utils.timesince import timesince from django.urls import include, path class CallAdmin(admin.ModelAdmin): list_display = ['id','app','name','stdout','started_at','finished_at','duration','timesince'] list_display_links =[] list_filter = ['name',] search_fiel...
# from __future__ import absolute_import # This will make sure the app is always imported when # Django starts so that shared_task will use this app. # from .celery import app as celery_app
"""Test :py:mod:`lmp.infer._base` entry."""
import os import json import pytest import peeringdb_server.models as models import peeringdb_server.views as pdbviews from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.test import TestCase, Client, RequestFactory from django.conf import settings import peeringdb_s...
from argparse import ArgumentParser from turtle import forward from typing import List import numpy as np import pytorch_lightning as pl import torch import torch.nn as nn import torch.nn.functional as F from pytorch_lightning.loggers import TensorBoardLogger from torchmetrics import RetrievalHitRate from lit_data im...
from .backbone import build_backbone as build_language_backbone from .build import build_tokenizer from .hfpt_tokenizer import HFPTTokenizer from .simple_tokenizer import SimpleTokenizer from .clip_model import CLIPTransformer
""" Π‘ΠΎΠ·Π΄Π°Ρ‚ΡŒ список состоящий ΠΈΠ· ΠΎΡ‚Π΄Π΅Π»ΡŒΠ½Ρ‹Ρ… Π΅Π΄ΠΈΠ½ΠΈΡ‡Π½Ρ‹Ρ… символов, ΠΏΡ€Π΅ΠΎΠ±Ρ€Π°Π·ΠΎΠ²Π°Ρ‚ΡŒ список Π² строку, ΠΈΠ½Π²Π΅Ρ€Ρ‚ΠΈΡ€ΠΎΠ²Π°Ρ‚ΡŒ строку ΠΈ вывСсти Π½Π° ΠΏΠ΅Ρ‡Π°Ρ‚ΡŒ. """ my_list = ["m", "y", "_", "l", "i", "s", "t"] my_str = "".join(my_list) print(my_str[::-1])
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-unsafe import hashlib import json import logging import os import shutil import site import sys from logging import Logger from typing impor...
#! /usr/bin/env python # about 1.8 million documents (3x training examples) # # 11502.9 1796001 3130318 0.364573 import os import random import struct import string import sys import time import DocGenerator random.seed(90210) sys.stdout = os.fdopen(sys.stdout.fileno(), "w", 0) sys.stderr = os.fdopen(sys.stderr.fi...
# Copyright (C) 2021-2022 Modin authors # # SPDX-License-Identifier: Apache-2.0 """High-level API.""" from .api import ( init, shutdown, remote, put, get, wait, is_object_ref, get_ip, num_cpus, ) from ._version import get_versions __all__ = [ "init", "shutdown", "remot...
import pytest from unittest import TestCase from unittest.mock import patch from web_crawler.utils.singleton import Singleton from web_crawler.utils.web_crawler_logger import WebCrawlerLogger @pytest.mark.unit_tests @patch('web_crawler.utils.web_crawler_logger.logging') class TestWebCrawlerLogger(TestCase): de...
import argparse import ast import traceback from typing import List from typing import NamedTuple from typing import Optional from typing import Sequence DEBUG_STATEMENTS = { 'ipdb', 'pdb', 'pdbr', 'pudb', 'pydevd_pycharm', 'q', 'rdb', 'rpdb', 'wdb', } class Debug(NamedTuple): ...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys from myanmar import converter def test_uni2zgy_conversion(): try: path = os.path.join( os.path.dirname(__file__), 'data', 'uni2zgy-conversion.txt' ) fil = open(path, 'r', encoding='utf-8') except Exceptio...
import json def lambda_handler(event, context): return { 'statusCode': 200, 'body': json.dumps('Hello from Lambda!') }
"""Zookeeper Partitioner Implementation :Maintainer: None :Status: Unknown :class:`SetPartitioner` implements a partitioning scheme using Zookeeper for dividing up resources amongst members of a party. This is useful when there is a set of resources that should only be accessed by a single process at a time that mul...
from taskmanager import petisco_setup from petisco import Petisco petisco_setup() app = Petisco.get_instance().get_app()
import logging import math import torch from torch.optim import Optimizer from torch.optim.lr_scheduler import _LRScheduler class WarmupLinearScheduleNonZero(_LRScheduler): """ Linear warmup and then linear decay. Linearly increases learning rate from 0 to max_lr over `warmup_steps` training steps. ...
# Generated by Django 2.0 on 2017-12-08 19:49 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('employees', '0005_auto_20171208_2003'), ] operations = [ migrations.AlterField( model_name='emplo...
#!/usr/bin/env python3 from datetime import datetime, timezone from reporting.category import Category from reporting.activity import Activity #{ # "_class": "org.jenkinsci.plugins.workflow.job.WorkflowRun", # "id": "1", # "url": "http://jk.domain/job/ancestor/job/grandfather/job/father/1/", # "result": ...
import os import logging from auth0.v3.management import Auth0 from auth0.v3.authentication import GetToken logger = logging.getLogger(__name__) def create_client(jupyterhub_endpoint, project_name, reuse_existing=True): for variable in {"AUTH0_DOMAIN", "AUTH0_CLIENT_ID", "AUTH0_CLIENT_SECRET"}: if varia...
# Imprt Libraries from scipy.spatial import distance as dist import numpy as np import pandas as pd import progressbar import cv2 # Necessary Paths protoFile = "openpose-master/models/pose/mpi/pose_deploy_linevec_faster_4_stages.prototxt" weightsFile = "openpose-master/models/pose_iter_160000.caffemodel" video_path =...
from abc import ABC, abstractmethod import subprocess import os from container_builder.src.exceptions import RepoException class Repo(ABC): repo_url = None release = None repo_dir = None name = None def __init__(self, repo_url, repo_dir, name): self.repo_url = repo_url self.name =...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
#!/usr/bin/env python # # Copyright 2016 Cisco Systems, 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 applicab...
from src.modules.helper.get_county_pop import get_county_pop from typing import Union def calc_county_per_capita_rate( county_name_clean: str, total_over_period: Union[int, float], _round=True, num_of_people: int = 100000, ): """ Calculates a rate per 100,000 people for a specific county Args...
from tensorflow.contrib.keras import datasets import numpy as np class MnistDataset: def __init__(self): (self.train_images, self.train_labels), (self.test_images, self.test_labels) = datasets.mnist.load_data() print('Dataset loaded') self.train_images = self.train_images/255.0 # type: n...
# Copyright 2020 IOTA Stiftung # SPDX-License-Identifier: Apache-2.0 import iota_wallet as iw import os from dotenv import load_dotenv # Load the env variables load_dotenv() # Get the stronghold password STRONGHOLD_PASSWORD = os.getenv('STRONGHOLD_PASSWORD') # This example restores a secured backup file. account_m...
# 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. # -----------------------------------------------------...
from typing import List, TypeVar, Sequence, Dict, Tuple from polyhedral_analysis.coordination_polyhedron import CoordinationPolyhedron T = TypeVar('T') """ Utility functions """ def flatten(this_list: Sequence[Sequence[T]]) -> List[T]: """Flattens a nested list. Args: (list): A list of lists. ...
from tkinter import * from tkinter import ttk from tkinter import filedialog from pytube import YouTube Folder_Name = "" #file location def openLocation(): global Folder_Name Folder_Name = filedialog.askdirectory() if(len(Folder_Name)>1): locationError.config(text = Folder_Name,fg ="green") else: ...
# # Author: Piyush Agram # Copyright 2016 # import isceobj import stdproc from stdproc.stdproc import crossmul import numpy as np from isceobj.Util.Poly2D import Poly2D import argparse import os import copy from isceobj.Sensor.TOPS import createTOPSSwathSLCProduct from .runBurstIfg import adjustValidLineSample def ...
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class UsersConfig(AppConfig): name = "super_project.users" verbose_name = _("Users") def ready(self): try: import super_project.users.signals # noqa F401 except ImportError: p...
from . import dbs from . import models
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="cnnmot", version="0.0.1", author="Romain Desarzens", author_email="rdesarz@protonmail.com", description="A multiple object tracking library", long_description=long_description, lon...
#!/usr/bin/python from numpy import * from matplotlib.pyplot import * import pickle, time from core import CPGoods, CombinedCurve, CPInitiator import numpy.random as rnd ''' The regime is set up by turning light off and on. All timescales are in minutes. ''' time_light_on = 9*3600 time_light_off = 21*3600 ''' Coun...
# Copyright (c) 2017 Pieter Wuille # # 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, distr...
# -*- coding: utf-8 -*- import struct import time from .bitcoin import Bitcoin class SerializeDataTooShort(Exception): pass class InvalidNetworkMagic(Exception): pass class InvalidCommandEncoding(Exception): pass class MessageChecksumFailure(Exception): pass class Serialize(object): @sta...
# test_moma.py # This file tests moma_dynamic.py for errors. # Author: Kristina Yancey Spencer import unittest from mock import Mock import binpacking_dynamic as bp import coolcookies import h5py import mooproblem import moma_dynamic as moma import numpy as np import solutions_dynamic as sols from random import ...
#!/usr/bin/python DOCUMENTATION = """ --- module: iosxr_sshkeys.py short_description: Copy and enable SSH keys to IOSXR device description: - This module copy the provided SSH keys and attach them to the users. - The users are expected to already exist in the running configuration. - Users not listed in this mod...
#!/usr/bin/env python3 # Copyright 2015 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 # # Unl...
# -*- coding: utf-8 -*- """User models.""" import datetime as dt from src.database import Column, Model, SurrogatePK, db, reference_col, relationship from src.extensions import bcrypt class User(SurrogatePK, Model): __tablename__ = 'user' name = Column(db.String(80), nullable=False) surname = Column(db.S...
# -*- coding: utf-8 -*- print("I'm hungry!")
_base_ = [ '../_base_/models/pspnet_r50-d8.py', '../_base_/datasets/pascal_context.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' ] model = dict( decode_head=dict(num_classes=60), auxiliary_head=dict(num_classes=60)) test_cfg = dict(mode='slide', crop_size=(480, 480), ...
""" """ import glob import os import tensorflow as tf from model import build_pix2pix FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_float( 'lambda-value', 100.0, 'weight of L1 loss for the generator') tf.app.flags.DEFINE_float( 'learning-rate', 0.0001, 'learning rate') tf.app.flags.DEFINE_string( 'logs-...
RAWDATA_DIR = '/staging/as/skchoudh/re-ribo-datasets/Mmul8/SRP062129' OUT_DIR = '/staging/as/skchoudh/re-ribo-analysis/Mmul8/SRP062129' GENOME_FASTA = '/home/cmb-06/as/skchoudh/genomes/Mmul8/fasta/Macaca_mulatta.Mmul_8.0.1.dna.toplevel.fa' CHROM_SIZES = '/home/cmb-06/as/skchoudh/genomes/Mmul8/fasta/Macaca_mulatta.Mmul...
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import os import uuid from babel.numbers import format_currency, get_currency_name from flask import _app...
#!/usr/bin/env python # Check that on startup, falcon can reload a depfile that was built in a # previous launch of the daemon. makefile = ''' { "rules": [ { "inputs": [ "source1" ], "outputs": [ "output" ], "cmd": "cat source1 > output && cat source2 >> output && echo 'output: source1 sou...
import bluetooth from picamera import PiCamera from time import sleep import datetime import RPi.GPIO as GPIO import _thread GPIO.setmode(GPIO.BOARD) GPIO.setup(36,GPIO.IN) GPIO.setup(37,GPIO.IN) serverAddress = 'B8:27:EB:C5:67:60' #Make sure Right Address port = 1 camera = PiCamera() camera.resolution = (400,400) Ima...
import unittest import os import rastervision as rv from rastervision.experiment import ExperimentLoader from tests import data_file_path class DummyExperimentSet(rv.ExperimentSet): def get_base(self): root_uri = '/some/dummy/root' img_path = '/dummy.tif' label_path = '/dummy.json' ...
""" 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 ...
#!/usr/bin/env python3 from setuptools import setup import pathlib here = pathlib.Path(__file__).parent.resolve() # Get the long description from the README file long_description = (here / 'README.md').read_text(encoding='utf-8') setup(name='nvidia-htop', version='1.0.5', description='A tool for enrichi...
import particle as p import detector as dct import particle_source as ps import cross_sections as xs import numpy as np import matplotlib.pyplot as plt import random class Simulation(object): """docstring for .""" def __init__(self, T, dt, detector, particle_source): self.T = T self.dt = dt ...
# -*- coding: utf-8 -*- # # Python MySQL Replication documentation build configuration file, created by # sphinx-quickstart on Sun Sep 30 15:04:27 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenera...
from flask_restplus import Namespace, fields class AuthDto: api = Namespace("auth", description="Authentication routes and requests") auth_login = api.model( "login_details", { "email": fields.String(required=True, description="User's email"), "password": fields.String(...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Python version: 3.6 from tqdm import tqdm import matplotlib.pyplot as plt import torch from torch.utils.data import DataLoader from utils import get_dataset from options import args_parser from update import test_inference from models import MLP, CNNMnist, CNNFashion_...
#!/usr/bin/env python # 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 "Licen...
import numpy as np import scipy.ndimage as ndi from ..segmentation import relabel_sequential from .. import measure from ..filters import rank_order def _get_high_intensity_peaks(image, mask, num_peaks): """ Return the highest intensity peak coordinates. """ # get coordinates of peaks coord = np.n...
"""Support for functionality to interact with Android TV / Fire TV devices.""" import binascii from datetime import datetime import functools import logging import os from adb_shell.auth.keygen import keygen from adb_shell.exceptions import ( InvalidChecksumError, InvalidCommandError, InvalidResponseError,...
from collections import namedtuple from json import loads from cachet import DontCacheException from cachet import sqlite_cache from requests import Session from switch import HEADERS from switch import TTL from switch.web_session import WebSession class TargetSession(WebSession, namedtuple('TargetSession', ['produ...
from extractor.exceptions import ExtractorError from extractor.formats.opentype import isOpenType, extractFontFromOpenType from extractor.formats.woff import isWOFF, extractFontFromWOFF from extractor.formats.type1 import isType1, extractFontFromType1 from extractor.formats.ttx import isTTX, extractFontFromTTX from ext...
from unittest import mock import pytest from rest_framework import serializers from django.conf import settings from dominio.exceptions import APIEmptyResultError from dominio.dao import ( GenericDAO, SingleDataObjectDAO, ) QUERIES_DIR = settings.BASE_DIR.child("dominio", "tests", "queries") class TestGene...
from modules.generator.aligner import Aligner from modules.generator.decoder import Decoder from modules.generator.encoder import Encoder
# Write results to this file OUTFILE = 'runs/src8-tgt4/par-nobro-iter00700.result.csv' # Source computers for the requests SOURCE = ['10.0.0.11', '10.0.0.12', '10.0.0.13', '10.0.0.14', '10.0.0.31', '10.0.0.32', '10.0.0.33', '10.0.0.34'] # Should Bro be enabled on the source machines? SOURCE_BRO = [False, False, Fals...
from .base import NamdObject
from __future__ import absolute_import, division, print_function import ast from ast import PyCF_ONLY_AST as _AST_FLAG from bisect import bisect_right import linecache import sys import six import inspect import textwrap import tokenize import py cpy_compile = compile class Source(object): """ an immutable obje...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from lisa.base_tools import Uname, Wget from .cat import Cat from .date import Date from .dmesg import Dmesg from .echo import Echo from .gcc import Gcc from .git import Git from .lscpu import Lscpu from .lsmod import Lsmod from .lspci import Ls...
import datetime import os from dataflows import Flow, validate, update_resource, add_metadata, load, set_type def readme(fpath='README.md'): if os.path.exists(fpath): return open(fpath).read() def format_date(row): if row.get('Date'): # Float returned by XLS file is exactly 693594 less then...
import unittest from random import choice import requests from semantic_version import Version import vmraid from vmraid.utils import get_site_url def maintain_state(f): def wrapper(*args, **kwargs): vmraid.db.rollback() r = f(*args, **kwargs) vmraid.db.commit() return r return wrapper class TestResour...
from datetime import datetime import json import os import requests from lib.airmonitor_common_libs import _send_data_to_api, logger_initialization LOGGER = logger_initialization() LOG_LEVEL = os.environ["LOG_LEVEL"] SMOGTOK_LOGIN = os.environ["SMOGTOK_LOGIN"] SMOGTOK_PASSWORD = os.environ["SMOGTOK_PASSWORD"] SMOGTO...
import matplotlib.pyplot as plt class PolCurve: def __init__(self, current_density, voltage): self.current_density = current_density self.voltage = voltage def plot_pol_curve(self, label=None, return_axes=None, ax=None): if ax is None: ax = plt.gca() ax.plot(se...
import os from django.core.management.commands.runserver import BaseRunserverCommand from datetime import datetime from google.appengine.tools.devappserver2 import shutdown class Command(BaseRunserverCommand): """ Overrides the default Django runserver command. Instead of starting the default Django de...
# ****************************************************************************** # Direitos Autorais (c) 2019-2020 Nurul GC * # * # Jovem Programador ...
""" Simple utilities for figures""" import numpy as np import matplotlib as mpl def log_me(val, err): """ Generate log and error from linear input Args: val (float): err (float): Returns: float, (float/None): Returns none if the err is negative """ ...
#!/usr/bin/env python # Copyright (c) 2012-2016 The Slemanium Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Generate valid and invalid base58 address and private key test vectors. Usage: gen_base58_test_...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Flask-Scrypt flask extension provides scrypt password hashing and random salt generation. Hashes and Salts are base64 encoded. """ from __future__ import print_function, unicode_literals import sys import base64 import hmac from os import urandom from werkzeug.security...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Implementation of ResNeXt (https://arxiv.org/pdf/1611.05431.pdf) """ import copy import math from typing import An...
# Copyright (c) 2017 Intel 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 to i...
import voluptuous as vol import esphomeyaml.config_validation as cv from esphomeyaml.components import sensor from esphomeyaml.const import CONF_ACCURACY, CONF_ADDRESS, CONF_HUMIDITY, CONF_MAKE_ID, CONF_NAME, \ CONF_TEMPERATURE, CONF_UPDATE_INTERVAL from esphomeyaml.helpers import App, Application, variable DEPEN...
BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0, 255) DARK_GREEN = (0, 128, 0) YELLOW = (255, 255, 0)
import datetime import traceback import os def log(*messages, **kwargs): ts = datetime.datetime.now(datetime.timezone.utc) ts = ts.strftime("%Y-%m-%d %H:%M:%S %z") tg = kwargs.get("tag", "STDOUT ") if len(tg) > 10: tg = tg[0:10] elif len(tg) < 10: tg += " " * (10 - len(tg)) ...
# -*- coding: utf-8 -*- # Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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.o...
import os import random from dotenv import load_dotenv from unittest.mock import AsyncMock from distribution import request_smsc, Methods load_dotenv() def _side_effect(*args, **kwargs): if args[0] == 'send': return {'id': random.randint(1, 1000), 'cnt': 1} elif args[0] == 'status': raise N...