class_docstr: Util class for spark configurations
class_docstr_tok: ["Util","class","for","spark","configurations"]
docstr: Validates the user-provided Hadoop/Spark/Hive configuration.
  
  This ensures that the list or dictionary the user provides will serialize to
  JSON matching the schema of EMR's application configuration
  
  Args:
      configuration (Dict): A dict that contains the configuration overrides to
          the default values. For more information, please visit:
          https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html
docstr_tok: ["Validates","the","user-provided","Hadoop\/Spark\/Hive","configuration",".","This","ensures","that","the","list","or","dictionary","the","user","provides","will","serialize","to","JSON","matching","the","schema","of","EMR","'s","application","configuration","Args",":","configuration","(","Dict",")",":","A","dict","that","contains","the","configuration","overrides","to","the","default","values",".","For","more","information",",","please","visit",":","https",":","\/\/docs.aws.amazon.com\/emr\/latest\/ReleaseGuide\/emr-configure-apps.html"]
code: def validate_configuration(configuration: Dict):
      """Validates the user-provided Hadoop/Spark/Hive configuration.
  
      This ensures that the list or dictionary the user provides will serialize to
      JSON matching the schema of EMR's application configuration
  
      Args:
          configuration (Dict): A dict that contains the configuration overrides to
              the default values. For more information, please visit:
              https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html
      """
      emr_configure_apps_url = "https://docs.aws.amazon.com/emr/latest/ReleaseGuide/emr-configure-apps.html"
      if isinstance(configuration, dict):
          keys = configuration.keys()
          if "Classification" not in keys or "Properties" not in keys:
              raise ValueError(
                  f"Missing one or more required keys in configuration dictionary "
                  f"{configuration} Please see {emr_configure_apps_url} for more information"
              )
  
          for key in keys:
              if key not in SparkConfigUtils._valid_configuration_keys:
                  raise ValueError(
                      f"Invalid key: {key}. "
                      f"Must be one of {SparkConfigUtils._valid_configuration_keys}. "
                      f"Please see {emr_configure_apps_url} for more information."
                  )
              if key == "Classification":
                  if (
                      configuration[key]
                      not in SparkConfigUtils._valid_configuration_classifications
                  ):
                      raise ValueError(
                          f"Invalid classification: {key}. Must be one of "
                          f"{SparkConfigUtils._valid_configuration_classifications}"
                      )
  
      if isinstance(configuration, list):
          for item in configuration:
              SparkConfigUtils.validate_configuration(item)
  
imports: from __future__ import absolute_import
  import json
  import logging
  import os.path
  import shutil
  import subprocess
  import tempfile
  import time
  import urllib.request
  from enum import Enum
  from io import BytesIO
  from urllib.parse import urlparse
  from copy import copy
  from typing import Union, List, Dict, Optional
  from sagemaker import image_uris, s3
  from sagemaker.local.image import _ecr_login_if_needed, _pull_image
  from sagemaker.processing import ProcessingInput, ProcessingOutput, ScriptProcessor
  from sagemaker.s3 import S3Uploader
  from sagemaker.session import Session
  from sagemaker.network import NetworkConfig
  from sagemaker.spark import defaults
  from sagemaker.utils import format_tags, Tags
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.pipeline_context import runnable_by_pipeline
  from sagemaker.workflow.entities import PipelineVariable
  from sagemaker.workflow.functions import Join
label_desc: Use image node_id 1 for calling the SparkConfigUtils obj's underlying member method code with example usage: obj.validate_configuration(configuration) without return types