Write the diff (toVol from fromVol) to the stream context manager.
344872
def send(self, diff):
        
        if not self.dryrun:
            self._fileSystemSync()

        return self.butter.send(
            self.getSendPath(diff.toVol),
            self.getSendPath(diff.fromVol),
            diff,
            self.showProgress is True,
        )
789640
def _other_wrapper(self, name, writing):
        
        io_attr = getattr(self._io, name)

        def other_wrapper(*args, **kwargs):
            """Wrap all other calls to the stream Object.

            We do this to track changes to the write pointer.  Anything that
            moves the write pointer in a file open for appending should move
            the read pointer as well.

            Args:
                *args: Pass through args.
                **kwargs: Pass through kwargs.

            Returns:
                Wrapped stream object method.
            """
            write_seek = self._io.tell()
            ret_value = io_attr(*args, **kwargs)
            if write_seek != self._io.tell():
                self._read_seek = self._io.tell()
                self._read_whence = 0
            if not writing or not IS_PY2:
                return ret_value

        return other_wrapper
602218
public String generateDiff(GenericObject from, GenericObject to) {
        StringBuilder builder = new StringBuilder();

        builder.append("<table class=\"nomargin diff\">");
        builder.append("<thead>");
        builder.append("<tr>");
        builder.append("<th/>");
        builder.append("<th class=\"texttitle\">From</th>");
        builder.append("<th/>");
        builder.append("<th class=\"texttitle\">To</th>");
        builder.append("</tr>");
        builder.append("</thead>");

        builder.append("<tbody>");

        writeDiff(builder, from, to);

        builder.append("</tbody>");
        builder.append("</table>");

        return builder.toString();
    }
219252
def _create_diff(diff, fun, key, prev, curr):

    '''
    
    '''

    if not fun(prev):
        _create_diff_action(diff, 'added', key, curr)
    elif fun(prev) and not fun(curr):
        _create_diff_action(diff, 'removed', key, prev)
    elif not fun(curr):
        _create_diff_action(diff, 'updated', key, curr)
82476
def update_with_diff(self, identifier, new_instance):
        
        with self.flushing():
            instance = self.retrieve(identifier)
            before = Version(instance)
            self.merge(instance, new_instance)
            instance.updated_at = instance.new_timestamp()
            after = Version(instance)
        return instance, before - after
1032235
def diff(
        cobertura_file1, cobertura_file2,
        color, format, output, source1, source2,
        source_prefix1, source_prefix2, source):
    """"""
    cobertura1 = Cobertura(
        cobertura_file1,
        source=source1,
        source_prefix=source_prefix1
    )
    cobertura2 = Cobertura(
        cobertura_file2,
        source=source2,
        source_prefix=source_prefix2
    )

    Reporter = delta_reporters[format]
    reporter_args = [cobertura1, cobertura2]
    reporter_kwargs = {'show_source': source}

    isatty = True if output is None else output.isatty()

    if format == 'text':
        color = isatty if color is None else color is True
        reporter_kwargs['color'] = color

    reporter = Reporter(*reporter_args, **reporter_kwargs)
    report = reporter.generate()

    if not isinstance(report, bytes):
        report = report.encode('utf-8')

    click.echo(report, file=output, nl=isatty, color=color)

    exit_code = get_exit_code(reporter.differ, source)
    raise SystemExit(exit_code)
694355
void write(ObjectOutputStream out) throws IOException {
        PutField fields = out.putFields();

        fields.put(CONTEXT, threadContextDescriptor.serialize());

        fields.put(EXEC_PROPS, threadContextDescriptor.getExecutionProperties());

        fields.put(INTERNAL_PROP_NAMES, internalPropNames);

        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        ObjectOutputStream oout = new ObjectOutputStream(bout);
        oout.writeObject(object);
        oout.flush();
        fields.put(OBJECT, bout.toByteArray());
        oout.close();

        out.writeFields();
    }
