def get_exp_with_draft_applied(exp_id, user_id):
 exp_user_data = user_models.ExplorationUserDataModel.get(user_id, exp_id)
 exploration = get_exploration_by_id(exp_id)
 return (apply_change_list(exp_id, exp_user_data.draft_change_list) if (exp_user_data and exp_user_data.draft_change_list and is_version_of_draft_valid(exp_id, exp_user_data.draft_change_list_exp_version)) else exploration)

def get_exp_with_draft_applied ( exp_id , user_id ) : exp_user_data = user_models . ExplorationUserDataModel . get ( user_id , exp_id ) exploration = get_exploration_by_id ( exp_id ) return ( apply_change_list ( exp_id , exp_user_data . draft_change_list ) if ( exp_user_data and exp_user_data . draft_change_list and is_version_of_draft_valid ( exp_id , exp_user_data . draft_change_list_exp_version ) ) else exploration )
if a draft exists for the given user and exploration .