code: def test_nested_map(x, fn, shallow):
      x_copy = copy.deepcopy(x)
      result = ivy.nested_map(fn, x, shallow=shallow)
      map_nested_dicts(x_copy, fn)
  
      assert result == x_copy
      if shallow:
          assert x == x_copy
      else:
          assert x != x_copy
  
imports: import copy
  import warnings
  import pytest
  import numpy
  import ivy
label_desc: Use image node_id 19 for calling a global function with example usage: test_nested_map(x, fn, shallow) without return types