<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def gfdist(target, abcorr, obsrvr, relate, refval, adjust, step, nintvls, cnfine, result=None):
 """ Return the time window over which a specified constraint on observer-target distance is met. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/gfdist_c.html :param target: Name of the target body. :type target: str :param abcorr: Aberration correction flag. :type abcorr: str :param obsrvr: Name of the observing body. :type obsrvr: str :param relate: Relational operator. :type relate: str :param refval: Reference value. :type refval: float :param adjust: Adjustment value for absolute extrema searches. :type adjust: float :param step: Step size used for locating extrema and roots. :type step: float :param nintvls: Workspace window interval count. :type nintvls: int :param cnfine: SPICE window to which the search is confined. :type cnfine: spiceypy.utils.support_types.SpiceCell :param result: Optional SPICE window containing results. :type result: spiceypy.utils.support_types.SpiceCell """

    assert isinstance(cnfine, stypes.SpiceCell)
    assert cnfine.is_double()
    if result is None:
        result = stypes.SPICEDOUBLE_CELL(2000)
    else:
        assert isinstance(result, stypes.SpiceCell)
        assert result.is_double()
    target = stypes.stringToCharP(target)
    abcorr = stypes.stringToCharP(abcorr)
    obsrvr = stypes.stringToCharP(obsrvr)
    relate = stypes.stringToCharP(relate)
    refval = ctypes.c_double(refval)
    adjust = ctypes.c_double(adjust)
    step = ctypes.c_double(step)
    nintvls = ctypes.c_int(nintvls)
    libspice.gfdist_c(target, abcorr, obsrvr, relate, refval, adjust,
                      step, nintvls, ctypes.byref(cnfine), ctypes.byref(result))
    return result