from bs4 import BeautifulSoup


def remove_html_tags(html_doc, lines_concat = True):
    """ Remove html tags from input strings
    >>> sample_doc = '''<html><head><title>The Dormouse's story</title></head>
    ... <body><p class="title"><b>A Mad Tea-Party</b></p></body>
    ... </html>'''
    >>> remove_html_tags(sample_doc, False)
    "The Dormouse's story\\nA Mad Tea-Party\\n"
    >>> remove_html_tags(sample_doc, True)
    "The Dormouse's story A Mad Tea-Party"
    """

    soup = BeautifulSoup(html_doc, 'html.parser')
    text = soup.get_text()
    if lines_concat:
        text = ' '.join(text.splitlines())
    return text