def get_assignment_similarities(context_documents, ending_documents, similarity_measure):
    """
    Given two dicts of the form (key -> embedding) where both dicts share the same set of keys, returns the
    similarities between documents of the same key as a list.
    :param context_documents:
    :param ending_documents:
    :param similarity_measure:
    :return a list of the cosine similarities between each context and ending of the same id
    """
    similarities = []
    for doc_id in context_documents.keys():
        context = context_documents[doc_id]
        ending = ending_documents[doc_id]
        similarities.append(similarity_measure.get_similarity(context, ending))
    return similarities