def METHOD_NAME(glob=None, regex=None, match_case=None):
    assert glob is not None or regex is not None
    if glob is not None and regex is not None:
        raise ValueError(
            "You should specify at most one of `glob` and `regex` parameters but not both")
    if glob is not None:
        pattern = glob_to_regex(glob)
    else:  # regex is not None
        if match_case is not None and not isinstance(regex, str):
            raise ValueError(
                "Regex must be a string if `match_case` is specified when "
                "calling assert_raises_pattern")
        pattern = regex
    if isinstance(pattern, str) and not match_case:  # ignore case by default
        pattern = re.compile(pattern, re.IGNORECASE)
    return pattern