code: def _geneig(
      a1, b1, left, right, overwrite_a, overwrite_b, homogeneous_eigvals
  ):
      (ggev,) = get_lapack_funcs(("ggev",), (a1, b1))
      cvl, cvr = left, right
      res = ggev(a1, b1, lwork=-1)
      lwork = res[-2][0].real.astype(numpy.int_)
      if ggev.typecode in "cz":
          alpha, beta, vl, vr, work, info = ggev(
              a1, b1, cvl, cvr, lwork, overwrite_a, overwrite_b
          )
          w = _make_eigvals(alpha, beta, homogeneous_eigvals)
      else:
          alphar, alphai, beta, vl, vr, work, info = ggev(
              a1, b1, cvl, cvr, lwork, overwrite_a, overwrite_b
          )
          alpha = alphar + _I * alphai
          w = _make_eigvals(alpha, beta, homogeneous_eigvals)
      _check_info(info, "generalized eig algorithm (ggev)")
  
      only_real = numpy.all(w.imag == 0.0)
      if not (ggev.typecode in "cz" or only_real):
          t = w.dtype.char
          if left:
              vl = _make_complex_eigvecs(w, vl, t)
          if right:
              vr = _make_complex_eigvecs(w, vr, t)
  
      # the eigenvectors returned by the lapack function are NOT normalized
      for i in range(vr.shape[0]):
          if right:
              vr[:, i] /= norm(vr[:, i])
          if left:
              vl[:, i] /= norm(vl[:, i])
  
      if not (left or right):
          return w
      if left:
          if right:
              return w, vl, vr
          return w, vl
      return w, vr
  
file_path: catboost/contrib/python/scipy/py3/scipy/linalg/decomp.py
imports: import numpy
  from numpy import array, isfinite, inexact, nonzero, iscomplexobj, cast, flatnonzero, conj, asarray, argsort, empty, iscomplex, zeros, einsum, eye, inf
  from scipy._lib._util import _asarray_validated
  from .misc import LinAlgError, _datacopied, norm
  from .lapack import get_lapack_funcs, _compute_lwork
label_desc: Use image node_id 3 for calling a global function with example usage: _geneig(a1, b1, left, right, overwrite_a, overwrite_b, homogeneous_eigvals) and returns: w,  vr, w, w,  vl, w,  vl,  vr