def parse(self, datetimeString, sourceTime=None, version=None):
debug and log.debug('<STR_LIT>')<EOL>datetimeString = re.sub(r'<STR_LIT>', r'<STR_LIT>', datetimeString)<EOL>datetimeString = re.sub(r'<STR_LIT>', r'<STR_LIT>', datetimeString)<EOL>datetimeString = re.sub(r'<STR_LIT>', r'<STR_LIT>', datetimeString)<EOL>if sourceTime:<EOL><INDENT>if isinstance(sourceTime, datetime.datetime):<EOL><INDENT>debug and log.debug('<STR_LIT>')<EOL>sourceTime = sourceTime.timetuple()<EOL><DEDENT>else:<EOL><INDENT>if not isinstance(sourceTime, time.struct_time) andnot isinstance(sourceTime, tuple):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>sourceTime = time.localtime()<EOL><DEDENT>with self.context() as ctx:<EOL><INDENT>s = datetimeString.lower().strip()<EOL>debug and log.debug('<STR_LIT>', s)<EOL>while s:<EOL><INDENT>for parseMeth in (self._partialParseModifier,<EOL>self._partialParseUnits,<EOL>self._partialParseQUnits,<EOL>self._partialParseDateStr,<EOL>self._partialParseDateStd,<EOL>self._partialParseDayStr,<EOL>self._partialParseWeekday,<EOL>self._partialParseTimeStr,<EOL>self._partialParseMeridian,<EOL>self._partialParseTimeStd):<EOL><INDENT>retS, retTime, matched = parseMeth(s, sourceTime)<EOL>if matched:<EOL><INDENT>s, sourceTime = retS.strip(), retTime<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>s = '<STR_LIT>'<EOL><DEDENT>debug and log.debug('<STR_LIT>',<EOL>ctx.hasDate, ctx.hasTime)<EOL>debug and log.debug('<STR_LIT>', s)<EOL><DEDENT>if sourceTime is None:<EOL><INDENT>debug and log.debug('<STR_LIT>', str(sourceTime))<EOL>sourceTime = time.localtime()<EOL><DEDENT><DEDENT>if not isinstance(sourceTime, time.struct_time):<EOL><INDENT>sourceTime = time.struct_time(sourceTime)<EOL><DEDENT>version = self.version if version is None else version<EOL>if version == VERSION_CONTEXT_STYLE:<EOL><INDENT>return sourceTime, ctx<EOL><DEDENT>else:<EOL><INDENT>return sourceTime, ctx.dateTimeFlag<EOL><DEDENT>
Splits the given C{datetimeString} into tokens, finds the regex
patterns that match and then calculates a C{struct_time} value from
the chunks.

If C{sourceTime} is given then the C{struct_time} value will be
calculated from that value, otherwise from the current date/time.

If the C{datetimeString} is parsed and date/time value found, then::

    If C{version} equals to L{VERSION_FLAG_STYLE}, the second item of
    the returned tuple will be a flag to let you know what kind of
    C{struct_time} value is being returned::

        0 = not parsed at all
        1 = parsed as a C{date}
        2 = parsed as a C{time}
        3 = parsed as a C{datetime}

    If C{version} equals to L{VERSION_CONTEXT_STYLE}, the second value
    will be an instance of L{pdtContext}

@type  datetimeString: string
@param datetimeString: date/time text to evaluate
@type  sourceTime:     struct_time
@param sourceTime:     C{struct_time} value to use as the base
@type  version:        integer
@param version:        style version, default will use L{Calendar}
                       parameter version value

@rtype:  tuple
@return: tuple of: modified C{sourceTime} and the result flag/context