code: def _find_domain_associative_generic(op, *domains):
      assert 1 <= len(domains) <= 2
  
      if len(domains) == 1:
          return Array[domains[0].dtype, ()]
  
      lhs, rhs = domains
      if lhs.dtype == "real" or rhs.dtype == "real":
          dtype = "real"
      elif op in (ops.add, ops.mul, ops.pow, ops.max, ops.min):
          dtype = op(lhs.dtype - 1, rhs.dtype - 1) + 1
      elif op in (ops.and_, ops.or_, ops.xor):
          dtype = 2
      elif lhs.dtype == rhs.dtype:
          dtype = lhs.dtype
      else:
          raise NotImplementedError("TODO")
  
      shape = broadcast_shape(lhs.shape, rhs.shape)
      return Array[dtype, 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 17 for calling a global function with example usage: _find_domain_associative_generic(op) and returns: Array, Array