<commit_before>from robot.utils import asserts


class PackageKeyword(object):

    def package(self, name, keyword, *args):
        _, stdout, _ = self.client.exec_command("dpkg-query -f '${Status}' --show %s | grep -E '^install ok installed'" % name)
        found_package = stdout.readline() != ''
        self.builtin.run_keyword(keyword, name, found_package)

    def should_be_installed(self, name, found_package):
        asserts.fail_unless(found_package, 'Package %s not found.' % name)

    def should_not_be_installed(self, name, found_package):
        asserts.fail_if(found_package, 'Found package %s' % name)<commit_msg>make the keyword works both python 2 and 3<commit_after>from robot.utils import asserts


class PackageKeyword(object):

    def package(self, name, keyword, *args):
        _, stdout, _ = self.client.exec_command("dpkg-query -f '${Status}' --show %s | grep -E '^install ok installed'" % name)
        found_package = stdout.readline() != ''
        self.builtin.run_keyword(keyword, name, found_package)

    def should_be_installed(self, name, found_package):
        asserts.assert_equal(found_package, 'Package %s not found.' % name)

    def should_not_be_installed(self, name, found_package):
        asserts.assert_false(found_package, 'Found package %s' % name)
{'fraction_non_alphanumeric': 0.12279355333844973, 'fraction_numerical': 0.0015349194167306216, 'mean_word_length': 3.958174904942966, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '964671', 'n_tokens_mistral': 412, 'n_tokens_neox': 395, 'n_words': 101}