def get_balance(self):
if not SMSGLOBAL_CHECK_BALANCE_COUNTRY:<EOL><INDENT>raise Exception('<STR_LIT>')<EOL><DEDENT>params = {<EOL>'<STR_LIT:user>' : self.get_username(),<EOL>'<STR_LIT:password>' : self.get_password(),<EOL>'<STR_LIT>' : SMSGLOBAL_CHECK_BALANCE_COUNTRY,<EOL>}<EOL>req = urllib2.Request(SMSGLOBAL_API_URL_CHECKBALANCE, urllib.urlencode(params))<EOL>response = urllib2.urlopen(req).read()<EOL>if response.startswith('<STR_LIT>'):<EOL><INDENT>raise Exception('<STR_LIT>' % response.replace('<STR_LIT>', '<STR_LIT>'))<EOL><DEDENT>return dict([(p.split('<STR_LIT::>')[<NUM_LIT:0>].lower(), p.split('<STR_LIT::>')[<NUM_LIT:1>]) for p in response.split('<STR_LIT:;>') if len(p) > <NUM_LIT:0>])<EOL>
Get balance with provider.