def completions(self, *args):
        """Get completions from the server.

        If the number of completions already performed reaches a threshold,
        restart the server.
        """
        if self._count > self.max_completion_count:
            self._count = 0
            self.restart()

        self._count += 1
        stream_write(self._server.stdin, args)
        return stream_read(self._server.stdout)
dataset/ETHPy150Open zchee/deoplete-jedi/rplugin/python3/deoplete/sources/deoplete_jedi/server.py/Client.completions/original