how do i fill a blank keyframe with the keyframe that precedes it(note there are thousands of blank frames)?
answer based on previous question

import bpy
import math
bpy.ops.object.mode_set(mode = 'OBJECT')
bpy.ops.object.select_all(action='SELECT')

# get keyframes of object list
def get_keyframes(obj_list):
    keyframes = []
    for obj in obj_list:
        anim = obj.animation_data
        if anim is not None and anim.action is not None:
            for fcu in anim.action.fcurves:
                for keyframe in fcu.keyframe_points:
                    x, y = keyframe.co
                    if x not in keyframes:
                        keyframes.append((math.ceil(x)))
    return keyframes

def get_without_keyframes(frames):
    s = bpy.context.scene.frame_start
    e = bpy.context.scene.frame_end

    k =[]

    while s &lt;=e:
        if s not in frames:
            k.append(s)

        s+=1


    return k

# get all selected objects
selection = bpy.context.selected_objects

# check if selection is not empty
if selection:

    # get all frames with assigned keyframes
    keys = get_keyframes(selection)

    # print all keyframes
    print ("WHIT: ",keys.sort())   
    print ("WHITout: ",get_without_keyframes(keys))  

    # print first and last keyframe
    print ("{} {}".format("first keyframe:", keys[0]))
    print ("{} {}".format("last keyframe:", keys[-1]))

else:
    print ('nothing selected')