Determines whether this AD Group is valid.

        :returns: True and "" if this group is valid or False and a string description
                  with the reason why it isn't valid otherwise.
335112
def _get_valididty(self):
        

        try:
            self.ldap_connection.search(search_base=self.VALID_GROUP_TEST['base_dn'],
                                        search_filter=self.VALID_GROUP_TEST['filter_string'],
                                        search_scope=self.VALID_GROUP_TEST['scope'],
                                        attributes=self.VALID_GROUP_TEST['attribute_list'])
        except LDAPOperationsErrorResult as error_message:
            raise ImproperlyConfigured("The LDAP server most-likely does not accept anonymous connections:"
                                       "\n\t{error}".format(error=error_message[0]['info']))
        except LDAPInvalidDNSyntaxResult:
            return False, "Invalid DN Syntax: {group_dn}".format(group_dn=self.group_dn)
        except LDAPNoSuchObjectResult:
            return False, "No such group: {group_dn}".format(group_dn=self.group_dn)
        except LDAPSizeLimitExceededResult:
            return False, ("This group has too many children for ldap-groups to handle: "
                           "{group_dn}".format(group_dn=self.group_dn))

        return True, ""
593308
def is_valid(self):
        
        conditions = [
            self.protocol_id == 0,  # Modbus always uses protocol 0
            2 <= self.length <= 260,  # Absolute length limits
            len(self.data) == self.length - 2,  # Total length matches data length
        ]
        return all(conditions)
7316
def valid?
      return false if @payment_id.nil?
      return false if @type.nil?
      type_validator = EnumAttributeValidator.new('String', ["FULL", "PARTIAL"])
      return false unless type_validator.valid?(@type)
      return false if @reason.nil?
      return true
    end
795859
def valid?
      @errors = []

      if !bank_transaction_id.nil? && bank_transaction_id !~ GUID_REGEX
        @errors << ['bank_transaction_id', 'must be blank or a valid Xero GUID']
      end

      if type && !TYPES[type]
        @errors << ['type', "must be one of #{TYPES.keys.join('/')}"]
      end

      if status && !STATUSES[status]
        @errors << ['status', "must be one of #{STATUSES.keys.join('/')}"]
      end

      unless date
        @errors << ['date', "can't be blank"]
      end

      # Make sure contact is valid.
      unless @contact && @contact.valid?
        @errors << ['contact', 'is invalid']
      end

      # Make sure all line_items are valid.
      unless line_items.all? { | line_item | line_item.valid? }
        @errors << ['line_items', "at least one line item invalid"]
      end

      @errors.size == 0
    end
710720
def valid?
      order_validator = EnumAttributeValidator.new('String', ["DESC", "ASC"])
      return false unless order_validator.valid?(@order)
      status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INACTIVE"])
      return false unless status_validator.valid?(@status)
      return true
    end
424212
@SuppressWarnings("unchecked")
    protected boolean isValid() {

        boolean res = true;

        res = res & m_description.isValid();
        res = res & m_name.isValid();
        if (!res) {
            return res;
        }
        for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
            if (!((AbstractField<String>)row.getComponent()).isValid()) {
                return false;
            }
        }
        return true;
    }
218087
public boolean isValid() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "Checking validity of token " + this.getClass().getName());

        if (token != null) {
            // return if this token is still valid
            long currentTime = System.currentTimeMillis();
            long expiration = getExpiration();
            long timeleft = expiration - currentTime;

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Time left for token: " + timeleft);

            if (timeleft > 0) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "token is valid.");
                return true;
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "token is invalid.");
                return false;
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "token is null, returning invalid.");
            return false;
        }
    }
1303823
def is_valid(self, value):
        
        if not self.is_array:
            return self._valid(value)

        if isinstance(value, (list, set, tuple)):
            return all([self._valid(item) for item in value])

        return self._valid(value)
