def normalize_date_aggressively(date):
def _strip_last_part(date):<EOL><INDENT>parts = date.split('<STR_LIT:->')<EOL>return '<STR_LIT:->'.join(parts[:-<NUM_LIT:1>])<EOL><DEDENT>fake_dates = {'<STR_LIT>', '<STR_LIT>'}<EOL>if date in fake_dates:<EOL><INDENT>return None<EOL><DEDENT>try:<EOL><INDENT>return normalize_date(date)<EOL><DEDENT>except ValueError:<EOL><INDENT>if '<STR_LIT:->' not in date:<EOL><INDENT>raise<EOL><DEDENT>else:<EOL><INDENT>new_date = _strip_last_part(date)<EOL>return normalize_date_aggressively(new_date)<EOL><DEDENT><DEDENT>
Normalize date, stripping date parts until a valid date is obtained.