This function is invoked by the shell to query for the completion
status and predictions for an argument with this parameter type.
358864
function(arg, typeSpec) {
				var result = new Deferred();
				var predictions = this._getPredictions(arg.text, typeSpec);
				result.resolve(this._createCompletion(arg.text, predictions));
				return result;
			}
509706
def gen_cmd_and_param_completions(self):
        
        if self.complete_command:
            for param in self.command_param_info.get(self.current_command, []):
                if self.validate_param_completion(param, self.leftover_args):
                    yield self.yield_param_completion(param, self.unfinished_word)
        elif not self.leftover_args:
            for child_command in self.subtree.children:
                if self.validate_completion(child_command):
                    yield Completion(child_command, -len(self.unfinished_word))
128079
def call_task_fn(self):
		""""""
		if not self.fn:
			return self.log_finished()

		future = asyncio.Future()
		future.add_done_callback(lambda x: self.log_finished())

		if inspect.iscoroutinefunction(self.fn):
			f = asyncio.ensure_future(self.fn())
			f.add_done_callback(lambda x: self.bind_end(x.result(), future))
		else:
			self.bind_end(self.fn(), future)

		return future
1350390
public ListenableFuture<ResultT> getAsyncResult() {
    Preconditions.checkState(operationTimerContext == null);
    operationTimerContext = rpc.getRpcMetrics().timeOperation();
    run();
    return completionFuture;
  }
462087
void update(JobStatus status) {
    this.status = status;
    try {
      this.counters = running.getCounters();
      this.completed = running.isComplete();
      this.successful = running.isSuccessful();
      this.mapProgress = running.mapProgress();
      this.reduceProgress = running.reduceProgress();
      // running.getTaskCompletionEvents(fromEvent);

    } catch (IOException ioe) {
      ioe.printStackTrace();
    }

    this.completedMaps = (int) (this.totalMaps * this.mapProgress);
    this.completedReduces = (int) (this.totalReduces * this.reduceProgress);
  }
783321
def possible_completions(self, e): # (M-?)
         """
        completions = self._get_completions()
        self._display_completions(completions)
        self.finalize()
377329
public void afterCompletion(int status)
    {
        if(afterCompletionCall) return;

        log.info("Method afterCompletion was called");
        try
        {
            switch(status)
            {
                case Status.STATUS_COMMITTED:
                    if(log.isDebugEnabled())
                    {
                        log.debug("Method afterCompletion: Do commit internal odmg-tx, status of JTA-tx is " + TxUtil.getStatusString(status));
                    }
                    commit();
                    break;
                default:
                    log.error("Method afterCompletion: Do abort call on internal odmg-tx, status of JTA-tx is " + TxUtil.getStatusString(status));
                    abort();
            }
        }
        finally
        {
            afterCompletionCall = true;
            log.info("Method afterCompletion finished");
        }
    }
34862
def notify_complete(self, result_code, error_info):
        
        if not isinstance(result_code, baseinteger):
            raise TypeError("result_code can only be an instance of type baseinteger")
        if not isinstance(error_info, IVirtualBoxErrorInfo):
            raise TypeError("error_info can only be an instance of type IVirtualBoxErrorInfo")
        self._call("notifyComplete",
                     in_p=[result_code, error_info])
309900
def on_complete(env)
      if env[:body].error?
        @logger.warn env[:raw_body] if VkontakteApi.log_errors?
      else
        @logger.debug env[:raw_body] if VkontakteApi.log_responses?
      end
    end
1125678
def handle_completion_info_list(self, call_id, payload):
        """"""
        self.log.debug('handle_completion_info_list: in')
        # filter out completions without `typeInfo` field to avoid server bug. See #324
        completions = [c for c in payload["completions"] if "typeInfo" in c]
        self.suggestions = [completion_to_suggest(c) for c in completions]
        self.log.debug('handle_completion_info_list: %s', Pretty(self.suggestions))
609402
private void checkForCompletion() {
        final String methodName = "checkForCompletion(): ";
        // mark the list complete if that was the last awaited key
        if (actualIndices.isEmpty()) {
            if (tc.isDebugEnabled())
                Tr.debug(tc, methodName + "setting state=COMPLETE");
            state = failedKeys == null
                            ? COMPLETE
                            : COMPLETE_WITH_FAILURES; // state change must be last action
        }
    }
47303
def execute(self, argv=None):
        
        if self.completion:
            self.autocomplete()
        parser = self.get_parser()
        namespace = parser.parse_args(argv)
        if hasattr(namespace, 'func'):
            self.run_command(namespace)
1318823
def in_function_call(self):
        """"""
        #See if we are calling a function inside a module or other function.
        result = []
        if (self.context.el_section == "body" and
            self.context.el_call in [ "sub", "fun" ]):
            #Do a signature completion for the function/subroutine call.
            result = self.signature()

        if result == []:
            return self.complete()

        return result
1253970
def is_finished(self):
        
        self.get_info()

        if 'status' not in self.info:
            return False
        if 'isFinished' not in self.info['status']:
            return False

        return self.info['status']['isFinished']
1282491
function invokeStatementComplete(statement, context)
{
  // find out if the result will be streamed;
  // if a value is not specified, get it from the connection
  var streamResult = context.streamResult;
  if (!Util.exists(streamResult))
  {
    streamResult = context.connectionConfig.getStreamResult();
  }

  // if the result will be streamed later,
  // invoke the complete callback right away
  if (streamResult)
  {
    context.complete(Errors.externalize(context.resultError), statement);
  }
  else
  {
    process.nextTick(function()
    {
      // aggregate all the rows into an array and pass this
      // array to the complete callback as the last argument
      var rows = [];
      statement.streamRows()
          .on('data', function(row)
          {
            rows.push(row);
          })
          .on('end', function()
          {
            context.complete(null, statement, rows);
          })
          .on('error', function(err)
          {
            context.complete(Errors.externalize(err), statement);
          });
    });
  }
}
324763
def estimate_completion(self):
        
        if self.completion_ts:
            # Task is already complete. Return the exact completion time:
            defer.returnValue(self.completed)
        # Get the timestamps from the descendent task that's doing the work:
        if self.method == 'build' or self.method == 'image':
            subtask_completion = yield self.estimate_descendents()
            defer.returnValue(subtask_completion)
        if self.state == task_states.FREE:
            est_completion = yield self._estimate_free()
            defer.returnValue(est_completion)
        avg_delta = yield self.estimate_duration()
        if avg_delta is None:
            defer.returnValue(None)
        est_completion = self.started + avg_delta
        defer.returnValue(est_completion)
255282
def check_complete(self):
        
        logger.debug('Running check_complete for task {0}'.format(self.name))

        # Tasks not completed
        if self.remote_not_complete() or self.local_not_complete():
            self._start_check_timer()
            return

        return_code = self.completed_task()

        # Handle task errors
        if self.terminate_sent:
            self.stderr += '\nDAGOBAH SENT SIGTERM TO THIS PROCESS\n'
        if self.kill_sent:
            self.stderr += '\nDAGOBAH SENT SIGKILL TO THIS PROCESS\n'
        if self.remote_failure:
            return_code = -1
            self.stderr += '\nAn error occurred with the remote machine.\n'

        self.stdout_file = None
        self.stderr_file = None

        self._task_complete(success=True if return_code == 0 else False,
                            return_code=return_code,
                            stdout=self.stdout,
                            stderr=self.stderr,
                            start_time=self.started_at,
                            complete_time=datetime.utcnow())