Creates a new Chunk.

@param options
@constructor
505036
function Chunk(options)
{
  // make sure the options object contains all the necessary information
  Errors.assertInternal(Util.isObject(options));
  Errors.assertInternal(Util.isObject(options.statement));
  Errors.assertInternal(Util.isObject(options.services));
  Errors.assertInternal(Util.isNumber(options.startIndex));
  Errors.assertInternal(Util.isArray(options.columns));
  Errors.assertInternal(Util.isObject(options.mapColumnNameToIndices));
  Errors.assertInternal(Util.isObject(options.statementParameters));
  Errors.assertInternal(Util.isString(options.resultVersion));
  Errors.assertInternal(Util.isNumber(options.rowCount));

  // if the result is small (i.e. not persisted on S3/Blob), there's no
  // compressed and uncompressed size, so default to -1
  this._compressedSize   = options.compressedSize   || -1;
  this._uncompressedSize = options.uncompressedSize || -1;

  // copy out other information from the options object and save it
  this._statement              = options.statement;
  this._services               = options.services;
  this._startIndex             = options.startIndex;
  this._url                    = options.url;
  this._columns                = options.columns;
  this._mapColumnNameToIndices = options.mapColumnNameToIndices;
  this._chunkHeaders           = options.chunkHeaders;
  this._rowset                 = options.rowset;

  // use the start index and row count to compute the end index
  this._endIndex = this._startIndex + options.rowCount - 1;

  // use the start and end index to build an id for this chunk
  this._id = buildId(this._startIndex, this._endIndex);
}
1205210
@UiThread
  public T create(S options) {
    T t = options.build(currentId, this);
    annotations.put(t.getId(), t);
    currentId++;
    updateSource();
    return t;
  }
630934
function(options) {
  options = options || {};
  
  this.datasources = [];
  this.styles = [];
  this.projection = DEFAULT_PROJECTION;
  this.assetsPath = ".";
  
  if (options.projection){
    this.projection = projector.util.cleanProjString(options.projection);
    console.log(this.projection);
  }
  
  this.boundsBuffer =
    ("boundsBuffer" in options) ? options.boundsBuffer : BUFFER_RATIO;
  
  this._renderer = cartoRenderer;
}
427439
async function create(channelName, options = {}) {
    options = fillOptionsWithDefaults(options);
    const time = microSeconds();
    const paths = getPaths(channelName);
    const ensureFolderExistsPromise = ensureFoldersExist(channelName, paths);
    const uuid = randomToken(10);

    const state = {
        time,
        channelName,
        options,
        uuid,
        paths,
        // contains all messages that have been emitted before
        emittedMessagesIds: new ObliviousSet(options.node.ttl * 2),
        messagesCallbackTime: null,
        messagesCallback: null,
        // ensures we do not read messages in parrallel
        writeBlockPromise: Promise.resolve(),
        otherReaderClients: {},
        // ensure if process crashes, everything is cleaned up
        removeUnload: unload.add(() => close(state)),
        closed: false
    };

    if (!OTHER_INSTANCES[channelName]) OTHER_INSTANCES[channelName] = [];
    OTHER_INSTANCES[channelName].push(state);

    await ensureFolderExistsPromise;
    const [
        socketEE,
        infoFilePath
    ] = await Promise.all([
        createSocketEventEmitter(channelName, uuid, paths),
        createSocketInfoFile(channelName, uuid, paths),
        refreshReaderClients(state)
    ]);
    state.socketEE = socketEE;
    state.infoFilePath = infoFilePath;

    // when new message comes in, we read it and emit it
    socketEE.emitter.on('data', data => {

        // if the socket is used fast, it may appear that multiple messages are flushed at once
        // so we have to split them before
        const singleOnes = data.split('|');
        singleOnes
            .filter(single => single !== '')
            .forEach(single => {
                try {
                    const obj = JSON.parse(single);
                    handleMessagePing(state, obj);
                } catch (err) {
                    throw new Error('could not parse data: ' + single);
                }
            });
    });

    return state;
}
596763
function Stream( arr, options ) {
		if ( !Array.isArray( arr ) ) {
			throw new TypeError( 'Stream()::invalid input argument. First argument must be an array.' );
		}
		if ( arguments.length < 2 ) {
			options = {};
		}
		if ( !( this instanceof Stream ) ) {
			return new Stream( arr, options );
		}
		var err = validate( options );
		if ( err ) {
			throw err;
		}
		setOptions( options );
		Readable.call( this, options );
		this._array = arr.slice();
		this._destroyed = false;
		this._enc = options.encoding;
		this._mode = options.objectMode;
		return this;
	}
1122658
function create(options) {
  options = options || {};

  var scrollParent = (options.scrollTarget && options.scrollTarget.parentNode) || window;

  var oldScrollY;
  var scrollDirty = true;
  var scrollEventsStream = Stream.createFromEvents(scrollParent, 'scroll');

  Stream.onValue(scrollEventsStream, function onScrollSetDirtyBit_() {
    scrollDirty = true;
  });

  var rAF = Stream.createFromRAF();

  var didChangeOnRAFStream = Stream.filter(function filterDirtyFramesFromRAF_() {
    if (!scrollDirty) { return false; }
    scrollDirty = false;

    var newScrollY = DOM.documentScrollY(scrollParent);

    if (oldScrollY !== newScrollY) {
      oldScrollY = newScrollY;
      return true;
    }

    return false;
  }, rAF);

  // It's going to space, will you just give it a second!
  Util.defer(Util.partial(Events.dispatchEvent, scrollParent, 'scroll'), 10);

  return Stream.map(function getWindowPosition_() {
    return oldScrollY;
  }, didChangeOnRAFStream);
}
1130727
function Zipline(options) {
  if (!this) return new Zipline(options);
  options = options || {};

  this.pathname = options.pathname || '/zipline.js';
  this.name = options.name || 'zipline';
  this.buffer = null;

  this.initialize();
}
1212161
function(options) {
      if (this.constructor.fromObject) {
        return this.constructor.fromObject(this.toObject(), options);
      }
      return new fabric.Object(this.toObject());
    }
688061
function Options(options) {
  if (!(this instanceof Options)) {
    return new Options(options);
  }
  this.defaults = this.defaults || {};
  this.options = this.options || {};
  if (options) {
    this.option(options);
  }
}
524964
function PaymentACK(options) {
  if (!(this instanceof PaymentACK))
    return new PaymentACK(options);

  this.payment = new Payment();
  this.memo = null;

  if (options)
    this.fromOptions(options);
}
713645
function chunk(arr, chunkSize) {
      var result = [];
      for (var index = 0, length = arr.length; index < length; index += chunkSize) {
        result.push(arr.slice(index,index + chunkSize));
      }
      return(result);
    }
947101
function ( options ) {
			this.protocol = options.protocol || 'http';
			this.port = options.port;
			this.server = options.server;
			this.path = options.path;
			this.proxy = options.proxy;
			this.jar = request.jar(); // create new cookie jar for each instance

			this.debug = options.debug;

			// set up logging
			const winston = require( 'winston' ),
				// file logging
				path = require( 'path' ),
				fs = require( 'fs' ),
				logDir = path.dirname( process.argv[ 1 ] ) + '/log/',
				logFile = logDir + path.basename( process.argv[ 1 ], '.js' ) + '.log',
				// how many tasks (i.e. requests) to run in parallel
				concurrency = options.concurrency || 3;

			this.logger = new ( winston.Logger )();

			// console logging
			if ( this.debug ) {
				this.logger.add( winston.transports.Console, {
					level: 'debug'
				} );
			}

			this.logger.cli();

			if ( fs.existsSync( logDir ) ) {
				this.logger.add( winston.transports.File, {
					colorize: true,
					filename: logFile,
					json: false,
					level: this.debug ? 'debug' : 'info'
				} );
			}

			// requests queue
			// @see https://github.com/caolan/async#queue
			this.queue = async.queue( function ( task, callback ) {
			// process the task (and call the provided callback once it's completed)
				task( callback );
			}, concurrency );

			// HTTP client
			this.formatUrl = require( 'url' ).format;

			this.userAgent = options.userAgent || ( `nodemw/${VERSION} (node.js ${process.version}; ${process.platform} ${process.arch})` );
			this.version = VERSION;

			// debug info
			this.info( process.argv.join( ' ' ) );
			this.info( this.userAgent );

			let port = this.port ? `:${this.port}` : '';

			this.info( `Using <${this.protocol}://${this.server}${port}${this.path}/api.php> as API entry point` );
			this.info( '----' );
		}
