code: def recursive_map(obj, function):
      if isinstance(obj, dict):
          return type(obj)(
              {k: recursive_map(v, function) for k, v in obj.items()}
          )
      elif isinstance(obj, list):
          return type(obj)([recursive_map(x, function) for x in obj])
      else:
          return function(obj)
  
imports: from __future__ import print_function, absolute_import
  import os
  import sys
  import logging
  import tempfile
  from time import time
  from functools import wraps
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: recursive_map(obj, function) and returns: type, type, function