from datetime import datetime
import pytz


def from_timestamp(value):
    """Transform a timestamp in a tz-aware datetime."""
    if isinstance(value, int) or isinstance(value, float):
        return datetime.fromtimestamp(value, pytz.utc)
    return None