<s> """<STR_LIT>""" <EOL> from flask import Flask <EOL> from flask import request <EOL> app = Flask ( __name__ ) <EOL> from train_data_service import TrainDataService <EOL> TRAIN_DATA = None <EOL> @ app . route ( '<STR_LIT:/>' ) <EOL> def hello_world ( ) : <EOL> return '<STR_LIT>' <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def data_for_train ( train_id ) : <EOL> return TRAIN_DATA . data_for_train ( train_id ) <EOL> @ app . route ( '<STR_LIT>' , methods = [ "<STR_LIT:POST>" ] ) <EOL> def reserve ( ) : <EOL> train_id = request . form [ "<STR_LIT>" ] <EOL> seat_ids = request . form [ "<STR_LIT>" ] <EOL> booking_reference = request . form [ "<STR_LIT>" ] <EOL> return TRAIN_DATA . reserve ( train_id , seat_ids , booking_reference ) <EOL> @ app . route ( '<STR_LIT>' ) <EOL> def reset ( train_id ) : <EOL> return TRAIN_DATA . reset ( train_id ) <EOL> def start ( trains_data ) : <EOL> global TRAIN_DATA <EOL> TRAIN_DATA = TrainDataService ( trains_data ) <EOL> app . config [ "<STR_LIT>" ] = "<STR_LIT>" <EOL> app . config [ "<STR_LIT>" ] = True <EOL> app . run ( ) </s>
