code: def _get_horovod_rank_and_size():
      """Get rank and size from environment, return (rank, size), if failed, return (``None``, ``None``)"""
      rank_env = ["HOROVOD_RANK", "OMPI_COMM_WORLD_RANK", "PMI_RANK"]
      size_env = ["HOROVOD_SIZE", "OMPI_COMM_WORLD_SIZE", "PMI_SIZE"]
  
      for rank_var, size_var in zip(rank_env, size_env):
          rank = os.environ.get(rank_var)
          size = os.environ.get(size_var)
          if rank is not None and size is not None:
              return int(rank), int(size)
          elif rank is not None or size is not None:
              return None, None
  
      return None, None
  
imports: import atexit
  import datetime
  import logging
  import os
  import shutil
  import threading
  import time
  import uuid
  from distutils.version import LooseVersion
  from multiprocessing.pool import ThreadPool
  from typing import List, Any
  import pyspark
  from pyarrow import LocalFileSystem
  from pyspark.sql.session import SparkSession
  from pyspark.sql.types import ArrayType, DoubleType, FloatType
  from six.moves.urllib.parse import urlparse
  from petastorm import make_batch_reader
  from petastorm.fs_utils import FilesystemResolver, get_filesystem_and_path_or_paths, normalize_dir_url
  from fsspec.core import strip_protocol
label_desc: Use image node_id 6 for calling a global function with example usage: _get_horovod_rank_and_size() and returns: None,  None, int,  int, None,  None