docstr: If old_var is in the list of block's outputs,
  replace old_var with the new_var.
docstr_tok: ["If","old_var","is","in","the","list","of","block","'s","outputs",",","replace","old_var","with","the","new_var","."]
code: def replace_block_output_var(
      self,
      old_var,
      new_var,
  ):
      """
      If old_var is in the list of block's outputs,
      replace old_var with the new_var.
      """
      found_old_var_in_output = False
      # There could be multiple matched `old_var` in output when the program has duplicate vars
      # in the output.
      for idx, output_var in enumerate(self._outputs):
          if old_var == output_var:
              found_old_var_in_output = True
              self._outputs[idx] = new_var
      if found_old_var_in_output:
          new_var.consuming_blocks.append(self)
          # This block no longer uses `old_var` as its outputs
          old_var.consuming_blocks.remove(self)
          # Ensure output name is consistent
          if isinstance(self, Function):
              if (
                  new_var in self.inputs.values()
                  and new_var.name != old_var.name
              ):
                  raise ValueError(
                      "It is not allowed to modify function inputs name."
                  )
              new_var.name = old_var.name
  
imports: import copy
  from collections import Counter, OrderedDict
  from typing import Tuple
  from coremltools import _OPSET
  from coremltools import _logger
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from .None import SPACES, types
  from .operation import Operation
  from .types.symbolic import is_symbolic, k_used_symbols
  from .var import ComplexVar, InternalVar, Var
  from .visitors.dot_visitor import DotVisitor
label_desc: Use image node_id 16 for calling the Block obj's underlying member method code with example usage: obj.replace_block_output_var(old_var, new_var) without return types