Get the types of a subtag string (excludes redundant and grandfathered).


        :param str subtag: subtag.
        :return: list of types. The return list can be empty.

def types(subtag):
        """
        Get the types of a subtag string (excludes redundant and grandfathered).


        :param str subtag: subtag.
        :return: list of types. The return list can be empty.
        """
        if subtag in index:
            types = index[subtag]
            return [type for type in types.keys() if type != 'redundant' or type != 'grandfathered']
        else:
            return []