class_docstr: Warps a NodeProviderV1 to a NodeProvider.
code: def _filter_instances(
      self,
      instances: Dict[str, Instance],
      instance_ids_filter: Set[str],
      instance_states_filter: Set[int],
  ) -> Dict[str, Instance]:
      filtered = {}
      for instance_id, instance in instances.items():
          if (
              instance_ids_filter
              and instance_id not in instance_ids_filter
          ):
              continue
          if (
              instance_states_filter
              and instance.state not in instance_states_filter
          ):
              continue
          filtered[instance_id] = instance
      return filtered
  
imports: import logging
  from abc import ABCMeta, abstractmethod
  from typing import Dict, List, Set
  from ray.autoscaler._private.node_launcher import BaseNodeLauncher
  from ray.autoscaler.node_provider import NodeProvider
  from ray.autoscaler.tags import TAG_RAY_USER_NODE_TYPE
  from ray.autoscaler.v2.instance_manager.config import AutoscalingConfig
  from ray.core.generated.instance_manager_pb2 import Instance
label_desc: Use image node_id 2 for calling the NodeProviderAdapter obj's underlying member method code with example usage: obj._filter_instances(instances, instance_ids_filter, instance_states_filter) and returns: filtered