def conv_bucket_to_dict(self, bhandle, account, region, bucket_name, exception_map):
        bucket_dict = {}
        grantees = {}
        acl = self.wrap_aws_rate_limited_call(
            bhandle.get_acl
        )
        aclxml = self.wrap_aws_rate_limited_call(
            acl.to_xml
        )
        if '<DisplayName>None</DisplayName>' in aclxml:
            # Boto sometimes returns XML with strings like:
            #   <DisplayName>None</DisplayName>
            # Wait a little while, and it will return the real DisplayName
            # The console will display "Me" as the Grantee when we see these None
            # DisplayNames in boto.
            exc = S3ACLReturnedNoneDisplayName(bucket_name)
            self.slurp_exception((self.index, account, region, bucket_name), exc, exception_map)
        else:
            for grant in acl.acl.grants:

                if grant.display_name == 'None' or grant.display_name == 'null':
                    app.logger.info("Received a bad display name: %s" % grant.display_name)

                if grant.display_name is None:
                    gname = grant.uri
                else:
                    gname = grant.display_name

                if gname in grantees:
                    grantees[gname].append(grant.permission)
                    grantees[gname] = sorted(grantees[gname])
                else:
                    grantees[gname] = [grant.permission]

        bucket_dict['grants'] = grantees

        try:
            policy = self.wrap_aws_rate_limited_call(
                bhandle.get_policy
            )
            policy = json.loads(policy)
            bucket_dict['policy'] = policy
        except boto.exception.S3ResponseError as e:
            # S3ResponseError is raised if there is no policy.
            # Simply ignore.
            pass

        # {} or {'Versioning': 'Enabled'} or {'MfaDelete': 'Disabled', 'Versioning': 'Enabled'}
        bucket_dict['versioning'] = self.wrap_aws_rate_limited_call(
            bhandle.get_versioning_status
        )

        bucket_dict['lifecycle_rules'] = get_lifecycle_rules(bhandle)
        bucket_dict['logging'] = get_logging(bhandle)

        return bucket_dict
Converts the bucket ACL and Policy information into a python dict that we can save.
dataset/ETHPy150Open Netflix/security_monkey/security_monkey/watchers/s3.py/S3.conv_bucket_to_dict