rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
_header_parser = email.Parser.HeaderParser()
def nolog(*allargs): """Dummy function, assigned to log when logging is disabled.""" pass
ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec/cgi.py
headers = _header_parser.parse(fp)
headers = mimetools.Message(fp)
def parse_multipart(fp, pdict): """Parse multipart input. Arguments: fp : input file pdict: dictionary containing other parameters of content-type header Returns a dictionary just like parse_qs(): keys are the field names, each value is a list of values for that field. This is easy to use but not much good if you ...
ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec/cgi.py
headers: a dictionary(-like) object (sometimes email.Message.Message or a subclass thereof) containing *all* headers
headers: a dictionary(-like) object (sometimes rfc822.Message or a subclass thereof) containing *all* headers
def __repr__(self): """Return printable representation.""" return "MiniFieldStorage(%r, %r)" % (self.name, self.value)
ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec/cgi.py
headers = _header_parser.parse(self.fp)
headers = rfc822.Message(self.fp)
def read_multi(self, environ, keep_blank_values, strict_parsing): """Internal: read a part that is itself multipart.""" ib = self.innerboundary if not valid_boundary(ib): raise ValueError, 'Invalid boundary in multipart form: %r' % (ib,) self.list = [] klass = self.FieldStorageClass or self.__class__ part = klass(self....
ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebe65fb9ccac4ee55ed4d13381c2a7d6aee19fec/cgi.py
Single = any(r"[^'\\]", r'\\.') + "'" Double = any(r'[^"\\]', r'\\.') + '"' Single3 = any(r"[^'\\]",r'\\.',r"'[^'\\]",r"'\\.",r"''[^'\\]",r"''\\.") + "'''" Double3 = any(r'[^"\\]',r'\\.',r'"[^"\\]',r'"\\.',r'""[^"\\]',r'""\\.') + '"""'
Single = r"[^'\\]*(?:\\.[^'\\]*)*'" Double = r'[^"\\]*(?:\\.[^"\\]*)*"' Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''" Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'
def maybe(*choices): return apply(group, choices) + '?'
4734c32e125db05ac02797e356644aada7f2fd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4734c32e125db05ac02797e356644aada7f2fd70/tokenize.py
String = group("[rR]?'" + any(r"[^\n'\\]", r'\\.') + "'", '[rR]?"' + any(r'[^\n"\\]', r'\\.') + '"') Operator = group('\+=', '\-=', '\*=', '%=', '/=', '\*\*=', '&=', '\|=', '\^=', '>>=', '<<=', '\+', '\-', '\*\*', '\*', '\^', '~', '/', '%', '&', '\|', '<<', '>>', '==', '<=', '<>', '!=', '>=', '=', '<', '>')
String = group(r"[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*'", r'[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*"') Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", r"[+\-*/%&|^=<>]=?", r"~")
def maybe(*choices): return apply(group, choices) + '?'
4734c32e125db05ac02797e356644aada7f2fd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4734c32e125db05ac02797e356644aada7f2fd70/tokenize.py
ContStr = group("[rR]?'" + any(r'\\.', r"[^\n'\\]") + group("'", r'\\\r?\n'), '[rR]?"' + any(r'\\.', r'[^\n"\\]') + group('"', r'\\\r?\n'))
ContStr = group(r"[rR]?'[^\n'\\]*(?:\\.[^\n'\\]*)*" + group("'", r'\\\r?\n'), r'[rR]?"[^\n"\\]*(?:\\.[^\n"\\]*)*' + group('"', r'\\\r?\n'))
def maybe(*choices): return apply(group, choices) + '?'
4734c32e125db05ac02797e356644aada7f2fd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4734c32e125db05ac02797e356644aada7f2fd70/tokenize.py
sizehint, if given, is passed as size argument to the stream's .read() method. """ if sizehint is None: data = self.stream.read() else: data = self.stream.read(sizehint)
sizehint, if given, is ignored since there is no efficient way to finding the true end-of-line. """ data = self.stream.read()
def readlines(self, sizehint=None):
70596312880e288cdc4bf7e7b2416353c2c6025f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/70596312880e288cdc4bf7e7b2416353c2c6025f/codecs.py
if sizehint is None: data = self.reader.read() else: data = self.reader.read(sizehint)
data = self.reader.read()
def readlines(self, sizehint=None):
70596312880e288cdc4bf7e7b2416353c2c6025f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/70596312880e288cdc4bf7e7b2416353c2c6025f/codecs.py
pat = re.compile(r'^\s*class\s*' + name + r'\b')
pat = re.compile(r'^(\s*)class\s*' + name + r'\b') candidates = []
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8/inspect.py
if pat.match(lines[i]): return lines, i
match = pat.match(lines[i]) if match: if lines[i][0] == 'c': return lines, i candidates.append((match.group(1), i)) if candidates: candidates.sort() return lines, candidates[0][1]
def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is r...
7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8/inspect.py
def __init__(self): self.childNodes = [] self.parentNode = None if Node._debug: index = repr(id(self)) + repr(self.__class__) Node.allnodes[index] = repr(self.__dict__) if Node.debug is None: Node.debug = _get_StringIO() #open( "debug4.out", "w" ) Node.debug.write("create %s\n" % index)
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
"%s cannot be child of %s" % (repr(newChild), repr(self) )
"%s cannot be child of %s" % (repr(newChild), repr(self))
def insertBefore(self, newChild, refChild): if newChild.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(newChild), repr(self) ) if newChild.parentNode is not None: newChild.parentNode.removeChild(newChild) if refChild is None: self.appendChild(newChild) else: index =...
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
"%s cannot be child of %s" % (repr(node), repr(self) )
"%s cannot be child of %s" % (repr(node), repr(self))
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node) if self.childNodes: last = self.lastChild node.previousSibling = last last.nextSibling = node el...
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
"%s cannot be child of %s" % (repr(newChild), repr(self) )
"%s cannot be child of %s" % (repr(newChild), repr(self))
def replaceChild(self, newChild, oldChild): if newChild.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(newChild), repr(self) ) if newChild.parentNode is not None: newChild.parentNode.removeChild(newChild) if newChild is oldChild: return index = self.childNodes.index...
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
return self._attrs[attname].value
try: return self._attrs[attname].value except KeyError: return ""
def getAttribute(self, attname): return self._attrs[attname].value
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
return self._attrsNS[(namespaceURI, localName)].value
try: return self._attrsNS[(namespaceURI, localName)].value except KeyError: return ""
def getAttributeNS(self, namespaceURI, localName): return self._attrsNS[(namespaceURI, localName)].value
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
return self._attrsNS[(namespaceURI, localName)]
return self._attrsNS.get((namespaceURI, localName))
def getAttributeNodeNS(self, namespaceURI, localName): return self._attrsNS[(namespaceURI, localName)]
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree")
raise xml.dom.WrongDocumentErr( "doctype object owned by another DOM tree")
def createDocument(self, namespaceURI, qualifiedName, doctype): if doctype and doctype.parentNode is not None: raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree") doc = Document() if doctype is None: doctype = self.createDocumentType(qualifiedName, None, None) if qualifiedName: prefix, localname ...
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
raise xml.dom.NamespaceErr("illegal use of prefix without namespaces")
raise xml.dom.NamespaceErr( "illegal use of prefix without namespaces") element = doc.createElementNS(namespaceURI, qualifiedName) doc.appendChild(element)
def createDocument(self, namespaceURI, qualifiedName, doctype): if doctype and doctype.parentNode is not None: raise xml.dom.WrongDocumentErr("doctype object owned by another DOM tree") doc = Document() if doctype is None: doctype = self.createDocumentType(qualifiedName, None, None) if qualifiedName: prefix, localname ...
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
"%s cannot be child of %s" % (repr(node), repr(self) )
"%s cannot be child of %s" % (repr(node), repr(self))
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node)
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
raise xml.dom.HierarchyRequestErr("two document elements disallowed")
raise xml.dom.HierarchyRequestErr( "two document elements disallowed")
def appendChild(self, node): if node.nodeType not in self.childNodeTypes: raise HierarchyRequestErr, \ "%s cannot be child of %s" % (repr(node), repr(self) ) if node.parentNode is not None: node.parentNode.removeChild(node)
08d73fb34139f70ceab853967e2cc2161783f491 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08d73fb34139f70ceab853967e2cc2161783f491/minidom.py
def _center(str, width): """Center a string in a field.""" n = width - len(str) if n <= 0: return str return ' '*((n+1)/2) + str + ' '*((n)/2)
def _center(str, width): """Center a string in a field.""" n = width - len(str) if n <= 0: return str return ' '*((n+1)/2) + str + ' '*((n)/2)
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
days.append(_center(s, width))
days.append(s.center(width))
def week(theweek, width): """Returns a single week in a string (no newline).""" days = [] for day in theweek: if day == 0: s = '' else: s = '%2i' % day # right-align single-digit days days.append(_center(s, width)) return ' '.join(days)
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
days.append(_center(names[i%7][:width], width))
days.append(names[i%7][:width].center(width))
def weekheader(width): """Return a header for a week.""" if width >= 9: names = day_name else: names = day_abbr days = [] for i in range(_firstweekday, _firstweekday + 7): days.append(_center(names[i%7][:width], width)) return ' '.join(days)
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
s = (_center(month_name[themonth] + ' ' + `theyear`,
s = ((month_name[themonth] + ' ' + `theyear`).center(
def month(theyear, themonth, w=0, l=0): """Return a month's calendar string (multi-line).""" w = max(2, w) l = max(1, l) s = (_center(month_name[themonth] + ' ' + `theyear`, 7 * (w + 1) - 1).rstrip() + '\n' * l + weekheader(w).rstrip() + '\n' * l) for aweek in monthcalendar(theyear, themonth): s = s + week(aweek, w).rs...
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
return (_center(a, colwidth) + ' ' * spacing + _center(b, colwidth) + ' ' * spacing + _center(c, colwidth))
return (a.center(colwidth) + ' ' * spacing + b.center(colwidth) + ' ' * spacing + c.center(colwidth))
def format3cstring(a, b, c, colwidth=_colwidth, spacing=_spacing): """Returns a string formatted from 3 strings, centered within 3 columns.""" return (_center(a, colwidth) + ' ' * spacing + _center(b, colwidth) + ' ' * spacing + _center(c, colwidth))
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
s = _center(`year`, colwidth * 3 + c * 2).rstrip() + '\n' * l
s = `year`.center(colwidth * 3 + c * 2).rstrip() + '\n' * l
def calendar(year, w=0, l=0, c=_spacing): """Returns a year's calendar as a multi-line string.""" w = max(2, w) l = max(1, l) c = max(2, c) colwidth = (w + 1) * 7 - 1 s = _center(`year`, colwidth * 3 + c * 2).rstrip() + '\n' * l header = weekheader(w) header = format3cstring(header, header, header, colwidth, c).rstrip(...
22a6d18157146ce2f5d2d27fa9bcf8cd432e8388 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/22a6d18157146ce2f5d2d27fa9bcf8cd432e8388/calendar.py
except string.atoi_error: port = None
except string.atoi_error: pass
def connect(self, host, *args): if args: if args[1:]: raise TypeError, 'too many args' port = args[0] else: i = string.find(host, ':') if i >= 0: host, port = host[:i], host[i+1:] try: port = string.atoi(port) except string.atoi_error: port = None if not port: port = HTTP_PORT self.sock = socket.socket(socket.AF_INET, ...
33e199e042c1ad93a5b73a0f8397c9bf534e02e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33e199e042c1ad93a5b73a0f8397c9bf534e02e2/httplib.py
def open_module(self, event=None): # XXX Shouldn't this be in IOBinding or in FileList? try: name = self.text.get("sel.first", "sel.last") except TclError: name = "" else: name = string.strip(name) if not name: name = tkSimpleDialog.askstring("Module", "Enter the name of a Python module\n" "to search on sys.path and op...
b6c4e9dc917f734b7d9cee0dd7a395aebe748fea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b6c4e9dc917f734b7d9cee0dd7a395aebe748fea/EditorWindow.py
(f, file, (suffix, mode, type)) = imp.find_module(name)
(f, file, (suffix, mode, type)) = _find_module(name)
def open_module(self, event=None): # XXX Shouldn't this be in IOBinding or in FileList? try: name = self.text.get("sel.first", "sel.last") except TclError: name = "" else: name = string.strip(name) if not name: name = tkSimpleDialog.askstring("Module", "Enter the name of a Python module\n" "to search on sys.path and op...
b6c4e9dc917f734b7d9cee0dd7a395aebe748fea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b6c4e9dc917f734b7d9cee0dd7a395aebe748fea/EditorWindow.py
_platform_cache = {True:None, False:None} _platform_aliased_cache = {True:None, False:None}
_platform_cache_terse = None _platform_cache_not_terse = None _platform_aliased_cache_terse = None _platform_aliased_cache_not_terse = None
def python_compiler(): """ Returns a string identifying the compiler used for compiling Python. """ return _sys_version()[3]
2938394d8a1f2178d0eb40ddea57d311fdc4a6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2938394d8a1f2178d0eb40ddea57d311fdc4a6a3/platform.py
global _platform_cache,_platform_aliased_cache if not aliased and (_platform_cache[bool(terse)] is not None): return _platform_cache[bool(terse)] elif _platform_aliased_cache[bool(terse)] is not None: return _platform_aliased_cache[bool(terse)]
global _platform_cache_terse, _platform_cache_not_terse global _platform_aliased_cache_terse, _platform_aliased_cache_not_terse if not aliased and terse and (_platform_cache_terse is not None): return _platform_cache_terse elif not aliased and not terse and (_platform_cache_not_terse is not None): return _platform_cac...
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
2938394d8a1f2178d0eb40ddea57d311fdc4a6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2938394d8a1f2178d0eb40ddea57d311fdc4a6a3/platform.py
if aliased: _platform_aliased_cache[bool(terse)] = platform
if aliased and terse: _platform_aliased_cache_terse = platform elif aliased and not terse: _platform_aliased_cache_not_terse = platform
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
2938394d8a1f2178d0eb40ddea57d311fdc4a6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2938394d8a1f2178d0eb40ddea57d311fdc4a6a3/platform.py
_platform_cache[bool(terse)] = platform
if terse: _platform_cache_terse = platform else: _platform_cache_not_terse = platform
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
2938394d8a1f2178d0eb40ddea57d311fdc4a6a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2938394d8a1f2178d0eb40ddea57d311fdc4a6a3/platform.py
char *cStr = PyString_AsString(v); *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, 0);
char *cStr; if (!PyArg_Parse(v, "et", "ascii", &cStr)) return NULL; *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, kCFStringEncodingASCII);
def outputCheckConvertArg(self): Out(""" if (v == Py_None) { *p_itself = NULL; return 1; } if (PyString_Check(v)) { char *cStr = PyString_AsString(v); *p_itself = CFStringCreateWithCString((CFAllocatorRef)NULL, cStr, 0); return 1; } if (PyUnicode_Check(v)) { /* We use the CF types here, if Python was configured differe...
c64936fe66979acdda47cbeacdcee3e2fdff0788 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c64936fe66979acdda47cbeacdcee3e2fdff0788/cfsupport.py
try: from os import popen2 except NameError:
if hasattr(os, "popen2"): def popen2(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" w, r = os.popen2(cmd, mode, bufsize) return r, w else:
def wait(self): """Wait for and return the exit status of the child process.""" pid, sts = os.waitpid(self.pid, 0) if pid == self.pid: self.sts = sts _active.remove(self) return self.sts
8e49bfbd24ae626628ac43cdc01d4f2dc0368963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e49bfbd24ae626628ac43cdc01d4f2dc0368963/popen2.py
try: from os import popen3 except NameError:
if hasattr(os, "popen3"): def popen3(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin, child_stderr) are returned.""" w, r, e = os.popen3(cmd, mode, bufsize) return r, w, e...
def popen2(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin) are returned.""" if type(mode) is type(0) and bufsize == -1: bufsize = mode mode = 't' assert mode in ('t', 'b'...
8e49bfbd24ae626628ac43cdc01d4f2dc0368963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e49bfbd24ae626628ac43cdc01d4f2dc0368963/popen2.py
try: from os import popen4 except NameError: pass
if hasattr(os, "popen4"): def popen4(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout_stderr, child_stdin) are returned.""" w, r = os.popen4(cmd, mode, bufsize) return r, w else: pass
def popen3(cmd, mode='t', bufsize=-1): """Execute the shell command 'cmd' in a sub-process. If 'bufsize' is specified, it sets the buffer size for the I/O pipes. The file objects (child_stdout, child_stdin, child_stderr) are returned.""" if type(mode) is type(0) and bufsize == -1: bufsize = mode mode = 't' assert mod...
8e49bfbd24ae626628ac43cdc01d4f2dc0368963 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8e49bfbd24ae626628ac43cdc01d4f2dc0368963/popen2.py
def split(p): d, p = splitdrive(p) slashes = '' while p and p[-1:] in '/\\': slashes = slashes + p[-1] p = p[:-1] if p == '': p = p + slashes head, tail = '', '' for c in p: tail = tail + c if c in '/\\': head, tail = head + tail, '' slashes = '' while head and head[-1:] in '/\\': slashes = slashes + head[-1] head = he...
fa4bab11fd347b50fe6e2db641814c5ae6e35b1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa4bab11fd347b50fe6e2db641814c5ae6e35b1b/ntpath.py
if c in '/\\':
if c in ['/','\\']:
def splitext(p): root, ext = '', '' for c in p: if c in '/\\': root, ext = root + ext + c, '' elif c == '.' or ext: ext = ext + c else: root = root + c return root, ext
fa4bab11fd347b50fe6e2db641814c5ae6e35b1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa4bab11fd347b50fe6e2db641814c5ae6e35b1b/ntpath.py
elif c == '.' or ext:
elif c == '.': if ext: root, ext = root + ext, c else: ext = c elif ext:
def splitext(p): root, ext = '', '' for c in p: if c in '/\\': root, ext = root + ext + c, '' elif c == '.' or ext: ext = ext + c else: root = root + c return root, ext
fa4bab11fd347b50fe6e2db641814c5ae6e35b1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fa4bab11fd347b50fe6e2db641814c5ae6e35b1b/ntpath.py
def formatmonthname(self, theyear, themonth, width):
def formatmonthname(self, theyear, themonth, width, withyear=True):
def formatmonthname(self, theyear, themonth, width): """ Return a formatted month name. """ s = "%s %r" % (month_name[themonth], theyear) return s.center(width)
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
s = "%s %r" % (month_name[themonth], theyear)
s = month_name[themonth] if withyear: s = "%s %r" % (s, theyear)
def formatmonthname(self, theyear, themonth, width): """ Return a formatted month name. """ s = "%s %r" % (month_name[themonth], theyear) return s.center(width)
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
a(formatstring((month_name[k] for k in months), colwidth, c).rstrip())
names = (self.formatmonthname(theyear, k, colwidth, False) for k in months) a(formatstring(names, colwidth, c).rstrip())
def formatyear(self, theyear, w=2, l=1, c=6, m=3): """ Returns a year's calendar as a multi-line string. """ w = max(2, w) l = max(1, l) c = max(2, c) colwidth = (w + 1) * 7 - 1 v = [] a = v.append a(repr(theyear).center(colwidth*m+c*(m-1)).rstrip()) a('\n'*l) header = self.formatweekheader(w) for (i, row) in enumerate...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
a(formatstring((header for k in months), colwidth, c).rstrip())
headers = (header for k in months) a(formatstring(headers, colwidth, c).rstrip())
def formatyear(self, theyear, w=2, l=1, c=6, m=3): """ Returns a year's calendar as a multi-line string. """ w = max(2, w) l = max(1, l) c = max(2, c) colwidth = (w + 1) * 7 - 1 v = [] a = v.append a(repr(theyear).center(colwidth*m+c*(m-1)).rstrip()) a('\n'*l) header = self.formatweekheader(w) for (i, row) in enumerate...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
return ''.join(v).encode(encoding)
return ''.join(v).encode(encoding, "xmlcharrefreplace") class LocaleTextCalendar(TextCalendar): """ This class can be passed a locale name in the constructor and will return month and weekday names in the specified locale. If this locale includes an encoding all strings containing month and weekday names will be retu...
def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None): """ Return a formatted year as a complete HTML page. """ if encoding is None: encoding = sys.getdefaultencoding() v = [] a = v.append a('<?xml version="1.0" encoding="%s"?>\n' % encoding) a('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stric...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number of lines for each week (default 1...
parser = optparse.OptionParser(usage="usage: %prog [options] [year [month]]") parser.add_option( "-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)" ) parser.add_option( "-l", "--lines", dest="lines", type="int", default=1, help="number of lines for each week (defaul...
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
cal = HTMLCalendar()
if options.locale: cal = LocaleHTMLCalendar(locale=options.locale) else: cal = HTMLCalendar()
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
cal = TextCalendar()
if options.locale: cal = LocaleTextCalendar(locale=options.locale) else: cal = TextCalendar()
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
print cal.formatyear(datetime.date.today().year, **optdict)
result = cal.formatyear(datetime.date.today().year, **optdict)
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
print cal.formatyear(int(args[1]), **optdict)
result = cal.formatyear(int(args[1]), **optdict)
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
print cal.formatmonth(int(args[1]), int(args[2]), **optdict)
result = cal.formatmonth(int(args[1]), int(args[2]), **optdict)
def main(args): import optparse parser = optparse.OptionParser(usage="usage: %prog [options] [year] [month]") parser.add_option("-w", "--width", dest="width", type="int", default=2, help="width of date column (default 2, text only)") parser.add_option("-l", "--lines", dest="lines", type="int", default=1, help="number o...
d56e62d7309efcde544e37125e9fb327e11b81ee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d56e62d7309efcde544e37125e9fb327e11b81ee/calendar.py
def abspath(p): return normpath(join(os.getcwd(), p))
abspath = os.expand
def expandvars(p): """ Expand environment variables using OS_GSTrans. """ l= 512 b= swi.block(l) return b.tostring(0, swi.swi('OS_GSTrans', 'sbi;..i', p, b, l))
bee1da89f7e12812189e791829cf9191fb2e45e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bee1da89f7e12812189e791829cf9191fb2e45e0/riscospath.py
while args and args[0][0] == '-' and args[0] <> '-':
while args and args[0][:1] == '-' and args[0] <> '-':
def getopt(args, options): list = [] while args and args[0][0] == '-' and args[0] <> '-': if args[0] == '--': args = args[1:] break optstring, args = args[0][1:], args[1:] while optstring <> '': opt, optstring = optstring[0], optstring[1:] if classify(opt, options): # May raise exception as well if optstring == '': if ...
7f88a609f2891ab051cf37849b729f47cc182145 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7f88a609f2891ab051cf37849b729f47cc182145/getopt.py
self.package_dir = self.distribution.package_dir
self.package_dir = {} if self.distribution.package_dir: for name, path in self.distribution.package_dir.items(): self.package_dir[name] = convert_path(path)
def finalize_options (self): self.set_undefined_options('build', ('build_lib', 'build_lib'), ('force', 'force'))
ec8613fc50f880af299bf5bd4f6b3b36873220f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ec8613fc50f880af299bf5bd4f6b3b36873220f3/build_py.py
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the
def scan_dragto(self, x, y, gain=10): """Adjust the view of the canvas to GAIN times the
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
2c54bf44f9c0f058bfd7b5c0a815d8481f12af2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2c54bf44f9c0f058bfd7b5c0a815d8481f12af2d/Tkinter.py
self.tk.call(self._w, 'scan', 'dragto', x, y)
self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
def scan_dragto(self, x, y): """Adjust the view of the canvas to 10 times the difference between X and Y and the coordinates given in scan_mark.""" self.tk.call(self._w, 'scan', 'dragto', x, y)
2c54bf44f9c0f058bfd7b5c0a815d8481f12af2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2c54bf44f9c0f058bfd7b5c0a815d8481f12af2d/Tkinter.py
def circle(self, radius, extent=None):
def circle(self, radius, extent = None):
def circle(self, radius, extent=None): """ Draw a circle with given radius. The center is radius units left of the turtle; extent determines which part of the circle is drawn. If not given, the entire circle is drawn.
2dbd76aa3f559923b75db4e55239b73aec0d1f7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2dbd76aa3f559923b75db4e55239b73aec0d1f7b/turtle.py
extent = self._fullcircle x0, y0 = self._position xc = x0 - radius * sin(self._angle * self._invradian) yc = y0 - radius * cos(self._angle * self._invradian) if radius >= 0.0: start = self._angle - (self._fullcircle / 4.0) else: start = self._angle + (self._fullcircle / 4.0) extent = -extent if self._filling: if abs(ex...
extent = self._fullcircle frac = abs(extent)/self._fullcircle steps = 1+int(min(11+abs(radius)/6.0, 59.0)*frac) w = 1.0 * extent / steps w2 = 0.5 * w l = 2.0 * radius * sin(w2*self._invradian) if radius < 0: l, w, w2 = -l, -w, -w2 self.left(w2) for i in range(steps): self.forward(l) self.left(w) self.right(w2)
def circle(self, radius, extent=None): """ Draw a circle with given radius. The center is radius units left of the turtle; extent determines which part of the circle is drawn. If not given, the entire circle is drawn.
2dbd76aa3f559923b75db4e55239b73aec0d1f7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2dbd76aa3f559923b75db4e55239b73aec0d1f7b/turtle.py
(Defaults to 1) clamp - If 1, change exponents if too high (Default 0)
_clamp - If 1, change exponents if too high (Default 0)
def __deepcopy__(self, memo): if type(self) == Decimal: return self # My components are also immutable return self.__class__(str(self))
7668379fdb08b387cb5d4fdf6978fec3901fa44a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7668379fdb08b387cb5d4fdf6978fec3901fa44a/decimal.py
capitals=1, _clamp=0,
capitals=None, _clamp=0,
def __init__(self, prec=None, rounding=None, trap_enablers=None, flags=None, _rounding_decision=None, Emin=None, Emax=None, capitals=1, _clamp=0, _ignored_flags=[]): if flags is None: flags = dict.fromkeys(Signals, 0) self.DefaultLock.acquire() for name, val in locals().items(): if val is None: setattr(self, name, copy...
7668379fdb08b387cb5d4fdf6978fec3901fa44a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7668379fdb08b387cb5d4fdf6978fec3901fa44a/decimal.py
"""Returns maximum exponent (= Emin - prec + 1)"""
"""Returns maximum exponent (= Emax - prec + 1)"""
def Etop(self): """Returns maximum exponent (= Emin - prec + 1)""" return int(self.Emax - self.prec + 1)
7668379fdb08b387cb5d4fdf6978fec3901fa44a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7668379fdb08b387cb5d4fdf6978fec3901fa44a/decimal.py
"""normalize reduces its operand to its simplest form.
"""normalize reduces an operand to its simplest form.
def normalize(self, a): """normalize reduces its operand to its simplest form.
7668379fdb08b387cb5d4fdf6978fec3901fa44a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7668379fdb08b387cb5d4fdf6978fec3901fa44a/decimal.py
Emin=DEFAULT_MIN_EXPONENT
Emin=DEFAULT_MIN_EXPONENT, capitals=1
def _isnan(num): """Determines whether a string or float is NaN (1, sign, diagnostic info as string) => NaN (2, sign, diagnostic info as string) => sNaN 0 => not a NaN """ num = str(num).lower() if not num: return 0 #get the sign, get rid of trailing [+-] sign = 0 if num[0] == '+': num = num[1:] elif num[0] == '-': ...
7668379fdb08b387cb5d4fdf6978fec3901fa44a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7668379fdb08b387cb5d4fdf6978fec3901fa44a/decimal.py
if filename == '<string>' and mainpyfile: filename = mainpyfile
if filename == '<string>' and self.mainpyfile: filename = self.mainpyfile
def defaultFile(self): """Produce a reasonable default.""" filename = self.curframe.f_code.co_filename if filename == '<string>' and mainpyfile: filename = mainpyfile return filename
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
"""Helper function for break/clear parsing -- may be overridden."""
"""Helper function for break/clear parsing -- may be overridden. lookupmodule() translates (possibly incomplete) file or module name into an absolute file name. """ if os.path.isabs(filename) and os.path.exists(filename): return filename f = os.path.join(sys.path[0], filename) if os.path.exists(f) and self.canonic(f...
def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden.""" root, ext = os.path.splitext(filename) if ext == '': filename = filename + '.py' if os.path.isabs(filename): return filename for dirname in sys.path: while os.path.islink(dirname): dirname = os.readlink(dirname) fullna...
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
mainmodule = '' mainpyfile = '' if __name__=='__main__':
def main():
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path'
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
mainpyfile = filename = sys.argv[1] if not os.path.exists(filename): print 'Error:', repr(filename), 'does not exist'
mainpyfile = sys.argv[1] if not os.path.exists(mainpyfile): print 'Error:', mainpyfile, 'does not exist'
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path'
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
mainmodule = os.path.basename(filename)
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path'
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
sys.path.insert(0, os.path.dirname(filename)) run('execfile(%r)' % (filename,))
sys.path[0] = os.path.dirname(mainpyfile) pdb = Pdb() while 1: try: pdb._runscript(mainpyfile) if pdb._user_requested_quit: break print "The program finished and will be restarted" except SystemExit: print "The program exited via sys.exit(). Exit status: ", print sys.exc_info()[1] except: traceback.print_exc() ...
def help(): for dirname in sys.path: fullname = os.path.join(dirname, 'pdb.doc') if os.path.exists(fullname): sts = os.system('${PAGER-more} '+fullname) if sts: print '*** Pager exit status:', sts break else: print 'Sorry, can\'t find the help file "pdb.doc"', print 'along the Python search path'
395f3ef345f02d02734ed4aa5c409f3875cf0504 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/395f3ef345f02d02734ed4aa5c409f3875cf0504/pdb.py
try: self.ftp.nlst(file) except ftplib.error_perm, reason: raise IOError, ('ftp error', reason), sys.exc_info()[2] self.ftp.voidcmd(cmd)
def retrfile(self, file, type): import ftplib self.endtransfer() if type in ('d', 'D'): cmd = 'TYPE A'; isdir = 1 else: cmd = 'TYPE ' + type; isdir = 0 try: self.ftp.voidcmd(cmd) except ftplib.all_errors: self.init() self.ftp.voidcmd(cmd) conn = None if file and not isdir: # Use nlst to see if the file exists at all tr...
446f9e622f178a516fc4e54fe357eccaa90debf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/446f9e622f178a516fc4e54fe357eccaa90debf2/urllib.py
def urlopen(url, data=None):
def urlopen(url, data=None, proxies=None):
def urlopen(url, data=None): """urlopen(url [, data]) -> open file-like object""" global _urlopener if not _urlopener: _urlopener = FancyURLopener() if data is None: return _urlopener.open(url) else: return _urlopener.open(url, data)
542a95920c653ebd9e517166454699eb2e163a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/542a95920c653ebd9e517166454699eb2e163a0a/urllib.py
if not _urlopener: _urlopener = FancyURLopener()
if proxies is not None: opener = FancyURLopener(proxies=proxies) elif not _urlopener: opener = FancyURLopener() _urlopener = opener else: opener = _urlopener
def urlopen(url, data=None): """urlopen(url [, data]) -> open file-like object""" global _urlopener if not _urlopener: _urlopener = FancyURLopener() if data is None: return _urlopener.open(url) else: return _urlopener.open(url, data)
542a95920c653ebd9e517166454699eb2e163a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/542a95920c653ebd9e517166454699eb2e163a0a/urllib.py
return _urlopener.open(url)
return opener.open(url)
def urlopen(url, data=None): """urlopen(url [, data]) -> open file-like object""" global _urlopener if not _urlopener: _urlopener = FancyURLopener() if data is None: return _urlopener.open(url) else: return _urlopener.open(url, data)
542a95920c653ebd9e517166454699eb2e163a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/542a95920c653ebd9e517166454699eb2e163a0a/urllib.py
return _urlopener.open(url, data)
return opener.open(url, data)
def urlopen(url, data=None): """urlopen(url [, data]) -> open file-like object""" global _urlopener if not _urlopener: _urlopener = FancyURLopener() if data is None: return _urlopener.open(url) else: return _urlopener.open(url, data)
542a95920c653ebd9e517166454699eb2e163a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/542a95920c653ebd9e517166454699eb2e163a0a/urllib.py
classmethod test.test_descrtut.C 1
classmethod <class 'test.test_descrtut.C'> 1
... def foo(cls, y):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
classmethod test.test_descrtut.C 1
classmethod <class 'test.test_descrtut.C'> 1
... def foo(cls, y):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
classmethod test.test_descrtut.D 1
classmethod <class 'test.test_descrtut.D'> 1
... def foo(cls, y):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
classmethod test.test_descrtut.D 1
classmethod <class 'test.test_descrtut.D'> 1
... def foo(cls, y):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
classmethod test.test_descrtut.C 1
classmethod <class 'test.test_descrtut.C'> 1
... def foo(cls, y): # override C.foo
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
classmethod test.test_descrtut.C 1
classmethod <class 'test.test_descrtut.C'> 1
... def foo(cls, y): # override C.foo
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
>>> class A:
>>> class A:
... def setx(self, x):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
called A.save() >>> class A(object):
called C.save() >>> class A(object):
... def save(self):
aac857e07e983cfb7c1a2faaa8aec9409d49a30a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/aac857e07e983cfb7c1a2faaa8aec9409d49a30a/test_descrtut.py
index = ac_in_buffer.find (self.terminator)
index = self.ac_in_buffer.find(terminator)
def handle_read (self):
8cd413864789f7e16e80da5d9c8ed59bbb0a6cb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cd413864789f7e16e80da5d9c8ed59bbb0a6cb1/asynchat.py
while 1: res = mime_code.search(line)
pos = 0 while 1: res = mime_code.search(line, pos)
def mime_decode(line): '''Decode a single line of quoted-printable text to 8bit.''' newline = '' while 1: res = mime_code.search(line) if res is None: break newline = newline + line[:res.start(0)] + \ chr(string.atoi(res.group(1), 16)) line = line[res.end(0):] return newline + line
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
newline = newline + line[:res.start(0)] + \
newline = newline + line[pos:res.start(0)] + \
def mime_decode(line): '''Decode a single line of quoted-printable text to 8bit.''' newline = '' while 1: res = mime_code.search(line) if res is None: break newline = newline + line[:res.start(0)] + \ chr(string.atoi(res.group(1), 16)) line = line[res.end(0):] return newline + line
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
line = line[res.end(0):] return newline + line
pos = res.end(0) return newline + line[pos:]
def mime_decode(line): '''Decode a single line of quoted-printable text to 8bit.''' newline = '' while 1: res = mime_code.search(line) if res is None: break newline = newline + line[:res.start(0)] + \ chr(string.atoi(res.group(1), 16)) line = line[res.end(0):] return newline + line
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
while 1: res = mime_head.search(line)
pos = 0 while 1: res = mime_head.search(line, pos)
def mime_decode_header(line): '''Decode a header line to 8bit.''' newline = '' while 1: res = mime_head.search(line) if res is None: break match = res.group(1) # convert underscores to spaces (before =XX conversion!) match = string.join(string.split(match, '_'), ' ') newline = newline + line[:res.start(0)] + mime_decod...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
newline = newline + line[:res.start(0)] + mime_decode(match) line = line[res.end(0):] return newline + line
newline = newline + line[pos:res.start(0)] + mime_decode(match) pos = res.end(0) return newline + line[pos:]
def mime_decode_header(line): '''Decode a header line to 8bit.''' newline = '' while 1: res = mime_head.search(line) if res is None: break match = res.group(1) # convert underscores to spaces (before =XX conversion!) match = string.join(string.split(match, '_'), ' ') newline = newline + line[:res.start(0)] + mime_decod...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
line = line[1:] while 1: res = reg.search(line)
pos = 1 while 1: res = reg.search(line, pos)
def mime_encode(line, header): '''Code a single line as quoted-printable. If header is set, quote some extra characters.''' if header: reg = mime_header_char else: reg = mime_char newline = '' if len(line) >= 5 and line[:5] == 'From ': # quote 'From ' at the start of a line for stupid mailers newline = string.upper('=%...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
newline = newline + line[:res.start(0)] + \ string.upper('=%02x' % ord(line[res.group(0)])) line = line[res.end(0):] line = newline + line
newline = newline + line[pos:res.start(0)] + \ string.upper('=%02x' % ord(res.group(0))) pos = res.end(0) line = newline + line[pos:]
def mime_encode(line, header): '''Code a single line as quoted-printable. If header is set, quote some extra characters.''' if header: reg = mime_header_char else: reg = mime_char newline = '' if len(line) >= 5 and line[:5] == 'From ': # quote 'From ' at the start of a line for stupid mailers newline = string.upper('=%...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
while 1: res = mime_header.search(line)
pos = 0 while 1: res = mime_header.search(line, pos)
def mime_encode_header(line): '''Code a single header line as quoted-printable.''' newline = '' while 1: res = mime_header.search(line) if res is None: break newline = newline + line[:res.start(0)] + res.group(1) + \ '=?' + CHARSET + '?Q?' + \ mime_encode(res.group(2), 1) + \ '?=' + res.group(3) line = line[res.end(0):...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
newline = newline + line[:res.start(0)] + res.group(1) + \ '=?' + CHARSET + '?Q?' + \ mime_encode(res.group(2), 1) + \ '?=' + res.group(3) line = line[res.end(0):] return newline + line
newline = '%s%s%s=?%s?Q?%s?=%s' % \ (newline, line[pos:res.start(0)], res.group(1), CHARSET, mime_encode(res.group(2), 1), res.group(3)) pos = res.end(0) return newline + line[pos:]
def mime_encode_header(line): '''Code a single header line as quoted-printable.''' newline = '' while 1: res = mime_header.search(line) if res is None: break newline = newline + line[:res.start(0)] + res.group(1) + \ '=?' + CHARSET + '?Q?' + \ mime_encode(res.group(2), 1) + \ '?=' + res.group(3) line = line[res.end(0):...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
line = chrset_res.group(1) + \ CHARSET + chrset_res.group(3)
line = '%s%s%s' % (chrset_res.group(1), CHARSET, chrset_res.group(3))
def mimify_part(ifile, ofile, is_mime): '''Convert an 8bit part of a MIME mail message to quoted-printable.''' has_cte = is_qp = is_base64 = 0 multipart = None must_quote_body = must_quote_header = has_iso_chars = 0 header = [] header_end = '' message = [] message_end = '' # read header hfile = HeaderFile(ifile) while...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
line = chrset_res.group(1) + 'us-ascii' + chrset_res.group(3)
line = '%sus-ascii%s' % chrset_res.group(1, 3)
def mimify_part(ifile, ofile, is_mime): '''Convert an 8bit part of a MIME mail message to quoted-printable.''' has_cte = is_qp = is_base64 = 0 multipart = None must_quote_body = must_quote_header = has_iso_chars = 0 header = [] header_end = '' message = [] message_end = '' # read header hfile = HeaderFile(ifile) while...
4795dec0fc48b083ae2113ae52427d0c8712bd70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4795dec0fc48b083ae2113ae52427d0c8712bd70/mimify.py
ServerClass = SocketServer.TCPServer):
ServerClass = BaseHTTPServer.HTTPServer):
def test(HandlerClass = SimpleHTTPRequestHandler, ServerClass = SocketServer.TCPServer): BaseHTTPServer.test(HandlerClass, ServerClass)
df999c2e6d4dd2e564b7400e2368888bdb89b20d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/df999c2e6d4dd2e564b7400e2368888bdb89b20d/SimpleHTTPServer.py
self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' ]
self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' , '/DNDEBUG']
def __init__ (self, verbose=0, dry_run=0, force=0):
d5d3293ac48d59e3c1c59817781f4a614aac1882 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d5d3293ac48d59e3c1c59817781f4a614aac1882/msvccompiler.py
except socket.sslerror, msg: break
except socket.sslerror, err: if (err[0] == socket.SSL_ERROR_WANT_READ or err[0] == socket.SSL_ERROR_WANT_WRITE or 0): continue if err[0] == socket.SSL_ERROR_ZERO_RETURN: break raise except socket.error, err: if err[0] = errno.EINTR: continue raise
def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket.
23c927659bc3c4eefadf335571a528436c78f545 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23c927659bc3c4eefadf335571a528436c78f545/httplib.py
This is called by send_reponse().
This is called by send_response().
def log_request(self, code='-', size='-'): """Log an accepted request.
65d6649bfbaaf18d98eecdf5e2764800860396c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/65d6649bfbaaf18d98eecdf5e2764800860396c8/BaseHTTPServer.py