text string |
|---|
import numpy as np
import scipy
import cv2
from numpy.fft import fft, ifft
from scipy import signal
from lib.eco.fourier_tools import resize_dft
from .feature import extract_hog_feature
from lib.utils import cos_window
from lib.fft_tools import ifft2,fft2
class DSSTScaleEstimator:
def __init__(self,target_sz,confi... |
<filename>pysces/kraken/Kraken.py<gh_stars>0
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2017 <NAME>, <NAME>, <NAME> all rights reserved,
<NAME> (<EMAIL>)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to use, m... |
<filename>tests/test_svd.py
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import pytest
import numpy as np
from numpy.testing import assert_equal, assert_allclose
from scipy.spatial import procrustes
from graspy.embed.svd import selectSVD
from graspy.simulations.simulations... |
<reponame>samuelkolb/polytope<filename>tests/polytope_test.py
#!/usr/bin/env python
"""Tests for the polytope subpackage."""
import logging
from nose import tools as nt
import numpy as np
from numpy.testing import assert_allclose
from numpy.testing import assert_array_equal
import scipy.optimize
import polytope as pc... |
<reponame>ryokbys/nap
#!/usr/bin/env python
"""
Cuckoo search.
Usage:
cs.py [options]
Options:
-h, --help Show this message and exit.
-n N Number of generations in CS. [default: 20]
--print-level LEVEL
Print verbose level. [default: 1]
"""
from __future__ import print_function
import os... |
from pudzu.charts import *
from pudzu.sandbox.bamboo import *
from fractions import Fraction
# data
df = pd.read_csv("datasets/nobels.csv").split_columns('countries', '|').explode('countries').update_columns(jewish=Fraction)
countries = sorted(c for c in set(df.countries) if len(df[df.countries == c]) >= 5)
dj = pd.Da... |
<filename>GP/mog_single_comp.py<gh_stars>1-10
__author__ = 'AT'
from scipy.linalg import cho_solve, solve_triangular
from mog import MoG
from GPy.util.linalg import mdot
import math
import numpy as np
from util import chol_grad, pddet, jitchol, tr_AB
class MoG_SingleComponent(MoG):
"""
Implementation of post... |
import sympy as sp
import numpy as np
"""
check sympy.Sum function for a Legendre series
it iss shown that he Sum function results in a different result
than when using summing up the arguments individually!
"""
n=sp.Symbol('n')
f1 = []
f2 = []
cum = 0.
# results in differences after coefficient #8
for nmax in ra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2014-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Train, tune and test statistic classifier
@author: jsulloa
"""
import pandas as pd
import matplotlib.pyplot as plt
from maad import sound, util
from sklearn import svm
from sklearn.model_selection import GroupKFold, RandomizedSearchCV
from scipy.stats import uniform
... |
import cv2
import numpy as np
import random
try:
import scipy.ndimage.interpolation as ndii
except ImportError:
import ndimage.interpolation as ndii
import matplotlib.pyplot as plt
def generate_random_data(height, width, count):
x, y, gt, trans = zip(*[generate_img_and_rot_img(height, width) for i in rang... |
import os
from scipy.interpolate import interp1d
import numpy as np
import matplotlib.pyplot as plt
from plotting import mapDat
tc = np.logspace(-4, -2, 15)
x = np.r_[-300.:301.:1]
ade = np.load('ATEMlineADE.npz')
t = ade['tCalc']
loc = ade['rxLoc']
ade = ade['data']*1e9
# Interpolate in time
adeT = interp1d(t, ade... |
# -*- coding: utf-8 -*-
"""
This module contains functions for the computation
of Euclidean, generalized Sturmian and (modified) subresultant
polynomial remainder sequences (prs's).
The pseudo-remainder function prem() of sympy is _not_ used
by any of the functions in the module.
Instead of prem() we use the function... |
import numpy as np
from . import utils, dynamics
from numba import jit
from scipy.optimize import linear_sum_assignment
from scipy.ndimage import convolve, mean
def mask_ious(masks_true, masks_pred):
""" return best-matched masks """
iou = _intersection_over_union(masks_true, masks_pred)[1:,1:]
n_min = mi... |
#!/usr/bin/env python
"""
MIT License (modified)
Copyright (c) 2018 The Trustees of the University of Pennsylvania
Authors:
<NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this **file** (the "Software"), to deal
in the Software without restriction, including without l... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#for the type 3.5 or 2.7
import os
import datetime
import math
import shutil
import numpy as np
from scipy.interpolate import griddata as sciGridData
import Python_Program
# 获取数据所在目录
# dirInfo[0]:观测数据, dirInfo[1]:风云4NC数据, dirInfo[2]:结果数据
def dirInfoGet(install):
dirInf... |
# -*- coding: utf-8 -*-
import os
import torch
import gudhi
import anndata
import numpy as np
import scanpy as sc
import squidpy as sq
import pandas as pd
import networkx as nx
from scipy.sparse import save_npz, load_npz
from scipy.spatial import distance
from sklearn.neighbors import kneighbors_graph
def mkdir(dir_pa... |
#!venv/bin/python
import src.io
import numpy as np
import scipy.sparse
from collections import defaultdict
def importProteinsAndPtms(parameters, log, generate_decoy=True):
with log.newSection("Reading protein databases"):
sequence, protein_ids, protein_sizes, protein_ptms = __defineAminoAcidSequence(
... |
# Copyright 2021 The Cirq Developers
#
# 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 ... |
#!/usr/bin/python3
import json
import math
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import scipy.stats as stats
def txnJSON2Dict(JSONstring):
jdata = json.loads(JSONstring)
contractBlock = jdata.pop(0)
allowedGas = contractBlock["gas"]
owner = contractBlock["from"]
... |
"""
Module for filtering data
Signal filtering functions copied to NetPyNE from ObsPy by <NAME> (NKI)
Originally:
------------------------------------------------------------------
Filename: filter.py
Purpose: Various Seismogram Filtering Functions
Author: <NAME>, <NAME>, <NAME>
Email: <EMAIL>
Copyright ... |
import matplotlib
from pcpca import PCPCA
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import sys
from sklearn.decomposition import PCA
from numpy.linalg import slogdet
from scipy import stats
font = {"size": 20}
matplotlib.rc("font", **font)
matplotlib.rcParams["text.us... |
#!/usr/bin/env python3
#cython: language_level=3
# -*- coding: utf-8 -*-
"""
Numeric Evaluation
Support for numeric evaluation with arbitrary precision is just a proof-of-concept.
Precision is not "guarded" through the evaluation process. Only integer precision is supported.
However, things like 'N[Pi, 100]' should ... |
# -*- coding: utf-8 -*-
# pylint: disable=W0231, W0142
"""Tests for statistical power calculations
Note:
tests for chisquare power are in test_gof.py
Created on Sat Mar 09 08:44:49 2013
Author: <NAME>
"""
import copy
import warnings
from distutils.version import LooseVersion
import numpy as np
from numpy.testi... |
<reponame>fmohr/llcv
import typing
import logging
import numpy as np
import pandas as pd
import scipy.stats
import time
import sklearn.metrics
import func_timeout
def format_learner(learner):
learner_name = str(learner).replace("\n", " ").replace("\t", " ")
for k in range(20):
learner_name = learner_... |
"""
Solvers
"""
# Import Modules
import random
import numpy as np
from time import sleep, time
from math import *
from scipy.optimize import fsolve
from scipy.optimize import broyden1
from scipy.optimize import... |
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
import warnings
import os
from sklearn.metrics import fbeta_score, precision_score, recall_score, confusion_matrix,f1_score
import itertools
import pickle
from scipy.stats import multivariate_normal
from matplotlib import pyplot... |
<reponame>pycalphad/scheil<filename>scheil/utils.py
import numpy as np
from scipy.stats import norm
def get_phase_amounts(eq_phases, phase_fractions, all_phases):
"""Return the phase fraction for each phase in equilibrium
Parameters
----------
eq_phases : Sequence[str]
Equilibrium phases
... |
import os
import re
import json
import itertools
import pickle
from skopt import load
import numpy as np
from scipy.optimize import OptimizeResult
def _load_checkpoint(results_path, rank):
"""
Loads checkpoint to resume optimization.
* `results_path` [str]
Path to the previously saved results.
... |
<reponame>yifan-you-37/omnihang
import time
import numpy as np
import random
import sys
import os
import argparse
# import cv2
import zipfile
import itertools
import pybullet
import json
import numpy as np
import time
from sklearn.neighbors import KDTree
from collect_pose_data import PoseDataCollector
sys.path.inser... |
import numpy as np
import scipy as sp
import nibabel as nib
from numpy.testing import (assert_array_equal,
assert_array_almost_equal,
assert_almost_equal,
assert_equal)
from dipy.core import geometry as geometry
from dipy.data import get_d... |
# -----------------------------------------------------------------------
# Author: <NAME>
#
# Purpose: detects outliers in the burned area monthly time series.
# Outliers are detected month-wise by computing the interquartile range
# (IQR) of each specific month's observations (e.g. all observation in
# April) and sel... |
import os, pandas as pd, numpy as np
import matplotlib.pyplot as plt
from scipy.fftpack import fft
RECORD_DIR = 'myo_data'
if not os.path.exists(RECORD_DIR):
os.mkdir(RECORD_DIR)
EMG_RANGE = 8
ORI_RANGE = 4
ACC_RANGE = 3
def getRecords():
"""
Function to get records to plot based on user input
... |
<reponame>stevenblair/strathprints-downloads
from __future__ import print_function
import csv
author_names = ['Blair, <NAME>']
try:
# For Python 3.0 and later
from urllib.request import urlopen
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
try:
imp... |
<reponame>smogork/TAiO_ImageClassification
#! /usr/bin/env python3
"""
Moduł zawiera klasę wyliczającą sumę kolumny, którego projekcja ma najmniejszą wartość.
"""
import copy
import statistics
import numpy as np
from bitmap.bitmap_grayscale import BitmapGrayscale
from feature import feature
from bitmap import bitmap... |
# ==================================================================================
#
# Copyright (c) 2019, <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 restric... |
<gh_stars>1-10
import matplotlib
matplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc')
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn import decomposition
from scipy import linalg as la
iris = load_iris()
def iris_base():
fig = plt.fig... |
"""
Determine continuum based on continuum mask
and fit best radial velocity to observation
"""
import logging
import warnings
import emcee
import numpy as np
from scipy.constants import speed_of_light
from scipy.interpolate import splev, splrep
from scipy.optimize import least_squares
from scipy.signal import correl... |
<filename>Examples/laser_acceleration/laser_acceleration_PICMI.py
"""
Run parameters - can be in separate file
"""
# Laser parameters
laser_waist = 5.e-6 # The waist of the laser (in meters)
laser_duration = 15.e-15 # The duration of the laser (in seconds)
laser_a0 = 4. # Amplitude of the normalized vector potential
... |
from __future__ import print_function
import numpy as np
import errno
import os
import glob
import sys
import datetime
import time
from PIL import Image
from zipfile import ZipFile
from scipy.optimize import differential_evolution
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style('darkgrid')
try:
... |
<reponame>mohrobati/HiddenMessageInSignal
from scipy.io import wavfile
from scipy.fftpack import fft, ifft
from matplotlib import pyplot as plt
import numpy as np
power = 0.02e7
def string_to_binary_ascii(string):
binary = []
for char in string:
binary.append("{:08b}".format(ord(char)))
return ""... |
<reponame>kiranvad/geomstats
"""Autograd based linear algebra backend."""
import autograd.numpy as np
import autograd.scipy.linalg as asp
import functools
import scipy.linalg
from autograd.extend import defvjp, primitive
from autograd.numpy.linalg import ( # NOQA
cholesky,
det,
eig,
eigh,
eigvalsh... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from itertools import combinations
from collections import Counter
import os.path
import numpy as np
from scipy.stats import mode
from scipy.linalg import orth
from numpy.linalg import svd, lstsq, inv, pinv, multi_dot
from scipy.special import logit
from sklearn.b... |
<filename>comancpipeline/Tools/Fitting.py
import numpy as np
from scipy.optimize import minimize
import emcee
from comancpipeline.Tools import stats
from tqdm import tqdm
# FUNCTION FOR FITTING ROUTINES
class Gauss2dRot:
def __init__(self):
self.__name__ = Gauss2dRot.__name__
def __call__(self,*args,... |
## Portions of Code from, copyright 2018 <NAME>
from __future__ import absolute_import, division, print_function
import torch
import numpy as np
from scipy import ndimage
def numpy2torch(array):
assert(isinstance(array, np.ndarray))
if array.ndim == 3:
array = np.transpose(array, (2, 0, 1))
else... |
# -*- coding: utf-8 -*-
"""Functions of bff library.
This module contains various useful fancy functions.
"""
from collections import abc, Counter
from datetime import datetime, timedelta
import logging
import math
import multiprocessing
import sys
from functools import partial, wraps
from typing import Any, Callable,... |
<filename>tales/objects/mapgrid.py
# coding: utf-8
# In[59]:
import language
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.spatial as spl
import scipy.sparse as spa
import scipy.sparse.csgraph as csg
import scipy.sparse.linalg as sla
from collections import defaultdict
impor... |
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
def func(exp):
"""
Function to convert the expression to the Pythonic format to make mathematical calculations.
Parameters:
exp: inputted expression by the user to be lambdified
"""
x = sp.symbols('x')
return sp.utilities.lambdify(x, exp,... |
<reponame>hanfeisun/10707
import scipy.misc
def dump_image(filename, data):
print("Save to %s" % filename)
scipy.misc.imsave(filename, data.reshape([64, 64]))
|
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[28]:
import pandas as pd
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.feature_extraction.text import CountVectorizer
from scipy import spatial
from sklearn.feature_extraction.text import TfidfVectorizer
data = pd.read_csv("D:\\Datas... |
<reponame>cvignac/gnn-benchmark
# -*- coding: utf-8 -*-
import os
import pickle as pkl
import sys
import networkx as nx
import numpy as np
import scipy.sparse as sp
import tensorflow as tf
from gnnbench.data.io import load_dataset
from gnnbench.data.preprocess import to_binary_bag_of_words, remove_underrepresented_cl... |
import numpy as np
import scipy.stats as stats
def featurewise_norm(data, fmean=None, fvar=None):
"""perform a whitening-like normalization operation on the data, feature-wise
Assumes data = (K, M) matrix where K = number of stimuli and M = number of features
"""
if fmean is None:
fmean = d... |
<reponame>kip-hart/MicroStructPy<gh_stars>10-100
"""Verification
This module contains functions related to mesh verification.
"""
# --------------------------------------------------------------------------- #
# #
# Import Modules ... |
<filename>davidgoliath/project/modelling/19_binomial.py
# binomial distribution python 'IMPORTANT'
# https://www.google.com/search?q=binomial+distribution+python&oq=Binomial+distribution+python&aqs=chrome.0.0i67j0l4j0i22i30l5.1894j0j4&sourceid=chrome&ie=UTF-8
''' Discrete Distribution
binary scenarios, e.g. toss of a ... |
<filename>NektarSimulations/unsteady_NACA0012/data_analysis_transformation/unnaca_mat_gen.py
import numpy as np
import scipy.io
import os
import matplotlib.pyplot as plt
fs = 15
plt.rc('font', size=fs) #controls default text size
plt.rc('axes', titlesize=fs) #fontsize of the title
plt.rc('axes', labelsize=f... |
#!/usr/bin/env python
import controler_v1 as controller
import rospy
from time import sleep
import numpy as np
from scipy import interpolate
import pid
import trajectory_v1 as traj
def avg_dist(points):
i = points.shape[1]
dr = points[:,1:] - points[:,:i-1]
ds = np.sqrt(np.sum(dr*dr, axis=0))
#n_max =... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.autograd as autograd
import cnn
import json
import random
import os
import sys
import numpy as np
from scipy.stats import pearsonr
is_cnn=False
is_rnn=False
is_mlp=False
if len(sys.argv)!=2:
print("Error!")
sys.exit(0)
print(sys.argv[1]... |
<gh_stars>0
#!/usr/bin/env python
'''
Author: <NAME>
Brief: Convert finite element FCa field results to simulated confocal
microscopy data to be processed by CaCLEAN.
Copyright 2019 <NAME>, University of Melbourne
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except... |
# ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Developed at the NSLS-II, ... |
import os
import re
import nltk
import dill as pickle
import numpy as np
import pandas as pd
import json
from tqdm import tqdm
from operator import itemgetter
import torch
import torch.utils.data as data
from scipy.stats import itemfreq
from sklearn.utils import shuffle
from allennlp.modules.elmo import batch_to_ids... |
# -*- coding: utf-8 -*-
"""
Tests for abagen.surfaces module
"""
import numpy as np
import pytest
from scipy import sparse
from abagen import datasets, surfaces
@pytest.fixture(scope='module')
def surf():
data = datasets.fetch_fsaverage5()
coords = np.row_stack([hemi.vertices for hemi in data])
triangle... |
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.chrome.options import Options
from settings import Settings
from statistics import Statistics
from cookieClicker import CookieClicker
import time
class CookieBot:
def __init__(self):
self.se... |
# utility.py
import numpy as np
import pandas as pd
import scipy.stats as stats
from scipy.stats import chi2
from sklearn.preprocessing import LabelEncoder
from sklearn.base import BaseEstimator, TransformerMixin
class DataFrameImputer(BaseEstimator, TransformerMixin):
def __init__(self):
"""Impute missi... |
"""Example implementation of the Ricker model."""
from functools import partial
import numpy as np
import scipy.stats as ss
import elfi
def ricker(log_rate, stock_init=1., n_obs=50, batch_size=1, random_state=None):
"""Generate samples from the Ricker model.
<NAME>. (1954) Stock and Recruitment Journal of... |
<filename>perform/rom/projection_rom/autoencoder_proj_rom/autoencoder_tfkeras/autoencoder_galerkin_proj_tfkeras.py
import numpy as np
from scipy.linalg import pinv
from perform.rom.projection_rom.autoencoder_proj_rom.autoencoder_tfkeras.autoencoder_tfkeras import AutoencoderTFKeras
class AutoencoderGalerkinProjTFKer... |
<reponame>ansijing/pyfastqc
import gzip
import os
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import collections
import operator
import numpy as np
from scipy.stats import norm
def per_bas_N(file_path):
"""Per Base N Content"""
if not os.path.exists(file_path):
print('file n... |
<gh_stars>0
import warnings
from sympy.core.sympify import sympify
from sympy.core.relational import Relational
def threaded(**flags):
"""Call a function on all elements of composite objects.
This decorator is intended to make it uniformly possible to apply
functions to all elements of composite or... |
"""Assignment - making a sklearn estimator.
The goal of this assignment is to implement by yourself a scikit-learn
estimator for the OneNearestNeighbor and check that it is working properly.
The nearest neighbor classifier predicts for a point X_i the target y_k of
the training sample X_k which is the closest to X_i.... |
<reponame>henk789/uf3
"""
This module provides functions for computing neighbor lists, evaluating
pair distances, computing direction cosines for force components, and
fitting/evaluating one-dimensional BSplines.
"""
from typing import List, Dict, Tuple, Union, Any
import numpy as np
import numba as nb
from scipy impo... |
# -*- coding: utf-8 -*-
import numpy as np
from photonpy import Context,GaussianPSFMethods
import matplotlib.pyplot as plt
from scipy.signal.windows import tukey
def _getfft(xy,photons,imgshape,zoom,ctx:Context):
spots = np.zeros((len(xy),5))
spots[:,[0,1]] = xy * zoom
spots[:,4] = photons
spots[:,[2... |
import numpy as np
from numpy import pi
from scipy.spatial import distance
from KiMonETSim.initialize_systems.excitation import excited_system
import copy
#######################################################################################################################
def get_system(conditions,
... |
<reponame>jclark8345/Rap-Music-Analysis
# -*- coding: utf-8 -*-
"""
<NAME>
CSYS 300
Final Project
popularityPrediction.py
Use different ML methods to predict song popularity
Outline:
"""
### 1. Imports ###
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import os
from skl... |
import os
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data
import torchvision.transforms as transforms
from torchvision.models.inception import inception_v3
from scipy.stats import entropy
fr... |
<reponame>shaygeller/Fast-Slow-LSTM
from __future__ import print_function
import random
import csv
from keras.models import load_model
from keras.callbacks import Callback
import keras
import os
from keras.layers import Input, Embedding, LSTM, Dense, TimeDistributed
from keras.models import Model
from keras.utils i... |
<gh_stars>1-10
# Name: labelers_comparison_functions
# Author: <EMAIL>
# Date: 22 November 2018
# Editing: 30 December 2018
import pandas as pd
import numpy as np
import os
from sklearn.metrics import cohen_kappa_score, classification_report, confusion_matrix
import matplotlib.pyplot as plt
from scipy import stats
imp... |
<filename>indel_analysis/kl_comparisons/plot_kl_analysis.py<gh_stars>10-100
import io, sys, os, csv
import pylab as PL
import numpy as np
import itertools
import pandas
from selftarget.oligo import partitionGuides
from selftarget.util import getPickleDir
from selftarget.data import getAllDataDirs, getSampleSelectors, ... |
<reponame>MacIver-Lab/Ergodic-Information-Harvesting
# -*- coding: utf-8 -*-
import numpy as np
from scipy.stats import norm
from scipy.signal import convolve
from scipy.interpolate import interp1d
from ErgodicHarvestingLib.EntropyEID import EntropyEID
class EID(object):
def __init__(self, eidParam, rng):
... |
<reponame>R6auto/openpilot-1
#!/usr/bin/env python3
import sys
import os
import numpy as np
from selfdrive.locationd.models.constants import ObservationKind
import sympy as sp
import inspect
from rednose.helpers.sympy_helpers import euler_rotate, quat_matrix_r, quat_rotate
from rednose.helpers.ekf_sym import gen_cod... |
<reponame>tarik/split-normal<filename>tests/test_numpy.py
import scipy as sp
import numpy as np
import numpy.testing as npt
import split_normal as sn
def test_pdf():
x = np.linspace(-5., 5., 40)
params_split_norm = dict(
loc=0,
scale_1=1,
scale_2=1
)
params_norm = dict(
... |
#Title: Enzyme Expression Optimization
#Author: <NAME>
#Version: 10.02.2021
#Import libraries
import math
import warnings
import streamlit as st
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing imp... |
<reponame>gmayday1997/pytorch_CAM
import torch
from torch.utils.data.dataset import Dataset
import numpy as np
import os
import scipy.io
import scipy.misc as m
from PIL import Image
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
]
def is_image_file(filenam... |
<gh_stars>1-10
#!/usr/bin/env python
import climate
import io
import numpy as np
import theanets
import scipy.io
import os
import tempfile
import urllib
import zipfile
logging = climate.get_logger('lstm-chime')
climate.enable_default_logging()
# do fixed segments for now (warning: each segment does not correspond t... |
<reponame>SIGKDDanon/SIGKDD2021DeAnonV2
import matplotlib
matplotlib.use('Agg')
import pickle
import os
import ipdb
import statsmodels.stats.power as smp
import pandas as pd
import matplotlib.pyplot as plt
import sys
sys.path.insert(0, '../../le_experiments/')
# print(data)
import numpy as np
import os
from scipy imp... |
<reponame>pbrisk/optionpricing<filename>demo.py
# -*- coding: utf-8 -*-
# putcall
# -------
# Collection of classical option pricing formulas.
#
# Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk]
# Version: 0.2, copyright Wednesday, 18 September 2019
# Website: https://github.com/sonntagsges... |
"""SWAMP: Solving structures With Alpha Membrane Pairs
This module implements classes and methods to cluster the fragments present in the SWAMP library to form ensembles that
can be used as search models.
"""
__author__ = "<NAME>"
__credits__ = "<NAME> & <NAME>"
__email__ = "<EMAIL>"
import os
from swamp import vers... |
<gh_stars>10-100
from typing import Union, List, Tuple, Dict, Optional
from Bio import SeqIO
from biotite.structure.io.pdb import PDBFile
from scipy.spatial.distance import pdist, squareform
from pathlib import Path
import numpy as np
import string
from .vocab import FastaVocab
PathLike = Union[str, Path]
def one_h... |
# -*- coding: utf-8 -*-
from qibo import matrices, K
from qibo.config import raise_error
from qibo.core.hamiltonians import Hamiltonian, SymbolicHamiltonian, TrotterHamiltonian
from qibo.core.terms import HamiltonianTerm
def multikron(matrix_list):
"""Calculates Kronecker product of a list of matrices.
Args:... |
import numpy as np
from typing import Dict, Union, Optional, List, Iterable
from scipy.spatial.ckdtree import cKDTree
from sharpy.managers.unit_value import race_townhalls
from sc2.constants import FakeEffectID
from sc2.game_state import EffectData
from sc2.position import Point2
from sc2.units import Units
from sha... |
<reponame>swagnercarena/paltas
# -*- coding: utf-8 -*-
"""
Conduct hierarchical inference on a population of lenses.
This module contains the tools to conduct hierarchical inference on our
network posteriors.
"""
import numpy as np
from scipy import special
import numba
# The predicted samples need to be et as a glo... |
<gh_stars>0
r"""PF-PASCAL dataset"""
import os
import scipy.io as sio
import pandas as pd
import numpy as np
import torch
from .dataset import CorrespondenceDataset
class PFPascalDataset(CorrespondenceDataset):
r"""Inherits CorrespondenceDataset"""
def __init__(self, benchmark, datapath, thres, device, spli... |
from itertools import cycle
import numpy as np
from scipy.ndimage import binary_erosion, binary_dilation
def _optSupInf(u):
''' SI operator
'''
if np.ndim(u) == 2:
kernels = self.kernel2d
elif np.ndim(u) == 3:
kernels = self.kernel3d
else:
raise... |
<reponame>andraszsom/HUNTER<gh_stars>1-10
import numpy
# checks whether a string is a number
#@profile
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def smooth(x,window_len=11,window='hanning'):
"""smooth the data using a window with requested size.
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# <NAME> <<EMAIL>>
# 2016-10-16 20:20:57 PM EDT
#
from flame import Machine
import numpy as np
import matplotlib.pyplot as plt
lat_fid = open('test.lat', 'r')
m = Machine(lat_fid)
## all BPMs and Correctors (both horizontal and vertical)
bpm_ids, cor_ids = m.find(type='bp... |
<gh_stars>1-10
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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... |
<reponame>icesat-2UT/PhoREAL<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
This script loads the PhoREAL GUI which:
- Reads ICESat-2 ATL03 and ATL08 .h5 files
- Reads Reference data in .las, .laz, and .tiff formats
- Finds geolocation offsets in the ICESat-2 data with respect to the Reference data
-... |
<filename>Project/AOD/AOD_new.py
import scipy, pickle ,re
import tensorflow as tf
from scipy import ndimage
from scipy.misc import imsave
import tensorflow.keras as keras
import matplotlib.image as plt_img
import os,cv2,glob,itertools,numpy as np,math as m
from sklearn.model_selection import train_test_split
#from skim... |
#!/usr/bin/env,python3
#,-*-,coding:,utf-8,-*-
'''
Problem 11
What is the greatest product of four adjacent numbers in the
same direction (up, down, left, right, or diagonally) in the 20×20 grid?
'''
import numpy as np
from scipy import signal
numgrid='''08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50... |
<gh_stars>0
import unittest
from pyapprox.induced_sampling import *
from pyapprox.indexing import compute_hyperbolic_indices, \
compute_hyperbolic_level_indices
from pyapprox.variables import float_rv_discrete, \
IndependentMultivariateRandomVariable
from pyapprox.variable_transformations import AffineRandomVar... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
#!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.