text string |
|---|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 27 22:06:40 2017
@author: sitibanc
"""
import math
from scipy.stats import norm
import matplotlib.pyplot as plt
# 以9/27當日收盤的台指選為例
s = 10326.68 #目前股價
l = 10300.0 #執行價
t = 21.0 / 365 #距到期日
r = 0.01065 #無風險利率(台銀公告定存利率)
#sigma = 0.10503 ... |
<gh_stars>0
import os, shutil, re, itertools, json, pickle
import argparse
import logging
import numpy as np
import pandas as pd
import math, copy, random
from sympy import Symbol, factorial, nsolve
from deap import algorithms, creator, tools
from deap.base import Fitness
from deap.base import Toolbox
from .calvin impo... |
"""
Produce figures for a single trained network.
"""
# imports
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt
import matplotlib
from matplotlib.ticker import MultipleLocator, AutoMinorLocator
import fly_rec as rec
import utilities as util
import copy
from cycler import cycler
from... |
<filename>sts_lib.py<gh_stars>0
# Versão 1.2.3
import imp
import sqlite3 as sql
import pickle
import scipy.stats as st
from scipy.sparse import csr_matrix
from matplotlib import pyplot as pp
import numpy as np
import time
import pprint
from sklearn.naive_bayes import BernoulliNB
import sklearn.metrics as metrics
from s... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 24 20:03:24 2019
@author: RV
"""
# Python(R)
# Modeules/packageslibraries
# OS - submodules/path/join
#eg. (os.path.join)
# pandas
# scipy
# onspy
#%% Setup
import os
projFld = "C:/Users/RV/Documents/Teaching/2019_01_Spring/ADEC7430_Spring2019/Lec... |
"""Generic evaluation script that evaluates a model using the Dirty-Pixels captured dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import skimage.measure
import scipy.ndimage.filters
import tensorflow as tf
import scipy.io
import os... |
<reponame>mercurio24/TimeSeriesForecasting
'''
Project: Time series forecasting
Contributors:
<NAME>
'''
#%% LIBRAIRES AND SETTINGS
import os
from warnings import warn
import numpy as np
import pandas as pd
from scipy.signal import correlate
from sklearn.feature_selection import mutual_info_regression
... |
<reponame>MacIver-Lab/Ergodic-Information-Harvesting<filename>SimulationCode/ErgodicHarvestingLib/Simulation.py
# -*- coding: utf-8 -*-
# Time
from time import strftime
# Entropy
from scipy.stats import entropy
import numpy as np
from numpy.random import Generator, MT19937
from scipy.interpolate import interp1d
# Im... |
<reponame>kimjaed/simpeg
from __future__ import print_function
import unittest
import numpy as np
from SimPEG import Mesh, Maps, Utils, SolverLU
from SimPEG import EM
import sys
from scipy.constants import mu_0
FLR = 1e-20 # "zero", so if residual below this --> pass regardless of order
CONDUCTIVITY = 1e1
MU = mu_0
fr... |
<filename>profile/results/compile-and-run.py
import os
import time
from fractions import gcd
comp = True
submit = True
directory = 'Takeda'
case = 'Takeda-unrodded'
ppn = 12
wall = '72:00:00'
mem = 6 #GB
qlim = 4
node_lim = 8
task_lim = 96
wait_time = 3
def get_unique_variants(num, max_decomp=10**8):
x = set()
... |
def from_sparse_to_file(filename, array, deli1=" ", deli2=":", ytarget=None):
from scipy.sparse import csr_matrix
import numpy as np
zsparse = csr_matrix(array)
indptr = zsparse.indptr
indices = zsparse.indices
data = zsparse.data
print(" data lenth %d" % (len(data)))
print(" indices l... |
#scipy.signal.istft example
#https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.istft.html
#
import numpy as np #added by author
from scipy import signal
import matplotlib.pyplot as plt
#Generate a test signal, a 2 Vrms sine wave at 50Hz corrupted by 0.001 V**2/Hz of white noise sampled at 1024 Hz.
#テス... |
<filename>ptss_poc.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 16 11:04:59 2018
@author: amaity
A quick and dirty python Proof of
concept for risk based scheduling
as proposed.
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
import ptss_utils as ptsl
import p... |
from itertools import product
import os
import sys
import numpy as np
from scipy.optimize import minimize
from scipy.spatial import distance_matrix
import read_gro
HEADER = """
; Topology file generated from Go-kit.\n
; https://github.org/gokit1/gokit/\n
[ defaults ]\n
; nbfunc comb-rule gen-pairs\n
1 1 ... |
import numpy as np
import os
from matplotlib import pyplot as plt
from math import sqrt,exp
import math
import time
from random import random
from scipy.signal import savgol_filter
import matplotlib
color_map={
'SGD': '#BBBB00',
'Adam beta1:0.0': ... |
'''
This script will setup a simple scipy optimization routine by combining
the 'CATS_InputFile' and 'MOOSE_CVS_File' classes. CATS_InputFile will
be used to read or create a simulation run case. The dict is then used
to identify a set of parameters to vary. Python will direct simulations
to run and... |
<reponame>alexeyignatiev/xdl-tool
#!/usr/bin/env python
#-*- coding:utf-8 -*-
##
## xdl.py
##
## Created on: Feb 2, 2021
## Author: <NAME>
## E-mail: <EMAIL>
##
#
#==============================================================================
from data import Data
from dlist import DecisionList
from enc imp... |
<gh_stars>0
'''
jackknife.py
Author: <NAME>
Written: March2013-October2013
Runs an interative jackknife analysis for crossing angle and contacts on a set of TM helix dimer
simulations - see full description below in the main method for a more detailed explanation
'''
import os,sys,MDAnalysis,numpy,shutil,math,multip... |
<filename>statzcw/test_zmean.py
from statzcw import zmean
from statistics import mean
import unittest
class TestZMean(unittest.TestCase):
def test_mean1(self):
test_data = [1, 2, 3, 4, 5]
self.assertEqual(mean(test_data), zmean.mean(test_data))
def test_mean2(self):
test_data = [-1, ... |
<reponame>squared9/Artificial-Intelligence
import math
import statistics
import warnings
import numpy as np
from hmmlearn.hmm import GaussianHMM
from sklearn.model_selection import KFold
from asl_utils import combine_sequences
class ModelSelector(object):
'''
base class for model selection (strategy design p... |
<filename>p_030_039/problem33.py<gh_stars>0
from fractions import Fraction
from functools import reduce
def main():
"""
Entry point
"""
# We consider fractions with two digits in num and denom, less than one
curious = []
for numerator in range(10, 100):
for denominator in range(numerato... |
import os
import subprocess
from utils import has_header
import sys
import argparse
import numpy as np
import sklearn.metrics
import random,copy,string
from nltk.tokenize import word_tokenize
from scipy.stats import pearsonr
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.models import Mo... |
import cv2
import numpy as np
from scipy.ndimage import convolve
from matplotlib import pyplot as plt
from mpl_toolkits import mplot3d
B = np.array([.0, 4.408490765224997, 3.144532188123648])
C = np.array([255., 257.2748941071508, 256.00960321263835])
D = (C - B) / np.linalg.norm(C - B)
def sobel(img):
scale = 1... |
# -*- coding: utf-8 -*-
from __future__ import division
import glob
import json
import os
from collections import Counter
from copy import deepcopy
from fractions import Fraction
from send_email import send_email
try:
import abcparse
except ImportError:
import gamc.abcparse as abcparse
if not os.path.exists... |
<reponame>galad-loth/DescHash
import numpy as npy
import struct
import os
from scipy import io as scio
def ReadFvecs(dataPath, dataFile, start=0, end=-1):
filePath=os.path.join(dataPath,dataFile)
with open(filePath,mode="rb") as fid:
buf=fid.read(4)
dimFeat=struct.unpack("i", buf[:4])
... |
<gh_stars>0
import warnings
from scipy.linalg import toeplitz
import scipy.sparse.linalg
from scipy.ndimage.interpolation import zoom
import numpy as np
import numba
import cooler
from functools import partial
from ._numutils import (
iterative_correction_symmetric as _iterative_correction_symmetric,
observed_... |
import numpy as np
from scipy import stats
#################
# BSM模型相关
def get_option_d(s, k, t, r, sigma, q):
d1 = (np.log(s/k) + (r - q + 0.5*sigma**2)*t)/(sigma*np.sqrt(t))
d2 = (np.log(s/k) + (r - q - 0.5*sigma**2)*t)/(sigma*np.sqrt(t))
return d1, d2
def get_option_greeks(cp, s, k, t, r, sigma, q):
... |
#!/usr/bin/env python
from fractions import Fraction
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
import seaborn as sns
import fluidsim as fls
import h5py
from base import (
_k_max,
_k_diss,
_eps,
set_figsize,
matplotlib_rc,
_index_where,
... |
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
def model(X, t, alpha):
x = X[0]
y = X[1]
z = X[2]
dxdt = x - x*y
dydt = x*y - y*(z**alpha)
dzdt = x - z
dZdt = [dxdt, dydt, dzdt]
return dZdt
# initial condition
X0 = [.2, .8, .3]
alpha = 1
# set T... |
#! /usr/bin/python
import argparse
import os
import shutil
import statistics
import subprocess
def add_result(results, test_name, slow_down, length):
if test_name not in results.keys():
results[test_name] = dict()
if length not in results.keys():
results[test_name][length] = []
results[te... |
import os
import numpy as np
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.figure_factory as ff
from scipy.special import erf
from scipy import stats
import pandas as pd
import seaborn as sns
cp = sns.color_palette()
from sklearn.neighbors.kde import KernelDensity
#%%
# loading data and... |
<reponame>RiccardoGrigoletto/SSM-Pytorch<filename>tools/trainval_net.py
# --------------------------------------------------------
# Tensorflow Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>, <NAME>, based on code from <NAME>
# -----------------------------------------------... |
import sys,os
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
import PyEFVLib
from PyEFVLib import Solver
import numpy as np
from scipy import sparse
import scipy.sparse.linalg
import time
class HeatTransferSolver(Solver):
def __init__(self, workspaceDirectory, **kwargs):
# kwargs -> output... |
"""
modules for DQAS framework
"""
import sys
import inspect
from functools import lru_cache, partial
from multiprocessing import Pool, get_context
import functools
import operator
import numpy as np
import scipy as sp
import sympy
import tensorflow as tf
from typing import (
List,
Sequence,
Any,
Tuple... |
""" Class definition for ExecComp, a component that evaluates an expression."""
import math
import cmath
import numpy
from numpy import ndarray, complex, imag
from six import string_types
from openmdao.core.component import Component
from openmdao.util.string_util import parse_for_vars
from openmdao.util.array_util... |
import os
import csv
import pandas as pd
import numpy as np
import scipy
from fancyimpute import SoftImpute
from sklearn.decomposition import TruncatedSVD, DictionaryLearning, SparseCoder
from sqlalchemy import create_engine
# configuration
DIR_DATA= '/path/to/ChnHistPhon/results'
con = create_engine('postgresql://... |
<reponame>louisXW/PODS-DYNO
"""
.. module:: adaptive_sampling
:synopsis: Ways of finding the next point to evaluate in the adaptive phase
.. moduleauthor:: <NAME> <<EMAIL>>,
<NAME> <<EMAIL>>
:Module: adaptive_sampling
:Author: <NAME> <<EMAIL>>,
<NAME> <<EMAIL>>
"""
import math
import scip... |
<gh_stars>0
import numpy as N
from scipy import sparse
# Modified from http://www.scipy.org/scipy/scipy/attachment/ticket/602/merge_sparse_blocks.py
def merge_sparse_blocks(block_mats, lookup_dicts, format='csr', dtype=N.float64):
""".. centered:: Merge several sparse matrix blocks into a single sparse matrix
Inp... |
from copy import deepcopy
from collections import namedtuple
import datetime
import io
import matplotlib
import matplotlib.patches as patches
import matplotlib.pyplot as plt
# Must be before torch.
import pydrake
import numpy as np
import scipy as sp
import scipy.stats
import time
from tensorboardX import SummaryWrite... |
#!/usr/bin/python
# coding: UTF-8
# -*- Coding: utf-8 -*-
import numpy as np
import pandas as pd
import csv
from scipy import stats
from matplotlib import pyplot as plt
import seaborn as sns
sns.set()
html_header = """
<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" cont... |
import scipy.io.wavfile as wav
from load_data.ILoadSupervised import ILoadSupervised
from load_data.loader.util_emotions import DiscreteEmotion
import os
__all__ = ["LoadTESS",]
class LoadTESS(ILoadSupervised):
def __init__(self, classesBinaryArray=[1,1,1,1,1,1,1], \
foldername="train_data/Folder_AudioEmo... |
#!/usr/bin/python
# multivariate Hawkes process -- simulation and Bayesian inference
# <NAME>
# May, 2014
from numpy import zeros, ones, identity, bincount, log, exp, abs, sqrt, savez, savetxt, shape, eye, all, any, argmin, argmax, array, mean, linspace, sum, loadtxt, concatenate, amax, diag
from slice_sampler import... |
<gh_stars>0
import numpy as np
from scipy.special import gamma
from skimage import color
class MLVMeasurement():
def __init__(self):
self.gam = np.linspace(0.2,10,9801)
def __estimateggdparam(self,vec):
gam = self.gam
r_gam = (gamma(1/gam)*gamma(3/gam))/((gamma(2/gam)) ** 2)
si... |
<reponame>sharhp/My-First-Recommendation-System<filename>utils.py
'''
Package: cs771 - assn 2
Module: plotData
Author: Puru
Institution: CSE, IIT Kanpur
License: GNU GPL v3.0
Various utilities for multi-label learning problems
'''
import numpy as np
from sklearn.datasets import ... |
<filename>dataset_tool/test_dataset_tool.py
#!/usr/bin/env python
# coding=utf-8
'Define the DatasetTool for spatial/frequency domain experiments in the test stage'
__author__ = '<NAME>, <NAME>, <NAME>, <NAME>'
import numpy as np
import scipy.io as sio
from tqdm import tqdm
from .basic_dataset_tool import BasicData... |
<filename>run_predictions.py<gh_stars>0
import argparse
import pathlib
import os
import numpy as np
from scipy.stats import pearsonr
import json
from typing import List
from PIL import Image
from joblib import Parallel, delayed
def compute_convolution(I, T, stride: int = 1, padding: int = 0):
"""
This functio... |
# -*- coding: utf-8 -*-
import numpy as np
import astropy.cosmology
from scipy.integrate import quad
from lenspack.utils import convert_units as conv
from lenspack.utils import sigma_critical
class nfw_profile(object):
def __init__(self, z, c200, m200=None, r200=None, cosmology='default'):
"""<NAME>, & ... |
<gh_stars>1-10
import os
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from scipy import stats
from typing import List
from activity_plot import calculate_month_activity
PLOT_COLOR: str = '#03A9F4'
def fill_ids(df1: pd.DataFrame, df2: pd.DataFrame) -> pd.DataFrame:
df: pd.DataFrame =... |
<reponame>carolmb/viewing-profiles-of-scientific-articles
import sys
import util
import getopt
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from scipy import stats
from sklearn.decomposition import PCA
import matplotlib.gridspec as gri... |
import numpy as np
from nose.tools import *
from pyyeti import psd
from pyyeti.fdepsd import fdepsd
import scipy.signal as signal
def compare(fde1, fde2):
assert np.allclose(fde1.freq, fde2.freq)
assert np.allclose(fde1.psd, fde2.psd)
assert np.allclose(fde1.peakamp, fde2.peakamp)
assert np.allclose(f... |
<reponame>brennash/FootballDashboard
from tasks.Team import Team
from scipy.cluster.vq import kmeans, kmeans2, whiten
import numpy as np
import math
import warnings
class League:
def __init__(self, leagueCode, seasonCode):
# Turn off the numpy warnings
warnings.filterwarnings("ignore")
self.leagueCode = leagu... |
<filename>aopy/util/curvefit.py
# -*- coding: utf-8 -*-
#
# curvefit.py
# aopy
#
# Created by <NAME> on 2013-05-27.
# Copyright 2013 <NAME>. All rights reserved.
#
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
import scipy.optim... |
<filename>Fig7_inversion/Invert_fp32_fp16.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Inversion on the marmousi model
"""
from invflow.SeisCL import SeisCL
from invflow.Inverter import Inverter, EnableCL, InvertError
import tensorflow as tf
import os
import numpy as np
from shutil import copyfile
import hdf5... |
## LOOCV for immunotherapy treated patients, using TMB and network-based transcriptome features
import pandas as pd
from collections import defaultdict
import numpy as np
import scipy.stats as stat
from statsmodels.stats.multitest import multipletests
import time, os, math, random
from sklearn.model_selection import c... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Utility functions for the evaluation of trigger word detection models.
This module contains fuctions to evaluate the performances of models created
with modules model_single and model_multi.
Todo:
* Implement statistics about peak shift and predicted peak length i... |
import numpy as np
from scipy.spatial.distance import directed_hausdorff, cdist
import matplotlib.pyplot as plt
import skimage.io as io
def get_hausdorff(im1, im2, visualise=False, im1_label='Predicted', im2_label='Actual'):
im1_coords = np.array(np.where(im1)).T
im2_coords = np.array(np.where(im2)).T
... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import convolve2d as conv2
from skimage import color, data, restoration
rng = np.random.default_rng()
astro = color.rgb2gray(data.astronaut())
psf = np.ones((5, 5)) / 25
astro = conv2(astro, psf, 'same')
# Add Noise to Image
astro_noisy = astro.c... |
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
""" Evaluation routine for 3D object detection with SUN RGB-D and ScanNet.
"""
import os
import sys
import numpy as np
from datetime import datetime
import argparse
import importlib
import torch... |
import numpy as np
from scipy.optimize import linear_sum_assignment
from sklearn.metrics import r2_score
from gdrive.MyDrive.misc.utils import remap_label, get_bounding_box
def get_multi_pq_info(true, pred, nr_classes=6, match_iou=0.5):
"""Get the statistical information needed to compute multi-class PQ.
... |
<reponame>MedicalVisionGroup/interlacer
import os
import time
import h5py
import numpy as np
import tensorflow as tf
from scipy import ndimage
from skimage.transform import resize
from tensorflow import keras
from tensorflow.keras.datasets import mnist
from interlacer import motion, utils
from scripts import filepath... |
#!/usr/bin/python
import warnings
warnings.filterwarnings("ignore")
import os,pandas
from optparse import OptionParser
import subroutines
import scipy.io,scipy.sparse
#
opts = OptionParser()
usage = "Align reads to build matrix\nusage: %prog -s project --fa chr.fa --bg bg --meme motif.meme --np 4"
opts = OptionParser(u... |
import scipy.interpolate as sci
import matplotlib.pyplot as plt
import numpy as np
def data_graph(dataFile, w, z):
#dataFile = input("Please input the name of the data file (.txt): ") + ".txt"
with open(dataFile, "r") as file:
data=file.read()
data = data.split("\n")
x = [row.split... |
import os
from tqdm import tqdm
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
from python_speech_features import mfcc, logfbank
import librosa
from sys import argv
rows = 1
cols = 2
def plot_signals(signals):
fig, axes = plt.subplots(nrows=rows, ncols=cols, sh... |
<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
from imageio import imread
from scipy.ndimage.filters import convolve
from skimage.color import rgb2gray
import os
GRAYSCALE = 1
MIN_RES = 16
def build_gaussian_pyramid(im, max_levels, filter_size):
"""
Construct a Gaussian pyramid for a given im... |
from __future__ import division
import dqn
import gym
import numpy as np
import random
# import matplotlib.pyplot as plt
import scipy.misc
import os
from gridworld import gameEnv
env = gameEnv(partial=False, size=5)
print('bal')
testMnih = dqn.QnetworkMnih13()
testMnih.runTraining(env)
|
import tensorflow as tf
import numpy as np
import scipy.misc as misc
import os, sys
import scipy.io
import matplotlib.cm as cm
from functools import partial
def save_image(image, save_dir, name):
"""
Save image by unprocessing if mean given else just save
:param mean:
:param image:
:param save_dir... |
<reponame>VinceBaz/neuromaps
# -*- coding: utf-8 -*-
"""
Functions for working with triangle meshes + surfaces
"""
from joblib import Parallel, delayed
import numpy as np
from scipy import ndimage, sparse
from neuromaps.images import load_gifti, relabel_gifti, PARCIGNORE
def point_in_triangle(point, triangle, retur... |
<reponame>Campbell-Muscle-Lab/PyMyoVent<filename>Python_code/single_ventricle_circulation/half_sarcomere/membranes/grandi_2009.py
# Size of variable arrays:
sizeAlgebraic = 114
sizeStates = 39
sizeConstants = 124
from math import *
from numpy import *
def createLegends():
legend_states = [""] * sizeStates
lege... |
from __future__ import division
import scipy.linalg
import autograd.numpy as anp
from autograd.numpy.numpy_wrapper import wrap_namespace
wrap_namespace(scipy.linalg.__dict__, globals()) # populates module namespace
sqrtm.defvjp(lambda g, ans, vs, gvs, A, **kwargs: solve_lyapunov(ans, g))
def _flip(a, trans):
i... |
import sys
import statistics
from timeit import default_timer as timer
from raffiot import io
from raffiot.io import IO
n = int(sys.argv[1])
t = int(sys.argv[2])
def fibo(i: int) -> int:
if i > 1:
return fibo(i - 1) + fibo(i - 2)
else:
return i
def fibo_io(i: int) -> IO:
if i > 1:
... |
# coding: utf-8
#
# This code is part of dqmc.
#
# Copyright (c) 2022, <NAME>
#
# This code is licensed under the MIT License. The copyright notice in the
# LICENSE file in the root directory and this permission notice shall
# be included in all copies or substantial portions of the Software.
import numpy as np
from s... |
#!/usr/bin python3
import numpy as np
import scipy as sp
import casadi as ca
import pathlib
import os
import copy
import shutil
import pdb
import warnings
from datetime import datetime
import matplotlib
import matplotlib.pyplot as plt
from typing import List, Dict
from DGSQP.types import VehicleState, VehiclePredi... |
<reponame>mileswhen/zoomppg<filename>tests/test2.py
import numpy as np
import warnings; warnings.filterwarnings("ignore")
import cv2
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mplib
import scipy.signal as signal
from statistics import mean, stdev
import time
cap = cv2.VideoCapture(0)
x,... |
from lib.device import Camera
from lib.processors_noopenmdao import findFaceGetPulse
from lib.interface import plotXY, imshow, waitKey, destroyWindow
from cv2 import moveWindow
import argparse
import numpy as np
import datetime
#TODO: work on serial port comms, if anyone asks for it
#from serial import Serial
import so... |
<gh_stars>0
import cv2
import os
import shutil
import numpy as np
import tensorflow as tf
import core.utils as utils
from core.config import cfg
from core.yolov4 import YOLOv4, decode
from PIL import Image
from matplotlib.pyplot import imshow
from urllib.request import urlopen
from scipy.misc import imread
INPUT_SIZE ... |
# test importing of required modules and sit2standpy package
def test_numpy():
import numpy
return
def test_scipy():
import scipy
return
def test_pywt():
import pywt
return
def test_pysit2stand():
import sit2standpy
from sit2standpy import Sit2Stand, detectors, mov_stats, Tran... |
"""
Created Date: Thursday, March 10th 2022, 9:26:53 pm
Author: <NAME>
Copyright (c) 2022 Your Company
"""
import open3d as o3d
import numpy as np
from glob import glob
from scipy.spatial.transform import Rotation as R
from .BaseLoader import BaseLoader
class PittsLoader(BaseLoader):
def __init__(self, dir_pat... |
################################################################################
# INIT
################################################################################
import numpy as np
import theano
import theano.tensor as T
import lasagne as ... |
"""
This file is a modified version of https://github.com/sigsep/open-unmix-pytorch/blob/master/test.py
"""
import torch
import numpy as np
import argparse
import soundfile as sf
import norbert
import json
from pathlib import Path
import scipy.signal
import resampy
import model
import utils
import warnings
import tqdm... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
from IPython.display import Image
import pydotplus
import utils
#plotting
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns # statistical data visualization with matplotlib
#stats
import math
imp... |
<reponame>goatchurchprime/barmesh<filename>democode/modelprobelocaterottest.py
import sys, random, math, time
sys.path.append(r"/home/goatchurch/geom3d/barmesh")
from basicgeo import P2, P3, Partition1, Along, Quat
import barmesh, triangleboxing, mainfunctions
import implicitareaballoffset, implicitareacyloffset
import... |
<filename>src/model/model.py
import os, pickle, json
from scipy.sparse import csr_matrix, load_npz
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
import numpy as np
import pandas as pd
import dask.dataframe as dd
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics... |
<reponame>forest1040/scikit-qulacs
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Callable, List, Optional, Tuple
import numpy as np
from numpy.typing import NDArray
from scipy.optimize import minimize
CostFunc = Callable[[List[float], NDArray[np.float_], NDArray[np.float_]],... |
import pytest
import os
import sympy as sp
import rolldecay.paper_writing as paper_writing
import rolldecay
import rolldecayestimators.equations
import rolldecayestimators.symbols
paper_path = rolldecay.paper_path
def test_find_tex_files():
file_paths = paper_writing._find_tex_files(paper_path=paper_path)
as... |
""" Adapted from https://scipy-cookbook.readthedocs.io/items/Data_Acquisition_with_NIDAQmx.html."""
import ctypes
import numpy
import time
import scipy.interpolate
import os
import gateway.metadata as md
nidaq = ctypes.windll.nicaiu # load the DLL
#FILE_PATH = "../../data/files/"
#FILE_PATH = "C:/Z/THI... |
#!/usr/bin/env python
#-------------------------------------------------------------------------------
# Name: Sequitr
# Purpose: Sequitr is a small, lightweight Python library for common image
# processing tasks in optical microscopy, in particular, single-
# molecule imaging, super-resolution... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Title : polar-coordinates
Subdomain : Math
Author : <NAME>
Created : 05 September 2018
https://www.hackerrank.com/challenges/polar-coordinates/problem
"""
import cmath
def print_polar_coor(complex_number):
r, y = cmath.polar(complex(co... |
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 26 08:43:25 2017
@author: mattsears
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
from pylab import rcParams
filepath = 'results/results.xlsx'
imagePath = 'results/images/'
results ... |
<filename>recognize.py
import cv2
import os
import numpy as np
import pickle
from tensorflow.keras.models import load_model
from sklearn.preprocessing import LabelEncoder
from mark_attendance import Mark_Attendance
from statistics import mode
from datetime import datetime
import pandas as pd
root_dir = os.getcwd()
fa... |
# -*- coding: utf-8 -*-
# """
# Created on Tue Jul 30 10:02:48 2019
# @author: <NAME> and <NAME>
# Compute unstable peridoic orbits at different energies using turning point method
# """
# For the DeLeon-Berne problem
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_iv... |
<reponame>PPTMiao/mtl-ssl<filename>object_detection/eval_util.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://w... |
# -*- coding: utf-8 -*-
from src.env import DATA
from src.postproc.utils import load_elec_file, order_dict
from analysis.fig1_fig2_and_stats import plot_matrix, multipage
from analysis.bha import cross_modularity
import os
from os.path import join as opj
import numpy as np
import scipy.io as sio
from matplotlib import... |
#!/usr/bin/env python
# coding: utf-8
# !jupyter nbconvert --no-prompt --to=python deconv.ipynb
import numpy as np
from scipy.signal import convolve2d
from os import path, system
from astropy.io import fits
from numpy.fft import fft2, ifft2
from time import perf_counter
def psf_gaussian(npixel=0, ndimension=2, f... |
from __future__ import print_function, division
import sys,os
from quspin.operators import hamiltonian, quantum_operator # Hamiltonian and observables
from quspin.basis import spin_basis_1d # Hilbert space bases
from quspin.tools.measurements import obs_vs_time # t_dep measurements
import numpy as np # generic math fun... |
"""
checks all result files subdirectories of queue_caches an writes results to /result/
"""
import csv
import glob
import json
import os
import pickle
import statistics
from itertools import groupby
from misc.learn_weights.csv_to_parallel_coordinates_plotter import generate_plot
from tools import mapper
def weights... |
# -*- coding: utf-8 -*-
"""Rapid Asymetric Maximung Chunking
see: https://www.sciencedirect.com/science/article/pii/S0167739X16305829
"""
import logging
from math import log
from pprint import pprint
from typing import List
from statistics import mean
from hyperopt import hp, fmin, tpe, Trials
from iscc_bench.algos.me... |
from scipy.optimize import root
import numpy as np
import cantera as ct
import pandas as pd
from solventx import result_struct as rs
from solventx import utilities
from solventx import config
import operator
import os
class solventx:
coltypes = ['Extraction','Scrub','Strip']
ml2l ... |
<filename>plot_snow.py
import numpy as np
import pandas as pd
from mpl_toolkits.axes_grid1 import make_axes_locatable
import pidsim.ml_simulator as pmpp_rf
import h5py
import os
import platform
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.ticker as mticker
import matplotlib.gridspec as gri... |
"""This is a wrapper for training XFalcon models."""
import gc
import copy
import logging
import os
from pathlib import Path
import scipy.sparse as smat
import numpy as np
from pecos.xmc import LabelEmbeddingFactory
from xcb.indexing import co_clustering
from xcb.xmc import multilabel_train as mt
LOGGER = logging.get... |
from sympy import *
# sympy化简: https://blog.csdn.net/FYZDMMCpp/article/details/86611948
# Lorentz变换: https://baike.baidu.com/item/%E6%B4%9B%E4%BC%A6%E5%85%B9%E5%8F%98%E6%8D%A2/620820?fr=aladdin
# 静止坐标系
x, y, z, t, c = symbols("x,y,z,t,c")
# 运动坐标系
x1, y1, z1, t1 = symbols("x',y',z',t'")
gamma, v = symbols('gamma, v')... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.