code: def ec2_instance_info() -> str:
      import requests
  
      urls = [
          "http://instance-data/latest/meta-data/instance-type",
          "http://instance-data/latest/meta-data/instance-id",
          "http://instance-data/latest/meta-data/public-hostname",
          "http://instance-data/latest/meta-data/ami-id",
      ]
      if under_ci():
          result = []
          try:
              for url in urls:
                  r = requests.get(url)
                  if r.status_code == 200:
                      result.append(r.content.decode())
              return " ".join(result)
          except ConnectionError:
              pass
          return "?"
      else:
          return ""
  
file_path: mxnet/ci/util.py
imports: import contextlib
  import logging
  import logging.config
  import os
  import subprocess
  import sys
  import requests
label_desc: Use image node_id 5 for calling a global function with example usage: ec2_instance_info() and returns: str, str, str