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
offset = 0
def render_HTMLUI(data): """Callback to render mysql stored data in HTML""" tmp = result.__class__(result) tmp.result = data return tmp
006976a5f252913f17c3c0fed6a24bb0302be5b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/006976a5f252913f17c3c0fed6a24bb0302be5b9/RevEng.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 4870, 5370, 12, 892, 4672, 3536, 2428, 358, 1743, 7219, 4041, 501, 316, 3982, 8395, 1853, 273, 563, 16186, 1106, 972, 12, 2088, 13, 1853, 18, 2088, 273, 501, 327, 1853, 2, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 4870, 5370, 12, 892, 4672, 3536, 2428, 358, 1743, 7219, 4041, 501, 316, 3982, 8395, 1853, 273, 563, 16186, 1106, 972, 12, 2088, 13, 1853, 18, 2088, 273, 501, 327, 1853, 2, -1...
<form name="add_to_basket" action="%(action)s" method="POST">
<form name="add_to_basket" action="%(action)s" method="post">
def tmpl_add(self, recids, personal_baskets, group_baskets, external_baskets, topics, referer, ln=cdslang): """ returns HTML for the basket selection form when adding new records @param recids: list of record ids @param personal_baskets: list of (basket id, basket name, topic) tuples @param group_baskets: list of (bskid, bsk_name, group_name) tuples @param external_baskets: list of (bskid, bsk_name) tuples @param topics: list of all the topics the user owns @param referer: url from where this page has been reached @param ln: language""" _ = gettext_set_language(ln) personal = '' group = '' external = '' if personal_baskets: topic_names = {} map(topic_names.setdefault, [row[2] for row in personal_baskets]) topic_names = topic_names.keys() topic_names.sort() personal_html = '' for topic_name in topic_names: baskets = map(lambda x: (x[0], x[1]), filter(lambda x: x[2]==topic_name, personal_baskets)) baskets.insert(0, (-1, _("Select basket"))) personal_html += """<tr>
0a2abb726af10679038485a34dbc4ac26d70217f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/0a2abb726af10679038485a34dbc4ac26d70217f/webbasket_templates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10720, 67, 1289, 12, 2890, 16, 1950, 2232, 16, 17816, 67, 70, 835, 2413, 16, 1041, 67, 70, 835, 2413, 16, 3903, 67, 70, 835, 2413, 16, 11204, 16, 18068, 16, 7211, 33, 4315, 2069, 539...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10720, 67, 1289, 12, 2890, 16, 1950, 2232, 16, 17816, 67, 70, 835, 2413, 16, 1041, 67, 70, 835, 2413, 16, 3903, 67, 70, 835, 2413, 16, 11204, 16, 18068, 16, 7211, 33, 4315, 2069, 539...
elif pick.state in ['confirmed','assigned']:
elif pick.state in ['confirmed','assigned', 'draft']:
def unlink(self, cr, uid, ids, context=None): for pick in self.browse(cr, uid, ids, context=context): if pick.state in ['done','cancel']: raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,)) elif pick.state in ['confirmed','assigned']: ids2 = [move.id for move in pick.move_lines] context.update({'call_unlink':True}) self.pool.get('stock.move').action_cancel(cr, uid, ids2, context) else: continue return super(stock_picking, self).unlink(cr, uid, ids, context=context)
9f31cb419c4813367d2423edb42cd29e36c49cbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9f31cb419c4813367d2423edb42cd29e36c49cbc/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8255, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 364, 6002, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 16, 819, 33, 2472, 4672, 309, 6002, 18, 2019, 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, 8255, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 364, 6002, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, 16, 819, 33, 2472, 4672, 309, 6002, 18, 2019, 316...
self.editor.InsertText(self.editor.GetCurrentPos(), quote(relative_uri(self.htmlfile(source), target)))
self.editor.InsertText( self.editor.GetCurrentPos(), quote(relative_path(self.htmlfile(source), target)))
def on_insert_path(self, event): if self.project <> None: item = self.activeitem if item != self.root: source = self.tree.GetItemText(item) dlg = wxFileDialog (self, "Choose file", self.project.directory, '', '*.*', wxOPEN|wxFILE_MUST_EXIST) if dlg.ShowModal() == wxID_OK: target = dlg.GetPath() self.editor.InsertText(self.editor.GetCurrentPos(), quote(relative_uri(self.htmlfile(source), target))) dlg.Destroy() else: customMsgBox(self, 'No file selected.', 'wakeup')
0386dacaa4983ab8619dec87afda0aae584bc1ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/0386dacaa4983ab8619dec87afda0aae584bc1ad/main.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 6387, 67, 803, 12, 2890, 16, 871, 4672, 309, 365, 18, 4406, 2813, 599, 30, 761, 273, 365, 18, 3535, 1726, 309, 761, 480, 365, 18, 3085, 30, 1084, 273, 365, 18, 3413, 18, 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, 603, 67, 6387, 67, 803, 12, 2890, 16, 871, 4672, 309, 365, 18, 4406, 2813, 599, 30, 761, 273, 365, 18, 3535, 1726, 309, 761, 480, 365, 18, 3085, 30, 1084, 273, 365, 18, 3413, 18, 9...
users_base = self.users_base
def _lookupuserbyattr(self, name, value, pwd=None): """ returns a record's DN and the groups a uid belongs to as well as a dictionary containing user attributes """ if name == 'dn': if value.find(',') == -1: # micro-optimization: this is not a valid dn because it # doesn't contain any commas; don't bother trying to look it # up msg = '_lookupuserbyattr: not a valid dn "%s"' % value logger.debug(msg) return None, None, None, None
61552a06ab2f3eed498ebf3d6c177043f6924cba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1858/61552a06ab2f3eed498ebf3d6c177043f6924cba/LDAPUserFolder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8664, 1355, 1637, 1747, 12, 2890, 16, 508, 16, 460, 16, 14720, 33, 7036, 4672, 3536, 1135, 279, 1409, 1807, 18001, 471, 326, 3252, 279, 4555, 11081, 358, 487, 5492, 487, 279, 3880, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8664, 1355, 1637, 1747, 12, 2890, 16, 508, 16, 460, 16, 14720, 33, 7036, 4672, 3536, 1135, 279, 1409, 1807, 18001, 471, 326, 3252, 279, 4555, 11081, 358, 487, 5492, 487, 279, 3880, ...
raise ValueError("Adding data to a dictionary failed. There should " "be an even number of key-value-pairs.") self._add_to_dictionary(dictionary, key_value_pairs)
raise ValueError("Adding data to a dictionary failed. There " "should be an even number of key-value-pairs.") for i in range(0, len(key_value_pairs), 2): dictionary[key_value_pairs[i]] = key_value_pairs[i+1] return dictionary
def set_to_dictionary(self, dictionary, *key_value_pairs): """Adds the given 'key_value_pairs' to the dictionary. Example: | Set To Dictionary | ${D1} | key | value | => ${D1} == {'a':1, 'key':'value'} """ if len(key_value_pairs) % 2 != 0: raise ValueError("Adding data to a dictionary failed. There should " "be an even number of key-value-pairs.") self._add_to_dictionary(dictionary, key_value_pairs)
2f5075140c0afeaf5bda26b5924aceb3478d1a14 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7408/2f5075140c0afeaf5bda26b5924aceb3478d1a14/Collections.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 869, 67, 15556, 12, 2890, 16, 3880, 16, 380, 856, 67, 1132, 67, 11545, 4672, 3536, 3655, 326, 864, 296, 856, 67, 1132, 67, 11545, 11, 358, 326, 3880, 18, 225, 5090, 30, 571,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 869, 67, 15556, 12, 2890, 16, 3880, 16, 380, 856, 67, 1132, 67, 11545, 4672, 3536, 3655, 326, 864, 296, 856, 67, 1132, 67, 11545, 11, 358, 326, 3880, 18, 225, 5090, 30, 571,...
def __init__(self, path=None, device=None, PedDevice=None):
def __init__(self, path=None, PedDevice=None):
def __init__(self, path=None, device=None, PedDevice=None): """Create a new Device object based on the specified path or the already existing _ped.Device object. You must provide either a path (e.g., "/dev/sda") or an existing _ped.Device object, but not both."""
a25687a267259a67131cf47c30a10352de335456 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5978/a25687a267259a67131cf47c30a10352de335456/device.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 589, 33, 7036, 16, 453, 329, 3654, 33, 7036, 4672, 3536, 1684, 279, 394, 6077, 733, 2511, 603, 326, 1269, 589, 578, 326, 1818, 2062, 389, 1845, 18, 3654,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 589, 33, 7036, 16, 453, 329, 3654, 33, 7036, 4672, 3536, 1684, 279, 394, 6077, 733, 2511, 603, 326, 1269, 589, 578, 326, 1818, 2062, 389, 1845, 18, 3654,...
user_dir = os.path.expanduser('~')
username = cs.split(os.path.sep, 1)[0] user_dir = os.path.expanduser(username)
def _complete(self, tab=False): """Construct a full list of possible completions and construct and display them in a window. Also check if there's an available argspec (via the inspect module) and bang that on top of the completions too. The return value is whether the list_win is visible or not."""
da4ad3899eb88e515f21a3bc020dc2ce988faeb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/da4ad3899eb88e515f21a3bc020dc2ce988faeb5/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6226, 12, 2890, 16, 3246, 33, 8381, 4672, 3536, 7249, 279, 1983, 666, 434, 3323, 23738, 471, 4872, 471, 2562, 2182, 316, 279, 2742, 18, 8080, 866, 309, 1915, 1807, 392, 2319, 23837,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6226, 12, 2890, 16, 3246, 33, 8381, 4672, 3536, 7249, 279, 1983, 666, 434, 3323, 23738, 471, 4872, 471, 2562, 2182, 316, 279, 2742, 18, 8080, 866, 309, 1915, 1807, 392, 2319, 23837,...
`G`. The columns represent the the conjugacy classes of
`G`. The columns represent the conjugacy classes of
def character_table(self): r""" Returns the matrix of values of the irreducible characters of a permutation group `G` at the conjugacy classes of `G`. The columns represent the the conjugacy classes of `G` and the rows represent the different irreducible characters in the ordering given by GAP. EXAMPLES:: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: G.order() 12 sage: G.character_table() [ 1 1 1 1] [ 1 1 -zeta3 - 1 zeta3] [ 1 1 zeta3 -zeta3 - 1] [ 3 -1 0 0] sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: CT = gap(G).CharacterTable() Type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 sage: G.character_table() [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] sage: CT = gap(G).CharacterTable() Again, type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: SymmetricGroup(2).character_table() [ 1 -1] [ 1 1] sage: SymmetricGroup(3).character_table() [ 1 -1 1] [ 2 0 -1] [ 1 1 1] sage: SymmetricGroup(5).character_table() [ 1 -1 1 1 -1 -1 1] [ 4 -2 0 1 1 0 -1] [ 5 -1 1 -1 -1 1 0] [ 6 0 -2 0 0 0 1] [ 5 1 1 -1 1 -1 0] [ 4 2 0 1 -1 0 -1] [ 1 1 1 1 1 1 1] sage: list(AlternatingGroup(6).character_table()) [(1, 1, 1, 1, 1, 1, 1), (5, 1, 2, -1, -1, 0, 0), (5, 1, -1, 2, -1, 0, 0), (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), (8, 0, -1, -1, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1), (9, 1, 0, 0, 1, -1, -1), (10, -2, 1, 1, 0, 0, 0)] Suppose that you have a class function `f(g)` on `G` and you know the values `v_1, ..., v_n` on the conjugacy class elements in ``conjugacy_classes_representatives(G)`` = `[g_1, \ldots, g_n]`. Since the irreducible characters `\rho_1, \ldots, \rho_n` of `G` form an `E`-basis of the space of all class functions (`E` a "sufficiently large" cyclotomic field), such a class function is a linear combination of these basis elements, `f = c_1\rho_1 + \cdots + c_n\rho_n`. To find the coefficients `c_i`, you simply solve the linear system ``character_table_values(G)``\*`[v_1, ..., v_n] = [c_1, ..., c_n]`, where `[v_1, ...,v_n]` = ``character_table_values(G)`` `^{-1}[c_1, ...,c_n]`. AUTHORS: - David Joyner and William Stein (2006-01-04)
f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/f5f8be9435d58a2a709e6aa602d3c0e6ac097c6a/permgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3351, 67, 2121, 12, 2890, 4672, 436, 8395, 2860, 326, 3148, 434, 924, 434, 326, 9482, 1118, 5286, 1523, 3949, 434, 279, 17440, 1041, 1375, 43, 68, 622, 326, 10550, 637, 3505, 3318, 434, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3351, 67, 2121, 12, 2890, 4672, 436, 8395, 2860, 326, 3148, 434, 924, 434, 326, 9482, 1118, 5286, 1523, 3949, 434, 279, 17440, 1041, 1375, 43, 68, 622, 326, 10550, 637, 3505, 3318, 434, ...
if '/' in config_name: config_name, platform_id = config_name.split('/', 1)
if platform_id:
def process_admin_request(self, req, cat, page, config_name): data = {}
118e21a1ce99bb8955d9c561f20f188dcea67061 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4547/118e21a1ce99bb8955d9c561f20f188dcea67061/admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 3666, 67, 2293, 12, 2890, 16, 1111, 16, 6573, 16, 1363, 16, 642, 67, 529, 4672, 501, 273, 2618, 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, 1207, 67, 3666, 67, 2293, 12, 2890, 16, 1111, 16, 6573, 16, 1363, 16, 642, 67, 529, 4672, 501, 273, 2618, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
set_dependencies(analisys, dependencies, path)
set_dependencies(analysis, dependencies, path)
def MERGE(*args): common_prefix = os.path.dirname(os.path.commonprefix([os.path.abspath(a.scripts[-1][1]) for a in args])) if common_prefix[-1] != os.sep: common_prefix += os.sep print "Common prefix: %s" % common_prefix dependencies = {} for analisys in args: path = os.path.abspath(analisys.scripts[-1][1]).replace(common_prefix, "", 1) path = os.path.splitext(path)[0] set_dependencies(analisys, dependencies, path)
dc6418bcc534841624abc6688b456d8060ecfb12 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11925/dc6418bcc534841624abc6688b456d8060ecfb12/Build.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 490, 654, 7113, 30857, 1968, 4672, 2975, 67, 3239, 273, 1140, 18, 803, 18, 12287, 12, 538, 18, 803, 18, 6054, 3239, 3816, 538, 18, 803, 18, 5113, 803, 12, 69, 18, 12827, 18919, 21, 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, 490, 654, 7113, 30857, 1968, 4672, 2975, 67, 3239, 273, 1140, 18, 803, 18, 12287, 12, 538, 18, 803, 18, 6054, 3239, 3816, 538, 18, 803, 18, 5113, 803, 12, 69, 18, 12827, 18919, 21, 6...
cell_6_a = self.tmpl_inputdate_box("d1", d1y, d1m, d1d, ln=ln) cell_6_b = create_inputdate_box("d2", d2y, d2m, d2d, ln=ln)
cell_6_a = self.tmpl_inputdate("d1", ln, d1y, d1m, d1d) cell_6_b = self.tmpl_inputdate("d2", ln, d2y, d2m, d2d)
def tmpl_search_box(self, ln, weburl, as, cc, cc_intl, ot, sp, action, fieldslist, f1, f2, f3, m1, m2, m3, p1, p2, p3, op1, op2, rm, p, f, coll_selects, d1y, d2y, d1m, d2m, d1d, d2d, sort_formats, sf, so, ranks, sc, rg, formats, of): """ Displays the *Nearest search terms* box
2a6e158305f7ee6a2932326b0e81fcbe279f205f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/2a6e158305f7ee6a2932326b0e81fcbe279f205f/websearch_templates.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10720, 67, 3072, 67, 2147, 12, 2890, 16, 7211, 16, 3311, 718, 16, 487, 16, 4946, 16, 4946, 67, 474, 80, 16, 15835, 16, 1694, 16, 1301, 16, 1466, 1098, 16, 284, 21, 16, 284, 22, 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, 10720, 67, 3072, 67, 2147, 12, 2890, 16, 7211, 16, 3311, 718, 16, 487, 16, 4946, 16, 4946, 67, 474, 80, 16, 15835, 16, 1694, 16, 1301, 16, 1466, 1098, 16, 284, 21, 16, 284, 22, 16,...
res = buildscript.execute('bunzip2 -dc %s | tar xf -' % localfile)
res = buildscript.execute('bunzip2 -dc "%s" | tar xf -' % localfile)
def do_unpack(self, buildscript): os.chdir(buildscript.config.checkoutroot) localfile = self.get_localfile(buildscript) srcdir = self.get_srcdir(buildscript)
f0c1fb2c65c875a0a30f240aa4a54385371a72e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4596/f0c1fb2c65c875a0a30f240aa4a54385371a72e4/tarball.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 17309, 12, 2890, 16, 1361, 4263, 4672, 1140, 18, 343, 1214, 12, 3510, 4263, 18, 1425, 18, 17300, 3085, 13, 1191, 768, 273, 365, 18, 588, 67, 3729, 768, 12, 3510, 4263, 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, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 17309, 12, 2890, 16, 1361, 4263, 4672, 1140, 18, 343, 1214, 12, 3510, 4263, 18, 1425, 18, 17300, 3085, 13, 1191, 768, 273, 365, 18, 588, 67, 3729, 768, 12, 3510, 4263, 13, 1...
pyrex_include_dirs=[ 'pcs/bpf' ],
def run(self): clean.clean.run(self) if self.all and os.path.exists(pcap_cache): print "removing '%s'" % pcap_cache os.unlink(pcap_cache)
6c6b4220d452cb14631a309007897baa3f3d6a20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5910/6c6b4220d452cb14631a309007897baa3f3d6a20/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2721, 18, 6200, 18, 2681, 12, 2890, 13, 309, 365, 18, 454, 471, 1140, 18, 803, 18, 1808, 12, 2436, 438, 67, 2493, 4672, 1172, 315, 2764, 13767, 1995, 87, 4970, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2721, 18, 6200, 18, 2681, 12, 2890, 13, 309, 365, 18, 454, 471, 1140, 18, 803, 18, 1808, 12, 2436, 438, 67, 2493, 4672, 1172, 315, 2764, 13767, 1995, 87, 4970, ...
reactor.callFromThread(self.deferred.errback, error.PBPScriptError())
e = getattr(self, 'last_failure', None) if e is None: e = error.PBPScriptError() reactor.callFromThread(self.deferred.errback, e)
def later(): t.timer = reactor.callLater(self.waiting, self._doneWaiting, t, s)
82a69cd8cb3fd75cfc003a6997b2926265fad80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2493/82a69cd8cb3fd75cfc003a6997b2926265fad80c/pbpscript.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5137, 13332, 268, 18, 12542, 273, 19178, 18, 1991, 20607, 12, 2890, 18, 20241, 16, 365, 6315, 8734, 15946, 16, 268, 16, 272, 13, 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, 5137, 13332, 268, 18, 12542, 273, 19178, 18, 1991, 20607, 12, 2890, 18, 20241, 16, 365, 6315, 8734, 15946, 16, 268, 16, 272, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if expressionMode: expectedDesc = "expression" else: expectedDesc = "statement" raiseSyntaxException(stream.curr(), expectedDesc)
if stream.currIsType("token", "SEMICOLON") and not expressionMode: item = createItemNode("emptyStatement", stream) stream.next() else: if expressionMode: expectedDesc = "expression" else: expectedDesc = "statement" raiseSyntaxException(stream.curr(), expectedDesc)
def readStatement (stream, expressionMode = False, overrunSemicolon = True): item = None if currIsIdentifier(stream, True): # statement starts with an identifier variable = readVariable(stream, True) variable = readObjectOperation(stream, variable); if stream.currIsType("token", ASSIGN_OPERATORS): # This is an assignment item = createItemNode("assignment", stream) item.set("operator", stream.currDetail()) stream.next() item.addListChild("left", variable) item.addListChild("right", readExpression(stream)) else: # Something else comes after the variable -> It's a sole variable item = variable # Any comments found for the variable belong to the extracted item commentsChild = variable.getChild("commentsBefore", False) if item and commentsChild != None: variable.removeChild(commentsChild) item.addChild(commentsChild, 0) elif stream.currIsType("protected", "FUNCTION"): stream.next() item = createItemNode("function", stream) # Read optional function name if not expressionMode and stream.currIsType("name"): item.set("name", stream.currSource()) stream.next() readParamList(item, stream) item.addListChild("body", readBlock(stream)) elif stream.currIsType("token", "LP"): stream.next() item = createItemNode("group", stream) if expressionMode: item.addChild(readExpression(stream)) else: item.addChild(readStatement(stream)) stream.expectCurrType("token", "RP") stream.next() item = readObjectOperation(stream, item); elif expressionMode and stream.currIsType("string"): item = createItemNode("constant", stream) item.set("constantType", "string") item.set("value", stream.currSource()) stream.next() # Allow function calls for strings. E.g.: "a string".match(...) item = readObjectOperation(stream, item, True); elif expressionMode and stream.currIsType("number"): item = createItemNode("constant", stream) item.set("constantType", "number") item.set("value", stream.currSource()) stream.next() elif expressionMode and stream.currIsType("regexp"): item = createItemNode("constant", stream) item.set("constantType", "regexp") item.set("value", stream.currSource()) stream.next() item = readObjectOperation(stream, item); elif expressionMode and (stream.currIsType("protected", "TRUE") or stream.currIsType("protected", "FALSE")): item = createItemNode("constant", stream) item.set("constantType", "boolean") item.set("value", stream.currSource()) stream.next() elif expressionMode and stream.currIsType("protected", "NULL"): item = createItemNode("constant", stream) item.set("constantType", "null") item.set("value", stream.currSource()) stream.next() elif expressionMode and stream.currIsType("token", "LC"): item = readMap(stream) elif expressionMode and stream.currIsType("token", "LB"): item = readArray(stream) elif stream.currIsType("token", SINGLE_LEFT_OPERATORS) or stream.currIsType("protected", "TYPEOF"): item = createItemNode("operation", stream) item.set("operator", stream.currDetail()) item.set("left", "true") stream.next() item.addListChild("first", readExpression(stream)) elif stream.currIsType("protected", "NEW"): item = readInstantiation(stream) item = readObjectOperation(stream, item); elif not expressionMode and stream.currIsType("protected", "VAR"): item = createItemNode("definition", stream) stream.next() finished = False while not finished: if not currIsIdentifier(stream, False): raiseSyntaxException(stream.curr(), "identifier") item.set("identifier", stream.currSource()) stream.next() if stream.currIsType("token", "ASSIGN"): stream.next() item.addListChild("assignment", readExpression(stream)) # Check whether anothe definition follows, e.g. "var a, b=1, c=4" if stream.currIsType("token", "COMMA"): stream.next() else: finished = True elif not expressionMode and stream.currIsType("protected", LOOP_KEYWORDS): item = readLoop(stream) elif not expressionMode and stream.currIsType("protected", "DO"): item = readDoWhile(stream) elif not expressionMode and stream.currIsType("protected", "SWITCH"): item = readSwitch(stream) elif not expressionMode and stream.currIsType("protected", "TRY"): item = readTryCatch(stream) elif not expressionMode and stream.currIsType("token", "LC"): item = readBlock(stream) elif not expressionMode and stream.currIsType("protected", "RETURN"): item = createItemNode("return", stream) stream.next() # NOTE: The expression after the return keyword is optional if not stream.currIsType("token", "SEMICOLON") and not stream.currIsType("token", "RC"): item.addListChild("expression", readExpression(stream)) elif not expressionMode and stream.currIsType("protected", "THROW"): item = createItemNode("throw", stream) stream.next() item.addListChild("expression", readExpression(stream)) elif not expressionMode and stream.currIsType("protected", "DELETE"): item = createItemNode("delete", stream) stream.next() item.addListChild("expression", readExpression(stream)) elif not expressionMode and stream.currIsType("protected", "BREAK"): item = createItemNode("break", stream) stream.next() elif not expressionMode and stream.currIsType("protected", "CONTINUE"): item = createItemNode("continue", stream) stream.next() if not item: if expressionMode: expectedDesc = "expression" else: expectedDesc = "statement" raiseSyntaxException(stream.curr(), expectedDesc) # check whether this is an operation if stream.currIsType("token", MULTI_TOKEN_OPERATORS) or stream.currIsType("protected", MULTI_PROTECTED_OPERATORS) or stream.currIsType("token", SINGLE_RIGHT_OPERATORS): # its an operation -> We've already parsed the first operand (in item) parsedItem = item operator = stream.currDetail() item = createItemNode("operation", stream) item.addListChild("first", parsedItem) item.set("operator", operator) stream.next() if operator in MULTI_TOKEN_OPERATORS or operator in MULTI_PROTECTED_OPERATORS: # It's a multi operator -> There must be a second argument item.addListChild("second", readExpression(stream)) if operator == "HOOK": # It's a "? :" operation -> There must be a third argument stream.expectCurrType("token", "COLON") stream.next() item.addListChild("third", readExpression(stream)) # check whether this is a combined statement, e.g. "bla(), i++" if not expressionMode and stream.currIsType("token", "COMMA"): statementList = createItemNode("statementList", stream); statementList.addChild(item) while stream.currIsType("token", "COMMA"): stream.next(); statementList.addChild(readStatement(stream, False, False)) item = statementList # go over the optional semicolon if not expressionMode and overrunSemicolon and stream.currIsType("token", "SEMICOLON"): stream.next() return item
0b498bc07686244c634158c56a6afa5879f0bb3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/0b498bc07686244c634158c56a6afa5879f0bb3a/treegenerator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 3406, 261, 3256, 16, 2652, 2309, 273, 1083, 16, 5713, 318, 13185, 17280, 273, 1053, 4672, 761, 273, 599, 225, 309, 4306, 2520, 3004, 12, 3256, 16, 1053, 4672, 468, 3021, 2542, 598, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3406, 261, 3256, 16, 2652, 2309, 273, 1083, 16, 5713, 318, 13185, 17280, 273, 1053, 4672, 761, 273, 599, 225, 309, 4306, 2520, 3004, 12, 3256, 16, 1053, 4672, 468, 3021, 2542, 598, ...
if chunk.find('<div id="sign_in_box">') != -1:
if chunk.find('<div class="signin">') != -1:
def download_file(filename,url): global options global checksums global filesizes resume_start = 0 if os.path.exists(filename): if filename in checksums: print 'Checking existing ' + filename file_size = os.stat(filename).st_size if file_size == filesizes[filename]: file_checksum = md5_checksum(filename) if file_checksum == checksums[filename]: if options.progress: print '- OK ' + filename return True elif file_size < filesizes[filename]: if options.progress: print '- %s is too short' % (filename) if options.debug: print '- %s is %d bytes, should be %d bytes' % (filename, file_size, filesizes[filename]) if options.resume: resume_start = file_size if options.dryrun and not re.match(r"release_metadata", filename): global download_list download_info = "download %s %s" % (filename, url) download_list.append(download_info) return True print 'Downloading ' + filename global headers request_headers = headers.copy() # want a fresh copy for each request if resume_start > 0: request_headers['Range'] = "bytes=%d-%d" % (resume_start, filesizes[filename]) req = urllib2.Request(url, None, request_headers) CHUNK = 128 * 1024 size = 0 filesize = -1 start_time = time.time() last_time = start_time last_size = size try: response = urllib2.urlopen(req) chunk = response.read(CHUNK) if chunk.find('<div id="sign_in_box">') != -1: # our urllib2 cookies have gone awol - login again login(False) req = urllib2.Request(url, None, request_headers) response = urllib2.urlopen(req) chunk = response.read(CHUNK) if chunk.find('<div id="sign_in_box">') != -1: # still broken - give up on this one print "*** ERROR trying to download %s" % (filename) return False info = response.info() if 'Content-Length' in info: filesize = resume_start + int(info['Content-Length']) # NB. length of the requested content, taking into account the range if resume_start > 0 and 'Content-Range' not in info: # server doesn't believe in our range filesize = int(info['Content-Length']) if options.debug: print "Server reports filesize as %d, ignoring our range request (%d-%d)" % (filesize, resume_start, filesizes[filename]) resume_start = 0; # will have to download from scratch if filename in filesizes: if filesize != filesizes[filename]: print "WARNING: %s size %d does not match release_metadata.xml (%d)" % ( filename, filesize, filesizes[filename]) else: match = re.search('>([^>]+Licen[^<]+)<', chunk, re.IGNORECASE) if match: license = match.group(1).replace('&amp;','&') print "*** %s is subject to the %s which you have not yet accepted\n" % (filename,license) return False print "*** HTTP response did not contain 'Content-Length' when expected" if options.debug: print info print chunk return False except urllib2.URLError, e: print '- ERROR: Failed to start downloading ' + filename if hasattr(e, 'reason'): print 'Reason: ', e.reason elif hasattr(e, 'code'): print 'Error code: ', e.code return False # we are now up and running, and chunk contains the start of the download if options.debug: print "\nReading %s from effective URL %s" % (filename, response.geturl()) try: if resume_start > 0: fp = open(filename, 'a+b') # append to existing content if options.progress: print " - Resuming at offset %d" % (resume_start) size = resume_start last_size = size else: fp = open(filename, 'wb') # write new file md5 = hashlib.md5() while True: fp.write(chunk) md5.update(chunk) size += len(chunk) now = time.time() if options.progress and now-last_time > 20: rate = (size-last_size)/(now-last_time) estimate = "" if filesize > 0 and rate > 0: remaining_seconds = (filesize-size)/rate if remaining_seconds > 110: remaining = "%d minutes" % (remaining_seconds/60) else: remaining = "%d seconds" % remaining_seconds estimate = "- %d%% est. %s" % ((100*size/filesize), remaining) print "- %d Kb (%d Kb/s) %s" % (size/1024, (rate/1024)+0.5, estimate) last_time = now last_size = size chunk = response.read(CHUNK) if not chunk: break fp.close() #handle errors except urllib2.URLError, e: print '- ERROR: Failed while downloading ' + filename if hasattr(e, 'reason'): print 'Reason: ', e.reason elif hasattr(e, 'code'): print 'Error code: ', e.code return False if options.debug: info = response.info() print "Info from final response of transfer:" print response.info() if filesize > 0 and size != filesize: print "Incomplete transfer - only received %d bytes of the expected %d byte file" % (size, filesize) return False if options.progress: now = time.time() print "- Completed %s - %d Kb in %d seconds" % (filename, (filesize/1024)+0.5, now-start_time) if filename in checksums: download_checksum = md5.hexdigest().upper() if resume_start > 0: # did a partial download, so need to checksum the whole file download_checksum = md5_checksum(filename) if download_checksum != checksums[filename]: if options.debug: print '- Checksum for %s was %s, expected %s' % (filename, download_checksum, checksums[filename]) print '- ERROR: %s checksum does not match' % filename return False return True
cf7d8af99e779ba15abf23b2ce9bc3c9383f5b1d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4206/cf7d8af99e779ba15abf23b2ce9bc3c9383f5b1d/downloadkit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4224, 67, 768, 12, 3459, 16, 718, 4672, 2552, 702, 2552, 26829, 2552, 1390, 3128, 10774, 67, 1937, 273, 374, 309, 1140, 18, 803, 18, 1808, 12, 3459, 4672, 309, 1544, 316, 26829, 30, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 768, 12, 3459, 16, 718, 4672, 2552, 702, 2552, 26829, 2552, 1390, 3128, 10774, 67, 1937, 273, 374, 309, 1140, 18, 803, 18, 1808, 12, 3459, 4672, 309, 1544, 316, 26829, 30, 11...
ceTypes = self.am_getOption('CETypes',[]) ceConfList = self.am_getOption('CEs',[])
ceTypes = self.am_getOption( 'CETypes', [] ) ceConfList = self.am_getOption( 'CEs', [] )
def getQueues(self): """ Get the list of relevant CEs and their descriptions """ ceFactory = ComputingElementFactory() ceTypes = self.am_getOption('CETypes',[]) ceConfList = self.am_getOption('CEs',[]) ceList = [] # Look up CE definitions in the site CS description gridType = self.siteName.split('.')[0] result = gConfig.getSections('/Resources/Sites/%s/%s/CEs' % (gridType,self.siteName)) if not result['OK']: return S_ERROR('Failed to look up the CS for the site %s CEs' % self.siteName) if not result['Value']: return S_ERROR('No CEs found for site %s' % self.siteName) ceTotalList = result['Value'] for ce in ceTotalList: if (ceConfList and ce in ceConfList) or not ceConfList: ceType = gConfig.getValue('/Resources/Sites/%s/%s/CEs/%s/CEType' % (gridType,self.siteName,ce), 'Unknown') result = gConfig.getOptionsDict('/Resources/Sites/%s/%s/CEs/%s' % (gridType,self.siteName,ce) ) if not result['OK']: return S_ERROR('Failed to look up the CS for ce %s' % ce ) ceDict = result['Value'] if ceType in ceTypes: ceList.append((ce,ceType,ceDict)) self.queueDict = {} for ce,ceType,ceDict in ceList: section = '/Resources/Sites/%s/%s/CEs/%s/Queues' % (gridType,self.siteName,ce) result = gConfig.getSections(section) if not result['OK']: return S_ERROR('Failed to look up the CS for queues') if not result['Value']: return S_ERROR('No Queues found for site %s, ce %s' % (self.siteName,ce)) queues = result['Value'] for queue in queues: result = gConfig.getOptionsDict('%s/%s' % (section,queue) ) if not result['OK']: return S_ERROR('Failed to look up the CS for ce,queue %s,%s' % (ce,queue) )
fecf3d418a4e3a08002c58982e809e7e4b152546 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fecf3d418a4e3a08002c58982e809e7e4b152546/SiteDirector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 17428, 12, 2890, 4672, 3536, 968, 326, 666, 434, 9368, 385, 6705, 471, 3675, 15550, 3536, 225, 5898, 1733, 273, 14169, 310, 1046, 1733, 1435, 225, 5898, 2016, 273, 365, 18, 301, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 17428, 12, 2890, 4672, 3536, 968, 326, 666, 434, 9368, 385, 6705, 471, 3675, 15550, 3536, 225, 5898, 1733, 273, 14169, 310, 1046, 1733, 1435, 225, 5898, 2016, 273, 365, 18, 301, 67,...
runpath_list = binary_info["runpath"] + checkpkg.SYS_DEFAULT_RUNPATH
runpath_list = binary_info["runpath"] + tuple(checkpkg.SYS_DEFAULT_RUNPATH)
def Libraries(pkg_data, error_mgr, logger, path_and_pkg_by_soname): pkgname = pkg_data["basic_stats"]["pkgname"] logger.debug("Libraries(): pkgname = %s", repr(pkgname)) orphan_sonames = [] required_deps = [] isalist = pkg_data["isalist"] ldd_emulator = checkpkg.LddEmulator() for binary_info in pkg_data["binaries_dump_info"]: for soname in binary_info["needed sonames"]: resolved = False path_list = path_and_pkg_by_soname[soname].keys() logger.debug("%s @ %s: looking for %s in %s", soname, binary_info["path"], binary_info["runpath"], path_list) runpath_list = binary_info["runpath"] + checkpkg.SYS_DEFAULT_RUNPATH for runpath in runpath_list: resolved_path = ldd_emulator.ResolveSoname(runpath, soname, isalist, path_list) if resolved_path: logger.debug("%s needed by %s:", soname, binary_info["path"]) logger.debug("=> %s provided by %s", resolved_path, path_and_pkg_by_soname[soname][resolved_path]) resolved = True req_pkg = path_and_pkg_by_soname[soname][resolved_path][-1] reason = ("provides %s/%s needed by %s" % (resolved_path, soname, binary_info["path"])) for bad_path, bad_soname, msg in DEPRECATED_LIBRARY_LOCATIONS: if resolved_path == bad_path and soname == bad_soname: logger.debug("Bad lib found: %s/%s", bad_path, bad_soname) error_mgr.ReportError( pkgname, "deprecated-library", ("%s %s %s/%s" % (binary_info["path"], msg, resolved_path, soname))) required_deps.append((req_pkg, reason)) break if not resolved: orphan_sonames.append((soname, binary_info["path"])) orphan_sonames = set(orphan_sonames) for soname, binary_path in orphan_sonames: error_mgr.ReportError( pkgname, "soname-not-found", "%s is needed by %s" % (soname, binary_path)) # TODO: Report orphan sonames here return required_deps
49089e4cba607c9e0b7a52a7c32dca50bbef57c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3137/49089e4cba607c9e0b7a52a7c32dca50bbef57c5/dependency_checks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10560, 11042, 12, 10657, 67, 892, 16, 555, 67, 13552, 16, 1194, 16, 589, 67, 464, 67, 10657, 67, 1637, 67, 816, 339, 4672, 29348, 273, 3475, 67, 892, 9614, 13240, 67, 5296, 6, 6362, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10560, 11042, 12, 10657, 67, 892, 16, 555, 67, 13552, 16, 1194, 16, 589, 67, 464, 67, 10657, 67, 1637, 67, 816, 339, 4672, 29348, 273, 3475, 67, 892, 9614, 13240, 67, 5296, 6, 6362, ...
def powtest(type): if type != float: print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if pow(type(i), 0) != 1: raise ValueError, 'pow('+str(i)+',0) != 1' if pow(type(i), 1) != type(i): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if pow(type(0), 1) != type(0): raise ValueError, 'pow(0,'+str(i)+') != 0' if pow(type(1), 1) != type(1): raise ValueError, 'pow(1,'+str(i)+') != 1'
def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(PowTest)) test.test_support.run_suite(suite)
def powtest(type): if type != float: print " Testing 2-argument pow() function..." for i in range(-1000, 1000): if pow(type(i), 0) != 1: raise ValueError, 'pow('+str(i)+',0) != 1' if pow(type(i), 1) != type(i): raise ValueError, 'pow('+str(i)+',1) != '+str(i) if pow(type(0), 1) != type(0): raise ValueError, 'pow(0,'+str(i)+') != 0' if pow(type(1), 1) != type(1): raise ValueError, 'pow(1,'+str(i)+') != 1' for i in range(-100, 100): if pow(type(i), 3) != i*i*i: raise ValueError, 'pow('+str(i)+',3) != '+str(i*i*i) pow2 = 1 for i in range(0,31): if pow(2, i) != pow2: raise ValueError, 'pow(2,'+str(i)+') != '+str(pow2) if i != 30 : pow2 = pow2*2 for othertype in int, long: for i in range(-10, 0) + range(1, 10): ii = type(i) for j in range(1, 11): jj = -othertype(j) try: pow(ii, jj) except ValueError: raise ValueError, "pow(%s, %s) failed" % (ii, jj) for othertype in int, long, float: for i in range(1, 100): zero = type(0) exp = -othertype(i/10.0) if exp == 0: continue try: pow(zero, exp) except ZeroDivisionError: pass # taking zero to any negative exponent should fail else: raise ValueError, "pow(%s, %s) did not fail" % (zero, exp) print " Testing 3-argument pow() function..." il, ih = -20, 20 jl, jh = -5, 5 kl, kh = -10, 10 compare = cmp if type == float: il = 1 compare = test_support.fcmp elif type == int: jl = 0 elif type == long: jl, jh = 0, 15 for i in range(il, ih+1): for j in range(jl, jh+1): for k in range(kl, kh+1): if k != 0: if type == float or j < 0: try: pow(type(i),j,k) except TypeError: pass else: raise ValueError, "expected TypeError from " + \ "pow%r" % ((type(i), j, k),) continue if compare(pow(type(i),j,k), pow(type(i),j)% type(k)): raise ValueError, "pow(" +str(i)+ "," +str(j)+ \ "," +str(k)+ ") != pow(" +str(i)+ "," + \ str(j)+ ") % " +str(k)
a39a4f829a3263717f8ce8cebc06a431dbdc9238 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a39a4f829a3263717f8ce8cebc06a431dbdc9238/test_pow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 11371, 273, 2836, 3813, 18, 4709, 13587, 1435, 11371, 18, 1289, 4709, 12, 4873, 3813, 18, 6540, 13587, 12, 28289, 4709, 3719, 1842, 18, 3813, 67, 13261, 18, 2681, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 13332, 11371, 273, 2836, 3813, 18, 4709, 13587, 1435, 11371, 18, 1289, 4709, 12, 4873, 3813, 18, 6540, 13587, 12, 28289, 4709, 3719, 1842, 18, 3813, 67, 13261, 18, 2681, ...
r"(?P<list>^(?P<ldepth>\s+)(?:\*|\d+\.|[a-zA-Z]+\.) )",
r"(?P<list>^(?P<ldepth>\s+)(?:\*|\d+\.|[a-zA-Z]\.|[ivxIVX]{1,5}\.) )",
def process(self, req, text, in_paragraph=False): if self.error: return system_message(Markup('Error: Failed to load processor ' '<code>%s</code>', self.name), self.error) text = self.processor(req, text) if in_paragraph: content_for_span = None interrupt_paragraph = False if isinstance(text, Element): tagname = text.tagname.lower() if tagname == 'div': class_ = text.attr.get('class_', '') if class_ and 'code' in class_: content_for_span = text.children else: interrupt_paragraph = True elif tagname == 'table': interrupt_paragraph = True else: match = re.match(self._code_block_re, text) if match: if match.group(1) and 'code' in match.group(1): content_for_span = match.group(2) else: interrupt_paragraph = True elif text.startswith('<table'): interrupt_paragraph = True if content_for_span: text = html.SPAN(class_='code-block')[content_for_span] elif interrupt_paragraph: text = "</p>%s<p>" % text return to_unicode(text)
6a4ca7278685b1828c8489159e6ff7cd2d1648be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/6a4ca7278685b1828c8489159e6ff7cd2d1648be/formatter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 2890, 16, 1111, 16, 977, 16, 316, 67, 22445, 33, 8381, 4672, 309, 365, 18, 1636, 30, 327, 2619, 67, 2150, 12, 13111, 2668, 668, 30, 11175, 358, 1262, 6659, 296, 2368, 710, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2890, 16, 1111, 16, 977, 16, 316, 67, 22445, 33, 8381, 4672, 309, 365, 18, 1636, 30, 327, 2619, 67, 2150, 12, 13111, 2668, 668, 30, 11175, 358, 1262, 6659, 296, 2368, 710, ...
tmp_rp = dir_rp.append("high_perms") tmp_rp.touch() try: tmp_rp.chmod(07000) tmp_rp.chmod(07777)
tmpf_rp = dir_rp.append("high_perms_file") tmpf_rp.touch() tmpd_rp = dir_rp.append("high_perms_dir") tmpd_rp.touch() try: tmpf_rp.chmod(07000) tmpf_rp.chmod(07777) tmpd_rp.chmod(07000) tmpd_rp.chmod(07777)
def set_high_perms_readwrite(self, dir_rp): """Test for writing high-bit permissions like suid""" tmp_rp = dir_rp.append("high_perms") tmp_rp.touch() try: tmp_rp.chmod(07000) tmp_rp.chmod(07777) except (OSError, IOError): self.high_perms = 0 else: self.high_perms = 1 tmp_rp.delete()
d695afed412d3285ba13f7aa164fe5a6b74a245c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6202/d695afed412d3285ba13f7aa164fe5a6b74a245c/fs_abilities.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 8766, 67, 15969, 67, 896, 2626, 12, 2890, 16, 1577, 67, 13832, 4672, 3536, 4709, 364, 7410, 3551, 17, 3682, 4371, 3007, 1597, 350, 8395, 1853, 74, 67, 13832, 273, 1577, 67, 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, 444, 67, 8766, 67, 15969, 67, 896, 2626, 12, 2890, 16, 1577, 67, 13832, 4672, 3536, 4709, 364, 7410, 3551, 17, 3682, 4371, 3007, 1597, 350, 8395, 1853, 74, 67, 13832, 273, 1577, 67, 13...
andi t3, t3, 16 or reg, reg, t3
andi t4, t3, 16, flags=(EZF,) or reg, reg, t4 mov t1, t1, t3, flags=(nCEZF,)
def macroop BSF_R_R { # Determine if the input was zero, and also move it to a temp reg. mov t1, t1, t0, dataSize=8 and t1, regm, regm, flags=(ZF,) bri t0, label("end"), flags=(CZF,) # Zero out the result register movi reg, reg, 0 subi t2, t1, 1 xor t1, t2, t1 # Bit 6 srli t3, t1, 32, dataSize=8 andi t3, t3, 32 or reg, reg, t3 # Bit 5 srli t3, t1, 16, dataSize=8 andi t3, t3, 16 or reg, reg, t3 # Bit 4 srli t3, t1, 8, dataSize=8 andi t3, t3, 8 or reg, reg, t3 # Bit 3 srli t3, t1, 4, dataSize=8 andi t3, t3, 4 or reg, reg, t3 # Bit 2 srli t3, t1, 2, dataSize=8 andi t3, t3, 2 or reg, reg, t3 # Bit 1 srli t3, t1, 1, dataSize=8 andi t3, t3, 1 or reg, reg, t3
8e2991b529fd63f4d7c56518ebfbd2424f964172 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6787/8e2991b529fd63f4d7c56518ebfbd2424f964172/bit_scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11522, 556, 605, 22395, 67, 54, 67, 54, 288, 468, 10229, 309, 326, 810, 1703, 3634, 16, 471, 2546, 3635, 518, 358, 279, 1906, 960, 18, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 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, 11522, 556, 605, 22395, 67, 54, 67, 54, 288, 468, 10229, 309, 326, 810, 1703, 3634, 16, 471, 2546, 3635, 518, 358, 279, 1906, 960, 18, 5730, 268, 21, 16, 268, 21, 16, 268, 20, 16, ...
if node.attributes["type"].value == "recording": tmpfile = string.split(os.path.join(recordingpath, node.attributes["filename"].value), '/') else: tmpfile = string.split(node.attributes["filename"].value, '/')
tmpfile = string.split(node.attributes["filename"].value, '/')
def copyRemote(files,tmpPath): from shutil import copy localTmpPath = os.path.join(tmpPath, "localcopy") # Define remote filesystems remotefs = ['nfs','smbfs'] remotemounts = [] # What does mount say? mounts = os.popen('mount') # Go through each line of mounts output for line in mounts.readlines(): parts = line.split() # mount says in this format device, txt1, mountpoint, txt2, filesystem, options = parts # only do if really remote if filesystem in remotefs: # add remote to list remotemounts.append(string.split(mountpoint,'/')) # go through files for node in files: # go through list for mount in remotemounts: # Recordings have no path in xml file generated by mytharchive. # # Maybe better to put real path in xml like file and video have it. if node.attributes["type"].value == "recording": tmpfile = string.split(os.path.join(recordingpath, node.attributes["filename"].value), '/') else: tmpfile = string.split(node.attributes["filename"].value, '/') filename = tmpfile[len(tmpfile)-1] tmpfiledirs="" tmpremotedir="" # path has to be minimum length of mountpoint if len(tmpfile) > len(mount): for i in range(len(mount)): tmpfiledirs = tmpfiledirs + tmpfile[i] + "/" for i in range(len(mount)): tmpremotedir = tmpremotedir + mount[i] + "/" # Is it like the mount point? if tmpfiledirs == tmpremotedir: # Write that we copy write("Copying file from " +os.path.join(recordingpath, node.attributes["filename"].value)) write("to " + os.path.join(localTmpPath, filename)) # Copy file if not doesFileExist(os.path.join(localTmpPath, filename)): copy(os.path.join(recordingpath, node.attributes["filename"].value),os.path.join(localTmpPath, filename)) # update node node.setAttribute("localfilename", os.path.join(localTmpPath, filename)) print node.attributes["localfilename"].value return files
f4ffaf6030cd78212c33aa61e49539cd965a76ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/f4ffaf6030cd78212c33aa61e49539cd965a76ca/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 5169, 12, 2354, 16, 5645, 743, 4672, 628, 11060, 1930, 1610, 225, 1191, 9161, 743, 273, 1140, 18, 803, 18, 5701, 12, 5645, 743, 16, 315, 3729, 3530, 7923, 468, 13184, 2632, 6496, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1610, 5169, 12, 2354, 16, 5645, 743, 4672, 628, 11060, 1930, 1610, 225, 1191, 9161, 743, 273, 1140, 18, 803, 18, 5701, 12, 5645, 743, 16, 315, 3729, 3530, 7923, 468, 13184, 2632, 6496, ...
def __init__(self): if _iscommand("konqueror"): self.name = self.basename = "konqueror" else: self.name = self.basename = "kfm" def _remote(self, action):
def _remote(self, url, action):
def __init__(self): if _iscommand("konqueror"): self.name = self.basename = "konqueror" else: self.name = self.basename = "kfm"
e8f244305ef4f257f6999b69601f4316b31faa5e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e8f244305ef4f257f6999b69601f4316b31faa5e/webbrowser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 309, 389, 291, 3076, 2932, 79, 265, 25734, 280, 6, 4672, 365, 18, 529, 273, 365, 18, 13909, 273, 315, 79, 265, 25734, 280, 6, 469, 30, 365, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 309, 389, 291, 3076, 2932, 79, 265, 25734, 280, 6, 4672, 365, 18, 529, 273, 365, 18, 13909, 273, 315, 79, 265, 25734, 280, 6, 469, 30, 365, 18, 529, ...
res = self.__getReplicaManager() if not res['OK']: return res rm = res['Value']
res = pythonCall(0,self.__addDirectory,path,force) if not res['OK']: gLogger.error("Failed to invoke addDirectory with shifter proxy") return res return res['Value'] def __addDirectory(self,path,force): res = setupShifterProxyInEnv("ProductionManager") if not res['OK']: return S_OK("Failed to setup shifter proxy") catalog = CatalogDirectory()
def addDirectory(self,path,force=False): """ Adds all the files stored in a given directory in file catalog """ gLogger.info("TransformationDB.addDirectory: Attempting to populate %s." % path) res = self.__getReplicaManager() if not res['OK']: return res rm = res['Value'] start = time.time() res = rm.getCatalogDirectoryReplicas(path,True) if not res['OK']: gLogger.error("TransformationDB.addDirectory: Failed to get replicas. %s" % res['Message']) return res gLogger.info("TransformationDB.addDirectory: Obtained %s replicas in %s seconds." % (path,time.time()-start)) fileTuples = [] for lfn,replicaDict in res['Value'].items(): for se,pfn in replicaDict.items(): fileTuples.append((lfn,pfn,0,se,'IGNORED-GUID','IGNORED-CHECKSUM')) if fileTuples: res = self.addFile(fileTuples,force=force) if not res['OK']: return res if not res['Value']['Successful']: return S_ERROR("Failed to add any files to database") return S_OK()
f54588da43d82256d4f9d1d4714acd11b51e64c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/f54588da43d82256d4f9d1d4714acd11b51e64c2/TransformationDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 2853, 12, 2890, 16, 803, 16, 5734, 33, 8381, 4672, 3536, 15605, 777, 326, 1390, 4041, 316, 279, 864, 1867, 316, 585, 6222, 3536, 314, 3328, 18, 1376, 2932, 15292, 2290, 18, 1289, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2853, 12, 2890, 16, 803, 16, 5734, 33, 8381, 4672, 3536, 15605, 777, 326, 1390, 4041, 316, 279, 864, 1867, 316, 585, 6222, 3536, 314, 3328, 18, 1376, 2932, 15292, 2290, 18, 1289, ...
resectiondecodeescapes = re.compile(r".(?=[0-9a-f]{2})",re.I)
resectiondecodeescapes = re.compile(r"\.(?=[0-9a-f]{2})",re.I)
def __init__(self, arg, arg2): self.length = arg self.limit = arg2,
c58e18dcfa88f059e70a585e67bcddd19801527f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/c58e18dcfa88f059e70a585e67bcddd19801527f/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1501, 16, 1501, 22, 4672, 365, 18, 2469, 273, 1501, 365, 18, 3595, 273, 1501, 22, 16, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1501, 16, 1501, 22, 4672, 365, 18, 2469, 273, 1501, 365, 18, 3595, 273, 1501, 22, 16, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
fp.write(dom.toxml())
fp.write(dom.toxml().encode("utf8"))
def anonymize(filename, outputfile): try: dom = parse(filename) except Exception, err: print "error while parsing %s: %s" % (filename, err) return tasks = dom.getElementsByTagName("task") for task in tasks: textnode = task.getElementsByTagName("title")[0].childNodes[0] nodevalue = textnode.nodeValue newnodevalue = "" for i in range(len(nodevalue)): if nodevalue[i] != " " and nodevalue[i] != "\t" and nodevalue[i] != "\n": newnodevalue = newnodevalue + "m" else: newnodevalue = newnodevalue + nodevalue[i] textnode.nodeValue = newnodevalue contentnode = task.getElementsByTagName("content") if len(contentnode) == 0: continue contentnode = contentnode[0].childNodes[0] nodevalue = contentnode.nodeValue newnodevalue = "" for i in range(len(nodevalue)): if nodevalue[i] != " " and nodevalue[i] != "\t" and nodevalue[i] != "\n": newnodevalue = newnodevalue + "m" else: newnodevalue = newnodevalue + nodevalue[i] contentnode.nodeValue = newnodevalue try: fp = open(outputfile, "w") fp.write(dom.toxml()) except Exception, err: print "error while saving output file: %s" % err
133c33f0c7d53ba50e78c5c51491ff3afb99be03 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/133c33f0c7d53ba50e78c5c51491ff3afb99be03/anonymize_task_file.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 392, 6435, 554, 12, 3459, 16, 876, 768, 4672, 225, 775, 30, 4092, 273, 1109, 12, 3459, 13, 1335, 1185, 16, 393, 30, 1172, 315, 1636, 1323, 5811, 738, 87, 30, 738, 87, 6, 738, 261, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 392, 6435, 554, 12, 3459, 16, 876, 768, 4672, 225, 775, 30, 4092, 273, 1109, 12, 3459, 13, 1335, 1185, 16, 393, 30, 1172, 315, 1636, 1323, 5811, 738, 87, 30, 738, 87, 6, 738, 261, ...
game.state.starkl += game.state.galaxy[nq.x][nq.y].stars game.state.basekl += game.state.galaxy[nq.x][nq.y].starbase
game.state.starkl += game.state.galaxy[nq.i][nq.j].stars game.state.basekl += game.state.galaxy[nq.i][nq.j].starbase
def supernova(induced, w=None): "Star goes supernova." num = 0; npdead = 0 nq = coord() if w != None: nq = w else: stars = 0 # Scheduled supernova -- select star # logic changed here so that we won't favor quadrants in top # left of universe for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): stars += game.state.galaxy[nq.x][nq.y].stars if stars == 0: return # nothing to supernova exists num = randrange(stars) + 1 for nq.x in range(GALSIZE): for nq.y in range(GALSIZE): num -= game.state.galaxy[nq.x][nq.y].stars if num <= 0: break if num <=0: break if idebug: proutn("=== Super nova here?") if ja() == True: nq = game.quadrant if not nq == game.quadrant or game.justin: # it isn't here, or we just entered (treat as enroute) if communicating(): skip(1) prout(_("Message from Starfleet Command Stardate %.2f") % game.state.date) prout(_(" Supernova in Quadrant %s; caution advised.") % nq) else: ns = coord() # we are in the quadrant! num = randrange(game.state.galaxy[nq.x][nq.y].stars) + 1 for ns.x in range(QUADSIZE): for ns.y in range(QUADSIZE): if game.quad[ns.x][ns.y]==IHSTAR: num -= 1 if num==0: break if num==0: break skip(1) prouts(_("***RED ALERT! RED ALERT!")) skip(1) prout(_("***Incipient supernova detected at Sector %s") % ns) if (ns.x-game.sector.x)**2 + (ns.y-game.sector.y)**2 <= 2.1: proutn(_("Emergency override attempts t")) prouts("***************") skip(1) stars() game.alldone = True # destroy any Klingons in supernovaed quadrant kldead = game.state.galaxy[nq.x][nq.y].klingons game.state.galaxy[nq.x][nq.y].klingons = 0 if nq == game.state.kscmdr: # did in the Supercommander! game.state.nscrem = game.state.kscmdr.x = game.state.kscmdr.y = game.isatb = 0 game.iscate = False unschedule(FSCMOVE) unschedule(FSCDBAS) survivors = filter(lambda w: w != nq, game.state.kcmdr) comkills = len(game.state.kcmdr) - len(survivors) game.state.kcmdr = survivors kldead -= comkills if not game.state.kcmdr: unschedule(FTBEAM) game.state.remkl -= kldead # destroy Romulans and planets in supernovaed quadrant nrmdead = game.state.galaxy[nq.x][nq.y].romulans game.state.galaxy[nq.x][nq.y].romulans = 0 game.state.nromrem -= nrmdead # Destroy planets for loop in range(game.inplan): if game.state.planets[loop].quadrant == nq: game.state.planets[loop].pclass = "destroyed" npdead += 1 # Destroy any base in supernovaed quadrant game.state.baseq = filter(lambda x: x != nq, game.state.baseq) # If starship caused supernova, tally up destruction if induced: game.state.starkl += game.state.galaxy[nq.x][nq.y].stars game.state.basekl += game.state.galaxy[nq.x][nq.y].starbase game.state.nplankl += npdead # mark supernova in galaxy and in star chart if game.quadrant == nq or communicating(): game.state.galaxy[nq.x][nq.y].supernova = True # If supernova destroys last Klingons give special message if (game.state.remkl + len(game.state.kcmdr) + game.state.nscrem)==0 and not nq == game.quadrant: skip(2) if not induced: prout(_("Lucky you!")) proutn(_("A supernova in %s has just destroyed the last Klingons.") % nq) finish(FWON) return # if some Klingons remain, continue or die in supernova if game.alldone: finish(FSNOVAED) return
e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2240, 82, 16739, 12, 728, 26372, 16, 341, 33, 7036, 4672, 315, 18379, 13998, 2240, 82, 16739, 1199, 818, 273, 374, 31, 1130, 22097, 273, 374, 290, 85, 273, 2745, 1435, 309, 341, 480, 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, 2240, 82, 16739, 12, 728, 26372, 16, 341, 33, 7036, 4672, 315, 18379, 13998, 2240, 82, 16739, 1199, 818, 273, 374, 31, 1130, 22097, 273, 374, 290, 85, 273, 2745, 1435, 309, 341, 480, 5...
for i in lines: key_and_value = i.split(" = ") retval[key_and_value[0]] = key_and_value[1]
try: f = open(filename, 'r') lines = f.readlines() f.close() for i in lines: key_and_value = i.split(" = ") retval[key_and_value[0]] = key_and_value[1] except IOError: pass
def ParseOptionsCacheFile(filename): f = open(filename, 'r') lines = f.readlines() f.close() retval = {} for i in lines: key_and_value = i.split(" = ") retval[key_and_value[0]] = key_and_value[1] return retval
87c03e8f2db9ef9d58f96d539356334095c5207b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10802/87c03e8f2db9ef9d58f96d539356334095c5207b/build_support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2884, 1320, 31371, 12, 3459, 4672, 284, 273, 1696, 12, 3459, 16, 296, 86, 6134, 2362, 273, 284, 18, 896, 3548, 1435, 284, 18, 4412, 1435, 5221, 273, 2618, 775, 30, 284, 273, 1696, 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, 2884, 1320, 31371, 12, 3459, 4672, 284, 273, 1696, 12, 3459, 16, 296, 86, 6134, 2362, 273, 284, 18, 896, 3548, 1435, 284, 18, 4412, 1435, 5221, 273, 2618, 775, 30, 284, 273, 1696, 12, ...
def test_expired_pending(self): mapper(User, users, properties={ 'addresses':relation(Address, backref='user'), }) mapper(Address, addresses) sess = create_session() a1 = Address(email_address='a1') sess.add(a1) sess.flush() u1 = User(name='u1') a1.user = u1 sess.flush() sess.expire(u1, ['addresses']) a2 = Address(email_address='a2') a2.user = u1 sess.expire(u1, ['addresses']) sess.execute(addresses.insert(), dict(email_address='a3', user_id=u1.id)) assert len(u1.addresses) == 2 sess.flush() sess.expire_all() assert len(u1.addresses) == 3 @testing.resolve_artifact_names
def test_expired_pending(self): mapper(User, users, properties={ 'addresses':relation(Address, backref='user'), }) mapper(Address, addresses)
2d6b3f09eb642915bf4618e78815e701dcabf592 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1074/2d6b3f09eb642915bf4618e78815e701dcabf592/expire.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 15820, 67, 9561, 12, 2890, 4672, 5815, 12, 1299, 16, 3677, 16, 1790, 5899, 296, 13277, 4278, 5488, 12, 1887, 16, 1473, 1734, 2218, 1355, 19899, 289, 13, 5815, 12, 1887, 16, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 15820, 67, 9561, 12, 2890, 4672, 5815, 12, 1299, 16, 3677, 16, 1790, 5899, 296, 13277, 4278, 5488, 12, 1887, 16, 1473, 1734, 2218, 1355, 19899, 289, 13, 5815, 12, 1887, 16, 6...
gen_rules(debiandir)
gen_rules(debiandir, arch)
def main(argv): tmpdir = None ret = 1 version = "@VERSION@" global verbose prog = os.path.basename(argv[0]) parser = OptionParser(prog=prog, usage='%prog [options] /path/to/sapgui.jar', version="%prog " + version) parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="verbose command execution") parser.add_option("--maintainer", default="Guido Günther", help="full name used in the maintainer field of the package") parser.add_option("--email", default="agx@sigxpcu.org", help="email address used in the maintainer field of the package") (options, args) = parser.parse_args(argv[1:]) verbose = options.verbose try: if len(args) != 1: raise SapGuiPkgError, "No jar given try '%s --help'" % prog else: jar = args[0] tmpdir = tempfile.mkdtemp(prefix=prog) pkgdir = os.path.join(tmpdir, "sapgui-java") destdir = os.path.join(pkgdir, 'dest') debiandir = os.path.join(pkgdir, 'debian') os.mkdir(pkgdir) os.mkdir(debiandir) print "Extracting '%s' to '%s'" % (jar, destdir) extract_sapgui_jar(jar, destdir) sg_version = get_version(destdir) pkg = "sapgui_%s_i386.deb" % sg_version gen_changelog(debiandir, version, options.maintainer, options.email, sg_version) gen_control(debiandir, version, options.maintainer, options.email) gen_rules(debiandir) gen_install(debiandir) gen_copyright(debiandir) gen_links(debiandir, sg_version) print "Building Debain package at '%s'" % pkgdir build_sapgui_deb(pkgdir) result = os.path.abspath(os.path.join(tmpdir, pkg)) shutil.move(result, os.path.curdir) except SapGuiPkgError, msg: print >>sys.stderr, msg else: print "Created '%s'" % pkg ret = 0 if tmpdir: if verbose: print "Cleaning up tempdir at %s" % tmpdir shutil.rmtree(tmpdir) return ret
4307afa7ded9e76b73a3a61a2ee2fa73631d5fe4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7223/4307afa7ded9e76b73a3a61a2ee2fa73631d5fe4/make-sgpkg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 20213, 273, 599, 325, 273, 404, 1177, 273, 8787, 5757, 27614, 2552, 3988, 225, 11243, 273, 1140, 18, 803, 18, 13909, 12, 19485, 63, 20, 5717, 2082, 273, 18862, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 20213, 273, 599, 325, 273, 404, 1177, 273, 8787, 5757, 27614, 2552, 3988, 225, 11243, 273, 1140, 18, 803, 18, 13909, 12, 19485, 63, 20, 5717, 2082, 273, 18862, 12,...
global mytime, increment, scr lsearch.skipPruneChance = skipPruneChance lsearch.searching = True
starttime = time() lsearch.endtime = starttime + usetime prevtime = 0 print "Time left: %3.2f seconds; Planing to thinking for %3.2f seconds" % \ (mytime, usetime) for depth in range(1, sd+1): if usetime > prevtime*4 or usetime <= 1: lsearch.timecheck_counter = lsearch.TIMECHECK_FREQ search_result = alphaBeta(board, depth) if lsearch.searching: mvs, scr = search_result if time() > lsearch.endtime: print "Endtime occured after depth" break print "got moves", " ".join(listToSan(board, mvs)), "from depth", depth else: print "We were interrupted while searching depth %d" % depth break prevtime = time()-starttime - prevtime else: print "I don't have enough time to go into depth %d" % depth break else: print "I searched through depths [1, %d]" % (sd+1)
def go (queue): """ Finds and prints the best move from the current position """ searchLock.acquire() try: queue.put(None) # TODO: Length info should be put in the book. # Btw. 10 is not enough. Try 20 if len(board.history) < 14: movestr = getBestOpening(board) if movestr: mvs = [parseSAN(board, movestr)] if len(board.history) >= 14 or not movestr: global mytime, increment, scr lsearch.skipPruneChance = skipPruneChance lsearch.searching = True if mytime == None: lsearch.endtime = sys.maxint mvs, scr = alphaBeta (board, sd) else: usetime = mytime / remainingMovesA(len(board.history)) if mytime < 6*60+increment*40: # If game is blitz, we assume 40 moves rather than 80 usetime *= 2 # The increment is a constant. We'll use this allways usetime += increment if usetime < 0.5: # We don't wan't to search for e.g. 0 secs usetime = 0.5 starttime = time() lsearch.endtime = starttime + usetime prevtime = 0 print "Time left: %3.2f seconds; Planing to thinking for %3.2f seconds" % \ (mytime, usetime) for depth in range(1, sd+1): # Heuristic time saving # Don't waste time, if the estimated isn't enough to complete next depth if usetime > prevtime*4 or usetime <= 1: lsearch.timecheck_counter = lsearch.TIMECHECK_FREQ search_result = alphaBeta(board, depth) if lsearch.searching: mvs, scr = search_result if time() > lsearch.endtime: # Endtime occured after depth break else: # Endtime occured in depth print "Endtime occoured while I was searching depth %d" % depth break prevtime = time()-starttime - prevtime else: print "I don't have enough time to go into depth %d" % depth # Not enough time for depth break else: print "I searched through depths [1, %d]" % (sd+1) mytime -= time() - starttime mytime += increment if not mvs: if not lsearch.searching: # We were interupted lsearch.movesearches = 0 lsearch.nodes = 0 searchLock.release() return #if lsearch.last == 4: # print "resign" #else: if scr == 0: print "result", reprResult[DRAW] elif scr < 0: if board.color == WHITE: print "result", reprResult[BLACKWON] else: print "result", reprResult[WHITEWON] else: if board.color == WHITE: print "result", reprResult[WHITEWON] else: print "result", reprResult[BLACKWON] print "last:", lsearch.last, scr return print "moves were:", " ".join(listToSan(board, mvs)), scr lsearch.movesearches = 0 lsearch.nodes = 0 lsearch.searching = False move = mvs[0] print "move", toSAN(board, move) board.applyMove(move) finally: searchLock.release()
3989d5f03e9e09f795eaf02ffa22de695b21e8e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5339/3989d5f03e9e09f795eaf02ffa22de695b21e8e9/PyChess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1960, 261, 4000, 4672, 3536, 4163, 87, 471, 14971, 326, 3796, 3635, 628, 326, 783, 1754, 3536, 1623, 2531, 18, 1077, 1039, 1435, 775, 30, 2389, 18, 458, 12, 7036, 13, 468, 2660, 30, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1960, 261, 4000, 4672, 3536, 4163, 87, 471, 14971, 326, 3796, 3635, 628, 326, 783, 1754, 3536, 1623, 2531, 18, 1077, 1039, 1435, 775, 30, 2389, 18, 458, 12, 7036, 13, 468, 2660, 30, 11...
retVal = vomsMgr.getAttributes( chain )
retVal = vomsMgr.getVOMSAttributes( chain )
def getVOMSProxy( self, userDN, userGroup, requiredLifeTime = False, requestedVOMSAttr = False ): """ Get proxy string from the Proxy Repository for use with userDN in the userGroup and VOMS attr """ retVal = self.__getVOMSAttribute( userGroup, requestedVOMSAttr ) if not retVal[ 'OK' ]: return retVal vomsAttr = retVal[ 'Value' ]
4c8302a782c37b10bb9c0a965d612c16c1486028 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4c8302a782c37b10bb9c0a965d612c16c1486028/ProxyDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11031, 1872, 55, 3886, 12, 365, 16, 729, 8609, 16, 26205, 16, 1931, 15315, 950, 273, 1083, 16, 3764, 58, 1872, 55, 3843, 273, 1083, 262, 30, 3536, 968, 2889, 533, 628, 326, 7659, 6281,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11031, 1872, 55, 3886, 12, 365, 16, 729, 8609, 16, 26205, 16, 1931, 15315, 950, 273, 1083, 16, 3764, 58, 1872, 55, 3843, 273, 1083, 262, 30, 3536, 968, 2889, 533, 628, 326, 7659, 6281,...
class fkout(object): write=flush=close=noprint class Logging(object): debug = error = warning = info = debug = noprint
class Fkout(object): debug=error=warning=info=debug=write=flush=close=noprint
def noprint(*args, **kwds): pass
633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 28797, 86, 474, 30857, 1968, 16, 2826, 25577, 4672, 1342, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 28797, 86, 474, 30857, 1968, 16, 2826, 25577, 4672, 1342, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): self.tries += 1 if self.tries >= self.maxtries: return self.http_error_default(url, fp, 500, "Internal Server Error: Redirect Recursion", headers) result = urllib.FancyURLopener.http_error_302(self, url, fp, errcode, errmsg, headers, data) self.tries = 0 return result
def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): self.tries += 1 if self.tries >= self.maxtries: return self.http_error_default(url, fp, 500, "Internal Server Error: Redirect Recursion", headers) result = urllib.FancyURLopener.http_error_302(self, url, fp, errcode, errmsg, headers, data) self.tries = 0 return result
9f86ae009f1e74ee040c0d6e683bcba6894a674b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4845/9f86ae009f1e74ee040c0d6e683bcba6894a674b/robotparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 23, 3103, 12, 2890, 16, 880, 16, 4253, 16, 393, 710, 16, 17460, 16, 1607, 16, 501, 33, 7036, 4672, 365, 18, 2007, 1011, 404, 309, 365, 18, 2007, 1545, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1062, 67, 1636, 67, 23, 3103, 12, 2890, 16, 880, 16, 4253, 16, 393, 710, 16, 17460, 16, 1607, 16, 501, 33, 7036, 4672, 365, 18, 2007, 1011, 404, 309, 365, 18, 2007, 1545, 365, 18, ...
"""%(table, more))
"""%(table_name, more))
def add_column(self, table, col_name, attr_dict, default='NULL'): """ Takes a while, thanks to SQLite... """ # Check input: if not self.__skeleton__.has_key(table): raise ValueError("Database has no table %s."%table) if self.__skeleton__[table].has_key(col_name): raise ValueError("Table %s already has column %s."%(table,col_name)) attr_dict = verify_column(attr_dict) # Get an ordered list: cur_list = skel_to_col_attr_list(self.__skeleton__[table]) # Update the skeleton: self.__skeleton__[table][col_name] = attr_dict original = '' for col in cur_list: original += col[0] +', ' original = original.rstrip(', ') more = original + ', ' + col_name more_attr = '' for col in cur_list: if col[2]: # If primary key: more_attr += col[0] + ' ' + col[1] + ' primary key, ' else: more_attr += col[0] + ' ' + col[1] + ', ' more_attr += col_name + ' ' + attr_dict['sql'] # ROBERT: Look at the new fun way to do this... # executescript runs a begin transaction and commit so this # should speed things up for even large amounts of data # Silly SQLite -- we have to make a temp table to hold info... self.__connection__.executescript(""" create temporary table spam(%s); insert into spam select %s, %s from %s; drop table %s; create table %s (%s); """%(more_attr, original, default, table, table, table, more_attr)) # Update indices in new table new_table_set_col_attr(self.__connection__, table, self.__skeleton__[table]) # Now we can plop our data into the *new* table: self.__connection__.executescript(""" insert into %s select %s from spam; drop table spam; """%(table, more)) self.vacuum()
ccd462ba82c8e638768d9aaffb11ed63f3c9a76d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ccd462ba82c8e638768d9aaffb11ed63f3c9a76d/database.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 2827, 12, 2890, 16, 1014, 16, 645, 67, 529, 16, 1604, 67, 1576, 16, 805, 2218, 8560, 11, 4672, 3536, 23004, 279, 1323, 16, 286, 19965, 358, 16192, 2777, 225, 3536, 468, 2073, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2827, 12, 2890, 16, 1014, 16, 645, 67, 529, 16, 1604, 67, 1576, 16, 805, 2218, 8560, 11, 4672, 3536, 23004, 279, 1323, 16, 286, 19965, 358, 16192, 2777, 225, 3536, 468, 2073, ...
results.append(len(self._bugzilla.query({
results['closed'] = len(self._bugzilla.query({
def _get_bug_stats(self, package, collection='Fedora'): """ Returns (# of open bugs, # of new bugs, # of closed bugs) """ results = [] last_week = str(datetime.utcnow() - timedelta(days=7)),
db7abe949e3fbab840693ccf5a932baa23e6ea8d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12732/db7abe949e3fbab840693ccf5a932baa23e6ea8d/bugzillaconnector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 925, 67, 5296, 12, 2890, 16, 2181, 16, 1849, 2218, 42, 15534, 11, 4672, 3536, 2860, 23885, 434, 1696, 22398, 16, 468, 434, 394, 22398, 16, 468, 434, 4375, 22398, 13, 3536...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 67, 925, 67, 5296, 12, 2890, 16, 2181, 16, 1849, 2218, 42, 15534, 11, 4672, 3536, 2860, 23885, 434, 1696, 22398, 16, 468, 434, 394, 22398, 16, 468, 434, 4375, 22398, 13, 3536...
``max_cache_age``:
``cache_max_age``:
def make_py(parser, environ, filename): module = load_module(environ, filename) if not module: return None if hasattr(module, 'application') and module.application: return getattr(module.application, 'wsgi_application', module.application) base_name = module.__name__.split('.')[-1] if hasattr(module, base_name): obj = getattr(module, base_name) if hasattr(obj, 'wsgi_application'): return obj.wsgi_application else: # @@: Old behavior; should probably be deprecated eventually: return getattr(module, base_name)() environ['wsgi.errors'].write( "Cound not find application or %s in %s\n" % (base_name, module)) return None
d47074a63528d1885de8f4e1363687b15f050031 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11400/d47074a63528d1885de8f4e1363687b15f050031/urlparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 2074, 12, 4288, 16, 5473, 16, 1544, 4672, 1605, 273, 1262, 67, 2978, 12, 28684, 16, 1544, 13, 309, 486, 1605, 30, 327, 599, 309, 3859, 12, 2978, 16, 296, 3685, 6134, 471, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 67, 2074, 12, 4288, 16, 5473, 16, 1544, 4672, 1605, 273, 1262, 67, 2978, 12, 28684, 16, 1544, 13, 309, 486, 1605, 30, 327, 599, 309, 3859, 12, 2978, 16, 296, 3685, 6134, 471, 1...
errorbar(bins, eff, error,markersize=12, markerfacecolor='None',\
errorbar(plotbins, eff, error,markersize=12, markerfacecolor='None',\
def efficiencyplot(found, missed, col_name, ifo=None, plot_type = 'linear', \ nbins = 40, output_name = None, plotsym = 'k-', plot_name = '', \ title_string = '', errors = False): """ function to plot the difference if col_name_a in two tables against the value of col_name_b in table1. @param found: metaDataTable containing found injections @param missed: metaDataTable containing missed injections @param col_name: name of column used to plot efficiency @param ifo: name of ifo (default = None), used in extracting information (e.g. which eff_dist) @param plot_type: either 'linear' or 'log' plot on x-axis @param plotsym: the symbol to use when plotting, default = 'k-' @param plot_name: name of the plot (for the legend) @param title_string: extra info for title @param errors: plot errorbars on the efficiencies (using binomial errors) default = False """ if not ifo and ("ifo" in found.validcolumns.keys()): ifo = found[0].ifo foundVal = readcol(found,col_name, ifo) missedVal = readcol(missed,col_name, ifo) if len(foundVal) or len(missedVal): # we have found or missed injections so we can generate the plot if plot_type == 'log': foundVal = log10(foundVal) missedVal = log10(missedVal) if len(foundVal): step = (max(foundVal) - min(foundVal)) /nbins bins = arange(min(foundVal),max(foundVal), step ) if step == 0: bins = array([foundVal[0]/2.0, foundVal[0], foundVal[0] * 3.0/2.0]) else: step = (max(missedVal) - min(missedVal)) /nbins bins = arange(min(missedVal),max(missedVal), step ) if step == 0: bins = array([missedVal[0]/2.0, missedVal[0], missedVal[0] * 3.0/2.0]) fig_num = gcf().number figure(100) [num_found,binsf,stuff] = hist(foundVal, bins) [num_missed,binsm,stuff] = hist(missedVal ,bins) close(100) figure(fig_num) num_found = array(num_found,'d') eff = num_found / (num_found + num_missed) error = sqrt( num_found * num_missed / (num_found + num_missed)**3 ) error = array(error) if plot_type == 'log': bins = 10**bins if plot_name: semilogx(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=2, label = plot_name) else: semilogx(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=2) if errors: errorbar(bins, eff, error,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth = 2, label = plot_name, \ fmt = plotsym) else: if errors: errorbar(bins, eff, error, fmt = plotsym, markersize=12,\ markerfacecolor='None',\ markeredgewidth=1, linewidth=1, label = plot_name) else: plot(bins, eff, plotsym,markersize=12, markerfacecolor='None',\ markeredgewidth=1, linewidth=1, label = plot_name) xlabel(col_name.replace("_"," "), size='x-large') ylabel('Efficiency', size='x-large') ylim(0,1.1) else: # no found or missed injections figtext(0,0,'No found or missed injections',fontsize=32) if ifo: title_string += ' ' + ifo title_string += ' ' + col_name.replace("_"," ") title_string += ' efficiency plot' title(title_string, size='x-large') grid(True) if output_name: if ifo: output_name += '_' + ifo output_name += '_' + col_name + '_eff.png' savefig(output_name)
c9b61fdc32295bdb8be1140c1b8359958473b6f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/c9b61fdc32295bdb8be1140c1b8359958473b6f4/viz.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 30325, 4032, 12, 7015, 16, 25143, 16, 645, 67, 529, 16, 21479, 33, 7036, 16, 3207, 67, 723, 273, 296, 12379, 2187, 521, 4264, 2679, 273, 8063, 16, 876, 67, 529, 273, 599, 16, 3207, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 30325, 4032, 12, 7015, 16, 25143, 16, 645, 67, 529, 16, 21479, 33, 7036, 16, 3207, 67, 723, 273, 296, 12379, 2187, 521, 4264, 2679, 273, 8063, 16, 876, 67, 529, 273, 599, 16, 3207, 8...
if not (upkg["arch"] == "noarch" or \ pkg["arch"] == "noarch" or \ buildarchtranslate[upkg["arch"]] == buildarchtranslate[pkg["arch"]]):
if not (is_filereq or \ archDuplicate(upkg["arch"], pkg["arch"]) or \ archCompat(upkg["arch"], pkg["arch"]) or \ archCompat(pkg["arch"], upkg["arch"])):
def __handleUpdatePkglist(self, pkg, pkg_list): """Choose a package from a list of RpmPackage's pkg_list that has the same base arch as RpmPackage pkg, and add it to self.opresolver.
6be4efdfec9ca44df9c229742a9ae9af03091072 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/6be4efdfec9ca44df9c229742a9ae9af03091072/yum.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4110, 1891, 11264, 1098, 12, 2890, 16, 3475, 16, 3475, 67, 1098, 4672, 3536, 24529, 279, 2181, 628, 279, 666, 434, 534, 7755, 2261, 1807, 3475, 67, 1098, 716, 711, 326, 1967, 1026,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4110, 1891, 11264, 1098, 12, 2890, 16, 3475, 16, 3475, 67, 1098, 4672, 3536, 24529, 279, 2181, 628, 279, 666, 434, 534, 7755, 2261, 1807, 3475, 67, 1098, 716, 711, 326, 1967, 1026,...
serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.settimeout(3) serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serv.bind(("", PORT)) serv.listen(5)
def capture_server(evt, buf): serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.settimeout(3) serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serv.bind(("", PORT)) serv.listen(5) try: conn, addr = serv.accept() except socket.timeout: pass else: n = 200 while n > 0: r, w, e = select.select([conn], [], []) if r: data = conn.recv(10) # keep everything except for the newline terminator buf.write(data.replace('\n', '')) if '\n' in data: break n -= 1 time.sleep(0.01) conn.close() finally: serv.close() evt.set()
aee5a827355b46b7a15ad7ea34293a734ab672a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/aee5a827355b46b7a15ad7ea34293a734ab672a8/test_asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7477, 67, 3567, 12, 73, 11734, 16, 1681, 4672, 775, 30, 1487, 16, 3091, 273, 13515, 18, 9436, 1435, 1335, 2987, 18, 4538, 30, 1342, 469, 30, 290, 273, 4044, 1323, 290, 405, 374, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7477, 67, 3567, 12, 73, 11734, 16, 1681, 4672, 775, 30, 1487, 16, 3091, 273, 13515, 18, 9436, 1435, 1335, 2987, 18, 4538, 30, 1342, 469, 30, 290, 273, 4044, 1323, 290, 405, 374, 30, ...
def sage_prefilter(self, line, continuation): """ Alternate prefilter for input.
def sage_prefilter(self, block, continuation): """ SAGE's prefilter for input. Given a string block (usually a line), return the preparsed version of it. INPUT: block -- string (usually a single line, but not always) continuation -- whether or not this line is a continuation.
def sage_prefilter(self, line, continuation): """ Alternate prefilter for input. """ try: line2 = do_prefilter_paste(line, continuation) except None: print "WARNING: An error occured in the SAGE parser while" print "parsing the following line:" print line print "Please report this as a bug (include the output of typing '%hist')." line2 = line from IPython.iplib import InteractiveShell return InteractiveShell._prefilter(self, line2, continuation)
1541938692bbdd77923b3715e5694717ed037891 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/1541938692bbdd77923b3715e5694717ed037891/interpreter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 410, 67, 1484, 2188, 12, 2890, 16, 1203, 16, 17378, 4672, 3536, 348, 2833, 1807, 675, 2188, 364, 810, 18, 225, 16803, 279, 533, 1203, 261, 407, 3452, 279, 980, 3631, 327, 326, 675...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 272, 410, 67, 1484, 2188, 12, 2890, 16, 1203, 16, 17378, 4672, 3536, 348, 2833, 1807, 675, 2188, 364, 810, 18, 225, 16803, 279, 533, 1203, 261, 407, 3452, 279, 980, 3631, 327, 326, 675...
if len((self.config['series_name_override'][program['title'].lower()]).strip()) == 7: self.config['sid'] = self.config['series_name_override'][program['title'].lower()]
self.config['sid'] = self.config['series_name_override'][program['title'].lower()]
def _getScheduledRecordedTVGraphics(self, program, graphics_type): '''Get TV show graphics for Scheduled and Recorded TV programs return None if no graphics found return fullpath and filename of downloaded graphics file ''' if graphics_type == 'coverfile': graphics_type = 'poster'
da58d67ff802989f12b584ed8dfcff2d3581d752 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/da58d67ff802989f12b584ed8dfcff2d3581d752/jamu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 10660, 426, 3850, 785, 15579, 17558, 12, 2890, 16, 5402, 16, 17313, 67, 723, 4672, 9163, 967, 399, 58, 2405, 17313, 364, 17286, 471, 868, 3850, 785, 399, 58, 25038, 327, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 10660, 426, 3850, 785, 15579, 17558, 12, 2890, 16, 5402, 16, 17313, 67, 723, 4672, 9163, 967, 399, 58, 2405, 17313, 364, 17286, 471, 868, 3850, 785, 399, 58, 25038, 327, 599, ...
while True: logpath, starttime, timenow, status = build(commands, config) email(logpath, starttime, timenow, status, config) time.sleep(wait_seconds)
logpath, starttime, timenow, status = build(commands, config) email(logpath, starttime, timenow, status, config)
def email(logpath, starttime, timenow, status, config): msg = """From: %(from)s
72a0b540c03a28be5077bae646258c897d4e5453 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8055/72a0b540c03a28be5077bae646258c897d4e5453/slave.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2699, 12, 1330, 803, 16, 23437, 16, 1658, 275, 543, 16, 1267, 16, 642, 4672, 1234, 273, 3536, 1265, 30, 8975, 2080, 13, 87, 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, 2699, 12, 1330, 803, 16, 23437, 16, 1658, 275, 543, 16, 1267, 16, 642, 4672, 1234, 273, 3536, 1265, 30, 8975, 2080, 13, 87, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
self.assert_(d.has_key('h'))
self.assertTrue('h' in d)
def h(z): return y + z
ee1e2c90ddec926208d140ae73eda8f97ae0305a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/ee1e2c90ddec926208d140ae73eda8f97ae0305a/test_scope.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 12, 94, 4672, 327, 677, 397, 998, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 12, 94, 4672, 327, 677, 397, 998, 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, ...
raise ValueError, "invalid subgraph type (%s)"%sub.type
raise ValueError, "invalid subgraph type (%s) and degree (%s)"%(sub.type,degree)
def StrechAllSubgraphsF2(G): cur_G=G.Clone() cur_G.s_degree=dict() cur_G.s_type=dict() for sub in cur_G.subgraphs: if subgraph_dim_with_diff(cur_G, sub)>=0: sub_ext_atoms_str = FindExtMomentAtoms(sub) strech_var_str = "s%s"%cur_G.subgraphs.index(sub) sub_ext_path = [(i[0],i[1],strech_var_str) for i in FindExtMomentPath(sub, sub_ext_atoms_str)] for idx in sub_ext_path: if idx[1]=="L": obj = cur_G.lines[idx[0]] elif idx[1]=="N": obj = cur_G.nodes[idx[0]] model.AddStrech(obj, strech_var_str, sub_ext_atoms_str) if sub.type == 2: cur_G.s_type[strech_var_str]= 2 cur_G.s_degree[strech_var_str] = subgraph_dim_with_diff(cur_G, sub)/sympy.Number(2) + 1 elif sub.type == 1: cur_G.s_type[strech_var_str]= 1 cur_G.s_degree[strech_var_str] = subgraph_dim_with_diff(cur_G, sub) + 1 else: raise ValueError, "invalid subgraph type (%s)"%sub.type return cur_G
b13d63b831f32ecb691a2ac88e33cc9661fc8095 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4941/b13d63b831f32ecb691a2ac88e33cc9661fc8095/phi3R1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 934, 266, 343, 1595, 1676, 30016, 42, 22, 12, 43, 4672, 662, 67, 43, 33, 43, 18, 10930, 1435, 662, 67, 43, 18, 87, 67, 21361, 33, 1576, 1435, 662, 67, 43, 18, 87, 67, 723, 33, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 934, 266, 343, 1595, 1676, 30016, 42, 22, 12, 43, 4672, 662, 67, 43, 33, 43, 18, 10930, 1435, 662, 67, 43, 18, 87, 67, 21361, 33, 1576, 1435, 662, 67, 43, 18, 87, 67, 723, 33, 15...
"WHERE _ROWID_ = NEW._ROWID_ " %(table, column, column))
"WHERE _ROWID_ = NEW._ROWID_ ; " %(table, column, column))
def createTrigger(self, table, column, onAction, pinned=False): onAction = onAction.lower() name = "%s_%s" % (table, onAction) assert(onAction in ["insert", "update"])
490a0284cbbb406b602ed786a560a158b7f2ee9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/490a0284cbbb406b602ed786a560a158b7f2ee9f/schema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 6518, 12, 2890, 16, 1014, 16, 1057, 16, 603, 1803, 16, 26193, 33, 8381, 4672, 603, 1803, 273, 603, 1803, 18, 8167, 1435, 508, 273, 2213, 87, 10185, 87, 6, 738, 261, 2121, 16, 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, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 6518, 12, 2890, 16, 1014, 16, 1057, 16, 603, 1803, 16, 26193, 33, 8381, 4672, 603, 1803, 273, 603, 1803, 18, 8167, 1435, 508, 273, 2213, 87, 10185, 87, 6, 738, 261, 2121, 16, 60...
if isinstance(sel, str):
if isinstance(sel, basestring):
def eval_print_amount(self, sel, list, msg): new_list = list if isinstance(sel, str): try: rex = re.compile(sel) except re.error: msg += " <Invalid regular expression %r>\n" % sel return new_list, msg new_list = [] for func in list: if rex.search(func_std_string(func)): new_list.append(func) else: count = len(list) if isinstance(sel, float) and 0.0 <= sel < 1.0: count = int(count * sel + .5) new_list = list[:count] elif isinstance(sel, int) and 0 <= sel < count: count = sel new_list = list[:count] if len(list) != len(new_list): msg += " List reduced from %r to %r due to restriction <%r>\n" % ( len(list), len(new_list), sel)
6f43299a9c3dad2d01fa466103002ae6a3b0f101 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/6f43299a9c3dad2d01fa466103002ae6a3b0f101/pstats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5302, 67, 1188, 67, 8949, 12, 2890, 16, 357, 16, 666, 16, 1234, 4672, 394, 67, 1098, 273, 666, 309, 1549, 12, 1786, 16, 10699, 4672, 775, 30, 28929, 273, 283, 18, 11100, 12, 1786, 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, 5302, 67, 1188, 67, 8949, 12, 2890, 16, 357, 16, 666, 16, 1234, 4672, 394, 67, 1098, 273, 666, 309, 1549, 12, 1786, 16, 10699, 4672, 775, 30, 28929, 273, 283, 18, 11100, 12, 1786, 13...
if "" != key.translate(idmap, LegalChars):
if len(filter(LegalChars.__contains__, key)) != len(key):
def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=_idmap): # First we verify that the key isn't a reserved word # Second we make sure it only contains legal characters if key.lower() in self._reserved: raise CookieError("Attempt to set a reserved key: %s" % key) if "" != key.translate(idmap, LegalChars): raise CookieError("Illegal key value: %s" % key)
1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256/Cookie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12, 2890, 16, 498, 16, 1244, 16, 29512, 67, 1125, 16, 17167, 287, 7803, 33, 67, 30697, 7803, 16, 612, 1458, 33, 67, 350, 1458, 4672, 468, 5783, 732, 3929, 716, 326, 498, 5177, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 16, 498, 16, 1244, 16, 29512, 67, 1125, 16, 17167, 287, 7803, 33, 67, 30697, 7803, 16, 612, 1458, 33, 67, 350, 1458, 4672, 468, 5783, 732, 3929, 716, 326, 498, 5177, 1...
r""" If this is a p-adic modular form, return p.
r""" If this is a `p`-adic modular form, return `p`.
def prime(self): r""" If this is a p-adic modular form, return p.
51aabb4f4c1d25de708da4cd9e8295aeb8a186e7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/51aabb4f4c1d25de708da4cd9e8295aeb8a186e7/genus0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17014, 12, 2890, 4672, 436, 8395, 971, 333, 353, 279, 293, 17, 20333, 681, 2490, 646, 16, 327, 293, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17014, 12, 2890, 4672, 436, 8395, 971, 333, 353, 279, 293, 17, 20333, 681, 2490, 646, 16, 327, 293, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
txt = unicode(urllib.unquote(obj.target.encode('utf-8')), 'utf-8')
txt = unicode(urllib.unquote(obj.target.encode('utf-8')), 'utf-8', 'replace')
def writeLink(self,obj): """ Link nodes are intra wiki links """
c7c8a82992cee350fbc636937c2f933aec888376 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12390/c7c8a82992cee350fbc636937c2f933aec888376/rlwriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 2098, 12, 2890, 16, 2603, 4672, 3536, 4048, 2199, 854, 316, 2033, 9050, 4716, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 2098, 12, 2890, 16, 2603, 4672, 3536, 4048, 2199, 854, 316, 2033, 9050, 4716, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
f[k] = self._dict[k]
f[k.encode("ascii")] = self._dict[k]
def init_db(self): f = anydbm.open(_fname, 'n') for k in self._dict: f[k] = self._dict[k] f.close()
3978b4e32bc06e7ac843145e024f93c61458b012 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3978b4e32bc06e7ac843145e024f93c61458b012/test_anydbm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1966, 12, 2890, 4672, 284, 273, 1281, 1966, 81, 18, 3190, 24899, 12749, 16, 296, 82, 6134, 364, 417, 316, 365, 6315, 1576, 30, 284, 63, 79, 18, 3015, 2932, 9184, 7923, 65, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1966, 12, 2890, 4672, 284, 273, 1281, 1966, 81, 18, 3190, 24899, 12749, 16, 296, 82, 6134, 364, 417, 316, 365, 6315, 1576, 30, 284, 63, 79, 18, 3015, 2932, 9184, 7923, 65, ...
""" z = s
INPUT: s -- a string of the code from the cell to be executed C -- the cell object EXAMPLES: First, we set up a new notebook and worksheet. sage: nb = sage.server.notebook.notebook.Notebook(tmp_dir()) sage: nb.add_user('sage','sage','sage@sagemath.org',force=True) sage: W = nb.create_new_worksheet('Test', 'sage') We first test running a native command in 'sage' mode and then a GAP cell within Sage mode. sage: W.edit_save('Sage\nsystem:sage\n{{{\n2+3\n}}}\n\n{{{\n%gap\nSymmetricGroup(5)\n}}}') sage: c0, c1 = W.cell_list() sage: W.check_for_system_switching(c0.input_text(), c0) (False, '2+3') sage: W.check_for_system_switching(c1.input_text(), c1) (True, "print _support_.syseval(gap, ur'''SymmetricGroup(5)''', '...')") sage: c0.evaluate() sage: W.check_comp() ('d', Cell 0; in=2+3, out= 5 ) sage: c1.evaluate() sage: W.check_comp() ('d', Cell 1; in=%gap SymmetricGroup(5), out= Sym( [ 1 .. 5 ] ) ) Next, we run the same commands but from 'gap' mode. sage: W.edit_save('Sage\nsystem:gap\n{{{\n%sage\n2+3\n}}}\n\n{{{\nSymmetricGroup(5)\n}}}') sage: c0, c1 = W.cell_list() sage: W.check_for_system_switching(c0.input_text(), c0) (False, '2+3') sage: W.check_for_system_switching(c1.input_text(), c1) (True, "print _support_.syseval(gap, ur'''SymmetricGroup(5)''', '...')") sage: c0.evaluate() sage: W.check_comp() ('d', Cell 0; in=%sage 2+3, out= 5 ) sage: c1.evaluate() sage: W.check_comp() ('d', Cell 1; in=SymmetricGroup(5), out= Sym( [ 1 .. 5 ] ) ) """
def check_for_system_switching(self, s, C): r""" Check for input cells that start with \code{\%foo}, where \var{foo} is an object with an eval method. """ z = s s = s.lstrip() S = self.system() if S != 'sage': if s.startswith('%sage'): s = after_first_word(s).lstrip() z = s else: return True, self._eval_cmd(S, s, os.path.abspath(C.directory()))
e666891d07de03cf769eff86fcbd4144b8756907 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/e666891d07de03cf769eff86fcbd4144b8756907/worksheet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1884, 67, 4299, 67, 9610, 310, 12, 2890, 16, 272, 16, 385, 4672, 436, 8395, 2073, 364, 810, 5983, 716, 787, 598, 521, 710, 23241, 9, 11351, 5779, 1625, 521, 1401, 95, 11351, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 866, 67, 1884, 67, 4299, 67, 9610, 310, 12, 2890, 16, 272, 16, 385, 4672, 436, 8395, 2073, 364, 810, 5983, 716, 787, 598, 521, 710, 23241, 9, 11351, 5779, 1625, 521, 1401, 95, 11351, ...
""" Database Tables """
"""Database Tables"""
def request(self, cr, uid, name, request, context = {}):
1dc268e357fe6ce10746aa6f778e8fad1db095de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1dc268e357fe6ce10746aa6f778e8fad1db095de/olap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 590, 16, 819, 273, 2618, 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...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 4422, 16, 4555, 16, 508, 16, 590, 16, 819, 273, 2618, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
newarray.append(subarray[0])
cur_array.append(subarray[0])
def parse_spec(mylines): myspec={} pos=0 colon=re.compile(":") trailing_comment=re.compile("#.*\n") newline=re.compile("\n") leading_white_space=re.compile("^\s+") white_space=re.compile("\s+") while pos<len(mylines): # Force the line to be clean # Remove Comments ( anything following # ) mylines[pos]=trailing_comment.sub("",mylines[pos]) # Remove newline character \n mylines[pos]=newline.sub("",mylines[pos]) # Remove leading white space mylines[pos]=leading_white_space.sub("",mylines[pos]) # Skip any blank lines if len(mylines[pos])<=1: pos += 1 continue msearch=colon.search(mylines[pos]) # If semicolon found assume its a new key # This may cause problems if : are used for key values but works for now if msearch: # Split on the first semicolon creating two strings in the array mobjs mobjs = colon.split(mylines[pos],1) # Start a new array using the first element of mobjs newarray=[mobjs[0]] if mobjs[1]: # split on white space creating additional array elements subarray=mobjs[1].split() if len(subarray)>0: if len(subarray)==1: # Store as a string if only one element is found. # this is to keep with original catalyst behavior # eventually this may go away if catalyst just works # with arrays. newarray.append(subarray[0]) else: newarray.append(mobjs[1].split()) # Else add on to the last key we were working on else: mobjs = white_space.split(mylines[pos]) for i in mobjs: newarray.append(i) pos += 1 if len(newarray)==2: myspec[newarray[0]]=newarray[1] else: myspec[newarray[0]]=newarray[1:] for x in myspec.keys(): # Convert myspec[x] to an array of strings newarray=[] if type(myspec[x])!=types.StringType: for y in myspec[x]: if type(y)==types.ListType: newarray.append(y[0]) if type(y)==types.StringType: newarray.append(y) myspec[x]=newarray # Delete empty key pairs if len(myspec[x])==0: print "\n\tWARNING: No value set for key: "+x print "\tdeleting key: "+x+"\n" del myspec[x] #print myspec return myspec
dbce1700b1e7db04d685467cc36da0e0c1a84ad8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/dbce1700b1e7db04d685467cc36da0e0c1a84ad8/catalyst_support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2793, 12, 4811, 3548, 4672, 312, 1900, 705, 12938, 949, 33, 20, 13336, 33, 266, 18, 11100, 2932, 2773, 13, 7341, 67, 3469, 33, 266, 18, 11100, 2932, 7, 4509, 64, 82, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 2793, 12, 4811, 3548, 4672, 312, 1900, 705, 12938, 949, 33, 20, 13336, 33, 266, 18, 11100, 2932, 2773, 13, 7341, 67, 3469, 33, 266, 18, 11100, 2932, 7, 4509, 64, 82, 7923, ...
if options.rignum.get() == 901: cmd="CMDSR -T 0" elif options.rignum.get() == 2509:
if options.rignum.get() == 2509:
def readinit(): global nparam,mrudir try: for i in range(len(params)): if badlist.count(i)>0: print 'Skipping bad entry in WSPR.INI:\a',params[i] continue key,value=params[i].split() if key == 'WSPRGeometry': root.geometry(value) elif key == 'MyCall': options.MyCall.set(value) elif key == 'MyGrid': options.MyGrid.set(value) elif key == 'CWID': advanced.idint.set(value) elif key == 'dBm': options.dBm.set(value) elif key == 'PctTx': ipctx.set(value) elif key == 'PttPort': options.PttPort.set(value) elif key == 'CatPort': options.CatPort.set(value) elif key == 'AudioIn': value=value.replace("#"," ") g.DevinName.set(value) try: g.ndevin.set(int(value[:2])) except: g.ndevin.set(0) options.DevinName.set(value) elif key == 'AudioOut': value=value.replace("#"," ") g.DevoutName.set(value) try: g.ndevout.set(int(value[:2])) except: g.ndevout.set(0) options.DevoutName.set(value) elif key == 'BFOfreq': advanced.bfofreq.set(value) elif key == 'Acal': advanced.Acal.set(value) elif key == 'Bcal': advanced.Bcal.set(value) elif key == 'CalEnable': advanced.encal.set(value) elif key == 'IQmode': iq.iqmode.set(value) elif key == 'IQrx': iq.iqrx.set(value) elif key == 'IQtx': iq.iqtx.set(value) elif key == 'FIQ': iq.fiq.set(value) elif key == 'Ntxdb': advanced.isc1.set(value) elif key == 'Ntxbal': iq.isc2.set(value) elif key == 'Ntxbalf': iq.isc2a.set(value) elif key == 'Ntxpha': iq.isc3.set(value) elif key == 'Ntxphaf': iq.isc3a.set(value) elif key == 'PTTmode': options.pttmode.set(value) elif key == 'CATenable': options.cat_enable.set(value) elif key == 'SerialRate': options.serial_rate.set(int(value)) elif key == 'DataBits': options.databits.set(int(value)) elif key == 'StopBits': options.stopbits.set(int(value)) elif key == 'Handshake': options.serial_handshake.set(value.replace("#"," ") ) elif key == 'Rig': t=value.replace("#"," ") options.rig.set(t) options.rignum.set(int(t[:4])) elif key == 'Nsave': nsave.set(value) elif key == 'Upload': upload.set(value) elif key == 'Idle': idle.set(value) elif key == 'Debug': ndebug.set(value) elif key == 'WatScale': sc1.set(value) elif key == 'WatOffset': sc2.set(value) elif key == 'Palette': g.cmap=value elif key == 'freq0_600': freq0[1]=float(value) elif key == 'freq0_160': freq0[2]=float(value) elif key == 'freq0_80': freq0[3]=float(value) elif key == 'freq0_60': freq0[4]=float(value) elif key == 'freq0_40': freq0[5]=float(value) elif key == 'freq0_30': freq0[6]=float(value) elif key == 'freq0_20': freq0[7]=float(value) elif key == 'freq0_17': freq0[8]=float(value) elif key == 'freq0_15': freq0[9]=float(value) elif key == 'freq0_12': freq0[10]=float(value) elif key == 'freq0_10': freq0[11]=float(value) elif key == 'freq0_6': freq0[12]=float(value) elif key == 'freq0_4': freq0[13]=float(value) elif key == 'freq0_2': freq0[14]=float(value) elif key == 'freq0_other': freq0[15]=float(value) elif key == 'freqtx_600': freqtx[1]=float(value) elif key == 'freqtx_160': freqtx[2]=float(value) elif key == 'freqtx_80': freqtx[3]=float(value) elif key == 'freqtx_60': freqtx[4]=float(value) elif key == 'freqtx_40': freqtx[5]=float(value) elif key == 'freqtx_30': freqtx[6]=float(value) elif key == 'freqtx_20': freqtx[7]=float(value) elif key == 'freqtx_17': freqtx[8]=float(value) elif key == 'freqtx_15': freqtx[9]=float(value) elif key == 'freqtx_12': freqtx[10]=float(value) elif key == 'freqtx_10': freqtx[11]=float(value) elif key == 'freqtx_6': freqtx[12]=float(value) elif key == 'freqtx_4': freqtx[13]=float(value) elif key == 'freqtx_2': freqtx[14]=float(value) elif key == 'freqtx_other': freqtx[15]=float(value) elif key == 'iband': iband.set(value) elif key == 'StartIdle': start_idle.set(value) elif key == 'NoBeep': no_beep.set(value) elif key == 'Ygain': w.acom1.gain=float(value) elif key == 'Phdeg': w.acom1.phase=float(value)/57.2957795 elif key == 'Reject': w.acom1.reject=float(value) elif key == 'RxApply': iq.iqrxapp.set(value) elif key == 'MRUdir': mrudir=value.replace("#"," ") nparam=i except: badlist.append(i) nparam=i
f41fef5858a544f41bea63d63493074842638a35 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2394/f41fef5858a544f41bea63d63493074842638a35/wspr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 2738, 13332, 2552, 290, 891, 16, 21387, 1100, 481, 775, 30, 364, 277, 316, 1048, 12, 1897, 12, 2010, 3719, 30, 309, 5570, 1098, 18, 1883, 12, 77, 13, 34, 20, 30, 1172, 296, 1687...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2738, 13332, 2552, 290, 891, 16, 21387, 1100, 481, 775, 30, 364, 277, 316, 1048, 12, 1897, 12, 2010, 3719, 30, 309, 5570, 1098, 18, 1883, 12, 77, 13, 34, 20, 30, 1172, 296, 1687...
__namedColors = {}
_namedColors = {}
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency if __namedColors is not None: return __namedColors import colors __namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): __namedColors[name] = value return __namedColors
ae7f8d797d822a5b6ac4442a1d8b238430be7f63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/ae7f8d797d822a5b6ac4442a1d8b238430be7f63/colors.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5514, 7604, 12570, 13332, 468, 6154, 279, 3880, 434, 777, 326, 4141, 5945, 316, 326, 1605, 468, 4692, 279, 6396, 364, 30325, 309, 1001, 13188, 12570, 353, 486, 599, 30, 327, 1001, 13188, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5514, 7604, 12570, 13332, 468, 6154, 279, 3880, 434, 777, 326, 4141, 5945, 316, 326, 1605, 468, 4692, 279, 6396, 364, 30325, 309, 1001, 13188, 12570, 353, 486, 599, 30, 327, 1001, 13188, ...
def safe_equal(x, y):
def safe_equal(x, y, TLS=TLS):
def safe_equal(x, y): # a specialized version for performance try: seeing = TLS.seeing_eq except AttributeError: seeing = TLS.seeing_eq = {} seeingkey = (id(x), id(y)) if seeingkey in seeing: return True seeing[seeingkey] = True try: return x == y finally: del seeing[seeingkey]
2190702654cb450e584e78f8f8b60296305c44aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/2190702654cb450e584e78f8f8b60296305c44aa/lltype.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4183, 67, 9729, 12, 92, 16, 677, 16, 8098, 33, 9905, 4672, 468, 279, 29158, 1177, 364, 9239, 775, 30, 2621, 310, 273, 8098, 18, 5946, 310, 67, 11253, 1335, 6394, 30, 2621, 310, 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, 4183, 67, 9729, 12, 92, 16, 677, 16, 8098, 33, 9905, 4672, 468, 279, 29158, 1177, 364, 9239, 775, 30, 2621, 310, 273, 8098, 18, 5946, 310, 67, 11253, 1335, 6394, 30, 2621, 310, 273, ...
map = aClass._attrMap.items() map.sort()
map = aClass._attrMap if map: map = map.items() map.sort() else: map = []
def beginAttributes(self, aClass): "Append a list of annotated attributes of a class."
abfd438181f6ce017fcd8617f90cee3a490ecd19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/abfd438181f6ce017fcd8617f90cee3a490ecd19/graphdocpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2376, 2498, 12, 2890, 16, 20148, 4672, 315, 5736, 279, 666, 434, 10529, 1677, 434, 279, 667, 1199, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2376, 2498, 12, 2890, 16, 20148, 4672, 315, 5736, 279, 666, 434, 10529, 1677, 434, 279, 667, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule="extended")
sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule="extended")
def branch_weyl_character(chi, R, S, rule="default"): r""" A Branching rule describes the restriction of representations from a Lie group or algebra G to a smaller one. See for example, R. C. King, Branching rules for classical Lie groups using tensor and spinor methods. J. Phys. A 8 (1975), 429-449, Howe, Tan and Willenbring, Stable branching rules for classical symmetric pairs, Trans. Amer. Math. Soc. 357 (2005), no. 4, 1601-1626, McKay and Patera, Tables of Dimensions, Indices and Branching Rules for Representations of Simple Lie Algebras (Marcel Dekker, 1981), and Fauser, Jarvis, King and Wybourne, New branching rules induced by plethysm. J. Phys. A 39 (2006), no. 11, 2611--2655. INPUT: - ``chi`` - a character of G - ``R`` - the Weyl Character Ring of G - ``S`` - the Weyl Character Ring of H - ``rule`` - a set of r dominant weights in H where r is the rank of G. You may use a predefined rule by specifying rule = one of"levi", "automorphic", "symmetric", "extended", "triality" or "miscellaneous". The use of these rules will be explained next. After the examples we will explain how to write your own branching rules for cases that we have omitted. To explain the predefined rules we survey the most important branching rules. These may be classified into several cases, and once this is understood, the detailed classification can be read off from the Dynkin diagrams. Dynkin classified the maximal subgroups of Lie groups in Mat. Sbornik N.S. 30(72):349-462 (1952). We will list give predefined rules that cover most cases where the branching rule is to a maximal subgroup. For convenience, we also give some branching rules to subgroups that are not maximal. For example, a Levi subgroup may or may not be maximal. LEVI TYPE. These can be read off from the Dynkin diagram. If removing a node from the Dynkin diagram produces another Dynkin diagram, there is a branching rule. Currently we require that the smaller diagram be connected. For these rules use the option rule="levi":: ['A',r] => ['A',r-1] ['B',r] => ['A',r-1] ['B',r] => ['B',r-1] ['C',r] => ['A',r-1] ['C',r] => ['C',r-1] ['D',r] => ['A',r-1] ['D',r] => ['D',r-1] ['E',r] => ['A',r-1] r = 7,8 ['E',r] => ['D',r-1] r = 6,7,8 ['E',r] => ['E',r-1] F4 => B3 F4 => C3 G2 => A1 (short root) Not all Levi subgroups are maximal subgroups. If the Levi is not maximal there may or may not be a preprogrammed rule="levi" for it. If there is not, the branching rule may still be obtained by going through an intermediate subgroup that is maximal using rule="extended". Thus the other Levi branching rule from G2 => A1 corresponding to the long root is available by first branching G2 => A_2 then A2 => A1. Similarly the branching rules to the Levi subgroup:: ['E',r] => ['A',r-1] r = 6,7,8 may be obtained by first branching E6=>A5xA1, E7=>A7 or E8=>A8. AUTOMORPHIC TYPE. If the Dynkin diagram has a symmetry, then there is an automorphism that is a special case of a branching rule. There is also an exotic "triality" automorphism of D4 having order 3. Use rule="automorphic" or (for D4) rule="triality":: ['A',r] => ['A',r] ['D',r] => ['D',r] E6 => E6 SYMMETRIC TYPE. Related to the automorphic type, when either the Dynkin diagram or the extended diagram has a symmetry there is a branching rule to the subalgebra (or subgroup) of invariants under the automorphism. Use rule="symmetric". The last branching rule, D4=>G2 is not to a maximal subgroup since D4=>B3=>G2, but it is included for convenience. :: ['A',2r+1] => ['B',r] ['A',2r] => ['C',r] ['A',2r] => ['D',r] ['D',r] => ['B',r-1] E6 => F4 D4 => G2 EXTENDED TYPE. If removing a node from the extended Dynkin diagram results in a Dynkin diagram, then there is a branching rule. Use rule="extended" for these. We will also use this classification for some rules that are not of this type, mainly involving type B, such as D6 => B3xB3. Here is the extended Dynkin diagram for D6:: 0 6 O O | | | | O---O---O---O---O 1 2 3 4 6 Removing the node 3 results in an embedding D3xD3 -> D6. This corresponds to the embedding SO(6)xSO(6) -> SO(12), and is of extended type. On the other hand the embedding SO(5)xSO(7)-->SO(12) (e.g. B2xB3 -> D6) cannot be explained this way but for uniformity is implemented under rule="extended". Using rule="extended" you can get any branching rule SO(n) => SO(a) x SO(b) x SO(c) x ... where n = a+b+c+ ... Sp(2n) => Sp(2a) x Sp(2b) x Sp(2c) x ... where n = a+b+c+ ... where O(a) = ['D',r] (a=2r) or ['B',r] (a=2r+1) and Sp(2r)=['C',r]. The following rules are implemented as special cases of rule="extended". :: E6 => A5xA1, A2xA2xA2 E7 => A7, D6xA1, A3xA3xA1 E8 => A8, D8, E7xA1, A4xA4, D5xA3, E6xA2 F4 => B4, C3xA1, A2xA2, A3xA1 G2 => A1xA1 Note that E8 has only a limited number of representations of reasonably low degree. TENSOR: There are branching rules: :: ['A', rs-1] => ['A',r-1] x ['A',s-1] ['B',2rs+r+s] => ['B',r] x ['B',s] ['D',2rs+s] => ['B',r] x ['D',s] ['D',2rs] => ['D',r] x ['D',s] ['D',2rs] => ['C',r] x ['C',s] ['C',2rs+s] => ['B',r] x ['C',s] ['C',2rs] => ['C',r] x ['D',s]. corresponding to the tensor product homomorphism. For type A, the homomorphism is GL(r) x GL(s) -> GL(rs). For the classical types, the relevant fact is that if V,W are orthogonal or symplectic spaces, that is, spaces endowed with symmetric or skew-symmetric bilinear forms, then V tensor W is also an orthogonal space (if V and W are both orthogonal or both symplectic) or symplectic (if one of V and W is orthogonal and the other symplectic). The corresponding branching rules are obtained using rule="tensor". SYMMETRIC POWER: The k-th symmetric and exterior power homomorphisms map GL(n) --> GL(binomial(n+k-1,k)) and GL(binomial(n,k)). The corresponding branching rules are not implemented but a special case is. The k-th symmetric power homomorphism SL(2) --> GL(k+1) has its image inside of SO(2r+1) if k=2r and inside of Sp(2r) if k=2r-1. Hence there are branching rules:: ['B',r] => A1 ['C',r] => A1 and these may be obtained using the rule "symmetric_power". MISCELLANEOUS: Use rule="miscellaneous" for the following rules:: B3 => G2 F4 => G2xA1 (not implemented yet) BRANCHING RULES FROM PLETHYSMS Nearly all branching rules G => H where G is of type A,B,C or D are covered by the preceding rules. The function branching_rules_from_plethysm covers the remaining cases. ISOMORPHIC TYPE: Although not usually referred to as a branching rule, the effects of the accidental isomorphisms may be handled using rule="isomorphic":: B2 => C2 C2 => B2 A3 => D3 D3 => A3 D2 => A1xA1 B1 => A1 C1 => A1 EXAMPLES: (Levi type) :: sage: A1 = WeylCharacterRing("A1") sage: A2 = WeylCharacterRing("A2") sage: A3 = WeylCharacterRing("A3") sage: A4 = WeylCharacterRing("A4") sage: A5 = WeylCharacterRing("A5") sage: B2 = WeylCharacterRing("B2") sage: B3 = WeylCharacterRing("B3") sage: B4 = WeylCharacterRing("B4") sage: C2 = WeylCharacterRing("C2") sage: C3 = WeylCharacterRing("C3") sage: D3 = WeylCharacterRing("D3") sage: D4 = WeylCharacterRing("D4") sage: D5 = WeylCharacterRing("D5") sage: G2 = WeylCharacterRing("G2") sage: F4 = WeylCharacterRing("F4",style="coroots") # long time sage: E6=WeylCharacterRing("E6",style="coroots") sage: D5=WeylCharacterRing("D5",style="coroots") sage: [B3(w).branch(A2,rule="levi") for w in B3.fundamental_weights()] [A2(0,0,-1) + A2(0,0,0) + A2(1,0,0), A2(0,-1,-1) + A2(0,0,-1) + A2(0,0,0) + A2(1,0,-1) + A2(1,0,0) + A2(1,1,0), A2(-1/2,-1/2,-1/2) + A2(1/2,-1/2,-1/2) + A2(1/2,1/2,-1/2) + A2(1/2,1/2,1/2)] The last example must be understood as follows. The representation of B3 being branched is spin, which is not a representation of SO(7) but of its double cover spin(7). The group A2 is really GL(3) and the double cover of SO(7) induces a cover of GL(3) that is trivial over SL(3) but not over the center of GL(3). The weight lattice for this GL(3) consists of triples (a,b,c) of half integers such that a-b and b-c are in `\ZZ`, and this is reflected in the last decomposition. :: sage: [C3(w).branch(A2,rule="levi") for w in C3.fundamental_weights()] [A2(0,0,-1) + A2(1,0,0), A2(0,-1,-1) + A2(1,0,-1) + A2(1,1,0), A2(-1,-1,-1) + A2(1,-1,-1) + A2(1,1,-1) + A2(1,1,1)] sage: [D4(w).branch(A3,rule="levi") for w in D4.fundamental_weights()] [A3(0,0,0,-1) + A3(1,0,0,0), A3(0,0,-1,-1) + A3(0,0,0,0) + A3(1,0,0,-1) + A3(1,1,0,0), A3(1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,-1/2), A3(-1/2,-1/2,-1/2,-1/2) + A3(1/2,1/2,-1/2,-1/2) + A3(1/2,1/2,1/2,1/2)] sage: [B3(w).branch(B2,rule="levi") for w in B3.fundamental_weights()] [2*B2(0,0) + B2(1,0), B2(0,0) + 2*B2(1,0) + B2(1,1), 2*B2(1/2,1/2)] sage: C3 = WeylCharacterRing(['C',3]) sage: [C3(w).branch(C2,rule="levi") for w in C3.fundamental_weights()] [2*C2(0,0) + C2(1,0), C2(0,0) + 2*C2(1,0) + C2(1,1), C2(1,0) + 2*C2(1,1)] sage: [D5(w).branch(D4,rule="levi") for w in D5.fundamental_weights()] [2*D4(0,0,0,0) + D4(1,0,0,0), D4(0,0,0,0) + 2*D4(1,0,0,0) + D4(1,1,0,0), D4(1,0,0,0) + 2*D4(1,1,0,0) + D4(1,1,1,0), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2) + D4(1/2,1/2,1/2,1/2)] sage: G2(1,0,-1).branch(A1,rule="levi") A1(0,-1) + A1(1,-1) + A1(1,0) sage: E6=WeylCharacterRing("E6",style="coroots") # long time sage: D5=WeylCharacterRing("D5",style="coroots") # long time sage: fw = E6.fundamental_weights() # long time sage: [E6(fw[i]).branch(D5,rule="levi") for i in [1,2,6]] # long time [D5(0,0,0,0,0) + D5(0,0,0,0,1) + D5(1,0,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(0,0,0,0,1) + D5(0,1,0,0,0), D5(0,0,0,0,0) + D5(0,0,0,1,0) + D5(1,0,0,0,0)] sage: E7=WeylCharacterRing("E7",style="coroots") # long time sage: D6=WeylCharacterRing("D6",style="coroots") # long time sage: fw = E7.fundamental_weights() # long time sage: [E7(fw[i]).branch(D6,rule="levi") for i in [1,2,7]] # long time [3*D6(0,0,0,0,0,0) + 2*D6(0,0,0,0,1,0) + D6(0,1,0,0,0,0), 3*D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0) + 2*D6(0,0,1,0,0,0) + D6(1,0,0,0,1,0), D6(0,0,0,0,0,1) + 2*D6(1,0,0,0,0,0)] sage: D7=WeylCharacterRing("D7",style="coroots",cache=True) # long time sage: E8=WeylCharacterRing("E8",style="coroots",cache=True) # long time sage: D7=WeylCharacterRing("D7",style="coroots",cache=True) # long time sage: E8(1,0,0,0,0,0,0,0).branch(D7,rule="levi") # long time 3*D7(0,0,0,0,0,0,0) + 2*D7(0,0,0,0,0,1,0) + 2*D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) + 2*D7(0,0,1,0,0,0,0) + D7(0,0,0,1,0,0,0) + D7(1,0,0,0,0,1,0) + D7(1,0,0,0,0,0,1) + D7(2,0,0,0,0,0,0) sage: E8(0,0,0,0,0,0,0,1).branch(D7,rule="levi") # long time D7(0,0,0,0,0,0,0) + D7(0,0,0,0,0,1,0) + D7(0,0,0,0,0,0,1) + 2*D7(1,0,0,0,0,0,0) + D7(0,1,0,0,0,0,0) sage: [F4(fw).branch(B3,rule="levi") for fw in F4.fundamental_weights()] # long time [B3(0,0,0) + 2*B3(1/2,1/2,1/2) + 2*B3(1,0,0) + B3(1,1,0), B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 5*B3(1,0,0) + 7*B3(1,1,0) + 3*B3(1,1,1) + 6*B3(3/2,1/2,1/2) + 2*B3(3/2,3/2,1/2) + B3(2,0,0) + 2*B3(2,1,0) + B3(2,1,1), 3*B3(0,0,0) + 6*B3(1/2,1/2,1/2) + 4*B3(1,0,0) + 3*B3(1,1,0) + B3(1,1,1) + 2*B3(3/2,1/2,1/2), 3*B3(0,0,0) + 2*B3(1/2,1/2,1/2) + B3(1,0,0)] sage: [F4(fw).branch(C3,rule="levi") for fw in F4.fundamental_weights()] # long time [3*C3(0,0,0) + 2*C3(1,1,1) + C3(2,0,0), 3*C3(0,0,0) + 6*C3(1,1,1) + 4*C3(2,0,0) + 2*C3(2,1,0) + 3*C3(2,2,0) + C3(2,2,2) + C3(3,1,0) + 2*C3(3,1,1), 2*C3(1,0,0) + 3*C3(1,1,0) + C3(2,0,0) + 2*C3(2,1,0) + C3(2,1,1), 2*C3(1,0,0) + C3(1,1,0)] sage: A1xA1 = WeylCharacterRing("A1xA1") sage: [A3(hwv).branch(A1xA1,rule="levi") for hwv in A3.fundamental_weights()] [A1xA1(0,0,1,0) + A1xA1(1,0,0,0), A1xA1(0,0,1,1) + A1xA1(1,0,1,0) + A1xA1(1,1,0,0), A1xA1(1,0,1,1) + A1xA1(1,1,1,0)] sage: A1xB1=WeylCharacterRing("A1xB1",style="coroots") sage: [B3(x).branch(A1xB1,rule="levi") for x in B3.fundamental_weights()] [A1xB1(0,2) + 2*A1xB1(1,0), 3*A1xB1(0,0) + A1xB1(0,2) + 2*A1xB1(1,2) + A1xB1(2,0), 2*A1xB1(0,1) + A1xB1(1,1)] EXAMPLES: (Automorphic type, including D4 triality) :: sage: [A3(chi).branch(A3,rule="automorphic") for chi in A3.fundamental_weights()] [A3(0,0,0,-1), A3(0,0,-1,-1), A3(0,-1,-1,-1)] sage: [D4(chi).branch(D4,rule="automorphic") for chi in D4.fundamental_weights()] [D4(1,0,0,0), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1/2,1/2,1/2,-1/2)] sage: [D4(chi).branch(D4,rule="triality") for chi in D4.fundamental_weights()] [D4(1/2,1/2,1/2,-1/2), D4(1,1,0,0), D4(1/2,1/2,1/2,1/2), D4(1,0,0,0)] EXAMPLES: (Symmetric type) :: sage: [w.branch(B2,rule="symmetric") for w in [A4(1,0,0,0,0),A4(1,1,0,0,0),A4(1,1,1,0,0),A4(2,0,0,0,0)]] [B2(1,0), B2(1,1), B2(1,1), B2(0,0) + B2(2,0)] sage: [A5(w).branch(C3,rule="symmetric") for w in A5.fundamental_weights()] [C3(1,0,0), C3(0,0,0) + C3(1,1,0), C3(1,0,0) + C3(1,1,1), C3(0,0,0) + C3(1,1,0), C3(1,0,0)] sage: [A5(w).branch(D3,rule="symmetric") for w in A5.fundamental_weights()] [D3(1,0,0), D3(1,1,0), D3(1,1,-1) + D3(1,1,1), D3(1,1,0), D3(1,0,0)] sage: [D4(x).branch(B3,rule="symmetric") for x in D4.fundamental_weights()] [B3(0,0,0) + B3(1,0,0), B3(1,0,0) + B3(1,1,0), B3(1/2,1/2,1/2), B3(1/2,1/2,1/2)] sage: [D4(x).branch(G2,rule="symmetric") for x in D4.fundamental_weights()] [G2(0,0,0) + G2(1,0,-1), 2*G2(1,0,-1) + G2(2,-1,-1), G2(0,0,0) + G2(1,0,-1), G2(0,0,0) + G2(1,0,-1)] sage: [E6(fw).branch(F4,rule="symmetric") for fw in E6.fundamental_weights()] # long time [F4(0,0,0,0) + F4(0,0,0,1), F4(0,0,0,1) + F4(1,0,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(1,0,0,0) + 2*F4(0,0,1,0) + F4(1,0,0,1) + F4(0,1,0,0), F4(0,0,0,1) + F4(1,0,0,0) + F4(0,0,1,0), F4(0,0,0,0) + F4(0,0,0,1)] EXAMPLES: (Extended type) :: sage: [B3(x).branch(D3,rule="extended") for x in B3.fundamental_weights()] [D3(0,0,0) + D3(1,0,0), D3(1,0,0) + D3(1,1,0), D3(1/2,1/2,-1/2) + D3(1/2,1/2,1/2)] sage: [G2(w).branch(A2, rule="extended") for w in G2.fundamental_weights()] [A2(0,0,0) + A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3), A2(1/3,1/3,-2/3) + A2(2/3,-1/3,-1/3) + A2(1,0,-1)] sage: [F4(fw).branch(B4,rule="extended") for fw in F4.fundamental_weights()] # long time [B4(1/2,1/2,1/2,1/2) + B4(1,1,0,0), B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2) + B4(3/2,3/2,1/2,1/2) + B4(2,1,1,0), B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0) + B4(1,1,0,0) + B4(1,1,1,0) + B4(3/2,1/2,1/2,1/2), B4(0,0,0,0) + B4(1/2,1/2,1/2,1/2) + B4(1,0,0,0)] sage: E6 = WeylCharacterRing("E6", style="coroots") # long time sage: A2xA2xA2=WeylCharacterRing("A2xA2xA2",style="coroots") sage: A5xA1=WeylCharacterRing("A5xA1",style="coroots") sage: G2 = WeylCharacterRing("G2", style="coroots") sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") sage: F4 = WeylCharacterRing("F4",style="coroots") sage: A3xA1 = WeylCharacterRing("A3xA1", style="coroots") sage: A2xA2 = WeylCharacterRing("A2xA2", style="coroots") sage: A1xC3 = WeylCharacterRing("A1xC3",style="coroots") sage: E6(1,0,0,0,0,0).branch(A5xA1,rule="extended") # long time A5xA1(0,0,0,1,0,0) + A5xA1(1,0,0,0,0,1) sage: E6(1,0,0,0,0,0).branch(A2xA2xA2, rule="extended") # long time A2xA2xA2(0,0,0,1,1,0) + A2xA2xA2(0,1,1,0,0,0) + A2xA2xA2(1,0,0,0,0,1) sage: E7=WeylCharacterRing("E7",style="coroots") # long time sage: A7=WeylCharacterRing("A7",style="coroots") # long time sage: E7(1,0,0,0,0,0,0).branch(A7,rule="extended") # long time A7(0,0,0,1,0,0,0) + A7(1,0,0,0,0,0,1) sage: E8=WeylCharacterRing("E8",cache=true,style="coroots") # long time sage: D8=WeylCharacterRing("D8",cache=true,style="coroots") # long time sage: E8(0,0,0,0,0,0,0,1).branch(D8,rule="extended") # long time D8(0,0,0,0,0,0,1,0) + D8(0,1,0,0,0,0,0,0) sage: F4(1,0,0,0).branch(A1xC3,rule="extended") # long time A1xC3(0,2,0,0) + A1xC3(1,0,0,1) + A1xC3(2,0,0,0) sage: G2(0,1).branch(A1xA1, rule="extended") A1xA1(0,2) + A1xA1(2,0) + A1xA1(3,1) sage: F4(0,0,0,1).branch(A2xA2, rule="extended") # long time A2xA2(0,0,1,1) + A2xA2(0,1,0,1) + A2xA2(1,0,1,0) sage: F4(0,0,0,1).branch(A3xA1,rule="extended") # long time A3xA1(0,0,0,0) + A3xA1(0,0,0,2) + A3xA1(0,0,1,1) + A3xA1(0,1,0,0) + A3xA1(1,0,0,1) sage: D4=WeylCharacterRing("D4",style="coroots") sage: D2xD2=WeylCharacterRing("D2xD2",style="coroots") # We get D4 => A1xA1xA1xA1 by remembering that A1xA1 = D2. sage: [D4(fw).branch(D2xD2, rule="extended") for fw in D4.fundamental_weights()] [D2xD2(0,0,1,1) + D2xD2(1,1,0,0), D2xD2(0,0,2,0) + D2xD2(0,0,0,2) + D2xD2(2,0,0,0) + D2xD2(1,1,1,1) + D2xD2(0,2,0,0), D2xD2(1,0,0,1) + D2xD2(0,1,1,0), D2xD2(1,0,1,0) + D2xD2(0,1,0,1)] EXAMPLES: (Tensor type) :: sage: A5=WeylCharacterRing("A5", style="coroots") sage: A2xA1=WeylCharacterRing("A2xA1", style="coroots") sage: [A5(hwv).branch(A2xA1, rule="tensor") for hwv in A5.fundamental_weights()] [A2xA1(1,0,1), A2xA1(0,1,2) + A2xA1(2,0,0), A2xA1(0,0,3) + A2xA1(1,1,1), A2xA1(1,0,2) + A2xA1(0,2,0), A2xA1(0,1,1)] sage: B4=WeylCharacterRing("B4",style="coroots") sage: B1xB1=WeylCharacterRing("B1xB1",style="coroots") sage: [B4(f).branch(B1xB1,rule="tensor") for f in B4.fundamental_weights()] [B1xB1(2,2), B1xB1(0,2) + B1xB1(2,0) + B1xB1(2,4) + B1xB1(4,2), B1xB1(0,2) + B1xB1(0,6) + B1xB1(2,0) + B1xB1(2,2) + B1xB1(2,4) + B1xB1(4,2) + B1xB1(4,4) + B1xB1(6,0), B1xB1(1,3) + B1xB1(3,1)] sage: D4=WeylCharacterRing("D4",style="coroots") sage: C2xC1=WeylCharacterRing("C2xC1",style="coroots") sage: [D4(f).branch(C2xC1,rule="tensor") for f in D4.fundamental_weights()] [C2xC1(1,0,1), C2xC1(0,0,2) + C2xC1(0,1,2) + C2xC1(2,0,0), C2xC1(1,0,1), C2xC1(0,0,2) + C2xC1(0,1,0)] sage: C3=WeylCharacterRing("C3",style="coroots") sage: B1xC1=WeylCharacterRing("B1xC1",style="coroots") sage: [C3(f).branch(B1xC1,rule="tensor") for f in C3.fundamental_weights()] [B1xC1(2,1), B1xC1(2,2) + B1xC1(4,0), B1xC1(0,3) + B1xC1(4,1)] EXAMPLES: (Symmetric Power) :: sage: A1=WeylCharacterRing("A1",style="coroots") sage: B3=WeylCharacterRing("B3",style="coroots") sage: C3=WeylCharacterRing("C3",style="coroots") sage: [B3(fw).branch(A1,rule="symmetric_power") for fw in B3.fundamental_weights()] [A1(6), A1(2) + A1(6) + A1(10), A1(0) + A1(6)] sage: [C3(fw).branch(A1,rule="symmetric_power") for fw in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] EXAMPLES: (Miscellaneous type) :: sage: G2 = WeylCharacterRing("G2") sage: [fw1, fw2, fw3] = B3.fundamental_weights() sage: B3(fw1+fw3).branch(G2, rule="miscellaneous") G2(1,0,-1) + G2(2,-1,-1) + G2(2,0,-2) EXAMPLES: (Isomorphic type) :: sage: [B2(x).branch(C2, rule="isomorphic") for x in B2.fundamental_weights()] [C2(1,1), C2(1,0)] sage: [C2(x).branch(B2, rule="isomorphic") for x in C2.fundamental_weights()] [B2(1/2,1/2), B2(1,0)] sage: [A3(x).branch(D3,rule="isomorphic") for x in A3.fundamental_weights()] [D3(1/2,1/2,1/2), D3(1,0,0), D3(1/2,1/2,-1/2)] sage: [D3(x).branch(A3,rule="isomorphic") for x in D3.fundamental_weights()] [A3(1/2,1/2,-1/2,-1/2), A3(1/4,1/4,1/4,-3/4), A3(3/4,-1/4,-1/4,-1/4)] Here A3(x,y,z,w) can be understood as a representation of SL(4). The weights x,y,z,w and x+t,y+t,z+t,w+t represent the same representation of SL(4) - though not of GL(4) - since A3(x+t,y+t,z+t,w+t) is the same as A3(x,y,z,w) tensored with `det^t`. So as a representation of SL(4), A3(1/4,1/4,1/4,-3/4) is the same as A3(1,1,1,0). The exterior square representation SL(4) -> GL(6) admits an invariant symmetric bilinear form, so is a representation SL(4) -> SO(6) that lifts to an isomorphism SL(4) -> Spin(6). Conversely, there are two isomorphisms SO(6) -> SL(4), of which we've selected one. In cases like this you might prefer style="coroots". :: sage: A3 = WeylCharacterRing("A3",style="coroots") sage: D3 = WeylCharacterRing("D3",style="coroots") sage: [D3(fw) for fw in D3.fundamental_weights()] [D3(1,0,0), D3(0,1,0), D3(0,0,1)] sage: [D3(fw).branch(A3,rule="isomorphic") for fw in D3.fundamental_weights()] [A3(0,1,0), A3(0,0,1), A3(1,0,0)] sage: D2 = WeylCharacterRing("D2", style="coroots") sage: A1xA1 = WeylCharacterRing("A1xA1", style="coroots") sage: [D2(fw).branch(A1xA1,rule="isomorphic") for fw in D2.fundamental_weights()] [A1xA1(1,0), A1xA1(0,1)] EXAMPLES: (Branching rules from plethysms) This is a general rule that includes any branching rule from types A,B,C or D as a special case. Thus it could be used in place of the above rules and would give the same results. However it is most useful when branching from G to a maximal subgroup H such that rank(H) < rank(G)-1. We consider a homomorphism H --> G where G is one of SL(r+1), SO(2r+1), Sp(2r) or SO(2r). The function branching_rule_from_plethysm produces the corresponding branching rule. The main ingredient is the character chi of the representation of H that is the homomorphism to GL(r+1), GL(2r+1) or GL(2r). This rule is so powerful that it contains the other rules implemented above as special cases. First let us consider the symmetric fifth power representation of SL(2). :: sage: A1=WeylCharacterRing("A1",style="coroots") sage: chi=A1([5]) sage: chi.degree() 6 sage: chi.frobenius_schur_indicator() -1 This confirms that the character has degree 6 and is symplectic, so it corresponds to a homomorphism SL(2) --> Sp(6), and there is a corresponding branching rule C3 => A1. :: sage: C3 = WeylCharacterRing("C3",style="coroots") sage: sym5rule = branching_rule_from_plethysm(chi,"C3") sage: [C3(hwv).branch(A1,rule=sym5rule) for hwv in C3.fundamental_weights()] [A1(5), A1(4) + A1(8), A1(3) + A1(9)] This is identical to the results we would obtain using rule="symmetric_power". The next example gives a branching not available by other standard rules. :: sage: G2 = WeylCharacterRing("G2",style="coroots") sage: D7 = WeylCharacterRing("D7",style="coroots") sage: ad=G2(0,1); ad.degree(); ad.frobenius_schur_indicator() 14 1 sage: spin = D7(0,0,0,0,0,1,0); spin.degree() 64 sage: spin.branch(G2, rule=branching_rule_from_plethysm(ad, "D7")) G2(1,1) We have confirmed that the adjoint representation of G2 gives a homomorphism into SO(14), and that the pullback of the one of the two 64 dimensional spin representations to SO(14) is an irreducible representation of G2. BRANCHING FROM A REDUCIBLE ROOT SYSTEM If you are branching from a reducible root system, the rule is a list of rules, one for each component type in the root system. The rules in the list are given in pairs [type, rule], where type is the root system to be branched to, and rule is the branching rule. :: sage: D4 = WeylCharacterRing("D4",style="coroots") sage: D2xD2 = WeylCharacterRing("D2xD2",style="coroots") sage: A1xA1xA1xA1 = WeylCharacterRing("A1xA1xA1xA1",style="coroots") sage: rr = [["A1xA1","isomorphic"],["A1xA1","isomorphic"]] sage: [D4(fw) for fw in D4.fundamental_weights()] [D4(1,0,0,0), D4(0,1,0,0), D4(0,0,1,0), D4(0,0,0,1)] sage: [D4(fw).branch(D2xD2,rule="extended").branch(A1xA1xA1xA1,rule=rr) for fw in D4.fundamental_weights()] [A1xA1xA1xA1(0,0,1,1) + A1xA1xA1xA1(1,1,0,0), A1xA1xA1xA1(0,0,0,2) + A1xA1xA1xA1(0,0,2,0) + A1xA1xA1xA1(0,2,0,0) + A1xA1xA1xA1(1,1,1,1) + A1xA1xA1xA1(2,0,0,0), A1xA1xA1xA1(0,1,1,0) + A1xA1xA1xA1(1,0,0,1), A1xA1xA1xA1(0,1,0,1) + A1xA1xA1xA1(1,0,1,0)] WRITING YOUR OWN RULES Suppose you want to branch from a group G to a subgroup H. Arrange the embedding so that a Cartan subalgebra U of H is contained in a Cartan subalgebra T of G. There is thus a mapping from the weight spaces Lie(T)* --> Lie(U)*. Two embeddings will produce identical branching rules if they differ by an element of the Weyl group of H. The RULE is this map Lie(T)* = G.space() to Lie(U)* = H.space(), which you may implement as a function. As an example, let us consider how to implement the branching rule A3 => C2. Here H = C2 = Sp(4) embedded as a subgroup in A3 = GL(4). The Cartan subalgebra U consists of diagonal matrices with eigenvalues u1, u2, -u2, -u1. The C2.space() is the two dimensional vector spaces consisting of the linear functionals u1 and u2 on U. On the other hand Lie(T) is RR^4. A convenient way to see the restriction is to think of it as the adjoint of the map [u1,u2] -> [u1,u2,-u2,-u1], that is, [x0,x1,x2,x3] -> [x0-x3,x1-x2]. Hence we may encode the rule: :: def rule(x): return [x[0]-x[3],x[1]-x[2]] or simply: :: rule = lambda x : [x[0]-x[3],x[1]-x[2]] EXAMPLES:: sage: A3 = WeylCharacterRing(['A',3]) sage: C2 = WeylCharacterRing(['C',2]) sage: rule = lambda x : [x[0]-x[3],x[1]-x[2]] sage: branch_weyl_character(A3([1,1,0,0]),A3,C2,rule) C2(0,0) + C2(1,1) sage: A3(1,1,0,0).branch(C2, rule) == C2(0,0) + C2(1,1) True """ if type(rule) == str: rule = get_branching_rule(R._cartan_type, S._cartan_type, rule) elif R._cartan_type.is_compound(): Rtypes = R._cartan_type.component_types() Stypes = [CartanType(l[0]) for l in rule] rules = [l[1] for l in rule] ntypes = len(Rtypes) rule_list = [get_branching_rule(Rtypes[i], Stypes[i], rules[i]) for i in range(ntypes)] shifts = R._cartan_type._shifts def rule(x): yl = [] for i in range(ntypes): yl.append(rule_list[i](x[shifts[i]:shifts[i+1]])) return flatten(yl) mdict = {} for k in chi._mdict: if S._style == "coroots": if S._cartan_type.is_atomic() and S._cartan_type[0] == 'E': if S._cartan_type[1] == 6: h = S._space(rule(list(k.to_vector()))) h = S.coerce_to_e6(h) elif S._cartan_type[1] == 7: h = S.coerce_to_e7(S._space(rule(list(k.to_vector())))) else: h = S.coerce_to_sl(S._space(rule(list(k.to_vector())))) else: h = S._space(rule(list(k.to_vector()))) if h in mdict: mdict[h] += chi._mdict[k] else: mdict[h] = chi._mdict[k] hdict = S.char_from_weights(mdict) return WeylCharacter(S, hdict, mdict)
68056760eb3ea24c9f38e98e013d2a603dceb54d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/68056760eb3ea24c9f38e98e013d2a603dceb54d/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3803, 67, 91, 402, 80, 67, 11560, 12, 24010, 16, 534, 16, 348, 16, 1720, 1546, 1886, 6, 4672, 436, 8395, 432, 15449, 310, 1720, 19605, 326, 9318, 434, 27851, 628, 279, 511, 1385, 1041,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3803, 67, 91, 402, 80, 67, 11560, 12, 24010, 16, 534, 16, 348, 16, 1720, 1546, 1886, 6, 4672, 436, 8395, 432, 15449, 310, 1720, 19605, 326, 9318, 434, 27851, 628, 279, 511, 1385, 1041,...
self._tk = None
def close(self, isOK=True, reason=None): """Start closing the serial port. Does nothing if the serial is already closed or failed. Inputs: - isOK: if True, mark state as Closed, else Failed - reason: a string explaining why, or None to leave unchanged; please specify if isOK is false. """ #print "%s.close(isOK=%s, reason=%s)" % (self.__class__.__name__, isOK, reason) if self._state <= self.Closed: return
8861073638c4cb2947725ca8b8e5a7078fd646bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6353/8861073638c4cb2947725ca8b8e5a7078fd646bc/TkSerial.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 16, 353, 3141, 33, 5510, 16, 3971, 33, 7036, 4672, 3536, 1685, 7647, 326, 2734, 1756, 18, 225, 9637, 5083, 309, 326, 2734, 353, 1818, 4375, 578, 2535, 18, 225, 24472, 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, 1746, 12, 2890, 16, 353, 3141, 33, 5510, 16, 3971, 33, 7036, 4672, 3536, 1685, 7647, 326, 2734, 1756, 18, 225, 9637, 5083, 309, 326, 2734, 353, 1818, 4375, 578, 2535, 18, 225, 24472, 3...
for i in range(len(self.__unpacked_data_elms__)):
for i in xrange(len(self.__unpacked_data_elms__)):
def __pack__(self): new_values = [] for i in range(len(self.__unpacked_data_elms__)): for key in self.__keys__[i]: new_val = getattr(self, key) old_val = self.__unpacked_data_elms__[i] # In the case of Unions, when the first changed value # is picked the loop is exited if new_val != old_val: break new_values.append(new_val) return struct.pack(self.__format__, *new_values)
21cbdaf9ea57ad8ceb3b39cbd606211597c127d9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/213/21cbdaf9ea57ad8ceb3b39cbd606211597c127d9/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2920, 972, 12, 2890, 4672, 225, 394, 67, 2372, 273, 5378, 225, 364, 277, 316, 12314, 12, 1897, 12, 2890, 16186, 17309, 329, 67, 892, 67, 292, 959, 972, 3719, 30, 225, 364, 498, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2920, 972, 12, 2890, 4672, 225, 394, 67, 2372, 273, 5378, 225, 364, 277, 316, 12314, 12, 1897, 12, 2890, 16186, 17309, 329, 67, 892, 67, 292, 959, 972, 3719, 30, 225, 364, 498, ...
items.reverse()
items=self.reverse_items(items)
def tpRenderTABLE(self, id, root_url, url, state, substate, diff, data, colspan, section, md, treeData, level=0, args=None, simple_type={type(''):0, type(1):0, type(1.0):0}.has_key, ): "Render a tree as a table" have_arg=args.has_key exp=0 if level >= 0: urlattr=args['url'] if urlattr and hasattr(self, urlattr): tpUrl=getattr(self, urlattr) if not simple_type(type(tpUrl)): tpUrl=tpUrl() url = (url and ('%s/%s' % (url, tpUrl))) or tpUrl root_url = root_url or tpUrl treeData['tree-item-url']=url treeData['tree-level']=level treeData['tree-item-expanded']=0 idattr=args['id'] output=data.append items=None if (have_arg('assume_children') and args['assume_children'] and substate is not state): # We should not compute children unless we have to. # See if we've been asked to expand our children. for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break if not exp: items=1 if items is None: validate=md.validate if have_arg('branches') and hasattr(self, args['branches']): if validate is None or not hasattr(self, 'aq_acquire'): items=getattr(self, args['branches']) else: items=self.aq_acquire(args['branches'],validate,md) items=items() elif have_arg('branches_expr'): items=args['branches_expr'](md) if not items and have_arg('leaves'): items=1 if items and items != 1: if validate is not None: unauth=[] index=0 for i in items: try: v=validate(items,items,index,i,md) except: v=0 if not v: unauth.append(index) index=index+1 if unauth: if have_arg('skip_unauthorized') and args['skip_unauthorized']: items=list(items) unauth.reverse() for i in unauth: del items[i] else: raise ValidationError, unauth if have_arg('sort'): # Faster/less mem in-place sort if type(items)==type(()): items=list(items) sort=args['sort'] size=range(len(items)) for i in size: v=items[i] k=getattr(v,sort) try: k=k() except: pass items[i]=(k,v) items.sort() for i in size: items[i]=items[i][1] if have_arg('reverse'): items.reverse() diff.append(id) sub=None if substate is state: output('<TABLE CELLSPACING="0">\n') sub=substate[0] exp=items else: # Add prefix output('<TR>\n') # Add +/- icon if items: if level: if level > 3: output( '<TD COLSPAN="%s"></TD>' % (level-1)) elif level > 1: output('<TD></TD>' * (level-1)) output('<TD WIDTH="16"></TD>\n') output('<TD WIDTH="16" VALIGN="TOP">') for i in range(len(substate)): sub=substate[i] if sub[0]==id: exp=i+1 break #################################### # Mostly inline encode_seq for speed s=compress(str(diff)) if len(s) > 57: s=encode_str(s) else: s=b2a_base64(s)[:-1] l=find(s,'=') if l >= 0: s=s[:l] s=translate(s, tplus) #################################### script=md['SCRIPT_NAME'] if exp: treeData['tree-item-expanded']=1 output('<A NAME="%s">' '<A HREF="%s?tree-c=%s#%s">' '<IMG SRC="%s/p_/mi" BORDER=0></A></A>' % (id, root_url, s, id, script)) else: output('<A NAME="%s">' '<A HREF="%s?tree-e=%s#%s">' '<IMG SRC="%s/p_/pl" BORDER=0></A></A>' % (id, root_url, s, id, script)) output('</TD>\n') else: if level > 2: output('<TD COLSPAN="%s"></TD>' % level) elif level > 0: output('<TD></TD>' * level) output('<TD WIDTH="16"></TD>\n') # add item text dataspan=colspan-level output('<TD%s%s VALIGN="TOP" ALIGN="LEFT">' % ((dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''), (have_arg('nowrap') and args['nowrap'] and ' NOWRAP' or '')) ) output(render_blocks(section, md)) output('</TD>\n</TR>\n') if exp: level=level+1 dataspan=colspan-level if level > 3: h='<TD COLSPAN="%s"></TD>' % (level-1) elif level > 1: h='<TD></TD>' * (level-1) else: h='' if have_arg('header'): doc=args['header'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) if items==1: # leaves if have_arg('leaves'): doc=args['leaves'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) elif have_arg('expand'): doc=args['expand'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: treeData['-tree-substate-']=sub treeData['tree-level']=level md._push(treeData) try: output(doc( None,md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) finally: md._pop(1) else: __traceback_info__=sub, args, state, substate ids={} for item in items: if hasattr(item, idattr): id=getattr(item, idattr) if not simple_type(type(id)): id=id() elif hasattr(item, '_p_oid'): id=oid(item) else: id=pyid(item) if len(sub)==1: sub.append([]) substate=sub[1] ids[id]=1 md._push(InstanceDict(item,md)) try: data=tpRenderTABLE( item,id,root_url,url,state,substate,diff,data, colspan, section, md, treeData, level, args) finally: md._pop() if not sub[1]: del sub[1] ids=ids.has_key for i in range(len(substate)-1,-1): if not ids(substate[i][0]): del substate[i] if have_arg('footer'): doc=args['footer'] if md.has_key(doc): doc=md.getitem(doc,0) else: doc=None if doc is not None: output(doc( None, md, standard_html_header=( '<TR>%s<TD WIDTH="16"></TD>' '<TD%s VALIGN="TOP">' % (h, (dataspan > 1 and (' COLSPAN="%s"' % dataspan) or ''))), standard_html_footer='</TD></TR>', )) del diff[-1] if not diff: output('</TABLE>\n') return data
2e1f1428414aba4dd77cf539c991228f632ae73a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/2e1f1428414aba4dd77cf539c991228f632ae73a/TreeTag.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8071, 3420, 7775, 12, 2890, 16, 612, 16, 1365, 67, 718, 16, 880, 16, 919, 16, 720, 2019, 16, 3122, 16, 501, 16, 20856, 16, 2442, 16, 3481, 16, 2151, 751, 16, 1801, 33, 20, 16, 833,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8071, 3420, 7775, 12, 2890, 16, 612, 16, 1365, 67, 718, 16, 880, 16, 919, 16, 720, 2019, 16, 3122, 16, 501, 16, 20856, 16, 2442, 16, 3481, 16, 2151, 751, 16, 1801, 33, 20, 16, 833,...
return socket.gethostbyname(name)
try: return socket.gethostbyname(name) except socket.gaierror: raise NetworkAddressError("The name '%s' could not be resolved." % name) except TypeError: raise ArgumentError("gethostbyname() takes a string as argument.")
def gethostbyname(name): """ <Purpose> Provides information about a hostname. Calls socket.gethostbyname(). Translate a host name to IPv4 address format. The IPv4 address is returned as a string, such as '100.50.200.5'. If the host name is an IPv4 address itself it is returned unchanged. <Arguments> name: The host name to translate. <Exceptions> NetworkAddressError (descends from NetworkError) if the address cannot be resolved. <Side Effects> None. <Resource Consumption> This operation consumes network bandwidth of 4K netrecv, 1K netsend. (It's hard to tell how much was actually sent / received at this level.) <Returns> The IPv4 address as a string. """ restrictions.assertisallowed('gethostbyname',name) # charge 4K for a look up... I don't know the right number, but we should # charge something. We'll always charge to the netsend interface... nanny.tattle_quantity('netsend', 1024) nanny.tattle_quantity('netrecv', 4096) return socket.gethostbyname(name)
0731dd0f39a2f629a0ee310099687053eaec0920 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/0731dd0f39a2f629a0ee310099687053eaec0920/emulcomm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 2564, 1637, 529, 12, 529, 4672, 3536, 411, 10262, 4150, 34, 28805, 1779, 2973, 279, 5199, 18, 23665, 2987, 18, 75, 546, 669, 1637, 529, 7675, 16820, 279, 1479, 508, 358, 7853, 24, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2564, 1637, 529, 12, 529, 4672, 3536, 411, 10262, 4150, 34, 28805, 1779, 2973, 279, 5199, 18, 23665, 2987, 18, 75, 546, 669, 1637, 529, 7675, 16820, 279, 1479, 508, 358, 7853, 24, ...
'address_allotment_id' : fields.many2one('res.partner.address', 'Allotment Partner'), 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16,2), required=True),
'address_allotment_id': fields.many2one('res.partner.address', 'Allotment Partner'), 'product_uom_qty': fields.float('Quantity (UoM)', digits=(16, 2), required=True),
def _number_packages(self, cr, uid, ids, field_name, arg, context): res = {} for line in self.browse(cr, uid, ids): try: res[line.id] = int(line.product_uom_qty / line.product_packaging.qty) except: res[line.id] = 1 return res
fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c/sale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2696, 67, 10308, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 652, 67, 529, 16, 1501, 16, 819, 4672, 400, 273, 2618, 364, 980, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2696, 67, 10308, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 652, 67, 529, 16, 1501, 16, 819, 4672, 400, 273, 2618, 364, 980, 316, 365, 18, 25731, 12, 3353, 16, 4555, 16, 3258, ...
parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, anniversary = \ [thispage], currentyear, currentmonth, 0, 0, 0, 0
parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, anniversary, parmtemplate = \ [thispage], currentyear, currentmonth, 0, 0, 0, 0, ''
def execute(macro, text): request = macro.request formatter = macro.formatter _ = request.getText # return immediately if getting links for the current page if request.mode_getpagelinks: return '' args_re = re.compile(_args_re_pattern) currentyear, currentmonth, currentday, h, m, s, wd, yd, ds = request.user.getTime(time.time()) thispage = formatter.page.page_name # does the url have calendar params (= somebody has clicked on prev/next links in calendar) ? if macro.form.has_key('calparms'): text2 = macro.form['calparms'][0] args2 = args_re.match(text2) if not args2: return ('<p><strong class="error">%s</strong></p>' % _('Invalid MonthCalendar calparms "%s"!')) % (text2,) else: has_calparms = 1 # yes! cparmpagename, cparmyear, cparmmonth, cparmoffset, cparmoffset2, cparmheight6, cparmanniversary = \ parseargs(args2, thispage, currentyear, currentmonth, 0, 0, 0, 0) else: has_calparms = 0 if text is None: # macro call without parameters parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, anniversary = \ [thispage], currentyear, currentmonth, 0, 0, 0, 0 else: # parse and check arguments args = args_re.match(text) if not args: return ('<p><strong class="error">%s</strong></p>' % _('Invalid MonthCalendar arguments "%s"!')) % (text,) else: parmpagename, parmyear, parmmonth, parmoffset, parmoffset2, parmheight6, anniversary = \ parseargs(args, thispage, currentyear, currentmonth, 0, 0, 0, 0) # does url have calendar params and is THIS the right calendar to modify (we can have multiple # calendars on the same page)? #if has_calparms and (cparmpagename,cparmyear,cparmmonth,cparmoffset) == (parmpagename,parmyear,parmmonth,parmoffset): # move all calendars when using the navigation: if has_calparms and cparmpagename == parmpagename: year,month = yearmonthplusoffset(parmyear, parmmonth, parmoffset + cparmoffset2) parmoffset2 = cparmoffset2 else: year,month = yearmonthplusoffset(parmyear, parmmonth, parmoffset) # get the calendar monthcal = calendar.monthcalendar(year, month) # european / US differences months = ('January','February','March','April','May','June','July','August','September','October','November','December') # Set things up for Monday or Sunday as the first day of the week if calendar.firstweekday() == calendar.MONDAY: wkend = (5, 6) wkdays = ('Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun') if calendar.firstweekday() == calendar.SUNDAY: wkend = (0, 6) wkdays = ('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat') colorstep = 85 p = Page(request, thispage) qpagenames = '*'.join(map(wikiutil.quoteWikinameURL, parmpagename)) querystr = "calparms=%%s,%d,%d,%d,%%d" % (parmyear, parmmonth, parmoffset) prevlink = p.url(request, querystr % (qpagenames, parmoffset2 - 1), 0) nextlink = p.url(request, querystr % (qpagenames, parmoffset2 + 1), 0) prevylink = p.url(request, querystr % (qpagenames, parmoffset2 - 12), 0) nextylink = p.url(request, querystr % (qpagenames, parmoffset2 + 12), 0) prevmonth = formatter.url(1, prevlink, 'cal-link') + '&lt;' + formatter.url(0) nextmonth = formatter.url(1, nextlink, 'cal-link') + '&gt;' + formatter.url(0) prevyear = formatter.url(1, prevylink, 'cal-link') + '&lt;&lt;' + formatter.url(0) nextyear = formatter.url(1, nextylink, 'cal-link') + '&gt;&gt;' + formatter.url(0) if parmpagename != [thispage]: pagelinks = '' r, g, b = (255, 0, 0) l = len(parmpagename[0]) steps = len(parmpagename) maxsteps = (255 / colorstep) if steps > maxsteps: steps = maxsteps chstep = int(l / steps) st = 0 while st < l: ch = parmpagename[0][st:st+chstep] r, g, b = cliprgb(r, g, b) pagelinks = pagelinks + '<a style="%s" href="%s">%s</a>' % \ ('background-color:#%02x%02x%02x;color:#000000;text-decoration:none' % \ (r,g,b), Page(request, parmpagename[0]).url(request), ch) r, g, b = (r, g+colorstep, b) st = st + chstep r, g, b = (255-colorstep, 255, 255-colorstep) for page in parmpagename[1:]: pagelinks = pagelinks + '*<a style="%s" href="%s">%s</a>' % \ ('background-color:#%02x%02x%02x;color:#000000;text-decoration:none' % \ (r,g,b), Page(request, page).url(request), page) showpagename = ' %s<BR>\n' % pagelinks else: showpagename = '' if calendar.firstweekday() == calendar.SUNDAY: resth1 = ' <th colspan="7" class="cal-header">\n' \ '%s' \ ' %s&nbsp;%s&nbsp;<b>&nbsp;%s&nbsp;%s</b>&nbsp;%s\n&nbsp;%s\n' \ ' </th>\n' % (showpagename, prevyear, prevmonth, months[month-1], str(year), nextmonth, nextyear) if calendar.firstweekday() == calendar.MONDAY: resth1 = ' <th colspan="7" class="cal-header">\n' \ '%s' \ ' %s&nbsp;%s&nbsp;<b>&nbsp;%s&nbsp;/&nbsp;%s</b>&nbsp;%s\n&nbsp;%s\n' \ ' </th>\n' % (showpagename, prevyear, prevmonth, str(year), month, nextmonth, nextyear) restr1 = ' <tr>\n%s </tr>\n' % resth1 r7 = range(7) restd2 = [] for wkday in r7: wday = _(wkdays[wkday]) if wkday in wkend: cssday = "cal-weekend" else: cssday = "cal-workday" restd2.append(' <td class="%s" width="14%%">%s</td>\n' % (cssday, wday)) restr2 = ' <tr>\n%s </tr>\n' % "".join(restd2) if parmheight6: while len(monthcal) < 6: monthcal = monthcal + [[0,0,0,0,0,0,0]] maketip_js = [] restrn = [] for week in monthcal: restdn = [] for wkday in r7: day = week[wkday] if not day: restdn.append(' <td class="cal-invalidday">&nbsp;</td>\n') else: page = parmpagename[0] if anniversary: link = "%s/%02d-%02d" % (page, month, day) else: link = "%s/%4d-%02d-%02d" % (page, year, month, day) daypage = Page(request, link) if daypage.exists(): csslink = "cal-usedday" r, g, b, u = (255, 0, 0, 1) daycontent = daypage.get_raw_body() header1_re = re.compile(r'^\s*=\s(.*)\s=$', re.MULTILINE) # re.UNICODE titletext = [] for match in header1_re.finditer(daycontent): if match: title = match.group(1) title = wikiutil.escape(title).replace("'","\\'") titletext.append(title) tipname = link tiptitle = link tiptext = '<br>'.join(titletext) maketip_js.append("maketip('%s','%s','%s');" % (tipname, tiptitle, tiptext)) onmouse = '''onMouseOver="tip('%s')" onMouseOut="untip()"''' % tipname else: csslink = "cal-emptyday" r, g, b, u = (255, 255, 255, 0) if wkday in wkend: csslink = "cal-weekend" onmouse = '' for otherpage in parmpagename[1:]: otherlink = "%s/%4d-%02d-%02d" % (otherpage, year, month, day) otherdaypage = Page(request, otherlink) if otherdaypage.exists(): csslink = "cal-usedday" if u == 0: r, g, b = (r-colorstep, g, b-colorstep) else: r, g, b = (r, g+colorstep, b) r, g, b = cliprgb(r, g, b) style = 'background-color:#%02x%02x%02x' % (r, g, b) fmtlink = formatter.url(1, daypage.url(request), csslink, attrs=onmouse) + str(day) + formatter.url(0) if day == currentday and month == currentmonth and year == currentyear: cssday = "cal-today" fmtlink = "<b>%s</b>" % fmtlink # for browser with CSS probs else: cssday = "cal-nottoday" restdn.append(' <td style="%s" class="%s">%s</td>\n' % (style, cssday, fmtlink)) restrn.append(' <tr>\n%s </tr>\n' % "".join(restdn)) restable = '<table border="2" cellspacing="2" cellpadding="2">\n%s%s%s</table>\n' restable = restable % (restr1, restr2, "".join(restrn)) result = """\
8df0648e183013444c9153b284dd9390e635d11b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/8df0648e183013444c9153b284dd9390e635d11b/MonthCalendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 12, 26448, 16, 977, 4672, 590, 273, 11522, 18, 2293, 4453, 273, 11522, 18, 12354, 389, 273, 590, 18, 588, 1528, 225, 468, 327, 7636, 309, 8742, 4716, 364, 326, 783, 1363, 309, 59...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26448, 16, 977, 4672, 590, 273, 11522, 18, 2293, 4453, 273, 11522, 18, 12354, 389, 273, 590, 18, 588, 1528, 225, 468, 327, 7636, 309, 8742, 4716, 364, 326, 783, 1363, 309, 59...
compressed = zlib.compress(raw)
compressed = zlib.compress(raw)
def loadImageFromPIL(self, PILImage): "Extracts the stream, width and height" zlib = import_zlib() if not zlib: return #standardize it to RGB. We could be more optimal later. if PILImage.mode <> 'RGB': PILImage = PILImage.convert('RGB') imgwidth, imgheight = PILImage.size raw = PILImage.tostring() assert(len(raw) == imgwidth * imgheight, "Wrong amount of data for image") compressed = zlib.compress(raw) encoded = pdfutils._AsciiBase85Encode(compressed) self.colorSpace = 'DeviceRGB' self.bitsPerComponent = 8 self.streamContent = encoded self.width = imgwidth self.height = imgheight
165f597d1c3177ed3af75f4afc9562e6bb26b4c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/165f597d1c3177ed3af75f4afc9562e6bb26b4c1/pdfdoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2040, 1265, 1102, 48, 12, 2890, 16, 29407, 2040, 4672, 315, 12809, 326, 1407, 16, 1835, 471, 2072, 6, 24220, 273, 1930, 67, 94, 2941, 1435, 309, 486, 24220, 30, 327, 468, 10005, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1262, 2040, 1265, 1102, 48, 12, 2890, 16, 29407, 2040, 4672, 315, 12809, 326, 1407, 16, 1835, 471, 2072, 6, 24220, 273, 1930, 67, 94, 2941, 1435, 309, 486, 24220, 30, 327, 468, 10005, ...
'datas': base64.encodestring(data),
'datas': base64.encodestring(data or ''),
def put(self, cursor, user, uri, data, content_type, context=None, cache=None): from DAV.errors import DAV_Forbidden from DAV.utils import get_uriparentpath, get_urifilename object_name, object_id = self._uri2object(cursor, user, get_uriparentpath(uri), context=context, cache=cache) if not object_name \ or object_name in ('ir.attachment') \ or not object_id: raise DAV_Forbidden attachment_obj = self.pool.get('ir.attachment') object_name2, object_id2 = self._uri2object(cursor, user, uri, context=context, cache=cache) if not object_id2: name = get_urifilename(uri) try: attachment_obj.create(cursor, user, { 'name': name, 'datas': base64.encodestring(data), 'name': name, 'res_model': object_name, 'res_id': object_id, }, context=context) except: raise DAV_Forbidden else: try: attachment_obj.write(cursor, user, object_id2, { 'datas': base64.encodestring(data), }, context=context) except: raise DAV_Forbidden return
5060aa16de85036bc324a25211b14af2b9d12ae8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/5060aa16de85036bc324a25211b14af2b9d12ae8/webdav.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 12, 2890, 16, 3347, 16, 729, 16, 2003, 16, 501, 16, 913, 67, 723, 16, 819, 33, 7036, 16, 1247, 33, 7036, 4672, 628, 463, 5856, 18, 4324, 1930, 463, 5856, 67, 16553, 628, 463, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1378, 12, 2890, 16, 3347, 16, 729, 16, 2003, 16, 501, 16, 913, 67, 723, 16, 819, 33, 7036, 16, 1247, 33, 7036, 4672, 628, 463, 5856, 18, 4324, 1930, 463, 5856, 67, 16553, 628, 463, ...
expected_response = "User settings stored correctly"
expected_response = "User settings saved correctly"
def test_select_records_per_group(self): """webuser - test of user preferences setting"""
a67b1e2b8f8778f706606e0d502b758f49163a35 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/a67b1e2b8f8778f706606e0d502b758f49163a35/webuser_regression_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4025, 67, 7094, 67, 457, 67, 1655, 12, 2890, 4672, 3536, 4875, 1355, 300, 1842, 434, 729, 12750, 3637, 8395, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4025, 67, 7094, 67, 457, 67, 1655, 12, 2890, 4672, 3536, 4875, 1355, 300, 1842, 434, 729, 12750, 3637, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
hbox.add(gtk.Label(_('Angle') + ':'))
hbox.add(gtk.Label(_('Angle:')))
def __makeAngleProperty(self): self.angle_spin = gtk.SpinButton(gtk.Adjustment(0.0, -360.0, 360.0, 0.1, 100.0, 0.0), 1.0, 1) self.detect_angle_button = gtk.Button(_('Detect')) hbox = gtk.HBox() hbox.add(gtk.Label(_('Angle') + ':')) hbox.add(self.angle_spin) vbox = gtk.VBox() vbox.pack_start(hbox, False) vbox.pack_start(self.detect_angle_button, False) return vbox
1baf639b7c0b78357342a021c71b70a4eb7e2399 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3764/1baf639b7c0b78357342a021c71b70a4eb7e2399/widgetPresenter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 6540, 8467, 1396, 12, 2890, 4672, 365, 18, 4341, 67, 22876, 273, 22718, 18, 3389, 267, 3616, 12, 4521, 79, 18, 19985, 12, 20, 18, 20, 16, 300, 29751, 18, 20, 16, 12360, 18, 20,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6540, 8467, 1396, 12, 2890, 4672, 365, 18, 4341, 67, 22876, 273, 22718, 18, 3389, 267, 3616, 12, 4521, 79, 18, 19985, 12, 20, 18, 20, 16, 300, 29751, 18, 20, 16, 12360, 18, 20,...
print " looking at", k, "=", v, "on", sheet
def setMemberProperties(self, mapping, force_local = 0): # Sets the properties given in the MemberDataTool. tool = self.getTool() print "setMemberProperties" # we could pay attention to force_local here... if IPluggableAuthService.isImplementedBy(self.acl_users): user = self.getUser() sheets = getattr(user, 'getOrderedPropertySheets', lambda: None)() print " PAS present. user is:", user.__class__ # we won't always have PlonePAS users, due to acquisition, nor are guaranteed property sheets if sheets: print " sheets present" # -- # xxx track values set to defer to default impl # property routing for k,v in mapping.items(): for sheet in sheets: print " looking at", k, "=", v, "on", sheet #import pdb; pdb.set_trace() if sheet.hasProperty(k): print ' hasProperty', k, 'sheet', sheet if IMutablePropertySheet.isImplementedBy(sheet): sheet.setProperty( k, v ) print " Set", k, v, sheet else: raise RuntimeError("mutable property provider shadowed by read only provider") self.notifyModified() return print " PAS fails, using MemberData" # defer to base impl in absence of PAS, a PAS user, or property sheets return BaseMemberData.setMemberProperties(self, mapping, force_local)
90f3ba5c455c21bca62a60a26a661ef024c55991 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12230/90f3ba5c455c21bca62a60a26a661ef024c55991/memberdata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 4419, 2297, 12, 2890, 16, 2874, 16, 2944, 67, 3729, 273, 374, 4672, 468, 11511, 326, 1790, 864, 316, 326, 8596, 751, 6364, 18, 5226, 273, 365, 18, 588, 6364, 1435, 1172, 315, 542,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4419, 2297, 12, 2890, 16, 2874, 16, 2944, 67, 3729, 273, 374, 4672, 468, 11511, 326, 1790, 864, 316, 326, 8596, 751, 6364, 18, 5226, 273, 365, 18, 588, 6364, 1435, 1172, 315, 542,...
env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} -o ${TARGET}'
env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} --outfile=${TARGET}'
def generate2(env): bld = env['BUILDERS']['PDF'] #bld.add_action('.ps', EpsPdfAction) # this is covered by direct Ghostcript action in gs.py bld.add_action('.eps', EpsPdfAction) env['EPSTOPDF'] = 'epstopdf' env['EPSTOPDFFLAGS'] = SCons.Util.CLVar('') env['EPSTOPDFCOM'] = '$EPSTOPDF $EPSTOPDFFLAGS ${SOURCE} -o ${TARGET}'
e3819dfa0ab9564aad3869ba7b043d9247f9ef7b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12817/e3819dfa0ab9564aad3869ba7b043d9247f9ef7b/pdf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 22, 12, 3074, 4672, 324, 1236, 273, 1550, 3292, 3000, 2627, 4179, 55, 21712, 17508, 3546, 468, 70, 1236, 18, 1289, 67, 1128, 2668, 18, 1121, 2187, 225, 512, 1121, 18562, 1803, 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, 2103, 22, 12, 3074, 4672, 324, 1236, 273, 1550, 3292, 3000, 2627, 4179, 55, 21712, 17508, 3546, 468, 70, 1236, 18, 1289, 67, 1128, 2668, 18, 1121, 2187, 225, 512, 1121, 18562, 1803, 13, ...
print 'registered font %s' % fontName dumpFontData()
def _SWRecover(text, fontName, fontSize, encoding): '''This is called when _rl_accel's database doesn't know about a font. Currently encoding is always a dummy. ''' try: print 'Attempting to register', fontName font = getFont(fontName) registerFont(font) print 'registered font %s' % fontName dumpFontData() return _stringWidth(text,fontName,fontSize,encoding) except: warnOnce('Font %s:%s not found - using Courier:%s for widths'%(fontName,encoding,encoding)) return _stringWidth(text,'courier',fontSize,encoding)
b5a502c8728d74ed1787bcd8581771c30a2e646d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/b5a502c8728d74ed1787bcd8581771c30a2e646d/pdfmetrics.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 18746, 27622, 12, 955, 16, 3512, 461, 16, 16746, 16, 2688, 4672, 9163, 2503, 353, 2566, 1347, 389, 1321, 67, 30737, 1807, 2063, 3302, 1404, 5055, 2973, 279, 3512, 18, 15212, 2688, 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, 389, 18746, 27622, 12, 955, 16, 3512, 461, 16, 16746, 16, 2688, 4672, 9163, 2503, 353, 2566, 1347, 389, 1321, 67, 30737, 1807, 2063, 3302, 1404, 5055, 2973, 279, 3512, 18, 15212, 2688, 3...
self.assertEqual(list(a), range(2, n))
self.assertEqual(list(a), range(100, n))
def irange(n): for i in xrange(n): yield i
9d7f0ec6c4ab535fc3d876ab7bbdc46393ad5147 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9d7f0ec6c4ab535fc3d876ab7bbdc46393ad5147/test_itertools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 277, 3676, 12, 82, 4672, 364, 277, 316, 12314, 12, 82, 4672, 2824, 277, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
"Go to parent directory"
"""Change into the parent directory."""
def ftp_CDUP(self, line): "Go to parent directory" # Note: RFC 959 says that code 200 is required but it also says that # CDUP uses the same codes as CWD. # FIX #14 self.ftp_CWD('..')
367a95e4363ae8b7515230480fff6ef354b95226 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/367a95e4363ae8b7515230480fff6ef354b95226/FTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 10160, 3079, 12, 2890, 16, 980, 4672, 3536, 3043, 1368, 326, 982, 1867, 12123, 468, 3609, 30, 8372, 2468, 6162, 20185, 716, 981, 4044, 353, 1931, 1496, 518, 2546, 20185, 716, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 13487, 67, 10160, 3079, 12, 2890, 16, 980, 4672, 3536, 3043, 1368, 326, 982, 1867, 12123, 468, 3609, 30, 8372, 2468, 6162, 20185, 716, 981, 4044, 353, 1931, 1496, 518, 2546, 20185, 716, ...
print "Got a queries exceeded error. Sleeping for %d hours..." % (config.copyright_exceeded_in_queries_sleep_hours)
error("Got a queries exceeded error. Sleeping for %d hours..." % (config.copyright_exceeded_in_queries_sleep_hours))
def exceeded_in_queries(engine): """Behavior if an exceeded error occur.""" # Disable search engine if config.copyright_exceeded_in_queries == 1: exec('config.copyright_' + engine + ' = False') # Sleeping if config.copyright_exceeded_in_queries == 2: print "Got a queries exceeded error. Sleeping for %d hours..." % (config.copyright_exceeded_in_queries_sleep_hours) time.sleep(config.copyright_exceeded_in_queries_sleep_hours * 60 * 60) # Stop execution if config.copyright_exceeded_in_queries == 3: raise 'Got a queries exceeded error.'
df982418feb2fee96037cb0fe13fcf2215c639bd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/df982418feb2fee96037cb0fe13fcf2215c639bd/copyright.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12428, 67, 267, 67, 13748, 12, 8944, 4672, 3536, 9212, 309, 392, 12428, 555, 3334, 12123, 225, 468, 10639, 1623, 4073, 309, 642, 18, 29187, 67, 338, 5816, 67, 267, 67, 13748, 422, 404, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12428, 67, 267, 67, 13748, 12, 8944, 4672, 3536, 9212, 309, 392, 12428, 555, 3334, 12123, 225, 468, 10639, 1623, 4073, 309, 642, 18, 29187, 67, 338, 5816, 67, 267, 67, 13748, 422, 404, ...
self.total_rtt = None self.rtts = [] self.timeout_counter = 0
self.total_rtt = None self.rtts = [] self.timeout_counter = 0 self.slowness_counter = 0 self.closed = False
def __init__(self): PathSupport.Circuit.__init__(self) self.total_rtt = None # double (sec) self.rtts = [] # list of partial rtts: 0-1-2 self.timeout_counter = 0 # close on reaching a limit
5c07e1b6d34f16556018f8177a0bd4db44e9e733 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3762/5c07e1b6d34f16556018f8177a0bd4db44e9e733/op-addon.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 2666, 6289, 18, 21719, 16186, 2738, 972, 12, 2890, 13, 365, 18, 4963, 67, 86, 748, 273, 599, 1377, 468, 1645, 261, 3321, 13, 365, 18, 86, 748, 87, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 2666, 6289, 18, 21719, 16186, 2738, 972, 12, 2890, 13, 365, 18, 4963, 67, 86, 748, 273, 599, 1377, 468, 1645, 261, 3321, 13, 365, 18, 86, 748, 87, 27...
self.dirtyRows[obj] = 1
self.dirtyRows.add(obj)
def insertRow(self, obj): """Mark on object for inserting when sync()ing.""" if self.deletedRows.has_key(obj): del self.deletedRows[obj] self.dirtyRows[obj] = 1 else: self.insertedRows[obj] = 1
99ef8dc45ac95cf0f7340c6550585958fa21eeac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/99ef8dc45ac95cf0f7340c6550585958fa21eeac/rowjournal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2243, 1999, 12, 2890, 16, 1081, 4672, 3536, 3882, 603, 733, 364, 21079, 1347, 3792, 1435, 310, 12123, 309, 365, 18, 8600, 4300, 18, 5332, 67, 856, 12, 2603, 4672, 1464, 365, 18, 8600, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2243, 1999, 12, 2890, 16, 1081, 4672, 3536, 3882, 603, 733, 364, 21079, 1347, 3792, 1435, 310, 12123, 309, 365, 18, 8600, 4300, 18, 5332, 67, 856, 12, 2603, 4672, 1464, 365, 18, 8600, ...
for x in os.listdir(directory_category): path = directory_category + "/" + x
for pluginname in os.listdir(directory_category): path = directory_category + "/" + pluginname
def readPluginList(self, directory): """enumerates plugins""" categories = os.listdir(directory) new_plugins = [ ] for c in categories: directory_category = directory + c if not os.path.isdir(directory_category): continue open(directory_category + "/__init__.py", "a").close() for x in os.listdir(directory_category): path = directory_category + "/" + x if os.path.isdir(path): if fileExists(path + "/plugin.pyc") or fileExists(path + "/plugin.py"): try: plugin = my_import('.'.join(["Plugins", c, x, "plugin"]))
408a1d7daf4b4ba42a1baabf9bf7886f9c235282 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/408a1d7daf4b4ba42a1baabf9bf7886f9c235282/PluginComponent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 3773, 682, 12, 2890, 16, 1867, 4672, 3536, 7924, 264, 815, 4799, 8395, 225, 6477, 273, 1140, 18, 1098, 1214, 12, 5149, 13, 225, 394, 67, 8057, 273, 306, 308, 225, 364, 276, 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, 855, 3773, 682, 12, 2890, 16, 1867, 4672, 3536, 7924, 264, 815, 4799, 8395, 225, 6477, 273, 1140, 18, 1098, 1214, 12, 5149, 13, 225, 394, 67, 8057, 273, 306, 308, 225, 364, 276, 316, ...
for aRow in [[['7', self.numberButton], ['4', self.numberButton], ['1', self.numberButton], ['C', self.clear]], [['8', self.numberButton], ['5', self.numberButton], ['2', self.numberButton], ['0', self.numberButton]], [['9', self.numberButton], ['6', self.numberButton], ['3', self.numberButton], ['.', self.numberButton]], [['+', self.operate], ['-', self.operate], ['*', self.operate], ['/', self.operate]]]:
for aRow in ((('7', self.numberButton), ('4', self.numberButton), ('1', self.numberButton), ('C', self.clear)), (('8', self.numberButton), ('5', self.numberButton), ('2', self.numberButton), ('0', self.numberButton)), (('9', self.numberButton), ('6', self.numberButton), ('3', self.numberButton), ('.', self.numberButton)), (('+', self.operate), ('-', self.operate), ('*', self.operate), ('/', self.operate))):
def __init__(self, **kw): super(CalculatorController, self).__init__(**kw) self.win.title = 'Calculator' vbox = cimarron.skin.VBox(parent=self.win) self.display = cimarron.skin.Label(parent=vbox, text='0') hbox = cimarron.skin.HBox(parent=vbox) for aRow in [[['7', self.numberButton], ['4', self.numberButton], ['1', self.numberButton], ['C', self.clear]], [['8', self.numberButton], ['5', self.numberButton], ['2', self.numberButton], ['0', self.numberButton]], [['9', self.numberButton], ['6', self.numberButton], ['3', self.numberButton], ['.', self.numberButton]], [['+', self.operate], ['-', self.operate], ['*', self.operate], ['/', self.operate]]]: vbox = cimarron.skin.VBox(parent=hbox) for aLabel, anAction in aRow: cimarron.skin.Button(parent=vbox, label=aLabel, onAction=anAction) self.clear()
bfdbd0cfbc563ae1233f45c62dbb1dee16054b81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2219/bfdbd0cfbc563ae1233f45c62dbb1dee16054b81/calculator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 9987, 4672, 2240, 12, 19278, 2933, 16, 365, 2934, 972, 2738, 972, 12, 636, 9987, 13, 365, 18, 8082, 18, 2649, 273, 296, 19278, 11, 331, 2147, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 9987, 4672, 2240, 12, 19278, 2933, 16, 365, 2934, 972, 2738, 972, 12, 636, 9987, 13, 365, 18, 8082, 18, 2649, 273, 296, 19278, 11, 331, 2147, 273, ...
autodir = host.get_autodir()
def _wait_on_client(self, host, command): """ Wait for the client to signal that it's finished by writing a byte into AUTODIR/profilers.command. Only waits for 30 seconds before giving up. """ autodir = host.get_autodir() path = os.path.join(autodir, "profiler.%s" % command) try: host.run("cat %s" % path, ignore_status=True, timeout=30) except error.AutoservSSHTimeout: pass # even if it times out, just give up and go ahead anyway
d16ba8fddbf6985a577ca31bfe9030c19678bb78 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/d16ba8fddbf6985a577ca31bfe9030c19678bb78/profiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7048, 67, 265, 67, 2625, 12, 2890, 16, 1479, 16, 1296, 4672, 3536, 5838, 364, 326, 1004, 358, 4277, 716, 518, 1807, 6708, 635, 7410, 279, 1160, 1368, 432, 1693, 1212, 7937, 19, 68...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7048, 67, 265, 67, 2625, 12, 2890, 16, 1479, 16, 1296, 4672, 3536, 5838, 364, 326, 1004, 358, 4277, 716, 518, 1807, 6708, 635, 7410, 279, 1160, 1368, 432, 1693, 1212, 7937, 19, 68...
attribute = []
attributes = [] voName = ''
def getVOMSAttributes(proxy,switch="all"): """ Return VOMS proxy attributes as list elements if switch="all" (default) OR return the string prepared to be stored in DB if switch="db" OR return the string of elements to be used as the option string in voms-proxy-init if switch="option". If a given proxy is a grid proxy, then function will return an empty list. """
0c6b8655865822a41748b548f4a80018d03206c7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/0c6b8655865822a41748b548f4a80018d03206c7/GridCredentials.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11031, 1872, 55, 2498, 12, 5656, 16, 9610, 1546, 454, 6, 4672, 3536, 2000, 776, 1872, 55, 2889, 1677, 487, 666, 2186, 309, 1620, 1546, 454, 6, 261, 1886, 13, 4869, 327, 326, 533, 8208,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11031, 1872, 55, 2498, 12, 5656, 16, 9610, 1546, 454, 6, 4672, 3536, 2000, 776, 1872, 55, 2889, 1677, 487, 666, 2186, 309, 1620, 1546, 454, 6, 261, 1886, 13, 4869, 327, 326, 533, 8208,...
"""class to hold iwparam data """
""" Class to hold iwparam data. """
def getMAC(self, packed_data): """ extracts mac addr from packed data and returns it as str """ mac_addr = struct.unpack('xxBBBBBB', packed_data[:8]) return "%02X:%02X:%02X:%02X:%02X:%02X" % mac_addr
05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/05b40a3d0b9e46299ea3a7ddfd32be4a1e2ba258/iwlibs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2108, 2226, 12, 2890, 16, 12456, 67, 892, 4672, 3536, 16469, 5318, 3091, 628, 12456, 501, 471, 1135, 518, 487, 609, 3536, 5318, 67, 4793, 273, 1958, 18, 17309, 2668, 5279, 9676, 9676, 96...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2108, 2226, 12, 2890, 16, 12456, 67, 892, 4672, 3536, 16469, 5318, 3091, 628, 12456, 501, 471, 1135, 518, 487, 609, 3536, 5318, 67, 4793, 273, 1958, 18, 17309, 2668, 5279, 9676, 9676, 96...
if not self.use_latex_toc and self.topic_class == 'contents': self.body.append( '\\end{list}\n' )
if self.topic_class == 'contents': if not self.use_latex_toc: self.body.append( '\\end{list}\n' )
def depart_bullet_list(self, node): if not self.use_latex_toc and self.topic_class == 'contents': self.body.append( '\\end{list}\n' ) else: self.body.append( '\\end{itemize}\n' )
3449eb547b826ebeae4cc2d414ffd515229b5a2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/3449eb547b826ebeae4cc2d414ffd515229b5a2e/latex2e.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 70, 19994, 67, 1098, 12, 2890, 16, 756, 4672, 309, 365, 18, 10476, 67, 1106, 422, 296, 3980, 4278, 309, 486, 365, 18, 1202, 67, 26264, 67, 1391, 30, 365, 18, 3432, 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, 26000, 67, 70, 19994, 67, 1098, 12, 2890, 16, 756, 4672, 309, 365, 18, 10476, 67, 1106, 422, 296, 3980, 4278, 309, 486, 365, 18, 1202, 67, 26264, 67, 1391, 30, 365, 18, 3432, 18, 692...
else: return False except:
if capability == "addeditors": if capab(user.name, "admin"): return True if capability == "admin": if capab(user.name, "owner"): return True if capability in capabilities: return True else:
def capab(prefix, capability): if prefix.find('!') > 0: user = prefix[:prefix.find('!')] else: user = prefix try: if 'editfactoids' in list(ircdb.users.getUser(prefix).capabilities): return True else: return False except: return False
4de83949cb6c8304bfd45f98fb98f9b817d7f680 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3105/4de83949cb6c8304bfd45f98fb98f9b817d7f680/plugin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3523, 378, 12, 3239, 16, 12593, 4672, 309, 1633, 18, 4720, 2668, 5124, 13, 405, 374, 30, 729, 273, 1633, 10531, 3239, 18, 4720, 2668, 5124, 25887, 469, 30, 729, 273, 1633, 775, 30, 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, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3523, 378, 12, 3239, 16, 12593, 4672, 309, 1633, 18, 4720, 2668, 5124, 13, 405, 374, 30, 729, 273, 1633, 10531, 3239, 18, 4720, 2668, 5124, 25887, 469, 30, 729, 273, 1633, 775, 30, 309...
method = getattr(content_instance, self.vocabulary, None)
method = getattr(content_instance, value, None)
def Vocabulary(self, content_instance=None): value = self.vocabulary if not isinstance(value, DisplayList): if content_instance is not None and type(value) is StringType: method = getattr(content_instance, self.vocabulary, None) if method and callable(method): value = method()
e6befb5fc921bbc4f8030831729614059e2fc643 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/e6befb5fc921bbc4f8030831729614059e2fc643/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 776, 23348, 12, 2890, 16, 913, 67, 1336, 33, 7036, 4672, 460, 273, 365, 18, 15913, 13631, 309, 486, 1549, 12, 1132, 16, 9311, 682, 4672, 309, 913, 67, 1336, 353, 486, 599, 471, 618, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 776, 23348, 12, 2890, 16, 913, 67, 1336, 33, 7036, 4672, 460, 273, 365, 18, 15913, 13631, 309, 486, 1549, 12, 1132, 16, 9311, 682, 4672, 309, 913, 67, 1336, 353, 486, 599, 471, 618, ...
if not os.path.isfile (init_py):
if os.path.isfile (init_py): return init_py else:
def check_package (self, package, package_dir):
5402f4d122edbc3d52589a84b5f6610895a5ed71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/5402f4d122edbc3d52589a84b5f6610895a5ed71/build_py.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 5610, 261, 2890, 16, 2181, 16, 2181, 67, 1214, 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...
[ 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, 866, 67, 5610, 261, 2890, 16, 2181, 16, 2181, 67, 1214, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
elif (text[i-1][-1] in (" ", "\n",) or text[i+1][0] in (" ", "\n",)):
elif (text[i-1][-1] in (" ", "\n",) or text[i+1][0] in (" ", "\n",)):
def check_whitespace(self): i = 0 text = self.text while i < len(text): if text[i] is self.white_space: if i == 0 or i == len(text)-1: text[0:0] = [" "] # del? XXX this is either a bug or a missing comment - what does that mean? why 0:0? i += 1 elif (text[i-1][-1] in (" ", "\n",) or # last char of previous element is whitespace text[i+1][0] in (" ", "\n",)): # or first char of next element is whitespace del text[i] elif (text[i+1] is self.white_space or # next element is white_space text[i+1] is self.new_line): # or new_line del text[i] else: text[i] = " " i += 1 elif text[i] is self.new_line: if i == 0: del text[i] elif i == len(text) - 1: text[i] = "\n" i += 1 elif text[i-1][-1] == "\n" or ( isinstance(text[i+1], str) and text[i+1][0] == "\n"): # XXX why do we need isinstance here, but not above? del text[i] else: text[i] = "\n" i += 1 else: i += 1
024e6ae8b32c9f5202b3bf6a465b921a38f26ea1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/024e6ae8b32c9f5202b3bf6a465b921a38f26ea1/text_html_text_x_moin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 18777, 12, 2890, 4672, 277, 273, 374, 977, 273, 365, 18, 955, 1323, 277, 411, 562, 12, 955, 4672, 309, 977, 63, 77, 65, 353, 365, 18, 14739, 67, 2981, 30, 309, 277, 422, 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, 866, 67, 18777, 12, 2890, 4672, 277, 273, 374, 977, 273, 365, 18, 955, 1323, 277, 411, 562, 12, 955, 4672, 309, 977, 63, 77, 65, 353, 365, 18, 14739, 67, 2981, 30, 309, 277, 422, 3...
def imagecapture(self, winName = None, width = None, height = None, x = 0, y = 0): if winName:
def imagecapture(self, window_name = None, x = 0, y = 0, width = None, height = None): if window_name:
def imagecapture(self, winName = None, width = None, height = None, x = 0, y = 0): if winName: acc = None for gui in self._list_guis(): if self._match_name_to_acc(winName, gui): if 'Component' in pyatspi.listInterfaces(gui): acc = gui break if not acc: raise LdtpServerException('No window matches %s' % winName) icomponent = acc.queryComponent() bb = icomponent.getExtents(pyatspi.DESKTOP_COORDS) x, y, resolution2, resolution1 = bb.x, bb.y, bb.height, bb.width
81c8c8cd474c93e12d233ad2acdc3fffaf348fd9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11266/81c8c8cd474c93e12d233ad2acdc3fffaf348fd9/generic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 19250, 12, 2890, 16, 2742, 67, 529, 273, 599, 16, 619, 273, 374, 16, 677, 273, 374, 16, 1835, 273, 599, 16, 2072, 273, 599, 4672, 309, 2742, 67, 529, 30, 4078, 273, 599, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1316, 19250, 12, 2890, 16, 2742, 67, 529, 273, 599, 16, 619, 273, 374, 16, 677, 273, 374, 16, 1835, 273, 599, 16, 2072, 273, 599, 4672, 309, 2742, 67, 529, 30, 4078, 273, 599, 364, ...
value = self.cl.get(self.nodeid, property)
if isinstance(propclass, hyperdb.Link: value = [self.cl.get(self.nodeid, property)] else: value = self.cl.get(self.nodeid, property)
def __call__(self, property, **args): propclass = self.properties[property] if self.nodeid: value = self.cl.get(self.nodeid, property) elif self.filterspec is not None: value = self.filterspec.get(property, []) else: value = [] if (isinstance(propclass, hyperdb.Link) or isinstance(propclass, hyperdb.Multilink)): linkcl = self.db.classes[propclass.classname] l = [] k = linkcl.labelprop() for optionid in linkcl.list(): option = linkcl.get(optionid, k) if optionid in value or option in value: checked = 'checked' else: checked = '' l.append('%s:<input type="checkbox" %s name="%s" value="%s">'%( option, checked, property, option)) return '\n'.join(l) return '[Checklist: not a link]'
b27451730e44737b39ff26a15c852d028fe9750c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/b27451730e44737b39ff26a15c852d028fe9750c/htmltemplate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1272, 16, 2826, 1968, 4672, 2270, 1106, 273, 365, 18, 4738, 63, 4468, 65, 309, 365, 18, 2159, 350, 30, 225, 309, 1549, 12, 5986, 1106, 16, 9512, 1966, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1991, 972, 12, 2890, 16, 1272, 16, 2826, 1968, 4672, 2270, 1106, 273, 365, 18, 4738, 63, 4468, 65, 309, 365, 18, 2159, 350, 30, 225, 309, 1549, 12, 5986, 1106, 16, 9512, 1966, ...
be used to decode a Python source file. It requires one argment, readline,
be used to decode a Python source file. It requires one argment, readline,
def detect_encoding(readline): """ The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argment, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. """ bom_found = False encoding = None default = 'utf-8' def read_or_stop(): try: return readline() except StopIteration: return b'' def find_cookie(line): try: line_string = line.decode('ascii') except UnicodeDecodeError: return None matches = cookie_re.findall(line_string) if not matches: return None encoding = _get_normal_name(matches[0]) try: codec = lookup(encoding) except LookupError: # This behaviour mimics the Python interpreter raise SyntaxError("unknown encoding: " + encoding) if bom_found: if codec.name != 'utf-8': # This behaviour mimics the Python interpreter raise SyntaxError('encoding problem: utf-8') encoding += '-sig' return encoding first = read_or_stop() if first.startswith(BOM_UTF8): bom_found = True first = first[3:] default = 'utf-8-sig' if not first: return default, [] encoding = find_cookie(first) if encoding: return encoding, [first] second = read_or_stop() if not second: return default, [first] encoding = find_cookie(second) if encoding: return encoding, [first, second] return default, [first, second]
1d5b9c6cf9ab130d15692ac8c977a63ef162c154 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/1d5b9c6cf9ab130d15692ac8c977a63ef162c154/tokenize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 5999, 12, 896, 1369, 4672, 3536, 1021, 5966, 67, 5999, 1435, 445, 353, 1399, 358, 5966, 326, 2688, 716, 1410, 506, 1399, 358, 2495, 279, 6600, 1084, 585, 18, 225, 2597, 4991, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5999, 12, 896, 1369, 4672, 3536, 1021, 5966, 67, 5999, 1435, 445, 353, 1399, 358, 5966, 326, 2688, 716, 1410, 506, 1399, 358, 2495, 279, 6600, 1084, 585, 18, 225, 2597, 4991, ...
trace_type="Node" trace_ids=[] def trace (message): if classname == trace_type and peer_object_id in trace_ids: message_verbose('TRACE>>'+message)
def message_focus (message): if classname != focus_type: return if peer_object_id in focus_ids or \ (object and primary_key in object and object[primary_key] in focus_ids): message_verbose("peer_obj : %d [[%r]]"%(peer_object_id,peer_object), header='FOCUS '+message) if object: message_verbose("local_obj : <<%r>>"%(object), header='FOCUS '+message); def equal_fields (object, peer_object, columns): if not compatibility: return object.__eq__(peer_object) else: for column in columns: if object[column] != peer_object[column]: return False return True
def sync(objects, peer_objects, classobj): """ Synchronizes two dictionaries of objects. objects should be a dictionary of local objects keyed on their foreign identifiers. peer_objects should be a dictionary of foreign objects keyed on their local (i.e., foreign to us) identifiers. Returns a final dictionary of local objects keyed on their foreign identifiers. """
be959d0158ffaff6d50158269f03ba7f2c1da56f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7598/be959d0158ffaff6d50158269f03ba7f2c1da56f/RefreshPeer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3792, 12, 6911, 16, 4261, 67, 6911, 16, 667, 2603, 4672, 3536, 26535, 3128, 2795, 16176, 434, 2184, 18, 2184, 1410, 506, 279, 3880, 434, 1191, 2184, 17408, 603, 3675, 5523, 9863, 18, 426...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3792, 12, 6911, 16, 4261, 67, 6911, 16, 667, 2603, 4672, 3536, 26535, 3128, 2795, 16176, 434, 2184, 18, 2184, 1410, 506, 279, 3880, 434, 1191, 2184, 17408, 603, 3675, 5523, 9863, 18, 426...
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host, port))
self.sock = socket.create_connection((host, port))
def open(self, host = '', port = IMAP4_PORT): """Setup connection to remote server on "host:port" (default: localhost:standard IMAP4 port). This connection will be used by the routines: read, readline, send, shutdown. """ self.host = host self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.connect((host, port)) self.file = self.sock.makefile('rb')
26ed2e3bc3bb9b5467fc256e77d87cf144b37c1b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/26ed2e3bc3bb9b5467fc256e77d87cf144b37c1b/imaplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 2890, 16, 1479, 273, 10226, 1756, 273, 6246, 2203, 24, 67, 6354, 4672, 3536, 7365, 1459, 358, 2632, 1438, 603, 315, 2564, 30, 655, 6, 261, 1886, 30, 17365, 30, 10005, 6246, 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, 1696, 12, 2890, 16, 1479, 273, 10226, 1756, 273, 6246, 2203, 24, 67, 6354, 4672, 3536, 7365, 1459, 358, 2632, 1438, 603, 315, 2564, 30, 655, 6, 261, 1886, 30, 17365, 30, 10005, 6246, 2...
self.frame.Show(True)
self.frame.Show() self.frame.Raise()
def OnInit(self): showsplash = False try: DV.prefs = DamnVidPrefs() DV.lang = DV.prefs.get('locale') DamnLoadCurrentLocale() if DV.prefs.get('splashscreen') == 'True': splash = DamnSplashScreen() clock = time.time() showsplash = True splash.Show() DV.prefs = None except: pass self.frame = DamnMainFrame(None, -1, DV.l('DamnVid')) if showsplash: try: while clock + .5 > time.time(): time.sleep(.02) # Makes splashscreen stay at least a fifth of a second on screen, in case the loading was faster than that. I think it's a reasonable compromise between eyecandy and responsiveness/snappiness splash.Hide() splash.Destroy() del clock, splash except: pass self.frame.init2() self.frame.Show(True) self.loadArgs(DV.argv) return True
b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2570, 12, 2890, 4672, 2405, 13106, 961, 273, 1083, 775, 30, 463, 58, 18, 1484, 2556, 273, 463, 301, 82, 58, 350, 1386, 2556, 1435, 463, 58, 18, 4936, 273, 463, 58, 18, 1484, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2570, 12, 2890, 4672, 2405, 13106, 961, 273, 1083, 775, 30, 463, 58, 18, 1484, 2556, 273, 463, 301, 82, 58, 350, 1386, 2556, 1435, 463, 58, 18, 4936, 273, 463, 58, 18, 1484, 25...
result = eval( self.checkstring, procenv )
evalenv = {} evalenv.update(procenv) result = eval( self.checkstring, evalenv )
def check(self,Config):
6dc32b1c3cc30e401b3a60443a793ffc21c712f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/6dc32b1c3cc30e401b3a60443a793ffc21c712f3/directive.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 809, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 866, 12, 2890, 16, 809, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
for m in [line for line in pick.move_lines]: res['return%s'%(m.id)] = m.product_qty if pick.invoice_state=='invoiced': res['invoice_state'] = '2binvoiced' else: res['invoice_state'] = 'none'
if pick: if 'invoice_state' in fields: if pick.invoice_state=='invoiced': res['invoice_state'] = '2binvoiced' else: res['invoice_state'] = 'none' for line in pick.move_lines: return_id = 'return%s'%(line.id) if return_id in fields: res[return_id] = line.product_qty
def default_get(self, cr, uid, fields, context): """ To get default values for the object. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param fields: List of fields for which we want default values @param context: A standard dictionary @return: A dictionary which of fields with values. """ res = super(stock_return_picking, self).default_get(cr, uid, fields, context=context) record_id = context and context.get('active_id', False) or False pick_obj = self.pool.get('stock.picking') pick = pick_obj.browse(cr, uid, record_id) for m in [line for line in pick.move_lines]: res['return%s'%(m.id)] = m.product_qty if pick.invoice_state=='invoiced': res['invoice_state'] = '2binvoiced' else: res['invoice_state'] = 'none' return res
3b5e198d6fca4e6934ff87ac875ee8b30300e487 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/3b5e198d6fca4e6934ff87ac875ee8b30300e487/stock_return_picking.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 805, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 1466, 16, 819, 4672, 3536, 2974, 336, 805, 924, 364, 326, 733, 18, 632, 891, 365, 30, 1021, 733, 4407, 18, 632, 891, 4422, 30, 432, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 805, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 1466, 16, 819, 4672, 3536, 2974, 336, 805, 924, 364, 326, 733, 18, 632, 891, 365, 30, 1021, 733, 4407, 18, 632, 891, 4422, 30, 432, ...
yield "".join(make_collapsible_html('cc_checker', title, content, id, status))
output += make_collapsible_html('cc_checker', title, content, id, status)
def print_log_cc_checker(input): # generate pretty-printed html for static analysis tools # for now, we only handle the IBM Checker's output style if not re.search("^BEAM_VERSION", input): yield "here" # yield input return content = "" inEntry = False title = None status = None for line in input.splitlines(): # for each line, check if the line is a new entry, # otherwise, store the line under the current entry. if line.startswith("-- "): # got a new entry if inEntry: yield "".join(make_collapsible_html('cc_checker', title, content, id, status)) else: yield content # clear maintenance vars (inEntry, content) = (True, "") # parse the line m = re.match("^-- ((ERROR|WARNING|MISTAKE).*?)\s+&gt;&gt;&gt;([a-zA-Z0-9]+_(\w+)_[a-zA-Z0-9]+)", line) # then store the result (title, status, id) = ("%s %s" % (m.group(1), m.group(4)), m.group(2), m.group(3)) elif line.startswith("CC_CHECKER STATUS"): if inEntry: yield "".join(make_collapsible_html('cc_checker', title, content, id, status)) inEntry = False content = "" # not a new entry, so part of the current entry's output content += "%s\n" % line yield content # This function does approximately the same as the following, following # commented-out regular expression except that the regex doesn't quite # handle IBM Checker's newlines quite right. # $output =~ s{ # --\ ((ERROR|WARNING|MISTAKE).*?)\s+ # &gt;&gt;&gt # (.*?) # \n{3,} # }{make_collapsible_html('cc_checker', "$1 $4", $5, $3, $2)}exgs
6f759d61aa9f4714f83d32476fcc23e0c846d5e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7314/6f759d61aa9f4714f83d32476fcc23e0c846d5e7/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 1330, 67, 952, 67, 19243, 12, 2630, 4672, 468, 2103, 7517, 17, 1188, 329, 1729, 364, 760, 6285, 8513, 468, 364, 2037, 16, 732, 1338, 1640, 326, 23450, 49, 31577, 1807, 876, 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, 1172, 67, 1330, 67, 952, 67, 19243, 12, 2630, 4672, 468, 2103, 7517, 17, 1188, 329, 1729, 364, 760, 6285, 8513, 468, 364, 2037, 16, 732, 1338, 1640, 326, 23450, 49, 31577, 1807, 876, 2...
return opts, dbg_opts, sys_argv
return opts, dbg_opts, sys.argv
def process_options(debugger_name, pkg_version, sys_argv, option_list=None): """Handle debugger options. Set `option_list' if you are writing another main program and want to extend the existing set of debugger options. The options dicionary from opt_parser is return. sys_argv is also updated.""" usage_str="""%prog [debugger-options] [python-script [script-options...]] Runs the extended python debugger""" serverChoices = ('TCP','FIFO', None) optparser = OptionParser(usage=usage_str, option_list=option_list, version="%%prog version %s" % pkg_version) optparser.add_option("-X", "--trace", dest="linetrace", action="store_true", default=False, help="Show lines before executing them. " + "This option also sets --batch") optparser.add_option("-F", "--fntrace", dest="fntrace", action="store_true", default=False, help="Show functions before executing them. " + "This option also sets --batch") optparser.add_option("--basename", dest="basename", action="store_true", default=False, help="Filenames strip off basename, (e.g. for regression tests)" )
3450b2b5c584b53ea66a60acb67e1a2ff6cd7abf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6117/3450b2b5c584b53ea66a60acb67e1a2ff6cd7abf/cli.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2116, 12, 4148, 693, 67, 529, 16, 3475, 67, 1589, 16, 2589, 67, 19485, 16, 1456, 67, 1098, 33, 7036, 4672, 3536, 3259, 19977, 702, 18, 1000, 1375, 3482, 67, 1098, 11, 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, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 67, 2116, 12, 4148, 693, 67, 529, 16, 3475, 67, 1589, 16, 2589, 67, 19485, 16, 1456, 67, 1098, 33, 7036, 4672, 3536, 3259, 19977, 702, 18, 1000, 1375, 3482, 67, 1098, 11, 309, ...
cmd = cmd + 'and convert(char(10), i.modification_date, 101) = convert(char(10), getdate(), 101)'
cmd = cmd + ' and convert(char(10), i.modification_date, 101) = convert(char(10), getdate(), 101)'
def process(objectKey): # # retrieve Assay (GXD) images that have thumbnails and are in pixel DB # cmd = 'select i._Image_key, i._MGIType_key, i._Refs_key, i._ThumbnailImage_key, ' + \ 'i.figureLabel, ip._ImagePane_key, ip.paneLabel, r.year, a.numericPart ' + \ 'into #images ' + \ 'from IMG_Image i, BIB_Refs r, IMG_ImagePane ip, ACC_Accession a ' + \ 'where i._MGIType_key = 8 ' + \ 'and i._ThumbnailImage_key is not null ' + \ 'and i.xdim is not null ' + \ 'and i._Refs_key = r._Refs_key ' + \ 'and i._Image_key = ip._Image_key ' + \ 'and r._Refs_key = a._Object_key ' + \ 'and a._MGIType_key = 1 ' + \ 'and a.prefixPart = "J:"' if objectKey > 0: cmd = cmd + 'and i._Refs_key = %s' % (objectKey) # images that don't have entries in the cache table elif objectKey == -1: cmd = cmd + 'and not exists (select 1 from %s c where c._Image_key = i._Image_key' % (table) # all images modified today elif objectKey == -2: cmd = cmd + 'and convert(char(10), i.modification_date, 101) = convert(char(10), getdate(), 101)' db.sql(cmd, None) db.sql('create index idx1 on #images(_Image_key)', None) db.sql('create index idx2 on #images(_ImagePane_key)', None) # # image/marker associations # # sort: insitu assays only (1), both insitu & gel assays (2), gel assays only (3) # db.sql('select distinct i.*, _ObjectMGIType_key = 2, _Object_key = a._Marker_key, ' + \ 'a._AssayType_key, t.assayType, sortOrder = 2 ' + \ 'into #imageassoc ' + \ 'from #images i, GXD_Assay a, GXD_AssayType t ' + \ 'where i._ImagePane_key = a._ImagePane_key ' + \ 'and a._AssayType_key = t._AssayType_key', None) db.sql('insert into #imageassoc ' + \ 'select distinct i.*, 2, a._Marker_key, a._AssayType_key, t.assayType, sortOrder = 2 ' + \ 'from #images i, GXD_Assay a, GXD_AssayType t, GXD_Specimen s, GXD_InSituResult r, GXD_InSituResultImage g ' + \ 'where i._ImagePane_key = g._ImagePane_key ' + \ 'and g._Result_key = r._Result_key ' + \ 'and r._Specimen_key = s._Specimen_key ' + \ 'and s._Assay_key = a._Assay_key ' + \ 'and a._AssayType_key = t._AssayType_key', None) db.sql('create index idx1 on #imageassoc(_Image_key)', None) db.sql('create index idx2 on #imageassoc(_ThumbnailImage_key)', None) db.sql('create index idx3 on #imageassoc(_AssayType_key)', None) db.sql('create index idx4 on #imageassoc(_Object_key)', None) db.sql('create index idx5 on #imageassoc(_Object_key, sortOrder, year, figureLabel, _Image_key)', None) # those with insitu assays only (by marker) db.sql('update #imageassoc set sortOrder = 1 from #imageassoc a1 where a1._AssayType_key in (1,6,9) ' + \ 'and not exists (select 1 from #imageassoc a2 where a1._Image_key = a2._Image_key ' + \ 'and a1._Object_key = a2._Object_key ' + \ 'and a2._AssayType_key in (2,3,4,5,8))', None) # those with gel assays only (by marker) db.sql('update #imageassoc set sortOrder = 3 from #imageassoc a1 where a1._AssayType_key in (2,3,4,5,8) ' + \ 'and not exists (select 1 from #imageassoc a2 where a1._Image_key = a2._Image_key ' + \ 'and a1._Object_key = a2._Object_key ' + \ 'and a2._AssayType_key in (1,6,9))', None) # # pixeldb ids for full size images # results = db.sql('select i._Image_key, a.numericPart ' + \ 'from #imageassoc i, ACC_Accession a ' + \ 'where i._Image_key = a._Object_key ' + \ 'and a._MGIType_key = 9 ' + \ 'and a._LogicalDB_key = 19 ' + \ 'and a.preferred = 1 ', 'auto') pixfullsize = {} for r in results: pixfullsize[r['_Image_key']] = r['numericPart'] # # pixeldb ids for thumbnail images # results = db.sql('select i._Image_key, a.numericPart ' + \ 'from #imageassoc i, ACC_Accession a ' + \ 'where i._ThumbnailImage_key = a._Object_key ' + \ 'and a._MGIType_key = 9 ' + \ 'and a._LogicalDB_key = 19 ' + \ 'and a.preferred = 1 ', 'auto') pixthumbnail = {} for r in results: pixthumbnail[r['_Image_key']] = r['numericPart'] # process all records results = db.sql('select * from #imageassoc order by _Object_key, sortOrder, year desc, numericPart, figureLabel, _Image_key', 'auto') # generate a unique sequence number (starting at 1) for a given Marker/Image pair x = 0 prevMarkerKey = 0 prevImageKey = 0 if objectKey == 0: cacheBCP = open(outDir + '/%s.bcp' % (table), 'w') for r in results: markerKey = r['_Object_key'] imageKey = r['_Image_key'] if prevMarkerKey != markerKey: x = 1 elif prevImageKey != imageKey: x = x + 1 prevMarkerKey = markerKey prevImageKey = imageKey cacheBCP.write(mgi_utils.prvalue(imageKey) + COLDL + \ mgi_utils.prvalue(r['_ThumbnailImage_key']) + COLDL + \ mgi_utils.prvalue(r['_ImagePane_key']) + COLDL + \ mgi_utils.prvalue(r['_MGIType_key']) + COLDL + \ mgi_utils.prvalue(markerKey) + COLDL + \ mgi_utils.prvalue(r['_ObjectMGIType_key']) + COLDL + \ mgi_utils.prvalue(r['_Refs_key']) + COLDL + \ mgi_utils.prvalue(r['_AssayType_key']) + COLDL + \ mgi_utils.prvalue(pixfullsize[imageKey]) + COLDL + \ mgi_utils.prvalue(pixthumbnail[imageKey]) + COLDL + \ mgi_utils.prvalue(x) + COLDL + \ r['assayType'] + COLDL + \ r['figureLabel'] + COLDL + \ mgi_utils.prvalue(r['paneLabel']) + LINEDL) cacheBCP.flush() cacheBCP.close() else: # delete existing cache table entries db.sql('delete %s ' % (table) + \ 'from %s c ' % (table) + \ 'where c._Refs_key = %s' % (objectKey), None) for r in results: markerKey = r['_Object_key'] imageKey = r['_Image_key'] if prevMarkerKey != markerKey: x = 1 elif prevImageKey != imageKey: x = x + 1 prevMarkerKey = markerKey prevImageKey = imageKey db.sql(insertSQL % ( \ mgi_utils.prvalue(imageKey), \ mgi_utils.prvalue(r['_ThumbnailImage_key']), \ mgi_utils.prvalue(r['_ImagePane_key']), \ mgi_utils.prvalue(r['_MGIType_key']), \ mgi_utils.prvalue(markerKey), \ mgi_utils.prvalue(r['_ObjectMGIType_key']), \ mgi_utils.prvalue(r['_Refs_key']), \ mgi_utils.prvalue(r['_AssayType_key']), \ mgi_utils.prvalue(pixfullsize[imageKey]), \ mgi_utils.prvalue(pixthumbnail[imageKey]), \ mgi_utils.prvalue(x),\ r['assayType'],\ r['figureLabel'], \ mgi_utils.prvalue(r['paneLabel'])), None)
66f59595d919a0b550e44e24b1b872459e2f05de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/343/66f59595d919a0b550e44e24b1b872459e2f05de/imgcache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 12, 1612, 653, 4672, 225, 468, 468, 4614, 4725, 528, 261, 43, 22953, 13, 4602, 716, 1240, 30526, 471, 854, 316, 4957, 2383, 468, 225, 1797, 273, 296, 4025, 277, 6315, 2040, 67, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1612, 653, 4672, 225, 468, 468, 4614, 4725, 528, 261, 43, 22953, 13, 4602, 716, 1240, 30526, 471, 854, 316, 4957, 2383, 468, 225, 1797, 273, 296, 4025, 277, 6315, 2040, 67, 8...