text
string
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: <NAME> # # Created: 24/07/2019 # Copyright: (c) <NAME> 2019 # Licence: <your licence> #------------------------------------------------------------------------------- import seri...
<gh_stars>1-10 #!/usr/bin/env python from pyNBS import data_import_tools as dit from pyNBS import network_propagation as prop from pyNBS import pyNBS_core as core from pyNBS import pyNBS_single from pyNBS import consensus_clustering as cc from pyNBS import pyNBS_plotting as plot import os import time import numpy as np...
<gh_stars>0 # This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, <NAME> and <NAME>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1....
import logging import sys import numpy as np import scipy as sp import scipy.sparse from openpnm.solvers import IterativeSolver logger = logging.getLogger(__name__) try: import petsc4py # Next line must be before importing PETSc petsc4py.init(sys.argv) from petsc4py import PETSc except ModuleNotFoundErr...
<reponame>LawrenceDior/thetis """ Test GridInterpolator object """ from thetis.interpolation import GridInterpolator import numpy as np from scipy.interpolate import griddata import pytest def do_interpolation(dataset='random', plot=False): """ Compare GridInterpolator against scipy.griddata """ np.r...
<gh_stars>10-100 from numpy import (array, zeros, floor, sqrt, dot, arange, hanning, sin, pi, linspace, log10, round, maximum, minimum, sum, cos, spacing, diag, correlate, argmax, mean, exp, log, ceil) from numpy.fft import fft from scipy.signal import filtfi...
from typing import Any from typing import Dict from typing import Union import numpy as np import pandas as pd from scipy.sparse import issparse from scipy.stats import ks_2samp from sklearn.utils import check_random_state from sklearn.utils import safe_indexing from .base import BaseSelector from .base import ONE_D...
<reponame>Claybarn/permute import sys import pytest import numpy as np from scipy.stats import hypergeom, binom from cryptorandom.cryptorandom import SHA256 from cryptorandom.sample import random_sample, random_permutation from ..utils import (binom_conf_interval, hypergeom_conf_interval, ...
import networkx as nx import time import math from scipy import sparse from gisele.functions import * from gisele.Steiner_tree_code import * def steiner(geo_df, gdf_cluster_pop, line_bc, resolution,Rivers_option, branch_points=None): if branch_points is None: branch_points = [] print("Running the St...
<gh_stars>0 import logging from typing import Dict, List, Iterable, Tuple, Any, Optional from overrides import overrides from pytorch_pretrained_bert.tokenization import BertTokenizer from allennlp.common.file_utils import cached_path from allennlp.data.dataset_readers.dataset_reader import DatasetReader from...
import numpy as np from qtpy import QtWidgets, QtCore, QtGui import skimage.filters import flika flika_version = flika.__version__ from flika import global_vars as g from flika.process.BaseProcess import BaseProcess from flika.window import Window from flika.process import generate_random_image from scipy import ndimag...
import matplotlib.pyplot as plt import matplotlib.image as mpimg #from mpl_toolkits.mplot3d import Axes3D import scipy.io as sio import scipy.misc from scipy import ndimage import numpy as np import numpy.linalg as linalg from PolyMesh import * from LaplacianMesh import * from OpenGL.arrays import vbo from OpenGL.GL im...
import argparse import Bio.SeqIO from collections import OrderedDict import hdbscan import matplotlib.pyplot as plt import numpy as np import pandas as pd import re from scipy.spatial.distance import squareform, pdist import seaborn as sns from sklearn.decomposition import PCA from sklearn.manifold import TSNE, MDS im...
from sympy.core import Basic, S, sympify, Expr, Rational, Symbol from sympy.core import Add, Mul from sympy.core.cache import cacheit from sympy.core.compatibility import cmp_to_key class Order(Expr): """ Represents O(f(x)) at the point x = 0. Definition ========== g(x) = O(f(x)) as x->0 if and ...
<reponame>benjaminmcdonald/sympy # -*- coding: utf-8 -*- import sympy from sympy.core import Dummy, Wild, S from sympy.core.numbers import Rational from sympy.functions import sin, cos, binomial from sympy.core.cache import cacheit # TODO add support for tan^m(x) * sec^n(x) # TODO sin(a*x)*cos(b*x) -> sin((a+b)x) + s...
<reponame>jake-is-ESD-protected/scipy<filename>scipy/sparse/linalg/_eigen/tests/test_svds.py import re import copy import numpy as np from numpy.testing import assert_allclose, assert_equal, assert_array_equal import pytest from scipy.linalg import hilbert, svd from scipy.sparse import csc_matrix, isspmatrix from sci...
from typing import List, Tuple, Dict import copy import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as spla def gen_seeds(size: int = None) -> np.ndarray: max_uint32 = np.iinfo(np.uint32).max return np.random.randint( max_uint32 + 1, size=size, dtype=np.uint32) def exclude_i...
from .evaluate import evaluate, evaluate_predictions from .predict import predict, extract_readout from .train import train from chemprop.args import TrainArgs from chemprop.constants import MODEL_FILE_NAME from chemprop.data import get_class_sizes, get_data, MoleculeDataLoader, MoleculeDataset, set_cache_graph, split_...
import numpy as np import pandas as pd import matplotlib.pyplot as plt from scipy import fftpack from scipy.integrate import cumtrapz import numbers class Quaternion: def __init__(self, w, x=None, y=None, z=None): q = [] if isinstance(w, Quaternion): q = w.q elif isinstance(w...
<reponame>AsRaNi1/sympy """Tools and arithmetics for monomials of distributed polynomials. """ from itertools import combinations_with_replacement, product from textwrap import dedent from sympy.core import Mul, S, Tuple, sympify from sympy.polys.polyerrors import ExactQuotientFailed from sympy.polys.polyutils impor...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> from __future__ import division import os, os.path import sys sys.path.append('/home/will/PySeqUtils/') from collections import Counter os.chdir('/home/will/HIVCpG/') from GeneralSeqTools import fasta_reader # <codecell> from itertools import izip, tee...
""" - Created By <NAME> in 2019 - This algorithm has the assumption that all features in a dataset is independent and each feature has a Gaussian Distribution - Bays Theorem: P(target|(x1..xn)) = P((x1...xn)|target) * P(target)/ P((x1...xn)) - P(target|(x1..xn)): priority probability - P((x1...xn)|target): likelihood g...
import numpy as np from astropy.io import fits from astropy.table import Table, vstack import os from scipy import optimize, stats import argparse import time import multiprocessing as mp import logging, traceback import sys from logllh_ebins_funcs import get_cnt_ebins_normed, log_pois_prob from ray_trace_funcs import...
<filename>dvh/modules/main/correlation.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ All Correlation tab objects and functions for the main DVH Analytics bokeh program Created on Sat Nov 3 2018 @author: <NAME>, PhD """ from future.utils import listitems from bokeh.models import Legend, CustomJS, HoverTool, Chec...
<filename>src/recommenders/preprocess2sparse.py # https://udemy.com/recommender-systems # https://deeplearningcourses.com/recommender-systems from __future__ import print_function, division from builtins import range, input # Note: you may need to update your version of future # sudo pip install -U future import numpy...
<gh_stars>0 import os import sys import time import logging import traceback import functools import numpy as np lib_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)),'lib') def exception_handler(exc_type, exc_value, exc_traceback): """Print exception with a logger.""" # Do not print traceback i...
<gh_stars>1000+ import os os.environ['OMP_NUM_THREADS'] = '1' import dgl import sys import numpy as np import time import socket from scipy import sparse as spsp from numpy.testing import assert_array_equal from multiprocessing import Process, Manager, Condition, Value import multiprocessing as mp from dgl.heterograph_...
<filename>_bak/more/test1.py<gh_stars>10-100 from scipy import signal import matplotlib.pyplot as plt import numpy as np t = np.linspace(1, 201, 200, endpoint=False) sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2) widths = np.arange(1, 31) cwtmatr = signal.cwt(sig, signal.ricker, widths) plt.imshow...
""" This file is part of the accompanying code to our manuscript: <NAME>., <NAME>., <NAME>., and <NAME>.: A note on leveraging synergy in multiple meteorological datasets with deep learning for rainfall-runoff modeling, Hydrol. Earth Syst. Sci. Discuss., https://doi.org/10.5194/hess-2020-221, in review, 2020. You sho...
<filename>scripts/depth_TPFD_ins.py<gh_stars>1-10 #!/usr/bin/env python # this script goes through a simulation set and for every detected position made by the transposon caller outputs the interval 20 bp upstream and downstream of that position # with the average coverage acorss that interval and wherther the call wa...
<filename>astropy/convolution/convolve.py # Licensed under a 3-clause BSD style license - see LICENSE.rst import warnings import os import ctypes from functools import partial import numpy as np from numpy.ctypeslib import ndpointer, load_library from .core import Kernel, Kernel1D, Kernel2D, MAX_NORMALIZATION from ...
from sympy import Derivative from sympy.core.function import UndefinedFunction, AppliedUndef from sympy.core.symbol import Symbol from sympy.interactive.printing import init_printing from sympy.printing.conventions import split_super_sub from sympy.printing.latex import LatexPrinter, translate from sympy.printing.prett...
import numpy as np import matplotlib.pyplot as plt import astropy.units as au import astropy.constants as ac import xarray as xr from scipy.interpolate import interp1d from scipy.stats import poisson import logging class TigressWindModel(object): """TIGRESS Wind Launching Model class Parameters --------...
#------------------------------------------------------------------------------ # Plotting.py # # Create publication-ready 3D and 2D plots using matplotlib # # # Created: 4/4/18 - <NAME> -- <EMAIL> # # Modified: # * 4/4/18 - DMN -- <EMAIL> # - Added documentation for this script # #-----------------------...
######################################################################################## ## ## ## THIS LIBRARY IS PART OF THE SOFTWARE DEVELOPED BY THE JET PROPULSION LABORATORY ## ## IN THE CONTEXT OF THE GPU ACCELERATED FLEXIBLE RA...
<reponame>atn832/model-analysis<filename>tensorflow_model_analysis/slicer/auto_slicing_util.py # Lint as: python3 # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
# Solution: import pandas as pd import numpy as np class NullModel: """ Class used as baseline model for both regression and classification Attributes ---------- target_type : str Type of ML problem (default regression) y : Numpy Array-like Target variable pred_value : Floa...
import numpy as np import numpy.random as npr import matplotlib.pyplot as plt from scipy.stats import mvn from LaTeXPy import latexify def func(U, epsilon): # Computes the prob any (U_i) is less than epsilon ind = np.any(U < epsilon, axis = 1) return ind def quant(X, alpha): G = np.sort(X) size =...
<gh_stars>0 """ProDy is a package for Protein Dynamics, Sequence, and Structure Analysis""" __version__ = '2.1.1' __release__ = __version__ # + '-dev' # comment out '-dev' before a release import sys import warnings if sys.version_info[:2] < (2, 7): sys.stderr.write('Python 2.6 and older is not supported\n') ...
# Copyright 2018-2021 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...
<reponame>rdarie/statsmodels """ Notes ----- Code written using below textbook as a reference. Results are checked against the expected outcomes in the text book. Properties: Hyndman, <NAME>., and <NAME>. Forecasting: principles and practice. OTexts, 2014. Author: <NAME> Modified: <NAME> """ from statsmodels.compat.p...
<reponame>KiLJ4EdeN/COVID_WEB from sklearn.model_selection import cross_val_score, StratifiedKFold import numpy as np from bayes_opt import BayesianOptimization from warnings import simplefilter from scipy.io import loadmat FV = loadmat('features.mat') X = FV['data'] Y = FV['labels'] Y = Y.transpose() def svm_evaluat...
<reponame>GabrielJie/psydac # coding: utf-8 # # Copyright 2018 <NAME>, <NAME> import numpy as np from collections import OrderedDict from scipy.sparse import bmat from psydac.linalg.basic import VectorSpace, Vector, LinearOperator, Matrix __all__ = ['ProductSpace', 'BlockVector', 'BlockLinearOperator'...
"""core analysis functions for Flydra tracked data files""" from __future__ import division import tables # pytables files stored using Numeric would by default return Numeric-based results. # We want to force those results to be returned as numpy recarrays. # Note that we need to keep "python" in the flavors list, o...
<reponame>fraunhoferhhi/CuriouslyEffectiveIQE import argparse import os import glob import zipfile import rarfile import sys import shutil from shutil import copyfile import numpy as np import PIL.Image as Image import pandas as pd from scipy.io import loadmat from skimage.metrics import mean_squared_error from tqdm ...
# -*- coding: utf-8 -*- """Combining multiple clusterings using evidence accumulation (EAC). """ # Author: <NAME> <<EMAIL>> # License: BSD 2 clause import warnings import numpy as np from scipy.cluster.hierarchy import fcluster from scipy.cluster.hierarchy import linkage from sklearn.utils import check_array from skl...
<gh_stars>10-100 # -*- coding: utf-8 -*- """ This file contains the PyTorch dataset for hyperspectral images and related helpers. """ import spectral import numpy as np import torch import torch.utils import torch.utils.data import os from tqdm import tqdm from scipy.linalg import sqrtm try: # Python 3 from url...
<filename>skellam_reg/__init__.py #!/usr/bin/env python import numpy as np from scipy.optimize import minimize from metrics import SkellamMetrics import warnings from scipy.stats import skellam from shared_utils import ArrayUtils class SkellamRegression: def __init__(self, x, y, l0, l1, add_intercept=True): ...
# -*- coding: utf-8 -*- # Copyright (c) 2013 <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, modify, merg...
from scipy.optimize import fsolve import numpy as np US_dist = [0.2837, 0.3451, 0.1507, 0.1276, 0.0578, 0.0226, 0.0125] def match_r(r, target_prevalence, household_dist, SAR): # computes probability of a primary case given population level prevalence, household size distribution, # and household secondary at...
<reponame>strawlab/flyvr<filename>src/freemovr_engine/calib/imgproc.py import time import math import numpy as np import scipy.ndimage import cv2 import traceback class DotBGFeatureDetector: WIN_TYPES = { "I":"img", "B":"bg", "D":"diff", "F":"features" } DETECT_METHODS = { ...
# SciPy imports. import numpy as np from numpy import pi from numpy.testing import (assert_array_almost_equal, assert_equal, assert_warns) from pytest import raises as assert_raises from scipy.odr import Data, Model, ODR, RealData, OdrStop, OdrWarning class TestODR(object): # Bad Data ...
<gh_stars>0 import numpy import json import cv2 import numpy as np import os import scipy.misc as misc ############################################################################################### def MergeOverLapping(InDir,SubDir): for DirName in os.listdir(InDir): DirName=InDir+"//"+DirName ...
""" Analytic tests of Bayesian Evidence. """ import pytest import attr import numpy as np from pypolychord import PolyChordOutput from scipy import stats from scipy.integrate import quad, simps from yabf import Likelihood, Param, Parameter from yabf.samplers.polychord import polychord @attr.s(frozen=True) class Gau...
<filename>ProcessSrcmod.py from __future__ import division import math import code import datetime import urllib import utm import os.path import numpy as np import matplotlib.pyplot as plt import mpl_toolkits.basemap.pyproj as pyproj from scipy import io as sio from okada_wrapper import dc3d0wrapper, dc3dwrapper from ...
""" This module implements an object for dealing with two-dimensional data. """ import numpy as np from scipy.interpolate import RegularGridInterpolator from . import lib from . import io class MeshData(io.IO): _io_store = ["data", "axes", "labels", "units", "uncertainty"] def __init__(self, data,...
<reponame>Pandinosaurus/imageSeg-3D_topo import torch from torch import nn from scipy.ndimage.filters import gaussian_filter from PIL import Image import glob import numpy as np import math def max_outputs(outputs): # outputs_i with prediction probability map, (2, 2, 1250, 1250) -> (batch, classes, dim, dim) ...
import numpy as np import torch import pickle import matplotlib.pyplot as plt from scipy import optimize import pandas as pd def collect_from_dataset(): with open('Data/data_capacity.data', 'rb') as f: data_h = pickle.load(f) with open('Data/data_conductivity.data', 'rb') as f: dat...
<reponame>martanto/pyts """Code for Multiple Coefficient Binning.""" import numpy as np from numba import njit, prange from scipy.stats import norm from sklearn.base import BaseEstimator, TransformerMixin from sklearn.tree import DecisionTreeClassifier from sklearn.utils.validation import check_array, check_is_fitted,...
<filename>src/opihiexarata/propagate/polynomial.py """For polynomial fitting propagation, using approximations of 1st or 2nd order terms but ignoring some spherical effects. Although this could be easily implimented in a better method using subclassing rather than having two classes, as having a 3rd order is not reall...
<reponame>iahsanujunda/federated # Copyright 2019, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
import json import math import logging import string import nltk import scipy import torch from nltk.stem.porter import * import numpy as np from collections import Counter import os from torch.autograd import Variable import config import pykp from utils import Progbar from pykp.metric.bleu import bleu stemmer = ...
<gh_stars>100-1000 ######################################################################## # # Reinforcement Learning (Q-Learning) for Atari Games # # How to run: # # To train a Neural Network for playing the Atari game Breakout, # run the following command in a terminal window. # # python reinforcement-learning.py --...
<reponame>Leengit/HistomicsTK<gh_stars>0 import numpy as np def delete(im_label, indices): """ Deletes objects with values in 'indices' from label image, writing them over with zeros to assimilate with background. Parameters ---------- im_label : array_like A label image generated by ...
<gh_stars>0 import itertools from fractions import Fraction import matplotlib as mpl import numpy as np def compute_ticks(vmin, vmax, unit=''): """Compute the ticks in a colorbar.""" centered = vmin == -vmax if vmax == vmin: tick_labels = '%s' ticks = np.array([vmin]) else: l...
# Declare imports # Style guide is currently following PEP8 - which means sort alphabetically # Standard Library Import from abc import ABC, abstractmethod # This is needed for the abstract classes # Third-party Imports import numpy as np import sympy as sp import dill # Application Specific Imports from agent.mode...
# Python based on device ad blocker. from re import template from statistics import mode import cv2 import numpy as np import os import time import pyautogui template3=cv2.imread('template3.png',0) template4=cv2.imread('template4.png',0) template5=cv2.imread('template5.png',0) template6=cv2.imread('template6.png',0) ...
<reponame>IguanaAzul/scipy # Author: <NAME> <<EMAIL>> # April 4, 2011 import numpy as np from numpy.testing import (assert_equal, assert_array_almost_equal, assert_array_equal, assert_allclose, assert_, assert_almost_equal, suppress_warni...
import sys import os import gc import numpy as np import matplotlib.pyplot as plt from matplotlib import ticker import scipy.interpolate as interp import majoranaJJ.modules.plots as plots #plotting functions import majoranaJJ.modules.finders as fndrs import majoranaJJ.modules.SNRG as SNRG import majoranaJJ.modules.di...
# import time # import torch # from torch.autograd import Variable from torchvision import datasets, transforms # from torch.utils.data import Dataset, DataLoader import scipy.io import warnings # from PIL import Image # import trimesh # import cv2 import wx # from pynput import keyboard warnings.filterwarnings("ignore...
import numpy as np from load_data import X, Y, Xtest from sklearn.svm import SVC from sklearn.grid_search import GridSearchCV from sklearn.cross_validation import StratifiedKFold from sklearn.cross_validation import train_test_split from scipy.io import savemat def return_best_svm(X, Y, N, C, penalties): """ ...
<filename>Matlab codes/Kernel_Try.py ## Imports import numpy as np import statsmodels import seaborn as sns from matplotlib import pyplot as plt import pandas as pd import pystan from sklearn.kernel_ridge import KernelRidge import os import xlrd os.chdir('C:\\Users\\lakshd5\\Dropbox\\Heteroscedasticity\\Final Data') im...
from fbpca import pca import math import numpy as np import os from scanorama import * from scipy.sparse import vstack from sklearn.preprocessing import LabelEncoder, scale from experiments import * from process import load_names from utils import * NAMESPACE = 'artificial_volume' METHOD = 'svd' DIMRED = 100 data_na...
<gh_stars>1-10 # coding=utf-8 import pylab import numpy as np from scipy import signal # 设置原图像 img = np.array([[10, 10, 10, 10, 10], [10, 5, 5, 5, 10], [10, 5, 5, 5, 10], [10, 5, 5, 5, 10], [10, 10, 10, 10, 10]]) # 设置卷积核 fil = np.array([[-1, -1, 0], ...
import numpy as np import math from scipy import stats from sklearn import mixture import matplotlib.pyplot as plt import pickle import time import matplotlib.pyplot as plt # cov = np.eye(2, 2) # u1 = np.array([2, 2]) # u2 = np.array([-2, -2]) # X1 = np.random.multivariate_normal(mean=u1, cov=cov, size=500...
import os import re import torch import string import pandas as pd import numpy as np from collections import OrderedDict from transformers import BertTokenizer from transformers import BertModel from scipy.spatial.distance import cosine from scipy.stats import pearsonr, spearmanr from nltk.corpus import wordnet as wn ...
<gh_stars>0 """Signal quality indexes based on dynamic template matching""" import numpy as np from scipy.stats import kurtosis, skew, entropy """ Most of the sqi scores are obtained from the following paper Elgendi, Mohamed, Optimal signal quality index for photoplethysmogram signals, Bioengineering. """ def perfu...
################################################################################ # # Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors # # This file is a part of the MadGraph5_aMC@NLO project, an application which # automatically generates Feynman diagrams and matrix elements for arbitrary # h...
<filename>BioNetGen-2.3.0/source_Atomizer/stats/atomizationStatistics.py import pandas from scipy import stats import matplotlib.pyplot as plt import seaborn as sns import numpy as np import progressbar from richContactMap import reactionBasedAtomization, stoichiometryAnalysis, extractActiveMolecules, getValidFiles im...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 7 13:06:21 2021 Core code obtained from <NAME>, Barnhart Lab Class structure and relative imports from Ike Ogbonna, Barnhart Lab @author: ike """ import io from PIL import Image, ImageSequence from glob import glob import numpy as np import os.path...
<reponame>chrishales/polcalsims # <NAME> # 22 June 2017 # Version 1.0 # # # This code is released under a BSD 3-Clause License # See LICENSE for details # # This code was used to obtain the results shown in arXiv:1706.06612 # and EVLA Memo 201 / ALMA Memo 603. # # # This code will plot spurious full-array on-axis linea...
<gh_stars>1-10 import numpy as np import scipy.linalg import scipy.sparse.linalg import scipy.spatial.distance import mdp class LPP(mdp.Node): def __init__(self, output_dim, k=10, input_dim=None, dtype=None): super(LPP, self).__init__(input_dim=input_dim, output_dim=output_dim, dtype=dtype) self...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
<filename>openpnm/core/Base.py import unyt from flatdict import FlatDict from collections import namedtuple import matplotlib.pyplot as plt from openpnm.utils import Workspace, logging from openpnm.utils.misc import PrintableList, SettingsDict, HealthDict import scipy as sp import warnings logger = logging.getLogger(__...
<reponame>PfizerRD/scikit-digital-health from pytest import fixture import numpy as np from scipy.signal import butter, sosfiltfilt @fixture(scope="class") def dummy_long_data(): rng = np.random.default_rng(1357) # make about 15 hours of data t = np.arange(0, int(12.5 * 3600), 1 / 50) a = (rng.rando...
from __future__ import division, absolute_import, print_function from past.builtins import xrange import numpy as np import os import sys import esutil import time import matplotlib.pyplot as plt import scipy.optimize from .sharedNumpyMemManager import SharedNumpyMemManager as snmm from .fgcmUtilities import dataBinn...
""" A module which contains the routines needed for computing the spillage values. """ #: Conversion between Atomic Units and Bohr AU_to_A = 0.52917721092 class MatrixMetadata: """ This class contains the information stored in the sparse matrix metadata file. Args: filename (str): the name of ...
<filename>app.py<gh_stars>1-10 import time import json import statistics from stellar_sdk import ( Asset, Keypair, Server, ManageBuyOffer, ManageSellOffer, Network, TransactionBuilder ) from config import ( URL, SECRET, COUNTER_ASSET, BASE_ASSETS, ) class Bot: def __in...
""" OpenMDAO Wrapper for the scipy.optimize.minimize family of local optimizers. """ import sys from collections import OrderedDict from distutils.version import LooseVersion import numpy as np from scipy import __version__ as scipy_version from scipy.optimize import minimize from openmdao.core.constants import INF_...
import numpy as np import glob from scipy.stats import levy_stable import sys class Logger(object): def __init__(self): self.terminal = sys.stdout self.log = open("logfile.log", "a") def write(self, message): self.terminal.write(message) self.log.write(message) def flush(...
#!/usr/bin/env python3 """ Changelog: New is v1_1: - Fixes bug in heading angle when rewiring the tree New is v1_0: - Run DR-RRT* with unicycle dynamics for steering ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Author: <NAME> Email: <EMAIL> ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # tifffile.py # Copyright (c) 2008-2014, <NAME> # Copyright (c) 2008-2014, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or with...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function) import array import cmath from functools import reduce import itertools from operator import mul import math import sys import symengine as se from symengine.utilities import raises from symengine import have_numpy import unit...
# this file is part of the XXX project # Copyright 2014 <NAME> # use this one, unless you copy it Aug 18 2014 import pyfits import glob import pickle from scipy import interpolate from scipy import ndimage import numpy as np def weighted_median(values, weights,quantile): """ """ sindx = np.argsort(va...
<filename>trecs/matrix_ops.py """ Common matrix operations """ import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import norm from trecs.base import Component def to_dense(arr): """ Convert a sparse array to a dense numpy array. If the array is already a numpy array, just return it. If ...
from posterior import * from astropy.cosmology import FlatLambdaCDM import numpy as N import sys, os, time from scipy.stats import kde from scipy import interpolate from scipy.integrate import simps from scipy.interpolate import LinearNDInterpolator from scipy.interpolate import interp2d from itertools import product ...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Dec 20 12:06:21 2017 @author: cuijiaxu """ import numpy as np import scipy.io import scipy.stats import pylab as pl from plotshadedErrorBar import plotshadedErrorBar2 from matplotlib.ticker import FuncFormatter def getconvcurve(data): curve=np.zer...
""" Load and process homo-sapien protein-protein interaction data We treat the network as undirected data from http://snap.stanford.edu/node2vec/#datasets """ import scipy.io import os import numpy as np import networkx as nx from relational_erm.graph_ops.representations import relabel def main(): hs_dir = '.....
<filename>pytket/pytket/qasm/qasm.py # Copyright 2019-2021 Cambridge Quantum Computing # # 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 # # U...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import print_function from __future__ import absolute_import import sys import platform import sympy import mpmath import django import six from mathics.version import __version__ from mathics.core.expression import...