rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
try: return rawval % d except KeyError, key: raise InterpolationError(key, option, section, rawval) | value = rawval while 1: if not string.find(value, "%("): try: value = value % d except KeyError, key: raise InterpolationError(key, option, section, rawval) else: return value | def get(self, section, option, raw=0): """Get an option value for a given section. | 3f9250cbcdfb86bfe4349b5aa09a3ebbda7fedf6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3f9250cbcdfb86bfe4349b5aa09a3ebbda7fedf6/ConfigParser.py |
self.storeName(alias or mod) | if alias: self._resolveDots(name) self.storeName(alias) else: self.storeName(mod) | def visitImport(self, node): self.set_lineno(node) for name, alias in node.names: if VERSION > 1: self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) mod = name.split(".")[0] self.storeName(alias or mod) | dcbf87292da508865ba4a1421cb35577f9787bdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dcbf87292da508865ba4a1421cb35577f9787bdd/pycodegen.py |
return paramre.split(value)[0].lower().strip() | ctype = paramre.split(value)[0].lower().strip() if ctype.count('/') <> 1: return 'text/plain' return ctype | def get_content_type(self): """Returns the message's content type. | f303f0e3dd00833f27bdbf89dfb02776b474d74f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f303f0e3dd00833f27bdbf89dfb02776b474d74f/Message.py |
if ctype.count('/') <> 1: raise ValueError, 'No maintype found in: %s' % ctype | def get_content_maintype(self): """Returns the message's main content type. | f303f0e3dd00833f27bdbf89dfb02776b474d74f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f303f0e3dd00833f27bdbf89dfb02776b474d74f/Message.py | |
if ctype.count('/') <> 1: raise ValueError, 'No subtype found in: %s' % ctype | def get_content_subtype(self): """Returns the message's sub content type. | f303f0e3dd00833f27bdbf89dfb02776b474d74f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f303f0e3dd00833f27bdbf89dfb02776b474d74f/Message.py | |
sys.ps1 = "[DEBUG ON]>>> " | sys.ps1 = "[DEBUG ON]\n>>> " | def open_debugger(self): import Debugger self.interp.setdebugger(Debugger.Debugger(self)) sys.ps1 = "[DEBUG ON]>>> " self.showprompt() self.top.tkraise() self.text.focus_set() | 365c3dc9a82b7814fa78d72a9d319b77e145f291 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/365c3dc9a82b7814fa78d72a9d319b77e145f291/PyShell.py |
self.top.tkraise() self.text.focus_set() | def open_debugger(self): import Debugger self.interp.setdebugger(Debugger.Debugger(self)) sys.ps1 = "[DEBUG ON]>>> " self.showprompt() self.top.tkraise() self.text.focus_set() | 365c3dc9a82b7814fa78d72a9d319b77e145f291 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/365c3dc9a82b7814fa78d72a9d319b77e145f291/PyShell.py | |
try: file = open(getsourcefile(object)) except (TypeError, IOError): | file = getsourcefile(object) or getfile(object) lines = linecache.getlines(file) if not lines: | 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... | 9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7/inspect.py |
lines = file.readlines() file.close() | 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... | 9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7/inspect.py | |
filename = getsourcefile(frame) | filename = getsourcefile(frame) or getfile(frame) | def getframeinfo(frame, context=1): """Get information about a frame or traceback object. A tuple of five things is returned: the filename, the line number of the current line, the function name, a list of lines of context from the source code, and the index of the current line within that list. The optional second ar... | 9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9f290c20f4dca4c7e0c1ced0f8fb9e0545c92da7/inspect.py |
return rv + '\n' | rv = rv + "\n" sys.stdout.write(rv) return rv | def readline(self): import EasyDialogs # A trick to make the input dialog box a bit more palatable if hasattr(sys.stdout, '_buf'): prompt = sys.stdout._buf else: prompt = "" if not prompt: prompt = "Stdin input:" sys.stdout.flush() rv = EasyDialogs.AskString(prompt) if rv is None: return "" return rv + '\n' | 69611dc53f4791a0424774557faec62c771627c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69611dc53f4791a0424774557faec62c771627c7/PyConsole.py |
doc = self.markup(value.__doc__, self.preformat) | doc = self.markup(getdoc(value), self.preformat) | def _docdescriptor(self, name, value, mod): results = [] push = results.append | 9fc5c610b268d649c9b5c7d8587403da9bd8db06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fc5c610b268d649c9b5c7d8587403da9bd8db06/pydoc.py |
doc = getattr(value, "__doc__", None) | doc = getdoc(value) | def spilldata(msg, attrs, predicate): ok, attrs = _split_list(attrs, predicate) if ok: hr.maybe() push(msg) for name, kind, homecls, value in ok: if callable(value) or inspect.isdatadescriptor(value): doc = getattr(value, "__doc__", None) else: doc = None push(self.docother(getattr(object, name), name, mod, 70, doc) + ... | 9fc5c610b268d649c9b5c7d8587403da9bd8db06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fc5c610b268d649c9b5c7d8587403da9bd8db06/pydoc.py |
verify(u'\u20ac'.encode('utf-8') == \ ''.join((chr(0xe2), chr(0x82), chr(0xac))) ) verify(u'\ud800\udc02'.encode('utf-8') == \ ''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))) ) verify(u'\ud84d\udc56'.encode('utf-8') == \ ''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) ) | verify(u'\u20ac'.encode('utf-8') == '\xe2\x82\xac') verify(u'\ud800\udc02'.encode('utf-8') == '\xf0\x90\x80\x82') verify(u'\ud84d\udc56'.encode('utf-8') == '\xf0\xa3\x91\x96') verify(u'\ud800'.encode('utf-8') == '\xed\xa0\x80') verify(u'\udc00'.encode('utf-8') == '\xed\xb0\x80') verify((u'\ud800\udc02'*1000).encode('ut... | def __str__(self): return self.x | a213c625f62e7b21d0c3de7912ef5caf015a580c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a213c625f62e7b21d0c3de7912ef5caf015a580c/test_unicode.py |
verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))), 'utf-8') == u'\U00023456' ) verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))), 'utf-8') == u'\U00010002' ) verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))), 'utf-8') == u'\u20ac' ) | verify(unicode('\xf0\xa3\x91\x96', 'utf-8') == u'\U00023456' ) verify(unicode('\xf0\x90\x80\x82', 'utf-8') == u'\U00010002' ) verify(unicode('\xe2\x82\xac', 'utf-8') == u'\u20ac' ) | def __str__(self): return self.x | a213c625f62e7b21d0c3de7912ef5caf015a580c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a213c625f62e7b21d0c3de7912ef5caf015a580c/test_unicode.py |
def test_SEH(self): import sys if not hasattr(sys, "getobjects"): | import _ctypes if _ctypes.uses_seh(): def test_SEH(self): | def test_SEH(self): # Call functions with invalid arguments, and make sure that access violations # are trapped and raise an exception. # # Normally, in a debug build of the _ctypes extension # module, exceptions are not trapped, so we can only run # this test in a release build. import sys if not hasattr(sys, "getobje... | 2d180ee12f0516cb3888d82bb912f29d5d822901 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d180ee12f0516cb3888d82bb912f29d5d822901/test_win32.py |
key = user, passwd, host, port | key = user, host, port, '/'.join(dirs) | def connect_ftp(self, user, passwd, host, port, dirs): key = user, passwd, host, port if key in self.cache: self.timeout[key] = time.time() + self.delay else: self.cache[key] = ftpwrapper(user, passwd, host, port, dirs) self.timeout[key] = time.time() + self.delay self.check_cache() return self.cache[key] | 115c90b3e2e4f0458f58409d3c250b8bf842c84b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/115c90b3e2e4f0458f58409d3c250b8bf842c84b/urllib2.py |
rep = self__repr(object, context, level - 1) | rep = self.__repr(object, context, level - 1) | def __format(self, object, stream, indent, allowance, context, level): | a5eb116b3fd59502c405dff792f767c5fb3271e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5eb116b3fd59502c405dff792f767c5fb3271e6/pprint.py |
pprint(object[0], stream, indent, allowance + 1) | self.__format(object[0], stream, indent, allowance + 1, context, level) | def __format(self, object, stream, indent, allowance, context, level): | a5eb116b3fd59502c405dff792f767c5fb3271e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a5eb116b3fd59502c405dff792f767c5fb3271e6/pprint.py |
for base in cls.__bases__: if hasattr(base, "_getDefaults"): defaults.update(base._getDefaults()) | def _getDefaults(cls): defaults = {} for name, value in cls.__dict__.items(): if name[0] != "_" and not isinstance(value, (function, classmethod)): defaults[name] = deepcopy(value) for base in cls.__bases__: if hasattr(base, "_getDefaults"): defaults.update(base._getDefaults()) return defaults | 0c10d2afe351c1a9a205626fa8c30429a8261616 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c10d2afe351c1a9a205626fa8c30429a8261616/bundlebuilder.py | |
def _parse(source, state, flags=0): # parse regular expression pattern into an operator list. subpattern = SubPattern(state) while 1: if source.next in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if state.flags & SRE_FLAG_VERBOSE: # skip whitespace and comments... | 97236c6d7544b0ad5732e85c1ba7fd7151b00d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97236c6d7544b0ad5732e85c1ba7fd7151b00d5a/sre_parse.py | ||
raise error, "unterminated index" | raise error, "unterminated group name" | def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) p = [] a = p.append while 1: this = s.get() if this is None: break # end of replacement string if this and this[0] == "\\": if this == "\\g": name = "" if s.match("<"): while 1: char =... | 97236c6d7544b0ad5732e85c1ba7fd7151b00d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97236c6d7544b0ad5732e85c1ba7fd7151b00d5a/sre_parse.py |
def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) p = [] a = p.append while 1: this = s.get() if this is None: break # end of replacement string if this and this[0] == "\\": if this == "\\g": name = "" if s.match("<"): while 1: char =... | 97236c6d7544b0ad5732e85c1ba7fd7151b00d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97236c6d7544b0ad5732e85c1ba7fd7151b00d5a/sre_parse.py | ||
raise error, "bad index" | raise error, "bad group name" | def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) p = [] a = p.append while 1: this = s.get() if this is None: break # end of replacement string if this and this[0] == "\\": if this == "\\g": name = "" if s.match("<"): while 1: char =... | 97236c6d7544b0ad5732e85c1ba7fd7151b00d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97236c6d7544b0ad5732e85c1ba7fd7151b00d5a/sre_parse.py |
raise IndexError, "unknown index" | raise IndexError, "unknown group name" | def parse_template(source, pattern): # parse 're' replacement string into list of literals and # group references s = Tokenizer(source) p = [] a = p.append while 1: this = s.get() if this is None: break # end of replacement string if this and this[0] == "\\": if this == "\\g": name = "" if s.match("<"): while 1: char =... | 97236c6d7544b0ad5732e85c1ba7fd7151b00d5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/97236c6d7544b0ad5732e85c1ba7fd7151b00d5a/sre_parse.py |
isbigendian = struct.pack('=i', 1)[0] == chr(0) | def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py | |
('='+fmt, isbigendian and big or lil)]: | ('='+fmt, ISBIGENDIAN and big or lil)]: | def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py |
def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py | ||
def string_reverse(s): chars = list(s) chars.reverse() return "".join(chars) def bigendian_to_native(value): if isbigendian: return value else: return string_reverse(value) | def any_err(func, *args): try: apply(func, args) except (struct.error, OverflowError, TypeError): pass else: raise TestFailed, "%s%s did not raise error" % ( func.__name__, args) | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py | |
MIN_Q, MAX_Q = 0, 2L**64 - 1 MIN_q, MAX_q = -(2L**63), 2L**63 - 1 | def test_native_qQ(): bytes = struct.calcsize('q') # The expected values here are in big-endian format, primarily because # I'm on a little-endian machine and so this is the clearest way (for # me) to force the code to get exercised. for format, input, expected in ( ('q', -1, '\xff' * bytes), ('q', 0, '\x00' * bytes), ... | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py | |
def test_one_qQ(x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std q/Q on", x, "==", hex(x) if MIN_q <= x <= MAX_q: expected = long(x) if x < 0: expected += 1L << 64 assert expected > 0 expected = hex(expected)[2:-1] if len(expected) & 1: expected = "0" + expected... | class IntTester: BUGGY_RANGE_CHECK = "bBhHIL" def __init__(self, formatpair, bytesize): assert len(formatpair) == 2 self.formatpair = formatpair for direction in "<>!=": for code in formatpair: format = direction + code verify(struct.calcsize(format) == bytesize) self.bytesize = bytesize self.bitsize = bytesize * 8... | def test_one_qQ(x, pack=struct.pack, unpack=struct.unpack, unhexlify=binascii.unhexlify): if verbose: print "trying std q/Q on", x, "==", hex(x) # Try 'q'. if MIN_q <= x <= MAX_q: # Try '>q'. expected = long(x) if x < 0: expected += 1L << 64 assert expected > 0 expected = hex(expected)[2:-1] # chop "0x" and trailing '... | 4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fb18ac9e6cf7ddf218d3560fd25420c4aa7f1c2/test_struct.py |
found_docstring = False | def visitModule(self, node): stmt = node.node found_docstring = False for s in stmt.nodes: # Skip over docstrings if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue if not self.check_stmt(s): break | a75807724da1964ecece8e7f65b2c583a808ca50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a75807724da1964ecece8e7f65b2c583a808ca50/future.py | |
if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue | def visitModule(self, node): stmt = node.node found_docstring = False for s in stmt.nodes: # Skip over docstrings if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue if not self.check_stmt(s): break | a75807724da1964ecece8e7f65b2c583a808ca50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a75807724da1964ecece8e7f65b2c583a808ca50/future.py | |
Will quote the value if needed or if quote is true. | This will quote the value if needed or if quote is true. | def _formatparam(param, value=None, quote=1): """Convenience function to format and return a key=value pair. Will quote the value if needed or if quote is true. """ if value is not None and len(value) > 0: # BAW: Please check this. I think that if quote is set it should # force quoting even if not necessary. if quote... | 1cca6772173993cc35d4ffe65dace9d6254e41ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cca6772173993cc35d4ffe65dace9d6254e41ea/Message.py |
return [(k, Utils.unquote(v)) for k, v in params] | return [(k, _unquotevalue(v)) for k, v in params] | def get_params(self, failobj=None, header='content-type', unquote=1): """Return the message's Content-Type: parameters, as a list. | 1cca6772173993cc35d4ffe65dace9d6254e41ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cca6772173993cc35d4ffe65dace9d6254e41ea/Message.py |
return Utils.unquote(v) | return _unquotevalue(v) | def get_param(self, param, failobj=None, header='content-type', unquote=1): """Return the parameter value if found in the Content-Type: header. | 1cca6772173993cc35d4ffe65dace9d6254e41ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cca6772173993cc35d4ffe65dace9d6254e41ea/Message.py |
return Utils.unquote(filename.strip()) | if isinstance(filename, TupleType): newvalue = _unquotevalue(filename) return unicode(newvalue[2], newvalue[0]) else: newvalue = _unquotevalue(filename.strip()) return newvalue | def get_filename(self, failobj=None): """Return the filename associated with the payload if present. | 1cca6772173993cc35d4ffe65dace9d6254e41ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cca6772173993cc35d4ffe65dace9d6254e41ea/Message.py |
return Utils.unquote(boundary.strip()) | return _unquotevalue(boundary.strip()) | def get_boundary(self, failobj=None): """Return the boundary associated with the payload if present. | 1cca6772173993cc35d4ffe65dace9d6254e41ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cca6772173993cc35d4ffe65dace9d6254e41ea/Message.py |
self.compile = 0 | self.compile = None | def initialize_options (self): | 9de1f990cdc226349d9bfee00809ce4fbe92f0f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9de1f990cdc226349d9bfee00809ce4fbe92f0f0/install.py |
except: pass | except OSError: pass | def nextfile(self): savestdout = self._savestdout self._savestdout = 0 if savestdout: sys.stdout = savestdout | f17bad0a67938d038bb7fd007932795862423656 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f17bad0a67938d038bb7fd007932795862423656/fileinput.py |
except: | except OSError: | def readline(self): try: line = self._buffer[self._bufindex] except IndexError: pass else: self._bufindex += 1 self._lineno += 1 self._filelineno += 1 return line if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._i... | f17bad0a67938d038bb7fd007932795862423656 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f17bad0a67938d038bb7fd007932795862423656/fileinput.py |
except: | except OSError: | def readline(self): try: line = self._buffer[self._bufindex] except IndexError: pass else: self._bufindex += 1 self._lineno += 1 self._filelineno += 1 return line if not self._file: if not self._files: return "" self._filename = self._files[0] self._files = self._files[1:] self._filelineno = 0 self._file = None self._i... | f17bad0a67938d038bb7fd007932795862423656 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f17bad0a67938d038bb7fd007932795862423656/fileinput.py |
dbgmsg("%s<%s> at %s" % (" "*depth, name, point)) | dbgmsg("pushing <%s> at %s" % (name, point)) | def pushing(name, point, depth): dbgmsg("%s<%s> at %s" % (" "*depth, name, point)) | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
dbgmsg("%s</%s> at %s" % (" "*depth, name, point)) class Conversion: def __init__(self, ifp, ofp, table=None, discards=(), autoclosing=()): | dbgmsg("popping </%s> at %s" % (name, point)) class _Stack(UserList.UserList): StringType = type('') def append(self, entry): if type(entry) is not self.StringType: raise LaTeXFormatError("cannot push non-string on stack: " + `entry`) sys.stderr.write("%s<%s>\n" % (" "*len(self.data), entry)) self.data.append(entry)... | def popping(name, point, depth): dbgmsg("%s</%s> at %s" % (" "*depth, name, point)) | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
self.err_write = sys.stderr.write | def __init__(self, ifp, ofp, table=None, discards=(), autoclosing=()): self.ofp_stack = [ofp] self.pop_output() self.table = table self.discards = discards self.autoclosing = autoclosing self.line = string.join(map(string.rstrip, ifp.readlines()), "\n") self.err_write = sys.stderr.write self.preamble = 1 | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
stack = [] | stack = self.stack | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
stack = [] | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) | raise LaTeXStackError(envname, stack) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
line = line[m.end(1):] | line = line[m.end(1):] | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
pushing(macroname, "a", depth + len(stack)) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
pushing(macroname, "b", len(stack) + depth) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) | def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
def convert(self): self.subconvert() | def convert(self): self.subconvert() | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
def convert(ifp, ofp, table={}, discards=(), autoclosing=()): | class NewConversion(BaseConversion): def __init__(self, ifp, ofp, table={}): BaseConversion.__init__(self, ifp, ofp, table) self.discards = [] def subconvert(self, endchar=None, depth=0): stack = new_stack() line = self.line while line: if line[0] == endchar and not stack: self.line = line return line m = _commen... | def convert(ifp, ofp, table={}, discards=(), autoclosing=()): c = Conversion(ifp, ofp, table, discards, autoclosing) try: c.convert() except IOError, (err, msg): if err != errno.EPIPE: raise | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
while line and line[0] in " %\n\t": | while line and line[0] in " %\n\t\r": | def skip_white(line): while line and line[0] in " %\n\t": line = string.lstrip(line[1:]) return line | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
if len(sys.argv) == 2: ifp = open(sys.argv[1]) | global DEBUG convert = new_convert newstyle = 1 opts, args = getopt.getopt(sys.argv[1:], "Dn", ["debug", "new"]) for opt, arg in opts: if opt in ("-n", "--new"): convert = new_convert newstyle = 1 elif opt in ("-o", "--old"): convert = old_convert newstyle = 0 elif opt in ("-D", "--debug"): DEBUG = DEBUG + 1 if len(ar... | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") | elif len(args) == 1: ifp = open(args) ofp = sys.stdout elif len(args) == 2: ifp = open(args[0]) ofp = open(args[1], "w") | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
convert(ifp, ofp, { | table = { | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
"appendix": ([], 0, 1, 0, 0), | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
"catcode": ([], 0, 1, 0, 0), | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py | |
}, | } if newstyle: table = load_table(open(os.path.join(sys.path[0], 'conversion.xml'))) convert(ifp, ofp, table, | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries have the form: # name: ([attribute names], is1stOptional, isEmpty, isEnv, nocontent) # attribute names can be:... | 9c473c6a358659888084683e3936939942224818 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9c473c6a358659888084683e3936939942224818/latex2esis.py |
test.test_support.run_unittest(XrangeTest) | test.test_support.run_unittest(BytesTest) | def test_main(): test.test_support.run_unittest(XrangeTest) | bb72b95569dbae097138524f766c82472509fba9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb72b95569dbae097138524f766c82472509fba9/test_bytes.py |
name = `id(self)` | Image._last_id += 1 name = "pyimage" +`Image._last_id` | def __init__(self, imgtype, name=None, cnf={}, master=None, **kw): self.name = None if not master: master = _default_root if not master: raise RuntimeError, 'Too early to create image' self.tk = master.tk if not name: name = `id(self)` # The following is needed for systems where id(x) # can return a negative number, su... | 6a3e1c36467593ab8624beac93251ba79f586c12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6a3e1c36467593ab8624beac93251ba79f586c12/Tkinter.py |
(e[0], e[2], str(error)) | (e[0], e[2], str(result)) | def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = int(now) gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='AM' else: ampm='PM' jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] if now[3] > 12:... | 30c1d1e94d96fabbc83e4664921dfc0e7320ca69 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30c1d1e94d96fabbc83e4664921dfc0e7320ca69/test_strftime.py |
n = int(s.rstrip(NUL) or "0", 8) | n = int(s.rstrip(NUL + " ") or "0", 8) | def nti(s): """Convert a number field to a python number. """ # There are two possible encodings for a number field, see # itn() below. if s[0] != chr(0200): n = int(s.rstrip(NUL) or "0", 8) else: n = 0L for i in xrange(len(s) - 1): n <<= 8 n += ord(s[i + 1]) return n | 3da63f34b8adc2f34d64911e66fafbca60c765df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3da63f34b8adc2f34d64911e66fafbca60c765df/tarfile.py |
the local hostname is found using gethostbyname(). | the local hostname is found using socket.getfqdn(). | def __init__(self, host = '', port = 0, local_hostname = None): """Initialize a new instance. | c7365d876391e3b1a1dcda294a35385febc3b51d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7365d876391e3b1a1dcda294a35385febc3b51d/smtplib.py |
self.transient(parent) | if parent.winfo_viewable(): self.transient(parent) | def __init__(self, parent, title = None): | 80e59986f893af27eb31b71a214fe1135431c9b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/80e59986f893af27eb31b71a214fe1135431c9b6/tkSimpleDialog.py |
def list(self, which=None): | def list(self, msg=None): | def list(self, which=None): """Request listing, return result. Result is in form ['response', ['mesg_num octets', ...]]. | 4628ed82b6caaf4872cbb379aec34ca07b56abe9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4628ed82b6caaf4872cbb379aec34ca07b56abe9/poplib.py |
Result is in form ['response', ['mesg_num octets', ...]]. Unsure what the optional 'msg' arg does. | Result without a msg argument is in form ['response', ['mesg_num octets', ...]]. Result when a msg argument is given is a single response: the "scan listing" for that message. | def list(self, which=None): """Request listing, return result. Result is in form ['response', ['mesg_num octets', ...]]. | 4628ed82b6caaf4872cbb379aec34ca07b56abe9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4628ed82b6caaf4872cbb379aec34ca07b56abe9/poplib.py |
return self._longcmd('LIST %s' % which) | return self._shortcmd('LIST %s' % which) | def list(self, which=None): """Request listing, return result. Result is in form ['response', ['mesg_num octets', ...]]. | 4628ed82b6caaf4872cbb379aec34ca07b56abe9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4628ed82b6caaf4872cbb379aec34ca07b56abe9/poplib.py |
if not strm: | if strm is None: | def __init__(self, strm=None): """ Initialize the handler. | c49bb67e7a3212109f74a1d8b159b6445a4edb4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c49bb67e7a3212109f74a1d8b159b6445a4edb4c/__init__.py |
__contains__ = has_key | def __contains__(self, key): return self.has_key(key) | def has_key(self, key): try: value = self[key] except KeyError: return False return True | 66d3f09e20346de3661e86f482ad29aec2b684a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66d3f09e20346de3661e86f482ad29aec2b684a4/UserDict.py |
iterkeys = __iter__ | def iterkeys(self): return self.__iter__() | def iteritems(self): for k in self: yield (k, self[k]) | 66d3f09e20346de3661e86f482ad29aec2b684a4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/66d3f09e20346de3661e86f482ad29aec2b684a4/UserDict.py |
if ((template_exists and (template_newer or setup_newer)) or self.force_manifest or self.manifest_only): | if manifest_outofdate or neither_exists or force_regen: | def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the s... | af95fbe90c7e9248f21f2a41d9aefac3b1c651a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af95fbe90c7e9248f21f2a41d9aefac3b1c651a9/sdist.py |
standards = [('README', 'README.txt'), 'setup.py'] | standards = [('README', 'README.txt'), self.distribution.script_name] | def add_defaults (self): """Add all the default files to self.filelist: - README or README.txt - setup.py - test/test*.py - all pure Python modules mentioned in setup script - all C sources listed as part of extensions or C libraries in the setup script (doesn't catch C headers!) Warns if (README or README.txt) or setu... | af95fbe90c7e9248f21f2a41d9aefac3b1c651a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af95fbe90c7e9248f21f2a41d9aefac3b1c651a9/sdist.py |
or code in (302, 303) and m == "POST"): | or code in (301, 302, 303) and m == "POST"): | def redirect_request(self, req, fp, code, msg, headers, newurl): """Return a Request or None in response to a redirect. | 5606397634057a9981172d11983ec34cbf49d8f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5606397634057a9981172d11983ec34cbf49d8f2/urllib2.py |
inf_msg = "The HTTP server returned a redirect error that would" \ | inf_msg = "The HTTP server returned a redirect error that would " \ | def http_error_302(self, req, fp, code, msg, headers): if 'location' in headers: newurl = headers['location'] elif 'uri' in headers: newurl = headers['uri'] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl) | 5606397634057a9981172d11983ec34cbf49d8f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5606397634057a9981172d11983ec34cbf49d8f2/urllib2.py |
"The last 302 error message was:\n" | "The last 30x error message was:\n" | def http_error_302(self, req, fp, code, msg, headers): if 'location' in headers: newurl = headers['location'] elif 'uri' in headers: newurl = headers['uri'] else: return newurl = urlparse.urljoin(req.get_full_url(), newurl) | 5606397634057a9981172d11983ec34cbf49d8f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5606397634057a9981172d11983ec34cbf49d8f2/urllib2.py |
def powtest(type): if type != float: print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if pow(type(i), 0) != 1: raise ValueError, 'pow('+str(i)+',0) != 1' if pow(type(i), 1) != type(i): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if pow(type(0), 1) != type(0): raise ValueError, 'pow(0,'... | def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PowTest)) test.test_support.run_suite(suite) | def powtest(type): if type != float: print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if pow(type(i), 0) != 1: raise ValueError, 'pow('+str(i)+',0) != 1' if pow(type(i), 1) != type(i): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if pow(type(0), 1) != type(0): raise ValueError, 'pow(0,'... | 1127e98fd0be9ff7c67c7bfa9d802d9c21b40579 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1127e98fd0be9ff7c67c7bfa9d802d9c21b40579/test_pow.py |
for i in range(-100, 100): if pow(type(i), 3) != i*i*i: raise ValueError, 'pow('+str(i)+',3) != '+str(i*i*i) pow2 = 1 for i in range(0,31): if pow(2, i) != pow2: raise ValueError, 'pow(2,'+str(i)+') != '+str(pow2) if i != 30 : pow2 = pow2*2 for othertype in int, long: for i in range(-10, 0) + range(1, 10): ii = type(... | if __name__ == "__main__": test_main() | def powtest(type): if type != float: print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if pow(type(i), 0) != 1: raise ValueError, 'pow('+str(i)+',0) != 1' if pow(type(i), 1) != type(i): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if pow(type(0), 1) != type(0): raise ValueError, 'pow(0,'... | 1127e98fd0be9ff7c67c7bfa9d802d9c21b40579 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1127e98fd0be9ff7c67c7bfa9d802d9c21b40579/test_pow.py |
if len(text) <= 1: text = ' '+text | if not text: text = ' ' | def record_sub_info(match_object,sub_info=sub_info): sub_info.append([match_object.group(1)[0],match_object.span()]) return match_object.group(1) | 72602dd1a6f01f246b8c8754fcc8f22b07de7e4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/72602dd1a6f01f246b8c8754fcc8f22b07de7e4a/difflib.py |
return '[Errno %d] %s: %s' % (self.errno, self.strerror, | return '[Errno %s] %s: %s' % (self.errno, self.strerror, | def __str__(self): if self.filename: return '[Errno %d] %s: %s' % (self.errno, self.strerror, self.filename) elif self.errno and self.strerror: return '[Errno %d] %s' % (self.errno, self.strerror) else: return StandardError.__str__(self) | 75204810f07a216b910ad2292c161b9e5ffaf7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75204810f07a216b910ad2292c161b9e5ffaf7fc/exceptions.py |
return '[Errno %d] %s' % (self.errno, self.strerror) | return '[Errno %s] %s' % (self.errno, self.strerror) | def __str__(self): if self.filename: return '[Errno %d] %s: %s' % (self.errno, self.strerror, self.filename) elif self.errno and self.strerror: return '[Errno %d] %s' % (self.errno, self.strerror) else: return StandardError.__str__(self) | 75204810f07a216b910ad2292c161b9e5ffaf7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75204810f07a216b910ad2292c161b9e5ffaf7fc/exceptions.py |
else: | elif tokentype in (NAME, OP) and level == 1: | def _readmodule(module, path, inpackage=None): '''Do the hard work for readmodule[_ex].''' # Compute the full module name (prepending inpackage if set) if inpackage: fullmodule = "%s.%s" % (inpackage, module) else: fullmodule = module # Check in the cache if fullmodule in _modules: return _modules[fullmodule] # Initi... | 08a7e650b585ad3db82bcfffb40966c63d9f3508 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08a7e650b585ad3db82bcfffb40966c63d9f3508/pyclbr.py |
print '\tnew IMAP4 connection, tag=%s' % self.tagpre | _mesg('new IMAP4 connection, tag=%s' % self.tagpre) | def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_respo... | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
print '\tCAPABILITIES: %s' % `self.capabilities` | _mesg('CAPABILITIES: %s' % `self.capabilities`) | def __init__(self, host = '', port = IMAP4_PORT): self.host = host self.port = port self.debug = Debug self.state = 'LOGOUT' self.literal = None # A literal argument to a command self.tagged_commands = {} # Tagged commands awaiting response self.untagged_responses = {} # {typ: [data, ...], ...} self.continuation_respo... | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
def __getattr__(self, attr): """Allow UPPERCASE variants of all following IMAP4 commands.""" if Commands.has_key(attr): return eval("self.%s" % string.lower(attr)) raise AttributeError("Unknown IMAP4 command: '%s'" % attr) | def recent(self): """Return most recent 'RECENT' responses if any exist, else prompt server for an update using the 'NOOP' command. (typ, [data]) = <instance>.recent() 'data' is None if no new messages, else list of RECENT responses, most recent last. """ name = 'RECENT' typ, dat = self._untagged_response('OK', [None... | def __getattr__(self, attr): """Allow UPPERCASE variants of all following IMAP4 commands.""" if Commands.has_key(attr): return eval("self.%s" % string.lower(attr)) raise AttributeError("Unknown IMAP4 command: '%s'" % attr) | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
raise self.error(dat) | raise self.error(dat[-1]) | def authenticate(self, mechanism, authobject): """Authenticate command - requires response processing. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
try: typ, dat = self._simple_command('CLOSE') except EOFError: typ, dat = None, [None] | typ, dat = self._simple_command('CLOSE') | def close(self): """Close currently selected mailbox. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
return self._untagged_response(typ, name) | return self._untagged_response(typ, dat, name) | def expunge(self): """Permanently remove deleted items from selected mailbox. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
return self._untagged_response(typ, name) | return self._untagged_response(typ, dat, name) | def fetch(self, message_set, message_parts): """Fetch (parts of) messages. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
return self._untagged_response(typ, name) | return self._untagged_response(typ, dat, name) | def list(self, directory='""', pattern='*'): """List mailbox names in directory matching pattern. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
raise self.error(dat) | raise self.error(dat[-1]) | def login(self, user, password): """Identify client using plaintext password. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
except EOFError: typ, dat = None, [None] | except: typ, dat = 'NO', ['%s: %s' % sys.exc_info()[:2]] | def logout(self): """Shutdown connection to server. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
return self._untagged_response(typ, name) | return self._untagged_response(typ, dat, name) | def lsub(self, directory='""', pattern='*'): """List 'subscribed' mailbox names in directory matching pattern. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
print '\tuntagged responses: %s' % `self.untagged_responses` | _dump_ur(self.untagged_responses) | def noop(self): """Send NOOP command. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
return self._untagged_response(typ, 'FETCH') def recent(self): """Return most recent 'RECENT' responses if any exist, else prompt server for an update using the 'NOOP' command, and flush all untagged responses. (typ, [data]) = <instance>.recent() 'data' is None if no new messages, else list of RECENT responses, mos... | return self._untagged_response(typ, dat, 'FETCH') | def partial(self, message_num, message_part, start, length): """Fetch truncated part of a message. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
def response(self, code): """Return data for response 'code' if received, or None. Old value for response 'code' is cleared. (code, [data]) = <instance>.response(code) """ return self._untagged_response(code, string.upper(code)) | def rename(self, oldmailbox, newmailbox): """Rename old mailbox name to new. | 30d7469fec69eeeae9057b22a126d4a00278147c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/30d7469fec69eeeae9057b22a126d4a00278147c/imaplib.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.