pipe rewire do not use recursion here to prevent maximum call stack
342720
function pipe(funcs) {
  return function pipeRewire(config) {
    const args = Array.prototype.slice.call(arguments, 1);
    (funcs || []).forEach(func => {
      if (func && typeof func === 'function') {
        // slice the first argument "config"
        config = func.apply(this, [config].concat(args));
      }
    });
    return config;
  };
}
1163852
function executePipeOnDestroys(viewData) {
    var pipeDestroyHooks = viewData[TVIEW] && viewData[TVIEW].pipeDestroyHooks;
    if (pipeDestroyHooks) {
        callHooks(viewData, pipeDestroyHooks);
    }
}
757137
function processStackItem(out, stack, rootPath, userFilter, readMode) {
  // Initialize a new file object.
  const initFile = (dirPath) => {
    return (fileName, callback) => {
      const filePath = path.join(dirPath, fileName);
      fs.stat(filePath, (error, stats) => {
        async.nextTick(callback, error, {
          path: path.relative(rootPath, filePath),
          stats,
        });
      });
    };
  };

  // Filter supported files.
  const filterSupported = () => {
    return (file, callback) => {
      const keep = file.stats.isFile() || file.stats.isDirectory();
      async.nextTick(callback, null, keep);
    };
  };

  // Filter output files.
  const filterOutput = () => {
    return (file, callback) => {
      const keep = file.stats.isFile() && userFilter(file);
      async.nextTick(callback, null, keep);
    };
  };

  // Read a file's data.
  const readData = () => {
    return (file, callback) => {
      const filePath = path.join(rootPath, file.path);
      read(filePath, readMode, (error, data) => {
        async.nextTick(callback, error, Object.assign({}, file, { data }));
      });
    };
  };

  return (callback) => {
    const dirPath = stack.shift();
    async.waterfall([
      cb => fs.readdir(dirPath, cb),
      (fileNames, cb) => async.map(fileNames, initFile(dirPath), cb),
      (files, cb) => async.filter(files, filterSupported(), cb),
      (files, cb) => populateStack(stack, rootPath, files, cb),
      (files, cb) => async.filter(files, filterOutput(), cb),
      (files, cb) => async.map(files, readData(), cb),
    ], (error, result) => {
      if (error) {
        async.nextTick(callback, error);
        return;
      }

      out.push(...result);
      async.nextTick(callback, null);
    });
  };
}
673995
function recursive($arg,$func,$stack=NULL) {
		if ($stack) {
			foreach ($stack as $node)
				if ($arg===$node)
					return $arg;
		}
		else
			$stack=array();
		switch (gettype($arg)) {
			case 'object':
				if (method_exists('ReflectionClass','iscloneable')) {
					$ref=new ReflectionClass($arg);
					if ($ref->iscloneable()) {
						$arg=clone($arg);
						$cast=is_a($arg,'IteratorAggregate')?
							iterator_to_array($arg):get_object_vars($arg);
						foreach ($cast as $key=>$val)
							$arg->$key=$this->recursive(
								$val,$func,array_merge($stack,array($arg)));
					}
				}
				return $arg;
			case 'array':
				$copy=array();
				foreach ($arg as $key=>$val)
					$copy[$key]=$this->recursive($val,$func,
						array_merge($stack,array($arg)));
				return $copy;
		}
		return $func($arg);
	}
112554
function pipeToPromise(pipe) {
  const d = defer();
  let str = '';

  pipe.on('data', data => str += data)
    .on('error', d.reject)
    .on('end', () => d.resolve(str));
  return d.promise;
}
649465
protected void reconfigureUpstream(ChannelPipeline pipeline, Handshake handshake) {
        pipeline.replace( "http-decoder", "websockets-decoder", handshake.newDecoder() );
        ChannelHandler[] additionalHandlers = handshake.newAdditionalHandlers();
        String currentTail = "websockets-decoder";
        for (ChannelHandler each : additionalHandlers) {
            String handlerName = "additional-" + each.getClass().getSimpleName();
            pipeline.addAfter( currentTail, handlerName, each );
            currentTail = handlerName;
        }
    }
1339483
function chain(tasks) {
      return function() {
        var pipeline = fullPipeline();

        _.each(tasks, function(task) {
          pipeline = pipeline.pipe(task.callback(options)());
        });

        return pipeline;
      };
    }
885613
def pipes_pipe(obj, arr)
      arr.inject(obj) {|acc,e| Boson.full_invoke(e, [acc]) }
    end
