def get_output_path(self, input_path=None, output_ext=None):
        """Returns a unique output path.

        Args:
            input_path (None): an input path
            output_ext (None): an optional output extension to use

        Returns:
            the output path
        """
        found_input = bool(input_path)

        if found_input:
            input_path = fos.normalize_path(input_path)

            if self.idempotent:
                # Adding ignore extension to idempotent check
                if self.ignore_exts:
                    input_path_sans_ext, input_path_ext = os.path.splitext(
                        input_path
                    )

                    matched_output_path = next(
                        (
                            o
                            for i, o in self._filepath_map.items()
                            if os.path.splitext(i)[0] == input_path_sans_ext
                        ),
                        None,
                    )

                    if matched_output_path is not None:
                        return_path, _ = os.path.splitext(matched_output_path)
                        return return_path + input_path_ext

                elif input_path in self._filepath_map:
                    return self._filepath_map[input_path]

        self._idx += 1

        if not found_input:
            filename = self._default_filename_patt % self._idx
        elif self.rel_dir is not None:
            filename = safe_relpath(input_path, self.rel_dir)
        else:
            filename = os.path.basename(input_path)

        name, ext = os.path.splitext(filename)

        # URL handling
        # @todo improve this, while still maintaining Unix/Windows path support
        name = name.replace("%", "-")
        ext = ext.split("?")[0]

        if output_ext is not None:
            ext = output_ext

        filename = name + ext

        key = name if self.ignore_exts else filename
        self._filename_counts[key] += 1

        count = self._filename_counts[key]
        if count > 1:
            filename = name + ("-%d" % count) + ext

        if self.chunk_size is not None:
            chunk_dir = self._chunk_root + "_" + str(self._chunk_num)
            filename = os.path.join(chunk_dir, filename)

            self._chunk_count += 1
            if self._chunk_count >= self.chunk_size:
                self._chunk_num += 1
                self._chunk_count = 0

        if self.output_dir:
            output_path = os.path.join(self.output_dir, filename)
        else:
            output_path = filename

        if found_input:
            self._filepath_map[input_path] = output_path

        return output_path
Returns a unique output path.

        Args:
            input_path (None): an input path
            output_ext (None): an optional output extension to use

        Returns:
            the output path
        
fiftyone/core/utils.py