code: def _is_match(tagged_phrase, cfg):
      """Return whether or not a tagged phrases matches a context-free grammar."""
      copy = list(tagged_phrase)  # A copy of the list
      merge = True
      while merge:
          merge = False
          for i in range(len(copy) - 1):
              first, second = copy[i], copy[i + 1]
              key = (
                  first[1],
                  second[1],
              )  # Tuple of tags e.g. ('NN', 'JJ')
              value = cfg.get(key, None)
              if value:
                  merge = True
                  copy.pop(i)
                  copy.pop(i)
                  match = "{0} {1}".format(first[0], second[0])
                  pos = value
                  copy.insert(i, (match, pos))
                  break
      match = any([t[1] in ("NNP", "NNI") for t in copy])
      return match
  
imports: from __future__ import unicode_literals, absolute_import
  import nltk
  from textblob.taggers import PatternTagger
  from textblob.decorators import requires_nltk_corpus
  from textblob.utils import tree2str, filter_insignificant
  from textblob.base import BaseNPExtractor
label_desc: Use image node_id 2 for calling a global function with example usage: _is_match(tagged_phrase, cfg) and returns: match