text string |
|---|
<reponame>hossein1387/random_sw_experiments
import numpy as np
import scipy.signal
import matplotlib.pyplot as plt
from skimage import io, color
from skimage import exposure
img = io.imread('lena_gray.jpg') # Load the image
img = color.rgb2gray(img) # Convert the image to grayscale (1 channel)
# apply sharpen ... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 01 00:39:44 2018
@author: punck
"""
import numpy as np
import scipy.stats as ss
import pandas as pd
class Generator:
"""A random dataset generator class"""
def Binomial(self, n, p, size):
"""
Dataset of random binomial variables with probab... |
import numpy as np
import pandas as pd
from scipy.io import arff
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from tqdm import tqdm
class DimensionValueError(ValueError):
pass
class TypeError(ValueError):
pass
class IterError(ValueError):
pass
class DataProcess:
... |
<filename>simulation.py
import pandas as pd
import os
import numpy as np
import datetime
from datetime import timedelta
from pandas.tseries.offsets import DateOffset
from dateutil.relativedelta import relativedelta
import math
from collections import defaultdict
import sklearn as sk
from sklearn.preprocessing... |
<reponame>sholloway/agents-playground
# Run With:
# poetry run python ./benchmarks/scheduler.py
# Debug With:
# PYTHONBREAKPOINT="pudb.set_trace" poetry run python -X dev ./benchmarks/scheduler.py
from __future__ import annotations
from dataclasses import dataclass, field
import logging
import random
from statistics... |
<reponame>YuzhongHuangCS/journal-citation-cartels
#!/usr/bin/env python
# coding: utf-8
import warnings
warnings.simplefilter(action="ignore")
import sys
import pandas as pd
import numpy as np
from scipy import sparse
import utils
import json
import py2neo
def count_citations_papers_within_group(journal_ids, year):
... |
<gh_stars>1-10
import numpy as np
from scipy.sparse import random
from scipy.linalg import svd
import pytest
from pylspack.linalg_kernels import csrjlt
m_values = list(range(113, 1100, 231))
n_values = [int(np.ceil(_m / _i)) for _i, _m in enumerate(m_values, start=2)]
density = [0.05, 0.1, 0.3]
csrjlt_matrices = [
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 14:06:09 2020
@author: u6265553
"""
'''This script generates the inverse transformation function required
for moving lens shift-scale calibration to align the synthetic images
generated by Blender to a reference image to obtain fully in-focus image
applyi... |
import numpy as np
import networkx as nx
from features_infra.feature_calculators import NodeFeatureCalculator, FeatureMeta
class HierarchyEnergyCalculator(NodeFeatureCalculator):
def is_relevant(self):
# TODO: finish this calculator
return False
def _calculate(self, include: set):
... |
#!/usr/bin/env python
import sys
sys.path.append('/root/caffe/python')
import caffe
import numpy as np
from PIL import Image
import os
import time
import cv2
import numpy as np
import scipy as sp
import scipy.ndimage
import socket
import socketserver # socketserver in Python 3+
import time
from queue import Queue
from... |
import folium
import geopy.distance
import math
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import butter,filtfilt,sosfilt
import os
import sys
import time
import serial
from pathlib import Path
Path(__file__).parents[1]
cwd = os.getcwd()
input_file_path = str(Path(__file__).parents[1]) + '\P... |
import numpy as np
import scipy.io
min_coord = 105
range__ = 285
def average_val_R_table_deck(deck):
sum_reward = 0
sum_angle = 0
for e in deck:
sum_reward += e[0]
sum_angle += e[1]
return (sum_reward / len(deck), sum_angle / len(deck))
def Approximate_R_value(X, Y, R_table):
... |
# Copyright 2020 <NAME>
#
# 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 wr... |
<gh_stars>0
"""
The code takes in the image list and generated perturbation and calculates the
fooling rate and classification accuracy on the ILSVRC validation set (50K images)
"""
from nets.vgg_f import vggf
from nets.caffenet import caffenet
from nets.vgg_16 import vgg16
from nets.vgg_19 import vgg19
from nets.goog... |
import os
import sys
import torch
import pickle
import argparse
import warnings
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import sklearn as skl
import tensorflow as tf
from scipy.stats import gamma
from callbacks import RegressionCallback
from regression_data import generate_toy_data
from ... |
<gh_stars>1-10
import warnings
import numpy as np
from scipy import stats
DISTRIBUTIONS = [stats.alpha, stats.anglit, stats.arcsine, stats.argus, stats.beta, stats.betaprime, stats.bradford, stats.burr, stats.burr12, stats.cauchy, stats.chi, stats.chi2, stats.cosine, stats.crystalball, stats.dgamma, stats.dweibull, s... |
#!/usr/bin/env python3
import numpy as np
import scipy.signal as sig
import numpy.ma as ma
from longslit.pipeline import *
import scipy.optimize as opt
from matplotlib import pyplot as plt
from itertools import *
def all_together_now(neon, ref_neon):
'''На выходе - "карта интерполяции" на линейную по длинам волн... |
<reponame>cjauvin/RavenPy
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 29 09:16:06 2015
@author: <NAME>
"""
from typing import Tuple
import numpy as np
from scipy.stats import norm
# TODO: This utility is written in python2 and will fail in python3 (e.g. no xrange)
def mk_test_calc(x: np.array, alpha: float = 0.0... |
<gh_stars>0
"""
Sandbox of new developments
Use at your own risks
Photometric package using Astropy Units
=======================================
Defines a Filter class and associated functions to extract photometry.
This also include functions to keep libraries up to date
.. note::
integrations are done usin... |
# FT_connect_functions
from __future__ import print_function
import numpy as np
import time, os, sys
import matplotlib.pyplot as plt
from scipy import ndimage as ndi
from skimage import color, feature, filters, io, measure, morphology, segmentation, img_as_ubyte, transform, registration
import warnings
import math
imp... |
<filename>BathymetryMap.py
# BathymetryMap.py
#
# Class for parsing and querying bathymetric data
# 2020-07-10 <EMAIL> initial implementation
import seaborn as sns
import numpy as np
import datetime
import rasterio as rio
import importlib
import earthpy as et
import earthpy.plot as ep
import scipy
import... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 9 09:07:48 2021
@author: <NAME>
"""
#=================================
#prepare
import numpy as np
import openpnm as op
import matplotlib.pyplot as plt
import scipy as sp
import openpnm.models as mods
import openpnm.io.VTK as iovtk
from bimodal_distribut... |
from __future__ import absolute_import
from ._registration import _L1_moments
import numpy as np
from scipy.ndimage import gaussian_filter
TINY = float(np.finfo(np.double).tiny)
SIGMA_FACTOR = 0.05
# A lambda function to force positive values
nonzero = lambda x: np.maximum(x, TINY)
def correlation2loglikelihood(rh... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
@author: Sebastian,Casper
"""
import logging
import matplotlib.pyplot as plt
import caiman as cm
import caiman.motion_correction
from caiman.motion_correction import MotionCorrect, high_pass_filter_space
from caiman.source_extraction.cnmf import params as params
from caiman.mmap... |
from __future__ import division, print_function
import glob
import numpy as np
from scipy import interpolate as interp
from scipy.ndimage import filters as filter
try:
from enterprise.pulsar import Pulsar
ent_present = True
except ImportError:
ent_present = False
fyr = 1./31536000.
# from Kristina
def... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import nipype.interfaces.fsl as fsl # fsl
from nipype.algorithms.misc import TSNR
import nipype.interfaces.utility as util # utility
import nipype.pipeline.engine as pe # pypeline eng... |
"""
Functions for creating the standard sets of matrices in the standard, Pauli, Gell-Mann, and qutrit bases
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the ter... |
import numpy as np
from . import usefuls
from scipy.signal import fftconvolve
from skimage import morphology
def spa_np(data, xth=0.95, nscales=30, binning='log'):
"""
@Zahn et al. (2007)
"""
Rmx = data.shape[0]
if binning=='linear': Rs_ = np.linspace(1,Rmx/2.,nscales)
else: Rs_ = np.exp(np.linspace(np.log(2.),n... |
<filename>solver/spectrum.py
import math
from rfsampler import GaussianRF
import torch
from timeit import default_timer
import scipy.io
# w0: initial vorticity
# f: forcing term
# visc: viscosity (1/Re)
# T: final time
# delta_t: internal time-step for solve (descrease if blow-up)
# record_steps: number of in-time ... |
import os
import sys
import psutil
if len(sys.argv) > 1:
scores = sys.argv[1]
os.environ['MKL_NUM_THREADS'] = scores
os.environ['OMP_NUM_THREADS'] = scores
os.environ['NUMBA_NUM_THREADS'] = scores
cpu_count = int(scores)
thread_count = int(scores)
else:
cpu_count = psutil.cpu_count(logical=... |
<filename>gmg/gmg.py
"""
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
GUI application for Forward modelling 2D potential field profiles.
Written by <NAME>, University of Oxford 2015-17. SIO 2018-19.
Includes ability to import seismic reflection... |
import numpy as np
import nibabel as nib
from scipy.ndimage import zoom
from glob import glob
def resize(plane):
x, y, z = plane.shape
return zoom(plane, (181.0/x, 217.0/y, 181.0/z))
def get_AD_risk(raw):
x1, x2 = raw[0, :, :, :], raw[1, :, :, :]
risk = np.exp(x2) / (np.exp(x1) + np.exp(x2))
retur... |
<reponame>FortinLab/Shahbaba_et_al_2021<gh_stars>1-10
import numpy as np
import scipy.stats
import argparse
from utils import data_utils
import pylab
import os
import pickle
def rgb_to_hex(rgb_val):
hexVal = '#%02x%02x%02x' % (rgb_val[0], rgb_val[1], rgb_val[2])
return hexVal
def mean_sem_confidence_inter... |
<filename>DaVE/dave/mlingua/vloggenerator.py
# Verilog model generator of PWL filter model
import sys
import os
import numpy as np
import scipy.interpolate
import shutil
import subprocess
import string
import random
import time
from empyinterface import EmpyInterface
from pwlbasisfunction import PWLBasisFunctionExpr
... |
from itertools import chain
import scipy
import torch.optim as optim
from progressbar import ETA, Bar, Percentage, ProgressBar
from dataset import *
from discogan_arch_options.options import Options
from model import *
class DiscoGAN(object):
def as_np(self, data):
return data.cpu().data.numpy()
d... |
<reponame>JacobDowns/filterpy
import numpy as np
from itertools import combinations, product
from scipy.misc import comb
def generate_fully_symmetric_set(n, vals):
"""
Generates a fully set of symmetric points of dimension n with
values given in vals.
Parameters
----------
n: int
D... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 20 11:20:30 2020
@author: yuhanyao
"""
##### radioactivity: Arnett model
import os
import sys
sys.path.append("/scratch/yyao/AT2019dge/playground/")
sys.path.append("/Users/yuhanyao/Documents/GitHub/AT2019dge/playground/")
import time
import numpy a... |
import random, math
from copy import deepcopy
from operator import attrgetter
from scipy.stats import norm, rv_discrete
import numpy as np
class ACOR:
def __init__(self, obj, dimension, **kwargs):
# Parameters for objective function
self.obj = obj
self.dimension = dimension
self.m... |
<reponame>apohl79/AudioTK<filename>Examples/EQ/compare_chebyshev.py
#!/usr/bin/env python
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
b, a = signal.cheby2(5, 3, (200./24000, 1000./24000), btype="bandstop")
print b, a
myb = (0.970480608569324, -9.674889407346342, 43.43258097823774, -11... |
<reponame>asplos2020/DRTest<gh_stars>1-10
#Guiding Deep Learning System Testing using Surprise Adequacy, https://arxiv.org/pdf/1808.08444.pdf#
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import gc
impor... |
<filename>sntools/formats/princeton.py
"""Parse Princeton fluxes.
For simulations by <NAME> al., arXiv:1804.00689
and later re-runs by <NAME>.
Format:
time, dL/dE (nu_e), dL/dE (anti-nu_e), dL/dE (nu_x)
where the spectral luminosity is split in 20 energy bins per flavor.
See parsing code below for details.
"""
from s... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
module to fit 2d value in array
still in development for fit of multiple peaks in ROI
"""
import pylab as p
import numpy as np
from scipy import optimize, stats
# from matplotlib.ticker import FuncFormatter
try:
from lauetools import generaltools as GT
except:
import... |
"""
Apply mask to the coseismic displacement
input data - geo_maskTempCoh.h5 (mintpy result)
coseismic_disp.mat
created by <NAME>
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import h5py
import scipy.io as sio
import sys
# load the coseismic_disp.mat file
mat_ts = sio.loadmat('cosei... |
#!/usr/bin/env python
import numpy as np
import pandas as pd
import click as ck
from sklearn.metrics import classification_report
from sklearn.metrics.pairwise import cosine_similarity
import sys
from collections import deque
import time
import logging
from sklearn.metrics import roc_curve, auc, matthews_corrcoef
from... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib.colors import is_color_like
from collections.abc import Iterable
import matplotlib.lines as mlines
import scipy.stats as st
import warnings
def _assert_plot_defaults(twotailed=True, difference_cutoff=.1, differentcolor='red', diffe... |
import os
import numpy as np
from scipy import interpolate
from scipy.spatial import Delaunay
from netCDF4 import Dataset
from ttide.t_getconsts import t_getconsts
from ttide.t_vuf import t_vuf
from matplotlib.tri import Triangulation
from ttide.t_predic import t_predic
from vcmq import regrid2d,create_grid,MV2,set_gri... |
import numpy as np
import scipy.cluster.hierarchy as shc
from sklearn.cluster import AgglomerativeClustering
import matplotlib.pyplot as plt
def shadederrorplot(x, y, ax=None, err_method='stderr', plt_args={}, shade_args={}, nan_policy='omit'):
'''
Parameters
----------
x : shape (time,)
y : shape ... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License-NC
# See LICENSE.txt for details
#
# Author: <NAME> (<EMAIL>)
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import ... |
<reponame>stephenhelms/statstools
import numpy as np
import numpy.ma as ma
from numpy import linalg as LA
from scipy import stats
import matplotlib.pyplot as plt
import seaborn as sns
import tsstats # stephen's library
'''
Example usage:
Starting with an nObservation x nVar time series Y.
Test orders:
Shows the R2 v... |
<gh_stars>10-100
import numpy as np
from keras.models import load_model
from cleverhans import utils
from random import randrange
from os import walk
import re
import scipy.io
from numpy import genfromtxt
import sys
import csv
from scipy import signal
def preprocess(x, maxlen):
x = np.nan_to_num(x)
... |
import sys
# Tensorflow
import tensorflow as tf
print(tf.__version__)
hello = tf.constant('TensorFlow ok')
sess = tf.Session()
print(sess.run(hello))
print("Tensorflow ok")
# Keras
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional impo... |
import numpy as np
from scipy.linalg import lu_factor, lu_solve
from scipy import sparse
from scipy.sparse import linalg as sp_linalg
from .defs import System, TrajectoryResult, SystemResult, StatePair, SystemCache
from collections import namedtuple
import logging
import time
from numba import jit
import itertools
impo... |
<reponame>EMBEDDIA/elmogan<gh_stars>0
import tensorflow as tf
from keras.models import Model
from keras.layers import Dense, Input, Concatenate, BatchNormalization, LeakyReLU
from tensorflow.keras import optimizers
import keras.backend as K
import random
from tensorflow.keras import metrics, losses
import numpy as np
i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 <NAME>
# 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... |
<filename>Algorithms/math_comb_supermarket.py
from fractions import gcd
def lcm(a,b):
return a / gcd(a,b) * b
n = input()
bitcount = [0]*(1<<n)
lcms = [1]*(1<<n)
for i in xrange(n):
a = input()
for j in xrange(1<<i):
lcms[(1<<i)|j] = lcm(a, lcms[j])
bitcount[(1<<i)|j] = bitcount[j] + 1
d... |
import numpy as np
from scipy.integrate import solve_ivp
# %% DESCRIPTION OF THE MODULE
"""
This file contains the Equations of the Tank of the rocket. These will
be integrated using the Runge-Kutta 4th order method.
"""
def DensityDerivative(t, y, rho, v_nozzle, d, m_0):
drhodt = -(rho**2*v_nozzle*np.pi*d**2/4)... |
<reponame>jdammers/mne-python<gh_stars>0
# Authors: <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import numpy as np
from scipy import linalg
from ..defaults import _handle_default
from ..fixes import _safe_svd
from ..utils import warn, logger
# For the reference implementation of eLORETA (force_equal=False),
# 0 <... |
<filename>vec2vec/exp/testNode2vec.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## For Testing Matrix2vec on dataset MNIST
## PCA, Kernel PCA, ISOMAP, NMDS, LLE, LE
import logging
import os.path
import sys
import multiprocessing
import numpy as np
import argparse
import scipy.io
import datetime
import vec2vec.ma... |
#!/usr/bin/env python3
from collections import defaultdict as dd
from collections import Counter
import os
import pysam
import argparse
import pandas as pd
import numpy as np
import scipy.stats as ss
import gzip
class Read:
def __init__(self, read_name, cpg_loc, llr, cutoff=2.5, phase=None):
self.read... |
<reponame>PavloWasTaken/ProjectEyeliner
import cv2
import matplotlib.pyplot as plt
from matplotlib import transforms
import numpy as np
from Objects.ImageSegmentationClass import ImageSegmentationClass
from Objects.LayerClass import LayerClass
from Objects.ResultClass import ResultClass
from Utils import utils
from sci... |
<reponame>scottwedge/payscale-course-materials
"""Examples of using clustering algorithms on network traffic data."""
import numpy as np
import sklearn
import matplotlib.pyplot as plt
from sklearn import cluster, mixture
from scipy import stats
plt.style.use('ggplot')
# simulate hourly network traffic data over 2 ... |
#!/usr/bin/env python3
import os
import sys
import time
import matplotlib.pyplot as pl
import statistics
import glob
def plot(data, metric, topology, ylabel):
pl.figure(figsize=(5, 4))
x = range(2)
barlist = pl.bar(x, data, width=0.4)
barlist[0].set_color("orange")
barlist[1].set_color("navy")
... |
"""
Copyright 2021 <NAME>.
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, software
distribute... |
from __future__ import absolute_import, division, print_function
import argparse
from collections import OrderedDict
import csv
import logging
import os
import random
import sys
import pandas as pd
import numpy as np
import torch.nn as nn
import torch
import torch.nn.functional as F
from torch.utils.data import (Data... |
import numpy as np
from galpy.potential import NFWPotential
from galpy.potential import MiyamotoNagaiPotential
from galpy.potential import PowerSphericalPotentialwCutoff
from galpy.potential import evaluateDensities
from scipy.optimize import minimize
def minimize_function(x, rho_nfw_target, rho_midplane_target, dens... |
<filename>genesis/length_scales/variability.py
"""
Methods for quantifying coherent length-scales in the convection boundary-layer
"""
import numpy as np
from scipy import ndimage
from tqdm import tqdm
from genesis import utils
model_name = "uclales"
case_name = "rico"
def _patch_average_splitting(d, s, shuffle_ma... |
<reponame>Annarien/GravitationalLensesResources
import numpy
def SimpleSample(pars,costs,deterministics,niter,cov=None,jump=None):
if jump is None:
stretch,offset = 3.3,3.
else:
stretch,offset = jump
nvars = len(pars)
niter = int(niter)
trace = numpy.empty((niter,nvars))
logps =... |
import copy
import numpy as np
# sympy order matters; it overrides scipy (???)
import sympy as sym
import scipy
import scipy.signal
import scipy.integrate
from scipy.linalg import solve_continuous_are
from matplotlib import pyplot as plt
# define constants
M = sym.Symbol("M")
m1 = sym.Symbol("m1")
m2 = sym.Symbol("m2"... |
# Program to perform linear convolution
import numpy as np
import scipy as sy
from matplotlib import pyplot as plt
# impulse response
h = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
# input response
x = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
N1 = len(x)
N2 = len(h)
N = N1 + N2 - 1
y = np.zeros(N)
# x = [[x],[np.zeros(... |
<reponame>AntoineSIMTEK/NuMPI<gh_stars>1-10
#
# Copyright 2020 <NAME>
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation t... |
<reponame>teanoice/RESEARCH-QD-ELECTRA<filename>classify.py
# Copyright 2018 <NAME>, <NAME>.
# (Strongly inspired by original Google BERT code and Hugging Face's code)
""" Fine-tuning on A Classification Task with pretrained Transformer """
import itertools
import csv
import fire
import json
import numpy as ... |
## Xilun: Need modify this file
## copied from data_loader.py
import os
from tempfile import NamedTemporaryFile
import librosa
import numpy as np
import scipy.signal
import torch
import torchaudio
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
import time
import json
import argparse
imp... |
<reponame>AstraZeneca-NGS/LogMl
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import scipy
import seaborn as sns
from ..core.files import MlFiles
from ..core.scatter_gather import scatter, scatter_all, gather
from ..util.etc import array_to_str
class FeatureImportanceModel(MlFiles):
"""
... |
"""
Labelling performs a vector search on the labels and fetches the closest
max_number_of_labels.
"""
from copy import deepcopy
from typing import Any, Dict, List
from relevanceai.operations_new.base import OperationBase
class LabelBase(OperationBase):
def __init__(
self,
vector_field: str,
... |
# -*- coding: utf-8 -*-
# Author: yongyuan.name
import os
import scipy.spatial.distance
import tensorflow as tf
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
# from extract_cnn_densenet_keras import DenseNETMAX
import numpy as np
import h5py
from util import utils
# import... |
<reponame>aymericvie/evology<filename>gp_trading/gp_demo.py
import operator
import math
import numpy as np
from deap import algorithms
from deap.algorithms import varAnd
from deap import base
from deap import creator
from deap import tools
from deap import gp
import warnings
import scipy
from math import isnan
import s... |
"""Tests for parabolic cylinder functions.
"""
from numpy.testing import assert_allclose
import scipy.special as sc
def test_pbwa_segfault():
# Regression test for https://github.com/scipy/scipy/issues/6208.
#
# Data generated by mpmath.
#
w = 1.02276567211316867161
wp = -0.488870533723461898... |
<gh_stars>0
import numpy as np
import scipy.stats as stats
class MultiArmedBandit:
"""Define a simple implementation of Multi-Armed Bandit with a Beta distribution.
Based on https://peterroelants.github.io/posts/multi-armed-bandit-implementation/
"""
def __init__(self, n_bandits, reshape_factor=1,... |
<reponame>Astech34/pymms<gh_stars>1-10
import glob
import os
import io
import re
import requests
import csv
import pymms
from tqdm import tqdm
import datetime as dt
import numpy as np
from cdflib import epochs
from urllib.parse import parse_qs
import urllib3
import warnings
from scipy.io import readsav
from getpass imp... |
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import numpy as np
from sklearn.datasets import make_classification
import pandas as pd
import seaborn as sns
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from IPython import display
from sklearn import metr... |
'''
graph_group_links_by_taxonomy.py -
======================================================
:Author: <NAME>
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
.. todo::
describe purpose of the script.
Usage
-----
Example::
python graph_group_links_by_taxonomy.py --help
Type::
python gra... |
"""
Utilities for plotting various figures and animations.
"""
# Author: <NAME> <<EMAIL>>
#
# License: TBD
import numpy as np
import matplotlib.pylab as plt
import collections
from scipy import signal
def dot_plot(x, labels, step=1, figsize=(12,8)):
"""
Make a 1D dot plot.
Inputs
x : 1D ... |
<reponame>ali1100/wa
# -*- coding: utf-8 -*-
"""
Authors: <NAME> and <NAME>
UNESCO-IHE 2016
Contact: <EMAIL>
<EMAIL>
Repository: https://github.com/wateraccounting/wa
Module: Collect/HiHydroSoil
Restrictions:
The data and this python file may not be distributed to others without
permission of the WA+... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 4 13:06:04 2021
@author: Michi
"""
from abc import ABC, abstractmethod
import numpy as np
#from .. import utils
import scipy.stats as ss
def logdiffexp(x, y):
'''
computes log( e^x - e^y)
'''
return x + np.log1p(-np.exp(y-x))
... |
import numpy as np
import logging
from qcodes.utils.validators import Numbers, Arrays
from qcodes.instrument.base import Instrument
from qcodes.instrument.parameter import ParameterWithSetpoints, Parameter
from qcodes.instrument.channel import InstrumentChannel
import scipy.signal as sp
class Circuit(Instrument):
... |
<reponame>Alhassan20/mealpy
#!/usr/bin/env python
# ------------------------------------------------------------------------------------------------------%
# Created by "<NAME>" at 09:48, 16/03/2020 %
# ... |
#!/usr/bin/env python2
# Example how to generate the output file
import yaml
import rospkg
#import tagdetect #Import the odom_tag9_subscriber node
import rospy
from std_msgs.msg import String
from apriltag_ros.msg import Coordinates
from apriltag_ros.msg import animalcoord
from apriltag_ros.msg import geometriccoo... |
import warnings
from scipy.stats.stats import pearsonr
from geosoup.common import Handler, Opt, Sublist, np
__all__ = ['Samples']
class Samples:
"""
Class to read and arrange sample data.
Stores label and label names in y and y_names
Stores feature and feature names in x and x_names.
... |
import numpy as np
from scipy.sparse import csr_matrix
# @ command allow us to multiply matrix, including sparse matrix
dense_1 = np.random.binomial(n=1, p=0.1, size=(10, 10))
sparse_1 = csr_matrix(dense_1)
dense_2 = np.random.binomial(n=1, p=0.2, size=(10, 10))
sparse_2 = csr_matrix(dense_2)
rand = np.random.random(s... |
<filename>openquake/hmtk/seismicity/max_magnitude/kijko_nonparametric_gaussian.py<gh_stars>1-10
#!/usr/bin/env python
# LICENSE
#
# Copyright (C) 2010-2018 GEM Foundation, <NAME>, <NAME>, <NAME>
#
# The Hazard Modeller's Toolkit (openquake.hmtk) is free software: you can
# redistribute it and/or modify it under the ter... |
# Copyright 1999-2018 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... |
"""Backward-facing step.
.. note::
This example requires the external package `pymsh <https://pypi.org/project/pygmsh/>`_.
Following the example :ref:`stokesex`, this is another example of the Stokes flow. The
difference here is that the domain has an inlet (with an imposed velocity) and
an outlet (through which ... |
<reponame>Ovishake1607066/Assignment_4239_chameleon_clustering
import itertools
import pandas as pd
from scipy.special import comb
import numpy as np
import metis
from tqdm import tqdm
import networkx as nx
import matplotlib.pyplot as plt
import seaborn as sns
class Chameleon():
def __init__(self):
self.c... |
<gh_stars>0
import numpy as np
from matplotlib import pyplot as plt
from gurobipy import *
# for mathematical calculations and statistical distributions
from scipy.stats import truncnorm
from scipy.spatial.distance import cdist
from scipy.special import comb
import math
import copy
import itertools
def createCarFullPa... |
"""
Name: <NAME>
References: Hawking and Ellis (5.9) p131
Coordinates: Spherical
Symmetry: Maximal
Notes: Static
"""
from sympy import cosh, diag, sin, sinh, symbols
coords = symbols("t r theta phi", real=True)
variables = ()
functions = ()
t, r, th, ph = coords
metric = diag(-cosh(r) ** 2, 1, sinh(r) ** 2, sinh(r) **... |
<reponame>AaronBlare/dnam
import pandas as pd
import statsmodels.formula.api as smf
from scripts.python.routines.manifest import get_manifest
import numpy as np
import os
from scripts.python.pheno.datasets.filter import filter_pheno, get_passed_fields
from scipy.stats import spearmanr
import matplotlib.pyplot as plt
fr... |
import sympy
def getModelPointSymbols():
return tuple(sympy.symbols("X Y Z"))
def getExtrinsicSymbols():
return tuple(sympy.symbols("ρx ρy ρz tx ty tz"))
def getHomographySymbols():
return tuple(sympy.symbols("H11 H12 H13 H21 H22 H23 H31 H32 H33"))
|
<reponame>fancent/CSC420
"""
Created on Sun Sep 22 18:32:30 2019
@author: vince
"""
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from scipy import signal
im = Image.open("A1_Q4.jpg").convert('L')
imArray = np.asarray(im)
fullPhoto = Image.open("A1_Q4c.jpg").convert('L')
full... |
from joblib import Parallel, delayed, cpu_count
import numpy
import openturns as ot
from anastruct.fem.system import SystemElements, Vertex
from scipy.interpolate import CubicSpline
try :
from numba import jit
except :
print("numba not installed.")
print("You can install numba if you want to speed up a bit ... |
<filename>tutorials/organic_synthesis_figures/debug_wei_part3.py
import os
import sys
from scipy import sparse
PARALLEL = 1 # assuming a quad-core machine
ATTRIBUTE = "organic_figure"
os.environ['FONDUERHOME'] = '/Users/liwei/BoxSync/s2016/Dropbox/839_fonduer'
os.environ['FONDUERDBNAME'] = ATTRIBUTE
os.environ['SNORK... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.