Accepts the invite.

@return \React\Promise\Promise
3258
public function accept()
    {
        $deferred = new Deferred();

        if ($this->revoked) {
            $deferred->reject(new \Exception('This invite has been revoked.'));

            return $deferred->promise();
        }

        if ($this->uses >= $this->max_uses) {
            $deferred->reject(new \Exception('This invite has been used the max times.'));

            return $deferred->promise();
        }

        $this->http->post("invite/{$this->code}")->then(
            \React\Partial\bind_right($this->resolve, $deferred),
            \React\Partial\bind_right($this->reject, $deferred)
        );

        return $deferred->promise();
    }
647882
public function put()
    {
        $js = $this->constructJavaScript($this->normalizeInput(func_get_args()));

        $this->viewBinder->bind($js);

        return $js;
    }
1273897
function commit(): \React\Promise\PromiseInterface {
        return $this->query('COMMIT')->then(function () {
            $this->driver->endTransaction();
            $this->client->checkinConnection($this->driver);
            $this->driver = null;
        });
    }
1192574
public function accept()
    {
        $asset = $this->getInnerIterator()->current(true);
        $duplicate = false;

        // check strict equality
        if (in_array($asset, $this->visited, true)) {
            $duplicate = true;
        } else {
            $this->visited[] = $asset;
        }

        // check source
        $sourceRoot = $asset->getSourceRoot();
        $sourcePath = $asset->getSourcePath();
        if ($sourceRoot && $sourcePath) {
            $source = $sourceRoot.'/'.$sourcePath;
            if (in_array($source, $this->sources)) {
                $duplicate = true;
            } else {
                $this->sources[] = $source;
            }
        }

        return !$duplicate;
    }
905757
function accept(&$renderer)
    {
        $renderer->startForm($this);
        foreach (array_keys($this->_elements) as $key) {
            $element =& $this->_elements[$key];
            $elementName = $element->getName();
            $required    = ($this->isElementRequired($elementName) && !$element->isFrozen());
            $error       = $this->getElementError($elementName);
            $element->accept($renderer, $required, $error);
        }
        $renderer->finishForm($this);
    }
1011877
public function accept()
    {
        /**
         * @var     \SplFileInfo        $file
         */
        $file = $this->current();
        if ($file->getType()==$this->getType()) {
            return true;
        }
        return false;
    }
407816
public function listen(): Promise
    {
        return call(function () {
            while (null !== ($chunk = yield $this->stream->read())) {
                foreach ($this->onNewFrameCallables as $newFrameCallable) {
                    $newFrameCallable($this->transformChunk($chunk));
                }
            }
        });
    }
125664
public function shouldMakeApiResponse()
    {
        $accept   = request()->header('Accept');
        $accepted = implode('.', [env('API_STANDARDS_TREE'), env('API_SUBTYPE')]);
        return request()->wantsJson() && extension_active('api') && str_contains($accept, $accepted) && class_exists('\Antares\Modules\Api\Http\Router\Adapter');
    }
873781
def accept_invitation(self, invitation):
        
        assert isinstance(invitation, github.Invitation.Invitation) or isinstance(invitation, int)

        if isinstance(invitation, github.Invitation.Invitation):
            invitation = invitation.id

        headers, data = self._requester.requestJsonAndCheck(
            "PATCH",
            "/user/repository_invitations/" + str(invitation),
            input={}
        )
85129
def accept(self, request, uuid=None):
        
        invitation = self.get_object()

        if invitation.state != models.Invitation.State.PENDING:
            raise ValidationError(_('Only pending invitation can be accepted.'))
        elif invitation.civil_number and invitation.civil_number != request.user.civil_number:
            raise ValidationError(_('User has an invalid civil number.'))

        if invitation.project:
            if invitation.project.has_user(request.user):
                raise ValidationError(_('User already has role within this project.'))
        elif invitation.customer.has_user(request.user):
            raise ValidationError(_('User already has role within this customer.'))

        if settings.WALDUR_CORE['VALIDATE_INVITATION_EMAIL'] and invitation.email != request.user.email:
            raise ValidationError(_('Invitation and user emails mismatch.'))

        replace_email = bool(request.data.get('replace_email'))
        invitation.accept(request.user, replace_email=replace_email)
        return Response({'detail': _('Invitation has been successfully accepted.')},
                        status=status.HTTP_200_OK)
209327
public function put()
    {
        $args = func_get_args();

        return $this->mapRoute($args)->via(\Yee\Http\Request::METHOD_PUT);
    }
970393
public function accept()
    {
        $path = ($this->mode & self::FILTER_VALUE) ? $this->current() : parent::key();

        if (0 !== strpos($path, $this->staticPrefix)) {
            return false;
        }

        $result = (bool) preg_match($this->regExp, $path);

        return $result;
    }
527945
public function promise(): Promise
    {
        return new class($this) implements Promise {

            private $defer;

            public function __construct(Deferred $defer)
            {
                $this->defer = $defer;
            }

            /**
             * {@inheritdoc}
             */
            public function when(callable $callback): void
            {
                if ($this->defer->state & AbstractPromise::SUCCEEDED) {
                    try {
                        $callback(null, $this->defer->result);
                    } catch (\Throwable $e) {
                        $this->defer->context->handleError($e);
                    }
                } elseif ($this->defer->state & AbstractPromise::FAILED) {
                    try {
                        $callback($this->defer->result);
                    } catch (\Throwable $e) {
                        $this->defer->context->handleError($e);
                    }
                } elseif ($this->defer->result) {
                    if (\is_array($this->defer->result) && isset($this->defer->result[0])) {
                        $this->defer->result[] = $callback;
                    } else {
                        $this->defer->result = [
                            $this->defer->result,
                            $callback
                        ];
                    }
                } else {
                    $this->defer->result = $callback;
                }
            }
        };
    }
608615
function (invite, cb) {
      var id = api.keys.sync.id()
      var data = ref.parseInvite(invite)
      api.contact.async.followerOf(id, data.key, function (_, follows) {
        if (follows) console.log('already following', cb())
        else console.log('accept invite:' + invite, accept(invite, cb))
      })
    }
1111593
public function postInviteUser()
    {
        try {
            execute(new InviteUserCommand(
                array_unique(array_filter((array) Binput::get('emails')))
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.team.invite')
                ->withInput(Binput::except('password'))
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.team.invite.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.team.invite')
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.team.invite.success')));
    }
546800
function add(\CharlotteDunois\Yasmin\HTTP\APIRequest $apirequest) {
        return (new \React\Promise\Promise(function (callable $resolve, callable $reject) use ($apirequest) {
            $apirequest->deferred = new \React\Promise\Deferred();
            $apirequest->deferred->promise()->done($resolve, $reject);
            
            $endpoint = $this->getRatelimitEndpoint($apirequest);
            if(!empty($endpoint)) {
                $this->client->emit('debug', 'Adding request "'.$apirequest->getEndpoint().'" to ratelimit bucket');
                $bucket = $this->getRatelimitBucket($endpoint);
                
                $bucket->push($apirequest);
                $this->queue[] = $bucket;
            } else {
                $this->client->emit('debug', 'Adding request "'.$apirequest->getEndpoint().'" to global queue');
                $this->queue[] = $apirequest;
            }
            
            $this->processFuture();
        }));
    }
316340
public function
	Accept() {
	/*//
	@override
	//*/

		// provide a way for me to reuse this to accept all files. then
		// i can reuse this is a recursive copy.
		if($this->Exts === null)
		return true;

		// else do the test.
		return array_key_exists(
			$this->getInnerIterator()->getExtension(),
			$this->Exts
		);
	}