code: def parse_policies(self, fetched_policy, params):
          
          api_client = params['api_client']
          policy = {}
          policy['name'] = fetched_policy.pop('PolicyName')
          policy['id'] = fetched_policy.pop('PolicyId')
          policy['arn'] = fetched_policy.pop('Arn')
          # Download version and document
          policy_version = api_client.get_policy_version(PolicyArn = policy['arn'], VersionId = fetched_policy['DefaultVersionId'])
          policy_version = policy_version['PolicyVersion']
          policy['PolicyDocument'] = policy_version['Document']
          # Get attached IAM entities
          policy['attached_to'] = {}
          attached_entities = handle_truncated_response(api_client.list_entities_for_policy, {'PolicyArn': policy['arn']}, ['PolicyGroups', 'PolicyRoles', 'PolicyUsers'])
          for entity_type in attached_entities:
              resource_type = entity_type.replace('Policy', '').lower()
              if len(attached_entities[entity_type]):
                  policy['attached_to'][resource_type] = []
              for entity in attached_entities[entity_type]:
                  name_field = entity_type.replace('Policy', '')[:-1] + 'Name'
                  resource_name = entity[name_field]
                  policy['attached_to'][resource_type].append({'name': resource_name})
          # Save policy
          self.policies[policy['id']] = policy
docs: Parse a single IAM policy and fetch additional information