'Check that the number of times that the given \'tab_type\' appears in \'tabs\' is less than or equal to \'max_num\'.'

@staticmethod
def _validate_num_tabs_of_type(tabs, tab_type, max_num):

    count = sum((1 for tab in tabs if (tab.get('type') == tab_type)))
    if (count > max_num):
        msg = "Tab    of    type    '{type}'    appears    {count}    time(s).    Expected    maximum    of    {max}    time(s).".format(type=tab_type, count=count, max=max_num)
        raise InvalidTabsException(msg)
