rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
eq(int(time.mktime(timetup[:9])), 1044470846) | t = int(time.mktime(timetup[:9])) eq(time.localtime(t)[:6], timetup[:6]) | def test_parsedate_acceptable_to_time_functions(self): eq = self.assertEqual timetup = Utils.parsedate('5 Feb 2003 13:47:26 -0800') eq(int(time.mktime(timetup)), 1044470846) eq(int(time.strftime('%Y', timetup)), 2003) timetup = Utils.parsedate_tz('5 Feb 2003 13:47:26 -0800') eq(int(time.mktime(timetup[:9])), 1044470846... | 08562c411899c7a6afd61f96417afe027bfc1dbb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/08562c411899c7a6afd61f96417afe027bfc1dbb/test_email.py |
func, targs, kargs = _exithandlers[-1] | func, targs, kargs = _exithandlers.pop() | def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. """ while _exithandlers: func, targs, kargs = _exithandlers[-1] apply(func, targs, kargs) _exithandlers.remove(_exithandlers[-1]) | 8fc77ecde389e20fd025d5003983a980621388d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fc77ecde389e20fd025d5003983a980621388d4/atexit.py |
_exithandlers.remove(_exithandlers[-1]) | def _run_exitfuncs(): """run any registered exit functions _exithandlers is traversed in reverse order so functions are executed last in, first out. """ while _exithandlers: func, targs, kargs = _exithandlers[-1] apply(func, targs, kargs) _exithandlers.remove(_exithandlers[-1]) | 8fc77ecde389e20fd025d5003983a980621388d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8fc77ecde389e20fd025d5003983a980621388d4/atexit.py | |
ofp.write("-%s\n" % encode(text)) | ofp.write("- %s \n" % encode(text)) | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
line = r"\%s%s" % (m.group(1), line[m.end():]) | line = r"\%s %s" % (m.group(1), line[m.end():]) | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py | ||
real_ofp = ofp | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py | |
if type(conversion) is type(""): line = "&%s;%s" % (conversion, line[m.end(1):]) continue | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py | |
line = line[m.end() - 1:] | line = line[m.end(1):] elif empty: line = line[m.end(1):] | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
if type(conversion) is not type(""): ofp.write("(%s\n" % macroname) | ofp.write("(%s\n" % macroname) | 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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
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\n"... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py | ||
return subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) | try: subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) except IOError, (err, msg): if err != errno.EPIPE: raise | def convert(ifp, ofp, table={}, discards=(), autoclosing=(), knownempties=()): d = {} for gi in knownempties: d[gi] = gi return subconvert(ifp.read(), ofp, table, discards, autoclosing, d.has_key) | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
"ABC": "ABC", "ASCII": "ASCII", "C": "C", "Cpp": "Cpp", "EOF": "EOF", "e": "backslash", "ldots": "ldots", "NULL": "NULL", "POSIX": "POSIX", "UNIX": "Unix", | "ABC": ([], 0, 1), "ASCII": ([], 0, 1), "C": ([], 0, 1), "Cpp": ([], 0, 1), "EOF": ([], 0, 1), "e": ([], 0, 1), "ldots": ([], 0, 1), "NULL": ([], 0, 1), "POSIX": ([], 0, 1), "UNIX": ([], 0, 1), | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
knownempties=["rfc", "declaremodule", "appendix", | knownempties=["appendix", | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
"localmoduletable", "manpage", "input"]) | "localmoduletable"]) | def main(): if len(sys.argv) == 2: ifp = open(sys.argv[1]) ofp = sys.stdout elif len(sys.argv) == 3: ifp = open(sys.argv[1]) ofp = open(sys.argv[2], "w") else: usage() sys.exit(2) convert(ifp, ofp, { # entries are name # -> ([list of attribute names], first_is_optional, empty) "cfuncdesc": (["type", "name", ("... | 177c5005c27b072f67098dea66be9f3528dd0fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/177c5005c27b072f67098dea66be9f3528dd0fe8/latex2esis.py |
except IOError: | except IOError, reason: | def main(self): | 3879423c63f7bb484ee8fdc03b7b41c9c64eebc7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3879423c63f7bb484ee8fdc03b7b41c9c64eebc7/pybench.py |
except IOError: | except IOError, reason: | def main(self): | 3879423c63f7bb484ee8fdc03b7b41c9c64eebc7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3879423c63f7bb484ee8fdc03b7b41c9c64eebc7/pybench.py |
auth = base64.encodestring(auth) | auth = base64.encodestring(urllib.unquote(auth)) | def get_host_info(self, host): | c053b0b24eb51792e19423614e896230b6d00f43 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c053b0b24eb51792e19423614e896230b6d00f43/xmlrpclib.py |
def test_remove(self): d = deque('abcdefghcij') d.remove('c') self.assertEqual(d, deque('abdefghcij')) d.remove('c') self.assertEqual(d, deque('abdefghij')) self.assertRaises(ValueError, d.remove, 'c') self.assertEqual(d, deque('abdefghij')) | 48c31247d537b70439da1f978c4e676fbb7e1ff8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/48c31247d537b70439da1f978c4e676fbb7e1ff8/test_deque.py | ||
__version__ = "1.0b2" | __version__ = "1.0b3" | def _stringify(string): return string | 4720263687630e06c907178060d725cc8a64cd6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4720263687630e06c907178060d725cc8a64cd6d/xmlrpclib.py |
class Error: | class Error(Exception): | def _stringify(string): return string | 4720263687630e06c907178060d725cc8a64cd6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4720263687630e06c907178060d725cc8a64cd6d/xmlrpclib.py |
t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType): | if not isinstance(value, StringType): if not isinstance(value, TupleType): | def __init__(self, value=0): t = type(value) if not isinstance(t, StringType): if not isinstance(t, TupleType): if value == 0: value = time.time() value = time.localtime(value) value = time.strftime("%Y%m%dT%H:%M:%S", value) self.value = value | 4720263687630e06c907178060d725cc8a64cd6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4720263687630e06c907178060d725cc8a64cd6d/xmlrpclib.py |
"<Server proxy for %s%s>" % | "<ServerProxy for %s%s>" % | def __repr__(self): return ( "<Server proxy for %s%s>" % (self.__host, self.__handler) ) | 4720263687630e06c907178060d725cc8a64cd6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4720263687630e06c907178060d725cc8a64cd6d/xmlrpclib.py |
server = Server("http://betty.userland.com") | server = ServerProxy("http://betty.userland.com") | def __getattr__(self, name): # magic method dispatcher return _Method(self.__request, name) | 4720263687630e06c907178060d725cc8a64cd6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4720263687630e06c907178060d725cc8a64cd6d/xmlrpclib.py |
self.fail("Error testing host resolution mechanisms.") | self.fail("Error testing host resolution mechanisms. (fqdn: %s, all: %s)" % (fqdn, repr(all_host_names))) | def testHostnameRes(self): # Testing hostname resolution mechanisms hostname = socket.gethostname() try: ip = socket.gethostbyname(hostname) except socket.error: # Probably name lookup wasn't set up right; skip this test return self.assert_(ip.find('.') >= 0, "Error resolving host to ip.") try: hname, aliases, ipaddrs ... | 42fb873022a325cb54b084a6f4eefa14b654fdd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/42fb873022a325cb54b084a6f4eefa14b654fdd6/test_socket.py |
e.append(fd) if obj.readable(): | is_r = obj.readable() is_w = obj.writable() if is_r: | def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): e.append(fd) if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) if [] == r == w == e: time.sleep(timeout) else: try: r, w, e = select.select(r, w, e, timeout) except select.error, er... | ac5dde0e16e1c251c36ab88e828574f613ff39be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac5dde0e16e1c251c36ab88e828574f613ff39be/asyncore.py |
if obj.writable(): | if is_w: | def poll(timeout=0.0, map=None): if map is None: map = socket_map if map: r = []; w = []; e = [] for fd, obj in map.items(): e.append(fd) if obj.readable(): r.append(fd) if obj.writable(): w.append(fd) if [] == r == w == e: time.sleep(timeout) else: try: r, w, e = select.select(r, w, e, timeout) except select.error, er... | ac5dde0e16e1c251c36ab88e828574f613ff39be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac5dde0e16e1c251c36ab88e828574f613ff39be/asyncore.py |
flags = select.POLLERR | select.POLLHUP | select.POLLNVAL | flags = 0 | def poll2(timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 if map is None: map = socket_map if timeout is not None: # timeout is in milliseconds timeout = int(timeout*1000) pollster = select.poll() if map: for fd, obj in map.items(): flags = select.POLLERR | select.POLLHUP | sel... | ac5dde0e16e1c251c36ab88e828574f613ff39be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ac5dde0e16e1c251c36ab88e828574f613ff39be/asyncore.py |
def buffer_inherit(): import binascii if verbose: print "Testing that buffer interface is inherited ..." class MyStr(str): pass base = 'abc' m = MyStr(base) vereq(binascii.b2a_hex(m), binascii.b2a_hex(base)) class MyUni(unicode): pass base = u'abc' m = MyUni(base) vereq(binascii.b2a_hex(m), binascii.b2a_hex(bas... | def __getattr__(self, name): if name in ("spam", "foo", "bar"): return "hello" raise AttributeError, name | 3d28667854fa7f283f47bc06ed70c79d65cccf86 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3d28667854fa7f283f47bc06ed70c79d65cccf86/test_descr.py | |
if completekey: try: import readline readline.set_completer(self.complete) readline.parse_and_bind(completekey+": complete") except ImportError: pass | self.completekey = completekey | def __init__(self, completekey='tab'): """Instantiate a line-oriented interpreter framework. | 2560f400c851ebae20b0da5ff3b04be7a823f0f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2560f400c851ebae20b0da5ff3b04be7a823f0f3/cmd.py |
pass | if self.completekey: try: import readline self.old_completer = readline.get_completer() readline.set_completer(self.complete) readline.parse_and_bind(self.completekey+": complete") except ImportError: pass | def preloop(self): """Hook method executed once when the cmdloop() method is called.""" pass | 2560f400c851ebae20b0da5ff3b04be7a823f0f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2560f400c851ebae20b0da5ff3b04be7a823f0f3/cmd.py |
pass | if self.completekey: try: import readline readline.set_completer(self.old_completer) except ImportError: pass | def postloop(self): """Hook method executed once when the cmdloop() method is about to return. | 2560f400c851ebae20b0da5ff3b04be7a823f0f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2560f400c851ebae20b0da5ff3b04be7a823f0f3/cmd.py |
def add_suffix(self, suffix, importer): assert isinstance(importer, SuffixImporter) self.suffixes.append((suffix, importer)) | def add_suffix(self, suffix, importFunc): assert callable(importFunc) self.fs_imp.add_suffix(suffix, importFunc) | def add_suffix(self, suffix, importer): assert isinstance(importer, SuffixImporter) self.suffixes.append((suffix, importer)) | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
def __init__(self): | clsFilesystemImporter = None def __init__(self, fs_imp=None): | def __init__(self): # we're definitely going to be importing something in the future, # so let's just load the OS-related facilities. if not _os_stat: _os_bootstrap() | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
self.suffixes = [ ] | def __init__(self): # we're definitely going to be importing something in the future, # so let's just load the OS-related facilities. if not _os_stat: _os_bootstrap() | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py | |
self.suffixes.append((desc[0], DynLoadSuffixImporter(desc))) self.suffixes.append(('.py', PySuffixImporter())) self.fs_imp = _FilesystemImporter(self.suffixes) | self.add_suffix(desc[0], DynLoadSuffixImporter(desc).import_file) self.add_suffix('.py', py_suffix_importer) | def __init__(self): # we're definitely going to be importing something in the future, # so let's just load the OS-related facilities. if not _os_stat: _os_bootstrap() | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
def install(self): sys.path.insert(0, self) | def install(self): sys.path.insert(0, self) | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py | |
if len(result) == 2: result = result + ({},) | def _import_one(self, parent, modname, fqname): "Import a single module." | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py | |
def __init__(self, suffixes): self.suffixes = suffixes | def __init__(self): self.suffixes = [ ] def add_suffix(self, suffix, importFunc): assert callable(importFunc) self.suffixes.append((suffix, importFunc)) | def __init__(self, suffixes): # this list is shared with the ImportManager. self.suffixes = suffixes | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
for suffix, importer in self.suffixes: | for suffix, importFunc in self.suffixes: | def _import_pathname(self, pathname, fqname): if _os_path_isdir(pathname): result = self._import_pathname(_os_path_join(pathname, '__init__'), fqname) if result: values = result[2] values['__pkgdir__'] = pathname values['__path__'] = [ pathname ] return 1, result[1], values return None | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
return importer.import_file(filename, finfo, fqname) | return importFunc(filename, finfo, fqname) | def _import_pathname(self, pathname, fqname): if _os_path_isdir(pathname): result = self._import_pathname(_os_path_join(pathname, '__init__'), fqname) if result: values = result[2] values['__pkgdir__'] = pathname values['__path__'] = [ pathname ] return 1, result[1], values return None | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
class SuffixImporter: def import_file(self, filename, finfo, fqname): raise RuntimeError class PySuffixImporter(SuffixImporter): def import_file(self, filename, finfo, fqname): file = filename[:-3] + _suffix t_py = long(finfo[8]) t_pyc = _timestamp(file) code = None if t_pyc is not None and t_pyc >= t_py: f = open(fi... | def py_suffix_importer(filename, finfo, fqname): file = filename[:-3] + _suffix t_py = long(finfo[8]) t_pyc = _timestamp(file) code = None if t_pyc is not None and t_pyc >= t_py: f = open(file, 'rb') if f.read(4) == imp.get_magic(): t = struct.unpack('<I', f.read(4))[0] if t == t_py: code = marshal.load(f) f.close() i... | def _import_pathname(self, pathname, fqname): if _os_path_isdir(pathname): result = self._import_pathname(_os_path_join(pathname, '__init__'), fqname) if result: values = result[2] values['__pkgdir__'] = pathname values['__path__'] = [ pathname ] return 1, result[1], values return None | 16abaf4fd2ed34d4b3b71d740cdef6686032295c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/16abaf4fd2ed34d4b3b71d740cdef6686032295c/imputil.py |
self.assertTrue(data.endswith('\n')) | self.assertTrue(data == '' or data.endswith('\n')) | def verify_valid_flag(self, cmd_line): data = self.start_python(cmd_line) self.assertTrue(data.endswith('\n')) self.assertTrue('Traceback' not in data) | ebcd88ed1b918ebdb086de4d1b285788e61f76eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ebcd88ed1b918ebdb086de4d1b285788e61f76eb/test_cmd_line.py |
self.assertRaises(ValueError, msg.get_content_maintype) | self.assertEqual(msg.get_content_maintype(), 'text') | def test_get_content_maintype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_maintype) | 0df35b27d6942d0d674ed2fa0a88c9074c29c169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0df35b27d6942d0d674ed2fa0a88c9074c29c169/test_email.py |
self.assertRaises(ValueError, msg.get_content_subtype) | self.assertEqual(msg.get_content_subtype(), 'plain') | def test_get_content_subtype_error(self): msg = Message() msg['Content-Type'] = 'no-slash-in-this-string' self.assertRaises(ValueError, msg.get_content_subtype) | 0df35b27d6942d0d674ed2fa0a88c9074c29c169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0df35b27d6942d0d674ed2fa0a88c9074c29c169/test_email.py |
def test_strptime(self): tt = time.gmtime(self.t) for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 'j', 'm', 'M', 'p', 'S', 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): format = ' %' + directive try: time.strptime(time.strftime(format, tt), format) except ValueError: self.fail('conversion specifier: %r failed... | 477877f138be6e56db275ee5acd346cf85c32383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/477877f138be6e56db275ee5acd346cf85c32383/test_time.py | ||
print "found", `title[start:m.end()]` | def clean_title(title): title = raisebox_rx.sub("", title) title = hackscore_rx.sub(r"\\_", title) pos = 0 while 1: m = title_rx.search(title, pos) if m: start = m.start() print "found", `title[start:m.end()]` if title[start:start+15] != "\\textunderscore": title = title[:start] + title[m.end():] pos = start + 1 else: ... | 0649cc1a40e66bd198591c94ac25b28052f3aff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0649cc1a40e66bd198591c94ac25b28052f3aff6/toc2bkm.py | |
print `title` | def clean_title(title): title = raisebox_rx.sub("", title) title = hackscore_rx.sub(r"\\_", title) pos = 0 while 1: m = title_rx.search(title, pos) if m: start = m.start() print "found", `title[start:m.end()]` if title[start:start+15] != "\\textunderscore": title = title[:start] + title[m.end():] pos = start + 1 else: ... | 0649cc1a40e66bd198591c94ac25b28052f3aff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0649cc1a40e66bd198591c94ac25b28052f3aff6/toc2bkm.py | |
if sys.platform.startswith("win"): lookfor = " denied" | if sys.platform == 'win32': expected_exit_code = 2 | def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | a9010e76a9db9081f0994642378f95ae80b2ae00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a9010e76a9db9081f0994642378f95ae80b2ae00/test_cmd_line.py |
lookfor = "is a directory" self.assertTrue(lookfor in self.start_python('.')) self.assertTrue(lookfor in self.start_python('< .')) | expected_exit_code = 0 self.assertEqual(self.exit_code('.'), expected_exit_code) self.assertTrue(self.exit_code('< .') != 0) | def test_directories(self): # Does this test make sense? The message for "< ." may depend on # the command shell, and the message for "." depends on the OS. if sys.platform.startswith("win"): # On WinXP w/ cmd.exe, # "< ." gives "Access is denied.\n" # "." gives "C:\\Code\\python\\PCbuild\\python.exe: " + # ... | a9010e76a9db9081f0994642378f95ae80b2ae00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a9010e76a9db9081f0994642378f95ae80b2ae00/test_cmd_line.py |
if os.path.isdir(dir) and dir not in dirlist: | if dir is not None and os.path.isdir(dir) and dir not in dirlist: | def add_dir_to_list(dirlist, dir): """Add the directory 'dir' to the list 'dirlist' (at the front) if 1) 'dir' is not already in 'dirlist' 2) 'dir' actually exists, and is a directory.""" if os.path.isdir(dir) and dir not in dirlist: dirlist.insert(0, dir) | 0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e/setup.py |
if platform == 'darwin': | if platform in ('darwin', 'mac'): | def build_extensions(self): | 0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e/setup.py |
input = text_file.TextFile('Modules/Setup', join_lines=1) remove_modules = [] while 1: line = input.readline() if not line: break line = line.split() remove_modules.append( line[0] ) input.close() for ext in self.extensions[:]: if ext.name in remove_modules: self.extensions.remove(ext) | if platform != 'mac': input = text_file.TextFile('Modules/Setup', join_lines=1) remove_modules = [] while 1: line = input.readline() if not line: break line = line.split() remove_modules.append( line[0] ) input.close() for ext in self.extensions[:]: if ext.name in remove_modules: self.extensions.remove(ext) | def build_extensions(self): | 0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e/setup.py |
if platform in ['darwin', 'beos']: | if platform in ['darwin', 'beos', 'mac']: | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0c0dd4bf44a5c1beef2034eb1ffd78f19e5aac1e/setup.py |
By default, the diff control lines (those with *** or ---) are | By default, the diff control lines (those with ---, +++, or @@) are | def unified_diff(a, b, fromfile='', tofile='', fromfiledate='', tofiledate='', n=3, lineterm='\n'): r""" Compare two sequences of lines; generate the delta as a unified diff. Unified diffs are a compact way of showing line changes and a few lines of context. The number of context lines is set by 'n' which defaults to... | 96f750098bec0878a49a31d422414badd77e4142 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/96f750098bec0878a49a31d422414badd77e4142/difflib.py |
return bool() | """Return true if the scope uses exec""" return bool(self._table.optimized & (OPT_EXEC | OPT_BARE_EXEC)) def has_import_star(self): """Return true if the scope uses import *""" return bool(self._table.optimized & OPT_IMPORT_STAR) | def has_exec(self): return bool() | c33b20ca43dc82a32480aafacb7c39fb3aef37b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c33b20ca43dc82a32480aafacb7c39fb3aef37b0/symtable.py |
return bool(self.flag & DEF_STAR) | return bool(self.__flags & DEF_STAR) | def is_vararg(self): return bool(self.flag & DEF_STAR) | c33b20ca43dc82a32480aafacb7c39fb3aef37b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c33b20ca43dc82a32480aafacb7c39fb3aef37b0/symtable.py |
return bool(self.__flags & DEF_STARSTAR) | return bool(self.__flags & DEF_DOUBLESTAR) | def is_keywordarg(self): return bool(self.__flags & DEF_STARSTAR) | c33b20ca43dc82a32480aafacb7c39fb3aef37b0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c33b20ca43dc82a32480aafacb7c39fb3aef37b0/symtable.py |
('dbserv2.theopalgroup.com', '/mediumfile'), ('dbserv2.theopalgroup.com', '/smallfile'), | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if a... | 48018f43c4ca1640451420db8a9ff0d86cdbc85d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/48018f43c4ca1640451420db8a9ff0d86cdbc85d/httplib.py | |
c = HTTPConnection("promotions.yahoo.com") c.set_debuglevel(1) c.connect() c.request("GET", "/promotions/mom_com97/supermom.html") r = c.getresponse() print r.status, r.version lines = r.read().split("\n") print "\n".join(lines[:5]) c = HTTPConnection("promotions.yahoo.com", strict=1) c.set_debuglevel(1) c.connect()... | def test(): """Test this module. A hodge podge of tests collected here, because they have too many external dependencies for the regular test suite. """ import sys import getopt opts, args = getopt.getopt(sys.argv[1:], 'd') dl = 0 for o, a in opts: if o == '-d': dl = dl + 1 host = 'www.python.org' selector = '/' if a... | 48018f43c4ca1640451420db8a9ff0d86cdbc85d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/48018f43c4ca1640451420db8a9ff0d86cdbc85d/httplib.py | |
self.draw.bind(fred, "<Any-Enter>", self.mouseEnter) self.draw.bind(fred, "<Any-Leave>", self.mouseLeave) | self.draw.tag_bind(fred, "<Any-Enter>", self.mouseEnter) self.draw.tag_bind(fred, "<Any-Leave>", self.mouseLeave) | def createWidgets(self): | 3744bdda5592bbbe5606c13f61f2c4665be6179a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3744bdda5592bbbe5606c13f61f2c4665be6179a/canvas-moving-w-mouse.py |
name = basename(in_file) | name = os.path.basename(in_file) | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): if name == None: name = basename(in_file) if mode == None: try: mode = os.path.stat(in_file)[0] except AttributeError... | cf962aae5edbfda52e2312d56623696721202411 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf962aae5edbfda52e2312d56623696721202411/uu.py |
mode = os.path.stat(in_file)[0] | mode = os.stat(in_file)[0] | def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): if name == None: name = basename(in_file) if mode == None: try: mode = os.path.stat(in_file)[0] except AttributeError... | cf962aae5edbfda52e2312d56623696721202411 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cf962aae5edbfda52e2312d56623696721202411/uu.py |
_apply = apply | def join(words, sep = ' '): """join(list [,sep]) -> string Return a string composed of the words in list, with intervening occurences of sep. The default separator is a single space. (joinfields and join are synonymous) """ return sep.join(words) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py | |
return _apply(s.index, args) | return s.index(*args) | def index(s, *args): """index(s, sub [,start [,end]]) -> int Like find but raises ValueError when the substring is not found. """ return _apply(s.index, args) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
return _apply(s.rindex, args) | return s.rindex(*args) | def rindex(s, *args): """rindex(s, sub [,start [,end]]) -> int Like rfind but raises ValueError when the substring is not found. """ return _apply(s.rindex, args) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
return _apply(s.count, args) | return s.count(*args) | def count(s, *args): """count(s, sub[, start[,end]]) -> int Return the number of occurrences of substring sub in string s[start:end]. Optional arguments start and end are interpreted as in slice notation. """ return _apply(s.count, args) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
return _apply(s.find, args) | return s.find(*args) | def find(s, *args): """find(s, sub [,start [,end]]) -> in Return the lowest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. """ return _apply(s.find, args) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
return _apply(s.rfind, args) | return s.rfind(*args) | def rfind(s, *args): """rfind(s, sub [,start [,end]]) -> int Return the highest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure. """ return _apply(s.rfind, args) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
n = width - len(s) if n <= 0: return s return s + ' '*n | return s.ljust(width) | def ljust(s, width): """ljust(s, width) -> string Return a left-justified version of s, in a field of the specified width, padded with spaces as needed. The string is never truncated. """ n = width - len(s) if n <= 0: return s return s + ' '*n | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
n = width - len(s) if n <= 0: return s return ' '*n + s | return s.rjust(width) | def rjust(s, width): """rjust(s, width) -> string Return a right-justified version of s, in a field of the specified width, padded with spaces as needed. The string is never truncated. """ n = width - len(s) if n <= 0: return s return ' '*n + s | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
n = width - len(s) if n <= 0: return s half = n/2 if n%2 and width%2: half = half+1 return ' '*half + s + ' '*(n-half) | return s.center(width) | def center(s, width): """center(s, width) -> string Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. """ n = width - len(s) if n <= 0: return s half = n/2 if n%2 and width%2: # This ensures that center(center(s, i), j) = center(s, j) half =... | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
res = line = '' for c in s: if c == '\t': c = ' '*(tabsize - len(line) % tabsize) line = line + c if c == '\n': res = res + line line = '' return res + line | return s.expandtabs(tabsize) | def expandtabs(s, tabsize=8): """expandtabs(s [,tabsize]) -> string Return a copy of the string s with all tab characters replaced by the appropriate number of spaces, depending on the current column, and the tabsize (default 8). """ res = line = '' for c in s: if c == '\t': c = ' '*(tabsize - len(line) % tabsize) li... | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py |
try: ''.upper except AttributeError: from stringold import * | def replace(s, old, new, maxsplit=-1): """replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced. """ return s.replace(old, new, maxsplit) | 4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py | |
parts = split(path, '.') | parts = [part for part in split(path, '.') if part] | def locate(path, forceload=0): """Locate an object by name or dotted path, importing as necessary.""" parts = split(path, '.') module, n = None, 0 while n < len(parts): nextmodule = safeimport(join(parts[:n+1], '.'), forceload) if nextmodule: module, n = nextmodule, n + 1 else: break if module: object = module for part... | c48fb29249b30e0a8c51f479659ba7be35789076 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c48fb29249b30e0a8c51f479659ba7be35789076/pydoc.py |
Keywords are width, height, startx and starty | Keywords are width, height, startx and starty: | def setup(**geometry): """ Sets the size and position of the main window. Keywords are width, height, startx and starty width: either a size in pixels or a fraction of the screen. Default is 50% of screen. height: either the height in pixels or a fraction of the screen. Default is 75% of screen. Setting either width... | 29610c54bd931177c82d81d09204149c628fbfab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29610c54bd931177c82d81d09204149c628fbfab/turtle.py |
""" set the window title. | """Set the window title. | def title(title): """ set the window title. By default this is set to 'Turtle Graphics' Example: >>> title("My Window") """ global _title _title = title | 29610c54bd931177c82d81d09204149c628fbfab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/29610c54bd931177c82d81d09204149c628fbfab/turtle.py |
raise ErrorDuringImport(filename, sys.exc_info()) | raise ErrorDuringImport(path, sys.exc_info()) | def locate(path): """Locate an object by name (or dotted path), importing as necessary.""" if not path: # special case: imp.find_module('') strangely succeeds return None if type(path) is not types.StringType: return path parts = split(path, '.') n = len(parts) while n > 0: path = join(parts[:n], '.') try: module = fre... | edee5756dee69ce72ea65b4b58546bc82199ab82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/edee5756dee69ce72ea65b4b58546bc82199ab82/pydoc.py |
return (action, pattern, dir, dir_pattern) | return (action, patterns, dir, dir_pattern) | def _parse_template_line (self, line): words = string.split (line) action = words[0] | 5cba2326315af1d8de35a28c989edb607eb87993 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5cba2326315af1d8de35a28c989edb607eb87993/filelist.py |
def test_string_charset(self): eq = self.assertEqual h = Header() h.append('hello', 'iso-8859-1') eq(h, '=?iso-8859-1?q?hello?=') | a2514107d552bcb0a7643b1041492d91c73a47ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a2514107d552bcb0a7643b1041492d91c73a47ab/test_email.py | ||
chunk = Chunk().init(self._file) | try: chunk = Chunk().init(self._file) except EOFError: if formlength == 8: print 'Warning: FORM chunk size too large' formlength = 0 break raise EOFError | def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata ... | b069c08f98ae61a17dd6e17dca6a0e398edf09c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b069c08f98ae61a17dd6e17dca6a0e398edf09c5/aifc.py |
from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler | def build_extensions(self): from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | |
compiler = os.environ.get('CC') linker_so = os.environ.get('LDSHARED') args = {} if compiler is not None: args['compiler_so'] = compiler if linker_so is not None: args['linker_so'] = linker_so + ' -shared' self.compiler.set_executables(**args) | def build_extensions(self): from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | |
exts.append( Extension('unicodedata', ['unicodedata.c', 'unicodedatabase.c']) ) | exts.append( Extension('unicodedata', ['unicodedata.c', 'unicodedatabase.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py |
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | ||
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | ||
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | ||
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | ||
def main(): setup(name = 'Python standard library', version = '%d.%d' % sys.version_info[:2], cmdclass = {'build_ext':PyBuildExt}, # The struct module is defined here, because build_ext won't be # called unless there's at least one extension module defined. ext_modules=[Extension('struct', ['structmodule.c'])] ) | 1fcdc25ab92d9b084a08284526b263586c9ebe57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1fcdc25ab92d9b084a08284526b263586c9ebe57/setup.py | ||
xid = self.unpack_uint(xid) | xid = self.unpack_uint() | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if temp <> CALL: | if temp != CALL: | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) | if temp != RPCVERSION: raise BadRPCVersion, 'bad RPC version %r' % (temp,) | def unpack_callheader(self): xid = self.unpack_uint(xid) temp = self.unpack_enum() if temp <> CALL: raise BadRPCFormat, 'no CALL but %r' % (temp,) temp = self.unpack_uint() if temp <> RPCVERSION: raise BadRPCVerspion, 'bad RPC version %r' % (temp,) prog = self.unpack_uint() vers = self.unpack_uint() proc = self.unpack_... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if mtype <> REPLY: | if mtype != REPLY: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if stat <> MSG_ACCEPTED: | if stat != MSG_ACCEPTED: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if stat <> SUCCESS: | if stat != SUCCESS: | def unpack_replyheader(self): xid = self.unpack_uint() mtype = self.unpack_enum() if mtype <> REPLY: raise RuntimeError, 'no REPLY but %r' % (mtype,) stat = self.unpack_enum() if stat == MSG_DENIED: stat = self.unpack_enum() if stat == RPC_MISMATCH: low = self.unpack_uint() high = self.unpack_uint() raise RuntimeError,... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if errno <> 114: | if errno != 114: | def bindresvport(sock, host): global last_resv_port_tried FIRST, LAST = 600, 1024 # Range of ports to try if last_resv_port_tried == None: import os last_resv_port_tried = FIRST + os.getpid() % (LAST-FIRST) for i in range(last_resv_port_tried, LAST) + \ range(FIRST, last_resv_port_tried): last_resv_port_tried = i try: ... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def do_call(self): call = self.packer.get_buf() sendrecord(self.sock, call) reply = recvrecord(self.sock) u = self.unpacker u.reset(reply) xid, verf = u.unpack_replyheader() if xid <> self.lastxid: # Can't really happen since this is TCP... raise RuntimeError, 'wrong xid in reply %r instead of %r' % ( xid, self.lastxid... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def do_call(self): call = self.packer.get_buf() self.sock.send(call) try: from select import select except ImportError: print 'WARNING: select not found, RPC may hang' select = None BUFSIZE = 8192 # Max UDP buffer size timeout = 1 count = 5 while 1: r, w, x = [self.sock], [], [] if select: r, w, x = select(r, w, x, tim... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if xid <> self.lastxid: | if xid != self.lastxid: | def dummy(): pass | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
if temp <> CALL: | if temp != CALL: | def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not ... | e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.