import re


def remove_ansible_warnings(output, warning_list=None):
    """Remove the specified warnings from std_err."""

    if warning_list is None:
        warning_list = [
            r"^.WARNING.: Ignoring timeout.10. for .*$",
        ]

    # Remove warnings one at a time from std_err
    for ansible_warn in warning_list:
        output = re.sub(ansible_warn, "", output, flags=re.M)
    return output.strip()