<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def etcal(et, lenout=_default_len_out):
 """ Convert from an ephemeris epoch measured in seconds past the epoch of J2000 to a calendar string format using a formal calendar free of leapseconds. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/etcal_c.html :param et: Ephemeris time measured in seconds past J2000. :type et: Union[float,Iterable[float]] :param lenout: Length of output string. :type lenout: int :return: A standard calendar representation of et. :rtype: str """

    lenout = ctypes.c_int(lenout)
    string = stypes.stringToCharP(lenout)
    if hasattr(et, "__iter__"):
        strings = []
        for t in et:
            libspice.etcal_c(t, lenout, string)
            checkForSpiceError(None)
            strings.append(stypes.toPythonString(string))
        return strings
    else:
        et = ctypes.c_double(et)
        libspice.etcal_c(et, lenout, string)
        return stypes.toPythonString(string)