text string |
|---|
#!/usr/bin/env python2
import numpy as np
import path_parser
import matplotlib.pyplot as plt
from scipy.spatial import KDTree
map_size_x=500 #cm
map_size_y=400 #cm
resolution = 10 #cm
lookahead_offset = 5 #*10cm
matrix = np.zeros( (map_size_x/resolution,map_size_y/resolution,2),dtype='f' )
def main(map_file):
... |
<filename>lib/west_tools/w_reweight.py
import logging
# Let's suppress those numpy warnings.
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
warnings.filterwarnings('ignore', category=RuntimeWarning)
warnings.filterwarnings('ignore', category=FutureWarning)
import numpy as np
import sc... |
<reponame>ranarango/fuegos-orinoquia
# -----------------------------------------------------------------------
# Author: <NAME>
#
# Purpose:
# -----------------------------------------------------------------------
import os
import numpy as np
import pandas as pd
import xarray as xr
from osgeo import gdal
from scipy i... |
<reponame>kageback/sge-python<filename>gridengine/pipeline.py
import os
import time
import pickle as pickle
from functools import reduce
from datetime import datetime
from pprint import pformat
from scipy.stats import t
from gridengine.task import Task
from gridengine.result_wrapper import ResultWrapper, LocalResult... |
from .. import settings
from .. import logging as logg
from ..preprocessing.neighbors import get_connectivities, verify_neighbors
from .transition_matrix import transition_matrix
from .utils import scale, groups_to_bool, strings_to_categoricals, get_plasticity_score
from scipy.sparse import linalg, csr_matrix, isspars... |
<filename>tests/test_zip.py
import unittest
from unittest.mock import patch, Mock
from pyvvo import zip
from pyvvo import glm
from pyvvo import utils
import pandas as pd
import numpy as np
import os
import math
from scipy.optimize import OptimizeResult
# BAD PRACTICE: file dependencies across tests.
from tests.test_ut... |
<filename>com_test.py
import os
from lib.model import CANNet2s
from lib.utils import save_checkpoint, fix_model_state_dict
import torch
from torch import nn
from torch.autograd import Variable
from torchvision import datasets, models, transforms
import torch.nn.functional as F
import numpy as np
import argparse
impor... |
<gh_stars>0
"""Tools for arithmetic error propagation."""
from itertools import repeat, combinations
from sympy.core.add import Add
from sympy.core.mul import Mul
from sympy.core.power import Pow
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.functions.elementary.exponenti... |
<filename>aqueduct/services/cba_service.py
import datetime
import logging
import os
import sys, traceback
import numpy as np
import pandas as pd
import sqlalchemy
from flask import json
from scipy.interpolate import interp1d
from sqlalchemy import Column, Integer, Text, DateTime
from sqlalchemy.dialects.postgresql im... |
import numpy as np
import matplotlib.pylab as plt
from scipy.optimize import leastsq
import os
def readData(filename):
'''
read in data in Decater format
date location uncertainty?
'''
#read in filename splitting into useful python arrays
date,loc,uncert = np.genfromtxt(filename,dtype=float,usecols = (0... |
<reponame>guanghaoyin/CVRKD-IQA
import torch
import os
import random
from dataloaders.dataloader_LQ_HQ import DataLoader
from option_train_DistillationIQA_FR import set_args, check_args
from scipy import stats
import numpy as np
from tools.nonlinear_convert import convert_obj_score
from models.DistillationIQA import Di... |
<gh_stars>1-10
# Authors: <NAME> <<EMAIL>>
# License: BSD 3 clause
import warnings
import numpy as np
import numpy.ma as ma
from scipy import sparse
from scipy import stats
from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array
from ..utils import as_float_array
from ..utils.fixes import ... |
<reponame>le-ander/batchglm<filename>batchglm/unit_test/test_jacobians_glm_all.py
import logging
import unittest
import time
import numpy as np
import scipy.sparse
import batchglm.data as data_utils
import batchglm.pkg_constants as pkg_constants
from batchglm.models.base_glm import InputDataGLM
class Test_Jacobians... |
<reponame>UTexas-PSAAP/Parla.py
import os
os.environ["OMP_NUM_THREADS"] = "24" # This is the default on my machine (Zemaitis)
import argparse
import numpy as np
import scipy.linalg
from time import perf_counter as time
def check_result(A, Q, R):
# Check product
is_correct_prod = np.allclose(np.matmul(Q, R), A)... |
<filename>FAE/Func/Metric.py
import numpy as np
from scipy.stats import sem
from sklearn.metrics import roc_auc_score, roc_curve, confusion_matrix
def AUC_Confidence_Interval(y_true, y_pred, CI_index=0.95):
'''
This function can help calculate the AUC value and the confidence intervals. It is note the confiden... |
# Copyright (c) 2019-2020, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
<filename>src/applications/spectralnet.py
'''
spectralnet.py: contains run function for spectralnet
'''
import sys, os, pickle
import tensorflow as tf
import numpy as np
import traceback
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '0'
from sklearn.cluster import KMeans
from sklearn.preprocessing import OneHotEncoder
from skl... |
import numpy as np
import cv2
from scipy.special import expit as sigmoid
def draw_boxes(img, bboxes_w_conf, color=(0, 0, 255), thick=2, draw_dot=False, radius=7):
# Make a copy of the image
draw_img = np.copy(img)
# Iterate through the bounding boxes
for bbox in bboxes_w_conf:
# Draw a rectangl... |
<gh_stars>0
import copy
import numpy
try:
import matplotlib.pyplot as plt
except ImportError:
plt = False
try:
import scipy.signal
except ImportError:
scipy = False
import slab.signal
from slab.signal import Signal # getting the base class
class Filter(Signal):
"""
Class for generating and ... |
"""
desispec.io.frame
=================
I/O routines for Frame objects
"""
import os.path
import time
import numpy as np
import scipy, scipy.sparse
from astropy.io import fits
from astropy.table import Table
import warnings
from desiutil.depend import add_dependencies
from desiutil.log import get_logger
from ..fram... |
<reponame>jotheshjolly/Speech-Emotion-Recognition-<filename>live_predictions.py
import keras
import librosa
import numpy as np
import sys
import pathlib
import subprocess
import sounddevice as sd
from scipy.io.wavfile import write
working_dir_path = pathlib.Path().absolute()
if sys.platform.startswith('win32'):
MO... |
#Import the required libraries and the sigmoid function(expit)
from scipy.special import expit
import numpy as np
import math
#Import our data
data = np.array([[1,0],[2,0],[3,0],[4,1],[5,1],[6,1],[7,1]])
class Classification(object):
#Setting some of our parameters
def __init__(self, alpha, num_parameter, dat... |
import importlib.resources
from typing import Any, Optional
import numpy as np
import pandas as pd
from scipy.stats import pearsonr
from scipy.stats.mstats import rankdata
def from_file(data_file: str, data_file2: str, learn_options: dict[str, Any]) -> tuple:
if learn_options["V"] == 1: # from Nature Biotech pa... |
<gh_stars>0
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 <NAME> <<EMAIL>>
#
# Distributed under terms of the GNU-License license.
"""
Single degree of freedom with time series external loads
"""
import uqra
from uqra.solver._solverbase import SolverBase
import os, numpy as np, ... |
# Copyright 2019 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 ... |
"""Unit tests for layout functions."""
import sys
from nose import SkipTest
from nose.tools import assert_equal
import networkx as nx
class TestLayout(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
try:
... |
<filename>mdp_playground/envs/rl_toy_env.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import warnings
import logging
import copy
from datetime import datetime
import numpy as np
import scipy
from scipy import stats
from scipy.spati... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erfc
import lmfit
import logging
from pycqed.analysis import analysis_toolbox as a_tools
from pycqed.analysis.tools import data_manipulation as dm_tools
#################################
# Fitting Functions Library #
####################... |
<reponame>hisergiorojas/OpenTimelineIO<filename>contrib/opentimelineio_contrib/adapters/advanced_authoring_format.py
#
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
#... |
import random
from pandas.core.indexes.base import InvalidIndexError
import unit_classes
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy.odr as odr
class Simulation():
def __init__(self, attacker, target, weapon):
if (isinstance(attacker, unit_classes.Attacker)==False):... |
"""
Some codes from https://github.com/Newmu/dcgan_code
"""
from __future__ import division
import math
import json
import random
import pprint
import scipy.misc
import matplotlib
import csv
import re
# matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import numpy as np
from time import gmtime, strftime
from ... |
<gh_stars>0
# Copyright 2018-2020 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by appli... |
<filename>scipy/fft/tests/test_real_transforms.py
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
import pytest
from scipy.fft import dct, idct, dctn, idctn, dst, idst, dstn, idstn
import scipy.fft as fft
from scipy import fftpack
import math
SQRT_2 = math.sqrt(2)
# scipy.fft wraps ... |
import paths
import sys
for p in paths.external:
sys.path.append(p)
import caffe
import lmdb
import random
import gzip
import struct
import numpy as np
from scipy.signal import convolve
from scipy.signal import convolve2d
from scipy.misc import imsave
from scipy.misc import imresize
db=sys.argv[1]
label=int(sys.... |
from __future__ import division
import os
import time
from sklearn.metrics import mean_absolute_error
import scipy.io as sio
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
import csv
from ops_ import *
from utils_ import *
from sklearn.metrics import mean_squar... |
#
# Copyright 2020 British Broadcasting Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
<reponame>barneydobson/cwsd_demand<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 12 11:44:38 2020
@author: Barney
"""
import os
import pandas as pd
from matplotlib import pyplot as plt
import numpy as np
from scipy.stats import spearmanr
import misc
"""Misc
"""
TIMESTEP = 'H'
"""Addresses
"""
data_root =... |
import warnings
from collections import namedtuple
import numpy as np
from fuzzywuzzy import process as fw_process
from scipy.linalg import ldl
from scipy.linalg import qr
def chol_params_to_lower_triangular_matrix(params):
dim = number_of_triangular_elements_to_dimension(len(params))
mat = np.zeros((dim, di... |
# 'source /home/voanna/TimePrediction/src/bash/gpu_caffe_env_variables ')
from __future__ import print_function
import os
import time_to_label
import glob
import math
import numpy as np
import scipy.io
import json
import argparse
import HONHelpers as hon
import random
parser = argparse.ArgumentParser()
parser.add_argu... |
<reponame>mauryas/DataScienceTasks<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 27 21:46:07 2018
These are the steps I have used on the analysis.
- Exploring the data
- Cleaning/pre-processing data
- Training Models
- Hypothesis Test
Please drop an email if you want further information
at... |
from __future__ import print_function
from __future__ import absolute_import
import numpy as np
from sympy import factorial, sympify, Rational
#from sage.combinat.combinat import permutations
from nodepy.utils import permutations
from six.moves import range
#=====================================================
class... |
<filename>topo_control.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 13 11:45:51 2019
@author: virati
Topology control project
"""
import numpy as np
import scipy.signal as sig
import networkx as nx
import mayavi
from mayavi.mlab import *
from scipy.ndimage.filters import gaussian_filter#,... |
# Copyright 2020 - 2021 MONAI Consortium
# 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 in wri... |
"""
Automated ranking of populations for ranking them. This is basically an implementation of Demsar's
Guidelines for the comparison of multiple classifiers. Details can be found in the description of the autorank function.
"""
import warnings
import sys
import numpy as np
import pandas as pd
import matplotlib.pyplot... |
<reponame>Andrea4-sr/prosody_stimuli<filename>loss_lexical_task.py
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
from tqdm import tqdm
import sys
import numpy as np
import random
from scipy.stats import entropy
from scipy.spatial.distance import cosine
class Dataset_Lexical_Loss:
def __init__(... |
import os
from os.path import dirname, join, realpath
import numpy as np
from pystan import StanModel
from scipy.stats import gaussian_kde, norm, cauchy
import expan.core.statistics as statx
__location__ = realpath(join(os.getcwd(), dirname(__file__)))
def obrien_fleming(information_fraction, alpha=0.05):
"""
... |
<reponame>Robo-Sapien/Search-Engine-for-arXiv.org<filename>ScrapedData/IndexData.py<gh_stars>0
from __future__ import print_function
import csv
import numpy as np
import nltk
from nltk import word_tokenize
from nltk import FreqDist
from nltk.stem import WordNetLemmatizer
import pandas
from nltk.corpus import stopwords
... |
import time
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import math as m
import numpy as np
import pandas as pd
import tensorflow_probability as tfp
import matplotlib.pyplot as plt
import math
from tensorflow import keras
from tensorflow.keras import layers
from random import shuffle
from keras import ba... |
<reponame>ishamandrekar/MyMscProj<gh_stars>0
# GUESSER TRANSFORMER
# CODE BY <NAME>
from players.guesser import guesser
import torch
from transformers import RobertaTokenizer, RobertaModel
from sklearn.neighbors import NearestNeighbors
import numpy as np
from scipy.spatial.distance import cosine
import operator
fro... |
<reponame>adiyoss/Representation_Analysis
import matplotlib
import numpy as np
import operator
from matplotlib import pyplot as plt
from scipy import stats
def check_norms(repr_path, labels):
reprs = np.load(repr_path)
norms = dict()
# plot_norm = list()
for i, r in enumerate(reprs):
n = np.li... |
__copyright__ = """
Machine Learning for Distributed Acoustic Sensing data (MLDAS)
Copyright (c) 2020, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of
any required approvals from the U.S. Dept. of Energy). All rights reserved.
If you have questions abou... |
<gh_stars>1-10
import itertools as it
from bisect import bisect_left
from typing import List
import numpy as np
import pandas as pd
import scipy.stats as ss
from pandas import Categorical
# turn off the SettingWithCopyWarning
pd.set_option('mode.chained_assignment', None)
def VD_A(treatment: List[float], control: Li... |
from __future__ import print_function
import numpy as np
from scipy.optimize import curve_fit
from scipy.interpolate import PchipInterpolator
import os, copy, warnings, shutil
from openmdao.api import IndepVarComp, ExplicitComponent, Group, Problem
from wisdem.commonse.mpi_tools import MPI
from wisdem.aeroelasticse.F... |
import numpy as np
from ..tools import *
from ..thermodyn import *
from scipy.interpolate import RegularGridInterpolator
g = 9.80665 # (m/s2)
class pressure_density_profile(object):
def __init__(self,P=[],Z=[],rho=[],melt_fraction=[],dz=200):
self.P = P # pressure (MPa)
self.Z = Z ... |
import unittest
from unittest import signals
from numpy.core.fromnumeric import shape
from scipy.signal.signaltools import resample
from antenna_diversity.diversity_technique import selection
import numpy as np
class TestSelection(unittest.TestCase):
def setUp(self):
self.signals = np.array([[1, 2, 3], [... |
import h5py
import numpy as np
from scipy.spatial.transform import Rotation as R
def correct_bad_chair(phases_dict):
"""
bad chair b'648972_chair_poliform_harmony' is not completely removed in current data
try to fix it here
"""
if len(phases_dict["instance_idx"]) - 1 != phases_dict["n_objects"]:
... |
import numpy as np
from scipy import stats
import cv2
import numexpr as ne
import imutils
import math
import time
from queue import TQueue
# Get video feed
cap = cv2.VideoCapture("aa.mp4")
# Get region of interest (crop)
ret, frame = cap.read()
# resize
scale = 5
frame = cv2.resize(frame, (frame.shape[1] * scale, fra... |
<reponame>ihavalyova/Diatom
from os import makedirs as _makedirs
from os.path import join as _join
from random import shuffle as _shuffle
from scipy.interpolate import CubicSpline as _CubicSpline
import numpy as np
from utils import Utils, C_hartree, C_bohr
import matplotlib.pyplot as plt
import matplotlib.ticker as tc... |
#!/usr/bin/env python3
"""
Machine learning for PDF shapes
"""
# ========================================================================
#
# Imports
#
# ========================================================================
import os
import time
import datetime
import numpy as np
import pickle
import pandas as pd
f... |
<filename>buhmm/twosample.py
"""
Two-sample tests to determine if two histograms are "equal".
"""
from __future__ import division
import numpy as np
import scipy.stats as stats
__all__ = [
'chisq_twosample',
'bayesian_twosample',
'bv_nonextreme_twosample',
]
def chisq_twosample(countsX, countsY, alpha):... |
<filename>august_2015b.py
# coding: utf-8
""" Reduction script for APF 2015B data. """
from __future__ import division, print_function
__author__ = "<NAME> <<EMAIL>>"
import cPickle as pickle
import logging
import matplotlib
matplotlib.rcParams["text.usetex"] = True
from matplotlib.ticker import MaxNLocator
from sc... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 28 15:58:31 2014
@author: viktor
plumy.Sensor - A Metal-Oxide-Sensor representation
The Sensor Class is the lowest link in our Object Oriented Data Model, thus
representing the smallest possible contributor to the Dataset.
There are 6 x 9 x 8 = 432 Sensors in the plumy ... |
<gh_stars>0
import numpy as np
import os
import warnings
import chainer
from chainercv.datasets.sbd import sbd_utils
from chainercv.datasets.voc import voc_utils
from chainercv.utils import read_image
try:
import scipy
_available = True
except ImportError:
_available = False
def _check_available():
... |
import os
import glob
import re
from datetime import datetime
import pandas as pd
import scipy.ndimage as ndimage
import numpy as np
import matplotlib.pyplot as plt
import cv2
import src.data.readers.load_hrit as load_hrit
import src.config.filepaths as fp
# CONSTANTS
MAX_REFLEC = 0.05
def get_geostationary_fnames... |
# -*- coding: utf-8 -*-
"""
pysteps.nowcasts.steps
======================
Implementation of the STEPS stochastic nowcasting method as described in
:cite:`Seed2003`, :cite:`BPS2006` and :cite:`SPN2013`.
.. autosummary::
:toctree: ../generated/
forecast
"""
import numpy as np
import scipy.ndimage
import time
... |
import copy
import itertools
import numpy as np
import pandas as pd
from scipy.special import erf
from scipy import stats
class JointNormal(object):
"""
:type labels: list
:param labels: A list of string labels for the variables in this distribution
:type mu: iterable of numbers or N x 1 numpy.matri... |
import scipy
import scipy.stats
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils import check_random_state
from sklearn.exceptions import NotFittedError
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PC... |
from StochasticModels.ClosedFormModels.CGenericOptionBlackScholesModel import calculate_d1 as __parent_calculate_d1
from StochasticModels.ClosedFormModels.CGenericOptionBlackScholesModel import calculate_d2 as __parent_calculate_d2
from StochasticModels.ClosedFormModels.CGenericOptionBlackScholesModel import calculate_... |
<reponame>eliask/openml-python
import collections
import copy
import hashlib
import re
import sys
import time
if sys.version_info[0] >= 3:
from unittest import mock
else:
import mock
import scipy.stats
import sklearn
import sklearn.datasets
import sklearn.decomposition
import sklearn.dummy
import sklearn.ense... |
<reponame>0x9900/wspr
#!/usr/bin/env python
"""The program leaf.py download the last 24 hours worth of data from WSPR
net and compute statistical analysis of your contacts.
To use leaf.py you need to set 2 environment variables one
with your call sign the second one with your wspr (dxplorer) key.
For example:
$ expor... |
from scipy.interpolate import interp1d
from pyHalo.defaults import *
from pyHalo.Cosmology.cosmology import Cosmology
from pyHalo.Halos.lens_cosmo import LensCosmo
from pyHalo.Halos.HaloModels.NFW import NFWSubhhalo, NFWFieldHalo
from pyHalo.Halos.HaloModels.TNFW import TNFWFieldHalo, TNFWSubhalo
from pyHalo.Halos.Halo... |
# TODO:
# - think about making all of the below subclasses
# - think about supporting the COO format
from typing import Optional
import six
import h5py
import numpy as np
import scipy.sparse as ss
from scipy.sparse.sputils import IndexMixin
from ..compat import PathLike
FORMAT_DICT = {
'csr': ss.csr_matrix,
... |
<reponame>velocist/TS4CheatsInfo<filename>Scripts/simulation/eco_footprint/eco_footprint_tuning.py
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\e... |
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import VyPy
from VyPy.data import ibunch
from VyPy.optimize.drivers import Driver
import numpy as np
from time import time
from VyPy.exceptions import... |
<filename>deepv2d/deepv2d.py
import tensorflow as tf
import numpy as np
import time
import cv2
import vis
from scipy import interpolate
import matplotlib.pyplot as plt
import struct
import os
from modules.depth import DepthNetwork
from modules.motion import MotionNetwork
from utils import flow_viz
from fcrn import fc... |
"""Common tools."""
import numpy as np
import scipy.linalg as sla
from tqdm.auto import tqdm as progbar
def repeat(model_step, nSteps, x0, dt, obs_model=None, pbar=True, **kwargs):
"""Recursively apply `model_step` `nSteps` times. Also apply `obs_model`.
Note that the output time series of states includes t... |
import datetime
import os
import arrow
import matplotlib.pyplot as plt
import numpy as np
import open3d as o3
import progressbar
import scipy.interpolate
import cluster
import kittiwrapper
import mapping
import particlefilter
import polesdetection as poles
import util
import makegif as mkgif
dataset = kittiwrapper... |
<gh_stars>0
import numpy as np
from scipy import linalg
from scipy.sparse import csr_matrix
from scipy.linalg import svd, eigvals
from pyamg.util.linalg import approximate_spectral_radius,\
infinity_norm, norm, condest, cond,\
ishermitian, pinv_array
from pyamg import gallery
from numpy.testing import TestCa... |
<gh_stars>1-10
#!/usr/bin/env python3
import numpy as np
from numpy import inf
from numpy import nan
from scipy.optimize import fmin
from scipy.stats import beta
from scipy.special import beta as B
from scipy.special import comb
import sys
#import matplotlib.pyplot as plt
def betaNLL(params,*args):
a,b = params
... |
#########################
## ##
## <NAME> ##
## February 12, 2021 ##
## ##
#########################
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import t
# The general formula of a ellipse is given by
# x^2 + By^2 + Cxy + Dx + Ey + F = 0
# i.e. By^2 + ... |
import scipy.ndimage as nd
from scipy.optimize import curve_fit
import numpy as np
import matplotlib.pyplot as p
import astropy.units as u
from astropy.table import QTable
from .profile import profile_line
eight_conn = np.ones((3, 3))
end_structs = [np.array([[1, 0, 0],
[0, 1, 0],
... |
<filename>old_scripts/relative_with_interpolation.py
import numpy as np
import cv2
import matplotlib.pyplot as plt
num_points_to_track = 200
x_coord_start = 200
x_coord_stop = 1720
frame_list = []
manifold_data = []
show_video_images = False
cap = cv2.VideoCapture("data/rope_two_hands.mp4")
if not cap.isOpened():
... |
<filename>chord_detection/camacho_kaver_oreamuno/prime_multif0.py
import numpy
import math
import random
import scipy
import scipy.signal
import librosa
import typing
import peakutils
from matplotlib import mlab
import matplotlib.pyplot as plt
from ..multipitch import Multipitch
from ..chromagram import Chromagram
from... |
# rlocus.py - code for computing a root locus plot
# Code contributed by <NAME>, 2010
#
# Copyright (c) 2010 by <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of s... |
<reponame>RParedesPalacios/GILA
import json
import random
from loaders import *
from keras.preprocessing.image import *
import numpy as np
import scipy.ndimage
#### DETECT TOOLS
def iou(box1,box2):
## (x1,y1,x2,y2)
w1=box1[2]-box1[0]
h1=box1[3]-box1[1]
w2=box2[2]-box2[0]
h2=box2[3]-box2[1]
... |
<reponame>henri-chat-noir/PyPSA-Docs-Staging<filename>pypsa/pf.py
## Copyright 2015-2021 PyPSA Developers
## You can find the list of PyPSA Developers at
## https://pypsa.readthedocs.io/en/latest/developers.html
## PyPSA is released under the open source MIT License, see
## https://github.com/PyPSA/PyPSA/blob/master... |
'''
tRNA Adaptation Index
'''
import collections
import os
import json
import logging
import pandas as pd
import numpy as np
import scipy.stats.mstats
from sqlalchemy import create_engine
from ..alphabet import CODON_REDUNDANCY
logger = logging.getLogger(__name__)
def main():
logging.basicConfig(level=logging... |
<reponame>jstac/production_chains<gh_stars>1-10
from scipy import interp
class linInterp:
"Provides linear interpolation in one dimension."
def __init__(self, X, Y):
"""Parameters: X and Y are sequences or arrays
containing the (x,y) interpolation points.
"""
self.X, self.Y = ... |
import unittest
import numpy as np
import scipy.stats
import PySeismoSoil.helper_generic as hlp
import PySeismoSoil.helper_site_response as sr
import os
from os.path import join as _join
f_dir = _join(os.path.dirname(os.path.realpath(__file__)), 'files')
class Test_Helper_Site_Response(unittest.TestCase):
def... |
<reponame>yzhao062/SUOD<gh_stars>100-1000
# Author: <NAME> <<EMAIL>>
# License: MIT
from sklearn.base import clone
import numpy as np
from scipy.stats import rankdata
from joblib import effective_n_jobs
from sklearn.utils import check_array
from sklearn.utils.validation import check_is_fitted
from pyod.utils.utility ... |
# <NAME> - 2019-04-18
# Subpixel registration test with various levels of poisson noise, circular shift
# based on https://scikit-image.org/docs/dev/auto_examples/transform/plot_register_translation.html
import numpy as np
import matplotlib.pyplot as plt
from skimage import data
from skimage.feature import register_t... |
<gh_stars>1-10
"""
Hierarchical Clustering for Document Embeddings
usage: python3 clustering.py -h
Author: <NAME>
"""
# Imports
import numpy as np
from scipy import ndimage
import os
import sys
if not os.environ.get('DISPLAY') is None:
HEADLESS = False
from matplotlib import pyplot as plt
else:
... |
#!/usr/bin/env python
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
<filename>variants_spike.py<gh_stars>1-10
from Bio import SeqIO
import csv
import pandas as pd
from sys import argv
from pathlib import Path
from scipy.stats import binom
import operator
from datetime import datetime
"""
create variants table - for each sample in fasta multiple alignment file a covid variant is decide... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib
import os
from glob import glob
import sys
import gc
from scipy.optimize import curve_fit
from astropy.table import Table
import astropy.io.fits as fits
from astropy.timeseries import LombScargle, BoxLe... |
import random
import numpy as np
from typing import Tuple, List, Hashable
from scipy.ndimage import gaussian_filter
class GaussianNoiseTransform:
def __init__(self, random_state, noise_variance=(0, 0.1), p_per_channel: float = 1,
per_channel: bool = False, data_key="data", execution_probabilit... |
<reponame>AlexJew/CityEnergyAnalyst
# -*- coding: utf-8 -*-
"""
Sewage source heat exchanger
"""
from __future__ import division
import pandas as pd
import numpy as np
import scipy
from cea.constants import HEX_WIDTH_M,VEL_FLOW_MPERS, HEAT_CAPACITY_OF_WATER_JPERKGK, H0_KWPERM2K, MIN_FLOW_LPERS, T_MIN, AT_MIN_K, P_SEWAG... |
"""
Helper function for CQED-CIS in the coherent state basis
References:
Equations and algorithms from
[Haugland:2020:041043], [DePrince:2021:094112], and [McTague:2021:ChemRxiv]
"""
__authors__ = ["<NAME>", "<NAME>"]
__credits__ = ["<NAME>", "<NAME>"]
__copyright_amp__ = "(c) 2014-2018, The Psi4NumPy Dev... |
<reponame>acolombi/pymc3
import numpy as np
from scipy.signal import gaussian, convolve
from scipy.stats import entropy
try:
import matplotlib.pyplot as plt
except ImportError: # mpl is optional
pass
def kdeplot(values, label=None, shade=0, bw=4.5, ax=None, kwargs_shade=None, **kwargs):
"""
1D KDE p... |
from scipy.optimize import minimize
from .measure.measure_sample import dst,hst,dst_source
from .measure.measure_sim import sep_purity, fid_ref, c_entropy
def vcirc_test(
x,
statein,
vcirc,
test_func=sep_purity,
ansatz_li=None,
update=False,
*args,
**kw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.