code: def environment_combinations():
      expected = {
          "global_rank": 3,
          "local_rank": 1,
          "node_rank": 1,
          "world_size": 4,
      }
      # Lightning
      variables = {
          "CUDA_VISIBLE_DEVICES": "0,1,2,4",
          "LOCAL_RANK": "1",
          "NODE_RANK": "1",
          "WORLD_SIZE": "8",
      }
      environment = LightningEnvironment()
      yield environment, variables, expected
      # SLURM
      variables = {
          "CUDA_VISIBLE_DEVICES": "0,1,2,4",
          "SLURM_JOB_NAME": "SOME_NAME",
          "SLURM_LOCALID": "1",
          "SLURM_NODEID": "1",
          "SLURM_PROCID": "3",
          "SLURM_NTASKS": "4",
          "SLURM_NTASKS_PER_NODE": "2",
      }
      environment = SLURMEnvironment()
      yield environment, variables, expected
      # TorchElastic
      variables = {
          "CUDA_VISIBLE_DEVICES": "0,1,2,4",
          "LOCAL_RANK": "1",
          "GROUP_RANK": "1",
          "RANK": "3",
          "WORLD_SIZE": "4",
          "LOCAL_WORLD_SIZE": "2",
          "TORCHELASTIC_RUN_ID": "1",
      }
      environment = TorchElasticEnvironment()
      yield environment, variables, expected
  
file_path: pytorch-lightning/tests/tests_pytorch/plugins/test_cluster_integration.py
imports: import os
  from unittest import mock
  import pytest
  import torch
  from lightning.fabric.plugins.environments import LightningEnvironment, SLURMEnvironment, TorchElasticEnvironment
  from lightning.pytorch import Trainer
  from lightning.pytorch.strategies import DDPStrategy, DeepSpeedStrategy
  from lightning.pytorch.utilities.rank_zero import rank_zero_only
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 1 for calling a global function with example usage: environment_combinations() without return types