import re


def sanitize_output(output):
    """Sanitize test output that may be environment specific or unique per run."""
    re_uuid = re.compile(
        "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", re.IGNORECASE
    )
    re_home = re.compile("(/Users|/home)/(?!runner)[a-z,0-9]*/")
    for idx, line in enumerate(output):
        new_line = re.sub(re_uuid, "00000000-0000-0000-0000-000000000000", line)

        new_line = re.sub(re_home, "/home/user/", new_line)
        output[idx] = new_line
    return output