Get the variant with the associated index.

        Returns:
            `Variant` object, or None if no variant with the given index exists.

def get_variant(self, index=None):
        """Get the variant with the associated index.

        Returns:
            `Variant` object, or None if no variant with the given index exists.
        """
        for variant in self.iter_variants():
            if variant.index == index:
                return variant