text
stringlengths
6.04k
39.5k
import tensorflow as tf import os import sys import time import numpy as np import imgaug # https://github.com/aleju/imgaug (pip3 install imgaug) import cv2 from pycocotools.coco import COCO from pycocotools.cocoeval import COCOeval from pycocotools import mask as maskUtils import zipfile import urllib.request impor...
from __future__ import print_function, division #import sys #sys.path.append("../") import numpy as np import argparse from fabry.tools.file_io import h5_2_dict, dict_2_h5, prep_folder, read_Ld_results, read_finesse_results from fabry.tools.plotting import ringsum_click, my_hist, tableau20_colors import matplotlib.pypl...
##!/bin/python # index, search for these labels including hashes ### staticConfig ### mainFunctionDef ### subFunctions ### checkLinkPersistence ### mainFunctionRun ### dirList ######################## ### printHelp ### printConf ### includeConf ### testConf ### utilFunctions ### mainLoop ### staticConfig import os...
""" >>>>> CORP ENGINE <<<<< A free & open-source toolkit for making games in Python programming language. Made by @PyxleDev0 & Contributors https://github.com/pyxledev0/corp-engine https://github.com/pyxledev0/corp-engine-examples """ import pygame import time import sys import inspect import easygui from pygam...
#!/usr/bin/env python import os import sys import time import numpy as np import pandas as pd from pandas import ( DataFrame, Series ) import pims import trackpy as tp import warnings import cv2 import matplotlib.pyplot as plt import matplotlib.colors as colors import matplotlib.cm as cmx from mpl_toolkits.mpl...
import sys import os import traceback import time import json import boto3 from zipfile import ZipFile from pathlib import Path from botocore.exceptions import ClientError # # # main function # start of script to create resources def main(): print("") print("cloud-ppe-detection start up... (╯°□°)╯︵ ┻━┻") ...
# -*- coding: utf-8 -*- # https://jfricas.readthedocs.io # https://github.com/fricas/jfricas. ################################################################### # This file is one part of the FriCAS to Jupyter notebook bridge. It # implements an IPython kernel such that pressing SHIFT-ENTER in a # Jupyter notebook ce...
# coding: utf-8 # # Table des matières # * [1. Agrégation externe de mathématiques, texte d’exercice diffusé en 2012](#1.-Agrégation-externe-de-mathématiques,-texte-d’exercice-diffusé-en-2012) # * [1.1 Épreuve de modélisation, option informatique](#1.1-Épreuve-de-modélisation,-option-informatique) # * [1.2 *Proposi...
# coding=utf-8 # Copyright 2020 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...
from docx.shared import Inches, Mm, Pt import numpy as np from .plotting import plot_calibration_curve, plot_roc_curve, plot_precision_recall_curve, \ plot_confusion_matrix, plot_histogram, plot_param_metric_relation from .metrics import get_metric, func_neg_score, is_loss_metric from docx.oxml.ns import nsdecls fr...
# Copyright 2020 AI2Business. 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 ...
import asyncio from pprint import pprint from aioupbit import UpbitRest UPBIT_API_KEY = '<KEY>' UPBIT_API_SECRET = '<KEY>' async def get_markets(): """ 마켓 코드 조회 https://docs.upbit.com/v1.0/reference#%EB%A7%88%EC%BC%93-%EC%BD%94%EB%93%9C-%EC%A1%B0%ED%9A%8C response: [{'english_name': 'Bitcoin', ...
import os.path from os import listdir import re from collections import OrderedDict, deque, Sequence import logging import warnings try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest default_tokenizer = re.compile(r'\S+\s*') class ToolboxError(Except...
""" doctest for these functions >>> int16('deadbeef') 3735928559 >>> int16('0xdeadbeef') 3735928559 >>> int8('7654') 4012 >>> int2('11010110110') 1718 >>> int16_ex('deadbeef') 3735928559 >>> int16_ex(b'deadbeef') 3735928559 >>> int16_ex(b'0xdeadbeef') 3735928559 >>> int8_ex(b'7654') 4012 >>> int2_ex(b'110101101...
import re import boto3 import logging import requests from datetime import datetime, timezone, timedelta from botocore import UNSIGNED from botocore.client import Config from time import sleep from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from indra import get_config, has_config from indra.util...
import bisect import math import numpy as np import audiomate from audiomate import containers from audiomate import processing from . import iterator class Dataset: """ An abstract class representing a dataset. A dataset provides indexable access to data. An implementation of a concrete dataset should ...
import glob import os import pickle import matplotlib.pyplot as plt import numpy as np import pandas as pd from matplotlib.patches import Rectangle from scipy.optimize import curve_fit from scipy.signal import savgol_filter import blitzcurve.utils as utils from blitzcurve.utils import setup_matplotlib_dark_background, ...
# code adapted from: # https://github.com/kakaobrain/fast-autoaugment # https://github.com/rpmcruz/autoaugment import math import random import numpy as np from collections import defaultdict import PIL, PIL.ImageOps, PIL.ImageEnhance, PIL.ImageDraw from PIL import Image random_mirror = True RESAMPLE_MODE=Image.BICU...
import logging import paramiko import requests import asyncio import aiohttp import sys import telnetlib from io import StringIO from os import getcwd, chdir, popen from threading import Thread from time import sleep from typing import Any, Dict, List from socketserver import BaseRequestHandler from urllib3.exceptions ...
# Copyright (c) 2015, <NAME> # See LICENSE file for details: <https://github.com/moble/scri/blob/master/LICENSE> from math import sqrt import numpy as np import quaternion from spherical_functions import ladder_operator_coefficient as ladder from spherical_functions import clebsch_gordan as CG from . import jit @j...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Name: csv_plot_heatmap.py # Description: # # Author: m.akei # Copyright: (c) 2020 by m.na.akei # Time-stamp: <2020-08-30 09:56:44> # Licence: # Copyright (c) 2021 <NAME> # # Thi...
import networkx as nx from networkx.algorithms.link_analysis.pagerank_alg import pagerank_numpy from networkx.algorithms.centrality import degree_centrality, closeness_centrality, betweenness_centrality from typing import Sequence, Dict from gowpy.gow.builder import GoWBuilder, Tokenized_document from gowpy.gow.typin...
from __future__ import annotations from typing import List import yaml import json from logger import logger from common_utils.file_utils import file_exists from common_utils.path_utils import get_extension_from_path, rel_to_abs_path from common_utils.check_utils import check_required_keys, check_type, \ check_typ...
import networkx as nx import logging from KEGGutils.KEGGutils import get_nodes_by_nodetype, populate_graph, connected_components,\ linked_nodes, graph_measures, projected_graph, get_unique_nodetypes, draw, neighbor_graph from KEGGutils.KEGGapi import keggapi_link, keggapi_info from KEGGutils.KEGGerrors import KEGGData...
__version__ = '0.7.2' from typing import List, Optional import torch import torch.nn as nn def logsumexp(tensor: torch.Tensor, dim: int = -1, keepdim: bool = False) -> torch.Tensor: """ A numerically stable computation of logsumexp. This is mathematically equivalent to `tensor.exp().sum(dim, keep=keepdi...
#!/usr/bin/python3 #-*- coding: utf-8 -*- import os import json import sys from UIBox import pkg, dialog, item from PyQt5.QtGui import QFont, QIcon from PyQt5.QtCore import QEvent, QObject, QRunnable, QSize, QThreadPool, Qt, pyqtSignal, pyqtSlot from PyQt5.QtWidgets import QAction, QApplication, QSizeGrip, QStackedWi...
# from comet_ml import Experiment import yaml import urllib import pandas as pd import torch.autograd as autograd import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F import torch.backends.cudnn as cudnn import torchvision import torchvision.transforms as transforms import argp...
from coroweb import get, post from models import User, Blog, Comment, next_id from orm import select from config import configs import asyncio from apis import get_page_index, Page, APIError, APIValueError, APIResourceNotFoundError, APIPermissionError from aiohttp import web from sqlite3 import Error import json import...
import numpy as np import matplotlib import matplotlib.pyplot as plt def setup_axes(figure_id, clear_figure=True): # interactive mode on plt.ion() # a new figure is created... fig = plt.figure(figure_id) # ...and, if requested,... if clear_figure: # ...cleared, just in case this method is called several ...
# -*- coding: utf-8 -*- """ fungiform.widgets ~~~~~~~~~~~~~~~~~ The widgets. :copyright: (c) 2010 by the Fungiform Team. :license: BSD, see LICENSE for more details. """ from itertools import chain from fungiform.utils import make_name, _force_dict, _make_widget,\ _val...
""" clictagger.taggedtext: Region-tag text ************************************** The TaggedText class is the main python interface to clictagger. You can use it to import a string of text, and print out a summary of regions:: >>> from clictagger.taggedtext import TaggedText >>> tt = TaggedText(''' ... Th...
import threading import json import logging import os import io import re import signal import socket import time import datetime import inspect from collections import OrderedDict import traceback import boto3 import botocore import numpy as np SIMAPP_VERSION="2.0" DEFAULT_COLOR="Black" SIMAPP_SIMULATION_WORKER_EXCE...
import cv2 import numpy as np from scipy.interpolate import interp2d from sklearn.decomposition import PCA, IncrementalPCA import xarray as xr import numpy as np import uuid from pathlib import Path from ..core.utilities import * from ..core.progressbar import * from .missing_values import * def regrid(X, lons, lats,...
from __future__ import division import warnings, re import keras.backend as K from keras.models import Model from keras.layers import Lambda, Input, Layer, Dense from keras.utils.vis_utils import plot_model from rl.core import Agent from rl.policy import EpsGreedyMQPolicy, GreedyMQPolicy from rl.util import * from PI...
import torch import torch.nn as nn from models import TextModels import argparse import sys import tqdm import numpy as np from itertools import combinations,permutations import time import random from torchvision.datasets import MNIST from sklearn.metrics import mean_absolute_error, mean_squared_error import json impo...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math import numpy as np import cv2 import matplotlib.pyplot as plt from torc...
# test_sampling.py # -*- coding: utf8 -*- # vim:fileencoding=utf8 ai ts=4 sts=4 et sw=4 # Copyright 2009 SKA South Africa (http://ska.ac.za/) # BSD license - see COPYING for details """Tests for the katcp.sampling module. """ import unittest2 as unittest import threading import time import logging import katcp imp...
# coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors and the HuggingFace Datasets 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/LI...
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at: # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
from camera_mat_distortion import * from color_trans_gradients import * from perpective_transform import * import numpy as np import cv2 import glob import matplotlib.pyplot as plt import pickle # Loading camera calibration cameraCalibration = pickle.load(open('serialized_camera_data/camera_calibration.p', 'rb')) mtx...
from data_loader import * from scipy import spatial from copy import deepcopy import time from open3d import * import matplotlib.pyplot as plt from sklearn.metrics import mean_squared_error import math from copy import deepcopy from openmesh import * import colorsys params = [0.03,0.15,0.02,0.01,0.008] def invKernel(p...
# Sample code implementing LeNet-5 from <NAME> import tensorflow as tf import numpy as np import time import h5py import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt from sklearn.metrics import confusion_matrix import itertools from copy import deepcopy import os import os.path # from tensorflow...
import numpy as np import torch from torch.autograd import Variable from rl.envs import create_sc2_minigame_env from rl.envs import GameInterfaceHandler from rl.model import FullyConv from rl.a3c.summary import Summary from rl.utils.gpu import cuda def ensure_shared_grads(model, shared_model, gpu_id): """ ensure...
from typing import Any, Tuple, List import os from os.path import join from pathlib import Path from sys import stderr import time from torch.utils.data import DataLoader from torch import nn import torch from pprint import pprint import warnings warnings.filterwarnings("ignore") import pytorch_lightning as pl warnin...
from screen import * import abc import os WHITE_PIECES_PATH = os.path.join(PICTURES_PATH, 'white_pieces') BLACK_PIECES_PATH = os.path.join(PICTURES_PATH, 'black_pieces') class Piece(metaclass=abc.ABCMeta): BASIC_SCORE = 0 SCORE_EVOLUTION_TABLE = None def __init__(self, square, team): self.image ...
from globals import * import libtcodpy as tcod import graphics as gfx import life as lfe import render_los import bad_numbers import weather import alife import items import tiles import maps import logging import random import numpy import time import sys def register_effect(effect): effect['id'] = str(WORLD_INFO...
import asyncio import websockets import json import os import base64 from pathlib import Path from PIL import Image import base64 import copy # const DEF_IMG_LOC = 'DEFAULTS/DEF_PROFILE.jpg' DEF_PROF_LOC = 'DEFAULTS/def_user.png' ESSAY_LOC = 'essays' USER_DIR = 'user_data' FEED_FILE = 'feed.txt' SRC_FILE = 'src.txt' F...
from os import truncate from pygame.version import PygameVersion try: import os import sys import time import pyfiglet import dealer import copy import pygame from pygame.locals import * import random except: if os.name == 'nt': os.system('python -m pip ...
import tensorflow as tf import numpy as np import os import time import datetime import data_helpers from text_cnn import TextCNN from tensorflow.contrib import learn import word2vec_helpers from tensorflow.python.framework import ops import math import chocolate as choco import matplotlib.pyplot as plt im...
# Original work Copyright 2020, Ubiquitous Knowledge Processing (UKP) Lab, Technische Universität Darmstadt from collections import defaultdict import json from tqdm import tqdm import nltk from nltk.corpus import stopwords from collections import Counter from copy import deepcopy import argparse from datetime import ...
''' Translate input text with trained model. ''' import torch import torch.utils.data import argparse from tqdm import tqdm import os,json from models import get_model from misc.run import get_loader, run_eval, get_forword_results from sklearn.decomposition import PCA from sklearn import manifold import numpy as np im...
#!/usr/bin/python -O ############################################################################ # Copyright (c) 2015-2017 Saint Petersburg State University # Copyright (c) 2011-2015 Saint Petersburg Academic University # All Rights Reserved # See file LICENSE for details. ############################################...
import argparse from pylab import * import os import audio_utilities from mpl_toolkits.axisartist.parasite_axes import HostAxes, ParasiteAxes import matplotlib.pyplot as plt def getM(txtdir): ''' to get M feature map :param txtdir: str, lastm.txt, in K*T shape :return: dimMeans(K-dim),frameMeans(T-dim)...
from m5ui import * import utime as time import random clear_bg(0x111111) rgb = RGB_Bar() btnA = M5Button(name="ButtonA", text="ButtonA", visibility=False) btnB = M5Button(name="ButtonB", text="ButtonB", visibility=False) btnC = M5Button(name="ButtonC", text="ButtonC", visibility=False) ##############################...
# -*- coding: utf-8 -*- # <NAME>, <NAME>oningDHV # <NAME>, Deltares import matplotlib.patheffects as PathEffects from matplotlib import pyplot as plt from matplotlib import transforms import numpy as np from collections import namedtuple import logging import os class CrossSectionPlot(object): Extension = named...
""" Instaclone main library. """ from __future__ import print_function __author__ = 'jlevy' import logging as log import re import sys import os from enum import Enum # enum34 # The subprocess module has known threading issues, so prefer subprocess32. try: import subprocess32 as subprocess except ImportError: ...
import requests, re, codecs, pickle import numpy as np from functools import reduce def getbdays(month=3, day=6): """Exctrats the Births section from the saved page Keyword Arguments: month -- Month. (default 3 or March) day -- Day. (default 6) """ # Read page contents from file file_he...
#!/usr/bin/python # Dependencies from the python standard library: from pathlib import Path import shutil # For copying files import subprocess # For calling ffmpeg to make animations import urllib.request # For downloading raw data import zipfile # For unzipping downloads # You can use 'pip' to ...
# Copyright (c) 2020 NVIDIA CORPORATION. # Copyright (c) 2018-2020 <NAME> (<EMAIL>). # # 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 ri...
import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse # import matplotlib.transforms as transforms import matplotlib.cm as cm from mpl_toolkits.mplot3d import Axes3D from core import utils import scipy.io as sio #import torch from scipy.stats import multivariate_normal from...
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
import torch from torchtext.data import Field, NestedField, Dataset class BPTTField(Field): def __init__(self, bptt_length=20, **kwargs): super(BPTTField, self).__init__(sequential=True, batch_first=True, **kwargs) self._bptt_length = bptt_length def pad(self, minibatch): """Pad a bat...
""" Determine the force required to open hatches and ramps """ __author__ = 'ab27' import itertools, logging, os, sys import _winreg import numpy as np import matplotlib.pyplot as plt from matplotlib.tri import Triangulation from matplotlib.ticker import NullFormatter from part_info import Hatch_Info, S...
""" Detect variants in reads. """ import logging from collections import defaultdict, Counter from typing import Iterable, Iterator, List from .core import Read, ReadSet from .bam import SampleBamReader, MultiBamReader from .align import edit_distance, edit_distance_affine_gap from ._variants import _iterate_cigar l...
import ConfigParser import logging import logging.config import os import StringIO import sys import tempfile import time import uuid job_type = None logger = None def _prepend_env_paths(content, names): """ E.g. names = ['PATH', 'PYTYHONPATH'] content = echo hi => export PAT...
# -*- coding: utf-8 -*- """ Created on Wed Nov 25 07:34:12 2020 @author: Mehak Models """ import tensorflow as tf from tensorflow.keras.initializers import RandomNormal from tensorflow.keras import Model from tensorflow.keras import Input from tensorflow.keras.layers import Conv2D from tensorflow.keras.layers impor...
import torch.nn.functional as F from typing import List, Dict, Tuple, Optional from fvcore.nn import smooth_l1_loss, sigmoid_focal_loss, giou_loss import math import numpy as np import torch from torch import nn from torchvision.ops import nms from detectron2.layers import ShapeSpec, cat, batched_nms from detectron2.s...
import matplotlib.pyplot as plt import numpy as np import scipy.optimize as opt import math import csv def sample_stdev(data): return np.std(data, ddof = 1, axis = -1) def standard_error(data): return sample_stdev(data) / np.sqrt(len(data) if data.ndim == 1 else len(data[0])) def data_statistics(data): ...
# -*- coding: utf-8 -*- # --- # jupyter: # jupytext: # cell_metadata_filter: -all # comment_magics: true # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.11.3 # kernelspec: # display_name:...
from django.conf import settings from django.db import models from django.db import transaction from django.db.utils import IntegrityError from django.core.exceptions import ObjectDoesNotExist from django.urls import reverse from django_bulk_update.manager import BulkUpdateManager from caching.base import CachingManage...
# Copyright 2015 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 a...
import torch import torch.nn as nn import spconv from spconv.modules import SparseModule import functools from collections import OrderedDict import sys sys.path.append('../../') from lib.pointgroup_ops.functions import pointgroup_ops from util import utils import numpy as np class ResidualBlock(Sparse...
""" Tests for lumpy.py. """ import os import tempfile from Bio import SeqIO from Bio.Alphabet import generic_dna from Bio.SeqFeature import FeatureLocation from Bio.SeqFeature import SeqFeature from django.conf import settings from django.test import TestCase import vcf from main.models import AlignmentGroup from ma...
import argparse import gc import logging import os import pathlib import sys from collections import defaultdict import torch import torch.nn as nn import torch.optim as optim from tensorboardX import SummaryWriter from cnn.model_cnn import TrajEstimator from cnn.model_cnn_moving_threshold import TrajEstimatorThresho...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os, sys, argparse import cv2 from PIL import Image import numpy as np import time from timeit import default_timer as timer from tensorflow.keras.models import Model, load_model import tensorflow.keras.backend as K from hourglass.model import get_hourglass_model fr...
"""This module contains auxiliary functions for plotting which are used in the main notebook.""" import numpy as np import pandas as pd import pandas.io.formats.style import seaborn as sns import statsmodels as sm import statsmodels.formula.api as smf import statsmodels.api as sm_api import matplotlib.pyplot as plt im...
# language-learning/src/grammar_learner/incremental_clustering.py # 190409 import sys, time, getopt, os, platform, json, traceback, logging from copy import copy from shutil import copy2 as file_copy from ..common import handle_path_string from .utl import kwa, UTC, test_stats, sec2string from .read_files import ...
#!/usr/bin/env python from __future__ import print_function import argparse import sys import networkx as nx import re import numpy as np import itertools _s = re.compile('\s+') _p = re.compile('(\d+)\s+(\d+)') def lsqp(atoms): com = atoms.mean(axis=0) #u, d, v = np.linalg.svd(atoms-com) axes = np.zeros(...
# Copyright (C) 2021 # Author: <NAME> <<EMAIL>> # License: new BSD """ Implements the `termynal` directive for Jupyter Book and Sphinx. """ import os import sys import yaml from docutils import nodes from docutils.parsers.rst import Directive, directives import sphinx_term DEPENDENCIES = { # See sphinx_term/_stati...
# Lint as: python3 # Copyright 2021 Shortest Path RL 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 applica...
# Copyright 2018 The GamePad 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 applicable...
import secrets from pprint import pprint from typing import List, Dict, Optional, Tuple import gym import numpy as np from gym import spaces from collections import defaultdict from game_engine import Agent from gym_checkers.engine import N_ROWS, N_COLS, N_ACTIONS, get_offset_from_tuple, get_tuple_from_offset, tuple_...
from __future__ import print_function import time import numpy as np import tqdm import global_vars as Global from datasets import MirroredDataset from utils.iterative_trainer import IterativeTrainerConfig from utils.logger import Logger from termcolor import colored from torch.utils.data.dataloader import DataLoade...
import time import math import torch import torch.nn as nn import torchvision.models as models import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence import tensorflow as tf import numpy as np import torchvision device = torch.device("cuda" if torch.cuda.is_available() else "c...
# Copyright 2015 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 ...
# Copyright 2021- imbus AG # # 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 writi...
import string import numpy import six import cupy from cupy import carray from cupy import cindexer from cupy import internal from cupy import util @util.memoize(for_each_device=True) def _get_simple_elementwise_kernel( params, operation, name='kernel', options=(), preamble='', loop_prep='', after_l...
import numpy as np import matplotlib.pyplot as plt from IPython.core.display import display, HTML import pyspark.sql.functions as sparkfunc import pyspark.sql.types as pyspark_types from functools import partial def get_separated_times_mask(times, min_dt=0.5): """Get a mask that only selects observations that a...
# --- built in --- import abc import math from typing import ( Any, Dict, Iterable, List, Optional, Tuple, Union ) import collections # --- 3rd party --- import numpy as np # --- my module --- from rlchemy.lib import utils as rl_utils from rlchemy.lib.data.utils import RelativeIndex from...
""" Tests for the functions in equilibrium_comp.py. Authors: <NAME> (<EMAIL>) Copyright (c) <NAME> """ import ns_eos.equilibrium_comp as ec import numpy as np import pytest TOL = 1e-5 @pytest.fixture() def test_case_1(): data = {"muon_eqn_const": 0.029956297154719348, "n_e": 0.001, "n_mu": 0.0} ...
"""Library for power logging.""" from __future__ import annotations from dataclasses import dataclass from glob import glob from typing import Callable, Dict, List, NamedTuple, Optional import base64 import math import os import queue import sys import time from serial.threaded import Packetizer, ReaderThread #type:ign...
#!/usr/bin/env python3 import syd import sys from tqdm import tqdm from datetime import datetime from datetime import timedelta from box import Box import numpy as np from .syd_helpers import * import pydicom import difflib import itk import syd.syd_algo.stitch_image as sti ### Patient ### def guess_or_create_patient...
#Copyright 2020 <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 # https://www.apache.org/licenses/LICENSE-2.0 #Unless required by applicable law or agreed to in writing, software #dis...
import pandas as pd import numpy as np from abc import ABC def _combineStrategies( df, buy_strategies, buy_weights, sell_strategies, sell_weights, buy_threshold, sell_threshold, ): # deprecated """ Combines given strategies into one, based on given weights and thresholds, work...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import struct import hashlib import imp import random from re import findall from Peach.mutator import * from Peach.Engi...
from skimage.filters import threshold_triangle, threshold_yen, threshold_otsu, threshold_local from skimage.util import img_as_ubyte import numpy as np import cv2 import os from exception import SignatureException class SignatureExtractor: def __init__(self, lang="cro", verbose=0, img_name=None): assert ...
""" author: <NAME> email: <EMAIL> Based on the stardust fitting results in the <files> list, plot the data points in the SFR-M* space and the ΔMS-redshift space. """ from astropy.io import fits from matplotlib import pyplot as plt from os import mkdir from os.path import isdir from typing import Union import numpy a...
import os import numpy as np import pandas as pd from shapely.geometry import MultiPolygon from shapely.geometry import Polygon from shapely.geometry import Point import geopandas as geopd import src.utils.make_config as make_config import src.data.access as data_access def haversine(lon1, lat1, lon2, lat2):...
#!/usr/bin/env python3 """ Tool for detecting DNA base-modifications from kinetic signatures. """ import cProfile import functools import gc import itertools import argparse import json import os import logging import sys import multiprocessing import time import threading import numpy as np import queue import trac...
from ast import arg from models.nets.net import * from torch import optim import numpy as np import cv2 import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models as models from torch.cuda.amp import autocast, GradScaler from random import randint from types import MethodType,FunctionT...