Write the common options of cartesian axes

@return options as JSON object
@throws java.io.IOException If an I/O error occurs
543030
public String encode() throws IOException {
        FastStringWriter fsw = new FastStringWriter();

        try {
            ChartUtils.writeDataValue(fsw, "display", this.display, false);
            ChartUtils.writeDataValue(fsw, "position", this.position, true);
            ChartUtils.writeDataValue(fsw, "fullWidth", this.fullWidth, true);
            ChartUtils.writeDataValue(fsw, "reverse", this.reverse, true);

            if (this.labels != null) {
                fsw.write(",\"labels\":" + this.labels.encode());
            }
        }
        finally {
            fsw.close();
        }

        return fsw.toString();
    }
1020413
public JSONWriter objectEnd() throws IOException {
        writer.write(JSON.RBRACE);
        state = stack.pop();
        return this;
    }
38861
public void writeCpMaps(Dictionary dict, PrintWriter fout) throws IOException {
	Iterator it = null;
    
	if (cpStr2Int == null) {
	    return;
	}
	
	int count = 0;
	for (it = cpStr2Int.keySet().iterator(); it.hasNext(); ) {
	    String cpStr = (String)it.next();
	    Integer cpInt = (Integer)cpStr2Int.get(cpStr);
	    
	    Element elem = (Element)dict.dict.get(cpInt);
	    if (elem != null) {
		if (elem.chosen == 1) {
		    count++;
		}
	    }
	}
		
	// write the map size
	fout.println(Integer.toString(count));
	
	for (it = cpStr2Int.keySet().iterator(); it.hasNext(); ) {
	    String cpStr = (String)it.next();
	    Integer cpInt = (Integer)cpStr2Int.get(cpStr);
	    
	    Element elem = (Element)dict.dict.get(cpInt);
	    if (elem != null) {
		if (elem.chosen == 1) {
		    fout.println(cpStr + " " + cpInt.toString());
		}
	    }	    
	}
	
	// write the line ###...
	fout.println(Option.modelSeparator);
    }
859733
protected ArgOptions createOptions() {
        ArgOptions options = new ArgOptions();
        options.addOption('f', "fileList", "a list of document files", 
                          true, "FILE[,FILE...]", "Required (at least one of)");
        options.addOption('d', "docFile", 
                          "a file where each line is a document", true,
                          "FILE[,FILE...]", "Required (at least one of)");

        options.addOption('T', "timespan", "the timespan for each semantic " +
                          "partition", true, "Date String", "Required");

        options.addOption('o', "outputFormat", "the .sspace format to use",
                          true, "{text|binary}", "Program Options");
        options.addOption('t', "threads", "the number of threads to use",
                          true, "INT", "Program Options");
        options.addOption('w', "overwrite", "specifies whether to " +
                          "overwrite the existing output", true, "BOOL",
                          "Program Options");
        options.addOption('v', "verbose", "prints verbose output",
                          false, null, "Program Options");

        // Algorithm Options
        options.addOption('i', "vectorGenerator", "IndexVectorGenerator "
                          + "class to use", true,
                          "CLASSNAME", "Algorithm Options");
        options.addOption('l', "vectorLength", "length of semantic vectors",
                          true, "INT", "Algorithm Options");
        options.addOption('n', "permutationFunction", "permutation function "
                          + "to use", true,
                          "CLASSNAME", "Algorithm Options");
        options.addOption('p', "usePermutations", "whether to permute " +
                          "index vectors based on word order", true,
                          "BOOL", "Algorithm Options");
        options.addOption('r', "useSparseSemantics", "use a sparse encoding of "
                          + "semantics to save memory", true,
                          "BOOL", "Algorithm Options");
        options.addOption('s', "windowSize", "how many words to consider " +
                          "in each direction", true,
                          "INT", "Algorithm Options");
        options.addOption('S', "saveVectors", "save word-to-IndexVector mapping"
                          + " after processing", true,
                          "FILE", "Algorithm Options");
        options.addOption('L', "loadVectors", "load word-to-IndexVector mapping"
                          + " before processing", true,
                          "FILE", "Algorithm Options");

        // Input Options
        options.addOption('F', "tokenFilter", "filters to apply to the input " +
                          "token stream", true, "FILTER_SPEC", 
                          "Tokenizing Options");
        options.addOption('C', "compoundWords", "a file where each line is a " +
                          "recognized compound word", true, "FILE", 
                          "Tokenizing Options");

        options.addOption('W', "semanticFilter", "exclusive list of word",
                          true, "FILE", "Input Options");

        // Output Options
        options.addOption('I', "interestingTokenList", "list of interesting " +
                          "words", true, "FILE", "Output Options");
        options.addOption('K', "printShiftRankings", "print ranked list of " +
                          "semantic shifts for each interesting word", false, 
                          null, "Output Options");
        options.addOption('R', "savePartitions", "write semantic partitions as " +
                          ".sspace files to disk", false, null, 
                          "Output Options");
        options.addOption('P', "printInterestingTokenShifts", "prints the "
                          + "vectors for each interesting word", false, null, 
                          "Output Options");
        options.addOption('N', "printInterestingTokenNeighbors", "prints the "
                          + "nearest neighbors for each interesting word", true,
                          "INT", "Output Options");
        options.addOption('Z', "printInterestingTokenNeighborComparison",
                          "prints the distances between each of the"
                          + "nearest neighbors for each interesting word", 
                          false, null , "Output Options");

        return options;
    }
