text
stringlengths
3.07k
22.1k
""" This file will import four packages: gym (the OpenAI Gym package for developing and comparing reinforcement learning algorithms), numpy (a package used primarily to conduct complex mathematical operations and to organize stacks along new axes), tensorflow (the computational library used most considerably in machin...
import fiona import logging from multiprocessing import cpu_count import os from pprint import pformat import rasterio from rasterio.crs import CRS from shapely.geometry import box from shapely.geometry.base import BaseGeometry import tilematrix from typing import Callable, List, Tuple, Union import warnings import ma...
import torch import torch.nn as nn from torch.nn import init from torch.optim import lr_scheduler import torchvision.models as torch_models ''' Helper functions for model Borrow tons of code from https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/models/networks.py ''' def get_scheduler(optimizer, ...
#!/usr/bin/python import os import sys import signal import json import yfinance as yf import pandas as pd import math import argparse from datetime import datetime import matplotlib.pyplot as plt import numpy as np g_StocksDB = None def Load(filename): if os.path.isfile(filename) is True: file = open(filename, "r...
from collections import OrderedDict import numpy as np from matplotlib.patches import FancyBboxPatch from classes.ui import UIManager from classes.ui import RepresentationController from classes.ui import RepresentationView class IndexRepresentationController(RepresentationController): tid = 'index_representati...
# Copyright 2015 Open Source Robotics Foundation, 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...
# This files contains your custom actions which can be used to run # custom Python code. # # See this guide on how to implement these action: # https://rasa.com/docs/rasa/core/actions/#custom-actions/ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __fu...
"""Shared jwt functionality for the Auth@Edge Lambda suite.""" import base64 import codecs import json import logging import re from urllib import request from jose import jwt # noqa pylint: disable=import-error LOGGER = logging.getLogger(__name__) def prepad_signed(hex_str): """Given a hexadecimal string prep...
import re import pathlib from nonebot import on_command, export, logger from nonebot.typing import T_State from nonebot.adapters.cqhttp.bot import Bot from nonebot.adapters.cqhttp.event import MessageEvent, GroupMessageEvent, PrivateMessageEvent from nonebot.adapters.cqhttp.permission import GROUP, PRIVATE_FRIEND from ...
import json import os import re import shutil import ssl import urllib.request from datetime import datetime from random import randint from time import sleep from urllib.error import URLError from insomniac.__version__ import __version__ COLOR_HEADER = '\033[95m' COLOR_OKBLUE = '\033[94m' COLOR_OKGREEN = '\033[92m' ...
#!/usr/bin/env python import os import sys import numpy as np import pickle import rospy import rospkg from pydc import DDC from anchor_msgs.msg import AnchorArray from anchor_msgs.msg import LogicAnchor from anchor_msgs.msg import LogicAnchorArray from anchor_msgs.msg import PositionAttribute from anchor_msgs.msg im...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2020, Battelle Memorial Institute. # # 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...
# Copyright 2016 by Raytheon BBN Technologies Corp. All Rights Reserved. from qgl2.qgl2 import qgl2decl, qreg, QRegister from qgl2.qgl1 import X90, Id, Y, U90, MEAS, pulseCentered from qgl2.basic_sequences.helpers import create_cal_seqs, cal_descriptor, delay_descriptor from qgl2.util import init from math import p...
"""Handles building condenser_api-compatible response objects.""" import logging import ujson as json from hive.utils.normalize import sbd_amount, rep_to_raw from hive.server.common.mutes import Mutes log = logging.getLogger(__name__) # Building of legacy account objects async def load_accounts(db, names): """...
# Copyright 2016-2017 <NAME> <<EMAIL>> # # 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...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <<EMAIL>> # # 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 ...
from cova import FEATURETABLE, GENOME, RFS, CDS, PSEQS from cova import utils from Bio.Data.CodonTable import unambiguous_dna_by_id as codon_table import os, sys, pandas, math, multiprocessing, numpy from time import time #### Point mutations ####### def ann_pm(vpos,vseq,ft=FEATURETABLE,cdss=CDS,ct=codon_table[1],rfs=...
#!/usr/bin/env python3 # # Python module of support vector classification with random matrix for CPU. ######################################### SOURCE START ######################################## import numpy as np import torch from .rfflearn_gpu_common import Base ### This class provides the RFF based SVC classif...
import itertools import logging import os import sys from argparse import ArgumentParser from signal import SIGUSR1, SIGUSR2, signal from subprocess import PIPE, run import matplotlib.pyplot as plt import numpy as np import xarray as xr from dask.distributed import Client from loren_frank_data_processing.position impo...
from django.shortcuts import render, get_object_or_404 from django.views import generic from django.urls import reverse, reverse_lazy from django.http import HttpResponseRedirect, Http404 from django.utils.translation import ugettext_lazy as _ from django.utils.decorators import method_decorator from django.contrib.au...
# pylint: disable=no-member,unused-variable from collections import OrderedDict import heterocl as hcl import heterocl.tvm as tvm from .util import equal_const_int dtype = hcl.Float() sum = hcl.reducer(0, lambda x, y: x + y, dtype) max = hcl.reducer(-1, lambda x, y: tvm.make.Max(x, y), dtype) def simplify(expr): ...
# Copyright The PyTorch Lightning team. # # 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...
# 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. import pickle import sqlite3 import zlib import dgl import numpy as np import torch from dgl.data import DGLDataset class CompilerGymDataset...
import numpy as np from enum import Enum, auto class BoardView(Enum): ONE_CHANNEL = auto() TWO_CHANNELS = auto() # Representation of the player in one-channel board view class OthelloPlayer(Enum): BLACK = 1 WHITE = -1 @property def opponent(self): return OthelloPlayer.WHITE if ...
import json import numpy as np import os import torch import types from torchvision import transforms from PIL import Image, ImageDraw from .model import resnet34 def load_classes(path): """ Loads class labels at 'path' """ with open(path, "r") as fp: names = json.load(fp) ...
import eight_mile.embeddings from eight_mile.embeddings import * from eight_mile.utils import exporter, optional_params, listify, idempotent_append, is_sequence from baseline.utils import import_user_module, DEFAULT_DATA_CACHE from eight_mile.downloads import AddonDownloader, EmbeddingDownloader import logging __all__...
import json import os import subprocess import math from ir_utils import * ## Global __version__ = "0.5" # FIXME add libdash version GIT_TOP_CMD = [ 'git', 'rev-parse', '--show-toplevel', '--show-superproject-working-tree'] if 'PASH_TOP' in os.environ: PASH_TOP = os.environ['PASH_TOP'] else: PASH_TOP = subpro...
''' Created on July 20, 2018 @author : hsiaoyetgun (yqxiao) ''' # coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from datetime import datetime import sys import tensorflow as tf import Config from Model import ESIM from ...
from discord.ext import commands import discord import aiohttp import asyncio from typing import List from lib.config import domain_name, twitch_client_secret, twitch_client_id, logger, twitch_hub_secret from lib.aiomodels import TwitchStream, Tokens from datetime import datetime, timedelta class Twitch(commands.Cog...
# Modified from cpython-2.7/Lib/test/regrtest.py import StringIO import datetime import getopt import imp import json import math import os import platform import random import re import shutil import sys import sysconfig import tempfile import time import traceback import unittest import warnings from . import suppo...
import json import pickle from operator import itemgetter from crispy_forms.layout import Submit from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required from django.contrib.auth.mixins import UserPas...
# -*- coding:utf-8 -*- ### # @Author: Chris # Created Date: 2020-01-02 19:46:23 # ----- # Last Modified: 2020-02-23 19:32:46 # Modified By: Chris # ----- # Copyright (c) 2020 ### import pickle import random import concurrent.futures from typing import List from collections import defaultdict import numpy as np import...
from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.utils import timezone from django.utils.module_loading import import_string from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from resources....
""" Functionality for generating Python code used to evaluate barycentric polynomials. """ from polynomials_on_simplices.algebra.multiindex import generate_all, norm from polynomials_on_simplices.generic_tools.code_generation_utils import CodeWriter from polynomials_on_simplices.generic_tools.str_utils import ( sp...
from enum import Enum import peewee from server import parser from server.model_register import ModelType from server.query.tree import QueryTree class QueryBuilder: def __init__(self, mr): self.mr = mr self.used_models = None self.query_tree = None self.query = N...
# ---------------------------------------------------------------------------- # Copyright 2019-2021 Pelion # # SPDX-License-Identifier: Apache-2.0 # # 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 Licens...
# -*- 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...
import logging import random from datetime import timedelta from django.contrib.auth import get_user_model from django.contrib.postgres.fields import JSONField from django.core.exceptions import ImproperlyConfigured from django.db import models, transaction from django.utils import timezone from django.utils.module_lo...
#!/usr/bin/python # #Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. # from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str from builtins import object import sys import argparse import configparser import json from reques...
import os import tkinter import tkinter.filedialog import subprocess import random import time from tkinter.font import Font from tkinter import * from tkinter import messagebox import Object_detection_webcam_pattern as bots from datetime import datetime import shutil import threading top = Tk() #ro...
from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rlib import rgc from rpython.rlib.rarithmetic import widen from rpython.rlib.debug import make_sure_not_resized from rpython.rlib.objectmodel import specialize from pypy.objspace.std.typeobject import W_TypeObject, find_best_base from pypy.objspace.std.o...
""" Provider that returns GeoJSON data responses from PostGIS queries. Note: The built-in TileStache Vector provider (new in version 1.9.0) offers a more complete method of generating vector tiles, and supports many kinds of data sources not avilable in PostGeoJSON such as shapefiles. PostGeoJSON will continue to be ...
import logging import os import platform import numpy as np import pybullet as p import yaml import igibson from igibson.action_primitives.action_primitive_set_base import ActionPrimitiveError from igibson.action_primitives.starter_semantic_action_primitives import StarterSemanticActionPrimitives from igibson.objects...
import rdkit from rdkit.Chem import rdMolTransforms from rdkit.Chem import TorsionFingerprints import numpy as np import networkx as nx import random atomTypes = ['H', 'C', 'B', 'N', 'O', 'F', 'Si', 'P', 'S', 'Cl', 'Br', 'I'] formalCharge = [-1, -2, 1, 2, 0] degree = [0, 1, 2, 3, 4, 5, 6] num_Hs = [0, 1, 2, 3, 4] loca...
import os.path import numpy as np import pandas import pickle import requests import ast import typing import pkg_resources from json import JSONDecoder from typing import List from Duke.agg_functions import * from Duke.dataset_descriptor import DatasetDescriptor from Duke.utils import mean_of_rows from d3m.primitive...
""" Functionity related to the recording and publishing of application events """ # import python deps import functools import logging from collections import Iterable from google.appengine.api import taskqueue # FRAMEWORK from django.core.urlresolvers import reverse from django.contrib.auth import get_user_m...
# -- coding: utf-8 -- import logging import pickle import time import datetime import equipment import pid import regulator import templogger class ExperimentException(Exception): def __init__(self, value): self.value = value def __str__(self): return self.value class Experiment: _CFG...
#ํฌ์Šค์ฝ” ์ฒญ๋…„ AI Bigdata ์•„์นด๋ฐ๋ฏธ A๋ฐ˜ 4์กฐ #์˜จ๋ผ์ธ ์‹œํ—˜ ๋ถ€์ • ํ–‰์œ„ ๋ฐฉ์ง€ ์‹œ์Šคํ…œ ############POSCAS############ #https://github.com/JoyLeeA # ์ž์„ธํ•œ ์„ค๋ช… ์ˆ˜๋ก #### FOR FACE IDENTIFY #### import numpy as np from keras.models import load_model from mtcnn.mtcnn import MTCNN from PIL import Image from sklearn.svm import SVC from faceidentify.SVMclassifier ...
#!/usr/bin/env python3 import sys import subprocess import os import re def usage(): print(("Usage: {} <riddle file> <solution file> " + "<riddle output> <solution output>").format(sys.argv[0])) sys.exit(0) def run(command, arguments=[], stdin=None): if stdin == None: stdin_pipe = open...
import os import time import torch import argparse import numpy as np from inference import infer from utils.util import mode from hparams import hparams as hps from torch.utils.data import DataLoader from utils.logger import Tacotron2Logger from utils.dataset import ljdataset, ljcollate from model.model import Tacotro...
# Copyright (c) 2021 <NAME>. All Rights Reserved. import pymel.core as pm import piper_config as pcfg import piper.core.pipermath as pipermath import piper.mayapy.util as myu import piper.mayapy.attribute as attribute from . import bone from . import xform from . import curve def getTag(node): """ Gets the...
#!/usr/bin/env python # coding: utf-8 # # ipyturtle3.py: an ipycanvas based turtle graphics module for Python # implemented as wrapper around turtle.py which ships with python # Version 0.1.3 - 19. 5. 2022 # # Copyright [2022] [<NAME>] # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
# 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 statistics import mean from typing import Any from dataclasses import dataclass, field import heapq import random import utils.blockworld as blockworld from model.utils.Search_Tree import * from model.BFS_Agent import BFS_Agent import os import sys proj_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file...
#!/usr/bin/env python # vim: set ts=4 sw=4 expandtab sts=4: # Copyright (c) 2011-2013 <NAME> & contributors # # 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 # ...
#!/usr/bin/env python """ initialize a rotta project directory computes features if they do not exist optional regenerate and overwrite existing feature h5 files """ import argparse import sys from multiprocessing import Pool from pathlib import Path import src.pose_estimation import src.feature_extraction import s...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division import paddle import paddle.fluid as fluid import numpy as np import math import matplotlib.pyplot as plt import os __all__ = [ 'test_and_save_distribution_img', 'test_dtype_1parameter_discre...
#!/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. import math from copy import deepcopy import numpy as np from ax.core.metric import Metric from ax.core.objective impo...
import sys sys.path.append('../') import argparse import os import torch from elmoformanylangs import Embedder from pytorch_transformers import BertModel, BertTokenizer from tqdm import tqdm import numpy as np from data_util import io_helper """ Creates static vectors for vocabulary """ def get_elmo(model, sen...
''' @author jtoung revised by awise ''' import re from collections import defaultdict valid_sections = set(('Header', 'Reads', 'Settings', 'Data')) def check_valid_samplename(name): if "_R1_" in name or "_R2_" in name or name.endswith("_R1") or name.endswith("_R2"): raise RuntimeError('Sample name {} cont...
# pylint: disable=no-name-in-module import asyncio import time from typing import ( Any, Dict, List, Sequence, Tuple, ) from lru import LRU from libp2p.host.host_interface import ( IHost, ) from libp2p.peer.id import ( ID, ) from libp2p.network.stream.net_stream_interface import ( INet...
import atexit import configparser import copy import io import multiprocessing import os import os.path import shlex import shutil import tempfile from . import consts, util DEBSRC = '.debsrc' DEFAULTS = [ '/etc/debsrc', os.path.join(consts.CFG_DIR, 'debsrc'), ] GROUP = 'debs' PACKAGES = 'packages' REPOS = 'repos'...
# -*- coding: utf-8 -*- import os import sys from pathlib import Path from pprint import pprint os.environ['CUDA_VISIBLE_DEVICES'] = '-1' # USE CPU import yaml import json import numpy as np import torch import tensorflow as tf from sklearn.preprocessing import StandardScaler sys.path.append('/home/ubuntu/tts-test...
import requests import time from bs4 import BeautifulSoup from pandas import DataFrame class Player: def __init__(self, name, team, champion, role, kills, deaths, assists, cs, gd_at_15): self.name = name self.team = team self.champion = champion self.role = role self.kills ...
"""Module to define a parent qtdesigner plugin class. Please continue to name your qtdesigner plugin modules using the convention modulename.py <--- defines the widget modulename_qtplugin.py <--- imports this module + the widget However, a majority of the builtin plugins are defined in qtplugins.py adjacent ...
"""Module containing a class to run a LakeShore 350 Cryogenic Temperature Controller in a pyqt5 application Classes: LakeShore350_ControlClient: a class for interfacing with a LakeShore350 temperature controller inherits from AbstractLoopClient """ import sys import os sys.path.append(os.path.dirname(...
from escpos.printer import Serial from tinydb import Query from datetime import datetime from trello import TrelloClient import tinydb.operations as tdbop from escpos import * from PIL import Image from time import sleep from emoji import demojize import random import pytz import os from text import * class printer: ...
#!/usr/bin/python import mimetypes import sys import tablib import tablib.core import csv import os from tablib.formats import ods from tablib.formats._ods import opendocument from tablib.formats._xls import xlrd from util.SBtab import misc def sheets(self): # Added to excess sheets of Databook return self._dat...
import time import datetime import sqlite3 from multiprocessing import Process import numpy as np from bokeh.embed import server_document from bokeh.server.server import Server from bokeh.themes import Theme import bokeh.io import bokeh.models import bokeh.plotting import bokeh.layouts import bokeh.driving import boa...
import py2700 as RM import time import math import CoolProp.CoolProp as CP import json from pathlib import Path import numpy as np # Global Settings Declarations REFERENCE_PRESSURE = 1.013 # bar MAX_PRESSURE = 59 # bar MIN_PRESSURE = -1 # bar def VoltageToPressure(voltage_reading: float, supply_voltage: float) ->...
import abc from inspect import getargspec from functools import wraps from copy import deepcopy from lizard.util.pretty_print import list_string_value from lizard.bitutil import copy_bits class HardwareModel(object): __metaclass__ = abc.ABCMeta def __init__(s, interface): s.interface = interface s.model...
import datetime as dt import pymms from pymms.sdc import mrmms_sdc_api as sdc from pymms.sdc import selections as sel from metaarray import metabase, metaarray, metatime from matplotlib import pyplot as plt import pathlib def time_to_orbit(time, sc='mms1', delta=10): ''' Identify the orbit in which a time fal...
#pylint: disable=too-few-public-methods import uuid import json import os import xml.etree.ElementTree class File(object): def __init__(self, name): self.name = name self.functions_found = 0 self.functions_hit = 0 self.branches_found = 0 self.branches_hit = 0 self.li...
#!/usr/bin/env python # -*- coding: UTF-8 -*- import os from bs4 import BeautifulSoup import requests import re import hashlib from urllib.parse import urlparse MESSAGES = { 'en': { 'broken_link': 'Cannot load content', 'not_supported': 'This content is not able to be viewed from within Kolibri', ...
from minigl import * import math import array, itertools # def use_pango_font(font, start, count, will_call_prepost=False): # import pango, cairo, pangocairo # fontDesc = pango.FontDescription(font) # a = array.array('b', itertools.repeat(0, 256*256)) # surface = cairo.ImageSurface.create_for_data(a, c...
from __future__ import division import numpy as np from cwc.data_wrappers import reject from cwc.evaluation.confidence_intervals import ConfidenceIntervals from sklearn.cross_validation import StratifiedKFold from sklearn.preprocessing import minmax_scale from sklearn import svm from sklearn.datasets import fetch_mlda...
#<NAME> #CNCS Capstone Spring 2020 #Cyberpatriot Practice Scoring Engine #import statements for necessary modules / libraries from flask import Flask, render_template from packaging.version import parse as parse_version import os, pwd, grp, subprocess import configparser #parses and reads config file config = config...
import paginate from flask import render_template, jsonify, flash, redirect, url_for, request from flask.views import MethodView from flask_login import login_required from paginate_sqlalchemy import SqlalchemyOrmWrapper from social_flask_sqlalchemy.models import UserSocialAuth from sqlalchemy import func, desc from we...
# Gravity Simulation Project # ---------------------------------------------------------------------------------------------------------------------- # This script is the one that should be ran in order to run the program. It is responsible for the whole GUI. import sys import simulation import scenarios import os imp...
# Generated from CSV.g4 by ANTLR 4.8 # encoding: utf-8 from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): with StringIO() as buf: buf.write("\3\u608b\ua72a\u8133\ub9ed\u417c\u3be7\u7786\u59...
# ---------------------------------------------------------------------------- # # TITLE - APOGEEMock.py # AUTHOR - <NAME> # # ---------------------------------------------------------------------------- '''APOGEEMock class tests''' ### Imports from apomock import APOGEEMock from apomock.util.util import chabrier_imf...
# Copyright (c) 2015, Intel Corporation # 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 notice, # this list of condit...
import abc import json import logging import os import numpy as np import tensorflow as tf def zip_weights(model, ckpt, variables_mapping, self_weight_names, **kwargs): weights, values = [], [] used_weights = [w for w in model.trainable_weights if w.name in self_weight_names] for w in used_weights: ...
# -*- coding: utf-8 -*- import os import pytest import numpy as np from ssqueezepy import ssq_cwt, issq_cwt, ssq_stft, issq_stft from ssqueezepy import cwt, icwt, stft, istft from ssqueezepy._stft import get_window from ssqueezepy.toolkit import lin_band try: from librosa import stft as lstft except Exception as e:...
import tensorflow as tf import numpy as np from ionotomo.settings import TFSettings def swap_axes(a,axis,start=0): """Swap axis *axis* of tensor *a* with location *start*""" nd = tf.size(tf.shape(a)) axis = tf.cond(tf.less(axis,0),lambda: nd + axis, lambda: axis) #perm is (axis, 1 ,...,axis-1, 0, axis...
import matplotlib.colors import numpy as np import xarray as xr from cartopy import crs as ccrs from matplotlib import pyplot as plt import matplotlib.patches as mpatches from confusion_matrix import plot_confusion_matrix from crop import crop_center, crop_2d def plot_results(x, y_true, y_pred, name, in_size, date,...
import argparse import subprocess import time import json from datetime import datetime, timedelta import pytz from prometheus_client import CollectorRegistry, Gauge, push_to_gateway registry = CollectorRegistry() bigtable_backup_job_last_run_seconds = Gauge('bigtable_backup_job_last_run_seconds', 'Last time a bigtab...
# Copyright (c) OpenMMLab. All rights reserved. import inspect from typing import Any, Callable, Dict, Optional, Sequence import torch from mmdeploy.core.rewriters import FUNCTION_REWRITER from mmdeploy.utils import IR, cfg_apply_marks, get_partition_config MARK_FUNCTION_COUNT = dict() def reset_mark_function_coun...
# existing markdown inlinePatterns # https://github.com/Python-Markdown/markdown/blob/2.6/markdown/inlinepatterns.py import re from markdown import util from markdown.extensions import Extension from markdown.inlinepatterns import AutolinkPattern, SimpleTagPattern, Pattern from python_markdown_slack.list_handler impo...
import argparse import time from copy import deepcopy from pathlib import Path import numpy as np import pandas as pd import sklearn import torch from torch.utils.data import DataLoader from tqdm import tqdm import qiqc from qiqc.datasets import load_qiqc, build_datasets from qiqc.preprocessing.modules import load_pr...
import os import io import sys from multiprocessing.dummy import Pool import pandas as pd from boxsdk import JWTAuth, OAuth2, Client from .memoizable import Memoizable from .config import LoadSettings config = LoadSettings() default_cache = config['root']['cache'] default_config = config['config_files']['box'] cla...
#Author-<NAME> #Description-Color holes by their size import os from random import random from pathlib import Path import adsk.core, adsk.fusion, adsk.cam, traceback import math import csv _app: adsk.core.Application = None _ui: adsk.core.UserInterface = None _handlers = [] _holes: list = None def loadHoles(): ...
import os import time from os import system import numpy as np import torch import torch.nn.functional as F from PIL import Image from torch.distributions import Normal from accel.agents.sac import SAC from accel.replay_buffers.replay_buffer import Transition def atanh(x): one_plus_x = (1 + x).clamp(min=1e-6) ...
""" Computes backward model scores. @author: JingyiGF """ from .toolkits import * from .family import * from .metrics import * from .solver import Solver import scipy.io def calc_xpr(y, yhat, nt): tpath = np.linspace(0, 1, nt) tp = np.zeros(nt) tn = np.zeros(nt) fp = np.zeros(nt) fn = np.zeros(nt...
from collections import defaultdict from gzip import open as gzip_open from pickle import dump, load from tables import ( Filters, Float32Col, HDF5ExtError, Int32Col, IsDescription, StringCol, open_file, ) from .get_vcf_info import get_vcf_info from .get_vcf_info_ann import get_vcf_info_an...
# Copyright 2018-2020 Xanadu Quantum Technologies 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...
import argparse import os import time import torch from tensorboardX import SummaryWriter from tqdm import tqdm from dataset import problem from utils.optimizer import LRScheduler from utils import utils def summarize_train(writer, global_step, last_time, model, opt, inputs, targets, optimizer, ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ TEST FOR QUADRATURE CONVERGENCE @author: jeguerra """ import pyshtools import numpy as np import math as mt from netCDF4 import Dataset import matplotlib.pyplot as plt from computeAreaIntegral import computeAreaIntegral import computeSphericalCartesianTransforms as sph...
"""Wrappers around various Win32 APIs debugging. Allows writing dump files, triggering debug breaks, detecting whether a debugger is attached and printing messages to the debugger. """ import os, sys, ctypes, msvcrt, threading class MiniDumpType: """MiniDump flags as defined on `MSDN <https://msdn.microsoft.com...
import osulib import osu.calc as oss import sqlite3 import utils as ut import os import requests import json import urllib.request from datetime import datetime from lxml import html, etree from PIL import Image with open("osutoken.txt", "r") as f: t = f.read().split(", ") osu = osulib.osu(t[0]) till = osulib.tiller...