code: def _median_complex(data, axis):
      """Compute marginal median on complex data safely.
  
      Can be removed when numpy introduces a fix.
      See: https://github.com/scipy/scipy/pull/12676/.
      """
      # np.median must be passed real arrays for the desired result
      if np.iscomplexobj(data):
          data = np.median(np.real(data), axis=axis) + 1j * np.median(
              np.imag(data), axis=axis
          )
      else:
          data = np.median(data, axis=axis)
      return data
  
imports: import inspect
  import operator
  import os
  import warnings
  from contextlib import contextmanager
  from io import StringIO
  from math import log
  from pprint import pprint
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _median_complex(data, axis) and returns: data