<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_by_flags(self, flags):
 """Iterate all register infos matching the given flags."""

        for reg in self._reg_infos:
            if reg.flags & flags == flags:
                yield reg