code: def toc(self):
          
          fails = ""
          skips = ""
  
          if len(self.failed()):
              faillist = list()
              for failure in self.failed():
                  faillist.append(
                      """
                      <li>
                          <a href="#{anchor}">{name}</a>
                      </li>
                      """.format(anchor=failure.anchor(),
                                 name=tag.text(
                                     failure.testclass.name + '.' + failure.name)))
  
              fails = """
              <li>Failures
              <ul>{faillist}</ul>
              </li>
              """.format(faillist="".join(faillist))
  
          if len(self.skipped()):
              skiplist = list()
              for skipped in self.skipped():
                  skiplist.append(
                      """
                      <li>
                          <a href="#{anchor}">{name}</a>
                      </li>
                      """.format(anchor=skipped.anchor(),
                                 name=tag.text(
                                     skipped.testclass.name + skipped.name)))
  
              skips = """
              <li>Skipped
              <ul>{skiplist}</ul>
              </li>
              """.format(skiplist="".join(skiplist))
  
          classlist = list()
          for classname in self.classes:
              testclass = self.classes[classname]
  
              cases = list()
              for testcase in testclass.cases:
                  if "pkcs11" in testcase.name:
                      assert True
  
                  cases.append(
                      """
                      <li>
                          <a href="#{anchor}">{name}</a>
                      </li>
                      """.format(anchor=testcase.anchor(),
                                 name=tag.text(testcase.name)))
  
              classlist.append("""
              <li>
                  <a href="#{anchor}">{name}</a>
                  <ul>
                  {cases}
                  </ul>
              </li>
              """.format(anchor=testclass.anchor(),
                         name=testclass.name,
                         cases="".join(cases)))
  
          return """
          <ul>
              {failed}
              {skips}
              <li>All Test Classes
              <ul>{classlist}</ul>
              </li>
          </ul>
          """.format(failed=fails,
                     skips=skips,
                     classlist="".join(classlist))
docs: Return a html table of contents
          :return: