FUNCTIONS // 
FUNCTION: copyOptions( options )
Copies relevant stream options into a new object.

@private
@param {Object} options - stream options
@returns {Object} options copy
187274
function copyOptions( options ) {
		var props = [
				'objectMode',
				'highWaterMark',
				'encoding'
			],
			copy = {},
			prop;

		for ( var i = 0; i < props.length; i++ ) {
			prop = props[ i ];
			if ( options.hasOwnProperty( prop ) ) {
				copy[ prop ] = options[ prop ];
			}
		}
		return copy;
	}
231622
function streamFactory( options ) {
		if ( !arguments.length ) {
			options = {};
		}
		options = copyOptions( options );
		/**
		* FUNCTION: createStream( value )
		*	Creates a stream.
		*
		* @param {*} value - value to be appended
		* @returns {Stream} Transform stream
		*/
		return function createStream( value ) {
			return new Stream( value, options );
		};
	}
385181
func copyOptions(opts []string) []string {
	if len(opts) == 0 {
		return nil
	}

	acopy := make([]string, len(opts))
	copy(acopy, opts)
	return acopy
}
1014085
function copyFile(source, target, copyCallback) {
    const readStream = fs.createReadStream(source);
    const writeStream = fs.createWriteStream(target);
    let done = false;

    readStream.on('error', copyDone);
    writeStream.on('error', copyDone);

    writeStream.on('close', function onWriteCb() {
        copyDone(null);
    });

    readStream.pipe(writeStream);

    /**
     * Finish copying. Reports error when needed
     * @param [error] optional error
     */
    function copyDone(error) {
        if (!done) {
            done = true;
            copyCallback(error);
        }
    }
}
295497
function cloneSuite(options) {
      var suite = this,
          result = new suite.constructor(_.assign({}, suite.options, options));

      // Copy own properties.
      _.forOwn(suite, function(value, key) {
        if (!_.has(result, key)) {
          result[key] = value && _.isFunction(value.clone)
            ? value.clone()
            : cloneDeep(value);
        }
      });
      return result;
    }
1229273
function(options) {
			this.inputStream = options.inputStream || process.stdin;
			this.outputStream = options.outputStream || process.stdout;
		}
938191
function(options) {
  var config = _.clone(options) || {};

  config.ignoredTypes = _.clone(Syphon.ignoredTypes);
  config.inputReaders = config.inputReaders || Syphon.InputReaders;
  config.inputWriters = config.inputWriters || Syphon.InputWriters;
  config.keyExtractors = config.keyExtractors || Syphon.KeyExtractors;
  config.keySplitter = config.keySplitter || Syphon.KeySplitter;
  config.keyJoiner = config.keyJoiner || Syphon.KeyJoiner;
  config.keyAssignmentValidators = config.keyAssignmentValidators || Syphon.KeyAssignmentValidators;

  return config;
}
589027
function setOptions(object, options) {
      options = object.options = _.assign({}, cloneDeep(object.constructor.options), cloneDeep(options));

      _.forOwn(options, function(value, key) {
        if (value != null) {
          // Add event listeners.
          if (/^on[A-Z]/.test(key)) {
            _.each(key.split(' '), function(key) {
              object.on(key.slice(2).toLowerCase(), value);
            });
          } else if (!_.has(object, key)) {
            object[key] = cloneDeep(value);
          }
        }
      });
    }
1151067
public static ImmutableSet<CopyOption> getMoveOptions(CopyOption... options) {
    return ImmutableSet.copyOf(Lists.asList(LinkOption.NOFOLLOW_LINKS, options));
  }
926040
function BufferStreamReader (data, options) {
  if (!(this instanceof BufferStreamReader)) {
    return new BufferStreamReader(data);
  }

  if (!options) {
    options = {};
  }

  stream.Readable.call(this, options);

  this._data = null;
  this._chunkSize = options.chunkSize || -1;

  if (typeof data === 'string') {
    this._data = new Buffer(data, options.encoding || 'utf8');
  } else if (Buffer.isBuffer(data)) {
    this._data = data;
  }
}
1243734
function createStringifyStream(opts) {
    assert.object(opts, 'opts');
    assert.ok(Array.isArray(opts.body) || typeof opts.body === 'object',
        'opts.body must be an array or object');

    return stringifyStreamFactory(opts.body, null, null, true);
}
849139
function Stream(options) {

  /**
   * Whether or not the Stream was initialized as
   * a single- or multi-key stream.
   *
   * @property multi
   * @type Boolean
   */
  reader(this, 'multi', !(options && options.apiKey));

  if (!this.multi) {
    options.headers = options.headers || {};
    options.headers['Zotero-API-Key'] = options.apiKey;

    delete options.apiKey;
  }

  Client.call(this, options);

  /**
   * @property retry
   * @type Object
   */
  reader(this, 'retry', {
    delay: Stream.DEFAULT_RETRY
  });

  /**
   * @property idle
   * @type Object
   */
  reader(this, 'idle', {
    ping: Stream.IDLE_TIMEOUT,
    pong: Stream.IDLE_TIMEOUT / 2
  });

  /**
   * @property subscriptions
   * @type Subscriptions
   */
  this.subscriptions = new Subscriptions();

  this.open = this.open.bind(this);
  this.opened = this.opened.bind(this);
  this.closed = this.closed.bind(this);
  this.ping = this.ping.bind(this);
  this.pong = this.pong.bind(this);
  this.receive = this.receive.bind(this);
  this.error = this.error.bind(this);

  this.open();
}
1174298
function copyFile (src, dest) {
  return new Promise((resolve, reject) => {
    const read = fs.createReadStream(src);
    read.on('error', reject);
    const write = fs.createWriteStream(dest);
    write.on('error', reject);
    write.on('finish', resolve);
    read.pipe(write);
  })
}
727559
function copy(src, dest) {
	return new Promise((resolve, reject) => {
		var cbCalled = false;
		var rd = fs.createReadStream(src);
		rd.on("error", (err) => {
			done(err);
		});
		var wr = fs.createWriteStream(dest);
		wr.on("error", (err) => {
			done(err);
		});
		wr.on("close", () => {
			done();
		});
		rd.pipe(wr);

		function done(err) {
			if (!cbCalled) {
				cbCalled = true;
				!err ? resolve() : reject(err);
			}
		}
	});
}
1273774
function() {
			var options, name, src, copy, copyIsArray, clone,
				target = arguments[0] || {},
				i = 1,
				length = arguments.length;


			// Handle case when target is a string or something (possible in deep copy)
			if (typeof target !== 'object' && typeof target !== 'function') {
				target = {};
			}

			for ( ; i < length; i++ ) {
				// Only deal with non-null/undefined values
				if ( (options = arguments[ i ]) !== null ) {
					// Extend the base object
					for ( name in options ) {
						src = target[ name ];
						copy = options[ name ];

						// Prevent never-ending loop
						if ( target === copy ) {
							continue;
						}

						// Recurse if we're merging plain objects or arrays
						if ( copy && ( typeof copy === 'object' || (copyIsArray = Array.isArray(copy)) ) ) {
							if ( copyIsArray ) {
								copyIsArray = false;
								clone = src && Array.isArray(src) ? src : [];

							} else {
								clone = src && typeof src === 'object' ? src : {};
							}

							// Never move original objects, clone them
							target[ name ] = this.deepMerge(clone, copy );

						// Don't bring in undefined values
						} else if ( copy !== undefined ) {
							target[ name ] = copy;
						}
					}
				}
			}

			// Return the modified object
			return target;
		}
470130
function createStream(func) {
    var dir = Path.dirname(this.options.path);
    Mkdirp.sync(dir);
    return Fs[func](this.options.path, Ul.deepMerge(
        {}
      , this.options.options
      , { flags: this.options.flags }
    ));
}
103039
function objectMode( value, options ) {
		if ( arguments.length < 2 ) {
			options = {};
		}
		options.objectMode = true;
		return new Stream( value, options );
	}