code: def render_with_template(
      text=None, filename=None, preprocessor=None, template_kwargs={}
  ):
      from mako.template import Template
      from mako import exceptions
  
      tmpl = Template(
          text=text, filename=filename, preprocessor=preprocessor
      )
      try:
          return tmpl.render(**template_kwargs)
      except Exception as e:
          import sys
  
          print("-" * 78, file=sys.stderr)
          print("Template exceptions", file=sys.stderr)
          print("-" * 78, file=sys.stderr)
          print(
              exceptions.text_error_template().render(), file=sys.stderr
          )
          print("-" * 78, file=sys.stderr)
          raise e
  
imports: from __future__ import print_function
  from collections import OrderedDict
  from os.path import abspath, join, dirname, exists
  from utils.common import check_update
  from utils.type_conv import type_from_proto
  import time
  import yaml
label_desc: Use image node_id 3 for calling a global function with example usage: render_with_template(text, filename, preprocessor, template_kwargs) and returns: tmpl