<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_commands(mod):

 """
 Find commands from a module
 """

    import inspect
    import types

    commands = {}

    def check(c):
        return (inspect.isclass(c) and
            issubclass(c, Command) and c is not Command and not issubclass(c, CommandManager))

    for name in dir(mod):
        c = getattr(mod, name)
        if check(c):
            commands[c.name] = c

    return commands