code: def _singular_values(M):
      """Compute the singular values of a Matrix
  
      Examples
      ========
  
      >>> from sympy import Matrix, Symbol
      >>> x = Symbol('x', real=True)
      >>> M = Matrix([[0, 1, 0], [0, x, 0], [-1, 0, 0]])
      >>> M.singular_values()
      [sqrt(x**2 + 1), 1, 0]
  
      See Also
      ========
  
      condition_number
      """
  
      if M.rows >= M.cols:
          valmultpairs = M.H.multiply(M).eigenvals()
      else:
          valmultpairs = M.multiply(M.H).eigenvals()
  
      # Expands result from eigenvals into a simple list
      vals = []
  
      for k, v in valmultpairs.items():
          vals += [sqrt(k)] * v  # dangerous! same k in several spots!
  
      # Pad with zeros if singular values are computed in reverse way,
      # to give consistent format.
      if len(vals) < M.cols:
          vals += [M.zero] * (M.cols - len(vals))
  
      # sort them in descending order
      vals.sort(reverse=True, key=default_sort_key)
  
      return vals
  
imports: from types import FunctionType
  from collections import Counter
  from mpmath import mp, workprec
  from mpmath.libmp.libmpf import prec_to_dps
  from sympy.core.sorting import default_sort_key
  from sympy.core.evalf import DEFAULT_MAXPREC, PrecisionExhausted
  from sympy.core.logic import fuzzy_and, fuzzy_or
  from sympy.core.numbers import Float
  from sympy.core.sympify import _sympify
  from sympy.functions.elementary.miscellaneous import sqrt
  from sympy.polys import roots, CRootOf, ZZ, QQ, EX
  from sympy.polys.matrices import DomainMatrix
  from sympy.polys.matrices.eigen import dom_eigenvects, dom_eigenvects_to_sympy
  from sympy.polys.polytools import gcd
  from .exceptions import MatrixError, NonSquareMatrixError
  from .determinant import _find_reasonable_pivot
  from .utilities import _iszero, _simplify
label_desc: Use image node_id 30 for calling a global function with example usage: _singular_values(M) and returns: vals