code: def test_from_params(self):
      params = Params(
          {
              "regexes": [
                  ("conv", "l1"),
                  ("linear", {"type": "l2", "alpha": 10}),
              ]
          }
      )
      regularizer_applicator = RegularizerApplicator.from_params(params)
      regularizers = regularizer_applicator._regularizers
  
      conv = linear = None
      for regex, regularizer in regularizers:
          if regex == "conv":
              conv = regularizer
          elif regex == "linear":
              linear = regularizer
  
      assert isinstance(conv, L1Regularizer)
      assert isinstance(linear, L2Regularizer)
      assert linear.alpha == 10
  
file_path: allennlp/tests/nn/regularizers_test.py
imports: import re
  import torch
  from allennlp.common.params import Params
  from allennlp.nn import InitializerApplicator, Initializer
  from allennlp.nn.regularizers import L1Regularizer, L2Regularizer, RegularizerApplicator
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 4 for calling the TestRegularizers obj's underlying member method code with example usage: obj.test_from_params() without return types