code: def _ndarray_matmul_ndim(left, right):
      if left == 1 and right == 1:
          return 0
      elif left == 1:
          return right - 1
      elif right == 1:
          return left - 1
      else:
          assert left == right
          return left
  
file_path: hail/hail/python/hail/linalg/utils/misc.py
imports: import numpy
  import hail
  from hail.typecheck import typecheck, oneof, nullable
  from hail.expr.expressions import expr_locus, expr_float64, raise_unless_row_indexed
  from hail.utils.java import Env
label_desc: Use image node_id 4 for calling a global function with example usage: _ndarray_matmul_ndim(left, right) and returns: int, unknown, unknown, left