code: def test_manual_user_launch(environ, creates_processes_externally):
      """Test that the environment switches to manual user mode when LOCAL_RANK env variable detected."""
      with mock.patch.dict(os.environ, environ):
          env = LightningEnvironment()
          assert (
              env.creates_processes_externally
              == creates_processes_externally
          )
  
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 3 for calling a global function with example usage: test_manual_user_launch(environ, creates_processes_externally) without return types