def METHOD_NAME(self, cls, exclude_inherited=False):
    commands = []
    for attr in dir(cls):
        # Some attributes will result in an AttributeError so we can skip them
        if not hasattr(cls, attr):
            continue
        method = getattr(cls, attr)
        # If it's not a callable method then we don't need to look at it
        if not callable(method):
            continue
        # Check if method has been exposed to the command graph
        if getattr(method, "_cmd", False):
            # If we're excluding inherited commands then check for them here
            if exclude_inherited and hasattr(command.base.CommandObject, method):
                continue
            commands.append(attr)
    return commands