Returns a stream containing the patched JavaScript and source maps.
770387
function nls() {
    const input = event_stream_1.through();
    const output = input.pipe(event_stream_1.through(function (f) {
        if (!f.sourceMap) {
            return this.emit('error', new Error(`File ${f.relative} does not have sourcemaps.`));
        }
        let source = f.sourceMap.sources[0];
        if (!source) {
            return this.emit('error', new Error(`File ${f.relative} does not have a source in the source map.`));
        }
        const root = f.sourceMap.sourceRoot;
        if (root) {
            source = path.join(root, source);
        }
        const typescript = f.sourceMap.sourcesContent[0];
        if (!typescript) {
            return this.emit('error', new Error(`File ${f.relative} does not have the original content in the source map.`));
        }
        nls.patchFiles(f, typescript).forEach(f => this.emit('data', f));
    }));
    return event_stream_1.duplex(input, output);
}
249798
function makeStream(conn) {
    return function stream(sql, options = { highWaterMark: 5 }) {
        return conn.query(sql).stream(options);
    };
}
1035577
function() {
    return gulp
      .src(item.src)
      .pipe(sourcemaps.init())
      .pipe(concat(item.name + '.js'))
      .pipe(sourcemaps.write('./'))
      .pipe(gulp.dest(item.dest));
  }
1335740
def _get_stream_metadata(self, use_cached):
        """"""
        if self._cached_data is None or not use_cached:
            try:
                self._cached_data = self._conn.get_json("/ws/DataStream/%s" % self._stream_id)["items"][0]
            except DeviceCloudHttpException as http_exception:
                if http_exception.response.status_code == 404:
                    raise NoSuchStreamException("Stream with id %r has not been created" % self._stream_id)
                raise http_exception
        return self._cached_data
997374
function streamHandler(stream) {
    return stream
      .pipe(plumber())
      .pipe(sourcemaps.init({loadMaps: true}))
      .pipe(sourcemaps.write('.', {includeContent: true, sourceRoot: '.'}))
      .pipe(gulp.dest(dest));
  }
625325
def get_stream(self, stream):
        
        path = '/archive/{}/streams/{}'.format(self._instance, stream)
        response = self._client.get_proto(path=path)
        message = archive_pb2.StreamInfo()
        message.ParseFromString(response.content)
        return Stream(message)
