<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reverse_formats(format_string, resolved_strings):
 """ Reverse the string method format for a list of strings. Given format_string and resolved_strings, for each resolved string find arguments that would give ``format_string.format(**arguments) == resolved_string``. Each item in the output corresponds to a new column with the key setting the name and the values representing a mapping from list of resolved_strings to the related value. Parameters format_strings : str Format template string as used with str.format method resolved_strings : list List of strings with same pattern as format_string but with fields filled out. Returns ------- args : dict the same order as resolved_strings, so: ``format_sting.format(**{f: v[0] for f, v in args.items()}) == resolved_strings[0]`` Examples -------- {'year': ['2014', '2014', '2015'], 'month': ['01', '02', '12'], 'day': ['03', '03', '03']} {'year': [2014, 2014, 2015], 'month': [1, 2, 12], 'day': [3, 3, 3]} {'date': [datetime.datetime(2014, 1, 3, 0, 0), datetime.datetime(2014, 2, 3, 0, 0), datetime.datetime(2015, 12, 3, 0, 0)]} {'state': ['PA', 'PA', 'MA'], 'zip': ['19104', '19143', '02534']} See also -------- str.format : method that this reverses reverse_format : method for reversing just one string using a pattern """

    from string import Formatter

    fmt = Formatter()

    # get the fields from the format_string
    field_names = [i[1] for i in fmt.parse(format_string) if i[1]]

    # itialize the args dict with an empty dict for each field
    args = {field_name: [] for field_name in field_names}
    for resolved_string in resolved_strings:
        for field, value in reverse_format(format_string, resolved_string).items():
            args[field].append(value)

    return args