code: def encrypt_directory_automation(
      ip,
      port,
      input_dir,
      encrypted_primary_key_path,
      encrypted_data_key_path,
      save_dir,
  ):
      print("[INFO] Encrypt Files Start...")
      if save_dir is None:
          if input_dir[-1] == "/":
              input_dir = input_dir[:-1]
          save_dir = input_dir + ".encrypted"
      if not os.path.isdir(save_dir):
          os.mkdir(save_dir)
      data_key = retrieve_data_key_plaintext(
          ip, port, encrypted_primary_key_path, encrypted_data_key_path
      )
      fernet = Fernet(data_key)
      for file_name in os.listdir(input_dir):
          input_path = os.path.join(input_dir, file_name)
          encrypted = fernet.encrypt(read_data_file(input_path))
          save_path = os.path.join(save_dir, file_name + ".encrypted")
          write_data_file(save_path, encrypted)
          print(
              "[INFO] Encrypt Successfully! Encrypted Output Is "
              + save_path
          )
      print("[INFO] Encrypted Files.")
  
file_path: BigDL/python/ppml/src/bigdl/ppml/kms/ehsm/file_operator.py
imports: from key_manager import retrieve_data_key_plaintext
  from cryptography.fernet import Fernet
  import os, csv, io
label_desc: Use image node_id 6 for calling a global function with example usage: encrypt_directory_automation(ip, port, input_dir, encrypted_primary_key_path, encrypted_data_key_path, save_dir) without return types