from typing import Union
from datetime import datetime


def _timestamp_to_datetime(timestamp: Union[str, int, float]) -> datetime:
    """
    Converts an int-timestamp with millisecond precision
    :param timestamp: A timestamp that describes elapsed milliseconds
    :type timestamp: Union[str, int, float]
    :return: The datetime object
    :rtype: datetime
    """
    return datetime.fromtimestamp(float(timestamp) / 1000.0)