input: 
  from flask import Flask, request
  from flask_restful import Resource, Api
  from flask_jwt import JWT, jwt_required
  
  app = Flask(name)
  api = Api(app)
  
  # Setup JWT authentication
  app.secret_key = 'super-secret-key'
  jwt = JWT(app, authenticate, identity)
  
  items = []
  
  class Item(Resource):
   @jwt_required()
   def get(self, name):
   for item in items:
   if item['name'] == name:
   return item
   return {'item': None}, 404
  
   def post(self, name):
   new_item = {'name': name, 'price': 12.00}
   items.append(new_item)
   return new_item, 201
  
  
  class ItemList(Resource):
   def get(self):
   return {'items': items}
  
  
  api.add_resource(Item, '/item/<string:name>')
  api.add_resource(ItemList, '/items')
  
  if name == 'main':
   app.run(port=5000, debug=True)
  
  
  def authenticate(username, password):
      """This function is provided to the JWT object to authenticate users.
      >>> authenticate('user1', 'password1')
      {'username': 'user1'}
      >>> authenticate('user2', 'wrongpassword')
      None
      """
      users = [
          {'username': 'user1', 'password': 'password1'},
          {'username': 'user2', 'password': 'password2'}
      ]
      for user in users:
          if user['username'] == username and user['password'] == password:
              return {'username': username}
      return None
  
  def identity(payload):
      """This function is provided to the JWT object to identity authenticated users.
      >>> identity({'identity': 0})
      {'username': 'user1'}
      >>> identity({'identity': 1})
      {'username': 'user2'}
      """
      user_id = payload['identity']
      users = [
          {'username': 'user1'},
          {'username': 'user2'}
      ]
      return users[user_id]
  
output:     
      users = [
          {'username': 'user1', 'password': 'password1'},
          {'username': 'user2', 'password': 'password2'}
      ]
      for user in users:
          if user['username'] == username and user['password'] == password:
              return {'username': username}
      return None
  
  def identity(payload):
      user_id = payload['identity']
      users = [
          {'username': 'user1'},
          {'username': 'user2'}
      ]
      return users[user_id]
  