code: def create_uid_dataset(
      dataset: Dataset,
      uid_dataset_cls: Type[_UidDataset] | None,
      uidd_args: List | None,
      uidd_kwargs: Dict | None,
  ):
      if isinstance(dataset, _UidDataset) and uid_dataset_cls is None:
          return dataset
      else:
          uid_dataset_cls = (
              IndexedDataset
              if uid_dataset_cls is None
              else uid_dataset_cls
          )
          assert issubclass(uid_dataset_cls, _UidDataset)
          uidd_args = uidd_args if uidd_args is not None else []
          uidd_kwargs = uidd_kwargs if uidd_kwargs is not None else {}
          return uid_dataset_cls(dataset, *uidd_args, **uidd_kwargs)
  
imports: from __future__ import annotations
  from collections import defaultdict
  from typing import Any, Callable, Dict, List, Type
  import torch
  from torch.utils.data import Dataset, IterableDataset
  from .utils import _default_get_rngs_state, _default_set_rngs_state, _default_manual_seed
label_desc: Use image node_id 1 for calling a global function with example usage: create_uid_dataset(dataset, uid_dataset_cls, uidd_args, uidd_kwargs) and returns: dataset, uid_dataset_cls