input: 
  def user_api():
      """Create a REST API in Python for creating and reading users. The API should 
      have endpoints for creating a user, reading all users, and reading a single 
      user.
  
      >>> app.test_client().post('/users', json={'name': 'John', 'email': 'john@example.com'}).status_code
      200
      >>> app.test_client().get('/users').get_json()
      [{'id': 1, 'name': 'John', 'email': 'john@example.com'}]
      >>> app.test_client().get('/users/1').get_json()
      {'id': 1, 'name': 'John', 'email': 'john@example.com'}
      """
  
output:     
      from flask import Flask, request, jsonify
      from flask_sqlalchemy import SQLAlchemy
  
      app = Flask(__name__)
      app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
      db = SQLAlchemy(app)
  
      class User(db.Model):
          id = db.Column(db.Integer, primary_key=True)
          name = db.Column(db.String(80), nullable=False)
          email = db.Column(db.String(120), nullable=False)
  
          def to_dict(self):
              return {'id': self.id, 'name': self.name, 'email': self.email}
  
      db.create_all()
  
      @app.route('/users', methods=['POST'])
      def create_user():
          data = request.get_json()
          new_user = User(name=data['name'], email=data['email'])
          db.session.add(new_user)
          db.session.commit()
          return jsonify(new_user.to_dict()), 200
  
      @app.route('/users', methods=['GET'])
      def get_users():
          users = User.query.all()
          return jsonify([user.to_dict() for user in users]), 200
  
      @app.route('/users/<int:user_id>', methods=['GET'])
      def get_user(user_id):
          user = User.query.get(user_id)
          if user:
              return jsonify(user.to_dict()), 200
          return jsonify({'error': 'User not found'}), 404
  