def assertItemsEqual(self, expected_seq, actual_seq, msg=None):
try:<EOL><INDENT>expected = sorted(expected_seq)<EOL>actual = sorted(actual_seq)<EOL><DEDENT>except TypeError:<EOL><INDENT>expected = list(expected_seq)<EOL>actual = list(actual_seq)<EOL>missing, unexpected = unorderable_list_difference(<EOL>expected, actual, ignore_duplicate=False<EOL>)<EOL><DEDENT>else:<EOL><INDENT>return self.assertSequenceEqual(expected, actual, msg=msg)<EOL><DEDENT>errors = []<EOL>if missing:<EOL><INDENT>errors.append('<STR_LIT>' % <EOL>safe_repr(missing))<EOL><DEDENT>if unexpected:<EOL><INDENT>errors.append('<STR_LIT>' % <EOL>safe_repr(unexpected))<EOL><DEDENT>if errors:<EOL><INDENT>standardMsg = '<STR_LIT:\n>'.join(errors)<EOL>self.fail(self._formatMessage(msg, standardMsg))<EOL><DEDENT>
An unordered sequence specific comparison. It asserts that
        expected_seq and actual_seq contain the same elements. It is
        the equivalent of::

            self.assertEqual(sorted(expected_seq), sorted(actual_seq))

        Raises with an error message listing which elements of expected_seq
        are missing from actual_seq and vice versa if any.

        Asserts that each element has the same count in both sequences.
        Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.