code: def command_exists_on_localhost(command: str) -> bool:
      """Check if a command exists on localhost."""
      cmd_ext = (
          "hash " + command + ' 2>/dev/null && echo "True" || echo ""'
      )
      return True if os.popen(cmd_ext).read() else False
  
imports: import os
  import platform
  import socket
  import subprocess
  import sys
  from typing import Dict, List, Union
  import lazycluster.settings
  from .utils import Environment
label_desc: Use image node_id 5 for calling a global function with example usage: command_exists_on_localhost(command) and returns: unknown