class_docstr: Tests for Scenic Optax utils.
class_docstr_tok: ["Tests","for","Scenic","Optax","utils","."]
docstr: Tests `make_mask_trees`.
docstr_tok: ["Tests","`","make_mask_trees","`","."]
code: def test_make_mask_trees(self, allow_unmatched):
      """Tests `make_mask_trees`."""
      tree = {"a": {"b": 1}, "c": 2}
      patterns = [
          ("a/.*", "A", 0.1),
          ("b/.*", "B", 0.3),
          ("c", "C", 0.3),
      ]
      masks = optax.make_mask_trees(
          tree, patterns, allow_unmatched=allow_unmatched
      )
      target_masks = [
          {"a": {"b": True}, "c": False},
          {"a": {"b": False}, "c": False},
          {"a": {"b": False}, "c": True},
      ]
      self.assertAllEqual(masks, target_masks)
  
imports: from typing import Optional
  from absl.testing import absltest
  from absl.testing import parameterized
  import ml_collections
  from scenic.train_lib import optax
  import tensorflow
label_desc: Use image node_id 1 for calling the OptaxTest obj's underlying member method code with example usage: obj.test_make_mask_trees(allow_unmatched) without return types