def parse_date(date_candidate):
    formats = ('%Y-%m-%d', '%Y%m%d', '%m/%d/%Y', '%m/%d/%y')
    for fmt in formats:
        try:
            parsed_date = datetime.strptime(date_candidate, fmt).date()
            return parsed_date
        except __HOLE__:
            pass
    raise ValueError(date_candidate)
dataset/ETHPy150Open sunlightlabs/clearspending/timeliness/management/commands/download_timeliness.py/parse_date