35812
def axes(self):
        
        out = self._axes[:]
        if self._horizontalAxis:
            out.append(self._horizontalAxis)
        if self._verticalAxis:
            out.append(self._verticalAxis)
        return out
52995
function writeOpts(opts) {
  return utils.extend({
    flags: opts.flags || (opts.overwrite ? 'w' : 'wx')
  }, opts);
}
1127719
public String encode() throws IOException {
        FastStringWriter fsw = new FastStringWriter();

        try {
            fsw.write("{");

            ChartUtils.writeDataValue(fsw, "display", this.display, false);
            ChartUtils.writeDataValue(fsw, "color", this.color, true);
            ChartUtils.writeDataValue(fsw, "borderDash", this.borderDash, true);
            ChartUtils.writeDataValue(fsw, "borderDashOffset", this.borderDashOffset, true);
            ChartUtils.writeDataValue(fsw, "lineWidth", this.lineWidth, true);
            ChartUtils.writeDataValue(fsw, "drawBorder", this.drawBorder, true);
            ChartUtils.writeDataValue(fsw, "drawOnChartArea", this.drawOnChartArea, true);
            ChartUtils.writeDataValue(fsw, "drawTicks", this.drawTicks, true);
            ChartUtils.writeDataValue(fsw, "tickMarkLength", this.tickMarkLength, true);
            ChartUtils.writeDataValue(fsw, "zeroLineWidth", this.zeroLineWidth, true);
            ChartUtils.writeDataValue(fsw, "zeroLineColor", this.zeroLineColor, true);
            ChartUtils.writeDataValue(fsw, "zeroLineBorderDash", this.zeroLineBorderDash, true);
            ChartUtils.writeDataValue(fsw, "zeroLineBorderDashOffset", this.zeroLineBorderDashOffset, true);
            ChartUtils.writeDataValue(fsw, "offsetGridLines", this.offsetGridLines, true);

            fsw.write("}");
        }
        finally {
            fsw.close();
        }

        return fsw.toString();
    }
170626
function () {
		var chart = this,
			options = this.options,
			xAxisOptions = options.xAxis = splat(options.xAxis || {}),
			yAxisOptions = options.yAxis = splat(options.yAxis || {}),
			optionsArray,
			axis;

		// make sure the options are arrays and add some members
		each(xAxisOptions, function (axis, i) {
			axis.index = i;
			axis.isX = true;
		});

		each(yAxisOptions, function (axis, i) {
			axis.index = i;
		});

		// concatenate all axis options into one array
		optionsArray = xAxisOptions.concat(yAxisOptions);

		each(optionsArray, function (axisOptions) {
			axis = new Axis(chart, axisOptions);
		});

		chart.adjustTickAmounts();
	}
608508
public String encode() throws IOException {
        FastStringWriter fsw = new FastStringWriter();

        try {
            fsw.write("{");

            ChartUtils.writeDataValue(fsw, "fontSize", this.fontSize, false);
            ChartUtils.writeDataValue(fsw, "fontColor", this.fontColor, true);
            ChartUtils.writeDataValue(fsw, "fontFamily", this.fontFamily, true);
            ChartUtils.writeDataValue(fsw, "fontStyle", this.fontStyle, true);

            fsw.write("}");
        }
        finally {
            fsw.close();
        }

        return fsw.toString();
    }
