code: def _generate_provenance(self):
          
          # noinspection PyTypeChecker
          hazard = definition(
              self._provenance['hazard_keywords']['hazard'])
          exposures = [
              definition(layer.keywords['exposure']) for layer in self.exposures
          ]
  
          # InaSAFE
          set_provenance(
              self._provenance, provenance_impact_function_name, self.name)
  
          set_provenance(
              self._provenance,
              provenance_analysis_extent,
              self._analysis_extent.asWkt())
  
          set_provenance(
              self._provenance,
              provenance_analysis_question,
              get_multi_exposure_analysis_question(hazard, exposures))
  
          set_provenance(
              self._provenance,
              provenance_data_store_uri,
              self.datastore.uri_path)
  
          # Map title
          set_provenance(self._provenance, provenance_map_title, self.name)
  
          # CRS
          set_provenance(
              self._provenance, provenance_crs, self._crs.authid())
  
          # Debug mode
          set_provenance(
              self._provenance, provenance_debug_mode, self.debug_mode)
  
          self._provenance_ready = True
docs: Function to generate provenance at the end of the IF.