original_docstring: checks if a lock exists and breaks it if its considered dead
docstring: checks if a lock exists and breaks it if its considered dead
docstring_tokens: checks if a lock exists and breaks it if its considered dead
code: def ensure_deletable(path, consider_lock_dead_if_created_before):
      """checks if a lock exists and breaks it if its considered dead"""
      if path.is_symlink():
          return False
      lock = get_lock_path(path)
      if not lock.exists():
          return True
      try:
          lock_time = lock.stat().st_mtime
      except Exception:
          return False
      else:
          if lock_time < consider_lock_dead_if_created_before:
              lock.unlink()
              return True
          else:
              return False
code_tokens: def ensure_deletable ( path , consider_lock_dead_if_created_before ) : if path . is_symlink ( ) : return False lock = get_lock_path ( path ) if not lock . exists ( ) : return True try : lock_time = lock . stat ( ) . st_mtime except Exception : return False else : if lock_time < consider_lock_dead_if_created_before : lock . unlink ( ) return True else : return False
short_docstring: checks if a lock exists and breaks it if its considered dead
short_docstring_tokens: checks if a lock exists and breaks it if its considered dead
comment: """checks if a lock exists and breaks it if its considered dead"""