def METHOD_NAME(diagram, parent=None):
    if subject_class:
        element_factory = diagram.model
        subject = element_factory.create(subject_class)
    else:
        subject = None
    item = diagram.create(item_class, subject=subject)
    if parent and subject and group(parent.subject, item.subject):
        item.change_parent(parent)
    if config_func:
        config_func(item)
    return item