code: def _find_domain_matmul(op, lhs, rhs):
      assert lhs.shape and rhs.shape
      if len(rhs.shape) == 1:
          assert lhs.shape[-1] == rhs.shape[-1]
          shape = lhs.shape[:-1]
      elif len(lhs.shape) == 1:
          assert lhs.shape[-1] == rhs.shape[-2]
          shape = rhs.shape[:-2] + rhs.shape[-1:]
      else:
          assert lhs.shape[-1] == rhs.shape[-2]
          shape = (
              broadcast_shape(lhs.shape[:-1], rhs.shape[:-2] + (1,))
              + rhs.shape[-1:]
          )
      return Reals[shape]
  
imports: import copyreg
  import functools
  import inspect
  import operator
  import warnings
  from functools import reduce
  from weakref import WeakValueDictionary
  import funsor.ops
  from funsor.ops.builtin import parse_ellipsis, parse_slice
  from funsor.util import broadcast_shape, get_backend, get_tracing_state, quote
label_desc: Use image node_id 16 for calling a global function with example usage: _find_domain_matmul(op, lhs, rhs) and returns: Reals