<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datetime_to_utc(ts):
 """Convert a timestamp to UTC+0 timezone. Returns the given datetime object converted to a date with UTC+0 timezone. For naive datetimes, it will be assumed that they are in UTC+0. When the timezone is wrong, UTC+0 will be set as default (using `dateutil.tz.tzutc` object). :param dt: timestamp to convert :returns: a datetime object :raises InvalidDateError: when the given parameter is not an instance of datetime """

    if not isinstance(ts, datetime.datetime):
        msg = '<%s> object' % type(ts)
        raise InvalidDateError(date=msg)

    if not ts.tzinfo:
        ts = ts.replace(tzinfo=dateutil.tz.tzutc())

    try:
        ts = ts.astimezone(dateutil.tz.tzutc())
    except ValueError:
        logger.warning("Date %s str does not have a valid timezone", ts)
        logger.warning("Date converted to UTC removing timezone info")
        ts = ts.replace(tzinfo=dateutil.tz.tzutc()).astimezone(dateutil.tz.tzutc())

    return ts