code: def _convert_paths_after_init(root: "LightningFlow"):
      """Converts the path attributes on a component to a dictionary.
  
      This is necessary because at the time of instantiating the component, its full affiliation is not known and Paths
      that get passed to other componenets during ``__init__`` are otherwise not able to reference their origin or
      consumer.
  
      """
      from lightning.app.core import LightningFlow, LightningWork
      from lightning.app.storage.path import Path
  
      for component in breadth_first(
          root, types=(LightningFlow, LightningWork)
      ):
          for attr in list(component.__dict__.keys()):
              value = getattr(component, attr)
              if isinstance(value, Path):
                  delattr(component, attr)
                  component._paths[attr] = value.to_dict()
  
imports: import os
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, Any, Dict, Generator, Optional
  from deepdiff.helper import NotPresent
  from lightning_utilities.core.apply_func import apply_to_collection
  from lightning.app.utilities.app_helpers import is_overridden
  from lightning.app.utilities.enum import ComponentContext
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
  from lightning.app.utilities.tree import breadth_first
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_paths_after_init(root) without return types