'Parse the date/time string into a :class:`datetime.datetime` object.
:param timestr:
Any date/time string using the supported formats.
:param default:
The default datetime object, if this is a datetime object and not
``None``, elements specified in ``timestr`` replace elements in the
default object.
:param ignoretz:
If set ``True``, time zones in parsed strings are ignored and a
naive :class:`datetime.datetime` object is returned.
:param tzinfos:
Additional time zone names / aliases which may be present in the
string. This argument maps time zone names (and optionally offsets
from those time zones) to time zones. This parameter can be a
dictionary with timezone aliases mapping time zone names to time
zones or a function taking two parameters (``tzname`` and
``tzoffset``) and returning a time zone.
The timezones to which the names are mapped can be an integer
offset from UTC in minutes or a :class:`tzinfo` object.
.. doctest::
:options: +NORMALIZE_WHITESPACE
>>> from dateutil.parser import parse
>>> from dateutil.tz import gettz
>>> tzinfos = {"BRST": -10800, "CST": gettz("America/Chicago")}
>>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u\'BRST\', -10800))
>>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
datetime.datetime(2012, 1, 19, 17, 21,
tzinfo=tzfile(\'/usr/share/zoneinfo/America/Chicago\'))
This parameter is ignored if ``ignoretz`` is set.
:param **kwargs:
Keyword arguments as passed to ``_parse()``.
:return:
Returns a :class:`datetime.datetime` object or, if the
``fuzzy_with_tokens`` option is ``True``, returns a tuple, the
first element being a :class:`datetime.datetime` object, the second
a tuple containing the fuzzy tokens.
:raises ValueError:
Raised for invalid or unknown string format, if the provided
:class:`tzinfo` is not in a valid format, or if an invalid date
would be created.
:raises OverflowError:
Raised if the parsed date exceeds the largest valid C integer on
your system.'

def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):

    if (default is None):
        effective_dt = datetime.datetime.now()
        default = datetime.datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
    else:
        effective_dt = default
    (res, skipped_tokens) = self._parse(timestr, **kwargs)
    if (res is None):
        raise ValueError(u'Unknown    string    format')
    if (len(res) == 0):
        raise ValueError(u'String    does    not    contain    a    date.')
    repl = {}
    for attr in (u'year', u'month', u'day', u'hour', u'minute', u'second', u'microsecond'):
        value = getattr(res, attr)
        if (value is not None):
            repl[attr] = value
    if (u'day' not in repl):
        cyear = (default.year if (res.year is None) else res.year)
        cmonth = (default.month if (res.month is None) else res.month)
        cday = (default.day if (res.day is None) else res.day)
        if (cday > monthrange(cyear, cmonth)[1]):
            repl[u'day'] = monthrange(cyear, cmonth)[1]
    ret = default.replace(**repl)
    if ((res.weekday is not None) and (not res.day)):
        ret = (ret + relativedelta.relativedelta(weekday=res.weekday))
    if (not ignoretz):
        if (isinstance(tzinfos, collections.Callable) or (tzinfos and (res.tzname in tzinfos))):
            if isinstance(tzinfos, collections.Callable):
                tzdata = tzinfos(res.tzname, res.tzoffset)
            else:
                tzdata = tzinfos.get(res.tzname)
            if isinstance(tzdata, datetime.tzinfo):
                tzinfo = tzdata
            elif isinstance(tzdata, text_type):
                tzinfo = tz.tzstr(tzdata)
            elif isinstance(tzdata, integer_types):
                tzinfo = tz.tzoffset(res.tzname, tzdata)
            else:
                raise ValueError(u'Offset    must    be    tzinfo    subclass,    tz    string,    or    int    offset.')
            ret = ret.replace(tzinfo=tzinfo)
        elif (res.tzname and (res.tzname in time.tzname)):
            ret = ret.replace(tzinfo=tz.tzlocal())
        elif (res.tzoffset == 0):
            ret = ret.replace(tzinfo=tz.tzutc())
        elif res.tzoffset:
            ret = ret.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset))
    if kwargs.get(u'fuzzy_with_tokens', False):
        return (ret, skipped_tokens)
    else:
        return ret
