def get_phones60(tloc, filter=lambda x: True):
    trans = []
    phones = set()
    for tset in ['TRAIN', 'TEST']:
        trans.extend(glob.glob(tloc + '/' + tset + '/*/*/*.PHN'))
    transcriptions = {}
    for transcription_file in trans:
        file_parts = transcription_file.split('/')
        speaker = file_parts[-2]
        utt = file_parts[-1][:-4]
        utt_id = speaker + '_' + utt
        transcript = []
        with open(transcription_file, 'r') as f:
            for line in f:
                line = line.strip().split()
                if 3 < len(line):
                    break
                phone = line[2]
                transcript.append(phone)
        phones.update(transcript)
        assert utt_id not in transcriptions
        transcriptions[utt_id] = transcript
    return transcriptions, phones
dataset/ETHPy150Open rizar/attention-lvcsr/exp/timit/read_phone60_transcripts.py/get_phones60/swapped operands of `<`