invokes the createAdjacencyMatrix method, if nodeCount != null or outputText otherwise
188043
private void convertSaltProject(SaltProject p, List<String> annoKeys, Map<String, String> args, boolean alignmc, int offset,
      Map<String, CorpusConfig> corpusConfigs, Writer out, Integer nodeCount) throws IOException, IllegalArgumentException
  {
    int recordNumber = offset;
    if(p != null && p.getCorpusGraphs() != null)
    {
      
      Map<String, String> spanAnno2order = null;
      boolean virtualTokenizationFromNamespace = false;
      
      Set<String> corpusNames = CommonHelper.getToplevelCorpusNames(p);
      if(!corpusNames.isEmpty())
      {
        CorpusConfig config = corpusConfigs.get(corpusNames.iterator().next());
        if(config != null)
        {
          if("true".equalsIgnoreCase(config.getConfig("virtual_tokenization_from_namespace")))
          {
            virtualTokenizationFromNamespace = true;
          }
          else
          {
            String mappingRaw = config.getConfig("virtual_tokenization_mapping");
            if(mappingRaw != null)
            {
              spanAnno2order = new HashMap<>();
              for(String singleMapping : Splitter.on(',').split(mappingRaw))
              {
                List<String> mappingParts = Splitter.on('=').splitToList(singleMapping);
                if(mappingParts.size() >= 2)
                {
                  spanAnno2order.put(mappingParts.get(0), mappingParts.get(1));
                }
              }
            }
          }
         
        }
      }
      
      for(SCorpusGraph corpusGraph : p.getCorpusGraphs())
      {
        if(corpusGraph.getDocuments() != null)
        {
          for(SDocument doc : corpusGraph.getDocuments())
          {
            if(virtualTokenizationFromNamespace)
            {
              TimelineReconstructor.removeVirtualTokenizationUsingNamespace(doc.getDocumentGraph());
            }
            else if(spanAnno2order != null)
            {
              // there is a definition how to map the virtual tokenization to a real one
              TimelineReconstructor.removeVirtualTokenization(doc.getDocumentGraph(), spanAnno2order);
            }
            
          
            if (nodeCount != null){
            	 createAdjacencyMatrix(doc.getDocumentGraph(), args, recordNumber++, nodeCount);
            }
            else{
            	 outputText(doc.getDocumentGraph(),  alignmc, recordNumber++, out);
            }
            
           
          }
        }
      }
    }
       
  }
782804
public static void writeNode(Node node, List<BelTerm> supportingTerms,
            PrintWriter writer) {
        int x = new Random().nextInt(200);
        int y = new Random().nextInt(200);

        StringBuilder sb = new StringBuilder();
        sb.append("  <node label='");
        sb.append(node.label);
        sb.append("' id='");
        sb.append(node.id.toString());
        sb.append("'>\n");
        sb.append("    <att name='function type'");
        sb.append(" value='");
        sb.append(node.function.getDisplayValue());
        sb.append("' />\n");
        sb.append("    <att name='parameters'");
        sb.append(" value='");

        String params = "";
        for (BelTerm t : supportingTerms) {
            if (hasLength(params)) {
                params = params.concat("&#10;");
            }
            String label = t.getLabel();
            label = label.replaceAll("&", "&amp;");
            label = label.replaceAll("'", "&quot;");
            params = params.concat(label);
        }
        sb.append(params);
        sb.append("' />\n");

        // Graphics type and fill color
        String graphics = format(NODE_GRAPHICS, type(node.function),
                color(node.function), x, y, params);
        sb.append(graphics);

        sb.append("  </node>\n");
        writer.write(sb.toString());
    }
68613
private void initMatrix(String line) {
		String[] spl = line.split(" ");

		// trim off the final , character
		currentRows = spl[3].substring(0, spl[3].length()-1);
		currentCols = spl[6];
		currentRowPos = -1;

		int nrRows = currentRows.length();
		int nrCols = currentCols.length();

		matrix = new short[nrRows][nrCols];

		rows = new ArrayList<AminoAcidCompound>();
		cols = new ArrayList<AminoAcidCompound>();


		//System.out.println(">" + currentRows+"<");
		AminoAcidCompoundSet compoundSet = AminoAcidCompoundSet.getAminoAcidCompoundSet();
		for ( int i = 0 ; i < currentRows.length() ; i ++){
			char c = currentRows.charAt(i);
			AminoAcidCompound aa = compoundSet.getCompoundForString(String.valueOf(c));

			rows.add(aa);
		}

		for ( int i = 0 ; i < currentCols.length() ; i ++){
			char c = currentRows.charAt(i);
			AminoAcidCompound aa = compoundSet.getCompoundForString(String.valueOf(c));

			cols.add(aa);
		}





		currentMatrix.setScale(scale);
	}
