def separate_errors_and_records(errors_and_records):
    """
    >>> errors_and_records = [({'the_record':'foo'}, "ERROR"),
    ...                       ({'another':'thing'}, None)]
    >>> separate_errors_and_records(errors_and_records)
    ([{'the_record': 'foo'}, {'another': 'thing'}], ['ERROR'])
    """
    records = map(lambda item: item[0],
                  errors_and_records)
    errors = map(lambda item: item[1],
                 filter(lambda item: item[1] is not None,
                        errors_and_records))
    return (records, errors)