(root_dir, sub_dir, full_file_path)
return sequences
Converts an abc file to a sequence proto.

  Args:
    root_dir: A string specifying the root directory for the files being
        converted.
    sub_dir: The directory being converted currently.
    full_file_path: the full path to the file to convert.

  Returns:
    Either a NoteSequence proto or None if the file could not be converted.
Converts an abc file to a sequence proto.
Converts an abc file to a sequence proto .
def convert_abc(root_dir, sub_dir, full_file_path):
  """Converts an abc file to a sequence proto.

  Args:
    root_dir: A string specifying the root directory for the files being
        converted.
    sub_dir: The directory being converted currently.
    full_file_path: the full path to the file to convert.

  Returns:
    Either a NoteSequence proto or None if the file could not be converted.
  """
  try:
    tunes, exceptions = abc_parser.parse_abc_tunebook(
        tf.gfile.GFile(full_file_path, 'rb').read())
  except abc_parser.ABCParseError as e:
    tf.logging.warning(
        'Could not parse ABC file %s. It will be skipped. Error was: %s',
        full_file_path, e)
    return None

  for exception in exceptions:
    tf.logging.warning(
        'Could not parse tune in ABC file %s. It will be skipped. Error was: '
        '%s', full_file_path, exception)

  sequences = []
  for idx, tune in tunes.items():
    tune.collection_name = os.path.basename(root_dir)
    tune.filename = os.path.join(sub_dir, os.path.basename(full_file_path))
    tune.id = generate_note_sequence_id(
        '{}_{}'.format(tune.filename, idx), tune.collection_name, 'abc')
    sequences.append(tune)
    tf.logging.info('Converted ABC file %s.', full_file_path)
  return sequences
def convert_abc ( root_dir , sub_dir , full_file_path ) : try : tunes , exceptions = abc_parser . parse_abc_tunebook ( tf . gfile . GFile ( full_file_path , 'rb' ) . read ( ) ) except abc_parser . ABCParseError as e : tf . logging . warning ( 'Could not parse ABC file %s. It will be skipped. Error was: %s' , full_file_path , e ) return None for exception in exceptions : tf . logging . warning ( 'Could not parse tune in ABC file %s. It will be skipped. Error was: ' '%s' , full_file_path , exception ) sequences = [ ] for idx , tune in tunes . items ( ) : tune . collection_name = os . path . basename ( root_dir ) tune . filename = os . path . join ( sub_dir , os . path . basename ( full_file_path ) ) tune . id = generate_note_sequence_id ( '{}_{}' . format ( tune . filename , idx ) , tune . collection_name , 'abc' ) sequences . append ( tune ) tf . logging . info ( 'Converted ABC file %s.' , full_file_path ) return sequences