def GatewayHeterogenity_metric(bpmn_graph):
gateway_counts = get_gateway_counts(bpmn_graph)<EOL>present_gateways = [gateway_name<EOL>for gateway_name, count in gateway_counts.items()<EOL>if count > <NUM_LIT:0>]<EOL>return len(present_gateways)<EOL>
Returns the value of the Gateway Heterogenity metric
("Number of different types of gateways used in a mode")
for the BPMNDiagramGraph instance.

:param bpmn_graph: an instance of BpmnDiagramGraph representing BPMN model.