/* Append data to file
@param {object} configure
516950
function append(configure) {
  fs.appendFileSync(configure.dist, JSON.stringify(configure.cacheArray).slice(1, -1));
}
512375
function writeToLogFile(rawPacket, parsedPacket) {
  if (!debugMode) { return; }

  var now = new Date().toUTCString();

  fs.appendFile(config.debugRawDataFile, 'Package received at ' + now + ':\n' + rawPacket + '\n\n', function (err) {
    if (err) {
      console.error('Could not write raw package to ' + config.debugRawDataFile);
    }
  });

  fs.appendFile(config.debugParsedDataFile, 'Package received at ' + now + ':\n' + JSON.stringify(parsedPacket, true, 4) + '\n\n', function (err) {
    if (err) {
      console.error('Could not write parsed package to ' + config.debugParsedDataFile);
    }
  });
}
85758
function appendToFile(fileContent, filePath) {
  return new Promise((resolve, reject) => {
    fs.appendFile(filePath, fileContent, 'utf8', (err) => {
      if (err) {
        reject(err);
      } else {
        resolve(filePath);
      }
    });
  });
}
229015
function (config) {
    config = config || {};
    Appender.call(this, config);

    /**
     * Log file name, initialized from the configuration. Folders up to the
     * file must exist beforehand.
     */
    this.fileName = config.fileName;

    /**
     * Append log events to the end of the file when true, clear the file
     * before writing the first log event otherwise.
     */
    this.appendToFile = (typeof config.append !== 'undefined') ?
      !!config.append :
      true;

    /**
     * True to log strings instead of objects
     */
    this.appendStrings = (typeof config.appendStrings !== 'undefined') ?
      config.appendStrings :
      true;

    /**
     * The file stream, initialized by the "start" function
     */
    this.stream = null;
  }
1037503
private void append(byte[] data) {
    if (storage.position() + data.length >= storage.capacity()) {
      ByteBuffer tmp = ByteBuffer.allocate(storage.limit() + data.length * 2);
      byte[] tmpData = new byte[storage.position()];
      storage.flip();
      storage.get(tmpData);
      tmp.put(tmpData);
      storage = tmp;
      logger.warn("Increase storage size. Current size is {}", storage.array().length);
    }

    try {
      storage.put(data);
    }
    catch (BufferOverflowException boe) {
      logger.error("Buffer overflow occured", boe);
    }
    boolean messageReceived;
    do {
      messageReceived = seekMessage();
    } while (messageReceived);
  }
1057700
def file_append(filepath, newcontent, backup=false)
      content = StringIO.new
      
      if self.file_exists?(filepath)
        self.cp filepath, "#{filepath}-previous" if backup
        content = self.file_download filepath
      end
      
      if newcontent.is_a?(StringIO)
        newcontent.rewind
        content.puts newcontent.read
      else
        content.puts newcontent
      end
      
      self.file_upload content, filepath
    end
1233758
def _append_data(self, value, _file):
        
        # binascii.b2a_base64(value) -> plistlib.Data
        # binascii.a2b_base64(Data) -> value(bytes)

        _tabs = '\t' * self._tctr
        _text = base64.b64encode(value).decode()  # value.hex() # str(value)[2:-1]
        _labs = '{tabs}<data>{text}</data>\n'.format(tabs=_tabs, text=_text)
        # _labs = '{tabs}<data>\n'.format(tabs=_tabs)

        # _list = []
        # for _item in textwrap.wrap(value.hex(), 32):
        #     _text = ' '.join(textwrap.wrap(_item, 2))
        #     _item = '{tabs}\t{text}'.format(tabs=_tabs, text=_text)
        #     _list.append(_item)
        # _labs += '\n'.join(_list)

        # _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 += '\n{tabs}</data>\n'.format(tabs=_tabs)
        _file.write(_labs)
977250
function adjustBundlesPath(data, options) {
	var path = require("path");
	var configuration = clone(data.configuration);

	var bundlesPath = configuration.bundlesPath;
	Object.defineProperty(configuration, "bundlesPath", {
		configurable: true,
		get: function() {
			return path.join(bundlesPath, options.target);
		}
	});

	return assign({}, omit(data, ["configuration"]), {
		configuration: configuration
	});
}
960325
function append(element, content) {
  if (isElement(content)) {
    element.appendChild(content);
  } else {
    const div = document.createElement('div');
    div.innerHTML = content || '';

    while (div.firstChild) {
      element.appendChild(div.firstChild);
    }
  }
}
52015
function append(key, value, req) {
  var val = this.getKey(key, req)
    , str = typeof val === 'string';
  // doesn't exist becomes the empty string
  if(val === undefined) val = new Buffer('');
  if(!(val instanceof Buffer)) val = new Buffer('' + val);
  if(!(value instanceof Buffer)) value = new Buffer('' + value);
  // coerce numbers to strings
  //val = (val + '') + value;
  //val = val.concat()
  val = Buffer.concat([val, value], val.length + value.length);
  if(str) val = val.toString();
  this.setKey(key, val, undefined, undefined, undefined, req);
  return str ? Buffer.byteLength(val) : val.length;
}
1346767
def addFile(self,file):
        
        mylambda= lambda adict : { key.upper() : mylambda(adict[key]) if isinstance(adict[key],dict) else adict[key] for key in adict.keys() }
        if file.endswith('.json') :
            with open(file, 'r') as f:
                fileContent = mylambda(json.load(f))

        elif file.endswith('.ini') :
            parser  = configparser.ConfigParser()
            parser.read(file)
            fileContent = { section : { conflist[0].upper() : conflist[1] for conflist in parser.items(section) } for section in parser.sections() }
        else :
            raise FileFormatException()

        self._config = {**self._config, **mylambda(fileContent)}
1287587
@GwtIncompatible("incompatible method")
    public StrBuilder append(final String format, final Object... objs) {
        return append(String.format(format, objs));
    }
939187
function addFilesToData(IOD, IODOpts, apiType, form) {
	_.each(T.maybeToArray(IODOpts.files), function(file) {
		if (apiType === IOD.TYPES.JOB) {
			form.append(file.name, fs.createReadStream(file.path))
		}
		else form.append('file', fs.createReadStream(file))
	})
}
717674
public void append(final byte[] data, final int start, final int len) {
		final int oldLength = this.bytes.length;
		setCapacity(this.bytes.length + len, true);
		System.arraycopy(data, start, this.bytes, oldLength, len);
	}
1350443
function add(data, callback) {
        var id = hat() + '.json';
        repo.contents(id).add({
            content: btoa(JSON.stringify(data)),
            branch: options.branch,
            message: '+'
        }, function(err, res) {
           callback(err, res, id);
        });
    }
279249
public Properties appendProperties(Properties properties, File configFile) {    

    if(!configFile.exists()) {

      return properties;
    }

    return reader.appendProperties(properties, configFile, log);
  }
564140
function _copyConfigFromFile(filePath, config) {
    LOG.info("Attempting to load configuration file '{}'", filePath);

    var fileConfig = require(filePath);
    _mergeConfig(config, fileConfig);

    LOG.info("Successfully read configuration file '{}'", filePath);
}