code: def collect_trainable_variables(modules):
      """Collects all trainable variables of modules.
  
      Trainable variables included in multiple modules occur only once in the
      returned list.
  
      Args:
          modules: A (list of) instance of the subclasses of
              :class:`~texar.tf.modules.ModuleBase`.
  
      Returns:
          A list of trainable variables in the modules.
      """
      if not isinstance(modules, (list, tuple)):
          modules = [modules]
  
      var_list = []
      for mod in modules:
          add_variable(mod.trainable_variables, var_list)
  
      return var_list
  
imports: import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: collect_trainable_variables(modules) and returns: var_list