<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wnextd(side, window):
 """ Extract the left or right endpoints from a double precision window. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/wnextd_c.html :param side: Extract left "L" or right "R" endpoints. :type side: str :param window: Window to be extracted. :type window: spiceypy.utils.support_types.SpiceCell :return: Extracted Window. :rtype: spiceypy.utils.support_types.SpiceCell """

    assert isinstance(window, stypes.SpiceCell)
    assert window.dtype == 1
    assert side == 'L' or side == 'R'
    side = ctypes.c_char(side.encode(encoding='UTF-8'))
    libspice.wnextd_c(side, ctypes.byref(window))
    return window