Get a :class:`language_tags.Subtag.Subtag` by subtag and type. Can be None if not exists.

        :param str subtag: subtag.
        :param str type: type of the subtag.
        :return: :class:`language_tags.Subtag.Subtag` if exists, otherwise None.

def type(subtag, type):
        """
        Get a :class:`language_tags.Subtag.Subtag` by subtag and type. Can be None if not exists.

        :param str subtag: subtag.
        :param str type: type of the subtag.
        :return: :class:`language_tags.Subtag.Subtag` if exists, otherwise None.
        """
        subtag = subtag.lower()
        if subtag in index:
            types = index[subtag]
            if type in types:
                return Subtag(subtag, type)
        return None