code: def test_split_dataset():
      train_ds, val_ds = DataModule._split_train_val(
          range(100), val_split=0.1
      )
      assert len(train_ds) == 90
      assert len(val_ds) == 10
      assert len(np.unique(train_ds.indices)) == len(train_ds.indices)
  
      class Dataset:
          def __init__(self):
              self.data = [0, 1, 2]
              self.name = "something"
              self.is_passed_down = False
  
          def __getitem__(self, index):
              return self.data[index]
  
          def __len__(self):
              return len(self.data)
  
      split_dataset = SplitDataset(Dataset(), indices=[0])
      assert split_dataset.name == "something"
  
      split_dataset.is_passed_down = True
      assert not split_dataset.dataset.is_passed_down
  
file_path: lightning-flash/tests/core/data/test_splits.py
imports: from copy import deepcopy
  import numpy
  import pytest
  from flash.core.data.data_module import DataModule
  from flash.core.data.splits import SplitDataset
  from flash.core.utilities.imports import _TOPIC_CORE_AVAILABLE
label_desc: Use image node_id 1 for calling a global function with example usage: test_split_dataset() and returns: self, len