code: def get_nodes_info(
      self,
      nodes: List[str] = None,
      role: NodeRole = None,
      env: bool = False,
      resource: bool = False,
      detail: bool = False,
      statuses: Set[NodeStatus] = None,
  ):
      statuses = statuses or {NodeStatus.READY}
      if nodes is None:
          nodes = (
              self._role_to_nodes.get(role)
              if role is not None
              else self._node_infos.keys()
          )
          nodes = nodes or []
      ret_infos = dict()
      for node in nodes:
          if node not in self._node_infos:
              continue
          info = self._node_infos[node]
          if info.status not in statuses:
              continue
  
          ret_infos[node] = dict(
              status=info.status,
              update_time=info.update_time,
              env=info.env if env else None,
              resource=info.resource if resource else None,
              detail=info.detail if detail else None,
          )
      return ret_infos
  
file_path: mars/mars/services/cluster/supervisor/node_info.py
imports: import time
  from collections import defaultdict
  from typing import Dict, List, Optional, Set
  from ....None import oscar
  from ....resource import Resource
  from ....typing import BandType
  from ...core import NodeRole
  from ..core import NodeInfo, WatchNotifier, NodeStatus
label_desc: Use image node_id 2 for calling the NodeInfoCollectorActor obj's underlying member method code with example usage: obj.get_nodes_info(nodes, role, env, resource, detail, statuses) and returns: ret_infos