this method auto-completes values of fields that have a :complete_value marker
975040
def complete_value
      if last_token_is(COMPARISON_OPERATORS)
        token = tokens[tokens.size - 2]
        val = ''
      else
        token = tokens[tokens.size - 3]
        val = tokens[tokens.size - 1]
      end

      field = definition.field_by_name(token)
      return [] unless field && field.complete_value

      return complete_set(field) if field.set?
      return complete_date_value if field.temporal?
      return complete_key_value(field, token, val) if field.key_field

      special_values = field.special_values.select { |v| v =~ /\A#{val}/ }
      special_values + complete_value_from_db(field, special_values, val)
    end
61794
function _selectItem(autocomplete) {
    var item = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    if (item === false && !this.isCustomValueAllowed(autocomplete)) {
      // custom input not allowed, restore to value before input was focused
      this.restoreState(autocomplete);
    } else {
      this._updateInputValues(autocomplete, item);
    }

    this.close(autocomplete);
  }
885297
public function autocomplete()
    {
        $this->loadComponent('RequestHandler');
        $this->viewClass = 'Json';
        $data = [];
        $paramName = $this->request->query('parameter');
        $query = $this->request->query('query');
        $parameter = $this->Filter->parameters()->get($paramName);
        if (!empty($parameter)) {
            $method = $parameter->config('autocompleteAction');
            $data = $method($query);
            $this->set('status', 'success');
        } else {
            $this->set('status', 'error');
            $this->set('message', __('Field not found'));
        }
        $this->set('data', $data);
        $this->set('_serialize', ['data', 'status', 'message']);
    }
1252691
@Override
    public void onComplete() {


        counter.active.decrementAndGet();
        counter.subscription.removeValue(subscription);
        if (queue != null && counter.active.get() == 0) {

            if (counter.completable) {

                if(counter.closing.compareAndSet(false,true)) {
                    counter.closed = true;
                    queue.addContinuation(new Continuation(
                            () -> {
                                final List current = new ArrayList();
                                while (queue.size() > 0) {
                                    try {

                                        current.add(queue.get());
                                    }catch(ClosedQueueException e){

                                        break;
                                    }
                                }

                                throw new ClosedQueueException(
                                        current);
                            }));

                    queue.close();
                }
            }

        }

    }
874595
def process_form(self, instance, field, form, empty_marker=None,
                     emptyReturnsMarker=False):
        

        name = field.getName()
        otherName = "%s_other" % name
        value = form.get(otherName, empty_marker)
        regex = field.widget.field_regex

        # validate the custom value against the given regex
        if value and not re.match(regex, value):
            value = None
        # If value is an empty string we check if the selection box
        # has a usable value.
        if value is empty_marker or not value:
            value = form.get(name, empty_marker)
        if value is empty_marker:
            return empty_marker
        if not value and emptyReturnsMarker:
            return empty_marker
        return value, {}
459951
protected function clearValues()
    {
        $this->values = [];
        foreach ($this->fields as $name => $syntax) {
            $this->values[$name] = (object) [
                'value'   => null,
                'error'   => static::MISSING_FIELD
            ];
        }
    }
118759
public void clearSavedFields() {
    append = null;
    tokenToName = new LinkedHashMap<String, Navigation>();
    nameToToken = new LinkedHashMap<String, Navigation>();
    remainingMappings = new ArrayList<Navigation>();
  }
202310
def submit_studio_edits(self, data, suffix=''):
        
        values = {}  # dict of new field values we are updating
        to_reset = []  # list of field names to delete from this XBlock
        for field_name in self.editable_fields:
            field = self.fields[field_name]
            if field_name in data['values']:
                if isinstance(field, JSONField):
                    values[field_name] = field.from_json(data['values'][field_name])
                else:
                    raise JsonHandlerError(400, "Unsupported field type: {}".format(field_name))
            elif field_name in data['defaults'] and field.is_set_on(self):
                to_reset.append(field_name)
        self.clean_studio_edits(values)
        validation = Validation(self.scope_ids.usage_id)
        # We cannot set the fields on self yet, because even if validation fails, studio is going to save any changes we
        # make. So we create a "fake" object that has all the field values we are about to set.
        preview_data = FutureFields(
            new_fields_dict=values,
            newly_removed_fields=to_reset,
            fallback_obj=self
        )
        self.validate_field_data(validation, preview_data)
        if validation:
            for field_name, value in six.iteritems(values):
                setattr(self, field_name, value)
            for field_name in to_reset:
                self.fields[field_name].delete_from(self)
            return {'result': 'success'}
        else:
            raise JsonHandlerError(400, validation.to_json())
1148440
function(fields, oldValue) {
            fields = this.__resolveFields(fields);

            var prop, key, i, ii;

            this.__checkEmitEvent(true);

            if (_.isSimpleObject(oldValue)) {
                for (key in oldValue) {
                    this.__emitPropertyRemove(fields.concat(key), oldValue[key]);
                }
            }
            else if (_.isArray(oldValue)) {
                for (i = 0, ii = oldValue.length; i < ii; ++i) {
                    this.__emitPropertyRemove(fields.concat(i), oldValue[i]);
                }
            }

            prop = fields.join('.');

            this.__emitEvent('property.' + prop + '.clear', oldValue);
            this.__emitEvent('property.clear', prop, oldValue);

            return this;
        }
757030
public static function processAutocomplete(&$element, FormStateInterface $form_state, &$complete_form) {
    $element = parent::processAutocomplete($element, $form_state, $complete_form);
    $element['#attached']['library'][] = 'webform_strawberryfield/webform_strawberryfield.metadataauth.autocomplete';
    $element['#attached']['drupalSettings'] = [
        'webform_strawberryfield_autocomplete' => [],
      ];

    $element['#attributes']['data-strawberry-autocomplete'] = 'wikidata';
    return $element;
  }
103938
def on_complete(&block)
      on do |_, value, reason|
        block.call(reason == nil, value, reason)
      end
    end
296773
public function autocomplete($name = null, $value = null) 
	{
		Argument::i()
			->test(1, 'string', 'null')
			->test(2, 'scalar', 'null');
			
		$field = Autocomplete::i();
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		if(!is_null($value)) {
			$field->setValue($value);
		}
		
		return $field;
	}
1246609
public void clearValues(String fieldName) {
        Utils.require(!Utils.isEmpty(fieldName), "fieldName");
        m_valueMap.remove(fieldName);
        m_valueRemoveMap.remove(fieldName);
    }
405669
final void postComplete() {
        /*
         * On each step, variable f holds current dependents to pop
         * and run.  It is extended along only one path at a time,
         * pushing others to avoid unbounded recursion.
         */
        CompletableFuture<?> f = this; Completion h;
        while ((h = f.stack) != null ||
               (f != this && (h = (f = this).stack) != null)) {
            CompletableFuture<?> d; Completion t;
            if (f.casStack(h, t = h.next)) {
                if (t != null) {
                    if (f != this) {
                        pushStack(h);
                        continue;
                    }
                    h.next = null;    // detach
                }
                f = (d = h.tryFire(NESTED)) == null ? this : d;
            }
        }
    }
276509
def _mark_context_complete(marker, context, has_errors):
    """"""

    current = None

    if marker:
        current = marker.key.get()

    if not current:
        return False

    if current and current.complete:
        return False

    current.complete = True
    current.has_errors = has_errors
    current.put()

    # Kick off completion tasks.
    _insert_post_complete_tasks(context)

    return True
1239006
protected void setAutocomplete(final String autocompleteValue) {
		final String newValue = Util.empty(autocompleteValue) ? null : autocompleteValue;
		if (!Util.equals(newValue, getAutocomplete())) {
			getOrCreateComponentModel().autocomplete = newValue;
		}
	}
565007
public function autocomplete() {
        $tree = Globals::getTree();
        $controller = new JsonController();
        
        $city = Filter::get('city');
        $contains = Filter::get('term');        

        $controller
            ->restrictAccess(Auth::isEditor($tree) && !empty($city) && !empty($contains))
            ->pageHeader();
        
        $listCert = $this->provider->getCertificatesListBeginWith($city, $contains); 
        $controller->encode($listCert);
    }