def print_tools(self, buf=sys.stdout, verbose=False, context_name=None):
def _get_row(entry):<EOL><INDENT>context_name_ = entry["<STR_LIT>"]<EOL>tool_alias = entry["<STR_LIT>"]<EOL>tool_name = entry["<STR_LIT>"]<EOL>properties = []<EOL>col = None<EOL>variant = entry["<STR_LIT>"]<EOL>if isinstance(variant, set):<EOL><INDENT>properties.append("<STR_LIT>")<EOL>col = critical<EOL>if verbose:<EOL><INDENT>package = "<STR_LIT:U+002CU+0020>".join(x.qualified_package_name for x in variant)<EOL><DEDENT>else:<EOL><INDENT>v = next(iter(variant))<EOL>package = "<STR_LIT>" % (v.qualified_package_name,<EOL>len(variant) - <NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>package = variant.qualified_package_name<EOL><DEDENT>if tool_name == tool_alias:<EOL><INDENT>tool_name = "<STR_LIT:->"<EOL><DEDENT>else:<EOL><INDENT>properties.append("<STR_LIT>")<EOL>if col is None:<EOL><INDENT>col = alias_col<EOL><DEDENT><DEDENT>msg = "<STR_LIT:U+0020>".join(properties)<EOL>row = [tool_alias, tool_name, package, context_name_, msg]<EOL>return row, col<EOL><DEDENT>if context_name:<EOL><INDENT>self._context(context_name)  <EOL>context_names = [context_name]<EOL><DEDENT>else:<EOL><INDENT>context_names = sorted(self.contexts.keys())<EOL><DEDENT>rows = [["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"],<EOL>["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]]<EOL>colors = [None, None]<EOL>entries_dict = defaultdict(list)<EOL>for d in self.get_tools().values():<EOL><INDENT>entries_dict[d["<STR_LIT>"]].append(d)<EOL><DEDENT>if verbose:<EOL><INDENT>for d in self.hidden_tools:<EOL><INDENT>d_ = d.copy()<EOL>d_["<STR_LIT>"] = True<EOL>entries_dict[d["<STR_LIT>"]].append(d_)<EOL><DEDENT>for docs in self.tool_conflicts.values():<EOL><INDENT>for d in docs:<EOL><INDENT>d_ = d.copy()<EOL>d_["<STR_LIT>"] = True<EOL>entries_dict[d["<STR_LIT>"]].append(d_)<EOL><DEDENT><DEDENT><DEDENT>for i, context_name in enumerate(context_names):<EOL><INDENT>entries = entries_dict.get(context_name, [])<EOL>if entries:<EOL><INDENT>if i:<EOL><INDENT>rows.append(('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'))<EOL>colors.append(None)<EOL><DEDENT>entries = sorted(entries, key=lambda x: x["<STR_LIT>"].lower())<EOL>for entry in entries:<EOL><INDENT>row, col = _get_row(entry)<EOL>if "<STR_LIT>" in entry:<EOL><INDENT>row[-<NUM_LIT:1>] = "<STR_LIT>"<EOL>rows.append(row)<EOL>colors.append(warning)<EOL><DEDENT>elif "<STR_LIT>" in entry:<EOL><INDENT>row[-<NUM_LIT:1>] = "<STR_LIT>"<EOL>rows.append(row)<EOL>colors.append(warning)<EOL><DEDENT>else:<EOL><INDENT>rows.append(row)<EOL>colors.append(col)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if rows:<EOL><INDENT>_pr = Printer(buf)<EOL>for col, line in zip(colors, columnise(rows)):<EOL><INDENT>_pr(line, col)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>_pr("<STR_LIT>")<EOL><DEDENT>
Print table of tools available in the suite.

        Args:
            context_name (str): If provided, only print the tools from this
                context.