from typing import Union
from datetime import datetime


def time_from_timestamp(timestamp_in: Union[int, float]) -> datetime:
    """
    Convert timestamp to :py:class:`datetime <datetime.datetime>` object.

    :param timestamp_in: Number representing the epoch.
    :return: :py:class:`datetime <datetime.datetime>` object as a time representation.
    """
    return datetime.fromtimestamp(timestamp_in)