def load_pa11y_ignore_rules(file=None, url=None):  
if not file and not url:<EOL><INDENT>return None<EOL><DEDENT>if file:<EOL><INDENT>file = Path(file)<EOL>if not file.isfile():<EOL><INDENT>msg = (<EOL>u"<STR_LIT>"<EOL>).format(file=file)<EOL>raise ValueError(msg)<EOL><DEDENT>return yaml.safe_load(file.text())<EOL><DEDENT>resp = requests.get(url)<EOL>if not resp.ok:<EOL><INDENT>msg = (<EOL>u"<STR_LIT>"<EOL>).format(status=resp.status_code)<EOL>err = RuntimeError(msg)<EOL>err.response = resp<EOL>raise err<EOL><DEDENT>return yaml.safe_load(resp.text)<EOL>
Load the pa11y ignore rules from the given file or URL.