code: def test_pytorch_adapt_batch_sampler():
      def check_equality(batch0, batch1):
          for a, b in zip(batch0, batch1):
              assert torch.eq(a, b)
  
      offset = 2
  
      dataloader = det.pytorch.DataLoader(make_dataset())
      data_adapter = dataloader.get_data_loader(
          repeat=True, skip=offset
      )
  
      data = make_data_loader()
      iterator = iter(data)
      inf_iterator = iter(data_adapter)
  
      # Advance the iterator by offset batches.
      for _ in range(offset):
          next(iterator)
  
      # Verify indefinite generator with offset.
  
      for batch in iterator:
          n = next(inf_iterator)
          for pair in zip(batch, n):
              assert torch.all(torch.eq(pair[0], pair[1]))
  
      for _ in range(3):
          for batch in iter(data):
              n = next(inf_iterator)
              for pair in zip(batch, n):
                  assert torch.all(torch.eq(pair[0], pair[1]))
  
imports: import logging
  import queue
  import typing
  from logging import handlers
  import numpy
  import pytest
  import torch
  import determined
  from determined.pytorch import data_length, samplers, to_device
label_desc: Use image node_id 11 for calling a global function with example usage: test_pytorch_adapt_batch_sampler() without return types