<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rst_preprocess(file):
 """ Preprocess reST file to support Sphinx like include directive. Includes are relative to the current working directory. """


    with open(file) as fp:
        return re.sub(
            "^\.\.\s+include:: (.*?)$",
            lambda x: (rst_preprocess(x.group(1)) or "").rstrip(),
            fp.read(),
            flags=re.MULTILINE)