text string |
|---|
<gh_stars>1-10
#!python
# set PYSPARK_DRIVER_PYTHON=python
# set PYSPARK_DRIVER_PYTHON_OPTS=
# spark-submit --master local[7] --deploy-mode client SectionPerfTest.py
import gc
import scipy.stats, numpy
import time
import random
from LinearRegression import linear_regression
from pyspark.sql import SparkSession
from pys... |
<gh_stars>1-10
#!/usr/bin/env python
# import numpy as linalg
import numpy
from scipy.sparse import csc_matrix
from scipy.sparse import linalg
from scipy.sparse import lil_matrix
from scipy.sparse.linalg import spsolve
import time
import sys
import collections
import operator
# import scipy.sparse as sparse
count = 0
h... |
"""Test import_data."""
import mne
import pytest
import os.path as op
import numpy as np
import scipy.io as sio
import nipype.pipeline.engine as pe
from ephypype.nodes.import_data import ConvertDs2Fif, ImportHdf5, ImportMat
from ephypype.nodes.import_data import Ep2ts, Fif2Array, ImportFieldTripEpochs
from ephypype.i... |
from __future__ import print_function, division
"""
@ About :
@ Author : <NAME>
@ ref. : https://labrosa.ee.columbia.edu/matlab/rastamat/
"""
from . import utils as rasta_utils
from scipy import signal
import numpy as np
def rastaplp(x, fs = 8000, window_time = 0.025, hop_time = 0.010, dorasta = True, modelorder = 8):... |
<filename>sistemi_lineari/esercizi/Test8.py
# -*- coding: utf-8 -*-
"""
Esercizio 8
"""
import numpy as np
import numpy.linalg as npl
import scipy.linalg as sci
import funzioni_Sistemi_lineari as fz
import matplotlib.pyplot as plt
def HankelModificata(n):
A = np.zeros((n,n), dtype = float)
for ... |
<reponame>chao0716/pybullet_ur5_robotiq<gh_stars>1-10
import pybullet as p
import glob
from collections import namedtuple
from attrdict import AttrDict
import functools
import torch
import cv2
from scipy import ndimage
import numpy as np
class Models:
def load_objects(self):
raise NotImplementedError
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 26 15:18:00 2021
@author: utric
"""
import numpy as np
from numpy import cos, sin, arctan2 as atan, sqrt, pi as π, sign, log
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.spatial.transform import Rotation
from scipy.integrate import qu... |
<filename>src/duplicate_snr.py<gh_stars>1-10
import torch
import numpy as np
from scipy.optimize import linear_sum_assignment
def duplicate_snr(sources, variable_est):
'''
sources: [spks, T]
variable_est: [spks, T]
'''
EPS = 1e-8
assert sources.shape[0] > variable_est.shape[0]
zero_... |
#!/usr/bin/env python
import matplotlib.pyplot as plt
from numpy import *
from scipy import stats
import sys
import argparse
parser = argparse.ArgumentParser(description='Process MD output')
parser.add_argument("output", help="output to analyze.")
parser.add_argument("-c","--column", type=str, choices=['U','K','T','... |
<gh_stars>0
'''
experiment (:mod:`calour.experiment`)
=====================================
.. currentmodule:: calour.experiment
Classes
^^^^^^^
.. autosummary::
:toctree: generated
Experiment
'''
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, Calour d... |
import sys
import os
import time
import pickle
import contextlib
import numpy as np
import scipy.interpolate
from numba import njit
with contextlib.redirect_stdout(None):
import ChiantiPy.tools.util as ch_util
import ChiantiPy.tools.io as ch_io
import ChiantiPy.tools.data as ch_data
try:
import backs... |
# Frequency filtering data
from scipy.signal import butter
from scipy.signal import lfilter
from scipy.signal import sosfilt
def filter(samples, sample_freq=None, low_freq=None, high_freq=None, order=4, type='butter', method='ba'):
# method is 'ba' or 'sos'
# Source sample frequency
if sample_freq is None... |
<reponame>xdr940/trajectory
from path import Path
import numpy as np
import json
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from utils.cubic_hermite import CubicHermite
from utils.formater import pose6dof2kitti
class Aperture():
def __init__(self,input_json,out_dir,interp_type='... |
<filename>config/systems.py
import sympy as sp
x1, x2 = sp.symbols('x1, x2')
class NonlinearController:
states = [x1, x2]
Z = sp.Matrix([x1, x2])
A = sp.Matrix([[0, 1], [-1, 0]])
B = sp.Matrix([[0], [1]])
K = sp.Matrix([[-0.1 -0.1*x1**2, -0.1-0.1*x2**2]])
system = (A + B @ K) @ Z
oP = 0
... |
<reponame>k-zen/SigmaProject<filename>imports.py
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019, <NAME> <akoenzen | uvic.ca>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source ... |
import math
import os
import cv2
import numpy as np
import torch
from meter_distro.models.net import U2NET
import matplotlib.pyplot as plt
from sympy import *
from skimage import morphology,data,color
class MeterReader_distro(object):
def __init__(self, is_cuda=False):
self.net = U2NET(3, 1)
self... |
<gh_stars>0
#! /usr/bin/env python
import os
from scipy.optimize import minimize
import numpy as np
import h5py
import argparse
import matplotlib.pyplot as plt
def main():
#syntax file = (hdf5-file, number of spins, lattice dimension)
file1 = (h5py.File('/data/cursus3/wolff_data/wolff_20x20_10kiterations_50... |
<reponame>hhuang90/Combine-CMIP5
import scipy.stats as stats
import numpy as np
from tools import *
import state
def estimate_V():
# Update V
degreeFreedom=2*state.n+state.M+state.df+1
Q1 = state.df*state.VPrior
Q2 = state.epsHm.transpose().dot(state.invCovMatH).dot(state.epsHm)*state.t... |
<reponame>arthur-bit-monnot/fire-rs-saop
# Copyright (c) 2019, CNRS-LAAS
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright n... |
<filename>tests/zquantum/core/circuits/_serde_test.py
import io
import numpy as np
import pytest
import sympy
from zquantum.core.circuits import _builtin_gates, _circuit, _gates
from zquantum.core.circuits._serde import (
circuit_from_dict,
circuitset_from_dict,
custom_gate_def_from_dict,
deserialize_e... |
<reponame>mazayus/ProjectEuler
#!/usr/bin/env python3
from fractions import *
from functools import *
from itertools import *
import operator
def proper_fractions():
for denom in range(10, 100):
for numer in range(10, denom):
yield (numer, denom)
def is_digit_cancelling(fraction):
numer, ... |
<gh_stars>0
import numpy as np
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
import scipy.stats as sts
from finn.util.gdrive import *
import sklearn
from sklearn.linear_model import LinearRegression
from sklearn.svm import SVR
from sklearn import model_selection
from sklearn.preprocessing import... |
<reponame>tkcroat/Augerquant<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 27 08:45:42 2016
@author: tkc
"""
from scipy.optimize import curve_fit
from scipy import optimize
from scipy import asarray as ar,exp
import numpy as np
from numpy import sqrt, log
import matplotlib.pyplot as plt
#%%
... |
<filename>common_python/ODEModel/ODEModel.py
"""
Model for non-linear ODE.
An ODEModel has one or more FixedPoint.
Each FixedPoint has a Jacobian and one or more EigenEntry.
An EigenEntry has 1 (if real) or 2 (if complex) eigenvalues
and one or more eigenvectors.
"""
import common_python.ODEModel.constants as cn
f... |
<reponame>h4vlik/TF2_OD_BRE
import time
import datetime
import numpy as np
import csv
import matplotlib.pyplot as plt
from scipy import signal, fft, integrate
import pandas
import os
import json
# script for offline floor detection based on real-time-floor detection
class Detect_floor(object):
def __init__(self, ... |
"""Implementation of contact Hamiltonians
"""
from dataclasses import dataclass
from dataclasses import field
import logging
import numpy as np
from scipy import sparse as sp
from luescher_nd.utilities import get_logger
from luescher_nd.hamiltonians.kinetic import MomentumKineticHamiltonian
from luescher_nd.databa... |
<filename>py3d/droites.py
"""Module droites, contient la classe Droite et des fonctions annexes
Attributes:
axe_x (Droite): Droite de l'axe X
axe_y (Droite): Droite de l'axe Y
axe_z (Droite): Droite de l'axe Z
"""
import points
import vecteurs
from fractions import Fraction
def parallelles(d, *args):
"""... |
import numpy as np
import cv2
import glob
import math
from sklearn.linear_model import LinearRegression
from scipy.cluster.hierarchy import ward, fclusterdata
from scipy.spatial.distance import pdist
import copy
import matplotlib
from matplotlib import pyplot as plt
def cal_curvature_2nd(x, coefs):
return np.powe... |
<filename>qcal/momentum_dispersion.py<gh_stars>0
"""
Analysis of the q/x dispersion from the borders of
a small, round aperture in momentum space / real space.
TODO
- polynomial distortion fails if dispersion has no zero
Copyright (c) 2013, rhambach.
This file is part of the TEMareels package and rel... |
import sys
from decimal import Decimal, localcontext
from scipy.special import gamma, gammaincc
from scipy import math
import scipy.stats as stats
def bayesfactor(locallambda, peakscore):
try:
# bayesfactor = 2 * (math.log((gammaincc(peakscore-1, locallambda)*gamma(peakscore-1)), math.e) - (peakscore-1)*... |
<gh_stars>1-10
from dateutil import parser
from fractions import Fraction
class Exif:
"""Helps us manage data in EXIF format."""
def convert_latitude(self, lat_float):
"""Converts a floating-point number latitude to EXIF format.
Args:
lat_float: latitude, as a floating-point numb... |
<reponame>adeeconometrics/s_distributions
try:
from scipy.special import gamma as _gamma, gammainc as _gammainc, digamma as _digamma
import numpy as _np
from math import sqrt as _sqrt, log as _log, exp as _exp
from typing import Union, Dict, List
from univariate._base import SemiInfinite
excep... |
import json
import os
import statistics
from datetime import datetime
from typing import Union
import numpy as np
from datasets import load_metric
from preprocessing.datasets_ import (
LawMatchingDatasets,
ClaimExtractionDatasets,
)
def eval_k_fold(results):
# TODO: Is this correct? Is there a better wa... |
from __future__ import print_function, division
import imgaug as ia
from imgaug import augmenters as iaa
from imgaug import parameters as iap
import numpy as np
from scipy import ndimage, misc
from skimage import data
import matplotlib.pyplot as plt
from matplotlib import gridspec
import six
import six.moves as sm
impo... |
import os, copy
import types
import itertools
import numpy as np
from math import sqrt, sin, cos, radians, pi
import scipy.optimize as optimize
from scipy.interpolate import bisplrep, \
bisplev, splev, splrep
from scipy.integrate import simps, trapz
from pwtools import _flib
import warnings
##warnings.simplefilter(... |
<reponame>awbirdsall/popmodel<filename>src/popmodel/loadhitran.py
# -*- coding: utf-8 -*-
"""
Created on Tue May 27 16:10:34 2014
@author: abirdsall
"""
from __future__ import division
from . import atmcalcs as atm
from . import ohcalcs as oh
import numpy as np
import logging
from fractions import Fraction
LOADHITRA... |
# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
<gh_stars>1-10
"""Tools to analyze band ratio data."""
import numpy as np
from numpy.linalg import LinAlgError
import pandas as pd
from scipy.stats import pearsonr, spearmanr
from fooof import FOOOF
from fooof.analysis import get_band_peak_fm
from settings import *
from ratios import *
from bootstrap import bootstra... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Delaunay
# Constants
n_features = 2 # number of features = dimension of feature space
n_clusters = 5 # number of clusters
n_samples_per_cluster = 500 # number of samples of each cluster
seed = 700
embiggen_... |
import numpy as np
import pandas as pd
from .initialization import *
from .conviction_helper_functions import *
import networkx as nx
from scipy.stats import expon, gamma
# Behaviors
def driving_process(params, step, sL, s):
'''
Driving process for adding new participants (their funds) and new proposals.
... |
<filename>bench_simple_pipeline.py
import numpy as np
from sklearn.utils._array_transformer import _ArrayTransformer
from sklearn.pipeline import make_pipeline
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.utils.validation import check_array
from sklearn import set_config
import scipy.sparse as ... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# ### Author : Saurabh
# # Analysis of Shark Tank Data
# In[7]:
#Poster of Tag
Image(path+"\\Sharkimgtitle.jpg",height=420,width=1000)
# In[8]:
text =" Shark Tank India ".join(cat for cat in df['Episode Title'])
stop_words = list(STOPWORDS) + ["Ka", "Ki", "... |
# %%
import numpy as np
import pandas as pd
import seaborn as sbn
from matplotlib import pyplot as plt
from scipy import stats
from sklearn import cluster, preprocessing
from sklearn.model_selection import cross_val_score
from locale import setlocale, LC_ALL, format_string
from requests import Session as sessao
from bz... |
import numpy as np
from PyQt5.QtWidgets import QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QLayout, QGroupBox, QCheckBox, QSpinBox, \
QFormLayout, QPushButton, QDoubleSpinBox, QLabel
from matplotlib.backends.qt_compat import is_pyqt5
from matplotlib.figure import Figure
from matplotlib.ticker import MultipleLoc... |
from operator import itemgetter
import networkx as nx
from numpy import random, sqrt, triu_indices
import numpy as np
from scipy.spatial.distance import pdist
from sss.misc.generalized_star_clustering import (
default_priority_func,
degree_and_weight_priority_func,
layered_clustering,
)
MIN_NUM_LEVELS_IN... |
<reponame>hhding/fio-plot<filename>fio_plot/fiolib/dataimport.py
import os
import sys
import csv
import pprint as pprint
import statistics
import fiolib.supporting as supporting
def list_fio_log_files(directory):
"""Lists all .log files in a directory. Exits with an error if no files are found.
"""
absolu... |
<filename>dev python code/texture.py
import matplotlib.pyplot as plt
import numpy as np
from skimage.feature import greycomatrix, greycoprops
from scipy import misc
from skimage import exposure
def texture(img):
def local(image, value):
a = np.where(image == value)
minimum = np.array([(a[0][i]-55)*... |
import warnings
import math
from typing import NamedTuple
import numpy as np
from numpy import convolve
from scipy.optimize import curve_fit
from scipy.signal.windows import hann
import matplotlib.pyplot as plt
from constants import *
warnings.filterwarnings('ignore')
class FitErrOutput(NamedTuple... |
<reponame>mrcsantos1/pySEP
import numpy as np
import math as mt
import cmath as cmt
def fl_getSbase(dicFlow):
return dicFlow.get('Sbase')
def fl_pot_injetada(dicBarras, dicFluxo, yBus, count, show=False):
dicFluxo['deltaPQ'] = []
dicFluxo['resP'] = []
dicFluxo['resQ'] = []
for i in dicBarras:
... |
<filename>updates_to_drs/faster_correct_local_background/fast_convolved2d.py
from scipy import ndimage
from scipy.signal import convolve2d
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
wx_ker = 1
wy_ker = 9
sig_ker = 3
def scattered1(image1, wx_ker, wy_ker, sig_ker):
print(... |
import tensorflow as tf
from scipy.stats import ttest_rel
from tqdm import tqdm
from data import generate_data
from model import AttentionModel
def copy_model(model, embed_dim = 128, n_customer = 20):
""" Copy model weights to new model
https://stackoverflow.com/questions/56841736/how-to-copy-a-network-in-tensorfl... |
<gh_stars>0
import numpy as np
from sklearn import cross_validation
from sklearn import svm
from sklearn.svm import LinearSVC
from sklearn.datasets import load_svmlight_file
from sklearn.pipeline import make_pipeline
from sklearn.feature_selection import SelectFromModel
from sklearn.feature_selection import RFE
from sk... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 1, 2017
Updated Mon Oct 22, 2018
@author: <EMAIL>
"""
import numpy as np
import os
import EXOSIMS.MissionSim as MissionSim
import sympy
from sympy.solvers import solve
import scipy.integrate as integrate
import scipy.interpolate as interpolate
import scipy.optimize as op... |
import h5py
import numpy as np
import re
from functools import reduce
from scipy.integrate import odeint
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.collections import PolyCollection
from mpl_toolkits import mplot3d
from mpl_toolkits.mplot3d... |
<gh_stars>1-10
####################################################################
# May.8.2018
# Adding gamma driver into shift equation to optimize BBH behavior
# with large mass ratio
#####################################################################
import dendro
from sympy import *
from sympy.physics.vector.ve... |
import numpy as np
import numpy.linalg as la
import scipy.stats as stats
import maths.numpyutils as npu
class KernelDensityEstimator(object):
class KernelDensityEstimate(object):
def __init__(self, estimator, sample):
self.__estimator = estimator
self.__sample = sample
de... |
'''
Generate transaction sequence and other necessary input information
'''
import yaml
import argparse
import numpy as np
from numpy.random import default_rng
import random
import math
import pickle
import pdb
import scipy.stats as stats
from os.path import dirname
from os.path import abspath
from pathlib import P... |
<reponame>wangleon/gamse
import os
import re
import math
import datetime
import logging
logger = logging.getLogger(__name__)
import dateutil.parser
import numpy as np
from scipy.signal import savgol_filter
from scipy.ndimage.filters import gaussian_filter
from scipy.interpolate import InterpolatedUnivariateSpline
impo... |
<filename>08_Image_Processing/Labelling/labelling/labelling.py
import os, cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
from matplotlib.widgets import Slider, Button
from scipy.ndimage import label
def _changeThreshold(val):
global _percentThreshold
global _... |
<reponame>crodriguez1a/inver-synth<filename>generators/vst_generator.py
import json
import re
import sys
import librenderman as rm
import numpy as np
import samplerate
from scipy import stats
from generators.generator import *
from generators.parameters import *
sys.path.append(
"/Users/dmrust//Uni/Work/Creative... |
import sys
import numpy as np
import pandas as pd
from scipy import stats
from itertools import permutations
NUM_RANKING = 3
def calculate_weighted_kendall_tau(pred, label, rnk_lst, num_rnk):
"""
calcuate Weighted Kendall Tau Correlation
"""
total_count = 0
total_corr = 0
for i in... |
# reconstructor.py
import numpy as np
import scipy.optimize as so
from scipy.cluster.hierarchy import linkage, fcluster, dendrogram
import warnings
warnings.filterwarnings('ignore') # Disable warnings, which appear during L1 reconstruction
def get_reconst_recording(cs_recording, meas_matrix, n, threshold_factor=5):... |
<reponame>mingzhaochina/AH-RJMCMC
# Script to make plots from the RJ-MCMC output
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab
import matplotlib.cm as cm
import numpy as np
from scipy import stats
from matplotlib.colors import LogNorm
import os
import sys
if not os.path.exists('Outputs_Paris700_no_ag... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
<reponame>henriquesimoes/humpback
import imgaug.augmenters as iaa
from scipy.ndimage import affine_transform
from tqdm import tqdm_notebook as tqdm
import numpy as np
from imgaug import augmenters as iaa
import imgaug as ia
import cv2
import os
import numpy as np
import random
import skimage
#=========================... |
<reponame>TatsuyaHaga/laplacian_associative_memory_codes<gh_stars>1-10
#!/usr/bin/env python3
import numpy
import scipy.linalg
import sys
W=numpy.loadtxt(sys.argv[1], delimiter=",")
P=W.shape[0]
#normalize
Dnorm=numpy.diag(numpy.sum(W,axis=1)**-1)
#laplacian
L=numpy.eye(P)-Dnorm@W
e,v=scipy.linalg.eig(L)
e=numpy.rea... |
<filename>repoNoData/image_operations.py<gh_stars>0
'''
just some basic image operations
'''
import numpy as np
import skimage as sk
import scipy.ndimage as nd
class LinearOperations(object):
def __init__(self, fname):
'''
an image object. Loads in some image from jpg and converts it to useful
... |
""" Solve Tolman-Oppenheimer-Volkoff equations with ode from scipy
TOV equations are (3.6a-f) in Damour & Esposito-Farese 1996
* Note: this script is using cgs units -
From "Einstein units" to cgs units, one needs the following replacements
- tilde_epsilon * (G/C^4) -> e
- tilde_p * (G... |
<filename>Mac_data_acq_app.py
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import scipy.io as sio
import os
import curl
import requests
import re
from bs4 import BeautifulSoup
if not os.path.isdir(os.path.realpath('data_healthy')):
os.mkdir(os.path.realpath('data_healthy'))
if not... |
__author__ = "<NAME>"
__license__ = "Apache 2"
__version__ = "1.0.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__project__ = "LLP - DiTaxa"
__website__ = "https://llp.berkeley.edu/ditaxa/"
import sys
sys.path.append('../')
from sklearn.preprocessing import normalize
from sklearn.feature_extraction.text import T... |
#计算每个cluster的OBB
import numpy as np
#from matplotlib import pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
import pyrr
from sklearn.preprocessing import MinMaxScaler
#from anytree.dotexport import RenderTreeGraph
from anytree import Node, LevelOrderIter
from scipy.spatial import ConvexHull
import os
from os.pat... |
import numpy as np
from scipy.stats import binned_statistic_2d
from skimage.io import imread
from skimage.transform import resize
from tqdm import tqdm
def _load_and_normalize(filename: str, output_shape: tuple = (64, 64)):
"""Load an image, reshape to output_shape and normalize."""
# reshape to a certain im... |
import warnings
from sklearn.cluster import KMeans
import numpy as np
import tqdm
import os
import glob
import xarray as xr
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import func
import scipy.stats
from scipy.linalg import qr, solve, lstsq
from scipy.stats import multivariate_normal
from sklear... |
<gh_stars>1-10
import librosa
import matplotlib.pyplot as plt
import numpy as np
import soundfile
from scipy.io.wavfile import read
from utils import griffin_lim
if __name__ == '__main__':
filename = 'audios/007064.wav'
# assume 1 channel wav file
sr, data = read(filename)
data = data.astype(np.float16... |
from sympy import *
x = Symbol('x')
raw_data = [('12','64.5'), ('24','100.4'), ('36','129'), ('48', '151.5'), ('60', '168')]
flat = []
for d in raw_data:
plat = d[1]
for p in raw_data:
if p != d:
plat += '\\left(\\frac{x-%s}{%s-%s}\\right)' % (p[0], d[0], p[0])
flat += [plat]
pr... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 13 11:07:35 2017
@author: gianni
"""
from pythonradex import atomic_transition
from scipy import constants
import pytest
import numpy as np
class TestLevel():
g = 2
E = 3
level = atomic_transition.Level(g=g,E=E,number=1)
def test_LTE_level_pop(sel... |
from functools import lru_cache
from fractions import Fraction
import numpy as np
from PIL import Image, ImageOps
import cv2
from richlog import get_logger
from . import imgops
from . import util
from . import minireco
from . import resources
def check_main(img):
vw, vh = util.get_vwvh(img.size)
gear1 = img.... |
"""
Utility functions for making visuals.
"""
import os
import tempfile
import scipy.misc
from collections import namedtuple
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
# import seaborn as sns
import matplotlib.pyplot as plt
# The first dimension of values correspond to the x axis
HeatM... |
<gh_stars>0
def main():
# Yury's results (for sourceFlag = 1), othersise Ilya's results (for sourceFlag = 2):
sourceFlag = 1
#
# Opening the input file:
#
# inputFile='frictionForceLong_Nsplit_5_ve_3.dat'
nameDevice = 'HESR'
nameDevice = 'EIC'
nameDevice = 'MOSOL'
inputFile = nameDevice
i... |
<filename>sourcecode/final.py
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.formula.api as smf
from scipy import stats
def data(filename):
f= open(filename,'r')
data=[]
i=1
for line in f.readlines():
newline=line.split()
newline[0]=i #날짜는 그냥 경과... |
import random
import numpy as np
from typing import Tuple, List, Hashable, Callable, Union
from scipy.ndimage import gaussian_filter
class ContrastAugmentationTransform:
def __init__(self,
random_state,
contrast_range: Union[Tuple[float, float], Callable[[], float]] = (0.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Date: 1/3/21
#
# BioQueue is free for personal use and is licensed under
# the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# This ... |
from bfilter import BayesFilter
from bfagent import GreedyAgent
import itertools
import numpy as np
import sys
import pickle as pkl
from scipy.stats import multivariate_normal
import matplotlib.pyplot as plt
import time
from multiprocessing import Pool, Queue, Manager
from threading import Thread
from tqdm import tqdm
... |
<reponame>mbwinkler/TUMMET<filename>src/TUMMET/Fatigue/Fitting.py
import numpy as np
import pandas as pd
import os
from tkinter.filedialog import askdirectory, askopenfilenames
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from scipy.optimize import curve_fit
matplotlib.use('TkAgg')
def fit... |
#Elementary ACU-unification for single term pair
####################################################
#To-Do:
#-- Fix the conversion from the diophantine solver
#-- Add free function symbols
#-- Allow more than one AC symbol
#-- Test the solver and AC solutions
#!/usr/bin/env python3
from copy import deepcopy
from sy... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import distance
import requests
from flask import Flask, request, jsonify, send_file, make_response
import random
from numpy.random import permutation
from sklearn.neighbors import KNeighborsRegressor
import math
import io
from cl... |
<gh_stars>0
# -*- coding: utf-8 -*-
import csv
import os
from statistics import mode
import time
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import tensorflow as tf
import tensorflow.keras as keras
from ecgdetectors import Detectors
from sklearn.model_selection import train_test_split
fro... |
<filename>boosting_bbvi/tests/test_fully_corrective.py
#!/usr/bin/python
from edward.models import Categorical, Normal, Mixture, MultivariateNormalDiag
import tensorflow as tf
import scipy.stats
import random
import boosting_bbvi.scripts.mixture_model_relbo as mixture_model_relbo
def main():
# build model
xc... |
<gh_stars>1-10
## ASYMMETRON ###
import itertools
import numpy as np
import warnings
from scipy.stats import binom_test
try:
from pybedtools import BedTool
except:
print("Pybedtools not imported")
try:
import visualizations
except:
print("visualizations not imported")
def pairs_generator(pathL1, path... |
import sys
from functools import partial
import dolfin as fem
import matplotlib.pyplot as plt
import numpy as np
import sympy as sym
from buildup import common, utilities
from mtnlion.newman import equations
# NOTE: Deprecated
def picard_solver(a, lin, estimated, previous, bc, phis, phie):
eps = 1.0
eps_1 =... |
<gh_stars>1-10
from sigmas import *
import sigmas
import scipy
COMMONDIR = os.path.dirname(sigmas.__file__)
print COMMONDIR
rhobar = cd.cosmo_densities(**cosmo)[1] #msun/Mpc
def m2R(m):
RL = (3*m/4/np.pi/rhobar)**(1./3)
return RL
def m2V(m):
return m/rhobar
def R2m(RL):
m = 4*np.pi/3*rhobar*RL**3
return m
dmS =... |
<gh_stars>0
from poisson import *
import matplotlib.pyplot as plt
import numpy
from scipy import spatial
from matplotlib.path import Path
def getColor(typeList):
defColors = numpy.array([[0,0,0],[0,1,0],[1,1,0],[0,1,1],[.4,.0,.4],[1,0,0],[0,0,1],[1,1,1]])
return defColors[typeList]
# x and y coords
def no... |
<reponame>mwernerds/agile21_abstaining<gh_stars>0
from sklearn.datasets import load_files
import logging
import numpy as np
from optparse import OptionParser
import sys
from time import time
import matplotlib.pyplot as plt
from scipy.optimize import minimize
from sklearn.datasets import fetch_20newsgroups
from sklearn... |
<gh_stars>0
import exifread
import json
import io
import os
import flask
from fractions import Fraction
app = flask.Flask(__name__)
# the file to store and read the image file index
indexfile = "imagefile.json"
# these date tags should be synchronized
DATETAGS = ['EXIF DateTimeOriginal', 'Image DateTime', 'EXIF Da... |
<filename>bqp.py
import numpy as np
from scipy.optimize import minimize
from scipy.sparse import csc_matrix, csr_matrix, kron, vstack
class BQP(object):
'''
Definition interface of binary quadratic programming(BQP) problem.
the problem is:
max_{x={-1,1}^n} x.T*Q*x + q.T*x
s.t. x \in S
'''
def __i... |
# Support for the MATRIX Voice (https://voice.matrix.one)
import os
from fractions import Fraction
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.generic_platform import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from... |
<filename>double_rfcn/core/debugger.py
# --------------------------------------------------------
# Deep Feature Flow
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by <NAME>, <NAME>
# --------------------------------------------------------
# Based on:
# MX-RCNN
# ... |
# Copyright (c) 2021, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import numpy as np
import sympy as sp
import z3
from src.barrier... |
import numpy as np
from scipy import special as sp
import json
import os
AE4878_path = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join(AE4878_path, 'constants_matt.json')) as handle:
course_constants = json.loads(handle.read())
from matplotlib import pyplot as plt
def get_Ua_n(mu_2, r_1, r_12... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 13:41:32 2019
@author: s146959
"""
# ========================================================================== #
# ========================================================================== #
from __future__ import absolute_import, with_statement, absolute_import, \... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.