code: def get_view(
      dataset,
      view_name=None,
      stages=None,
      filters=None,
      pagination_data=False,
      extended_stages=None,
      sample_filter=None,
      reload=True,
  ):
      """Gets the view defined by the given request parameters.
  
      Args:
          dataset: the dataset name or :class:`fiftyone.core.dataset.Dataset`
              instance
          view_name (None): the name of a saved view to load
          stages (None): an optional list of serialized
              :class:`fiftyone.core.stages.ViewStage` instances
          filters (None): an optional ``dict`` of App defined filters
          pagination_data (False): whether process samples as pagination data
              - excludes all :class:`fiftyone.core.fields.DictField` values
              - filters label fields
          only_matches (True): whether to filter unmatches samples when filtering
              labels
          extended_stages (None): extended view stages
          sample_filter (None): an optional
              :class:`fiftyone.server.filters.SampleFilter`
          reload (None): whether to reload the dataset
  
      Returns:
          a :class:`fiftyone.core.view.DatasetView`
      """
      if isinstance(dataset, str):
          dataset = fod.load_dataset(dataset)
  
      if reload:
          dataset.reload()
  
      if view_name is not None:
          return dataset.load_saved_view(view_name)
  
      if stages:
          view = fov.DatasetView._build(dataset, stages)
      else:
          view = dataset.view()
  
      if sample_filter is not None:
          if sample_filter.group:
              if sample_filter.group.slice:
                  view.group_slice = sample_filter.group.slice
  
              if sample_filter.group.id:
                  view = fov.make_optimized_select_view(
                      view, sample_filter.group.id, groups=True
                  )
              if sample_filter.group.slices:
                  view = view.select_group_slices(
                      sample_filter.group.slices,
                      _force_mixed=len(sample_filter.group.slices) > 1,
                  )
  
          elif sample_filter.id:
              view = fov.make_optimized_select_view(
                  view, sample_filter.id
              )
  
      if pagination_data:
          # omit all dict field values for performance, not needed by grid
          view = _project_pagination_paths(view)
  
      if filters or extended_stages or pagination_data:
          view = get_extended_view(
              view,
              filters,
              pagination_data=pagination_data,
              extended_stages=extended_stages,
          )
      return view
  
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 1 for calling a global function with example usage: get_view(dataset, view_name, stages, filters, pagination_data, extended_stages, sample_filter, reload) and returns: view, dataset