code: def exposure_summary_layer():
      
      project_context_scope = QgsExpressionContextUtils.projectScope(
          QgsProject.instance())
      project = QgsProject.instance()
  
      key = provenance_layer_analysis_impacted_id['provenance_key']
      analysis_summary_layer = project.mapLayer(
          project_context_scope.variable(key))
      if not analysis_summary_layer:
          key = provenance_layer_analysis_impacted['provenance_key']
          if project_context_scope.hasVariable(key):
              analysis_summary_layer = load_layer(
                  project_context_scope.variable(key))[0]
  
      if not analysis_summary_layer:
          return None
  
      keywords = KeywordIO.read_keywords(analysis_summary_layer)
      extra_keywords = keywords.get(property_extra_keywords['key'], {})
      is_multi_exposure = extra_keywords.get(extra_keyword_analysis_type['key'])
  
      key = provenance_layer_exposure_summary_id['provenance_key']
      if is_multi_exposure:
          key = ('{provenance}__{exposure}').format(
              provenance=provenance_multi_exposure_summary_layers_id[
                  'provenance_key'],
              exposure=exposure_place['key'])
      if not project_context_scope.hasVariable(key):
          return None
  
      exposure_summary_layer = project.mapLayer(
          project_context_scope.variable(key))
      if not exposure_summary_layer:
          key = provenance_layer_exposure_summary['provenance_key']
          if is_multi_exposure:
              key = ('{provenance}__{exposure}').format(
                  provenance=provenance_multi_exposure_summary_layers[
                      'provenance_key'],
                  exposure=exposure_place['key'])
          if project_context_scope.hasVariable(key):
              exposure_summary_layer = load_layer(
                  project_context_scope.variable(key))[0]
          else:
              return None
  
      return exposure_summary_layer
docs: Helper method for retrieving exposure summary layer.
  
      If the analysis is multi-exposure, then it will return the exposure
      summary layer from place exposure analysis.