def _check_isinstance(left, right, cls):
err_msg = "<STR_LIT>"<EOL>cls_name = cls.__name__<EOL>if not isinstance(left, cls):<EOL><INDENT>raise AssertionError(err_msg.format(name=cls_name, exp_type=cls,<EOL>act_type=type(left)))<EOL><DEDENT>if not isinstance(right, cls):<EOL><INDENT>raise AssertionError(err_msg.format(name=cls_name, exp_type=cls,<EOL>act_type=type(right)))<EOL><DEDENT>
Helper method for our assert_* methods that ensures that
the two objects being compared have the right type before
proceeding with the comparison.

Parameters
----------
left : The first object being compared.
right : The second object being compared.
cls : The class type to check against.

Raises
------
AssertionError : Either `left` or `right` is not an instance of `cls`.