<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nonterminal(n):
 """ Create a PEG function to match a nonterminal. """

    def match_nonterminal(s, grm=None, pos=0):
        if grm is None: grm = {}
        expr = grm[n]
        return expr(s, grm, pos)
    return match_nonterminal