code: def fold_text(self, prefix, hidden, postfix="", file=None, align=0):
          
          if file is None:
              file = sys.stdout
          # Extra logic: Multi-line hidden. Add initial "\n" if not there.
          if "\n" in hidden:
              if hidden[:1] != "\n":
                  hidden = "\n" + hidden
          # Extra logic: A final "\n" of hidden, make it always visible such that it looks nicer.
          if hidden[-1:] == "\n":
              hidden = hidden[:-1]
              postfix += "\n"
          if self.is_domterm():
              with self.logical_block(file=file):
                  self.indentation(file=file)
                  self.hide_button(file=file)
                  file.write(prefix)
                  if prefix.endswith("\x1b[0m"):
                      file.write(" ")  # bug in DomTerm?
                  with self.hide_button_span(2, file=file):
                      hidden_ls = hidden.split("\n")
                      hidden_ls = [s[align:] for s in hidden_ls]
                      hidden = "\033]118\007".join(hidden_ls)
                      file.write(hidden)
          else:
              file.write(prefix)
              file.write(hidden.replace("\n", "\n "))
          file.write(postfix)
          file.flush()
docs: :param str prefix: always visible
          :param str hidden: hidden
              If this is sys.stdout, it will replace that stream,
              and collect the data during the context (in the `with` block).
          :param str postfix: always visible, right after. "" by default.
          :param io.TextIOBase|io.StringIO file: sys.stdout by default.
          :param int align: remove this number of initial chars from hidden