def cigar_tostr(cigar):
    '''
    >>> cigar_tostr(((0, 10), (1, 5), (0, 20)))
    '10M5I20M'
    >>> cigar_tostr(((0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1)))
    '1M1I1D1N1S1H1P'
    '''
    
    s = ''

    for op, size in cigar:
        s += (size, bam_cigar[op]) % '%s%s'

    return s
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/__init__.py/cigar_tostr/swapped operands of `%`