Returns true if this S3 object has the encryption information stored
as user meta data; false otherwise.
511875
final boolean hasEncryptionInfo() {
        ObjectMetadata metadata = s3obj.getObjectMetadata();
        Map<String, String> userMeta = metadata.getUserMetadata();
        return userMeta != null
            && userMeta.containsKey(Headers.CRYPTO_IV)
            && (userMeta.containsKey(Headers.CRYPTO_KEY_V2)
                || userMeta.containsKey(Headers.CRYPTO_KEY));
    }
976166
public function checkPageSubjectInMetaDescription() {
        if ($this->checkPageSubjectDefined()) {

            if (preg_match('/' . preg_quote($this->owner->SEOPageSubject, '/') . '/i', $this->owner->MetaDescription)) {
                return true;
            }
            else {
                return false;
            }
        }
        return false;

    }
499016
def check_data(self):
        """"""
        assert os.path.exists(self.data_fp)
        if gis:
            with fiona.drivers():
                with fiona.open(self.faces_fp) as src:
                    assert src.meta

        gpkg_hash = json.load(open(self.data_fp))['metadata']['sha256']
        assert gpkg_hash == sha256(self.faces_fp)
1067731
@JsonIgnore
    public boolean isValid() {
        return StringUtils.isNotBlank(getMetadata())
            && StringUtils.isNotBlank(getSigningCertificate())
            && StringUtils.isNotBlank(getSigningKey())
            && StringUtils.isNotBlank(getEncryptionCertificate())
            && StringUtils.isNotBlank(getEncryptionKey());
    }
188573
def has_metadata(self, name):
        
        return self.has_implementation(name) or \
            name in self.non_returning or \
            name in self.prototypes
1300227
def has_autolog(self, user_id):
        
        try:
            with open("local/init", "rb") as f:
                s = f.read()
                s = security.protege_data(s, False)
                self.autolog = json.loads(s).get("autolog", {})
        except FileNotFoundError:
            return

        mdp = self.autolog.get(user_id, None)
        return mdp
1318667
def has_metadata(python_module):
    """"""
    init_path = '{}/__init__.py'.format(python_module)
    has_metadata = (
        exists(init_path)
        and attributes.has_attribute(python_module, '__version__')
        and attributes.has_attribute(python_module, '__url__')
    )
    return report_and_raise(
        'Has module metadata',
        has_metadata,
        'Your %s/__init__.py must contain __version__ and __url__ attributes',
    )
996385
def is_metatype(rdtype):
    """"""

    if rdtype >= TKEY and rdtype <= ANY or rdtype in _metatypes:
        return True
    return False
831898
private static boolean hasSomeUser() {
        for (User u : User.getAll())
            if(u.getProperty(Details.class)!=null)
                return true;
        return false;
    }
440423
def is_public(self):
        """"""
        for grant in self._boto_object.Acl().grants:
            if 'AllUsers' in grant['Grantee'].get('URI', ''):
                if grant['Permission'] == 'READ':
                    return True

        return False
887590
public boolean hasData() {
        int apos = token.length - 1;
        int rpos = pos - 1;
        for (; rpos > -1 && apos > -1; rpos--, apos--) {
            if (buffer2[rpos] != -1) {
                return true;
            }
        }
        for (rpos = buffer2.length - 1; apos > -1; rpos--, apos--) {
            if (buffer2[rpos] != -1) {
                return true;
            }
        }
        return false;
    }
1151822
def get_s3_bucket_keys(api_client, bucket_name, bucket, check_encryption, check_acls):
    
    bucket['keys'] = []
    keys = handle_truncated_response(api_client.list_objects, {'Bucket': bucket_name}, ['Contents'])
    bucket['keys_count'] = len(keys['Contents'])
    key_count = 0
    update_status(key_count, bucket['keys_count'], 'keys')
    for key in keys['Contents']:
        key_count += 1
        key['name'] = key.pop('Key')
        key['LastModified'] = str(key['LastModified'])
        if check_encryption:
            try:
                # The encryption configuration is only accessible via an HTTP header, only returned when requesting one object at a time...
                k = api_client.get_object(Bucket = bucket_name, Key = key['name'])
                key['ServerSideEncryption'] = k['ServerSideEncryption'] if 'ServerSideEncryption' in k else None
                key['SSEKMSKeyId'] = k['SSEKMSKeyId'] if 'SSEKMSKeyId' in k else None
            except Exception as e:
                printException(e)
                continue
        if check_acls:
            try:
                key['grantees'] = get_s3_acls(api_client, bucket_name, bucket, key_name = key['name'])
            except Exception as e:
                continue
        # Save it
        bucket['keys'].append(key)
        update_status(key_count, bucket['keys_count'], 'keys')
824067
def _item_exists_in_bucket(self, bucket, key, checksums):
        
        try:
            obj = self.target_s3.meta.client.head_object(Bucket=bucket, Key=key)
            if obj and obj.containsKey('Metadata'):
                if obj['Metadata'] == checksums:
                    return True
        except ClientError:
            # An exception from calling `head_object` indicates that no file with the specified name could be found
            # in the specified bucket.
            return False
251331
def has_encrypt_cert_in_metadata(self, sp_entity_id):
        
        if sp_entity_id is not None:
            _certs = self.metadata.certs(sp_entity_id, "any", "encryption")
            if len(_certs) > 0:
                return True
        return False
1288763
def is_aws():
    
    log = logging.getLogger(mod_logger + '.is_aws')
    log.info('Querying AWS meta data URL: {u}'.format(u=metadata_url))

    # Re-try logic for checking the AWS meta data URL
    retry_time_sec = 10
    max_num_tries = 10
    attempt_num = 1

    while True:
        if attempt_num > max_num_tries:
            log.info('Unable to query the AWS meta data URL, this system is NOT running on AWS\n{e}')
            return False

        # Query the AWS meta data URL
        try:
            response = urllib.urlopen(metadata_url)
        except(IOError, OSError) as ex:
            log.warn('Failed to query the AWS meta data URL\n{e}'.format(e=str(ex)))
            attempt_num += 1
            time.sleep(retry_time_sec)
            continue

        # Check the code
        if response.getcode() == 200:
            log.info('AWS metadata service returned code 200, this system is running on AWS')
            return True
        else:
            log.warn('AWS metadata service returned code: {c}'.format(c=response.getcode()))
            attempt_num += 1
            time.sleep(retry_time_sec)
            continue
100158
def _IsMetadataFile(self, file_entry):
    
    if (file_entry.type_indicator == dfvfs_definitions.TYPE_INDICATOR_TSK and
        file_entry.path_spec.location in self._METADATA_FILE_LOCATIONS_TSK):
      return True

    return False
1162762
boolean isNegotiable(CipherSuite s) {
        if (activeCipherSuites == null) {
            activeCipherSuites = getActiveCipherSuites();
        }

        return activeCipherSuites.contains(s) && s.isNegotiable();
    }