Return index values for instance identification

def getIndicesFromInstId(self, instId):
        """Return index values for instance identification"""
        if instId in self._idToIdxCache:
            return self._idToIdxCache[instId]

        indices = []
        for impliedFlag, modName, symName in self._indexNames:
            mibObj, = mibBuilder.importSymbols(modName, symName)
            try:
                syntax, instId = self.oidToValue(mibObj.syntax, instId, impliedFlag, indices)
            except PyAsn1Error as exc:
                debug.logger & debug.FLAG_INS and debug.logger(
                    'error resolving table indices at %s, %s: %s' % (self.__class__.__name__, instId, exc))
                indices = [instId]
                instId = ()
                break

            indices.append(syntax)  # to avoid cyclic refs

        if instId:
            raise error.SmiError(
                'Excessive instance identifier sub-OIDs left at %s: %s' %
                (self, instId)
            )

        indices = tuple(indices)
        self._idToIdxCache[instId] = indices

        return indices