168771
public void marshal(Object obj, HierarchicalStreamWriter writer,
			MarshallingContext context) {
		XTrace trace = (XTrace) obj;
		writer.startNode("XAttributeMap");
		context.convertAnother(trace.getAttributes(),
				XesXStreamPersistency.attributeMapConverter);
		writer.endNode();
		for (XEvent event : trace) {
			writer.startNode("XEvent");
			context.convertAnother(event, XesXStreamPersistency.eventConverter);
			writer.endNode();
		}
	}
90709
function writeStreamToFs(opts, stream) {
    var baseDir = path.join(opts.cwd, opts.directory);
    var walker = walk.walk(baseDir);

    walker.on('errors', function (root, stats, next) {
        stream.emit('error', new PluginError(PLUGIN_NAME, stats.error));
        next();
    });
    walker.on('directory', function (root, stats, next) {
        next();
    });

    walker.on('file', function (root, stats, next) {
        var filePath = path.resolve(root, stats.name);

        fs.readFile(filePath, function (error, data) {
            if (error) {
                stream.emit('error', new PluginError(PLUGIN_NAME, error));
            } else {
                stream.write(new Vinyl({
                    path: path.relative(baseDir, filePath),
                    contents: data
                }));
            }

            next();
        });
    });

    walker.on('end', function () {
        stream.emit('end');
        stream.emit('finish');
    });
}
1014000
def record_diff(lhs, rhs):
    ""
    delta = {}
    for k in set(lhs).union(rhs):
        from_ = lhs[k]
        to_ = rhs[k]
        if from_ != to_:
            delta[k] = {'from': from_, 'to': to_}

    return delta
1087309
def WriteMoDiff(diffObj):
	
	tabsize = 8
	print str(diffObj.Dn).ljust(tabsize * 10), str(diffObj.InputObject.propMoMeta.name).ljust(tabsize * 4), str(
		diffObj.SideIndicator).ljust(tabsize * 3), str(diffObj.DiffProperty)
285284
def write_to_textfile(path, registry):
    """"""
    tmppath = '%s.%s.%s' % (path, os.getpid(), threading.current_thread().ident)
    with open(tmppath, 'wb') as f:
        f.write(generate_latest(registry))
    # rename(2) is atomic.
    os.rename(tmppath, path)
1200105
def writeInfoLine(self, stream, fromUUID, size):
        
        if size is None or fromUUID is None:
            return
        if not isinstance(size, int):
            logger.warning("Bad size: %s", size)
            return
        stream.write(str("%s\t%s\t%d\n" % (
            self.uuid,
            fromUUID,
            size,
        )))
788009
def modified_lines_from_diff(self, diff):
        
        from pep8radius.diff import modified_lines_from_udiff
        for start, end in modified_lines_from_udiff(diff):
            yield start, end
150262
void writeToFile() throws IOException {
		// on clone le counter avant de le sérialiser pour ne pas avoir de problèmes de concurrences d'accès
		final Counter counter = this.clone();
		// on n'écrit pas rootCurrentContextsByThreadId en fichier
		// puisque ces données ne seront plus vraies dans quelques secondes (clear pour être sûr ici)
		counter.rootCurrentContextsByThreadId.clear();
		estimatedMemorySize = new CounterStorage(counter).writeToFile();
	}
638826
def __diff_obj(self, level, parents_ids=frozenset({}),
                   is_namedtuple=False):
        """"""
        try:
            if is_namedtuple:
                t1 = level.t1._asdict()
                t2 = level.t2._asdict()
            else:
                t1 = level.t1.__dict__
                t2 = level.t2.__dict__
        except AttributeError:
            try:
                t1 = self.__dict_from_slots(level.t1)
                t2 = self.__dict_from_slots(level.t2)
            except AttributeError:
                self.__report_result('unprocessed', level)
                return

        self.__diff_dict(
            level,
            parents_ids,
            print_as_attribute=True,
            override=True,
            override_t1=t1,
            override_t2=t2)
249360
def diff(base, other, **kwargs):
    """"""
    return Diff(diff_iter(base, other, **kwargs),
                base_type_name=type(base).__name__,
                other_type_name=type(other).__name__)