code: def substitute(script, submap):
  
      
  
      match = config.TEMPLATE_RE.search(script)
      if match:
          template_type = match.groupdict()['type']
          try:
              return config.TEMPLATE_TYPEMAP[template_type](script, submap)
          except KeyError:
              logger.error('Unsupported template type: %s' % template_type)
              raise
      return script
docs: Check for presence of template indicator and if found, perform
      variable substition on script based on template type, returning
      script.