syck_emitter_mark_node
331907
public long markNode(Object n) {
        long oid = 0;
        if(this.markers == null) {
            this.markers = new IdentityHashMap<Object, Long>();
        }

        if(!this.markers.containsKey(n)) {
            oid = this.markers.size() + 1;
            markers.put(n, oid);
        } else {
            oid = this.markers.get(n);
            if(this.anchors == null) {
                this.anchors = new HashMap<Long, String>();
            }
            if(!anchors.containsKey(oid)) {
                int idx = 0;
                String anc = this.anchor_format == null ? YAML.DEFAULT_ANCHOR_FORMAT : this.anchor_format;
                idx = anchors.size() + 1;
                String anchor_name = String.format(anc, idx);
                anchors.put(oid, anchor_name);
            }
        }

        return oid;
    }
506343
function scanNode(node, c){
      if (node.nextSibling)
        c = push(scanNode, node.nextSibling, c);

      if (partNode(node)){
        nodeQueue.push(node);
        afterBR = false;
        return yield(node.currentText, c);
      }
      else if (isBR(node)) {
        if (afterBR && window.opera)
          node.parentNode.insertBefore(makePartSpan("", owner), node);
        nodeQueue.push(node);
        afterBR = true;
        return yield("\n", c);
      }
      else {
        var end = !node.nextSibling;
        point = pointAt(node);
        removeElement(node);
        return writeNode(node, c, end);
      }
    }
740617
void _emitJcc(INST_CODE code, Label label, final int hint) {
        if (hint == 0) {
            emitX86(code, label);
        } else {
            emitX86(code, label, Immediate.imm(hint));
        }
    }
393940
private void markUngroupedEnclosedNodes(InstructionGroup group) {
        while_:
        while (true) {
            for (int i = getIndexOfFirstInsn(group), max = getIndexOfLastInsn(group); i < max; i++) {
                InstructionGraphNode node = method.getGraphNodes().get(i);
                if (node.getGroup() == null) {
                    markGroup(node, group);
                    sort(group);
                    continue while_;
                }
            }
            break;
        }
    }
817132
void emitMinusOne(int tc) {
        if (tc == LONGcode) {
            items.makeImmediateItem(syms.longType, Long.valueOf(-1)).load();
        } else {
            code.emitop0(iconst_m1);
        }
    }
91264
function markAsUsed(node) {
            if (!node.label) {
                return;
            }

            const label = node.label.name;
            let info = scopeInfo;

            while (info) {
                if (info.label === label) {
                    info.used = true;
                    break;
                }
                info = info.upper;
            }
        }
27592
function postprocess(analyzer, node) {
    switch (node.type) {
        case "Program":
        case "FunctionDeclaration":
        case "FunctionExpression":
        case "ArrowFunctionExpression": {
            let codePath = analyzer.codePath;

            // Mark the current path as the final node.
            CodePath.getState(codePath).makeFinal();

            // Emits onCodePathSegmentEnd event of the current segments.
            leaveFromCurrentSegment(analyzer, node);

            // Emits onCodePathEnd event of this code path.
            debug.dump(`onCodePathEnd ${codePath.id}`);
            analyzer.emitter.emit("onCodePathEnd", codePath, node);
            debug.dumpDot(codePath);

            codePath = analyzer.codePath = analyzer.codePath.upper;
            if (codePath) {
                debug.dumpState(node, CodePath.getState(codePath), true);
            }
            break;
        }

        default:
            break;
    }
}
201328
function(node, state, leaving) {
        for (let i = 0; i < state.currentSegments.length; ++i) {
            const segInternal = state.currentSegments[i].internal;

            if (leaving) {
                segInternal.exitNodes.push(node);
            } else {
                segInternal.nodes.push(node);
            }
        }

        debug([
            `${state.currentSegments.map(getId).join(",")})`,
            `${node.type}${leaving ? ":exit" : ""}`
        ].join(" "));
    }
