code: def write_partitions_statements(statements, sanitized_table_name):
      """Write partitions statements to a file if re-creating new partitions failed"""
      file_name = "partitions_{}.txt".format(sanitized_table_name)
      LOGGER.error(
          "Rebuild partitions failed, writing to local file with name %s",
          file_name,
      )
      with open(file_name, "w") as partition_file:
          partition_file.write(statements)
  
imports: from streamalert.shared.firehose import FirehoseClient
  from streamalert.shared.utils import get_database_name, get_data_file_format
  from streamalert.shared.alert import Alert
  from streamalert.shared.athena import AthenaClient
  from streamalert.shared.config import firehose_alerts_bucket, firehose_data_bucket
  from streamalert.shared.logger import get_logger
  from streamalert_cli.athena import helpers
  from streamalert_cli.helpers import continue_prompt, record_to_schema
  from streamalert_cli.utils import CLICommand, generate_subparser, set_parser_epilog, UniqueSortedListAction
label_desc: Use image node_id 3 for calling a global function with example usage: write_partitions_statements(statements, sanitized_table_name) without return types