<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pattern_from_template(templates, name):
 """Return pattern for name Arguments: templates (dict):
 Current templates name (str):
 Name of name """


    if name not in templates:
        echo("No template named \"%s\"" % name)
        sys.exit(1)

    return templates[name]