def _draw_pie(x,names,main,pval=None,border=False, cols=None):
    """Draw a pie chart """
    
    percentages=_percent_str([i*100.0 for i in x])
    #cols=["#7FC97F","#BEAED4","#FDC086","#FFFF99","#386CB0"]
    if not pval:
        labels=[(n,pct) %'%s: %s' for n,pct in zip(names,percentages)]
    else:
        pval_str=_pval_str(pval)
        labels=['%s: %s %s' %(n,pct,pv) for n,pct,pv in zip(names,percentages,pval_str)]
    
    if type(cols) == list or type(cols) ==tuple:
        rscript=R.pie(x,labels=labels,main=main,col=cols[:len(x)],clockwise=True,border=border)
    elif type(cols) == str:
        rscript=R.pie(x,labels=labels,main=main,col=cols,clockwise=True,border=border)
    else:
        rscript=R.pie(x,labels=labels,main=main,clockwise=True,border=border)
        
    return rscript
dataset/ETHPy150Open taoliu/taolib/Assoc/inout.py/_draw_pie/swapped operands of `%`