def METHOD_NAME(
    pairs_and_poses,
) -> List[Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]]:
    pairs, poses, camera, _, _, _ = pairs_and_poses
    pairs = sorted(zip(pairs.values(), poses.values()), key=lambda x: -len(x[0]))
    num_pairs = 20
    indices = [np.random.randint(0, len(pairs) - 1) for i in range(num_pairs)]
    ret_pairs = []
    for idx in indices:
        pair = pairs[idx]
        p1 = np.array([x for x, _ in pair[0]])
        p2 = np.array([x for _, x in pair[0]])
        p1 = p1.reshape(-1, p1.shape[-1])
        p2 = p2.reshape(-1, p2.shape[-1])
        f1 = camera.pixel_bearing_many(p1)
        f2 = camera.pixel_bearing_many(p2)
        pose = pair[1]
        R = pose.get_rotation_matrix()
        t_x = multiview.cross_product_matrix(pose.get_origin())
        e = R.dot(t_x)
        e /= np.linalg.norm(e)
        ret_pairs.append((f1, f2, e, pose))
    return ret_pairs