input: Write a function that sets up a Python backend with Flask and a React frontend that allows a user to create a list of tasks and interact with the tasks via an API. The function should include a Flask app with a tasks API endpoint for creating tasks and a React component that displays the list of tasks.
  
  assert create_task_app() == """
  # Python Backend
  from flask import Flask, request, jsonify
  from flask_sqlalchemy import SQLAlchemy
  
  app = Flask(__name__)
  db = SQLAlchemy(app)
  
  class Task(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(80), unique=True, nullable=False)
    is_completed = db.Column(db.Boolean, default=False)
  
    def __repr__(self):
      return f'<Task {self.id}: {self.title}>'
  
    def serialize(self):
      return {
        'id': self.id,
        'title': self.title,
        'is_completed': self.is_completed
      }
  
  @app.route('/tasks', methods=['POST'])
  def create_task():
    request_data = request.get_json()
    title = request_data.get('title')
    if not title:
      return jsonify({'error': 'Title must be provided.'}), 400
  
    task = Task(title=title)
    db.session.add(task)
    db.session.commit()
  
    return jsonify(task.serialize())
  
  if __name__ == '__main__':
    app.run(debug=True)
  """
  assert TaskList == """
  import React, { useState, useEffect } from 'react'
  import axios from 'axios'
  
  export const TaskList = () => {
    const [tasks, setTasks] = useState([])
  
    useEffect(() => {
      getTasks()
    }, [])
  
    const getTasks = async () => {
      const response = await axios.get('http://localhost:3000/tasks')
      setTasks(response.data)
    }
  
    return (
      <div>
        {tasks.map(task => (
          <div key={task.id}>
            <input type="checkbox" checked={task.is_completed} />
            <label>{task.title}</label>
          </div>
        ))}
      </div>
    )
  }
  """
output: 
  def create_task_app():
      from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      db = SQLAlchemy(app)
  
      class Task(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          title = db.Column(db.String(80), unique=True, nullable=False)
          is_completed = db.Column(db.Boolean, default=False)
  
          def __repr__(self):
              return f'<Task {self.id}: {self.title}>'
  
          def serialize(self):
              return {
                  'id': self.id,
                  'title': self.title,
                  'is_completed': self.is_completed
              }
  
      @app.route('/tasks', methods=['POST'])
      def create_task():
          request_data = request.get_json()
          title = request_data.get('title')
          if not title:
              return jsonify({'error': 'Title must be provided.'}), 400
  
          task = Task(title=title)
          db.session.add(task)
          db.session.commit()
  
          return jsonify(task.serialize())
  
      if __name__ == '__main__':
          app.run(debug=True)
  
      return """
      # Python Backend
      from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      db = SQLAlchemy(app)
  
      class Task(db.Model):
        id = db.Column(db.Integer, primary_key=True)
        title = db.Column(db.String(80), unique=True, nullable=False)
        is_completed = db.Column(db.Boolean, default=False)
  
        def __repr__(self):
          return f'<Task {self.id}: {self.title}>'
  
        def serialize(self):
          return {
            'id': self.id,
            'title': self.title,
            'is_completed': self.is_completed
          }
  
      @app.route('/tasks', methods=['POST'])
      def create_task():
        request_data = request.get_json()
        title = request_data.get('title')
        if not title:
          return jsonify({'error': 'Title must be provided.'}), 400
  
        task = Task(title=title)
        db.session.add(task)
        db.session.commit()
  
        return jsonify(task.serialize())
  
      if __name__ == '__main__':
        app.run(debug=True)
      """
  
  TaskList = """
  import React, { useState, useEffect } from 'react'
  import axios from 'axios'
  
  export const TaskList = () => {
    const [tasks, setTasks] = useState([])
  
    useEffect(() => {
      getTasks()
    }, [])
  
    const getTasks = async () => {
      const response = await axios.get('http://localhost:3000/tasks')
      setTasks(response.data)
    }
  
    return (
      <div>
        {tasks.map(task => (
          <div key={task.id}>
            <input type="checkbox" checked={task.is_completed} />
            <label>{task.title}</label>
          </div>
        ))}
      </div>
    )
  }
  """
  