{% set def = "async def" if async_mode else "def" %}
{% set async_prefix = "a" if async_mode else "" %}
{% set await = "await " if async_mode else "" %}
{% set async_class = "Async" if async_mode else "" %}
{% macro escape_str(s) %}'{{ s|replace("'", "\\'") }}'{% endmacro %}
{% set kwargs_declaration = "**kwargs: Any" %}
{% set extend_all = "__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore" %}
{% macro patch_imports(try_except=False) %}
{% set indentation = "    " if try_except else "" %}
{% if try_except %}
try:
{% endif %}
{{ indentation }}from ._patch import __all__ as _patch_all
{{ indentation }}from ._patch import *
{% if try_except %}
except ImportError:
    _patch_all = []
{% endif %}
from ._patch import patch_sdk as _patch_sdk{% endmacro %}
{% macro path_type_checking_imports() %}
# pylint: disable=wrong-import-position

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from ._patch import *  # pylint: disable=unused-wildcard-import
{% endmacro %}
