def infer(examples, alt_rules=None):
date_classes = _tag_most_likely(examples)<EOL>if alt_rules:<EOL><INDENT>date_classes = _apply_rewrites(date_classes, alt_rules)<EOL><DEDENT>else:<EOL><INDENT>date_classes = _apply_rewrites(date_classes, RULES)<EOL><DEDENT>date_string = '<STR_LIT>'<EOL>for date_class in date_classes:<EOL><INDENT>date_string += date_class.directive<EOL><DEDENT>return date_string<EOL>
Returns a datetime.strptime-compliant format string for parsing the *most likely* date format
used in examples. examples is a list containing example date strings.