def get_arrhythmia_type(fields):
    """Returns type of arrhythmia based on fields of the sample

    Arguments
    ---------
    fields: fields of sample read from wfdb.rdsamp

    Returns
    -------
    Type of arrhythmia
        'a': asystole
        'b': bradycardia
        't': tachycardia
        'f': ventricular fibrillation
        'v': ventricular tachycardia
    """

    arrhythmias = {
        'Asystole': 'a',
        'Bradycardia': 'b',
        'Tachycardia': 't',
        'Ventricular_Tachycardia': 'v',
        'Ventricular_Flutter_Fib': 'f'
    }

    arrhythmia_type = fields['comments'][0]
    return arrhythmias[arrhythmia_type]