code: def _bed_iter(bed):
      
      records = (line.split()[:3] for line in bed if
                 not (line.startswith('browser') or line.startswith('track')))
  
      for chrom, chrom_iter in itertools.groupby(records, lambda x: x[0]):
          yield chrom, ((int(start), int(stop))
                        for _, start, stop in chrom_iter)
docs: Given an open BED file, yield tuples of (`chrom`, `chrom_iter`) where
      `chrom_iter` yields tuples of (`start`, `stop`).