175409
@Override protected boolean toJavaCheckTooBig() {
    // If the number of leaves in a forest is more than N, don't try to render it in the browser as POJO code.
    return _output==null || _output._treeStats._num_trees * _output._treeStats._mean_leaves > 1000000;
  }
98006
function(nodeCount) {
    if (!common.isNumber(nodeCount)) { return new Error('count of nodes is not number'); }

    this.nodeCount = nodeCount;
    this.badNodes = {};
    this.recoverTime = JS_CONSTANTS.DEFAULT_RECOVER_TIME;
}
42012
protected void parseBracketCreateMatrix(TokenList tokens, Sequence sequence) {
        List<TokenList.Token> left = new ArrayList<TokenList.Token>();

        TokenList.Token t = tokens.getFirst();

        while( t != null ) {
            TokenList.Token next = t.next;
            if( t.getSymbol() == Symbol.BRACKET_LEFT ) {
                left.add(t);
            } else if( t.getSymbol() == Symbol.BRACKET_RIGHT ) {
                if( left.isEmpty() )
                    throw new RuntimeException("No matching left bracket for right");

                TokenList.Token start = left.remove(left.size() - 1);

                // Compute everything inside the [ ], this will leave a
                // series of variables and semi-colons hopefully
                TokenList bracketLet = tokens.extractSubList(start.next,t.previous);
                parseBlockNoParentheses(bracketLet, sequence, true);
                MatrixConstructor constructor = constructMatrix(bracketLet);

                // define the matrix op and inject into token list
                Operation.Info info = Operation.matrixConstructor(constructor);
                sequence.addOperation(info.op);

                tokens.insert(start.previous, new TokenList.Token(info.output));

                // remove the brackets
                tokens.remove(start);
                tokens.remove(t);
            }

            t = next;
        }

        if( !left.isEmpty() )
            throw new RuntimeException("Dangling [");
    }
827177
function(e) {
      switch (e.data.action) {
        case 'start':
          init(
            new Float32Array(e.data.nodes),
            new Float32Array(e.data.edges),
            e.data.config
          );

          // First iteration(s)
          run(W.settings.startingIterations);
          break;

        case 'loop':
          NodeMatrix = new Float32Array(e.data.nodes);
          run(W.settings.iterationsPerRender);
          break;

        case 'config':

          // Merging new settings
          configure(e.data.config);
          break;

        case 'kill':

          // Deleting context for garbage collection
          __emptyObject(W);
          NodeMatrix = null;
          EdgeMatrix = null;
          RegionMatrix = null;
          self.removeEventListener('message', listener);
          break;

        default:
      }
    }
217706
public static void createWithDepth(Program program, TreeNode x, int allowableDepth, TGPInitializationStrategy method, RandEngine randEngine) {

      int child_count = x.arity();

      for (int i = 0; i != child_count; ++i)
      {
         Primitive primitive = anyPrimitive(program, allowableDepth, method, randEngine);
         TreeNode child = new TreeNode(primitive);
         x.getChildren().add(child);

         if (!primitive.isTerminal())
         {
            createWithDepth(program, child, allowableDepth - 1, method, randEngine);
         }
      }
   }
853216
public void buildMethodTags(XMLNode node, Content methodsContentTree) {
        methodWriter.addMemberTags((MethodDoc) currentMember, methodsContentTree);
        MethodDoc method = (MethodDoc)currentMember;
        if (method.name().compareTo("writeExternal") == 0
                && method.tags("serialData").length == 0) {
            if (configuration.serialwarn) {
                configuration.getDocletSpecificMsg().warning(
                        currentMember.position(), "doclet.MissingSerialDataTag",
                        method.containingClass().qualifiedName(), method.name());
            }
        }
    }
