def METHOD_NAME(self, source: Source) -> None:  # pragma: no feature-test-cover
    """Copy the user entity data of the source to this source."""
    new_entity_keys = {entity["key"] for entity in self.get("entities", [])}
    # Sometimes the key Quality-time generates for entities needs to change, e.g. when it turns out not to be
    # unique. Create a mapping of old keys to new keys so we can move the entity user data to the new keys
    changed_entity_keys = {
        entity["old_key"]: entity["key"] for entity in self.get("entities", []) if "old_key" in entity
    }
    # Copy the user data of entities, keeping 'orphaned' entity user data around for a while in case the entity
    # returns in a later measurement:
    max_timedelta_to_keep_orphaned_entity_user_data = timedelta(days=21)
    for entity_key, attributes in source.get("entity_user_data", {}).items():
        entity_key = changed_entity_keys.get(entity_key, entity_key)  # noqa: PLW2901
        if entity_key in new_entity_keys:
            if "orphaned_since" in attributes:
                del attributes["orphaned_since"]  # The entity reappeared, remove the orphaned since date/time
        elif "orphaned_since" in attributes:
            orphaned_since = datetime.fromisoformat(attributes["orphaned_since"])
            orphaned_timedelta = datetime.now(tz=orphaned_since.tzinfo) - orphaned_since
            if orphaned_timedelta > max_timedelta_to_keep_orphaned_entity_user_data:
                continue  # Don't copy this user data, it has been orphaned too long
        else:
            # The entity user data refers to a disappeared entity. Keep it around in case the entity
            # returns, but also set the current date/time so we can eventually remove the user data.
            attributes["orphaned_since"] = iso_timestamp()
        self.setdefault("entity_user_data", {})[entity_key] = attributes