<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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]
    )