def __dedup_search_list(self, items_by_target):
        clean_items_by_target = defaultdict(list)

        for target, items in items_by_target.items():
            merge_items = defaultdict(list)
            for item in items:
                if item['type'] == "pushplans":
                    clean_items_by_target[target].append(item)
                else:
                    merge_items[item['type']].append(item)

            for type_, items in merge_items.iteritems():
                if 1 > len(items):
                    users = set(item['user'] for item in items)
                    ids = [str(item['id']) for item in items]
                    is_complete = all([item['complete'] for item in items])
                    merged_item = {
                        "target": target,
                        "type": type_,
                        "complete": is_complete,
                        "id": u",".join(ids),
                        "request": 0,  # this key is not used by template/js
                        "title": u"multiple requests",
                        "repo": u"multiple repositories",
                        "branch": u'multiple branches',
                        "user": u",".join(users)
                    }
                    clean_items_by_target[target].append(merged_item)
                elif len(items) == 1:
                    clean_items_by_target[target].append(items[0])

        return dict(clean_items_by_target)
dataset/ETHPy150Open YelpArchive/pushmanager/pushmanager/servlets/checklist.py/ChecklistServlet.__dedup_search_list/swapped operands of `>`