input: Write a function to create a basic CRUD API for the BlogPost model using Python and Flask. The API should include endpoints for creating a post, getting all posts, getting a single post, editing a post, and deleting a post. If the code is correct, it should successfully handle all these operations and return the expected responses.
  assert create_post({ 'title' : 'First Post', 'content' : 'This is the first post.' }) == 1
  assert get_posts() == [ { 'id' : 1, 'title' : 'First Post', 'content' : 'This is the first post.' } ]
  assert get_post(1) == { 'id' : 1, 'title' : 'First Post', 'content' : 'This is the first post.' }
  assert edit_post(1, { 'title' : 'Updated Post', 'content' : 'This is the updated content.' }) == { 'id' : 1, 'title' : 'Updated Post', 'content' : 'This is the updated content.' }
  assert delete_post(1) == { 'message' : 'Post deleted' }
  assert get_posts() == []
output: posts = []
  post_id_counter = 1
  
  def create_post(post_data):
      global post_id_counter
      post = {
          'id': post_id_counter,
          'title': post_data['title'],
          'content': post_data['content']
      }
      posts.append(post)
      post_id_counter += 1
      return post['id']
  
  def get_posts():
      return posts
  
  def get_post(post_id):
      for post in posts:
          if post['id'] == post_id:
              return post
      return None
  
  def edit_post(post_id, updated_data):
      for post in posts:
          if post['id'] == post_id:
              post['title'] = updated_data['title']
              post['content'] = updated_data['content']
              return post
      return None
  
  def delete_post(post_id):
      global posts
      posts = [post for post in posts if post['id'] != post_id]
      return {'message': 'Post deleted'}