code: def test_map_nested_structure_mutable():
      # Single elem
      test_value = torch.rand((20, 4))
      out_value = map_nested_structure(
          test_value, mapping=lambda x: x, in_place=True
      )
      assert test_value is out_value
  
      test_value = torch.rand((20, 4))
      out_value = map_nested_structure(
          test_value, mapping=lambda x: x, in_place=False
      )
      assert test_value is not out_value
  
      # List
      test_value = [torch.rand((20, 4))]
      out_value = map_nested_structure(
          test_value, mapping=lambda x: x, in_place=True
      )
      assert test_value is out_value
  
      test_value = [torch.rand((20, 4))]
      out_value = map_nested_structure(
          test_value, mapping=lambda x: x, in_place=False
      )
      assert test_value is not out_value
  
      test_value = [torch.rand((2, 4))]
      out_value = map_nested_structure(
          test_value, mapping=lambda x: x, in_place=False
      )
      test_value[0] *= 2
      assert test_value is not out_value
  
file_path: maze/maze/test/perception/test_perception_utils.py
imports: import numpy
  import pytest
  import torch
  from gym import spaces
  from maze.perception.perception_utils import flatten_spaces, observation_spaces_to_in_shapes, map_nested_structure, convert_to_torch, convert_to_numpy, stack_and_flatten_spaces
label_desc: Use image node_id 3 for calling a global function with example usage: test_map_nested_structure_mutable() without return types