text string |
|---|
from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)
N=int(input())
ans=1
for i in range(N):
t=int(input())
ans=lcm(ans,t)
print(ans) |
"""
This file is part of the repo: https://github.com/tencent-ailab/hifi3dface
If you find the code useful, please cite our paper:
"High-Fidelity 3D Digital Human Creation from RGB-D Selfies."
<NAME>*, <NAME>*, <NAME>*, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, and <NAME>.
arXiv: https://arxiv.org/abs/2010.05... |
<gh_stars>0
import json
import sys
import os
import pickle
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
from ast import literal_eval
from scipy.stats import multivariate_normal
import naive_bayes_profiler
PRIOR_ = {
"@Enhedslisten": 0.069,
"@alternativet": 0.01,
"@friegronn... |
import os
import random
from tqdm import tqdm
from glob import glob
import torch
import numpy as np
from scipy import linalg
import zipfile
import cleanfid
from cleanfid.utils import *
from cleanfid.features import build_feature_extractor, get_reference_statistics
from cleanfid.resize import *
"""
Numpy implementatio... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 16 13:09:20 2020
@author: MiaoLi
"""
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
import numpy as np
#%% =============================================================================
# import clean data
# ==============... |
<filename>pybrain/optimization/finitedifference/pgpe.py
__author__ = '<NAME>, <EMAIL>, <NAME>'
from scipy import ones, random
from pybrain.auxiliary import GradientDescent
from fd import FiniteDifferences
class PGPE(FiniteDifferences):
""" Policy Gradients with Parameter Exploration (ICANN 2008)."""
... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import math
import numpy as np
import scipy as sp
from scipy.stats.distributions import gamma
import routines
def R_estimator_VdW_score(y, mu, S0, pert):
"""
# -----------------------------------------------------------
# This function implement the R-... |
#!/Users/fa/anaconda/bin/python
'''
Evaluation code for the SICK dataset (SemEval 2014 Task 1)
'''
import sys
#sys.path = ['../gensim', '../models', '../utils'] + sys.path
sys.path = ['../', '../featuremodels', '../utils', '../monolingual-word-aligner'] + sys.path
# Local imports
import gensim, utils
from featuremode... |
# pylint: disable=too-few-public-methods
"""Wrappers for :mod:`scipy.stats` distributions."""
from collections.abc import Sequence
import numpy as np
import xarray as xr
from scipy import stats
__all__ = [
"XrContinuousRV",
"XrDiscreteRV",
"circmean",
"circstd",
"circvar",
"gmean",
"hmean... |
'''
This module contains the `RBF` class, which is used to symbolically
define and numerically evaluate a radial basis function. `RBF`
instances have been predefined in this module for some of the commonly
used radial basis functions. The predefined radial basis functions are
shown in the table below. For each express... |
<reponame>rdukale007/ga-learner-dsmp-repo<gh_stars>0
# --------------
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 [... |
<filename>inferential/logistic_regression.py
import numpy as np
import scipy.stats as sp
from scipy.special import expit
from scipy.optimize import minimize
SMALL = np.finfo(float).eps
__all__ = ['logistic_regression']
def _logr_statistics(independent_vars, regression_coefficients):
"""Computes the significanc... |
<gh_stars>1-10
import pylab as pyl
import h5py as hdf
from scipy import stats
def find_indices(bigArr, smallArr):
from bisect import bisect_left, bisect_right
''' Takes the full halo catalog and picks out the HALOIDs that we are
interested in. Only returns their indexes. It will need to be combined
wi... |
import scipy
import scipy.stats as ss
import numpy as np
import matplotlib
import pandas as pd
import random
import math
def iqr_threshold_method(scores, margin):
q1 = np.percentile(scores, 25, interpolation='midpoint')
q3 = np.percentile(scores, 75, interpolation='midpoint')
iqr = q3-q1
lower_range =... |
<filename>src/PyOGRe/Metric.py
import sympy as sp
from dataclasses import dataclass
import numpy.typing as npt
from typing import Optional
@dataclass
class Metric:
"""Generic Metric class used to represent Metrics in General Relativity"""
components: npt.ArrayLike
symbols: Optional[sp.symbols] = sp.symb... |
<reponame>rougier/VSOM
# -----------------------------------------------------------------------------
# VSOM (Voronoidal Self Organized Map)
# Copyright (c) 2019 <NAME>
#
# Distributed under the terms of the BSD License.
# -----------------------------------------------------------------------------
import sys
import ... |
# next is to add accel and see the difference
# add stiffness too
import numpy as np
from scipy import signal, stats
from matplotlib import pyplot as plt
from all_functions import *
import pickle
from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
experiment_ID = "transfer_learning... |
# Copyright 2017 Match Group, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
<reponame>marcua/qurk_experiments
# Retrieves the unique worker ids for experiments
# for testing overlap between experiments
#!/usr/bin/env python
import sys, os
ROOT = os.path.abspath('%s/../..' % os.path.abspath(os.path.dirname(__file__)))
sys.path.append(ROOT)
os.environ['DJANGO_SETTINGS_MODULE'] = 'qurkexp.setti... |
<reponame>echaussidon/desispec<gh_stars>0
"""
Monitoring algorithms for Quicklook pipeline
"""
import os,sys
import datetime
import numpy as np
import scipy.ndimage
import yaml
import re
import astropy.io.fits as fits
import desispec.qa.qa_plots_ql as plot
import desispec.quicklook.qlpsf
import desispec.qa.qa_plots_q... |
# -*- coding: utf-8 -*-
# This file is part of QuTiP: Quantum Toolbox in Python.
#
# Copyright (c) 2014 and later, <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:
#
# 1.... |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from pytest import approx
from scipy.stats import multivariate_normal
from ..nonlinear import (
CartesianToElevationBearingRange, CartesianToBearingRange,
CartesianToElevationBearing, Cartesian2DToBearing, CartesianToBearingRangeRate,
CartesianToElev... |
from pathlib import Path
import scipy.io
import csv
from . import file_io
matrix_names= [\
'HB/arc130',
'Nasa/nasa2910',
'HB/bcsstk21',
'HB/bcsstk01',
'Boeing/msc00726',
'HB/bcsstk19',
'Boeing/msc04515',
'HB/plat1919',
'Norris/fv1',
'Okunbor/aft01',
'NASA/nasa1824',
'HB/bcsstk09',
'HB/bcsstk... |
<filename>cosmosis-standard-library/structure/owls/owls.py
"""
This module loads data from the powtable files which summarize the OWLS
results made by <NAME> et al.
I interpolate into that data using a bivariate spline to get an estimate of the
effect on the matter power from baryons at a given z and k.
This requires... |
<reponame>wiebket/del_clustering
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 4 12:17:34 2017
@author: saintlyvi
"""
import pandas as pd
import numpy as np
from math import ceil, floor
from scipy import stats
import os
import colorlover as cl
import plotly.offline as offline
import plotl... |
# Importing the Kratos Library
import KratosMultiphysics as KM
import KratosMultiphysics.ShallowWaterApplication as SW
from KratosMultiphysics.ShallowWaterApplication.benchmarks.base_benchmark_process import BaseBenchmarkProcess
from KratosMultiphysics.process_factory import Factory as ProcessFactory
# Other imports
... |
import cv2
import argparse
import scipy.spatial
import numpy as np
import tensorflow as tf
def load_graph(frozen_graph_filename):
with tf.gfile.GFile(frozen_graph_filename, "rb") as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
with tf.Graph().as_default() as graph:
... |
<filename>faster-rcnn.pytorch/lib/datasets/gta.py
# --------------------------------------------------------
# Fast/er R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by <NAME> and <NAME>
# --------------------------------------------------------
import os.path as osp
import numpy as np
imp... |
#!/usr/bin/python3
"""
Program Name: enf_analysis.py
Created By: <NAME>
Description:
Program designed to extract ENF traces from audio files.
"""
# Import Required Libraries
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import scipy
from scipy.io import wavfile
import sci... |
import load_MNIST
import numpy as np
import sparse_autoencoder
import scipy.optimize
import display_network
import softmax
## ======================================================================
# STEP 0: Here we provide the relevant parameters values that will
# allow your sparse autoencoder to get good filters; ... |
<reponame>minhoolee/Synopsys-Project-2017<filename>src/models/wave_net.py
from __future__ import absolute_import, division, print_function
import datetime
import json
import os
import re
import wave
import logging
import keras.backend as K
import numpy as np
import scipy.io.wavfile
import scipy.signal
# import theano... |
<reponame>Damseh/VascularGraph
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 30 10:29:31 2019
@author: rdamseh
"""
from VascGraph.Tools.CalcTools import fixG, FullyConnectedGraph
import networkx as nx
import numpy as np
import scipy as sp
import scipy.io as sio
def PostProcessMRIGraph(gr... |
<reponame>utkarshdeorah/sympy
#!/usr/bin/env python
"""
Script to generate test coverage reports.
Usage:
$ bin/coverage_report.py
This will create a directory covhtml with the coverage reports. To
restrict the analysis to a directory, you just need to pass its name as
argument. For example:
$ bin/coverage_report.p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
GMM results class
-----------------
"""
from __future__ import print_function, division
import numpy as np
import pandas as pd
from scipy.stats import chi2
__all__ = ['Results']
class Results(object):
"""Class to hold estimation results.
Attributes
-... |
# -*- coding: utf-8 -*-
import numpy as np
from scipy.spatial.distance import cdist,pdist,squareform
from scipy.sparse import csc_matrix
from sklearn.cluster import KMeans
from scipy.spatial import Delaunay
import networkx as nx
#%%
def fun_GPGL_layout_push(pos,size):
dist_mat = pdist(pos)
scale1 = 1/dist... |
#!/usr/bin/env python
# Author: <NAME> (jsh) [<EMAIL>]
import argparse
import logging
import pandas as pd
import pathlib
import shutil
import sys
from matplotlib import pyplot as plt
import numpy as np
import scipy.stats as st
import seaborn as sns
logging.basicConfig(level=logging.INFO,
format='... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
<gh_stars>100-1000
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved
Author: <NAME> (<EMAIL>)
Date: 02/26/2021
"""
from __future__ import print_function
import time
import torch
import numpy as np
from scipy.optimize import linear_sum_assignment as hungarian
from sklearn.metrics.cluster import nor... |
from scipy import *
from scipy.fftpack import *
from scipy.signal import gaussian, hilbert
from scipy.constants import speed_of_light
from matplotlib.pyplot import *
from my_format_lib import *
format_plot()
|
from fractions import Fraction
from functools import partial
from typing import (Sequence,
Tuple)
from ground.base import get_context
from hypothesis import strategies
from hypothesis_geometry import planar
from tests.strategies import coordinates_strategies
from tests.strategies.base import MAX_C... |
<filename>FLOOD.py
from slixmpp.basexmpp import BaseXMPP
from node import Node
from asyncio import sleep
from aioconsole import aprint
from time import time
from xml.etree import ElementTree as ET
import json
import asyncio
import numpy as np
from scipy.sparse.csgraph import shortest_path
import uuid
"""
---------
| ... |
"""
Taken from https://github.com/HugoLav/DynamicalOTSurfaces
"""
# Clock
import time
# Mathematical functions
import numpy as np
import scipy.sparse as scsp
import scipy.sparse.linalg as scspl
from numpy import linalg as lin
from math import *
def buildLaplacianMatrix(geomDic, eps):
"""Return a function whi... |
<filename>spinup/algos/pytorch/dqn/core.py
import numpy as np
import scipy.signal
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions.normal import Normal
from tensorboardX import SummaryWriter
from ipdb import set_trace as tt
class ExpScheduler:
def __init__(self, init_val... |
<reponame>avsastry/U01_ICA_tutorial<gh_stars>0
"""
Clusters the S vectors generated from random_restart_ica.py
The output files are S.csv and A.csv.
To execute the code:
mpiexec -n <n_cores> python cluster_components.py -i ITERATIONS [-o OUT_DIR ]
n_cores: Number of processors to use
OUT_DIR: Path to output director... |
"""Hyperbolic secant distribution."""
import numpy
from scipy import special
from ..baseclass import Dist
from ..operators.addition import Add
class hyperbolic_secant(Dist):
"""Hyperbolic secant distribution."""
def __init__(self):
Dist.__init__(self)
def _pdf(self, x):
return .5*numpy.... |
import os
from fractions import Fraction
import matplotlib.pyplot as plt
from matplotlib import cm
import mpltern
import pandas as pd
import numpy as np
from mpl_toolkits.axes_grid1 import ImageGrid
def make_square_axes(ax):
"""Make an axes square in screen units.
Should be called after plotting.
"""
... |
from datetime import date
from typing import Optional, List, Iterable
import numpy as np
import pandas as pd
from scipy.stats import nbinom
from epyestim import bagging_r
from epyestim.distributions import discretise_gamma
def generate_standard_si_distribution():
"""
Build the standard serial interval dist... |
# Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... |
<reponame>Yash-10/numbakit-ode
"""
benchmarks.against_scipy
~~~~~~~~~~~~~~~~~~~~~~~~
Comparisons using SciPy as a gold standard.
:copyright: 2020 by nbkode Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import numpy as np
from scipy import integrate
impor... |
import base64
import io
import itertools
import ipywidgets as widgets
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as stats
import seaborn as sns
from IPython.display import display, Markdown, HTML
from explorer.explorer_utils import hist, retrieve_nested_path
from explore... |
<gh_stars>1-10
"""
SciPy ode solver for system of kinetic reactions for biomass pyrolysis. Solution
based on reaction rates function, for example dp/dt = K*p. Kinetic scheme from
Papadikis 2010 which uses parameters from Chan 1985, Liden 1988, and Blasi 1993.
Requirements:
Python 3, Numpy, Matplotlib
References:
1) ... |
<filename>sds_torch/transitions.py
import numpy as np
from numpy import random as npr
from scipy.special import logsumexp as spy_logsumexp
from scipy.stats import dirichlet as spy_dirichlet
from torch.distributions import dirichlet
import scipy as sc
from scipy import special
import torch
import torch.nn as nn
impor... |
import cv2
from scipy.ndimage.filters import gaussian_filter, convolve
class Frame:
def __init__(self, frame):
self.raw_frame = frame
self.bw = cv2.cvtColor(self.raw_frame, cv2.COLOR_BGR2GRAY)
self.canny_list = [[]]
def blur(self, sigma_val):
blurred = gaussian_filter(self.bw,... |
<filename>pystein/matter.py
"""Utilities for constructing symbolic matter expressions, usually via the Stress-Energy Tensor
"""
from sympy import Array
from sympy.matrices import diag, zeros
from pystein import symbols
from pystein import constants
from pystein.metric import Metric
def vacuum(metric: Metric) -> Arr... |
#!/opt/local/bin/python
#-*- Encoding: UTF-8 -*-
import numpy as np
import blobtrail
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
import helper_functions
import geometry
def velocity_analysis(trails, frames, sol_px, rz_array, xyi):
"""
Study blob velocity dependence on cross-field... |
#%%
import matplotlib.pyplot as plt
import numpy as np
np_load_old = np.load
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)
hists = np.load('lagged_hists_ox.npy')
# restore np.load for future normal usage
np.load = np_load_old
print(hists.shape)
# Separate histograms from yields
lagged_h... |
<filename>BirdSongToolbox/PreProcessClass.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
from scipy.signal import hilbert
from functools import wraps
import numpy as np
import decorator
from .PreProcTools import bandpass_filter, bandpass_filter_causal, Create_Bands, Good_Channel_Index
# Master Func... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 04 23:27:43 2015
@author: Richard
"""
import itertools
import re
import sympy
import timeit
from sympy.core.cache import clear_cache
from sympy_helper_fns import is_equation
### Plain sympy functions
def subs1(expr, to_sub):
''' Given an equati... |
import statistics as s
def classify_data(data, rate=10000):
"""
Return 'left', 'right', or None.
"""
streaming_result = streaming_classifier(data, rate)
def streaming_classifier(wave_data, samp_rate, threshold_events=500):
window_size = samp_rate
test_stat = s.stdev(wave_data)
... |
<gh_stars>0
import numpy as np
from scipy import stats
def generate_boot_samples(x, n_samples, estimator):
n = x.size
e_arr = np.zeros(n_samples)
for i_iteration in range(n_samples):
i_boot = np.random.randint(0, n, size=x.shape)
x_boot = x[i_boot]
e_arr[i_iteration] = estimator(x_... |
<filename>randomForest_tutorials/_src_1core_1tree/scdataset_image.py
"""
Created on Tue Oct 14 18:52:01 2014
@author: Wasit
"""
import numpy as np
import os
from PIL import Image
from scipy.ndimage import filters
try:
import json
except ImportError:
import simplejson as json
rootdir="../dataset"
mrec=64
mtran=... |
import warnings
import logging
import numpy as np
from scipy import ndimage
from ..masks import slice_image, mask_image
from ..find import grey_dilation, drop_close
from ..utils import (default_pos_columns, is_isotropic, validate_tuple,
pandas_concat)
from ..preprocessing import bandpass
from ..r... |
<gh_stars>0
"""/**
* @author [<NAME>]
* @email [<EMAIL>]
* @create date 2020-05-22 11:59:29
* @modify date 2020-05-26 16:20:49
* @desc [
SC_EndGame utility methods:
- Format score
- Returns user score
- Relative score message
- High score message
-
]
*/
"""
##########
# Imports
########... |
# Adapted from https://github.com/amarquand/nispat/blob/master/nispat/bayesreg.py
from __future__ import print_function
from __future__ import division
import numpy as np
from scipy import optimize, linalg
from scipy.linalg import LinAlgError
class BLR:
"""Bayesian linear regression
Estimation and pred... |
'''Implementation of the umap task simulator'''
from functools import partial
import numpy as np
import scipy.stats as ss
import scipy.io
import math
import gym
from gym import spaces
from stable_baselines3 import PPO
import elfi
from sklearn.datasets import load_digits
from sklearn.model_selection import train_tes... |
<reponame>siej88/FuzzyACO
# -*- coding: utf-8 -*-
"""
UNIVERSIDAD DE CONCEPCION
Departamento de Ingenieria Informatica y
Ciencias de la Computacion
Memoria de Titulo Ingenieria Civil Informatica
DETECCION DE BORDES EN IMAGENES DGGE USANDO UN
SISTEMA HIBRIDO ACO CON LOGICA DIFUSA
Autor: <NAME>
Patrocinante:... |
<gh_stars>1-10
"""
"""
from __init__ import *
from scipy import sparse
from annoy import AnnoyIndex
def build_knn_map(X, metric='euclidean', n_trees=10, verbose=True):
"""X is expected to have low feature dimensions (n_obs, n_features) with (n_features <= 50)
return:
t: annoy knn object, can be used ... |
<gh_stars>0
#Author: <NAME>
#Email: <EMAIL>, <EMAIL>
#copyright @ 2018: <NAME>. All right reserved.
#Info:
#main file to solve multi-stage DEF of CBM model by using linearization and solver
#
#Last update: 10/18/2018
#!/usr/bin/python
from __future__ import print_function
import sys
import cplex
import itertools
impo... |
<filename>tools/gmm.py<gh_stars>1-10
#!/usr/bin/env python3
# Gaussian Mixed Model tutorial
import math, random
import numpy as np
from scipy.stats import norm
import matplotlib.pyplot as plt
from numpy.linalg import cholesky
def generate_data(mu, sigma, num_sample):
R = cholesky(sigma)
return np.dot(np.rand... |
# -*-coding:utf8;-*-
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy.sparse import (
load_npz,
isspmatrix_dok,
save_npz
)
from constants import (
FILES_PATH,
INDEX_TYPES,
MATCHING_ALGORITHMS,
MANHATTAN_DISTANCE,
METHODS,
REQUIRE_INDEX_TYPE,
SEARCH_METHO... |
from multiprocessing import Pool
import numpy as np
from scipy import sparse
from scipy.signal import butter, lfilter, freqz, iirnotch, filtfilt
from scipy.sparse.linalg import spsolve
def butter_lowpass(cutoff, fs, order=5):
nyq = 0.5 * fs
normal_cutoff = cutoff / nyq
b, a = butter(order, normal_cutoff, ... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
from __future__ import print_function
import collections
import acq4.analysis.atlas.Atlas as Atlas
import os
from acq4.util import Qt
import acq4.util.DataManager as DataManager
from acq4.analysis.atlas.AuditoryCortex.CortexROI import CortexROI
import numpy as np
import pyqtgrap... |
import warnings
import numpy as np
from joblib import Parallel, delayed
from scipy.stats.distributions import chi2
from scipy.stats.stats import _contains_nan
from sklearn.metrics import pairwise_distances
from sklearn.metrics.pairwise import pairwise_kernels
def contains_nan(a): # from scipy
"""Check if inputs... |
<gh_stars>0
# fmt: off
import os
import shutil
import warnings
from collections import Counter, namedtuple
from collections.abc import Iterable
from copy import copy, deepcopy
from itertools import chain, cycle
from pathlib import Path
import numpy as np
import pandas as pd
import toml
from plotly import express as px... |
<reponame>Warmshawn/CaliCompari
#!/usr/bin/env python
# encoding: utf-8
"""
helper.py
Created by <NAME> on 2011-09-23.
Copyright (c) 2011 All rights reserved.
Email: <EMAIL>
"""
import sys
import getopt
# import argparse
# parser.add_argument('foo', nargs='?', default=42)
import os
import glob
import numpy as np
im... |
<filename>ihna/kozhukhov/imageanalysis/gui/mapfilterdlg/ellipbox.py
# -*- coding: utf-8
from scipy.signal import ellip
from .filterbox import FilterBox
class EllipBox(FilterBox):
_filter_properties = ["broadband", "manual", "rippable", "self_attenuatable"]
def _get_filter_name(self):
return "ellip"... |
# Copyright (c) Missouri State University and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
import soundfile
import numpy as np
import librosa
import glob
import os
import noisereduce
from scipy import signal as sg
from sklearn.model_selection im... |
from django.db import models
from django.contrib.auth.models import User
from django.db.models.aggregates import Avg
from statistics import mean
from django.utils import timezone
from django.db.models.functions import Coalesce
from django.dispatch import receiver
from django.db.models.signals import post_save
from djan... |
<filename>openmdao.lib/src/openmdao/lib/surrogatemodels/kriging_surrogate.py
""" Surrogate model based on Kriging. """
from math import log, e, sqrt
# pylint: disable-msg=E0611,F0401
from numpy import array, zeros, dot, ones, eye, abs, vstack, exp, \
sum, log10
from numpy.linalg import det, linalg, l... |
<gh_stars>0
from __future__ import annotations
import re
from email.message import EmailMessage
from statistics import stdev, mean
from typing import List, Dict, Union, Tuple, Optional
from checks_interface import ChecksInterface
def find_invariant_cols(results: List[List[str]]) -> Dict[int, str]:
"""
This ... |
# ======================================================================
# Copyright CERFACS (February 2018)
# Contributor: <NAME> (<EMAIL>)
#
# This software is governed by the CeCILL-B license under French law and
# abiding by the rules of distribution of free software. You can use,
# modify and/or redistribute ... |
# -*- coding: utf-8 -*-
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import Qt
from tkinter import filedialog
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from scipy.interpolate import make_interp_spline, BSpline
from mpldatacurso... |
<reponame>Kolkir/superpoint<filename>python/src/homographies.py
# The code is based on https://github.com/rpautrat/SuperPoint/ that is licensed as:
# MIT License
#
# Copyright (c) 2018 <NAME> & <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docu... |
from __future__ import absolute_import, division, print_function
import numpy as np
import pandas as pd
import six
import scipy.optimize as spo
import pyswarm
import sklearn.base as sklb
import sklearn.metrics as sklm
import sklearn.utils.validation as skluv
class FunctionMinimizer(sklb.BaseEstimator):
def __ini... |
#
#
# cffnb.py
#
# Classification with Feedfoward Neural Network using Backpropagation
#
# Build a network with two hidden layers with sigmoid neurons and
# softmax neurons at the output layer. Train with backpropagation.
#
# Make up training, cross-validation and test data sets if you don't
# have some that you ... |
# The MIT License (MIT)
#
# Copyright (c) 2014 WUSTL ZPLAB
#
# 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, modif... |
import os
import warnings
import matplotlib.pyplot as plt
import numpy as np
import scipy.signal
from tensorflow import keras
from tensorflow.keras import backend as K
class LossHistory(keras.callbacks.Callback):
def __init__(self, log_dir):
import datetime
curr_time = datetime.datet... |
<reponame>galvisf/shaf-ida
"""Site specific hazard adjustment"""
import numpy as np
from scipy import stats as spst
from scipy import optimize as spop
from matplotlib import pyplot as plt
__author__ = '<NAME>'
class SiteAdjustment:
def __init__(self,surrogate=[],site=[]):
"""
__... |
<filename>time_track.py<gh_stars>0
"""
driver of the whole pipe line
for finding current sheet and null pts
"""
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
#import athena4_read as ath
import athena_read as ath
import scipy.ndimage.measurements as measurements
import scipy.ndimage.morphology a... |
import pysb.core
import pysb.bng
import numpy
import scipy.integrate
import code
try:
# weave is not available under Python 3.
from scipy.weave import inline as weave_inline
import scipy.weave.build_tools
except ImportError:
weave_inline = None
import distutils.errors
import sympy
import re
import iter... |
from scipy import sparse
import data_get
import numpy as np
if __name__ == '__main__':
matrix = np.array(
[[1, 0, 1, 0, 0, 0], [0, 1, 0, 0, 0, 0], [1, 1, 0, 0, 0, 0], [1, 0, 0, 1, 1, 0], [0, 0, 0, 1, 0, 1]])
my_matrix = sparse.csr_matrix(matrix)
my_matrix = my_matrix.astype(float)
u, s, vt = d... |
<reponame>AppliedMechanics-EAFIT/Mod_Temporal
# -*- coding: utf-8 -*-
"""
Interpolaciones para explicar el fenomeno de Runge
"""
from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import lagrange
import sympy as sym
plt.rcParams["axes.s... |
<gh_stars>1-10
from tensorflow.python.keras.models import Model, Input
from tensorflow.python.keras.layers import Dense, Flatten, Concatenate, Activation, Dropout
from tensorflow.python.keras.layers.convolutional import Conv2D, Conv2DTranspose, ZeroPadding2D, Cropping2D
from tensorflow.python.keras.layers.normalization... |
#!/usr/bin/env python
"""
Reads Calgary sCMOS .out timing files
tk0: FPGA tick when frame was taken. In this test configuration of internal trigger,
it basically tells you, yes, the FPGA is running and knows how to count. The FPGA
timebase could have large error (yielding large absolute time error) and yet
this column... |
# import section
import speech_recognition as sr
import datetime
import wikipedia
import webbrowser
import pyttsx3
import pywhatkit
import pyjokes
import rotatescreen
import os
import PyPDF2
from textblob import TextBlob
import platform
import calendar
import cowsay
from translate import Translator
import sounddevice
f... |
<gh_stars>1-10
import numpy as np
from sklearn.ensemble import GradientBoostingRegressor
import csv
# from sklearn.externals import joblib
import joblib
import lightgbm as lgb
from scipy import stats
import warnings
import os
import time
#get all *.csv files in given path
def get_all_csv_name(path):
filename_list ... |
<gh_stars>0
#!/usr/bin/env python3
import math
import tempfile
from dataclasses import dataclass
from pathlib import Path
from typing import Union
import copy
import numpy as np
from scipy.spatial.transform import Rotation as R
from urdfpy import URDF
import requests
import gym
from gym import spaces
from gym.utils... |
# Copyright (C) 2017 DataArt
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 26 14:38:40 2020
@author: thosvarley
"""
import numpy as np
from sklearn.cluster import k_means
from sklearn.decomposition import PCA
from scipy.spatial.distance import squareform, pdist
from scipy.stats import zscore, entropy
import igraph as ig
f... |
<gh_stars>0
import numpy as np
import sys
import re
from scipy.stats import ttest_ind
from scipy.stats import combine_pvalues
from scipy.stats import variation
from scipy.stats import chi2
from scipy.stats import rankdata
import pandas as pd
import ast
def isclose(a, b, rel_tol=1e-05, abs_tol=0.0):
return abs(a-b)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.