def retrieve_flags(flag_dict, flag_filter):
 return [(f[0], f[1]) for f in list(flag_dict.items()) if (isinstance(f[0], (str, bytes)) and f[0].startswith(flag_filter))]

def retrieve_flags ( flag_dict , flag_filter ) : return [ ( f [ 0 ] , f [ 1 ] ) for f in list ( flag_dict . items ( ) ) if ( isinstance ( f [ 0 ] , ( str , bytes ) ) and f [ 0 ] . startswith ( flag_filter ) ) ]
read the flags from a dictionary and return them in a usable form .