<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cast_to_type(self, value):
 """ Raise error if the value is not a list """

        if not isinstance(value, list):
            self.fail('invalid', value=value)
        return value