code: def _filter_outs(
      outs: Outputs, fs_paths: StrPaths, duplicates=False
  ) -> Tuple[Outputs, StrPaths]:
      res_outs: Outputs = []
      fs_res_paths = fs_paths
  
      for out in outs:
          fs_path = out.repo.dvcfs.from_os_path(out.fs_path)
          if fs_path in fs_paths:
              res_outs.append(out)
              if not duplicates:
                  # MUTATING THE SAME LIST!!
                  fs_res_paths.remove(fs_path)
  
      return res_outs, fs_res_paths
  
imports: from typing import TYPE_CHECKING, Callable, Iterable, List, Optional, Tuple
  from dvc.log import logger
label_desc: Use image node_id 3 for calling a global function with example usage: _filter_outs(outs, fs_paths, duplicates) and returns: res_outs,  fs_res_paths