text
string
<gh_stars>0 import pandas as pd import numpy as np import scipy.stats as ss def cramers_v(confusion_matrix: pd.DataFrame) -> int: """ Calculate Cramers V statistic for categorial-categorial association. uses correction from Bergsma and Wicher, Journal of the Korean Statistical Society 42 (2013): 323-3...
# uncompyle6 version 3.7.4 # Python bytecode 3.7 (3394) # Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # Embedded file name: T:\InGame\Gameplay\Scripts\Server\routing\object_routing\object_routing_behavior_actions.py # Compiled at: 2020-04-14 00:05:30 # Size ...
from scipy.io import loadmat import numpy as np from matplotlib import pyplot as plt # This script prints selected frames of the stored escalator video sequence data = loadmat('escalator_130p.mat') X = data["X"] dimensions = data["dimensions"][0] framenumbers = [1806, 1813, 1820] for framenumber in framenumbers: ...
<filename>HCTSA Vital Proccessing/Operations.py #© 2020 By The Rector And Visitors Of The University Of Virginia #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 wit...
from pudzu.charts import * from scipy import ndimage import seaborn as sns import tqdm MAP = "maps/Europe.png" MERGE = { 'Gibraltar': 'UK', 'Jersey': 'UK', 'Guernsey': 'UK', 'Faroe Islands': 'Denmark' } COLOR = { 'Sea': '#E0E0FF', 'Borders': 'white', 'Land': 'white' } PALETTE_ARGS = { 'start': 0.2, 'rot': -0.75, 'hue'...
from subprocess import call import sys import os from PIL import Image import numpy as np from scipy import ndimage from subprocess import call import sys import os from PIL import Image from datetime import datetime import cv2 from object_detection.utils import visualization_utils as vis_util from objec...
import os.path import numpy as np import astropy.io.ascii import re import scipy.interpolate import pkg_resources class MeanStars: def __init__(self, datapath=None): """MeanStars implements an automated lookup and interpolation functionality over th data from: "A Modern Mean Dwarf Stellar Color ...
<filename>calcium_analysis/modules.py from collections import OrderedDict import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore #import pyqtgraph.flowchart import pyqtgraph.parametertree as pt import numpy as np import scipy.ndimage as ndi import functions as fn class CellSelector(QtCore.QObject): """Se...
#!/usr/bin/env python import rospy import rospkg from transition_srv.srv import * from transition_srv.msg import * from std_msgs.msg import String from baxter_core_msgs.msg import EndpointState from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter import numpy as np import scipy.io import glob import os ...
<reponame>microsoft/Turtlebot3-Photo-Collection<gh_stars>1-10 #!/usr/bin/env python3 from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient from azure.cognitiveservices.vision.customvision.training.models import * from msrest.authentication import ApiKeyCredentials from turtlebot3_...
# -*- coding: utf-8 -*- import os import sys import h5py from matplotlib import rcParams import matplotlib.pyplot as plt import numpy as np from scipy.optimize import curve_fit from presto.utils import rotate_opt rcParams['figure.dpi'] = 108.8 if len(sys.argv) == 2: load_filename = sys.argv[1] print(f"Loadi...
#!/usr/bin/python """Create a consensus dataset. Create a set of images, sampling N images per attribute. """ import json import time import pickle import sys import csv import argparse import os import os.path as osp import shutil import numpy as np import matplotlib.pyplot as plt from PIL import Image from scipy.m...
<filename>src/processing.py """ Pre-processing and post-processing """ import numpy as np import scipy.ndimage as ndi import torch from scipy.ndimage.morphology import distance_transform_edt from skimage.morphology import ( skeletonize_3d, remove_small_objects, remove_small_holes ) def create_signal(mask): ...
<filename>eda.py<gh_stars>1-10 import random from random import shuffle from kmeans import random_deletion as crandom_deletion from kmeans import random_swap as crandom_swap from scipy.sparse import csr_matrix, vstack random.seed(1) ######################################################################## # Random del...
<reponame>Guzpenha/DomainRegularizedDeepMatchingNetworks # -*- coding: utf8 -*- import os import sys import time import json import argparse import random # random.seed(49999) import numpy # numpy.random.seed(49999) import tensorflow # tensorflow.set_random_seed(49999) from collections import OrderedDict import keras...
<filename>acq4/analysis/modules/PSPReversal/PSPReversal.py # -*- coding: utf-8 -*- from __future__ import print_function """ PSPReversal: Analysis module that analyzes the current-voltage relationships relationships of PSPs from voltage clamp data. This is part of Acq4 Based on IVCurve (as of 5/2014) <NAME>, Ph.D. 201...
<reponame>wellcometrust/deep_reference_parser #!/usr/bin/env python3 # coding: utf-8 """ Runs the model using configuration defined in a config file. This is suitable for running model versions < 2019.10.8 """ import plac import wasabi from deep_reference_parser import load_tsv from deep_reference_parser.common impor...
<reponame>OneGneissGuy/detrend-ec # -*- coding: utf-8 -*- """ Created on Thu Dec 6 12:38:52 2018 script to read in conductivity data and correct for drift due to evaporation @author: jsaracen """ import numpy as np import pandas as pd from scipy.signal import detrend input_data_file = 'sc1000_data.csv' #read...
<reponame>HBOMAT/AglaUndZufall #!/usr/bin/python # -*- coding utf-8 -*- # # Kurve - Klasse von agla # # # This file is part of agla # # # Copyright (c) 2019 <NAME> <EMAIL> # # # Licensed under the Apache L...
import numpy as np from math import ceil, sqrt import sys sys.path.append('..') from scipy.stats import multivariate_normal, uniform, norm from scipy.optimize import Bounds from itertools import product from scipy.special import erf class ToyMVNMultiDSimpleHypLoader: def __init__(self, alt_mu_norm=1, d_obs=2, ...
import numpy as np from .HDPModel import HDPModel from bnpy.suffstats import SuffStatBag from bnpy.util import NumericUtil, NumericHardUtil import scipy.sparse import logging Log = logging.getLogger('bnpy') class HDPSoft2Hard(HDPModel): ######################################################### Local Params ###...
<filename>demoSfM.py<gh_stars>100-1000 import torch import numpy as np import BPnP import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import torchvision from scipy.io import loadmat, savemat device = 'cuda' pl = 0.00000586 f = 0.0005 u = 0 v = 0 K = torch.tensor( [[f, 0, u], [0, f, v], ...
<filename>baobab/bnn_priors/models.py import numpy as np from scipy.special import gamma import astropy.units as u def velocity_dispersion_function_CPV2007(vel_disp_grid): """Evaluate the velocity dispersion function from the fit on SDSS DR6 by [1]_ on a provided grid. Parameters ---------- vel_di...
import numpy as np import pandas as pd import matplotlib.cm as cm import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import seaborn as sns from scipy import stats import warnings import os from itertools import combinations import multiprocessing from multiprocessing import Pool from ...
# -*- coding: utf-8 -*- import glob, os, json, pickle import pandas as pd import numpy as np from scipy import ones,arange,floor from sklearn.linear_model import SGDClassifier from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import train_test_split from sklearn.grid_search import...
<filename>server/app/outputs/led.py import socket import logging import time import random import numpy as np from scipy.ndimage.filters import gaussian_filter1d from . import Output from app.effects import Effect from app.lib.dsp import ExpFilter from app.lib.misc import FPSCounter logger = logging.getLogger() #...
from __future__ import division import logging import math from datetime import datetime # import itertools # pyplot is not thread safe since it rely on global parameters: https://github.com/matplotlib/matplotlib/issues/757 from matplotlib.figure import Figure from matplotlib.artist import setp from matplo...
<reponame>mtopalid/Neurosciences # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright INRIA # Contributors: <NAME> (<EMAIL>) # <NAME> (<EMAIL>) # # This software is governed by the CeCILL license under French law and abiding # by the rules of ...
<gh_stars>0 #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Apr 11 09:54:02 2018 @author: frico """ #============================================================================== # Plotting - HC3N* #============================================================================== version = '8' # Th...
import scipy.stats as st import gzip import argparse from signal import signal, SIGPIPE, SIG_DFL signal(SIGPIPE,SIG_DFL) parser = argparse.ArgumentParser(description = "Keep one minimal p-value per position to make fgwas annotations.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--qtlt...
<reponame>Wei2624/pcl_post_processing import os import cv2 import numpy as np import sys import scipy.io import pcl import image_geometry import random # from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt import math import pickle from pcl_pixel_processing import pcl_processing from pcl_pixel_proc...
<filename>localisation.py # !/usr/bin/env python # # 'localisation.py' has a simple implementation of calculation for # disorder-averaged amplitudes of a 1d-tight binding model with # the nearest neighbor couplings being perturbed by disorder. # # # MIT License. Copyright (c) 2020 <NAME> # # Source code at # <htt...
<gh_stars>0 from scipy.stats import pearsonr import matplotlib.pyplot as plt import pickle import numpy as np import csv import os,sys # changeable inputs # choices are: euclid, corr, dtw, and norm (for manhattan) matrix_type = 'dtw' no_buffer = False # open linkage matrix with open(os.path.join('data',matrix_type+'...
import sys import time from orangecontrib.shadow.als.widgets.gui.shadow4_ow_electron_beam import OWElectronBeam from orangecontrib.shadow.als.widgets.gui.shadow4_plots import plot_data1D from oasys.widgets import gui as oasysgui from orangewidget import gui as orangegui from orangewidget.settings import Setting # fr...
<filename>fe/utils.py import numpy as np import simtk.unit def set_velocities_to_temperature(n_atoms, temperature, masses): assert 0 # don't call this yet until its v_t = np.random.normal(size=(n_atoms, 3)) velocity_scale = np.sqrt(constants.BOLTZ*temperature/np.expand_dims(masses, -1)) return v_t*velo...
<filename>gui_and_analytics/analytics/power/solar.py import numpy as np import scipy.integrate from datetime import datetime import analytics.forecast.forecast as fc import analytics.location.path as ap import analytics.definitions as adef def ghi_total_over_path(path: ap.Path) -> float: """ Returned value is Wa...
''' Created on Dec 6, 2018 ''' # System imports import os # Standard imports import numpy as np import tensorflow as tf import keras.backend as K from scipy import stats # Plotting libraries import matplotlib.pyplot as plt # Project library imports from modules.deltavae.deltavae_latent_spaces.deltavae_parent import...
<reponame>vyatu/Hanabi-AI-Engineering-Thesis # -*- coding: utf-8 -*- from framework import BasePlayer, Choice, ChoiceDetails, utils, HintDetails import random import math from copy import deepcopy import statistics debug = True random_action = 0.01 exploration_param = math.sqrt(2) class Reinforced: def __init__...
<reponame>DenisAltruist/NEFreeSamplesFinder from scipy.optimize import linprog import time import numpy as np def solve(A, b): c = np.zeros(len(A[0])).tolist() res = linprog(c=c, A_ub=A, b_ub=b, bounds=(None, None), method='interior-point') return res['success'], np.array(res['x']).tolist() def is_feasible(A,...
<gh_stars>1-10 from numpy import exp, median from scipy.sparse.csgraph import laplacian from sklearn.manifold.locally_linear import ( null_space, LocallyLinearEmbedding) from sklearn.metrics.pairwise import pairwise_distances, rbf_kernel from sklearn.neighbors import kneighbors_graph, NearestNeighbors def ler(X, ...
<reponame>rodriguesrenato/CarND-Capstone #!/usr/bin/env python import numpy as np import rospy from std_msgs.msg import Int32 from geometry_msgs.msg import PoseStamped, TwistStamped from styx_msgs.msg import Lane, Waypoint from scipy.spatial import KDTree from lowpass import LowPassFilter import math ''' This node wi...
<reponame>kevinlacaille/Galaxy-Disc-Fitting<gh_stars>1-10 import numpy import scipy import astropy import matplotlib import bottleneck import galpak import asciitable from astropy.io import fits from galpak import run import time #Set the beam and check parameters #restoring beam = 0.749", 0.665", 5.826deg ALMA_b7 = ...
import numpy as np import matplotlib.pyplot as plt from scipy import linalg import sys def read_geometry_local(file_name): f = open(file_name,'r') file_raw = f.read() file_lines = file_raw.split('\n') parameters = {} l = 1 while '/' not in file_lines[l] and len(file_lines[l])>0: lsplit...
"""Arnold-Winther elements on simplices. Thse elements definitions appear in https://doi.org/10.1007/s002110100348 (Arnold, Winther, 2002) [conforming] and https://doi.org/10.1142/S0218202503002507 (<NAME>, 2003) [nonconforming] """ import sympy from ..finite_element import CiarletElement from ..polynomials import po...
#coding:utf-8 # trial estimation of glottal source spectrum condition by inverse radiation filter and anti-formant filter # under following hypotheses. # (1) glottal source spectrum (frequency response) characterizes simply descending rightwards without sharp peak. # (2) resonance strength of formant is roughly...
<gh_stars>0 import numpy as np import os import random from scipy import io as sio import sys import torch from torch.utils import data from PIL import Image, ImageOps import pandas as pd import glob from config import cfg from .setting import cfg_data def letterbox(img,den, new_shape=(640, 640), color=(114, 114, 1...
#!/usr/bin/env python3 from collections import defaultdict as dd from itertools import product import os import pysam import argparse import pandas as pd import numpy as np import scipy.stats as ss import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') # Illustrator compatibil...
""" @author: frode This file contains functions for solving the tumour problem in both 1D and 2D. The main-function calls to smaller trial-functions, which call the solver functions using some initial conditions, and then plot the outputs. What remains to be done: Alter the """ import numpy as np from scipy.sparse...
import glob import json import numpy as np import pandas as pd from scipy.stats.mstats import gmean metric_names = [ 'node-is-malicious-accuracy', 'node-is-malicious-auc', 'node-is-attacked-accuracy', 'node-is-attacked-auc', 'edge-is-malicious-accuracy', 'edge-is-malicious-auc' ] def read_results(path): ...
<reponame>monte-flora/wofs_ml_severe<gh_stars>0 """Calibration of predicted probabilities.""" # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD 3 clause import warnings from inspect import signature from math import log import numpy as np fro...
""" A set of convenience functions to download datasets for illustrative examples """ import os import os.path as op import sys import itertools import numpy as np from scipy.special import comb from urllib.request import urlretrieve _rgcs_license_text = """ License ------- This tutorial dataset (RGC spikes data) is ...
#!/usr/bin/env python from pydy import * from sympy import factor # Create a Newtonian reference frame N = NewtonianReferenceFrame('N') # Declare parameters, coordinates, speeds params = N.declare_parameters('l1 l2 l3 ma mb g I11 I22 I33 I12 I23 I13 I J K T') q, qd = N.declare_coords('q', 7) u, ud = N.declare_speeds(...
import numpy as np import scipy.linalg as scipy_linalg import cocos.device import cocos.numerics as cn import cocos.numerics.linalg def compare_cocos_numpy(cocos_array, numpy_array): return np.allclose(np.array(cocos_array), numpy_array) def test_cholesky(): cocos.device.init() A_numpy = np.array([[1....
import matplotlib.pyplot as plt import numpy as np from scipy.stats import multivariate_normal import random as rn import iso mean = [0, 0] cov = [[1, 0], [0, 1]] # diagonal covariance Nobjs = 2000 x, y = np.random.multivariate_normal(mean, cov, Nobjs).T x[0]=3 y[0]=3 X=np.array([x,y]).T ntrees=500 CT=[] sample = 256...
from scipy import stats import numpy as np from .DoubleHyp import DoubleHyp class Z2Hyp(DoubleHyp): """double Z-test hypothesis""" def __init__(self, kind, sigma1, sigma2): dist = stats.norm(0, 1) super(Z2Hyp, self).__init__(dist, kind=kind) self.sigma1 = sigma1 self.sigma2 = s...
<filename>xrayvision/clean.py<gh_stars>1-10 """ CLEAN algorithms. The CLEAN algorithm solves the deconvolution problem by assuming equation by assuming a model for the true sky intensity which is a collection of point sources or in the case of multiscale clean a collection of appropriate component shapes at different ...
import sympy f = lambda x, r=0: r + 1 - x - sympy.exp(-x) from normal_forms import normal_form h = normal_form(f, x=0, k=2) print h.fun print h(2)
from sklearn.svm import LinearSVC from scipy.special import erf import nest import pylab # # # # Create neurons neuron1 = nest.Create("iaf_psc_alpha") nest.SetStatus(neuron1 , {"I_e": 376.}) neuron2 = nest.Create("iaf_psc_alpha") nest.SetStatus(neuron2 , {"I_e": 378.}) multimeter = nest.Create("multimeter") nest.S...
<reponame>7gang/7synth import numpy as np from scipy import signal notes = { # maps keyboard keys to musical notes "a": 440, # A4 "s": 494, # B4 "d": 523, # C4 "f": 587, # D4 "g": 660, # E4 "h": 698, # F4 "j": 784, # G4 "k": 880 # A5 } def wave(note, duration=1): """ Bas...
<reponame>LeoIV/sparse-ho import pytest import numpy as np from scipy.sparse import csc_matrix from sklearn import linear_model from sklearn.model_selection import KFold import celer from celer.datasets import make_correlated_data from sparse_ho.utils import Monitor from sparse_ho.models import Lasso from sparse_ho.cr...
#***************************************************# # This file is part of PFNET. # # # # Copyright (c) 2015, <NAME>. # # # # PFNET is released under the BSD 2-clause license. # #***********...
<gh_stars>1-10 import numpy as np from scipy import stats import plotly.offline as py import plotly.graph_objs as go # Create surfaces Z1 and Z2 n = 100 r = 10 x = np.linspace(-1.8, 1.8, n) y = np.linspace(-1.8, 1.8, n) X, Y = np.meshgrid(x, y) XY = np.empty((n * n, 2)) XY[:, 0] = X.flatten() XY[:, 1] = Y.flatten(...
<filename>run_exp.py from scipy.special import logsumexp import numpy as np import ctypes import os import platform import sys import functions import time import hashlib from shutil import copyfile config_file = sys.argv[1] exp_type = sys.argv[2] # options: model, pg rep_begin = int(sys.argv[3]) rep_end = int(sys.ar...
""" .. class:: LineLuminosityFunctionFromSimulations .. moduleauthor:: <NAME> <johan.comparat__at__gmail.com> The class LineLuminosityFunctionFromSimulations is dedicated to measuring the line luminosity functions obtained from simulations. """ from os.path import join import os import astropy.cosmology as co cosmo=c...
<reponame>googlearchive/rgc-models # Copyright 2018 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
import pandas as pd from sklearn import preprocessing from sklearn.decomposition import TruncatedSVD from sklearn.feature_extraction.text import CountVectorizer, HashingVectorizer from sklearn.feature_extraction.text import TfidfTransformer from sklearn.feature_extraction.text import ENGLISH_STOP_WORDS from sklearn.svm...
# Copyright 2021 Sony Group 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 i...
import numpy as np from scipy.optimize import minimize_scalar, minimize from scipy.stats import norm, multivariate_normal def sample_data(): dt = 1/12 maturity = np.array([1,3,5,10,20]) data = np.array([ [0.01995,0.02039,0.02158,0.02415,0.02603], [0.01981,0.02024,0.02116,0.02346,0.02518], ...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: <NAME> """ import pandas as pd import pickle import os import seaborn as sns import matplotlib.pyplot as plt import scipy.stats save_plots = True #%%load data analysis_folder=os.path.dirname(__file__) plot_folder=os.path.join(analysis_folder,...
<filename>python/homography.py import argparse import json import logging import pyflann import scipy.io as sio from util.iou_util import IouUtil from util.projective_camera import ProjectiveCamera from util.synthetic_util import SyntheticUtil LOGGER = logging.getLogger(__name__) def retrieve_homography(retrieved_...
<filename>deeplook/regularization/tikhonov.py """ Tikhonov regularization """ import scipy.sparse class Damping(): """ Damping regularization. """ def __init__(self, regul_param, nparams): self.regul_param = regul_param self.nparams = nparams def hessian(self, params=None): # py...
<reponame>BenedictIrwin/ExactLearning import numpy as np from scipy.special import ellipk from matplotlib import pyplot as plt x = np.random.exponential(size=(1000000)) y = np.random.exponential(size=(1000000)) mean = 0.25*np.pi*(x+y)/ellipk((x-y)/(x+y)) plt.hist(mean,bins=500,density=True) x = np.linspa...
import numpy as np import matplotlib.pyplot as plt from scipy.optimize import root_scalar from tqdm.auto import tqdm import jax.numpy as jnp from pydd.analysis import calculate_SNR from pydd.binary import * """ Plots SNRs for GR-in-vacuum binaries as a function of chirp mass and luminosity distance. Produces `figur...
from __future__ import print_function, division import os import sys sys.path.append(os.path.dirname(sys.path[0])) import warnings import numpy as np from scipy import interpolate from scipy.ndimage import interpolation as spinterp from scipy.stats import threshold import geometry import density def cart2pol(*coor...
<gh_stars>1-10 # -*- coding: utf-8 -*- """ Created on Mon Feb 1 07:55:39 2021 @author: kpapke """ import numpy from scipy.interpolate import interp1d from ..log import logmanager from .hs_formats import HSFormatFlag, HSFormatDefault, convert logger = logmanager.getLogger(__name__) __all__ = ['HSComponent'] cla...
<reponame>TatianaOvsiannikova/ostap #!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= # Copyright (c) Ostap developpers. # ============================================================================= # @file ostap/histos/tests/test_histos_pa...
<reponame>gitter-badger/mlmodels #!/usr/bin/env python # coding: utf-8 # In[1]: import json import os import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim from scipy.misc import imread, imresize import inception_v1 # just remove line below if want to use GPU # os.environ['CUDA_VISIBLE...
<filename>netNMFsc/run_netNMF-sc.py # run netNMF-sc from command line and save outputs to specified directory from __future__ import print_function import numpy as np from warnings import warn from joblib import Parallel, delayed import copy,argparse,os,math,random,time from scipy import sparse, io,linalg from scipy.sp...
import numpy as np import os import glob import healpy as hp from rubin_sim.photUtils import Sed, Bandpass from .twilightFunc import twilightFunc from scipy.interpolate import InterpolatedUnivariateSpline, interp1d from rubin_sim.data import get_data_dir # Make backwards compatible with healpy if hasattr(hp, 'get_inte...
''' 파일 이름 : 2108.py 제작자 : 정지운 제작 날짜 : 2018년 6월 5일 ''' """ lst = [] n = int(input()) for i in range(n): lst.append(int(input)) print(round(sum(lst) / len(lst))) print(lst[len(lst) // 2]) print(max(lst) - min(lst)) """ # statistics module을 python tutorial에서 보고 난 후 재도전 from statistics import mean, median, mod...
<gh_stars>1-10 import unittest from revenue_maximization_ranking.cascade.revenue import expected_revenue from scipy.stats import randint class TestExpectedRevenue(unittest.TestCase): def test_revenue(self): g = randint(1, 4) ranking = [("A", {"revenue": 1.2, "probability": 0.1}), ...
import serial import time import threading from myUtil import serialBaud, serialPort from myUtil import MHz, kHz, minUkw, maxUkw, minKw, maxKw, minMw, maxMw, minLw, maxLw from myUtil import minCap, maxCap from myUtil import capToLw, capToMw, capToKw, capToUkw from myLog import log, elog, slog import myRadios import myN...
""" This script receives a BedGraphFile file as input and smoothes it out using convolution with a window of the user's choosing. It also contains supplementary functionality such as changing the loci coordinates of the given BedGraph. """ import pathlib from enum import Enum from typing import Callable, MutableMapping...
<filename>Scripts/functions.py from initialise_parameters import params, control_data, categories, calculated_categories, change_in_categories from math import exp, ceil, log, floor, sqrt import numpy as np from scipy.integrate import ode from scipy.stats import norm, gamma import pandas as pd import statistics import ...
<reponame>Bridge-The-Gap-Series/PSK-00-JobMyers<gh_stars>0 import statistics name=input("Enter your name: ") age=int(input("Enter your age(20+): ")) print("\n\n") print("Hello world\n") print("my name is",name) print("I am ",age," years of age.Young, right?\U0001F600\n") numlist=[] numlist.append(12) numlist.append(4) ...
from ctypes import * import math import random import os import cv2 import numpy as np import time import darknet import pytesseract from skimage import measure import threading from scipy.spatial import distance as dist from collections import OrderedDict from multiprocessing import Process, Lock lic_pl = cv2.imread(...
import json,copy,datetime,numbers import numpy as np from scipy.sparse import csr_matrix from scipy.sparse.csgraph import connected_components from scipy.spatial.transform import Rotation as R import ase from ase import Atoms from ase.data import atomic_numbers,atomic_masses_iupac2016,chemical_symbols fro...
<gh_stars>0 import re import random import numpy as np import os.path import scipy.misc import shutil import zipfile import time import tensorflow as tf from glob import glob from urllib.request import urlretrieve from tqdm import tqdm from tensorflow.python.platform import gfile from tensorflow.core.protobuf import s...
# -*- coding: utf-8 -*- """ Created on Tue Jun 25 08:19:27 2019 @author: SESA539950 """ from scipy.optimize import fsolve import numpy as np simulation = ["AC Unit", "Ventilation Fans (Economizer Mode)"] simulation_options = ["AC Fans on UPS", "Vent Fans on UPS"] simulation01 = [ "AC Unit", "Front Ventilati...
# -*- coding: utf-8 -*- """ Created on Thu Jul 28 12:11:07 2016 @author: Eric """ import argparse import pickle import TopoSparsenet import numpy as np import scipy.io as io parser = argparse.ArgumentParser(description="Learn dictionaries for Topographic Sparsenet with given parameters.") parser.add_ar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Aug 23 17:31:19 2020 @author: skyjones """ import os import numpy as np import pandas as pd import scipy import gbs # for generating a default model master_csv = '/Users/manusdonahue/Documents/Sky/segmentations_sci/pt_data/move_and_prepare_tabular...
<gh_stars>0 # !/usr/bin/python3 # -*- coding: utf-8 -*- # *****************************************************************************/ # * Authors: <NAME>, <NAME> # *****************************************************************************/ """visualizeTS.py This module contains the basic functions for plotting t...
<reponame>hamishgibbs/facebook_mobility_uk #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Aug 10 09:39:32 2020 @author: hamishgibbs Which matrices are closest to eachother? Then - cluster the matrices to see what are the dominant patterns in travel network over time? Date x Date matrix of canberr...
<reponame>sjwenn/holmuskWorkspace from logs import logDecorator as lD import jsonref, pprint import matplotlib matplotlib.use('Qt5Agg') import matplotlib.pyplot as plt import numpy as np import seaborn as sns sns.set(style="dark") sns.set_palette(sns.diverging_palette(240, 120, l=60, n=3, center="dark")) from scipy im...
# coding: utf-8 # In[78]: import matplotlib.pyplot as plt from scipy.stats import multivariate_normal import numpy as np from mpl_toolkits.mplot3d import Axes3D plt.rcParams['figure.figsize']=(12,12) # In[89]: x,y = np.mgrid[-4:4:.01,-4:4:.01] # In[90]: pos = np.dstack((x,y)) # In[91]: fig=plt.figure() ...
# 3D IoU caculate code for 3D object detection # Kent 2018/12 # https://github.com/AlienCat-K/3D-IoU-Python/blob/master/3D-IoU-Python.py import numpy as np from scipy.spatial import ConvexHull from numpy import * def polygon_clip(subjectPolygon, clipPolygon): """ Clip a polygon with another polygon. ...
from .Element import Element from sympy import symbols, cosh, sinh, sqrt, lambdify from sympy.matrices import Matrix from ruamel import yaml from collections import UserList # TODO: Have StructuredBeamline inherit from UserList and remove the sequence attribute and just use self # This may break the current self._t...
import os import scipy.io import numpy as np from tqdm import tqdm import matplotlib.pyplot as plt data_path = os.path.join("Data-HWK3-2020","Problem-4","SymptomDisease.mat") data=scipy.io.loadmat(data_path) #print(data.keys()) W = data['W'] b = data['b'] p = data['p'] s = data['s'] # symptoms def check_data(): ...
import numpy as np import pandas as pd import pytest from pandas.testing import assert_frame_equal from scipy.sparse import csr_matrix from feature_engine.dataframe_checks import ( _check_contains_inf, _check_contains_na, _check_X_matches_training_df, check_X, ) def test_check_X_returns_df(df_vartype...
# emailAlert = EmailAlert() # ledAlert = LEDAlert() # maxThreshold = 10.5 # statsAlerter = StatsAlerter(maxThreshold, [emailAlert, ledAlert]) # statsAlerter.checkAndAlert([22.6, 12.5, 3.7]) # self.assertTrue(emailAlert.emailSent) # self.assertTrue(ledAlert.ledGlows) import statistics class ...