return s.find(*args)<EOL>

find(s, sub [,start [,end]]) -> in

    Return the lowest index in s where substring sub is found,
    such that sub is contained within s[start,end].  Optional
    arguments start and end are interpreted as in slice notation.

    Return -1 on failure.


def split(s, sep=None, maxsplit=-<NUM_LIT:1>):

return s.split(sep, maxsplit)<EOL>

split(s [,sep [,maxsplit]]) -> list of strings

    Return a list of the words in the string s, using sep as the
    delimiter string.  If maxsplit is given, splits at no more than
    maxsplit places (resulting in at most maxsplit+1 words).  If sep
    is not specified or is None, any whitespace string is a separator.

    (split and splitfields are synonymous)


return s.rindex(*args)<EOL>

rindex(s, sub [,start [,end]]) -> int

    Like rfind but raises ValueError when the substring is not found.


self.locked = False<EOL>self.queue = deque()<EOL>

Create a new mutex -- initially unlocked.


<EOL>if n == <NUM_LIT:1>:<EOL><INDENT>it = iter(iterable)<EOL>head = list(islice(it, <NUM_LIT:1>))<EOL>if not head:<EOL><INDENT>return []<EOL><DEDENT>if key is None:<EOL><INDENT>return [max(chain(head, it))]<EOL><DEDENT>return [max(chain(head, it), key=key)]<EOL><DEDENT>try:<EOL><INDENT>size = len(iterable)<EOL><DEDENT>except (TypeError, AttributeError):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if n >= size:<EOL><INDENT>return sorted(iterable, key=key, reverse=True)[:n]<EOL><DEDENT><DEDENT>if key is None:<EOL><INDENT>it = izip(iterable, count(<NUM_LIT:0>,-<NUM_LIT:1>))                    <EOL>result = _nlargest(n, it)<EOL>return map(itemgetter(<NUM_LIT:0>), result)                   <EOL><DEDENT>in1, in2 = tee(iterable)<EOL>it = izip(imap(key, in1), count(<NUM_LIT:0>,-<NUM_LIT:1>), in2)             <EOL>result = _nlargest(n, it)<EOL>return map(itemgetter(<NUM_LIT:2>), result)                       <EOL>

Find the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]


if n < <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>it = iter(iterable)<EOL>result = list(islice(it, n))<EOL>if not result:<EOL><INDENT>return result<EOL><DEDENT>_heapify_max(result)<EOL>_heappushpop = _heappushpop_max<EOL>for elem in it:<EOL><INDENT>_heappushpop(result, elem)<EOL><DEDENT>result.sort()<EOL>return result<EOL>

Find the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable)[:n]


heap.append(item)<EOL>_siftdown(heap, <NUM_LIT:0>, len(heap)-<NUM_LIT:1>)<EOL>

Push item onto heap, maintaining the heap invariant.


if n < <NUM_LIT:0>:<EOL><INDENT>return []<EOL><DEDENT>it = iter(iterable)<EOL>result = list(islice(it, n))<EOL>if not result:<EOL><INDENT>return result<EOL><DEDENT>heapify(result)<EOL>_heappushpop = heappushpop<EOL>for elem in it:<EOL><INDENT>_heappushpop(result, elem)<EOL><DEDENT>result.sort(reverse=True)<EOL>return result<EOL>

Find the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, reverse=True)[:n]


if encoding == '<STR_LIT>':<EOL><INDENT>import base64<EOL>return base64.encode(input, output)<EOL><DEDENT>if encoding == '<STR_LIT>':<EOL><INDENT>import quopri<EOL>return quopri.encode(input, output, <NUM_LIT:0>)<EOL><DEDENT>if encoding in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>import uu<EOL>return uu.encode(input, output)<EOL><DEDENT>if encoding in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>return output.write(input.read())<EOL><DEDENT>if encoding in encodetab:<EOL><INDENT>pipethrough(input, encodetab[encoding], output)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % encoding)<EOL><DEDENT>

Encode common content-transfer-encodings (base64, quopri, uuencode).


if encoding == '<STR_LIT>':<EOL><INDENT>import base64<EOL>return base64.decode(input, output)<EOL><DEDENT>if encoding == '<STR_LIT>':<EOL><INDENT>import quopri<EOL>return quopri.decode(input, output)<EOL><DEDENT>if encoding in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>import uu<EOL>return uu.decode(input, output)<EOL><DEDENT>if encoding in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>return output.write(input.read())<EOL><DEDENT>if encoding in decodetab:<EOL><INDENT>pipethrough(input, decodetab[encoding], output)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' % encoding)<EOL><DEDENT>

Decode common content-transfer-encodings (base64, quopri, uuencode).


def unorderable_list_difference(expected, actual, ignore_duplicate=False):

missing = []<EOL>unexpected = []<EOL>while expected:<EOL><INDENT>item = expected.pop()<EOL>try:<EOL><INDENT>actual.remove(item)<EOL><DEDENT>except ValueError:<EOL><INDENT>missing.append(item)<EOL><DEDENT>if ignore_duplicate:<EOL><INDENT>for lst in expected, actual:<EOL><INDENT>try:<EOL><INDENT>while True:<EOL><INDENT>lst.remove(item)<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if ignore_duplicate:<EOL><INDENT>while actual:<EOL><INDENT>item = actual.pop()<EOL>unexpected.append(item)<EOL>try:<EOL><INDENT>while True:<EOL><INDENT>actual.remove(item)<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return missing, unexpected<EOL><DEDENT>return missing, actual<EOL>

Same behavior as sorted_list_difference but
    for lists of unorderable items (like dicts).

    As it does a linear search per item (remove) it
    has O(n*n) performance.


def __new__(_cls, actual, expected, value):

return _tuple.__new__(_cls, (actual, expected, value))<EOL>

Create new instance of Mismatch(actual, expected, value)


<EOL>return dict(zip(self._fields, self))<EOL>

Return a new OrderedDict which maps field names to their values


i = j = <NUM_LIT:0><EOL>missing = []<EOL>unexpected = []<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>e = expected[i]<EOL>a = actual[j]<EOL>if e < a:<EOL><INDENT>missing.append(e)<EOL>i += <NUM_LIT:1><EOL>while expected[i] == e:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT><DEDENT>elif e > a:<EOL><INDENT>unexpected.append(a)<EOL>j += <NUM_LIT:1><EOL>while actual[j] == a:<EOL><INDENT>j += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>i += <NUM_LIT:1><EOL>try:<EOL><INDENT>while expected[i] == e:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT><DEDENT>finally:<EOL><INDENT>j += <NUM_LIT:1><EOL>while actual[j] == a:<EOL><INDENT>j += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>except IndexError:<EOL><INDENT>missing.extend(expected[i:])<EOL>unexpected.extend(actual[j:])<EOL>break<EOL><DEDENT><DEDENT>return missing, unexpected<EOL>

Finds elements in only one or the other of two, sorted input lists.

    Returns a two-element tuple of lists.    The first list contains those
    elements in the "expected" list but not in the "actual" list, and the
    second contains those elements in the "actual" list but not in the
    "expected" list.    Duplicate elements in either input list are ignored.


c = {} <EOL>for elem in iterable:<EOL><INDENT>c[elem] = c.get(elem, <NUM_LIT:0>) + <NUM_LIT:1><EOL><DEDENT>return c<EOL>

Return dict of element counts, in the order they were first seen


OptionContainer.destroy(self)<EOL>for group in self.option_groups:<EOL><INDENT>group.destroy()<EOL><DEDENT>del self.option_list<EOL>del self.option_groups<EOL>del self.formatter<EOL>

Declare that you are done with this OptionParser.  This cleans up
reference cycles so the OptionParser (and all objects referenced by
it) can be garbage-collected promptly.  After calling destroy(), the
OptionParser is unusable.


text_width = max(self.width - self.current_indent, <NUM_LIT:11>)<EOL>indent = "<STR_LIT:U+0020>"*self.current_indent<EOL>return textwrap.fill(text,<EOL>text_width,<EOL>initial_indent=indent,<EOL>subsequent_indent=indent)<EOL>

Format a paragraph of free-form text for inclusion in the
help output at the current indentation level.


<EOL>if s in wordmap:<EOL><INDENT>return s<EOL><DEDENT>else:<EOL><INDENT>possibilities = [word for word in list(wordmap.keys())<EOL>if word.startswith(s)]<EOL>if len(possibilities) == <NUM_LIT:1>:<EOL><INDENT>return possibilities[<NUM_LIT:0>]<EOL><DEDENT>elif not possibilities:<EOL><INDENT>raise BadOptionError(s)<EOL><DEDENT>else:<EOL><INDENT>possibilities.sort()<EOL>raise AmbiguousOptionError(s, possibilities)<EOL><DEDENT><DEDENT>

_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.


return _match_abbrev(opt, self._long_opt)<EOL>

_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.


if option.takes_value():<EOL><INDENT>metavar = option.metavar or option.dest.upper()<EOL>short_opts = [self._short_opt_fmt % (sopt, metavar)<EOL>for sopt in option._short_opts]<EOL>long_opts = [self._long_opt_fmt % (lopt, metavar)<EOL>for lopt in option._long_opts]<EOL><DEDENT>else:<EOL><INDENT>short_opts = option._short_opts<EOL>long_opts = option._long_opts<EOL><DEDENT>if self.short_first:<EOL><INDENT>opts = short_opts + long_opts<EOL><DEDENT>else:<EOL><INDENT>opts = long_opts + short_opts<EOL><DEDENT>return "<STR_LIT:U+002CU+0020>".join(opts)<EOL>

Return a comma-separated list of option strings & metavariables.


return (values, args)<EOL>

check_values(values : Values, args : [string])
-> (values : Values, args : [string])

Check that the supplied option values and leftover arguments are
valid.  Returns the option values and leftover arguments
(possibly adjusted, possibly completely new -- whatever you
like).  Default implementation just returns the passed-in
values; subclasses may override as desired.


Update the option values from an arbitrary dictionary,
using all keys from the dictionary regardless of whether
they have a corresponding attribute in self or not.


if file is None:<EOL><INDENT>file = sys.stdout<EOL><DEDENT>encoding = self._get_encoding(file)<EOL>file.write(self.format_help())<EOL>

print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).


if self.usage:<EOL><INDENT>print(self.get_usage(), file=file)<EOL><DEDENT>

print_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.


def enter(self, delay, priority, action, argument):

time = self.timefunc() + delay<EOL>return self.enterabs(time, priority, action, argument)<EOL>

A variant that specifies the time as a relative time.
        This is actually the more commonly used interface.


<EOL>events = self._queue[:]<EOL>return map(heapq.heappop, [events]*len(events))<EOL>

An ordered list of upcoming events.
        Events are named tuples with fields for:
            time, priority, action, arguments


<EOL>q = self._queue<EOL>delayfunc = self.delayfunc<EOL>timefunc = self.timefunc<EOL>pop = heapq.heappop<EOL>while q:<EOL><INDENT>checked_event = q[<NUM_LIT:0>]<EOL>time, priority, action, argument = checked_event.get_fields()<EOL>now = timefunc()<EOL>if now < time:<EOL><INDENT>delayfunc(time - now)<EOL><DEDENT>else:<EOL><INDENT>event = pop(q)<EOL>if event is checked_event:<EOL><INDENT>action(*argument)<EOL>delayfunc(<NUM_LIT:0>)   <EOL><DEDENT>else:<EOL><INDENT>heapq.heappush(q, event)<EOL><DEDENT><DEDENT><DEDENT>

Execute events until the queue is empty.
        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.
        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.
        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.


return len(self.dict)<EOL>


self.dict = {}<EOL>self.unixfrom = '<STR_LIT>'<EOL>self.headers = lst = []<EOL>self.status = '<STR_LIT>'<EOL>headerseen = "<STR_LIT>"<EOL>firstline = <NUM_LIT:1><EOL>startofline = unread = tell = None<EOL>if hasattr(self.fp, '<STR_LIT>'):<EOL><INDENT>unread = self.fp.unread<EOL><DEDENT>elif self.seekable:<EOL><INDENT>tell = self.fp.tell<EOL><DEDENT>while <NUM_LIT:1>:<EOL><INDENT>if tell:<EOL><INDENT>try:<EOL><INDENT>startofline = tell()<EOL><DEDENT>except IOError:<EOL><INDENT>startofline = tell = None<EOL>self.seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>line = self.fp.readline()<EOL>if not line:<EOL><INDENT>self.status = '<STR_LIT>'<EOL>break<EOL><DEDENT>if firstline and line.startswith('<STR_LIT>'):<EOL><INDENT>self.unixfrom = self.unixfrom + line<EOL>continue<EOL><DEDENT>firstline = <NUM_LIT:0><EOL>if headerseen and line[<NUM_LIT:0>] in '<STR_LIT>':<EOL><INDENT>lst.append(line)<EOL>x = (self.dict[headerseen] + "<STR_LIT>" + line.strip())<EOL>self.dict[headerseen] = x.strip()<EOL>continue<EOL><DEDENT>elif self.iscomment(line):<EOL><INDENT>continue<EOL><DEDENT>elif self.islast(line):<EOL><INDENT>break<EOL><DEDENT>headerseen = self.isheader(line)<EOL>if headerseen:<EOL><INDENT>lst.append(line)<EOL>self.dict[headerseen] = line[len(headerseen)+<NUM_LIT:1>:].strip()<EOL>continue<EOL><DEDENT>elif headerseen is not None:<EOL><INDENT>continue<EOL><DEDENT>else:<EOL><INDENT>if not self.dict:<EOL><INDENT>self.status = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>self.status = '<STR_LIT>'<EOL><DEDENT>if unread:<EOL><INDENT>unread(line)<EOL><DEDENT>elif tell:<EOL><INDENT>self.fp.seek(startofline)<EOL><DEDENT>else:<EOL><INDENT>self.status = self.status + '<STR_LIT>'<EOL><DEDENT>break<EOL><DEDENT><DEDENT>

