code: def test_errors_grad_clipping():
      strategy = DeepSpeedStrategy()
      with pytest.raises(
          NotImplementedError,
          match=(
              "DeepSpeed handles gradient clipping automatically within the optimizer. "
              "Make sure to set the `gradient_clipping` value in your Config."
          ),
      ):
          strategy.clip_gradients_norm(
              Mock(), Mock(), Mock(), Mock(), Mock()
          )
  
      with pytest.raises(
          NotImplementedError,
          match=(
              "DeepSpeed handles gradient clipping automatically within the optimizer. "
              "Make sure to set the `gradient_clipping` value in your Config."
          ),
      ):
          strategy.clip_gradients_value(Mock(), Mock(), Mock())
  
imports: import json
  from re import escape
  from unittest import mock
  from unittest.mock import ANY, Mock
  import pytest
  import torch
  from lightning.fabric.accelerators import CPUAccelerator, CUDAAccelerator
  from lightning.fabric.strategies import DeepSpeedStrategy
  from torch.optim import Optimizer
  from tests_fabric.helpers.runif import RunIf
label_desc: Use image node_id 22 for calling a global function with example usage: test_errors_grad_clipping() without return types