code: def set_buffer_options(self, options, bufnr=None):
          
          buf = self._vim.buffers[bufnr] if bufnr else self._vim.current.buffer
  
          # Special case handling for filetype, see doc on ``set_filetype``
          filetype = options.pop('filetype', None)
          if filetype:
              self.set_filetype(filetype)
  
          for opt, value in options.items():
              buf.options[opt] = value
docs: Set buffer-local options for a buffer, defaulting to current.
  
          Args:
              options (dict):
                  Options to set, with keys being Vim option names. For Boolean
                  options, use a :class:`bool` value as expected, e.g.
                  ``{'buflisted': False}`` for ``setlocal nobuflisted``.
              bufnr (Optional[int]):
                  A Vim buffer number, as you might get from VimL ``bufnr('%')``
                  or Python ``vim.current.buffer.number``. If ``None``, options
                  are set on the current buffer.