code: def test_samples(
      fmodel_and_data: ModelAndData, batchsize: int, dataset: str
  ) -> None:
      fmodel, _, _ = fmodel_and_data
      if hasattr(fmodel, "data_format"):
          data_format = fmodel.data_format
          x, y = fbn.samples(
              fmodel, dataset=dataset, batchsize=batchsize
          )
          assert len(x) == len(y) == batchsize
          assert not ep.istensor(x)
          assert not ep.istensor(y)
          x, y = fbn.samples(
              fmodel, batchsize=batchsize, data_format=data_format
          )
          assert len(x) == len(y) == batchsize
          assert not ep.istensor(x)
          assert not ep.istensor(y)
          with pytest.raises(ValueError):
              data_format = {
                  "channels_first": "channels_last",
                  "channels_last": "channels_first",
              }[data_format]
              fbn.samples(
                  fmodel, batchsize=batchsize, data_format=data_format
              )
      else:
          x, y = fbn.samples(
              fmodel, batchsize=batchsize, data_format="channels_first"
          )
          assert len(x) == len(y) == batchsize
          assert not ep.istensor(x)
          assert not ep.istensor(y)
          with pytest.raises(ValueError):
              fbn.samples(fmodel, batchsize=batchsize)
  
imports: from typing import Tuple
  import foolbox
  import eagerpy
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_samples(fmodel_and_data, batchsize, dataset) without return types