code: def _check_download_path(filename, download_dir, expected_hash):
      download_path = os.path.join(download_dir, filename)
      if not os.path.exists(download_path):
          return None
      log.info("Using cached file %s", download_path)
      if not expected_hash:
          return download_path
      cached_hash = util.try_cached_sha(download_path)
      if cached_hash and cached_hash == expected_hash:
          return download_path
      _verify_and_cache_hash(download_path, expected_hash)
      return download_path
  
imports: import logging
  import os
  import re
  import subprocess
  import sys
  from guild import util
label_desc: Use image node_id 8 for calling a global function with example usage: _check_download_path(filename, download_dir, expected_hash) and returns: download_path, None, download_path, download_path