def nestedExpr(opener="<STR_LIT:(>", closer="<STR_LIT:)>", content=None, ignoreExpr=quotedString.copy()):
if opener == closer:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if content is None:<EOL><INDENT>if isinstance(opener,basestring) and isinstance(closer,basestring):<EOL><INDENT>if len(opener) == <NUM_LIT:1> and len(closer)==<NUM_LIT:1>:<EOL><INDENT>if ignoreExpr is not None:<EOL><INDENT>content = (Combine(OneOrMore(~ignoreExpr +<EOL>CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS,exact=<NUM_LIT:1>))<EOL>).setParseAction(lambda t:t[<NUM_LIT:0>].strip()))<EOL><DEDENT>else:<EOL><INDENT>content = (empty.copy()+CharsNotIn(opener+closer+ParserElement.DEFAULT_WHITE_CHARS<EOL>).setParseAction(lambda t:t[<NUM_LIT:0>].strip()))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if ignoreExpr is not None:<EOL><INDENT>content = (Combine(OneOrMore(~ignoreExpr + <EOL>~Literal(opener) + ~Literal(closer) +<EOL>CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=<NUM_LIT:1>))<EOL>).setParseAction(lambda t:t[<NUM_LIT:0>].strip()))<EOL><DEDENT>else:<EOL><INDENT>content = (Combine(OneOrMore(~Literal(opener) + ~Literal(closer) +<EOL>CharsNotIn(ParserElement.DEFAULT_WHITE_CHARS,exact=<NUM_LIT:1>))<EOL>).setParseAction(lambda t:t[<NUM_LIT:0>].strip()))<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>ret = Forward()<EOL>if ignoreExpr is not None:<EOL><INDENT>ret <<= Group( Suppress(opener) + ZeroOrMore( ignoreExpr | ret | content ) + Suppress(closer) )<EOL><DEDENT>else:<EOL><INDENT>ret <<= Group( Suppress(opener) + ZeroOrMore( ret | content )  + Suppress(closer) )<EOL><DEDENT>return ret<EOL>
Helper method for defining nested lists enclosed in opening and closing
       delimiters ("(" and ")" are the default).

       Parameters:
        - opener - opening character for a nested list (default="("); can also be a pyparsing expression
        - closer - closing character for a nested list (default=")"); can also be a pyparsing expression
        - content - expression for items within the nested lists (default=None)
        - ignoreExpr - expression for ignoring opening and closing delimiters (default=quotedString)

       If an expression is not provided for the content argument, the nested
       expression will capture all whitespace-delimited content between delimiters
       as a list of separate values.

       Use the C{ignoreExpr} argument to define expressions that may contain
       opening or closing characters that should not be treated as opening
       or closing characters for nesting, such as quotedString or a comment
       expression.  Specify multiple expressions using an C{L{Or}} or C{L{MatchFirst}}.
       The default is L{quotedString}, but if no expressions are to be ignored,
       then pass C{None} for this argument.