text string |
|---|
import pysb
import sympy
import warnings
from sympy.printing import StrPrinter
from sympy.core import S
import collections
import re
import pysb.logging
from pysb.export import CompartmentsNotSupported, LocalFunctionsNotSupported
# Alias basestring under Python 3 for forwards compatibility
try:
basestring
except Na... |
from statistics import mean
pythonic_machine_ages = [19, 22, 34, 26, 32, 30, 24, 24]
print(mean(pythonic_machine_ages)) |
<gh_stars>0
import numpy as np
from scipy import linalg
def dot3(A, B, C):
'''
Multiplies 3 matrices.
'''
return np.dot(A, np.dot(B, C))
def predict(x, P, F=1, Q=0):
'''
Predict next position using the Kalman filter state propagation equations.
@param x:numpy.array - state vector
@p... |
<filename>examples/toy_examples/gaussian.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import tensorflow as tf
import zhusuan as zs... |
<gh_stars>1-10
import torch.utils.data
from scipy import signal
import numpy as np
from training.utils.stft_local import stft
class RadarDataset(torch.utils.data.Dataset):
def __init__(self, path, config):
self.config = config
allData = np.load(path, allow_pickle=True)
# This should be mo... |
import numpy as np
import matplotlib.pyplot as plt
from edibles import PYTHONDIR
from edibles.utils.edibles_oracle import EdiblesOracle
from edibles.utils.edibles_spectrum import EdiblesSpectrum
from edibles.utils.voigt_profile import *
from pathlib import Path
import astropy.constants as cst
from scipy.interpolate imp... |
#!/usr/bin/env python
from problem import Problem
import rospy
import numpy as np
from scipy.stats import rice
from scipy.special import jv as besseli
from tools import compute_distance
# sigma=12.551, rice_b=0.009, rice_loc=-7.001
class WLANLocalization(Problem):
def __init__(self, locations, neighbours, Ptx=12.0... |
import numpy as np
from scipy.linalg import block_diag
from ...common.timeseries_output_comp import TimeseriesOutputCompBase
from dymos.utils.lagrange import lagrange_matrices
class RungeKuttaTimeseriesOutputComp(TimeseriesOutputCompBase):
def setup(self):
"""
Define the independent variables as... |
# scientific computing library
import numpy as np
# `.mat` to `Python`-compatible data converter
import scipy.io
def fetch_data(fname='face', ratio=0.8, seed=13):
"""Bootstrapping helper function for fetching data.
Parameters
----------
fname: str
Name of the `.mat` input file
ratio: floa... |
import numpy as np
import cv2
from scipy.stats import skew, kurtosis
# Param: im { Numpy Array } - contains the image read
# Return: results { List } - check documentation for details on each element in the list
def rgbProcData(im):
height, width, channels = im.shape
b,g,r = cv2.split(im)
left_im = im[:,0:... |
import numba
import numpy as np
from scipy.spatial import distance_matrix
@numba.jit
def _farthest_first_traversal(dist, k, row_ind=0, sample_edge=False):
N = len(dist)
if N == k:
return list(range(N))
# Collect indices of maximally distant vectors in the data array
distant_inds = set()
... |
import numpy as np
import scipy
import cv2
import pylab
import utilCV
import os
# ---------------------------------- Image registration ----------------------------------
def calc_rigid_transform(refpts, pts):
# calc rotation angle, scale coef and translation coef
assert(len(refpts) == len(pts))
A = np.ar... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os.path
import time
import moviepy.video.fx.all
import numpy as np
from scipy.io import wavfile
from lecture_shortener import globals, audio, util
def _apply_speed_to_range(clip, range_to_modify, speed, is_silent):
subclip = clip.subclip(rang... |
from timeit import default_timer as timer
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import StratifiedKFold
import scipy.optimize
from scipy.special import expit, xlog1py
from experiments import experimental_design
from performance_metrics import performan... |
<filename>code/replicate_AVE.py
import utils
from os import path
import numpy as np
from scipy import stats, sparse
from scipy.spatial.distance import pdist, squareform
from sklearn.cluster import AgglomerativeClustering
from sklearn.linear_model import LogisticRegression
from tqdm import tqdm
##Set a random seed to... |
""" Functionality for analysis of single quantum dots
For more details see https://arxiv.org/abs/1603.02274
"""
# %%
import scipy
import scipy.ndimage
import numpy as np
import matplotlib.pyplot as plt
import warnings
import logging
import qcodes
from qcodes.plots.qcmatplotlib import MatPlot
from qtt.data import dat... |
<gh_stars>1-10
import gc
import numpy as np
import pandas as pd
import src.utils as utils
from typing import Optional
from scipy.io import savemat
from scipy.sparse import csr_matrix, hstack
from src.core.states import RunningState
from .base import Callback, CallbackOrder
# on_features_start
class AssignTarget... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 9 21:47:30 2017
@author: chris
"""
import numpy as np
from scipy import stats
mean = [0,0]
cov = [[1,1],[1,2]]
N = 20
Repeat = 1000
SigCases = 0
inSigCases = 0
CI_1 = np.zeros(2000).reshape(1000,2)
CI_2 = np.zeros(2000).reshape(1000,2)
CI_3 = n... |
# -*- coding: utf-8 -*-
'''
Aperture/pupil utility functions for pyZELDA
'''
import numpy as np
import collections
import scipy.ndimage as ndimage
def coordinates(dim, size, diameter=False, strict=False, center=(), cpix=False, normalized=True, outside=np.nan, polar=True):
'''
Returns rho,theta coordinates ... |
<reponame>eppdyl/cathode-database
# MIT License
#
# Copyright (c) 2020-2021 <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 r... |
<gh_stars>0
#!/usr/bin/env python3
#####################################################################
# This script presents how to read and use the sound buffer.
# This script stores a "basic_sounds.wav" file of recorded audio.
# Note: This requires scipy library
###################################################... |
# -*- coding: utf8 -*-
from utils import *
import scipy
import cv2
import tensorlayer as tl
#x = get_imgs_fn('0_6.bmp', 'finger_imgs/finger_HR_split/')
#print x.shape
#print type(x)
x = cv2.imread('finger_imgs/finger_HR_split/0_0.bmp')
x = (x / 127.5) - 1
print x.shape
print x[45][45]
cv2.imwrite('finger_imgs/finger... |
<reponame>FBlandfort/Subset-Simulation-Interpolation<filename>susi/examples/coll2.py
from .. import props
from .. import main
from scipy.stats import norm
from scipy.stats import gamma
#################################################################################
#Example 1:
'''
sum of standard normally distribut... |
import numpy as np
import pandas as pd
from collections import Counter
from copy import deepcopy
from queue import Queue
from math import floor, log
from random import randint
from scipy import stats
from sklearn.base import ClassifierMixin
class RandomForest(ClassifierMixin):
def __init__(self, num_trees=10, d... |
# coding=utf-8
"""Calculate colley matrix"""
import logging
import numpy as np
import pandas as pd
from scipy.linalg import solve
from scipy.sparse import coo_matrix
__author__ = '<NAME>'
logger = logging.getLogger(__name__)
def get_colley_ranks(df_schedule, week, printMatrix=False):
"""Calculate colley ranks... |
<reponame>861934367/cgat<filename>legacy/gnuplot_data.py
################################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id$
#
# Copyright (C) 2009 <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the term... |
# Copyright 2017 <NAME>, <EMAIL>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee
# is hereby granted, provided that the above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WAR... |
# -*- coding: utf-8 -*-
import wx
from wx.py.shell import ShellFrame
import scipy.ndimage as ndimg
import numpy as np
from imagepy import IPy
from imagepy.core.engine import Free
from imagepy.core.manager import PluginsManager
## There is something wrong!
## To be fixed!
def get_ips():
ips = IPy.get_ips()
if... |
<filename>egret/model_library/transmission/tx_calc.py<gh_stars>0
# ___________________________________________________________________________
#
# EGRET: Electrical Grid Research and Engineering Tools
# Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract ... |
<filename>caltest/test_caldetector1/test_superbias.py<gh_stars>1-10
from ..utils import translate_dq, extract_subarray
import os
import numpy as np
import pytest
from astropy.io import fits
from jwst.superbias import SuperBiasStep
from jwst import datamodels
import numpy as np
from scipy.stats import normaltest
from a... |
#!/usr/bin/env python
'''
Created on Jul 29, 2015
@author: adrian
'''
import matplotlib
matplotlib.use('Agg')
import json
import os
import scipy.io as sio
import shutil
import sys
from oct2py import octave
from pprint import pprint
from pylab import * # @UnusedWildImport
PNGDIR = os.path.abspath('.') + '/png/'
... |
<gh_stars>1-10
import inspect
import numpy as np
from scipy.optimize import root
from constants import molwt, lifetime, radeff
from constants.general import M_ATMOS
from forcing import ozone_tr, ozone_st, h2o_st, contrails, aerosols, bc_snow,\
landuse
def iirf_interp_funct(alp_b,a,tau,targ_iirf):
... |
# Ipanema_single_analysis.py
#
# Created: Ago 2018, <NAME>
#----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
from SUAVE.Core import Units, Data
import numpy as np
import pylab as plt
import time
... |
import scipy.special
import sys
import math
import numpy as np
import tensorflow as tf
def get_is(is_mean, is_img, inps, splits=10):
with tf.Session() as sess:
bs = 200
preds = []
n_batches = int(math.ceil(float(len(inps)) / float(bs)))
for i in range(n_batches):
sys.stdout.write(".")
... |
<filename>fitter.py
import numpy as np
from scipy import optimize as opt
import data_handler as dta
import polynomial_model as mod
def fit_curve(x, y):
model_data = dta.retrieve_model()
if model_data:
return model_data
models, training_errors, testing_errors = compare_models(x, y)
best_model ... |
<filename>armory/utils/export.py
import os
import logging
import numpy as np
import ffmpeg
import pickle
import time
from PIL import Image
from scipy.io import wavfile
from armory.data.datasets import ImageContext, VideoContext, AudioContext, So2SatContext
logger = logging.getLogger(__name__)
class SampleExporter:... |
import numpy as np
import astropy.io.fits as pyfits
import astropy.wcs as pywcs
import os
from six import string_types
from xcs_soxs.utils import mylog, parse_value, get_rot_mat, \
downsample
from xcs_soxs.instrument_registry import instrument_registry
from tqdm import tqdm
def wcs_from_event_file(f):
h = f["... |
<reponame>J-43/GST-Tacotron<filename>Synthesis.py
from utils import *
from Data import get_eval_data
from Hyperparameters import Hyperparameters as hp
import torch
from scipy.io.wavfile import write
from Network import *
import sys
import os
# import cv2
device = torch.device(hp.device)
def synthesis(log_number, e... |
<gh_stars>1-10
# pylint: disable=unused-variable
from statistics import mean, median
import matplotlib.pyplot as plt
SPLIT_LARGE = 500
# Remove events < 50 bp in tools (True)
FLAG_50 = True
# Plot fscore (True)
FSCORE_PLOT = False
# Plot breakpoint error plot (True)
BREAKPOINT_PLOT = True
# Plot support (True)
SUPPOR... |
import unittest
import numpy as np
import scipy.stats as st
from ..analysis import Correlation
from ..analysis.exc import MinimumSizeError, NoDataError
from ..data import UnequalVectorLengthError, Vector
class MyTestCase(unittest.TestCase):
def test_Correlation_corr_pearson(self):
"""Test the Correlation... |
from __future__ import division
from __future__ import print_function
import logging
logging.basicConfig(level=logging.INFO, format='INFO: %(message)s')
import numpy as np
import networkx as nx
import scipy.sparse as sp
import pandas as pd
from sklearn import metrics
def build_vocab(words):
vocab, cnt = {}, 0
... |
<reponame>juliomateoslangerak/microscope-metrics
# Import sample infrastructure
from itertools import product
from microscopemetrics.samples import *
from typing import Union, Tuple, List
# Import analysis tools
import numpy as np
from pandas import DataFrame
from skimage.transform import hough_line # hough_line_pe... |
<gh_stars>0
"""Geographical Regression Module"""
import numpy as np
from matplotlib import path
from scipy import stats
def geo_regression(coordinates, x, y, radius):
"""Georaphical univariate linear regression.
Pearson's r value is calculated for each coordinate using the input data
within a g... |
import pandas as pd
import numpy as np
from collections import defaultdict
from sklearn.preprocessing import scale
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from sklearn.mixture import GaussianMixture, BayesianGaussianMixture
from sklearn import metrics
import hdbscan
from scipy.cluster... |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from scipy import stats
import statsmodels.api as sm
from sklearn.metrics import accuracy_score
from sklearn.metrics import precision_recall_fscore_support as score
from sklearn.metrics import confusion_matrix
from sklearn.util... |
<reponame>luguoxiang/text-classfication
import jieba
import scipy.sparse
import time
import itertools
import os
import sys
import nltk.stem
import string
import numpy
TEXT_ENCODING="utf-8"
OTHER_CH=0
CN_CH=1
EN_CH=2
NUM_CH=3
EMPTY_CH=4
type_dict = [OTHER_CH] * 256
for c in string.digits + ".,":
type_dict[ord(c)... |
<gh_stars>0
"""
Our probing algorithm SIP and SIP-T
"""
import logging
import time
from collections import defaultdict
from typing import Tuple
import numpy as np
import scipy.integrate as integrate
import scipy.special as special
from scipy.stats import rv_continuous
from pup.algorithms.privacy_helper import buy_dat... |
<filename>src/main.py
import os
import stat
from os.path import join, exists, isdir
import shutil
from shutil import copyfile
import subprocess
import sys
import logging
import argparse
import json
from poracle import Poracle, PoracleException
import statistics
import time
import tensorflow as tf
logger = logging.get... |
<reponame>OrangeTowel/FrameTrajectory
"""
"""
from LieGroup import LieGroup
from LieGroupElement import LieGroupElement
from LieAlgebra import LieAlgebra
from LieAlgebraElement import LieAlgebraElement
import numpy as np
import scipy
import copy
class so3element(LieAlgebraElement):
representation: np.ndarray
d... |
<filename>audio_train.py
#%% Setup.
import signal
import sys
import numpy as np
import scipy.io.wavfile
from keras.utils.visualize_util import plot
from keras.callbacks import TensorBoard, ModelCheckpoint
from keras.utils import np_utils
from eva.models.wavenet import Wavenet, compute_receptive_field
from eva.util.... |
<reponame>siriusi/tensornets<filename>load_wiki_cropface.py
import numpy as np
import math
import cv2
import sys
import scipy.io as sio
import os
import h5py
def add_margin(img, face_loc):
crop_h = int(0.4 * (face_loc[3] - face_loc[1]))
crop_w = int(0.4 * (face_loc[2] - face_loc[0]))
img_h = img.shape[0]
... |
<gh_stars>0
""" Functions for hodogram analysis"""
import numpy as np
import math
import matplotlib.pyplot as plt
from scipy.spatial.transform import Rotation as R
def hodogram(comp1, comp2, compz, title="", ndt=0.001, azimuth=None, incidence=None):
"""
Plot an hodogram from 3C data
:param comp1: (numpy... |
import numpy as np
import scipy.sparse
from scipy.sparse import spmatrix, sputils
from .base import _formats
from .util import nbytes
class hsb_matrix(spmatrix):
"""Horizontally Stacked Block matrix"""
format = 'hsb'
def __init__(self, blocks, dtype=None):
ns, ms = zip(*[block.shape for... |
import pandas as pd
import numpy as np
import math
from typing import Tuple
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from function_approximation import rbf_approx, approx_nonlin_func
def read_vectorfield_data(dir_path="../data/", base_filename="linear_vectorfield_data") -> Tuple[np.ndarra... |
# standard imports
import numpy as np
import matplotlib.pyplot as plt
import time
# custom imports
import apt_fileio
import m2q_calib
import plotting_stuff
import initElements_P3
import peak_param_determination as ppd
from histogram_functions import bin_dat
from voltage_and_bowl import do_voltage_and_bowl
import v... |
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial.transform import Rotation
def best_fit_transform(A, B):
'''
Calculates the least-squares best-fit transform that maps corresponding points A to B in m spatial dimensions
Input:
A: Nxm numpy array of corresponding points
... |
<gh_stars>0
import re
import os
from netCDF4 import Dataset
from datetime import datetime, timedelta
import numpy as np
from scipy import interpolate
from multiprocessing import Pool
from functools import partial
p_top = 1 # Pa (=0.01 hPa)
lat = 0
lon = 0
shifted_lons = False
shift_index = 0
files = []
mera_time... |
# CREATED:2015-09-16 14:46:47 by <NAME> <<EMAIL>>
# -*- encoding: utf-8 -*-
'''Evaluation criteria for hierarchical structure analysis.
Hierarchical structure analysis seeks to annotate a track with a nested
decomposition of the temporal elements of the piece, effectively providing
a kind of "parse tree" of the compos... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 27 22:55:02 2019
@author: carl
"""
import json
import traceback
import os.path
from collections import namedtuple
import numpy as np
import scipy.signal, scipy.io
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot
from ..miccs impo... |
<filename>examples/brunel_solver/plot_brunel_net.py
# -*- coding: utf-8 -*-
#
# brunel_alpha_nest.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fre... |
"""
Very useful utilities for working with images
### author: <NAME>
### <EMAIL>
### date: 9/10/2018
"""
import PIL.Image as IMG
import numpy as np
from scipy.ndimage.measurements import label
import math
def get_rgb_scores(arr_2d=None, truth=None):
"""
Returns a rgb image of pixelwise separation between gro... |
import ast
import sys
import numpy as np
import pyDOE2 as doe
from scipy.stats.distributions import norm
from spellbook.commands import CliCommand
def scale_samples(samples_norm, limits, limits_norm=(0, 1), do_log=False):
"""Scale samples to new limits, either log10 or linearly.
Args:
samples_norm ... |
# text_association.py - calculates the similarity between the text and the influencers
import pandas as pd
from .text_cleaner import *
import re
from collections import Counter
import numpy as np
import pickle
from scipy.special import softmax
import tensorflow as tf
class TextProcessor(object):
def __init__(self... |
<filename>guotai_brats17/data_process.py
# -*- coding: utf-8 -*-
# Implementation of Wang et al 2017: Automatic Brain Tumor Segmentation using Cascaded Anisotropic Convolutional Neural Networks. https://arxiv.org/abs/1709.00382
# Author: <NAME>
# Copyright (c) 2017-2018 University College London, United Kingdom. All r... |
<filename>tests/e2e/performance/csi_tests/test_pvc_multi_clone_performance.py
import datetime
import logging
import os
import tempfile
import time
from uuid import uuid4
from ocs_ci.framework import config
import statistics
import yaml
import pytest
from ocs_ci.ocs.perftests import PASTest
from ocs_ci.ocs.perfresult ... |
<reponame>Knowledge-Precipitation-Tribe/Maximum-Entropy-Model-and-Expectation-maximization-algorithm<filename>code/normal_show.py<gh_stars>1-10
# -*- coding: utf-8 -*-#
'''
# Name: normal_show
# Description: 显示高斯混合模型的一些信息
# Author: super
# Date: 2020/5/10
'''
import numpy as np
import matplotlib... |
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
bank=pd.read_csv(path)
categorical_var = bank.select_dtypes(include = 'object')
print(categorical_var.head(5))
print('='*20)
numerical_var=bank.select_dtypes(include = 'number')
print(numerical_... |
#
# mvportfolio
# Python Package for
# Mean-Variance Portfolio (MVP)
# Analysis & Management
#
# The Python Quants GmbH
#
import logging
import doctest
import numpy as np
import pandas as pd
import scipy.optimize as sco
logging.basicConfig(filename='mvp.log',
format='%(asctime)s | %(levelname)s | %... |
<gh_stars>10-100
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchsummary import summary
import sys
import ipdb
import itertools
import warnings
import shutil
import pickle
from pprint import pprint
from types import SimpleNamespace
from math import floor,ceil
from pathlib im... |
"""
Utility function for modeling.
.. include:: ../include/links.rst
"""
import numpy as np
from scipy import linalg, stats
def cov_err(jac):
"""
Provided the Jacobian matrix from a least-squares minimization
routine, construct the parameter covariance matrix. See e.g.
Press et al. 2007, Numerical Re... |
<reponame>hcngac/knix_dev
# Copyright 2020 The KNIX 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 ... |
<filename>DeepWEST/bpti_md.py
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
from sys import stdout
from math import exp
import pandas as pd
import mdtraj as md
import pickle as pk
import numpy as np
import statistics
import itertools
import fileinput
import fnmatch
import shutil
imp... |
# coding: utf-8
import os
import sys
import re
import numpy as np
from scipy.io import wavfile
from tqdm import tqdm
import yaml
from yaml.loader import SafeLoader
from nltk import sent_tokenize
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
sys.path.append(f'{os.path.dirname(os.path.realpath(__file__))}/TransformerTTS')
f... |
import numpy as np
import scipy as sp
import openpnm as op
from numpy.testing import assert_approx_equal
class VaporPressureTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[3, 3, 3])
self.phase = op.phase.GenericPhase(network=self.net)
self.phase['pore.temperature'] = 300*np... |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from scipy import signal
from scipy import io
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import axes3d
from matplotlib import cm
from scipy.interpolate import interp1d
#MData = scipy.io.loadm... |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 29 16:24:16 2020
@author: mclea
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import convolve2d
from mpl_toolkits.mplot3d import Axes3D
from scipy.interpolate import griddata
from matplotlib import cm
import kernprof
from line_profiler import L... |
<reponame>Ziqi-Li/FastGWR
#FastGWR Class
#Author: <NAME>
#Email: <EMAIL>
from mpi4py import MPI
import math
import numpy as np
from scipy.spatial.distance import cdist,pdist
import argparse
class FastGWR:
"""
FastGWR class.
Parameters
----------
comm : MPI communicators initialized wi... |
<reponame>kmiddleton/Pic-Numero
from skimage import data, io, segmentation, color
from skimage.future import graph
from matplotlib import pyplot as plt
from scipy import misc
from skimage.color import rgb2gray
import numpy as np
import Helper
import Display
def spectral_cluster(filename, compactness_val=30, n=6):
... |
import scipy.stats as sps
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import json
import os
import tvc_benchmarker
import itertools
def standerdize(x):
return (x-x.mean())/(x.std())
def square_axis(ax):
"""
Makes axis square.
**Input**
:ax: axis objec... |
<filename>torchinductor/graph.py
import logging
import operator
from itertools import chain
import sympy
import torch
import torch.fx
from sympy import Integer
from . import config
from . import ir
from .codegen.wrapper import WrapperCodeGen
from .exc import LoweringException
from .exc import MissingOperator
from .ir... |
import os
import time
import numpy as np
import scipy.io as sio
import scipy.stats as st
import tensorflow as tf
from models.Alexnet import AlexnetModel
from datasets.tfr.imagenet_tfr import ImagenetDataSet
from datasets.hadamard import load_hadamard_matrix
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# os.environ['CUDA_V... |
<reponame>amrkh97/Arabic-OCR-Using-Python
import cv2
import csv
import time
import glob
import torch
import numpy as np
import read_files as RF
import neural_network as NN
import feature_extractor as FE
import dataset_creator as DC
from scipy import stats
from commonfunctions import *
#################################... |
<reponame>pernici/sympy<filename>sympy/polys/tests/test_monomialtools.py
"""Tests for tools and arithmetics for monomials of distributed polynomials. """
from sympy.polys.monomialtools import (
monomials, monomial_count,
monomial_lex_key, monomial_grlex_key, monomial_grevlex_key, monomial_key,
monomial_lex... |
<reponame>fjeng/aeptools
def crossCorr(hd='C:', logfilepath='C:/data/GroupData_NMF_feasibility_python/', logfilename='NMF_feasibility_log.json', file='', win=50.0, gap=0.5, freqResolution=1.0, upperFreq=1000.0, avg='', crossCorrFlag=True):
'''
Purpose : perform cross-correlation on FFR recordings
param... |
import numpy as np
import numpy.matlib as nm
from svgd import SVGD
class MVN:
def __init__(self, mu, A):
self.mu = mu
self.A = A
def dlnprob(self, theta):
return -1*np.matmul(theta-nm.repmat(self.mu, theta.shape[0], 1), np.linalg.inv(self.A))
def plot_results(mu, A, theta, bins=2... |
<reponame>timtyree/bgmc
import pandas as pd, numpy as np, trackpy
from scipy import stats
from .compute_slope import *
################################################################################
# compute_D_OLS_2D Reproduced Diffusion Coefficients of Wiener Processes
##############################################... |
<gh_stars>1-10
# Runlike this exec(open("att_testing.py").read())
# to use the pysmurf S object you've already initialized
import scipy.signal as signal
import time
import numpy as np
import sys
def check_att(ctime,which_att,att_idx,use_pysmurf=True,att_wait_after=2):
bands=[0,1,2,3]
slot=5
epics_path_to_... |
import klcalculator
import pandas as pd
from statistics import mean
from Utils import get_combined_feature_risks
data = pd.read_csv('./Datasets/Synthetic NAPLAN test/NAPLAN_synthetic.csv')
for col in ['Surname', 'First_Name']:
data = data.drop(col, axis=1)
data['DOB'] = pd.to_datetime(data['DOB'])
data['DOB'] = d... |
<reponame>shebogholo/kaldi
#!/usr/bin/env python3
# Copyright 2013-2017 <NAME> (<EMAIL>)
#
# 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
#
# Unl... |
<gh_stars>1-10
#!/usr/bin/env python
import rospy
import numpy as np
from scipy.spatial import KDTree
from std_msgs.msg import Int32
from geometry_msgs.msg import PoseStamped, Pose
from styx_msgs.msg import TrafficLightArray, TrafficLight
from styx_msgs.msg import Lane
from sensor_msgs.msg import Image
from cv_bridge i... |
<gh_stars>1-10
##========================================================================================
## 2018.01.23: Network reconstruction with latent variables
## 2018.02.28: speed up by using multiprocessing
## 2018.03.01: check: update hidden spin in parallel (?)
##==============================================... |
<reponame>mrazomej/stat_gen
# %%
# Import relevant libraries
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
# %%
# Define array to evaluate Gaussian
x = np.linspace(0, 1, 200)
# Evaluate Gaussian
px_1 = norm.pdf(x, 0.4, 0.12)
px_2 = norm.pdf(x, 0.55, 0.15)
# Plot pdf
plt.plot(x, px_1... |
<reponame>SU-ECE-17-7/ibeis
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
"""
Runs IBIES gui
Pyinstaller entry point
When running from non-pyinstaller source use
python ibeis.__main__.py
instead, or more desirably
python -m ibeis
"""
from __future__ import absolute_import, division, print_fu... |
<reponame>gleb-t/PerceptualSimilarity
import datetime
import itertools
import math
import os
import random
import glob
import scipy
import imageio
import scipy.misc
import scipy.spatial
import scipy.ndimage
import numpy as np
import torch
import torch.nn as nn
import torchvision.transforms as transforms
from torch.util... |
<filename>ISM_functions.py
import yt
from astropy import units as u
import numpy as np
import healpy as hp
import matplotlib.pyplot as plt
import itertools
import random
from yt.utilities.math_utils import get_cyl_theta, get_cyl_theta_component, euclidean_dist
import pickle
import re
import pandas as pd
import h5py
f... |
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from scipy.stats import ortho_group
import torch.nn.functional as F
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
plt.rcParams['axes.facecolor'] = '#f9f9f9'
plt.rcPara... |
<filename>vsepr/test_Pic50.py
from data import make_matrix
import pandas as pd
import numpy as np
import os
import math
import time
import torch
import model_vsepr as net
from Criteria import MSELoss
import torch.backends.cudnn as cudnn
from argparse import ArgumentParser
from sklearn.metrics import mean_squared_error
... |
# -*- coding: utf-8 -*-
import matplotlib.pylab as plt
import numpy
from scipy import integrate
lpa = 400.0
hpa = 300.0
pxs = 0.194
maxres = 1.3
epx = 1 / (2 * maxres)
tsl = 1.0
nxp = 1.0
NAc = pxs / (tsl / 2)
NAa = integrate.quad(lambda x: numpy.arctan(pxs / (2 * x)), 0.01, 1)[0]
print 'middle NA:', NAc
print 'aver... |
<reponame>PNNL-Comp-Mass-Spec/CRNT4SBML
import sys
sys.path.insert(0, "..")
import crnt4sbml
import numpy
import sympy
import pandas
import scipy.integrate as itg
import dill
from plotnine import ggplot, aes, geom_line, ylim, scale_color_distiller, facet_wrap, theme_bw, geom_path, geom_point, labs, annotate
from matplo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.