Function
optparse.check_choice

Signature

check_choice(option, opt, value)