docstr: Loads a key, returning a `Promise` for the value represented by that key.
docstr_tok: ["Loads","a","key",",","returning","a","`","Promise","`","for","the","value","represented","by","that","key","."]
code: def load(self, key=None):
      # type: (Hashable) -> Promise
      """
      Loads a key, returning a `Promise` for the value represented by that key.
      """
      if key is None:
          raise TypeError(
              (
                  "The loader.load() function must be called with a value,"
                  + "but got: {}."
              ).format(key)
          )
  
      cache_key = self.get_cache_key(key)
  
      # If caching and there is a cache-hit, return cached Promise.
      if self.cache:
          cached_promise = self._promise_cache.get(cache_key)
          if cached_promise:
              return cached_promise
  
      # Otherwise, produce a new Promise for this value.
  
      promise = Promise(partial(self.do_resolve_reject, key))  # type: ignore
  
      # If caching, cache this promise.
      if self.cache:
          self._promise_cache[cache_key] = promise
  
      return promise
  
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 2 for calling the DataLoader obj's underlying member method code with example usage: obj.load(key) and returns: promise, cached_promise