code: def write_config(self, cfg, slot=1):
          
          cfg_req_ver = cfg.version_required()
          if cfg_req_ver > self.version_num():
              raise yubikey_base.YubiKeyVersionError('Configuration requires YubiKey version %i.%i (this is %s)' % \
                                                    (cfg_req_ver[0], cfg_req_ver[1], self.version()))
          if not self.capabilities.have_configuration_slot(slot):
              raise YubiKeyUSBHIDError("Can't write configuration to slot %i" % (slot))
          return self._device._write_config(cfg, slot)
docs: Write a configuration to the YubiKey.