code: def _get_pem(config: Any) -> Any:
      key_name = config["auth"].get("ssh_private_key")
      if key_name is not None:
          return key_name
      key_name = config["provider"].get("key_pair", {}).get("key_name")
      if key_name:
          return os.path.expanduser(
              os.path.expanduser(f"~/.ssh/{key_name}.pem")
          )
      region = config["provider"]["region"]
      key_pair_name = f"ray-autoscaler_{region}"
      return os.path.expanduser(f"~/.ssh/{key_pair_name}.pem")
  
file_path: hydra/plugins/hydra_ray_launcher/hydra_plugins/hydra_ray_launcher/_launcher_util.py
imports: import logging
  import os
  from contextlib import contextmanager
  from subprocess import PIPE, Popen
  from typing import Any, Dict, Generator, List, Tuple
  import ray
  from hydra.core.hydra_config import HydraConfig
  from hydra.core.singleton import Singleton
  from hydra.core.utils import JobReturn, run_job, setup_globals
  from hydra.types import HydraContext, TaskFunction
  from omegaconf import DictConfig, OmegaConf
label_desc: Use image node_id 6 for calling a global function with example usage: _get_pem(config) and returns: os, key_name, os