code: def _get_stage_hash(stage):
      from .serialize import to_single_stage_lockfile
  
      assert _can_hash(stage)
      return _get_cache_hash(to_single_stage_lockfile(stage), key=True)
  
imports: import os
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, List, Optional, Tuple
  from funcy import first
  from dvc import fs
  from dvc.config import RemoteConfigError
  from dvc.exceptions import CollectCacheError, DvcException
  from dvc.log import logger
  from dvc.utils import dict_sha256, relpath
label_desc: Use image node_id 3 for calling a global function with example usage: _get_stage_hash(stage) and returns: _get_cache_hash