def write_pa11y_results(item, pa11y_results, data_dir):
data = dict(item)<EOL>data['<STR_LIT>'] = pa11y_results<EOL>hasher = hashlib.md5()<EOL>hasher.update(item["<STR_LIT:url>"].encode('<STR_LIT:utf8>'))<EOL>hasher.update(item["<STR_LIT>"].isoformat().encode('<STR_LIT:utf8>'))<EOL>basename = hasher.hexdigest()<EOL>filename = basename + "<STR_LIT>"<EOL>filepath = data_dir / filename<EOL>data_dir.makedirs_p()<EOL>text = json.dumps(data, cls=DateTimeEncoder)<EOL>filepath.write_text(text)<EOL>
Write the output from pa11y into a data file.