class_docstr: Launches Ray nodes in the main thread using
  `BaseNodeLauncher.launch_node()`.
  
  This is a superclass of NodeLauncher, which launches nodes asynchronously
  in the background.
  
  By default, the subclass NodeLauncher is used to launch nodes in subthreads.
  That behavior can be flagged off in the provider config by setting
  `foreground_node_launch: True`; the autoscaler will then makes blocking calls to
  BaseNodeLauncher.launch_node() in the main thread.
class_docstr_tok: ["Launches","Ray","nodes","in","the","main","thread","using","`","BaseNodeLauncher.launch_node","(",")","`",".","This","is","a","superclass","of","NodeLauncher",",","which","launches","nodes","asynchronously","in","the","background",".","By","default",",","the","subclass","NodeLauncher","is","used","to","launch","nodes","in","subthreads",".","That","behavior","can","be","flagged","off","in","the","provider","config","by","setting","`","foreground_node_launch",":","True","`",";","the","autoscaler","will","then","makes","blocking","calls","to","BaseNodeLauncher.launch_node","(",")","in","the","main","thread","."]
code: def launch_node(
      self, config: Dict[str, Any], count: int, node_type: str
  ) -> Optional[Dict]:
      self.log("Got {} nodes to launch.".format(count))
      created_nodes = self._launch_node(config, count, node_type)
      self.pending.dec(node_type, count)
      return created_nodes
  
imports: import copy
  import logging
  import operator
  import threading
  import time
  import traceback
  from typing import Any, Dict, Optional
  from ray.autoscaler._private.node_provider_availability_tracker import NodeProviderAvailabilityTracker
  from ray.autoscaler._private.prom_metrics import AutoscalerPrometheusMetrics
  from ray.autoscaler._private.util import hash_launch_conf
  from ray.autoscaler.node_launch_exception import NodeLaunchException
  from ray.autoscaler.tags import NODE_KIND_WORKER, STATUS_UNINITIALIZED, TAG_RAY_LAUNCH_CONFIG, TAG_RAY_NODE_KIND, TAG_RAY_NODE_NAME, TAG_RAY_NODE_STATUS, TAG_RAY_USER_NODE_TYPE
label_desc: Use image node_id 2 for calling the BaseNodeLauncher obj's underlying member method code with example usage: obj.launch_node(config, count, node_type) and returns: created_nodes