def _parse_data_path(dataset_dir=None, data_path=None, default=None):
        """Helper function that computes default values for the ``data_path``
        parameter supported by many importers.
        """
        if data_path is None:
            if dataset_dir is not None:
                data_path = default

        if isinstance(data_path, dict):
            return data_path

        if data_path is not None:
            data_path = os.path.expanduser(data_path)

            if not os.path.isabs(data_path) and dataset_dir is not None:
                dataset_dir = fos.normalize_path(dataset_dir)
                data_path = os.path.join(dataset_dir, data_path)
            else:
                data_path = fos.normalize_path(data_path)

            if not os.path.exists(data_path):
                if os.path.isfile(data_path + ".json"):
                    data_path += ".json"

        return data_path
Helper function that computes default values for the ``data_path``
        parameter supported by many importers.
        
fiftyone/utils/data/importers.py