<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lparsm(inlist, delims, nmax, lenout=None):
 """ Parse a list of items separated by multiple delimiters. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/lparsm_c.html :param inlist: list of items delimited by delims. :type inlist: list of strings :param delims: Single characters which delimit items. :type delims: str :param nmax: Maximum number of items to return. :type nmax: int :param lenout: Optional Length of strings in item array. :type lenout: int :return: Items in the list, left justified. :rtype: list of strings """

    if lenout is None:
        lenout = ctypes.c_int(len(inlist) + 1)
    else:
        lenout = ctypes.c_int(lenout)
    inlist = stypes.stringToCharP(inlist)
    delims = stypes.stringToCharP(delims)
    items = stypes.emptyCharArray(lenout.value, nmax)
    nmax = ctypes.c_int(nmax)
    n = ctypes.c_int()
    libspice.lparsm_c(inlist, delims, nmax, lenout, ctypes.byref(n), items)
    return [stypes.toPythonString(x.value) for x in items][0:n.value]