code: def get_data_loader(
      model: GPyTorchModel, batch_size: int = 1024, **kwargs: Any
  ) -> DataLoader:
      dataset = TensorDataset(*model.train_inputs, model.train_targets)
      return DataLoader(
          dataset=dataset,
          batch_size=min(batch_size, len(model.train_targets)),
          **kwargs,
      )
  
file_path: botorch/botorch/optim/utils/model_utils.py
imports: from __future__ import annotations
  from re import Pattern
  from typing import Any, Callable, Dict, Iterator, NamedTuple, Optional, Tuple, Union
  from warnings import warn
  import torch
  from botorch.exceptions.warnings import BotorchWarning
  from botorch.models.gpytorch import GPyTorchModel
  from torch import Tensor
  from torch.nn import Module
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_loader(model, batch_size) and returns: DataLoader