code: def _ensure_header_written(self):
      if not self._nframeswritten:
          if not self._nchannels:
              raise Error("# of channels not specified")
          if not self._sampwidth:
              raise Error("sample width not specified")
          if not self._framerate:
              raise Error("frame rate not specified")
          self._write_header()
  
imports: from collections import namedtuple
  import warnings
label_desc: Use image node_id 23 for calling the Au_write obj's underlying member method code with example usage: obj._ensure_header_written() without return types