def get_nodes_count(bpmn_graph, node_type=None):
    """
    Gets the count of nodes of the requested type.
    If no type is provided,
    the count of all nodes in BPMN diagram graph is returned.

    :param bpmn_graph: an instance of BpmnDiagramGraph representing BPMN model.
    :param node_type: string with valid BPMN XML tag name
                      (e.g. 'task', 'sequenceFlow').
    """

    return len(bpmn_graph.get_nodes(node_type=node_type))