812767
function labelTryCatch(ast, engineMode) {
        treeWalk(ast, function (node, descend, path) {
            if (node.type === 'TryStatement' && !node.$seh) {
                if (!examine(path[0].parent).isBlockStatement) {
                    path[0].parent[path[0].field] = {
                        type: 'BlockStatement',
                        body: [node]
                    };
                }
                // Every try-catch needs a name, so asyncDefine/asyncAwait knows who's handling errors
                node.$seh = generateSymbol("Try") + "_";
                node.$containedAwait = !(!containsAwait(node));
                node.$finallyExit = node.finalizer && inAsync(path) && !(!contains(node.finalizer.body, isExitStatement));
                if (node.$containedAwait || node.$finallyExit) {
                    node.$needsMapping = engineMode ? !node.$finallyExit : true;
                    var parent = getExit(path, [opts]);
                    if (node.finalizer && !node.handler) {
                        // We have a finally, but no 'catch'. Create the default catch clause 'catch(_ex) { throw _ex }'
                        var exSym = ident(generateSymbol("exception"));
                        node.handler = {
                            "type": "CatchClause",
                            "param": exSym,
                            "body": {
                                "type": "BlockStatement",
                                "body": [{
                                    "type": "ThrowStatement",
                                    "argument": exSym
                                }]
                            }
                        };
                    }
                    if (!node.handler && !node.finalizer) {
                        var ex = new SyntaxError(where(node.value) + "try requires catch and/or finally clause", pr.filename, node.start);
                        ex.pos = node.start;
                        ex.loc = node.loc.start;
                        throw ex;
                    }
                    if (node.finalizer) {
                        setExit(node.block, {
                            $error: node.$seh + "Catch",
                            $return: deferredFinally(node, parent.$return)
                        });
                        setExit(node.handler, {
                            $error: deferredFinally(node, parent.$error),
                            $return: deferredFinally(node, parent.$return)
                        });
                    } else {
                        setExit(node.block, {
                            $error: node.$seh + "Catch",
                            $return: parent.$return
                        });
                    }
                }
            }
            descend();
        });
        return ast;
    }
533622
def _get_nodes_from_symbol(sym):
    """"""
    if not isinstance(sym, Symbol):
        raise TypeError('sym must be an `mxnet.symbol.Symbol`,'
                        ' received type {}'.format(str(type(sym))))
    conf = json.loads(sym.tojson())
    nodes = conf['nodes']
    data2op = {}  # key: data id, value: list of ops to whom data is an input
    for i, node in enumerate(nodes):
        if node['op'] != 'null':  # node is an operator
            input_list = node['inputs']
            for idx in input_list:
                if idx[0] == 0:  # do not include 'data' node in the op scope
                    continue
                if idx[0] in data2op:
                    # nodes[idx[0]] is a data as an input to op nodes[i]
                    data2op[idx[0]].append(i)
                else:
                    data2op[idx[0]] = [i]

    # In the following, we group data with operators they belong to
    # by attaching them with operator names as scope names.
    # The parameters with the operator name as the prefix will be
    # assigned with the scope name of that operator. For example,
    # a convolution op has name 'conv', while its weight and bias
    # have name 'conv_weight' and 'conv_bias'. In the end, the operator
    # has scope name 'conv' prepended to its name, i.e. 'conv/conv'.
    # The parameters are named 'conv/conv_weight' and 'conv/conv_bias'.
    node_defs = []
    for i, node in enumerate(nodes):
        node_name = node['name']
        op_name = node['op']
        kwargs = {'op': op_name, 'name': node_name}
        if op_name != 'null':  # node is an operator
            inputs = []
            input_list = node['inputs']
            for idx in input_list:
                input_node = nodes[idx[0]]
                input_node_name = input_node['name']
                if input_node['op'] != 'null':
                    inputs.append(_scoped_name(input_node_name, input_node_name))
                elif idx[0] in data2op and len(data2op[idx[0]]) == 1 and data2op[idx[0]][0] == i:
                    # the data is only as an input to nodes[i], no else
                    inputs.append(_scoped_name(node_name, input_node_name))
                else:  # the data node has no scope name, e.g. 'data' as the input node
                    inputs.append(input_node_name)
            kwargs['input'] = inputs
            kwargs['name'] = _scoped_name(node_name, node_name)
        elif i in data2op and len(data2op[i]) == 1:
            # node is a data node belonging to one op, find out which operator this node belongs to
            op_node_name = nodes[data2op[i][0]]['name']
            kwargs['name'] = _scoped_name(op_node_name, node_name)

        if 'attrs' in node:
            # TensorBoard would escape quotation marks, replace it with space
            attr = json.dumps(node['attrs'], sort_keys=True).replace("\"", ' ')
            attr = {'param': AttrValue(s=attr.encode(encoding='utf-8'))}
            kwargs['attr'] = attr
        node_def = NodeDef(**kwargs)
        node_defs.append(node_def)
    return node_defs
