<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def genpass(pattern=r'[\w]{32}'):
 """generates a password with random chararcters """

    try:
        return rstr.xeger(pattern)
    except re.error as e:
        raise ValueError(str(e))