elif model is ANM:
model = "anm"
elif isinstance(model, str):
model = model.lower().strip()
else:
raise TypeError("invalid type for model: {0}".format(type(model)))
if isinstance(trim, str):
trim = trim.lower().strip()
elif trim is reduceModel:
trim = "reduce"
elif trim is sliceModel:
trim = "slice"
elif trim is None:
trim = "trim"
else:
raise TypeError("invalid type for trim: {0}".format(type(model)))
if trim == "trim" and select is not None:
if isinstance(select, str):