code: def previous_key(self, cache_key):
      
      if not self.cacheable(cache_key):
        # We should never successfully cache an uncacheable CacheKey.
        return None
  
      previous_hash = self._read_sha(cache_key)
      if not previous_hash:
        return None
      return CacheKey(cache_key.id, previous_hash)
docs: If there was a previous successful build for the given key, return the previous key.
  
      :param cache_key: A CacheKey object (as returned by CacheKeyGenerator.key_for().
      :returns: The previous cache_key, or None if there was not a previous build.