original_docstring: removes a numbered directory if its lock can be obtained
docstring: removes a numbered directory if its lock can be obtained
docstring_tokens: removes a numbered directory if its lock can be obtained
code: def maybe_delete_a_numbered_dir(path):
      """removes a numbered directory if its lock can be obtained"""
      try:
          create_cleanup_lock(path)
      except (OSError, EnvironmentError):
          #  known races:
          #  * other process did a cleanup at the same time
          #  * deletable folder was found
          return
      parent = path.parent
  
      garbage = parent.joinpath("garbage-{}".format(uuid.uuid4()))
      path.rename(garbage)
      rmtree(garbage, force=True)
code_tokens: def maybe_delete_a_numbered_dir ( path ) : try : create_cleanup_lock ( path ) except ( OSError , EnvironmentError ) : return parent = path . parent garbage = parent . joinpath ( "garbage-{}" . format ( uuid . uuid4 ( ) ) ) path . rename ( garbage ) rmtree ( garbage , force = True )
short_docstring: removes a numbered directory if its lock can be obtained
short_docstring_tokens: removes a numbered directory if its lock can be obtained
comment: """removes a numbered directory if its lock can be obtained"""$SEP$#  known races:$SEP$#  * other process did a cleanup at the same time$SEP$#  * deletable folder was found