def with_options(cls, **options):
        r"""
        Returns a subclass with alternative constructor that extends any original keyword
        arguments to the original constructor with the given options.
        """

        class cls_with_options(cls):  # type: ignore[misc, valid-type]
            def __init__(self, *args, **kwargs):
                kwargs.update(options)
                super().__init__(*args, **kwargs)

        return cls_with_options

        Returns a subclass with alternative constructor that extends any original keyword
        arguments to the original constructor with the given options.
        
intel_extension_for_pytorch/xpu/cpp_extension.py