code: def get_task_stats(task):
      """Get the comment markdown for a stats table based on the task object."""
      task_status = task.get_status()
      # Try to get the task stats
      if task_status == "completed":
          table = create_comment_output(task, task_status)
          if table:
              return (
                  f"Results\n\n{table}\n\n"
                  f"You can view full task results [here]({task.get_output_log_web_page()})"
              )
          else:
              return (
                  f"Something went wrong when creating the task table. "
                  f"Check full task [here]({task.get_output_log_web_page()})"
              )
      # Update the user about the task status, can not get any stats
      else:
          return f"Task is in {task_status} status, this should not happen!"
  
file_path: clearml/examples/cicd/task_stats_to_comment.py
imports: import json
  import os
  import pandas
  from clearml import Task
  from github3 import login
  from tabulate import tabulate
label_desc: Use image node_id 4 for calling a global function with example usage: get_task_stats(task) and returns: str, task_status, str, str, table, str, task, str, str, task, str