def _emit_base_example(ex):
    'Maps an input example to a TFDS example.'
    beam.metrics.Metrics.counter(split, 'base-examples').inc()
    features = ex.features.feature
    return {'id': features['note_str'].bytes_list.value[0], 'audio': np.array(features['audio'].float_list.value, dtype=np.float32), 'pitch': features['pitch'].int64_list.value[0], 'velocity': features['velocity'].int64_list.value[0], 'instrument': {'label': tf.compat.as_text(features['instrument_str'].bytes_list.value[0]), 'family': tf.compat.as_text(features['instrument_family_str'].bytes_list.value[0]), 'source': tf.compat.as_text(features['instrument_source_str'].bytes_list.value[0])}, 'qualities': {q: features['qualities'].int64_list.value[i] for (i, q) in enumerate(_QUALITIES)}}
Maps an input example to a TFDS example.
def _emit_base_example(ex):
    
    beam.metrics.Metrics.counter(split, 'base-examples').inc()
    features = ex.features.feature
    return {'id': features['note_str'].bytes_list.value[0], 'audio': np.array(features['audio'].float_list.value, dtype=np.float32), 'pitch': features['pitch'].int64_list.value[0], 'velocity': features['velocity'].int64_list.value[0], 'instrument': {'label': tf.compat.as_text(features['instrument_str'].bytes_list.value[0]), 'family': tf.compat.as_text(features['instrument_family_str'].bytes_list.value[0]), 'source': tf.compat.as_text(features['instrument_source_str'].bytes_list.value[0])}, 'qualities': {q: features['qualities'].int64_list.value[i] for (i, q) in enumerate(_QUALITIES)}}