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

  <div class="doc doc-object doc-class">
  {% with html_id = class.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 %}

      {% filter heading(heading_level,
          role="class",
          id=html_id,
          class="doc doc-heading",
          toc_label=class.name) %}

        <code>
          {% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
          {% if config.show_bases and class.bases and class.bases != ['object'] %}
            ({% for base in class.bases -%}
              {{ base|brief_xref() }}{% if not loop.last %}, {% endif %}
             {% endfor %})
          {% endif %}
        </code>

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

      {% endfilter %}

    {% else %}
      {% if config.show_root_toc_entry %}
        {% filter heading(heading_level,
            role="class",
            id=html_id,
            toc_label=class.path,
            hidden=True) %}
        {% endfilter %}
      {% endif %}
      {% set heading_level = heading_level - 1 %}
    {% endif %}

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

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

      {% with obj = class %}
        {% set root = False %}
        {% set heading_level = heading_level + 1 %}
        {% include "children.html" with context %}
      {% endwith %}
    </div>

  {% endwith %}
  </div>

{% endif %}
