rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
for k in sorted(registry._module_key_map.itervalues()): descriptor = registry.descriptors[k] combo.addItem(descriptor.name, QtCore.QVariant(descriptor.sigstring))
for k, descriptor in sorted(registry.descriptors.iteritems()): if not descriptor.module_abstract(): combo.addItem("%s (%s)" % (k[1], k[0]), QtCore.QVariant(descriptor.sigstring))
def createEditor(self, parent, option, index): registry = get_module_registry() if index.column()==1: #Port type combo = QtGui.QComboBox(parent) combo.setEditable(False) # FIXME just use descriptors here!! for k in sorted(registry._module_key_map.itervalues()): descriptor = registry.descriptors[k] combo.addItem(descriptor.name, QtCore.QVariant(descriptor.sigstring)) return combo else: return QtGui.QItemDelegate.createEditor(self, parent, option, index)
6b68013812c03494141a83848a752c85adbb438f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6341/6b68013812c03494141a83848a752c85adbb438f/tuple_configuration.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 6946, 12, 2890, 16, 982, 16, 1456, 16, 770, 4672, 4023, 273, 336, 67, 2978, 67, 9893, 1435, 309, 770, 18, 2827, 1435, 631, 21, 30, 468, 2617, 618, 16778, 273, 23425, 18, 53, 221...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 6946, 12, 2890, 16, 982, 16, 1456, 16, 770, 4672, 4023, 273, 336, 67, 2978, 67, 9893, 1435, 309, 770, 18, 2827, 1435, 631, 21, 30, 468, 2617, 618, 16778, 273, 23425, 18, 53, 221...
xml_glob = triggerList[0]
def readTriggerFiles(self,cp,opts): if not self.cache or self.triggerTag == "": xml_glob = string.strip(cp.get('followup-triggers','xml-glob')) triggerList = glob.glob(xml_glob) else: triggerCache = self.filesMatchingGPSinCache(None,self.triggerTag) triggerList = self.getListFromCache(triggerCache) xml_glob = triggerList[0]
2b6b935e59ed05e1e6dc17ea3ebff4d8c7a7542c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/2b6b935e59ed05e1e6dc17ea3ebff4d8c7a7542c/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 6518, 2697, 12, 2890, 16, 4057, 16, 4952, 4672, 225, 309, 486, 365, 18, 2493, 578, 365, 18, 10668, 1805, 422, 1408, 30, 2025, 67, 10581, 273, 533, 18, 6406, 12, 4057, 18, 588, 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, 855, 6518, 2697, 12, 2890, 16, 4057, 16, 4952, 4672, 225, 309, 486, 365, 18, 2493, 578, 365, 18, 10668, 1805, 422, 1408, 30, 2025, 67, 10581, 273, 533, 18, 6406, 12, 4057, 18, 588, 2...
if role==ROLE_SERVER:
if role==ROLE_SERVER and not trainingMode:
def startGame(): taskMgr.add(moveKickerTask, "gameTask"); if role==ROLE_SERVER: taskMgr.add(pingTask, "pingTask"); # not needed, currently. enable to determine rtt (deltatime)
304e263a4040069059a78e2746eab32fa368c72b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12834/304e263a4040069059a78e2746eab32fa368c72b/kickern.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12496, 13332, 1562, 9455, 18, 1289, 12, 8501, 47, 5448, 2174, 16, 315, 13957, 2174, 8863, 309, 2478, 631, 16256, 67, 4370, 471, 486, 8277, 2309, 30, 1562, 9455, 18, 1289, 12, 1382, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 787, 12496, 13332, 1562, 9455, 18, 1289, 12, 8501, 47, 5448, 2174, 16, 315, 13957, 2174, 8863, 309, 2478, 631, 16256, 67, 4370, 471, 486, 8277, 2309, 30, 1562, 9455, 18, 1289, 12, 1382, ...
cmd = "/bin/mount -t ext3 " + parts[0]
cmd = "mount -t ext3 " + parts[0]
def mount(self): try: fstab = open("/etc/fstab") except IOError: return -1
a35c57a736086abaef5a82e2e117a12e3a79b273 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6652/a35c57a736086abaef5a82e2e117a12e3a79b273/Harddisk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5344, 12, 2890, 4672, 775, 30, 20223, 378, 273, 1696, 2932, 19, 14175, 19, 74, 334, 378, 7923, 1335, 8340, 30, 327, 300, 21, 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, 5344, 12, 2890, 4672, 775, 30, 20223, 378, 273, 1696, 2932, 19, 14175, 19, 74, 334, 378, 7923, 1335, 8340, 30, 327, 300, 21, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
def command_help(self, args):
def command_help(self, arg):
def command_help(self, args): """ /help <command_name> """ room = self.current_room() if len(args) == 0: msg = _('Available commands are: ') for command in self.commands.keys(): msg += "%s " % command msg += _("\nType /help <command_name> to know what each command does") if len(args) == 1: if args[0] in self.commands.keys(): msg = self.commands[args[0]][1] else: msg = _('Unknown command: %s') % args[0] self.add_message_to_room(room, msg)
1c7377804051166c26f33457378524d192077c66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9814/1c7377804051166c26f33457378524d192077c66/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 67, 5201, 12, 2890, 16, 1501, 4672, 3536, 342, 5201, 411, 3076, 67, 529, 34, 3536, 7725, 273, 365, 18, 2972, 67, 13924, 1435, 309, 562, 12, 1968, 13, 422, 374, 30, 1234, 273, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1296, 67, 5201, 12, 2890, 16, 1501, 4672, 3536, 342, 5201, 411, 3076, 67, 529, 34, 3536, 7725, 273, 365, 18, 2972, 67, 13924, 1435, 309, 562, 12, 1968, 13, 422, 374, 30, 1234, 273, 3...
classes = node.get('classes', ['Unknown', ]) for cls in classes: self.body.append( '\\docutilsrole%s{' % cls) self.context.append('}'*len(classes))
self.latex_fallbacks['inline'] = latex_headings['DUspan'] classes = node.get('classes', []) self.body.append(r'\DUspan{%s}{' %','.join(classes))
def visit_inline(self, node): # titlereference classes = node.get('classes', ['Unknown', ]) for cls in classes: self.body.append( '\\docutilsrole%s{' % cls) self.context.append('}'*len(classes))
ed0abdb5db877dcbb02815b3989607b66d92de4c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1532/ed0abdb5db877dcbb02815b3989607b66d92de4c/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 67, 10047, 12, 2890, 16, 756, 4672, 468, 268, 305, 749, 73, 1134, 3318, 273, 756, 18, 588, 2668, 4701, 2187, 10228, 4874, 2187, 308, 13, 364, 2028, 316, 3318, 30, 365, 18, 3432, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3757, 67, 10047, 12, 2890, 16, 756, 4672, 468, 268, 305, 749, 73, 1134, 3318, 273, 756, 18, 588, 2668, 4701, 2187, 10228, 4874, 2187, 308, 13, 364, 2028, 316, 3318, 30, 365, 18, 3432, ...
core_state["filename"] = core_state["history"][-1]
filename = core_state["history"][-1]
def hyltMain (meta_screen, starting_filename): curses.curs_set(0)
dbabc7ec51ba32db10e46ac6dc0054947f6fdccc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2254/dbabc7ec51ba32db10e46ac6dc0054947f6fdccc/hylt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4855, 5618, 6376, 261, 3901, 67, 9252, 16, 5023, 67, 3459, 4672, 225, 30436, 18, 2789, 67, 542, 12, 20, 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, 4855, 5618, 6376, 261, 3901, 67, 9252, 16, 5023, 67, 3459, 4672, 225, 30436, 18, 2789, 67, 542, 12, 20, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
l = W[k]
li = W[k]
def search_tree(G, Pi, lab=True, dig=False, dict=False, proof=False, verbosity=0): """ Assumes that the vertex set of G is {0,1,...,n-1} for some n. Note that this conflicts with the SymmetricGroup we are using to represent automorphisms. The solution is to let the group act on the set {1,2,...,n}, under the assumption n = 0. INPUT: lab -- if True, return the canonical label in addition to the auto- morphism group. dig -- if True, does not use Lemma 2.25 in [1], and the algorithm is valid for digraphs and graphs with loops. dict -- if True, explain which vertices are which elements of the set {1,2,...,n} in the representation of the automorphism group. proof -- if True, return the automorphism between G and its canonical label. Forces lab=True. STATE DIAGRAM: sage: SD = DiGraph( { 1:[18,2], 2:[5,3], 3:[4,6], 4:[7,2], 5:[4], 6:[13,12], 7:[18,8,10], 8:[6,9,10], 9:[6], 10:[11,13], 11:[12], 12:[13], 13:[17,14], 14:[16,15], 15:[2], 16:[13], 17:[15,13], 18:[13] } ) sage: SD.set_arc_label(1, 18, 'discrete') sage: SD.set_arc_label(4, 7, 'discrete') sage: SD.set_arc_label(2, 5, 'h = 0') sage: SD.set_arc_label(7, 18, 'h = 0') sage: SD.set_arc_label(7, 10, 'aut') sage: SD.set_arc_label(8, 10, 'aut') sage: SD.set_arc_label(8, 9, 'label') sage: SD.set_arc_label(8, 6, 'no label') sage: SD.set_arc_label(13, 17, 'k > h') sage: SD.set_arc_label(13, 14, 'k = h') sage: SD.set_arc_label(17, 15, 'v_k finite') sage: SD.set_arc_label(14, 15, 'v_k m.c.r.') sage: posn = {1:[ 3,-3], 2:[0,2], 3:[0, 13], 4:[3,9], 5:[3,3], 6:[16, 13], 7:[6,1], 8:[6,6], 9:[6,11], 10:[9,1], 11:[10,6], 12:[13,6], 13:[16,2], 14:[10,-6], 15:[0,-10], 16:[14,-6], 17:[16,-10], 18:[6,-4]} sage: SD.plot(pos=posn, node_size=400, color_dict={'#FFFFFF':range(1,19)}, edge_labels=True).save('search_tree.png') EXAMPLES: sage: from sage.groups.perm_gps.permgroup import PermutationGroup sage: import sage.graphs.graph_isom sage: from sage.graphs.graph_isom import search_tree, perm_group_elt sage: from sage.graphs.graph import enum sage: G = graphs.DodecahedralGraph() sage: Pi=[range(20)] sage: a,b = search_tree(G, Pi) sage: print a, enum(b) [[0, 19, 3, 2, 6, 5, 4, 17, 18, 11, 10, 9, 13, 12, 16, 15, 14, 7, 8, 1], [0, 1, 8, 9, 13, 14, 7, 6, 2, 3, 19, 18, 17, 4, 5, 15, 16, 12, 11, 10], [0, 19, 18, 11, 12, 16, 17, 4, 3, 2, 1, 8, 7, 6, 5, 15, 14, 13, 9, 10], [1, 8, 9, 10, 11, 12, 13, 14, 7, 6, 2, 3, 4, 5, 15, 16, 17, 18, 19, 0]] 17318942212009113839976787462421724338461987195898671092180383421848885858584973127639899792828728124797968735273000 sage: c = search_tree(G, Pi, lab=False) sage: print c [[0, 19, 3, 2, 6, 5, 4, 17, 18, 11, 10, 9, 13, 12, 16, 15, 14, 7, 8, 1], [0, 1, 8, 9, 13, 14, 7, 6, 2, 3, 19, 18, 17, 4, 5, 15, 16, 12, 11, 10], [0, 19, 18, 11, 12, 16, 17, 4, 3, 2, 1, 8, 7, 6, 5, 15, 14, 13, 9, 10], [1, 8, 9, 10, 11, 12, 13, 14, 7, 6, 2, 3, 4, 5, 15, 16, 17, 18, 19, 0]] sage: DodecAut = PermutationGroup([perm_group_elt(aa) for aa in a]) sage: DodecAut.character_table() [ 1 1 1 1 1 1 1 1 1 1] [ 1 -1 1 1 -1 1 -1 1 -1 -1] [ 3 -1 0 -1 zeta5^3 + zeta5^2 + 1 -zeta5^3 - zeta5^2 0 zeta5^3 + zeta5^2 + 1 -zeta5^3 - zeta5^2 3] [ 3 -1 0 -1 -zeta5^3 - zeta5^2 zeta5^3 + zeta5^2 + 1 0 -zeta5^3 - zeta5^2 zeta5^3 + zeta5^2 + 1 3] [ 3 1 0 -1 -zeta5^3 - zeta5^2 - 1 -zeta5^3 - zeta5^2 0 zeta5^3 + zeta5^2 + 1 zeta5^3 + zeta5^2 -3] [ 3 1 0 -1 zeta5^3 + zeta5^2 zeta5^3 + zeta5^2 + 1 0 -zeta5^3 - zeta5^2 -zeta5^3 - zeta5^2 - 1 -3] [ 4 0 1 0 -1 -1 1 -1 -1 4] [ 4 0 1 0 1 -1 -1 -1 1 -4] [ 5 1 -1 1 0 0 -1 0 0 5] [ 5 -1 -1 1 0 0 1 0 0 -5] sage: DodecAut2 = PermutationGroup([perm_group_elt(cc) for cc in c]) sage: DodecAut2.character_table() [ 1 1 1 1 1 1 1 1 1 1] [ 1 -1 1 1 -1 1 -1 1 -1 -1] [ 3 -1 0 -1 zeta5^3 + zeta5^2 + 1 -zeta5^3 - zeta5^2 0 zeta5^3 + zeta5^2 + 1 -zeta5^3 - zeta5^2 3] [ 3 -1 0 -1 -zeta5^3 - zeta5^2 zeta5^3 + zeta5^2 + 1 0 -zeta5^3 - zeta5^2 zeta5^3 + zeta5^2 + 1 3] [ 3 1 0 -1 -zeta5^3 - zeta5^2 - 1 -zeta5^3 - zeta5^2 0 zeta5^3 + zeta5^2 + 1 zeta5^3 + zeta5^2 -3] [ 3 1 0 -1 zeta5^3 + zeta5^2 zeta5^3 + zeta5^2 + 1 0 -zeta5^3 - zeta5^2 -zeta5^3 - zeta5^2 - 1 -3] [ 4 0 1 0 -1 -1 1 -1 -1 4] [ 4 0 1 0 1 -1 -1 -1 1 -4] [ 5 1 -1 1 0 0 -1 0 0 5] [ 5 -1 -1 1 0 0 1 0 0 -5] sage: G = graphs.PetersenGraph() sage: Pi=[range(10)] sage: a,b = search_tree(G, Pi) sage: print a, enum(b) [[0, 1, 2, 7, 5, 4, 6, 3, 9, 8], [0, 1, 6, 8, 5, 4, 2, 9, 3, 7], [0, 4, 3, 8, 5, 1, 9, 2, 6, 7], [1, 0, 4, 9, 6, 2, 5, 3, 7, 8]] 8716441511243809436161868448 sage: c = search_tree(G, Pi, lab=False) sage: PAut = PermutationGroup([perm_group_elt(aa) for aa in a]) sage: PAut.character_table() [ 1 1 1 1 1 1 1] [ 1 -1 1 -1 1 -1 1] [ 4 -2 0 1 1 0 -1] [ 4 2 0 -1 1 0 -1] [ 5 1 1 1 -1 -1 0] [ 5 -1 1 -1 -1 1 0] [ 6 0 -2 0 0 0 1] sage: PAut = PermutationGroup([perm_group_elt(cc) for cc in c]) sage: PAut.character_table() [ 1 1 1 1 1 1 1] [ 1 -1 1 -1 1 -1 1] [ 4 -2 0 1 1 0 -1] [ 4 2 0 -1 1 0 -1] [ 5 1 1 1 -1 -1 0] [ 5 -1 1 -1 -1 1 0] [ 6 0 -2 0 0 0 1] sage: G = graphs.CubeGraph(3) sage: Pi = [] sage: for i in range(8): ... b = Integer(i).binary() ... Pi.append(b.zfill(3)) ... sage: Pi = [Pi] sage: a,b = search_tree(G, Pi) sage: print a, enum(b) [[0, 3, 2, 1, 6, 5, 4, 7], [0, 1, 4, 5, 2, 3, 6, 7], [0, 3, 6, 5, 2, 1, 4, 7], [1, 0, 3, 2, 5, 4, 7, 6]] 520239721777506480 sage: c = search_tree(G, Pi, lab=False) sage: PermutationGroup([perm_group_elt(aa) for aa in a]).order() 48 sage: PermutationGroup([perm_group_elt(cc) for cc in c]).order() 48 sage: DodecAut.order() 120 sage: PAut.order() 120 sage: D = graphs.DodecahedralGraph() sage: a,b,c = search_tree(D, [range(20)], proof=True) sage: from sage.plot.plot import GraphicsArray sage: import networkx sage: position_D = networkx.spring_layout(D._nxg) sage: position_b = {} sage: for vert in position_D: ... position_b[c[vert]] = position_D[vert] sage.: GraphicsArray([D.plot(pos=position_D), b.plot(pos=position_b)]).show() sage: c {0: 0, 1: 19, 2: 16, 3: 15, 4: 9, 5: 1, 6: 10, 7: 8, 8: 14, 9: 12, 10: 17, 11: 11, 12: 5, 13: 6, 14: 2, 15: 4, 16: 3, 17: 7, 18: 13, 19: 18} BENCHMARKS: The following examples are given to check modifications to the algorithm for optimization-- use sage -t -long to check all the cases. sage: G = Graph({0:[]}) sage: Pi = [[0]] sage: a,b = search_tree(G, Pi) sage: print a, enum(b) [] 0 sage: a,b = search_tree(G, Pi, dig=True) sage: print a, enum(b) [] 0 sage: search_tree(G, Pi, lab=False) [] sage: from sage.graphs.graph_isom import all_labeled_graphs, all_ordered_partitions sage: graph2 = all_labeled_graphs(2) sage: part2 = all_ordered_partitions(range(2)) sage: for G in graph2: ... for Pi in part2: ... a,b = search_tree(G, Pi) ... c,d = search_tree(G, Pi, dig=True) ... e = search_tree(G, Pi, lab=False) ... a = str(a); b = str(enum(b)); c = str(c); d = str(enum(d)); e = str(e) ... print a.ljust(15), b.ljust(5), c.ljust(15), d.ljust(5), e.ljust(15) [] 0 [] 0 [] [] 0 [] 0 [] [[1, 0]] 0 [[1, 0]] 0 [[1, 0]] [[1, 0]] 0 [[1, 0]] 0 [[1, 0]] [] 6 [] 6 [] [] 6 [] 6 [] [[1, 0]] 6 [[1, 0]] 6 [[1, 0]] [[1, 0]] 6 [[1, 0]] 6 [[1, 0]] sage: graph3 = all_labeled_graphs(3) sage: part3 = all_ordered_partitions(range(3)) sage: for G in graph3: # long time (~30 secs) ... for Pi in part3: ... a,b = search_tree(G, Pi) ... c,d = search_tree(G, Pi, dig=True) ... e = search_tree(G, Pi, lab=False) ... a = str(a); b = str(enum(b)); c = str(c); d = str(enum(d)); e = str(e) ... print a.ljust(15), b.ljust(5), c.ljust(15), d.ljust(5), e.ljust(15) [] 0 [] 0 [] [] 0 [] 0 [] [[0, 2, 1]] 0 [[0, 2, 1]] 0 [[0, 2, 1]] [[0, 2, 1]] 0 [[0, 2, 1]] 0 [[0, 2, 1]] [] 0 [] 0 [] [] 0 [] 0 [] [[2, 1, 0]] 0 [[2, 1, 0]] 0 [[2, 1, 0]] [[2, 1, 0]] 0 [[2, 1, 0]] 0 [[2, 1, 0]] [] 0 [] 0 [] [] 0 [] 0 [] [[1, 0, 2]] 0 [[1, 0, 2]] 0 [[1, 0, 2]] [[1, 0, 2]] 0 [[1, 0, 2]] 0 [[1, 0, 2]] [[1, 0, 2]] 0 [[1, 0, 2]] 0 [[1, 0, 2]] [[2, 1, 0]] 0 [[2, 1, 0]] 0 [[2, 1, 0]] [[1, 0, 2]] 0 [[1, 0, 2]] 0 [[1, 0, 2]] [[0, 2, 1]] 0 [[0, 2, 1]] 0 [[0, 2, 1]] [[2, 1, 0]] 0 [[2, 1, 0]] 0 [[2, 1, 0]] [[0, 2, 1]] 0 [[0, 2, 1]] 0 [[0, 2, 1]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] 0 [[0, 2, 1], [1, 0, 2]] [] 10 [] 10 [] [] 10 [] 10 [] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [] 68 [] 68 [] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 10 [] 10 [] [] 10 [] 10 [] [] 10 [] 10 [] [[0, 2, 1]] 160 [[0, 2, 1]] 160 [[0, 2, 1]] [] 10 [] 10 [] [[0, 2, 1]] 160 [[0, 2, 1]] 160 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [[0, 2, 1]] 10 [[0, 2, 1]] 10 [[0, 2, 1]] [] 68 [] 68 [] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 10 [] 10 [] [] 10 [] 10 [] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 10 [] 10 [] [[2, 1, 0]] 160 [[2, 1, 0]] 160 [[2, 1, 0]] [] 10 [] 10 [] [] 10 [] 10 [] [[2, 1, 0]] 160 [[2, 1, 0]] 160 [[2, 1, 0]] [] 10 [] 10 [] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [[2, 1, 0]] 10 [[2, 1, 0]] 10 [[2, 1, 0]] [] 78 [] 78 [] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 228 [] 228 [] [] 228 [] 228 [] [[1, 0, 2]] 228 [[1, 0, 2]] 228 [[1, 0, 2]] [[1, 0, 2]] 228 [[1, 0, 2]] 228 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [] 170 [] 170 [] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [] 170 [] 170 [] [] 170 [] 170 [] [] 170 [] 170 [] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [[1, 0, 2]] 78 [[1, 0, 2]] 78 [[1, 0, 2]] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 160 [] 160 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 68 [] 68 [] [] 10 [] 10 [] [] 10 [] 10 [] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 160 [[1, 0, 2]] 160 [[1, 0, 2]] [] 10 [] 10 [] [[1, 0, 2]] 160 [[1, 0, 2]] 160 [[1, 0, 2]] [] 10 [] 10 [] [] 10 [] 10 [] [] 10 [] 10 [] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [[1, 0, 2]] 10 [[1, 0, 2]] 10 [[1, 0, 2]] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 228 [] 228 [] [] 228 [] 228 [] [[2, 1, 0]] 228 [[2, 1, 0]] 228 [[2, 1, 0]] [[2, 1, 0]] 228 [[2, 1, 0]] 228 [[2, 1, 0]] [] 78 [] 78 [] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 170 [] 170 [] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [] 170 [] 170 [] [] 170 [] 170 [] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [] 170 [] 170 [] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [[2, 1, 0]] 78 [[2, 1, 0]] 78 [[2, 1, 0]] [] 228 [] 228 [] [] 228 [] 228 [] [[0, 2, 1]] 228 [[0, 2, 1]] 228 [[0, 2, 1]] [[0, 2, 1]] 228 [[0, 2, 1]] 228 [[0, 2, 1]] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 170 [] 170 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 78 [] 78 [] [] 170 [] 170 [] [] 170 [] 170 [] [] 170 [] 170 [] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [] 170 [] 170 [] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [[0, 2, 1]] 78 [[0, 2, 1]] 78 [[0, 2, 1]] [] 238 [] 238 [] [] 238 [] 238 [] [[0, 2, 1]] 238 [[0, 2, 1]] 238 [[0, 2, 1]] [[0, 2, 1]] 238 [[0, 2, 1]] 238 [[0, 2, 1]] [] 238 [] 238 [] [] 238 [] 238 [] [[2, 1, 0]] 238 [[2, 1, 0]] 238 [[2, 1, 0]] [[2, 1, 0]] 238 [[2, 1, 0]] 238 [[2, 1, 0]] [] 238 [] 238 [] [] 238 [] 238 [] [[1, 0, 2]] 238 [[1, 0, 2]] 238 [[1, 0, 2]] [[1, 0, 2]] 238 [[1, 0, 2]] 238 [[1, 0, 2]] [[1, 0, 2]] 238 [[1, 0, 2]] 238 [[1, 0, 2]] [[2, 1, 0]] 238 [[2, 1, 0]] 238 [[2, 1, 0]] [[1, 0, 2]] 238 [[1, 0, 2]] 238 [[1, 0, 2]] [[0, 2, 1]] 238 [[0, 2, 1]] 238 [[0, 2, 1]] [[2, 1, 0]] 238 [[2, 1, 0]] 238 [[2, 1, 0]] [[0, 2, 1]] 238 [[0, 2, 1]] 238 [[0, 2, 1]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] 238 [[0, 2, 1], [1, 0, 2]] sage: C = graphs.CubeGraph(1) sage: gens = search_tree(C, [C.vertices()], lab=False) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() 2 sage: C = graphs.CubeGraph(2) sage: gens = search_tree(C, [C.vertices()], lab=False) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() 8 sage: C = graphs.CubeGraph(3) sage: gens = search_tree(C, [C.vertices()], lab=False) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() 48 sage: C = graphs.CubeGraph(4) sage: gens = search_tree(C, [C.vertices()], lab=False) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() 384 sage: C = graphs.CubeGraph(5) sage: gens = search_tree(C, [C.vertices()], lab=False) # long time (~8 secs) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() # long time 3840 sage: C = graphs.CubeGraph(6) sage: gens = search_tree(C, [C.vertices()], lab=False) # long time (~50 secs) sage: PermutationGroup([perm_group_elt(aa) for aa in gens]).order() # long time 46080 """ from copy import copy from sage.rings.infinity import Infinity from sage.graphs.graph import enum n = G.order() Pi = copy(Pi) if n == 0: if lab: H = copy(G) if dict: ddd = {} if proof: dd = {} if dict: return [[]], ddd, H, dd else: return [[]], H, dd if lab and dict: return [[]], ddd, H elif lab: return [[]], H elif dict: return [[]], ddd else: return [[]] if proof: lab=True #create to and from mappings to relabel vertices listto = G.vertices() ffrom = {} for v in listto: ffrom[v] = listto.index(v) to = {} for i in range(len(listto)): to[i] = listto[i] G.relabel(ffrom) Pi2 = [] for cell in Pi: newcell = [] for c in cell: newcell.append(ffrom[c]) Pi2.append(newcell) Pi = Pi2 # create the boolean matrix M = [] for _ in range(n): M.append( [False]*n ) if isinstance(G, Graph): for i, j, l in G.edge_iterator(): M[i][j] = True M[j][i] = True elif isinstance(G, DiGraph): for i, j, l in G.arc_iterator(): M[i][j] = True #begin BDM's algorithm: L = 100 state = 1 W = {} v = {} Lambda = {} nu = {} eta = None rho = None Phi = {} Omega = {} e = {} zf = {} zb = {} output = [] k = None h = None hh = None hb = None hzb = None hzf = None qzb = None while not state is None: if verbosity > 1: print 'k: ' + str(k) print 'nu: ' + str(nu) print 'rho: ' + str(rho) if verbosity > 3: print 'e: ' + str(e) print 'hh: ' + str(hh) print 'hb: ' + str(hb) print 'h: ' + str(h) print 'eta: ' + str(eta) print 'zb: ' + str(zb) print 'hzb: ' + str(hzb) print 'hzf: ' + str(hzf) print 'qzb: ' + str(qzb) if state == 1: if verbosity > 0: print 'state: 1' size = 1 k = 1 h = 0 hzb = 0 index = 0 l = 0 Theta = [[i] for i in range(n)] nu[1] = refine(M, Pi, Pi, bool_matrix_format=True) hh = 2 if not dig: if sat225(nu[1], n): hh = 1 if is_discrete(nu[1]): state = 18 else: W[1] = first_smallest_non_trivial(nu[1]) v[1] = min(W[1]) Lambda[1] = 0 e[1] = 0 state = 2 elif state == 2: if verbosity > 0: print 'state: 2' k += 1 nu[k] = perp(M, nu[k-1], v[k-1], bool_matrix_format=True) Lambda[k] = indicator(M, Pi, nu.values(), k, bool_matrix_format=True) if h == 0: state = 5 else: if hzf == k-1 and Lambda[k] == zf[k]: hzf = k if not lab: state = 3 else: qzb = Lambda[k] - zb[k] if hzb == k-1 and qzb == 0: hzb = k if qzb > 0: zb[k] = Lambda[k] state = 3 elif state == 3: if verbosity > 0: print 'state: 3' if hzf <= k or (lab and qzb >= 0): state = 4 ##changed hzb to hzf, == to <= else: state = 6 elif state == 4: if verbosity > 0: print 'state: 4' if is_discrete(nu[k]): state = 7 else: W[k] = first_smallest_non_trivial(nu[k]) v[k] = min(W[k]) if dig or not sat225(nu[k], n): hh = k+1 e[k] = 0 state = 2 elif state == 5: if verbosity > 0: print 'state: 5' zf[k] = Lambda[k] zb[k] = Lambda[k] state = 4 elif state == 6: if verbosity > 0: print 'state: 6' kprime = k k = min([ hh-1, max(ht-1,hzb) ]) if k == 0: k = 1 # not in BDM, broke at G = Graph({0:[], 1:[]}), Pi = [[0,1]], lab=False if kprime == hh: state = 13 else: l = min([l+1,L]) Lambda[l] = min_cell_reps(nu[hh]) Phi[l] = fix(nu[hh]) state = 12 elif state == 7: if verbosity > 0: print 'state: 7' if h == 0: state = 18 elif k < hzf: state = 8 ## BDM had !=, broke at G = Graph({0:[],1:[],2:[]}), Pi = [[0,1,2]] else: gamma = get_permutation(eta.values(), nu.values(), list_perm=True) if verbosity > 2: print gamma if enum(G, quick=True) == G.relabel(gamma, inplace=False, quick=True): # if G^gamma == G: state = 10 else: state = 8 elif state == 8: if verbosity > 0: print 'state: 8' if (not lab) or (qzb < 0): state = 6 elif (qzb > 0) or (k < len(rho)): state = 9 elif (term_pnest_graph(G, nu.values(), enumer=True) > term_pnest_graph(G, rho.values(), enumer=True)): state = 9 elif (term_pnest_graph(G, nu.values(), enumer=True) < term_pnest_graph(G, rho.values(), enumer=True)): state = 6 else: gamma = get_permutation(nu.values(), rho.values(), list_perm=True) if verbosity > 2: print gamma state = 10 elif state == 9: if verbosity > 0: print 'state: 9' rho = copy(nu) qzb = 0 hb = k hzb = k zb[k+1] = Infinity state = 6 elif state == 10: if verbosity > 0: print 'state: 10' l = min([l+1,L]) Omega[l] = min_cell_reps(orbit_partition(gamma, list_perm=True)) Phi[l] = fix(orbit_partition(gamma, list_perm=True)) if finer( orbit_partition(gamma, list_perm=True), Theta ): state = 11 else: Theta = vee( orbit_partition(gamma, list_perm=True), Theta ) output.append(gamma) if tvc in min_cell_reps(Theta) and lab: ## added "and lab" state = 11 else: k = h state = 13 elif state == 11: if verbosity > 0: print 'state: 11' k = hb state = 12 elif state == 12: if verbosity > 0: print 'state: 12' if e[k] == 1: W[k] = [v for v in W[k] if v in Omega[l]] state = 13 elif state == 13: if verbosity > 0: print 'state: 13' if k == 0: state = None else: if k > h: state = 17 elif k == h: state = 14 else: h = k tvc = min(W[k]) tvh = tvc state = 14 elif state == 14: if verbosity > 0: print 'state: 14' for cell in Theta: if v[k] in cell: if tvh in cell: index += 1 else: break VVV = [vv for vv in W[k] if vv > v[k]] if len(VVV) != 0: v[k] = min(VVV) else: v[k] = Infinity if v[k] == Infinity: state = 16 elif v[k] not in min_cell_reps(Theta): state = 14 else: state = 15 elif state == 15: if verbosity > 0: print 'state: 15' hh = min(hh,k+1) hzf = min(hzf,k) if not lab or hb < k: state = 2 # changed hzb to hb else: hb = k # changed hzb to hb qzb = 0 state = 2 elif state == 16: if verbosity > 0: print 'state: 16' if len(W[k]) == index and ht == k+1: ht = k size = size*index index = 0 k -= 1 state = 13 elif state == 17: if verbosity > 0: print 'state: 17' if e[k] == 0: l = W[k] for i in range(1,l+1): boo = True for j in range(1,k): if v[j] not in Phi[i]: boo = False break if boo: l = [v for v in l if v in Omega[i]] W[k] = l e[k] = 1 VVV = [v for v in W[k] if v > v[k]] if len(VVV) != 0: v[k] = min(VVV) else: v[k] = Infinity if v[k] != Infinity: state = 15 k -= 1 state = 13 elif state == 18: if verbosity > 0: print 'state: 18' h = k ht = k hzf = k zf[k+1] = Infinity eta = copy(nu) k -= 1 if not lab: state = 13 else: rho = copy(nu) hzb = k ## BDM had k+1 hb = k ## BDM had k+1 zb[k+2] = Infinity qzb = 0 state = 13 if lab: H = term_pnest_graph(G, rho.values()) G.relabel(to) if dict: ddd = {} for v in G.vertices(): if ffrom[v] != 0: ddd[v] = ffrom[v] else: ddd[v] = n if proof: proofpart = rho.values()[-1] dd = {} for i in proofpart: dd[i[0]] = proofpart.index(i) if dict: return output, ddd, H, dd else: return output, H, dd if lab and dict: return output, ddd, H elif lab: return output, H elif dict: return output, ddd else: return output
7ab22483839352913d606d7876b7c4edf05fc338 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7ab22483839352913d606d7876b7c4edf05fc338/graph_isom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 67, 3413, 12, 43, 16, 13380, 16, 11814, 33, 5510, 16, 3097, 33, 8381, 16, 2065, 33, 8381, 16, 14601, 33, 8381, 16, 11561, 33, 20, 4672, 3536, 25374, 716, 326, 5253, 444, 434, 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, 1623, 67, 3413, 12, 43, 16, 13380, 16, 11814, 33, 5510, 16, 3097, 33, 8381, 16, 2065, 33, 8381, 16, 14601, 33, 8381, 16, 11561, 33, 20, 4672, 3536, 25374, 716, 326, 5253, 444, 434, 6...
if not rexp.match(arg) : continue
if not rexp.match(arg.GetName()) : continue
def setConstant(ws, pattern, constant = True, value = None): rc = 0 import re rexp = re.compile(pattern) for arg in ws.allVars() : if not rexp.match(arg) : continue arg.setConstant( constant ) if constant and value : if value < arg.getMin() : arg.setMin(value) if value > arg.getMax() : arg.setMax(value) arg.setVal(value) rc += 1 return rc
53bdedcce0d095ae22c4f8dda0ebbd5f473a1fc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7060/53bdedcce0d095ae22c4f8dda0ebbd5f473a1fc4/RooFitDecorators.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 6902, 12, 4749, 16, 1936, 16, 5381, 273, 1053, 16, 460, 273, 599, 4672, 4519, 273, 374, 1930, 283, 283, 23829, 273, 283, 18, 11100, 12, 4951, 13, 364, 1501, 316, 4945, 18, 454, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 444, 6902, 12, 4749, 16, 1936, 16, 5381, 273, 1053, 16, 460, 273, 599, 4672, 4519, 273, 374, 1930, 283, 283, 23829, 273, 283, 18, 11100, 12, 4951, 13, 364, 1501, 316, 4945, 18, 454, ...
recID_list_ = perform_request_search(c=oai['c'].split(','),
recID_list_ = perform_request_search(c=[coll.strip() for coll in oai['c'].split(',')],
def get_recID_list(oai_sets, set): setSpec = "" setName = "" setCoverage = "" #list_of_sets = [] processed_sets = [] recID_list = [] for oai in oai_sets: if oai['setSpec'] in processed_sets : pass else: #list_of_sets.append(oai) processed_sets.append(oai['setSpec']) if(oai['setSpec'] == set): setSpec = oai['setSpec'] setName = oai['setName'] setCoverage += oai['c'] setCoverage += " " recID_list_ = perform_request_search(c=oai['c'].split(','), p1=oai['p1'], f1=oai['f1'], m1=oai['m1'], op1='a', p2=oai['p2'], f2=oai['f2'], m2=oai['m2'], op2='a', p3=oai['p3'], f3=oai['f3'], m3=oai['m3']) for recID in recID_list_: if recID in recID_list: pass else: recID_list.append(recID) if (setSpec == "global"): setCoverage = cdsname return (setSpec, setName, setCoverage, recID_list)
13fdcb7409ddb1944d0f7286e439338dd26a99f1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/13fdcb7409ddb1944d0f7286e439338dd26a99f1/oaiarchive_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3927, 734, 67, 1098, 12, 83, 10658, 67, 4424, 16, 444, 4672, 225, 444, 1990, 1850, 273, 1408, 6788, 1850, 273, 1408, 444, 9739, 1377, 273, 1408, 468, 1098, 67, 792, 67, 4424, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3927, 734, 67, 1098, 12, 83, 10658, 67, 4424, 16, 444, 4672, 225, 444, 1990, 1850, 273, 1408, 6788, 1850, 273, 1408, 444, 9739, 1377, 273, 1408, 468, 1098, 67, 792, 67, 4424, ...
def _view_look_dom_arch(self, cursor, user, tree, context=None):
def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
def _view_look_dom_arch(self, cursor, user, tree, context=None): analytic_account_obj = self.pool.get('analytic_account.account') analytic_account_obj.convert_view(cursor, user, tree, context=context) arch, fields = super(PurchaseLine, self)._view_look_dom_arch(cursor, user, tree, context=context) return arch, fields
478f145f77d322c8a5c7ef27f315e04d883e8772 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9277/478f145f77d322c8a5c7ef27f315e04d883e8772/purchase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1945, 67, 7330, 67, 9859, 67, 991, 12, 2890, 16, 3347, 16, 729, 16, 2151, 16, 618, 16, 819, 33, 7036, 4672, 392, 7834, 335, 67, 4631, 67, 2603, 273, 365, 18, 6011, 18, 588, 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, 389, 1945, 67, 7330, 67, 9859, 67, 991, 12, 2890, 16, 3347, 16, 729, 16, 2151, 16, 618, 16, 819, 33, 7036, 4672, 392, 7834, 335, 67, 4631, 67, 2603, 273, 365, 18, 6011, 18, 588, 26...
value, err = self._series(v, z)
value, err = self.iv_series(v, z)
def test_iv_series(self): for v in [-20., -10., -1., 0., 1., 12.49, 120.]: for z in [1., 10., 200.5, -1+2j]: value, err = self._series(v, z) assert_tol_equal(iv(v, z), value, atol=err, err_msg=(v, z))
670b0f6dc7ca2d2b86c72fd8030fd59c4629abef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/670b0f6dc7ca2d2b86c72fd8030fd59c4629abef/test_basic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 427, 67, 10222, 12, 2890, 4672, 364, 331, 316, 23059, 3462, 12990, 300, 2163, 12990, 300, 21, 12990, 374, 12990, 404, 12990, 2593, 18, 7616, 16, 15743, 18, 14542, 364, 998, 316...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 427, 67, 10222, 12, 2890, 4672, 364, 331, 316, 23059, 3462, 12990, 300, 2163, 12990, 300, 21, 12990, 374, 12990, 404, 12990, 2593, 18, 7616, 16, 15743, 18, 14542, 364, 998, 316...
raise RuntimeError, "You must intall the optional gap_packages package."
raise RuntimeError, "You must install the optional gap_packages package."
def cohomology(self, n, p = 0): r""" Computes the group cohomology `H^n(G, F)`, where `F = \ZZ` if `p=0` and `F = \ZZ / p \ZZ` if `p > 0` is a prime. Wraps HAP's ``GroupHomology`` function, written by Graham Ellis. REQUIRES: GAP package HAP (in gap_packages-\*.spkg). EXAMPLES:: sage: G = SymmetricGroup(4) sage: G.cohomology(1,2) # optional - gap_packages Multiplicative Abelian Group isomorphic to C2 sage: G = SymmetricGroup(3) sage: G.cohomology(5) # optional - gap_packages Trivial Abelian Group sage: G.cohomology(5,2) # optional - gap_packages Multiplicative Abelian Group isomorphic to C2 sage: G.homology(5,3) # optional - gap_packages Trivial Abelian Group sage: G.homology(5,4) # optional - gap_packages Traceback (most recent call last): ... ValueError: p must be 0 or prime This computes `H^4(S_3, \ZZ)` and `H^4(S_3, \ZZ / 2 \ZZ)`, respectively. AUTHORS:
fa0b770d85ec2cdcebd583672be03ce9fd3df119 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fa0b770d85ec2cdcebd583672be03ce9fd3df119/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1825, 17125, 4676, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1041, 1825, 17125, 4676, 1375, 44, 66, 82, 12, 43, 16, 478, 13, 9191, 1625, 1375, 42, 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, 1825, 17125, 4676, 12, 2890, 16, 290, 16, 293, 273, 374, 4672, 436, 8395, 14169, 281, 326, 1041, 1825, 17125, 4676, 1375, 44, 66, 82, 12, 43, 16, 478, 13, 9191, 1625, 1375, 42, 273, ...
template :string
template: string
def __init__(self, dir='.', template=None, speciespath=None, bin='excitingser', kpts=(1, 1, 1), **kwargs): """Exciting calculator object constructor Parameters ---------- dir : string directory in which to excecute exciting template :string Path to XSLT templat if it schould be used default: none bin :string Path or executable name of exciting default: ``excitingser`` kpts:integer list length 3 Number of kpoints **kwargs : dictionary like list of key value pairs to be converted into groundstate attributes """ self.dir = dir self.energy = None self.template = template if speciespath is None: self.speciespath = os.environ.get('EXCITING_SPECIES_PATH', './') self.converged = False self.excitingbinary = bin self.groundstate_attributes = kwargs if not 'ngridk' in kwargs.keys(): self.groundstate_attributes['ngridk'] = ' '.join(map(str, kpts))
9cbf4e6ca2cb470d699b1c8d27f42fb6533ce806 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/9cbf4e6ca2cb470d699b1c8d27f42fb6533ce806/exciting.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1577, 2218, 1093, 16, 1542, 33, 7036, 16, 12891, 803, 33, 7036, 16, 4158, 2218, 10075, 305, 310, 550, 2187, 417, 1092, 28657, 21, 16, 404, 16, 404, 3631,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1577, 2218, 1093, 16, 1542, 33, 7036, 16, 12891, 803, 33, 7036, 16, 4158, 2218, 10075, 305, 310, 550, 2187, 417, 1092, 28657, 21, 16, 404, 16, 404, 3631,...
if hasattr(value, 'shape'):
if hasattr(value, '__iter__'): value = farray(value)
def add_property(self, name, value, n_cols=1): """ Add a new property to this Atoms object.
0f111c958ab0e88cd01fd55c13a6005ce0e19c70 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/0f111c958ab0e88cd01fd55c13a6005ce0e19c70/extras.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4468, 12, 2890, 16, 508, 16, 460, 16, 290, 67, 6842, 33, 21, 4672, 3536, 1436, 279, 394, 1272, 358, 333, 7149, 87, 733, 18, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4468, 12, 2890, 16, 508, 16, 460, 16, 290, 67, 6842, 33, 21, 4672, 3536, 1436, 279, 394, 1272, 358, 333, 7149, 87, 733, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100...
return self.images[name]['url']
return nget(self.images, name)['url']
def getURL(self, name, size=None): try: return self.images[name]['url'] except KeyError: return None
534819a3727f235571481b0675a66077bf8109ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/534819a3727f235571481b0675a66077bf8109ac/zipwiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19341, 12, 2890, 16, 508, 16, 963, 33, 7036, 4672, 775, 30, 327, 290, 588, 12, 2890, 18, 7369, 16, 508, 13, 3292, 718, 3546, 1335, 4999, 30, 327, 599, 225, 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, 1, 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, 19341, 12, 2890, 16, 508, 16, 963, 33, 7036, 4672, 775, 30, 327, 290, 588, 12, 2890, 18, 7369, 16, 508, 13, 3292, 718, 3546, 1335, 4999, 30, 327, 599, 225, 2, -100, -100, -100, -100,...
"universe":"vanilla"
"universe":"vanilla",
def modifyCP(cp,defaults): """ Appended the configuration information in defaults into the config parser (cp) object and return a copy of this newly update cp object. """ if not(cp.has_section(defaults["section"])): cp.add_section(defaults["section"]) for key, val in defaults["options"].iteritems(): if not cp.has_option(defaults["section"], key): cp.set(defaults["section"], val) #End modifyCP
9e152961c57c114ca32f6d71b76f936ddd7c7b79 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/9e152961c57c114ca32f6d71b76f936ddd7c7b79/fu_Condor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5612, 4258, 12, 4057, 16, 7606, 4672, 3536, 1716, 11275, 326, 1664, 1779, 316, 3467, 1368, 326, 642, 2082, 261, 4057, 13, 733, 471, 327, 279, 1610, 434, 333, 10894, 1089, 3283, 733, 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, 5612, 4258, 12, 4057, 16, 7606, 4672, 3536, 1716, 11275, 326, 1664, 1779, 316, 3467, 1368, 326, 642, 2082, 261, 4057, 13, 733, 471, 327, 279, 1610, 434, 333, 10894, 1089, 3283, 733, 18, ...
assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,cursor,me.fileLogger,deltaWindow=delta,processingDay=procDay) assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,cursor,me.fileLogger,startWindow=start,processingDay=procDay) assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,cursor,me.fileLogger,endWindow=start,processingDay=procDay)
assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,None,cursor,me.fileLogger,deltaWindow=delta,processingDay=procDay) assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,None,cursor,me.fileLogger,startWindow=start,processingDay=procDay) assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,None,cursor,me.fileLogger,endWindow=start,processingDay=procDay)
def testGetProcessingWindow(self): cursor = self.connection.cursor() config = {} # check that a really empty system fails assert_raises(SystemExit,cron_util.getProcessingWindow,config,self.tableName,cursor,me.fileLogger)
cafbae83143e839351f7e00f20999c211cfa9fdb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12383/cafbae83143e839351f7e00f20999c211cfa9fdb/testUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 967, 7798, 3829, 12, 2890, 4672, 3347, 273, 365, 18, 4071, 18, 9216, 1435, 642, 273, 2618, 468, 866, 716, 279, 8654, 1008, 2619, 6684, 1815, 67, 354, 6141, 12, 22729, 16, 18041, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 967, 7798, 3829, 12, 2890, 4672, 3347, 273, 365, 18, 4071, 18, 9216, 1435, 642, 273, 2618, 468, 866, 716, 279, 8654, 1008, 2619, 6684, 1815, 67, 354, 6141, 12, 22729, 16, 18041, ...
self.prune_file_list()
if self.prune: self.prune_file_list()
def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.files'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the state of the filesystem. """
9c5d865b9fb9fe64faba573d6c415fce6c85800d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9c5d865b9fb9fe64faba573d6c415fce6c85800d/sdist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 768, 67, 1098, 261, 2890, 4672, 3536, 42, 15906, 596, 326, 666, 434, 1390, 358, 2341, 316, 326, 1084, 7006, 16, 471, 1378, 518, 316, 296, 2890, 18, 2354, 10332, 225, 1220, 482...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 768, 67, 1098, 261, 2890, 4672, 3536, 42, 15906, 596, 326, 666, 434, 1390, 358, 2341, 316, 326, 1084, 7006, 16, 471, 1378, 518, 316, 296, 2890, 18, 2354, 10332, 225, 1220, 482...
(key, value, self._host))
(key, value, host))
def __setitem__(self, key, value): if key not in self._data: self.__getitem__(key) c = self._db.cursor(self._log) if self._data[key] is None: c.execute("""INSERT INTO settings (value, data, hostname) VALUES (%s,%s,%s)""", (key, value, self._host)) else: if self._host == 'NULL': where = 'IS NULL' wheredat = (value, key) else: where = 'LIKE(%s)' wheredat = (value, key, self._host) c.execute("""UPDATE settings SET data=%%s WHERE value=%%s AND hostname %s""" % where, wheredat) self._data[key] = value
579d2b0d74c64f5c9a73587dd87d4cda3aafef04 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/579d2b0d74c64f5c9a73587dd87d4cda3aafef04/MythBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 1726, 972, 12, 2890, 16, 498, 16, 460, 4672, 309, 498, 486, 316, 365, 6315, 892, 30, 365, 16186, 31571, 972, 12, 856, 13, 276, 273, 365, 6315, 1966, 18, 9216, 12, 2890, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 542, 1726, 972, 12, 2890, 16, 498, 16, 460, 4672, 309, 498, 486, 316, 365, 6315, 892, 30, 365, 16186, 31571, 972, 12, 856, 13, 276, 273, 365, 6315, 1966, 18, 9216, 12, 2890, 63...
"BM.{4}\0{4}.{4}[\x0C\x28\x6C]\0{3}",
"BM.{4}.{8}[\x0C\x28\x6C]\0{3}",
def createFields(self): # Version 2 (12 bytes) yield UInt32(self, "header_size", "Header size") yield UInt32(self, "width", "Width (pixels)") yield UInt32(self, "height", "Height (pixels)") yield UInt16(self, "nb_plan", "Number of plan (=1)") yield UInt16(self, "bpp", "Bits per pixel") # may be zero for PNG/JPEG picture
b542476656e7f2f9813c1f1e2ab64c1775221fb9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9327/b542476656e7f2f9813c1f1e2ab64c1775221fb9/bmp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 2314, 12, 2890, 4672, 468, 4049, 576, 261, 2138, 1731, 13, 2824, 29810, 1578, 12, 2890, 16, 315, 3374, 67, 1467, 3113, 315, 1864, 963, 7923, 2824, 29810, 1578, 12, 2890, 16, 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, 752, 2314, 12, 2890, 4672, 468, 4049, 576, 261, 2138, 1731, 13, 2824, 29810, 1578, 12, 2890, 16, 315, 3374, 67, 1467, 3113, 315, 1864, 963, 7923, 2824, 29810, 1578, 12, 2890, 16, 315, ...
c.execute("""DELETE FROM ticket""")
c.execute("DELETE FROM ticket")
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla if BZ_VERSION == '2.11': print 'Using Buzvilla v%s schema.' % BZ_VERSION activityFields['removed'] = 'oldvalue' activityFields['added'] = 'newvalue' # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % (_db, _host, _user, _password) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "cleaning all tickets..." c = trac.db().cursor() c.execute("""DELETE FROM ticket_change""") trac.db().commit() c.execute("""DELETE FROM ticket""") trac.db().commit() c.execute("""DELETE FROM attachment""") os.system('rm -rf %s' % trac.env.get_attachments_dir()) os.mkdir(trac.env.get_attachments_dir()) trac.db().commit() print print "1. import severities..." severities = (('blocker', '1'), ('critical', '2'), ('major', '3'), ('normal', '4'), ('minor', '5'), ('trivial', '6'), ('enhancement', '7')) trac.setSeverityList(severities) print print "2. import components..." sql = "SELECT value, initialowner AS owner FROM components" if PRODUCTS: sql += " WHERE %s" % productFilter('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'value') print print "3. import priorities..." priorities = (('P1', '1'), ('P2', '2'), ('P3', '3'), ('P4', '4'), ('P5', '5')) trac.setPriorityList(priorities) print print "4. import versions..." sql = "SELECT DISTINCTROW value FROM versions" if PRODUCTS: sql += " WHERE %s" % productFilter('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print print "5. import milestones..." mysql_cur.execute("SELECT value FROM milestones") milestones = mysql_cur.fetchall() if milestones[0] == '---': trac.setMilestoneList(milestones, 'value') else: trac.setMilestoneList([], '') print print '6. retrieving bugs...' sql = "SELECT * FROM bugs " if PRODUCTS: sql += " WHERE %s" % productFilter('product', PRODUCTS) sql += " ORDER BY bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print print "7. import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'] ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s" % bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] if bug['target_milestone'] == '---': ticket['milestone'] = '' else: ticket['milestone'] = bug['target_milestone'] bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] keywords = string.split(bug['keywords'], ' ') mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time=desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value=desc['thetext']) mysql_cur.execute("SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == 'resolution' or field_name == 'bug_status': removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == 'resolution': resolution = added.lower() keywordChange = False oldKeywords = string.join(keywords, " ") # convert bugzilla field names... if field_name == 'bug_severity': field_name = 'severity' elif field_name == 'assigned_to': field_name = 'owner' elif field_name == 'bug_status': field_name = 'status' if removed in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[added] keywords.append(kw) keywordChange = True added = statusXlator[added] removed = statusXlator[removed] elif field_name == 'short_desc': field_name = 'summary' elif field_name == 'product': if removed in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[removed] if kw in keywords: keywords.remove(kw) else: oldKeywords = string.join(keywords + [ kw ], " ") keywordChange = True if added in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[added] keywords.append(kw) keywordChange = True ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if keywordChange: newKeywords = string.join(keywords, " ") ticketChangeKw = ticketChange ticketChangeKw['field'] = 'keywords' ticketChangeKw['oldvalue'] = oldKeywords ticketChangeKw['newvalue'] = newKeywords #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field='keywords', oldvalue=oldKeywords, newvalue=newKeywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # skip changes that have no effect (think translation!) if added == removed: continue # bugzilla splits large summary changes into two records for oldChange in ticketChanges: if (field_name == 'summary' and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break else: #trac.addTicketChange(ticket=bugid, time=activity['bug_when'], # author=trac.getLoginName(mysql_cur, activity['who']), # field=field_name, oldvalue=removed, newvalue=added) ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # for some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == 'closed': ticket['resolution'] = resolution if bug['bug_status'] in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug['bug_status']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) if bug['product'] in PRODUCT_KEYWORDS: kw = PRODUCT_KEYWORDS[bug['product']] # may have already been added during activity import if kw not in keywords: keywords.append(kw) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) tracAttachment = Attachment(a['filename'], a['thedata']) trac.addAttachment(bugid, tracAttachment, a['description'], author) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) print "Success!"
63f7bce156a2ed5a10227f95c07a9ae105efaf62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/63f7bce156a2ed5a10227f95c07a9ae105efaf62/bugzilla2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
_("You have successfully obtained an authorization as %(role)s! " "This authorization will last until %(expiration)s and until "
_("You have successfully obtained an authorization as %(x_role)s! " "This authorization will last until %(x_expiration)s and until "
def access(self, req, form): args = wash_urlargd(form, {'mailcookie' : (str, '')}) _ = gettext_set_language(args['ln']) title = _("Mail Cookie Service") try: kind = mail_cookie_retrieve_kind(args['mailcookie']) if kind == 'pw_reset': redirect_to_url(req, '%s/youraccount/resetpassword?k=%s&ln=%s' % (sweburl, args['mailcookie'], args['ln'])) elif kind == 'role': uid = webuser.getUid(req) try: (role_name, expiration) = mail_cookie_check_role(args['mailcookie'], uid) except InvenioWebAccessMailCookieDeletedError: return page(title=_("Role authorization request"), req=req, body=_("This request for an authorization has already been authorized."), uid=webuser.getUid(req), navmenuid='youraccount', language=args['ln']) return page(title=title, body=webaccount.perform_back( _("You have successfully obtained an authorization as %(role)s! " "This authorization will last until %(expiration)s and until " "you close your browser if you are a guest user.") % {'role' : '<strong>%s</strong>' % role_name, 'expiration' : '<em>%s</em>' % expiration.strftime("%Y-%m-%d %H:%M:%S")}, 'login', _('login'), args['ln']), req=req, uid=webuser.getUid(req), language=args['ln'], lastupdated=__lastupdated__, navmenuid='youraccount') elif kind == 'mail_activation': try: email = mail_cookie_check_mail_activation(args['mailcookie']) if not email: raise StandardError webuser.confirm_email(email) body = "<p>" + _("You have confirmed the validity of your email" " address!") + "</p>" if CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS == 1: body += "<p>" + _("Please, wait for the administrator to " "enable your account.") + "</p>" else: uid = webuser.update_Uid(req, email) body += "<p>" + _("You can now go to %(x_url_open)syour account page%(x_url_close)s.") % {'x_url_open' : '<a href="/youraccount/display?ln=%s">' % args['ln'], 'x_url_close' : '</a>'} + "</p>" return page(title=_("Email address successfully activated"), body=body, req=req, language=args['ln'], uid=webuser.getUid(req), lastupdated=__lastupdated__, navmenuid='youraccount') except InvenioWebAccessMailCookieDeletedError, e: body = "<p>" + _("You have already confirmed the validity of your email address!") + "</p>" if CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS == 1: body += "<p>" + _("Please, wait for the administrator to " "enable your account.") + "</p>" else: body += "<p>" + _("You can now go to %(x_url_open)syour account page%(x_url_close)s.") % {'x_url_open' : '<a href="/youraccount/display?ln=%s">' % args['ln'], 'x_url_close' : '</a>'} + "</p>" return page(title=_("Email address successfully activated"), body=body, req=req, language=args['ln'], uid=webuser.getUid(req), lastupdated=__lastupdated__, navmenuid='youraccount') return webuser.page_not_authorized(req, "../youraccount/access", text=_("This request for confirmation of an email " "address is not valid or" " is expired."), navmenuid='youraccount') except InvenioWebAccessMailCookieError: return webuser.page_not_authorized(req, "../youraccount/access", text=_("This request for an authorization is not valid or" " is expired."), navmenuid='youraccount')
0fdc70575318c17fadb1476e7759f2e992d9c45b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/0fdc70575318c17fadb1476e7759f2e992d9c45b/websession_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2006, 12, 2890, 16, 1111, 16, 646, 4672, 833, 273, 341, 961, 67, 718, 3175, 72, 12, 687, 16, 13666, 4408, 8417, 11, 294, 261, 701, 16, 28707, 6792, 389, 273, 24972, 67, 542, 67, 4923...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2006, 12, 2890, 16, 1111, 16, 646, 4672, 833, 273, 341, 961, 67, 718, 3175, 72, 12, 687, 16, 13666, 4408, 8417, 11, 294, 261, 701, 16, 28707, 6792, 389, 273, 24972, 67, 542, 67, 4923...
def setdefault(self, key, value): self.values.setdefault(key, value)
def setdefault(self, key, value): self.values.setdefault(key, value) def has_key(self, key): return self.values.has_key(key)
def setdefault(self, key, value): self.values.setdefault(key, value)
31a172669051f612c39ad10e813c996483107c44 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6150/31a172669051f612c39ad10e813c996483107c44/hectic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8745, 12, 2890, 16, 498, 16, 460, 4672, 365, 18, 2372, 18, 542, 1886, 12, 856, 16, 460, 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,...
[ 1, 1, 1, 1, 1, 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, 8745, 12, 2890, 16, 498, 16, 460, 4672, 365, 18, 2372, 18, 542, 1886, 12, 856, 16, 460, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
self._titlebox = TerminatorTermTitle (self.terminator, self.conf.titlebars)
self._titlebox = TerminatorTermTitle (self, self.terminator, self.conf.titlebars)
def __init__ (self, terminator, profile = None, command = None, cwd = None): gtk.VBox.__init__ (self) self.terminator = terminator self.conf = terminator.conf self.command = command self._oldtitle = "" self.matches = {}
58e20f08682147d5bb232d4fab88ecdede542a88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1032/58e20f08682147d5bb232d4fab88ecdede542a88/terminatorterm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 261, 2890, 16, 24965, 16, 3042, 273, 599, 16, 1296, 273, 599, 16, 7239, 273, 599, 4672, 22718, 18, 58, 3514, 16186, 2738, 972, 261, 2890, 13, 365, 18, 9505, 639, 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, 261, 2890, 16, 24965, 16, 3042, 273, 599, 16, 1296, 273, 599, 16, 7239, 273, 599, 4672, 22718, 18, 58, 3514, 16186, 2738, 972, 261, 2890, 13, 365, 18, 9505, 639, 273, ...
logging.critical("I caught an OSError. Assure that the directory containing the tool to be benchmarked is included in the PATH environment variable.")
logging.critical("I caught an OSError. Assure that the directory containing the tool to be benchmarked is included in the PATH environment variable or an alias is set.")
def setrlimits(): for rsrc, limits in rlimits.items(): resource.setrlimit(rsrc, limits)
201c0697d1deb69d169d7e411e32649983cb9773 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7293/201c0697d1deb69d169d7e411e32649983cb9773/benchmark.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1321, 1038, 87, 13332, 364, 3597, 1310, 16, 8181, 316, 436, 14270, 18, 3319, 13332, 1058, 18, 542, 1321, 1038, 12, 86, 4816, 16, 8181, 13, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1321, 1038, 87, 13332, 364, 3597, 1310, 16, 8181, 316, 436, 14270, 18, 3319, 13332, 1058, 18, 542, 1321, 1038, 12, 86, 4816, 16, 8181, 13, 2, -100, -100, -100, -100, -100, -100, -...
return STOP
def process(res, args): mlist = res.mlist if len(args) <> 1: res.results.append(_('Usage:')) res.results.append(gethelp(mlist)) return STOP cookie = args[0] try: results = mlist.ProcessConfirmation(cookie, res.msg) except Errors.MMBadConfirmation, e: # Express in approximate days days = int(mm_cfg.PENDING_REQUEST_LIFE / mm_cfg.days(1) + 0.5) res.results.append(_("""\
7ec39d0596092de34954f856c1e4cfdbe25bf2cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7ec39d0596092de34954f856c1e4cfdbe25bf2cc/cmd_confirm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 455, 16, 833, 4672, 312, 1098, 273, 400, 18, 781, 376, 309, 562, 12, 1968, 13, 2813, 404, 30, 400, 18, 4717, 18, 6923, 24899, 2668, 5357, 2497, 3719, 400, 18, 4717, 18, 692...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1207, 12, 455, 16, 833, 4672, 312, 1098, 273, 400, 18, 781, 376, 309, 562, 12, 1968, 13, 2813, 404, 30, 400, 18, 4717, 18, 6923, 24899, 2668, 5357, 2497, 3719, 400, 18, 4717, 18, 692...
_self.edit.textChanged.connect(self.on_text_changed)
_self.edit.textChanged.connect(_self.on_text_changed)
def create_file_chooser_layout(_self, reverse): hlayout = QtGui.QHBoxLayout() _self.edit = edit = QtGui.QLineEdit() _self.edit.textChanged.connect(self.on_text_changed) browse = QtGui.QPushButton("...") browse.clicked.connect(_self.on_file_select) browse.setMaximumWidth(20) add_to_layout(hlayout, edit) add_to_layout(hlayout, browse) if not reverse: download = QtGui.QPushButton(_("Download it")) download.clicked.connect(_self.on_dl) add_to_layout(hlayout, download) return hlayout
a70e957ae62024bb854ab7edb509c3b57e010d96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/a70e957ae62024bb854ab7edb509c3b57e010d96/ufo_dd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 768, 67, 2599, 13164, 67, 6741, 24899, 2890, 16, 4219, 4672, 366, 6741, 273, 23425, 18, 53, 44, 3514, 3744, 1435, 389, 2890, 18, 4619, 273, 3874, 273, 23425, 18, 53, 1670, 466...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 752, 67, 768, 67, 2599, 13164, 67, 6741, 24899, 2890, 16, 4219, 4672, 366, 6741, 273, 23425, 18, 53, 44, 3514, 3744, 1435, 389, 2890, 18, 4619, 273, 3874, 273, 23425, 18, 53, 1670, 466...
nme.writeDesktopFile(os.path.join(MENUDIR, category + ".directory"))
nme.writeDesktopFile(file)
def add_menu_entry(root_menu, root_category, category): '''This adds a menu element entry 'category' under the root_category menu''' if category == root_category: below = "Pentoo" else: below = root_category menu = find_menu_entry(root_menu, category) if menu == None: new_menu_entry = etree.SubElement(find_menu_entry(root_menu, below), "Menu") new_name_entry = etree.SubElement(new_menu_entry, "Name") new_name_entry.text = category file = os.path.join(LOCALDIR, category + ".directory") if not options.simulate: if not os.path.exists(LOCALDIR): try: os.makedirs(LOCALDIR) except: sys.stderr.write("Unable to create " + LOCALDIR + "\n") sys.stderr.write("Verify that you have write permissions in " + LOCALDIR + "\n") return -1 try: if os.path.exists(os.path.join(MENUDIR, category + ".directory")): shutil.copyfile(os.path.join(MENUDIR, category + ".directory"), file) else: # We try to make it by hand nme = create_menu_entry(category, root_category) nme.writeDesktopFile(os.path.join(MENUDIR, category + ".directory")) except: sys.stderr.write("Unable to copy " + category + ".directory" + " to " + LOCALDIR + "\n") sys.stderr.write("Verify that you have write permissions in " + LOCALDIR + "\n") return -1 new_directory_entry = etree.SubElement(new_menu_entry, "Directory") new_directory_entry.text = category + ".directory" new_includelist = etree.SubElement(new_menu_entry, "Include") return new_includelist
4fcbfbed60e511f85c58e074305411c99aa75ad7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7161/4fcbfbed60e511f85c58e074305411c99aa75ad7/genmenu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5414, 67, 4099, 12, 3085, 67, 5414, 16, 1365, 67, 4743, 16, 3150, 4672, 9163, 2503, 4831, 279, 3824, 930, 1241, 296, 4743, 11, 3613, 326, 1365, 67, 4743, 3824, 26418, 309, 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, 527, 67, 5414, 67, 4099, 12, 3085, 67, 5414, 16, 1365, 67, 4743, 16, 3150, 4672, 9163, 2503, 4831, 279, 3824, 930, 1241, 296, 4743, 11, 3613, 326, 1365, 67, 4743, 3824, 26418, 309, 315...
headers = {}
headers = {'content-type': 'application/x-www-form-urlencoded'}
def http_request(self, path_name, cookie_string=None, form={}): path = self.base_path + '/' + config.get('cb_' + path_name) if config['secret']: form['secret'] = config['secret'] body = urllib.urlencode(form) http = httplib.HTTPConnection(self.base_host, self.base_port) headers = {} if cookie_string: headers['Cookie'] = cookie_string http.request('POST', path, body=body, headers=headers) response = http.getresponse() if response.status != 200: raise ExpectedException("Invalid callback response, status=" + str(response.status)) body = response.read() try: output = json.loads(body) except: raise ExpectedException("Invalid json: " + body) if not isinstance(output, list) or len(output) != 2: raise ExpectedException("Invalid response (expected json list of length 2)") if not isinstance(output[1], dict): raise ExpectedException("Invalid response (expected json object in response index 1)") output[1] = dict([(str(k), v) for (k,v) in output[1].items()]) return output
3ea37f7d99abfcd32f52cb0759f0e696df340dca /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13219/3ea37f7d99abfcd32f52cb0759f0e696df340dca/server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 2293, 12, 2890, 16, 589, 67, 529, 16, 3878, 67, 1080, 33, 7036, 16, 646, 12938, 4672, 589, 273, 365, 18, 1969, 67, 803, 397, 2023, 397, 642, 18, 588, 2668, 7358, 4623, 397,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1062, 67, 2293, 12, 2890, 16, 589, 67, 529, 16, 3878, 67, 1080, 33, 7036, 16, 646, 12938, 4672, 589, 273, 365, 18, 1969, 67, 803, 397, 2023, 397, 642, 18, 588, 2668, 7358, 4623, 397,...
Construct a cylindrical transformation for a function ``rho`` in terms of ``phi`` and ``z``:: sage: T = Cylindrical('rho', ['phi', 'z'])
Construct a cylindrical transformation for a function for ``height`` in terms of ``radius`` and ``azimuth``:: sage: T = Cylindrical('height', ['radius', 'azimuth'])
def gen_transform(self, r=None, theta=None, phi=None): """ EXAMPLE:: sage: T = Spherical('r', ['theta', 'phi']) sage: T.gen_transform(r=var('r'), theta=var('theta'), phi=var('phi')) (r*sin(theta)*cos(phi), r*sin(phi)*sin(theta), r*cos(theta)) """ return (r * sin(theta) * cos(phi), r * sin(theta) * sin(phi), r * cos(theta))
ae9bf5e0d28a56cbf9d189e5545c9a8340d806de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ae9bf5e0d28a56cbf9d189e5545c9a8340d806de/plot3d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 67, 6547, 12, 2890, 16, 436, 33, 7036, 16, 7338, 33, 7036, 16, 7706, 33, 7036, 4672, 3536, 5675, 21373, 2866, 225, 272, 410, 30, 399, 273, 348, 21570, 2668, 86, 2187, 10228, 1448...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 6547, 12, 2890, 16, 436, 33, 7036, 16, 7338, 33, 7036, 16, 7706, 33, 7036, 4672, 3536, 5675, 21373, 2866, 225, 272, 410, 30, 399, 273, 348, 21570, 2668, 86, 2187, 10228, 1448...
Return a tuple of two elements: all the bytes that were read, and the decoded string produced by the decoder. (The entire input chunk is sent to the decoder, but some of it may remain buffered in the decoder, yet to be converted.)
The return value is True unless EOF was reached. The decoded string is placed in self._decoded_text (replacing its previous value). (The entire input chunk is sent to the decoder, though some of it may remain buffered in the decoder, yet to be converted.)
def _read_chunk(self): """ Read and decode the next chunk of data from the BufferedReader.
1e18b9ecf014bdc7f0b206c49c140c4f21edcb70 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/1e18b9ecf014bdc7f0b206c49c140c4f21edcb70/io.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 896, 67, 6551, 12, 2890, 4672, 3536, 2720, 471, 2495, 326, 1024, 2441, 434, 501, 628, 326, 10633, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 389, 896, 67, 6551, 12, 2890, 4672, 3536, 2720, 471, 2495, 326, 1024, 2441, 434, 501, 628, 326, 10633, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
_("GoogleEarth not installed!"), (_("Create kmz/kml file ''%s''\n"
_("GoogleEarth not installed!"), (_("Create kmz/kml file ''%s''\n"
def calc_url(self): """ Creates a file for use with GoogleEarth and launches GoogleEarth if in system """ home_dir = os.path.expanduser("~") default_filename = 'GrampsPlacesForGoogleEarth' filename = os.path.join(home_dir, default_filename) if not _GOOGLEEARTH_OK: qd2 = QuestionDialog2( _("GoogleEarth not installed!"), (_("Create kmz/kml file ''%s''\n" "in user directory ''%s''?")\ % (default_filename, home_dir)), _("Yes"), _("No")) if not qd2.run(): return base = os.path.dirname(filename) # Check if directory exists if not os.path.exists(os.path.normpath(base)): ErrorDialog((_("Failure writing to %s") % base), _("Directory does not exist")) return
767a0ae51fb403854e86b60498675cea0c45c60e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/767a0ae51fb403854e86b60498675cea0c45c60e/GoogleEarthWriteKML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7029, 67, 718, 12, 2890, 4672, 3536, 10210, 279, 585, 364, 999, 598, 6124, 41, 27076, 471, 8037, 281, 6124, 41, 27076, 309, 316, 2619, 3536, 6382, 67, 1214, 273, 1140, 18, 803, 18, 123...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7029, 67, 718, 12, 2890, 4672, 3536, 10210, 279, 585, 364, 999, 598, 6124, 41, 27076, 471, 8037, 281, 6124, 41, 27076, 309, 316, 2619, 3536, 6382, 67, 1214, 273, 1140, 18, 803, 18, 123...
if is_prime(n):
elif is_prime(n):
def __init__(self, DSage, n, concurrent=10, verbosity=0, trial_division_limit=10000, name='DistributedFactor'): r""" Parameters: DSage -- an instance of a dsage connection n -- the square-free number to be factored concurrent -- number of parallel jobs to run trial_division_limit -- perform trial division up to this number before attempting ecm. Defaults to 10000 which finishes quite quickly Set to -1 to skip (if the number is known to contain no small factors) name, verbosity -- obvious """ DistributedFunction.__init__(self, DSage) self.n = n self.prime_factors = [] self.cur_B1 = 2000 self.curve_count = 50 self.concurrent = concurrent self.verbosity = verbosity self.name = name # Trial division first to peel off some factors for d in prime_range(2, trial_division_limit): while d.divides(n): self.prime_factors.append(d) n = n // d if n == 1: self.done = True if is_prime(n): # The last value might be prime self.done = True self.prime_factors.append(n) else: self.composite_factors = [n] self.outstanding_jobs = [self.qsieve_job()] for i in range(concurrent-1): self.outstanding_jobs.append(self.ecm_job())
a048f2bedae5ab705dd4778e2e8bc1eb7cd6e5a7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a048f2bedae5ab705dd4778e2e8bc1eb7cd6e5a7/dist_factor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 8678, 410, 16, 290, 16, 10020, 33, 2163, 16, 11561, 33, 20, 16, 12950, 67, 2892, 1951, 67, 3595, 33, 23899, 16, 508, 2218, 1669, 11050, 6837, 11, 4672, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8678, 410, 16, 290, 16, 10020, 33, 2163, 16, 11561, 33, 20, 16, 12950, 67, 2892, 1951, 67, 3595, 33, 23899, 16, 508, 2218, 1669, 11050, 6837, 11, 4672, ...
p = "Hello, World"
p = b"Hello, World"
def test_memmove(self): # large buffers apparently increase the chance that the memory # is allocated in high address space. a = create_string_buffer(1000000) p = "Hello, World" result = memmove(a, p, len(p)) self.failUnlessEqual(a.value, "Hello, World")
b0fa61710ee12f761e86d596666d1c66fea0c345 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/b0fa61710ee12f761e86d596666d1c66fea0c345/test_memfunctions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3917, 8501, 12, 2890, 4672, 468, 7876, 9664, 29614, 715, 10929, 326, 17920, 716, 326, 3778, 468, 353, 11977, 316, 3551, 1758, 3476, 18, 279, 273, 752, 67, 1080, 67, 4106, 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, 1842, 67, 3917, 8501, 12, 2890, 4672, 468, 7876, 9664, 29614, 715, 10929, 326, 17920, 716, 326, 3778, 468, 353, 11977, 316, 3551, 1758, 3476, 18, 279, 273, 752, 67, 1080, 67, 4106, 12, ...
email_body = loader.get_template('core/registration_email.html')
email_body = loader.get_template('core/registration_email.txt')
def form_email_about_registration(request, user, profile): email_body = loader.get_template('core/registration_email.html') activation_url = request.build_absolute_uri( reverse('epic.core.views.activate', kwargs={'activation_key': profile.activation_key})) login_url = request.build_absolute_uri(reverse('django.contrib.auth.views.login')) template_context_data = { 'user': user, 'activation_url': activation_url, 'login_url': login_url } template_context = Context(template_context_data) rendered_email = email_body.render(template_context) return rendered_email
81f700ff6e4aab5fe69fb92179d473683965917a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2706/81f700ff6e4aab5fe69fb92179d473683965917a/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 646, 67, 3652, 67, 21071, 67, 14170, 12, 2293, 16, 729, 16, 3042, 4672, 2699, 67, 3432, 273, 4088, 18, 588, 67, 3202, 2668, 3644, 19, 14170, 67, 3652, 18, 5830, 6134, 10027, 67, 718, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 646, 67, 3652, 67, 21071, 67, 14170, 12, 2293, 16, 729, 16, 3042, 4672, 2699, 67, 3432, 273, 4088, 18, 588, 67, 3202, 2668, 3644, 19, 14170, 67, 3652, 18, 5830, 6134, 10027, 67, 718, ...
result = connection.execute(s)
result = db.execute(s)
def iterConnectionIds(self): s = sa.select([self.connections.c.id]) db = self.getDb() result = connection.execute(s) for row in result: yield row[self.connections.c.id] db.close()
622d27bc5a95011edb05f63b709aaf04f62d8c31 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5028/622d27bc5a95011edb05f63b709aaf04f62d8c31/sa_connection_manager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1400, 1952, 2673, 12, 2890, 4672, 272, 273, 7864, 18, 4025, 3816, 2890, 18, 13313, 18, 71, 18, 350, 5717, 1319, 273, 365, 18, 588, 4331, 1435, 563, 273, 1319, 18, 8837, 12, 87, 13, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1400, 1952, 2673, 12, 2890, 4672, 272, 273, 7864, 18, 4025, 3816, 2890, 18, 13313, 18, 71, 18, 350, 5717, 1319, 273, 365, 18, 588, 4331, 1435, 563, 273, 1319, 18, 8837, 12, 87, 13, 3...
Called by the constructor.
Description: This is called by the constructor. [Protected, grouped under "Protected methods"]
def _fill_attributes(self): """Fills default attributes for certain elements. Called by the constructor. """
31746b2c12abc94e701d932b47560a36d5494b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10890/31746b2c12abc94e701d932b47560a36d5494b1d/sparkup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5935, 67, 4350, 12, 2890, 4672, 3536, 28688, 805, 1677, 364, 8626, 2186, 18, 225, 6507, 30, 1220, 353, 2566, 635, 326, 3885, 18, 225, 306, 15933, 16, 10303, 3613, 315, 15933, 2590, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 5935, 67, 4350, 12, 2890, 4672, 3536, 28688, 805, 1677, 364, 8626, 2186, 18, 225, 6507, 30, 1220, 353, 2566, 635, 326, 3885, 18, 225, 306, 15933, 16, 10303, 3613, 315, 15933, 2590, ...
print " * writing compiled file..."
print " * writing compiled file..."
def execute(options): if options.sourceDirectories == None or len(options.sourceDirectories) == 0: basename = os.path.basename(sys.argv[0]) print "You must define at least one source directory!" print "usage: %s [options]" % basename print "Try '%s -h' or '%s --help' to show the help message." % (basename, basename) sys.exit(1) print print " PREPARING:" print "***********************************************************************************************" print " * Loading source directory content..." # Normalizing directories i=0 for directory in options.sourceDirectories: options.sourceDirectories[i] = os.path.normpath(options.sourceDirectories[i]) i+=1 scanResult = loader.scanAll(options.sourceDirectories) sortedIncludeList = loader.getSortedList(options, scanResult) if options.outputFiles: print print " KNOWN FILES:" print "***********************************************************************************************" for key in scanResult["files"]: print " %s (%s)" % (key, scanResult["files"][key]) if options.outputModules: print print " KNOWN MODULES:" print "***********************************************************************************************" for pkg in scanResult["modules"]: print " * %s" % pkg for key in scanResult["modules"][pkg]: print " - %s" % key if options.outputList: print print " INCLUDE ORDER:" print "***********************************************************************************************" for key in sortedIncludeList: print " * %s" % key if options.copyResources: print print " COPY RESOURCES:" print "***********************************************************************************************" print " * Creating needed directories..." if options.copyResources: if options.resourceDirectory == None: print " * You must define the resource directory!" sys.exit(1) else: options.resourceDirectory = os.path.normpath(options.resourceDirectory) # Normalizing directory if not os.path.exists(options.resourceDirectory): os.makedirs(options.resourceDirectory) for fileId in sortedIncludeList: filePath = scanResult["files"][fileId] fileContent = file(filePath, "r").read() fileResourceList = loader.extractResources(fileContent) if len(fileResourceList) > 0: print " * Found %i resources in %s" % (len(fileResourceList), fileId) for fileResource in fileResourceList: resourceId = fileId + "." + fileResource resourcePath = resourceId.replace(".", os.sep) if options.verbose: print " * ResourcePath: %s" % resourcePath sourceDir = os.path.join(os.path.dirname(filePath), fileResource) destDir = os.path.join(options.resourceDirectory, resourcePath) for root, dirs, files in os.walk(sourceDir): # Filter ignored directories for ignoredDir in config.DIRIGNORE: if ignoredDir in dirs: dirs.remove(ignoredDir) # Searching for items (resource files) for itemName in files: # Generate absolute source file path itemSourcePath = os.path.join(root, itemName) # Extract relative path and directory itemRelPath = itemSourcePath.replace(sourceDir + os.sep, "") itemRelDir = os.path.dirname(itemRelPath) # Generate destination directory and file path itemDestDir = os.path.join(destDir, itemRelDir) itemDestPath = os.path.join(itemDestDir, itemName) # Check/Create destination directory if not os.path.exists(itemDestDir): os.makedirs(itemDestDir) # Copy file shutil.copyfile(itemSourcePath, itemDestPath) if options.compileSource or options.storeTokens: print print " TRANSFORMING SOURCE:" print "***********************************************************************************************" print " * Creating needed directories..." if options.storeTokens: if options.tokenDirectory == None: print " * You must define the token directory!" sys.exit(1) else: options.tokenDirectory = os.path.normpath(options.tokenDirectory) # Normalizing directory if not os.path.exists(options.tokenDirectory): os.makedirs(options.tokenDirectory) if options.compileSource or options.copyResources: if options.compileDirectory == None: print " * You must define the build directory!" sys.exit(1) else: options.compileDirectory = os.path.normpath(options.compileDirectory) # Normalizing directory if not os.path.exists(options.compileDirectory): os.makedirs(options.compileDirectory) compiledOutput = "" compressedStrings = {} compressedIndex = 0 for fileId in sortedIncludeList: print " * %s" % fileId if options.verbose: print " * reading..." fileName = scanResult["files"][fileId] fileContent = file(fileName, "r").read() fileSize = len(fileContent) / 1000.0 if options.verbose: print " * tokenizing source (%s KB)..." % fileSize tokens = tokenizer.parseStream(fileContent, fileId) if options.storeTokens: tokenString = tokenizer.convertTokensToString(tokens) tokenSize = len(tokenString) / 1000.0 if options.verbose: print " * writing tokens to file (%s KB)..." % tokenSize tokenFileName = os.path.join(options.tokenDirectory, fileId + config.TOKENEXT) tokenFile = file(tokenFileName, "w") tokenFile.write(tokenString) tokenFile.flush() tokenFile.close() if options.compressStrings: for token in tokens: if token["type"] != "string": continue compressSource = token["source"] if not compressedStrings.has_key(compressSource): compressedStrings[compressSource] = compressedIndex compressedIndex += 1 print "Compressed [%s]: %s" % (compressedIndex, compressSource) token["source"] = "qxStr[%s]" % compressedStrings[compressSource] token["detail"] = "compressed" if options.compileSource: if options.verbose: print " * compiling..." compiledFileContent = compile.compile(tokens, options.compileWithNewLines) if options.addFileIds: compiledOutput += "/* ID: " + fileId + " */\n" + compiledFileContent + "\n" else: compiledOutput += compiledFileContent compiledFileSize = len(compiledFileContent) / 1000.0 compiledFileSizeFactor = 100 - (compiledFileSize / fileSize * 100) if options.verbose: print " * compression %i%% (%s KB)" % (compiledFileSizeFactor, compiledFileSize) if options.storeSeparateScripts: if options.verbose: print " * writing compiled file..." compiledSeparateFileName = os.path.join(options.compileDirectory, fileId.replace(".", os.path.sep) + config.JSEXT) compiledSeparateFileDir = os.path.dirname(compiledSeparateFileName) # Check/Create destination directory if not os.path.exists(compiledSeparateFileDir): os.makedirs(compiledSeparateFileDir) compiledSeparateFile = file(compiledSeparateFileName, "w") compiledSeparateFile.write(compiledFileContent) compiledSeparateFile.flush() compiledSeparateFile.close() if options.compileSource: compiledOutputFileName = os.path.join(options.compileDirectory, options.compileOutputName) compiledOutputFileDir = os.path.dirname(compiledOutputFileName) # Check/Create destination directory if not os.path.exists(compiledOutputFileDir): os.makedirs(compiledOutputFileDir) compiledOutputFile = file(compiledOutputFileName, "w") compiledOutputFile.write(compiledOutput) compiledOutputFile.flush() compiledOutputFile.close()
85aacefb36d60936c37d08520d1b27007e812a55 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/85aacefb36d60936c37d08520d1b27007e812a55/build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 2116, 4672, 309, 702, 18, 3168, 13071, 422, 599, 578, 562, 12, 2116, 18, 3168, 13071, 13, 422, 374, 30, 4882, 273, 1140, 18, 803, 18, 13909, 12, 9499, 18, 19485, 63, 20, 57...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2116, 4672, 309, 702, 18, 3168, 13071, 422, 599, 578, 562, 12, 2116, 18, 3168, 13071, 13, 422, 374, 30, 4882, 273, 1140, 18, 803, 18, 13909, 12, 9499, 18, 19485, 63, 20, 57...
_widgetTest = '''\ <html><body> The widgets on this page were created dynamically on the fly by a custom wxTagHandler found in wxPython.lib.wxpTag. <hr> <center> <wxp class="wxButton" width="50%"> <param name="label" value="It works!"> <param name="id" value="wxID_OK"> </wxp> </center> <hr> after </body></html> '''
def runTest(frame, nb, log): win = TestHtmlPanel(nb, frame, log) return win
ae920857a74f858f98d0d68f55f6a77de0d8f2cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/ae920857a74f858f98d0d68f55f6a77de0d8f2cf/wxHtmlWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 4709, 12, 3789, 16, 4264, 16, 613, 4672, 5657, 273, 7766, 4353, 5537, 12, 6423, 16, 2623, 16, 613, 13, 327, 5657, 282, 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, 1086, 4709, 12, 3789, 16, 4264, 16, 613, 4672, 5657, 273, 7766, 4353, 5537, 12, 6423, 16, 2623, 16, 613, 13, 327, 5657, 282, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
title_match = perform_regex_search_upon_line_with_pattern_list(docbody[x], title_patterns)
title_match = \ perform_regex_search_upon_line_with_pattern_list(docbody[x], \ title_patterns)
def find_reference_section(docbody): """Search in document body for its reference section. More precisely, find the first line of the reference section. Effectively, the function starts at the end of a document and works backwards, line-by-line, looking for the title of a reference section. It stops when (if) it finds something that it considers to be the first line of a reference section. @param docbody: (list) of strings - the full document body. @return: (dictionary) : { 'start_line' : (integer) - index in docbody of 1st reference line, 'title_string' : (string) - title of the reference section. 'marker' : (string) - the marker of the first reference line, 'marker_pattern' : (string) - regexp string used to find the marker, 'title_marker_same_line' : (integer) - flag to indicate whether the reference section title was on the same line as the first reference line's marker or not. 1 if it was; 0 if not. } Much of this information is used by later functions to rebuild a reference section. -- OR -- (None) - when the reference section could not be found. """ ref_start_line = ref_title = ref_line_marker = ref_line_marker_ptn = None title_marker_same_line = found_part = None if len(docbody) > 0: title_patterns = get_reference_section_title_patterns() marker_patterns = get_reference_line_numeration_marker_patterns() p_num = sre.compile(unicode(r'(\d+)')) ## Try to find refs section title: x = len(docbody) - 1 found_title = 0 while x >= 0 and not found_title: title_match = perform_regex_search_upon_line_with_pattern_list(docbody[x], title_patterns) if title_match is not None: temp_ref_start_line = x temp_title = title_match.group('title') mk_with_title_ptns = get_reference_line_numeration_marker_patterns(temp_title) mk_with_title_match = perform_regex_search_upon_line_with_pattern_list(docbody[x], mk_with_title_ptns) if mk_with_title_match is not None: mk = mk_with_title_match.group('mark') mk_ptn = mk_with_title_match.re.pattern m_num = p_num.search(mk) if m_num is not None and int(m_num.group(0)) == 1: # Mark found. found_title = 1 ref_title = temp_title ref_line_marker = mk ref_line_marker_ptn = mk_ptn ref_start_line = temp_ref_start_line title_marker_same_line = 1 else: found_part = 1 ref_start_line = temp_ref_start_line ref_line_marker = mk ref_line_marker_ptn = mk_ptn ref_title = temp_title title_marker_same_line = 1 else: try: y = x + 1 ## Move past blank lines while docbody[y].isspace() and y < len(docbody): y = y + 1 ## Is this line numerated like a reference line? mark_match = perform_regex_match_upon_line_with_pattern_list(docbody[y], marker_patterns) if mark_match is not None: ## Ref line found. What is it? title_marker_same_line = None mark = mark_match.group('mark') mk_ptn = mark_match.re.pattern m_num = p_num.search(mark) if m_num is not None and int(m_num.group(0)) == 1: # 1st ref truly found ref_start_line = temp_ref_start_line ref_line_marker = mark ref_line_marker_ptn = mk_ptn ref_title = temp_title found_title = 1 elif m_num is not None and m_num.groups(0) != 1: found_part = 1 ref_start_line = temp_ref_start_line ref_line_marker = mark ref_line_marker_ptn = mk_ptn ref_title = temp_title else: if found_part: found_title = 1 else: found_part = 1 ref_start_line = temp_ref_start_line ref_title=temp_title ref_line_marker = mark ref_line_marker_ptn = mk_ptn else: ## No numeration if found_part: found_title = 1 else: found_part = 1 ref_start_line = temp_ref_start_line ref_title=temp_title except IndexError: ## References section title was on last line for some reason. Ignore pass x = x - 1 if ref_start_line is not None: ## return dictionary containing details of reference section: ref_sectn_details = { 'start_line' : ref_start_line, 'title_string' : ref_title, 'marker' : ref_line_marker, 'marker_pattern' : ref_line_marker_ptn, 'title_marker_same_line' : (title_marker_same_line is not None and 1) or (0) } else: ref_sectn_details = None return ref_sectn_details
afd852f45332d11ac027b8d47ce1a922ce7f2cc6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/afd852f45332d11ac027b8d47ce1a922ce7f2cc6/refextract.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 6180, 67, 3464, 12, 2434, 3432, 4672, 3536, 2979, 316, 1668, 1417, 364, 2097, 2114, 2442, 18, 16053, 13382, 291, 2357, 16, 1104, 326, 1122, 980, 434, 326, 2114, 2442, 18, 30755...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1104, 67, 6180, 67, 3464, 12, 2434, 3432, 4672, 3536, 2979, 316, 1668, 1417, 364, 2097, 2114, 2442, 18, 16053, 13382, 291, 2357, 16, 1104, 326, 1122, 980, 434, 326, 2114, 2442, 18, 30755...
0x2018: ur'`', 0x2019: ur"'",
0x2018: ur'\textquoteleft{}', 0x2019: ur'\textquoteright{}',
def encode(self, text): """Return text with 'problematic' characters escaped.
839863406d16ba6236fa9348a1de79551ca2adf1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1532/839863406d16ba6236fa9348a1de79551ca2adf1/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 296, 18968, 2126, 11, 3949, 8345, 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, ...
[ 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 990, 977, 598, 296, 18968, 2126, 11, 3949, 8345, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
if e.args[0] in (2006, 2013): if c == 2:
if e.args[0] in (MySQLdb.constants.CR.SERVER_GONE_ERROR, MySQLdb.constants.CR.SERVER_LOST): if count == 2:
def _executeRetry(self, conn, cursor, query): # When a server connection is lost and a query is attempted, most of # the time the query will raise a SERVER_LOST exception, then at the # second attempt to execute it, the mysql lib will reconnect and # succeed. However is a few cases, the first attempt raises the # SERVER_GONE exception, the second attempt the SERVER_LOST exception # and only the third succeeds. Thus the 3 in the loop count. # If it doesn't reconnect even after 3 attempts, while the database is # up and running, it is because a 5.0.x (or newer) server is used # which no longer permits autoreconnects by default. In their case a # reconnect flag must be set when making the connection to indicate # that autoreconnecting is desired and the python-mysqldb module # doesn't set this flag. for c in range(0, 3): try: if self.need_unicode: # For MysqlDB 1.2.1 and later, we go # encoding->unicode->charset (in the mysql db) myquery = unicode(query, self.encoding) return cursor.execute(myquery) else: return cursor.execute(query) except MySQLdb.OperationalError, e: if e.args[0] in (2006, 2013): # SERVER_GONE or SERVER_LOST error if c == 2: raise OperationalError(ErrorMessage(e)) if self.debug: self.printDebug(conn, str(e), 'ERROR') else: raise OperationalError(ErrorMessage(e)) except MySQLdb.IntegrityError, e: msg = ErrorMessage(e) if e.args[0] == 1062: raise DuplicateEntryError(msg) else: raise IntegrityError(msg) except MySQLdb.InternalError, e: raise InternalError(ErrorMessage(e)) except MySQLdb.ProgrammingError, e: raise ProgrammingError(ErrorMessage(e)) except MySQLdb.DataError, e: raise DataError(ErrorMessage(e)) except MySQLdb.NotSupportedError, e: raise NotSupportedError(ErrorMessage(e)) except MySQLdb.DatabaseError, e: raise DatabaseError(ErrorMessage(e)) except MySQLdb.InterfaceError, e: raise InterfaceError(ErrorMessage(e)) except MySQLdb.Warning, e: raise Warning(ErrorMessage(e)) except MySQLdb.Error, e: raise Error(ErrorMessage(e))
82930788c7ee529eadab1c33ef5177db0c00aef1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8798/82930788c7ee529eadab1c33ef5177db0c00aef1/mysqlconnection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8837, 7539, 12, 2890, 16, 1487, 16, 3347, 16, 843, 4672, 468, 5203, 279, 1438, 1459, 353, 13557, 471, 279, 843, 353, 18121, 16, 4486, 434, 468, 326, 813, 326, 843, 903, 1002, 279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8837, 7539, 12, 2890, 16, 1487, 16, 3347, 16, 843, 4672, 468, 5203, 279, 1438, 1459, 353, 13557, 471, 279, 843, 353, 18121, 16, 4486, 434, 468, 326, 813, 326, 843, 903, 1002, 279,...
e, self.host, self.port, self.db, self.user, self.password)
e, self.host, self.port, self.db, self.user, self.password)
def makeConnection(self): try: conn = self.module.connect(host=self.host, port=self.port, db=self.db, user=self.user, passwd=self.password, **self.kw) except self.module.OperationalError, e: raise OperationalError( "%s; used connection string: host=%s, port=%s, db=%s, user=%s, pwd=%s" % ( e, self.host, self.port, self.db, self.user, self.password) )
45b9e87402108cc076db542bb7aac9d91d00615c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6718/45b9e87402108cc076db542bb7aac9d91d00615c/mysqlconnection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1952, 12, 2890, 4672, 775, 30, 1487, 273, 365, 18, 2978, 18, 3612, 12, 2564, 33, 2890, 18, 2564, 16, 1756, 33, 2890, 18, 655, 16, 1319, 33, 2890, 18, 1966, 16, 729, 33, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1952, 12, 2890, 4672, 775, 30, 1487, 273, 365, 18, 2978, 18, 3612, 12, 2564, 33, 2890, 18, 2564, 16, 1756, 33, 2890, 18, 655, 16, 1319, 33, 2890, 18, 1966, 16, 729, 33, 2890, ...
'configlet_url':'portal_'+c.getName().lower()+configlet_view,
'configlet_url':tool_instance_name+configlet_view,
def generateStdFiles(self, target,projectName,generatedModules): #generates __init__.py, Extensions/Install.py and the skins directory #the result is a QuickInstaller installable product
d02f24e32990e39040efa4daf92ccd808f091ea7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/d02f24e32990e39040efa4daf92ccd808f091ea7/ArchGenXML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 10436, 2697, 12, 2890, 16, 1018, 16, 4406, 461, 16, 11168, 7782, 4672, 468, 3441, 815, 1001, 2738, 25648, 2074, 16, 23105, 19, 6410, 18, 2074, 471, 326, 4343, 2679, 1867, 468, 5787...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2103, 10436, 2697, 12, 2890, 16, 1018, 16, 4406, 461, 16, 11168, 7782, 4672, 468, 3441, 815, 1001, 2738, 25648, 2074, 16, 23105, 19, 6410, 18, 2074, 471, 326, 4343, 2679, 1867, 468, 5787...
url = self.parent.url
url = self.url
def download_api_data(self): url = self.parent.url id_regex = re.compile("http://.*netload\.in/(?:datei(.*?)(?:\.htm|/)|index.php?id=10&file_id=)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} if src == "unknown_server_data": self.api_data = False self.html[0] = self.req.load(self.parent.url, cookies=False) elif not src == "unknown file_data": lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] self.api_data["filename"] = lines[1] self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') self.api_data["status"] = lines[3] self.api_data["checksum"] = lines[4].strip() else: self.api_data["exists"] = False
0f1f260c5cd98839aafb3e47261e62b742fe3f8a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/0f1f260c5cd98839aafb3e47261e62b742fe3f8a/NetloadIn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 67, 2425, 67, 892, 12, 2890, 4672, 880, 273, 365, 18, 718, 612, 67, 7584, 273, 283, 18, 11100, 2932, 2505, 2207, 4509, 2758, 945, 5834, 267, 19, 6503, 712, 77, 21110, 15599, 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, 4224, 67, 2425, 67, 892, 12, 2890, 4672, 880, 273, 365, 18, 718, 612, 67, 7584, 273, 283, 18, 11100, 2932, 2505, 2207, 4509, 2758, 945, 5834, 267, 19, 6503, 712, 77, 21110, 15599, 18, ...
process.cvs_entry_time = XLALUTCToGPS(time.strptime(kwargs["cvs_entry_time"], "%Y/%m/%d %H:%M:%S")).seconds
try: process.cvs_entry_time = XLALUTCToGPS(time.strptime(kwargs["cvs_entry_time"], "%Y-%m-%d %H:%M:%S +0000")).seconds except ValueError: process.cvs_entry_time = XLALUTCToGPS(time.strptime(kwargs["cvs_entry_time"], "%Y/%m/%d %H:%M:%S")).seconds
def append_process(*args, **kwargs): """ Identical to the append_process() function in glue.ligolw.utils.process except uses LAL to convert UTC to GPS time to get the leap seconds correct. """ process = ligolwprocess.append_process(*args, **kwargs) # FIXME: remove the "" case when the git metadata business is # sorted out if "cvs_entry_time" in kwargs and kwargs["cvs_entry_time"] is not None and kwargs["cvs_entry_time"] != "": process.cvs_entry_time = XLALUTCToGPS(time.strptime(kwargs["cvs_entry_time"], "%Y/%m/%d %H:%M:%S")).seconds process.start_time = XLALUTCToGPS(time.gmtime()).seconds return process
07708144cf9803298e006cab7d5456f57c6e648b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/07708144cf9803298e006cab7d5456f57c6e648b/llwapp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 67, 2567, 30857, 1968, 16, 2826, 4333, 4672, 3536, 13128, 1706, 358, 326, 714, 67, 2567, 1435, 445, 316, 17960, 18, 80, 360, 355, 91, 18, 5471, 18, 2567, 1335, 4692, 511, 1013, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 714, 67, 2567, 30857, 1968, 16, 2826, 4333, 4672, 3536, 13128, 1706, 358, 326, 714, 67, 2567, 1435, 445, 316, 17960, 18, 80, 360, 355, 91, 18, 5471, 18, 2567, 1335, 4692, 511, 1013, 35...
dictstr_template = N_('%d dictionary', '%d dictionaries', dcount)
dictstr_template = gettext.ngettext('%d dictionary', '%d dictionaries', dcount)
def create_dict_title(self): dcount = len(set((d.uuid for d in self.dictionaries))) vcount = len(self.dictionaries) if vcount == 0: return _('No dictionaries') volumestr_template = N_('%d volume', '%d volumes', vcount) volumestr = volumestr_template % vcount dictstr_template = N_('%d dictionary', '%d dictionaries', dcount) dictstr = dictstr_template % dcount return '%s (%s)' % (dictstr, volumestr)
85eea32c37c988d2f7946d41041b85d9216497f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14305/85eea32c37c988d2f7946d41041b85d9216497f0/ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 1576, 67, 2649, 12, 2890, 4672, 302, 1883, 273, 562, 12, 542, 12443, 72, 18, 7080, 364, 302, 316, 365, 18, 72, 14336, 20349, 331, 1883, 273, 562, 12, 2890, 18, 72, 14336, 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, 752, 67, 1576, 67, 2649, 12, 2890, 4672, 302, 1883, 273, 562, 12, 542, 12443, 72, 18, 7080, 364, 302, 316, 365, 18, 72, 14336, 20349, 331, 1883, 273, 562, 12, 2890, 18, 72, 14336, 13...
if not node:
if not patchname and not node:
def makepatch(patch, idx, total): desc = [] node = None body = '' for line in patch: if line.startswith('#'): if line.startswith('# Node ID'): node = line.split()[-1] continue if line.startswith('diff -r') or line.startswith('diff --git'): break desc.append(line) if not node: raise ValueError
5f8789270dde0ad495a09fe99904cd9d88a6585b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/5f8789270dde0ad495a09fe99904cd9d88a6585b/patchbomb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 881, 505, 12, 2272, 16, 2067, 16, 2078, 4672, 3044, 273, 5378, 756, 273, 599, 1417, 273, 875, 364, 980, 316, 4729, 30, 309, 980, 18, 17514, 1918, 2668, 10038, 4672, 309, 980, 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, 29796, 881, 505, 12, 2272, 16, 2067, 16, 2078, 4672, 3044, 273, 5378, 756, 273, 599, 1417, 273, 875, 364, 980, 316, 4729, 30, 309, 980, 18, 17514, 1918, 2668, 10038, 4672, 309, 980, 18...
[dist, bin, info] = hist(list,bins,bottom=None,\
[dist, bin, info] = pylab.hist(inputlist,bins,bottom=None,\
def makeHistogram(list,distribution,opts,percentiles=None,candidate=None): parameter = distribution.split('-')[0] # set up the bin boundaries for the histogram min_val = eval('opts.' + parameter + '_min') max_val = eval('opts.' + parameter + '_max') nbins = eval('opts.' + parameter + '_bins') if percentiles: max_percentile = float( int(percentiles[2]) ) + 1.0 max_val = max(max_val,max_percentile) if candidate: max_val = max(max_val,candidate) step = (float(max_val) - float(min_val))/float(nbins) bins = arange(min_val - step/2., max_val + step/2., step) if len(list): # compute the histogram values [dist, bin, info] = hist(list,bins,bottom=None,\ align='edge', orientation='vertical', width=None) return dist,bin
3a58220c8f9b9cb9764dcae94b5a4569bed72c68 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/3a58220c8f9b9cb9764dcae94b5a4569bed72c68/analyseQscan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 12874, 12, 1098, 16, 16279, 16, 4952, 16, 8849, 1449, 33, 7036, 16, 19188, 33, 7036, 4672, 225, 1569, 273, 7006, 18, 4939, 2668, 17, 6134, 63, 20, 65, 225, 468, 444, 731, 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, 1221, 12874, 12, 1098, 16, 16279, 16, 4952, 16, 8849, 1449, 33, 7036, 16, 19188, 33, 7036, 4672, 225, 1569, 273, 7006, 18, 4939, 2668, 17, 6134, 63, 20, 65, 225, 468, 444, 731, 326, ...
except Exception, e: log(netsvc.LOG_WARNING,"Could not unlink %s, %s" %(fname, e))
except Exception: self.__logger.exception("Could not unlink %s", fname)
def doIndex(self,content, filename=None, content_type=None, realfname = None, debug=False): fobj = None fname = None mime = None if content_type and self.mimes.has_key(content_type): mime = content_type fobj = self.mimes[content_type] elif filename: bname,ext = os.path.splitext(filename) if self.exts.has_key(ext): fobj = self.exts[ext] mime = fobj._getDefMime(ext) if content_type and not fobj: mime,fobj = mime_match(content_type, self.mimes) if not fobj: try: if realfname : fname = realfname else: bname,ext = os.path.splitext(filename) fd, fname = tempfile.mkstemp(suffix=ext) os.write(fd, content) os.close(fd) fp = Popen(['file','-b','--mime-type',fname], shell=False, stdout=PIPE).stdout result = fp.read() fp.close() mime2 = result.strip() log(netsvc.LOG_DEBUG,"File gave us: %s" % mime2) # Note that the temporary file still exists now. mime,fobj = mime_match(mime2, self.mimes) if not mime: mime = mime2 except Exception, e: log(netsvc.LOG_WARNING,"Cannot determine mime type: %s" % str(e)) try: if fobj: res = (mime, fobj.indexContent(content,filename,fname or realfname) ) else: log(netsvc.LOG_DEBUG,"Have no object, return (%s, None)" % mime) res = (mime, None ) except Exception, e: log(netsvc.LOG_WARNING,"Could not index file, %s" % e) res = None # If we created a tmp file, unlink it now if not realfname and fname: try: os.unlink(fname) except Exception, e: log(netsvc.LOG_WARNING,"Could not unlink %s, %s" %(fname, e)) return res
cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/cfd0ae1f9084cbd1bf989d9eb75150c37d1b4b52/content_index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 1016, 12, 2890, 16, 1745, 16, 1544, 33, 7036, 16, 913, 67, 723, 33, 7036, 16, 2863, 12749, 273, 599, 16, 1198, 33, 8381, 4672, 24705, 273, 599, 5299, 273, 599, 4892, 273, 599, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1016, 12, 2890, 16, 1745, 16, 1544, 33, 7036, 16, 913, 67, 723, 33, 7036, 16, 2863, 12749, 273, 599, 16, 1198, 33, 8381, 4672, 24705, 273, 599, 5299, 273, 599, 4892, 273, 599, 3...
To customize how the worker, server, or client behaves, you can look for their respective conf files in DOT_SAGE/dsage. The configuration file should be self explanatory.
See the $DOT_SAGE/dsage directory.
def spawn(cmd, verbose=True): """ Spawns a process and registers it with the SAGE cleaner. """ null = open('/dev/null', 'a') proc = '%s/%s' % (SAGE_ROOT + '/local/bin', cmd) process = subprocess.Popen(proc, shell=True, stdout=null, stderr=null) sage.interfaces.cleaner.cleaner(process.pid, cmd) if verbose: print 'Spawned %s (pid = %s)\n' % (cmd, process.pid)
0b3cafd8d82dd046c82b6656e34fb3c659e4046e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0b3cafd8d82dd046c82b6656e34fb3c659e4046e/dsage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12560, 12, 4172, 16, 3988, 33, 5510, 4672, 3536, 5878, 2219, 2387, 279, 1207, 471, 10285, 518, 598, 326, 348, 2833, 25933, 18, 225, 3536, 225, 446, 273, 1696, 2668, 19, 5206, 19, 2011, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12560, 12, 4172, 16, 3988, 33, 5510, 4672, 3536, 5878, 2219, 2387, 279, 1207, 471, 10285, 518, 598, 326, 348, 2833, 25933, 18, 225, 3536, 225, 446, 273, 1696, 2668, 19, 5206, 19, 2011, ...
for jdlName in 'Site': jdlValue = classAdJob.getAttributeString( jdlName ) if jdlValue: jobAttrNames.append( jdlName ) jobAttrValues.append( jdlValue )
site = classAdJob.getAttributeString('Site') if not site: site = 'ANY' jobAttrNames.append( 'Site' ) jobAttrValues.append( site )
def rescheduleJob (self, jobID): """ Reschedule the given job to run again from scratch. Retain the already defined parameters in the parameter Attic """ # Check Verified Flag result = self.getJobAttributes( jobID, ['Status','MinorStatus','VerifiedFlag','RescheduleCounter', 'Owner','OwnerDN','OwnerGroup','DIRACSetup'] ) if result['OK']: resultDict = result['value'] else: return S_ERROR('JobDB.getJobAttributes: can not retrieve job attributes')
217021ab63329dc922bb37e596caca5cf0d30ec7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/217021ab63329dc922bb37e596caca5cf0d30ec7/JobDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 400, 2847, 2278, 261, 2890, 16, 28913, 4672, 3536, 1124, 2847, 326, 864, 1719, 358, 1086, 3382, 628, 15289, 18, 17100, 530, 326, 1818, 2553, 1472, 316, 326, 1569, 6020, 335, 3536, 468, 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, 400, 2847, 2278, 261, 2890, 16, 28913, 4672, 3536, 1124, 2847, 326, 864, 1719, 358, 1086, 3382, 628, 15289, 18, 17100, 530, 326, 1818, 2553, 1472, 316, 326, 1569, 6020, 335, 3536, 468, 2...
files.append(f)
files.append((f,f))
def _addResources(self): "Add Welcome/ReadMe/License files, .lproj folders and scripts."
18f917dac1d0c4373b8f3ea1de666a7605f47d91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/18f917dac1d0c4373b8f3ea1de666a7605f47d91/buildpkg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, 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, 389, 1289, 3805, 12, 2890, 4672, 315, 986, 678, 16312, 19, 1994, 4667, 19, 13211, 1390, 16, 263, 80, 17995, 9907, 471, 8873, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
FL_Coord, STRING],
FL_Coord, STRING],
def fl_create_roundbutton(type, x, y, w, h, label): """ fl_create_roundbutton(type, x, y, w, h, label) -> object """ retval = _fl_create_roundbutton(type, x, y, w, h, label) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 2260, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, ...
def read(self,filename): """ read in a cache object from filename """ c = [CacheEntry(line) for line in open(filename)] return Cache(c) def write(self,filename): """ write a cache object to filename as a lal cache file """ fp = open(filename,'w')
entry_class = CacheEntry def fromfile(cls, fileobj, coltype=LIGOTimeGPS): """ Return a Cache object whose entries are read from an open file. """ c = [cls.entry_class(line, coltype=coltype) for line in fileobj] return cls(c) fromfile = classmethod(fromfile) def fromfilenames(cls, filenames, coltype=LIGOTimeGPS): """ Read Cache objects from the files named and concatenate the results into a single Cache. See pylal.itertools.uniq if you require uniqueness. """ cache = cls() for filename in filenames: cache.extend(cls.fromfile(open(filename), coltype=coltype)) return cache fromfilenames = classmethod(fromfilenames) def tofile(self, fileobj): """ write a cache object to the fileobj as a lal cache file """
def read(self,filename): """ read in a cache object from filename """ c = [CacheEntry(line) for line in open(filename)] return Cache(c)
078bd3cbb2fb71f825e2788f3373a4c6a737baa9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/078bd3cbb2fb71f825e2788f3373a4c6a737baa9/lal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 12, 2890, 16, 3459, 4672, 3536, 855, 316, 279, 1247, 733, 628, 1544, 3536, 276, 273, 306, 27630, 12, 1369, 13, 364, 980, 316, 1696, 12, 3459, 25887, 327, 4379, 12, 71, 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, 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, 855, 12, 2890, 16, 3459, 4672, 3536, 855, 316, 279, 1247, 733, 628, 1544, 3536, 276, 273, 306, 27630, 12, 1369, 13, 364, 980, 316, 1696, 12, 3459, 25887, 327, 4379, 12, 71, 13, 2, -1...
else: break
def ExpireRequests(self): """Delete all the expired requests.
71e114da4ce07bcbe76516069b621ac459da3d69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/71e114da4ce07bcbe76516069b621ac459da3d69/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7784, 577, 6421, 12, 2890, 4672, 3536, 2613, 777, 326, 7708, 3285, 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, 7784, 577, 6421, 12, 2890, 4672, 3536, 2613, 777, 326, 7708, 3285, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
signal.signal(signal.SIGHUP, signal.SIG_IGN)
signal.signal(signal.SIGUSR1, signal.SIG_IGN)
def ttyloop(task, nodeset, gather, timeout, label, verbosity): """Manage the interactive prompt to run command""" has_readline = False if task.info("USER_interactive"): assert sys.stdin.isatty() readline_avail = False try: import readline readline_setup() readline_avail = True except ImportError: pass if verbosity >= VERB_STD: print "Enter 'quit' to leave this interactive mode" rc = 0 ns = NodeSet(nodeset) ns_info = True cmd = "" while task.info("USER_running") or cmd.lower() != 'quit': try: if task.info("USER_interactive") and not task.info("USER_running"): if ns_info: print "Working with nodes: %s" % ns ns_info = False prompt = "clush> " else: prompt = "" cmd = raw_input(prompt) except EOFError: print return except UpdatePromptException: if task.info("USER_interactive"): continue return except KeyboardInterrupt, e: signal.signal(signal.SIGHUP, signal.SIG_IGN) if gather: # Suspend task, so we can safely access its data from # the main thread suspended = task.suspend() print_warn = False # Display command output, but cannot order buffers by rc for buffer, nodelist in task.iter_buffers(): if not print_warn: print_warn = True print >>sys.stderr, "Warning: Caught keyboard interrupt!" print "-" * 15 print NodeSet.fromlist(nodelist) print "-" * 15 print buffer # Return code handling ns_ok = NodeSet() for rc, nodeliset in task.iter_retcodes(): ns_ok.add(NodeSet.fromlist(nodelist)) if rc != 0: # Display return code if not ok ( != 0) ns = NodeSet.fromlist(nodelist) print >>sys.stderr, \ "clush: %s: exited with exit code %s" % (ns, rc) # Add uncompleted nodeset to exception object e.uncompleted_nodes = ns - ns_ok # Display nodes that didn't answer within command timeout delay if task.num_timeout() > 0: print >>sys.stderr, "clush: %s: command timeout" % \ NodeSet.fromlist(task.iter_keys_timeout()) raise e if task.info("USER_running"): ns_reg, ns_unreg = NodeSet(), NodeSet() for c in task._engine.clients(): if c.registered: ns_reg.add(c.key) else: ns_unreg.add(c.key) if ns_unreg: pending = "\nclush: pending(%d): %s" % (len(ns_unreg), ns_unreg) else: pending = "" print >>sys.stderr, "clush: interrupt (^C to abort task)\n" \ "clush: in progress(%d): %s%s" % (len(ns_reg), ns_reg, pending) else: cmdl = cmd.lower() try: ns_info = True if cmdl.startswith('+'): ns.update(cmdl[1:]) elif cmdl.startswith('-'): ns.difference_update(cmdl[1:]) elif cmdl.startswith('@'): ns = NodeSet(cmdl[1:]) elif cmdl == '=': gather = not gather if verbosity >= VERB_STD: if gather: print "Switching to gathered output format" else: print "Switching to standard output format" ns_info = False continue elif not cmdl.startswith('?'): # if ?, just print ns_info ns_info = False except NodeSetParseError: print >>sys.stderr, "clush: nodeset parse error (ignoring)" if ns_info: continue if cmdl.startswith('!'): run_command(task, cmd[1:], None, gather, timeout, None, verbosity) elif cmdl != "quit": if not cmd: continue if readline_avail: readline.write_history_file(get_history_file()) run_command(task, cmd, ns, gather, timeout, label, verbosity) return rc
b1a858775a0c2d9702d6d8c6329507066a5d4dd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11479/b1a858775a0c2d9702d6d8c6329507066a5d4dd6/clush.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21520, 6498, 12, 4146, 16, 2199, 278, 16, 11090, 16, 2021, 16, 1433, 16, 11561, 4672, 3536, 21258, 326, 12625, 6866, 358, 1086, 1296, 8395, 711, 67, 896, 1369, 273, 1083, 309, 1562, 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, 21520, 6498, 12, 4146, 16, 2199, 278, 16, 11090, 16, 2021, 16, 1433, 16, 11561, 4672, 3536, 21258, 326, 12625, 6866, 358, 1086, 1296, 8395, 711, 67, 896, 1369, 273, 1083, 309, 1562, 18, ...
os.system("git commit -a -m '%s' %s %s" % (msg, opts, options.files))
os.system("git commit -a -m '%s' %s %s" % (options.name, options.edit, options.files))
def __init__(self): self.name = None self.all = None self.help = False self.files = ""
5add7fca73485e5351d7d20e84c1174f86ef00dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11934/5add7fca73485e5351d7d20e84c1174f86ef00dd/dg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 365, 18, 454, 273, 599, 365, 18, 5201, 273, 1083, 365, 18, 2354, 273, 1408, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 365, 18, 454, 273, 599, 365, 18, 5201, 273, 1083, 365, 18, 2354, 273, 1408, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
class textcolor(Command): args = 'color:str self'
class definecolor(Command): args = 'name:str model:str color:str'
def latex2htmlcolor(arg): if ',' in arg: red, green, blue = [float(x) for x in arg.split(',')] red = min(int(red * 255), 255) green = min(int(green * 255), 255) blue = min(int(blue * 255), 255) else: try: red = green = blue = float(arg) except ValueError: return arg.strip() return '#%.2X%.2X%.2X' % (red, green, blue)
761807bbf64f0d9834ce7ee3ce2e439f577851f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7864/761807bbf64f0d9834ce7ee3ce2e439f577851f1/color.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25079, 22, 2620, 3266, 12, 3175, 4672, 309, 3316, 316, 1501, 30, 1755, 16, 10004, 16, 8024, 273, 306, 5659, 12, 92, 13, 364, 619, 316, 1501, 18, 4939, 12, 2187, 6134, 65, 1755, 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, 25079, 22, 2620, 3266, 12, 3175, 4672, 309, 3316, 316, 1501, 30, 1755, 16, 10004, 16, 8024, 273, 306, 5659, 12, 92, 13, 364, 619, 316, 1501, 18, 4939, 12, 2187, 6134, 65, 1755, 273, ...
return value
return b''.join(value)
def _read_chunked(self, amt): assert self.chunked != _UNKNOWN chunk_left = self.chunk_left value = b""
10def068cb2957d319b77f5465de2d1f38df3989 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/10def068cb2957d319b77f5465de2d1f38df3989/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 896, 67, 6551, 329, 12, 2890, 16, 25123, 4672, 1815, 365, 18, 6551, 329, 480, 389, 14737, 2441, 67, 4482, 273, 365, 18, 6551, 67, 4482, 460, 273, 324, 3660, 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, 1, 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, 389, 896, 67, 6551, 329, 12, 2890, 16, 25123, 4672, 1815, 365, 18, 6551, 329, 480, 389, 14737, 2441, 67, 4482, 273, 365, 18, 6551, 67, 4482, 460, 273, 324, 3660, 2, -100, -100, -100, ...
Constant polynomials coerce into finite fields: sage: from sage.rings.finite_field_ext_pari import FiniteField_ext_pari sage: R = QQ['x']
Univariate polynomials coerce into finite fields by evaluating the polynomial at the field's generator: sage: from sage.rings.finite_field_ext_pari import FiniteField_ext_pari sage: R.<x> = QQ[]
def __call__(self, x): r""" Coerce x into the finite field. INPUT: x -- object
5c9f17a7ae7db46040eafbff2d7aa9efa9bfb829 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5c9f17a7ae7db46040eafbff2d7aa9efa9bfb829/finite_field_ext_pari.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 4672, 436, 8395, 7695, 2765, 619, 1368, 326, 25922, 652, 18, 225, 12943, 30, 619, 1493, 733, 2, 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, 1001, 1991, 972, 12, 2890, 16, 619, 4672, 436, 8395, 7695, 2765, 619, 1368, 326, 25922, 652, 18, 225, 12943, 30, 619, 1493, 733, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
Variable.__init__(self,name,descr)
Variable.__init__(self,name,None,descr)
def __init__(self,name,descr=None): Variable.__init__(self,name,descr)
a32fd692dd1e30de835cd0c6d09d9bec8f3ccf92 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/a32fd692dd1e30de835cd0c6d09d9bec8f3ccf92/dws.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 529, 16, 28313, 33, 7036, 4672, 7110, 16186, 2738, 972, 12, 2890, 16, 529, 16, 28313, 13, 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, 1001, 2738, 972, 12, 2890, 16, 529, 16, 28313, 33, 7036, 4672, 7110, 16186, 2738, 972, 12, 2890, 16, 529, 16, 28313, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if prog <> self.prog:
if prog != self.prog:
def handle(self, call): # Don't use unpack_header but parse the header piecewise # XXX I have no idea if I am using the right error responses! self.unpacker.reset(call) self.packer.reset() xid = self.unpacker.unpack_uint() self.packer.pack_uint(xid) temp = self.unpacker.unpack_enum() if temp <> CALL: return None # Not worthy of a reply self.packer.pack_uint(REPLY) temp = self.unpacker.unpack_uint() if temp <> RPCVERSION: self.packer.pack_uint(MSG_DENIED) self.packer.pack_uint(RPC_MISMATCH) self.packer.pack_uint(RPCVERSION) self.packer.pack_uint(RPCVERSION) return self.packer.get_buf() self.packer.pack_uint(MSG_ACCEPTED) self.packer.pack_auth((AUTH_NULL, make_auth_null())) prog = self.unpacker.unpack_uint() if prog <> self.prog: self.packer.pack_uint(PROG_UNAVAIL) return self.packer.get_buf() vers = self.unpacker.unpack_uint() if vers <> self.vers: self.packer.pack_uint(PROG_MISMATCH) self.packer.pack_uint(self.vers) self.packer.pack_uint(self.vers) return self.packer.get_buf() proc = self.unpacker.unpack_uint() methname = 'handle_' + repr(proc) try: meth = getattr(self, methname) except AttributeError: self.packer.pack_uint(PROC_UNAVAIL) return self.packer.get_buf() cred = self.unpacker.unpack_auth() verf = self.unpacker.unpack_auth() try: meth() # Unpack args, call turn_around(), pack reply except (EOFError, GarbageArgs): # Too few or too many arguments self.packer.reset() self.packer.pack_uint(xid) self.packer.pack_uint(REPLY) self.packer.pack_uint(MSG_ACCEPTED) self.packer.pack_auth((AUTH_NULL, make_auth_null())) self.packer.pack_uint(GARBAGE_ARGS) return self.packer.get_buf()
e6b5917a3f1232d3676928a6fb5ae07cc948f164 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6b5917a3f1232d3676928a6fb5ae07cc948f164/rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 745, 4672, 468, 7615, 1404, 999, 6167, 67, 3374, 1496, 1109, 326, 1446, 11151, 2460, 468, 11329, 467, 1240, 1158, 21463, 309, 467, 2125, 1450, 326, 2145, 555, 7220, 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, 1640, 12, 2890, 16, 745, 4672, 468, 7615, 1404, 999, 6167, 67, 3374, 1496, 1109, 326, 1446, 11151, 2460, 468, 11329, 467, 1240, 1158, 21463, 309, 467, 2125, 1450, 326, 2145, 555, 7220, 5...
def _writeinfo(self, name, finfo): if DEBUG: print 'binhex info:', name, finfo.Type, finfo.Creator, self.dlen, self.rlen
def _writeinfo(self, name, finfo):
def _writeinfo(self, name, finfo):
f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580/binhex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 1376, 12, 2890, 16, 508, 16, 15190, 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, ...
[ 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2626, 1376, 12, 2890, 16, 508, 16, 15190, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
debug("Socket file read %r" % data)
debug("Socket file read %d bytes: %r" % (len(data), data))
def socketfile_read (sock): """ Read data from socket until no more data is available. """ data = "" while wc.proxy.readable_socket(sock): s = sock.read(1) if not s: break data += s debug("Socket file read %r" % data) return data + sock._rbuf
fdd7e1aa42ee3181557e51dbf890452ba081f48b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/fdd7e1aa42ee3181557e51dbf890452ba081f48b/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2987, 768, 67, 896, 261, 15031, 4672, 3536, 2720, 501, 628, 2987, 3180, 1158, 1898, 501, 353, 2319, 18, 3536, 501, 273, 1408, 1323, 14310, 18, 5656, 18, 11018, 67, 7814, 12, 15031, 4672,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2987, 768, 67, 896, 261, 15031, 4672, 3536, 2720, 501, 628, 2987, 3180, 1158, 1898, 501, 353, 2319, 18, 3536, 501, 273, 1408, 1323, 14310, 18, 5656, 18, 11018, 67, 7814, 12, 15031, 4672,...
if not match_rule(event):
if match_rule and not match_rule(event):
def event_parser(self, message, requester, room_jid, **attrs): for element in message.children("event"): event = events.Event.from_element(element)
f2e0e8478d2a2032a6db7726b4e18e22b1382a37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14361/f2e0e8478d2a2032a6db7726b4e18e22b1382a37/historian.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 871, 67, 4288, 12, 2890, 16, 883, 16, 19961, 16, 7725, 67, 18252, 16, 2826, 7039, 4672, 364, 930, 316, 883, 18, 5906, 2932, 2575, 6, 4672, 871, 273, 2641, 18, 1133, 18, 2080, 67, 295...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 871, 67, 4288, 12, 2890, 16, 883, 16, 19961, 16, 7725, 67, 18252, 16, 2826, 7039, 4672, 364, 930, 316, 883, 18, 5906, 2932, 2575, 6, 4672, 871, 273, 2641, 18, 1133, 18, 2080, 67, 295...
if os.path.exists(output_dir) == 'False':
if not os.path.exists(output_dir):
def usage(): msg = """\
7f6e8d002ef7aab494d31c8c3fb6576ea9d4ab9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/7f6e8d002ef7aab494d31c8c3fb6576ea9d4ab9f/make_C_files.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1234, 273, 3536, 64, 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, 0, 0...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4084, 13332, 1234, 273, 3536, 64, 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, -100, -...
try: del self._keys
try: del self._v_keys
def __setitem__(self, key, v):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 1726, 972, 12, 2890, 16, 498, 16, 331, 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, ...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 1726, 972, 12, 2890, 16, 498, 16, 331, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
"code": project.code, "name": project.title,
"code": project_model.code, "name": projecttitle,
def getquicklinks(self): """gets a set of quick links to user's project-languages""" quicklinks = [] user_profile = self.request.user.get_profile() for language in user_profile.languages.all(): if not self.potree.haslanguage(language.code): continue langlinks = [] for project in user_profile.projects.all(): if self.potree.hasproject(language.code, project.code): projecttitle = self.potree.getprojectname(project.code) project = self.potree.getproject(language.code, project.code) isprojectadmin = "admin" in project.getrights(request=self.request) langlinks.append({ "code": project.code, "name": project.title, "isprojectadmin": isprojectadmin, "sep": "<br />"}) if langlinks: langlinks[-1]["sep"] = "" quicklinks.append({"code": languagecode, "name": self.tr_lang(language.name), "projects": langlinks}) # rewritten for compatibility with Python 2.3 # quicklinks.sort(cmp=locale.strcoll, key=lambda dict: dict["name"]) quicklinks.sort(lambda x,y: locale.strcoll(x["name"], y["name"])) return quicklinks
175d382fc31e690fc531a50d19fa85a14987aa15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11388/175d382fc31e690fc531a50d19fa85a14987aa15/indexpage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 19525, 7135, 12, 2890, 4672, 3536, 14665, 279, 444, 434, 9549, 4716, 358, 729, 1807, 1984, 17, 14045, 8395, 9549, 7135, 273, 5378, 729, 67, 5040, 273, 365, 18, 2293, 18, 1355, 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, 19525, 7135, 12, 2890, 4672, 3536, 14665, 279, 444, 434, 9549, 4716, 358, 729, 1807, 1984, 17, 14045, 8395, 9549, 7135, 273, 5378, 729, 67, 5040, 273, 365, 18, 2293, 18, 1355, 18, ...
graph.reset()
graph("e\n") raw_input("press return to continue...\n")
def GraphData(self, path, graph): file = eval(open(path).read()) choice = self.choice1.GetSelection() if choice == -1: choice = 0 size = len(file['Test']['GraphLines'][0]['ResultSet']) count = 0 while count < size: name = file['Test']['GraphLines'][0]['ResultSet'][count]['Name'] result = file['Test']['GraphLines'][0]['ResultSet'][count]['Results'][choice]['Value'] # graph it print name print result count = count + 1 graph.reset()
1968eba5b6a3698dd7fdbc4a8f30257933263174 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2798/1968eba5b6a3698dd7fdbc4a8f30257933263174/wxFrame1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5601, 751, 12, 2890, 16, 589, 16, 2667, 4672, 585, 273, 5302, 12, 3190, 12, 803, 2934, 896, 10756, 6023, 273, 365, 18, 11569, 21, 18, 967, 6233, 1435, 309, 6023, 422, 300, 21, 30, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5601, 751, 12, 2890, 16, 589, 16, 2667, 4672, 585, 273, 5302, 12, 3190, 12, 803, 2934, 896, 10756, 6023, 273, 365, 18, 11569, 21, 18, 967, 6233, 1435, 309, 6023, 422, 300, 21, 30, 60...
version = distutils.msvccompiler.get_build_version() if version:
try: distutils.msvccompiler.MSVCCompiler().initialize
def msvc_exists(): """ Determine whether MSVC is available on the machine. """ result = 0 try: p = subprocess.Popen(['cl'], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) str_result = p.stdout.read() #print str_result if 'Microsoft' in str_result: result = 1 except: #assume we're ok if devstudio exists import distutils.msvccompiler version = distutils.msvccompiler.get_build_version() if version: result = 1 return result
b81a962346e67dbf363ecafecd4d1934cc2d9c6e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7416/b81a962346e67dbf363ecafecd4d1934cc2d9c6e/build_tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4086, 4227, 67, 1808, 13332, 3536, 10229, 2856, 9238, 13464, 353, 2319, 603, 326, 5228, 18, 3536, 563, 273, 374, 775, 30, 293, 273, 6652, 18, 52, 3190, 12, 3292, 830, 17337, 5972, 33, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4086, 4227, 67, 1808, 13332, 3536, 10229, 2856, 9238, 13464, 353, 2319, 603, 326, 5228, 18, 3536, 563, 273, 374, 775, 30, 293, 273, 6652, 18, 52, 3190, 12, 3292, 830, 17337, 5972, 33, ...
print "%ERROR:%s Could not locate thirdparty package %s, aborting build" % (GetColor("red"), GetColor(), pkg.lower())
print "%sERROR:%s Could not locate thirdparty package %s, aborting build" % (GetColor("red"), GetColor(), pkg.lower())
def PkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None, framework = None, tool = "pkg-config"): global PKG_LIST_ALL if (pkgconfig == ""): pkgconfig = None if (framework == ""): framework = None if (libs == None or libs == ""): libs = () elif (isinstance(libs, str)): libs = (libs, ) if (incs == None or incs == ""): incs = () elif (isinstance(incs, str)): incs = (incs, ) if (defs == None or defs == "" or len(defs) == 0): defs = {} elif (isinstance(incs, str)): defs = {defs : ""} elif (isinstance(incs, list) or isinstance(incs, tuple) or isinstance(incs, set)): olddefs = defs defs = {} for d in olddefs: defs[d] = "" if (os.path.isdir(THIRDPARTYLIBS + pkg.lower())): IncDirectory(pkg, THIRDPARTYLIBS + pkg.lower() + "/include") LibDirectory(pkg, THIRDPARTYLIBS + pkg.lower() + "/lib") for l in libs: libname = l if (l.startswith("lib")): libname = l[3:] # This is for backward compatibility - in the thirdparty dir, we kept some libs with "panda" prefix, like libpandatiff. if (len(glob.glob(THIRDPARTYLIBS + pkg.lower() + "/lib/libpanda%s.*" % libname)) > 0 and len(glob.glob(THIRDPARTYLIBS + pkg.lower() + "/lib/lib%s.*" % libname)) == 0): libname = "panda" + libname LibName(pkg, libname) for d, v in defs.values(): DefSymbol(pkg, d, v) elif (sys.platform == "darwin" and framework != None): if (os.path.isdir("/Library/Frameworks/%s.framework" % framework) or os.path.isdir("/System/Library/Frameworks/%s.framework" % framework) or os.path.isdir("/Developer/Library/Frameworks/%s.framework" % framework) or os.path.isdir("/Users/%s/System/Library/Frameworks/%s.framework" % (getpass.getuser(), framework))): LibName(pkg, "-framework " + framework) for d, v in defs.values(): DefSymbol(pkg, d, v) elif (pkg in PkgListGet()): print "%sWARNING:%s Could not locate framework %s, excluding from build" % (GetColor("red"), GetColor(), framework) PkgDisable(pkg) else: print "%ERROR:%s Could not locate framework %s, aborting build" % (GetColor("red"), GetColor(), framework) exit() elif (LocateBinary(tool) != None and (tool != "pkg-config" or pkgconfig != None)): if (isinstance(pkgconfig, str) or tool != "pkg-config"): if (PkgConfigHavePkg(pkgconfig, tool)): return PkgConfigEnable(pkg, pkgconfig, tool) else: have_all_pkgs = True for pc in pkgconfig: if (PkgConfigHavePkg(pc, tool)): PkgConfigEnable(pkg, pc, tool) else: have_all_pkgs = False if (have_all_pkgs): return elif (pkgconfig != None and libs == None): if (pkg in PkgListGet()): print "%sWARNING:%s Could not locate package %s, excluding from build" % (GetColor("red"), GetColor(), pkgconfig) PkgDisable(pkg) else: print "%ERROR:%s Could not locate package %s, aborting build" % (GetColor("red"), GetColor(), pkgconfig) exit() else: # Okay, our pkg-config attempts failed. Let's try locating the libs by ourselves. have_pkg = True for l in libs: if (l in GetLdCache()): LibName(pkg, "-l" + l) else: if (VERBOSE): print GetColor("cyan") + "Couldn't find library lib" + l + GetColor() have_pkg = False for i in incs: incdir = None if (len(glob.glob("/usr/include/" + i)) > 0): incdir = sorted(glob.glob("/usr/include/" + i))[-1] elif (len(glob.glob("/usr/local/include/" + i)) > 0): incdir = sorted(glob.glob("/usr/local/include/" + i))[-1] elif (platform.uname()[1]=="pcbsd" and len(glob.glob("/usr/PCBSD/local/include/" + i)) > 0): incdir = sorted(glob.glob("/usr/PCBSD/local/include/" + i))[-1] else: # Try searching in the package's IncDirectories. for ppkg, pdir in INCDIRECTORIES: if (pkg == ppkg and len(glob.glob(os.path.join(pdir, i))) > 0): incdir = sorted(glob.glob(os.path.join(pdir, i)))[-1] if (incdir == None and VERBOSE and i.endswith(".h")): print GetColor("cyan") + "Couldn't find header file " + i + GetColor() have_pkg = False # Note: It's possible to specify a file instead of a dir, for the sake of checking if it exists. if (incdir != None and os.path.isdir(incdir)): IncDirectory(pkg, incdir) if (not have_pkg): if (pkg in PkgListGet()): print "%sWARNING:%s Could not locate thirdparty package %s, excluding from build" % (GetColor("red"), GetColor(), pkg.lower()) PkgDisable(pkg) else: print "%ERROR:%s Could not locate thirdparty package %s, aborting build" % (GetColor("red"), GetColor(), pkg.lower()) exit()
9d06d108bcf9b58d212e557f55ba111aa99fd02f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/9d06d108bcf9b58d212e557f55ba111aa99fd02f/makepandacore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 453, 14931, 8317, 12, 10657, 16, 3475, 1425, 273, 599, 16, 15042, 273, 599, 16, 316, 2143, 273, 599, 16, 17588, 273, 599, 16, 8257, 273, 599, 16, 5226, 273, 315, 10657, 17, 1425, 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, 453, 14931, 8317, 12, 10657, 16, 3475, 1425, 273, 599, 16, 15042, 273, 599, 16, 316, 2143, 273, 599, 16, 17588, 273, 599, 16, 8257, 273, 599, 16, 5226, 273, 315, 10657, 17, 1425, 6, ...
def small(text): return '<small>' + text + '</small>' def strong(text): return '<strong>' + text + '</strong>' def grey(text): return '<font color="
def small(text): if text: return '<small>' + text + '</small>' else: return '' def strong(text): if text: return '<strong>' + text + '</strong>' else: return '' def grey(text): if text: return '<font color=" else: return ''
def small(text): return '<small>' + text + '</small>'
5fcefdb32600fa64d3160f031d48fb033150fdb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/5fcefdb32600fa64d3160f031d48fb033150fdb3/cgitb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5264, 12, 955, 4672, 327, 2368, 12019, 1870, 397, 977, 397, 4357, 12019, 1870, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5264, 12, 955, 4672, 327, 2368, 12019, 1870, 397, 977, 397, 4357, 12019, 1870, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
class RecurrentAutoencoder(RecurrentWrapper): r""" Specialized version of RecurrentWrapper to deal with autoencoder pretraining. See the documentation for `Autoencoder` for details on the semantics of the parameters.
def recurrent_autoencoder(n_in, n_out, tied=True, nlin=sigmoid, noise=0.0, error=cross_entropy, name=None, dtype=theano.config.floatX, rng=numpy.random, noise_rng=RandomStreams()): r""" Utility function to create a recurrent autoencoder. See the documentation for `Autoencoder` for details on the semantics of the parameters.
def recurrent_layer(n_in, n_out, nlin=sigmoid, rng=numpy.random, name=None, dtype=theano.config.floatX): r""" Utility function to create a recurrent layer. See the documentation for `SimpleLayer` for details on the semantics of the parameters. Examples: >>> rl = recurrent_layer(3, 2) """ from pynnet.layers import SimpleLayer h = SimpleLayer(n_in+n_out, n_out, nlin=nlin, dtype=dtype, rng=rng) return RecurrentWrapper(h, (n_out,), name=name, dtype=dtype)
be398f5295ae3c6c999c3358899e2a341413174d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3400/be398f5295ae3c6c999c3358899e2a341413174d/recurrent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 283, 2972, 67, 6363, 12, 82, 67, 267, 16, 290, 67, 659, 16, 290, 7511, 33, 7340, 30501, 16, 11418, 33, 15974, 18, 9188, 16, 508, 33, 7036, 16, 3182, 33, 5787, 31922, 18, 1425, 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, 283, 2972, 67, 6363, 12, 82, 67, 267, 16, 290, 67, 659, 16, 290, 7511, 33, 7340, 30501, 16, 11418, 33, 15974, 18, 9188, 16, 508, 33, 7036, 16, 3182, 33, 5787, 31922, 18, 1425, 18, ...
if self.compiler.find_library_file(lib_dirs, 'db-3.1'):
if self.compiler.find_library_file(lib_dirs, 'db-3.2'): dblib = ['db-3.2'] elif self.compiler.find_library_file(lib_dirs, 'db-3.1'):
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' )
b1a9f646e0a72645e0bcfc54fa934e4c4cf93b7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b1a9f646e0a72645e0bcfc54fa934e4c4cf93b7b/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, ...
context.interpArgCount = 0
def parse(self, context, operands): # Case 1: One interpretive opcode. # Case 2: Two packed interpretive opcodes. # Case 3: Interpretive opcode, simple operand. # Case 4: Interpretive opcode, operand expression with 2 components (e.g. ['A', '+1']). # Case 5: Interpretive opcode, operand expression with 3 components (e.g. ['A', '-', '1']).
0dc7e9a86302afee6b962e9657efe937f5ff2e18 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/0dc7e9a86302afee6b962e9657efe937f5ff2e18/interpretive.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 819, 16, 14883, 4672, 468, 12605, 404, 30, 6942, 10634, 688, 11396, 18, 468, 12605, 576, 30, 16896, 12456, 10634, 688, 1061, 7000, 18, 468, 12605, 890, 30, 5294, 1508...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16, 819, 16, 14883, 4672, 468, 12605, 404, 30, 6942, 10634, 688, 11396, 18, 468, 12605, 576, 30, 16896, 12456, 10634, 688, 1061, 7000, 18, 468, 12605, 890, 30, 5294, 1508...
if (u.getUserName().lower().find(name) == -1) and (user.fullname.lower().find(name) == -1):
if (u.getUserName().lower().find(name) == -1) and \ ((not user.fullname) or user.fullname.lower().find(name) == -1):
def searchForMembers( self, REQUEST=None, **kw ): """ """ if REQUEST: dict = REQUEST else: dict = kw name = dict.get('name', None) email = dict.get('email', None) roles = dict.get('roles', None) last_login_time = dict.get('last_login_time', None) is_manager = self.checkPermission('Manage portal', self) if name: name = name.strip().lower() if not name: name = None if email: email = email.strip().lower() if not email: email = None
84c18869edd929d033841a43c77e28e0bedb89d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/84c18869edd929d033841a43c77e28e0bedb89d2/MemberDataTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 1290, 6918, 12, 365, 16, 12492, 33, 7036, 16, 2826, 9987, 262, 30, 3536, 3536, 309, 12492, 30, 2065, 273, 12492, 469, 30, 2065, 273, 5323, 225, 508, 273, 2065, 18, 588, 2668, 529...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1623, 1290, 6918, 12, 365, 16, 12492, 33, 7036, 16, 2826, 9987, 262, 30, 3536, 3536, 309, 12492, 30, 2065, 273, 12492, 469, 30, 2065, 273, 5323, 225, 508, 273, 2065, 18, 588, 2668, 529...
patterns = {r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s', r'([^\.]*)\.([0-9]+)':'%s.%s%s',
patterns = {r'([^\.]*)\.([0-9]+)':'%s.%s%s', r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s',
def image2image(filename): '''Return an integer for the template to match this filename.''' # check that the file name doesn't contain anything mysterious if filename.count('#'): raise RuntimeError, '# characters in filename' # the patterns in the order I want to test them pattern_keys = [r'(.*)_([0-9]*)\.(.*)', r'([^\.]*)\.([0-9]+)', r'(.*?)([0-9]*)\.(.*)'] # patterns is a dictionary of possible regular expressions with # the format strings to put the file name back together patterns = {r'(.*)_([0-9]*)\.(.*)':'%s_%s.%s', r'([^\.]*)\.([0-9]+)':'%s.%s%s', r'(.*?)([0-9]*)\.(.*)':'%s%s.%s'} for pattern in pattern_keys: match = re.compile(pattern).match(filename) if match: prefix = match.group(1) number = match.group(2) try: exten = match.group(3) except: exten = '' return int(number) raise RuntimeError, 'filename %s not understood as a template' % \ filename
1c4943d902d9054aa693637949c54b1cb8ca8dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3290/1c4943d902d9054aa693637949c54b1cb8ca8dda/FindImages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 22, 2730, 12, 3459, 4672, 9163, 990, 392, 3571, 364, 326, 1542, 358, 845, 333, 1544, 1093, 6309, 225, 468, 866, 716, 326, 585, 508, 3302, 1404, 912, 6967, 312, 1094, 264, 22774, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1316, 22, 2730, 12, 3459, 4672, 9163, 990, 392, 3571, 364, 326, 1542, 358, 845, 333, 1544, 1093, 6309, 225, 468, 866, 716, 326, 585, 508, 3302, 1404, 912, 6967, 312, 1094, 264, 22774, ...
repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id})
repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id, 'state': 'done'})
def action_repair_done(self, cr, uid, ids, context=None): """ Creates stock move and picking for repair order. @return: Picking ids. """ res = {} move_obj = self.pool.get('stock.move') wf_service = netsvc.LocalService("workflow") repair_line_obj = self.pool.get('mrp.repair.line') seq_obj = self.pool.get('ir.sequence') pick_obj = self.pool.get('stock.picking') for repair in self.browse(cr, uid, ids, context=context): for move in repair.operations: move_id = move_obj.create(cr, uid, { 'name': move.name, 'product_id': move.product_id.id, 'product_qty': move.product_uom_qty, 'product_uom': move.product_uom.id, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': move.location_id.id, 'location_dest_id': move.location_dest_id.id, 'tracking_id': False, 'state': 'done', }) repair_line_obj.write(cr, uid, [move.id], {'move_id': move_id}) if repair.deliver_bool: pick_name = seq_obj.get(cr, uid, 'stock.picking.out') picking = pick_obj.create(cr, uid, { 'name': pick_name, 'origin': repair.name, 'state': 'draft', 'move_type': 'one', 'address_id': repair.address_id and repair.address_id.id or False, 'note': repair.internal_notes, 'invoice_state': 'none', 'type': 'out', }) move_id = move_obj.create(cr, uid, { 'name': repair.name, 'picking_id': picking, 'product_id': repair.product_id.id, 'product_qty': 1.0, 'product_uom': repair.product_id.uom_id.id, 'prodlot_id': repair.prodlot_id and repair.prodlot_id.id or False, 'address_id': repair.address_id and repair.address_id.id or False, 'location_id': repair.location_id.id, 'location_dest_id': repair.location_dest_id.id, 'tracking_id': False, 'state': 'assigned', }) wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr) self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking}) res[repair.id] = picking else: self.write(cr, uid, [repair.id], {'state': 'done'}) return res
d24451dcd60465f12661380032cf600cdea1a4b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d24451dcd60465f12661380032cf600cdea1a4b1/mrp_repair.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1301, 67, 266, 6017, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 10210, 12480, 3635, 471, 6002, 310, 364, 20994, 1353, 18, 632, 2463, 30, 23038, 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, 1301, 67, 266, 6017, 67, 8734, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 10210, 12480, 3635, 471, 6002, 310, 364, 20994, 1353, 18, 632, 2463, 30, 23038, 31...
def run(self): self.app_controller = AppController.alloc().initWithApp_(self) NSApplication.sharedApplication().setDelegate_(self.app_controller) NSApplicationMain(sys.argv)
def endLoop(self, loop): del loop.pool
0c7ca02ab76e0cf4099644d25a9e6c2ac8439e35 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/0c7ca02ab76e0cf4099644d25a9e6c2ac8439e35/application.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 6452, 12, 2890, 16, 2798, 4672, 1464, 2798, 18, 6011, 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...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 6452, 12, 2890, 16, 2798, 4672, 1464, 2798, 18, 6011, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if len(toks) == 4:
print toks if len(toks) in (3,4):
def trigger(self, a, loc, toks, op): #print op, toks if op == 'lit': negated = False if toks[0] == '!' or toks[0] == '*': if toks[0] == '*': negated = 2 else: negated = True toks = toks[1] else: toks = toks[0] self.stack.append(Lit(negated, toks[0], toks[1])) elif op == '!': if len(toks) == 1: formula = Negation(self.stack[-1:]) self.stack = self.stack[:-1] self.stack.append(formula) elif op == 'v': if len(toks) > 1: formula = Disjunction(self.stack[-len(toks):]) self.stack = self.stack[:-len(toks)] self.stack.append(formula) elif op == '^': if len(toks) > 1: formula = Conjunction(self.stack[-len(toks):]) self.stack = self.stack[:-len(toks)] self.stack.append(formula) elif op == 'ex': if len(toks) == 2: formula = self.stack.pop() self.stack.append(Exist(toks[0], formula)) elif op == '=>': if len(toks) == 2: children = self.stack[-2:] self.stack = self.stack[:-2] self.stack.append(Implication(children)) elif op == '<=>': if len(toks) == 2: children = self.stack[-2:] self.stack = self.stack[:-2] self.stack.append(Biimplication(children)) elif op == '=': if len(toks) == 2: self.stack.append(Equality(list(toks))) elif op == 'count': if len(toks) == 4: pred, pred_params = toks[0] fixed_params, op, count = list(toks[1]), toks[2], int(toks[3]) self.stack.append(CountConstraint(pred, pred_params, fixed_params, op, count)) #print str(self.stack[-1])
1f3caf6d5f7ae8ea6c4270ece63192b00b154a4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10261/1f3caf6d5f7ae8ea6c4270ece63192b00b154a4d/FOL.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3080, 12, 2890, 16, 279, 16, 1515, 16, 21404, 16, 1061, 4672, 468, 1188, 1061, 16, 21404, 309, 1061, 422, 296, 24235, 4278, 24765, 273, 1083, 309, 21404, 63, 20, 65, 422, 15502, 578, 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, 3080, 12, 2890, 16, 279, 16, 1515, 16, 21404, 16, 1061, 4672, 468, 1188, 1061, 16, 21404, 309, 1061, 422, 296, 24235, 4278, 24765, 273, 1083, 309, 21404, 63, 20, 65, 422, 15502, 578, 2...
sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( ... x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)); B [74311982 57996908] [95877067 25828133] sage: B.det() 10007 sage: B.trace() 66 sage: EllipticCurve([-1, 1/4]).ap(10007) 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( ... x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)) sage: B.det() 5 sage: -B.trace() 2 sage: EllipticCurve([-1, 1/4]).ap(5) -2
sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( ... x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)); B [74311982 57996908] [95877067 25828133] sage: B.det() 10007 sage: B.trace() 66 sage: EllipticCurve([-1, 1/4]).ap(10007) 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( ... x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)) sage: B.det() 5 sage: -B.trace() 2 sage: EllipticCurve([-1, 1/4]).ap(5) -2
def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): """ Computes the matrix of Frobenius on Monsky-Washnitzer cohomology, with respect to the basis $(dx/y, x dx/y)$. INPUT: Q -- cubic polynomial $Q(x) = x^3 + ax + b$ defining an elliptic curve E by $y^2 = Q(x)$. The coefficient ring of Q should be a $\Z/(p^M)\Z$-algebra in which the matrix of frobenius will be constructed. p -- prime >= 5 for which E has good reduction M -- integer >= 2; $p$-adic precision of the coefficient ring trace -- (optional) the trace of the matrix, if known in advance. This is easy to compute because it's just the $a_p$ of the curve. If the trace is supplied, matrix_of_frobenius will use it to speed the computation (i.e. we know the determinant is $p$, so we have two conditions, so really only column of the matrix needs to be computed. It's actually a little more complicated than that, but that's the basic idea.) If trace=None, then both columns will be computed independently, and you can get a strong indication of correctness by verifying the trace afterwards. WARNING: -- THE RESULT WILL NOT NECESSARILY BE CORRECT TO M p-ADIC DIGITS. If you want prec digits of precision, you need to use the function adjusted_prec(), and then you need to reduce the answer mod p^prec at the end. OUTPUT: 2x2 matrix of frobenius on Monsky-Washnitzer cohomology, with entries in the coefficient ring of Q. EXAMPLES: A simple example: sage: p = 5 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: M 5 sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A [3090 187] [2945 408] But the result is only accurate to prec digits: sage: B = A.change_ring(Integers(p**prec)) sage: B [90 62] [70 33] Check trace (123 = -2 mod 125) and determinant: sage: B.det() 5 sage: B.trace() 123 sage: EllipticCurve([-1, 1/4]).ap(5) -2 Try using the trace to speed up the calculation: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] Hmmm... it looks different, but that's because the trace of our first answer was only -2 modulo $5^3$, not -2 modulo $5^5$. So the right answer is: sage: A.change_ring(Integers(p**prec)) [90 62] [70 33] Check it works with only one digit of precision: sage: p = 5 sage: prec = 1 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A.change_ring(Integers(p)) [0 2] [0 3] Here's an example that's particularly badly conditioned for using the trace trick: sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The problem here is that the top-right entry is divisible by 11, and the bottom-left entry is divisible by $11^2$. So when you apply the trace trick, neither $F(dx/y)$ nor $F(x dx/y)$ is enough to compute the whole matrix to the desired precision, even if you try increasing the target precision by one. Nevertheless, \code{matrix_of_frobenius} knows how to get the right answer by evaluating $F((x+1) dx/y)$ instead: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M, -2) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The running time is about \code{O(p * prec**2)} (times some logarithmic factors), so it's feasible to run on fairly large primes, or precision (or both?!?!): sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)); B # long time [74311982 57996908] [95877067 25828133] sage: B.det() # long time 10007 sage: B.trace() # long time 66 sage: EllipticCurve([-1, 1/4]).ap(10007) # long time 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)) # long time sage: B.det() # long time 5 sage: -B.trace() # long time 2 sage: EllipticCurve([-1, 1/4]).ap(5) # long time -2 Let's check consistency of the results for a range of precisions: sage: p = 5 sage: max_prec = 60 sage: M = monsky_washnitzer.adjusted_prec(p, max_prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) # long time sage: A = A.change_ring(Integers(p**max_prec)) # long time sage: result = [] # long time sage: for prec in range(1, max_prec): # long time ... M = monsky_washnitzer.adjusted_prec(p, prec) # long time ... R.<x> = PolynomialRing(Integers(p^M),'x') # long time ... B = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time ... B = B.change_ring(Integers(p**prec)) # long time ... result.append(B == A.change_ring( # long time ... Integers(p**prec))) # long time sage: result == [True] * (max_prec - 1) # long time True The remaining examples discuss what happens when you take the coefficient ring to be a power series ring; i.e. in effect you're looking at a family of curves. The code does in fact work... sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: S.<t> = PowerSeriesRing(Integers(p**M), default_prec=4) sage: a = 7 + t + 3*t^2 sage: b = 8 - 6*t + 17*t^2 sage: R.<x> = PolynomialRing(S) sage: Q = x**3 + a*x + b sage: A = monsky_washnitzer.matrix_of_frobenius(Q, p, M) # long time sage: B = A.change_ring(PowerSeriesRing(Integers(p**prec), 't', default_prec=4)) # long time sage: B # long time [1144 + 264*t + 841*t^2 + 1025*t^3 + O(t^4) 176 + 1052*t + 216*t^2 + 523*t^3 + O(t^4)] [ 847 + 668*t + 81*t^2 + 424*t^3 + O(t^4) 185 + 341*t + 171*t^2 + 642*t^3 + O(t^4)] The trace trick should work for power series rings too, even in the badly- conditioned case. Unfortunately I don't know how to compute the trace in advance, so I'm not sure exactly how this would help. Also, I suspect the running time will be dominated by the expansion, so the trace trick won't really speed things up anyway. Another problem is that the determinant is not always p: sage: B.det() # long time 11 + 484*t^2 + 451*t^3 + O(t^4) However, it appears that the determinant always has the property that if you substitute t -> 11t, you do get the constant series p (mod p**prec). Similarly for the trace. And since the parameter only really makes sense when it's divisible by p anyway, perhaps this isn't a problem after all. """ M = int(M) if M < 2: raise ValueError, "M (=%s) must be at least 2" % M base_ring = Q.base_ring() # Expand out frobenius of dx/y and x dx/y. # (You can substitute frobenius_expansion_by_series here, that will work # as well. See its docstring for some performance notes.) F0, F1, offset = frobenius_expansion_by_newton(Q, p, M) #F0, F1, offset = frobenius_expansion_by_series(Q, p, M) if compute_exact_forms: # we need to do all the work to get the exact expressions f such that F(x^i dx/y) = df + \sum a_i x^i dx/y F0_coeffs = transpose_list(F0.coeffs()) F0_reduced, f_0 = reduce_all(Q, p, F0_coeffs, offset, True) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced, f_1 = reduce_all(Q, p, F1_coeffs, offset, True) elif M == 2: # This implies that only one digit of precision is valid, so we only need # to reduce the second column. Also, the trace doesn't help at all. F0_reduced = [ base_ring(0), base_ring(0) ] F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) elif trace is None: # No trace provided, just reduce F(dx/y) and F(x dx/y) separately. F0_coeffs = transpose_list(F0.coeffs()) F0_reduced = reduce_all(Q, p, F0_coeffs, offset) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) else: # Trace has been provided. # In most cases this can be used to quickly compute F(dx/y) from # F(x dx/y). However, if we're unlucky, the (dx/y)-component of # F(x dx/y) (i.e. the top-right corner of the matrix) may be divisible # by p, in which case there isn't enough information to get the # (x dx/y)-component of F(dx/y) to the desired precision. When this # happens, it turns out that F((x+1) dx/y) always *does* give enough # information (together with the trace) to get both columns to the # desired precision. # First however we need a quick way of telling whether the top-right # corner is divisible by p, i.e. we want to compute the second column # of the matrix mod p. We could do this by just running the entire # algorithm with M = 2 (which assures precision 1). Luckily, we've # already done most of the work by computing F1 to high precision; so # all we need to do is extract the coefficients that would correspond # to the first term of the series, and run the reduction on them. # todo: actually we only need to do this reduction step mod p^2, not # mod p^M, which is what the code currently does. If the base ring # is Integers(p^M), then it's easy. Otherwise it's tricky to construct # the right ring, I don't know how to do it. F1_coeffs = transpose_list(F1.coeffs()) F1_modp_coeffs = F1_coeffs[int((M-2)*p):] # make a copy, because reduce_all will destroy the coefficients: F1_modp_coeffs = [[cell for cell in row] for row in F1_modp_coeffs] F1_modp_offset = offset - (M-2)*p F1_modp_reduced = reduce_all(Q, p, F1_modp_coeffs, F1_modp_offset) if F1_modp_reduced[0].is_unit(): # If the first entry is invertible mod p, then F(x dx/y) is sufficient # to get the whole matrix. F1_reduced = reduce_all(Q, p, F1_coeffs, offset) F0_reduced = [ base_ring(trace) - F1_reduced[1], None ] # using that the determinant is p: F0_reduced[1] = (F0_reduced[0] * F1_reduced[1] - base_ring(p)) \ / F1_reduced[0] else: # If the first entry is zero mod p, then F((x+1) dx/y) will be sufficient # to get the whole matrix. (Here we are using the fact that the second # entry *cannot* be zero mod p. This is guaranteed by some results in # section 3.2 of ``Computation of p-adic Heights and Log Convergence'' # by Mazur, Stein, Tate. But let's quickly check it anyway :-)) assert F1_modp_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in the second column " \ "should be invertible mod p!" G0_coeffs = transpose_list( (F0 + F1).coeffs()) G0_reduced = reduce_all(Q, p, G0_coeffs, offset) # Now G0_reduced expresses F((x+1) dx/y) in terms of dx/y and x dx/y. # Re-express this in terms of (x+1) dx/y and x dx/y. H0_reduced = [ G0_reduced[0], G0_reduced[1] - G0_reduced[0] ] # The thing we're about to divide by better be a unit. assert H0_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in this column " \ "should be invertible mod p!" # Figure out the second column using the trace... H1_reduced = [ None, base_ring(trace) - H0_reduced[0] ] # ... and using that the determinant is p: H1_reduced[0] = (H0_reduced[0] * H1_reduced[1] - base_ring(p)) \ / H0_reduced[1] # Finally, change back to the usual basis (dx/y, x dx/y) F1_reduced = [ H1_reduced[0], \ H1_reduced[0] + H1_reduced[1] ] F0_reduced = [ H0_reduced[0] - F1_reduced[0], H0_reduced[0] + H0_reduced[1] - F1_reduced[1] ] # One more sanity check: our final result should be congruent mod p # to the approximation we used earlier. assert not ( (F1_reduced[0] - F1_modp_reduced[0]).is_unit() or \ (F1_reduced[1] - F1_modp_reduced[1]).is_unit() or \ F0_reduced[0].is_unit() or F0_reduced[1].is_unit()), \ "Hey that's impossible! The output matrix is not congruent mod p " \ "to the approximation found earlier!" if compute_exact_forms: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]), f_0, f_1 else: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]])
894b878ec3bbe6ef06c36aa7cf3e8cd6f2838986 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/894b878ec3bbe6ef06c36aa7cf3e8cd6f2838986/monsky_washnitzer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 53, 16, 293, 16, 490, 16, 2606, 33, 7036, 16, 3671, 67, 17165, 67, 9741, 33, 8381, 4672, 3536, 14169, 281, 326, 3148, 434, 478, 303, 1942...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3148, 67, 792, 67, 74, 303, 19425, 8384, 12, 53, 16, 293, 16, 490, 16, 2606, 33, 7036, 16, 3671, 67, 17165, 67, 9741, 33, 8381, 4672, 3536, 14169, 281, 326, 3148, 434, 478, 303, 1942...
return unic(string, encoding) return unic(string)
return unic(stdout, encoding) return unic(stdout)
def _decode_from_system(self, string): if self._is_jython(2, 2): return string encoding = self._get_console_encoding() if encoding: return unic(string, encoding) return unic(string)
ce780d1bf53e538f52a0feebc6f3ddf1618e93b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/ce780d1bf53e538f52a0feebc6f3ddf1618e93b7/OperatingSystem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3922, 67, 2080, 67, 4299, 12, 2890, 16, 533, 4672, 309, 365, 6315, 291, 67, 78, 18490, 12, 22, 16, 576, 4672, 327, 533, 2688, 273, 365, 6315, 588, 67, 8698, 67, 5999, 1435, 309,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3922, 67, 2080, 67, 4299, 12, 2890, 16, 533, 4672, 309, 365, 6315, 291, 67, 78, 18490, 12, 22, 16, 576, 4672, 327, 533, 2688, 273, 365, 6315, 588, 67, 8698, 67, 5999, 1435, 309,...
def test_cast_subarray_pointer(): from pypy.rpython.lltypesystem.lltype import malloc, GcArray, Signed from pypy.rpython.lltypesystem.lltype import FixedSizeArray, Ptr for a in [malloc(GcArray(Signed), 5), malloc(FixedSizeArray(Signed, 5), immortal=True)]: a[0] = 0 a[1] = 10 a[2] = 20 a[3] = 30 a[4] = 40 BOX = Ptr(FixedSizeArray(Signed, 2)) b01 = lltype.cast_subarray_pointer(BOX, a, 0) b12 = lltype.cast_subarray_pointer(BOX, a, 1) b23 = lltype.cast_subarray_pointer(BOX, a, 2) b34 = lltype.cast_subarray_pointer(BOX, a, 3) def llf(n): saved = a[n] a[n] = 1000 try: return b01[0] + b12[0] + b23[1] + b34[1] finally: a[n] = saved res = interpret(llf, [0]) assert res == 1000 + 10 + 30 + 40 res = interpret(llf, [1]) assert res == 0 + 1000 + 30 + 40 res = interpret(llf, [2]) assert res == 0 + 10 + 30 + 40 res = interpret(llf, [3]) assert res == 0 + 10 + 1000 + 40 res = interpret(llf, [4]) assert res == 0 + 10 + 30 + 1000 def test_cast_structfield_pointer(): S = lltype.GcStruct('S', ('x', lltype.Signed), ('y', lltype.Signed)) SUBARRAY = lltype.FixedSizeArray(lltype.Signed, 1) P = lltype.Ptr(SUBARRAY) def llf(n): s = lltype.malloc(S) a = lltype.cast_structfield_pointer(P, s, 'y') a[0] = n return s.y res = interpret(llf, [34]) assert res == 34
def llf(v): return lltype.cast_primitive(lltype.UniChar, v)
009a8d041db36a9c6f347c5e28db4ee06e85c6f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/009a8d041db36a9c6f347c5e28db4ee06e85c6f4/test_rbuiltin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6579, 74, 12, 90, 4672, 327, 6579, 723, 18, 4155, 67, 683, 5025, 12, 2906, 723, 18, 984, 77, 2156, 16, 331, 13, 2, 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, 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, 6579, 74, 12, 90, 4672, 327, 6579, 723, 18, 4155, 67, 683, 5025, 12, 2906, 723, 18, 984, 77, 2156, 16, 331, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
try: urlTool = aq_parent(self).portal_url except AttributeError: urlTool = self.portal_url
urlTool = getToolByName(self, 'portal_url')
def getRelPath(self, ppath): """take something with context (self) and a physical path as a tuple, return the relative path for the portal""" try: urlTool = aq_parent(self).portal_url except AttributeError: urlTool = self.portal_url portal_path = urlTool.getPortalObject().getPhysicalPath() ppath = ppath[len(portal_path):] return ppath
b9163725c4c85727fc8fab92fc7f75623b6a66f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b9163725c4c85727fc8fab92fc7f75623b6a66f2/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1971, 743, 12, 2890, 16, 293, 803, 4672, 3536, 22188, 5943, 598, 819, 261, 2890, 13, 471, 279, 11640, 589, 487, 279, 3193, 16, 327, 326, 3632, 589, 364, 326, 11899, 8395, 880, 636...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1971, 743, 12, 2890, 16, 293, 803, 4672, 3536, 22188, 5943, 598, 819, 261, 2890, 13, 471, 279, 11640, 589, 487, 279, 3193, 16, 327, 326, 3632, 589, 364, 326, 11899, 8395, 880, 636...
value = tuple(value.split(' '))
value = tuple(value.split())
def merge_file(self, filename): import ConfigParser c = ConfigParser.ConfigParser() c.read(filename) for sect in c.sections(): for opt in c.options(sect): value = c.get(sect, opt) # backward compatibility guff if opt[:len(sect) + 1].lower() == sect.lower() + '_': opt = opt[len(sect)+1:] # end of backward compatibility guff if not self._options.has_key((sect, opt)): print "Invalid option %s in section %s in file %s" % \ (opt, sect, filename) else: if self.multiple_values_allowed(sect, opt): value = tuple(value.split(' ')) self.set(sect, opt, self.convert(sect, opt, value))
c8b260b56d7296eb74c97cffc2ed5c2cf3d9dd57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9857/c8b260b56d7296eb74c97cffc2ed5c2cf3d9dd57/Options.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2691, 67, 768, 12, 2890, 16, 1544, 4672, 1930, 25076, 276, 273, 25076, 18, 809, 2678, 1435, 276, 18, 896, 12, 3459, 13, 364, 29140, 316, 276, 18, 11657, 13332, 364, 2153, 316, 276, 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, 2691, 67, 768, 12, 2890, 16, 1544, 4672, 1930, 25076, 276, 273, 25076, 18, 809, 2678, 1435, 276, 18, 896, 12, 3459, 13, 364, 29140, 316, 276, 18, 11657, 13332, 364, 2153, 316, 276, 18,...
val = ecb.GetServerVariable(q)
val = ecb.GetServerVariable(q, '&lt;no such variable&gt;')
def HttpExtensionProc(self, ecb): # NOTE: If you use a ThreadPoolExtension, you must still perform # this check in HttpExtensionProc - raising the exception from # The "Dispatch" method will just cause the exception to be # rendered to the browser. if self.reload_watcher.change_detected: print "Doing reload" raise InternalReloadException
6ccefe13698c5d3ace9ef790ed49172ec930f81a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/992/6ccefe13698c5d3ace9ef790ed49172ec930f81a/advanced.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2541, 3625, 15417, 12, 2890, 16, 6557, 70, 4672, 468, 5219, 30, 971, 1846, 999, 279, 27359, 3625, 16, 1846, 1297, 4859, 3073, 468, 333, 866, 316, 2541, 3625, 15417, 300, 28014, 326, 1520...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2541, 3625, 15417, 12, 2890, 16, 6557, 70, 4672, 468, 5219, 30, 971, 1846, 999, 279, 27359, 3625, 16, 1846, 1297, 4859, 3073, 468, 333, 866, 316, 2541, 3625, 15417, 300, 28014, 326, 1520...
else
else:
def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 388) else quickfix.CharField.__init__(self, 388, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 890, 5482, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 890, 5482, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 273...
R = PolynomialRing(self.base_ring(), 2, 'x,y')
R, (y,x) = PolynomialRing(self.base_ring(), 2, 'y,x', order='revlex').objgens() if use_divpoly and m % 2 == 1: return R(self.division_polynomial(m))
def full_division_polynomial(self, m): """ Return the m-th bivariate division polynomial in x and y.
84dad5dfc790d5dacf9589fdd0cfafb884726e83 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/84dad5dfc790d5dacf9589fdd0cfafb884726e83/ell_generic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1983, 67, 2892, 1951, 67, 3915, 13602, 12, 2890, 16, 312, 4672, 3536, 2000, 326, 312, 17, 451, 324, 27693, 16536, 16991, 316, 619, 471, 677, 18, 2, 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, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1983, 67, 2892, 1951, 67, 3915, 13602, 12, 2890, 16, 312, 4672, 3536, 2000, 326, 312, 17, 451, 324, 27693, 16536, 16991, 316, 619, 471, 677, 18, 2, -100, -100, -100, -100, -100, -100, ...
'control=', 'case='])
'root=', 'libdir=', 'control=', 'debug', 'profile', 'cflags=', 'case='])
def get_options(self, args): optlist, args = getopt.getopt(args, '', ['checkout', 'nocheckout', 'build', 'nobuild', 'test', 'notest', 'control=', 'case=']) for (opt, val) in optlist: if opt == '--nocheckout': self.checkout = 0 if opt == '--checkout': self.checkout = 1 if opt == '--nobuild': self.build = 0 if opt == '--build': self.build = 1 if opt == '--notest': self.test = 0 if opt == '--test': self.test = 1 if opt == '--control': self.control = val if opt == '--case': self.cases.append(val) return args
6e67a8118ba11aa99fa7c3f0ebf2fd1c80f5f9e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12935/6e67a8118ba11aa99fa7c3f0ebf2fd1c80f5f9e6/streamit-regtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2116, 12, 2890, 16, 833, 4672, 2153, 1098, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 1968, 16, 10226, 10228, 17300, 2187, 296, 2135, 17300, 2187, 296, 3510, 2187, 296, 82, 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, 336, 67, 2116, 12, 2890, 16, 833, 4672, 2153, 1098, 16, 833, 273, 336, 3838, 18, 588, 3838, 12, 1968, 16, 10226, 10228, 17300, 2187, 296, 2135, 17300, 2187, 296, 3510, 2187, 296, 82, 9...
os.makedirs(self.value)
if None: os.makedirs(self.value)
def configure(self): '''Generate an interactive prompt to enter a workspace variable *var* value and returns True if the variable value as been set.''' if self.value != None: return False if log: # Configuration of logPath (where the log is stored) # will execute to here before the file is actually open. log.write('\n' + self.name + ':\n') log.write(self.descr + '\n') else: sys.stdout.write('\n' + self.name + ':\n') sys.stdout.write(self.descr + '\n') # compute the default leaf directory from the variable name leafDir = self.name for last in range(0,len(self.name)): if self.name[last] in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ': leafDir = self.name[:last] break dir = self default = self.default if (not default or (not (':' in default) or default.startswith(os.sep))): # If there are no default values or the default is not # an absolute pathname. if self.base: if default: showDefault = '*' + self.base.name + '*/' + default else: showDefault = '*' + self.base.name + '*/' + leafDir if not self.base.value: directly = 'Enter *' + self.name + '* directly ?' offbase = 'Enter *' + self.base.name + '*, *' + self.name \ + '* will defaults to ' + showDefault \ + ' ?' selection = selectOne(self.name + ' is based on *' \ + self.base.name \ + '* by default. Would you like to ... ', [ [ offbase ], [ directly ] ], False) if selection == offbase: dir = self.base default = dir.default else: if default: default = os.path.join(self.base.value,default) else: default = os.path.join(self.base.value,leafDir) elif default: default = os.path.join(os.getcwd(),default) if not default: default = os.getcwd()
4a9bbf3c5ea7429f402e63ad28ed48a40972ea00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/4a9bbf3c5ea7429f402e63ad28ed48a40972ea00/dws.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 2890, 4672, 9163, 4625, 392, 12625, 6866, 358, 6103, 279, 6003, 2190, 380, 1401, 14, 460, 471, 1135, 1053, 309, 326, 2190, 460, 487, 2118, 444, 1093, 6309, 309, 365, 18, 1132, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5068, 12, 2890, 4672, 9163, 4625, 392, 12625, 6866, 358, 6103, 279, 6003, 2190, 380, 1401, 14, 460, 471, 1135, 1053, 309, 326, 2190, 460, 487, 2118, 444, 1093, 6309, 309, 365, 18, 1132, ...
print 'header read'
def Load(self): self.read_header() print 'header read' self.chunks = self.read_subchunks(self.riff_header) print 'subchunks read' self.process_chunks()
005d65a1317c0d7ddba798bcfb5132e409ea3148 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3123/005d65a1317c0d7ddba798bcfb5132e409ea3148/ccxloader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 12, 2890, 4672, 365, 18, 896, 67, 3374, 1435, 365, 18, 14691, 273, 365, 18, 896, 67, 1717, 14691, 12, 2890, 18, 86, 3048, 67, 3374, 13, 1172, 296, 1717, 14691, 855, 11, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 12, 2890, 4672, 365, 18, 896, 67, 3374, 1435, 365, 18, 14691, 273, 365, 18, 896, 67, 1717, 14691, 12, 2890, 18, 86, 3048, 67, 3374, 13, 1172, 296, 1717, 14691, 855, 11, 365, 18...
self._indirect_analyze_results_file = ""
def __init__(self): BaseTool.__init__(self) self.RegisterOptionParserHook(ValgrindTool.ExtendOptionParser) self._indirect_analyze_results_file = ""
b91d8155e1de5888b96ea1b17ac5fce7d82773ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b91d8155e1de5888b96ea1b17ac5fce7d82773ca/valgrind_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3360, 6364, 16186, 2738, 972, 12, 2890, 13, 365, 18, 3996, 1895, 2678, 5394, 12, 3053, 3197, 728, 6364, 18, 16675, 1895, 2678, 13, 365, 6315, 728, 867, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3360, 6364, 16186, 2738, 972, 12, 2890, 13, 365, 18, 3996, 1895, 2678, 5394, 12, 3053, 3197, 728, 6364, 18, 16675, 1895, 2678, 13, 365, 6315, 728, 867, ...
tag = line.split(" - ")[1].strip() self.log_buffer.insert_with_tags_by_name(iter, line + "\n", tag)
if line != "": tag = line.split(" - ")[1].strip() self.log_buffer.insert_with_tags_by_name(iter, line + "\n", tag)
def __init__(self, specto, notifier): self.specto = specto self.notifier = notifier #create tree gladefile= self.specto.PATH + 'glade/log_dialog.glade' windowname= "log_dialog" self.wTree=gtk.glade.XML(gladefile,windowname, self.specto.glade_gettext) dic={ "on_button_help_clicked": self.show_help, "on_button_save_clicked": self.save, "on_button_clear_clicked": self.clear, "on_button_close_clicked": self.delete_event, "on_button_find_clicked": self.find } #attach the events self.wTree.signal_autoconnect(dic) self.log_dialog=self.wTree.get_widget("log_dialog") icon = gtk.gdk.pixbuf_new_from_file(self.specto.PATH + 'icons/specto_window_icon.png' ) self.log_dialog.set_icon(icon) self.wTree.get_widget("combo_level").set_active(0) #read the log file self.read_log() self.logwindow=gtk.TextBuffer(None) self.log_buffer = self.wTree.get_widget("log_field").get_buffer() self.log_buffer.create_tag("ERROR", foreground="#a40000") self.log_buffer.create_tag("INFO", foreground="#4e9a06") self.log_buffer.create_tag("WARNING", foreground="#c4a000") start = self.log_buffer.get_start_iter() end = self.log_buffer.get_end_iter() self.log_buffer.delete(start, end) iter = self.log_buffer.get_iter_at_offset(0) self.log = self.log.split("\n") for line in self.log: tag = line.split(" - ")[1].strip() self.log_buffer.insert_with_tags_by_name(iter, line + "\n", tag)
34c954c546a0f2f0b6292dd6042e5cae93c8337d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10818/34c954c546a0f2f0b6292dd6042e5cae93c8337d/logger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 23242, 83, 16, 19057, 4672, 365, 18, 13234, 83, 273, 23242, 83, 365, 18, 902, 1251, 273, 19057, 468, 2640, 2151, 5118, 69, 536, 398, 33, 365, 18, 13234, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 23242, 83, 16, 19057, 4672, 365, 18, 13234, 83, 273, 23242, 83, 365, 18, 902, 1251, 273, 19057, 468, 2640, 2151, 5118, 69, 536, 398, 33, 365, 18, 13234, ...
if (self.ready and not self.sent_headers and not self.connection.server.interrupt):
if (self.ready and not self.sent_headers):
def respond(self): """Call the appropriate WSGI app and write its iterable output.""" response = self.wsgi_app(self.environ, self.start_response) try: for chunk in response: # "The start_response callable must not actually transmit # the response headers. Instead, it must store them for the # server or gateway to transmit only after the first # iteration of the application return value that yields # a NON-EMPTY string, or upon the application's first # invocation of the write() callable." (PEP 333) if chunk: self.write(chunk) finally: if hasattr(response, "close"): response.close() if (self.ready and not self.sent_headers and not self.connection.server.interrupt): self.sent_headers = True self.send_headers() if self.chunked_write: self.sendall("0\r\n\r\n")
acc42149c6f09db3b7c163286ba44aeeee07fb89 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/82/acc42149c6f09db3b7c163286ba44aeeee07fb89/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6846, 12, 2890, 4672, 3536, 1477, 326, 5505, 7649, 13797, 595, 471, 1045, 2097, 6087, 876, 12123, 766, 273, 365, 18, 28539, 67, 2910, 12, 2890, 18, 28684, 16, 365, 18, 1937, 67, 2740, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6846, 12, 2890, 4672, 3536, 1477, 326, 5505, 7649, 13797, 595, 471, 1045, 2097, 6087, 876, 12123, 766, 273, 365, 18, 28539, 67, 2910, 12, 2890, 18, 28684, 16, 365, 18, 1937, 67, 2740, ...
print rsq_vector
def plotsnrchisq(gpsTime,frameFile,ligoName,chisqBins,chisqDelta,outputPath): # BE CAREFUL ! The length of the frame file itself (without taking into account the path) is supposed to be 30 characters ! ind1 = len(frameFile) - 30 # this variable is also used in the definition of the plot title ind2 = ind1 + 2 ifoName = frameFile[ind1:ind2] print ifoName chanString = ifoName + ':' + ligoName + '_SNRSQ_0' print chanString # find the start time of the first channel # BE CAREFUL ! it is assumed that the sampling frequency is higher than 200 Hz testOnFirstChannel = frgetvect.frgetvect(frameFile,chanString,-1,0.01,0) gpsStart = testOnFirstChannel[3] # This actually prints only one digit after the . print gpsStart # find the channel which contains the data we want to look at # BE CAREFUL ! it is assumed that the segment length is 128 s segmentLength = 128. position = (float(gpsTime) - float(gpsStart) - segmentLength/2.)/segmentLength position = int(position) chanNumber = str(position) chanNameSnr = ifoName + ':' + ligoName + '_SNRSQ_' + chanNumber print chanNameSnr chanNameChisq = ifoName + ':' + ligoName + '_CHISQ_' + chanNumber # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 startWindow = float(gpsTime) - duration/2. squareSnr_tuple = frgetvect.frgetvect(frameFile,chanNameSnr,startWindow,duration,0) print squareSnr_tuple[0] squareChisq_tuple = frgetvect.frgetvect(frameFile,chanNameChisq,startWindow,duration,0) # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) print snr_vector snr_time = squareSnr_tuple[1] print snr_time # compute the r^2 rsq_vector = squareChisq_tuple[0] chisq_time = squareChisq_tuple[1] print rsq_vector # compute the normalized chisq chisqNorm_vector = rsq_vector/(1 + chisqDelta/chisqBins*squareSnr_tuple[0]) print chisqNorm_vector # Now plot the snr time serie !! figure(1) plot(snr_time - duration/2.,snr_vector) xlabel('time (s)',size='x-large') ylabel(r'$\rho$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_snr.png') # Now plot the r^2 time serie !! figure(2) plot(chisq_time - duration/2.,rsq_vector) xlabel('time (s)',size='x-large') ylabel(r'$r^2$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_rsq.png') # Now plot the normalized chisq time serie !! figure(3) plot(chisq_time - duration/2.,chisqNorm_vector) xlabel('time (s)',size='x-large') ylabel(r'$\chi^2 / (p + \delta^2\rho^2)$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_chisq.png')
4fac04e0504100b75904fdd3ae9bfd8f468c6562 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/4fac04e0504100b75904fdd3ae9bfd8f468c6562/plotsnrchisq_pipe.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 8134, 86, 343, 291, 85, 12, 75, 1121, 950, 16, 3789, 812, 16, 80, 17626, 461, 16, 343, 291, 85, 38, 2679, 16, 343, 291, 85, 9242, 16, 2844, 743, 4672, 225, 468, 9722, 6425, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3207, 8134, 86, 343, 291, 85, 12, 75, 1121, 950, 16, 3789, 812, 16, 80, 17626, 461, 16, 343, 291, 85, 38, 2679, 16, 343, 291, 85, 9242, 16, 2844, 743, 4672, 225, 468, 9722, 6425, 1...
self.bossLiteSession.getNewRunningInstance( self.bossJob ) self.bossJob.runningJob['outputDirectory'] = outdir
def doBOSSSubmit(self): """ _doSubmit_
d9550c06bc4173e74945a83e7b00e7af90ca69a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/d9550c06bc4173e74945a83e7b00e7af90ca69a5/BossLiteBulkInterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 5315, 1260, 11620, 12, 2890, 4672, 3536, 389, 2896, 11620, 67, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5315, 1260, 11620, 12, 2890, 4672, 3536, 389, 2896, 11620, 67, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
print (mb, cc) print amb/10, acc/10
return amb/10, acc/10 def checkDirectionAccuracyForPair(model, reference, direction, clsID, reversedAttributes): constraint = int(model(reference)) prediction = 0 for attr in reversedAttributes: constraint, tc = constraint/3, constraint%3 if tc==2: continue v1, v2 = reference[attr], direction[attr] if v1.isSpecial() or v2.isSpecial(): continue if tc: c = -cmp(v1, v2) else: c = cmp(v1, v2) if not prediction: prediction = c elif prediction != c: return -1 if not prediction: return -3 return c == cmp(reference.getclass(), direction.getclass()) def computeDirectionAccuracyForPairs(model, data, meter, weightK, clsID, nTests = 0): nTests = nTests or 10*len(data) reversedAttrs = model.domain.constraintAttributes[:] reversedAttrs.reverse() actTests = acc = amb = unre = 0 for i in range(10*len(data)): distance = 0 while not distance: ref, dir = data.randomexample(), data.randomexample() distance = meter(ref, dir) weight = math.exp(weightK * distance**2) actTests += weight diracc = checkDirectionAccuracyForPair(model, ref, dir, -1, reversedAttrs) if diracc == -1: amb += weight elif diracc == -3: unre += weight elif diracc: acc += weight return acc/actTests, amb/actTests, unre/actTests def CVByPairs(data, dimensions = None, method = None, **dic): import orngTree cv = orange.MakeRandomIndicesCV(data, 10) meter = orange.ExamplesDistanceConstructor_Euclidean(data) maxDist = 0 for i in range(100): maxDist = max(maxDist, meter(data.randomexample(), data.randomexample())) weightK = 10.0 / maxDist acc = amb = unre = 0 for fold in range(10): train = data.select(cv, fold, negate=1) test = data.select(cv, fold) pa, qid, did, cid = pade(train, dimensions, method, originalAsMeta=True, **dic) tree = orngTree.TreeLearner(pa, maxDepth=4) tacc, tamb, tunre = computeDirectionAccuracyForPairs(tree, data, meter, weightK, -1) acc += tacc amb += tamb unre += tunre return acc/10, amb/10, unre/10
def CVAgainstKnown(data, oracle, dimensions = None, method = None, **dic): cv = orange.MakeRandomIndicesCV(data, 10) for fold in range(10): train = data.select(cv, fold, negate=1) test = data.select(cv, fold) pa, qid, did, cid = pade(train, oracle, dimensions, method, originalAsMeta=True, **dic) tree = orngTree.TreeLearner(pa, maxDepth=4) mb, cc = orngPade.computeAmbiguityAccuracy(tree, test, -1) amb += mb acc += cc print (mb, cc) print amb/10, acc/10
a7cd4bd05f0f929427c72f89b82f8b9110bc3ccb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/a7cd4bd05f0f929427c72f89b82f8b9110bc3ccb/orngPade.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 385, 58, 23530, 334, 11925, 12, 892, 16, 20865, 16, 5769, 273, 599, 16, 707, 273, 599, 16, 2826, 15859, 4672, 8951, 273, 578, 726, 18, 6464, 8529, 8776, 22007, 12, 892, 16, 1728, 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, 385, 58, 23530, 334, 11925, 12, 892, 16, 20865, 16, 5769, 273, 599, 16, 707, 273, 599, 16, 2826, 15859, 4672, 8951, 273, 578, 726, 18, 6464, 8529, 8776, 22007, 12, 892, 16, 1728, 13, ...
primary = 'RelVal'+line.split('@@@')[0].strip() array = line.split('@@@')[1].strip().split()
primary = 'RelVal' + line.split('@@@')[0].split('++')[1].strip()
def main(argv) : """ prepareRelValworkflows prepare workflows for chained processing of RelVal samples - parse file holding cmsDriver commands for 1st and 2nd steps - prepare workflows - prepare WorkflowInjector:Input script - prepare ForceMerge script - prepare DBSMigrationToGlobal script - prepare PhEDExInjection script - prepare local DBS query script required parameters --samples <textfile> : list of RelVal sample parameter-sets in plain text file, one sample per line, # marks comment --version <processing version> : processing version (v1, v2, ... ) --DBSURL <URL> : URL of the local DBS (http://cmsdbsprod.cern.ch/cms_dbs_prod_local_07/servlet/DBSServlet, http://cmssrv46.fnal.gov:8080/DBS126/servlet/DBSServlet) optional parameters : --lumi <number> : initial run for generation (default: 666666), set it to 777777 for high statistics samples --event <number> : initial event number --help (-h) : help --debug (-d) : debug statements """ # default try: version = os.environ.get("CMSSW_VERSION") except: print '' print 'CMSSW version cannot be determined from $CMSSW_VERSION' sys.exit(2) try: architecture = os.environ.get("SCRAM_ARCH") except: print '' print 'CMSSW architecture cannot be determined from $SCRAM_ARCH' sys.exit(2) samples = None processing_version = None initial_run = "666666" initial_event = None debug = 0 DBSURL = None try: opts, args = getopt.getopt(argv, "", ["help", "debug", "samples=", "version=", "DBSURL=", "event=", "lumi="]) except getopt.GetoptError: print main.__doc__ sys.exit(2) # check command line parameter for opt, arg in opts : if opt == "--help" : print main.__doc__ sys.exit() elif opt == "--debug" : debug = 1 elif opt == "--samples" : samples = arg elif opt == "--version" : processing_version = arg
47397be0ad25e900c8367cb1b05a7d6e187b915f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/47397be0ad25e900c8367cb1b05a7d6e187b915f/prepareRelValWorkflows.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...