code: def _get_indexed_paths(data: Any) -> Dict[int, str]:
      flattened_item, _ = tree_flatten(data)
  
      indexed_paths = {
          index: element
          for index, element in enumerate(flattened_item)
          if isinstance(element, str) and os.path.exists(element)
      }
  
      return indexed_paths
  
imports: import inspect
  import os
  from datetime import datetime
  from pathlib import Path
  from types import FunctionType
  from typing import Any, Callable, Dict, Optional, Sequence, Union
  import torch
  from lightning.data.streaming.constants import _LIGHTNING_CLOUD_LATEST, _TORCH_GREATER_EQUAL_2_1_0
  from lightning.data.streaming.data_processor import DataChunkRecipe, DataProcessor, DataTransformRecipe
label_desc: Use image node_id 1 for calling a global function with example usage: _get_indexed_paths(data) and returns: indexed_paths