def getPositionByName(self, name):
        if not self.__nameToPosIdx:
            idx = self.__namedTypesLen
            while idx > 0:
                idx = idx - 1
                n = self.__namedTypes[idx].getName()
                if n in self.__nameToPosIdx:
                    raise error.PyAsn1Error('Duplicate name %s' % (n,))
                self.__nameToPosIdx[n] = idx
        try:
            return self.__nameToPosIdx[name]
        except __HOLE__:
            raise error.PyAsn1Error('Name %s not found' % (name,))
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/pyasn1/type/namedtype.py/NamedTypes.getPositionByName