def add_quotes(text_):
    """
    Add quotes around string if necessary

    Cases
    (1) no spaces --> no need
    (2) no "s --> surround by "..."
    (3) no 's --> surround by '...'
    (4) otherwise --> surround by "..." (anyway)

    Parameters
    ----------
    text_ : str
        text to be quoted

    Returns
    -------
    str
        quoted text

    """
    if " " not in text_:
        # No need to add quotes
        return text_
    if '"' not in text_:
        return '"' + text_ + '"'
    if "'" not in text_:
        return "'" + text_ + "'"
    return '"' + text_ + '"'