def clean_field_dict(field_dict, cleaner=str.strip, time_zone=None):
d = {}<EOL>if time_zone is None:<EOL><INDENT>tz = DEFAULT_TZ<EOL><DEDENT>for k, v in viewitems(field_dict):<EOL><INDENT>if k == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>if isinstance(v, basestring):<EOL><INDENT>d[k] = cleaner(str(v))<EOL><DEDENT>elif isinstance(v, (datetime.datetime, datetime.date)):<EOL><INDENT>d[k] = tz.localize(v)<EOL><DEDENT>else:<EOL><INDENT>d[k] = v<EOL><DEDENT><DEDENT>return d<EOL>
r"""Normalize field values by stripping whitespace from strings, localizing datetimes to a timezone, etc

    >>> (sorted(clean_field_dict({'_state': object(), 'x': 1, 'y': "\t  Wash Me! \n" }).items()) ==
    ... [('x', 1), ('y', 'Wash Me!')])
    True