code: def convert_layer_class(layer_class):
      """
      If layer instance is callable, return layer, otherwise convert to TF type
      :param layer: layer to be converted
      :return: converted layer if not callable, otherwise layer itself
      """
      if hasattr(layer_class, "to_tf_instance"):
          return layer_class
      else:
          return tf_layer_class_dict[layer_class]()
  
imports: import math
  from types import FunctionType
  import tensorflow
  from rl_coach.architectures import layers
  from rl_coach.architectures.tensorflow_components import utils
label_desc: Use image node_id 5 for calling a global function with example usage: convert_layer_class(layer_class) and returns: layer_class, tf_layer_class_dict