def _merge_before_set(
        self,
        existing,
        value,
        identifier: SourceMetadata | None = None,
        context_merge=empty,
        list_merge="merge",
    ):
        """
        Merge the new value being set with the existing value before set
        Returns the merged value and the updated identifier (for inspecting).
        """
        # context_merge may come from file_scope or env_scope
        if context_merge is empty:
            context_merge = self.get("MERGE_ENABLED_FOR_DYNACONF")

        if isinstance(value, dict):
            local_merge = value.pop(
                "dynaconf_merge", value.pop("dynaconf_merge_unique", None)
            )
            if local_merge not in (True, False, None) and not value:
                # In case `dynaconf_merge:` holds value not boolean - ref #241
                value = local_merge

            if local_merge or (context_merge and local_merge is not False):
                identifier = (
                    identifier._replace(merged=True) if identifier else None
                )
                value = object_merge(existing, value, list_merge=list_merge)

        if isinstance(value, (list, tuple)):
            value = list(value)
            local_merge = None
            unique = False
            if "dynaconf_merge" in value:
                value.remove("dynaconf_merge")
                local_merge = True
            elif "dynaconf_merge_unique" in value:
                value.remove("dynaconf_merge_unique")
                local_merge = True
                unique = True

            if local_merge or (context_merge and local_merge is not False):
                identifier = (
                    identifier._replace(merged=True) if identifier else None
                )
                value = object_merge(existing, value, unique=unique)
        return value, identifier

        Merge the new value being set with the existing value before set
        Returns the merged value and the updated identifier (for inspecting).
        
dynaconf/base.py