Build the union and write the result into the stream.

        :stream: None
        :returns: None
550910
def _pfp__build(self, stream=None, save_offset=False):
        
        max_size = -1
        if stream is None:
            core_stream = six.BytesIO()
            new_stream = bitwrap.BitwrappedStream(core_stream)
        else:
            new_stream = stream

        for child in self._pfp__children:
            curr_pos = new_stream.tell()
            child._pfp__build(new_stream, save_offset)
            size = new_stream.tell() - curr_pos
            new_stream.seek(-size, 1)

            if size > max_size:
                max_size = size

        new_stream.seek(max_size, 1)

        if stream is None:
            return core_stream.getvalue()
        else:
            return max_size
567160
def dump(data, stream=None, **kwargs):
    
    return yaml.dump_all(
        [data],
        stream=stream,
        Dumper=YAMLDictDumper,
        **kwargs
    )
967241
def puts(s='', newline=True, stream=STDOUT):
    
    if not is_werkzeug_process():
        try:
            return _puts(s, newline, stream)
        except UnicodeEncodeError:
            return _puts(s.encode(sys.stdout.encoding), newline, stream)
113823
def _write_plan(self, stream):
        
        if self.plan is not None:
            if not self._plan_written:
                print("1..{0}".format(self.plan), file=stream)
            self._plan_written = True
1323998
def union(self, *others):
        
        return self.copy(super(NGram, self).union(*others))
1370400
def union(self, *args):
        """"""
        if self._readonly:
            raise AttributeError

        if len(args) == 0:
            return None
        if len(args) == 1:
            return self[args[0]]
        for a, b in zip(args[:-1], args[1:]):
            result = self._union_pair(a, b)
        return result
996343
def writeUTFBytes(self, value):
        
        val = None

        if isinstance(value, unicode):
            val = value
        else:
            val = unicode(value, 'utf8')

        self.stream.write_utf8_string(val)
373379
def _add_flaky_report(self, stream):
        
        value = self._stream.getvalue()

        # If everything succeeded and --no-success-flaky-report is specified
        # don't print anything.
        if not self._flaky_success_report and not value:
            return

        stream.write('===Flaky Test Report===\n\n')

        # Python 2 will write to the stderr stream as a byte string, whereas
        # Python 3 will write to the stream as text. Only encode into a byte
        # string if the write tries to encode it first and raises a
        # UnicodeEncodeError.
        try:
            stream.write(value)
        except UnicodeEncodeError:
            stream.write(value.encode('utf-8', 'replace'))

        stream.write('\n===End Flaky Test Report===\n')
724956
def write(self, stream):
        """"""
        topology = self.createTopology()
        def write_it(stream):
            transportOut = TMemoryBuffer()
            protocolOut = TBinaryProtocol.TBinaryProtocol(transportOut)
            topology.write(protocolOut)
            bytes = transportOut.getvalue()
            stream.write(bytes)

        if isinstance(stream, six.string_types):
            with open(stream, 'wb') as f:
                write_it(f)
        else:
            write_it(stream)
            
        return topology
162269
def dump(self, stream=None):
        
        if stream is None:
            stream = BytesIO()

        if isinstance(stream, bytes):
            stream = BytesIO(stream)

        stream = self.codec.compress(stream)
        self.fs.dump(stream)

        return self
1374704
def union(self):
        
        usegs = reduce(operator.or_, self.values())
        usegs.name = ' | '.join(self.keys())
        return usegs
1157734
def dump_stream(self, iterator, stream):
        
        batches = (self._create_batch(series) for series in iterator)
        super(ArrowStreamPandasSerializer, self).dump_stream(batches, stream)
875474
def pack(o, stream, **kwargs):
    
    packer = Packer(**kwargs)
    stream.write(packer.pack(o))
1364321
def write(self, output):
        
        self._stream.write(output)

        if self._auto_flush:
            self._stream.flush()
822346
def _create_stream(self, max_buffer_size, af, addr, **kwargs):  # pylint: disable=unused-argument
        '''
        
        '''
        # Always connect in plaintext; we'll convert to ssl if necessary
        # after one connection has completed.
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        _set_tcp_keepalive(sock, self.opts)
        stream = tornado.iostream.IOStream(
            sock,
            max_buffer_size=max_buffer_size)
        if tornado.version_info < (5,):
            return stream.connect(addr)
        return stream, stream.connect(addr)
379702
def dump(data, stream=None, Dumper=Dumper, **kwds):
    
    return dump_all([data], stream, Dumper=Dumper, **kwds)
933585
def _pfp__build(self, stream=None, save_offset=False):
        
        if save_offset and stream is not None:
            self._pfp__offset = stream.tell()

        # returns either num bytes written or total data
        res = utils.binary("") if stream is None else 0

        # iterate IN ORDER
        for child in self._pfp__children:
            child_res = child._pfp__build(stream, save_offset)
            res += child_res

        return res