Read header lines.

        Read header lines up to the entirely blank line that terminates them.
        The (normally blank) line that ends the headers is skipped, but not
        included in the returned list.  If a non-header line ends the headers,
        (which is an error), an attempt is made to backspace over it; it is
        never included in the returned list.

        The variable self.status is set to the empty string if all went well,
        otherwise it is an error message.  The variable self.headers is a
        completely uninterpreted list of lines contained in the header (so
        printing them will reproduce the header exactly as it appears in the
        file).


raw = []<EOL>for h in self.getallmatchingheaders(name):<EOL><INDENT>if h[<NUM_LIT:0>] in '<STR_LIT>':<EOL><INDENT>raw.append(h)<EOL><DEDENT>else:<EOL><INDENT>if raw:<EOL><INDENT>raw.append('<STR_LIT:U+002CU+0020>')<EOL><DEDENT>i = h.find('<STR_LIT::>')<EOL>if i > <NUM_LIT:0>:<EOL><INDENT>addr = h[i+<NUM_LIT:1>:]<EOL><DEDENT>raw.append(addr)<EOL><DEDENT><DEDENT>alladdrs = '<STR_LIT>'.join(raw)<EOL>a = AddressList(alladdrs)<EOL>return a.addresslist<EOL>

Get a list of addresses from a header.

        Retrieves a list of addresses from a header, where each address is a
        tuple as returned by getaddr().  Scans all named headers, so it works
        properly with multiple To: or Cc: headers for example.


if timeval is None:<EOL><INDENT>timeval = time.time()<EOL><DEDENT>timeval = time.gmtime(timeval)<EOL>return "<STR_LIT>" % (<EOL>("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>")[timeval[<NUM_LIT:6>]],<EOL>timeval[<NUM_LIT:2>],<EOL>("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>")[timeval[<NUM_LIT:1>]-<NUM_LIT:1>],<EOL>timeval[<NUM_LIT:0>], timeval[<NUM_LIT:3>], timeval[<NUM_LIT:4>], timeval[<NUM_LIT:5>])<EOL>

Returns time format preferred for Internet standards.

    Sun, 06 Nov 1994 08:49:37 GMT  ; RFC 822, updated by RFC 1123

    According to RFC 1123, day and month names must always be in
    English.  If not for that, this code could use strftime().  It
    can't because strftime() honors the locale and could generate
    non-English names.


if pair[<NUM_LIT:0>]:<EOL><INDENT>return '<STR_LIT:">' + pair[<NUM_LIT:0>] + '<STR_LIT>' + pair[<NUM_LIT:1>] + '<STR_LIT:>>'<EOL><DEDENT>else:<EOL><INDENT>return pair[<NUM_LIT:1>]<EOL><DEDENT>

Dump a (name, address) pair in a canonicalized form.


name = name.lower() + '<STR_LIT::>'<EOL>n = len(name)<EOL>lst = []<EOL>hit = <NUM_LIT:0><EOL>for line in self.headers:<EOL><INDENT>if hit:<EOL><INDENT>if not line[:<NUM_LIT:1>].isspace():<EOL><INDENT>break<EOL><DEDENT><DEDENT>elif line[:n].lower() == name:<EOL><INDENT>hit = <NUM_LIT:1><EOL><DEDENT>if hit:<EOL><INDENT>lst.append(line)<EOL><DEDENT><DEDENT>return lst<EOL>

Get the first header line matching name.

        This is similar to getallmatchingheaders, but it returns only the
        first matching header (and its continuation lines).


if data[<NUM_LIT:9>] is None:<EOL><INDENT>return time.mktime(data[:<NUM_LIT:8>] + (-<NUM_LIT:1>,))<EOL><DEDENT>else:<EOL><INDENT>t = time.mktime(data[:<NUM_LIT:8>] + (<NUM_LIT:0>,))<EOL>return t - data[<NUM_LIT:9>] - time.timezone<EOL><DEDENT>

Turn a 10-tuple as returned by parsedate_tz() into a UTC timestamp.


return name.lower() in self.dict<EOL>

Determine whether a message contains the named header.


return self.getdelimited('<STR_LIT:">', '<STR_LIT>', <NUM_LIT:0>)<EOL>

Get a quote-delimited fragment from self's field.


def __init__(self, fp, seekable = <NUM_LIT:1>):

if seekable == <NUM_LIT:1>:<EOL><INDENT>try:<EOL><INDENT>fp.tell()<EOL><DEDENT>except (AttributeError, IOError):<EOL><INDENT>seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>self.fp = fp<EOL>self.seekable = seekable<EOL>self.startofheaders = None<EOL>self.startofbody = None<EOL>if self.seekable:<EOL><INDENT>try:<EOL><INDENT>self.startofheaders = self.fp.tell()<EOL><DEDENT>except IOError:<EOL><INDENT>self.seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>self.readheaders()<EOL>if self.seekable:<EOL><INDENT>try:<EOL><INDENT>self.startofbody = self.fp.tell()<EOL><DEDENT>except IOError:<EOL><INDENT>self.seekable = <NUM_LIT:0><EOL><DEDENT><DEDENT>

Initialize the class instance and read the headers.


i = line.find('<STR_LIT::>')<EOL>if i > -<NUM_LIT:1>:<EOL><INDENT>return line[:i].lower()<EOL><DEDENT>return None<EOL>

Determine whether a given line is a legal header.

        This method should return the header name, suitably canonicalized.
        You may override this method in order to use Message parsing on tagged
        data in RFC 2822-like formats with special header formats.


if len(s) > <NUM_LIT:1>:<EOL><INDENT>if s.startswith('<STR_LIT:">') and s.endswith('<STR_LIT:">'):<EOL><INDENT>return s[<NUM_LIT:1>:-<NUM_LIT:1>].replace('<STR_LIT>', '<STR_LIT:\\>').replace('<STR_LIT>', '<STR_LIT:">')<EOL><DEDENT>if s.startswith('<STR_LIT:<>') and s.endswith('<STR_LIT:>>'):<EOL><INDENT>return s[<NUM_LIT:1>:-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>return s<EOL>


del self[name] <EOL>self.dict[name.lower()] = value<EOL>text = name + "<STR_LIT>" + value<EOL>for line in text.split("<STR_LIT:\n>"):<EOL><INDENT>self.headers.append(line + "<STR_LIT:\n>")<EOL><DEDENT>

Set the value of a header.

        Note: This is not a perfect inversion of __getitem__, because any
        changed headers get stuck at the end of the raw-headers list rather
        than where the altered header was.


self.commentlist = []<EOL>self.gotonext()<EOL>oldpos = self.pos<EOL>oldcl = self.commentlist<EOL>plist = self.getphraselist()<EOL>self.gotonext()<EOL>returnlist = []<EOL>if self.pos >= len(self.field):<EOL><INDENT>if plist:<EOL><INDENT>returnlist = [('<STR_LIT:U+0020>'.join(self.commentlist), plist[<NUM_LIT:0>])]<EOL><DEDENT><DEDENT>elif self.field[self.pos] in '<STR_LIT>':<EOL><INDENT>self.pos = oldpos<EOL>self.commentlist = oldcl<EOL>addrspec = self.getaddrspec()<EOL>returnlist = [('<STR_LIT:U+0020>'.join(self.commentlist), addrspec)]<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT::>':<EOL><INDENT>returnlist = []<EOL>fieldlen = len(self.field)<EOL>self.pos += <NUM_LIT:1><EOL>while self.pos < len(self.field):<EOL><INDENT>self.gotonext()<EOL>if self.pos < fieldlen and self.field[self.pos] == '<STR_LIT:;>':<EOL><INDENT>self.pos += <NUM_LIT:1><EOL>break<EOL><DEDENT>returnlist = returnlist + self.getaddress()<EOL><DEDENT><DEDENT>elif self.field[self.pos] == '<STR_LIT:<>':<EOL><INDENT>routeaddr = self.getrouteaddr()<EOL>if self.commentlist:<EOL><INDENT>returnlist = [('<STR_LIT:U+0020>'.join(plist) + '<STR_LIT>' +'<STR_LIT:U+0020>'.join(self.commentlist) + '<STR_LIT:)>', routeaddr)]<EOL><DEDENT>else: returnlist = [('<STR_LIT:U+0020>'.join(plist), routeaddr)]<EOL><DEDENT>else:<EOL><INDENT>if plist:<EOL><INDENT>returnlist = [('<STR_LIT:U+0020>'.join(self.commentlist), plist[<NUM_LIT:0>])]<EOL><DEDENT>elif self.field[self.pos] in self.specials:<EOL><INDENT>self.pos += <NUM_LIT:1><EOL><DEDENT><DEDENT>self.gotonext()<EOL>if self.pos < len(self.field) and self.field[self.pos] == '<STR_LIT:U+002C>':<EOL><INDENT>self.pos += <NUM_LIT:1><EOL><DEDENT>return returnlist<EOL>


return self.getdelimited('<STR_LIT:(>', '<STR_LIT>', <NUM_LIT:1>)<EOL>

Get a parenthesis-delimited fragment from self's field.


self.specials = '<STR_LIT>'<EOL>self.pos = <NUM_LIT:0><EOL>self.LWS = '<STR_LIT>'<EOL>self.CR = '<STR_LIT:\r\n>'<EOL>self.atomends = self.specials + self.LWS + self.CR<EOL>self.phraseends = self.atomends.replace('<STR_LIT:.>', '<STR_LIT>')<EOL>self.field = field<EOL>self.commentlist = []<EOL>

