text string |
|---|
<reponame>GS-Shashank/DSP-basic-codes
"""
#######################################
IIR system
code by: GSS
#######################################
Consider the equation
y(n)=0.2x(n)+0.4x(n-1)+0.5y(n-2)
Let us solve the difference equation for the IIR system
chose x(n)= delta function a... |
import math
def yorumyap():
with open ("160401056_yorum.txt","w") as dosya:
dosya.write("Batuhan Şahin 160401056.\n")
dosya.write("3. ve 4. maddelerde farklı sonuç çıkma sebebi deltax değeridir.Deltax parçaladığımız parçaların enini ifade eder.\n")
dosya.write("Deltax azaldığı zaman parçalar... |
# This file contains predictors of our model
# Currently contains: average-based predictor
# Update on Dec. 01, 2020:
# 1. add multi-label method 1 and 2 to predictor (excluding weight section)
# 2. multi-label method 1 and 2 pass toy testing
# 3. remove prediction mode as can be derived from score
# 4. remove verbos... |
<reponame>zaqqwerty/qhbm-library
# Copyright 2021 The QHBM Library 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
#
# https://www.apache.org/licenses/LICENS... |
<gh_stars>0
from scipy.ndimage.interpolation import shift
import cv2
import os
import argparse
from math import *
from data_augmentation.utils.xml_utils import show_object_cv_box
from data_augmentation.utils import io_utils, xml_store,xml_utils
from tools import _init_paths
from model.config import cfg
def translate... |
#!/usr/bin/env python3
"""typex.py
Type extensions that build on those provided by the built-in typing module.
"""
__author__ = '<NAME>'
from abc import ABCMeta, abstractmethod
from fractions import Fraction
from typing import (
Any,
List,
Tuple,
TypeVar,
Union,
)
# Generic type variables
T = T... |
<reponame>kleinschmidt/formulaic
import numpy
import pytest
import scipy.sparse as spsparse
from formulaic.errors import DataMismatchWarning
from formulaic.materializers.transforms import encode_categorical
from formulaic.model_spec import ModelSpec
def test_encode_categorical():
state = {}
spec = ModelSpec(... |
""" xarray tools for calling wavelet analysis """
import warnings
import xarray as xr
import numpy as np
from scipy.stats import skew
from . import wavelets
def detrend_array(arr, dim="time", deg=1):
"""Detrend an Xarray DataArray
Parameters
----------
arr : xarray.DataArray
Input data array... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 21 13:12:03 2021
@author: jane_hsieh
Goal: Find out the potential anomalies of variable –"Tran Count", and visualize the results
Here we use a person's bank account transaction record, in the case of 'Japan', 'Australia',or 'USA'
Resource... |
<filename>hfcs-fffit/analysis/final-figs/presentations/plotfig3-r125_prev.py
import sys
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import seaborn
sys.path.append("../../")
from scipy.stats import linregress
from utils.r125 import R125Constants
from matplotlib.ticker impor... |
<reponame>le-ander/epiScanpy<filename>episcanpy/preprocessing/_load_matrix.py
import numpy as np
from scipy.io import mmread
import pandas as pd
import anndata as ad
def read_ATAC_10x(matrix, cell_names='', var_names='', path_file=''):
"""
Load sparse matrix (including matrices corresponding to 10x data) as A... |
<gh_stars>10-100
import numpy as np
import pandas as pd
from scipy.sparse import vstack, save_npz, csr_matrix
from sklearn.metrics import pairwise_distances
import sys
import trajectorama
from process import merge_datasets
from subtypes_zeisel_saunders import (
interpret_clustermap, plot_clustermap, sub_coexpr,
)
... |
import numpy as np
from scipy.optimize import least_squares
from Models.MixtureModel import MixtureModel
class FitExpDataToBinaryParameterModel:
def __init__(
self,
model: MixtureModel,
isovar: float,
diagtype: str,
x_exp,
y_exp,
data_exp,
initial_k... |
<reponame>maximillian91/scVAE
# ======================================================================== #
#
# Copyright (c) 2017 - 2018 scVAE 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 Li... |
# Covid Detection WebService
#
# $ curl -XPOST -F "file=@covid.jpg" http://127.0.0.1:5001
from flask import Flask, jsonify, request, redirect
from flask_ngrok import run_with_ngrok
import cv2
import PIL
import numpy as np
from sklearn.svm import NuSVC
import pickle
from scipy.io import loadmat
import time
# Create An... |
<gh_stars>1-10
from scipy.integrate import simps
from sklearn.metrics import auc
from scipy.signal import find_peaks
from numpy import*
#Read the scan rate in a file name.
#In the filename, the scan rate is stated at the very front of the file, OR
#the scan rate seperated from other elements of the filename and/or sep... |
import clamp_ephys
import pandas as pd
import os
import scipy
import matplotlib
import matplotlib.pyplot as plt
'''####################### SET THE PROPER PATH YOU WANT ########################### '''
paths = clamp_ephys.workflows.file_structure('local', 'Injected_GC_data/VC_pairs')
tables = paths.tables
figures = path... |
<reponame>martinlarsalbert/wPCC<gh_stars>0
"""[summary]
[1] <NAME>., <NAME>, and <NAME>. “The Application of Manoeuvring Criteria in Hull Design Using Linear Theory.” Transactions of the Royal Institution of Naval Architects, RINA., 1982. https://repository.tudelft.nl/islandora/object/uuid%3A2a5671ac-a502-43e1-9683-f2... |
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2011 and later, <NAME> and <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. Redistrib... |
<gh_stars>0
import itertools
import math
import numpy as np
import rasterio
from scipy import interpolate
import os
# To help indentify bottleneck(s)
import datetime as dt
def load_datasets():
"""
Loads the two target datasets from disk into memory.
"""
start_time = dt.datetime.now()
print("Read... |
from cmath import pi
import numpy as np
from Utils.Cluster import Cluster
class GaussianDistribution:
def __init__(self, cluster, num_samples, k, dim) -> None:
'''
Gaussian Distribution
phi := the proportion of this distribution related to the whole sample space of points
mu := th... |
"""File to generate synthetic data
"""
import numpy as np
from numpy.linalg import norm
from scipy.linalg import toeplitz
from sklearn.utils import check_random_state
def get_synt_data(
dictionary_type="Gaussian", noise_type="Gaussian_iid", n_samples=20,
n_features=20, n_times=30, n_active=3, rho=0... |
<gh_stars>0
from unittest.mock import MagicMock
import numpy as np
import pytest
from numpy.testing import assert_allclose
import tensorflow as tf
from dgp_aepmcm.nodes.output_node_multiclass import OutputNodeMulticlass
from scipy.integrate import quad
from scipy.special import logsumexp
from scipy.stats import norm
... |
'''
Extractors that operate primarily or exclusively on Text stimuli.
'''
import sys
import itertools
import logging
import numpy as np
import pandas as pd
import scipy
import nltk
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from pliers.stimuli.text import TextStim, ComplexTextStim
from pliers.extract... |
#!/usr/bin/python
from scipy.stats import norm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
# read data from a text file. One number per line
arch = "./data/HB101-N2-before-worm1_to_15.dat"
datos = []
for item in open(arch,'r'):
item = item.strip()
if item != '':
try:
dato... |
# Written by Dr <NAME>, Marda Science LLC
# for the USGS Coastal Change Hazards Program
#
# MIT License
#
# Copyright (c) 2020, Marda Science LLC
#
# 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 Soft... |
# -*- coding: utf-8 -*-
import math
from copy import deepcopy
import numpy as np
from scipy import linalg as LA
def create(config, command_model, motion_model, obs_model):
if config['type'] == 'ekf':
return ExtendedKalmanFilter(command_model, motion_model, obs_model)
elif config['type'] == 'ukf':
... |
import numpy as np
import os
import pickle as Pickle
from flarestack.icecube_utils.dataset_loader import data_loader
from flarestack.core.energy_pdf import EnergyPDF
import matplotlib.pyplot as plt
from flarestack.shared import weighted_quantile, floor_pickle, pull_pickle
from flarestack.core.astro import angular_dista... |
from numpy import equal, where, isnan, maximum, minimum, exp, logical_not, logical_and, logical_or, select, less_equal, greater_equal, less, greater, nan, inf, log
from scipy.special import expit
%for function_code in functions:
${function_code}
%endfor |
import colorsys
import pickle
from collections import OrderedDict
import boost_histogram as bh
import matplotlib
import matplotlib.pyplot as plt
import mplhep as hep
import numpy as np
import scipy.optimize
import uproot
from coffea.util import load
from hist import Stack
plt.style.use([hep.style.ROOT, hep.style.fira... |
def test_fft():
import numpy as np
from pwtools import signal
from scipy.fftpack import fft
y = np.random.rand(1000)
pwtools_ffty = signal.dft(y)
scipy_ffty = fft(y)
np.testing.assert_almost_equal(scipy_ffty, pwtools_ffty)
np.testing.assert_almost_equal(scipy_ffty.real, pwtools_ffty.rea... |
<filename>utils/normalize.py
'''
<NAME>
NIH CC CNRM
Normalization
'''
import numpy as np
from statsmodels.nonparametric.kde import KDEUnivariate
from scipy.signal import argrelextrema
def normalize_data(img, contrast='T1'):
'''
Normalizes 3D images via KDE and clamping
Params:
- img: 3D image
... |
import torch
import numpy as np
from PIL import Image, ImageOps
import collections
try:
import accimage
except ImportError:
accimage = None
import random
import scipy.ndimage as ndimage
import pdb
def _is_pil_image(img):
if accimage is not None:
return isinstance(img, (Image.Image, accimage.Imag... |
from . import DATA_DIR
import sys
import glob
from .background_systems import BackgroundSystemModel
from .export import ExportInventory
from inspect import currentframe, getframeinfo
from pathlib import Path
from scipy import sparse
import csv
import itertools
import numexpr as ne
import numpy as np
import xarray as xr... |
<reponame>ablotekar/irfu-python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# 3rd party imports
import xarray as xr
from scipy import signal
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__copyright__ = "Copyright 2020-2021"
__license__ = "MIT"
__version__ = "2.3.7"
__status__ = "Prototype"
def lowpass(inp, f_cut,... |
## evaluate the model and generate the prediction
import sys
sys.path.append('../lib')
from tensorflow.keras.models import load_model
import os
import scipy.io.wavfile as wavfile
import numpy as np
import tensorflow as tf
import utils
# super parameters
people_num = 2
NUM_GPU = 1
# PATH
# model_path = './AVmodel-2p-0... |
"""
This branch is the software release for the 2019 paper: https://www.nature.com/articles/s41598-019-47795-0
See LICENSE.txt
Copyright 2019 Massachusetts Institute of Technology
Useage:
from importlib import reload
module = __import__(file_name)
reload(module)
get_data = getattr(module, 'get_data'
"""
__author__ ... |
from __future__ import division, print_function, absolute_import
import os
import argparse
import datetime
import matplotlib
import numpy as np
import scipy.io
import tensorflow as tf
from sklearn.metrics import mean_absolute_error, mean_squared_error
matplotlib.use('Agg')
import matplotlib.pyplot as plt
os.environ... |
<reponame>zuranski/imolecule<filename>imolecule/format_converter.py
"""
Methods to interconvert between json and other (cif, mol, smi, etc.) files
"""
import imolecule.json_formatter as json
from collections import Counter
from fractions import gcd
from functools import reduce
# Open Babel <= '2.4.1'
try:
import ... |
<gh_stars>10-100
#!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().system('pip install console_progressbar')
# In[2]:
# This preprocessing portion of the code is provided by foamliu on his github repo
# https://github.com/foamliu/Car-Recognition/blob/master/pre-process.py
import tarfile
import scipy.... |
<gh_stars>0
# -*- coding: utf-8 -*-
import numpy as np
import sympy
from sympy.plotting import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.pylab import mpl
import ikernal23 as ker
from scipy.ndimage.filters import convolve as convolveim
# 解决画图是中文显示的问题
mpl.rcPa... |
"""
The main class
========================================================
"""
import math
import numpy as np
import pandas as pd
from scipy.signal import convolve2d
pi=math.pi
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
numTFThreads = 0
import tensorflow_probability as tfp
tfd = tfp.di... |
<filename>recepmod/StoneModel.py
import os
from scipy.special import binom
from scipy.stats import poisson
from scipy.optimize import newton
import numpy as np
np.seterr(over='raise')
def logpdf_sum(x, loc, scale):
"""
Normal distribution function. Sums over the likelihoods of points in x
"""
root2 =... |
import numpy as np
from scipy.cluster import vq
def python_vq(all_data,code_book):
import time
t1 = time.time()
codes1,dist1 = vq.vq(all_data,code_book)
t2 = time.time()
#print 'fast (double):', t2 - t1
#print ' first codes:', codes1[:5]
#print ' first dist:', dist1[:5]
#print ' last... |
<gh_stars>1-10
from sympy import symbols
from sympy.utilities.iterables import postorder_traversal, \
preorder_traversal, flatten, subsets
w,x,y,z= symbols('wxyz')
def test_postorder_traversal():
expr = z+w*(x+y)
expected1 = [z, w, y, x, x + y, w*(x + y), z + w*(x + y)]
expected2 = [z, w, x, y, x + y... |
<filename>code/kernel_fcns.py
# this file contains the integral kernel functions that are used for applying the
# forward and adjoint operators
import numpy as np
from params import beta0,slope,k,kx,ky,uh0,ub0,tau,nu,lamda,t,t_final,Nt
from scipy.signal import fftconvolve
#---------------------convolution and cross-co... |
# coding: utf-8
# In[ ]:
# Awesome image patch finder,
# Due to http://stackoverflow.com/questions/9525313
import os
import sys
import numpy
import random
import numpy as np
import scipy.ndimage as ndimage
import scipy.spatial as spatial
import scipy.misc as misc
import matplotlib.pyplot as plt
import matplotlib.p... |
import sys
from pathlib import Path
from copy import deepcopy
import numpy as np
from scipy.stats import norm
import pandas as pd
from matplotlib import pyplot as plt
import PIL
from PIL import Image
util_dir = Path.cwd().parent.parent.joinpath('Utility')
sys.path.insert(1, str(util_dir))
from Abstract import binnin... |
<reponame>charles-blouin/Servorobots
import numpy as np
import matplotlib.pyplot as plt
import json
import servorobots.components.dc_motor as motor
# This file opens a step_test output file and finds the motor constants that fit the motors best.
import scipy.optimize as opt
# should be run from the top servorobots fo... |
import imageio
import numpy as np
from scipy import ndimage
a = np.zeros((600, 600, 3), dtype=np.uint8)
rect = np.zeros((400, 400, 3), dtype=np.uint8)
blue = np.array([0, 127, 255])
rect[100:300,:] = blue // 9
for i in range(0, 180, 10):
r = ndimage.rotate(rect, i)
x = 300 - r.shape[1] // 2
y = 300 - r.sh... |
<reponame>valentinissot/corona
# http://localhost:8050/
import datetime
import os
import yaml
import numpy as np
import pandas as pd
from scipy.integrate import solve_ivp
from scipy.optimize import minimize
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import dash
import dash_core_compone... |
import torch
from numpy import flip
import numpy as np
from scipy.signal import convolve2d, correlate2d
from torch.autograd import Function
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class ScipyConv2dFunction(Function):
@staticmethod
def forward(ctx, input, filter, bia... |
import uclasm
from timeit import default_timer
from time import sleep
from matplotlib import pyplot as plt
import numpy as np
import scipy as sp
from scipy.sparse import csr_matrix
from multiprocessing import Process, Queue, cpu_count
np.random.seed(0)
timeout = 10000
def process_fn(tmplt, world, result_queue=None,... |
from abc import ABC
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.constants import c
from scipy.optimize import curve_fit
from scipy.ndimage import gaussian_filter1d
import os
from glob import glob
from astropy.table import Table, join, vstack, hstack, unique
from desispec.... |
import matplotlib.pyplot as plt
import numpy as np
from numpy import arange, ones, zeros, where, exp
from numpy import sum as npsum, max as npmax
from scipy.linalg import expm
plt.style.use('seaborn')
def FitMarkovChainFP(dates,t_end,N,n,m,lam=None):
# This function computes the credit transition matrix p, toge... |
<gh_stars>10-100
from . import nn, util, thutil, optim, ContinuousSpace, FiniteSpace, RaggedArray
from collections import namedtuple
from contextlib import contextmanager
import environments
import numpy as np
import theano
from theano import tensor
from abc import abstractmethod
class Policy(nn.Model):
def __in... |
<gh_stars>0
# Author: <NAME>
# Creation date: 4 Dec 2020
from mlt import ROOT_DIR
from mlt.utils import download_file_from_google_drive
from scipy.stats import ortho_group
import ast
import json
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplotlib.ticker import MaxNLocator
impor... |
<filename>servers/health_monitor/src/HealthMonitorDaemon/healthmonitordaemon/butterworth_filter.py<gh_stars>10-100
import scipy.signal as signal
def butterworth_filter(x, order=144, lowcut=0.5, highcut=100):
b, a = signal.butter(order, [lowcut, highcut], 'band', True)
filtered = signal.lfilter(a, b, x)
r... |
# Copyright <NAME> 2019-2021.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import jax
import jax.numpy as jnp
import scipy
jax.config.update("jax_enable_x64", True)
def gaussian_decay(x, *... |
<filename>wires.py
import cmath
import functools
import math
import re
import types
from typing import Union
import kwant
import kwant.continuum
import numpy as np
import scipy.constants
from scipy.constants import physical_constants
from shapely.geometry import Point, Polygon
from shapely import speedups
import peie... |
<filename>irispreppy/psf/deconvolve.py<gh_stars>1-10
import concurrent.futures
import pickle
from copy import deepcopy as dc
from glob import glob as ls
from os import cpu_count as cpus
from os import path
import numpy as np
import scipy.stats as scist
from astropy.io import fits
from tqdm import tqdm
from . import I... |
<filename>day15/homework/Hired_or_not_with_GUI.py<gh_stars>0
from tkinter import *
import pandas as pd
import numpy as np
import seaborn as sb
from sklearn.linear_model import LinearRegression
from sklearn.cross_validation import train_test_split
from sklearn import metrics
from sklearn.linear_model import LogisticRegr... |
"""
Import as:
import core.plotting as cplott
"""
# TODO(gp): Test with a gallery notebook and/or with unit tests.
import calendar
import logging
import math
from typing import Any, Dict, List, Optional, Tuple, Union, cast
import matplotlib as mpl
import matplotlib.cm as mcm
import matplotlib.colors as mcolor
impor... |
<reponame>jutanke/mv3dpose
import numpy as np
from mv3dpose.baseline import estimate, distance_between_poses
from scipy.optimize import linear_sum_assignment
from scipy.ndimage.filters import gaussian_filter1d
import json
def tracking(calib_per_frame, poses_per_frame,
actual_frames=None,
epi... |
import environments.ControlledRangeVariance
from opebet import wealth_lb_1d, wealth_lb_2d, wealth_2d, wealth_lb_2d_individual_qps
import pickle
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt
def getenv(wsq, tv=None):
wsupport = [0, 0.5, 2, 100]
env = environm... |
# -*- coding: utf-8 -*-
import sys
sys.path.append('/notebooks')
import wave
import struct
import glob
import params as par
import os.path
from scipy import fromstring, int16
import numpy as np
test_files = glob.glob(par.base_data + 'input/*.wav')
test_files = test_files[:3]
def get_dataset(filename):
wavfile = ... |
<gh_stars>1-10
"""
Implementation of entrenchment-based revision in belief bases.
The algorithms have been adapted from "Applications of Belief Revision"
by <NAME>, 1996.
"""
import math
import logging
from operator import neg
from sympy.logic.boolalg import to_cnf, And, Or, Equivalent
from sortedcontainers import S... |
'''
* Copyright 2018 Canaan 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 applicable law or agreed to... |
from mvregfus.mv_utils import matrix_to_params, params_to_matrix, params_invert_coordinates, invert_params, \
params_to_pmap, image_to_sitk, sitk_to_image
__author__ = 'malbert'
import logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)
import os,tempfile, sys,copy
import numpy as np
fr... |
from Bio import Phylo
from Bio.Phylo import PhyloXML
from Bio.Phylo import PhyloXMLIO
from collections import defaultdict as ddict
from Bio.Phylo.PhyloXML import Property as Prop
from Bio.Phylo.PhyloXML import Clade as PClade
from Bio.Phylo.BaseTree import Tree as BTree
from Bio.Phylo.BaseTree import Clade as BClade
im... |
import numpy as np
import pandas as pd
import cv2
from config import *
from scipy.stats import multivariate_normal
import itertools
import tensorflow as tf
class Misc:
@staticmethod
def get_image_rgb(text):
img = np.zeros(shape= (Config.IMAGE_SIZE[0], Config.IMAGE_SIZE[1], 3), dtype= np.uint8)
values = [int(i) fo... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from six.moves import range
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import zhusuan as zs
def toy2d_intractable_posterior(obser... |
#!/usr/bin/env python
# coding: utf-8
"""
Deconvolve radon observations from simulated observations (700L detector)
"""
from __future__ import (absolute_import, division,
print_function)
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import dat... |
<reponame>pierfra-ro/stingray<filename>stingray/stats.py
import warnings
from collections.abc import Iterable
import numpy as np
from scipy import stats
from stingray.utils import simon
from stingray.utils import vectorize, float64, float32, int32, int64
__all__ = ['p_multitrial_from_single_trial',
'p_sin... |
import sys
import os
import cPickle as pickle
import scipy
import scipy.stats
import re
import numpy as np
import pandas as pd
import seaborn as sns
from pandas.plotting import scatter_matrix
import seaborn as sns
from stock.utils.symbol_util import get_stock_symbols, get_archived_trading_dates
from stock.marketdata.st... |
<filename>energy_models/hue/runit.py
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 06 10:09:58 2014
@author: Patrick
"""
'''Ablauf: Einlesen Train und Test, Filtern der Laenge 2, Zeitverschiebung
mit Kreuzkorrelation, beste Sensorkombination und Regressionsverfahren
ermitteln mit MSE als Optimierungskriter... |
<filename>linear_plots.py
#####################
# Copyright <NAME> 2019
#####################
# Python script containing all functions for solving the linear optimal control problem and generating
# corresponding plots. Also contains some miscellaneous functions for further plotting of results.
#####################
i... |
<filename>scripts/stt_silero.py<gh_stars>10-100
import os
import json
import argparse
import base64
import requests
import scipy.io.wavfile
# https://api.silero.ai/docs#operation/transcribe_transcribe_post
parser = argparse.ArgumentParser()
parser.add_argument('--input-path', '-i')
parser.add_argument('--output-path... |
import glob
import os
from astroquery.irsa import Irsa
import astropy.coordinates as crd
import astropy.units as u
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import readsav
from astropy.io import fits
from exoctk.utils import get_env_variables
EXOCTK_DATA = os.environ.get('EXOCTK_DATA')
if not E... |
<filename>pysem/model_generalized_effects.py
# -*- coding: utf-8 -*-
"""Generalized Random Effects SEM."""
from .utils import chol_inv, chol_inv2, cov
from scipy.linalg import solve_sylvester
from .model_means import ModelMeans
from itertools import combinations
from functools import partial
from . import startingvalue... |
<gh_stars>1-10
import datetime
from scapy.all import *
import cudf as cd
import pandas as pd
import nvstrings
from collections import OrderedDict
import math
import numpy as np
import xgboost as xgb
from azureml.core.run import Run
# sklearn is used to binarize the labels as well as calculate ROC and AUC
from sklearn.... |
import random
from pathlib import Path
from skimage.feature import peak_local_max
import numpy as np
import torch
import cv2
from scipy.ndimage.interpolation import rotate
def local_maxima(img, threshold=100, dist=2):
assert len(img.shape) == 2
data = np.zeros((0, 2))
x = peak_local_max(img, threshold_abs... |
# Claptrap class
# This class runs a simulation of Claptrap using pinocchio, given a controller as input.
# A controller is defined by the following signature:
# def controller(t, q, v):
# return tau
import pinocchio as pnc
import numpy as np
import scipy.integrate
import tqdm
import pkg_resources
import os
from ..... |
# This script converts files from the HaloFinder
# into hdf5 readable files.
#It also computes the Sersic index of all structures
# Not all quantities are dumped, should be modified depending on what is needed
# and the version of the HaloFinder
import numpy as np
import pandas as pd
import yt.utilities.fortran_util... |
<reponame>fancyerii/voicebook<filename>chapter_2_collection/diarize.py
'''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/... |
from scipy.cluster.hierarchy import linkage, dendrogram, to_tree
from scipy.spatial.distance import pdist
from scipy.cluster.hierarchy import dendrogram
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from utils import convert, distance
def clusters_at_distance(nodelist,max_distance):
foun... |
<reponame>Astro74205/astrophysics
# detrend.py
#
# this takes a simple csv of time-series data and applies a 2nd or 3rd order polynomial fit.
# useful for "detrending" astronomical time series data before processing.
#
#
import pprint
import os
import sys
import numpy
from matplotlib import pyplot
from scipy... |
<gh_stars>0
# Third-party
import numpy as np
from scipy.interpolate import interp1d
# Project
from ..util import check_random_state
__all__ = ['broken_power_law', 'broken_power_law_normed', 'salpeter',
'kroupa', 'scalo', 'imf_dict', 'sample_imf', 'build_galaxy']
def salpeter(mass_grid, norm_type='numbe... |
"""This module contains function to get the necessary datasets and mlpython
problem for the project."""
from __future__ import print_function
import glob
import re
from scipy.misc import imread
from numpy import random
import numpy as np
from mlpython.mlproblems.classification import ClassificationProblem
from mlpython... |
__author__ = '<NAME>, <EMAIL>'
import scipy
from neuronlayer import NeuronLayer
from pybrain.tools.functions import safeExp
class SoftmaxLayer(NeuronLayer):
""" A layer implementing a softmax distribution over the input."""
# TODO: collapsing option?
# CHECKME: temperature parameter?
def ... |
# 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 agreed to in writing, ... |
<reponame>Abhaycl/RoboND-Kinematics-1P2<filename>kuka_arm/scripts/IK_server.py
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: <NAME>
# import modules
import rospy
import... |
from scipy.fftpack import dct, idct
import numpy as np
try: import pywt
except: pass
def identity(x, inverse=0):
return x
def dct1(x, inverse=0):
if not inverse: return dct(x)
else: return idct(x)
def dct2(x, inverse=0):
if not inverse:
return dct(dct(x.T, norm='ortho', axis=0).T, norm='ortho... |
import numpy as np
import warnings
from scipy.interpolate import interp1d
from hn2016_falwa import utilities
from hn2016_falwa.constant import *
from interpolate_fields import interpolate_fields
from compute_reference_states import compute_reference_states
from compute_lwa_and_barotropic_fluxes import compute_lwa_and_... |
import numpy as np
from scipy import linalg
import logging
DTYPE = np.double
logger = logging.getLogger("timeseries.distances")
def make_symmetrical(matrix):
"""
Converts an approximation generated by ACA (which isn't symmetrical) to a symmetrical matrix by
taking the average between the entries at i,j a... |
<reponame>aaron-schroeder/py-elevation<gh_stars>0
import math
import warnings
import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
from scipy.signal import savgol_filter
def threshold_filter(elevation_series, threshold=5.0):
"""Filter elevation series by breaking it into vertical increment... |
<reponame>tushar-corbic/esda
import numpy as np
import pandas as pd
from scipy import sparse
from sklearn.base import BaseEstimator
from libpysal import weights
from esda.crand import crand as _crand_plus, njit as _njit, _prepare_univariate
PERMUTATIONS = 999
class Join_Counts_Local_MV(BaseEstimator):
"""Multi... |
<gh_stars>0
from typing import Optional
import math
import numpy as np
import matplotlib.pyplot as plt
from sympy import gcdex
from qiskit import QuantumCircuit, Aer, transpile, assemble
from qiskit.visualization import plot_histogram
from sympy import Rational
from sympy.ntheory.continued_fraction import continued_fr... |
from database import *
from emulator import *
import tensorflow as tf
import numpy as np
import time
from ale_python_interface import ALEInterface
import cv2
from scipy import misc
import gc
import _thread
# Turn on garbage collection
gc.enable()
generic_params = {
'visualize' : True,
'network_type':'rl_dqn',
'ckp... |
import io
import json
import os
import librosa
import numpy as np
import re
import tempfile
from collections import defaultdict
from pathlib import Path
from urllib.parse import urljoin
from scipy.signal import find_peaks
from surfboard.sound import Waveform
from pykalman import UnscentedKalmanFilter as KalmanFilter
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.