def _format_template_content(content, params):
 def arg_replace(matchobj):
  "Takes a regex matching {{{name}} and returns params['name']"
  param_name = matchobj.group(1)
  if (param_name in params):
   return params[param_name]
 return TEMPLATE_ARG_REGEX.sub(arg_replace, content)

def _format_template_content ( content , params ) : def arg_replace ( matchobj ) : param_name = matchobj . group ( 1 ) if ( param_name in params ) : return params [ param_name ] return TEMPLATE_ARG_REGEX . sub ( arg_replace , content )
formats a templates content using passed in arguments .