rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
class HTTPDigestAuthHandler(BaseHandler): """An authentication protocol defined by RFC 2069 Digest authentication improves on basic authentication because it does not transmit passwords in the clear. """ def __init__(self): self.passwd = HTTPPasswordMgr()
class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): header = 'Authorization' def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] return self.http_error_auth_reqed('www-authenticate', host, req, headers) class ProxyBasicAuthHandler(AbstractBasicAuthHa...
def retry_http_basic_auth(self, req, realm): if self.__current_realm is None: self.__current_realm = realm else: self.__current_realm = realm return None # XXX host isn't really the correct URI? host = req.get_host() user,pw = self.passwd.find_user_password(realm, host) if pw: raw = "%s:%s" % (user, pw) auth = base64.e...
8a18e99008c28156a7ba701ca8d6824a50fb0a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a18e99008c28156a7ba701ca8d6824a50fb0a9e/urllib2.py
def http_error_401(self, req, fp, code, msg, headers): authreq = headers.get('www-authenticate', None)
def http_error_auth_reqed(self, authreq, host, req, headers): authreq = headers.get(self.header, None)
def http_error_401(self, req, fp, code, msg, headers): # XXX could be mult. headers authreq = headers.get('www-authenticate', None) if authreq: kind = authreq.split()[0] if kind == 'Digest': return self.retry_http_digest_auth(req, authreq)
8a18e99008c28156a7ba701ca8d6824a50fb0a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a18e99008c28156a7ba701ca8d6824a50fb0a9e/urllib2.py
req.add_header('Authorization', 'Digest %s' % auth)
req.add_header(self.header, 'Digest %s' % auth)
def retry_http_digest_auth(self, req, auth): token, challenge = auth.split(' ', 1) chal = parse_keqv_list(parse_http_list(challenge)) auth = self.get_authorization(req, chal) if auth: req.add_header('Authorization', 'Digest %s' % auth) resp = self.parent.open(req) self.__current_realm = None return resp
8a18e99008c28156a7ba701ca8d6824a50fb0a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a18e99008c28156a7ba701ca8d6824a50fb0a9e/urllib2.py
class HTTPHandler(BaseHandler): def http_open(self, req):
class AbstractHTTPHandler(BaseHandler): def do_open(self, http_class, req):
def encode_digest(digest): hexrep = [] for c in digest: n = (ord(c) >> 4) & 0xf hexrep.append(hex(n)[-1]) n = ord(c) & 0xf hexrep.append(hex(n)[-1]) return ''.join(hexrep)
8a18e99008c28156a7ba701ca8d6824a50fb0a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a18e99008c28156a7ba701ca8d6824a50fb0a9e/urllib2.py
h = httplib.HTTP(host)
h = http_class(host)
def http_open(self, req): # XXX devise a new mechanism to specify user/password host = req.get_host() if not host: raise URLError('no host given')
8a18e99008c28156a7ba701ca8d6824a50fb0a9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8a18e99008c28156a7ba701ca8d6824a50fb0a9e/urllib2.py
print
def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spaces in the section names serves as a regression test for # SourceForge bug #115357. # ...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print L for s in L: print "%s: %s" % (s, cf.options(s))
verify(L == ['Commented Bar', 'Foo Bar', 'Internationalized Stuff', 'Spacey Bar'], "unexpected list of section names")
def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spaces in the section names serves as a regression test for # SourceForge bug #115357. # ...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print `cf.get('Foo Bar', 'foo', raw=1)` print `cf.get('Spacey Bar', 'foo', raw=1)` print `cf.get('Commented Bar', 'foo', raw=1)`
verify(cf.get('Foo Bar', 'foo', raw=1) == 'bar') verify(cf.get('Spacey Bar', 'foo', raw=1) == 'bar') verify(cf.get('Commented Bar', 'foo', raw=1) == 'bar')
def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spaces in the section names serves as a regression test for # SourceForge bug #115357. # ...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
if '__name__' in cf.options("Foo Bar"): print '__name__ "option" should not be exposed by the API!' else: print '__name__ "option" properly hidden by the API.'
verify('__name__' not in cf.options("Foo Bar"), '__name__ "option" should not be exposed by the API!')
def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spaces in the section names serves as a regression test for # SourceForge bug #115357. # ...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
if not cf.remove_option('Foo Bar', 'foo'): raise TestFailed( "remove_option() failed to report existance of option") if cf.has_option('Foo Bar', 'foo'): raise TestFailed("remove_option() failed to remove option") if cf.remove_option('Foo Bar', 'foo'): raise TestFailed( "remove_option() failed to report non-existance of...
verify(cf.remove_option('Foo Bar', 'foo'), "remove_option() failed to report existance of option") verify(not cf.has_option('Foo Bar', 'foo'), "remove_option() failed to remove option") verify(not cf.remove_option('Foo Bar', 'foo'), "remove_option() failed to report non-existance of option" " that was removed")
def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spaces in the section names serves as a regression test for # SourceForge bug #115357. # ...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print
def interpolation(src): print print "Testing value interpolation..." cf = ConfigParser.ConfigParser({"getname": "%(__name__)s"}) sio = StringIO.StringIO(src) cf.readfp(sio) print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")` expect_get_error(cf, Con...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")`
verify(cf.get("Foo", "getname") == "Foo") verify(cf.get("Foo", "bar") == "something with interpolation (1 step)") verify(cf.get("Foo", "bar9") == "something with lots of interpolation (9 steps)") verify(cf.get("Foo", "bar10") == "something with lots of interpolation (10 steps)")
def interpolation(src): print print "Testing value interpolation..." cf = ConfigParser.ConfigParser({"getname": "%(__name__)s"}) sio = StringIO.StringIO(src) cf.readfp(sio) print `cf.get("Foo", "getname")` print `cf.get("Foo", "bar")` print `cf.get("Foo", "bar9")` print `cf.get("Foo", "bar10")` expect_get_error(cf, Con...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print print "Testing for parsing errors..."
print "Testing parse errors..."
def parse_errors(): print print "Testing for parsing errors..." expect_parse_error(ConfigParser.ParsingError, """[Foo]\n extra-spaces: splat\n""") expect_parse_error(ConfigParser.ParsingError, """[Foo]\n extra-spaces= splat\n""") expect_parse_error(ConfigParser.ParsingError, """[Foo]\noption-without-value\n""") expec...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo")
verify(cf.sections() == [], "new ConfigParser should have no defined sections") verify(not cf.has_section("Foo"), "new ConfigParser should have no acknowledged sections")
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Caught expected NoSectionError:", e
pass
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Failed to catch expected NoSectionError from options()"
raise TestFailed( "Failed to catch expected NoSectionError from options()")
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Caught expected NoSectionError:", e
pass
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Failed to catch expected NoSectionError from set()"
raise TestFailed("Failed to catch expected NoSectionError from set()")
def query_errors(): print print "Testing query interface..." cf = ConfigParser.ConfigParser() print cf.sections() print "Has section 'Foo'?", cf.has_section("Foo") try: cf.options("Foo") except ConfigParser.NoSectionError, e: print "Caught expected NoSectionError:", e else: print "Failed to catch expected NoSectionErro...
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print
def weird_errors(): print print "Testing miscellaneous error conditions..." cf = ConfigParser.ConfigParser() cf.add_section("Foo") try: cf.add_section("Foo") except ConfigParser.DuplicateSectionError, e: print "Caught expected DuplicateSectionError:", e else: print "Failed to catch expected DuplicateSectionError"
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Caught expected DuplicateSectionError:", e
pass
def weird_errors(): print print "Testing miscellaneous error conditions..." cf = ConfigParser.ConfigParser() cf.add_section("Foo") try: cf.add_section("Foo") except ConfigParser.DuplicateSectionError, e: print "Caught expected DuplicateSectionError:", e else: print "Failed to catch expected DuplicateSectionError"
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Failed to catch expected DuplicateSectionError"
raise TestFailed("Failed to catch expected DuplicateSectionError")
def weird_errors(): print print "Testing miscellaneous error conditions..." cf = ConfigParser.ConfigParser() cf.add_section("Foo") try: cf.add_section("Foo") except ConfigParser.DuplicateSectionError, e: print "Caught expected DuplicateSectionError:", e else: print "Failed to catch expected DuplicateSectionError"
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Caught expected", exctype.__name__, ":" print e
pass
def expect_get_error(cf, exctype, section, option, raw=0): try: cf.get(section, option, raw=raw) except exctype, e: print "Caught expected", exctype.__name__, ":" print e else: print "Failed to catch expected", exctype.__name__
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Failed to catch expected", exctype.__name__
raise TestFailed("Failed to catch expected " + exctype.__name__)
def expect_get_error(cf, exctype, section, option, raw=0): try: cf.get(section, option, raw=raw) except exctype, e: print "Caught expected", exctype.__name__, ":" print e else: print "Failed to catch expected", exctype.__name__
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Caught expected exception:", e
pass
def expect_parse_error(exctype, src): cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) try: cf.readfp(sio) except exctype, e: print "Caught expected exception:", e else: print "Failed to catch expected", exctype.__name__
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
print "Failed to catch expected", exctype.__name__
raise TestFailed("Failed to catch expected " + exctype.__name__)
def expect_parse_error(exctype, src): cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) try: cf.readfp(sio) except exctype, e: print "Caught expected exception:", e else: print "Failed to catch expected", exctype.__name__
95b96d3941b739017f69b8ac695ca1ac25073a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/95b96d3941b739017f69b8ac695ca1ac25073a55/test_cfgparser.py
import StringIO f = StringIO.StringIO(s) g = StringIO.StringIO() encode(f, g) return g.getvalue()
pieces = [] for i in range(0, len(s), MAXBINSIZE): chunk = s[i : i + MAXBINSIZE] pieces.append(binascii.b2a_base64(chunk)) return "".join(pieces)
def encodestring(s): """Encode a string.""" import StringIO f = StringIO.StringIO(s) g = StringIO.StringIO() encode(f, g) return g.getvalue()
fbb2b4c4a5f38f8337f637b31300eb218608d050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbb2b4c4a5f38f8337f637b31300eb218608d050/base64.py
import StringIO f = StringIO.StringIO(s) g = StringIO.StringIO() decode(f, g) return g.getvalue()
return binascii.a2b_base64(s)
def decodestring(s): """Decode a string.""" import StringIO f = StringIO.StringIO(s) g = StringIO.StringIO() decode(f, g) return g.getvalue()
fbb2b4c4a5f38f8337f637b31300eb218608d050 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fbb2b4c4a5f38f8337f637b31300eb218608d050/base64.py
self.checkequal(('http://www.python.org', '', ''), S, 'rpartition', '?')
self.checkequal(('', '', 'http://www.python.org'), S, 'rpartition', '?')
def test_rpartition(self):
29a5fdb7caf372144a085247d63440d1abb51b5c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/29a5fdb7caf372144a085247d63440d1abb51b5c/string_tests.py
name = alogger.name namelen = len(name)
def _fixupChildren(self, ph, alogger): """ Ensure that children of the placeholder ph are connected to the specified logger. """ #for c in ph.loggers: for c in ph.loggerMap.keys(): if string.find(c.parent.name, alogger.name) <> 0: alogger.parent = c.parent c.parent = alogger
ef7f3bf3b306cf8702496cb8ac2c7afdcf1b2fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef7f3bf3b306cf8702496cb8ac2c7afdcf1b2fdb/__init__.py
if string.find(c.parent.name, alogger.name) <> 0:
if c.parent.name[:namelen] != name:
def _fixupChildren(self, ph, alogger): """ Ensure that children of the placeholder ph are connected to the specified logger. """ #for c in ph.loggers: for c in ph.loggerMap.keys(): if string.find(c.parent.name, alogger.name) <> 0: alogger.parent = c.parent c.parent = alogger
ef7f3bf3b306cf8702496cb8ac2c7afdcf1b2fdb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ef7f3bf3b306cf8702496cb8ac2c7afdcf1b2fdb/__init__.py
if lastcs is not None: if nextcs is None or nextcs == 'us-ascii':
if lastcs not in (None, 'us-ascii'): if nextcs in (None, 'us-ascii'):
def __unicode__(self): """Helper for the built-in unicode function.""" uchunks = [] lastcs = None for s, charset in self._chunks: # We must preserve spaces between encoded and non-encoded word # boundaries, which means for us we need to add a space when we go # from a charset to None/us-ascii, or from None/us-ascii to ...
ba1548a7362aecf4c94523579486fed62de12d15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba1548a7362aecf4c94523579486fed62de12d15/Header.py
elif nextcs is not None and nextcs <> 'us-ascii':
elif nextcs not in (None, 'us-ascii'):
def __unicode__(self): """Helper for the built-in unicode function.""" uchunks = [] lastcs = None for s, charset in self._chunks: # We must preserve spaces between encoded and non-encoded word # boundaries, which means for us we need to add a space when we go # from a charset to None/us-ascii, or from None/us-ascii to ...
ba1548a7362aecf4c94523579486fed62de12d15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba1548a7362aecf4c94523579486fed62de12d15/Header.py
self.file = self.sock.makefile('r')
self.file = self.sock.makefile('rb')
def open(self, host, port): """Setup connection to remote server on "host:port". This connection will be used by the routines: read, readline, send, shutdown. """ self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((self.host, self.port)) self.file = self.sock.makefile('r')
c0f1bfec05fcbd44390156f07008dc90f25ef487 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c0f1bfec05fcbd44390156f07008dc90f25ef487/imaplib.py
socket.SOL_SOCKET, socket.SO_REUSEADDR,
socket.SOL_SOCKET, reuse_constant,
def set_reuse_addr(self): # try to re-use a server port if possible try: self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: pass
5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d/asyncore.py
socket.SO_REUSEADDR) | 1
reuse_constant) | 1
def set_reuse_addr(self): # try to re-use a server port if possible try: self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: pass
5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d/asyncore.py
def set_reuse_addr(self): # try to re-use a server port if possible try: self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR) | 1 ) except socket.error: pass
5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5336f8caa4ed6d3777183f8b0ab1fc81db3eec3d/asyncore.py
inst.poll()
if inst.poll(_deadstate=sys.maxint) >= 0: try: _active.remove(inst) except ValueError: pass
def _cleanup(): for inst in _active[:]: inst.poll()
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
_active.append(self)
def __init__(self, args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0): """Create new Popen instance.""" _cleanup()
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
def poll(self):
def poll(self, _deadstate=None):
def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode is None: if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0: self.returncode = GetExitCodeProcess(self._handle) _active.remove(self) return self.returncode
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
_active.remove(self)
def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode is None: if WaitForSingleObject(self._handle, 0) == WAIT_OBJECT_0: self.returncode = GetExitCodeProcess(self._handle) _active.remove(self) return self.returncode
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
_active.remove(self)
def wait(self): """Wait for child process to terminate. Returns returncode attribute.""" if self.returncode is None: obj = WaitForSingleObject(self._handle, INFINITE) self.returncode = GetExitCodeProcess(self._handle) _active.remove(self) return self.returncode
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
_active.remove(self) def poll(self):
def poll(self, _deadstate=None):
def _handle_exitstatus(self, sts): if os.WIFSIGNALED(sts): self.returncode = -os.WTERMSIG(sts) elif os.WIFEXITED(sts): self.returncode = os.WEXITSTATUS(sts) else: # Should never happen raise RuntimeError("Unknown child exit status!")
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
pass
if _deadstate is not None: self.returncode = _deadstate
def poll(self): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode is None: try: pid, sts = os.waitpid(self.pid, os.WNOHANG) if pid == self.pid: self._handle_exitstatus(sts) except os.error: pass return self.returncode
17de8ffc215d8539860a8a7f06279c4155382c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/17de8ffc215d8539860a8a7f06279c4155382c4f/subprocess.py
text='when tab key inserts spaces,\nspaces per tab')
text='when tab key inserts spaces,\nspaces per indent')
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPa...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
labeltabColsTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts tabs,\ncolumns per tab') self.scaleTabCols=Scale(frameIndentSize,variable=self.tabCols, orient='horizontal',tickinterval=2,from_=2,to=8)
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPa...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
labeltabColsTitle.pack(side=TOP,anchor=W,padx=5) self.scaleTabCols.pack(side=TOP,padx=5,fill=X)
def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPa...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
def LoadTabCfg(self): ##indent type radibuttons spaceIndent=idleConf.GetOption('main','Indent','use-spaces', default=1,type='bool') self.indentBySpaces.set(spaceIndent) ##indent sizes spaceNum=idleConf.GetOption('main','Indent','num-spaces', default=4,type='int') tabCols=idleConf.GetOption('main','Indent','tab-cols', d...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
tabCols=idleConf.GetOption('main','Indent','tab-cols', default=4,type='int')
def LoadTabCfg(self): ##indent type radibuttons spaceIndent=idleConf.GetOption('main','Indent','use-spaces', default=1,type='bool') self.indentBySpaces.set(spaceIndent) ##indent sizes spaceNum=idleConf.GetOption('main','Indent','num-spaces', default=4,type='int') tabCols=idleConf.GetOption('main','Indent','tab-cols', d...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
self.tabCols.set(tabCols)
def LoadTabCfg(self): ##indent type radibuttons spaceIndent=idleConf.GetOption('main','Indent','use-spaces', default=1,type='bool') self.indentBySpaces.set(spaceIndent) ##indent sizes spaceNum=idleConf.GetOption('main','Indent','num-spaces', default=4,type='int') tabCols=idleConf.GetOption('main','Indent','tab-cols', d...
63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py
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')
259b1e18b4b5f8acca8366efa3a06e7d489d1045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/259b1e18b4b5f8acca8366efa3a06e7d489d1045/setup.py
version_req = '"1.1.4"'
version_req = '"1.1.3"'
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')
259b1e18b4b5f8acca8366efa3a06e7d489d1045 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/259b1e18b4b5f8acca8366efa3a06e7d489d1045/setup.py
websucker.Sucker.savefilename(self, url))
websucker.Sucker.savefilename(self.sucker, url))
def go(self, event=None): if not self.msgq: self.msgq = Queue.Queue(0) self.check_msgq() if not self.sucker: self.sucker = SuckerThread(self.msgq) if self.sucker.stopit: return self.url_entry.selection_range(0, END) url = self.url_entry.get() url = url.strip() if not url: self.top.bell() self.message("[Error: No URL en...
592c4cc46059e6443b7ae235c73180b75a3a69f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/592c4cc46059e6443b7ae235c73180b75a3a69f7/wsgui.py
_platform_cache = {True:None, False:None} _platform_aliased_cache = {True:None, False:None}
_platform_cache_terse = None _platform_cache_not_terse = None _platform_aliased_cache_terse = None _platform_aliased_cache_not_terse = None
def python_compiler(): """ Returns a string identifying the compiler used for compiling Python. """ return _sys_version()[3]
9001cde559ef1b4f6b700c76bc2c86aef14b4e9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9001cde559ef1b4f6b700c76bc2c86aef14b4e9d/platform.py
global _platform_cache,_platform_aliased_cache if not aliased and (_platform_cache[bool(terse)] is not None): return _platform_cache[bool(terse)] elif _platform_aliased_cache[bool(terse)] is not None: return _platform_aliased_cache[bool(terse)]
global _platform_cache_terse, _platform_cache_not_terse global _platform_aliased_cache_terse, _platform_aliased_cache_not_terse if not aliased and terse and (_platform_cache_terse is not None): return _platform_cache_terse elif not aliased and not terse and (_platform_cache_not_terse is not None): return _platform_cac...
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
9001cde559ef1b4f6b700c76bc2c86aef14b4e9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9001cde559ef1b4f6b700c76bc2c86aef14b4e9d/platform.py
if aliased: _platform_aliased_cache[bool(terse)] = platform
if aliased and terse: _platform_aliased_cache_terse = platform elif aliased and not terse: _platform_aliased_cache_not_terse = platform
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
9001cde559ef1b4f6b700c76bc2c86aef14b4e9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9001cde559ef1b4f6b700c76bc2c86aef14b4e9d/platform.py
_platform_cache[bool(terse)] = platform
if terse: _platform_cache_terse = platform else: _platform_cache_not_terse = platform
def platform(aliased=0, terse=0): """ Returns a single string identifying the underlying platform with as much useful information as possible (but no more :). The output is intended to be human readable rather than machine parseable. It may look different on different platforms and this is intended. If "aliased" is ...
9001cde559ef1b4f6b700c76bc2c86aef14b4e9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/9001cde559ef1b4f6b700c76bc2c86aef14b4e9d/platform.py
version = "HTTP/0.9"
def handle(self):
f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f/BaseHTTPServer.py
self.send_error(400, "Bad request syntax (%s)" % `command`)
self.send_error(400, "Bad request syntax (%s)" % `requestline`)
def handle(self):
f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f/BaseHTTPServer.py
self.send_error(501, "Unsupported method (%s)" % `command`)
self.send_error(501, "Unsupported method (%s)" % `mname`)
def handle(self):
f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f69da220bfe1b8a0b8a061a0463fbb7d542ffa0f/BaseHTTPServer.py
self.assertEqual(grp.getgrgid(e.gr_gid), e)
entriesbygid.setdefault(e.gr_gid, []).append(e) for e in entries: self.assert_(grp.getgrgid(e.gr_gid) in entriesbygid[e.gr_gid])
def test_values(self): entries = grp.getgrall()
43bc1f18dbf18b9a7639f0933b829cf83d05c382 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/43bc1f18dbf18b9a7639f0933b829cf83d05c382/test_grp.py
A2 = "%s:%s" % (req.has_data() and 'POST' or 'GET',
A2 = "%s:%s" % (req.get_method(),
def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None
cdd625a77067e226a5dc715d1892f9511a067391 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cdd625a77067e226a5dc715d1892f9511a067391/urllib2.py
def maketables():
def maketables(trace=0):
def maketables(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAM...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
index1, index2, shift = splitbins(index)
index1, index2, shift = splitbins(index, trace)
def maketables(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAM...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
index1, index2, shift = splitbins(decomp_index)
index1, index2, shift = splitbins(decomp_index, trace)
def maketables(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAM...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
print len(table), "ctype entries"
def maketables(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAM...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
index1, index2, shift = splitbins(index)
index1, index2, shift = splitbins(index, trace)
def maketables(): unicode = UnicodeData(UNICODE_DATA) # extract unicode properties dummy = (0, 0, 0, 0) table = [dummy] cache = {0: dummy} index = [0] * len(unicode.chars) # 1) database properties for char in unicode.chars: record = unicode.table[char] if record: # extract database properties category = CATEGORY_NAM...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
def __init__(self, filename):
def __init__(self, filename, expand=1):
def __init__(self, filename): file = open(filename) table = [None] * 65536 while 1: s = file.readline() if not s: break s = string.split(string.strip(s), ";") char = string.atoi(s[0], 16) table[char] = s
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
If optional arg trace is true (default false), progress info is printed to sys.stderr.
If optional arg trace is non-zero (default zero), progress info is printed to sys.stderr. The higher the value, the more info you'll get.
def splitbins(t, trace=0): """t, trace=0 -> (t1, t2, shift). Split a table to save space. t is a sequence of ints. This function can be useful to save space if many of the ints are the same. t1 and t2 are lists of ints, and shift is an int, chosen to minimize the combined size of t1 and t2 (in C code), and where fo...
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
if trace:
if trace > 1:
def dump(t1, t2, shift, bytes): print >>sys.stderr, "%d+%d bins at shift %d; %d bytes" % ( len(t1), len(t2), shift, bytes)
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
maketables()
maketables(1)
def dump(t1, t2, shift, bytes): print >>sys.stderr, "%d+%d bins at shift %d; %d bytes" % ( len(t1), len(t2), shift, bytes)
fad27aee11e8ece649b72c8ad9513f46882d23ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fad27aee11e8ece649b72c8ad9513f46882d23ba/makeunicodedata.py
def readfp(self):
def readfp(self, fp):
def readfp(self): """Read a single mime.types-format file.""" map = self.types_map while 1: line = f.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff]...
c019ecb7fe7b44fa339defd071510ec2b0728775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c019ecb7fe7b44fa339defd071510ec2b0728775/mimetypes.py
line = f.readline()
line = fp.readline()
def readfp(self): """Read a single mime.types-format file.""" map = self.types_map while 1: line = f.readline() if not line: break words = line.split() for i in range(len(words)): if words[i][0] == '#': del words[i:] break if not words: continue type, suffixes = words[0], words[1:] for suff in suffixes: map['.' + suff]...
c019ecb7fe7b44fa339defd071510ec2b0728775 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c019ecb7fe7b44fa339defd071510ec2b0728775/mimetypes.py
>>> pik = pickle.dumps(x, 0) >>> dis(pik)
>>> pkl = pickle.dumps(x, 0) >>> dis(pkl)
def dis(pickle, out=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which th...
570283584af6a9aff47d2341d6154055572aaff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/570283584af6a9aff47d2341d6154055572aaff5/pickletools.py
>>> pik = pickle.dumps(x, 1) >>> dis(pik)
>>> pkl = pickle.dumps(x, 1) >>> dis(pkl)
def dis(pickle, out=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which th...
570283584af6a9aff47d2341d6154055572aaff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/570283584af6a9aff47d2341d6154055572aaff5/pickletools.py
49: p PUT 4 52: s SETITEM 53: b BUILD 54: a APPEND 55: g GET 1 58: a APPEND 59: . STOP
49: s SETITEM 50: b BUILD 51: a APPEND 52: g GET 1 55: a APPEND 56: . STOP
def dis(pickle, out=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which th...
570283584af6a9aff47d2341d6154055572aaff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/570283584af6a9aff47d2341d6154055572aaff5/pickletools.py
__test__ = {'dissassembler_test': _dis_test,
__test__ = {'disassembler_test': _dis_test,
def dis(pickle, out=None, indentlevel=4): """Produce a symbolic disassembly of a pickle. 'pickle' is a file-like object, or string, containing a (at least one) pickle. The pickle is disassembled from the current position, through the first STOP opcode encountered. Optional arg 'out' is a file-like object to which th...
570283584af6a9aff47d2341d6154055572aaff5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/570283584af6a9aff47d2341d6154055572aaff5/pickletools.py
if sys.maxint > 0x7fffffff: self.assertRaises(ValueError, len, r) else: self.assertEqual(len(r), sys.maxint)
self.assertEqual(len(r), sys.maxint)
def test_xrange(self): self.assertEqual(list(xrange(3)), [0, 1, 2]) self.assertEqual(list(xrange(1, 5)), [1, 2, 3, 4]) self.assertEqual(list(xrange(0)), []) self.assertEqual(list(xrange(-3)), []) self.assertEqual(list(xrange(1, 10, 3)), [1, 4, 7]) self.assertEqual(list(xrange(5, -5, -3)), [5, 2, -1, -4])
f4d8f390536416c083c687206be8e2687e26c9a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f4d8f390536416c083c687206be8e2687e26c9a3/test_xrange.py
return unittest.TestSuite((sqlite_type_suite, decltypes_type_suite, colnames_type_suite, adaptation_suite, date_suite))
return unittest.TestSuite((sqlite_type_suite, decltypes_type_suite, colnames_type_suite, adaptation_suite, bin_suite, date_suite))
def suite(): sqlite_type_suite = unittest.makeSuite(SqliteTypeTests, "Check") decltypes_type_suite = unittest.makeSuite(DeclTypesTests, "Check") colnames_type_suite = unittest.makeSuite(ColNamesTests, "Check") adaptation_suite = unittest.makeSuite(ObjectAdaptationTests, "Check") date_suite = unittest.makeSuite(DateTime...
762fbd34858f7df608e6da8079bf648bc7d3d8cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/762fbd34858f7df608e6da8079bf648bc7d3d8cc/types.py
def remap_element_names(root, name_map): queue = [] for child in root.childNodes: if child.nodeType == ELEMENT: queue.append(child) while queue: node = queue.pop() tagName = node.tagName if name_map.has_key(tagName): name, attrs = name_map[tagName] node._node.name = name for attr, value in attrs.items(): node.setAttrib...
def remap_element_names(root, name_map): queue = [] for child in root.childNodes: if child.nodeType == ELEMENT: queue.append(child) while queue: node = queue.pop() tagName = node.tagName if name_map.has_key(tagName): name, attrs = name_map[tagName] node._node.name = name for attr, value in attrs.items(): node.setAttrib...
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
def fixup_table_structures(doc, fragment): # must be done after remap_element_names(), or the tables won't be found for table in find_all_elements(fragment, "table"): fixup_table(doc, table)
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
"sectionauthor", "seealso",
"sectionauthor", "seealso", "itemize",
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep))
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
"index", "indexii", "indexiii", "indexiv", "setindexsubitem",
"setindexsubitem",
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep))
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
"moduleauthor", "indexterm",
"moduleauthor", "indexterm", "leader",
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == ELEMENT and child.tagName == name: nodes.append(child) for node in nodes: source.removeChild(node) dest.appendChild(node) if sep: dest.appendChild(doc.createTextNode(sep))
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
module_name = entry.getAttribute("name")
module_name = entry.getAttribute("module")
def fixup_refmodindexes_chunk(container): # node is probably a <para>; let's see how often it isn't: if container.tagName != PARA_ELEMENT: bwrite("--- fixup_refmodindexes_chunk(%s)\n" % container) module_entries = find_all_elements(container, "module") if not module_entries: return index_entries = find_all_elements_fro...
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
remap_element_names(fragment, { "tableii": ("table", {"cols": "2"}), "tableiii": ("table", {"cols": "3"}), "tableiv": ("table", {"cols": "4"}), "lineii": ("row", {}), "lineiii": ("row", {}), "lineiv": ("row", {}), "refmodule": ("module", {"link": "link"}), })
def convert(ifp, ofp): p = esistools.ExtendedEsisBuilder() p.feed(ifp.read()) doc = p.document fragment = p.fragment normalize(fragment) simplify(doc, fragment) handle_labels(doc, fragment) handle_appendix(doc, fragment) fixup_trailing_whitespace(doc, { "abstract": "\n", "title": "", "chapter": "\n\n", "section": "\n\n...
82ebc27357891ec342b8602fb28189751b8d06e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/82ebc27357891ec342b8602fb28189751b8d06e6/docfixer.py
def test_varsized_array(self): array = (c_int * 20)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29) varsize_array = (c_int * 1).from_address(addressof(array)) self.failUnlessEqual(varsize_array[0], 20) self.failUnlessEqual(varsize_array[1], 21) self.failUnlessEqual(varsize_array[2], 22) self.failUnlessEqual(varsize_array[3...
def test_varsized_array(self): array = (c_int * 20)(20, 21, 22, 23, 24, 25, 26, 27, 28, 29)
ce049a0aeffff6a37ebb05269e69c81b342c248a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ce049a0aeffff6a37ebb05269e69c81b342c248a/test_varsize_struct.py
"""Read and parse a list of filenames."""
"""Read and parse a filename or a list of filenames. Files that cannot be opened are silently ignored; this is designed so that you can specifiy a list of potential configuration file locations (e.g. current directory, user's home directory, systemwide directory), and all existing configuration files in the list will...
def read(self, filenames): """Read and parse a list of filenames.""" if type(filenames) is type(''): filenames = [filenames] for file in filenames: fp = open(file) self.__read(fp) fp.close()
6a8d84b0c1508d0a3f10f716f3faf3863b41f758 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a8d84b0c1508d0a3f10f716f3faf3863b41f758/ConfigParser.py
for file in filenames: fp = open(file) self.__read(fp)
for filename in filenames: try: fp = open(filename) except IOError: continue self.__read(fp, filename)
def read(self, filenames): """Read and parse a list of filenames.""" if type(filenames) is type(''): filenames = [filenames] for file in filenames: fp = open(file) self.__read(fp) fp.close()
6a8d84b0c1508d0a3f10f716f3faf3863b41f758 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a8d84b0c1508d0a3f10f716f3faf3863b41f758/ConfigParser.py
def __read(self, fp):
def __read(self, fp, fpname):
def __read(self, fp): """Parse a sectioned setup file.
6a8d84b0c1508d0a3f10f716f3faf3863b41f758 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a8d84b0c1508d0a3f10f716f3faf3863b41f758/ConfigParser.py
raise MissingSectionHeaderError(fp.name, lineno, `line`)
raise MissingSectionHeaderError(fpname, lineno, `line`)
def __read(self, fp): """Parse a sectioned setup file.
6a8d84b0c1508d0a3f10f716f3faf3863b41f758 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a8d84b0c1508d0a3f10f716f3faf3863b41f758/ConfigParser.py
e = ParsingError(fp.name)
e = ParsingError(fpname)
def __read(self, fp): """Parse a sectioned setup file.
6a8d84b0c1508d0a3f10f716f3faf3863b41f758 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/6a8d84b0c1508d0a3f10f716f3faf3863b41f758/ConfigParser.py
'recv', 'recvfrom', 'send', 'sendall', 'sendto', 'setblocking',
'sendall', 'setblocking',
def getfqdn(name=''): """Get fully qualified domain name from name. An empty argument is interpreted as meaning the local host. First the hostname returned by gethostbyaddr() is checked, then possibly existing aliases. In case no FQDN is available, hostname is returned. """ name = name.strip() if not name or name == ...
c689918c941d366716c9a630414fb6703581b425 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c689918c941d366716c9a630414fb6703581b425/socket.py
def __getattr__(self, name):
def _dummy(*args):
def __getattr__(self, name): raise error(9, 'Bad file descriptor')
c689918c941d366716c9a630414fb6703581b425 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c689918c941d366716c9a630414fb6703581b425/socket.py
__slots__ = ["_sock"]
__slots__ = ["_sock", "send", "recv", "sendto", "recvfrom"]
def __getattr__(self, name): raise error(9, 'Bad file descriptor')
c689918c941d366716c9a630414fb6703581b425 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c689918c941d366716c9a630414fb6703581b425/socket.py
assert sre.split("(b)|(:+)", ":a:b::c") == \ ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c']
def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1)
067bebfe2da916d1e681db100be4c9a99ff36694 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/067bebfe2da916d1e681db100be4c9a99ff36694/test_sre.py
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
12f21ae07f56611926ec06bd92681e771d29968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/12f21ae07f56611926ec06bd92681e771d29968f/linecache.py
fullname = os.path.join(dirname, basename)
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
12f21ae07f56611926ec06bd92681e771d29968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/12f21ae07f56611926ec06bd92681e771d29968f/linecache.py
stat = os.stat(fullname) break except os.error:
fullname = os.path.join(dirname, basename) except (TypeError, AttributeError):
def updatecache(filename): """Update a cache entry and return its list of lines. If something's wrong, print a message, discard the cache entry, and return an empty list.""" if cache.has_key(filename): del cache[filename] if not filename or filename[0] + filename[-1] == '<>': return [] fullname = filename try: stat = ...
12f21ae07f56611926ec06bd92681e771d29968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/12f21ae07f56611926ec06bd92681e771d29968f/linecache.py
l = 2.0 * radius * sin(w2*self._invradian)
l = 2.0 * radius * sin(w2*self._invradian)
def circle(self, radius, extent = None): """ Draw a circle with given radius. The center is radius units left of the turtle; extent determines which part of the circle is drawn. If not given, the entire circle is drawn.
2b88f63a3c78755ff19d8e535fbe93a2f16a87d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/2b88f63a3c78755ff19d8e535fbe93a2f16a87d3/turtle.py