<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def split_window(self, fpath, vertical=False, size=None, bufopts=None):
 """Open file in a new split window. Args: fpath (str):
 Path of the file to open. If ``None``, a new empty split is created. vertical (bool):
 Whether to open a vertical split. size (Optional[int]):
 The height (or width) to set for the new window. bufopts (Optional[dict]):
 Buffer-local options to set in the split window. See :func:`.set_buffer_options`. """

        command = 'split {}'.format(fpath) if fpath else 'new'
        if vertical:
            command = 'v' + command
        if size:
            command = str(size) + command

        self._vim.command(command)

        if bufopts:
            self.set_buffer_options(bufopts)