class_docstr: Cache for model outputs.
docstr: Get the key for the predictions lock for the provided cache keys.
code: def pred_lock_key(
      self, keys: list[CacheKey]
  ) -> Optional[PredLockKey]:
      """Get the key for the predictions lock for the provided cache keys."""
      fs = self._construct_pred_lock_key(keys)
  
      # If the provided cache keys already have a lock, return the key.
      if fs in self._pred_locks:
          return fs
      # If there is a lock for a superset of the provided cache keys, return the
      # key to that lock.
      # This means that requests for subsets of data already being predicted will
      # wait for the larger set of predictions to complete. This can slow down
      # certain single-example requests but leads to more efficient use of the
      # model. We may have duplicate predict calls for an example to a model if
      # one example is part of separate but distinct predict calls with different
      # subsets of examples, but this is unlikely given how LIT predict requests
      # work.
      for key in self._pred_locks:
          if fs.issubset(key):
              return key
      # Otherwise, return None as there is no lock yet for the provided cache
      # keys.
      return None
  
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 7 for calling the PredsCache obj's underlying member method code with example usage: obj.pred_lock_key(keys) and returns: None, fs, key