def generate_conf_py(source_dir, build_dir):
    """ Generate a suitable conf.py """
    conf_in_py = os.path.join(source_dir, "conf.in.py")
    with open(conf_in_py, "r") as fp:
        contents = fp.read()
    header = """\
# Generated by build-doc.py. Do not edit
import sys
import os

source_suffix = '.rst'
master_doc = 'index'

extensions = ["sphinx.ext.todo"]
"""
    contents = header + contents
    out_conf_py = os.path.join(build_dir, "conf.py")
    with open(out_conf_py, "w") as fp:
        fp.write(contents)
dataset/ETHPy150Open aldebaran/qibuild/doc/build-doc.py/generate_conf_py/original