code: def test_default_attributes():
      """Test the default attributes when no environment variables are set."""
      env = TorchElasticEnvironment()
      assert env.creates_processes_externally
      assert env.main_address == "127.0.0.1"
      assert env.main_port == 12910
      with pytest.raises(KeyError):
          # world size is required to be passed as env variable
          env.world_size()
      with pytest.raises(KeyError):
          # local rank is required to be passed as env variable
          env.local_rank()
      assert env.node_rank() == 0
  
file_path: pytorch-lightning/tests/tests_fabric/plugins/environments/test_torchelastic.py
imports: import logging
  import os
  import re
  from unittest import mock
  import pytest
  from lightning.fabric.plugins.environments import TorchElasticEnvironment
label_desc: Use image node_id 1 for calling a global function with example usage: test_default_attributes() without return types