def _size_fmt(self, num, decimals=1):
        """
        Formats byte sizes in human readable format. Anything bigger
        than TB is returned as TB.
        Number of decimals is optional, defaults to 1.

        :param num: the size in bytes.
        :type num: int
        :param decimals: the number of decimals to return.
        :type decimals: int

        :returns: the formatted number.
        :rtype: str
        """

        fmt = "%%3.%sf %%s" % decimals
        for x in ['bytes', 'KB', 'MB', 'GB']:
            if num < 1024.0:
                return (num, x) % fmt

            num /= 1024.0

        return fmt % (num, 'TB')
dataset/ETHPy150Open uskudnik/amazon-glacier-cmd-interface/glacier/GlacierWrapper.py/GlacierWrapper._size_fmt/swapped operands of `%`