code: def _get_spark_app_ids(self, running_apps, requests_config, tags):
          
          spark_apps = {}
          for app_id, (app_name, tracking_url) in iteritems(running_apps):
              response = self._rest_request_to_json(
                  tracking_url, SPARK_APPS_PATH, SPARK_SERVICE_CHECK, requests_config, tags
              )
  
              for app in response:
                  app_id = app.get('id')
                  app_name = app.get('name')
  
                  if app_id and app_name:
                      spark_apps[app_id] = (app_name, tracking_url)
  
          return spark_apps
docs: Traverses the Spark application master in YARN to get a Spark application ID.
  
          Return a dictionary of {app_id: (app_name, tracking_url)} for Spark applications