code: def test_distributed_sampler_with_overfit_batches():
      model = BoringModel()
      trainer = Trainer(
          overfit_batches=1,
          accelerator="cpu",
          devices=2,
          strategy="ddp_spawn",
      )
      model.trainer = trainer
      trainer.strategy.connect(model)
      trainer._data_connector.attach_dataloaders(model)
      trainer.fit_loop.setup_data()
      train_sampler = trainer.train_dataloader.sampler
      assert isinstance(train_sampler, DistributedSampler)
      assert train_sampler.shuffle is False
  
file_path: pytorch-lightning/tests/tests_pytorch/trainer/flags/test_overfit_batches.py
imports: import os
  from unittest import mock
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.trainer.states import RunningStage
  from torch.utils.data import DataLoader, DistributedSampler, RandomSampler, Sampler, SequentialSampler
  from tests_pytorch.helpers.datamodules import ClassifDataModule
  from tests_pytorch.helpers.datasets import SklearnDataset
  from tests_pytorch.helpers.runif import RunIf
  from tests_pytorch.helpers.simple_models import ClassificationModel
label_desc: Use image node_id 5 for calling a global function with example usage: test_distributed_sampler_with_overfit_batches() without return types