disqualify a candidate
 @param candidate_id [String] the candidate's id
 @param member_id [String] id of the member performing the disqualification
 @param reason [String] why the candidate should be disqualified
344743
def disqualify(candidate_id, member_id, reason = nil)
      post_request("candidates/#{candidate_id}/disqualify") do |request|
        request.body = { member_id: member_id, disqualification_reason: reason }.to_json
      end
    end
54447
def election_group_id(self):
        
        self._validate()
        # there are no additional validation checks for the top-level group id
        parts = []
        parts.append(self.election_type)
        parts.append(self.date)
        return ".".join(parts)
94500
public static void validateId(final String id) {
    if (id == null || id.isEmpty()) {
      throw new IllegalArgumentException("The ID cannot be null or empty");
    }
    for (int i = 0; i < id.length(); i++) {
      final char c = id.charAt(i);
      if (!(Character.isLetterOrDigit(c))) {
        throw new IllegalArgumentException("Invalid id (\"" + id + 
            "\"): illegal character: " + c);
      }
    }
    if (id.length() == 1) {
      if (Character.isDigit(id.charAt(0))) {
        throw new IllegalArgumentException("The ID cannot be an integer");
      }
    }
  }
1032740
function(new_id) {

		if (Lava.schema.DEBUG && !Lava.isValidId(new_id)) Lava.t();
		Lava.view_manager.unregisterView(this);
		this.id = new_id;
		Lava.view_manager.registerView(this);

	}
1124667
public boolean shouldExcludeQualifier(String qualifier){
        if (excludedQualifiers.contains("all") ||
            excludedQualifiers.contains(qualifier) ||
            excludedQualifiers.contains(qualifier + ".*")) {
            return true;
        } else {
            int index = -1;
            while ((index = qualifier.indexOf(".", index + 1)) != -1) {
                if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) {
                    return true;
                }
            }
            return false;
        }
    }
89222
def fail(reason=nil, options={})
      case reason
      when Errno::EACCES
        STDERR.puts reason.message
        STDERR.puts "Try elevating privilege (sudo/runas) before invoking this command."
        code = 2
      when Exception
        STDOUT.puts "Unexpected #{reason.class.name}: #{reason.message}"
        STDOUT.puts "We apologize for the inconvenience. You may try connecting as root"
        STDOUT.puts "to work around this problem, if you have sufficient privilege."
        unless @log_sink.string.empty?
          STDERR.puts
          STDERR.puts("Debugging information:")
          STDERR.puts(@log_sink.string)
        end
        code = 50
      when String
        STDOUT.puts reason
        code = 50
      when Integer
        code = reason
      else
        code = 50
      end

      puts Usage.scan(__FILE__) if options[:print_usage]
      exit(code)
    end
1142371
def remove_member(self, member_id):
        
        member_rm_request = etcdrpc.MemberRemoveRequest(ID=member_id)
        self.clusterstub.MemberRemove(
            member_rm_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
59494
def reason=(reason)

      if !reason.nil? && reason.to_s.length > 192
        fail ArgumentError, "invalid value for 'reason', the character length must be smaller than or equal to 192."
      end

      @reason = reason
    end
367883
def kick_user(self, user_id, reason=""):
        
        try:
            self.client.api.kick_user(self.room_id, user_id)
            return True
        except MatrixRequestError:
            return False
1246879
public StatementBuilder withQualifier(Snak qualifier) {
		getQualifierList(qualifier.getPropertyId()).add(qualifier);
		return getThis();
	}
505016
def reference_id=(reference_id)

      if !reference_id.nil? && reference_id.to_s.length > 40
        fail ArgumentError, "invalid value for 'reference_id', the character length must be smaller than or equal to 40."
      end

      @reference_id = reference_id
    end
192058
public function unAvailable($code, $card_id, $reason = null)
    {
        $data = ['code' => $code, 'card_id' => $card_id];
        is_null($reason) || $data['reason'] = $reason;
        $url = "https://api.weixin.qq.com/card/code/unavailable?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
331360
@Deactivate
    protected void deactivate(int reason) {
        final String methodName = "deactivate";
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(tc, methodName, "Entry Count: " + ++JDBCMBeanRuntime.counterDeactivate);
        if (trace && tc.isEventEnabled())
            Tr.event(tc, className + methodName + ", reason=" + reason);
        if (trace && tc.isEntryEnabled())
            Tr.exit(tc, methodName, "Normal Exit");
    }
213895
def remove(self, membership_id):
        
        path = '{}/remove'.format(membership_id)
        url = utils.urljoin(self.url, path)
        payload = {'membership_id': membership_id}
        response = self.session.post(url, json=payload)
        return response.ok
467702
def cancel(id)
      pipeline = Base.find(id)
      pipeline.cancel
    rescue ActiveRecord::RecordNotFound
      raise InvalidPipelineError.new("Invalid pipeline")
    end
154098
async def reject(self, reason: str = '') -> None:
        
        try:
            await self.bot.call_action(
                action='.handle_quick_operation_async',
                self_id=self.ctx.get('self_id'),
                context=self.ctx,
                operation={'approve': False, 'reason': reason}
            )
        except CQHttpError:
            pass
830126
public function removeVote($id, $memberId)
    {
        return $this->delete($this->getPath($id).'/membersVoted/'.rawurlencode($memberId));
    }