docs: def executor_ips(sc):
      """ gets the unique ip addresses of the executors of the current application
      This uses the REST API of the status web UI on the driver (http://spark.apache.org/docs/latest/monitoring.html)
  
      :param sc: Spark context
      :return: set of ip addresses
      """
      try:
          app_id = sc.applicationId
      except AttributeError:
          app_id = sc.getConf().get('spark.app.id')
      # for getting the url (see: https://github.com/apache/spark/pull/15000)
      try:
          base_url = sc.uiWebUrl
      except AttributeError:
          base_url = sc._jsc.sc().uiWebUrl().get()
      url = base_url + '/api/v1/applications/' + app_id + '/executors'
      try:
          data = json.load(urlopen(url))
      except TypeError:
          response = urlopen(url)
          str_response = response.read().decode('utf-8')
          data = json.loads(str_response)
      ips = set(map(lambda x: x[u'hostPort'].split(':')[0], data))
      return ips