<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_pa11y_ignore_rules(file=None, url=None):
 # pylint: disable=redefined-builtin """ Load the pa11y ignore rules from the given file or URL. """

    if not file and not url:
        return None

    if file:
        file = Path(file)
        if not file.isfile():
            msg = (
                u"pa11y_ignore_rules_file specified, but file does not exist! {file}"
            ).format(file=file)
            raise ValueError(msg)
        return yaml.safe_load(file.text())

    # must be URL
    resp = requests.get(url)
    if not resp.ok:
        msg = (
            u"pa11y_ignore_rules_url specified, but failed to fetch URL. status={status}"
        ).format(status=resp.status_code)
        err = RuntimeError(msg)
        err.response = resp
        raise err
    return yaml.safe_load(resp.text)