def METHOD_NAME(function_scope_prefix, db_session):
    executables = []
    def _create_executable():
        executable = f'{function_scope_prefix}_{len(executables)}'
        executables.append(executable)
        return executable
    yield _create_executable
    db_session.query(Heartbeats).where(Heartbeats.executable.in_(executables)).delete()