from orangescape.model.engine.exception.Error import FormulaArgumentError
from orangescape.model.engine.exception.ErrorMessage import  *

def CHOOSE(argList):
    IndexNum=int(argList[0])
    if IndexNum>0 and IndexNum<len(argList):
        return argList[IndexNum]
    else:
       raise FormulaArgumentError,Engine2017 % (1,'CHOOSE',IndexNum)