code: def fill_parentidid2obj_r0(self, id2obj, child_obj):
          
          for parent_obj in child_obj.parents:
              if parent_obj.item_id not in id2obj:
                  id2obj[parent_obj.item_id] = parent_obj
                  self.fill_parentidid2obj_r0(id2obj, parent_obj)
docs: Fill id2obj with all parent key item IDs and their objects.