code: def format(self, obj, **kwargs):
          
          sio = StringIO()
          self.fprint(obj, stream=sio, **kwargs)
          return sio.getvalue()
docs: Return the formatted representation of the object as a string.