def METHOD_NAME(text: str, stopwords: Optional[List[str]] = None, umls: bool = False) -> str:
    # Remove multi spaces
    text = re.sub("[ ]+", " ", text).strip()
    # If UMLS
    if umls:
        # Remove specific things from parentheses
        text = PH_RM.sub(" ", text)
    # Remove stopwords if requested and <= 5 words in total in the name
    if stopwords:
        new_text = ""
        for word in text.split(" "):
            if word not in stopwords:
                new_text += word + " "
        text = new_text.strip()
    return text