code: def _project_pagination_paths(view: foc.SampleCollection):
      schema = view.get_field_schema(flat=True)
      frame_schema = view.get_frame_field_schema(flat=True)
      if frame_schema:
          schema.update(
              **{
                  f"frames.{path}": field
                  for path, field in frame_schema.items()
              }
          )
  
      excluded = [
          path
          for path, field in schema.items()
          if isinstance(field, fof.DictField)
      ]
  
      return view.select_fields(
          [
              path
              for path in schema
              if all(
                  not path.startswith(exclude) for exclude in excluded
              )
          ]
      )
  
imports: from typing import List, Optional
  from bson import ObjectId
  import strawberry
  import fiftyone.core.collections
  import fiftyone.core.dataset
  from fiftyone.core.expressions import ViewField, VALUE
  import fiftyone.core.fields
  import fiftyone.core.labels
  import fiftyone.core.media
  import fiftyone.core.stages
  import fiftyone.core.utils
  import fiftyone.core.view
  from fiftyone.server.aggregations import GroupElementFilter, SampleFilter
  from fiftyone.server.scalars import BSONArray, JSON
label_desc: Use image node_id 5 for calling a global function with example usage: _project_pagination_paths(view) and returns: view