code: def format_blocks_section(self):
          
          buf = io.StringIO()
          buf.write('blocks\n')
          buf.write('(\n')
          for b in self.blocks.values():
              buf.write('    ' + b.format(self.vertices) + '\n')
          buf.write(');')
          return buf.getvalue()
docs: format blocks section.
          assign_vertexid() should be called before this method, because
          vertices reffered by blocks should have valid index.