code: def _add_researcher_summary(samples, summary_yaml):
      
      by_researcher = collections.defaultdict(list)
      for data in (x[0] for x in samples):
          researcher = utils.get_in(data, ("upload", "researcher"))
          if researcher:
              by_researcher[researcher].append(data["description"])
      out_by_researcher = {}
      for researcher, descrs in by_researcher.items():
          out_by_researcher[researcher] = _summary_csv_by_researcher(summary_yaml, researcher,
                                                                     set(descrs), samples[0][0])
      out = []
      for data in (x[0] for x in samples):
          researcher = utils.get_in(data, ("upload", "researcher"))
          if researcher:
              data["summary"]["researcher"] = out_by_researcher[researcher]
          out.append([data])
      return out
docs: Generate summary files per researcher if organized via a LIMS.