def can_use_cache(self, target: Target) -> bool:
        """Return True if should attempt to load `target` from cache.
           Return False if `target` has to be built, regardless of its cache
           status (because cache is disabled, or dependencies are dirty).
        """
        # if caching is disabled for this execution, then all targets are dirty
        if self.conf.no_build_cache:
            return False
        # if the target's `cachable` prop is falsy, then it is dirty
        if not target.props.cachable:
            return False
        # if any dependency of the target is dirty, then the target is dirty
        if any(self.targets[dep].is_dirty for dep in target.deps):
            return False
        # if the target has a dirty buildenv then it's also dirty
        if target.buildenv and self.targets[target.buildenv].is_dirty:
            return False
        return True
def can_use_cache ( self , target : Target ) -> bool : if self . conf . no_build_cache : return False if not target . props . cachable : return False if any ( self . targets [ dep ] . is_dirty for dep in target . deps ) : return False if target . buildenv and self . targets [ target . buildenv ] . is_dirty : return False return True
Return True if should attempt to load `target` from cache.
           Return False if `target` has to be built, regardless of its cache
           status (because cache is disabled, or dependencies are dirty).