def METHOD_NAME(datestr):
    try:
        return pandas.METHOD_NAME(datestr)
    except pandas.errors.OutOfBoundsDatetime as exc:
        # parse and clamp to upper or lower range
        try:
            date = dateutil.parser.parse(datestr)
            if date >= pandas.Timestamp.max:
                return pandas.Timestamp.max
            elif date <= pandas.Timestamp.min:
                return pandas.Timestamp.min
        except dateutil.parser.ParserError:
            pass
        raise exc