

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\nimport sys\nimport os\n\nsource_suffix = \'.rst\'\nmaster_doc = \'index\'\n\nextensions = ["sphinx.ext.todo"]\n'
    contents = (header + contents)
    out_conf_py = os.path.join(build_dir, 'conf.py')
    with open(out_conf_py, 'w') as fp:
        build_dir.write(contents)

dataset/ETHPy150Open aldebaran/qibuild/doc/build-doc.py generate_conf_py/VarMisuse@85/209 `fp`->`build_dir`