code: def test_suggested_max_num_workers_not_triggering_torch_warning(
      local_world_size, cpu_count, monkeypatch
  ):
      """Test that our suggestion for num workers doesn't trigger a warning in the DataLoader for too many workers."""
      monkeypatch.delattr(
          lightning.fabric.utilities.data.os,
          "sched_getaffinity",
          raising=False,
      )
      monkeypatch.delattr(
          torch.utils.data.dataloader.os,
          "sched_getaffinity",
          raising=False,
      )
      monkeypatch.setattr(
          lightning.fabric.utilities.data.os,
          "cpu_count",
          lambda: cpu_count,
      )
      monkeypatch.setattr(
          torch.utils.data.dataloader.os, "cpu_count", lambda: cpu_count
      )
  
      # The dataloader runs a check in `DataLoader.check_worker_number_rationality`
      with pytest.warns(
          UserWarning, match="This DataLoader will create"
      ):
          DataLoader(range(2), num_workers=(cpu_count + 1))
      with no_warning_call():
          DataLoader(
              range(2),
              num_workers=suggested_max_num_workers(local_world_size),
          )
  
imports: import contextlib
  import os
  import random
  from unittest import mock
  from unittest.mock import Mock
  import lightning.fabric
  import numpy
  import pytest
  import torch
  from lightning.fabric.utilities.data import AttributeDict, _get_dataloader_init_args_and_kwargs, _replace_dunder_methods, _replace_value_in_saved_args, _set_sampler_epoch, _update_dataloader, _WrapAttrTag, has_iterable_dataset, has_len, suggested_max_num_workers
  from lightning.fabric.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
  from tests_fabric.helpers.models import RandomDataset, RandomIterableDataset
label_desc: Use image node_id 19 for calling a global function with example usage: test_suggested_max_num_workers_not_triggering_torch_warning(local_world_size, cpu_count, monkeypatch) without return types