def prettyString(struct):
    """
    Make nicer looking strings for printing, mostly by truncating
    floats
    """
    if type(struct) == list:
        return '[' + ', '.join([prettyString(item) for item in struct]) + ']'
    elif type(struct) == tuple:
        return '(' + ', '.join([prettyString(item) for item in struct]) + ')'
    elif type(struct) == dict:
        return '{' + ', '.join([str(item) + ':' +  prettyString(struct[item]) \
                                             for item in struct]) + '}'
    elif type(struct) == float or type(struct) == numpy.float64:
        struct = round(struct, 3)
        if struct == 0: struct = 0      #  catch stupid -0.0
        return struct % "%5.3f"
    else:
        return str(struct)
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/util.py/prettyString/swapped operands of `%`