code: def write_min_config(self, filename,
                           header="# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n"):
          
          with self._open(filename, "w") as f:
              f.write(header)
  
              for sym in self.unique_defined_syms:
                  # Skip symbols that cannot be changed. Only check
                  # non-choice symbols, as selects don't affect choice
                  # symbols.
                  if not sym.choice and \
                     sym.visibility <= expr_value(sym.rev_dep):
                      continue
  
                  # Skip symbols whose value matches their default
                  if sym.str_value == sym._str_default():
                      continue
  
                  # Skip symbols that would be selected by default in a
                  # choice, unless the choice is optional or the symbol type
                  # isn't bool (it might be possible to set the choice mode
                  # to n or the symbol to m in those cases).
                  if sym.choice and \
                     not sym.choice.is_optional and \
                     sym.choice._get_selection_from_defaults() is sym and \
                     sym.orig_type is BOOL and \
                     sym.tri_value == 2:
                      continue
  
                  f.write(sym.config_string)
docs: Writes out a "minimal" configuration file, omitting symbols whose value
          matches their default value. The format matches the one produced by
          'make savedefconfig'.
  
          The resulting configuration file is incomplete, but a complete
          configuration can be derived from it by loading it. Minimal
          configuration files can serve as a more manageable configuration format
          compared to a "full" .config file, especially when configurations files
          are merged or edited by hand.
  
          filename:
            Self-explanatory.
  
          header (default: "# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)\n"):
            Text that will be inserted verbatim at the beginning of the file. You
            would usually want each line to start with '#' to make it a comment,
            and include a final terminating newline.