780633
function(fromSegment, toSegment) {
			if (fromSegment.reachable && toSegment.reachable) {
				this.emitter.emit(
					"onCodePathSegmentLoop",
					fromSegment,
					toSegment,
					this.currentNode
				);
			}
		}
693160
function emitChangeEvent(emitter, path, log) {
        emitter.emit("file:changed", {
            path: path,
            log: log,
            namespace: "core",
            event: "change"
        });
    }
1238896
public void emitScalar(String tag, ScalarStyle force_style, int force_indent, int force_width, int keep_nl, Pointer _str, int len) {
        if(_str == null) {
            _str = EMPTY;
        }

        byte[] bstr = _str.buffer;
        int str = _str.start;

        ScalarStyle favor_style = ScalarStyle.Literal;
        Level parent = parentLevel();
        Level lvl = currentLevel();

        if(len == 0 && (parent.status == LevelStatus.map || parent.status == LevelStatus.imap) && parent.ncount % 2 == 1 && ImplicitScanner2.tagcmp(tag, "tag:yaml.org,2002:null")) {
            _str = TILDE;
            bstr = _str.buffer;
            str = _str.start;
            len = 1;
        }
        
        int scan = scanScalar(force_width, _str, len);
        String implicit = Parser.taguri(YAML.DOMAIN, ImplicitScanner2.matchImplicit(_str, len));
        if(!ImplicitScanner2.tagcmp(tag, implicit) && ImplicitScanner2.tagcmp(tag, "tag:yaml.org,2002:str")) {
            force_style = ScalarStyle.TwoQuote;
        } else {
            if(parent.status == LevelStatus.map && parent.ncount % 2 == 1 && ( !(tag == null || (implicit != null && ImplicitScanner2.tagcmp(tag, implicit) && !explicit_typing)))) {
                write(QUESTION_MARK_SPACE, 2);
                parent.status = LevelStatus.mapx;
            }
            emitTag(tag, implicit);
        }

        if(force_style == ScalarStyle.None) {
            if((scan & SCAN_NEWLINE) != 0) {
                force_style = ScalarStyle.Literal;
            } else {
                force_style = ScalarStyle.Plain;
            }
        }

        if(this.style == ScalarStyle.Fold) {
            favor_style = ScalarStyle.Fold;
        }

        if((scan & SCAN_NONPRINT) != 0) {
            force_style = ScalarStyle.TwoQuote;
        } else if((scan & SCAN_WHITEEDGE) != 0) {
            force_style = ScalarStyle.TwoQuote;
        } else if(force_style != ScalarStyle.Fold && (scan & SCAN_INDENTED) != 0) {
            force_style = ScalarStyle.Literal;
        } else if(force_style == ScalarStyle.Plain && (scan & SCAN_NEWLINE) != 0) {
            force_style = favor_style;
        } else if(force_style == ScalarStyle.Plain && parent.status == LevelStatus.iseq && (scan & SCAN_FLOWSEQ) != 0) {
            force_style = ScalarStyle.TwoQuote;
        } else if(force_style == ScalarStyle.Plain && parent.status == LevelStatus.imap && (scan & SCAN_FLOWMAP) != 0) {
            force_style = ScalarStyle.TwoQuote;
        } else if(force_style == ScalarStyle.Plain && ((scan & SCAN_INDIC_S) != 0 || (scan & SCAN_INDIC_C) != 0)) {
            if((scan & SCAN_NEWLINE) != 0) {
                force_style = favor_style;
            } else {
                force_style = ScalarStyle.TwoQuote;
            }
        }

        if(force_indent > 0) {
            lvl.spaces = parent.spaces + force_indent;
        } else if((scan & SCAN_DOCSEP) != 0) {
            lvl.spaces = parent.spaces + this.indent;
        }
        
        if((parent.status == LevelStatus.map || parent.status == LevelStatus.mapx) && parent.ncount % 2 == 1) {
            if(force_style != ScalarStyle.Plain) {
                force_style = ScalarStyle.TwoQuote;
            }
        }

        if(parent.status == LevelStatus.imap || parent.status == LevelStatus.iseq) {
            if(force_style != ScalarStyle.Plain && force_style != ScalarStyle.OneQuote) {
                force_style = ScalarStyle.TwoQuote;
            }
        }

        if((scan & SCAN_NONL_E) != 0) {
            keep_nl = YAML.NL_CHOMP;
        } else if((scan & SCAN_MANYNL_E) != 0) {
            keep_nl = YAML.NL_KEEP;
        }

        switch(force_style) {
        case OneQuote:
            emit1Quoted(force_width, _str, len);
            break;
        case None:
        case TwoQuote:
            emit2Quoted(force_width, _str, len);
            break;
        case Fold:
            emitFolded(force_width, keep_nl, _str, len);
            break;
        case Literal:
            emitLiteral(keep_nl, _str, len);
            break;
        case Plain:
            write(_str, len);
            break;
        }

        if(parent.status == LevelStatus.mapx) {
            write(NEWLINE, 1);
        }
    }
