code: def test_combined_dataset_no_length():
      class Foo:
          # map-style
          def __len__(self):
              return 5
  
      class Bar:
          # iterable style
          ...
  
      class Baz:
          # None length
          def __len__(self):
              pass
  
      cl = CombinedLoader(
          [DataLoader(Foo()), DataLoader(Bar()), DataLoader(Baz())]
      )
      assert cl._dataset_length() == 5
  
      cl = CombinedLoader(DataLoader(Bar()))
      with pytest.raises(
          NotImplementedError, match="All datasets are iterable-style"
      ):
          cl._dataset_length()
  
imports: import math
  import pickle
  from typing import Any, NamedTuple, Sequence, get_args
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset
  from lightning.pytorch.utilities.combined_loader import _LITERAL_SUPPORTED_MODES, _SUPPORTED_MODES, CombinedLoader, _MaxSize, _MaxSizeCycle, _MinSize, _Sequential
  from torch import Tensor
  from torch.utils._pytree import tree_flatten
  from torch.utils.data import DataLoader, TensorDataset
  from torch.utils.data.dataset import Dataset, IterableDataset
  from torch.utils.data.distributed import DistributedSampler
  from torch.utils.data.sampler import RandomSampler, SequentialSampler
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 2 for calling a global function with example usage: test_combined_dataset_no_length() and returns: int