docs: def format_output(instances, flag):
      """return formatted string for instance"""
      out = []
      line_format = '{0}\t{1}\t{2}\t{3}\t{4}'
      name_len = _get_max_name_len(instances) + 3
      if flag:
          line_format = '{0:<' + str(name_len) + '}{1:<16}{2:<21}{3:<16}{4:<16}'
  
      for i in instances:
          tag_name = get_tag_value(i.tags, 'Name')
          out.append(line_format.format(
              tag_name, i.state['Name'], i.id, i.private_ip_address, str(i.public_ip_address)))
      return out