code: def category_failures(self) -> List[Dict]:
      failure_blocks = []
  
      MAX_ERROR_TEXT = (
          3000
          - len("The following examples had failures:\n\n\n\n")
          - len("[Truncated]\n")
      )
      line_length = 40
      category_failures = {
          k: v["failed"]
          for k, v in doc_test_results.items()
          if isinstance(v, dict)
      }
  
      def single_category_failures(category, failures):
          text = ""
          if len(failures) == 0:
              return ""
          text += (
              f"*{category} failures*:".ljust(line_length // 2).rjust(
                  line_length // 2
              )
              + "\n"
          )
  
          for idx, failure in enumerate(failures):
              new_text = text + f"`{failure}`\n"
              if len(new_text) > MAX_ERROR_TEXT:
                  text = text + "[Truncated]\n"
                  break
              text = new_text
  
          return text
  
      for category, failures in category_failures.items():
          report = single_category_failures(category, failures)
          if len(report) == 0:
              continue
          block = {
              "type": "section",
              "text": {
                  "type": "mrkdwn",
                  "text": f"The following examples had failures:\n\n\n{report}\n",
              },
          }
          failure_blocks.append(block)
  
      return failure_blocks
  
imports: import collections
  import json
  import math
  import os
  import re
  import time
  from fnmatch import fnmatch
  from typing import Dict, List
  import requests
  from slack_sdk import WebClient
label_desc: Use image node_id 6 for calling the Message obj's underlying member method code with example usage: obj.category_failures() and returns: failure_blocks, text, str