<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expand(template_str, dictionary, **kwargs):
 """Free function to expands a template string with a data dictionary. This is useful for cases where you don't care about saving the result of compilation (similar to re.match('.*', s) vs DOT_STAR.match(s)) """

    t = Template(template_str, **kwargs)
    return t.expand(dictionary)