code: def cache_scan(self):
          
          try:
              return len(self.transformations) - self.transformations[::-1].index(CACHE_T)
          except ValueError:
              return 0
docs: Scan the lineage for the index of the most recent cache.
          :return: Index of most recent cache