rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
self.prefixes["http://www.w3.org/XML/1998/namespace"] = "xml" | self.prefixes.update(G_PREFIXES) | def __init__(self, prefixes = None): self.cio = StringIO.StringIO() self.prefixes = prefixes or {} self.prefixes["http://www.w3.org/XML/1998/namespace"] = "xml" self.prefixCounter = 0 | ba7f7bd4449a6737bbbcd42dac85428f56ada9e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ba7f7bd4449a6737bbbcd42dac85428f56ada9e7/domish.py |
if not os.path.isdir(dir): os.mkdir(dir) for subdir in ['new', 'cur', 'tmp', '.Trash']: os.mkdir(os.path.join(dir, subdir)) for subdir in ['new', 'cur', 'tmp']: os.mkdir(os.path.join(dir, '.Trash', subdir)) fp=open(os.path.join(dir, '.Trash', 'maildirfolder'), 'w') fp.close() | def userDirectory(self, name): """Get the directory for a user | ebfdaecfa498474c6b2947b8a04daa94d7209b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ebfdaecfa498474c6b2947b8a04daa94d7209b2a/maildir.py | |
print "password is", repr(self.opts['password']) | def postOptions(self): if not self.opts.has_key('password'): self.opt_password('-') print "password is", repr(self.opts['password']) | 76fc52ff9004f34ad549adc43b604666f3de49a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/76fc52ff9004f34ad549adc43b604666f3de49a9/manhole.py | |
testReadEmptyInput.timeout = 5 | def testReadEmptyInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READINPUT_CGI) cgiFile.close() | 497f67db80dbfffc7109051e230f6f09ac089187 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/497f67db80dbfffc7109051e230f6f09ac089187/test_cgi.py | |
testReadInput.timeout = 5 | def testReadInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READINPUT_CGI) cgiFile.close() | 497f67db80dbfffc7109051e230f6f09ac089187 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/497f67db80dbfffc7109051e230f6f09ac089187/test_cgi.py | |
testRealAllInput.timeout = 5 | def testRealAllInput(self): cgiFilename = os.path.abspath(self.mktemp()) cgiFile = file(cgiFilename, 'wt') cgiFile.write(READALLINPUT_CGI) cgiFile.close() | 497f67db80dbfffc7109051e230f6f09ac089187 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/497f67db80dbfffc7109051e230f6f09ac089187/test_cgi.py | |
testScriptsExecute.timeout=10 | def _cleanup(res): d = self.p.stopListening() d.addCallback(lambda ign: res) return d | 497f67db80dbfffc7109051e230f6f09ac089187 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/497f67db80dbfffc7109051e230f6f09ac089187/test_cgi.py | |
self.assertEquals(unittest.wait(d), "End") | self.assertEquals(util.wait(d), "End") | def _cbDoWait(self, result): self.assertEquals(result, "Beginning") d = defer.succeed("End") self.assertEquals(unittest.wait(d), "End") | d7098ebcbaad74554c2ff539e2dfb62ac775b6d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7098ebcbaad74554c2ff539e2dfb62ac775b6d1/test_util.py |
self.assertRaises(util.WaitIsNotReentrantError, unittest.wait, d) | self.assertRaises(util.WaitIsNotReentrantError, util.wait, d) | def testReturnedDeferredThenWait(self): d = self._returnedDeferredThenWait() self.assertRaises(util.WaitIsNotReentrantError, unittest.wait, d) | d7098ebcbaad74554c2ff539e2dfb62ac775b6d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7098ebcbaad74554c2ff539e2dfb62ac775b6d1/test_util.py |
d1.addCallback(lambda ignored: unittest.wait(d2)) unittest.wait(d1) | d1.addCallback(lambda ignored: util.wait(d2)) util.wait(d1) | def threadedOperation(n): time.sleep(n) return n | d7098ebcbaad74554c2ff539e2dfb62ac775b6d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7098ebcbaad74554c2ff539e2dfb62ac775b6d1/test_util.py |
if len(conn.channels) == 1 and not (options['fork'] and options['nocache']): | if len(conn.channels) == 1 and not (options['fork'] and not options['nocache']): | def closed(self): self.unix.sendMessage('closed', self.id) if len(conn.channels) == 1 and not (options['fork'] and options['nocache']): # just us left reactor.stop() | 138eaebae7a62107081cf5aa44913cae5ebbeddd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/138eaebae7a62107081cf5aa44913cae5ebbeddd/conch.py |
log.msg(str(self.conn.channels)) log.msg(str(options['fork'])) log.msg(str(options['nocache'])) if len(self.conn.channels) == 1 and not (options['fork'] and options['nocache']): | if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']): | def closed(self): log.msg('closed %s' % self) log.msg(str(self.conn.channels)) log.msg(str(options['fork'])) log.msg(str(options['nocache'])) if len(self.conn.channels) == 1 and not (options['fork'] and options['nocache']): # just us left reactor.stop() | 138eaebae7a62107081cf5aa44913cae5ebbeddd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/138eaebae7a62107081cf5aa44913cae5ebbeddd/conch.py |
if len(self.conn.channels) == 1 and not (options['fork'] and options['nocache']): | if len(self.conn.channels) == 1 and not (options['fork'] and not options['nocache']): | def closed(self): forwarding.SSHListenClientForwardingChannel.closed(self) if len(self.conn.channels) == 1 and not (options['fork'] and options['nocache']): # just us left reactor.stop() | 138eaebae7a62107081cf5aa44913cae5ebbeddd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/138eaebae7a62107081cf5aa44913cae5ebbeddd/conch.py |
else: for node in slots: node.removeAttribute('pattern') else: for node in slots: node.removeAttribute(name + 'Of') | def getPattern(self, name, default=missingPattern, clone=1, deep=1): """Get a named slot from the incoming template node. Returns a copy of the node and all its children. If there was more than one node with the same slot identifier, they will be returned in a round-robin fashion. """ #print self.templateNode.toxml() i... | 4d3715da170391b323b9e18fa2c284f35af101fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4d3715da170391b323b9e18fa2c284f35af101fe/widgets.py | |
config['nodaemon'] = config['nodaemon'] and not config['debug'] | config['nodaemon'] = config['nodaemon'] or config['debug'] | def runApp(config): passphrase = app.getPassphrase(config['encrypted']) app.installReactor(config['reactor']) config['nodaemon'] = config['nodaemon'] and not config['debug'] oldstdout = sys.stdout oldstderr = sys.stderr startLogging(config['logfile'], config['syslog'], config['prefix'], config['nodaemon']) app.initialL... | d9aabf39eb2fba0eda003d376d0dd8b0e982f1c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d9aabf39eb2fba0eda003d376d0dd8b0e982f1c6/twistd.py |
def discoverAuthority(host, roots, cache=None, p=None): if cache is None: cache = {} rootAuths = list(roots) parts = host.rstrip('.').split('.') parts.reverse() authority = rootAuths.pop() soFar = '' for part in parts: soFar = part + '.' + soFar msg = flow.wrap(lookupNameservers(soFar, authority, p)) yield msg msg... | d0059b0a120c5a50d8cc09f505ae2da492f93e12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d0059b0a120c5a50d8cc09f505ae2da492f93e12/root.py | ||
else: msg = flow.wrap(lookupAddress(soFar, authority, p)) yield msg msg = msg.next() records = msg.answers + msg.authority + msg.additional addresses = [r for r in records if r.type == dns.A] if addresses: authority = addresses[0].payload.dottedQuad() else: raise IOError("Resolution error") | def discoverAuthority(host, roots, cache=None, p=None): if cache is None: cache = {} rootAuths = list(roots) parts = host.rstrip('.').split('.') parts.reverse() authority = rootAuths.pop() soFar = '' for part in parts: soFar = part + '.' + soFar msg = flow.wrap(lookupNameservers(soFar, authority, p)) yield msg msg... | d0059b0a120c5a50d8cc09f505ae2da492f93e12 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d0059b0a120c5a50d8cc09f505ae2da492f93e12/root.py | |
return "InstanceMethod(%r, %r, \n\t%s)" % (self.name, self.klass, prettify(self.instance)) | return "InstanceMethod(%r, %r, \n\0%s)" % (self.name, self.klass, prettify(self.instance)) | def getSource(self): return "InstanceMethod(%r, %r, \n\t%s)" % (self.name, self.klass, prettify(self.instance)) | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
pass | return "Instance(%r, %s)" % (self.klass, prettify(stateDict)) | def getSource(self): #XXX make state be foo=bar instead of a dict. if self.stateIsDict: stateDict = self.state elif isinstance(self.state, Ref) and isinstance(self.state.obj, types.DictType): stateDict = self.state.obj else: stateDict = None if stateDict is not None: try: return "Instance(%r, %s)" % (self.klass, dictTo... | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
return "Ref(%d, \n\t%s)" % (self.refnum, prettify(self.obj)) | return "Ref(%d, \n\0%s)" % (self.refnum, prettify(self.obj)) | def getSource(self): if self.obj is None: raise RuntimeError("Don't try to display me before setting an object on me!") if self.refnum: return "Ref(%d, \n\t%s)" % (self.refnum, prettify(self.obj)) return prettify(self.obj) | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
raise NonFormattableDict(d) | raise NonFormattableDict("%r ain't a string" % k) if not r.match(k): raise NonFormattableDict("%r ain't an identifier" % k) | def dictToKW(d): out = [] items = d.items() items.sort() for k,v in items: if not isinstance(k, types.StringType): raise NonFormattableDict(d) out.append( "\n\t%s=%s," % (k, prettify(v)) ) return string.join(out, '') | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
"\n\t%s=%s," % (k, prettify(v)) | "\n\0%s=%s," % (k, prettify(v)) | def dictToKW(d): out = [] items = d.items() items.sort() for k,v in items: if not isinstance(k, types.StringType): raise NonFormattableDict(d) out.append( "\n\t%s=%s," % (k, prettify(v)) ) return string.join(out, '') | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
out.append('\n\t%s: %s,' % (prettify(k), prettify(v))) out.append(len(obj) and '\n\t}' or '}') | out.append('\n\0%s: %s,' % (prettify(k), prettify(v))) out.append(len(obj) and '\n\0}' or '}') | def prettify(obj): if hasattr(obj, 'getSource'): return obj.getSource() else: #basic type t = type(obj) if t in [types.StringType, types.UnicodeType, types.IntType, types.FloatType, types.LongType, types.NoneType]: return repr(obj) elif t is types.DictType: out = ['{'] for k,v in obj.items(): out.append('\n\t%s: %s,'... | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
out.append('\n\t%s,' % prettify(x)) out.append(len(obj) and '\n\t]' or ']') | out.append('\n\0%s,' % prettify(x)) out.append(len(obj) and '\n\0]' or ']') | def prettify(obj): if hasattr(obj, 'getSource'): return obj.getSource() else: #basic type t = type(obj) if t in [types.StringType, types.UnicodeType, types.IntType, types.FloatType, types.LongType, types.NoneType]: return repr(obj) elif t is types.DictType: out = ['{'] for k,v in obj.items(): out.append('\n\t%s: %s,'... | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
out.append('\n\t%s,' % prettify(x)) out.append(len(obj) and '\n\t)' or ')') | out.append('\n\0%s,' % prettify(x)) out.append(len(obj) and '\n\0)' or ')') | def prettify(obj): if hasattr(obj, 'getSource'): return obj.getSource() else: #basic type t = type(obj) if t in [types.StringType, types.UnicodeType, types.IntType, types.FloatType, types.LongType, types.NoneType]: return repr(obj) elif t is types.DictType: out = ['{'] for k,v in obj.items(): out.append('\n\t%s: %s,'... | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
for ch in s: if ch in ['[', '(', '{']: stack.append(ch) elif ch in [']', ')', '}']: | def eater(type, val, r, c, l, out=out, stack=stack): if val in ['[', '(', '{']: stack.append(val) elif val in [']', ')', '}']: | def indentify(s): out = [] stack = [] for ch in s: if ch in ['[', '(', '{']: stack.append(ch) elif ch in [']', ')', '}']: stack.pop() if ch == '\t': out.append(' '*len(stack)) else: out.append(ch) return string.join(out, '') | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
if ch == '\t': | if val == '\0': | def indentify(s): out = [] stack = [] for ch in s: if ch in ['[', '(', '{']: stack.append(ch) elif ch in [']', ')', '}']: stack.pop() if ch == '\t': out.append(' '*len(stack)) else: out.append(ch) return string.join(out, '') | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
out.append(ch) | out.append(val) l = ['', s] tokenize.tokenize(l.pop, eater) | def indentify(s): out = [] stack = [] for ch in s: if ch in ['[', '(', '{']: stack.append(ch) elif ch in [']', ')', '}']: stack.pop() if ch == '\t': out.append(' '*len(stack)) else: out.append(ch) return string.join(out, '') | 8fe5bd8521c56292cbda81a5e16ab51d100d5840 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8fe5bd8521c56292cbda81a5e16ab51d100d5840/aot.py |
def accumulateMethods(obj, dict, prefix=''): | def accumulateMethods(obj, dict, prefix='', curClass=None): | def accumulateMethods(obj, dict, prefix=''): """Raped'n'pasted from addMethodNamesToDict. This takes an *instance* object, and accumulates a dict of methname: *instance*MethObj pairs. """ for base in obj.__class__.__bases__: accumulateMethods(obj, dict, prefix) for name, method in obj.__class__.__dict__.items(): optNa... | 0d3d1ead837e78cffa573e73f207dd343338654f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d3d1ead837e78cffa573e73f207dd343338654f/reflect.py |
for base in obj.__class__.__bases__: accumulateMethods(obj, dict, prefix) for name, method in obj.__class__.__dict__.items(): | if not curClass: curClass = obj.__class__ for base in curClass.__bases__: accumulateMethods(obj, dict, prefix, base) for name, method in curClass.__dict__.items(): | def accumulateMethods(obj, dict, prefix=''): """Raped'n'pasted from addMethodNamesToDict. This takes an *instance* object, and accumulates a dict of methname: *instance*MethObj pairs. """ for base in obj.__class__.__bases__: accumulateMethods(obj, dict, prefix) for name, method in obj.__class__.__dict__.items(): optNa... | 0d3d1ead837e78cffa573e73f207dd343338654f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0d3d1ead837e78cffa573e73f207dd343338654f/reflect.py |
cmd.deferred.addBoth(close) d = DeferredList([cmd.deferred, protocol.deferred], fireOnOneErrback=1) | d.addBoth(close) | def close(x, m=_mutable): m[0] and m[0].disconnect() return x | 0b32993f650133174c7471dcae011c638fd3fade /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0b32993f650133174c7471dcae011c638fd3fade/ftp.py |
self.running = 1 | self.running = 0 | def stopService(self): self.running = 1 | f15bdd9d5bec3305bc03f1bd8ce3bd283f868e74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f15bdd9d5bec3305bc03f1bd8ce3bd283f868e74/service.py |
print 'false is open' | def channelOpen(self, ignored): print 'false is open' d = self.conn.sendRequest(self, 'exec', common.NS('false'), 1) d.addErrback(self._ebRequestFailed) log.msg('opened false') | 3104f1d96fa24987c113b94962a3198a080ec404 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/3104f1d96fa24987c113b94962a3198a080ec404/test_conch.py | |
def datagramReceived(self, datagram): | def datagramReceived(self, datagram, host): | def datagramReceived(self, datagram): print 'Datagram received: ', repr(datagram) self.sendDatagram() | c56d942f05a0c5fe404c1cb3bc01314ab9c4afa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c56d942f05a0c5fe404c1cb3bc01314ab9c4afa9/echoclient_udp.py |
protocol = ConnectedEchoClientDatagramProtocol() reactor.connectUDP('localhost', 8000, protocol) | protocol = EchoClientDatagramProtocol() t = reactor.listenUDP(0, protocol) | def main(): protocol = ConnectedEchoClientDatagramProtocol() reactor.connectUDP('localhost', 8000, protocol) reactor.run() | c56d942f05a0c5fe404c1cb3bc01314ab9c4afa9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c56d942f05a0c5fe404c1cb3bc01314ab9c4afa9/echoclient_udp.py |
ret = f(*args, **kwargs) | return f(*args, **kwargs) | exec """def %s(*args, **kwargs): | c3bfb32a194a8ad1971b042eb6ebfd7a51a97f98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c3bfb32a194a8ad1971b042eb6ebfd7a51a97f98/util.py |
return ret | exec """def %s(*args, **kwargs): | c3bfb32a194a8ad1971b042eb6ebfd7a51a97f98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c3bfb32a194a8ad1971b042eb6ebfd7a51a97f98/util.py | |
d.addErrback(self.receiveDirectMessage, sender.name, message, None) | if d: d.addErrback(self.receiveDirectMessage, sender.name, message, None) | def receiveDirectMessage(self, sender, message, metadata): if self.client: if metadata: d = self.client.receiveDirectMessage(sender.name, message, metadata) #If the client doesn't support metadata, call this function #again with no metadata, so none is sent d.addErrback(self.receiveDirectMessage, sender.name, message, ... | 0a65831d807a0f9e4a4aee778c2062c4ecaae851 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0a65831d807a0f9e4a4aee778c2062c4ecaae851/service.py |
d.addErrback(self.receiveGroupMessage, sender, group, message, None) | if d: d.addErrback(self.receiveGroupMessage, sender, group, message, None) | def receiveGroupMessage(self, sender, group, message, metadata): if sender is not self and self.client: if metadata: d = self.client.receiveGroupMessage(sender.name, group.name, message, metadata) d.addErrback(self.receiveGroupMessage, sender, group, message, None) else: self.client.receiveGroupMessage(sender.name, gro... | 0a65831d807a0f9e4a4aee778c2062c4ecaae851 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0a65831d807a0f9e4a4aee778c2062c4ecaae851/service.py |
def runProcess(self, env, request): | def runProcess(self, env, request, qargs=[]): | def runProcess(self, env, request): p = CGIProcessProtocol(request) reactor.spawnProcess(p, self.filter, [self.filter, self.filename], env, os.path.dirname(self.filename)) | 0573576dcf672cb95507d69d407323035d04742f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0573576dcf672cb95507d69d407323035d04742f/twcgi.py |
reactor.spawnProcess(p, self.filter, [self.filter, self.filename], env, os.path.dirname(self.filename)) | reactor.spawnProcess(p, self.filter, [self.filter, self.filename]+qargs, env, os.path.dirname(self.filename)) | def runProcess(self, env, request): p = CGIProcessProtocol(request) reactor.spawnProcess(p, self.filter, [self.filter, self.filename], env, os.path.dirname(self.filename)) | 0573576dcf672cb95507d69d407323035d04742f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0573576dcf672cb95507d69d407323035d04742f/twcgi.py |
if not [n.tagName in ('pre', 'code') for n in parents]: | if not [1 for n in parents if n.tagName in ('pre', 'code')]: | def writeNodeData(self, node): buf = StringIO() getLatexText(node, buf.write, latexEscape) parents = domhelpers.getParents(node.parentNode)[:-1] text = buf.getvalue() if not [n.tagName in ('pre', 'code') for n in parents]: text = text.replace('<', '$<$').replace('>', '$>$') self.writer(text) | 67a23ef345e7689e50560447dfc81ad921c1abce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/67a23ef345e7689e50560447dfc81ad921c1abce/latex.py |
if ftp_reply[key].find('%s') > -1: | if string.find(ftp_reply[key], '%s') > -1: | def reply(self, key, s = ''): if ftp_reply[key].find('%s') > -1: self.transport.write(ftp_reply[key] % s + '\r\n') else: self.transport.write(ftp_reply[key] + '\r\n') | d7c19cd40d07c8c37f856c9a364881ce2179988e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7c19cd40d07c8c37f856c9a364881ce2179988e/ftp.py |
wd = wd.replace('\\','/') while wd.find('//') > -1: wd = wd.replace('//','/') | wd = string.replace(wd,'\\','/') while string.find(wd, '//') > -1: wd = string.replace(wd, '//','/') | def ftp_Cwd(self, params): if self.checkauth(): return wd = os.path.normpath(params) if not os.path.isabs(wd): wd = os.path.normpath(self.wd + '/' + wd) wd = wd.replace('\\','/') while wd.find('//') > -1: wd = wd.replace('//','/') # '..', '\\', and '//' is there just to prevent stop hacking :P if (not os.path.isdir(sel... | d7c19cd40d07c8c37f856c9a364881ce2179988e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7c19cd40d07c8c37f856c9a364881ce2179988e/ftp.py |
if (not os.path.isdir(self.root + wd)) or (wd.find('..') > 0) or \ (wd.find('\\') > 0) or (wd.find('//') > 0): | if (not os.path.isdir(self.root + wd)) or (string.find(wd,'..') > 0) or \ (string.find(wd,'\\') > 0) or (string.find(wd,'//') > 0): | def ftp_Cwd(self, params): if self.checkauth(): return wd = os.path.normpath(params) if not os.path.isabs(wd): wd = os.path.normpath(self.wd + '/' + wd) wd = wd.replace('\\','/') while wd.find('//') > -1: wd = wd.replace('//','/') # '..', '\\', and '//' is there just to prevent stop hacking :P if (not os.path.isdir(sel... | d7c19cd40d07c8c37f856c9a364881ce2179988e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7c19cd40d07c8c37f856c9a364881ce2179988e/ftp.py |
wd = wd.replace('\\','/') | wd = string.replace(wd,'\\','/') | def ftp_Cwd(self, params): if self.checkauth(): return wd = os.path.normpath(params) if not os.path.isabs(wd): wd = os.path.normpath(self.wd + '/' + wd) wd = wd.replace('\\','/') while wd.find('//') > -1: wd = wd.replace('//','/') # '..', '\\', and '//' is there just to prevent stop hacking :P if (not os.path.isdir(sel... | d7c19cd40d07c8c37f856c9a364881ce2179988e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7c19cd40d07c8c37f856c9a364881ce2179988e/ftp.py |
if line.count(' ') > 0: | if string.count(line,' ') > 0: | def processLine(self, line): "Process the input from the client" line = string.strip(line) command = string.split(line) if command == []: self.reply('unknown') return 0 commandTmp, command = command[0], '' for c in commandTmp: if ord(c) < 128: command = command + c command = string.capitalize(command) print "-"+command... | d7c19cd40d07c8c37f856c9a364881ce2179988e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d7c19cd40d07c8c37f856c9a364881ce2179988e/ftp.py |
name = params[-1] | name = params[0] | def irc_WHO(self, prefix, params): #<< who #python #>> :benford.openprojects.net 352 glyph #python aquarius pc-62-31-193-114-du.blueyonder.co.uk forward.openprojects.net Aquarius H :3 Aquarius # ... #>> :benford.openprojects.net 352 glyph #python foobar europa.tranquility.net benford.openprojects.net skreech H :0 skree... | a1c0994200ef730d5e2e47b2c4cc87c4dd751e50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a1c0994200ef730d5e2e47b2c4cc87c4dd751e50/irc.py |
self.transport.write(record.encode()) | self.write(record.encode()) def dataReceived(self, data): print 'Received', repr(data) ImplicitStateProtocol.dataReceived(self, data) | def send(self, record): self.transport.write(record.encode()) | 525d0969c638dc5e40f93ff51887c101d1ef24ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/525d0969c638dc5e40f93ff51887c101d1ef24ab/tls.py |
def __init__(self, target): | def __init__(self, target, logFile=None): | def __init__(self, target): self.target = target | 06e0efe53171baa5b4a395ac55c8c14110b57ccf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/06e0efe53171baa5b4a395ac55c8c14110b57ccf/loopback.py |
self.request.write(self.file.read(abstract.FileDescriptor.bufferSize)) | buffer = self.file.read(abstract.FileDescriptor.bufferSize) self.request.write(buffer) | def resumeProducing(self): if (self.request is None) or (self.file.closed): return self.request.write(self.file.read(abstract.FileDescriptor.bufferSize)) if self.file.tell() == self.filesize: self.stopProducing() | 1968805e1b79c882ea1cc5155e1d464eaef999dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1968805e1b79c882ea1cc5155e1d464eaef999dd/ftp.py |
self.file = open(queuedfile, "rb") self.filesize = os.path.getsize(queuedfile) | if self.file is None: self.file = open(queuedfile, "rb") self.filesize = os.path.getsize(queuedfile) | def actionRETR(self, queuedfile): "Send the given file to the peer" self.file = open(queuedfile, "rb") self.filesize = os.path.getsize(queuedfile) producer = SendFileTransfer(self.file, self.filesize, self.makeRETRTransport()) producer.resumeProducing() | 1968805e1b79c882ea1cc5155e1d464eaef999dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1968805e1b79c882ea1cc5155e1d464eaef999dd/ftp.py |
list = os.listdir(dir) | list = os.listdir(dir) s = '' | def actionLIST(self, dir): """Prints outs the files in the given directory Note that the printout is very fake, and only gives the filesize, date, time and filename. """ list = os.listdir(dir) for a in list: s = a ff = os.path.join(dir, s) # the full filename mtime = time.strftime("%b %d %H:%M", time.gmtime(os.path.get... | 1968805e1b79c882ea1cc5155e1d464eaef999dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1968805e1b79c882ea1cc5155e1d464eaef999dd/ftp.py |
self.transport.write(diracc+"r-xr-xr-x 1 twisted twisted %11d" % fsize+' '+mtime+' '+s+'\r\n') self.pi.reply('fileok') self.pi.queuedfile = None self.transport.loseConnection() | s = s + diracc+"r-xr-xr-x 1 twisted twisted %11d" % fsize+' '+mtime+' '+s+'\r\n' self.action = 'RETR' self.file = StringIO.StringIO(s) self.filesize = len(s) reactor.callLater(0.1, self.executeAction) | def actionLIST(self, dir): """Prints outs the files in the given directory Note that the printout is very fake, and only gives the filesize, date, time and filename. """ list = os.listdir(dir) for a in list: s = a ff = os.path.join(dir, s) # the full filename mtime = time.strftime("%b %d %H:%M", time.gmtime(os.path.get... | 1968805e1b79c882ea1cc5155e1d464eaef999dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1968805e1b79c882ea1cc5155e1d464eaef999dd/ftp.py |
def reply(self, key, s = ''): if string.find(ftp_reply[key], '%s') > -1: if self.debug: print ftp_reply[key] % s + '\r\n' self.transport.write(ftp_reply[key] % s + '\r\n') else: if self.debug: print ftp_reply[key] + '\r\n' self.transport.write(ftp_reply[key] + '\r\n') | 1968805e1b79c882ea1cc5155e1d464eaef999dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1968805e1b79c882ea1cc5155e1d464eaef999dd/ftp.py | ||
def _reissue(self, reason, addressesLeft, addressesUsed, query, timeout): reason.trap(dns.DNSQueryTimeoutError) | 9adb02f03b3f564b403097ab89a178c2dc5bf0f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9adb02f03b3f564b403097ab89a178c2dc5bf0f6/client.py | ||
self.reactor.removeReader(w) self.reactor.removeWriter(w) | def read(self, sock): why = None w = self.watcher try: why = w.doRead() except: why = sys.exc_value log.msg('Error in %s.doRead()' % w) log.deferr() if why: try: w.connectionLost(failure.Failure(why)) except: log.deferr() self.reactor.removeReader(w) self.reactor.removeWriter(w) self.reactor.simulate() | 5cbc08473762b201a01bc0113770d567e015fe53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5cbc08473762b201a01bc0113770d567e015fe53/qtreactor.py | |
self.reactor.removeReader(w) self.reactor.removeWriter(w) | def write(self, sock): why = None w = self.watcher self.setEnabled(0) try: why = w.doWrite() except: why = sys.exc_value log.msg('Error in %s.doWrite()' % w) log.deferr() if why: try: w.connectionLost(failure.Failure(why)) except: log.deferr() self.reactor.removeReader(w) self.reactor.removeWriter(w) elif self.watcher:... | 5cbc08473762b201a01bc0113770d567e015fe53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5cbc08473762b201a01bc0113770d567e015fe53/qtreactor.py | |
return long(gmpy.mpz(n, 256)), i[4+l:] | return long(gmpy.mpz(n+'\x00', 256)), i[4+l:] | def _fastgetMP(i): l = struct.unpack('!L', i[:4])[0] n = i[4:l+4][::-1] return long(gmpy.mpz(n, 256)), i[4+l:] | e17734a4175e06ba9f8bf9f5262f60c1c1e63dab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e17734a4175e06ba9f8bf9f5262f60c1c1e63dab/common.py |
getLatexText(node, buf.write, entities=entities) self.writer(buf.getvalue()) | getLatexText(node, buf.write, entities=hacked_entities) self.writer(buf.getvalue().rstrip()) | def writeNodeData(self, node): buf = StringIO() getLatexText(node, buf.write, entities=entities) self.writer(buf.getvalue()) | 23193889eea4636051a9ffb6e713ef3afefa73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/23193889eea4636051a9ffb6e713ef3afefa73e8/slides.py |
text = domhelpers.getNodeText(node) lines = text.split('\n') self.writer('%font "typewriter", size 4\n') | buf = StringIO() getLatexText(node, buf.write, entities=entities) data = buf.getvalue() data = text.removeLeadingTrailingBlanks(data) lines = data.split('\n') | def visitNode_pre(self, node): # TODO: Syntax highlighting text = domhelpers.getNodeText(node) lines = text.split('\n') self.writer('%font "typewriter", size 4\n') self.fontStack.append(('typewriter', 4)) for line in lines: self.writer(' ' + line + '\n') del self.fontStack[-1] self.writer('%' + self.fontName() + '\n') | 23193889eea4636051a9ffb6e713ef3afefa73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/23193889eea4636051a9ffb6e713ef3afefa73e8/slides.py |
self.writer('\n%cont, ' + self.fontName() + '\n') | self.writer(' \n%cont, ' + self.fontName() + '\n') | def doFont(self, node, style): self.fontStack.append((style, None)) self.writer('\n%cont, ' + self.fontName() + '\n') self.visitNodeDefault(node) del self.fontStack[-1] self.writer('\n%cont, ' + self.fontName() + '\n') | 23193889eea4636051a9ffb6e713ef3afefa73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/23193889eea4636051a9ffb6e713ef3afefa73e8/slides.py |
return 'font "%s" size %d' % (name, size) | return 'font "%s", size %d' % (name, size) | def fontName(self): names = [x[0] for x in self.fontStack] if 'typewriter' in names: name = 'typewriter' else: name = '' | 23193889eea4636051a9ffb6e713ef3afefa73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/23193889eea4636051a9ffb6e713ef3afefa73e8/slides.py |
end_h2 = '\n\n%font "typewriter", size 2\n\n%font "standard"\n' start_li = "\t" | end_h2 = '\n\n\n' _start_ul = '\n' _start_li = "\t" | def fontName(self): names = [x[0] for x in self.fontStack] if 'typewriter' in names: name = 'typewriter' else: name = '' | 23193889eea4636051a9ffb6e713ef3afefa73e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/23193889eea4636051a9ffb6e713ef3afefa73e8/slides.py |
from twisted.internet import base self.original = base.seconds | from twisted.internet import base, task from twisted.python import runtime self.base_original = base.seconds self.task_original = task.seconds self.runtime_original = runtime.seconds | def install(self): # Violation is fun. from twisted.internet import base self.original = base.seconds base.seconds = self | 1350ffb429904b27e808178034fea10a0c01711e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1350ffb429904b27e808178034fea10a0c01711e/test_task.py |
from twisted.internet import base base.seconds = self.original | from twisted.internet import base, task from twisted.python import runtime base.seconds = self.base_original runtime.seconds = self.runtime_original task.seconds = self.task_original | def uninstall(self): from twisted.internet import base base.seconds = self.original | 1350ffb429904b27e808178034fea10a0c01711e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1350ffb429904b27e808178034fea10a0c01711e/test_task.py |
timings = [0.05, 0.1, 0.1, 0.1] | timings = [0.05, 0.1, 0.1] | def testBasicFunction(self): # Arrange to have time advanced enough so that our function is # called a few times. timings = [0.05, 0.1, 0.1, 0.1] | 1350ffb429904b27e808178034fea10a0c01711e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1350ffb429904b27e808178034fea10a0c01711e/test_task.py |
timings = [0.05, 0.1, 0.1, 0.1] | timings = [0.05, 0.1, 0.1] | def testDelayedStart(self): timings = [0.05, 0.1, 0.1, 0.1] | 1350ffb429904b27e808178034fea10a0c01711e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1350ffb429904b27e808178034fea10a0c01711e/test_task.py |
except socket.error: log.msg('port %s already bound' % port.port) | except socket.error, msg: log.msg('error on port %s: %s' % (port.port, msg[1])) | def run(self, save=1, installSignalHandlers=1): """Run this application, running the main loop if necessary. """ global resolver if not self.running: log.logOwner.own(self) for delayed in self.delayeds: main.addDelayed(delayed) if save: main.addShutdown(self.shutDownSave) for port in self.ports: try: port.startListenin... | 86c5ed40ba8a7a01972ee59197090d554c5c57c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/86c5ed40ba8a7a01972ee59197090d554c5c57c6/app.py |
self.failUnless('*' in f.openFile.getvalue()) | v = f.openFile.getvalue() self.failUnless('*' in v, "* not found in %r" % (v,)) | def testThingsGetLogged(self): t = StringTransportWithDisconnection() f = TestLoggingFactory(Server(), 'test') p = f.buildProtocol(('1.2.3.4', 5678)) t.protocol = p p.makeConnection(t) | d41737c7c99667c5e279f077a259b5f6639c9efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d41737c7c99667c5e279f077a259b5f6639c9efc/test_policies.py |
self.assertNotEqual(-1, f.openFile.getvalue().find("C 1: 'here are some bytes'")) self.assertNotEqual(-1, f.openFile.getvalue().find("S 1: 'here are some bytes'")) | v = f.openFile.getvalue() self.assertNotEqual(-1, v.find("C 1: 'here are some bytes'"), "Expected client string not found in %r" % (v,)) self.assertNotEqual(-1, v.find("S 1: 'here are some bytes'"), "Expected server string not found in %r" % (v,)) | def testThingsGetLogged(self): t = StringTransportWithDisconnection() f = TestLoggingFactory(Server(), 'test') p = f.buildProtocol(('1.2.3.4', 5678)) t.protocol = p p.makeConnection(t) | d41737c7c99667c5e279f077a259b5f6639c9efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d41737c7c99667c5e279f077a259b5f6639c9efc/test_policies.py |
self.assertNotEqual(-1, f.openFile.getvalue().find('ConnectionDone')) | v = f.openFile.getvalue() self.assertNotEqual(-1, v.find('ConnectionDone'), "Connection done notification not found in %r" % (v,)) | def testThingsGetLogged(self): t = StringTransportWithDisconnection() f = TestLoggingFactory(Server(), 'test') p = f.buildProtocol(('1.2.3.4', 5678)) t.protocol = p p.makeConnection(t) | d41737c7c99667c5e279f077a259b5f6639c9efc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/d41737c7c99667c5e279f077a259b5f6639c9efc/test_policies.py |
client's address | client's address. | def getPeer(self): """ Returns a tuple of ('INET', hostname, port), indicating the connected client's address """ return ('INET',)+self.client | 17923230bb821957e010b6946f53e872e09cd815 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/17923230bb821957e010b6946f53e872e09cd815/tcp.py |
a.connectionLost() | a.connectionLost(IOError("all one")) | def testBuffer(self): b = StringIOWithoutClosing() a = http.HTTPChannel() a.requestFactory = DummyHTTPHandler a.makeConnection(protocol.FileWrapper(b)) # one byte at a time, to stress it. for byte in self.requests: a.dataReceived(byte) a.connectionLost() value = b.getvalue() if value != self.expected_response: for i in... | 7dfb56cacd72b8a72d920c6d9be6d1d7e3be02c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7dfb56cacd72b8a72d920c6d9be6d1d7e3be02c9/test_http.py |
a.connectionLost() | a.connectionLost(IOError("all done")) | def runRequest(self, httpRequest, requestClass): httpRequest = httpRequest.replace("\n", "\r\n") b = StringIOWithoutClosing() a = http.HTTPChannel() a.requestFactory = requestClass a.makeConnection(protocol.FileWrapper(b)) # one byte at a time, to stress it. for byte in httpRequest: a.dataReceived(byte) a.connectionLos... | 7dfb56cacd72b8a72d920c6d9be6d1d7e3be02c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/7dfb56cacd72b8a72d920c6d9be6d1d7e3be02c9/test_http.py |
map(lambda line, self=self: self.sendLine(fmt % line), lines) | map(lambda line, self=self, fmt=fmt: self.sendLine(fmt % line), lines) | def msg(self, user, message, length = None): fmt = "PRIVMSG %s :%%s" % (user,) | 685183c2441b60f9140182be407aa9b5ddf1d6f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/685183c2441b60f9140182be407aa9b5ddf1d6f2/irc.py |
print cnames | def processAnswer_1(self, message): '''looking for name->address resolution choose one of the IPs at random''' answers, cnames, cnameMap = [], [], {} for answer in message.answers: if answer.type in (1, 5): cnameMap[answer.name.name] = answer if answer.name.name != self.name: continue if answer.type == 1: answers.appe... | eff36a163fc39ec60ded5afad79620136394234a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/eff36a163fc39ec60ded5afad79620136394234a/dns.py | |
svc = internet.TCPServer(1025, factory) service.IService(application).addService(svc) | internet.TCPServer(1025, factory).setServiceParent(application) | def message(self, message): self.transport.write(message + '\n') | 47e5bb7ce4f2ca95d69f41034157e83dbba241c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/47e5bb7ce4f2ca95d69f41034157e83dbba241c5/chatserver.py |
for child in node.childNodes: node.removeChild(child) | while node.childNodes.length: node.removeChild(node.firstChild) | def clearNode(node): """ Remove all children from the given node. """ if node.hasChildNodes(): for child in node.childNodes: node.removeChild(child) | 78fa117caf0b47607cbedce4e06d720ca32eb070 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/78fa117caf0b47607cbedce4e06d720ca32eb070/domhelpers.py |
A result that is true (which will be a negtive number) implies the | A result that is true (which will be a negative number) implies the | def doWrite(self): """Called when data is available for writing. | 51113132c989a5cbb7cded6d4512a8e3250f4cf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/51113132c989a5cbb7cded6d4512a8e3250f4cf8/abstract.py |
methodPrefix = 'test' | def getResult(self): """I return a tuple containing the first result obtained from the test. If the test was successful, this is also the only result. """ if self.runs > 0: if not self.failures: if self.todo: self.failures.append((reporter.UNEXPECTED_SUCCESS, self.todo)) else: self.failures.append((reporter.SUCCESS,)) ... | a733615e3c18ef32b1d3021ece2ee94ac3e9254d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a733615e3c18ef32b1d3021ece2ee94ac3e9254d/unittest.py | |
if e.args[0] == EWOULDBLOCK: | if e.args[0] == tcp.EWOULDBLOCK: | def doRead(self): """Called when my socket is ready for reading. | 462984aa8078a38ff17ef6775c6dfc3575fdbe90 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/462984aa8078a38ff17ef6775c6dfc3575fdbe90/ssl.py |
return unittest.wait(d) | return unittest.wait(d, timeout=timeout) | def wait(self, d, timeout=10.0): return unittest.wait(d) | ffb33b84e30ecee036d0f07a068fd3353413b5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ffb33b84e30ecee036d0f07a068fd3353413b5c5/test_adbapi.py |
return unittest.wait(d) | return unittest.wait(d, timeout=timeout) | def wait(self, d, timeout=10.0): return unittest.wait(d) | ffb33b84e30ecee036d0f07a068fd3353413b5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/ffb33b84e30ecee036d0f07a068fd3353413b5c5/test_adbapi.py |
reactor.callFromThread(self.response.stream.finish, failure.Failure()) | reactor.callFromThread(self.stream.finish, failure.Failure()) | def run(self): from twisted.internet import reactor # Called in application thread try: result = self.application(self.environment, self.startWSGIResponse) self.handleResult(result) except: if not self.headersSent: reactor.callFromThread(self.__error, failure.Failure()) else: reactor.callFromThread(self.response.stream... | bec576033f37cd6a573b842521b9686c9194d679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bec576033f37cd6a573b842521b9686c9194d679/wsgi.py |
self.response.stream=stream.ProducerStream() | self.stream=self.response.stream=stream.ProducerStream() | def write(self, output): # Called in application thread from twisted.internet import reactor if self.response is None: raise RuntimeError( "Application didn't call startResponse before writing data!") if not self.headersSent: self.response.stream=stream.ProducerStream() self.headersSent = True # After this, we cannot ... | bec576033f37cd6a573b842521b9686c9194d679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bec576033f37cd6a573b842521b9686c9194d679/wsgi.py |
self.response.stream.registerProducer(self, True) | self.stream.registerProducer(self, True) | def _start(): # Called in IO thread self.response.stream.registerProducer(self, True) self.__callback() # Notify application thread to start writing self.unpaused.set() | bec576033f37cd6a573b842521b9686c9194d679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bec576033f37cd6a573b842521b9686c9194d679/wsgi.py |
reactor.callFromThread(self.response.stream.write, output) | reactor.callFromThread(self.stream.write, output) | def _start(): # Called in IO thread self.response.stream.registerProducer(self, True) self.__callback() # Notify application thread to start writing self.unpaused.set() | bec576033f37cd6a573b842521b9686c9194d679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bec576033f37cd6a573b842521b9686c9194d679/wsgi.py |
reactor.callFromThread(self.response.stream.finish) | reactor.callFromThread(self.stream.finish) | def handleResult(self, result): # Called in application thread try: from twisted.internet import reactor if (isinstance(result, FileWrapper) and hasattr(result.filelike, 'fileno') and not self.headersSent): if self.response is None: raise RuntimeError( "Application didn't call startResponse before writing data!") self.... | bec576033f37cd6a573b842521b9686c9194d679 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/bec576033f37cd6a573b842521b9686c9194d679/wsgi.py |
return '''<table bgcolor=" | return '''<table bgcolor=" | def htmlInst(i): if hasattr(i, "__html__"): s = i.__html__() else: s = '<code>'+html.escape(repr(i))+'</code>' return '''<table bgcolor="#cc7777"><tr><td><b>%s</b> instance</td></tr> <tr bgcolor="#ff9999"><td>%s</td></tr> </table> ''' % (i.__class__, s) | 21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0/widgets.py |
''' % (i.__class__, s) | ''' % (i.__class__, id(i), s) | def htmlInst(i): if hasattr(i, "__html__"): s = i.__html__() else: s = '<code>'+html.escape(repr(i))+'</code>' return '''<table bgcolor="#cc7777"><tr><td><b>%s</b> instance</td></tr> <tr bgcolor="#ff9999"><td>%s</td></tr> </table> ''' % (i.__class__, s) | 21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/21ae10c6f9b659c182ffdca9f0b1ac1ae00c9bf0/widgets.py |
from xml.dom.minidom import parse | try: from xml.dom.minidom import parse except ImportError: return | def _getSVNVersion(self): mod = sys.modules.get(self.package) if mod: ent = os.path.join(os.path.dirname(mod.__file__), '.svn', 'entries') if os.path.exists(ent): from xml.dom.minidom import parse doc = parse(file(ent)).documentElement for node in doc.childNodes: if hasattr(node, 'getAttribute'): rev = node.getAttribut... | 8f3be5cb40cc400469a255f5ca399ba13fd51e8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/8f3be5cb40cc400469a255f5ca399ba13fd51e8f/versions.py |
state = LogFile.__getstate__(self) | state = BaseLogFile.__getstate__(self) | def __getstate__(self): state = LogFile.__getstate__(self) del state["size"] return state | 051d913db16cc13ba2712353038a7ab107b37d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/051d913db16cc13ba2712353038a7ab107b37d9a/logfile.py |
def __getstate__(self): state = LogFile.__getstate__(self) del state["size"] return state | 051d913db16cc13ba2712353038a7ab107b37d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/051d913db16cc13ba2712353038a7ab107b37d9a/logfile.py | ||
state = LogFile.__getstate__(self) | state = BaseLogFile.__getstate__(self) | def __getstate__(self): state = LogFile.__getstate__(self) del state["lastDate"] return state | 051d913db16cc13ba2712353038a7ab107b37d9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/051d913db16cc13ba2712353038a7ab107b37d9a/logfile.py |
import domhandlers, domwidgets | import dominput, domwidgets | def getMethodForNode(self, node): if not node.hasAttributes(): return id = node.getAttribute("id") if id: if self._byid.has_key(id): return self._byid[id] klass = node.getAttribute("class") if klass: if self._byclass.has_key(klass): return self._byclass[klass] if self._bytag.has_key(str(node.nodeName)): return self._by... | 6ed1da994d6509ac7b85b84495d505789d6b7f46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6ed1da994d6509ac7b85b84495d505789d6b7f46/domtemplate.py |
controllerFactory = getattr(domhandlers, controllerName, DefaultHandler) | controllerFactory = getattr(dominput, controllerName, DefaultHandler) | def getNodeController(self, request, node): # Most specific controllerName = node.getAttribute('controller') # Next-most specific if not controllerName: controllerName = node.getAttribute('id') # Least specific if not controllerName: controllerName = node.getAttribute('class') # Look up a handler controllerFactory = D... | 6ed1da994d6509ac7b85b84495d505789d6b7f46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/6ed1da994d6509ac7b85b84495d505789d6b7f46/domtemplate.py |
self.escapeMode = 1 fd = 0 try: new = tty.tcgetattr(fd) except: log.msg('not a typewriter!') else: new[3] = new[3] & ~tty.ICANON & ~tty.ECHO new[6][tty.VMIN] = 1 new[6][tty.VTIME] = 0 tty.tcsetattr(fd, tty.TCSANOW, new) tty.setraw(fd) | if (options['command'] and options['tty']) or not options['notty']: fd = 0 try: new = tty.tcgetattr(fd) except: log.msg('not a typewriter!') else: new[3] = new[3] & ~tty.ICANON & ~tty.ECHO new[6][tty.VMIN] = 1 new[6][tty.VTIME] = 0 tty.tcsetattr(fd, tty.TCSANOW, new) tty.setraw(fd) | def channelOpen(self, foo): #global globalSession #globalSession = self # turn off local echo if options['agent']: d = self.conn.sendRequest(self, 'auth-agent-req@openssh.com', '', wantReply=1) d.addBoth(lambda x:log.msg(x)) if options['noshell']: return self.escapeMode = 1 fd = 0 #sys.stdin.fileno() try: new = tty.tcg... | 0b278fb0f6b45a71f7e8a6ee05680d7b5b1f6d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0b278fb0f6b45a71f7e8a6ee05680d7b5b1f6d7b/conch.py |
if options['escape']: | if options['escape'] and not options['notty']: self.escapeMode = 1 | def channelOpen(self, foo): #global globalSession #globalSession = self # turn off local echo if options['agent']: d = self.conn.sendRequest(self, 'auth-agent-req@openssh.com', '', wantReply=1) d.addBoth(lambda x:log.msg(x)) if options['noshell']: return self.escapeMode = 1 fd = 0 #sys.stdin.fileno() try: new = tty.tcg... | 0b278fb0f6b45a71f7e8a6ee05680d7b5b1f6d7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/0b278fb0f6b45a71f7e8a6ee05680d7b5b1f6d7b/conch.py |
val = eval(code, self.factory.namespace) | val = eval(code) | def perspective_do(self, mesg): fn = "$manhole" try: code = compile(mesg, fn, 'eval') except: try: code = compile(mesg, fn, 'exec') except: io = StringIO.StringIO() traceback.print_exc(file=io) return io.getvalue() try: val = eval(code, self.factory.namespace) except: io = StringIO.StringIO() traceback.print_exc(file=i... | 68752cffdebee9e43a8a3e13db7c8af247a8c60c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/68752cffdebee9e43a8a3e13db7c8af247a8c60c/service.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.