<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def repmd(instr, marker, value, sigdig):
 """ Replace a marker with a double precision number. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/repmd_c.html :param instr: Input string. :type instr: str :param marker: Marker to be replaced. :type marker: str :param value: Replacement value. :type value: float :param sigdig: Significant digits in replacement text. :type sigdig: int :return: Output string. :rtype: str """

    lenout = ctypes.c_int(len(instr) + len(marker) + 15)
    instr = stypes.stringToCharP(instr)
    marker = stypes.stringToCharP(marker)
    value = ctypes.c_double(value)
    sigdig = ctypes.c_int(sigdig)
    out = stypes.stringToCharP(lenout)
    libspice.repmd_c(instr, marker, value, sigdig, lenout, out)
    return stypes.toPythonString(out)