Contextualize a node.
970441
protected function _contextualize($node, $coverable = false)
    {
        $parent = $this->_states['current'];
        $node->namespace = $parent->namespace;
        $node->function = $parent->function;
        $node->parent = $parent;
        $node->coverable = $parent->hasMethods ? false : $coverable;
        $parent->tree[] = $node;
        $this->_assignLines($node);

        $node->inPhp = $this->_states['php'];
        $this->_states['body'] = '';
        return $node;
    }
1097948
function isNodeInContext(node, context) {
	'use strict';

	var include =
		context.include &&
		getDeepest(
			context.include.filter(function(candidate) {
				return axe.utils.contains(candidate, node);
			})
		);
	var exclude =
		context.exclude &&
		getDeepest(
			context.exclude.filter(function(candidate) {
				return axe.utils.contains(candidate, node);
			})
		);
	if (
		(!exclude && include) ||
		(exclude && axe.utils.contains(exclude, include))
	) {
		return true;
	}
	return false;
}
207385
async def node(self, node_id: str) -> dict:
        """"""
        return await self._request('get', node_id, base_url=NODE_URL_SCAFFOLD)
802858
function prepareContext(virtualNode, context) {
	const { actualNode } = virtualNode;
	if (!context.startNode) {
		context = { startNode: virtualNode, ...context };
	}
	/**
	 * When `aria-labelledby` directly references a `hidden` element
	 * the element needs to be included in the accessible name.
	 *
	 * When a descendent of the `aria-labelledby` reference is `hidden`
	 * the element should not be included in the accessible name.
	 *
	 * This is done by setting `includeHidden` for the `aria-labelledby` reference.
	 */
	if (
		actualNode.nodeType === 1 &&
		context.inLabelledByContext &&
		context.includeHidden === undefined
	) {
		context = {
			includeHidden: !dom.isVisible(actualNode, true),
			...context
		};
	}
	return context;
}
861273
private void fillResponseContext(UnitResponse.Context context) {
        context.setDestinationNodeId(unitRequest.getContext().getSourceNodeId());
        context.setSourceNodeId(LocalNodeManager.LOCAL_NODE_ID);
        context.setMsgId(unitRequest.getContext().getMsgId());
        context.setSsid(unitRequest.getContext().getSsid());
    }
210669
def parse(self):
        """"""
        result = nodes.Template(self.subparse(), lineno=1)
        result.set_environment(self.environment)
        return result
175249
def context(self, size, placeholder=None, scope=None):
        """"""
        return self.leftcontext(size, placeholder,scope) + [self] + self.rightcontext(size, placeholder,scope)
962925
def from_context(cls, context):
        """"""
        return cls(id=context.id, context=context.to_dict())
575640
def node_from_nid(self, nid):
        """"""
        for node in self.iflat_nodes():
            if node.node_id == nid: return node
        raise ValueError("Cannot find node with node id: %s" % nid)
1032284
def visit_comprehension(self, node, parent):
        """"""
        newnode = nodes.Comprehension(parent)
        newnode.postinit(
            self.visit(node.target, newnode),
            self.visit(node.iter, newnode),
            [self.visit(child, newnode) for child in node.ifs],
            getattr(node, "is_async", None),
        )
        return newnode
1094173
def set_definition_node(self, node, name):
        """"""
        definition = self.get_definition(name)
        if definition:
            definition.node = node
