docstr: Splits connected and non terminated nodes to pending & running.
docstr_tok: ["Splits","connected","and","non","terminated","nodes","to","pending","&","running","."]
code: def _separate_running_and_pending_nodes(
      self,
      non_terminated_nodes: List[NodeID],
      connected_nodes: List[NodeIP],
  ) -> (Dict[NodeType, int], Dict[NodeType, int]):
      """Splits connected and non terminated nodes to pending & running."""
  
      running_nodes = collections.defaultdict(int)
      pending_nodes = collections.defaultdict(int)
      for node_id in non_terminated_nodes:
          tags = self.provider.node_tags(node_id)
          if TAG_RAY_USER_NODE_TYPE in tags:
              node_type = tags[TAG_RAY_USER_NODE_TYPE]
              node_ip = self.provider.internal_ip(node_id)
              if node_ip in connected_nodes:
                  running_nodes[node_type] += 1
              else:
                  pending_nodes[node_type] += 1
      return running_nodes, pending_nodes
  
imports: import collections
  import copy
  import logging
  import os
  from abc import abstractmethod
  from functools import partial
  from typing import Callable, Dict, List, Optional, Tuple
  import ray
  from ray._private.gcs_utils import PlacementGroupTableData
  from ray.autoscaler._private.constants import AUTOSCALER_CONSERVE_GPU_NODES, AUTOSCALER_UTILIZATION_SCORER_KEY
  from ray.autoscaler._private.loader import load_function_or_class
  from ray.autoscaler._private.node_provider_availability_tracker import NodeAvailabilitySummary
  from ray.autoscaler._private.util import NodeID, NodeIP, NodeType, NodeTypeConfigDict, ResourceDict, is_placement_group_resource
  from ray.autoscaler.node_provider import NodeProvider
  from ray.autoscaler.tags import NODE_KIND_HEAD, NODE_KIND_UNMANAGED, NODE_KIND_WORKER, TAG_RAY_NODE_KIND, TAG_RAY_USER_NODE_TYPE
  from ray.core.generated.common_pb2 import PlacementStrategy
label_desc: Use image node_id 8 for calling the ResourceDemandScheduler obj's underlying member method code with example usage: obj._separate_running_and_pending_nodes(non_terminated_nodes, connected_nodes) and returns: running_nodes,  pending_nodes