<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ensure_instance(value, types):
 """ Ensure value is an instance of a certain type Traceback (most recent call last):
 TypeError: Traceback (most recent call last):
 TypeError: :attr types: Type of list of types """

    if not isinstance(value, types):
        raise TypeError(
            "expected instance of {}, got {}".format(
                types, value))