Return the next possible completion for ``word``.

        This is called successively with ``state == 0, 1, 2, ...`` until it
        returns ``None``.

        The completion should begin with ``word``.

        :param word: the word to complete
        :param state: an int, used to iterate over the choices

def complete(self, word, state):
        """Return the next possible completion for ``word``.

        This is called successively with ``state == 0, 1, 2, ...`` until it
        returns ``None``.

        The completion should begin with ``word``.

        :param word: the word to complete
        :param state: an int, used to iterate over the choices
        """
        try:
            import rl
            # TODO: doing this manually right now, but may make sense to
            # exploit
            rl.completion.suppress_append = True
        except ImportError:
            pass
        word = transform(word, self.transforms, word=True)

        if state == 0:
            self.matches = self.get_matches(word)

        try:
            match = self.matches[state]
        except IndexError:
            return None
        else:
            return transform(match, self.transforms, word=True, inverse=True)