code: def compute_md5(stage):
      from dvc.output import Output
      from dvc.utils import dict_md5
  
      d = stage.dumpd()
  
      # Remove md5 and meta, these should not affect stage md5
      d.pop(stage.PARAM_MD5, None)
      d.pop(stage.PARAM_META, None)
      d.pop(stage.PARAM_DESC, None)
  
      # Ignore the wdir default value. In this case DVC file w/o
      # wdir has the same md5 as a file with the default value specified.
      # It's important for backward compatibility with pipelines that
      # didn't have WDIR in their DVC files.
      if d.get(stage.PARAM_WDIR) == ".":
          del d[stage.PARAM_WDIR]
  
      return dict_md5(
          d,
          exclude=[
              *ANNOTATION_FIELDS,
              stage.PARAM_LOCKED,  # backward compatibility
              stage.PARAM_FROZEN,
              Output.PARAM_METRIC,
              Output.PARAM_PERSIST,
              Meta.PARAM_ISEXEC,
              Meta.PARAM_SIZE,
              Meta.PARAM_NFILES,
          ],
      )
  
imports: import os
  import pathlib
  from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Union
  from funcy import concat, first, lsplit, rpartial
  from dvc.annotations import ANNOTATION_FIELDS
  from dvc.exceptions import InvalidArgumentError
  from dvc_data.hashfile.meta import Meta
  from .exceptions import MissingDataSource, StageExternalOutputsError, StagePathNotDirectoryError, StagePathNotFoundError, StagePathOutsideError
label_desc: Use image node_id 8 for calling a global function with example usage: compute_md5(stage) and returns: dict_md5