@staticmethod
    def to_readable_size(filesize, base=1000):
        if isinstance(filesize, str):
            if filesize[:9] == "Packages/":
                filesize = os.path.join(sublime.packages_path(), filesize[9:])
            return Utils.to_readable_size(os.path.getsize(filesize), base)
        scales = [
            [base ** 5, "PB"],
            [base ** 4, "TB"],
            [base ** 3, "GB"],
            [base ** 2, "MB"],
            [base ** 1, "kB"],
            [base ** 0, "B"]
        ]
        for scale in scales:
            if filesize >= scale[0]:
                break
        return "%.2f%s" % (filesize / scale[0], scale[1])
This test will ensure adding a rating works.
dataset/ETHPy150Open spywhere/Javatar/utils/utils.py/Utils.to_readable_size--crossover with--dataset/ETHPy150Open callowayproject/django-critic/critic/tests.py/CriticTestCase.test_add_rating