original_docstring: lists candidates for numbered directories to be removed - follows py.path
docstring: lists candidates for numbered directories to be removed - follows py.path
docstring_tokens: lists candidates for numbered directories to be removed - follows py . path
code: def cleanup_candidates(root, prefix, keep):
      """lists candidates for numbered directories to be removed - follows py.path"""
      max_existing = _max(map(parse_num, find_suffixes(root, prefix)), default=-1)
      max_delete = max_existing - keep
      paths = find_prefixed(root, prefix)
      paths, paths2 = itertools.tee(paths)
      numbers = map(parse_num, extract_suffixes(paths2, prefix))
      for path, number in zip(paths, numbers):
          if number <= max_delete:
              yield path
code_tokens: def cleanup_candidates ( root , prefix , keep ) : max_existing = _max ( map ( parse_num , find_suffixes ( root , prefix ) ) , default = - 1 ) max_delete = max_existing - keep paths = find_prefixed ( root , prefix ) paths , paths2 = itertools . tee ( paths ) numbers = map ( parse_num , extract_suffixes ( paths2 , prefix ) ) for path , number in zip ( paths , numbers ) : if number <= max_delete : yield path
short_docstring: lists candidates for numbered directories to be removed - follows py.path
short_docstring_tokens: lists candidates for numbered directories to be removed - follows py . path
comment: """lists candidates for numbered directories to be removed - follows py.path"""