code: 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 []
docs: 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.