def get_view(
    dataset,
    view_name=None,
    stages=None,
    filters=None,
    pagination_data=False,
    extended_stages=None,
    sample_filter=None,
    reload=True,
    awaitable=False,
    sort_by=None,
    desc=None,
):
    """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
        extended_stages (None): extended view stages
        sample_filter (None): an optional
            :class:`fiftyone.server.filters.SampleFilter`
        reload (True): whether to reload the dataset
        awaitable (False): whether to return an awaitable coroutine

    Returns:
        a :class:`fiftyone.core.view.DatasetView`
    """

    def run(dataset, stages):
        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()

        media_types = None
        if sample_filter is not None:
            if sample_filter.group:
                view, media_types = handle_group_filter(
                    dataset, view, sample_filter.group
                )

            elif sample_filter.id:
                view = fov.make_optimized_select_view(view, sample_filter.id)

        if filters or extended_stages or pagination_data:
            view = get_extended_view(
                view,
                filters,
                pagination_data=pagination_data,
                extended_stages=extended_stages,
                media_types=media_types,
                sort_by=sort_by,
                desc=desc,
            )

        return view

    if awaitable:
        return fou.run_sync_task(run, dataset, stages)

    return run(dataset, stages)
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
        extended_stages (None): extended view stages
        sample_filter (None): an optional
            :class:`fiftyone.server.filters.SampleFilter`
        reload (True): whether to reload the dataset
        awaitable (False): whether to return an awaitable coroutine

    Returns:
        a :class:`fiftyone.core.view.DatasetView`
    
fiftyone/server/view.py