code: def apply_optimizer(x):
      with funsor.interpretations.normalize:
          expr = funsor.interpreter.reinterpret(x)
  
      with funsor.optimizer.optimize_base:
          return funsor.interpreter.reinterpret(expr)
  
imports: import contextlib
  import funsor
  from funsor.adjoint import AdjointTape
  from funsor.sum_product import _partition
  from pyro.contrib.funsor import to_data, to_funsor
  from pyro.contrib.funsor.handlers import enum, plate, replay, trace
  from pyro.contrib.funsor.infer.elbo import ELBO, Jit_ELBO
  from pyro.distributions.util import copy_docs_from
  from pyro.infer import TraceEnum_ELBO
label_desc: Use image node_id 1 for calling a global function with example usage: apply_optimizer(x) and returns: funsor