def create_new_dataset_with_unique_name(
        self,
        dataset_basename: str,
        dataset_type: str = DatasetType.IMAGES,
    ) -> None:
        """Creates a new dataset on the Lightly Platform.

        If a dataset with the specified name already exists,
        the name is suffixed by a counter value.

        Args:
            dataset_basename:
                The name of the dataset to be created.
            dataset_type:
                The type of the dataset. We recommend to use the API provided
                constants `DatasetType.IMAGES` and `DatasetType.VIDEOS`.

        Examples:
            >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
            >>>
            >>> # Create a dataset with a brand new name.
            >>> client.create_new_dataset_with_unique_name("new-dataset")
            >>> client.get_dataset_by_id(client.dataset_id)
            {'id': '6470abef4f0eb7e635c30954',
             'name': 'new-dataset',
             ...}
            >>>
            >>> # Create another dataset with the same name. This time, the
            >>> # new dataset should have a suffix `_1`.
            >>> client.create_new_dataset_with_unique_name("new-dataset")
            >>> client.get_dataset_by_id(client.dataset_id)
            {'id': '6470ac194f0eb7e635c30990',
             'name': 'new-dataset_1',
             ...}

        """
        if not self.dataset_name_exists(dataset_name=dataset_basename):
            self._create_dataset_without_check_existing(
                dataset_name=dataset_basename,
                dataset_type=dataset_type,
            )
        else:
            existing_datasets = list(
                utils.paginate_endpoint(
                    self._datasets_api.get_datasets_query_by_name,
                    dataset_name=dataset_basename,
                    exact=False,
                    shared=False,
                )
            )
            existing_dataset_names = {dataset.name for dataset in existing_datasets}
            counter = 1
            dataset_name = f"{dataset_basename}_{counter}"
            while dataset_name in existing_dataset_names:
                counter += 1
                dataset_name = f"{dataset_basename}_{counter}"
            self._create_dataset_without_check_existing(
                dataset_name=dataset_name,
                dataset_type=dataset_type,
            )
Creates a new dataset on the Lightly Platform.

        If a dataset with the specified name already exists,
        the name is suffixed by a counter value.

        Args:
            dataset_basename:
                The name of the dataset to be created.
            dataset_type:
                The type of the dataset. We recommend to use the API provided
                constants `DatasetType.IMAGES` and `DatasetType.VIDEOS`.

        Examples:
            >>> client = ApiWorkflowClient(token="MY_AWESOME_TOKEN")
            >>>
            >>> # Create a dataset with a brand new name.
            >>> client.create_new_dataset_with_unique_name("new-dataset")
            >>> client.get_dataset_by_id(client.dataset_id)
            {'id': '6470abef4f0eb7e635c30954',
             'name': 'new-dataset',
             ...}
            >>>
            >>> # Create another dataset with the same name. This time, the
            >>> # new dataset should have a suffix `_1`.
            >>> client.create_new_dataset_with_unique_name("new-dataset")
            >>> client.get_dataset_by_id(client.dataset_id)
            {'id': '6470ac194f0eb7e635c30990',
             'name': 'new-dataset_1',
             ...}

        
lightly/api/api_workflow_datasets.py