text string |
|---|
<gh_stars>1-10
import csv
from math import sqrt
from numpy import min as np_min
from random import randint
from sympy import nextprime
SOURCE_FILE_NAME = 'facts.csv'
FIRST_N_USERS = 100
TOTAL_HASH_FUNCTIONS = 100
def jaccard(list_a, list_b):
# List stored 'hit' in song_id - no zeros in both records
# When va... |
<reponame>Garfield-kh/PoseTriplet<gh_stars>1-10
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import numpy as np
import torch
import torchgeometry as tgm
from common.utils ... |
<reponame>abefrandsen/numerical_computing
# Solutions to problem 1
import scipy as sp
import numpy as sp
from matplotlib import pyplot as plt
from scipy import signal
def getFrame(m):
coeffs = []
k_max = int(sp.pi*2**(m+1))
for k in xrange(k_max):
coeffs.append(-2**m*(sp.cos((k+1)*2**(-m)) - sp.cos... |
<reponame>jcartus/Lanczos<filename>qm.py
"""This module contains the quantum mechanical core of the project. It has
representations of the systems and its states as well as
a function to start the simulation of a system.
Author:
<NAME>, <NAME>
"""
import numpy as np
from scipy.sparse import dok_matrix
import ma... |
from pathlib import Path
from shutil import which
from geopandas.geodataframe import GeoDataFrame
from ipywidgets.widgets import widget
from keplergl import KeplerGl
import pandas as pd
import geopandas as gpd
from typing import Union
from .config import load_config
import contextily as ctx
import matplotlib.pyplot as ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 22 20:48:45 2017
@author: Chrystiann
"""
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 3 20:15:56 2017
@author: s1465002
"""
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
... |
<filename>gap/bcmark.py
import sys
from pathlib import Path
from time import time
from statistics import mean
from pygraphblas import *
def load_sources(subdir):
fname = 'GAP/GAP-{0}/GAP-{0}_sources.mtx'.format(subdir)
if not Path(fname).exists():
raise Exception('No sourcefile for {} found at {}'.for... |
import wx.grid as gridlib
import pandas as pd
import numpy as np
import copy
import ciw
import re
import math
import statistics
import random
import imp
adapt = imp.load_source('adapt', 'src/adapt.py')
summary = imp.load_source('summary', 'src/Summary.py')
cluster = imp.load_source('cluster', 'src/clustering.py')
tra... |
import json
import os
import pandas as pd
import numpy as np
import cPickle as pickle
import hickle
from collections import Counter
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
import urllib
import tarfile
from PIL import Image
from core.vggnet import Vgg19
import tensorflow as tf
from scipy... |
# -*- coding: utf-8 -*-
"""
This script is used to run convert the raw data to train and test data
It is designed to be idempotent [stateless transformation]
Usage:
python ./scripts/etl.py
"""
from pathlib import Path
import click
import pandas as pd
import numpy as np
import calendar
import datetime as dt
import ... |
from collections import Counter
import matplotlib.pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.patches import Rectangle, Circle, ConnectionPatch
import numpy as np
from scipy.spatial import Delaunay
def delaunay_figure(box_r, convergence_bins, output_path, triang=None, children=[]... |
<filename>stellarpop/zzmass_estimator.py
from stellarpop.estimator import Estimator
class MassEstimator(Estimator):
"""
An object used to determine estimates of stellar masses. This inherits
from the base class NestedSampler, although this functionality is not
necessary for simple MCMC chains.
... |
# Reference MPMATH implementation:
#
# import mpmath
# from mpmath import nsum
#
# def Wright_Series_MPMATH(a, b, z, dps=50, method='r+s+e', steps=[1000]):
# """Compute Wright' generalized Bessel function as Series.
#
# This uses mpmath for arbitrary precision.
# """
# with mpmath.workdps(dps):
# res... |
<reponame>CKQu1/extended-criticality-dnn
import argparse
import math
import numpy as np
import os
import pandas as pd
import random
import scipy.io as sio
import seaborn as sns
import sys
import time
import torch
from numpy import dot
from scipy.stats import levy_stable
lib_path = os.getcwd()
sys.path.append(f'{lib_p... |
# %%
#!/usr/bin/env python
#
# Copyright (c) 2021, <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.
#
# CHILI 1.0
#
# kinetics.py (generates all figures (+ additional) from the published paper)
#
# Mineral... |
<gh_stars>1-10
import unittest
import os
import pandas as pd
from scipy.sparse import csr_matrix, load_npz
from MovieRecommender.train_test_model import *
test_sparse_user_item = load_npz("./tests/test_sparse_user_item.npz")
test_train_data, test_test_data, test_users_altered = test_train_split(test_sparse_user_item)
... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import netCDF4
%matplotlib inline
from scipy.stats import binned_statistic_2d
import datetime as dt
import pandas as pd
import oceans
import matplotlib.pyplot as plt
import numpy as np
import numpy.ma as ma
# <codecell>
url='http://dods.ndbc.noaa.gov/t... |
<reponame>toborobot/torchopenl3
import itertools
import os.path
import random
import tempfile
import numpy as np
import openl3
import pytest
import requests
import resampy
import scipy.stats
import soundfile as sf
import torch
from torch import tensor as T
import torchopenl3
from keras import Input, Model
from tqdm.au... |
<gh_stars>0
"""
Prior
=====
Prior class contains prior information for state and dimension variable.
"""
from operator import attrgetter
from typing import Union, Optional
import numpy as np
from scipy.sparse import diags, csr_matrix
def extend_info(info: np.ndarray, size: int) -> np.ndarray:
"""Extend infomatio... |
<reponame>louis-richard/ionacc
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Built-in imports
import argparse
# 3rd party imports
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
# from scipy import optimize
from scipy.constants import elementary_charge, mu_0
from py... |
import mne
import os.path as op
import matplotlib.pyplot as plt
from camcan.library.config import ctc, cal
from mne.preprocessing import compute_proj_ecg, compute_proj_eog
import glob
import numpy as np
from scipy.signal import hilbert
from camcan.utils import get_stc, stft
import joblib
import bct
import os
import dat... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 12 21:10:25 2021
@author: jenny
"""
import numpy as np
from scipy.integrate import solve_ivp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
#one of the critical points
fx, fy, fz = -np.sqrt(72),-np.sqrt(72),27
# Maximum time po... |
<reponame>Nokkxz/ME336-Yellow-Team-Project
# coding= utf8
"""
.. module:: link
This module implements the Link class.
"""
import numpy as np
import sympy
# Ikpy imports
from . import geometry_utils
class Link(object):
"""
Base Link class.
Parameters
----------
name: string
The name of th... |
import torch
from torch.autograd import Variable
import numpy as np
import util
import classifier
from util import cal_macc
from lib import generate_syn_feature
from binary_classifier import BINARY_CLASSIFIER
from knn_classifier import KNNClassifier
import os
from datetime import datetime
import pickle
import numpy as ... |
"""Spectrogram."""
from matplotlib.colors import BoundaryNorm
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import numpy as np
from scipy.io import wavfile
# 讀入單一檔案測試
sampling_rate, frequency = wavfile.read('一分鐘,吸睛說話術-bt-_c9DxQmY.wav')
FFT_SIZE = sampling_rate
time = len(frequency) / sampl... |
import backend as F
import numpy as np
import scipy as sp
import dgl
import torch as th
from dgl import utils
import os
import time
client_namebook = { 0:'127.0.0.1:50061' }
server_namebook = { 0:'127.0.0.1:50062' }
def start_server(server_embed):
server = dgl.contrib.KVServer(
server_id=0,
cli... |
<reponame>BillKiller/ECG_shandong<filename>dataset.py
# -*- coding: utf-8 -*-
'''
@time: 2019/9/8 19:47
@ author: javis
'''
import os
import copy
import torch
import numpy as np
import pandas as pd
from config import config
from torch.utils.data import Dataset
from sklearn.preprocessing import scale
from scipy import... |
<filename>modules/dynamicsTools.py
from numpy import *
from numpy import random
from random import sample
from numpy.linalg import cond
from numpy.linalg import eigh,norm,inv
from scipy.linalg import eig,svdvals,qr
from matplotlib.pyplot import *
def smooth_cov(N,t,tau):
cov=empty((N,N))
for i in range(N):
... |
#!/usr/bin/python
import sys, string
from random import choice
import random
from string import ascii_lowercase
from scipy.stats import beta, uniform
import numpy as np
import struct
import pandas as pd
import math
import data_gen_utils
############################################################################
# N... |
<gh_stars>10-100
from __future__ import division
import gensim
import numpy as np
from numpy import log, pi, linalg, exp
from scipy.special import gamma, gammaln
import random
from collections import defaultdict
class Wishart(object):
def __init__(self, word_vecs):
self.nu = None
self.kappa = No... |
import numpy as np
import librosa.display
from librosa import time_to_frames
from scipy.signal import find_peaks
import matplotlib.pyplot as plt
import math
class Audio():
def __init__(self, y, sr, n_fft, hop_len):
self.y = y
self.SR = sr
self.N_FFT = n_fft
self.HOP_LEN = hop_len
... |
import numpy as np
import matplotlib.pyplot as plt
import pdb
from scipy.optimize import minimize
from horsetailmatching import HorsetailMatching, UncertainParameter
from horsetailmatching import UniformParameter, GaussianParameter
from horsetailmatching.demoproblems import TP3
def main():
def plotHorsetail(theH... |
"""
_ _____
| | /___ \ Intelligent Infrastructure
| | ___| | script created by: <NAME>
| | / ___/ 16/08/2011
| | | |___ info: <EMAIL>
|_| |_____| Copyright (c) Intelligent Infrastructure 2011
=====================
Dependencies:
1. Matplotlib
2. SciPy
3. NumPy
4. Gui crea... |
import warnings
warnings.filterwarnings("ignore")
import os
import re
import numpy as np
import scipy.io as io
from util import strs
from dataset.data_util import pil_load_img
from dataset.dataload import TextDataset, TextInstance
import cv2
from util import io as libio
class TotalText(TextDataset):
def __init__... |
""" Fitting of various models. """
import warnings
import operator
import matplotlib.pyplot as plt
import numpy as np
import scipy
from typing import Tuple, Dict, Any
from lmfit.model import Model, ModelResult
from qcodes.data.data_array import DataArray
import qtt.pgeometry
from qtt.algorithms.functions import Fer... |
"""
Module for performing two-dimensional coaddition of spectra.
.. include common links, assuming primary doc root is up one directory
.. include:: ../links.rst
"""
import os
import copy
from IPython import embed
import numpy as np
import scipy
from matplotlib import pyplot as plt
from astropy.io import fits
from... |
<reponame>minrk/sympy
from sympy import (Lambda, Symbol, Function, Derivative, Subs, sqrt,
log, exp, Rational, Float, sin, cos, acos, diff, I, re, im,
oo, zoo, nan, E, expand, pi, O, Sum, S, polygamma, loggamma,
Tuple, Dummy)
from sympy.utilities.pytest import XFAIL, raises
from sympy.abc import... |
<gh_stars>1-10
# data generators for AxProf
import numpy as np
import random
import math
from AxProfUtil import writeDataToFile
import scipy
# Generates numbers of the form a*i+b for i in [0..length)
def linearGenerator(length, a, b):
output = length * [0]
for i in range(length):
output[i] = a * i + b
retu... |
"""
It contains the functions to build the tree and compute all the interactions.
"""
import time
import numpy
from scipy.special import comb
# Wrapped code
from pygbe.tree.multipole import multipole_c, setIndex, getIndex_arr, multipole_sort, multipoleKt_sort
from pygbe.tree.direct import direct_c, direct_sort, direct... |
<reponame>DiogoRibeiro7/Finance
import numpy as np
import scipy.stats
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
T = 1
S_0 = 100;
r = 0.05;
sigma = np.linspace(0.01, 2, num=100)
K = np.linspace(S_0 * 0.1, S_0*2, num=200)
def get_bs_price(s, sigma, t, r, k):
phi_arg_1 = (np.log(s/k) +... |
<filename>burgers1d/analytical.py
# -*- coding: utf-8 -*-
"""
@author: Fidel
Generates analytical solutions to the 1D Burgers equation for PINN training
data and analytics. Check GitHub for the original paper.
"""
import numpy as np
import pandas as pd
from scipy import integrate
from matplotlib import pyp... |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 26 11:55:32 2021
@author: Diloz
"""
import cv2
import numpy as np
import pandas as pd
from scipy import ndimage
from scipy import optimize
import matplotlib.pylab as plt
from joblib import Parallel, delayed
from Detect_colorChecker import paralell... |
<reponame>gsamarakoon/ParadoxTrading<filename>ParadoxTrading/Indicator/General/MA.py
import statistics
from collections import deque
from ParadoxTrading.Indicator.IndicatorAbstract import IndicatorAbstract
from ParadoxTrading.Utils import DataStruct
class MA(IndicatorAbstract):
"""
rolling ma
"""
de... |
<filename>Chapter06/6_extract_features.py
from scipy import misc
import tensorflow as tf
import numpy as np
import os
import facenet
print facenet
from facenet import load_model, prewhiten
import align.detect_face
def load_and_align_data(image_paths,
image_size=160,
mar... |
"""The WaveBlocks Project
This file contains code for evaluating inner products
and matrix elements by using standard quadrature rules.
Here we handle the inhomogeneous case.
@author: <NAME>
@copyright: Copyright (C) 2013, 2014, 2016 <NAME>
@license: Modified BSD License
"""
from numpy import zeros, ones, imag, conj... |
<gh_stars>1-10
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import numpy as np
from scipy.interpolate import griddata
def calc_psi_norm(R, Z, psi, xpt, axis_mag):
# normalize psi
# psi_interp = Rbf(R, Z, psi)
# psi_min = psi_interp(axis_mag[0], axis_mag[1])
#
# psi_shifted = psi - psi_min # set... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.5.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# Trying to follow...
# https://ceholden.github.io/open... |
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright 2016 <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
#
# Un... |
<reponame>yuzhu561/digitalgeo
#!/usr/bin/env python3
import numpy as np
import random
import math
from netCDF4 import Dataset
from scipy import signal
import imageio
from skimage import segmentation as seg
import matplotlib.pyplot as plt
from PIL import Image
from skimage import transform
from collections import Counte... |
# MIT License
# Copyright (c) 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 restriction, including without limitation the rights
# to use, copy, modify, merge, publish... |
<gh_stars>10-100
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from math import sqrt
import numpy as np
from scipy import interpolate
def GetDivisors(x):
l_div = []
i = 1
while i<x:
if x%i == 0:
l_div.append(i)
i = i + 1
return... |
"""
This script makes a stand-alone 'executable' of the wflow models. It is tested using
Anaconda on windows 64 bit and ubuntu xenial 64 bit
supported tagets:
- normal
- openda - includes thrift connection to openda, Make sure you have thrift installed first
- deltashell - includes bmi/mmi link top deltashell. Windo... |
##########################################
# File: fit_uniform_bspline.py #
# Copyright <NAME> 2014. #
# Distributed under the MIT License. #
# (See accompany file LICENSE or copy at #
# http://opensource.org/licenses/MIT) #
##########################################
# Imports
from __future__ im... |
<gh_stars>1-10
from __future__ import division
from __future__ import print_function
from __future__ import division
from __future__ import print_function
import numpy as np
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# %tensorflow_version 1.14
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
... |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# # **World Cup 2018 Prediction by <NAME>**
#
# The purpose of this is to try and predict the top 3 teams for World Cup 2018 using classification models coupled with poisson distribution to predict the exact results of the semi-finals, third place playoff and final... |
#!/usr/bin/env python
import numpy as np
import sys
import scipy.io as io_mat
from subprocess import call
import os
import matplotlib
#matplotlib.use('Svg')
import matplotlib.pyplot as plt
font = {'weight' : 'normal',
'size' : 12}
matplotlib.rc('font', **font)
name_sol = sys.argv[1]
matfile = [name_sol+ ... |
import argparse
import glob
import math
import os
from datetime import datetime
from collections import deque
import cv2
import numpy as np
from scipy import io as sio
from tensorpack.predict import OfflinePredictor, PredictConfig
from tensorpack.tfutils.sessinit import get_model_loader
from tensorpack.tfutils.export... |
'''
SequenceViz.py
Visualizes sequential Data as a plot of colored bars of the estimated state
as calculated by the Viterbi algorithm. Displays a separate grid for each
jobname specified where each row corresponds to a sequence and each column
to a taskid. By default, the final lap from each taskid is used; however,... |
<reponame>wqliu657/mint
import vedo
import torch
import time
import numpy as np
from scipy.spatial.transform import Rotation as R
from scipy import linalg
# See https://github.com/google/aistplusplus_api/ for installation
from aist_plusplus.features.kinetic import extract_kinetic_features
from aist_plusplus.features.... |
<gh_stars>1-10
import os
import logging
from mxboard import SummaryWriter
import glob
import itertools
import numpy as np
import nibabel as nib
import mxnet as mx
from mxnet import gluon, autograd, ndarray as nd
from mxnet.gluon.nn import Activation, Conv3D, Conv3DTranspose, \
BatchNorm, HybridSequential, HybridBl... |
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import time
import numpy as np
import cv2
import tensorflow as tf
from tensorflow.contrib.layers.python.layers import utils
import matplotlib.pyplot as plt
import sys
... |
import sys
from random import shuffle
import pickle as pk
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
import numpy as np
import scipy.io
from keras.optimizers import SGD
from keras.utils import np_utils, generic_utils
from sklearn.preprocessing import LabelEncoder
impor... |
import argparse
import os
import inflect
import matplotlib.pyplot as plt
import torch
import numpy as np
import matplotlib
from scipy.io.wavfile import write
from os.path import dirname, abspath
import sys
sys.path.append(dirname(dirname(abspath(__file__))))
matplotlib.use("Agg")
import glow # noqa
from training.tac... |
# This script runs a simulation of a Lennard-Jones gas and plots the resulting autocorrelation function
# averaged over many particles
# <NAME> 2014
from matplotlib import pyplot
from scipy import *
from numpy import *
from random import randrange
from vergas_funcs import *
lat = init_lattice(100)
temps = linspace(... |
<filename>src/py/crankshaft/crankshaft/regression/glm/base.py
from __future__ import print_function
import numpy as np
from scipy import stats
from utils import cache_readonly
class Results(object):
"""
Class to contain model results
Parameters
----------
model : class instance
the previou... |
import ipdb
import sys
sys.path.append("../../models")
from clvm_tfp_poisson_link import fit_model as fit_clvm_link
from clvm_tfp_poisson import fit_model as fit_clvm_nonnegative
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from scipy.stats import norm
from scipy.stats import multivariate_n... |
<reponame>schoolofdata-ch/DataBasic
import textmining, logging
from scipy import spatial
def term_document_matrix(texts):
term_doc_matrix = textmining.TermDocumentMatrix(tokenizer=textmining.simple_tokenize_remove_stopwords)
for t in texts:
term_doc_matrix.add_doc(t)
return term_doc_matrix
def com... |
# Copyright 2019 IBM Corporation
#
# 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, ... |
import numpy as np
import collections
import logging
def parse_cli():
""" argparse capabilites that enables user to input values to change output
:param: user inputed values for one or more of filename, bradycardia
threshold, tachycardia threshold, signal type,
and desired minute HR average
:re... |
from scipy import weave, zeros_like
def filter(a):
if a.ndim != 2:
raise ValueError, "a must be 2-d"
code = r"""
int i,j;
for(i=1;i<Na[0]-1;i++) {
for(j=1;j<Na[1]-1;j++) {
B2(i,j) = A2(i,j) + (A2(i-1,j) +
A2(i+1,j) + A2(i,j-1)
+ A2... |
<reponame>zzhmark/vaa3d_tools
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: brain_env.py
# Author: <NAME> <<EMAIL>>
import csv
import itertools
def warn(*args, **kwargs):
pass
import warnings
warnings.warn = warn
warnings.simplefilter("ignore", category=PendingDeprecationWarning)
import os
import sys... |
# -*- coding: UTF-8 -*-
# Version 3.1; <NAME>, <NAME>; Polar Geospatial Center, University of Minnesota; 2019
# Translated from MATLAB code written by <NAME>, Ohio State University, 2018
from __future__ import division
import math
import os
import re
import sys
import traceback
from warnings import warn
if sys.versi... |
<reponame>Sangbaek/clas12-nflows
#!/usr/bin/env python3
"""
A script to run nflow in HPC, like eofe cluster
"""
import pickle
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.use('pdf')
import sklearn.datasets as datasets
import itertools
import numpy as np
from datetime import datetime
from scipy.stats im... |
#!/usr/local/sci/bin/python
# PYTHON3.6.1
#
# Author: <NAME>
# Created: 18 Jul 2018
# Last update: 15 Apr 2019
# Location: /data/local/hadkw/HADCRUH2/UPDATE2017/PROGS/PYTHON/
# GitHub: https://github.com/Kate-Willett/HadISDH_Build
# -----------------------
# CODE PURPOSE AND OUTPUT
# -----------------------
# TH... |
# Copyright (c) 2021 Mira Geoscience Ltd.
#
# This file is part of geoapps.
#
# geoapps is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
import re
import dask
import matplotlib.pyplot as plt
import numpy as np
import plotly.express as p... |
<filename>projects/WSL/tools/proposal_convert.py
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import os
import sys
from multiprocessing import Pool
from pathlib import Path
import cv2
import scipy.io as sio
from six.moves import cPickle as pickle
from tqdm import... |
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
import scipy.ndimage as ndi
import pyglet
INIT_SNAKE_LENGTH = 3
BORDER_COLOR = (0,0,0)
SNAKE_COLOR = (0,200,0)
SNAKE_HEAD_COLOR = (0,255,0)
FOOD_COLOR = (255,0,0)
DIRECTIONS_DICT = {
0: (0,1),
1: (0,-1),
2: (-1,... |
<reponame>karlnapf/kernel_goodness_of_fit
from time import time
from scipy.stats import norm
from statsmodels.tsa.stattools import acf
from sampplers.austerity import austerity
from sgld_test.constants import SIGMA_1, SIGMA_2
from sgld_test.mcmc_convergance.cosnt import NUMBER_OF_TESTS, NO_OF_SAMPELS_IN_TEST, CHAIN_SIZ... |
import sys
sys.path.append('../..')
import numpy as np
from scipy.linalg import eigh
from tudaesasII.beam2d import Beam2D, update_K, update_M, DOF
# number of nodes along x
nx = 100
# geometry
length = 10
h = 1
w = h/10
Izz = h**3*w/12
A = w*h
# material properties
E = 70e9
nu = 0.33
rho = 2.6e3
# creating mesh
x... |
import torch
from functools import lru_cache
@lru_cache
def O3_clebsch_gordan(l_out, l_in, l_filter):
from e3nn import o3
cg = o3.wigner_3j(l_out, l_in, l_filter) # [m_out, m_in, m]
return cg
def irr_repr(order, alpha, beta, gamma, dtype=None, device=None):
from lie_learn.representations.SO3.wigner... |
import csv
import datetime
import itertools
import math
import os
import random
import sys
import time
import warnings
from collections import OrderedDict, defaultdict
from numbers import Number
from random import shuffle
import pandas as pd
import numpy as np
from numpy.random import beta
from scipy import stats
from... |
<reponame>industrial-sloth/thunder
import shutil
import tempfile
from numpy import array, allclose, transpose, random, dot, corrcoef, diag
from numpy.linalg import norm
import scipy.linalg as LinAlg
from thunder.factorization.ica import ICA
from thunder.factorization.svd import SVD
from thunder.factorization.nmf import... |
<reponame>nutrik/pymole
import numpy as np
from .div1DNonUniform import div1DNonUniform
from scipy import sparse
from scipy.sparse import csr_matrix
def div3DNonUniform(k, xticks, yticks, zticks):
"""Computes a three-dimensional non-uniform mimetic divergence operator
Arguments:
k (int): Order of acc... |
# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified).
__all__ = ['split_data', 'split_data_by_time', 'rmse', 'set_rf_samples', 'reset_rf_samples', 'RfRegressor',
'CorrelatedColumns', 'RfOptimizer']
# Cell
import pandas as pd
from sklearn.ensemble import RandomForestRegress... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
surfaces --- Models for surfaces
================================
.. autosummary::
:toctree: generated/
Surface Models
--------------
SurfaceRadiation
DAp
DApColor
HG
NEATM
Phase functions
---------------
phaseHG
... |
<filename>venv/Lib/site-packages/statsmodels/sandbox/nonparametric/kdecovclass.py<gh_stars>1000+
'''subclassing kde
Author: <NAME>
'''
import numpy as np
from numpy.testing import assert_almost_equal, assert_
import scipy
from scipy import stats
import matplotlib.pylab as plt
class gaussian_kde_set_covariance(stats... |
<filename>optimizationTest.py
import numpy as np
from PIL import Image
from scipy import ndimage
from skimage.measure import CircleModel
import time
from curveDrawing import createImage, loadImage, displayImage
class CurvesImage:
def __init__(self, imagePath, imageWidth, imageHeight):
self.imageWi... |
<filename>reVX/least_cost_xmission/least_cost_xmission.py
# -*- coding: utf-8 -*-
"""
Module to compute least cost xmission paths, distances, and costs one or
more SC points
"""
from concurrent.futures import as_completed
import geopandas as gpd
import json
import logging
import numpy as np
import os
import pandas as p... |
import pandas
from sklearn import model_selection
from sklearn.linear_model import LogisticRegression
import pickle
import codecs
import json
import gensim
import numpy as np
import math
import random
import numpy
import operator
import scipy
import Queue
from heapq import nlargest
import sys
start = int(sys.argv[1]) ... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from ...pvtpy.black_oil import Pvt,Oil,Water,Gas
from scipy.optimize import root_scalar
from .inflow import OilInflow, GasInflow
from ...utils import intercept_curves
from typing import Union
## Incompressible pressure drop
def potential_energy_ch... |
# -*- coding: utf-8 -*-
from pathlib import Path
from scipy.io import mmwrite
from sklearn.feature_extraction.text import CountVectorizer
from fintopics import config
def prepare_bow_matrix(labeled) -> None:
"""Function to prepare the BOW matrix."""
savedir = Path(config['data']['save_path'])
cvect = C... |
<filename>comptools/effective_area.py
from __future__ import division
import numpy as np
from scipy.optimize import curve_fit
try:
from icecube.weighting.weighting import from_simprod
except ImportError as e:
pass
from .base import requires_icecube
from .simfunctions import level3_sim_files
from .io import l... |
<reponame>Saro00/pna<gh_stars>0
import time
import dgl
import torch
from torch.utils.data import Dataset
import random as rd
from ogb.graphproppred import Evaluator
from scipy import sparse as sp
import numpy as np
import itertools
import torch.utils.data
import pandas as pd
import shutil, os
import os.path as osp
fr... |
<gh_stars>1-10
import os
import math
import time
import imageio
import decimal
import random
import numpy as np
from scipy import misc
import skimage.color as sc
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
import torch.nn as nn
from torch.autograd import Variable
from tqdm import tqd... |
""" valley points Indicator
"""
import scipy.signal as scipySignal
import numpy as np
from analyzers.utils import IndicatorUtils
class Valley_Loc(IndicatorUtils):
def analyze(self, historical_data, period_count=14,
signal=['valley_loc'], hot_thresh=None, cold_thresh=None):
dataframe = se... |
<reponame>amitdchougule/project_follow_me<filename>code/follower.py
# Copyright (c) 2017, Ele ctric Movement
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source ... |
from __future__ import print_function, division
import numpy as np
import os
import cv2
from PIL import Image
import random
from functools import partial
import tensorflow as tf
from keras.models import Model, Sequential, load_model
from keras.layers.merge import _Merge
from keras.layers import Input, Conv2D, MaxPooli... |
<reponame>emrecncelik/scikit-multilearn
import unittest
import numpy as np
import scipy.sparse as sparse
from sklearn import model_selection
from skmultilearn.tests.example import EXAMPLE_X, EXAMPLE_y
class ClassifierBaseTest(unittest.TestCase):
def get_multilabel_data_for_tests(self, sparsity_indicator):
... |
import os
import zipfile
import io
from tqdm import tqdm
import numpy as np
import time
from scipy.io.wavfile import read as wav_read
from ..utils import download_dataset
_urls = {
"https://zenodo.org/record/1290750/files/IRMAS-TrainingData.zip?download=1": "IRMAS-TrainingData.zip",
"https://zenodo.org/record... |
import config
import itertools
import pandas as pd
import numpy as np
import recordlinkage
import unittest
from common import (
export_embeddings,
export_false_positives,
export_false_negatives,
export_result_prob,
get_optimal_threshold,
get_logger,
InformationRetrievalMetrics,
log_qual... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.