text string |
|---|
import warnings
from functools import lru_cache
from typing import Optional
import numpy as np
import scipy.sparse as sp
from numba import njit
from tqdm import tqdm
from torch_geometric.data import Data
from graphwar import Surrogate
from graphwar.attack.targeted.targeted_attacker import TargetedAttacker
... |
<filename>solution/sensors/dewpoint.py<gh_stars>0
import pandas as pd
from scipy.stats import truncnorm
import time
from .sensor import Sensor
class DewPointSensor(Sensor):
def __init__(self, sensor_id: int, name: str = "dewPointSensor", units='Temperature [${}^\circ F$]'):
"""
Instanciateur de la classe DewPoi... |
<gh_stars>0
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from nose.plugins.attrib import attr
from nose.tools import assert_raises, raises
import numpy as np
from numpy.random import RandomState
from scipy.stats import norm
from ..npc import (fisher,
... |
<reponame>alexandrovteam/sm-networks
import pyarrow.parquet
import pandas as pd
import numpy as np
import scipy.spatial.distance as ssd
import bottle
from tempfile import mkdtemp
import os.path
from glob import glob
from zipfile import ZipFile
import json
class NetworkGenerator:
def __init__(self, config):
... |
import numpy as np
from scipy import stats
from copy import copy
import warnings
from si.data.scale import StandardScaler
class PCA:
"""
Consta de um procedimento algébrico que converte as variáveis originais (tipicamente correlacionadas) num conjunto
de variáveis não correlacionadas (linearmente) que... |
import pandas as pd
from scipy.stats import percentileofscore
from PIL import Image
import torch
from torchvision import transforms
from torch.autograd import Variable
model_path = "land_cover/experimentation/model.pt"
transform = transforms.Compose([transforms.Resize(224),
transforms.... |
<gh_stars>0
# pylint: disable=C0103,C0301,E0401
"""Pre-process station data for app ingest"""
import argparse
import math
import os
import sys
import time
from datetime import datetime
from multiprocessing import Pool
from pathlib import Path
from random import choice
import numpy as np
import pandas as pd
from scipy.... |
import json
import networkx as nx
import matplotlib.pyplot as plt
import scipy as sp
import numpy as np
import collections
from copy import deepcopy
def get_type_dict(kb_path):
"""
Specifically, we augment the vocabulary with some special words, one for each of the KB entity types
For each type, the corr... |
# -*- coding: utf-8 -*-
"""tarea4
"""
import numpy as np
import scipy as sp
import sklearn as sl
import time
from mpl_toolkits.mplot3d import axes3d
from matplotlib import pyplot as plt
from matplotlib import cm
import pandas as pd
import seaborn as sns; sns.set()
import matplotlib as mpl
# Metodo del Trapecio
Inicio_d... |
from mujoco_py import load_model_from_path, MjSim, MjViewer
import numpy as np
from numpy import matlib
from scipy import signal, stats
from sklearn.neural_network import MLPRegressor
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import axes3d
import matplotlib.lines as mlines
#import pickle
import os
... |
import gc
import sys
import time
import uuid
from statistics import mean
from .backends.interface import Backend
async def _get_latency(func, **kwargs) -> float:
start = time.perf_counter()
await func(**kwargs)
return time.perf_counter() - start
async def _get_average_latency(func, iters: int = 100, **... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 19 11:25:16 2017
@author: flwe6397
"""
import scipy
from scipy import stats
def CalcMannWhitneyU(list1, list2):
scipy.stats.mannwhitneyu(list1, list2)
|
<gh_stars>1-10
import numpy as np
from python_speech_features import mfcc,fbank
import os
from sphfile import SPHFile
from scipy.io import wavfile
import csv
import pickle
import json
from pathlib import Path
import matplotlib.pyplot as plt
from struct import unpack
DATA_PATH = '../datasets/timit'
TMP_PATH = '/tmp/tim... |
<reponame>ghostbbbmt/svhn_tflearn
import numpy as np
import scipy.io as sio
def load_raw_data(train_data_file, test_data_file, load_extra_data, extra_data_file):
"""
Load RAW Google SVHN Digit Localization from .mat files
"""
loading_information = "with Extra" if load_extra_data else "without Extra"
... |
<filename>_build/jupyter_execute/content/Module01/M01_Lab.py
#!/usr/bin/env python
# coding: utf-8
# # Lab 1
# In[13]:
#%reset
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import xarray as xr
import requests
import os
# These are some parameters to make figures nic... |
<reponame>exmakhina/xm_color<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 vi:noet
import numpy as np
import sympy
import cv2
from xm_color import conversions
def do_yuv():
"""
Color analog TV: perform YUV <-> RGB computations.
The luma and chroma components in YUV are calculated from gamma corrected RGB.... |
<gh_stars>1-10
#loadImage.py
# to load image to matrix
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
from armor import defaultParameters as dp
def loadImage(a, dataTime="", dataPath="",
inputFolder="",
#imageType="hs1p",
imageType='chart... |
import scipy.io as sio
import numpy as np
def read_response_data(file):
mat_contents = sio.loadmat(file)
responseStruct = mat_contents['responseStruct']
RT = responseStruct['RT'].tolist()
thekey = responseStruct['thekey'].tolist()
correct = responseStruct['correct'].tolist()
targetLocation = responseStruc... |
'''
This function is from moorepants GaitAnalysisToolkit. Slightly adapted with predefined physical constants.
'''
from sympy import symbols, exp
def contact_force(point, ground, origin):
"""Returns a contact force vector acting on the given point made of
friction along the contact surface and elastic force i... |
import datetime as dt
from typing import Dict
from scipy.interpolate import interp1d
from containers.quote import SimpleQuote
from utilities.time import timestamp_to_year_fraction as ts2ttm
# ####################################################################
# CONSTANTS
# ##########################################... |
from Crypto.Util.number import getPrime, bytes_to_long, inverse
import random, math, json
from sympy import isprime
with open("flag.txt",'r') as f:
flag = f.read()
m1 = "Wiener wiener chicken dinner" # For wiener's attack
m2 = "Who came up with this math term anyway?" # For sexy primes
m3 = "Totally did not mean to ... |
<reponame>Ajay-Chaudhary/ML-Algorithmns
"""
Created on Fri Mar 31 21:41:34 2017
@author: Robert
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-deep')
import matplotlib.cm
cmap = matplotlib.cm.get_cmap('plasma')
# Reading in data
ds = pd.read_csv('Mall_Customers.... |
import copy
import math
import compress_pickle
from collections import defaultdict
import random
import scipy.stats
import statistics
import numpy as np
def calculate_hamming_distance_score(shared, nid1_connections, nid2_connections):
n_common = 0
for i in shared:
if i in nid1_connections and i in ni... |
<reponame>eduardo82926/tcc-clustering-soybean<filename>Clusters.py
from pandas import DataFrame
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from sklearn.cluster import KMeans
from sklearn.cluster import Birch
from sklearn.cluster import AgglomerativeClustering
from sklearn.cluster import OPTI... |
import numpy as np
from scipy.ndimage.morphology import binary_dilation
import unittest
from scipy import interpolate
NUM = 10000
def mock_image():
const = 100
theta = np.linspace(-4 * np.pi, 4 * np.pi, NUM)
z = np.linspace(0, 10, NUM)
r = z**2 + 3
x = r * np.sin(theta) + const
y = r * np.c... |
<reponame>HateNoSaiShi/Improved-Finite-Difference-Method-for-Barrier-Options<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 21:34:47 2019
@author: HateNoSaiShi
"""
import numpy as np
from scipy.stats import norm
from scipy import linalg
class option(object):
'''
Abstract:
... |
<filename>src/run.py
#!/usr/bin/env python3
# coding: utf8
import pyopenjtalk
import numpy
import simpleaudio as sa
from scipy.io import wavfile
x, sr = pyopenjtalk.tts("おめでとうございます")
wavfile.write("test.wav", sr, x.astype(numpy.int16))
play_obj = sa.play_buffer(x.astype(numpy.int16), 1, 2, 44100)
play_obj.wait_done()... |
<filename>examples/illustrate.py
#!/usr/bin/env python
# vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 :
#
# Illustrate data and fitting for this object.
#
# <NAME>
# Created: 2020-02-09
# Last modified: 2021-03-08
#--------------------------------------------------------------------------
#***************... |
<reponame>IrvanDimetrio/Calculator-Fraction<gh_stars>0
from fractions import Fraction as P
print "- PROGRAM MENGHITUNG BILANGAN PECAHAN"
print " "
print "1. Penjumlahan"
print "2. Pengurangan"
print "3. Perkalian"
print "4. Pembagian"
print " "
pilih = input("Masukkan Pilihan : ")
if pilih == 1:
a =... |
import numpy as np
from scipy.sparse.linalg import LinearOperator
from ..operators import *
def apply_strong_second_order_internal_penalty_operator(x, domain, fluxes, sources, penalty_parameter, lifting_scheme, order):
domain.set_data(x, 'u', fields_valence=(0,), order=order)
domain.apply(compute_deriv, 'u', ... |
<filename>python/simplePrograms/poisson.py<gh_stars>0
# Assignement on Poisson Distribution
import numpy as np
from scipy.stats import poisson
'''
1.Find the probability that atmost 5 defective fuses will be found in a box of 200 fuses if experience shows that 2 per cent of such fuses are defective.
'''
print("Assign... |
# -*- coding: utf-8 -*-
"""
Main module for wallthick.
PD 8010-2:2015
Pipeline Systems - Part 2: Subsea pipelines – Code of practice - 2015
"""
import math
import scipy.optimize
import json
TITLE = "PD 8010-2"
YEAR = 2015
n_s = 0.72
def internal_pressure(P_d, P_h):
"""Return total internal pressure [Pa].
... |
from typing import List
import numpy as np
import scipy
from deprecated import deprecated
from scipy import special
from ..utils import maskutils
from .coco import CocoDataset
__all__ = ["SemanticCoco", "SemanticCocoDataset"]
class SemanticCoco(CocoDataset):
"""
An extension of the coco dataset to handle t... |
# -*- coding: utf-8 -*-
import cv2
import concurrent.futures
import numpy as np
from scipy import signal
from PIL import Image
from datetime import datetime
import sys
def my_Normalize(img):
# convert to grayscale
if len(img.shape) == 3: # check if img is color
img = cv2.cvtCo... |
import numpy as np
from PIL import Image
from scipy.special import erf
from fluid import Fluid
import pandas as pd
def normalize(df):
blacklist = ['Race', 'Year']
result = df.copy()
for feature_name in df.columns:
if(feature_name in blacklist):
continue
max_value = df[feature_... |
<reponame>OSSome01/signal_modulation<filename>scripts/modulating_signal.py
import math
import numpy as np
from scipy.io import wavfile
print("Press 1 for sin wave")
print("Press 2 for cosine wave")
print("Press 3 for using custom audio file (wav format)")
opt = int(input("Enter option: "))
file = open("data.txt", "w+... |
"""
Module containing classes for ray tracing through layered ice.
Supports layers of ice where the index is monotonic within the layer's valid
range.
"""
import logging
import numpy as np
import scipy.optimize
from pyrex.internal_functions import (flatten, normalize,
LazyMutabl... |
"""
Characterize the test examples for local.
"""
import os
import sys
import time
import hashlib
import argparse
import resource
from datetime import datetime
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
from sklearn.metrics import accuracy_score
from sklearn.me... |
"""Assignment 4: Chaos
"""
import numpy as np
from scipy.integrate import solve_ivp
_DEFAULT_RNG = np.random.default_rng(0)
__all__ = ["compute_lyapunov"]
def compute_lyapunov(
compute_dy_dt,
y0,
dy0=None,
t0=0,
dt=None,
min_norm=None,
Nsamples=None,
norm=np.linalg.norm,
rng=_DE... |
<gh_stars>0
"""
This file can generate all the figures used in the paper.
You can run it with -h for some help.
Feel free to change tunable parameters line 47 and after.
You can also do a bit of tweaking inside the methods.
Note that:
- you need to have produced the data to be able to plot anything.
- for the... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 21 12:04:02 2020
#from mvlearn.embed.utils import select_dimension
@author: jmconro
"""
import numpy as np
import scipy
from scipy.stats import norm
from sklearn.decomposition import TruncatedSVD
from mvlearn.embed.utils import select_dimension
d... |
import numpy as np
import scipy.sparse
from .sparsevecvalder import SparseVecValDer
from . import true_np
from . import numpy_masking
def _vstack_lil_matrix(matrices):
M = sum(m.shape[0] for m in matrices)
N = (s := set(m.shape[1] for m in matrices)).pop()
assert len(s) == 0, "Mixing SparseVecValDer's fro... |
"""
Mask R-CNN
Common utility functions and classes.
Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by <NAME>
"""
import os, sys, math, zlib, argparse, random, platform, pprint, datetime
from sys import stdout
import numpy as np
import tensorflow as tf
... |
<reponame>andpol5/whaleDetector
import numpy as np
import os
import re
from collections import defaultdict
from scipy import random
validationDir = 'validation'
if not os.path.exists(validationDir):
os.makedirs(validationDir)
output = np.genfromtxt('whales.csv', skip_header=1, dtype=[('image', 'S10'), ('label', '... |
'''
Created on 2015/02/23
@author: <NAME>
'''
import numpy as np
import scipy.sparse
class ObjectiveFunction:
def __init__(self,E,dim,best=None):
self._E = E
self._dim = dim
def __call__(self,x):
return self._E(x)
def dim(self):
return self._dim
class BestInfo:
def _... |
<filename>medimodule/Kidney/kidney_tumor_segmentation/models/cascade_1st/run_eval_cascaded.py
import numpy as np
import tensorflow as tf
import csv
# import queue
import os
from skimage import color
os.environ['CUDA_VISIBLE_DEVICES'] = '%d' % 0
from pathlib import Path
# import itertools
import SimpleITK a... |
import argparse
import sys
import os
import importlib
import pickle
import joblib
import math
import sklearn.metrics as metrics
from scipy.stats import pearsonr
import numpy as np
import matplotlib.pyplot as plt
def main(args):
model_files = sorted([model_file for model_file in os.listdir(
args.models_di... |
<filename>peon/player.py
import time
from scipy.spatial.distance import euclidean
from fastmc.proto import Slot
import numpy as np
import math
from math import floor
import threading
import itertools
import logging
from fastmc.proto import Position
import types
log = logging.getLogger(__name__)
log.addHandler(logging... |
<filename>Udemy Python Bootcamp/tuple.py
import statistics
#!/usr/bin/env python
"""Docstring"""
def main():
"""Docstring"""
def example():
return 15, 12, 11
x, y, z = example()
print(x, y, z)
if __name__ == '__main__':
main()
|
from __future__ import print_function
import numpy as np
import pandas as pd
import csv
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from scipy.interpolate import interp1d
import scipy.optimize as op
import scipy
from scipy import *
from scipy.special import expi
#import lmfit
#from lmfit i... |
import sklearn.decomposition
import sklearn.preprocessing
import numpy as np
import pandas as pd
import elice_utils
import scipy.spatial.distance
import operator
def main():
# 1
champs_df = pd.read_pickle('champ_df.pd')
champ_pca_array = run_PCA(champs_df, 2)
# 5
elice_utils.plot_champions(champ... |
# -*- coding: utf-8 -*-
#MIT License
#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
#to use, copy, modify, merge, publish, ... |
import numpy as np
import cv2
import math
from scipy import signal
np.set_printoptions(precision=15)
def set_board(in_, width, method=1):
temp = np.ones(in_.shape)
y, x = np.mgrid[1:(in_.shape[0] + 1), 1:(in_.shape[1] + 1)]
temp = temp * ((x < temp.shape[1] - width + 1) & (x > width))
temp = temp * (... |
<filename>data_utils/MyDataLoader.py<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 28 13:38:48 2020
@author: fa19
"""
import nibabel as nb
import numpy as np
import torch
import random
from scipy.interpolate import griddata
import os
means_birth_age = torch.Tensor([1.18443463... |
# coding: utf-8
import pandas as pd
from pandas import Series,DataFrame
import numpy as np
import itertools
import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
from collections import Counter
import re
import datetime as dt
from datetime import date
from datetime import datetime
i... |
import cmath
print("Welcome to the Quadratic Solver App\n")
print("A quadratic equation is of the form ax^2 + bx + c = 0")
print("Your solutions can be real or complex numbers")
print("A complex number has two parts: a + bj")
print("Where a is the real portion and bj is the imaginary portion.\n")
amount = int(input("... |
<gh_stars>0
#!/usr/bin/env python3
################################################################################
################################################################################
### Locate tiles - "tile.py" ###################################################
##########################################... |
"""
最佳平方逼近
"""
import sympy as sp
from sympy.abc import x
def best_square_approximation(f, domain, num_base_funcs, weight_func=x ** 0):
"""
最佳平方逼近
默认基函数为{1, x, x_2, ...}
:param f: 原函数
:param domain: f的定义域
:param num_base_funcs: 基函数个数
:param weight_func: 权函数
:return: 最佳平方逼近多项式
"""
... |
<gh_stars>1-10
import re
import sys
import os.path
import argparse
import warnings
import numpy as np
from collections import Counter
from itertools import combinations
from scipy.stats import fisher_exact
def main():
parser = argparse.ArgumentParser()
argument_parser(parser)
args = parser.parse_args()
... |
<reponame>MilesQLi/Theano-Lights<filename>models/draw_scrn1.py<gh_stars>100-1000
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import ... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.misc
import scipy
from sklearn import metrics
import matplotlib.pyplot as plt
import matplotlib.cm as cm
def open_classification_performance(score=None, threshold=None, pred_y=None, true_y=None):
if score is not None and threshold is not None:
... |
import scipy as scipy
import scipy.special as special
import numpy as np
import itertools as it
from pandas import *
import matplotlib.pylab as plt
from scipy.integrate import ode
import time
def unique_rows(a):
a = np.ascontiguousarray(a)
unique_a = np.unique(a.view([('', a.dtype)]*a.shape[1]))
return uni... |
<filename>pharos/view/GUI/monitor_with_memory.py
"""
Monitor a signal with memory. This means that the latest signal will be plotted in a specific color, while older
data will be plotted as thinner lines that fade out with time.
Parameters to configure: The number of plots to keep in memory and the colors/... |
import numpy as np
from .base import EvaluationMethod
import ot
import json
import scipy
def wasserstein(X,Y,metric):
M = ot.dist(X, Y, metric=metric)
M /= np.max(M)
n1,n2 = M.shape
a = np.ones(n1) / n1 # 1d histogram, uniform distribution
b = np.ones(n2) / n2
return ot.emd2(a,b,M)
def f... |
<reponame>aileisun/bubblepy
# inttools.py
# 06/02/2017 ALS
"""
tool for integration
"""
import numpy as np
import scipy.integrate as integrate
from scipy.interpolate import interp1d
import copy
import astropy.units as u
import astropy.constants as const
def calc_Fnu_in_band_from_fl(fl, ws, trans, ws_trans, isnorme... |
<reponame>terraregina/BalancingControl
from numpy.lib.npyio import save
import pandas as pd
import numpy as np
import matplotlib.pylab as plt
import action_selection as asl
import seaborn as sns
import pandas as pd
from scipy.stats import entropy
plt.style.use('seaborn-whitegrid')
from pandas.plotting import table
impo... |
<filename>Lab 3/11-ottica2/analisi2a.py
import numpy as np
import menzalib as mz
import scipy.optimize
import pylab as pl
def f_thetad(h, l): return np.pi/2-np.arctan(h/l)
def lin(x, a, b): return a*x + b
def dsin(x, dx): # Errore su sin(x) al secondo ordine
return np.abs(np.cos(x)*dx) + np.abs(0.5*np.sin(x)*dx*... |
from .continuous_marginal import *
from ...util.stats import normal_cdf_approx
from scipy import stats
import numpy as np
class Gumbel(ContinuousMarginalDistribution):
"""
Gumbel distribution specified by mean and standard deviation
"""
def __init__(self, name, mean, std):
super().__in... |
from statistics import mean
import numpy as np
from mgcpy.independence_tests.abstract_class import IndependenceTest
from mgcpy.independence_tests.utils.compute_distance_matrix import \
compute_distance
from mgcpy.independence_tests.utils.distance_transform import \
transform_distance_matrix
from mgcpy.independ... |
import glob
import os
import statistics
os.chdir("library/timelines/summary")
listOfTxtFiles = []
for file in glob.glob("*.txt"):
listOfTxtFiles.append(file)
print(listOfTxtFiles)
def newData(list):
minorList = []
megaList = []
for file in list:
for line in open(file,"r").readlines():#open the file, read all l... |
"""
problem 493
"""
import fractions
import math
from euler_python.utils import eulerlib
def problem493():
"""
:return:
"""
num_colors = 7
balls_per_color = 10
num_picked = 20
decimals = 9
numerator = [0]
def explore(remain, limit, history):
if remain == 0:
h... |
<gh_stars>0
import logging
import pickle
import numpy as np
from scipy.sparse import csr_matrix, load_npz, save_npz, spdiags, linalg
class Space(object):
"""
Load and save Space objects.
"""
def __init__(self, path=None, matrix=csr_matrix([]), rows=[], columns=[], format='npz'):
"""
... |
import lcdata
import numpy as np
import scipy.stats
from astropy.stats import biweight_location
SIDEREAL_SCALE = 86400. / 86164.0905
def _determine_time_grid(light_curve):
"""Determine the time grid that will be used for a light curve
ParSNIP evaluates all light curves on a grid internally for the encoder.... |
<filename>tensorflow_quantum/core/ops/math_ops/simulate_mps_test.py
# Copyright 2020 The TensorFlow Quantum 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
#
# ... |
<filename>DMSC/src/data.py
import scipy.io as sio
import numpy as np
from torch.utils.data import Dataset
class EYaleBDataset(Dataset):
def __init__(self, root:str = './data/EYB.mat', transform=None):
"""
0: face, 1: left eye, 2: nose, 3: mouth, 4:right eye
"""
raw_data = sio.loadm... |
<reponame>certik/sympy-oldcore
from sympy import *
def test_complex():
a = Symbol("a", real=True)
b = Symbol("b", real=True)
e = (a+I*b)*(a-I*b)
assert e.expand() == a**2+b**2
assert sqrt(I) == (-1)**Rational(1,4)
assert str(abs(a)) == "abs(a)"
def test_conjugate():
a = Symbol("a", real=T... |
<filename>1_cyptography/rsa/lenstra.py
import sys
import math
from random import randint
from fractions import gcd
def primes(n):
b = [True] * (n + 1)
for p in range(2, n + 1):
if b[p]:
for i in range(p, n + 1, p):
b[i] = False
yield p
return
def modular_inv(a, b):
if b == 0:
return 1, 0, a
q, r = ... |
# Written by <NAME>, Seoul National University (<EMAIL>)
""" Utility functions """
import os
import sys
import math
import random
import numpy as np
from datetime import datetime
from sklearn.metrics import auc, roc_auc_score
from scipy.stats import pearsonr, spearmanr, t
import torch
import torch.nn as nn
def Pri... |
<gh_stars>0
import matplotlib
matplotlib.use('Agg')
import mytools
from pylab import *
from neuron import h
import pickle
from os.path import exists
import numpy
import scipy.io
import time
Nmc = 150
rates = [1.0]
seeds = range(1,1000)
cols = ['#666666','#012345','#aa00aa','#bbaa00','#ee6600','#ff0000', '#00aaaa','#77... |
from abc import ABC, abstractmethod
import numpy as np
from scipy.stats import entropy
from small_text.query_strategies.exceptions import EmptyPoolException, PoolExhaustedException
class QueryStrategy(ABC):
"""Abstract base class for Query Strategies."""
@abstractmethod
def query(self, clf, x, x_indice... |
import sys, os
sys.path.insert(0, os.path.dirname(os.path.abspath(os.path.realpath(__file__))))
from scipy import stats
from scipy.stats import distributions
from fisher import pvalue
import numpy as np
import pandas as pd
from decimal import Decimal
import multiple_testing
from multiple_testing import Bonferroni, Sida... |
<gh_stars>0
# Quantum Ciruits with qiskit
from qiskit import QuantumCircuit, Aer, execute
# Visualization tools
from qiskit.visualization import plot_histogram
from matplotlib import pyplot as plt
# Graph tools with networkX
import networkx as nx
# Math
from numpy import pi
from random import random
from scipy.optim... |
<reponame>xdata-skylark/libskylark
import ctypes
from ctypes import byref, cdll, c_double, c_void_p, c_int, c_char_p, pointer, POINTER, c_bool
import ctypes.util
import errors
import numpy, scipy.sparse
import atexit
import time
import sys
_libc = cdll.LoadLibrary(ctypes.util.find_library('c'))
_libc.free.argtypes = ... |
<reponame>wilsonjefferson/DSSC_IRDV<gh_stars>0
import subprocess
import sys
from collections import defaultdict
import numpy as np
import pandas as pd
# import matplotlib.pyplot as plt
# import seaborn as sns
# import spotipy
# import os
import plotly.express as px
from scipy.spatial.distance import cdist... |
# --------------------------------------------------------
# RON
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME>
# date Nov.18, 2016
# --------------------------------------------------------
from datasets.imdb import imdb
import datasets
import os.path as osp
import sys
import os
import... |
#!/usr/bin/env python
# stdlib imports
import struct
import os.path
import sys
# third party imports
import numpy as np
from scipy.io import netcdf
from .grid2d import Grid2D
from .dataset import DataSetException
from .geodict import GeoDict
import h5py
'''Grid2D subclass for reading, writing, and manipulating GMT ... |
<gh_stars>1-10
"""Main module."""
import io
import pathlib
import time
import warnings
from pprint import pformat
from typing import Callable, Dict, List, Tuple, Union
from collections import Counter
import numpy as np
import pyqms
import scipy as sci
from intervaltree import IntervalTree
from loguru import logger
fro... |
#!/sw/bin/python3.5
# ----------------------------------------------------------------------------------------------- #
# kosudoku-genelisting.py
# Created by <NAME> 2018-04-13
# Last modified by <NAME> 2018-11-09
#
# Code to make listing of gene loci in the Gluconobacter genome.
# ------------------------------------... |
import numpy as np
from pointcloud import PointCloud
import matplotlib.pyplot as plt
from scipy import signal
from mpl_toolkits.mplot3d import Axes3D
class Tracker():
def __init__(self):
self.bounding_boxes = []
def set_bounding_boxes(self, bounding_boxes):
self.bounding_boxes = bounding_boxes
def predict_bou... |
<reponame>thelazyscripter777/ga-learner-dsmp-repo
# --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File loca... |
import sys
import os
import traceback
import boto3
import numpy as np
import io
import argparse
from PIL import Image
import math
import shortuuid as su
import json
import scipy.ndimage as nd
from skimage import io
from skimage.filters import gaussian
from skimage.exposure import histogram
from skimage.filters import t... |
<reponame>tfroehlich82/Ryven
from NENV import *
import statistics
class NodeBase(Node):
pass
class _Coerce_Node(NodeBase):
"""
Coerce types T and S to a common type, or raise TypeError.
Coercion rules are currently an implementation detail. See the CoerceTest
test class in test_statistics for... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## For Testing Matrix2vec on dataset MNIST
## PCA, Kernel PCA, ISOMAP, NMDS, LLE, LE
# import tensorflow as ts
import logging
import os.path
import sys
import multiprocessing
import numpy as np
import argparse
import scipy.io
import datetime
import matrix2vec
from skle... |
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from builtins import str
from builtins import range
from builtins import object
from copy import copy, deepcopy
import numpy as np
from scipy.optimize import newton
from HARK import AgentType, Solution, NullFunc... |
<filename>pymkm/pymkm_helper.py
#!/usr/bin/env python3
"""
Helper functions for the PyMKM example app.
"""
__author__ = "<NAME>"
__version__ = "2.0.4"
__license__ = "MIT"
import math
import statistics
import shelve
from distutils.util import strtobool
class PyMkmHelper:
@staticmethod
def calculate_average(t... |
<gh_stars>10-100
from __future__ import division
def linear_kinship(G, out=None, verbose=True):
"""
Estimate Kinship matrix via linear kernel.
Let 𝑑 be the number of columns of ``G``. The resulting matrix is given by:
.. math::
𝙺 = 𝚇𝚇ᵀ/𝑑
where
.. math::
𝚇ᵢⱼ = (𝙶ᵢⱼ ... |
import torchvision.models as models
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from torch.utils.data import DataLoader
import torch
import torch.onnx
from torchsummary import summary
from thop import profile
from import_models import import_all
from pathlib import Path
import t... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 20 16:32:57 2019
@author: DaniJ
"""
import four_layer_model_2try_withFixSpeciesOption_Scaling_2surface as flm1
import four_layer_model_LNX_withFixSpeciesOption_Scaling_2surface as flm2
import numpy as np
import scipy as sp
from matplotlib import pyplot as plt
idx_fix... |
<filename>features/MFCC.py<gh_stars>0
# Copyright (c) 2019 <NAME>
#
# 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
# to use, copy... |
<reponame>jsonbruce/MTSAnomalyDetection
#!/usr/bin/env python
# coding=utf-8
# Created by max on 17-10-31
"""
Anomaly Detection (ad) Using hp filter and mad test
"""
import sys
import numpy as np
import pandas as pd
from scipy import sparse, stats
import matplotlib.pyplot as plt
# Hodrick Prescott filter
def hp_fi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.