code: def parse_out_keys_arg(
      out_feat_keys: List[str], all_feat_names: List[str]
  ) -> Tuple[List[str], int]:
      """
      Checks if all out_feature_keys are mapped to a layer in the model.
      Returns the last layer to forward pass through for efficiency.
      Allow duplicate features also to be evaluated.
      Adapted from (https://github.com/gidariss/FeatureLearningRotNet).
      """
  
      # By default return the features of the last layer / module.
      if out_feat_keys is None or (len(out_feat_keys) == 0):
          out_feat_keys = [all_feat_names[-1]]
  
      if len(out_feat_keys) == 0:
          raise ValueError("Empty list of output feature keys.")
      for _, key in enumerate(out_feat_keys):
          if key not in all_feat_names:
              raise ValueError(
                  f"Feature with name {key} does not exist. "
                  f"Existing features: {all_feat_names}."
              )
  
      # Find the highest output feature in `out_feat_keys
      max_out_feat = max(
          all_feat_names.index(key) for key in out_feat_keys
      )
  
      return out_feat_keys, max_out_feat
  
imports: import logging
  import math
  import warnings
  from enum import Enum
  from typing import Dict, List, Tuple
  import torch
  import torch.distributed
  import torch.nn
  import torch.nn.functional
  from torch.nn.modules.utils import _ntuple
  from torch.utils.checkpoint import checkpoint
  from vissl.data.collators.collator_helper import MultiDimensionalTensor
  from vissl.utils.activation_checkpointing import checkpoint_trunk
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.misc import is_apex_available
label_desc: Use image node_id 9 for calling a global function with example usage: parse_out_keys_arg(out_feat_keys, all_feat_names) and returns: out_feat_keys,  max_out_feat