code: def test_applies_activation_with_dropout(
      self, use_dropout, is_training
  ):
      activation = CountingActivation()
      mod = mlp.MLP(
          [1, 1, 1],
          dropout_rate=(0.5 if use_dropout else None),
          activation=activation,
      )
      mod(
          tf.ones([1, 1]),
          is_training=(is_training if use_dropout else None),
      )
      self.assertEqual(activation.count, 2)
  
imports: import itertools
  from absl.testing import parameterized
  from sonnet.src import test_utils
  from sonnet.src.nets import mlp
  import tensorflow
label_desc: Use image node_id 21 for calling the MLPTest obj's underlying member method code with example usage: obj.test_applies_activation_with_dropout(use_dropout, is_training) without return types