def format():
argparser = argparse.ArgumentParser(description='<STR_LIT>')<EOL>argparser.add_argument('<STR_LIT>', metavar='<STR_LIT>', help='<STR_LIT>', nargs='<STR_LIT:?>')<EOL>arguments = argparser.parse_args()<EOL>service_style = "<STR_LIT>"<EOL>host_style = "<STR_LIT>"<EOL>ranges_style = "<STR_LIT>"<EOL>users_style = "<STR_LIT>"<EOL>if arguments.format:<EOL><INDENT>format_input(arguments.format)<EOL><DEDENT>else:<EOL><INDENT>doc_mapper = DocMapper()<EOL>if doc_mapper.is_pipe:<EOL><INDENT>for obj in doc_mapper.get_pipe():<EOL><INDENT>style = '<STR_LIT>'<EOL>if isinstance(obj, Range):<EOL><INDENT>style = ranges_style<EOL><DEDENT>elif isinstance(obj, Host):<EOL><INDENT>style = host_style<EOL><DEDENT>elif isinstance(obj, Service):<EOL><INDENT>style = service_style<EOL><DEDENT>elif isinstance(obj, User):<EOL><INDENT>style = users_style<EOL><DEDENT>print_line(fmt.format(style, **obj.to_dict(include_meta=True)))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print_error("<STR_LIT>")<EOL><DEDENT><DEDENT>
Formats the output of another tool in the given way.
Has default styles for ranges, hosts and services.