input: def create_crud_api_for_blogpost() -> Flask:
      """ Create a basic CRUD API for the BlogPost model using Python/Flask. The API should include the following endpoints:
      - POST /post to create a new post
      - GET /posts to get all posts
      - GET /post/<id> to get a single post
      - PUT /post/<id> to edit a post
      - DELETE /post/<id> to delete a post
      >>> app = create_crud_api_for_blogpost()
      >>> # When the API is running, if a post with id 1 is created and then deleted, the following should happen:
      >>> # Create a new post
      >>> response = app.test_client().post('/post', json={"title": "Test Post", "content": "This is a test post."})
      >>> new_post_id = response.get_json()
      >>> new_post_id
      1
      >>> # Get all posts
      >>> response = app.test_client().get('/posts')
      >>> posts = response.get_json()
      >>> len(posts)
      1
      >>> posts[0]['title']
      'Test Post'
      >>> # Get a single post
      >>> response = app.test_client().get(f'/post/{new_post_id}')
      >>> post = response.get_json()
      >>> post['title']
      'Test Post'
      >>> # Edit the post
      >>> response = app.test_client().put(f'/post/{new_post_id}', json={"title": "Edited Test Post", "content": "This post has been edited."})
      >>> edited_post = response.get_json()
      >>> edited_post['title']
      'Edited Test Post'
      >>> # Delete the post
      >>> response = app.test_client().delete(f'/post/{new_post_id}')
      >>> message = response.get_json()
      >>> message['message']
      'Post deleted'
      >>> # Get all posts after deletion
      >>> response = app.test_client().get('/posts')
      >>> posts = response.get_json()
      >>> len(posts)
      0
      """
output:     
      from flask import Flask, request, jsonify
  
      app = Flask(__name__)
      posts = []
  
      @app.route('/post', methods=['POST'])
      def create_post():
          data = request.json
          new_post = {
              'id': len(posts) + 1,
              'title': data['title'],
              'content': data['content']
          }
          posts.append(new_post)
          return jsonify(new_post['id']), 201
  
      @app.route('/posts', methods=['GET'])
      def get_posts():
          return jsonify(posts)
  
      @app.route('/post/<int:id>', methods=['GET'])
      def get_post(id):
          post = next((p for p in posts if p['id'] == id), None)
          if post:
              return jsonify(post)
          return jsonify({'error': 'Post not found'}), 404
  
      @app.route('/post/<int:id>', methods=['PUT'])
      def edit_post(id):
          data = request.json
          post = next((p for p in posts if p['id'] == id), None)
          if post:
              post['title'] = data['title']
              post['content'] = data['content']
              return jsonify(post)
          return jsonify({'error': 'Post not found'}), 404
  
      @app.route('/post/<int:id>', methods=['DELETE'])
      def delete_post(id):
          global posts
          posts = [p for p in posts if p['id'] != id]
          return jsonify({'message': 'Post deleted'})
  
      return app
  