def check_date(option, opt, value):
    try:
        t = strptime(value, '%Y-%m-%d')
        return date(*t[:3])
    except __HOLE__:
        raise OptionValueError(
            'option %s: invalid date value: %r' % (opt, value)
        )
dataset/ETHPy150Open e-loue/django-lean/django_lean/lean_segments/management/commands/lean_segments.py/check_date