code: def _build_out_changes(index, changes):
      from dvc_data.index.checkout import MODIFY
  
      out_keys = []
      for out in index.outs:
          if not out.use_cache:
              continue
  
          ws, key = out.index_key
          if ws != "repo":
              continue
  
          out_keys.append(key)
  
      out_changes = {}
      for key, change in changes.items():
          for out_key in out_keys:
              if (
                  len(out_key) > len(key)
                  or key[: len(out_key)] != out_key
              ):
                  continue
  
              if key == out_key:
                  out_changes[out_key] = change.typ
              elif not out_changes.get(out_key):
                  out_changes[out_key] = MODIFY
              break
  
      return out_changes
  
file_path: dvc/dvc/repo/checkout.py
imports: import os
  from typing import TYPE_CHECKING, Dict, List
  from dvc.exceptions import CheckoutError, CheckoutErrorSuggestGit, DvcException, NoOutputOrStageError
  from dvc.log import logger
  from dvc.ui import ui
  from dvc.utils import relpath
  from .None import locked
label_desc: Use image node_id 3 for calling a global function with example usage: _build_out_changes(index, changes) and returns: out_changes