docs: def format_license(template, lang):
      """ Format the StringIO template object for specified lang string:
          return StringIO object formatted
      """
      if not lang:
          lang = 'txt'
      out = StringIO()
      template.seek(0)  # from the start of the buffer
      out.write(LANG_CMT[LANGS[lang]][0] + u'\n')
      for line in template.readlines():
          out.write(LANG_CMT[LANGS[lang]][1] + u' ')
          out.write(line)
      out.write(LANG_CMT[LANGS[lang]][2] + u'\n')
      template.close()  # force garbage collector
      return out