rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
for ordinal in (-100, 0x20000):
for ordinal in (-100, 0x200000):
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
5c00accab67dddc3b5dbcc9aae46249243be78c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c00accab67dddc3b5dbcc9aae46249243be78c9/test_unicode.py
print '*** formatting u"%%c" % %i should give a ValueError' % ordinal
print '*** formatting u"%%c" %% %i should give a ValueError' % ordinal
def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc01' test_lecmp(s, s2) s2 = u'\udb00\udc01' test_lecmp(s, s2) s2 = u'\ud800\udd01' test_lecmp(s, s2) s2 = u'\ud900\udd01' test_lecmp(s, s2) s2 = u'\uda00\udd01' test_lecmp(s, s2) s2 = u'\udb00\udd01' test_le...
5c00accab67dddc3b5dbcc9aae46249243be78c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5c00accab67dddc3b5dbcc9aae46249243be78c9/test_unicode.py
MethodNumber(1), CoerceNumber(2)]
MethodNumber(2), CoerceNumber(2)]
def __cmp__(self, other): return cmp(self.arg, other)
041a76e9d913b0c39e85c717f1acaf6dd21d2f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/041a76e9d913b0c39e85c717f1acaf6dd21d2f5a/test_coercion.py
print '=', x
print '=', format_result(x)
def do_infix_binops(): for a in candidates: for b in candidates: for op in infix_binops: print '%s %s %s' % (a, op, b), try: x = eval('a %s b' % op) except: error = sys.exc_info()[:2] print '... %s' % error[0] else: print '=', x try: z = copy.copy(a) except copy.Error: z = a # assume it has no inplace ops print '%s %s=...
041a76e9d913b0c39e85c717f1acaf6dd21d2f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/041a76e9d913b0c39e85c717f1acaf6dd21d2f5a/test_coercion.py
print '=>', z
print '=>', format_result(z)
def do_infix_binops(): for a in candidates: for b in candidates: for op in infix_binops: print '%s %s %s' % (a, op, b), try: x = eval('a %s b' % op) except: error = sys.exc_info()[:2] print '... %s' % error[0] else: print '=', x try: z = copy.copy(a) except copy.Error: z = a # assume it has no inplace ops print '%s %s=...
041a76e9d913b0c39e85c717f1acaf6dd21d2f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/041a76e9d913b0c39e85c717f1acaf6dd21d2f5a/test_coercion.py
print '=', x
print '=', format_result(x)
def do_prefix_binops(): for a in candidates: for b in candidates: for op in prefix_binops: print '%s(%s, %s)' % (op, a, b), try: x = eval('%s(a, b)' % op) except: error = sys.exc_info()[:2] print '... %s' % error[0] else: print '=', x
041a76e9d913b0c39e85c717f1acaf6dd21d2f5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/041a76e9d913b0c39e85c717f1acaf6dd21d2f5a/test_coercion.py
if sys.platform == 'mac': _MWERKSDIR="Moes:Applications (Mac OS 9):Metrowerks CodeWarrior 7.0:Metrowerks CodeWarrior" else: _MWERKSDIR="/Volumes/Moes/Applications (Mac OS 9)/Metrowerks CodeWarrior 7.0/Metrowerks CodeWarrior/" INCLUDEDIR=os.path.join(_MWERKSDIR, "MacOS Support", "Universal", "Interfaces", "CIncludes")
INCLUDEDIR="/Users/jack/src/Universal/Interfaces/CIncludes"
def _pardir(p): return os.path.split(p)[0]
89dc0a2f94122533dc76aad7538109c84660f626 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89dc0a2f94122533dc76aad7538109c84660f626/bgenlocations.py
if sys.platform == 'mac': TOOLBOXDIR=os.path.join(sys.prefix, "Lib", "plat-mac", "Carbon") else: TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
TOOLBOXDIR="/Users/jack/src/python/Lib/plat-mac/Carbon"
def _pardir(p): return os.path.split(p)[0]
89dc0a2f94122533dc76aad7538109c84660f626 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/89dc0a2f94122533dc76aad7538109c84660f626/bgenlocations.py
res = [] for c in s: if c in safe: res.append(c) else: res.append('%%%02x' % ord(c))
res = list(s) for i in range(len(res)): c = res[i] if c not in safe: res[i] = '%%%02x' % ord(c)
def quote(s, safe = '/'): safe = always_safe + safe res = [] for c in s: if c in safe: res.append(c) else: res.append('%%%02x' % ord(c)) return string.joinfields(res, '')
4cb7b775aa34690d84c299f2f1bd1311ab643b64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cb7b775aa34690d84c299f2f1bd1311ab643b64/urllib.py
s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+')
l = string.split(s, ' ') for i in range(len(l)): l[i] = quote(l[i], safe) return string.join(l, '+')
def quote_plus(s, safe = '/'): if ' ' in s: # replace ' ' with '+' s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe)
4cb7b775aa34690d84c299f2f1bd1311ab643b64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cb7b775aa34690d84c299f2f1bd1311ab643b64/urllib.py
dict = {}
def readmodule(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package ...
4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py
dict = {'__path__': [file]}
dict['__path__'] = [file]
def readmodule(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package ...
4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py
return dict
path = [file] + path f, file, (suff, mode, type) = \ imp.find_module('__init__', [file])
def readmodule(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package ...
4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py
dict = {}
def readmodule(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package ...
4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py
dict = {}
def readmodule(module, path=[], inpackage=0): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module.''' i = string.rfind(module, '.') if i >= 0: # Dotted module name package ...
4d5c0343252aa15051a12da5ee8efeac3f3ea387 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4d5c0343252aa15051a12da5ee8efeac3f3ea387/pyclbr.py
print repr(p)
def test_pickling(self): p = pickle.dumps(self.set) print repr(p) copy = pickle.loads(p) repr(copy) self.assertEqual(self.set, copy, "%s != %s" % (self.set, copy))
433e729bb288235779f1fa315fc0aa3fb748726b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/433e729bb288235779f1fa315fc0aa3fb748726b/test_sets.py
repr(copy)
def test_pickling(self): p = pickle.dumps(self.set) print repr(p) copy = pickle.loads(p) repr(copy) self.assertEqual(self.set, copy, "%s != %s" % (self.set, copy))
433e729bb288235779f1fa315fc0aa3fb748726b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/433e729bb288235779f1fa315fc0aa3fb748726b/test_sets.py
ZGUuDQ0KJAAAAAAAAADqs5WMrtL7367S+9+u0vvf1c7336/S+98tzvXfrNL731Hy/9+s0vvfzM3o 36bS+9+u0vrf89L7367S+9+j0vvfUfLx36PS+99p1P3fr9L731JpY2iu0vvfAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAUEUAAEwBAwD9e9Q5AAAAAAAAAADgAA8BCwEGAABAAAAAEAAAAJAAAADVAAAA
ZGUuDQ0KJAAAAAAAAABwj7aMNO7Y3zTu2N807tjfT/LU3zXu2N+38tbfNu7Y39zx3N827tjfVvHL 3zzu2N807tnfae7Y3zTu2N857tjf3PHS3znu2N+M6N7fNe7Y31JpY2g07tjfAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAUEUAAEwBAwAu6+E5AAAAAAAAAADgAA8BCwEGAABAAAAAEAAAAJAAAPDUAAAA
def get_exe_bytes (self): import base64 return base64.decodestring(EXEDATA)
beac8e54f6a27c63ca7981adb8482c4465b6e6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/beac8e54f6a27c63ca7981adb8482c4465b6e6b4/bdist_wininst.py
bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCmbxMY8TFMU40bYAAPM0AAAAsAAAJgEABP+/
bGwgUmlnaHRzIFJlc2VydmVkLiAkCgBVUFghDAkCCl/uS+s25ddS0bYAAO40AAAAsAAAJgEAkP+/
def get_exe_bytes (self): import base64 return base64.decodestring(EXEDATA)
beac8e54f6a27c63ca7981adb8482c4465b6e6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/beac8e54f6a27c63ca7981adb8482c4465b6e6b4/bdist_wininst.py
dZNqAVhfXr/7//9dW8NVi+yD7BCLRRRTVleLQBaLPXg0iUX4M/a79u7+d0PAOXUIdQfHRQgBDFZo gFYRY9/+9lZWUwUM/9eD+P8p/A+FiG182s23P/gDdRshGP91EOgV/wD2bffmcagPhApB67EfUHQJ UJn9sW176y9cGBjxUwxqAv9VGIW12bLxwC5nEGbW8GTsdSUuwmhUMOlTt/ue7wH0OwdZDvwkdAoT vb37yAONRfBQ3GaLSAoDQAxRYdj70Ht0Sn38GQNQ4XVvpqQ7+HUJC4idhy+U7psOVmoEVhCghIs9 iN/X4CKQhg9o...
dZNqAVhfXu/u/v9dW8NVi+yD7AxTVleLPXguM/a7OsA5dQjt7d39dQfHRQgBDFZogE0RVlZTBfsz 9v8M/9eD+P+JRfwPhYhkfPgDdRshb67dfCD/dRDoHv8AaJ8PhAO2Z992QeuxH1B0CVCQ6y9cIC3b H9sY6lMMagL/VSDowC7GXlibZxBmdSUuu/luDU9oVCfpUwHkOwePfLvvWQ7sJHQKEwONRfT3Wdhu bnUcAhg6dH38Et5Mw7ADQKQ0FHUJ3TfD6wuIlncOVmoEVhCgwUVoMBCIdIl2rW2+rw9hOII86yal K9u2NdsCUyqc...
def get_exe_bytes (self): import base64 return base64.decodestring(EXEDATA)
beac8e54f6a27c63ca7981adb8482c4465b6e6b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/beac8e54f6a27c63ca7981adb8482c4465b6e6b4/bdist_wininst.py
(pid, status) = os.waitpid(pid, 0)
try: (pid, status) = os.waitpid(pid, 0) except OSError, exc: import errno if exc.errno == errno.EINTR: continue raise DistutilsExecError, \ "command '%s' failed: %s" % (cmd[0], exc[-1])
def _spawn_posix (cmd, search_path=1, verbose=0, dry_run=0): log.info(string.join(cmd, ' ')) if dry_run: return exec_fn = search_path and os.execvp or os.execv pid = os.fork() if pid == 0: # in the child try: #print "cmd[0] =", cmd[0] #print "cmd =", cmd exec_fn(cmd[0], cmd) except OSError, e:...
23fe5701f8f465620c4d441f5047093cb27d0ec3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/23fe5701f8f465620c4d441f5047093cb27d0ec3/spawn.py
while 1:
while True:
def _do_cmp(f1, f2): bufsize = BUFSIZE fp1 = open(f1, 'rb') fp2 = open(f2, 'rb') while 1: b1 = fp1.read(bufsize) b2 = fp2.read(bufsize) if b1 != b2: return 0 if not b1: return 1
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
return 0
return False
def _do_cmp(f1, f2): bufsize = BUFSIZE fp1 = open(f1, 'rb') fp2 = open(f2, 'rb') while 1: b1 = fp1.read(bufsize) b2 = fp2.read(bufsize) if b1 != b2: return 0 if not b1: return 1
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
return 1
return True
def _do_cmp(f1, f2): bufsize = BUFSIZE fp1 = open(f1, 'rb') fp2 = open(f2, 'rb') while 1: b1 = fp1.read(bufsize) b2 = fp2.read(bufsize) if b1 != b2: return 0 if not b1: return 1
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
__p4_attrs = ('subdirs',) __p3_attrs = ('same_files', 'diff_files', 'funny_files') __p2_attrs = ('common_dirs', 'common_files', 'common_funny') __p1_attrs = ('common', 'left_only', 'right_only') __p0_attrs = ('left_list', 'right_list') def __getattr__(self, attr): if attr in self.__p4_attrs: self.phase4() elif attr in...
def phase0(self): # Compare everything except common subdirectories self.left_list = _filter(os.listdir(self.left), self.hide+self.ignore) self.right_list = _filter(os.listdir(self.right), self.hide+self.ignore) self.left_list.sort() self.right_list.sort()
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
a_only, b_only = [], [] common = {} b = {} for fnm in self.right_list: b[fnm] = 1 for x in self.left_list: if b.get(x, 0): common[x] = 1 else: a_only.append(x) for x in self.right_list: if common.get(x, 0): pass else: b_only.append(x)
b = dict.fromkeys(self.right_list) common = dict.fromkeys(ifilter(b.has_key, self.left_list)) self.left_only = list(ifilterfalse(common.has_key, self.left_list)) self.right_only = list(ifilterfalse(common.has_key, self.right_list))
def phase1(self): # Compute common names a_only, b_only = [], [] common = {} b = {} for fnm in self.right_list: b[fnm] = 1 for x in self.left_list: if b.get(x, 0): common[x] = 1 else: a_only.append(x) for x in self.right_list: if common.get(x, 0): pass else: b_only.append(x) self.common = common.keys() self.left_only =...
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
self.left_only = a_only self.right_only = b_only
def phase1(self): # Compute common names a_only, b_only = [], [] common = {} b = {} for fnm in self.right_list: b[fnm] = 1 for x in self.left_list: if b.get(x, 0): common[x] = 1 else: a_only.append(x) for x in self.right_list: if common.get(x, 0): pass else: b_only.append(x) self.common = common.keys() self.left_only =...
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
def _cmp(a, b, sh):
def _cmp(a, b, sh, abs=abs, cmp=cmp):
def _cmp(a, b, sh): try: return not abs(cmp(a, b, sh)) except os.error: return 2
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
def _filter(list, skip): result = [] for item in list: if item not in skip: result.append(item) return result
def _filter(flist, skip): return list(ifilterfalse(skip.__contains__, flist))
def _filter(list, skip): result = [] for item in list: if item not in skip: result.append(item) return result
96a007422f48d730fd5c8fff2baba32db87faf76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96a007422f48d730fd5c8fff2baba32db87faf76/filecmp.py
self.wfile.flush()
if not self.wfile.closed: self.wfile.flush()
def finish(self): self.wfile.flush() self.wfile.close() self.rfile.close()
16d38f3364e5a5c420db017e50296b15434aecdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16d38f3364e5a5c420db017e50296b15434aecdb/SocketServer.py
13 0 LOAD_FAST 0 (a)
%-4d 0 LOAD_FAST 0 (a)
def _f(a): print a return 1
b9e429acf8a31d0428bd3b559a4b55b8580c6b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b9e429acf8a31d0428bd3b559a4b55b8580c6b81/test_dis.py
14 5 LOAD_CONST 1 (1)
%-4d 5 LOAD_CONST 1 (1)
def _f(a): print a return 1
b9e429acf8a31d0428bd3b559a4b55b8580c6b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b9e429acf8a31d0428bd3b559a4b55b8580c6b81/test_dis.py
"""
"""%(_f.func_code.co_firstlineno + 1, _f.func_code.co_firstlineno + 2) def bug708901(): for res in range(1, 10): pass dis_bug708901 = """\ %-4d 0 SETUP_LOOP 23 (to 26) 3 LOAD_GLOBAL 0 (range) 6 LOAD_CONST 1 (1) %-4d 9 LOAD_CONST 2 (10) 12 CALL_FU...
def _f(a): print a return 1
b9e429acf8a31d0428bd3b559a4b55b8580c6b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b9e429acf8a31d0428bd3b559a4b55b8580c6b81/test_dis.py
s = StringIO.StringIO() save_stdout = sys.stdout sys.stdout = s dis.dis(_f) sys.stdout = save_stdout got = s.getvalue() lines = got.split('\n') lines = [line.rstrip() for line in lines] got = '\n'.join(lines) self.assertEqual(dis_f, got)
self.do_disassembly_test(_f, dis_f) def test_bug_708901(self): self.do_disassembly_test(bug708901, dis_bug708901)
def test_dis(self): s = StringIO.StringIO() save_stdout = sys.stdout sys.stdout = s dis.dis(_f) sys.stdout = save_stdout got = s.getvalue() # Trim trailing blanks (if any). lines = got.split('\n') lines = [line.rstrip() for line in lines] got = '\n'.join(lines) self.assertEqual(dis_f, got)
b9e429acf8a31d0428bd3b559a4b55b8580c6b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b9e429acf8a31d0428bd3b559a4b55b8580c6b81/test_dis.py
self.__super_init(fp, hdrs, url)
def __init__(self, url, code, msg, hdrs, fp): self.__super_init(fp, hdrs, url) self.code = code self.msg = msg self.hdrs = hdrs self.fp = fp # XXX self.filename = url
7bce431fc9155d2f018f7e3cf57b9900e2813ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bce431fc9155d2f018f7e3cf57b9900e2813ebb/urllib2.py
def __init__(self, url, code, msg, hdrs, fp): self.__super_init(fp, hdrs, url) self.code = code self.msg = msg self.hdrs = hdrs self.fp = fp # XXX self.filename = url
7bce431fc9155d2f018f7e3cf57b9900e2813ebb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bce431fc9155d2f018f7e3cf57b9900e2813ebb/urllib2.py
timeaware = timetz(now.hour, now.minute, now.second, now.microsecond, tzinfo=tz55)
timeaware = now.timetz().replace(tzinfo=tz55)
def test_tz_aware_arithmetic(self): import random
1410f22e181c04b0c2bf26fede019523e36a5459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1410f22e181c04b0c2bf26fede019523e36a5459/test_datetime.py
nowawareplus = self.theclass.combine(nowawareplus.date(), timetz(nowawareplus.hour, nowawareplus.minute, nowawareplus.second, nowawareplus.microsecond, tzinfo=tzr))
nowawareplus = nowawareplus.replace(tzinfo=tzr)
def test_tz_aware_arithmetic(self): import random
1410f22e181c04b0c2bf26fede019523e36a5459 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1410f22e181c04b0c2bf26fede019523e36a5459/test_datetime.py
def append(self, s, charset=None): """Append a string to the MIME header.
9aa15830c534956ca524997d4fc911a124eb07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9aa15830c534956ca524997d4fc911a124eb07e6/Header.py
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings. Given a list of pairs (string, charset), return a MIME-encoded string suitable for use in a header field. Each pair may have different charsets and/or encodings, and the resulting header will accurately reflect each setti...
def _encode_chunks(self, newchunks):
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings.
9aa15830c534956ca524997d4fc911a124eb07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9aa15830c534956ca524997d4fc911a124eb07e6/Header.py
for header, charset in self._chunks:
for header, charset in newchunks:
def _encode_chunks(self): """MIME-encode a header with many different charsets and/or encodings.
9aa15830c534956ca524997d4fc911a124eb07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9aa15830c534956ca524997d4fc911a124eb07e6/Header.py
self._chunks = newchunks return self._encode_chunks()
return self._encode_chunks(newchunks)
def encode(self): """Encode a message header into an RFC-compliant format.
9aa15830c534956ca524997d4fc911a124eb07e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9aa15830c534956ca524997d4fc911a124eb07e6/Header.py
if str[0] == '"' and str[-1:] == '"': return str[1:-1] if str[0] == '<' and str[-1:] == '>':
if str.startswith('"') and str.endswith('"'): return str[1:-1].replace('\\\\', '\\').replace('\\"', '"') if str.startswith('<') and str.endswith('>'):
def unquote(str): """Remove quotes from a string.""" if len(str) > 1: if str[0] == '"' and str[-1:] == '"': return str[1:-1] if str[0] == '<' and str[-1:] == '>': return str[1:-1] return str
ddf44e4ecda570aec9a96e5464795f02b30304c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ddf44e4ecda570aec9a96e5464795f02b30304c1/rfc822.py
self.assertEqual(len(Set(map(id, list(self.seq)))), len(self.seq))
self.assertEqual(len(Set(map(id, list(enumerate(self.seq))))), len(self.seq))
def test_tuple_reuse(self): # Tests an implementation detail where tuple is reused # whenever nothing else holds a reference to it self.assertEqual(len(Set(map(id, list(self.seq)))), len(self.seq)) self.assertEqual(len(Set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))
8723b24ee23dd443ab2284b7cda36eb089d35ba3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8723b24ee23dd443ab2284b7cda36eb089d35ba3/test_enumerate.py
<body bgcolor=" <body bgcolor="
<body bgcolor=" <body bgcolor="
def reset(): """Return a string that resets the CGI and browser to a known state.""" return '''<!--: spam
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc
__UNDEF__ = [] def small(text): return '<small>' + text + '</small>' def strong(text): return '<strong>' + text + '</strong>' def grey(text): return '<font color=" def lookup(name, frame, locals): """Find the value for a given name in the given environment.""" if name in locals: return 'local', locals[name] if name in...
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable da...
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
head = '<body bgcolor="
head = '<body bgcolor="
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable da...
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
' <p>A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, with the most recent (innermost) call last.''' indent = '<tt><small>' + '&nbsp;' * 5 + '</small>&nbsp;</tt>'
' <p>A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.''' indent = '<tt>' + small('&nbsp;' * 5) + '&nbsp;</tt>'
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable da...
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
link = '<a href="file:%s">%s</a>' % (file, pydoc.html.escape(file))
link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file))
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable da...
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
if func == '?': call = '' else: def eqrepr(value): return '=' + pydoc.html.repr(value) call = 'in <strong>%s</strong>' % func + inspect.formatargvalues( args, varargs, varkw, locals, formatvalue=eqrepr) names = [] def tokeneater(type, token, start, end, line): if type == tokenize.NAME and token not in keyword.kwlist: ...
call = '' if func != '?': call = 'in ' + strong(func) + \ inspect.formatargvalues(args, varargs, varkw, locals, formatvalue=lambda value: '=' + pydoc.html.repr(value)) highlight = {} def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1 vars = scanvars(reade...
def html(etype, evalue, etb, context=5): """Return a nice HTML document describing the traceback.""" import sys, os, types, time, traceback import keyword, tokenize, linecache, inspect, pydoc if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable da...
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
num = '<small><font color=" '&nbsp;' * (5-len(str(i))) + str(i)) line = '<tt>%s&nbsp;%s</tt>' % (num, pydoc.html.preformat(line)) if i == lnum: line = ''' <table width="100%%" bgcolor=" <tr><td>%s</td></tr></table>\n''' % line excerpt.append('\n' + line) if i == lnum: excerpt.append(lvals) i = i + 1 frames.append('<p>'...
num = small('&nbsp;' * (5-len(str(i))) + str(i)) + '&nbsp;' line = '<tt>%s%s</tt>' % (num, pydoc.html.preformat(line)) if i in highlight: rows.append('<tr><td bgcolor=" else: rows.append('<tr><td>%s</td></tr>' % grey(line)) i += 1 done, dump = {}, [] for name, where, value in vars: if name in done: continue done[name]...
def linereader(lnum=[lnum]): line = linecache.getline(file, lnum[0]) lnum[0] += 1 return line
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
plaintrace = ''.join(traceback.format_exception(etype, evalue, etb))
def linereader(lnum=[lnum]): line = linecache.getline(file, lnum[0]) lnum[0] += 1 return line
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
<!-- The above is a description of an error that occurred in a Python program. It is formatted for display in a Web browser because it appears that we are running in a CGI environment. In case you are viewing this message outside of a Web browser, here is the original error traceback:
<!-- The above is a description of an error in a Python program, formatted for a Web browser because the 'cgitb' module was enabled. In case you are not reading this in a Web browser, here is the original traceback:
def linereader(lnum=[lnum]): line = linecache.getline(file, lnum[0]) lnum[0] += 1 return line
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
''' % plaintrace
''' % ''.join(traceback.format_exception(etype, evalue, etb))
def linereader(lnum=[lnum]): line = linecache.getline(file, lnum[0]) lnum[0] += 1 return line
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
def __init__(self, display=1, logdir=None):
"""A hook to replace sys.excepthook that shows tracebacks in HTML.""" def __init__(self, display=1, logdir=None, context=5):
def __init__(self, display=1, logdir=None): self.display = display # send tracebacks to browser if true self.logdir = logdir # log tracebacks to files if not None
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
"""This hook can replace sys.excepthook (for Python 2.1 or higher)."""
def __call__(self, etype, evalue, etb): """This hook can replace sys.excepthook (for Python 2.1 or higher).""" self.handle((etype, evalue, etb))
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
import sys, os
import sys
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
text = 0
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
doc = html(*info)
text, doc = 0, html(info, self.context)
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
doc = ''.join(traceback.format_exception(*info)) text = 1
text, doc = 1, ''.join(traceback.format_exception(*info))
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
print '<pre>', doc, '</pre>'
print '<pre>' + doc + '</pre>'
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
import tempfile
import os, tempfile
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
print '<p>%s contains the description of this error.' % path
print '<p> %s contains the description of this error.' % path
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
print '<p>Tried to write to %s, but failed.' % path
print '<p> Tried to save traceback to %s, but failed.' % path
def handle(self, info=None): import sys, os info = info or sys.exc_info() text = 0 print reset()
09029ec15c2b61a0aa506286a6bb485f468ac920 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/09029ec15c2b61a0aa506286a6bb485f468ac920/cgitb.py
print '<dd>', escape(form[key])
print '<dd>', escape(`form[key]`)
def print_form( form ): skeys = form.keys() skeys.sort() print '<h3> The following name/value pairs ' \ 'were entered in the form: </h3>' print '<dl>' for key in skeys: print '<dt>', escape(key), ':', print '<i>', escape(`type(form[key])`), '</i>', print '<dd>', escape(form[key]) print '</dl>'
a305fa93eb6111240afbb81d33844c0b86caea9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a305fa93eb6111240afbb81d33844c0b86caea9c/cgi.py
s = regsub.gsub('&', '&amp;') s = regsub.gsub('<', '&lt;') s = regsub.gsub('>', '&gt;')
s = regsub.gsub('&', '&amp;', s) s = regsub.gsub('<', '&lt;', s) s = regsub.gsub('>', '&gt;', s)
def escape( s ): s = regsub.gsub('&', '&amp;') # Must be done first s = regsub.gsub('<', '&lt;') s = regsub.gsub('>', '&gt;') return s
a305fa93eb6111240afbb81d33844c0b86caea9c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a305fa93eb6111240afbb81d33844c0b86caea9c/cgi.py
class SMTPRecipientsRefused(SMTPResponseException):
class SMTPRecipientsRefused(SMTPException):
def __init__(self, code, msg, sender): self.smtp_code = code self.smtp_error = msg self.sender = sender self.args = (code, msg, sender)
8be27436b64d89208615d8247595b90b3382acde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8be27436b64d89208615d8247595b90b3382acde/smtplib.py
self.send(quotedata(msg)) self.send("%s.%s" % (CRLF, CRLF))
q = quotedata(msg) if q[-2:] != CRLF: q = q + CRLF q = q + "." + CRLF self.send(q)
def data(self,msg): """SMTP 'DATA' command -- sends message data to server.
8be27436b64d89208615d8247595b90b3382acde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8be27436b64d89208615d8247595b90b3382acde/smtplib.py
def readline(self):
def readline(self, length=None):
def readline(self): if self.buflist: self.buf = self.buf + string.joinfields(self.buflist, '') self.buflist = [] i = string.find(self.buf, '\n', self.pos) if i < 0: newpos = self.len else: newpos = i+1 r = self.buf[self.pos:newpos] self.pos = newpos return r
5cfcf89c3b5efee34f2fda9feff2239f74d42b99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5cfcf89c3b5efee34f2fda9feff2239f74d42b99/StringIO.py
src = sys.modules[key]
src = sys.modules[name]
def load_dynamic(self, name, filename, file):
49ef06ddd22c3a079ce2639f7cd561fe34a8fa74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/49ef06ddd22c3a079ce2639f7cd561fe34a8fa74/rexec.py
print exc_type_name + ':', repr.repr(exc_value)
print exc_type_name + ':', _saferepr(exc_value)
def user_exception(self, frame, (exc_type, exc_value, exc_traceback)): """This function is called if an exception occurs, but only if we are to stop at or just below this level.""" frame.f_locals['__exception__'] = exc_type, exc_value if type(exc_type) == type(''): exc_type_name = exc_type else: exc_type_name = exc_typ...
079e2af125f039348ee3de5ef1ef3ae184573ac9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/079e2af125f039348ee3de5ef1ef3ae184573ac9/pdb.py
zinfo.external_attr = st[0] << 16L
zinfo.external_attr = (st[0] & 0xFFFF) << 16L
def write(self, filename, arcname=None, compress_type=None): """Put the bytes from filename into the archive under the name arcname.""" st = os.stat(filename) mtime = time.localtime(st.st_mtime) date_time = mtime[0:6] # Create ZipInfo instance to store file information if arcname is None: zinfo = ZipInfo(filename, date...
41e7536e49eaa7fb55bc383c27814bf7bc39e53c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41e7536e49eaa7fb55bc383c27814bf7bc39e53c/zipfile.py
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 2)
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 3)
>>> def f():
bf39f862ae932b4c89c2b39409add25af9507824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf39f862ae932b4c89c2b39409add25af9507824/test_generators.py
... yield 2
... yield 2
... def f(i):
bf39f862ae932b4c89c2b39409add25af9507824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf39f862ae932b4c89c2b39409add25af9507824/test_generators.py
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[24]>, line 8)
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[24]>, line 10)
... def f(i):
bf39f862ae932b4c89c2b39409add25af9507824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf39f862ae932b4c89c2b39409add25af9507824/test_generators.py
/.
/\.
def test_getstatus(self): # This pattern should match 'ls -ld /.' on any posix # system, however perversely configured. pat = r'''d......... # It is a directory. \s+\d+ # It has some number of links. \s+\w+\s+\w+ # It has a user and group, which may # be named anything. \s+\d+ # It has a size. [^/]* ...
54456ab48bd359be719938136a4e22a596429fcb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/54456ab48bd359be719938136a4e22a596429fcb/test_commands.py
hdrfields = string.split(hdr)
hdrfields = hdr.split(" ", 2)
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr...
b20979b323009a8f903855010469151d47be2eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b20979b323009a8f903855010469151d47be2eaa/uu.py
string.atoi(hdrfields[1], 8)
int(hdrfields[1], 8)
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr...
b20979b323009a8f903855010469151d47be2eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b20979b323009a8f903855010469151d47be2eaa/uu.py
out_file = hdrfields[2]
out_file = hdrfields[2].rstrip()
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr...
b20979b323009a8f903855010469151d47be2eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b20979b323009a8f903855010469151d47be2eaa/uu.py
mode = string.atoi(hdrfields[1], 8)
mode = int(hdrfields[1], 8)
def decode(in_file, out_file=None, mode=None): """Decode uuencoded file""" # # Open the input file, if needed. # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): in_file = open(in_file) # # Read until a begin is encountered or we've exhausted the file # while 1: hdr = in_file.readline() if not hdr...
b20979b323009a8f903855010469151d47be2eaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b20979b323009a8f903855010469151d47be2eaa/uu.py
print "Distribution.parse_config_files():"
if DEBUG: print "Distribution.parse_config_files():"
def parse_config_files (self, filenames=None):
6f70fdef014f1bda41dd34d1f0df3e698606f2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f70fdef014f1bda41dd34d1f0df3e698606f2ed/dist.py
print " reading", filename
if DEBUG: print " reading", filename
def parse_config_files (self, filenames=None):
6f70fdef014f1bda41dd34d1f0df3e698606f2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f70fdef014f1bda41dd34d1f0df3e698606f2ed/dist.py
print "showing 'global' help; commands=", self.commands
def parse_command_line (self, args): """Parse the setup script's command line. 'args' must be a list of command-line arguments, most likely 'sys.argv[1:]' (see the 'setup()' function). This list is first processed for "global options" -- options that set attributes of the Distribution instance. Then, it is alternate...
6f70fdef014f1bda41dd34d1f0df3e698606f2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f70fdef014f1bda41dd34d1f0df3e698606f2ed/dist.py
print "showing help for command", cmd_class
def _parse_command_opts (self, parser, args): """Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options we are about to parse). Returns a new version of 'args' with the next command at the fron...
6f70fdef014f1bda41dd34d1f0df3e698606f2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f70fdef014f1bda41dd34d1f0df3e698606f2ed/dist.py
print "Distribution.get_command_obj(): " \ "creating '%s' command object" % command
if DEBUG: print "Distribution.get_command_obj(): " \ "creating '%s' command object" % command
def get_command_obj (self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no comand object for 'command' is in the cache, then we either create and return it (if 'create' is true) or return None. """ cmd_obj = self.command_ob...
6f70fdef014f1bda41dd34d1f0df3e698606f2ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6f70fdef014f1bda41dd34d1f0df3e698606f2ed/dist.py
('two', '(compound, (argument, list))',))
('two', '(compound, (argument, list))', 'compound', 'argument', 'list',))
def f5((compound, first), two): pass
7e7308c781db2f4cdc3a86341c51425001bfcabe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7e7308c781db2f4cdc3a86341c51425001bfcabe/test_grammar.py
def storbinary(self, cmd, fp, blocksize):
def storbinary(self, cmd, fp, blocksize=8192):
def storbinary(self, cmd, fp, blocksize): '''Store a file in binary mode.''' self.voidcmd('TYPE I') conn = self.transfercmd(cmd) while 1: buf = fp.read(blocksize) if not buf: break conn.send(buf) conn.close() return self.voidresp()
4ccd2bd92c14e92f94eb2aa9d7f1538277d0cc9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4ccd2bd92c14e92f94eb2aa9d7f1538277d0cc9d/ftplib.py
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__ Resolves a dotted attribute name to an object. Raises an AttributeError if any attribute in the chain starts with a '_'. """ for i in attr.split('.'): if i.startswith('_'): raise AttributeError( 'attempt to ac...
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde/SimpleXMLRPCServer.py
return apply( getattr(self.server.instance,'_dispatch'), (method, params) )
return self.server.instance._dispatch(method, params)
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde/SimpleXMLRPCServer.py
func = resolve_dotted_attribute(
func = _resolve_dotted_attribute(
def resolve_dotted_attribute(obj, attr): """resolve_dotted_attribute(math, 'cos.__doc__') => math.cos.__doc__
e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e8a79ac23ac8c33b80724f8b8ec21e9cbb2f0bde/SimpleXMLRPCServer.py
assert self.type is not None, self.__original
if self.type is None: raise ValueError, "unknown url type: %s" % self.__original
def get_type(self): if self.type is None: self.type, self.__r_type = splittype(self.__original) assert self.type is not None, self.__original return self.type
3603e4c42b70b53ca3adb397bbd5a4f675612858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3603e4c42b70b53ca3adb397bbd5a4f675612858/urllib2.py
pos = pos + self.chunk_size
pos = pos + self.chunksize
def seek(self, pos, whence = 0): """Seek to specified position into the chunk. Default position is 0 (start of chunk). If the file is not seekable, this will result in an error. """
6848cb06e4b855023b2a6a31be91dd40f37500cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6848cb06e4b855023b2a6a31be91dd40f37500cb/chunk.py
if do_copy: macostools.copy(os.path.join(sys.exec_prefix, src), dst) else: macostools.mkalias(os.path.join(sys.exec_prefix, src), dst)
try: if do_copy: macostools.copy(os.path.join(sys.exec_prefix, src), dst) else: macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) except IOError: return 0
def mkcorealias(src, altsrc): import string import macostools version = string.split(sys.version)[0] dst = getextensiondirfile(src+ ' ' + version) if not dst: return 0 if not os.path.exists(os.path.join(sys.exec_prefix, src)): if not os.path.exists(os.path.join(sys.exec_prefix, altsrc)): return 0 src = altsrc try: os.u...
dfd727ed197f50c23ce431b673f86b2a5a7ae02e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dfd727ed197f50c23ce431b673f86b2a5a7ae02e/ConfigurePython.py
self.__testMethodName = methodName
self._testMethodName = methodName
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name. """ try: self.__testMethodName = methodName testMethod = getattr(self, methodName) self.__testMethodDoc = te...
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
self.__testMethodDoc = testMethod.__doc__
self._testMethodDoc = testMethod.__doc__
def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name. """ try: self.__testMethodName = methodName testMethod = getattr(self, methodName) self.__testMethodDoc = te...
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
doc = self.__testMethodDoc
doc = self._testMethodDoc
def shortDescription(self): """Returns a one-line description of the test, or None if no description has been provided.
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
return "%s.%s" % (_strclass(self.__class__), self.__testMethodName)
return "%s.%s" % (_strclass(self.__class__), self._testMethodName)
def id(self): return "%s.%s" % (_strclass(self.__class__), self.__testMethodName)
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__))
return "%s (%s)" % (self._testMethodName, _strclass(self.__class__))
def __str__(self): return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__))
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
(_strclass(self.__class__), self.__testMethodName)
(_strclass(self.__class__), self._testMethodName)
def __repr__(self): return "<%s testMethod=%s>" % \ (_strclass(self.__class__), self.__testMethodName)
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py
testMethod = getattr(self, self.__testMethodName)
testMethod = getattr(self, self._testMethodName)
def run(self, result=None): if result is None: result = self.defaultTestResult() result.startTest(self) testMethod = getattr(self, self.__testMethodName) try: try: self.setUp() except KeyboardInterrupt: raise except: result.addError(self, self.__exc_info()) return
b66ad788444c7f79115e9d6749906c4511b216dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b66ad788444c7f79115e9d6749906c4511b216dd/unittest.py