<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def summary(doc):
 """ Generate markdown for summary section. Parameters doc : dict Output from numpydoc Returns ------- list of str Markdown strings """

    lines = []
    if "Summary" in doc and len(doc["Summary"]) > 0:
        lines.append(fix_footnotes(" ".join(doc["Summary"])))
        lines.append("\n")
    if "Extended Summary" in doc and len(doc["Extended Summary"]) > 0:
        lines.append(fix_footnotes(" ".join(doc["Extended Summary"])))
        lines.append("\n")
    return lines