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
item_menu = menu.Menu(_('%s Main Menu') % title, self.main_menu_generate(),
item_menu = menu.Menu(menutitle, self.main_menu_generate(),
def main_menu(self, arg=None, menuw=None): """ display the (IMAGE|VIDEO|AUDIO|GAMES) main menu """ self.display_type, force_text_view = arg title = _('Media')
543ce9f3c9744feb4cf0c475d79bb04c49f6489d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/543ce9f3c9744feb4cf0c475d79bb04c49f6489d/mediamenu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 67, 5414, 12, 2890, 16, 1501, 33, 7036, 16, 3824, 91, 33, 7036, 4672, 3536, 2562, 326, 261, 13603, 96, 58, 27242, 96, 14237, 2565, 51, 96, 43, 1642, 55, 13, 2774, 3824, 3536, 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, 2774, 67, 5414, 12, 2890, 16, 1501, 33, 7036, 16, 3824, 91, 33, 7036, 4672, 3536, 2562, 326, 261, 13603, 96, 58, 27242, 96, 14237, 2565, 51, 96, 43, 1642, 55, 13, 2774, 3824, 3536, 3...
('p', 'patch', None, _('show patch'))],
('', 'map-file', '', _('display using template map file')), ('p', 'patch', None, _('show patch')), ('t', 'template', '', _('display with template'))],
def verify(ui, repo): """verify the integrity of the repository Verify the integrity of the current repository. This will perform an extensive check of the repository's integrity, validating the hashes and checksums of each entry in the changelog, manifest, and tracked files, as well as the integrity of their crosslinks and indices. """ return repo.verify()
c039812ee7c7f898ae061ae3829b75a0c153bd65 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/c039812ee7c7f898ae061ae3829b75a0c153bd65/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 12, 4881, 16, 3538, 4672, 3536, 8705, 326, 24425, 434, 326, 3352, 225, 8553, 326, 24425, 434, 326, 783, 3352, 18, 225, 1220, 903, 3073, 392, 1110, 14315, 866, 434, 326, 3352, 1807,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3929, 12, 4881, 16, 3538, 4672, 3536, 8705, 326, 24425, 434, 326, 3352, 225, 8553, 326, 24425, 434, 326, 783, 3352, 18, 225, 1220, 903, 3073, 392, 1110, 14315, 866, 434, 326, 3352, 1807,...
assert b in refs assert c in refs assert a.getRefs('Owns') == [c] assert c.getBRefs('Owns')== [a]
self.failUnless(b in refs, (b, refs)) self.failUnless(c in refs, (c, refs)) self.assertEquals(a.getRefs('Owns'), [c]) self.assertEquals(c.getBRefs('Owns'), [a])
def test_relationships(self):
86089dd5ecda849baf4811c4a444c82c5f916c42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/86089dd5ecda849baf4811c4a444c82c5f916c42/test_referenceable.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 21632, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1842, 67, 21632, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if v not in verts: verts.append(v)
if v not in verts: verts.add(v)
def __init__(self, data=None, pos=None, loops=None, format=None, boundary=[], weighted=None, implementation='networkx', sparse=True, vertex_labels=True, **kwds): """ TEST::
f18927082f20c274175cdc4b0faac157e1c0a697 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/f18927082f20c274175cdc4b0faac157e1c0a697/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 501, 33, 7036, 16, 949, 33, 7036, 16, 14075, 33, 7036, 16, 740, 33, 7036, 16, 7679, 22850, 6487, 13747, 33, 7036, 16, 4471, 2218, 5185, 92, 2187, 9387, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2738, 972, 12, 2890, 16, 501, 33, 7036, 16, 949, 33, 7036, 16, 14075, 33, 7036, 16, 740, 33, 7036, 16, 7679, 22850, 6487, 13747, 33, 7036, 16, 4471, 2218, 5185, 92, 2187, 9387, ...
If 'msg' is not given, the default error message "['a', 'b', 'c'] does not contain the value 'x'" is shown in case of a failure. Otherwise, the given 'msg' is used in case of a failure. """ default = "%s does not contain value '%s'" % (utils.seq2str2(L), str(value)) _verify_condition(L.count(value) != 0, default, msg)
If 'msg' is not given, the default error message "[ a | b | c ] does not contain the value 'x'" is shown in case of a failure. Otherwise, the given 'msg' is used in case of a failure. """ default = "%s does not contain value '%s'" % (utils.seq2str2(L), value) _verify_condition(value in L, default, msg)
def list_should_contain_value(self, L, value, msg=None): """Fails if the value is not found from L. If 'msg' is not given, the default error message "['a', 'b', 'c'] does not contain the value 'x'" is shown in case of a failure. Otherwise, the given 'msg' is used in case of a failure. """ default = "%s does not contain value '%s'" % (utils.seq2str2(L), str(value)) _verify_condition(L.count(value) != 0, default, msg)
9e3b0b6f2f5e1229f613f2fc11d15a4072f9d6db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/9e3b0b6f2f5e1229f613f2fc11d15a4072f9d6db/Collections.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 13139, 67, 28744, 67, 1132, 12, 2890, 16, 511, 16, 460, 16, 1234, 33, 7036, 4672, 3536, 30800, 309, 326, 460, 353, 486, 1392, 628, 511, 18, 225, 971, 296, 3576, 11, 353, 486...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 666, 67, 13139, 67, 28744, 67, 1132, 12, 2890, 16, 511, 16, 460, 16, 1234, 33, 7036, 4672, 3536, 30800, 309, 326, 460, 353, 486, 1392, 628, 511, 18, 225, 971, 296, 3576, 11, 353, 486...
widget_object.SetValue(str(widget_content).rstrip())
if type(widget_content) <> unicode: widget_content = str(widget_content) widget_object.SetValue(widget_content.rstrip())
def populate(self, content_dict=None): ''' content_dict = {#column_name: #content} #column_name = Name of the database field #content = Content of the database field'''
49b4e2a509692e7ee5b1af580d65e2cfc7ac971e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3069/49b4e2a509692e7ee5b1af580d65e2cfc7ac971e/DataViews.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 12, 2890, 16, 913, 67, 1576, 33, 7036, 4672, 9163, 913, 67, 1576, 273, 288, 7, 2827, 67, 529, 30, 468, 1745, 97, 468, 2827, 67, 529, 273, 1770, 434, 326, 2063, 652, 468, 1745, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6490, 12, 2890, 16, 913, 67, 1576, 33, 7036, 4672, 9163, 913, 67, 1576, 273, 288, 7, 2827, 67, 529, 30, 468, 1745, 97, 468, 2827, 67, 529, 273, 1770, 434, 326, 2063, 652, 468, 1745, ...
def get_query_set(): return QuerySet(new_class) new_class.objects.get_query_set = get_query_set new_class._default_manager.get_query_set = get_query_set
if not new_class._meta.abstract: def get_query_set(): return QuerySet(new_class) new_class.objects.get_query_set = get_query_set new_class._default_manager.get_query_set = get_query_set
def get_query_set(): return QuerySet(new_class)
a8d4fb785850a8c5fcdb19f3be10f24b4edcfc81 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12933/a8d4fb785850a8c5fcdb19f3be10f24b4edcfc81/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2271, 67, 542, 13332, 327, 2770, 694, 12, 2704, 67, 1106, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 336, 67, 2271, 67, 542, 13332, 327, 2770, 694, 12, 2704, 67, 1106, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if status not in ('RUNNING', 'CONTINUING'): self.display_in_footer("this process is not running!") else:
if status in ('RUNNING', 'CONTINUING'):
def sleep(self): task_id = self.currentrow[0] process = self.currentrow[1].split(':')[0] status = self.currentrow[5] if status not in ('RUNNING', 'CONTINUING'): self.display_in_footer("this process is not running!") else: bibsched_send_signal(process, task_id, signal.SIGUSR1) self.display_in_footer("SLEEP signal sent to task #%s" % task_id)
1524a2c3d257d234de78198c2e2cff56faded8bd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/1524a2c3d257d234de78198c2e2cff56faded8bd/bibsched.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5329, 12, 2890, 4672, 1562, 67, 350, 273, 365, 18, 2972, 492, 63, 20, 65, 1207, 273, 365, 18, 2972, 492, 63, 21, 8009, 4939, 2668, 2497, 25146, 20, 65, 1267, 273, 365, 18, 2972, 492,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5329, 12, 2890, 4672, 1562, 67, 350, 273, 365, 18, 2972, 492, 63, 20, 65, 1207, 273, 365, 18, 2972, 492, 63, 21, 8009, 4939, 2668, 2497, 25146, 20, 65, 1267, 273, 365, 18, 2972, 492,...
res = RecapDecompose(m)
res = RecapDecompose(m,onlyUseReactions=[0])
def testUreaRxn(self): m = Chem.MolFromSmiles('C1CC1NC(=O)NC1OC1') res = RecapDecompose(m) self.failUnless(res) self.failUnless(len(res.GetLeaves())==2) ks = res.GetLeaves().keys() self.failUnless('[*]NC1CC1' in ks) self.failUnless('[*]NC1CO1' in ks) m = Chem.MolFromSmiles('C1CC1NC(=O)N(C)C1OC1') res = RecapDecompose(m) self.failUnless(res) self.failUnless(len(res.GetLeaves())==2) ks = res.GetLeaves().keys() self.failUnless('[*]NC1CC1' in ks) self.failUnless('[*]N(C)C1CO1' in ks)
e793cf1d5a1abc952de6d7bd7feb70328e8a57c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9195/e793cf1d5a1abc952de6d7bd7feb70328e8a57c4/Recap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 57, 266, 69, 54, 22695, 12, 2890, 4672, 312, 273, 26542, 18, 49, 355, 1265, 9552, 1449, 2668, 39, 21, 6743, 21, 10346, 12, 33, 51, 13, 10346, 21, 10809, 21, 6134, 400, 273, 868...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 57, 266, 69, 54, 22695, 12, 2890, 4672, 312, 273, 26542, 18, 49, 355, 1265, 9552, 1449, 2668, 39, 21, 6743, 21, 10346, 12, 33, 51, 13, 10346, 21, 10809, 21, 6134, 400, 273, 868...
d = xml.dom.minidom.parseString(obj.arch)
d = xml.dom.minidom.parseString(encode(obj.arch))
def encode(s): if isinstance(s, unicode): return s.encode('utf8') return s
0a3efd96a73c4a12402c6fca8fd82c5d53054444 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/0a3efd96a73c4a12402c6fca8fd82c5d53054444/translate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 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, 2017, 12, 87, 4672, 309, 1549, 12, 87, 16, 5252, 4672, 327, 272, 18, 3015, 2668, 3158, 28, 6134, 327, 272, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
if ndir_node.context != self.context:
if ndir_node and ndir_node.context != self.context:
def move_to(self, cr, ndir_node, new_name=False, fil_obj=None, ndir_obj=None, in_write=False): if ndir_node.context != self.context: raise NotImplementedError("Cannot move files between contexts")
9dec9c2863bb41a997510b7eedab1945412a6cb0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/9dec9c2863bb41a997510b7eedab1945412a6cb0/nodes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3635, 67, 869, 12, 2890, 16, 4422, 16, 290, 1214, 67, 2159, 16, 394, 67, 529, 33, 8381, 16, 661, 67, 2603, 33, 7036, 16, 290, 1214, 67, 2603, 33, 7036, 16, 316, 67, 2626, 33, 8381,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3635, 67, 869, 12, 2890, 16, 4422, 16, 290, 1214, 67, 2159, 16, 394, 67, 529, 33, 8381, 16, 661, 67, 2603, 33, 7036, 16, 290, 1214, 67, 2603, 33, 7036, 16, 316, 67, 2626, 33, 8381,...
return S_OK(userMap.userid) return S_ERROR("DN did not exist") def __rmUserDN(self,dn): res = lfc.lfc_rmusrmap(0,dn)
return S_OK( userMap.userid ) return S_ERROR( "DN did not exist" ) def __rmUserDN( self, dn ): res = lfc.lfc_rmusrmap( 0, dn )
def __getDNUserID(self,dn): value, list = lfc.lfc_getusrmap() if value != 0: return S_ERROR(lfc.sstrerror(lfc.cvar.serrno)) else: for userMap in list: if userMap.username == dn: return S_OK(userMap.userid) return S_ERROR("DN did not exist")
6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 8609, 16631, 12, 2890, 16, 5176, 4672, 460, 16, 666, 273, 328, 7142, 18, 80, 7142, 67, 588, 13640, 1458, 1435, 309, 460, 480, 374, 30, 327, 348, 67, 3589, 12, 80, 7142, 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, 1001, 588, 8609, 16631, 12, 2890, 16, 5176, 4672, 460, 16, 666, 273, 328, 7142, 18, 80, 7142, 67, 588, 13640, 1458, 1435, 309, 460, 480, 374, 30, 327, 348, 67, 3589, 12, 80, 7142, 18...
chunk = Chunk().init(self._file)
try: chunk = Chunk().init(self._file) except EOFError: if formlength == 8: print 'Warning: FORM chunk size too large' formlength = 0 break raise EOFError
def initfp(self, file): self._file = file self._version = 0 self._decomp = None self._markers = [] self._soundpos = 0 form = self._file.read(4) if form != 'FORM': raise Error, 'file does not start with FORM id' formlength = _read_long(self._file) if formlength <= 0: raise Error, 'invalid FORM chunk data size' formdata = self._file.read(4) formlength = formlength - 4 if formdata == 'AIFF': self._aifc = 0 elif formdata == 'AIFC': self._aifc = 1 else: raise Error, 'not an AIFF or AIFF-C file' self._comm_chunk_read = 0 while formlength > 0: self._ssnd_seek_needed = 1 chunk = Chunk().init(self._file) formlength = formlength - 8 - chunk.chunksize if chunk.chunksize & 1: formlength = formlength - 1 if chunk.chunkname == 'COMM': self._read_comm_chunk(chunk) self._comm_chunk_read = 1 elif chunk.chunkname == 'SSND': self._ssnd_chunk = chunk dummy = chunk.read(8) self._ssnd_seek_needed = 0 elif chunk.chunkname == 'FVER': self._version = _read_long(chunk) elif chunk.chunkname == 'MARK': self._readmark(chunk) elif chunk.chunkname in _skiplist: pass else: raise Error, 'unrecognized chunk type '+chunk.chunkname if formlength > 0: chunk.skip() if not self._comm_chunk_read or not self._ssnd_chunk: raise Error, 'COMM chunk and/or SSND chunk missing' if self._aifc and self._decomp: params = [CL.ORIGINAL_FORMAT, 0, \ CL.BITS_PER_COMPONENT, 0, \ CL.FRAME_RATE, self._framerate] if self._nchannels == AL.MONO: params[1] = CL.MONO else: params[1] = CL.STEREO_INTERLEAVED if self._sampwidth == AL.SAMPLE_8: params[3] = 8 elif self._sampwidth == AL.SAMPLE_16: params[3] = 16 else: params[3] = 24 self._decomp.SetParams(params) return self
fd50c7470bc1928a83450a47395b44219e3dbacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/fd50c7470bc1928a83450a47395b44219e3dbacf/aifc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 7944, 12, 2890, 16, 585, 4672, 365, 6315, 768, 273, 585, 365, 6315, 1589, 273, 374, 365, 6315, 323, 2919, 273, 599, 365, 6315, 22807, 273, 5378, 365, 6315, 29671, 917, 273, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1208, 7944, 12, 2890, 16, 585, 4672, 365, 6315, 768, 273, 585, 365, 6315, 1589, 273, 374, 365, 6315, 323, 2919, 273, 599, 365, 6315, 22807, 273, 5378, 365, 6315, 29671, 917, 273, 374, ...
print "set password"
def set_password(self, raw_password): print "set password" import random algo = 'sha1' salt = get_hexdigest(algo, str(random.random()), str(random.random()))[:5] hsh = get_hexdigest(algo, salt, raw_password) self.password = '%s$%s$%s' % (algo, salt, hsh) pwd,created = Md5Password.objects.get_or_create(user=self) pwd.password = md5.new(raw_password).hexdigest() pwd.save()
88a916601808cb2e1cc9793a154b906c9a5574d7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6447/88a916601808cb2e1cc9793a154b906c9a5574d7/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 3664, 12, 2890, 16, 1831, 67, 3664, 4672, 1930, 2744, 13901, 273, 296, 7819, 21, 11, 4286, 273, 336, 67, 7118, 10171, 12, 20713, 16, 609, 12, 9188, 18, 9188, 1435, 3631, 609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3664, 12, 2890, 16, 1831, 67, 3664, 4672, 1930, 2744, 13901, 273, 296, 7819, 21, 11, 4286, 273, 336, 67, 7118, 10171, 12, 20713, 16, 609, 12, 9188, 18, 9188, 1435, 3631, 609, ...
journal_period_obj.close(cursor, user, data['ids'], context=context)
journal_period_obj.write(cursor, user, data['ids'], { 'state': 'open', }, context=context)
def _reopen(self, cursor, user, data, context=None): journal_period_obj = self.pool.get('account.journal.period') journal_period_obj.close(cursor, user, data['ids'], context=context) return {}
0babeaa116c12a16544a7d43bccd0a6aa0203f31 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/0babeaa116c12a16544a7d43bccd0a6aa0203f31/journal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 266, 3190, 12, 2890, 16, 3347, 16, 729, 16, 501, 16, 819, 33, 7036, 4672, 13001, 67, 6908, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 4631, 18, 22644, 18, 6908, 6134, 13001, 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, 389, 266, 3190, 12, 2890, 16, 3347, 16, 729, 16, 501, 16, 819, 33, 7036, 4672, 13001, 67, 6908, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668, 4631, 18, 22644, 18, 6908, 6134, 13001, 6...
info=curObject.makeTextInfo(textHandler.POSITION_SELECTION) if info.text and not info.isCollapsed: textList.append(info.text) else: info.expand(textHandler.UNIT_READINGCHUNK) if info.text:
try: info=curObject.makeTextInfo(textHandler.POSITION_SELECTION) if not info.isCollapsed:
def script_navigatorObject_current(self,keyPress): curObject=api.getNavigatorObject() if not isinstance(curObject,NVDAObject): speech.speakMessage(_("no navigator object")) return if scriptHandler.getLastScriptRepeatCount()>=1: textList=[] if isinstance(curObject.name,basestring) and len(curObject.name)>0 and not curObject.name.isspace(): textList.append(curObject.name) if isinstance(curObject.value,basestring) and len(curObject.value)>0 and not curObject.value.isspace(): textList.append(curObject.value) if curObject.TextInfo!=NVDAObjectTextInfo: info=curObject.makeTextInfo(textHandler.POSITION_SELECTION) if info.text and not info.isCollapsed: textList.append(info.text) else: info.expand(textHandler.UNIT_READINGCHUNK) if info.text: textList.append(info.text) text=" ".join(textList) if len(text)>0 and not text.isspace(): if scriptHandler.getLastScriptRepeatCount()==1: speech.speakSpelling(text) else: if api.copyToClip(text): speech.speakMessage(_("%s copied to clipboard")%text) else: speech.speakObject(curObject,reason=speech.REASON_QUERY) return False
40c8f846858859039a346c278773091a39292402 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/40c8f846858859039a346c278773091a39292402/_default.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2728, 67, 82, 13061, 921, 67, 2972, 12, 2890, 16, 856, 11840, 4672, 662, 921, 33, 2425, 18, 588, 22817, 921, 1435, 309, 486, 1549, 12, 1397, 921, 16, 11679, 9793, 921, 4672, 24556, 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, 2728, 67, 82, 13061, 921, 67, 2972, 12, 2890, 16, 856, 11840, 4672, 662, 921, 33, 2425, 18, 588, 22817, 921, 1435, 309, 486, 1549, 12, 1397, 921, 16, 11679, 9793, 921, 4672, 24556, 18,...
SimpleAnim.__init__(self, node, attrName, duration, useInt, onStop, start)
SimpleAnim.__init__(self, node, attrName, duration, useInt, onStop, onStart, start)
def __init__(self, node, attrName, duration, startValue, startSpeed, endValue, endSpeed, useInt=False, onStop=None, start=True): """ @param node: The libavg node object to animate. @param attrName: The name of the attribute to change. Must be a numeric attribute. @param duration: The length of the animation in milliseconds. @param startValue: Initial value of the attribute. @param startSpeed: Initial speed of the animation. @param endValue: Value of the attribute after duration has elapsed. @param endSpeed: Final speed of the animation. @param useInt: If True, the attribute is always set to an integer value. @param onStop: Python callable to invoke when duration has elapsed and the animation has finished. This can be used to chain animations together by using lambda to create a second animation. """ self.__startValue = startValue+0.0 self.__startSpeed = startSpeed self.__endValue = endValue self.__endSpeed = endSpeed self.__a = -2*(self.__endValue-self.__startValue)+self.__startSpeed+self.__endSpeed self.__b = 3*(self.__endValue-self.__startValue)-2*self.__startSpeed-self.__endSpeed self.__c = self.__startSpeed self.__d = self.__startValue SimpleAnim.__init__(self, node, attrName, duration, useInt, onStop, start)
9c2422e1d9ba82fc9726fd07ba1362f21d982cca /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7300/9c2422e1d9ba82fc9726fd07ba1362f21d982cca/anim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 756, 16, 11583, 16, 3734, 16, 27900, 16, 787, 16562, 16, 30684, 16, 679, 16562, 16, 999, 1702, 33, 8381, 16, 603, 4947, 33, 7036, 16, 787, 33, 5510, 46...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 756, 16, 11583, 16, 3734, 16, 27900, 16, 787, 16562, 16, 30684, 16, 679, 16562, 16, 999, 1702, 33, 8381, 16, 603, 4947, 33, 7036, 16, 787, 33, 5510, 46...
delta_r = (float(r2) - float(r1))/length
delta_r = (float(r2) - float(r1)) / length
def plotMSFile(self, filename, outfile = None, format = None, size = (800, 200), starttime = False, endtime = False, dpi = 100, color = 'red', bgcolor = 'white', transparent = False, shadows = False, minmaxlist = False): """ Creates a graph of any given Mini-SEED file. It either saves the image directly to the file system or returns an binary image string. For all color values you can use legit html names, html hex strings (e.g. '#eeefff') or you can pass an R , G , B tuple, where each of R , G , B are in the range [0,1]. You can also use single letters for basic builtin colors ('b' = blue, 'g' = green, 'r' = red, 'c' = cyan, 'm' = magenta, 'y' = yellow, 'k' = black, 'w' = white) and gray shades can be given as a string encoding a float in the 0-1 range. @param filename: Mini-SEED file string @param outfile: Output file string. Also used to automatically determine the output format. Currently supported is emf, eps, pdf, png, ps, raw, rgba, svg and svgz output. Defaults to None. @param format: Format of the graph picture. If no format is given the outfile parameter will be used to try to automatically determine the output format. If no format is found it defaults to png output. If no outfile is specified but a format is than a binary imagestring will be returned. Defaults to None. @param size: Size tupel in pixel for the output file. This corresponds to the resolution of the graph for vector formats. Defaults to 800x200 px. @param starttime: Starttime of the graph as a datetime object. If not set the graph will be plotted from the beginning. Defaults to False. @param endtime: Endtime of the graph as a datetime object. If not set the graph will be plotted until the end. Defaults to False. @param dpi: Dots per inch of the output file. This also affects the size of most elements in the graph (text, linewidth, ...). Defaults to 100. @param color: Color of the graph. If the supplied parameter is a 2-tupel containing two html hex string colors a gradient between the two colors will be applied to the graph. Defaults to 'red'. @param bgcolor: Background color of the graph. If the supplied parameter is a 2-tupel containing two html hex string colors a gradient between the two colors will be applied to the background. Defaults to 'white'. @param transparent: Make all backgrounds transparent (True/False). This will overwrite the bgcolor param. Defaults to False. @param shadows: Adds a very basic drop shadow effect to the graph. Defaults to False. @param minmaxlist: A list containing minimum, maximum and timestamp values. If none is supplied it will be created automatically. Useful for caching. Defaults to False. """ #Either outfile or format needs to be set. if not outfile and not format: raise ValueError('Either outfile or format needs to be set.') #Get a list with minimum and maximum values. if not minmaxlist: minmaxlist = self._getMinMaxList(filename = filename, width = size[0], starttime = starttime, endtime = endtime) starttime = minmaxlist[0] endtime = minmaxlist[1] stepsize = (endtime - starttime)/size[0] minmaxlist = minmaxlist[2:] length = len(minmaxlist) #Importing pyplot and numpy. import matplotlib.pyplot as plt #Setup figure and axes fig = plt.figure(num = None, figsize = (float(size[0])/dpi, float(size[1])/dpi)) ax = fig.add_subplot(111) # hide axes + ticks ax.axison = False #Make the graph fill the whole image. fig.subplots_adjust(left=0, bottom=0, right=1, top=1) #Determine range for the y axis. This may not be the smartest way to #do it. miny = 99999999999999999 maxy = -9999999999999999 for _i in range(length): try: if minmaxlist[_i][0] < miny: miny = minmaxlist[_i][0] except: pass try: if minmaxlist[_i][1] > maxy: maxy = minmaxlist[_i][1] except: pass #Set axes and disable ticks plt.ylim(miny, maxy) plt.xlim(starttime, endtime) plt.yticks([]) plt.xticks([]) #Overwrite the background gradient if transparent is set. if transparent: bgcolor = None #Draw gradient background if needed. if type(bgcolor) == type((1,2)): for _i in xrange(size[0]+1): #Convert hex values to integers r1 = int(bgcolor[0][1:3], 16) r2 = int(bgcolor[1][1:3], 16) delta_r = (float(r2) - float(r1))/size[0] g1 = int(bgcolor[0][3:5], 16) g2 = int(bgcolor[1][3:5], 16) delta_g = (float(g2) - float(g1))/size[0] b1 = int(bgcolor[0][5:], 16) b2 = int(bgcolor[1][5:], 16) delta_b = (float(b2) - float(b1))/size[0] new_r = hex(int(r1 + delta_r * _i))[2:] new_g = hex(int(g1 + delta_g * _i))[2:] new_b = hex(int(b1 + delta_b * _i))[2:] if len(new_r) == 1: new_r = '0'+new_r if len(new_g) == 1: new_g = '0'+new_g if len(new_b) == 1: new_b = '0'+new_b #Create color string bglinecolor = '#'+new_r+new_g+new_b plt.axvline(x = starttime + _i*stepsize, color = bglinecolor) bgcolor = 'white' #Clone color for looping. loop_color = color #Draw horizontal lines. for _i in range(length): #Make gradient if color is a 2-tupel. if type(loop_color) == type((1,2)): #Convert hex values to integers r1 = int(loop_color[0][1:3], 16) r2 = int(loop_color[1][1:3], 16) delta_r = (float(r2) - float(r1))/length g1 = int(loop_color[0][3:5], 16) g2 = int(loop_color[1][3:5], 16) delta_g = (float(g2) - float(g1))/length b1 = int(loop_color[0][5:], 16) b2 = int(loop_color[1][5:], 16) delta_b = (float(b2) - float(b1))/length new_r = hex(int(r1 + delta_r * _i))[2:] new_g = hex(int(g1 + delta_g * _i))[2:] new_b = hex(int(b1 + delta_b * _i))[2:] if len(new_r) == 1: new_r = '0'+new_r if len(new_g) == 1: new_g = '0'+new_g if len(new_b) == 1: new_b = '0'+new_b #Create color string color = '#'+new_r+new_g+new_b #Calculate relative values needed for drawing the lines. yy = (float(minmaxlist[_i][0])-miny)/(maxy-miny) xx = (float(minmaxlist[_i][1])-miny)/(maxy-miny) #Draw shadows if desired. if shadows: plt.axvline(x = minmaxlist[_i][2] + stepsize, ymin = yy - 0.01, ymax = xx - 0.01, color = 'k', alpha = 0.4) #Draw actual data lines. plt.axvline(x = minmaxlist[_i][2], ymin = yy, ymax = xx, color = color) #Save file. if outfile: #If format is set use it. if format: plt.savefig(outfile, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor, format = format) #Otherwise try to get the format from outfile or default to png. else: plt.savefig(outfile, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor) #Return an binary imagestring if outfile is not set but format is. if not outfile: imgdata = StringIO.StringIO() plt.savefig(imgdata, dpi = dpi, transparent = transparent, facecolor = bgcolor, edgecolor = bgcolor, format = format) imgdata.seek(0) return imgdata.read()
da81b4ce7064a28a168b56663efe435b307a52d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/da81b4ce7064a28a168b56663efe435b307a52d4/libmseed.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 3537, 812, 12, 2890, 16, 1544, 16, 8756, 273, 599, 16, 740, 273, 599, 16, 963, 273, 261, 17374, 16, 4044, 3631, 23437, 273, 1083, 16, 31361, 273, 1083, 16, 16361, 273, 2130, 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, 3207, 3537, 812, 12, 2890, 16, 1544, 16, 8756, 273, 599, 16, 740, 273, 599, 16, 963, 273, 261, 17374, 16, 4044, 3631, 23437, 273, 1083, 16, 31361, 273, 1083, 16, 16361, 273, 2130, 16, ...
log.setLevel(logging.DEBUG)
if opt.debug: log.setLevel(logging.DEBUG) else: log.setLevel(logging.INFO)
def init_log(): global opt log = logging.getLogger() log.setLevel(logging.DEBUG) has_stdout = has_stderr = False if not (opt.xml_log or opt.txt_log or opt.mach_log): # Default to a txt logger opt.txt_log = 'stderr' if opt.xml_log: hnd = XMLStreamHandler(opt.xml_log) log.addHandler(hnd) if opt.txt_log: if opt.txt_log == 'stderr': log.addHandler(logging.StreamHandler()) has_stderr = True elif opt.txt_log == 'stdout': log.addHandler(logging.StreamHandler(sys.stdout)) has_stdout = True else: log.addHandler(logging.FileHandler(opt.txt_log)) #hnd2.setFormatter() if opt.mach_log: if opt.mach_log == 'stdout': if has_stdout: raise Exception("Cannot have two loggers at stdout!") hnd3 = logging.StreamHandler(sys.stdout) has_stdout = True else: hnd3 = logging.FileHandler(opt.mach_log) hnd3.setFormatter(MachineFormatter()) log.addHandler(hnd3)
5626a18758b74bba9bf609d6121898e258e57124 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12355/5626a18758b74bba9bf609d6121898e258e57124/base_quality_interrogation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1330, 13332, 2552, 2153, 613, 273, 2907, 18, 588, 3328, 1435, 309, 2153, 18, 4148, 30, 613, 18, 542, 2355, 12, 11167, 18, 9394, 13, 469, 30, 613, 18, 542, 2355, 12, 11167, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1208, 67, 1330, 13332, 2552, 2153, 613, 273, 2907, 18, 588, 3328, 1435, 309, 2153, 18, 4148, 30, 613, 18, 542, 2355, 12, 11167, 18, 9394, 13, 469, 30, 613, 18, 542, 2355, 12, 11167, ...
jl.append(jobname)
jl.append(jobname)
def nfspath(dir): if dir.startswith('/.automount/'): dir = '/n/%s' % dir[12:] elif not dir.startswith('/n/'): dir = '/n/%s%s' % (socket.gethostname().split('.')[0], dir) return dir
5e9bc06457923893d5acf049ab5d1dd621a865cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6787/5e9bc06457923893d5acf049ab5d1dd621a865cc/send.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 290, 2556, 803, 12, 1214, 4672, 309, 1577, 18, 17514, 1918, 2668, 15865, 5854, 362, 592, 2473, 4672, 1577, 273, 1173, 82, 5258, 87, 11, 738, 1577, 63, 2138, 26894, 1327, 486, 1577, 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, 290, 2556, 803, 12, 1214, 4672, 309, 1577, 18, 17514, 1918, 2668, 15865, 5854, 362, 592, 2473, 4672, 1577, 273, 1173, 82, 5258, 87, 11, 738, 1577, 63, 2138, 26894, 1327, 486, 1577, 18, ...
c1=context.copy()
c1 = context.copy()
def _get_in_out(self, cr, uid, val, date_start, date_stop, direction, done, context):
6a21b5d661b74602c870fac41f3c8c42e8bc6c33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a21b5d661b74602c870fac41f3c8c42e8bc6c33/stock_planning.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 267, 67, 659, 12, 2890, 16, 4422, 16, 4555, 16, 1244, 16, 1509, 67, 1937, 16, 1509, 67, 5681, 16, 4068, 16, 2731, 16, 819, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 267, 67, 659, 12, 2890, 16, 4422, 16, 4555, 16, 1244, 16, 1509, 67, 1937, 16, 1509, 67, 5681, 16, 4068, 16, 2731, 16, 819, 4672, 2, -100, -100, -100, -100, -100, -100, ...
print "checking record %d" % i
print "FIXME: checking record %d" % i
def _getPathBounds(self): """Get the bounding rectangle for the list of EMR records starting from the last saved path start to the current record.""" for i in range(self.pathstart,len(self.records)): print "checking record %d" % i return (0,0,-1,-1)
5ec5c46b0b6b12f6dd38c8d54dc0815bac382b0e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8136/5ec5c46b0b6b12f6dd38c8d54dc0815bac382b0e/pyemf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 743, 5694, 12, 2890, 4672, 3536, 967, 326, 7552, 11845, 364, 326, 666, 434, 7141, 54, 3853, 5023, 628, 326, 1142, 5198, 589, 787, 358, 326, 783, 1409, 12123, 364, 277, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 743, 5694, 12, 2890, 4672, 3536, 967, 326, 7552, 11845, 364, 326, 666, 434, 7141, 54, 3853, 5023, 628, 326, 1142, 5198, 589, 787, 358, 326, 783, 1409, 12123, 364, 277, 316, 1...
:param jobstore: alias of the job store to store the job in (overrides the ``persistent`` option)
:param trigger: alias of the job store to store the job in :param func: alias of the job store to store the job in :param args: alias of the job store to store the job in :param kwargs: alias of the job store to store the job in :param jobstore: alias of the job store to store the job in
def add_job(self, trigger, func, args, kwargs, jobstore='default', quiet=False, **options): """ Adds the given job to the job list and notifies the scheduler thread.
b52fbed4ddc35b1d9ed22897822250de9d37d45a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1127/b52fbed4ddc35b1d9ed22897822250de9d37d45a/scheduler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4688, 12, 2890, 16, 3080, 16, 1326, 16, 833, 16, 1205, 16, 1719, 2233, 2218, 1886, 2187, 10902, 33, 8381, 16, 2826, 2116, 4672, 3536, 15605, 326, 864, 1719, 358, 326, 1719, 66...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 4688, 12, 2890, 16, 3080, 16, 1326, 16, 833, 16, 1205, 16, 1719, 2233, 2218, 1886, 2187, 10902, 33, 8381, 16, 2826, 2116, 4672, 3536, 15605, 326, 864, 1719, 358, 326, 1719, 66...
sage: ls
sage: ls
def enumerate_totallyreal_fields_rel(F, m, B, a = [], verbose=0, return_seqs=False): r""" This function enumerates (primitive) totally real field extensions of degree $m>1$ of the totally real field F with discriminant $d \leq B$; optionally one can specify the first few coefficients, where the sequence $a$ corresponds to a polynomial by $$ a[d]*x^n + ... + a[0]*x^(n-d) $$ if length(a) = d+1, so in particular always a[d] = 1. If verbose == 1 (or 2), then print to the screen (really) verbosely; if verbose is a string, then print verbosely to the file specified by verbose. If return_seqs, then return the polynomials as sequences (for easier exporting to a file). NOTE: This is guaranteed to give all primitive such fields, and seems in practice to give many imprimitive ones. INPUT: F -- number field, the base field m -- integer, the degree B -- integer, the discriminant bound a -- list (default: []), the coefficient list to begin with verbose -- boolean or string (default: 0) return_seqs -- boolean (default: False) OUTPUT: the list of fields with entries [d,fabs,f], where d is the discriminant, fabs is an absolute defining polynomial, and f is a defining polynomial relative to F, sorted by discriminant. EXAMPLES: In this first simple example, we compute the totally real quadratic fields of Q(sqrt(2)) of discriminant <= 2000. sage: ZZx = ZZ['x'] sage: F.<t> = NumberField(x^2-2) sage: enumerate_totallyreal_fields_rel(F, 2, 2000) [[1600, x^4 - 6*x^2 + 4, xF^2 + xF - 1]] There is indeed only one such extension, given by F(sqrt(5)). Next, we list all totally real quadratic extensions of Q(sqrt(5)) with root discriminant <= 10. sage: F.<t> = NumberField(x^2-5) sage: ls = enumerate_totallyreal_fields_rel(F, 2, 10^4) sage: ls # random [[725, x^4 - x^3 - 3*x^2 + x + 1, xF^2 + (-1/2*t + 1/2)*xF - t - 2], [1125, x^4 - x^3 - 4*x^2 + 4*x + 1, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 3/2], [1600, x^4 - 6*x^2 + 4, xF^2 - t - 3], [2000, x^4 - 5*x^2 + 5, xF^2 - 1/2*t - 5/2], [2225, x^4 - x^3 - 5*x^2 + 2*x + 4, xF^2 + (-1/2*t + 1/2)*xF - 3/2*t - 7/2], [2525, x^4 - 2*x^3 - 4*x^2 + 5*x + 5, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 5/2], [3600, x^4 - 2*x^3 - 7*x^2 + 8*x + 1, xF^2 - 3/2*t - 9/2], [4225, x^4 - 9*x^2 + 4, xF^2 + (-1/2*t - 1/2)*xF - 3/2*t - 9/2], [4400, x^4 - 7*x^2 + 11, xF^2 - 1/2*t - 7/2], [4525, x^4 - x^3 - 7*x^2 + 3*x + 9, xF^2 + (-1/2*t - 1/2)*xF - 3], [5125, x^4 - 2*x^3 - 6*x^2 + 7*x + 11, xF^2 + (-1/2*t - 1/2)*xF - t - 4], [5225, x^4 - x^3 - 8*x^2 + x + 11, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 7/2], [5725, x^4 - x^3 - 8*x^2 + 6*x + 11, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 7/2], [6125, x^4 - x^3 - 9*x^2 + 9*x + 11, xF^2 + (-1/2*t + 1/2)*xF - t - 4], [7600, x^4 - 9*x^2 + 19, xF^2 - 1/2*t - 9/2], [7625, x^4 - x^3 - 9*x^2 + 4*x + 16, xF^2 + (-1/2*t - 1/2)*xF - 4], [8000, x^4 - 10*x^2 + 20, xF^2 - t - 5], [8525, x^4 - 2*x^3 - 8*x^2 + 9*x + 19, xF^2 + xF - 1/2*t - 9/2], [8725, x^4 - x^3 - 10*x^2 + 2*x + 19, xF^2 + (-1/2*t - 1/2)*xF - 1/2*t - 9/2], [9225, x^4 - x^3 - 10*x^2 + 7*x + 19, xF^2 + (-1/2*t + 1/2)*xF - 1/2*t - 9/2]] sage: [ f[0] for f in ls ] [725, 1125, 1600, 2000, 2225, 2525, 3600, 4225, 4400, 4525, 5125, 5225, 5725, 6125, 7600, 7625, 8000, 8525, 8725, 9225] sage: [NumberField(ZZx(_[i][1]), 't').is_galois() for i in range(len(_))] [False, True, True, True, False, False, True, True, False, False, False, False, False, True, False, False, True, False, False, False] Seven out of 18 such fields are Galois (with Galois group Z/4Z or Z/2Z + Z/2Z); the others have have Galois closure of degree 8 (with Galois group D_8). Finally, we compute the cubic extensions of Q(zeta_7)^+ with discriminant <= 17*10^9. sage: F.<t> = NumberField(ZZx([1,-4,3,1])) sage: F.disc() 49 sage: enumerate_totallyreal_fields_rel(F, 3, 17*10^9) [[16240385609L, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]] # 32-bit [[16240385609, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]] # 64-bit NOTES: We enumerate polynomials f(x) = x^n + a[n-1]*x^(n-1) + ... + a[0]. A relative Hunter's theorem gives bounds on a[n-1] and a[n-2]; then given a[n-1] and a[n-2], one can recursively compute bounds on a[n-3], ..., a[0] using the fact that the polynomial is totally real by looking at the zeros of successive derivatives and applying Rolle's theorem! See references in totallyreal.py. AUTHORS: - John Voight (2007-11-01) """ if not isinstance(m, Integer): try: m = Integer(m) except: raise TypeError, "cannot coerce m (= %s) to an integer"%n if (m < 1): raise ValueError, "m must be at least 1." n = F.degree()*m # Initialize T = tr_data_rel(F,m,B,a) S = [] Srel = [] dB_odlyzko = odlyzko_bound_totallyreal(n) dB = math.ceil(40000*dB_odlyzko**n) counts = [0,0,0,0] # Trivial case if m == 1: g = pari(F.defining_polynomial()).reverse().Vec() if return_seqs: return [[0,0,0,0],[1,g,[-1,1]]] else: return [[1,pari('x-1'),g]] if verbose: saveout = sys.stdout if type(verbose) == str: fsock = open(verbose, 'w') sys.stdout = fsock # Else, print to screen f_out = [0]*m + [1] if verbose == 2: T.incr(f_out,verbose) else: T.incr(f_out) Fx = PolynomialRing(F, 'xF') nfF = pari(str(F.defining_polynomial()).replace('x', str(F.primitive_element()) ) ) parit = pari(str(F.primitive_element())) while f_out[m] <> 0: counts[0] += 1 if verbose: print "==>", f_out, f_str = '' for i in range(len(f_out)): f_str += '(' + str(f_out[i]) + ')*x^' + str(i) if i < len(f_out)-1: f_str += '+' nf = pari(f_str).polresultant(nfF, parit) d = nf.poldisc() counts[0] += 1 if d > 0 and nf.polsturm_full() == n: da = int_has_small_square_divisor(Integer(d)) if d > dB or d <= B*da: counts[1] += 1 if nf.polisirreducible(): counts[2] += 1 [zk,d] = nf.nfbasis_d() if d <= B: if verbose: print "has discriminant", d, # Find a minimal lattice element counts[3] += 1 ng = pari([nf,zk]).polredabs() # Check if K is contained in the list. found = False ind = bisect.bisect_left(S, [d,ng]) while ind < len(S) and S[ind][0] == d: if S[ind][1] == ng: if verbose: print "but is not new" found = True break ind += 1 if not found: if verbose: print "and is new!" S.insert(ind, [d,ng]) Srel.insert(ind, Fx(f_out)) else: if verbose: print "has discriminant", abs(d), "> B" else: if verbose: print "is not absolutely irreducible" else: if verbose: print "has discriminant", abs(d), "with no large enough square divisor" else: if verbose: if d == 0: print "is not squarefree" else: print "is not totally real" if verbose == 2: T.incr(f_out,verbose=verbose) else: T.incr(f_out) # In the application of Smyth's theorem above, we exclude finitely # many possibilities which we must now throw back in. if m == 2: if Fx([-1,1,1]).is_irreducible(): K = F.extension(Fx([-1,1,1]), 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, Fx([-1,1,1])) elif d == 2: for ff in [[1,-7,13,-7,1],[1,-8,14,-7,1]]: f = Fx(ff).factor()[0][0] K = F.extension(f, 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, f) elif m == 3: if Fx([-1,6,-5,1]).is_irreducible(): K = F.extension(Fx([-1,6,-5,1]), 'tK') Kabs = K.absolute_field('tKabs') Kabs_pari = pari(Kabs.defining_polynomial()) d = K.disc() if abs(d) <= B: ng = Kabs_pari.polredabs() ind = bisect.bisect_left(S, [d,ng]) S.insert(ind, [d,ng]) Srel.insert(ind, Fx([-1,6,-5,1])) # Now check for isomorphic fields S = [[S[i][0],S[i][1],Srel[i]] for i in range(len(S))] weed_fields(S) # Output. if verbose: print "="*80 print "Polynomials tested:", counts[0] print "Irreducible polynomials:", counts[1] print "Polynomials with nfdisc <= B:", counts[2] for i in range(len(S)): print S[i] if type(verbose) == str: fsock.close() sys.stdout = saveout if return_seqs: return [counts,[[s[0],s[1].reverse().Vec(),s[2].coeffs()] for s in S]] else: return S
5343932d258da52a2db760699b6f482feffa2018 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5343932d258da52a2db760699b6f482feffa2018/totallyreal_rel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4241, 67, 3307, 1230, 7688, 67, 2821, 67, 2878, 12, 42, 16, 312, 16, 605, 16, 279, 273, 5378, 16, 3988, 33, 20, 16, 327, 67, 22437, 33, 8381, 4672, 436, 8395, 1220, 445, 3557, 815, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4241, 67, 3307, 1230, 7688, 67, 2821, 67, 2878, 12, 42, 16, 312, 16, 605, 16, 279, 273, 5378, 16, 3988, 33, 20, 16, 327, 67, 22437, 33, 8381, 4672, 436, 8395, 1220, 445, 3557, 815, ...
Create a time period with the given length centered around `time`.
Return a time period with the given length (represented as a timedelta) centered around `time`.
def time_period_center(time, length): """ TimePeriod factory method. Create a time period with the given length centered around `time`. """ half_length = mult_timedelta(length, 0.5) start_time = time - half_length end_time = time + half_length return TimePeriod(start_time, end_time)
c737fbb26e428df0d8a1e1d888dbdf8efa3b1d24 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/c737fbb26e428df0d8a1e1d888dbdf8efa3b1d24/data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 813, 67, 6908, 67, 5693, 12, 957, 16, 769, 4672, 3536, 2647, 5027, 3272, 707, 18, 225, 2000, 279, 813, 3879, 598, 326, 864, 769, 261, 28205, 329, 487, 279, 10661, 13, 25340, 6740, 1375...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 813, 67, 6908, 67, 5693, 12, 957, 16, 769, 4672, 3536, 2647, 5027, 3272, 707, 18, 225, 2000, 279, 813, 3879, 598, 326, 864, 769, 261, 28205, 329, 487, 279, 10661, 13, 25340, 6740, 1375...
return self._append(EMR.ELLIPSE((left,top,right,bottom)))
return self._append(_EMR._ELLIPSE((left,top,right,bottom)))
def Ellipse(self,left,top,right,bottom): """
688318604ffe18a54bb261a3bde4bf6e1784a8de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8136/688318604ffe18a54bb261a3bde4bf6e1784a8de/pyemf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10426, 10472, 12, 2890, 16, 4482, 16, 3669, 16, 4083, 16, 9176, 4672, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 10426, 10472, 12, 2890, 16, 4482, 16, 3669, 16, 4083, 16, 9176, 4672, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,))
'WHERE account_id IN %s AND unit_amount <> 0.0',(parent_ids,))
def _month(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()] else: res[id] = [] return res
3c18c11c83e2549431192a3a0c1f46403db9d628 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8241/3c18c11c83e2549431192a3a0c1f46403db9d628/account_analytic_analysis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7496, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 1501, 16, 819, 33, 7036, 4672, 400, 273, 2618, 364, 612, 316, 3258, 30, 3258, 22, 273, 365, 18, 3072, 12, 3353, 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, 389, 7496, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 1501, 16, 819, 33, 7036, 4672, 400, 273, 2618, 364, 612, 316, 3258, 30, 3258, 22, 273, 365, 18, 3072, 12, 3353, 16, ...
self.EmptyUndoBuffer()
self.SetSavePoint()
def refreshModel(self): if self.isModified(): self.model.modified = true self.nonUserModification = false
f2d9de9b91fb77d3ba05e87f8e4569617622e102 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/f2d9de9b91fb77d3ba05e87f8e4569617622e102/SourceViews.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 1488, 12, 2890, 4672, 309, 365, 18, 291, 4575, 13332, 365, 18, 2284, 18, 7342, 273, 638, 365, 18, 5836, 1299, 13467, 273, 629, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4460, 1488, 12, 2890, 4672, 309, 365, 18, 291, 4575, 13332, 365, 18, 2284, 18, 7342, 273, 638, 365, 18, 5836, 1299, 13467, 273, 629, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
code[skip] = len(code) - skip elif _simple(av) and op != REPEAT: if op == MAX_REPEAT:
code[skip] = _len(code) - skip elif _simple(av) and op is not REPEAT: if op is MAX_REPEAT:
def fixup(literal, flags=flags): return _sre.getlower(literal, flags)
01c9f8c35f583338e3638906ceeef9d2f29a0254 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01c9f8c35f583338e3638906ceeef9d2f29a0254/sre_compile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 416, 12, 13107, 16, 2943, 33, 7133, 4672, 327, 389, 87, 266, 18, 588, 8167, 12, 13107, 16, 2943, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 416, 12, 13107, 16, 2943, 33, 7133, 4672, 327, 389, 87, 266, 18, 588, 8167, 12, 13107, 16, 2943, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
for delimiter in DELIMITERS_WORDS:
for delimiter in _DELIMITERS_WORDS:
def get_word_info(word): longest = (word, "") for delimiter in DELIMITERS_WORDS: if len(delimiter) > len(longest[1]) and word.endswith(delimiter): word = word.rpartition(delimiter) longest = (word[0], word[1]) return (len(longest[0]), longest[1])
bc9d5a1d58b676e7cc6dcf78f4cef02419954da2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3480/bc9d5a1d58b676e7cc6dcf78f4cef02419954da2/lipsum.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1095, 67, 1376, 12, 1095, 4672, 12163, 273, 261, 1095, 16, 1408, 13, 225, 364, 5654, 316, 389, 1639, 8283, 11367, 67, 23287, 30, 309, 562, 12, 15751, 13, 405, 562, 12, 5748, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1095, 67, 1376, 12, 1095, 4672, 12163, 273, 261, 1095, 16, 1408, 13, 225, 364, 5654, 316, 389, 1639, 8283, 11367, 67, 23287, 30, 309, 562, 12, 15751, 13, 405, 562, 12, 5748, ...
mpfr = ctypes.cdll.LoadLibrary(ctypes.util.find_library('mpfr'))
mpfr = ctypes.cdll.LoadLibrary('/opt/local/lib/libmpfr.dylib')
def format_finite(digits, dot_pos): """Given a (possibly empty) string of digits and an integer dot_pos indicating the position of the decimal point relative to the start of that string, output a formatted numeric string with the same value and same implicit exponent.""" # strip leading zeros olddigits = digits digits = digits.lstrip('0') dot_pos -= len(olddigits) - len(digits) # value is 0.digits * 10**dot_pos use_exponent = dot_pos <= -4 or dot_pos > len(digits) if use_exponent: exp = dot_pos-1 if digits else dot_pos dot_pos -= exp # left pad with zeros, insert decimal point, and add exponent if dot_pos <= 0: digits = '0'*(1-dot_pos) + digits dot_pos += 1-dot_pos assert 1 <= dot_pos <= len(digits) if dot_pos < len(digits): digits = digits[:dot_pos] + '.' + digits[dot_pos:] if use_exponent: digits += "e{0:+}".format(exp) return digits
b4bb7dbffcfba97a783076753e1edf1fa845d5c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7048/b4bb7dbffcfba97a783076753e1edf1fa845d5c5/pympfr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9551, 12, 16649, 16, 3928, 67, 917, 4672, 3536, 6083, 279, 261, 917, 8781, 1008, 13, 533, 434, 6815, 471, 392, 3571, 3928, 67, 917, 11193, 326, 1754, 434, 326, 6970, 1634, 363...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 9551, 12, 16649, 16, 3928, 67, 917, 4672, 3536, 6083, 279, 261, 917, 8781, 1008, 13, 533, 434, 6815, 471, 392, 3571, 3928, 67, 917, 11193, 326, 1754, 434, 326, 6970, 1634, 363...
self.havelist = (disp,)
self.havelist = (disp, eltprefs)
# global dispdef change (in GLPane.setDisplay).]
93eddd7f9b9b49578f5a665b53b25e890707e2e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/93eddd7f9b9b49578f5a665b53b25e890707e2e8/chunk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 225, 2552, 16232, 536, 2549, 261, 267, 10252, 8485, 18, 542, 4236, 2934, 65, 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...
[ 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 225, 2552, 16232, 536, 2549, 261, 267, 10252, 8485, 18, 542, 4236, 2934, 65, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
model, iter = playerSelection.get_selected()
model, iter = widgets["playertreeview"].get_selection().get_selected()
def challengeButtonClicked (button): model, iter = playerSelection.get_selected() if iter == None: return playerName = model.get_value(iter, 1) rated = widgets["chaRatedGameCheck"].get_active() color = widgets["chaColorCombobox"].get_active()-1 if color == -1: color = None min, incr = map(int, widgets["chaTimeCombobox"].get_model()[ widgets["chaTimeCombobox"].get_active()][0].split(" min +")) glm.challenge(playerName, min, incr, rated, color)
c54289fd6b8ee5121535e711caaf244b178f9fea /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5339/c54289fd6b8ee5121535e711caaf244b178f9fea/icLounge.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 12948, 3616, 27633, 261, 5391, 4672, 938, 16, 1400, 273, 10965, 9614, 1601, 1051, 992, 1945, 6, 8009, 588, 67, 10705, 7675, 588, 67, 8109, 1435, 309, 1400, 422, 599, 30, 327, 7291, 461, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12948, 3616, 27633, 261, 5391, 4672, 938, 16, 1400, 273, 10965, 9614, 1601, 1051, 992, 1945, 6, 8009, 588, 67, 10705, 7675, 588, 67, 8109, 1435, 309, 1400, 422, 599, 30, 327, 7291, 461, ...
suite = _getSuite(config)
def run(): _monkeyPatchPyunit() if len(sys.argv) == 1: sys.argv.append("--help") config = Options() try: config.parseOptions() except usage.error, ue: raise SystemExit, "%s: %s" % (sys.argv[0], ue) _setUpAdapters() _initialDebugSetup(config) suite = _getSuite(config) _setUpTestdir() _setUpLogging(config) reallyRun(config, suite) if config.tracer: sys.settrace(None) results = config.tracer.results() results.write_results(show_missing=1, summary=False, coverdir=config.coverdir) sys.exit(not itrial.ITestStats(suite).allPassed)
5584962440ea64de685830c76e42f7a16ae3c06b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/5584962440ea64de685830c76e42f7a16ae3c06b/trial.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 389, 2586, 856, 7332, 9413, 4873, 1435, 225, 309, 562, 12, 9499, 18, 19485, 13, 422, 404, 30, 2589, 18, 19485, 18, 6923, 2932, 413, 5201, 7923, 225, 642, 273, 5087, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 13332, 389, 2586, 856, 7332, 9413, 4873, 1435, 225, 309, 562, 12, 9499, 18, 19485, 13, 422, 404, 30, 2589, 18, 19485, 18, 6923, 2932, 413, 5201, 7923, 225, 642, 273, 5087, 1435, ...
print (Y1-Y2).max()
if verbose > 2: print (Y1-Y2).max()
def test_cdist_wminkowski_random_p4d6(self): "Tests cdist(X, 'wminkowski') on random data. (p=4.6)" eps = 1e-07 # Get the data: the input matrix and the right output. X1 = eo['cdist-X1'] X2 = eo['cdist-X2'] w = 1.0 / X1.std(axis=0) Y1 = cdist(X1, X2, 'wminkowski', p=4.6, w=w) Y2 = cdist(X1, X2, 'test_wminkowski', p=4.6, w=w) print (Y1-Y2).max() self.failUnless(within_tol(Y1, Y2, eps))
4d0e70abd9cffaed8694c9e382fc2bb8c34516fd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/4d0e70abd9cffaed8694c9e382fc2bb8c34516fd/test_distance.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4315, 376, 67, 91, 81, 754, 543, 7771, 77, 67, 9188, 67, 84, 24, 72, 26, 12, 2890, 4672, 315, 14650, 276, 4413, 12, 60, 16, 296, 91, 81, 754, 543, 7771, 77, 6134, 603, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4315, 376, 67, 91, 81, 754, 543, 7771, 77, 67, 9188, 67, 84, 24, 72, 26, 12, 2890, 4672, 315, 14650, 276, 4413, 12, 60, 16, 296, 91, 81, 754, 543, 7771, 77, 6134, 603, ...
except UnicodeDecodeError:
except (UnicodeDecodeError, LookupError):
def _to_utf8_bytes(s, encoding=None): """Takes a string and do whatever needs to be done to make it into a UTF-8 string. If a Unicode string is given, it is just encoded in UTF-8. Otherwise, if an encoding hint is given, first try to decode the string as if it were in that encoding; if that fails (or the hint isn't given), liberally (if necessary lossily) interpret it as _default_encoding. """ try: return _utf8cache[(s, encoding)] except KeyError: pass result = None # If we got a Unicode string, half of our work is already done. if isinstance(s, unicode): result = s.encode('utf-8') elif not isinstance(s, str): s = str(s) if result is None and encoding is not None and not encoding == '': # If we knew the encoding of the s, try that. try: decoded = s.decode(encoding, 'replace') except UnicodeDecodeError: pass else: result = decoded.encode('utf-8') if result is None: # Encoding wasn't provided, or it was wrong. Interpret # provided string liberally as a fixed _default_encoding (see # above.) result = s.decode(_default_encoding, 'replace').encode('utf-8') _utf8cache[(s, encoding)] = result return _utf8cache[(s, encoding)]
5fd00789139dbb7a22078332a3121e67fd790bd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/5fd00789139dbb7a22078332a3121e67fd790bd1/util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 869, 67, 3158, 28, 67, 3890, 12, 87, 16, 2688, 33, 7036, 4672, 3536, 11524, 279, 533, 471, 741, 15098, 4260, 358, 506, 2731, 358, 1221, 518, 1368, 279, 6380, 17, 28, 533, 18, 97...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 869, 67, 3158, 28, 67, 3890, 12, 87, 16, 2688, 33, 7036, 4672, 3536, 11524, 279, 533, 471, 741, 15098, 4260, 358, 506, 2731, 358, 1221, 518, 1368, 279, 6380, 17, 28, 533, 18, 97...
os.chmod(imgfile, mod) os.chown(imgfile, -1, gid)
try: os.chmod(imgfile, mod) except OSError: pass try: os.chown(imgfile, -1, gid) except OSError: pass
def cmd(s): print "[shell cmd] %s" % s n = os.system(s) if n != 0: raise Exception("shell cmd error: %s" % n)
b2de97b88db5f1abb1ff5619f2613703ddfb437c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6851/b2de97b88db5f1abb1ff5619f2613703ddfb437c/obfusmail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1797, 12, 87, 4672, 1172, 5158, 10304, 1797, 65, 738, 87, 6, 738, 272, 290, 273, 1140, 18, 4299, 12, 87, 13, 309, 290, 480, 374, 30, 1002, 1185, 2932, 10304, 1797, 555, 30, 738, 87, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1797, 12, 87, 4672, 1172, 5158, 10304, 1797, 65, 738, 87, 6, 738, 272, 290, 273, 1140, 18, 4299, 12, 87, 13, 309, 290, 480, 374, 30, 1002, 1185, 2932, 10304, 1797, 555, 30, 738, 87, ...
logging.getLogger().info("Scheduler: %d tasks to perform" % len(deffereds))
logging.getLogger().info("Scheduler: %d tasks to start" % len(deffereds))
def startAllCommands(scheduler_name): # we return a list of deferred deffereds = [] # will hold all deferred session = sqlalchemy.create_session() database = MscDatabase() logger = logging.getLogger() logger.debug("MSC_Scheduler->startAllCommands()...") # gather candidates: # ignore completed tasks # ignore paused tasks # ignore stopped tasks # ignore tasks already in progress # ignore tasks which failed # ignore tasks with no retries left # take tasks with a pid not already set # take tasks with next launch time in the future # TODO: check command state integrity AND command_on_host state integrity in a separtseparate function for q in session.query(CommandsOnHost).\ select_from(database.commands_on_host.join(database.commands)).\ filter(database.commands_on_host.c.current_state != 'done').\ filter(database.commands_on_host.c.current_state != 'pause').\ filter(database.commands_on_host.c.current_state != 'stop').\ filter(database.commands_on_host.c.current_state != 'upload_in_progress').\ filter(database.commands_on_host.c.current_state != 'execution_in_progress').\ filter(database.commands_on_host.c.current_state != 'delete_in_progress').\ filter(database.commands_on_host.c.current_state != 'inventory_in_progress').\ filter(database.commands_on_host.c.current_state != 'upload_failed').\ filter(database.commands_on_host.c.current_state != 'execution_failed').\ filter(database.commands_on_host.c.current_state != 'delete_failed').\ filter(database.commands_on_host.c.current_state != 'inventory_failed').\ filter(database.commands_on_host.c.next_launch_date <= time.strftime("%Y-%m-%d %H:%M:%S")).\ filter(sqlalchemy.or_( database.commands_on_host.c.scheduler == '', database.commands_on_host.c.scheduler == scheduler_name, database.commands_on_host.c.scheduler == None) ).all(): deffered = runCommand(q.id) if deffered: deffereds.append(deffered) session.close() logging.getLogger().info("Scheduler: %d tasks to perform" % len(deffereds)) return deffereds
73cd4c71bcd7384e724630021be966b0cab3150e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/73cd4c71bcd7384e724630021be966b0cab3150e/scheduling.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 1595, 9127, 12, 19972, 67, 529, 4672, 468, 732, 327, 279, 666, 434, 7045, 1652, 586, 9765, 273, 5378, 468, 903, 6887, 777, 7045, 1339, 273, 1847, 24182, 18, 2640, 67, 3184, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 1595, 9127, 12, 19972, 67, 529, 4672, 468, 732, 327, 279, 666, 434, 7045, 1652, 586, 9765, 273, 5378, 468, 903, 6887, 777, 7045, 1339, 273, 1847, 24182, 18, 2640, 67, 3184, 1435, ...
return _spacejoin(result)
return _semispacejoin(result)
def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append
eebb4bbe4670c7d4c05857583386a55110f30b32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/eebb4bbe4670c7d4c05857583386a55110f30b32/Cookie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3633, 780, 12, 2890, 16, 3422, 33, 7036, 4672, 468, 3998, 731, 3134, 563, 468, 563, 273, 5378, 26880, 273, 563, 18, 6923, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3633, 780, 12, 2890, 16, 3422, 33, 7036, 4672, 468, 3998, 731, 3134, 563, 468, 563, 273, 5378, 26880, 273, 563, 18, 6923, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return []
return {}
def getRegisteredUsers(self, filter, current = None): """ Returns a list of usernames in the phpBB3 database which contain filter as a substring. """ try: sql = 'SELECT username FROM %susers WHERE username LIKE %%s' % cfg.database.prefix cur = threadDB.execute(sql, filter) except threadDbException: return []
9f36caa421806530adcbe0a45cf04a0e8eb4d8ff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13030/9f36caa421806530adcbe0a45cf04a0e8eb4d8ff/phpBB3auth.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 10868, 6588, 12, 2890, 16, 1034, 16, 783, 273, 599, 4672, 3536, 2860, 279, 666, 434, 27675, 316, 326, 3863, 9676, 23, 2063, 1492, 912, 1034, 487, 279, 3019, 18, 3536, 225, 775, 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, 336, 10868, 6588, 12, 2890, 16, 1034, 16, 783, 273, 599, 4672, 3536, 2860, 279, 666, 434, 27675, 316, 326, 3863, 9676, 23, 2063, 1492, 912, 1034, 487, 279, 3019, 18, 3536, 225, 775, 30...
self._platform, len(rebaselining_tests))
self._platform, len(self._rebaselining_tests))
def _CompileRebaseliningTests(self): """Compile list of tests that need rebaselining for the platform.
f88af6d54c48237ad0edb1b3bd6a6d27d9f30401 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/f88af6d54c48237ad0edb1b3bd6a6d27d9f30401/rebaseline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9937, 426, 9157, 292, 10008, 14650, 12, 2890, 4672, 3536, 9937, 666, 434, 7434, 716, 1608, 283, 9157, 292, 10008, 364, 326, 4072, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9937, 426, 9157, 292, 10008, 14650, 12, 2890, 4672, 3536, 9937, 666, 434, 7434, 716, 1608, 283, 9157, 292, 10008, 364, 326, 4072, 18, 2, -100, -100, -100, -100, -100, -100, -100, -1...
sub_path = copy_subtitle_file(sub_path, self.item_info)
sub_path = copy_subtitle_file(sub_path, self.item_info.video_path)
def select_subtitle_file(self, sub_path): sub_path = copy_subtitle_file(sub_path, self.item_info)
74d84949d66366f6144afc6b61f5764039e1cdb9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/74d84949d66366f6144afc6b61f5764039e1cdb9/quicktime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 67, 1717, 2649, 67, 768, 12, 2890, 16, 720, 67, 803, 4672, 720, 67, 803, 273, 1610, 67, 1717, 2649, 67, 768, 12, 1717, 67, 803, 16, 365, 18, 1726, 67, 1376, 13, 2, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 67, 1717, 2649, 67, 768, 12, 2890, 16, 720, 67, 803, 4672, 720, 67, 803, 273, 1610, 67, 1717, 2649, 67, 768, 12, 1717, 67, 803, 16, 365, 18, 1726, 67, 1376, 13, 2, -100, -100...
self.sendAccountingRecord( job, msg, classAdJob )
if classAdJob: self.sendAccountingRecord( job, msg, classAdJob )
def setFailedJob( self, job, msg, classAdJob ): """This method moves the job to the failed status """ self.log.verbose( "self.updateJobStatus(%s,'%s','%s')" % ( job, self.failedStatus, msg ) ) if not self.am_Enabled(): return S_OK() self.updateJobStatus( job, self.failedStatus, msg ) self.sendAccountingRecord( job, msg, classAdJob )
5afa746c3a7117c060ac96263007d0746e63780b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/5afa746c3a7117c060ac96263007d0746e63780b/OptimizerModule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 2925, 2278, 12, 365, 16, 1719, 16, 1234, 16, 667, 1871, 2278, 262, 30, 3536, 2503, 707, 13934, 326, 1719, 358, 326, 2535, 1267, 3536, 365, 18, 1330, 18, 11369, 12, 315, 2890, 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, 444, 2925, 2278, 12, 365, 16, 1719, 16, 1234, 16, 667, 1871, 2278, 262, 30, 3536, 2503, 707, 13934, 326, 1719, 358, 326, 2535, 1267, 3536, 365, 18, 1330, 18, 11369, 12, 315, 2890, 18, ...
Generate a unique name for this node in the DAG
Generate a unique name for this node in the DAG.
def set_name(self): """ Generate a unique name for this node in the DAG """ t = str( long( time.time() * 1000 ) ) r = str( long( random.random() * 100000000000000000L ) ) a = str( self.__class__ ) self.__name = md5.md5(t + r + a).hexdigest()
43adc4d722e280c921ddb7c38f99393e57936591 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/43adc4d722e280c921ddb7c38f99393e57936591/pipeline.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 529, 12, 2890, 4672, 3536, 6654, 279, 3089, 508, 364, 333, 756, 316, 326, 463, 1781, 18, 3536, 268, 273, 609, 12, 1525, 12, 813, 18, 957, 1435, 380, 4336, 262, 262, 436, 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, 444, 67, 529, 12, 2890, 4672, 3536, 6654, 279, 3089, 508, 364, 333, 756, 316, 326, 463, 1781, 18, 3536, 268, 273, 609, 12, 1525, 12, 813, 18, 957, 1435, 380, 4336, 262, 262, 436, 273...
self.username = ""
def ftp_PASS(self, line): """Check username's password against the authorizer."""
ec365e6d5087da71cc02b321332eb3f61dd588dc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3782/ec365e6d5087da71cc02b321332eb3f61dd588dc/ftpserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 10884, 12, 2890, 16, 980, 4672, 3536, 1564, 2718, 1807, 2201, 5314, 326, 16761, 12123, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 13487, 67, 10884, 12, 2890, 16, 980, 4672, 3536, 1564, 2718, 1807, 2201, 5314, 326, 16761, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
logfile = 'configure.log'
def removeTempFiles(): # Final clean-up if not lyx_keep_temps: removeFiles(['chkconfig.vars', \ 'wrap_chkconfig.ltx', 'wrap_chkconfig.log', \ 'chklayouts.tex', 'missfont.log', 'chklatex.ltx', 'chklatex.log'])
b8ce87578f9d75ccccfc9a3eb0e0156576b6d158 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7514/b8ce87578f9d75ccccfc9a3eb0e0156576b6d158/configure.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 7185, 2697, 13332, 468, 16269, 2721, 17, 416, 309, 486, 18519, 92, 67, 10102, 67, 874, 1121, 30, 1206, 2697, 12, 3292, 27038, 1425, 18, 4699, 2187, 225, 521, 296, 4113, 67, 27038, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1206, 7185, 2697, 13332, 468, 16269, 2721, 17, 416, 309, 486, 18519, 92, 67, 10102, 67, 874, 1121, 30, 1206, 2697, 12, 3292, 27038, 1425, 18, 4699, 2187, 225, 521, 296, 4113, 67, 27038, ...
if entry.getElementsByTagName('MovieName'):
if entry.getElementsByTagName('MovieName') and entry.getElementsByTagName('MovieName')[0].firstChild:
def parse_results(self, raw_xml): """Parse the xml and return a list of dictionaries like: [ {'IDSubtitle': 'foo', 'LinkUseNext': 'foo', 'MovieName': 'foo_movie', ... }, {'IDSubtitle': 'foo', 'LinkUseNext': 'foo', 'MovieName': 'foo_movie', ... }, ...] """ dom = minidom.parseString(raw_xml) #Make the dom from raw xml entries=dom.getElementsByTagName('opensubtitles') #Pull out all entry's result_entries=[] #Make an empty container to fill up and return data = None # fetch the wanted result xml node for entry in entries: if len(entry.getElementsByTagName('results')) > 0: for result in entry.getElementsByTagName('results'): if len(result.getElementsByTagName('subtitle')) > 0: data = result.getElementsByTagName('subtitle') break break #print "data=", data if not data: return [] # catch all subtitles information for entry in data: try: sub_obj = subtitlefile.SubtitleFile(online=True) sub = {} if entry.getElementsByTagName('IDSubtitle'): sub['IDSubtitle'] = { 'IDSubtitle': entry.getElementsByTagName('IDSubtitle')[0].firstChild.data, 'Link': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('Link'), 'LinkImdb': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('LinkImdb'), 'DownloadLink': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('DownloadLink'), 'uuid': entry.getElementsByTagName('IDSubtitle')[0].getAttribute('uuid'), } sub_obj.id = sub['IDSubtitle']['IDSubtitle'] if entry.getElementsByTagName('UserID'): sub['UserID'] = { 'UserID': entry.getElementsByTagName('UserID')[0].firstChild.data, 'Link': entry.getElementsByTagName('UserID')[0].getAttribute('Link'), } if entry.getElementsByTagName('UserNickName'): sub['UserNickName'] = entry.getElementsByTagName('UserNickName')[0].firstChild.data sub_obj._uploader = sub['UserNickName'] if entry.getElementsByTagName('MovieID'): #sub['MovieID'] = entry.getElementsByTagName('MovieID')[0].firstChild.data sub['MovieID'] = { 'MovieID': entry.getElementsByTagName('MovieID')[0].firstChild.data, 'Link': entry.getElementsByTagName('MovieID')[0].getAttribute('Link'), 'LinkImdb': entry.getElementsByTagName('MovieID')[0].getAttribute('LinkImdb'), } if entry.getElementsByTagName('MovieThumb'): sub['MovieThumb'] = entry.getElementsByTagName('MovieThumb')[0].firstChild.data if entry.getElementsByTagName('LinkUseNext'): sub['LinkUseNext'] = entry.getElementsByTagName('LinkUseNext')[0].firstChild.data if entry.getElementsByTagName('LinkZoozle'): sub['LinkZoozle'] = entry.getElementsByTagName('LinkZoozle')[0].firstChild.data if entry.getElementsByTagName('LinkTorrentbar'): sub['LinkTorrentbar'] = entry.getElementsByTagName('LinkTorrentbar')[0].firstChild.data if entry.getElementsByTagName('LinkBoardreader'): sub['LinkBoardreader'] = entry.getElementsByTagName('LinkBoardreader')[0].firstChild.data if entry.getElementsByTagName('MovieName'): sub['MovieName'] = entry.getElementsByTagName('MovieName')[0].firstChild.data if entry.getElementsByTagName('MovieYear'): sub['MovieYear'] = entry.getElementsByTagName('MovieYear')[0].firstChild.data if entry.getElementsByTagName('MovieImdbRating'): sub['MovieImdbRating'] = entry.getElementsByTagName('MovieImdbRating')[0].firstChild.data if entry.getElementsByTagName('MovieImdbID'): sub['MovieImdbID'] = entry.getElementsByTagName('MovieImdbID')[0].firstChild.data if entry.getElementsByTagName('SubAuthorComment'): try: sub['SubAuthorComment'] = entry.getElementsByTagName('SubAuthorComment')[0].firstChild.data except AttributeError: sub['SubAuthorComment'] = entry.getElementsByTagName('SubAuthorComment')[0].firstChild if entry.getElementsByTagName('ISO639'): sub['ISO639'] = { 'ISO639': entry.getElementsByTagName('ISO639')[0].firstChild.data, 'LinkSearch': entry.getElementsByTagName('ISO639')[0].getAttribute('LinkSearch'), 'flag': entry.getElementsByTagName('ISO639')[0].getAttribute('flag'), } sub_obj._languageXX = sub['ISO639']['ISO639'] if entry.getElementsByTagName('LanguageName'): sub['LanguageName'] = entry.getElementsByTagName('LanguageName')[0].firstChild.data sub_obj._languageName = sub['LanguageName'] if entry.getElementsByTagName('SubFormat'): sub['SubFormat'] = entry.getElementsByTagName('SubFormat')[0].firstChild.data if entry.getElementsByTagName('SubSumCD'): sub['SubSumCD'] = entry.getElementsByTagName('SubSumCD')[0].firstChild.data if entry.getElementsByTagName('SubAddDate'): sub['SubAddDate'] = entry.getElementsByTagName('SubAddDate')[0].firstChild.data if entry.getElementsByTagName('SubBad'): sub['SubBad'] = entry.getElementsByTagName('SubBad')[0].firstChild.data if entry.getElementsByTagName('SubRating'): sub['SubRating'] = entry.getElementsByTagName('SubRating')[0].firstChild.data if entry.getElementsByTagName('SubDownloadsCnt'): sub['SubDownloadsCnt'] = entry.getElementsByTagName('SubDownloadsCnt')[0].firstChild.data if entry.getElementsByTagName('SubMovieAka'): sub['SubMovieAka'] = entry.getElementsByTagName('SubMovieAka')[0].firstChild.data if entry.getElementsByTagName('SubDate'): sub['SubDate'] = entry.getElementsByTagName('SubDate')[0].firstChild.data if entry.getElementsByTagName('SubComments'): sub['SubComments'] = entry.getElementsByTagName('SubComments')[0].firstChild.data if entry.getElementsByTagName('TotalSubs'): sub['TotalSubs'] = entry.getElementsByTagName('TotalSubs')[0].firstChild.data if entry.getElementsByTagName('Newest'): sub['Newest'] = entry.getElementsByTagName('Newest')[0].firstChild.data if sub: #result_entries.append(sub) movie = Movie(sub) if sub_obj.id: movie.subtitles.append(sub_obj) result_entries.append(movie) except IndexError, e: pass return result_entries
f4a0b5c76f2474a74fe101030a960e622bef3d59 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/f4a0b5c76f2474a74fe101030a960e622bef3d59/search.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4717, 12, 2890, 16, 1831, 67, 2902, 4672, 3536, 3201, 326, 2025, 471, 327, 279, 666, 434, 16176, 3007, 30, 306, 282, 13666, 734, 1676, 2649, 4278, 296, 11351, 2187, 296, 2098, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4717, 12, 2890, 16, 1831, 67, 2902, 4672, 3536, 3201, 326, 2025, 471, 327, 279, 666, 434, 16176, 3007, 30, 306, 282, 13666, 734, 1676, 2649, 4278, 296, 11351, 2187, 296, 2098, ...
IMPLEMENTATION: Calls the PARI isprime function. """ n = ZZ(n) return pari(n).isprime()
ALGORITHM:: Calculation is delegated to the ``n.is_prime()`` method, or in special cases (e.g., Python ``int``s) to ``Integer(n).is_prime()``. If an ``n.is_prime()`` method is not available, it otherwise raises a ``TypeError``. """ if type(n) == int or type(n)==long: from sage.rings.integer import Integer return Integer(n).is_prime() else: try: return n.is_prime() except AttributeError: raise TypeError, "is_prime() is not written for this type"
def is_prime(n, flag=0): r""" Returns True if `x` is prime, and False otherwise. The result is proven correct - *this is NOT a pseudo-primality test!*. INPUT: - ``flag`` - int - ``0`` (default) - use a combination of algorithms. - ``1`` - certify primality using the Pocklington-Lehmer Test. - ``2`` - certify primality using the APRCL test. OUTPUT: - ``bool`` - True or False .. note:: We do not consider negatives of prime numbers as prime. EXAMPLES:: sage: is_prime(389) True sage: is_prime(2000) False sage: is_prime(2) True sage: is_prime(-1) False sage: factor(-6) -1 * 2 * 3 sage: is_prime(1) False sage: is_prime(-2) False IMPLEMENTATION: Calls the PARI isprime function. """ n = ZZ(n) return pari(n).isprime()
bd4a8cfafce1ad06ab866905b52f8bdaee588220 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/bd4a8cfafce1ad06ab866905b52f8bdaee588220/arith.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 16382, 12, 82, 16, 2982, 33, 20, 4672, 436, 8395, 2860, 1053, 309, 1375, 92, 68, 353, 17014, 16, 471, 1083, 3541, 18, 1021, 563, 353, 450, 3995, 3434, 300, 380, 2211, 353, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 16382, 12, 82, 16, 2982, 33, 20, 4672, 436, 8395, 2860, 1053, 309, 1375, 92, 68, 353, 17014, 16, 471, 1083, 3541, 18, 1021, 563, 353, 450, 3995, 3434, 300, 380, 2211, 353, 4...
if hasattr(self,'_keys'): del self._keys
if hasattr(self,'_v_keys'): del self._v_keys
def clear(self):
37130a76c083481cb70c3b12bc9f8d849e2452a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/37130a76c083481cb70c3b12bc9f8d849e2452a5/Persistence.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2424, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2424, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
if appenddot: self.tokenstack.append('.') result = self.token self.token = None self.state = None return result
return token
def get_token(self): if self.tokenstack: return self.tokenstack.pop(0) while not self.eof: if self.charstack: nextchar = self.charstack.pop(0) else: nextchar = self.instream.read(1) if not nextchar: self.eof = True break elif not self.state: self.token = nextchar if nextchar in self.wordchars: self.state = 'a' elif nextchar in self.numchars: self.state = '0' elif nextchar in self.whitespace: self.token = ' ' break # emit token else: break # emit token elif self.state == 'a': if nextchar in self.wordchars: self.token += nextchar else: self.charstack.append(nextchar) break # emit token elif self.state == '0': if (nextchar in self.numchars or nextchar in '.'): self.token += nextchar else: self.charstack.append(nextchar) if self.token[-1] == '.': self.tokenstack.append('.') self.token = self.token[:-1] if self.token.count('.') == 1: splitdots = False break # emit token if self.state == '0': if self.token[-1] == '.': appenddot = True self.token = self.token[:-1] else: appenddot = False if self.token.count('.') > 1: l = self.token.split('.') self.token = l[0] for tok in l[1:]: self.tokenstack.append('.') self.tokenstack.append(tok) if appenddot: self.tokenstack.append('.') result = self.token self.token = None self.state = None return result
df40ec34463f41133b27dcd652cf51345c00a32d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8441/df40ec34463f41133b27dcd652cf51345c00a32d/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2316, 12, 2890, 4672, 309, 365, 18, 2316, 3772, 30, 327, 365, 18, 2316, 3772, 18, 5120, 12, 20, 13, 1323, 486, 365, 18, 9339, 30, 309, 365, 18, 3001, 3772, 30, 1024, 3001, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2316, 12, 2890, 4672, 309, 365, 18, 2316, 3772, 30, 327, 365, 18, 2316, 3772, 18, 5120, 12, 20, 13, 1323, 486, 365, 18, 9339, 30, 309, 365, 18, 3001, 3772, 30, 1024, 3001, ...
"""readall() -> bytes. Read until EOF, using multiple read() call."""
"""readall() -> bytes. Read until EOF, using multiple read() calls."""
def readall(self): """readall() -> bytes. Read until EOF, using multiple read() call.""" res = bytearray() while True: data = self.read(DEFAULT_BUFFER_SIZE) if not data: break res += data return bytes(res)
e7c3e2e5e4f30f57daf737bd819c94309263cc54 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/e7c3e2e5e4f30f57daf737bd819c94309263cc54/io.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 454, 12, 2890, 4672, 3536, 896, 454, 1435, 317, 1731, 18, 225, 2720, 3180, 6431, 16, 1450, 3229, 855, 1435, 4097, 12123, 400, 273, 14552, 1435, 1323, 1053, 30, 501, 273, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 454, 12, 2890, 4672, 3536, 896, 454, 1435, 317, 1731, 18, 225, 2720, 3180, 6431, 16, 1450, 3229, 855, 1435, 4097, 12123, 400, 273, 14552, 1435, 1323, 1053, 30, 501, 273, 365, 18, ...
node.to_ncx(point, playorder, depth+1)
node.to_ncx(point, order, depth+1)
def to_ncx(self, parent, playorder=None, depth=1): if not playorder: playorder = [0] for node in self.nodes: playorder[0] += 1 point = etree.SubElement(parent, NCX('navPoint'), attrib={'playOrder': str(playorder[0])}) if self.klass: point.attrib['class'] = node.klass if self.id: point.attrib['id'] = node.id label = etree.SubElement(point, NCX('navLabel')) etree.SubElement(label, NCX('text')).text = node.title href = node.href if depth > 1 else urldefrag(node.href)[0] child = etree.SubElement(point, NCX('content'), attrib={'src': href}) node.to_ncx(point, playorder, depth+1) return parent
2857ff00fb0dd9da2dfdd4eaab72e15320e4b31e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/2857ff00fb0dd9da2dfdd4eaab72e15320e4b31e/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 14202, 92, 12, 2890, 16, 982, 16, 6599, 1019, 33, 7036, 16, 3598, 33, 21, 4672, 309, 486, 6599, 1019, 30, 6599, 1019, 273, 306, 20, 65, 364, 756, 316, 365, 18, 4690, 30, 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, 358, 67, 14202, 92, 12, 2890, 16, 982, 16, 6599, 1019, 33, 7036, 16, 3598, 33, 21, 4672, 309, 486, 6599, 1019, 30, 6599, 1019, 273, 306, 20, 65, 364, 756, 316, 365, 18, 4690, 30, 6...
self.__minpoly = "("+(str(self.base_ring().modulus()).replace("x",gen)).replace(" ","")+")" singular.eval("minpoly=%s"%(self.__minpoly) )
self.__minpoly = (str(self.base_ring().modulus()).replace("x",gen)).replace(" ","") if singular.eval('minpoly') != "(" + self.__minpoly + ")": singular.eval("minpoly=%s"%(self.__minpoly) ) self.__minpoly = singular.eval('minpoly')[1:-1]
def _singular_init_(self, singular=singular_default, force=False): """ Return a newly created Singular ring matching this ring. """ if not self._can_convert_to_singular() and not force: raise TypeError, "no conversion of this ring to a Singular ring defined"
ea4f74b7a23f067370f4119dc8ee606b848e3c11 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/ea4f74b7a23f067370f4119dc8ee606b848e3c11/polynomial_singular_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17835, 67, 2738, 67, 12, 2890, 16, 10048, 33, 17835, 67, 1886, 16, 2944, 33, 8381, 4672, 3536, 2000, 279, 10894, 2522, 348, 17830, 9221, 3607, 333, 9221, 18, 3536, 309, 486, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17835, 67, 2738, 67, 12, 2890, 16, 10048, 33, 17835, 67, 1886, 16, 2944, 33, 8381, 4672, 3536, 2000, 279, 10894, 2522, 348, 17830, 9221, 3607, 333, 9221, 18, 3536, 309, 486, 365, ...
command = ['checkout', url, checkout_path]
command = ['checkout', url, self.checkout_path]
def update(self, options, args, file_list): """Runs svn to update or transparently checkout the working copy.
338ead09dbd34566cb60d324c2eb7366229ad94e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6076/338ead09dbd34566cb60d324c2eb7366229ad94e/gclient_scm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 2890, 16, 702, 16, 833, 16, 585, 67, 1098, 4672, 3536, 9361, 5893, 82, 358, 1089, 578, 17270, 715, 13926, 326, 5960, 1610, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 1089, 12, 2890, 16, 702, 16, 833, 16, 585, 67, 1098, 4672, 3536, 9361, 5893, 82, 358, 1089, 578, 17270, 715, 13926, 326, 5960, 1610, 18, 2, -100, -100, -100, -100, -100, -100, -100, -1...
sage: D.cliques_containing_node()
sage: D.cliques_containing_vertex()
def cliques_containing_node(self, nodes=None, cliques=None, with_labels=False): """ Returns the cliques containing each node, represented as a list of lists. (Returns a single list if only one input node).
139028392b54ae237314b7536b21897e9b1d7ed3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/139028392b54ae237314b7536b21897e9b1d7ed3/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 1213, 3280, 67, 2159, 12, 2890, 16, 2199, 33, 7036, 16, 4942, 29896, 33, 7036, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 4942, 29896, 4191, 1517, 756, 16, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4942, 29896, 67, 1213, 3280, 67, 2159, 12, 2890, 16, 2199, 33, 7036, 16, 4942, 29896, 33, 7036, 16, 598, 67, 5336, 33, 8381, 4672, 3536, 2860, 326, 4942, 29896, 4191, 1517, 756, 16, 10...
if child_cls is not None and (True if child_cls is [c for c in [Role]] else False):
if child_cls is not None and child_cls is Role:
def _parse_element(self, element, *args, **kwargs): for child in element: child_cls = self._xml_application.get_element(child.tag) if child_cls is not None and (True if child_cls is [c for c in [Role]] else False): try: list.append(self, child_cls.from_element(child, *args, **kwargs)) except ValidationError: pass
1c9fe7c720994fa651059d9d0fceae54f4915dc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3449/1c9fe7c720994fa651059d9d0fceae54f4915dc3/conference.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 2956, 12, 2890, 16, 930, 16, 380, 1968, 16, 2826, 4333, 4672, 364, 1151, 316, 930, 30, 1151, 67, 6429, 273, 365, 6315, 2902, 67, 3685, 18, 588, 67, 2956, 12, 3624, 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, 389, 2670, 67, 2956, 12, 2890, 16, 930, 16, 380, 1968, 16, 2826, 4333, 4672, 364, 1151, 316, 930, 30, 1151, 67, 6429, 273, 365, 6315, 2902, 67, 3685, 18, 588, 67, 2956, 12, 3624, 18,...
classColor=OWGraphTools.ColorPaletteHSV(len(dist))
classColor=OWColorPalette.ColorPaletteHSV(len(dist))
def fixGeom(self, width): distText=self.distText.strip("<>") dist=[float(f) for f in distText.split(",")] distSum=sum(dist) classColor=OWGraphTools.ColorPaletteHSV(len(dist)) m=max(dist) for i in range(len(dist)): r=QGraphicsRectItem(None, self.canvas) r.setRect(self.x(), self.y(), dist[i]/distSum*width,barHeight) r.setPen(QPen(QColor(classColor[i]),2)) if dist[i]==m: r.setBrush(QBrush(classColor[i])) self.rect.append(r)
81805feed134fca27f3486db9f5494ed6d4525ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/81805feed134fca27f3486db9f5494ed6d4525ab/OWCN2RulesViewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2917, 16972, 12, 2890, 16, 1835, 4672, 2411, 1528, 33, 2890, 18, 4413, 1528, 18, 6406, 2932, 32, 2984, 13, 2411, 22850, 5659, 12, 74, 13, 364, 284, 316, 2411, 1528, 18, 4939, 2932, 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, 2917, 16972, 12, 2890, 16, 1835, 4672, 2411, 1528, 33, 2890, 18, 4413, 1528, 18, 6406, 2932, 32, 2984, 13, 2411, 22850, 5659, 12, 74, 13, 364, 284, 316, 2411, 1528, 18, 4939, 2932, 16,...
def unwrap(self, x): if isinstance(x, PGBuild.XML.dom.Node): if not hasattr(x, 'node'): Element(x) return x.node if type(x)==type([]) or isinstance(x, PGBuild.XML.dom.minidom.NodeList): out = [] for item in x: out.append(self.unwrap(item)) return out return x
def unwrap(self, x): if isinstance(x, PGBuild.XML.dom.Node): if not hasattr(x, 'node'): # Create an Element() class if it hasn't been done Element(x) return x.node if type(x)==type([]) or isinstance(x, PGBuild.XML.dom.minidom.NodeList): out = [] for item in x: out.append(self.unwrap(item)) return out return x
591b55afd6c84f45e172101e788d41d8d6820828 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/454/591b55afd6c84f45e172101e788d41d8d6820828/XML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11014, 12, 2890, 16, 619, 4672, 309, 1549, 12, 92, 16, 22116, 3116, 18, 4201, 18, 9859, 18, 907, 4672, 309, 486, 3859, 12, 92, 16, 296, 2159, 11, 4672, 468, 1788, 392, 3010, 1435, 66...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 11014, 12, 2890, 16, 619, 4672, 309, 1549, 12, 92, 16, 22116, 3116, 18, 4201, 18, 9859, 18, 907, 4672, 309, 486, 3859, 12, 92, 16, 296, 2159, 11, 4672, 468, 1788, 392, 3010, 1435, 66...
sentence_length = int(round(sentence_length)) if start_with_lorem: return self.__start_with_lorem() for i in range(len(sentence), max(10, sentence_length)): if chains.has_key(previous): chain = random.choice(chains[previous]) word_length = chain[0] end_of_word = chain[1] word = random.choice(self.__choose_closest(dictionary, word_length)) word = word.lower() previous = (previous[1], word_length) sentence += [word + end_of_word] if self.__punctuation_end_sentence.count(end_of_word): break else: previous = random.choice(end_sentences) if not self.__punctuation_end_sentence.count(end_of_word): if self.__punctuation_end_word.count(end_of_word): sentence[-1] = sentence[-1].rstrip(end_of_word) + '.' else: sentence[-1] = sentence[-1] + '.' sentence[0] = sentence[0].capitalize() sentence = string.join(sentence) return sentence def generate_paragraph(self, start_with_lorem=False, paragraph_dist=None): """ generate_paragraph() -> str Generates a single paragraph, consisting of a variable number of sentences of variable length. """ if start_with_lorem: paragraph = [self.generate_sentence(start_with_lorem=True)]
for key in dictionary.iterkeys(): above = key if target_key < key: if below == False: below = above break below = key if abs(above - target_key) < abs(below - target_key): return dictionary[above]
def generate_sentence(self, start_with_lorem=False, distribution=None): """ generate_sentence() -> str
932a233d397baa992e7d4b7bbdc3fd34094331e6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3480/932a233d397baa992e7d4b7bbdc3fd34094331e6/lipsum.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 19335, 12, 2890, 16, 787, 67, 1918, 67, 383, 2764, 33, 8381, 16, 7006, 33, 7036, 4672, 3536, 2103, 67, 19335, 1435, 317, 609, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 2103, 67, 19335, 12, 2890, 16, 787, 67, 1918, 67, 383, 2764, 33, 8381, 16, 7006, 33, 7036, 4672, 3536, 2103, 67, 19335, 1435, 317, 609, 2, -100, -100, -100, -100, -100, -100, -100, -10...
home = os.environ['HOME']
home = os.environ.get('HOME')
def addpackage(sitedir, name): global _dirs_in_sys_path if _dirs_in_sys_path is None: _init_pathinfo() reset = 1 else: reset = 0 fullname = os.path.join(sitedir, name) try: f = open(fullname) except IOError: return while 1: dir = f.readline() if not dir: break if dir[0] == '#': continue if dir.startswith("import"): exec dir continue if dir[-1] == '\n': dir = dir[:-1] dir, dircase = makepath(sitedir, dir) if not dircase in _dirs_in_sys_path and os.path.exists(dir): sys.path.append(dir) _dirs_in_sys_path[dircase] = 1 if reset: _dirs_in_sys_path = None
ff57b77c0ee82ab3e6b2ac620936239771651ce3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/ff57b77c0ee82ab3e6b2ac620936239771651ce3/site.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 5610, 12, 87, 16261, 481, 16, 508, 4672, 2552, 389, 8291, 67, 267, 67, 9499, 67, 803, 309, 389, 8291, 67, 267, 67, 9499, 67, 803, 353, 599, 30, 389, 2738, 67, 803, 1376, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5610, 12, 87, 16261, 481, 16, 508, 4672, 2552, 389, 8291, 67, 267, 67, 9499, 67, 803, 309, 389, 8291, 67, 267, 67, 9499, 67, 803, 353, 599, 30, 389, 2738, 67, 803, 1376, 1435, ...
gLogger.error(errStr,res['Message'])
gLogger.error( errStr, res['Message'] )
def removeFile(self,lfn): """ Remove the file (all replicas) from Storage Elements and file catalogue
9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 812, 12, 2890, 16, 80, 4293, 4672, 3536, 3581, 326, 585, 261, 454, 21545, 13, 628, 5235, 17219, 471, 585, 20833, 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, 1206, 812, 12, 2890, 16, 80, 4293, 4672, 3536, 3581, 326, 585, 261, 454, 21545, 13, 628, 5235, 17219, 471, 585, 20833, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
[('http://testserver/account/login/?from_offsite=True&next=%2F%2Bprojects%2FMyproject%3Fwanna_help%3Dtrue', 302)])
[('http://testserver/account/login/?next=%2F%2Bprojects%2FMyproject%3Fwanna_help%3Dtrue', 302)]) lucky_projects = mysite.project.controllers.get_wanna_help_queue_from_session(self.client.session) self.assertEqual(lucky_projects, ['Twisted'])
def test(self): # Steps for this test # 1. User POSTs to the wannahelp POST handler, indicating the request came from offsite # 2. User is redirected to a login page that knows the request came from offsite project_id = Project.create_dummy(name='Myproject').id
6b91ed21bf2fb273ccaa95c3e587795124b1552f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/6b91ed21bf2fb273ccaa95c3e587795124b1552f/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 12, 2890, 4672, 468, 7780, 1121, 364, 333, 1842, 468, 404, 18, 2177, 5485, 87, 358, 326, 341, 1072, 69, 5201, 5485, 1838, 16, 11193, 326, 590, 22497, 628, 21174, 1137, 468, 576, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 468, 7780, 1121, 364, 333, 1842, 468, 404, 18, 2177, 5485, 87, 358, 326, 341, 1072, 69, 5201, 5485, 1838, 16, 11193, 326, 590, 22497, 628, 21174, 1137, 468, 576, ...
self.disconnect(viewer, qt.PYSIGNAL("mouseReleased"),
self.disconnect(self.viewer, qt.PYSIGNAL("mouseReleased"),
def disconnectViewer(self): viewer = self.parent().viewer self.disconnect(viewer, qt.PYSIGNAL("mousePressed"), self.mousePressed) self.disconnect(viewer, qt.PYSIGNAL("mousePosition"), self.mouseMoved) self.disconnect(viewer, qt.PYSIGNAL("mouseReleased"), self.mouseReleased) self.disconnect(self.viewer, qt.PYSIGNAL("mouseDoubleClicked"), self.mouseDoubleClicked) self.viewer.removeOverlay(self.overlayIndex)
65254bc446b7c353066fe806e0424030a38d558d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/65254bc446b7c353066fe806e0424030a38d558d/tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9479, 18415, 12, 2890, 4672, 14157, 273, 365, 18, 2938, 7675, 25256, 365, 18, 20177, 12, 25256, 16, 25672, 18, 16235, 11260, 1013, 2932, 11697, 24624, 6, 3631, 365, 18, 11697, 24624, 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, 9479, 18415, 12, 2890, 4672, 14157, 273, 365, 18, 2938, 7675, 25256, 365, 18, 20177, 12, 25256, 16, 25672, 18, 16235, 11260, 1013, 2932, 11697, 24624, 6, 3631, 365, 18, 11697, 24624, 13, ...
if lr_aaaa_hit is not None:
if lr_aaaa_hit is not None and (not gp.prefix or g1['questions'][0][0].startswith(gp.prefix)):
def hip_cache_lookup(gp, g1): lr = None qname = g1['questions'][0][0] qtype = g1['questions'][0][1]
b110f03bfd90a3506ff3e2ed821f1c19b9aabf16 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6933/b110f03bfd90a3506ff3e2ed821f1c19b9aabf16/dnsproxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 366, 625, 67, 2493, 67, 8664, 12, 6403, 16, 314, 21, 4672, 12226, 273, 599, 12621, 273, 314, 21, 3292, 9758, 3546, 63, 20, 6362, 20, 65, 28056, 273, 314, 21, 3292, 9758, 3546, 63, 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, 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, 625, 67, 2493, 67, 8664, 12, 6403, 16, 314, 21, 4672, 12226, 273, 599, 12621, 273, 314, 21, 3292, 9758, 3546, 63, 20, 6362, 20, 65, 28056, 273, 314, 21, 3292, 9758, 3546, 63, 20...
gl.RGBmode() gl.gconfig()
self.set_rgbmode()
def initcolormap(self): self.colormapinited = 1 self.color0 = None self.fixcolor0 = 0 if self.format in ('rgb', 'jpeg', 'compress'): self.set_rgbmode() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return # This only works on an Entry-level Indigo from IRIX 4.0.5 if self.format == 'rgb8' and is_entry_indigo() and \ gl.gversion() == 'GL4DLG-4.0.': # Note trailing '.'! gl.RGBmode() gl.gconfig() gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() gl.pixmode(GL.PM_SIZE, 8) return self.set_cmode() self.skipchrom = 0 if self.offset == 0: self.mask = 0x7ff else: self.mask = 0xfff if not self.quiet: sys.stderr.write('Initializing color map...') self._initcmap() gl.clear() if not self.quiet: sys.stderr.write(' Done.\n')
b1a5afa1c5e01fd8ca8c53cf97ce4b6d30a13ac8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b1a5afa1c5e01fd8ca8c53cf97ce4b6d30a13ac8/VFile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 1293, 18804, 12, 2890, 4672, 365, 18, 1293, 18804, 2738, 329, 273, 404, 365, 18, 3266, 20, 273, 599, 365, 18, 904, 3266, 20, 273, 374, 309, 365, 18, 2139, 316, 7707, 10948, 2187,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 1293, 18804, 12, 2890, 4672, 365, 18, 1293, 18804, 2738, 329, 273, 404, 365, 18, 3266, 20, 273, 599, 365, 18, 904, 3266, 20, 273, 374, 309, 365, 18, 2139, 316, 7707, 10948, 2187,...
parser.add_option ("-t", "--tag", dest="action",
parser.add_option ("-t", "--tag", dest="action",
def parse_args (): from optparse import OptionParser parser = OptionParser ("usage: %prog [optoins] name") parser.add_option ("-A", "--ACE", dest="project", action="store_const", help="Branch/tag only ACE", default=None, const="ace") parser.add_option ("-T", "--TAO", dest="project", action="store_const", help="Branch/tag ACE and TAO", default=None, const="tao") parser.add_option ("-C", "--CIAO", dest="project", action="store_const", help="Branch/tag ACE, TAO, and CIAO", default=None, const="ciao") parser.add_option ("-t", "--tag", dest="action", help="Create a tag", action="store_true", default=None) parser.add_option ("-b", "--branch", dest="action", action="store_false", help="Create a branch", default=None) parser.add_option ("-v", "--verbose", dest="verbose", action="store_true", help="Print out verbose debugging output", default=False) parser.add_option ("-s", "--svn", dest="svn", default="svn", help="Full path to svn binary, if not in path") parser.add_option ("-r", "--repo", dest="repo", default="https://svn.dre.vanderbilt.edu/DOC/Middleware/", help="Repository to use, defaults to s.d.v.e/DOC/Middleware.") parser.add_option ("--src", dest="source", default="trunk/", help="Path in repository from which to branch, defaults to trunk") parser.add_option ("--dest", dest="dest", default="", help="Specifies a subdirectory of branches or tags in which " + "to place the new branch/tag. dest must already exist.") parser.add_option ("-n", dest="take_action", action="store_false", default=True, help="Take no action") (opts, args) = parser.parse_args () if len(args) != 1: parser.error ("must specify exactly one branch or tag name") if opts.action is None: parser.error ("must specify either a branch or tag action") if opts.project is None: parser.error ("must specity a project to branch") return (opts, args)
008f3d68a8f4b0ff9dc390e6ab79cedebd1a1902 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5660/008f3d68a8f4b0ff9dc390e6ab79cedebd1a1902/sets-manager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 1968, 1832, 30, 628, 2153, 2670, 1930, 18862, 225, 2082, 273, 18862, 7566, 9167, 30, 738, 14654, 306, 3838, 9896, 65, 508, 7923, 2082, 18, 1289, 67, 3482, 7566, 17, 37, 3113, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1968, 1832, 30, 628, 2153, 2670, 1930, 18862, 225, 2082, 273, 18862, 7566, 9167, 30, 738, 14654, 306, 3838, 9896, 65, 508, 7923, 2082, 18, 1289, 67, 3482, 7566, 17, 37, 3113, ...
var asyncObj; var async_count = 0;
var async_oblist = [null,null,null,null,null]; var async_idstack= [0,1,2,3,4];
def async_lib(): s = r"""
c9cf38403af89793f6ab350abce3831e50990956 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/c9cf38403af89793f6ab350abce3831e50990956/js.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4326, 67, 2941, 13332, 272, 273, 436, 8395, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 4326, 67, 2941, 13332, 272, 273, 436, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
def python_docs(self, event=None): self.display_docs(self.help_url)
def python_docs(self, event=None): os.startfile(self.help_url) else: def python_docs(self, event=None): self.display_docs(self.help_url)
def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') textView.TextViewer(self.top,'Help',fn)
255f07576451ddb33018b1cc161cc5ce8750ad00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/255f07576451ddb33018b1cc161cc5ce8750ad00/EditorWindow.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2809, 67, 12730, 12, 2890, 16, 871, 33, 7036, 4672, 2295, 33, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 5113, 803, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 13, 3631, 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, 2809, 67, 12730, 12, 2890, 16, 871, 33, 7036, 4672, 2295, 33, 538, 18, 803, 18, 5701, 12, 538, 18, 803, 18, 5113, 803, 12, 538, 18, 803, 18, 12287, 12, 972, 768, 972, 13, 3631, 11,...
res = self.__makeDirs(baseDir)
res = self.__makeDirs( baseDir )
def addFile(self, lfn): res = self.__checkArgumentFormat(lfn) if not res['OK']: return res lfns = res['Value'] created = self.__openSession() failed = {} successful = {} baseDirs = [] for lfn in lfns.keys(): baseDir = os.path.dirname(lfn) if baseDir in baseDirs: continue baseDirs.append(baseDir) res = self.__executeOperation(baseDir,'exists') # If we failed to find out whether the directory exists if not res['OK']: continue # If the directory exists if res['Value']: continue #Make the directories recursively if needed res = self.__makeDirs(baseDir) # If we failed to make the directory for the file if not res['OK']: continue lfc.lfc_umask(0000) for lfnList in breakListIntoChunks(sortList(lfns.keys()),1000): fileChunk = [] for lfn in lfnList: lfnInfo = lfns[lfn] pfn = lfnInfo['PFN'] size = lfnInfo['Size'] se = lfnInfo['SE'] guid = lfnInfo['GUID'] checksum = lfnInfo['Checksum'] res = self.__checkAddFile(lfn,pfn,size,se,guid,checksum) if not res['OK']: failed[lfn] = res['Message'] lfnList.remove(lfn) elif not res['Value']: successful[lfn] = True lfnList.remove(lfn) else: oFile = lfc.lfc_filereg() oFile.lfn = "%s/%s" % (self.prefix,lfn) oFile.sfn = pfn oFile.size = size oFile.mode = 0664 oFile.server = se oFile.guid = guid oFile.csumtype = 'AD' oFile.status = 'U' oFile.csumvalue = lfnInfo['Checksum'] fileChunk.append(oFile) if not fileChunk: continue value, errCodes = lfc.lfc_registerfiles(fileChunk) if (value != 0) or (len(errCodes) != len(lfnList)): for lfn in lfnList: failed[lfn] = lfc.sstrerror(lfc.cvar.serrno) continue for index in range(len(errCodes)): lfn = lfnList[index] errCode = errCodes[index] if errCode == 0: successful[lfn] = True elif errCode == 17: failed[lfn] = "The supplied GUID is already used" res = self.__getLfnForGUID(guid) if res['OK']: failed[lfn] = "The supplied GUID is already used by %s" % res['Value'] else: failed[lfn] = lfc.sstrerror(errCode) if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict)
6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18671, 12, 2890, 16, 328, 4293, 4672, 400, 273, 365, 16186, 1893, 1379, 1630, 12, 80, 4293, 13, 309, 486, 400, 3292, 3141, 3546, 30, 327, 400, 18594, 2387, 273, 400, 3292, 620, 3546, 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, 18671, 12, 2890, 16, 328, 4293, 4672, 400, 273, 365, 16186, 1893, 1379, 1630, 12, 80, 4293, 13, 309, 486, 400, 3292, 3141, 3546, 30, 327, 400, 18594, 2387, 273, 400, 3292, 620, 3546, 2...
if self.browser:
if self.flags() & gtk.REALIZED: self.browser_window.resize(rect.width, rect.height)
def do_size_allocate(self, rect): gtk.DrawingArea.do_size_allocate(self, rect) if self.browser: self.browser.resize(0, 0, rect.width, rect.height)
f46fbbc3f3595c9f649caaeca6edffbd919aeefb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/f46fbbc3f3595c9f649caaeca6edffbd919aeefb/browser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1467, 67, 16247, 12, 2890, 16, 4917, 4672, 22718, 18, 26885, 5484, 18, 2896, 67, 1467, 67, 16247, 12, 2890, 16, 4917, 13, 309, 365, 18, 7133, 1435, 473, 22718, 18, 31052, 2413...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1467, 67, 16247, 12, 2890, 16, 4917, 4672, 22718, 18, 26885, 5484, 18, 2896, 67, 1467, 67, 16247, 12, 2890, 16, 4917, 13, 309, 365, 18, 7133, 1435, 473, 22718, 18, 31052, 2413...
grass_interface = GRASSInterface.get_g()
grass_interface = grass.get_g()
def main(argv): global simulations # Do a migration of model repository data if len(argv) > 0 and argv[0] == 'migrate': do_migration(argv[1:]) # Otherwise start up normally mdig_config = config.get_config() logger = setupLogger(mdig_config["LOGGING"]["ansi"]) the_action = process_options(argv) signal.signal(signal.SIGINT, exit_catcher) # Load model repository if the_action.repository is not None: mdig_config["GRASS"]["GISDBASE"] = the_action.repository if the_action.location is not None: mdig_config["GRASS"]["LOCATION_NAME"] = the_action.location if the_action.init_repository: mdig.repository = ModelRepository.ModelRepository() models = mdig.repository.get_models() if the_action.init_grass: # Check for grass environment and set up interface grass_interface = GRASSInterface.get_g() if the_action.preload == True: # Load model definition if the_action.model_names is not None: # check that there is only one model for preload assert(len(the_action.model_names) == 1) m_name = the_action.model_names[0] if m_name not in models: logger.error("Model " + m_name + " doesn't exist in repository") sys.exit(mdig.mdig_exit_codes["model_not_found"]) model_xml_file = models[m_name] exp = DispersalModel.DispersalModel(model_xml_file, the_action) simulations.append(exp) else: logger.error ("No model file specified") sys.exit(mdig.mdig_exit_codes["model_not_found"]) if the_action is not None: the_action.do_me(exp) else: the_action.do_me(None) exit_cleanup() logger.debug("Exiting")
c22a8ac1e03674fc59fdff540e6ae0c2d85dd773 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10332/c22a8ac1e03674fc59fdff540e6ae0c2d85dd773/mdig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 2552, 3142, 21011, 225, 468, 2256, 279, 6333, 434, 938, 3352, 501, 309, 562, 12, 19485, 13, 405, 374, 471, 5261, 63, 20, 65, 422, 296, 22083, 4278, 741, 67, 1574...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2552, 3142, 21011, 225, 468, 2256, 279, 6333, 434, 938, 3352, 501, 309, 562, 12, 19485, 13, 405, 374, 471, 5261, 63, 20, 65, 422, 296, 22083, 4278, 741, 67, 1574...
else: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() if self.notebook.get_current_page() == self.TAB_STREAMS: self.UIManager.get_widget('/mainmenu/newmenu/').show() self.UIManager.get_widget('/mainmenu/editmenu/').show()
elif self.notebook.get_current_page() == self.TAB_PLAYLISTS: if self.playlists_selection.count_selected_rows() > 0: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() elif self.notebook.get_current_page() == self.TAB_STREAMS: if self.streams_selection.count_selected_rows() > 0: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() if self.streams_selection.count_selected_rows() == 1: self.UIManager.get_widget('/mainmenu/editmenu/').show() self.UIManager.get_widget('/mainmenu/newmenu/').show()
def set_menu_contextual_items_visible(self): self.set_menu_contextual_items_hidden() if not self.expanded: return elif self.notebook.get_current_page() == self.TAB_CURRENT: self.UIManager.get_widget('/mainmenu/removemenu/').show() self.UIManager.get_widget('/mainmenu/clearmenu/').show() self.UIManager.get_widget('/mainmenu/savemenu/').show() elif self.notebook.get_current_page() == self.TAB_LIBRARY: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/updatemenu/').show() else: self.UIManager.get_widget('/mainmenu/addmenu/').show() self.UIManager.get_widget('/mainmenu/replacemenu/').show() self.UIManager.get_widget('/mainmenu/rmmenu/').show() if self.notebook.get_current_page() == self.TAB_STREAMS: self.UIManager.get_widget('/mainmenu/newmenu/').show() self.UIManager.get_widget('/mainmenu/editmenu/').show()
8cbdded67d2cd4af1d043eab95abc449dd591f9b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/8cbdded67d2cd4af1d043eab95abc449dd591f9b/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 5414, 67, 2472, 1462, 67, 3319, 67, 8613, 12, 2890, 4672, 365, 18, 542, 67, 5414, 67, 2472, 1462, 67, 3319, 67, 6345, 1435, 309, 486, 365, 18, 17336, 30, 327, 1327, 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, 444, 67, 5414, 67, 2472, 1462, 67, 3319, 67, 8613, 12, 2890, 4672, 365, 18, 542, 67, 5414, 67, 2472, 1462, 67, 3319, 67, 6345, 1435, 309, 486, 365, 18, 17336, 30, 327, 1327, 365, 18,...
sage: P=E.gens()[0]
sage: P=E(0,0)
def saturation(self, points, verbose=False, max_prime=0, odd_primes_only=False): """ Given a list of rational points on E, compute the saturation in E(Q) of the subgroup they generate.
bf7393ec4e994ba1f0bb9856cc425fe42f6a9e80 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/bf7393ec4e994ba1f0bb9856cc425fe42f6a9e80/ell_rational_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22824, 12, 2890, 16, 3143, 16, 3988, 33, 8381, 16, 943, 67, 16382, 33, 20, 16, 14800, 67, 683, 4485, 67, 3700, 33, 8381, 4672, 3536, 16803, 279, 666, 434, 436, 8371, 3143, 603, 512, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22824, 12, 2890, 16, 3143, 16, 3988, 33, 8381, 16, 943, 67, 16382, 33, 20, 16, 14800, 67, 683, 4485, 67, 3700, 33, 8381, 4672, 3536, 16803, 279, 666, 434, 436, 8371, 3143, 603, 512, ...
print items[i]; i+=1
b = items[i]; i+=1
def tightloop_example(): items = range(0, 3) try: i = 0 while 1: print items[i]; i+=1 except IndexError: pass
a6afedc3ad0dabc629733ae27db699c9428b52d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a6afedc3ad0dabc629733ae27db699c9428b52d6/test_trace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26066, 6498, 67, 8236, 13332, 1516, 273, 1048, 12, 20, 16, 890, 13, 775, 30, 277, 273, 374, 1323, 404, 30, 324, 273, 1516, 63, 77, 15533, 277, 15, 33, 21, 1335, 10195, 30, 1342, 225,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26066, 6498, 67, 8236, 13332, 1516, 273, 1048, 12, 20, 16, 890, 13, 775, 30, 277, 273, 374, 1323, 404, 30, 324, 273, 1516, 63, 77, 15533, 277, 15, 33, 21, 1335, 10195, 30, 1342, 225,...
sage: cut.add_edges(edges) sage: cut.is_isomorphic(graphs.StarGraph(4))
sage: cut.add_edges(edges) sage: cut.is_isomorphic(graphs.StarGraph(4))
def edge_connectivity(self, value_only=True, use_edge_labels=False, vertices=False, solver=None, verbose=0): r""" Returns the edge connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_. INPUT:
5e5675fbbda4b56d6c68a34b01203655c16cdb9e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/5e5675fbbda4b56d6c68a34b01203655c16cdb9e/generic_graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3591, 67, 3612, 2818, 12, 2890, 16, 460, 67, 3700, 33, 5510, 16, 999, 67, 7126, 67, 5336, 33, 8381, 16, 6928, 33, 8381, 16, 12776, 33, 7036, 16, 3988, 33, 20, 4672, 436, 8395, 2860, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3591, 67, 3612, 2818, 12, 2890, 16, 460, 67, 3700, 33, 5510, 16, 999, 67, 7126, 67, 5336, 33, 8381, 16, 6928, 33, 8381, 16, 12776, 33, 7036, 16, 3988, 33, 20, 4672, 436, 8395, 2860, ...
print 'from django_evolution.mutation import *'
print 'from django_evolution.mutations import *'
def handle(self, *app_labels, **options): verbosity = int(options['verbosity']) interactive = options['interactive'] execute = options['execute'] compile_sql = options['compile_sql'] hint = options['hint'] # Use the list of all apps, unless app labels are specified. if app_labels: if execute: raise CommandError('Cannot specify an application name when executing evolutions.') try: app_list = [get_app(app_label) for app_label in app_labels] except (ImproperlyConfigured, ImportError), e: raise CommandError("%s. Are you sure your INSTALLED_APPS setting is correct?" % e) else: app_list = get_apps()
0a65f70fa7d6ee95fb782de10ef93e6530d77de1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8377/0a65f70fa7d6ee95fb782de10ef93e6530d77de1/evolve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 380, 2910, 67, 5336, 16, 2826, 2116, 4672, 11561, 273, 509, 12, 2116, 3292, 16629, 8807, 19486, 12625, 273, 702, 3292, 24761, 3546, 1836, 273, 702, 3292, 8837, 3546, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 380, 2910, 67, 5336, 16, 2826, 2116, 4672, 11561, 273, 509, 12, 2116, 3292, 16629, 8807, 19486, 12625, 273, 702, 3292, 24761, 3546, 1836, 273, 702, 3292, 8837, 3546, ...
remove_paths.add(path)
paths_to_remove.add(path)
def uninstall(self, auto_confirm=False): assert self.check_if_exists(), "Cannot uninstall requirement %s, not installed" % (self.name,) dist = self.satisfied_by remove_paths = set() remove_from_easy_install_pth = set() easy_install_pth = os.path.join(lib_py, os.path.join('site-packages', 'easy-install.pth'))
83f9d9c18b33d7eaefd25541ebfcc8eb4c825233 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/83f9d9c18b33d7eaefd25541ebfcc8eb4c825233/pip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16577, 12, 2890, 16, 3656, 67, 10927, 33, 8381, 4672, 1815, 365, 18, 1893, 67, 430, 67, 1808, 9334, 315, 4515, 16577, 12405, 738, 87, 16, 486, 5876, 6, 738, 261, 2890, 18, 529, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16577, 12, 2890, 16, 3656, 67, 10927, 33, 8381, 4672, 1815, 365, 18, 1893, 67, 430, 67, 1808, 9334, 315, 4515, 16577, 12405, 738, 87, 16, 486, 5876, 6, 738, 261, 2890, 18, 529, 16, 1...
label = NomGene+AjouteZero(i)+"-"
label = NomGene+"-"+AjouteZero(i)
def AjouteZero(n): N = str(n) a = [] for i in range(len(N),4): a.append("0") a.append(N) return "".join(a)
500e50f615961d0b243097de80bb4b7c3c0febd5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5108/500e50f615961d0b243097de80bb4b7c3c0febd5/liste_exo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 432, 78, 2571, 7170, 12, 82, 4672, 423, 273, 609, 12, 82, 13, 279, 273, 5378, 364, 277, 316, 1048, 12, 1897, 12, 50, 3631, 24, 4672, 279, 18, 6923, 2932, 20, 7923, 279, 18, 6923, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 432, 78, 2571, 7170, 12, 82, 4672, 423, 273, 609, 12, 82, 13, 279, 273, 5378, 364, 277, 316, 1048, 12, 1897, 12, 50, 3631, 24, 4672, 279, 18, 6923, 2932, 20, 7923, 279, 18, 6923, 1...
main(sys.argv)
yacc.parse(file(sys.argv[1]).read()) """ def tokid(s): """turn a string into a python identifier >>> tokid(u'TOK_STRING_LITERAL_2') u'STRING_LITERAL_2' >>> tokid(u'@a') u'x40a' """ r = '' if s.startswith("TOK_"): s = s[4:] for c in s: if c == '_' or (r == '' and c.isalpha()) or c.isalnum(): r = r + c else: r = r + 'x%x' % ord(c) return r.encode('us-ascii') def _test(): import doctest doctest.testmod() if __name__ == '__main__': import sys if '--test' in sys.argv: _test() else: main(sys.argv)
def toYacc(it): print """
bd068ec24eaf23bc0bd0bf3ff78a8e7679367e0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/bd068ec24eaf23bc0bd0bf3ff78a8e7679367e0a/gramLL1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 61, 8981, 12, 305, 4672, 1172, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 61, 8981, 12, 305, 4672, 1172, 3536, 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,...
file.write(line + "\n")
file.write(line + b'\n')
def getlongresp(self, file=None): """Internal: get a response plus following text from the server. Raise various errors if the response indicates an error."""
17de0ac39e028b8777529030dfc984cdf592a543 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/17de0ac39e028b8777529030dfc984cdf592a543/nntplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5748, 12243, 12, 2890, 16, 585, 33, 7036, 4672, 3536, 3061, 30, 336, 279, 766, 8737, 3751, 977, 628, 326, 1438, 18, 20539, 11191, 1334, 309, 326, 766, 8527, 392, 555, 12123, 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, 336, 5748, 12243, 12, 2890, 16, 585, 33, 7036, 4672, 3536, 3061, 30, 336, 279, 766, 8737, 3751, 977, 628, 326, 1438, 18, 20539, 11191, 1334, 309, 326, 766, 8527, 392, 555, 12123, 2, -1...
child = self.resource.getChildWithDefault("foo", turtle.Turtle())
child = self.resource.getChildWithDefault("testname", turtle.Turtle())
def test_get_job(self): """Test that we can find a specific job""" child = self.resource.getChildWithDefault("foo", turtle.Turtle()) assert isinstance(child, www.JobResource) assert child._job is self.job
5bfafc8826bc4e716e3c80a74020727711431a9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14977/5bfafc8826bc4e716e3c80a74020727711431a9b/www_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 588, 67, 4688, 12, 2890, 4672, 3536, 4709, 716, 732, 848, 1104, 279, 2923, 1719, 8395, 1151, 273, 365, 18, 3146, 18, 588, 1763, 24502, 2932, 3813, 529, 3113, 268, 295, 5929, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 588, 67, 4688, 12, 2890, 4672, 3536, 4709, 716, 732, 848, 1104, 279, 2923, 1719, 8395, 1151, 273, 365, 18, 3146, 18, 588, 1763, 24502, 2932, 3813, 529, 3113, 268, 295, 5929, ...
def handle_launch_configuration(sumo_command, launch_xml_string, client_socket, keep_temp):
def handle_launch_configuration(sumo_command, shlex, launch_xml_string, client_socket, keep_temp):
def handle_launch_configuration(sumo_command, launch_xml_string, client_socket, keep_temp): """ Process launch configuration in launch_xml_string. """ # create temporary directory logging.debug("Creating temporary directory...") runpath = tempfile.mkdtemp(prefix="sumo-launchd-tmp-") if not runpath: raise RuntimeError("Could not create temporary directory") if not os.path.exists(runpath): raise RuntimeError('Temporary directory "%s" does not exist, even though it should have been created' % runpath) logging.debug("Temporary dir is %s" % runpath) result_xml = None unused_port_lock = UnusedPortLock() try: # parse launch configuration (basedir, copy_nodes, seed) = parse_launch_configuration(launch_xml_string) # find remote_port logging.debug("Finding free port number...") unused_port_lock.__enter__() remote_port = find_unused_port() logging.debug("...found port %d" % remote_port) # copy (and modify) files config_file_name = copy_and_modify_files(basedir, copy_nodes, runpath, remote_port, seed) # run SUMO result_xml = run_sumo(runpath, sumo_command, config_file_name, remote_port, seed, client_socket, unused_port_lock, keep_temp) finally: unused_port_lock.__exit__() # clean up if not keep_temp: logging.debug("Cleaning up") shutil.rmtree(runpath) else: logging.debug("Not cleaning up %s" % runpath) logging.debug('Result: "%s"' % result_xml) return result_xml
6b13c373057a765e123909544eca271ecae92757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3656/6b13c373057a765e123909544eca271ecae92757/sumo-launchd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 20738, 67, 7025, 12, 1364, 83, 67, 3076, 16, 27180, 16, 8037, 67, 2902, 67, 1080, 16, 1004, 67, 7814, 16, 3455, 67, 5814, 4672, 3536, 4389, 8037, 1664, 316, 8037, 67, 2902, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 20738, 67, 7025, 12, 1364, 83, 67, 3076, 16, 27180, 16, 8037, 67, 2902, 67, 1080, 16, 1004, 67, 7814, 16, 3455, 67, 5814, 4672, 3536, 4389, 8037, 1664, 316, 8037, 67, 2902, ...
if not os.path.exists(os.path.split(destination)[0]): os.makedirs(destination)
if not destination: destination = os.path.abspath(os.curdir) destdir = os.path.split(destination)[0] if not os.path.isabs(destdir): destdir = os.path.join(os.path.abspath(os.curdir), destdir) self._info(destdir) if not os.path.exists(destdir): os.makedirs(destdir)
def _create_missing_local_dirs(self, destination): if not os.path.exists(os.path.split(destination)[0]): os.makedirs(destination) return
dd709a82932deb39224b979717482cc9e1c4b1d4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6575/dd709a82932deb39224b979717482cc9e1c4b1d4/abstractclient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 7337, 67, 3729, 67, 8291, 12, 2890, 16, 2929, 4672, 309, 486, 2929, 30, 2929, 273, 1140, 18, 803, 18, 5113, 803, 12, 538, 18, 1397, 1214, 13, 1570, 1214, 273, 1140, 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, 389, 2640, 67, 7337, 67, 3729, 67, 8291, 12, 2890, 16, 2929, 4672, 309, 486, 2929, 30, 2929, 273, 1140, 18, 803, 18, 5113, 803, 12, 538, 18, 1397, 1214, 13, 1570, 1214, 273, 1140, 18...
if exppart: expo = eval(exppart[1:])
if exppart: expo = int(exppart[1:])
def extract(s): res = decoder.match(s) if res is None: raise NotANumber, s sign, intpart, fraction, exppart = res.group(1,2,3,4) if sign == '+': sign = '' if fraction: fraction = fraction[1:] if exppart: expo = eval(exppart[1:]) else: expo = 0 return sign, intpart, fraction, expo
fd6d50fa6cdff930d2bbd4ec679d47b1f030bc56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/fd6d50fa6cdff930d2bbd4ec679d47b1f030bc56/fpformat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 12, 87, 4672, 400, 273, 8320, 18, 1916, 12, 87, 13, 309, 400, 353, 599, 30, 1002, 2288, 1258, 1226, 16, 272, 1573, 16, 509, 2680, 16, 8330, 16, 1329, 2680, 273, 400, 18, 1655, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2608, 12, 87, 4672, 400, 273, 8320, 18, 1916, 12, 87, 13, 309, 400, 353, 599, 30, 1002, 2288, 1258, 1226, 16, 272, 1573, 16, 509, 2680, 16, 8330, 16, 1329, 2680, 273, 400, 18, 1655, ...
Subwidgets Class ---------- ----- fsbox ExFileSelectBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixExFileSelectDialog', ['options'], cnf, kw) self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')
Subwidgets Class ---------- ----- fsbox ExFileSelectBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixExFileSelectDialog', ['options'], cnf, kw) self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')
def invoke(self):
b0e44d61d9e592e1acd6aa05eac9704ba5776f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b0e44d61d9e592e1acd6aa05eac9704ba5776f61/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
version="0.6.5",
version=long_version,
def glob_to(prefix, new_prefix, dirs): if prefix and prefix[-1]!='/': prefix += '/' return list([(new_prefix+'/'+dir, glob_(prefix, dir+'/*')) for dir in dirs])
2a1e42d6e4a958facae10ff4b01b12daf5bf0f0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13148/2a1e42d6e4a958facae10ff4b01b12daf5bf0f0e/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4715, 67, 869, 12, 3239, 16, 394, 67, 3239, 16, 7717, 4672, 309, 1633, 471, 1633, 18919, 21, 65, 5, 2218, 2473, 30, 1633, 1011, 2023, 327, 666, 3816, 12, 2704, 67, 3239, 6797, 2473, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4715, 67, 869, 12, 3239, 16, 394, 67, 3239, 16, 7717, 4672, 309, 1633, 471, 1633, 18919, 21, 65, 5, 2218, 2473, 30, 1633, 1011, 2023, 327, 666, 3816, 12, 2704, 67, 3239, 6797, 2473, ...
if len(matches) > 0:
if matches != []:
def parse_plugin_name(self): self.parse_dbg_indent += " " buff = self.buffer.strip() self.pdbg("parse_plugin_name buff=%s" % buff) plugin_match = re_plugin.match(buff) if plugin_match: plugin_name = C.cname(plugin_match.group(1)) self.pdbg("parse_plugin_name name=%s" % plugin_name) pos = plugin_match.span(2)[1] self.buffer = buff[pos:].lstrip() matches = self.expand_filename(plugin_name) if len(matches) > 0: plugin_name = matches.pop(0) self.pdbg("parse_plugin_name new name=%s" % plugin_name) if len(matches) > 0: self.buffer = " ".join(matches) + " " + self.buffer return(True, plugin_name) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(False, plugin_name) else: self.parse_error(_["expected a plugin name"]) self.parse_dbg_indent = self.parse_dbg_indent[:-2] return(None, None)
07c6564afc09f1eae18d93180e08f3e41b8bb49e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2827/07c6564afc09f1eae18d93180e08f3e41b8bb49e/mlox.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4094, 67, 529, 12, 2890, 4672, 365, 18, 2670, 67, 1966, 75, 67, 9355, 1011, 315, 225, 315, 6139, 273, 365, 18, 4106, 18, 6406, 1435, 365, 18, 17414, 75, 2932, 2670, 67, 409...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4094, 67, 529, 12, 2890, 4672, 365, 18, 2670, 67, 1966, 75, 67, 9355, 1011, 315, 225, 315, 6139, 273, 365, 18, 4106, 18, 6406, 1435, 365, 18, 17414, 75, 2932, 2670, 67, 409...
@param factory: a twisted.internet.protocol.ServerFactory instance
@param factory: a L{twisted.internet.protocol.ServerFactory} instance
def listenTCP(self, port, factory, backlog=5, interface=''): """Connects a given protocol factory to the given numeric TCP/IP port.
2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/2049631dd0aa73ddfc33a2c3c8f41078e4f4fcf8/interfaces.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6514, 13891, 12, 2890, 16, 1756, 16, 3272, 16, 1473, 1330, 33, 25, 16, 1560, 2218, 11, 4672, 3536, 21500, 279, 864, 1771, 3272, 358, 326, 864, 6389, 9911, 19, 2579, 1756, 18, 2, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6514, 13891, 12, 2890, 16, 1756, 16, 3272, 16, 1473, 1330, 33, 25, 16, 1560, 2218, 11, 4672, 3536, 21500, 279, 864, 1771, 3272, 358, 326, 864, 6389, 9911, 19, 2579, 1756, 18, 2, -100, ...
self.conn.send.command_list_begin()
def updatedb_path(self, action): if self.conn: if self.notebook.get_current_page() == self.TAB_LIBRARY: model, selected = self.browser_selection.get_selected_rows() iters = [model.get_iter(path) for path in selected] if len(iters) > 0: # If there are selected rows, update these paths.. self.conn.send.command_list_begin() for iter in iters: self.conn.send.update(self.browserdata.get_value(iter, 1)) self.conn.do.command_list_end() else: # If no selection, update the current path... self.conn.do.update(self.browser.wd) self.iterate_now()
0da9815c248298a9268c10f25c59ea81e5bd319d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/0da9815c248298a9268c10f25c59ea81e5bd319d/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3526, 70, 67, 803, 12, 2890, 16, 1301, 4672, 309, 365, 18, 4646, 30, 309, 365, 18, 24422, 18, 588, 67, 2972, 67, 2433, 1435, 422, 365, 18, 28899, 67, 2053, 28254, 30, 938, 16, 3170, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3526, 70, 67, 803, 12, 2890, 16, 1301, 4672, 309, 365, 18, 4646, 30, 309, 365, 18, 24422, 18, 588, 67, 2972, 67, 2433, 1435, 422, 365, 18, 28899, 67, 2053, 28254, 30, 938, 16, 3170, ...
self.netdev_id[vlan])
self.netdev_id[vlan], nic_params.get("nic_extra_params"))
def add_no_hpet(help): if has_option(help, "no-hpet"): return " -no-hpet" else: return ""
7a790c7cbd000c7a970c2f75e90fe4792b77a9a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/7a790c7cbd000c7a970c2f75e90fe4792b77a9a1/kvm_vm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 2135, 67, 76, 6951, 12, 5201, 4672, 309, 711, 67, 3482, 12, 5201, 16, 315, 2135, 17, 76, 6951, 6, 4672, 327, 315, 300, 2135, 17, 76, 6951, 6, 469, 30, 327, 1408, 2, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 2135, 67, 76, 6951, 12, 5201, 4672, 309, 711, 67, 3482, 12, 5201, 16, 315, 2135, 17, 76, 6951, 6, 4672, 327, 315, 300, 2135, 17, 76, 6951, 6, 469, 30, 327, 1408, 2, -100, ...
slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd
slice1 = (slice(None),)*nd slice2 = (slice(None),)*nd
def simps(y, x=None, dx=1, axis=-1, even='avg'): """Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of intervals. The parameter 'even' controls how this is handled as follows: even='avg': Average two results: 1) use the first N-2 intervals with a trapezoidal rule on the last interval and 2) use the last N-2 intervals with a trapezoidal rule on the first interval even='first': Use Simpson's rule for the first N-2 intervals with a trapezoidal rule on the last interval. even='last': Use Simpson's rule for the last N-2 intervals with a trapezoidal rule on the first interval. For an odd number of samples that are equally spaced the result is exact if the function is a polynomial of order 3 or less. If the samples are not equally spaced, then the result is exact only if the function is a polynomial of order 2 or less. """ y = asarray(y) nd = len(y.shape) N = y.shape[axis] last_dx = dx first_dx = dx returnshape = 0 if not x is None: x = asarray(x) if len(x.shape) == 1: shapex = ones(nd) shapex[axis] = x.shape[0] saveshape = x.shape returnshape = 1 x=x.reshape(tuple(shapex)) elif len(x.shape) != len(y.shape): raise ValueError, "If given, shape of x must be 1-d or the " \ "same as y." if x.shape[axis] != N: raise ValueError, "If given, length of x along axis must be the " \ "same as y." if N % 2 == 0: val = 0.0 result = 0.0 slice1 = [slice(None)]*nd slice2 = [slice(None)]*nd if not even in ['avg', 'last', 'first']: raise ValueError, \ "Parameter 'even' must be 'avg', 'last', or 'first'." # Compute using Simpson's rule on first intervals if even in ['avg', 'first']: slice1[axis] = -1 slice2[axis] = -2 if not x is None: last_dx = x[slice1] - x[slice2] val += 0.5*last_dx*(y[slice1]+y[slice2]) result = _basic_simps(y,0,N-3,x,dx,axis) # Compute using Simpson's rule on last set of intervals if even in ['avg', 'last']: slice1[axis] = 0 slice2[axis] = 1 if not x is None: first_dx = x[slice2] - x[slice1] val += 0.5*first_dx*(y[slice2]+y[slice1]) result += _basic_simps(y,1,N-2,x,dx,axis) if even == 'avg': val /= 2.0 result /= 2.0 result = result + val else: result = _basic_simps(y,0,N-2,x,dx,axis) if returnshape: x = x.reshape(saveshape) return result
704696cd1cef533b4e608563919a4d4ce035a41b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/704696cd1cef533b4e608563919a4d4ce035a41b/quadrature.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3142, 1121, 12, 93, 16, 619, 33, 7036, 16, 6633, 33, 21, 16, 2654, 29711, 21, 16, 5456, 2218, 14141, 11, 4672, 3536, 11476, 340, 677, 12, 92, 13, 1450, 5216, 7563, 326, 864, 2654, 47...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3142, 1121, 12, 93, 16, 619, 33, 7036, 16, 6633, 33, 21, 16, 2654, 29711, 21, 16, 5456, 2218, 14141, 11, 4672, 3536, 11476, 340, 677, 12, 92, 13, 1450, 5216, 7563, 326, 864, 2654, 47...
cfg.SetDiskID(device, node)
lu.cfg.SetDiskID(device, node)
def _CreateBlockDevOnSecondary(cfg, node, instance, device, force, info): """Create a tree of block devices on a secondary node. If this device type has to be created on secondaries, create it and all its children. If not, just recurse to children keeping the same 'force' value. """ if device.CreateOnSecondary(): force = True if device.children: for child in device.children: if not _CreateBlockDevOnSecondary(cfg, node, instance, child, force, info): return False if not force: return True cfg.SetDiskID(device, node) new_id = rpc.call_blockdev_create(node, device, device.size, instance.name, False, info) if not new_id: return False if device.physical_id is None: device.physical_id = new_id return True
b9bddb6bdf7ac5841c732845ce0122c64bb026b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b9bddb6bdf7ac5841c732845ce0122c64bb026b1/cmdlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1684, 1768, 8870, 1398, 14893, 12, 7066, 16, 756, 16, 791, 16, 2346, 16, 2944, 16, 1123, 4672, 3536, 1684, 279, 2151, 434, 1203, 7166, 603, 279, 9946, 756, 18, 225, 971, 333, 2346...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1684, 1768, 8870, 1398, 14893, 12, 7066, 16, 756, 16, 791, 16, 2346, 16, 2944, 16, 1123, 4672, 3536, 1684, 279, 2151, 434, 1203, 7166, 603, 279, 9946, 756, 18, 225, 971, 333, 2346...
class Range:
"""
def range(*a): if len(a) == 1: start, stop, step = 0, a[0], 1 elif len(a) == 2: start, stop = a step = 1 elif len(a) == 3: start, stop, step = a else: raise TypeError, 'range() needs 1-3 arguments' return Range(start, stop, step)
3ab29ecc760b20e6913507a63404a08c886d81b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3ab29ecc760b20e6913507a63404a08c886d81b5/Range.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1048, 30857, 69, 4672, 309, 562, 12, 69, 13, 422, 404, 30, 787, 16, 2132, 16, 2235, 273, 374, 16, 279, 63, 20, 6487, 404, 1327, 562, 12, 69, 13, 422, 576, 30, 787, 16, 2132, 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, 1048, 30857, 69, 4672, 309, 562, 12, 69, 13, 422, 404, 30, 787, 16, 2132, 16, 2235, 273, 374, 16, 279, 63, 20, 6487, 404, 1327, 562, 12, 69, 13, 422, 576, 30, 787, 16, 2132, 273, ...
from email.Header import Header v = Header(v, 'utf-8').encode()
from binascii import b2a_base64 v = '=?utf-8?b?%s?=' % b2a_base64(v.encode('utf-8')).strip('\n')
def send_headers(self): """Assert, process, and send the HTTP response message-headers.""" hkeys = [key.lower() for key, value in self.outheaders] status = int(self.status[:3]) if status == 413: # Request Entity Too Large. Close conn to avoid garbage. self.close_connection = True elif "content-length" not in hkeys: # "All 1xx (informational), 204 (no content), # and 304 (not modified) responses MUST NOT # include a message-body." So no point chunking. if status < 200 or status in (204, 205, 304): pass else: if (self.response_protocol == 'HTTP/1.1' and self.environ["REQUEST_METHOD"] != 'HEAD'): # Use the chunked transfer-coding self.chunked_write = True self.outheaders.append(("Transfer-Encoding", "chunked")) else: # Closing the conn is the only way to determine len. self.close_connection = True if "connection" not in hkeys: if self.response_protocol == 'HTTP/1.1': # Both server and client are HTTP/1.1 or better if self.close_connection: self.outheaders.append(("Connection", "close")) else: # Server and/or client are HTTP/1.0 if not self.close_connection: self.outheaders.append(("Connection", "Keep-Alive")) if (not self.close_connection) and (not self.chunked_read): # Read any remaining request body data on the socket. # "If an origin server receives a request that does not include an # Expect request-header field with the "100-continue" expectation, # the request includes a request body, and the server responds # with a final status code before reading the entire request body # from the transport connection, then the server SHOULD NOT close # the transport connection until it has read the entire request, # or until the client closes the connection. Otherwise, the client # might not reliably receive the response message. However, this # requirement is not be construed as preventing a server from # defending itself against denial-of-service attacks, or from # badly broken client implementations." size = self.rfile.maxlen - self.rfile.bytes_read if size > 0: self.rfile.read(size) if "date" not in hkeys: self.outheaders.append(("Date", rfc822.formatdate())) if "server" not in hkeys: self.outheaders.append(("Server", self.environ['SERVER_SOFTWARE'])) buf = [self.environ['ACTUAL_SERVER_PROTOCOL'], " ", self.status, "\r\n"] try: for k, v in self.outheaders: k = k.encode("ISO-8859-1") # HTTP/1.0 says, "Words of *TEXT may contain octets # from character sets other than US-ASCII." and # "Recipients of header field TEXT containing octets # outside the US-ASCII character set may assume that # they represent ISO-8859-1 characters." try: v = v.encode("ISO-8859-1") except UnicodeEncodeError: if self.response_protocol == "HTTP/1.1": # Encode RFC-2047 TEXT # (e.g. u"\u8200" -> "=?utf-8?b?6IiA?="). from email.Header import Header v = Header(v, 'utf-8').encode() else: raise buf += [k + ": " + v + "\r\n"] except TypeError: if not isinstance(k, str): raise TypeError("WSGI response header key %r is not a string.") if not isinstance(v, str): raise TypeError("WSGI response header value %r is not a string.") else: raise buf.append("\r\n") self.wfile.sendall("".join(buf))
b56bfd00f28a52ce2fad993f383784d6aee2464f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/82/b56bfd00f28a52ce2fad993f383784d6aee2464f/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 2485, 12, 2890, 4672, 3536, 8213, 16, 1207, 16, 471, 1366, 326, 2239, 766, 883, 17, 2485, 12123, 366, 2452, 273, 306, 856, 18, 8167, 1435, 364, 498, 16, 460, 316, 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, 1366, 67, 2485, 12, 2890, 4672, 3536, 8213, 16, 1207, 16, 471, 1366, 326, 2239, 766, 883, 17, 2485, 12123, 366, 2452, 273, 306, 856, 18, 8167, 1435, 364, 498, 16, 460, 316, 365, 18, ...
mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid)
mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid)
def convert(_db, _host, _user, _password, _env, _force): activityFields = FieldTranslator() # account for older versions of bugzilla print "Using Bugzilla v%s schema." % BZ_VERSION if BZ_VERSION == 2110: activityFields['removed'] = "oldvalue" activityFields['added'] = "newvalue" # init Bugzilla environment print "Bugzilla MySQL('%s':'%s':'%s':'%s'): connecting..." % \ (_db, _host, _user, ("*" * len(_password))) mysql_con = MySQLdb.connect(host=_host, user=_user, passwd=_password, db=_db, compress=1, cursorclass=MySQLdb.cursors.DictCursor) mysql_cur = mysql_con.cursor() # init Trac environment print "Trac SQLite('%s'): connecting..." % (_env) trac = TracDatabase(_env) # force mode... if _force == 1: print "\nCleaning all tickets..." c = trac.db().cursor() c.execute("DELETE FROM ticket_change") trac.db().commit() c.execute("DELETE FROM ticket") trac.db().commit() c.execute("DELETE FROM attachment") attachments_dir = os.path.join(os.path.normpath(trac.env.path), "attachments") # Straight from the Python documentation. for root, dirs, files in os.walk(attachments_dir, topdown=False): for name in files: os.remove(os.path.join(root, name)) for name in dirs: os.rmdir(os.path.join(root, name)) if not os.stat(attachments_dir): os.mkdir(attachments_dir) trac.db().commit() print "All tickets cleaned..." print "\n0. Filtering products..." mysql_cur.execute("SELECT name FROM products") products = [] for line in mysql_cur.fetchall(): product = line['name'] if PRODUCTS and product not in PRODUCTS: continue if product in IGNORE_PRODUCTS: continue products.append(product) PRODUCTS[:] = products print " Using products", " ".join(PRODUCTS) print "\n1. Import severities..." trac.setSeverityList(SEVERITIES) print "\n2. Import components..." if not COMPONENTS_FROM_PRODUCTS: if BZ_VERSION >= 2180: sql = """SELECT DISTINCT c.name AS name, c.initialowner AS owner FROM components AS c, products AS p WHERE c.product_id = p.id AND""" sql += makeWhereClause('p.name', PRODUCTS) else: sql = "SELECT value AS name, initialowner AS owner FROM components" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) components = mysql_cur.fetchall() for component in components: component['owner'] = trac.getLoginName(mysql_cur, component['owner']) trac.setComponentList(components, 'name') else: sql = """SELECT program AS product, value AS comp, initialowner AS owner FROM components""" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) lines = mysql_cur.fetchall() all_components = {} # product -> components all_owners = {} # product, component -> owner for line in lines: product = line['product'] comp = line['comp'] owner = line['owner'] all_components.setdefault(product, []).append(comp) all_owners[(product, comp)] = owner component_list = [] for product, components in all_components.items(): # find best default owner default = None for comp in DEFAULT_COMPONENTS: if comp in components: default = comp break if default is None: default = components[0] owner = all_owners[(product, default)] owner_name = trac.getLoginName(mysql_cur, owner) component_list.append({'product': product, 'owner': owner_name}) trac.setComponentList(component_list, 'product') print "\n3. Import priorities..." trac.setPriorityList(PRIORITIES) print "\n4. Import versions..." if BZ_VERSION >= 2180: sql = """SELECT DISTINCTROW versions.value AS value FROM products, versions""" sql += " WHERE" + makeWhereClause('products.name', PRODUCTS) else: sql = "SELECT DISTINCTROW value FROM versions" sql += " WHERE" + makeWhereClause('program', PRODUCTS) mysql_cur.execute(sql) versions = mysql_cur.fetchall() trac.setVersionList(versions, 'value') print "\n5. Import milestones..." sql = "SELECT DISTINCT value FROM milestones" sql += " WHERE" + makeWhereClause('value', IGNORE_MILESTONES, negative=True) mysql_cur.execute(sql) milestones = mysql_cur.fetchall() trac.setMilestoneList(milestones, 'value') print "\n6. Retrieving bugs..." sql = """SELECT DISTINCT b.*, c.name AS component, p.name AS product FROM bugs AS b, components AS c, products AS p """ sql += " WHERE (" + makeWhereClause('p.name', PRODUCTS) sql += ") AND b.product_id = p.id" sql += " AND b.component_id = c.id" sql += " ORDER BY b.bug_id" mysql_cur.execute(sql) bugs = mysql_cur.fetchall() print "\n7. Import bugs and bug activity..." for bug in bugs: bugid = bug['bug_id'] ticket = {} keywords = [] ticket['id'] = bugid ticket['time'] = bug['creation_ts'] ticket['changetime'] = bug['delta_ts'] if COMPONENTS_FROM_PRODUCTS: ticket['component'] = bug['product'] else: ticket['component'] = bug['component'] ticket['severity'] = bug['bug_severity'] ticket['priority'] = bug['priority'].lower() ticket['owner'] = trac.getLoginName(mysql_cur, bug['assigned_to']) ticket['reporter'] = trac.getLoginName(mysql_cur, bug['reporter']) mysql_cur.execute("SELECT * FROM cc WHERE bug_id = %s", bugid) cc_records = mysql_cur.fetchall() cc_list = [] for cc in cc_records: cc_list.append(trac.getLoginName(mysql_cur, cc['who'])) cc_list = [cc for cc in cc_list if '@' in cc and cc not in IGNORE_CC] ticket['cc'] = string.join(cc_list, ', ') ticket['version'] = bug['version'] target_milestone = bug['target_milestone'] if target_milestone in IGNORE_MILESTONES: target_milestone = '' ticket['milestone'] = target_milestone bug_status = bug['bug_status'].lower() ticket['status'] = statusXlator[bug_status] ticket['resolution'] = bug['resolution'].lower() # a bit of extra work to do open tickets if bug_status == 'open': if owner != '': ticket['status'] = 'assigned' else: ticket['status'] = 'new' ticket['summary'] = bug['short_desc'] mysql_cur.execute("SELECT * FROM longdescs WHERE bug_id = %s" % bugid) longdescs = list(mysql_cur.fetchall()) # check for empty 'longdescs[0]' field... if len(longdescs) == 0: ticket['description'] = '' else: ticket['description'] = longdescs[0]['thetext'] del longdescs[0] for desc in longdescs: ignore = False for comment in IGNORE_COMMENTS: if re.match(comment, desc['thetext']): ignore = True if ignore: continue trac.addTicketComment(ticket=bugid, time = desc['bug_when'], author=trac.getLoginName(mysql_cur, desc['who']), value = desc['thetext']) mysql_cur.execute("""SELECT * FROM bugs_activity WHERE bug_id = %s ORDER BY bug_when""" % bugid) bugs_activity = mysql_cur.fetchall() resolution = '' ticketChanges = [] keywords = [] for activity in bugs_activity: field_name = trac.getFieldName(mysql_cur, activity['fieldid']).lower() removed = activity[activityFields['removed']] added = activity[activityFields['added']] # statuses and resolutions are in lowercase in trac if field_name == "resolution" or field_name == "bug_status": removed = removed.lower() added = added.lower() # remember most recent resolution, we need this later if field_name == "resolution": resolution = added.lower() add_keywords = [] remove_keywords = [] # convert bugzilla field names... if field_name == "bug_severity": field_name = "severity" elif field_name == "assigned_to": field_name = "owner" elif field_name == "bug_status": field_name = "status" if removed in STATUS_KEYWORDS: remove_keywords.append(STATUS_KEYWORDS[removed]) if added in STATUS_KEYWORDS: add_keywords.append(STATUS_KEYWORDS[added]) added = statusXlator[added] removed = statusXlator[removed] elif field_name == "short_desc": field_name = "summary" elif field_name == "product" and COMPONENTS_FROM_PRODUCTS: field_name = "component" elif ((field_name == "product" and not COMPONENTS_FROM_PRODUCTS) or (field_name == "component" and COMPONENTS_FROM_PRODUCTS)): if MAP_ALL_KEYWORDS or removed in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(removed, removed) if kw: remove_keywords.append(kw) if MAP_ALL_KEYWORDS or added in KEYWORDS_MAPPING: kw = KEYWORDS_MAPPING.get(added, added) if kw: add_keywords.append(kw) if field_name == "component": # just keep the keyword change added = removed = "" elif field_name == "target_milestone": field_name = "milestone" if added in IGNORE_MILESTONES: added = "" if removed in IGNORE_MILESTONES: removed = "" ticketChange = {} ticketChange['ticket'] = bugid ticketChange['time'] = activity['bug_when'] ticketChange['author'] = trac.getLoginName(mysql_cur, activity['who']) ticketChange['field'] = field_name ticketChange['oldvalue'] = removed ticketChange['newvalue'] = added if add_keywords or remove_keywords: # ensure removed ones are in old old_keywords = keywords + [kw for kw in remove_keywords if kw not in keywords] # remove from new keywords = [kw for kw in keywords if kw not in remove_keywords] # add to new keywords += [kw for kw in add_keywords if kw not in keywords] if old_keywords != keywords: ticketChangeKw = ticketChange.copy() ticketChangeKw['field'] = "keywords" ticketChangeKw['oldvalue'] = ' '.join(old_keywords) ticketChangeKw['newvalue'] = ' '.join(keywords) ticketChanges.append(ticketChangeKw) if field_name in IGNORED_ACTIVITY_FIELDS: continue # Skip changes that have no effect (think translation!). if added == removed: continue # Bugzilla splits large summary changes into two records. for oldChange in ticketChanges: if (field_name == "summary" and oldChange['field'] == ticketChange['field'] and oldChange['time'] == ticketChange['time'] and oldChange['author'] == ticketChange['author']): oldChange['oldvalue'] += " " + ticketChange['oldvalue'] oldChange['newvalue'] += " " + ticketChange['newvalue'] break # cc sometime appear in different activities with same time if (field_name == "cc" \ and oldChange['time'] == ticketChange['time']): oldChange['newvalue'] += ", " + ticketChange['newvalue'] break else: ticketChanges.append (ticketChange) for ticketChange in ticketChanges: trac.addTicketChange (**ticketChange) # For some reason, bugzilla v2.11 seems to clear the resolution # when you mark a bug as closed. Let's remember it and restore # it if the ticket is closed but there's no resolution. if not ticket['resolution'] and ticket['status'] == "closed": ticket['resolution'] = resolution bug_status = bug['bug_status'] if bug_status in STATUS_KEYWORDS: kw = STATUS_KEYWORDS[bug_status] if kw not in keywords: keywords.append(kw) product = bug['product'] if product in KEYWORDS_MAPPING and not COMPONENTS_FROM_PRODUCTS: kw = KEYWORDS_MAPPING.get(product, product) if kw and kw not in keywords: keywords.append(kw) component = bug['component'] if (COMPONENTS_FROM_PRODUCTS and \ (MAP_ALL_KEYWORDS or component in KEYWORDS_MAPPING)): kw = KEYWORDS_MAPPING.get(component, component) if kw and kw not in keywords: keywords.append(kw) ticket['keywords'] = string.join(keywords) ticketid = trac.addTicket(**ticket) mysql_cur.execute("SELECT * FROM attachments WHERE bug_id = %s" % bugid) attachments = mysql_cur.fetchall() for a in attachments: author = trac.getLoginName(mysql_cur, a['submitter_id']) trac.addAttachment(author, a) print "\n8. Importing users and passwords..." if BZ_VERSION >= 2180: mysql_cur.execute("SELECT login_name, cryptpassword FROM profiles") users = mysql_cur.fetchall() htpasswd = file("htpasswd", 'w') for user in users: if LOGIN_MAP.has_key(user['login_name']): login = LOGIN_MAP[user['login_name']] else: login = user['login_name'] htpasswd.write(login + ":" + user['cryptpassword'] + "\n") htpasswd.close() print " Bugzilla users converted to htpasswd format, see 'htpasswd'." print "\nAll tickets converted."
96cc24322ea11500094f96e7b8dc5b0c7e85d253 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/96cc24322ea11500094f96e7b8dc5b0c7e85d253/bugzilla2trac.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1765, 24899, 1966, 16, 389, 2564, 16, 389, 1355, 16, 389, 3664, 16, 389, 3074, 16, 389, 5734, 4672, 5728, 2314, 273, 2286, 12233, 1435, 225, 468, 2236, 364, 12156, 5244, 434, 7934, 15990...
ctx.find_program('vlib', var='VLIB', mandatory=True)
ctx.find_program('vlib', var='VLIB', mandatory=True, okmsg="ok")
def configure(ctx): """Detect modelsim executables and set default flags""" ctx.find_program('vlib', var='VLIB', mandatory=True) ctx.env['VLIBFLAGS'] = [] ctx.find_program('vsim', var='VSIM', mandatory=True) ctx.env['VSIMFLAGS'] = ['-quiet'] ctx.find_program('sccom', var='SCCOM', mandatory=True) ctx.env['SCCOMFLAGS'] = ['-nologo'] ctx.env['SCLINKFLAGS'] = ['-nologo'] ctx.find_program('scgenmod', var='SCGENMOD', mandatory=True) ctx.env['SCGENMODFLAGS'] = [] ctx.env['SCGENMODMAP'] = ['-bool', '-map', "std_logic_vector=sc_uint", '-createtemplate'] ctx.find_program('vcom', var='VCOM', mandatory=True) ctx.env['VCOMFLAGS'] = ['-quiet'] ctx.find_program('vlog', var='VLOG', mandatory=True) ctx.env['VLOGFLAGS'] = ['-quiet']
7c31064d730fec5e3b83aa4842fea01bd5df60db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/209/7c31064d730fec5e3b83aa4842fea01bd5df60db/modelsim.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 5900, 4672, 3536, 12081, 3679, 381, 28743, 1538, 471, 444, 805, 2943, 8395, 1103, 18, 4720, 67, 12890, 2668, 90, 2941, 2187, 569, 2218, 58, 14484, 2187, 11791, 33, 5510, 16, 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, 5068, 12, 5900, 4672, 3536, 12081, 3679, 381, 28743, 1538, 471, 444, 805, 2943, 8395, 1103, 18, 4720, 67, 12890, 2668, 90, 2941, 2187, 569, 2218, 58, 14484, 2187, 11791, 33, 5510, 16, 15...
t1.create()
metadata.create_all()
def test_default_exec(self): metadata = MetaData(testing.db) t1 = Table('t1', metadata, Column(u'special_col', Integer, Sequence('special_col'), primary_key=True), Column('data', String(50)) # to appease SQLite without DEFAULT VALUES ) t1.create()
1a352c69f9c66bdc7ef90ecaffcc0c65b5911073 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/1a352c69f9c66bdc7ef90ecaffcc0c65b5911073/test_unicode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1886, 67, 4177, 12, 2890, 4672, 1982, 273, 27512, 12, 3813, 310, 18, 1966, 13, 268, 21, 273, 3555, 2668, 88, 21, 2187, 1982, 16, 4753, 12, 89, 1807, 705, 649, 67, 1293, 218...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1886, 67, 4177, 12, 2890, 4672, 1982, 273, 27512, 12, 3813, 310, 18, 1966, 13, 268, 21, 273, 3555, 2668, 88, 21, 2187, 1982, 16, 4753, 12, 89, 1807, 705, 649, 67, 1293, 218...
str1 = cur_root.toString()
str1 = cur_root and cur_root.toString() or -1
def addServiceToBouquet(self, dest, service=None): mutableList = self.getMutableList(dest) if not mutableList is None: if service is None: #use current selected service service = self.servicelist.getCurrent() if not mutableList.addService(service): self.bouquetNumOffsetCache = { } mutableList.flushChanges() # do some voodoo to check if current_root is equal to dest cur_root = self.getRoot(); str1 = cur_root.toString() str2 = dest.toString() pos1 = str1.find("FROM BOUQUET") pos2 = str2.find("FROM BOUQUET") if pos1 != -1 and pos2 != -1 and str1[pos1:] == str2[pos2:]: self.servicelist.addService(service)
c88273c34d261ad897dbb507dbaf5c9cb38f741f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/c88273c34d261ad897dbb507dbaf5c9cb38f741f/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 1179, 774, 38, 1395, 28357, 12, 2890, 16, 1570, 16, 1156, 33, 7036, 4672, 16074, 682, 273, 365, 18, 588, 19536, 682, 12, 10488, 13, 309, 486, 16074, 682, 353, 599, 30, 309, 1156, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1179, 774, 38, 1395, 28357, 12, 2890, 16, 1570, 16, 1156, 33, 7036, 4672, 16074, 682, 273, 365, 18, 588, 19536, 682, 12, 10488, 13, 309, 486, 16074, 682, 353, 599, 30, 309, 1156, ...
fo = open(test_support.TESTFN, "wb")
fo = open(test_support.TESTFN, "w")
def test_cyclical_print(self): w = ReprWrapper() s = self.thetype([w]) w.value = s try: fo = open(test_support.TESTFN, "wb") fo.write(str(s)) fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), repr(s)) finally: fo.close() os.remove(test_support.TESTFN)
e6109d53f7d5b1be9e4c6f2ff568e5f7e02a6e99 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/e6109d53f7d5b1be9e4c6f2ff568e5f7e02a6e99/test_set.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2431, 830, 1706, 67, 1188, 12, 2890, 4672, 341, 273, 868, 683, 3611, 1435, 272, 273, 365, 18, 451, 5872, 3816, 91, 5717, 341, 18, 1132, 273, 272, 775, 30, 18261, 273, 1696, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2431, 830, 1706, 67, 1188, 12, 2890, 4672, 341, 273, 868, 683, 3611, 1435, 272, 273, 365, 18, 451, 5872, 3816, 91, 5717, 341, 18, 1132, 273, 272, 775, 30, 18261, 273, 1696, ...
raise TypeError, "Oops! There are no quadratic non-residues in Z/2Z."
raise ValueError, "Oops! There are no quadratic non-residues in Z/2Z."
def quadratic_nonresidue(p): """ Returns the smalest positive integer quadratic non-residue in Z/pZ for primes p>2. EXAMPLES: sage: quadratic_nonresidue(5) 2 """ p1 = abs(p) ## Deal with the prime p = 2 and |p| <= 1. if p1 == 2: raise TypeError, "Oops! There are no quadratic non-residues in Z/2Z." if p1 < 2: raise TypeError, "Oops! p must be a prime number > 2." ## TO DO: Test that p is prime??? ## Find the smallest non-residue mod p for r in range(2,p): if legendre_symbol(r, p) == -1: return r
ceab3cfbf6ff8fdeda42c6808a031582899ac19b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ceab3cfbf6ff8fdeda42c6808a031582899ac19b/extras.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26146, 67, 5836, 23388, 12, 84, 4672, 3536, 2860, 326, 3029, 287, 395, 6895, 3571, 26146, 1661, 17, 23388, 316, 2285, 19, 84, 62, 364, 846, 4485, 293, 34, 22, 18, 225, 5675, 8900, 1138...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 26146, 67, 5836, 23388, 12, 84, 4672, 3536, 2860, 326, 3029, 287, 395, 6895, 3571, 26146, 1661, 17, 23388, 316, 2285, 19, 84, 62, 364, 846, 4485, 293, 34, 22, 18, 225, 5675, 8900, 1138...