import re


def remove_special_message(section_content):
    """
    Remove special message - "medicinal product no longer authorised"

    e.g.
    'me di cin al p ro du ct n o lo ng er a ut ho ris ed'
    'me dic ina l p rod uc t n o l on ge r a uth ori se d'

    :param section_content: content of a section
    :return: content of a section without special message
    """

    # string as it is present in the section content
    SPECIAL_MESSAGE1 = 'me di cin al p ro du ct n o lo ng er a ut ho ris ed'
    SPECIAL_MESSAGE2 = 'me dic ina l p ro du ct no lo ng er au th or ise d'
    SPECIAL_MESSAGE3 = 'me dic ina l p rod uc t n o l on ge r a uth ori se d'
    SPECIAL_MESSAGE4 = 'me dic ina l p ro du ct no lo ng er au tho ris ed'
    SPECIAL_MESSAGE5 = 'me dic ina l p ro du ct no lo ng er a ut ho ris ed'
    SPECIAL_MESSAGE6 = 'me dic ina l p rod uc t n o l on ge r a uth ori sed'
    SPECIAL_MESSAGE7 = 'm ed ici na l p ro du ct no lo ng er a ut ho ris ed'
    SPECIAL_MESSAGE8 = 'm ed ici na l p ro du ct no lo ng er au th or ise d'
    SPECIAL_MESSAGE9 = 'med icin al pro du ct no lo ng er au tho ris ed'
    SPECIAL_MESSAGE_ARRAY = [SPECIAL_MESSAGE1, SPECIAL_MESSAGE2, SPECIAL_MESSAGE3, SPECIAL_MESSAGE4,
                             SPECIAL_MESSAGE5, SPECIAL_MESSAGE6, SPECIAL_MESSAGE7, SPECIAL_MESSAGE8,
                             SPECIAL_MESSAGE9]

    # in case message present in section content
    for SPECIAL_MESSAGE in SPECIAL_MESSAGE_ARRAY:
        section_content = section_content.replace(SPECIAL_MESSAGE, '')

    # remove multiple consecutive spaces
    section_content = re.sub(' +', ' ', section_content)

    return section_content