def page_count(pdflatex_stdout, paper_dir):
    if pdflatex_stdout is None:
        print("*** WARNING: PDFLaTeX failed to generate output.")
        return

    regexp = re.compile('Output written on paper.pdf \((\d+) pages')
    cfgname = os.path.join(paper_dir, 'paper_stats.json')

    d = options.cfg2dict(cfgname)

    for line in pdflatex_stdout.splitlines():
        m = regexp.match(line)
        if m:
            pages = m.groups()[0]
            d.update({'pages': int(pages)})
            break

    options.dict2cfg(d, cfgname)
init
dataset/ETHPy150Open scipy-conference/scipy_proceedings/publisher/build_paper.py/page_count--crossover with--dataset/ETHPy150Open cakebread/yolk/yolk/yolklib.py/Distributions.__init__