23997
function fsReaddirAsync(root, opts, callback) {
  if (typeof root !== 'string') {
    throw new TypeError('fsReaddir: expect `root` to be string');
  }
  if (typeof opts === 'function') {
    callback = opts;
    opts = {
      objectMode: true,
      EventEmitter: false,
      emitterOptions: {maxListeners: 1},
    };
  }

  opts = opts || {};

  var aborted = false;
  var stream = false;
  var ____cb = callback || noop;

  if (typeof callback !== 'function') {
    opts.objectMode = opts.objectMode || true;
    stream = new ReaddirReadable(opts);
  } else {
    if (opts.EventEmitter) {
      opts.EventEmitter.prototype.destroy = ReaddirReadable.prototype.destroy;
      stream = new opts.EventEmitter(opts.emitterOptions);
    }
  }

  if (!stream) {
    stream = {push: noop, emit: noop, destroy: noop};
  }

  callback = function callbackAndEvents(err, res) {
    ____cb(err, res);
    if (err && err instanceof Error) {
      stream.emit('error', err);
      stream.destroy();
      return;
    }
    stream.push(res);
    stream.emit('finish', res);
    stream.destroy();
  }

  var res = [];
  fs.readdir(root, function(err, files) {
    if (aborted) {return;}
    if (err) {
      return callback(err);
    }

    var pending = files.length;
    if (!pending) {
      return callback(null, res);
    }

    files.forEach(function(fp) {
      if (aborted) {return;}
      fp = path.join(root, fp)

      fs.stat(fp, function(err, stats) {
        if (aborted) {return;}
        if (err) {
          return callback(err);
        }

        if (aborted === false && stats.isDirectory()) {
          stream.emit('folder', fp);
          stream.emit('directory', fp);

          return fsReaddirAsync(fp, function(err, fps) {
            if (aborted) {return;}
            if (err) {
              return callback(err);
            }

            res = res.concat(fps);
            pending -= 1;
            if (!pending) {
              return callback(null, res);
            }
          });
        }
        if (aborted === false && stats.isFile()) {
          stream.emit('file', fp);
          res.push(fp);
          pending -= 1;
          if (!pending) {
            return callback(null, res);
          }
        }
      });
    });
  });

  return stream;
}
568741
function defineProxy(object, stack) {
    if (! stack) stack = [];

    /* Non-null, non-array objects will be defined recursively */
    if (object &&
        ((typeof(object) === 'object') || (typeof(object) === 'function')) &&
        (!Array.isArray(object))) {

      /* Just triple check */
      if (stack.indexOf(object) >= 0) {
        throw new TypeError("Unable to proxy object: circular reference detected");
      }

      /* Definition, and functions are invokable */
      var definition = {};
      if (typeof(object) === 'function') definition["!$invocable$!"] = true;

      /* Recursively define this object */
      stack.push(object);
      for (var i in object) {
        definition[i] = defineProxy(object[i], stack);
      }
      stack.pop();
      return definition;

    }

    /* Everything else is just a getter */
    return { "!$value$!": object };
  }
20397
def pipe(self, target):
        
        return self._replace(recver=self.recver.pipe(target))
918752
function recomputeCallback(){
  var len = TO_CALL.length;
  CALL_TIMEOUT = null;
  while(len--){
    (TO_CALL.shift() || NOOP).call();
  }

  TO_CALL.added = {};
}
1085074
function plumb() {
  var fns = slice.call(arguments)
  return function (val) {
    return pipe.apply(this, [val].concat(fns))
  }
}
476695
public static <E> void pipe(Iterable<E> iterable, OutputIterator<E> outputIterator) {
        dbc.precondition(iterable != null, "cannot call pipe with a null iterable");
        new ConsumeIntoOutputIterator<>(outputIterator).apply(iterable.iterator());
    }
1360936
def ignore_broken_pipe():
    
    for f in sys.stdin, sys.stdout, sys.stderr:
        try:
            f.close()
        except BrokenPipeError:
            pass
1049613
function _pipe(method, args, done) {

  let proc;
  let isProc =
    typeof method === 'object' &&
    (method.constructor && method.constructor.name === 'ChildProcess');

  done = done || function () {};

  if (typeof args === 'function') {
    done = args;
    args = undefined;
  }

  // Ensure args array.
  args = args || [];

  // Allow passing args as a string.
  // supports either ' ' or ', '.
  if (typeof args === 'string') {
    let splitChar = ~args.indexOf(',') ? ',' : ' ';
    if (splitChar === ',')
      args = args.replace(/\s/g, '');
    args = args.split(splitChar);
  }

  // If string assume command set method to spawn.
  if (typeof method === 'string') {
    args = [method, args];
    method = spawn;
  }

  if (isProc)
    proc = method;

  if (!proc)
    proc = method(...args);

  const thru = thruHandler(done);

  proc.stdin = proc.stdin || process.stdin;
  proc.stdout = proc.stdout || process.stdout;
  proc.stderr = proc.stderr || process.stderr;

  proc.stdout.pipe(thru);

  return proc;

}
1179234
private function createPipelineCallback() : Closure
    {
        return function ($stack, $pipe) {
            return function ($request) use ($stack, $pipe) {
                if ($pipe instanceof Closure) {
                    return call_user_func($pipe, $request, $stack);
                } elseif (!is_object($pipe)) {
                    list($callback, $parameters) = $this->createParameters($pipe, $request, $stack, true);
                } else {
                    if (!method_exists($pipe, $this->method)) {
                        throw new PipelineException(sprintf("%s::%s doesn't exist", get_class($pipe), $this->method));
                    }

                    list($callback, $parameters) = $this->createParameters($pipe, $request, $stack);
                }

                return $this->call($callback, $parameters);
            };
        };
    }