code: def get_rank_info(texts: list, rank_key: str) -> int:
      for line in texts:
          if rank_key in line:
              rank_value = line.split(":")[-1]
              rank_value = int(rank_value)
              return rank_value
  
      print("Could not find the correct rank key !")
      exit(1)
  
imports: import os
  import shutil
  import torch
  from omegaconf import OmegaConf
  from pytorch_lightning import Trainer
  from pytorch_lightning.utilities import rank_zero_only
  from nemo.core import ModelPT
  from nemo.utils import logging
  from nemo.utils.exp_manager import ExpManagerConfig, exp_manager
label_desc: Use image node_id 3 for calling a global function with example usage: get_rank_info(texts, rank_key) and returns: rank_value