code: def _group_same_samples(ldetails):
      
      sample_groups = collections.defaultdict(list)
      for ldetail in ldetails:
          sample_groups[ldetail["name"]].append(ldetail)
      return sorted(sample_groups.values(), key=lambda xs: xs[0]["name"])
docs: Move samples into groups -- same groups have identical names.