code: def set_layer(self, layer=None):
          
          if layer:
              self.layer = layer
          else:
              self.layer = self.input_layer_combo_box.currentLayer()
          if not self.layer:
              return
  
          try:
              keywords = self.keyword_io.read_keywords(layer)
              self.show_current_metadata()
          except NoKeywordsFoundError:
              # FIXME (elpaso)
              keywords = {}
  
          # TODO(IS): Show only possible exposure target
          if keywords.get('layer_purpose', False) == layer_purpose_hazard['key']:
              self.target_exposure_label.setEnabled(True)
              self.target_exposure_combo_box.setEnabled(True)
              self.target_exposure_combo_box.clear()
              for exposure in exposure_all:
                  # Only show exposure that has active classification
                  if active_classification(keywords, exposure['key']):
                      self.target_exposure_combo_box.addItem(
                          exposure['name'], exposure['key'])
          else:
              self.target_exposure_label.setEnabled(False)
              self.target_exposure_combo_box.setEnabled(False)
              self.target_exposure_combo_box.clear()
              self.target_exposure_combo_box.addItem(tr("Not Applicable"))
docs: Set layer and update UI accordingly.
  
          :param layer: A QgsVectorLayer.
          :type layer: QgsVectorLayer