from dateutil import tz
from datetime import datetime


def get_human_time(timestamp, timezone=None):
    """Get human-readable timestamp from UNIX UTC timestamp.

    Args:
        timestamp (int): UNIX UTC timestamp.
        timezone (optional): Explicit timezone (e.g: "America/Chicago").

    Returns:
        str: Formatted human-readable date in ISO format (UTC), with
             time zone added.

    Example:
        >>> get_human_time(1565092435, timezone='Europe/Paris')
        >>> 2019-08-06T11:53:55.000000+02:00
        which corresponds to the UTC time appended the timezone format
        to help with display and retrieval of the date localized.
    """
    if timezone is not None:  # get timezone from arg
        to_zone = tz.gettz(timezone)
    else:  # auto-detect locale
        to_zone = tz.tzlocal()
    dt_utc = datetime.utcfromtimestamp(timestamp)
    dt_tz = dt_utc.replace(tzinfo=to_zone)
    timeformat = '%Y-%m-%dT%H:%M:%S.%f%z'
    date_str = datetime.strftime(dt_tz, timeformat)
    core_str = date_str[:-2]
    tz_str = date_str[-2:]
    date_str = f'{core_str}:{tz_str}'
    return date_str