def _check_template_consistency(self, nestedName: ASTNestedName, templatePrefix: ASTTemplateDeclarationPrefix, fullSpecShorthand: bool, isMember: bool=False) -> ASTTemplateDeclarationPrefix:
    numArgs = nestedName.num_templates()
    isMemberInstantiation = False
    if (not templatePrefix):
        numParams = 0
    elif (isMember and (templatePrefix.templates is None)):
        numParams = 0
        isMemberInstantiation = True
    else:
        numParams = len(templatePrefix.templates)
    if ((numArgs + 1) < numParams):
        self.fail(('Too few template argument lists comapred to parameter lists. Argument lists: %d, Parameter lists: %d.' % (numArgs, numParams)))
    if (numArgs > numParams):
        numExtra = (numArgs - numParams)
        if ((not fullSpecShorthand) and (not isMemberInstantiation)):
            msg = ('Too many template argument lists compared to parameter lists. Argument lists: %d, Parameter lists: %d, Extra empty parameters lists prepended: %d.' % (numArgs, numParams, numExtra))
            msg += ' Declaration:\n\t'
            if templatePrefix:
                msg += ('%s\n\t' % templatePrefix)
            msg += str(nestedName)
            self.warn(msg)
        newTemplates = []
        for i in range(numExtra):
            newTemplates.append(ASTTemplateParams([]))
        if (templatePrefix and (not isMemberInstantiation)):
            newTemplates.extend(templatePrefix.templates)
        templatePrefix = ASTTemplateDeclarationPrefix(newTemplates)
    return templatePrefix
def _check_template_consistency(self, nestedName: ASTNestedName, templatePrefix: ASTTemplateDeclarationPrefix, fullSpecShorthand: bool, isMember: bool=False) -> ASTTemplateDeclarationPrefix:
    numArgs = nestedName.num_templates()
    isMemberInstantiation = False
    if (not templatePrefix):
        numParams = 0
    elif (isMember and (templatePrefix.templates is None)):
        numParams = 0
        isMemberInstantiation = True
    else:
        numParams = len(templatePrefix.templates)
    if ((numArgs + 1) < numParams):
        self.fail(('Too few template argument lists comapred to parameter lists. Argument lists: %d, Parameter lists: %d.' % (numArgs, numParams)))
    if (numArgs > numParams):
        numExtra = (numArgs - numParams)
        if ((not fullSpecShorthand) and (not isMemberInstantiation)):
            msg = ('Too many template argument lists compared to parameter lists. Argument lists: %d, Parameter lists: %d, Extra empty parameters lists prepended: %d.' % (numArgs, numParams, numExtra))
            msg += ' Declaration:\n\t'
            if templatePrefix:
                msg += ('%s\n\t' % templatePrefix)
            msg += str(nestedName)
            self.warn(msg)
        newTemplates = []
        for i in range(numExtra):
            newTemplates.append(ASTTemplateParams([]))
        if (templatePrefix and (not isMemberInstantiation)):
            newTemplates.extend(templatePrefix.templates)
        templatePrefix = ASTTemplateDeclarationPrefix(newTemplates)
    return templatePrefix