import _datetime


def string_to_time(s):
    """Return a time from the string that was encoded by 'time_to_string'.
    This will only be guaranteed to produce valid output for strings
    produced using that function

    Args:
         s (str): String to convert to time
    Returns:
         datetime.time: Time object created from string
    """
    t = _datetime.time.fromisoformat(s)

    if t.tzinfo is None:
        # assume this is a UTC time
        t = t.replace(tzinfo=_datetime.timezone.utc)
    else:
        t = t.astimezone(_datetime.timezone.utc)

    return t