class_docstr: Abstract subclass of NodeProvider meant for use with external cluster managers.
  
  Batches reads of cluster state into a single method, get_node_data, called at the
  start of an autoscaling update.
  
  Batches modifications to cluster state into a single method, submit_scale_request,
  called at the end of an autoscaling update.
  
  Implementing a concrete subclass of BatchingNodeProvider only requires overriding
  get_node_data() and submit_scale_request().
  
  See the method docstrings for more information.
  
  Note that an autoscaling update may be conditionally
  cancelled using the optional method safe_to_scale()
  of the root NodeProvider.
code: def non_terminated_nodes(
      self, tag_filters: Dict[str, str]
  ) -> List[str]:
      self.scale_change_needed = False
      self.node_data_dict = self.get_node_data()
  
      # Initialize ScaleRequest
      self.scale_request = ScaleRequest(
          desired_num_workers=self.cur_num_workers(),  # Current scale
          workers_to_delete=set(),  # No workers to delete yet
      )
      all_nodes = list(self.node_data_dict.keys())
      # Support filtering by TAG_RAY_NODE_KIND, TAG_RAY_NODE_STATUS, and
      # TAG_RAY_USER_NODE_TYPE.
      # The autoscaler only uses tag_filters={},
      # but filtering by the these keys is useful for testing.
      filtered_nodes = [
          node
          for node in all_nodes
          if tag_filters.items() <= self.node_tags(node).items()
      ]
      return filtered_nodes
  
imports: import logging
  from collections import defaultdict
  from dataclasses import dataclass, field
  from typing import Any, Dict, List, Optional, Set
  from ray.autoscaler._private.constants import DISABLE_LAUNCH_CONFIG_CHECK_KEY, DISABLE_NODE_UPDATERS_KEY, FOREGROUND_NODE_LAUNCH_KEY
  from ray.autoscaler._private.util import NodeID, NodeIP, NodeKind, NodeStatus, NodeType
  from ray.autoscaler.node_provider import NodeProvider
  from ray.autoscaler.tags import NODE_KIND_HEAD, TAG_RAY_NODE_KIND, TAG_RAY_NODE_STATUS, TAG_RAY_USER_NODE_TYPE
label_desc: Use image node_id 5 for calling the BatchingNodeProvider obj's underlying member method code with example usage: obj.non_terminated_nodes(tag_filters) and returns: filtered_nodes