class_docstr: Tests for Scenic Optax utils.
class_docstr_tok: ["Tests","for","Scenic","Optax","utils","."]
docstr: Tests `_make_mask_trees` with values only.
docstr_tok: ["Tests","`","_make_mask_trees","`","with","values","only","."]
code: def test__make_mask_trees_with_values_only(self, allow_unmatched):
      """Tests `_make_mask_trees` with values only."""
      tree = {"a": {"b": 1}, "c": 2}
      patterns_names_values = [("a/.*", 1), ("b/.*", 2), ("c", 3)]
      # pylint: disable=protected-access
      masks, names_values = optax._make_mask_trees(
          tree, patterns_names_values, allow_unmatched=allow_unmatched
      )
      # pylint: enable=protected-access
      target_masks = [
          {"a": {"b": True}, "c": False},
          {"a": {"b": False}, "c": False},
          {"a": {"b": False}, "c": True},
      ]
      target_names_values = [(None, 1), (None, 2), (None, 3)]
      self.assertAllEqual(masks, target_masks)
      self.assertAllEqual(names_values, target_names_values)
  
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 4 for calling the OptaxTest obj's underlying member method code with example usage: obj.test__make_mask_trees_with_values_only(allow_unmatched) without return types