def _interface_gen_callback(task_gen, node, interface_task_name):
    if not hasattr(task_gen, "name"):
        module_name = f2py_modulename(node)
    else:
        module_name = task_gen.name

    intermediate_output = node.parent.find_or_declare("%s.pyf" % module_name)
    module_node = node.parent.find_or_declare("%smodule.c" % module_name)
    # Guard against overwriting existing source code by accident. Did I say I
    # hate find_or_declare ?
    assert intermediate_output.is_bld()
    assert module_node.is_bld()

    interface_task = task_gen.create_task(interface_task_name, node, intermediate_output)

    f2py_task = task_gen.create_task('f2py', intermediate_output, module_node)
    add_f2py_tasks(task_gen, f2py_task, module_name, module_node)
dataset/ETHPy150Open cournape/Bento/bento/backends/waf_tools/f2py.py/_interface_gen_callback/original