def build_dataset_exporter(
    dataset_type, strip_none=True, warn_unused=True, **kwargs
):
    """Builds the :class:`DatasetExporter` instance for the given parameters.

    Args:
        dataset_type: the :class:`fiftyone.types.Dataset` type
        strip_none (True): whether to exclude None-valued items from ``kwargs``
        warn_unused (True): whether to issue warnings for any non-None unused
            parameters encountered
        **kwargs: keyword arguments to pass to the dataset exporter's
            constructor via ``DatasetExporter(**kwargs)``

    Returns:
        a tuple of:

        -   the :class:`DatasetExporter` instance
        -   a dict of unused keyword arguments
    """
    if dataset_type is None:
        raise ValueError(
            "You must provide a `dataset_type` in order to build a dataset "
            "exporter"
        )

    if etau.is_str(dataset_type):
        dataset_type = etau.get_class(dataset_type)

    if inspect.isclass(dataset_type):
        dataset_type = dataset_type()

    dataset_exporter_cls = dataset_type.get_dataset_exporter_cls()

    if strip_none:
        kwargs = {k: v for k, v in kwargs.items() if v is not None}

    kwargs, unused_kwargs = fou.extract_kwargs_for_class(
        dataset_exporter_cls, kwargs
    )

    try:
        dataset_exporter = dataset_exporter_cls(**kwargs)
    except Exception as e:
        raise ValueError(
            "Failed to construct exporter of type %s using the provided "
            "parameters. See above for the error. You may need to supply "
            "additional mandatory arguments. Please consult the documentation "
            "of %s to learn more"
            % (dataset_exporter_cls, dataset_exporter_cls)
        ) from e

    if warn_unused:
        for key, value in unused_kwargs.items():
            if value is not None:
                logger.warning(
                    "Ignoring unsupported parameter '%s' for exporter type %s",
                    key,
                    dataset_exporter_cls,
                )

    return dataset_exporter, unused_kwargs
Builds the :class:`DatasetExporter` instance for the given parameters.

    Args:
        dataset_type: the :class:`fiftyone.types.Dataset` type
        strip_none (True): whether to exclude None-valued items from ``kwargs``
        warn_unused (True): whether to issue warnings for any non-None unused
            parameters encountered
        **kwargs: keyword arguments to pass to the dataset exporter's
            constructor via ``DatasetExporter(**kwargs)``

    Returns:
        a tuple of:

        -   the :class:`DatasetExporter` instance
        -   a dict of unused keyword arguments
    
fiftyone/utils/data/exporters.py