code: def test_flatten_unflatten_depth_2_or_more():
      datasets = [range(1), [range(2), [range(3)]]]
      flat, spec = _tree_flatten(datasets)
      assert flat == [range(1), range(2), range(3)]
      unflattened = tree_unflatten(flat, spec)
      assert unflattened == datasets
  
      datasets = [[1], [[2], [[3]]]]
      flat, spec = _tree_flatten(datasets)
      assert flat == [[1], [2], [3]]
      unflattened = tree_unflatten(flat, spec)
      assert unflattened == datasets
  
      datasets = [1, [2, [3]]]
      flat, spec = _tree_flatten(datasets)
      # [3] is a container of all primitives so it is treated as a leaf
      assert flat == [1, 2, [3]]
      unflattened = tree_unflatten(flat, spec)
      assert unflattened == datasets
  
imports: import torch
  from lightning.pytorch.utilities._pytree import _tree_flatten, tree_unflatten
  from torch.utils.data import DataLoader, TensorDataset
label_desc: Use image node_id 3 for calling a global function with example usage: test_flatten_unflatten_depth_2_or_more() without return types