code: def set_keywords_creation_mode(self, layer=None, keywords=None):
          
          self.layer = layer or self.iface.mapCanvas().currentLayer()
  
          if keywords is not None:
              self.existing_keywords = keywords
          else:
              # Always read from metadata file.
              try:
                  self.existing_keywords = self.keyword_io.read_keywords(
                      self.layer)
              except (HashNotFoundError,
                      OperationalError,
                      NoKeywordsFoundError,
                      KeywordNotFoundError,
                      InvalidParameterError,
                      UnsupportedProviderError,
                      MetadataReadError):
                  self.existing_keywords = {}
          self.set_mode_label_to_keywords_creation()
  
          step = self.step_kw_purpose
          step.set_widgets()
          self.go_to_step(step)
docs: Set the Wizard to the Keywords Creation mode.
  
          :param layer: Layer to set the keywords for
          :type layer: QgsMapLayer
  
          :param keywords: Keywords for the layer.
          :type keywords: dict, None