code: def GatewayHeterogenity_metric(bpmn_graph):
      
  
      gateway_counts = get_gateway_counts(bpmn_graph)
      present_gateways = [gateway_name
                          for gateway_name, count in gateway_counts.items()
                          if count > 0]
  
      return len(present_gateways)
docs: 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.