code: def samples(
      fmodel: Model,
      dataset: str = "imagenet",
      index: int = 0,
      batchsize: int = 1,
      shape: Tuple[int, int] = (224, 224),
      data_format: Optional[str] = None,
      bounds: Optional[Bounds] = None,
  ) -> Any:
      if hasattr(fmodel, "data_format"):
          if data_format is None:
              data_format = fmodel.data_format
          elif data_format != fmodel.data_format:
              raise ValueError(
                  f"data_format ({data_format}) does not match model.data_format ({fmodel.data_format})"
              )
      elif data_format is None:
          raise ValueError(
              "data_format could not be inferred, please specify it explicitly"
          )
  
      if bounds is None:
          bounds = fmodel.bounds
  
      images, labels = _samples(
          dataset=dataset,
          index=index,
          batchsize=batchsize,
          shape=shape,
          data_format=data_format,
          bounds=bounds,
      )
  
      if hasattr(fmodel, "dummy") and fmodel.dummy is not None:
          images = ep.from_numpy(fmodel.dummy, images).raw
          labels = ep.from_numpy(fmodel.dummy, labels).raw
      else:
          warnings.warn(
              f"unknown model type {type(fmodel)}, returning NumPy arrays"
          )
  
      return images, labels
  
file_path: foolbox/foolbox/utils.py
imports: from typing import Optional, Tuple, Any
  import eagerpy
  import warnings
  import os
  import numpy
  from .types import Bounds
  from .models import Model
label_desc: Use image node_id 2 for calling a global function with example usage: samples(fmodel, dataset, index, batchsize, shape, data_format, bounds) and returns: images,  labels