docstr: Adds the provied key and value to the cache. If the key already exists, no
  change is made. Returns itself for method chaining.
docstr_tok: ["Adds","the","provied","key","and","value","to","the","cache",".","If","the","key","already","exists",",","no","change","is","made",".","Returns","itself","for","method","chaining","."]
code: def prime(self, key, value):
      # type: (Hashable, Any) -> DataLoader
      """
      Adds the provied key and value to the cache. If the key already exists, no
      change is made. Returns itself for method chaining.
      """
      cache_key = self.get_cache_key(key)
  
      # Only add the key if it does not already exist.
      if cache_key not in self._promise_cache:
          # Cache a rejected promise if the value is an Error, in order to match
          # the behavior of load(key).
          if isinstance(value, Exception):
              promise = Promise.reject(value)
          else:
              promise = Promise.resolve(value)
  
          self._promise_cache[cache_key] = promise
  
      return self
  
file_path: wandb/wandb/vendor/promise-2.3.0/wandb_promise/dataloader.py
imports: from collections import namedtuple
  from functools import partial
  from threading import local
  from .promise import Promise, async_instance, get_default_scheduler
label_desc: Use image node_id 7 for calling the DataLoader obj's underlying member method code with example usage: obj.prime(key, value) and returns: self