<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def erract(op, lenout, action=None):
 """ Retrieve or set the default error action. spiceypy sets the default error action to "report" on init. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/erract_c.html :param op: peration, "GET" or "SET". :type op: str :param lenout: Length of list for output. :type lenout: int :param action: Error response action. :type action: str :return: Error response action. :rtype: str """

    if action is None:
        action = ""
    lenout = ctypes.c_int(lenout)
    op = stypes.stringToCharP(op)
    action = ctypes.create_string_buffer(str.encode(action), lenout.value)
    actionptr = ctypes.c_char_p(ctypes.addressof(action))
    libspice.erract_c(op, lenout, actionptr)
    return stypes.toPythonString(actionptr)