rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
def interaction(self, message, fid, iid):
def interaction(self, message, fid, modified_info):
def interaction(self, message, fid, iid): ##print "interaction: (%s, %s, %s)" % (`message`,`fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now self.gui.interaction(message, frame, info)
5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9/RemoteDebugger.py
info = None self.gui.interaction(message, frame, info)
self.gui.interaction(message, frame, modified_info)
def interaction(self, message, fid, iid): ##print "interaction: (%s, %s, %s)" % (`message`,`fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now self.gui.interaction(message, frame, info)
5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9/RemoteDebugger.py
def get_stack(self, frame, tb): stack, i = self.call("get_stack", frame._fid, None)
def get_stack(self, frame, tbid): stack, i = self.call("get_stack", frame._fid, tbid)
def get_stack(self, frame, tb): stack, i = self.call("get_stack", frame._fid, None) stack = [(FrameProxy(self.conn, fid), k) for fid, k in stack] return stack, i
5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9/RemoteDebugger.py
return msg
def clear_all_file_breaks(self, filename): msg = self.call("clear_all_file_breaks", filename)
5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5b7ae25b7e14ebbd46e30a47cc7822b6179e12d9/RemoteDebugger.py
print 'Testing UTF-16 code point order comparisons...', assert u'\u0061' < u'\u20ac' assert u'\u0061' < u'\ud800\udc02' def test_lecmp(s, s2): assert s < s2 , "comparison failed on %s < %s" % (s, s2) def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\uda00\udc...
if 0: print 'Testing UTF-16 code point order comparisons...', assert u'\u0061' < u'\u20ac' assert u'\u0061' < u'\ud800\udc02' def test_lecmp(s, s2): assert s < s2 , "comparison failed on %s < %s" % (s, s2) def test_fixup(s): s2 = u'\ud800\udc01' test_lecmp(s, s2) s2 = u'\ud900\udc01' test_lecmp(s, s2) s2 = u'\u...
test('capwords', u'abc\t def \nghi', u'Abc Def Ghi')
0623e57f861e2383354e2397c43067f561adc80e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0623e57f861e2383354e2397c43067f561adc80e/test_unicode.py
ckmsg(s, "'continue' not supported inside 'finally' clause")
if sys.platform.startswith('java'): print "'continue' not supported inside 'finally' clause" print "ok" else: ckmsg(s, "'continue' not supported inside 'finally' clause")
def ckmsg(src, msg): try: compile(src, '<fragment>', 'exec') except SyntaxError, e: print e.msg if e.msg == msg: print "ok" else: print "expected:", msg else: print "failed to get expected SyntaxError"
4b7557c37c2b47b46719f0e60f85e7d9f35da077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b7557c37c2b47b46719f0e60f85e7d9f35da077/test_exceptions.py
test_capi1()
def test_capi1(): try: _testcapi.raise_exception(BadException, 1) except TypeError, err: exc, err, tb = sys.exc_info() co = tb.tb_frame.f_code assert co.co_name == "test_capi1" assert co.co_filename.endswith('test_exceptions.py') else: print "Expected exception"
4b7557c37c2b47b46719f0e60f85e7d9f35da077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b7557c37c2b47b46719f0e60f85e7d9f35da077/test_exceptions.py
test_capi2()
if not sys.platform.startswith('java'): test_capi1() test_capi2()
def test_capi2(): try: _testcapi.raise_exception(BadException, 0) except RuntimeError, err: exc, err, tb = sys.exc_info() co = tb.tb_frame.f_code assert co.co_name == "__init__" assert co.co_filename.endswith('test_exceptions.py') co2 = tb.tb_frame.f_back.f_code assert co2.co_name == "test_capi2" else: print "Expected ...
4b7557c37c2b47b46719f0e60f85e7d9f35da077 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4b7557c37c2b47b46719f0e60f85e7d9f35da077/test_exceptions.py
self.addr = sock.getpeername()
try: self.addr = sock.getpeername() except socket.error: pass
def __init__ (self, sock=None, map=None): if sock: self.set_socket (sock, map) # I think it should inherit this anyway self.socket.setblocking (0) self.connected = 1 self.addr = sock.getpeername() else: self.socket = None
333c025cec1626c0d3cb14a5fc4835710f5e5bc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/333c025cec1626c0d3cb14a5fc4835710f5e5bc9/asyncore.py
verify(L == ['Commented Bar', 'Foo Bar', 'Internationalized Stuff', 'Spacey Bar'],
verify(L == [r'Commented Bar', r'Foo Bar', r'Internationalized Stuff', r'Section\with$weird%characters[' '\t', r'Spacey Bar', ],
def basic(src): print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() verify(L == ['Commented Bar', 'Foo Bar', 'Internationalized Stuff', 'Spacey Bar'], "unexpected list of section names") # The use of spaces in the section names serv...
e16a278f026dcee7c478f3b96e025b141e4b6297 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e16a278f026dcee7c478f3b96e025b141e4b6297/test_cfgparser.py
for i in range(0, 256):
for i in [0, 8, 16, 32, 64, 127, 128, 255]:
def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_...
d1722de32db85bca4407ac729781ad91b3d051e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d1722de32db85bca4407ac729781ad91b3d051e8/test_sre.py
"Handle a notation declaration event."
"Handle a notation declaration event."
def notationDecl(self, name, publicId, systemId):
8cdc103233c927819774d9857ca81d9c8a608f7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cdc103233c927819774d9857ca81d9c8a608f7e/handler.py
"Handle an unparsed entity declaration event."
"Handle an unparsed entity declaration event."
def unparsedEntityDecl(self, name, publicId, systemId, ndata):
8cdc103233c927819774d9857ca81d9c8a608f7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cdc103233c927819774d9857ca81d9c8a608f7e/handler.py
"""Resolve the system identifier of an entity and return either
"""Resolve the system identifier of an entity and return either
def resolveEntity(self, publicId, systemId):
8cdc103233c927819774d9857ca81d9c8a608f7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cdc103233c927819774d9857ca81d9c8a608f7e/handler.py
return systemId
return systemId
def resolveEntity(self, publicId, systemId):
8cdc103233c927819774d9857ca81d9c8a608f7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/8cdc103233c927819774d9857ca81d9c8a608f7e/handler.py
assert gc.collect() == 1
if gc.collect() != 1: raise TestFailed
def test_list(): l = [] l.append(l) gc.collect() del l assert gc.collect() == 1
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() == 1
if gc.collect() != 1: raise TestFailed
def test_dict(): d = {} d[1] = d gc.collect() del d assert gc.collect() == 1
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() == 2
if gc.collect() != 2: raise TestFailed
def test_tuple(): # since tuples are immutable we close the loop with a list l = [] t = (l,) l.append(t) gc.collect() del t del l assert gc.collect() == 2
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def test_class(): class A: pass A.a = A gc.collect() del A assert gc.collect() > 0
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def test_instance(): class A: pass a = A() a.a = a gc.collect() del a assert gc.collect() > 0
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() > 0
if gc.collect() == 0: raise TestFailed
def __init__(self): self.init = self.__init__
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
gc.garbage[:] = []
def __del__(self): pass
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() > 0 assert id(gc.garbage[0]) == id_a
if gc.collect() == 0: raise TestFailed for obj in gc.garbage: if id(obj) == id_a: del obj.a break else: raise TestFailed gc.garbage.remove(obj)
def __del__(self): pass
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
assert gc.collect() == 2
if gc.collect() != 2: raise TestFailed def test_saveall(): debug = gc.get_debug() gc.set_debug(debug | gc.DEBUG_SAVEALL) l = [] l.append(l) id_l = id(l) del l gc.collect() try: for obj in gc.garbage: if id(obj) == id_l: del obj[:] break else: raise TestFailed gc.garbage.remove(obj) finally: gc.set_debug(debug)
exec("def f(): pass\n") in d
a84d7e902d565e6ea53dab3d21a5e721598dd168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a84d7e902d565e6ea53dab3d21a5e721598dd168/test_gc.py
"paragraph", "subparagraph")
"paragraph", "subparagraph", "description", "opcodedesc", "classdesc", "funcdesc", "methoddesc", "excdesc", "datadesc", "funcdescni", "methoddescni", "excdescni", "datadescni", )
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.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))
3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f/docfixer.py
"moduleinfo", "title", "opcodedesc", "verbatim", "funcdesc", "methoddesc", "excdesc", "datadesc",
"moduleinfo", "title", "verbatim", "opcodedesc", "classdesc", "funcdesc", "methoddesc", "excdesc", "datadesc",
def move_elements_by_name(doc, source, dest, name, sep=None): nodes = [] for child in source.childNodes: if child.nodeType == xml.dom.core.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))
3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f/docfixer.py
i = 0
i = len(children)
def fixup_paras_helper(doc, container): # document is already normalized children = container.childNodes start = 0 start_fixed = 0 i = 0 SKIP_ELEMENTS = PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_help...
3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f/docfixer.py
for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_helper(doc, child) break elif child.tagName in SKIP_ELEMENTS: if not start_fixed: start = i + 1 elif not start_fixed: start_fixed = 1 i = i + 1 else: if child.nodeType == xml.dom.core.TEXT \ and string...
def fixup_paras_helper(doc, container): # document is already normalized children = container.childNodes start = 0 start_fixed = 0 i = 0 SKIP_ELEMENTS = PARA_LEVEL_ELEMENTS + PARA_LEVEL_PRECEEDERS for child in children: if child.nodeType == xml.dom.core.ELEMENT: if child.tagName in FIXUP_PARA_ELEMENTS: fixup_paras_help...
3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/3759c0f7c4a36aa16f6e09ec1bb99e14f315dc6f/docfixer.py
print >> self.stream, "Welcome to the profile statistics browser."
def postcmd(self, stop, line): if stop: return stop return None
19bc3cf253d17c53dd81ef9e48f6ccb99881d3fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19bc3cf253d17c53dd81ef9e48f6ccb99881d3fd/pstats.py
ProfileBrowser(initprofile).cmdloop() print >> self.stream, "Goodbye."
browser = ProfileBrowser(initprofile) print >> browser.stream, "Welcome to the profile statistics browser." browser.cmdloop() print >> browser.stream, "Goodbye."
def postcmd(self, stop, line): if stop: return stop return None
19bc3cf253d17c53dd81ef9e48f6ccb99881d3fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/19bc3cf253d17c53dd81ef9e48f6ccb99881d3fd/pstats.py
self.interaction(frame, None)
if self.bp_commands(frame): self.interaction(frame, None) def bp_commands(self,frame): """ Call every command that was set for the current active breakpoint (if there is one) Returns True if the normal interaction function must be called, False otherwise """ if getattr(self,"currentbp",False) and self.currentbp in se...
def user_line(self, frame): """This function is called when we stop or break at this line.""" if self._wait_for_mainpyfile: if (self.mainpyfile != self.canonic(frame.f_code.co_filename) or frame.f_lineno<= 0): return self._wait_for_mainpyfile = 0 self.interaction(frame, None)
529a9b8aec6ca20e7ef42b4de193ea8d4af71692 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/529a9b8aec6ca20e7ef42b4de193ea8d4af71692/pdb.py
submsgobj = self.parsestr(part) msgobj.attach(submsgobj)
def _parsebody(self, container, fp): # Parse the body, but first split the payload on the content-type # boundary if present. boundary = container.get_boundary() isdigest = (container.get_content_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each se...
a77fdbb0e209cb11ab053e09a57746093cab3228 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a77fdbb0e209cb11ab053e09a57746093cab3228/Parser.py
on connect to the Net for testing.
on connecting to the Net for testing.
def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() if len(hex_repr) == 1: hex_repr = "0%s" % hex_repr return "%" + hex_repr
1cc156355c53fc3707ec8bc2ac9017a2c5b73e4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/1cc156355c53fc3707ec8bc2ac9017a2c5b73e4e/test_urllib.py
def test_basic_proxy(self): o = C() self.check_proxy(o, weakref.proxy(o))
7114c6cb588ea0ee964b1b68f31141cf9616d1f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7114c6cb588ea0ee964b1b68f31141cf9616d1f6/test_weakref.py
from os.path import normpath, join, dirname for (name, value) in done.items(): if value[0:2] == "./": done[name] = normpath(join(dirname(fp.name), value))
def parse_makefile(fp, g=None): """Parse a Makefile-style file. A dictionary containing name/value pairs is returned. If an optional dictionary is passed in as the second argument, it is used instead of a new dictionary. """ if g is None: g = {} variable_rx = re.compile("([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)\n") done =...
44a4889a6cc7e9630286617bc672fa88be66626f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/44a4889a6cc7e9630286617bc672fa88be66626f/sysconfig.py
testtar = path("testtar" + os.extsep + "tar") tempdir = path("testtar" + os.extsep + "dir") tempname = path("testtar" + os.extsep + "tmp")
testtar = path("testtar.tar") tempdir = os.path.join(tempfile.gettempdir(), "testtar" + os.extsep + "dir") tempname = test_support.TESTFN
def path(path): return test_support.findfile(path)
d94d3a7b7192ae96baecf3a0940262139092f45e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d94d3a7b7192ae96baecf3a0940262139092f45e/test_tarfile.py
if os.path.exists(tempdir): shutil.rmtree(tempdir) if os.path.exists(tempname): os.remove(tempname)
if os.path.exists(dirname()): shutil.rmtree(dirname()) if os.path.exists(tmpname()): os.remove(tmpname())
def test_main(): if gzip: # create testtar.tar.gz gzip.open(tarname("gz"), "wb").write(file(tarname(), "rb").read()) if bz2: # create testtar.tar.bz2 bz2.BZ2File(tarname("bz2"), "wb").write(file(tarname(), "rb").read()) tests = [ ReadTest, ReadStreamTest, WriteTest, WriteStreamTest ] if gzip: tests.extend([ ReadTestG...
d94d3a7b7192ae96baecf3a0940262139092f45e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d94d3a7b7192ae96baecf3a0940262139092f45e/test_tarfile.py
return whatever**2
return arg**2
def m1(self, arg): return whatever**2
6ee10f5dad8e779caeaa878798cc934d991f5f62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6ee10f5dad8e779caeaa878798cc934d991f5f62/Eiffel.py
sys.stderr.write('MH error: %\n' % (msg % args))
sys.stderr.write('MH error: %s\n' % (msg % args))
def error(self, msg, *args): sys.stderr.write('MH error: %\n' % (msg % args))
ca4080248ab45f039942df6137766b3f37621321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca4080248ab45f039942df6137766b3f37621321/mhlib.py
mode = eval('0' + protect)
mode = string.atoi(protect, 8)
def makefolder(self, name): protect = pickline(self.profile, 'Folder-Protect') if protect and isnumeric(protect): mode = eval('0' + protect) else: mode = FOLDER_PROTECT os.mkdir(os.path.join(self.getpath(), name), mode)
ca4080248ab45f039942df6137766b3f37621321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca4080248ab45f039942df6137766b3f37621321/mhlib.py
if isnumeric(name): messages.append(eval(name))
if name[0] != "," and \ numericprog.match(name) == len(name): messages.append(string.atoi(name))
def listmessages(self): messages = [] for name in os.listdir(self.getfullname()): if isnumeric(name): messages.append(eval(name)) messages.sort() if messages: self.last = max(messages) else: self.last = 0 return messages
ca4080248ab45f039942df6137766b3f37621321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca4080248ab45f039942df6137766b3f37621321/mhlib.py
path = self.getmessagefilename(n)
def openmessage(self, n): path = self.getmessagefilename(n) return Message(self, n)
ca4080248ab45f039942df6137766b3f37621321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca4080248ab45f039942df6137766b3f37621321/mhlib.py
newline = '%s: %s' % (key, value)
newline = '%s: %s\n' % (key, value)
def updateline(file, key, value, casefold = 1): try: f = open(file, 'r') lines = f.readlines() f.close() except IOError: lines = [] pat = key + ':\(.*\)\n' if casefold: prog = regex.compile(pat, regex.casefold) else: prog = regex.compile(pat) if value is None: newline = None else: newline = '%s: %s' % (key, value) for ...
ca4080248ab45f039942df6137766b3f37621321 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ca4080248ab45f039942df6137766b3f37621321/mhlib.py
common = filter(big._data.has_key, little._data)
common = ifilter(big._data.has_key, little)
def __and__(self, other): """Return the intersection of two sets as a new set.
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
for elt in selfdata: if elt not in otherdata: data[elt] = value for elt in otherdata: if elt not in selfdata: data[elt] = value
for elt in ifilter(otherdata.has_key, selfdata, True): data[elt] = value for elt in ifilter(selfdata.has_key, otherdata, True): data[elt] = value
def __xor__(self, other): """Return the symmetric difference of two sets as a new set.
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
otherdata = other._data
def __sub__(self, other): """Return the difference of two sets as a new Set.
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
for elt in self: if elt not in otherdata: data[elt] = value
for elt in ifilter(other._data.has_key, self, True): data[elt] = value
def __sub__(self, other): """Return the difference of two sets as a new Set.
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
otherdata = other._data for elt in self: if elt not in otherdata: return False
for elt in ifilter(other._data.has_key, self, True): return False
def issubset(self, other): """Report whether another set contains this set.""" self._binary_sanity_check(other) if len(self) > len(other): # Fast check for obvious cases return False otherdata = other._data for elt in self: if elt not in otherdata: return False return True
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
selfdata = self._data for elt in other: if elt not in selfdata:
for elt in ifilter(self._data.has_key, other, True):
def issuperset(self, other): """Report whether this set contains another set.""" self._binary_sanity_check(other) if len(self) < len(other): # Fast check for obvious cases return False selfdata = self._data for elt in other: if elt not in selfdata: return False return True
bb04f603aeaa1c68e92eeaad9a385781f20ea68b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb04f603aeaa1c68e92eeaad9a385781f20ea68b/sets.py
self.stack = get_stack(tb) self.text = get_exception()
self.stack = self.get_stack(tb) self.text = self.get_exception() def get_stack(self, tb): if tb is None: tb = sys.last_traceback stack = [] if tb and tb.tb_frame is None: tb = tb.tb_next while tb is not None: stack.append((tb.tb_frame, tb.tb_lineno)) tb = tb.tb_next return stack def get_exception(self): type = sys.la...
def __init__(self, flist=None, tb=None): self.flist = flist self.stack = get_stack(tb) self.text = get_exception()
a65a5c3b9132afd68f55afcc94a29266a0972afb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a65a5c3b9132afd68f55afcc94a29266a0972afb/StackViewer.py
def GetText(self): frame, lineno = self.info try: modname = frame.f_globals["__name__"] except: modname = "?" code = frame.f_code filename = code.co_filename funcname = code.co_name sourceline = linecache.getline(filename, lineno) sourceline = sourceline.strip() if funcname in ("?", "", None): item = "%s, line %d: %s" ...
a65a5c3b9132afd68f55afcc94a29266a0972afb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a65a5c3b9132afd68f55afcc94a29266a0972afb/StackViewer.py
def get_stack(t=None, f=None): if t is None: t = sys.last_traceback stack = [] if t and t.tb_frame is f: t = t.tb_next while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: break f = f.f_back stack.reverse() while t is not None: stack.append((t.tb_frame, t.tb_lineno)) t = t.tb_next return stack def...
def get_stack(t=None, f=None): if t is None: t = sys.last_traceback stack = [] if t and t.tb_frame is f: t = t.tb_next while f is not None: stack.append((f, f.f_lineno)) if f is self.botframe: break f = f.f_back stack.reverse() while t is not None: stack.append((t.tb_frame, t.tb_lineno)) t = t.tb_next return stack
a65a5c3b9132afd68f55afcc94a29266a0972afb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a65a5c3b9132afd68f55afcc94a29266a0972afb/StackViewer.py
manifest = open (self.manifest, "w") for fn in self.files: manifest.write (fn + '\n') manifest.close ()
self.execute(write_file, (self.manifest, self.files), "writing manifest file")
def write_manifest (self): """Write the file list in 'self.files' (presumably as filled in by 'find_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'."""
0a589965ebd56b680a316a6da3c5aa20174b1e6c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0a589965ebd56b680a316a6da3c5aa20174b1e6c/sdist.py
("Visual Studio 2003 needs to be installed before " "building extensions for Python.")
("""Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")
def load_macros(self, version): vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir") self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir") net = r"Software\Microsoft\.NETFramework" self.set_macro("FrameworkDir", net, "installroot")...
7b15d1c1df4220fcedc86aaa5e0254e5961f4dee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7b15d1c1df4220fcedc86aaa5e0254e5961f4dee/msvccompiler.py
expect(gc.collect(), 0, "boom")
expect(gc.collect(), 4, "boom")
def test_boom(): a = Boom() b = Boom() a.attr = b b.attr = a gc.collect() garbagelen = len(gc.garbage) del a, b # a<->b are in a trash cycle now. Collection will invoke Boom.__getattr__ # (to see whether a and b have __del__ methods), and __getattr__ deletes # the internal "attr" attributes as a side effect. That ca...
6671c22bf9bde3ee009feb9cc0081d0f4beeb7df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6671c22bf9bde3ee009feb9cc0081d0f4beeb7df/test_gc.py
'BuildRoot: %{_tmppath}/%{name}-buildroot',
'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + se...
cadc4c7155b7259e616a80dac1c91d8333b3b4cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cadc4c7155b7259e616a80dac1c91d8333b3b4cb/bdist_rpm.py
if isinstance(host, TupleType): host, x509 = host else: x509 = {}
host, extra_headers, x509 = self.get_host_info(host)
def make_connection(self, host): # create a HTTPS connection object from a host descriptor # host may be a string, or a (host, x509-dict) tuple import httplib if isinstance(host, TupleType): host, x509 = host else: x509 = {} try: HTTPS = httplib.HTTPS except AttributeError: raise NotImplementedError,\ "your version of ...
927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed/xmlrpclib.py
raise NotImplementedError,\ "your version of httplib doesn't support HTTPS"
raise NotImplementedError( "your version of httplib doesn't support HTTPS" )
def make_connection(self, host): # create a HTTPS connection object from a host descriptor # host may be a string, or a (host, x509-dict) tuple import httplib if isinstance(host, TupleType): host, x509 = host else: x509 = {} try: HTTPS = httplib.HTTPS except AttributeError: raise NotImplementedError,\ "your version of ...
927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed/xmlrpclib.py
return apply(HTTPS, (host, None), x509) def send_host(self, connection, host): if isinstance(host, TupleType): host, x509 = host connection.putheader("Host", host)
return apply(HTTPS, (host, None), x509 or {})
def make_connection(self, host): # create a HTTPS connection object from a host descriptor # host may be a string, or a (host, x509-dict) tuple import httplib if isinstance(host, TupleType): host, x509 = host else: x509 = {} try: HTTPS = httplib.HTTPS except AttributeError: raise NotImplementedError,\ "your version of ...
927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/927af33c6c99e8bd64bfc2ad345ac6e08eadb0ed/xmlrpclib.py
_hostprog = re.compile('^//([^/]*)(.*)$')
_hostprog = re.compile('^//([^/?]*)(.*)$')
def splithost(url): """splithost('//host[:port]/path') --> 'host[:port]', '/path'.""" global _hostprog if _hostprog is None: import re _hostprog = re.compile('^//([^/]*)(.*)$') match = _hostprog.match(url) if match: return match.group(1, 2) return None, url
9fe10b8aca0e8f88d7001c7b070f74f3f93a8a70 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9fe10b8aca0e8f88d7001c7b070f74f3f93a8a70/urllib.py
"timzone value not set to -1")
"timezone value not set to -1")
def test_timezone(self): # Test timezone directives. # When gmtime() is used with %Z, entire result of strftime() is empty. # Check for equal timezone names deals with bad locale info when this # occurs; first found in FreeBSD 4.4. strp_output = _strptime.strptime("UTC", "%Z") self.failUnlessEqual(strp_output.tm_isdst,...
dbf18163c5b4543a01162041bcccf45398e110e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dbf18163c5b4543a01162041bcccf45398e110e9/test_strptime.py
def basename(s): return split(s)[1]
03ad1315456c8f7d02f007b8a2330eb9f4c5137f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/03ad1315456c8f7d02f007b8a2330eb9f4c5137f/macpath.py
n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n:
prefix = m[0] for item in m:
def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) # if os.sep didn't have any effect, try os.altsep if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: for ...
03ad1315456c8f7d02f007b8a2330eb9f4c5137f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/03ad1315456c8f7d02f007b8a2330eb9f4c5137f/macpath.py
return os.sep.join(prefix) def isdir(s): """Return true if the pathname refers to an existing directory.""" try: st = os.stat(s) except os.error: return 0 return S_ISDIR(st[ST_MODE]) def getsize(filename): """Return the size of a file, reported by os.stat().""" st = os.stat(filename) return st[ST_SIZE] def getm...
return prefix
def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) # if os.sep didn't have any effect, try os.altsep if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: for ...
03ad1315456c8f7d02f007b8a2330eb9f4c5137f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/03ad1315456c8f7d02f007b8a2330eb9f4c5137f/macpath.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...
c43afc96d1c6818977ff7570f0f2992918891c21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c43afc96d1c6818977ff7570f0f2992918891c21/setup.py
if self.basetype: Output("
Output("
def generate(self): # XXX This should use long strings and %(varname)s substitution!
a54aa7d6b2b6af5d0207815044cd26f6dbd35b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a54aa7d6b2b6af5d0207815044cd26f6dbd35b79/bgenObjectDefinition.py
else: Output(" self.prefix, self.typename)
def generate(self): # XXX This should use long strings and %(varname)s substitution!
a54aa7d6b2b6af5d0207815044cd26f6dbd35b79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a54aa7d6b2b6af5d0207815044cd26f6dbd35b79/bgenObjectDefinition.py
try: line = raw_input(self.prompt) except EOFError: line = 'EOF'
if self.use_rawinput: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' else: sys.stdout.write(self.prompt) line = sys.stdin.readline() if not len(line): line = 'EOF' else: line = line[:-1]
def cmdloop(self, intro=None): self.preloop() if intro is not None: self.intro = intro if self.intro: print self.intro stop = None while not stop: if self.cmdqueue: line = self.cmdqueue[0] del self.cmdqueue[0] else: try: line = raw_input(self.prompt) except EOFError: line = 'EOF' line = self.precmd(line) stop = self.on...
39f135a47c55c398af6831ea8398f398ec6dd658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/39f135a47c55c398af6831ea8398f398ec6dd658/cmd.py
'HTTPS'))
'HTTPS', 'HTTP11'))
def test_others(self): cm = self.checkModule
af12c6220dd19e956d0d6c35ef64a86a8dd0b9f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/af12c6220dd19e956d0d6c35ef64a86a8dd0b9f3/test_pyclbr.py
fp = open(findfile('audiotest.au'), 'rb')
datadir = os.path.join(os.path.dirname(landmark), 'data', '') fp = open(findfile('audiotest.au', datadir), 'rb')
def setUp(self): # In Python, audiotest.au lives in Lib/test not Lib/test/data fp = open(findfile('audiotest.au'), 'rb') try: self._audiodata = fp.read() finally: fp.close() self._au = MIMEAudio(self._audiodata)
7bf8ff08db6be310facf0ec54571f16a58b03c8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7bf8ff08db6be310facf0ec54571f16a58b03c8f/test_email.py
if not mimetypes.inited: mimetypes.init()
def guess_type(self, path): """Guess the type of a file.
bb9619ff7d75a53b8938edd1226bf8ed33206aad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bb9619ff7d75a53b8938edd1226bf8ed33206aad/SimpleHTTPServer.py
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__("".join(L)) return self._rev
79138b278b07d6500617e1aa5efb2c2a7fb66578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/79138b278b07d6500617e1aa5efb2c2a7fb66578/test_descr.py
verify(unicode(u).__class__ is unicode)
def rev(self): if self._rev is not None: return self._rev L = list(self) L.reverse() self._rev = self.__class__(u"".join(L)) return self._rev
79138b278b07d6500617e1aa5efb2c2a7fb66578 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/79138b278b07d6500617e1aa5efb2c2a7fb66578/test_descr.py
s = "\\pdfoutline goto name{page.%d}" % pageno
s = "\\pdfoutline goto name{page.%dx}" % pageno
def write_toc_entry(entry, fp, layer): stype, snum, title, pageno, toc = entry s = "\\pdfoutline goto name{page.%d}" % pageno if toc: s = "%s count -%d" % (s, len(toc)) if snum: title = "%s %s" % (snum, title) s = "%s {%s}\n" % (s, title) fp.write(s) for entry in toc: write_toc_entry(entry, fp, layer + 1)
c062fa67dc22c871119de842fa7673278cdd347c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c062fa67dc22c871119de842fa7673278cdd347c/toc2bkm.py
self.checkequal(('this', ' is ', 'the partition method'), 'this is the partition method', 'partition', ' is ')
self.checkequal(('this is the par', 'ti', 'tion method'), 'this is the partition method', 'partition', 'ti')
def test_partition(self):
d8c2c74e78f2012b417671a80f95405f58b84eca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d8c2c74e78f2012b417671a80f95405f58b84eca/string_tests.py
self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50))
if self.parent is not None: self.geometry("+%d+%d" % (parent.winfo_rootx()+50, parent.winfo_rooty()+50))
def __init__(self, parent, title = None):
932c072acb5dd035fce8cc036cd8b8b232b825f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/932c072acb5dd035fce8cc036cd8b8b232b825f8/tkSimpleDialog.py
override if you don't want the standard buttons
override if you do not want the standard buttons
def buttonbox(self): '''add standard button box.
932c072acb5dd035fce8cc036cd8b8b232b825f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/932c072acb5dd035fce8cc036cd8b8b232b825f8/tkSimpleDialog.py
self.parent.focus_set()
if self.parent is not None: self.parent.focus_set()
def cancel(self, event=None):
932c072acb5dd035fce8cc036cd8b8b232b825f8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/932c072acb5dd035fce8cc036cd8b8b232b825f8/tkSimpleDialog.py
v = self.get(section, option) val = int(v) if val not in (0, 1):
states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not states.has_key(v.lower()):
def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val
4cbaddcba571461f7c48e95bc0295014bada51bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cbaddcba571461f7c48e95bc0295014bada51bf/ConfigParser.py
return val
return states[v.lower()]
def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val
4cbaddcba571461f7c48e95bc0295014bada51bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cbaddcba571461f7c48e95bc0295014bada51bf/ConfigParser.py
outfile.write(" ")
outfile.write(" ")
def write_results_file(self, path, lines, lnotab, lines_hit): """Return a coverage results file in path."""
a541c2af72bc7cd0f693bae102251afaa6043d47 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a541c2af72bc7cd0f693bae102251afaa6043d47/trace.py
if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) if auth: h.putheader('Authorization: Basic %s' % auth)
if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) if auth: h.putheader('Authorization', 'Basic %s' % auth)
def open_https(self, url, data=None): """Use HTTPS protocol.""" import httplib user_passwd = None proxy_passwd = None if isinstance(url, str): host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url # here, we determine, whether the pr...
b049597c1b0acbab285222f0b3083956dcfb107c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b049597c1b0acbab285222f0b3083956dcfb107c/urllib.py
includes = ['-I' + incldir, '-I' + binlib]
includes = ['-I' + incldir, '-I' + config_h_dir]
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...
e5c8b9f2e864843b41b044743f88995b4f3576b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e5c8b9f2e864843b41b044743f88995b4f3576b4/freeze.py
if self.inc.match(fullname) == None:
if DEBUG: print 'checkpath', fullname matchvalue = self.inc.match(fullname) if matchvalue == None:
def checkdir(self, path, istop): files = os.listdir(path) rv = [] todo = [] for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if self.inc.match(fullname) == None: if os.path.isdir(fullname): todo.append(fullname) else: rv.append(fullname) for d in todo: if len(rv) > 500: if istop: rv.appen...
582c3868c008e703f17b8c9b66ac4afe3ed2d047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/582c3868c008e703f17b8c9b66ac4afe3ed2d047/MkDistr.py
macostools.copy(fullname, os.path.join(destprefix, dest), 1)
try: macostools.copy(fullname, os.path.join(destprefix, dest), 1) except: print 'cwd', os.path.getcwd() print 'fsspec', macfs.FSSpec(fullname) sys.exit(1)
def rundir(self, path, destprefix, doit): files = os.listdir(path) todo = [] rv = 1 for f in files: if self.exc.match(f): continue fullname = os.path.join(path, f) if os.path.isdir(fullname): todo.append(fullname) else: dest = self.inc.match(fullname) if dest == None: print 'Not yet resolved:', fullname rv = 0 if dest:...
582c3868c008e703f17b8c9b66ac4afe3ed2d047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/582c3868c008e703f17b8c9b66ac4afe3ed2d047/MkDistr.py
path = module.__path__
try: path = module.__path__ except AttributeError: raise ImportError, 'No source for module ' + module.__name__
def _find_module(fullname, path=None): """Version of imp.find_module() that handles hierarchical module names""" file = None for tgt in fullname.split('.'): if file is not None: file.close() # close intermediate files (file, filename, descr) = imp.find_module(tgt, path) if descr[2] == imp.PY_SOURCE: break ...
4cb1dd70bc8ada38270c8364df8f38fcd8ce6895 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4cb1dd70bc8ada38270c8364df8f38fcd8ce6895/EditorWindow.py
path = path + "index.html"
path = path + "index.html"
def savefilename(self, url): type, rest = urllib.splittype(url) host, path = urllib.splithost(rest) while path[:1] == "/": path = path[1:] user, host = urllib.splituser(host) host, port = urllib.splitnport(host) host = string.lower(host) if not path or path[-1] == "/": path = path + "index.html" if os.sep != "/": path ...
02626eac1d45b425e9ebca080b68fa8b6627715d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/02626eac1d45b425e9ebca080b68fa8b6627715d/websucker.py
def __init__(self, recipients): self.recipients = recipients self.args = ( recipients,)
7baf72fe4c119e32e58bb5dd7356a68ce800b2f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7baf72fe4c119e32e58bb5dd7356a68ce800b2f7/smtplib.py
name=string.strip(name) if len(name)==0: name = socket.gethostname() try: name = socket.gethostbyaddr(name)[0] except socket.error: pass self.putcmd("helo",name)
self.putcmd("helo", _get_fqdn_hostname(name))
def helo(self, name=''): """SMTP 'helo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name = socket.gethostname() try: name = socket.gethostbyaddr(name)[0] except socket.error: pass self.putcmd("helo",name) (code,msg)=self.getreply() self...
7baf72fe4c119e32e58bb5dd7356a68ce800b2f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7baf72fe4c119e32e58bb5dd7356a68ce800b2f7/smtplib.py
name=string.strip(name) if len(name)==0: name = socket.gethostname() try: name = socket.gethostbyaddr(name)[0] except socket.error: pass self.putcmd("ehlo",name)
self.putcmd("ehlo", _get_fqdn_hostname(name))
def ehlo(self, name=''): """ SMTP 'ehlo' command. Hostname to send for this command defaults to the FQDN of the local host. """ name=string.strip(name) if len(name)==0: name = socket.gethostname() try: name = socket.gethostbyaddr(name)[0] except socket.error: pass self.putcmd("ehlo",name) (code,msg)=self.getreply() # A...
7baf72fe4c119e32e58bb5dd7356a68ce800b2f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7baf72fe4c119e32e58bb5dd7356a68ce800b2f7/smtplib.py
"Divide two Rats, returning quotient and remainder (reversed args)."""
"""Divide two Rats, returning quotient and remainder (reversed args)."""
def __rdivmod__(self, other): "Divide two Rats, returning quotient and remainder (reversed args).""" if isint(other): other = Rat(other) elif not isRat(other): return NotImplemented return divmod(other, self)
7f5c88801018da1f3551e55f4183bfe07e5379e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7f5c88801018da1f3551e55f4183bfe07e5379e6/test_binop.py
server_version = "Python-urllib/%s" % __version__ self.addheaders = [('User-agent', server_version)]
self.addheaders = [('User-agent', self.version)]
def __init__(self, proxies=None, **x509): if proxies is None: proxies = getproxies() assert hasattr(proxies, 'has_key'), "proxies must be a mapping" self.proxies = proxies self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') server_version = "Python-urllib/%s" % __version__ self.addheaders = [('U...
4334ad93aac7ff7ec9ab52dec1c0e59e134a5ce0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4334ad93aac7ff7ec9ab52dec1c0e59e134a5ce0/urllib.py
f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS")
f2 = self.tar.extractfile("/S-SPARSE-WITH-NULLS")
def test_sparse(self): """Test sparse member extraction. """ if self.sep != "|": f1 = self.tar.extractfile("S-SPARSE") f2 = self.tar.extractfile("S-SPARSE-WITH-NULLS") self.assert_(f1.read() == f2.read(), "_FileObject failed on sparse file member")
ff5c8b677975dc32839a3be17f3592a656c949b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff5c8b677975dc32839a3be17f3592a656c949b3/test_tarfile.py
filename = "0-REGTYPE-TEXT"
filename = "/0-REGTYPE-TEXT"
def test_readlines(self): """Test readlines() method of _FileObject. """ if self.sep != "|": filename = "0-REGTYPE-TEXT" self.tar.extract(filename, dirname()) lines1 = file(os.path.join(dirname(), filename), "r").readlines() lines2 = self.tar.extractfile(filename).readlines() self.assert_(lines1 == lines2, "_FileObject...
ff5c8b677975dc32839a3be17f3592a656c949b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff5c8b677975dc32839a3be17f3592a656c949b3/test_tarfile.py
lines1 = file(os.path.join(dirname(), filename), "r").readlines()
lines1 = file(os.path.join(dirname(), filename), "rU").readlines()
def test_readlines(self): """Test readlines() method of _FileObject. """ if self.sep != "|": filename = "0-REGTYPE-TEXT" self.tar.extract(filename, dirname()) lines1 = file(os.path.join(dirname(), filename), "r").readlines() lines2 = self.tar.extractfile(filename).readlines() self.assert_(lines1 == lines2, "_FileObject...
ff5c8b677975dc32839a3be17f3592a656c949b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff5c8b677975dc32839a3be17f3592a656c949b3/test_tarfile.py
filename = "0-REGTYPE"
filename = "/0-REGTYPE"
def test_seek(self): """Test seek() method of _FileObject, incl. random reading. """ if self.sep != "|": filename = "0-REGTYPE" self.tar.extract(filename, dirname()) data = file(os.path.join(dirname(), filename), "rb").read()
ff5c8b677975dc32839a3be17f3592a656c949b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/ff5c8b677975dc32839a3be17f3592a656c949b3/test_tarfile.py
return _urlopener.retrieve(url, filename)
return _urlopener.retrieve(url, filename)
def urlretrieve(url, filename=None): global _urlopener if not _urlopener: _urlopener = FancyURLopener() if filename: return _urlopener.retrieve(url, filename) else: return _urlopener.retrieve(url)
fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py
return _urlopener.retrieve(url)
return _urlopener.retrieve(url)
def urlretrieve(url, filename=None): global _urlopener if not _urlopener: _urlopener = FancyURLopener() if filename: return _urlopener.retrieve(url, filename) else: return _urlopener.retrieve(url)
fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py
self.tempcache.clear()
self.tempcache.clear()
def cleanup(self): # This code sometimes runs when the rest of this module # has already been deleted, so it can't use any globals # or import anything. if self.__tempfiles: for file in self.__tempfiles: try: self.__unlink(file) except: pass del self.__tempfiles[:] if self.tempcache: self.tempcache.clear()
fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py
def open(self, fullurl, data=None): fullurl = unwrap(fullurl) if self.tempcache and self.tempcache.has_key(fullurl): filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') return addinfourl(fp, headers, fullurl) type, url = splittype(fullurl) if not type: type = 'file' if self.proxies.has_key(type): prox...
fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py