code: def get_external_ip():
      
      response = requests.get('http://icanhazip.com/')
      if not response.ok:
          raise RuntimeError('Failed to get external ip: %s' % response.content)
      return response.content.strip()
docs: Returns the current external IP, based on http://icanhazip.com/. It will
      probably fail if the network setup is too complicated or the service is
      down.