rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
"""Return a 2-tuple containing (new_string, number). new_string is the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made."""
"""subn(repl, string[, count=0]) -> tuple Perform the same operation as sub(), but return a tuple (new_string, number_of_subs_made). """
def subn(self, repl, source, count=0): """Return a 2-tuple containing (new_string, number). new_string is the string obtained by replacing the leftmost non-overlapping occurrences of the pattern in the source string by the replacement repl. number is the number of substitutions that were made.""" if count < 0: raise ...
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"""Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings."""
"""split(source[, maxsplit=0]) -> list of strings Split string by the occurrences of the compiled pattern. If capturing parentheses are used in the pattern, then the text of all groups in the pattern are also returned as part of the resulting list. If maxsplit is nonzero, at most maxsplit splits occur, and the remaind...
def split(self, source, maxsplit=0): """Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings."""
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"""Return a list of all non-overlapping matches in the string. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.
"""findall(source) -> list Return a list of all non-overlapping matches of the compiled pattern in string. If one or more groups are present in the pattern, return a list of groups; this will be a list of tuples if the pattern has more than one group. Empty matches are included in the result.
def findall(self, source): """Return a list of all non-overlapping matches in the string.
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Return the start of the substring matched by group g"
"""start([group=0]) -> int or None Return the index of the start of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return None if group exists but did not contribute to the match. """
def start(self, g = 0): "Return the start of the substring matched by group g" if type(g) == type(''): try: g = self.re.groupindex[g] except (KeyError, TypeError): raise IndexError, 'group %s is undefined' % `g` return self.regs[g][0]
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Return the end of the substring matched by group g"
"""end([group=0]) -> int or None Return the indices of the end of the substring matched by group; group defaults to zero (meaning the whole matched substring). Return None if group exists but did not contribute to the match. """
def end(self, g = 0): "Return the end of the substring matched by group g" if type(g) == type(''): try: g = self.re.groupindex[g] except (KeyError, TypeError): raise IndexError, 'group %s is undefined' % `g` return self.regs[g][1]
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Return (start, end) of the substring matched by group g"
"""span([group=0]) -> tuple Return the 2-tuple (m.start(group), m.end(group)). Note that if group did not contribute to the match, this is (None, None). Group defaults to zero (meaning the whole matched substring). """
def span(self, g = 0): "Return (start, end) of the substring matched by group g" if type(g) == type(''): try: g = self.re.groupindex[g] except (KeyError, TypeError): raise IndexError, 'group %s is undefined' % `g` return self.regs[g]
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Return a tuple containing all subgroups of the match object"
"""groups([default=None]) -> tuple Return a tuple containing all the subgroups of the match, from 1 up to however many groups are in the pattern. The default argument is used for groups that did not participate in the match. """
def groups(self, default=None): "Return a tuple containing all subgroups of the match object" result = [] for g in range(1, self.re._num_regs): a, b = self.regs[g] if a == -1 or b == -1: result.append(default) else: result.append(self.string[a:b]) return tuple(result)
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
"Return one or more groups of the match"
"""group([group1, group2, ...]) -> string or tuple Return one or more subgroups of the match. If there is a single argument, the result is a single string; if there are multiple arguments, the result is a tuple with one item per argument. Without arguments, group1 defaults to zero (i.e. the whole match is returned). I...
def group(self, *groups): "Return one or more groups of the match" if len(groups) == 0: groups = (0,) result = [] for g in groups: if type(g) == type(''): try: g = self.re.groupindex[g] except (KeyError, TypeError): raise IndexError, 'group %s is undefined' % `g` if g >= len(self.regs): raise IndexError, 'group %s is u...
6ebb387a087b1a64437856da4b286694396e663c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6ebb387a087b1a64437856da4b286694396e663c/re.py
self.filename = filename
self.filename = _normpath(filename)
def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)): self.filename = filename # Name of the file in the archive self.date_time = date_time # year, month, day, hour, min, sec # Standard values: self.compress_type = ZIP_STORED # Type of compression for the file self.comment = "" # ...
a58947f60098b07471ad6771b185557081d14a4c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a58947f60098b07471ad6771b185557081d14a4c/zipfile.py
for i in ['_exit']: try: exec "from nt import " + i except ImportError: pass
try: from nt import _exit except ImportError: pass
def _get_exports_list(module): try: return list(module.__all__) except AttributeError: return [n for n in dir(module) if n[0] != '_']
6757c1e8565262cdc234de3370c4747927a72f72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6757c1e8565262cdc234de3370c4747927a72f72/os.py
for i in ['_exit']: try: exec "from ce import " + i except ImportError: pass
try: from ce import _exit except ImportError: pass
def _get_exports_list(module): try: return list(module.__all__) except AttributeError: return [n for n in dir(module) if n[0] != '_']
6757c1e8565262cdc234de3370c4747927a72f72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6757c1e8565262cdc234de3370c4747927a72f72/os.py
except IOError, msg:
except (OSError, IOError), msg:
def addrobot(self, root): root = urlparse.urljoin(root, "/") if self.robots.has_key(root): return url = urlparse.urljoin(root, "/robots.txt") self.robots[root] = rp = robotparser.RobotFileParser() self.note(2, "Parsing %s", url) rp.debug = self.verbose > 3 rp.set_url(url) try: rp.read() except IOError, msg: self.note(1...
f0953b9dff9a0cc08b6dcfe206047c0490e1d38a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0953b9dff9a0cc08b6dcfe206047c0490e1d38a/webchecker.py
except IOError, msg:
except (OSError, IOError), msg:
def openpage(self, url_pair): url, fragment = url_pair try: return self.urlopener.open(url) except IOError, msg: msg = self.sanitize(msg) self.note(0, "Error %s", msg) if self.verbose > 0: self.show(" HREF ", url, " from", self.todo[url_pair]) self.setbad(url_pair, msg) return None
f0953b9dff9a0cc08b6dcfe206047c0490e1d38a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f0953b9dff9a0cc08b6dcfe206047c0490e1d38a/webchecker.py
(sys.platform.startswith('linux') and
((sys.platform.startswith('linux') or sys.platform.startswith('gnu')) and
def finalize_options (self): from distutils import sysconfig
d149d0c76a7fa8c90140342dad3e1c220c63c054 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d149d0c76a7fa8c90140342dad3e1c220c63c054/build_ext.py
self.assertRaises(TypeError, islice, xrange(10))
self.assertEqual(list(islice(xrange(10))), range(10)) self.assertEqual(list(islice(xrange(10), None)), range(10)) self.assertEqual(list(islice(xrange(10), 2, None)), range(2, 10)) self.assertEqual(list(islice(xrange(10), 1, None, 2)), range(1, 10, 2))
def test_islice(self): for args in [ # islice(args) should agree with range(args) (10, 20, 3), (10, 3, 20), (10, 20), (10, 3), (20,) ]: self.assertEqual(list(islice(xrange(100), *args)), range(*args))
14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87/test_itertools.py
import test_itertools
def test_main(verbose=None): import test_itertools suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBasicOps)) test_support.run_suite(suite) test_support.run_doctest(test_itertools, verbose) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [] for i in xr...
14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87/test_itertools.py
test_support.run_doctest(test_itertools, verbose)
def test_main(verbose=None): import test_itertools suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBasicOps)) test_support.run_suite(suite) test_support.run_doctest(test_itertools, verbose) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [] for i in xr...
14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87/test_itertools.py
pass
def __getitem__(self, index): return 2*tuple.__getitem__(self, index)
def test_filter_subclasses(self): # test, that filter() never returns tuple, str or unicode subclasses funcs = (None, lambda x: True) class tuple2(tuple): pass class str2(str): pass inputs = { tuple2: [(), (1,2,3)], str2: ["", "123"] } if have_unicode: class unicode2(unicode): pass inputs[unicode2] = [unicode(), unic...
1918f7755e03900224c5a53cca9fc0088c3186d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1918f7755e03900224c5a53cca9fc0088c3186d3/test_builtin.py
pass
def __getitem__(self, index): return 2*str.__getitem__(self, index)
def test_filter_subclasses(self): # test, that filter() never returns tuple, str or unicode subclasses funcs = (None, lambda x: True) class tuple2(tuple): pass class str2(str): pass inputs = { tuple2: [(), (1,2,3)], str2: ["", "123"] } if have_unicode: class unicode2(unicode): pass inputs[unicode2] = [unicode(), unic...
1918f7755e03900224c5a53cca9fc0088c3186d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1918f7755e03900224c5a53cca9fc0088c3186d3/test_builtin.py
tuple2: [(), (1,2,3)], str2: ["", "123"]
tuple2: {(): (), (1, 2, 3): (1, 2, 3)}, str2: {"": "", "123": "112233"}
def test_filter_subclasses(self): # test, that filter() never returns tuple, str or unicode subclasses funcs = (None, lambda x: True) class tuple2(tuple): pass class str2(str): pass inputs = { tuple2: [(), (1,2,3)], str2: ["", "123"] } if have_unicode: class unicode2(unicode): pass inputs[unicode2] = [unicode(), unic...
1918f7755e03900224c5a53cca9fc0088c3186d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1918f7755e03900224c5a53cca9fc0088c3186d3/test_builtin.py
pass inputs[unicode2] = [unicode(), unicode("123")] for func in funcs: for (cls, inps) in inputs.iteritems(): for inp in inps: out = filter(func, cls(inp)) self.assertEqual(inp, out) self.assert_(not isinstance(out, cls))
def __getitem__(self, index): return 2*unicode.__getitem__(self, index) inputs[unicode2] = { unicode(): unicode(), unicode("123"): unicode("112233") } for (cls, inps) in inputs.iteritems(): for (inp, exp) in inps.iteritems(): self.assertEqual( filter(funcs[0], cls(inp)), filter(funcs[1], cls(inp)) ) for func in func...
def test_filter_subclasses(self): # test, that filter() never returns tuple, str or unicode subclasses funcs = (None, lambda x: True) class tuple2(tuple): pass class str2(str): pass inputs = { tuple2: [(), (1,2,3)], str2: ["", "123"] } if have_unicode: class unicode2(unicode): pass inputs[unicode2] = [unicode(), unic...
1918f7755e03900224c5a53cca9fc0088c3186d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1918f7755e03900224c5a53cca9fc0088c3186d3/test_builtin.py
TypeError: iteration over non-sequence
TypeError: 'int' object is not iterable
>>> def f(n):
ccff78525889fe2fa1a3512c4084a407994f9ce3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ccff78525889fe2fa1a3512c4084a407994f9ce3/test_genexps.py
e.set_lk_detect(db.DB_LOCK_DEFAULT)
def _openDBEnv(cachesize): e = db.DBEnv() if cachesize is not None: if cachesize >= 20480: e.set_cachesize(0, cachesize) else: raise error, "cachesize must be >= 20480" e.open('.', db.DB_PRIVATE | db.DB_CREATE | db.DB_THREAD | db.DB_INIT_LOCK | db.DB_INIT_MPOOL) e.set_lk_detect(db.DB_LOCK_DEFAULT) return e
996710fd44426f43d54034ebf3ee2355fca18f6a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/996710fd44426f43d54034ebf3ee2355fca18f6a/__init__.py
def __imull__(self, n): self.data += n
def __imul__(self, n): self.data *= n
def __imull__(self, n): self.data += n return self
add8d8632528d104a3a1e653ec815ed2e2c75b7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/add8d8632528d104a3a1e653ec815ed2e2c75b7a/UserString.py
self._tk.deletecommand(cbname)
self._master.deletecommand(cbname)
def trace_vdelete(self, mode, cbname): self._tk.call("trace", "vdelete", self._name, mode, cbname) self._tk.deletecommand(cbname)
0001a11986a17a94f1bf16df92b57df358d56958 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0001a11986a17a94f1bf16df92b57df358d56958/Tkinter.py
if time.strftime(directive, time_tuple).find('00'):
if '00' in time.strftime(directive, time_tuple):
def __calc_date_time(self): # Set self.date_time, self.date, & self.time by using # time.strftime().
6e372d1422dfaf5b1cd2ab2f48a42ee609cc119c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6e372d1422dfaf5b1cd2ab2f48a42ee609cc119c/_strptime.py
test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0)
test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0)
def __getitem__(self, i): return self.seq[i]
1ee77d9b71dab3b42b3c00760216cc4955a3cfeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1ee77d9b71dab3b42b3c00760216cc4955a3cfeb/test_strop.py
if self.force or output_file is None or newer(source, output_file)):
if self.force or output_file is None or newer(source, output_file):
def preprocess (self, source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None):
63a47402b354e76255d4a629ee3e1950d843af25 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63a47402b354e76255d4a629ee3e1950d843af25/unixccompiler.py
install = self.distribution.get_command_obj('install')
install = self.reinitialize_command('install')
def run (self):
edc6a519dc7801d22b3105f25327606476f4cc46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/edc6a519dc7801d22b3105f25327606476f4cc46/bdist_dumb.py
def __init__(self, allow_none):
def __init__(self, allow_none, encoding):
def __init__(self, allow_none): self.funcs = {} self.instance = None self.allow_none = allow_none
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
allow_none = self.allow_none)
allow_none=self.allow_none, encoding=self.encoding)
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
response = xmlrpclib.dumps(fault)
response = xmlrpclib.dumps(fault, allow_none=self.allow_none, encoding=self.encoding)
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value))
xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value)), encoding=self.encoding, allow_none=self.allow_none,
def _marshaled_dispatch(self, data, dispatch_method = None): """Dispatches an XML-RPC method from marshalled (XML) data.
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
logRequests=True, allow_none=False):
logRequests=True, allow_none=False, encoding=None):
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=True, allow_none=False): self.logRequests = logRequests
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
SimpleXMLRPCDispatcher.__init__(self, allow_none)
SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler, logRequests=True, allow_none=False): self.logRequests = logRequests
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
def __init__(self, allow_none=False): SimpleXMLRPCDispatcher.__init__(self, allow_none)
def __init__(self, allow_none=False, encoding=None): SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding)
def __init__(self, allow_none=False): SimpleXMLRPCDispatcher.__init__(self, allow_none)
427aedbbd436a3daa27176b2a57b8e402d1ff0e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/427aedbbd436a3daa27176b2a57b8e402d1ff0e0/SimpleXMLRPCServer.py
return Falso
return False
def ignored(self, file): if os.path.isdir(file): return True for pat in self.IgnoreList: if fnmatch.fnmatch(file, pat): return True return Falso
72118e5bc7fff604058b821ac8fca6587eedf735 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/72118e5bc7fff604058b821ac8fca6587eedf735/cvslib.py
def addwork(self, job): if not job: raise TypeError, 'cannot add null job'
def addwork(self, func, args): job = (func, args)
def addwork(self, job): if not job: raise TypeError, 'cannot add null job' self.mutex.acquire() self.work.append(job) self.mutex.release() if len(self.work) == 1: self.todo.release()
3ac5b00d4091e2c06bafe5fc5fb18798d3fa701b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3ac5b00d4091e2c06bafe5fc5fb18798d3fa701b/find.py
if '\n' in text: if string.find(text, '\r\n') >= 0: self._eoln = '\r\n' else: self._eoln = '\n' text = string.replace(text, self._eoln, '\r') change = 0 else: change = 0 self._eoln = '\r'
def __init__(self, path = "", title = ""): defaultfontsettings, defaulttabsettings, defaultwindowsize = geteditorprefs() global _scriptuntitledcounter if not path: if title: self.title = title else: self.title = "Untitled Script " + `_scriptuntitledcounter` _scriptuntitledcounter = _scriptuntitledcounter + 1 text = "" ...
4e6b3c55d0a045e37725a0eb6c7a0dfcd4d4084b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4e6b3c55d0a045e37725a0eb6c7a0dfcd4d4084b/PyEdit.py
if change > 0: self.editgroup.editor.textchanged()
def __init__(self, path = "", title = ""): defaultfontsettings, defaulttabsettings, defaultwindowsize = geteditorprefs() global _scriptuntitledcounter if not path: if title: self.title = title else: self.title = "Untitled Script " + `_scriptuntitledcounter` _scriptuntitledcounter = _scriptuntitledcounter + 1 text = "" ...
4e6b3c55d0a045e37725a0eb6c7a0dfcd4d4084b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4e6b3c55d0a045e37725a0eb6c7a0dfcd4d4084b/PyEdit.py
"http://www.unicode.org/Public/UNIDATA/" + TESTDATAFILE)
"http://www.unicode.org/Public/3.2-Update/" + TESTDATAFILE)
def test_main(): if skip_expected: raise TestSkipped(TESTDATAFILE + " not found, download from " + "http://www.unicode.org/Public/UNIDATA/" + TESTDATAFILE) part1_data = {} for line in open(TESTDATAFILE): if '#' in line: line = line.split('#')[0] line = line.strip() if not line: continue if line.startswith("@Part"): pa...
8db4403a768b711bbda1857ab4f38ed4be726e4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8db4403a768b711bbda1857ab4f38ed4be726e4b/test_normalization.py
for checkArgName in expected.keys():
s = str(e) for checkArgName in expected:
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
38d4d4a35b9f5ba10d0343d458dd97a2a2432dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38d4d4a35b9f5ba10d0343d458dd97a2a2432dae/test_exceptions.py
for checkArgName in expected.keys():
for checkArgName in expected:
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
38d4d4a35b9f5ba10d0343d458dd97a2a2432dae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38d4d4a35b9f5ba10d0343d458dd97a2a2432dae/test_exceptions.py
raise DistutilsOptionsError, \
raise DistutilsOptionError, \
def finalize_options (self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) if self.rpm_base is None: if not self.rpm3_mode: raise DistutilsOptionError, \ "you must specify --rpm-base in RPM 2 mode" self.rpm_base = os.path.join(self.bdist_base, "rpm")
5079fe07fe990e6db9b7c3b2d8702cad06cf2be0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5079fe07fe990e6db9b7c3b2d8702cad06cf2be0/bdist_rpm.py
fn = os.path.join(fn, os.pardir, os.pardir, "Doc", "index.html")
fn = os.path.join(fn, os.pardir, os.pardir, "pythlp.chm")
def help_dialog(self, event=None): try: helpfile = os.path.join(os.path.dirname(__file__), self.helpfile) except NameError: helpfile = self.helpfile if self.flist: self.flist.open(helpfile) else: self.io.loadfile(helpfile)
dcd2dc2fffce8614c5d2b8d303a303a599b88a23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcd2dc2fffce8614c5d2b8d303a303a599b88a23/EditorWindow.py
def python_docs(self, event=None): webbrowser.open(self.help_url)
def python_docs(self, event=None): os.startfile(self.help_url) else: def python_docs(self, event=None): webbrowser.open(self.help_url)
def python_docs(self, event=None): webbrowser.open(self.help_url)
dcd2dc2fffce8614c5d2b8d303a303a599b88a23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcd2dc2fffce8614c5d2b8d303a303a599b88a23/EditorWindow.py
opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name)
if self.negative_opt.has_key(opt_name): opt_name = string.translate(self.negative_opt[opt_name], longopt_xlate) val = not getattr(self, opt_name) else: opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name)
def dump_dirs (self, msg): if DEBUG: from distutils.fancy_getopt import longopt_xlate print msg + ":" for opt in self.user_options: opt_name = opt[0] if opt_name[-1] == "=": opt_name = opt_name[0:-1] opt_name = string.translate(opt_name, longopt_xlate) val = getattr(self, opt_name) print " %s: %s" % (opt_name, val)
1d1eac3ce895e29cdd5bb1d9b1f39dd60621e841 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/1d1eac3ce895e29cdd5bb1d9b1f39dd60621e841/install.py
else: p = "%s-ast.h" % mod.name f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' c = ChainOfVisitors(TypeDefVisitor(f), StructVisitor(f), PrototypeVisitor(f), ) c.visit(mod) print >>f, "PyObject* PyAST_mod2obj(mod_ty t);" f.close()
f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' c = ChainOfVisitors(TypeDefVisitor(f), StructVisitor(f), PrototypeVisitor(f), ) c.visit(mod) print >>f, "PyObject* PyAST_mod2obj(mod_ty t);" f.close()
def main(srcfile): argv0 = sys.argv[0] components = argv0.split(os.sep) argv0 = os.sep.join(components[-2:]) auto_gen_msg = '/* File automatically generated by %s */\n' % argv0 mod = asdl.parse(srcfile) if not asdl.check(mod): sys.exit(1) if INC_DIR: p = "%s/%s-ast.h" % (INC_DIR, mod.name) else: p = "%s-ast.h" % mod.na...
7580149bde28532ef16924328af0f0543411c3b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7580149bde28532ef16924328af0f0543411c3b4/asdl_c.py
else: p = "%s-ast.c" % mod.name f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' print >> f, ' print >> f print >>f, "static PyTypeObject* AST_type;" v = ChainOfVisitors( PyTypesDeclareVisitor(f), PyTypesVisitor(f), FunctionVisitor(f), ObjVisitor(f), ASTModuleVisitor(f), PartingShots(f), ) v.visit(mod) f.close(...
f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' print >> f, ' print >> f print >>f, "static PyTypeObject* AST_type;" v = ChainOfVisitors( PyTypesDeclareVisitor(f), PyTypesVisitor(f), FunctionVisitor(f), ObjVisitor(f), ASTModuleVisitor(f), PartingShots(f), ) v.visit(mod) f.close()
def main(srcfile): argv0 = sys.argv[0] components = argv0.split(os.sep) argv0 = os.sep.join(components[-2:]) auto_gen_msg = '/* File automatically generated by %s */\n' % argv0 mod = asdl.parse(srcfile) if not asdl.check(mod): sys.exit(1) if INC_DIR: p = "%s/%s-ast.h" % (INC_DIR, mod.name) else: p = "%s-ast.h" % mod.na...
7580149bde28532ef16924328af0f0543411c3b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7580149bde28532ef16924328af0f0543411c3b4/asdl_c.py
def __init__(self, format):
def __init__(self, format, len):
def __init__(self, format): self.format = format
4c8349592d508df26b9a8023f7a78d6874eedb08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c8349592d508df26b9a8023f7a78d6874eedb08/calendar.py
day_name = _localized_name('%A') day_abbr = _localized_name('%a')
day_name = _localized_name('%A', 7) day_abbr = _localized_name('%a', 7)
def __getitem__(self, item): return strftime(self.format, (item,)*9).capitalize()
4c8349592d508df26b9a8023f7a78d6874eedb08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c8349592d508df26b9a8023f7a78d6874eedb08/calendar.py
month_name = _localized_name('%B') month_abbr = _localized_name('%b')
month_name = _localized_name('%B', 12) month_abbr = _localized_name('%b', 12)
def __getitem__(self, item): return strftime(self.format, (item,)*9).capitalize()
4c8349592d508df26b9a8023f7a78d6874eedb08 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/4c8349592d508df26b9a8023f7a78d6874eedb08/calendar.py
def __init__(self, sock, debuglevel=0):
def __init__(self, sock, debuglevel=0, strict=0):
def __init__(self, sock, debuglevel=0): self.fp = sock.makefile('rb', 0) self.debuglevel = debuglevel
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
version = "HTTP/0.9" status = "200" reason = "" if version[:5] != 'HTTP/': self.close() raise BadStatusLine(line)
version = "" if not version.startswith('HTTP/'): if self.strict: self.close() raise BadStatusLine(line) else: self.fp = LineAndFileWrapper(line, self.fp) return "HTTP/0.9", 200, ""
def _read_status(self): line = self.fp.readline() if self.debuglevel > 0: print "reply:", repr(line) try: [version, status, reason] = line.split(None, 2) except ValueError: try: [version, status] = line.split(None, 1) reason = "" except ValueError: version = "HTTP/0.9" status = "200" reason = "" if version[:5] != 'HTTP...
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
def __init__(self, host, port=None):
strict = 0 def __init__(self, host, port=None, strict=None):
def getheader(self, name, default=None): if self.msg is None: raise ResponseNotReady() return self.msg.getheader(name, default)
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
def __init__(self, host, port=None): self.sock = None self.__response = None self.__state = _CS_IDLE
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
response = self.response_class(self.sock, self.debuglevel) else: response = self.response_class(self.sock)
response = self.response_class(self.sock, self.debuglevel, strict=self.strict) else: response = self.response_class(self.sock, strict=self.strict)
def getresponse(self): "Get the response from the server."
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
def __init__(self, host, port=None, key_file=None, cert_file=None): HTTPConnection.__init__(self, host, port)
def __init__(self, host, port=None, key_file=None, cert_file=None, strict=None): HTTPConnection.__init__(self, host, port, strict)
def __init__(self, host, port=None, key_file=None, cert_file=None): HTTPConnection.__init__(self, host, port) self.key_file = key_file self.cert_file = cert_file
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
def __init__(self, host='', port=None):
def __init__(self, host='', port=None, strict=None):
def __init__(self, host='', port=None): "Provide a default host, since the superclass requires one."
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
self._setup(self._connection_class(host, port))
self._setup(self._connection_class(host, port, strict))
def __init__(self, host='', port=None): "Provide a default host, since the superclass requires one."
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
def __init__(self, host='', port=None, **x509):
def __init__(self, host='', port=None, key_file=None, cert_file=None, strict=None):
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
self._setup(self._connection_class(host, port, **x509))
self._setup(self._connection_class(host, port, key_file, cert_file, strict))
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file')
self.key_file = key_file self.cert_file = cert_file
def __init__(self, host='', port=None, **x509): # provide a default host, pass the X509 cert info
d46aa37d35811a37397104f02074c8a44e7dbec1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d46aa37d35811a37397104f02074c8a44e7dbec1/httplib.py
int i;
int i, result;
def visitModule(self, mod): self.emit("""
19379f18a6ba7f8baf695f9340eb1ab21a85771e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19379f18a6ba7f8baf695f9340eb1ab21a85771e/asdl_c.py
for(i=0; i < num_fields; i++) {
for(i = 0; i < num_fields; i++) {
def visitModule(self, mod): self.emit("""
19379f18a6ba7f8baf695f9340eb1ab21a85771e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19379f18a6ba7f8baf695f9340eb1ab21a85771e/asdl_c.py
return PyObject_SetAttrString((PyObject*)type, "_attributes", l) >=0;
result = PyObject_SetAttrString((PyObject*)type, "_attributes", l) >= 0; Py_DECREF(l); return result;
def visitModule(self, mod): self.emit("""
19379f18a6ba7f8baf695f9340eb1ab21a85771e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19379f18a6ba7f8baf695f9340eb1ab21a85771e/asdl_c.py
self.emit("static int initialized;", 0)
def visitModule(self, mod): self.emit("""
19379f18a6ba7f8baf695f9340eb1ab21a85771e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19379f18a6ba7f8baf695f9340eb1ab21a85771e/asdl_c.py
self.emit('if(PyDict_SetItemString(d, "%s", (PyObject*)%s_type) < 0) return;' % (name, name), 1)
self.emit('if (PyDict_SetItemString(d, "%s", (PyObject*)%s_type) < 0) return;' % (name, name), 1)
def addObj(self, name): self.emit('if(PyDict_SetItemString(d, "%s", (PyObject*)%s_type) < 0) return;' % (name, name), 1)
19379f18a6ba7f8baf695f9340eb1ab21a85771e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19379f18a6ba7f8baf695f9340eb1ab21a85771e/asdl_c.py
self.chunksize = struct.unpack(strflag+'l', file.read(4))[0]
self.chunksize = struct.unpack(strflag+'L', file.read(4))[0]
def __init__(self, file, align=True, bigendian=True, inclheader=False): import struct self.closed = False self.align = align # whether to align to word (2-byte) boundaries if bigendian: strflag = '>' else: strflag = '<' self.file = file self.chunkname = file.read(4) if len(self.chunkname) < 4: raise EOFError try: ...
7b4e7c24df974b2590d5ef332910a020db355546 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7b4e7c24df974b2590d5ef332910a020db355546/chunk.py
>>> def m235():
b6c3ceae79f193e4361651fea61dfb2528bc2746 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6c3ceae79f193e4361651fea61dfb2528bc2746/test_generators.py
__test__ = {"tut": tutorial_tests, "pep": pep_tests, "email": email_tests, "fun": fun_tests, "syntax": syntax_tests}
x_tests = """ >>> def firstn(g, n): ... return [g.next() for i in range(n)] >>> def times(n, g): ... for i in g: ... yield n * i >>> def merge(g, h): ... ng = g.next() ... nh = h.next() ... while 1: ... if ng < nh: ... yield ng ... ng = g.next() ... ...
>>> def f():
b6c3ceae79f193e4361651fea61dfb2528bc2746 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6c3ceae79f193e4361651fea61dfb2528bc2746/test_generators.py
for i in range(1000):
for i in range(5000):
def test_main(): import doctest, test_generators if 0: # Temporary block to help track down leaks. So far, the blame # has fallen mostly on doctest. for i in range(1000): doctest.master = None doctest.testmod(test_generators) else: doctest.testmod(test_generators)
b6c3ceae79f193e4361651fea61dfb2528bc2746 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b6c3ceae79f193e4361651fea61dfb2528bc2746/test_generators.py
try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e try: unicode('\xff') except Exception, e: sampleUnicodeDecodeError = e
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
(sampleUnicodeEncodeError, {'message' : '', 'args' : ('ascii', u'Hello \xe1', 6, 7, 'ordinal not in range(128)'), 'encoding' : 'ascii', 'object' : u'Hello \xe1', 'start' : 6, 'reason' : 'ordinal not in range(128)'}), (sampleUnicodeDecodeError,
(UnicodeEncodeError, ('ascii', u'a', 0, 1, 'ordinal not in range'), {'message' : '', 'args' : ('ascii', u'a', 0, 1, 'ordinal not in range'), 'encoding' : 'ascii', 'object' : u'a', 'start' : 0, 'reason' : 'ordinal not in range'}), (UnicodeDecodeError, ('ascii', '\xff', 0, 1, 'ordinal not in range'),
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
'ordinal not in range(128)'),
'ordinal not in range'),
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
'start' : 0, 'reason' : 'ordinal not in range(128)'}),
'start' : 0, 'reason' : 'ordinal not in range'}),
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
for args in exceptionList: expected = args[-1] try: exc = args[0] if len(args) == 2: raise exc else: raise exc(*args[1])
for exc, args, expected in exceptionList: try: raise exc(*args)
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
if (e is not exc and type(e) is not exc):
if type(e) is not exc:
def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e
ecab623e1315cd0cfbe01e046e618001fe315490 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecab623e1315cd0cfbe01e046e618001fe315490/test_exceptions.py
The QUESTION strign ca be at most 255 characters.
The QUESTION string can be at most 255 characters.
def AskYesNoCancel(question, default = 0, yes=None, no=None, cancel=None, id=262): """Display a QUESTION string which can be answered with Yes or No. Return 1 when the user clicks the Yes button. Return 0 when the user clicks the No button. Return -1 when the user clicks the Cancel button. When the user presses Retur...
639a740e50c12400586b2dad429e357365c16822 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/639a740e50c12400586b2dad429e357365c16822/EasyDialogs.py
st = os.stat(src) mode = stat.S_IMODE(st[stat.ST_MODE]) os.chmod(dst, mode)
if hasattr(os, 'chmod'): st = os.stat(src) mode = stat.S_IMODE(st[stat.ST_MODE]) os.chmod(dst, mode)
def copymode(src, dst): """Copy mode bits from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st[stat.ST_MODE]) os.chmod(dst, mode)
0c94724cc77a004973fb0105417c084234c2da73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c94724cc77a004973fb0105417c084234c2da73/shutil.py
os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME])) os.chmod(dst, mode)
if hasattr(os, 'utime'): os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME])) if hasattr(os, 'chmod'): os.chmod(dst, mode)
def copystat(src, dst): """Copy all stat info (mode bits, atime and mtime) from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st[stat.ST_MODE]) os.utime(dst, (st[stat.ST_ATIME], st[stat.ST_MTIME])) os.chmod(dst, mode)
0c94724cc77a004973fb0105417c084234c2da73 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0c94724cc77a004973fb0105417c084234c2da73/shutil.py
if (rframe is frame) and rcur:
if (rframe is not frame) and rcur:
def trace_dispatch_exception(self, frame, t): rt, rtt, rct, rfn, rframe, rcur = self.cur if (rframe is frame) and rcur: return self.trace_dispatch_return(rframe, t) return 0
a0bc9993e77afc32660082a392f9af7fef428648 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a0bc9993e77afc32660082a392f9af7fef428648/profile.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...
62c11155eb13e950e10d660b8f5150e04efb3a5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62c11155eb13e950e10d660b8f5150e04efb3a5e/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...
62c11155eb13e950e10d660b8f5150e04efb3a5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62c11155eb13e950e10d660b8f5150e04efb3a5e/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...
62c11155eb13e950e10d660b8f5150e04efb3a5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62c11155eb13e950e10d660b8f5150e04efb3a5e/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...
62c11155eb13e950e10d660b8f5150e04efb3a5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62c11155eb13e950e10d660b8f5150e04efb3a5e/uu.py
self.sock.send(str)
sendptr = 0 while sendptr < len(str): sendptr = sendptr + self.sock.send(str[sendptr:])
def send(self, str): """Send `str' to the server.""" if self.debuglevel > 0: print 'send:', `str` if self.sock: try: self.sock.send(str) except socket.error: raise SMTPServerDisconnected('Server not connected') else: raise SMTPServerDisconnected('please run connect() first')
5bf94a0b772276548781ec6c29c3bd1cc96115d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5bf94a0b772276548781ec6c29c3bd1cc96115d7/smtplib.py
except SyntaxWarning, msg: print "got SyntaxWarning as expected"
except SyntaxError, msg: print "got SyntaxError as expected"
def compile_and_catch_warning(text): try: compile(text, "<test code>", "exec") except SyntaxWarning, msg: print "got SyntaxWarning as expected" else: print "expected SyntaxWarning"
150a6640f5f63d2dd32e823b619b6afdf3d1b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/150a6640f5f63d2dd32e823b619b6afdf3d1b8c1/test_global.py
print "expected SyntaxWarning"
print "expected SyntaxError"
def compile_and_catch_warning(text): try: compile(text, "<test code>", "exec") except SyntaxWarning, msg: print "got SyntaxWarning as expected" else: print "expected SyntaxWarning"
150a6640f5f63d2dd32e823b619b6afdf3d1b8c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/150a6640f5f63d2dd32e823b619b6afdf3d1b8c1/test_global.py
if os.name == "posix": check_environ() sys_dir = os.path.dirname(sys.modules['distutils'].__file__) sys_file = os.path.join(sys_dir, "pydistutils.cfg") if os.path.isfile(sys_file): files.append(sys_file) user_file = os.path.join(os.environ.get('HOME'), ".pydistutils.cfg")
check_environ() if os.name=='posix': sys_dir = os.path.dirname(sys.modules['distutils'].__file__) user_filename = ".pydistutils.cfg" else: sys_dir = sysconfig.PREFIX user_filename = "pydistutils.cfg" sys_file = os.path.join(sys_dir, "pydistutils.cfg") if os.path.isfile(sys_file): files.append(sys_file) if os.environ...
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).
acf3f6a7000eaed43f8c4e5df249967b06dfc474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/acf3f6a7000eaed43f8c4e5df249967b06dfc474/dist.py
else: sys_file = os.path.join (sysconfig.PREFIX, "pydistutils.cfg") if os.path.isfile(sys_file): files.append(sys_file)
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).
acf3f6a7000eaed43f8c4e5df249967b06dfc474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/acf3f6a7000eaed43f8c4e5df249967b06dfc474/dist.py
exc_type, exc_val, exc_tb = sys.exc_info()
exc_type, exc_val = sys.exc_info()[:2]
def _run_examples_inner(out, fakeout, examples, globs, verbose, name): import sys, traceback OK, BOOM, FAIL = range(3) NADA = "nothing" stderr = _SpoofOut() failures = 0 for source, want, lineno in examples: if verbose: _tag_out(out, ("Trying", source), ("Expecting", want or NADA)) fakeout.clear() try: exec compile(sou...
77f2d504c3891ff7f75d1e50d12b4cdb30e89767 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/77f2d504c3891ff7f75d1e50d12b4cdb30e89767/doctest.py
pid, sts = os.wait(G.busy, options)
pid, sts = os.waitpid(G.busy, options)
def waitchild(options): pid, sts = os.wait(G.busy, options) if pid == G.busy: G.busy = 0 G.stop.enable(0)
3dc44aba71305cd9be8cba7703a96b6528f34169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc44aba71305cd9be8cba7703a96b6528f34169/jukebox.py
"could not extract parameter group: " + `line`)
"could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`))
def subconvert(line, ofp, table, discards, autoclosing, knownempty, 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\...
bbd7509dbe6865e8f74d155c6f149b27828361d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/bbd7509dbe6865e8f74d155c6f149b27828361d7/latex2esis.py
if not callable(callback): callback = print_line
if callback is None: callback = print_line
def retrlines(self, cmd, callback = None): '''Retrieve data in line mode. The argument is a RETR or LIST command. The callback function (2nd argument) is called for each line, with trailing CRLF stripped. This creates a new port for you. print_line() is the default callback.''' if not callable(callback): callback = pr...
e874fc304e0ea29fc9608023b3f153b566e0acef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e874fc304e0ea29fc9608023b3f153b566e0acef/ftplib.py
self.packageRootFolder = root
self.sourceFolder = root
def build(self, root, resources=None, **options): """Create a package for some given root folder.
997429a5f47037de601ff9bd7d4bd4b538927106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/997429a5f47037de601ff9bd7d4bd4b538927106/buildpkg.py
self.packageResourceFolder = root
self.resourceFolder = root else: self.resourceFolder = resources
def build(self, root, resources=None, **options): """Create a package for some given root folder.
997429a5f47037de601ff9bd7d4bd4b538927106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/997429a5f47037de601ff9bd7d4bd4b538927106/buildpkg.py
elif not k in ["OutputDir"]: raise Error, "Unknown package option: %s" % k outputdir = options.get("OutputDir", os.getcwd()) packageName = self.packageInfo["Title"] self.PackageRootFolder = os.path.join(outputdir, packageName + ".pkg")
def build(self, root, resources=None, **options): """Create a package for some given root folder.
997429a5f47037de601ff9bd7d4bd4b538927106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/997429a5f47037de601ff9bd7d4bd4b538927106/buildpkg.py
packageName = self.packageInfo["Title"] rootFolder = packageName + ".pkg" contFolder = join(rootFolder, "Contents") resourceFolder = join(contFolder, "Resources") os.mkdir(rootFolder)
contFolder = join(self.PackageRootFolder, "Contents") self.packageResourceFolder = join(contFolder, "Resources") os.mkdir(self.PackageRootFolder)
def _makeFolders(self): "Create package folder structure."
997429a5f47037de601ff9bd7d4bd4b538927106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/997429a5f47037de601ff9bd7d4bd4b538927106/buildpkg.py
os.mkdir(resourceFolder) self.resourceFolder = resourceFolder
os.mkdir(self.packageResourceFolder)
def _makeFolders(self): "Create package folder structure."
997429a5f47037de601ff9bd7d4bd4b538927106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/997429a5f47037de601ff9bd7d4bd4b538927106/buildpkg.py