<commit_before>from __future__ import with_statement
from StringIO import StringIO
import time
import os

import unittest
from robot.output.xmllogger import XmlLogger

from robot.reporting.outputparser import OutputParser, CombiningOutputParser
from robot.result.model import Message
from robot.utils.abstractxmlwriter import AbstractXmlWriter
from robot.utils.asserts import assert_equals, assert_true


def assert_model(data_model, basemillis=None, suite=None, strings=None, plain_suite=None):
    if basemillis is not None:
        basemillis += time.altzone*1000
        assert_equals(data_model._robot_data['baseMillis'], basemillis)
    if suite is not None:
        assert_equals(data_model._robot_data['suite'], suite)
    if strings is not None:
        assert_equals(data_model._robot_data['strings'], strings)
    if plain_suite is not None:
        _assert_plain_suite(data_model, plain_suite)


def _assert_plain_suite(data_model, plain_suite):
    _assert_plain_suite_item(plain_suite, data_model._robot_data['suite'], data_model._robot_data['strings'])

def _assert_plain_suite_item(expected, actual, strings):
    if isinstance(expected, (float, int)):<commit_msg>correct import after moving class<commit_after>from __future__ import with_statement
from StringIO import StringIO
import time
import os

import unittest
from robot.output.xmllogger import XmlLogger

from robot.reporting.outputparser import OutputParser, CombiningOutputParser
from robot.model import Message
from robot.utils.abstractxmlwriter import AbstractXmlWriter
from robot.utils.asserts import assert_equals, assert_true


def assert_model(data_model, basemillis=None, suite=None, strings=None, plain_suite=None):
    if basemillis is not None:
        basemillis += time.altzone*1000
        assert_equals(data_model._robot_data['baseMillis'], basemillis)
    if suite is not None:
        assert_equals(data_model._robot_data['suite'], suite)
    if strings is not None:
        assert_equals(data_model._robot_data['strings'], strings)
    if plain_suite is not None:
        _assert_plain_suite(data_model, plain_suite)


def _assert_plain_suite(data_model, plain_suite):
    _assert_plain_suite_item(plain_suite, data_model._robot_data['suite'], data_model._robot_data['strings'])

def _assert_plain_suite_item(expected, actual, strings):
    if isinstance(expected, (float, int)):
{'fraction_non_alphanumeric': 0.0762747576906869, 'fraction_numerical': 0.00337126000842815, 'mean_word_length': 5.782857142857143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5613422', 'n_tokens_mistral': 713, 'n_tokens_neox': 698, 'n_words': 175}