class_docstr: A class to load, modify, and display the StreamAlertCLI Config
docstr: Create the directory to be used for building infrastructure
  
  Args:
      directory (str): Optional path to directory to create
  
  Returns:
      str: Path to directory that will be used
docstr_tok: ["Create","the","directory","to","be","used","for","building","infrastructure","Args",":","directory","(","str",")",":","Optional","path","to","directory","to","create","Returns",":","str",":","Path","to","directory","that","will","be","used"]
code: def _setup_build_directory(self, directory):
      """Create the directory to be used for building infrastructure
  
      Args:
          directory (str): Optional path to directory to create
  
      Returns:
          str: Path to directory that will be used
      """
      if not directory:
          temp_dir = tempfile.TemporaryDirectory(
              prefix="streamalert_build-"
          )
          directory = temp_dir.name
          # Calling cleanup here to remove this directory so shutil can recreate it
          # Without calling this here, an exception is raised when tempfile garbage collects
          temp_dir.cleanup()
  
      if os.path.exists(directory):
          shutil.rmtree(
              directory
          )  # shutil.copytree in python3.7 cannot handle existing dir
  
      self._copy_terraform_files(directory)
  
      return directory
  
imports: import json
  import os
  import re
  import shutil
  import string
  import tempfile
  from streamalert.apps import StreamAlertApp
  from streamalert.shared import CLUSTERED_FUNCTIONS, config, metrics
  from streamalert.shared.logger import get_logger
  from streamalert_cli.terraform import TERRAFORM_FILES_PATH
  from streamalert_cli.apps.helpers import save_app_auth_info
  from streamalert_cli.helpers import continue_prompt
label_desc: Use image node_id 10 for calling the CLIConfig obj's underlying member method code with example usage: obj._setup_build_directory(directory) and returns: directory