'Internal function.'

def _grid_configure(self, command, index, cnf, kw):

    if ((type(cnf) is StringType) and (not kw)):
        if (cnf[(-1):] == '_'):
            cnf = cnf[:(-1)]
        if (cnf[:1] != '-'):
            cnf = ('-' + cnf)
        options = (cnf,)
    else:
        options = self._options(cnf, kw)
    if (not options):
        res = self.tk.call('grid', command, self._w, index)
        words = self.tk.splitlist(res)
        dict = {}
        for i in range(0, len(words), 2):
            key = words[i][1:]
            value = words[(i + 1)]
            dict[key] = self._gridconvvalue(value)
        return dict
    res = self.tk.call((('grid', command, self._w, index) + options))
    if (len(options) == 1):
        return self._gridconvvalue(res)
