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: Attach a LightningWork to this Path.
  
  The first work to be attached becomes the `origin`, i.e., the Work that is meant to expose the file to other
  Work. Attaching a Work to a Path that already has an `origin` Work will make it a `consumer`. A consumer Work
  is a work that can access the file only by first transferring it via :meth:`transfer`.
  
  Args:
      work: LightningWork to be attached to this Path.
docstr_tok: ["Attach","a","LightningWork","to","this","Path",".","The","first","work","to","be","attached","becomes","the","`","origin","`",",","i.e.",",","the","Work","that","is","meant","to","expose","the","file","to","other","Work",".","Attaching","a","Work","to","a","Path","that","already","has","an","`","origin","`","Work","will","make","it","a","`","consumer","`",".","A","consumer","Work","is","a","work","that","can","access","the","file","only","by","first","transferring","it","via",":","meth",":","`","transfer","`",".","Args",":","work",":","LightningWork","to","be","attached","to","this","Path","."]
code: def _attach_work(self, work: "LightningWork") -> None:
      """Attach a LightningWork to this Path.
  
      The first work to be attached becomes the `origin`, i.e., the Work that is meant to expose the file to other
      Work. Attaching a Work to a Path that already has an `origin` Work will make it a `consumer`. A consumer Work
      is a work that can access the file only by first transferring it via :meth:`transfer`.
  
      Args:
          work: LightningWork to be attached to this Path.
  
      """
      if self._origin is None:
          # Can become an owner only if there is not already one
          self._origin = work
      self._consumer = work
  
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 15 for calling the Path obj's underlying member method code with example usage: obj._attach_work(work) without return types