<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def retrieve_flags(flag_dict, flag_filter):
 """Read the flags from a dictionary and return them in a usable form. Will return a list of (flag, value) for all flags in "flag_dict" matching the filter "flag_filter". """


    return [(flag, value) for flag, value in list(flag_dict.items()) if
            isinstance(flag, (str, bytes)) and flag.startswith(flag_filter)]