code: def test_encode_model_with_pure_windows_path():
      class ModelWithPath(BaseModel):
          path: PureWindowsPath
  
          if PYDANTIC_V2:
              model_config = {"arbitrary_types_allowed": True}
          else:
  
              class Config:
                  arbitrary_types_allowed = True
  
      obj = ModelWithPath(path=PureWindowsPath("/foo", "bar"))
      assert jsonable_encoder(obj) == {"path": "\\foo\\bar"}
  
imports: from collections import deque
  from dataclasses import dataclass
  from datetime import datetime, timezone
  from decimal import Decimal
  from enum import Enum
  from pathlib import PurePath, PurePosixPath, PureWindowsPath
  from typing import Optional
  import pytest
  from fastapi._compat import PYDANTIC_V2
  from fastapi.encoders import jsonable_encoder
  from pydantic import BaseModel, Field, ValidationError
  from .utils import needs_pydanticv1, needs_pydanticv2
label_desc: Use image node_id 16 for calling a global function with example usage: test_encode_model_with_pure_windows_path() without return types