Initialize a new instance.

        `field' is an unparsed address header field, containing one or more
        addresses.


<EOL>alist = self.getaddrlist(name)<EOL>if alist:<EOL><INDENT>return alist[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>return (None, None)<EOL><DEDENT>

Get a single address from a header, as a tuple.

        An example return value:
        ('Guido van Rossum', 'guido@cwi.nl')


return list(self.dict.items())<EOL>

Get all of a message's headers.

        Returns a list of name, value tuples.


return self.dict[name.lower()]<EOL>

Get a specific header, as from a dictionary.


try:<EOL><INDENT>data = self[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>return None<EOL><DEDENT>return parsedate(data)<EOL>

Retrieve a date field from a header.

        Retrieves a date field from the named header, returning a tuple
        compatible with time.mktime().


sdlist = []<EOL>while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] in self.LWS:<EOL><INDENT>self.pos += <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:(>':<EOL><INDENT>self.commentlist.append(self.getcomment())<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:[>':<EOL><INDENT>sdlist.append(self.getdomainliteral())<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:.>':<EOL><INDENT>self.pos += <NUM_LIT:1><EOL>sdlist.append('<STR_LIT:.>')<EOL><DEDENT>elif self.field[self.pos] in self.atomends:<EOL><INDENT>break<EOL><DEDENT>else: sdlist.append(self.getatom())<EOL><DEDENT>return '<STR_LIT>'.join(sdlist)<EOL>

Get the complete domain name from an address.


aslist = []<EOL>self.gotonext()<EOL>while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] == '<STR_LIT:.>':<EOL><INDENT>aslist.append('<STR_LIT:.>')<EOL>self.pos += <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:">':<EOL><INDENT>aslist.append('<STR_LIT>' % self.getquote())<EOL><DEDENT>elif self.field[self.pos] in self.atomends:<EOL><INDENT>break<EOL><DEDENT>else: aslist.append(self.getatom())<EOL>self.gotonext()<EOL><DEDENT>if self.pos >= len(self.field) or self.field[self.pos] != '<STR_LIT:@>':<EOL><INDENT>return '<STR_LIT>'.join(aslist)<EOL><DEDENT>aslist.append('<STR_LIT:@>')<EOL>self.pos += <NUM_LIT:1><EOL>self.gotonext()<EOL>return '<STR_LIT>'.join(aslist) + self.getdomain()<EOL>


a = AddressList(address)<EOL>lst = a.addresslist<EOL>if not lst:<EOL><INDENT>return (None, None)<EOL><DEDENT>return lst[<NUM_LIT:0>]<EOL>

Parse an address into a (realname, mailaddr) tuple.


return False<EOL>

Determine whether a line should be skipped entirely.

        You may override this method in order to use Message parsing on tagged
        data in RFC 2822-like formats that support embedded comments or
        free-text data.


return s.replace('<STR_LIT:\\>', '<STR_LIT>').replace('<STR_LIT:">', '<STR_LIT>')<EOL>


plist = []<EOL>while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] in self.LWS:<EOL><INDENT>self.pos += <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:">':<EOL><INDENT>plist.append(self.getquote())<EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:(>':<EOL><INDENT>self.commentlist.append(self.getcomment())<EOL><DEDENT>elif self.field[self.pos] in self.phraseends:<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>plist.append(self.getatom(self.phraseends))<EOL><DEDENT><DEDENT>return plist<EOL>

Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.


return '<STR_LIT>' % self.getdelimited('<STR_LIT:[>', '<STR_LIT>', <NUM_LIT:0>)<EOL>


while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] in self.LWS + '<STR_LIT>':<EOL><INDENT>self.pos = self.pos + <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:(>':<EOL><INDENT>self.commentlist.append(self.getcomment())<EOL><DEDENT>else: break<EOL><DEDENT>

Parse up to the start of the next address.


_complain_ifclosed(self.closed)<EOL>if size is None:<EOL><INDENT>size = self.pos<EOL><DEDENT>elif size < <NUM_LIT:0>:<EOL><INDENT>raise IOError(EINVAL, "<STR_LIT>")<EOL><DEDENT>elif size < self.pos:<EOL><INDENT>self.pos = size<EOL><DEDENT>self.buf = self.getvalue()[:size]<EOL>self.len = size<EOL>

Truncate the file's size.

        If the optional size argument is present, the file is truncated to
        (at most) that size. The size defaults to the current position.
        The current file position is not changed unless the position
        is beyond the new file size.

        If the specified size exceeds the file's current size, the
        file remains unchanged.


_complain_ifclosed(self.closed)<EOL>return False<EOL>

Returns False because StringIO objects are not connected to a
        tty-like device.


if not self.closed:<EOL><INDENT>self.closed = True<EOL>del self.buf, self.pos<EOL><DEDENT>


_complain_ifclosed(self.closed)<EOL>return self.pos<EOL>


_complain_ifclosed(self.closed)<EOL>if self.buflist:<EOL><INDENT>self.buf += '<STR_LIT>'.join(self.buflist)<EOL>self.buflist = []<EOL><DEDENT>return self.buf<EOL>

Retrieve the entire contents of the "file" at any time before
the StringIO object's close() method is called.

The StringIO object can accept either Unicode or 8-bit strings,
but mixing the two may take some care. If both are used, 8-bit
strings that cannot be interpreted as 7-bit ASCII (that use the
8th bit) will cause a UnicodeError to be raised when getvalue()
is called.


def _guess_quote_and_delimiter(self, data, delimiters):

matches = []<EOL>for restr in ('<STR_LIT>', <EOL>'<STR_LIT>',   <EOL>'<STR_LIT>',  <EOL>'<STR_LIT>'):                            <EOL><INDENT>regexp = re.compile(restr, re.DOTALL | re.MULTILINE)<EOL>matches = regexp.findall(data)<EOL>if matches:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if not matches:<EOL><INDENT>return ('<STR_LIT>', False, None, <NUM_LIT:0>)<EOL><DEDENT>quotes = {}<EOL>delims = {}<EOL>spaces = <NUM_LIT:0><EOL>for m in matches:<EOL><INDENT>n = regexp.groupindex['<STR_LIT>'] - <NUM_LIT:1><EOL>key = m[n]<EOL>if key:<EOL><INDENT>quotes[key] = quotes.get(key, <NUM_LIT:0>) + <NUM_LIT:1><EOL><DEDENT>try:<EOL><INDENT>n = regexp.groupindex['<STR_LIT>'] - <NUM_LIT:1><EOL>key = m[n]<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT>if key and (delimiters is None or key in delimiters):<EOL><INDENT>delims[key] = delims.get(key, <NUM_LIT:0>) + <NUM_LIT:1><EOL><DEDENT>try:<EOL><INDENT>n = regexp.groupindex['<STR_LIT>'] - <NUM_LIT:1><EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT>if m[n]:<EOL><INDENT>spaces += <NUM_LIT:1><EOL><DEDENT><DEDENT>quotechar = reduce(lambda a, b, quotes = quotes:<EOL>(quotes[a] > quotes[b]) and a or b, list(quotes.keys()))<EOL>if delims:<EOL><INDENT>delim = reduce(lambda a, b, delims = delims:<EOL>(delims[a] > delims[b]) and a or b, list(delims.keys()))<EOL>skipinitialspace = delims[delim] == spaces<EOL>if delim == '<STR_LIT:\n>': <EOL><INDENT>delim = '<STR_LIT>'<EOL><DEDENT><DEDENT>else:<EOL><INDENT>delim = '<STR_LIT>'<EOL>skipinitialspace = <NUM_LIT:0><EOL><DEDENT>dq_regexp = re.compile(<EOL>r"<STR_LIT>" %{'<STR_LIT>':re.escape(delim), '<STR_LIT>':quotechar}, re.MULTILINE)<EOL>if dq_regexp.search(data):<EOL><INDENT>doublequote = True<EOL><DEDENT>else:<EOL><INDENT>doublequote = False<EOL><DEDENT>return (quotechar, doublequote, delim, skipinitialspace)<EOL>

Looks for text enclosed between two identical quotes
(the probable quotechar) which are preceded and followed
by the same character (the probable delimiter).
For example:
                 ,'some text',
The quote with the most wins, same with the delimiter.
If there is no quotechar the delimiter can't be determined
this way.


return list(iglob(pathname))<EOL>

Return a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.


return os.stat(filename).st_atime<EOL>

Return the last access time of a file, reported by os.stat().


try:<EOL><INDENT>st = os.stat(s)<EOL><DEDENT>except os.error:<EOL><INDENT>return False<EOL><DEDENT>return stat.S_ISDIR(st.st_mode)<EOL>

Return true if the pathname refers to an existing directory.


if not m: return '<STR_LIT>'<EOL>s1 = min(m)<EOL>s2 = max(m)<EOL>for i, c in enumerate(s1):<EOL><INDENT>if c != s2[i]:<EOL><INDENT>return s1[:i]<EOL><DEDENT><DEDENT>return s1<EOL>

Given a list of pathnames, returns the longest common leading component


try:<EOL><INDENT>st = os.stat(path)<EOL><DEDENT>except os.error:<EOL><INDENT>return False<EOL><DEDENT>return stat.S_ISREG(st.st_mode)<EOL>


try:<EOL><INDENT>os.stat(path)<EOL><DEDENT>except os.error:<EOL><INDENT>return False<EOL><DEDENT>return True<EOL>

Test whether a path exists.  Returns False for broken symbolic links


return os.stat(filename).st_ctime<EOL>

Return the metadata change time of a file, reported by os.stat().


return os.stat(filename).st_mtime<EOL>

Return the last modification time of a file, reported by os.stat().


def start_new_thread(function, args, kwargs={}):

if type(args) != type(tuple()):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>if type(kwargs) != type(dict()):<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>global _main<EOL>_main = False<EOL>try:<EOL><INDENT>function(*args, **kwargs)<EOL><DEDENT>except SystemExit:<EOL><INDENT>pass<EOL><DEDENT>except:<EOL><INDENT>_traceback.print_exc()<EOL><DEDENT>_main = True<EOL>global _interrupt<EOL>if _interrupt:<EOL><INDENT>_interrupt = False<EOL>raise KeyboardInterrupt<EOL><DEDENT>

Dummy implementation of thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.


if size is not None:<EOL><INDENT>raise error("<STR_LIT>")<EOL><DEDENT>return <NUM_LIT:0><EOL>

Dummy implementation of thread.stack_size().


if _main:<EOL><INDENT>raise KeyboardInterrupt<EOL><DEDENT>else:<EOL><INDENT>global _interrupt<EOL>_interrupt = True<EOL><DEDENT>

Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.


<EOL>if not self.locked_status:<EOL><INDENT>raise error<EOL><DEDENT>self.locked_status = False<EOL>return True<EOL>


return -<NUM_LIT:1><EOL>

Dummy implementation of thread.get_ident().

    Since this module should only be used when threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.


if waitflag is None or waitflag:<EOL><INDENT>self.locked_status = True<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>if not self.locked_status:<EOL><INDENT>self.locked_status = True<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>

Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.


for test in self:<EOL><INDENT>test.debug()<EOL><DEDENT>

Run the tests without collecting errors in a TestResult


self.shouldStop = True<EOL>

Indicates that the tests should be aborted


return len(self.failures) == len(self.errors) == <NUM_LIT:0><EOL>

Tells whether or not this result was a success


def wraps(wrapped,<EOL>assigned = WRAPPER_ASSIGNMENTS,<EOL>updated = WRAPPER_UPDATES):

return partial(update_wrapper, wrapped=wrapped,<EOL>assigned=assigned, updated=updated)<EOL>

Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().


convert = {<EOL>'<STR_LIT>': [('<STR_LIT>', lambda self, other: not (self < other or self == other)),<EOL>('<STR_LIT>', lambda self, other: self < other or self == other),<EOL>('<STR_LIT>', lambda self, other: not self < other)],<EOL>'<STR_LIT>': [('<STR_LIT>', lambda self, other: not self <= other or self == other),<EOL>('<STR_LIT>', lambda self, other: self <= other and not self == other),<EOL>('<STR_LIT>', lambda self, other: not self <= other)],<EOL>'<STR_LIT>': [('<STR_LIT>', lambda self, other: not (self > other or self == other)),<EOL>('<STR_LIT>', lambda self, other: self > other or self == other),<EOL>('<STR_LIT>', lambda self, other: not self > other)],<EOL>'<STR_LIT>': [('<STR_LIT>', lambda self, other: (not self >= other) or self == other),<EOL>('<STR_LIT>', lambda self, other: self >= other and not self == other),<EOL>('<STR_LIT>', lambda self, other: not self >= other)]<EOL>}<EOL>roots = set(dir(cls)) & set(convert)<EOL>if not roots:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>root = max(roots)       <EOL>for opname, opfunc in convert[root]:<EOL><INDENT>if opname not in roots:<EOL><INDENT>opfunc.__name__ = opname<EOL>opfunc.__doc__ = getattr(int, opname).__doc__<EOL>setattr(cls, opname, opfunc)<EOL><DEDENT><DEDENT>return cls<EOL>

Class decorator that fills in missing ordering methods


return [(key, self[key]) for key in self]<EOL>

D.items() -> list of D's (key, value) pairs, as 2-tuples


for key in self:<EOL><INDENT>yield self[key]<EOL><DEDENT>

D.itervalues() -> an iterator over the values of D


return list(self)<EOL>


for key in self:<EOL><INDENT>yield (key, self[key])<EOL><DEDENT>

D.iteritems() -> an iterator over the (key, value) items of D


try:<EOL><INDENT>key = next(iter(self))<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise KeyError<EOL><DEDENT>value = self[key]<EOL>del self[key]<EOL>return key, value<EOL>

D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.


return iter(self)<EOL>

D.iterkeys() -> an iterator over the keys of D


raise NotImplementedError<EOL>


try:<EOL><INDENT>return self[key]<EOL><DEDENT>except KeyError:<EOL><INDENT>return default<EOL><DEDENT>

D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.


n = len(self)<EOL>for i in range(n//<NUM_LIT:2>):<EOL><INDENT>self[i], self[n-i-<NUM_LIT:1>] = self[n-i-<NUM_LIT:1>], self[i]<EOL><DEDENT>


it = iter(self)<EOL>try:<EOL><INDENT>value = next(it)<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise KeyError<EOL><DEDENT>self.discard(value)<EOL>return value<EOL>

Return the popped value.  Raise KeyError if empty.


v = self[index]<EOL>del self[index]<EOL>return v<EOL>

S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.


def setdefault(self, key, default=None):

try:<EOL><INDENT>return self[key]<EOL><DEDENT>except KeyError:<EOL><INDENT>self[key] = default<EOL><DEDENT>return default<EOL>

D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D


MAX = sys.maxint<EOL>MASK = <NUM_LIT:2> * MAX + <NUM_LIT:1><EOL>n = len(self)<EOL>h = <NUM_LIT> * (n + <NUM_LIT:1>)<EOL>h &= MASK<EOL>for x in self:<EOL><INDENT>hx = hash(x)<EOL>h ^= (hx ^ (hx << <NUM_LIT:16>) ^ <NUM_LIT>)  * <NUM_LIT><EOL>h &= MASK<EOL><DEDENT>h = h * <NUM_LIT> + <NUM_LIT><EOL>h &= MASK<EOL>if h > MAX:<EOL><INDENT>h -= MASK + <NUM_LIT:1><EOL><DEDENT>if h == -<NUM_LIT:1>:<EOL><INDENT>h = <NUM_LIT><EOL><DEDENT>return h<EOL>

Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.


@abstractmethod<EOL><INDENT>def insert(self, index, value):<DEDENT>

raise IndexError<EOL>

S.insert(index, object) -- insert object before index


raise NotImplementedError<EOL>

Remove an element.  Do not raise an exception if absent.


return cls(it)<EOL>

Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.


return sum(<NUM_LIT:1> for v in self if v == value)<EOL>

S.count(value) -> integer -- return number of occurrences of value


def randrange(self, start, stop=None, step=<NUM_LIT:1>, _int=int, _maxwidth=<NUM_LIT:1><<BPF):

<EOL>istart = _int(start)<EOL>if istart != start:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if stop is None:<EOL><INDENT>if istart > <NUM_LIT:0>:<EOL><INDENT>if istart >= _maxwidth:<EOL><INDENT>return self._randbelow(istart)<EOL><DEDENT>return _int(self.random() * istart)<EOL><DEDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>istop = _int(stop)<EOL>if istop != stop:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>width = istop - istart<EOL>if step == <NUM_LIT:1> and width > <NUM_LIT:0>:<EOL><INDENT>if width >= _maxwidth:<EOL><INDENT>return _int(istart + self._randbelow(width))<EOL><DEDENT>return _int(istart + _int(self.random()*width))<EOL><DEDENT>if step == <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>" % (istart, istop, width))<EOL><DEDENT>istep = _int(step)<EOL>if istep != step:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if istep > <NUM_LIT:0>:<EOL><INDENT>n = (width + istep - <NUM_LIT:1>) // istep<EOL><DEDENT>elif istep < <NUM_LIT:0>:<EOL><INDENT>n = (width + istep + <NUM_LIT:1>) // istep<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if n <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if n >= _maxwidth:<EOL><INDENT>return istart + istep*self._randbelow(n)<EOL><DEDENT>return istart + istep*_int(self.random() * n)<EOL>

Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.


if random is None:<EOL><INDENT>random = self.random<EOL><DEDENT>_int = int<EOL>for i in reversed(range(<NUM_LIT:1>, len(x))):<EOL><INDENT>j = _int(random() * (i+<NUM_LIT:1>))<EOL>x[i], x[j] = x[j], x[i]<EOL><DEDENT>

x, random=random.random -> shuffle list x in place; return None.

        Optional arg random is a 0-argument function returning a random
        float in [0.0, 1.0); by default, the standard random.random.


self.seed(x)<EOL>self.gauss_next = None<EOL>

Initialize an instance.

        Optional argument x controls seeding, as for Random.seed().


return self.randrange(a, b+<NUM_LIT:1>)<EOL>

Return random integer in range [a, b], including both end points.


def match(pattern, string, flags=<NUM_LIT:0>):

return _compile(pattern, flags).match(string)<EOL>

Try to apply the pattern at the start of the string, returning
    a match object, or None if no match was found.


def subn(pattern, repl, string, count=<NUM_LIT:0>, flags=<NUM_LIT:0>):

return _compile(pattern, flags).subn(repl, string, count)<EOL>

Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the match object and must
    return a replacement string to be used.


def findall(pattern, string, flags=<NUM_LIT:0>):

return _compile(pattern, flags).findall(string)<EOL>def finditer(pattern, string, flags=<NUM_LIT:0>):<EOL><INDENT>"""<STR_LIT>"""<EOL>return _compile(pattern, flags).finditer(string)<EOL><DEDENT>

Return a list of all non-overlapping matches in the string.

    If one or more groups are present in the pattern, return a
    list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result.


s = list(pattern)<EOL>alphanum = _alphanum<EOL>for i, c in enumerate(pattern):<EOL><INDENT>if c not in alphanum:<EOL><INDENT>if c == "<STR_LIT>":<EOL><INDENT>s[i] = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>s[i] = "<STR_LIT:\\>" + c<EOL><DEDENT><DEDENT><DEDENT>return pattern[:<NUM_LIT:0>].join(s)<EOL>

Escape all non-alphanumeric characters in pattern.


return _compile(pattern, flags)<EOL>

Compile a regular expression pattern, returning a pattern object.


def add_argument(self, *args, **kwargs):

<EOL>chars = self.prefix_chars<EOL>if not args or len(args) == <NUM_LIT:1> and args[<NUM_LIT:0>][<NUM_LIT:0>] not in chars:<EOL><INDENT>if args and '<STR_LIT>' in kwargs:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>kwargs = self._get_positional_kwargs(*args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>kwargs = self._get_optional_kwargs(*args, **kwargs)<EOL><DEDENT>if '<STR_LIT:default>' not in kwargs:<EOL><INDENT>dest = kwargs['<STR_LIT>']<EOL>if dest in self._defaults:<EOL><INDENT>kwargs['<STR_LIT:default>'] = self._defaults[dest]<EOL><DEDENT>elif self.argument_default is not None:<EOL><INDENT>kwargs['<STR_LIT:default>'] = self.argument_default<EOL><DEDENT><DEDENT>action_class = self._pop_action_class(kwargs)<EOL>if not _callable(action_class):<EOL><INDENT>raise ValueError('<STR_LIT>' % (action_class,))<EOL><DEDENT>action = action_class(**kwargs)<EOL>type_func = self._registry_get('<STR_LIT:type>', action.type, action.type)<EOL>if not _callable(type_func):<EOL><INDENT>raise ValueError('<STR_LIT>' % (type_func,))<EOL><DEDENT>if hasattr(self, "<STR_LIT>"):<EOL><INDENT>try:<EOL><INDENT>self._get_formatter()._format_args(action, None)<EOL><DEDENT>except TypeError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>return self._add_action(action)<EOL>

add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...)


self.print_usage(_sys.stderr)<EOL>self.exit(<NUM_LIT:2>, _('<STR_LIT>') % (self.prog, message))<EOL>

error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.


<EOL>if isinstance(o, str):<EOL><INDENT>if isinstance(o, str):<EOL><INDENT>_encoding = self.encoding<EOL>if (_encoding is not None<EOL>and not (_encoding == '<STR_LIT:utf-8>')):<EOL><INDENT>o = o.decode(_encoding)<EOL><DEDENT><DEDENT>if self.ensure_ascii:<EOL><INDENT>return encode_basestring_ascii(o)<EOL><DEDENT>else:<EOL><INDENT>return encode_basestring(o)<EOL><DEDENT><DEDENT>chunks = self.iterencode(o, _one_shot=True)<EOL>if not isinstance(chunks, (list, tuple)):<EOL><INDENT>chunks = list(chunks)<EOL><DEDENT>return '<STR_LIT>'.join(chunks)<EOL>

Return a JSON string representation of a Python data structure.

        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'


def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True,<EOL>allow_nan=True, cls=None, indent=None, separators=None,<EOL>encoding='<STR_LIT:utf-8>', default=None, sort_keys=False, **kw):

<EOL>if (not skipkeys and ensure_ascii and<EOL>check_circular and allow_nan and<EOL>cls is None and indent is None and separators is None and<EOL>encoding == '<STR_LIT:utf-8>' and default is None and not sort_keys and not kw):<EOL><INDENT>return _default_encoder.encode(obj)<EOL><DEDENT>if cls is None:<EOL><INDENT>cls = JSONEncoder<EOL><DEDENT>return cls(<EOL>skipkeys=skipkeys, ensure_ascii=ensure_ascii,<EOL>check_circular=check_circular, allow_nan=allow_nan, indent=indent,<EOL>separators=separators, encoding=encoding, default=default,<EOL>sort_keys=sort_keys, **kw).encode(obj)<EOL>

Serialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``)
    will be skipped instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, all non-ASCII characters are not escaped, and
    the return value may be a ``unicode`` instance. See ``dump`` for details.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.  Since the default item separator is ``', '``,  the
    output might include trailing whitespace when ``indent`` is specified.
    You can use ``separators=(',', ': ')`` to avoid this.

    If ``separators`` is an ``(item_separator, dict_separator)`` tuple
    then it will be used instead of the default ``(', ', ': ')`` separators.
    ``(',', ':')`` is the most compact JSON representation.

    ``encoding`` is the character encoding for str instances, default is UTF-8.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is ``True`` (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.


def decode(self, s, _w=WHITESPACE.match):

obj, end = self.raw_decode(s, idx=_w(s, <NUM_LIT:0>).end())<EOL>end = _w(s, end).end()<EOL>if end != len(s):<EOL><INDENT>raise ValueError(errmsg("<STR_LIT>", s, end, len(s)))<EOL><DEDENT>return obj<EOL>

Return the Python representation of ``s`` (a ``str`` or ``unicode``
        instance containing a JSON document)


def py_scanstring(s, end, encoding=None, strict=True,<EOL>_b=BACKSLASH, _m=STRINGCHUNK.match):

if encoding is None:<EOL><INDENT>encoding = DEFAULT_ENCODING<EOL><DEDENT>chunks = []<EOL>_append = chunks.append<EOL>begin = end - <NUM_LIT:1><EOL>while <NUM_LIT:1>:<EOL><INDENT>chunk = _m(s, end)<EOL>if chunk is None:<EOL><INDENT>raise ValueError(<EOL>errmsg("<STR_LIT>", s, begin))<EOL><DEDENT>end = chunk.end()<EOL>content, terminator = chunk.groups()<EOL>if content:<EOL><INDENT>if not isinstance(content, unicode):<EOL><INDENT>content = unicode(content, encoding)<EOL><DEDENT>_append(content)<EOL><DEDENT>if terminator == '<STR_LIT:">':<EOL><INDENT>break<EOL><DEDENT>elif terminator != '<STR_LIT:\\>':<EOL><INDENT>if strict:<EOL><INDENT>msg = "<STR_LIT>" % (terminator,)<EOL>raise ValueError(errmsg(msg, s, end))<EOL><DEDENT>else:<EOL><INDENT>_append(terminator)<EOL>continue<EOL><DEDENT><DEDENT>try:<EOL><INDENT>esc = s[end]<EOL><DEDENT>except IndexError:<EOL><INDENT>raise ValueError(<EOL>errmsg("<STR_LIT>", s, begin))<EOL><DEDENT>if esc != '<STR_LIT:u>':<EOL><INDENT>try:<EOL><INDENT>char = _b[esc]<EOL><DEDENT>except KeyError:<EOL><INDENT>msg = "<STR_LIT>" + repr(esc)<EOL>raise ValueError(errmsg(msg, s, end))<EOL><DEDENT>end += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>uni = _decode_uXXXX(s, end)<EOL>end += <NUM_LIT:5><EOL>if sys.maxunicode > <NUM_LIT> and<NUM_LIT> <= uni <= <NUM_LIT> and s[end:end + <NUM_LIT:2>] == '<STR_LIT>':<EOL><INDENT>uni2 = _decode_uXXXX(s, end + <NUM_LIT:1>)<EOL>if <NUM_LIT> <= uni2 <= <NUM_LIT>:<EOL><INDENT>uni = <NUM_LIT> + (((uni - <NUM_LIT>) << <NUM_LIT:10>) | (uni2 - <NUM_LIT>))<EOL>end += <NUM_LIT:6><EOL><DEDENT><DEDENT>char = unichr(uni)<EOL><DEDENT>_append(char)<EOL><DEDENT>return u'<STR_LIT>'.join(chunks), end<EOL>

Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote.


res = decoder.match(s)<EOL>if res is None: raise NotANumber(s)<EOL>sign, intpart, fraction, exppart = res.group(<NUM_LIT:1>,<NUM_LIT:2>,<NUM_LIT:3>,<NUM_LIT:4>)<EOL>if sign == '<STR_LIT:+>': sign = '<STR_LIT>'<EOL>if fraction: fraction = fraction[<NUM_LIT:1>:]<EOL>if exppart: expo = int(exppart[<NUM_LIT:1>:])<EOL>else: expo = <NUM_LIT:0><EOL>return sign, intpart, fraction, expo<EOL>

Return (sign, intpart, fraction, expo) or raise an exception:
    sign is '+' or '-'
    intpart is 0 or more digits beginning with a nonzero
    fraction is 0 or more digits
    expo is an integer


if type(x) != type('<STR_LIT>'): x = repr(x)<EOL>try:<EOL><INDENT>sign, intpart, fraction, expo = extract(x)<EOL><DEDENT>except NotANumber:<EOL><INDENT>return x<EOL><DEDENT>intpart, fraction = unexpo(intpart, fraction, expo)<EOL>intpart, fraction = roundfrac(intpart, fraction, digs)<EOL>while intpart and intpart[<NUM_LIT:0>] == '<STR_LIT:0>': intpart = intpart[<NUM_LIT:1>:]<EOL>if intpart == '<STR_LIT>': intpart = '<STR_LIT:0>'<EOL>if digs > <NUM_LIT:0>: return sign + intpart + '<STR_LIT:.>' + fraction<EOL>else: return sign + intpart<EOL>

Format x as [-]ddd.ddd with 'digs' digits after the point
    and at least one digit before.
    If digs <= 0, the point is suppressed.


def _show_warning(message, category, filename, lineno, file=None, line=None):

if file is None:<EOL><INDENT>file = sys.stderr<EOL>if file is None:<EOL><INDENT>return<EOL><DEDENT><DEDENT>try:<EOL><INDENT>file.write(formatwarning(message, category, filename, lineno, line))<EOL><DEDENT>except (IOError, UnicodeError):<EOL><INDENT>pass <EOL><DEDENT>

Hook to write a warning to a file; replace if you like.


def formatwarning(message, category, filename, lineno, line=None):

try:<EOL><INDENT>unicodetype = str<EOL><DEDENT>except NameError:<EOL><INDENT>unicodetype = ()<EOL><DEDENT>try:<EOL><INDENT>message = str(message)<EOL><DEDENT>except UnicodeEncodeError:<EOL><INDENT>pass<EOL><DEDENT>s =  "<STR_LIT>" % (lineno, category.__name__, message)<EOL>line = linecache.getline(filename, lineno) if line is None else line<EOL>if line:<EOL><INDENT>line = line.strip()<EOL>if isinstance(s, unicodetype) and isinstance(line, str):<EOL><INDENT>line = str(line, '<STR_LIT>')<EOL><DEDENT>s += "<STR_LIT>" % line<EOL><DEDENT>if isinstance(s, unicodetype) and isinstance(filename, str):<EOL><INDENT>enc = sys.getfilesystemencoding()<EOL>if enc:<EOL><INDENT>try:<EOL><INDENT>filename = str(filename, enc)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT>s = "<STR_LIT>" % (filename, s)<EOL>return s<EOL>

Function to format a warning the standard way.


def warn(message, category=None, stacklevel=<NUM_LIT:1>):

<EOL>if isinstance(message, Warning):<EOL><INDENT>category = message.__class__<EOL><DEDENT>if category is None:<EOL><INDENT>category = UserWarning<EOL><DEDENT>assert issubclass(category, Warning)<EOL>try:<EOL><INDENT>caller = sys._getframe(stacklevel)<EOL><DEDENT>except ValueError:<EOL><INDENT>globals = sys.__dict__<EOL>lineno = <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>globals = caller.f_globals<EOL>lineno = caller.f_lineno<EOL><DEDENT>if '<STR_LIT>' in globals:<EOL><INDENT>module = globals['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>module = "<STR_LIT>"<EOL><DEDENT>filename = globals.get('<STR_LIT>')<EOL>if filename:<EOL><INDENT>fnl = filename.lower()<EOL>if fnl.endswith(("<STR_LIT>", "<STR_LIT>")):<EOL><INDENT>filename = filename[:-<NUM_LIT:1>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if module == "<STR_LIT:__main__>":<EOL><INDENT>try:<EOL><INDENT>filename = sys.argv[<NUM_LIT:0>]<EOL><DEDENT>except AttributeError:<EOL><INDENT>filename = '<STR_LIT:__main__>'<EOL><DEDENT><DEDENT>if not filename:<EOL><INDENT>filename = module<EOL><DEDENT><DEDENT>registry = globals.setdefault("<STR_LIT>", {})<EOL>warn_explicit(message, category, filename, lineno, module, registry,<EOL>globals)<EOL>

Issue a warning, or maybe ignore it or raise an exception.


def warnpy3k(message, category=None, stacklevel=<NUM_LIT:1>):

if sys.py3kwarning:<EOL><INDENT>if category is None:<EOL><INDENT>category = DeprecationWarning<EOL><DEDENT>warn(message, category, stacklevel+<NUM_LIT:1>)<EOL><DEDENT>

Issue a deprecation warning for Python 3.x related changes.

    Warnings are omitted unless Python is started with the -3 option.


def simplefilter(action, category=Warning, lineno=<NUM_LIT:0>, append=<NUM_LIT:0>):

assert action in ("<STR_LIT:error>", "<STR_LIT:ignore>", "<STR_LIT>", "<STR_LIT:default>", "<STR_LIT>",<EOL>"<STR_LIT>"), "<STR_LIT>" % (action,)<EOL>assert isinstance(lineno, int) and lineno >= <NUM_LIT:0>,"<STR_LIT>"<EOL>item = (action, None, category, None, lineno)<EOL>if append:<EOL><INDENT>filters.append(item)<EOL><DEDENT>else:<EOL><INDENT>filters.insert(<NUM_LIT:0>, item)<EOL><DEDENT>

Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters


def getopt(args, shortopts, longopts = []):

opts = []<EOL>if type(longopts) == type("<STR_LIT>"):<EOL><INDENT>longopts = [longopts]<EOL><DEDENT>else:<EOL><INDENT>longopts = list(longopts)<EOL><DEDENT>while args and args[<NUM_LIT:0>].startswith('<STR_LIT:->') and args[<NUM_LIT:0>] != '<STR_LIT:->':<EOL><INDENT>if args[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>args = args[<NUM_LIT:1>:]<EOL>break<EOL><DEDENT>if args[<NUM_LIT:0>].startswith('<STR_LIT>'):<EOL><INDENT>opts, args = do_longs(opts, args[<NUM_LIT:0>][<NUM_LIT:2>:], longopts, args[<NUM_LIT:1>:])<EOL><DEDENT>else:<EOL><INDENT>opts, args = do_shorts(opts, args[<NUM_LIT:0>][<NUM_LIT:1>:], shortopts, args[<NUM_LIT:1>:])<EOL><DEDENT><DEDENT>return opts, args<EOL>

getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.


i, n = <NUM_LIT:0>, len(pat)<EOL>res = '<STR_LIT>'<EOL>while i < n:<EOL><INDENT>c = pat[i]<EOL>i = i+<NUM_LIT:1><EOL>if c == '<STR_LIT:*>':<EOL><INDENT>res = res + '<STR_LIT>'<EOL><DEDENT>elif c == '<STR_LIT:?>':<EOL><INDENT>res = res + '<STR_LIT:.>'<EOL><DEDENT>elif c == '<STR_LIT:[>':<EOL><INDENT>j = i<EOL>if j < n and pat[j] == '<STR_LIT:!>':<EOL><INDENT>j = j+<NUM_LIT:1><EOL><DEDENT>if j < n and pat[j] == '<STR_LIT:]>':<EOL><INDENT>j = j+<NUM_LIT:1><EOL><DEDENT>while j < n and pat[j] != '<STR_LIT:]>':<EOL><INDENT>j = j+<NUM_LIT:1><EOL><DEDENT>if j >= n:<EOL><INDENT>res = res + '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>stuff = pat[i:j].replace('<STR_LIT:\\>','<STR_LIT>')<EOL>i = j+<NUM_LIT:1><EOL>if stuff[<NUM_LIT:0>] == '<STR_LIT:!>':<EOL><INDENT>stuff = '<STR_LIT>' + stuff[<NUM_LIT:1>:]<EOL><DEDENT>elif stuff[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>stuff = '<STR_LIT:\\>' + stuff<EOL><DEDENT>res = '<STR_LIT>' % (res, stuff)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>res = res + re.escape(c)<EOL><DEDENT><DEDENT>return res + '<STR_LIT>'<EOL>

Translate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.


try:<EOL><INDENT>re_pat = _cache[pat]<EOL><DEDENT>except KeyError:<EOL><INDENT>res = translate(pat)<EOL>if len(_cache) >= _MAXCACHE:<EOL><INDENT>globals()['<STR_LIT>'] = {}<EOL><DEDENT>_cache[pat] = re_pat = re.compile(res)<EOL><DEDENT>return re_pat.match(name) is not None<EOL>

Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.


<EOL>return fnmatchcase(name, pat)<EOL>

Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).


import os<EOL>result=[]<EOL>try:<EOL><INDENT>re_pat = _cache[pat]<EOL><DEDENT>except KeyError:<EOL><INDENT>res = translate(pat)<EOL>if len(_cache) >= _MAXCACHE:<EOL><INDENT>globals()['<STR_LIT>'] = {}<EOL><DEDENT>_cache[pat] = re_pat = re.compile(res)<EOL><DEDENT>match = re_pat.match<EOL>if <NUM_LIT:1>:<EOL><INDENT>for name in names:<EOL><INDENT>if match(name):<EOL><INDENT>result.append(name)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for name in names:<EOL><INDENT>if match(os.path.normcase(name)):<EOL><INDENT>result.append(name)<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>

Return the subset of the list NAMES that match PAT


formatdef, endianness, i = getmode(fmt)<EOL>num = <NUM_LIT:0><EOL>result = <NUM_LIT:0><EOL>while i < len(fmt):<EOL><INDENT>num, i = getNum(fmt, i)<EOL>cur = fmt[i]<EOL>try:<EOL><INDENT>format = formatdef[cur]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise StructError("<STR_LIT>" % cur)<EOL><DEDENT>if num != None:<EOL><INDENT>result += num * format['<STR_LIT:size>']<EOL><DEDENT>else:<EOL><INDENT>result += format['<STR_LIT:size>']<EOL><DEDENT>num = <NUM_LIT:0><EOL>i += <NUM_LIT:1><EOL><DEDENT>return result<EOL>

calcsize(fmt) -> int
    Return size of C struct described by format string fmt.
    See struct.__doc__ for more on format strings.


if size == <NUM_LIT:8>:<EOL><INDENT>MIN_EXP = -<NUM_LIT>  <EOL>MAX_EXP = <NUM_LIT>   <EOL>MANT_DIG = <NUM_LIT>    <EOL>BITS = <NUM_LIT:64><EOL><DEDENT>elif size == <NUM_LIT:4>:<EOL><INDENT>MIN_EXP = -<NUM_LIT>   <EOL>MAX_EXP = <NUM_LIT>    <EOL>MANT_DIG = <NUM_LIT>    <EOL>BITS = <NUM_LIT:32><EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if Q >> BITS:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>sign = Q >> BITS - <NUM_LIT:1><EOL>exp = (Q & ((<NUM_LIT:1> << BITS - <NUM_LIT:1>) - (<NUM_LIT:1> << MANT_DIG - <NUM_LIT:1>))) >> MANT_DIG - <NUM_LIT:1><EOL>mant = Q & ((<NUM_LIT:1> << MANT_DIG - <NUM_LIT:1>) - <NUM_LIT:1>)<EOL>if exp == MAX_EXP - MIN_EXP + <NUM_LIT:2>:<EOL><INDENT>result = float('<STR_LIT>') if mant else float('<STR_LIT>')<EOL><DEDENT>elif exp == <NUM_LIT:0>:<EOL><INDENT>result = math.ldexp(float(mant), MIN_EXP - MANT_DIG)<EOL><DEDENT>else:<EOL><INDENT>mant += <NUM_LIT:1> << MANT_DIG - <NUM_LIT:1><EOL>result = math.ldexp(float(mant), exp + MIN_EXP - MANT_DIG - <NUM_LIT:1>)<EOL><DEDENT>return -result if sign else result<EOL>

Convert a 32-bit or 64-bit integer created
    by float_pack into a Python float.


formatdef, endianness, i = getmode(fmt)<EOL>j = <NUM_LIT:0><EOL>num = <NUM_LIT:0><EOL>result = []<EOL>length = calcsize(fmt)<EOL>if length != len(data):<EOL><INDENT>raise StructError("<STR_LIT>")<EOL><DEDENT>while i < len(fmt):<EOL><INDENT>num, i = getNum(fmt, i)<EOL>cur = fmt[i]<EOL>i += <NUM_LIT:1><EOL>try:<EOL><INDENT>format = formatdef[cur]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise StructError("<STR_LIT>" % cur)<EOL><DEDENT>if not num:<EOL><INDENT>num = <NUM_LIT:1><EOL><DEDENT>if cur == '<STR_LIT:x>':<EOL><INDENT>j += num<EOL><DEDENT>elif cur == '<STR_LIT:s>':<EOL><INDENT>result.append(data[j:j + num])<EOL>j += num<EOL><DEDENT>elif cur == '<STR_LIT:p>':<EOL><INDENT>n = data[j]<EOL>if n >= num:<EOL><INDENT>n = num - <NUM_LIT:1><EOL><DEDENT>result.append(data[j + <NUM_LIT:1>:j + n + <NUM_LIT:1>])<EOL>j += num<EOL><DEDENT>else:<EOL><INDENT>for n in range(num):<EOL><INDENT>result += [format['<STR_LIT>'](data, j, format['<STR_LIT:size>'], endianness)]<EOL>j += format['<STR_LIT:size>']<EOL><DEDENT><DEDENT><DEDENT>return tuple(result)<EOL>

unpack(fmt, string) -> (v1, v2, ...)
       Unpack the string, containing packed C structure data, according
       to fmt.  Requires len(string)==calcsize(fmt).
       See struct.__doc__ for more on format strings.


def b2a_qp(data, quotetabs=False, istext=True, header=False):

MAXLINESIZE = <NUM_LIT><EOL>lf = data.find('<STR_LIT:\n>')<EOL>crlf = lf > <NUM_LIT:0> and data[lf-<NUM_LIT:1>] == '<STR_LIT:\r>'<EOL>inp = <NUM_LIT:0><EOL>linelen = <NUM_LIT:0><EOL>odata = []<EOL>while inp < len(data):<EOL><INDENT>c = data[inp]<EOL>if (c > '<STR_LIT>' or<EOL>c == '<STR_LIT:=>' or<EOL>(header and c == '<STR_LIT:_>') or<EOL>(c == '<STR_LIT:.>' and linelen == <NUM_LIT:0> and (inp+<NUM_LIT:1> == len(data) or<EOL>data[inp+<NUM_LIT:1>] == '<STR_LIT:\n>' or<EOL>data[inp+<NUM_LIT:1>] == '<STR_LIT:\r>')) or<EOL>(not istext and (c == '<STR_LIT:\r>' or c == '<STR_LIT:\n>')) or<EOL>((c == '<STR_LIT:\t>' or c == '<STR_LIT:U+0020>') and (inp + <NUM_LIT:1> == len(data))) or<EOL>(c <= '<STR_LIT:U+0020>' and c != '<STR_LIT:\r>' and c != '<STR_LIT:\n>' and<EOL>(quotetabs or (not quotetabs and (c != '<STR_LIT:\t>' and c != '<STR_LIT:U+0020>'))))):<EOL><INDENT>linelen += <NUM_LIT:3><EOL>if linelen >= MAXLINESIZE:<EOL><INDENT>odata.append('<STR_LIT:=>')<EOL>if crlf: odata.append('<STR_LIT:\r>')<EOL>odata.append('<STR_LIT:\n>')<EOL>linelen = <NUM_LIT:3><EOL><DEDENT>odata.append('<STR_LIT:=>' + two_hex_digits(ord(c)))<EOL>inp += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>if (istext and<EOL>(c == '<STR_LIT:\n>' or (inp+<NUM_LIT:1> < len(data) and c == '<STR_LIT:\r>' and<EOL>data[inp+<NUM_LIT:1>] == '<STR_LIT:\n>'))):<EOL><INDENT>linelen = <NUM_LIT:0><EOL>if (len(odata) > <NUM_LIT:0> and<EOL>(odata[-<NUM_LIT:1>] == '<STR_LIT:U+0020>' or odata[-<NUM_LIT:1>] == '<STR_LIT:\t>')):<EOL><INDENT>ch = ord(odata[-<NUM_LIT:1>])<EOL>odata[-<NUM_LIT:1>] = '<STR_LIT:=>'<EOL>odata.append(two_hex_digits(ch))<EOL><DEDENT>if crlf: odata.append('<STR_LIT:\r>')<EOL>odata.append('<STR_LIT:\n>')<EOL>if c == '<STR_LIT:\r>':<EOL><INDENT>inp += <NUM_LIT:2><EOL><DEDENT>else:<EOL><INDENT>inp += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>if (inp + <NUM_LIT:1> < len(data) and<EOL>data[inp+<NUM_LIT:1>] != '<STR_LIT:\n>' and<EOL>(linelen + <NUM_LIT:1>) >= MAXLINESIZE):<EOL><INDENT>odata.append('<STR_LIT:=>')<EOL>if crlf: odata.append('<STR_LIT:\r>')<EOL>odata.append('<STR_LIT:\n>')<EOL>linelen = <NUM_LIT:0><EOL><DEDENT>linelen += <NUM_LIT:1><EOL>if header and c == '<STR_LIT:U+0020>':<EOL><INDENT>c = '<STR_LIT:_>'<EOL><DEDENT>odata.append(c)<EOL>inp += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>return '<STR_LIT>'.join(odata)<EOL>

quotetabs=True means that tab and space characters are always
       quoted.
       istext=False means that \r and \n are treated as regular characters
       header=True encodes space characters with '_' and requires
       real '_' characters to be quoted.


leninBuf = len(inBuf)<EOL>index = (self.count[<NUM_LIT:0>] >> <NUM_LIT:3>) & <NUM_LIT><EOL>self.count[<NUM_LIT:0>] = self.count[<NUM_LIT:0>] + (leninBuf << <NUM_LIT:3>)<EOL>if self.count[<NUM_LIT:0>] < (leninBuf << <NUM_LIT:3>):<EOL><INDENT>self.count[<NUM_LIT:1>] = self.count[<NUM_LIT:1>] + <NUM_LIT:1><EOL><DEDENT>self.count[<NUM_LIT:1>] = self.count[<NUM_LIT:1>] + (leninBuf >> <NUM_LIT>)<EOL>partLen = <NUM_LIT:64> - index<EOL>if leninBuf >= partLen:<EOL><INDENT>self.input[index:] = list(inBuf[:partLen])<EOL>self._transform(_bytelist2long(self.input))<EOL>i = partLen<EOL>while i + <NUM_LIT> < leninBuf:<EOL><INDENT>self._transform(_bytelist2long(list(inBuf[i:i + <NUM_LIT:64>])))<EOL>i = i + <NUM_LIT:64><EOL><DEDENT>else:<EOL><INDENT>self.input = list(inBuf[i:leninBuf])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>i = <NUM_LIT:0><EOL>self.input = self.input + list(inBuf)<EOL><DEDENT>

Add to the current message.

        Update the md5 object with the string arg. Repeated calls
        are equivalent to a single call with the concatenation of all
        the arguments, i.e. m.update(a); m.update(b) is equivalent
        to m.update(a+b).

        The hash is immediately calculated for all full blocks. The final
        calculation is made in digest(). This allows us to keep an
        intermediate value for the hash, so that we only need to make
        minimal recalculation if we call update() to add moredata to
        the hashed string.


return (x << n) | (x >> (<NUM_LIT:32> - n))<EOL>

Rotate x (32 bit) left n bits circularly.


res = <NUM_LIT:0><EOL>res = res + a + func(b, c, d)<EOL>res = res + x<EOL>res = res + ac<EOL>res = res & <NUM_LIT><EOL>res = _rotateLeft(res, s)<EOL>res = res & <NUM_LIT><EOL>res = res + b<EOL>return res & <NUM_LIT><EOL>

Wrapper for call distribution to functions F, G, H and I.

    This replaces functions FF, GG, HH and II from "Appl. Crypto."
    Rotation is separate from addition to prevent recomputation
    (now summed-up in one function).


crypto = MD5Type()<EOL>if arg:<EOL><INDENT>crypto.update(arg)<EOL><DEDENT>return crypto<EOL>

Return a new md5 crypto object.
    If arg is present, the method call update(arg) is made.


a, b, c, d = A, B, C, D = self.A, self.B, self.C, self.D<EOL>S11, S12, S13, S14 = <NUM_LIT:7>, <NUM_LIT:12>, <NUM_LIT>, <NUM_LIT><EOL>a = XX(F, a, b, c, d, inp[<NUM_LIT:0>], S11, <NUM_LIT>)  <EOL>d = XX(F, d, a, b, c, inp[<NUM_LIT:1>], S12, <NUM_LIT>)  <EOL>c = XX(F, c, d, a, b, inp[<NUM_LIT:2>], S13, <NUM_LIT>)  <EOL>b = XX(F, b, c, d, a, inp[<NUM_LIT:3>], S14, <NUM_LIT>)  <EOL>a = XX(F, a, b, c, d, inp[<NUM_LIT:4>], S11, <NUM_LIT>)  <EOL>d = XX(F, d, a, b, c, inp[<NUM_LIT:5>], S12, <NUM_LIT>)  <EOL>c = XX(F, c, d, a, b, inp[<NUM_LIT:6>], S13, <NUM_LIT>)  <EOL>b = XX(F, b, c, d, a, inp[<NUM_LIT:7>], S14, <NUM_LIT>)  <EOL>a = XX(F, a, b, c, d, inp[<NUM_LIT:8>], S11, <NUM_LIT>)  <EOL>d = XX(F, d, a, b, c, inp[<NUM_LIT:9>], S12, <NUM_LIT>)  <EOL>c = XX(F, c, d, a, b, inp[<NUM_LIT:10>], S13, <NUM_LIT>)  <EOL>b = XX(F, b, c, d, a, inp[<NUM_LIT:11>], S14, <NUM_LIT>)  <EOL>a = XX(F, a, b, c, d, inp[<NUM_LIT:12>], S11, <NUM_LIT>)  <EOL>d = XX(F, d, a, b, c, inp[<NUM_LIT>], S12, <NUM_LIT>)  <EOL>c = XX(F, c, d, a, b, inp[<NUM_LIT>], S13, <NUM_LIT>)  <EOL>b = XX(F, b, c, d, a, inp[<NUM_LIT:15>], S14, <NUM_LIT>)  <EOL>S21, S22, S23, S24 = <NUM_LIT:5>, <NUM_LIT:9>, <NUM_LIT>, <NUM_LIT:20><EOL>a = XX(G, a, b, c, d, inp[<NUM_LIT:1>], S21, <NUM_LIT>)  <EOL>d = XX(G, d, a, b, c, inp[<NUM_LIT:6>], S22, <NUM_LIT>)  <EOL>c = XX(G, c, d, a, b, inp[<NUM_LIT:11>], S23, <NUM_LIT>)  <EOL>b = XX(G, b, c, d, a, inp[<NUM_LIT:0>], S24, <NUM_LIT>)  <EOL>a = XX(G, a, b, c, d, inp[<NUM_LIT:5>], S21, <NUM_LIT>)  <EOL>d = XX(G, d, a, b, c, inp[<NUM_LIT:10>], S22, <NUM_LIT>)  <EOL>c = XX(G, c, d, a, b, inp[<NUM_LIT:15>], S23, <NUM_LIT>)  <EOL>b = XX(G, b, c, d, a, inp[<NUM_LIT:4>], S24, <NUM_LIT>)  <EOL>a = XX(G, a, b, c, d, inp[<NUM_LIT:9>], S21, <NUM_LIT>)  <EOL>d = XX(G, d, a, b, c, inp[<NUM_LIT>], S22, <NUM_LIT>)  <EOL>c = XX(G, c, d, a, b, inp[<NUM_LIT:3>], S23, <NUM_LIT>)  <EOL>b = XX(G, b, c, d, a, inp[<NUM_LIT:8>], S24, <NUM_LIT>)  <EOL>a = XX(G, a, b, c, d, inp[<NUM_LIT>], S21, <NUM_LIT>)  <EOL>d = XX(G, d, a, b, c, inp[<NUM_LIT:2>], S22, <NUM_LIT>)  <EOL>c = XX(G, c, d, a, b, inp[<NUM_LIT:7>], S23, <NUM_LIT>)  <EOL>b = XX(G, b, c, d, a, inp[<NUM_LIT:12>], S24, <NUM_LIT>)  <EOL>S31, S32, S33, S34 = <NUM_LIT:4>, <NUM_LIT:11>, <NUM_LIT:16>, <NUM_LIT><EOL>a = XX(H, a, b, c, d, inp[<NUM_LIT:5>], S31, <NUM_LIT>)  <EOL>d = XX(H, d, a, b, c, inp[<NUM_LIT:8>], S32, <NUM_LIT>)  <EOL>c = XX(H, c, d, a, b, inp[<NUM_LIT:11>], S33, <NUM_LIT>)  <EOL>b = XX(H, b, c, d, a, inp[<NUM_LIT>], S34, <NUM_LIT>)  <EOL>a = XX(H, a, b, c, d, inp[<NUM_LIT:1>], S31, <NUM_LIT>)  <EOL>d = XX(H, d, a, b, c, inp[<NUM_LIT:4>], S32, <NUM_LIT>)  <EOL>c = XX(H, c, d, a, b, inp[<NUM_LIT:7>], S33, <NUM_LIT>)  <EOL>b = XX(H, b, c, d, a, inp[<NUM_LIT:10>], S34, <NUM_LIT>)  <EOL>a = XX(H, a, b, c, d, inp[<NUM_LIT>], S31, <NUM_LIT>)  <EOL>d = XX(H, d, a, b, c, inp[<NUM_LIT:0>], S32, <NUM_LIT>)  <EOL>c = XX(H, c, d, a, b, inp[<NUM_LIT:3>], S33, <NUM_LIT>)  <EOL>b = XX(H, b, c, d, a, inp[<NUM_LIT:6>], S34, <NUM_LIT>)  <EOL>a = XX(H, a, b, c, d, inp[<NUM_LIT:9>], S31, <NUM_LIT>)  <EOL>d = XX(H, d, a, b, c, inp[<NUM_LIT:12>], S32, <NUM_LIT>)  <EOL>c = XX(H, c, d, a, b, inp[<NUM_LIT:15>], S33, <NUM_LIT>)  <EOL>b = XX(H, b, c, d, a, inp[<NUM_LIT:2>], S34, <NUM_LIT>)  <EOL>S41, S42, S43, S44 = <NUM_LIT:6>, <NUM_LIT:10>, <NUM_LIT:15>, <NUM_LIT><EOL>a = XX(I, a, b, c, d, inp[<NUM_LIT:0>], S41, <NUM_LIT>)  <EOL>d = XX(I, d, a, b, c, inp[<NUM_LIT:7>], S42, <NUM_LIT>)  <EOL>c = XX(I, c, d, a, b, inp[<NUM_LIT>], S43, <NUM_LIT>)  <EOL>b = XX(I, b, c, d, a, inp[<NUM_LIT:5>], S44, <NUM_LIT>)  <EOL>a = XX(I, a, b, c, d, inp[<NUM_LIT:12>], S41, <NUM_LIT>)  <EOL>d = XX(I, d, a, b, c, inp[<NUM_LIT:3>], S42, <NUM_LIT>)  <EOL>c = XX(I, c, d, a, b, inp[<NUM_LIT:10>], S43, <NUM_LIT>)  <EOL>b = XX(I, b, c, d, a, inp[<NUM_LIT:1>], S44, <NUM_LIT>)  <EOL>a = XX(I, a, b, c, d, inp[<NUM_LIT:8>], S41, <NUM_LIT>)  <EOL>d = XX(I, d, a, b, c, inp[<NUM_LIT:15>], S42, <NUM_LIT>)  <EOL>c = XX(I, c, d, a, b, inp[<NUM_LIT:6>], S43, <NUM_LIT>)  <EOL>b = XX(I, b, c, d, a, inp[<NUM_LIT>], S44, <NUM_LIT>)  <EOL>a = XX(I, a, b, c, d, inp[<NUM_LIT:4>], S41, <NUM_LIT>)  <EOL>d = XX(I, d, a, b, c, inp[<NUM_LIT:11>], S42, <NUM_LIT>)  <EOL>c = XX(I, c, d, a, b, inp[<NUM_LIT:2>], S43, <NUM_LIT>)  <EOL>b = XX(I, b, c, d, a, inp[<NUM_LIT:9>], S44, <NUM_LIT>)  <EOL>A = (A + a) & <NUM_LIT><EOL>B = (B + b) & <NUM_LIT><EOL>C = (C + c) & <NUM_LIT><EOL>D = (D + d) & <NUM_LIT><EOL>self.A, self.B, self.C, self.D = A, B, C, D<EOL>

Basic MD5 step transforming the digest based on the input.

        Note that if the Mysterious Constants are arranged backwards
        in little-endian order and decrypted with the DES they produce
        OCCULT MESSAGES!


try:<EOL><INDENT>del _dialects[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise Error("<STR_LIT>")<EOL><DEDENT>

Delete the name/dialect mapping associated with a string name.\n
    csv.unregister_dialect(name)


return list(_dialects)<EOL>

Return a list of all know dialect names
    names = csv.list_dialects()


def count_repetitions(self, ctx, maxcount):

count = <NUM_LIT:0><EOL>real_maxcount = ctx.state.end - ctx.string_position<EOL>if maxcount < real_maxcount and maxcount != MAXREPEAT:<EOL><INDENT>real_maxcount = maxcount<EOL><DEDENT>code_position = ctx.code_position<EOL>string_position = ctx.string_position<EOL>ctx.skip_code(<NUM_LIT:4>)<EOL>reset_position = ctx.code_position<EOL>while count < real_maxcount:<EOL><INDENT>ctx.code_position = reset_position<EOL>self.dispatch(ctx.peek_code(), ctx)<EOL>if ctx.has_matched is False: <EOL><INDENT>break<EOL><DEDENT>count += <NUM_LIT:1><EOL><DEDENT>ctx.has_matched = None<EOL>ctx.code_position = code_position<EOL>ctx.string_position = string_position<EOL>return count<EOL>

Returns the number of repetitions of a single item, starting from the
        current string position. The code pointer is expected to point to a
        REPEAT_ONE operation (with the repeated 4 ahead).


groups = []<EOL>for indices in self.regs[<NUM_LIT:1>:]:<EOL><INDENT>if indices[<NUM_LIT:0>] >= <NUM_LIT:0>:<EOL><INDENT>groups.append(self.string[indices[<NUM_LIT:0>]:indices[<NUM_LIT:1>]])<EOL><DEDENT>else:<EOL><INDENT>groups.append(default)<EOL><DEDENT><DEDENT>return tuple(groups)<EOL>

Returns a tuple containing all the subgroups of the match. The
        default argument is used for groups that did not participate in the
        match (defaults to None).


def search(self, string, pos=<NUM_LIT:0>, endpos=sys.maxsize):

state = _State(string, pos, endpos, self.flags)<EOL>if state.search(self._code):<EOL><INDENT>return SRE_Match(self, state)<EOL><DEDENT>else:<EOL><INDENT>return None<EOL><DEDENT>

Scan through string looking for a location where this regular
        expression produces a match, and return a corresponding MatchObject
        instance. Return None if no position in the string matches the
        pattern.


self.set_dispatcher.reset(char)<EOL>save_position = ctx.code_position<EOL>result = None<EOL>while result is None:<EOL><INDENT>result = self.set_dispatcher.dispatch(ctx.peek_code(), ctx)<EOL><DEDENT>ctx.code_position = save_position<EOL>return result<EOL>

Checks whether a character matches set of arbitrary length. Assumes
        the code pointer is at the first member of the set.


def split(self, string, maxsplit=<NUM_LIT:0>):

splitlist = []<EOL>state = _State(string, <NUM_LIT:0>, sys.maxsize, self.flags)<EOL>n = <NUM_LIT:0><EOL>last = state.start<EOL>while not maxsplit or n < maxsplit:<EOL><INDENT>state.reset()<EOL>state.string_position = state.start<EOL>if not state.search(self._code):<EOL><INDENT>break<EOL><DEDENT>if state.start == state.string_position: <EOL><INDENT>if last == state.end:                <EOL><INDENT>break<EOL><DEDENT>state.start += <NUM_LIT:1><EOL>continue<EOL><DEDENT>splitlist.append(string[last:state.start])<EOL>if self.groups:<EOL><INDENT>match = SRE_Match(self, state)<EOL>splitlist += (list(match.groups(None)))<EOL><DEDENT>n += <NUM_LIT:1><EOL>last = state.start = state.string_position<EOL><DEDENT>splitlist.append(string[last:state.end])<EOL>return splitlist<EOL>

Split string by the occurrences of pattern.


groupdict = {}<EOL>for key, value in list(self.re.groupindex.items()):<EOL><INDENT>groupdict[key] = self._get_slice(value, default)<EOL><DEDENT>return groupdict<EOL>

Return a dictionary containing all the named subgroups of the match.
        The default argument is used for groups that did not participate in the
        match (defaults to None).


if self._microsecond != <NUM_LIT:0>:<EOL><INDENT>s = "<STR_LIT>" % (self._second, self._microsecond)<EOL><DEDENT>elif self._second != <NUM_LIT:0>:<EOL><INDENT>s = "<STR_LIT>" % self._second<EOL><DEDENT>else:<EOL><INDENT>s = "<STR_LIT>"<EOL><DEDENT>module = "<STR_LIT>" if self.__class__ is time else "<STR_LIT>"<EOL>s= "<STR_LIT>" % (module + self.__class__.__name__,<EOL>self._hour, self._minute, s)<EOL>if self._tzinfo is not None:<EOL><INDENT>assert s[-<NUM_LIT:1>:] == "<STR_LIT:)>"<EOL>s = s[:-<NUM_LIT:1>] + "<STR_LIT>" % self._tzinfo + "<STR_LIT:)>"<EOL><DEDENT>return s<EOL>


t = _time.time()<EOL>return cls.fromtimestamp(t)<EOL>


assert <NUM_LIT:1> <= month <= <NUM_LIT:12>, '<STR_LIT>'<EOL>dim = _days_in_month(year, month)<EOL>assert <NUM_LIT:1> <= day <= dim, ('<STR_LIT>' % dim)<EOL>return (_days_before_year(year) +<EOL>_days_before_month(year, month) +<EOL>day)<EOL>

year, month, day -> ordinal, considering 01-Jan-0001 as day 1.


def replace(self, hour=None, minute=None, second=None, microsecond=None,<EOL>tzinfo=True):

if hour is None:<EOL><INDENT>hour = self.hour<EOL><DEDENT>if minute is None:<EOL><INDENT>minute = self.minute<EOL><DEDENT>if second is None:<EOL><INDENT>second = self.second<EOL><DEDENT>if microsecond is None:<EOL><INDENT>microsecond = self.microsecond<EOL><DEDENT>if tzinfo is True:<EOL><INDENT>tzinfo = self.tzinfo<EOL><DEDENT>return time.__new__(type(self),<EOL>hour, minute, second, microsecond, tzinfo)<EOL>

Return a new time with new values for the specified fields.


return self._hour<EOL>


return self._microseconds<EOL>


return year % <NUM_LIT:4> == <NUM_LIT:0> and (year % <NUM_LIT:100> != <NUM_LIT:0> or year % <NUM_LIT> == <NUM_LIT:0>)<EOL>


raise NotImplementedError("<STR_LIT>")<EOL>


<EOL>n -= <NUM_LIT:1><EOL>n400, n = divmod(n, _DI400Y)<EOL>year = n400 * <NUM_LIT> + <NUM_LIT:1>   <EOL>n100, n = divmod(n, _DI100Y)<EOL>n4, n = divmod(n, _DI4Y)<EOL>n1, n = divmod(n, <NUM_LIT>)<EOL>year += n100 * <NUM_LIT:100> + n4 * <NUM_LIT:4> + n1<EOL>if n1 == <NUM_LIT:4> or n100 == <NUM_LIT:4>:<EOL><INDENT>assert n == <NUM_LIT:0><EOL>return year-<NUM_LIT:1>, <NUM_LIT:12>, <NUM_LIT><EOL><DEDENT>leapyear = n1 == <NUM_LIT:3> and (n4 != <NUM_LIT> or n100 == <NUM_LIT:3>)<EOL>assert leapyear == _is_leap(year)<EOL>month = (n + <NUM_LIT:50>) >> <NUM_LIT:5><EOL>preceding = _DAYS_BEFORE_MONTH[month] + (month > <NUM_LIT:2> and leapyear)<EOL>if preceding > n:  <EOL><INDENT>month -= <NUM_LIT:1><EOL>preceding -= _DAYS_IN_MONTH[month] + (month == <NUM_LIT:2> and leapyear)<EOL><DEDENT>n -= preceding<EOL>assert <NUM_LIT:0> <= n < _days_in_month(year, month)<EOL>return year, month, n+<NUM_LIT:1><EOL>

ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.


datetime -> minutes east of UTC (negative for west of UTC)


assert <NUM_LIT:1> <= month <= <NUM_LIT:12>, '<STR_LIT>'<EOL>return _DAYS_BEFORE_MONTH[month] + (month > <NUM_LIT:2> and _is_leap(year))<EOL>

year, month -> number of days in year preceding first day of month.


return _ymd2ord(self._year, self._month, self._day)<EOL>

Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.


datetime -> DST offset in minutes east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.


return time(self.hour, self.minute, self.second, self.microsecond,<EOL>self._tzinfo)<EOL>


if self._tzinfo is None:<EOL><INDENT>return None<EOL><DEDENT>offset = self._tzinfo.utcoffset(None)<EOL>offset = _check_utc_offset("<STR_LIT>", offset)<EOL>if offset is not None:<EOL><INDENT>offset = timedelta._create(<NUM_LIT:0>, offset * <NUM_LIT>, <NUM_LIT:0>, True)<EOL><DEDENT>return offset<EOL>

Return the timezone offset in minutes east of UTC (negative west of
        UTC).


if isinstance(other, date):<EOL><INDENT>days1 = self.toordinal()<EOL>days2 = other.toordinal()<EOL>return timedelta._create(days1 - days2, <NUM_LIT:0>, <NUM_LIT:0>, False)<EOL><DEDENT>if isinstance(other, timedelta):<EOL><INDENT>return self._add_timedelta(other, -<NUM_LIT:1>)<EOL><DEDENT>return NotImplemented<EOL>

Subtract two dates, or a date and a timedelta.


s = ("<STR_LIT>" % (self._year, self._month, self._day, sep) +<EOL>_format_time(self._hour, self._minute, self._second,<EOL>self._microsecond))<EOL>off = self._utcoffset()<EOL>if off is not None:<EOL><INDENT>if off < <NUM_LIT:0>:<EOL><INDENT>sign = "<STR_LIT:->"<EOL>off = -off<EOL><DEDENT>else:<EOL><INDENT>sign = "<STR_LIT:+>"<EOL><DEDENT>hh, mm = divmod(off, <NUM_LIT>)<EOL>s += "<STR_LIT>" % (sign, hh, mm)<EOL><DEDENT>return s<EOL>

Return the time formatted according to ISO.

        This is 'YYYY-MM-DD HH:MM:SS.mmmmmm', or 'YYYY-MM-DD HH:MM:SS' if
        self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM' or 'YYYY-MM-DD HH:MM:SS+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.


return self._minute<EOL>


y, m, d = self.year, self.month, self.day<EOL>hh, mm, ss = self.hour, self.minute, self.second<EOL>offset = self._utcoffset()<EOL>if offset:  <EOL><INDENT>mm -= offset<EOL>y, m, d, hh, mm, ss, _ = _normalize_datetime(<EOL>y, m, d, hh, mm, ss, <NUM_LIT:0>, ignore_overflow=True)<EOL><DEDENT>return _build_struct_time(y, m, d, hh, mm, ss, <NUM_LIT:0>)<EOL>

Return UTC time tuple compatible with time.gmtime().


return self._tzinfo<EOL>


def replace(self, year=None, month=None, day=None, hour=None,<EOL>minute=None, second=None, microsecond=None, tzinfo=True):

if year is None:<EOL><INDENT>year = self.year<EOL><DEDENT>if month is None:<EOL><INDENT>month = self.month<EOL><DEDENT>if day is None:<EOL><INDENT>day = self.day<EOL><DEDENT>if hour is None:<EOL><INDENT>hour = self.hour<EOL><DEDENT>if minute is None:<EOL><INDENT>minute = self.minute<EOL><DEDENT>if second is None:<EOL><INDENT>second = self.second<EOL><DEDENT>if microsecond is None:<EOL><INDENT>microsecond = self.microsecond<EOL><DEDENT>if tzinfo is True:<EOL><INDENT>tzinfo = self.tzinfo<EOL><DEDENT>return datetime.__new__(type(self),<EOL>year, month, day, hour, minute, second,<EOL>microsecond, tzinfo)<EOL>

Return a new datetime with new values for the specified fields.


L = [self._year, self._month, self._day,  <EOL>self._hour, self._minute, self._second, self._microsecond]<EOL>if L[-<NUM_LIT:1>] == <NUM_LIT:0>:<EOL><INDENT>del L[-<NUM_LIT:1>]<EOL><DEDENT>if L[-<NUM_LIT:1>] == <NUM_LIT:0>:<EOL><INDENT>del L[-<NUM_LIT:1>]<EOL><DEDENT>s = "<STR_LIT:U+002CU+0020>".join(map(str, L))<EOL>module = "<STR_LIT>" if self.__class__ is datetime else "<STR_LIT>"<EOL>s = "<STR_LIT>" % (module + self.__class__.__name__, s)<EOL>if self._tzinfo is not None:<EOL><INDENT>assert s[-<NUM_LIT:1>:] == "<STR_LIT:)>"<EOL>s = s[:-<NUM_LIT:1>] + "<STR_LIT>" % self._tzinfo + "<STR_LIT:)>"<EOL><DEDENT>return s<EOL>


if self._tzinfo is None:<EOL><INDENT>return None<EOL><DEDENT>offset = self._tzinfo.dst(None)<EOL>offset = _check_utc_offset("<STR_LIT>", offset)<EOL>if offset is not None:<EOL><INDENT>offset = timedelta._create(<NUM_LIT:0>, offset * <NUM_LIT>, <NUM_LIT:0>, True)<EOL><DEDENT>return offset<EOL>

Return 0 if DST is not in effect, or the DST offset (in minutes
        eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.


return _build_struct_time(self._year, self._month, self._day,<EOL><NUM_LIT:0>, <NUM_LIT:0>, <NUM_LIT:0>, -<NUM_LIT:1>)<EOL>

Return local time tuple compatible with time.localtime().


return self.isoformat(sep='<STR_LIT:U+0020>')<EOL>


<EOL>return "<STR_LIT>" % (str(self._year).zfill(<NUM_LIT:4>), str(self._month).zfill(<NUM_LIT:2>), str(self._day).zfill(<NUM_LIT:2>))<EOL>

Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html


return self._second<EOL>


assert <NUM_LIT:1> <= month <= <NUM_LIT:12>, month<EOL>if month == <NUM_LIT:2> and _is_leap(year):<EOL><INDENT>return <NUM_LIT><EOL><DEDENT>return _DAYS_IN_MONTH[month]<EOL>

year, month -> number of days in that month in that year.


if isinstance(other, timedelta):<EOL><INDENT>return self._add_timedelta(other, <NUM_LIT:1>)<EOL><DEDENT>return NotImplemented<EOL>


t = _time.time()<EOL>return cls.fromtimestamp(t, tz)<EOL>

Construct a datetime from time.time() and optional time zone info.


if not isinstance(other, timedelta):<EOL><INDENT>return NotImplemented<EOL><DEDENT>return self._add_timedelta(other, <NUM_LIT:1>)<EOL>


def replace(self, year=None, month=None, day=None):

if year is None:<EOL><INDENT>year = self._year<EOL><DEDENT>if month is None:<EOL><INDENT>month = self._month<EOL><DEDENT>if day is None:<EOL><INDENT>day = self._day<EOL><DEDENT>return date.__new__(type(self), year, month, day)<EOL>

Return a new date with new values for the specified fields.


if self._tzinfo is None:<EOL><INDENT>return None<EOL><DEDENT>name = self._tzinfo.tzname(self)<EOL>_check_tzname(name)<EOL>return name<EOL>

Return the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.


return self._year<EOL>


return self._month<EOL>


def __new__(cls, hour=<NUM_LIT:0>, minute=<NUM_LIT:0>, second=<NUM_LIT:0>, microsecond=<NUM_LIT:0>, tzinfo=None):

<EOL>hour, minute, second, microsecond = _check_time_fields(<EOL>hour, minute, second, microsecond)<EOL>_check_tzinfo_arg(tzinfo)<EOL>self = object.__new__(cls)<EOL>self._hour = hour<EOL>self._minute = minute<EOL>self._second = second<EOL>self._microsecond = microsecond<EOL>self._tzinfo = tzinfo<EOL>self._hashcode = -<NUM_LIT:1><EOL>return self<EOL>

Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)


@classmethod<EOL><INDENT>def fromtimestamp(cls, timestamp, tz=None):<DEDENT>

_check_tzinfo_arg(tz)<EOL>converter = _time.localtime if tz is None else _time.gmtime<EOL>self = cls._from_timestamp(converter, timestamp, tz)<EOL>if tz is not None:<EOL><INDENT>self = tz.fromutc(self)<EOL><DEDENT>return self<EOL>

Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.


<EOL>self.length = <NUM_LIT:0><EOL>self.count = [<NUM_LIT:0>, <NUM_LIT:0>]<EOL>self.input = []<EOL>self.init()<EOL>


imax = len(list) // <NUM_LIT:4><EOL>hl = [<NUM_LIT:0>] * imax<EOL>j = <NUM_LIT:0><EOL>i = <NUM_LIT:0><EOL>while i < imax:<EOL><INDENT>b0 = ord(list[j]) << <NUM_LIT><EOL>b1 = ord(list[j+<NUM_LIT:1>]) << <NUM_LIT:16><EOL>b2 = ord(list[j+<NUM_LIT:2>]) << <NUM_LIT:8><EOL>b3 = ord(list[j+<NUM_LIT:3>])<EOL>hl[i] = b0 | b1 | b2 | b3<EOL>i = i+<NUM_LIT:1><EOL>j = j+<NUM_LIT:4><EOL><DEDENT>return hl<EOL>

Transform a list of characters into a list of longs.


self.length = <NUM_LIT:0><EOL>self.input = []<EOL>self.H0 = <NUM_LIT><EOL>self.H1 = <NUM_LIT><EOL>self.H2 = <NUM_LIT><EOL>self.H3 = <NUM_LIT><EOL>self.H4 = <NUM_LIT><EOL>

Initialize the message-digest and set all fields to zero.


leninBuf = len(inBuf)<EOL>index = (self.count[<NUM_LIT:1>] >> <NUM_LIT:3>) & <NUM_LIT><EOL>self.count[<NUM_LIT:1>] = self.count[<NUM_LIT:1>] + (leninBuf << <NUM_LIT:3>)<EOL>if self.count[<NUM_LIT:1>] < (leninBuf << <NUM_LIT:3>):<EOL><INDENT>self.count[<NUM_LIT:0>] = self.count[<NUM_LIT:0>] + <NUM_LIT:1><EOL><DEDENT>self.count[<NUM_LIT:0>] = self.count[<NUM_LIT:0>] + (leninBuf >> <NUM_LIT>)<EOL>partLen = <NUM_LIT:64> - index<EOL>if leninBuf >= partLen:<EOL><INDENT>self.input[index:] = list(inBuf[:partLen])<EOL>self._transform(_bytelist2longBigEndian(self.input))<EOL>i = partLen<EOL>while i + <NUM_LIT> < leninBuf:<EOL><INDENT>self._transform(_bytelist2longBigEndian(list(inBuf[i:i+<NUM_LIT:64>])))<EOL>i = i + <NUM_LIT:64><EOL><DEDENT>else:<EOL><INDENT>self.input = list(inBuf[i:leninBuf])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>i = <NUM_LIT:0><EOL>self.input = self.input + list(inBuf)<EOL><DEDENT>

Add to the current message.

        Update the md5 object with the string arg. Repeated calls
        are equivalent to a single call with the concatenation of all
        the arguments, i.e. m.update(a); m.update(b) is equivalent
        to m.update(a+b).

        The hash is immediately calculated for all full blocks. The final
        calculation is made in digest(). It will calculate 1-2 blocks,
        depending on how much padding we have to add. This allows us to
        keep an intermediate value for the hash, so that we only need to
        make minimal recalculation if we call update() to add more data
        to the hashed string.


<EOL>s = b'<STR_LIT>'<EOL>pack = struct.pack<EOL>while n > <NUM_LIT:0>:<EOL><INDENT>s = pack('<STR_LIT>', n & <NUM_LIT>) + s<EOL>n = n >> <NUM_LIT:32><EOL><DEDENT>for i in range(len(s)):<EOL><INDENT>if s[i] != '<STR_LIT>':<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>s = '<STR_LIT>'<EOL>i = <NUM_LIT:0><EOL><DEDENT>s = s[i:]<EOL>if blocksize > <NUM_LIT:0> and len(s) % blocksize:<EOL><INDENT>s = (blocksize - len(s) % blocksize) * '<STR_LIT>' + s<EOL><DEDENT>return s<EOL>

Convert a long integer to a byte string.

    If optional blocksize is given and greater than zero, pad the front
    of the byte string with binary zeros so that the length is a multiple
    of blocksize.


return (type(self), (self.default_factory,), None, None, self.iteritems())<EOL>

__reduce__ must return a 5-tuple as follows:

   - factory function
   - tuple of args for the factory function
   - additional state (here None)
   - sequence iterator (here None)
   - dictionary iterator (yielding successive (key, value) pairs

   This API is used by pickle.py and copy.py.


def render(self, only_line=False, colored=False):

source_line = self.location.source_line().rstrip("<STR_LIT:\n>")<EOL>highlight_line = bytearray(re.sub(r"<STR_LIT>", "<STR_LIT:U+0020>", source_line), "<STR_LIT:utf-8>")<EOL>for hilight in self.highlights:<EOL><INDENT>if hilight.line() == self.location.line():<EOL><INDENT>lft, rgt = hilight.column_range()<EOL>highlight_line[lft:rgt] = bytearray("<STR_LIT>", "<STR_LIT:utf-8>") * (rgt - lft)<EOL><DEDENT><DEDENT>lft, rgt = self.location.column_range()<EOL>if rgt == lft: <EOL><INDENT>rgt = lft + <NUM_LIT:1><EOL><DEDENT>highlight_line[lft:rgt] = bytearray("<STR_LIT>", "<STR_LIT:utf-8>") * (rgt - lft)<EOL>if only_line:<EOL><INDENT>location = "<STR_LIT>" % (self.location.source_buffer.name, self.location.line())<EOL><DEDENT>else:<EOL><INDENT>location = str(self.location)<EOL><DEDENT>notes = list(self.notes)<EOL>if self.level != "<STR_LIT>":<EOL><INDENT>expanded_location = self.location.expanded_from<EOL>while expanded_location is not None:<EOL><INDENT>notes.insert(<NUM_LIT:0>, Diagnostic("<STR_LIT>",<EOL>"<STR_LIT>", {},<EOL>self.location.expanded_from))<EOL>expanded_location = expanded_location.expanded_from<EOL><DEDENT><DEDENT>rendered_notes = reduce(list.__add__, [note.render(only_line, colored)<EOL>for note in notes], [])<EOL>if colored:<EOL><INDENT>if self.level in ("<STR_LIT:error>", "<STR_LIT>"):<EOL><INDENT>level_color = <NUM_LIT> <EOL><DEDENT>elif self.level == "<STR_LIT>":<EOL><INDENT>level_color = <NUM_LIT> <EOL><DEDENT>else: <EOL><INDENT>level_color = <NUM_LIT:30> <EOL><DEDENT>return [<EOL>"<STR_LIT>".<EOL>format(location, level_color, self.level, self.message()),<EOL>source_line,<EOL>"<STR_LIT>".format(highlight_line.decode("<STR_LIT:utf-8>"))<EOL>] + rendered_notes<EOL><DEDENT>else:<EOL><INDENT>return [<EOL>"<STR_LIT>".format(location, self.level, self.message()),<EOL>source_line,<EOL>highlight_line.decode("<STR_LIT:utf-8>")<EOL>] + rendered_notes<EOL><DEDENT>

Returns the human-readable location of the diagnostic in the source,
the formatted message, the source line corresponding
to ``location`` and a line emphasizing the problematic
locations in the source line using ASCII art, as a list of lines.
Appends the result of calling :meth:`render` on ``notes``, if any.

For example: ::

    <input>:1:8-9: error: cannot add integer and string
    x + (1 + "a")
         ~ ^ ~~~

:param only_line: (bool) If true, only print line number, not line and column range


self._appended_notes += notes<EOL>yield<EOL>del self._appended_notes[-len(notes):]<EOL>

A context manager that appends ``note`` to every diagnostic processed by
this engine.


def compare(left, right, compare_locs=False):

if type(left) != type(right):<EOL><INDENT>return False<EOL><DEDENT>if isinstance(left, ast.AST):<EOL><INDENT>for field in left._fields:<EOL><INDENT>if not compare(getattr(left, field), getattr(right, field)):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>if compare_locs:<EOL><INDENT>for loc in left._locs:<EOL><INDENT>if getattr(left, loc) != getattr(right, loc):<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>return True<EOL><DEDENT>elif isinstance(left, list):<EOL><INDENT>if len(left) != len(right):<EOL><INDENT>return False<EOL><DEDENT>for left_elt, right_elt in zip(left, right):<EOL><INDENT>if not compare(left_elt, right_elt):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>return True<EOL><DEDENT>else:<EOL><INDENT>return left == right<EOL><DEDENT>

An AST comparison function. Returns ``True`` if all fields in
``left`` are equal to fields in ``right``; if ``compare_locs`` is
true, all locations should match as well.


if isinstance(obj, list):<EOL><INDENT>return list(filter(lambda x: x is not None, map(self.visit, obj)))<EOL><DEDENT>elif isinstance(obj, ast.AST):<EOL><INDENT>return self._visit_one(obj)<EOL><DEDENT>else:<EOL><INDENT>return obj<EOL><DEDENT>

Visit a node or a list of nodes. Other values are ignored


for field_name in node._fields:<EOL><INDENT>setattr(node, field_name, self.visit(getattr(node, field_name)))<EOL><DEDENT>return node<EOL>

Called if no explicit visitor function exists for a node.


return ast.Continue(loc=stmt_loc, keyword_loc=stmt_loc)<EOL>


@action(Seq(Loc("<STR_LIT>"), Tok("<STR_LIT>"), Rule("<STR_LIT>"), Loc("<STR_LIT::>"), Rule("<STR_LIT>")))<EOL><INDENT>def funcdef__26(self, def_loc, ident_tok, args, colon_loc, suite):<DEDENT>

return ast.FunctionDef(name=ident_tok.value, args=args, returns=None,<EOL>body=suite, decorator_list=[],<EOL>at_locs=[], keyword_loc=def_loc, name_loc=ident_tok.loc,<EOL>colon_loc=colon_loc, arrow_loc=None,<EOL>loc=def_loc.join(suite[-<NUM_LIT:1>].loc))<EOL>

(2.6, 2.7) funcdef: 'def' NAME parameters ':' suite


@action(Seq(Loc("<STR_LIT>"), List(Tok("<STR_LIT>"), "<STR_LIT:U+002C>", trailing=False)))<EOL><INDENT>def nonlocal_stmt(self, nonlocal_loc, names):<DEDENT>

return ast.Nonlocal(names=list(map(lambda x: x.value, names)),<EOL>name_locs=list(map(lambda x: x.loc, names)),<EOL>keyword_loc=nonlocal_loc, loc=nonlocal_loc.join(names[-<NUM_LIT:1>].loc))<EOL>

(3.0-) nonlocal_stmt: 'nonlocal' NAME (',' NAME)*


return Alt(inner_rule, Eps(), loc=loc)<EOL>

Shorthand for ``Alt(inner_rule, Eps())``


@action(Alt(Seq(Star(SeqN(<NUM_LIT:0>, varargslist__26_1, Tok("<STR_LIT:U+002C>"))),<EOL>Alt(varargslist__26_2, varargslist__26_3)),<EOL>Seq(List(varargslist__26_1, "<STR_LIT:U+002C>", trailing=True),<EOL>varargslist__26_4)))<EOL><INDENT>def varargslist__26(self, fparams, args):<DEDENT>

for fparam, default_opt in fparams:<EOL><INDENT>if default_opt:<EOL><INDENT>equals_loc, default = default_opt<EOL>args.equals_locs.append(equals_loc)<EOL>args.defaults.append(default)<EOL><DEDENT>elif len(args.defaults) > <NUM_LIT:0>:<EOL><INDENT>error = diagnostic.Diagnostic(<EOL>"<STR_LIT>", "<STR_LIT>", {},<EOL>fparam.loc, [args.args[-<NUM_LIT:1>].loc.join(args.defaults[-<NUM_LIT:1>].loc)])<EOL>self.diagnostic_engine.process(error)<EOL><DEDENT>args.args.append(fparam)<EOL><DEDENT>def fparam_loc(fparam, default_opt):<EOL><INDENT>if default_opt:<EOL><INDENT>equals_loc, default = default_opt<EOL>return fparam.loc.join(default.loc)<EOL><DEDENT>else:<EOL><INDENT>return fparam.loc<EOL><DEDENT><DEDENT>if args.loc is None:<EOL><INDENT>args.loc = fparam_loc(*fparams[<NUM_LIT:0>]).join(fparam_loc(*fparams[-<NUM_LIT:1>]))<EOL><DEDENT>elif len(fparams) > <NUM_LIT:0>:<EOL><INDENT>args.loc = args.loc.join(fparam_loc(*fparams[<NUM_LIT:0>]))<EOL><DEDENT>return args<EOL>


for arg in args:<EOL><INDENT>if isinstance(arg, ast.keyword):<EOL><INDENT>call.keywords.append(arg)<EOL><DEDENT>elif len(call.keywords) > <NUM_LIT:0>:<EOL><INDENT>error = diagnostic.Diagnostic(<EOL>"<STR_LIT>", "<STR_LIT>", {},<EOL>arg.loc, [call.keywords[-<NUM_LIT:1>].loc])<EOL>self.diagnostic_engine.process(error)<EOL><DEDENT>else:<EOL><INDENT>call.args.append(arg)<EOL><DEDENT><DEDENT>return call<EOL>

arglist: (argument ',')* (argument [','] |
                                     '*' test (',' argument)* [',' '**' test] |
                                     '**' test)


@action(Seq(Rule("<STR_LIT>"), Alt(Rule("<STR_LIT>"), Rule("<STR_LIT>"))))<EOL><INDENT>def decorated(self, decorators, classfuncdef):<DEDENT>

classfuncdef.at_locs = list(map(lambda x: x[<NUM_LIT:0>], decorators))<EOL>classfuncdef.decorator_list = list(map(lambda x: x[<NUM_LIT:1>], decorators))<EOL>classfuncdef.loc = classfuncdef.loc.join(decorators[<NUM_LIT:0>][<NUM_LIT:0>])<EOL>return classfuncdef<EOL>

decorated: decorators (classdef | funcdef)


@llrule(loc, lambda parser: ["<STR_LIT>"])<EOL>def rule(parser):<EOL><INDENT>result = parser._accept("<STR_LIT>")<EOL>if result is unmatched:<EOL><INDENT>return result<EOL><DEDENT>return []<EOL><DEDENT>return rule<EOL>

A rule that accepts token of kind ``newline`` and returns an empty list.