code: def _format_inputs_dataset(
      inputs_dataset: Union[Tuple[Any, ...], DataLoader]
  ):
      # if `inputs_dataset` is not a `DataLoader`, turn it into one.
      # `_DatasetFromList` turns a list into a `Dataset` where `__getitem__`
      # returns an element in the list, and using it to construct a `DataLoader`
      # with `batch_size=None` gives a `DataLoader` that yields a single batch.
      if not isinstance(inputs_dataset, DataLoader):
          inputs_dataset = DataLoader(
              _DatasetFromList([inputs_dataset]),
              shuffle=False,
              batch_size=None,
          )
      return inputs_dataset
  
imports: import warnings
  from functools import reduce
  from typing import Any, Callable, Iterable, List, NamedTuple, Optional, Tuple, TYPE_CHECKING, Union
  import torch
  import torch.nn
  from captum._utils.common import _get_module_from_name, _parse_version
  from captum._utils.gradient import _compute_jacobian_wrt_params, _compute_jacobian_wrt_params_with_sample_wise_trick
  from captum._utils.progress import progress
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, Dataset
label_desc: Use image node_id 6 for calling a global function with example usage: _format_inputs_dataset(inputs_dataset) and returns: inputs_dataset