94268
function createMiddleware(options) {
  /**
   * Express middleware handling Git API Blob requests
   *
   * Only a small subset will be implemented
   *
   * @param {Request} req Request object
   * @param {Response} res Response object
   * @param {callback} next next middleware in chain
   *
   * @see https://developer.github.com/v3/git/blobs/#get-a-blob
   */
  return (req, res, next) => {
    // GET /repos/:owner/:repo/git/blobs/:file_sha
    const { owner } = req.params;
    const repoName = req.params.repo;
    const sha = req.params.file_sha;
    const host = req.mappedSubDomain ? `localhost:${options.listen[req.protocol].port}` : req.headers.host;

    const repPath = resolveRepositoryPath(options, owner, repoName);

    if (sha.match(/[0-9a-f]/g).length !== 40) {
      // invalid sha format
      res.status(422).json({
        message: 'The sha parameter must be exactly 40 characters and contain only [0-9a-f].',
        documentation_url: 'https://developer.github.com/v3/git/blobs/#get-a-blob',
      });
      return;
    }
    getObject(repPath, sha)
      .then(({ object: content }) => {
        res.json({
          sha,
          size: content.length,
          url: `${req.protocol}://${host}${req.path}`,
          content: `${content.toString('base64')}\n`,
          encoding: 'base64',
        });
      })
      .catch((err) => {
        // TODO: use generic errors
        if (err.code === 'ReadObjectFail') {
          options.logger.debug(`[blobHandler] resource not found: ${err.message}`);
          res.status(404).json({
            message: 'Not Found',
            documentation_url: 'https://developer.github.com/v3/git/blobs/#get-a-blob',
          });
        } else {
          options.logger.debug(`[blobHandler] code: ${err.code} message: ${err.message} stack: ${err.stack}`);
          next(err);
        }
      });
  };
}
968039
function createChunk(type, data) {
	const length = typeof data != 'undefined' ? data.length : 0;
	const chunk = Buffer.alloc(4 + 4 + length + 4);

	chunk.writeUInt32BE(length, 0);
	chunk.fill(type, 4, 8, 'utf8');
	if (typeof data != 'undefined') {
		chunk.fill(data, 8, chunk.length - 4);
	}
	chunk.writeUInt32BE(crc32(chunk.slice(4, -4)), chunk.length - 4);

	return chunk;
}
489289
function createWriteStream (path, options) {
    // build meta data
    var metadata = {}
    // get content type for file
    var contentType = mimeTypes.lookup(path)
    // set content type if found
    if (contentType) {
        metadata.contentType = contentType
    }
    // make sure bucket exists
    return this.bucketExists().then(() => {
        // create file write stream
        return this.bucket.file(path).createWriteStream({
            gzip: this.defaultGzip,
            metadata: metadata,
            public: this.defaultPublic,
            resumable: false,
        })
    })
}
649809
function (output, chunk) {
                var me = this, stream = me._stream;
                stream.pause();
                output.write(chunk).then(function () {
                    stream.resume();
                }, me._reject);
            }
493585
function Block(options) {
  if (!(this instanceof Block))
    return new Block(options);

  AbstractBlock.call(this);

  this.txs = [];

  this._raw = null;
  this._size = -1;
  this._witness = -1;

  if (options)
    this.fromOptions(options);
}