text string |
|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri May 28 12:28:09 2021
@author: <NAME>
"""
import sys
if sys.version_info[0] >= 3:
unicode = str
import os, argparse
import multiprocessing
from Bio import SeqIO
import numpy as np
from scipy.spatial import distance
nproc=multiprocessing.cpu_count()
pa... |
<filename>preprocessing/fap.py
# -*- coding: utf-8 -*-
import numpy as np
import scipy.signal
from scipy.signal import peak_widths
import matplotlib.pyplot as plt
import utils
import peakutils
import pandas as pd
from sklearn.preprocessing import StandardScaler, MinMaxScaler
def faps_slide_subplot(faps_feat_df,sbj,la... |
<filename>pystruct/inference/maxprod.py
import numpy as np
from scipy import sparse
from .common import _validate_params
from ..utils.graph_functions import is_forest
def edges_to_graph(edges, n_vertices=None):
if n_vertices is None:
n_vertices = np.max(edges) + 1
graph = sparse.coo_matrix((np.ones(l... |
<reponame>omardrwch/mfanalysis<filename>mfanalysis/cumulants.py
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import binom as binomial_coefficient
from .utils import Utils
class Cumulants:
"""
This class prov... |
<reponame>ForrestPi/faceSwapProjects
# import BFM
# import os
# import trimesh
# import numpy as np
# import utils
# import torch
# from skimage import io
# # if not os.path.isfile("./BFM/BFM_model_front.mat"):
# # utils.transferBFM09()
# # bfm_face_model = BFM.BFM()
# # print (bfm_face_model.point_buf[-1,-1])
# ... |
import numpy as np
from scipy.spatial import cKDTree
class DataDrivenSolver:
"""
Data-driven solver for truss structures
Args
----
truss :
Object defining the truss structure
"""
def __init__(self, truss):
self.truss = truss
def load_material_data(self, material_data... |
<filename>data-collection/utils/Parsers.py
import csv
import os
import pickle
import numpy, scipy.io
from collections import defaultdict
__author__ = 'diegogaleano'
__email__ = '<EMAIL>'
__date__ = '19-10-2016'
class EasyParsers(object):
"""
Broad class that parser different types of files.
"""
def __init__(self... |
def str_repr_demos():
from fractions import Fraction
half = Fraction(1, 2)
half
print(half)
str(half)
repr(half)
s = 'hello world'
str(s)
repr(s)
"'hello world'"
repr(repr(repr(s)))
eval(eval(eval(repr(repr(repr(s))))))
# Errors: eval('hello world')
# Implementing g... |
<reponame>pierreglaser/templatematching-mva
import numpy as np
from scipy.special import expit
from templatematching.models.linear import R2Ridge, SE2Ridge
# XXX: R2LogReg inheriting from R2Ridge is a hack: the commom
# logic between the two classes should be factored out into the
# Spline Base class or a Spline Mixi... |
from __future__ import division
import numpy as np
from sklearn.preprocessing import MaxAbsScaler # normalize data with 0 and 1 as min/max absolute vals
import scipy
from multiprocessing import Pool, Process, Queue
from sklearn.metrics import roc_auc_score
import traceback
def get_acc_all(dist_arr, y):
"""
Ge... |
<reponame>vveitch/causal-embeddings<gh_stars>1-10
import tensorflow as tf
from scipy.special import expit
import numpy as np
import scipy.stats as stats
import os
from sklearn.linear_model import LogisticRegression, LinearRegression
from relational_erm.data_cleaning.pokec import load_data_pokec, process_pokec_attribut... |
import sklearn
from pprint import pprint
# Standard Imports (Data Manipulation and Graphics)
import numpy as np # Load the Numpy library with alias 'np'
import pandas as pd # Load the Pandas library with alias 'pd'
import seaborn as sns # Load the Seabonrn, graphics library with alias 'sns'
import copy
impor... |
<gh_stars>1-10
# Configuration to reproduce h0rton Sersic training set, but changing magnitude,
# R_sersic, and n_sersic to match distributions of COSMOS images that pass cuts
from paltas.Configs.Horton.config_horton import *
from scipy.stats import lognorm
config_dict['source']['parameters']['magnitude'] = truncnorm... |
import numpy as np
from scipy.stats import norm
from dcf import dcf
def mini_sigma(a, b, sigma, nu, rho, t, S, T):
coefficient_a = sigma**2 / (2 * a**3)
first_term_a = 1 - np.exp(-a * (T - S))
second_term_a = 1 - np.exp(- 2 * a * (S - t))
coefficient_b = nu**2 / (2 * b**3)
first_term... |
# coding: utf-8
# # Preparing inputs
# The inputs generation uses three step:
# 1. Pulling data
# 2. Formatting data to TFRecord files
# 3. Writting TFRecord files
# ## Imports
# In[1]:
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tensorflow as tf
from collections import defau... |
<gh_stars>10-100
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#code by Dangxiaobin at 2013-11-28
"""
Project the ROI to the gray white matter interface.
"""
import numpy as np
from froi.algorithm import imtool as imt
import time as time
from scipy.sp... |
<gh_stars>10-100
# coding=utf-8
"""
This module contains classes for primary flight simulation and the processing
of results.
With all the flight parameters, the flight class defines the framework of
operations necessary to accomplish the balloon flight simulation. See examples
for usage.
University of Southampton
"... |
import numpy as np
import scipy
import pandas as pd
import random
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Normalize points of data to plot in matplotlib
def pre_process_3dPlot(data,n):
this_min = np.amin(data)
this_max = np.amax(data)
return (this_max-this_min)*np.random.r... |
<reponame>ranocha/nodepy
from __future__ import absolute_import
from six.moves import range
def bisect(rlo, rhi, acc, tol, fun, **kwargs):
"""
Performs a bisection search.
**Input**:
- fun -- a function such that fun(r)==True iff x_0>r, where x_0 is the value to be found.
"""
w... |
import autocomplete_me
import time
import statistics as stat
import numpy
# import os
# os.chdir("C:/Users/dell/Documents/s750/assignments-junyi-zhu/autocomplete-me")
###############################################################################
## 1 LOADING DATA
## read_terms_slow() vs. read_terms_aut... |
<gh_stars>0
from scipy import interpolate
import numpy as np
power_list = [-18, -17, -16, -15, -14, -13, -12, -11, -10]
fd1_list = [10.4724, 10.4720, 10.4710, 10.4705, 10.4700, 10.469, 10.468, 10.467, 10.466]
fd2_list = [10.4734, 10.4732, 10.4728, 10.4725, 10.4723, 10.4723, 10.4720, 10.4717, 10.4714]
fd_peak_list = []... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 14 01:40:59 2019
@author: kenneth
"""
from __future__ import absolute_import
import numpy as np
import copy
class kMeans:
def __init__(self, k = None):
'''
Parameter
----------
k: Number ... |
import numpy as np
import copy
from hexhamming import hamming_distance
import progressbar
import time
import lightreid
from lightreid.utils.meters import AverageMeter
import scipy
from scipy.optimize import curve_fit
from scipy import special
from scipy.optimize import minimize_scalar
from ..build import EVALUATORs_... |
#!/usr/bin/python
import os
import copy
import time
import numpy
import cobra
import bisect
import pandas
import warnings
import symengine
import itertools
from cobra.util import solver
from scipy.stats import spearmanr
from numpy.random import permutation
from cobra.flux_analysis import flux_variability_analysis
# ... |
<reponame>johanvdw/scikit-gstat
import numpy as np
from sklearn.cluster import KMeans, AgglomerativeClustering
from scipy.optimize import minimize, OptimizeWarning
from skgstat.util import shannon_entropy
def even_width_lags(distances, n, maxlag):
"""Even lag edges
Calculate the lag edges for a given amount... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
def rotate_pc_along_y(pc, rot_angle):
'''
Input:
pc: numpy array (N,C), first 3 channels are XYZ
z is facing forward, x is left ward, y is downward
rot_an... |
<gh_stars>1-10
import numpy as np
import pinocchio
from scipy.linalg import block_diag
from .utils import a2m
class StateAbstract:
r""" Abstract class for the state representation.
A state is represented by its operators: difference, integrates and their
derivatives. The difference operator returns the ... |
<filename>tools/deprecated/linear_system/lhs_rhs.py
# -*- coding: utf-8 -*-
from screws.freeze.main import FrozenOnly
from scipy import sparse as spspa
from tools.linear_algebra.data_structures.global_matrix.main import GlobalVector, GlobalMatrix
class LHS(FrozenOnly):
def __init__(self, LS, lhs):
self.... |
import numpy as np
import scipy.sparse as sparse
from gridlod import fem, util
class PatchPeriodic:
''' Patch object in periodic setting. Adapted from non-periodic setting in gridlod.world.Patch'''
def __init__(self, world, k, TInd):
self.world = world
self.k = k
self.TInd = TInd
... |
import utils
import argparse
import itertools
import numpy as np
from pathlib import Path
import scipy.io as sio
from scipy.spatial.distance import pdist, squareform
def make_crops(seq_file):
target_line, *seq_line = seq_file.read_text().split('\n')
target = seq_file.stem
suffix = seq_file.suffix
targe... |
<gh_stars>0
import argparse
import os
from random import randint
import numpy as np
import torch
from scipy.misc import imsave
from combine_sg2im_neural_motifs.bbox_feature_dataset.bbox_feature_dataset import VG, VGDataLoader
from torchvision import transforms
from scene_generation.data import imagenet_deprocess_bat... |
# -*- coding: utf-8 -*-
"""
ST-DBSCAN - fast scalable implementation of ST DBSCAN
scales also to memory by splitting into frames
and merging the clusters together
"""
# Author: <NAME> <<EMAIL>>
#
# License: MIT
import numpy as np
from scipy.spatial.distance import pdist, squareform
from sklear... |
<filename>jtnn.py<gh_stars>0
from argparse import Namespace
from collections import defaultdict
from copy import deepcopy
from typing import List, Tuple
import rdkit
import rdkit.Chem as Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
import torch
import torch.nn as nn
... |
from galaxy_analysis.plot.plot_styles import *
import numpy as np
import matplotlib.pyplot as plt
import sys, glob
from scipy.integrate import cumtrapz
def compute_property(fpath, property, integrate = False, normalize = None):
# load file to get names
files = np.sort(glob.glob(fpath + 'run????_summary_output... |
<filename>doc/src/Chapter8-programs/python/ccd.py
#!/usr/bin/python
from sympy import *
from pylab import *
import matplotlib.pyplot as plt
density = [0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.2]
ECCD = [6.468200479265218, 7.932148263480525,9.105590614303889, 10.0743311672404, 10.88453820307055,11.5652399387... |
<gh_stars>1-10
"""
Source fitting routines.
"""
import math
import numpy
import scipy.optimize
from .gaussian import gaussian
from .stats import indep_pixels
import utils
FIT_PARAMS = ('peak', 'xbar', 'ybar', 'semimajor', 'semiminor', 'theta')
def moments(data, beam, threshold=0):
"""Calculate source positional ... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#Standard python libraries
import os
import warnings
import copy
import time
import itertools
import functools
#Dependencies - numpy, scipy, matplotlib, pyfftw
import numpy as np
import matplotlib.pyplot as plt
import pyfftw
from pyfftw.interfaces.numpy_fft import fft, fftshift, ifft, ifftshift, fftfreq
from scipy.int... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import expm,logm
import tensorflow as tf
import vis
import os
import argparse
import nibabel as nib
import warnings
import scipy.interpolate as spi
'''
In this file we include several basic functions that were not present natively in tensorflow,
and... |
<gh_stars>100-1000
from sympy.abc import x as symbolic_x
from sympy.abc import y as symbolic_y
from bmtk.simulator.filternet.filters import TemporalFilterCosineBump, GaussianSpatialFilter, SpatioTemporalFilter
from bmtk.simulator.filternet.cell_models import TwoSubfieldLinearCell, OnUnit, OffUnit
from bmtk.simulator.f... |
#!/usr/bin/env python
"""
The Gamma is a probability distribution over a positive random variable τ > 0
It is governed by parameters a and b that are subject to the constraints a > 0 and b > 0
The constraints exist to ensure that the distribution can be normalized.
Special case of a = 1 is known as the exponential ... |
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.io import loadmat
import scipy.optimize as opt
from sklearn import svm
raw_data = loadmat('data/ex6data2.mat')
x = raw_data['X']
y = raw_data['y'][:,0]
m = x.shape[0]
def gaussian(xi, xj, σ):
tmp = xi - xj
norm = (np.i... |
from scipy.sparse import data
import tensorflow_hub as hub
import tensorflow as tf
import numpy as np
import tensorflow_datasets as tfds
import pandas as pd
import downloader
import os
import model_trainer_extreme_task
import deduplicator
import blocker
import indexer
from scipy.spatial import distance
from sklearn.mod... |
# Python 2-to-3 compatibility code
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import scipy.constants as cnst
import scipy.sparse as scisp
import scipy.sparse.linalg as scisp_lin
from pyschro.gr... |
<filename>unsupervised/kmeansPCA/ex7.py
# Exercise 7 | Principle Component Analysis and K-Means Clustering
# ================= Part 1: Find Closest Centroids ====================
from matplotlib import use, cm
use('TkAgg')
import numpy as np
import scipy.io
import scipy.misc
import matplotlib.pyplot as plt
from fin... |
# Copyright 2020 The FedLearner 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... |
<gh_stars>1-10
import numpy as np
import std_msgs.msg, sensor_msgs.msg
import rospkg
import matplotlib
import matplotlib.pyplot as plt
from magpylib.source.magnet import Box,Cylinder
from magpylib import Collection, displaySystem, Sensor
from scipy.optimize import fsolve, least_squares
import matplotlib.animation as ma... |
<reponame>adozier/pymatgen<filename>pymatgen/phasediagram/maker.py
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
This module provides classes to create phase diagrams.
"""
__author__ = "<NAME>"
__copy... |
"""
Utility functions to generate and modify certain classes of networkx Graphs and
DiGraphs.
random_dag-- Generate a random DAG with specified number of nodes and edges.
poisson_ditree-- Generate directed rooted tree with Poissonian offspring.
directify-- Turn tree into directed rooted tree relative to specified root... |
'''
Tests for nrg.
'''
from numpy import *
from numpy.testing import dec,assert_,assert_raises,assert_almost_equal,assert_allclose
from scipy.sparse import coo_matrix
import pdb,sys
from sa import SAP,anneal
class CC(SAP):
def __init__(self,J):
self.J=J
def get_cost(self,state):
config=state[... |
# -*- coding: UTF-8 -*-
import numpy as np
from scipy.linalg import eig as eig_solver
from sympde.calculus import grad, inner
from sympde.topology import VectorFunctionSpace
from sympde.topology import element_of
from sympde.topology import Square
from sympde.expr import BilinearForm, integral
from gelato.expr i... |
<gh_stars>1-10
# Comparing Shape Descriptors
# Import the necessary packages
from scipy.spatial import distance as dist
class Searcher:
def __init__(self, index):
# store the index that we will be searching over
self.index = index
def search(self, queryIndex, queryFeatures):
# initialize our dictionary of ... |
<gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from subprocess import Popen, PIPE
import tensorflow as tf
from tensorflow.python.framework import ops
import numpy as np
from scipy import misc
from sklearn.model_selection import KFol... |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 20 15:12:54 2018
@author: 79127
"""
import numpy as np
import statsmodels.sandbox.distributions.extras as extras
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('seaborn')
GC = extras.pdf_mvsk([1, 2, 4, 2])
GC(0.05)
GC?
fro... |
<filename>structure/time_signature.py
"""
File: time_signature.py
Purpose: Defines TimeSignature and TSBeatType
"""
from fractions import Fraction
from enum import Enum
class TSBeatType:
"""
Enum class for standard beat types/durations.
Standard duration notes are Whole, Half, Quarter, Eighth, Sixteent... |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# Parameteric Functions of Time
# ---------------------------------------------------------------------------
'''{begin_markdown param_time_fun}
{spell_markdown
params
expit
gaussian_cdf
gaussian_pdf
... |
<filename>python/nbdb/anomaly/gaussian.py<gh_stars>1-10
"""
Gaussian based anomaly detection
"""
from typing import List, Tuple
import logging
from scipy.stats import norm
import numpy as np
import pandas as pd
from nbdb.anomaly.anomaly_interface import AnomalyInterface
from nbdb.readapi.graphite_response import Anom... |
# Licensed under an MIT style license -- see LICENSE.md
import numpy as np
from matplotlib import gridspec
from scipy.stats import gaussian_kde
import copy
from pesummary.core.plots.figure import figure
from .corner import hist2d
from pesummary import conf
__author__ = ["<NAME> <<EMAIL>>"]
DEFAULT_LEGEND_KWARGS = {"... |
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
import scipy.stats as ss
model = Pipeline(steps=[
('scl', StandardScaler()),
('lin', LogisticRegression(
penalty = 'l1',
solver = 'liblinear', # for L1
... |
<reponame>CiceroAraujo/SB<filename>packs/multiscale/operators/prolongation/AMS/ams_mpfa.py
from .ams_tpfa import AMSTpfa
import time
import numpy as np
import scipy.sparse as sp
from scipy.sparse import linalg
class AMSMpfa(AMSTpfa):
# def __init__(self,
# internals,
# faces,
# edges,
... |
import os
import json
import numpy as np
import pandas as pd
from abc import ABC, abstractmethod
from scipy.integrate import solve_ivp
from models.noise import build_noise
from models.stimulation import build_stimulator
from models.oscillators import build_oscillators, build_connection, build_sensitivity
class Net... |
<reponame>sv1990/CorrelationThreshold<gh_stars>0
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from sklearn import base, feature_selection
from sklearn.utils import validation
def _pearsonr_pval(x, y):
return pearsonr(x, y)[1]
def _get_masked_corr(X, method='pearson'):
"""
Obta... |
<gh_stars>0
from decimal import Decimal
from fractions import Fraction
def get_multiplier(fr_out: str, fr_in: str = '20000000', delta: float = 0.001, des_error: float = 0.1, max_error: float = 30, divider_limit : float = 5):
# des_error - желаемая ошибка
# delta - шаг при подборе числа, большой -- плохо, мале... |
<reponame>petercorke/machinevision-toolbox-python
#!/usr/bin/env python
"""
Camera class
@author: <NAME>
@author: <NAME>
"""
import numpy as np
import cv2 as cv
from spatialmath import base
import machinevisiontoolbox as mvt
import matplotlib.pyplot as plt
from abc import ABC, abstractmethod
import numpy as np
import ... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2018 yech <<EMAIL>>
# Distributed under terms of the MIT license.
#
# Created: 2018-01-06 17:13
"""Circular Consensus Clustering.
# features
- reference guided (speed enchanced)
- uncompromising qual consolidation (posterior porb)
"""
imp... |
<filename>tools/valuation_small_patten.py
import numpy as np
import os
import glob
from PIL import Image
import cv2 as cv
import os
from sklearn.metrics import confusion_matrix,cohen_kappa_score
from skimage import io
from skimage import measure
from scipy import ndimage
from scipy import misc
from sklearn.metrics impo... |
# coding: utf-8
#
# This code is part of cmpy.
#
# Copyright (c) 2022, <NAME>
import numpy as np
from numpy.lib import scimath
from scipy import linalg as la
import matplotlib.pyplot as plt
from cmpy.collection import get_bins
from abc import abstractmethod, ABC
def gf0_z_onedim(z, half_bandwidth):
z_rel_inv = h... |
import pandas as pd
import numpy as np
import pickle
from scipy.stats import ranksums, chisquare
import numpy as np
# PART 1 ----------------------------------------------------------------------
with open('/project/M-ABeICU176709/delirium/data/inputs/master/ids/ids_train.pickle', 'rb') as f :
ids_train = pickle.... |
## Notebook for Creating Generator code for Keras and PyTorch
from __future__ import print_function, division
import os
import torch
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
#
# Import ... |
<reponame>TCD-Ultramicroscopy/STEM-Flyback-correction
###############################################################################
#
# generate_reference.py
#
# Created by <NAME>
#
# The functions in this file are used to generate a reference image
# mostly it is a lot of cropping and self tiling, followed by aligni... |
<gh_stars>1-10
import sys
import time
import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix
import pandas as pd
import dask.dataframe as ddf
from dask.dataframe import from_pandas
from dask_ml.preprocessing import Categorizer, OrdinalEncoder, OneHotEncoder
from dask.distributed import Client, LocalC... |
<filename>cdlib/algorithms/internal/GDMP2_nx.py
"""
Name :: UnityId
<NAME> :: skuber
<NAME> :: aslingwa
<NAME> :: rsaxena
<NAME>, and <NAME>.
"Dense subgraph extraction with application to algorithms detection."
IEEE Transactions on Knowledge and Data Engineering 24.7 (2012): 1216-1230.
Reference internal: https://gi... |
import numpy as np
import numpy.ma as ma
import scipy.stats as stat
import random
import matplotlib as mpl
import matplotlib.pyplot as plt
import scipy.stats as stat
def histogram_by_video(SMfilename, xlabel='Log Diffusion Coefficient Dist', ylabel='Trajectory Count', fps=100.02, frames=651,
y_... |
#!/usr/bin/env python
"""
Definition and functions for a simple image (stamp) data structure:
a square image with Npix*Npix pixels, where input Npix is odd
N.B. the center of the central pixel of the stamp has coordinates (0,0)
Functions:
- getOneDpixels(self, Npix)
- set2Dpixels(self, Xpixels... |
from __future__ import division
import requests
import random
import time
import threading
import rethinkdb as r
import math
import numpy as np
import cv2
import matplotlib
from matplotlib import pyplot as plt
import matplotlib.patches as patches
from scipy.misc import imread
import os
plt.scatter([0,5],[0,5])
plt.io... |
"""Krylov-subspaces model order reduction techniques
"""
import numpy as np
import scipy.linalg as sclalg
import sharpy.linear.src.libss as libss
import time
import sharpy.utils.settings as settings
import sharpy.utils.cout_utils as cout
import sharpy.utils.rom_interface as rom_interface
import sharpy.utils.h5utils as ... |
import logging
import warnings
from pathlib import Path
from datetime import datetime
from datetime import timedelta
from calendar import isleap
import rasterio
import numpy as np
from scipy import stats
from ost.helpers import raster as ras
from ost.helpers import helpers as h
logger = logging.getLogger(__name__)
... |
<gh_stars>0
__all__ = ['coalesce','migrate','mkQ','mkB','mk_F_iicr','main_eigenvalue','mk_fixed_K_iicrs','mk_fixed_k_iicrs']
import copy
import numpy as np
from scipy import linalg
from partition import *
def coalesce(p):
"""
Starting from a state p, produces a list of new states after coalescence of two genes.
... |
<filename>kimonet/core/processes/fcwd.py
import numpy as np
from kimonet.utils.units import BOLTZMANN_CONSTANT
from scipy.integrate import quad
import math
###########################################################################################################
# Frank-Condon weighted density (OLD an... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 <NAME> <<EMAIL>>
#
# Distributed under terms of the GNU-License license.
"""
"""
import context
import chaospy as cp
import numpy as np
import scipy.signal as spsignal
import envi, doe, solver, utilities
from envi import environment... |
<gh_stars>1-10
# tools.py
import allel
import zarr
import numpy as np
from scipy import stats
import pandas as pd
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import seaborn as sns
from functools import partial, reduce
from collections import defaultdict
from adjustText import adjust_text
# ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 29 15:40:56 2021
@author: jagtaps
project: BraneMF
"""
import pandas as pd
from sklearn.metrics.pairwise import euclidean_distances,paired_distances
import numpy as np
from sklearn.metrics import precision_recall_curve,recall_score,matthews_corrcoef
from sklearn.... |
<filename>nelpy/auxiliary/_tuningcurve.py<gh_stars>10-100
__all__ = ['TuningCurve1D', 'TuningCurve2D', 'DirectionalTuningCurve1D']
import copy
import numpy as np
import numbers
import scipy.ndimage.filters
import warnings
from .. import utils
from ..utils_.decorators import keyword_deprecation
# TODO: TuningCurve2D
... |
<gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Examples of generalized linear Gaussian process and random effects models
for several non-Gaussian likelihoods
@author: <NAME>
"""
import gpboost as gpb
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
plt.style.use('ggplot')
def f1d(x):
"""... |
import numpy as np
from e2cnn.nn import *
from e2cnn.group import *
from e2cnn.gspaces import *
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import matplotlib.animation as manimation
from skimage.transform import resize
import scipy.ndimage
import torch
from typing import Union
plt.rcParams['im... |
# Dynamic Neural Field simulation
# Copyright (c) 2017 <NAME>
'''
Dynamic neural field
====================
This script implements the numerical integration of dynamic neural field of the
form:
∂U(x,t) ⌠+∞
τ ------- = -U(x,t) + ⎮ w(|x-y|).f(U(y,t)).dy + I(x,t) + h
∂t ... |
#!/usr/bin/env python3
# coding: utf-8
"""
@file: test_stereo_exp_data.py
@description:
@author: <NAME>
@email: <EMAIL>
@last modified by: <NAME>
change log:
2021/06/17 create file.
"""
from stereo.core.data import Data
from stereo.core.stereo_exp_data import StereoExpData
filename = '/home/qiuping/workspace/... |
import pandas as pd
import numpy as np
import scipy
import seaborn as sns
import matplotlib.pyplot as plt
import os
from functools import reduce
from statsmodels.tsa.stattools import coint
############### 一、pearson_corr begin
sns.set(style='white')
# Retrieve intraday price data and combine them into a DataFrame.
#... |
"""Utility functions for ``stginga``."""
# STDLIB
import os
import warnings
# THIRD-PARTY
import numpy as np
from astropy import wcs
from astropy.io import ascii, fits
from astropy.stats import biweight_location
from astropy.stats import sigma_clip
from astropy.utils import minversion
from astropy.utils.exceptions imp... |
#!/usr/bin/env python
# coding: utf-8
# ## Análisis Exploratorio de Datos
# In[34]:
from netCDF4 import Dataset, num2date
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
import cartopy.crs as crs
import pprint
import pandas as pd
import os
from datetime import datetime
import seaborn as sns
... |
<reponame>sajetan/PyHDX
import numpy as np
from symfit import Parameter, Variable, Model, exp
from scipy.optimize import fsolve
class KineticsModel(object):
"""
Base class for kinetics models. Main function is to generate :ref:`symfit` Variables and Parameters. The class
attributes `par_index` and `var_in... |
# Created by <NAME> (2021)
#%%
import numpy as np
from scipy.special import polygamma
from scipy.stats import gamma
import matplotlib.pyplot as plt
import requests
from bs4 import BeautifulSoup, SoupStrainer
import pandas as pd
from sklearn import linear_model
#%%
### Question 1b
k = np.arange(1, 21, 1)
n = np.array(... |
# Dynamic Neural Field simulation
# Copyright (c) 2017 <NAME>
'''
Dynamic neural field
====================
This script implements the numerical integration of dynamic neural field of the
form:
∂U(x,t) ⌠+∞
τ ------- = -U(x,t) + ⎮ w(|x-y|).f(U(y,t)).dy + I(x,t) + h
∂t ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position
"""
Use VBWKDE to characterize (with optional "extra" smoothing) the negative-error
distribution for a reconstructed parameter, then sample the resulting pdf for
use as a prior by Retro (see `retro.priors`).
"""
from __future__ impo... |
from contextlib import contextmanager
from time import time
@contextmanager
def timeit( output=False, name = None, storage=None):
s = time()
yield
if output:
print( "" if name is None else (name + ":"), time()-s, "sec" )
if storage is not None:
storage.append( time()-s )
import numpy a... |
# source contrast get averaged
# reset -f
import os
import numpy
import numpy as np
import mne
from mne.io import read_raw_fif
from scipy import stats as stats
from mne.stats import permutation_t_test
from mne.stats import (spatio_temporal_cluster_1samp_test,
summarize_clusters_stc)
from sklearn.... |
#!/usr/bin/env python3
from __future__ import print_function
from __future__ import division
import rospy
import rosbag
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Quaternion
from sensor_msgs.msg import Imu
from ... |
# C2SMART Lab, NYU
# NCHRP 03-137
# @file TTCD_Calculation_Online.py
# @author <NAME>
# @author <NAME>
# @date 2020-10-18
import pandas as pd
import numpy as np
from shapely.geometry import Polygon
import math
import time
import multiprocessing as mp
from itertools import repeat
from scipy import spatial
impor... |
<gh_stars>0
from math import ceil
from sklearn.cluster import DBSCAN
from scipy.spatial.distance import pdist, squareform
import numpy as np
from .metrics import jacard
def filter_duplicated(data):
'''
Filters the duplicated elements from the data.
Parameters:
data (list) List of s... |
# Author: <NAME> (<EMAIL>)
# Center for Machine Perception, Czech Technical University in Prague
# A script to render 3D object models into the test images. The models are
# rendered at the ground truth 6D poses that are provided with the test images.
# The visualizations are saved into the folder specified by "output... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.