47916
function getStreams(config) {
  const streams = Array.isArray(config.streams)
    ? [...config.streams]
    : [];

  // Nice output to stdout
  if (config.stdout) {
    streams.push({
      name: 'stdout',
      level: config.level,
      stream: bunyanFormat({ outputMode: 'short' }),
      type: 'stream',
    });
  }

  // Rollbar Transport
  // Messages at the warn level or higher are transported to Rollbar
  // Messages with an `err` and/or `req` data params are handled specially
  if (config.rollbarToken) {
    streams.push({
      name: 'rollbar',
      level: 'warn',
      stream: new ServerRollbarLogger({
        token: config.rollbarToken,
        environment: config.environment,
        codeVersion: config.codeVersion,
      }),
      type: 'raw',
    });
  }

  // Transport server logs
  if (config.logentriesToken) {
    streams.push(new ServerLogentriesLogger({
      name: config.name,
      token: config.logentriesToken,
      level: config.level,
    }));
  }

  return streams;
}
1156191
function gulpReplaceRef(opts) {

    opts = opts || {};

    var stream;

    // Creating a stream through which each file will pass
    stream = through.obj(function (srcFile, enc, callback) {
        var self = this;
        if (srcFile.isNull()) {
            self.push(srcFile); // Do nothing if no contents
            return callback();
        }

        if (srcFile.isBuffer()) {

            var strToReplace = srcFile.path.match( opts.srcMatch )[0], stream, targetMatch = opts.targetMatch;

            vfs.src(opts.target).pipe(es.map(function(phpFile, cb){
                //console.log(phpFile.path);
                var content = phpFile.contents.toString();
                if(targetMatch(srcFile.path).test(content)){
                    fs.writeFile(phpFile.path, content.replace(targetMatch(srcFile.path), strToReplace));
                    console.log('php file updated: ' + phpFile.path);
                }

                cb(null, phpFile);
            }));


            self.push(srcFile);
            return callback();
        }

        if (srcFile.isStream()) {
            this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!'));
            return callback();
        }
    });

    // returning the file stream
    return stream;
}
646094
function getSourceCode(fileName) {
    return __awaiter(this, void 0, void 0, function () {
        var code, codeCommentsRegex, importsRegex, imports;
        var _this = this;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0: return [4 /*yield*/, readFile(fileName, 'utf-8')];
                case 1:
                    code = _a.sent();
                    codeCommentsRegex = /(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(\/\/.*)/g;
                    code = code.replace(codeCommentsRegex, '');
                    importsRegex = /import "([^"]*)";/g;
                    imports = matches(importsRegex, code);
                    return [4 /*yield*/, Promise.all(imports.map(function (match) { return __awaiter(_this, void 0, void 0, function () {
                            var p, innerCode;
                            return __generator(this, function (_a) {
                                switch (_a.label) {
                                    case 0:
                                        p = path.resolve(fileName, '..', match.inner);
                                        return [4 /*yield*/, getSourceCode(p)];
                                    case 1:
                                        innerCode = _a.sent();
                                        // remove first line containing version
                                        innerCode = innerCode.replace(/^.*\n/, '');
                                        code = code.replace(match.full, innerCode);
                                        return [2 /*return*/];
                                }
                            });
                        }); }))];
                case 2:
                    _a.sent();
                    return [2 /*return*/, code];
            }
        });
    });
}
923558
function getSourceMappingURL() {
	if (path.extname(argv.output) === '.css') {
		return `\n/*# sourceMappingURL=${path.basename(argv.output)}.map */`;
	}
	return `\n//# sourceMappingURL=${path.basename(argv.output)}.map`;
}
1067154
function getProductsStream (types) {
  var stream = JSONStream.stringify(false);
  this.getProductsLists().then(function (lists) {
    this.getProductsDetails(selectProducts(types, lists), true)
        .pipe(JSONStream.parse())
        .pipe(stream);
  }.bind(this));
  return stream;
}
268360
function streamInjectLrScript (opts) {
  opts = opts || {}

  assert.equal(typeof opts, 'object')

  const protocol = opts.protocol || 'http'
  const host = opts.host || 'localhost'
  const port = opts.port || 35729

  var lrTag = '<script type="text/javascript"'
  lrTag += 'src="'
  lrTag += protocol
  lrTag += '://'
  lrTag += host
  lrTag += ':'
  lrTag += port
  lrTag += '/livereload.js?snipver=1">'
  lrTag += '</script>'

  return hyperstream({ body: { _appendHtml: lrTag } })
}
1038945
function () {
    var chunks = [];
    return through2.obj(function (file, enc, cb) {
        chunks.push(file);
        var string = file._contents.toString();
        var regex  = /\/\*\*debug:start\*\*\/[\s\S]*\/\*\*debug:end\*\*\//g;
        var stripped = string.replace(regex, "");
        file.contents = new Buffer(stripped);
        this.push(file);
        cb();
    });
}
1030147
function getNodeFromFiles(scriptFile, mapFile) {
    if (fs.existsSync(scriptFile) && fs.existsSync(mapFile)) {
        try {
            return SourceNode.fromStringWithSourceMap(
                getScriptFromFile(scriptFile),
                new SourceMapConsumer(getMapFromMapFile(mapFile))
            );
        } catch (error) {
            console.error('getNodeFromFiles() error: ' + error);
            return new SourceNode();
        }
    } else {
        return new SourceNode();
    }
}
854354
public static <T, K, V> Map<K, V> toMap( Stream<T> stream, Function<T, K> keySupplier, Function<T, V> valueSupplier ) {
        return stream.collect(Collectors.toMap(keySupplier, valueSupplier));
    }
733170
def get_stream(self, rel_path, cb=None, return_meta=False):
        """"""
        from boto.s3.key import Key
        from boto.exception import S3ResponseError

        import StringIO
        from . import MetadataFlo

        b = StringIO.StringIO()
        try:
            k = self._get_boto_key(rel_path)
            if not k:
                return None

            k.get_contents_to_file(b, cb=cb, num_cb=100)

            b.seek(0)

            if return_meta:
                d = k.metadata
                d['size'] = k.size
                d['etag'] = k.etag
            else:
                d = {}

            return MetadataFlo(b, d)

        except S3ResponseError as e:
            if e.status == 404:
                return None
            else:
                raise e
1065161
function processOutputs(outputs) {
  var removeSourceMaps = require('./sourcemaps').removeSourceMaps;

  var offset = 0;

  var outputObj = {};

  var sources = outputObj.sources = [];
  var sourceMapsWithOffsets = outputObj.sourceMapsWithOffsets = [];

  outputs.forEach(function(output) {
    var source;
    if (typeof output == 'object') {
      source = output.source || '';
      var offset_ = output.sourceMapOffset || 0;
      var map = output.sourceMap;
      if (map) {
        sourceMapsWithOffsets.push([offset + offset_, map]);
      }
    }
    // NB perhaps we should enforce output is always an object down the chain?
    else if (typeof output == 'string') {
      source = output;
    }
    else {
      var format = output ? output.toString() : typeof output;
      throw new Error("Unexpected output format: " + format);
    }
    source = removeSourceMaps(source || '');
    offset += countLines(source);
    sources.push(source);
  });

  return outputObj;
}