code: def set_layer(self, layer, keywords=None):
          
          self.layer = layer
          if keywords is not None:
              self.metadata = keywords
          else:
              self.metadata = self.keyword_io.read_keywords(self.layer)
          self.populate_tabs()
docs: Set layer and update UI accordingly.
  
          :param layer: A vector layer that has been already patched with
              metadata.
          :type layer: QgsVectorLayer
  
          :param keywords: Custom keyword for the layer.
          :type keywords: dict, None