code: def test_weight_decay_validation(optimizer_class):
      weight_decay = -0.1
      with pytest.raises(ValueError) as ctx:
          optimizer_class(None, lr=0.1, weight_decay=weight_decay)
      msg = "Invalid weight_decay value: {}".format(weight_decay)
      assert msg in str(ctx.value)
  
file_path: pytorch-optimizer/tests/test_param_validation.py
imports: import pytest
  import torch
  import torch_optimizer
label_desc: Use image node_id 5 for calling a global function with example usage: test_weight_decay_validation(optimizer_class) without return types