code: def get_activation_function(activation_function):
      if not activation_function:
          return lambda a: a
  
      try:
          return getattr(tf.nn, activation_function)
      except AttributeError:
          raise ValueError(
              'Invalid activation function "{}"'.format(
                  activation_function
              )
          )
  
imports: import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: get_activation_function(activation_function) and returns: function, getattr