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 []
def types ( subtag ) : if subtag in index : types = index [ subtag ] return [ type for type in types . keys ( ) if type != 'redundant' or type != 'grandfathered' ] else : return [ ]
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.