Starts a new completion popup for the current object.
        
        :return     <bool> success
484245
def startCompletion(self, force=False):
        
        # add the top level items
        tree = self.completerTree()
        if not force and tree.isVisible():
            return
        
        tree.clear()
        
        # make sure we have a valid object
        obj, remain = self.objectAtCursor()
        
        if obj is None:
            tree.hide()
            return
        
        # determine the cursor position
        rect   = self.cursorRect()
        cursor = self.textCursor()
        point  = QPoint(rect.left(), rect.top() + 18)
        
        # compare the ids since some things might overload the __eq__
        # comparator
        if id(obj) == id(self._scope):
            o_keys = obj.keys()
        elif obj is not None:
            o_keys = dir(obj)
        
        keys = [key for key in sorted(o_keys) if not key.startswith('_')]
        if id(obj) == id(self._scope):
            if not remain:
                return False
            else:
                keys = filter(lambda x: x.startswith(remain[0]), keys)
        
        if not keys:
            return False
        
        for key in keys:
            tree.addTopLevelItem(QTreeWidgetItem([key]))
        
        tree.move(self.mapToGlobal(point))
        tree.show()
        return True
1324773
def _on_completions_refreshed(self, new_completer):
        
        with self._completer_lock:
            self.completer = new_completer
            # When cli is first launched we call refresh_completions before
            # instantiating the cli object. So it is necessary to check if cli
            # exists before trying the replace the completer object in cli.
            if self.cli:
                self.cli.current_buffer.completer = new_completer

        if self.cli:
            # After refreshing, redraw the CLI to clear the statusbar
            # "Refreshing completions..." indicator
            self.cli.request_redraw()
584480
private <R, U> CompletionStage<U> doApplyToEitherAsync(
            CompletionStage<? extends R> first,
            CompletionStage<? extends R> second,
            Function<? super R, U> fn,
            Executor executor) {
    	CompletableCompletionStage<R> nextStage = newCompletableCompletionStage();

        // only the first result is accepted by completion stage,
        // the other one is ignored
        BiConsumer<R, Throwable> action = completeHandler(nextStage);
        first.whenComplete(action);
        second.whenComplete(action);

        return nextStage.thenApplyAsync(fn, executor);
    }
194539
function() {
        if (!(this instanceof clazz)) {
          throw new Error("Use new keyword to create a new instance or call/apply class with right scope");
        }
        Class.onBeforeInstantiation && Class.onBeforeInstantiation(this);
        
        // remember the current super property
        var temp = this.__super__;
        // set the right super class prototype
        this.__super__ = superClass;

        // call the right constructor
        if (constructor) {
          constructor.apply(this, arguments);
        } else if (superClass) {
          superClass.apply(this, arguments);
        }
        // reset the current super property
        this.__super__ = temp;
        Class.onAfterInstantiation && Class.onAfterInstantiation(this);
      }
385011
@NotNull
	@Override
	public final MaterializedPromise<Void> startProcess() {
		if (!processStarted) {
			processStarted = true;
			beforeProcess();
			doProcess();
		}
		return processCompletion;
	}
704630
def chore
      if complete?
        stat :found_completed, :item_id => object_id
        return
      end
      stat :will_execute, :item_id => object_id
      begin
        @result = @block.call(*@args)
      rescue Exception => e
        @error = e
      end
      stat :did_execute, :item_id => object_id
      discard
    end
691479
function completionHandler(currentInput, currentArgv) {
    commandExecuted = true
    const {scripts} = getPSConfig(currentArgv) || {}
    if (scripts) {
      return getCompletionScripts(scripts, currentInput)
    }
    return []
  }
1360064
public static void newFutureCollectionCompletionListener(Collection<ApplicationDependency> futureConditions, CompletionListener<Boolean> newCL) {
        if (futureConditions.isEmpty()) {
            newCL.successfulCompletion(null, true);
        } else {
            FutureCollectionCompletionListener futureListener = new FutureCollectionCompletionListener(futureConditions.size(), newCL);
            futureListener.onCompletion(futureConditions);
        }
    }
1016455
def scorable_block_completion(sender, **kwargs):  # pylint: disable=unused-argument
    
    if not waffle.waffle().is_enabled(waffle.ENABLE_COMPLETION_TRACKING):
        return
    course_key = CourseKey.from_string(kwargs['course_id'])
    block_key = UsageKey.from_string(kwargs['usage_id'])
    block_cls = XBlock.load_class(block_key.block_type)
    if XBlockCompletionMode.get_mode(block_cls) != XBlockCompletionMode.COMPLETABLE:
        return
    if getattr(block_cls, 'has_custom_completion', False):
        return
    user = User.objects.get(id=kwargs['user_id'])
    if kwargs.get('score_deleted'):
        completion = 0.0
    else:
        completion = 1.0
    if not kwargs.get('grader_response'):
        BlockCompletion.objects.submit_completion(
            user=user,
            course_key=course_key,
            block_key=block_key,
            completion=completion,
        )
