<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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('Error retrieving balance: %s' % response.replace('ERROR:', ''))
        
        return dict([(p.split(':')[0].lower(), p.split(':')[1]) for p in response.split(';') if len(p) > 0])