rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
return codecs.mbs_decode(input,self.errors)[0] | return codecs.mbcs_decode(input,self.errors)[0] | def decode(self, input, final=False): return codecs.mbs_decode(input,self.errors)[0] | 73d09e6e47e37bc2c1926f4c829d4acdd37e9e2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/73d09e6e47e37bc2c1926f4c829d4acdd37e9e2a/mbcs.py |
delimiter string. If maxsplit is given, splits into at most maxsplit words. If sep is not specified, any whitespace string is a separator. | delimiter string. If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words). If sep is not specified, any whitespace string is a separator. | def split(s, sep=None, maxsplit=-1): """split(s [,sep [,maxsplit]]) -> list of strings Return a list of the words in the string s, using sep as the delimiter string. If maxsplit is given, splits into at most maxsplit words. If sep is not specified, any whitespace string is a separator. (split and splitfields are synonymous) """ return s.split(sep, maxsplit) | 1d989d057403d0078c989c52affcf3c4e0d0524f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1d989d057403d0078c989c52affcf3c4e0d0524f/string.py |
suffixes_map). | suffix_map). | def guess_type(url): """Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to ".tar.gz". (This is table-driven too, using the dictionary suffixes_map). """ if not inited: init() base, ext = posixpath.splitext(url) while suffix_map.has_key(ext): base, ext = posixpath.splitext(base + suffix_map[ext]) if encodings_map.has_key(ext): encoding = encodings_map[ext] base, ext = posixpath.splitext(base) else: encoding = None if types_map.has_key(ext): return types_map[ext], encoding elif types_map.has_key(string.lower(ext)): return types_map[string.lower(ext)], encoding else: return None, encoding | b21ad5b05f5b0e58bbaa7fe7387fbbd6cfc87120 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b21ad5b05f5b0e58bbaa7fe7387fbbd6cfc87120/mimetypes.py |
def __init__(self, sock): | def __init__(self, sock, debuglevel=0): | def __init__(self, sock): self.fp = sock.makefile('rb', 0) | 98fe92a73e923f679ebda6e70ee985b7650cd60f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98fe92a73e923f679ebda6e70ee985b7650cd60f/httplib.py |
if self.length == 0: self.close() | def begin(self): if self.msg is not None: # we've already started reading the response return | 98fe92a73e923f679ebda6e70ee985b7650cd60f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98fe92a73e923f679ebda6e70ee985b7650cd60f/httplib.py |
|
if self.length == 0 or len(s) < amt: self.close() | def read(self, amt=None): if self.fp is None: return '' | 98fe92a73e923f679ebda6e70ee985b7650cd60f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98fe92a73e923f679ebda6e70ee985b7650cd60f/httplib.py |
|
response = self.response_class(self.sock) | if self.debuglevel > 0: response = self.response_class(self.sock, self.debuglevel) else: response = self.response_class(self.sock) | def getresponse(self): "Get the response from the server." | 98fe92a73e923f679ebda6e70ee985b7650cd60f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98fe92a73e923f679ebda6e70ee985b7650cd60f/httplib.py |
"The class no longer supports the debuglevel." pass | self._conn.set_debuglevel(debuglevel) | def set_debuglevel(self, debuglevel): "The class no longer supports the debuglevel." pass | 98fe92a73e923f679ebda6e70ee985b7650cd60f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/98fe92a73e923f679ebda6e70ee985b7650cd60f/httplib.py |
if __debug__: class Foo: version = 1 class Foo: version = 2 class Foo: version = 3 def execfunc(x): exec x in y | def get_namespace(self): """Returns the single namespace bound to this name. | 6e33e13d7addf2321a96d34004ac062d482b5cbc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6e33e13d7addf2321a96d34004ac062d482b5cbc/symtable.py |
|
def writeln(self, *args): if args: self.write(*args) | def writeln(self, arg=None): if arg: self.write(arg) | def writeln(self, *args): if args: self.write(*args) self.write('\n') # text-mode streams translate to \r\n if needed | 02eed7545ccf6e419d2e6762bb699f172751c694 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02eed7545ccf6e419d2e6762bb699f172751c694/unittest.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="") | 54afc385ee15215cafb9c809d6a4579354760e16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54afc385ee15215cafb9c809d6a4579354760e16/smtplib.py |
fp = open(temp_filename, 'wt') | mode = 'w' if sys.platform not in ['cygwin']: mode += 't' fp = open(temp_filename, mode) | def setUp (self): fp = open(temp_filename, 'wt') fp.write(TEST_NETRC) fp.close() self.netrc = netrc.netrc(temp_filename) | adc8e5bdadab99d92889ed469f2a65a7afba8d7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/adc8e5bdadab99d92889ed469f2a65a7afba8d7a/test_netrc.py |
del dirs_in_sys_path | def addpackage(sitedir, name): fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dirs_in_sys_path.has_key(dircase) and os.path.exists(dir): sys.path.append(dir) dirs_in_sys_path[dircase] = 1 | 29736e21f794527d653f8d63000e9ec30809af7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29736e21f794527d653f8d63000e9ec30809af7f/site.py |
|
data = self.rfile.read(int(self.headers["content-length"])) | max_chunk_size = 10*1024*1024 size_remaining = int(self.headers["content-length"]) L = [] while size_remaining: chunk_size = min(size_remaining, max_chunk_size) L.append(self.rfile.read(chunk_size)) size_remaining -= len(L[-1]) data = ''.join(L) | def do_POST(self): """Handles the HTTP POST request. | 62b2bbe893a247009cb0aa35221cc77320f291c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/62b2bbe893a247009cb0aa35221cc77320f291c9/SimpleXMLRPCServer.py |
elif _isfunction(v) or _isclass(v): | elif _isfunction(v) or _isclass(v) or _ismethod(v): | def run__test__(self, d, name): """d, name -> Treat dict d like module.__test__. | 93c6492106baad86aaa09980a7560c2724b8e132 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/93c6492106baad86aaa09980a7560c2724b8e132/doctest.py |
"dict must be strings, functions " | "dict must be strings, functions, methods, " | def run__test__(self, d, name): """d, name -> Treat dict d like module.__test__. | 93c6492106baad86aaa09980a7560c2724b8e132 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/93c6492106baad86aaa09980a7560c2724b8e132/doctest.py |
if verbose: print "compiling string with syntax error" | def test_complex_args(self): | exec 'def f(a, a): pass' | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
try: compile("1+*3", "filename", "exec") except SyntaxError, detail: if not detail.filename == "filename": raise TestFailed, "expected 'filename', got %r" % detail.filename | def comp_args((a, b)): return a,b self.assertEqual(comp_args((1, 2)), (1, 2)) | exec 'def f(a, a): pass' | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
try: exec 'def f(a = 0, a = 1): pass' raise TestFailed, "duplicate keyword arguments" except SyntaxError: pass | def comp_args((a, b)=(3, 4)): return a, b self.assertEqual(comp_args((1, 2)), (1, 2)) self.assertEqual(comp_args(), (3, 4)) | exec 'def f(a, a): pass' | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
try: exec 'def f(a): global a; a = 1' raise TestFailed, "variable is global and local" except SyntaxError: pass | def comp_args(a, (b, c)): return a, b, c self.assertEqual(comp_args(1, (2, 3)), (1, 2, 3)) | exec 'def f(a = 0, a = 1): pass' | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
if verbose: print "testing complex args" | def comp_args(a=2, (b, c)=(3, 4)): return a, b, c self.assertEqual(comp_args(1, (2, 3)), (1, 2, 3)) self.assertEqual(comp_args(), (2, 3, 4)) | exec 'def f(a): global a; a = 1' | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
def comp_args((a, b)): print a,b | def test_argument_order(self): try: exec 'def f(a=1, (b, c)): pass' self.fail("non-default args after default") except SyntaxError: pass | def comp_args((a, b)): print a,b | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
comp_args((1, 2)) | def test_float_literals(self): self.assertRaises(SyntaxError, eval, "2e") self.assertRaises(SyntaxError, eval, "2.0e+") self.assertRaises(SyntaxError, eval, "1e-") self.assertRaises(SyntaxError, eval, "3-4e/21") | def comp_args((a, b)): print a,b | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
def comp_args((a, b)=(3, 4)): print a, b comp_args((1, 2)) comp_args() def comp_args(a, (b, c)): print a, b, c comp_args(1, (2, 3)) def comp_args(a=2, (b, c)=(3, 4)): print a, b, c comp_args(1, (2, 3)) comp_args() try: exec 'def f(a=1, (b, c)): pass' raise TestFailed, "non-default args after default" except SyntaxError: pass if verbose: print "testing bad float literals" def expect_error(s): try: eval(s) raise TestFailed("%r accepted" % s) except SyntaxError: pass expect_error("2e") expect_error("2.0e+") expect_error("1e-") expect_error("3-4e/21") if verbose: print "testing compile() of indented block w/o trailing newline" s = """ | def test_indentation(self): s = """ | def comp_args((a, b)=(3, 4)): print a, b | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
compile(s, "<string>", "exec") | compile(s, "<string>", "exec") def test_literals_with_leading_zeroes(self): for arg in ["077787", "0xj", "0x.", "0e", "090000000000000", "080000000000000", "000000000000009", "000000000000008"]: self.assertRaises(SyntaxError, eval, arg) self.assertEqual(eval("0777"), 511) self.assertEqual(eval("0777L"), 511) self.assertEqual(eval("000777"), 511) self.assertEqual(eval("0xff"), 255) self.assertEqual(eval("0xffL"), 255) self.assertEqual(eval("0XfF"), 255) self.assertEqual(eval("0777."), 777) self.assertEqual(eval("0777.0"), 777) self.assertEqual(eval("000000000000000000000000000000000000000000000000000777e0"), 777) self.assertEqual(eval("0777e1"), 7770) self.assertEqual(eval("0e0"), 0) self.assertEqual(eval("0000E-012"), 0) self.assertEqual(eval("09.5"), 9.5) self.assertEqual(eval("0777j"), 777j) self.assertEqual(eval("00j"), 0j) self.assertEqual(eval("00.0"), 0) self.assertEqual(eval("0e3"), 0) self.assertEqual(eval("090000000000000."), 90000000000000.) self.assertEqual(eval("090000000000000.0000000000000000000000"), 90000000000000.) self.assertEqual(eval("090000000000000e0"), 90000000000000.) self.assertEqual(eval("090000000000000e-0"), 90000000000000.) self.assertEqual(eval("090000000000000j"), 90000000000000j) self.assertEqual(eval("000000000000007"), 7) self.assertEqual(eval("000000000000008."), 8.) self.assertEqual(eval("000000000000009."), 9.) def test_unary_minus(self): warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning) warnings.filterwarnings("ignore", "hex.* of negative int", FutureWarning) all_one_bits = '0xffffffff' if sys.maxint != 2147483647: all_one_bits = '0xffffffffffffffff' self.assertEqual(eval(all_one_bits), -1) self.assertEqual(eval("-" + all_one_bits), 1) def test_sequence_unpacking_error(self): i,j = (1, -1) or (-1, 1) self.assertEqual(i, 1) self.assertEqual(j, -1) | def expect_error(s): try: eval(s) raise TestFailed("%r accepted" % s) except SyntaxError: pass | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
if verbose: print "testing literals with leading zeroes" | def test_main(): test_support.run_unittest(TestSpecifics) | def expect_error(s): try: eval(s) raise TestFailed("%r accepted" % s) except SyntaxError: pass | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
def expect_same(test_source, expected): got = eval(test_source) if got != expected: raise TestFailed("eval(%r) gave %r, but expected %r" % (test_source, got, expected)) expect_error("077787") expect_error("0xj") expect_error("0x.") expect_error("0e") expect_same("0777", 511) expect_same("0777L", 511) expect_same("000777", 511) expect_same("0xff", 255) expect_same("0xffL", 255) expect_same("0XfF", 255) expect_same("0777.", 777) expect_same("0777.0", 777) expect_same("000000000000000000000000000000000000000000000000000777e0", 777) expect_same("0777e1", 7770) expect_same("0e0", 0) expect_same("0000E-012", 0) expect_same("09.5", 9.5) expect_same("0777j", 777j) expect_same("00j", 0j) expect_same("00.0", 0) expect_same("0e3", 0) expect_same("090000000000000.", 90000000000000.) expect_same("090000000000000.0000000000000000000000", 90000000000000.) expect_same("090000000000000e0", 90000000000000.) expect_same("090000000000000e-0", 90000000000000.) expect_same("090000000000000j", 90000000000000j) expect_error("090000000000000") expect_error("080000000000000") expect_error("000000000000009") expect_error("000000000000008") expect_same("000000000000007", 7) expect_same("000000000000008.", 8.) expect_same("000000000000009.", 9.) import warnings warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning) warnings.filterwarnings("ignore", "hex.* of negative int", FutureWarning) import sys all_one_bits = '0xffffffff' if sys.maxint != 2147483647: all_one_bits = '0xffffffffffffffff' exec """ expect_same(all_one_bits, -1) expect_same("-" + all_one_bits, 1) """ i,j = (1, -1) or (-1, 1) if i != 1 or j != -1: raise TestFailed, "Sequence packing/unpacking" | if __name__ == "__main__": test_main() | def expect_same(test_source, expected): got = eval(test_source) if got != expected: raise TestFailed("eval(%r) gave %r, but expected %r" % (test_source, got, expected)) | cfaee582698839a2f4c5a779f9a4b3f30c7efa67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cfaee582698839a2f4c5a779f9a4b3f30c7efa67/test_compile.py |
import warnings warnings.warn("cookielib bug!", stacklevel=2) import traceback traceback.print_exc() | import warnings, traceback, StringIO f = StringIO.StringIO() traceback.print_exc(None, f) msg = f.getvalue() warnings.warn("cookielib bug!\n%s" % msg, stacklevel=2) | def reraise_unmasked_exceptions(unmasked=()): # There are a few catch-all except: statements in this module, for # catching input that's bad in unexpected ways. # This function re-raises some exceptions we don't want to trap. unmasked = unmasked + (KeyboardInterrupt, SystemExit, MemoryError) etype = sys.exc_info()[0] if issubclass(etype, unmasked): raise # swallowed an exception import warnings warnings.warn("cookielib bug!", stacklevel=2) import traceback traceback.print_exc() | 595abd2da7567fc83be31c68ccc709464f0147af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/595abd2da7567fc83be31c68ccc709464f0147af/cookielib.py |
if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: | try: if timeout is None: waiter.acquire() | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 # 1 usec while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | 949864a535605826a9c8133398771c382fc4d75e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/949864a535605826a9c8133398771c382fc4d75e/threading.py |
self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass | self._note("%s.wait(): got it", self) | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 # 1 usec while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | 949864a535605826a9c8133398771c382fc4d75e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/949864a535605826a9c8133398771c382fc4d75e/threading.py |
if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | endtime = _time() + timeout delay = 0.000001 while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __debug__: self._note("%s.wait(%s): got it", self, timeout) finally: self._acquire_restore(saved_state) | def wait(self, timeout=None): me = currentThread() assert self._is_owned(), "wait() of un-acquire()d lock" waiter = _allocate_lock() waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() if timeout is None: waiter.acquire() if __debug__: self._note("%s.wait(): got it", self) else: endtime = _time() + timeout delay = 0.000001 # 1 usec while 1: gotit = waiter.acquire(0) if gotit or _time() >= endtime: break _sleep(delay) if delay < 1.0: delay = delay * 2.0 if not gotit: if __debug__: self._note("%s.wait(%s): timed out", self, timeout) try: self.__waiters.remove(waiter) except ValueError: pass else: if __debug__: self._note("%s.wait(%s): got it", self, timeout) self._acquire_restore(saved_state) | 949864a535605826a9c8133398771c382fc4d75e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/949864a535605826a9c8133398771c382fc4d75e/threading.py |
def d22v(a, b, c=1, d=2, *rest): pass | ca34baacf6e3c2ab0a5692eb0f39b5e0995de901 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca34baacf6e3c2ab0a5692eb0f39b5e0995de901/test_grammar.py |
||
"".join(map(lambda i: "0123456789ABCDEF"[i], digits)) + "L" | "".join(map(lambda i: "0123456789abcdef"[i], digits)) + "L" | def slow_format(self, x, base): if (x, base) == (0, 8): # this is an oddball! return "0L" digits = [] sign = 0 if x < 0: sign, x = 1, -x while x: x, r = divmod(x, base) digits.append(int(r)) digits.reverse() digits = digits or [0] return '-'[:sign] + \ {8: '0', 10: '', 16: '0x'}[base] + \ "".join(map(lambda i: "0123456789ABCDEF"[i], digits)) + "L" | c3281563dd6a44a2ed04056618dbb248acf6557c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c3281563dd6a44a2ed04056618dbb248acf6557c/test_long.py |
def flush(self): | def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH): if self.mode == WRITE: self.fileobj.write(self.compress.flush(zlib_mode)) | def flush(self): self.fileobj.flush() | 10794b09cfe2915f4e81b9b48157c5e1b46677b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/10794b09cfe2915f4e81b9b48157c5e1b46677b9/gzip.py |
def dump(*stuff): sys.__stdout__.write(string.join(map(str, stuff), " ") + "\n") | 464bf36919ff2936f8e1224be84fce9759640ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/464bf36919ff2936f8e1224be84fce9759640ede/PyParse.py |
||
(?: \s+ | ( [^\s[\](){} )+ | [^[\](){} | def dump(*stuff): sys.__stdout__.write(string.join(map(str, stuff), " ") + "\n") | 464bf36919ff2936f8e1224be84fce9759640ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/464bf36919ff2936f8e1224be84fce9759640ede/PyParse.py |
i = m.end(1) - 1 | p = m.end() i = p-1 while i >= 0 and str[i] in " \t\n": i = i-1 | def _study2(self, _rfind=string.rfind, _find=string.find, _ws=string.whitespace): if self.study_level >= 2: return self._study1() self.study_level = 2 | 464bf36919ff2936f8e1224be84fce9759640ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/464bf36919ff2936f8e1224be84fce9759640ede/PyParse.py |
p = m.end() | def _study2(self, _rfind=string.rfind, _find=string.find, _ws=string.whitespace): if self.study_level >= 2: return self._study1() self.study_level = 2 | 464bf36919ff2936f8e1224be84fce9759640ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/464bf36919ff2936f8e1224be84fce9759640ede/PyParse.py |
|
prefix = PREFIX prefix_len = len(prefix) | def main(): rcfile = os.path.join(os.path.dirname(refcounts.__file__), os.pardir, "api", "refcounts.dat") outfile = "-" opts, args = getopt.getopt(sys.argv[1:], "o:r:", ["output=", "refcounts="]) for opt, arg in opts: if opt in ("-o", "--output"): outfile = arg elif opt in ("-r", "--refcounts"): rcfile = arg rcdict = refcounts.load(rcfile) if outfile == "-": output = sys.stdout else: output = open(outfile, "w") if not args: args = ["-"] prefix = PREFIX prefix_len = len(prefix) for infile in args: if infile == "-": input = sys.stdin else: input = open(infile) while 1: line = input.readline() if not line: break if line[:prefix_len] == prefix: s = string.split(line[prefix_len:], '}', 1)[0] try: info = rcdict[s] except KeyError: sys.stderr.write("No refcount data for %s\n" % s) else: if info.result_type in ("PyObject*", "PyVarObject*"): if info.result_refs is None: rc = "Always \NULL{}" else: rc = info.result_refs and "New" or "Borrowed" rc = rc + " reference" line = (r"\begin{cfuncdesc}[%s]{%s}{" % (rc, info.result_type)) \ + line[prefix_len:] output.write(line) if infile != "-": input.close() if outfile != "-": output.close() | bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9/anno-api.py |
|
if line[:prefix_len] == prefix: s = string.split(line[prefix_len:], '}', 1)[0] | prefix = None if line.startswith(PREFIX_1): prefix = PREFIX_1 elif line.startswith(PREFIX_2): prefix = PREFIX_2 if prefix: s = line[len(prefix):].split('}', 1)[0] | def main(): rcfile = os.path.join(os.path.dirname(refcounts.__file__), os.pardir, "api", "refcounts.dat") outfile = "-" opts, args = getopt.getopt(sys.argv[1:], "o:r:", ["output=", "refcounts="]) for opt, arg in opts: if opt in ("-o", "--output"): outfile = arg elif opt in ("-r", "--refcounts"): rcfile = arg rcdict = refcounts.load(rcfile) if outfile == "-": output = sys.stdout else: output = open(outfile, "w") if not args: args = ["-"] prefix = PREFIX prefix_len = len(prefix) for infile in args: if infile == "-": input = sys.stdin else: input = open(infile) while 1: line = input.readline() if not line: break if line[:prefix_len] == prefix: s = string.split(line[prefix_len:], '}', 1)[0] try: info = rcdict[s] except KeyError: sys.stderr.write("No refcount data for %s\n" % s) else: if info.result_type in ("PyObject*", "PyVarObject*"): if info.result_refs is None: rc = "Always \NULL{}" else: rc = info.result_refs and "New" or "Borrowed" rc = rc + " reference" line = (r"\begin{cfuncdesc}[%s]{%s}{" % (rc, info.result_type)) \ + line[prefix_len:] output.write(line) if infile != "-": input.close() if outfile != "-": output.close() | bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9/anno-api.py |
+ line[prefix_len:] | + line[len(prefix):] | def main(): rcfile = os.path.join(os.path.dirname(refcounts.__file__), os.pardir, "api", "refcounts.dat") outfile = "-" opts, args = getopt.getopt(sys.argv[1:], "o:r:", ["output=", "refcounts="]) for opt, arg in opts: if opt in ("-o", "--output"): outfile = arg elif opt in ("-r", "--refcounts"): rcfile = arg rcdict = refcounts.load(rcfile) if outfile == "-": output = sys.stdout else: output = open(outfile, "w") if not args: args = ["-"] prefix = PREFIX prefix_len = len(prefix) for infile in args: if infile == "-": input = sys.stdin else: input = open(infile) while 1: line = input.readline() if not line: break if line[:prefix_len] == prefix: s = string.split(line[prefix_len:], '}', 1)[0] try: info = rcdict[s] except KeyError: sys.stderr.write("No refcount data for %s\n" % s) else: if info.result_type in ("PyObject*", "PyVarObject*"): if info.result_refs is None: rc = "Always \NULL{}" else: rc = info.result_refs and "New" or "Borrowed" rc = rc + " reference" line = (r"\begin{cfuncdesc}[%s]{%s}{" % (rc, info.result_type)) \ + line[prefix_len:] output.write(line) if infile != "-": input.close() if outfile != "-": output.close() | bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bc91c5e0599ae2e57fa667df3e9c9baf7e5760d9/anno-api.py |
seq, request = rpc.request_queue.get(0) | seq, request = rpc.request_queue.get(block=True, timeout=0.05) | def main(del_exitfunc=False): """Start the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated, the TCPServer initialization creates an instance of run.MyHandler and calls its handle() method. handle() instantiates a run.Executive object, passing it a reference to the MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. """ global exit_now global quitting global no_exitfunc no_exitfunc = del_exitfunc port = 8833 #time.sleep(15) # test subprocess not responding if sys.argv[1:]: port = int(sys.argv[1]) sys.argv[:] = [""] sockthread = threading.Thread(target=manage_socket, name='SockThread', args=((LOCALHOST, port),)) sockthread.setDaemon(True) sockthread.start() while 1: try: if exit_now: try: exit() except KeyboardInterrupt: # exiting but got an extra KBI? Try again! continue try: seq, request = rpc.request_queue.get(0) except Queue.Empty: time.sleep(0.05) continue method, args, kwargs = request ret = method(*args, **kwargs) rpc.response_queue.put((seq, ret)) except KeyboardInterrupt: if quitting: exit_now = True continue except SystemExit: raise except: type, value, tb = sys.exc_info() try: print_exception() rpc.response_queue.put((seq, None)) except: # Link didn't work, print same exception to __stderr__ traceback.print_exception(type, value, tb, file=sys.__stderr__) exit() else: continue | 169648986ea1f11c2c30c3a6c100e5c3583d51ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/169648986ea1f11c2c30c3a6c100e5c3583d51ea/run.py |
time.sleep(0.05) | def main(del_exitfunc=False): """Start the Python execution server in a subprocess In the Python subprocess, RPCServer is instantiated with handlerclass MyHandler, which inherits register/unregister methods from RPCHandler via the mix-in class SocketIO. When the RPCServer 'server' is instantiated, the TCPServer initialization creates an instance of run.MyHandler and calls its handle() method. handle() instantiates a run.Executive object, passing it a reference to the MyHandler object. That reference is saved as attribute rpchandler of the Executive instance. The Executive methods have access to the reference and can pass it on to entities that they command (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can call MyHandler(SocketIO) register/unregister methods via the reference to register and unregister themselves. """ global exit_now global quitting global no_exitfunc no_exitfunc = del_exitfunc port = 8833 #time.sleep(15) # test subprocess not responding if sys.argv[1:]: port = int(sys.argv[1]) sys.argv[:] = [""] sockthread = threading.Thread(target=manage_socket, name='SockThread', args=((LOCALHOST, port),)) sockthread.setDaemon(True) sockthread.start() while 1: try: if exit_now: try: exit() except KeyboardInterrupt: # exiting but got an extra KBI? Try again! continue try: seq, request = rpc.request_queue.get(0) except Queue.Empty: time.sleep(0.05) continue method, args, kwargs = request ret = method(*args, **kwargs) rpc.response_queue.put((seq, ret)) except KeyboardInterrupt: if quitting: exit_now = True continue except SystemExit: raise except: type, value, tb = sys.exc_info() try: print_exception() rpc.response_queue.put((seq, None)) except: # Link didn't work, print same exception to __stderr__ traceback.print_exception(type, value, tb, file=sys.__stderr__) exit() else: continue | 169648986ea1f11c2c30c3a6c100e5c3583d51ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/169648986ea1f11c2c30c3a6c100e5c3583d51ea/run.py |
|
if len(result) > 1: | if use_all or len(result) > 1: | def group(self, *groups): | ac05b9217476cbeb900cdc3dc005f7f898f83ae8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac05b9217476cbeb900cdc3dc005f7f898f83ae8/re.py |
if (type!=float): | if type != float: | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (pow(type(i),0)!=1): | if pow(type(i), 0) != 1: | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (pow(type(i),1)!=type(i)): | if pow(type(i), 1) != type(i): | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (pow(type(0),1)!=type(0)): | if pow(type(0), 1) != type(0): | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (pow(type(1),1)!=type(1)): | if pow(type(1), 1) != type(1): | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
||
if (pow(type(i),3)!=i*i*i): | if pow(type(i), 3) != i*i*i: | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
pow2=1 | pow2 = 1 | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (pow(2,i)!=pow2): | if pow(2, i) != pow2: | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (i!=30): pow2=pow2*2 | if i != 30 : pow2 = pow2*2 for othertype in int, long: for i in range(-10, 0) + range(1, 10): ii = type(i) for j in range(1, 11): jj = -othertype(j) try: pow(ii, jj) except ValueError: pass else: raise ValueError, "pow(%s, %s) did not fail" % (ii, jj) for othertype in int, long, float: for i in range(1, 100): zero = type(0) exp = -othertype(i/10.0) if exp == 0: continue try: pow(zero, exp) except ZeroDivisionError: pass else: raise ValueError, "pow(%s, %s) did not fail" % (zero, exp) | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (type==float): il=1 | if type == float: il = 1 | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 | elif type == int: jl = 0 elif type == long: jl, jh = 0, 15 | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
for j in range(jl,jh+1): | for j in range(jl, jh+1): | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (k!=0): | if k != 0: | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
if (j>=0 and k!=0): o=pow(i,j) % k n=pow(i,j,k) if (o!=n): print 'Integer mismatch:', i,j,k if (j>=0 and k<>0): o=pow(long(i),j) % k n=pow(long(i),j,k) if (o!=n): print 'Long mismatch:', i,j,k if (i>=0 and k<>0): o=pow(float(i),j) % k n=pow(float(i),j,k) if (o!=n): print 'Float mismatch:', i,j,k | if j >= 0 and k != 0: o = pow(i,j) % k n = pow(i,j,k) if o != n: print 'Integer mismatch:', i,j,k if j >= 0 and k <> 0: o = pow(long(i),j) % k n = pow(long(i),j,k) if o != n: print 'Long mismatch:', i,j,k if i >= 0 and k <> 0: o = pow(float(i),j) % k n = pow(float(i),j,k) if o != n: print 'Float mismatch:', i,j,k | 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,'+str(i)+') != 0' if (pow(type(1),1)!=type(1)): raise ValueError, 'pow(1,'+str(i)+') != 1' 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 print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if (type==float): il=1 compare = test_support.fcmp elif (type==int): jl=0 elif (type==long): jl,jh = 0, 15 for i in range(il, ih+1): for j in range(jl,jh+1): for k in range(kl, kh+1): if (k!=0): if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k) | 294a1764c606a701489f3c9bcab5865abf636c26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/294a1764c606a701489f3c9bcab5865abf636c26/test_pow.py |
self.file = self.sock.makefile('rb') | if self.file is None: self.file = self.sock.makefile('rb') | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: | 95eac732a5b0f34b39088dd310bc3d807f5bc32f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/95eac732a5b0f34b39088dd310bc3d807f5bc32f/smtplib.py |
try: errcode = string.atoi(code) except ValueError: errcode = -1 break | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: | 95eac732a5b0f34b39088dd310bc3d807f5bc32f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/95eac732a5b0f34b39088dd310bc3d807f5bc32f/smtplib.py |
|
try: errcode = string.atoi(code) except(ValueError): errcode = -1 | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: | 95eac732a5b0f34b39088dd310bc3d807f5bc32f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/95eac732a5b0f34b39088dd310bc3d807f5bc32f/smtplib.py |
|
On Unix, there are three possible config files: pydistutils.cfg in the Distutils installation directory (ie. where the top-level Distutils __inst__.py file lives), .pydistutils.cfg in the user's home directory, and setup.cfg in the current directory. On Windows and Mac OS, there are two possible config files: pydistutils.cfg in the Python installation directory (sys.prefix) and setup.cfg in the current directory. | There are three possible config files: distutils.cfg in the Distutils installation directory (ie. where the top-level Distutils __inst__.py file lives), a file in the user's home directory named .pydistutils.cfg on Unix and pydistutils.cfg on Windows/Mac, and setup.cfg in the current directory. | def find_config_files (self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist (modulo nasty race conditions). | 0574e576a0658179a19dc1f66d98c52dae198c4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0574e576a0658179a19dc1f66d98c52dae198c4b/dist.py |
eq(msg.epilogue, '\n\n') | eq(msg.epilogue, '\n') | def test_mondo_message(self): eq = self.assertEqual neq = self.ndiffAssertEqual msg = self._msgobj('crispin-torture.txt') payload = msg.get_payload() eq(type(payload), ListType) eq(len(payload), 12) eq(msg.preamble, None) eq(msg.epilogue, '\n\n') # Probably the best way to verify the message is parsed correctly is to # dump its structure and compare it against the known structure. fp = StringIO() _structure(msg, fp=fp) neq(fp.getvalue(), """\ | 90a0fa8c3a160e323f5a5a6bd0621b4a9a802034 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/90a0fa8c3a160e323f5a5a6bd0621b4a9a802034/test_email_torture.py |
existed = sectdict.has_key(key) | existed = sectdict.has_key(option) | def remove_option(self, section, option): """Remove an option.""" if not section or section == "DEFAULT": sectdict = self.__defaults else: try: sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) existed = sectdict.has_key(key) if existed: del sectdict[key] return existed | 27409c95b33b971c499c359698bbd01a7181f64b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/27409c95b33b971c499c359698bbd01a7181f64b/ConfigParser.py |
del sectdict[key] | del sectdict[option] | def remove_option(self, section, option): """Remove an option.""" if not section or section == "DEFAULT": sectdict = self.__defaults else: try: sectdict = self.__sections[section] except KeyError: raise NoSectionError(section) existed = sectdict.has_key(key) if existed: del sectdict[key] return existed | 27409c95b33b971c499c359698bbd01a7181f64b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/27409c95b33b971c499c359698bbd01a7181f64b/ConfigParser.py |
def subconvert(line, ofp, table, discards, autoclosing, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("- %s \n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n") | a00fc9c25eae87b8013ff011fc5a39e2a0f14bed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a00fc9c25eae87b8013ff011fc5a39e2a0f14bed/latex2esis.py |
||
subconvert(ifp.read(), ofp, table, discards, autoclosing) | subconvert(data, ofp, table, discards, autoclosing) | def convert(ifp, ofp, table={}, discards=(), autoclosing=()): try: subconvert(ifp.read(), ofp, table, discards, autoclosing) except IOError, (err, msg): if err != errno.EPIPE: raise | a00fc9c25eae87b8013ff011fc5a39e2a0f14bed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a00fc9c25eae87b8013ff011fc5a39e2a0f14bed/latex2esis.py |
"calling %s returned %s, not a test" % obj,test | "calling %s returned %s, not a test" % (obj,test) | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 7e911725dcd06f01daec1d3c86a322d0e0df7875 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7e911725dcd06f01daec1d3c86a322d0e0df7875/unittest.py |
<type 'None'> | <type 'NoneType'> | ... def g(): | 7329df3f9216b798b095b56b2b5a9cb2a58b5c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7329df3f9216b798b095b56b2b5a9cb2a58b5c52/test_generators.py |
<type 'None'> | <type 'NoneType'> | ... def f(self): | 7329df3f9216b798b095b56b2b5a9cb2a58b5c52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7329df3f9216b798b095b56b2b5a9cb2a58b5c52/test_generators.py |
file.warn ("exclude (!) doesn't apply to " + "whole directory trees") | manifest.warn ("exclude (!) doesn't apply to " + "whole directory trees") | def read_manifest (self): | b10371c295a021a94e580e02d59b2b0ffbc3ad4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b10371c295a021a94e580e02d59b2b0ffbc3ad4b/dist.py |
file.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | manifest.warn ("can't have multiple words unless first word " + "('%s') is a directory name" % words[0]) | def read_manifest (self): | b10371c295a021a94e580e02d59b2b0ffbc3ad4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b10371c295a021a94e580e02d59b2b0ffbc3ad4b/dist.py |
file.warn ("no files excluded by '%s'" % pattern) | manifest.warn ("no files excluded by '%s'" % pattern) | def read_manifest (self): | b10371c295a021a94e580e02d59b2b0ffbc3ad4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b10371c295a021a94e580e02d59b2b0ffbc3ad4b/dist.py |
self.sock.send(str) | if self.sock: self.sock.send(str) else: raise SMTPServerDisconnected | def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` self.sock.send(str) | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
(note : multiline responces converted to a single, multiline string) | (note : multiline responces converted to a single, multiline string) | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read responce code. - server response string corresponding to response code | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg) | print 'reply: retcode (%s); Msg: %s' % (errcode,errmsg) | def getreply(self): """Get a reply from the server. Returns a tuple consisting of: - server response code (e.g. '250', or such, if all goes well) Note: returns -1 if it can't read responce code. - server response string corresponding to response code | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
""" SMTP 'help' command. Returns help text from server """ | """ SMTP 'help' command. Returns help text from server """ | def help(self): """ SMTP 'help' command. Returns help text from server """ | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
def data(self,msg): """ SMTP 'DATA' command. Sends message data to server. Automatically quotes lines beginning with a period per rfc821 """ | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
||
def data(self,msg): """ SMTP 'DATA' command. Sends message data to server. Automatically quotes lines beginning with a period per rfc821 """ | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
||
This method will return normally if the mail is accepted for at least one recipiant .Otherwise it will throw an exception (either SMTPSenderRefused,SMTPRecipientsRefused, or SMTPDataError) That is, if this method does not throw an excception, then someone | This method will return normally if the mail is accepted for at least one recipiant. Otherwise it will throw an exception (either SMTPSenderRefused, SMTPRecipientsRefused, or SMTPDataError) That is, if this method does not throw an exception, then someone | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
It returns a dictionary , with one entry for each recipient that was refused. | It returns a dictionary , with one entry for each recipient that was refused. | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
>>> tolist= [ "[email protected]", ... "[email protected]", ... "[email protected]", ... "[email protected]"] | >>> tolist=["[email protected]","[email protected]","[email protected]","[email protected]"] | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
In the above example, the message was accepted for delivery to three of the four addresses, and one was rejected, with the error code 550. If all addresses are accepted, then the method will return an empty dictionary. | In the above example, the message was accepted for delivery to three of the four addresses, and one was rejected, with the error code 550. If all addresses are accepted, then the method will return an empty dictionary. | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
senderr[each]=(code,resp) | senderrs[each]=(code,resp) | def sendmail(self,from_addr,to_addrs,msg): """ This command performs an entire mail transaction. The arguments are: - from_addr : The address sending this mail. - to_addrs : a list of addresses to send this mail to - msg : the message to send. | e73ba6c2cf417ec058a05564b3e178c42b6b9b58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e73ba6c2cf417ec058a05564b3e178c42b6b9b58/smtplib.py |
if self.elements is XMLParser.elements: self.__fixelements() | def __init__(self): self.reset() if self.elements is XMLParser.elements: self.__fixelements() | e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1/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-1 str = res.group(1) pre = data[:res.start(0)] post = data[i:] if str[0] == '#': if str[1] == 'x': str = chr(string.atoi(str[2:], 16)) else: str = chr(string.atoi(str[1:])) data = pre + str + post i = res.start(0)+len(str) elif all: if self.entitydefs.has_key(str): data = pre + self.entitydefs[str] + post i = res.start(0) # rescan substituted text else: self.syntax_error('reference to unknown entity') # can't do it, so keep the entity ref in data = pre + '&' + str + ';' + post i = res.start(0) + len(str) + 2 else: # just translating character references pass # i is already postioned correctly | e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1/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 < j: data = rawdata[i:j] if self.__at_start and space.match(data) is None: self.syntax_error('illegal data at start of file') self.__at_start = 0 if not self.stack and space.match(data) is None: self.syntax_error('data not in content') if illegal.search(data): self.syntax_error('illegal character in content') self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = j if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue k = self.parse_starttag(i) if k < 0: break self.__seen_starttag = 1 self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if endtagopen.match(rawdata, i): k = self.parse_endtag(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if commentopen.match(rawdata, i): if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue k = self.parse_comment(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if cdataopen.match(rawdata, i): k = self.parse_cdata(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:i], '\n') i = k continue res = xmldecl.match(rawdata, i) if res: if not self.__at_start: self.syntax_error("<?xml?> declaration not at start of document") version, encoding, standalone = res.group('version', 'encoding', 'standalone') if version[1:-1] != '1.0': raise RuntimeError, 'only XML version 1.0 supported' if encoding: encoding = encoding[1:-1] if standalone: standalone = standalone[1:-1] self.handle_xml(encoding, standalone) i = res.end(0) continue res = procopen.match(rawdata, i) if res: k = self.parse_proc(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue res = doctype.match(rawdata, i) if res: if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue if self.__seen_doctype: self.syntax_error('multiple DOCTYPE elements') if self.__seen_starttag: self.syntax_error('DOCTYPE not at beginning of document') k = self.parse_doctype(res) if k < 0: break self.__seen_doctype = res.group('name') self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue elif rawdata[i] == '&': if self.literal: data = rawdata[i] self.handle_data(data) i = i+1 continue res = charref.match(rawdata, i) if res is not None: i = res.end(0) if rawdata[i-1] != ';': self.syntax_error("`;' missing in charref") i = i-1 if not self.stack: self.syntax_error('data not in content') self.handle_charref(res.group('char')[:-1]) self.lineno = self.lineno + string.count(res.group(0), '\n') continue res = entityref.match(rawdata, i) if res is not None: i = res.end(0) if rawdata[i-1] != ';': self.syntax_error("`;' missing in entityref") i = i-1 name = res.group('name') if self.entitydefs.has_key(name): self.rawdata = rawdata = rawdata[:res.start(0)] + self.entitydefs[name] + rawdata[i:] n = len(rawdata) i = res.start(0) else: self.syntax_error('reference to unknown entity') self.unknown_entityref(name) self.lineno = self.lineno + string.count(res.group(0), '\n') continue elif rawdata[i] == ']': if self.literal: data = rawdata[i] self.handle_data(data) i = i+1 continue if n-i < 3: break if cdataclose.match(rawdata, i): self.syntax_error("bogus `]]>'") self.handle_data(rawdata[i]) i = i+1 continue else: raise RuntimeError, 'neither < nor & ??' # We get here only if incomplete matches but # nothing else break # end while if i > 0: self.__at_start = 0 if end and i < n: data = rawdata[i] self.syntax_error("bogus `%s'" % data) if illegal.search(data): self.syntax_error('illegal character in content') self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') self.rawdata = rawdata[i+1:] return self.goahead(end) self.rawdata = rawdata[i:] if end: if not self.__seen_starttag: self.syntax_error('no elements in file') if self.stack: self.syntax_error('missing end tags') while self.stack: self.finish_endtag(self.stack[-1][0]) | e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e0b147ddd3da5db3fd41041b0b05157bbbf7a3d1/xmllib.py |
childNodeTypes = (Node.TEXT_NODE, Node.ENTITY_REFERENCE_NODE) | def _getElementsByTagNameNSHelper(parent, nsURI, localName, rc): for node in parent.childNodes: if node.nodeType == Node.ELEMENT_NODE: if ((localName == "*" or node.tagName == localName) and (nsURI == "*" or node.namespaceURI == nsURI)): rc.append(node) _getElementsByTagNameNSHelper(node, nsURI, localName, rc) return rc | 5de284e56e3608700c2fb402aa85e392a6d2fa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5de284e56e3608700c2fb402aa85e392a6d2fa6f/minidom.py |
|
childNodeTypes = (Node.ELEMENT_NODE, Node.PROCESSING_INSTRUCTION_NODE, Node.COMMENT_NODE, Node.TEXT_NODE, Node.CDATA_SECTION_NODE, Node.ENTITY_REFERENCE_NODE) | def __delitem__(self, attname_or_tuple): node = self[attname_or_tuple] node.unlink() del self._attrs[node.name] del self._attrsNS[(node.namespaceURI, node.localName)] self.length = len(self._attrs) | 5de284e56e3608700c2fb402aa85e392a6d2fa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5de284e56e3608700c2fb402aa85e392a6d2fa6f/minidom.py |
|
childNodeTypes = () | def _get_attributes(self): return AttributeList(self._attrs, self._attrsNS) | 5de284e56e3608700c2fb402aa85e392a6d2fa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5de284e56e3608700c2fb402aa85e392a6d2fa6f/minidom.py |
|
childNodeTypes = () | def writexml(self, writer): writer.write("<!--%s-->" % self.data) | 5de284e56e3608700c2fb402aa85e392a6d2fa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5de284e56e3608700c2fb402aa85e392a6d2fa6f/minidom.py |
|
childNodeTypes = () | def writexml(self, writer): writer.write("<?%s %s?>" % (self.target, self.data)) | 5de284e56e3608700c2fb402aa85e392a6d2fa6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5de284e56e3608700c2fb402aa85e392a6d2fa6f/minidom.py |
|
magic = unpack('<i', buf[:4])[0] | magic = unpack('<i', buf[:4])[0] & MASK | def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < len(buf) and tend < len(buf): tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8 | e7680dc2d35b27df2d3b024c61357b06f19ba8f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7680dc2d35b27df2d3b024c61357b06f19ba8f6/gettext.py |
msgcount &= MASK masteridx &= MASK transidx &= MASK | def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < len(buf) and tend < len(buf): tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8 | e7680dc2d35b27df2d3b024c61357b06f19ba8f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7680dc2d35b27df2d3b024c61357b06f19ba8f6/gettext.py |
|
mend = moff + mlen | moff &= MASK mend = moff + (mlen & MASK) | def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < len(buf) and tend < len(buf): tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8 | e7680dc2d35b27df2d3b024c61357b06f19ba8f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7680dc2d35b27df2d3b024c61357b06f19ba8f6/gettext.py |
tend = toff + tlen if mend < len(buf) and tend < len(buf): | toff &= MASK tend = toff + (tlen & MASK) if mend < buflen and tend < buflen: | def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < len(buf) and tend < len(buf): tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8 | e7680dc2d35b27df2d3b024c61357b06f19ba8f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e7680dc2d35b27df2d3b024c61357b06f19ba8f6/gettext.py |
if ((localName == "*" or node.tagName == localName) and | if ((localName == "*" or node.localName == localName) and | def _getElementsByTagNameNSHelper(parent, nsURI, localName, rc): for node in parent.childNodes: if node.nodeType == Node.ELEMENT_NODE: if ((localName == "*" or node.tagName == localName) and (nsURI == "*" or node.namespaceURI == nsURI)): rc.append(node) _getElementsByTagNameNSHelper(node, nsURI, localName, rc) return rc | 41933385cff17fe80313d77a9b4c22d0b730ce87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41933385cff17fe80313d77a9b4c22d0b730ce87/minidom.py |
_getElementsByTagNameNSHelper(self, namespaceURI, localName, []) | rc = [] _getElementsByTagNameNSHelper(self, namespaceURI, localName, rc) return rc | def getElementsByTagNameNS(self, namespaceURI, localName): _getElementsByTagNameNSHelper(self, namespaceURI, localName, []) | 41933385cff17fe80313d77a9b4c22d0b730ce87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41933385cff17fe80313d77a9b4c22d0b730ce87/minidom.py |
_getElementsByTagNameNSHelper(self, namespaceURI, localName) | rc = [] _getElementsByTagNameNSHelper(self, namespaceURI, localName, rc) return rc | def getElementsByTagNameNS(self, namespaceURI, localName): _getElementsByTagNameNSHelper(self, namespaceURI, localName) | 41933385cff17fe80313d77a9b4c22d0b730ce87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41933385cff17fe80313d77a9b4c22d0b730ce87/minidom.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.