{% set params_str = params | join(', ') %}
{% set signature_len = 4 + method_name | length + params_str | length + return_type | length + 6 %}
{% if signature_len > 88 or params | length > 4 %}
def {{ method_name }}(
{% for param in params %}
    {{ param }},
{% endfor %}
) -> {{ return_type }}:
{% else %}
def {{ method_name }}({{ params_str }}) -> {{ return_type }}:
{% endif %}
{% if docstring %}
    """
{{ docstring | indent(4, first=True) }}
    """
{% endif %}
{% for line in body_lines %}
    {{ line }}
{% endfor %}
