text string |
|---|
from typing import List, Tuple, Dict, Set
from random import sample, choice, randint, uniform
from math import log, floor, ceil
from fractions import Fraction
import csv
class NumberRange:
def random_int(self)->int:
pass
def random_float(self)->float:
pass
class IntRange(NumberRange):
def... |
__description__ = \
"""
Fitter subclass for performing bootstrap fits.
"""
__author__ = "<NAME>"
__date__ = "2017-05-11"
from .base import Fitter
import numpy as np
import scipy.optimize
import sys
class BootstrapFitter(Fitter):
"""
Perform the fit many times, sampling from uncertainty in each measurement.
... |
import matplotlib.pyplot as plt
from scipy import special, optimize, fft as sp_fft
import scipy.io.wavfile as file
import scipy.signal as signal
import operator
import os
import numpy as np
from numpy import (atleast_1d, poly, polyval, roots, real, asarray,
resize, pi, absolute, logspace, r_, sqr... |
<reponame>OverLordGoldDragon/dev_tg<gh_stars>1-10
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2022- <NAME>
#
# Distributed under the terms of the MIT License
# (see wavespin/__init__.py for details)
# -------------------------------------------... |
<reponame>orlandi/connectomicsPerspectivesPaper<filename>participants_codes/konnectomics/optical/deconvolution.py
# Copyright 2014 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... |
'''
For all things related to TransCom regions but, in particular, for
the statistical summary of SMAP L4C (or other raster array data) by TransCom
region. The TransCom project seems to be poorly documented, but Carbon
Tracker [1] uses it and provides the data used here. Intended use (Example):
>>> f = h5py.File(f... |
<gh_stars>1-10
#!/usr/bin/env python
import numpy
import math
import logging
from scipy.stats import poisson
import networkx as nx
import NetworkX_Extension as nxe
# from GSA import Edge
class NJTree:
logger = logging.getLogger("NJTree")
def __init__(self, mrca, alpha, beta, gamma, gain, loss, synteny):
self.gr... |
import torch
import json
from transformers import RobertaTokenizer, RobertaModel, BertTokenizer, BertModel
import numpy as np
import argparse
import os
from tqdm import tqdm
import spacy
from multiprocessing import Pool
from torch.nn.modules.distance import PairwiseDistance
from gurobi import *
from scipy.special impor... |
import numpy as np
import scipy.signal as signal
#
try:
from .plots import plots, plotlf, plotif
except (RuntimeError,ImportError):
plots=None
from tincanradar.fwdmodel import chirprx,friis
c=299792458 #[m/s]
def noisepower(nf,bw):
"""
Compute noise power for receiver in dBm
Note: we are tal... |
<gh_stars>0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os,sys,argparse
from ctypes import c_int
import numpy as np
import torch
import traceback
# sparse uresnet imports (in networks/sparse_ssnet)
import uresnet
from uresnet.flags import UR... |
############################################################
# File: convert_data.py #
# Created: 2019-10-31 19:06:54 #
# Author : wvinzh #
# Email : <EMAIL> #
# -----------------... |
'''
Universidad Nacional Autonoma de Mexico.
Licenciatura en ciencias genomicas - Computo Cientifico 2020.
<NAME>.
Proyecto final.
Programa 5: Lagrange.py
Calcula la interpolacion de un valor dado un conjunto de puntos u obtiene el polinomio de la funcion que siguen estos mismos, utilizando el metodo de Interpo... |
from .sac import VarSACTrainer
from .ensembleSAC import EnsembleSAC, VarEnsembleSAC
from collections import OrderedDict
import numpy as np
import torch
import torch.optim as optim
from torch import nn as nn
from scipy.optimize import minimize
import rlkit.torch.pytorch_util as ptu
from rlkit.core.eval_util import c... |
<reponame>krmuth/textplot
import os
import re
import matplotlib.pyplot as plt
import textplot.utils as utils
import numpy as np
import pkgutil
from nltk.stem import PorterStemmer
from sklearn.neighbors import KernelDensity
from collections import OrderedDict, Counter
from scipy.spatial import distance
from scipy imp... |
import argparse
import random
import numpy as np
import torch
import spacy
import scispacy
import json
import os
import logging
import pandas as pd
import sys
from tqdm import tqdm
from datasets import Dataset
from functools import partial
from dataclasses import dataclass, field
from custom_trainer import CustomTrain... |
import numpy as np
import os
import gzip
import re
import subprocess
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(program):
return program
else:
for path ... |
<reponame>nazcaspider/simple-3dviz
from os import path
import unittest
from cv2 import imwrite
import numpy as np
from scipy.spatial import ConvexHull
import trimesh
from simple_3dviz import Scene, Mesh
class TestMesh(unittest.TestCase):
def test_cube(self):
points = np.array([[ 1, 1, 1],
... |
<gh_stars>10-100
import os
import time
import numpy as np
import pandas as pd
import scipy.sparse as ssp
import scipy.stats as stats
import statsmodels.sandbox.stats.multicomp
from ete3 import Tree
from matplotlib import pyplot as plt
from numpy.lib.twodim_base import tril_indices
from scipy.cluster import hierarchy
... |
__author__ = '<NAME>'
from PIL import Image
import numpy as np
import scipy as sc
import os.path
def load_training_images(images_path):
file_name = 2
images_collection = []
for i in range(2, 217):
if i == 217:
break
image = images_path + "\\" + str(i) + ".png"
if not ... |
<filename>tests/test_wait_time_conversions.py
import numpy as np
import pandas as pd
import pytest
from scipy.stats import beta
from multi_locus_analysis import finite_window as fw
# for Beta distributions, making the window size a little less than 1
# guarantees there's not too many, and also not too few waits per
... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.ndimage.filters import convolve1d
#<start>
a = 1
h = 0.05
k = 0.8*h
T = 17
x = np.arange(0,25+h,h)
t = np.arange(0,T+k,k)
u = np.zeros((len(t),len(x)))
u[0] = np.exp... |
<reponame>gamdow/oommfc
import os
import glob
import shutil
import pytest
import numpy as np
import oommfc as oc
import discretisedfield as df
from scipy.optimize import bisect
@pytest.mark.oommf
def test_stdprob5():
name = "stdprob5"
# Remove any previous simulation directories.
if os.path.exists(name):... |
<reponame>JohnGriffiths/dipy
import sympy
import numpy as np
import scipy as sc
from numpy.random import random_sample as random
def random_uniform_in_disc():
# returns a tuple which is uniform in the disc
theta = 2*np.pi*random()
r2 = random()
r = np.sqrt(r2)
return np.array((r*np.sin(theta),r*np.... |
# --------------
# 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)
numerical_var = bank.select_dtypes(include = 'number')
print(numerical_var)
# code en... |
"""Collection of io related items."""
import os
import shelve
from collections import namedtuple
import pickle
import numpy as np
import pandas as pd
import re
import scipy.sparse as sp_sparse
import tables
NUCS = ["A", "C", "G", "T"]
NUCS_INVERSE = {"A": 0, "C": 1, "G": 2, "T": 3}
CellRangerCounts = namedtuple("Ce... |
# cvmask.py
# ---------------------------
# Wrapper class for masks. See class doc for details.
import numpy as np
from scipy.linalg import lstsq
from scipy.spatial import distance
from operator import itemgetter
from skimage.measure import find_contours
from skimage.morphology import disk, dilation
from scipy.ndimag... |
import os
import numpy as np
from scipy import sparse
from scipy.sparse import coo_matrix
from scipy.sparse import vstack
from scipy.spatial.distance import pdist
from copy import deepcopy
from collections import OrderedDict
import torch
import torch.nn as nn
from torch.nn import Module
from torch.nn impor... |
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
import soundfile as sf
import sounddevice as sd
from sys import argv
from codec import *
from converter import *
from scipy.io.wavfile import write
def print_stats(arr, arr_name=''):
print(f'{arr_name}:', arr.dtype, arr.shape, arr.min(), arr... |
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall
n, m = map(int, readline().split())
graph = [[0] * (n + 1) for _ in range(n + 1)]
abc =... |
# -*- coding: utf-8 -*-
'''
Module for defining the class related to the slices and their structure.
'''
# %%
class MaterialParameters:
'''Creates an instance of an object that defines the structure of the
material where the stabilibity analysis is performed. ::
MaterialParameters(cohesion... |
<reponame>NumericalEnvironmental/Numerical_Solver_in_Python_for_Soil_Infiltration_Tests<gh_stars>1-10
##############################################################################################
#
# percolation.py - numerical solution for interpretation of a falling head infiltration test
#
######################... |
<reponame>michaels10/pydec<filename>pydec/dec/simplicial_complex.py<gh_stars>0
__all__ = ['SimplicialComplex','simplicial_complex']
from warnings import warn
import numpy
import scipy
from scipy import sparse, zeros, asarray, mat, hstack
import pydec
from pydec.mesh.simplex import simplex, simplicial_mesh
from pydec... |
from math import exp, sqrt
import numpy as np
import scipy.optimize as sciopt
import cgn
from do_test import do_test
from problem import TestProblem
def F(x, y):
out = np.array([x[0] + exp(-x[1] + sqrt(y[0])),
x[0] ** 2 + 2 * x[1] + 1 - sqrt(y[0])])
return out
def DF(x, y):
jac = np... |
<reponame>JRPCF/Artificial-Dermatologist
import sagemaker_containers
import torch.nn as nn
import torch.optim as optim
import argparse
import json
import os
import sys
import sagemaker_containers
import numpy as np
import torch
import scipy
import torch.optim as optim
import torch.utils.data
from torchvision import mo... |
import numpy as np
from scipy.cluster.vq import kmeans
def region_mean_color(img, region):
""" Region mean color
Parameters
----------
img: numpy array (N,M,D)
color/gray image
region: dict
dictionary containing the coordinates of the region
Returns
-------
avg: numpy ... |
<filename>pesummary/gw/file/calibration.py
# Licensed under an MIT style license -- see LICENSE.md
import os
import numpy as np
from scipy.interpolate import interp1d
from pesummary import conf
from pesummary.utils.utils import logger, check_file_exists_and_rename
from pesummary.utils.dict import Dict
__author__ = ["... |
# -*- coding: utf-8 -*-
"""
Created on Thur June 18, 2015
Last modified: April, 2016
@author: pauliuk
"""
"""
# Script MaTrace_Global_Main.py
# Standalone script for global multiregional version of MaTrace model (Nakamura et al. 2014)
# Import required libraries:
#%%
"""
# import os
import loggin... |
<gh_stars>0
from robot.api.deco import keyword, library
from robot.libraries.BuiltIn import BuiltIn
import os
try:
from PIL import Image
except ImportError:
import Image
import numpy as np
from scipy.stats import norm
from ledsa.core.ledsa_conf import ConfigData
from subprocess import Popen, PIPE
import piexif
... |
<gh_stars>0
from pathlib import Path
import logging
import numpy as np
from numpy.testing import assert_allclose
from dateutil.parser import parse
from datetime import datetime
from scipy.signal import savgol_filter
from numpy.random import poisson
import h5py
import xarray
import typing as T
from . import splitconf
f... |
import sys
sys.path.append(".")
sys.path.append("..")
import numpy as np
import os
import sklearn
from sklearn.model_selection import train_test_split
from utils import pickle_object, read_pickle_object
from collections import defaultdict
import pandas as pd
import glob
import json
from data.twin_data_metadata import ... |
<reponame>fabiansinz/cadwell2020<filename>Connectivity/schema.py
import numpy as np
from scipy import io
import pandas as pd
import datajoint as dj
import seaborn as sns
import matplotlib.pyplot as plt
schema = dj.schema('cadwell2020', locals())
@schema
class CellsPerClone(dj.Lookup):
definition = """
# numb... |
<reponame>dongheig/hedhywl
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Model of simple trigonal lattice """
from crystal import Crystal
from sympy.geometry import Point
class ParallelogramCrystal(Crystal):
""" Model of simple trigonal lattice """
def __init__(self, a, size, center):
self._a = a
s... |
"""Module to build Online Sequential Extreme Learning Machine (OS-ELM) models"""
# ===================================================
# Author: <NAME>
# Copyright(c) 2018
# License: Apache License 2.0
# ===================================================
import warnings
import numpy as np
from scipy.linalg import p... |
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 6 18:54:13 2021
@author: <NAME>
"""
import prose as pgx
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.colors as colors
import seaborn as sns
import numpy as np
import itertools
import glob
import os
import random
from tqdm import t... |
<filename>pyrolysis/one_reaction_pyrolysis.py
from scipy import special
import numpy as np
import math
from pybitup import bayesian_inference as bi
class OneReactionPyrolysis(bi.Model):
R = 8.314
def __init__(self, x=[], param=[]):
# Initialize parent object ModelInference
bi... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# saov.py - <NAME> (<EMAIL>) - Jan 2017
'''
Contains the Schwarzenberg-Czerny Analysis of Variance period-search algorithm
implementation for periodbase.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import log_sub, log_fmt, log_date_fmt
... |
from scipy import signal
import numpy as np
# Bandpass filter
def bandpass(start, stop, data, fs=250):
bp_Hz = np.array([start, stop])
b, a = signal.butter(5, bp_Hz / (fs / 2.0), btype='bandpass')
return signal.lfilter(b, a, data, axis=0)
# Notch Filter
def notch_filter(val, data, fs=250):
notch_fre... |
<reponame>s1990i/EMOSworks
import numpy as np
# import HyperProTool as hyper
import scipy.io as sio
#from LRSR_1 import LRSR
import matplotlib.pyplot as plt
from matplotlib.collections import EventCollection
# data pre-precessing
data = sio.loadmat("Sandiego.mat")
data3d = np.array(data["Sandiego"], dtype=float)
# n... |
'''
Functions used to calculate & fit radial M/L gradients in galaxies.
Stored here for easy importing.
'''
# make sure we've got all the packages we need
import numpy as np
from astropy.io import fits
from astropy.wcs import WCS
import photutils
import math
import subprocess
import scipy.io
import itertools
from astr... |
<reponame>kastnerkyle/pachet_experiments<filename>markov_steerable.py
#!/usr/bin/env python
import numpy as np
from scipy.cluster.vq import vq
import os
import cPickle as pickle
import copy
import collections
from collections import defaultdict, Counter, namedtuple
import heapq
import music21
from datasets import pitch... |
# coding: utf-8
# The iPython notebooks did not work on my computer.
# I therefore did the exercise in plane python.
import numpy as np
import scipy as sp
import sympy
import matplotlib.pyplot as plt
import matplotlib as mpl
x = np.arange(-10,10,0.1)
fig, ax = plt.subplots(nrows=3, ncols=1)
ax[0].plot(x,x**2, 'o-... |
<reponame>Delaunay/Ranked
import math
from scipy.stats import norm
from ranked.models import Match, Player, Ranker, Team
class EloPlayer(Player):
def __init__(self, mu=0, *args) -> None:
self.mu = mu
def skill(self) -> float:
return self.mu
class EloTeam(Team):
"""Combine multiple pla... |
<filename>src/image/data.py
import numpy as np
import scipy.ndimage
from skimage import measure, morphology
def to_ndarray(slice):
"""Convert slice types to :class:`numpy.ndarray`
"""
return np.array(slice.pixel_array).astype(np.int16)
def hu_rescale(slice, slope, intercept):
"""Convert slice raw pi... |
<filename>tracklib/models/statgauss.py
"""
This module provides a useful way to sample from a stationary Gaussian process.
By assuming stationary, Gaussian, mean-zero increments, the process is uniquely
defined by its MSD. Here we use that observation to generate sample traces from
such processes, given the MSD.
"""
... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
from scipy.stats import gamma
def biGammaHRF(times):
"""Return values for HRF at given times. Unit of time: second.
This HRF is derived from the sum of two Gamma function, it st... |
<reponame>israeldi/friday-workshop
import numpy as np
from scipy.stats.stats import pearsonr
n = 5000
rho = 0
z1 = np.random.normal(0,1, n)
z2 = np.random.normal(0,1, n)
r1 = z1
r2 = rho * z1 + (1 - rho**2)**0.5 * z2
# Simple tests
print(np.mean(r2)) # mean
print(np.std(r2)) # standard deviation
r2.sort()
q = 5 # qua... |
<filename>utilities.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 6 13:03:05 2020
@author: kaniska
"""
import numpy as np
from scipy import signal
def db(arr):
return 20*np.log10(np.abs(arr))
def power(x):
'''
Calculate power of signal x
'''
fro = np.linalg.norm(x) # ... |
<filename>utils/utils_mat.py
import os
import json
import scipy.io as spio
import pandas as pd
def loadmat(filename):
'''
this function should be called instead of direct spio.loadmat
as it cures the problem of not properly recovering python dictionaries
from mat files. It calls the function check key... |
<reponame>svenkilian/Financial
"""
This module implements the machine learning models used in the study
"""
import inspect
from scipy.stats import rankdata
from sklearn import ensemble
from config import ROOT_DIR
from core import execute
GPU_ENABLED = True
import os
import numpy as np
import datetime as dt
from nu... |
<filename>datasets/data/magic_dataset.py
import os.path
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import random
import scipy.io as sp
import scipy.ndimage as image
import numpy as np
import torch
from util.util import generate_mask... |
<filename>scarplet/tests/test_core.py
import filecmp
import numpy as np
import os
import sys
import pytest
import unittest
from osgeo import gdal, osr
from scipy.special import erf
from context import scarplet
import scarplet as sl
from scarplet import dem
from scarplet.WindowedTemplate import Scarp
DEFAULT_EPSG = ... |
<gh_stars>0
__author__ = '<NAME>'
"""
Intended for processing of 80s monosome-seq data from defined RNA pools
Based on <NAME>'s original RBNS pipeline, available on github
"""
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42 #leaves most text as actual text in PDFs, not outlines
import os
import argpar... |
<reponame>marcopodda/netutils
from statistics import mean, stdev
class Graphlist:
def __init__(self, graphs=None):
self._graphs = graphs or []
self._num_nodes = []
self._num_edges = []
for G in self._graphs:
num_nodes = G.number_of_nodes()
num_edges = G.num... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import gaussian_kde
from som_anomaly_detector.AnomalyDetection import AnomalyDetection # Our special Anomaly Detector
from mpl_toolkits.mplot3d import Axes3D
# Initialize our anomaly detector with some arbitrary paremeters.
# Note: in a production sit... |
from scipy import misc
import numpy as np
class Utility:
@staticmethod
def mapData(values : list, originalMap : dict, newMap : dict):
# originalMap # Index - Object
# newMap # Object - List of Indices
lenMap = 0
for idxList in newMap.values():
lenMap = l... |
<reponame>altherwy/S-Parameters-Parser
import numpy as num
import scipy as scp
import pandas as pnd
import sys
def parse_S2P_file(file_name):
labels = ["Frequency","S11_r","S11_i","S21_r","S21_i","S12_r","S12_i","S22_r","S22_i"]
with open(file_name) as f:
lines = [line.rstrip('\n') for lin... |
<filename>phonemes_segmentation.py
# AUTHORS: <NAME> AND <NAME>
#######!!!!!!!!!####### GO TO THE MAIN AT THE END OF THIS FILE AND REPLACE PATHS WITH YOUR PATHS#######!!!!!!!!!#######
import subprocess
import shutil
from shutil import copyfile
from distutils.dir_util import copy_tree
import fileinput
import sys
impo... |
<filename>examples/ripple.py<gh_stars>0
import numpy
import pygame
import scipy
import scipy.ndimage
from makersign import LedSign
import cv2
pygame.init()
window = pygame.display.set_mode((0, 0),pygame.FULLSCREEN)
clock = pygame.time.Clock()
window_size = window.get_size()
scale = 4
sim_size = (window_size[0]//scal... |
<filename>main.py<gh_stars>1-10
import scipy.io as sio
import numpy as np
from scipy.sparse import csc_matrix
import scipy.sparse as sp
from sklearn.preprocessing import normalize
import scipy.sparse.linalg as LA
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import argpa... |
<gh_stars>0
import logging
import numpy as np
import os
import scipy.optimize as optimize
root_path = os.path.dirname(os.path.realpath(__file__))
runlog = logging.getLogger('runlog')
alglog = logging.getLogger('alglog')
def exponential_curve(Qi, D, time_range, months=True):
"""
Generates decline data using t... |
# -*- coding: utf-8 -*-
"""
This file is part of pyCMBS.
(c) 2012- <NAME>
For COPYING and LICENSE details, please refer to the LICENSE file
"""
import unittest
import numpy
from pycmbs import mapping
import scipy as sc
from pycmbs.data import Data
import numpy as np
import matplotlib.pylab as pl
import matplotlib.pypl... |
<filename>pdfa_parser/avisleser.py<gh_stars>10-100
#!/usr/bin/env python
import argparse
import faulthandler
import io
import logging
import os
import re
import signal
import statistics
import string
import sys
import tarfile
import traceback
from collections import Counter
from collections.abc import Iterable
from con... |
<gh_stars>0
import operator
from scipy.spatial import distance
from data import Data
class KNN:
k = 0
model = []
size = 0
def __init__(self, k, trainingData):
self.k = k
for x in trainingData:
self.model.append(Data(x))
self.size = len(self.model)
# przyjmuje li... |
import urllib.request
import json
import dml
import prov.model
import datetime
import uuid
import statistics
import pandas as pd
from bson.code import Code
class transform_turnstile_weather(dml.Algorithm):
contributor = 'anuragp1_jl101995'
reads = ['anuragp1_jl101995.subway_stations,' 'anuragp1_jl101995.turns... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Written by <NAME>
Email: danaukes<at>gmail.com
Please see LICENSE for full license.
"""
import pynamics
from pynamics.frame import Frame
from pynamics.variable_types import Differentiable,Constant
from pynamics.system import System
from pynamics.body import Body
from pynamics... |
import copy
import numpy as np
from astropy.convolution import convolve
from scipy.ndimage import median_filter
def ring_median_filter(nd, inner_radius, outer_radius, max_iters=1,
inplace=False, replace_flags=65535,
replace_func='median'):
"""Replace masked values wit... |
import multiprocessing as mp
import tqdm
import numpy as np
import scipy.sparse
from scipy.optimize import linear_sum_assignment
from .. import utils
def get_linear_sum_assignment_score(S, vocab1, vocab2, doc1, doc2, normalize=True):
scores = np.zeros((len(doc1), len(doc2)))
for idx, w1 in enumerate(doc1):... |
<reponame>azagajewski/ColiCoords
from colicoords.data_models import BinaryImage, BrightFieldImage, FluorescenceImage, STORMTable, Data
from colicoords.fileIO import load_thunderstorm, load
from colicoords.cell import Cell, CellList
from test.testcase import ArrayTestCase
from test.test_functions import load_testdat... |
<reponame>farhanreynaldo/hipotesa
import pytest
import pandas as pd
import numpy as np
from scipy import stats
from hypothesis import Hypothesis
from generator import Permute
from test_statistic import DiffMeans
from specifier import Specifier
@pytest.fixture
def data():
data = (
pd.read_table("https://m... |
<gh_stars>0
import numpy as np
import os.path, sys
import h5py
from scipy.interpolate import splev, splrep
from randoms import make_random_catalogue,make_Nrandom_catalogue
#############################
#
# Input ARGUMENTS
#
narg = len(sys.argv)
if(narg == 7):
mag_lim = float(sys.argv[1])
N_rand = int(sys.argv... |
import warnings
import numpy as np
import scipy as sp
from scipy import stats
import torch
import torch.nn as nn
import torch.nn.functional as F
from .. import utilities
def create_batches(features, y, batchsize):
# Create random indices to reorder datapoints
n = features.shape[0]
p = features.shape[1]
... |
from __future__ import print_function
print(__doc__)
import os
import sys
import numpy as np
#import matplotlib
#matplotlib.use('AGG') # Do this BEFORE importing matplotlib.pyplot
import matplotlib.pyplot as plt
#from matplotlib.colors import Normalize
import matplotlib.colors as colors
import matplotlib.cm as cm
... |
from scipy.misc import imread, imsave
img101 = imread('frames/saida_101.bmp')
img103 = imread('frames/saida_103.bmp')
img109 = imread('frames/saida_109.bmp')
img111 = imread('frames/saida_111.bmp')
img117 = imread('frames/saida_117.bmp')
img119 = imread('frames/saida_119.bmp')
imsave('inter_102.bmp', img101 / 2 + i... |
<reponame>treverhines/ModEst
#!/usr/bin/env python
import numpy as np
import scipy
class Weight:
def __init__(self,cov=None,var=None,std=None,weight=None):
if cov is not None:
cov = np.asarray(cov)
assert axes_no(cov) == 2, 'covariance matrix must be 2 dimensional'
if isdiagona... |
<filename>mhkit/power/characteristics.py
import pandas as pd
import numpy as np
from scipy.signal import hilbert
import datetime
def instantaneous_frequency(um):
"""
Calculates instantaneous frequency of measured voltage
Parameters
-----------
um: pandas Series or DataFrame
Meas... |
import pickle
import pandas as pd
import os
import openai
import numpy as np
import ipdb
import re
from tqdm import tqdm
import time
from transformers import GPT2Tokenizer
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
import spacy
import scipy
from data_utils import *
from eval_utils import *
openai.api_key = os... |
<gh_stars>1-10
#!/usr/bin/env python
from sparse_neighbors_search import MinHash
from sparse_neighbors_search import MinHashClassifier
from sparse_neighbors_search import WtaHash
from sparse_neighbors_search import WtaHashClassifier
import numpy as np
from sklearn.neighbors import NearestNeighbors
from scipy.sparse ... |
from spectral_cube import SpectralCube
from astropy.io import fits
import matplotlib.pyplot as plt
import astropy.units as u
import numpy as np
from scipy.optimize import curve_fit
from scipy import *
import time
import pprocess
from astropy.convolution import convolve
import radio_beam
import sys
from astropy.convolut... |
<filename>BasalGanglia/stn_gpe_io.py<gh_stars>0
from pyrates.utility import plot_timeseries, create_cmap, grid_search
import numpy as np
import matplotlib.pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
from scipy.signal import correlate
import matplotlib as mpl
plt.style.reload_library()
plt.style.u... |
'''
file phase_animation_2D.py
@author <NAME>
@copyright Copyright © UCLouvain 2020
multiflap is a Python tool for finding periodic orbits and assess their stability via the Floquet multipliers.
Copyright <2020> <Université catholique de Louvain (UCLouvain), Belgique>
List of the contributors to the development of m... |
#!/usr/bin/env python
"""
Module of functions to obtain quantities from CAMB easily using the pycamb
class.
<NAME>, Sun Aug 25 19:27:59 CDT 2013
Requirements: pycamb
"""
import numpy as np
import pycamb as pyc
import scipy.interpolate as sip
from astropy.cosmology import Planck13 as cosmo
def PK ( koverh , r... |
#!/usr/bin/env python
# function <binary expression file> <selected_TF_list_fn> <all TF list>
import pandas as pd
import sys
from scipy import stats
import numpy as np
#binary expression profile
df = pd.read_table(sys.argv[1],sep=",")
#all TF with pwm
TF_with_pwm_fh = open(sys.argv[3], "r")
allTFwithpwm = []
for line... |
<gh_stars>0
import json
import csv
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import pandas as pd
from tqdm import tqdm
from scipy.stats import norm
from scipy.stats import pearsonr
import argparse
import itertools
from os import listdir
from os.path import isfile, join
def find_idx(... |
<reponame>sswarnakar/Behavioral-Cloning-Using-Udacity-Self-Driving-Car-Simulator
import tensorflow as tf
tf.python.control_flow_ops = tf
from keras.models import Sequential, model_from_json, load_model
from keras.optimizers import *
from keras.layers import Dense, Activation, Flatten, Dropout, Lambda, Cropping2D, ELU
... |
# -*- coding: utf-8 -*-
"""Copy of Copy of prefilter for EMG signal.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1deuYbf9kUkS-FJcfnA0afu_10UQQvD8K
"""
import sys
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0" #for training on gpu
from scipy... |
<gh_stars>1-10
from fractions import Fraction
from math import ceil, floor
# 入力
K = int(input())
# N = 50で決め打ち。操作回数がなるべく均等となるようにaを定める。
N = 50
a = [
ceil(Fraction(K, N)) * (N + 1) + N - (K + 1)
for _ in range(K % N)
] + [
floor(Fraction(K, N)) * (N + 1) + N - (K + 1)
for _ in range(N - K % N)
]
ans = '... |
import qinfer
import random
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
import qmla.model_building_utilities as model_building_utilities
import qmla.logging
__all__ = ["gaussian_prior", "prelearned_true_parameters_prior"]
def log_print(to_print_list, log_file, log_identifier="Dis... |
"""
复合求积公式
"""
import sympy as sp
def compound_trapezoid(f, x, interval, n):
"""
复合梯形公式
:param f: 原函数
:param x: 变量
:param interval: 积分区间
:param n: 对积分区间进行n等分
:return: 近似的积分值
"""
bottom, top = interval # 积分上下限
step = (top - bottom) / n # 步长
X = [bottom + step * k for k i... |
from sympy import Eq, solve, symbols
from homogeneous import *
def main():
a, b, c, d, e, f, g, h, j, k, m, n, p, q, r, s, t, u, v, x, y = \
symbols('a, b, c, d, e, f, g, h, j, k, m, n, p, q, r, s, t, u, v, x, y')
A, B, C = (a, b, c), (d, e, f), (g, h, j)
D0, E0, F0 = span(k, B, m, C), span(n, C, p... |
import matplotlib.image as mpimg
import numpy as np
import cv2
from skimage.feature import hog
from scipy.ndimage.measurements import label
# Define a function to return HOG features and visualization
def get_hog_features(img, orient, pix_per_cell, cell_per_block,
vis=False, feature_vec=True):... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.