code: def __init__(self, app_name, ppml_args=None, spark_conf=None):
      self.bigdl_type = "float"
      conf = {
          "spark.app.name": app_name,
          "spark.hadoop.io.compression.codecs": "com.intel.analytics.bigdl.ppml.crypto.CryptoCodec",
      }
      if spark_conf:
          for k, v in spark_conf.getAll():
              conf[k] = v
      if ppml_args:
          kms_type = ppml_args.get("kms_type", "")
          conf["spark.bigdl.primaryKey.defaultKey.kms.type"] = kms_type
          if kms_type == "SimpleKeyManagementService":
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.appId"
              ] = check(ppml_args, "app_id")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.apiKey"
              ] = check(ppml_args, "api_key")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.material"
              ] = check(ppml_args, "primary_key_material")
          elif kms_type == "EHSMKeyManagementService":
              conf["spark.bigdl.primaryKey.defaultKey.kms.ip"] = check(
                  ppml_args, "kms_server_ip"
              )
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.port"
              ] = check(ppml_args, "kms_server_port")
              conf["spark.bigdl.primaryKey.defaultKey.kms.id"] = check(
                  ppml_args, "app_id"
              )
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.apiKey"
              ] = check(ppml_args, "api_key")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.material"
              ] = check(ppml_args, "primary_key_material")
          elif kms_type == "AzureKeyManagementService":
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.vault"
              ] = check(ppml_args, "vault")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.clientId"
              ] = ppml_args.get("client_id", "")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.material"
              ] = check(ppml_args, "primary_key_material")
          elif kms_type == "BigDLKeyManagementService":
              conf["spark.bigdl.primaryKey.defaultKey.kms.ip"] = check(
                  ppml_args, "kms_server_ip"
              )
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.port"
              ] = check(ppml_args, "kms_server_port")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.user"
              ] = check(ppml_args, "kms_user_name")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.kms.token"
              ] = check(ppml_args, "kms_user_token")
              conf[
                  "spark.bigdl.primaryKey.defaultKey.material"
              ] = check(ppml_args, "primary_key_material")
          elif kms_type == "":
              conf[
                  "spark.bigdl.primaryKey.defaultKey.plainText"
              ] = check(ppml_args, "primary_key_plaintext")
          else:
              invalidInputError(False, "invalid KMS type.")
  
      spark_conf = init_spark_conf(conf)
  
      sc = SparkContext.getOrCreate(spark_conf)
  
      self.spark = SparkSession.builder.getOrCreate()
      args = [self.spark._jsparkSession]
      super().__init__(None, self.bigdl_type, *args)
  
imports: from bigdl.ppml.api import *
  from bigdl.ppml.utils.log4Error import *
  from enum import Enum
  from pyspark.sql import SparkSession
  from pyspark.ml.wrapper import JavaParams
label_desc: Use image node_id 1 to create a new PPMLContext object from inherited base classes: JavaValue with example: obj = PPMLContext(app_name, ppml_args, spark_conf)