813081
public void writeGeometries( Geometry[] geometries ) throws IOException {
        File file = new File(path);
        RandomAccessFile raf = null;
        try {
            raf = new RandomAccessFile(file, "rw");

            int major = JTSVersion.MAJOR;
            int minor = JTSVersion.MINOR;

            raf.writeChars("jts");
            raf.writeInt(major);
            raf.writeInt(minor);

            long geometriesStart = INDEX_ADDRESS_POSITION + INDEX_ADDRESS_SIZE + INDEX_LENGTH_SIZE;
            raf.seek(geometriesStart);
            System.out.println("geometriesStart: " + geometriesStart);

            long fileIndex = geometriesStart;
            STRtree tree = new STRtree(geometries.length);
            for( int i = 0; i < geometries.length; i++ ) {
                Geometry geometry = geometries[i];

                if (geometry.isEmpty()) {
                    continue;
                }
                Envelope envelope = geometry.getEnvelopeInternal();

                byte[] geomBytes = serialize(geometry);
                raf.write(geomBytes);

                /*
                 * the tree contains the envelope of a geometry
                 * and the array with the exact position in the file where the 
                 * geometry bytes start + the length. 
                 */
                tree.insert(envelope, new long[]{fileIndex, geomBytes.length});

                fileIndex = fileIndex + geomBytes.length;
                System.out.println("geom: " + i + " finished at: " + fileIndex);
            }

            raf.seek(INDEX_ADDRESS_POSITION);
            raf.writeLong(fileIndex);

            System.out.println("INDEX_ADDRESS_POSITION: " + fileIndex);

            /*
             * serialize index
             */
            byte[] treeBytes = serialize(tree);

            long treeSize = treeBytes.length;
            raf.seek(fileIndex);
            raf.write(treeBytes, 0, (int) treeSize);

            System.out.println("treeSize: " + treeSize);

            raf.seek(INDEX_ADDRESS_POSITION + INDEX_ADDRESS_SIZE);
            raf.writeLong(treeSize);

            long length = raf.length();
            System.out.println(length);

        } finally {
            System.out.println("close");
            if (raf != null)
                raf.close();
        }
    }
1122334
public Writer write(Writer writer) throws JSONException {
        try {
            if (m_map.isEmpty()) {
                writer.write("{}");
                return writer;
            }
            // This prefix value applies to the first key only
            String keyprefix = "{\"";
            for (Entry<String, Object> entry : m_map.entrySet()) {
                writer.write(keyprefix);
                writer.write(quotable(entry.getKey()));
                writer.write("\":");
                Object v = entry.getValue();
                if (v instanceof JSONObject) {
                    ((JSONObject)v).write(writer);
                }
                else if (v instanceof JSONArray) {
                    ((JSONArray)v).write(writer);
                }
                else {
                    writer.write(valueToString(v));
                }
                // This prefix value applies to all subsequent keys
                keyprefix = ",\"";
            }
            writer.write('}');
            return writer;
        }
        catch (IOException exception) {
            throw new JSONException(exception);
        }
     }
372501
public List<LineString> lineStrings() {
    List<List<Point>> coordinates = coordinates();
    List<LineString> lineStrings = new ArrayList<>(coordinates.size());
    for (List<Point> points : coordinates) {
      lineStrings.add(LineString.fromLngLats(points));
    }
    return lineStrings;
  }
240198
public Batch<T> getWrites(WriteBuilder writeBuilder, T op) {
        Map<Address, T> outputMap = Maps.newHashMap();

        for (Rollup rollup : rollups) {

            List<Set<byte[]>> coordSets =
                    new ArrayList<Set<byte[]>>(rollup.getComponents().size());

            boolean dimensionHadNoBucket = false;
            for (DimensionAndBucketType dimAndBucketType : rollup.getComponents()) {
                Dimension<?> dimension = dimAndBucketType.dimension;
                BucketType bucketType = dimAndBucketType.bucketType;

                SetMultimap<BucketType, byte[]> bucketsForDimension =
                        writeBuilder.getBuckets().get(dimension);

                if (bucketsForDimension == null || bucketsForDimension.isEmpty()) {
                    dimensionHadNoBucket = true;
                    break;
                }

                Set<byte[]> coords = bucketsForDimension.get(bucketType);
                if (coords == null || coords.isEmpty()) {
                    dimensionHadNoBucket = true;
                    break;
                }
                coordSets.add(coords);
            }

            if (dimensionHadNoBucket) {
                // Skip this rollup since one of its input buckets was not present.
                log.debug("Skipping rollup due to dimension with no buckets");
                continue;
            }

            Set<List<byte[]>> crossProduct = Sets.cartesianProduct(coordSets);

            for (List<byte[]> crossProductTuple : crossProduct) {
                Address outputAddress = new Address(this, rollup);

                // Start out with all dimensions wildcard, overwrite with other values later
                for (Dimension<?> dimension : dims) {
                    outputAddress.at(dimension, BucketTypeAndBucket.WILDCARD);
                }

                for (int i = 0; i < crossProductTuple.size(); i++) {
                    byte[] coord = crossProductTuple.get(i);
                    Dimension<?> dim = rollup.getComponents().get(i).dimension;
                    BucketType bucketType = rollup.getComponents().get(i).bucketType;

                    outputAddress.at(dim, new BucketTypeAndBucket(bucketType, coord));
                }

                boolean shouldWrite = true;

                if (shouldWrite) {
                    outputMap.put(outputAddress, op);
                }
            }
        }

        return new Batch<T>(outputMap);
    }
