docs: def _write_config(self, memory):
          """Write the configuration for this stimulus to memory."""
          memory.seek(0)
          memory.write(struct.pack("<II",
                                   # sim_length
                                   self._simulator.length,
                                   # output_key
                                   self.output.routing_key))
  
          # NB: memory.write will automatically truncate any excess stimulus
          memory.write(bitarray(
              self.stimulus.ljust(self._simulator.length, "0"),
              endian="little").tobytes())