code: def display(self, typ, data):
          
          if hasattr(self, 'print_' + typ):
              getattr(self, 'print_' + typ)(data)
  
          elif not data:
              self._print("%s: %s" % (typ, data))
  
          elif isinstance(data, collections.Mapping):
              self._print("\n", typ)
              for k, v in data.items():
                  self.print(k, v)
  
          elif isinstance(data, (list, tuple)):
              # tabular data layout for lists of dicts
              if isinstance(data[0], collections.Mapping):
                  self.display_set(typ, data, self._get_columns(data[0]))
              else:
                  for each in data:
                      self.print(typ, each)
          else:
              self._print("%s: %s" % (typ, data))
  
          self.fobj.flush()
docs: display section of typ with data