code: def _verify_and_cache_hash(path, expected_hash):
      calculated_hash = util.file_sha256(path)
      if calculated_hash != expected_hash:
          raise HashMismatch(path, expected_hash, calculated_hash)
      _cache_sha256(calculated_hash, path)
  
imports: import logging
  import os
  import re
  import subprocess
  import sys
  from guild import util
label_desc: Use image node_id 9 for calling a global function with example usage: _verify_and_cache_hash(path, expected_hash) without return types