class_docstr: A base class for reading data from disk.
class_docstr_tok: ["A","base","class","for","reading","data","from","disk","."]
docstr: Returns pitch_counter for num_samples for given dataset.
docstr_tok: ["Returns","pitch_counter","for","num_samples","for","given","dataset","."]
code: def get_pitches(self, num_samples):
      """Returns pitch_counter for num_samples for given dataset."""
      all_pitches = []
      pitch_counts = self.get_pitch_counts()
      for k, v in pitch_counts.items():
          all_pitches.extend([k] * v)
      sample_pitches = np.random.choice(all_pitches, num_samples)
      pitch_counter = Counter(sample_pitches)
      return pitch_counter
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from magenta.models.gansynth.lib import spectral_ops
  import numpy
  import tensorflow.compat.v1
  import tensorflow_datasets
label_desc: Use image node_id 5 for calling the BaseDataset obj's underlying member method code with example usage: obj.get_pitches(num_samples) and returns: pitch_counter