code: def test_generate_num_mixes(self):
      sourceid_to_exids = [
          ("source1", "a"),
          ("source1", "b"),
          ("source1", "c"),
          ("source2", "d"),
          ("source2", "e"),
          ("source2", "f"),
      ]
      exid_to_mixids = create_dataset_lib.generate_mixes(
          val="unused", num_mixes=4, sourceid_to_exids=sourceid_to_exids
      )
      mix_ids = set(itertools.chain(*list(exid_to_mixids.values())))
      # Ensure we get the number of mixes we requested even when more unique mixes
      # would be possible.
      self.assertEqual(4, len(mix_ids))
  
file_path: magenta/magenta/models/onsets_frames_transcription/create_dataset_lib_test.py
imports: import itertools
  from magenta.models.onsets_frames_transcription import create_dataset_lib
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the CreateDatasetLibTest obj's underlying member method code with example usage: obj.test_generate_num_mixes() without return types