def METHOD_NAME(color_files, depth_files, keys):
    if len(keys) == 0:
        raise RuntimeError("No key frames selected")
    if keys[-1] >= len(color_files):
        raise ValueError("keys[-1]: {} index out of range".format(keys[-1]))
    selected_color_files = []
    selected_depth_files = []
    for key in keys:
        selected_color_files.append(color_files[key])
        selected_depth_files.append(depth_files[key])
    return selected_color_files, selected_depth_files