Verify that this sender is valid.
975991
def _verifySender(self, sender):
        
        if self.store.findFirst(
            LoginMethod,
            AND(LoginMethod.localpart == sender.localpart,
                LoginMethod.domain == sender.domain,
                LoginMethod.internal == True)) is None:
            raise BadSender(sender.localpart + u'@' + sender.domain,
                            [lm.localpart + u'@' + lm.domain
                             for lm in self.store.query(
                        LoginMethod, LoginMethod.internal == True)])
70195
def is_valid(self, qstr=None):
        """"""
        if qstr is None:
            qstr = self.currentText()
        return QUrl(qstr).isValid()
677286
def is_valid(cls, arg):
        """"""
        return isinstance(arg, (int, long)) and (not isinstance(arg, bool))
124336
def verify_envelope(reply, key_file):
    """"""
    doc = etree.fromstring(reply)
    node = doc.find(".//{%s}Signature" % xmlsec.DSigNs)
    if node is None:
        raise CertificationError("No signature node found")
    dsigCtx = xmlsec.DSigCtx()

    xmlsec.addIDs(doc, ['Id'])
    signKey = xmlsec.Key.load(key_file, xmlsec.KeyDataFormatPem)
    signKey.name = os.path.basename(key_file)

    dsigCtx.signKey = signKey
    try:
        dsigCtx.verify(node)
    except xmlsec.VerificationError:
        return False
    return True
875091
public function is_valid() {
        $ret = false;

        if (is_null($this->maxRecipients) === false && is_null($this->priority) === false &&
            is_null($this->compileBeforeDeliveryStart) === false && is_null($this->allowMultipleDeliveries) === false &&
            is_null($this->deliverImmediately) === false && is_null($this->obeyDeliveryLimits) === false
        ) {
            if ($this->deliverImmediately === true || is_null($this->deliveryStartDateTime) === false) {
                if ($this->compileBeforeDeliveryStart === false ||
                    (is_null($this->compileStartDateTime) === false && is_null($this->deliveryStartDateTime) === false &&
                        $this->compileStartDateTime <= $this->deliveryStartDateTime)
                ) {
                    // TODO: deliveryFrequency
                    $ret = true;
                }
            }
        }

        return $ret;
    }
208304
def is_valid(self):
        ''' 
        '''
        if not super(DeleteUserForm, self).is_valid():
            return False
        if self.user == self.request.user:
            self._errors["__all__"] = self.error_class([MESSAGES['SELF_DELETE']])
            return False
        return True
483222
def validate(address, mailbox_verification = false)
      params = {:address => address}
      params[:mailbox_verification] = true if mailbox_verification

      res = @client.get "address/validate", params
      return res.to_h!
    end
766047
def verify(self, base_path, update=False):
        """"""
        return self.project.verify_submission(base_path, self, update=update)
1207479
def __check_valid(self, post_data):
        '''
        
        '''
        user_create_status = {'success': False, 'code': '00'}

        if not tools.check_username_valid(post_data['user_name']):
            user_create_status['code'] = '11'
            return user_create_status
        elif not tools.check_email_valid(post_data['user_email']):
            user_create_status['code'] = '21'
            return user_create_status
        elif MUser.get_by_name(post_data['user_name']):
            user_create_status['code'] = '12'
            return user_create_status
        elif MUser.get_by_email(post_data['user_email']):
            user_create_status['code'] = '22'
            return user_create_status

        user_create_status['success'] = True
        return user_create_status
99316
def isValid(self):
        

        today = DateTime()
        valid_from = self.getValidFrom()
        valid_to = self.getValidTo()

        return valid_from <= today <= valid_to
54656
def valid(self):
        """"""

        valid_servers = 0
        for server in self._servers:
            if server['down_until'] <= time.time():
                valid_servers += 1

        return valid_servers > 0
212869
public function valid(){
        $rs = $_GET['echostr'];
        if ($this->check_signature()){
            echo $rs;
            exit;
        }else{
            if ($this->business_interface) $this->business_interface->log('valid fail. get data:'.json_encode($_GET));
            echo '';
            exit;
        }
    }
476311
def is_valid(self):
        
        return len(self.ref) == 1 and \
               len(self.alt) == 1 and \
               len(self.alt[0]) == 1
784252
def are_you_sure(msg=''):
    
    """
    print(msg)
    from utool import util_arg
    from utool import util_str
    override = util_arg.get_argflag(('--yes', '--y', '-y'))
    if override:
        print('accepting based on command line flag')
        return True
    valid_ans = ['yes', 'y']
    valid_prompt = util_str.conj_phrase(valid_ans, 'or')
    ans = input('Are you sure?\n Enter %s to accept\n' % valid_prompt)
    return ans.lower() in valid_ans
295006
public function isTransactionVerificationValid()
    {
        $this->verifyTransactionAtGateway();

        $result = $this->getResponse()['message'];

        switch ($result) {
            case self::VS:
                $validate = true;
                break;
            case self::ITF:
                $validate = false;
                break;
            default:
                $validate = false;
                break;
        }

        return $validate;
    }
1247891
public function isValid(): bool
    {
        return $this->result_code === ResponseInterface::RESULT_OK
            || $this->result_code === ResponseInterface::RESULT_RECEIPT_VALID_BUT_SUB_EXPIRED;
    }
800238
def valid?
      @errors = []

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

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

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

      # Make sure all addresses are correct.
      unless addresses.all? { | address | address.valid? }
        @errors << ['addresses', 'at least one address is invalid']
      end

      # Make sure all phone numbers are correct.
      unless phones.all? { | phone | phone.valid? }
        @errors << ['phones', 'at least one phone is invalid']
      end

      @errors.size == 0
    end