text string |
|---|
import os
import requests
from itertools import chain, count, groupby, starmap
from functools import lru_cache, partial
from operator import itemgetter, methodcaller
from random import randint
from statistics import harmonic_mean
from uuid import uuid4
import neuralknight
@lru_cache(maxsize=1024)
def get_score(leaf,... |
<gh_stars>1-10
from sympy import (
sqrt, Derivative, symbols, collect, Function, factor, Wild, S,
collect_const, log, fraction, I, cos, Add, O,sin, rcollect,
Mul, Pow, radsimp, diff, root, Symbol, Rational, exp, Abs)
from sympy.core.expr import unchanged
from sympy.core.mul import _unevaluated_Mul as umul
... |
#!/usr/bin/env python
####################################################################
### This is the PYTHON version of program 5.3 from page 184 of #
### "Modeling Infectious Disease in humans and animals" #
### by Keeling & Rohani. #
### #
### It is the simple SIR ep... |
<filename>pycqed/instrument_drivers/meta_instrument/mwg_lo_calibration.py
import scipy as sp
from qcodes import validators as vals
from qcodes.instrument.parameter import ManualParameter
def mwg_with_lo_calibration_template(mwg_class):
"""
A class decorator that adds dynamic parameter update functionality to... |
from __future__ import division, print_function, unicode_literals
from decimal import Decimal
from fractions import Fraction
from functools import reduce
from io import StringIO
from itertools import chain, count, groupby, permutations, product, repeat
from operator import itemgetter
from unittest import TestCase
fro... |
import matplotlib
matplotlib.use('tkagg')
import matplotlib.pyplot as plt
import sys
import pickle
import seaborn as sns
import scipy.stats as ss
import numpy as np
import core_compute as cc
import core_plot as cp
def feval(param, T, D):
A = np.zeros((np.atleast_2d(param)[..., 0]*T).shape)
for... |
<filename>PM/analyzer_formula.py
import sys
import math
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import argrelextrema
def MovingAverage(values, window):
weights = np.repeat(1.0, window)/window
smas = np.convolve(values, weights, 'valid')
return smas
def ExpMovingAver... |
<reponame>krystophny/chaospy<gh_stars>1-10
"""Log-Normal probability distribution."""
import numpy
from scipy import special
from ..baseclass import Dist
from ..operators.addition import Add
from .deprecate import deprecation_warning
class log_normal(Dist):
def __init__(self, a=1):
Dist.__init__(self, a... |
<gh_stars>1-10
'''
-This program serve to obtain the value of the maximum black hole abundance for
a Log-Normal mass function and for values of \sigma=[1,0.6,0.4]
parameter.
@Return: A txt file with the values of maximum f_{PBH} for each value of Mc.
@author:<NAME>
@Date:14/06/21
'''
from time import... |
#import matplotlib
#matplotlib.use('Agg')
#import matplotlib.pyplot as plt
import os
import numpy as np
from skimage import io;
import glob;
import cv2 ;
import sys;
import scipy
from skimage.measure import label
from skimage import filters
import math
from skimage.transform import resize
'''
Use previous... |
<reponame>oytundemirbilek/ReMI-Net-Star
import numpy as np
from scipy.stats import multivariate_normal
from utils import antiVectorize
from random import randint
# --------------------------------------------------------------
# SHAPE: (n_subjects, n_timepoints, n_rois, n_rois, n_views)
# --------------------... |
<filename>lokki/feature_transform/feature_selection/hfe.py
import re
import sys
import numpy as np
import pandas as pd
from treelib import Node, Tree
from scipy.stats import pearsonr
from sklearn.feature_selection import mutual_info_classif
from lokki.feature_transform import FeatureTransformChoice
class HFE(Featur... |
<reponame>halilagin/d3studies<filename>backend/BayesianStats/src/kruschke/CH03_GaussianPlot.py
import matplotlib.pyplot as plt
import numpy as np;
import time
from pylab import *
from drawnow import drawnow, figure
from filterpy.discrete_bayes import normalize
from filterpy.discrete_bayes import predict
from filterpy.... |
<filename>regDriver.py
'''
Main module to run the regDriver method
@author: <NAME>
'''
from ParseCellInfo import parse_cellinfodict_to_populate_data, populate_cellinfo_dirs
from GetMotifMutScores import score_motifs_according_to_their_affect, file_len, \
calculate_p_value_motifregions, get_number_of_mutations_... |
<gh_stars>0
# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
<reponame>mfkasim91/anoa<filename>anoa/functions/fftpack.py
import numpy as np
from exceptions import *
import anoa.operators.fftpack as pm
from anoa.functions.decorator import unary_function, binary_function
import scipy.fftpack as scft
__all__ = ["dct", "idct", "dst", "idst", "fft", "ifft",
"dct2", "idct2... |
<reponame>PhySci/LightAutoML<gh_stars>1-10
"""Internal representation of dataset in numpy, pandas and csr formats."""
from copy import copy # , deepcopy
from typing import Any
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import TypeVar
from typin... |
import numpy as np
from ple import PLE
import random
from ple.games.monsterkong import MonsterKong
from collections import deque
from scipy.misc import imresize
from evolution_strategy import *
class Agent:
MEMORY_SIZE = 300
BATCH = 32
POPULATION_SIZE = 15
SIGMA = 0.1
LEARNING_RATE = 0.03
EPSI... |
<gh_stars>1000+
#!/usr/bin/env python
# coding: utf-8
# DO NOT EDIT
# Autogenerated from the notebook gls.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # Generalized Least Squares
import numpy as np
import statsmodels.api as sm
# The Longley dataset is a time ... |
<reponame>giammi56/iminuit<gh_stars>0
import numpy as np
from numpy.random import default_rng
from matplotlib import pyplot as plt
import matplotlib as mpl
from matplotlib.ticker import LogLocator
import os
import pickle
mpl.rcParams.update(mpl.rcParamsDefault)
class TrackingFcn:
def __init__(self, rng, npar):
... |
#!/usr/bin/env python
# coding: utf-8
# # SSD Evaluation Tutorial
#
# This is a brief tutorial that explains how compute the average precisions for any trained SSD model using the `Evaluator` class. The `Evaluator` computes the average precisions according to the Pascal VOC pre-2010 or post-2010 detection evaluation ... |
"""PyFstat search & follow-up classes using MCMC-based methods
The general approach is described in
Ashton & Prix (PRD 97, 103020, 2018):
https://arxiv.org/abs/1802.05450
and we use the `ptemcee` sampler
described in Vousden et al. (MNRAS 455, 1919-1937, 2016):
https://arxiv.org/abs/1501.05823
and based on Foreman-Mac... |
<filename>src/routes/lists/one.py
from starlette.responses import RedirectResponse
from pydantic import Field, confloat, conlist
from fastapi import APIRouter
from src.models import input, output
from src.utils import responses
from src.utils import vector
import cmath
import math
router = APIRouter(prefix='/list/on... |
<filename>code/geertsma_disk.py
"""
Forward modelling of elastic reservoir deformation produced by a single
disk-shaped reservoir.
The displacement and stress components are computed by using the Geertsma's
model (Fjær et al., 2008, Appendix D-5). The equations are valid outside the
reservoir.
References
----------
... |
<reponame>umamibeef/pyscf<filename>pyscf/pbc/x2c/sfx2c1e.py
#!/usr/bin/env python
# Copyright 2014-2021 The PySCF Developers. All Rights Reserved.
#
# 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... |
<reponame>AngCamp/Stienmetz2019Reanalyzed
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 3 23:08:38 2022
@author: angus
YET TO BE RUN TAKES A VERY LONG TIME, MAY NEED TO BE CHANGED TO REPORT WHICH TESS ARE
BEING PASSED
Please Note all functions here assume all times tested will be within trial
int... |
"""
.. module:: analyze
:synopsis: Extract data from chains and produce plots
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
Collection of functions needed to analyze the Markov chains.
This module defines as well a class :class:`Information`, that stores useful
quantities, and shortens the... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
<reponame>drammock/mne-tools.github.io
# -*- coding: utf-8 -*-
"""
================================================
Source localization with a custom inverse solver
================================================
The objective of this example is to show how to plug a custom inverse solver
in MNE in order to facilate ... |
#!/home/kevinml/anaconda3/bin/python3.7
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 27 13:15:02 2019
@author: juangabriel and <NAME>
"""
# Clustering Jerárquico
# =======================================================================================================
# PASOS
#
# Hay 2 tipos de agrupaciones jerarqu... |
<filename>L3_optical_flow.py
import cv2
import numpy as np
from scipy import ndimage
from pathlib import Path
import imageio
# import matplotlib.pyplot as plt
# from skimage.filters import threshold_local
from skimage.filters import threshold_otsu
from skimage import morphology
from datetime import datetime
import csv
... |
<filename>DEPTH/depthsummary_cpow.py
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 16:37:23 2013
@author: hari
"""
import numpy as np
from scipy import io
import pylab as pl
def plotDepthResults(subjlist, numCondsToPlot, harm = 1):
#froot = '/home/hari/Documents/PythonCodes/research/DepthResults/' ... |
import pdb
import sys
import os
from scipy.io import loadmat
import torch
sys.path.append("../src")
import stats.svGPFA.svPosteriorOnIndPoints
import utils.svGPFA.initUtils
def test_buildQSigma():
tol = 1e-5
dataFilename = os.path.join(os.path.dirname(__file__), "data/get_full_from_lowplusdiag.mat")
mat =... |
<reponame>c-meyer/github-spielwiese<filename>tests/test_element.py
# -*- coding: utf-8 -*-
'''
Test for checking the stiffness matrices.
'''
import unittest
import numpy as np
import scipy as sp
import nose
from numpy.testing import assert_allclose, assert_almost_equal
import amfe
from amfe import Tri3, Tri6, Quad4, ... |
<filename>code/multidop_time.py<gh_stars>0
import matplotlib
# Needed for Blues
matplotlib.use('agg')
from matplotlib import rcParams
from matplotlib import pyplot as plt
# PyART
import pyart
import gzip
import sys
from scipy import ndimage
import shutil, os
from datetime import timedelta, datetime
import numpy as np
i... |
<reponame>kemerelab/ghostipy
import numpy as np
from abc import ABC, abstractmethod
from numba import njit
from scipy.signal import correlate
__all__ = ['Wavelet',
'MorseWavelet',
'AmorWavelet',
'BumpWavelet']
def reference_coi(psifn, reference_scale, *, threshold=1/(np.e**2)):
""... |
<filename>ridt/equation/eddy_diffusion.py
import warnings
import numpy
from typing import List
from typing import Tuple
from typing import Union
from itertools import product
from tqdm import tqdm
from numpy import ndarray
from numpy import array
from numpy import zeros
from numpy import exp
from numpy import log... |
<reponame>yuqj1990/deepano_train
import os, sys
import numpy as np
import cv2
from PIL import Image
import argparse
import random
from scipy import misc
import math
import re
import tensorflow as tf
from tensorflow.python.platform import gfile
# my idea is input five images into the cnn net and get the 512-dimension fe... |
# vim: fileencoding=utf-8
# vim: foldmethod=marker foldenable:
"""
[X] emoji
[ ] wego icon
[ ] v2.wttr.in
[X] astronomical (sunset)
[X] time
[X] frames
[X] colorize rain data
[ ] date + locales
[X] wind color
[ ] highlight current date
[ ] bind to real site
[ ] max values: temperature
[X] max value: rain
[ ] comment g... |
from __future__ import annotations
from itertools import product
import numpy as np
from scipy.ndimage import map_coordinates
from .transform import Transformer
from .utils import grid_field
class ImageTransformer:
def __init__(
self,
img,
control_points,
deformed_control_points,... |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Feb 2018
@author: Chester (<NAME>)
"""
""""""""""""""""""""""""""""""
# import libraries
""""""""""""""""""""""""""""""
import os
import warnings
warnings.filterwarnings('ignore')
# ignore all warnings
warnings.simplefilter("ignore")
os.environ["PYTHONWARNINGS"]... |
# <NAME>
import os
import sys
import platform
import numpy as np
from time import sleep
from PIL import ImageGrab
from game_control import *
from predict import predict
from scipy.misc import imresize
from game_control import get_id
from get_dataset import save_img
from multiprocessing import Process
from keras.models ... |
from __future__ import annotations
from scipy.interpolate import griddata # type: ignore
import numpy as np
import math
from pyscses.set_up_calculation import site_from_input_file, load_site_data
from pyscses.grid import index_of_grid_at_x, phi_at_x, energy_at_x
from pyscses.constants import boltzmann_eV
from pyscses.d... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import torch
import matplotlib.pyplot as plt
from scipy.io import loadmat
import deepxde as dde
from deepxde.backend import tf
def gen_testdata():
data = loadmat("usol_D_... |
<filename>scipy/sparse/linalg/eigen/lobpcg/tests/test_lobpcg.py<gh_stars>1-10
""" Test functions for the sparse.linalg.eigen.lobpcg module
"""
from __future__ import division, print_function, absolute_import
import itertools
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal,
... |
<gh_stars>0
'''
jonn_lib.py
last updated 03/28/2020
'''
import os
import gc
import dcor
import smtplib
import mysql.connector
import numpy as np
import pandas as pd
import os.path as op
import cvxopt as cvx
import networkx as nx
import seaborn as sns
import scipy.stats as ss
import yahoofinancials as yf
import statsm... |
#!/usr/bin/env python
import time
import os
import random
import threading
import argparse
import matplotlib.pyplot as plt
import numpy as np
import scipy as sc
import cv2
from collections import namedtuple
import torch
from torch.autograd import Variable
from robot import Robot
from trainer import Trainer
from logger... |
from typing import Tuple
import pandas as pd
from scipy.spatial import distance
from evidently.analyzers.stattests.utils import get_binned_data
from evidently.analyzers.stattests.registry import StatTest, register_stattest
def _jensenshannon(
reference_data: pd.Series,
current_data: pd.Series,
... |
#!/usr/bin/env python3
import sys, os, re, pysam
import scipy.stats as stats
MY_DIR = os.path.dirname(os.path.realpath(__file__))
PRE_DIR = os.path.join(MY_DIR, os.pardir)
sys.path.append( PRE_DIR )
import genomicFileHandler.genomic_file_handlers as genome
from genomicFileHandler.read_info_extractor import *
nan =... |
import numpy as np
import math
import time
from scipy.spatial.transform import Rotation
from ..common import Vec, equal_angle
from .realtime.constants import *
class Joints(Vec):
'''
A vector of 6 elements representing joint properties. The order is: base, shoulder, elbow, wrist1, wrist2, wrist3.
'''
... |
# -*- coding: utf-8 -*-
##########################################################################
# NSAp - Copyright (C) CEA, 2020
# Distributed under the terms of the CeCILL-B license, as published by
# the CEA-CNRS-INRIA. Refer to the LICENSE file or to
# http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
#... |
<filename>NaiveBayes/NaiveBayes.py
import numpy as np
from statistics import mean, pvariance
from math import pi, exp
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris as iris
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
class NaiveBay... |
<gh_stars>0
import heterocl as hcl
import numpy as np
import time
import math
#import plotly.graph_objects as go
from compute_graphs.custom_graph_functions import *
from plots.plotting_utilities import *
from user_definer import *
from argparse import ArgumentParser
from compute_graphs.graph_3d import *
from compute_g... |
<gh_stars>1-10
import numpy as np
from scipy.optimize import least_squares
from sklearn.cluster import KMeans
from sklearn.neighbors import NearestNeighbors
def sol_u(t, u0, alpha, beta):
"""The analytical solution of unspliced mRNA kinetics.
Arguments
---------
t: :class:`~numpy.ndarray`
A ve... |
<filename>PyOCTCalibration/toolbox/spectra_processing.py
'''_____Standard imports_____'''
import numpy as np
import json
import scipy.fftpack as fp
import matplotlib.pyplot as plt
import sys
'''_____Project imports_____'''
from toolbox.filters import butter_highpass_filter
from toolbox.calibration_processing import l... |
<reponame>hungcn/VocGAN
import random
import subprocess
import numpy as np
from scipy.io.wavfile import read
def weights_init(m):
classname = m.__class__.__name__
if classname.find("Conv") != -1:
m.weight.data.normal_(0.0, 0.02)
elif classname.find("BatchNorm2d") != -1:
m.weight.data.norma... |
from scipy.io import loadmat
import numpy as np
from torch.utils.data import Dataset
from stanford_cars_data_config import CarCommonDatasetAttributes
import logging
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)
class AStanfordCarDataset(Dataset):
TRANSFORMED_IMAGE = 'train'
LABEL ... |
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
import scipy.stats as st
start=time.time()
TRAIN_FILES = ['202008'+str(i).zfill(2)+'.csv' for i in range(1,32)]
PATH = '../data/train/train_head/'
drivers = {}
for i, fn in tqdm(enumerate(TRAIN_FILES)):
with open(PATH+fn, 'r') as f:
... |
"""Tools for setting up printing in interactive sessions. """
def _init_python_printing(stringify_func):
"""Setup printing in Python interactive session. """
import __builtin__, sys
def displayhook(arg):
"""Python's pretty-printer display hook.
This function was adapted from:
... |
from ._discrete_distribution import DiscreteDistribution
from numpy import *
from scipy.stats import norm
class IIDStdGaussian(DiscreteDistribution):
"""
A wrapper around NumPy's IID Standard Uniform generator `numpy.random.randn`.
>>> dd = IIDStdGaussian(dimension=2,seed=7)
>>> dd.gen_samples(4)
... |
# -*- coding: utf-8 -*-
"""
音声ファイルを作る
===================
"""
# import standard libraries
import os
# import third-party libraries
import numpy as np
import numpy.fft as fft
from scipy.io import wavfile
import turbo_colormap
from scipy import interpolate
# import my libraries
# import test_pattern_generator2 as tpg
... |
<reponame>twhughes/autodidact<filename>autograd/sparse/sparse_wrapper.py
from __future__ import absolute_import
import types
from autograd.tracer import primitive, notrace_primitive
import scipy.sparse as _sp
# ----- Non-differentiable functions -----
nograd_functions = [_sp.shape]
def wrap_intdtype(cls):
class ... |
import numpy as np
import pdb
import numpy.random as npr
import networkx as nx
from scipy.sparse.linalg import eigs
from sklearn.cluster import KMeans
import varinf as varinf
import heapq as hp
from util import *
from scipy.stats import wasserstein_distance
def init_moments(data, hyper, seed = None, sparse = True, uns... |
<gh_stars>1-10
import numpy as np
from scipy import ndimage
import matplotlib.pyplot as plt
class Image:
"""
Processor class for annotating 3D scans.
Arguments:
voxels: a 3D numpy array
voxel_size: a tuple/list of three numbers indicating the voxel size in mm,
cm etc point_position: the positi... |
from typing import Tuple
import torch
import numpy as np
from scipy.special import erfcinv
class Lattice(object):
"""
Lattice is an object that describe the periodicity of the lattice.
Note that this object does not know about atoms.
For the integrated object between the lattice and atoms, please see S... |
<reponame>janbrumm/layermodel_lib
# This file is part of LayerModel_lib
#
# A tool to compute the transmission behaviour of plane electromagnetic waves
# through human tissue.
#
# Copyright (C) 2018 <NAME>
#
# Licensed under MIT license.
#
import random
import warnings
import logging
import numpy as np
import g... |
<gh_stars>0
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
r"""
.. _meta1:
================================================
Run Estimators on a simulated dataset
================================================
PyMARE implements a range of m... |
from sklearn.metrics.pairwise import rbf_kernel
from scipy.stats import ks_2samp
from scipy.stats import wilcoxon
import numpy as np
import random
from scipy import stats
import time
from collections import defaultdict
import numpy as np
import warnings
from scipy.stats import rankdata
def same(x):
return x
def... |
'''
[B, stats] = hublasso(y, X,c,lambda,b0,sig0,...)
hublasso computes the M-Lasso estimate for a given penalty parameter
using Huber's loss function
INPUT:
yx: Numeric data vector of size N (output,respones)
Xx: Numeric data matrix of size N x p (inputs,predictors,features).
Each row repres... |
"""
problem71.py
https://projecteuler.net/problem=71
Consider the fraction, n/d, where n and d are positive integers. If n<d and
HCF(n,d)=1, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d ≤ 8 in ascending order of
size, we get:
1/8, 1/7, 1/6, 1/5, 1/4, 2/7, 1/3, 3/8, 2/... |
<reponame>dtiarks/ThesisPlot<filename>Chap5/EIT_Propagation.py
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 20 17:49:13 2016
@author: tstolz
"""
import numpy as np
from scipy.special import erf
PHI = lambda x: 0.5 * (1 + erf(x / np.sqrt(2)))
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
i... |
<gh_stars>1-10
"""
Simplicial Complex Propagating Labels - Iris DataSet
===================================================
Analysis of the Threshold Value.
----------------------------------------------------
**Author**: <NAME>
**Tittle**: diameter_var_cancer_scpl.py
**Project**: Semi-Supervised Learning Using Comp... |
import os
import os.path as op
import json
import cv2
import base64
import sys
import argparse
import numpy as np
import pickle
import code
import imageio
import torch
from tqdm import tqdm
from metro.utils.tsv_file_ops import tsv_reader, tsv_writer
from metro.utils.tsv_file_ops import generate_linelist_file
from metro... |
from collections import OrderedDict
import json
from tqdm import tqdm
import numpy as np
from scipy import sparse as sp
from sklearn.feature_extraction.text import TfidfTransformer
from .files import personality_adj, value_words, liwc_dict, mxm2msd
from .preprocessing import preprocessing, filter_english_plsa
class... |
<reponame>ivuckovic/PySyft<gh_stars>0
# coding=utf-8
"""
Module math implements mathematical primitives for tensor objects
Note:The Documentation in this file follows the NumPy Doc. Style;
Hence, it is mandatory that future docs added here
strictly follow the same, to maintain readability and... |
# -*- coding: utf-8 -*-
import numbers
import numpy
import scipy.ndimage.filters
from . import _utils
@_utils._update_wrapper(scipy.ndimage.filters.generic_filter)
def generic_filter(input,
function,
size=None,
footprint=None,
mode='refle... |
# -*- coding: utf-8 -*-
import scipy.optimize
import torch
import torch.nn.functional as F
import numpy as np
import multiprocessing
def hungarian_loss(predictions, targets, thread_pool):
# predictions and targets shape :: (n, c, s)
predictions, targets = outer(predictions, targets)
# squared_error shape ... |
"""
========================================
Label Propagation digits active learning
========================================
Demonstrates an active learning technique to learn handwritten digits
using label propagation.
We start by training a label propagation model with only 10 labeled points,
then we select the t... |
<reponame>div-B-equals-0/dust-wave-case-studies
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext_format_version: '1.2'
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# language_info:
# codemirror_mode:
# name: ipython
# version: 3
# file_extension: .py... |
<filename>tweets_analysis.py
import codecs
import json
import math
import os
import shutil
import preprocessor as p
import re
import numpy as np
import seaborn
from kneed import KneeLocator
from scipy.spatial.distance import cdist
from sklearn.decomposition import NMF, PCA
from sklearn.feature_extraction.text import ... |
"""Uses TF-IDF, SVD, and cosine distance to classify documents"""
import sklearn
import scipy
import numpy as np
import pandas as pd
import argparse
from tools import *
from sklearn.decomposition import TruncatedSVD
from copy import deepcopy
from sklearn.svm import LinearSVC, SVC
from sklearn.pipeline import make_pip... |
from pathlib import Path
import shutil
from audio_utils import peak_norm
import os
from numpy.core.defchararray import partition
import numpy as np
import random
from itertools import repeat
from scipy import stats
import soundfile as sf
from glob import glob
from matplotlib import pyplot as plt
import ... |
import numpy as np
from scipy.spatial.distance import pdist, squareform
class Solution:
def numberOfBoomerangs(self, points: List[List[int]]) -> int:
def dist_counter(dis):
m = np.unique(dis, return_counts=True)[1]
return np.sum(m * (m - 1))
return sum(dist_counter(x) for ... |
<filename>utils/dataloaders/auto_augment.py<gh_stars>10-100
#https://github.com/4uiiurz1/pytorch-auto-augment/blob/master/auto_augment.py
import random
import numpy as np
import scipy
from scipy import ndimage
from PIL import Image, ImageEnhance, ImageOps
class AutoAugment(object):
def __init__(self):
sel... |
<reponame>kawatadaisuke/PerSp
#
# dVrotVrVz
#
# reading DR/*.fits
#
import pyfits
import math
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.gridspec as gridspec
from matplotlib import patches
from scipy import stats
from scipy import optimize
import ... |
from __future__ import (print_function, unicode_literals, absolute_import, division)
import scipy.ndimage as ndimage
import scipy.interpolate as interpolate
import numpy as np
__all__ = ['Slit']
# =============================================================================
# Slit Class
# =================... |
import math
import cv2
import matplotlib.cm
import numpy as np
from scipy.ndimage.filters import gaussian_filter, maximum_filter
from scipy.ndimage.morphology import generate_binary_structure
# It is better to use 0.1 as threshold when evaluation, but 0.3 for demo
# purpose.
cmap = matplotlib.cm.get_cmap('hsv')
# He... |
""" Test Region Extractor and its functions """
import numpy as np
import nibabel
from scipy import ndimage
from nose.tools import assert_equal, assert_true, assert_not_equal
from nilearn.regions import (connected_regions, RegionExtractor,
connected_label_regions)
from nilearn.regions.re... |
<filename>flask/src/cnn_pipeline.py
import tensorflow as tf
import prettytensor as pt
import numpy as np
import scipy.io as io
import argparse
import cnn_models as models
import sys
import os
import cnn_data_loader as data_loader
from collections import defaultdict
from constants import *
from progressbar import ETA,... |
"""
EARM 1.3 (extrinsic apoptosis reaction model)
<NAME>, <NAME>, <NAME>, <NAME> (2012) Exploring the Contextual
Sensitivity of Factors that Determine Cell-to-Cell Variability in
Receptor-Mediated Apoptosis. PLoS Comput Biol 8(4): e1002482.
doi:10.1371/journal.pcbi.1002482
http://www.ploscompbiol.org/article/info:doi... |
<reponame>ataymano/estimators<gh_stars>0
# CR(-2) is particularly computationally convenient
from math import inf
from estimators.bandits import base
from typing import List, Optional
from estimators.math import IncrementalFsum
class EstimatorImpl:
wmin: float
wmax: float
n: IncrementalFsum
sumw: Inc... |
<gh_stars>10-100
"""Brillouin zone and slice geometries."""
import itertools
from dataclasses import dataclass, field
from typing import List, Optional, Tuple
import numpy as np
from monty.json import MSONable
from pymatgen.core.structure import Structure
__all__ = ["ReciprocalSlice", "ReciprocalCell", "WignerSeitzC... |
<filename>python/pumapy/utilities/isosurface.py
import numpy as np
from skimage import measure
import scipy.ndimage as ndimage
import pyvista as pv
from pumapy.utilities.workspace import Workspace
from pumapy.utilities.generic_checks import check_ws_cutoff
def generate_isosurface(workspace, cutoff, flag_closed_edges=... |
<filename>implementations/adams_bashforth.py
from sympy import Point2D
def method(f, p, h, n, order):
print "Running Adams-Bashforth of order {} for {} iterations".format(order, n)
points = []
y = 0
ys = []
ts = []
pts = [x for x in p]
for i in range(order):
points.insert(... |
import numpy as np
import scipy.io
mat = scipy.io.loadmat('globalIcpOut.mat')
print(mat['R'][0,:].shape)
%creates all H
for k=1:length(R)-1
for i=1:length(pcs)
H(1:4,1:4,k,i)=eye(4);
H(1:3,1:3,k,i)=R{i,k};
H(1:3,4,k,i)=t{i,k};
end
end
%%
%merges all H
% last index is pc index
mergedH = repmat(eye(4... |
<gh_stars>0
"""InVEST Carbon Edge Effect Model.
An implementation of the model described in 'Degradation in carbon stocks
near tropical forest edges', by <NAME>. al (in review).
"""
from __future__ import absolute_import
import os
import logging
import time
import uuid
from . import utils
import numpy
from osgeo impo... |
"""Iterpolations
* :class:`.BarycentricRational`
* :function:`._q`
* :function:`._compute_roots`
* :function:`._mp_svd`
* :function:`._mp_qr`
* :function:`._nullspace_vector`
* :function:`._compute_roots`
* :function:`._mp_svd`
* :function:`._mp_qr`
* :function:`._nullspace_vector`
* :function:`.chebyshev_pts`
* :funct... |
<reponame>cophi-wue/Word-Embeddings-in-the-Digital-Humanities<filename>embedding/evaluation.py
import argparse
import itertools
import sys
import gensim.models.keyedvectors
import numpy as np
import pandas
import torch
from scipy.spatial.distance import cosine
from scipy.stats import spearmanr
from sklearn.metrics imp... |
<gh_stars>0
import tarfile
from StringIO import StringIO
from random import shuffle
import sys
from time import time
from pyext._MakeDataPyExt import resizeJPEG
import itertools
import os
import cPickle
import scipy.io
import math
import argparse as argp
# Set this to True to crop images to square. In this case each i... |
<gh_stars>0
from pylsl import StreamInlet, resolve_stream
import sys
import time
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from scipy.integrate import simps
from scipy import signal
import eegspectrum
def main(epochTime,fileNumber):
i=0
# first resolve an ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.