code: def structure_func(time, param=struct_param):
      dict_final = {}
      for key, magnitude in param.items():
          dict_final[key] = []
          Nsf, Np = 100, 100
          sf1, sf2, sf3 = np.zeros(Nsf), np.zeros(Nsf), np.zeros(Nsf)
          f = interp1d(time, magnitude)
  
          time_int = np.linspace(np.min(time), np.max(time), Np)
          mag_int = f(time_int)
  
          for tau in np.arange(1, Nsf):
              sf1[tau - 1] = np.mean(
                  np.power(
                      np.abs(mag_int[0 : Np - tau] - mag_int[tau:Np]),
                      1.0,
                  )
              )
              sf2[tau - 1] = np.mean(
                  np.abs(
                      np.power(
                          np.abs(
                              mag_int[0 : Np - tau] - mag_int[tau:Np]
                          ),
                          2.0,
                      )
                  )
              )
              sf3[tau - 1] = np.mean(
                  np.abs(
                      np.power(
                          np.abs(
                              mag_int[0 : Np - tau] - mag_int[tau:Np]
                          ),
                          3.0,
                      )
                  )
              )
          sf1_log = np.log10(np.trim_zeros(sf1))
          sf2_log = np.log10(np.trim_zeros(sf2))
          sf3_log = np.log10(np.trim_zeros(sf3))
  
          if len(sf1_log) and len(sf2_log):
              m_21, b_21 = np.polyfit(sf1_log, sf2_log, 1)
          else:
              m_21 = np.nan
  
          if len(sf1_log) and len(sf3_log):
              m_31, b_31 = np.polyfit(sf1_log, sf3_log, 1)
          else:
              m_31 = np.nan
  
          if len(sf2_log) and len(sf3_log):
              m_32, b_32 = np.polyfit(sf2_log, sf3_log, 1)
          else:
              m_32 = np.nan
          dict_final[key].append(m_21)
          dict_final[key].append(m_31)
          dict_final[key].append(m_32)
  
      return [
          ("StructureFunction_{}__m_{}".format(key, name), li)
          for key, lis in dict_final.items()
          for name, li in zip([21, 31, 32], lis)
      ]
  
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 51 for calling a global function with example usage: structure_func(time, param) and returns: unknown