def datetime_from_iso8601(value):
    '''
    Turns an ISO8601 formatted date into a datetime object.

    Example::

        inputs.datetime_from_iso8601("2012-01-01T23:30:00+02:00")

    :param str value: The ISO8601-complying string to transform
    :return: A datetime
    :rtype: datetime
    :raises ValueError: if value is an invalid date literal

    '''
    try:
        try:
            return aniso8601.parse_datetime(value)
        except __HOLE__:
            date = aniso8601.parse_date(value)
            return datetime(date.year, date.month, date.day)
    except:
        raise ValueError('Invalid date literal "{0}"'.format(value))
dataset/ETHPy150Open noirbizarre/flask-restplus/flask_restplus/inputs.py/datetime_from_iso8601