code: def cache(self, name, val, overwrite=True):
          
          if name in TaskCache.cached and not overwrite:
              raise CacheError('Object with name `%s` already in cache.' % name)
          TaskCache.cached[name] = val
docs: Assigns an attribute reference to all subsequent tasks. For example, if a task caches a
          DataFrame `df` using `self.cache('some_df', df)`, all tasks that follow can access the
          DataFrame using `self.some_df`. Note that manually assigned attributes that share the same
          name have precedence over cached attributes.
  
          Parameters
          ----------
          name : str
              Name of the attribute
          val
              Attribute value
          overwrite : bool
              Indicates if the attribute shall be overwritten, or not (if `False`, and
              a cached attribute with the given name already exists, `sparklanes.errors.CacheError`
              will be thrown).