def tech_level(template_group):
    """Returns the maximum tech level of the template group."""

    tl = 0
    for template in template_group:
        for build_order in template:
            tl = max(tl, build_order.unit.tech_level)
    return tl