approve a friendship invitation. If the operation succeeds, the method returns true, else false
553248
def approve(user)
      friendship = find_any_friendship_with(user)
      return false if friendship.nil? || invited?(user)
      friendship.update_attribute(:pending, false)
    end
1252339
def send_invitation(self, invitation, **kwargs):
        # type: (OrganizationInvitationBase) -> bool
        
        return self.email_message(
            invitation.invitee_identifier,
            self.invitation_subject,
            self.invitation_body,
            invitation.invited_by,
            **kwargs
        ).send()
165196
def _send_invitation(request, project):
    
    form = forms.InviteUserApplicationForm(request.POST or None)
    if request.method == 'POST':
        if form.is_valid():

            email = form.cleaned_data['email']
            applicant, existing_person = get_applicant_from_email(email)

            # If applicant is None then there were multiple persons found.
            if applicant is None:
                return render(
                    template_name='kgapplications/'
                                  'project_common_invite_multiple.html',
                    context={'form': form, 'email': email},
                    request=request)

            if existing_person and 'existing' not in request.POST:
                return render(
                    template_name='kgapplications/'
                                  'project_common_invite_existing.html',
                    context={'form': form, 'person': applicant},
                    request=request)

            application = form.save(commit=False)
            application.applicant = applicant
            application.project = project
            application.save()
            state_machine = get_application_state_machine()
            response = state_machine.start(request, application)
            return response

    return render(
        template_name='kgapplications/project_common_invite_other.html',
        context={'form': form, 'project': project, },
        request=request)
1186557
def get_next_action(self, request, application, roles):
        
        application.reopen()
        link, is_secret = base.get_email_link(application)
        emails.send_invite_email(application, link, is_secret)
        messages.success(
            request,
            "Sent an invitation to %s."
            % application.applicant.email)
        return 'success'
440636
def approveproposal(ctx, proposal, account):
    
    print_tx(ctx.bitshares.approveproposal(proposal, account=account))
488166
public boolean accept(File f) {
        if (f != null) {
            if (f.isDirectory()) {
                return false;
            }
            String extension = getExtension(f);
            if (extension != null && filters.get(getExtension(f)) != null) {
                return true;
            }
        }
        return false;
    }
531946
public boolean accepts(Method method) {
        return isPublic(method) && isVoid(method) && takesOneParameter(method) && isAnnotatedAsSubscription(method);
    }
586283
public function approve($friendId)
    {

        $uri = $this->buildUserResourceUri('approve', $friendId);
        $response = $this->makeAuthenticatedApiRequest($uri);

        return $response->user;

    }
601803
public static function accept() {
        global $USER, $DB;
        if (!isloggedin()) {
            return false;
        }
        if ($USER->policyagreed || !static::is_defined(isguestuser())) {
            return false;
        }

        if (!isguestuser()) {
            // For the guests agreement in stored in session only, for other users - in DB.
            $DB->set_field('user', 'policyagreed', 1, array('id' => $USER->id));
        }
        $USER->policyagreed = 1;
        return true;
    }
1155110
public T friends_areFriends(int userId1, int userId2)
    throws FacebookException, IOException {
    return this.callMethod(FacebookMethod.FRIENDS_ARE_FRIENDS,
                           new Pair<String, CharSequence>("uids1", Integer.toString(userId1)),
                           new Pair<String, CharSequence>("uids2", Integer.toString(userId2)));
  }
117948
function approveWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, arrOtherCosigners, onDone){
	var arrDeviceAddresses = getDeviceAddresses(arrWalletDefinitionTemplate);
	device.addIndirectCorrespondents(arrOtherCosigners, function(){
		addWallet(wallet, xPubKey, account, arrWalletDefinitionTemplate, function(){
			arrDeviceAddresses.forEach(function(device_address){
				if (device_address !== device.getMyDeviceAddress())
					sendMyXPubKey(device_address, wallet, xPubKey);
			});
			if (onDone)
				onDone();
		});
	});
}
1194493
def send_org_invite(user, invite)
      # Generate token if not generated
      user.send(:generate_confirmation_token!) if !user.confirmed? && user.confirmation_token.blank?

      MnoEnterprise::SystemNotificationMailer.organization_invite(invite).deliver_later

      # Update staged invite status
      invite.status = 'pending' if invite.status == 'staged'
      invite.notification_sent_at = Time.now unless invite.notification_sent_at.present?
      invite.save
    end
413358
def action_approve(self):
        """"""
        for rec in self:
            if rec.state not in ['draft', 'to approve']:
                raise UserError(
                    _("Can't approve page in '%s' state.") % rec.state)
            if not rec.am_i_approver:
                raise UserError(_(
                    'You are not authorized to do this.\r\n'
                    'Only approvers with these groups can approve this: '
                    ) % ', '.join(
                        [g.display_name
                            for g in rec.page_id.approver_group_ids]))
            # Update state
            rec.write({
                'state': 'approved',
                'approved_date': fields.datetime.now(),
                'approved_uid': self.env.uid,
            })
            # Trigger computed field update
            rec.page_id._compute_history_head()
            # Notify state change
            rec.message_post(
                subtype='mt_comment',
                body=_(
                    'Change request has been approved by %s.'
                    ) % (self.env.user.name)
            )
            # Notify followers a new version is available
            rec.page_id.message_post(
                subtype='mt_comment',
                body=_(
                    'New version of the document %s approved.'
                    ) % (rec.page_id.name)
            )
245803
def do_invite(self, sender, body, args):
        """"""
        for invitee in args:
            new_member = { 'JID': invitee }
            self.invite_user(new_member, inviter=sender)
964997
def accept(self, match=None, match_dict=None, include_rejected=False, include_denied=False):
        '''
        
        '''
        if match is not None:
            matches = self.name_match(match)
        elif match_dict is not None and isinstance(match_dict, dict):
            matches = match_dict
        else:
            matches = {}
        keydirs = [self.PEND]
        if include_rejected:
            keydirs.append(self.REJ)
        if include_denied:
            keydirs.append(self.DEN)
        for keydir in keydirs:
            for key in matches.get(keydir, []):
                try:
                    shutil.move(
                            os.path.join(
                                self.opts['pki_dir'],
                                keydir,
                                key),
                            os.path.join(
                                self.opts['pki_dir'],
                                self.ACC,
                                key)
                            )
                    eload = {'result': True,
                             'act': 'accept',
                             'id': key}
                    self.event.fire_event(eload,
                                          salt.utils.event.tagify(prefix='key'))
                except (IOError, OSError):
                    pass
        return (
            self.name_match(match) if match is not None
            else self.dict_match(matches)
        )
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={}
        )
1252269
def acknowledged(self, value):
        
        assert (isinstance(value, bool))
        self._acknowledged = value
        if value:
            self._timeouted = False
            self._rejected = False
            self._cancelled = False