class_docstr: Class containing unit tests for nltk.tgrep.
class_docstr_tok: ["Class","containing","unit","tests","for","nltk.tgrep","."]
docstr: Test defining and using tgrep2 macros.
docstr_tok: ["Test","defining","and","using","tgrep2","macros","."]
code: def test_use_macros(self):
      """
      Test defining and using tgrep2 macros.
      """
      tree = ParentedTree.fromstring(
          "(VP (VB sold) (NP (DET the) "
          "(NN heiress)) (NP (NN deed) (PREP to) "
          "(NP (DET the) (NN school) (NN house))))"
      )
      self.assertEqual(
          list(
              tgrep.tgrep_positions(
                  "@ NP /^NP/;\n@ NN /^NN/;\n@NP !< @NP !$.. @NN",
                  [tree],
              )
          ),
          [[(1,), (2, 2)]],
      )
      # use undefined macro @CNP
      self.assertRaises(
          tgrep.TgrepException,
          list,
          tgrep.tgrep_positions(
              "@ NP /^NP/;\n@ NN /^NN/;\n@CNP !< @NP !$.. @NN", [tree]
          ),
      )
  
imports: import unittest
  from nltk import tgrep
  from nltk.tree import ParentedTree
label_desc: Use image node_id 24 for calling the TestSequenceFunctions obj's underlying member method code with example usage: obj.test_use_macros() without return types