Return True if this is a valid UPS tracking number.
500159
def validate(self, tracking_number):
        ""
        tracking_num = tracking_number[2:-1]
        odd_total = 0
        even_total = 0

        for ii, digit in enumerate(tracking_num.upper()):
            try:
                value = int(digit)
            except ValueError:
                value = int((ord(digit) - 63) % 10)
            if (ii + 1) % 2:
                odd_total += value
            else:
                even_total += value

        total = odd_total + even_total * 2
        check = ((total - (total % 10) + 10) - total) % 10
        return (check == int(tracking_number[-1:]))
1001394
def is_number(self):
        """"""
        self.number = re.sub(r'[^\d]', '', self.number)
        return self.number.isdigit()
42756
def is_valid_esi(esi):
    """"""
    if isinstance(esi, numbers.Integral):
        return 0 <= esi <= 0xffffffffffffffffff
    return isinstance(esi, dict)
979919
def isValidPublicAddress(address: str) -> bool:
    """"""
    valid = False

    if len(address) == 34 and address[0] == 'A':
        try:
            base58.b58decode_check(address.encode())
            valid = True
        except ValueError:
            # checksum mismatch
            valid = False

    return valid
876113
@SuppressWarnings("unused")
    public boolean isValid() {
        Phonenumber.PhoneNumber phoneNumber = getPhoneNumber();
        return phoneNumber != null && mPhoneUtil.isValidNumber(phoneNumber);
    }
755045
def _is_valid_id(self, inpt):
        """"""
        from dlkit.abstract_osid.id.primitives import Id as abc_id
        if isinstance(inpt, abc_id):
            return True
        else:
            return False
974581
def _txn_is_in_valid_batch(self, txn_id):
        

        batch = self._batches_by_txn_id[txn_id]

        # Return whether every transaction in the batch with a
        # transaction result is valid
        return all(
            self._txn_results[sig].is_valid
            for sig in set(self._txn_results).intersection(
                (txn.header_signature for txn in batch.transactions)))
920890
private boolean responseIsInValid() {
        if (response == null) {
            return true;
        }
        else if (!response.isHeadless() && validityCheck) {
            return request.getTransactionID() != response.getTransactionID();
        }
        else {
            return false;
        }
    }
987859
def confirm(self, tid, out_sid, session):
        ''''''
        request = TOPRequest('taobao.logistics.online.confirm')
        request['tid'] = tid
        request['out_sid'] = out_sid
        self.create(self.execute(request, session), fields = ['shipping',], models = {'shipping':Shipping})
        return self.shipping
273284
def valid(number):
    
    checksum = 0

    number_len = len(number)
    offset = ord('0')

    i = number_len - 1
    while i >= 0:
      n = ord(number[i]) - offset
      checksum += n
      i -= 2

    i = number_len - 2
    while i >= 0:
      n = ord(number[i]) - offset
      n *= 2
      if n > 9:
          n -= 9
      checksum += n
      i -= 2

    return checksum%10 == 0
80803
def verify(backup_path, fast):
    """"""
    from PyHardLinkBackup.phlb.verify import verify_backup

    verify_backup(backup_path, fast)
1263970
def verify(self, otp, for_time=None, valid_window=0):
        
        if for_time is None:
            for_time = datetime.datetime.now()

        if valid_window:
            for i in range(-valid_window, valid_window + 1):
                if utils.strings_equal(str(otp), str(self.at(for_time, i))):
                    return True
            return False

        return utils.strings_equal(str(otp), str(self.at(for_time)))
473742
def valid?
      return false if !@catalog_object_id.nil? && @catalog_object_id.to_s.length > 192
      return false if !@name.nil? && @name.to_s.length > 255
      type_validator = EnumAttributeValidator.new('String', ["UNKNOWN_TAX", "ADDITIVE", "INCLUSIVE"])
      return false unless type_validator.valid?(@type)
      return false if !@percentage.nil? && @percentage.to_s.length > 10
      return true
    end
926362
def valid?
      return false if @id.nil?
      return false if @integration_id.nil?
      return false if @state.nil?
      state_validator = EnumAttributeValidator.new('String', ['pending', 'processed', 'failed', 'error'])
      return false unless state_validator.valid?(@state)
      return false if @action_category.nil?
      action_category_validator = EnumAttributeValidator.new('String', ['notification', 'file_upload'])
      return false unless action_category_validator.valid?(@action_category)
      return false if @action_type.nil?
      action_type_validator = EnumAttributeValidator.new('String', ['webhook', 'slack_webhook', 'email', 'aws_s3_upload'])
      return false unless action_type_validator.valid?(@action_type)
      return false if @result_data.nil?
      true
    end
635219
def is_valid_uniprot_id(instring):
    
    valid_id = re.compile("[OPQ][0-9][A-Z0-9]{3}[0-9]|[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}")
    if valid_id.match(str(instring)):
        return True
    else:
        return False
1046705
public function isValidForCurrentPortal()
    {
        $aPortalIdList = $this->getShopShippingTypeDataAccess()->getPermittedPortalIds($this->id);
        if (!is_array($aPortalIdList) || count($aPortalIdList) < 1) {
            $bIsValidForPortal = true;
        } else {
            $oActivePortal = $this->getPortalDomainService()->getActivePortal();
            if (null === $oActivePortal) {
                $bIsValidForPortal = false;
            } else {
                $bIsValidForPortal = in_array($oActivePortal->id, $aPortalIdList);
            }
        }

        return $bIsValidForPortal;
    }
802851
def is_valid(self) -> bool:
        
        return CRCPubkey.from_pubkey(self.pubkey).crc == self.crc