374909
public void emitIndent() {
        Level lvl = currentLevel();
        if(bufpos == 0 && marker == 0) {
            return;
        }
        if(lvl.spaces >= 0) {
            byte[] spcs = new byte[lvl.spaces + 2];
            spcs[0] = '\n';
            spcs[lvl.spaces + 1] = 0;
            for(int i=0; i<lvl.spaces; i++) {
                spcs[i+1] = ' ';
            }
            write(Pointer.create(spcs, 0), lvl.spaces + 1);
        }
    }
1019677
function showAST(node) {
  if (node === null) {
    return 'null';
  } else if (node instanceof Array) {
    return '[\n' + showASTs(node).join(',\n') + '\n]';
  } else if (node instanceof Token) {
    return node.toString();
  } else {
    let tag = Symbol.keyFor(node.tag).substring(2);
    return tag + '(\n' + showASTs(node.children).join(',\n') + '\n)';
  }
}
1241314
void mark()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "mark");
      SibTr.exit(tc, "mark");
    }

    _marked = true;
  }
226156
private void markRings(int idx, int bprev) {
        avisit[idx] = numVisit++;
        final int d = deg[idx];
        for (int j = 0; j < d; j++) {
            int nbr = atomAdj[idx][j];
            int bidx = bondAdj[idx][j];
            if (avisit[nbr] == 0 || bidx == bprev)
                continue; // ignored
            else if (avisit[nbr] < 0)
                markRings(nbr, bidx);
            else if (avisit[nbr] < avisit[idx])
                rbnds[bidx] = -1; // ring closure
        }
    }