text string |
|---|
<reponame>alexburky/rflexa
import numpy as np
import obspy
from obspy.taup import TauPyModel
from scipy import signal
import os
import matplotlib
from matplotlib import rc
# matplotlib.use('Qt4Agg')
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
# This script makes a contour plot of receiver function data in ... |
<filename>cupydo/utilities.py
#! /usr/bin/env python
# -*- coding: utf8 -*-
'''
Copyright 2018 University of Liège
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/licen... |
<filename>post_proc/composition.py<gh_stars>1-10
'''
# This is an 80 character line #
What does this file do?
(Reads single argument, .gsd file name)
1.) Get center of mass
'''
import sys
import os
# Run locally
sys.path.append('/Users/kolbt/Desktop/compiled/hoomd-blu... |
"""ダイナミクスを導出"""
import sympy as sy
#from sympy import sqrt
import tqdm
import kinematics
import utils
def operate_T2(A):
"""T2演算"""
return A[0,0] + A[1,1]
def operate_V(A):
"""ベクトル化演算"""
V_A = A.reshape(len(A), 1)
return V_A
def operate_tilde(A):
"""行列の最後の列を0埋め"""
m, _ = A.shape
t... |
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
# Copyright (c) 2015, Gamelan Labs, Inc.
# Copyright (c) 2016, Google, Inc.
# Copyright (c) 2019, Gamalon, Inc.
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
# Redistribution and use in source and bi... |
<reponame>asenzz/cuosqp
# Test cuosqp python module
import cuosqp as osqp
from cuosqp._osqp import constant
from scipy import sparse
import numpy as np
from numpy.random import Generator, PCG64
# Unit Test
import unittest
class primal_infeasibility_tests(unittest.TestCase):
def setUp(self):
"""
Setup prim... |
<filename>beta_rec/data/deprecated_data.py<gh_stars>100-1000
import os
import random
from collections import defaultdict
from time import time
import numpy as np
import pandas as pd
import scipy.sparse as sp
from tabulate import tabulate
from ..data.base_data import BaseData
from ..datasets.data_load import (
loa... |
<filename>packnet_sfm/geometry/camera_fisheye_woodscape_utils.py
# Copyright 2020 Toyota Research Institute. All rights reserved.
import torch
import torch.nn.functional as funct
from scipy import optimize
from functools import lru_cache
from packnet_sfm.utils.image_valeo import centered_2d_grid
###################... |
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn.linear_model import SGDClassifier
from sentiment import classifier_path
from sklearn.preprocessing import scale
import pickle
from Base.utils import drange
from Base.vectorize import vectorize
from scipy.interpolate import interp1d
... |
<reponame>ajain-23/open_spiel<filename>open_spiel/python/algorithms/response_graph_ucb_utils.py
# Copyright 2019 DeepMind Technologies Ltd. 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 ... |
#!/usr/bin/python
# - * - coding: utf-8 - * -
from calibration import Calibration
from calibrate_point_manager import CalibratePointManager
from cell import Cell
from iwscanner import IWScanner
from fractions import Fraction
import decimal
import numpy as np
import sys
# np.mean(array)
# np.std(array)
Kd = 4
def euc... |
<filename>mogp_emulator/SequentialDesign.py
import numpy as np
from scipy.spatial.distance import cdist
from inspect import signature
from mogp_emulator.ExperimentalDesign import ExperimentalDesign
from mogp_emulator.GaussianProcess import GaussianProcess
from mogp_emulator.fitting import fit_GP_MAP
from numpy.linalg i... |
<filename>quadcopter/script/extras/sdre_real.py
#!/usr/bin/env python
import rospy
import tf
import scipy.linalg as la
import numpy as np
from math import *
import mavros_msgs.srv
from mavros_msgs.msg import AttitudeTarget
from nav_msgs.msg import Odometry
from std_msgs.msg import *
from geometry_msgs.msg import *
from... |
"""
Geometric Algebra (inherits Metric)
"""
import warnings
import operator
import copy
from collections import OrderedDict
from itertools import combinations
import functools
from functools import reduce
from sympy import (
diff, Rational, Symbol, S, Mul, Add,
expand, simplify, eye, trigsimp,
symbols, sqr... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""Final
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1mE5FnyUrUhJIQx-DieJJqfy_sazRreay
"""
from google.colab import files
import pandas as pd
import numpy as np
from sklearn import datasets, linear_model
import m... |
import json
import pandas as pd
from lightfm.data import Dataset
from lightfm import LightFM, lightfm
import numpy as np
import scipy.sparse as sp
import matplotlib
import matplotlib.pyplot as plt
from lightfm import LightFM
from lightfm.datasets import fetch_movielens
from lightfm.evaluation import auc_score, precis... |
# -*- coding: utf-8 -*-
#
# test_connect_fixed_total_number.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... |
<gh_stars>1-10
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy import asarray_chkfinite, single
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs
from scipy.lib.six import callable
__all__ = ['qz']
_double_precision = ['i... |
<reponame>RushabhVasani/math-hurdler
import random
from fractions import Fraction
class Question:
def __init__(self):
self.left_side = 0
self.right_side = 0
self.answer = 0
self.next()
def next(self):
self.populate_multiple_choice()
def populate_multiple_c... |
<reponame>yerseg/profiling_data_learning
import pandas as pd
import numpy as np
from datetime import datetime as dt
import scipy.stats as stats
from scipy.spatial import distance
from geopy.distance import distance as geodist
import argparse
import os
POWER_EVENTS_FILE_NAME = "power.data"
def generate_location_featu... |
<filename>workR/Optis_2.0/plotting.py
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import os
metrics = ["energy", "speed", "period", "length", "one leg stance phase",
"double support", "tot flight"];
def find(name, path):
for root, dirs, files in os.walk(path):
... |
"""Tools for estimation and analysis of Markovian milestoning models."""
import collections
import msmtools.estimation as estimation
import msmtools.util.types
import numpy as np
import scipy.spatial
import bkit.ctmc as ctmc
class MilestoneState(frozenset):
"""A milestone state identified by a pair of cells.
... |
from django.shortcuts import render
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import math
import h5py
import matplotlib.pyplot as plt
import scipy
from PIL import Image
from scipy import ndimage
import tensorflow as tf
from tensorflow.python.framework im... |
<filename>11) Text Classification.py
# Develop a text classifier to perform Sentiment ANalysis:
# Identify Good or Bad sentiment. Works for any category, as long as binary outcome (good or bad)
# features will be used to train. Label will be the output/result
import nltk
import random
from nltk.corpus import movie_rev... |
import pandas as pd
import numpy as np
import scipy.stats as stats
import os,re,sys
from collections import defaultdict
from collections import OrderedDict
from operator import itemgetter
from tempfile import *
from Bio.Seq import Seq
import datetime,time
from multiprocessing import Process,Pool,Manager,Value
SNVFILE=s... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import numpy as np
from pyiron_base import Settings
from sklearn.cluster import AgglomerativeClustering
from scipy.spars... |
'''
StationSim
author: aw-west
created: 19/06/18
version: 0.8.1
Changelog:
.0 merged models
.0 batch() moved to experiments
.0 separated figures
.1 checked figures and created experiment notebooks
.1 fixed _heightmap
Todo:
new entering
speeds[-1] separation drawn
set_pickle?
... |
import gcsfs
import pandas as pd
import numpy as np
import statistics as stats
from line_reader import LineReader
from table_identifier import TableIdentifier
from table_fitter import TableFitter
from pdf_annotator import PDFAnnotator
from doc_ai_parser import DocParser
from table_to_df import Table2Df
fs = gcsfs.GCS... |
import pickle, warnings, scipy
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from scipy.interpolate import interp1d
from scipy.stats import norm, multivariate_normal
from scipy.interpolate import griddata
from scipy.ndimage.filters import median_filter
from scipy.ndimage.mo... |
<gh_stars>100-1000
import numpy as np
import scipy.special
import scipy.ndimage.interpolation
import matplotlib
import astropy.io.fits as fits
import astropy.units as u
import warnings
import logging
from . import utils
from . import conf
from . import accel_math
from .poppy_core import OpticalElement, Wavefront, Base... |
import random, sys,os, json,logging, datetime, itertools
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
plt.switch_backend('Agg')
from numpy.linalg import norm
from actor import actor
from optparse import OptionParser
from scipy.stats import percentileofscore, scoreatpercentile,kruskal
from ... |
<reponame>muskanmahajan37/aa
"""
Functions remove the linear trend at each grid point for the period of
1979-2016.
Notes
-----
Author : <NAME>
Date : 4 February 2019
Usage
-----
detrendData(datavar,timeperiod)
detrendDataR(datavar,timeperiod)
"""
def detrendData(datavar,level,timeperiod):
... |
import numpy as np
from scipy.constants import *
import scipy.special
import scipy.integrate
import matplotlib.pyplot as plt
import math
L = 386*10**(-9)
C = 5.3*10**(-15)
Ec = e**2/(2*C)
Qzpf = np.sqrt(hbar/(2*np.sqrt(L/C)))
qzpf = Qzpf / (2*e)
Ej = 6.2 * 10**9 * hbar # investigheaza comportamentul pentru * 10 ** (... |
<gh_stars>0
import numpy as np
import quicklens as ql
import scipy
import config
r2d = 180./np.pi
d2r = np.pi/180.
#pass array of form [img_id,:,:,channel], return same array normalized channel wise, and also return variances
def normalize_channelwise(images):
# #remove mean per image
# for img_id in ra... |
#!/usr/bin/python3.7
# type: ignore
########################################################################################
# fitting.py - The parameter-fitting component for the model.
#
# Author: <NAME>
# Copyright: <NAME>, 2021
########################################################################################... |
<reponame>groutr/UTide
"""
Band-averaged spectral estimation for use in tidal error analysis.
There is only one function in this module that is imported by
other modules: `band_psd` (``ut_pdgm`` in the Matlab version), which
uses the residuals from the tidal fit to calculate power spectral
density averaged in bands ne... |
from discord.ext import commands
import ast
import numpy
import scipy
from utilities import checks
def setup(bot):
bot.add_cog(Matrix())
class Matrix(commands.Cog):
# TODO: move to converters file
class Matrix(commands.Converter):
async def convert(self, ctx, argument):
try:
return ast.literal_eval(a... |
<reponame>cmaclell/mendeley-paper-tagging<gh_stars>0
from flask import Flask, redirect, render_template, request, session
import yaml
from mendeley import Mendeley
from mendeley.session import MendeleySession
from sklearn.linear_model import LogisticRegression
from sklearn.svm import OneClassSVM
from sklearn.svm impo... |
<reponame>Christovis/wys-ars
import numpy as np
import pandas as pd
import xarray as xr
from scipy.spatial import cKDTree
from scipy.interpolate import RectBivariateSpline
import time
class Profiles3D:
def get_one_profile(
self, halo_idx: int, quantity: str = "mass", nbins: int = 20,
):
"""
... |
from autodc.components.feature_engineering.transformations.base_transformer import *
class FeatureRank(object):
"""This class implements the feature selection task. """
def nsav_caculation(self, data: DataNode):
X, y = data.data
from scipy import linalg
U, s, VT = linalg.svd(np.array(... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
from init_state import init_state
from quadEOM import quadEOM
from globals import flag, hover_t, hover_z, hover_x, hover_y
from globals import t, s
from globals import systemParameters
from globals import fort_t, fort_x, fort_y, ... |
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
from numbers import Real
import numpy as np
from scipy.interpolate import Rbf
from sklearn.utils import check_random_state
import torch
from torch.fft import fft, ifft
from torch.nn.functional import pad, one_hot
from mne.filter impor... |
try:
import scipy as sp
except Exception:
print 'Using Numpy instead of Scipy.'
import numpy as sp
from scipy import linalg
import pdb
import plinkio
from plinkio import plinkfile
import random
import numpy as np
import time
import gzip
import itertools as it
from sklearn import metrics
import getop... |
<reponame>abodacs/ExplainaBoard
import numpy as np
import os
import scipy.stats as statss
import scipy
from random import choices
from seqeval.metrics import precision_score, recall_score, f1_score
from collections import Counter
import string
import re
import argparse
import json
import sys
from typing import Any, Cla... |
#!/usr/bin/env python
import sys
from frovedis.exrpc.server import FrovedisServer
from frovedis.linalg import eigsh
from scipy.sparse import coo_matrix
desc = "Testing eigsh() for coo_matrix: "
# initializing the Frovedis server
argvs = sys.argv
argc = len(argvs)
if argc < 2:
print ('Please give frovedis_server ... |
"""
Two way BANOVA
"""
from __future__ import division
import numpy as np
import pymc3 as pm
import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('seaborn-darkgrid')
from scipy.stats import norm
from theano import tensor as tt
# THE DATA.
# Specify data source:
data_source = ["QianS2007" ,... |
<gh_stars>0
import numpy as NP
from astropy.io import fits
from astropy.io import ascii
from astropy import coordinates as coord
from astropy.coordinates import Galactic, FK5
from astropy import units
import astropy.cosmology as CP
import scipy.constants as FCNST
from scipy import interpolate
import matplotlib.pyplot a... |
"""Functions for DCE processing.
Created 15 October 2021
@authors: <NAME>
@institution: Barrow Neurological Institute
Translated from jupyter notebook DSCpipeline.ipynb by <NAME>
Functions:
estimate_delta_R1
signal_to_conc
tofts_model
fit_tofts
"""
import numpy as np
from scipy.optimize import curve... |
"""
test_pythonmpq.py
Test the PythonMPQ class for consistency with gmpy2's mpq type. If gmpy2 is
installed run the same tests for both.
"""
from fractions import Fraction
from decimal import Decimal
import pickle
from sympy.testing.pytest import raises
from sympy.external.pythonmpq import PythonMPQ
#
# If gmpy2 is... |
import tensorflow as tf
from tensorflow.python.ops import math_ops
import numpy as np
from tqdm import tqdm
from utils.progress import WorkSplitter, inhour
from scipy.sparse import vstack, hstack
class CDAE(object):
"""
Collaborative Denoiseing Auto-Encoders for Top-N Recommender Systems
"""
def ... |
<gh_stars>10-100
#
# Valuation of European call options
# in Black-Scholes-Merton model
# bsm.py
#
# (c) Dr. <NAME>
#
def bsm_call_value(S0, K, T, r, sigma):
''' Valuation of European call option in BSM model.
Analytical formula.
Parameters
==========
S0: float
initial stock/index level
... |
# coding: utf-8
#
# This code is part of dqmc.
#
# Copyright (c) 2022, <NAME>
#
# This code is licensed under the MIT License. The copyright notice in the
# LICENSE file in the root directory and this permission notice shall
# be included in all copies or substantial portions of the Software.
"""Tests for the main dqm... |
from __future__ import division, print_function, absolute_import
import scipy.special as sc
import numpy as np
from numpy.testing import assert_, assert_equal, assert_allclose
def test_zeta():
assert_allclose(sc.zeta(2,2), np.pi**2/6 - 1, rtol=1e-12)
def test_zetac():
# Expected values in the following wer... |
import pandas as pd
from scipy.spatial import distance
def _get_df_from_weight_vectors(weight_vectors):
return pd.DataFrame().reindex_like(weight_vectors)
def _calc_distances_vector_to_weight_vectors(vector, weight_vectors):
return weight_vectors.applymap(lambda x: _calc_vector_distance(x, vector))
def _c... |
<gh_stars>0
"""The :mod:`pyts.quantization` module includes quantization algorithms.
Implemented algorithms are:
- Symbolic Aggregate approXimation
- Multiple Coefficient Binning
- Symbolic Fourier Approximation
"""
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_f... |
<reponame>lefty71/open-nsynth-super<gh_stars>1000+
# Copyright 2017 Google 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
# https://www.apache.org/licenses/LICENSE-2.0
# Unless requ... |
# adapted from https://github.com/benmaier/reaction-diffusion/blob/master/gray_scott.ipynb
# based on http://karlsims.com/rd.html
# proposed setup to ignore margins: https://ipython-books.github.io/124-simulating-a-partial-differential-equation-reaction-diffusion-systems-and-turing-patterns/
import numpy as np
from t... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# ******************************************************... |
<filename>preprocessing.py<gh_stars>0
# based on https://github.com/dawenl/vae_cf
import os
import sys
import numpy as np
from scipy import sparse
import pandas as pd
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str)
parser.add_argument('--output_dir', type=str)
parser.ad... |
import pandas as pd
from my_functions import drawAll, transformLine, predict
from sympy.geometry import Point, Line
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
import progressbar
# Set the learning rate and the number of iterations
learning_rate = 0.01
nb_epochs... |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib.cm import get_cmap
import scipy.linalg as la
plt.rcParams['figure.figsize'] = [8, 8]
plt.rcParams.update({'font.size': 18})
sns.set_style("whitegrid")
np.set_printoptions(precision=3, linewidth=100) #, formatter={'float': '{: 0.... |
#-------------------------------------------------------------------------------
# Name: thickness_to_coordinates.py
# Purpose: Determine the 3rd Dimension for each 2D surface based on thickness
# and Determine the divisions of coordinates in material layers
# based on thickness pro... |
from codenames import *
from statistics import mean
test = input('What test do you want to run?').lower()
while test != 'quit' and test!='exit' and test!='q':
# Takes arbitrary reference word and list of words to test distance from
# list of words to reference word
if test == 'distance':
print... |
"""
Programmer: <NAME>
Purpose: A variety of tools for computing self-similarity matrices (SSMs)
and cross-similarity matrices (CSMs), with a particular
emphasis on speeding up Euclidean SSMs/CSMs.
"""
import numpy as np
import scipy.misc
import scipy.interpolate
import matplotlib.pyplot as plt
import SequenceAlignment... |
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 a... |
<gh_stars>1-10
#!/usr/bin/env python
import sys
import os
import numpy as np
import scipy.ndimage as nd
from astropy.io import fits as pyfits
def rfits(file):
f = pyfits.open(file, memmap=True)
hdu = f[0]
return hdu
def daofind(im):
mean = np.mean(im)
sig = np.std(im)
smooth = nd.gaussian_f... |
<filename>autoreglib/model_feature_reg.py
"""
モデルベース特徴量選択
教師あり学習モデルを用いて個々の特徴量の重要度を判断して、重要なものだけを残す方法。
特徴選択に使うモデルは最終的に使うモデルと同じでなくてもよい。
SelectFromModelは、フィッティング後に coef_ またはfeature_importances_属性を持つ推定器と一緒に使用できるメタ変換器。
coef_またはfeature_importances_の対応する値が、
指定されたしきい値パラメータを下回る場合、特徴は重要ではないとみなされ、削除されます。
しきい値を数値で指定する以外にも、... |
<filename>plotutils.py
from scipy import interpolate
import numpy as np
def roc_lininterp(x, y, length):
"""
interporlation of the bootstrap roc_curves
"""
f = interpolate.interp1d(x, y, kind='slinear')
xnew = np.linspace(0, 1, length)
return xnew, f(xnew)
def mean_roc_kfold(curveitms):
... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 23:31:19 2015
@author: willy
"""
import numpy as np
from scipy.integrate import quad
import scipy
import os
import matplotlib.pyplot as plt
from scipy.stats import kstest
from scipy.stats import chisquare
from mpl_toolkits.mplot3d.axes3d import Axes3D
... |
<filename>UserCode/John/ReWriteAcousticT0.py<gh_stars>1-10
from __future__ import division
import copy
import re
import numpy as np
import scipy.signal
from scipy import optimize
import matplotlib.pyplot as plt
def my_rms(arr):
#return np.sqrt(arr.dot(arr)/arr.size)
return np.std(arr)
def extend_window(w, r... |
# for random distributions, random number generators, statistics
import random
import numpy as np
import scipy.stats as stats
# for simulation
import simulus
random.seed(13579) # global random seed
def exp_generator(mean, seed):
rv = stats.expon(scale=mean)
rv.random_state = np.random.RandomState(seed)
w... |
import subprocess
from distutils.dir_util import copy_tree
import time
import h5py
import os
import numpy as np
from scipy.integrate import quad
from pymooIN import *
# from exectBatch import execSims
def runGen(x, gen):
global genDir, n_ind
n_ind = len(x)
genDir = './gen%i' % gen
###################... |
<reponame>jake100/Mathics<gh_stars>1-10
# -*- coding: utf8 -*-
"""
Special functions
"""
import sympy
import sympy.mpmath as mpmath
from mathics.builtin.base import Builtin
from mathics.builtin.arithmetic import _MPMathFunction
from mathics.core.expression import Integer
from mathics.core.numbers import mpmath2sympy... |
'''
This code is used to replot Figure 2 of the main text.
'''
# to make things py2 and py3 compatible
from __future__ import print_function, division
# major packages needed
import numpy as np
import os, sys
# some additional packages that are needed
from scipy import io, signal
from scipy.ndimage.filters import... |
<filename>src/evaluation/landing_eval.py<gh_stars>1-10
import numpy as np
import matplotlib.pyplot as plt
import airsim
import torch
from torchvision import transforms as T
import cv2
import time
import os
import segmentation_models_pytorch as smp
from PIL import Image
from scipy import stats
from collections import Co... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
Extraction of thumbs from sd09 dataset
"""
import os
import argparse
import shutil
import progressbar
import numpy as np
import matplotlib.pyplot as plt
import scipy
import scipy.signal
import scipy.ndimage
import scipy.spatial
import scipy.misc
from scipy.ndimage.filters ... |
<reponame>RunningPhoton/mfea-ii
from mtsoo import *
from cea import cea
from mfea import mfea
from mfeaii import mfeaii
from scipy.io import savemat
def callback(res):
pass
def main():
config = load_config()
functions = CI_HS().functions
for exp_id in range(config['repeat']):
print('[+] EA - %d/%d' % (ex... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 28 03:18:40 2020
@author: siddhesh
"""
from __future__ import print_function, division
import os
import sys
import time
import pandas as pd
import torch
import nibabel as nib
import numpy as np
import tqdm
from scipy.ndimage.morphology import binar... |
from pyjamas_core import Supermodel
from pyjamas_core.util import Input, Output, Property
from datetime import datetime, timedelta
from Models._utils.time import datetime2utc_time, utc_time2datetime
import numpy as np
from pytz import timezone
import json
from scipy.interpolate import griddata
import pandas as pd
impor... |
<filename>src/postABC.py
import numpy as np
from scipy import optimize
class ABCPostProcessor():
def __init__(self, data, sample_data, sample_parameters):
"""Create an instance of the ABCPostProcessor
Parameters
----------
data : array
data point for in... |
""" Fast multiscale clustering
Kushnir et al 2006 (K06)
"""
from __future__ import absolute_import
from __future__ import print_function
import itertools
import numpy as np
from scipy.spatial import cKDTree as KDTree
from scipy import sparse
from .InterpolationMatrix import interpolation_matrix
from six.moves impo... |
<reponame>shivangdubey/sympy<filename>sympy/sets/handlers/comparison.py
from sympy.core.relational import Eq, is_eq
from sympy.core.logic import fuzzy_and, fuzzy_bool
from sympy.logic.boolalg import And
from sympy.multipledispatch import dispatch
from sympy.sets.sets import tfn, ProductSet, Interval, FiniteSet
@dispa... |
<filename>rmgpy/pdep/network.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
#... |
<filename>plantcv/plantcv/morphology/segment_euclidean_length.py
# Find euclidean lengths of skeleton segments
import os
import cv2
import numpy as np
from plantcv.plantcv import params
from plantcv.plantcv import outputs
from plantcv.plantcv import plot_image
from plantcv.plantcv import print_image
from plantcv.plant... |
from __future__ import division, print_function
from scipy.optimize._numdiff import approx_derivative
from scipy.optimize import approx_fprime
import numpy as np
class _Common(object):
def __init__(self, fun, step=None, method='central', order=2,
bounds=(-np.inf, np.inf), sparsity=None):
... |
"""
DistFitting
=====
Provides
1. A data Normalizer
2. A data discretizer
3. Goodness of fit tests between two continuous data distributions
----------------------------
Documentation is available at github.
"""
import pandas as pd
import scipy.stats as scp
import scipy.stats
import scipy
import numpy as np
i... |
# Copyright 2020 Google 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... |
<reponame>belkhir-nacim/Fast-AutoAugment-Segmentation<filename>FastAutoAugment/joint_transform.py<gh_stars>0
"""
# Code borrowded from:
# https://github.com/zijundeng/pytorch-semantic-segmentation/blob/master/utils/joint_transforms.py
#
#
# MIT License
#
# Copyright (c) 2017 ZijunDeng
#
# Permission is hereby granted, ... |
import numpy as np
import scipy.misc
import matplotlib.pyplot as plt
import sys
sys.path.append('../../')
from proximal import *
input = scipy.misc.face()
input = input[:512, :512, :]
mosaic = np.zeros((input.shape[0], input.shape[1]))
mosaic[1::2,1::2] = input[1::2,fc00:e968:6179::de52:7100, 0]
mosaic[0::2,1::2] ... |
<gh_stars>0
# ---
# jupyter:
# jupytext:
# formats: ipynb,py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# +
# ... |
from sympy import *
x = symbols("x")
function = sin
func = function(x)
a = -1
b = 1
def zero_pow():
func_diff = lambdify(x, diff(func), 'numpy')
possible_points_raw = solve([Eq(func)], [x])
possible_points = [a, b]
for i in range(len(possible_points_raw)):
if possible_points_raw[i][0] > a and possible_points_ra... |
<reponame>AndresSixtos/pyeBOSS
#! /usr/bin/env python
"""
This script fits emission lines on a stacked spectrum
"""
import os
import glob
import numpy as n
import astropy.io.fits as fits
import matplotlib.pyplot as p
# import the fitting routines
import LineFittingLibrary as lineFit
from scipy.interpolate import inter... |
import numpy as np
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import scipy
from scipy.interpolate import griddata
from scipy.ndimage import convolve
import cv2
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
from scipy.ndimage import... |
<reponame>ecsbeats/qhbm-library<filename>tests/inference/vqt_loss_test.py
# Copyright 2021 The QHBM Library 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
#
# ... |
#!/usr/bin/env python3
from tqdm import tqdm, trange
import os.path, os
import numpy as np
import pandas as pd
from numpy import array as arr
from glob import glob
from scipy import signal, stats
from scipy.interpolate import splev, splrep
from scipy.spatial.distance import cdist
from scipy.spatial import cKDTree
from... |
<filename>Chapter 13/04 Choosing activation functions for multilayer neural networks/program.py
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
from scipy.special import expit
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
# Choosing activation functions for multilayer neural networks
... |
<reponame>turbach/challenge1<filename>challenge1.py
'''coding challenge ... speed up an inefficient function
1. set up a git repo for this challenge ... download or fork
2. get oriented ...
* first run this script as a demo a couple times without change and study the plot
* read the slow_scan() docstring and c... |
import numpy as np
import scipy.integrate
def test_outlier(out, asd, edge_thresh, over_thresh, tw_mean, tw_std):
#checks whether an outlier is an actual outlier or not. out is of class .outlier.outlier
#asd is of class .density.approximate_esd
# function returns a Boolean whether an outlier or not, and ret... |
import pickle
import unittest
import numpy
import pytest
try:
import scipy.sparse
except ImportError:
pass
import cupy
from cupy import testing
from cupy import cusparse
from cupyx.scipy import sparse
if cupy.cuda.runtime.is_hip:
pytest.skip('HIP sparse support is not yet ready',
allow_m... |
<reponame>mikehulluk/morphforge<filename>src/morphforge/traces/methods/trace_methods_std_math.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 <NAME>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.