class_docstr: The default environment used by Lightning for a single node or free cluster (not managed).
  
  There are two modes the Lightning environment can operate with:
  
  1.  The user only launches the main process by :code:`python train.py ...` with no additional environment variables
      set. Lightning will spawn new worker processes for distributed training in the current node.
  2.  The user launches all processes manually or with utilities like :code:`torch.distributed.launch`.
      The appropriate environment variables need to be set, and at minimum :code:`LOCAL_RANK`.
  
  If the main address and port are not provided, the default environment will choose them
  automatically. It is recommended to use this default environment for single-node distributed
  training as it provides a convenient way to launch the training script.
class_docstr_tok: ["The","default","environment","used","by","Lightning","for","a","single","node","or","free","cluster","(","not","managed",")",".","There","are","two","modes","the","Lightning","environment","can","operate","with",":","1",".","The","user","only","launches","the","main","process","by",":","code",":","`","python","train.py","...","`","with","no","additional","environment","variables","set",".","Lightning","will","spawn","new","worker","processes","for","distributed","training","in","the","current","node",".","2",".","The","user","launches","all","processes","manually","or","with","utilities","like",":","code",":","`","torch.distributed.launch","`",".","The","appropriate","environment","variables","need","to","be","set",",","and","at","minimum",":","code",":","`","LOCAL_RANK","`",".","If","the","main","address","and","port","are","not","provided",",","the","default","environment","will","choose","them","automatically",".","It","is","recommended","to","use","this","default","environment","for","single-node","distributed","training","as","it","provides","a","convenient","way","to","launch","the","training","script","."]
code: def node_rank(self) -> int:
      group_rank = os.environ.get("GROUP_RANK", 0)
      return int(os.environ.get("NODE_RANK", group_rank))
  
imports: import os
  import socket
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.utilities.rank_zero import rank_zero_only
label_desc: Use image node_id 11 for calling the LightningEnvironment obj's underlying member method code with example usage: obj.node_rank() and returns: int