text string |
|---|
<gh_stars>1-10
from quantum_mc.arithmetic.piecewise_linear_transform import PiecewiseLinearTransform3
import unittest
import numpy as np
from qiskit.test.base import QiskitTestCase
import quantum_mc.calibration.fitting as ft
import quantum_mc.calibration.time_series as ts
from scipy.stats import multivariate_normal, n... |
<reponame>ssh0/growing-string<gh_stars>0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by <NAME>
# 2016-12-06
## for N_sub ===========
import set_data_path
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
from scipy.stats import gamma
def result_N_sub(path):
fig,... |
<filename>arnold/sensors/lidar.py
import logging
import serial
import statistics
from typing import Optional
from arnold import config
_logger = logging.getLogger(__name__)
class Lidar(object):
"""A sensor class which gets the distance from the lidar module to the closest
object in range.
Args:
... |
<reponame>syrGitHub/Graph-Temporal-AR-GTA-
import numpy as np
import torch
import matplotlib.pyplot as plt
import torch.nn as nn
import time
from util.time import *
from util.env import *
from sklearn.metrics import mean_squared_error
from test import *
import torch.nn.functional as F
import numpy as np
from evaluate i... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2017 <NAME>
""" Module for simple optical media definitions
.. Created on Fri Sep 15 17:06:17 2017
.. codeauthor: <NAME>
"""
from scipy.interpolate import interp1d
from rayoptics.util.spectral_lines import spectra
def glass_encode(n, v):
return str(... |
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import timeit
import unittest
from chainer import testing
f... |
<reponame>IbHansen/ModelFlow
# -*- coding: utf-8 -*-
"""
This is a module for testing new features of the model class, but in a smaler file.
Created on Sat Sep 29 06:03:35 2018
@author: hanseni
"""
import sys
import time
import matplotlib.pyplot as plt
import matplotlib as mpl
import ... |
<filename>tests/recommenders/test_slim.py
from typing import Dict
import numpy as np
import pytest
import scipy.sparse as sps
from irspack.recommenders import SLIMRecommender
def test_slim_positive(test_interaction_data: Dict[str, sps.csr_matrix]) -> None:
try:
from sklearn.linear_model import ElasticNe... |
<reponame>shivay101/Assignments-2021
import math
import numpy as np
def demo(x):
'''
This is a demo function
Where in you just return square of the number
args:
x (int)
returns:
x*x (int)
'''
return x*x
def is_palindrome(string):
'''
This function returns True if th... |
<filename>builder/models/feature_extractor/psd_feature.py
# Copyright (c) 2022, <NAME>. All rights reserved.
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is ... |
"""prodigal.py: a module with functions to call genes with Prodigal,
count codon usage, calculate centered log ratio and isometric log ration
transformations and return values as a CSV."""
import subprocess
import os
import logging
import csv
import yaml
import numpy as np
# import scipy.linalg
import scipy
f... |
# -*- coding: utf-8 -*-
"""Untitled9.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1J_uxb0SmcorkTNpQumtf2jcQWHkAFTHj
"""
import tensorflow as tf
import numpy as np
#import matplotlib.pyplot as plt
#import pandas as pd
import time
import sys
im... |
<reponame>mobergd/interfaces
""" fit rate constants to Arrhenius expressions
"""
import os
import numpy as np
from scipy.optimize import leastsq
from ratefit.fit.arrhenius import dsarrfit_io
RC = 1.98720425864083e-3 # Gas Constant in kcal/mol.K
def single(temps, rate_constants, t_ref, method,
a_guess=8... |
#!/usr/bin/env python
"""
Utility classes functions that are used for drift correction.
Hazen 02/17
"""
import numpy
import scipy
import storm_analysis.sa_library.grid_c as gridC
import storm_analysis.sa_library.sa_h5py as saH5Py
class SAH5DriftCorrection(saH5Py.SAH5Py):
"""
A sub-class of SAH5Py designed ... |
# Copyright 2020 <NAME>, <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, ... |
#
# Copyright 2021 <NAME>
#
"""The FpRintTranslator is used to convert FloatingPoint formulae into those of RealIntervals.
"""
import warnings
from fractions import Fraction
import pysmt.walkers
import pysmt.typing as types
import pysmt.operators as op
import pysmt.smtlib.commands as smtcmd
from pysmt.environment ... |
import numpy as np
import theano.tensor as tt
from scipy.special import logsumexp
vsearchsorted = np.vectorize(np.searchsorted, otypes=[np.int], signature="(n),()->()")
def compute_steady_state(P):
"""Compute the steady state of a transition probability matrix.
Parameters
----------
P: TensorVari... |
import numpy as np
import scipy.io as sio
import os
from pathlib import Path
import tensorflow as tf
import tensorflow_addons as tfa
from functools import partial
from inspect import getfullargspec
import math
import random
def get_angles(tensor):
if len(tensor.shape) > 3:
angles = tf.random.uniform(
... |
import time
import warnings
import numpy as np
import os.path as pa
from astropy.io import fits
import scipy.ndimage as ndimage
from astropy.table import Column
from sfft.AutoSparsePrep import Auto_SparsePrep
__author__ = "<NAME> <<EMAIL>>"
__version__ = "v1.1"
class Easy_SparsePacket:
@staticmethod
def ESP(F... |
import numpy as np
import sys
# See https://github.com/YuyangL/SOWFA-PostProcess
sys.path.append('/home/yluan/Documents/SOWFA PostProcessing/SOWFA-Postprocess')
from FieldData import FieldData
from Postprocess.OutlierAndNoveltyDetection import InputOutlierDetection
from Preprocess.Tensor import processReynoldsStress, g... |
<reponame>denkuzin/captcha_solver<filename>train.py<gh_stars>1-10
import torch
import torch.nn as nn
from torch.autograd import Variable
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
from torch.utils.data import DataLoader
import config
import preprocessing
from models impo... |
import matplotlib.pyplot as plt
import matplotlib as mpl
import pymc3 as pm
from pymc3 import Model, Normal, Slice
from pymc3 import sample
from pymc3 import traceplot
from pymc3.distributions import Interpolated
from theano import as_op
import theano
import theano.tensor as tt
import numpy as np
import math
from scipy... |
<filename>simpleqe/tests/test_utils.py
"""
Test suite for simpleqe.utils
"""
import numpy as np
from scipy import signal
from simpleqe import qe, utils
def prep_data(freqs, data_spw=None, pspec_spw=None, seed=None, ind_noise=True, Ntimes=200):
# assume freqs to be in Hz
Nfreqs = len(freqs)
Ntimes = 200
... |
import sys
import numpy as np
import openmoc
# For Python 2.X.X
if sys.version_info[0] == 2:
from log import py_printf
import checkvalue as cv
# For Python 3.X.X
else:
from openmoc.log import py_printf
import openmoc.checkvalue as cv
class IRAMSolver(object):
"""A Solver which uses a Krylov sub... |
import streamlit as st
from PIL import Image
import numpy as np
import cv2
import tensorflow
from tensorflow.keras.models import load_model
from scipy.spatial import distance
# from streamlit_webrtc import webrtc_streamer
################
## Tiltle ##
################
# app = MultiApp()
hide_streamlit_style = """... |
import networkx
import networkx as nx
import numpy as np
import scipy
import torch
from graphgym.config import cfg
from graphgym.register import register_feature_augment
def laplacian_eigenvectors(graph, **kwargs):
nxG = graph.G
L = nx.laplacian_matrix(nxG)
import numpy
eigvals, eigvecs = numpy.linalg... |
<filename>TTS/utils/audio_lws.py
import os
import sys
import librosa
import pickle
import copy
import numpy as np
from scipy import signal
import lws
_mel_basis = None
class AudioProcessor(object):
def __init__(
self,
sample_rate,
num_mels,
min_lev... |
<reponame>GregoryLand/PyGrid<filename>gateway/app/main/routes.py
"""
All Gateway routes (REST API).
"""
from flask import render_template, Response, request, current_app, send_file
from math import floor
import numpy as np
from scipy.stats import poisson
from . import main
import json
import random
import os
impor... |
"""
Run every file at the input scope on all versions x times
Tally as we go
Outputs
-file-scope- list - just goal files, and their scope
-LONG-LOG - everything
-time-data - goal files, scope, all versions & times (collects some data for initial perf comparisons)
"""
import re
import csv
impor... |
<reponame>llbxg/hundun<filename>hundun/exploration/_fnn.py
# False Nearest Neighbors - Algorithm
import warnings as _warnings
import numpy as _np
from scipy.spatial.distance import cdist as _cdist
from ._utils import embedding as _embedding
from ..utils import Drawing as _Drawing
def _dist(seq):
return _cdist(s... |
<filename>convoluter.py<gh_stars>1-10
import sys
import csv
import math
import numpy as np
import audiotools
from scipy import interpolate
import cv2
import warnings
import wave
import struct
from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader as vid
from functools import reduce
import cmath
import random
de... |
<filename>Simple_does_it/Dataset/save_result.py
import os
import sys
import scipy.misc
import matplotlib as mlp
import matplotlib.pyplot as plt
import numpy as np
mlp.use('Agg')
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from Dataset import voc12_color
class Save:
def __init__(self, img,... |
<reponame>hyperion-ml/hyperion
"""
Copyright 2018 Johns Hopkins University (Author: <NAME>)
Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
import numpy as np
import h5py
import scipy.linalg as la
from ..hyp_model import HypModel
from .sb_sw import SbSw
class LDA(HypModel):
"""Class to do linea... |
<reponame>xsuite/xcol
import numpy as np
import pandas as pd
from scipy.constants import c as clight
import xpart as xp
mp = 938.272088e6
# Note: SixTrack initial.dat is with respect to the closed orbit when using TRAC,
# but in the lab frame when using SIMU
def particles_to_sixtrack_initial(part, filename):
... |
<reponame>meinardmueller/libtsm<filename>libtsm/utils.py
"""
Description: libtsm utility functions
Contributors: <NAME>, <NAME>, <NAME>, <NAME>
License: The MIT license, https://opensource.org/licenses/MIT
This file is part of libtsm (https://www.audiolabs-erlangen.de/resources/MIR/2021-DAFX-AdaptivePitchShifting)
"""
... |
<reponame>mathischeap/mifem
import numpy as np
from scipy.sparse import csc_matrix
from screws.freeze.base import FrozenOnly
from tools.linear_algebra.data_structures.global_matrix.main import GlobalVector
class EWC_ColumnVector_Assembler(FrozenOnly):
""""""
def __init__(self, Vec):
self._Vec_ = Vec... |
from __future__ import print_function
import os
import sys
import contextlib
import subprocess
import glob
from setuptools import setup, find_packages
from setuptools import Extension
HERE = os.path.dirname(os.path.abspath(__file__))
# import ``__version__` from code base
exec(open(os.path.join(HERE, 'dynetlsm', '... |
<gh_stars>10-100
import numpy as np
from simple_convnet import convnet as cn
from scipy.optimize import approx_fprime
def _check_gradients(layer_args, input_shape):
rand = np.random.RandomState(0)
net = cn.SoftmaxNet(layer_args=layer_args, input_shape=input_shape, rand_state=rand)
x = rand.randn(*(10,)+ne... |
<reponame>nim65s/supaero2021
'''
Example of use a the optimization toolbox of SciPy.
The function optimized here are meaningless, and just given
as example. They ***are not*** related to the robotic models.
'''
import numpy as np
from scipy.optimize import fmin_bfgs, fmin_slsqp
def cost(x):
'''Cost f(x,y) = x^2 +... |
<reponame>pawsen/pyvib
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from numpy.fft import fft
from scipy.interpolate import interp1d
from .common import mmul_weight
from .polynomial import multEdwdx, nl_terms, poly_deriv
from .statespace import NonlinearStateSpace, StateSpaceIdent
"""
PNLSS -- ... |
import numpy as np
import networkx as nx
from scipy.spatial.distance import pdist
from typing import List, Tuple
from timemachine.lib.potentials import HarmonicBond
def compute_box_volume(box: np.ndarray) -> float:
assert box.shape == (3, 3)
return np.linalg.det(box)
def compute_box_center(box: np.ndarray) ... |
<filename>NNDB/model.py
from peewee import *
from peewee import (FloatField, FloatField, ProgrammingError, IntegerField, BooleanField,
AsIs)
# Param, Passthrough)
from peewee import fn
import numpy as np
import inspect
import sys
from playhouse.postgres_ext import PostgresqlExtDat... |
#!/usr/bin/env python
# coding: utf-8
import os, sys
import pymongo as pm
import numpy as np
import scipy.stats as stats
import pandas as pd
import json
import re
from io import BytesIO
from PIL import Image
import requests # this is to access the stim urls
from skimage import io, img_as_float
import base64
import m... |
"""
Path Planning Using Particle Swarm Optimization
Implementation of particle swarm optimization (PSO) for path planning when the
environment is known.
Copyright (c) 2021 <NAME>
Main Quantities
---------------
start Start coordinates.
goal Goal coordinates.
limits Lower and upper bo... |
<filename>cnmodel/cells/cell.py
from __future__ import print_function
import weakref
import numpy as np
import scipy.optimize
from collections import OrderedDict
import neuron
from neuron import h
from ..util import nstomho, mho2ns
from ..util import custom_init
from ..util import Params
from .. import synapses
from ..... |
<filename>scripts/utils/pythree_display.py
import pythreejs as three
import matplotlib.colors as mcolors
from utils.curves import *
# NB: this dependency is only used for vector display functions (pythree_vectors function)
# Typically, it is not used in the Example Jupyter notebook
try:
from scipy.spatial.transfor... |
<reponame>kimbring2/AlphaStar_Implementation<filename>run_reinforcement_learning.py
from pysc2.env import sc2_env, available_actions_printer
from pysc2.lib import actions, features, units
from pysc2.lib.actions import FunctionCall, FUNCTIONS
from pysc2.env.environment import TimeStep, StepType
from pysc2.lib.actions im... |
import warnings
from collections import Counter
import numpy as np
from scipy.spatial.distance import euclidean
from pymatgen.core import Structure
from pymatgen.analysis.chemenv.coordination_environments.chemenv_strategies import \
SimplestChemenvStrategy
from pymatgen.analysis.chemenv.coordination_environments.c... |
#!/usr/bin/python3
import time
import config
import random
import statistics
import datagen as dg
import matplotlib.pyplot as plt
from sys import argv
from pprint import pprint
from scipy.spatial import ConvexHull
def run_dataset(dataset, function, sizes):
'''
Runs the given dataset on the list of input sizes... |
<gh_stars>1-10
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from numpy.polynomial import Polynomial, polynomial
from scipy.interpolate import splev, splrep
from nuspacesim.simulation.eas_optical import atmospheric_models
from nuspacesim.simulation.eas_optical.quadeas import (
aerosol_optica... |
from functools import reduce
from pyspark.ml.feature import OneHotEncoderEstimator, StringIndexer, VectorAssembler
from pyspark.sql.functions import col, countDistinct, format_number, lit, mean, stddev_pop, udf
from pyspark.sql.types import DoubleType
from pyspark.ml import Pipeline
import math
import numpy as np
impo... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 10 12:47:31 2021
@author: sophi
"""
# data origin : https://www.kaggle.com/fedesoriano/stroke-prediction-dataset
import pandas as pd
df = pd.read_csv('C:/Users/sophi/OneDrive/Desktop/Applied Health Informatics/AHI FALL 21/healthcare-dataset-stroke-... |
<gh_stars>0
#
import numpy as np
import netCDF4
import scipy.ndimage as ndimage
import datetime as dt
import cartopy
import cartopy.crs as ccrs
import cartopy.feature as cpf
from cartopy.io.shapereader import Reader
from cartopy.io.shapereader import natural_earth
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER,... |
<filename>algorithmic_trading/samples/c2_beta_binomial.py
import numpy as np
from scipy import stats
from matplotlib import pyplot as plt
from random import randint
if __name__ == "__main__":
# Create a list of the number of coin tosses ("Bernoulli trials")
numbers = [0, 2, 10, 20, 50, 500] # trials
# ... |
import numpy as np
import os
from scipy import sparse, io
import pandas as pd
import random
def posterior_predictiveLL(X,y,alpha,mu,s2,sigma2_eps,XX):
N = X.shape[0]
y_XB = y-X.dot(mu*alpha)
LL = -N/2*np.log(2*np.pi*sigma2_eps)
LL -= 1./(2*sigma2_eps)*(y_XB.dot(y_XB))
LL -= 1./(2*sigma2_eps)*((alpha*(s2+mu**2)-... |
import logging
import os
import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage.filters import gaussian_filter1d
from topomc.common.coordinates import Coordinates
from topomc.common.logger import Logger
MARGIN = 3
class MapRender:
settings = [
"smoothness",
"contour_index",... |
<reponame>iro-upgto/rkd
"""
"""
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from sympy import *
from sympy.matrices import Matrix,eye
from rkd.didactic.transformations import *
from rkd.didactic.util import *
__all__ = ["plot_euler", "draw_uv", "draw_uvw"]
def plot_euler(phi,theta,psi,seq... |
from sympy import (
sqrt,
Derivative,
symbols,
collect,
Function,
factor,
Wild,
S,
collect_const,
log,
fraction,
I,
cos,
Add,
O,
sin,
rcollect,
Mul,
radsimp,
diff,
root,
Symbol,
Rational,
exp,
Abs,
)
from sympy.core.exp... |
<reponame>marcelo-alvarez/specter<gh_stars>1-10
#!/usr/bin/env python
"""
Convert simulated BigBOSS spots into PSF format.
<NAME>, LBL
January 2013
"""
import sys
import os
import numpy as N
from glob import glob
from scipy import ndimage
import fitsio
#+ TODO: refactor this to use numpy.polynomial.legendre instead... |
<reponame>lucgiffon/psm-nets
from collections import defaultdict
import pickle
import pathlib
import pandas as pd
import scipy.special
import scipy.stats
from palmnet.data import param_training, image_data_generator_cifar_svhn
from palmnet.experiments.utils import get_line_of_interest
from palmnet.utils import get_spa... |
<reponame>akuhnregnier/bounded-rand-walkers<filename>tests/test_shaper_generation.py<gh_stars>0
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from numpy.testing import assert_allclose
from scipy.interpolate import UnivariateSpline
from bounded_rand_walkers.cpp import bound_map
from bounded_rand_walkers.rad_... |
<reponame>JamesDownsLab/Experiments
from math import pi, atan, sin, cos
import cv2
import matplotlib.pyplot as plt
import numpy as np
from scipy import spatial
from tqdm import tqdm
from shapely import affinity
from shapely.geometry import LineString, Point
from labvision import images
import filehandling
from parti... |
<gh_stars>0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Data pre-processing and preparation
"""
import pickle
import util
import pandas as pd
import sklearn.linear_model
import numpy as np
import scipy
def get_data_pk():
f = open('edata.pkl')
x = pickle.load(f)
f.close()
return x
def url_to_s... |
# coding: utf-8
def load_pickle(fname):
with open(fname, 'rb') as f:
return pickle.load(f)
## time
def aexp2zred(aexp):
return [1.0/a - 1.0 for a in aexp]
def zred2aexp(zred):
return [1.0/(1.0 + z) for z in zred]
def lbt2aexp(lts):
import astropy.units as u
from astropy.cosmology import W... |
import argparse
import gc
import json
import logging
import pprint
import sys
from pathlib import Path
import feather
import numpy as np
import lightgbm as lgb
import pandas as pd
from scipy import sparse as sp
from tqdm import tqdm
import config as cfg
from predictors import GBMFeatures, GBMPredictor
from utils impo... |
import h5py, os, time, sys
import numpy as np
from scipy.special import gammaln, digamma, multigammaln
from scipy.optimize import minimize
from scipy.stats import chi2
from sklearn_extensions.fuzzy_kmeans import FuzzyKMeans
from sklearn.metrics.pairwise import euclidean_distances
from collections import Counter
from mu... |
import re
import sys
from io import StringIO
import numpy as np
import scipy.sparse as sp
from scipy import linalg
from sklearn.decomposition import NMF, MiniBatchNMF
from sklearn.decomposition import non_negative_factorization
from sklearn.decomposition import _nmf as nmf # For testing internals
from scipy.sparse i... |
from interpolation.splines.eval_cubic_numba import vec_eval_cubic_spline_3, vec_eval_cubic_spline_2
from interpolation.splines.filter_cubic import filter_coeffs
from interpolation.splines.multilinear_numba import multilinear_interpolation
from interpolation.splines.misc import mlinspace
import numpy
K = 50
d = 2
N =... |
<filename>LAB2/lab/distribution.py
import math
from typing import List, Tuple
import numpy as np
import scipy.stats as scs
class CustomDistr:
def __init__(self, scs_distr: str, size: int) -> None:
self._distr_title = scs_distr
self._size = size
def _generate_distr(self):
if self._dis... |
from unittest import TestCase
from sympkf.symbolic.random import Expectation, omega, israndom
from sympy import Function, Derivative, symbols, I, latex
class TestExpectation(TestCase):
"""
Test of the expectation operator E()
This operator should be:
* Linear (for non-random components)
* Idempot... |
import numpy as np
import torch
from matplotlib import pyplot as plt
from pykeops.torch import LazyTensor
import torch.nn.functional as F
from scipy.special import gamma
from .proposals import Proposal
numpy = lambda x: x.cpu().numpy()
def squared_distances(x, y):
x_i = LazyTensor(x[:, None, :]) # (N,1,D)
... |
<reponame>Hylta/qupulse<gh_stars>1-10
import typing
import abc
import inspect
import numbers
import fractions
import functools
import warnings
import collections
import numpy
__all__ = ["MeasurementWindow", "ChannelID", "HashableNumpyArray", "TimeType", "time_from_float", "DocStringABCMeta",
"SingletonABCM... |
import numpy as np
from pomegranate import HiddenMarkovModel, State, DiscreteDistribution
from scipy.special import logsumexp
np.warnings.filterwarnings('ignore')
class HMM:
def __init__(self, num_states, num_emissions, laplace=0):
self.num_states = num_states
self.num_emissions = num_emissions
... |
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import numpy as np
from keras.utils import multi_gpu_model
import matplotlib.pyplot as plt
from scipy.signal import medfilt
from model import *
from featureExtraction import *
import glob
class Options(object):
def __init__(self):
self.num_spec... |
<gh_stars>0
"""
This code supports experiments using the approach of [G&G]
to estimate uncertainty for held-out examples for the CIFAR-10
data set.
See the Makefile for examples of how to use this script.
Note: since we are not currently doing any special synthetic
data augmentation on-the-fly, could pr... |
<reponame>gvvynplaine/dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import dgl
import dgl.function as fn
import numpy as np
import scipy.sparse as ssp
from dgl.data import citation_graph as citegrh
import networkx as nx
##load data
##cora dataset have 2708 nodes, 1208 of them is used as train ... |
<reponame>levidantzinger/hawaii_covid_forecast
#########################################################
############### ~ Import Libraries ~ ####################
#########################################################
import numpy as np
import pandas as pd
import scipy.integrate as integrate
from dd_model.model imp... |
import numpy as np
import math
import pyvista as pv
import tree as T
import assignment as AS
import time
import pickle
from tqdm import tqdm_notebook
from pathlib import Path
from scipy.optimize import linear_sum_assignment
from pyvista import examples
from operator import itemgetter
dataset_teapot = examples.downlo... |
<filename>dcekit/just_in_time/lwpls.py
# -*- coding: utf-8 -*-
# %reset -f
"""
@author: <NAME>
"""
import numpy as np
from scipy.spatial.distance import cdist
from sklearn.base import BaseEstimator, RegressorMixin
#from sklearn.utils.estimator_checks import check_estimator
class LWPLS(BaseEstimator, RegressorMixin):
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 24 10:12:03 2018
@author: zyv57124
"""
import matplotlib
matplotlib.use("Agg")
import numpy as np
import pandas
import sys
import matplotlib.pyplot as plt
import scipy.io as sio
import tensorflow as tf
import sklearn
from tensorflow import keras
from sklearn.model_select... |
from model_postprocessing import check_model_monotonicity, split_nonmonotonic_clusters
import joblib
import numpy as np
import pandas as pd
from scipy.stats import linregress
from scipy.optimize import curve_fit
# import statsmodels.formula.api as smf
################################################################... |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
import uncertainties.unumpy as unp
from uncertainties import ufloat
from uncertainties.unumpy import nominal_values as noms
from uncertainties.unumpy import std_devs as sdevs
s1_rot, s2_rot = np.genfromtxt(... |
import numpy as np
from .. import sympix
def test_roundup():
x = [sympix.roundup(i, 2) for i in range(10)]
assert np.all(np.asarray(x) == [0, 2, 2, 4, 4, 6, 6, 8, 8, 10])
def test_make_sympix_grid():
k = 5
nrings_min = 200
g = sympix.make_sympix_grid(nrings_min, k)
assert np.all(g.tile_counts ... |
#!/usr/bin/python
import numpy as np
import math
from scipy.stats import norm
import vrep
import vrep_rotors, vrep_imu
class RL(object):
def __init__(self, clientID):
self.clientID = clientID
self.quadHandle = None
self.pos = [0, 0, 0]
self.rotor_data = [0.0, 0.0, 0.... |
<filename>functions/DATA_AGNfitter.py
"""%%%%%%%%%%%%%%%%%
DATA_AGNFitter.py
%%%%%%%%%%%%%%%%%%
This script contains the class DATA,
which administrate the catalog properties given by the user props().
It also helps transporting
the main information on the dictionaries (DICTS).
"""
import sys,os
import num... |
<reponame>jasondraether/verbio
import numpy as np
import pandas as pd
from scipy import signal
import math
# Returns the index of the time if it matches exactly OR
# the index of the time RIGHT BEFORE upper_time
def get_upper_time_index(times, upper_time):
k = 0
n_times = times.shape[0]
while times[k] <= upper_t... |
import argparse, os, sys
import torch
import mmcv
import numpy as np
import torch.nn.functional as F
from mmcv.parallel import collate, scatter
from mmaction.datasets.pipelines import Compose
from mmaction.apis import init_recognizer
from mmaction.datasets import build_dataloader, build_dataset
from mmcv.parallel impor... |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import pandas as pd
from datetime import datetime, timedelta
import numpy as np
import netCDF4 as nc
from netCDF4 import Dataset
import os
import rasterio
from scipy.interpolate import griddata
from scipy import interpolate
Path_save = '/home/nacorreasa/Maes... |
<reponame>QianWanghhu/IES-FF
#!/usr/bin/env python
from multiprocessing import Pool
import numpy as np
import os
import matplotlib.pyplot as plt
from functools import partial
import time
import copy
from scipy.stats import multivariate_normal
from scipy import stats
# from scipy.optimize import root
from scipy.optimiz... |
<filename>src/yolo.py
import sys
import os
sys.path.append(os.path.abspath("/src"))
import darknet
import utils
import parse
import kerasmodel
import yolodata
import ddd
from keras.models import load_model
from PIL import Image, ImageDraw
import numpy as np
from keras import backend as K
import keras.optimizers as opt
... |
import itertools
from collections import deque
from typing import Tuple
import numpy as np
from pypda.wavelets import Waveform, TriangGaussian
class PulseModelRaw(Waveform):
def __init__(self, samples:int=100, baseline=80, pulse_amplitudes: Tuple = (8, 3, 4, 2, 1),
delta_time: Tuple = (10, 10, ... |
<gh_stars>0
import OpenPNM
import scipy as sp
class PoreSeedTest:
def setup_class(self):
self.net = OpenPNM.Network.Cubic(shape=[5, 5, 5])
self.geo = OpenPNM.Geometry.GenericGeometry(network=self.net,
pores=self.net.Ps,
... |
from scipy import *
from numpy import *
import matplotlib.pyplot as plt
ryd=0.0136
#keV;1 ryd = 0.0136 keV
Ip=7.112
#keV,I为铁的 K 层电离势阱 7.112 keV。
keV2erg=1.602e-9
abund=4.67735e-05
#?
E_keV=[0,6.4077,6.3915]
#For isolated Fe atoms, the fluorescent Fe Ka line consists of two components,K α 1 =6.404keV 和 K α 2 =6.391ke... |
import numpy as np
import geopandas as geop
from shapely import geometry
from shapely.ops import polygonize
from scipy.spatial import Voronoi
from disarm_gears.validators import validate_1d_array, validate_2d_array
def voronoi_polygons(X, margin=0):
'''
Returns a set of Voronoi polygons corresponding to a set... |
<filename>src/dev/basset_kmers.py<gh_stars>100-1000
#!/usr/bin/env python
from optparse import OptionParser
import copy
import math
import os
import random
import string
import subprocess
import sys
import h5py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.cluster import hierarchy
f... |
<filename>tests/test_data_models.py
from DocumentFeatureSelection.common import data_converter
from DocumentFeatureSelection.pmi import PMI_python3
from DocumentFeatureSelection.models import ScoredResultObject
from scipy.sparse import csr_matrix
import unittest
import numpy
import logging
class TestDataModels(unitte... |
<reponame>takelifetime/competitive-programming
from itertools import accumulate,chain,combinations,groupby,permutations,product
from collections import deque,Counter
from bisect import bisect_left,bisect_right
from math import gcd,sqrt,sin,cos,tan,degrees,radians
from fractions import Fraction
from decimal import Decim... |
<reponame>HelligeChris/DisplayMath
from sympy import latex
from IPython.display import display, Math
def displayMath(text, value = ""):
if type(value) != list:
value = [value]
res = ""
for i in value:
if type(i) != list:
res += f"{latex(i)}"
else:
res += i[0]... |
import constr
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
import scipy.optimize
import sys
import planPendulum
#import lqr
if __name__ == '__main__':
np.set_printoptions(linewidth=160)
np.set_printoptions(threshold=sys.maxsize)
np.set_printoptions(formatter={'float':... |
<filename>src/jpcm/core/core.py
#!/usr/bin/env python3
# inspired / based on https://stackoverflow.com/questions/61487041/more-perceptually-uniform-colormaps
import matplotlib
matplotlib.use('agg')
from matplotlib import pyplot as plt
from matplotlib.colors import ListedColormap as LCM
from matplotlib.colors import Nor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.