def get_variant(self, index=None):
for variant in self.iter_variants():<EOL><INDENT>if variant.index == index:<EOL><INDENT>return variant<EOL><DEDENT><DEDENT>
Get the variant with the associated index.

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