code: def _self_test():
      """Run self-test.
      This method is called if the module is run as a standalone script.
      """
  
      def assert_approx_equal(list1, list2):
          """Checks that the two dropout proportions lists are equal."""
          assert len(list1) == len(list2)
          for i in range(0, len(list1)):
              assert len(list1[i]) == 2
              assert len(list2[i]) == 2
              assert list1[i][0] == list2[i][0]
              assert abs(list1[i][1] - list2[i][1]) < 1e-8
  
      assert _parse_dropout_option(
          "*=0.0,0.5,0.0 lstm.*=0.0,0.3@0.75,0.0"
      ) == [
          ("*", [(1.0, 0.0), (0.5, 0.5), (0.0, 0.0)]),
          ("lstm.*", [(1.0, 0.0), (0.75, 0.3), (0.0, 0.0)]),
      ]
      assert_approx_equal(
          _get_dropout_proportions(
              "*=0.0,0.5,0.0 lstm.*=0.0,0.3@0.75,0.0", 0.75
          ),
          [("*", 0.25), ("lstm.*", 0.3)],
      )
      assert_approx_equal(
          _get_dropout_proportions(
              "*=0.0,0.5,0.0 lstm.*=0.0,0.3@0.75,0.0", 0.5
          ),
          [("*", 0.5), ("lstm.*", 0.2)],
      )
      assert_approx_equal(
          _get_dropout_proportions(
              "*=0.0,0.5,0.0 lstm.*=0.0,0.3@0.75,0.0", 0.25
          ),
          [("*", 0.25), ("lstm.*", 0.1)],
      )
  
      assert _parse_dropout_option("0.0,0.3,0.0") == [
          ("*", [(1.0, 0.0), (0.5, 0.3), (0.0, 0.0)])
      ]
      assert_approx_equal(
          _get_dropout_proportions("0.0,0.3,0.0", 0.5), [("*", 0.3)]
      )
      assert_approx_equal(
          _get_dropout_proportions("0.0,0.3,0.0", 0.0), [("*", 0.0)]
      )
      assert_approx_equal(
          _get_dropout_proportions("0.0,0.3,0.0", 1.0), [("*", 0.0)]
      )
      assert_approx_equal(
          _get_dropout_proportions("0.0,0.3,0.0", 0.25), [("*", 0.15)]
      )
  
      assert _parse_dropout_option("0.0,0.5@0.25,0.0,0.6@0.75,0.0") == [
          (
              "*",
              [
                  (1.0, 0.0),
                  (0.75, 0.6),
                  (0.5, 0.0),
                  (0.25, 0.5),
                  (0.0, 0.0),
              ],
          )
      ]
      assert_approx_equal(
          _get_dropout_proportions(
              "0.0,0.5@0.25,0.0,0.6@0.75,0.0", 0.25
          ),
          [("*", 0.5)],
      )
      assert_approx_equal(
          _get_dropout_proportions(
              "0.0,0.5@0.25,0.0,0.6@0.75,0.0", 0.1
          ),
          [("*", 0.2)],
      )
  
      assert _parse_dropout_option("lstm.*=0.0,0.3,0.0@0.75,1.0") == [
          ("lstm.*", [(1.0, 1.0), (0.75, 0.0), (0.5, 0.3), (0.0, 0.0)])
      ]
      assert_approx_equal(
          _get_dropout_proportions("lstm.*=0.0,0.3,0.0@0.75,1.0", 0.25),
          [("lstm.*", 0.15)],
      )
      assert_approx_equal(
          _get_dropout_proportions("lstm.*=0.0,0.3,0.0@0.75,1.0", 0.5),
          [("lstm.*", 0.3)],
      )
      assert_approx_equal(
          _get_dropout_proportions("lstm.*=0.0,0.3,0.0@0.75,1.0", 0.9),
          [("lstm.*", 0.6)],
      )
  
file_path: espnet/egs2/grabo/asr1/steps/libs/nnet3/train/dropout_schedule.py
imports: import logging
label_desc: Use image node_id 7 for calling a global function with example usage: _self_test() without return types