1007220
private Node getNode(Node nodeStart, String key, CreateMode createMode, boolean bReturnTextNode)
    {
        if (key.indexOf('/') != -1)
        {
            String strKeyParent = key.substring(0, key.indexOf('/'));
            CreateMode createModeParent = createMode;
            if (createModeParent == CreateMode.CREATE_NEW_NODE)
                createModeParent = CreateMode.CREATE_IF_NOT_FOUND;  // Only create a duplicate node at the leaf level.
            nodeStart = this.getNode(nodeStart, strKeyParent, createModeParent, false);
            if (nodeStart == null)
                return null;
            key = key.substring(key.indexOf('/') + 1);
            return this.getNode(nodeStart, key, createMode, bReturnTextNode);
        }
        if (nodeStart == null)
            nodeStart = this.getNode(true);

        int iIndex = Integer.MAX_VALUE;
        if (key.indexOf('[') != -1)
        {
            iIndex = Integer.parseInt(key.substring(key.indexOf('[') + 1, key.indexOf(']')));
            key = key.substring(0, key.indexOf('['));
        }
        key = Util.fixDOMElementName(key);
        Node node = null;
        NodeList nodeList = ((Element)nodeStart).getElementsByTagName(key);
        if (nodeList != null)
        {
            for (int i = 0; i < nodeList.getLength(); i++)
            {
                if (nodeList.item(i).getParentNode() == nodeStart)
                {
                    node = nodeList.item(i);    // Get the last child.
                    if (iIndex != Integer.MAX_VALUE)
                    {
                        if (--iIndex == 0)
                            break;  // This is the correct node
                        node = null;    // If you are looking for a specific node, and it doesn't exist, return null.
                    }
                }
            }
        }
        if (((node == null) && (createMode != CreateMode.DONT_CREATE))
                || (createMode == CreateMode.CREATE_NEW_NODE))
        {
        	Document doc = null;
        	if (m_data instanceof Document)
        		doc = (Document)m_data;
        	if (doc == null)
        		doc = ((Node)m_data).getOwnerDocument();
            node = doc.createElement(key);
            if (bReturnTextNode)
            {
                if (createMode != CreateMode.CREATE_CDATA_NODE)
                    node.appendChild(doc.createTextNode(Constant.BLANK));
                else
                    node.appendChild(doc.createCDATASection(Constant.BLANK));
            }
            nodeStart.appendChild(node);
        }
        if (node != null)
            if (bReturnTextNode)
                node = node.getFirstChild();
        return node;    // Return new node or null.
    }
13473
@Override
    public GraphHopperStorage create(long byteCount) {
        baseGraph.checkInit();
        if (encodingManager == null)
            throw new IllegalStateException("EncodingManager can only be null if you call loadExisting");

        dir.create();
        long initSize = Math.max(byteCount, 100);
        properties.create(100);

        properties.put("graph.bytes_for_flags", encodingManager.getBytesForFlags());
        properties.put("graph.flag_encoders", encodingManager.toDetailsString());

        properties.put("graph.byte_order", dir.getByteOrder());
        properties.put("graph.dimension", baseGraph.nodeAccess.getDimension());
        properties.putCurrentVersions();

        baseGraph.create(initSize);

        for (CHGraphImpl cg : getAllCHGraphs()) {
            cg.create(byteCount);
        }

        properties.put("graph.ch.weightings", getNodeBasedCHWeightings().toString());
        properties.put("graph.ch.edge.weightings", getEdgeBasedCHWeightings().toString());
        return this;
    }
713397
private Thread createThreadFindNodesCount(final Reindexable reindexableComponent)
   {
      return new Thread("Nodes count(" + handler.getContext().getWorkspaceName() + ")")
      {
         public void run()
         {
            try
            {
               if (reindexableComponent != null)
               {
                  Long value = reindexableComponent.getNodesCount();
                  if (value != null)
                  {
                     nodesCount = new AtomicLong(value);
                  }
               }
            }
            catch (RepositoryException e)
            {
               LOG.error("Can't calculate nodes count : " + e.getMessage());
            }
         }
      };
   }
201088
function(nodes) {
      for (var i = 0, node; node = nodes[i]; i++)
        node._counted = true;
      return nodes;
    }