113292
def perform_completion(editor):
    

    completion_prefix = editor.get_partial_word_under_cursor()
    if not completion_prefix:
        return

    words = editor.get_words()
    completion_prefix in words and words.remove(completion_prefix)
    editor.completer.update_model(words)
    editor.completer.setCompletionPrefix(completion_prefix)
    if editor.completer.completionCount() == 1:
        completion = editor.completer.completionModel().data(
            editor.completer.completionModel().index(0, 0)).toString()
        cursor = editor.textCursor()
        cursor.insertText(completion[len(completion_prefix):])
        editor.setTextCursor(cursor)
    else:
        popup = editor.completer.popup()
        popup.setCurrentIndex(editor.completer.completionModel().index(0, 0))

        completer_rectangle = editor.cursorRect()
        hasattr(editor, "margin_area_LinesNumbers_widget") and completer_rectangle.moveTo(
            completer_rectangle.topLeft().x() + editor.margin_area_LinesNumbers_widget.get_width(),
            completer_rectangle.topLeft().y())
        completer_rectangle.setWidth(editor.completer.popup().sizeHintForColumn(0) +
                                     editor.completer.popup().verticalScrollBar().sizeHint().width())
        editor.completer.complete(completer_rectangle)
    return True
997441
def _getOrCreate(cls):
        
        if not isinstance(cls._taskContext, BarrierTaskContext):
            cls._taskContext = object.__new__(cls)
        return cls._taskContext
221878
def start(self):
        
        # While the implemetation matches the description in the docstring
        # conceptually, it always adds a new waiter and then calls
        # _check_concurrent() to handle the various cases.
        if self._limit < 0:
            # Special case for no limit, never block.
            return succeed(None)
        elif self._limit == 0:
            # Special case for limit of zero, always block forever.
            return Deferred()
        d = self._make_waiter()
        self._check_concurrent()
        return d
1230322
def _finish_progress(self):
        

        if self._show_progressbar:
            if self._progressbar is None:
                self._initialize_progressbar()
            if self._progressbar is not None:
                self._progressbar.finish()

        if self._progress_callback is not None:
            self._progress_callback(100.0)
1151237
def eventFilter( self, object, event ):
        
        if ( event.type() == event.KeyPress ):
            if ( event.key() == Qt.Key_Escape ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
                
            elif ( event.key() in (Qt.Key_Return, Qt.Key_Enter) ):
                self.acceptEdit()
                return True
                
            elif ( event.key() == Qt.Key_Tab ):
                if ( self.completer().popup().isVisible() ):
                    text   = nativestring(self.completer().currentCompletion())
                    super(XNavigationEdit, self).setText(text)
                    return True
                else:
                    self.acceptEdit()
                    return False
            
        elif ( event.type() == event.MouseButtonPress ):
            if ( not self._completerTree.rect().contains(event.pos()) ):
                self._completerTree.hide()
                self.completer().popup().hide()
                
                self.cancelEdit()
        
        return False
747042
def context_completion_checker(async):
    """"""

    store_async_marker(async.id, async.result.status if async.result else -1)

    logging.debug("Async check completion for: %s", async.context_id)
    current_queue = _get_current_queue()
    from furious.async import Async
    logging.debug("Completion Check queue:%s", current_queue)
    Async(_completion_checker, queue=current_queue,
          args=(async.id, async.context_id)).start()

    return True
1336940
def _task_complete(self, **kwargs):
        
        logger.debug('Running _task_complete for task {0}'.format(self.name))
        with self.parent_job.completion_lock:
            self.completed_at = datetime.utcnow()
            self.successful = kwargs.get('success', None)
            self.parent_job._complete_task(self.name, **kwargs)
948942
def init_completer(self):
        
        # PyDev uses its own completer and custom hooks so that it uses
        # most completions from PyDev's core completer which provides
        # extra information.
        # See getCompletions for where the two sets of results are merged

        if IPythonRelease._version_major >= 6:
            self.Completer = self._new_completer_600()
        elif IPythonRelease._version_major >= 5:
            self.Completer = self._new_completer_500()
        elif IPythonRelease._version_major >= 2:
            self.Completer = self._new_completer_234()
        elif IPythonRelease._version_major >= 1:
            self.Completer = self._new_completer_100()

        if hasattr(self.Completer, 'use_jedi'):
            self.Completer.use_jedi = False

        self.add_completer_hooks()

        if IPythonRelease._version_major <= 3:
            # Only configure readline if we truly are using readline.  IPython can
            # do tab-completion over the network, in GUIs, etc, where readline
            # itself may be absent
            if self.has_readline:
                self.set_readline_completer()