code: def _get_config_file(
      source_path: Union[str, pathlib.Path]
  ) -> pathlib.Path:
      """Get the Lightning app config file '.lightning' at the given source path.
  
      Args:
          source_path: A path to a folder or a file.
  
      """
      source_path = pathlib.Path(source_path).absolute()
      if source_path.is_file():
          source_path = source_path.parent
  
      return pathlib.Path(source_path / _APP_CONFIG_FILENAME)
  
file_path: pytorch-lightning/src/lightning/app/utilities/packaging/app_config.py
imports: import pathlib
  from dataclasses import asdict, dataclass, field
  from typing import Union
  import yaml
  from lightning.app.utilities.name_generator import get_unique_name
label_desc: Use image node_id 1 for calling a global function with example usage: _get_config_file(source_path) and returns: pathlib