<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_template_dirs():
 """Return a set of all template directories."""

    temp_glob = rel_to_cwd('templates', '**', 'templates', 'config.yaml')
    temp_groups = glob(temp_glob)
    temp_groups = [get_parent_dir(path, 2) for path in temp_groups]
    return set(temp_groups)