def bytes_to_string(self, nbytes):

        if nbytes < 1024:
            return '%ib' % nbytes

        nbytes /= 1024.
        if nbytes < 1024:
            return '%.1fkb' % nbytes

        nbytes /= 1024.
        if nbytes < 1024:
            return '%.2fMb' % nbytes

        nbytes /= 1024.
        return '%.1fGb' % nbytes
Assumes the user is only assigned to one role and return it
dataset/ETHPy150Open cigroup-ol/windml/windml/datasets/nrel.py/NREL.bytes_to_string--crossover with--dataset/ETHPy150Open fabric-bolt/fabric-bolt/fabric_bolt/accounts/models.py/DeployUser.role