prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  feat: add stringify_pydantic_error util
  
  
  </issue>
  <code>
  [start of src/bk-user/bkuser/common/passwd/__init__.py]
  1 # -*- coding: utf-8 -*-
  2 """
  3 TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
  4 Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
  5 Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
  6 You may obtain a copy of the License at http://opensource.org/licenses/MIT
  7 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  8 an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  9 specific language governing permissions and limitations under the License.
  10 """
  11 from .exceptions import PasswordStrengthError
  12 from .generator import PasswordGenerator
  13 from .models import PasswordRule, ValidateResult
  14 from .validator import PasswordValidator
  15 
  16 __all__ = [
  17     # 密码规则
  18     "PasswordRule",
  19     # 密码生成器
  20     "PasswordGenerator",
  21     # 密码强度校验器
  22     "PasswordValidator",
  23     # 密码校验结果
  24     "ValidateResult",
  25     # 密码强度过低异常
  26     "PasswordStrengthError",
  27 ]
  28
  [end of src/bk-user/bkuser/common/passwd/__init__.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/src/bk-user/bkuser/common/passwd/__init__.py b/src/bk-user/bkuser/common/passwd/__init__.py
  --- a/src/bk-user/bkuser/common/passwd/__init__.py
  +++ b/src/bk-user/bkuser/common/passwd/__init__.py
  @@ -8,7 +8,7 @@
   an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
   specific language governing permissions and limitations under the License.
   """
  -from .exceptions import PasswordStrengthError
  +from .exceptions import PasswordGenerateError, PasswordStrengthError
   from .generator import PasswordGenerator
   from .models import PasswordRule, ValidateResult
   from .validator import PasswordValidator
  @@ -24,4 +24,6 @@
       "ValidateResult",
       # 密码强度过低异常
       "PasswordStrengthError",
  +    # 不合理的规则导致生成密码失败
  +    "PasswordGenerateError",
   ]
  
verification_info: {"golden_diff": "diff --git a/src/bk-user/bkuser/common/passwd/__init__.py b/src/bk-user/bkuser/common/passwd/__init__.py\n--- a/src/bk-user/bkuser/common/passwd/__init__.py\n+++ b/src/bk-user/bkuser/common/passwd/__init__.py\n@@ -8,7 +8,7 @@\n an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\n specific language governing permissions and limitations under the License.\n \"\"\"\n-from .exceptions import PasswordStrengthError\n+from .exceptions import PasswordGenerateError, PasswordStrengthError\n from .generator import PasswordGenerator\n from .models import PasswordRule, ValidateResult\n from .validator import PasswordValidator\n@@ -24,4 +24,6 @@\n     \"ValidateResult\",\n     # \u5bc6\u7801\u5f3a\u5ea6\u8fc7\u4f4e\u5f02\u5e38\n     \"PasswordStrengthError\",\n+    # \u4e0d\u5408\u7406\u7684\u89c4\u5219\u5bfc\u81f4\u751f\u6210\u5bc6\u7801\u5931\u8d25\n+    \"PasswordGenerateError\",\n ]\n", "issue": "feat: add stringify_pydantic_error util\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nTencentBlueKing is pleased to support the open source community by making \u84dd\u9cb8\u667a\u4e91-\u7528\u6237\u7ba1\u7406(Bk-User) available.\nCopyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.\nLicensed under the MIT License (the \"License\"); you may not use this file except in compliance with the License.\nYou may obtain a copy of the License at http://opensource.org/licenses/MIT\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on\nan \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n\"\"\"\nfrom .exceptions import PasswordStrengthError\nfrom .generator import PasswordGenerator\nfrom .models import PasswordRule, ValidateResult\nfrom .validator import PasswordValidator\n\n__all__ = [\n    # \u5bc6\u7801\u89c4\u5219\n    \"PasswordRule\",\n    # \u5bc6\u7801\u751f\u6210\u5668\n    \"PasswordGenerator\",\n    # \u5bc6\u7801\u5f3a\u5ea6\u6821\u9a8c\u5668\n    \"PasswordValidator\",\n    # \u5bc6\u7801\u6821\u9a8c\u7ed3\u679c\n    \"ValidateResult\",\n    # \u5bc6\u7801\u5f3a\u5ea6\u8fc7\u4f4e\u5f02\u5e38\n    \"PasswordStrengthError\",\n]\n", "path": "src/bk-user/bkuser/common/passwd/__init__.py"}]}