def _from_docstring_rst(doc):
def format_fn(line, status):<EOL><INDENT>"""<STR_LIT>"""<EOL>if re_from_data.match(line):<EOL><INDENT>line = re_from_data.sub(r"<STR_LIT>", line)<EOL>status["<STR_LIT>"] = True<EOL><DEDENT>line = re_from_defaults.sub(r"<STR_LIT>", line)<EOL>if status["<STR_LIT>"]:<EOL><INDENT>if re_from_param.match(line):<EOL><INDENT>m = re_from_param.match(line)<EOL>line = "<STR_LIT>".format(m.group(<NUM_LIT:1>), m.group(<NUM_LIT:3>))<EOL><DEDENT>elif re_from_status.match(line):<EOL><INDENT>m = re_from_status.match(line)<EOL>line = "<STR_LIT>".format(m.group(<NUM_LIT:1>), m.group(<NUM_LIT:3>))<EOL><DEDENT>elif re_from_item.match(line):<EOL><INDENT>line = re_from_item.sub(r"<STR_LIT>", line)<EOL><DEDENT>else:<EOL><INDENT>line = "<STR_LIT:U+0020>" * <NUM_LIT:4> + line.lstrip()<EOL><DEDENT><DEDENT>line = re_lone_backtick.sub("<STR_LIT>", line)<EOL>return line<EOL><DEDENT>return _reformat_docstring(doc, format_fn, code_newline="<STR_LIT:\n>")<EOL>
format from docstring to ReStructured Text