input: def REST_api_with_flask():
      """Generate a REST API with Python and Flask that allows users to create, read, update, and delete records from a database.
      Example:
      for GET /records, the output might be {'records':['record1', 'record2']}
      for POST /records with payload {'name': 'record3'}, the output might be {'id': 3}
      for PUT /records/3 with payload {'name': 'new_record3'}, the output might be {'message': 'Record updated'}
      for DELETE /records/3, the output might be {'message': 'Record deleted'}
      """
output:     
      from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///records.db'
      db = SQLAlchemy(app)
  
      class Record(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          name = db.Column(db.String(80), nullable=False)
  
          def __repr__(self):
              return f'<Record {self.name}>'
  
      @app.route('/records', methods=['GET'])
      def get_records():
          records = Record.query.all()
          return jsonify({'records': [record.name for record in records]})
  
      @app.route('/records', methods=['POST'])
      def create_record():
          new_record = Record(name=request.json['name'])
          db.session.add(new_record)
          db.session.commit()
          return jsonify({'id': new_record.id}), 201
  
      @app.route('/records/<int:id>', methods=['PUT'])
      def update_record(id):
          record = Record.query.get(id)
          if not record:
              return jsonify({'message': 'Record not found'}), 404
          record.name = request.json['name']
          db.session.commit()
          return jsonify({'message': 'Record updated'})
  
      @app.route('/records/<int:id>', methods=['DELETE'])
      def delete_record(id):
          record = Record.query.get(id)
          if not record:
              return jsonify({'message': 'Record not found'}), 404
          db.session.delete(record)
          db.session.commit()
          return jsonify({'message': 'Record deleted'})
  
      if __name__ == '__main__':
          db.create_all()
          app.run(debug=True)
  