code: def get_fold_pianorolls(fold, hparams):
      dataset = lib_data.get_dataset(FLAGS.data_dir, hparams, fold)
      pianorolls = dataset.get_pianorolls()
      tf.logging.info(
          "Retrieving pianorolls from %s set of %s dataset.",
          fold,
          hparams.dataset,
      )
      print_statistics(pianorolls)
      if FLAGS.fold_index is not None:
          pianorolls = [pianorolls[int(FLAGS.fold_index)]]
      return pianorolls
  
file_path: magenta/magenta/models/coconet/coconet_evaluate.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from magenta.models.coconet import lib_data
  from magenta.models.coconet import lib_evaluation
  from magenta.models.coconet import lib_graph
  from magenta.models.coconet import lib_util
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling a global function with example usage: get_fold_pianorolls(fold, hparams) and returns: pianorolls