text string |
|---|
<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 12 11:52:13 2021
@author: ion
"""
import tt
import scipy.io
import numpy as np
from CME import CME,Gillespie,CompleteObservations,Observations_grid
import matplotlib.pyplot as plt
import scipy.integrate
import tt.amen
import timeit
im... |
<filename>connorav/tests/test_connorav.py
import unittest
import connorav
import numpy
from scipy.stats import norm, johnsonsu
MAX_ERROR = 0.02
class TestDist(unittest.TestCase):
def setUp(self):
self.c = connorav.MSSKDistribution(0,1.0,0.0,0.0)
def test_dist(self):
mean = 2.0
... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from __future__ import division
from pandas import *
import os, os.path
import csv
from itertools import product
import numpy as np
import matplotlib.pyplot as plt
os.chdir('/home/will/Tip60Data/')
# <codecell>
microdata = read_csv('microdata.tsv', se... |
<filename>autoPyTorch/pipeline/nodes/image/cross_validation_indices.py
__author__ = "<NAME>"
__version__ = "0.0.1"
__license__ = "BSD"
import torch
import logging
import scipy.sparse
import numpy as np
import pandas as pd
import signal
import time
import math
import copy
from sklearn.model_selection import Stratified... |
<gh_stars>1-10
import numpy as np
import pandas as pd
import tensorflow as tf
import scipy.linalg as la
from rdkit import Chem as chem
from rdkit.Chem import rdmolops
from rdkit.Chem import MolFromSmiles as ms
class Conv(object):
possible_atom_list = ['C', 'N', 'O', 'S', 'F', 'P', 'Cl', 'Mg',
... |
# 07/04/2020, <NAME>, Postdoc, Edinburgh
# Read in and compare the model fits:
Compare_Mag = False # Compare fit params/model including/excluding
# the impact of magnification.
Compare_Single_Bin = True # Compare fit params obtained for each l+s bin individually
... |
<gh_stars>0
import gc
import os
from itertools import product
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scanpy as sc
import scipy.stats as sts
from tqdm.notebook import tqdm
import triku as tk
from triku.tl._triku_functions import subtract_median
from skle... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
python3 fit.py [filename] [angle_format=deg|rad] [time_format=sec|frames] [fps]
Adapted from fitting.py posted on Quercus.
The data file is named "data.txt" by default, but can be specified as an argument.
If angle_format is "deg", the angles will be converted into radians f... |
import os
import re
import sys
import csv
import numpy as np
import pandas as pd
from scipy import stats
import matplotlib.pyplot as plt
from src.main import config
def get_combined_data(file1, file2):
feature_df = pd.read_csv(file1)
feature_df = feature_df.append(pd.read_csv(file2))
train_split_df = pd.re... |
"""
Multilayer VAE + Pixel CNN
<NAME> + <NAME>
"""
import os, sys
sys.path.append(os.getcwd())
try: # This only matters on Ishaan's computer
import experiment_tools
experiment_tools.wait_for_gpu(tf=True)
except ImportError:
pass
import tflib as lib
import tflib.debug
import tflib.train_loop
import tflib.... |
<gh_stars>1-10
# -*- coding: utf8
from __future__ import division, print_function
'''
Implements models based on state space models.
'''
from _ssm_model import Model
from pyseries.data.base import TimeSeriesDataset
from scipy.optimize import fmin_l_bfgs_b
from sklearn.base import BaseEstimator
from sklearn.base impo... |
<gh_stars>1-10
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from scipy import interpolate
from pextant.lib.geoshapely import GeoPolygon, LAT_LONG, UTM, Cartesian, XY
from pextant.EnvironmentalModel import GDALMesh
from pextant.analysis.loadWaypoints impor... |
<gh_stars>1-10
from __future__ import absolute_import
from collections import defaultdict
import warnings
try:
from plotly import graph_objs as go
plotly_installed = True
except:
plotly_installed = False
# warnings.warn("PLOTLY not installed so interactive plots are not available. This may result in un... |
<reponame>oist-ncbc/kurikawa-mizuseki-fukai-2020
# modify gen_fig.py to generate figures ver4 (2019.2.22)
import numpy as np
import pylab as pl
import os
import itertools
import cmath
import math
from scipy import stats
import func as fc
"""
s-C 500-1500
R 1500-3500
delay 3500-5000
NE_EC3=240 0-240
NI_EC3=160... |
<filename>behaviours/old/scripts/feature_extractionv2.py<gh_stars>0
import numpy as np
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
from torchvision import utils
import torchvision.models as models
from torchvision.utils import save_image
import matplotlib.pyplot as... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 18:08:53 2021
@author: Hatlab_3
"""
import easygui
from plottr.apps.autoplot import autoplotDDH5, script, main
from plottr.data.datadict_storage import all_datadicts_from_hdf5
import matplotlib.pyplot as plt
import numpy as np
from measurement_modules.Helper_Function... |
from __future__ import print_function
import argparse
import torch
import torch.utils.data
import torch.nn as nn
from tgcn.nn.gcn import gcn_pool, gcn_pool_4, ChebConv, ChebTimeConv
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
import autograd.numpy as npa
from load.data_hcp import load... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
solve で虚数解が出てしまう件の調査
=================================
"""
# import standard libraries
import os
# import third-party libraries
import matplotlib.pyplot as plt
import numpy as np
from sympy import symbols
from sympy.solvers import solve
# import my libraries
import plot_... |
<reponame>koukyo1994/atmaCup5
import abc
import numpy as np
import scipy.sparse as sp
from typing import List, Tuple, Union, Optional
SparseMatrix = Union[sp.csr_matrix, Union[sp.csc_matrix, sp.coo_matrix]]
Matrix = Union[np.ndarray, SparseMatrix]
class BaseModel(metaclass=abc.ABCMeta):
def __init__(self, mode... |
try:
import pyfits
except:
from astropy.io import fits as pyfits
from pylab import *
import scipy
from scipy import optimize, interpolate
import pickle
import sys
sys.path.append("../utils/GLOBALutils")
import GLOBALutils
from multiprocessing import Pool
def clipp(vec,n=5.):
I = np.arange(len(vec))
res = n... |
#------------------------------------------------------------------------------
# Copyright (C) 1996-2010 Power System Engineering Research Center (PSERC)
# Copyright (C) 2007-2010 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... |
<gh_stars>0
# standard imports
import pandas as pd
import numpy as np
import seaborn as sns
import datetime
import matplotlib.pyplot as plt
%matplotlib inline
# normal distribution
from scipy.stats import norm
# optimization and regression imports
from scipy.optimize import minimize
from scipy import stats
# data im... |
# Program 13b: A second order recurrence relation.
# See Example 2.
from sympy import Function, rsolve
from sympy.abc import n
x = Function('x')
f = x(n+2) - x(n+1) - 6*x(n)
sol = rsolve(f, x(n), {x(0):1, x(1):2})
print('x_n = {}'.format(sol))
|
import shelve
import numpy as np
from statistics import mean, stdev, median, variance
import scipy.stats as stats
from math import sqrt
from ostap.utils.progress_bar import progress_bar
from ostap.histos.graphs import makeGraph
#===============================================================================
def num2str... |
from torch import nn
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import pdb
import scipy.io as io
import numpy as np
class CDS_Layer(object):
def __init__(self, toll=0.0000007, max_it=1000, batch_size=None):
super(CDS_Layer, self).__init__()
# self.model = mode... |
<reponame>Radionews/popcatring
from scipy.io import wavfile
samplerate, data = wavfile.read('pop_16000.wav')
print ("{")
i=0
out = ""
for data_i in data:
i=i+1
out = out+str(data_i)+","
if i==16:
i = 0
print(out)
out = ""
print("}")
print(len(data)) |
# -*- coding: utf-8 -*-
"""Calculate land-atmosphere coupling indices via ESMValTool.
This script is based on code contributed by <NAME>.
"""
import cartopy.crs as ccrs
import iris
import iris.analysis.stats as istats
import iris.plot as iplt
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats as ... |
<reponame>kwierman/ArchitectureResource<gh_stars>0
from larcv import larcv
larcv.IOManager
from ROOT import TChain
import numpy as np
import scipy.misc as smp
from matplotlib import pyplot as plt
class ImageWriter(object):
"""
Prints the highest energy particle to file.
usage:
my_image_writer = ImagesW... |
"""This file contains functions that implement the following approaches
to consistency-based belief change in a graph-oriented setting:
1. Global completion: ``eb.global_completion(G)``
2. Simple iteration: ``eb.iterate_simple(G)``
3. Expanding iteration: ``eb.iterate_expanding(G)``
4. Augmenting iteration: ``eb.iter... |
<reponame>Tillsten/skultrafast<gh_stars>1-10
# -*- coding: utf-8 -*-
import numpy as np
import scipy.stats as st
import scipy.signal as sig
from collections import namedtuple
from scipy.constants import c, physical_constants
tup = namedtuple('tup','wl t data')
def add_to_cls(cls):
def function_enum(fn... |
import os
os.environ["OMP_NUM_THREADS"] = "1"
import time
import numpy as np
from scipy import linalg
class bcolors:
WARNING = '\033[93m'
ENDC = '\033[0m'
def tridiagmm_scipy(A,B,C):
diag = np.diag(A)
l_diag = np.diag(A,-1)
u_diag = np.diag(A,1)
for i in range(diag.shape[0]):
tmp = li... |
<filename>ssdaq/bin/terminaldumpers.py
from ssdaq import subscribers
from ssdaq.utils import common_args as cargs
from ssdaq import sslogger
from ssdaq import data
import logging
import numpy as np
import argparse
import signal
from datetime import datetime
import time
from statistics import mean
from ssdaq.core.utils ... |
<gh_stars>1-10
# Copyright 2016 Mycroft AI, Inc.
#
# This file is part of Mycroft Core.
#
# Mycroft Core is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... |
<gh_stars>0
#> \author <NAME>
#> \brief This is an example program to solve a diffusion equation using OpenCMISS calls.
#>
#> \section LICENSE
#>
#> Version: MPL 1.1/GPL 2.0/LGPL 2.1
#>
#> The contents of this file are subject to the Mozilla Public License
#> Version 1.1 (the "License"); you may not use this file excep... |
<reponame>desihub/desici<gh_stars>0
import numpy as np
import re
import glob
import matplotlib.pyplot as plt
#from scipy.interpolate import griddata
#from donutlib.donutana import donutana
from read_donut_fit import *
from getdonutanadata import *
import table as lut
import matplotlib.pyplot as plt
import scipy.optimiz... |
from sympy import *
a = Symbol('a')
A1 = Symbol('A1')
A2 = Symbol('A2')
theta = Symbol('theta')
phi = Symbol('phi')
Y00 = Ynm(0, 0, theta, phi).expand(func=True)
Y20 = Ynm(2, 0, theta, phi).expand(func=True)
Y40 = Ynm(4, 0, theta, phi).expand(func=True)
# Calc expansions
hh = A1*sin(theta)**2 + (a**2)*A2*cos(theta)*... |
<reponame>VirtualEmbryo/lumen_network
"""
config_lib.py is a file containing useful functions for generating configurations for the graph of lumens
Contents
--------
remove_single_edge
find_border
X plot_inside
sorted_edge_list
plot_edges
plot_lumens
resistance_edge
get_neighbour... |
import time
import numpy as np
from sympy import symbols, preorder_traversal, Float
from pylatex import Document, Section, Subsection, Math, Matrix, NoEscape, Figure, Command
from task1 import get_inverse, get_Lagrange, get_Euler
from task2 import create_cube_image
from task3 import get_ds2, get_deformgrad_X_Kk, get_d... |
import numpy as np
from scipy.linalg import hadamard
def gaussian_random_sketch(m, n, mean=0, variance=1):
"""
m: Sketch size,
n: Number of columns of the input matrix,
mean: mean of gaussian distribution
variance: variance of gaussian distribution
returns: An m x n matrix sample from the Gau... |
import faiss
import math
from joblib import cpu_count
from faiss import normalize_L2
from sklearn.base import TransformerMixin, BaseEstimator
from scipy.sparse import csr_matrix
import numpy as np
from ..utils import postprocess_knn_csr, TransformerChecksMixin
L2_INFO = {"metric": faiss.METRIC_L2, "sqrt": True}
MET... |
import os
import scipy.io as sio
from nipype.interfaces.base import TraitedSpec, BaseInterface, BaseInterfaceInputSpec
import shutil
class ConnImportInputSpec(BaseInterfaceInputSpec):
from nipype.interfaces.base import traits, InputMultiPath
functional_files = InputMultiPath(desc="preprocessed functional file... |
import unittest
import numpy as np
import threading
import statistics
from server_solution import ThreadedTCPServer, ThreadedTCPRequestHandler
from client_solution import TCPClient, res_mean, res_stdev
class ValuesTest(unittest.TestCase):
def test_get_mean_stdev(self):
HOST, PORT = "localhost", 9998
server ... |
#! /usr/bin/env python
import utils
from Bio import SeqIO
import seaborn
from matplotlib import pyplot
import os
import math
from math import sqrt
import multiprocessing
import numpy
import pandas
from scipy import stats
seaborn.set()
min_gamma = -4
max_gamma = 10
white = "#F2F2F2"
bracket_pairs = [("(", ")"), ("<", ... |
"""
NeuroLearn Statistics Tools
===========================
Tools to help with statistical analyses.
"""
__all__ = [
"pearson",
"zscore",
"fdr",
"holm_bonf",
"threshold",
"multi_threshold",
"winsorize",
"trim",
"calc_bpm",
"downsample",
"upsample",
"fisher_r_to_z",
... |
<filename>quakeml/training/data/training_dataset.py
"""
training_dataset.py
-------------------
This module provides classes and methods for creating a training dataset.
By: <NAME>, Ph.D., 2018
"""
# Compatibility imports
from __future__ import absolute_import, division, print_function
# 3rd party imports
import os
i... |
<reponame>imad-el-achiri/pyccel
#------------------------------------------------------------------------------------------#
# This file is part of Pyccel which is released under MIT License. See the LICENSE file or #
# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. #
#--------... |
<filename>assignment/global_optimization.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 21 15:36:06 2022
@author: bobrokerson
"""
# 1.Теперь попробуем применить к той же функции f(x) метод глобальной оптимизации — дифференциальную эволюцию.
# 2.Изучите документацию и примеры использования фу... |
import sys
import numpy as np
import os
import skimage.color as color
import matplotlib.pyplot as plt
import scipy.ndimage.interpolation as sni
import caffe
if __name__ == '__main__':
caffe.set_mode_cpu()
arg_prototxt = '/opt/col_distr/models/colorization_deploy_v2.prototxt'
arg_caffemodel = '/opt/col_distr/models/... |
<filename>dfdt/dfdt_utils.py
"""Utilities for linear drift rate measurements."""
import numpy as np
import scipy.signal
class DynamicSpectrum():
"""Holds intensity data parameters."""
def __init__(self, dt_s, df_mhz, nchan, freq_bottom_mhz, freq_top_mhz):
self.dt_s = dt_s
self.df_mhz = df_mhz... |
import numpy as np
from scipy.signal import argrelextrema
from scipy.interpolate import CubicSpline
def resid(t,f):
'''
Outline:
* do 1-point derivative to find local Max's and Min's
* this is point of possible improvement
* do cubic splines between Max's and Min's
* find running mean betw... |
import sys
import os
import math
from random import randint
from statistics import mean
import chardet
# TIMIT has 16000 sampling/frame rate
# .phn files are in units of 1/16000 of a second
# From VTR documentation: "The left column shows the frame number (10 msec each)"
# Let's work in seconds - easier to keep straig... |
<gh_stars>0
# from __future__ import division
import torch
import torch.utils.data as data
from skimage.color import rgb2gray, rgb2yuv, yuv2rgb, rgb2lab, lab2rgb
from skimage.transform import resize, rescale
import matplotlib.pyplot as plt
# import cv2
import os, math, random
from os.path import *
import numpy as np
... |
#! /usr/bin env python
"""
Code to estimate and subtract a three-components (Zodiacal, HeI from Earth, and Scattered light) background model from WFC3 IR data
"""
import numpy as np
import os,urllib.request,shutil,glob
from scipy import optimize
from astropy.convolution import Gaussian2DKernel
from astropy.convolution... |
<gh_stars>0
from app.ml_tools.transformers import *
from app.ml_tools.models import *
from app.ml_tools.helpers import *
from sklearn.pipeline import Pipeline
from sklearn.model_selection import train_test_split, GridSearchCV, RandomizedSearchCV, \
KFold, StratifiedKFold, cross_val_score
from sklearn.preprocessing ... |
import os
import sys
import subprocess
import time
import yaml
import statistics
class Corpuses:
__AVAILABLE = {
"CALGARY": {
"PATH": "FILES\\CALGARY\\",
"FILES": ["bib","book1","book2","geo","news","obj1","obj2","paper1","paper2","paper3","paper4","paper5","paper6","pic","progc","progl","progp","trans"]
},... |
<filename>tests/grouping_test.py
from .context import assert_equal, _Pow, _Add, _Mul
import pytest
from sympy import Integral, sin, Symbol, Mul, Integer, Pow
from latex2sympy.latex2sympy import process_sympy
a = Symbol('a', real=True)
b = Symbol('b', real=True)
x = Symbol('x', real=True)
theta = Symbol('theta', real=T... |
<filename>turbustat/statistics/vca_vcs/vca_vcs.py<gh_stars>0
# Licensed under an MIT open source license - see LICENSE
import numpy as np
from ..psds import pspec
import statsmodels.formula.api as sm
from pandas import Series, DataFrame
try:
from scipy.fftpack import fftn, fftfreq, fftshift
except ImportError:
... |
<reponame>ad765/jaco_trajectory
#! /usr/bin/env python
"""Takes trajectory data from xyz and uses inverse kinematics algorithms to calculate the best state. """
import rospy
import numpy
from scipy.linalg import pinv
import time
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from math import p... |
<filename>generate_dataset.py
import scipy
import random
import numpy as np
from sklearn.metrics import precision_recall_fscore_support
from sklearn.metrics import confusion_matrix
# LSTM for international airline passengers problem with time step regression framing
from keras.layers import Dense
from keras.layers i... |
#!/usr/bin/env python3
# coding: utf-8
from benchmark_0resnet50_4chls_FAN2d_18pts_1998 import extract_param
from ddfa_utils import reconstruct_vertex
from io_utils import _dump, _load
import os.path as osp
from skimage import io
import matplotlib.pyplot as plt
from benchmark_aflw2000 import convert_to_ori
from mpl_too... |
<filename>POZ.py<gh_stars>0
"""
This File solves the static EED problem with Transmission Losses and Prohibited operating Zones.
Author: <NAME>
Date : 11/06/2020
"""
import numpy as np
import math
import gurobipy as gp
from gurobipy import GRB
from gurobipy import *
import matplotlib.pyplot as plt
impo... |
<reponame>nnarenraju/ASIAA_SSP
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Project Details:
HSC_convolve.py
Performning convolution operation to obtain AB Magnitude of Spectrum
Created on Mon Oct 16 03:27:52 2017
__author__ = "nnarenraju"
__copyright__ = "Copyright 2017, AGN_Classification"
_... |
<reponame>leevilehtonen/tfq-varqbm
from collections import defaultdict
from utils import evaluate_exact_state, fidelity, plot_density_matrix_heatmap
import numpy as np
import cirq
import tensorflow as tf
import tensorflow_probability as tfp
from scipy import optimize as scipyoptimize
from hamiltonian import Hamiltonia... |
<gh_stars>0
import numpy as np
from scipy import stats
from sklearn.metrics import confusion_matrix, f1_score
y1_neg = np.array([0.6, 0.1, 0.2, 0.1])
y1_pos = np.array([0.3, -0.1, -0.3, 0.2, 0.4, -0.2])
y2_neg = np.array(["A", "B", "A", "C"])
y2_pos = np.array(["B", "C", "C", "B", "A", "C"])
y3_neg = np.array(... |
<gh_stars>10-100
import os, sys
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import copy
import numpy as np
import random
from scipy.optimize import linear_sum_assignment
from policy import Policy, PolicyWithPacking
class AlloXPolicy(Policy):
def __init__(self, alpha=1.0):
self._name = 'A... |
# -*- coding: utf-8 -*-
import numpy as np
import scipy as sp
from sklearn.externals import joblib
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
import pandas as pd
impo... |
# The training code for our ICLR position project.
# It will run on all the five groundtruth types, but you can change it only for one type, e.g., hor.
# The backbone used, VGG or ResNet, is pre-trained on ImageNet by default.
# Our work is to if the position information is encoded in the pre-trained model.
# A simple ... |
<filename>ldapkg/mymodel.py
import numpy as np
import numba
from scipy.special import digamma, polygamma
class LDA_OPT():
@staticmethod
def _convergence_(new, old, epsilon = 1.0e-3):
'''
Check convergence.
'''
return np.all(np.abs(new - old)) < epsilon
@stati... |
from mpi4py import MPI
from tacs import TACS, elements
from tmr import TMR
from paropt import ParOpt
import numpy as np
from six import iteritems
try:
from scipy.optimize import minimize
except:
minimize = None
def createTopoProblem(forest, callback, filter_type, nlevels=2,
repartition=Tr... |
<filename>test.py
import matplotlib.pyplot as plt
from scipy.io import wavfile # get the api
from scipy.fftpack import fft
from pylab import *
from pydub import AudioSegment
from pydubtest import play
# file1 = AudioSegment.from_wav('ri.wav')
# file2 = AudioSegment.from_wav('sa.wav')
# song = file1[:1000] + file2[:100... |
<filename>apollo4/DeepLearningModel.py
'''
This file contains code for all deep learning models
'''
CUDA_LAUNCH_BLOCKING="1"
import os
# install torch version 1.4.0
import torch
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0,1,2,3"
# Simple transformers doesn't have versions. Just in... |
"""
Name: <NAME>
Coordinates: Cartesian
Symmetry: Axial
"""
from sympy import diag, symbols
coords = symbols("t x y z", real=True)
variables = ()
functions = ()
t, x, y, z = coords
metric = diag(-1, t ** 2, 1, 1)
|
<filename>sosfilt/filter_design.py
import numpy as np
from scipy import signal
from ._zpk_funcs import zpk2sos_multiple
def _relative_degree(z, p):
if z.ndim == 1 and p.ndim == 1:
return len(p) - len(z)
elif z.ndim == 2 and p.ndim == 2:
return p.shape[0] - z.shape[0]
raise ValueError("re... |
# -*- coding: utf-8 -*-
"""
Module to manipulate, analyze and visualize structural geology data.
"""
from __future__ import division, print_function
from copy import deepcopy
import warnings
import pickle
import numpy as np
import matplotlib.pyplot as plt
from apsg.helpers import (
KentDistribution,
sind,... |
<gh_stars>0
import numpy as np
import math
import cv2
import random
from scipy import ndimage
from skimage.draw import line, disk, ellipse_perimeter, circle_perimeter, rectangle_perimeter, rectangle
from pathlib import Path
import matplotlib.pyplot as plt
import glob
import argparse
nLinesMax = 8
pSmall ... |
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium import webdriver
from bs4 import BeautifulSoup
from random import uniform
from time import sleep
from faker import Faker
from scipy.io import... |
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from scipy.spatial.distance import pdist, cdist, squareform
from sklearn.decomposition import NMF
from sklearn.decomposition import LatentDirichletAllocation as LDA
from nltk.tokenize import sent_toke... |
<reponame>benti/Error-Pypagation
from numpy import *
from scipy.stats import t as student_t
import numpy as np
from errorpro.quantities import Quantity
def mean_value(quantity_to_assign, quantities, weighted, force_weighted):
# put all values and errors into arrays
values = np.ndarray((0),dtype=np.float_)
errors = ... |
import os
from datetime import datetime
from tqdm import tqdm
from copy import deepcopy
import matplotlib
matplotlib.use('agg') # use non-interactive backend for pdf plotting
matplotlib.rcParams['axes.spines.right'] = False
matplotlib.rcParams['axes.spines.top'] = False
matplotlib.rcParams['pdf.fonttype'] = 42
matplot... |
# prototype object for handling multiple QoI for a given OpenMDAO problem
from __future__ import division, print_function
import os, sys, errno, copy
# pyStatReduce specific imports
import numpy as np
import chaospy as cp
from pystatreduce.stochastic_collocation import StochasticCollocation
from pystatreduce.quantity_... |
from contextlib import contextmanager
import numpy as np
from numpy.testing import assert_allclose
import pytest
from sympy import lambdify
from beambending import Beam, DistributedLoadH, DistributedLoadV, PointLoadH, PointLoadV, PointTorque, x
def test_beam_is_correctly_created():
span = 9
my_beam = Beam(sp... |
<filename>infercnvpy/tl/_copykat.py
from typing import Optional
import pandas as pd
from scipy.sparse import issparse
from anndata import AnnData
from scanpy import logging
import os
from multiprocessing import cpu_count
def copykat(
adata: AnnData,
gene_ids: str = "S",
segmentation_cut: float = 0.1,
... |
import numpy as np
from scipy import interpolate
def u_func(x1,x2):
a = 4
b = 5
c1 = 12
c2 = 24
c3 = 3
c4 = 4
c5 = 5
c6 = 6
return c1*(x1**4/12 - a*x1**3/6) + c2*(x2**4/12 - b*x2**3/6) \
+ c3*x1*x2 + c4*x1 + c5*x2 + c6
def cubic_func(x1,x2):
return x1**3 + 2*x2**3
x1 =... |
import numpy as np
from scipy.ndimage.measurements import label
# Give option to user to play again or end game
def replay():
while True:
again = input("Would you like to play again? (Please answer yes or no) \n")
if again.lower() == "yes":
main()
break
elif again.lower() == 'no':
print (... |
<filename>radontea/_alg_bpj.py
import numpy as np
import scipy.interpolate as intp
from . import _threed, util
def backproject(sinogram: np.ndarray, angles: np.ndarray,
filtering: str = "ramp", weight_angles: bool = True,
padding: bool = True, padval: float = 0, count=None,
... |
<reponame>WWmore/compute.rhino3d
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
#---------------------------------------------------------------------------
__author__ = 'Hui'
#-----------------------------------------------------... |
<gh_stars>100-1000
import scipy.io as sio
import numpy as np
import os
try:
del smt_train # does a exist in the current namespace
del y
except NameError:
smt_train = None
y = None
sess = 1
#for문 끝숫자는 포함 안된다 ㅋㅋ 전체 사용자의경우 55로 해야함
for i in range(1,2):
dataname = 'sess%02d_subj%02d_EEG_MI.mat' % (sess... |
"""A program that will calculate the length of a curve between two points"""
from sympy import Derivative, Integral, Symbol, sqrt, SympifyError, sympify
def find_length(expr, var, lower, upper):
deriv = Derivative(expr, var).doit()
length = Integral(sqrt(1 + deriv**2), (var, lower, upper)).doit()
return ... |
<gh_stars>1-10
############################################
# imports
############################################
import sys
import numpy as np
import pandas as pd
from bisect import bisect
from scipy.stats import f_oneway, chisquare
from statsmodels.stats import multitest
from sklearn.utils import resample
######... |
import argparse
from astropy.io import ascii
from pandeia.engine.perform_calculation import perform_calculation
import json
import os
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.table import Table
from scipy.optimize import minimize
import numpy as np
import warnings
import pysynphot as S ... |
<filename>dicodile/utils/dictionary.py
import numpy as np
from scipy import signal
from .csc import reconstruct
from . import check_random_state
from .shape_helpers import get_valid_support
def get_max_error_dict(X, z, D, window=False):
"""Get the maximal reconstruction error patch from the data as a new atom
... |
<gh_stars>0
import unittest
from statistics import mean, variance, stdev
from math import isnan, sqrt
from fractions import Fraction
from numbers import Rational
from coba.utilities import check_pandas_support
from coba.statistics import BatchMeanEstimator, OnlineVariance, OnlineMean, StatisticalEstimate
class Stati... |
<filename>loose_seal/loose_seal_analysis_pipeline_3_plot.py<gh_stars>0
# %% [markdown]
# ## 0 | Import packages and load data
# %%
# Import packages
import os
import tkinter
from tkinter.filedialog import askopenfilename, askopenfilenames, askdirectory
import h5py
from collections import defaultdict
from nptdms import... |
<gh_stars>1-10
#!/bin/python
from scipy import *
from numpy import *
seed_min = 1
seed_max = 1
alpha_min = 0
alpha_max = 0
beta_min = 0
beta_max = 0
fout1=open('Run.bash','w')
fout2=open('Parameters01.txt','w')
fout3=open('Create_Folders.bash','w')
print >> fout1, '#!/bin/bash'
print >> fout1, 'source Bash_archiv... |
<reponame>yamasakih/gtm-generativetopographicmapping<filename>Python/gtm.py
# -*- coding: utf-8 -*-
#%reset -f
"""
@author: <NAME>
"""
# GTM (generative topographic mapping) class
import numpy as np
from scipy.spatial.distance import cdist
from scipy.stats import norm, multivariate_normal
from sklearn.decomposition i... |
<reponame>mehfoos/Nuclear-Fusion<filename>IcfLabWk1/fitting.py
import numpy as np
from scipy.optimize import curve_fit
import icf
# This function will generate a perfect Gaussian
# You can replace this function with any other you want to fit with...
def gaussian(x, *params):
A = params[0]
x0 = params[1]
c = para... |
import math
from scipy import spatial
def cosineS(text1,text2):
value=0
#get word count
t1=text1.lower().split(' ')
t2=text2.lower().split(' ')
f1={}
f2={}
t=''
t=t1+t2 #concatenate them together
#remove duplicate words
for word in t2:
if word in t1:
t.remove(word)
#compute vectors
for i in t:... |
import numpy as np
import networkx as nx
import itertools
import h5py
import time
import math
import context
from utils.graph_utils import rand_permute_adj_matrix, is_isomorphic_from_adj, ged_from_adj, ged_from_adj_ged4py
from sympy.utilities.iterables import multiset_permutations
def generate_ged_exact(save_path, n... |
<reponame>aimagelab/MCMR
"""
Computes Lx and it's derivative, where L is the graph laplacian on the mesh with cotangent weights.
1. Given V, F, computes the cotangent matrix (for each face, computes the angles) in pytorch.
2. Then it's taken to NP and sparse L is constructed.
Mesh laplacian computation follows <NAME>... |
<reponame>yhtang/GraphDot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from sympy.codegen import ast
from sympy.printing.cxx import CXX11CodePrinter
class CUDACXX11CodePrinter(CXX11CodePrinter):
_ns = ''
def __init__(self, settings):
super().__init__(settings)
def __call__(self, expr, symbol_to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.