code: def _inference_context():
      msg = "You might need to check your input implementation."
      try:
          yield
      except (StopIteration, tf.errors.CancelledError):
          logger.error(
              "[InferenceRunner] input stopped before reaching its __len__()! "
              + msg
          )
          raise
      except tf.errors.OutOfRangeError:  # tf.data reaches an end
          pass
  
imports: import itertools
  import sys
  from contextlib import contextmanager
  import tqdm
  from tensorflow.python.training.monitored_session import _HookedSession
  from ..compat import tfv1
  from ..dataflow.base import DataFlow
  from ..input_source import FeedInput, InputSource, QueueInput, StagingInput
  from ..tfutils.tower import PredictTowerContext
  from ..utils import logger
  from ..utils.utils import get_tqdm_kwargs
  from .base import Callback
  from .group import Callbacks
  from .inference import Inferencer
label_desc: Use image node_id 2 for calling a global function with example usage: _inference_context() without return types