<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_paragraph(document, par):
 """Parse paragraph element. Some other elements could be found inside of paragraph element (math, links). """


    paragraph = doc.Paragraph()
    paragraph.document = document

    for elem in par:
        if elem.tag == _name('{{{w}}}pPr'):
            parse_paragraph_properties(document, paragraph, elem)

        if elem.tag == _name('{{{w}}}r'):
            parse_text(document, paragraph, elem)

        if elem.tag == _name('{{{m}}}oMath'):
            _m = doc.Math()
            paragraph.elements.append(_m)

        if elem.tag == _name('{{{m}}}oMathPara'):
            _m = doc.Math()
            paragraph.elements.append(_m)

        if elem.tag == _name('{{{w}}}commentRangeStart'):
            _m = doc.Comment(elem.attrib[_name('{{{w}}}id')], 'start')
            paragraph.elements.append(_m)

        if elem.tag == _name('{{{w}}}commentRangeEnd'):
            _m = doc.Comment(elem.attrib[_name('{{{w}}}id')], 'end')
            paragraph.elements.append(_m)

        if elem.tag == _name('{{{w}}}hyperlink'):
            try:
                t = doc.Link(elem.attrib[_name('{{{r}}}id')])

                parse_text(document, t, elem)

                paragraph.elements.append(t)
            except:
                logger.error('Error with with hyperlink [%s].', str(elem.attrib.items()))

        if elem.tag == _name('{{{w}}}smartTag'):
            parse_smarttag(document, paragraph, elem)

    return paragraph