text string |
|---|
"""
Itt van az összes igénybevett beépített funkció.
"""
import collections, contextlib, functools, inspect, itertools, json, logging, math, random, re, statistics, subprocess, time, threading, typing, os, unittest.mock
abspath = os.path.abspath
call_mock = unittest.mock.call
Callable = typing.Callable
CalledProcessEr... |
<reponame>gpoulin/python-test<filename>optest/optest.py
import time, timeit, numpy as np
from scipy import weave
from _pure_c import rescale_c
from ctypes import cdll, CDLL, c_double, POINTER
cdll.LoadLibrary('ctype.so')
libc = CDLL('ctype.so')
def rescale_np(data, scale, offset):
return (data - offset) * scale
... |
<reponame>Cliftonz/Quantum-Visualizations<filename>HW/CalculationValidation3.py<gh_stars>0
import math
from scipy import constants
h = constants.value(u'reduced Planck constant')
pi2 = math.pow(math.pi, 2)
Final = ((2 * pi2 + 3) / (2 * pi2 - 3))
c1 = .5 * math.sqrt((6 * pi2) / (2 * pi2 - 3))
def cn(nput):
t1 ... |
"""This file provides abstraction over the tasks of computing the ranking"""
import numpy as np
import time
import scipy.sparse as sparse
from devmine.app.models.feature import Feature
from devmine.app.models.score import Score
__scores_matrix = None
__users_list = None
def __construct_weight_vector(db, query):
... |
<gh_stars>0
# AUTOGENERATED! DO NOT EDIT! File to edit: 010_finite_diff.ipynb (unless otherwise specified).
__all__ = ['get_stencil', 'apply_stencil']
# Cell
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import factorial
# define functions for getting stencile
def _get_dx_factors(num_points)... |
import librosa
import librosa.filters
import numpy as np
from scipy import signal
def spectrogram_nn(y, fs, hparams):
D = _stft(preemphasis(y, hparams), fs, hparams)
S = _amp_to_db(np.abs(D)) - hparams.ref_level_db
return S
def melspectrogram_nn(y, fs, hparams, _mel_basis):
D = _stft(preemphasis(y, ... |
"""Algorithms to determine the roots of polynomials"""
from sympy.polynomials.base import *
from sympy.polynomials import div_, groebner_
def cubic(f):
"""Computes the roots of a cubic polynomial.
Usage:
======
This function is called by the wrapper L{roots}, don't use it
directly. The in... |
<reponame>adriangrepo/segmentl
import numpy as np
import uuid
from scipy.ndimage import distance_transform_edt
import joblib
from pycocotools import mask as cocomask
from scipy import ndimage as ndi
from segmentl.distance.utils import compute_edts_image, generate_contours
import cv2
def update_distances(dist, mask)... |
# encoding: utf-8
__author__ = '<NAME>'
"""
finWalk.py
Created by lex at 2019-07-29.
"""
from NetEmbs.GraphSampling.walk_strategies.abstract import abstractWalk
import numpy as np
from scipy.special import softmax
import random
from NetEmbs.FSN.graph import FSN
from NetEmbs.utils.Logs.make_snapshot import log_snapshot... |
import numpy as np
from geosoup.common import Handler, Opt, Sublist
from geosoup.exceptions import ImageProcessingError, ObjectNotFound
import warnings
import random
import time
import json
from osgeo import gdal, gdal_array, ogr, osr, gdalconst
np.set_printoptions(suppress=True)
# Tell GDAL to throw Python exceptions... |
import os
import cv2
import numpy as np
import tools
import sys
from scipy.optimize import curve_fit
from matplotlib import pyplot as plt
def matrix_mean_normalizer(objective, normalization):
z_means = np.mean(np.mean(normalization, axis = 2), axis = 1)
print(z_means)
sys.exit()
# Function: t... |
<gh_stars>1-10
#!/usr/bin/env python
import logging
import os
import warnings
import numpy as np
from logutils import BraceMessage as __
from matplotlib import pyplot as plt
from matplotlib import rc
from scipy.optimize import newton
from spectrum_overload import Spectrum
from bin.coadd_analysis_module import fit_chi... |
import numpy as np
import torch
import glob
import math
import sys
sys.path.insert(0, '..')
from envs.gridworld_drone import GridWorldDrone
from featureExtractor.gridworld_featureExtractor import SocialNav,LocalGlobal,FrontBackSideSimple
from featureExtractor.drone_feature_extractor import DroneFeatureSAM1, DroneFe... |
import math
import statistics
import random
import matplotlib.pyplot as plt
def lcp(str1, str2):
len_of_shorter = min(len(str1), len(str2))
len_lcp = 0
for i in range(len_of_shorter):
if str1[i] != str2[i]:
break
len_lcp += 1
return len_lcp
def read_fasta(fname):
with... |
from sympy import Symbol
from sympy.physics.mechanics import (RigidBody, Particle, ReferenceFrame,
inertia)
from sympy.physics.vector import Point, Vector
__all__ = ['Body']
class Body(RigidBody, Particle):
"""
Body is a common representation of RigidBody or a Particle.
... |
#
# Project : cloud-devops-benchmarking
# Timestamp : 30-10-2018 9:45
# Author : <NAME> <<EMAIL>>
# ---
#
"""
This module contains data models used by the benchmarking scripts
"""
import pandas as pd
from scipy import stats
# NOTE - I think I won't need this level of abstraction, I can remove it later
class ... |
<gh_stars>100-1000
import time
import json
import numpy as np
from scipy.optimize import curve_fit
from tsfel.feature_extraction.features_settings import load_json
from tsfel.feature_extraction.calc_features import calc_window_features
# curves
def n_squared(x, no):
"""The model function"""
return no * x ** 2... |
import argparse
import matplotlib
import matplotlib.image as image
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from PIL import Image
from skimage.transform import resize
from scipy.ndimage.interpolation import rotate
from sys import argv, exit
from termcolor import colored
impor... |
import numpy as np
import tensorflow as tf
from .. import misc
from . import translations_tf
from . import lowrankregistration_tf
import numbers
import scipy as sp
import scipy.optimize
def _procminicode(mini,codebook,zero_padding):
minitf = tf.identity(mini)
codetf = tf.identity(codebook)
codetf = tf.cast... |
import tensorflow as tf
from keras import backend as K
from keras.engine.topology import Layer
import numpy as np
import math
from scipy.fftpack import fft, ifft
class DftTransform(Layer):
def __init__(self, n, **kwargs):
"""
Perform Discrete Fourier Transform (DFT) Analysis and synthesis of the... |
<gh_stars>0
'''
timing: scipy
runtime=0.8869051933288574
timing: sympy
runtime=451.0642590522766
timing: gmpy
runtime=9.880879878997803
timing: choose1
runtime=0.03794503211975098
'''
from time import time
from scipy.special import comb as scipy_choose
from sympy import binomial as sympy_choose
from gmpy import co... |
from genetic_algorithm import GeneticAlgorithm
from graph import Graph
import numpy as np
from scipy.stats import ttest_rel
from tabulate import tabulate
population_sizes = (50, 100, 150)
numbers_of_generations = (50, 100, 150)
graph = Graph("graphs/games120.graph")
# graph = Graph("graphs/miles750.graph")
combination... |
<filename>src/features/build_features.py
import os
import logging
import click
import numpy as np
from tqdm import tqdm
from scipy.ndimage.interpolation import shift
from scipy.ndimage import gaussian_filter
from sklearn.preprocessing import StandardScaler
from dotenv import find_dotenv, load_dotenv
from pathlib ... |
import numpy as np
import scipy.stats
import warnings
def KDE_multiply(KDE1, KDE2, downsample=False,
random_state=None, nsamples=None):
""" Multiply two Gaussian KDEs analytically and return another
Gaussian KDE
As a Gaussian kernel density estimation is a sum of Gaussians with
t... |
import numpy as np
import deepdish as dd
from scipy.signal import welch
def interaction_band_pow(epochs, config):
"""Get the band power (psd) of the interaction forces/moments.
Parameters
----------
subject : string
subject ID e.g. 7707.
trial : string
trial e.g. HighFine, AdaptFi... |
"""Utility programs used in `min_distance.py`.
"""
from dataclasses import dataclass
import numpy as np
import scipy.linalg as spla
from typing import Optional, List, Tuple
@dataclass
class MDEResults:
"""The results from estimation and testing. """
X: int
Y: int
K: int
number_households: int
... |
# -*- coding: utf-8 -*-
"""
tests:
1. 原始資料,雷達(881x921)與模式(150x140)的網格不同
a. 2014年3月12日雨帶
b. 2014年5月20日雨帶
c. 2013年8月28-29日 Kong-Rey 颱風
2. 經過陳新淦先生以 Grace 重畫的資料 (201x183),網格相同
2014年5月20日雨帶
分析原始資料前,因為雷達COMPREF的網格比模式WRF的網格細,(雷達4x4 格等於模式 1x1格),故我們在計算之前先將網格歸一。具體方法有三:
1. 每4x4格點抽樣取1格點 (s... |
<gh_stars>0
import keras
import tensorflow as tf
print('TensorFlow version:', tf.__version__)
print('Keras version:', keras.__version__)
import os
from os.path import join
import json
import random
import itertools
import re
import datetime
# import cairocffi as cairo
import editdistance
import numpy as np
from scip... |
import networkx as nx
import scipy.io as scio
def betweenness(parameter):
"""Calculate the betweenness of mega-constellations
:param parameter: two-dimensional list about parameter of constellations
"""
constellation_num = len(parameter[0])
for constellation_index in range(constellation_num):
... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 25 09:30:08 2021
@author: Nacho
"""
# =============================================================================
# =============================================================================
""" --- LINEAR REGRESSION MODEL --- """
# ============... |
<filename>stats_scripts/cellHarmonyCombine.py
#Author <NAME> - <EMAIL>
#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, c... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Image utility functions"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy as np
from astropy.units import Quantity
from astropy.coordinates import Angle
from astropy.io import fits
from ast... |
<filename>lumopt/utilities/gradients.py
import numpy as np
from scipy.integrate import dblquad,nquad
from lumopt.utilities.scipy_wrappers import dblsimps, wrapped_GridInterpolator
from lumopt.utilities.scipy_wrappers import trapz1D,trapz3D,trapz2D
import matplotlib as mpl
from lumopt.utilities.fields import Fields
#... |
<filename>singlet/counts_table/counts_table_sparse.py
# vim: fdm=indent
# author: <NAME>
# date: 09/08/17
# content: Sparse table of gene counts
# Modules
import numpy as np
import pandas as pd
# Classes / functions
class CountsTableSparse(pd.SparseDataFrame):
'''Sparse table of gene expression count... |
<reponame>Giddius/A3A_Logster_repo<filename>a3a_logster/utility/scheduler.py
"""
[summary]
[extended_summary]
"""
# region [Imports]
from pathlib import Path, PurePath, PurePosixPath
import os
from typing import Union, Optional, Iterable, Mapping, Any, Callable, TYPE_CHECKING, AsyncContextManager
from statistics im... |
<reponame>narek-davtyan/rivgraph
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 10 09:39:19 2018
@author: Jon
"""
import rivgraph.im_utils as iu
import rivgraph.ln_utils as lnu
import numpy as np
from skimage import measure
from scipy import stats
def handle_bp(linkid, bpnode, nodes, links, links2do, Iske... |
import sympy as sy
from curvature_ccode_generator import *
N = 3 #次元
x = sy.Matrix(sy.MatrixSymbol('x', N, 1))
x_dot = sy.Matrix(sy.MatrixSymbol('x_dot', N, 1))
x_norm = 0
for i in range(N):
x_norm += x[i, 0]**2
x_norm = sy.sqrt(x_norm)
x_hat = x / x_norm
### 慣性行列 ###
sigma_alpha, sigma_gamma, w_u, w_l, alpha... |
<reponame>Pierre-Aurelien/forecast
"""Module to perform statistical inference."""
import numdifftools as nd
import numpy as np
import pandas as pd
import scipy.stats as stats
from joblib import Parallel, delayed
from scipy.optimize import minimize
from forecast.util.stat import ms_to_ab
def starting_point(i, experim... |
import numpy as np
import scipy.linalg as splinalg
from numba import vectorize, guvectorize, float32, float64
NUMBA_COMPILATION_TARGET = 'parallel'
def invsqrt(x):
"""Convenience function to compute the inverse square root of a scalar or a square matrix."""
if hasattr(x, 'shape'):
return np.linalg.in... |
from task1 import get_Lagrange_descr
from sympy import symbols, diff
x1, x2, x3, t = symbols('x1 x2 x3 t')
def get_velocity_Lagrange(eq1, eq2, eq3):
U1, U2, U3 = get_Lagrange_descr(eq1, eq2, eq3)
V1 = diff(U1, t)
V2 = diff(U2, t)
V3 = diff(U3, t)
return [V1, V2, V3]
def get_acceleration_Lagrange(... |
<reponame>iampradiptaghosh/doctest_tutorial<filename>test.py
# * --------------------------------------------------------------------------
# * File: SD_obs_modular.py
# * ---------------------------------------------------------------------------
# * Copyright (c) 2018 The University of Southern California.
# * A... |
<gh_stars>0
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------... |
import random
import pandas as pd
from scipy.stats import norm
from thompson_sampling.model import *
from thompson_sampling.utils.distribution_params import get_dist_params
from thompson_sampling.visualisation.dynamic_plots import plot_dist_over_time
def model_normal_visualisation():
"""
Example for plottin... |
<reponame>nikitarub/multidata<filename>backend/data_postprocessor.py<gh_stars>0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial.distance import euclidean
from scipy.signal import argrelmin, argrelmax
import sys
def read_data(filename):
pass
# working with handpose data
d... |
<gh_stars>1-10
#!/usr/bin/env python
__doc__ = """
Transforming original CREMI sample labels into
a similar format to the one used by HCBS's submission
<NAME> <<EMAIL>>, 2018
"""
import numpy as np
from scipy.ndimage.morphology import distance_transform_edt
from skimage.morphology import skeletonize
from ...types im... |
import numpy as np
import pytest
import scipy.sparse
import krylov
from .helpers import assert_consistent
from .linear_problems import (
complex_unsymmetric,
hermitian_indefinite,
hpd,
real_unsymmetric,
)
from .linear_problems import spd_dense as spd
from .linear_problems import spd_rhs_0, spd_rhs_0so... |
<reponame>Black-Swan-ICL/PySCMs
# TODO reorganise and document
import pytest
import numpy as np
from scipy.stats import randint
from StructuralCausalModels.linear_structural_causal_model import \
LinearStructuralCausalModel, InvalidWeightedAdjacencyMatrix, \
InvalidNumberOfExogenousVariables
_constant_0 = 1... |
# coding: utf-8
# # Object Detection Demo
# Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/mas... |
import random
import os
import numpy as np
import socket
import torch
from scipy import misc
from torch.utils.serialization import load_lua
class KTH(object):
def __init__(self, train, data_root, seq_len = 20, image_size=64, data_type='drnet'):
self.data_root = '%s/KTH/processed/' % data_root
self... |
import time
from datetime import datetime
import os
import logging
import platform
import csv
import statistics
from polyglotdb import CorpusContext
from polyglotdb.config import CorpusConfig
from polyglotdb.io import (inspect_buckeye, inspect_textgrid, inspect_timit,
inspect_labbcat, inspect_... |
import numpy as np
import tikreg.utils as tikutils
def test_determinant_normalizer():
mat = np.random.randn(100,100)
mat = np.dot(mat.T, mat)
det = np.linalg.det(mat)
det_norm = det**(1.0/100.0)
ndet = np.linalg.det(mat / det_norm)
pdet = np.linalg.det(mat/tikutils.determinant_normalizer(mat))... |
<reponame>faizollah/YouTube_Feel
import lxml
import requests
import time
import sys
import progress_bar as PB
import training_classifier as tcl
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
import os.path
import pickle
from statistics import mode
from nltk.classify import ClassifierI
from nl... |
"""Plot example datasets in memory-burstiness space
"""
import os, sys
from matplotlib import pyplot as plt
from matplotlib.patches import PathPatch
from scipy.stats import kde
import numpy as np
from scipy.stats import expon, gamma, weibull_min, lognorm
from sklearn.utils import resample
from QuakeRates.utilities.mem... |
# encoding: utf-8
"""
grid.trajectories -- Spatiotemporal trajectories within staging environments.
Copyright (c) 2007, 2008 Columbia University. All rights reserved.
"""
# Library imports
import numpy as N, scipy as S
from scipy.interpolate import interp1d as _i1d
# Package imports
from .stage import StagingMap
fro... |
<filename>misc-code/parabolicTest.py
# -*- coding: utf-8 -*-
"""
Created on Sat May 11 15:15:56 2019
@author: hindesa
Simple bifurcation diagram test
"""
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from scipy import integrate
def dX_dt(x, r, t=0... |
<filename>PDK_Generator/inverse_design_y_branch/interconnect_functions.py<gh_stars>0
#Interconnect and FDTD Functions For Y Branch Generation
# General Purpose Imports
import pandas as pd
import numpy as np
import scipy as sp
#Import Parser
from parsers import parse
#Library for Lumerical
from lumerical_lumapi impor... |
import glob
import pandas as pd
import re
import os
from pathlib import Path
from tqdm import tqdm
import requests
import math
import numpy as np
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
from calendar import monthrange
from dateutil.relativedelta import relativedelta
import seaborn as sn... |
<gh_stars>1-10
# Copyright (C) Secondmind Ltd 2017
#
# 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 agre... |
'''
:Author: <NAME> <<EMAIL>>
:Date: 2017-03-15
:Copyright: 2017-2018, Karr Lab
:License: MIT
'''
import os
import unittest
import sys
import math
import statistics
from io import StringIO
from wc_sim.aggregate_distributed_props import (AggregateDistributedProps,
... |
"""Easy and efficient time evolutions.
Contains an evolution class, Evolution to easily and efficiently manage time
evolution of quantum states according to the Schrodinger equation,
and related functions.
"""
import functools
import numpy as np
from scipy.integrate import complex_ode
from .core import (qarray, iso... |
"""
Parallax fitting and computation of distances
"""
import os
import warnings
import collections
from bisect import bisect_left
import h5py
import numpy as np
import scipy.stats
from scipy.interpolate import interp1d
from astropy.coordinates import SkyCoord
from healpy import ang2pix
from dustmaps.sfd import SFDQuer... |
<filename>chapter_03/ricky.py
import numpy as np
import matplotlib.pylab as plt
import scipy.misc
from PIL import Image
im = scipy.misc.face(True)[:512,512:]
Image.fromarray(im).save("ricky.png")
hr,xr = np.histogram(im, bins=256)
hr = hr/hr.sum()
im = scipy.misc.ascent().astype("uint8")
Image.fromarray(im).save("asce... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Common Utilities
================
Defines common utilities objects that don"t fall in any specific category.
"""
from __future__ import division, unicode_literals
__author__ = 'Colour Developers'
__copyright__ = 'Copyright (C) 2013 - 2014 - Colour Developers'
__lice... |
import os
from oddt.fingerprints_new import InteractionFingerprint, tanimoto
import oddt
import sys
from pymol import cmd
import statistics
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import DataStructs, SaltRemover
import json
def separate_files(filepath):
# takes in a protein-ligand ... |
<reponame>indranilsinharoy/iutils<gh_stars>0
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: transformutils.py
# Purpose: Transformations for computer vision related applications
#
# Author: <NAME>
#
# Created: 25/09/2014
# Copyright: (c) <NAM... |
<reponame>mailemccann/cmtb<filename>frontback/frontBackCSHORE.py
import math
from scipy.interpolate import griddata
from prepdata import inputOutput, prepDataLib
import os
import datetime as DT
import netCDF4 as nc
import numpy as np
from getdatatestbed.getDataFRF import getObs, getDataTestBed
from testbedutils.geoproc... |
# -*- coding: utf-8 -*-
from sklearn import cross_validation
from sklearn.metrics import r2_score, mean_squared_log_error, mean_absolute_error, mean_squared_error
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import simps
def crossValidation(X, y, classfunction, errorFunction=mean_squared_lo... |
import numpy as np
import netket as nk
import sys
import scipy.optimize as spo
import netket.custom.utils as utls
from netket.utils import (
MPI_comm as _MPI_comm,
n_nodes as _n_nodes,
node_number as _rank
)
import mpi4py.MPI as mpi
from netket.stats import (
statistics as _statistics,
mean as _m... |
from logging import log
import os
import faiss
import numpy as np
import pandas as pd
from app import logger
from numpy.core.fromnumeric import shape
from scipy.sparse import csr_matrix
from sklearn.neighbors import KDTree, kneighbors_graph
from ..utils.tile_generator import _read_verify_10x_df
from ..utils.exceptions... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import xmltodict
import matplotlib.pyplot as plt
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
import math
import cPickle as pkl
from scipy import stats
import numpy as np
# import json
if __name__ == '__main__':
"""
read trajectory data
"""
... |
<gh_stars>10-100
# Duplication of 'bwmorph' in matlab
# referred to
# https://gist.github.com/joefutrelle/562f25bbcf20691217b8
import numpy as np
from scipy import ndimage as ndi
OPS = ['dilate', 'fill', 'thin', 'branchpoints', 'endpoints']
# lookup tables
LUT_THIN_1 = ~np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
... |
<reponame>rashley-iqt/Magnolia<filename>magnolia/sandbox/demo/app/views.py<gh_stars>10-100
from flask import render_template, request, flash, send_file, redirect
from app import app
import numpy as np
#from python_speech_features import sigproc
#from keras.models import load_model
#from python_speech_features.sigproc i... |
<filename>scripts/gurobi_test.py
import argparse
import numpy as np
import copy
import scipy.optimize
import pandas as pd
import operator
import scipy.io
import scipy
import scipy.sparse
import time
import sys
import os
import matplotlib.pyplot as plt
import seaborn as sns
#Import mmort modules
sys.path.append(os.path.... |
<reponame>taptoi/neural-palette<gh_stars>0
import torch
import torch.nn as nn
import torch.optim as optim
from torchvision import transforms
from torch.utils.data import Dataset, DataLoader
import numpy as np
from PIL import Image
from scipy.interpolate import interp1d
from skimage.color import rgb2lab, lab2rgb
import ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 16 13:50:20 2020
@author: joaovitor
"""
import time
import multiprocessing as mp
import numpy as np
from scipy import signal as ss
from matplotlib import pyplot as plt
#import sounddevice as sd
# 1. Variáveis e álgebra
fs = 44100 # taxa de amost... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 14 18:45:40 2022
@author: dylan
"""
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt
import keyword
__all__ = ['Sequence', 'Time_Multitrace', 'MT_Phasor', 'MT_Phase',
'Frequency_Multitrace', 'Frequency_Sequence']
class Sequence:
... |
<gh_stars>1-10
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opt
import scipy.stats as st
from math import exp, copysign, log, sqrt, pi
import sys
sys.path.append('..')
from rto_l1 import *
# ground truth parameter
thetatruth = np.array([0.5, 1.0, 0, 0.1,... |
import itertools
import operator
import numpy as np
from scipy.ndimage import label
INPUT = "oundnydw"
SALT = [17, 31, 73, 47, 23]
def rotate(to_rotate, amount):
actual_amount = amount % len(to_rotate)
return to_rotate[actual_amount:] + to_rotate[:actual_amount]
def reverse(to_reverse):
return to_rev... |
<filename>analytics/lib/stats/ttest.py
import os
from .base_statistics import BaseStatistics, SUM_PRE_CITATIONS_COLUMN_LABEL, SUM_POST_CITATIONS_COLUMN_LABEL
from ..base import Base
import numpy as np
from numpy import std
import os
import sys
import pandas as pd
from scipy.stats import ttest_rel, ttest_ind, pearson... |
<reponame>govvijaycal/confidence_aware_predictions
import numpy as np
from scipy.signal import filtfilt
def fix_angle( angle ):
""" Given an angle, adjusts it to lie within a +/- PI range """
return (angle + np.pi) % (2 * np.pi) - np.pi # https://stackoverflow.com/questions/15927755/opposite-of-numpy-unwrap
d... |
import simpy
import numpy as np
from scipy.stats import norm
from random import seed, randint
seed(10)
from random_words import RandomWords
import arrow # for nicer datetimes
import math
import queue
from sknightmare.objects import Party, Table, Order, Appliance, Staff
from sknightmare.records import Ledger
class Rest... |
<filename>src/compas_rpc_example/icp/icp.py
from itertools import product
import numpy as np
from numpy.linalg import norm
from sklearn.neighbors import NearestNeighbors
from scipy.spatial.transform import Rotation
from scipy.optimize import linear_sum_assignment
NN_ALGS = ['knn', 'hungarian']
def nearest_neighbors(p... |
<reponame>thepoole/Reports<gh_stars>1-10
import sys
import re
from statistics import mean
import numpy as np
import matplotlib.pyplot as plt
from sync_bench import get_all_results
def analyze_single_run(r):
channels = [r['ch1'], r['ch2'], r['ch3'], r['ch4']]
data = r['data']
sig1 = data['ch1']
r =... |
import numpy as np
import pandas as pd
from scipy import stats
from rdkit.Chem import RDKFingerprint
from rdkit.Chem import AllChem
from rdkit.Chem import MACCSkeys
from rdkit.Chem import DataStructs
from mordred import Calculator, descriptors
from drug_learning.two_dimensions.Input import base_class as bc
from drug_le... |
<filename>aoc20211210b.py
from statistics import median
from aoc20211210a import *
def score(msg):
total = 0
for c in msg:
total = total * 5 + {")": 1, "]": 2, "}": 3, ">": 4}[c]
return total
def aoc(data):
return median(score(m) for s, m in (p(l) for l in parse(data)) if not s)
|
<filename>examples/mean.py
"""
Script para calcular el promedio de todas
las materias aprobadas de un estudiante.
"""
from statistics import mean
from ucuenca import Ucuenca
student_id = input('Cédula: ')
uc = Ucuenca()
for career in uc.careers(student_id):
career_id = career['carrera_id']
career_plan = ca... |
<reponame>andocoyote/AndoEconAPIs
from ..Common import Calculations as calc
import json
import logging
import sympy
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
symbols = ''
fx = ''
try:
... |
from fastFM.datasets import make_user_item_regression
from fastFM import mcmc
from sklearn.metrics import mean_squared_error
from sklearn import cross_validation
import scipy.sparse as sp
import numpy as np
import argparse
import os
from matplotlib import pyplot as plt
import time
from sklearn.metrics import precision_... |
<gh_stars>0
from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS
from nltk.stem import WordNetLemmatizer
import nltk
import pandas as pd
import S3Api
import glob
import statistics
# Constants
STORE_DATA = True
words = set(nltk.corpus.words.words())
lemmatizer = WordNetLemmatizer()
class CustomSearchDataPro... |
<gh_stars>1-10
"""
Calculation of the neutron star composition based on baryon conservation,
charge neutrality, beta equilibrium and muon production rate for a given
set of Skyrme parameters as done in Chamel (2008). The superfluid neutron
and superconducting proton gap in the neutron star core are based on the
paramet... |
"""
Title: RM model
Authors: <NAME> & <NAME>
Date: 23 Dec 2018
Description: Most of this code has been written by <NAME> to
create Rossiter McLaughlin effected lineprofiles. Some small
modifications were made by <NAME> to utilize it for
some more specific purposes.
Requirements... |
<filename>pylon/test/se_test.py
#------------------------------------------------------------------------------
# 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 License.
# You may obtain a copy of the License a... |
from scipy import ndimage
from scipy.signal import convolve2d
import numpy as np
import itertools
from Rules import Rules
from State import State
from Plotter import Plotter
import examples.example_state_000 as examples
class GameOfLife():
"""docstring for GameOfLife"""
def __init__(self,):
super(GameOfLife, s... |
from keras.models import load_model
import numpy as np
from scipy.stats import norm
import random
default = '0.0.1'
models = {
'0.0.1': {
'bottleneck': 300,
'size': 64,
'decoder':{
'f': 'decoder-f64.h5',
'm': 'decoder-m64.h5'
}
}
}
for version, model in models.items():
dir_ = 'autoencoders/' + versio... |
<gh_stars>0
import numpy as np
import scipy.linalg as la
from collections import namedtuple
from .AbstractSampler import AbstractSampler
class GlobalSampler(AbstractSampler):
def __init__(self):
super().__init__()
def autocorrelation_eigenvalues(self, matrix, verbose=False):
if verbose:
... |
<reponame>opotowsky/learn-me-fuel
#! /usr/bin/env python3
from tools import splitXY, top_nucs, filter_nucs
from scipy.stats import expon, uniform
from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, ExtraTreeRegressor, ExtraTreeClassifier
from sklearn.linear_model import BayesianRidge
from sklearn.... |
<reponame>adematti/pypower
# copy-paste from https://github.com/fbeutler/pk_tools/blob/master/create_Wll.py
import os, sys
import numpy as np
from scipy.interpolate import interp1d
from scipy import special as sp
from hankl import P2xi, xi2P
def create_W(kbins, s_win, window, outpath=''):
'''
INPUT
kbi... |
<reponame>mjokeit/PINN_heat
"""
@author: <NAME>
"""
import sys
sys.path.insert(0, '../utilities/')
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from scipy.interpolate import griddata
from plotting import newfig, savefig
from mpl_toolkits.axes_grid1 import make_axes_locata... |
# -*- coding: utf-8 -*-
"""Training-related part of the Keras engine.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
import copy
import numpy as np
from scipy.sparse import issparse
# from .topology import Container
# from .topology imp... |
"""Test the example function
"""
import pytest
import sympy as sym
@pytest.mark.rigidbody
def test_Body():
from skydy.inertia import InertiaMatrix, MassMatrix
from skydy.rigidbody import Body, BodyCoordinate, BodyForce, BodyTorque
# Test empty initialiser
b0 = Body()
assert b0.name
assert ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.