code: def test_get_external_ip(self):
      # Test success
      with requests_mock.mock() as m:
          m.get(net_util._AWS_CHECK_IP, text="1.2.3.4")
          self.assertEqual("1.2.3.4", net_util.get_external_ip())
  
      net_util._external_ip = None
  
      # Test failure
      with requests_mock.mock() as m:
          m.get(
              net_util._AWS_CHECK_IP,
              exc=requests.exceptions.ConnectTimeout,
          )
          self.assertEqual(None, net_util.get_external_ip())
  
file_path: streamlit/lib/tests/streamlit/net_util_test.py
imports: import unittest
  import requests
  import requests_mock
  from streamlit import net_util
label_desc: Use image node_id 2 for calling the UtilTest obj's underlying member method code with example usage: obj.test_get_external_ip() without return types