text string |
|---|
<reponame>conscienceli/MDTNet<filename>utils/some_scripts/draw_skeleton.py
#%% detect cup
import argparse
import cv2
import math
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import scipy.ndimage as ndimage
from matplotlib import pyplot as plt
from skimage import exposure, filters
from skimage.... |
"""Dark matter - electron scattering
"""
import numericalunits as nu
import numpy as np
from scipy.interpolate import RegularGridInterpolator, interp1d
from scipy.integrate import quad, dblquad
from scipy.stats import binom
import wimprates as wr
export, __all__ = wr.exporter()
__all__ += ['dme_shells', 'l_to_letter',... |
"""
Cosmological power spectrum (linear growth etc.)
"""
from __future__ import print_function
from numpy import sin, cos, power, square, pi, sqrt, loadtxt, log, array, exp, interp
from scipy.integrate import quad
from .log import null_log
from iccpy.cgs import yr, mpc
def hubble_closure(H0, OmegaM0, OmegaLam0):
... |
"""
Unit and regression test for the kissim.comparison.tree module.
"""
from pathlib import Path
import pytest
import pandas as pd
from scipy.spatial import distance
from scipy.cluster import hierarchy
from kissim.utils import enter_temp_directory
from kissim.comparison import tree
PATH_TEST_DATA = Path(__name__).p... |
<filename>1-XD_XD/code/v12_im.py
# -*- coding: utf-8 -*-
"""
Image preprocessing module
* 1/1 slice MUL images
* depends on v5_im
* used by v13 and v17
Author: Kohei <<EMAIL>>
"""
from logging import getLogger, Formatter, StreamHandler, INFO
from pathlib import Path
import math
import glob
import warnings
import cli... |
"""Functions and classes for creating particle grids, counting bins and transition matrices."""
# Imports
import pandas as pd
import numpy as np
import xarray as xr
import networkx as nx
from scipy.interpolate import griddata
from scipy.spatial import cKDTree, SphericalVoronoi
from scipy import sparse
from astropy.coor... |
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import seaborn as sns
max_n_components = 6
fwhm = 0.3
sns.set_style('whitegrid')
sns.set_context('poster')
import os
import pandas
import numpy as np
import itertools
from multiprocessing im... |
<reponame>koulakhilesh/taxi101<filename>taxi101.py<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is for taxi101, please see requirement.txt and readme file.
@author:akhilesh.koul
"""
#library imports
import numpy as np
import pandas as pd
import geopandas as gpd
import matplotlib.pyplot as plt
i... |
#!/bin/python3
# if used ubuntu 20.10 or later, interpreter set as #!/bin/python and use pip instead of pip3
# # =================================================================== #
# # platfrom check
# # dateutil check and import
# try:
# from scipy.linalg import fractional_matrix_power
# except:
# import os... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
def s_shape(x, power=1.5, eps=1e-7):
"""Helper function to densify the midle of a cubic Bezier curve"""
return (
1 / (
1 + ((x + eps) / (1 - x + eps)) ** -power
)
)
def bezier3(cont... |
import numpy as np
from scipy.stats import norm
import pandas
from tqdm import tqdm
import random
import torch
import statsmodels.api as sm
import statsmodels.formula.api as smf
# Load kcgof for testing conditional
import kcgof.util as util
import kcgof.cdensity as cden
import kcgof.cgoftest as cgof
import kcgof.kerne... |
#!/usr/bin/env python
import os
import sys
import numpy
import scipy.optimize
import pyds9
import argparse
import astLib.astWCS as astWCS
import scipy.spatial
from astropy.io import fits
from astroquery.vizier import Vizier
import astropy.coordinates
from astropy.coordinates import Angle, FK5
import astropy.units ... |
<filename>statistics/W/significance_fit.py
#!/usr/bin/env python
import ROOT as r,sys,math,array,os
from optparse import OptionParser
from ROOT import std,RooDataHist
from array import array
import numpy as np
import pandas as pd
from scipy.stats import poisson, norm, kstest
from pvalue import *
fOutput="Output.root"
... |
import types
import numpy as np
import scipy as sp
import pymc3 as pm
import theano as th
import theano.tensor as tt
import theano.tensor.slinalg as tsl
import theano.tensor.nlinalg as tnl
from scipy import stats
from theano.ifelse import ifelse
from .elliptical import debug_p
from .stochastic import StochasticProcess
... |
'''
Created on 24 juil. 2015
@author: admin
'''
import unittest
import numpy as np
import scipy.sparse as sparse
import som
import csom
from som import _hexagonal as hex
class SOMMaperTest(unittest.TestCase):
def setUp(self):
"""
We create a simple test corpus that can be used as text data.
... |
import pandas as pd
from types import SimpleNamespace
import typing as t
from scipy import sparse as sp
import numpy as np
import random
from ast import literal_eval as make_tuple
np.random.seed(42)
random.seed(42)
"""
prefiltering:
strategy: global_threshold|user_average|user_k_core|item_k_core|iterative_k_core|... |
import numpy as np
import pytest
from numpy.testing import assert_allclose
from scipy.optimize import fsolve
from einsteinpy.geodesic.utils import _energy, _sphToCart
@pytest.mark.parametrize(
"q, p, a, mu, expected",
[
(
[2.5, np.pi / 6, np.pi / 2],
[0.1, 2., 2.],
... |
import numpy as np
from scipy import stats
from sklearn.utils import check_arrays
from sklearn.utils.extmath import norm
# f_regression with correct degrees of freedom when center=False
# available is sklearn version >= 0.15
# This version does not support sparse matrices and is used to have tests
# passing for versi... |
#!/usr/bin/env python
__author__ = "<NAME>"
__copyright__ = "Copyright 2019, QoS-aware WiFi Slicing"
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Prototype"
''' Python script for parsing Z3 raw results'''
import json
import statistics
base_path = '/Users/phiso... |
## Python Module for Vectorised Backtesting
import numpy as np
import pandas as pd
from scipy.optimize import brute
import yfinance as yf
class VectorBacktester(object):
""" Class for vectorized backtesting
Attributes
==========
symbol: str
symbol to work with
SMA1: int
... |
<filename>demo/heat_1d_cn.py
# Solve the heat equation
#
# u_t = u_xx in (-1, 1) x (0, T)
# u(-1, t) = 0
# u(1, t) = 1
# u(x, 0) = sin(k*pi*x) + (1+x)/2
#
from __future__ import division
from sympy import symbols, integrate, sin, symbols, simplify, pi, exp
from lega.common import reference_mapping, jacobia... |
import unittest
from cmath import exp, cos, sin, pi
from itertools import product
import numpy as np
from numpy.testing import assert_allclose
from random import random, seed
from builtin_arithmetics import invert_gate, reduce_consecutive_u3
from builtin_gates import X_GATE, Y_GATE, Z_GATE, H_GATE, U3_GATE
def _u3(... |
<reponame>Keito-oz/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers
from IPython.core.pylabtools import figsize
import numpy as np
from matplotlib import pyplot as plt
figsize(11, 9)
import scipy.stats as stats
dist = stats.beta
n_trials = [0, 1, 2, 3, 4, 5, 8, 15, 50, 500]
data = stats.bernoulli.rvs(0.5, s... |
<filename>photometric_stereo.py
from light_vector_resampler import LightVectorResampler
from denominator_finder import DenominatorFinder
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
for dataset_num in range(3,4):
sample_points_num = 310
##==== resample light vectors ... |
<reponame>orange-eng/internship
"""
Hint: please ingore the chinease annotations whcih may be wrong and they are just remains from old version.
"""
import sys
import json
import math
import numpy as np
from scipy.ndimage.filters import gaussian_filter
import tqdm
import time
import cv2
import torch
import torch.nn.fun... |
<gh_stars>0
from __future__ import print_function
import sys
from setuptools import setup, find_packages
with open('requirements.txt') as f:
INSTALL_REQUIRES = [l.strip() for l in f.readlines() if l]
try:
import numpy
except ImportError:
print('numpy is required during installation')
sys.exit(1)
try... |
#!/usr/bin/env python
'''
File Name: composites.py
Description: El Niño composites.
Observations: Statistical Significance is left for the user determination.
Author: <NAME>
E-mail: <EMAIL>
Python Version: 3.6
'''
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature ... |
<reponame>chenzhaiyu/abspy<filename>abspy/complex.py
"""
complex.py
----------
Cell complex from planar primitive arrangement.
A linear cell complex is constructed from planar primitives
with adaptive binary space partitioning: upon insertion of a primitive
only the local cells that are intersecting it will be update... |
import numpy as np
import pickle
import pandas as pd
import seaborn as sns
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
import json
def init_plotting():
sns.set_style("darkgrid", {"axes.facecolor": "0.9"})
# plt.rcParams['figure.figsize'] = (15, 8)
plt.rcParams['figure.figsize'] = (4, 6)
p... |
<filename>spect_image.py
#Data visualization
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#Audio Analysis
import librosa
import librosa.display
import tensorflow as tf
#path
import os
import tensorflow_io as tfio
from scipy.io import wavfile
#import meta data
df_meta = pd.read_csv('./CoronaHa... |
<reponame>ifkid/gnnex
# -*- coding: utf-8 -*-
# @Time : 2019-10-15 14:32
# @Author : Jason
# @FileName: utils.py
import scipy.sparse as sp
import numpy as np
from scipy.sparse.linalg.eigen.arpack import eigsh, ArpackNoConvergence
import random
import matplotlib.pyplot as plt
import os
def encode_onehot(labels):... |
<reponame>aileisun/bubblepy
# noiselevel.py
# ALS 2017/08/29
"""
tool sets to measure the noise level of an image by fitting a Gaussian to the histogram of the image pixel values
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.signal import medfilt
def getnoi... |
<reponame>DanielaZahn/TTM_inputs_from_DFT_results<filename>functions/phonon_heat_capacity.py
import numpy as np
import scipy.constants as constants
def calculate_phonon_heat_capacity(temperatures,v_dos):
# This function calculates the phonon heat capacity from the phonon density of states.
# INPUTS:
# IMPO... |
from PIL import Image
import requests
from io import BytesIO
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import scipy as sp
from wordcloud import WordCloud, STOPWORDS
import surprise
from surprise import Reader
from surprise import Dataset
from surprise.model_selectio... |
import torch
import numpy as np
import print_custom as db
import unittest
import scipy
from train_pg_f18 import build_mlp
from train_pg_f18 import PolicyNet
from train_pg_f18 import Agent
class ModelTest(unittest.TestCase):
# def testModelOutputShape(self):
# input_size, ouput_size, layers, hidden = 5... |
import collections
import os
import sys
import numpy as np
from scipy.spatial.distance import cosine
def load_centroids(path):
centroids = {}
with open(path) as cfile:
for line in cfile:
centroid_id,vector = line.strip().split(':')
centroids[int(float(centroid_id))] = np.arr... |
# authors_name = '<NAME>'
# project_title = 'Multi Sensor-based Human Activity Recognition using OpenCV and Sensor Fusion'
# email = '<EMAIL>'
import pandas as pd
import numpy as np
from scipy.io import loadmat
from skeleton_points_extraction import choose_caffe_model_files
from skeleton_points_extraction import expo... |
<filename>adv_reprogramming.py<gh_stars>1-10
import random
import os
import numpy as np
from time import time
import cv2
import tensorflow as tf
import tensorflow.contrib.slim as slim
from sklearn.model_selection import KFold, StratifiedKFold
import pandas as pd
import pickle
from scipy import stats
import math
import ... |
<reponame>lis-epfl/vmodel
import matplotlib.pyplot as plt
import numpy as np
import xarray as xr
from vmodel.geometry import tangent_points_to_circle
from vmodel.util import sort_dict
import vmodel.util.xarray as xrutil
from scipy.spatial import ConvexHull
REDUCE_NAMES = {
'min': 'Mininum',
'mean': 'Mean',
}
... |
<gh_stars>1-10
#!/usr/bin/env python3
'''Create python database from tri files'''
import numpy as np
import glob, re, collections
import argparse, pickle
from scipy import spatial
def make(tridir,keepoutliers=False,dynamicfilter=True):
'''Create an optimized python database for looking up calculated chemical shi... |
#minimizing scalar func of vector argument
import numpy as np
import scipy as sp
from copy import deepcopy
def func(x):
y = 0
for i in range(x.shape[0]):
for j in range(x.shape[0]):
if i == j:
y += x[i] ** 2
else:
y += 2 * x[i] * x[j]
return ... |
<reponame>teslyuk/kaggle-jigsaw-severity-toxic
import pandas as pd
import numpy as np
from sklearn.linear_model import Ridge
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import mean_squared_error
from scipy.stats import rank... |
<filename>respiratory/Processed Datasets/Processed Datasets/try2_34.py
# Finding coefficients in ranking algorithm by comparing results to actual ranking
# coefficients to find
# 1) 'punishment' for not participating (1 unknown - assigning non-positive number to exercise)
# 2) weight of each exercise (10 unknowns - on... |
<gh_stars>0
"""Display functions for the game deck and board."""
from tkinter import Tk
from tkinter import Canvas
from pathlib import Path
import tiles
import math
import cmath
import os
class Display:
"""Contains modules for game visualization."""
def __init__(self):
"""Initialize class for display... |
# GUI frame for the hpsMorph_function.py
try:
# for Python2
from Tkinter import * ## notice capitalized T in Tkinter
import tkFileDialog, tkMessageBox
except ImportError:
# for Python3
from tkinter import * ## notice lowercase 't' in tkinter here
from tkinter import filedialog as tkFileDial... |
# -*- coding: utf-8 -*-
from sympy import *
from mpmath import *
import pandas
import math
import operator
# from methods.knn import KNN
import csv
from numpy import array
import random
from sklearn.model_selection import KFold
def euclideanDistance(instance1, instance2, length):
distance = 0
for x in... |
<filename>src/pyskindose/calculate_dose/add_correction_and_event_dose_to_output.py
from typing import List, Dict, Any
import numpy as np
import pandas as pd
from pyskindose import Phantom, constants as c
import logging
from pyskindose.corrections import calculate_k_med
from scipy.interpolate import CubicSpline
logger... |
from models import Experiment
import pandas as pd
from scipy.stats import ttest_ind, hypergeom
def ttest(experiment: Experiment):
"""This is a two-sided test for the null hypothesis that 2 independent samples have identical average (expected) values.
This test assumes that the populations have identical v... |
<filename>src/features/get_stats.py<gh_stars>0
"""
<NAME>
Statistical Functions for Fisher's exact to get the pairwise TF values
"""
import pandas as pd
import glob, os
from collections import Counter,defaultdict
import seaborn as sns
import numpy as np
import scipy.stats as stats
def eval_tf(tf, genes, original_d... |
import dimarray as da
import pytest
import numpy as np
import warnings
collect_ignore = ["setup.py", "docs/conf.py", "dist", "build", "tests/testing.py", "tests/test_mpl.py", "docs/scripts"]
collect_ignore.append('docs/_build_rst/dimarray.rst')
collect_ignore.append('sandbox/numpy_checks.py')
try:
import netCDF4
... |
<reponame>tucaman/lppls
import multiprocessing
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
import random
from scipy.optimize import minimize
# from scipy import linalg
import statistics as stats
class LPPLS(object):
def __init__(self, use_ln, observations):
"""
Ar... |
<gh_stars>1-10
import numpy as np
from numpy import sin,cos
from astropy.cosmology import FlatLambdaCDM
from scipy.interpolate import interp1d
def cosmo_cohlength(zmax, L0, cosmo=FlatLambdaCDM(H0=70., Om0=0.3)):
"""
Calculate a grid of coherence lengths given a maximum
redshift, coherence length, and cosm... |
"""A module for hydrology-related functionality.
Most functions are used in the `swimpy.output` module but they are placed here
to enable """
import warnings
import numpy as np
import pandas as pd
def NSE(obs, sim):
"""Nash-Sutcliff-Efficiency.
Arguments
---------
obs, sim : same-length 1D array or... |
<filename>scripts/run_experiment.py
# ~~~
# This file is part of the paper:
#
# " An Online Efficient Two-Scale Reduced Basis Approach
# for the Localized Orthogonal Decomposition "
#
# https://github.com/TiKeil/Two-scale-RBLOD.git
#
# Copyright 2019-2021 all developers. All rights reserved.
... |
<reponame>salammemphis/DeepBrainIPP<filename>Scripts/mousebrainsegmentation/process.py
import os,glob,sys, shutil
import argparse
import nibabel as nib
from nilearn.image import resample_to_img
from train_brain import config, fetch_mouse_data_files
from unet3d.prediction import run_validation_cases
from unet3d.data im... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
# Essentials
import os, sys, glob
import pandas as pd
import numpy as np
import nibabel as nib
import scipy.io as sio
# Stats
import scipy as sp
from scipy import stats
import statsmodels.api as sm
import pingouin as pg
# Plotting
import seaborn as sns
import matplotl... |
<filename>doc/src/LectureNotes/testbook/_build/jupyter_execute/chapter4.py
# Work, Energy, Momentum and Conservation laws
Energy conservation is most convenient as a strategy for addressing
problems where time does not appear. For example, a particle goes
from position $x_0$ with speed $v_0$, to position $x_f$; what i... |
<filename>db/similarity/OtoO_Similarity.py
# -*- coding: utf-8 -*-
from scipy import linalg, mat, dot
import numpy as np
import sys
import math
def main(argument1, argument2) :
text = argument1+ " " + argument2
table = dict()
wcnt = 0
for word in text.split():
if word not in table... |
"""Get a priori solar flux data
Description:
------------
Reads time-dependent solar flux from file.
References:
-----------
http://www.ngdc.noaa.gov/stp/space-weather/solar-data/solar-features/solar-radio/noontime-flux/penticton/penticton_observed/tables/
https://www.ngdc.noaa.gov/stp/space-weather/solar-data/sol... |
<gh_stars>1-10
#!/usr/bin/env python
import numpy as np
import os
import sys
import time
from PIL import Image
import scipy.misc
import tensorflow as tf
from collections import OrderedDict
import cPickle as pkl
import crc_input_data_seq
from util import log, override
from models.base import ModelBase, BaseModelConf... |
<reponame>nestauk/narrowing_ai_research
import pandas as pd
import numpy as np
import altair as alt
import logging
import networkx as nx
import yaml
from scipy.stats import zscore
from narrowing_ai_research.utils.read_utils import (
read_papers,
read_topic_mix,
)
from narrowing_ai_research.utils.altair_utils i... |
<filename>dataset.py
import numpy as np
import tensorflow as tf
import numpy as np
import scipy
from layers.utils import EPSILON
tetris = [[(0, 0, 0), (0, 0, 1), (1, 0, 0), (1, 1, 0)], # chiral_shape_1
[(0, 0, 0), (0, 0, 1), (1, 0, 0), (1, -1, 0)], # chiral_shape_2
[(0, 0, 0), (1, 0, 0), (0, 1, 0)... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
# simple, early phenom frequency-space waveform according to Ajith et al. (2008)
# https://arxiv.org/abs/0710.2335
# Just calculating the amplitude and phase here (latter is relative, so you have to choose an offset)
a1 = 2.9740e-1
a2 = ... |
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
from utils import audspec,postaud,dolpc,lpc2cep,spec2cep,lpc2spec,lifter,power_spectrum
def powspec(x, sr,wintime=0.025, steptime= 0.010, dither=1):
winpts = int(np.round(wintime*sr));
steppts =int(np.round(steptime*sr));
NFFT = 2**(np... |
import json
import time
import numpy as np
import os
import sys
from copy import deepcopy
import timeit
from PyQt4 import QtGui, QtCore, Qt
from PyQt4.QtCore import pyqtSignal
from twisted.internet.defer import inlineCallbacks
from scipy.optimize import least_squares
sys.path.append('../../')
sys... |
<filename>peas/tasks/linefollowing/linefollowing.py
#! /usr/bin/python
""" Top-down line following task
"""
### IMPORTS ###
import random
import os
# Libraries
import pymunk
import numpy as np
from scipy.misc import imread
# import imread
# Local
from ...networks.rnn import NeuralNetwork
# Shortcuts
pi = np.pi
##... |
<gh_stars>0
"""
Tools for linear least square fitting also called linear regression.
"""
from numpy import *
import numpy as np
# for chi2 probability
import scipy.stats as SS
import pdb
from .parameters import *
# setup the general fit function
def linfit(function, y, x = None, y_err = None, nplot = 100):
... |
"""
Useful small tools for spectroscopic analysis
"""
import numpy as np
from numpy.polynomial.polynomial import polyval
from scipy import interpolate
import warnings
# Create a center wavelength grid with constant width in log (i.e., velocity) space:
# Input is in Angstrom, output is log10(lambda/Angstrom)
def get... |
"""
kkpy.plot
========================
Functions to read and write files
.. currentmodule:: plot
.. autosummary::
kkpy.plot.koreamap
kkpy.plot.icepop_sites
kkpy.plot.cartopy_grid
kkpy.plot.tickint
kkpy.plot.scatter
kkpy.plot.density2d
"""
import numpy as np
import matplotlib.pyplot as plt
im... |
<reponame>focusunsink/study_python
# -*- coding:utf-8 -*-
"""
Project : numpy
File Name : 15_16_conway_game_life
Author : Focus
Date : 8/26/2021 12:56 AM
Keywords :
Abstract :
Param :
Usage : py 15_16_conway_game_life
Reference :
"""
import numpy as np
import matplotlib.pyplot as plt
import sys
im... |
import numpy as np
import scipy.misc
import urllib.request as urllib
import utils.dataloaders as dataloaders
from models.wideresnet import *
from models.lenet import *
from utils.helpers import *
import methods.entropy.curriculum_labeling as curriculum_labeling
import torch
class Wrapper:
"""
All steps for o... |
<gh_stars>0
# Description: Fuctions for calculating derived quantities
# from LeTSROMS model-sampled fields.
# Author/date: <NAME>, July/2017.
# E-mail: <EMAIL>
__all__ = ['crosstrk_flux',
'mke',
'eke',
'ape',
'pespec',
'kespec',
'xspe... |
<filename>calibration.py<gh_stars>0
import serial
import matplotlib.pyplot as plt
import matplotlib.animation
import numpy as np
import re
from scipy import linalg
from scipy import optimize
fig = plt.figure()
ax = plt.axes(projection='3d')
ax.grid()
x=[]
y=[]
z=[]
try:
with open('samples.npy', 'rb') as f:
... |
#!/usr/bin/env python
"""
Created by stevertaylor
Copyright (c) 2014 <NAME>
Code contributions by <NAME> (piccard) and <NAME> (PAL/PAL2).
"""
from __future__ import division
import numpy as np
from numpy import *
import os, optparse, corner, json
import h5py as h5
import matplotlib
matplotlib.use('macosx')
import ... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 22 13:06:02 2017
@author: lex
"""
import numpy as np
from scipy.spatial import ConvexHull
class Path(object):
"""Transform a list of coordinates into a path object"""
def __init__(self, coordinatesIN):
super(Path, s... |
<filename>plot_measurements.py
##############################################################
########################## The *Bakers #######################
######################### (AstroBakers) ######################
######################### 2021 #######################
####################################... |
#
# Copyright IBM Corporation 2022
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
import argparse
import sys
import pickle
import os
import numpy as np
import conj_grad as cg
import scipy.sparse as sp
import scipy.optimize as opt
from time import time,ctime
##########################################################################################
def p(pdict):
keys = sorted(pdict.keys())
... |
<reponame>aknottymathematician/Intent-Detection<filename>Emotix NLP Task.py
#!/usr/bin/env python
# coding: utf-8
# In[338]:
import pandas as pd
import matplotlib.pyplot as plt
import re
import nltk
from nltk.corpus import stopwords
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
from sk... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2021 <NAME>(<EMAIL>). All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights t... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
from __future__ import absolute_import, print_function
import os
import errno
import inspect
import time
import numpy as np
import scipy.sparse as sp
import numpy.core.numeric as _nx
def format_seconds(secs):
if secs < 1e-3:
t, u = secs * 1e6, 'mi... |
<gh_stars>0
# -----------------------------------------------------------------------------
# This file contains several utility functions for reproducing results
# of the WWL paper
#
# October 2019, <NAME>
# -----------------------------------------------------------------------------
import numpy as np
import os
fro... |
import scipy as sp
import scipy.ndimage as spim
import scipy.sparse as sprs
import warnings
import porespy as ps
from scipy.sparse import csgraph
from openpnm.utils import PrintableDict, logging, Workspace
ws = Workspace()
logger = logging.getLogger(__name__)
def find_neighbor_sites(sites, am, flatten=True, include_i... |
import sys
sys.path.append("../")
import helpers.feature_model_helpers as fmh
import pandas as pd
import pickle
from gensim.models import Word2Vec
from importlib import reload
from pathlib import Path
import pickle as pkl
import numpy as np
from scipy.sparse import coo_matrix
reload(fmh)
# %% Get ID from arg
try:
... |
<reponame>anguyen8/generative-attribution-methods
import os
import cv2
import sys
import time
import scipy
import torch
import argparse
import numpy as np
import torch.optim
from formal_utils import *
from skimage.transform import resize
from PIL import ImageFilter, Image
use_cuda = torch.cuda.is_available()
# Fixin... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy.stats
def markov_test_homogeneity(sequence, size=10):
"""**Is the Markov process homogeneous?**
Performs a homogeneity test that tests the null hypothesis that the samples are
homogeneous, i.e., from the same - but unspecified - population, against ... |
"""
Created on Wed Feb 5 16:07:35 2020
@author: matias
"""
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import minimize
import emcee
import corner
from scipy.interpolate import interp1d
import sys
import os
from os.path import join as osjoin
from pc_path import definir_path
path_git, ... |
from matplotlib import pyplot as plt
import tensorflow as tf
import numpy as np
import scipy
from getdist import plots, MCSamples
import traceback
from scipy.stats import chi2
from tqdm import tqdm
from .ConfidenceIntervalsOnlySamples import ConfidenceIntervalsOnlySamples
class ConfidenceIntervalsOnlySamplesRegressi... |
<reponame>ajensen1234/ShapeWorks
import os
import sys
import numpy as np
from shapeworks import *
success = True
# load an image
def initImageTest1():
img = Image(os.environ["DATA"] + "/femurImage.nrrd")
return img
success &= utils.test(initImageTest1)
# pass invalid path to make sure an exception is thrown
de... |
<filename>tensorflow_probability/python/internal/empirical_statistical_testing.py
# Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... |
# -*- coding: utf-8 -*-
# @Date : 2019/12/30 14:30
# @Author : stellahong (<EMAIL>)
# @Desc : Exploratory data analysis
import numpy as np
from scipy import stats
from collections import Counter
NLP_WORDS_STAT_METHODS = {"avg","max","min","median","mode","std"}
def ohe2cat(label):
label = np.reshape(label,... |
<filename>functions/DICTIONARIES_AGNfitter.py
"""%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DICTIONARIES_AGNFitter.py
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
This script contains all functions which are needed to construct the total model of AGN.
##For constructing a new dictionary,
(in cases: 1)add a filter which i... |
import subprocess
import statistics
import sys
with open("out.txt", "w+") as fout:
for nthreads in range(5):
for nsamples in [1, 4, 16, 64]:
times = []
for i in range(5):
out = subprocess.call(["./main.o", str(nthreads), str(nsamples)], stdout = fout);
... |
<reponame>TJConnellyContingentMacro/northwestern<gh_stars>0
# 1. A famous researcher observed that chimpanzees hunt and eat meat as part of their regular diet.
# Sometimes chimpanzees hunt alone, while other times they form hunting parties. The following table
# summarizes research on chimpanzee hunting parties, givi... |
<reponame>arrayfire/af-sklearn-monkeypatch
import numpy as np
import scipy.sparse as sp
from sklearn.utils.sparsefuncs import _raise_error_wrong_axis
from sklearn.utils.sparsefuncs_fast import csc_mean_variance_axis0 as _csc_mean_var_axis0
from sklearn.utils.sparsefuncs_fast import csr_mean_variance_axis0 as _csr_mean_... |
<reponame>stickfighter342/nistscraper
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 18 11:17:16 2020
@author: 21EthanD
Contains residual functions for several equations of state.
Currently limited to RK EOS.
"""
from scipy.optimize import fsolve
import numpy as np
Rgas = 0.0821 #atm * L / mol / K
def eos(P, T, v):... |
import pytest
import numpy as np
import scipy.stats
import george
from ..GP import GPFit
class Test_GPFit(object):
@classmethod
def setup_class(cls):
# setting up some input parameters
time = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
flux = np.array([4, 5, 6, 7, 8, 9, 8, 7, 6, 5])
... |
import logging
import os
import scipy.io.wavfile as wav
from maria import plugin
try:
from deepspeech.model import Model
deepspeech_available = True
except ImportError:
deepspeech_available = False
class DeepSpeechSTTPlugin(plugin.STTPlugin):
"""
Speech-To-Text implementation which ... |
import os
from math import ceil
from scipy.misc import imsave
import torch
import torchvision.utils as vutils
from lib.detector.NAE import NAE
from lib.engine.twostage import TwoStage
from lib.misc import util
from lib.misc import visual as vis
class nae(TwoStage):
"""
CUDA_VISIBLE_DEVICES=0 python main.py ... |
"""Test *all* of the algebraic rules (the rules in the _rules and _binary_rules
class attributes of all Operation subclasses"""
import logging
from collections import defaultdict
import pytest
import sympy
from sympy import IndexedBase, symbols
import qalgebra
from qalgebra import (
BasisKet,
FockIndex,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.