code: def setsampwidth(self, sampwidth):
      if self._nframeswritten:
          raise Error(
              "cannot change parameters after starting to write"
          )
      if sampwidth not in (1, 2, 3, 4):
          raise Error("bad sample width")
      self._sampwidth = sampwidth
  
imports: from collections import namedtuple
  import warnings
label_desc: Use image node_id 8 for calling the Au_write obj's underlying member method code with example usage: obj.setsampwidth(sampwidth) without return types