class_docstr: This class provides basic functionality to generate code. It is
  language-agnostic, but exposes set of attributes which subclasses should
  use to define syntax specific for certain language(s).
  
  !!IMPORTANT!!: Code generators must know nothing about AST.
class_docstr_tok: ["This","class","provides","basic","functionality","to","generate","code",".","It","is","language-agnostic",",","but","exposes","set","of","attributes","which","subclasses","should","use","to","define","syntax","specific","for","certain","language","(","s",")",".","!","!","IMPORTANT","!","!",":","Code","generators","must","know","nothing","about","AST","."]
code: def _write_to_code_buffer(self, text, prepend=False):
      if self._code_buf.closed:
          raise BufferError(
              "Cannot modify code after getting generated code and closing the underlying buffer!\n"
              "Call reset_state() to allocate new buffer."
          )
      if prepend:
          self._code_buf.seek(0)
          old_content = self._code_buf.read()
          self._code_buf.seek(0)
          text += old_content
      self._code_buf.write(text)
  
imports: from io import StringIO
  from weakref import finalize
  import numpy
  from m2cgen.interpreters.utils import format_float
label_desc: Use image node_id 4 for calling the BaseCodeGenerator obj's underlying member method code with example usage: obj._write_to_code_buffer(text, prepend) without return types