class_docstr: A drop-in replacement for :class:`pathlib.Path` for all paths in Lightning.
  
  The Lightning Path works exactly the same as :class:`pathlib.Path` but it also remembers in which LightningWork
  it was created. If the Path gets passed to a different LightningWork, the file or folder can then be easily
  accessed no matter where it is located in the other Work's filesystem.
  
  Args:
      *args: Accepts the same arguments as in :class:`pathlib.Path`
      **kwargs: Accepts the same keyword arguments as in :class:`pathlib.Path`
class_docstr_tok: ["A","drop-in","replacement","for",":","class",":","`","pathlib.Path","`","for","all","paths","in","Lightning",".","The","Lightning","Path","works","exactly","the","same","as",":","class",":","`","pathlib.Path","`","but","it","also","remembers","in","which","LightningWork","it","was","created",".","If","the","Path","gets","passed","to","a","different","LightningWork",",","the","file","or","folder","can","then","be","easily","accessed","no","matter","where","it","is","located","in","the","other","Work","'s","filesystem",".","Args",":","*","args",":","Accepts","the","same","arguments","as","in",":","class",":","`","pathlib.Path","`","*","*","kwargs",":","Accepts","the","same","keyword","arguments","as","in",":","class",":","`","pathlib.Path","`"]
docstr: Check if the path exists locally or remotely.
  
  If the path exists locally, this method immediately returns ``True``, otherwise it will make a RPC call
  to the attached origin Work and check if the path exists remotely.
  If you strictly want to check local existence only, use :meth:`exists_local` instead. If you strictly want
  to check existence on the remote (regardless of whether the file exists locally or not), use
  :meth:`exists_remote`.
docstr_tok: ["Check","if","the","path","exists","locally","or","remotely",".","If","the","path","exists","locally",",","this","method","immediately","returns","``","True","``",",","otherwise","it","will","make","a","RPC","call","to","the","attached","origin","Work","and","check","if","the","path","exists","remotely",".","If","you","strictly","want","to","check","local","existence","only",",","use",":","meth",":","`","exists_local","`","instead",".","If","you","strictly","want","to","check","existence","on","the","remote","(","regardless","of","whether","the","file","exists","locally","or","not",")",",","use",":","meth",":","`","exists_remote","`","."]
code: def exists(self) -> bool:
      """Check if the path exists locally or remotely.
  
      If the path exists locally, this method immediately returns ``True``, otherwise it will make a RPC call
      to the attached origin Work and check if the path exists remotely.
      If you strictly want to check local existence only, use :meth:`exists_local` instead. If you strictly want
      to check existence on the remote (regardless of whether the file exists locally or not), use
      :meth:`exists_remote`.
  
      """
      return self.exists_local() or (
          self._origin and self.exists_remote()
      )
  
imports: import hashlib
  import os
  import pathlib
  import shutil
  import sys
  from time import sleep
  from typing import TYPE_CHECKING, Any, List, Optional, Sequence, Union
  from fsspec import AbstractFileSystem
  from fsspec.implementations.local import LocalFileSystem
  from lightning.app.core.constants import REMOTE_STORAGE_WAIT
  from lightning.app.core.queues import BaseQueue
  from lightning.app.storage.requests import _ExistsRequest, _ExistsResponse, _GetRequest, _GetResponse
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.component import _is_flow_context
  from lightning.app.utilities.imports import _is_s3fs_available
label_desc: Use image node_id 8 for calling the Path obj's underlying member method code with example usage: obj.exists() and returns: unknown