code: def convert(val, unit, axis):
      if np.iterable(val):
          if isinstance(val, np.ma.MaskedArray):
              val = val.astype(float).filled(np.nan)
          out = np.empty(len(val))
          for i, thisval in enumerate(val):
              if np.ma.is_masked(thisval):
                  out[i] = np.nan
              else:
                  try:
                      out[i] = thisval.convert_to(unit).get_value()
                  except AttributeError:
                      out[i] = thisval
          return out
      if np.ma.is_masked(val):
          return np.nan
      else:
          return val.convert_to(unit).get_value()
  
imports: import math
  from packaging.version import parse
  import numpy
  import matplotlib.ticker
  import matplotlib.units
label_desc: Use image node_id 2 for calling the BasicUnitConverter obj's underlying member method code with example usage: obj.convert(val, unit, axis) and returns: out, np, val