def get_variants_from_log(trace_log, attribute_key="concept:name"):
    """
    Gets a dictionary whose key is the variant and as value there
    is the list of traces that share the variant

    Parameters
    ----------
    trace_log
        Trace log
    attribute_key
        Field that identifies the attribute (must be provided if different from concept:name)

    Returns
    ----------
    variant
        Dictionary with variant as the key and the list of traces as the value
    """
    variants = {}
    for trace in trace_log:
        variant = ",".join([x[attribute_key] for x in trace if attribute_key in x])
        if not variant in variants:
            variants[variant] = []
        variants[variant].append(trace)
    return variants