<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def AreHostsReachable(hostnames, ssh_key):
 """ Returns list of bools indicating if host reachable via ssh. """

  # validate input
  for hostname in hostnames:
    assert(len(hostname))
  ssh_ok = [exit_code == 0 for (exit_code, _) in
            RunCommandOnHosts('echo test > /dev/null', hostnames, ssh_key)]
  return ssh_ok