input: def generate_rest_api():
      """Generate a basic REST API with authentication and endpoints in Python.
      The API should include JWT authentication, a list of items, and endpoints to retrieve
      a specific item or a list of all items.
      >>> generate_rest_api()
      # Output as described in the function
      """
output:     
      from flask import Flask, jsonify, request
      from flask_jwt_extended import JWTManager, jwt_required, create_access_token, get_jwt_identity
      from flask_restful import Api, Resource
  
      app = Flask(__name__)
      app.config['JWT_SECRET_KEY'] = 'super-secret'  # Change this in production
      jwt = JWTManager(app)
      api = Api(app)
  
      items = []
  
      class Item(Resource):
          @jwt_required()
          def get(self, name):
              item = next(filter(lambda x: x['name'] == name, items), None)
              return {'item': item}, 200 if item else 404
  
          @jwt_required()
          def post(self, name):
              if next(filter(lambda x: x['name'] == name, items), None):
                  return {'message': f"An item with name '{name}' already exists."}, 400
              data = request.get_json()
              item = {'name': name, 'price': data['price']}
              items.append(item)
              return item, 201
  
      class ItemList(Resource):
          @jwt_required()
          def get(self):
              return {'items': items}, 200
  
      class User(Resource):
          def post(self):
              data = request.get_json()
              access_token = create_access_token(identity=data['username'])
              return {'access_token': access_token}, 200
  
      api.add_resource(Item, '/item/<string:name>')
      api.add_resource(ItemList, '/items')
      api.add_resource(User, '/login')
  
      if __name__ == '__main__':
          app.run(debug=True)
  