{{ log.debug() }}
{% if config.show_if_no_docstring or function.has_contents %}

  <div class="doc doc-object doc-function">
  {% with html_id = function.path %}

    {% if not root or config.show_root_heading %}

      {% if root %}
        {% set show_full_path = config.show_root_full_path %}
        {% set root_members = True %}
      {% elif root_members %}
        {% set show_full_path = config.show_root_members_full_path or config.show_object_full_path %}
        {% set root_members = False %}
      {% else %}
        {% set show_full_path = config.show_object_full_path %}
      {% endif %}

      <h{{ heading_level }}
          id="{{ html_id }}"
          class="doc doc-heading"
          data-toc-label="{{ function.name }}()">

        {% filter highlight(language="python", inline=True) %}
          {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}
          {% with signature = function.signature %}{% include "signature.html" with context %}{% endwith %}
        {% endfilter %}

        {% with properties = function.properties %}
          {% include "properties.html" with context %}
        {% endwith %}

      </h{{ heading_level }}>

    {% else %}
      {% if config.show_root_toc_entry %}
        <h{{ heading_level }} class="hidden-toc"
            id="{{ html_id }}"
            data-toc-label="{{ function.path }}"
            style="visibility: hidden; position: absolute;">
        </h{{ heading_level }}>
      {% endif %}
      {% set heading_level = heading_level - 1 %}
    {% endif %}

    <div class="doc doc-contents {% if root %}first{% endif %}">
      {% with docstring_sections = function.docstring_sections %}
        {% include "docstring.html" with context %}
      {% endwith %}

      {% if config.show_source and function.source %}
        <details class="quote">
          <summary>Source code in <code>{{ function.relative_file_path }}</code></summary>
          {{ function.source.code|highlight(language="python", line_start=function.source.line_start) }}
        </details>
      {% endif %}
    </div>

  {% endwith %}
  </div>

{% endif %}
