class_docstr: Cache for model outputs.
docstr: Gets the lock for the provided cache keys, creating one if neccessary.
code: def get_pred_lock(self, keys: list[CacheKey]) -> threading.RLock:
      """Gets the lock for the provided cache keys, creating one if neccessary."""
      # If the lock already exists for the provided keys, return it.
      pl_key = self.pred_lock_key(keys)
      if pl_key:
          return self._pred_locks[pl_key]
      # If no such lock exists, create, store and return it.
      pred_lock = threading.RLock()
      self._pred_locks[self._construct_pred_lock_key(keys)] = pred_lock
      return pred_lock
  
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 8 for calling the PredsCache obj's underlying member method code with example usage: obj.get_pred_lock(keys) and returns: pred_lock, self