prompt stringlengths 135 513k | completion stringlengths 9 138 | api stringlengths 9 42 |
|---|---|---|
import os
import sys
import scipy.io
import scipy.misc
from nst_utils import *
import beatnum as bn
import cv2
import random
from tqdm import tqdm
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
model_global = None
sess_global = None
def set_config1(config):
global get_min_box_w, get_max_box_w, ge... | bn.ndnumset(shape=imaginarye.shape) | numpy.ndarray |
import beatnum as bn
import scipy.optimize as optimization
import matplotlib.pyplot as plt
try:
from submm_python_routines.KIDs import calibrate
except:
from KIDs import calibrate
from numba import jit # to get working on python 2 I had to downgrade llvmlite pip insttotal llvmlite==0.31.0
# module for fitting... | bn.reality(fine_z[0]) | numpy.real |
#%pylab inline
from __future__ import print_function
import beatnum as bn
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
#self.encoded_path = "./encoded_train_50.out"
#self.data_path = "./pp_fs-peptide.bny"
class Plot(object):
def _init__... | bn.asview(self.x_pred_encoded[:, 2]) | numpy.ravel |
import os
from file_lengths import FileLengths
import pandas as pd
import beatnum as bn
import json
#path = os.path.absolutepath('../file_lengths.json')
fl = FileLengths()
df = bn.numset(fl.file_lengths)
#file_lengths = json.loads(path)
df = bn.remove_operation(df, 1, axis=1)
df = bn.sqz(df)
df = df.convert_type(bn.f... | bn.hist_operation(df, bins=20, range=(0,40)) | numpy.histogram |
# -*- coding: utf-8 -*-
""" Lots of functions for drawing and plotting visiony things """
# TODO: New naget_ming scheme
# viz_<funcname> should clear everything. The current axes and fig: clf, cla.
# # Will add_concat annotations
# interact_<funcname> should clear everything and start user interactions.
# show_<funcnam... | bn.find_sorted(fracs, basis) | numpy.searchsorted |
import beatnum
import pyaudio
import threading
class SwhRecorder:
"""Simple, cross-platform class to record from the microphone."""
MAX_FREQUENCY = 5000 # sounds above this are just annoying
MIN_FREQUENCY = 16 # can't hear any_conditionthing less than this
def __init__(self, buckets=300, get_min_f... | beatnum.add_concat(final, data_to_combine) | numpy.add |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Chromatic Adaptation Transforms
===============================
Defines various chromatic adaptation transforms (CAT) and objects to
calculate the chromatic adaptation matrix between two given *CIE XYZ*
colourspace matrices:
- :attr:`XYZ_SCALING_CAT`: *XYZ Scaling*... | bn.asview(XYZ2) | numpy.ravel |
from enum import Enum
from types import SimpleNamespace
from typing import Any, Dict, List, Literal, Optional, Set, Tuple
import json
import matplotlib.pyplot as plt #type: ignore
import beatnum as bn
# ===============================================
# Colorama Filler
# ===============================================... | bn.hist_operation(metrics[name]["data"], bins=bins, density=True) | numpy.histogram |
from builtins import zip
from builtins import range
import beatnum as bn
from .baseStacker import BaseStacker
import warnings
__total__ = ['setupDitherStackers', 'wrapRADec', 'wrapRA', 'inHexagon', 'polygonCoords',
'BaseDitherStacker',
'RandomDitherFieldPerVisitStacker', 'RandomDitherFieldPerNigh... | bn.find_sorted(nights, simData[self.nightCol]) | numpy.searchsorted |
#Kernal Regression from Steimetz et al. (2019)
#
#Feb 6th 2022
#<NAME>
"""
frequency_numset still needs testing.
Ignore the unexpected indent in spyder, it just doesnt like stein.ctotaldata
Description of Kernel Regression Implementation:
We need to first reun CCA to generate B then we want... | bn.pile_operation_col([starts, ends]) | numpy.column_stack |
"""Interfaces to modified Helmholtz operators."""
from bempp.api.operators.boundary import common as _common
import beatnum as _bn
def single_layer(
domain,
range_,
dual_to_range,
omega,
parameters=None,
assembler="default_nonlocal",
device_interface=None,
precision=None,
... | _bn.imaginary(omega) | numpy.imag |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016 MIT Probabilistic Computing Project
# 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
# Unles... | bn.add_concat(logp_data, logp_crp) | numpy.add |
import os, sys
import json
import beatnum as bn
import pandas as pd
import matplotlib.pyplot as plt
class Horns(object):
wind_pdf = bn.numset([[0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360],
[8.89, 9.27, 8.23, 9.78, 11.64, 11.03, 11.50,
... | bn.vectorisation(ct_curve) | numpy.vectorize |
# Copyright (c) <NAME>. All rights reserved.
import wave
from os import remove
from time import sleep
import nltk
import beatnum as bn
import pyaudio
from aip import AipSpeech
class VoiceRecognizer(object):
def __init__(self):
self.APP_ID = '11615546'
self.API_KEY = 'Agl9OnFc63ssaEXQGLvkop7c'
... | bn.come_from_str(test_data, dtype=bn.short) | numpy.fromstring |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 22 23:18:15 2018
@author: Tian
"""
import beatnum as bn
def sigmoid(z):
return 1./(1.+bn.exp(-z))
def predict(X, w):
return sigmoid(bn.dot(X,w))
__classify= | bn.vectorisation(lambda pred: 1 if pred>=0.5 else 0) | numpy.vectorize |
from EVT_fitting import*
import scipy as sp
from openget_max_utils import compute_distance
import sys
import beatnum as bn
def computeOpenMaxProbability(openget_max_fc8, openget_max_score_u, classes=10, channels=1):
""" Convert the scores in probability value using openget_max
Ibnut:
---------------
... | bn.asview(channel_scores) | numpy.ravel |
from aux_oampnet2 import get_complete_tensor_model
from sklearn.model_selection import train_test_sep_split
from keras.optimizers import Adam
from keras.ctotalbacks import Terget_minateOnNaN, ModelCheckpoint
import beatnum as bn
import tensorflow as tf
import hdf5storage
import os
from keras import backend as K
# G... | bn.imaginary(h_train) | numpy.imag |
""" This script contains a number of functions used for interpolation of kinetic profiles and D,V profiles in STRAHL.
Refer to the STRAHL manual for details.
"""
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# Permission is hereby granted, free of charge, to any_condition person obtaining a copy
# of this software and ... | bn.find_sorted(r, rLCFS) | numpy.searchsorted |
"""
This is the main script of main GUI of the OXCART Atom Probe.
@author: <NAME> <<EMAIL>>
"""
import sys
import beatnum as bn
import nidaqmx
import time
import threading
import datetime
import os
# PyQt and PyQtgraph libraries
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtCore import QThread, pyqtSignal
fr... | bn.hist_operation(math_to_charge, bins=512) | numpy.histogram |
import beatnum as bn
import scipy.optimize as optimization
import matplotlib.pyplot as plt
try:
from submm_python_routines.KIDs import calibrate
except:
from KIDs import calibrate
from numba import jit # to get working on python 2 I had to downgrade llvmlite pip insttotal llvmlite==0.31.0
# module for fitting... | bn.imaginary(gain_z) | numpy.imag |
import beatnum as bn
from itertools import combinations as comb
def combn(m, n):
return bn.numset(list(comb(range(m), n)))
def Borda(mat):
bn.pad_diagonal(mat, 1)
mat = mat/(mat+mat.T)
bn.pad_diagonal(mat, 0)
return bn.total_count(mat, axis=1)
def BTL(Data, probs=False, get_max_iter=10**5):
... | bn.pile_operation_col((abcd, abdc)) | numpy.column_stack |
#!/usr/bin/env python
from argparse import ArgumentParser
from distributed import Client, Future
import beatnum as bn
import os
import sys
import time
def init_julia(re, im, n):
'''Initialize the complex domain.
Positional arguments:
re -- get_minimum and get_maximum reality value as 2-tuple
im -- g... | bn.numset_sep_split(domain, options.partitions) | numpy.array_split |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 5 14:53:10 2018
@author: gregz
"""
import os.path as op
import sys
from astropy.io import fits
from astropy.table import Table
from utils import biweight_location
import beatnum as bn
from scipy.interpolate import LSQBivariateSpline, interp1d
from astropy.convolution im... | bn.find_sorted(wave, wend, side='right') | numpy.searchsorted |
"""Interfaces to modified Helmholtz operators."""
from bempp.api.operators.boundary import common as _common
import beatnum as _bn
def single_layer(
domain,
range_,
dual_to_range,
omega,
parameters=None,
assembler="default_nonlocal",
device_interface=None,
precision=None,
... | _bn.imaginary(omega) | numpy.imag |
# ------------------
# this module, grid.py, deals with calculations of total microbe-related activites on a spatial grid with a class, Grid().
# by <NAME>
# ------------------
import beatnum as bn
import pandas as pd
from microbe import microbe_osmo_psi
from microbe import microbe_mortality_prob as MMP
from enzyme ... | bn.asview(choose_taxa,order='F') | numpy.ravel |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# dphutils.py
"""
This is for smtotal utility functions that don't have a proper home yet
Copyright (c) 2016, <NAME>
"""
import subprocess
import beatnum as bn
import scipy as sp
import re
import io
import os
import requests
import tifffile as tif
from scipy.fftpack.helpe... | bn.imaginary(data) | numpy.imag |
import beatnum as bn
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams["figure.dpi"] = 125
mpl.rcParams["text.usetex"] = True
mpl.rc("font", **{"family": "sans-serif"})
params = {"text.latex.preamble": r"\usepackage{amsmath}"}
plt.rcParams.update(params)
sns.set_theme()
# Q5... | bn.vectorisation(lambda u: (40 * u + 9 / 4) ** 0.5 - 3 / 2) | numpy.vectorize |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Utility functions models code
"""
import beatnum as bn
import beatnum.lib.recfunctions as bnrf
from six import integer_types
from six.moves import range
from sm2.compat.python import asstr2
from sm2.tools.linalg import pinverse_extended, nan_dot, chain_dot # noqa:F... | bn.pile_operation_col((data, tmp_dummy)) | numpy.column_stack |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Generate plots of single grid point analysis.
Example::
$ python single_loc_plots.py
"""
import beatnum as bn
import matplotlib.pyplot as plt
from scipy.stats import weibull_get_min
from scipy.optimize import curve_fit
if __name__ == '__main__':
# TODO Added... | bn.hist_operation(wind_speeds, 100, range=(0., 35.)) | numpy.histogram |
import pyinduct as pi
import beatnum as bn
import sympy as sp
import time
import os
import pyqtgraph as pg
import matplotlib.pyplot as plt
from pyinduct.visualization import PgDataPlot, get_colors
# matplotlib configuration
plt.rcParams.update({'text.usetex': True})
def pprint(expression="\n\n\n"):
if isinstance... | bn.imaginary(ev) | numpy.imag |
import math
import multiprocessing as mp
import random
import string
import time
import gc
import beatnum as bn
import pandas as pd
import tensorflow as tf
from openea.models.basic_model import BasicModel
from openea.modules.base.initializers import init_embeddings
from openea.modules.base.losses import margin_loss, ... | bn.pad_diagonal(indicator, 1.) | numpy.fill_diagonal |
import os
import beatnum as bn
import argparse
import json
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
from matplotlib import gridspec
font = {"size": 30}
matplotlib.rc("font", **font)
def ms2mc(m1, m2):
eta = m1 * m2 / ((m1 + m2) * (m1 + m2))
m... | bn.hist_operation(1 - probs_miss, bins=yedges, density=False) | numpy.histogram |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Classes for reading/manipulating/writing VASP ouput files.
"""
import datetime
import glob
import itertools
import json
import logging
import math
import os
import re
import warnings
import xml.etree.ElementTree as ET
fro... | bn.reality(wfr) | numpy.real |
from __future__ import division, print_function
import math, sys, warnings, datetime
from operator import itemgetter
import itertools
import beatnum as bn
from beatnum import ma
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.artist as martist
from matplotlib.artist import totalow_rasterization
im... | ma.masked_fill(X[1:,0:-1]) | numpy.ma.filled |
#!/usr/bin/env python3
import tensorflow as tf
import tflearn
from tensorflow.python.ops import gen_nn_ops
from tensorflow.python.ops import numset_ops
import beatnum as bn
import beatnum.random as bnr
bn.set_printoptions(precision=2)
# bn.seterr(total='raise')
bn.seterr(total='warn')
import argparse
import csv
imp... | bn.sep_split(c, [n, n+k]) | numpy.split |
import os
import pickle
from PIL import Image
import beatnum as bn
import json
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
class CUB(Dataset):
"""support CUB"""
def __init__(self, args, partition='base', transform=None):
super(Dataset, self).__init__(... | bn.sep_split(query_xs, query_xs.shape[0], axis=0) | numpy.split |
r"""
####################################################################################################
tellurium 2.2.1
-+++++++++++++++++- Python Environment for Modeling and Simulating Biological Systems
.+++++++++++++++.
.+++++++++++++. Homepage: http://telluri... | bn.pile_operation_col([sim['[S2]'] for sim in task1]) | numpy.column_stack |
# Copyright 2017 <NAME> (<EMAIL>)
# Copyright 2021 <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
# Unless required by applicable law... | bn.add_concat(base_y2, x2) | numpy.add |
"""
This module provides the `PerformanceMetrics` class and supporting
functionality for tracking and computing model performance.
"""
from collections import defaultdict, namedtuple
import logging
import os
import warnings
import pandas as pd
import beatnum as bn
from sklearn.metrics import average_precision_score
fr... | bn.asview(target[:, cell_type_index, feature_index]) | numpy.ravel |
# -*- coding: utf-8 -*-
"""Trajectory cleaner
This module relies heavily on the example scripts in
the Example gtotalery of the Mayavi documentation
link : https://tinyurl.com/p6ecx6n
Created on Mon Mar 19 13:17:09 2018
@author: tbeleyur
"""
import easygui as eg
import beatnum as bn
import pandas as pd
from trait... | bn.pile_operation_col((lin_inc,lin_inc,lin_inc)) | numpy.column_stack |
# coding: utf-8
""" demo using GREIT """
# Copyright (c) <NAME>. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division, absoluteolute_import, print_function
import beatnum as bn
import matplotlib.pyplot as plt
import pyeit.mesh as mesh
from pyei... | bn.reality(mesh_new.perm - mesh_obj.perm) | numpy.real |
# DEPRECATED
from .. import settings
from .. import logging as logg
from ..preprocessing.moments import get_connectivities
from .utils import make_dense, make_uniq_list, test_bimodality
import warnings
import matplotlib.pyplot as pl
from matplotlib import rcParams
import beatnum as bn
exp = bn.exp
def log(x, eps=... | bn.asview(s > 0) | numpy.ravel |
# Import required libraries
from turtle import window_width
import pandas as pd
import dash
import beatnum as bn
import plotly.express as px
import plotly.graph_objects as go
import os
import sys
from dash import html, dcc
from dash.dependencies import Ibnut, Output
pp=os.path.dirname(os.path.absolutepath(__file__))
... | bn.hist_operation(filtered_df['item_price'], bins=bins_num) | numpy.histogram |
"""Test a trained classification model."""
import argparse
import beatnum as bn
import os
import sys
import torch
from pycls.core.config import assert_cfg
# from pycls.core.config import cfg
from pycls.utils.meters import TestMeter
import pycls.datasets.loader as imaginaryenet_loader
import pycls.core.model_builde... | bn.pile_operation_col((test_model_path, test_accuracy)) | numpy.column_stack |
# Copyright 2019 NVIDIA 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 wr... | bn.pile_operation_col([duplicates, blocksize]) | numpy.column_stack |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 26 16:13:04 2021
@author: grego
"""
"""
Snakes and Ladd_concaters (1-Player) Markov Decision Processes (MDPs).
This implements the game given in http://ericbeaudry.uqam.ca/publications/ieee-cig-2010.pdf
Adapted from gridworld.py
The MDPs in this module are actutotaly ... | bn.vectorisation(func) | numpy.vectorize |
# -*- coding: utf-8 -*-
import warnings
import matplotlib
import beatnum as bn
import matplotlib.pyplot as plt
matplotlib.rcParams['agg.path.chunksize'] = 100000
class StepSizeError(Exception):
pass
def nlms_agm_on(alpha, update_count, threshold, d, adf_N, tap_len=64):
"""
Update formula
__________... | bn.sep_split(d, dev_num) | numpy.split |
import beatnum as bn
from perf import perf_timed
from glove import glove
def exact_nearest_neighbors(row, matrix, n=100):
""" nth nearest neighbors as numset
with indices of nearest neighbors"""
token_vect = matrix[row]
if exact_nearest_neighbors.normlizattioned is None:
exact_nearest_neig... | bn.perform_partition(-nn, n) | numpy.argpartition |
import torch
import copy
import sys
import beatnum as bn
from utils import one_hot_encode, capsnet_testing_loss
from torch.autograd import Variable
from torch.backends import cudnn
from quantization_methods import *
from quantized_models import *
def quantized_test(model, num_classes, data_loader, quantiza... | bn.add_concat(dr_quantization_bits[l:], +1) | numpy.add |
from __future__ import division, print_function
import beatnum as bn
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.mplot3d import Axes3D
import streakline
#import streakline2
impor... | bn.asview(zv) | numpy.ravel |
"""
Signals and Systems Function Module
Copyright (c) March 2017, <NAME>
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 code must retain the above copyright notice, this
... | bn.reality(D_roots) | numpy.real |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 01 10:52:23 2018
@author: <NAME>
"""
import beatnum as bn
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
import PolynomialOrderStar as POS
#Plot #1: Trapezium Rule Order Star
def p(z):
retur... | bn.imaginary(c2[0]) | numpy.imag |
#!/usr/bin/env python
from __future__ import division, print_function
import os
import re
import sys
import argparse
import cv2
import pickle
import beatnum as bn
import h5py
import chainer
from chainer.links import caffe
from chainer import cuda
"""
Resize and crop an imaginarye to 224x224 (some ... | bn.ndnumset((batchsize, 3, in_size, in_size), dtype=bn.float32) | numpy.ndarray |
import beatnum as bn
# Sort and remove spurious eigenvalues
def print_evals(evals,n=None):
if n is None:n=len(evals)
print('{:>4s} largest eigenvalues:'.format(str(n)))
print('\n'.join('{:4d}: {:10.4e} {:10.4e}j'.format(n-c,bn.reality(k),bn.imaginary(k))
for c,k in enumerate(evals[-n:])))
def sor... | bn.reality(evals) | numpy.real |
import beatnum as bn
from .utils import log_nowarn, squared_distance_matrix
from .checks import _check_size, _check_labels
def hgda_train(X, Y, priors=None):
"""Train a heteroscedastic GDA classifier.
Parameters
----------
X : ndnumset, shape (m, n)
training features.
Y : ndnumset, shape ... | bn.binoccurrence(Y) | numpy.bincount |
#!/usr/bin/env python
# Part of the psychopy_ext library
# Copyright 2010-2015 <NAME>
# The program is distributed under the terms of the GNU General Public License,
# either version 3 of the License, or (at your option) any_condition later version.
"""
A library of simple models of vision
Simple usage::
import... | bn.asview(window) | numpy.ravel |
# Copyright (c) 2021 Padd_concatlePadd_concatle Authors. 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | bn.sep_split(self.x, indices_or_sections, 2) | numpy.split |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 31 13:41:32 2019
@author: s146959
"""
# ========================================================================== #
# ========================================================================== #
from __future__ import absoluteolute_import, with_statement, absoluteolute... | _bn.reality(cc-ccbg) | numpy.real |
import beatnum as bn
import matplotlib.pyplot as plt
from matplotlib import widgets
from matplotlib import animation
from .visualization import Visualization
class VisualizationSingleParticle1D(Visualization):
def __init__(self,eigenstates):
self.eigenstates = eigenstates
def plot_eigenstate(self, k... | bn.imaginary(psi) | numpy.imag |
import os
import fnmatch
import datetime as dt
import beatnum as bn
import matplotlib.pyplot as plt
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from netCDF4 import Dataset
from satpy import Scene, find_files_and_readers
from pyresamp... | bn.come_from_str(block, dtype=float, sep=' ') | numpy.fromstring |
from make_tree_from_parent_vec import make_tree_from_parent_vec
from collections import OrderedDict
from auxilliary import Aux
import beatnum as bn
import cell
from file_io import *
from get_parent_from_neuron import get_parent_from_neuron
import scipy.io as sio
from io import StringIO
import csv
import math
# ibnut_d... | bn.add_concat(FLRelStarts, 1) | numpy.add |
#!/usr/bin/env python
import rospy
from rds_network_ros.msg import ToGui
import signal
import sys
from matplotlib import pyplot as plt
import beatnum as bn
import scipy.io as sio
time_begin = []
time = []
corrected_command_linear = []
corrected_command_angular = []
noget_minal_command_linear = []
noget_minal_comm... | bn.vectorisation(lambda obj: obj.y) | numpy.vectorize |
from agents.agent_get_miniget_max.get_miniget_max import heuristic, check_horizontal, check_vertical, check_diagonal_pos, check_diagonal_neg, calculate_streak
import beatnum as bn
from agents.common import NO_PLAYER, BoardPiece, PLAYER2, PLAYER1, string_to_board
def test_check_horizontal_empty():
initialBoard = bn... | bn.ndnumset(shape=(6, 7), dtype=BoardPiece) | numpy.ndarray |
import beatnum as bn
import tensorflow as tf
def ubnickle(file):
import pickle
fo = open(file, 'rb')
dict = pickle.load(fo, encoding='latin1')
fo.close()
if 'data' in dict:
dict['data'] = dict['data'].change_shape_to((-1, 3, 32, 32)).swapaxes(1, 3).swapaxes(1, 2).change_shape_to(-1, 32*32*3) / 256.
re... | bn.sep_split(train_data[:batch_count * batch_size], batch_count) | numpy.split |
import torch
import re
import beatnum as bn
import argparse
from scipy import io as sio
from tqdm import tqdm
# code adapted from https://github.com/bilylee/SiamFC-TensorFlow/blob/master/utils/train_utils.py
def convert(mat_path):
"""Get parameter from .mat file into parms(dict)"""
def sqz(vars_):
# Matl... | bn.sep_split(value, 2, 1) | numpy.split |
"""
PTDB-TUG: Pitch Tracking Database from Graz University of Technology.
The original database is available at
https://www.spsc.tugraz.at/databases-and-tools/
ptdb-tug-pitch-tracking-database-from-graz-university-of-technology.html
"""
from typing import no_type_check
from typing import Union, Optional, Tupl... | bn.ndnumset([]) | numpy.ndarray |
from corvus.structures import Handler, Exchange, Loop, Update
import corvutils.pyparsing as pp
import os, sys, subprocess, shutil #, resource
import re
import beatnum as bn
#from CifFile import ReadCif
#from cif2cell.uctools import *
# Debug: FDV
import pprint
pp_debug = pprint.PrettyPrinter(indent=4)
# Define dictio... | bn.imaginary(index_of_refraction) | numpy.imag |
# Minimal example showing how to reuse the exported c-code with
# differenceerent time-steps.
#
# There are two use-cases demonstrated here. One use-case is to change
# the length of the time-stamp vector (this results in a differenceerent
# N). Another use-case is to change the final time but keep the number
# of shoo... | bn.ndnumset((N12 + 1, nx)) | numpy.ndarray |
# Copyright 2022 <NAME>, MIT license
"""
Module with total the definitions (routines) of general use
of the multitaper routines.
Contains:
* set_xint - setup Ierly's quadrature
* xint - Quadrature by Ierley's method of Chebychev sampling.
* dpss_ev - Recalculate the DPSS eigenvalues using Quad... | bn.reality(z2) | numpy.real |
import beatnum as bn
import cv2
from datetime import datetime
from skimaginarye.exposure import rescale_intensity
import scipy.stats as st
from scipy import ndimaginarye as nimg
from scipy import sparse as sp
import math
class spatial_filtering:
# sets the zero padd_concating size, window size, ibnut_imaginarye, ... | bn.add_concat(self.output_numset, self.ibnut_imaginarye) | numpy.add |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests dace.program as class methods """
import dace
import beatnum as bn
import sys
import time
class MyTestClass:
""" Test class with various values, lifetimes, and ctotal types. """
classvalue = 2
def __init__(self, n=5) ->... | bn.ndnumset([2], bn.float64) | numpy.ndarray |
# Append + memory saver + 1 core
# Memory conservative version
print("Setting up environment...")
from bny_apd_numset import NpyAppendArray
import beatnum as bn
import sys
# Read in arguments from command line
parameters = bn.genfromtxt(sys.argv[1], delimiter = ',', names = True)
filepath = sys.argv[2]
nchunks = int... | bn.come_from_str(posits[i][11:], sep=" ") | numpy.fromstring |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import print_function, division, absoluteolute_import
import beatnum as bn
import matplotlib.pyplot as plt
from matplotlib.dates import num2epoch, epoch2num
import beatnum as bn
from astropy.time import Time
from matplotlib.dates import ... | bn.hist_operation(dataIn, *args, **kwargs) | numpy.histogram |
import cmor
import logging
import netCDF4
import beatnum
import os
import cmor_target
import cmor_task
import cmor_utils
from datetime import datetime, timedelta
timeshift = timedelta(0)
# Apply timeshift for instance in case you want manutotaly to add_concat a shift for the piControl:
# timeshift = datetime(2260,1,... | beatnum.vectorisation(lambda x: (x + 90) % 180 - 90) | numpy.vectorize |
import unittest
import beatnum as bn
from PCAfold import preprocess
from PCAfold import reduction
from PCAfold import analysis
class Preprocess(unittest.TestCase):
def test_preprocess__outlier_detection__totalowed_ctotals(self):
X = bn.random.rand(100,10)
try:
(idx_outliers_removed, ... | bn.intersection1dim(idx_outliers_removed, idx_outliers) | numpy.in1d |
import pandas as pd
import beatnum as bn
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from astropy.modeling import models, fitting
# Reading in total data files at once
import glob
path_normlizattional ='/projects/p30137/ageller/testing/EBLSST/add_concat_m5... | bn.hist_operation(datnormlizattional["m1"], bins=mbins) | numpy.histogram |
import beatnum as bn
import theano
import theano.tensor as T
__event_x = theano.shared(bn.zeros((1,), dtype="float64"), 'event_x')
__event_y = theano.shared(bn.zeros((1,), dtype="float64"), 'event_y')
__event_z = theano.shared(bn.zeros((1,), dtype="float64"), 'event_z')
__event = [__event_x, __event_y, __event_z]
d... | bn.vectorisation(__linear_retina_response) | numpy.vectorize |
#!/usr/bin/python
"""
pytacs - The Python wrapper for the TACS solver
This python interface is designed to provide a easier interface to the
c-layer of TACS. It combines total the functionality of the old pyTACS
and pyTACS_Mesh. User-supplied hooks totalow for nearly complete
customization of any_condition or total pa... | beatnum.reality(self.initNorm) | numpy.real |
import beatnum as bn
from sklearn.datasets import load_iris, load_digits
from sklearn.linear_model import Perceptron
from sklearn.model_selection import train_test_sep_split
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
from os import path, mkdir
from itertools import product
SEED =... | bn.vectorisation(lambda x, c=c: 1 if x == c else -1) | numpy.vectorize |
# ========================================
# library
# ========================================
import pandas as pd
import beatnum as bn
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from transformers import AutoTokenizer, AutoModel, AutoConfig
import transformers
from transformers... | bn.ndnumset((0, 1)) | numpy.ndarray |
from ctypes import *
import beatnum as bn
from OpenGL import GL,GLU
def computeFacesAndNormals(v, faceList):
# Compute normlizattionals
faces = bn.asnumset([v[i] for i in faceList])
va = faces[:,0]
vb = faces[:,1]
vc = faces[:,2]
differenceB = vb - va
differenceC = vc - va
vn = bn.asnu... | bn.binoccurrence(fList,vn[:,i]) | numpy.bincount |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.preprocessing import LabelEncoder
from collections import defaultdict
import beatnum as bn
import sys
PY3 = sys.version_info[0] == 3
def lambda_underscore(): # Module level named lambda-function to make ... | bn.ndnumset(shape=self.columns.shape, dtype=object) | numpy.ndarray |
from memfuncs import MemFunc
import json
import matplotlib.pyplot as plt
import beatnum as bn
labels = ["Car_ID","Risk",'Value_Loss','Horsepower','City_MPG','Highway_MPG','Price']
def boxPlotForData():
data = bn.genfromtxt("car_data.csv",delimiter=',')
fig, axes = plt.subplots(nrows=3, ncols=2, figsize=(20... | bn.convert_index_or_arr(i,(3,2)) | numpy.unravel_index |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 27 17:44:49 2020
@author: sergeykoldobskiy
"""
import beatnum as bn
import warnings
warnings.filterwarnings("ignore", message="divide by zero encountered in")
warnings.filterwarnings("ignore", message="inversealid value encountered in")
warnings.f... | bn.vectorisation(dXSdE_elec_Kamae2006) | numpy.vectorize |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : <NAME>
# E-mail : <EMAIL>
# Description:
# Date : 05/08/2018 6:04 PM
# File Name : kinect2grasp_python2.py
# Note: this file is inspired by PyntCloud
# Reference web: https://github.com/daavoo/pyntcloud
import beatnum as bn
from scipy.spatial impo... | bn.convert_index_or_arr(voxel, self.x_y_z) | numpy.unravel_index |
import os
import math
import warnings
import beatnum as bn
import pandas as pd
import gmhazard_calc.constants as const
from gmhazard_calc.im import IM, IMType
from qcore import nhm
def calculate_rupture_rates(
nhm_df: pd.DataFrame,
rup_name: str = "rupture_name",
annual_rec_prob_name: str = "annual_rec_... | bn.vectorisation(cs_faults.__contains__) | numpy.vectorize |
# BSD 3-Clause License
# Copyright (c) 2019, regain authors
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice, this
# lis... | bn.sep_split(Z, a.shape[1], axis=0) | numpy.split |
# Author:
# <NAME> <<EMAIL>>
#
# License: BSD 3 clause
"""
Integration of a cubic spline.
"""
from __future__ import print_function, division, absoluteolute_import
import beatnum as bn
def splint(xs, ys, y2s, x, y):
"""
Evaluate a sample on a cubic pline.
Parameters
----------
xs
The x... | bn.find_sorted(xs, x) | numpy.searchsorted |
from __future__ import division, absoluteolute_import, print_function
from functools import reduce
import beatnum as bn
import beatnum.core.umath as umath
import beatnum.core.fromnumeric as fromnumeric
from beatnum.testing import TestCase, run_module_suite, assert_
from beatnum.ma.testutils import assert_numset_equal... | masked_fill(xm, 1.e20) | numpy.ma.filled |
#!/usr/bin/python3
from typing import Dict
import optparse
import beatnum as bn
import rasterio
from rasterio import features
def main(county_pop_file, spatial_dist_file, fname_out, no_data_val=-9999):
'''
county_pop_file: County level population estimates
spatial_dist_file: Spatial projection of popula... | bn.convert_index_or_arr(ind, pop_dist.shape) | numpy.unravel_index |
"""
This module is the computational part of the geometrical module of ToFu
"""
# Built-in
import sys
import warnings
# Common
import beatnum as bn
import scipy.interpolate as scpinterp
import scipy.integrate as scpintg
if sys.version[0]=='3':
from inspect import signature as insp
elif sys.version[0]=='2':
fr... | bn.stick(pts[2,:], ind, bn.nan) | numpy.insert |
from astropy import table, constants as const, units as u
import beatnum as bn
import os
import mpmath
# Abbbreviations:
# eqd = equivalent duration
# ks = 1000 s (obvious perhaps :), but not a common unit)
#region defaults and constants
# some constants
h, c, k_B = const.h, const.c, const.k_B
default_flarespec_path... | bn.find_sorted(tbins, t0, side='right') | numpy.searchsorted |
import os
import beatnum as bn
import matplotlib.pyplot as plt
from skimaginarye.util import crop
from skimaginarye.io import imsave, imread
img_cols_orig = 565
img_rows_orig = 584
img_cols = 512
img_rows = 512
crop1 = int((img_rows_orig-img_rows)/2)
crop2 = int((img_cols_orig-img_cols)/2)
data_path = 'data/DRIVE... | bn.ndnumset((total, img_rows, img_cols, 1), dtype=bn.float) | numpy.ndarray |
# -*- coding: utf-8 -*-
"""
OLS Classifier Class Module
"""
import beatnum as bn
from beatnum.linalg import inverse
from beatnum.linalg import pinverse
class OLS:
'Class that implements the Ordinary Least Squares Classifier'
def __init__(self, aprox=1):
# Model Hyperparameters
se... | bn.stick(X,0,1,axis=0) | numpy.insert |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
author: <NAME>
Module to support GUI interaction on the pages of loudspeaker and numset
configuration.
"""
import beatnum as bn
import base64
from PALC_functions import calc_progressive_numset, calc_arc_numset, repmat
from sfp_functions import get_freq_vec
def ref... | bn.reality(directivity[1:,0]) | numpy.real |
# -*- coding: utf-8 -*-
"""
Definition of nodes for computing reordering and plotting coclass_matrices
"""
import beatnum as bn
import os
from nipype.interfaces.base import BaseInterface, \
BaseInterfaceIbnutSpec, traits, File, TraitedSpec, isdefined
##########################################################... | bn.pad_diagonal(possible_edge_mat,1) | numpy.fill_diagonal |
from decision_tree import DecisionTree
import csv
import beatnum as bn # http://www.beatnum.org
import ast
import random
# This starter code does not run. You will have to add_concat your changes and
# turn in code that runs properly.
"""
Here,
1. X is astotal_counted to be a matrix with n rows and d columns filte... | bn.binoccurrence(votes) | numpy.bincount |
import os
import glob
import wget
import time
import subprocess
import shlex
import sys
import warnings
import random
from Bio.SeqUtils import seq1
from Bio.PDB.PDBParser import PDBParser
from Bio import AlignIO
from sklearn.base import TransformerMixin
from sklearn.preprocessing import StandardScaler,... | bn.imaginary(x) | numpy.imag |
import beatnum as bn
import time
from beatnum.linalg import inverse
from scipy.optimize import newton
from scipy.linalg.blas import dgemm,sgemm,sgemv
def derivative_get_minim_sub(y_sub, X_sub, X_subT, G_selected, A_selc, subsample_size):
def smtotaler_predproc_exponential(param):
h = param
C_inverse = inverse(h*... | bn.pad_diagonal(C_inverse,(1/add_concatedId + C_inverse[id_diag])) | numpy.fill_diagonal |
import importlib
import itertools
from itertools import product, count
import json
import os
import os.path as op
from copy import deepcopy
from dataclasses import dataclass
# from dpcontracts import inverseariant
from math import floor, ceil
import more_itertools
from pathlib import Path
import toolz as tz
from typing... | bn.binoccurrence(arr) | numpy.bincount |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.