rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
return None | traceback = info[2] assert isinstance(traceback, types.TracebackType) traceback_id = id(traceback) tracebacktable[traceback_id] = traceback modified_info = (info[0], info[1], traceback_id) return modified_info | def wrap_info(info): if info is None: return None else: return None # XXX for now | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py |
tb = None | if tbid is None: tb = None else: tb = tracebacktable[tbid] | def get_stack(self, fid, tbid): ##print >>sys.__stderr__, "get_stack(%s, %s)" % (`fid`, `tbid`) frame = frametable[fid] tb = None # XXX for now stack, i = self.idb.get_stack(frame, tb) ##print >>sys.__stderr__, "get_stack() ->", stack stack = [(wrap_frame(frame), k) for frame, k in stack] ##print >>sys.__stderr__, "get... | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py |
return msg | def clear_all_file_breaks(self, filename): msg = self.idb.clear_all_file_breaks(filename) | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py | |
def interaction(self, message, fid, iid): | def interaction(self, message, fid, modified_info): | def interaction(self, message, fid, iid): ##print "interaction: (%s, %s, %s)" % (`message`,`fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now self.gui.interaction(message, frame, info) | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py |
info = None self.gui.interaction(message, frame, info) | self.gui.interaction(message, frame, modified_info) | def interaction(self, message, fid, iid): ##print "interaction: (%s, %s, %s)" % (`message`,`fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now self.gui.interaction(message, frame, info) | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py |
def get_stack(self, frame, tb): stack, i = self.call("get_stack", frame._fid, None) | def get_stack(self, frame, tbid): stack, i = self.call("get_stack", frame._fid, tbid) | def get_stack(self, frame, tb): stack, i = self.call("get_stack", frame._fid, None) stack = [(FrameProxy(self.conn, fid), k) for fid, k in stack] return stack, i | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.py |
return msg | def clear_all_file_breaks(self, filename): msg = self.call("clear_all_file_breaks", filename) | f50d0f96a22c3316e023e7a1b6441baf4d54ece3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f50d0f96a22c3316e023e7a1b6441baf4d54ece3/RemoteDebugger.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,'... | 363f6d65a764ace00524e96da78055c8e2ef9cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/363f6d65a764ace00524e96da78055c8e2ef9cc4/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,'... | 363f6d65a764ace00524e96da78055c8e2ef9cc4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/363f6d65a764ace00524e96da78055c8e2ef9cc4/test_pow.py |
"""Implements a file object on top of a regular socket object.""" | """Faux file object attached to a socket object.""" default_bufsize = 8192 | _s = "def %s(self, *args): return self._sock.%s(*args)\n\n" | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 else: bufsize = 8192 self._rbufsize = bufsize | self._mode = mode if bufsize < 0: bufsize = self.default_bufsize if bufsize == 0: self._rbufsize = 1 elif bufsize == 1: self._rbufsize = self.default_bufsize else: self._rbufsize = bufsize | def __init__(self, sock, mode='rb', bufsize=-1): self._sock = sock self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 # Unbuffered mode else: bufsize = 8192 self._rbufsize = bufsize self._wbufsize = bufsize self._rbuf = [ ] self._wbuf = [ ] | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
self._rbuf = [ ] self._wbuf = [ ] | self._rbuf = [] self._wbuf = [] | def __init__(self, sock, mode='rb', bufsize=-1): self._sock = sock self._mode = mode if bufsize <= 0: if bufsize == 0: bufsize = 1 # Unbuffered mode else: bufsize = 8192 self._rbufsize = bufsize self._wbufsize = bufsize self._rbuf = [ ] self._wbuf = [ ] | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
buffer = ''.join(self._wbuf) | buffer = "".join(self._wbuf) self._wbuf = [] | def flush(self): if self._wbuf: buffer = ''.join(self._wbuf) self._sock.sendall(buffer) self._wbuf = [ ] | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
self._wbuf = [ ] | def flush(self): if self._wbuf: buffer = ''.join(self._wbuf) self._sock.sendall(buffer) self._wbuf = [ ] | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py | |
self._wbuf.append (data) if self._wbufsize == 1: if '\n' in data: self.flush () elif self.__get_wbuf_len() >= self._wbufsize: | data = str(data) if not data: return self._wbuf.append(data) if (self._wbufsize == 0 or self._wbufsize == 1 and '\n' in data or self._get_wbuf_len() >= self._wbufsize): | def write(self, data): self._wbuf.append (data) # A _wbufsize of 1 means we're doing unbuffered IO. # Flush accordingly. if self._wbufsize == 1: if '\n' in data: self.flush () elif self.__get_wbuf_len() >= self._wbufsize: self.flush() | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
filter(self._sock.sendall, list) self.flush() def __get_wbuf_len (self): | self._wbuf.extend(filter(None, map(str, list))) if (self._wbufsize <= 1 or self._get_wbuf_len() >= self._wbufsize): self.flush() def _get_wbuf_len(self): | def writelines(self, list): filter(self._sock.sendall, list) self.flush() | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
for i in [len(x) for x in self._wbuf]: buf_len += i | for x in self._wbuf: buf_len += len(x) | def __get_wbuf_len (self): buf_len = 0 for i in [len(x) for x in self._wbuf]: buf_len += i return buf_len | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
def __get_rbuf_len(self): | def _get_rbuf_len(self): | def __get_rbuf_len(self): buf_len = 0 for i in [len(x) for x in self._rbuf]: buf_len += i return buf_len | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
for i in [len(x) for x in self._rbuf]: buf_len += i | for x in self._rbuf: buf_len += len(x) | def __get_rbuf_len(self): buf_len = 0 for i in [len(x) for x in self._rbuf]: buf_len += i return buf_len | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
buf_len = self.__get_rbuf_len() while size < 0 or buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) data = ''.join(self._rbuf) self._rbuf = [ ] if buf_len > size and size >= 0: | if size < 0: if self._rbufsize <= 1: recv_size = self.default_bufsize else: recv_size = self._rbufsize while 1: data = self._sock.recv(recv_size) if not data: break self._rbuf.append(data) else: buf_len = self._get_rbuf_len() while buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(... | def read(self, size=-1): buf_len = self.__get_rbuf_len() while size < 0 or buf_len < size: recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) # Clear the rbuf at the end so we're not affected by # an exception during a recv d... | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
index = -1 buf_len = self.__get_rbuf_len() if self._rbuf: index = min([x.find('\n') for x in self._rbuf]) while index < 0 and (size < 0 or buf_len < size): recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.append(data) index = data.find(... | data_len = 0 for index, x in enumerate(self._rbuf): data_len += len(x) if '\n' in x or 0 <= size <= data_len: index += 1 data = "".join(self._rbuf[:index]) end = data.find('\n') if end < 0: end = len(data) else: end += 1 if 0 <= size < end: end = size data, rest = data[:end], data[end:] if rest: self._rbuf[:index] = [r... | def readline(self, size=-1): index = -1 buf_len = self.__get_rbuf_len() if self._rbuf: index = min([x.find('\n') for x in self._rbuf]) while index < 0 and (size < 0 or buf_len < size): recv_size = max(self._rbufsize, size - buf_len) data = self._sock.recv(recv_size) if not data: break buf_len += len(data) self._rbuf.ap... | 443fec3dd9c1a2c60b538af0504d4926e633b9b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/443fec3dd9c1a2c60b538af0504d4926e633b9b4/socket.py |
'<<run-module>>': ['<F5>'], '<<debug-module>>': ['<Control-F5>'], | '<<import-module>>': ['<F5>'], '<<run-script>>': ['<Control-F5>'], | def flush(self): pass | 1f3de5d7b99190d3dda48349fa163e65e19153dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f3de5d7b99190d3dda48349fa163e65e19153dc/ScriptBinding.py |
('Run module', '<<run-module>>'), ('Debug module', '<<debug-module>>'), | ('Import module', '<<import-module>>'), ('Run script', '<<run-script>>'), | def flush(self): pass | 1f3de5d7b99190d3dda48349fa163e65e19153dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f3de5d7b99190d3dda48349fa163e65e19153dc/ScriptBinding.py |
def run_module_event(self, event, debugger=None): | def import_module_event(self, event): filename = self.getfilename() if not filename: return modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename setattr(sys.modules[... | def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file... | 1f3de5d7b99190d3dda48349fa163e65e19153dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f3de5d7b99190d3dda48349fa163e65e19153dc/ScriptBinding.py |
modname, ext = os.path.splitext(os.path.basename(filename)) if sys.modules.has_key(modname): mod = sys.modules[modname] else: mod = imp.new_module(modname) sys.modules[modname] = mod mod.__file__ = filename saveout = sys.stdout saveerr = sys.stderr owin = OnDemandOutputWindow(self.editwin.flist) try: sys.stderr = Pseud... | return filename | def run_module_event(self, event, debugger=None): if not self.editwin.get_saved(): tkMessageBox.showerror("Not saved", "Please save first!", master=self.editwin.text) self.editwin.text.focus_set() return filename = self.editwin.io.filename if not filename: tkMessageBox.showerror("No file name", "This window has no file... | 1f3de5d7b99190d3dda48349fa163e65e19153dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1f3de5d7b99190d3dda48349fa163e65e19153dc/ScriptBinding.py |
timestamp = 1000000000 utc = FixedOffset(0, "utc", 0) expected = datetime(2001, 9, 9, 1, 46, 40) got = datetime.utcfromtimestamp(timestamp) self.failUnless(abs(got - expected) < timedelta(minutes=1)) est = FixedOffset(-5*60, "est", 0) expected -= timedelta(hours=5) got = datetime.fromtimestamp(timestamp, est).replac... | timestamp = 1000000000 utcdatetime = datetime.utcfromtimestamp(timestamp) utcoffset = timedelta(hours=-15, minutes=39) tz = FixedOffset(utcoffset, "tz", 0) expected = utcdatetime + utcoffset got = datetime.fromtimestamp(timestamp, tz) self.assertEqual(expected, got.replace(tzinfo=None)) | def test_tzinfo_fromtimestamp(self): import time meth = self.theclass.fromtimestamp ts = time.time() # Ensure it doesn't require tzinfo (i.e., that this doesn't blow up). base = meth(ts) # Try with and without naming the keyword. off42 = FixedOffset(42, "42") another = meth(ts, off42) again = meth(ts, tz=off42) self.fa... | 844076122e5d7a5aeab8089dd2fb91bfd47596a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/844076122e5d7a5aeab8089dd2fb91bfd47596a2/test_datetime.py |
if version[:11] == '$Revision$': version = version[11:-1] | if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) | def docmodule(self, object): """Produce HTML documentation for a module object.""" name = object.__name__ result = '' head = '<br><big><big><strong> %s</strong></big></big>' % name try: file = inspect.getsourcefile(object) filelink = '<a href="file:%s">%s</a>' % (file, file) except TypeError: filelink = '(built-in... | 40c49919fb7385d4b7e2e2647be157873f75ab26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/40c49919fb7385d4b7e2e2647be157873f75ab26/pydoc.py |
exceptions, this sets `sender' to the string that the SMTP refused | exceptions, this sets `sender' to the string that the SMTP refused. | def __init__(self, code, msg): self.smtp_code = code self.smtp_error = msg self.args = (code, msg) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
"""All recipient addresses refused. | """All recipient addresses refused. | def __init__(self, code, msg, sender): self.smtp_code = code self.smtp_error = msg self.sender = sender self.args = (code, msg, sender) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
"""Error during connection establishment""" | """Error during connection establishment.""" | def __init__(self, recipients): self.recipients = recipients self.args = ( recipients,) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
"""The server refused our HELO reply""" | """The server refused our HELO reply.""" | def __init__(self, recipients): self.recipients = recipients self.args = ( recipients,) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
Double leading '.', and change Unix newline '\n', or Mac '\r' into | Double leading '.', and change Unix newline '\\n', or Mac '\\r' into | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
This is the message given by the server in responce to the | This is the message given by the server in response to the | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
This is the message given by the server in responce to the | This is the message given by the server in response to the | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
will _after you do an EHLO command_, contain the names of the SMTP service extentions this server supports, and their | will _after you do an EHLO command_, contain the names of the SMTP service extensions this server supports, and their | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
Note, all extention names are mapped to lower case in the | Note, all extension names are mapped to lower case in the | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
For method docs, see each method's docstrings. In general, there is a method of the same name to perform each SMTP command, and there is a method called 'sendmail' that will do an entire mail transaction. """ | See each method's docstrings for details. In general, there is a method of the same name to perform each SMTP command. There is also a method called 'sendmail' that will do an entire mail transaction. """ | def quotedata(data): """Quote data for email. Double leading '.', and change Unix newline '\n', or Mac '\r' into Internet CRLF end-of-line. """ return re.sub(r'(?m)^\.', '..', re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)) | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised if the specified `host' doesn't respond correctly. | By default, smtplib.SMTP_PORT is used. An SMTPConnectError is raised if the specified `host' doesn't respond correctly. | def __init__(self, host = '', port = 0): """Initialize a new instance. | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
one recipient. It returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server. | one recipient. It returns a dictionary, with one entry for each recipient that was refused. Each entry contains a tuple of the SMTP error code and the accompanying error message sent by the server. | def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
SMTPRecipientsRefused The server rejected for ALL recipients | SMTPRecipientsRefused The server rejected ALL recipients | def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
550. If all addresses are accepted, then the method will return an | 550. If all addresses are accepted, then the method will return an | def sendmail(self, from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]): """This command performs an entire mail transaction. | d25c1b73d2c8ab561476de849026aef7bd25808e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d25c1b73d2c8ab561476de849026aef7bd25808e/smtplib.py |
test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1) test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1) | test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1) | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_... | acee48628d6df976170c289227def0644cf2dbf5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/acee48628d6df976170c289227def0644cf2dbf5/test_sre.py |
try: | if old: | def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime(). | 62fe75509c905bee1181fed9b6714e0de27ff5d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62fe75509c905bee1181fed9b6714e0de27ff5d4/_strptime.py |
except ValueError: pass | def __calc_date_time(self): # Set self.__date_time, self.__date, & self.__time by using # time.strftime(). | 62fe75509c905bee1181fed9b6714e0de27ff5d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62fe75509c905bee1181fed9b6714e0de27ff5d4/_strptime.py | |
"""Convert a list to a regex string for matching directive.""" | """Convert a list to a regex string for matching a directive.""" | def __seqToRE(self, to_convert, directive): """Convert a list to a regex string for matching directive.""" def sorter(a, b): """Sort based on length. | 62fe75509c905bee1181fed9b6714e0de27ff5d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62fe75509c905bee1181fed9b6714e0de27ff5d4/_strptime.py |
def strptime(data_string, format="%a %b %d %H:%M:%S %Y"): """Return a time struct based on the input data and the format string. The format argument may either be a regular expression object compiled by strptime(), or a format string. If False is passed in for data_string then the re object calculated for format will... | 62fe75509c905bee1181fed9b6714e0de27ff5d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62fe75509c905bee1181fed9b6714e0de27ff5d4/_strptime.py | ||
Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);") | Output("%s.tp_dealloc((PyObject *)self);", self.basetype) | def outputDealloc(self): Output() Output("static void %s_dealloc(%s *self)", self.prefix, self.objecttype) OutLbrace() self.outputCleanupStructMembers() if self.basetype: Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);") elif hasattr(self, 'output_tp_free'): # This is a new-style object with tp_free slot ... | 35f82d7051093ffe3ab181a05ed61982560149be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/35f82d7051093ffe3ab181a05ed61982560149be/bgenObjectDefinition.py |
Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;") | if self.basetype: Output("if (%s.tp_new)", self.basetype) OutLbrace() Output("if ( (*%s.tp_init)(_self, _args, _kwds) == NULL) return NULL;", self.basetype) Dedent() Output("} else {") Indent() Output("if ((_self = type->tp_alloc(type, 0)) == NULL) return NULL;") OutRbrace() else: Output("if ((_self = type->tp_alloc(ty... | def output_tp_newBody(self): Output("PyObject *_self;"); Output("%s itself;", self.itselftype); Output("char *kw[] = {\"itself\", 0};") Output() Output("if (!PyArg_ParseTupleAndKeywords(_args, _kwds, \"O&\", kw, %s_Convert, &itself)) return NULL;", self.prefix); Output("if ((_self = type->tp_alloc(type, 0)) == NULL) re... | 35f82d7051093ffe3ab181a05ed61982560149be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/35f82d7051093ffe3ab181a05ed61982560149be/bgenObjectDefinition.py |
if self.elements is XMLParser.elements: self.__fixelements() | def __init__(self): self.reset() if self.elements is XMLParser.elements: self.__fixelements() | cc2c291b7fdb2eb4a46bdce264931bd5adeaff38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc2c291b7fdb2eb4a46bdce264931bd5adeaff38/xmllib.py | |
self.syntax_error('reference to unknown entity') | self.syntax_error("reference to unknown entity `&%s;'" % str) | def translate_references(self, data, all = 1): i = 0 while 1: res = amp.search(data, i) if res is None: return data res = ref.match(data, res.start(0)) if res is None: self.syntax_error("bogus `&'") i =i+1 continue i = res.end(0) if data[i - 1] != ';': self.syntax_error("`;' missing after entity/char reference") i = i-... | cc2c291b7fdb2eb4a46bdce264931bd5adeaff38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc2c291b7fdb2eb4a46bdce264931bd5adeaff38/xmllib.py |
self.syntax_error('reference to unknown entity') | self.syntax_error("reference to unknown entity `&%s;'" % name) | def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i ... | cc2c291b7fdb2eb4a46bdce264931bd5adeaff38 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc2c291b7fdb2eb4a46bdce264931bd5adeaff38/xmllib.py |
return getint( | return self.tk.getint( | def winfo_id(self): return getint( self.tk.call('winfo', 'id', self._w)) | cef4c844df324979f25ffec172c141a5d5c4672e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cef4c844df324979f25ffec172c141a5d5c4672e/Tkinter.py |
if hasattr(package, "__loader__"): | if (hasattr(package, "__loader__") and hasattr(package.__loader__, '_files')): | def find_package_modules(package, mask): import fnmatch if hasattr(package, "__loader__"): path = package.__name__.replace(".", os.path.sep) mask = os.path.join(path, mask) for fnm in package.__loader__._files.iterkeys(): if fnmatch.fnmatchcase(fnm, mask): yield os.path.splitext(fnm)[0].replace(os.path.sep, ".") else: ... | 8211297a7e4d18833b61170f65a1c47183e348c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8211297a7e4d18833b61170f65a1c47183e348c8/__init__.py |
print '%s == %s: OK' % (repr(a), repr(b)) | print '%s == %s: OK' % (a, b) | def check(a, b): if a != b: print '*** check failed: %s != %s' % (repr(a), repr(b)) else: print '%s == %s: OK' % (repr(a), repr(b)) | 84cc9bf722a6261fe6603e67cde38784e533e8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84cc9bf722a6261fe6603e67cde38784e533e8b9/test_charmapcodec.py |
print 'Option', opt, 'require integer argument' | print 'Option', opt, 'requires integer argument' | def main(): global debug, looping, magnify, mindelta, nowait, quiet, regen, speed global threading, xoff, yoff # Parse command line try: opts, args = getopt.getopt(sys.argv[1:], 'M:dlm:nqr:s:tx:y:') except getopt.error, msg: sys.stdout = sys.stderr print 'Error:', msg, '\n' help() sys.exit(2) # Interpret options try:... | 42e9be455952cc4fd69f8f7143cd363b58ef6b9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42e9be455952cc4fd69f8f7143cd363b58ef6b9b/Vplay.py |
if string.find (args[i], ' ') == -1: | if string.find (args[i], ' ') != -1: | def _nt_quote_args (args): """Obscure quoting command line arguments on NT. Simply quote every argument which contains blanks.""" # XXX this doesn't seem very robust to me -- but if the Windows guys # say it'll work, I guess I'll have to accept it. (What if an arg # contains quotes? What other magic characters, othe... | e2a33079e9325781dcbc549921664c6ff92d86b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2a33079e9325781dcbc549921664c6ff92d86b9/spawn.py |
return | def _nt_quote_args (args): """Obscure quoting command line arguments on NT. Simply quote every argument which contains blanks.""" # XXX this doesn't seem very robust to me -- but if the Windows guys # say it'll work, I guess I'll have to accept it. (What if an arg # contains quotes? What other magic characters, othe... | e2a33079e9325781dcbc549921664c6ff92d86b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e2a33079e9325781dcbc549921664c6ff92d86b9/spawn.py | |
+ If you continue a line via backslashing in an interactive session, or for any other reason use a backslash, you need to double the backslash in the docstring version. This is simply because you're in a string, and so the backslash must be escaped for it to survive intact. Like: >>> if "yes" == \\ ... "y" + \... | + If you continue a line via backslashing in an interactive session, or for any other reason use a backslash, you should use a raw docstring, which will preserve your backslahses exactly as you type them: >>> def f(x): ... r'''Backslashes in a raw docstring: m\n''' >>> print f.__doc__ Backslashes in a raw docstrin... | def _test(): import doctest import sys verbose = "-v" in sys.argv for mod in modules: doctest.testmod(mod, verbose=verbose, report=0) doctest.master.summarize() | 92816de18e3456f8304a1aaa6f28b151858a6e5d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/92816de18e3456f8304a1aaa6f28b151858a6e5d/doctest.py |
if (inspect.getmodule(value) or object) is object: | if (all is not None or (inspect.getmodule(value) or object) is object): | def docmodule(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name try: all = object.__all__ except AttributeError: all = None parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.ht... | 4c11f6088af5c2b3b97ed4352df3e39c4c7c9732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c11f6088af5c2b3b97ed4352df3e39c4c7c9732/pydoc.py |
if inspect.isbuiltin(value) or inspect.getmodule(value) is object: | if (all is not None or inspect.isbuiltin(value) or inspect.getmodule(value) is object): | def docmodule(self, object, name=None, mod=None, *ignored): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name try: all = object.__all__ except AttributeError: all = None parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.ht... | 4c11f6088af5c2b3b97ed4352df3e39c4c7c9732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c11f6088af5c2b3b97ed4352df3e39c4c7c9732/pydoc.py |
if (inspect.getmodule(value) or object) is object: | if (all is not None or (inspect.getmodule(value) or object) is object): | def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop)) | 4c11f6088af5c2b3b97ed4352df3e39c4c7c9732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c11f6088af5c2b3b97ed4352df3e39c4c7c9732/pydoc.py |
if inspect.isbuiltin(value) or inspect.getmodule(value) is object: | if (all is not None or inspect.isbuiltin(value) or inspect.getmodule(value) is object): | def docmodule(self, object, name=None, mod=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop)) | 4c11f6088af5c2b3b97ed4352df3e39c4c7c9732 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c11f6088af5c2b3b97ed4352df3e39c4c7c9732/pydoc.py |
self._prepareInstall(pkg, force, recursive) | self._prepareInstall(pkg, False, recursive) | def _prepareInstall(self, package, force=0, recursive=1): """Internal routine, recursive engine for prepareInstall. Test whether the package is installed and (if not installed or if force==1) prepend it to the temporary todo list and call ourselves recursively on all prerequisites.""" if not force: status, message = ... | 0576d0a48a5111fef529732830db2e60102406f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0576d0a48a5111fef529732830db2e60102406f7/pimp.py |
print "Failed", name | print "Passed", name | def confirm(outcome, name): global tests tests = tests + 1 if outcome: if verbose: print "Failed", name else: failures.append(name) | 09e2cb0ba70aeb52bf6562120103573d7f65cbd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09e2cb0ba70aeb52bf6562120103573d7f65cbd6/test_sax.py |
try: class C(bool): pass except TypeError: pass else: raise TestFailed, "bool should not be subclassable" try: int.__new__(bool, 0) except TypeError: pass else: raise TestFailed, "should not be able to create new bool instances" fo = open(TESTFN, "wb") print >> fo, False, True fo.close() fo = open(TESTFN, "rb") vere... | class BoolTest(unittest.TestCase): def assertIs(self, a, b): self.assert_(a is b) def assertIsNot(self, a, b): self.assert_(a is not b) def test_subclass(self): try: class C(bool): pass except TypeError: pass else: self.fail("bool should not be subclassable") self.assertRaises(TypeError, int.__new__, bool, 0) def ... | def verisnot(a, b): if a is b: raise TestFailed, "%r is %r" % (a, b) | dbcede5d66aee2999c16367fd4a2529fe77e91ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dbcede5d66aee2999c16367fd4a2529fe77e91ae/test_bool.py |
self.socket = socket.socket(self.address_family, self.socket_type) self.server_bind() self.server_activate() def server_bind(self): """Called by constructor to bind the socket. May be overridden. """ if self.allow_reuse_address: self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.... | def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" self.server_address = server_address self.RequestHandlerClass = RequestHandlerClass self.socket = socket.socket(self.address_family, self.socket_type) self.server_bind() self.server_activate() | 90cb9067b82509ed4917084ffa85abc150509ff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cb9067b82509ed4917084ffa85abc150509ff5/SocketServer.py | |
self.socket.listen(self.request_queue_size) def fileno(self): """Return socket file number. Interface required by select(). """ return self.socket.fileno() | pass | def server_activate(self): """Called by constructor to activate the server. | 90cb9067b82509ed4917084ffa85abc150509ff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cb9067b82509ed4917084ffa85abc150509ff5/SocketServer.py |
def get_request(self): """Get the request and client address from the socket. May be overridden. """ return self.socket.accept() | def get_request(self): """Get the request and client address from the socket. | 90cb9067b82509ed4917084ffa85abc150509ff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cb9067b82509ed4917084ffa85abc150509ff5/SocketServer.py | |
traceback.print_exc() | traceback.print_exc() | def handle_error(self, request, client_address): """Handle an error gracefully. May be overridden. | 90cb9067b82509ed4917084ffa85abc150509ff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cb9067b82509ed4917084ffa85abc150509ff5/SocketServer.py |
self.socket.close() | self.server_close() | def process_request(self, request, client_address): """Fork a new subprocess to process the request.""" self.collect_children() pid = os.fork() if pid: # Parent process if self.active_children is None: self.active_children = [] self.active_children.append(pid) return else: # Child process. # This must never return, hen... | 90cb9067b82509ed4917084ffa85abc150509ff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/90cb9067b82509ed4917084ffa85abc150509ff5/SocketServer.py |
This is called by send_reponse(). | This is called by send_response(). | def log_request(self, code='-', size='-'): """Log an accepted request. | ec73cd4b1a6104461d795b6f9408bf8227e0ddde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ec73cd4b1a6104461d795b6f9408bf8227e0ddde/BaseHTTPServer.py |
'Library', 'Python', sys.version[:3], 'site-packages') | 'Library', 'Python', sys.version[:3], 'site-packages') | def _init(): import macresource import sys, os macresource.need('DITL', 468, "PythonIDE.rsrc") widgetrespathsegs = [sys.exec_prefix, "Mac", "Tools", "IDE", "Widgets.rsrc"] widgetresfile = os.path.join(*widgetrespathsegs) if not os.path.exists(widgetresfile): widgetrespathsegs = [os.pardir, "Tools", "IDE", "Widgets.rsrc... | f776dee6dd3d11f084071f52200838aeed0f4613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f776dee6dd3d11f084071f52200838aeed0f4613/PackageManager.py |
rv = 0 | rv = 0 | def _quit(self): | f776dee6dd3d11f084071f52200838aeed0f4613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f776dee6dd3d11f084071f52200838aeed0f4613/PackageManager.py |
self.packages = self.pimpdb.list() | packages = self.pimpdb.list() if show_hidden: self.packages = packages else: self.packages = [] for pkg in packages: name = pkg.fullname() if name[0] == '(' and name[-1] == ')' and not show_hidden: continue self.packages.append(pkg) | def getbrowserdata(self, show_hidden=1): self.packages = self.pimpdb.list() rv = [] for pkg in self.packages: name = pkg.fullname() if name[0] == '(' and name[-1] == ')' and not show_hidden: continue status, _ = pkg.installed() description = pkg.description() rv.append((status, name, description)) return rv | f776dee6dd3d11f084071f52200838aeed0f4613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f776dee6dd3d11f084071f52200838aeed0f4613/PackageManager.py |
if name[0] == '(' and name[-1] == ')' and not show_hidden: continue | def getbrowserdata(self, show_hidden=1): self.packages = self.pimpdb.list() rv = [] for pkg in self.packages: name = pkg.fullname() if name[0] == '(' and name[-1] == ')' and not show_hidden: continue status, _ = pkg.installed() description = pkg.description() rv.append((status, name, description)) return rv | f776dee6dd3d11f084071f52200838aeed0f4613 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f776dee6dd3d11f084071f52200838aeed0f4613/PackageManager.py | |
attrname = string.lower(attrname) | def parse_starttag(self, i): | 5d68e8e312fe66450314c9cd49db9bce63cadc42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5d68e8e312fe66450314c9cd49db9bce63cadc42/xmllib.py | |
def test(args = None): import sys if not args: args = sys.argv[1:] if args and args[0] == '-s': args = args[1:] klass = XMLParser else: klass = TestXMLParser if args: file = args[0] else: file = 'test.xml' if file == '-': f = sys.stdin else: try: f = open(file, 'r') except IOError, msg: print file, ":", msg sys.exi... | 5d68e8e312fe66450314c9cd49db9bce63cadc42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5d68e8e312fe66450314c9cd49db9bce63cadc42/xmllib.py | ||
(typ, [data]) = <instance>.create(mailbox, who, what) | (typ, [data]) = <instance>.setacl(mailbox, who, what) | def setacl(self, mailbox, who, what): """Set a mailbox acl. | f167dc33805ad5e9c15327628969b91383eca037 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f167dc33805ad5e9c15327628969b91383eca037/imaplib.py |
name = string.join(string.split(name, '-'), '_') | name = '_'.join(name.split('-')) | def open(self, fullurl, data=None): """Use URLopener().open(file) instead of open(file, 'r').""" fullurl = unwrap(toBytes(fullurl)) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) urltype, url = splittyp... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
if string.lower(urltype) != 'http': | if urltype.lower() != 'http': | def open_http(self, url, data=None): """Use HTTP protocol.""" import httplib user_passwd = None if type(url) is types.StringType: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest us... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
auth = string.strip(base64.encodestring(user_passwd)) | auth = base64.encodestring(user_passwd).strip() | def open_http(self, url, data=None): """Use HTTP protocol.""" import httplib user_passwd = None if type(url) is types.StringType: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest us... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
if string.lower(urltype) != 'https': | if urltype.lower() != 'https': | def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None if type(url) in types.StringTypes: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
auth = string.strip(base64.encodestring(user_passwd)) | auth = base64.encodestring(user_passwd).strip() | def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None if type(url) in types.StringTypes: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
return self.http_error(url, fp, errcode, errmsg, headers, data) | return self.http_error(url, fp, errcode, errmsg, headers, data) | def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None if type(url) in types.StringTypes: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
dirs = string.splitfields(path, '/') | dirs = path.split('/') | def open_ftp(self, url): """Use FTP protocol.""" host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = unquote(host) user = unquote(user or '') passwd = unquote... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
key = user, host, port, string.join(dirs, '/') | key = user, host, port, '/'.join(dirs) | def open_ftp(self, url): """Use FTP protocol.""" host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = unquote(host) user = unquote(user or '') passwd = unquote... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
if string.lower(attr) == 'type' and \ | if attr.lower() == 'type' and \ | def open_ftp(self, url): """Use FTP protocol.""" host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = unquote(host) user = unquote(user or '') passwd = unquote... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
type = string.upper(value) | type = value.upper() | def open_ftp(self, url): """Use FTP protocol.""" host, path = splithost(url) if not host: raise IOError, ('ftp error', 'no host given') host, port = splitport(host) user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = unquote(host) user = unquote(user or '') passwd = unquote... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
[type, data] = string.split(url, ',', 1) | [type, data] = url.split(',', 1) | def open_data(self, url, data=None): """Use "data" URL.""" # ignore POSTed data # # syntax of data URLs: # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data # mediatype := [ type "/" subtype ] *( ";" parameter ) # data := *urlchar # parameter := attribute "=" value import StringIO, mimetools, time try: [ty... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
semi = string.rfind(type, ';') | semi = type.rfind(';') | def open_data(self, url, data=None): """Use "data" URL.""" # ignore POSTed data # # syntax of data URLs: # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data # mediatype := [ type "/" subtype ] *( ";" parameter ) # data := *urlchar # parameter := attribute "=" value import StringIO, mimetools, time try: [ty... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
msg = string.join(msg, '\n') | msg = '\n'.join(msg) | def open_data(self, url, data=None): """Use "data" URL.""" # ignore POSTed data # # syntax of data URLs: # dataurl := "data:" [ mediatype ] [ ";base64" ] "," data # mediatype := [ type "/" subtype ] *( ";" parameter ) # data := *urlchar # parameter := attribute "=" value import StringIO, mimetools, time try: [ty... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
if string.lower(scheme) == 'basic': | if scheme.lower() == 'basic': | def http_error_401(self, url, fp, errcode, errmsg, headers, data=None): """Error 401 -- authentication required. See this URL for a description of the basic authentication scheme: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt""" if headers.has_key('www-authenticate'): stuff = headers['www-authent... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
i = string.find(host, '@') + 1 | i = host.find('@') + 1 | def retry_http_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = string.find(host, '@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = 'http://' + host + selector if data is None: re... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
i = string.find(host, '@') + 1 | i = host.find('@') + 1 | def retry_https_basic_auth(self, url, realm, data=None): host, selector = splithost(url) i = string.find(host, '@') + 1 host = host[i:] user, passwd = self.get_user_passwd(host, realm, i) if not (user or passwd): return None host = user + ':' + passwd + '@' + host newurl = '//' + host + selector return self.open_https(... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
key = realm + '@' + string.lower(host) | key = realm + '@' + host.lower() | def get_user_passwd(self, host, realm, clear_cache = 0): key = realm + '@' + string.lower(host) if self.auth_cache.has_key(key): if clear_cache: del self.auth_cache[key] else: return self.auth_cache[key] user, passwd = self.prompt_user_passwd(host, realm) if user or passwd: self.auth_cache[key] = (user, passwd) return ... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
if reason[:3] != '550': | if str(reason)[:3] != '550': | def retrfile(self, file, type): import ftplib self.endtransfer() if type in ('d', 'D'): cmd = 'TYPE A'; isdir = 1 else: cmd = 'TYPE ' + type; isdir = 0 try: self.ftp.voidcmd(cmd) except ftplib.all_errors: self.init() self.ftp.voidcmd(cmd) conn = None if file and not isdir: # Use nlst to see if the file exists at all tr... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
i = string.rfind(basepath, '/') | i = basepath.rfind('/') | def basejoin(base, url): """Utility to combine a URL with a base URL to form a new URL.""" type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, ju... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
i = string.rfind(basepath[:-1], '/') | i = basepath[:-1].rfind('/') | def basejoin(base, url): """Utility to combine a URL with a base URL to form a new URL.""" type, path = splittype(url) if type: # if url is complete (i.e., it contains a type), return it return url host, path = splithost(path) type, basepath = splittype(base) # inherit type from base if host: # if url contains host, ju... | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
raise UnicodeError("URL "+repr(url)+" contains non-ASCII characters") | raise UnicodeError("URL " + repr(url) + " contains non-ASCII characters") | def toBytes(url): """toBytes(u"URL") --> 'URL'.""" # Most URL schemes require ASCII. If that changes, the conversion # can be relaxed if type(url) is types.UnicodeType: try: url = url.encode("ASCII") except UnicodeError: raise UnicodeError("URL "+repr(url)+" contains non-ASCII characters") return url | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
url = string.strip(url) | url = url.strip() | def unwrap(url): """unwrap('<URL:type://host/path>') --> 'type://host/path'.""" url = string.strip(url) if url[:1] == '<' and url[-1:] == '>': url = string.strip(url[1:-1]) if url[:4] == 'URL:': url = string.strip(url[4:]) return url | b2493f855a7319ce0748bfb965253cad9c9f5a2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2493f855a7319ce0748bfb965253cad9c9f5a2c/urllib.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.