def ensure(self, option_name, check, message=None):
        o = self.options[option_name]
        if isinstance(check, basestring):
            # regexp patter
            import re
            for v in o.value:
                if not re.match(check, str(v)):
                    self.validation_error(
                        message if message else "check failed for %s" % str(v)
                    )
            return
        elif callable(check):
            if o.nargs == 0 or o.nargs == 1:
                for v in o.value:
                    if not check(v):
                        self.validation_error(
                            message if message
                            else "check failed for %s" % str(v)
                        )
            else:
                if not check(o.value):
                    self.validation_error(
                        message if message else "check failed for %s" % str(v)
                    )
            return
        raise Exception("Ensure check paramter has to be a "
                        "function or a pattern")
Returns the current output directory basename override value.
dataset/ETHPy150Open thasso/pyjip/jip/tools.py/Tool.ensure--crossover with--dataset/ETHPy150Open devttys0/binwalk/src/binwalk/modules/extractor.py/Extractor.get_output_directory_override