def compute_avg_wmd_distance(contexts1, contexts2, gensim_obj):
    """
    Compute an average word metric distance
    :param contexts1: List of ContextAndEntities objects extracted from Document 1
    :param contexts2: List of ContextAndEntities objects extracted from Document 2
    :param gensim_obj: a Gensim object initialized with a word2vec model
                       e.g. gensim_obj = api.load('word2vec-google-news-300')
    :return: Dictionary with keys for the 'max' WMD, 'min' WMD, and 'avg' WMD for all
             combinations of contexts. Returns None if the average WMD cannot be calculated
    """
    distances = list()
    context_combinations = 0

    if len(contexts1) == 0:
        return None
    if len(contexts2) == 0:
        return None

    # Calculate the distance for every combination of contexts we have been passed
    for c1 in contexts1:
        for c2 in contexts2:
            sc1 = c1.sentence_as_string
            sc2 = c2.sentence_as_string
            context_combinations += 1
            distances.append(gensim_obj.wmdistance(sc1, sc2))

    if len(distances) > 0:
        avg_distance = sum(distances) / len(distances)
    else:
        return None

    max_distance = max(distances)
    min_distance = min(distances)

    return {'max': max_distance, 'min': min_distance, 'avg': avg_distance,
            'number_of_combinations': context_combinations}