def book_car(intent_request):
slots = intent_request['<STR_LIT>']['<STR_LIT>']<EOL>pickup_city = slots['<STR_LIT>']<EOL>pickup_date = slots['<STR_LIT>']<EOL>return_date = slots['<STR_LIT>']<EOL>driver_age = slots['<STR_LIT>']<EOL>car_type = slots['<STR_LIT>']<EOL>confirmation_status = intent_request['<STR_LIT>']['<STR_LIT>']<EOL>session_attributes = intent_request['<STR_LIT>']<EOL>last_confirmed_reservation = try_ex(lambda: session_attributes['<STR_LIT>'])<EOL>if last_confirmed_reservation:<EOL><INDENT>last_confirmed_reservation = json.loads(last_confirmed_reservation)<EOL><DEDENT>confirmation_context = try_ex(lambda: session_attributes['<STR_LIT>'])<EOL>reservation = json.dumps({<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': pickup_city,<EOL>'<STR_LIT>': pickup_date,<EOL>'<STR_LIT>': return_date,<EOL>'<STR_LIT>': car_type<EOL>})<EOL>session_attributes['<STR_LIT>'] = reservation<EOL>if pickup_city and pickup_date and return_date and driver_age and car_type:<EOL><INDENT>price = generate_car_price(pickup_city, get_day_difference(pickup_date, return_date), driver_age, car_type)<EOL>session_attributes['<STR_LIT>'] = price<EOL><DEDENT>if intent_request['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>validation_result = validate_book_car(intent_request['<STR_LIT>']['<STR_LIT>'])<EOL>if not validation_result['<STR_LIT>']:<EOL><INDENT>slots[validation_result['<STR_LIT>']] = None<EOL>return elicit_slot(<EOL>session_attributes,<EOL>intent_request['<STR_LIT>']['<STR_LIT:name>'],<EOL>slots,<EOL>validation_result['<STR_LIT>'],<EOL>validation_result['<STR_LIT:message>']<EOL>)<EOL><DEDENT>if confirmation_status == '<STR_LIT>':<EOL><INDENT>try_ex(lambda: session_attributes.pop('<STR_LIT>'))<EOL>try_ex(lambda: session_attributes.pop('<STR_LIT>'))<EOL>if confirmation_context == '<STR_LIT>':<EOL><INDENT>return elicit_slot(<EOL>session_attributes,<EOL>intent_request['<STR_LIT>']['<STR_LIT:name>'],<EOL>{<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None<EOL>},<EOL>'<STR_LIT>',<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:content>': '<STR_LIT>'<EOL>}<EOL>)<EOL><DEDENT>return delegate(session_attributes, intent_request['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>if confirmation_status == '<STR_LIT:None>':<EOL><INDENT>if (not pickup_city and not pickup_date and not return_date and not driver_age and not car_type)or confirmation_context == '<STR_LIT>':<EOL><INDENT>if last_confirmed_reservation and try_ex(lambda: last_confirmed_reservation['<STR_LIT>']) == '<STR_LIT>':<EOL><INDENT>session_attributes['<STR_LIT>'] = '<STR_LIT>'<EOL>return confirm_intent(<EOL>session_attributes,<EOL>intent_request['<STR_LIT>']['<STR_LIT:name>'],<EOL>{<EOL>'<STR_LIT>': last_confirmed_reservation['<STR_LIT>'],<EOL>'<STR_LIT>': last_confirmed_reservation['<STR_LIT>'],<EOL>'<STR_LIT>': add_days(<EOL>last_confirmed_reservation['<STR_LIT>'], last_confirmed_reservation['<STR_LIT>']<EOL>),<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': None<EOL>},<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:content>': '<STR_LIT>'.format(<EOL>last_confirmed_reservation['<STR_LIT>'],<EOL>last_confirmed_reservation['<STR_LIT>'],<EOL>last_confirmed_reservation['<STR_LIT>']<EOL>)<EOL>}<EOL>)<EOL><DEDENT><DEDENT>return delegate(session_attributes, intent_request['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT>if confirmation_status == '<STR_LIT>':<EOL><INDENT>try_ex(lambda: session_attributes.pop('<STR_LIT>'))<EOL>if confirmation_context == '<STR_LIT>':<EOL><INDENT>if not driver_age:<EOL><INDENT>return elicit_slot(<EOL>session_attributes,<EOL>intent_request['<STR_LIT>']['<STR_LIT:name>'],<EOL>intent_request['<STR_LIT>']['<STR_LIT>'],<EOL>'<STR_LIT>',<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:content>': '<STR_LIT>'<EOL>}<EOL>)<EOL><DEDENT>elif not car_type:<EOL><INDENT>return elicit_slot(<EOL>session_attributes,<EOL>intent_request['<STR_LIT>']['<STR_LIT:name>'],<EOL>intent_request['<STR_LIT>']['<STR_LIT>'],<EOL>'<STR_LIT>',<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:content>': '<STR_LIT>'<EOL>'<STR_LIT>'<EOL>}<EOL>)<EOL><DEDENT><DEDENT>return delegate(session_attributes, intent_request['<STR_LIT>']['<STR_LIT>'])<EOL><DEDENT><DEDENT>logger.debug('<STR_LIT>'.format(reservation))<EOL>del session_attributes['<STR_LIT>']<EOL>del session_attributes['<STR_LIT>']<EOL>session_attributes['<STR_LIT>'] = reservation<EOL>return close(<EOL>session_attributes,<EOL>'<STR_LIT>',<EOL>{<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT:content>': '<STR_LIT>'<EOL>}<EOL>)<EOL>
Performs dialog management and fulfillment for booking a car.

Beyond fulfillment, the implementation for this intent demonstrates the following:
1) Use of elicitSlot in slot validation and re-prompting
2) Use of sessionAttributes to pass information that can be used to guide conversation