Add function to the end to emit "done" event
321278
function emitDone(rawArgs) {
		if(EventEmitter.listenerCount(emitter, "done") > 0) {
			var args = new Array(rawArgs.length + 1);
			args[0] = "done";
			for(var i = 0; i < rawArgs.length; i++)
				args[i + 1] = rawArgs[i];
			process.nextTick(function() {
				emitter.emit.apply(emitter, args);
			});
		}
	}
1207553
function wrapComplete(instance, options) {
	var complete = options.complete;

	options.complete = function(response) {
		if ( _.isFunction( complete ) ) {
			complete.call( this, instance, response, options );
		}
	};
}
1085661
function finish(ch) {
  ch[STATE] = STATES.ENDED
  let waiting = null
  while (
    (waiting = ch.waiting.shift()) // eslint-disable-line no-cond-assign
  ) {
    waiting()
  }
}
529106
function completed() {
	document.removeEventListener( "DOMContentLoaded", completed, false );
	window.removeEventListener( "load", completed, false );
	jQuery.ready();
}
49711
function (ui, done) {

        var bs = ui.bs;

        ui.clients.on("connection", function (client) {

            client.emit("ui:connection", ui.options.toJS());

            ui.options.get("clientFiles").map(function (item) {
                if (item.get("active")) {
                    ui.addElement(client, item.toJS());
                }
            });
        });

        ui.socket.on("connection", function (client) {

            client.emit("connection", bs.getOptions().toJS());

            client.emit("ui:connection", ui.options.toJS());

            client.on("ui:get:options", function () {
                client.emit("ui:receive:options", {
                    bs: bs.getOptions().toJS(),
                    ui: ui.options.toJS()
                });
            });

            // proxy client events
            client.on("ui:client:proxy", function (evt) {
                ui.clients.emit(evt.event, evt.data);
            });

            client.on("ui", function (data) {
                ui.delegateEvent(data);
            });
        });
        done();
    }
1064156
function onFinished (msg, listener) {
  if (isFinished(msg) !== false) {
    defer(listener, null, msg)
    return msg
  }

  // attach the listener to the message
  attachListener(msg, listener)

  return msg
}
949868
def function_end_action(self, text, loc, fun):
        """"""
        if DEBUG > 0:
            print("FUN_END:",fun)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        #set function's attribute to number of function parameters
        self.symtab.set_attribute(self.shared.function_index, self.shared.function_params)
        #clear local function symbols (but leave function name)
        self.symtab.clear_symbols(self.shared.function_index + 1)
        self.codegen.function_end()
1255923
function(done) {
    this.async = true;
    var self = this;

    function finish(err, file) {
      var hasCallback = (typeof done === 'function');
      if (err && !hasCallback) return self.emit('error', err);
      if (err) return done(err);
      done(null, file);
    }

    if (this.data) {
      this.createFile(this.file, this.uri, this.file, this.data, finish).parse(finish);
    } else {
      this.resolve(this.file, this.cwd, function(err, file) {
        if (err) return finish(err);
        file.parse(finish);
      });
    }

    return this;
  }
133761
function(event) {
            var args = Array.prototype.slice.call(arguments);
            (this.emitter || (this.emitter = new emitter())).emit.apply(this, args);
        }
1269813
function finisher(error, output, callback)
{
  // signal end of the stream
  // only for successfully finished streams
  if (!error)
  {
    this.push(null);
  }

  // back to original track
  callback(error, output);
}
599337
function listener (event, done) {
  return function onevent (arg1) {
    var args = new Array(arguments.length)
    var ee = this
    var err = event === 'error'
      ? arg1
      : null

    // copy args to prevent arguments escaping scope
    for (var i = 0; i < args.length; i++) {
      args[i] = arguments[i]
    }

    done(err, ee, event, args)
  }
}
194135
def _trigger(self):
        
        self._completed.set()
        for callback in self._callbacks:
            callback(self)
793425
function one() {
  var self = this

  self.actual++

  if (self.actual >= self.expected) {
    self.emit('done')
  }
}
1211515
function done( error ) {
		if ( error ) {
			return clbk( error );
		}
		count += 1;
		if ( count === len ) {
			clbk( null, concat( out ) );
		}
	}
316181
def done(message):
    """"""

    def done(value, _context, **_params):
        return Done(value, message)

    return done
601208
function finish(e) {
      if (e && e.target !== node) {
        return;
      }

      clearTimeout(timer);
      if (removeListeners) removeListeners();

      (0, _removeClass2.default)(node, className);
      (0, _removeClass2.default)(node, activeClassName);

      if (removeListeners) removeListeners();

      // Usually this optional callback is used for informing an owner of
      // a leave animation and telling it to remove the child.
      if (finishCallback) {
        finishCallback();
      }
    }
374841
function onStreamEnd(done) {
    Promise
      .all(lintPromiseList)
      .then(passLintResultsThroughReporters)
      .then(lintResults => {
        process.nextTick(() => {
          const errorCount = lintResults.reduce((sum, res) => {
            const errors = res.results[0].warnings.filter(isErrorSeverity);
            return sum + errors.length;
          }, 0);
          if (pluginOptions.failAfterError && errorCount > 0) {
            const errorMessage = `Failed with ${errorCount} ${errorCount === 1 ? 'error' : 'errors'}`;
            this.emit('error', new PluginError(pluginName, errorMessage));
          }
          done();
        });
      })
      .catch(error => {
        process.nextTick(() => {
          this.emit('error', new PluginError(pluginName, error, {
            showStack: Boolean(pluginOptions.debug)
          }));
          done();
        });
      });
  }