def cleanup_callback(self, pending):
        if len(pending.parent) == 2:    # <title> and <pending>
            pending.parent.parent.remove(pending.parent)
Remove an empty "References" section.
dataset/ETHPy150Open adieu/allbuttonspressed/docutils/transforms/peps.py/TargetNotes.cleanup_callback