code: def xfail_on_windows(
      reason: str, raises: Optional[Type[Exception]] = None
  ):
      """
      Decorator to flag tests that we expect to fail on Windows.
  
      Will not raise an error if the expected error happens while running on Windows machine.
      If error is expected but does not happen, the test fails as well.
  
      Args:
          reason (`str`):
              Reason why it should fail.
          raises (`Type[Exception]`):
              The error type we except to happen.
      """
  
      def _inner_decorator(test_function: Callable) -> Callable:
          return pytest.mark.xfail(
              os.name == "nt",
              reason=reason,
              raises=raises,
              strict=True,
              run=True,
          )(test_function)
  
      return _inner_decorator
  
imports: import inspect
  import os
  import shutil
  import stat
  import time
  import unittest
  import uuid
  from contextlib import contextmanager
  from enum import Enum
  from functools import wraps
  from pathlib import Path
  from typing import Callable, Optional, Type, TypeVar, Union
  from unittest.mock import Mock, patch
  import pytest
  import requests
  from huggingface_hub.utils import is_gradio_available, logging, reset_sessions
  from tests.testing_constants import ENDPOINT_PRODUCTION, ENDPOINT_PRODUCTION_URL_SCHEME
label_desc: Use image node_id 11 for calling a global function with example usage: xfail_on_windows(reason, raises) and returns: _inner_decorator, pytest