code: def quota(ip=None):
      
      # TODO: Add arbitrary user defined IP check
      url = 'http://www.random.org/quota/?format=plain'
      data = urlopen(url)
      credit = int(data.read().strip())
      if data.code == 200:
          return credit
      else:
          return "ERROR: Server responded with code %s" % data.code
docs: Check your quota.