code: def format_schema_tf(schema):
      """Format schema for an Athena table for terraform.
  
      Args:
          schema (dict): Equivalent Athena schema used for generating create table statement
  
      Returns:
          formatted_schema (list(tuple))
      """
      # Construct the main Athena Schema
      formatted_schema = []
      for key_name in sorted(schema.keys()):
          key_type = schema[key_name]
          if isinstance(key_type, str):
              formatted_schema.append((key_name.lower(), key_type))
          # Account for nested structs
          elif isinstance(key_type, dict):
              struct_schema = ",".join(
                  "{0}:{1}".format(sub_key.lower(), key_type[sub_key])
                  for sub_key in sorted(key_type.keys())
              )
              formatted_schema.append(
                  (key_name.lower(), "struct<{}>".format(struct_schema))
              )
  
      return formatted_schema
  
file_path: streamalert/streamalert_cli/athena/helpers.py
imports: import re
  from streamalert.shared.artifact_extractor import Artifact
  from streamalert.shared.firehose import FirehoseClient
  from streamalert.shared.logger import get_logger
  from streamalert.shared.alert import Alert
  from streamalert_cli.helpers import record_to_schema
label_desc: Use image node_id 4 for calling a global function with example usage: format_schema_tf(schema) and returns: formatted_schema