from typing import Any


def clean(data: Any) -> Any:
    """Recursively cleans a `dict` or a `list` from 'None' values."""

    if isinstance(data, list):
        return [x for x in map(clean, data) if x is not None]

    if isinstance(data, dict):
        result = {key: clean(value) for key, value in data.items()}
        result = {key: value for key, value in result.items()
                  if value is not None}

        return result

    return data