392924
public JSONWriter arrayBegin() throws IOException {
        beforeValue();

        writer.write(JSON.LSQUARE);
        stack.push(state);
        state = new State(ARRAY);
        return this;
    }
1065318
@Override
    protected void write(JsonGenerator g, JacksonJrsTreeCodec codec) throws IOException
    {
        g.writeStartArray();
        for (int i = 0, end = _values.size(); i < end; ++i) {
            codec.writeTree(g, _values.get(i));
        }
        g.writeEndArray();
    }
1168357
public JsonWriter write(Object object) throws IOException {
        if (object == null) {
            writeNull();
        } else if (object instanceof String
                || object instanceof Date) {
            writeValue(object.toString());
        } else if (object instanceof Boolean) {
            writeValue((Boolean)object);
        } else if (object instanceof Number) {
            writeValue((Number)object);
        } else if (object instanceof Parameters) {
            openCurlyBracket();

            Map<String, ParameterValue> params = ((Parameters)object).getParameterValueMap();
            Iterator<ParameterValue> it = params.values().iterator();
            while (it.hasNext()) {
                Parameter p = it.next();
                String name = p.getName();
                Object value = p.getValue();
                checkCircularReference(object, value);

                writeName(name);
                write(value);
                if (it.hasNext()) {
                    writeComma();
                }
            }

            closeCurlyBracket();
        } else if (object instanceof Map<?, ?>) {
            openCurlyBracket();

            @SuppressWarnings("unchecked")
            Iterator<Map.Entry<Object, Object>> it = ((Map<Object, Object>)object).entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry<Object, Object> entry = it.next();
                String name = entry.getKey().toString();
                Object value = entry.getValue();
                checkCircularReference(object, value);

                writeName(name);
                write(value);
                if (it.hasNext()) {
                    writeComma();
                }
            }

            closeCurlyBracket();
        } else if (object instanceof Collection<?>) {
            openSquareBracket();

            @SuppressWarnings("unchecked")
            Iterator<Object> it = ((Collection<Object>)object).iterator();
            while (it.hasNext()) {
                Object value = it.next();
                checkCircularReference(object, value);

                write(value);
                if (it.hasNext()) {
                    writeComma();
                }
            }

            closeSquareBracket();
        } else if (object.getClass().isArray()) {
            openSquareBracket();

            int len = Array.getLength(object);
            for (int i = 0; i < len; i++) {
                Object value = Array.get(object, i);
                checkCircularReference(object, value);

                if (i > 0) {
                    writeComma();
                }
                write(value);
            }

            closeSquareBracket();
        } else {
            String[] readablePropertyNames = BeanUtils.getReadablePropertyNamesWithoutNonSerializable(object);
            if (readablePropertyNames != null && readablePropertyNames.length > 0) {
                openCurlyBracket();

                for (int i = 0; i < readablePropertyNames.length; i++) {
                    Object value;
                    try {
                        value = BeanUtils.getProperty(object, readablePropertyNames[i]);
                    } catch (InvocationTargetException e) {
                        throw new IOException(e);
                    }
                    checkCircularReference(object, value);

                    writeName(readablePropertyNames[i]);
                    write(value);
                    if (i < (readablePropertyNames.length - 1)) {
                        writeComma();
                    }
                }

                closeCurlyBracket();
            } else {
                writeValue(object.toString());
            }
        }
        return this;
    }
1128528
function mergeAxisOptionFromParallel(option) {
    var axes = modelUtil.normalizeToArray(option.parallelAxis);

    zrUtil.each(axes, function (axisOption) {
        if (!zrUtil.isObject(axisOption)) {
            return;
        }

        var parallelIndex = axisOption.parallelIndex || 0;
        var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];

        if (parallelOption && parallelOption.parallelAxisDefault) {
            zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);
        }
    });
}