code: def _bidiagonalize(M, upper=True):
      """
      Returns $B$, the Bidiagonalized form of the input matrix.
  
      Note: Bidiagonal Computation can hang for symbolic matrices.
  
      Parameters
      ==========
  
      upper : bool. Whether to do upper bidiagnalization or lower.
                  True for upper and False for lower.
  
      References
      ==========
  
      .. [1] Algorithm 5.4.2, Matrix computations by Golub and Van Loan, 4th edition
      .. [2] Complex Matrix Bidiagonalization : https://github.com/vslobody/Householder-Bidiagonalization
  
      """
  
      if not isinstance(upper, bool):
          raise ValueError("upper must be a boolean")
  
      if upper:
          return _eval_bidiag_hholder(M)
      return _eval_bidiag_hholder(M.H).H
  
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 17 for calling a global function with example usage: _bidiagonalize(M, upper) and returns: _eval_bidiag_hholder, _eval_bidiag_hholder