class_docstr: An environment for running on clusters managed by the LSF resource manager.
  
  It is expected that any execution using this ClusterEnvironment was executed
  using the Job Step Manager i.e. ``jsrun``.
  
  This plugin expects the following environment variables:
  
  ``LSB_JOBID``
    The LSF assigned job ID
  
  ``LSB_DJOB_RANKFILE``
    The OpenMPI compatible rank file for the LSF job
  
  ``JSM_NAMESPACE_LOCAL_RANK``
    The node local rank for the task. This environment variable is set by ``jsrun``
  
  ``JSM_NAMESPACE_SIZE``
    The world size for the task. This environment variable is set by ``jsrun``
  
  ``JSM_NAMESPACE_RANK``
    The global rank for the task. This environment variable is set by ``jsrun``
docstr: Read compute hosts that are a part of the compute job.
  
  LSF uses the Job Step Manager (JSM) to manage job steps. Job steps are executed by the JSM from "launch" nodes.
  Each job is assigned a launch node. This launch node will be the first node in the list contained in
  ``LSB_DJOB_RANKFILE``.
docstr_tok: ["Read","compute","hosts","that","are","a","part","of","the","compute","job",".","LSF","uses","the","Job","Step","Manager","(","JSM",")","to","manage","job","steps",".","Job","steps","are","executed","by","the","JSM","from","``","launch","''","nodes",".","Each","job","is","assigned","a","launch","node",".","This","launch","node","will","be","the","first","node","in","the","list","contained","in","``","LSB_DJOB_RANKFILE","``","."]
code: def _read_hosts() -> List[str]:
      """Read compute hosts that are a part of the compute job.
  
      LSF uses the Job Step Manager (JSM) to manage job steps. Job steps are executed by the JSM from "launch" nodes.
      Each job is assigned a launch node. This launch node will be the first node in the list contained in
      ``LSB_DJOB_RANKFILE``.
  
      """
      var = "LSB_DJOB_RANKFILE"
      rankfile = os.environ.get(var)
      if rankfile is None:
          raise ValueError(
              "Did not find the environment variable `LSB_DJOB_RANKFILE`"
          )
      if not rankfile:
          raise ValueError(
              "The environment variable `LSB_DJOB_RANKFILE` is empty"
          )
  
      fs = get_filesystem(rankfile)
      with fs.open(rankfile, "r") as f:
          ret = [line.strip() for line in f]
      # remove the launch node (i.e. the first node in LSB_DJOB_RANKFILE) from the list
      return ret[1:]
  
imports: import logging
  import os
  import socket
  from typing import Dict, List
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.utilities.cloud_io import get_filesystem
label_desc: Use image node_id 14 for calling the LSFEnvironment obj's underlying member method code with example usage: obj._read_hosts() and returns: ret