<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def maybeparens(lparen, item, rparen):
 """Wrap an item in optional parentheses, only applying them if necessary."""

    return item | lparen.suppress() + item + rparen.suppress()