<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _check_type(name, obj, expected_type):
 """ Raise a TypeError if object is not of expected type """

    if not isinstance(obj, expected_type):
        raise TypeError(
            '"%s" must be an a %s' % (name, expected_type.__name__)
        )