code: def test_batching_node_provider_basic():
      tester = BatchingNodeProviderTester()
  
      tester.update(
          create_node_requests=[
              ("type-1", 5),
          ],
          terminate_nodes_requests=[],
          safe_to_scale_flag=True,
      )
      tester.assert_worker_counts({"type-1": 5})
      assert tester.node_provider._scale_request_submitted_count == 1
  
      tester.update(
          create_node_requests=[("type-2", 5), ("type-2", 5)],
          terminate_nodes_requests=[("type-1", 2)],
          safe_to_scale_flag=True,
      )
      tester.assert_worker_counts({"type-1": 3, "type-2": 10})
      assert tester.node_provider._scale_request_submitted_count == 2
  
      tester.update(
          create_node_requests=[],
          terminate_nodes_requests=[
              ("type-1", 2),
              ("type-2", 1),
              ("type-2", 1),
          ],
          safe_to_scale_flag=True,
      )
      tester.assert_worker_counts({"type-1": 1, "type-2": 8})
      assert tester.node_provider._scale_request_submitted_count == 3
  
      tester.update(
          create_node_requests=[],
          terminate_nodes_requests=[],
          safe_to_scale_flag=True,
      )
      tester.assert_worker_counts({"type-1": 1, "type-2": 8})
      # No scale request submitted, since there were no create/terminate calls.
      assert tester.node_provider._scale_request_submitted_count == 3
  
imports: from copy import copy
  from uuid import uuid4
  import os
  import random
  import sys
  from typing import Any, Dict
  from collections import defaultdict
  import pytest
  from ray.autoscaler.batching_node_provider import BatchingNodeProvider, NodeData, ScaleRequest
  from ray.autoscaler._private.util import NodeID, NodeType
  from ray.autoscaler.tags import STATUS_UP_TO_DATE, TAG_RAY_USER_NODE_TYPE, TAG_RAY_NODE_KIND, TAG_RAY_NODE_STATUS, NODE_KIND_HEAD, NODE_KIND_WORKER
  from ray.autoscaler._private.constants import DISABLE_LAUNCH_CONFIG_CHECK_KEY, DISABLE_NODE_UPDATERS_KEY, FOREGROUND_NODE_LAUNCH_KEY
label_desc: Use image node_id 1 for calling a global function with example usage: test_batching_node_provider_basic() without return types