1247400
function () {
        var data = this.data;
        var nodes = this._nodes;

        for (var i = 0, len = nodes.length; i < len; i++) {
            nodes[i].dataIndex = -1;
        }

        for (var i = 0, len = data.count(); i < len; i++) {
            nodes[data.getRawIndex(i)].dataIndex = i;
        }
    }
1092918
private void runCypher(final String line, final Writable writable) throws FrameworkException, IOException {

		final App app = StructrApp.getInstance(actionContext.getSecurityContext());

		try (final Tx tx = app.tx()) {

			final long t0                  = System.currentTimeMillis();
			final List<GraphObject> result = Iterables.toList(app.query(line, Collections.emptyMap()));
			final long t1                  = System.currentTimeMillis();
			final int size                 = result.size();

			writable.print("Query returned ", size, " objects in ", (t1-t0), " ms.");
			writable.println();
			writable.println();

			if (size <= 10) {

				writable.print(Functions.get("to_json").apply(actionContext, null, new Object[] { result } ));

			} else {

				writable.print("Too many results (> 10), please use LIMIT to reduce the result count of your Cypher query.");
			}

			writable.println();

			tx.success();
		}

	}
305037
private void doPercentTypedAccounting(Node n) {
    JSType type = n.getJSType();
    if (type == null) {
      nullCount++;
    } else if (type.isUnknownType()) {
      if (reportUnknownTypes) {
        compiler.report(JSError.make(n, UNKNOWN_EXPR_TYPE));
      }
      unknownCount++;
    } else {
      typedCount++;
    }
  }
1137949
private void addNode(Node n) {
    Node target = null;
    Node fn = null;
    String name = null;

    switch (n.getToken()) {
      // handles assignment cases like:
      // a = function() {}
      // a = b = c = function() {}
      case ASSIGN:
        if (!n.getFirstChild().isQualifiedName()) {
          compiler.report(JSError.make(n, INJECTED_FUNCTION_ON_NON_QNAME));
          return;
        }
        name = n.getFirstChild().getQualifiedName();
        // last node of chained assignment.
        fn = n;
        while (fn.isAssign()) {
          fn = fn.getLastChild();
        }
        target = n.getParent();
        break;

      // handles function case:
      // function fnName() {}
      case FUNCTION:
        name = NodeUtil.getName(n);
        fn = n;
        target = n;
        if (n.getParent().isAssign()
            && n.getParent().getJSDocInfo().isNgInject()) {
          // This is a function assigned into a symbol, e.g. a regular function
          // declaration in a goog.module or goog.scope.
          // Skip in this traversal, it is handled when visiting the assign.
          return;
        }
        break;

      // handles var declaration cases like:
      // var a = function() {}
      // var a = b = function() {}
      case VAR:
      case LET:
      case CONST:
        name = n.getFirstChild().getString();
        // looks for a function node.
        fn = getDeclarationRValue(n);
        target = n;
        break;

      // handles class method case:
      // class clName(){
      //   constructor(){}
      //   someMethod(){} <===
      // }
      case MEMBER_FUNCTION_DEF:
        Node parent = n.getParent();
        if (parent.isClassMembers()){
          Node classNode = parent.getParent();
          String midPart = n.isStaticMember() ? "." : ".prototype.";
          name = NodeUtil.getName(classNode) + midPart + n.getString();
          if (NodeUtil.isEs6ConstructorMemberFunctionDef(n)) {
            name = NodeUtil.getName(classNode);
          }
          fn = n.getFirstChild();
          if (classNode.getParent().isAssign() || classNode.getParent().isName()) {
            target = classNode.getGrandparent();
          } else {
            target = classNode;
          }
        }
        break;
      default:
        break;
    }

    if (fn == null || !fn.isFunction()) {
      compiler.report(JSError.make(n, INJECT_NON_FUNCTION_ERROR));
      return;
    }
    // report an error if the function declaration did not take place in a block or global scope
    if (!target.getParent().isScript()
        && !target.getParent().isBlock()
        && !target.getParent().isModuleBody()) {
      compiler.report(JSError.make(n, INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR));
      return;
    }
    // checks that name is present, which must always be the case unless the
    // compiler allowed a syntax error or a dangling anonymous function
    // expression.
    checkNotNull(name);
    // registers the node.
    injectables.add(new NodeContext(name, n, fn, target));
  }