text string |
|---|
<filename>lib/graph.py
import networkx as nx
import matplotlib.pyplot as plt
import itertools
import numpy as np
import ot
import time
from scipy import sparse
import copy
import matplotlib.colors as mcol
from matplotlib import cm
from attentionwalk import AttentionWalkTrainer
from scipy.linalg import fractional_matrix... |
#!/usr/bin/env python
# coding: utf-8
# Edited May, 27th 2020
## This is vHULK: viral Host Unveiling Kit
# Developed by <NAME> and <NAME>
# Creative commons
# Import required Python modules
import numpy as np
import pandas as pd
from Bio import SeqIO
import re
import sys
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] =... |
<reponame>laputian/dml
# Cf. http://scikit-learn.org/stable/auto_examples/manifold/plot_lle_digits.html
import numpy as np
import matplotlib.pyplot as plt
import gzip
import cPickle as pickle
from sklearn import (manifold, datasets, decomposition, ensemble,
discriminant_analysis, random_projection... |
# coding: utf-8
# # Prerequisites
# Install Theano and Lasagne using the following commands:
#
# ```bash
# pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt
# pip install https://github.com/Lasagne/Lasagne/archive/master.zip
# ```
# ## Prepared data
#
# All it is required to ... |
# Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
<filename>aifeynman/S_get_expr_complexity.py
import numpy as np
from .S_snap import bestApproximation
from .S_get_number_DL_snapped import get_number_DL_snapped
from sympy.parsing.sympy_parser import parse_expr
from sympy import preorder_traversal, count_ops
def get_expr_complexity(expr):
expr = parse_expr(expr)
... |
import unittest
import autograd
import autograd.numpy as np
import numpy.random as npr
import scipy.optimize
from autograd import grad
from uq360.algorithms.infinitesimal_jackknife.infinitesimal_jackknife import InfinitesimalJackknife
npr.seed(42)
sigmoid = lambda x : 0.5 * (np.tanh(x / 2.) + 1)
get_num_train = lam... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Copyright (c) 2020
# @Author : GitOPEN
# @Email : <EMAIL>
# @Date : 2020-11-05 10:23:57
# @Description : 一系列统计学相关的计算函数
__version__ = "0.19.7"
import math
from collections import Counter
from typing import List, Optional, Union
import numpy as np
from gitopenlib... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from typing import Union
from numpy import array, append, where, copy, delete
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter
from .. import Group
from ..utils import check_objattrs
from ..xas.normalize import find_e0
#from ..xas.xasutils import ro... |
<filename>xclim/testing/tests/test_sdba/test_utils.py
import numpy as np
import pandas as pd
import pytest
import xarray as xr
from scipy.stats import norm
from xclim.sdba import utils as u
from xclim.sdba.base import Grouper
def test_ecdf(series):
dist = norm(5, 2)
r = dist.rvs(10000)
q = [0.01, 0.5, 0.... |
<filename>tensorflow_probability/python/math/special_test.py
# Copyright 2020 The TensorFlow Probability 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... |
<filename>recbole/trainer/trainer.py
# @Time : 2020/6/26
# @Author : <NAME>
# @Email : <EMAIL>
# UPDATE:
# @Time : 2020/8/7, 2020/9/26, 2020/9/26, 2020/10/01, 2020/9/16
# @Author : <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# @Email : <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>, <EMAIL>
# UPDATE:
# @Time : 2020/10/8, 2020... |
import unittest
import numpy as np
import scipy.sparse
from autosklearn.pipeline.implementations.MinorityCoalescer import MinorityCoalescer
class MinorityCoalescerTest(unittest.TestCase):
@property
def X1(self):
# Generates an array with categories 3, 4, 5, 6, 7 and occurences of 30%,
# 30%... |
#coding:utf-8
# Figure 1: Show Spectrogram and Select Area for 2D FFT by mouse
# Figure 2: Show selected Area and Show its 2D FFT. Select Area to inverse 2D FFT by mouse
# Figure 3: Show selected Area, Show 2D inverse FFT of selected area in 2D FFT, Show same 2D FFT of Figure 2
#
# BPF bank analysis Spe... |
<reponame>gregoirehertz/MAPIE<filename>examples/plot_prefit_nn.py
"""
========================================================
Example use of the prefit parameter with neural networks
========================================================
:class:`mapie.estimators.MapieRegressor` is used to calibrate
uncertainties fo... |
# BSD 3-Clause License
# Copyright (c) 2019, regain authors
# 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
# lis... |
<reponame>zyzhucreol/PACK
# -*- coding: utf-8 -*-
"""
Interface with GigE camera via Allied Vision Vimba
Use Mono8 for alignment; BayerRG12 for capture
@author: <NAME>
"""
import threading
import numpy as np
from vimba import Vimba
from vimba.camera import Camera, Frame
from vimba.frame import FrameStatus
... |
from typing import Optional, Union, Iterable
import numpy as np
from anndata import AnnData
from scipy.sparse import issparse
from sklearn.utils import sparsefuncs
from .. import logging as logg
def _normalize_data(X, counts, after=None, copy=False):
X = X.copy() if copy else X
after = np.median(counts[cou... |
<reponame>herjy/proxmin
from __future__ import print_function, division
import logging
import numpy as np
from . import operators
from . import utils
from . import algorithms
def delta_data(A, S, Y, W=1):
return W*(A.dot(S) - Y)
def grad_likelihood_A(A, S, Y, W=1):
D = delta_data(A, S, Y, W=W)
return D.do... |
"""
<NAME>
University of Saskatchewan
plotwrf.py
Python 2.x
Python script to plot various WRF model output. Plots are saved as PNG.
example usage: plotwrf.py --infile filename.nc --sfc --tunit C --ppn -punit mm --td
Will plot surface chart and dewpoint in Celcius and precipitation in mm.
Use plotwrf.py --help t... |
"""DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... |
'''
6. Faça um programa em Python utilizando a biblioteca fractions,
para determinar o resultado da multiplicação entre as frações:
1/2 x 3/2 x 6/7 x 9/3 = ?
- Resultado deve ser: 27/14
'''
import fractions
a = fractions.Fraction(1, 2)
b = fractions.Fraction(3, 2)
c = fractions.Fraction(6, 7)
d = fractions.Fraction(9,... |
<gh_stars>1-10
#!/usr/bin/env python
__author__ = "<NAME>"
__copyright__ = "Copyright 2020, ECG Sex Classification"
__credits__ = ["<NAME>"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
from scipy.signal import medfilt
import numpy as np
import sci... |
<filename>iterative_style_transfer.py
'''
Original neural style transfer algorithm that iteratively updates the input
image in order to minimize the loss. Script inspired on the Keras example
available at
https://github.com/fchollet/keras/blob/master/examples/neural_style_transfer.py
'''
import os
import argparse
impo... |
<reponame>dlasecki/z-quantum-core
"""General-purpose utilities."""
import warnings
import numpy as np
from scipy.linalg import expm
import random
import math
import operator
import sys
import json
import openfermion
import sympy
from openfermion import hermitian_conjugated
from openfermion import InteractionRDM
from o... |
<reponame>Pabsm94/Easyplume
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 22 14:07:39 2016
@author: pablo
"""
""" CREATING PYTHON plasma_plume PACKAGE """
""" IMPORTING GENERAL USAGE MODULES """
from scipy.interpolate import interp1d,interp2d,griddata #1D, and 2D interpolation libraries
from scipy.integrate impo... |
import torch
import torchvision
from torchvision import transforms
from tqdm import tqdm
import os
import pickle
import statistics
import numpy as np
from scipy.stats import truncnorm
import argparse
import glob
import utils
from models.biggan_deep import Generator, Discriminator
from models.sync_batchnorm import Data... |
"""
Code adapted from: https://github.com/mseitzer/pytorch-fid/blob/master/fid_score.py
Licensed under the Apache License, Version 2.0: https://github.com/mseitzer/pytorch-fid/blob/master/LICENSE;
Copyright https://github.com/mseitzer
to use tensors instead of file paths
Calculates the Frechet Inception Distan... |
from abc import ABC, abstractmethod
from scipy.stats import norm
from z3 import *
from z3extra import *
class ProbVar(ABC):
@abstractmethod
def evalCDF(self, l, u):
...
@abstractmethod
def makeApproxDist(self, numHists, histBound):
...
def __init__(self):
self.adist = None
... |
<filename>scripts/benchmark.py
#!/usr/bin/env -S python3 -u
import argparse
import fcntl
import os
import statistics
import struct
import sys
import termios
from datetime import datetime
def main():
parser = argparse.ArgumentParser()
parser.add_argument('files', type=argparse.FileType('rb'), nargs='+')
... |
<filename>quantdsl/tests/test_parser.py
import datetime
import threading
import unittest
import sys
import math
from dateutil.relativedelta import relativedelta
import time
from six import print_
from quantdsl.domain.services.parser import dsl_parse
from quantdsl.domain.services.price_processes import get_price_proc... |
"""interactive_analysis.py
Author: <NAME> (2020-2021)
"""
from .extern.time_domain_astronomy_sandbox.backend import Backend
from .extern.time_domain_astronomy_sandbox.observation import Observation
from .extern.time_domain_astronomy_sandbox.rfim import RFIm
from .plotting import plot_coherent_power, plot_waterfall
fr... |
import numpy as np
import pandas as pd
import sys
import scipy.stats
import sklearn.cluster
import os
import multiprocessing as mp
def _spearman(data_matrix, i, j, min_overlap, absolute):
'''
Internal function, called by calculate_spearman. Get the two rows of the data matrix
that correspond to the two us... |
import torch
import numpy as np
import scipy
from scipy import stats
import pandas as pd
import scanpy
import anndata
# tempo imports
from . import utils
# --- PARAMETER FUNCTIONS TO GET VARIATIONAL AND PRIOR DISTRIBUTIONS ---
# ** mesor **
# variational
def get_mesor_variational_params(adata, init_mesor_scale_... |
from __future__ import print_function
if __name__ == '__main__':
import matplotlib
matplotlib.use('Agg')
from optparse import OptionParser
from math import sqrt, floor, ceil, pi
from glob import glob
import numpy as np
import pylab as plt
from scipy import linalg
from astrom_common import *
from astrom_intra... |
"""
Handlers for keys related to number theory: prime, even, odd, etc.
"""
from sympy.assumptions import Q, ask
from sympy.assumptions.handlers import CommonHandler
from sympy.ntheory import isprime
class AskPrimeHandler(CommonHandler):
"""
Handler for key 'prime'
Test that an expression represents a prime... |
<filename>Exercises/1_Constraint Satisfaction/util.py
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from sympy import *
def constraint(name, expr):
"""Augment the sympy Function class by attaching a symbolic expression
and making the function evaluatable by patching the .subs()... |
from __future__ import division
import scipy as sp
from scipy import linalg as la
from scipy.linalg import hessenberg
def eig(A, normal = False, iter = 100):
'''Finds eigenvalues of an nxn array A. If A is normal, QRalg.eig
may also return eigenvectors.
Parameters
----------
A : nxn array
May be real or... |
<reponame>JeremyBYU/UnrealRooftopLanding
"""Will check all the lidar returned
"""
import time
from pathlib import Path
import argparse
import joblib
import os
from descartes import PolygonPatch
import matplotlib.pyplot as plt
import numpy as np
from shapely.affinity import affine_transform
from scipy.spatial.transfor... |
"""
Usage
python3 run-deep-mismatch-net-tensorflow.py local_folder high_res
"""
import sys
import numpy as np
from scipy.sparse import coo_matrix
import glob
from keras import models, layers
import keras
from scipy import signal
from keras import backend as K
import os
import tensorflow as tf
import random
#from mat... |
import os
import numpy as np
from scipy.optimize import linear_sum_assignment
from ._base_metric import _BaseMetric
from .. import _timing
class HOTA(_BaseMetric):
"""Class which implements the HOTA metrics.
See: https://link.springer.com/article/10.1007/s11263-020-01375-2
"""
def __init__(self):
... |
<reponame>anand-bala/pycem<gh_stars>0
"""Provides the CEM class, the core of this package"""
import math
import logging
from typing import Union, Mapping, Callable, Optional, Sequence
import attr
import numpy as np
import bottleneck as bn
from scipy.stats import truncnorm
@attr.s(slots=True, auto_attribs=True, orde... |
import tensorflow as tf
from scipy.ndimage import imread
import os
import matplotlib.pyplot as plt
import numpy as np
DATASET_DIR = './Dataset'
class datasetLoader:
def __init__(self, dataset_dir, batch_size, image_size,check_readability = True, max_images_in_ram = None, shuffled = True):
self.batch_size ... |
"""
A first pass at solving Wald's sequential decision problem using dynamic
programming.
"""
import numpy as np
import scipy.stats as st
import scipy.interpolate as interp
import quantecon as qe
def expect_loss_choose_0(p, L0):
"For a given probability return expected loss of choosing model 0"
return (1-p)*... |
<filename>multifit/fitting.py
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
from iminuit import Minuit
from iminuit.cost import LeastSquares
from iminuit.util import make_with_signature, describe
class Spectrum(object):
"""
Read spectra from ascii file,
Place counts and... |
<gh_stars>1-10
import numpy as np
from scipy.interpolate import RectBivariateSpline
def LucasKanadeBasis(It, It1, rect, bases):
# Input:
# It: template image
# It1: Current image
# rect: Current position of the car
# (top left, bot right coordinates)
# bases: [n, m, k] where nxm is the size of the template.
# ... |
#!/usr/bin/env python3
import numpy as np
import logging
from skimage.feature import blob_log
import matplotlib.pyplot as plt
from scipy import signal, ndimage, optimize, linalg
def smooth(img, sigma):
img = ndimage.gaussian_filter(img, sigma)
logging.info("Image smoothed.")
return img
def blobsearch(... |
<reponame>joveh/qsim
# Copyright 2019 Google LLC. 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ..GaussianProcess import GaussianProcess, PredictResult
from ..MultiOutputGP import MultiOutputGP
from ..MultiOutputGP_GPU import MultiOutputGP_GPU
from ..LibGPGPU import gpu_usable
from ..MeanFunction import ConstantMean, LinearMean, MeanF... |
"""
removing:
max rank file creation
adding to curve data file:
- score
- difference between snapshot and when that post was submitted (age)
- median elapsed time of other posts on that page (median age)
then differences:
- time difference from last observation (seconds)
- difference in rank position
- difference i... |
"""
Created on Sun Feb 2 13:28:48 2020
@author: matias
"""
import numpy as np
from scipy.interpolate import interp1d
from scipy.constants import c as c_luz #metros/segundos
c_luz_km = c_luz/1000
import sys
import os
from os.path import join as osjoin
from pc_path import definir_path
path_git, path_datos_global = def... |
"""
File name: renderer
Author: <NAME>
Date created: 03.03.2019
Date last modified: 18:25 03.03.2019
Python Version: "3.6"
Copyright = "Copyright (C) 2018-2019 of Packt"
Credits = ["<NAME>, <NAME>"] # people who reported bug fixes, made suggestions, etc. but did not actually write the code
License = "MIT"
Version = "1... |
<filename>src/vs_method.py
# 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, sof... |
#!/usr/bin/env python3
import os
import cv2
import tqdm
import torch
import os.path
import numpy as np
from common import Config
import pickle as pkl
from lib.utils.basic_utils import Basic_Utils
import scipy.io as scio
import scipy.misc
from datasets.linemod.linemod_dataset import LM_Dataset
from argparse import Argum... |
import random
import sys
from collections import defaultdict
from typing import Optional, Dict, Tuple
from uuid import uuid4
import numpy as np
from scipy.special import softmax
from hmtl.utils import K
MAX_PERTURB_ATTEMPTS = (
10 # maximum number of attempts to apply the same perturbation if it fails
)
class... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import os
import numpy as np
import nibabel as nib
from scipy import signal
from numba import jit, float64, int64
def calculate_blood_t1(hct):
# hct as a float between 0 and 1
#%s - Jordan et al.
blood_t1 = 1./(0.52*hct+0.38)
... |
<gh_stars>0
import pylab as plb
from pyspecdata import *
from scipy.optimize import minimize, leastsq
from sympy import exp as s_exp
import numpy as np
import matplotlib.pyplot as plt
from sympy import symbols, latex, Symbol
from proc_scripts import *
from .simple_functions import select_pathway
t2 = symbols('t2')
def... |
#########################
### Paramaters to set ###
#########################
save_path = 'model_cut_py.h5'
save_path_hist = 'model_cut_py.json'
crop_top = 60
crop_bottom = 20
################
### Imports ###
################
import numpy as np
import pandas as pd
from scipy import ndimage
import matplotlib.pyplot as ... |
<gh_stars>1-10
import numpy as np
import scipy
import scipy.stats
import sklearn
import sklearn.cross_decomposition
import sklearn.decomposition
import sklearn.preprocessing
import bb_network_decomposition.constants
import bb_network_decomposition.data
import bb_network_decomposition.evaluation
def scale_projection_... |
<gh_stars>0
import scipy
import matplotlib.pyplot as plt
import numpy as np
import ahrs
import pandas as pd
import scipy.signal as signal
import scipy.integrate as intg
from numpy import pi
from scipy.fftpack import fft, ifft, dct, idct, dst, idst, fftshift, fftfreq
from numpy import linspace, zeros, array, pi, sin, co... |
<filename>_simdata.py
from scipy.stats import multivariate_normal
import numpy as np
from _util import calc_K
def _gen_rand_Cd(n_neurons,nDims):
"""
Generate random matrices of baseline firing rates, d, and
loadings from latent states, C
"""
C = np.random.normal(loc=0,scale=.5,size=(n_neurons,nDims))/2
d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Testing suite for COS method.
"""
from __future__ import print_function, division
import unittest as ut
import numpy as np
import scipy.stats as scs
from impvol import impvol_bisection, blackscholes_norm, lfmoneyness
from fangoosterlee import (cosmethod, cfinverse, GB... |
#!/usr/bin/env python
# coding: utf-8
# In[61]:
import os
import sys
import pandas as pd
import numpy as np
import string
from operator import itemgetter
from collections import Counter, OrderedDict
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.stem import SnowballStemmer
from nltk.corpus import ... |
import numpy as np
import tensorflow as tf
import scipy
from collections import defaultdict
from dist_pd.utils import coo_to_sparsetensor
import dist_pd.partitioners as partitioners
class DistMat:
"""
Distributed Dense Matrix.
Only consider 1d partitioning.
"""
def __init__(self, list_of_tensors, ... |
import numpy as np
import matplotlib
import platform
if platform.system() == 'Darwin':
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import rcParams
import torch
from datetime import datetime
import time
import pickle
import os
import seaborn as sns
import matplotlib.pylab as plt
from sc... |
<gh_stars>0
# Copyright (c) 2014 <NAME>
# Copyright (c) 2021 <NAME>
#
# Code initally borrowed from:
# https://github.com/hildensia/bayesian_changepoint_detection
# under the MIT license.
'''
Bayesian Online Changepoint Detection as seen in:
<NAME>, <NAME>, Bayesian Online Changepoint Detection, arXiv 0710.3742 (... |
from sympy import *
import sys
sys.path.insert(1, '..')
from tait_bryan_R_utils import *
from rodrigues_R_utils import *
from quaternion_R_utils import *
a_1, b_1, c_1, d_1 = symbols('a_1 b_1 c_1 d_1')
px_1, py_1, pz_1 = symbols('px_1 py_1 pz_1')
om_1, fi_1, ka_1 = symbols('om_1 fi_1 ka_1')
#sx_1, sy_1, sz_1 = symbols... |
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import JointTrajectory,... |
import pandas as pd
import numpy as np
import ast
from scipy.spatial.distance import pdist, squareform
import pdb
from sklearn.decomposition import PCA
import os
SEED = 0
np.random.seed(SEED)
## Calculates the first PCA_dim dimension of the PCA
def generate_PCA_features(features, PCA_dim):
pca = PCA(n_components=... |
<gh_stars>0
# Copyright (c) 2011-2017 by California Institute of Technology
# All rights reserved. Licensed under 3-clause BSD.
"""Interface to linear programming solvers.
The `polytope` package selects the default solver as follows:
1. use GLPK if installed
2. otherwise use SciPy
You can change this default at runt... |
#%%
"""Demonstrate the effect of compressing the number of thresholds of a random
forest."""
import sys
from numpy.linalg import LinAlgError
from tqdm import tqdm
import os.path
import numpy as np
import xgboost as xgb
sys.path.insert(1, "..")
from datasets import load_data
import pandas as pd
from sklearn.model_... |
<filename>examples/characterization/T1/superconducting-qubits/t1.py
"""
t1.py: Single qubit T1 decay time
Author: <NAME>, <NAME> - Quantum Machines
Created: 7/11/2020
Created on QUA version: 0.5.138
"""
import matplotlib.pyplot as plt
from configuration import *
from qm.QuantumMachinesManager import QuantumMachinesMan... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from scipy.spatial import cKDTree
from compas.utilities import pairwise
from compas.geometry import centroid_points
from compas.topology import breadth_first_traverse
__all__ = [
'face_adjacency_numpy',
... |
import fastprogress
import joblib
import numpy as np
import scipy.spatial
import scipy.spatial.distance
import scipy.special
import sklearn
import sklearn.decomposition
import mabe
import mabe.config
import mabe.features
# %% codecell
master_bar, progress_bar = fastprogress.fastprogress.force_console_behavior()
trai... |
import unittest
from scipy.interpolate import interp1d
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal
import dymos as dm
from dymos.examples.brachistochrone.brachistochrone_ode import BrachistochroneODE
class TestTimeseriesOutput(unittest.TestCase):
def test_timeseries_gl(s... |
# Author: <NAME> <<EMAIL>>
from math import log, sqrt
import numpy as np
from numpy.testing import assert_allclose
from scipy.signal import gaussian
from eelbrain._data_opt import gaussian_smoother
def test_gaussian_smoother():
"Test gaussian_kernel function"
x, y = np.mgrid[:99, :99]
d = np.abs(x - y, ... |
import os
import mvae
import numpy as np
import tensorflow as tf
from scipy import ndimage
from keras.datasets import cifar10
from mvae.custom_logger import logger
# ==============================================================================
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
tf.compat.v1.disable_eager_execu... |
from telnetlib import NOP
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_hastie_10_2
import pickle
from sympy import HankelTransform
def chenge_format(mat, paradaim):
if paradaim == 'CLA':
time_max = 206
left = np.empty((0, time_max, 22))
... |
'''
This protocol can be used to find the rmsd between the residues in the binding pocket of every pair of structures of a protein
Only the residues within 4 angstroms of either structures' ligands are considered
# how to run this file:
# /home/groups/rondror/software/sidhikab/miniconda/envs/geometric/bin/python flex_... |
<filename>dicoFolding/postprocessing/eval_tools.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This software and supporting documentation are distributed by
# Institut Federatif de Recherche 49
# CEA/NeuroSpin, Batiment 145,
# 91191 Gif-sur-Yvette cedex
# France
#
# This software is governed ... |
from sympy.core import symbols, Lambda
from sympy.functions import KroneckerDelta
from sympy.matrices import Matrix
from sympy.matrices.expressions import FunctionMatrix, MatrixExpr, Identity
from sympy.utilities.pytest import raises
def test_funcmatrix_creation():
i, j, k = symbols('i j k')
assert FunctionMa... |
<reponame>eneelo/qats<filename>qats/stats/gumbelmin.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:class:`GumbelMin` class and functions related to Gumbel (minima) distribution.
"""
import numpy as np
from scipy.special import zetac
from scipy.optimize import leastsq, fsolve
from matplotlib.pyplot import figure,... |
<filename>examples/pnlss/boucwen_plot.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from copy import deepcopy
import pickle
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
from scipy.linalg import norm
from pyvib.common import db
from pyvib.frf import covariance
from pyvib.signal import... |
<reponame>aoblakova/roots_and_integrals
from scipy.integrate import quad
import numpy.polynomial.polynomial as poly
import numpy as np
import math
SMALL_EPS = 10 ** (-12)
def complex_from_angle(phi, radius):
"""Return the complex number with argument 'phi' and absolute value 'radius'."""
return complex(math... |
<reponame>joungh93/SEDfit_prospector
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 30 10:54:16 2020
@author: jlee
"""
import time, sys, os
import h5py
import numpy as np
import scipy
from matplotlib import pyplot as pyplot
import fsps
import sedpy
import prospect
import emcee
def build_o... |
<reponame>STALKER2010/sympy-bleeding-edge<gh_stars>1-10
from __future__ import print_function, division
from sympy.matrices import diag
'''
Functions returning normal forms of matrices
'''
def smith_normal_form(m, domain = None):
'''
Return the Smith Normal Form of a matrix `m` over the ring `domain`.
Thi... |
import time
import math
import numpy as np
import scipy.sparse as sp
import networkx as nx
import dgl
import backend as F
from dgl import DGLError
def test_graph_creation():
g = dgl.DGLGraph()
# test add nodes with data
g.add_nodes(5)
g.add_nodes(5, {'h' : F.ones((5, 2))})
ans = F.cat([F.zeros((5, ... |
<filename>EXOSIMS/PlanetPopulation/SAG13.py<gh_stars>10-100
from EXOSIMS.PlanetPopulation.KeplerLike2 import KeplerLike2
from EXOSIMS.util.InverseTransformSampler import InverseTransformSampler
import astropy.units as u
import astropy.constants as const
import numpy as np
import scipy.integrate as integrate
import sys
... |
"""
Interaction with scipy.sparse matrices.
Currently only includes to_coo helpers.
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Iterable,
)
import numpy as np
from pandas._libs import lib
from pandas._typing import (
IndexLabel,
npt,
)
from pandas.core.dtypes.missing ... |
# -*- 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... |
<gh_stars>1-10
import os
import numpy as np
import scipy.io as io
from torch.utils.data import Dataset
import sunrgbd
from basic_utils import RunSteps, DataTypesSUNRGBD
from sunrgbd import load_props
class SUNRGBDDataset(Dataset):
def __init__(self, params, phase, loader=None, transform=None):
self.param... |
import torch
import torchaudio
import torchvision
import librosa
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage import gaussian_filter1d
from config import set_params
from kws.model import treasure_net
from kws.utils.transforms import SpectogramNormalize
from kws.utils.utils import exp_moving_ave... |
<reponame>lokik/sfepy
from __future__ import absolute_import
import time
import hashlib
import numpy as nm
import warnings
import scipy.sparse as sps
import six
from six.moves import range
warnings.simplefilter('ignore', sps.SparseEfficiencyWarning)
from sfepy.base.base import output, get_default, assert_, try_impo... |
"""Functions used to load the render results of Manim."""
import os
from fractions import Fraction
from pathlib import Path
from typing import Any, Dict, List, Optional
from .commands import valid_json_load, walk
from .config import get_config
from .presentation_classes import Scene, Section
__all__ = ["get_scene", "... |
<gh_stars>1-10
#! /usr/bin/env python
from tqdm import tqdm
import argparse
from warnings import warn
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats, sparse
from scipy.stats.mstats import theilslopes
import pymannkendall as mk
from panopticon impo... |
from __future__ import division, print_function
import os
import argparse
import numpy as np
import tensorflow as tf
from utils import preserve_colors_np
from utils import get_files, get_img, get_img_crop, save_img, resize_to, center_crop
import scipy
import time
from wct import WCT
parser = argparse.ArgumentParser()... |
<reponame>eqperes/mvaproject<filename>CCA/performance_tests.py
"""
Performance Tests for CCA
"""
import numpy as np
from CCAbib import CCA2view
import scipy.io as sio
import pickle
from sklearn.preprocessing import scale
class PerfTests(object):
def __init__(self, path_train_view1, path_test_view1, path_view2):
... |
"""Description of Diffrn class."""
__author__ = 'ikibalin'
__version__ = "2020_08_19"
from warnings import warn
from typing import NoReturn, List, Union
import numpy
import scipy
import scipy.misc
from cryspy.A_functions_base.matrix_operations import calc_vector_product_v1_v2_v1
from cryspy.A_functions_base.extincti... |
<filename>python/chisel/learning/driver.py<gh_stars>1-10
import os
import logging
import shlex
import chisel.mteval as mteval
import subprocess as sp
import traceback
import sys
import numpy as np
from numpy import linalg as LA
from multiprocessing import Pool
from time import time, strftime
from scipy.optimize import... |
# Copyright (c) 2020-2021 The Center for Theoretical Biological Physics (CTBP) - Rice University
# This file is from the Open-MiChroM project, released under the MIT License.
R"""
The :class:`~.ChromDynamics` classes perform chromatin dynamics based on the compartment annotations sequence of chromosomes. The simula... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.