code: def test_naive_ubersum(equation, plates):
      inputs, outputs, operands, sizes = make_example(equation)
  
      actual = naive_ubersum(equation, *operands, plates=plates)
  
      assert isinstance(actual, tuple)
      assert len(actual) == len(outputs)
      for output, actual_part in zip(outputs, actual):
          expected_shape = tuple(sizes[dim] for dim in output)
          assert actual_part.shape == expected_shape
          if not plates:
              equation_part = ",".join(inputs) + "->" + output
              expected_part = opt_einsum.contract(
                  equation_part,
                  *operands,
                  backend="pyro.ops.einsum.torch_log",
              )
              assert_equal(
                  expected_part,
                  actual_part,
                  msg="For output '{}':\nExpected:\n{}\nActual:\n{}".format(
                      output,
                      expected_part.detach().cpu(),
                      actual_part.detach().cpu(),
                  ),
              )
  
imports: import itertools
  import numbers
  from collections import OrderedDict
  import opt_einsum
  import pytest
  import torch
  import pyro.ops.jit
  from pyro.distributions.util import logsumexp
  from pyro.ops.contract import _partition_terms, contract_tensor_tree, contract_to_tensor, einsum, naive_ubersum, ubersum
  from pyro.ops.einsum.adjoint import require_backward
  from pyro.ops.rings import LogRing
  from pyro.poutine.indep_messenger import CondIndepStackFrame
  from pyro.util import optional
  from tests.common import assert_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_naive_ubersum(equation, plates) without return types