code: def _get_node_id_from_node_ip(node_ip: str) -> Optional[str]:
      """Returns the node ID for the first alive node with the input IP."""
      for node in ray.nodes():
          if node["Alive"] and node["NodeManagerAddress"] == node_ip:
              return node["NodeID"]
  
      return None
  
imports: from typing import Dict, Optional, Union
  import ray
label_desc: Use image node_id 1 for calling a global function with example usage: _get_node_id_from_node_ip(node_ip) and returns: None, node