def _check_duration(option, opt, value):
    try:
        if value[-1].isdigit():
            return int(value)
        else:
            return int(value[:-1]) * _time_units[value[-1]]
    except (__HOLE__, IndexError):
        raise OptionValueError(
            'option %s: invalid duration: %r' % (opt, value))
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/test/test_optparse.py/_check_duration