def getFromList(xvar, xvarbase, errMsg):
    indxtf = [x.startswith(xvar.lower()) for x in xvarbase] # find index 
    xvarind = [i for i in range(len(indxtf)) if indxtf[i] == True]
    if len(xvarind) == 0:
        raise ValueError(errMsg)
    else:
        xvar = xvarbase[xvarind[0]]
    return xvar