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
def get_variant ( self , index = None ) : for variant in self . iter_variants ( ) : if variant . index == index : return variant
Get the variant with the associated index.

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