def METHOD_NAME(
    self,
) -> typing.Dict[str, typing.List[typing.Dict]]:
    """
    build a dictionary of the form
    {"identifier": [{"trait_key": "key", "trait_value": "value"}, ...]}
    """
    identity_trait_items = defaultdict(list)
    for item in self.validated_data:
        # item will be in the format:
        # {"identity": {"identifier": "foo"}, "trait_key": "foo", "trait_value": "bar"}
        identity_trait_items[item["identity"]["identifier"]].append(
            dict((k, v) for k, v in item.items() if k != "identity")
        )
    return identity_trait_items