def get_commands_from_module(imported):
<EOL>imported_vars = vars(imported)<EOL>if "<STR_LIT>" in imported_vars:<EOL><INDENT>imported_vars = [<EOL>(name, imported_vars[name]) for name in<EOL>imported_vars if name in imported_vars["<STR_LIT>"]]<EOL><DEDENT>else:<EOL><INDENT>imported_vars = imported_vars.items()<EOL><DEDENT>cmd_dict = extract_commands(imported_vars)<EOL>return imported.__doc__, cmd_dict<EOL>
从传入的 ``imported`` 中获取所有 ``click.core.Command``

:param module imported: 导入的Python包
:return: 包描述文档，仅含终端命令函数的对象字典
:rtype: (str, dict(str, object))