code: def get_representatives(level: list, representatives: dict):
      unique = dict()
      for job in level:
          if job.rule.name in unique:
              representatives[job] = unique[job.rule.name]
          else:
              representatives[job] = job
              unique[job.rule.name] = job
      return sorted(unique.values(), key=lambda job: job.rule.name)
  
label_desc: Use image node_id 2 for calling a global function with example usage: get_representatives(level, representatives) and returns: sorted