def cleanup_numbered_dir(root, prefix, keep, consider_lock_dead_if_created_before):
for path in cleanup_candidates(root, prefix, keep):<EOL><INDENT>try_cleanup(path, consider_lock_dead_if_created_before)<EOL><DEDENT>for path in root.glob("<STR_LIT>"):<EOL><INDENT>try_cleanup(path, consider_lock_dead_if_created_before)<EOL><DEDENT>
cleanup for lock driven numbered directories