class_docstr: Wrapper to add per-example caching to a LIT model.
code: def _validate_ids(self, inputs: Iterable[JsonDict]):
      for ex in inputs:
          if not (given_id := ex.get("_id")):
              continue
          if (
              computed_id := self._id_hash_fn(types.Input(ex))
          ) != given_id:
              raise ValueError(
                  f"Given id '{given_id}' does not match computed id '{computed_id}'"
                  f" for example {str(ex)}."
              )
  
imports: from collections.abc import Callable, Iterable
  import os
  import pickle
  import threading
  from typing import Any, Optional, Union
  from absl import logging
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import serialize
label_desc: Use image node_id 5 for calling the CachingModelWrapper obj's underlying member method code with example usage: obj._validate_ids(inputs) without return types