def remove_whitespace(event, field_or_field_list):
    """ Remove leading and trailing whitespace

    :param event: A dictionary
    :param field_or_field_list: A field or list of fields to trim the whitespace from
    :return: A trimmed string

    Examples:

    .. code-block:: python

        # Example #1
        event = {'a_field': '  should not have whitespace at ends    '}
        event = remove_whitespace(event, field_or_field_list='a_field')
        event = {'a_field': 'should not have whitespace at ends'}

        # Example #2
        event = {'a_field': '  should not have whitespace at ends    ',
                'another_field': '  also should not have whitespace at ends    '}
        event = remove_whitespace(event, field_or_field_list=['a_field', 'another_field'])
        event = {'a_field': 'should not have whitespace at ends',
                'another_field': 'also should not have whitespace at ends'}


    """

    if type(field_or_field_list) is not list:
        field_or_field_list = [field_or_field_list]

    for field in field_or_field_list:
        if field in event and isinstance(event[field], str):
            event[field] = event[field].strip()

    return event