code: def test_group_sampler(
      dataloader: torch.utils.data.DataLoader,
  ) -> None:
      dataset = dataloader.dataset
      sampler = mh_mmdet.GroupSampler(dataset, 2, 1)
      flags = [dataset.flag[i] for i in sampler]  # type: ignore
      test = [flags[i] == flags[i + 1] for i in range(0, len(flags), 2)]
      assert all(test)
  
imports: import os
  import shutil
  from typing import Generator
  import git
  import pytest
  import torch
  import determined
  import determined.pytorch
  import model_hub.mmdetection
  import model_hub.mmdetection._callbacks
  import model_hub.utils
  from determined.common import util
label_desc: Use image node_id 7 for calling a global function with example usage: test_group_sampler(dataloader) without return types