code: def tasks_by_state(self):
      tasks_by_state = collections.defaultdict(dict)
      for task_name, task in self.job.tasks.items():
          state = task.status().combined_state
          tasks_by_state[state][task_name] = task
      return tasks_by_state
  
imports: import collections
  import csv
  import operator
  import fnmatch
  import functools
  import time
  import click
  import requests
  from archery.utils.report import JinjaReport
label_desc: Use image node_id 6 for calling the Report obj's underlying member method code with example usage: obj.tasks_by_state() and returns: tasks_by_state