code: def test_fsdp_precision_optimizer_step_with_scaler():
      precision = FSDPPrecision(precision="16-mixed")
      precision.scaler = Mock()
      model = Mock(trainer=Mock(callbacks=[], profiler=MagicMock()))
      optimizer = Mock()
      closure = Mock()
  
      precision.optimizer_step(optimizer, model, closure, keyword="arg")
      precision.scaler.step.assert_called_once_with(
          optimizer, keyword="arg"
      )
      precision.scaler.update.assert_called_once()
  
file_path: pytorch-lightning/tests/tests_pytorch/plugins/precision/test_fsdp.py
imports: from unittest.mock import ANY, MagicMock, Mock
  import pytest
  import torch
  from lightning.fabric.plugins.precision.utils import _DtypeContextManager
  from lightning.pytorch.plugins.precision.fsdp import FSDPPrecision
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 6 for calling a global function with example usage: test_fsdp_precision_optimizer_step_with_scaler() without return types