code: def _run(
      self,
      cond: np.ndarray | np.bool_,
      context=None,
      else_branch=None,
      then_branch=None,
      attributes=None,
  ):
      if cond.size != 1:
          raise ValueError(
              f"Operator If ({self.onnx_node.name!r}) expects a single element as condition, but the size of 'cond' is {len(cond)}."
          )
      cond_ = cond.item(0)
      if cond_:
          self._log("  -- then> {%r}", context)
          outputs = self._run_then_branch(context, attributes=attributes)  # type: ignore
          self._log("  -- then<")
          final = tuple(outputs)
          branch = "then"
      else:
          self._log("  -- else> {%r}", context)
          outputs = self._run_else_branch(context, attributes=attributes)  # type: ignore
          self._log("  -- else<")
          final = tuple(outputs)
          branch = "else"
  
      if not final:
          raise RuntimeError(
              f"Operator If ({self.onnx_node.name!r}) does not have any output."
          )
      for i, f in enumerate(final):
          if f is None:
              br = self.then_branch if branch == "then" else self.else_branch  # type: ignore
              names = br.output_names
              inits = [i.name for i in br.obj.graph.initializer]
              raise RuntimeError(
                  f"Output {i!r} (branch={branch!r}, name={names[i]!r}) is None, "
                  f"available inputs={sorted(context)}, initializers={inits}."
              )
      return self._check_and_fix_outputs(final)
  
file_path: onnx/onnx/reference/ops/op_if.py
imports: from __future__ import annotations
  import numpy
  from onnx.reference.op_run import OpRun
label_desc: Use image node_id 3 for calling the If obj's underlying member method code with example usage: obj._run(cond, context, else_branch, then_branch, attributes) and returns: self