code: def _get_paths(
      dataset: fo.Dataset,
      field_type: t.Type[fo.Field],
      keys: t.Set[str],
  ):
      field_dict = dataset.get_field_schema(flat=True)
      field_dict.update(
          **{
              f"frames.{path}": field
              for path, field in dataset.get_frame_field_schema(
                  flat=True
              ).items()
          }
      )
      paths: t.List[LightningPathInput] = []
      for path in sorted(field_dict):
          field = field_dict[path]
          if isinstance(field, fo.ListField):
              field = field.field
  
          if not isinstance(field, field_type):
              continue
  
          if all([key not in path for key in keys]):
              continue
  
          dataset.create_index(path)
          paths.append(LightningPathInput(path=path))
      return paths
  
imports: from dataclasses import asdict
  from datetime import date, datetime
  import typing
  import unittest
  import strawberry
  from strawberry.schema.config import StrawberryConfig
  import fiftyone
  from fiftyone.server.constants import SCALAR_OVERRIDES
  from fiftyone.server.context import get_context
  from fiftyone.server.lightning import lightning_resolver, LightningInput, LightningPathInput
  from decorators import drop_async_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: _get_paths(dataset, field_type, keys) and returns: paths