def is_model_admin_subclass(node):
    """Checks that node is derivative of ModelAdmin class."""
    if node.name[-5:] != 'Admin' or isinstance(node.parent, ClassDef):
        return False

    return node_is_subclass(node, 'django.contrib.admin.options.ModelAdmin')
def is_model_admin_subclass ( node ) : if node . name [ - 5 : ] != 'Admin' or isinstance ( node . parent , ClassDef ) : return False return node_is_subclass ( node , 'django.contrib.admin.options.ModelAdmin' )
Checks that node is derivative of ModelAdmin class.