code: def map_tree(fn, tree, *args):
      """Maps `fn` over the leaves of a nested structure."""
      return tf.nest.map_structure(fn, tree, *args)
  
imports: import functools
  import numpy
  import six
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 1 for calling a global function with example usage: map_tree(fn, tree) and returns: tf