113680
def validate(self) -> bool:
        
        # Asset class allocation should match the sum of children's allocations.
        # Each group should be compared.
        sum = Decimal(0)

        # Go through each asset class, not just the top level.
        for ac in self.asset_classes:
            if ac.classes:
                # get the sum of all the children's allocations
                child_alloc_sum = ac.child_allocation
                # compare to set allocation
                if ac.allocation != child_alloc_sum:
                    message = f"The sum of child allocations {child_alloc_sum:.2f} invalid for {ac}!"
                    self.logger.warning(message)
                    print(message)
                    return False

        # also make sure that the sum of 1st level children matches 100
        for ac in self.classes:
            sum += ac.allocation
        if sum != Decimal(100):
            message = f"The sum of all allocations ({sum:.2f}) does not equal 100!"
            self.logger.warning(message)
            print(message)
            return False

        return True
615952
def is_valid(self, context, sid):
		
		
		record = self._Document.find_one(sid, project=('expires', ))
		
		if not record:
			return
		
		return not record._expired
361973
public function is_valid() {
        $ret = false;

        if (is_null($this->masterName) === false && is_null($this->fromName) === false &&
            is_null($this->fromDomain) === false && is_null($this->division) === false &&
            is_null($this->encoding) === false && is_null($this->subject) === false &&
            is_null($this->deliveryType) === false && is_null($this->friendlyFrom) === false &&
            is_null($this->description) === false && is_null($this->campaign) === false
        ) {
            $ret = true;
        }

        return $ret;
    }
277583
@Override
    public boolean isValidGroup(String groupSecurityName) throws RegistryException {
        if (groupSecurityName == null) {
            throw new IllegalArgumentException("groupSecurityName is null");
        }
        if (groupSecurityName.isEmpty()) {
            throw new IllegalArgumentException("groupSecurityName is an empty String");
        }
        return false;
    }
213386
def is_valid(self):
        """"""
        form = super(AuthenticateForm, self).is_valid()
        for f, error in self.errors.items():
            if f != "__all__":
                self.fields[f].widget.attrs.update({"class": "error", "placeholder": ", ".join(list(error))})
            else:
                errors = list(error)
                if "This account is inactive." in errors:
                    message = "Intranet access restricted"
                else:
                    message = "Invalid password"
                self.fields["password"].widget.attrs.update({"class": "error", "placeholder": message})

        return form
825233
def is_valid(self):
        '''
        
        '''

        valid = super(RegistrationContactForm,self).is_valid()
        msgs = messages.get_messages(self._request)

        # We only want validation messages to show up once, so pop messages that have already show up
        # before checking to see if any messages remain to be shown.
        prior_messages = self._session.pop('prior_messages',[])
        remaining_messages = []

        for m in msgs:
            m_dict = {'message': m.message, 'level': m.level, 'extra_tags': m.extra_tags}
            if m_dict not in prior_messages:
                remaining_messages.append(m_dict)

        if remaining_messages:
            self._session['prior_messages'] = remaining_messages
            self._request.session.modified = True
            return False
        return valid
305174
def is_group(value):
    

    if type(value) == str:
        try:
            entry = grp.getgrnam(value)
            value = entry.gr_gid
        except KeyError:
            err_message = ('{0}: No such group.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    elif type(value) == int:
        try:
            grp.getgrgid(value)
        except KeyError:
            err_message = ('{0}: No such group.'.format(value))
            raise validate.VdtValueError(err_message)

        return value

    else:
        err_message = ('Please, use str or int to "user" parameter.')
        raise validate.VdtTypeError(err_message)
239991
def is_correct(self):
        
        valid = True
        valid &= self.swday in range(7)
        if not valid:
            logger.error("Error: %s is not a valid day", self.swday)

        valid &= self.ewday in range(7)
        if not valid:
            logger.error("Error: %s is not a valid day", self.ewday)

        return valid
363693
def is_valid(self, instance):
        

        errors = self.errors(instance)

        if isinstance(errors, list):
            return not any(errors)

        return not bool(errors)