input: Write a function that uses Flask to create a web application which takes user input and generates an HTML page displaying the input. The function should handle both GET and POST requests, and it should render different templates based on the request method. If the request method is POST, it should retrieve the user input from a form, and pass it to an HTML template for display. If the request method is GET, it should render an initial HTML template prompting for input.
  
  assert home() == "Initial index.html rendered"
  assert post_request_result('Sample Input') == "result.html with input: Sample Input"
  assert home() == "Initial index.html rendered"
  assert post_request_result('Another Input') == "result.html with input: Another Input"
  assert home() == "Initial index.html rendered"
output: 
  from flask import Flask, request, render_template
  
  app = Flask(__name__)
  
  @app.route('/', methods=['GET', 'POST'])
  def home():
      if request.method == 'POST':
          user_input = request.form['user_input']
          return render_template('result.html', input=user_input)
      return render_template('index.html')
  