def get_variant(variant_handle, context=None):
if isinstance(variant_handle, dict):<EOL><INDENT>variant_handle = ResourceHandle.from_dict(variant_handle)<EOL><DEDENT>variant_resource = package_repository_manager.get_resource_from_handle(variant_handle)<EOL>variant = Variant(variant_resource, context=context)<EOL>return variant<EOL>
Create a variant given its handle (or serialized dict equivalent)

    Args:
        variant_handle (`ResourceHandle` or dict): Resource handle, or
            equivalent serialized dict representation from
            ResourceHandle.to_dict
        context (`ResolvedContext`): The context this variant is associated
            with, if any.

    Returns:
        `Variant`.