def preprocess_options(args):
    for (option, value) in args.items():
        try:
            cls = self.__options__[option]
        except KeyError:
            raise OptionError(("'%s' is not a valid option" % option))
        if issubclass(cls, Flag):
            if ((flags is None) or (option not in flags)):
                if strict:
                    raise OptionError(("'%s' flag is not allowed in this context" % option))
        if (value is not None):
            self[option] = cls.preprocess(value)
def preprocess_options(args):
    for (option, value) in args.items():
        try:
            cls = self.__options__[option]
        except KeyError:
            raise OptionError(("'%s' is not a valid option" % option))
        if issubclass(cls, Flag):
            if ((flags is None) or (option not in flags)):
                if strict:
                    raise OptionError(("'%s' flag is not allowed in this context" % option))
        if (value is not None):
            self[option] = cls.preprocess(value)