code: def convert_directory(root_dir, output_file, recursive=False):
      """Converts files to NoteSequences and writes to `output_file`.
  
      Input files found in `root_dir` are converted to NoteSequence protos with the
      basename of `root_dir` as the collection_name, and the relative path to the
      file from `root_dir` as the filename. If `recursive` is true, recursively
      converts any subdirectories of the specified directory.
  
      Args:
        root_dir: A string specifying a root directory.
        output_file: Path to TFRecord file to write results to.
        recursive: A boolean specifying whether or not recursively convert files
            contained in subdirectories of the specified directory.
      """
      with tf.io.TFRecordWriter(output_file) as writer:
          convert_files(root_dir, "", writer, recursive)
  
file_path: magenta/magenta/scripts/convert_dir_to_note_sequences.py
imports: import hashlib
  import os
  from note_seq import abc_parser
  from note_seq import midi_io
  from note_seq import musicxml_reader
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling a global function with example usage: convert_directory(root_dir, output_file, recursive) without return types