def validate_date(date):
    if date is None or date == '':
        return ''
    try:
        datetime.strptime(date, '%Y%m%d')
        return date
    except __HOLE__:
        raise InvalidDate('{0} is not a valid YYYYMMDD date.'.format(date))
dataset/ETHPy150Open 55minutes/python-epo-ops-client/epo_ops/utils.py/validate_date