code: def _can_hash(stage):
      if stage.is_callback or stage.always_changed:
          return False
  
      if not all([stage.cmd, stage.deps, stage.outs]):
          return False
  
      for dep in stage.deps:
          if not (
              dep.protocol == "local"
              and dep.def_path
              and dep.get_hash()
          ):
              return False
  
      for out in stage.outs:
          if (
              out.protocol != "local"
              or not out.def_path
              or out.persist
              or not out.is_in_repo
          ):
              return False
  
      return 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 2 for calling a global function with example usage: _can_hash(stage) and returns: True, False, False, False, False