code: def _get_cache_hash(cache, key=False):
      from dvc_data.hashfile.meta import Meta
  
      if key:
          cache["outs"] = [out["path"] for out in cache.get("outs", [])]
      return dict_sha256(
          cache, exclude=[Meta.PARAM_SIZE, Meta.PARAM_NFILES]
      )
  
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 1 for calling a global function with example usage: _get_cache_hash(cache, key) and returns: dict_sha256