code: def test_main_lightning_cli_help():
      """Validate the Lightning CLI."""
      res = os.popen("lightning --help").read()
      assert "login   " in res
      assert "logout  " in res
      assert "run     " in res
      assert "list    " in res
      assert "delete  " in res
      assert "show    " in res
  
      res = os.popen("lightning run --help").read()
      assert "app  " in res
  
      # hidden run commands should not appear in the help text
      assert "server" not in res
      assert "flow" not in res
      assert "work" not in res
      assert "frontend" not in res
  
      # inspect show group
      res = os.popen("lightning show --help").read()
      assert "logs " in res
  
file_path: pytorch-lightning/tests/tests_app/cli/test_cli.py
imports: import os
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from click.testing import CliRunner
  from lightning.app import __version__
  from lightning.app.cli.lightning_cli import _main, login, logout, run
  from lightning.app.cli.lightning_cli_delete import delete
  from lightning.app.cli.lightning_cli_list import get_list, list_apps
  from lightning.app.utilities.exceptions import _ApiExceptionHandler
label_desc: Use image node_id 3 for calling a global function with example usage: test_main_lightning_cli_help() without return types