code: def _asfarray(x):
      """Like numpy asfarray, except that it does not modify x dtype if x is
      already an array with a float dtype, and do not cast complex types to
      real."""
      if (
          hasattr(x, "dtype")
          and x.dtype.char in numpy.typecodes["AllFloat"]
      ):
          # 'dtype' attribute does not ensure that the
          # object is an ndarray (e.g. Series class
          # from the pandas library)
          if x.dtype == numpy.half:
              # no half-precision routines, so convert to single precision
              return numpy.asarray(x, dtype=numpy.float32)
          return numpy.asarray(x, dtype=x.dtype)
      else:
          # We cannot use asfarray directly because it converts sequences of
          # complex to sequence of real
          ret = numpy.asarray(x)
          if ret.dtype == numpy.half:
              return numpy.asarray(ret, dtype=numpy.float32)
          elif ret.dtype.char not in numpy.typecodes["AllFloat"]:
              return numpy.asfarray(x)
          return ret
  
imports: from __future__ import division, print_function, absolute_import
  from numpy import swapaxes, zeros
  import numpy
  from .None import _fftpack
  from scipy.fftpack.helper import _init_nd_shape_and_axes_sorted
  import atexit
label_desc: Use image node_id 8 for calling a global function with example usage: _asfarray(x) and returns: numpy, ret, numpy, numpy, numpy