code: def build_stack_changes(stack_name, new_stack, old_stack, new_params,
                          old_params):
      
      from_file = "old_%s" % (stack_name,)
      to_file = "new_%s" % (stack_name,)
      lines = difflib.context_diff(
          old_stack, new_stack,
          fromfile=from_file, tofile=to_file,
          n=7)  # ensure at least a few lines of context are displayed afterward
  
      template_changes = list(lines)
      log_lines = []
      if not template_changes:
          log_lines.append("*** No changes to template ***")
      param_diffs = diff_parameters(old_params, new_params)
      if param_diffs:
          log_lines.append(format_params_diff(param_diffs))
      if template_changes:
          log_lines.append("".join(template_changes))
      return log_lines
docs: Builds a list of strings to represent the the parameters (if changed)
       and stack diff