def diff(self, other):
        '''show differences of two trees

        return ([added object], [removed object], [modified object])
        '''
        added = []
        removed = []
        modified = []

        my_contents = dict(self.iteritems())
        for k, v in other.iteritems():
            if k in my_contents:
                my_v = my_contents[k]
                if my_v != v:
                    if isinstance(my_v, TreeObject):
                        a, r, m = my_v.diff(v)
                        added.extend(a)
                        removed.extend(r)
                        modified.extend(m)

                    else:
                        modified.append(my_v)

                del my_contents[k]

        added.extend(my_contents.values())

        return (added, removed, modified)
dataset/ETHPy150Open nakamuray/blikit/blikit/models.py/TreeObject.diff/original