prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  DeprecationWarning for distutils in Python 3.10 (will be removed in Python 3.12)
  <!--- Provide a general summary of the issue in the Title above -->
  <!--- How has this issue affected you? What are you trying to accomplish? -->
  
  **What were you trying to accomplish?**
  
  Run tests utilizing aws-lambda-powertools.
  
  ## Expected Behavior
  <!--- If you're describing a bug, tell us what should happen -->
  <!--- If you're suggesting a change/improvement, tell us how it should work -->
  
  No DeprecationWarning to appear.
  
  ## Current Behavior
  <!--- If describing a bug, tell us what happens instead of the expected behavior -->
  <!--- If suggesting a change/improvement, explain the difference from current behavior -->
  
  When running tests (specifically using `pytest`) that import `aws_lamdba_powertools`, a `DeprecationWarning` appears.
  
  ```
  .../aws_lambda_powertools/shared/functions.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.util import strtobool
  ```
  
  ## Possible Solution
  <!--- Not obligatory, but suggest a fix/reason for the bug, -->
  <!--- or ideas how to implement the addition or change -->
  
  The only function used out of distutils is `strtobool`, and it is only used in one place, so that logic can simply be copied into the `resolve_truthy_env_var_choice` function in `aws_lambda_powertools.shared.functions`.
  
  ## Steps to Reproduce (for bugs)
  <!--- Provide a link to a live example, or an unambiguous set of steps to -->
  <!--- reproduce this bug. Include code to reproduce, if relevant -->
  1. Use python3.10
  2. Activate a new venv (`python3.10 -m venv .venv` and `. .venv/bin/activate`)
  3. `pip install aws-lambda-powertools pytest`
  4. `echo "import aws_lambda_powertools" > reproduce.py`
  5. `pytest reproduce.py`
  
  ## Environment
  
  * **Powertools version used**: `1.22.0`
  * **Packaging format (Layers, PyPi)**: PyPi
  
  This warning appears in development workflows, but will be eventually breaking when Python 3.12 is released.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `aws_lambda_powertools/shared/functions.py`
  Content:
  ```
  1 from distutils.util import strtobool
  2 from typing import Any, Optional, Union
  3 
  4 
  5 def resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:
  6     """Pick explicit choice over truthy env value, if available, otherwise return truthy env value
  7 
  8     NOTE: Environment variable should be resolved by the caller.
  9 
  10     Parameters
  11     ----------
  12     env : str
  13         environment variable actual value
  14     choice : bool
  15         explicit choice
  16 
  17     Returns
  18     -------
  19     choice : str
  20         resolved choice as either bool or environment value
  21     """
  22     return choice if choice is not None else strtobool(env)
  23 
  24 
  25 def resolve_env_var_choice(env: Any, choice: Optional[Any] = None) -> Union[bool, Any]:
  26     """Pick explicit choice over env, if available, otherwise return env value received
  27 
  28     NOTE: Environment variable should be resolved by the caller.
  29 
  30     Parameters
  31     ----------
  32     env : Any
  33         environment variable actual value
  34     choice : bool
  35         explicit choice
  36 
  37     Returns
  38     -------
  39     choice : str
  40         resolved choice as either bool or environment value
  41     """
  42     return choice if choice is not None else env
  43
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/aws_lambda_powertools/shared/functions.py b/aws_lambda_powertools/shared/functions.py
  --- a/aws_lambda_powertools/shared/functions.py
  +++ b/aws_lambda_powertools/shared/functions.py
  @@ -1,7 +1,16 @@
  -from distutils.util import strtobool
   from typing import Any, Optional, Union
   
   
  +def strtobool(value):
  +    value = value.lower()
  +    if value in ("y", "yes", "t", "true", "on", "1"):
  +        return 1
  +    elif value in ("n", "no", "f", "false", "off", "0"):
  +        return 0
  +    else:
  +        raise ValueError("invalid truth value %r" % (value,))
  +
  +
   def resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:
       """Pick explicit choice over truthy env value, if available, otherwise return truthy env value
  
verification_info: {"golden_diff": "diff --git a/aws_lambda_powertools/shared/functions.py b/aws_lambda_powertools/shared/functions.py\n--- a/aws_lambda_powertools/shared/functions.py\n+++ b/aws_lambda_powertools/shared/functions.py\n@@ -1,7 +1,16 @@\n-from distutils.util import strtobool\n from typing import Any, Optional, Union\n \n \n+def strtobool(value):\n+    value = value.lower()\n+    if value in (\"y\", \"yes\", \"t\", \"true\", \"on\", \"1\"):\n+        return 1\n+    elif value in (\"n\", \"no\", \"f\", \"false\", \"off\", \"0\"):\n+        return 0\n+    else:\n+        raise ValueError(\"invalid truth value %r\" % (value,))\n+\n+\n def resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:\n     \"\"\"Pick explicit choice over truthy env value, if available, otherwise return truthy env value\n", "issue": "DeprecationWarning for distutils in Python 3.10 (will be removed in Python 3.12)\n<!--- Provide a general summary of the issue in the Title above -->\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n\r\n**What were you trying to accomplish?**\r\n\r\nRun tests utilizing aws-lambda-powertools.\r\n\r\n## Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\n\r\nNo DeprecationWarning to appear.\r\n\r\n## Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\n\r\nWhen running tests (specifically using `pytest`) that import `aws_lamdba_powertools`, a `DeprecationWarning` appears.\r\n\r\n```\r\n.../aws_lambda_powertools/shared/functions.py:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives\r\n    from distutils.util import strtobool\r\n```\r\n\r\n## Possible Solution\r\n<!--- Not obligatory, but suggest a fix/reason for the bug, -->\r\n<!--- or ideas how to implement the addition or change -->\r\n\r\nThe only function used out of distutils is `strtobool`, and it is only used in one place, so that logic can simply be copied into the `resolve_truthy_env_var_choice` function in `aws_lambda_powertools.shared.functions`.\r\n\r\n## Steps to Reproduce (for bugs)\r\n<!--- Provide a link to a live example, or an unambiguous set of steps to -->\r\n<!--- reproduce this bug. Include code to reproduce, if relevant -->\r\n1. Use python3.10\r\n2. Activate a new venv (`python3.10 -m venv .venv` and `. .venv/bin/activate`)\r\n3. `pip install aws-lambda-powertools pytest`\r\n4. `echo \"import aws_lambda_powertools\" > reproduce.py`\r\n5. `pytest reproduce.py`\r\n\r\n## Environment\r\n\r\n* **Powertools version used**: `1.22.0`\r\n* **Packaging format (Layers, PyPi)**: PyPi\r\n\r\nThis warning appears in development workflows, but will be eventually breaking when Python 3.12 is released.\n", "before_files": [{"content": "from distutils.util import strtobool\nfrom typing import Any, Optional, Union\n\n\ndef resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:\n    \"\"\"Pick explicit choice over truthy env value, if available, otherwise return truthy env value\n\n    NOTE: Environment variable should be resolved by the caller.\n\n    Parameters\n    ----------\n    env : str\n        environment variable actual value\n    choice : bool\n        explicit choice\n\n    Returns\n    -------\n    choice : str\n        resolved choice as either bool or environment value\n    \"\"\"\n    return choice if choice is not None else strtobool(env)\n\n\ndef resolve_env_var_choice(env: Any, choice: Optional[Any] = None) -> Union[bool, Any]:\n    \"\"\"Pick explicit choice over env, if available, otherwise return env value received\n\n    NOTE: Environment variable should be resolved by the caller.\n\n    Parameters\n    ----------\n    env : Any\n        environment variable actual value\n    choice : bool\n        explicit choice\n\n    Returns\n    -------\n    choice : str\n        resolved choice as either bool or environment value\n    \"\"\"\n    return choice if choice is not None else env\n", "path": "aws_lambda_powertools/shared/functions.py"}], "after_files": [{"content": "from typing import Any, Optional, Union\n\n\ndef strtobool(value):\n    value = value.lower()\n    if value in (\"y\", \"yes\", \"t\", \"true\", \"on\", \"1\"):\n        return 1\n    elif value in (\"n\", \"no\", \"f\", \"false\", \"off\", \"0\"):\n        return 0\n    else:\n        raise ValueError(\"invalid truth value %r\" % (value,))\n\n\ndef resolve_truthy_env_var_choice(env: str, choice: Optional[bool] = None) -> bool:\n    \"\"\"Pick explicit choice over truthy env value, if available, otherwise return truthy env value\n\n    NOTE: Environment variable should be resolved by the caller.\n\n    Parameters\n    ----------\n    env : str\n        environment variable actual value\n    choice : bool\n        explicit choice\n\n    Returns\n    -------\n    choice : str\n        resolved choice as either bool or environment value\n    \"\"\"\n    return choice if choice is not None else strtobool(env)\n\n\ndef resolve_env_var_choice(env: Any, choice: Optional[Any] = None) -> Union[bool, Any]:\n    \"\"\"Pick explicit choice over env, if available, otherwise return env value received\n\n    NOTE: Environment variable should be resolved by the caller.\n\n    Parameters\n    ----------\n    env : Any\n        environment variable actual value\n    choice : bool\n        explicit choice\n\n    Returns\n    -------\n    choice : str\n        resolved choice as either bool or environment value\n    \"\"\"\n    return choice if choice is not None else env\n", "path": "aws_lambda_powertools/shared/functions.py"}]}