458150
public void processNode(INode node) throws ContextPreprocessorException {
        try {
            // reset old preprocessing
            node.getNodeData().setcLabFormula("");
            node.getNodeData().setcNodeFormula("");
            while (0 < node.getNodeData().getACoLCount()) {
                node.getNodeData().removeACoL(0);
            }

            boolean isEmpty = true;
            String labelOfNode = node.getNodeData().getName().trim();

            if (debugLabels) {
                log.debug("preprocessing: " + labelOfNode);
            }

            labelOfNode = labelOfNode.toLowerCase();
            List<ISense> wnSense = new ArrayList<ISense>();
            if (!(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent()) && (!meaninglessWords.contains(labelOfNode + " ")) && (isTokenMeaningful(labelOfNode))) {
                wnSense = linguisticOracle.getSenses(labelOfNode);
            }
            if ((0 == wnSense.size()) && !(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent()) && (!meaninglessWords.contains(labelOfNode + " ")) && (isTokenMeaningful(labelOfNode))) {
                labelOfNode = replacePunctuation(labelOfNode);
                wnSense = linguisticOracle.getSenses(labelOfNode);
            }

            // identifiers of meaningful tokens in
            String meaningfulTokens = " ";
            // tokens of the label of node
            List<String> tokensOfNodeLabel = new ArrayList<String>();

            // is the label a WordNet entry?
            int id_tok = 0;
            if (0 < wnSense.size()) {
                // add to list of processed labels
                tokensOfNodeLabel.add(labelOfNode);
                List<String> lemmas = linguisticOracle.getBaseForms(labelOfNode);
                String lemma = labelOfNode;
                if (0 < lemmas.size()) {
                    lemma = lemmas.get(0);
                }

                // create atomic node of label
                IAtomicConceptOfLabel ACoL = createACoL(node, id_tok, labelOfNode, lemma);
                // to token ids
                meaningfulTokens = meaningfulTokens + id_tok + " ";
                // add senses to ACoL
                for (ISense sense : wnSense) {
                    ACoL.addSense(sense);
                }
                isEmpty = false;
                id_tok++;
            } else {
                // The label of node is not in WN
                // Split the label by words
                StringTokenizer lemmaTokenizer = new StringTokenizer(labelOfNode, " _()[]/'\\#1234567890");
                ArrayList<String> tokens = new ArrayList<String>();
                while (lemmaTokenizer.hasMoreElements()) {
                    tokens.add(lemmaTokenizer.nextToken());
                }

                // perform multiword recognition
                tokens = multiwordRecognition(tokens);
                // for all tokens in label
                for (int i = 0; i < tokens.size(); i++) {
                    String token = tokens.get(i).trim();
                    // if the token is not meaningless
                    if ((!meaninglessWords.contains(token + " ")) && (isTokenMeaningful(token))) {
                        // add to list of processed tokens
                        tokensOfNodeLabel.add(token);
                        // if not logical connective
                        if ((!andWords.contains(token)) && ((orWords.indexOf(token)) == -1)
                                && ((notWords.indexOf(token)) == -1) && (!isNumber(token))) {
                            // get WN senses for token
                            if (!(("top".equals(token) || "thing".equals(token)) && !node.hasParent())) {
                                wnSense = linguisticOracle.getSenses(token);
                            } else {
                                wnSense = new ArrayList<ISense>();
                            }
                            if (0 == wnSense.size()) {
                                List<String> newTokens = complexWordsRecognition(token);
                                if (0 < newTokens.size()) {
                                    tokensOfNodeLabel.remove(tokensOfNodeLabel.size() - 1);
                                    tokensOfNodeLabel.add(newTokens.get(0));
                                    wnSense = linguisticOracle.getSenses(newTokens.get(0));
                                    tokens.remove(i);
                                    tokens.add(i, newTokens.get(0));
                                    for (int j = 1; j < newTokens.size(); j++) {
                                        String s = newTokens.get(j);
                                        tokens.add(i + j, s);
                                    }
                                }
                            }
                            List<String> lemmas = linguisticOracle.getBaseForms(token);
                            String lemma = token;
                            if (0 < lemmas.size()) {
                                lemma = lemmas.get(0);
                            }

                            // create atomic node of label
                            IAtomicConceptOfLabel ACoL = createACoL(node, id_tok, token, lemma);
                            // mark id as meaningful
                            meaningfulTokens = meaningfulTokens + id_tok + " ";
                            // if there no WN senses
                            if (0 == wnSense.size() && !(("top".equals(labelOfNode) || "thing".equals(labelOfNode)) && !node.hasParent())) {
                                unrecognizedWords.add(token);
                            }
                            // add senses to ACoL
                            for (ISense sense : wnSense) {
                                ACoL.addSense(sense);
                            }
                            isEmpty = false;
                        }
                        id_tok++;
                    }
                }
            }

            if (isEmpty) {
                String token = labelOfNode.replaceAll(" ", "_");
                // add to list of processed labels
                tokensOfNodeLabel.add(token);
                // create atomic node of label
                createACoL(node, id_tok, token, token);
                // to token ids
                meaningfulTokens = meaningfulTokens + id_tok + " ";
            }
            // build complex formula of a node
            buildComplexConcept(node, tokensOfNodeLabel, meaningfulTokens);
            node.getNodeData().setIsPreprocessed(true);
        } catch (LinguisticOracleException e) {
            final String errMessage = e.getClass().getSimpleName() + ": " + e.getMessage();
            log.error(errMessage, e);
            throw new ContextPreprocessorException(errMessage, e);
        }
    }
724428
function processNode(node) {
            const entity = node.code.trim()
            if (!entity) {
                context.report({
                    node,
                    messageId: "missing",
                })
            }
        }
1312266
def visit_name(self, node, parent):
        """"""
        context = self._get_context(node)
        # True and False can be assigned to something in py2x, so we have to
        # check first the context.
        if context == astroid.Del:
            newnode = nodes.DelName(node.id, node.lineno, node.col_offset, parent)
        elif context == astroid.Store:
            newnode = nodes.AssignName(node.id, node.lineno, node.col_offset, parent)
        elif node.id in CONST_NAME_TRANSFORMS:
            newnode = nodes.Const(
                CONST_NAME_TRANSFORMS[node.id],
                getattr(node, "lineno", None),
                getattr(node, "col_offset", None),
                parent,
            )
            return newnode
        else:
            newnode = nodes.Name(node.id, node.lineno, node.col_offset, parent)
        # XXX REMOVE me :
        if context in (astroid.Del, astroid.Store):  # 'Aug' ??
            self._save_assignment(newnode)
        return newnode
343797
def set_context(context):
    """"""
    global _context
    _context = {k: v for k, v in context.items()}
244432
@Override
    public void contextualize(Context context) throws ContextException {
        authConfigFactory = new AuthConfigFactory((PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY));
    }
81888
protected void initContextParam(XmlParser.Node node)
    {
        String name=node.getString("param-name",false,true);
        String value=node.getString("param-value",false,true);
        if(log.isDebugEnabled())
            log.debug("ContextParam: "+name+"="+value);
        getWebApplicationContext().setInitParameter(name,value);
    }