def METHOD_NAME(candidates: [dict], mask=None):
    contexts = []
    for candidate in candidates:
        context = candidate["contexts"][0]
        if mask:
            context = context.replace(candidate["words_in_contexts"][0], mask)
        contexts.append(context)
    return contexts