code: def _node_type_counts_to_node_resources(
      node_types: Dict[NodeType, NodeTypeConfigDict],
      node_type_counts: Dict[NodeType, int],
  ) -> List[ResourceDict]:
      """Converts a node_type_counts dict into a list of node_resources."""
      resources = []
      for node_type, count in node_type_counts.items():
          # Be careful, each entry in the list must be deep copied!
          resources += [
              node_types[node_type]["resources"].copy()
              for _ in range(count)
          ]
      return resources
  
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 1 for calling a global function with example usage: _node_type_counts_to_node_resources(node_types, node_type_counts) and returns: resources