code: def test_attributes_from_environment_variables():
      """Test that the default cluster environment takes the attributes from the environment variables."""
      env = LightningEnvironment()
      assert env.main_address == "1.2.3.4"
      assert env.main_port == 500
      assert env.world_size() == 1
      assert env.global_rank() == 0
      assert env.local_rank() == 2
      assert env.node_rank() == 3
      env.set_global_rank(100)
      assert env.global_rank() == 100
      env.set_world_size(100)
      assert env.world_size() == 100
  
file_path: pytorch-lightning/tests/tests_fabric/plugins/environments/test_lightning.py
imports: import os
  from unittest import mock
  import pytest
  from lightning.fabric.plugins.environments import LightningEnvironment
label_desc: Use image node_id 2 for calling a global function with example usage: test_attributes_from_environment_variables() without return types