code: def flux_perc(magnitude):
      sorted_data = np.sort(magnitude)
      lc_length = len(sorted_data)
  
      F_60_index = int(math.ceil(0.60 * lc_length))
      F_40_index = int(math.ceil(0.40 * lc_length))
      F_5_index = int(math.ceil(0.05 * lc_length))
      F_95_index = int(math.ceil(0.95 * lc_length))
  
      F_40_60 = sorted_data[F_60_index] - sorted_data[F_40_index]
      F_5_95 = sorted_data[F_95_index] - sorted_data[F_5_index]
      F_mid20 = F_40_60 / F_5_95
  
      return {"FluxPercentileRatioMid20": F_mid20}
  
imports: import pandas
  import numpy
  from statsmodels.tsa.stattools import acf, adfuller, pacf
  import itertools
  from statsmodels.tsa.ar_model import AR
  from scipy.signal import cwt, find_peaks_cwt, ricker, welch
  from scipy.stats import linregress
  import scipy.stats
  from scipy.stats import kurtosis
  from scipy.stats import skew
  import numpy
  from scipy import signal, integrate
  from scipy.interpolate import interp1d
  import math
  from statsmodels.tools.sm_exceptions import MissingDataError
  from numpy.linalg import LinAlgError
label_desc: Use image node_id 49 for calling a global function with example usage: flux_perc(magnitude) and returns: dict