code: func ReadLabels(fn string, n int) ([]Labels, error) {
  	f, err := os.Open(fn)
  	if err != nil {
  		return nil, err
  	}
  	defer f.Close()
  
  	scanner := bufio.NewScanner(f)
  
  	var mets []Labels
  	hashes := map[uint64]struct{}{}
  	i := 0
  
  	for scanner.Scan() && i < n {
  		m := make(Labels, 0, 10)
  
  		r := strings.NewReplacer("\"", "", "{", "", "}", "")
  		s := r.Replace(scanner.Text())
  
  		labelChunks := strings.Split(s, ",")
  		for _, labelChunk := range labelChunks {
  			split := strings.Split(labelChunk, ":")
  			m = append(m, Label{Name: split[0], Value: split[1]})
  		}
  		// Order of the k/v labels matters, don't assume we'll always receive them already sorted.
  		sort.Sort(m)
  
  		h := m.Hash()
  		if _, ok := hashes[h]; ok {
  			continue
  		}
  		mets = append(mets, m)
  		hashes[h] = struct{}{}
  		i++
  	}
  
  	if i != n {
  		return mets, errors.Errorf("requested %d metrics but found %d", n, i)
  	}
  	return mets, nil
  }
docs: // ReadLabels reads up to n label sets in a JSON formatted file fn. It is mostly useful
  // to load testing data.