def count_variants(graph):
    """Count how many of each type of variant a graph has.

    :param pybel.BELGraph graph: A BEL graph
    :rtype: Counter
    """
    return Counter(
        variant_data[KIND]
        for data in graph
        if has_variant(graph, data)
        for variant_data in data[VARIANTS]
    )
Count how many of each type of variant a graph has.

    :param pybel.BELGraph graph: A BEL graph
    :rtype: Counter