Cached variant of normalize

    Args:
        decl (declaration.declaration_t): the declaration

    Returns:
        str: normalized name
777282
def normalize_name(decl):
    
    if decl.cache.normalized_name is None:
        decl.cache.normalized_name = normalize(decl.name)
    return decl.cache.normalized_name
758240
def __decl_types(decl):
        """"""
        types = []
        bases = list(decl.__class__.__bases__)
        if 'pygccxml' in decl.__class__.__module__:
            types.append(decl.__class__)
        while bases:
            base = bases.pop()
            if base is declaration.declaration_t:
                continue
            if base is byte_info.byte_info:
                continue
            if base is elaborated_info.elaborated_info:
                continue
            if 'pygccxml' not in base.__module__:
                continue
            types.append(base)
            bases.extend(base.__bases__)
        return types
1013504
def decls(
            self,
            name=None,
            function=None,
            decl_type=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):
        """"""
        return (
            self._find_multiple(
                self._impl_matchers[
                    scopedef_t.decl],
                name=name,
                function=function,
                decl_type=decl_type,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
154399
def ENUM_DECL(self, cursor):
        """"""
        name = self.get_unique_name(cursor)
        if self.is_registered(name):
            return self.get_registered(name)
        align = cursor.type.get_align()
        size = cursor.type.get_size()
        obj = self.register(name, typedesc.Enumeration(name, size, align))
        self.set_location(obj, cursor)
        self.set_comment(obj, cursor)
        # parse all children
        for child in cursor.get_children():
            self.parse_cursor(child)  # FIXME, where is the starElement
        return obj
144514
def get_normalized_definition(self):
        """"""
        typedef = self.value_type.get_normalized_definition()
        return ('%s[<=%d]' if self.mode == ArrayType.MODE_DYNAMIC else '%s[%d]') % (typedef, self.max_size)
581846
function standardizeLets(declars) {
  var _arr = declars;

  for (var _i = 0; _i < _arr.length; _i++) {
    var declar = _arr[_i];
    delete declar._let;
  }
}
614938
def dpar(self, cl=1):
        
        sval = self.toString(self.value, quoted=1)
        if not cl:
            if sval == "": sval = "None"
        s = "%s = %s" % (self.name, sval)
        return s
883256
function getSourceString(visitor, decl) {
  const code = visitor.code;
  if (code) {
    return code.slice(
      decl.source.start,
      decl.source.end
    );
  }

  assert.strictEqual(typeof decl.source.value, "string");

  return JSON.stringify(decl.source.value);
}
242472
def normalize_string(mac_type, resource, content_hash):
    """"""

    normalized = [
        'hawk.' + str(HAWK_VER) + '.' + mac_type,
        normalize_header_attr(resource.timestamp),
        normalize_header_attr(resource.nonce),
        normalize_header_attr(resource.method or ''),
        normalize_header_attr(resource.name or ''),
        normalize_header_attr(resource.host),
        normalize_header_attr(resource.port),
        normalize_header_attr(content_hash or '')
    ]

    # The blank lines are important. They follow what the Node Hawk lib does.

    normalized.append(normalize_header_attr(resource.ext or ''))

    if resource.app:
        normalized.append(normalize_header_attr(resource.app))
        normalized.append(normalize_header_attr(resource.dlg or ''))

    # Add trailing new line.
    normalized.append('')

    normalized = '\n'.join(normalized)

    return normalized
80650
def normalize_name(context, constant = nil)
        case context
          when constant
            context.name
          when Symbol
            context.to_s
          else
            context
        end
      end
159905
def get_decl_pair(self):
        
        def get_tp():
            """ Iterator generating lines for struct definition. """
            decl = "struct "
            if self.tpname is not None:
                decl += self.tpname
                if self.inherit is not None:
                    decl += " : " + self.inherit
            yield decl
            yield "{"
            for f in self.fields:
                for f_line in f.generate():
                    yield "  " + f_line
            yield "} "
        return get_tp(), ""
432931
private void translateConstantDeclaration(WyilFile.Decl.StaticVariable decl) {
		if (decl.hasInitialiser()) {
			// The environments are needed to prevent clashes between variable
			// versions across verification conditions, and also to type variables
			// used in verification conditions.
			GlobalEnvironment globalEnvironment = new GlobalEnvironment(decl);
			LocalEnvironment localEnvironment = new LocalEnvironment(globalEnvironment);
			List<VerificationCondition> vcs = new ArrayList<>();
			Context context = new Context(wyalFile, AssumptionSet.ROOT, localEnvironment, localEnvironment, null, vcs);
			//
			Pair<Expr, Context> rp = translateExpressionWithChecks(decl.getInitialiser(), null, context);
			generateTypeInvariantCheck(decl.getType(), rp.first(), context);
			// Translate each generated verification condition into an assertion in
			// the underlying WyalFile.
			createAssertions(decl, vcs, globalEnvironment);
		}
	}
1244083
def parse_declaration(self, tup_tree):
        

        self.check_node(tup_tree, 'DECLARATION')

        child = self.one_child(tup_tree, ('DECLGROUP',))

        return name(tup_tree), attrs(tup_tree), child
246428
def _normalize_custom_param_name(name):
    

    replacements = (("\u2018", "'"), ("\u2019", "'"), ("\u201C", '"'), ("\u201D", '"'))
    for orig, replacement in replacements:
        name = name.replace(orig, replacement)
    return name
1055206
def TYPEDEF_DECL(self, cursor):
        
        name = self.get_unique_name(cursor)
        # if the typedef is known, get it from cache
        if self.is_registered(name):
            return self.get_registered(name)
        # use the canonical type directly.
        _type = cursor.type.get_canonical()
        log.debug("TYPEDEF_DECL: name:%s", name)
        log.debug("TYPEDEF_DECL: typ.kind.displayname:%s", _type.kind)

        # For all types (array, fundament, pointer, others), get the type
        p_type = self.parse_cursor_type(_type)
        if not isinstance(p_type, typedesc.T):
            log.error(
                'Bad TYPEREF parsing in TYPEDEF_DECL: %s',
                _type.spelling)
            # import code
            # code.interact(local=locals())
            raise TypeError(
                'Bad TYPEREF parsing in TYPEDEF_DECL: %s' %
                (_type.spelling))
        # register the type
        obj = self.register(name, typedesc.Typedef(name, p_type))
        self.set_location(obj, cursor)
        self.set_comment(obj, cursor)
        return obj
591059
def remove_declarated(type_):
    
    type_ = remove_alias(type_)
    if isinstance(type_, cpptypes.elaborated_t):
        type_ = type_.base
    if isinstance(type_, cpptypes.declarated_t):
        type_ = type_.declaration
    return type_
259795
private Decl parseImportDeclaration() {
		int start = index;
		EnclosingScope scope = new EnclosingScope();
		match(Import);
		Identifier fromName = parseOptionalFrom(scope);
		Tuple<Identifier >filterPath = parseFilterPath(scope);
		int end = index;
		matchEndLine();
		Decl.Import imprt;
		if(fromName != null) {
			imprt = new Decl.Import(filterPath, fromName);
		} else {
			imprt = new Decl.Import(filterPath);
		}
		return annotateSourceLocation(imprt, start);
	}