code: def test_regularizer_applicator_respects_regex_matching(self):
      model = torch.nn.Sequential(
          torch.nn.Linear(5, 10), torch.nn.Linear(10, 5)
      )
      initializer = InitializerApplicator(
          [(".*", lambda tensor: constant_(tensor, 1.0))]
      )
      initializer(model)
      value = RegularizerApplicator(
          [("weight", L2Regularizer(0.5)), ("bias", L1Regularizer(1.0))]
      )(model)
      assert value.data.numpy() == 65.0
  
file_path: magnitude/pymagnitude/third_party/allennlp/tests/nn/regularizers_test.py
imports: from __future__ import absolute_import
  import torch
  from torch.nn.init import constant_
  from allennlp.common.params import Params
  from allennlp.nn import InitializerApplicator
  from allennlp.nn.regularizers import L1Regularizer, L2Regularizer, RegularizerApplicator
  from allennlp.common.testing import AllenNlpTestCase
label_desc: Use image node_id 3 for calling the TestRegularizers obj's underlying member method code with example usage: obj.test_regularizer_applicator_respects_regex_matching() without return types