code: def test_dataloader_kwargs_replacement_with_array_default_comparison():
      """Test that the comparison of attributes and default argument values works with arrays (truth value ambiguous).
  
      Regression test for issue #15408.
  
      """
      dataset = RandomDataset(5, 100)
  
      class ArrayAttributeDataloader(DataLoader):
          def __init__(self, indices=None, **kwargs):
              super().__init__(dataset)
              self.indices = np.random.rand(
                  2, 2
              )  # an attribute we can't compare with ==
  
      dataloader = ArrayAttributeDataloader(dataset)
      _, dl_kwargs = _get_dataloader_init_args_and_kwargs(
          dataloader, dataloader.sampler
      )
      assert dl_kwargs["indices"] is dataloader.indices
  
imports: from dataclasses import dataclass
  from unittest.mock import Mock
  import numpy
  import pytest
  import torch
  from lightning.fabric.utilities.data import _replace_dunder_methods
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import RandomDataset, RandomIterableDataset
  from lightning.pytorch.overrides.distributed import _IndexBatchSamplerWrapper
  from lightning.pytorch.trainer.states import RunningStage
  from lightning.pytorch.utilities.data import _get_dataloader_init_args_and_kwargs, _update_dataloader, extract_batch_size, has_len_all_ranks, warning_cache
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning_utilities.test.warning import no_warning_call
  from torch import Tensor
  from torch.utils.data import BatchSampler, DataLoader, RandomSampler
label_desc: Use image node_id 10 for calling a global function with example usage: test_dataloader_kwargs_replacement_with_array_default_comparison() without return types