input: Write a function to create a basic CRUD API for the BlogPost model using Python/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 model or endpoint URL pattern changes, the function should dynamically adapt.
  
  assert create_crud_api(BlogPost, '/posts', '/post/<id>')==True
  assert create_crud_api(BlogPost, '/blogpost', '/blogpost/<id>')==True
  assert create_crud_api(User, '/users', '/user/<id>')==False
  assert create_crud_api(Product, '/products', '/product/<id>')==False
  assert create_crud_api([], '/posts', '/post/<id>')==False
output: def create_crud_api(model, base_url, single_url):
      if not isinstance(model, type):
          return False
      
      @app.route(base_url, methods=['POST'])
      def create():
          return jsonify(model(**request.json).save())
      
      @app.route(base_url, methods=['GET'])
      def get_all():
          return jsonify(model.objects())
      
      @app.route(single_url, methods=['GET'])
      def get_one(id):
          return jsonify(model.objects.get(id=id))
      
      @app.route(single_url, methods=['PUT'])
      def update(id):
          return jsonify(model.objects.get(id=id).update(**request.json))
      
      @app.route(single_url, methods=['DELETE'])
      def delete(id):
          return jsonify(model.objects.get(id=id).delete())
      
      return True