def parse(self, text, base=None, shift_dates=True):
        """Parses text into a Date object.

        Args:
          text: String representation of one date, or an offset from a date. Will be
              interpreted as local time, unless "UTC" appears somewhere in the text.
          base: Starting point for this Date. Used if the text represents an hour,
              or an offset.
          shift_dates: If the date is earlier than self.today(), and the year is not
              specified, shift it to the future. True by default.
              Set to False if you want to set a day in the past without referencing
              the year. For example, today is 10/25/2010. Parsing "10/24" with
              shift_dates=True will return a date of 10/24/2011. If
              shift_dates=False, will return a date of 10/24/2010.

        Returns:
          Date object.

        Raises:
          ParsingError: Given text could not be parsed.
        """
        local_datetime = None
        day = None
        all_day = False
        try:
            # Unlikely anyone uses this, but if so, it's done in one shot
            all_info = datetime.datetime.strptime(
                text, ACCEPTED_DAY_TIME_FORMAT)
        except __HOLE__:
            pass
        else:
            return Date(local_datetime=all_info, all_day=False)

        day_token, _, time_token = split_string(text, _DAY_TIME_TOKENIZERS)
        if not (day_token or time_token):
            raise ParsingError(text)

        past_time_to_tomorrow = False
        if day_token:
            day = self.determine_day(day_token, shift_dates)
            if day is None:
                # If we couldn't figure out the day...
                # ...Calendar will shift times that already happened to tomorrow
                past_time_to_tomorrow = True
                # ...Maybe the day_token is actually a time_token
                time_token = day_token
                if base:
                    # ... and we'll use the starting point passed in.
                    day = base
            else:
                # If there's no time token, we're parsing an all day date.
                all_day = not bool(time_token)

        if time_token:
            if time_token.startswith('+'):
                delta = determine_duration(time_token.lstrip('+'))
                if delta and not day:
                    # Durations go off of right now.
                    day = self.now()
            else:
                time_offset = self.determine_time(time_token)
                if time_offset is None:
                    delta = None
                else:
                    if past_time_to_tomorrow and self._time_has_passed(time_offset):
                        delta = datetime.timedelta(hours=time_offset.hour + 24,
                                                   minutes=time_offset.minute)
                    else:
                        delta = datetime.timedelta(hours=time_offset.hour,
                                                   minutes=time_offset.minute)
                    if not day:
                        # Hour/minutes (i.e. not durations) go off of the date.
                        day = self.today()
            if delta is not None:
                local_datetime = day + delta
        else:
            local_datetime = day

        if local_datetime:
            return Date(local_datetime=local_datetime, all_day=all_day)
        else:
            raise ParsingError(text)
dataset/ETHPy150Open vinitkumar/googlecl/src/googlecl/calendar/date.py/DateParser.parse