Append data to a file.
481229
def append(self, data):
    """"""
    data_length = len(data)
    if self._size + data_length > self._flush_size:
      self.flush()

    if not self._exclusive and data_length > _FILE_POOL_MAX_SIZE:
      raise errors.Error(
          "Too big input %s (%s)."  % (data_length, _FILE_POOL_MAX_SIZE))
    else:
      self._buffer.append(data)
      self._size += data_length

    if self._size > self._flush_size:
      self.flush()
933118
def write_file(path, data):
    """"""
    with open(path, 'w') as f:
        log.debug('setting %s contents:\n%s', path, data)
        f.write(data)
    return f
275856
def _append_array(self, value, _file):
        
        if not value:
            self._append_none(None, _file)
            return

        _bptr = ''
        _tabs = ''
        _tlen = len(value) - 1
        if _tlen:
            _bptr = '  |-->'
            for _ in range(self._tctr + 1):
                _tabs += _TEMP_SPACES if self._bctr[_] else _TEMP_BRANCH
        else:
            _tabs = ''

        for (_nctr, _item) in enumerate(value):
            _text = '{tabs}{bptr}'.format(tabs=_tabs, bptr=_bptr)
            _file.write(_text)

            _item = self.object_hook(_item)
            _type = type(_item).__name__
            _MAGIC_TYPES[_type](self, _item, _file)

            _suff = '\n' if _nctr < _tlen else ''
            _file.write(_suff)
1251455
def _append_integer(self, value, _file):
        
        _tabs = '\t' * self._tctr
        _text = value
        _labs = '{tabs}<integer>{text}</integer>\n'.format(tabs=_tabs, text=_text)
        _file.write(_labs)
191155
def write(self, data):
        """"""
        data = data.encode('utf-8')
        data_p = ctypes.create_string_buffer(data)
        num_bytes = PLARGE_INTEGER(LARGE_INTEGER(0))
        bytes_to_write = len(data)
        success = WriteFile(self.conin_pipe, data_p,
                            bytes_to_write, num_bytes, None)
        return success, num_bytes[0]
1358795
def append(self, filename, content, binary=False):
        """"""

        self._raise_if_none()
        fn = path_join(self.path, filename)

        if binary:
            flags = 'ab'
        else:
            flags = 'a'

        with open(fn, 'a') as f:
            f.write(content)
            return True
942993
def feed_data(self, data):
        """"""
        if data:
            self._bytes.append(data)
            if self.parser.stream:
                self.parser.stream(self)
            else:
                self.parser.buffer.extend(data)
850047
def write (self, data):
        """"""
        assert isinstance(data, unicode)
        if self.closed:
            raise IOError("Write on closed I/O object")
        if data:
            self.buf.append(data)
724376
def file_put_contents(path, data):
    
    with open(path, 'w') as f:
        f.write(data); f.flush()
1118747
def _append_bytes(self, value, _file):  # pylint: disable=no-self-use
        
        # binascii.b2a_base64(value) -> plistlib.Data
        # binascii.a2b_base64(Data) -> value(bytes)

        _text = ' '.join(textwrap.wrap(value.hex(), 2))
        # _data = [H for H in iter(
        #         functools.partial(io.StringIO(value.hex()).read, 2), '')
        #         ]  # to split bytes string into length-2 hex string list
        _labs = ' "{text}"'.format(text=_text)
        _file.write(_labs)
183932
def _append_value(self, value, _file, _name):
        
        _tabs = '\t' * self._tctr
        _cmma = ',\n' if self._vctr[self._tctr] else ''
        _keys = '{cmma}{tabs}"{name}" :'.format(cmma=_cmma, tabs=_tabs, name=_name)

        _file.seek(self._sptr, os.SEEK_SET)
        _file.write(_keys)

        self._vctr[self._tctr] += 1
        self._append_object(value, _file)
124257
def append(self, data: Union[bytes, bytearray, memoryview]) -> None:
        
        size = len(data)
        if size > self._large_buf_threshold:
            if not isinstance(data, memoryview):
                data = memoryview(data)
            self._buffers.append((True, data))
        elif size > 0:
            if self._buffers:
                is_memview, b = self._buffers[-1]
                new_buf = is_memview or len(b) >= self._large_buf_threshold
            else:
                new_buf = True
            if new_buf:
                self._buffers.append((False, bytearray(data)))
            else:
                b += data  # type: ignore

        self._size += size
838184
public void setData(byte[] data, boolean append) {
	lastModified = System.currentTimeMillis();

	// set data
	if (append) {
	    if (this.data != null && data != null) {
		byte[] newData = new byte[this.data.length + data.length];
		int i = 0;
		for (; i < this.data.length; i++) {
		    newData[i] = this.data[i];
		}
		for (; i < this.data.length + data.length; i++) {
		    newData[i] = data[i - this.data.length];
		}
		this.data = newData;
	    }
	    else if (data != null) {
		this.data = data;
	    }
	}
	else {
	    this.data = data;
	}

	// set type
	if (this.data != null) this.type = TYPE_FILE;

    }
1136454
static byte[] append(byte[] data, boolean[] toAppend) {
        byte[] toAppendBytes = new byte[toAppend.length];
        for (int i = 0; i < toAppend.length; i++) {
            toAppendBytes[i] = toAppend[i] ? (byte) 1 : (byte) 0;
        }
        return append(data, toAppendBytes);
    }
792580
function append($data)
    {
        if ($this->_PPS_FILE) {
            fwrite($this->_PPS_FILE, $data);
        } else {
            $this->_data .= $data;
        }
    }
449447
def _append_array(self, value, _file):
        
        _labs = ' ['
        _file.write(_labs)

        self._tctr += 1

        for _item in value:
            _cmma = ',' if self._vctr[self._tctr] else ''
            _file.write(_cmma)

            self._vctr[self._tctr] += 1

            _item = self.object_hook(_item)
            _type = type(_item).__name__
            _MAGIC_TYPES[_type](self, _item, _file)

        self._vctr[self._tctr] = 0
        self._tctr -= 1

        _labs = ' ]'
        _file.write(_labs)
1113480
def append (self, cmd, delay=0.000, attrs=None):
    """"""
    self.lines.append( SeqCmd(cmd, delay, attrs) )