code: def dump(self, full=True, redact=False):
          
          if full:
              out_dict = self.flatten(redact=redact)
          else:
              # Exclude defaults when flattening.
              sources = [s for s in self.sources if not s.default]
              temp_root = RootView(sources)
              temp_root.redactions = self.redactions
              out_dict = temp_root.flatten(redact=redact)
  
          yaml_out = yaml.dump(out_dict, Dumper=Dumper,
                               default_flow_style=None, indent=4,
                               width=1000)
  
          # Restore comments to the YAML text.
          default_source = None
          for source in self.sources:
              if source.default:
                  default_source = source
                  break
          if default_source and default_source.filename:
              with open(default_source.filename, 'rb') as fp:
                  default_data = fp.read()
              yaml_out = restore_yaml_comments(yaml_out,
                                               default_data.decode('utf-8'))
  
          return yaml_out
docs: Dump the Configuration object to a YAML file.
  
          The order of the keys is determined from the default
          configuration file. All keys not in the default configuration
          will be appended to the end of the file.
  
          :param filename:  The file to dump the configuration to, or None
                            if the YAML string should be returned instead
          :type filename:   unicode
          :param full:      Dump settings that don't differ from the defaults
                            as well
          :param redact:    Remove sensitive information (views with the `redact`
                            flag set) from the output