text
stringlengths
3.07k
12.6k
import csv from tempfile import NamedTemporaryFile import shutil import datetime d = datetime.datetime.now() date= d.strftime("%d") month= d.strftime("%m") year = d.strftime("%Y") def sup_invoice(): medi_name = input("Enter medicine name : ") quantity = int(input("Enter quantity : ")) sup_id = input("E...
# vim: se sw=2: # MIT licensed # Copyright (c) 2013-2018 lilydjwg <<EMAIL>>, et al. import os import sys import configparser import asyncio import logging import structlog from .lib import nicelogger from .get_version import get_version from .source import session from . import slogconf from . import __version__ l...
from __future__ import division import os import genapi import numpy_api from genapi import \ TypeApi, GlobalVarApi, FunctionApi, BoolValuesApi h_template = r""" #ifdef _UMATHMODULE #ifdef NPY_ENABLE_SEPARATE_COMPILATION extern NPY_NO_EXPORT PyTypeObject PyUFunc_Type; #else NPY_NO_EXPORT PyTypeObject PyUFu...
from collections import OrderedDict import numpy as np import os from typing import List, Tuple, Dict import torch from torch.utils.data import DataLoader from torch import optim import torch.nn as nn from torch.optim.lr_scheduler import ReduceLROnPlateau from argparse import ArgumentParser import src.py.flwr as ...
from .richtext import richtext_convertor from notion2md.notion_api import get_children import concurrent.futures from .file import downloader def paragraph(information:dict) -> str: return information['text'] def heading_1(information:dict) -> str: return f"# {information['text']}" def heading_2(information:...
#when time allows, go back and neatly comment everything #you won't remember the flow or reasoning if you don't from flask import Flask, request, redirect, render_template, flash, session from app import app, db from models import Blog, User from hashutils import make_pw_hash, check_pw_hash import os @app.before_req...
from __future__ import print_function # In python 2.7 from flask import render_template, flash, redirect, url_for from flask_login import current_user from flask_wtf import FlaskForm from wtforms import StringField, DecimalField, IntegerField, SelectField, SubmitField from wtforms.validators import DataRequired, Number...
""" Module with useful time/date functions """ import datetime import dateutil.parser from .constants import OgcConstants from .config import SHConfig def get_dates_in_range(start_date, end_date): """ Get all dates within input start and end date in ISO 8601 format :param start_date: start date in ISO 8601...
from restorm.clients.base import BaseClient from restorm.clients.jsonclient import JSONClient from restorm.exceptions import RestServerException from restorm.patterns import ResourcePattern VALID_GET_STATUS_RESPONSES = ( 200, # OK 304, # NOT MODIFIED ) class RestQuerySet(object): """Rest query set.""" ...
import torch import numpy as np import datetime import uuid import json import pickle import glob from collections import defaultdict, Counter from pathlib import Path def convert_value_to_built_in_type(v): """Convert torch tensors to built in types, i.e., non zero-dimensional`tensor` is converted to `list` and...
import Currencies import Account def check_amount_validity(amount: str) -> bool: """ Static method to check whether a given amount is valid for a monetary value (i.e. cannot be negative or contain letters). :param amount: String value that will be checked for monetary validity. :return:...
from abc import abstractmethod import numpy as np from overrides import overrides from typing import List, Union, Tuple, Dict from .doc import AlignedBiText, EncodedBiText from .distance import Distance from .applicator import Applicator from .resolver import DynamicResolver @Applicator.register('aligner') class ...
from collections import namedtuple import numpy as np from numpy.random import normal from app.models.influx import insert_candles from app.ta.constructors import Point from config import BaseConfig Sample = namedtuple("Sample", ["close", "points"]) def make_sample(points: list) -> np.ndarray: assert len(point...
import json from PIL import Image, ImageDraw, ImageFont W = 1200 H = 630 # Open fonts times_120 = ImageFont.truetype('/mnt/c/Windows/Fonts/times.ttf', 120) arial_black_40 = ImageFont.truetype('/mnt/c/Windows/Fonts/ariblk.ttf', 40) arial_black_52 = ImageFont.truetype('/mnt/c/Windows/Fonts/ariblk.ttf', 52) # Open TOC ...
import argparse from kotor.tools import * from PIL import Image, ImageDraw ENCODING_DXT_1 = 2 ENCODING_DXT_5 = 4 class DX1Texel: def rgb565ToRgba32(self, color): return ((color & 0x1F) << 3) | (((color >> 5) & 0x3F) << 10) | (((color >> 11) & 0x1F) << 19) | 0xFF000000 def interpolateRgba32(self, we...
import socket import select from tools import * from queue import Queue import threading import time import sys import pickle class User(): def __init__(self, username, password, register_date): if isinstance(username, bytes): username = username.decode('utf-8') if isinstance(password, bytes): pass...
# sets PlotAtScale values for a feature class # September 2017: now invokes edit session before setting values (line 135) versionString = 'GeMS_SetPlotAtScales_Arc10.py, version of 2 September 2017' import arcpy, os.path, sys from GeMS_utilityFunctions import * # global dictionaries OPTypeDict = {} OPLCMDict = {} O...
""" Contains upgrade tasks that are executed when the application is being upgraded on the server. See :class:`onegov.core.upgrade.upgrade_task`. """ import multiprocessing from concurrent.futures import ThreadPoolExecutor from copy import copy from onegov.core.orm import as_selectable from onegov.core.orm.types impo...
import yaml from CinderMetrics import CinderMetrics from NeutronMetrics import NeutronMetrics from NovaMetrics import NovaMetrics import collectd COUNTER_METRICS = set(tuple("cpu{0}_time".format(n) for n in range(32)) + ("rx", "rx_packets", "tx", "tx_packets")) def config_callback(conf): """Receive configurati...
#https://stackoverflow.com/questions/42007434/slider-widget-for-pyqtgraph import numpy as np from vispy import app, visuals import h5py from PyQt5.QtWidgets import QApplication, QMainWindow import sys from PyQt5 import QtCore, QtGui, QtWidgets import time import numpy as np from vispy import app import vispy fro...
import numpy as np from typing import Iterator, Callable, List import inspect from qsweep import param_table from qsweep.param_table import ParamTable class BaseSweepObject: """ A sweep object is an iterable and at every iteration we produce a dictionary which is meant as input for the data saver class. ...
from django.conf import settings from cinp import client CONTRACTOR_API_VERSION = '0.9' def getContractor(): return Contractor( settings.CONTRACTOR_HOST, settings.CONTRACTOR_PROXY, settings.CONTRACTOR_USERNAME, settings.CONTRACTOR_PASSWORD ) class Contractor(): def __init__( self, host, proxy, username, passw...
import argparse import json import re from pathlib import Path import torch from gensim.corpora import Dictionary from tqdm import tqdm from data_utils import DocDataset from mlutils.exp import yaml_load from mlutils.pt.training import GSMTrainer, extend_config_reference from torch.utils.data import DataLoader from ge...
# REPLAY MEMORY import lmdb import json import numpy as np import psutil import os import time from utils import show_RAM_usage, show_image from collections import deque, OrderedDict from IPython import display print('initialized with priority experience replay memory') class SumTree: # little modified from ht...
# -*- test-case-name: twisted.cred.test.test_cred -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from __future__ import division, absolute_import import os from zope.interface import implementer, Interface, Attribute from twisted.internet import defer from twisted.python import failure,...
import pytest from collections import Counter from deepdiff import DeepDiff from modelmapper.stats import StatsCollector, FieldStats, InconsistentData @pytest.fixture(scope='function') def default_collector(): return StatsCollector() @pytest.mark.parametrize("values, expected_stats", [ # Test that boolean ...
"""Support for Mikrotik routers as device tracker.""" import logging from homeassistant.components.device_tracker import ( DOMAIN as DEVICE_TRACKER, DeviceScanner, ) from homeassistant.const import CONF_METHOD from homeassistant.util import slugify from .const import ( ARP, ATTR_DEVICE_TRACKER, CA...
""" The :mod:`websockets.framing` module implements data framing as specified in `section 5 of RFC 6455`_. It deals with a single frame at a time. Anything that depends on the sequence of frames is implemented in :mod:`websockets.protocol`. .. _section 5 of RFC 6455: http://tools.ietf.org/html/rfc6455#section-5 """ ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
# 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 # distributed under th...
import os import numpy as np import pandas as pd from pyuplift.utils import download_file, retrieve_from_gz def download_criteo_uplift_prediction( data_home=None, url='https://s3.us-east-2.amazonaws.com/criteo-uplift-dataset/criteo-uplift.csv.gz' ): """Downloading the Criteo Uplift Prediction dataset. ...
# Copyright 2020, <NAME>, mailto:<EMAIL> # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
import numpy as np import scipy as scy import scipy.optimize as scyopt from sympy import gamma, Float from numba import jit,njit,prange,vectorize,float64 import pyFCI ################################################################################ @njit(parallel=True,fastmath=True) def center_and_normalize(dataset):...
use_cassandra=True use_kafka=True use_print=True #TODO: may have to replace those directives by ___debug___ or something more optimized if use_cassandra: from cassandra.cluster import Cluster import datetime import getopt if use_kafka: from kafka import KafkaProducer import math import numpy import os import p...
# encoding=utf8 # pylint: disable=mixed-indentation, line-too-long, singleton-comparison, multiple-statements, attribute-defined-outside-init, no-self-use, logging-not-lazy, unused-variable, arguments-differ, old-style-class import logging from numpy import vectorize, argmin, exp from NiaPy.algorithms.algorithm import ...
# -*- coding: utf-8 -*- from datetime import timedelta from iso8601 import parse_date from openprocurement.api.utils import ( get_now, raise_operation_error, update_logging_context, ) from openprocurement.api.validation import validate_data from openprocurement.contracting.esco.models import Milestone from ...
#snakes and ladders import random def create_board(players): board = [] # a list (dynamic array) for i in range(100): #0-99 element = [i+1, [' ']*players , ' '] # [number, pegs[], sym] board.append(element) return board def display_board(board): print() i, x, flag = 1, 99, 0 w...
import os import numpy as np from PIL import Image __all__ = ['list_images', 'ColorMode', 'color_convert', 'image_to_array', 'array_to_image'] def list_images(directory, file_format=('jpg', 'jpeg', 'bmp', 'png', 'ppm', 'tif', 'tiff')): """Lists all pictures in a directory, including all subdirectories. ...
# -*- coding: utf-8 -*- """Yo A-B copy test operations package.""" import sys import re from flask import current_app from mongoengine import MultipleObjectsReturned, DoesNotExist from mongoengine.errors import ValidationError from .ab_test import get_enrolled_experiments from .core import cache from .errors import...
""" Tests if the type-cast works. """ import pytest from hisock.utils import _type_cast, InvalidTypeCast, ClientInfo, SendableTypes from typing import Any class Error: """Sentinel class for expecting to raise an error""" tests = { "bytes": [ {"original": "hello", "expected": b"hello"}, {"o...
import os import click # from labfunctions.io.fileserver import FileFileserver import httpx from rich.console import Console from rich.table import Table from labfunctions import client from labfunctions.client import init_script from labfunctions.conf import load_client from labfunctions.utils import mkdir_p conso...
#!/usr/bin/env python """ Setup helpers for PyGraphviz. """ # Copyright (C) 2006-2015 by # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME>, http://www.cs.brown.edu/~er/ # Distributed with BSD license. # All rights reserved, see LICENSE for details. import subprocess as S import sys import os def ...
# pr4_5_1 # LPC <-> LSP from Universal import * from audiolazy.lazy_lpc import lpc from LPC import LPC from scipy.signal import deconvolve, convolve import cmath import math def ar2lsp(a): """ Convert LPC ai to LSP :param a: LPC(order = p, lpc size = p + 1) :return lsf: LSP angle frequency """ a = np.array(a) ...
#!/usr/bin/env python # # 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.0OA # # Authors: # - <NAME>, <<EMAIL>>, 2019 - 2020 """ Test client. """ im...
# Copyright (c) 2018, Novartis Institutes for BioMedical Research 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: # # * Redistributions of source code must retain the above copyright ...
import sys import time if sys.implementation.name != "circuitpython": from ...lib.brteve.brt_eve_bt817_8 import BrtEve from ...lib.brteve.brt_eve_rp2040 import BrtEveRP2040 _last_tag = 0 def _tag_release(new_tag): global _last_tag tag_released = 0 if (new_tag == 0 and _last_tag != new_tag): ...
import datetime import random import re import time import traceback from time import sleep import pymongo import redis import requests import urllib3 # 忽视免验证并不显示 from redis import Redis from urllib3.exceptions import InsecureRequestWarning from selenium import webdriver from urllib.parse import urlparse # options =...
from django.urls import NoReverseMatch, reverse from django.utils.html import format_html from django.utils.translation import ugettext as _ from django.utils.translation import ugettext_noop from django.views import View from memoized import memoized from dimagi.utils.parsing import string_to_utc_datetime from dimag...
import sys import os import argparse import fnmatch import _vs_project_util as vsproj import _vs_solution_util as vssol import _vs_version_util as vsver class ChangesData: def __init__(self): self.changeProjList = list() self.changePkgList = list() def getArguments(): parser = argparse.Argum...
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7 #import kratos core and applications import KratosMultiphysics import KratosMultiphysics.ConvectionDiffusionApplication as KratosConvDiff import KratosMultiphysics.SolidMechanicsApplic...
#/* # * Copyright (c) 2021 Xilinx Inc. All rights reserved. # * # * Author: # * <NAME> <<EMAIL>> # * # * SPDX-License-Identifier: BSD-3-Clause # */ import struct import sys import types import unittest import os import getopt import re import subprocess import shutil from pathlib import Path from pathlib import ...
import numpy as np import cv2 as cv from numpy.lib.function_base import disp from bbox import BoundingBox, JSON2BboxList from utils import drawBbox,displayImage,drawVectfromBbox import time import matplotlib.pyplot as plt import json # setup initial location of window img1 = "img0658.jpg" img2 = "img0659.jpg" img3 = ...
''' How to run: command python train.py flowers --arch vgg16 --learning_rate 0.001 --epochs 10 Here data directory: flowers is mandatory. Other is optional. ''' import argparse import matplotlib.pyplot as plt import torch from torch import nn from torch import optim import torch.nn.functional as F from torchvision...
import glob import os import random import numpy as np import nibabel as nib from tqdm import tqdm import tensorflow as tf from args import PreproArgParser def get_npy_image(path, name): file_card = glob.glob(os.path.join(path, '*' + name + '.nii' + '*'))[0] return np.array(nib.load(file_card).dataobj).astyp...
#Import necessary package import requests import re from bs4 import BeautifulSoup import pandas as pd import numpy as np import datetime as dt import configparser import os import json #Configure parameter config = configparser.ConfigParser() config.read(os.path.join(os.path.dirname(__file__), 'config.ini')) mall = co...
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. import copy import dace from dace.fpga_testing import fpga_test, xilinx_test def make_sdfg(dtype, name="pipeline_test", input_device_memory="ddr", input_device_bank="0", output_device_me...
# -*- coding: utf-8 -*- ####################################################################### # Function to implement one-vs-all SVM # For SVM we use the scikit learn's SVM implementation ####################################################################### from __future__ import division import pdb import itertool...
import torch import torch.nn as nn import numpy as np import random import time from utils import device, AverageMeter, dir_path, write_log, accuracy, save_checkpoint from models.c3d import C3DFusionBaseline_small from dataset import HeatmapDataset from torch.utils.data import DataLoader import os import pandas as pd ...
import torch from torch import nn from torch.nn import CrossEntropyLoss from transformers.modeling_bert import ACT2FN, BertLayerNorm from transformers.modeling_bert import BertForMaskedLM from transformers.configuration_bert import BertConfig from models.custom_criterion import CustomAdaptiveLogSoftmax class TabForm...
# Copyright 2021 MosaicML. All Rights Reserved. from __future__ import annotations from typing import TYPE_CHECKING, Optional, Tuple import torch import torch.nn.functional as F from torch import Tensor from torchmetrics import Metric from torchmetrics.utilities.data import to_categorical if TYPE_CHECKING: from...
import time import json import pytest import subprocess from subprocess import Popen from tempfile import TemporaryDirectory, TemporaryFile from datetime import datetime from pyNakadi import NakadiClient, NakadiException from itertools import count URL_INTEGRATION_TEST_SERVER_PORT = '8080' URL_INTEGRATION_TEST_SERVE...
import json from ocean_utils.agreements.service_types import ServiceTypes from ocean_utils.utils.utilities import get_timestamp from ocean_lib.config import Config from ocean_lib.models.algorithm_metadata import AlgorithmMetadata from ocean_lib.models.bpool import BPool from ocean_lib.models.data_token import DataTok...
from matplotlib import pyplot as plt import itertools, json, os OS = os.name USER_HOME = os.environ.get('Homepath' if OS == 'nt' else 'HOME') USER_DOC_PATH = USER_HOME + '\\Documents\\' if OS == 'nt' else USER_HOME + '/Documents/' def sumlist(x): """ sumlist(x) Returns the running sum of a lis...
import torch from torch import nn from torch.nn import functional as F from ..backbone.utils import conv3x3 from ..backbone.resnet import BasicBlock from .base import SegBaseModule __all__ = ["ModernUNet"] class DownBlock(nn.Module): def __init__(self, in_ch, out_ch): super(DownBlock, self).__init__() ...
# Copyright 2021 <NAME>. 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 applicable law or agreed to...
#!/usr/bin/env python3 from collections import defaultdict from distutils import log from distutils.command import install_data as dst_install_data from distutils.util import byte_compile from itertools import chain import os import sys from textwrap import dedent from setuptools import setup from snakeoil.dist impo...
# Copyright 2011 <NAME> # # 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, softw...
""" Django views for interacting with Company app """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.views.generic import DetailView, ListView from django.forms import HiddenInput from InvenTree.views import AjaxCreateView, AjaxUpdateView, AjaxDeleteView from InvenTree.status_codes imp...
"""Tests for alpacka.agents.core.""" import collections import gym import numpy as np import pytest from alpacka import agents from alpacka import testing from alpacka import utils mock_env = testing.mock_env_fixture @pytest.mark.parametrize('with_critic', [True, False]) @pytest.mark.parametrize('agent_class', ...
# Copyright 2021, The TensorFlow Federated 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 law o...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Copyright 2014 Rackspace, <NAME> # # 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 wri...
# coding: utf-8 import datetime, os, ui, sys def get_dir(path = os.path.expanduser('~')): dirs = [] if path == os.path.expanduser('~') else ['..'] files = [] for entry in sorted(os.listdir(path)): if os.path.isdir(path + '/' + entry): dirs.append(entry) else: files...
import attr import sys import tqdm import torch from vel.api import TrainingInfo, EpochInfo, BatchInfo, Model, ModelFactory from vel.openai.baselines.common.vec_env import VecEnv from vel.rl.api import ( ReinforcerBase, ReinforcerFactory, ReplayEnvRollerBase, AlgoBase, VecEnvFactory, ReplayEnvRollerFactoryBase ) ...
import pathlib from typing import Any, Callable, Dict, List, Optional, Tuple, Union from urllib.parse import urlparse import pandas as pd from fugue.dataframe import LocalBoundedDataFrame, LocalDataFrame, PandasDataFrame from triad.collections.fs import FileSystem from triad.collections.schema import Schema from triad...
# encoding: utf-8 def main_hrun(): """ API test: parse command line options and run commands. """ import argparse from httprunner import logger from httprunner.__about__ import __description__, __version__ from httprunner.api import HttpRunner from httprunner.compat import is_py2 from h...
############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
import json import logging import os import sys import traceback from collections import defaultdict from datetime import datetime from os.path import basename from pathlib import Path import click import gevent import structlog from eth_utils import to_checksum_address from urwid import ExitMainLoop from web3.utils.t...
""" <NAME> and <NAME> Tic Tac Toe Game for Project Include Albion Library July 3 to July 7 """ from random import randint def genBoard(): """ Generates an empty board. >>> genBoard() ["A", "B", "C", "D", "E", "F", "G", "H", "I"] """ # Empty board empty = ["A", "B", "C", "D", "E"...
# ------------------------------------------------------------------------ # Copyright 2015 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/li...
#!/usr/env python from pprint import pprint import os import sys import math import time import requests import datetime import mysql.connector from bs4 import BeautifulSoup from lxml import html from dotenv import load_dotenv load_dotenv() CASE_NUMBER = '' SEARCH_URL = "http://www.fcmcclerk.com/case/search" R...
""" The MIT License (MIT) Copyright (c) 2021-present Dolfies 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, mod...
import numpy as np import pytest import transfer import utils import automatic_speech_recognition as asr @pytest.fixture def pipeline() -> asr.pipeline.CTCPipeline: transfer.transfer_open_seq2seq_deepspeech2( weights_file_name='nvidia-weights.bin', store_file_name='weights.h5' ) deepspeech2 = asr....
from django.shortcuts import render, redirect, get_object_or_404 from .forms import( RegisterForm, UserProfileForm, EditProfileForm, EditProfileFormCustme, RemoveUser, ) from django.http import HttpResponse from django.contrib.auth.forms import PasswordChangeForm from django.contrib.auth import upda...
from flask import make_response, send_from_directory import logging import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from io import StringIO, BytesIO import numpy as np class CubicSplines: ALLOWED_FUNCTIONS = { 'max': np.fmax, 'min': np.fmin, 'sin': np.sin, ...
import pandas as pd import requests import numpy as np import matplotlib.pyplot as plt from math import floor from termcolor import colored as cl plt.rcParams['figure.figsize'] = (20, 10) plt.style.use('fivethirtyeight') # EXTRACTING STOCK DATA def get_historical_data(symbol, start_date): api_key = 'YOUR API KEY...
"""SoftLayer Message Queue transport module for kombu. Features ======== * Type: Virtual * Supports Direct: Yes * Supports Topic: Yes * Supports Fanout: No * Supports Priority: No * Supports TTL: No Connection String ================= *Unreviewed* Transport Options ================= *Unreviewed* """ import socket...
# Copyright (c) 2018 PaddlePaddle 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 app...
"""Generic GUI testing utils - mainly helpers and extensions for Selenium. """ import re import os from time import sleep, time from itertools import islice, izip from contextlib import contextmanager from decorator import decorator from tests import gui from tests.gui.conftest import SELENIUM_IMPLICIT_WAIT, WAIT_R...
import PyTorchTrainer as Trainer import os, sys, getopt, pickle import torch import torchvision import torchvision.transforms as transforms from torch.utils.data import DataLoader import torch.nn as nn class AllCNN(nn.Module): def __init__(self, n_class): super(AllCNN, self).__init__() self.block1...
"""A sample runtime program that submits random circuits for user-specified iterations.""" from qiskit import transpile, ClassicalRegister, QuantumRegister, QuantumCircuit import scipy.optimize as opt import numpy as np import time from numpy import pi import datetime global BENCHMARK_TIMES def regular_graph(n): ...
""" Implementation following setups from PuzzleMix authors According to the seminal code: https://github.com/google-research/augmix/blob/master/cifar.py This code structure is borrowed from: https://github.com/ildoonet/pytorch-randaugment/blob/616ef12a5176169b4e1e645728f3dedd1a5a148e/RandAugment/augmentations.py """ i...
import os import json import argparse from tqdm import tqdm import numpy as np import torch import torch.utils.data from dataset import DanceDataset, paired_collate_fn from utils.functional import str2bool, load_data from generator import Generator from PIL import Image from keypoint2img import read_keypoints from mult...
# Released under The MIT License (MIT) # http://opensource.org/licenses/MIT # Copyright (c) 2013-2015 SCoT Development Team import unittest import numpy as np from numpy.testing.utils import assert_allclose from scot.datatools import dot_special from scot.csp import csp try: from generate_testdata import genera...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2016 F5 Networks Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # ...
from pathlib import Path from typing import Any, Dict, Optional from unittest import mock import platform import pytest import yaml from ray.autoscaler._private.kuberay.autoscaling_config import ( _derive_autoscaling_config_from_ray_cr, ) AUTOSCALING_CONFIG_MODULE_PATH = "ray.autoscaler._private.kuberay.autoscal...
"""Yesterday wo Utatte script""" __author__ = 'Vardë' import sys import os import subprocess from typing import NamedTuple from pathlib import Path from acsuite import eztrim import debandshit as dbs import vardefunc as vdf import mvsfunc as mvf import G41Fun as gf import xvs from vsutil import depth, get_y import l...
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic...
import datetime import pytest from aiohttp_admin2.mappers import fields from aiohttp_admin2.mappers import Mapper from aiohttp_admin2.mappers.exceptions import ValidationError FIELDS = [ fields.FloatField, fields.ArrayField, fields.BooleanField, fields.ChoicesField, fields.DateTimeField, fie...