Attempt to remove the EighthSignup if the user has permission to do so.
329911
def remove_signup(self, user=None, force=False, dont_run_waitlist=False):
        """"""

        exception = eighth_exceptions.SignupException()

        if user is not None:
            if user != self.user and not user.is_eighth_admin:
                exception.SignupForbidden = True

        # Check if the block has been locked
        if self.scheduled_activity.block.locked:
            exception.BlockLocked = True

        # Check if the scheduled activity has been cancelled
        if self.scheduled_activity.cancelled:
            exception.ScheduledActivityCancelled = True

        # Check if the activity has been deleted
        if self.scheduled_activity.activity.deleted:
            exception.ActivityDeleted = True

        # Check if the user is already stickied into an activity
        if self.scheduled_activity.activity and self.scheduled_activity.activity.sticky:
            exception.Sticky = True

        if len(exception.messages()) > 0 and not force:
            raise exception
        else:
            block = self.scheduled_activity.block
            self.delete()
            if settings.ENABLE_WAITLIST and self.scheduled_activity.waitlist.all().exists() and not block.locked and not dont_run_waitlist:
                if not self.scheduled_activity.is_full():
                    waitlists = EighthWaitlist.objects.get_next_waitlist(self.scheduled_activity)
                    self.scheduled_activity.notify_waitlist(waitlists, self.scheduled_activity)
            return "Successfully removed signup for {}.".format(block)
753256
def auth_remove(name, drop, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('auth:group:remove', **{
        'storage': ctx.repo.create_secure_service('storage'),
        'name': name,
        'drop': drop,
    })
957041
public function remove_remaining($base_id, $n = 1)
    {
        $this->load_rights_bas();

        if (!$this->has_access_to_base($base_id)) {
            return false;
        }

        $this->_rights_bas[$base_id]['remain_dwnld'] = max(0, $this->_rights_bas[$base_id]['remain_dwnld'] - (int) $n);

        return $this;
    }
42681
public static void removeCurrentAuthentication() {
        RequestContext context = RequestContext.getCurrent();
        if (context != null) {
            removeAuthentication(context.getRequest());
        }
    }
770345
private void removeFromPermissionsCache(IAuthorizationPrincipal[] principals)
            throws AuthorizationException {
        for (int i = 0; i < principals.length; i++) {
            cacheRemove(principals[i]);
        }
    }
279444
@Override
	public void removeByG_P_A(long groupId, boolean primary, boolean active) {
		for (CommerceCurrency commerceCurrency : findByG_P_A(groupId, primary,
				active, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceCurrency);
		}
	}
1142493
def can_unconsign(self):
        
        chain = BlockchainSpider.chain(self._tree, self.edition_number)
        if len(chain) == 0:
            self.reason = 'Master edition not yet registered'
            return False

        chain = BlockchainSpider.strip_loan(chain)
        action = chain[-1]['action']
        piece_address = chain[-1]['piece_address']
        edition_number = chain[-1]['edition_number']
        to_address = chain[-1]['to_address']

        if action != 'CONSIGN' or piece_address != self.piece_address or edition_number != self.edition_number or to_address != self.address:
            self.reason = 'Edition number {} is not consigned to {}'.format(self.edition_number, self.address)
            return False

        return True
1079220
void revoke(SchemaObject object, Right right, Grantee grantor,
                boolean grantOption) {

        final HsqlName name     = object.getName();
        Iterator       it       = directRightsMap.get(name);
        Right          existing = null;

        while (it.hasNext()) {
            existing = (Right) it.next();

            if (existing.grantor == grantor) {
                break;
            }
        }

        if (existing == null) {
            return;
        }

        if (existing.grantableRights != null) {
            existing.grantableRights.remove(object, right);
        }

        if (grantOption) {
            return;
        }

        if (right.isFull) {
            directRightsMap.remove(name, existing);
            grantor.grantedRightsMap.remove(name, existing);
            updateAllRights();

            return;
        }

        existing.remove(object, right);

        if (existing.isEmpty()) {
            directRightsMap.remove(name, existing);
            grantor.grantedRightsMap.remove(object, existing);
        }

        updateAllRights();

        return;
    }
101940
def remove_sid2uid(self, sid, uid):
        
        self.remove('uid2sid', uid, sid)
        self.remove('sid2uid', sid, uid)
576498
def drop_privileges ():
    """"""
    if os.name != 'posix':
        return
    if os.geteuid() == 0:
        log.warn(LOG_CHECK, _("Running as root user; "
                       "dropping privileges by changing user to nobody."))
        import pwd
        os.seteuid(pwd.getpwnam('nobody')[3])
985405
@Override
	public void removeByG_U(long groupId, long userId) {
		for (CommerceSubscriptionEntry commerceSubscriptionEntry : findByG_U(
				groupId, userId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(commerceSubscriptionEntry);
		}
	}
876626
def remove_permission(self, label, callback=None):
        
        return self.connection.remove_permission(self, label, callback=callback)
9150
def remove(self, uid, filename=None):
        """"""
        if not filename:
            filename = self._filename
        elif filename not in self._reminders:
            return

        uid = uid.split('@')[0]

        with self._lock:
            rem = open(filename).readlines()
            for (index, line) in enumerate(rem):
                if uid == md5(line[:-1].encode('utf-8')).hexdigest():
                    del rem[index]
                    open(filename, 'w').writelines(rem)
                    break
545178
function unsigncookie(val, secrets) {
  for (var i = 0; i < secrets.length; i++) {
    var result = signature.unsign(val, secrets[i]);

    if (result !== false) {
      return result;
    }
  }

  return false;
}
82041
def remove(h, i):
    """"""
    n = h.size() - 1
    if n != i:
        h.swap(i, n)
        down(h, i, n)
        up(h, i)

    return h.pop()
1269628
def remove(self, value):
        """"""
        def remove_trans(pipe):
            # If we're caching, we'll need to synchronize before removing.
            if self.writeback:
                self._sync_helper(pipe)

            delete_count = pipe.lrem(self.key, 1, self._pickle(value))
            if delete_count == 0:
                raise ValueError

        self._transaction(remove_trans)
660563
function removeSignatory (commandOptions, { accountId, publicKey }) {
  return command(
    commandOptions,
    txHelper.addCommand(
      txHelper.emptyTransaction(),
      'removeSignatory',
      {
        accountId,
        publicKey
      }
    )
  )
}