Writes the complete Morse-Smale merge hierarchy to a string
            object.
            @ Out, a string object storing the entire merge hierarchy of
            all minima and maxima.
324054
def to_json(self):
        
        capsule = {}
        capsule["Hierarchy"] = []
        for (
            dying,
            (persistence, surviving, saddle),
        ) in self.merge_sequence.items():
            capsule["Hierarchy"].append(
                {
                    "Dying": dying,
                    "Persistence": persistence,
                    "Surviving": surviving,
                    "Saddle": saddle,
                }
            )
        capsule["Partitions"] = []
        base = np.array([None, None] * len(self.Y)).reshape(-1, 2)
        for (min_index, max_index), items in self.base_partitions.items():
            base[items, :] = [min_index, max_index]
        capsule["Partitions"] = base.tolist()

        return json.dumps(capsule)
1126910
def write
      node = to_rxf_node(@members.root , 0)
      io = StringIO.new
      node.out( io , 0 )
      io.string
    end
154683
def writeString(self, s):
        
        s = self.context.getBytesForString(s)

        self.writeBytes(s)
1280715
private static void writeStringMap(SymbolTable map, ObjectOutput out)
      throws IOException {
    out.writeInt(map.size());
    for (ObjectIntCursor<String> cursor : map) {
      out.writeUTF(cursor.key);
      out.writeInt(cursor.value);
    }
  }
1295461
def _merge_string(lhs, rhs, type_):  # pylint: disable=unused-argument
    """"""
    return Value(string_value=lhs.string_value + rhs.string_value)
972796
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, splits.length);
    for (InputSplit s : splits) {
      Text.writeString(out, s.getClass().getName());
    }
    for (InputSplit s : splits) {
      s.write(out);
    }
  }
61791
@Override
    public String encode() throws IOException {
        FastStringWriter fsw = new FastStringWriter();

        try {
            fsw.write(super.encode());
            ChartUtils.writeDataValue(fsw, "labels", this.labels, true);
            ChartUtils.writeDataValue(fsw, "min", this.min, true);
            ChartUtils.writeDataValue(fsw, "max", this.max, true);
        }
        finally {
            fsw.close();
        }

        return fsw.toString();
    }
648037
public void writeObject(Object obj, AbstractHessianOutput out) 
        throws IOException {
    	
        if (out.addRef(obj)) {
            return;
        }
	    
        Class< ? > cl = obj.getClass();
	    
        try {
            if (writeReplace != null) {
                Object repl = writeReplace.invoke(obj, new Object[0]);

                out.removeRef(obj);

                out.writeObject(repl);

                out.replaceRef(repl, obj);

                return;
            }
        } catch (Exception e) {
            log.log(Level.FINE, e.toString(), e);
        }

        int ref = out.writeObjectBegin(cl.getName());

        if (ref < -1) {
	    // Hessian 1.1 uses a map
	      
            for (int i = 0; i < localMethods.length; i++) {
                Object value = null;

                try {
                    value = localMethods[i].invoke(obj, (Object []) null);
                } catch (Exception e) {
                    log.log(Level.FINE, e.toString(), e);
                }
		
                if (!LazyUtil.isPropertyInitialized(value)) {
                    continue;
                }
		
                out.writeString(localNames[i]);
		
                out.writeObject(value);
            }
	      
            out.writeMapEnd();
        } else {
            if (ref == -1) {
                out.writeInt(localNames.length);
		
                for (int i = 0; i < localNames.length; i++) {
                    out.writeString(localNames[i]);
                }
                out.writeObjectBegin(cl.getName());
            }

            for (int i = 0; i < localMethods.length; i++) {
                Object value = null;

                try {
                    value = localMethods[i].invoke(obj, (Object []) null);
                } catch (Exception e) {
                    log.log(Level.FINER, e.toString(), e);
                }
		
                if (!LazyUtil.isPropertyInitialized(value)) {
                    continue;
                }
		
                out.writeObject(value);
            }
        }
    }
1327288
@Override
  public void write (@Nonnull final String sStr, final int nOfs, final int nLen)
  {
    m_aSB.append (sStr.substring (nOfs, nOfs + nLen));
  }
