docs: 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 [(f[0], f[1]) for f in flag_dict.items() if
              isinstance(f[0], str) and f[0].startswith(flag_filter)]