docstr: Validate the call args before they get passed to the run method of the Work.
  
  Currently, this performs a check against strings that look like filesystem paths and may need to be wrapped with
  a Lightning Path by the user.
docstr_tok: ["Validate","the","call","args","before","they","get","passed","to","the","run","method","of","the","Work",".","Currently",",","this","performs","a","check","against","strings","that","look","like","filesystem","paths","and","may","need","to","be","wrapped","with","a","Lightning","Path","by","the","user","."]
code: def _validate_call_args(
      self, args: Tuple[Any, ...], kwargs: Dict[str, Any]
  ) -> None:
      """Validate the call args before they get passed to the run method of the Work.
  
      Currently, this performs a check against strings that look like filesystem paths and may need to be wrapped with
      a Lightning Path by the user.
  
      """
  
      def warn_if_pathlike(obj: Union[os.PathLike, str]):
          if isinstance(obj, Path):
              return
          if os.sep in str(obj) and os.path.exists(obj):
              # NOTE: The existence check is wrong in general, as the file will never exist on the disk
              # where the flow is running unless we are running locally
              warnings.warn(
                  f"You passed a the value {obj!r} as an argument to the `run()` method of {self.work_name} and"
                  f" it looks like this is a path to a file or a folder. Consider wrapping this path in a"
                  f" `lightning.app.storage.Path` object to be able to access these files in your Work.",
                  UserWarning,
              )
  
      apply_to_collection(
          args, dtype=(os.PathLike, str), function=warn_if_pathlike
      )
      apply_to_collection(
          kwargs, dtype=(os.PathLike, str), function=warn_if_pathlike
      )
  
imports: import os
  import pathlib
  import queue
  import signal
  import sys
  import threading
  import time
  import traceback
  import warnings
  from contextlib import contextmanager
  from copy import deepcopy
  from dataclasses import dataclass, field
  from functools import partial
  from threading import Event, Thread
  from typing import TYPE_CHECKING, Any, Callable, Dict, Generator, Optional, Set, Tuple, Type, Union
  from deepdiff import DeepDiff, Delta
  from lightning_utilities.core.apply_func import apply_to_collection
  from lightning.app.core import constants
  from lightning.app.core.queues import MultiProcessQueue
  from lightning.app.storage.copier import _Copier, _copy_files
  from lightning.app.storage.drive import Drive, _maybe_create_drive
  from lightning.app.storage.path import Path, _path_to_work_artifact
  from lightning.app.storage.payload import Payload
  from lightning.app.utilities.app_helpers import affiliation
  from lightning.app.utilities.component import _set_work_context
  from lightning.app.utilities.enum import CacheCallsKeys, WorkFailureReasons, WorkStageStatus, WorkStopReasons, make_status
  from lightning.app.utilities.exceptions import CacheMissException, LightningSigtermStateException
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 3 for calling the ProxyWorkRun obj's underlying member method code with example usage: obj._validate_call_args(args, kwargs) without return types