1368375
public void writeDefinition(final OutputStream result) throws IOException 
    {
        if(this.mergeType == MERGE_VERT_PARENT) {
            result.write(DocWriter.getISOBytes("\\clvmgf"));
        } else if(this.mergeType == MERGE_VERT_CHILD) {
            result.write(DocWriter.getISOBytes("\\clvmrg"));
        }
        switch (verticalAlignment) {
            case Element.ALIGN_BOTTOM:
                result.write(DocWriter.getISOBytes("\\clvertalb"));
                break;
            case Element.ALIGN_CENTER:
            case Element.ALIGN_MIDDLE:
                result.write(DocWriter.getISOBytes("\\clvertalc"));
                break;
            case Element.ALIGN_TOP:
                result.write(DocWriter.getISOBytes("\\clvertalt"));
                break;
        }
        this.borders.writeContent(result);

        if(this.backgroundColor != null) {
            result.write(DocWriter.getISOBytes("\\clcbpat"));
            result.write(intToByteArray(this.backgroundColor.getColorNumber()));
        }
        this.document.outputDebugLinebreak(result);
        
        result.write(DocWriter.getISOBytes("\\clftsWidth3"));
        this.document.outputDebugLinebreak(result);
        
        result.write(DocWriter.getISOBytes("\\clwWidth"));
        result.write(intToByteArray(this.cellWidth));
        this.document.outputDebugLinebreak(result);
        
        if(this.cellPadding > 0) {
            result.write(DocWriter.getISOBytes("\\clpadl"));
            result.write(intToByteArray(this.cellPadding / 2));
            result.write(DocWriter.getISOBytes("\\clpadt"));
            result.write(intToByteArray(this.cellPadding / 2));
            result.write(DocWriter.getISOBytes("\\clpadr"));
            result.write(intToByteArray(this.cellPadding / 2));
            result.write(DocWriter.getISOBytes("\\clpadb"));
            result.write(intToByteArray(this.cellPadding / 2));
            result.write(DocWriter.getISOBytes("\\clpadfl3"));
            result.write(DocWriter.getISOBytes("\\clpadft3"));
            result.write(DocWriter.getISOBytes("\\clpadfr3"));
            result.write(DocWriter.getISOBytes("\\clpadfb3"));
        }
        result.write(DocWriter.getISOBytes("\\cellx"));
        result.write(intToByteArray(this.cellRight));
    }
115030
protected final void writeMapTo( Map<String,Object> map , RawDataBuffer out )
    {
    	if (map == null)
    	{
    		out.writeInt(0);
    		return;
    	}
    	
        out.writeInt(map.size());
        if (!map.isEmpty())
        {
            Iterator<Map.Entry<String,Object>> allEntries = map.entrySet().iterator();
            while (allEntries.hasNext())
            {
                Map.Entry<String,Object> entry = allEntries.next();
                out.writeUTF(entry.getKey());
                out.writeGeneric(entry.getValue());
            }
        }
    }
177562
private void writeZeroString(String outString, OutputStream outStream) throws IOException
   {
      simpleWriteString(outString, outStream);
      outStream.write(0);
      outStream.write(0);
   }
584440
@Override
    public void writeTo(CodedOutputStream output) throws IOException {
        MapEntryLite.writeTo(output, metadata, key, value);
    }
431
def write(self, msg):
        
        ser = msg.SerializeToString()
        header = struct.pack(">HL", mapping.get_type(msg), len(ser))
        self._write(b"##" + header + ser, msg)
1339236
private void _writeLongString(String text)
        throws IOException, JsonGenerationException
    {
        // First things first: let's flush the buffer to get some more room
        _flushBuffer();

        // Then we can write 
        final int textLen = text.length();
        int offset = 0;
        do {
            int max = _outputEnd;
            int segmentLen = ((offset + max) > textLen)
                ? (textLen - offset) : max;
            text.getChars(offset, offset+segmentLen, _outputBuffer, 0);
            if (_maximumNonEscapedChar != 0) {
                _writeSegmentASCII(segmentLen, _maximumNonEscapedChar);
            } else {
                _writeSegment(segmentLen);
            }
            offset += segmentLen;
        } while (offset < textLen);
    }
1205325
private void writeToImpl(Writer out, String encoding, byte[] bufferToWrite, int bufferToWriteLen)
            throws IOException {
        String writeStr;
        if (encoding != null) {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen, encoding);
        } else {
            writeStr = new String(bufferToWrite, 0, bufferToWriteLen);
        }
        out.write(writeStr);
    }
1188983
@Override protected AutoBuffer writeAll_impl(AutoBuffer ab) {
    for (Key<CompressedTree>[] ks : _output._treeKeys)
      for (Key<CompressedTree> k : ks)
        ab.putKey(k);
    for (Key<CompressedTree>[] ks : _output._treeKeysAux)
      for (Key<CompressedTree> k : ks)
        ab.putKey(k);
    return super.writeAll_impl(ab);
  }