rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
return newPacket(self.pubTag, self._bodyStream, minHeaderLen = minHeaderLen) | return self._msgClass.newPacket(self.pubTag, self._bodyStream, minHeaderLen = minHeaderLen) | def toPublicKey(self, minHeaderLen = 2): return newPacket(self.pubTag, self._bodyStream, minHeaderLen = minHeaderLen) | 4fd56e701ef4706d42981fa85285185ee22dae57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/4fd56e701ef4706d42981fa85285185ee22dae57/openpgpfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
9632,
12,
2890,
16,
1131,
1864,
2891,
273,
576,
4672,
327,
394,
6667,
12,
2890,
18,
10174,
1805,
16,
365,
6315,
3432,
1228,
16,
1131,
1864,
2891,
273,
1131,
1864,
2891,
13,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
9632,
12,
2890,
16,
1131,
1864,
2891,
273,
576,
4672,
327,
394,
6667,
12,
2890,
18,
10174,
1805,
16,
365,
6315,
3432,
1228,
16,
1131,
1864,
2891,
273,
1131,
1864,
2891,
13,
2,
-10... |
return xpcom.server.WrapObject(DefaultClassInfo(self._obj_.__class__), iid, bWrapClient = 0) | return GetClassInfoForClass(self._obj_.__class__) | def _QueryInterface_(self, com_object, iid): # Framework allows us to return a single boolean integer, # or a COM object. if iid in self._nominated_interfaces_: # We return the underlying object re-wrapped # in a new gateway - which is desirable, as one gateway should only support # one interface (this wont affect the users of this policy - we can have as many # gateways as we like pointing to the same Python objects - the users never # see what object the call came in from. # NOTE: We could have simply returned the instance and let the framework # do the auto-wrap for us - but this way we prevent a round-trip back into Python # code just for the autowrap. return xpcom.server.WrapObject(self._obj_, iid, bWrapClient = 0) | 25cc439a6634e0648bc276f5c054d9dabfa560ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13067/25cc439a6634e0648bc276f5c054d9dabfa560ca/policy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1138,
1358,
67,
12,
2890,
16,
532,
67,
1612,
16,
22819,
4672,
468,
13472,
5360,
584,
358,
327,
279,
2202,
1250,
3571,
16,
468,
578,
279,
5423,
733,
18,
309,
22819,
316,
365,
6315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1138,
1358,
67,
12,
2890,
16,
532,
67,
1612,
16,
22819,
4672,
468,
13472,
5360,
584,
358,
327,
279,
2202,
1250,
3571,
16,
468,
578,
279,
5423,
733,
18,
309,
22819,
316,
365,
6315,... |
if self.originalTrackNumber is not None: ET.SubElement(root, 'upnp:originalTrackNumber').text = \ str(self.originalTrackNumber) | def toElement(self,**kwargs): | e302bd87db2a38b1a1be9d8bf77e3411b0db4ee6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11626/e302bd87db2a38b1a1be9d8bf77e3411b0db4ee6/DIDLLite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
1046,
12,
2890,
16,
636,
4333,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
1046,
12,
2890,
16,
636,
4333,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
if count_words(self.target_f.strings): | if filter(None, self.target_f.strings): | def markfuzzy(self, value=True): if self.state <= OBSOLETE: return | 2c35e62ffe3ab5e1666ed936af78198262141082 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11388/2c35e62ffe3ab5e1666ed936af78198262141082/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
74,
13903,
12,
2890,
16,
460,
33,
5510,
4672,
309,
365,
18,
2019,
1648,
9730,
3584,
4311,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2267,
74,
13903,
12,
2890,
16,
460,
33,
5510,
4672,
309,
365,
18,
2019,
1648,
9730,
3584,
4311,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
vetoed = metaio.new_from_template(self) keep = metaio.new_from_template(self) | vetoed = table.new_from_template(self) keep = table.new_from_template(self) | def veto(self,seglist): vetoed = metaio.new_from_template(self) keep = metaio.new_from_template(self) for row in self.rows: time = row.get_end() if time in seglist: vetoed.append(event) else: keep.append(event) | e61476db1c18ebe56acdb203a807e6f90b1dfe1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/e61476db1c18ebe56acdb203a807e6f90b1dfe1e/lsctables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
11453,
12,
2890,
16,
5680,
1098,
4672,
331,
11453,
329,
273,
1014,
18,
2704,
67,
2080,
67,
3202,
12,
2890,
13,
3455,
273,
1014,
18,
2704,
67,
2080,
67,
3202,
12,
2890,
13,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
11453,
12,
2890,
16,
5680,
1098,
4672,
331,
11453,
329,
273,
1014,
18,
2704,
67,
2080,
67,
3202,
12,
2890,
13,
3455,
273,
1014,
18,
2704,
67,
2080,
67,
3202,
12,
2890,
13,
364,
... |
code[skipno] = len(code) - skipno else: code[skipyes] = len(code) - skipyes + 1 | code[skipno] = _len(code) - skipno else: code[skipyes] = _len(code) - skipyes + 1 | def fixup(literal, flags=flags): return _sre.getlower(literal, flags) | 2177055b902a7e649c7988bb4499ab5115b4ea1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2177055b902a7e649c7988bb4499ab5115b4ea1d/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
(pin, pout) = popen2(cmd, 'b') def writer(): try: pin.write(s) pin.close() except IOError, inst: if inst.errno != errno.EPIPE: raise w = threading.Thread(target=writer) w.start() f = pout.read() pout.close() w.join() return f | p = subprocess.Popen(cmd, shell=True, close_fds=closefds, stdin=subprocess.PIPE, stdout=subprocess.PIPE) pout, perr = p.communicate(s) return pout | def pipefilter(s, cmd): '''filter string S through command CMD, returning its output''' (pin, pout) = popen2(cmd, 'b') def writer(): try: pin.write(s) pin.close() except IOError, inst: if inst.errno != errno.EPIPE: raise # we should use select instead on UNIX, but this will work on most # systems, including Windows w = threading.Thread(target=writer) w.start() f = pout.read() pout.close() w.join() return f | 2ca5ed62752f2a3c9ca8f8a51141a164fd23c336 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/2ca5ed62752f2a3c9ca8f8a51141a164fd23c336/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6010,
2188,
12,
87,
16,
1797,
4672,
9163,
2188,
533,
348,
3059,
1296,
18052,
16,
5785,
2097,
876,
26418,
261,
13097,
16,
293,
659,
13,
273,
30925,
22,
12,
4172,
16,
296,
70,
6134,
1652... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6010,
2188,
12,
87,
16,
1797,
4672,
9163,
2188,
533,
348,
3059,
1296,
18052,
16,
5785,
2097,
876,
26418,
261,
13097,
16,
293,
659,
13,
273,
30925,
22,
12,
4172,
16,
296,
70,
6134,
1652... |
var update_timeout = -1; | var update_time = -1; | def javascript(): s = r""" | da2842effe3912283a0cf2046f64d4c6d1af156b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/da2842effe3912283a0cf2046f64d4c6d1af156b/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
436,
8395,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
436,
8395,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if Lockable.wl_isLocked(ob): | if wl_isLocked(ob): | def index_html(self, REQUEST, RESPONSE): """Publish the object to the external editor helper app""" security = getSecurityManager() parent = self.aq_parent try: ob = parent[REQUEST['target']] # Try getitem except KeyError: ob = getattr(parent, REQUEST['target']) # Try getattr except AttributeError: # Handle objects that are methods in ZClasses ob = parent.propertysheets.methods[REQUEST['target']] r = [] r.append('url:%s' % ob.absolute_url()) r.append('meta_type:%s' % ob.meta_type) if hasattr(Acquisition.aq_base(ob), 'content_type'): if callable(ob.content_type): r.append('content_type:%s' % ob.content_type()) else: r.append('content_type:%s' % ob.content_type) if REQUEST._auth: if REQUEST._auth[-1] == '\n': auth = REQUEST._auth[:-1] else: auth = REQUEST._auth r.append('auth:%s' % auth) r.append('cookie:%s' % REQUEST.environ.get('HTTP_COOKIE','')) if Lockable.wl_isLocked(ob): # Object is locked, send down the lock token # owned by this user (if any) user_id = security.getUser().getId() for lock in ob.wl_lockValues(): if not lock.isValid(): continue # Skip invalid/expired locks creator = lock.getCreator() if creator and creator[1] == user_id: # Found a lock for this user, so send it r.append('lock-token:%s' % lock.getLockToken()) break r.append('') RESPONSE.setHeader('Pragma', 'no-cache') if hasattr(Acquisition.aq_base(ob), 'data') \ and hasattr(ob.data, '__class__') \ and ob.data.__class__ is Image.Pdata: # We have a File instance with chunked data, lets stream it metadata = join(r, '\n') RESPONSE.setHeader('Content-Type', 'application/x-zope-edit') RESPONSE.setHeader('Content-Length', len(metadata) + ob.get_size() + 1) RESPONSE.write(metadata) RESPONSE.write('\n') data = ob.data while data is not None: RESPONSE.write(data.data) data = data.next return '' if hasattr(ob, 'manage_FTPget'): try: r.append(ob.manage_FTPget()) except TypeError: # some need the R/R pair! r.append(ob.manage_FTPget(REQUEST, RESPONSE)) elif hasattr(ob, 'EditableBody'): r.append(ob.EditableBody()) elif hasattr(ob, 'document_src'): r.append(ob.document_src(REQUEST, RESPONSE)) elif hasattr(ob, 'read'): r.append(ob.read()) else: # can't read it! raise 'BadRequest', 'Object does not support external editing' RESPONSE.setHeader('Content-Type', 'application/x-zope-edit') return join(r, '\n') | d129504c8fd3481c106ac552932369c5e889fa98 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/d129504c8fd3481c106ac552932369c5e889fa98/ExternalEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
6024,
326,
733,
358,
326,
3903,
4858,
4222,
595,
8395,
225,
4373,
273,
19288,
1318,
1435,
982,
273,
365,
18,
69,
85,
67,
2938... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
6024,
326,
733,
358,
326,
3903,
4858,
4222,
595,
8395,
225,
4373,
273,
19288,
1318,
1435,
982,
273,
365,
18,
69,
85,
67,
2938... |
newnet=pynet.SymmFullNet(N) | newnet=pynet.SymmFullNet(len(keep_these_nodes)) nodedict={} for i,node in enumerate(keep_these_nodes): nodedict[node]=i edges=list(net.edges) for edge in edges: if (edge[0] in keep_these_nodes) and (edge[1] in keep_these_nodes): newnet[nodedict[edge[0]]][nodedict[edge[1]]]=edge[2] copyproperties=hasattr(net,'nodeProperty') if copyproperties: for node_property in net.nodeProperty: netext.addNodeProperty(newnet,node_property) for node in keep_these_nodes: for node_property in newnet.nodeProperty: newnet.nodeProperty[node_property][nodedict[node]]=net.nodeProperty[node_property][node] | def filterNet(net,keep_these_nodes): '''Takes a network net, and returns a network newnet with only those nodes listed in keep_these_nodes. Node properties etc are left untouched.''' N=len(net._nodes) if (isinstance(net,pynet.SymmFullNet)): newnet=pynet.SymmFullNet(N) else: newnet=pynet.SymmNet() edges=list(net.edges) for edge in edges: if (edge[0] in keep_these_nodes) and (edge[1] in keep_these_nodes): newnet[edge[0]][edge[1]]=edge[2] netext.copyNodeProperties(net,newnet) return newnet | 59548869b8741c35adccd2efb3f0b4458aa29be2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/768/59548869b8741c35adccd2efb3f0b4458aa29be2/transforms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
7308,
12,
2758,
16,
10102,
67,
451,
3392,
67,
4690,
4672,
9163,
11524,
279,
2483,
2901,
16,
471,
1135,
279,
2483,
394,
2758,
598,
1338,
5348,
2199,
12889,
316,
3455,
67,
451,
3392,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
7308,
12,
2758,
16,
10102,
67,
451,
3392,
67,
4690,
4672,
9163,
11524,
279,
2483,
2901,
16,
471,
1135,
279,
2483,
394,
2758,
598,
1338,
5348,
2199,
12889,
316,
3455,
67,
451,
3392,... |
self.s.shutdown() | self.s.shutdown(hacksessconfcheckpoint=False) | def OnExit(self): print >>sys.stderr,"main: ONEXIT" self.shuttingdown = True self.remove_downloads_in_vodmode_if_not_complete() | 9f1204bf39e3e79b0d277edaa7bac4b04657ad2f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/9f1204bf39e3e79b0d277edaa7bac4b04657ad2f/BaseApp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6767,
12,
2890,
4672,
1172,
1671,
9499,
18,
11241,
10837,
5254,
30,
6229,
28682,
6,
365,
18,
674,
25387,
2378,
273,
1053,
365,
18,
4479,
67,
7813,
87,
67,
267,
67,
90,
369,
3188,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6767,
12,
2890,
4672,
1172,
1671,
9499,
18,
11241,
10837,
5254,
30,
6229,
28682,
6,
365,
18,
674,
25387,
2378,
273,
1053,
365,
18,
4479,
67,
7813,
87,
67,
267,
67,
90,
369,
3188,... |
if res['Value']['Successful'].has_key(pfn): gLogger.info("RemovalAgent.execute: Successfully requested retransfer of %s." % pfn) oRequest.setSubRequestFileAttributeValue(ind,'removal',lfn,'Status','Done') | if res['Value']['Successful'].has_key( pfn ): gLogger.info( "RemovalAgent.execute: Successfully requested retransfer of %s." % pfn ) oRequest.setSubRequestFileAttributeValue( ind, 'removal', lfn, 'Status', 'Done' ) | def executeRequest(self): ################################################ # Get a request from request DB gMonitor.addMark( "Iteration", 1 ) res = self.RequestDBClient.getRequest('removal') if not res['OK']: gLogger.info("RemovalAgent.execute: Failed to get request from database.") return S_OK() elif not res['Value']: gLogger.info("RemovalAgent.execute: No requests to be executed found.") return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] sourceServer= res['Value']['Server'] try: jobID = int(res['Value']['JobID']) except: jobID = 0 gLogger.info("RemovalAgent.execute: Obtained request %s" % requestName) | 639c184ef75c7730d44d5168750f1731c63bf98b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/639c184ef75c7730d44d5168750f1731c63bf98b/RemovalAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... |
self.sock.settimeout(120) self.sock.connect((host, int(port))) | self.sock.settimeout(TIMEOUT) self.sock.connect((host, int(port))) | def connect(self, host, port=False): if not port: buf = host.split('//')[1] host, port = buf.rsplit(':', 1) hostname = host if host in DNS_CACHE: host = DNS_CACHE[host] self.sock = None if socket.has_ipv6: try: socket.getaddrinfo(host, int(port), socket.AF_INET6) self.sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) except: pass if self.sock is None: self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.settimeout(120) self.sock.connect((host, int(port))) DNS_CACHE[hostname], port = self.sock.getpeername()[:2] try: sock = None if socket.has_ipv6: try: socket.getaddrinfo(host, int(port), socket.AF_INET6) sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM) except: pass if sock is None: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(120) sock.connect((host, int(port))) if hasattr(socket, 'ssl'): ssl_sock = socket.ssl(sock) self.ssl = True except: pass if self.ssl: self.ssl_sock = socket.ssl(self.sock) self.host = host self.hostname = hostname self.port = port self.connected = True | cec83d810f50a36a699a964d066d5807288b14e6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/cec83d810f50a36a699a964d066d5807288b14e6/pysocket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
16,
1756,
33,
8381,
4672,
309,
486,
1756,
30,
1681,
273,
1479,
18,
4939,
2668,
759,
6134,
63,
21,
65,
1479,
16,
1756,
273,
1681,
18,
86,
4939,
2668,
30,
218... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
16,
1756,
33,
8381,
4672,
309,
486,
1756,
30,
1681,
273,
1479,
18,
4939,
2668,
759,
6134,
63,
21,
65,
1479,
16,
1756,
273,
1681,
18,
86,
4939,
2668,
30,
218... |
self.BMP_WITH_TEXT = wx.Bitmap(os.path.join(const.ICON_DIR,"text.png")) self.BMP_WITHOUT_TEXT =\ wx.Bitmap(os.path.join(const.ICON_DIR,"text_inverted.png")) | self.BMP_WITH_TEXT = wx.Bitmap(os.path.join(const.ICON_DIR,"text.gif"), wx.BITMAP_TYPE_GIF) self.BMP_WITHOUT_TEXT = wx.Bitmap(os.path.join(const.ICON_DIR,"text_inverted.png")) | def __init_items(self): | 6392b159e2d8e275dd552ebd6080770df4d6b40a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/6392b159e2d8e275dd552ebd6080770df4d6b40a/frame.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
67,
3319,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
67,
3319,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
import lib lib.epdb.st() | def _orderComponents(compGraph): # returns a topological sort of compGraph order = [] seen = [ False ] * len(compGraph) nextIndex = 0 while (nextIndex < len(compGraph)): if not seen[nextIndex]: _orderDFS(compGraph, nextIndex, seen, order) | b7d5c98293ff1c55dfcd58a10d9ac124486c1d7d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/b7d5c98293ff1c55dfcd58a10d9ac124486c1d7d/deptable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
7171,
12,
2919,
4137,
4672,
468,
1135,
279,
1760,
18224,
1524,
434,
1161,
4137,
1353,
273,
5378,
5881,
273,
306,
1083,
308,
380,
562,
12,
2919,
4137,
13,
22262,
273,
374,
1323... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
7171,
12,
2919,
4137,
4672,
468,
1135,
279,
1760,
18224,
1524,
434,
1161,
4137,
1353,
273,
5378,
5881,
273,
306,
1083,
308,
380,
562,
12,
2919,
4137,
13,
22262,
273,
374,
1323... | |
print "Parsing: %s" % self.original_file.name.val | log.info("Parsing: %s" % self.original_file.name.val) | def parse(self): print "Parsing: %s" % self.original_file.name.val provider = self.original_file_provider data = provider.get_original_file_data(self.original_file) try: et = ElementTree(file=data) finally: data.close() root = et.getroot() areas = root.findall(self.AREA_XPATH) print "Area count: %d" % len(areas) for i, area in enumerate(areas): result_parameters = area.findall(self.PARAMETER_XPATH) print "Area %d result children: %d" % (i, len(result_parameters)) if len(result_parameters) == 0: print "%s contains no analysis data." % self.get_name() return headers = list() for result_parameter in result_parameters: headers.append(result_parameter.text) columns = self.get_empty_columns(headers) wells = area.findall(self.WELL_XPATH) for well in wells: # Rows and columns are 1-indexed, OMERO wells are 0-indexed row = int(well.get('row')) - 1 column = int(well.get('col')) - 1 try: v = columns['Well'].values wellobj, images = self.get_well_images(row, column) if not wellobj: continue v.append(wellobj.id.val) except: log.exception("ERROR: Failed to get well images") continue results = well.findall(self.RESULT_XPATH) for result in results: name = result.get('name') columns[name].values.append(float(result.text)) return MeasurementParsingResult([columns.values()]) | 2abc05f6ec4c7dd58ee9bb618f839a4be9554279 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/2abc05f6ec4c7dd58ee9bb618f839a4be9554279/populate_roi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
613,
18,
1376,
2932,
13963,
30,
738,
87,
6,
738,
365,
18,
8830,
67,
768,
18,
529,
18,
1125,
13,
2893,
273,
365,
18,
8830,
67,
768,
67,
6778,
501,
273,
2893,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
4672,
613,
18,
1376,
2932,
13963,
30,
738,
87,
6,
738,
365,
18,
8830,
67,
768,
18,
529,
18,
1125,
13,
2893,
273,
365,
18,
8830,
67,
768,
67,
6778,
501,
273,
2893,
1... |
self.assertTrue(len(dirs), 2) | self.assertEqual(len(dirs), 2) | def test_getsitepackages(self): site.PREFIXES = ['xoxo'] dirs = site.getsitepackages() | d71f4c72792df2d0174e18e8322c73afda8056c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/d71f4c72792df2d0174e18e8322c73afda8056c3/test_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14665,
305,
881,
484,
1023,
12,
2890,
4672,
2834,
18,
6307,
3991,
273,
10228,
92,
2409,
83,
3546,
7717,
273,
2834,
18,
14665,
305,
881,
484,
1023,
1435,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14665,
305,
881,
484,
1023,
12,
2890,
4672,
2834,
18,
6307,
3991,
273,
10228,
92,
2409,
83,
3546,
7717,
273,
2834,
18,
14665,
305,
881,
484,
1023,
1435,
2,
-100,
-100,
-100,
... |
if self.max_requests > 0: self.max_requests -= 1 if self.max_requests <= 0: self.log(1, "reached max_requests, exiting") break | def run(self): self.log(1, "Server.run()") web_server_addrs = os.environ.get("FCGI_WEB_SERVER_ADDRS", "").split(",") self.log(1, "web_server_addrs = %s" % `web_server_addrs`) sock = socket.fromfd(sys.stdin.fileno(), socket.AF_INET, socket.SOCK_STREAM) try: sock.getpeername() except socket.error, x: if x[0] != errno.ENOTSOCK and x[0] != errno.ENOTCONN: raise if x[0] == errno.ENOTSOCK: self.log(1, "stdin not socket - falling back to CGI") cgi.CGIRequest(self.handler_types[FCGI_RESPONDER]).process() return sock.setblocking(1) while 1: if self.max_requests > 0: self.max_requests -= 1 if self.max_requests <= 0: self.log(1, "reached max_requests, exiting") break (newsock, addr) = sock.accept() self.log(1, "accepted connection %d" % newsock.fileno()) if web_server_addrs and addr not in web_server_addrs: self.log(1, "not in web_server_addrs - rejected") newsock.close() continue Connection(newsock, self.handler_types).start() del newsock sock.close() | b44edd7a32a18c2b21123c7d5cf82c04058f6897 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/506/b44edd7a32a18c2b21123c7d5cf82c04058f6897/fcgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
1330,
12,
21,
16,
315,
2081,
18,
2681,
1435,
7923,
3311,
67,
3567,
67,
23305,
273,
1140,
18,
28684,
18,
588,
2932,
4488,
13797,
67,
14778,
67,
4370,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
1330,
12,
21,
16,
315,
2081,
18,
2681,
1435,
7923,
3311,
67,
3567,
67,
23305,
273,
1140,
18,
28684,
18,
588,
2932,
4488,
13797,
67,
14778,
67,
4370,
67,
... | |
assert len(rc()) == 0 | self.assertEquals(len(rc()), 0) | def test_folderishDeleteCleanup(self): self.folder.invokeFactory(type_name="Folder", id="reftest") folder = getattr(self.folder, "reftest") | 86089dd5ecda849baf4811c4a444c82c5f916c42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/86089dd5ecda849baf4811c4a444c82c5f916c42/test_referenceable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5609,
1468,
2613,
15007,
12,
2890,
4672,
365,
18,
5609,
18,
14407,
1733,
12,
723,
67,
529,
1546,
3899,
3113,
612,
1546,
266,
1222,
395,
7923,
3009,
273,
3869,
12,
2890,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5609,
1468,
2613,
15007,
12,
2890,
4672,
365,
18,
5609,
18,
14407,
1733,
12,
723,
67,
529,
1546,
3899,
3113,
612,
1546,
266,
1222,
395,
7923,
3009,
273,
3869,
12,
2890,
18,
5... |
elif isinstance(obj, unittest.TestSuite): | elif isinstance(obj, TestSuite): | def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. | 574b8d8adedfa3567f2e1195fa1c0b57337f7057 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/574b8d8adedfa3567f2e1195fa1c0b57337f7057/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
14650,
29732,
12,
2890,
16,
508,
16,
1605,
33,
7036,
4672,
3536,
990,
279,
11371,
434,
777,
7434,
6088,
864,
279,
533,
24562,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
14650,
29732,
12,
2890,
16,
508,
16,
1605,
33,
7036,
4672,
3536,
990,
279,
11371,
434,
777,
7434,
6088,
864,
279,
533,
24562,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
print 'ERROR %s' % ( result['Message'] ) | print 'ERROR: ', result['Message'] | def usage(): print 'Usage: %s <LFN> <DESTINATION SE> [<SOURCE SE> <LOCAL CACHE>]' % ( Script.scriptName ) DIRAC.exit( 2 ) | b9f96435258060e88c9ef35602a74c9e16f7165b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/b9f96435258060e88c9ef35602a74c9e16f7165b/dirac-dms-replicate-lfn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
9105,
50,
34,
411,
29451,
3174,
34,
306,
32,
6537,
3174,
34,
411,
14922,
13669,
34,
3864,
738,
261,
7739,
18,
4263,
461,
262,
18544,
222... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
9105,
50,
34,
411,
29451,
3174,
34,
306,
32,
6537,
3174,
34,
411,
14922,
13669,
34,
3864,
738,
261,
7739,
18,
4263,
461,
262,
18544,
222... |
currentNegWeight = 0 for negtech in negweight: currentNegWeight = min(currentNegWeight,negweight[negtech]) currentNegSlots = 0 for negtech in negslots: currentNegSlots = min(currentNegSlots,negslots[negtech]) | def makeShipFullSpec(player, name, hullID, eqIDs, improvements, raiseExs = True): if not hullID: raise GameException("Ship's hull must be specified.") hull = Rules.techs[hullID] if not hull.isShipHull: raise GameException("Ship's hull must be specified.") ship = IDataHolder() ship.type = T_SHIP # initial values techEff = Rules.techImprEff[player.techs.get(hullID, Rules.techBaseImprovement)] ship.name = name ship.hullID = hullID ship.eqIDs = eqIDs ship.level = hull.level ship.combatClass = hull.combatClass ship.improvements = improvements ship.buildProd = hull.buildProd ship.buildSRes = hull.buildSRes[:] # we need copy ship.operEn = hull.operEn ship.storEn = hull.storEn * techEff ship.weight = hull.weight ship.slots = 0 ship.signature = hull.signature ship.minSignature = hull.minSignature ship.signatureCloak = 1.0 #NEW; 100% - this is the default rule ship.signatureDecloak = 1.0 #NEW; 100% - this is the default rule ship.combatAttBase = hull.combatAtt * techEff ship.combatAtt = 0 ship.combatAttMultiplier = 1.0 #NEW; 100% - this is the default rule ship.combatDefBase = hull.combatDef * techEff ship.combatDef = 0 ship.combatDefMultiplier = 1.0 #NEW; 100% - this is the default rule ship.missileDefBase = hull.missileDef * techEff ship.missileDef = 0 ship.missileDefMultiplier = 1.0 #NEW; 100% - this is the default rule ship.scannerPwr = max(hull.scannerPwr * techEff, Rules.scannerMinPwr) ship.autoRepairMaxHP = hull.autoRepairMaxHP #New...this had been forgotten ship.autoRepairFix = hull.autoRepairFix ship.autoRepairPerc = hull.autoRepairPerc ship.shieldRechargeFix = hull.shieldRechargeFix ship.shieldRechargePerc = hull.shieldRechargePerc ship.hardShield = 0.0 ship.engPwr = 0 ship.upgradeTo = 0 ship.shieldHP = 0 ship.maxHP = int(hull.maxHP * techEff) ship.weaponIDs = [] ship.deployStructs = [] ship.deployHandlers = [] ship.isMilitary = 0 ship.baseExp = 0 ship.damageAbsorb = 0 combatExtra = 0 shieldPerc = 0.0 unpactStruct = 0 deployHandler = 0 # add equipment negslots = {} negweight = {} counter = {} installations = {} for techID in eqIDs: tech = Rules.techs[techID] techEff = Rules.techImprEff[player.techs.get(techID, Rules.techBaseImprovement)] for i in xrange(0, eqIDs[techID]): counter[tech.subtype] = 1 + counter.get(tech.subtype, 0) installations[techID] = 1 + installations.get(techID, 0) # check min hull req if tech.minHull > ship.combatClass and raiseExs: log.warning("Cannot add tech", techID, tech.name) raise GameException("Minimum hull requirement not satisfied.") # check max hull req #NEW if tech.maxHull < ship.combatClass and raiseExs: log.warning("Cannot add tech", techID, tech.name) raise GameException("Maximum hull requirement not satisfied.") # check maximum installations if tech.maxInstallations and installations[tech.id] > tech.maxInstallations \ and raiseExs: raise GameException("Maximum number of equipment installations exceeded.") # add values ship.level = max(ship.level, tech.level) ship.buildProd += tech.buildProd ship.buildSRes.extend(tech.buildSRes) ship.storEn += tech.storEn * techEff if (tech.weight > 0): ship.weight += tech.weight else: negweight[techID] = tech.weight + negweight.get(techID, 0) #this is complex for items with max installs... if (tech.slots > 0): ship.slots += tech.slots else: negslots[techID] = tech.slots + negslots.get(techID, 0) #this is complex for items with max installs... ship.signature += tech.signature ship.minSignature = max(ship.minSignature, tech.minSignature) ship.signatureCloak = min(ship.signatureCloak, tech.signatureCloak) ship.signatureDecloak = min(ship.signatureDecloak, tech.signatureDecloak) if tech.subtype == "seq_mod": #not cumulative for equipment; pick best ship.combatAtt = max(ship.combatAtt, tech.combatAtt * techEff) ship.combatDef = max(ship.combatDef, tech.combatDef * techEff) ship.missileDef = max(ship.missileDef, tech.missileDef * techEff) else : ship.combatDefBase += tech.combatDef * techEff ship.missileDefBase += tech.missileDef * techEff ship.combatAttBase += tech.combatAtt * techEff #not cumulative; pick best ship.combatAttMultiplier = max(ship.combatAttMultiplier, tech.combatAttPerc * techEff) #NEW ship.combatDefMultiplier = max(ship.combatDefMultiplier, tech.combatDefPerc * techEff) #NEW ship.missileDefMultiplier = max(ship.missileDefMultiplier, tech.missileDefPerc * techEff) #NEW ship.engPwr += tech.engPwr * techEff ship.maxHP += tech.maxHP * techEff shieldPerc = max(shieldPerc, tech.shieldPerc * techEff) ship.scannerPwr = max(ship.scannerPwr, tech.scannerPwr * techEff) ship.operEn += tech.operEn ship.autoRepairFix = max(ship.autoRepairFix, tech.autoRepairFix * techEff) ship.autoRepairPerc = max(ship.autoRepairPerc, tech.autoRepairPerc * techEff) if ((ship.autoRepairFix < tech.autoRepairFix) or (ship.autoRepairPerc < tech.autoRepairPerc) and (ship.autoRepairMaxHP < tech.autoRepairMaxHP)): ship.autoRepairMaxHP = tech.autoRepairMaxHP #grab this ONLY if the tech repairs faster than another tech (prevent abuse through multiple repair systems) ship.shieldRechargeFix = max(ship.shieldRechargeFix, tech.shieldRechargeFix * techEff) ship.shieldRechargePerc = max(ship.shieldRechargePerc, tech.shieldRechargePerc * techEff) ship.hardShield = max(ship.hardShield,tech.hardShield * techEff) ship.damageAbsorb = min(ship.damageAbsorb + tech.damageAbsorb,Rules.maxDamageAbsorb) #limit this by rule combatExtra += tech.addMP # if weapon - register only if tech.subtype == "seq_wpn": ship.weaponIDs.append(techID) ship.isMilitary = 1 weapon = Rules.techs[techID] ship.baseExp += (weapon.weaponDmgMin + weapon.weaponDmgMax) / 2 * weapon.weaponROF # deployables if tech.unpackStruct != OID_NONE: ship.deployStructs.append(tech.unpackStruct) unpactStruct = 1 if tech.deployHandlerID != OID_NONE: #this calls another tech at execute time, so only need the ID ship.deployHandlers.append(tech.deployHandlerID) deployHandler = 1 #fix limiter based attibs; round when needed currentNegWeight = 0 for negtech in negweight: currentNegWeight = min(currentNegWeight,negweight[negtech]) currentNegSlots = 0 for negtech in negslots: currentNegSlots = min(currentNegSlots,negslots[negtech]) ship.weight = max(ship.weight+currentNegWeight,int(hull.weight/2)) ship.slots = max(ship.slots+currentNegSlots,1) ship.combatAtt += ship.combatAttBase ship.combatDef = int((ship.combatDef + ship.combatDefBase) * ship.combatDefMultiplier) ship.missileDef = int((ship.missileDef + ship.missileDefBase) * ship.missileDefMultiplier) ship.hardShield = min(1.0,ship.hardShield) #don't allow this to be more than 100% blocking!! #add some MP for damage absorb: combatExtra += ship.damageAbsorb * 1500 #calculate final signature ship.signature *= ship.signatureCloak * ship.signatureDecloak #fix autorepair MaxHP / if nothing set autoRepairMaxHP, assume 100%; this is for legacy technologies if ship.autoRepairMaxHP==0.0: ship.autoRepairMaxHP = 1.0 # check various conditions | e36f6837ef1b365a4e49a58cc4e5c3712ecafe5e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/503/e36f6837ef1b365a4e49a58cc4e5c3712ecafe5e/ShipUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
26358,
5080,
1990,
12,
14872,
16,
508,
16,
22474,
734,
16,
7555,
5103,
16,
13069,
90,
17110,
16,
1002,
424,
87,
273,
1053,
4672,
309,
486,
22474,
734,
30,
1002,
14121,
503,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
26358,
5080,
1990,
12,
14872,
16,
508,
16,
22474,
734,
16,
7555,
5103,
16,
13069,
90,
17110,
16,
1002,
424,
87,
273,
1053,
4672,
309,
486,
22474,
734,
30,
1002,
14121,
503,
2932,
... | |
modeOverride = kwds.get('modeOverride', None) forceUpdate = kwds.get('forceUpdate', None) | def silentCallback(*args, **kwds): # Simply return the interrupt flag return interrupt_flag == IMMEDIATE_STOP | f1b62db6d8b3c28cab8cdd7839f8900fd1db3964 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/f1b62db6d8b3c28cab8cdd7839f8900fd1db3964/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10404,
2428,
30857,
1968,
16,
2826,
25577,
4672,
468,
9587,
1283,
327,
326,
13123,
2982,
327,
13123,
67,
6420,
422,
6246,
15971,
1777,
67,
17513,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10404,
2428,
30857,
1968,
16,
2826,
25577,
4672,
468,
9587,
1283,
327,
326,
13123,
2982,
327,
13123,
67,
6420,
422,
6246,
15971,
1777,
67,
17513,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
r""" Bipartite graph. INPUT: 1. Empty: creates a zero vertex bipartite graph. sage: B = BipartiteGraph() sage: type(B) <class 'sage.graphs.bipartite_graph.BipartiteGraph'> sage: B.order() 0 2. From a graph: without any more information, finds a bipartition. sage: B = BipartiteGraph( graphs.CycleGraph(4) ) sage: B = BipartiteGraph( graphs.CycleGraph(5) ) Traceback (most recent call last): ... TypeError: Input graph is not bipartite! 3. From a NetworkX bipartite graph. sage: import networkx sage: G = graphs.OctahedralGraph() sage: N = networkx.cliques.make_clique_bipartite(G.networkx_graph()) sage: B = BipartiteGraph(N) 4. From a graph and a partition. Note that if the input graph is not bipartite, then Sage will raise an error. However, if one specifies check = False, the offending edges are simply deleted (along with those vertices not appearing in either list). sage: P = graphs.PetersenGraph() sage: partition = [range(5), range(5,10)] sage: B = BipartiteGraph(P, partition) Traceback (most recent call last): ... TypeError: Input graph is not bipartite with respect to the given partition! sage: B = BipartiteGraph(P, partition, check=False) sage: B.left [0, 1, 2, 3, 4] sage: B.show() EXAMPLES: Test for arbitrary argument handled by Graph class sage: B = BipartiteGraph(None) sage: B Bipartite graph on 0 vertices Copy constructor sage: G = Graph({0:[5,6], 1:[4,5], 2:[4,6], 3:[4,5,6]}) sage: B = BipartiteGraph(G) sage: B2 = BipartiteGraph(B) sage: B == B2 True sage: B3 = BipartiteGraph(G, range(4), range(4,7)) sage: B3 Bipartite graph on 7 vertices sage: B3 == B2 True Make sure "copy constructor" returns the same partition for no edges sage: G = Graph({0:[], 1:[], 2:[]}) sage: part = (range(2), [2]) sage: B = BipartiteGraph(G, part) sage: B2 = BipartiteGraph(B) sage: B == B2 True """ | def __init__(self, *args, **kwds): r""" Bipartite graph. | c5cd1ded92bd4e8e22136bbf3f302bd89ac4dd74 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c5cd1ded92bd4e8e22136bbf3f302bd89ac4dd74/bipartite_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
605,
5762,
1137,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
for node in doc.childNodes: if node.nodeType == xml.dom.core.ELEMENT \ and node.tagName == "section": create_module_info(doc, node) | for node in find_all_elements(doc, "section"): create_module_info(doc, node) | def cleanup_synopses(doc): for node in doc.childNodes: if node.nodeType == xml.dom.core.ELEMENT \ and node.tagName == "section": create_module_info(doc, node) | d0d0e6321e87f7a7674d00a59071ba5b1fe090c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d0d0e6321e87f7a7674d00a59071ba5b1fe090c5/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
67,
11982,
556,
2420,
12,
2434,
4672,
364,
756,
316,
1104,
67,
454,
67,
6274,
12,
2434,
16,
315,
3464,
6,
4672,
752,
67,
2978,
67,
1376,
12,
2434,
16,
756,
13,
282,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
67,
11982,
556,
2420,
12,
2434,
4672,
364,
756,
316,
1104,
67,
454,
67,
6274,
12,
2434,
16,
315,
3464,
6,
4672,
752,
67,
2978,
67,
1376,
12,
2434,
16,
756,
13,
282,
2,
-100,
... |
location_qties.append((location, qty)) | if qty != 0.0: location_qties.append((location, qty)) | def assign_try(self, cursor, user, id, context=None): location_obj = self.pool.get('stock.location') move_obj = self.pool.get('stock.move') product_obj = self.pool.get('product.product') uom_obj = self.pool.get('product.uom') | 29491748f4db140813da38fb21884dc4bf06af10 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/29491748f4db140813da38fb21884dc4bf06af10/packing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
698,
12,
2890,
16,
3347,
16,
729,
16,
612,
16,
819,
33,
7036,
4672,
2117,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3562,
6134,
3635,
67,
2603,
273,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
698,
12,
2890,
16,
3347,
16,
729,
16,
612,
16,
819,
33,
7036,
4672,
2117,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
15381,
18,
3562,
6134,
3635,
67,
2603,
273,
365,
18,
... |
_store.dumpNested(workingContext, _outSink) | if option_outputStyle == "-ugly": _store.dumpChronological(workingContext, _outSink) elif option_outputStyle == "-bySubject": _store.dumpBySubject(workingContext, _outSink) elif option_outputStyle == "-no": pass else: _store.dumpNested(workingContext, _outSink) | def doCommand(): """Command line RDF/N3 tool <command> <options> <inputURIs> | a7d0c800568125609e0fc58e331b9a6f318031c6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/a7d0c800568125609e0fc58e331b9a6f318031c6/cwm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2189,
13332,
3536,
2189,
980,
13539,
19,
50,
23,
5226,
225,
411,
3076,
34,
411,
2116,
34,
411,
2630,
1099,
2520,
34,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2189,
13332,
3536,
2189,
980,
13539,
19,
50,
23,
5226,
225,
411,
3076,
34,
411,
2116,
34,
411,
2630,
1099,
2520,
34,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for p in self.element.findall("Profile"): self.profiles[p.attrib['name']] = Profile(p) for c in self.element.findall("Client"): self.clients[c.attrib['name']] = (c.attrib['image'], c.attrib['profile']) for c in self.element.findall("Class"): self.classes[c.attrib['name']] = [x.attrib['name'] for x in c.findall("Bundle")] for (k, v) in self.element.attrib.iteritems(): if k[:8] == 'default_': self.defaults[k[8:]] = v | for prof in self.element.findall("Profile"): self.profiles[prof.attrib['name']] = Profile(prof) for cli in self.element.findall("Client"): self.clients[cli.attrib['name']] = (cli.attrib['image'], cli.attrib['profile']) for cls in self.element.findall("Class"): self.classes[cls.attrib['name']] = [bundle.attrib['name'] for bundle in cls.findall("Bundle")] for key in [key[8:] for key in self.element.attrib if key[:8] == 'default_']: self.defaults[key] = self.element.get("default_%s" % key) | def Index(self): self.element = XML(self.data) self.defaults = {} self.clients = {} self.profiles = {} self.classes = {} for p in self.element.findall("Profile"): self.profiles[p.attrib['name']] = Profile(p) for c in self.element.findall("Client"): self.clients[c.attrib['name']] = (c.attrib['image'], c.attrib['profile']) for c in self.element.findall("Class"): self.classes[c.attrib['name']] = [x.attrib['name'] for x in c.findall("Bundle")] for (k, v) in self.element.attrib.iteritems(): if k[:8] == 'default_': self.defaults[k[8:]] = v | 8ce27b3c73b1f4b17f1b558f7e5f1d4f57c2559d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/8ce27b3c73b1f4b17f1b558f7e5f1d4f57c2559d/Metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3340,
12,
2890,
4672,
365,
18,
2956,
273,
3167,
12,
2890,
18,
892,
13,
365,
18,
7606,
273,
2618,
365,
18,
16931,
273,
2618,
365,
18,
18314,
273,
2618,
365,
18,
4701,
273,
2618,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3340,
12,
2890,
4672,
365,
18,
2956,
273,
3167,
12,
2890,
18,
892,
13,
365,
18,
7606,
273,
2618,
365,
18,
16931,
273,
2618,
365,
18,
18314,
273,
2618,
365,
18,
4701,
273,
2618,
364,
... |
if Auto in (self.valueAxis.valueMin, self.valueAxis.valueMax): y = self.valueAxis.scale(self._findMinMaxValues()[0]) elif self.valueAxis.valueMin <= 0 <= self.valueAxis.valueMax: y = self.valueAxis.scale(0) elif 0 < self.valueAxis.valueMin: y = self.valueAxis.scale(self.valueAxis.valueMin) elif self.valueAxis.valueMax < 0: y = self.valueAxis.scale(self.valueAxis.valueMax) | scale = self.valueAxis.scale vm, vM = self.valueAxis.valueMin, self.valueAxis.valueMax if Auto in (vm, vM): y = scale(self._findMinMaxValues()[0]) elif vm <= 0 <= vM: y = scale(0) elif 0 < vm: y = scale(vm) elif vM < 0: y = scale(vM) | def calcBarPositions(self): """Works out where they go. | 40c058808accb2ea1c7dbd9e07048bb60043efa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/40c058808accb2ea1c7dbd9e07048bb60043efa2/barchart1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
5190,
11024,
12,
2890,
4672,
3536,
16663,
596,
1625,
2898,
1960,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
5190,
11024,
12,
2890,
4672,
3536,
16663,
596,
1625,
2898,
1960,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
v.getPipeline('quadric') | v.getPipeline('final') | def test2(self): import vistrail import xml_parser parser = xml_parser.XMLParser() parser.openVistrail('test_files/vtk_book_3rd_p189.xml') v = parser.getVistrail() parser.closeVistrail() p1 = v.getPipeline('final') v.getPipeline('quadric') p2 = v.getPipeline('final') m1s = p1.modules.items() m2s = p2.modules.items() m1s.sort() m2s.sort() for ((i1,m1),(i2,m2)) in zip(m1s, m2s): self.assertEquals(m1.center.x, m2.center.x) self.assertEquals(m1.center.y, m2.center.y) | 7272e3972f68b6d3d3d89c4b133856f30edaecd7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6341/7272e3972f68b6d3d3d89c4b133856f30edaecd7/vis_action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
22,
12,
2890,
4672,
1930,
2281,
15565,
1930,
2025,
67,
4288,
2082,
273,
2025,
67,
4288,
18,
4201,
2678,
1435,
2082,
18,
3190,
3282,
15565,
2668,
3813,
67,
2354,
19,
11734,
79,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
22,
12,
2890,
4672,
1930,
2281,
15565,
1930,
2025,
67,
4288,
2082,
273,
2025,
67,
4288,
18,
4201,
2678,
1435,
2082,
18,
3190,
3282,
15565,
2668,
3813,
67,
2354,
19,
11734,
79,
67,
... |
collections[cat_name] = [] collections_lpaths[cat_name] = set() if lpath in collections_lpaths[cat_name]: continue collections_lpaths[cat_name].add(lpath) | collections[cat_name] = {} | def get_collections(self, collection_attributes): from calibre.devices.usbms.driver import debug_print debug_print('Starting get_collections:', prefs['manage_device_metadata']) debug_print('Renaming rules:', tweaks['sony_collection_renaming_rules']) | bcd1d79352d584b33c4d09cb755712aadd3f1139 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/bcd1d79352d584b33c4d09cb755712aadd3f1139/books.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
19246,
12,
2890,
16,
1849,
67,
4350,
4672,
628,
26139,
266,
18,
12506,
18,
25525,
959,
18,
7407,
1930,
1198,
67,
1188,
1198,
67,
1188,
2668,
11715,
336,
67,
19246,
30,
2187,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
19246,
12,
2890,
16,
1849,
67,
4350,
4672,
628,
26139,
266,
18,
12506,
18,
25525,
959,
18,
7407,
1930,
1198,
67,
1188,
1198,
67,
1188,
2668,
11715,
336,
67,
19246,
30,
2187,
1... |
for ua in ua_applets: tokens = ua.split("::") applets.insert(int(tokens[1]), ua) | for ua in ua_applets: tokens = ua.split("::") applets.insert(int(tokens[1]), ua) | def make_active_model (self): self.active_model = gtk.ListStore(gtk.gdk.Pixbuf, str, str, str) self.active_model.connect("row-changed", self.applet_reorder) | 30bb56994f49caaea99383c3cdc7f4e2a2d375f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/30bb56994f49caaea99383c3cdc7f4e2a2d375f1/awnClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
3535,
67,
2284,
261,
2890,
4672,
365,
18,
3535,
67,
2284,
273,
22718,
18,
682,
2257,
12,
4521,
79,
18,
75,
2883,
18,
21816,
4385,
16,
609,
16,
609,
16,
609,
13,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
3535,
67,
2284,
261,
2890,
4672,
365,
18,
3535,
67,
2284,
273,
22718,
18,
682,
2257,
12,
4521,
79,
18,
75,
2883,
18,
21816,
4385,
16,
609,
16,
609,
16,
609,
13,
365,
18,
... |
@keyword package: A string that specifies the package, component, or package | @keyword package: A string that specifies the package, component, or package | def __init__(self, recipe, *args, **keywords): | bbf56a2c6ce326846b9cfaed245edce8bd904567 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/bbf56a2c6ce326846b9cfaed245edce8bd904567/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
16100,
16,
380,
1968,
16,
2826,
11771,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
16100,
16,
380,
1968,
16,
2826,
11771,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"""Return the names of the groups that the user is a member of""" | """Return the names of the groups that the user is a member of. Return an empty list if the user doesn't belong to any group.""" | def getParentGroups(): """Return the names of the groups that the user is a member of""" | 11f8e10f2aff02a461d77f35c8bd2fdc6ad61e72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/11f8e10f2aff02a461d77f35c8bd2fdc6ad61e72/IUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5089,
3621,
13332,
3536,
990,
326,
1257,
434,
326,
3252,
716,
326,
729,
353,
279,
3140,
434,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5089,
3621,
13332,
3536,
990,
326,
1257,
434,
326,
3252,
716,
326,
729,
353,
279,
3140,
434,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return S_OK(localFile) gLogger.error("ReplicaManager.getFile: Failed to get local copy from any replicas.",lfn) return S_ERROR("ReplicaManager.getFile: Failed to get local copy from any replicas.") def _getSEProximity(self,ses): | return S_OK( localFile ) gLogger.error( "ReplicaManager.getFile: Failed to get local copy from any replicas.", lfn ) return S_ERROR( "ReplicaManager.getFile: Failed to get local copy from any replicas." ) def _getSEProximity( self, ses ): | def __getFile(self,lfn,replicas,metadata,destinationDir): if not replicas: gLogger.error("No accessible replicas found") return S_ERROR("No accessible replicas found") # Determine the best replicas res = self._getSEProximity(replicas.keys()) if not res['OK']: return res for storageElementName in res['Value']: physicalFile = replicas[storageElementName] res = self.getStorageFile(physicalFile,storageElementName,localPath=os.path.realpath(destinationDir),singleFile=True) if not res['OK']: gLogger.error("Failed to get %s from %s" % (lfn,storageElementName),res['Message']) else: if not destinationDir: destinationDir = '.' localFile = os.path.realpath("%s/%s" % (destinationDir,os.path.basename(lfn))) localAdler = fileAdler(localFile) if (metadata['Size'] != res['Value']): gLogger.error("Size of downloaded file (%d) does not match catalog (%d)" % (res['Value'],metadata['Size'])) elif (metadata['CheckSumValue']) and (not compareAdler(metadata['CheckSumValue'],localAdler)): gLogger.error("Checksum of downloaded file (%s) does not match catalog (%s)" % (localAdler,metadata['CheckSumValue'])) else: return S_OK(localFile) gLogger.error("ReplicaManager.getFile: Failed to get local copy from any replicas.",lfn) return S_ERROR("ReplicaManager.getFile: Failed to get local copy from any replicas.") | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
29925,
12,
2890,
16,
80,
4293,
16,
266,
10528,
16,
4165,
16,
10590,
1621,
4672,
309,
486,
21545,
30,
314,
3328,
18,
1636,
2932,
2279,
12718,
21545,
1392,
7923,
327,
348,
67,
3589,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
29925,
12,
2890,
16,
80,
4293,
16,
266,
10528,
16,
4165,
16,
10590,
1621,
4672,
309,
486,
21545,
30,
314,
3328,
18,
1636,
2932,
2279,
12718,
21545,
1392,
7923,
327,
348,
67,
3589,
... |
l = [1, 2, 3, 4, 5] * (size // 5) | l = [1, 2, 3, 4, 5] * size | def test_reverse(self, size): l = [1, 2, 3, 4, 5] * (size // 5) l.reverse() self.assertEquals(len(l), size) self.assertEquals(l[-5:], [5, 4, 3, 2, 1]) self.assertEquals(l[:5], [5, 4, 3, 2, 1]) | 58ac820523228252b5516333377d351fed0a2095 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/58ac820523228252b5516333377d351fed0a2095/test_bigmem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9845,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
16,
576,
16,
890,
16,
1059,
16,
1381,
65,
380,
963,
328,
18,
9845,
1435,
365,
18,
11231,
8867,
12,
1897,
12,
80,
3631,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9845,
12,
2890,
16,
963,
4672,
328,
273,
306,
21,
16,
576,
16,
890,
16,
1059,
16,
1381,
65,
380,
963,
328,
18,
9845,
1435,
365,
18,
11231,
8867,
12,
1897,
12,
80,
3631,
9... |
self.specScan = scan | def setFromSpec(self, scan, mon = 'Monitor'): """Set the filenames from a SpecScan instance | 8862dcf26a4225de67d49c677cfa7010b7a8e0ce /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8436/8862dcf26a4225de67d49c677cfa7010b7a8e0ce/transformations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22012,
1990,
12,
2890,
16,
4135,
16,
6921,
273,
296,
7187,
11,
4672,
3536,
694,
326,
9066,
628,
279,
4185,
7972,
791,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22012,
1990,
12,
2890,
16,
4135,
16,
6921,
273,
296,
7187,
11,
4672,
3536,
694,
326,
9066,
628,
279,
4185,
7972,
791,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
return FiniteField_ext_pariElement(self.__parent, self.__value) | return FiniteField_ext_pariElement(self.__parent, self.__value, check=False) | def copy(self): """ Return a copy of this element. | a8b0bc86f67092c8d164d155afff81c6830223eb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a8b0bc86f67092c8d164d155afff81c6830223eb/finite_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
333,
930,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
333,
930,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print LibFiles if EasyDialogs.AskYesNoCancel('Proceed with creating new ones?') <= 0: sys.exit(0) for dst, src in goals: if src in LibFiles: mkalias(src, dst) else: EasyDialogs.Message(dst+' not created: '+src+' not found') EasyDialogs.Message('All done!') if __name__ == '__main__': main() | def main(): # Ask the user for the plugins directory dir, ok = macfs.GetDirectory() if not ok: sys.exit(0) os.chdir(dir.as_pathname()) # Remove old .slb aliases and collect a list of .slb files if EasyDialogs.AskYesNoCancel('Proceed with removing old aliases?') <= 0: sys.exit(0) LibFiles = [] allfiles = os.listdir(':') for f in allfiles: if f[-4:] == '.slb': finfo = macfs.FSSpec(f).GetFInfo() if finfo.Flags & 0x8000: os.unlink(f) else: LibFiles.append(f) print LibFiles # Create the new aliases. if EasyDialogs.AskYesNoCancel('Proceed with creating new ones?') <= 0: sys.exit(0) for dst, src in goals: if src in LibFiles: mkalias(src, dst) else: EasyDialogs.Message(dst+' not created: '+src+' not found') EasyDialogs.Message('All done!') | d406b3a24aeb43d3a0c6a02edd948c36ebd76106 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d406b3a24aeb43d3a0c6a02edd948c36ebd76106/fixfiletypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
25747,
326,
729,
364,
326,
4799,
1867,
1577,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
1435,
309,
486,
1529,
30,
2589,
18,
8593,
12,
20,
13,
1140,
18,
343,
1214,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
25747,
326,
729,
364,
326,
4799,
1867,
1577,
16,
1529,
273,
5318,
2556,
18,
967,
2853,
1435,
309,
486,
1529,
30,
2589,
18,
8593,
12,
20,
13,
1140,
18,
343,
1214,
12,
... | |
thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ | thumbDict[sngl.ifo]=fnmatch.filter(filesOmega,\ | def prepareChecklist(wikiFilename=None,wikiCoinc=None,wikiTree=None,file2URL=None): """ Method to prepare a checklist where data products are isolated in directory. """ endOfS5=int(875232014) wikiFileFinder=findFileType(wikiTree,wikiCoinc) # Check to see if wiki file with name already exists maxCount=0 while os.path.exists(wikiFilename) and maxCount < 15: sys.stdout.write("File %s already exists.\n"%\ os.path.split(wikiFilename)[1]) wikiFilename=wikiFilename+".wiki" maxCount=maxCount+1 # #Create the wikipage object etc # wikiPage=wiki(wikiFilename) # # Create top two trigger params tables # cTable=wikiPage.wikiTable(2,9) cTable.data=[ ["Trigger Type", "Rank", "FAR", "SNR", "IFOS(Coinc)", "Instruments(Active)", "Coincidence Time (s)", "Total Mass (mSol)", "Chirp Mass (mSol)" ], ["%s"%(wikiCoinc.type), "%s"%(wikiCoinc.rank), "%s"%(wikiCoinc.far), "%s"%(wikiCoinc.snr), "%s"%(wikiCoinc.ifos), "%s"%(wikiCoinc.instruments), "%s"%(wikiCoinc.time), "%s"%(wikiCoinc.mass), "%s"%(wikiCoinc.mchirp) ] ] pTable=wikiPage.wikiTable(len(wikiCoinc.sngls_in_coinc())+1,7) pTable.data[0]=[ "IFO", "GPS Time(s)", "SNR", "CHISQR", "Mass 1", "Mass 2", "Chirp Mass" ] for row,cSngl in enumerate(wikiCoinc.sngls_in_coinc()): pTable.data[row+1]=[ "%s"%(cSngl.ifo), "%s"%(cSngl.time), "%s"%(cSngl.snr), "%s"%(cSngl.chisqr), "%s"%(cSngl.mass1), "%s"%(cSngl.mass2), "%s"%(cSngl.mchirp) ] #Write the tables into the Wiki object wikiPage.putText("Coincident Trigger Event Information: %s\n"\ %(stfu_pipe.gpsTimeToReadableDate(wikiCoinc.time))) wikiPage.insertTable(cTable) wikiPage.putText("Corresponding Coincident Single IFO Trigger Information\n") wikiPage.insertTable(pTable) #Generate a table of contents to appear after candidate params table wikiPage.tableOfContents(3) #Begin including each checklist item as section with subsections wikiPage.section("Follow-up Checklist") #Put each checklist item wikiPage.subsection("Checklist Summary") wikiPage.subsubsection("Does this candidate pass this checklist?") wikiPage.subsubsection("Answer") wikiPage.subsubsection("Relevant Information and Comments") wikiPage.insertHR() # #First real checklist item wikiPage.subsection("#0 False Alarm Probability") wikiPage.subsubsection("Question") wikiPage.putText("What is the false alarm rate associated with this candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") farTable=wikiPage.wikiTable(2,1) farTable.setTableStyle("background-color: yellow; text-align center;") farTable.data[0][0]="False Alarm Rate" farTable.data[1][0]="%s"%(wikiCoinc.far) wikiPage.insertTable(farTable) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#1 Data Quality Flags") wikiPage.subsubsection("Question") wikiPage.putText("Can the data quality flags coincident with this candidate be safely disregarded?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPath=os.path.split(wikiFilename)[0] dqFileList=wikiFileFinder.get_findFlags() if len(dqFileList) != 1: sys.stdout.write("Warning: DQ flags data product import problem.\n") print "Found %i files."%len(dqFileList) for mf in dqFileList: print mf for myFile in dqFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#2 Veto Investigations") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate survive the veto investigations performed at its time?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") vetoFileList=wikiFileFinder.get_findVetos() if len(vetoFileList) != 1: sys.stdout.write("Warning: Veto flags data product import problem.\n") for myFile in vetoFileList:print myFile for myFile in vetoFileList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#3 IFO Status") wikiPage.subsubsection("Question") wikiPage.putText("Are the interferometers operating normally with a reasonable level of sensitivity around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") #Add link to Daily Stats if wikiCoinc.time <= endOfS5: statsLink=wikiPage.makeExternalLink("http://blue.ligo-wa.caltech.edu/scirun/S5/DailyStatistics/",\ "S5 Daily Stats Page") else: statsLink="This should be a link to S6 Daily Stats!\n" wikiPage.putText(statsLink) #Link figures of merit #Get link for all members of wikiCoinc wikiPage.putText("Figures of Merit\n") if wikiCoinc.time > endOfS5: fomLinks=dict() elems=0 for wikiSngl in wikiCoinc.sngls: if not(wikiSngl.ifo.upper().rstrip().lstrip() == 'V1'): fomLinks[wikiSngl.ifo]=stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo) elems=elems+len(fomLinks[wikiSngl.ifo]) else: for myLabel,myLink,myThumb in stfu_pipe.getFOMLinks(wikiCoinc.time,wikiSngl.ifo): wikiPage.putText("%s\n"%(wikiPage.makeExternalLink(myLink,myLabel))) cols=4 rows=(elems/3)+1 fTable=wikiPage.wikiTable(rows,cols) fTable.data[0]=["IFO,Shift","FOM1","FOM2","FOM3"] currentIndex=0 for myIFOKey in fomLinks.keys(): for label,link,thumb in fomLinks[myIFOKey]: myRow=currentIndex/int(3)+1 myCol=currentIndex%int(3)+1 fTable.data[myRow][0]=label thumbURL=thumb fTable.data[myRow][myCol]="%s"%(wikiPage.linkedRemoteImage(thumb,link)) currentIndex=currentIndex+1 wikiPage.insertTable(fTable) else: wikiPage.putText("Can not automatically fetch S5 FOM links.") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # #Additional Checklist Item #First real checklist item wikiPage.subsection("#4 Candidate Appearance") wikiPage.subsubsection("Question") wikiPage.putText("Do the Qscan figures show what we would expect for a gravitational-wave event?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() for sngl in wikiCoinc.sngls: frametype,channelName=stfu_pipe.figure_out_type(sngl.time,sngl.ifo,'hoft') indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*/%s/*/%s/*index.html"%(frametype,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened.png"\ %(sngl.time,channelName)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_hoft_frame(),\ "*%s*_%s_16.00_spectrogram_whitened?thumb.png"\ %(sngl.time,channelName)) # #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("GW data channel scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >= 1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >= 1 if enoughImage and enoughIndex: wikiPage.insertQscanTable(imageDict,\ thumbDict,\ indexDict) else: sys.stdout.write("Warning: Candidate appearance plot import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#5 Seismic Plots") wikiPage.subsubsection("Question") wikiPage.putText("Is the seismic activity insignificant around the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() # for sngl in wikiCoinc.sngls_in_coinc(): indexDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*index.html"%(sngl.ifo,sngl.time)) imageDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)) thumbDict[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*SEI*_512.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1_SEIS(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if (len(zValueFiles) > 0): for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Search for analyzeQscan files #/L1-analyseQscan_L1_932797512_687_seis_rds_L1_SEI-ETMX_X_z_scat-unspecified-gpstime.png timeString=str(float(sngl.time)).replace(".","_") zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.txt"%(sngl.ifo,timeString)) indexDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*_%s_%s_*.html"%(sngl.ifo,timeString)) thumbDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime_thumb.png"\ %(sngl.ifo,timeString)) imageDictAQ[sngl.ifo]=fnmatch.filter(wikiFileFinder.get_analyzeQscan_SEIS(),\ "*%s-*_%s_*_SEI*_z_scat-unspecified-gpstime.png"\ %(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse keeping SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Seismic scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: Seismic plots product import problem.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#6 Other environmental causes") wikiPage.subsubsection("Question") wikiPage.putText("Were the environmental disturbances (other than seismic) insignificant at the time of the candidate?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only PEM channels for sngl in wikiCoinc.sngls_in_coinc(): imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) #Search for corresponding Omega summary.txt file zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse only keeping PEM and not SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) for chan in zValueDictAQ[sngl.ifo]: if "PEM" in chan[0] and not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Analyze Qscan Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if "PEM" in myFile.upper() and not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(imageDict[sngl.ifo]) < 1: wikiPage.putText("PEM scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: PEM plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#7 Auxiliary degree of freedom") wikiPage.subsubsection("Question") wikiPage.putText("Were the auxiliary channel transients coincident with the candidate insignificant?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") imageDict=dict() indexDict=dict() thumbDict=dict() zValueDict=dict() imageDictAQ=dict() indexDictAQ=dict() thumbDictAQ=dict() zValueDictAQ=dict() #Select only AUX channels for sngl in wikiCoinc.sngls: imageDict[sngl.ifo]=list() indexDict[sngl.ifo]=list() thumbDict[sngl.ifo]=list() for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*html"%(sngl.ifo,sngl.time)): indexDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDict[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*_16.00_spectrogram_whitened?thumb.png"%\ (sngl.ifo,sngl.time)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDict[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_RDS_R_L1(),\ "*/%s_RDS_*/%s/*summary.txt"%(sngl.ifo,sngl.time)) zValueDict[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDict[sngl.ifo].extend(wikiFileFinder.__readSummary__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDict[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDict[sngl.ifo]=tmpList else: sys.stdout.write("Omega scan summary file not for for %s. ...skipping...\n"%sngl.ifo) #Select associated analyzeQscans imageDictAQ[sngl.ifo]=list() indexDictAQ[sngl.ifo]=list() thumbDictAQ[sngl.ifo]=list() timeString=str(float(sngl.time)).replace(".","_") #H1-analyseQscan_H1_931176926_116_rds-unspecified-gpstime.html for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*html"%(sngl.ifo,timeString)): indexDictAQ[sngl.ifo].append(myFile) zValueFiles=fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*txt"%(sngl.ifo,timeString)) #Process zValue ranking file if found for IFO zValueDictAQ[sngl.ifo]=list() if len(zValueFiles)>0: for zFile in zValueFiles: zValueDictAQ[sngl.ifo].extend(wikiFileFinder.__readZranks__(zFile)) #Reparse NOT keeping PEM or SEI channels tmpList=list() for chan in zValueDictAQ[sngl.ifo]: if not "PEM" in chan[0] or not "SEI" in chan[0]: tmpList.append(chan) zValueDictAQ[sngl.ifo]=tmpList else: sys.stdout.write("Z ranking file not found for %s. ...skipping...\n"%sngl.ifo) #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime_thumb.png #H1-analyseQscan_H1_931176926_116_rds_H0_PEM-MY_SEISX_z_scat-unspecified-gpstime.png for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): imageDictAQ[sngl.ifo].append(myFile) for myFile in fnmatch.filter(wikiFileFinder.get_analyzeQscan_RDS(),\ "*%s-*_%s_*_z_scat-unspecified-gpstime?thumb.png"%\ (sngl.ifo,timeString)): if not "PEM" in myFile.upper() or not "SEI" in myFile.upper(): thumbDictAQ[sngl.ifo].append(myFile) #Convert disk locals to URLs imageDict[sngl.ifo]=[file2URL.convert(x) for x in imageDict[sngl.ifo]] indexDict[sngl.ifo]=[file2URL.convert(x) for x in indexDict[sngl.ifo]] thumbDict[sngl.ifo]=[file2URL.convert(x) for x in thumbDict[sngl.ifo]] imageDictAQ[sngl.ifo]=[file2URL.convert(x) for x in imageDictAQ[sngl.ifo]] indexDictAQ[sngl.ifo]=[file2URL.convert(x) for x in indexDictAQ[sngl.ifo]] thumbDictAQ[sngl.ifo]=[file2URL.convert(x) for x in thumbDictAQ[sngl.ifo]] if len(indexDict[sngl.ifo]) < 1: wikiPage.putText("Other scans for %s not available.\n"%sngl.ifo) enoughImage=[len(imageDict[key])>0 for key in imageDict.keys()].count(True) >=1 enoughIndex=[len(indexDict[key])>0 for key in indexDict.keys()].count(True) >=1 if enoughImage and enoughIndex: wikiPage.insertAnalyzeQscanTable(imageDict, thumbDict, indexDict, zValueDict, imageDictAQ, thumbDictAQ, indexDictAQ, zValueDictAQ) else: sys.stdout.write("Warning: AUX plots import trouble.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#8 Electronic Log Book") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the comments posted by the sci-mons or the operators in the e-log?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiLinkLHOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"H1"), "Hanford eLog") wikiLinkLLOlog=wikiPage.makeExternalLink(stfu_pipe.getiLogURL(myCoinc.time,"L1"), "Livingston eLog") wikiPage.putText("%s\n\n%s\n\n"%(wikiLinkLHOlog,wikiLinkLLOlog)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#9 Glitch Report") wikiPage.subsubsection("Question") wikiPage.putText("Were the instruments behaving normally according to the weekly glitch report?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") if int(wikiCoinc.time) >= endOfS5: wikiLinkGlitch=wikiPage.makeExternalLink( "https://www.lsc-group.phys.uwm.edu/twiki/bin/view/DetChar/GlitchStudies", "Glitch Reports for S6" ) else: wikiLinkGlitch=wikiPage.makeExternalLink( "http://www.lsc-group.phys.uwm.edu/glitch/investigations/s5index.html#shift", "Glitch Reports for S5" ) wikiPage.putText("%s\n"%(wikiLinkGlitch)) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#10 Snr versus time") wikiPage.subsubsection("Question") wikiPage.putText("Is this trigger significant in a SNR versus time plot of all triggers in its analysis chunk?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#11 Parameters of the candidate") wikiPage.subsubsection("Question") wikiPage.putText("Does the candidate have a high likelihood of being a gravitational-wave according to its parameters?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Effective Distance Ratio Test\n") effDList=wikiFileFinder.get_effDRatio() if len(effDList) != 1: sys.stdout.write("Warning: Effective Distance Test import problem.\n") for myFile in effDList: wikiPage.putText("%s\n"%(file(myFile).read())) wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#12 Snr and Chisq") wikiPage.subsubsection("Question") wikiPage.putText("Are the SNR and CHISQ time series consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") # #Put plots SNR and Chi sqr # indexList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*.html") thumbList=fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_snr-*thumb.png") thumbList.extend(fnmatch.filter(wikiFileFinder.get_plotsnrchisq(),"*_chisq-*thumb.png")) thumbList.sort() indexList=[file2URL.convert(x) for x in indexList] thumbList=[file2URL.convert(x) for x in thumbList] #Two thumb types possible "_thumb.png" or ".thumb.png" imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] ifoCount=len(wikiCoinc.sngls) rowLabel={"SNR":1,"CHISQ":2} rowCount=len(rowLabel) colCount=ifoCount if len(indexList) >= 1: snrTable=wikiPage.wikiTable(rowCount+1,colCount+1) for i,sngl in enumerate(wikiCoinc.sngls): myIndex="" for indexFile in indexList: if indexFile.__contains__("_pipe_%s_FOLLOWUP_"%sngl.ifo): myIndex=indexFile if myIndex=="": snrTable.data[0][i+1]=" %s "%sngl.ifo else: snrTable.data[0][i+1]=wikiPage.makeExternalLink(myIndex,sngl.ifo) for col,sngl in enumerate(wikiCoinc.sngls): for row,label in enumerate(rowLabel.keys()): snrTable.data[row+1][0]=label for k,image in enumerate(imageList): if (image.__contains__("_%s-"%label.lower()) \ and image.__contains__("pipe_%s_FOLLOWUP"%sngl.ifo)): snrTable.data[row+1][col+1]=" %s "%(wikiPage.linkedRemoteImage(thumbList[k],thumbList[k])) wikiPage.insertTable(snrTable) else: sys.stdout.write("Warning: SNR and CHISQ plots not found.\n") wikiPage.putText("SNR and CHISQ plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#13 Template bank veto") wikiPage.subsubsection("Question") wikiPage.putText("Is the bank veto value consistent with our expectations for a gravitational wave?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#14 Coherent studies") wikiPage.subsubsection("Question") wikiPage.putText("Are the triggers found in multiple interferometers coherent with each other?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") indexList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),"*.html") if len(indexList) >= 1: myIndex=file2URL.convert(indexList[0]) wikiPage.putText(wikiPage.makeExternalLink(myIndex,\ "%s Coherence Study Results"%(wikiCoinc.ifos))) thumbList=fnmatch.filter(wikiFileFinder.get_plotchiatimeseries(),\ "PLOT_CHIA_%s_snr-squared*thumb.png"%(wikiCoinc.time)) imageList=[x.replace("_thumb.png",".png").replace(".thumb.png",".png") for x in thumbList] rowCount=len(imageList) colCount=1 cohSnrTimeTable=wikiPage.wikiTable(rowCount+1,colCount) cohSnrTimeTable.data[0][0]="%s Coherent SNR Squared Times Series"%(wikiCoinc.ifos) for i,image in enumerate(imageList): cohSnrTimeTable.data[i+1][0]=wikiPage.linkedRemoteImage(image,thumbList[i]) wikiPage.insertTable(cohSnrTimeTable) else: sys.stdout.write("Warning: Coherent plotting jobs not found.\n") wikiPage.putText("Coherent Studies plots not found.\n") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#15 Segmentation Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in segmentation?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # #Additional Checklist Item wikiPage.subsection("#16 Calibration Stability") wikiPage.subsubsection("Question") wikiPage.putText("Is the candidate stable against changes in calibration that are consistent with systematic uncertainties?") wikiPage.subsubsection("Answer") wikiPage.putText("Edit Here") wikiPage.subsubsection("Relevant Information") wikiPage.putText("Plots and pipeline data go here!") wikiPage.subsubsection("Investigator Comments") wikiPage.putText("Edit Here") wikiPage.insertHR() # # | fb84ac33aba836b8fcb61075cfaec34ced2846c0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5758/fb84ac33aba836b8fcb61075cfaec34ced2846c0/makeCheckListWiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
1564,
1098,
12,
13044,
5359,
33,
7036,
16,
13044,
27055,
71,
33,
7036,
16,
13044,
2471,
33,
7036,
16,
768,
22,
1785,
33,
7036,
4672,
3536,
2985,
358,
2911,
279,
866,
1098,
1625,
... |
start, end = active_widgets[editor] | start, end = editor.buffer.get_bounds() | def on_replace_all_activate(button, editor, widget): if editor not in active_widgets: return search = active_widgets[editor].entry.get_text() ignore_case = active_widgets[editor].ignore_case.get_active() regex = active_widgets[editor].regex.get_active() replace = unicode(active_widgets[editor].replace_entry.get_text()) matcher = get_matcher(editor, search, ignore_case, regex) if not matcher: return line, offset = editor.cursor.get_line(), editor.cursor.get_line_offset() if active_widgets[editor].replace_in_selection: start, end = editor.buffer.get_selection_bounds() start.order(end) else: start, end = active_widgets[editor] end_mark = editor.buffer.create_mark(None, end) editor.buffer.begin_user_action() editor.buffer.place_cursor(start) count = 0 while True: match = matcher.search(editor.utext, editor.cursor.get_offset()) if not match: break start, end = map(editor.buffer.get_iter_at_offset, match.span()) if end.compare(editor.buffer.get_iter_at_mark(end_mark)) > 0: break editor.buffer.place_cursor(start) editor.buffer.delete(start, end) editor.buffer.insert_at_cursor(match.expand(replace).encode('utf-8')) count += 1 editor.buffer.end_user_action() if not count: editor.message('Nothing to replace') elif count == 1: editor.message('One occurrence was replaced') else: editor.message('%d occurrences were replaced' % count) cursor = editor.cursor cursor.set_line(line) cursor.set_line_offset(offset) editor.buffer.place_cursor(cursor) editor.view.scroll_mark_onscreen(editor.buffer.get_insert()) editor.view.grab_focus() | 57205993d808a70c5241ed91b7052ec7eed97c51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14800/57205993d808a70c5241ed91b7052ec7eed97c51/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2079,
67,
454,
67,
10014,
12,
5391,
16,
4858,
16,
3604,
4672,
309,
4858,
486,
316,
2695,
67,
18148,
30,
327,
225,
1623,
273,
2695,
67,
18148,
63,
9177,
8009,
4099,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2079,
67,
454,
67,
10014,
12,
5391,
16,
4858,
16,
3604,
4672,
309,
4858,
486,
316,
2695,
67,
18148,
30,
327,
225,
1623,
273,
2695,
67,
18148,
63,
9177,
8009,
4099,
18,
588,
... |
raise ValueError, 'unknown message digest' | raise ValueError, ('unknown message digest', d) | def __init__(self, alg, key, iv, op, key_as_bytes=0, d='md5', salt='', i=1): cipher = getattr(m2, alg) if not cipher: raise ValueError, 'unknown cipher' self.cipher=cipher() if key_as_bytes: kmd = getattr(m2, d) if not kmd: raise ValueError, 'unknown message digest' key = m2.bytes_to_key(self.cipher, kmd(), key, salt, iv, i) self.ctx=m2.cipher_ctx_new() m2.cipher_init(self.ctx, self.cipher, key, iv, op) del key | 7d7f2149adadc77030ca56b706fde9ba0a74467d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10522/7d7f2149adadc77030ca56b706fde9ba0a74467d/EVP.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11989,
16,
498,
16,
4674,
16,
1061,
16,
498,
67,
345,
67,
3890,
33,
20,
16,
302,
2218,
1264,
25,
2187,
4286,
2218,
2187,
277,
33,
21,
4672,
5867,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11989,
16,
498,
16,
4674,
16,
1061,
16,
498,
67,
345,
67,
3890,
33,
20,
16,
302,
2218,
1264,
25,
2187,
4286,
2218,
2187,
277,
33,
21,
4672,
5867,
273,
... |
([\s\S]*?)</table>''', fr).group(1) | ([\s\S]*?)</table>''', fr) if gp == 'privsec0018_2006-05-09.html': assert not Mppstext return "SKIPTHIS", None if not Mppstext: print gp ppstext = Mppstext.group(1) | def ParsePrivSecPage(fr, gp): # extract the updated date and time frupdated = re.search('<td class="lastupdated">\s*Updated\s*([\d/]*) ([\d:]*)\s*</td>', fr) lsudate = re.match("(\d\d)/(\d\d)/(\d\d)$", frupdated.group(1)) y2k = int(lsudate.group(3)) < 50 and "20" or "19" sudate = "%s%s-%s-%s" % (y2k, lsudate.group(3), lsudate.group(2), lsudate.group(1)) sutime = frupdated.group(2) sdate = sudate stime = sutime # or midnight if not posted properly to match the msdate if (gp == 'privsec0017_2006-01-13.html'): sdate = '2006-01-13' stime = '12:00' res = [ ] ppstext = re.search('''(?x)<tr>\s*<td[^>]*> <font[^>]*><b>Attorney-General.see.</b>\s*Law.Officers.Department</font> </td>\s*</tr> ([\s\S]*?)</table>''', fr).group(1) ppslst = re.split("</?tr>", ppstext) # match the name form on each entry #<TD><B>Abercorn, Duke of</B></TD><TD>Lord Steward, HM Household</TD> luniqgov = uniqgovposns[:] deptname = None ministername = None for e1 in ppslst: e = e1.strip() if re.match("(?:<[^<]*>|\s| )*$", e): continue deptMatch = re.match('<td[^>]*><font[^>]*><b>([^<]*)(?:</b></font></td>)?$', e1) if deptMatch: deptname = deptMatch.group(1) # carry forward department name continue nameMatch = re.match("<td>\s*([^<]*)</td><td>\s*([^<]*)(?:</td>)?$", e1) if nameMatch.group(1): ministername = nameMatch.group(1) # carry forward minister name (when more than one PPS) if deptname in ppsdepts: ec = protooffice() ec.PPSproto((sdate, stime), nameMatch.group(2), ministername, deptname) res.append(ec) else: #print deptname assert deptname in ppsnondepts return (sdate, stime), res | 4bcbb0fc7a72d6b8890dd9eda1d95e4d872728d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8428/4bcbb0fc7a72d6b8890dd9eda1d95e4d872728d6/minpostparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
15475,
2194,
1964,
12,
4840,
16,
4178,
4672,
468,
2608,
326,
3526,
1509,
471,
813,
3812,
7007,
273,
283,
18,
3072,
2668,
32,
4465,
667,
1546,
2722,
7007,
6,
5333,
87,
14,
7381,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
15475,
2194,
1964,
12,
4840,
16,
4178,
4672,
468,
2608,
326,
3526,
1509,
471,
813,
3812,
7007,
273,
283,
18,
3072,
2668,
32,
4465,
667,
1546,
2722,
7007,
6,
5333,
87,
14,
7381,
6... |
= self.calculateBarLength( value ) aIndicator = (value / (float)(10**(self.theMultiplier))) \ | = self.calculateBarLength( aValue ) aIndicator = (aValue / (float)(10**(self.theMultiplier))) \ | def update( self ): aString = str( self.theFullPN()[ID] ) aString += ':\n' + str( self.theFullPN()[PROPERTY] ) self.theIDEntry.set_text ( aString ) | d6afe4061131c3989292a58918940112ac0c8b2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/d6afe4061131c3989292a58918940112ac0c8b2d/BargraphWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
262,
30,
225,
279,
780,
273,
609,
12,
365,
18,
5787,
5080,
15124,
1435,
63,
734,
65,
262,
279,
780,
1011,
4290,
64,
82,
11,
397,
609,
12,
365,
18,
5787,
5080,
15124,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
262,
30,
225,
279,
780,
273,
609,
12,
365,
18,
5787,
5080,
15124,
1435,
63,
734,
65,
262,
279,
780,
1011,
4290,
64,
82,
11,
397,
609,
12,
365,
18,
5787,
5080,
15124,
... |
args = [decodeArg(sys.argv[0]) ] + [decodeArg('"%s"' % s) for s in sys.argv[1:]] | args = [decodeArg(modname)] + [decodeArg('"%s"' % s) for s in sys.argv[1:]] | def writeToCommandLogFile(): """ Save the name of the called module along with all parameters to logs/commands.log so that the user can look it up later to track errors or report bugs. """ # put quotation marks around all parameters args = [decodeArg(sys.argv[0]) ] + [decodeArg('"%s"' % s) for s in sys.argv[1:]] commandLogFilename = config.datafilepath('logs', 'commands.log') try: commandLogFile = codecs.open(commandLogFilename, 'a', 'utf-8') except IOError: commandLogFile = codecs.open(commandLogFilename, 'w', 'utf-8') # add a timestamp in ISO 8601 formulation isoDate = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) commandLogFile.write("%s r%s Python %s " % (isoDate, version.getversiondict()['rev'], sys.version.split()[0])) s = u' '.join(args) commandLogFile.write(s + os.linesep) commandLogFile.close() | 1193a3d70006d1b334af19ee49cc92fa5e63991f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/1193a3d70006d1b334af19ee49cc92fa5e63991f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12870,
2189,
19103,
13332,
3536,
7074,
326,
508,
434,
326,
2566,
1605,
7563,
598,
777,
1472,
358,
5963,
19,
7847,
18,
1330,
1427,
716,
326,
729,
848,
2324,
518,
731,
5137,
358,
3298,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12870,
2189,
19103,
13332,
3536,
7074,
326,
508,
434,
326,
2566,
1605,
7563,
598,
777,
1472,
358,
5963,
19,
7847,
18,
1330,
1427,
716,
326,
729,
848,
2324,
518,
731,
5137,
358,
3298,
133... |
-0.00000000000074992740280181431112064614366496792309675391526978827185055 | -0.00000000000074992740280181431112064614366622348652078895136533593355718 | def nintegral(self, x, a, b, desired_relative_error='1e-8', maximum_num_subintervals=200): r""" Return a floating point machine precision numerical approximation to the integral of self from a to b, computed using floating point arithmetic and the GSL scientific library. | 4b26dcc2bd8e78b8213e37fc98bb329900126eb2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/4b26dcc2bd8e78b8213e37fc98bb329900126eb2/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14970,
23811,
12,
2890,
16,
619,
16,
279,
16,
324,
16,
6049,
67,
11626,
67,
1636,
2218,
21,
73,
17,
28,
2187,
4207,
67,
2107,
67,
1717,
19812,
33,
6976,
4672,
436,
8395,
2000,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
14970,
23811,
12,
2890,
16,
619,
16,
279,
16,
324,
16,
6049,
67,
11626,
67,
1636,
2218,
21,
73,
17,
28,
2187,
4207,
67,
2107,
67,
1717,
19812,
33,
6976,
4672,
436,
8395,
2000,
2... |
gLogger.info("TransferAgent.execute: Attempting to execute %s sub-request." % operation) | gLogger.info( "TransferAgent.execute: Attempting to execute %s sub-request." % operation ) | def executeRequest(self): ################################################ # Get a request from request DB gMonitor.addMark( "Iteration", 1 ) res = self.RequestDBClient.getRequest('transfer') if not res['OK']: gLogger.info("TransferAgent.execute: Failed to get request from database.") return S_OK() elif not res['Value']: gLogger.info("TransferAgent.execute: No requests to be executed found.") return S_OK() requestString = res['Value']['RequestString'] requestName = res['Value']['RequestName'] sourceServer= res['Value']['Server'] try: jobID = int(res['Value']['JobID']) except: jobID = 0 gLogger.info("TransferAgent.execute: Obtained request %s" % requestName) | e9b27a9be4536012e60823ee81099deb0a1fbe85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e9b27a9be4536012e60823ee81099deb0a1fbe85/TransferAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
691,
12,
2890,
4672,
19709,
26487,
13151,
468,
968,
279,
590,
628,
590,
2383,
314,
7187,
18,
1289,
3882,
12,
315,
10795,
3113,
404,
262,
400,
273,
365,
18,
691,
2290,
1227,
18,
5... |
i = string.find(sys.version, prefix) | i = sys.version.find(prefix) | def get_platform (): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the architecture (as supplied by 'os.uname()'), although the exact information included depends on the OS; eg. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-x86_64 (64bit Windows on x86_64 (AMD64)) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. """ if os.name == 'nt': # sniff sys.version for architecture. prefix = " bit (" i = string.find(sys.version, prefix) if i == -1: return sys.platform j = string.find(sys.version, ")", i) look = sys.version[i+len(prefix):j].lower() if look=='amd64': return 'win-x86_64' if look=='itanium': return 'win-ia64' return sys.platform if os.name != "posix" or not hasattr(os, 'uname'): # XXX what about the architecture? NT is Intel or Alpha, # Mac OS is M68k or PPC, etc. return sys.platform # Try to distinguish various flavours of Unix (osname, host, release, version, machine) = os.uname() # Convert the OS name to lowercase, remove '/' characters # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") osname = osname.lower().replace('/', '') machine = machine.replace(' ', '_') machine = machine.replace('/', '-') if osname[:5] == "linux": # At least on Linux/Intel, 'machine' is the processor -- # i386, etc. # XXX what about Alpha, SPARC, etc? return "%s-%s" % (osname, machine) elif osname[:5] == "sunos": if release[0] >= "5": # SunOS 5 == Solaris 2 osname = "solaris" release = "%d.%s" % (int(release[0]) - 3, release[2:]) # fall through to standard osname-release-machine representation elif osname[:4] == "irix": # could be "irix64"! return "%s-%s" % (osname, release) elif osname[:3] == "aix": return "%s-%s.%s" % (osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+') m = rel_re.match(release) if m: release = m.group() elif osname[:6] == "darwin": # # For our purposes, we'll assume that the system version from # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set # to. This makes the compatibility story a bit more sane because the # machine is going to compile and link as if it were # MACOSX_DEPLOYMENT_TARGET. from distutils.sysconfig import get_config_vars cfgvars = get_config_vars() macver = os.environ.get('MACOSX_DEPLOYMENT_TARGET') if not macver: macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') if not macver: # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) try: f = open('/System/Library/CoreServices/SystemVersion.plist') except IOError: # We're on a plain darwin box, fall back to the default # behaviour. pass else: m = re.search( r'<key>ProductUserVisibleVersion</key>\s*' + r'<string>(.*?)</string>', f.read()) f.close() if m is not None: macver = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour if macver: from distutils.sysconfig import get_config_vars release = macver osname = "macosx" if (release + '.') < '10.4.' and \ get_config_vars().get('UNIVERSALSDK', '').strip(): # The universal build will build fat binaries, but not on # systems before 10.4 machine = 'fat' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. machine = 'ppc' return "%s-%s-%s" % (osname, release, machine) | c49a8d0dc091a213d4117981931f3d1357ba1d02 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/c49a8d0dc091a213d4117981931f3d1357ba1d02/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9898,
1832,
30,
3536,
990,
279,
533,
716,
25283,
326,
783,
4072,
18,
225,
1220,
353,
1399,
31457,
358,
23926,
4072,
17,
12524,
1361,
6402,
471,
4072,
17,
12524,
6650,
23296,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9898,
1832,
30,
3536,
990,
279,
533,
716,
25283,
326,
783,
4072,
18,
225,
1220,
353,
1399,
31457,
358,
23926,
4072,
17,
12524,
1361,
6402,
471,
4072,
17,
12524,
6650,
23296,
18,... |
def closeEvent(self,ce): | def closeEvent(self,ce): | def closeEvent(self,ce): if not self.assy.modified: ce.accept() return rc = QMessageBox.warning( self, self.name(), "The part has been changed since the last save.\n" "Do you want to save the changes before exiting?", "&Save", "&Discard", "Cancel", 0, # Enter == button 0 2 ) # Escape == button 2 | c1cfa0a31ca5d9e14873b5fbcd2cb04f892ddc6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/c1cfa0a31ca5d9e14873b5fbcd2cb04f892ddc6d/MWsemantics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
1133,
12,
2890,
16,
311,
4672,
225,
309,
486,
365,
18,
428,
93,
18,
7342,
30,
5898,
18,
9436,
1435,
327,
225,
4519,
273,
30728,
18,
8551,
12,
365,
16,
365,
18,
529,
9334,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
1133,
12,
2890,
16,
311,
4672,
225,
309,
486,
365,
18,
428,
93,
18,
7342,
30,
5898,
18,
9436,
1435,
327,
225,
4519,
273,
30728,
18,
8551,
12,
365,
16,
365,
18,
529,
9334,
315,
... |
'<td>%5.2f</td>' % (tls.rmsd_b), | '<td>%5.2f</td>' % (tls.rmsd_b), | def html_tls_group_table(ntls, chain, cpartition, report_root = None): """Generate HTML for a table containing the details of the ntls-group partitioning of the given chain. """ ## inspect the first tls group dictionary to determine TLS model type try: tls = cpartition.tls_list[0] except IndexError: return "" tls_model = tls.tls_group.model if tls_model == "ISOT": t_head = 'T<sup>r</sup> <var>B</var>' elif tls_model == "ANISO": t_head = 'eval(T<sup>r</sup>) <var>B</var>' else: return "" l = ['<table width="100%" border=0 style="background-color:#eeeeee; font-size:x-small">', '<tr>', '<th align="center" colspan="12">Analysis of TLS Group %s Chain Segments (overall rmsd_b=%.2f and residual=%.2f)</th>' %(ntls,cpartition.rmsd_b(),cpartition.residual()), ## Added "overall rmsd_b + residual". Christoph Champ, 2008-04-05 '</tr>', '<tr>', '<th colspan="7" style="background-color:#aaaaaa">Input Structure</th>', '<th colspan="5" style="background-color:#bbbbbb">TLS Predictions</th>', '</tr>', '<tr style="background-color:#bbbbbb">', '<th>Color</th>', '<th>Segment</th>', '<th>Residues</th>', '<th>Atoms</th>', '<th><B></th>', '<th>B<sub>rmsd</sub></th>', ## Added. Christoph Champ, 2008-04-15 '<th><Aniso></th>', '<th>RMSD B</th>', '<th>%s</th>' % (t_head), '<th>eval(L) <var>DEG<sup>2</sup></var></th>', '<th><B></th>', '<th><Aniso></th>', '</tr>' ] bgcolor_flag = True for tls in cpartition.iter_tls_segments(): ## Calculate the stddev for all temperature factors in a given segment. Christoph Champ, 2008-04-15 tmp_temp_factor = [] for atm, Utls in tls.tls_group.iter_atm_Utls(): tmp_temp_factor.append(atm.temp_factor) stddev=numpy.std(tmp_temp_factor) tls_group = tls.tls_group mtls_info = tls.model_tls_info ## EAM DEBUG - I think this results from a previous exception in html_tls_graph_path() if mtls_info == None: l.append('<tr style="background-color:#ffeeee"><td colspan="12" align-text="center">Error</td></tr>') continue L1 = mtls_info["L1_eigen_val"] * Constants.RAD2DEG2 L2 = mtls_info["L2_eigen_val"] * Constants.RAD2DEG2 L3 = mtls_info["L3_eigen_val"] * Constants.RAD2DEG2 if tls_model=="ISOT": t_data = "%5.1f" % (mtls_info["Tr1_eigen_val"] * Constants.U2B) else: Tr1 = mtls_info["Tr1_eigen_val"] * Constants.U2B Tr2 = mtls_info["Tr2_eigen_val"] * Constants.U2B Tr3 = mtls_info["Tr3_eigen_val"] * Constants.U2B t_data = '%5.1f, %5.1f, %5.1f' % (Tr1, Tr2, Tr3), ## alternate row background color if bgcolor_flag: l.append('<tr style="background-color:#dddddd">') else: l.append('<tr>') bgcolor_flag = not bgcolor_flag ## path to color thumbnail if report_root: cpath = os.path.join(report_root, tls.color.thumbnail_path) else: cpath = tls.color.thumbnail_path l += ['<td align="center" valign="middle"><img src="%s" alt="%s"></td>' % (cpath, tls.color.name), '<td>%s</td>' % (tls.display_label()), '<td>%d</td>' % (tls.num_residues()), '<td>%d</td>' % (tls.num_atoms()), '<td>%5.1f</td>' % (tls.mean_b()), '<td>%5.2f</td>' % (stddev), ## Added. Christoph Champ, 2008-04-15 '<td>%4.2f</td>' % (tls.mean_anisotropy()), '<td>%5.2f</td>' % (tls.rmsd_b), '<td>%s</td>' % (t_data), '<td>%5.2f, %5.2f, %5.2f</td>' % (L1, L2, L3), '<td>%5.1f</td>' % (tls.tls_mean_b()), '<td>%4.2f</td>' % (tls.tls_mean_anisotropy()), '</tr>'] l.append('</table>') return "".join(l) | 81092918682cb3b404793cc6abd4020f9621498a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10674/81092918682cb3b404793cc6abd4020f9621498a/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
17116,
67,
1655,
67,
2121,
12,
496,
3251,
16,
2687,
16,
276,
10534,
16,
2605,
67,
3085,
273,
599,
4672,
3536,
4625,
3982,
364,
279,
1014,
4191,
326,
3189,
434,
326,
9513,
325... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
17116,
67,
1655,
67,
2121,
12,
496,
3251,
16,
2687,
16,
276,
10534,
16,
2605,
67,
3085,
273,
599,
4672,
3536,
4625,
3982,
364,
279,
1014,
4191,
326,
3189,
434,
326,
9513,
325... |
self.enable_call_buttons(len(selected_items)==1 and type(self.contact_model.data(selected_items[0])) is Contact) | self.enable_call_buttons(len(selected_items)==1 and isinstance(self.contact_model.data(selected_items[0]), Contact)) | def contact_list_selection_changed(self, selected, deselected): selected_items = self.contact_list.selectionModel().selectedIndexes() self.enable_call_buttons(len(selected_items)==1 and type(self.contact_model.data(selected_items[0])) is Contact) | 5c1ff76abe25b8278678e2d1609706e6b125ef66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3447/5c1ff76abe25b8278678e2d1609706e6b125ef66/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5388,
67,
1098,
67,
10705,
67,
6703,
12,
2890,
16,
3170,
16,
2832,
292,
828,
4672,
3170,
67,
3319,
273,
365,
18,
8994,
67,
1098,
18,
10705,
1488,
7675,
8109,
8639,
1435,
365,
18,
7589,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5388,
67,
1098,
67,
10705,
67,
6703,
12,
2890,
16,
3170,
16,
2832,
292,
828,
4672,
3170,
67,
3319,
273,
365,
18,
8994,
67,
1098,
18,
10705,
1488,
7675,
8109,
8639,
1435,
365,
18,
7589,... |
rv_generic.__init__(self) | super(rv_generic,self).__init__() | def __init__(self, a=0, b=inf, name=None, badvalue=None, moment_tol=1e-8,values=None,inc=1,longname=None, shapes=None, extradoc=None): | 8b3a4224a0eebc7cef8c46d42fde0301ea131ef1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/8b3a4224a0eebc7cef8c46d42fde0301ea131ef1/distributions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
279,
33,
20,
16,
324,
33,
10625,
16,
508,
33,
7036,
16,
5570,
1132,
33,
7036,
16,
10382,
67,
3490,
33,
21,
73,
17,
28,
16,
2372,
33,
7036,
16,
9523,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
279,
33,
20,
16,
324,
33,
10625,
16,
508,
33,
7036,
16,
5570,
1132,
33,
7036,
16,
10382,
67,
3490,
33,
21,
73,
17,
28,
16,
2372,
33,
7036,
16,
9523,
... |
'start' : 0, 'reason' : 'ordinal not in range(128)'}), | 'start' : 0, 'reason' : 'ordinal not in range'}), | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | 0ab94afc7a8f9a3238729fdb056a83090166af3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0ab94afc7a8f9a3238729fdb056a83090166af3f/test_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... |
isBracketAligned = True | isBracketAligned = False | def apply(self, lines): vList = [] # don't enforce this for line continuation of argument lists or other parenthesized statements inParentheses = False if (self.getFiletype() in self.getTypeList()): for line in lines: if (re.search("\([^\)]+$", line.stripped)): inParentheses = True m = re.search("^(\s*)[^\s]", line.stripped) if (m and not (inParentheses or re.search("^\s*(case|default)", line.stripped))): leadingSpace = m.group(1) nLead = len(leadingSpace) # check and see if we're aligned to a '(' # ... the inParentheses test above will fail if an arg is x = func(y) isBracketAligned = True jLine = line.number - 2 # the previous line | 5432dc4fee5b9db163a86ec3ee3f1ecc4222856d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6529/5432dc4fee5b9db163a86ec3ee3f1ecc4222856d/style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
16,
2362,
4672,
331,
682,
273,
5378,
225,
468,
2727,
1404,
12980,
333,
364,
980,
17378,
434,
1237,
6035,
578,
1308,
15231,
1235,
6317,
316,
17880,
281,
273,
1083,
309,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
12,
2890,
16,
2362,
4672,
331,
682,
273,
5378,
225,
468,
2727,
1404,
12980,
333,
364,
980,
17378,
434,
1237,
6035,
578,
1308,
15231,
1235,
6317,
316,
17880,
281,
273,
1083,
309,
26... |
self._getbitmap(filename) | return self._getbitmap(filename) | def loadbitmap(self, filename): self._getbitmap(filename) | 6df99dc53926dc524a71e80f5983fd1dff419351 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/6df99dc53926dc524a71e80f5983fd1dff419351/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
3682,
1458,
12,
2890,
16,
1544,
4672,
327,
365,
6315,
588,
3682,
1458,
12,
3459,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
3682,
1458,
12,
2890,
16,
1544,
4672,
327,
365,
6315,
588,
3682,
1458,
12,
3459,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.open_internal(xcodeproj_filepath(), 'open') | self.open_internal(self.xcodeproj_filepath(), 'open') | def open(self): generator = self.get_generator_from_config() if generator.startswith('Visual Studio'): print 'Opening with %s...' % generator self.open_internal(self.sln_filepath()) elif generator.startswith('Xcode'): print 'Opening with %s...' % generator self.open_internal(xcodeproj_filepath(), 'open') else: raise Exception('Not supported with generator: ' + generator) | 27fbda691225030ecaa4bb35a59e3fda2d092cc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6688/27fbda691225030ecaa4bb35a59e3fda2d092cc2/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
4456,
273,
365,
18,
588,
67,
8812,
67,
2080,
67,
1425,
1435,
309,
4456,
18,
17514,
1918,
2668,
25780,
934,
4484,
11,
4672,
1172,
296,
21378,
598,
738,
87,
7821,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
4672,
4456,
273,
365,
18,
588,
67,
8812,
67,
2080,
67,
1425,
1435,
309,
4456,
18,
17514,
1918,
2668,
25780,
934,
4484,
11,
4672,
1172,
296,
21378,
598,
738,
87,
7821,
7... |
self.intended_tags = self.get_selected_tags() treeview.set_cursor(old_path, old_col, 0) | def on_tag_treeview_button_press_event(self, treeview, event): if event.button == 3: x = int(event.x) y = int(event.y) time = event.time pthinfo = treeview.get_path_at_pos(x, y) if pthinfo is not None: path, col, cellx, celly = pthinfo #pylint: disable-msg=W0612 treeview.grab_focus() # Stores the currently selected item so that we can return to # it when we're done. Makes it so that the view isn't switched # every time a tag is right clicked. old_path, old_col = treeview.get_cursor() treeview.set_cursor(path, col, 0) selected_tags = self.get_selected_tags()[0] if len(selected_tags) > 0: # Then we are looking at single, normal tag rather than # the special 'All tags' or 'Tasks without tags'. We only # want to popup the menu for normal tags. display_in_workview_item = self.tagpopup.get_children()[2] selected_tag = selected_tags[0] nonworkview = selected_tag.get_attribute("nonworkview") # We must invert because the tagstore has "True" for tasks # that are *not* in workview, and the checkbox is set if # the tag *is* shown in the workview. if nonworkview == "True": shown = False else: shown = True display_in_workview_item.set_active(shown) self.tagpopup.popup(None, None, None, event.button, time) # Stores the right-clicked tag here so that we can work # with it even after the cursor returns to its previous # position. self.intended_tags = self.get_selected_tags() treeview.set_cursor(old_path, old_col, 0) return 1 | bfe6d5b75538050c23bfc2e0d6b76f4cf341af5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/bfe6d5b75538050c23bfc2e0d6b76f4cf341af5d/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2692,
67,
3413,
1945,
67,
5391,
67,
1028,
67,
2575,
12,
2890,
16,
2151,
1945,
16,
871,
4672,
309,
871,
18,
5391,
422,
890,
30,
619,
273,
509,
12,
2575,
18,
92,
13,
677,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2692,
67,
3413,
1945,
67,
5391,
67,
1028,
67,
2575,
12,
2890,
16,
2151,
1945,
16,
871,
4672,
309,
871,
18,
5391,
422,
890,
30,
619,
273,
509,
12,
2575,
18,
92,
13,
677,
27... | |
return new Node(t, LET) | return Node(t, LET) | def LET__build(t): return new Node(t, LET) | c7acf93c85d2480e1e64e292c2f42ae1721eefbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/c7acf93c85d2480e1e64e292c2f42ae1721eefbe/Builder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
1584,
972,
3510,
12,
88,
4672,
327,
394,
2029,
12,
88,
16,
511,
1584,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
511,
1584,
972,
3510,
12,
88,
4672,
327,
394,
2029,
12,
88,
16,
511,
1584,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.debugging: print '<-- file', `file` | print '!'*self.debugging, '<-- file', `file` | def do_include(self, args): file = args file = os.path.join(self.includedir, file) try: fp = open(file, 'r') except IOError, msg: print '*** Can\'t open include file', `file` return if self.debugging: print '--> file', `file` save_done = self.done save_skip = self.skip save_stack = self.stack self.includedepth = self.includedepth + 1 self.parserest(fp, 0) self.includedepth = self.includedepth - 1 fp.close() self.done = save_done self.skip = save_skip self.stack = save_stack if self.debugging: print '<-- file', `file` | db6f5c4045c0343f80223a59ad6975c71dc11049 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/db6f5c4045c0343f80223a59ad6975c71dc11049/texi2html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
6702,
12,
2890,
16,
833,
4672,
585,
273,
833,
585,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
20405,
481,
16,
585,
13,
775,
30,
4253,
273,
1696,
12,
768,
16,
296,
86,
613... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
6702,
12,
2890,
16,
833,
4672,
585,
273,
833,
585,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
20405,
481,
16,
585,
13,
775,
30,
4253,
273,
1696,
12,
768,
16,
296,
86,
613... |
print "* ",som2[0] print "* ",som2[1] | print "* ", som2[0] print "* ", som2[1] | def energy_transfer(left,right,**kwargs): """ This function takes a tuple and a SOM, a tuple and a SO or two tuples and calculates the energy transfer in units of THz. The SOM principle axis must be in units of meV. The SO and tuples are assumed to be in units of meV. Parameters: ---------- -> left is a SOM, SO or tuple on the left side of the subtraction -> right is a SOM, SO or tuple on the right side of the subtraction -> kwargs is a list of key word arguments that the function accepts: units= a string containing the expected units for this function. The default for this function is meV Return: ------ <- A SOM, SO or tuple based on left - right in units of THz Exceptions: ---------- <- RuntimeError is raised if the x-axis units are not meV """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(left,right) (l_descr,r_descr)=hlr_utils.get_descr(left,right) # error checking for types if l_descr == "SOM" and r_descr == "SOM": raise TypeError, "SOM-SOM operation not supported" elif l_descr == "SOM" and r_descr == "SO": raise TypeError, "SOM-SO operation not supported" elif l_descr == "SO" and r_descr == "SOM": raise TypeError, "SO-SOM operation not supported" elif l_descr == "SO" and r_descr == "SO": raise TypeError, "SO-SO operation not supported" else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "meV" result=hlr_utils.copy_som_attr(result,res_descr,left,l_descr,right,r_descr) if res_descr == "SOM": index = hlr_utils.hlr_1D_units(result, units) result = hlr_utils.hlr_force_units(result, "THz", index) result.setAxisLabel(index, "energy transfer") result.setYUnits("Counts/THz") result.setYLabel("Intensity") else: pass # iterate through the values import axis_manip for i in range(hlr_utils.get_length(left,right)): val1 = hlr_utils.get_value(left,i,l_descr,"x") err2_1 = hlr_utils.get_err2(left,i,l_descr,"x") val2 = hlr_utils.get_value(right,i,r_descr,"x") err2_2 = hlr_utils.get_err2(right,i,r_descr,"x") value=axis_manip.energy_transfer(val1, err2_1, val2, err2_2) map_so = hlr_utils.get_map_so(left,right,i) hlr_utils.result_insert(result,res_descr,value,map_so,"x") return result | 6616e35e539c4c6226057c57a0d82efcc16edee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/6616e35e539c4c6226057c57a0d82efcc16edee3/hlr_energy_transfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12929,
67,
13866,
12,
4482,
16,
4083,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
3193,
471,
279,
348,
1872,
16,
279,
3193,
471,
279,
7460,
578,
2795,
10384,
471,
17264,
326,
12929,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12929,
67,
13866,
12,
4482,
16,
4083,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
3193,
471,
279,
348,
1872,
16,
279,
3193,
471,
279,
7460,
578,
2795,
10384,
471,
17264,
326,
12929,... |
html.write('var aSearchHosts = %s;' % data) html.write('mkSearchAddField("mk_side_search_field", "main", "%s");</script>' % defaults.checkmk_web_uri) | html.write("aSearchHosts = %s;\n" % data) html.write('</script>') | def render_searchform(): html.write('<script type="text/javascript" src="%s/search.js"></script>' % defaults.checkmk_web_uri) html.write('<div id="mk_side_search">') html.write('<input id="mk_side_search_field" type="text" name="search" />') html.write('</div>') html.write('<script type="text/javascript">') # Store (user) hosts in JS array data = html.live.query("GET hosts\nColumns: name alias\n") html.write('var aSearchHosts = %s;' % data) html.write('mkSearchAddField("mk_side_search_field", "main", "%s");</script>' % defaults.checkmk_web_uri) | 0077cf4d96a72bbf7908ea2594e5fda902550f2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5589/0077cf4d96a72bbf7908ea2594e5fda902550f2d/search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3072,
687,
13332,
1729,
18,
2626,
2668,
32,
4263,
618,
1546,
955,
19,
11242,
6,
1705,
11613,
87,
19,
3072,
18,
2924,
13762,
4263,
1870,
738,
3467,
18,
1893,
24816,
67,
4875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
3072,
687,
13332,
1729,
18,
2626,
2668,
32,
4263,
618,
1546,
955,
19,
11242,
6,
1705,
11613,
87,
19,
3072,
18,
2924,
13762,
4263,
1870,
738,
3467,
18,
1893,
24816,
67,
4875,
... |
self._editTime = None | self._editTime = '0' self._startTime = '0' | def __init__(self, site, title, insite=None, defaultNamespace=0): try: # if _editrestriction is True, it means that the page has been found # to have an edit restriction, but we do not know yet whether the # restriction affects us or not self._editrestriction = False | 9eceded4974ba66395f58e066c1ae11283615f99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/9eceded4974ba66395f58e066c1ae11283615f99/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2834,
16,
2077,
16,
2763,
1137,
33,
7036,
16,
805,
3402,
33,
20,
4672,
775,
30,
468,
309,
389,
4619,
23954,
353,
1053,
16,
518,
4696,
716,
326,
1363,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2834,
16,
2077,
16,
2763,
1137,
33,
7036,
16,
805,
3402,
33,
20,
4672,
775,
30,
468,
309,
389,
4619,
23954,
353,
1053,
16,
518,
4696,
716,
326,
1363,
7... |
if not hasfunc and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module did not have attribute named %s" % name) if not func_is_func and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module attribute %s was not a function" % name) if not func_has_correct_param and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module function %s did not have %d arguments" % (name, num_args)) | def validate_execution_hook(self, module, name, num_args): if self.debug_output >= DEBUG_ALL: print "Module %s has attribute %s: %s " % (module, name, hasattr(module, name)) print "Module attribute %s is of type 'func_code': %s" % (name, hasattr(module.__dict__[name], "func_code")) print "Module function %s has %d args: %s" % (name, num_args, module.__dict__[name].func_code.co_argcount is num_args) hasfunc = hasattr(module, name) func_is_func = hasattr(module.__dict__[name], "func_code") func_has_correct_param = module.__dict__[name].func_code.co_argcount is num_args if not hasfunc and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module did not have attribute named %s" % name) if not func_is_func and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module attribute %s was not a function" % name) if not func_has_correct_param and not self.fault_tolerance: raise ModuleUnloadeableException(module.__name__, "Module function %s did not have %d arguments" % (name, num_args)) # Ryan: Is this ok? return True | ac8394e492ea52df689e85bed76504f07ab8ee23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/635/ac8394e492ea52df689e85bed76504f07ab8ee23/moduleloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
16414,
67,
4476,
12,
2890,
16,
1605,
16,
508,
16,
818,
67,
1968,
4672,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
3120,
738,
87,
711,
1566,
738,
87,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
67,
16414,
67,
4476,
12,
2890,
16,
1605,
16,
508,
16,
818,
67,
1968,
4672,
309,
365,
18,
4148,
67,
2844,
1545,
6369,
67,
4685,
30,
1172,
315,
3120,
738,
87,
711,
1566,
738,
87,... | |
self.muc.sayTo(to, auto_decode(message)) | if self.xmpp_c != None: self.muc.sayTo(to, auto_decode(message)) elif self.irc_connection == None: if self.bridge.mode != 'normal': self.bridge.getParticipant(to).sayOnXMPPTo(self.nickname, 'Sorry but cross-protocol private messages are disabled in '+self.bridge.mode+' mode.') else: self.bridge.getParticipant(to).sayOnXMPPTo(self.nickname, 'Sorry but you cannot send cross-protocol private messages because I don\'t have an XMPP duplicate with your nickname.') | def sayOnXMPPTo(self, to, message): if self.protocol == 'xmpp': raise Exception('[Internal Error] "'+self.nickname+'" comes from XMPP') try: self.muc.sayTo(to, auto_decode(message)) except EncodingException: self.bridge.say('[Warning] "'+self.nickname+'" is sending messages using an unknown encoding') | d96bf24efa4ff6b4c74a1fdc2610fadf512c84fe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9915/d96bf24efa4ff6b4c74a1fdc2610fadf512c84fe/participant.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12532,
1398,
60,
19388,
774,
12,
2890,
16,
358,
16,
883,
4672,
309,
365,
18,
8373,
422,
296,
92,
24109,
4278,
1002,
1185,
2668,
63,
3061,
1068,
65,
2491,
15,
2890,
18,
17091,
529,
15,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12532,
1398,
60,
19388,
774,
12,
2890,
16,
358,
16,
883,
4672,
309,
365,
18,
8373,
422,
296,
92,
24109,
4278,
1002,
1185,
2668,
63,
3061,
1068,
65,
2491,
15,
2890,
18,
17091,
529,
15,
... |
raise osv.except_osv(_('Data Insufficient !'), | raise osv.except_osv(_('Data Insufficient !'), | def action_confirm(self, cr, uid, ids, context={}): """ Confirms procurement and writes exception message if any. @return: True """ move_obj = self.pool.get('stock.move') for procurement in self.browse(cr, uid, ids): if procurement.product_qty <= 0.00: raise osv.except_osv(_('Data Insufficient !'), _('Please check the Quantity in Procurement Order(s), it should not be less than 1!')) if procurement.product_id.type in ('product', 'consu'): if not procurement.move_id: source = procurement.location_id.id if procurement.procure_method == 'make_to_order': source = procurement.product_id.product_tmpl_id.property_stock_procurement.id id = move_obj.create(cr, uid, { 'name': procurement.name, 'location_id': source, 'location_dest_id': procurement.location_id.id, 'product_id': procurement.product_id.id, 'product_qty': procurement.product_qty, 'product_uom': procurement.product_uom.id, 'date_expected': procurement.date_planned, 'state': 'draft', 'company_id': procurement.company_id.id, 'auto_validate': True, }) move_obj.action_confirm(cr, uid, [id], context=context) self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1}) self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''}) return True | be16348523df3d3f4769b71419d143ad492f98b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be16348523df3d3f4769b71419d143ad492f98b4/procurement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10927,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3536,
9675,
481,
959,
5418,
594,
475,
471,
7262,
1520,
883,
309,
1281,
18,
632,
2463,
30,
1053,
3536,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10927,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
12938,
4672,
3536,
9675,
481,
959,
5418,
594,
475,
471,
7262,
1520,
883,
309,
1281,
18,
632,
2463,
30,
1053,
3536,
363... |
"'ascii' codec can't encode character '\\xfc' in position 1: ouch" | "'ascii' codec can't encode character u'\\xfc' in position 1: ouch" | def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters in position 1-3: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\u0100x", 0, 1, "ouch"], "'ascii' codec can't encode character '\\u0100' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\uffffx", 0, 1, "ouch"], "'ascii' codec can't encode character '\\uffff' in position 0: ouch" ) if sys.maxunicode > 0xffff: self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\U00010000x", 0, 1, "ouch"], "'ascii' codec can't encode character '\\U00010000' in position 0: ouch" ) | 98297cb7539a203e5469af40bd7bee10634456e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/98297cb7539a203e5469af40bd7bee10634456e8/test_codeccallbacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
3015,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
5509,
668,
16,
8247,
9184,
3113,
582,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
576,
16,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
3015,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
5509,
668,
16,
8247,
9184,
3113,
582,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
576,
16,
31... |
rev_display = ' (to revision %s)' % rev | rev_display = ' (to %s)' % rev | def obtain(self, dest): url, rev = self.get_url_rev() if rev: rev_options = [rev] rev_display = ' (to revision %s)' % rev else: rev_options = ['origin/master'] rev_display = '' if self.check_destination(dest, url, rev_options, rev_display): logger.notify('Cloning %s%s to %s' % (url, rev_display, display_path(dest))) call_subprocess( [self.cmd, 'clone', '-q', url, dest]) rev_options = self.check_rev_options(rev, dest, rev_options) call_subprocess( [self.cmd, 'checkout', '-q'] + rev_options, cwd=dest) | a8de40cac1efc1e64dff6e62ad6939499027ed0d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/a8de40cac1efc1e64dff6e62ad6939499027ed0d/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
306,
9083,
65,
5588,
67,
5417,
273,
296,
261,
869,
738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
306,
9083,
65,
5588,
67,
5417,
273,
296,
261,
869,
738,... |
print self.datafile_dir | def update_pathconfig(self): # Write the new location to the pathconfig.py file. pathconfig = os.path.join(self.build_lib, self.package, 'pathconfig.py') if self.datafile_dir is None: # Make sure that we have installed the data files self.run_command('install_data') # Get the location of the installed data try: data_file = open( os.path.join(self.build_base, self.package + '_data_base'), 'r') self.datafile_dir = data_file.read() finally: data_file.close() try: path_file = open(pathconfig, 'r') pathconfig_str = path_file.read() finally: path_file.close() try: path_file = open(pathconfig, 'w') print self.datafile_dir path_file.write(pathconfig_str.replace('os.path.dirname(__file__)', "\"%s\"" % self.datafile_dir + self.package)) finally: path_file.close() | 7e86c9ed7a2671f488d0391e7d7ede4a68f750b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/7e86c9ed7a2671f488d0391e7d7ede4a68f750b4/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
803,
1425,
12,
2890,
4672,
468,
2598,
326,
394,
2117,
358,
326,
589,
1425,
18,
2074,
585,
18,
589,
1425,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
3510,
67,
2941,
16,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
803,
1425,
12,
2890,
4672,
468,
2598,
326,
394,
2117,
358,
326,
589,
1425,
18,
2074,
585,
18,
589,
1425,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18,
3510,
67,
2941,
16,
365... | |
def get_complete_name(self, cursor, user, ids, name, arg, context): res = self.name_get(cursor, user, ids, context) | def get_complete_name(self, cursor, user, ids, name, arg, context=None): res = self.name_get(cursor, user, ids, context=context) | def get_complete_name(self, cursor, user, ids, name, arg, context): res = self.name_get(cursor, user, ids, context) return dict(res) | 42aa0bce747ae29172a353d508b48191e3e818cb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/533/42aa0bce747ae29172a353d508b48191e3e818cb/category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6226,
67,
529,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
365,
18,
529,
67,
588,
12,
9216,
16,
729,
16,
3258,
16,
819,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
6226,
67,
529,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
400,
273,
365,
18,
529,
67,
588,
12,
9216,
16,
729,
16,
3258,
16,
819,
... |
self.exit_rstr.add_restriction(ExitPolicyRestriction("255.255.255.255", 80)) | def reconfigure(self, sorted_r): """This function is called after a configuration change, to rebuild the RestrictionLists.""" if self.use_all_exits: self.path_rstr = PathRestrictionList([UniqueRestriction()]) else: self.path_rstr = PathRestrictionList( [Subnet16Restriction(), UniqueRestriction()]) if self.use_guards: entry_flags = ["Guard", "Valid", "Running"] else: entry_flags = ["Valid", "Running"] | 4b763ab6ae8784d9f66a654e970b49853ea92450 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3224/4b763ab6ae8784d9f66a654e970b49853ea92450/PathSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
14895,
12,
2890,
16,
3115,
67,
86,
4672,
3536,
2503,
445,
353,
2566,
1839,
279,
1664,
2549,
16,
358,
13419,
326,
1124,
6192,
7432,
12123,
309,
365,
18,
1202,
67,
454,
67,
338,
128... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
14895,
12,
2890,
16,
3115,
67,
86,
4672,
3536,
2503,
445,
353,
2566,
1839,
279,
1664,
2549,
16,
358,
13419,
326,
1124,
6192,
7432,
12123,
309,
365,
18,
1202,
67,
454,
67,
338,
128... | |
warn("tables rebuilt because of dependencies updated: '" \ | warn("Tables rebuilt because of dependencies updated: '" \ | def build(self, tables): """ Builds the given tables. | e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11128/e8e9b1566ed97c2e61c03da42d88ea3809b5a0f1/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
4606,
4672,
3536,
3998,
87,
326,
864,
4606,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
2890,
16,
4606,
4672,
3536,
3998,
87,
326,
864,
4606,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
OUTPUT: a free ZZ-module of rank 4 | OUTPUT: a free `\\ZZ`-module of rank 4 | def free_module(self): """ Return the free ZZ-module that corresponds to this order inside the vector space corresponding to the ambient quaternion algebra. | 1ec65dfa0c3aab294b8ecca3f5f5493e154b7172 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/1ec65dfa0c3aab294b8ecca3f5f5493e154b7172/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
67,
2978,
12,
2890,
4672,
3536,
2000,
326,
4843,
2285,
62,
17,
2978,
716,
13955,
358,
333,
1353,
4832,
326,
3806,
3476,
4656,
358,
326,
13232,
1979,
26774,
524,
29087,
18,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4843,
67,
2978,
12,
2890,
4672,
3536,
2000,
326,
4843,
2285,
62,
17,
2978,
716,
13955,
358,
333,
1353,
4832,
326,
3806,
3476,
4656,
358,
326,
13232,
1979,
26774,
524,
29087,
18,
2,
-100,... |
for attDict,count in result['Value']: | for attDict, count in result['Value']: | def getUserSummaryWeb(self,selectDict, sortList, startItem, maxItems): """ Get the summary of user jobs in a standard form for the Web portal. Pagination and global sorting is supported. """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
729,
6550,
316,
279,
4529,
646,
364,
326,
2999,
11899,
18,
169... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4735,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
1524,
682,
16,
787,
1180,
16,
943,
3126,
4672,
3536,
968,
326,
4916,
434,
729,
6550,
316,
279,
4529,
646,
364,
326,
2999,
11899,
18,
169... |
self.text_view.set_size_request(900, 350) | self.text_view.set_size_request(0, int(SIZE_Y * 0.5)) | def __init__(self, handle): """Set up the Pippy activity.""" super(PippyActivity, self).__init__(handle) self._logger = logging.getLogger('pippy-activity') | 022d096d4933fb8b27ead24e0904a67e14e88379 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7610/022d096d4933fb8b27ead24e0904a67e14e88379/pippy_app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1640,
4672,
3536,
694,
731,
326,
29305,
2074,
5728,
12123,
2240,
12,
24925,
2074,
6193,
16,
365,
2934,
972,
2738,
972,
12,
4110,
13,
365,
6315,
4901,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1640,
4672,
3536,
694,
731,
326,
29305,
2074,
5728,
12123,
2240,
12,
24925,
2074,
6193,
16,
365,
2934,
972,
2738,
972,
12,
4110,
13,
365,
6315,
4901,
273,
... |
_cache[key] = weakref.ref(R) | _cache[key] = R | def _save_in_cache(key, R): """ EXAMPLES: sage: from sage.rings.polynomial.laurent_polynomial_ring import _save_in_cache, _get_from_cache sage: L = LaurentPolynomialRing(QQ,2,'x') sage: _save_in_cache('testkey', L) sage: _get_from_cache('testkey') Multivariate Laurent Polynomial Ring in x0, x1 over Rational Field sage: _ is L True """ try: _cache[key] = weakref.ref(R) except TypeError, msg: raise TypeError, 'key = %s\n%s'%(key,msg) | 957c3b07fd0e4f4010a0f424b7337249535c58ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/957c3b07fd0e4f4010a0f424b7337249535c58ce/laurent_polynomial_ring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5688,
67,
267,
67,
2493,
12,
856,
16,
534,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
86,
899,
18,
3915,
13602,
18,
80,
8377,
547,
67,
3915,
13602,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5688,
67,
267,
67,
2493,
12,
856,
16,
534,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
628,
272,
410,
18,
86,
899,
18,
3915,
13602,
18,
80,
8377,
547,
67,
3915,
13602,
67,
... |
raise Unauthorized, ''' | author = anonid if not self.db.security.hasPermission('Email Access', author): if author == anonid: raise Unauthorized, ''' | def handle_message(self, message): ''' message - a Message instance | d707f9bfdb46f60188adeb8fefab434f16a66f3d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/d707f9bfdb46f60188adeb8fefab434f16a66f3d/mailgw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2150,
12,
2890,
16,
883,
4672,
9163,
883,
300,
279,
2350,
791,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2150,
12,
2890,
16,
883,
4672,
9163,
883,
300,
279,
2350,
791,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
screen = fsm.something[0] screen.cursor_save_attrs() | screen = fsm.something[0] screen.cursor_save_attrs() | def DoCursorSave (fsm): screen = fsm.something[0] screen.cursor_save_attrs() | cfa572ed6a74538df062e539442271b2ff84abec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9386/cfa572ed6a74538df062e539442271b2ff84abec/ansi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
6688,
4755,
261,
2556,
81,
4672,
5518,
273,
26957,
18,
30289,
63,
20,
65,
5518,
18,
9216,
67,
5688,
67,
7039,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
6688,
4755,
261,
2556,
81,
4672,
5518,
273,
26957,
18,
30289,
63,
20,
65,
5518,
18,
9216,
67,
5688,
67,
7039,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self._shared_activity: self.connect('joined', self._joined_cb) self._shared_activity.connect('buddy-joined', self._buddy_joined_cb) self._shared_activity.connect('buddy-left', self._buddy_left_cb) if self.get_shared(): self._joined_cb() | self.connect('joined', self._joined_cb) | def __init__(self, handle): activity.Activity.__init__(self, handle) | dbc8c5f13d2b8e09cca0503a87da58c7acf16254 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6691/dbc8c5f13d2b8e09cca0503a87da58c7acf16254/poll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1640,
4672,
5728,
18,
6193,
16186,
2738,
972,
12,
2890,
16,
1640,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1640,
4672,
5728,
18,
6193,
16186,
2738,
972,
12,
2890,
16,
1640,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
other = self._convert_other(other) ans = self._check_nans(other, context) if ans: return ans | def __mul__(self, other, context=None): """Return self * other. | 323d0b30a64964b89a85e1b02e8fcc4017ce9fa7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/323d0b30a64964b89a85e1b02e8fcc4017ce9fa7/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
990,
365,
380,
1308,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
990,
365,
380,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
doc = Request(self, self.ws_prefix + '.getTags', self.api_key, params, True, self.secret).execute() | doc = _Request(self, self.ws_prefix + '.getTags', self.api_key, params, True, self.secret).execute() | def getTags(self): """Returns a list of the user-set tags to this object.""" params = self._getParams() doc = Request(self, self.ws_prefix + '.getTags', self.api_key, params, True, self.secret).execute() if not doc: return None tag_names = self._extract_all(doc, 'name') tags = [] for tag in tag_names: tags.append(Tag(tag, *self.auth_data)) return tags | 903c9b1622fe56617e5099f20abdc69f2090f8e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9926/903c9b1622fe56617e5099f20abdc69f2090f8e0/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17388,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
326,
729,
17,
542,
2342,
358,
333,
733,
12123,
225,
859,
273,
365,
6315,
588,
1370,
1435,
997,
273,
389,
691,
12,
2890,
16,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17388,
12,
2890,
4672,
3536,
1356,
279,
666,
434,
326,
729,
17,
542,
2342,
358,
333,
733,
12123,
225,
859,
273,
365,
6315,
588,
1370,
1435,
997,
273,
389,
691,
12,
2890,
16,
365,
18,
... |
self.assertEqual(result, inputdata) | self.assertEqual(result, [self.stampedrow,]) | def testWrite(self): 'Tests fileio.write() method.' | bc636e57612bcfa0da2d1cabdb5fb65dcc503873 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9837/bc636e57612bcfa0da2d1cabdb5fb65dcc503873/test-libra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3067,
12,
2890,
4672,
296,
14650,
585,
1594,
18,
2626,
1435,
707,
1093,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3067,
12,
2890,
4672,
296,
14650,
585,
1594,
18,
2626,
1435,
707,
1093,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.manager.classifier_data.message_db.store_msg(msg) | self.manager.classifier_data.message_db.store_msg(msgstore_message) | def OnClick(self, button, cancel): msgstore = self.manager.message_store msgstore_messages = self.explorer.GetSelectedMessages(True) if not msgstore_messages: return # If we are not yet enabled, tell the user. # (This is better than disabling the button as a) the user may not # understand why it is disabled, and b) as we would then need to check # the button state as the manager dialog closes. if not self.manager.config.filter.enabled: self.manager.ReportError( _("You must configure and enable SpamBayes before you " \ "can mark messages as not spam")) return SetWaitCursor(1) # Get the inbox as the default place to restore to # (incase we dont know (early code) or folder removed etc app = self.explorer.Application inbox_folder = msgstore.GetFolder( app.Session.GetDefaultFolder(constants.olFolderInbox)) new_msg_state = self.manager.config.general.recover_from_spam_message_state for msgstore_message in msgstore_messages: # Recover where they were moved from # During experimenting/playing/debugging, it is possible # that the source folder == dest folder - restore to # the inbox in this case. # (But more likely is that the original store may be read-only # so we were unable to record the initial folder, as we save it # *before* we do the move (and saving after is hard)) try: subject = msgstore_message.GetSubject() self.manager.classifier_data.message_db.load_msg(msgstore_message) restore_folder = msgstore_message.GetRememberedFolder() if restore_folder is None or \ msgstore_message.GetFolder() == restore_folder: print "Unable to determine source folder for message '%s' - restoring to Inbox" % (subject,) restore_folder = inbox_folder | ccfb175f884b2f5cb378ec21c0edb3433c9e0451 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/ccfb175f884b2f5cb378ec21c0edb3433c9e0451/addin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6563,
12,
2890,
16,
3568,
16,
3755,
4672,
1234,
2233,
273,
365,
18,
4181,
18,
2150,
67,
2233,
1234,
2233,
67,
6833,
273,
365,
18,
338,
11766,
18,
967,
7416,
5058,
12,
5510,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6563,
12,
2890,
16,
3568,
16,
3755,
4672,
1234,
2233,
273,
365,
18,
4181,
18,
2150,
67,
2233,
1234,
2233,
67,
6833,
273,
365,
18,
338,
11766,
18,
967,
7416,
5058,
12,
5510,
13,
... |
elif self.lineno is None: | elif self.lineno is None or arg == '.': | def do_list(self, arg): self.lastcmd = 'list' last = None if arg: try: x = eval(arg, {}, {}) if type(x) == type(()): first, last = x first = int(first) last = int(last) if last < first: # Assume it's a count last = first + last else: first = max(1, int(x) - 5) except: print('*** Error in argument:', repr(arg), file=self.stdout) return elif self.lineno is None: first = max(1, self.curframe.f_lineno - 5) else: first = self.lineno + 1 if last is None: last = first + 10 filename = self.curframe.f_code.co_filename breaklist = self.get_file_breaks(filename) try: for lineno in range(first, last+1): line = linecache.getline(filename, lineno, self.curframe.f_globals) if not line: print('[EOF]', file=self.stdout) break else: s = repr(lineno).rjust(3) if len(s) < 4: s = s + ' ' if lineno in breaklist: s = s + 'B' else: s = s + ' ' if lineno == self.curframe.f_lineno: s = s + '->' print(s + '\t' + line, end='', file=self.stdout) self.lineno = lineno except KeyboardInterrupt: pass | a91a94b7c054a01b26bc76a1f3ccaefc6395f077 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/a91a94b7c054a01b26bc76a1f3ccaefc6395f077/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1098,
12,
2890,
16,
1501,
4672,
365,
18,
2722,
4172,
273,
296,
1098,
11,
1142,
273,
599,
309,
1501,
30,
775,
30,
619,
273,
5302,
12,
3175,
16,
10615,
2618,
13,
309,
618,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1098,
12,
2890,
16,
1501,
4672,
365,
18,
2722,
4172,
273,
296,
1098,
11,
1142,
273,
599,
309,
1501,
30,
775,
30,
619,
273,
5302,
12,
3175,
16,
10615,
2618,
13,
309,
618,
12,... |
this = apply(_quickfix.new_MaturityDate, args) | this = _quickfix.new_MaturityDate(*args) | def __init__(self, *args): this = apply(_quickfix.new_MaturityDate, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
15947,
2336,
1626,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
15947,
2336,
1626,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
for letter in freq_info.keys(): freq_info[letter] = freq_info[letter] / total_count | if total_count == 0 : for letter in freq_info.keys(): assert freq_info[letter] == 0 else : for letter in freq_info.keys(): freq_info[letter] = freq_info[letter] / total_count | def _get_letter_freqs(self, residue_num, all_records, letters, to_ignore): """Determine the frequency of specific letters in the alignment. | 7a987bbfe5616cfbe91efc69918a09ab8b7b9679 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/7a987bbfe5616cfbe91efc69918a09ab8b7b9679/AlignInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
13449,
67,
10212,
87,
12,
2890,
16,
14765,
67,
2107,
16,
777,
67,
7094,
16,
13768,
16,
358,
67,
6185,
4672,
3536,
8519,
326,
8670,
434,
2923,
13768,
316,
326,
8710,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
13449,
67,
10212,
87,
12,
2890,
16,
14765,
67,
2107,
16,
777,
67,
7094,
16,
13768,
16,
358,
67,
6185,
4672,
3536,
8519,
326,
8670,
434,
2923,
13768,
316,
326,
8710,
18,
... |
if out.find("Output not yet Ready") != -1 : obj.runningJob.errors.append("Not yet Ready") | def getOutput( self, obj, outdir='' ): """ retrieve job output """ | db5bc68a73a296563e8769af888171214d3df710 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8886/db5bc68a73a296563e8769af888171214d3df710/SchedulerGLite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11062,
12,
365,
16,
1081,
16,
15398,
2218,
11,
262,
30,
3536,
4614,
1719,
876,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11062,
12,
365,
16,
1081,
16,
15398,
2218,
11,
262,
30,
3536,
4614,
1719,
876,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
print (phi,theta,psi) | def make_hdr(self): "Pack a NIFTI format header." # (un)rotation is handled like this: take the image as transformed with # 2 rotations, S, Rb (S is the xform from scanner space into the # data-ordering in the FID file, Rb is the xform applied by slicing # coronal-wise, sagital-wise, etc) # then I = Rb(psi)*Rb(theta)*Rb(phi)*S*I_real # The goal is to encode a quaternion which does this inverse: # R = R(-S)*R(-phi)*R(-theta)*R(-psi) # # the euler angles for inverting S have been determined to be # (phi=pi, theta=0, psi=-pi/2) # The euler angles for slicing rotations are from procpar # To avoid the chance of interpolation, these angles are "normalized" # to the closest multiple of pi/2 (ie 22 degrees->0, 49 degrees->90) | 0395d9b55ef60e733032416a11c6431e6c96a9c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7241/0395d9b55ef60e733032416a11c6431e6c96a9c2/nifti.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16587,
12,
2890,
4672,
315,
4420,
279,
423,
17925,
45,
740,
1446,
1199,
468,
261,
318,
13,
18807,
353,
7681,
3007,
333,
30,
4862,
326,
1316,
487,
10220,
598,
468,
576,
31157,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16587,
12,
2890,
4672,
315,
4420,
279,
423,
17925,
45,
740,
1446,
1199,
468,
261,
318,
13,
18807,
353,
7681,
3007,
333,
30,
4862,
326,
1316,
487,
10220,
598,
468,
576,
31157,
... | |
print pprint.pp.process(g.outputs[0]) | print pprint(g.outputs[0]) | def test_muldiv(self): x, y, z = matrices('xyz') a, b, c, d = matrices('abcd') | 8bac635aa52a9bd662a2bb534b37246d68e24b85 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12438/8bac635aa52a9bd662a2bb534b37246d68e24b85/test_opt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16411,
2892,
12,
2890,
4672,
619,
16,
677,
16,
998,
273,
16415,
2668,
17177,
6134,
279,
16,
324,
16,
276,
16,
302,
273,
16415,
2668,
378,
4315,
6134,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
16411,
2892,
12,
2890,
4672,
619,
16,
677,
16,
998,
273,
16415,
2668,
17177,
6134,
279,
16,
324,
16,
276,
16,
302,
273,
16415,
2668,
378,
4315,
6134,
2,
-100,
-100,
-100,
-10... |
key = encode_page(key) | if isinstance(key, unicode): key = encode_page(key) | def __setattr__(self, key, value): key = encode_page(key) self.__dict__[key] = value | 56d4bd00e29c4d0d242d0d73f0ee688019315e15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/56d4bd00e29c4d0d242d0d73f0ee688019315e15/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
498,
16,
460,
4672,
225,
309,
1549,
12,
856,
16,
5252,
4672,
498,
273,
2017,
67,
2433,
12,
856,
13,
365,
16186,
1576,
972,
63,
856,
65,
273,
460,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
498,
16,
460,
4672,
225,
309,
1549,
12,
856,
16,
5252,
4672,
498,
273,
2017,
67,
2433,
12,
856,
13,
365,
16186,
1576,
972,
63,
856,
65,
273,
460,
... |
prune_filenodes(fname, filerevlog) msng_filenode_lst = msng_filenode_set[fname].keys() | if msng_filenode_set.has_key(fname): prune_filenodes(fname, filerevlog) msng_filenode_lst = msng_filenode_set[fname].keys() else: msng_filenode_lst = [] | def gengroup(): # The set of changed files starts empty. changedfiles = {} # Create a changenode group generator that will call our functions # back to lookup the owning changenode and collect information. group = cl.group(msng_cl_lst, identity, manifest_and_file_collector(changedfiles)) for chnk in group: yield chnk | 832548130f1d3e93bef9c1c34bd0cfd71a3804cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/832548130f1d3e93bef9c1c34bd0cfd71a3804cd/localrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
1655,
13332,
468,
1021,
444,
434,
3550,
1390,
2542,
1008,
18,
3550,
2354,
273,
2618,
468,
1788,
279,
9435,
20680,
1041,
4456,
716,
903,
745,
3134,
4186,
468,
1473,
358,
3689,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
1655,
13332,
468,
1021,
444,
434,
3550,
1390,
2542,
1008,
18,
3550,
2354,
273,
2618,
468,
1788,
279,
9435,
20680,
1041,
4456,
716,
903,
745,
3134,
4186,
468,
1473,
358,
3689,
326,
... |
"""Retrieve the real component of this number. | """Retrieve the imaginary component of this number. | def imag(self): """Retrieve the real component of this number. | 5793e6f4b02b3c377906c639e5d5412f942837d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/5793e6f4b02b3c377906c639e5d5412f942837d4/numbers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8902,
12,
2890,
4672,
3536,
5767,
326,
2863,
1794,
434,
333,
1300,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8902,
12,
2890,
4672,
3536,
5767,
326,
2863,
1794,
434,
333,
1300,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
desc = _('Convert book %d of %d (%s)') % (i + 1, total, repr(mi.title)) | try: dtitle = unicode(mi.title) except: dtitle = repr(mi.title) desc = _('Convert book %d of %d (%s)') % (i + 1, total, dtitle) | def convert_single_ebook(parent, db, book_ids, auto_conversion=False, out_format=None): changed = False jobs = [] bad = [] total = len(book_ids) if total == 0: return None, None, None parent.status_bar.showMessage(_('Starting conversion of %d books') % total, 2000) for i, book_id in enumerate(book_ids): temp_files = [] try: d = SingleConfig(parent, db, book_id, None, out_format) if auto_conversion: d.accept() result = QDialog.Accepted else: result = d.exec_() if result == QDialog.Accepted: #if not convert_existing(parent, db, [book_id], d.output_format): # continue mi = db.get_metadata(book_id, True) in_file = db.format_abspath(book_id, d.input_format, True) out_file = PersistentTemporaryFile('.' + d.output_format) out_file.write(d.output_format) out_file.close() temp_files = [] desc = _('Convert book %d of %d (%s)') % (i + 1, total, repr(mi.title)) recs = cPickle.loads(d.recommendations) if d.opf_file is not None: recs.append(('read_metadata_from_opf', d.opf_file.name, OptionRecommendation.HIGH)) temp_files.append(d.opf_file) if d.cover_file is not None: recs.append(('cover', d.cover_file.name, OptionRecommendation.HIGH)) temp_files.append(d.cover_file) args = [in_file, out_file.name, recs] temp_files.append(out_file) jobs.append(('gui_convert', args, desc, d.output_format.upper(), book_id, temp_files)) changed = True except NoSupportedInputFormats: bad.append(book_id) if bad != []: res = [] for id in bad: title = db.title(id, True) res.append('%s'%title) msg = '%s' % '\n'.join(res) warning_dialog(parent, _('Could not convert some books'), _('Could not convert %d of %d books, because no suitable source' ' format was found.') % (len(res), total), msg).exec_() return jobs, changed, bad | f0d3fe56b48cfa2ef025c167c20c677b47ac98e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/f0d3fe56b48cfa2ef025c167c20c677b47ac98e4/tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
7526,
67,
73,
3618,
12,
2938,
16,
1319,
16,
6978,
67,
2232,
16,
3656,
67,
20990,
33,
8381,
16,
596,
67,
2139,
33,
7036,
4672,
3550,
273,
1083,
6550,
273,
5378,
5570,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
7526,
67,
73,
3618,
12,
2938,
16,
1319,
16,
6978,
67,
2232,
16,
3656,
67,
20990,
33,
8381,
16,
596,
67,
2139,
33,
7036,
4672,
3550,
273,
1083,
6550,
273,
5378,
5570,
273,
5... |
def make_proxy(global_conf, address, allowed_request_methods=""): | def make_proxy(global_conf, address, allowed_request_methods="", suppress_http_headers=""): | def make_proxy(global_conf, address, allowed_request_methods=""): """ Make a WSGI application that proxies to another address -- 'address' should be the full URL ending with a trailing / 'allowed_request_methods' is a space seperated list of request methods """ from paste.deploy.converters import aslist allowed_request_methods = aslist(allowed_request_methods) return Proxy(address, allowed_request_methods=allowed_request_methods) | e8e8c440bd9f31e7b8409229f28a70383b87e33c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/e8e8c440bd9f31e7b8409229f28a70383b87e33c/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
5656,
12,
6347,
67,
3923,
16,
1758,
16,
2935,
67,
2293,
67,
5163,
1546,
3113,
12257,
67,
2505,
67,
2485,
1546,
6,
4672,
3536,
4344,
279,
7649,
13797,
2521,
716,
13263,
358,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
5656,
12,
6347,
67,
3923,
16,
1758,
16,
2935,
67,
2293,
67,
5163,
1546,
3113,
12257,
67,
2505,
67,
2485,
1546,
6,
4672,
3536,
4344,
279,
7649,
13797,
2521,
716,
13263,
358,
4... |
print "Including extra troves to resolve dependencies" print " %s" % " ".join(suggMap.itervalues()) | print "Including extra troves to resolve dependencies:" print " ", for suggList in suggMap.itervalues(): print "%s" % (" ".join([x[0] for x in suggList])), print | def doUpdate(repos, cfg, pkgList, replaceFiles = False, tagScript = None, keepExisting = False, depCheck = True, recurse = True): client = conaryclient.ConaryClient(repos, cfg) applyList = [] if type(pkgList) is str: pkgList = ( pkgList, ) for pkgStr in pkgList: if os.path.exists(pkgStr) and os.path.isfile(pkgStr): try: cs = changeset.ChangeSetFromFile(pkgStr) except BadContainer, msg: log.error("'%s' is not a valid conary changset: %s" % (pkgStr, msg)) sys.exit(1) applyList.append(cs) elif pkgStr.find("=") >= 0: l = pkgStr.split("=") if len(l) != 2: log.error("too many ='s in %s", pkgStr) return 1 applyList.append((l[0], l[1])) else: applyList.append(pkgStr) try: (cs, depFailures, suggMap) = \ client.updateChangeSet(applyList, recurse = recurse, resolveDeps = depCheck, keepExisting = keepExisting) if depFailures: print "The following dependencies could not be resolved:" for (troveName, depSet) in depFailures: print " %s:\n\t%s" % \ (troveName, "\n\t".join(str(depSet).split("\n"))) return elif not cfg.autoResolve and suggMap: print "Additional troves are needed:" for (req, suggList) in suggMap.iteritems(): print " %s -> %s" % (req, " ".join([x[0] for x in suggList])) return elif suggMap: print "Including extra troves to resolve dependencies" print " %s" % " ".join(suggMap.itervalues()) client.applyUpdate(cs, replaceFiles, tagScript, keepExisting) except conaryclient.UpdateError, e: log.error(e) except repository.CommitError, e: log.error(e) | 88498ebca11f8092ae5ac30dda91836b2ad19ed2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/88498ebca11f8092ae5ac30dda91836b2ad19ed2/updatecmd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1891,
12,
15564,
16,
2776,
16,
3475,
682,
16,
1453,
2697,
273,
1083,
16,
1047,
3651,
273,
599,
16,
3455,
9895,
273,
1083,
16,
5993,
1564,
273,
1053,
16,
11502,
273,
1053,
4672,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1891,
12,
15564,
16,
2776,
16,
3475,
682,
16,
1453,
2697,
273,
1083,
16,
1047,
3651,
273,
599,
16,
3455,
9895,
273,
1083,
16,
5993,
1564,
273,
1053,
16,
11502,
273,
1053,
4672,
10... |
if os.path.split(tarinfo.name)[1] in ('desc','depends'): | fname = os.path.split(tarinfo.name)[1] if fname in dbfiles: | def parse_repo(repopath): """ Parses an Arch repo db file, and returns a list of Pkg objects. Arguments: repopath -- The path of a repository db file. """ logger.info("Starting repo parsing") if not os.path.exists(repopath): logger.error("Could not read file %s", repopath) logger.info("Reading repo tarfile %s", repopath) filename = os.path.split(repopath)[1] rindex = filename.rindex('.db.tar.gz') reponame = filename[:rindex] repodb = tarfile.open(repopath,"r:gz") ## assuming well formed tar, with dir first then files after ## repo-add enforces this logger.debug("Starting package parsing") pkgs = [] tpkg = None while True: tarinfo = repodb.next() if tarinfo == None or tarinfo.isdir(): if tpkg != None: tpkg.reset() data = parse_inf(tpkg) p = Pkg(data) p.repo = reponame logger.debug("Done parsing package %s", p.name) pkgs.append(p) if tarinfo == None: break # set new tpkg tpkg = StringIO() if tarinfo.isreg(): if os.path.split(tarinfo.name)[1] in ('desc','depends'): tpkg.write(repodb.extractfile(tarinfo).read()) tpkg.write('\n') # just in case repodb.close() logger.info("Finished repo parsing") return pkgs | 8eff04788d0c62af01848a22a91efe74b87380b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11256/8eff04788d0c62af01848a22a91efe74b87380b2/reporead.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
7422,
12,
266,
5120,
421,
4672,
3536,
2280,
2420,
392,
16959,
3538,
1319,
585,
16,
471,
1135,
279,
666,
434,
453,
14931,
2184,
18,
225,
13599,
30,
2071,
556,
421,
1493,
1021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
7422,
12,
266,
5120,
421,
4672,
3536,
2280,
2420,
392,
16959,
3538,
1319,
585,
16,
471,
1135,
279,
666,
434,
453,
14931,
2184,
18,
225,
13599,
30,
2071,
556,
421,
1493,
1021,
... |
if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) ) | exts.append( Extension('resource', ['resource.c']) ) | def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.insert(0, '/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.insert(0, '/usr/local/include' ) | 821415e27911f631fc5df823beeced92b282c74f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/821415e27911f631fc5df823beeced92b282c74f/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
309,
1173,
13640,
19,
3729,
19,
2941,
11,
486,
316,
365,
18,
9576,
18,
12083,
67,
8291,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
309,
1173,
13640,
19,
3729,
19,
2941,
11,
486,
316,
365,
18,
9576,
18,
12083,
67,
8291,
30,
365,
... |
self._mac1, self._mac2, self._ip1, self._ip2 = None, None, None, None | self._mac1, self._mac2 = None, None self._ip1, self._ip2 = None, None self.linktype = None | def __init__(self, dev1, dev2=None, bpf_filter=None, \ skip_forwarded=True, unoffensive=False, capmethod=0): BaseAuditContext.__init__(self, dev1, dev2, bpf_filter, capmethod) | 5c13d0d057581caab1db6e48b06519b077c2311b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11468/5c13d0d057581caab1db6e48b06519b077c2311b/audit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4461,
21,
16,
4461,
22,
33,
7036,
16,
9107,
74,
67,
2188,
33,
7036,
16,
521,
2488,
67,
1884,
11804,
33,
5510,
16,
640,
3674,
14315,
33,
8381,
16,
3523,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4461,
21,
16,
4461,
22,
33,
7036,
16,
9107,
74,
67,
2188,
33,
7036,
16,
521,
2488,
67,
1884,
11804,
33,
5510,
16,
640,
3674,
14315,
33,
8381,
16,
3523,... |
self.assertEqual(-(0x7fffffff), -2147483647) | if platform_long_is_32_bits: self.assertEqual(-(0x7fffffff), -2147483647) else: self.assertEqual(-(0x7fffffffffffffff), -9223372036854775807) | def test_hex_baseline(self): # Baseline tests self.assertEqual(0x0, 0) self.assertEqual(0x10, 16) self.assertEqual(0x7fffffff, 2147483647) # Ditto with a minus sign and parentheses self.assertEqual(-(0x0), 0) self.assertEqual(-(0x10), -16) self.assertEqual(-(0x7fffffff), -2147483647) # Ditto with a minus sign and NO parentheses self.assertEqual(-0x0, 0) self.assertEqual(-0x10, -16) self.assertEqual(-0x7fffffff, -2147483647) | 9f9d6e6c1d506067db8a1309e91d568018bef591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/9f9d6e6c1d506067db8a1309e91d568018bef591/test_hexoct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7118,
67,
27818,
12,
2890,
4672,
468,
605,
345,
3027,
7434,
365,
18,
11231,
5812,
12,
20,
92,
20,
16,
374,
13,
365,
18,
11231,
5812,
12,
20,
92,
2163,
16,
2872,
13,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7118,
67,
27818,
12,
2890,
4672,
468,
605,
345,
3027,
7434,
365,
18,
11231,
5812,
12,
20,
92,
20,
16,
374,
13,
365,
18,
11231,
5812,
12,
20,
92,
2163,
16,
2872,
13,
365,
... |
self.s.append(r - r_old) self.y.append(-(f - f_old)) self.rho.append(1 / np.vdot(self.y[ITR],self.s[ITR])) | stemp = r - r_old ytemp = -(f - f_old) if (ytemp * stemp < 0.0).any(): ytemp = np.zeros_like(ytemp) stemp = np.zeros_like(stemp) rhotemp = 0.0 else: rhotemp = 1 / np.vdot(ytemp , stemp) self.s.append(stemp) self.y.append(ytemp) self.rho.append(rhotemp) | def update(self, r, f, r_old, f_old): a = np.zeros(self.memory + 1, 'd') self.tmp = self.atoms if not self.ITR: self.ITR = 1 self.s = [1.] # The 0'th element is not actually used # The point is to use 1-indexation self.y = [1.] self.rho = [1.] else: a1 = abs (np.vdot(f, f_old)) a2 = np.vdot(f_old, f_old) reset_flag = self.check_for_reset(a1, a2) if not reset_flag: ITR = self.ITR if(ITR > self.memory): self.s.pop(1) self.y.pop(1) self.rho.pop(1) ITR = self.memory self.s.append(r - r_old) self.y.append(-(f - f_old)) self.rho.append(1 / np.vdot(self.y[ITR],self.s[ITR])) self.ITR += 1 else: self.ITR = 1 self.s = [1.] self.y = [1.] self.rho = [1.] self.dump((self.ITR, self.s, self.y, self.rho, r_old, f_old)) r_old = r.copy() f_old = f.copy() if self.ITR <= self.memory: BOUND = self.ITR else: BOUND = self.memory q = -1.0 * f for j in range(1,BOUND): k = (BOUND - j) a[k] = self.rho[k] * np.vdot(self.s[k], q) q -= a[k] * self.y[k] d = (np.dot(q.reshape(-1), self.Ho)).reshape(-1,3) #d = self.Ho * q for j in range(1,BOUND): B = self.rho[j] * np.vdot(self.y[j], d) d = d + self.s[j] * (a[j] - B) self.d = -1.0 * d | bc3efb9267548f28c85bf11e1c0f7d7bcda39eea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/bc3efb9267548f28c85bf11e1c0f7d7bcda39eea/lbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
436,
16,
284,
16,
436,
67,
1673,
16,
284,
67,
1673,
4672,
279,
273,
1130,
18,
22008,
12,
2890,
18,
7858,
397,
404,
16,
296,
72,
6134,
365,
18,
5645,
273,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
436,
16,
284,
16,
436,
67,
1673,
16,
284,
67,
1673,
4672,
279,
273,
1130,
18,
22008,
12,
2890,
18,
7858,
397,
404,
16,
296,
72,
6134,
365,
18,
5645,
273,
365,
1... |
print "Dumped invalid XML to sax_parse_bug.dat" | print >>sys.stderr, "Dumped invalid XML to sax_parse_bug.dat" | def run(self): dt=15 while 1: try: data = self.getData() except socket.error: # Print the traceback of the caught exception print ''.join(traceback.format_exception(*sys.exc_info())) output(u'DBG> got socket error in GetAll.run. Sleeping for %d seconds'%dt) time.sleep(dt) dt *= 2 else: break handler = WikimediaXmlHandler() handler.setCallback(self.oneDone) try: xml.sax.parseString(data, handler) except xml.sax._exceptions.SAXParseException: f=open('sax_parse_bug.dat','w') f.write(data) f.close() print "Dumped invalid XML to sax_parse_bug.dat" raise # All of the ones that have not been found apparently do not exist for pl in self.pages: if not hasattr(pl,'_contents') and not hasattr(pl,'_getexception'): if self.site.lang == 'eo': if pl.hashfreeLinkname() != pl.hashfreeLinkname(doublex = True): # Maybe we have used x-convention when we should not? try: pl.get(force = True) except NoPage: pass except IsRedirectPage,arg: pass except LockedPage: pass except SectionError: pass else: pl._getexception = NoPage else: pl._getexception = NoPage if hasattr(pl,'_contents') and pl.site().lang=="eo": # Edit-pages on eo: use X-convention, XML export does not. # Double X-es where necessary so that we can submit a changed # page later. for c in 'C','G','H','J','S','U': for c2 in c,c.lower(): for x in 'X','x': pl._contents = pl._contents.replace(c2+x,c2+x+x) | 8d387c54be5bbb6cc9194b41b1629ac1de056332 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/8d387c54be5bbb6cc9194b41b1629ac1de056332/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3681,
33,
3600,
1323,
404,
30,
775,
30,
501,
273,
365,
18,
588,
751,
1435,
1335,
2987,
18,
1636,
30,
468,
3038,
326,
10820,
434,
326,
13537,
1520,
1172,
875,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3681,
33,
3600,
1323,
404,
30,
775,
30,
501,
273,
365,
18,
588,
751,
1435,
1335,
2987,
18,
1636,
30,
468,
3038,
326,
10820,
434,
326,
13537,
1520,
1172,
875,
18,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.