def track_pa11y_stats(pa11y_results, spider):
    """
    Keep track of the number of pa11y errors, warnings, and notices that
    we've seen so far, using the Scrapy stats collector:
    http://doc.scrapy.org/en/1.1/topics/stats.html
    """
    num_err, num_warn, num_notice = pa11y_counts(pa11y_results)
    stats = spider.crawler.stats
    stats.inc_value("pa11y/error", count=num_err, spider=spider)
    stats.inc_value("pa11y/warning", count=num_warn, spider=spider)
    stats.inc_value("pa11y/notice", count=num_notice, spider=spider)
Keep track of the number of pa11y errors, warnings, and notices that
    we've seen so far, using the Scrapy stats collector:
    http://doc.scrapy.org/en/1.1/topics/stats.html