code: def configure(cls, global_, key, val):
          
          # first retrieve current configuration
          scope = 'global' if global_ else 'local'
          if scope not in cls._conffiles:
              cls._conffiles[scope] = {}
          config = cls._conffiles.get(scope, {})
          # apply modification to fields
          cls._set(scope, key, val)
          conf_file = cls.home_config if global_ else cls.local_config
          # save configuration to file
          cls.save(os.path.expanduser(conf_file), config)
docs: Update and save configuration value to file.