text
string
<filename>prediction/bimod/BACs_and_TERF/cefprox_ccs_comparison.py #!/Library/Frameworks/Python.framework/Versions/3.8/bin/python3 """ """ from matplotlib import pyplot as plt import json import numpy as np from scipy.optimize import curve_fit import sys fset = sys.argv[1] # set up plot fonts from matplotlib impo...
<gh_stars>0 import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy import signal import time import os import argparse parser = argparse.ArgumentParser(description='csv2txts') parser.add_argument('--path', default='test2', type=str, metavar='PATH',help='csvs path') args = parser.parse_args()...
from __future__ import division import refnx from refnx.reflect import structure, ReflectModel, SLD from refnx.dataset import ReflectDataset from refnx.analysis import Transform, CurveFitter, Objective, GlobalObjective, Parameter import numpy as np import scipy import matplotlib.pyplot as plt import matplotlib.gridspe...
<gh_stars>0 # -*- coding: utf-8 -*- #"""Untitled1.ipynb #Automatically generated by Colaboratory. #Original file is located at # https://colab.research.google.com/drive/105QoVdeDZbSv4YOPECOv3ZPRNU0Z1jhi #""" #from google.colab import drive #drive.mount('/content/gdrive') import sys from bitarray import bitarray ...
""" A container for functions which aim to analyze or process gwas results, for some aim. Author: <NAME> Email: <EMAIL> """ import scipy as sp import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import warnings import itertools as it import random import phenotypeData as pd import math def ca...
""" API resource class, retrieve attriubte data from database Parameters can be passed with url using GET requests required :param attribute: attribute name(s) :type attribute: string :return The requested attribute details from the database :rtype: JSON OR :param attributedata: attribute name(s) :type...
<reponame>dbstein/pybie2d import numpy as np import scipy as sp import scipy.signal import warnings import os from ..boundary import Boundary from .laplace_slp_self_kress import Laplace_SLP_Self_Kress from .stokes_slp_self_kress import Stokes_SLP_Self_Kress from .laplace_cslp_self_kress import Laplace_CSLP_Self_Kress ...
<gh_stars>10-100 """ qtl.py contains wrappers around C++ Limix objects to streamline common tasks in GWAS. """ import scipy as SP import scipy.stats as ST import limix import limix.utils.preprocess as preprocess import limix.deprecated.modules.varianceDecomposition as VAR import limix.utils.fdr as FDR import time #TO...
import sys,os import numpy as np import pandas as pd import h5py import math from scipy.stats import entropy from collections import Counter import pickle # Get Euclidean Norm minus One def get_ENMO(x,y,z): enorm = np.sqrt(x*x + y*y + z*z) ENMO = np.maximum(enorm-1.0, 0.0) return ENMO # Get tilt angles def get_...
<reponame>terhardt/DO-progression import numpy as np import matplotlib.pyplot as plt import pandas as pd import joblib as jl from code.model import linear_ramp from code.plotting import parcolors from scipy.stats import gaussian_kde def calc_med_iqr(y, q=[5, 95], axis=None): qs = np.percentile(y, [q[0], 50, q[-1]...
""" Python interface module for OSQP solver v0.6.2.post0 """ from __future__ import print_function from builtins import object import rlqp._osqp as _osqp # Internal low level module import numpy as np import scipy.sparse as spa from warnings import warn from platform import system import rlqp.codegen as cg import rlqp...
from .. import MagnetisationData from . import plot_tools import numpy as np import click import scipy.spatial as ss import matplotlib.pyplot as plt from matplotlib.widgets import Slider # import matplotlib # from matplotlib import rcParams from mpl_toolkits.axes_grid1 import make_axes_locatable # -------------------...
<filename>week_12_quantumChemistry1/utils2.py import sys version=sys.version_info.major import os import numpy as np import scipy as sp import scipy.linalg as spla import matplotlib.pyplot as plt import matplotlib.ticker as mtick import matplotlib as mpl try: from colorama import Fore,Back,Style from colorama i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Feb 5 12:03:32 2020 Posprocessing functions @author: jmon """ import numpy as np from neepy import Neepy import scipy.linalg as matrix from functions_neepy import partial_trace, partial_trace_mul from scipy.constants import k sx = np.array([[0,1],[1,0]...
""" Some common functions and constants for all of CLAM. """ SUBSAMPLE_LIMIT = 100 BATCH_SIZE = 10_000 EPSILON = 1e-8 def catch_normalization_mode(mode: str) -> None: from typing import List """ Make sure that the normalization mode is allowed. """ modes: List[str] = ['linear', 'gaussian', 'sigmoid'] ...
<reponame>LLNL/MaPPeRTrac<gh_stars>1-10 #!/usr/bin/env python3 import os,sys,glob,multiprocessing,time,csv,math,pprint,shutil,platform,fcntl,errno,tempfile,json,psutil,random import scipy.io import numpy as np from parsl.app.app import python_app from os.path import * from mappertrac.subscripts import * EDGE_LIST = 'd...
import itertools import os import sys import amici.petab_import import git import matplotlib.pyplot as plt import numpy as np import pandas as pd import petab import petab.C as C import pytest import scipy.stats import pyabc.petab import pyabc.petab.base @pytest.fixture( params=itertools.product( [petab...
from skimage import io, filters, feature, measure, morphology, util import numpy as np from skimage.draw import polygon from scipy import ndimage from skimage.external.tifffile import TiffFile import re import alphashape from joblib import Parallel, delayed def bounding_box(viewer, img, DAPI_Ch=0): z,x,y = img.sh...
#!/usr/bin/env python3 # Linear programming bound on rank of different functions. # This could almost certainly be simplified, but here we're # trying to emphasize clarity. # This includes several constraints; not all of them may be useful. import numpy as np import scipy.optimize import scipy.special class LpBound:...
<reponame>GaffaSnobb/kshell-utilities import sys, time, warnings from typing import Union, Tuple, Optional from fractions import Fraction from itertools import chain import numpy as np import matplotlib.pyplot as plt from scipy.stats import chi2 from scipy.optimize import curve_fit from .parameters import flags def cr...
import numpy as np from supporting_functions import p_stabilize from plot_drawings import show_2d_array, quick_hist, correlation_plot from chiffatools.dataviz import smooth_histogram from scipy.stats import norm # TODO: cell_drug_replicates analysis # TODO: plate_specific noise level : correlation between T0 and TF di...
import sys import requests import re import discord import logging import argparse import os import random from metno_locationforecast import Place, Forecast import random import giphy_client from giphy_client.rest import ApiException import xml.etree.ElementTree as ET import datetime as dt import statistics as s impor...
<gh_stars>1-10 from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from SMLMUtil import SMLM from scipy import ndimage import numpy as np import time, os import matplotlib.pyplot as plt # ******************************** # ******* resolution window ****** # ******************************...
<filename>python/mxnet/gluon/probability/distributions/utils.py<gh_stars>1-10 # 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 #...
# -*- coding: utf-8 -*- import time as tim import matplotlib.pyplot as plt import numpy as np from scipy.cluster.hierarchy import cut_tree, dendrogram, linkage from scipy.constants import pi from scipy.interpolate import interp1d as interp1d from .boreholes import Borehole, _EquivalentBorehole, find_duplicates from ....
<reponame>linklab/link_rl<gh_stars>1-10 ''' Example taken from Balaji et al. Paper: https://arxiv.org/abs/1911.10641 GitHub: https://github.com/awslabs/or-rl-benchmarks ''' import gym from gym import spaces import or_gym from or_gym.utils import assign_env_config import random import numpy as np from scipy.stats import...
<gh_stars>1-10 # -*- coding: utf-8 -*- # """ <NAME>, Approximate Calculation of Multiple Integrals, Prentice Hall, 1971. """ from __future__ import division import numpy import sympy from . import rabinowitz_richter from . import stroud_secrest from ..helpers import untangle def _gen4_1(symbolic): frac = sympy....
""" Set of functions to generate synthetic data for experiments as in the paper "Clustering network layers with the strata multilayer stochastic block model" """ import numpy as np import numpy.random as npr import sys import pickle import time import pdb from random import randint import scipy as sp from scipy.stats i...
""" Implementation of the method proposed in the paper: 'Adversarial Attacks on Graph Neural Networks via Meta Learning' by <NAME>, <NAME> Published at ICLR 2019 in New Orleans, USA. Copyright (C) 2019 <NAME> Technical University of Munich """ import tensorflow.compat.v1 as tf tf.disable_v2_behavior() import numpy as ...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- u""" Created by <NAME> at 2021.03.16 This is migrated from Zhou's code """ import numpy as np import scipy.stats as sts from matplotlib import pylab from plot.utils import * def plot_sideplot( read_depth_object, sample_info, graph_coords, ax_var, fon...
<filename>cosmos/latex_ocr/img2latex.py import sys, os sys.path.append(os.path.dirname(__file__)) import random import re from scipy.misc import imread import PIL from PIL import Image import os import uuid from imgaug import augmenters as iaa from model.img2seq import Img2SeqModel from model.utils.general import Conf...
import streamlit as st from streamlit_ace import st_ace import types import sympy as sm from sympy.abc import * from pchem import solve # See # https://discuss.streamlit.io/t/take-code-input-from-user/6413/2?u=ryanpdwyer # import random, string # import importlib # import os # def import_code(code, name): # ...
<reponame>jessicaleete/numerical_computing import matplotlib matplotlib.rcParams = matplotlib.rc_params_from_file('../../matplotlibrc') from matplotlib import pyplot as plt import numpy as np from scipy import linalg as la from scipy import optimize as opt def newtonsMethod1d(f, df, ddf, x, niter=10): ''' Per...
<reponame>jifengting1/fastpliFork # -*- coding: utf-8 -*- """ Methods for calculating and applying affine transformation to coordinates and images. """ import numpy as np import scipy.interpolate import numba def _replace_mat_row(B, r, d): return np.linalg.det(np.delete(np.vstack([r, B]), (d + 1), axis=0)) @n...
<filename>examples/pinn_inverse/Navier_Stokes_inverse.py """Backend supported: tensorflow.compat.v1, tensorflow, pytorch An inverse problem of the Navier-Stokes equation of incompressible flow around cylinder with Re=100 References: https://doi.org/10.1016/j.jcp.2018.10.045 Section 4.1.1 """ import deepxde as dde im...
<filename>demo.py #!/usr/bin/env python from random import random from sympy import * class Supply: def __init__(self, file): self.pair = {} self.satisfy_demand = {} with open(file, 'r') as f: for line in f: line = line.strip() if line.startswi...
<gh_stars>1-10 import numpy as np import math as mth import matplotlib.pyplot as plt from mpl_toolkits import axes_grid1 from astropy.io import fits import math as m import sys from scipy.optimize import curve_fit import astropy.units as u import astropy.coordinates as coord from astropy.wcs import WCS def fit(x,y,y...
<gh_stars>0 import functools import warnings import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd import os from scipy.stats import poisson from scipy.special import logsumexp from sklearn.neighbors import DistanceMetric from sklearn.decomposition import PCA, NMF from sklearn.me...
<reponame>robbje/eis #!/usr/bin/env python2 import json import numpy as np import scipy.signal from scipy.optimize import leastsq import matplotlib.pyplot as plt from copy import deepcopy class Spectrum(object): def __init__(self): self.omega = [] self.Z = [] @classmethod def fromExperim...
<reponame>mherde/modAL<gh_stars>0 import numpy as np import itertools from scipy.special import factorial, gammaln from modAL.utils.parzen_window_classifier import PWC from typing import Tuple import numpy as np from scipy.stats import entropy from sklearn.exceptions import NotFittedError from sklearn.base import Ba...
# -*- coding: utf-8 -*- # Copyright 2020 the HERA Project # Licensed under the MIT License """ abscal.py --------- Calibrate measured visibility data to a visibility model using linearizations of the (complex) antenna-based calibration equation: V_ij,xy^data = g_i_x * conj(g_j_y) * V_ij,xy^model. Complex-valued para...
""" :author: <NAME> (<EMAIL>) 2021 :License: This package is published under Simplified BSD License. """ """ This script extracts and converts audio samples from Common Voice. """ import os import pydub import argparse from threading import Thread import numpy as np import scipy.io.wavfile as wav import shutil from...
import math from statistics import mean from pm4py.objects.conversion.log import converter from pm4pymdl.algo.mvp.utils import succint_mdl_to_exploded_mdl from collections import Counter def apply(df, parameters=None): if parameters is None: parameters = {} stream = get_stream_from_dataframe(df, pa...
<gh_stars>10-100 import scipy.signal import numpy as np def _spectrogram(samplerate, signal, window="hamming", winlen=0.02, winstep=0.01, nfft=512): nperseg = int(winlen * samplerate) noverlap = int(winstep * samplerate) f, t, Sxx = scipy.signal.spectrogram(signal, samplerate, window, nperseg=nperseg, noverlap=n...
from load import ROOT as R import gna.constructors as C import numpy as N from collections import OrderedDict from gna.bundle import * from scipy.interpolate import interp1d class reactor_anu_freemodel_v01(TransformationBundleLegacy): debug = False def __init__(self, *args, **kwargs): super(reactor_an...
""" This contains Thiel analysis plots """ from os import read, path # import px4tools import numpy as np import math import io import os import sys import errno import base64 from db_entry import * import pickle import simstats # this the module that you can modify to add your own stats #import thiel_analysis fr...
<gh_stars>0 import clamp_ephys import pandas as pd import os import scipy import matplotlib %matplotlib import matplotlib.pyplot as plt import numpy as np '''####################### SET PROPER PATH_TO_DATA_NOTES ########################## ''' data_path = os.path.join(os.getcwd(), 'test_data', 'p2_data_notes.csv') '''...
<filename>openhgnn/models/HPN.py """ This model shows an example of using dgl.metapath_reachable_graph on the original heterogeneous graph. """ import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import dgl from scipy import sparse as sp from . import BaseModel, register_model from d...
<filename>ML/gtsdb/semantic_seg.py #!/usr/bin/env python """Semantic Segmentation experiment.""" from keras.models import load_model from keras.models import Model from keras.layers import UpSampling2D import scipy.misc import numpy as np from PIL import Image import logging import sys logging.basicConfig(format='%(...
<gh_stars>1-10 import statistics import ast import os import matplotlib.pyplot as plt import numpy as np import urllib.request from bs4 import BeautifulSoup script_directory = str(os.path.dirname(os.path.realpath(__file__))) file_name = "prelimsavefile.txt" path_to_file = script_directory + '\\' + file_name """ READM...
import numpy as np # import scipy.stats # import scipy.special from scipy.special import gammaln try: import xarray as xr except ImportError: xr = None class NegativeBinomial: r""" Negative binomial distribution. This class supports re-parameterising, sampling and calculation of probabilities...
<filename>corems/molecular_id/calc/math_distance.py import numpy as np import scipy.stats '''exploratory module based on Yuanyue Li code at TODO add GitHub and Paper here''' def entropy_distance(v, y): merged = v + y entropy_increase = 2 * scipy.stats.entropy(merged) - scipy.stats.entropy(v) - scipy.stats.en...
from sympy import Eq, Symbol, Derivative, Basic from compartor.compartments import Moment, Expectation, _getNumSpecies, get_missing_moments from IPython.core.display import display, Markdown ################################################### # # Displaying reaction networks and moment equations # in jupyter notebook...
<reponame>princeton-computational-imaging/NLOSFeatureEmbeddings import numpy as np import cv2 from helper import definePsf, resamplingOperator ########################################################## def lct(meas_hxwxt, wall_size, crop, bin_len): c = 3e8 width = wall_size / 2.0; bin_resolution = ...
<gh_stars>0 from os import path import json, time, numpy as np, pandas as pd, datetime, copy, re, traceback, multiprocessing as mp from scipy.spatial import distance # function for solving instance def meta_zone(zone): m = re.match('[A-Z]+(?=-)', zone) higher_meta = m.group(0) if m else zone m_ = re...
import json import collections import numpy as np from scipy.stats import multivariate_normal # import matplotlib.pyplot as plt def parse_json_parameters(func): def inner(*args, **kwargs): print(args, kwargs) args = [json.loads(value) if type(value) is str else value ...
# ------------------------------------------------------------------- # ibool reader. # # Author: <NAME> # Email: <EMAIL> # ------------------------------------------------------------------- from seisgen.util_SPECFEM3D import NGLLX, NGLLY, NGLLZ, CONSTANT_INDEX_27_GLL from scipy.io import FortranFile import numpy as ...
<gh_stars>0 from mpmath import * from sympy import * def k_1(func, k, n, f, t0): for i in range(k, n+1): k0 = func.subs([(y,f[0]),(t,t0)]) y_prox = f[0] + h* k0 f[0] = y_prox print (str(i) + ' ' + str(y_prox)) t0=t0+h def k_2(func, k, n, f, t0): for i in...
<filename>gprpy/mergeProfiles.py import gprpy.gprpy as gp import numpy as np from scipy.ndimage import zoom def mergeProfiles(file1,file2,outfile,gapfill=0): ''' Merges two GPR profiles by placing the second one at the end of the first one. Make sure you preprocessed them in GPRPy and save ...
import argparse import csv import logging import math import time from datetime import datetime from pathlib import Path from statistics import mean, stdev import numpy as np import fem from feat import mesh def main(): # argument parser creation and setup desc = ( "Complete an RVE analysis for the ...
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 <NAME> # 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 notice, this # list of...
import numpy as np import matplotlib.pyplot as plt import random from scipy.signal import convolve2d import math from scipy import misc import os from PIL import Image from numba import jit import cv2 import scipy.misc np.set_printoptions(threshold=np.inf) def S_UNIWARD(coverPath, payload): sgm = 1 ## Get 2D ...
<filename>pyNastran/op2/op2_interface/random_results.py from typing import Dict, Any import numpy as np class RandomObjects: prefix = '' postfix = '' def __init__(self): self.displacements = {} self.velocities = {} self.accelerations = {} self.load_vectors = {} self....
<gh_stars>0 # qa_images.py import os import logging import numpy as np def do_diff(test, mast, nodata=False): """Do image diff, break if the grids are not the same size. Args: test <numpy.ndarray>: array of test raster mast <numpy.ndarray>: array of master raster """ if nodata: ...
<reponame>gianmatharu/Aniso import numpy as np from scipy.ndimage.filters import gaussian_filter # math utilities def eigsorted(A): """ Return sorted eigenvalues and eigenvec...
<filename>cognigraph/gui/source_obj.py """Base class for objects of type source.""" from warnings import warn import logging import numpy as np from scipy.spatial.distance import cdist from vispy import scene from vispy.scene import visuals import vispy.visuals.transforms as vist # from ._projection import _project_s...
from __future__ import division, print_function from scipy.special import logsumexp from ._global_imports import * from . import _precision from getdist.plots import getSubplotPlotter from getdist.mcsamples import MCSamples try: from nestcheck.ns_run_utils import get_logw, get_w_rel from nestcheck.plots im...
<filename>particlezoo/parsers/transform.py from __future__ import annotations from particlezoo.builders.lagrangian import Lagrangian from sympy import sympify, Matrix from liesym import SU, SO, U1, Sp, Z, E, Group, LieGroup from typing import Dict, Union from ..builders import (SymmetryGroup, Symmetry, ...
<gh_stars>0 """ Module for performing two-dimensional coaddition of spectra. .. include common links, assuming primary doc root is up one directory .. include:: ../include/links.rst """ import os import copy from IPython import embed import numpy as np from scipy import ndimage from matplotlib import pyplot as plt ...
""" localization_detection.py This script contains all methods used for localization and detection. - parse_annotations: groundtruth localization, based on metadata annotation parsing - ld_oracle: wrapper for parse_annotations methor - ld_basic: diffuseness mask and simple event grouping by temporal continuity - ld_ba...
<reponame>vishaltiwari/XNet<filename>tools/thermo/plot_expansion_no_parser.py import os,sys,itertools import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as plticker import matplotlib.gridspec as gridspec import matplotlib.axes as plax from datetime import datetime from scipy import inter...
<filename>miditoolkit/pianoroll/parser.py import numpy as np from copy import deepcopy from scipy.sparse import csc_matrix import miditoolkit.midi.containers as ct PITCH_RANGE = 128 # def get_onsets_pianoroll(): # pass # def get_offsets_pianoroll(): # pass def notes2pianoroll( note_stream_ori, ...
from mmdet.apis import init_detector, inference_detector import mmcv import cv2 import numpy as np from scipy import ndimage config_file = '../configs/solov2/solov2_r50_fpn_8gpu_1x___.py' # download the checkpoint from model zoo and put it in `checkpoints/` checkpoint_file = '../work_dirs/solov2_12/epoch_12.pth' # b...
from dgdynamic.utils.project_utils import LogMixin, make_directory from dgdynamic.config.settings import config from dgdynamic.utils.plotter import matplotlib_plot from scipy.interpolate import interpolate import threading import time import csv import matplotlib.pyplot as plt import os.path import enum import collecti...
<gh_stars>1-10 import statistics import pytest from telliot_feed_examples.feeds.eth_jpy_feed import eth_jpy_median_feed @pytest.mark.asyncio async def test_AssetPriceFeed(): """Retrieve median ETH/JPY price.""" v, _ = await eth_jpy_median_feed.source.fetch_new_datapoint() assert v is not None asser...
<filename>scripts/gauge_comparison.py #!/usr/bin/env python import os import sys import datetime import scipy.io import numpy as np # Plot customization import matplotlib # Markers and line widths matplotlib.rcParams['lines.linewidth'] = 2.0 matplotlib.rcParams['lines.markersize'] = 6 matplotlib.rcParams['lines.mar...
from lrasm.homoscedasticity_tst import homoscedasticity_test import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model from matplotlib.pyplot import figure from scipy import stats def test_homoscedasticity_test(): """Test homoscedasticity test outputs from dataset""" ...
<reponame>sreichl/genomic_region_enrichment #!/bin/env python import pandas as pd import pickle import os import numpy as np import gseapy as gp # utils for manual odds ratio calculation def overlap_converter(overlap_str, bg_n, gene_list_n): overlap_n, gene_set_n = str(overlap_str).split('/') return odds_rati...
#!/usr/bin/env python3 from itertools import accumulate, chain, combinations, groupby, permutations, product from collections import deque, Counter from bisect import bisect_left, bisect_right from math import gcd, sqrt, sin, cos, tan, degrees, radians, ceil, floor from fractions import Fraction from decimal import Dec...
<reponame>psteinb/HINT import numpy as np import torch import time import os import matplotlib.pyplot as plt import pickle from tqdm import tqdm from scipy.spatial import distance_matrix from data import FourierCurveModel # Choose data set dataset = ('fourier_curve', 'fourier-curve') # dataset = ('plus_shape', 'plus-...
import warnings import sympy from xarray import DataArray from weldx.asdf.types import WeldxConverter from weldx.constants import META_ATTR from weldx.core import MathematicalExpression __all__ = ["MathematicalExpression", "MathematicalExpressionConverter"] class MathematicalExpressionConverter(WeldxConverter): ...
# -*- coding: utf-8 -*- # @Time : 2021/4/12 12:59 上午 # @Author : <NAME> # @FileName: main.py # @Software: PyCharm # @Blog :https://lesliewongcv.github.io/ import numpy as np import os from scipy.io import loadmat from sklearn.model_selection import KFold def sigmoid(a, b, x): return 1.0 / (1 + np.exp(-1...
<reponame>QuESt-Calculator/pyscf #!/usr/bin/env python # Copyright 2014-2020 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apac...
import time import requests import shutil import os import numpy as np import matplotlib.pyplot as plt import scipy.io.wavfile as wavfile def download_file(file_url, headers, output_path): args = { "url": file_url, } url = "https://api.dolby.com/media/output" # Create a request to download ...
#! /usr/bin/env python3 import os import gensim import pickle import string import numpy as np import pandas as pd from scipy.stats import pearsonr from nltk.corpus import stopwords from gensim.models import Word2Vec from nltk import word_tokenize from nltk.stem import SnowballStemmer from sklearn.feature_extraction.te...
<reponame>Sumit1673/Projects from matplotlib.colors import ListedColormap import numpy as np from random import seed from math import exp from random import random import matplotlib.pyplot as plt # Activation functions sigmoid_functn = lambda x: 1/(1+ np.exp(-x)) sigmoid_derivative = lambda x: x * (1-x) # Question(a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Oct 07 2019 @author: <NAME> <<EMAIL>> """ from typing import Union import numpy as np from scipy import sparse from sknetwork.linalg import SVDSolver, LanczosSVD from sknetwork.ranking.base import BaseRanking from sknetwork.utils.check import check_format...
<filename>src/eddington/fit_result.py """Fitting result class that will be returned by the fitting algorithm.""" from dataclasses import dataclass, field from typing import Optional import numpy as np import scipy.stats as stats from eddington.print_util import to_precise_string @dataclass(repr=False) # pylint: di...
<filename>cats/data_modules/combine.py<gh_stars>1-10 import numpy as np from astropy import units as u import matplotlib.pyplot as plt from copy import deepcopy from scipy.optimize import curve_fit from scipy.ndimage.filters import gaussian_filter1d from scipy.interpolate import RegularGridInterpolator from astropy.nd...
""" A suite of functions for finding sources in images. :Authors: <NAME>, <NAME> :License: :doc:`LICENSE` """ import sys import math import numpy as np from scipy import signal, ndimage import stsci.imagestats as imagestats from . import cdriz __all__ = ['gaussian1', 'gausspars', 'gaussian', 'moments', 'errfunc'...
import numpy as np from scipy.interpolate import LinearNDInterpolator, interp1d, griddata from scipy.spatial import cKDTree from numpy import matlib import discretize from discretize import TensorMesh import matplotlib.pyplot as plt import matplotlib as mpl from matplotlib import ticker import warnings from ....data i...
<filename>src/utils.py import time import pathlib import numpy as np import json from .log import logger # Timing and Performance import hdbscan import umap import umap.plot import numpy as np import pandas as pd from scipy.spatial.distance import cdist def timing_info(method): def wrapper(*args, **kw): s...
import numpy as np import cv2 from scipy import ndimage def flow_visualization(u, v, dil_size=0): H = u.shape[0] W = u.shape[1] hsv = np.zeros((H, W, 3)) # convert from cartesian to polar mag, ang = cv2.cartToPolar(u, v) hsv[:, :, 0] = ang * 180 / np.pi / 2 hsv[:, :, 2] = cv2.normalize(m...
# noinspection PyPackageRequirements import datawrangler as dw import os import sys import numpy as np import pandas as pd import ast import json import datetime import quail import nltk import warnings import pickle import datetime as dt # noinspection PyPackageRequirements from spellchecker import SpellChecker from ...
<gh_stars>10-100 from pylab import * import argparse import packages.primitive as primitive import scipy.signal parser = argparse.ArgumentParser(description='Generate polar view of the lines directions.') parser.add_argument('primitivefile') parser.add_argument('--shownormals', action="store_true", help="Shows the nor...
import numpy as np import pandas as pd import scipy.integrate as integrate import scipy.optimize as optimize def simulate_JM_base(I, obstime, miss_rate=0.1, opt="none", seed=None): if seed is not None: np.random.seed(seed) J = len(obstime) #### longitudinal submodel...
<reponame>joye1503/Distributed-Computing-Scripts #!/usr/bin/env python # -*- coding: utf-8 -*- ''' Automatic assignment handler for Mlucas and CUDALucas. [*] Revised by <NAME> and <NAME> for CUDALucas (2020) Original Authorship(s): * # EWM: adapted from https://github.com/MarkRose/primetools/blob/master/mfloo...
<reponame>leggedrobotics/DeLORA #!/usr/bin/env python3 # Copyright 2021 by <NAME>, Robotic Systems Lab, ETH Zurich. # All rights reserved. # This file is released under the "BSD-3-Clause License". # Please see the LICENSE file that has been included as part of this package. import scipy.spatial class KDTreeBuilder: ...
import pandas as pd import numpy as np import math import statistics import api.recrudescence_utils as recrudescence_utils def calculate_frequencies3(genotypedata, alleles_definitions): ''' Calculate frequencies of alleles Using the input data table and alleles_definition which contains the lower and upper break...
### Diffusion_1D # Time-stamp: <2015-07-21 09:33:37 marine> import numpy as np import scipy as sp import matplotlib.pyplot as plt ## Tri Diagonal Matrix Algorithm(a.k.a Thomas algorithm) solver def TDMAsolver(a, b, c, d): ''' Solve the equation ax_{i-1}+bx_{i}+cx_{i+1}=d_{i} for x TDMA solver, a b c d ca...