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
self.append = self.__append return self.append(value, txn=txn)
return self.__append(value, txn=txn)
def append(self, value, txn=None): if self.get_type() == db.DB_RECNO: self.append = self.__append return self.append(value, txn=txn) raise DBShelveError, "append() only supported when dbshelve opened with filetype=dbshelve.db.DB_RECNO"
b3f5cb4c3601fdf050cb7a82ba097070e2f7ec0a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/b3f5cb4c3601fdf050cb7a82ba097070e2f7ec0a/dbshelve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 460, 16, 7827, 33, 7036, 4672, 309, 365, 18, 588, 67, 723, 1435, 422, 1319, 18, 2290, 67, 862, 39, 3417, 30, 327, 365, 16186, 6923, 12, 1132, 16, 7827, 33, 24790, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 714, 12, 2890, 16, 460, 16, 7827, 33, 7036, 4672, 309, 365, 18, 588, 67, 723, 1435, 422, 1319, 18, 2290, 67, 862, 39, 3417, 30, 327, 365, 16186, 6923, 12, 1132, 16, 7827, 33, 24790, ...
print "BLAH! %s" % child
def OnChildFocus(self, evt): # If the child window that gets the focus is not visible, # this handler will try to scroll enough to see it. evt.Skip() child = evt.GetWindow() print "BLAH! %s" % child
83d6f4a718588b9b4fd3dc0b49383aaa47f1ca47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/83d6f4a718588b9b4fd3dc0b49383aaa47f1ca47/nextpanel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 1763, 9233, 12, 2890, 16, 6324, 4672, 468, 971, 326, 1151, 2742, 716, 5571, 326, 7155, 353, 486, 6021, 16, 468, 333, 1838, 903, 775, 358, 5532, 7304, 358, 2621, 518, 18, 6324, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 1763, 9233, 12, 2890, 16, 6324, 4672, 468, 971, 326, 1151, 2742, 716, 5571, 326, 7155, 353, 486, 6021, 16, 468, 333, 1838, 903, 775, 358, 5532, 7304, 358, 2621, 518, 18, 6324, 18...
for i in requires: req = (RPMRequires, i[0], i[1], i[2]) reqdict[req] = True
for n, r, v, f in requires: if f: reqdict[(PreReq, n, r, v)] = True else: reqdict[(Req, n, r, v)] = True
def load(self):
4d3c7d9bafafd2f5ac28bbd15a108c5d05aacc78 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/4d3c7d9bafafd2f5ac28bbd15a108c5d05aacc78/synthesis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 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, 1262, 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, -...
wpadrivercombo.set_active(i) if not found:
if found: wpadrivercombo.set_active(user_driver_index) else:
def settings_dialog(self, widget, event=None): """ Displays a general settings dialog. """ dialog = self.wTree.get_widget("pref_dialog") dialog.set_title(language['preferences']) wiredcheckbox = self.wTree.get_widget("pref_always_check") wiredcheckbox.set_label(language['wired_always_on']) wiredcheckbox.set_active(wired.GetAlwaysShowWiredInterface()) reconnectcheckbox = self.wTree.get_widget("pref_auto_check") reconnectcheckbox.set_label(language['auto_reconnect']) reconnectcheckbox.set_active(daemon.GetAutoReconnect())
9f9ac656877ef7388b181959e2467d6cdd0a2a4d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12280/9f9ac656877ef7388b181959e2467d6cdd0a2a4d/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1947, 67, 12730, 12, 2890, 16, 3604, 16, 871, 33, 7036, 4672, 3536, 9311, 87, 279, 7470, 1947, 6176, 18, 3536, 6176, 273, 365, 18, 91, 2471, 18, 588, 67, 6587, 2932, 25724, 67, 12730, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1947, 67, 12730, 12, 2890, 16, 3604, 16, 871, 33, 7036, 4672, 3536, 9311, 87, 279, 7470, 1947, 6176, 18, 3536, 6176, 273, 365, 18, 91, 2471, 18, 588, 67, 6587, 2932, 25724, 67, 12730, ...
self.assertRaises(TypeError, b.rsplit)
def test_rsplit_whitespace(self): for b in (b' arf barf ', b'arf\tbarf', b'arf\nbarf', b'arf\rbarf', b'arf\fbarf', b'arf\vbarf'): self.assertEqual(b.rsplit(), [b'arf', b'barf']) self.assertEqual(b.rsplit(None), [b'arf', b'barf']) self.assertEqual(b.rsplit(None, 2), [b'arf', b'barf']) self.assertEqual(b' a bb c '.rsplit(None, 0), [b' a bb c']) self.assertEqual(b' a bb c '.rsplit(None, 1), [b' a bb', b'c']) self.assertEqual(b' a bb c '.rsplit(None,2), [b' a', b'bb', b'c']) self.assertEqual(b' a bb c '.rsplit(None, 3), [b'a', b'bb', b'c']) def test_rplit_buffer(self): self.assertEqual(b'a b'.rsplit(buffer(b' ')), [b'a', b'b']) def test_rplit_string_error(self): self.assertRaises(TypeError, b'a b'.rsplit, ' ')
def test_rsplit(self): b = b'mississippi' self.assertEqual(b.rsplit(b'i'), [b'm', b'ss', b'ss', b'pp', b'']) self.assertEqual(b.rsplit(b'ss'), [b'mi', b'i', b'ippi']) self.assertEqual(b.rsplit(b'w'), [b]) # require an arg (no magic whitespace split) self.assertRaises(TypeError, b.rsplit)
ac09bb4c20f2d4657ae4dcfdb21964f8e862a01d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/ac09bb4c20f2d4657ae4dcfdb21964f8e862a01d/test_bytes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 86, 4939, 12, 2890, 4672, 324, 273, 324, 17784, 1054, 1054, 625, 7259, 11, 365, 18, 11231, 5812, 12, 70, 18, 86, 4939, 12, 70, 11, 77, 19899, 306, 70, 17784, 2187, 324, 180...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 86, 4939, 12, 2890, 4672, 324, 273, 324, 17784, 1054, 1054, 625, 7259, 11, 365, 18, 11231, 5812, 12, 70, 18, 86, 4939, 12, 70, 11, 77, 19899, 306, 70, 17784, 2187, 324, 180...
try:
if self.productionPolicy.exists("configuration"):
def configure(self, workflowVerbosity): self.logger.log(Log.DEBUG, "ProductionRunConfigurator:configure") self.repository = self.productionPolicy.get("repositoryDirectory")
821d793227fdc705d45de9279f1af55b6dcbb66d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6549/821d793227fdc705d45de9279f1af55b6dcbb66d/ProductionRunConfigurator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 2890, 16, 6095, 30594, 4672, 365, 18, 4901, 18, 1330, 12, 1343, 18, 9394, 16, 315, 31590, 1997, 17182, 30, 14895, 7923, 365, 18, 9071, 273, 365, 18, 17273, 2582, 18, 588, 293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5068, 12, 2890, 16, 6095, 30594, 4672, 365, 18, 4901, 18, 1330, 12, 1343, 18, 9394, 16, 315, 31590, 1997, 17182, 30, 14895, 7923, 365, 18, 9071, 273, 365, 18, 17273, 2582, 18, 588, 293...
fp = open(temp_filename, 'wt')
mode = 'w' if sys.platform not in ['cygwin']: mode += 't' fp = open(temp_filename, mode)
def setUp (self): fp = open(temp_filename, 'wt') fp.write(TEST_NETRC) fp.close() self.netrc = netrc.netrc(temp_filename)
4b396d0972f45074c76f334d35200f46e61a90a5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4b396d0972f45074c76f334d35200f46e61a90a5/test_netrc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 261, 2890, 4672, 1965, 273, 296, 91, 11, 309, 2589, 18, 9898, 486, 316, 10228, 2431, 75, 8082, 3546, 30, 1965, 1011, 296, 88, 11, 4253, 273, 1696, 12, 5814, 67, 3459, 16, 1965, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 261, 2890, 4672, 1965, 273, 296, 91, 11, 309, 2589, 18, 9898, 486, 316, 10228, 2431, 75, 8082, 3546, 30, 1965, 1011, 296, 88, 11, 4253, 273, 1696, 12, 5814, 67, 3459, 16, 1965, ...
self.journal_name,
journal_name,
def __call__(self, req, form): """ Maybe resolve the final / of a directory """ ## Support for legacy journal/[empty]?(args*) urls. There are ## these parameters only in that case argd = wash_urlargd(form, {'name': (str, ""), 'issue': (str, ""), 'category': (str, ""), 'ln': (str, CFG_SITE_LANG), 'number': (int, None), 'verbose': (int, 0)} )
bae57c8d54f081029ed46e6fc1bac54d5858c064 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/bae57c8d54f081029ed46e6fc1bac54d5858c064/webjournal_webinterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 14024, 2245, 326, 727, 342, 434, 279, 1867, 3536, 7541, 13619, 364, 8866, 13001, 19, 63, 5531, 26717, 12, 1968, 12437, 6903, 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, 1991, 972, 12, 2890, 16, 1111, 16, 646, 4672, 3536, 14024, 2245, 326, 727, 342, 434, 279, 1867, 3536, 7541, 13619, 364, 8866, 13001, 19, 63, 5531, 26717, 12, 1968, 12437, 6903, 18,...
'prop': ['revisions','info'], 'rvprop': ['content','ids','flags','timestamp','user','comment','size'],
'prop': ['revisions', 'info'], 'rvprop': ['content', 'ids', 'flags', 'timestamp', 'user', 'comment', 'size'],
def _getEditPage(self, get_redirect=False, throttle=True, sysop=False, oldid=None, change_edit_time=True): """Get the contents of the Page via API query
5fabd8503b611266414aae0bf6d41ae404fc33e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/5fabd8503b611266414aae0bf6d41ae404fc33e4/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 4666, 1964, 12, 2890, 16, 336, 67, 7590, 33, 8381, 16, 18304, 33, 5510, 16, 2589, 556, 33, 8381, 16, 1592, 350, 33, 7036, 16, 2549, 67, 4619, 67, 957, 33, 5510, 4672, 3536,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 4666, 1964, 12, 2890, 16, 336, 67, 7590, 33, 8381, 16, 18304, 33, 5510, 16, 2589, 556, 33, 8381, 16, 1592, 350, 33, 7036, 16, 2549, 67, 4619, 67, 957, 33, 5510, 4672, 3536,...
old_value = action.get_annotation_by_key('notes').value
def change_notes(self, notes, version_number): """ change_notes(notes:str, version_number) -> None Changes the notes of a version """ if self.actionMap.has_key(version_number): action = self.actionMap[version_number] old_value = action.get_annotation_by_key('notes').value annotation = Annotation(id=self.idScope.getNewId(Annotation.vtType), key='notes', value=notes) if action.has_annotation_with_key('notes'): old_annotation = action.get_annotation_by_key('notes') action.delete_annotation(old_annotation) if notes.strip() != '': action.add_annotation(annotation) self.changed = True
70f1bc6c9dbdabcf9cb7828c60be16341c10c4ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/70f1bc6c9dbdabcf9cb7828c60be16341c10c4ca/vistrail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 67, 12903, 12, 2890, 16, 10913, 16, 1177, 67, 2696, 4672, 3536, 2549, 67, 12903, 12, 12903, 30, 701, 16, 1177, 67, 2696, 13, 317, 599, 17776, 326, 10913, 434, 279, 1177, 225, 353...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2549, 67, 12903, 12, 2890, 16, 10913, 16, 1177, 67, 2696, 4672, 3536, 2549, 67, 12903, 12, 12903, 30, 701, 16, 1177, 67, 2696, 13, 317, 599, 17776, 326, 10913, 434, 279, 1177, 225, 353...
output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' ALTER COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) +self.style.SQL_KEYWORD(' SET NOT NULL;') )
output.append( self.style.SQL_KEYWORD('ALTER TABLE ') + \ self.style.SQL_TABLE(qn(table_name)) + \ self.style.SQL_KEYWORD(' ALTER COLUMN ') + \ self.style.SQL_FIELD(qn(col_name)) + \ self.style.SQL_KEYWORD(' SET NOT NULL;') )
def get_change_column_def_sql( self, table_name, col_name, col_type, f, column_flags ): output = [] output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' ADD COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name+'_tmp')) +' '+ self.style.SQL_KEYWORD(col_type) + ';' ) output.append( self.style.SQL_KEYWORD('UPDATE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' SET ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name+'_tmp')) +' = '+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) + ';' ) output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' DROP COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) +';' ) output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' RENAME COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name+'_tmp')) +self.style.SQL_KEYWORD(' TO ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) + ';' ) if f.default!=None and str(f.default) != 'django.db.models.fields.NOT_PROVIDED': output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' ALTER COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) +self.style.SQL_KEYWORD(' SET DEFAULT ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(str(f.default))) +';' ) if not f.null: output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' ALTER COLUMN ')+ self.style.SQL_FIELD(self.connection.ops.quote_name(col_name)) +self.style.SQL_KEYWORD(' SET NOT NULL;') ) if f.unique: output.append( self.style.SQL_KEYWORD('ALTER TABLE ')+ self.style.SQL_TABLE(self.connection.ops.quote_name(table_name)) +self.style.SQL_KEYWORD(' ADD CONSTRAINT ')+ table_name +'_'+ col_name +'_unique_constraint'+self.style.SQL_KEYWORD(' UNIQUE(')+ self.style.SQL_FIELD(col_name) +self.style.SQL_KEYWORD(')')+';' ) return output
9cdf745fd71e68b3b6453831cb634a4528ced824 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8472/9cdf745fd71e68b3b6453831cb634a4528ced824/postgresql.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3427, 67, 2827, 67, 536, 67, 4669, 12, 365, 16, 1014, 67, 529, 16, 645, 67, 529, 16, 645, 67, 723, 16, 284, 16, 1057, 67, 7133, 262, 30, 876, 273, 5378, 876, 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, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 3427, 67, 2827, 67, 536, 67, 4669, 12, 365, 16, 1014, 67, 529, 16, 645, 67, 529, 16, 645, 67, 723, 16, 284, 16, 1057, 67, 7133, 262, 30, 876, 273, 5378, 876, 18, 6923, 1...
if ((self.section == 'metaserver') or (self.doBuildPkg > 0)):
if (self.section == 'metaserver'):
def doInstall(self): fn = os.path.basename(self.packageFn) if ((self.section == 'metaserver') or (self.doBuildPkg > 0)): c = "scp -q %s kfsinstall.sh %s:/tmp/; ssh %s 'mv /tmp/%s /tmp/kfspkg.tgz; sh /tmp/kfsinstall.sh %s %s ' " % \ (self.packageFn, self.dest, self.dest, fn, self.mode, self.installArgs) else: # chunkserver configFn = os.path.basename(self.configOutputFn) c = "scp -q %s kfsinstall.sh %s %s:/tmp/; ssh %s 'mv /tmp/%s /tmp/kfspkg.tgz; mv /tmp/%s /tmp/ChunkServer.prp; sh /tmp/kfsinstall.sh %s %s ' " % \ (self.packageFn, self.configOutputFn, self.dest, self.dest, fn, configFn, self.mode, self.installArgs) os.system(c)
3afa15bce30408c1d558c9c7bec82e27f9d04e1b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4466/3afa15bce30408c1d558c9c7bec82e27f9d04e1b/kfssetup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 6410, 12, 2890, 4672, 2295, 273, 1140, 18, 803, 18, 13909, 12, 2890, 18, 5610, 5372, 13, 309, 261, 2890, 18, 3464, 422, 296, 10578, 345, 12330, 11, 4672, 276, 273, 315, 18461, 300...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6410, 12, 2890, 4672, 2295, 273, 1140, 18, 803, 18, 13909, 12, 2890, 18, 5610, 5372, 13, 309, 261, 2890, 18, 3464, 422, 296, 10578, 345, 12330, 11, 4672, 276, 273, 315, 18461, 300...
self.failUnlessEqual(3, getargs_I(3.14))
self.assertRaises(TypeError, getargs_I, 3.14)
def test_I(self): from _testcapi import getargs_I # I returns 'unsigned int', no range checking self.failUnlessEqual(3, getargs_I(3.14)) self.failUnlessEqual(99, getargs_I(Long())) self.failUnlessEqual(99, getargs_I(Int()))
c947123350b31d3fab7e4893eb87cb361125f549 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c947123350b31d3fab7e4893eb87cb361125f549/test_getargs2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 45, 12, 2890, 4672, 628, 389, 3813, 71, 2425, 1930, 336, 1968, 67, 45, 468, 467, 1135, 296, 22297, 509, 2187, 1158, 1048, 6728, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 33...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 45, 12, 2890, 4672, 628, 389, 3813, 71, 2425, 1930, 336, 1968, 67, 45, 468, 467, 1135, 296, 22297, 509, 2187, 1158, 1048, 6728, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 33...
if not exe_exists(execs[0]):
if not FileUtilities.exe_exists(execs[0]):
def __is_broken_xdg_desktop_application(config, desktop_pathname): """Returns boolean whether application deskop entry file is broken""" if not config.has_option('Desktop Entry', 'Exec'): print "info: is_broken_xdg_menu: missing required option 'Exec': '%s'" \ % (desktop_pathname) return True exe = config.get('Desktop Entry', 'Exec').split(" ")[0] if not exe_exists(exe): print "info: is_broken_xdg_menu: executable '%s' does not exist '%s'" \ % (exe, desktop_pathname) return True if 'env' == exe: # Wine v1.0 creates .desktop files like this # Exec=env WINEPREFIX="/home/z/.wine" wine "C:\\Program Files\\foo\\foo.exe" execs = shlex.split(config.get('Desktop Entry', 'Exec')) wineprefix = None del(execs[0]) while True: if 0 <= execs[0].find("="): (name, value) = execs[0].split("=") if 'WINEPREFIX' == name: wineprefix = value del(execs[0]) else: break if not exe_exists(execs[0]): print "info: is_broken_xdg_menu: executable '%s'" \ "does not exist '%s'" % (execs[0], desktop_pathname) return True # check the Windows executable exists if wineprefix: windows_exe = wine_to_linux_path(wineprefix, execs[1]) if not os.path.exists(windows_exe): print "info: is_broken_xdg_menu: Windows executable" \ "'%s' does not exist '%s'" % \ (windows_exe, desktop_pathname) return True return False
163c2eb4604041473a88a5cf8bac1cd2975a81c3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/163c2eb4604041473a88a5cf8bac1cd2975a81c3/Unix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 291, 67, 70, 19906, 67, 7669, 75, 67, 31949, 67, 3685, 12, 1425, 16, 21304, 67, 28336, 4672, 3536, 1356, 1250, 2856, 2521, 2832, 79, 556, 1241, 585, 353, 12933, 8395, 309, 486, 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, 1001, 291, 67, 70, 19906, 67, 7669, 75, 67, 31949, 67, 3685, 12, 1425, 16, 21304, 67, 28336, 4672, 3536, 1356, 1250, 2856, 2521, 2832, 79, 556, 1241, 585, 353, 12933, 8395, 309, 486, 6...
>>> print digest_message.as_string()
>>> print digest_message.as_string()
def consume_digest(self): digest = list(self.digest) del self.digest[:] return digest
f0b04506a5c04612b3f8b659e09d5165d893bbef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12308/f0b04506a5c04612b3f8b659e09d5165d893bbef/digest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7865, 67, 10171, 12, 2890, 4672, 5403, 273, 666, 12, 2890, 18, 10171, 13, 1464, 365, 18, 10171, 10531, 65, 327, 5403, 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, 7865, 67, 10171, 12, 2890, 4672, 5403, 273, 666, 12, 2890, 18, 10171, 13, 1464, 365, 18, 10171, 10531, 65, 327, 5403, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if relative_NA_rate==-1 and hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid relative_no_of_totals=0 between %s and %s.\n"%(col_id1, col_id2)) if mismatch_rate==-1 and hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid(non-NA) pairs between %s and %s.\n"%(col_id1, col_id2))
if relative_NA_rate==-1: counter_no_relative_valid_pairs += 1 """ if hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid relative_no_of_totals=0 between %s and %s.\n"%(col_id1, col_id2)) """ if mismatch_rate==-1: counter_no_valid_non_NA_pairs += 1 """ if hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid(non-NA) pairs between %s and %s.\n"%(col_id1, col_id2)) """
def cmp_col_wise(cls, data_matrix1, data_matrix2, col_id2col_index1, col_id2col_index2, col_id12col_id2, row_id2row_index1, \ row_id2row_index2, row_id12row_id2): """ 2008-05-12 return independent/relative NA_rate 2007-12-18 SNP wise 2007-12-20 make it more generic 2008-01-07 change the non_NA criteria from !=0 to >0. in 2010 data matrix, there's substantial amount of -2 (not tried). """ sys.stderr.write("Comparing col-wise for mismatches ...\n") col_id2NA_mismatch_rate = {} no_of_rows1 = len(data_matrix1) for col_id1, col_id2 in col_id12col_id2.iteritems(): col_index1 = col_id2col_index1[col_id1] col_index2 = col_id2col_index2[col_id2] NA_rate, no_of_NAs, no_of_totals = QualityControl.get_NA_rate_for_one_col(data_matrix1, col_index1) if NA_rate==-1 and hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid no_of_totals=0 between %s and %s.\n"%(col_id1, col_id2)) relative_NA_rate, mismatch_rate, relative_no_of_NAs, relative_no_of_totals, no_of_mismatches, no_of_non_NA_pairs = \ QualityControl.cmp_one_col(data_matrix1, data_matrix2, col_index1, col_index2, row_id2row_index1, row_id2row_index2, row_id12row_id2) if relative_NA_rate==-1 and hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid relative_no_of_totals=0 between %s and %s.\n"%(col_id1, col_id2)) if mismatch_rate==-1 and hasattr(cls, 'debug') and getattr(cls,'debug'): sys.stderr.write("\t no valid(non-NA) pairs between %s and %s.\n"%(col_id1, col_id2)) col_id2NA_mismatch_rate[col_id1] = [NA_rate, mismatch_rate, no_of_NAs, no_of_totals, no_of_mismatches, no_of_non_NA_pairs, \ relative_NA_rate, relative_no_of_NAs, relative_no_of_totals] sys.stderr.write("Done.\n") return col_id2NA_mismatch_rate
c13cb33cb1a6b269be23f22968b5981b73c60e17 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/c13cb33cb1a6b269be23f22968b5981b73c60e17/TwoSNPData.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 67, 1293, 67, 2460, 12, 6429, 16, 501, 67, 5667, 21, 16, 501, 67, 5667, 22, 16, 645, 67, 350, 22, 1293, 67, 1615, 21, 16, 645, 67, 350, 22, 1293, 67, 1615, 22, 16, 645, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 67, 1293, 67, 2460, 12, 6429, 16, 501, 67, 5667, 21, 16, 501, 67, 5667, 22, 16, 645, 67, 350, 22, 1293, 67, 1615, 21, 16, 645, 67, 350, 22, 1293, 67, 1615, 22, 16, 645, 67,...
self.closure = space.unpackiterable(w_closure)
from pypy.interpreter.nestedscope import Cell closure_w = space.unpackiterable(w_closure) self.closure = [space.interp_w(Cell, w_cell) for w_cell in closure_w]
def descr_function__setstate__(self, space, w_args): from pypy.interpreter.pycode import PyCode args_w = space.unpackiterable(w_args) (w_name, w_doc, w_code, w_func_globals, w_closure, w_defs_w, w_func_dict, w_module) = args_w
9893d9982ef1597d26b001ab1615f16cbe41f07c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/9893d9982ef1597d26b001ab1615f16cbe41f07c/function.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18426, 67, 915, 972, 542, 2019, 972, 12, 2890, 16, 3476, 16, 341, 67, 1968, 4672, 628, 18951, 93, 18, 2761, 11599, 18, 2074, 710, 1930, 4707, 1085, 833, 67, 91, 273, 3476, 18, 17309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18426, 67, 915, 972, 542, 2019, 972, 12, 2890, 16, 3476, 16, 341, 67, 1968, 4672, 628, 18951, 93, 18, 2761, 11599, 18, 2074, 710, 1930, 4707, 1085, 833, 67, 91, 273, 3476, 18, 17309, ...
msg = _get_value_from_user('Give error message:', 'Failed')
msg = _get_value_from_user('Give error message:', default_error)
def _execute_manual_step(message, error): status = showOptionDialog(None, message, DIALOG_TITLE, YES_NO_OPTION, PLAIN_MESSAGE, None, ['PASS', 'FAIL'], None) if status != 0: msg = _get_value_from_user('Give error message:', 'Failed') raise AssertionError(msg)
d39511da40357621d159d06f3f100ea700108c20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7408/d39511da40357621d159d06f3f100ea700108c20/Dialogs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8837, 67, 19840, 67, 4119, 12, 2150, 16, 555, 4672, 1267, 273, 2405, 1895, 6353, 12, 7036, 16, 883, 16, 3690, 18683, 67, 14123, 16, 1624, 3991, 67, 3417, 67, 7425, 16, 25564, 706,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8837, 67, 19840, 67, 4119, 12, 2150, 16, 555, 4672, 1267, 273, 2405, 1895, 6353, 12, 7036, 16, 883, 16, 3690, 18683, 67, 14123, 16, 1624, 3991, 67, 3417, 67, 7425, 16, 25564, 706,...
if i==0 and type(f) != list:
if i == 0 and type(f) != list:
def load(self): CM = self.COMPMAP CF = self.COMPFLAGS Pkg = RPMPackage Prv = RPMProvides NPrv = RPMNameProvides PreReq = RPMPreRequires Req = RPMRequires Obs = RPMObsoletes Cnf = RPMConflicts prog = iface.getProgress(self._cache) for h, offset in self.getHeaders(prog): if h[1106]: # RPMTAG_SOURCEPACKAGE continue arch = h[1022] # RPMTAG_ARCH if rpm.archscore(arch) == 0: continue
d383b28f0eb391187f0d9a46f6abdb2d3bc54f4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/d383b28f0eb391187f0d9a46f6abdb2d3bc54f4a/header.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 15871, 273, 365, 18, 10057, 8352, 6123, 273, 365, 18, 10057, 17836, 453, 14931, 273, 534, 12728, 2261, 2301, 90, 273, 534, 12728, 17727, 423, 2050, 90, 273, 534, 12...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 15871, 273, 365, 18, 10057, 8352, 6123, 273, 365, 18, 10057, 17836, 453, 14931, 273, 534, 12728, 2261, 2301, 90, 273, 534, 12728, 17727, 423, 2050, 90, 273, 534, 12...
if name == None: self.setName(obj.getName()) else: self.setName(name) self.setType(obj.getType()) self.setDescrShort(obj.getDescrShort()) self.parameters = ParameterCollection(obj.parameters)
if name == None: self.setName(obj.getName()) else: self.setName(name) self.setType(obj.getType()) self.setDescrShort(obj.getDescrShort()) self.parameters = ParameterCollection(obj.parameters)
def __init__(self, name, obj=None, parent=None): AttributeCollection.__init__(self) self.parent = None
e041418d1c1325864d917d04c9c09c24baf7387e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e041418d1c1325864d917d04c9c09c24baf7387e/Step.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 508, 16, 1081, 33, 7036, 16, 982, 33, 7036, 4672, 3601, 2532, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2938, 273, 599, 2, 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, 1001, 2738, 972, 12, 2890, 16, 508, 16, 1081, 33, 7036, 16, 982, 33, 7036, 4672, 3601, 2532, 16186, 2738, 972, 12, 2890, 13, 365, 18, 2938, 273, 599, 2, -100, -100, -100, -100, -100, ...
n = len(vals)-1
n = len(vals)
def _drawCell(self, cellval, cellstyle, (colpos, rowpos), (colwidth, rowheight)): #print "cellstyle is ", repr(cellstyle), id(cellstyle) if self._curcellstyle is not cellstyle: cur = self._curcellstyle if cur is None or cellstyle.color != cur.color: #print "setting cell color to %s" % `cellstyle.color` self.canv.setFillColor(cellstyle.color) if cur is None or cellstyle.leading != cur.leading or cellstyle.fontname != cur.fontname or cellstyle.fontsize != cur.fontsize: #print "setting font: %s, %s, %s" % (cellstyle.fontname, cellstyle.fontsize, cellstyle.leading) self.canv.setFont(cellstyle.fontname, cellstyle.fontsize, cellstyle.leading) self._curcellstyle = cellstyle #print "leading is ", cellstyle.leading, "size is", cellstyle.fontsize just = cellstyle.alignment #print "alignment is ", just if just == 'LEFT': draw = self.canv.drawString x = colpos + cellstyle.leftPadding elif just in ('CENTRE', 'CENTER'): draw = self.canv.drawCentredString x = colpos + colwidth * 0.5 elif just == 'RIGHT': draw = self.canv.drawRightString x = colpos + colwidth - cellstyle.rightPadding else: raise ValueError, 'Invalid justification %s' % just
a9fe0699337465276f75f079d196bac4a545bdd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/a9fe0699337465276f75f079d196bac4a545bdd0/tables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9446, 4020, 12, 2890, 16, 2484, 1125, 16, 2484, 4060, 16, 261, 1293, 917, 16, 1027, 917, 3631, 261, 1293, 2819, 16, 1027, 4210, 3719, 30, 468, 1188, 315, 3855, 4060, 353, 3104, 84...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9446, 4020, 12, 2890, 16, 2484, 1125, 16, 2484, 4060, 16, 261, 1293, 917, 16, 1027, 917, 3631, 261, 1293, 2819, 16, 1027, 4210, 3719, 30, 468, 1188, 315, 3855, 4060, 353, 3104, 84...
if nonportable.ostype == 'Darwin': pscommand = 'ps -aww' else: pscommand = 'ps aux'
pscommand = 'ps auxww'
def main(): # Initialize the update url to just be the ip address of this machine. ip = getmyip() updateurl = 'http://' + ip + ':12345/' if len(sys.argv) == 1: sys.argv.append(updateurl) else: sys.argv[1] = updateurl # Create a temp directory to serve the updates from that we can # automatically clean up when we are done. tmpserver = tempfile.mkdtemp() try: test_updater.create_folders(tmpserver) ############################ # Run the rsync only tests # ############################ # Run the noup test (Nothing should fail, nothing should be updated) runRsyncTest('-x', tmpserver + '/noup/') # Run the wronghash test(There should be an RsyncError, and no updates) runRsyncTest('-e', tmpserver + '/wronghash/') # Run the badkeysig test (There should be no updates) runRsyncTest('-x', tmpserver + '/badkeysig/') # Run the corruptmeta test (there should be an RsyncError, and no updates) runRsyncTest('-e', tmpserver + '/corruptmeta/') # Run the updatenmmain test (only nmmain should get updated) runRsyncTest('-u', tmpserver + '/updatenmmain/', ['nmmain.py', 'metainfo']) # Run an update that should get us into a state where the softwareupdater has # a different key than what the metainfo is signed with. The next test will # ensure that our method of dealing with this situation works. runRsyncTest('-u', tmpserver + '/updater/', ['softwareupdater.py', 'metainfo']) # Run an update that should successfully update from the strange state from # the previous test. runRsyncTest('-u', tmpserver + '/updater_new/', ['nmmain.py', 'metainfo']) ##################################### # Finished running rsync only tests # ##################################### # Copy back everything from noup so the restart tests start with a # clean slate. for originalfile in glob.glob(tmpserver + '/noup/*'): shutil.copy(originalfile, os.path.basename(originalfile)) ################################## # Software updater restart tests # ################################## # Start the web server for the first update webserver = run_webserver(tmpserver + '/updater/') # Keep track of whether ps is there (it isn't on Windows) no_ps = False if nonportable.ostype == 'Windows': # If we are running on windows, disable the ps calls. no_ps = True # ps works different on a mac, where we need to use 'ps -aww' instead of # 'ps -ef'. if nonportable.ostype == 'Darwin': pscommand = 'ps -aww' else: # We use 'aux' instead of '-ef' because 'aux' works the same on bsd and linux. pscommand = 'ps aux' updateprocess = subprocess.Popen(['python', 'softwareupdater.py']) if not no_ps: # Only do the ps check if ps is available ps = subprocess.Popen(pscommand + ' | grep "softwareupdater.py" | grep -v grep', shell=True, stdout=subprocess.PIPE) psout = ps.communicate()[0] print 'Initial ps out:' print psout if psout == '': print 'Failure to start initially' # Wait for 2 minutes for the update to happen and the # process to die. for junk in range(60): if updateprocess.poll() != None: break time.sleep(2) ret = updateprocess.returncode if ret != 10: if ret == None: raise Exception("First software updater never died.") elif ret == 55: raise Exception("Software updater failed to get the process lock.") elif ret == 1: raise Exception("Softwareupdater failed with an uncaught exception. \n\ See end of softwareupdater.old in v2 for details.") else: raise Exception("Unknown return code from the software updater (" + str(ret) + ")") else: print "Old softwareupdater returned correctly" if not no_ps: # Only do the ps check if ps is available ps = subprocess.Popen(pscommand + ' | grep "softwareupdater.py" | grep -v grep', shell=True, stdout=subprocess.PIPE) psout = ps.communicate()[0] print 'After ps out:' print psout if psout == '': print 'New updater failed to start!' else: print 'softwareupdater restart success!' # We need to kill the webserver serving from /updater, and start one serving # from updater_new kill_webserver(webserver.pid, updateurl) webserver = run_webserver(tmpserver + '/updater_new/') print "Waiting 2 minutes for the second update to happen" # Wait 2 minutes for the second update to happen. # Is there a way to get a handle for the new softwareupdater? time.sleep(120) # If nmmain's version has been updated, the second update was a success! nmmainfile = file('nmmain.py', 'r') nmmaindata = nmmainfile.read() nmmainfile.close() if 'version = "1234"' in nmmaindata: print 'Second update a success!' else: print 'Second update failed to happen within 2 minutes' # Kill the webserver again now that we are all done with it. kill_webserver(webserver.pid, updateurl) ###################################### # End Software updater restart tests # ###################################### except: traceback.print_exc() finally: # Clean up the temporary server directory. # This throws an exception on Windows if a file is still in use (for example, # if the webserver started in a test couldn't be shut down). shutil.rmtree(tmpserver)
38002a9b5c1156248dd99d422adba97009431652 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/38002a9b5c1156248dd99d422adba97009431652/test_updater_local.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 9190, 326, 1089, 880, 358, 2537, 506, 326, 2359, 1758, 434, 333, 5228, 18, 2359, 273, 336, 4811, 625, 1435, 1089, 718, 273, 296, 2505, 8931, 397, 2359, 397, 4290, 2138,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 9190, 326, 1089, 880, 358, 2537, 506, 326, 2359, 1758, 434, 333, 5228, 18, 2359, 273, 336, 4811, 625, 1435, 1089, 718, 273, 296, 2505, 8931, 397, 2359, 397, 4290, 2138,...
alt_names, rest = asn1.der_decode(ext[1].value())
alt_names, rest = asn1.der_decode(ext[-1].value())
def extractURISubjectAltNames(cert): alt_names = None for optfield in cert.optional_fields: if optfield.tag == 3: for ext in optfield.value(): if ext[0].value() == (2, 5, 29, 17): alt_names, rest = asn1.der_decode(ext[1].value()) assert rest == '' if alt_names != None: break if alt_names != None: break if alt_names == None: return [] alt_names_array = [] for alt_name in alt_names: if alt_name.tag == 6: alt_names_array.append(alt_name.value()) return alt_names_array
56c43dec38f49d3f2831ec0e40a26a8d39fbe3a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10424/56c43dec38f49d3f2831ec0e40a26a8d39fbe3a2/proxy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2608, 3098, 6638, 10655, 1557, 12, 7593, 4672, 3770, 67, 1973, 273, 599, 225, 364, 2153, 1518, 316, 3320, 18, 10444, 67, 2821, 30, 309, 2153, 1518, 18, 2692, 422, 890, 30, 364, 1110, 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, 2608, 3098, 6638, 10655, 1557, 12, 7593, 4672, 3770, 67, 1973, 273, 599, 225, 364, 2153, 1518, 316, 3320, 18, 10444, 67, 2821, 30, 309, 2153, 1518, 18, 2692, 422, 890, 30, 364, 1110, 3...
self.user = unquote(user or '') self.passwd = unquote(passwd or '')
self.user = user self.passwd = passwd
def __init__(self, user, passwd, host, port, dirs): self.user = unquote(user or '') self.passwd = unquote(passwd or '') self.host = host self.port = port self.dirs = [] for dir in dirs: self.dirs.append(unquote(dir)) self.init()
a3dc4797620c4275ff3a17e8bde7b3466b3fca84 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a3dc4797620c4275ff3a17e8bde7b3466b3fca84/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 729, 16, 19093, 16, 1479, 16, 1756, 16, 7717, 4672, 365, 18, 1355, 273, 729, 365, 18, 24002, 273, 19093, 365, 18, 2564, 273, 1479, 365, 18, 655, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 729, 16, 19093, 16, 1479, 16, 1756, 16, 7717, 4672, 365, 18, 1355, 273, 729, 365, 18, 24002, 273, 19093, 365, 18, 2564, 273, 1479, 365, 18, 655, 273, 1...
self.data = csv.reader(codecs.open(self.__source_name, 'r', encoding), dialect='excel', quotechar=quotechar, delimiter=delimiter, lineterminator = lineterminator)
self.data = csv.reader(codecs.open(self.__source_name, 'r', encoding), dialect = 'excel', quotechar = quotechar, delimiter = delimiter, lineterminator = lineterminator)
def open_source(self): import csv, codecs, os # get user values for converting/opening the csv-file self.start_row = int(digits_only( self.gtk.get_widget('e_startrow').get_text() )) encoding = self.gtk.get_widget('e_encoding').get_active_text() encoding = encoding[:string.find( encoding, ' ' )] delimiter = self.gtk.get_widget('e_delimiter').get_text() if delimiter == '': delimiter = "," # quotechar quotechar = self.gtk.get_widget('e_quotechar').get_text() if quotechar == '': quotechar == '"' # lineterminator active = self.gtk.get_widget('e_lineterminator').get_active() # default for none selected and the same for linux and macintosh lineterminator = '\r' # windows lineterminator if active == 1: lineterminator = '\r\n' # open file try: self.data = csv.reader(codecs.open(self.__source_name, 'r', encoding), dialect='excel', quotechar=quotechar, delimiter=delimiter, lineterminator = lineterminator)
8dd23db0ad40a315c4c2431088bf2a98189408a8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2687/8dd23db0ad40a315c4c2431088bf2a98189408a8/CSV.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3168, 12, 2890, 4672, 1930, 6101, 16, 17437, 16, 1140, 468, 336, 729, 924, 364, 14540, 19, 3190, 310, 326, 6101, 17, 768, 365, 18, 1937, 67, 492, 273, 509, 12, 16649, 67, 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, 1696, 67, 3168, 12, 2890, 4672, 1930, 6101, 16, 17437, 16, 1140, 468, 336, 729, 924, 364, 14540, 19, 3190, 310, 326, 6101, 17, 768, 365, 18, 1937, 67, 492, 273, 509, 12, 16649, 67, 3...
self.bb=curl(f[5:8,...],dx,dy,dz,run2D=param.lwrite_2d)
iax=index.index.get('ax')-1 iaz=index.index.get('az') self.bb=curl(f[iax:iaz,...],dx,dy,dz,run2D=param.lwrite_2d)
def __init__(self, varfile='', datadir='data/', proc=-1, ivar=-1, quiet=False, trimall=False, format='native', param=None, dim=None, index=None, run2D=False, magic=None): """ Description: ----------- read VAR files from pencil code. if proc < 0, then load all data and assemble. otherwise, load VAR file from specified processor. format -- one of (['native', 'n'], ['ieee-le', 'l'], ['ieee-be', 'B']) for byte-ordering Params: ------ varfile='' datadir='data/' proc=-1 ivar=-1 quiet=False trimall=False format='native' param=None dim=None index=None run2D=False """ datadir = os.path.expanduser(datadir) if dim is None: dim = read_dim(datadir,proc) if param is None: param = read_param(datadir=datadir, quiet=quiet) if index is None: index = read_index(datadir=datadir) if dim.precision == 'D': precision = 'd' else: precision = 'f' if param.lwrite_aux: totalvars = dim.mvar+dim.maux else: totalvars = dim.mvar
37dbbd56934de61340f76d7190784d277a8d61cc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1377/37dbbd56934de61340f76d7190784d277a8d61cc/var.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 569, 768, 2218, 2187, 22034, 481, 2218, 892, 19, 2187, 5418, 29711, 21, 16, 277, 1401, 29711, 21, 16, 10902, 33, 8381, 16, 2209, 454, 33, 8381, 16, 740, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 569, 768, 2218, 2187, 22034, 481, 2218, 892, 19, 2187, 5418, 29711, 21, 16, 277, 1401, 29711, 21, 16, 10902, 33, 8381, 16, 2209, 454, 33, 8381, 16, 740, ...
result_dir = os.path.dirname(result.message) result_doc = os.path.basename(result.message)
def copyResultToTempDir(self, sourcepath, result): """Copy the results to a fresh directory.
5421018c19f59e01c3e180f4260f96ed0af99ef7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9481/5421018c19f59e01c3e180f4260f96ed0af99ef7/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 1253, 774, 7185, 1621, 12, 2890, 16, 1084, 803, 16, 563, 4672, 3536, 2951, 326, 1686, 358, 279, 12186, 1867, 18, 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, 1610, 1253, 774, 7185, 1621, 12, 2890, 16, 1084, 803, 16, 563, 4672, 3536, 2951, 326, 1686, 358, 279, 12186, 1867, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
gen.startElementNS((ns_uri, "doc"), "ns:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns:doc")
gen.startElementNS((ns_uri, "doc"), "ns1:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns1:doc")
def test_xmlgen_ns(): result = StringIO() gen = XMLGenerator(result) gen.startDocument() gen.startPrefixMapping("ns1", ns_uri) gen.startElementNS((ns_uri, "doc"), "ns:doc", {}) gen.endElementNS((ns_uri, "doc"), "ns:doc") gen.endPrefixMapping("ns1") gen.endDocument() return result.getvalue() == start + ('<ns1:doc xmlns:ns1="%s"></ns1:doc>' % ns_uri)
638b4bde45f9fa549eaa74f4f76f143beb655065 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/638b4bde45f9fa549eaa74f4f76f143beb655065/test_sax.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 2902, 4507, 67, 2387, 13332, 563, 273, 15777, 1435, 3157, 273, 3167, 3908, 12, 2088, 13, 225, 3157, 18, 1937, 2519, 1435, 3157, 18, 1937, 2244, 3233, 2932, 2387, 21, 3113, 3153...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2902, 4507, 67, 2387, 13332, 563, 273, 15777, 1435, 3157, 273, 3167, 3908, 12, 2088, 13, 225, 3157, 18, 1937, 2519, 1435, 3157, 18, 1937, 2244, 3233, 2932, 2387, 21, 3113, 3153...
if vlen: dlen=dlen+16+vlen
if vlen: dlen=dlen+(16+vlen)
def _sane(self, index, pos): """Sanity check saved index data by reading the last undone trans
e9aa3bd398cba329c8a421eb6d47f4dba6e400a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/e9aa3bd398cba329c8a421eb6d47f4dba6e400a9/FileStorage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 87, 8806, 12, 2890, 16, 770, 16, 949, 4672, 3536, 55, 10417, 866, 5198, 770, 501, 635, 6453, 326, 1142, 640, 8734, 906, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 87, 8806, 12, 2890, 16, 770, 16, 949, 4672, 3536, 55, 10417, 866, 5198, 770, 501, 635, 6453, 326, 1142, 640, 8734, 906, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
update_dir = UPDATE_SITE + "/test" make_base_installers.prepare_initial_files(trunk_location, update_dir)
print "Debug mode..." update_dir = UPDATE_SITE + "/test" make_base_installers.prepare_initial_files(trunk_location, update_dir)
def update(trunk_location): """ <Purpose> Populates the update directory (set by a constant) with the program files from the current repository. <Arguments> trunk_location: The location of the repository's trunk directory, used to find the program files. <Exceptions> IOError on bad filepath. <Side Effects> None. <Returns> None. """ update_dir = UPDATE_SITE + "/real" # If we're in DEBUG mode, don't use the real update # directory if DEBUG: update_dir = UPDATE_SITE + "/test" make_base_installers.prepare_initial_files(trunk_location, update_dir)
ea9dac3531a093802c77f9afd39ecf47da662497 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7995/ea9dac3531a093802c77f9afd39ecf47da662497/update_software.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 26133, 67, 3562, 4672, 3536, 411, 10262, 4150, 34, 10264, 17099, 326, 1089, 1867, 261, 542, 635, 279, 5381, 13, 598, 326, 5402, 1390, 628, 326, 783, 3352, 18, 225, 411, 4628, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 12, 26133, 67, 3562, 4672, 3536, 411, 10262, 4150, 34, 10264, 17099, 326, 1089, 1867, 261, 542, 635, 279, 5381, 13, 598, 326, 5402, 1390, 628, 326, 783, 3352, 18, 225, 411, 4628, ...
entry["roles"][role] = role in desired_roles
if entry["roles"][role] in [True, False]: entry["roles"][role] = role in desired_roles
def role_settings(self): """Get current settings for users and groups for which settings have been made. Returns a list of dicts with keys: - id - title - type (one of 'group' or 'user') - roles 'roles' is a dict of settings, with keys of role ids as returned by roles(), and values True if the role is explicitly set, False if the role is explicitly disabled and None if the role is inherited. """ existing_settings = self.existing_role_settings() user_results = self.user_search_results() group_results = self.group_search_results()
3923134a1225c0125c68732d5dd0b052213ead0b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12187/3923134a1225c0125c68732d5dd0b052213ead0b/sharing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2478, 67, 4272, 12, 2890, 4672, 3536, 967, 783, 1947, 364, 3677, 471, 3252, 364, 1492, 1947, 1240, 2118, 7165, 18, 225, 2860, 279, 666, 434, 15838, 598, 1311, 30, 225, 300, 612, 300, 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, 2478, 67, 4272, 12, 2890, 4672, 3536, 967, 783, 1947, 364, 3677, 471, 3252, 364, 1492, 1947, 1240, 2118, 7165, 18, 225, 2860, 279, 666, 434, 15838, 598, 1311, 30, 225, 300, 612, 300, 2...
Provides a conversion to unicode without the UnicodeDecode error of the
Convert to Unicode without the UnicodeDecode error of the
def decode_path(path): """ Decode file/path string. Return `nodes.reprunicode` object. Provides a conversion to unicode without the UnicodeDecode error of the implicit 'ascii:strict' decoding. """ # see also http://article.gmane.org/gmane.text.docutils.user/2905 try: path = path.decode(sys.getfilesystemencoding(), 'strict') except AttributeError: # default value None has no decode method return nodes.reprunicode(path) except UnicodeDecodeError: path = path.decode('utf-8', 'strict') try: path = path.decode(sys.getfilesystemencoding(), 'strict') except UnicodeDecodeError: path = path.decode('ascii', 'replace') return nodes.reprunicode(path)
2f6ef260b96804b3eec0adab31e26b89999ee4cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/2f6ef260b96804b3eec0adab31e26b89999ee4cb/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 67, 803, 12, 803, 4672, 3536, 6209, 585, 19, 803, 533, 18, 2000, 1375, 4690, 18, 12715, 9124, 68, 733, 18, 225, 4037, 358, 9633, 2887, 326, 9633, 6615, 555, 434, 326, 10592, 296,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2495, 67, 803, 12, 803, 4672, 3536, 6209, 585, 19, 803, 533, 18, 2000, 1375, 4690, 18, 12715, 9124, 68, 733, 18, 225, 4037, 358, 9633, 2887, 326, 9633, 6615, 555, 434, 326, 10592, 296,...
'diffs': groups,
'diffs': groups, 'diffs_title': groups_title,
def htmlify(match): div, mod = divmod(len(match.group(0)), 2) return div * '&nbsp; ' + mod * '&nbsp;'
39ad8748d9065256470194452150b192dfb037d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2831/39ad8748d9065256470194452150b192dfb037d4/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 1164, 12, 1916, 4672, 3739, 16, 681, 273, 26105, 12, 1897, 12, 1916, 18, 1655, 12, 20, 13, 3631, 576, 13, 327, 3739, 380, 5183, 10600, 31, 296, 397, 681, 380, 5183, 10600, 4359, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1729, 1164, 12, 1916, 4672, 3739, 16, 681, 273, 26105, 12, 1897, 12, 1916, 18, 1655, 12, 20, 13, 3631, 576, 13, 327, 3739, 380, 5183, 10600, 31, 296, 397, 681, 380, 5183, 10600, 4359, ...
fn = self.function_builder(_fn, _i, _o, self.indices, self.outputs, defaults, self.unpack_single, self)
fn = self.function_builder(_fn, _i, _o, self.indices, self.outputs, defaults, self.unpack_single, self.return_none, self)
def create(self, defaults = None, trustme = False): """ Create a function.
f93342408fadb5f496258cf719a18c3217eee9f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/f93342408fadb5f496258cf719a18c3217eee9f0/debugmode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 3467, 273, 599, 16, 10267, 3501, 273, 1083, 4672, 3536, 1788, 279, 445, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 3467, 273, 599, 16, 10267, 3501, 273, 1083, 4672, 3536, 1788, 279, 445, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if re.search(string, line, *flags)]
if re.search(string, line, flags)]
sage: 'divisors' in _search_src_or_doc('src', '^ *def prime', interact=False)
fb82be1d32fd4ead18b0899563ff0f5fcba1ceec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/fb82be1d32fd4ead18b0899563ff0f5fcba1ceec/sagedoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 272, 410, 30, 296, 2892, 291, 1383, 11, 316, 389, 3072, 67, 4816, 67, 280, 67, 2434, 2668, 4816, 2187, 10731, 380, 536, 17014, 2187, 16592, 33, 8381, 13, 2, 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, 0, 0, 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, 272, 410, 30, 296, 2892, 291, 1383, 11, 316, 389, 3072, 67, 4816, 67, 280, 67, 2434, 2668, 4816, 2187, 10731, 380, 536, 17014, 2187, 16592, 33, 8381, 13, 2, -100, -100, -100, -100, -100, -10...
fp.write(' (gtype-id "' + typecode(cname) + '")\n')
fp.write(' (gtype-id "' + typecode(cname, self.namespace) + '")\n')
def write_enum_defs(self, enums, fp=None): if not fp: fp = self.fp
2311187824d1b48a996ee2620fd3c9a63e3edd66 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8659/2311187824d1b48a996ee2620fd3c9a63e3edd66/h2def.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 7924, 67, 12537, 12, 2890, 16, 17922, 16, 4253, 33, 7036, 4672, 309, 486, 4253, 30, 4253, 273, 365, 18, 7944, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 7924, 67, 12537, 12, 2890, 16, 17922, 16, 4253, 33, 7036, 4672, 309, 486, 4253, 30, 4253, 273, 365, 18, 7944, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
except:
except IOError:
def quick_link(request, path_obj): try: if path_obj.getquickstats()['translated'] < path_obj.getquickstats()['total']: if check_permission('translate', request): text = _('Quick Translate') else: text = _('View Untranslated') return { 'href': dispatch.translate(request, path_obj.pootle_path, match_names=['fuzzy', 'untranslated']), 'text': text } except: pass
582cfbf41b3b0c1924c5557a814f3c35f7838d60 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/582cfbf41b3b0c1924c5557a814f3c35f7838d60/item_dict.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9549, 67, 1232, 12, 2293, 16, 589, 67, 2603, 4672, 775, 30, 309, 589, 67, 2603, 18, 588, 19525, 5296, 1435, 3292, 22899, 3546, 411, 589, 67, 2603, 18, 588, 19525, 5296, 1435, 3292, 496...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9549, 67, 1232, 12, 2293, 16, 589, 67, 2603, 4672, 775, 30, 309, 589, 67, 2603, 18, 588, 19525, 5296, 1435, 3292, 22899, 3546, 411, 589, 67, 2603, 18, 588, 19525, 5296, 1435, 3292, 496...
def getSetter(targetObj, valueName, prefix='set'):
def getSetter(targetObj, valueName):
def getSetter(targetObj, valueName, prefix='set'): # getSetter(smiley, 'pos') -> smiley.setPos return getattr(targetObj, getSetterName(valueName, prefix))
1ea78fd02fc9ae34753d15944c23b5502ce72aef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/1ea78fd02fc9ae34753d15944c23b5502ce72aef/PythonUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 8465, 12, 3299, 2675, 16, 460, 461, 4672, 468, 336, 8465, 12, 4808, 398, 93, 16, 296, 917, 6134, 317, 3029, 398, 93, 18, 542, 1616, 327, 3869, 12, 3299, 2675, 16, 336, 8465, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 8465, 12, 3299, 2675, 16, 460, 461, 4672, 468, 336, 8465, 12, 4808, 398, 93, 16, 296, 917, 6134, 317, 3029, 398, 93, 18, 542, 1616, 327, 3869, 12, 3299, 2675, 16, 336, 8465, 461...
self._test.run_errors.setup_err(error)
self._test.run_errors.setup_err(unicode(error))
def _notify_run_errors(self, error): self._test.run_errors.setup_err(error)
d77ea0acbd2792b1bd2897db37438192c5d40690 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/d77ea0acbd2792b1bd2897db37438192c5d40690/fixture.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12336, 67, 2681, 67, 4324, 12, 2890, 16, 555, 4672, 365, 6315, 3813, 18, 2681, 67, 4324, 18, 8401, 67, 370, 12, 1636, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12336, 67, 2681, 67, 4324, 12, 2890, 16, 555, 4672, 365, 6315, 3813, 18, 2681, 67, 4324, 18, 8401, 67, 370, 12, 1636, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if tx is StringType or tx is InstanceType:
if tx in (StringType, UnicodeType, InstanceType):
def compileProgram(self, parsedText, program=None): style = self.style1 # standard parameters #program = self.program if program is None: program = [] a = program.append fn = style.fontName # add style information if there was no initial state a( ("face", fn ) ) from reportlab.lib.fonts import ps2tt (self.face, self.bold, self.italic) = ps2tt(fn) a( ("size", style.fontSize ) ) self.size = style.fontSize a( ("align", style.alignment ) ) a( ("indent", style.leftIndent ) ) if style.firstLineIndent: a( ("indent", style.firstLineIndent ) ) # must be undone later a( ("rightIndent", style.rightIndent ) ) a( ("leading", style.leading) ) if style.textColor: a( ("color", style.textColor) ) #a( ("nextLine", 0) ) # clear for next line if self.bulletText: self.do_bullet(self.bulletText, program) self.compileComponent(parsedText, program) # now look for a place where to insert the unindent after the first line if style.firstLineIndent: count = 0 from types import StringType, InstanceType for x in program: count = count+1 tx = type(x) if tx is StringType or tx is InstanceType: break program.insert( count, ("indent", -style.firstLineIndent ) ) # defaults to end if no visibles #print "="*8, id(self), "program is" #for x in program: # print x
a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/a9fe2a25d7fcc8f510447cdecc4f6473c43d80f7/para.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 9459, 12, 2890, 16, 2707, 1528, 16, 5402, 33, 7036, 4672, 2154, 273, 365, 18, 4060, 21, 468, 4529, 1472, 468, 12890, 273, 365, 18, 12890, 309, 5402, 353, 599, 30, 5402, 273, 5378...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 9459, 12, 2890, 16, 2707, 1528, 16, 5402, 33, 7036, 4672, 2154, 273, 365, 18, 4060, 21, 468, 4529, 1472, 468, 12890, 273, 365, 18, 12890, 309, 5402, 353, 599, 30, 5402, 273, 5378...
def testConvertWrite(self): testfile = "test/data/jpg/bluegreen_noise.400x300.jpg"
def testRead(self): testfile = "test/data/tiff/bluegreen_noise.400x300.tif"
def testConvertWrite(self):
73471e17491a0d7435fbf42c7be77f3400fe9aa8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9042/73471e17491a0d7435fbf42c7be77f3400fe9aa8/TIFFReader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 2723, 3067, 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, 2723, 3067, 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, -...
if 0 : buildPackage( "libxml2",
if 1 : buildPackage( "libxml2",
def buildPackage(name, uri, checkVersion, downloadUri, tarballName, buildCommand, srcdir=None, deps="", pinnedVersion = None, ) : print "Module:", name subst = dict( sandbox = sandbox, prefix = prefix, target = target, sfmirror = sfmirror, apachemirror = apachemirror, name = name, pinned = pinnedVersion if pinnedVersion else "None", ) availableVersion = output(checkVersion).strip() availableVersion or die("No online version found for the package\n Command used:\n%s" % checkVersion) print "Found version: '%s'" % availableVersion if (pinnedVersion and pinnedVersion != availableVersion) : warning("Package: Pinning to version %s, although version %s is available" % (pinnedVersion, availableVersion)) version = pinnedVersion if pinnedVersion else availableVersion subst.update ( version = version, majorversion = ".".join(version.split(".")[:1]), minorversion = ".".join(version.split(".")[:2]), ) subst.update( tarball = tarballName % subst, srcdir = ("%(sandbox)s/src/" + (srcdir or "%(name)s-%(version)s/")) % subst, ) print "srcdir:", subst['srcdir'] download(downloadUri % subst) extractSource(subst['tarball']) patches = glob.glob(scriptRelative("mingw-"+name+"*")) patches.sort() print patches for patch in patches : applyPatch(subst['srcdir'], patch, level=1) run(buildCommand % subst)
9516624bdaf457fb48cb287da6115af5d509bbca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1456/9516624bdaf457fb48cb287da6115af5d509bbca/setup_mingw.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 2261, 12, 529, 16, 2003, 16, 866, 1444, 16, 4224, 3006, 16, 29441, 461, 16, 1361, 2189, 16, 1705, 1214, 33, 7036, 16, 8740, 1546, 3113, 26193, 1444, 273, 599, 16, 262, 294, 1172,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1361, 2261, 12, 529, 16, 2003, 16, 866, 1444, 16, 4224, 3006, 16, 29441, 461, 16, 1361, 2189, 16, 1705, 1214, 33, 7036, 16, 8740, 1546, 3113, 26193, 1444, 273, 599, 16, 262, 294, 1172,...
INPUTS: p -- probabilities
Parameters ---------- p: array-like Probabilities
def deriv(self, p):
8cf1bc1bd108f801dc00298b13807714beaac7d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12658/8cf1bc1bd108f801dc00298b13807714beaac7d5/links.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9630, 12, 2890, 16, 293, 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, 9630, 12, 2890, 16, 293, 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...
elif type(out_file) == type(''):
elif isinstance(out_file, StringType):
def encode(in_file, out_file, name=None, mode=None): """Uuencode file""" # # If in_file is a pathname open it and change defaults # if in_file == '-': in_file = sys.stdin elif type(in_file) == type(''): if name is None: name = os.path.basename(in_file) if mode is None: try: mode = os.stat(in_file)[0] except AttributeError: pass in_file = open(in_file, 'rb') # # Open out_file if it is a pathname # if out_file == '-': out_file = sys.stdout elif type(out_file) == type(''): out_file = open(out_file, 'w') # # Set defaults for name and mode # if name is None: name = '-' if mode is None: mode = 0666 # # Write the data # out_file.write('begin %o %s\n' % ((mode&0777),name)) str = in_file.read(45) while len(str) > 0: out_file.write(binascii.b2a_uu(str)) str = in_file.read(45) out_file.write(' \nend\n')
7dd503dda36ba97cf1f0dc07da0505ba843532d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7dd503dda36ba97cf1f0dc07da0505ba843532d7/uu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 267, 67, 768, 16, 596, 67, 768, 16, 508, 33, 7036, 16, 1965, 33, 7036, 4672, 3536, 57, 89, 3015, 585, 8395, 468, 468, 971, 316, 67, 768, 353, 279, 9806, 1696, 518, 471, 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, 2017, 12, 267, 67, 768, 16, 596, 67, 768, 16, 508, 33, 7036, 16, 1965, 33, 7036, 4672, 3536, 57, 89, 3015, 585, 8395, 468, 468, 971, 316, 67, 768, 353, 279, 9806, 1696, 518, 471, 2...
while not is_all_white(line):
while lineno > 0 and not is_all_white(line):
def find_paragraph(text, mark): lineno, col = map(int, string.split(mark, ".")) line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while is_all_white(line): lineno = lineno + 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first_lineno = lineno while not is_all_white(line): lineno = lineno + 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) last = "%d.0" % lineno # Search back to beginning of paragraph lineno = first_lineno - 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) while not is_all_white(line): lineno = lineno - 1 line = text.get("%d.0" % lineno, "%d.0 lineend" % lineno) first = "%d.0" % (lineno+1) return first, last, text.get(first, last)
410cfde802b503b376118955296a7414d56a44f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/410cfde802b503b376118955296a7414d56a44f0/FormatParagraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 22445, 12, 955, 16, 2267, 4672, 7586, 16, 645, 273, 852, 12, 474, 16, 533, 18, 4939, 12, 3355, 16, 4585, 3719, 980, 273, 977, 18, 588, 27188, 72, 18, 20, 6, 738, 7586, 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, 1104, 67, 22445, 12, 955, 16, 2267, 4672, 7586, 16, 645, 273, 852, 12, 474, 16, 533, 18, 4939, 12, 3355, 16, 4585, 3719, 980, 273, 977, 18, 588, 27188, 72, 18, 20, 6, 738, 7586, 16...
Dimension of the p-new subspace of $S_k(\Gamma_0(N))$.
Dimension of the $p$-new subspace of $S_k(\Gamma_0(N))$.
def dimension_new_cusp_forms_gamma0(N, k=2, p=0): r""" Dimension of the p-new subspace of $S_k(\Gamma_0(N))$. If $p=0$, dimension of the new subspace. INPUT: N -- a positive integer k -- an integer p -- a prime number OUTPUT: Integer EXAMPLES: sage: sage.modular.dims.dimension_new_cusp_forms_gamma0(100, 2, 5) 5 Independently compute the dimension 5 above: sage: m = ModularSymbols(100, 2,sign=1).cuspidal_subspace() sage: m.new_subspace(5) Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension 18 for Gamma_0(100) of weight 2 with sign 1 over Rational Field """ if N <= 0: raise ArithmeticError, "the level N (=%s) must be positive"%N if k < 0: return Z(0) elif k == 0: return Z(0) elif k%2 == 1: return Z(0) if p==0 or N%p!=0: return sum([dimension_cusp_forms_gamma0(M,k)*mumu(N//M) \ for M in divisors(N)]) return dimension_cusp_forms_gamma0(N,k) - \ 2*dimension_new_cusp_forms_gamma0(N//p,k)
248019f740827c6c514f1cd94eb6bd825f071218 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/248019f740827c6c514f1cd94eb6bd825f071218/dims.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4968, 67, 2704, 67, 71, 407, 84, 67, 9741, 67, 20589, 20, 12, 50, 16, 417, 33, 22, 16, 293, 33, 20, 4672, 436, 8395, 13037, 434, 326, 271, 84, 8, 17, 2704, 720, 2981, 434, 271, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4968, 67, 2704, 67, 71, 407, 84, 67, 9741, 67, 20589, 20, 12, 50, 16, 417, 33, 22, 16, 293, 33, 20, 4672, 436, 8395, 13037, 434, 326, 271, 84, 8, 17, 2704, 720, 2981, 434, 271, 5...
oldFile, diff )
oldFile, diff, fileExists )
def _findMovedPaths(self, db, changeSet): # Lookup paths which have swithed troves. These look like a # remove and add of the same path; we build an dict which lets # us treat these events as file updates rather than a remove/add # sequence, allowing us to preserve state. pathsMoved = {}
62924f6a695934b70527fb089af5d68da577e117 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/62924f6a695934b70527fb089af5d68da577e117/update.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 25317, 4466, 12, 2890, 16, 1319, 16, 26104, 4672, 468, 8834, 2953, 1492, 1240, 1352, 483, 329, 23432, 3324, 18, 8646, 2324, 3007, 279, 468, 1206, 471, 527, 434, 326, 1967, 589...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4720, 25317, 4466, 12, 2890, 16, 1319, 16, 26104, 4672, 468, 8834, 2953, 1492, 1240, 1352, 483, 329, 23432, 3324, 18, 8646, 2324, 3007, 279, 468, 1206, 471, 527, 434, 326, 1967, 589...
if item.description.lower().find("shirt") > -1 and not item.description.lower().startswith("discount"):
if item.description.lower().startswith("discount"): pass elif item.description.lower().find("shirt") > -1:
def rego_desk_list(self): """ List of people who have not checked in (see checkins table). [Registrations] """ import zookeepr.model checkedin = zookeepr.model.metadata.bind.execute("SELECT person_id FROM checkins WHERE conference IS NOT NULL"); checkedin_list = checkedin.fetchall() registration_list = self.dbsession.query(Registration).all() c.columns = ['ID', 'Name', 'Type', 'Shirts', 'Dinner Tickets'] c.data = [] for registration in registration_list: if (registration.person.id not in [id[0] for id in checkedin_list]) and registration.person.paid(): shirts = [] dinner_tickets = 0 ticket_types = [] for invoice in registration.person.invoices: if invoice.paid() and not invoice.void: for item in invoice.items: if item.description.lower().find("shirt") > -1 and not item.description.lower().startswith("discount"): shirts.append(item.description + " x" + str(item.qty)) elif item.description.lower().startswith("dinner") and not item.description.lower().startswith("discount"): dinner_tickets += item.qty if item.description.lower().endswith("ticket") or item.description.lower().startswith("press pass"): ticket_types.append(item.description + " x" + str(item.qty)) c.data.append([registration.person.id, registration.person.firstname + " " + registration.person.lastname, ", ".join(ticket_types), ", ".join(shirts), dinner_tickets])
9cf71694ef12fa03a8eb819a0536258280351f9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12856/9cf71694ef12fa03a8eb819a0536258280351f9f/admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 960, 83, 67, 5489, 79, 67, 1098, 12, 2890, 4672, 3536, 987, 434, 16951, 10354, 1240, 486, 5950, 316, 261, 5946, 866, 2679, 1014, 2934, 306, 20175, 1012, 65, 3536, 1930, 998, 1184, 1340, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 960, 83, 67, 5489, 79, 67, 1098, 12, 2890, 4672, 3536, 987, 434, 16951, 10354, 1240, 486, 5950, 316, 261, 5946, 866, 2679, 1014, 2934, 306, 20175, 1012, 65, 3536, 1930, 998, 1184, 1340, ...
except Exception as inst:
except Exception, inst:
def send(self, port, length=1, mode=True): """ Send a data of some length
368bdd74e063c19063d4c5db99e94bb088943ceb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/368bdd74e063c19063d4c5db99e94bb088943ceb/virtio_guest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 12, 2890, 16, 1756, 16, 769, 33, 21, 16, 1965, 33, 5510, 4672, 3536, 2479, 279, 501, 434, 2690, 769, 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, 1366, 12, 2890, 16, 1756, 16, 769, 33, 21, 16, 1965, 33, 5510, 4672, 3536, 2479, 279, 501, 434, 2690, 769, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
sites = Sites(self.api, site_ids)
sites = PLC.Sites.Sites(self.api, site_ids)
def validate_site_ids(self, site_ids): """ Ensure that the specified site_ids are all valid. """
3d52c346ea0b7eb846e02702f51edd3e01c4e163 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/3d52c346ea0b7eb846e02702f51edd3e01c4e163/Persons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 67, 4256, 67, 2232, 12, 2890, 16, 2834, 67, 2232, 4672, 3536, 7693, 716, 326, 1269, 2834, 67, 2232, 854, 777, 923, 18, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1954, 67, 4256, 67, 2232, 12, 2890, 16, 2834, 67, 2232, 4672, 3536, 7693, 716, 326, 1269, 2834, 67, 2232, 854, 777, 923, 18, 3536, 2, -100, -100, -100, -100, -100, -100, -100, -100, -1...
transfer = False transfer_param = returnnode.attrib.get('transfer-ownership') if transfer_param is not None: transfer = (transfer_param == '1')
transfer = returnnode.attrib.get('transfer-ownership')
def _parse_function(self, node, klass): name = node.attrib['name'] returnnode = node.find(_corens('return-value')) if not returnnode: raise ValueError('node %r has no return-value' % (name, )) transfer = False transfer_param = returnnode.attrib.get('transfer-ownership') if transfer_param is not None: transfer = (transfer_param == '1') retval = Return(self._parse_type(returnnode), transfer) parameters_node = node.find(_corens('parameters')) parameters = [] if (parameters_node is not None): for paramnode in parameters_node.findall(_corens('parameter')): parameters.append(Parameter(paramnode.attrib.get('name'), self._parse_type(paramnode))) if klass is Callback: return klass(name, retval, parameters, node.attrib.get(_cns('type'))) else: identifier = node.attrib.get(_cns('identifier')) return klass(name, retval, parameters, identifier)
a9da57b96714bc693d7463e0a5b00c7a65494a1a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2770/a9da57b96714bc693d7463e0a5b00c7a65494a1a/girparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 915, 12, 2890, 16, 756, 16, 7352, 4672, 508, 273, 756, 18, 14588, 3292, 529, 3546, 327, 2159, 273, 756, 18, 4720, 24899, 3644, 2387, 2668, 2463, 17, 1132, 26112, 309, 48...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 915, 12, 2890, 16, 756, 16, 7352, 4672, 508, 273, 756, 18, 14588, 3292, 529, 3546, 327, 2159, 273, 756, 18, 4720, 24899, 3644, 2387, 2668, 2463, 17, 1132, 26112, 309, 48...
else: if not is_valid_ip_address(localip): raise Exception("Local IP address is invalid.") if not is_valid_ip_address(desthost): raise Exception("Destination host IP address is invalid.")
def sendmess(desthost, destport, message,localip=None,localport = None): """ <Purpose> Send a message to a host / port <Arguments> desthost: The host to send a message to destport: The port to send the message to message: The message to send localhost (optional): The local IP to send the message from localport (optional): The local port to send the message from (0 for a random port) <Exceptions> socket.error when communication errors happen <Side Effects> None. <Returns> The number of bytes sent on success """ # Check that if either localip or local port is specified, that both are if (localip != None and localport == None) or (localport != None and localip == None): raise Exception("Localip and localport must be specified simultaneously.") # Assign the default value to localport if none given if localport == None: localport = 0 if not localip or localip == '0.0.0.0': localip = None else: if not is_valid_ip_address(localip): raise Exception("Local IP address is invalid.") if not is_valid_ip_address(desthost): raise Exception("Destination host IP address is invalid.") if not is_valid_network_port(destport): raise Exception("Destination port number must be an integer, between 1 and 65535.") if not is_valid_network_port(localport, True): raise Exception("Local port number must be an integer, between 1 and 65535.") restrictions.assertisallowed('sendmess', desthost, destport, message,localip,localport) if localport: nanny.tattle_check('messport',localport) # Armon: Check if the specified local ip is allowed # this check only makes sense if the localip is specified if localip and not ip_is_allowed(localip): raise Exception, "IP '"+str(localip)+"' is not allowed." # If there is a preference, but no localip, then get one elif user_ip_interface_preferences and not localip: # Use whatever getmyip returns localip = getmyip() # this is used to track errors when trying to resend data firsterror = None if localip and localport: # let's see if the socket already exists... commtableentry,commhandle = find_tip_entry('UDP',localip,localport) else: # no, we'll skip commhandle = None # yes it does! let's use the existing socket if commhandle: # block in case we're oversubscribed if is_loopback(desthost): nanny.tattle_quantity('loopsend',0) else: nanny.tattle_quantity('netsend',0) # try to send using this socket try: bytessent = commtableentry['socket'].sendto(message,(desthost,destport)) except socket.error,e: # we're going to save this error in case we also get an error below. # This is likely to be the error we actually want to raise firsterror = e # should I really fall through here? else: # send succeeded, let's wait and return if is_loopback(desthost): nanny.tattle_quantity('loopsend',bytessent) else: nanny.tattle_quantity('netsend',bytessent) return bytessent # open a new socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) try: if localip: try: s.bind((localip,localport)) except socket.error, e: if firsterror: raise Exception, firsterror raise Exception, e # wait if already oversubscribed if is_loopback(desthost): nanny.tattle_quantity('loopsend',0) else: nanny.tattle_quantity('netsend',0) bytessent = s.sendto(message,(desthost,destport)) if is_loopback(desthost): nanny.tattle_quantity('loopsend',bytessent) else: nanny.tattle_quantity('netsend',bytessent) return bytessent finally: # close no matter what try: s.close() except: pass
86ad74d7f2a9e42e79c68ad230d00a596e6fabc6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/86ad74d7f2a9e42e79c68ad230d00a596e6fabc6/emulcomm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 81, 403, 12, 10488, 2564, 16, 1570, 655, 16, 883, 16, 3729, 625, 33, 7036, 16, 3729, 655, 273, 599, 4672, 3536, 411, 10262, 4150, 34, 2479, 279, 883, 358, 279, 1479, 342, 1756, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 81, 403, 12, 10488, 2564, 16, 1570, 655, 16, 883, 16, 3729, 625, 33, 7036, 16, 3729, 655, 273, 599, 4672, 3536, 411, 10262, 4150, 34, 2479, 279, 883, 358, 279, 1479, 342, 1756, ...
The shape of `U` is ``(M, M)`` or ``(M, K)``
The shape of `U` is ``(M, M)`` or ``(K, M)``
def svd_device(a, a_dtype, a_shape, full_matrices=1, compute_uv=1): """ Singular Value Decomposition. Factorizes the matrix `a` into two unitary matrices, ``U`` and ``Vh``, and a 1-dimensional array of singular values, ``s`` (real, non-negative), such that ``a == U S Vh``, where ``S`` is the diagonal matrix ``np.diag(s)``. Parameters ---------- a : c_void_p Pointer to device memory containing matrix of shape ``(M, N)`` to decompose. a_dtype : type Type of matrix data. a_shape : tuple Shape of matrix data ``(M, N)``. full_matrices : bool, optional If True (default), ``u`` and ``v.H`` have the shapes ``(M, M)`` and ``(N, N)``, respectively. Otherwise, the shapes are ``(M, K)`` and ``(K, N)``, resp., where ``K = min(M, N)``. compute_uv : bool, optional Whether or not to compute ``u`` and ``v.H`` in addition to ``s``. True by default. Returns ------- u : c_void_p Pointer to device memory containing unitary matrix. The shape of `U` is ``(M, M)`` or ``(M, K)`` depending on value of `full_matrices`. s : c_void_p Pointer to device memory containing the singular values, sorted so that ``s[i] >= s[i+1]``. `S` is a 1-D array of length ``min(M, N)`` v.H : c_void_p Pointer to device memory containing unitary matrix of shape ``(N, N)`` or ``(K, N)``, depending on `full_matrices`. Raises ------ LinAlgError If SVD computation does not converge. Notes ----- Because of the limitations of the free version of CULA, the argument is cast to single precision. If `a` is a matrix object (as opposed to an `ndarray`), then so are all the return values. Examples -------- >>> import cula >>> cula.culaInitialize() 0 >>> a = np.random.randn(9, 6) + 1j*np.random.randn(9, 6) >>> a = np.asarray(a, np.complex64) >>> m, n = a.shape >>> at = a.T.copy() >>> a_ptr = cula.cuda_malloc(a.nbytes) >>> cula.cuda_memcpy_htod(a_ptr, at.ctypes.data, a.nbytes) >>> U_ptr, s_ptr, Vh_ptr = cula.svd_device(a_ptr, a.dtype, a.shape, full_matrices=False) >>> U = np.empty((m, min(m, n)), a.dtype) >>> s = np.empty(min(m, n), np.float32) >>> Vh = np.empty((n, min(m, n)), a.dtype) >>> cula.cuda_memcpy_dtoh(U.ctypes.data, U_ptr, U.nbytes) >>> cula.cuda_memcpy_dtoh(s.ctypes.data, s_ptr, s.nbytes) >>> cula.cuda_memcpy_dtoh(Vh.ctypes.data, Vh_ptr, Vh.nbytes) >>> S = np.diag(s) >>> np.allclose(a, np.dot(U, np.dot(S, Vh.T))) True """ # The free version of CULA only supports single precision floating # point numbers: real_dtype = np.float32 real_dtype_nbytes = np.nbytes[real_dtype] if a_dtype == np.complex64: cula_func = _libcula.culaDeviceCgesvd a_dtype_nbytes = np.nbytes[a_dtype] elif a_dtype == np.float32: cula_func = _libcula.culaDeviceSgesvd a_dtype_nbytes = np.nbytes[a_dtype] else: raise ValueError('unsupported type') cula_func.restype = int cula_func.argtypes = [ctypes.c_char, ctypes.c_char, ctypes.c_int, ctypes.c_int, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p, ctypes.c_int, ctypes.c_void_p, ctypes.c_int] (m, n) = a_shape # Set LDA: lda = max(1, m) # Set S: s = cuda_malloc(min(m, n)*real_dtype_nbytes) # Set JOBU and JOBVT: if compute_uv: if full_matrices: jobu = 'A' jobvt = 'A' else: jobu = 'S' jobvt = 'S' else: jobu = 'N' jobvt = 'N' # Set LDU and transpose of U: ldu = m if jobu == 'A': u = cuda_malloc(ldu*m*a_dtype_nbytes) elif jobu == 'S': u = cuda_malloc(min(m, n)*ldu*a_dtype_nbytes) else: ldu = 1 u = cuda_malloc(a_dtype_nbytes) # Set LDVT and transpose of VT: if jobvt == 'A': ldvt = n vt = cuda_malloc(n*n*a_dtype_nbytes) elif jobvt == 'S': ldvt = min(m, n) vt = cuda_malloc(n*ldvt*a_dtype_nbytes) else: ldvt = 1 vt = cuda_malloc(a_dtype_nbytes) status = cula_func(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt) if status != 0: status = culaInitialize() culaCheckStatus(status) status = cula_func(jobu, jobvt, m, n, a, lda, s, u, ldu, vt, ldvt) if status > 0: raise LinAlgError, 'SVD did not converge' if compute_uv: return u, s, vt else: cuda_free(u) cuda_free(vt) return s
7fc4e451024ef5d36885b07be6a15417c4ae54c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/7fc4e451024ef5d36885b07be6a15417c4ae54c3/cula.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25656, 67, 5964, 12, 69, 16, 279, 67, 8972, 16, 279, 67, 4867, 16, 1983, 67, 7373, 12660, 33, 21, 16, 3671, 67, 16303, 33, 21, 4672, 3536, 348, 17830, 1445, 26824, 3276, 18, 225, 264...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 25656, 67, 5964, 12, 69, 16, 279, 67, 8972, 16, 279, 67, 4867, 16, 1983, 67, 7373, 12660, 33, 21, 16, 3671, 67, 16303, 33, 21, 4672, 3536, 348, 17830, 1445, 26824, 3276, 18, 225, 264...
if self.LIVECD:
if self.LIVECD or os.environ.has_key("_MEIPASS2"):
def load(self): self.cp = ConfigParser() self.options = options try: files = [path.join(self.SCRIPT_DIR, "settings.conf"), # Used on Mac OS LiveCD path.join(self.SCRIPT_DIR, "..", "..", "..", "..", ".data", "settings", "settings.conf"), # Mac - Normal case path.join(self.SCRIPT_DIR, "..", "..", "..", ".data", "settings", "settings.conf"), path.join(self.SCRIPT_DIR, "..", "..", ".data", "settings", "settings.conf"), # Windows - Normal case path.join(self.SCRIPT_DIR, "..", ".data", "settings", "settings.conf")] # Linux - Normal case if os.environ.has_key("_MEIPASS2"): # Used on Windows & Linux Live files.append(path.join(os.environ["_MEIPASS2"], "settings.conf")) if options.update: files.append(path.join(options.update, ".data", "settings", "settings.conf")) settings = self.cp.read(files) self.conf_file = settings[0] except: print "Could not read settings.conf" self.conf_file = ""
aed91fa933db01bced622bfd998590261aefae1e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/aed91fa933db01bced622bfd998590261aefae1e/conf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 365, 18, 4057, 273, 25076, 1435, 365, 18, 2116, 273, 702, 775, 30, 1390, 273, 306, 803, 18, 5701, 12, 2890, 18, 10885, 67, 4537, 16, 315, 4272, 18, 3923, 6, 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, 1262, 12, 2890, 4672, 365, 18, 4057, 273, 25076, 1435, 365, 18, 2116, 273, 702, 775, 30, 1390, 273, 306, 803, 18, 5701, 12, 2890, 18, 10885, 67, 4537, 16, 315, 4272, 18, 3923, 6, 363...
return os.sep.join(prefix) def isdir(s): """Return true if the pathname refers to an existing directory.""" try: st = os.stat(s) except os.error: return 0 return S_ISDIR(st[ST_MODE]) def getsize(filename): """Return the size of a file, reported by os.stat().""" st = os.stat(filename) return st[ST_SIZE] def getmtime(filename): """Return the last modification time of a file, reported by os.stat().""" st = os.stat(filename) return st[ST_MTIME] def getatime(filename): """Return the last access time of a file, reported by os.stat().""" st = os.stat(filename) return st[ST_ATIME] def islink(s): """Return true if the pathname refers to a symbolic link. Always false on the Mac, until we understand Aliases.)""" return 0 def isfile(s): """Return true if the pathname refers to an existing regular file.""" try: st = os.stat(s) except os.error: return 0 return S_ISREG(st[ST_MODE]) def exists(s): """Return true if the pathname refers to an existing file or directory.""" try: st = os.stat(s) except os.error: return 0 return 1
return prefix
def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' n = m[:] for i in range(len(n)): n[i] = n[i].split(os.sep) # if os.sep didn't have any effect, try os.altsep if os.altsep and len(n[i]) == 1: n[i] = n[i].split(os.altsep) prefix = n[0] for item in n: for i in range(len(prefix)): if prefix[:i+1] <> item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return os.sep.join(prefix)
7a8047165bde0c4daa4a1b763f3327f14be19a0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7a8047165bde0c4daa4a1b763f3327f14be19a0b/macpath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2975, 3239, 12, 81, 4672, 315, 6083, 279, 666, 434, 589, 1973, 16, 1135, 326, 12163, 2975, 7676, 1794, 6, 309, 486, 312, 30, 327, 875, 290, 273, 312, 10531, 65, 364, 277, 316, 1048, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2975, 3239, 12, 81, 4672, 315, 6083, 279, 666, 434, 589, 1973, 16, 1135, 326, 12163, 2975, 7676, 1794, 6, 309, 486, 312, 30, 327, 875, 290, 273, 312, 10531, 65, 364, 277, 316, 1048, ...
dtpref_cols='50', dtpref_rows='20'):
dtpref_cols='100%', dtpref_rows='20'):
def pt_changePrefs(self, REQUEST, height=None, width=None, dtpref_cols='50', dtpref_rows='20'): """Change editing preferences.""" # The <textarea> can have dimensions expressed in percentages; # strip the percent sign so int() below won't fail if dtpref_cols[-1:] == "%": dtpref_cols = dtpref_cols[:-1] or '50' if dtpref_rows[-1:] == "%": dtpref_rows = dtpref_rows[:-1] or '20' szchh = {'Taller': 1, 'Shorter': -1, None: 0} szchw = {'Wider': 5, 'Narrower': -5, None: 0} try: rows = int(height) except: rows = max(1, int(dtpref_rows) + szchh.get(height, 0)) try: cols = int(width) except: cols = max(40, int(dtpref_cols) + szchw.get(width, 0)) e = (DateTime('GMT') + 365).rfc822() setc = REQUEST['RESPONSE'].setCookie setc('dtpref_rows', str(rows), path='/', expires=e) setc('dtpref_cols', str(cols), path='/', expires=e) REQUEST.form.update({'dtpref_cols': cols, 'dtpref_rows': rows}) return self.manage_main()
537a21a6fc3d202925bbb3c4ac9cc86776310a89 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/537a21a6fc3d202925bbb3c4ac9cc86776310a89/ZopePageTemplate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5818, 67, 3427, 1386, 2556, 12, 2890, 16, 12492, 16, 2072, 33, 7036, 16, 1835, 33, 7036, 16, 3681, 25724, 67, 6842, 2218, 6625, 9, 2187, 3681, 25724, 67, 3870, 2218, 3462, 11, 4672, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5818, 67, 3427, 1386, 2556, 12, 2890, 16, 12492, 16, 2072, 33, 7036, 16, 1835, 33, 7036, 16, 3681, 25724, 67, 6842, 2218, 6625, 9, 2187, 3681, 25724, 67, 3870, 2218, 3462, 11, 4672, 35...
[0, 1, -1, 1/2, -1/2, 2, -2, 1/3, -1/3, 3/2]
[0, 1, -1, 1/2, -1/2, 2, -2, 1/3, -1/3, 3]
def list_of_first_n(v,n): """ Given an iterator v, return first n elements it produces as a list. INPUT: v -- an interator n -- an integer OUTPUT: list EXAMPLES: sage: sage.server.notebook.interact.list_of_first_n(Primes(), 10) [2, 3, 5, 7, 11, 13, 17, 19, 23, 29] sage: sage.server.notebook.interact.list_of_first_n((1..5), 10) [1, 2, 3, 4, 5] sage: sage.server.notebook.interact.list_of_first_n(QQ, 10) [0, 1, -1, 1/2, -1/2, 2, -2, 1/3, -1/3, 3/2] """ if not hasattr(v, 'next'): v = v.__iter__() w = [] while n > 0: try: w.append(v.next()) except StopIteration: return w n -= 1 return w
b6f05aef10ae5348937b4d4debe37daa48847a27 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/b6f05aef10ae5348937b4d4debe37daa48847a27/interact.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 792, 67, 3645, 67, 82, 12, 90, 16, 82, 4672, 3536, 16803, 392, 2775, 331, 16, 327, 1122, 290, 2186, 518, 15505, 487, 279, 666, 18, 225, 12943, 30, 331, 1493, 392, 1554, 639,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 792, 67, 3645, 67, 82, 12, 90, 16, 82, 4672, 3536, 16803, 392, 2775, 331, 16, 327, 1122, 290, 2186, 518, 15505, 487, 279, 666, 18, 225, 12943, 30, 331, 1493, 392, 1554, 639,...
CopyFile(File, To) open(os.path.join(To, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n")
CopyFile(File, Config) open(os.path.join(Bin, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n")
def CopyConfigForDistribution(To): # # The distributed environment is minimal and targets only one # or a small number of targets (e.g. NT386*). # # The distributed environment does not require a source tree. # a = os.path.join(Root, "m3-sys", "cminstall", "src") To = os.path.join(To, "bin/config") CreateDirectory(To) for a in [Target + "*", "*.common"]: for File in glob.glob(os.path.join(a, "config-no-install", a)): if os.path.isfile(File): #print(File + " => " + To + "\n") CopyFile(File, To) open(os.path.join(To, "cm3.cfg"), "w").write("INSTALL_ROOT = (path() & SL & \"..\")\ninclude(path() & \"/config/" + Config + "\")\n") return True
68c3037f693ad11ca8cdb1ec1efa62109f73ac4f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9328/68c3037f693ad11ca8cdb1ec1efa62109f73ac4f/pylib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5631, 809, 1290, 9003, 12, 774, 4672, 468, 468, 1021, 16859, 3330, 353, 16745, 471, 5774, 1338, 1245, 468, 578, 279, 5264, 1300, 434, 5774, 261, 73, 18, 75, 18, 20064, 23, 5292, 14, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5631, 809, 1290, 9003, 12, 774, 4672, 468, 468, 1021, 16859, 3330, 353, 16745, 471, 5774, 1338, 1245, 468, 578, 279, 5264, 1300, 434, 5774, 261, 73, 18, 75, 18, 20064, 23, 5292, 14, 29...
return min(a, max(b, gauss((a+b)*.5, (b-a)/6.)))
return max(a, min(b, gauss((a+b)*.5, (b-a)/6.)))
def normalDistrib(a, b, gauss=random.gauss): """ NOTE: assumes a < b Returns random number between a and b, using gaussian distribution, with mean=avg(a,b), and a standard deviation that fits ~99.7% of the curve between a and b. Outlying results are clipped to a and b. ------------------------------------------------------------------------ http://www-stat.stanford.edu/~naras/jsm/NormalDensity/NormalDensity.html The 68-95-99.7% Rule ==================== All normal density curves satisfy the following property which is often referred to as the Empirical Rule: 68% of the observations fall within 1 standard deviation of the mean. 95% of the observations fall within 2 standard deviations of the mean. 99.7% of the observations fall within 3 standard deviations of the mean. Thus, for a normal distribution, almost all values lie within 3 standard deviations of the mean. ------------------------------------------------------------------------ In calculating our standard deviation, we divide (b-a) by 6, since the 99.7% figure includes 3 standard deviations _on_either_side_ of the mean. """ return min(a, max(b, gauss((a+b)*.5, (b-a)/6.)))
aca80e65637cd9849ef04bd95f36aef709df9a0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/aca80e65637cd9849ef04bd95f36aef709df9a0d/PythonUtil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2212, 1669, 665, 12, 69, 16, 324, 16, 314, 10325, 33, 9188, 18, 75, 10325, 4672, 3536, 5219, 30, 13041, 279, 411, 324, 225, 2860, 2744, 1300, 3086, 279, 471, 324, 16, 1450, 21490, 7006...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2212, 1669, 665, 12, 69, 16, 324, 16, 314, 10325, 33, 9188, 18, 75, 10325, 4672, 3536, 5219, 30, 13041, 279, 411, 324, 225, 2860, 2744, 1300, 3086, 279, 471, 324, 16, 1450, 21490, 7006...
s=L2Socket(*args, **kargs)
if not isinstance(x, Gen): x = SetGen(x) s=conf.L2socket(*args, **kargs)
def sendp(x, inter=0, *args, **kargs): """Send packets at layer 2""" s=L2Socket(*args, **kargs) for p in x: s.send(p) time.sleep(inter)
722a4073400c335f86f3f613ddc3e31e4e032485 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/722a4073400c335f86f3f613ddc3e31e4e032485/scapy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 84, 12, 92, 16, 1554, 33, 20, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 3826, 12640, 622, 3018, 576, 8395, 309, 486, 1549, 12, 92, 16, 10938, 4672, 619, 273, 1000, 7642, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 84, 12, 92, 16, 1554, 33, 20, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 3826, 12640, 622, 3018, 576, 8395, 309, 486, 1549, 12, 92, 16, 10938, 4672, 619, 273, 1000, 7642, 1...
try: import platform except: platform = None if platform and platform.system() in ["Windows"]: if not os.environ.get('SDL_VIDEODRIVER', ''): if sys.getwindowsversion()[3] in [1,2]: os.environ['SDL_VIDEODRIVER'] = 'directx'
if not os.environ.get('SDL_VIDEODRIVER', ''): if hasattr(sys, "getwindowsversion"): try: if (sys.getwindowsversion()[3] in [1,2] and sys.getwindowsversion()[0] in [0,1,2,3,4,5]): os.environ['SDL_VIDEODRIVER'] = 'directx' except: pass
def _check_darwin(): try: from objc import loadBundleFunctions import AppKit import Foundation except ImportError: raise ImportError("PyObjC 1.2 or later is required to use pygame on Mac OS X. http://pygame.org/wiki/PyObjC")
773e5b4a826a44a22c34a984bc9ea201fe615934 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/773e5b4a826a44a22c34a984bc9ea201fe615934/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 28076, 13332, 775, 30, 628, 1081, 71, 1930, 1262, 3405, 7503, 1930, 4677, 14102, 1930, 31289, 1335, 11308, 30, 1002, 11308, 2932, 9413, 2675, 39, 404, 18, 22, 578, 5137, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 67, 28076, 13332, 775, 30, 628, 1081, 71, 1930, 1262, 3405, 7503, 1930, 4677, 14102, 1930, 31289, 1335, 11308, 30, 1002, 11308, 2932, 9413, 2675, 39, 404, 18, 22, 578, 5137, 3...
radius = function.intctrl.eqpath_radius origin = function.intctrl.eqpath_origin
radius = -1 origin = 1000
def function_integral(function, calcutype): #return the integral of the 'function' on 'intrange' #the function can be a value or a matrix, arg1,arg2 are the possible #parameters of the function intctrl = function.intctrl if calcutype == 'eqInt': intrange = intctrl.eqintpath tol = intctrl.eqinttol radius = function.intctrl.eqpath_radius origin = function.intctrl.eqpath_origin elif calcutype == 'neInt': intrange = intctrl.neintpath tol = intctrl.neinttol radius = function.intctrl.eqpath_radius origin = function.intctrl.eqpath_origin elif calcutype == 'locInt': intrange = intctrl.locintpath tol = intctrl.locinttol radius = function.intctrl.locpath_radius origin = function.intctrl.locpath_origin trace = 0 a = 0. b = 1. #Initialize with 13 function evaluations. c = (a + b) / 2 h = (b - a) / 2 realmin = 2e-308 s = [.942882415695480, sqrt(2.0/3), .641853342345781, 1/sqrt(5.0), .236383199662150] s1 = [0] * len(s) s2 = [0] * len(s) for i in range(len(s)): s1[i] = c - s[i] * h s2[i] = c + fliplr(s)[i] * h x0 = [a] + s1 + [c] + s2 + [b] s0 = [.0158271919734802, .094273840218850, .155071987336585, .188821573960182, .199773405226859, .224926465333340] w0 = s0 + [.242611071901408] + fliplr(s0) w1 = [1, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 1] w2 = [77, 0, 432, 0, 625, 0, 672, 0, 625, 0, 432, 0, 77] for i in range(len(w1)): w1[i] = w1[i] / 6.0 w2[i] = w2[i] / 1470.0 dZ = [intrange[:len(intrange) - 1], intrange[1:]] hmin = [0] * len(dZ[1]) path_type = [] for i in range(len(intrange) - 1): rs = npy.abs(dZ[0][i] - origin) re = npy.abs(dZ[1][i] - origin) if abs(rs - radius) < 1.0e-8 and abs(re - radius) < 1.0e-8: path_type.append('half_circle') else: path_type.append('line') for i in range(len(dZ[1])): if path_type[i] == 'half_circle': dZ[0][i] = 0 dZ[1][i] = npy.pi for i in range(len(dZ[1])): dZ[1][i] = dZ[1][i] - dZ[0][i] hmin[i] = realmin / 1024 * abs(dZ[1][i]) temp = npy.array([[1] * 13, x0]).transpose() Zx = npy.dot(temp, npy.array(dZ)) Zxx = [] for i in range(len(intrange) - 1): for j in range(13): Zxx.append(Zx[j][i]) ns = 0 ne = 12 if path_type[0] == 'line': yns = function.calgfunc(Zxx[ns], calcutype) elif path_type[0] == 'half_circle': energy = origin + radius * npy.exp((npy.pi - Zxx[ns + i]) * 1.j) yns = -1.j * radius * npy.exp(-1.j* Zxx[ns +i])* function.calgfunc(energy, calcutype) fcnt = 0 for n in range(len(intrange)-1): # below evaluate the integral and adjust the tolerance Q1pQ0 = yns * (w1[0] - w0[0]) Q2pQ0 = yns * (w2[0] - w0[0]) fcnt = fcnt + 12 for i in range(1,12): if path_type[n] == 'line': yne = function.calgfunc(Zxx[ns + i], calcutype) elif path_type[n] == 'half_circle': energy = origin + radius * npy.exp((npy.pi -Zxx[ns + i]) * 1.j) yne = -1.j * radius * npy.exp(-1.j * Zxx[ns + i])* function.calgfunc(energy, calcutype) Q1pQ0 += yne * (w1[i] - w0[i]) Q2pQ0 += yne * (w2[i] - w0[i]) # Increase the tolerance if refinement appears to be effective r = npy.abs(Q2pQ0) / npy.abs(Q1pQ0 + realmin) dim = npy.product(r.shape) r = npy.sum(r) / dim if r > 0 and r < 1: thistol = tol / r else: thistol = tol if path_type[n] == 'line': yne = function.calgfunc(Zxx[ne], calcutype) elif path_type[n] == 'half_circle': energy = origin + radius * npy.exp((npy.pi -Zxx[ne]) * 1.j) yne = -1.j * radius * npy.exp(-1.j * Zxx[ne])* function.calgfunc(energy, calcutype) #Call the recursive core integrator Qk, xpk, wpk, fcnt, warn = quadlstep(function, Zxx[ns], Zxx[ne], yns, yne, thistol, trace, fcnt, hmin[n], calcutype, path_type[n], origin, radius) if n == 0: Q = npy.copy(Qk) Xp = xpk[:] Wp = wpk[:] else: Q += Qk Xp = Xp[:-1] + xpk Wp = Wp[:-1] + [Wp[-1] + wpk[0]] + wpk[1:] if warn == 1: print 'warning: Minimum step size reached,singularity possible' elif warn == 2: print 'warning: Maximum function count excced; singularity likely' elif warn == 3: print 'warning: Infinite or Not-a-Number function value encountered' else: pass ns += 13 ne += 13 yns = npy.copy(yne) return Q,Xp,Wp,fcnt
00bdc146ae747b9eb684bf5161ab978e7d7f9a85 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1380/00bdc146ae747b9eb684bf5161ab978e7d7f9a85/tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 445, 67, 14970, 23811, 12, 915, 16, 1443, 5150, 388, 4672, 468, 2463, 326, 21423, 434, 326, 296, 915, 11, 603, 296, 267, 313, 726, 11, 468, 5787, 445, 848, 506, 279, 460, 578, 279, 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, 445, 67, 14970, 23811, 12, 915, 16, 1443, 5150, 388, 4672, 468, 2463, 326, 21423, 434, 326, 296, 915, 11, 603, 296, 267, 313, 726, 11, 468, 5787, 445, 848, 506, 279, 460, 578, 279, 3...
'title': lead.title,
'title': lead.title and lead.title.id or False,
def _create_partner(self, cr, uid, ids, context=None): """ This function Creates partner based on action. @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of Lead to Partner's IDs @param context: A standard dictionary for contextual values
a2e42c4e73cfb97108bcdb5b6322e6c5ec077396 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/a2e42c4e73cfb97108bcdb5b6322e6c5ec077396/crm_lead_to_partner.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 31993, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 1220, 445, 10210, 19170, 2511, 603, 1301, 18, 632, 891, 365, 30, 1021, 733, 4407, 632, 891,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31993, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 3536, 1220, 445, 10210, 19170, 2511, 603, 1301, 18, 632, 891, 365, 30, 1021, 733, 4407, 632, 891,...
def deps_print(title, parent, target, level, deps):
def print_deps(target, deps):
def deps_print(title, parent, target, level, deps): csvstring = '' spacer = '' nospace = '' if level > 0: nospace += spacer for space in range(0, level): spacer += " " if len(deps) < 1: # FIXME - this blows up the recursion, just drop it? #deps.append("NONE") # at ld-linux - just suppress the output return if do_csv: if depth == 1: csvstring += str(level + 1) + "," + target else: csvstring += str(level + 1) + "," + target + "," + title if level > 0 or depth < 2: for dep in deps: csvstring += "," + dep print csvstring else: if level == 1: print spacer + title print spacer + "[" + str(level + 1) + "]" + target + ":" spacer += " " if level > 0 or depth < 2: for dep in deps: print spacer + dep
89ba6d56319b5570ed0de187a733e3a224e3b917 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4228/89ba6d56319b5570ed0de187a733e3a224e3b917/readelf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1172, 67, 14877, 12, 3299, 16, 8740, 4672, 6101, 1080, 273, 875, 31896, 273, 875, 26628, 909, 273, 875, 225, 309, 1801, 405, 374, 30, 26628, 909, 1011, 31896, 225, 364, 3476, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1172, 67, 14877, 12, 3299, 16, 8740, 4672, 6101, 1080, 273, 875, 31896, 273, 875, 26628, 909, 273, 875, 225, 309, 1801, 405, 374, 30, 26628, 909, 1011, 31896, 225, 364, 3476, 316, ...
if mon[i]!=zero and found != i:
if mon[i]!=0 and found != i:
def is_univariate(self): """ Returns True if this multivariate polynomial is univariate and False otherwise.
649d76c47aa6dab51facb4ea82f9297ae0c87131 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/649d76c47aa6dab51facb4ea82f9297ae0c87131/multi_polynomial_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 67, 318, 27693, 12, 2890, 4672, 3536, 2860, 1053, 309, 333, 1778, 27693, 16991, 353, 640, 27693, 471, 1083, 3541, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 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, 353, 67, 318, 27693, 12, 2890, 4672, 3536, 2860, 1053, 309, 333, 1778, 27693, 16991, 353, 640, 27693, 471, 1083, 3541, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if worker._current_task is not None:
if worker._HasRunningTaskUnlocked():
def _HasRunningTasksUnlocked(self): """Checks whether there's a task running in a worker.
b3558df1ce05334d20560d16cec79e7e4286ae09 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b3558df1ce05334d20560d16cec79e7e4286ae09/workerpool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5582, 7051, 6685, 7087, 329, 12, 2890, 4672, 3536, 4081, 2856, 1915, 1807, 279, 1562, 3549, 316, 279, 4322, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 5582, 7051, 6685, 7087, 329, 12, 2890, 4672, 3536, 4081, 2856, 1915, 1807, 279, 1562, 3549, 316, 279, 4322, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if self.properties[defn.namespace].get("export") == "yes":
if defn.namespace in self.properties and self.properties[defn.namespace].get("export") == "yes":
if defn.undef != None: # Local macros are only visible in the file where they were defined return defn.filename == fn and n >= defn.lineno and n <= defn.undef
9c89a6c0feece2e0d33306332a3f4d08410d82bc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9355/9c89a6c0feece2e0d33306332a3f4d08410d82bc/wmltools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 1652, 82, 18, 318, 536, 480, 599, 30, 468, 3566, 24302, 854, 1338, 6021, 316, 326, 585, 1625, 2898, 4591, 2553, 327, 1652, 82, 18, 3459, 422, 2295, 471, 290, 1545, 1652, 82, 18, 17782, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 309, 1652, 82, 18, 318, 536, 480, 599, 30, 468, 3566, 24302, 854, 1338, 6021, 316, 326, 585, 1625, 2898, 4591, 2553, 327, 1652, 82, 18, 3459, 422, 2295, 471, 290, 1545, 1652, 82, 18, 17782, ...
An interactive slider control, which can be used in conjunction
An interactive range slider control, which can be used in conjunction
def __init__(self, vmin, vmax=None, step_size=1, default=None, label=None, display_value=True): r""" An interactive slider control, which can be used in conjunction with the interact command.
84810e20828637dc0c5b540b9d08853b9f0c31da /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/84810e20828637dc0c5b540b9d08853b9f0c31da/interact.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 17501, 16, 17831, 33, 7036, 16, 2235, 67, 1467, 33, 21, 16, 805, 33, 7036, 16, 1433, 33, 7036, 16, 2562, 67, 1132, 33, 5510, 4672, 436, 8395, 1922, 126...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 2890, 16, 17501, 16, 17831, 33, 7036, 16, 2235, 67, 1467, 33, 21, 16, 805, 33, 7036, 16, 1433, 33, 7036, 16, 2562, 67, 1132, 33, 5510, 4672, 436, 8395, 1922, 126...
if test_support.debug:
if test_support.verbose:
def isTipcAvailable(): """Check if the TIPC module is loaded The TIPC module is not loaded automatically on Ubuntu and probably other Linux distros. """ if not hasattr(socket, "AF_TIPC"): return False if not os.path.isfile("/proc/modules"): return False with open("/proc/modules") as f: for line in f: if line.startswith("tipc "): return True if test_support.debug: print "TIPC module is not loaded, please 'sudo modprobe tipc'" return False
2c4689e590345f7db1f4c75a2fb4272c990ab4ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2c4689e590345f7db1f4c75a2fb4272c990ab4ee/test_socket.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 14189, 71, 5268, 13332, 3536, 1564, 309, 326, 399, 2579, 39, 1605, 353, 4203, 225, 1021, 399, 2579, 39, 1605, 353, 486, 4203, 6635, 603, 587, 70, 25348, 471, 8656, 1308, 13318, 2411...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14189, 71, 5268, 13332, 3536, 1564, 309, 326, 399, 2579, 39, 1605, 353, 4203, 225, 1021, 399, 2579, 39, 1605, 353, 486, 4203, 6635, 603, 587, 70, 25348, 471, 8656, 1308, 13318, 2411...
FILE.write("\tmodifier \"" + str(textu.tex.getName()) + "\"\n")
FILE.write("\t\t\"" + textu.tex.getName() + "\"\n") elif textp <> None and (textp.tex.name.startswith("perlin")): FILE.write("\t\t\"" + textp.tex.getName() + "\"\n")
def export_geometry(obj): islight = obj.name.startswith("meshlight") isparticleob = obj.name.startswith("particleob") if islight: print "o exporting meshlight " + obj.name+"..." if isparticleob: print "o exporting particle object " + obj.name+"..." # get the mesh data if obj.getType() <> "Empty": mesh = Mesh.New(obj.name) # Note the "mesh.verts = None" at the end of this if. Used to clear the new mesh from memory mesh.getFromObject(obj, 0, 1) mesh.transform(obj.mat, 1) verts = mesh.verts faces = mesh.faces numverts = verts.__len__() if numverts > 0: if islight: FILE.write("\n\nlight {\n") FILE.write("\ttype meshlight\n") FILE.write("\tname \"" + obj.name + "\"\n") if len(mesh.materials) >= 1: matrl = mesh.materials[0] FILE.write("\temit { \"sRGB nonlinear\" %.3f %.3f %.3f }\n" % (matrl.R, matrl.G, matrl.B)) else: FILE.write("\temit 1 1 1\n") FILE.write("\tradiance %s\n" % (MESHLIGHTPOWER.val)) FILE.write("\tsamples %s\n" % DSAMPLES.val) FILE.write("\tpoints %d\n" % (numverts)) for vert in verts: FILE.write("\t\t%s %s %s\n" % (vert.co[0], vert.co[1], vert.co[2])) numtris = 0 for face in faces: num = len(face.verts) if num == 4: numtris = numtris + 2 elif num == 3: numtris = numtris + 1 FILE.write("\ttriangles %d\n" % (numtris)) allsmooth = True allflat = True for face in faces: num = len(face.verts) smooth = face.smooth <> 0 allsmooth &= smooth allflat &= not smooth if num == 4: FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[1].index, face.verts[2].index)) FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[2].index, face.verts[3].index)) elif num == 3: FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[1].index, face.verts[2].index)) FILE.write("}") else: FILE.write("\n\nobject {\n") if len(mesh.materials) == 1: FILE.write("\tshader \"" + mesh.materials[0].name + ".shader\"\n") ##Check for and write modfiers## for mat in mesh.materials: textures = mat.getTextures() textu = textures[1] if textu <> None and (textu.tex.name.startswith("bump") or textu.tex.name.startswith("normal") or textu.tex.name.startswith("perlin")): FILE.write("\tmodifier \"" + str(textu.tex.getName()) + "\"\n") elif len(mesh.materials) > 1: FILE.write("\tshaders %d\n" % (len(mesh.materials))) for mat in mesh.materials: FILE.write("\t\t\"" + mat.name + ".shader\"\n") ##Check for and write modfiers## FILE.write("\tmodifiers %d\n" % (len(mesh.materials))) for mat in mesh.materials: textures = mat.getTextures() textu = textures[1] if textu <> None and (textu.tex.name.startswith("bump") or textu.tex.name.startswith("normal") or textu.tex.name.startswith("perlin")): FILE.write("\t\t\"" + textu.tex.getName() + "\"\n") else: FILE.write("\t\t\"" + "None" + "\"\n") else: FILE.write("\tshader def\n") ##Particle object section. Works with Sunflow 0.07.3 and up. ## # Check if there are particles on the object # ob = Object.Get(obj.name) if len(ob.effects) <> 0: effect = ob.effects[0] particles = effect.getParticlesLoc() effects= Effect.Get() # Check that particles are points only (not static and not vectors) # if not effect.getFlag() & Effect.Flags.STATIC or not effect.getStype(): FILE.write("\ttype particles\n") FILE.write("\tname \"" + obj.name + "\"\n") FILE.write("\tpoints %d\n" % (len(particles))) for pt in particles: FILE.write("\t\t%s %s %s\n" % (pt[0], pt[1], pt[2])) FILE.write("\tradius 0.05\n}\n") elif type(particles)==list: # Is it a strand or pair? if len(particles)>1: pointnum = ((len(particles)*effect.getLifetime())*3) print "o exporting hair object " + obj.name+"..." FILE.write("\ttype hair\n") FILE.write("\tname \"" + obj.name + "\"\n") FILE.write("\tsegments %d\n" % (effect.getLifetime()-1)) FILE.write("\twidth .01\n") FILE.write("\tpoints %d" % pointnum) for eff in effects: for p in eff.getParticlesLoc(): if type(p)==list: # Are we a strand or a pair, then add hair data. if len(p)>1: destData = str() for vect in p: for elem in vect: destData+=" "+str(elem) FILE.write("\t%s\n" % (destData)) FILE.write("}\n") elif isparticleob: FILE.write("\ttype particles\n") FILE.write("\tname \"" + obj.name + "\"\n") FILE.write("\tpoints %d\n" % (numverts)) for vert in verts: FILE.write("\t\t%s %s %s\n" % (vert.co[0], vert.co[1], vert.co[2])) FILE.write("\tradius 0.05\n}\n") else: print "o exporting mesh " + obj.name+"..." FILE.write("\ttype generic-mesh\n") FILE.write("\tname \"" + obj.name + "\"\n") FILE.write("\tpoints %d\n" % (numverts)) for vert in verts: FILE.write("\t\t%s %s %s\n" % (vert.co[0], vert.co[1], vert.co[2])) numtris = 0 for face in faces: num = len(face.verts) if num == 4: numtris = numtris + 2 elif num == 3: numtris = numtris + 1 FILE.write("\ttriangles %d\n" % (numtris)) allsmooth = True allflat = True for face in faces: num = len(face.verts) smooth = face.smooth <> 0 allsmooth &= smooth allflat &= not smooth if num == 4: FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[1].index, face.verts[2].index)) FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[2].index, face.verts[3].index)) elif num == 3: FILE.write("\t\t%d %d %d\n" % (face.verts[0].index, face.verts[1].index, face.verts[2].index)) ## what kind of normals do we have? if not islight: if allflat: FILE.write("\tnormals none\n") elif allsmooth: FILE.write("\tnormals vertex\n") for vert in verts: FILE.write("\t\t%s %s %s\n" % (vert.no[0], vert.no[1], vert.no[2])) else: FILE.write("\tnormals facevarying\n") for face in faces: num = len(face.verts) if face.smooth <> 0: if num == 4: index0 = face.verts[0].index index1 = face.verts[1].index index2 = face.verts[2].index index3 = face.verts[3].index FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (verts[index0].no[0], verts[index0].no[1], verts[index0].no[2], verts[index1].no[0], verts[index1].no[1], verts[index1].no[2], verts[index2].no[0], verts[index2].no[1], verts[index2].no[2])) FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (verts[index0].no[0], verts[index0].no[1], verts[index0].no[2], verts[index2].no[0], verts[index2].no[1], verts[index2].no[2], verts[index3].no[0], verts[index3].no[1], verts[index3].no[2])) elif num == 3: index0 = face.verts[0].index index1 = face.verts[1].index index2 = face.verts[2].index FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (verts[index0].no[0], verts[index0].no[1], verts[index0].no[2], verts[index1].no[0], verts[index1].no[1], verts[index1].no[2], verts[index2].no[0], verts[index2].no[1], verts[index2].no[2])) else: fnx = face.no[0] fny = face.no[1] fnz = face.no[2] if num == 4: FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (fnx, fny, fnz, fnx, fny, fnz, fnx, fny, fnz)) FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (fnx, fny, fnz, fnx, fny, fnz, fnx, fny, fnz)) elif num == 3: FILE.write("\t\t%s %s %s %s %s %s %s %s %s\n" % (fnx, fny, fnz, fnx, fny, fnz, fnx, fny, fnz)) # Check for UVs # if mesh.faceUV <> 0: tx = 1 ty = 1 if len(mesh.materials) >= 1: if len(mesh.materials[0].getTextures()) >= 1: if mesh.materials[0].getTextures()[0] <> None: tx = mesh.materials[0].getTextures()[0].tex.repeat[0] ty = mesh.materials[0].getTextures()[0].tex.repeat[1] FILE.write("\tuvs facevarying\n") for face in faces: num = len(face.verts) if num == 4: FILE.write("\t\t%s %s %s %s %s %s\n" % (tx * face.uv[0][0], ty * face.uv[0][1], tx * face.uv[1][0], ty * face.uv[1][1], tx * face.uv[2][0], ty * face.uv[2][1])) FILE.write("\t\t%s %s %s %s %s %s\n" % (tx * face.uv[0][0], ty * face.uv[0][1], tx * face.uv[2][0], ty * face.uv[2][1], tx * face.uv[3][0], ty * face.uv[3][1])) elif num == 3: FILE.write("\t\t%s %s %s %s %s %s\n" % (tx * face.uv[0][0], ty * face.uv[0][1], tx * face.uv[1][0], ty * face.uv[1][1], tx * face.uv[2][0], ty * face.uv[2][1])) else: FILE.write("\tuvs none\n") # Check for multiple materials on the mesh (face indices) # if len(mesh.materials) > 1: FILE.write("\tface_shaders\n") for face in faces: num = len(face.verts) if num == 4: FILE.write("\t\t%d\n" % (face.mat)) FILE.write("\t\t%d\n" % (face.mat)) elif num == 3: FILE.write("\t\t%d\n" % (face.mat)) FILE.write("}\n") # This clears the data from the new mesh created. # mesh.verts = None # Look for Instances/Dupligroups # if obj.getType() == "Empty": ob = Object.Get(obj.name) dupe_obs = ob.DupObjects dupmatrix = Mathutils.Matrix(ob.getMatrix()) group = ob.DupGroup if group <> "None": for dupe_ob, dup_matrix in dupe_obs: dupobmesh = Mesh.New(dupe_ob.name) instancematrix = ob.getMatrix() print "o exporting instances of " + dupe_ob.name+"..." FILE.write("\n\ninstance {\n") FILE.write("\tname %s \n" % obj.name) FILE.write("\tgeometry %s \n" % dupe_ob.name) FILE.write("\ttransform col %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s \n" % (instancematrix[0][0], instancematrix[0][1], instancematrix[0][2], instancematrix[0][3], instancematrix[1][0], instancematrix[1][1], instancematrix[1][2], instancematrix[1][3], instancematrix[2][0], instancematrix[2][1], instancematrix[2][2], instancematrix[2][3], instancematrix[3][0], instancematrix[3][1], instancematrix[3][2], instancematrix[3][3])) if len(dupobmesh.materials) >= 1: FILE.write("\tshader \"" + dupobmesh.materials[0].name + ".shader\"\n") else: FILE.write("\tshader def\n") for mat in dupobmesh.materials: textures = mat.getTextures() textu = textures[1] if textu <> None and (textu.tex.name.startswith("bump") or textu.tex.name.startswith("normal")): FILE.write("\tmodifier \"" + str(textu.tex.getName()) + "\"\n") FILE.write("}\n") mesh.verts = None # Add infinite plane object # if INFINITEPLANE.val == 1: FILE.write("\n\nobject {\n") FILE.write("\tshader iplane\n") FILE.write("\ttype plane\n") FILE.write("\tp 0 0 0\n") FILE.write("\tn 0 0 1\n}\n")
223dfc1c7b8557f033095eceba9a38be84b7749e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12400/223dfc1c7b8557f033095eceba9a38be84b7749e/sunflow_export.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 14330, 12, 2603, 4672, 353, 5099, 273, 1081, 18, 529, 18, 17514, 1918, 2932, 15557, 5099, 7923, 353, 2680, 3711, 947, 273, 1081, 18, 529, 18, 17514, 1918, 2932, 2680, 3711, 947...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 67, 14330, 12, 2603, 4672, 353, 5099, 273, 1081, 18, 529, 18, 17514, 1918, 2932, 15557, 5099, 7923, 353, 2680, 3711, 947, 273, 1081, 18, 529, 18, 17514, 1918, 2932, 2680, 3711, 947...
encoding = locale.getlocale(locale.LC_TIME)[1] or \ locale.getpreferredencoding()
lc_time_encoding = sys.platform != 'win32' and getlocale(locale.LC_TIME)[1] encoding = lc_time_encoding or locale.getpreferredencoding()
def format_datetime(t=None, format='%x %X', gmt=False): if t is None: t = time.time() if not isinstance(t, (list, tuple, time.struct_time)): if gmt: t = time.gmtime(int(t)) else: t = time.localtime(int(t)) text = time.strftime(format, t) encoding = locale.getlocale(locale.LC_TIME)[1] or \ locale.getpreferredencoding() return unicode(text, encoding, 'replace')
8139a67668a4c2aadaadbc0c1bd62331fb7416d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/8139a67668a4c2aadaadbc0c1bd62331fb7416d4/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 6585, 12, 88, 33, 7036, 16, 740, 28713, 92, 738, 60, 2187, 314, 1010, 33, 8381, 4672, 309, 268, 353, 599, 30, 268, 273, 813, 18, 957, 1435, 309, 486, 1549, 12, 88, 16, 261...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 6585, 12, 88, 33, 7036, 16, 740, 28713, 92, 738, 60, 2187, 314, 1010, 33, 8381, 4672, 309, 268, 353, 599, 30, 268, 273, 813, 18, 957, 1435, 309, 486, 1549, 12, 88, 16, 261...
if sigVersion == _TROVESIG_VER_NEW:
if sigVersion in (_TROVESIG_VER_NEW, _TROVESIG_VER_NEW2):
def computeDigest(self, sigVersion, message): if sigVersion == _TROVESIG_VER_CLASSIC: self.sha1.compute(message) return
01bf33c96dd051260688dbc5ed027317e80c9ea8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8747/01bf33c96dd051260688dbc5ed027317e80c9ea8/trove.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3671, 9568, 12, 2890, 16, 3553, 1444, 16, 883, 4672, 309, 3553, 1444, 422, 389, 56, 1457, 3412, 18513, 67, 2204, 67, 5237, 2871, 30, 365, 18, 7819, 21, 18, 9200, 12, 2150, 13, 327, 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, 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, 3671, 9568, 12, 2890, 16, 3553, 1444, 16, 883, 4672, 309, 3553, 1444, 422, 389, 56, 1457, 3412, 18513, 67, 2204, 67, 5237, 2871, 30, 365, 18, 7819, 21, 18, 9200, 12, 2150, 13, 327, 2...
if self.center == None or self.bond_width == None:
if self.bond_width == None:
def _draw_n3( self): x1,y1,x2,y2 = self._draw_n1() if self.center == None or self.bond_width == None: self._decide_distance_and_center() d = self.bond_width _k = (1-self.double_length_ratio)/2 x, y, x0, y0 = geometry.find_parallel( x1, y1, x2, y2, d*3/4) dx = x-x0 dy = y-y0 self.second = self.paper.create_line( x-_k*dx, y-_k*dy, x0+_k*dx, y0+_k*dy, width=self.line_width, fill=self.line_color) self.third = self.paper.create_line( 2*x1-x-_k*dx, 2*y1-y-_k*dy, 2*x2-x0+_k*dx, 2*y2-y0+_k*dy, width=self.line_width, fill=self.line_color)
5f5d6008fa9cca2d302d06c0211631310bea39cc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4298/5f5d6008fa9cca2d302d06c0211631310bea39cc/classes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9446, 67, 82, 23, 12, 365, 4672, 619, 21, 16, 93, 21, 16, 92, 22, 16, 93, 22, 273, 365, 6315, 9446, 67, 82, 21, 1435, 309, 365, 18, 26425, 67, 2819, 422, 599, 30, 365, 6315,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9446, 67, 82, 23, 12, 365, 4672, 619, 21, 16, 93, 21, 16, 92, 22, 16, 93, 22, 273, 365, 6315, 9446, 67, 82, 21, 1435, 309, 365, 18, 26425, 67, 2819, 422, 599, 30, 365, 6315,...
joiner = '\n--' + boundary + '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--',
if msgtexts: self._fp.write(msgtexts.pop(0)) for body_part in msgtexts: print >> self._fp, '\n--' + boundary self._fp.write(body_part) self._fp.write('\n--' + boundary + '--')
def _handle_multipart(self, msg): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has ever been attached boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary print >> self._fp, '\n' print >> self._fp, '--' + boundary + '--' return elif _isstring(subparts): # e.g. a non-strict parse of a message with no starting boundary. self._fp.write(subparts) return elif not isinstance(subparts, ListType): # Scalar payload subparts = [subparts] for part in subparts: s = StringIO() g = self.clone(s) g.flatten(part, unixfrom=False) msgtexts.append(s.getvalue()) # Now make sure the boundary we've selected doesn't appear in any of # the message texts. alltext = NL.join(msgtexts) # BAW: What about boundaries that are wrapped in double-quotes? boundary = msg.get_boundary(failobj=_make_boundary(alltext)) # If we had to calculate a new boundary because the body text # contained that string, set the new boundary. We don't do it # unconditionally because, while set_boundary() preserves order, it # doesn't preserve newlines/continuations in headers. This is no big # deal in practice, but turns out to be inconvenient for the unittest # suite. if msg.get_boundary() <> boundary: msg.set_boundary(boundary) # Write out any preamble if msg.preamble is not None: self._fp.write(msg.preamble) # If preamble is the empty string, the length of the split will be # 1, but the last element will be the empty string. If it's # anything else but does not end in a line separator, the length # will be > 1 and not end in an empty string. We need to # guarantee a newline after the preamble, but don't add too many. plines = NLCRE.split(msg.preamble) if plines <> [''] and plines[-1] <> '': self._fp.write('\n') # First boundary is a bit different; it doesn't have a leading extra # newline. print >> self._fp, '--' + boundary # Join and write the individual parts joiner = '\n--' + boundary + '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--', # Write out any epilogue if msg.epilogue is not None: if not msg.epilogue.startswith('\n'): print >> self._fp self._fp.write(msg.epilogue)
a484afe325164155d408e376292799b6871d1e1c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a484afe325164155d408e376292799b6871d1e1c/Generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4110, 67, 16404, 12, 2890, 16, 1234, 4672, 468, 1021, 28837, 2674, 353, 358, 1045, 596, 1517, 1087, 18190, 16, 2691, 2182, 777, 468, 9475, 16, 471, 1508, 1221, 3071, 716, 326, 7679,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4110, 67, 16404, 12, 2890, 16, 1234, 4672, 468, 1021, 28837, 2674, 353, 358, 1045, 596, 1517, 1087, 18190, 16, 2691, 2182, 777, 468, 9475, 16, 471, 1508, 1221, 3071, 716, 326, 7679,...
tripleQuote = QuotedString('"""', multiline=True, unquoteResults=False)+ \
tripleQuote = QuotedString('"""', multiline=True, unquoteResults=False) | \
def convertToEnglish(s,l,t): """search worddict to match keywords if not in keyword, replace the chinese variable/argument/ function name/class name/method name to a variable with prefix 'p' """ tmp = t[0].encode("utf8") if tmp in worddict: word = worddict[tmp].decode("utf8") else: word = zh_ord(t[0]) return word
06579b52543980de12efe484fbfa6f8e077ba64d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1969/06579b52543980de12efe484fbfa6f8e077ba64d/zhpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8137, 664, 13740, 12, 87, 16, 80, 16, 88, 4672, 3536, 3072, 14591, 449, 933, 358, 845, 7093, 225, 309, 486, 316, 4932, 16, 1453, 326, 462, 25331, 2190, 19, 3446, 19, 445, 508, 19, 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, 8137, 664, 13740, 12, 87, 16, 80, 16, 88, 4672, 3536, 3072, 14591, 449, 933, 358, 845, 7093, 225, 309, 486, 316, 4932, 16, 1453, 326, 462, 25331, 2190, 19, 3446, 19, 445, 508, 19, 11...
def __init__(self, filename):
def __init__(self, filename, config={}):
def __init__(self, filename): self.items = {} self.filename = filename self.fp = open(filename) self.lineno = 0 self.resolving = {} self.resolved = {} self.pushback = None
10b20e795b8150162255e3169e0e933f9ae84032 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/10b20e795b8150162255e3169e0e933f9ae84032/unweave.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1544, 16, 642, 12938, 4672, 365, 18, 3319, 273, 2618, 365, 18, 3459, 273, 1544, 365, 18, 7944, 273, 1696, 12, 3459, 13, 365, 18, 17782, 273, 374, 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, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1544, 16, 642, 12938, 4672, 365, 18, 3319, 273, 2618, 365, 18, 3459, 273, 1544, 365, 18, 7944, 273, 1696, 12, 3459, 13, 365, 18, 17782, 273, 374, 365, ...
return type, rate, nchannels, data_size/frame_size, sample_bits
return type, rate, nchannels, data_size//frame_size, sample_bits
def test_au(h, f): if h[:4] == '.snd': f = get_long_be elif h[:4] in ('\0ds.', 'dns.'): f = get_long_le else: return None type = 'au' hdr_size = f(h[4:8]) data_size = f(h[8:12]) encoding = f(h[12:16]) rate = f(h[16:20]) nchannels = f(h[20:24]) sample_size = 1 # default if encoding == 1: sample_bits = 'U' elif encoding == 2: sample_bits = 8 elif encoding == 3: sample_bits = 16 sample_size = 2 else: sample_bits = '?' frame_size = sample_size * nchannels return type, rate, nchannels, data_size/frame_size, sample_bits
e313c555d2ba5154c0fda7d78c5413d6746654aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/e313c555d2ba5154c0fda7d78c5413d6746654aa/sndhdr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8377, 12, 76, 16, 284, 4672, 309, 366, 10531, 24, 65, 422, 2418, 87, 4880, 4278, 284, 273, 336, 67, 5748, 67, 2196, 1327, 366, 10531, 24, 65, 316, 7707, 64, 20, 2377, 1093,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8377, 12, 76, 16, 284, 4672, 309, 366, 10531, 24, 65, 422, 2418, 87, 4880, 4278, 284, 273, 336, 67, 5748, 67, 2196, 1327, 366, 10531, 24, 65, 316, 7707, 64, 20, 2377, 1093,...
def test03_lock_timeout(self):
def _DISABLED_test03_lock_timeout(self):
def test03_lock_timeout(self): self.env.set_timeout(0, db.DB_SET_LOCK_TIMEOUT) self.env.set_timeout(0, db.DB_SET_TXN_TIMEOUT) self.env.set_timeout(123456, db.DB_SET_LOCK_TIMEOUT) self.env.set_timeout(7890123, db.DB_SET_TXN_TIMEOUT)
1bc83e1f62516edeae9342624bd118a4d482e337 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/1bc83e1f62516edeae9342624bd118a4d482e337/test_lock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 24493, 67, 3813, 4630, 67, 739, 67, 4538, 12, 2890, 4672, 377, 365, 18, 3074, 18, 542, 67, 4538, 12, 20, 16, 1319, 18, 2290, 67, 4043, 67, 6589, 67, 9503, 13, 365, 18, 3074, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 24493, 67, 3813, 4630, 67, 739, 67, 4538, 12, 2890, 4672, 377, 365, 18, 3074, 18, 542, 67, 4538, 12, 20, 16, 1319, 18, 2290, 67, 4043, 67, 6589, 67, 9503, 13, 365, 18, 3074, 1...
return self.autodiscovery.get(
url = self.autodiscovery.get(
def feed_url(self, page_url): page_data = urllib2.urlopen(page_url).read() self.feed(page_data) # Atom has cleaner semantics than RSS, so give it priority return self.autodiscovery.get( 'atom', self.autodiscovery.get('rss'))
8a035cdf858ac098c88e54176712332c7bc1f307 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/8a035cdf858ac098c88e54176712332c7bc1f307/update.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4746, 67, 718, 12, 2890, 16, 1363, 67, 718, 4672, 1363, 67, 892, 273, 11527, 22, 18, 295, 18589, 12, 2433, 67, 718, 2934, 896, 1435, 365, 18, 7848, 12, 2433, 67, 892, 13, 468, 7149, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4746, 67, 718, 12, 2890, 16, 1363, 67, 718, 4672, 1363, 67, 892, 273, 11527, 22, 18, 295, 18589, 12, 2433, 67, 718, 2934, 896, 1435, 365, 18, 7848, 12, 2433, 67, 892, 13, 468, 7149, ...
self.editor.SaveAndHide()
if self.editor.IsShown(): self.editor.SaveAndHide()
def GrabFocusHack(self): self.editor.SaveAndHide()
d90d5ede2395197b7f3f30ddff799aa099ce8bcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/d90d5ede2395197b7f3f30ddff799aa099ce8bcd/CalendarCanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17150, 9233, 44, 484, 12, 2890, 4672, 309, 365, 18, 9177, 18, 2520, 27042, 13332, 365, 18, 9177, 18, 4755, 1876, 15690, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17150, 9233, 44, 484, 12, 2890, 4672, 309, 365, 18, 9177, 18, 2520, 27042, 13332, 365, 18, 9177, 18, 4755, 1876, 15690, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
print >> env_file, "PATH=" + self.install_scripts + ":${PATH}"
print >> env_file, "PATH=" + glue_install_scripts + ":${PATH}"
def run(self):
ae44075ce5df81f6404c737cc4720f6c045115d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3589/ae44075ce5df81f6404c737cc4720f6c045115d1/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 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, 1086, 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 __namedColors is not None: return __namedColors
global _namedColors if _namedColors is not None: return _namedColors
def getAllNamedColors(): #returns a dictionary of all the named ones in the module # uses a singleton for efficiency if __namedColors is not None: return __namedColors import colors __namedColors = {} for (name, value) in colors.__dict__.items(): if isinstance(value, Color): __namedColors[name] = value return __namedColors
ae7f8d797d822a5b6ac4442a1d8b238430be7f63 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/ae7f8d797d822a5b6ac4442a1d8b238430be7f63/colors.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5514, 7604, 12570, 13332, 468, 6154, 279, 3880, 434, 777, 326, 4141, 5945, 316, 326, 1605, 468, 4692, 279, 6396, 364, 30325, 2552, 389, 13188, 12570, 309, 389, 13188, 12570, 353, 486, 599,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5514, 7604, 12570, 13332, 468, 6154, 279, 3880, 434, 777, 326, 4141, 5945, 316, 326, 1605, 468, 4692, 279, 6396, 364, 30325, 2552, 389, 13188, 12570, 309, 389, 13188, 12570, 353, 486, 599,...
return {'value': {'th_weight' : 0, 'product_packaging': False,
return {'value': {'th_weight': 0, 'product_packaging': False,
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False): if not partner_id: raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sale form !\nPlease set one customer before choosing a product.')) warning={} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') product_obj = self.pool.get('product.product') if partner_id: lang = partner_obj.browse(cr, uid, partner_id).lang context = {'lang': lang, 'partner_id': partner_id}
fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/fa29dc7d9e6d87f49bc3316e2b56fa977448ad6c/sale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 846, 335, 5449, 16, 3017, 16, 26667, 33, 20, 16, 582, 362, 33, 8381, 16, 26667, 67, 89, 538, 33, 20, 16, 582, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3017, 67, 350, 67, 3427, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 846, 335, 5449, 16, 3017, 16, 26667, 33, 20, 16, 582, 362, 33, 8381, 16, 26667, 67, 89, 538, 33, 20, 16, 582, ...
task.addJobs( jobs )
task.appendJobs( jobs )
def loadTaskJobs( self, task, jobList=None, jobAttributes=None, runningAttrs=None, all=False, strict=True ) : """ retrieve task information from db using task id and defined static/running attributes. Does not allow load of jobs without running instance """
1aea1369acadb6107a8268837f444fdd17e69b15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/1aea1369acadb6107a8268837f444fdd17e69b15/BossLiteAPI.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2174, 7276, 12, 365, 16, 1562, 16, 1719, 682, 33, 7036, 16, 1719, 2498, 33, 7036, 16, 3549, 8262, 33, 7036, 16, 777, 33, 8381, 16, 5490, 33, 5510, 262, 294, 3536, 4614, 1562, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 2174, 7276, 12, 365, 16, 1562, 16, 1719, 682, 33, 7036, 16, 1719, 2498, 33, 7036, 16, 3549, 8262, 33, 7036, 16, 777, 33, 8381, 16, 5490, 33, 5510, 262, 294, 3536, 4614, 1562, 1...
except TypeError: pass else: raise TestFailed, 'expected TypeError'
except (AttributeError, TypeError): pass else: raise TestFailed, 'expected TypeError or AttributeError'
def b(): 'my docstring' pass
c7c1012045bf79ac48a43527b32ee5543013d951 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c7c1012045bf79ac48a43527b32ee5543013d951/test_funcattrs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 13332, 296, 4811, 14525, 11, 1342, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 324, 13332, 296, 4811, 14525, 11, 1342, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
@param details: Description, Ddtails of case history if any
@param details: Description, Details of case history if any
def history(self, cr, uid, cases, keyword, history=False, subject=None, email=False, details=None, \ email_from=False, message_id=False, references=None, attach=None, email_cc=None, \ email_bcc=None, email_date=None, context=None): """ @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param cases: a browse record list @param keyword: Case action keyword e.g.: If case is closed "Close" keyword is used @param history: Value True/False, If True it makes entry in case History otherwise in Case Log @param email: Email-To / Recipient address @param email_from: Email From / Sender address if any @param email_cc: Comma-Separated list of Carbon Copy Emails To addresse if any @param email_bcc: Comma-Separated list of Blind Carbon Copy Emails To addresses if any @param email_date: Email Date string if different from now, in server Timezone @param details: Description, Ddtails of case history if any @param atach: Attachment sent in email @param context: A standard dictionary for contextual values""" if context is None: context = {} if attach is None: attach = []
91147298af06d8794f21edb9c87d76078f43d951 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/91147298af06d8794f21edb9c87d76078f43d951/mail_gateway.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 4422, 16, 4555, 16, 6088, 16, 4932, 16, 4927, 33, 8381, 16, 3221, 33, 7036, 16, 2699, 33, 8381, 16, 3189, 33, 7036, 16, 521, 2699, 67, 2080, 33, 8381, 16, 883, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 4422, 16, 4555, 16, 6088, 16, 4932, 16, 4927, 33, 8381, 16, 3221, 33, 7036, 16, 2699, 33, 8381, 16, 3189, 33, 7036, 16, 521, 2699, 67, 2080, 33, 8381, 16, 883, ...
log.info('delay packet %s', packet_type)
log.debug('delay packet %s', packet_type)
def _send_packet(self, seq, packet_type, payload): """ Send a packet (header + payload) to the other side. """ if not self._socket: return header = struct.pack("I4sI", seq, packet_type, len(payload)) if not self._authenticated and packet_type not in ('RESP', 'AUTH'): log.info('delay packet %s', packet_type) self._write_buffer_delayed += header + payload else: self._write_buffer += header + payload
842d345982b9d6198e33a7209cc9906dc2aa2fbd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11722/842d345982b9d6198e33a7209cc9906dc2aa2fbd/rpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4661, 67, 11482, 12, 2890, 16, 3833, 16, 4414, 67, 723, 16, 2385, 4672, 3536, 2479, 279, 4414, 261, 3374, 397, 2385, 13, 358, 326, 1308, 4889, 18, 3536, 309, 486, 365, 6315, 7814,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4661, 67, 11482, 12, 2890, 16, 3833, 16, 4414, 67, 723, 16, 2385, 4672, 3536, 2479, 279, 4414, 261, 3374, 397, 2385, 13, 358, 326, 1308, 4889, 18, 3536, 309, 486, 365, 6315, 7814,...
opts = ['ssl','rescan', 'pernode=', 'resume=', 'html','http','ssh','smtp','pop','imap','dns','dnsrebind','policies','exit=']
opts = ['ssl','rescan', 'pernode=', 'resume=', 'html','http','ssh','smtp','pop','imap','dns','dnsrebind','policies','exit=','target=']
def main(argv): # make sure we have something to test for if len(argv) < 2: print '' print 'Please provide at least one test option:' print '--pernode <n>' print '--resume [<n>]' print '--rescan [<n>]' print '--ssl' print '--http' print '--html'
ba5f7fa040706daf1e1b988aba2b93971703387a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3762/ba5f7fa040706daf1e1b988aba2b93971703387a/soat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 4672, 468, 1221, 3071, 732, 1240, 5943, 358, 1842, 364, 309, 562, 12, 19485, 13, 411, 576, 30, 1172, 875, 1172, 296, 8496, 5615, 622, 4520, 1245, 1842, 1456, 2497, 1172,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 468, 1221, 3071, 732, 1240, 5943, 358, 1842, 364, 309, 562, 12, 19485, 13, 411, 576, 30, 1172, 875, 1172, 296, 8496, 5615, 622, 4520, 1245, 1842, 1456, 2497, 1172,...
if( cudaSuccess != err)
if( cudaSuccess != err)
def c_code(self, node, nodename, (x, z, gz), (gx,), sub): fail = sub['fail'] ds0, ds1 = self.ds ignore_border = int(self.ignore_border) return """ if (%(x)s->nd != 4 || %(z)s->nd != 4 || %(gz)s->nd != 4) { PyErr_SetString(PyExc_ValueError, "rank error"); %(fail)s; } if ((NULL == %(gx)s) || (CudaNdarray_HOST_DIMS(%(gx)s)[0] != CudaNdarray_HOST_DIMS(%(x)s)[0]) || (CudaNdarray_HOST_DIMS(%(gx)s)[1] != CudaNdarray_HOST_DIMS(%(x)s)[1]) || (CudaNdarray_HOST_DIMS(%(gx)s)[2] != CudaNdarray_HOST_DIMS(%(x)s)[2]) || (CudaNdarray_HOST_DIMS(%(gx)s)[3] != CudaNdarray_HOST_DIMS(%(x)s)[3])) { Py_XDECREF(%(gx)s); %(gx)s = (CudaNdarray*)CudaNdarray_new_null(); if ((NULL == %(gx)s) || CudaNdarray_alloc_contiguous(%(gx)s, 4, CudaNdarray_HOST_DIMS(%(x)s))) { Py_XDECREF(%(gx)s); %(gx)s = NULL; %(fail)s; } } { //TODO: supporting more output columns than threads // make sure we cover every x row when ignore border isset and there's a border present to be ignored int needs_extra_z_col = %(ignore_border)s && (CudaNdarray_HOST_DIMS(%(x)s)[2] %% %(ds0)s); dim3 grid(CudaNdarray_HOST_DIMS(%(z)s)[0],CudaNdarray_HOST_DIMS(%(z)s)[2] + (needs_extra_z_col ? 1 : 0)); dim3 block(CudaNdarray_HOST_DIMS(%(x)s)[3]); kDownsampleMaxGrad_%(nodename)s<%(ds0)s, %(ds1)s> <<<grid, block>>>( CudaNdarray_HOST_DIMS(%(z)s)[0], CudaNdarray_HOST_DIMS(%(z)s)[1], CudaNdarray_HOST_DIMS(%(z)s)[2], CudaNdarray_HOST_DIMS(%(z)s)[3], CudaNdarray_HOST_DIMS(%(x)s)[2], CudaNdarray_HOST_DIMS(%(x)s)[3], CudaNdarray_DEV_DATA(%(x)s), CudaNdarray_HOST_STRIDES(%(x)s)[0], CudaNdarray_HOST_STRIDES(%(x)s)[1], CudaNdarray_HOST_STRIDES(%(x)s)[2], CudaNdarray_HOST_STRIDES(%(x)s)[3], CudaNdarray_DEV_DATA(%(z)s), CudaNdarray_HOST_STRIDES(%(z)s)[0], CudaNdarray_HOST_STRIDES(%(z)s)[1], CudaNdarray_HOST_STRIDES(%(z)s)[2], CudaNdarray_HOST_STRIDES(%(z)s)[3], CudaNdarray_DEV_DATA(%(gz)s), CudaNdarray_HOST_STRIDES(%(gz)s)[0], CudaNdarray_HOST_STRIDES(%(gz)s)[1], CudaNdarray_HOST_STRIDES(%(gz)s)[2], CudaNdarray_HOST_STRIDES(%(gz)s)[3], CudaNdarray_DEV_DATA(%(gx)s)); CNDA_THREAD_SYNC; cudaError_t err = cudaGetLastError(); if( cudaSuccess != err) { PyErr_Format(PyExc_RuntimeError, "Cuda error: %%s: %%s. (grid: %%i x %%i; block: %%i x %%i x %%i)\\n", "kDownsampleMaxGrad_%(nodename)s", cudaGetErrorString(err), grid.x, grid.y, block.x, block.y, block.z); %(fail)s; } } """ % locals()
98f8608be75b8b81997fa956395f0063b48ea567 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/98f8608be75b8b81997fa956395f0063b48ea567/blas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 12, 2890, 16, 756, 16, 14003, 1069, 16, 261, 92, 16, 998, 16, 14136, 3631, 261, 75, 92, 16, 3631, 720, 4672, 2321, 273, 720, 3292, 6870, 3546, 3780, 20, 16, 3780, 21, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 12, 2890, 16, 756, 16, 14003, 1069, 16, 261, 92, 16, 998, 16, 14136, 3631, 261, 75, 92, 16, 3631, 720, 4672, 2321, 273, 720, 3292, 6870, 3546, 3780, 20, 16, 3780, 21, ...
self.argc = len(self.args) + 1
self.argn = len(self.args)
def __init__(self, arglead, cmdline, complete_command_aliases=False, complete_hidden_commands=False):
dfb6494a77abf10a9a7094258aadd4fdc1e9a023 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1604/dfb6494a77abf10a9a7094258aadd4fdc1e9a023/bzrstatus.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1501, 24429, 16, 22877, 16, 3912, 67, 3076, 67, 13831, 33, 8381, 16, 3912, 67, 6345, 67, 7847, 33, 8381, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1501, 24429, 16, 22877, 16, 3912, 67, 3076, 67, 13831, 33, 8381, 16, 3912, 67, 6345, 67, 7847, 33, 8381, 4672, 2, -100, -100, -100, -100, -100, -100, -10...
q = sqrt(npy.dot(d, d))
q = sqrt(np.dot(d, d))
def adjust_positions(self, old, new): p1, p2 = old[self.indices] d = p2 - p1 p = sqrt(npy.dot(d, d)) q1, q2 = new[self.indices] d = q2 - q1 q = sqrt(npy.dot(d, d)) d *= 0.5 * (p - q) / q new[self.indices] = (q1 - d, q2 + d)
7500c4e78232ffffc9664aa36989b59b01381456 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/7500c4e78232ffffc9664aa36989b59b01381456/constraints.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5765, 67, 12388, 12, 2890, 16, 1592, 16, 394, 4672, 293, 21, 16, 293, 22, 273, 1592, 63, 2890, 18, 6836, 65, 302, 273, 293, 22, 300, 293, 21, 293, 273, 5700, 12, 82, 2074, 18, 9811...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5765, 67, 12388, 12, 2890, 16, 1592, 16, 394, 4672, 293, 21, 16, 293, 22, 273, 1592, 63, 2890, 18, 6836, 65, 302, 273, 293, 22, 300, 293, 21, 293, 273, 5700, 12, 82, 2074, 18, 9811...
gLogger.info("[%s] MigratingToMigrated: Found no 'Migrating' files." % se)
gLogger.info( "[%s] MigratingToMigrated: Found no 'Migrating' files." % se )
def MigratingToMigrated(self,se): """ Obtain the active files from the migration monitoring db and check their status """ # First get the migrating files from the database gLogger.info("[%s] MigratingToMigrated: Attempting to obtain 'Migrating' files." % se) res = self.__getFiles(se,'Migrating') if not res['OK']: gLogger.error("[%s] MigratingToMigrated: Failed to get 'Migrating' files." % se, res['Message']) return res pfnIDs = res['Value']['PFNIDs'] if not pfnIDs: gLogger.info("[%s] MigratingToMigrated: Found no 'Migrating' files." % se) return S_OK() migratingFiles = res['Value']['Files'] gLogger.info("[%s] MigratingToMigrated: Found %d 'Migrating' files." % (se, len(pfnIDs))) gMonitor.addMark("MigratingFiles%s" % se,len(pfnIDs)) gLogger.info("[%s] MigratingToMigrated: Obtaining physical file metadata for 'Migrating' files." % se) startTime = datetime.datetime.utcnow() res = self.__getMigratedFiles(se,pfnIDs.keys()) if not res['OK']: gLogger.error("[%s] MigratingToMigrated: Failed to get 'Migrating' file metadata." % se, res['Message']) return res assumedEndTime = datetime.datetime.utcnow()-((datetime.datetime.utcnow()-startTime)/2) # Assumed that the files are found migrated midway through obtaining the metadata previousMonitorTime = self.lastMonitors[se] self.lastMonitors[se] = datetime.datetime.utcnow() terminal = res['Value']['Terminal'] migrated = res['Value']['Migrated']
d0365a9152f6e7105162edd475d5401448bfdaed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d0365a9152f6e7105162edd475d5401448bfdaed/MigrationMonitoringAgent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 490, 2757, 1776, 774, 25483, 690, 12, 2890, 16, 307, 4672, 3536, 24850, 326, 2695, 1390, 628, 326, 6333, 16309, 1319, 471, 866, 3675, 1267, 3536, 468, 5783, 336, 326, 4196, 1776, 1390, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 490, 2757, 1776, 774, 25483, 690, 12, 2890, 16, 307, 4672, 3536, 24850, 326, 2695, 1390, 628, 326, 6333, 16309, 1319, 471, 866, 3675, 1267, 3536, 468, 5783, 336, 326, 4196, 1776, 1390, 6...
def _get_info_files(self, parent_path=None): """ Return info.py files from parent_path subdirectories.
def _get_info_files(self, package_dir, parent_path, parent_package=None): """ Return list of (package name,info.py file) from parent_path subdirectories.
def _get_info_files(self, parent_path=None): """ Return info.py files from parent_path subdirectories. """ from glob import glob if parent_path is None: parent_path = self.parent_path info_files = glob(os.path.join(parent_path,'*','info.py')) for info_file in glob(os.path.join(parent_path,'*','info.pyc')): if info_file[:-1] not in info_files: info_files.append(info_file) for info_file in info_files[:]: info_files.extend(self._get_info_files(os.path.dirname(info_file))) return info_files
f169e88dee50378c8accfb7a67438271a73fcc61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/f169e88dee50378c8accfb7a67438271a73fcc61/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 1376, 67, 2354, 12, 2890, 16, 2181, 67, 1214, 16, 982, 67, 803, 16, 982, 67, 5610, 33, 7036, 4672, 3536, 2000, 666, 434, 261, 5610, 508, 16, 1376, 18, 2074, 585, 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, 389, 588, 67, 1376, 67, 2354, 12, 2890, 16, 2181, 67, 1214, 16, 982, 67, 803, 16, 982, 67, 5610, 33, 7036, 4672, 3536, 2000, 666, 434, 261, 5610, 508, 16, 1376, 18, 2074, 585, 13, ...
response += self._processAtom(atom, sessionID).strip()
response += self._processElement(elem, sessionID).strip()
def _respond(self, input, sessionID): "Private version of respond(), does the real work." if len(input) == 0: return ""
cdb5ca51cf362e7f41cc166060e200bc84fcb1e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6428/cdb5ca51cf362e7f41cc166060e200bc84fcb1e8/Kernel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17863, 12, 2890, 16, 810, 16, 13737, 4672, 315, 6014, 1177, 434, 6846, 9334, 1552, 326, 2863, 1440, 1199, 309, 562, 12, 2630, 13, 422, 374, 30, 327, 1408, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 17863, 12, 2890, 16, 810, 16, 13737, 4672, 315, 6014, 1177, 434, 6846, 9334, 1552, 326, 2863, 1440, 1199, 309, 562, 12, 2630, 13, 422, 374, 30, 327, 1408, 2, -100, -100, -100, -10...
binary = self.stream.read(_float_format.size) self.stack.append(_float_format.unpack(binary)[0])
binary = self.stream.read(FLOAT_FORMAT_SIZE) self.stack.append(struct.unpack(FLOAT_FORMAT, binary)[0])
def load_float(self): binary = self.stream.read(_float_format.size) self.stack.append(_float_format.unpack(binary)[0])
b1d087a8d9755e46aa845d71fc1175153b4a066d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7009/b1d087a8d9755e46aa845d71fc1175153b4a066d/serializer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 5659, 12, 2890, 4672, 3112, 273, 365, 18, 3256, 18, 896, 24899, 5659, 67, 2139, 18, 1467, 13, 365, 18, 3772, 18, 6923, 24899, 5659, 67, 2139, 18, 17309, 12, 8578, 25146, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 67, 5659, 12, 2890, 4672, 3112, 273, 365, 18, 3256, 18, 896, 24899, 5659, 67, 2139, 18, 1467, 13, 365, 18, 3772, 18, 6923, 24899, 5659, 67, 2139, 18, 17309, 12, 8578, 25146, 20, ...
def __init__(self): models.Model.__init__(self)
def __init__(self, *args, **kwargs): models.Model.__init__(self, *args, **kwargs)
def __init__(self): models.Model.__init__(self)
02c648933f66c65e8b50d78b54efd057129a2a4e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6163/02c648933f66c65e8b50d78b54efd057129a2a4e/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3679, 18, 1488, 16186, 2738, 972, 12, 2890, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 3679, 18, 1488, 16186, 2738, 972, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if not host: return addinfo(open(url2pathname(file), 'r'), noheaders())
if not host: return addinfourl(open(url2pathname(file), 'r'), noheaders(), self.openedurl)
def open_local_file(self, url): host, file = splithost(url) if not host: return addinfo(open(url2pathname(file), 'r'), noheaders()) host, port = splitport(host) if not port and socket.gethostbyname(host) in ( localhost(), thishost()): file = unquote(file) return addinfo(open(url2pathname(file), 'r'), noheaders()) raise IOError, ('local file error', 'not on local host')
7b299496167f0d4abb56eca6712f76e2985429f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7b299496167f0d4abb56eca6712f76e2985429f2/urllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3729, 67, 768, 12, 2890, 16, 880, 4672, 1479, 16, 585, 273, 6121, 483, 669, 12, 718, 13, 309, 486, 1479, 30, 327, 527, 10625, 477, 80, 12, 3190, 12, 718, 22, 28336, 12, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 67, 3729, 67, 768, 12, 2890, 16, 880, 4672, 1479, 16, 585, 273, 6121, 483, 669, 12, 718, 13, 309, 486, 1479, 30, 327, 527, 10625, 477, 80, 12, 3190, 12, 718, 22, 28336, 12, 7...
version = re.search("VERSIONSTRING (\S+)", file("client/version.h").read()).group(1)
varstr = ""; strings = ""; varname = ""; names = ""; prolog = ""; example = '<?xml version="1.0" encoding="utf-8" standalone="yes"?>\n'; example += '<Language Name="Example Language" Native="English" Code="en" Author="arnetheduck" Version=' + version + ' Revision="1" RightToLeft="0">\n' example += '\t<Strings>\n'; lre = re.compile('\s*(\w+),\s*//\s*\"(.+)\"\s*') decoder = codecs.getdecoder('cp1252') encoder = codecs.getencoder('utf8') recodeattr = lambda s: encoder(decoder(quoteattr(s))[0])[0] recodeval = lambda s: encoder(decoder(escape(s, {"\\\\":"\\","\\t":"\t"}))[0])[0] for x in file("client/StringDefs.h", "r"): if x.startswith("// @Strings: "): varstr = x[13:].strip(); elif x.startswith("// @Names: "): varname = x[11:].strip(); elif x.startswith("// @Prolog: "): prolog += x[12:]; elif len(x) >= 5: match = lre.match(x); if match is not None: name , value = match.groups(); strings += '"' + value + '", \n' newname = makename(name) names += '"' + newname + '", \n' example += '\t\t<String Name=%s>%s</String>\n' % (recodeattr(newname), recodeval(value)) example += '\t</Strings>\n'; example += '</Language>\n'; file('client/StringDefs.cpp', 'w').write(prolog + varstr + " = {\n" + strings + "};\n" + varname + " = {\n" + names + "};\n"); file('Example.xml', 'w').write(example);
def makename(oldname): name = ""; nextBig = True; for x in oldname: if x == '_': nextBig = True; else: if nextBig: name += x.upper(); nextBig = False; else: name += x.lower(); return name;
143b30b85746f3901532a5ed67635db2a19368ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7868/143b30b85746f3901532a5ed67635db2a19368ca/makedefs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 1069, 12, 1673, 529, 4672, 508, 273, 1408, 31, 1024, 9901, 273, 1053, 31, 364, 619, 316, 1592, 529, 30, 309, 619, 422, 2070, 4278, 1024, 9901, 273, 1053, 31, 469, 30, 309, 1024,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 1069, 12, 1673, 529, 4672, 508, 273, 1408, 31, 1024, 9901, 273, 1053, 31, 364, 619, 316, 1592, 529, 30, 309, 619, 422, 2070, 4278, 1024, 9901, 273, 1053, 31, 469, 30, 309, 1024,...
def TestAll(self, root_key): self.WriteTestData(root_key) self.ReadTestData(root_key) self.DeleteTestData(root_key) def testLocalMachineRegistryWorks(self): self.TestAll(HKEY_CURRENT_USER) def testConnectRegistryToLocalMachineWorks(self):
def _test_all(self, root_key): self._write_test_data(root_key) self._read_test_data(root_key) self._delete_test_data(root_key) class LocalWinregTests(BaseWinregTests): def test_registry_works(self): self._test_all(HKEY_CURRENT_USER) def test_registry_works_extended_functions(self): cke = lambda key, sub_key: CreateKeyEx(key, sub_key, 0, KEY_ALL_ACCESS) self._write_test_data(HKEY_CURRENT_USER, cke) oke = lambda key, sub_key: OpenKeyEx(key, sub_key, 0, KEY_READ) self._read_test_data(HKEY_CURRENT_USER, oke) self._delete_test_data(HKEY_CURRENT_USER) def test_connect_registry_to_local_machine_works(self):
def TestAll(self, root_key): self.WriteTestData(root_key) self.ReadTestData(root_key) self.DeleteTestData(root_key)
332c84498e5bd7902d41b2e404b6f2b9218caba7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/332c84498e5bd7902d41b2e404b6f2b9218caba7/test_winreg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7766, 1595, 12, 2890, 16, 1365, 67, 856, 4672, 365, 18, 3067, 4709, 751, 12, 3085, 67, 856, 13, 365, 18, 1994, 4709, 751, 12, 3085, 67, 856, 13, 365, 18, 2613, 4709, 751, 12, 3085, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7766, 1595, 12, 2890, 16, 1365, 67, 856, 4672, 365, 18, 3067, 4709, 751, 12, 3085, 67, 856, 13, 365, 18, 1994, 4709, 751, 12, 3085, 67, 856, 13, 365, 18, 2613, 4709, 751, 12, 3085, ...
os.path.join(solution_name, "src", "t")).AndReturn(scm_wrapper_t)
gclient.os.path.join(solution_name, "src", "t") ).AndReturn(scm_wrapper_t)
def testRunOnDepsRelativePaths(self): solution_name = 'testRunOnDepsRelativePaths_solution_name' gclient_config = ( "solutions = [ {\n" " 'name': '%s',\n" " 'url': '%s',\n" " 'custom_deps': {},\n" "} ]\n" ) % (solution_name, self.url)
90ba161b70b445eba62b2a376e4fa2f508854e13 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/90ba161b70b445eba62b2a376e4fa2f508854e13/gclient_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1997, 1398, 14430, 8574, 4466, 12, 2890, 4672, 6959, 67, 529, 273, 296, 3813, 1997, 1398, 14430, 8574, 4466, 67, 13385, 67, 529, 11, 314, 2625, 67, 1425, 273, 261, 315, 18281, 6170...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1997, 1398, 14430, 8574, 4466, 12, 2890, 4672, 6959, 67, 529, 273, 296, 3813, 1997, 1398, 14430, 8574, 4466, 67, 13385, 67, 529, 11, 314, 2625, 67, 1425, 273, 261, 315, 18281, 6170...