rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
line = "%s: %s\n" % (etype, _some_str(value)) | line = "%s: %s\n" % (etype, valuestr) | def _format_final_exc_line(etype, value): """Return a list of a single line -- normal case for format_exception_only""" try: printable = value is None or not str(value) except: printable = False if printable: line = "%s\n" % etype else: line = "%s: %s\n" % (etype, _some_str(value)) return line | 16183631ede0656a5cfd58626419cc081d281fff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/16183631ede0656a5cfd58626419cc081d281fff/traceback.py |
try: os.rename(self.baseFilename, dfn) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record) | os.rename(self.baseFilename, dfn) | def doRollover(self): """ Do a rollover, as described in __init__(). """ | 6dd59f1632fd174ffdd255acca4b596a69e1a5b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6dd59f1632fd174ffdd255acca4b596a69e1a5b4/handlers.py |
try: os.rename(self.baseFilename, dfn) except (KeyboardInterrupt, SystemExit): raise except: self.handleError(record) | os.rename(self.baseFilename, dfn) | def doRollover(self): """ do a rollover; in this case, a date/time stamp is appended to the filename when the rollover happens. However, you want the file to be named for the start of the interval, not the current time. If there is a backup count, then we have to get a list of matching filenames, sort them and remove... | 6dd59f1632fd174ffdd255acca4b596a69e1a5b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6dd59f1632fd174ffdd255acca4b596a69e1a5b4/handlers.py |
d = dict(items={}) | d = dict({}) | def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py |
vereq(d, dict(items=d.iteritems())) | vereq(d, dict(d.iteritems())) d = dict({'one':1, 'two':2}) vereq(d, dict(one=1, two=2)) vereq(d, dict(**d)) vereq(d, dict({"one": 1}, two=2)) vereq(d, dict([("two", 2)], one=1)) vereq(d, dict([("one", 100), ("two", 200)], **d)) verify(d is not dict(**d)) | def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py |
try: dict(senseless={}) except TypeError: pass else: raise TestFailed("no TypeError from dict(senseless={})") | def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py | |
d = dict(items=Mapping()) | d = dict(Mapping()) | def dict_constructor(): if verbose: print "Testing dict constructor ..." d = dict() vereq(d, {}) d = dict({}) vereq(d, {}) d = dict(items={}) vereq(d, {}) d = dict({1: 2, 'a': 'b'}) vereq(d, {1: 2, 'a': 'b'}) vereq(d, dict(d.items())) vereq(d, dict(items=d.iteritems())) for badarg in 0, 0L, 0j, "0", [0], (0,): try: dic... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py |
vereq(dict(items={1: 2}), {1: 2}) | def keywords(): if verbose: print "Testing keyword args to basic type constructors ..." vereq(int(x=1), 1) vereq(float(x=2), 2.0) vereq(long(x=3), 3L) vereq(complex(imag=42, real=666), complex(666, 42)) vereq(str(object=500), '500') vereq(unicode(string='abc', errors='strict'), u'abc') vereq(tuple(sequence=range(3)), (... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py | |
tuple, list, dict, file): | tuple, list, file): | def keywords(): if verbose: print "Testing keyword args to basic type constructors ..." vereq(int(x=1), 1) vereq(float(x=2), 2.0) vereq(long(x=3), 3L) vereq(complex(imag=42, real=666), complex(666, 42)) vereq(str(object=500), '500') vereq(unicode(string='abc', errors='strict'), u'abc') vereq(tuple(sequence=range(3)), (... | a797d8150dd6fd8336653d8e91db3c088f2c53ff /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a797d8150dd6fd8336653d8e91db3c088f2c53ff/test_descr.py |
def doc(thing, title='Python Library Documentation: '): | def doc(thing, title='Python Library Documentation: %s'): | def doc(thing, title='Python Library Documentation: '): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s... | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
pager(title + desc + suffix + '\n\n' + text.document(object, name)) | pager(title % (desc + suffix) + '\n\n' + text.document(thing, name)) | def doc(thing, title='Python Library Documentation: '): """Display text documentation, given an object or a path to an object.""" suffix, name = '', None if type(thing) is type(''): try: object = locate(thing) except ErrorDuringImport, value: print value return if not object: print 'no Python documentation found for %s... | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
def run(self, key, callback, completer=None): key = lower(key) | def run(self, callback, key=None, completer=None): if key: key = lower(key) | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | if key is None: callback(None, modname, '') else: desc = split(freshimport(modname).__doc__ or '', '\n')[0] if find(lower(modname + ' - ' + desc), key) >= 0: callback(None, modname, desc) | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
if key: | if key is None: callback(path, modname, '') else: | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
else: callback(path, modname, '') | def run(self, key, callback, completer=None): key = lower(key) self.quit = 0 seen = {} | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py | |
ModuleScanner().run(key, callback) | ModuleScanner().run(callback, key) | def callback(path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' print modname, desc and '- ' + desc | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
def serve(port, callback=None, finalizer=None): | def serve(port, callback=None, completer=None): | def serve(port, callback=None, finalizer=None): import BaseHTTPServer, SocketServer, mimetools, select # Patch up mimetools.Message so it doesn't break if rfc822 is reloaded. class Message(mimetools.Message): def __init__(self, fp, seekable=1): Message = self.__class__ Message.__bases__[0].__bases__[0].__init__(self, ... | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
if finalizer: finalizer() | if completer: completer() | def server_activate(self): self.base.server_activate(self) if self.callback: self.callback(self) | 662469619aff9e9ef8cc61fd4b529ed34806b3f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/662469619aff9e9ef8cc61fd4b529ed34806b3f1/pydoc.py |
self.prefix = sys.prefix | self.prefix = os.path.normpath (sys.prefix) | def set_final_options (self): | c27d80025134ee2ae92557af3b9d6c5496004c88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c27d80025134ee2ae92557af3b9d6c5496004c88/install.py |
self.exec_prefix = sys.exec_prefix | self.exec_prefix = os.path.normpath (sys.exec_prefix) | def set_final_options (self): | c27d80025134ee2ae92557af3b9d6c5496004c88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c27d80025134ee2ae92557af3b9d6c5496004c88/install.py |
sys_prefix = sys.exec_prefix | sys_prefix = os.path.normpath (sys.exec_prefix) | def replace_sys_prefix (self, config_attr, fallback_postfix, use_exec=0): """Attempts to glean a simple pattern from an installation directory available as a 'sysconfig' attribute: if the directory name starts with the "system prefix" (the one hard-coded in the Makefile and compiled into Python), then replace it with t... | c27d80025134ee2ae92557af3b9d6c5496004c88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c27d80025134ee2ae92557af3b9d6c5496004c88/install.py |
sys_prefix = sys.prefix | sys_prefix = os.path.normpath (sys.prefix) | def replace_sys_prefix (self, config_attr, fallback_postfix, use_exec=0): """Attempts to glean a simple pattern from an installation directory available as a 'sysconfig' attribute: if the directory name starts with the "system prefix" (the one hard-coded in the Makefile and compiled into Python), then replace it with t... | c27d80025134ee2ae92557af3b9d6c5496004c88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c27d80025134ee2ae92557af3b9d6c5496004c88/install.py |
except pickle.UnpicklingError: | except pickle.PicklingError: | def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try: s = pickle.dumps(message) except pickle.UnpicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise s = struct.pack("<i", len(s)) + s while len(s) > 0: try: n = self.sock.send(s) except (AttributeError, socket.error): # socket ... | d6ab77d27dae87d7ffb66db0a411a631ce85a11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6ab77d27dae87d7ffb66db0a411a631ce85a11d/rpc.py |
n = self.sock.send(s) | r, w, x = select.select([], [self.sock], []) n = self.sock.send(s[:BUFSIZE]) | def putmessage(self, message): self.debug("putmessage:%d:" % message[0]) try: s = pickle.dumps(message) except pickle.UnpicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise s = struct.pack("<i", len(s)) + s while len(s) > 0: try: n = self.sock.send(s) except (AttributeError, socket.error): # socket ... | d6ab77d27dae87d7ffb66db0a411a631ce85a11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6ab77d27dae87d7ffb66db0a411a631ce85a11d/rpc.py |
def ioready(self, wait): r, w, x = select.select([self.sock.fileno()], [], [], wait) return len(r) | def ioready(self, wait): r, w, x = select.select([self.sock.fileno()], [], [], wait) return len(r) | d6ab77d27dae87d7ffb66db0a411a631ce85a11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6ab77d27dae87d7ffb66db0a411a631ce85a11d/rpc.py | |
if not self.ioready(wait): | r, w, x = select.select([self.sock.fileno()], [], [], wait) if len(r) == 0: | def pollpacket(self, wait): self._stage0() if len(self.buffer) < self.bufneed: if not self.ioready(wait): return None try: s = self.sock.recv(BUFSIZE) except socket.error: raise EOFError if len(s) == 0: raise EOFError self.buffer += s self._stage0() return self._stage1() | d6ab77d27dae87d7ffb66db0a411a631ce85a11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6ab77d27dae87d7ffb66db0a411a631ce85a11d/rpc.py |
except: | except pickle.UnpicklingError: | def pollmessage(self, wait): packet = self.pollpacket(wait) if packet is None: return None try: message = pickle.loads(packet) except: print >>sys.__stderr__, "-----------------------" print >>sys.__stderr__, "cannot unpickle packet:", `packet` traceback.print_stack(file=sys.__stderr__) print >>sys.__stderr__, "-------... | d6ab77d27dae87d7ffb66db0a411a631ce85a11d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d6ab77d27dae87d7ffb66db0a411a631ce85a11d/rpc.py |
self.write(STOP) def dump_special(self, callable, args, state = None): if type(args) is not TupleType and args is not None: raise PicklingError, "Second argument to dump_special " \ "must be a tuple" self.save_reduce(callable, args, state) | def dump(self, object): self.save(object) self.write(STOP) | d370379186e1639ff43b245c54ed56dbdc8ab96c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d370379186e1639ff43b245c54ed56dbdc8ab96c/pickle.py | |
def save_float(self, object): self.write(FLOAT + `object` + '\n') | def save_float(self, object, pack=struct.pack): if self.bin: self.write(BINFLOAT + pack('>d', object)) else: self.write(FLOAT + `object` + '\n') | def save_float(self, object): self.write(FLOAT + `object` + '\n') | d370379186e1639ff43b245c54ed56dbdc8ab96c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d370379186e1639ff43b245c54ed56dbdc8ab96c/pickle.py |
def test_05_no_pop_tops(self): self.run_test(no_pop_tops) | ## def test_05_no_pop_tops(self): | 4ffedadb1032a4310e756d476310d056ad209310 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4ffedadb1032a4310e756d476310d056ad209310/test_trace.py | |
list.append('%s: %s\n' % (str(stype), str(value))) return list | list.append('%s: %s\n' % (str(stype), _some_str(value))) return list def _some_str(value): try: return str(value) except: return '<unprintable %s object>' % type(value).__name__ | def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_value. The return value is a list of strings, each ending in a newline. Normally, the list contains a single string; however, for SyntaxError... | 2823f03a56451f3187a1d85ffcef107f00f6f48e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2823f03a56451f3187a1d85ffcef107f00f6f48e/traceback.py |
up in the table self.extensions_map, using text/plain | up in the table self.extensions_map, using application/octet-stream | def guess_type(self, path): """Guess the type of a file. | b839c1f33f842720e9592c4ef598688bed94266f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b839c1f33f842720e9592c4ef598688bed94266f/SimpleHTTPServer.py |
exts.append( Extension('MacOS', ['macosmodule.c']) ) exts.append( Extension('icglue', ['icgluemodule.c']) ) exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c']) ) exts.append( Extension('_CF', ['cf/_CFmodule.c'], extra_link_args=['-framework', 'CoreFoundation']) ) exts.append( Extension('_... | exts.append( Extension('MacOS', ['macosmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('icglue', ['icgluemodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('macfs', ['macfsmodule.c', '../Python/getapplbycreator.c'], extra_link_args=['-framework', 'Carbon']) ) e... | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 666b1e7e2f929af06fdfd074304a727f3dc5ed12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/666b1e7e2f929af06fdfd074304a727f3dc5ed12/setup.py |
exts.append( Extension('Nav', ['Nav.c']) ) exts.append( Extension('_AE', ['ae/_AEmodule.c']) ) exts.append( Extension('_App', ['app/_Appmodule.c']) ) exts.append( Extension('_Cm', ['cm/_Cmmodule.c']) ) exts.append( Extension('_Ctl', ['ctl/_Ctlmodule.c']) ) exts.append( Extension('_Dlg', ['dlg/_Dlgmodule.c']) ) exts.app... | exts.append( Extension('Nav', ['Nav.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_AE', ['ae/_AEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_App', ['app/_Appmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Cm', ['cm/_Cmmodule... | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 666b1e7e2f929af06fdfd074304a727f3dc5ed12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/666b1e7e2f929af06fdfd074304a727f3dc5ed12/setup.py |
extra_link_args=['-framework', 'QuickTime']) ) | extra_link_args=['-framework', 'QuickTime', '-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 666b1e7e2f929af06fdfd074304a727f3dc5ed12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/666b1e7e2f929af06fdfd074304a727f3dc5ed12/setup.py |
exts.append( Extension('_TE', ['te/_TEmodule.c']) ) | exts.append( Extension('_TE', ['te/_TEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 666b1e7e2f929af06fdfd074304a727f3dc5ed12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/666b1e7e2f929af06fdfd074304a727f3dc5ed12/setup.py |
exts.append( Extension('_Win', ['win/_Winmodule.c']) ) | exts.append( Extension('_Win', ['win/_Winmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 666b1e7e2f929af06fdfd074304a727f3dc5ed12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/666b1e7e2f929af06fdfd074304a727f3dc5ed12/setup.py |
if hex(-16) != '0xfffffff0': raise TestFailed, 'hex(-16)' | if len(hex(-1)) != len(hex(sys.maxint)): raise TestFailed, 'len(hex(-1))' if hex(-16) not in ('0xfffffff0', '0xfffffffffffffff0'): raise TestFailed, 'hex(-16)' | def f(): pass | c1c96d1b5c5b94edc84c057278a29f4aa7a32453 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c1c96d1b5c5b94edc84c057278a29f4aa7a32453/test_b1.py |
print ("bdist.run: format=%s, command=%s, rest=%s" % (self.formats[i], cmd_name, commands[i+1:])) | def run (self): | 4c7fb96b7a5e86fe23bb28cfee620ea616eec710 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c7fb96b7a5e86fe23bb28cfee620ea616eec710/bdist.py | |
makedirs(head, mode) | try: makedirs(head, mode) except OSError, e: if e.errno != EEXIST: raise | def makedirs(name, mode=0777): """makedirs(path [, mode=0777]) Super-mkdir; create a leaf directory and all intermediate ones. Works like mkdir, except that any intermediate path segment (not just the rightmost) will be created if it does not exist. This is recursive. """ head, tail = path.split(name) if not tail: h... | 2bcf0154d5412e0d03a30cbbe8a853c47ab6bfc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2bcf0154d5412e0d03a30cbbe8a853c47ab6bfc5/os.py |
from errno import ENOENT, ENOTDIR | def _execvpe(file, args, env=None): from errno import ENOENT, ENOTDIR if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ head, tail = path.split(file) if head: func(file, *argrest) return if 'PATH' in env: envpath = env['PATH'] else: envpath = defpath PATH = env... | 2bcf0154d5412e0d03a30cbbe8a853c47ab6bfc5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2bcf0154d5412e0d03a30cbbe8a853c47ab6bfc5/os.py | |
except: | except OSError: | def _run_child(self, cmd): if isinstance(cmd, types.StringTypes): cmd = ['/bin/sh', '-c', cmd] for i in range(3, MAXFD): try: os.close(i) except: pass try: os.execvp(cmd[0], cmd) finally: os._exit(1) | 1c90d7ab3c9a13e8578d6148cd33b5ace23f3aec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1c90d7ab3c9a13e8578d6148cd33b5ace23f3aec/popen2.py |
import difflib a = expected.splitlines() b = output.splitlines() | a = expected.splitlines(1) b = output.splitlines(1) | def reportdiff(expected, output): print "*" * 70 import difflib a = expected.splitlines() b = output.splitlines() sm = difflib.SequenceMatcher(a=a, b=b) tuples = sm.get_opcodes() def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) for op, a0, a1, b0, b1 in tuples: if op == 'equal': pas... | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
return str(x0) else: return "%d,%d" % (x0, x1) | return "line " + str(x0) else: return "lines %d-%d" % (x0, x1) | def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
print pair(a0, a1) + "d" + pair(b0, b1) | print "***", pair(a0, a1), "of expected output missing:" | def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
print "<", line | print "-", line, | def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
print pair(a0, a1) + "c" + pair(b0, b1) for line in a[a0:a1]: print "<", line print "---" | print "*** mismatch between", pair(a0, a1), "of expected", \ "output and", pair(b0, b1), "of actual output:" for line in difflib.ndiff(a[a0:a1], b[b0:b1]): print line, elif op == 'insert': print "***", pair(b0, b1), "of actual output doesn't appear", \ "in expected output after line", str(a1)+":" | def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
print ">", line elif op == 'insert': print str(a0) + "a" + pair(b0, b1) for line in b[b0:b1]: print ">", line | print "+", line, | def pair(x0, x1): x0 += 1 if x0 >= x1: return str(x0) else: return "%d,%d" % (x0, x1) | c377b16d12ba325bb108eca575447d66f19294c0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c377b16d12ba325bb108eca575447d66f19294c0/regrtest.py |
return not not self.cl.methods | try: return not not self.cl.methods except AttributeError: return False | def IsExpandable(self): if self.cl: return not not self.cl.methods | 0b743441a60640824360bdff15780fc5d40489d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0b743441a60640824360bdff15780fc5d40489d6/ClassBrowser.py |
rc = os.system("%s %s" % (self.name, url)) | rc = os.system(cmd) | def _remote(self, url, action, autoraise): autoraise = int(bool(autoraise)) # always 0/1 raise_opt = self.raise_opts and self.raise_opts[autoraise] or '' cmd = "%s %s %s '%s' >/dev/null 2>&1" % (self.name, raise_opt, self.remote_cmd, action) if self.remote_background: cmd += ' &' rc = os.system(cmd) if rc: # bad return... | 1cb179e93fb0f698fdb5f215b3864c578d910d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cb179e93fb0f698fdb5f215b3864c578d910d9a/webbrowser.py |
rc = os.system(self.name + " -d '%s'" % url) | rc = os.system(self.name + " -d '%s' &" % url) | def _remote(self, url, action): # kfmclient is the new KDE way of opening URLs. cmd = "kfmclient %s >/dev/null 2>&1" % action rc = os.system(cmd) # Fall back to other variants. if rc: if _iscommand("konqueror"): rc = os.system(self.name + " --silent '%s' &" % url) elif _iscommand("kfm"): rc = os.system(self.name + " -d... | 1cb179e93fb0f698fdb5f215b3864c578d910d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cb179e93fb0f698fdb5f215b3864c578d910d9a/webbrowser.py |
script = _safequote('open location "%s"', url) | script = 'open location "%s"' % url.replace('"', '%22') | def open(self, url, new=0, autoraise=1): assert "'" not in url # new must be 0 or 1 new = int(bool(new)) if self.name == "default": # User called open, open_new or get without a browser parameter script = _safequote('open location "%s"', url) # opens in default browser else: # User called get and chose a browser if sel... | 1cb179e93fb0f698fdb5f215b3864c578d910d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cb179e93fb0f698fdb5f215b3864c578d910d9a/webbrowser.py |
cmd = _safequote('OpenURL "%s"', url) | cmd = 'OpenURL "%s"' % url.replace('"', '%22') | def open(self, url, new=0, autoraise=1): assert "'" not in url # new must be 0 or 1 new = int(bool(new)) if self.name == "default": # User called open, open_new or get without a browser parameter script = _safequote('open location "%s"', url) # opens in default browser else: # User called get and chose a browser if sel... | 1cb179e93fb0f698fdb5f215b3864c578d910d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1cb179e93fb0f698fdb5f215b3864c578d910d9a/webbrowser.py |
print 'XX', dst, '->', (head, tail) | def mkdirs(dst): """Make directories leading to 'dst' if they don't exist yet""" if dst == '' or os.path.exists(dst): return head, tail = os.path.split(dst) print 'XX', dst, '->', (head, tail) # XXXX Is this a bug in os.path.split? if not ':' in head: head = head + ':' mkdirs(head) os.mkdir(dst, 0777) | 880e6eb409ecf599943ed40bb87a3fe4641b0f9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/880e6eb409ecf599943ed40bb87a3fe4641b0f9e/macostools.py | |
path = sys.path | path = sys.path[:] | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ["s... | 1e07403bbf47e7198a735a901598cbc1eedd607f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e07403bbf47e7198a735a901598cbc1eedd607f/freeze.py |
if args[0][-3:] != ".py": usage('the script name must have a .py suffix') | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] path = sys.path modargs = 0 debug = 1 odir = '' win = sys.platform[:3] == 'win' # modules that are imported by the Python runtime implicits = ["s... | 1e07403bbf47e7198a735a901598cbc1eedd607f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e07403bbf47e7198a735a901598cbc1eedd607f/freeze.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)) | 1422e9dc60bd795b0bf8d8877087ce1eb6ad6942 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1422e9dc60bd795b0bf8d8877087ce1eb6ad6942/riscospath.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) + '?' | de49583a0d59f806b88b0f6a869f470047b3cbce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de49583a0d59f806b88b0f6a869f470047b3cbce/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) + '?' | de49583a0d59f806b88b0f6a869f470047b3cbce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de49583a0d59f806b88b0f6a869f470047b3cbce/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) + '?' | de49583a0d59f806b88b0f6a869f470047b3cbce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/de49583a0d59f806b88b0f6a869f470047b3cbce/tokenize.py |
b = (12,) c = (6, 6) d = (4, 4, 4) e = (3, 3, 3, 3) | b = (1,) c = (1, 2) d = (1, 2, 3) e = (1, 2, 3, 4) | def test_short_tuples(self): a = () b = (12,) c = (6, 6) d = (4, 4, 4) e = (3, 3, 3, 3) for proto in 0, 1, 2: for x in a, b, c, d, e: s = self.dumps(x, proto) y = self.loads(s) self.assertEqual(x, y, (proto, x, s, y)) | 025bc2fe6c1d71505b95b6351795cba7724fd45f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/025bc2fe6c1d71505b95b6351795cba7724fd45f/pickletester.py |
self.addheaders = [('User-Agent', server_version)] | self.addheaders = [('User-agent', server_version)] | def __init__(self): server_version = "Python-urllib/%s" % __version__ self.addheaders = [('User-Agent', server_version)] # manage the individual handlers self.handlers = [] self.handle_open = {} self.handle_error = {} | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
req.add_header('Proxy-Authorization', 'Basic ' + user_pass) | req.add_header('Proxy-authorization', 'Basic ' + user_pass) | def proxy_open(self, req, proxy, type): orig_type = req.get_type() type, r_type = splittype(proxy) host, XXX = splithost(r_type) if '@' in host: user_pass, host = host.split('@', 1) if ':' in user_pass: user, password = user_pass.split(':', 1) user_pass = base64.encodestring('%s:%s' % (unquote(user), unquote(password))... | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
auth_header = 'Proxy-Authorization' | auth_header = 'Proxy-authorization' | def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] return self.http_error_auth_reqed('www-authenticate', host, req, headers) | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
for args in self.parent.addheaders: name, value = args | for name, value in self.parent.addheaders: name = name.capitalize() | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
h.putheader(*args) | h.putheader(name, value) | def do_open(self, http_class, req): host = req.get_host() if not host: raise URLError('no host given') | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % | 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % | def open_local_file(self, req): host = req.get_host() file = req.get_selector() localfile = url2pathname(file) stats = os.stat(localfile) size = stats.st_size modified = rfc822.formatdate(stats.st_mtime) mtype = mimetypes.guess_type(file)[0] headers = mimetools.Message(StringIO( 'Content-Type: %s\nContent-Length: %d\nL... | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
headers += "Content-Type: %s\n" % mtype | headers += "Content-type: %s\n" % mtype | def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') # XXX handle custom username & password try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) host, port = splitport(host) if port is None: port = ftplib.FTP_PORT path, attrs = splita... | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
headers += "Content-Length: %d\n" % retrlen | headers += "Content-length: %d\n" % retrlen | def ftp_open(self, req): host = req.get_host() if not host: raise IOError, ('ftp error', 'no host given') # XXX handle custom username & password try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) host, port = splitport(host) if port is None: port = ftplib.FTP_PORT path, attrs = splita... | 783eaf4774006d8cb6362d4136c88e74b36a0b77 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/783eaf4774006d8cb6362d4136c88e74b36a0b77/urllib2.py |
chunk = Chunk().init(self._file) | try: chunk = Chunk().init(self._file) except EOFError: if formlength == 8: print 'Warning: FORM chunk size too large' formlength = 0 break raise EOFError | def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ... | 8d733a00f00c98f5627a977150c85bfa9bed6d28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8d733a00f00c98f5627a977150c85bfa9bed6d28/aifc.py |
headers, 'file:'+file) | headers, urlfile) | def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+file) hos... | 336a201d4fed1b800029f302653e851a430a166b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/336a201d4fed1b800029f302653e851a430a166b/urllib.py |
headers, 'file:'+file) | headers, urlfile) | def open_local_file(self, url): import mimetypes, mimetools, StringIO mtype = mimetypes.guess_type(url)[0] headers = mimetools.Message(StringIO.StringIO( 'Content-Type: %s\n' % (mtype or 'text/plain'))) host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'rb'), headers, 'file:'+file) hos... | 336a201d4fed1b800029f302653e851a430a166b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/336a201d4fed1b800029f302653e851a430a166b/urllib.py |
if self.tkconsole.closing: return | def poll_subprocess(self): clt = self.rpcclt if clt is None: return try: response = clt.pollresponse(self.active_seq, wait=0.05) except (EOFError, IOError, KeyboardInterrupt): # lost connection or subprocess terminated itself, restart # [the KBI is from rpc.SocketIO.handle_EOF()] if self.tkconsole.closing: return respo... | 88957d8d0d9bf6d45603171927aa82d921bf9697 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88957d8d0d9bf6d45603171927aa82d921bf9697/PyShell.py | |
self.tkconsole.text.after(50, self.poll_subprocess) | if not self.tkconsole.closing: self.tkconsole.text.after(self.tkconsole.pollinterval, self.poll_subprocess) | def poll_subprocess(self): clt = self.rpcclt if clt is None: return try: response = clt.pollresponse(self.active_seq, wait=0.05) except (EOFError, IOError, KeyboardInterrupt): # lost connection or subprocess terminated itself, restart # [the KBI is from rpc.SocketIO.handle_EOF()] if self.tkconsole.closing: return respo... | 88957d8d0d9bf6d45603171927aa82d921bf9697 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88957d8d0d9bf6d45603171927aa82d921bf9697/PyShell.py |
return EditorWindow.close(self) | self.closing = True self.text.after(2 * self.pollinterval, self.close2) def close2(self): return EditorWindow.close(self) | def close(self): "Extend EditorWindow.close()" if self.executing: response = tkMessageBox.askokcancel( "Kill?", "The program is still running!\n Do you want to kill it?", default="ok", parent=self.text) if response == False: return "cancel" # interrupt the subprocess self.canceled = True if use_subprocess: self.interp.... | 88957d8d0d9bf6d45603171927aa82d921bf9697 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/88957d8d0d9bf6d45603171927aa82d921bf9697/PyShell.py |
import __main__ class_ = getattr(__main__, options.classname) | classname = options.classname if "." in classname: lastdot = classname.rfind(".") mod = __import__(classname[:lastdot], globals(), locals(), [""]) classname = classname[lastdot+1:] else: import __main__ as mod print mod.__name__, dir(mod) class_ = getattr(mod, classname) | def parseargs(): global DEBUGSTREAM try: opts, args = getopt.getopt( sys.argv[1:], 'nVhc:d', ['class=', 'nosetuid', 'version', 'help', 'debug']) except getopt.error, e: usage(1, e) options = Options() for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-V', '--version'): print >> sys.stderr, __ver... | 90e01539409c01649fab95122b61c023784d9a51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90e01539409c01649fab95122b61c023784d9a51/smtpd.py |
name = basename(in_file) | name = os.path.basename(in_file) | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): if name == None: name = basename(in_file) if mode == None: try: mode = os.path.stat(in_file)[0] except AttributeError... | 5a49ffca5e229b087bea31f378420ea4c9868dea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a49ffca5e229b087bea31f378420ea4c9868dea/uu.py |
mode = os.path.stat(in_file)[0] | mode = os.stat(in_file)[0] | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): if name == None: name = basename(in_file) if mode == None: try: mode = os.path.stat(in_file)[0] except AttributeError... | 5a49ffca5e229b087bea31f378420ea4c9868dea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a49ffca5e229b087bea31f378420ea4c9868dea/uu.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 | bba6acc714710e7e0190e4eba300b1dc4e492ecf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bba6acc714710e7e0190e4eba300b1dc4e492ecf/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) + ... | bba6acc714710e7e0190e4eba300b1dc4e492ecf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bba6acc714710e7e0190e4eba300b1dc4e492ecf/pydoc.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... | fcf6696255b36efd73745d4e5e8e9a1dcbd2fd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcf6696255b36efd73745d4e5e8e9a1dcbd2fd40/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... | fcf6696255b36efd73745d4e5e8e9a1dcbd2fd40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fcf6696255b36efd73745d4e5e8e9a1dcbd2fd40/inspect.py |
verify(2*L(3) == 6) verify(L(3)*2 == 6) verify(L(3)*L(2) == 6) | def mysetattr(self, name, value): if name == "spam": raise AttributeError return object.__setattr__(self, name, value) | e0007821cd2b8db1ecde561929f685bb356d0209 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e0007821cd2b8db1ecde561929f685bb356d0209/test_descr.py | |
return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") | return encode_base64("\0%s\0%s" % (user, password), eol="") | def encode_plain(user, password): return encode_base64("%s\0%s\0%s" % (user, user, password), eol="") | 25946ddac90e2f69199af740cbaaa08beb13d9a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/25946ddac90e2f69199af740cbaaa08beb13d9a9/smtplib.py |
blocknum = blocknum + 1 | read += len(block) blocknum += 1 | def retrieve(self, url, filename=None, reporthook=None, data=None): """retrieve(url) returns (filename, headers) for a local object or (tempfilename, headers) for a remote object.""" url = unwrap(toBytes(url)) if self.tempcache and url in self.tempcache: return self.tempcache[url] type, url1 = splittype(url) if filenam... | b925602f169d47270a064cf9eb03e21706ed25c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b925602f169d47270a064cf9eb03e21706ed25c3/urllib.py |
def findall(pattern, string, maxsplit=0): | def findall(pattern, string): | def findall(pattern, string, maxsplit=0): """Return a list of all non-overlapping matches in the string. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.""" return _compile(pattern... | e06cbb8c56d76d5f845c4809a22fcdf99063496c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e06cbb8c56d76d5f845c4809a22fcdf99063496c/sre.py |
return _compile(pattern, 0).findall(string, maxsplit) | return _compile(pattern, 0).findall(string) | def findall(pattern, string, maxsplit=0): """Return a list of all non-overlapping matches in the string. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.""" return _compile(pattern... | e06cbb8c56d76d5f845c4809a22fcdf99063496c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e06cbb8c56d76d5f845c4809a22fcdf99063496c/sre.py |
imageop.mono2grey(img, x, y, 0, 255) | return imageop.mono2grey(img, x, y, 0, 255) | def mono2grey(img, x, y): imageop.mono2grey(img, x, y, 0, 255) | 1e0fdd8a6bd4a094e42f0b9a8c995e98cfda5257 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1e0fdd8a6bd4a094e42f0b9a8c995e98cfda5257/imgconv.py |
alltests.addTest(module.suite()) | alltests.addTest(module.test_suite()) | def suite(): test_modules = [ 'test_associate', 'test_basics', 'test_compat', 'test_dbobj', 'test_dbshelve', 'test_dbtables', 'test_env_close', 'test_get_none', 'test_join', 'test_lock', 'test_misc', 'test_queue', 'test_recno', 'test_thread', ] alltests = unittest.TestSuite() for name in test_modules: module = __impor... | bce64ec086026464c14bdedc00599a837d5ad6ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bce64ec086026464c14bdedc00599a837d5ad6ef/test_all.py |
v = self.get(section, option) val = int(v) if val not in (0, 1): | states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not states.has_key(v.lower()): | def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | fb06f75c5ac24c720aaf8f221efff35543d878b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb06f75c5ac24c720aaf8f221efff35543d878b6/ConfigParser.py |
return val | return states[v.lower()] | def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | fb06f75c5ac24c720aaf8f221efff35543d878b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fb06f75c5ac24c720aaf8f221efff35543d878b6/ConfigParser.py |
try: what, tdelta, fileno, lineno = self._nextitem() except TypeError: self._reader.close() raise StopIteration() | what, tdelta, fileno, lineno = self._nextitem() | def next(self, index=0): while 1: try: what, tdelta, fileno, lineno = self._nextitem() except TypeError: # logreader().next() returns None at the end self._reader.close() raise StopIteration() | fbe36082906201210da081d71c6ac7b30f7ef1a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbe36082906201210da081d71c6ac7b30f7ef1a2/log.py |
self.close() | try: self.close() except: pass | def __del__(self): self.close() | 65f8cedd4a9820e5d069ece0194b7da0b1e4e33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65f8cedd4a9820e5d069ece0194b7da0b1e4e33c/socket.py |
wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI:PythonCGISlave.py") | wrapper = "PythonCGISlave.py" if not os.path.exists("PythonCGISlave.py"): wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI", wrapper) | def buildcgiapplet(): buildtools.DEBUG=1 # Find the template # (there's no point in proceeding if we can't find it) template = buildtools.findtemplate() wrapper = os.path.join(sys.exec_prefix, ":Mac:Tools:CGI:PythonCGISlave.py") # Ask for source text if not specified in sys.argv[1:] if not sys.argv[1:]: srcfss, ok =... | c88093a90f8f5f979d291a282cfdd555c7a784b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c88093a90f8f5f979d291a282cfdd555c7a784b6/BuildCGIApplet.py |
try: ignore = posix.fdopen except: raise AttributeError, 'dup() method unavailable' | if not hasattr(posix, 'fdopen'): raise AttributeError, 'dup() method unavailable' | def dup(self): import posix | e9901f325e4bfb123479c706288d5c6a09bad406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9901f325e4bfb123479c706288d5c6a09bad406/posixfile.py |
try: ignore = posix.fdopen except: raise AttributeError, 'dup() method unavailable' | if not hasattr(posix, 'fdopen'): raise AttributeError, 'dup() method unavailable' | def dup2(self, fd): import posix | e9901f325e4bfb123479c706288d5c6a09bad406 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e9901f325e4bfb123479c706288d5c6a09bad406/posixfile.py |
test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0) | test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0) | def __getitem__(self, i): return self.seq[i] | da45d55a6ecff00ca714cbcf66fb2133621ca836 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/da45d55a6ecff00ca714cbcf66fb2133621ca836/test_strop.py |
assert isinstance(req, Request) | def open(self, fullurl, data=None): # accept a URL or a Request object if isinstance(fullurl, basestring): req = Request(fullurl, data) else: req = fullurl if data is not None: req.add_data(data) assert isinstance(req, Request) # really only care about interface | 24b2bc365467218ee719f6155d04b1f2962742c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/24b2bc365467218ee719f6155d04b1f2962742c1/urllib2.py | |
elif path == '' or path[-1:] in '/\\': | elif path == '' or path[-1:] in '/\\:': | def join(a, *p): """Join two or more pathname components, inserting "\\" as needed""" path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\': path = path + b else: path = path + os.sep + b return path | 0eeba5b24b0cf5297421c7bd5dbc38aff774dc5f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0eeba5b24b0cf5297421c7bd5dbc38aff774dc5f/ntpath.py |
self.plist.CFBundleExecutable = self.name | def setup(self): if self.mainprogram is None and self.executable is None: raise TypeError, ("must specify either or both of " "'executable' and 'mainprogram'") | 7fd69ad2f11c945cbe362cee4e262cec239d9f6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7fd69ad2f11c945cbe362cee4e262cec239d9f6c/bundlebuilder.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.