<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_relavent_flags(self):
        '''
        Retrieves the relevant flags for this data block.

        Returns:
            All flags related to this block.
        '''
        relavent_flags = {}

        for code, flags_list in self.flags.items():
            relavent_flags[code] = []
            for flag in flags_list:
                if self.flag_is_related(flag):
                    relavent_flags[code].append(flag)
            # Remove that flag level if no error exists
            if not relavent_flags[code]:
                del relavent_flags[code]

        return relavent_flags