'Add a frame.
Args:
frame (Frame): the frame to add
strict (bool): if this should raise in case it can\'t be added
and frames shouldn\'t be merged.'

def _add(self, frame, strict):

    if (not isinstance(frame, Frame)):
        raise TypeError(('%r    not    a    Frame    instance' % frame))
    orig_frame = frame
    frame = frame._upgrade_frame()
    if (frame is None):
        if (not strict):
            return
        raise TypeError(("Can't    upgrade    %r    frame" % type(orig_frame).__name__))
    hash_key = frame.HashKey
    if (strict or (hash_key not in self)):
        self[hash_key] = frame
        return
    while True:
        old_frame = self[hash_key]
        new_frame = old_frame._merge_frame(frame)
        new_hash = new_frame.HashKey
        if (new_hash == hash_key):
            self[hash_key] = new_frame
            break
        else:
            assert (new_frame is frame)
            if (new_hash not in self):
                self[new_hash] = new_frame
                break
            hash_key = new_hash
