<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _sequence_query(self):
 """ query all sequence rows """

        klass = self.__class__
        query = klass.select().where(klass.sequence.is_null(False))
        seq_scope_field_names =\
            (self.__seq_scope_field_name__ or '').split(',')
        for name in seq_scope_field_names:
            seq_scope_field = getattr(klass, name, None)
            if seq_scope_field:
                seq_scope_field_value = getattr(self, name)
                query = query.where(seq_scope_field == seq_scope_field_value)
        return query