code: def _complex2real(z):
      return np.ascontiguousarray(z, dtype=complex).view(np.float64)
  
file_path: scipy/scipy/optimize/_spectral.py
imports: import collections
  import numpy
  from scipy.optimize import OptimizeResult
  from scipy.optimize._optimize import _check_unknown_options
  from ._linesearch import _nonmonotone_line_search_cruz, _nonmonotone_line_search_cheng
label_desc: Use image node_id 5 for calling a global function with example usage: _complex2real(z) and returns: np