def _check_histories(history1, history2):
    """Check if two histories are the same."""
    if history1.replace('\n', '').replace(' ', '') == history2.replace('\n', ''
        ).replace(' ', ''):
        return True
    else:
        return False
