import coral

def count_diagrams(project):
    elements = project.contents()
    num_of_diagrams = 0

    for elem in elements:
        if elem.oclIsKindOf(coral.lang.XMIDI20.Diagram):
            num_of_diagrams = num_of_diagrams + 1

    return num_of_diagrams


def count_classes(project):
    elements = project.contents()[0].__getAllParts__()
    num_of_classes = 0

    for elem in elements:
        if elem.oclIsKindOf(coral.lang.UML14.Class):
            num_of_classes = num_of_classes + 1
    return num_of_classes
