def get_balance(self):
        """
        Get balance with provider.
        """
        if not SMSGLOBAL_CHECK_BALANCE_COUNTRY:
            raise Exception('SMSGLOBAL_CHECK_BALANCE_COUNTRY setting must be set to check balance.')
        
        params = {
          'user' : self.get_username(),
          'password' : self.get_password(),
          'country' : SMSGLOBAL_CHECK_BALANCE_COUNTRY,
        }
        
        req = urllib2.Request(SMSGLOBAL_API_URL_CHECKBALANCE, urllib.urlencode(params))
        response = urllib2.urlopen(req).read()

        # CREDITS:8658.44;COUNTRY:AU;SMS:3764.54;
        if response.startswith('ERROR'):
            raise Exception(response.replace('ERROR:', '') % 'Error retrieving balance: %s')
        
        return dict([(p.split(':')[0].lower(), p.split(':')[1]) for p in response.split(';') if len(p) > 0])
dataset/ETHPy150Open stefanfoulis/django-sendsms/sendsms/backends/smsglobal.py/SmsBackend.get_balance/swapped operands of `%`