def show_modules(config, modules_list):
details = config["<STR_LIT>"]<EOL>core_mods = not config["<STR_LIT:user>"]<EOL>user_mods = not config["<STR_LIT>"]<EOL>modules = core_module_docstrings(<EOL>include_core=core_mods, include_user=user_mods, config=config<EOL>)<EOL>new_modules = []<EOL>if modules_list:<EOL><INDENT>from fnmatch import fnmatch<EOL>for _filter in modules_list:<EOL><INDENT>for name in modules.keys():<EOL><INDENT>if fnmatch(name, _filter):<EOL><INDENT>if name not in new_modules:<EOL><INDENT>new_modules.append(name)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>new_modules = modules.keys()<EOL><DEDENT>for name in sorted(new_modules):<EOL><INDENT>module = _to_docstring(modules[name])<EOL>desc = module[<NUM_LIT:0>][:-<NUM_LIT:1>]<EOL>if details:<EOL><INDENT>dash_len = len(name) + <NUM_LIT:4><EOL>print("<STR_LIT:#>" * dash_len)<EOL>print("<STR_LIT>".format(name))<EOL>print("<STR_LIT:#>" * dash_len)<EOL>for description in module:<EOL><INDENT>print(description[:-<NUM_LIT:1>])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print("<STR_LIT>" % (name, desc))<EOL><DEDENT><DEDENT>
List modules available optionally with details.