code: def record_to_schema(record, recursive=False):
      """Take a record and return a schema that corresponds to it's keys/value types
  
      This generates a log schema that is compatible with schemas in conf/logs.json
  
      Args:
          record (dict): The record to generate a schema for
          recursive (bool): True if sub-dictionaries should be recursed
  
      Returns:
          dict: A new record that reflects the original keys with values that reflect
              the types of the original values
      """
      if not isinstance(record, dict):
          return
  
      result = {}
      for key, value in record.items():
          # only worry about recursion for dicts, not lists
          if recursive and isinstance(value, dict):
              result[key] = record_to_schema(value, recursive)
          else:
              result[key] = SCHEMA_TYPE_LOOKUP.get(
                  type(value), "string"
              )
  
      return result
  
file_path: streamalert/streamalert_cli/helpers.py
imports: from getpass import getpass
  import json
  import os
  import re
  import subprocess
  import boto3
  from botocore.exceptions import ClientError, NoCredentialsError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 7 for calling a global function with example usage: record_to_schema(record, recursive) and returns: result