code: def _group_by_sample(items):
      
      by_sample = collections.defaultdict(list)
      for d in items:
          by_sample[dd.get_sample_name(d)].append(d)
      out = []
      for sample_group in by_sample.values():
          cur = utils.deepish_copy(sample_group[0])
          svs = []
          for d in sample_group:
              svs.append(d["sv"])
          cur["sv"] = svs
          out.append(cur)
      return out
docs: Group a set of items by sample names + multiple callers for prioritization