rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.fail("expected TypeError") | def test_intersection_update(self): try: self.set &= self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py | |
try: self.other & self.set self.fail("expected TypeError") except TypeError: pass try: self.set & self.other self.fail("expected TypeError") except TypeError: pass | self.assertRaises(TypeError, lambda: self.set & self.other) self.assertRaises(TypeError, lambda: self.other & self.set) | def test_intersection(self): try: self.other & self.set self.fail("expected TypeError") except TypeError: pass try: self.set & self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py |
self.fail("expected TypeError") | def test_sym_difference_update(self): try: self.set ^= self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py | |
try: self.other ^ self.set self.fail("expected TypeError") except TypeError: pass try: self.set ^ self.other self.fail("expected TypeError") except TypeError: pass | self.assertRaises(TypeError, lambda: self.set ^ self.other) self.assertRaises(TypeError, lambda: self.other ^ self.set) | def test_sym_difference(self): try: self.other ^ self.set self.fail("expected TypeError") except TypeError: pass try: self.set ^ self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py |
self.fail("expected TypeError") | def test_difference_update(self): try: self.set -= self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py | |
try: self.other - self.set self.fail("expected TypeError") except TypeError: pass try: self.set - self.other self.fail("expected TypeError") except TypeError: pass | self.assertRaises(TypeError, lambda: self.set - self.other) self.assertRaises(TypeError, lambda: self.other - self.set) | def test_difference(self): try: self.other - self.set self.fail("expected TypeError") except TypeError: pass try: self.set - self.other self.fail("expected TypeError") except TypeError: pass | 6cca754c2085e4eb203855b7d67df4a11ff0f534 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6cca754c2085e4eb203855b7d67df4a11ff0f534/test_sets.py |
makefile_in = os.path.join(exec_prefix, 'Modules', 'Makefile') | makefile_in = os.path.join(exec_prefix, 'Makefile') | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.p... | ffa5a5015a359045d7efb2c4cd0b5738c97b86ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ffa5a5015a359045d7efb2c4cd0b5738c97b86ce/freeze.py |
for key in makevars.keys(): somevars[key] = makevars[key] | for key in makevars.keys(): somevars[key] = makevars[key] | def main(): # overridable context prefix = None # settable with -p option exec_prefix = None # settable with -P option extensions = [] exclude = [] # settable with -x option addn_link = [] # settable with -l, but only honored under Windows. path = sys.p... | ffa5a5015a359045d7efb2c4cd0b5738c97b86ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ffa5a5015a359045d7efb2c4cd0b5738c97b86ce/freeze.py |
testclasses = (WichmannHill_TestBasicOps, | testclasses = [WichmannHill_TestBasicOps, | def test_main(verbose=None): testclasses = (WichmannHill_TestBasicOps, MersenneTwister_TestBasicOps, HardwareRandom_TestBasicOps, TestDistributions, TestModule) test_support.run_unittest(*testclasses) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [None] * 5 for i i... | b8717631561fec74cb1ab1963d918e53ead29a97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b8717631561fec74cb1ab1963d918e53ead29a97/test_random.py |
HardwareRandom_TestBasicOps, | def test_main(verbose=None): testclasses = (WichmannHill_TestBasicOps, MersenneTwister_TestBasicOps, HardwareRandom_TestBasicOps, TestDistributions, TestModule) test_support.run_unittest(*testclasses) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [None] * 5 for i i... | b8717631561fec74cb1ab1963d918e53ead29a97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b8717631561fec74cb1ab1963d918e53ead29a97/test_random.py | |
TestModule) | TestModule] if random._urandom is not None: testclasses.append(HardwareRandom_TestBasicOps) | def test_main(verbose=None): testclasses = (WichmannHill_TestBasicOps, MersenneTwister_TestBasicOps, HardwareRandom_TestBasicOps, TestDistributions, TestModule) test_support.run_unittest(*testclasses) # verify reference counting import sys if verbose and hasattr(sys, "gettotalrefcount"): counts = [None] * 5 for i i... | b8717631561fec74cb1ab1963d918e53ead29a97 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b8717631561fec74cb1ab1963d918e53ead29a97/test_random.py |
preprocessor=cc + " -E", | preprocessor=cpp, | def customize_compiler(compiler): """Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": (cc, opt, ccshared, ldshared, so_ext) = \ get_config_vars(... | 29c8623e5cdec2855ddbdec2c9c6305a8daa8fbd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/29c8623e5cdec2855ddbdec2c9c6305a8daa8fbd/sysconfig.py |
def visitLambda(self, node, parent): | def visitLambda(self, node, parent, assign=0): assert not assign | def visitLambda(self, node, parent): for n in node.defaults: self.visit(n, parent) scope = LambdaScope(self.module, self.klass) if parent.nested or isinstance(parent, FunctionScope): scope.nested = 1 self.scopes[node] = scope self._do_args(scope, node.argnames) self.visit(node.code, scope) self.handle_free_vars(scope, ... | ead21f596ce9c3f3ed3349bdf872182a1e930ca0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ead21f596ce9c3f3ed3349bdf872182a1e930ca0/symbols.py |
s = marshal.dumps(f) | s = marshal.dumps(f, 2) | def test_floats(self): # Test a few floats small = 1e-25 n = sys.maxint * 3.7e250 while n > small: for expected in (-n, n): f = float(expected) s = marshal.dumps(f) got = marshal.loads(s) self.assertEqual(f, got) marshal.dump(f, file(test_support.TESTFN, "wb")) got = marshal.load(file(test_support.TESTFN, "rb")) self.a... | df88846ebca9186514e86bc2067242233ade4608 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/df88846ebca9186514e86bc2067242233ade4608/test_marshal.py |
self.compile = None self.no_compile = None | self.compile = 0 | def initialize_options (self): | 3f1822b468efed725bf1d16d6d6d5b324573f0dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3f1822b468efed725bf1d16d6d6d5b324573f0dd/install.py |
filename = compiler.library_filename(libname, lib_type='shared') result = find_file(filename, std_dirs, paths) if result is not None: return result filename = compiler.library_filename(libname, lib_type='static') result = find_file(filename, std_dirs, paths) return result | result = compiler.find_library_file(std_dirs + paths, libname) if result is None: return None dirname = os.path.dirname(result) for p in std_dirs: if p.endswith(os.sep): p = p.strip(os.sep) if p == dirname: return [ ] for p in paths: if p.endswith(os.sep): p = p.strip(os.sep) if p == dirname: return [p] else: as... | def find_library_file(compiler, libname, std_dirs, paths): filename = compiler.library_filename(libname, lib_type='shared') result = find_file(filename, std_dirs, paths) if result is not None: return result filename = compiler.library_filename(libname, lib_type='static') result = find_file(filename, std_dirs, paths) r... | a246d9fefd729294e84a190f2e92cf4e4ff08f20 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a246d9fefd729294e84a190f2e92cf4e4ff08f20/setup.py |
access *: private | if 0: access *: private | def close(self): self._ensure_header_written() if self._nframeswritten != self._nframes or \ self._datalength != self._datawritten: self._patchheader() self._file.flush() self._file = None | f33a69f2739a2ad7968c0cada7577cbe130602b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f33a69f2739a2ad7968c0cada7577cbe130602b4/sunau.py |
def urlparse(url, scheme = '', allow_fragments = 1): | def urlparse(url, scheme='', allow_fragments=1): | def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand... | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py |
netloc = params = query = fragment = '' | netloc = query = fragment = '' | def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand... | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py |
if allow_fragments: i = url.rfind(' if i >= 0: fragment = url[i+1:] url = url[:i] i = url.find('?') if i >= 0: query = url[i+1:] url = url[:i] i = url.find(';') if i >= 0: params = url[i+1:] url = url[:i] tuple = scheme, netloc, url, params, query, fragment | if allow_fragments and ' url, fragment = url.split(' if '?' in url: url, query = url.split('?', 1) tuple = scheme, netloc, url, query, fragment | def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand... | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py |
if allow_fragments and scheme in uses_fragment: i = url.rfind(' if i >= 0: url, fragment = url[:i], url[i+1:] if scheme in uses_query: i = url.find('?') if i >= 0: url, query = url[:i], url[i+1:] if scheme in uses_params: i = url.find(';') if i >= 0: url, params = url[:i], url[i+1:] tuple = scheme, netloc, url, params,... | if allow_fragments and scheme in uses_fragment and ' url, fragment = url.split(' if scheme in uses_query and '?' in url: url, query = url.split('?', 1) tuple = scheme, netloc, url, query, fragment | def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: <scheme>://<netloc>/<path>;<params>?<query>#<fragment> Return a 6-tuple: (scheme, netloc, path, params, query, fragment). Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand... | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py |
if params: url = url + ';' + params | def urlunparse((scheme, netloc, url, params, query, fragment)): """Put a parsed URL back together again. This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).""" if netloc o... | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py | |
s, n, p, a, q, frag = urlparse(url) defrag = urlunparse((s, n, p, a, q, '')) return defrag, frag | if ' s, n, p, a, q, frag = urlparse(url) defrag = urlunparse((s, n, p, a, q, '')) return defrag, frag else: return url, '' | def urldefrag(url): """Removes any existing fragment from URL. Returns a tuple of the defragmented URL and the fragment. If the URL contained no fragments, the second element is the empty string. """ s, n, p, a, q, frag = urlparse(url) defrag = urlunparse((s, n, p, a, q, '')) return defrag, frag | 5751a22ede6a1c40f3926439e6c8368889f9b8d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5751a22ede6a1c40f3926439e6c8368889f9b8d2/urlparse.py |
assert re.sub('(?P<a>x)', '\g<a>\g<a>', 'xx') == 'xxxx' | assert re.sub('(?P<unk>x)', '\g<unk>\g<unk>', 'xx') == 'xxxx' | def bump_num(matchobj): | 9ec2ed466b5c1430f4980fcf0af1fe5e46adb25c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9ec2ed466b5c1430f4980fcf0af1fe5e46adb25c/test_re.py |
self._out.write('<?xml version="1.0" encoding="%s"?>\n' % | self._write('<?xml version="1.0" encoding="%s"?>\n' % | def startDocument(self): self._out.write('<?xml version="1.0" encoding="%s"?>\n' % self._encoding) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write('<' + name) | self._write('<' + name) | def startElement(self, name, attrs): self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') | self._write(' %s=%s' % (name, quoteattr(value))) self._write('>') | def startElement(self, name, attrs): self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write('</%s>' % name) | self._write('</%s>' % name) | def endElement(self, name): self._out.write('</%s>' % name) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write('<' + name) | self._write('<' + name) | def startElementNS(self, name, qname, attrs): if name[0] is None: # if the name was not namespace-scoped, use the unqualified part name = name[1] else: # else try to restore the original prefix from the namespace name = self._current_context[name[0]] + ":" + name[1] self._out.write('<' + name) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write(' xmlns:%s="%s"' % pair) | self._write(' xmlns:%s="%s"' % pair) | def startElementNS(self, name, qname, attrs): if name[0] is None: # if the name was not namespace-scoped, use the unqualified part name = name[1] else: # else try to restore the original prefix from the namespace name = self._current_context[name[0]] + ":" + name[1] self._out.write('<' + name) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') | self._write(' %s=%s' % (name, quoteattr(value))) self._write('>') | def startElementNS(self, name, qname, attrs): if name[0] is None: # if the name was not namespace-scoped, use the unqualified part name = name[1] else: # else try to restore the original prefix from the namespace name = self._current_context[name[0]] + ":" + name[1] self._out.write('<' + name) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write('</%s>' % name) | self._write('</%s>' % name) | def endElementNS(self, name, qname): if name[0] is None: name = name[1] else: name = self._current_context[name[0]] + ":" + name[1] self._out.write('</%s>' % name) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write(escape(content)) | self._write(escape(content)) | def characters(self, content): self._out.write(escape(content)) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write(content) | self._write(content) | def ignorableWhitespace(self, content): self._out.write(content) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
self._out.write('<?%s %s?>' % (target, data)) | self._write('<?%s %s?>' % (target, data)) | def processingInstruction(self, target, data): self._out.write('<?%s %s?>' % (target, data)) | ae20722d9619f0e2128d5e23f68c3d64db961bfd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ae20722d9619f0e2128d5e23f68c3d64db961bfd/saxutils.py |
def TemporaryFile(mode='w+b', bufsize=-1, suffix=""): """Create and return a temporary file (opened read-write by default).""" name = mktemp(suffix) if os.name == 'posix': # Unix -- be very careful fd = os.open(name, os.O_RDWR|os.O_CREAT|os.O_EXCL, 0700) try: os.unlink(name) return os.fdopen(fd, mode, bufsize) except: ... | c7349ee2c6863263eef4d48ee19f741e6d2244be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c7349ee2c6863263eef4d48ee19f741e6d2244be/tempfile.py | ||
if DEBUG: sys.stderr.write("%s<%s> at %s\n" % (" "*depth, name, point)) | dbgmsg("%s<%s> at %s" % (" "*depth, name, point)) | def pushing(name, point, depth): if DEBUG: sys.stderr.write("%s<%s> at %s\n" % (" "*depth, name, point)) | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py |
if DEBUG: sys.stderr.write("%s</%s> at %s\n" % (" "*depth, name, point)) | dbgmsg("%s</%s> at %s" % (" "*depth, name, point)) | def popping(name, point, depth): if DEBUG: sys.stderr.write("%s</%s> at %s\n" % (" "*depth, name, point)) | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py |
stack = [] line = self.line | def subconvert(self, endchar=None, depth=0): if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) stack = [] line = self.line while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py | |
elif envname == stack[-1]: | elif stack and envname == stack[-1]: | def subconvert(self, endchar=None, depth=0): if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) stack = [] line = self.line while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py |
def subconvert(self, endchar=None, depth=0): if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) stack = [] line = self.line while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py | ||
line = subconvert("}", depth + len(stack) + 2) | line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) | def subconvert(self, endchar=None, depth=0): if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) stack = [] line = self.line while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _c... | f79acbdaa1798eceb5e00ad32bbbfbf191333817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f79acbdaa1798eceb5e00ad32bbbfbf191333817/latex2esis.py |
explicitely. DEFAULT can be the relative path to a .ico file | explicitly. DEFAULT can be the relative path to a .ico file | def wm_iconbitmap(self, bitmap=None, default=None): """Set bitmap for the iconified widget to BITMAP. Return the bitmap if None is given. | 210262c0ec0356dfa7e8f0778783e678e8075a04 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/210262c0ec0356dfa7e8f0778783e678e8075a04/Tkinter.py |
if h[0] == 'P' and h[1] in '123456' and h[2] in ' \t\n\r': | if len(h) >= 3 and \ h[0] == 'P' and h[1] in '123456' and h[2] in ' \t\n\r': | def test_pnm(h, f): # PBM, PGM, PPM (portable {bit,gray,pix}map; together portable anymap) if h[0] == 'P' and h[1] in '123456' and h[2] in ' \t\n\r': return 'pnm' | 05b55e76f07805af719f53d9c832871774a855aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05b55e76f07805af719f53d9c832871774a855aa/imghdr.py |
ic.launcurl(url) | ic.launchurl(url) | def open(self, url, new=0): ic.launcurl(url) | 2595a837b5b536bd850660e8337a96116eccf80a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2595a837b5b536bd850660e8337a96116eccf80a/webbrowser.py |
return self.parser.names | if self.parser: return self.parser.names else: return [] | def getnames(self): return self.parser.names | 84306246f1d9a70b887881e029a082aab8db9211 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/84306246f1d9a70b887881e029a082aab8db9211/webchecker.py |
def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename)[stat.ST_MTIME] lastupdate, result = cache.get(filename, (0, None)) # XXX what if ext is 'rb' type in imp_getsuffixes? if lastupdate < mtime: file = open(filename) line = file.readline() while line[:1] == '#'... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py | ||
line = file.readline() while line[:1] == ' | if info and 'b' in info[2]: try: module = imp.load_module(info[0], file, filename, info[1:]) except: return None result = split(module.__doc__ or '', '\n')[0] else: | def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename)[stat.ST_MTIME] lastupdate, result = cache.get(filename, (0, None)) # XXX what if ext is 'rb' type in imp_getsuffixes? if lastupdate < mtime: file = open(filename) line = file.readline() while line[:1] == '#'... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if not line: break if line[-2:] == '\\\n': line = line[:-2] + file.readline() line = strip(line) if line[:3] == '"""': line = line[3:] while strip(line) == '': | while line[:1] == ' | def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename)[stat.ST_MTIME] lastupdate, result = cache.get(filename, (0, None)) # XXX what if ext is 'rb' type in imp_getsuffixes? if lastupdate < mtime: file = open(filename) line = file.readline() while line[:1] == '#'... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
result = strip(split(line, '"""')[0]) else: result = None | line = strip(line) if line[:4] == 'r"""': line = line[1:] if line[:3] == '"""': line = line[3:] if line[-1:] == '\\': line = line[:-1] while not strip(line): line = file.readline() if not line: break result = strip(split(line, '"""')[0]) else: result = None | def synopsis(filename, cache={}): """Get the one-line summary out of a module file.""" mtime = os.stat(filename)[stat.ST_MTIME] lastupdate, result = cache.get(filename, (0, None)) # XXX what if ext is 'rb' type in imp_getsuffixes? if lastupdate < mtime: file = open(filename) line = file.readline() while line[:1] == '#'... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent, so we need an example. for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '>', text) return text | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py | ||
def modulename(path): """Return the Python module name for a given path, or None.""" filename = os.path.basename(path) suffixes = map(lambda (suffix, mode, kind): (len(suffix), suffix), imp.get_suffixes()) suffixes.sort() suffixes.reverse() for length, suffix in suffixes: if len(filename) > length and filename[-length... | def stripid(text): """Remove the hexadecimal id from a Python object representation.""" # The behaviour of %p is implementation-dependent, so we need an example. for pattern in [' at 0x[0-9a-f]{6,}>$', ' at [0-9A-F]{8,}>$']: if re.search(pattern, repr(Exception)): return re.sub(pattern, '>', text) return text | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py | |
return re.sub(r'((\\[\\abfnrtv\'"]|\\x..|\\u....)+)', | return re.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)', | def repr_string(self, x, level): test = cram(x, self.maxstring) testrepr = repr(test) if '\\' in test and '\\' not in replace(testrepr, (r'\\', '')): # Backslashes are only literal in the string and are never # needed to make any special characters, so show a raw string. return 'r' + testrepr[0] + self.escape(test) + t... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
def section(self, title, fgcol, bgcol, contents, width=20, | def section(self, title, fgcol, bgcol, contents, width=10, | def section(self, title, fgcol, bgcol, contents, width=20, prelude='', marginalia=None, gap=' '): """Format a section with a heading.""" if marginalia is None: marginalia = ' ' * width result = ''' | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
marginalia = ' ' * width | marginalia = '<tt>' + ' ' * width + '</tt>' | def section(self, title, fgcol, bgcol, contents, width=20, prelude='', marginalia=None, gap=' '): """Format a section with a heading.""" if marginalia is None: marginalia = ' ' * width result = ''' | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
return result + '<td width="100%%">%s</td></tr></table>' % contents | return result + '\n<td width="100%%">%s</td></tr></table>' % contents | def section(self, title, fgcol, bgcol, contents, width=20, prelude='', marginalia=None, gap=' '): """Format a section with a heading.""" if marginalia is None: marginalia = ' ' * width result = ''' | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if 0 and hasattr(object, '__all__'): visible = lambda key, all=object.__all__: key in all else: visible = lambda key: key[:1] != '_' | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) l... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py | |
if visible(key) and ( inspect.getmodule(value) or object) is object: | if (inspect.getmodule(value) or object) is object: | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) l... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if visible(key) and (inspect.isbuiltin(value) or inspect.getmodule(value) is object): | if inspect.isbuiltin(value) or inspect.getmodule(value) is object: | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) l... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if visible(key): constants.append((key, value)) | constants.append((key, value)) | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) l... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if file[:1] != '_': path = os.path.join(object.__path__[0], file) modname = modulename(file) if modname and modname not in modnames: modpkgs.append((modname, name, 0, 0)) modnames.append(modname) elif ispackage(path): modpkgs.append((file, name, 1, 0)) | path = os.path.join(object.__path__[0], file) modname = inspect.getmodulename(file) if modname and modname not in modnames: modpkgs.append((modname, name, 0, 0)) modnames.append(modname) elif ispackage(path): modpkgs.append((file, name, 1, 0)) | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) l... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
doc = self.small(doc and '<tt>%s<br> </tt>' % doc or '<tt> </tt>') return self.section(title, ' | doc = self.small(doc and '<tt>%s<br> </tt>' % doc or self.small(' ')) return self.section(title, ' | def docclass(self, object, name=None, funcs={}, classes={}): """Produce HTML documentation for a class object.""" realname = object.__name__ name = name or realname bases = object.__bases__ contents = '' | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
doc = doc and '<tt>%s</tt>' % doc return '<dl><dt>%s<dd>%s</dl>\n' % (decl, self.small(doc)) | doc = doc and '<dd>' + self.small('<tt>%s</tt>' % doc) return '<dl><dt>%s%s</dl>\n' % (decl, doc) | def docroutine(self, object, name=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name note = '' skipdocs = 0 if inspect.ismethod(object): if cl: if object.i... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if file[:1] != '_' and os.path.isfile(path): modname = modulename(file) | if os.path.isfile(path): modname = inspect.getmodulename(file) | def found(name, ispackage, modpkgs=modpkgs, shadowed=shadowed, seen=seen): if not seen.has_key(name): modpkgs.append((name, '', ispackage, shadowed.has_key(name))) seen[name] = 1 shadowed[name] = 1 | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
namesec = name lines = split(strip(getdoc(object)), '\n') if len(lines) == 1: if lines[0]: namesec = namesec + ' - ' + lines[0] lines = [] elif len(lines) >= 2 and not rstrip(lines[1]): if lines[0]: namesec = namesec + ' - ' + lines[0] lines = lines[2:] result = self.section('NAME', namesec) | synop, desc = splitdoc(getdoc(object)) result = self.section('NAME', name + (synop and ' - ' + synop)) | def docmodule(self, object, name=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name namesec = name lines = split(strip(getdoc(object)), '\n') if len(lines) == 1: if lines[0]: namesec = namesec + ' - ' + lines[0] lines = [] elif len(lines) >= 2 and not r... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if lines: result = result + self.section('DESCRIPTION', join(lines, '\n')) | if desc: result = result + self.section('DESCRIPTION', desc) | def docmodule(self, object, name=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name namesec = name lines = split(strip(getdoc(object)), '\n') if len(lines) == 1: if lines[0]: namesec = namesec + ' - ' + lines[0] lines = [] elif len(lines) >= 2 and not r... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if key[:1] != '_': constants.append((key, value)) | constants.append((key, value)) | def docmodule(self, object, name=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name namesec = name lines = split(strip(getdoc(object)), '\n') if len(lines) == 1: if lines[0]: namesec = namesec + ' - ' + lines[0] lines = [] elif len(lines) >= 2 and not r... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if file[:1] != '_': path = os.path.join(object.__path__[0], file) modname = modulename(file) if modname and modname not in modpkgs: modpkgs.append(modname) elif ispackage(path): modpkgs.append(file + ' (package)') | path = os.path.join(object.__path__[0], file) modname = inspect.getmodulename(file) if modname and modname not in modpkgs: modpkgs.append(modname) elif ispackage(path): modpkgs.append(file + ' (package)') | def docmodule(self, object, name=None): """Produce text documentation for a given module object.""" name = object.__name__ # ignore the passed-in name namesec = name lines = split(strip(getdoc(object)), '\n') if len(lines) == 1: if lines[0]: namesec = namesec + ' - ' + lines[0] lines = [] elif len(lines) >= 2 and not r... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
return lambda a: pipepager(a, os.environ['PAGER']) | if sys.platform == 'win32': return lambda a: tempfilepager(a, os.environ['PAGER']) else: return lambda a: pipepager(a, os.environ['PAGER']) | def getpager(): """Decide what method to use for paging through text.""" if type(sys.stdout) is not types.FileType: return plainpager if not sys.stdin.isatty() or not sys.stdout.isatty(): return plainpager if os.environ.has_key('PAGER'): return lambda a: pipepager(a, os.environ['PAGER']) if sys.platform == 'win32': ret... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
raise DocImportError(filename, sys.exc_info()) | raise ErrorDuringImport(filename, 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... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
page = html.page('Python: ' + describe(object), | page = html.page(describe(object), | def writedoc(key): """Write HTML documentation to a file in the current directory.""" try: object = locate(key) except ErrorDuringImport, value: print value else: if object: page = html.page('Python: ' + describe(object), html.document(object, object.__name__)) file = open(key + '.html', 'w') file.write(page) file.clos... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
modname = modulename(path) | modname = inspect.getmodulename(path) | def writedocs(dir, pkgpath='', done={}): """Write out HTML documentation for all modules in a directory tree.""" for file in os.listdir(dir): path = os.path.join(dir, file) if ispackage(path): writedocs(path, pkgpath + file + '.') elif os.path.isfile(path): modname = modulename(path) if modname: modname = pkgpath + mod... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
modname = modulename(path) | modname = inspect.getmodulename(path) | def run(self, key, callback, completer=None): self.quit = 0 seen = {} | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
print modname, '-', desc or '(no description)' | print modname, desc and '- ' + desc try: import warnings except ImportError: pass else: warnings.filterwarnings('ignore') | def callback(path, modname, desc): if modname[-9:] == '.__init__': modname = modname[:-9] + ' (package)' print modname, '-', desc or '(no description)' | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
try: import ic ic.launchurl(url) | try: import ic | def open(self, event=None, url=None): url = url or self.server.url try: import webbrowser webbrowser.open(url) except ImportError: # pre-webbrowser.py compatibility if sys.platform == 'win32': os.system('start "%s"' % url) elif sys.platform == 'mac': try: import ic ic.launchurl(url) except ImportError: pass else: rc = ... | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
Pop up a graphical interface for serving and finding documentation. | Pop up a graphical interface for finding and serving documentation. | def ready(server): print 'server ready at %s' % server.url | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
directory. If <name> contains a '%s', it is treated as a filename. | directory. If <name> contains a '%s', it is treated as a filename; if it names a directory, documentation is written for all the contents. | def ready(server): print 'server ready at %s' % server.url | 5a804edd3cacf2a790ff3c872adad22f95e7a604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5a804edd3cacf2a790ff3c872adad22f95e7a604/pydoc.py |
if _os.name != 'posix': | if _os.name != 'posix' or _os.sys.platform == 'cygwin': | def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="", prefix=template, dir=gettempdir()): """Create and return a temporary file. Arguments: 'prefix', 'suffix', 'dir' -- as for mkstemp. 'mode' -- the mode argument to os.fdopen (default "w+b"). 'bufsize' -- the buffer size argument to os.fdopen (default -1). The file... | 80c02af345d0f85be06422915394bbacfbd87bdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/80c02af345d0f85be06422915394bbacfbd87bdb/tempfile.py |
def open_https(self, url): | def open_https(self, url, data=None): | def open_https(self, url): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, realhost = s... | 141e9894b7818daa06773d50705d7c64d298f9d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/141e9894b7818daa06773d50705d7c64d298f9d8/urllib.py |
h.putrequest('GET', selector) | if data is not None: h.putrequest('POST', selector) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', selector) | def open_https(self, url): """Use HTTPS protocol.""" import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) else: host, selector = url urltype, rest = splittype(selector) if string.lower(urltype) == 'https': realhost, rest = splithost(rest) user_passwd, realhost = s... | 141e9894b7818daa06773d50705d7c64d298f9d8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/141e9894b7818daa06773d50705d7c64d298f9d8/urllib.py |
ld_args.extend (extra_postargs) | ld_args.extend(extra_postargs) | def link_shared_object (self, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): | 159eb92239c20198e9318acbe142ab3e168aae4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/159eb92239c20198e9318acbe142ab3e168aae4b/msvccompiler.py |
msgbuf = "" | msgbuf = [] | def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. | 42dd01add5cc53dc5a5eab46b04b44c8ef6c969f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42dd01add5cc53dc5a5eab46b04b44c8ef6c969f/httplib.py |
msgbuf = msgbuf + self.__ssl.read() | buf = self.__ssl.read() | def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. | 42dd01add5cc53dc5a5eab46b04b44c8ef6c969f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42dd01add5cc53dc5a5eab46b04b44c8ef6c969f/httplib.py |
return StringIO(msgbuf) | if buf == '': break msgbuf.append(buf) return StringIO("".join(msgbuf)) | def makefile(self, mode, bufsize=None): """Return a readable file-like object with data from socket. | 42dd01add5cc53dc5a5eab46b04b44c8ef6c969f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/42dd01add5cc53dc5a5eab46b04b44c8ef6c969f/httplib.py |
if inst.poll(_deadstate=sys.maxint) >= 0: | res = inst.poll(_deadstate=sys.maxint) if res is not None and res >= 0: | def _cleanup(): for inst in _active[:]: if inst.poll(_deadstate=sys.maxint) >= 0: try: _active.remove(inst) except ValueError: # This can happen if two threads create a new Popen instance. # It's harmless that it was already removed, so ignore. pass | b5d47efe92fd12cde1de6a473108ef48238a43cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b5d47efe92fd12cde1de6a473108ef48238a43cc/subprocess.py |
"""execv(file, args, env) | """execvpe(file, args, env) | def execvpe(file, args, env): """execv(file, args, env) Execute the executable file (which is searched for along $PATH) with argument list args and environment env , replacing the current process. args may be a list or tuple of strings. """ _execvpe(file, args, env) | 683c0fe41430d66e329279e164912cea62170f0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/683c0fe41430d66e329279e164912cea62170f0a/os.py |
except error, (errno, msg): if errno != ENOENT and errno != ENOTDIR: raise raise error, (errno, msg) | except error, e: tb = sys.exc_info()[2] if (e.errno != ENOENT and e.errno != ENOTDIR and saved_exc is None): saved_exc = e saved_tb = tb if saved_exc: raise error, saved_exc, saved_tb raise error, e, tb | def _execvpe(file, args, env=None): from errno import ENOENT, ENOTDIR if env is not None: func = execve argrest = (args, env) else: func = execv argrest = (args,) env = environ head, tail = path.split(file) if head: apply(func, (file,) + argrest) return if 'PATH' in env: envpath = env['PATH'] else: envpath = defpath ... | 683c0fe41430d66e329279e164912cea62170f0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/683c0fe41430d66e329279e164912cea62170f0a/os.py |
def _test(): | def test_main(): | def _test(): threads = [] print "Creating" for i in range(NUM_THREADS): t = TempFileGreedy() threads.append(t) t.start() print "Starting" startEvent.set() print "Reaping" ok = errors = 0 for t in threads: t.join() ok += t.ok_count errors += t.error_count if t.error_count: print '%s errors:\n%s' % (t.getName(), t.err... | d8a9d2a0e964d1018f1ba4fa3857a3f061a24137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8a9d2a0e964d1018f1ba4fa3857a3f061a24137/test_threadedtempfile.py |
_test() | test_main() | def _test(): threads = [] print "Creating" for i in range(NUM_THREADS): t = TempFileGreedy() threads.append(t) t.start() print "Starting" startEvent.set() print "Reaping" ok = errors = 0 for t in threads: t.join() ok += t.ok_count errors += t.error_count if t.error_count: print '%s errors:\n%s' % (t.getName(), t.err... | d8a9d2a0e964d1018f1ba4fa3857a3f061a24137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8a9d2a0e964d1018f1ba4fa3857a3f061a24137/test_threadedtempfile.py |
print_lines is the default callback.''' | print_line() is the default callback.''' | 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_lines is the default callback.''' if not callback: callback = print_line re... | d5f173bf1f215ce156805545ff20e0d764162e89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d5f173bf1f215ce156805545ff20e0d764162e89/ftplib.py |
self.botframe = frame | self.botframe = frame.f_back | def dispatch_call(self, frame, arg): # XXX 'arg' is no longer used if self.botframe is None: # First call of dispatch since reset() self.botframe = frame return self.trace_dispatch if not (self.stop_here(frame) or self.break_anywhere(frame)): # No need to trace this function return # None self.user_call(frame, arg) if ... | 313a7513b0c5771042d850d70782a2448d1cdcb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/313a7513b0c5771042d850d70782a2448d1cdcb7/bdb.py |
if self.stopframe is None: return True | def stop_here(self, frame): if self.stopframe is None: return True if frame is self.stopframe: return True while frame is not None and frame is not self.stopframe: if frame is self.botframe: return True frame = frame.f_back return False | 313a7513b0c5771042d850d70782a2448d1cdcb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/313a7513b0c5771042d850d70782a2448d1cdcb7/bdb.py | |
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back | frame = sys._getframe().f_back | def set_trace(self): """Start debugging from here.""" try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back self.reset() while frame: frame.f_trace = self.trace_dispatch self.botframe = frame frame = frame.f_back self.set_step() sys.settrace(self.trace_dispatch) | 313a7513b0c5771042d850d70782a2448d1cdcb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/313a7513b0c5771042d850d70782a2448d1cdcb7/bdb.py |
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back | frame = sys._getframe().f_back | def set_continue(self): # Don't stop except at breakpoints or when finished self.stopframe = self.botframe self.returnframe = None self.quitting = 0 if not self.breaks: # no breakpoints; run without debugger overhead sys.settrace(None) try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back while frame a... | 313a7513b0c5771042d850d70782a2448d1cdcb7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/313a7513b0c5771042d850d70782a2448d1cdcb7/bdb.py |
if platform in ['cygwin', 'aix4']: | data = open('pyconfig.h').read() m = re.search(r" if m is not None: | 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') | 19d173486b2263a269260343d65ac3929c89297e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/19d173486b2263a269260343d65ac3929c89297e/setup.py |
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called... | d7ce86dcab78d3fef32bb8fff23e84cf9df628db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d7ce86dcab78d3fef32bb8fff23e84cf9df628db/trace.py | ||
thingie = pickle.load(open(self.infile, 'r')) if isinstance(thingie, dict): self.update(self.__class__(thingie)) elif isinstance(thingie, tuple) and len(thingie) == 2: counts, calledfuncs = thingie self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError), err: | counts, calledfuncs = pickle.load(open(self.infile, 'r')) self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError, ValueError), err: | def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.called... | d7ce86dcab78d3fef32bb8fff23e84cf9df628db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d7ce86dcab78d3fef32bb8fff23e84cf9df628db/trace.py |
if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) | if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), 'file:'+file) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfourl(open(url2pathname(file), 'r... | b030bc026eb57861568fdc9310512185c95a6f11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b030bc026eb57861568fdc9310512185c95a6f11/urllib.py |
return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) | return addinfourl(open(url2pathname(file), 'r'), noheaders(), 'file:'+file) | def open_local_file(self, url): host, file = splithost(url) if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfourl(open(url2pathname(file), 'r... | b030bc026eb57861568fdc9310512185c95a6f11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b030bc026eb57861568fdc9310512185c95a6f11/urllib.py |
self.assertRaises(TypeError, setattr, X.x, "offset", 92) self.assertRaises(TypeError, setattr, X.x, "size", 92) | self.assertRaises(AttributeError, setattr, X.x, "offset", 92) self.assertRaises(AttributeError, setattr, X.x, "size", 92) | def test_fields(self): # test the offset and size attributes of Structure/Unoin fields. class X(Structure): _fields_ = [("x", c_int), ("y", c_char)] | ecc3e67b986a1eed404b528ccbc099049c149edb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ecc3e67b986a1eed404b528ccbc099049c149edb/test_structures.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.