text
stringlengths
3.07k
22.1k
""" User module """ import discord import random import asyncio from discord.ext import commands from discord.ext.commands import has_permissions, MissingPermissions, BadArgument import requests, json, pyfiglet from datetime import timedelta, datetime class User(commands.Cog): api_key = "<KEY>" base_url = "...
import secrets import asyncio from datetime import datetime, timedelta import discord from discord.ext import commands from database import DatabasePersonality, DatabaseDeck class Roll(commands.Cog): def __init__(self, bot): """Initial the cog with the bot.""" self.bot = bot #### Commands #...
#from https://github.com/mfurukawa/imu_sensor/tree/master/src/Python # September 03, 2020 # <NAME> from __future__ import unicode_literals ,print_function import serial from time import sleep import numpy as np import matplotlib.pyplot as plt import io import csv import time import datetime import struct impo...
""" @author: mkowalska """ import os import numpy as np from numpy.linalg import LinAlgError import matplotlib.pyplot as plt from figure_properties import * import matplotlib.gridspec as gridspec from kcsd import KCSD1D import targeted_basis as tb __abs_file__ = os.path.abspath(__file__) def _html(r, g, b): ret...
#!/usr/bin/env python3 import argparse import getpass import os import sys import argcomplete from datetime import datetime from forest import cmake_tools from forest.common.eval_handler import EvalHandler from forest.common.install import install_package, write_setup_file, write_ws_file, check_ws_file, uninstall_pac...
# ****************************************************************************** # Copyright 2017-2021 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.apa...
# (c) 2017 Red Hat Inc. # # This file is part of Ansible # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import collections import os import json import p...
import logging from thespian.actors import * from eventsourcing.application.process import ProcessApplication, Prompt from eventsourcing.application.system import System, SystemRunner from eventsourcing.domain.model.events import subscribe, unsubscribe from eventsourcing.interface.notificationlog import RecordManager...
import h5py from ont_fast5_api.conversion_tools import multi_to_single_fast5 from ont_fast5_api import fast5_interface import SequenceGenerator.align as align import SignalExtractor.Nanopolish as events from testFiles.test_commands import * import os, sys import subprocess #todo get basecall data def bas...
import click import aiohttp import asyncio import re import json from typing import Optional, Tuple, Iterable, Union, List from blspy import G2Element, AugSchemeMPL from chia.cmds.wallet_funcs import get_wallet from chia.rpc.wallet_rpc_client import WalletRpcClient from chia.util.default_root import DEFAULT_ROOT_PATH...
##--------------------------------Main file------------------------------------ ## ## Copyright (C) 2020 by <NAME> (<EMAIL>) ## June, 2020 ## <EMAIL> ##----------------------------------------------------------------------------- # Variables aleatorias múltiples # Se consideran dos bases de datos las ...
# -*- coding:UTF-8 -*- import pandas as pd from minepy import MINE import seaborn as sns import matplotlib.pyplot as plt from sklearn.ensemble import ExtraTreesClassifier import xgboost as xgb import operator from sklearn.utils import shuffle from Common.ModelCommon import ModelCV from sklearn import svm import numpy a...
""" This tool compares measured data (observed) with model outputs (predicted), used in procedures of calibration and validation """ from __future__ import division from __future__ import print_function import os from math import sqrt import pandas as pd from sklearn.metrics import mean_squared_error as calc_mean_squar...
from itertools import product import struct import pickle import numpy as np from scipy import sparse from scipy import isnan as scipy_isnan import numpy.matlib ASCII_FACET = """facet normal 0 0 0 outer loop vertex {face[0][0]:.4f} {face[0][1]:.4f} {face[0][2]:.4f} vertex {face[1][0]:.4f} {face[1][1]:.4f} {face[1][2]...
# this version is adapted from http://wiki.ipython.org/Old_Embedding/GTK """ Backend to the console plugin. @author: <NAME> @organization: IBM Corporation @copyright: Copyright (c) 2007 IBM Corporation @license: BSD All rights reserved. This program and the accompanying materials are made available under the term...
import json import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import pandas as pd import dash_table def get_comps_data(bd, projverurl): print('Getting components ...') # path = projverurl + "/components?limit=5000" # # custom_headers = {'Acc...
import numpy as np from time import time import matplotlib.pyplot as plt measure2index={"y-coordinate":0,"x-coordinate":1,"timestamp":2, "button_status":3,"tilt":4, "elevation":5,"pressure":6} index2measure=list(measure2index.keys()) task2index={"spiral":0,"l":1,"le":2 ,"les":3,"lektorka" :4,"porovnat":5,"nepopadnout...
from Tkinter import * import ttk import BuyBook import BookInformationPage import Message class UserPage(object): def __init__(self, root, color, font, dbConnection, userInfo): for child in root.winfo_children(): child.destroy() self.root = root self.color = color sel...
import argparse, os, fnmatch, json, joblib import pandas as pd from sklearn.mixture import GaussianMixture from sklearn.metrics import adjusted_rand_score # Reference paper - https://arxiv.org/abs/1906.11373 # "Unsupervised Methods for Identifying Pass Coverage Among Defensive Backs with NFL Player Tracking Data" STA...
''' --- I M P O R T S T A T E M E N T S --- ''' import coloredlogs, logging coloredlogs.install() import numpy as np ''' === S T A R T O F C L A S S E V A L M E T R I C === [About] Object class for calculating average values. [Init Args] - name: String for the variable name to calc...
#!/usr/bin/env python3 """ Main script for workload forecasting. Example usage: - Generate data (runs OLTP benchmark on the built database) and perform training, and save the trained model ./forecaster --gen_data --models=LSTM --model_save_path=model.pickle - Use the trained models (LSTM) to generate predictions. ...
import numpy as np import tectosaur.util.gpu as gpu from tectosaur.fmm.c2e import build_c2e import logging logger = logging.getLogger(__name__) def make_tree(m, cfg, max_pts_per_cell): tri_pts = m[0][m[1]] centers = np.mean(tri_pts, axis = 1) pt_dist = tri_pts - centers[:,np.newaxis,:] Rs = np.max(np...
""" Challenge Exercises for Chapter 1. """ import random import timeit from algs.table import DataTable, ExerciseNum, caption from algs.counting import RecordedItem def partition(A, lo, hi, idx): """ Partition using A[idx] as value. Note lo and hi are INCLUSIVE on both ends and idx must be valid index. C...
import os, time, mimetypes, glob from django.utils.translation import gettext_lazy as _ from django.urls import reverse from task.const import * from task.models import Task, detect_group from rusel.base.config import Config from rusel.base.forms import CreateGroupForm from rusel.context import get_base_context from ru...
import os import argparse import subprocess import random import edlib from typing import List from collections import Counter import stanza class ExtractMetric(object): """used for precision recall""" def __init__(self, nume=0, denom_p=0, denom_r=0, precision=0, recall=0, f1=0): super(ExtractMetric, ...
import qiskit import numpy as np import matplotlib.pyplot as plt import json from graph import * # Random comment P =1 def makeCircuit(inbits, outbits): q = qiskit.QuantumRegister(inbits+outbits) c = qiskit.ClassicalRegister(inbits+outbits) qc = qiskit.QuantumCircuit(q, c) q_input = [q[i] for i in ran...
# 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 u...
from random import Random from collections_extended import setlist # The version of seeding to use for random SEED_VERSION = 2 # Common alphabets to use ALPHANUM = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' def shuffle(key...
# -*- coding: utf-8 -*- """ Created on Wed Jun 28 13:03:05 2017 @author: <NAME> """ import cntk as C import _cntk_py import cntk.layers import cntk.initializer import cntk.losses import cntk.metrics import cntk.logging import cntk.io.transforms as xforms import cntk.io import cntk.train import os import numpy as np i...
import h2o from h2o.base import Keyed from h2o.exceptions import H2OValueError from h2o.job import H2OJob from h2o.model import ModelBase from h2o.utils.typechecks import assert_is_type, is_type class H2OAutoMLBaseMixin: def predict(self, test_data): """ Predict on a dataset. :param ...
# # Copyright (C) 2014 Dell, 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 wri...
import os from itertools import product from concurrent import futures from contextlib import closing from datetime import datetime import numpy as np from . import _z5py from .file import File, S3File from .dataset import Dataset from .shape_utils import normalize_slices def product1d(inrange): for ii in inrang...
import discord from discord.ext import commands from pathlib import Path from config import bot from collections import OrderedDict import json class RoleSelector(commands.Cog): def __init__(self, bot): self.bot = bot self.messages_path = str(Path('cogs/data/messages.json')) async def opener(...
#!/usr/bin/env python # Author: <NAME> # Date: 2015oct31 from __future__ import print_function import os import sys import stat import errno import shutil import optparse import traceback import subprocess wrappaconda_name_string = 'Wr[App]-A-Conda' class AppAtizer(object): def __init__(self): # tmp ...
import numpy as np from pyquil.gate_matrices import X, Y, Z, H from forest.benchmarking.operator_tools.superoperator_transformations import * # Test philosophy: # Using the by hand calculations found in the docs we check conversion # between one qubit channels with one Kraus operator (Hadamard) and two # Kraus operat...
from distutils.version import LooseVersion import requests import os import shutil import threading import webbrowser from zipfile import ZipFile from pathlib import Path import traceback import tempfile # import concurrent.futures from flask import Flask, url_for, make_response from flask.json import dumps from flask_...
# Copyright Contributors to the Pyro-Cov project. # SPDX-License-Identifier: Apache-2.0 import functools import io import logging import math import re import sys import torch import torch.multiprocessing as mp from Bio import AlignIO from Bio.Phylo.NewickIO import Parser from Bio.Seq import Seq from Bio.SeqRecord im...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module contains the necessary functions to load a text-corpus from NLTK, contract all possible sentences, applying POS-tags to the contracted sentences and compare that with the original text. The information about which contraction+pos-tag pair gets expanded to ...
from tensorflow.keras.models import Model import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np import cv2 import numpy as np import pandas as pd from tensorflow.keras.models import load_model import tensorflow as tf import os #--------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Common utility functions Created on Sun May 27 16:37:42 2018 @author: chen """ import math import cv2 import os from imutils import paths import numpy as np import scipy.ndimage def rotate_cooridinate(cooridinate_og,rotate_angle,rotate_center): """ calculat...
import scipy, numpy, typing, numbers from tequila.objective import Objective from tequila.objective.objective import assign_variable, Variable, format_variable_dictionary, format_variable_list from .optimizer_base import Optimizer from ._containers import _EvalContainer, _GradContainer, _HessContainer, _QngContainer fr...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import keras from keras.models import Model, load_model from keras import backend as K from keras.preprocessing.image import ImageDataGenerator import tensorflow as tf tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) # mute deprecation warnings from kera...
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch, glob, os from .sparseConvNetTensor import SparseConvNetTensor from .metadata import Metadata import sparsecon...
# The MIT License (MIT) # # Copyright © 2021 <NAME>, <NAME>, <NAME> # # 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...
import os import json from common import update_json_file, get_logger, exec_cmd from yamlparser import Parser from pathlib import Path logger = get_logger("update-image") # Functions that work to update gluu_versions.json def determine_final_official_and_dev_version(tag_list): """ Determine official version...
def setopts(defaults, given): """Override default keyword dictionary options. kwargs = setopts(defaults, kwargs) A warning is shown if kwargs contains a key not found in default. """ # Override defaults for key, value in given.items(): if type(given[key]) == dict: setopts(...
from __future__ import unicode_literals, print_function, division import feedparser import dataset from twisted.internet.reactor import callLater from threading import Thread import twisted.internet.error import logging logger = logging.getLogger('module_rss') DATABASE = None updater = None botref = None config = {} ...
import pytest import re import unittest import metric_learn import numpy as np from sklearn import clone from test.test_utils import ids_metric_learners, metric_learners, remove_y from metric_learn.sklearn_shims import set_random_state, SKLEARN_AT_LEAST_0_22 def remove_spaces(s): return re.sub(r'\s+', '', s) def ...
import numpy as np import pandas as pd import scipy as sc from scipy.stats import randint, norm, multivariate_normal, ortho_group from scipy import linalg from scipy.linalg import subspace_angles, orth from scipy.optimize import fmin import math from statistics import mean import seaborn as sns from sklearn.cluster imp...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Usage: %(scriptName) <bug_report_file> <data_prefix> """ import json from timeit import default_timer import datetime import numpy as np import pickle import sys from multiprocessing import Pool from operator import itemgetter from scipy import sparse from sklearn.fe...
import board from i2cperipheral import I2CPeripheral from analogio import AnalogOut from digitalio import DigitalInOut, Direction, Pull import struct import math import time regs = [0] * 16 index = 0 i2c_addr = 0x68 frame_id = 0 motor_control_mode = 0 backup_mode = 0 motor_switch_state = 0 hall_switch_state = 0 enc...
""" PEP 0484 ( https://www.python.org/dev/peps/pep-0484/ ) describes type hints through function annotations. There is a strong suggestion in this document that only the type of type hinting defined in PEP0484 should be allowed as annotations in future python versions. """ import re from parso import ParserSyntaxErro...
import argparse import math import matplotlib.pyplot as plt import os import numpy as np import shutil import pandas as pd import seaborn as sns sns.set() sns.set_context("talk") NUM_BINS = 100 path = '../Data/Video_Info/Pensieve_Info/PenieveVideo_video_info' video_mappings = {} video_mappings['300'] = '320x180x30_v...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# coding=utf-8 # Copyright 2022 The Google Research 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 applicab...
# vim: set encoding=utf-8 import re from lxml import etree import logging from regparser import content from regparser.tree.depth import heuristics, rules, markers as mtypes from regparser.tree.depth.derive import derive_depths from regparser.tree.struct import Node from regparser.tree.paragraph import p_level_of from...
import os import numpy as np import torch import torch.nn as nn import torch.optim as optim import argparse from tqdm import tqdm import sys import distributed as dist import utils from models.vqvae import VQVAE, VQVAE_Blob2Full from models.discriminator import discriminator visual_folder = '/home2/bipasha31/python_...
# /*********************************************************************** # Copyright 2019 Google 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/LICE...
import os import shutil import tempfile from taskmage2.utils import filesystem, functional from taskmage2.asttree import asttree, renderers from taskmage2.parser import iostream, parsers from taskmage2.project import taskfiles class Project(object): def __init__(self, root='.'): """ Constructor. ...
# !/usr/bin/env python3 # -*- coding: utf-8 -*- """ @Time : 2019/9/17 15:07 @Author : <NAME> @FileName: models.py @GitHub : https://github.com/cRiii """ from datetime import datetime from werkzeug.security import generate_password_hash, check_password_hash from jaysblog.extensions import db from flask_login i...
from django.db import models from django.core.validators import RegexValidator, ValidationError from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from smart_selects.db_fields import ChainedForeignKey, ChainedManyToManyField from ordered_model.models import OrderedModel ...
from myhdl import Signal, intbv, block, always_comb, ConcatSignal import myhdl from collections import OrderedDict import keyword def _is_valid_name(ident: str) -> bool: '''Determine if ident is a valid register or bitfield name. ''' if not isinstance(ident, str): raise TypeError("expected str, b...
# nuScenes dev-kit. # Code written by <NAME>, 2020. import argparse import gc import os import random from typing import List from collections import defaultdict import cv2 import tqdm from nuimages.nuimages import NuImages def render_images(nuim: NuImages, mode: str = 'all', ca...
from django.db import models from django.core.urlresolvers import reverse from djnfusion import server, key from django.conf import settings from jsonfield import JSONField # TODO: change to this. Currently doesnt work. may have something to do with # the server not in __init__ # from packages.providers.infusionsoft ...
#!/usr/bin/env python # # Creates resources # This script creates VPC/security group/keypair if not already present import logging import os import sys import time from . import aws_util as u from . import util DRYRUN = False DEBUG = True # Names of Amazon resources that are created. These settings are fixed across ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 <EMAIL> # Licensed under the MIT license (http://opensource.org/licenses/MIT) import cffi import ctypes.util import platform ffi = cffi.FFI() ffi.cdef(""" struct hid_device_info { char *path; unsigned short vendor_id; unsigned short product_id...
""" ethereum.py ethereum.py contains an EthereumClient class that provides functions for interacting with the Coverage.sol solidity contract on an Ethereum blockchain network. """ import asyncio import datetime import json import logging import os from ethereum.clients.nats import get_nats_client from ethereum.config ...
# -*- coding: UTF-8 -*- """ Provides a summary after each test run. """ from __future__ import absolute_import, division, print_function import sys from time import time as time_now from behave.model import Rule, ScenarioOutline # MAYBE: Scenario from behave.model_core import Status from behave.reporter.base import R...
#!/usr/bin/env python # This program 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 # (at your option) any later version. # # Written (W) 2008-2009 <NAME> # Copyright (C) ...
"""Main farm access.""" from __future__ import annotations import os from datetime import datetime from typing import Dict, Iterable, Iterator, List, Type, Union from farmos_ext.area import Area from farmos_ext.asset import Asset, Equipment, Planting from farmos_ext.log import (Activity, Birth, Harvest, Input, Log, ...
import dataclasses as dc from typing import Any, Dict, Iterable, List, Optional from loguru import logger from mate3.field_values import FieldValue, ModelValues from mate3.read import AllModelReads from mate3.sunspec.fields import IntegerField from mate3.sunspec.model_base import Model from mate3.sunspec.models impor...
#!/usr/bin/env/python3 """Recipe for training a wav2vec-based ctc ASR system with librispeech. The system employs wav2vec as its encoder. Decoding is performed with ctc greedy decoder. To run this recipe, do the following: > python train_with_wav2vec.py hparams/train_with_wav2vec.yaml The neural network is trained on C...
import os import platform import unittest # ZODB >= 3.9. The blob directory can be a private cache. shared_blob_dir_choices = (False, True) RUNNING_ON_TRAVIS = os.environ.get('TRAVIS') RUNNING_ON_APPVEYOR = os.environ.get('APPVEYOR') RUNNING_ON_CI = RUNNING_ON_TRAVIS or RUNNING_ON_APPVEYOR def _do_not_skip(reason):...
# -*- coding: utf-8 -*- """ obspy.io.nied.knet - K-NET/KiK-net read support for ObsPy ========================================================= Reading of the K-NET and KiK-net ASCII format as defined on http://www.kyoshin.bosai.go.jp. """ from __future__ import (absolute_import, division, print_function, ...
from data import NumericalField, CategoricalField, Iterator from data import Dataset from synthesizer import MaskGenerator_MLP, ObservedGenerator_MLP, Discriminator, Handler, ObservedGenerator_LSTM from random import choice import multiprocessing import pandas as pd import numpy as np import torch import argparse impor...
from urllib.parse import parse_qs from anticaptchaofficial.hcaptchaproxyless import hCaptchaProxyless from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait from court_scraper.base.selenium_helpers import Sel...
# Copyright 2016 Google 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 required by applicable law or ag...
from collections import defaultdict from celery.task import task from pandas import concat, DataFrame from bamboo.core.aggregator import Aggregator from bamboo.core.frame import add_parent_column, join_dataset from bamboo.core.parser import Parser from bamboo.lib.datetools import recognize_dates from bamboo.lib.jsont...
# -*- coding: utf-8 -*- """ Created on Mon Aug 10 14:31:17 2015 @author: <NAME>. Description: This script does CPU and GPU matrix element time complexity profiling. It has a function which applies the matrix element analysis for a given set of parameters, profiles the code and ...
import Sofa import SofaTest import SofaPython.Tools OBJ = SofaPython.Tools.localPath( __file__, "beam.obj" ) RAW = SofaPython.Tools.localPath( __file__, "beam.raw" ) ##Check if calling Mapping::init() change anything # #The trick is to know that if the option evaluateShapeFunction is activated #in the ImageGaussPoint...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: bigip_device_group_memb...
# <NAME>, March 2020 # Common code for PyTorch implementation of Copy-Pasting GAN import copy import itertools import matplotlib.pyplot as plt import numpy as np import os, platform, time import torch import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms f...
"""The :mod:`mlshell.pipeline.steps` contains unified pipeline steps.""" import inspect import mlshell import numpy as np import pandas as pd import sklearn import sklearn.impute import sklearn.compose __all__ = ['Steps'] class Steps(object): """Unified pipeline steps. Parameters ---------- estim...
__all__ = [ 'BenchmarksManifest', 'load_manifest', 'parse_manifest', ] from collections import namedtuple import os.path from . import __version__, DATA_DIR from . import _benchmark, _utils DEFAULTS_DIR = os.path.join(DATA_DIR, 'benchmarks') DEFAULT_MANIFEST = os.path.join(DEFAULTS_DIR, 'MANIFEST') ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 1 15:10:45 2019 @author: r17935avinash """ ################################ IMPORT LIBRARIES ############################################################### import torch import numpy as np import pykp.io import torch.nn as nn from utils.statistics...
from __future__ import division from __future__ import print_function from __future__ import absolute_import import tensorflow as tf import numpy as np EPS = 1e-10 def get_required_argument(dotmap, key, message, default=None): val = dotmap.get(key, default) if val is default: raise ValueError(message)...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from numpy import array from numpy import isnan from numpy import isinf from numpy import ones from numpy import zeros from scipy.linalg import norm from scipy.sparse import diags from compas.numerical import ...
# Lint as: python3 # # Copyright 2020 The XLS 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...
import collections from itertools import groupby from django.db import connections, models, router from django.db.models.deletion import Collector from django.utils import encoding import bleach import commonware.log from mkt.site.models import ManagerBase, ModelBase from mkt.site.utils import linkify_with_outgoing ...
from flask import render_template, Flask, flash, redirect, url_for, abort, request from flask_login import login_user, logout_user, login_required from werkzeug.urls import url_parse from app import app, db from app.forms import * from app.models import * @app.route('/') @app.route('/landing') def landing(): ret...
# -*- encoding: utf-8 -*- """ endpoint_user_tokens.py """ from solidata_api.api import * # from log_config import log, pformat log.debug(">>> api_auth ... creating api endpoints for USER_TOKENS") ### create namespace ns = Namespace('tokens', description='User : tokens freshening related endpoints') ### import mo...
# 分析黑魔法防御课界面 import cv2 import sys sys.path.append(r"C:\\Users\\SAT") # 添加自定义包的路径 from UniversalAutomaticAnswer.conf.confImp import get_yaml_file from UniversalAutomaticAnswer.screen.screenImp import ScreenImp # 加入自定义包 from UniversalAutomaticAnswer.ocr.ocrImp import OCRImp from UniversalAutomaticAnswer.util.filter imp...
import logging from datetime import datetime, timedelta import requests from core.utils.customClasses import UserFilter from core.utils.default_responses import (api_accepted_202, api_bad_request_400, api_block_by_policy_451, ...
import datetime from typing import List from reminders.events import Buttons, Alerts from reminders.screen import Screen # highest level, things that can be in a list menu class ListMenuItem: def __init__(self, name): self._name = str(name) @property def name(self): return self._name ...
# encoding=utf-8 """ Misc PyTorch utils Author: <EMAIL> update 12.7 Usage: `from torch_utils import *` `func_name()` # to call functions in this file """ from datetime import datetime import math import os import torch import torch.nn as nn from tensorboardX import SummaryWriter #########################...
# This a training script launched with py_config_runner # It should obligatory contain `run(config, **kwargs)` method import sys from collections.abc import Mapping from pathlib import Path import torch from apex import amp from dataflow.datasets import VOCSegmentationOpencv from py_config_runner.config_utils import ...
#!/usr/bin/env python u""" radial_basis.py Written by <NAME> (01/2022) Interpolates data using radial basis functions CALLING SEQUENCE: ZI = radial_basis(xs, ys, zs, XI, YI, polynomial=0, smooth=smooth, epsilon=epsilon, method='inverse') INPUTS: xs: scaled input X data ys: scaled input Y data ...
import os import sys import glob import time import copy import random import numpy as np import utils import logging import argparse import tensorflow as tf import tensorflow.keras as keras from model import NASNetworkCIFAR os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # os.environ['CUDA_VISIBLE_DEVICES'] = '1' # Basic m...
import argparse,time,os,pickle import matplotlib.pyplot as plt import numpy as np from player import * plt.switch_backend('agg') np.set_printoptions(precision=2) class lemon: def __init__(self, std, num_sellers, num_actions, unit, minx): self.std = std self.unit = unit self.num_sellers = num_sellers self.nu...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...