code: def test_lightning_module_configure_gradient_clipping_different_argument_values(
      tmpdir,
  ):
      """Test that setting gradient clipping arguments in `Trainer` and cusotmizing gradient clipping inside
      `configure_gradient_clipping` with different values raises an exception.
      """
  
      class TestModel(BoringModel):
          custom_gradient_clip_val = 1e-2
  
          def configure_gradient_clipping(
              self,
              optimizer,
              gradient_clip_val,
              gradient_clip_algorithm,
          ):
              self.clip_gradients(
                  optimizer,
                  gradient_clip_val=self.custom_gradient_clip_val,
              )
  
      model = TestModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          limit_train_batches=2,
          limit_val_batches=0,
          gradient_clip_val=1e-4,
      )
      with pytest.raises(
          MisconfigurationException,
          match=r"gradient_clip_val=0.0001\)` and have passed `clip_gradients\(gradient_clip_val=0.01",
      ):
          trainer.fit(model)
  
      class TestModel(BoringModel):
          custom_gradient_clip_algorithm = "foo"
  
          def configure_gradient_clipping(
              self,
              optimizer,
              gradient_clip_val,
              gradient_clip_algorithm,
          ):
              self.clip_gradients(
                  optimizer,
                  gradient_clip_algorithm=self.custom_gradient_clip_algorithm,
              )
  
      model = TestModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          max_epochs=1,
          limit_train_batches=2,
          limit_val_batches=0,
          gradient_clip_algorithm="norm",
      )
      with pytest.raises(
          MisconfigurationException,
          match=r"gradient_clip_algorithm='norm'\)` and have passed `clip_gradients\(gradient_clip_algorithm='foo'",
      ):
          trainer.fit(model)
  
imports: import sys
  import weakref
  from unittest.mock import Mock
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_1_13, _TORCH_GREATER_EQUAL_2_0
  from lightning.pytorch import LightningModule, Trainer
  from lightning.pytorch.core.module import _TrainerFabricShim
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.loggers import TensorBoardLogger
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch import nn
  from torch.optim import SGD, Adam
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 14 for calling a global function with example usage: test_lightning_module_configure_gradient_clipping_different_argument_values(tmpdir) without return types