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","`"]
code: def get(self, overwrite: bool = False) -> None:
      if _is_flow_context():
          raise RuntimeError(
              "`Path.get()` can only be called from within the `run()` method of LightningWork."
          )
      if self._request_queue is None or self._response_queue is None:
          raise RuntimeError(
              f"Trying to get the file {self}, but the path is not attached to a LightningApp."
              f" Are you trying to get the file from within `__init__`?"
          )
      if self._origin is None:
          raise RuntimeError(
              f"Trying to get the file {self}, but the path is not attached to a LightningWork. Set it as an"
              f" attribute to a LightningWork or pass it to the `run()` method."
          )
  
      if self.exists_local() and not overwrite:
          raise FileExistsError(
              f"The file or folder {self} exists locally. Pass `overwrite=True` if you wish to replace it"
              f" with the new contents."
          )
  
      # 1. Send message to orchestrator through queue with details of the transfer
      # the source is the name of the work that owns the file that we request
      # the destination is determined by the queue, since each work has a dedicated send and recv queue
      request = _GetRequest(
          source=self.origin_name,
          path=str(self),
          hash=self.hash,
          name=self._name,
      )
      self._request_queue.put(request)
  
      # 2. Wait for the transfer to finish
      response: _GetResponse = self._response_queue.get()  # blocking
      self._validate_get_response(response)
  
      fs = _filesystem()
  
      # 3. Wait until the file appears in shared storage
      while (
          not fs.exists(response.path)
          or fs.info(response.path)["size"] != response.size
      ):
          sleep(REMOTE_STORAGE_WAIT)
  
      if self.exists_local() and self.is_dir():
          # Delete the directory, otherwise we can't overwrite it
          shutil.rmtree(self)
  
      # 4. Copy the file from the shared storage to the destination on the local filesystem
      if fs.isdir(response.path):
          if isinstance(fs, LocalFileSystem):
              shutil.copytree(response.path, self.resolve())
          else:
              glob = f"{str(response.path)}/**"
              _logger.debug(
                  f"Attempting to copy {glob} -> {str(self.absolute())}"
              )
              fs.get(glob, str(self.absolute()), recursive=False)
      else:
          _logger.debug(
              f"Attempting to copy {str(response.path)} -> {str(self.absolute())}"
          )
          fs.get(
              str(response.path), str(self.absolute()), recursive=False
          )
  
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 11 for calling the Path obj's underlying member method code with example usage: obj.get(overwrite) without return types