def METHOD_NAME(inputFrameData, frameData, inputOffsetData, offsetData, animGroupData):
    mapping = {}
    for idx, frame in enumerate(inputFrameData):
        dupe_idx = -1
        for check_idx, check_frame in enumerate(frameData):
            frames_equal = True
            # perform a check to see if they're equal
            if len(frame) == len(check_frame):
                for ii in range(len(frame)):
                    if (
                        frame[ii].imgIndex != check_frame[ii].imgIndex
                        or frame[ii].attr0 != check_frame[ii].attr0
                        or frame[ii].attr1 != check_frame[ii].attr1
                        or frame[ii].attr2 != check_frame[ii].attr2
                    ):
                        frames_equal = False
                        break
            else:
                frames_equal = False
            if frames_equal:
                dupe_idx = check_idx
                break
        if dupe_idx > -1:
            mapping[idx] = dupe_idx
        else:
            mapping[idx] = len(frameData)
            frameData.append(frame)
            offsetData.append(inputOffsetData[idx])
    for animGroup in animGroupData:
        for anim in animGroup:
            for animFrame in anim:
                animFrame.frameIndex = mapping[animFrame.frameIndex]