<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def questions(self, type=None):
 """Get questions associated with this participant. Return a list of questions associated with the participant. If specified, ``type`` filters by class. """

        if type is None:
            type = Question

        if not issubclass(type, Question):
            raise TypeError("{} is not a valid question type.".format(type))

        return type.query.filter_by(participant_id=self.id).all()