def get_lemma_id(your_fn,
                 lemma,
                 pos):
    """
    FrameNet stores an identifier for each lemma.pos combination.
    In this function, we retrieve it or generate a new one.
    """
    chosen_lemma_id = None
    target = f'{lemma}.{pos.lower()}'
    for lu_id, lemma_pos in your_fn.lu_ids_and_names().items():
        if lemma_pos == target:
            lu = your_fn.lu(lu_id)
            chosen_lemma_id = lu.lemmaID
            break

    if chosen_lemma_id is None:
        lemma_ids = set()
        for lu in your_fn.lus():
            lemma_ids.add(lu.lemmaID)

        if lemma_ids:
            maximum = max(lemma_ids)
        else:
            maximum = 0
        chosen_lemma_id = maximum + 1

    return chosen_lemma_id