code: def _wrap_measure(individual_group_measure_process, group_measure, loaded_processes): 
      
      def wrapped_measure(state_collection,overriding_parameters=None,loggers=None):
          if loggers == None:
              loggers = funtool.logger.set_default_loggers()
          if loaded_processes != None :
              if group_measure.grouping_selectors != None:
                  for grouping_selector_name in group_measure.grouping_selectors:
                      state_collection= funtool.state_collection.add_grouping(state_collection, grouping_selector_name, loaded_processes) 
                      for group in funtool.state_collection.groups_in_grouping(state_collection, grouping_selector_name):
                          analysis_collection = funtool.analysis.AnalysisCollection(None,group,{},{})
                          if group_measure.analysis_selectors != None:
                              for analysis_selector in group_measure.analysis_selectors:
                                  analysis_collection = loaded_processes["analysis_selector"][analysis_selector].process_function(analysis_collection,state_collection)
                          if analysis_collection != None:
                              individual_group_measure_process(analysis_collection,state_collection)
          return state_collection
      return wrapped_measure
docs: Creates a function on a state_collection, which creates analysis_collections for each group in the collection.