code: def get_worker_nodegroup(
      ami_map: dict, nodegroup_config: dict, cluster_config: dict
  ) -> dict:
      """
      Converts Cortex-dict nodegroup config to EKS-dict format.
      """
      worker_nodegroup = default_nodegroup(cluster_config)
      worker_nodegroup["ami"] = get_ami(
          ami_map, nodegroup_config["instance_type"]
      )
  
      apply_worker_settings(worker_nodegroup, nodegroup_config)
      apply_clusterconfig(worker_nodegroup, nodegroup_config)
  
      if nodegroup_config["spot"]:
          apply_spot_settings(worker_nodegroup, nodegroup_config)
  
      if is_gpu(nodegroup_config["instance_type"]):
          apply_gpu_settings(worker_nodegroup)
  
      if is_inf(nodegroup_config["instance_type"]):
          apply_inf_settings(worker_nodegroup, nodegroup_config)
  
      return worker_nodegroup
  
imports: import json
  import click
  from collections import namedtuple
  import re
  import yaml
label_desc: Use image node_id 14 for calling a global function with example usage: get_worker_nodegroup(ami_map, nodegroup_config, cluster_config) and returns: worker_nodegroup