code: def _get_id2upper(id2upper, item_id, item_obj):
      
      if item_id in id2upper:
          return id2upper[item_id]
      upper_ids = set()
      for upper_obj in item_obj.get_goterms_upper():
          upper_id = upper_obj.item_id
          upper_ids.add(upper_id)
          upper_ids |= _get_id2upper(id2upper, upper_id, upper_obj)
      id2upper[item_id] = upper_ids
      return upper_ids
docs: Add the parent item IDs for one item object and their upper.