text string |
|---|
#!/usr/bin/env python
"""
File Name: awgn.py
Author: <NAME>
Date: 13 Apr 2008
Purpose: Takes waveform arrays as input and returns them with additive
white gaussian noise effects.
Usage:
from awgn import *
awgninstance = awgn(period, samplesperperiod, power)
outputarray = awgninstance.run(inputarray, plot = False... |
import numpy as np
import matplotlib.pyplot as plt
from scipy import linalg
from scipy.stats import norm, t
###
# See Genest and MacKay (1986) The joy of copulas: bivariate distributions with uniform marginals
### General algorithm to generate pairs of random variables whose distribution function is given by an Arch... |
from typing import Union
import numpy as np
# noinspection PyProtectedMember
from scipy.stats._stats import _kendall_dis
def kendall_tau(x, y):
x = np.asarray(x).ravel()
y = np.asarray(y).ravel()
if x.size != y.size:
raise ValueError("All inputs to `kendalltau` must be of the same size, "
... |
# -*- coding: utf-8 -*-
import scipy as sp
def make_oct_cqt_kernel(fmax, n_bins, fs, q=1.0, atom_hop_factor=0.25, thr=0.0005, window='blackmanharris', perf_rast=False):
"""
CQTのKernel設計(Klapuri CQT用)
"""
def nextpow2(i):
# n = 2
# while n < i:
# n = n * 2
n = int(s... |
from __future__ import print_function
from .prox_fn import ProxFn
from proximal.lin_ops import CompGraph, mul_elemwise
import numpy as np
import numexpr as ne
from proximal.utils.utils import Impl, fftd, ifftd
from scipy.sparse.linalg import lsqr, LinearOperator
from proximal.halide.halide import Halide
class sum_squ... |
<reponame>guillefix/mt-lightning<filename>feature_extraction/madmom/audio/hpss.py<gh_stars>10-100
# encoding: utf-8
# pylint: disable=no-member
# pylint: disable=invalid-name
# pylint: disable=too-many-arguments
"""
This module contains all harmonic/percussive source separation functionality.
"""
from __future__ impo... |
<filename>inclearn/models/icarl.py<gh_stars>1-10
import numpy as np
import torch
from scipy.spatial.distance import cdist
from torch.nn import functional as F
from tqdm import tqdm
from inclearn.lib import factory, network, utils
from inclearn.models.base import IncrementalLearner
EPSILON = 1e-8
class ICarl(Increme... |
import os
import pickle
from os import listdir
from os.path import isfile, join
import fire
import matplotlib.pyplot as plt
import numpy as np
from scipy.io import savemat
colors = [(255, 10, 10), (255, 200, 15)]
overlap = (230, 66, 24)
# data_list = [
# "/Users/sschickler/Code_Devel/LSSC-python/plotting_function... |
<gh_stars>100-1000
from pudzu.charts import *
from pudzu.sandbox.bamboo import *
import scipy.stats
df = pd.read_csv("datasets/flagsrwbpercent.csv").set_index("country")
class HeraldicPalette(metaclass=NamedPaletteMeta):
ARGENT = "#ffffff"
AZURE = "#0f47af"
GULES = "#da121a"
SABLE = "#00ff00"
def fla... |
# encoding=utf8
import numpy as np
from scipy.stats import rankdata
from mathpy._lib import _create_array
from mathpy.linalgebra.norm import norm
def corr(x, y=None, method='pearson'):
r"""
Computes the Pearson product-moment or Spearman correlation coefficients of the given variables.
P... |
import pickle
import numpy as np
from numpy.testing import (
assert_almost_equal,
assert_equal,
assert_,
assert_allclose,
)
from scipy.stats import cauchy
from refnx._lib import flatten
from refnx.reflect import (
SLD,
Structure,
Spline,
Slab,
Stack,
Erf,
Linear,
Exponen... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import scipy.io as sio
import numpy as np
from datasets import tracket_num
FLAGS = tf.app.flags.FLAGS
# define one line functions for
# computing distances, losses and normalisation... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 9 14:28:29 2015
@author: stvhoey
"""
import os
import sys
import numpy as np
import scipy.io as sio
def convert_ascat_to_matlab(filename, grid_point_id='all', byte2skip=208):
"""read in the .idx and .dat file combinationa dn convert data to matlab readable .mat-fi... |
<filename>experiments.py
import datetime
import shutil
import os
import scipy.signal
import scipy.io
import mir_eval
import numpy
import ntf
import synth
import util
import defaults
import pickle
__author__ = 'ecreager'
class Design(object):
def __init__(self):
self.files = True # does the design specify... |
<filename>example.py
# This file contains code to run a sample separation and listen to the output
#
# Copyright 2020 <NAME>
#
# 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 restrict... |
import math
# years_apart function
from datetime import date
def years_apart(date1, date2):
"""Returns the fractional difference in years between the given dates.
Assumes a 365-day year for the fractional part.
>>> years_apart(date(1959, 5, 3), date(1960, 5, 3))
1.0
>>> years_apart(dat... |
<filename>app.py<gh_stars>0
import cv2
import statistics
import paho.mqtt.client as mqtt #import the client1
import serial
import time
mqtt_url = "a2nu865xwia0u3-ats.iot.us-west-2.amazonaws.com"
root_ca ='/Users/pettergustafsson/Desktop/IoT/Project/iot-test/certificates/G2-RootCA1.pem'
public_crt = '/Users/pettergusta... |
<reponame>smartalecH/pyWMM
# ---------------------------------------------------------------------------- #
#
# ---------------------------------------------------------------------------- #
import numpy as np
from scipy import integrate
from pyWMM import WMM as wmm
from pyWMM import mode
from scipy import linalg
from ... |
#!/usr/bin/env python
# cardinal_pythonlib/rpm.py
"""
===============================================================================
Original code copyright (C) 2009-2021 <NAME> (<EMAIL>).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (the "License");
you m... |
<filename>src/modules/modem.py
import numpy as np
import sounddevice as sd
import sys
import fsk
import time
import microphone
class Transmitter:
def __init__(self):
self.BAUD = 50
self.RATE = 44100
self.CARRIER = 1200
self.TSIGNAL = None
def config(self, Bd=None, fs=None, carr... |
<filename>datasets/loadCIFAR10dvs.py<gh_stars>0
# Preprocessing for CIFAR10DVS, adapted from code for "Convolutional spiking
# neural networks (SNN) for spatio-temporal feature extraction" paper
# <NAME> et al.
# https://github.com/aa-samad/conv_snn
import os
import torch
from torch.utils.data import Dataset
import n... |
import gensim
import matplotlib as mpl
from imp import reload
from nltk.corpus import stopwords
from collections import Counter
import pandas as pd
import numpy as np
import nltk,re,pprint
import sys,glob,os
import operator, string, argparse, math, random, statistics
class vectorize:
def __init__(self,data,factorN... |
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
#import local_conditions as local
import sys
folder = str(sys.argv[1])
#folder = 'bessel'
#folder = 'stroemgren'
#folder = 'sloan'
if folder == 'bessel':
bands = ['U','B','V','R','I']
elif folder == 'sloan':
bands = ['u',... |
"""
Comparing AntEvents to generic asyncio programming.
This is the AntEvents version.
"""
import asyncio
import random
from statistics import median
from antevents.base import DefaultSubscriber, SensorEvent, Scheduler, SensorPub
from antevents.linq.transducer import Transducer
import antevents.linq.combinators
import... |
import numpy as np
import scipy.special as sp_spec
from scipy.optimize import minimize
from nest_elephant_tvb.Tvb.modify_tvb.Zerlaut import ZerlautAdaptationSecondOrder as model
def create_transfer_function(parameter,excitatory):
"""
create the transfer function from the model of Zerlaut adapted for inhibitory... |
<filename>higrid/utils.py<gh_stars>1-10
import struct
import pickle as pkl
from collections import defaultdict
from os import getcwd
import healpy as hp
import numpy as np
import wave
from scipy import signal as sp, special as sp
def wavread(wave_file):
"""
Returns the contents of a wave file
:param wave... |
<filename>print_exact_free_energy.py
import numpy as np
import scipy.integrate
def ising_exact_free_energy(beta, J_horizontal, J_vertical):
"""Calculate exact free energy per site.
https://en.wikipedia.org/wiki/Square-lattice_Ising_model
"""
K = beta * J_horizontal
L = beta * J_vertical
cosh2Kcosh2L = np.... |
<reponame>samwaseda/clartbeat
import numpy as np
from scipy import ndimage
from scipy.spatial import cKDTree
from sklearn.cluster import DBSCAN
from clartbeat.area import Area
import matplotlib.pylab as plt
from scipy.spatial import ConvexHull
from skimage import feature
from skimage import filters
from sklearn.cluster... |
import logging
import warnings
# External libs
import numpy as np
import pandas as pd
from scipy import stats
# Optional libs
try:
import salem
except ImportError:
pass
# Locals
from oggm import cfg
from oggm import utils
from oggm import entity_task
from oggm.exceptions import InvalidParamsError
# Module l... |
<reponame>McCoyBecker/ising-on-the-cake<filename>analysis.py
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import KMeans
from scipy.interpolate import InterpolatedUnivariateSpline
import numpy as np
import random as random
import matplotl... |
"""
UnmixColors
===========
**UnmixColors** creates separate images per dye stain for
histologically stained images.
This module creates separate grayscale images from a color image stained
with light-absorbing dyes. Dyes are assumed to absorb an amount of light
in the red, green and blue channels that increases prop... |
<filename>x2.ESR/main.py
import numpy as np
import matplotlib.pyplot as plt
import pint
ureg = pint.UnitRegistry()
ureg.setup_matplotlib(True)
from uncertainties import ufloat, umath
import pandas as pd
from scipy.signal import find_peaks
# To fit the modulation's sin
from scipy.optimize import curve_fit
# To calculate... |
<filename>em/deep_segmentation/SegmentationDataset.py
import numpy as np
from torch.utils.data import Dataset
from torch import from_numpy
from scipy.ndimage import zoom
import pandas as pd
from em.molecule import Molecule
class SegmentationDataset(Dataset):
def __init__(self, df, num_classes, image_size, device... |
"""
Simple math addons and wrappers
Authors/Modifications:
----------------------
* <NAME> (<EMAIL>)
<NAME> (<EMAIL>)
* minimize and random from original tdl
Todo:
-----
* peak fit
"""
#######################################################################
import types
import numpy as num
impor... |
<filename>dataset/SR_data_load.py
import os
import time
import glob
import cv2
import random
import numpy as np
import tensorflow as tf
import scipy.io as sio
import time
try:
import data_util
except ImportError:
from dataset import data_util
FLAGS = tf.app.flags.FLAGS
#./Your/Path/train_HR/*_HR.mat
def load_i... |
from __future__ import print_function
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optimizer
from get_dataset import *
import models
import utils
from sklearn.metrics import confusion_matrix, roc_curve,auc
from sklearn.metri... |
<filename>tests/test_resource_queue.py
#!/usr/bin/env python3
import unittest
from collections import OrderedDict
import scipy.stats as stats
import despy.dp as dp
class testResource(unittest.TestCase):
def test_resource_init(self):
print()
print("TEST RESOURCE INIT OUTPUT")
model =... |
# By <NAME>
# Imports
import getpass
import psycopg2
import pandas as pd
import numpy as np
import json
import datetime
import argparse
import scipy.stats as scistats
import matplotlib.pyplot as plt
from urllib.error import URLError, HTTPError
from urllib.request import urlopen
import readfile
# EIA API query to get ... |
import os
import sys
import pandas as pd
from Bio import SeqIO
import matplotlib.pyplot as plt
import matplotlib as mpl
import scipy.stats as st
import random as rnd
#
#
from matplotlib.ticker import MaxNLocator
from matplotlib.patches import ConnectionPatch
from matplotlib.patches import Rectangle
from matplotlib.tick... |
<reponame>atomicguy/vvr_tools<filename>src/pairs.py
from __future__ import division, absolute_import
import os
import cv2
import numpy as np
from PIL import Image
from skimage import color
from skimage.feature import hog
from skimage.filters import sobel_v
from scipy.stats import norm
from scipy.signal import find_pe... |
<reponame>ASchneidman/VDSH
import os
import numpy as np
from scipy.sparse import csr_matrix
import pandas as pd
import pickle
from tqdm import tqdm
import argparse
from sklearn.utils import shuffle
from nltk.corpus import reuters
from sklearn.feature_extraction.text import CountVectorizer
#from nltk.stem import Porter... |
import subprocess
import time
import os
import re
import itertools
import pandas as pd
from Bio import SeqIO
from scipy.stats import chi2_contingency
from scipy.spatial import distance
""" First Function Downloading the genomes """
def Cleaning_Folder(path):
for root, dirs, files in os.walk(path):
for fil... |
<filename>AudioWatermark/echo_hiding_method.py
#!/usr/bin/env python3
"""A python script to perform watermark embedding/detection
on the basis of echo hiding method."""
# Copyright (C) 2020 by <NAME>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pub... |
<reponame>KuibinZhao/TecoGAN<filename>lib/dataloader.py
import tensorflow as tf
from lib.ops import *
import cv2 as cv
import collections, os, math
import scipy.misc as sic
import numpy as np
from scipy import signal
# The inference data loader.
# should be a png sequence
def inference_data_loader(FLAGS):
filed... |
<reponame>gaabrielfranco/ia-moba-tcc
import pandas as pd
from copy import deepcopy
from modules.plots import radarplot, radarplot_multi, radarplot_comp
import seaborn as sns
from statsmodels.distributions.empirical_distribution import ECDF
from scipy.spatial.distance import cosine
import seaborn as sns
from copy import... |
"""
Reliable and extremely fast kernel density estimator for one and two-dimensional
samples.
The kernel density estimations here are kept as simple and as separated from the rest
of the code as possible. They do nothing but kernel density estimation. The
motivation for their partial reimplementation is that the exist... |
<filename>8.4-generating-images-with-vaes.py
#!/usr/bin/env python
# coding: utf-8
# In[2]:
import keras
keras.__version__
# In[3]:
from keras import backend as K
K.clear_session()
# # Generating images
#
# This notebook contains the second code sample found in Chapter 8, Section 4 of [Deep Learning with Pyth... |
import sys
import tfcochleagram
import tensorflow as tf
import numpy as np
import scipy.io.wavfile as wav
import pickle
import sys
import json
import os
import scipy
import matplotlib.pylab as plt
import audio_cnn_helpers
import metamer_helpers
# Jittered relu grad is only applied to the metamer generation layer.
... |
import pandas as pd
import argparse
from sklearn.metrics import mean_squared_error
from scipy.stats import spearmanr
def benchmark(predictions_file, actuals_file):
predictions_array = pd.read_csv(predictions_file)['prediction'].to_numpy()
actuals_array = pd.read_csv(actuals_file)['actual'].to_numpy()
mse... |
<filename>Discussion/Reply_Comments/chemical_space_PCA.py
# -*- coding: utf-8 -*-
"""
Created on Tue May 5 08:43:28 2020
@author: hcji
"""
import json
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.sparse import load_npz, csr_matrix, save_npz
from tqdm import tqdm
from sklearn.deco... |
<filename>src/models.py
import numpy as np
import pandas as pd
import seaborn as sns
import time
from collections import namedtuple
from dataclasses import dataclass, field, InitVar
from matplotlib import pyplot as plt
from scipy.interpolate import InterpolatedUnivariateSpline
from scipy.integrate import solve_ivp
fro... |
import itertools as it
import os
import random
from scipy.ndimage import distance_transform_edt
import cv2
import numpy as np
from skimage import color, morphology
from datasets.Util.flo_Reader import read_flo_file
from datasets.Util.python_pfm import readPFM
D = 40
D_MARGIN = 5
# Number of positive clicks to sample... |
# TODO:
# - Check ros dbw node to make sure all vehicle states are available (pose, speed, yaw rate)
from gekko import GEKKO
import numpy as np
from scipy import interpolate
from math import pi
import rospy
class LateralMPC(object):
def __init__(self, vehicle_mass, wheel_base, max_steer_angle, steer_ratio):
... |
import scipy.io as sio
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
from torchvision import transforms
from torch.utils.data import DataLoader,TensorDataset
import argparse
import models
from collections import OrderedDict
from iou import IoU_per_class
def str2bool(v)... |
import numpy as np
import matplotlib.pylab as plot
from astropy.io import ascii,fits
from scipy import interpolate
import grb_catalogs
from BurstCube.LocSim.Detector import *
from BurstCube.LocSim.Spacecraft import *
from astropy.coordinates import SkyCoord
from astropy import units as u
from scipy.optimize import curv... |
<reponame>huoww07/calulate_bacteria_doubling_time<filename>Growth_curve/cal.double.time.curve.fit.py
import os
# take input file name through prompt
# please make sure the file is in the same directory with this script
file_name = input("Please enter your file name: ") # example response: input_template.xlsx
plot_opt... |
<filename>graphik/robots/robot_base.py
from abc import ABC, abstractmethod
import numpy as np
import sympy as sp
import networkx as nx
from numpy import sqrt, sin, cos, pi, arctan2, cross
from numpy.linalg import norm
from liegroups.numpy._base import SEMatrixBase
from liegroups.numpy import SO2, SO3, SE2, SE3
from gra... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import argparse
import os.path
from math import *
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.model_selection import train_test_split
from modules.preprocessing.date import DatePreprocessor
fr... |
import numpy as np
import scipy as sp
from climpy.utils import mie_utils as mie
from climpy.utils.diag_decorators import normalize_size_distribution_by_area
__author__ = '<NAME> <<EMAIL>>'
@normalize_size_distribution_by_area
def get_Kok_dust_emitted_size_distribution(moment='dN'):
# Kok et. al, 2011, equations ... |
<gh_stars>1-10
'''
Created on Mar 23, 2019
@author: Gias
'''
import os
import re
import pandas as pd
import nltk
from nltk.stem.snowball import SnowballStemmer
from imblearn.over_sampling import SMOTE
from statistics import mean
import cPickle as pickle
import numpy as np
import argparse
import csv
... |
<reponame>LLNL/NDDAV
#from __future__ import print_function
'''
Driver Script 2
Input: Multiple Linear Projections
Output: Set of Axis-Aligned Projections that Explain the Structure in the union
of all linear projections
Parameters:
dSet - name of the dataset
embMethod - pca, lpp
maxIter - Maximum number of linear pro... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 21 21:30:31 2018
@authors: <NAME> and <NAME>
"""
# sklearn library
from sklearn import datasets
from sklearn import decomposition
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import OneHotEncod... |
<gh_stars>1-10
"""canonical_test.py"""
import numpy as np
import pytest
import scipy.linalg
from control.tests.conftest import slycotonly
from control import ss, tf, tf2ss
from control.canonical import canonical_form, reachable_form, \
observable_form, modal_form, similarity_transform, bdschur
from control.excep... |
<filename>deepstomata/__init__.py
from . import utils
import sys, os, time, statistics
name = "deepstomata"
def deepstomata(dir_path, config_path = os.path.dirname(__file__)+"/config.ini"):
#silence deprecation warning
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("... |
<gh_stars>1-10
r"""Preprocessing module for TIMIT data. Defines functions for loading entire audio samples from TIMIT.
Run this command to convert the LDC sphere files to .wav:
find . -name '*.WAV' -exec sph2pipe -f wav {} {}.wav \;
sph2pipe is available online from the LDC.
<NAME>. 2019-02-05.
"""
from os im... |
import numpy, scipy, scipy.sparse, scipy.sparse.linalg, scipy.linalg, pylab
import FemIo, Assembler
def Solve(pslg, slopeFunctions, parameters, G, A, BPrime, femFilename, releaseFilename):
#Initialize the variables
deltaT = parameters.deltaT
tEnd = parameters.tEnd
#Open the output file
resultsF... |
import statistics
import matplotlib.pyplot as plt
import numpy as np
# The function responsible for displaying the plots in the screen
def visualiser(time_stats, memory_stats, path_stats):
# Converting to appropriate data
func_names = []
performance = []
error = []
peak_memory = []
avg_path =... |
''' CNN.py
Implementation of Convolutional Neural Network
Author: <NAME>
Date: 19.03.2015
Version: 1.0
TODO: implement max pooling
TODO: deconvolution
TODO: Try multiple layers
'''
import sys
import numpy as np
import pylab as pl
from scipy.optimize import minimize
import scipy.io
import scipy.linalg
im... |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
import matplotlib.animation
class Grid:
def __init__(self, x, y):
print(self.na(x,y))
def na(self, x, y):
self.list1 = [x for x in range(0, self.x)]
self.list2 = [y for y in range(0, self.y)]
ar = np.array([s... |
"""Navigation Kalman filters."""
from collections import OrderedDict
import numpy as np
import pandas as pd
from scipy.linalg import cholesky, cho_solve, solve_triangular
from . import dcm, earth, util
N_BASE_STATES = 7
DR1 = 0
DR2 = 1
DV1 = 2
DV2 = 3
PHI1 = 4
PHI2 = 5
PSI3 = 6
DRE = 0
DRN = 1
DVE = 2
DVN = 3
DH = 4... |
"""
Original code from <NAME> for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by <NAME> and <NAME>
Adapted for CS294-112 Fall 2018 by <NAME> and <NAME>
Adapted for pytorch version by <NAME>
"""
import numpy as np
import torch
import gym
import logz
import scipy.signal
import os
import ... |
<filename>mlmodels/model_tf/misc/tf_nlp/text-classification/47.triplet-loss-lstm.py
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import os
import random
import time
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from matplotlib import offsetbox
from scipy.spatial.distance import cdi... |
import time,os,sys
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
from scipy.stats impor... |
<filename>src/quocslib/optimalalgorithms/dCRABNoisyAlgorithm.py<gh_stars>0
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Copyright 2021- QuOCS Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... |
<reponame>Yuexiaoxi10/Key-Frame-Proposal-Network-for-Efficient-Pose-Estimation-in-Videos
import numpy as np
import torch
from PIL import Image,ImageFilter,ImageEnhance
from torchvision import transforms
import torch.utils.data as data
from torch.utils.data import DataLoader
import numpy as np
from h5py import File
imp... |
<filename>nodeeditor/dev_Curves.py
# implemenation of the compute methods for category
import numpy as np
import random
import time
import os.path
from os import path
import matplotlib.pyplot as plt
import scipy.interpolate
from nodeeditor.say import *
import nodeeditor.store as store
import nodeeditor.pfwrap as pfw... |
<reponame>whzup/quadpy
"""
Two of the schemes also appear in
<NAME>, <NAME>,
Numerical Evaluation of Multiple Integrals II,
Mathematical Tables and Other Aids to Computation.
Vol. 12, No. 64 (Oct., 1958), pp. 272-280,
<https://www.jstor.org/stable/2002370>
"""
from sympy import Rational as frac
from sympy import sqrt
... |
<filename>stRT/preprocess/preprocess/slices_alignment.py
from typing import List, Tuple
import numpy as np
import pandas as pd
import torch
from anndata import AnnData
from scipy.sparse import isspmatrix
from scipy.spatial import distance_matrix
from ...logging import Logger
def pairwise_align(
slice1: AnnData,... |
import datetime
import statistics
import webbrowser
from pathlib import Path
import plotly.graph_objs as go
from jinja2 import PackageLoader, Environment
from plotly.offline import plot, iplot
template_env = Environment(
loader=PackageLoader('JSSP', 'templates'),
autoescape=True
)
benchmark_template = "bench... |
#!/usr/bin/env python
# Built-in imports
import math
import cmath
# General module imports
import numpy as np
# Own imports
import baxter_essentials.denavit_hartenberg as dh
class BaxterIPK:
"""
Calculate Baxter's Inverse Pose Kinematics for each limb and with the
desired degrees of freedom for the tot... |
<reponame>JeremyBYU/polylidar<filename>examples/python/for_paper/polygon_example_research_statement.py<gh_stars>100-1000
# This example requires a mesh that I have not distributed.
import time
import logging
import warnings
import numpy as np
from copy import deepcopy
from scipy.spatial.transform import Rotation as R
... |
<gh_stars>1-10
"""
TODO:
- Feature: Clicking on a point in the parameter space plots the integral curve with that initial condition
so that the parameter space can be explored interactively.
- Feature: Link the x axes for all the plots in 1D embedding domain.
-
"""
import glob
import heisenberg.library.util
im... |
<reponame>MilesQLi/Theano-Lights<gh_stars>100-1000
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import RandomStreams
import numpy as... |
<filename>exp/bezier/diff_exp.py<gh_stars>100-1000
from sympy import *
#f = Function('f')
#eq = Derivative(f(x), x) + 1
#res = dsolve(eq, f(x), ics={f(0):0})
#print(res)
x = Function('x')
y = Function('y')
t = symbols('t')
x1, y1, x2, y2, yx1, yx2 = symbols('x1 y1 x2 y2 yx1 yx2')
# constant speed
eq = Derivative(Der... |
import collections
from scipy.optimize import linear_sum_assignment
import numpy as np
import pytest
import importlib
import sys
def load_solver_lapsolver():
from lapsolver import solve_dense
def run(costs):
rids, cids = solve_dense(costs)
return costs[rids, cids].sum()
return run
def lo... |
<reponame>arnav-agrawal/excalibur-alpha<gh_stars>0
import os
import numpy as np
import pandas as pd
import re
import time
import requests
import sys
import numba
from bs4 import BeautifulSoup
from scipy.interpolate import UnivariateSpline as Interp
from .hapi import molecularMass, moleculeName, isotopologueName
from .... |
<reponame>rafiahmed40/media-workflow
'''
Diagnostic functions for detecting outliers in the data
'''
import pandas as pd
import numpy as np
from scipy.spatial.distance import mahalanobis
from numpy.linalg import LinAlgError
def mahalanobis_distances(df, axis=0):
'''
Returns a pandas Series with Mahalanobis d... |
# -*- coding: utf-8 -*-
#############################################################
# Copyright (c) 2020-2021 <NAME> #
# #
# This software is open-source and is distributed under the #
# BSD 3-Clause "New" or "Revised" License #... |
# Strong Password detection wth Regexes
# By <NAME>
import re
import Plot
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
from docx import Document
from docx.shared import Inches, Pt
from docx.enum.table import WD_TABLE_ALIGNMENT
with open('Pass10k.txt', encoding="utf-8") as file:
data =... |
# Copyright (c) 2021, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from z3 import *
import sympy as sp
import logging
from src.shared.sympy_converte... |
"""Pig Dice Game Start Module."""
import random
import statistics
import menu
import get_winner
class Main:
@staticmethod
def main():
"""Will print out game menus and loop the game."""
while True:
print("<<<<< Two Dice Pig Game >>>>>")
print("\nRules")
p... |
import time
import cv2 as cv
import numpy as np
from libs.centroid_object_tracker import CentroidTracker
from scipy.spatial import distance as dist
class Distancing:
def __init__(self, config):
self.config = config
self.ui = None
self.detector = None
self.device = self.config.get_... |
"""
Tests module analysis.connections.
Note: The pickles used here (segmentations/*.pkl) are real, except that
large (image) arrays that are not needed in tests were removed in
order to fit the GutHub size limit.
# Author: <NAME>
# $Id$
"""
from __future__ import unicode_literals
__version__ = "$Revision$"
from c... |
from picamera.array import PiYUVArray, PiRGBArray
from picamera import PiCamera
from scipy.signal import find_peaks, butter, filtfilt
import time
import matplotlib.pyplot as plt
import skimage as ski
res = (640, 480)
camera = PiCamera()
# Check the link below for the combinations between mode and resolution
# http... |
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 5 08:43:24 2019
@author: constatza
"""
import warnings
import numpy as np
import pandas as pd
import scipy.stats as st
from dataclasses import dataclass
@dataclass
class StochasticField:
"""
axis : axis along which the field varies (not the dimension of the fie... |
# This file is part of Frhodo. Copyright © 2020, UChicago Argonne, LLC
# and licensed under BSD-3-Clause. See License.txt in the top-level
# directory for license and copyright information.
from tabulate import tabulate
import matplotlib as mpl
import numpy as np
from scipy import stats
from convert_units import Oo... |
"""
This module provides functions for transforming curves to different models.
"""
from public import public
from sympy import FF, symbols, Poly
from .coordinates import AffineCoordinateModel
from .curve import EllipticCurve
from .mod import Mod
from .model import ShortWeierstrassModel, MontgomeryModel, TwistedEdward... |
#!/usr/bin/env python
"""
"""
import argparse
import os
import h5py
import numpy as np
import astropy.table
from astropy.io import fits
import scipy.interpolate
import matplotlib as mpl
mpl.use('Agg')
mpl.rcParams.update({'font.size': 18})
mpl.rcParams.update({'savefig.dpi': 200})
mpl.rcParams.update({'savefig.bbox... |
import numpy as np
from scipy.linalg import expm, cholesky
import warnings
from . import init, units, utils
class Update(object):
"""
Abstract base class describing single updates to position or velocity (or
other members of the state dict), a list of these is used to construct
an integrator; each u... |
from . import util as utils
from . import pack_points, obs, get_bond
import matplotlib.pyplot as plt
import numpy as np
import scipy
from math import pi
import sys
import os
import csv
i = scipy.pi
dot = scipy.dot
sin = scipy.sin
cos = scipy.cos
ar = scipy.array
def plot_set_points():
pack = pack_points()
fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.