rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
sw.show_all()
def __init__(self, activator, Kind=SearchBar): gtk.Window.__init__(self) self.set_border_width(12) self.set_title(_("Library Browser")) icon_theme = gtk.icon_theme_get_default() self.set_icon(icon_theme.load_icon( const.ICON, 64, gtk.ICON_LOOKUP_USE_BUILTIN))
f1bdc25eef59b94c1e9407c010ba679e8aa77ae5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/f1bdc25eef59b94c1e9407c010ba679e8aa77ae5/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5981, 639, 16, 5851, 33, 2979, 5190, 4672, 22718, 18, 3829, 16186, 2738, 972, 12, 2890, 13, 365, 18, 542, 67, 8815, 67, 2819, 12, 2138, 13, 365, 18, 54...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5981, 639, 16, 5851, 33, 2979, 5190, 4672, 22718, 18, 3829, 16186, 2738, 972, 12, 2890, 13, 365, 18, 542, 67, 8815, 67, 2819, 12, 2138, 13, 365, 18, 54...
assert not is_string(paths),`paths`
assert not is_string(paths),repr(paths)
def _fix_paths(paths,local_path,include_non_existing): assert is_sequence(paths), repr(type(paths)) new_paths = [] assert not is_string(paths),`paths` for n in paths: if is_string(n): if '*' in n or '?' in n: p = glob.glob(n) p2 = glob.glob(njoin(local_path,n)) if p2: new_paths.extend(p2) elif p: new_paths.extend(p) else: if include_non_existing: new_paths.append(n) print 'could not resolve pattern in %r: %r' \ % (local_path,n) else: n2 = njoin(local_path,n) if os.path.exists(n2): new_paths.append(n2) else: if os.path.exists(n): new_paths.append(n) elif include_non_existing: new_paths.append(n) if not os.path.exists(n): print 'non-existing path in %r: %r' \ % (local_path,n) elif is_sequence(n): new_paths.extend(_fix_paths(n,local_path,include_non_existing)) else: new_paths.append(n) return [minrelpath(p) for p in new_paths]
c85421c3b85e794d07e8de0304136c068c7f2e17 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/c85421c3b85e794d07e8de0304136c068c7f2e17/misc_util.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 67, 4481, 12, 4481, 16, 3729, 67, 803, 16, 6702, 67, 5836, 67, 11711, 4672, 1815, 353, 67, 6178, 12, 4481, 3631, 8480, 12, 723, 12, 4481, 3719, 394, 67, 4481, 273, 5378, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 67, 4481, 12, 4481, 16, 3729, 67, 803, 16, 6702, 67, 5836, 67, 11711, 4672, 1815, 353, 67, 6178, 12, 4481, 3631, 8480, 12, 723, 12, 4481, 3719, 394, 67, 4481, 273, 5378, 18...
def OnTextEnter(self, event):
def SaveItem(self):
def OnTextEnter(self, event): if self.item != None: self.item.displayName = self.GetValue() self.Hide() event.Skip()
198f845fb11f76a42bb0d89843db2f2bc3f2808d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/198f845fb11f76a42bb0d89843db2f2bc3f2808d/CalendarCanvas.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7074, 1180, 12, 2890, 4672, 309, 365, 18, 1726, 480, 599, 30, 365, 18, 1726, 18, 5417, 461, 273, 365, 18, 967, 620, 1435, 365, 18, 15690, 1435, 871, 18, 6368, 1435, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7074, 1180, 12, 2890, 4672, 309, 365, 18, 1726, 480, 599, 30, 365, 18, 1726, 18, 5417, 461, 273, 365, 18, 967, 620, 1435, 365, 18, 15690, 1435, 871, 18, 6368, 1435, 2, -100, -100, -1...
iwreq = iwstruct.pack("ihBB", -1, 0, 0, pythonwifi.flags.IW_FREQ_AUTO)
iwreq = iwstruct.pack(format, -1, 0, 0, pythonwifi.flags.IW_FREQ_AUTO)
def setFrequency(self, freq): """ Sets the frequency on the card.
48c1d48d2846ae641db4bc5778937b0ba4d0dd0a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3159/48c1d48d2846ae641db4bc5778937b0ba4d0dd0a/iwlibs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 13865, 12, 2890, 16, 7684, 4672, 3536, 11511, 326, 8670, 603, 326, 5270, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 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, 444, 13865, 12, 2890, 16, 7684, 4672, 3536, 11511, 326, 8670, 603, 326, 5270, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
t=valu.split(" ") opt=t[0] key=t[1]
opt, key, action, param=valu.split(None,3)
def e17_keys(): try: import pyetun_keys keys=pyetun_keys.get_KEYS() mod=pyetun_keys.get_MODIFIERS() action=pyetun_keys.get_ACTION() par=pyetun_keys.get_PARAMS() for index,i in enumerate(keys): print bold("[MODIFIER+KEY] "), print mod[index],"+",i, print bold(" [ACTION] "), print action[index], print bold(" [ACTION PARAMS] "), print par[index][:-1] print "> Options: " print bold("[a]dd keybinding <modifier+key> <action> <action_params>") print bold("[d]elete keybinding <modifier+key> <action> <action_params>") print "EXAMPLE: a ALT+g exec gedit * This example creates a shortcut key (ALT+g) to open gedit *" print "> CTRL+C - Main Menu" valu=raw_input("Option: ") while 1: try: t=valu.split(" ") opt=t[0] key=t[1] key_final=key.split("+")[1] mod=key.split("+")[0] action=t[2] param=t[3] except IndexError: print "[error]: m00, wrong wrong wrong! ;-)" e17_keys() if opt=="a": pyetun_keys.add_key(key_final,mod,action,param) print bold("KEY:"), print mod,"+",key, "ADDED!" e17_keys() elif opt=="d": pyetun_keys.del_key(key_final,mod,action,param) print bold("KEY:"), print mod,"+",key, "DELETED!" e17_keys() else: print bold("[error] m000 wrong option!") e17_keys() except KeyboardInterrupt: print "\nOops! exiting ;)" console()
ed8ecddeb585ef604137d25f0a0389c26533b33a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2281/ed8ecddeb585ef604137d25f0a0389c26533b33a/pyetun.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 4033, 67, 2452, 13332, 775, 30, 1930, 2395, 278, 318, 67, 2452, 1311, 33, 2074, 278, 318, 67, 2452, 18, 588, 67, 16333, 1435, 681, 33, 2074, 278, 318, 67, 2452, 18, 588, 67, 672...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 4033, 67, 2452, 13332, 775, 30, 1930, 2395, 278, 318, 67, 2452, 1311, 33, 2074, 278, 318, 67, 2452, 18, 588, 67, 16333, 1435, 681, 33, 2074, 278, 318, 67, 2452, 18, 588, 67, 672...
keyword.
keyword. In case the value is not found, -1 is returned. The given list is never altered by this keyword.
def get_index_from_list(self, L, value, start=0, end=None): """Returns the index of the first occurrence of the value on the list.
9e3b0b6f2f5e1229f613f2fc11d15a4072f9d6db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/9e3b0b6f2f5e1229f613f2fc11d15a4072f9d6db/Collections.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1615, 67, 2080, 67, 1098, 12, 2890, 16, 511, 16, 460, 16, 787, 33, 20, 16, 679, 33, 7036, 4672, 3536, 1356, 326, 770, 434, 326, 1122, 13083, 434, 326, 460, 603, 326, 666, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1615, 67, 2080, 67, 1098, 12, 2890, 16, 511, 16, 460, 16, 787, 33, 20, 16, 679, 33, 7036, 4672, 3536, 1356, 326, 770, 434, 326, 1122, 13083, 434, 326, 460, 603, 326, 666, ...
checkupdates = tmpprefs.get('CheckForUpdates') locale = tmpprefs.get('locale')
try: checkupdates = tmpprefs.get('CheckForUpdates') locale = tmpprefs.get('locale') except: pass
def init2(self): Damnlog('Starting DamnMainFrame init stage 2.') if os.path.exists(DV.conf_file_directory + 'lastversion.damnvid'): lastversion = DamnOpenFile(DV.conf_file_directory + 'lastversion.damnvid', 'r') dvversion = lastversion.readline().strip() lastversion.close() del lastversion Damnlog('Version file found; version number read:',dvversion) else: dvversion = 'old' # This is not just an arbitrary erroneous value, it's actually handy in the concatenation on the wx.FileDialog line below Damnlog('No version file found.') Damnlog('Read version:',dvversion,';running version:',DV.version) if dvversion != DV.version: # Just updated to new version, ask what to do about the preferences #dlg = wx.MessageDialog(self, DV.l('DamnVid was updated to ') + DV.version + '.\n' + DV.l('locale:damnvid-updated-export-prefs'), DV.l('DamnVid was successfully updated'), wx.YES | wx.NO | wx.ICON_QUESTION) tmpprefs = DamnVidPrefs() checkupdates = tmpprefs.get('CheckForUpdates') locale = tmpprefs.get('locale') Damnlog('Check for updates preference is',checkupdates) if False: #dlg.ShowModal() == wx.ID_YES: dlg.Destroy() dlg = wx.FileDialog(self, DV.l('Where do you want to export DamnVid\'s configuration?'), tmpprefs.get('lastprefdir'), 'DamnVid-' + dvversion + '-configuration.ini', DV.l('locale:browse-ini-files'), wx.FD_SAVE | wx.FD_OVERWRITE_PROMPT) if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() f = DamnOpenFile(path, 'w') tmpprefs.ini.write(f) f.close() dlg.Destroy() else: pass#dlg.Destroy() # Now, overwrite the preferences! del tmpprefs os.remove(DV.conf_file) shutil.copyfile(DV.curdir + 'conf' + DV.sep + 'conf.ini', DV.conf_file) lastversion = DamnOpenFile(DV.conf_file_directory + 'lastversion.damnvid', 'w') lastversion.write(DV.version.encode('utf8')) lastversion.close() del lastversion tmpprefs = DamnVidPrefs() tmpprefs.set('CheckForUpdates', checkupdates) tmpprefs.set('locale', locale) tmpprefs.save() del tmpprefs Damnlog('Local version check done, initializing DamnMainFrame properties.') self.videos = [] self.clippedvideos = [] self.resultlist = [] self.thisbatch = 0 self.thisvideo = [] self.meta = {} DV.prefs = DamnVidPrefs() self.converting = -1 self.isclosing = False self.searchopen = False self.addurl = None self.loadingvisible = 0 self.onListSelect() Damnlog('DamnMainFrame properties OK, first run?',DV.first_run) if DV.first_run: dlg = wx.MessageDialog(self, DV.l('Welcome to DamnVid ') + DV.version + '!\n' + DV.l('Would you like DamnVid to check for updates every time it starts?'), DV.l('Welcome to DamnVid ') + DV.version + '!', wx.YES | wx.NO | wx.ICON_QUESTION) if dlg.ShowModal() == wx.ID_YES: DV.prefs.set('CheckForUpdates', 'True') else: DV.prefs.set('CheckForUpdates', 'False') if DV.prefs.get('CheckForUpdates') == 'True': Damnlog('DamnMainFrame checking for updates.') self.onCheckUpdates(None) self.SetStatusText(DV.l('DamnVid ready.')) windowpolicy = DV.prefs.get('windowpolicy') if not len(windowpolicy) or windowpolicy=='center': Damnlog('Window policy is centering.') self.Center() elif windowpolicy=='remember': Damnlog('Window policy is remember; trying to load saved window geometry.') lastx = DV.prefs.gets('damnvid-mainwindow','lastx') lasty = DV.prefs.gets('damnvid-mainwindow','lasty') lastw = DV.prefs.gets('damnvid-mainwindow','lastw') lasth = DV.prefs.gets('damnvid-mainwindow','lasth') lastresw = DV.prefs.gets('damnvid-mainwindow','lastresw') lastresh = DV.prefs.gets('damnvid-mainwindow','lastresh') allstuff=(lastx,lasty,lastw,lasth,lastresw,lastresh) Damnlog('Old window geometry information:',allstuff) allstuff2=[] for i in allstuff: try: allstuff2.append(int(i)) except: allstuff2.append(-1) if -1 in allstuff2: Damnlog('Invalid information in old window geometry information; giving up on restoring window geometry.') else: try: screen = wx.Display().GetGeometry()[2:] if allstuff2[4] != screen[0] or allstuff2[5]!= screen[1]: Damnlog('Resolution information is different:',allstuff2[4:5],'vs',screen,'(current); giving up on restoring window geometry.') else: Damnlog('All window geometry tests passed, attempting to restore window geometry.') try: self.SetSizeWH(allstuff2[2],allstuff2[3]) self.MoveXY(allstuff2[0],allstuff2[1]) Damnlog('Window geometry restored successfully.') except: Damnlog('Window manager refused to change window geometry.') except: Damnlog('Could not get screen resolution; giving up on restoring window geometry.') else: Damnlog('Window policy is',windowpolicy,'; doing nothing.') self.buildHistoryMenu() Damnlog('DamnMainFrame: Main window all ready,')
b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11142/b7d25df46cda9abe5d9a3b14b5e4ff8eca58617b/DamnVid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 22, 12, 2890, 4672, 463, 301, 82, 1330, 2668, 11715, 463, 301, 82, 6376, 3219, 1208, 6009, 576, 1093, 13, 309, 1140, 18, 803, 18, 1808, 12, 30199, 18, 3923, 67, 768, 67, 5149, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 22, 12, 2890, 4672, 463, 301, 82, 1330, 2668, 11715, 463, 301, 82, 6376, 3219, 1208, 6009, 576, 1093, 13, 309, 1140, 18, 803, 18, 1808, 12, 30199, 18, 3923, 67, 768, 67, 5149, ...
code1 = _fixescape(this, 1)
code1 = _class_escape(source, this)
def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, this)) elif this == "[": # character set set = []
d46b2a42eda94cbac3b610e36d5f97230d629068 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d46b2a42eda94cbac3b610e36d5f97230d629068/sre_parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 3168, 16, 1936, 16, 2943, 33, 1435, 4672, 225, 468, 1109, 6736, 2652, 1936, 1368, 392, 3726, 666, 18, 225, 720, 4951, 273, 2592, 3234, 12, 4951, 13, 225, 333, 273, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 3168, 16, 1936, 16, 2943, 33, 1435, 4672, 225, 468, 1109, 6736, 2652, 1936, 1368, 392, 3726, 666, 18, 225, 720, 4951, 273, 2592, 3234, 12, 4951, 13, 225, 333, 273, 599, ...
p = [0]*G.num_verts()
p = [None]*G.num_verts()
def blocks_and_cut_vertices(self): """ Computes the blocks and cut vertices of the graph. In the case of a digraph, this computation is done on the underlying graph.
592545f3bcbdce40614121ff33879bf7c4995e08 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/592545f3bcbdce40614121ff33879bf7c4995e08/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4398, 67, 464, 67, 5150, 67, 17476, 12, 2890, 4672, 3536, 14169, 281, 326, 4398, 471, 6391, 6928, 434, 326, 2667, 18, 657, 326, 648, 434, 279, 3097, 1483, 16, 333, 16039, 353, 2731, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4398, 67, 464, 67, 5150, 67, 17476, 12, 2890, 4672, 3536, 14169, 281, 326, 4398, 471, 6391, 6928, 434, 326, 2667, 18, 657, 326, 648, 434, 279, 3097, 1483, 16, 333, 16039, 353, 2731, 60...
return h.digest()
if suffix: return h.digest()[:-len(suffix)] + suffix else: return h.digest()
def newID(): """Get a new pseudorandom globally unique hash string.""" h = sha() h.update(urandom(HASH_LENGTH)) return h.digest()
dead3eff408396611d9f0dd7f8a3fc09cc097ae8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/665/dead3eff408396611d9f0dd7f8a3fc09cc097ae8/khash.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 734, 13332, 3536, 967, 279, 394, 29606, 280, 2111, 25654, 3089, 1651, 533, 12123, 366, 273, 6056, 1435, 366, 18, 2725, 12, 295, 2111, 12, 15920, 67, 7096, 3719, 309, 3758, 30, 327, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 394, 734, 13332, 3536, 967, 279, 394, 29606, 280, 2111, 25654, 3089, 1651, 533, 12123, 366, 273, 6056, 1435, 366, 18, 2725, 12, 295, 2111, 12, 15920, 67, 7096, 3719, 309, 3758, 30, 327, ...
default_minilay_paths = [os.path.join(self._prefix,'minilays', minilay)\
default_minilays_pathes_urls = [(os.path.join(self._prefix,'minilays', minilay), '/'.join((urlbase, minilay)))\
def _sync(self): """Sync or install our minilays.""" # install our default minilays self.logger.info('Syncing minilays') default_minilays = [s.strip() \ for s in self._config._sections\ .get('minimerge', {})\ .get('default_minilays','')\ .split('\n')] minimerge_section = self._config._sections.get('minimerge', {}) urlbase = '%s/%s' % ( minimerge_section\ .get('minilays_url','')\ .strip(), version )
76d5bf95735327499584c9cda2384ba15a856ab6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9393/76d5bf95735327499584c9cda2384ba15a856ab6/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8389, 12, 2890, 4672, 3536, 4047, 578, 3799, 3134, 1131, 330, 8271, 12123, 468, 3799, 3134, 805, 1131, 330, 8271, 365, 18, 4901, 18, 1376, 2668, 4047, 310, 1131, 330, 8271, 6134, 80...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8389, 12, 2890, 4672, 3536, 4047, 578, 3799, 3134, 1131, 330, 8271, 12123, 468, 3799, 3134, 805, 1131, 330, 8271, 365, 18, 4901, 18, 1376, 2668, 4047, 310, 1131, 330, 8271, 6134, 80...
return self.no == other.no and self.setting == other.setting
if isinstance(other, int): return self.no == other elif isinstance(other, str): return self.symbol == other else: return self.no == other.no and self.setting == other.setting
def __eq__(self, other): """Chech whether *self* and *other* refer to the same spacegroup number and setting.""" return self.no == other.no and self.setting == other.setting
e6b43a282e4f374086d16b913744056243256848 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/e6b43a282e4f374086d16b913744056243256848/spacegroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 3536, 39, 580, 343, 2856, 380, 2890, 14, 471, 380, 3011, 14, 8884, 358, 326, 1967, 3476, 1655, 1300, 471, 3637, 12123, 327, 365, 18, 2135, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 11253, 972, 12, 2890, 16, 1308, 4672, 3536, 39, 580, 343, 2856, 380, 2890, 14, 471, 380, 3011, 14, 8884, 358, 326, 1967, 3476, 1655, 1300, 471, 3637, 12123, 327, 365, 18, 2135, 4...
"access" : ACCESS_TRANSLATE[values["subindexes"][subindex]["ACCESSTYPE"]],
"access" : ACCESS_TRANSLATE[values["subindexes"][subindex]["ACCESSTYPE"].upper()],
def GenerateNode(filepath, nodeID = 0): global Node # Create a new node Node = node.Node(id = nodeID) try: # Parse file and extract dictionary of EDS entry eds_dict = ParseEDSFile(filepath) # Extract Profile Number from Device Type entry ProfileNb = eds_dict[0x1000]["DEFAULTVALUE"] & 0x0000ffff # If profile is not DS-301 or DS-302 if ProfileNb not in [301, 302]: # Compile Profile name and path to .prf file ProfileName = "DS-%d"%ProfileNb ProfilePath = os.path.join(os.path.split(__file__)[0], "config/%s.prf"%ProfileName) # Verify that profile is available if os.path.isfile(ProfilePath): try: # Load Profile execfile(ProfilePath) Node.SetProfileName(ProfileName) Node.SetProfile(Mapping) Node.SetSpecificMenu(AddMenuEntries) except: pass # Read all entries in the EDS dictionary for entry, values in eds_dict.items(): # All sections with a name in keynames are escaped if entry in SECTION_KEYNAMES: pass else: # Extract informations for the entry entry_infos = Node.GetEntryInfos(entry) # If no informations are available, then we write them if not entry_infos: # First case, entry is a VAR if values["OBJECTTYPE"] == 7: # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 1) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : values["PARAMETERNAME"], "type" : values["DATATYPE"], "access" : ACCESS_TRANSLATE[values["ACCESSTYPE"]], "pdo" : values.get("PDOMAPPING", 0) == 1}) # Second case, entry is an ARRAY elif values["OBJECTTYPE"] == 8: # Extract maximum subindex number defined try: max_subindex = values["subindexes"][0]["DEFAULTVALUE"] except: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for an ARRAY entry"%entry # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 3) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : "Number of Entries", "type" : 0x05, "access" : "ro", "pdo" : False}) # Add mapping for other subindexes for subindex in xrange(1, int(max_subindex) + 1): # if subindex is defined if subindex in values["subindexes"]: Node.AddMappingEntry(entry, subindex, values = {"name" : values["subindexes"][subindex]["PARAMETERNAME"], "type" : values["subindexes"][subindex]["DATATYPE"], "access" : ACCESS_TRANSLATE[values["subindexes"][subindex]["ACCESSTYPE"]], "pdo" : values["subindexes"][subindex].get("PDOMAPPING", 0) == 1}) # if not, we add a mapping for compatibility else: Node.AddMappingEntry(entry, subindex, values = {"name" : "Compatibility Entry", "type" : 0x05, "access" : "rw", "pdo" : False}) # Third case, entry is an RECORD elif values["OBJECTTYPE"] == 9: # Verify that the first subindex is defined if 0 not in values["subindexes"]: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for a RECORD entry"%entry # Add mapping for entry Node.AddMappingEntry(entry, name = values["PARAMETERNAME"], struct = 7) # Add mapping for first subindex Node.AddMappingEntry(entry, 0, values = {"name" : "Number of Entries", "type" : 0x05, "access" : "ro", "pdo" : False}) # Verify that second subindex is defined if 1 in values: Node.AddMappingEntry(entry, 1, values = {"name" : values["PARAMETERNAME"] + " %d[(sub)]", "type" : values["subindexes"][1]["DATATYPE"], "access" : ACCESS_TRANSLATE[values["subindexes"][1]["ACCESSTYPE"]], "pdo" : values["subindexes"][1].get("PDOMAPPING", 0) == 1}) else: raise SyntaxError, "Error on entry 0x%4.4X:\nA RECORD entry must have at least 2 subindexes"%entry # Define entry for the new node # First case, entry is a VAR if values["OBJECTTYPE"] == 7: # Take default value if it is defined if "DEFAULTVALUE" in values: value = values["DEFAULTVALUE"] # Find default value for value type of the entry else: value = GetDefaultValue(entry) Node.AddEntry(entry, 0, value) # Second case, entry is an ARRAY or a RECORD elif values["OBJECTTYPE"] in (8, 9): # Verify that "Subnumber" attribute is defined and has a valid value if "SUBNUMBER" in values and values["SUBNUMBER"] > 0: # Extract maximum subindex number defined try: max_subindex = values["subindexes"][0]["DEFAULTVALUE"] except: raise SyntaxError, "Error on entry 0x%4.4X:\nSubindex 0 must be defined for an ARRAY or a RECORD entry"%entry Node.AddEntry(entry, value = []) # Define value for all subindexes except the first for subindex in xrange(1, int(max_subindex) + 1): # Take default value if it is defined and entry is defined if subindex in values["subindexes"] and "DEFAULTVALUE" in values["subindexes"][subindex]: value = values["subindexes"][subindex]["DEFAULTVALUE"] # Find default value for value type of the subindex else: value = GetDefaultValue(entry, subindex) Node.AddEntry(entry, subindex, value) else: raise SyntaxError, "Array or Record entry 0x%4.4X must have a \"SubNumber\" attribute"%entry return Node except SyntaxError, message: return "Unable to import EDS file\n%s"%message
377e3b02a272798306727eecf174777a489d3f3d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/116/377e3b02a272798306727eecf174777a489d3f3d/eds_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 907, 12, 10561, 16, 14871, 273, 374, 4672, 2552, 2029, 468, 1788, 279, 394, 756, 2029, 273, 756, 18, 907, 12, 350, 273, 14871, 13, 775, 30, 468, 2884, 585, 471, 2608, 3880, 434, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 907, 12, 10561, 16, 14871, 273, 374, 4672, 2552, 2029, 468, 1788, 279, 394, 756, 2029, 273, 756, 18, 907, 12, 350, 273, 14871, 13, 775, 30, 468, 2884, 585, 471, 2608, 3880, 434, ...
_rcsid="$Id: fitting_toolkit.py,v 1.7 2003-05-30 13:31:55 mendenhall Exp $"
_rcsid="$Id: fitting_toolkit.py,v 1.8 2003-07-03 14:17:50 mendenhall Exp $"
def derivs(self): #analytic derivatives for a 2-d gaussian #z0+a*exp( -(x-xmu)**2/(2*xsig**2) -(y-ymu)**2/(2.0*ysig**2)) z0, a, xmu, xsigma, ymu, ysigma = self.funcparams n=self.pointcount x=self.xarray[0,:n] y=self.xarray[1,:n] xsigi=-1.0/(2.0*xsigma**2) ysigi=-1.0/(2.0*ysigma**2) dx=x-xmu dx2=dx*dx dy=y-ymu dy2=dy*dy expfact=Numeric.exp(xsigi*dx2+ysigi*dy2) z=a*expfact dd = Numeric.zeros((n, 6), self.atype) dd[:,0]=1.0 dd[:,1]=expfact dd[:,2]=(-2.0*xsigi)*(dx*z) dd[:,3]=(-2.0*xsigi/xsigma)*(dx2*z) dd[:,4]=(-2.0*ysigi)*(dy*z) dd[:,5]= (-2.0*ysigi/ysigma)*(dy2*z) return dd
4d44ea8ac114ba81a7fea75d025f5d3b975b2f1e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6028/4d44ea8ac114ba81a7fea75d025f5d3b975b2f1e/fitting_toolkit.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9630, 87, 12, 2890, 4672, 468, 304, 7834, 335, 9630, 8785, 364, 279, 576, 17, 72, 21490, 468, 94, 20, 15, 69, 14, 2749, 12, 300, 12, 92, 17, 92, 13297, 13, 636, 22, 19, 12, 22, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9630, 87, 12, 2890, 4672, 468, 304, 7834, 335, 9630, 8785, 364, 279, 576, 17, 72, 21490, 468, 94, 20, 15, 69, 14, 2749, 12, 300, 12, 92, 17, 92, 13297, 13, 636, 22, 19, 12, 22, 1...
classAdAgent = ClassAd("["+resourceJDL+"]")
classAdAgent = ClassAd(resourceJDL)
def selectJob(self, resourceJDL): """ Main job selection function to find the highest priority job matching the resource capacity """
efa72d039ea8335d5706043f0e4af017355dbdd3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/efa72d039ea8335d5706043f0e4af017355dbdd3/MatcherHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 2278, 12, 2890, 16, 1058, 46, 8914, 4672, 3536, 12740, 1719, 4421, 445, 358, 1104, 326, 9742, 4394, 1719, 3607, 326, 1058, 7519, 3536, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 2278, 12, 2890, 16, 1058, 46, 8914, 4672, 3536, 12740, 1719, 4421, 445, 358, 1104, 326, 9742, 4394, 1719, 3607, 326, 1058, 7519, 3536, 2, -100, -100, -100, -100, -100, -100, -100, ...
assert not gc.garbage, 'uncollectable garbage left over from previous tests'
check_garbage()
def leakTest_generic(func): print 'memory leak test', func.__name__ assert not gc.garbage, 'uncollectable garbage left over from previous tests' doc = document.Document() #gc.set_debug(gc.DEBUG_LEAK) m = [] N = 20 for i in range(N): func(doc, i) m2 = mem() m.append(m2) print 'iteration %02d/%02d: %d pages used' % (i+1, N, m2) print m for i in range(N/2,N): assert m[i] == m[9], 'looks like a memory leak in ' + func.__name__ #import objgraph #from lib import strokemap #objgraph.show_refs(doc) #sys.exit(0) #assert m2 == m0, (m2-m0, m3-m2) # note: if gc.DEBUG_LEAK is enabled above this is expected to fail assert not gc.garbage print 'no leak found'
e9401ce8fa849433b139b4ec9499bfad444e6a21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7129/e9401ce8fa849433b139b4ec9499bfad444e6a21/test_mypaintlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20891, 4709, 67, 13540, 12, 644, 4672, 1172, 296, 7858, 20891, 1842, 2187, 1326, 16186, 529, 972, 866, 67, 75, 12332, 1435, 225, 997, 273, 1668, 18, 2519, 1435, 468, 13241, 18, 542, 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, 20891, 4709, 67, 13540, 12, 644, 4672, 1172, 296, 7858, 20891, 1842, 2187, 1326, 16186, 529, 972, 866, 67, 75, 12332, 1435, 225, 997, 273, 1668, 18, 2519, 1435, 468, 13241, 18, 542, 67, ...
[(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 : 1), (2/3 : 1/3 : 1), (3/4 : 1/4 : 1), (4/5 : 1/5 : 1), (5/6 : 1/6 : 1), (1 : 0 : 1), (6/5 : -1/5 : 1), (5/4 : -1/4 : 1), (4/3 : -1/3 : 1), (3/2 : -1/2 : 1), (5/3 : -2/3 : 1), (2 : -1 : 1), (5/2 : -3/2 : 1), (3 : -2 : 1), (4 : -3 : 1), (5 : -4 : 1), (6 : -5 : 1)]
[(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 : 1), (2/3 : 1/3 : 1), (3/4 : 1/4 : 1), (4/5 : 1/5 : 1), (5/6 : 1/6 : 1), (1 : 0 : 1), (6/5 : -1/5 : 1), (5/4 : -1/4 : 1), (4/3 : -1/3 : 1), (3/2 : -1/2 : 1), (5/3 : -2/3 : 1), (2 : -1 : 1), (5/2 : -3/2 : 1), (3 : -2 : 1), (4 : -3 : 1), (5 : -4 : 1), (6 : -5 : 1)]
def enum_projective_rational_field(X,B): """ Enumerates projective, rational points on scheme X of height up to bound B. INPUT: - ``X`` - a scheme or set of abstract rational points of a scheme. - ``B`` - a positive integer bound OUTPUT: - a list containing the projective points of X of height up to B, sorted. EXAMPLES:: sage: P.<X,Y,Z> = ProjectiveSpace(2,QQ) sage: C = P.subscheme([X+Y-Z]) sage: from sage.schemes.generic.rational_point import enum_projective_rational_field sage: enum_projective_rational_field(C(QQ),6) [(-5 : 6 : 1), (-4 : 5 : 1), (-3 : 4 : 1), (-2 : 3 : 1), (-3/2 : 5/2 : 1), (-1 : 1 : 0), (-1 : 2 : 1), (-2/3 : 5/3 : 1), (-1/2 : 3/2 : 1), (-1/3 : 4/3 : 1), (-1/4 : 5/4 : 1), (-1/5 : 6/5 : 1), (0 : 1 : 1), (1/6 : 5/6 : 1), (1/5 : 4/5 : 1), (1/4 : 3/4 : 1), (1/3 : 2/3 : 1), (2/5 : 3/5 : 1), (1/2 : 1/2 : 1), (3/5 : 2/5 : 1), (2/3 : 1/3 : 1), (3/4 : 1/4 : 1), (4/5 : 1/5 : 1), (5/6 : 1/6 : 1), (1 : 0 : 1), (6/5 : -1/5 : 1), (5/4 : -1/4 : 1), (4/3 : -1/3 : 1), (3/2 : -1/2 : 1), (5/3 : -2/3 : 1), (2 : -1 : 1), (5/2 : -3/2 : 1), (3 : -2 : 1), (4 : -3 : 1), (5 : -4 : 1), (6 : -5 : 1)] sage: enum_projective_rational_field(C,6) == enum_projective_rational_field(C(QQ),6) True :: sage: P3.<W,X,Y,Z> = ProjectiveSpace(3,QQ) sage: enum_projective_rational_field(P3,1) [(-1 : -1 : -1 : 1), (-1 : -1 : 0 : 1), (-1 : -1 : 1 : 0), (-1 : -1 : 1 : 1), (-1 : 0 : -1 : 1), (-1 : 0 : 0 : 1), (-1 : 0 : 1 : 0), (-1 : 0 : 1 : 1), (-1 : 1 : -1 : 1), (-1 : 1 : 0 : 0), (-1 : 1 : 0 : 1), (-1 : 1 : 1 : 0), (-1 : 1 : 1 : 1), (0 : -1 : -1 : 1), (0 : -1 : 0 : 1), (0 : -1 : 1 : 0), (0 : -1 : 1 : 1), (0 : 0 : -1 : 1), (0 : 0 : 0 : 1), (0 : 0 : 1 : 0), (0 : 0 : 1 : 1), (0 : 1 : -1 : 1), (0 : 1 : 0 : 0), (0 : 1 : 0 : 1), (0 : 1 : 1 : 0), (0 : 1 : 1 : 1), (1 : -1 : -1 : 1), (1 : -1 : 0 : 1), (1 : -1 : 1 : 0), (1 : -1 : 1 : 1), (1 : 0 : -1 : 1), (1 : 0 : 0 : 0), (1 : 0 : 0 : 1), (1 : 0 : 1 : 0), (1 : 0 : 1 : 1), (1 : 1 : -1 : 1), (1 : 1 : 0 : 0), (1 : 1 : 0 : 1), (1 : 1 : 1 : 0), (1 : 1 : 1 : 1)] ALGORITHM: We just check all possible projective points in correct dimension of projective space to see if they lie on X. AUTHORS: John Cremona and Charlie Turner (06-2010) """ if is_Scheme(X): X = X(X.base_ring()) n = X.codomain().ambient_space().ngens()-1 zero=tuple([0 for _ in range(n+1)])
7437114fd97818d63a9f0b766fecf0fb34f4f16c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7437114fd97818d63a9f0b766fecf0fb34f4f16c/rational_point.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2792, 67, 4406, 688, 67, 7034, 287, 67, 1518, 12, 60, 16, 38, 4672, 3536, 6057, 264, 815, 1984, 688, 16, 436, 8371, 3143, 603, 4355, 1139, 434, 2072, 731, 358, 2489, 605, 18, 225, 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, 2792, 67, 4406, 688, 67, 7034, 287, 67, 1518, 12, 60, 16, 38, 4672, 3536, 6057, 264, 815, 1984, 688, 16, 436, 8371, 3143, 603, 4355, 1139, 434, 2072, 731, 358, 2489, 605, 18, 225, 12...
self.failedDown.append( FailedItem( link, threadName, itemNode, failureDownDict ) )
self.failedDown.append( FailedItem( link, threadName, itemNode, failureDownDict ) )
def load(self): u"""take care of conversion from older versions here, then call save to store updates, then continue with loading.""" f = open(self.saveFileName, 'rb') saveFile = pickle.load(f) if 'version' not in saveFile: self.version = u'0.2.4' else: self.version = saveFile['version'] self.lastChecked = saveFile['lastChecked'] self.downloads = saveFile['downloads'] self.minScanTime = saveFile['minScanTime'] if (self.version <= u'0.2.4' and len(saveFile['failedDown']) and not isinstance(saveFile['failedDown'][0], FailedItem)): for link, threadName, itemNode, LDir in saveFile['failedDown']: failureDownDict = DownloadItemConfig(None, None, None, LDir) self.failedDown.append( FailedItem( link, threadName, itemNode, failureDownDict ) ) self.version = getVersion() self.save() else: self.failedDown = saveFile['failedDown'] del saveFile # upgrade process should be complete, set to current version self.version = getVersion()
633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 582, 8395, 22188, 7671, 434, 4105, 628, 12156, 5244, 2674, 16, 1508, 745, 1923, 358, 1707, 4533, 16, 1508, 1324, 598, 7153, 12123, 284, 273, 1696, 12, 2890, 18, 568...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 582, 8395, 22188, 7671, 434, 4105, 628, 12156, 5244, 2674, 16, 1508, 745, 1923, 358, 1707, 4533, 16, 1508, 1324, 598, 7153, 12123, 284, 273, 1696, 12, 2890, 18, 568...
returns 'modelRoot' NOTE: returns parts of first LOD"""
returns 'modelRoot' NOTE: returns parts of arbitrary LOD"""
def getPartNames(self): """getPartNames(self): Return list of Actor part names. If not an multipart actor, returns 'modelRoot' NOTE: returns parts of first LOD""" return self.__partBundleDict.values()[0].keys()
f3ecd1b3be1dfb26d71ee04e5cafdbea5f5b53a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/f3ecd1b3be1dfb26d71ee04e5cafdbea5f5b53a9/Actor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13657, 1557, 12, 2890, 4672, 3536, 588, 1988, 1557, 12, 2890, 4672, 2000, 666, 434, 21142, 1087, 1257, 18, 971, 486, 392, 10263, 8327, 16, 1135, 296, 2284, 2375, 11, 5219, 30, 1135, 2140...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13657, 1557, 12, 2890, 4672, 3536, 588, 1988, 1557, 12, 2890, 4672, 2000, 666, 434, 21142, 1087, 1257, 18, 971, 486, 392, 10263, 8327, 16, 1135, 296, 2284, 2375, 11, 5219, 30, 1135, 2140...
table.addElement(ecs.Tr().addElement(td)) if f.description: tr.addElement(ecs.Td().addElement(f.description)) tr.addElement(ecs.Td().addElement(f.getView())) else: td=ecs.Td().addElement(f.getView()).setAttribute('colspan', '2')
def handleField(self, f, tr, table): msg=self.errors.get(f) if msg: em=ecs.Em(msg).setAttribute('class', 'form_error') td=ecs.Td(em).setAttribute('colspan', '2') table.addElement(ecs.Tr().addElement(td))
dd3fcaae83881277e9cf6cdf57b1d04d852ed615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5832/dd3fcaae83881277e9cf6cdf57b1d04d852ed615/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 974, 12, 2890, 16, 284, 16, 433, 16, 1014, 4672, 1234, 33, 2890, 18, 4324, 18, 588, 12, 74, 13, 309, 1234, 30, 801, 33, 557, 87, 18, 1514, 12, 3576, 2934, 542, 1499, 2668, 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, 1640, 974, 12, 2890, 16, 284, 16, 433, 16, 1014, 4672, 1234, 33, 2890, 18, 4324, 18, 588, 12, 74, 13, 309, 1234, 30, 801, 33, 557, 87, 18, 1514, 12, 3576, 2934, 542, 1499, 2668, 11...
popen([python, '-c', cmd])
p = popen([python, '-c', cmd], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE) p.stdout.close() p.stdin.close() p.stderr.close()
def run(self, job_id, func, args=[], kwdargs={}, monitor=True): ''' Run a job in a separate process. @param job_id: A unique (per server) identifier @param func: One of C{PARALLEL_FUNCS.keys()} @param args: A list of arguments to pass of C{func} @param kwdargs: A dictionary of keyword arguments to pass to C{func} @param monitor: If False launch the child process and return. Do not monitor/communicate with it. @return: (result, exception, formatted_traceback, log) where log is the combined stdout + stderr of the child process; or None if monitor is True. If a job is killed by a call to L{kill()} then result will be L{KILL_RESULT} ''' job_id = str(job_id) job_dir = os.path.join(self.tdir, job_id) if os.path.exists(job_dir): raise ValueError('Cannot run job. The job_id %s has already been used.'%job_id) os.mkdir(job_dir) job_data = os.path.join(job_dir, 'job_data.pickle') cPickle.dump((func, args, kwdargs), open(job_data, 'wb'), -1) prefix = '' if hasattr(sys, 'frameworks_dir'): fd = getattr(sys, 'frameworks_dir') prefix = 'import sys; sys.frameworks_dir = "%s"; sys.frozen = "macosx_app"; '%fd if fd not in os.environ['PATH']: os.environ['PATH'] += ':'+fd cmd = prefix + 'from libprs500.parallel import run_job; run_job(\'%s\')'%binascii.hexlify(job_data) if not monitor: popen([python, '-c', cmd]) return output = open(os.path.join(job_dir, 'output.txt'), 'wb') p = popen([python, '-c', cmd], stdout=output, stderr=output, stdin=subprocess.PIPE) p.stdin.close() while p.returncode is None: if job_id in self.kill_jobs: self._terminate(p) return self.KILL_RESULT, None, None, _('Job killed by user') time.sleep(0.1) p.poll() output.close() job_result = os.path.join(job_dir, 'job_result.pickle') if not os.path.exists(job_result): result, exception, traceback = None, ('ParallelRuntimeError', 'The worker process died unexpectedly.'), '' else: result, exception, traceback = cPickle.load(open(job_result, 'rb')) log = open(output.name, 'rb').read() return result, exception, traceback, log
fb805aa4ece85e6e4fde23ade4d93233e714387f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/fb805aa4ece85e6e4fde23ade4d93233e714387f/parallel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 16, 1719, 67, 350, 16, 1326, 16, 833, 22850, 6487, 417, 3623, 1968, 28793, 6438, 33, 5510, 4672, 9163, 1939, 279, 1719, 316, 279, 9004, 1207, 18, 632, 891, 1719, 67, 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, 1086, 12, 2890, 16, 1719, 67, 350, 16, 1326, 16, 833, 22850, 6487, 417, 3623, 1968, 28793, 6438, 33, 5510, 4672, 9163, 1939, 279, 1719, 316, 279, 9004, 1207, 18, 632, 891, 1719, 67, 35...
audio.cancel() audio.speakMessage(str(self.dom.frames.item(frameNum).document.readyState))
if winUser.isDescendantWindow(self.NVDAObject.windowHandle,api.getFocusObject().windowHandle): audio.cancel() audio.speakMessage(str(self.dom.frames.item(frameNum).document.readyState))
def isDocumentComplete(self): documentComplete=True if self.dom.readyState!="complete": audio.cancel() audio.speakMessage(str(self.dom.readyState)) documentComplete=False for frameNum in range(self.dom.frames.length): try: if self.dom.frames.item(frameNum).document.readyState!="complete": audio.cancel() audio.speakMessage(str(self.dom.frames.item(frameNum).document.readyState)) documentComplete=False except: pass return documentComplete
2ccbd29a498b50e15a00cf571a2d239c140eb639 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/2ccbd29a498b50e15a00cf571a2d239c140eb639/MSHTML.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 2519, 6322, 12, 2890, 4672, 1668, 6322, 33, 5510, 309, 365, 18, 9859, 18, 1672, 1119, 5, 1546, 6226, 6877, 7447, 18, 10996, 1435, 7447, 18, 87, 10244, 1079, 12, 701, 12, 2890, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 2519, 6322, 12, 2890, 4672, 1668, 6322, 33, 5510, 309, 365, 18, 9859, 18, 1672, 1119, 5, 1546, 6226, 6877, 7447, 18, 10996, 1435, 7447, 18, 87, 10244, 1079, 12, 701, 12, 2890, 18,...
path = self._find_file(self.main_module) fp = open(path, 'r') source = fp.read() fp.close()
def _regenerate(self): if self._dependencies: for name, mtime in self._dependencies.items(): path = self._find_file(name) if not path or os.path.getmtime(path) != mtime: # Just recompile everything self._dependencies = {} break else: # No changes return
d81888e767010d1d117a8a8eb85fb468a070a307 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11828/d81888e767010d1d117a8a8eb85fb468a070a307/sass.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1574, 14681, 12, 2890, 4672, 309, 365, 6315, 11037, 30, 364, 508, 16, 13158, 316, 365, 6315, 11037, 18, 3319, 13332, 589, 273, 365, 6315, 4720, 67, 768, 12, 529, 13, 309, 486, 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, 1574, 14681, 12, 2890, 4672, 309, 365, 6315, 11037, 30, 364, 508, 16, 13158, 316, 365, 6315, 11037, 18, 3319, 13332, 589, 273, 365, 6315, 4720, 67, 768, 12, 529, 13, 309, 486, 589...
map = socket_map
map = self._map
def del_channel(self, map=None): fd = self._fileno if map is None: map = socket_map if map.has_key(fd): #self.log_info('closing channel %d:%s' % (fd, self)) del map[fd]
f9ca40929241fa83c4fc7a8f2ba6c334286e5e16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f9ca40929241fa83c4fc7a8f2ba6c334286e5e16/asyncore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1464, 67, 4327, 12, 2890, 16, 852, 33, 7036, 4672, 5194, 273, 365, 6315, 7540, 5764, 309, 852, 353, 599, 30, 852, 273, 365, 6315, 1458, 309, 852, 18, 5332, 67, 856, 12, 8313, 4672, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1464, 67, 4327, 12, 2890, 16, 852, 33, 7036, 4672, 5194, 273, 365, 6315, 7540, 5764, 309, 852, 353, 599, 30, 852, 273, 365, 6315, 1458, 309, 852, 18, 5332, 67, 856, 12, 8313, 4672, 4...
addFilter('E: emacs.*el|xemacs.*el no-dependency-on locales-el')
addFilter('E: emacs.*-el|xemacs.*-el no-dependency-on locales-el')
def isFiltered(s): global _filters if not no_exception: for f in _filters: if f.search(s): return 1 return 0
5755bb2e69569c1758ae9432582bc9f3efd9d7cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3346/5755bb2e69569c1758ae9432582bc9f3efd9d7cd/Config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 14478, 12, 87, 4672, 2552, 389, 6348, 225, 309, 486, 1158, 67, 4064, 30, 364, 284, 316, 389, 6348, 30, 309, 284, 18, 3072, 12, 87, 4672, 327, 404, 327, 374, 225, 2, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14478, 12, 87, 4672, 2552, 389, 6348, 225, 309, 486, 1158, 67, 4064, 30, 364, 284, 316, 389, 6348, 30, 309, 284, 18, 3072, 12, 87, 4672, 327, 404, 327, 374, 225, 2, -100, -100, ...
qscanList = stfu_pipe.getParamsFromCache(eval("opts.qscan_cache_" + type_string),type)
qscanList = getParamsFromCache(eval("opts.qscan_cache_" + type_string),type)
def getQscanTable(opts,type): summary = readSummaryFiles() if "FG" in type: type_string = "foreground" elif "BG" in type: type_string = "background" if eval("opts.qscan_cache_" + type_string): qscanList = stfu_pipe.getParamsFromCache(eval("opts.qscan_cache_" + type_string),type) else: try: inputPath = eval("opts." + type_string + "_input_path") qscanList = parseDirectoryList(inputPath) except: print >> sys.stderr, "cannot get input path for " + type_string print >> sys.stderr, "specify at least one of the following options:" print >> sys.stderr, "--qscan-cache, --" + type_string + "-input-path" sys.exit(1) table = summary.parseQscanList(qscanList) # perform a sanity check if not (len(table['channel_name']) == len(table['qscan_dir'])): print >> sys.stderr, "the length of channel_name does not match the length of qscan_dir in the " + type_string + " table" print >> sys.stderr, "check for data corruption in the qscan summary files in the " + type_string + " table" sys.exit(1) return table
6c15368b6ad90ea664a08bf234347a0623f88dd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/6c15368b6ad90ea664a08bf234347a0623f88dd1/analyseQscan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23413, 9871, 1388, 12, 4952, 16, 723, 4672, 225, 4916, 273, 855, 4733, 2697, 1435, 225, 309, 315, 42, 43, 6, 316, 618, 30, 618, 67, 1080, 273, 315, 1405, 2915, 6, 1327, 315, 30098, 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, 23413, 9871, 1388, 12, 4952, 16, 723, 4672, 225, 4916, 273, 855, 4733, 2697, 1435, 225, 309, 315, 42, 43, 6, 316, 618, 30, 618, 67, 1080, 273, 315, 1405, 2915, 6, 1327, 315, 30098, 6...
except ImportError:
gzip.GzipFile except (ImportError, AttributeError):
def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError, "mode must be 'r' or 'w'"
dfaef169347f31b7cfb56d0efdf0f53c2ff1dd24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/dfaef169347f31b7cfb56d0efdf0f53c2ff1dd24/tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14136, 3190, 12, 6429, 16, 508, 16, 1965, 1546, 86, 3113, 17041, 33, 7036, 16, 8099, 2815, 33, 29, 4672, 3536, 3678, 10331, 8968, 8232, 5052, 508, 364, 6453, 578, 7410, 18, 6181, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14136, 3190, 12, 6429, 16, 508, 16, 1965, 1546, 86, 3113, 17041, 33, 7036, 16, 8099, 2815, 33, 29, 4672, 3536, 3678, 10331, 8968, 8232, 5052, 508, 364, 6453, 578, 7410, 18, 6181, 310, ...
handleStatus_200 = lambda *args: None
def handleStatus_200(self): self.factory.gotHeaders(self.headers)
1e191aa32d1fc9299221c26afe945b16e55bccfc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/1e191aa32d1fc9299221c26afe945b16e55bccfc/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1482, 67, 6976, 12, 2890, 4672, 365, 18, 6848, 18, 13212, 3121, 12, 2890, 18, 2485, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 1482, 67, 6976, 12, 2890, 4672, 365, 18, 6848, 18, 13212, 3121, 12, 2890, 18, 2485, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING'):
if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING', ''):
def __call__(self, environ, start_response): if 'gzip' not in environ.get('HTTP_ACCEPT_ENCODING'): # nothing for us to do, so this middleware will # be a no-op: return self.application(environ, start_response) response = GzipResponse(start_response, self.compress_level) app_iter = self.application(environ, response.gzip_start_response) try: if app_iter: response.finish_response(app_iter) finally: response.close() return None
b122f389283fa3b627d3c4d1bc51706be175567a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/b122f389283fa3b627d3c4d1bc51706be175567a/gzipper.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 309, 296, 17380, 11, 486, 316, 5473, 18, 588, 2668, 3693, 67, 21417, 67, 14672, 2187, 875, 4672, 468, 5083, 364, 584, 358,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5473, 16, 787, 67, 2740, 4672, 309, 296, 17380, 11, 486, 316, 5473, 18, 588, 2668, 3693, 67, 21417, 67, 14672, 2187, 875, 4672, 468, 5083, 364, 584, 358,...
for child in obj.children: if child.name not in exported_children: writeObject(scene, path, child, current_pass, write) exported_children.append(child.name)
writeChildren()
def writeObject(path, obj, current_pass, write, scene): if obj.type == 'MESH': if check_visible(obj, scene): print("write "+obj.name) mat = obj.active_material write("\nAttributeBegin\n") write('Attribute "identifier" "name" ["'+obj.name+'"]\n') write_attrs_or_opts(obj.renderman[current_pass.name].attribute_groups, write, "Attribute", "", scene) if not current_pass.shadow: for item in obj.renderman[current_pass.name].light_list: if not item.illuminate: write('Illuminate "'+item.lightname+'"') write(' 0\n') objtransform(obj, write, current_pass, scene) rmansettings = scene.renderman_settings if mat: write(writeMaterial(mat, path, current_pass, scene).replace('\\', '\\\\')) if obj.children: for child in obj.children: if child.name not in exported_children: writeObject(scene, path, child, current_pass, write) exported_children.append(child.name) if obj.data.show_double_sided: write('Sides 2\n') write('ShadingRate '+str(obj.renderman[current_pass.name].shadingrate)+'\n') export_type = obj.data.export_type meshpath = os.path.join(path, scene.renderman_settings.polydir) if export_type == 'ObjectInstance': write('ObjectInstance "'+obj.data.name+'"\n') else: export_object(obj, current_pass, meshpath, write, scene, export_type) write("AttributeEnd\n") print("Done")
36e719e8947fc0f79b6d39a93ad6ee903a8f98de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14285/36e719e8947fc0f79b6d39a93ad6ee903a8f98de/export_renderman.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16306, 12, 803, 16, 1081, 16, 783, 67, 5466, 16, 1045, 16, 9065, 4672, 309, 1081, 18, 723, 422, 296, 958, 2664, 4278, 309, 866, 67, 8613, 12, 2603, 16, 9065, 4672, 1172, 2932, 2626, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16306, 12, 803, 16, 1081, 16, 783, 67, 5466, 16, 1045, 16, 9065, 4672, 309, 1081, 18, 723, 422, 296, 958, 2664, 4278, 309, 866, 67, 8613, 12, 2603, 16, 9065, 4672, 1172, 2932, 2626, ...
try: class C(bool): pass except TypeError: pass else: raise TestFailed, "bool should not be subclassable" try: int.__new__(bool, 0) except TypeError: pass else: raise TestFailed, "should not be able to create new bool instances" fo = open(TESTFN, "wb") print >> fo, False, True fo.close() fo = open(TESTFN, "rb") vereq(fo.read(), 'False True\n') fo.close() os.remove(TESTFN) vereq(str(False), 'False') vereq(str(True), 'True') vereq(repr(False), 'False') vereq(repr(True), 'True') vereq(eval(repr(False)), False) vereq(eval(repr(True)), True) vereq(int(False), 0) verisnot(int(False), False) vereq(int(True), 1) verisnot(int(True), True) vereq(+False, 0) verisnot(+False, False) vereq(-False, 0) verisnot(-False, False) vereq(abs(False), 0) verisnot(abs(False), False) vereq(+True, 1) verisnot(+True, True) vereq(-True, -1) vereq(abs(True), 1) verisnot(abs(True), True) vereq(~False, -1) vereq(~True, -2) vereq(False+2, 2) vereq(True+2, 3) vereq(2+False, 2) vereq(2+True, 3) vereq(False+False, 0) verisnot(False+False, False) vereq(False+True, 1) verisnot(False+True, True) vereq(True+False, 1) verisnot(True+False, True) vereq(True+True, 2) vereq(True-True, 0) verisnot(True-True, False) vereq(False-False, 0) verisnot(False-False, False) vereq(True-False, 1) verisnot(True-False, True) vereq(False-True, -1) vereq(True*1, 1) vereq(False*1, 0) verisnot(False*1, False) vereq(True/1, 1) verisnot(True/1, True) vereq(False/1, 0) verisnot(False/1, False) for b in False, True: for i in 0, 1, 2: vereq(b**i, int(b)**i) verisnot(b**i, bool(int(b)**i)) for a in False, True: for b in False, True: veris(a&b, bool(int(a)&int(b))) veris(a|b, bool(int(a)|int(b))) veris(a^b, bool(int(a)^int(b))) vereq(a&int(b), int(a)&int(b)) verisnot(a&int(b), bool(int(a)&int(b))) vereq(a|int(b), int(a)|int(b)) verisnot(a|int(b), bool(int(a)|int(b))) vereq(a^int(b), int(a)^int(b)) verisnot(a^int(b), bool(int(a)^int(b))) vereq(int(a)&b, int(a)&int(b)) verisnot(int(a)&b, bool(int(a)&int(b))) vereq(int(a)|b, int(a)|int(b)) verisnot(int(a)|b, bool(int(a)|int(b))) vereq(int(a)^b, int(a)^int(b)) verisnot(int(a)^b, bool(int(a)^int(b))) veris(1==1, True) veris(1==0, False) x = [1] veris(x is x, True) veris(x is not x, False) veris(1 in x, True) veris(0 in x, False) veris(1 not in x, False) veris(0 not in x, True) veris(not True, False) veris(not False, True) veris(bool(10), True) veris(bool(1), True) veris(bool(-1), True) veris(bool(0), False) veris(bool("hello"), True) veris(bool(""), False) veris(bool(), False) veris(hasattr([], "append"), True) veris(hasattr([], "wobble"), False) veris(callable(len), True) veris(callable(1), False) veris(isinstance(True, bool), True) veris(isinstance(False, bool), True) veris(isinstance(True, int), True) veris(isinstance(False, int), True) veris(isinstance(1, bool), False) veris(isinstance(0, bool), False) veris(issubclass(bool, int), True) veris(issubclass(int, bool), False) veris({}.has_key(1), False) veris({1:1}.has_key(1), True) veris("xyz".endswith("z"), True) veris("xyz".endswith("x"), False) veris("xyz0123".isalnum(), True) veris("@ veris("xyz".isalpha(), True) veris("@ veris("0123".isdigit(), True) veris("xyz".isdigit(), False) veris("xyz".islower(), True) veris("XYZ".islower(), False) veris(" ".isspace(), True) veris("XYZ".isspace(), False) veris("X".istitle(), True) veris("x".istitle(), False) veris("XYZ".isupper(), True) veris("xyz".isupper(), False) veris("xyz".startswith("x"), True) veris("xyz".startswith("z"), False) if have_unicode: veris(unicode("xyz", 'ascii').endswith(unicode("z", 'ascii')), True) veris(unicode("xyz", 'ascii').endswith(unicode("x", 'ascii')), False) veris(unicode("xyz0123", 'ascii').isalnum(), True) veris(unicode("@ veris(unicode("xyz", 'ascii').isalpha(), True) veris(unicode("@ veris(unicode("0123", 'ascii').isdecimal(), True) veris(unicode("xyz", 'ascii').isdecimal(), False) veris(unicode("0123", 'ascii').isdigit(), True) veris(unicode("xyz", 'ascii').isdigit(), False) veris(unicode("xyz", 'ascii').islower(), True) veris(unicode("XYZ", 'ascii').islower(), False) veris(unicode("0123", 'ascii').isnumeric(), True) veris(unicode("xyz", 'ascii').isnumeric(), False) veris(unicode(" ", 'ascii').isspace(), True) veris(unicode("XYZ", 'ascii').isspace(), False) veris(unicode("X", 'ascii').istitle(), True) veris(unicode("x", 'ascii').istitle(), False) veris(unicode("XYZ", 'ascii').isupper(), True) veris(unicode("xyz", 'ascii').isupper(), False) veris(unicode("xyz", 'ascii').startswith(unicode("x", 'ascii')), True) veris(unicode("xyz", 'ascii').startswith(unicode("z", 'ascii')), False) f = file(TESTFN, "w") veris(f.closed, False) f.close() veris(f.closed, True) os.remove(TESTFN) import operator veris(operator.truth(0), False) veris(operator.truth(1), True) veris(operator.isCallable(0), False) veris(operator.isCallable(len), True) veris(operator.isNumberType(None), False) veris(operator.isNumberType(0), True) veris(operator.not_(1), False) veris(operator.not_(0), True) veris(operator.isSequenceType(0), False) veris(operator.isSequenceType([]), True) veris(operator.contains([], 1), False) veris(operator.contains([1], 1), True) veris(operator.isMappingType(1), False) veris(operator.isMappingType({}), True) veris(operator.lt(0, 0), False) veris(operator.lt(0, 1), True) import marshal veris(marshal.loads(marshal.dumps(True)), True) veris(marshal.loads(marshal.dumps(False)), False) import pickle veris(pickle.loads(pickle.dumps(True)), True) veris(pickle.loads(pickle.dumps(False)), False) veris(pickle.loads(pickle.dumps(True, True)), True) veris(pickle.loads(pickle.dumps(False, True)), False) import cPickle veris(cPickle.loads(cPickle.dumps(True)), True) veris(cPickle.loads(cPickle.dumps(False)), False) veris(cPickle.loads(cPickle.dumps(True, True)), True) veris(cPickle.loads(cPickle.dumps(False, True)), False) veris(pickle.loads(cPickle.dumps(True)), True) veris(pickle.loads(cPickle.dumps(False)), False) veris(pickle.loads(cPickle.dumps(True, True)), True) veris(pickle.loads(cPickle.dumps(False, True)), False) veris(cPickle.loads(pickle.dumps(True)), True) veris(cPickle.loads(pickle.dumps(False)), False) veris(cPickle.loads(pickle.dumps(True, True)), True) veris(cPickle.loads(pickle.dumps(False, True)), False) vereq(pickle.dumps(True), "I01\n.") vereq(pickle.dumps(False), "I00\n.") vereq(cPickle.dumps(True), "I01\n.") vereq(cPickle.dumps(False), "I00\n.") vereq(pickle.dumps(True, True), "I01\n.") vereq(pickle.dumps(False, True), "I00\n.") vereq(cPickle.dumps(True, True), "I01\n.") vereq(cPickle.dumps(False, True), "I00\n.") if verbose: print "All OK"
class BoolTest(unittest.TestCase): def assertIs(self, a, b): self.assert_(a is b) def assertIsNot(self, a, b): self.assert_(a is not b) def test_subclass(self): try: class C(bool): pass except TypeError: pass else: self.fail("bool should not be subclassable") self.assertRaises(TypeError, int.__new__, bool, 0) def test_print(self): try: fo = open(test_support.TESTFN, "wb") print >> fo, False, True fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), 'False True\n') finally: fo.close() os.remove(test_support.TESTFN) def test_repr(self): self.assertEqual(repr(False), 'False') self.assertEqual(repr(True), 'True') self.assertEqual(eval(repr(False)), False) self.assertEqual(eval(repr(True)), True) def test_str(self): self.assertEqual(str(False), 'False') self.assertEqual(str(True), 'True') def test_int(self): self.assertEqual(int(False), 0) self.assertIsNot(int(False), False) self.assertEqual(int(True), 1) self.assertIsNot(int(True), True) def test_math(self): self.assertEqual(+False, 0) self.assertIsNot(+False, False) self.assertEqual(-False, 0) self.assertIsNot(-False, False) self.assertEqual(abs(False), 0) self.assertIsNot(abs(False), False) self.assertEqual(+True, 1) self.assertIsNot(+True, True) self.assertEqual(-True, -1) self.assertEqual(abs(True), 1) self.assertIsNot(abs(True), True) self.assertEqual(~False, -1) self.assertEqual(~True, -2) self.assertEqual(False+2, 2) self.assertEqual(True+2, 3) self.assertEqual(2+False, 2) self.assertEqual(2+True, 3) self.assertEqual(False+False, 0) self.assertIsNot(False+False, False) self.assertEqual(False+True, 1) self.assertIsNot(False+True, True) self.assertEqual(True+False, 1) self.assertIsNot(True+False, True) self.assertEqual(True+True, 2) self.assertEqual(True-True, 0) self.assertIsNot(True-True, False) self.assertEqual(False-False, 0) self.assertIsNot(False-False, False) self.assertEqual(True-False, 1) self.assertIsNot(True-False, True) self.assertEqual(False-True, -1) self.assertEqual(True*1, 1) self.assertEqual(False*1, 0) self.assertIsNot(False*1, False) self.assertEqual(True/1, 1) self.assertIsNot(True/1, True) self.assertEqual(False/1, 0) self.assertIsNot(False/1, False) for b in False, True: for i in 0, 1, 2: self.assertEqual(b**i, int(b)**i) self.assertIsNot(b**i, bool(int(b)**i)) for a in False, True: for b in False, True: self.assertIs(a&b, bool(int(a)&int(b))) self.assertIs(a|b, bool(int(a)|int(b))) self.assertIs(a^b, bool(int(a)^int(b))) self.assertEqual(a&int(b), int(a)&int(b)) self.assertIsNot(a&int(b), bool(int(a)&int(b))) self.assertEqual(a|int(b), int(a)|int(b)) self.assertIsNot(a|int(b), bool(int(a)|int(b))) self.assertEqual(a^int(b), int(a)^int(b)) self.assertIsNot(a^int(b), bool(int(a)^int(b))) self.assertEqual(int(a)&b, int(a)&int(b)) self.assertIsNot(int(a)&b, bool(int(a)&int(b))) self.assertEqual(int(a)|b, int(a)|int(b)) self.assertIsNot(int(a)|b, bool(int(a)|int(b))) self.assertEqual(int(a)^b, int(a)^int(b)) self.assertIsNot(int(a)^b, bool(int(a)^int(b))) self.assertIs(1==1, True) self.assertIs(1==0, False) self.assertIs(0<1, True) self.assertIs(1<0, False) self.assertIs(0<=0, True) self.assertIs(1<=0, False) self.assertIs(1>0, True) self.assertIs(1>1, False) self.assertIs(1>=1, True) self.assertIs(0>=1, False) self.assertIs(0!=1, True) self.assertIs(0!=0, False) x = [1] self.assertIs(x is x, True) self.assertIs(x is not x, False) self.assertIs(1 in x, True) self.assertIs(0 in x, False) self.assertIs(1 not in x, False) self.assertIs(0 not in x, True) x = {1: 2} self.assertIs(x is x, True) self.assertIs(x is not x, False) self.assertIs(1 in x, True) self.assertIs(0 in x, False) self.assertIs(1 not in x, False) self.assertIs(0 not in x, True) self.assertIs(not True, False) self.assertIs(not False, True) def test_convert(self): self.assertRaises(TypeError, bool, 42, 42) self.assertIs(bool(10), True) self.assertIs(bool(1), True) self.assertIs(bool(-1), True) self.assertIs(bool(0), False) self.assertIs(bool("hello"), True) self.assertIs(bool(""), False) self.assertIs(bool(), False) def test_hasattr(self): self.assertIs(hasattr([], "append"), True) self.assertIs(hasattr([], "wobble"), False) def test_callable(self): self.assertIs(callable(len), True) self.assertIs(callable(1), False) def test_isinstance(self): self.assertIs(isinstance(True, bool), True) self.assertIs(isinstance(False, bool), True) self.assertIs(isinstance(True, int), True) self.assertIs(isinstance(False, int), True) self.assertIs(isinstance(1, bool), False) self.assertIs(isinstance(0, bool), False) def test_issubclass(self): self.assertIs(issubclass(bool, int), True) self.assertIs(issubclass(int, bool), False) def test_haskey(self): self.assertIs({}.has_key(1), False) self.assertIs({1:1}.has_key(1), True) def test_string(self): self.assertIs("xyz".endswith("z"), True) self.assertIs("xyz".endswith("x"), False) self.assertIs("xyz0123".isalnum(), True) self.assertIs("@ self.assertIs("xyz".isalpha(), True) self.assertIs("@ self.assertIs("0123".isdigit(), True) self.assertIs("xyz".isdigit(), False) self.assertIs("xyz".islower(), True) self.assertIs("XYZ".islower(), False) self.assertIs(" ".isspace(), True) self.assertIs("XYZ".isspace(), False) self.assertIs("X".istitle(), True) self.assertIs("x".istitle(), False) self.assertIs("XYZ".isupper(), True) self.assertIs("xyz".isupper(), False) self.assertIs("xyz".startswith("x"), True) self.assertIs("xyz".startswith("z"), False) if have_unicode: self.assertIs(unicode("xyz", 'ascii').endswith(unicode("z", 'ascii')), True) self.assertIs(unicode("xyz", 'ascii').endswith(unicode("x", 'ascii')), False) self.assertIs(unicode("xyz0123", 'ascii').isalnum(), True) self.assertIs(unicode("@ self.assertIs(unicode("xyz", 'ascii').isalpha(), True) self.assertIs(unicode("@ self.assertIs(unicode("0123", 'ascii').isdecimal(), True) self.assertIs(unicode("xyz", 'ascii').isdecimal(), False) self.assertIs(unicode("0123", 'ascii').isdigit(), True) self.assertIs(unicode("xyz", 'ascii').isdigit(), False) self.assertIs(unicode("xyz", 'ascii').islower(), True) self.assertIs(unicode("XYZ", 'ascii').islower(), False) self.assertIs(unicode("0123", 'ascii').isnumeric(), True) self.assertIs(unicode("xyz", 'ascii').isnumeric(), False) self.assertIs(unicode(" ", 'ascii').isspace(), True) self.assertIs(unicode("XYZ", 'ascii').isspace(), False) self.assertIs(unicode("X", 'ascii').istitle(), True) self.assertIs(unicode("x", 'ascii').istitle(), False) self.assertIs(unicode("XYZ", 'ascii').isupper(), True) self.assertIs(unicode("xyz", 'ascii').isupper(), False) self.assertIs(unicode("xyz", 'ascii').startswith(unicode("x", 'ascii')), True) self.assertIs(unicode("xyz", 'ascii').startswith(unicode("z", 'ascii')), False) def test_boolean(self): self.assertEqual(True & 1, 1) self.assert_(not isinstance(True & 1, bool)) self.assertIs(True & True, True) self.assertEqual(True | 1, 1) self.assert_(not isinstance(True | 1, bool)) self.assertIs(True | True, True) self.assertEqual(True ^ 1, 0) self.assert_(not isinstance(True ^ 1, bool)) self.assertIs(True ^ True, False) def test_fileclosed(self): try: f = file(TESTFN, "w") self.assertIs(f.closed, False) f.close() self.assertIs(f.closed, True) finally: os.remove(TESTFN) def test_operator(self): import operator self.assertIs(operator.truth(0), False) self.assertIs(operator.truth(1), True) self.assertIs(operator.isCallable(0), False) self.assertIs(operator.isCallable(len), True) self.assertIs(operator.isNumberType(None), False) self.assertIs(operator.isNumberType(0), True) self.assertIs(operator.not_(1), False) self.assertIs(operator.not_(0), True) self.assertIs(operator.isSequenceType(0), False) self.assertIs(operator.isSequenceType([]), True) self.assertIs(operator.contains([], 1), False) self.assertIs(operator.contains([1], 1), True) self.assertIs(operator.isMappingType(1), False) self.assertIs(operator.isMappingType({}), True) self.assertIs(operator.lt(0, 0), False) self.assertIs(operator.lt(0, 1), True) self.assertIs(operator.is_(True, True), True) self.assertIs(operator.is_(True, False), False) self.assertIs(operator.is_not(True, True), False) self.assertIs(operator.is_not(True, False), True) def test_marshal(self): import marshal veris(marshal.loads(marshal.dumps(True)), True) veris(marshal.loads(marshal.dumps(False)), False) def test_pickle(self): import pickle self.assertIs(pickle.loads(pickle.dumps(True)), True) self.assertIs(pickle.loads(pickle.dumps(False)), False) self.assertIs(pickle.loads(pickle.dumps(True, True)), True) self.assertIs(pickle.loads(pickle.dumps(False, True)), False) def test_cpickle(self): import cPickle self.assertIs(cPickle.loads(cPickle.dumps(True)), True) self.assertIs(cPickle.loads(cPickle.dumps(False)), False) self.assertIs(cPickle.loads(cPickle.dumps(True, True)), True) self.assertIs(cPickle.loads(cPickle.dumps(False, True)), False) def test_mixedpickle(self): import pickle, cPickle self.assertIs(pickle.loads(cPickle.dumps(True)), True) self.assertIs(pickle.loads(cPickle.dumps(False)), False) self.assertIs(pickle.loads(cPickle.dumps(True, True)), True) self.assertIs(pickle.loads(cPickle.dumps(False, True)), False) self.assertIs(cPickle.loads(pickle.dumps(True)), True) self.assertIs(cPickle.loads(pickle.dumps(False)), False) self.assertIs(cPickle.loads(pickle.dumps(True, True)), True) self.assertIs(cPickle.loads(pickle.dumps(False, True)), False) def test_picklevalues(self): import pickle, cPickle self.assertEqual(pickle.dumps(True), "I01\n.") self.assertEqual(pickle.dumps(False), "I00\n.") self.assertEqual(cPickle.dumps(True), "I01\n.") self.assertEqual(cPickle.dumps(False), "I00\n.") self.assertEqual(pickle.dumps(True, True), "I01\n.") self.assertEqual(pickle.dumps(False, True), "I00\n.") self.assertEqual(cPickle.dumps(True, True), "I01\n.") self.assertEqual(cPickle.dumps(False, True), "I00\n.") def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(BoolTest)) test_support.run_suite(suite) if __name__ == "__main__": test_main()
def verisnot(a, b): if a is b: raise TestFailed, "%r is %r" % (a, b)
dbcede5d66aee2999c16367fd4a2529fe77e91ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dbcede5d66aee2999c16367fd4a2529fe77e91ae/test_bool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1924, 291, 902, 12, 69, 16, 324, 4672, 309, 279, 353, 324, 30, 1002, 7766, 2925, 16, 2213, 86, 353, 738, 86, 6, 738, 261, 69, 16, 324, 13, 225, 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, 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, 1924, 291, 902, 12, 69, 16, 324, 4672, 309, 279, 353, 324, 30, 1002, 7766, 2925, 16, 2213, 86, 353, 738, 86, 6, 738, 261, 69, 16, 324, 13, 225, 2, -100, -100, -100, -100, -100, -10...
cty.c_int, [cty.POINTER(FL_OBJECT)],
cty.c_int, [cty.POINTER(FL_OBJECT)],
def fl_set_input_xoffset(ob, xoff): """ fl_set_input_xoffset(ob, xoff) """ _fl_set_input_xoffset(ob, xoff)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 2630, 67, 92, 3348, 12, 947, 16, 619, 3674, 4672, 3536, 1183, 67, 542, 67, 2630, 67, 92, 3348, 12, 947, 16, 619, 3674, 13, 3536, 225, 389, 2242, 67, 542, 67, 263...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 2630, 67, 92, 3348, 12, 947, 16, 619, 3674, 4672, 3536, 1183, 67, 542, 67, 2630, 67, 92, 3348, 12, 947, 16, 619, 3674, 13, 3536, 225, 389, 2242, 67, 542, 67, 263...
print strftime("%c", localnow)
def processRepeated(self, findRunningEvent = True): print "ProcessRepeated" if (self.repeated != 0): now = int(time()) + 1
9ddb6ca949731ad0f510602b012ee0b2ea53890f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6652/9ddb6ca949731ad0f510602b012ee0b2ea53890f/timer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 20730, 12, 2890, 16, 1104, 7051, 1133, 273, 1053, 4672, 1172, 315, 2227, 20730, 6, 309, 261, 2890, 18, 266, 9061, 480, 374, 4672, 2037, 273, 509, 12, 957, 10756, 397, 404, 2, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 20730, 12, 2890, 16, 1104, 7051, 1133, 273, 1053, 4672, 1172, 315, 2227, 20730, 6, 309, 261, 2890, 18, 266, 9061, 480, 374, 4672, 2037, 273, 509, 12, 957, 10756, 397, 404, 2, -10...
alpha_k, fc, gc, old_fval, old_old_fval = \
alpha_k, fc, gc, old_fval, old_old_fval, gfkp1 = \
def fmin_cg(f, x0, fprime=None, args=(), avegtol=1e-5, epsilon=1.49e-8, maxiter=None, full_output=0, disp=1, retall=0): """Minimize a function with nonlinear conjugate gradient algorithm. Description: Optimize the function, f, whose gradient is given by fprime using the nonlinear conjugate gradient algorithm of Polak and Ribiere See Wright, and Nocedal 'Numerical Optimization', 1999, pg. 120-122. Inputs: f -- the Python function or method to be minimized. x0 -- the initial guess for the minimizer. fprime -- a function to compute the gradient of f. args -- extra arguments to f and fprime. avegtol -- minimum average value of gradient for stopping epsilon -- if fprime is approximated use this value for the step size (can be scalar or vector) Outputs: (xopt, {fopt, func_calls, grad_calls, warnflag}, {allvecs}) xopt -- the minimizer of f. fopt -- the value of f(xopt). func_calls -- the number of function_calls. grad_calls -- the number of gradient calls. warnflag -- an integer warning flag: 1 : 'Maximum number of iterations exceeded.' 2 : 'Gradient and/or function calls not changing' allvecs -- if retall then this vector of the iterates is returned Additional Inputs: avegtol -- the minimum occurs when fprime(xopt)==0. This specifies how close to zero the average magnitude of fprime(xopt) needs to be. maxiter -- the maximum number of iterations. full_output -- if non-zero then return fopt, func_calls, grad_calls, and warnflag in addition to xopt. disp -- print convergence message if non-zero. retall -- return a list of results at each iteration if True """ app_fprime = 0 if fprime is None: app_fprime = 1 x0 = asarray(x0) if maxiter is None: maxiter = len(x0)*200 func_calls = 0 grad_calls = 0 k = 0 N = len(x0) gtol = N*avegtol if app_fprime: gfk = apply(approx_fprime,(x0,f,epsilon)+args) myfprime = (approx_fprime,epsilon) func_calls = func_calls + len(x0) + 1 else: gfk = apply(fprime,(x0,)+args) myfprime = fprime grad_calls = grad_calls + 1 xk = x0 if retall: allvecs = [xk] sk = [2*gtol] warnflag = 0 pk = -gfk old_fval = f(xk,*args) old_old_fval = old_fval + 5000 while (Num.add.reduce(abs(gfk)) > gtol) and (k < maxiter): deltak = Num.dot(gfk,gfk) alpha_k, fc, gc, old_fval, old_old_fval = \ line_search(f,myfprime,xk,pk,gfk,old_fval,old_old_fval,args=args,c2=0.3) func_calls += fc grad_calls += gc xk = xk + alpha_k*pk if retall: allvecs.append(xk) if app_fprime: gfkp1 = apply(approx_fprime,(xk,f,epsilon)+args) func_calls = func_calls + gc + len(x0) + 1 else: gfkp1 = apply(fprime,(xk,)+args) grad_calls = grad_calls + gc + 1 yk = gfkp1 - gfk beta_k = pymax(0,Num.dot(yk,gfkp1)/deltak) pk = -gfkp1 + beta_k * pk gfk = gfkp1 k = k + 1 if disp or full_output: fval = apply(f,(xk,)+args) if warnflag == 2: if disp: print "Warning: Desired error not necessarily achieved due to precision loss" print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls elif k >= maxiter: warnflag = 1 if disp: print "Warning: Maximum number of iterations has been exceeded" print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls else: if disp: print "Optimization terminated successfully." print " Current function value: %f" % fval print " Iterations: %d" % k print " Function evaluations: %d" % func_calls print " Gradient evaluations: %d" % grad_calls if full_output: retlist = xk, fval, func_calls, grad_calls, warnflag if retall: retlist += (allvecs,) else: retlist = xk if retall: retlist = (xk, allvecs) return retlist
18d62e07c7b0b8dd2d3680a3b704bd36ff6ae89b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/18d62e07c7b0b8dd2d3680a3b704bd36ff6ae89b/optimize.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1154, 67, 26275, 12, 74, 16, 619, 20, 16, 284, 16382, 33, 7036, 16, 833, 33, 9334, 279, 537, 75, 3490, 33, 21, 73, 17, 25, 16, 12263, 33, 21, 18, 7616, 73, 17, 28, 16, 25743...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 1154, 67, 26275, 12, 74, 16, 619, 20, 16, 284, 16382, 33, 7036, 16, 833, 33, 9334, 279, 537, 75, 3490, 33, 21, 73, 17, 25, 16, 12263, 33, 21, 18, 7616, 73, 17, 28, 16, 25743...
mol = self.molecule from chunk import _nullMol better_alive_answer = mol is not None and self.key in mol.atoms and mol is not _nullMol
better_alive_answer = mol is not None and self.key in mol.atoms and mol is not _nullMol
def killed(self): #bruce 041029; totally revised by bruce 050702 """ (Public method) Report whether an atom has been killed. """ # Note: some "friend code" inlines this method for speed # (and omits the debug code). To find it, search for _Atom__killed # (the mangled version of __killed). [bruce 071018 comment] if debug_flags.atom_debug: # this cond is for speed mol = self.molecule from chunk import _nullMol better_alive_answer = mol is not None and self.key in mol.atoms and mol is not _nullMol ##e and mol is not killed??? if (not not better_alive_answer) != (not self.__killed): if debug_flags.atom_debug: #bruce 060414 re bug 1779, but it never printed for it (worth keeping in for other bugs) #bruce 071018 fixed typo of () after debug_flags.atom_debug -- could that be why it never printed it?!? print "debug: better_alive_answer is %r but (not self.__killed) is %r" % (better_alive_answer , not self.__killed) return self.__killed
ed409134e77b5e0b4516d0060e8f298611249859 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/ed409134e77b5e0b4516d0060e8f298611249859/chem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24859, 12, 2890, 4672, 468, 2848, 3965, 16486, 2163, 5540, 31, 9997, 1230, 283, 26779, 635, 5186, 3965, 374, 3361, 27, 3103, 3536, 261, 4782, 707, 13, 8706, 2856, 392, 3179, 711, 2118, 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, 24859, 12, 2890, 4672, 468, 2848, 3965, 16486, 2163, 5540, 31, 9997, 1230, 283, 26779, 635, 5186, 3965, 374, 3361, 27, 3103, 3536, 261, 4782, 707, 13, 8706, 2856, 392, 3179, 711, 2118, 2...
return http.Response(stream=template('login.html', **template_dict)) else: return http.Response(stream = message("Please enable cookies and try again."))
return HTMLResponse(stream=template('login.html', **template_dict)) else: return HTMLResponse(stream = message("Please enable cookies and try again."))
def render(self, ctx): # Since public access is allowed, which lists usernames in the published # worksheets and ratings, this gives no new information way. # If published pages were disabled, then this should be disabled too. if self.problem == 'username': template_dict = {'accounts': notebook.get_accounts(), 'default_user': notebook.default_user(), 'username_error': True, 'recovery': notebook.conf()['email']} return http.Response(stream=template('login.html', **template_dict)) elif self.problem == 'password': template_dict = {'accounts': notebook.get_accounts(), 'default_user': self.username, 'password_error': True, 'recovery': notebook.conf()['email']} return http.Response(stream=template('login.html', **template_dict)) else: return http.Response(stream = message("Please enable cookies and try again."))
86a4ed9cb0aba48a11523b820246bf1c9d9e7be2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/86a4ed9cb0aba48a11523b820246bf1c9d9e7be2/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 7897, 1071, 2006, 353, 2935, 16, 1492, 6035, 27675, 316, 326, 9487, 468, 6330, 10245, 471, 15183, 899, 16, 333, 14758, 1158, 394, 1779, 4031, 18, 468...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 468, 7897, 1071, 2006, 353, 2935, 16, 1492, 6035, 27675, 316, 326, 9487, 468, 6330, 10245, 471, 15183, 899, 16, 333, 14758, 1158, 394, 1779, 4031, 18, 468...
return ""
return "2000"
def GetImageWindowWidth(self, preset=WL_PRESET, multiple=WL_MULT): """ Return image window width (related to contrast). This is an integer or a floating point. If the value can't be read, return "".
c7ea4e643babd25a3c51ade4e2a02ac75bc59474 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/c7ea4e643babd25a3c51ade4e2a02ac75bc59474/dicom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 2040, 3829, 2384, 12, 2890, 16, 12313, 33, 59, 48, 67, 3670, 4043, 16, 3229, 33, 59, 48, 67, 12845, 4672, 3536, 2000, 1316, 2742, 1835, 261, 9243, 358, 23119, 2934, 1220, 353, 392...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 968, 2040, 3829, 2384, 12, 2890, 16, 12313, 33, 59, 48, 67, 3670, 4043, 16, 3229, 33, 59, 48, 67, 12845, 4672, 3536, 2000, 1316, 2742, 1835, 261, 9243, 358, 23119, 2934, 1220, 353, 392...
group_info=group_info.replace(group_info[openindex:closeindex+1],"")
group_info=group_info.replace\ (group_info[openindex:closeindex+1],"")
def verify_sched_domain_dmesg(sched_mc_level, sched_smt_level): ''' Read sched domain information from dmesg. ''' cpu_group = list() try: dmesg_info = os.popen('dmesg').read() if dmesg_info != "": lines = dmesg_info.split('\n') for i in range(0, len(lines)): if lines[i].endswith('CPU'): groups = lines[i+1].split("groups:") group_info = groups[1] if group_info.find("(") != -1: openindex=group_info.index("(") closeindex=group_info.index(")") group_info=group_info.replace(group_info[openindex:closeindex+1],"") subgroup = group_info.split() for j in range(0, len(subgroup)): cpu_group = expand_range(subgroup[j]) status = validate_cpugrp_map(cpu_group, sched_mc_level,\ sched_smt_level) if status == 1: if is_quad_core() == 1: if int(sched_mc_level) == 0: return(0) else: return(1) else: return(1) return(0) else: return(1) except Exception, details: print "Reading dmesg failed", details sys.exit(1)
bde0088285dcc63685bddce865f205b2c4a8bbe0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11457/bde0088285dcc63685bddce865f205b2c4a8bbe0/sched_mc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 67, 87, 2049, 67, 4308, 67, 10956, 281, 75, 12, 87, 2049, 67, 13952, 67, 2815, 16, 23964, 67, 87, 1010, 67, 2815, 4672, 9163, 2720, 23964, 2461, 1779, 628, 9113, 281, 75, 18, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 67, 87, 2049, 67, 4308, 67, 10956, 281, 75, 12, 87, 2049, 67, 13952, 67, 2815, 16, 23964, 67, 87, 1010, 67, 2815, 4672, 9163, 2720, 23964, 2461, 1779, 628, 9113, 281, 75, 18, 9...
print 'workflow creation command for workflow:',workflow,'exited with ExitCode:',exitValue else : exitValue = exitCode
print 'workflow creation command for workflow:',workflow,'exited with ExitCode:',exitCode else :
def main(argv) : """ prepareRelValworkflows prepare workflows for chained processing of RelVal samples - parse file holding cmsDriver commands for 1st and 2nd steps - prepare workflows - prepare WorkflowInjector:Input script - prepare ForceMerge script - prepare DBSMigrationToGlobal script - prepare PhEDExInjection script - prepare local DBS query script required parameters --samples <textfile> : list of RelVal sample parameter-sets in plain text file, one sample per line, # marks comment --version <processing version> : processing version (v1, v2, ... ) --DBSURL <URL> : URL of the local DBS (http://cmsdbsprod.cern.ch/cms_dbs_prod_local_07/servlet/DBSServlet, http://cmssrv46.fnal.gov:8080/DBS126/servlet/DBSServlet) optional parameters : --lumi <number> : initial run for generation (default: 666666), set it to 777777 for high statistics samples --event <number> : initial event number --help (-h) : help --debug (-d) : debug statements """ # default try: version = os.environ.get("CMSSW_VERSION") except: print '' print 'CMSSW version cannot be determined from $CMSSW_VERSION' sys.exit(2) try: architecture = os.environ.get("SCRAM_ARCH") except: print '' print 'CMSSW architecture cannot be determined from $SCRAM_ARCH' sys.exit(2) samples = None processing_version = None initial_run = "666666" initial_event = None debug = 0 DBSURL = None try: opts, args = getopt.getopt(argv, "", ["help", "debug", "samples=", "version=", "DBSURL=", "event=", "lumi="]) except getopt.GetoptError: print main.__doc__ sys.exit(2) # check command line parameter for opt, arg in opts : if opt == "--help" : print main.__doc__ sys.exit() elif opt == "--debug" : debug = 1 elif opt == "--samples" : samples = arg elif opt == "--version" : processing_version = arg
47397be0ad25e900c8367cb1b05a7d6e187b915f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/47397be0ad25e900c8367cb1b05a7d6e187b915f/prepareRelValWorkflows.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 19485, 13, 294, 3536, 225, 2911, 1971, 3053, 13815, 87, 225, 2911, 31738, 364, 20269, 4929, 434, 4275, 3053, 5216, 225, 300, 1109, 585, 19918, 6166, 4668, 4364, 364, 404, 334, ...
lines1 = file(os.path.join(dirname(), filename), "r").readlines()
lines1 = file(os.path.join(dirname(), filename), "rU").readlines()
def test_readlines(self): """Test readlines() method of _FileObject. """ if self.sep != "|": filename = "0-REGTYPE-TEXT" self.tar.extract(filename, dirname()) lines1 = file(os.path.join(dirname(), filename), "r").readlines() lines2 = self.tar.extractfile(filename).readlines() self.assert_(lines1 == lines2, "_FileObject.readline() does not work correctly")
17e0b35990981886e883d198e3696cf53a8b312a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/17e0b35990981886e883d198e3696cf53a8b312a/test_tarfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 896, 3548, 12, 2890, 4672, 3536, 4709, 17546, 1435, 707, 434, 389, 21471, 18, 3536, 309, 365, 18, 10814, 480, 11747, 6877, 1544, 273, 315, 20, 17, 5937, 2399, 17, 5151, 6, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 896, 3548, 12, 2890, 4672, 3536, 4709, 17546, 1435, 707, 434, 389, 21471, 18, 3536, 309, 365, 18, 10814, 480, 11747, 6877, 1544, 273, 315, 20, 17, 5937, 2399, 17, 5151, 6, 36...
iface)
iface, addr)
def __repr__(self): rt = "Network Netmask Gateway Iface\n" for net,msk,gw,iface,addr in self.routes: rt += "%-15s %-15s %-15s %s\n" % (ltoa(net), ltoa(msk), gw, iface) return rt
3189058f12fcf8b5eb134c746ce4ab9b49c84e27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/3189058f12fcf8b5eb134c746ce4ab9b49c84e27/scapy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 8253, 273, 315, 3906, 540, 8503, 4455, 540, 11381, 540, 29808, 64, 82, 6, 364, 2901, 16, 959, 79, 16, 28500, 16, 31479, 16, 4793, 316, 365, 18, 10854,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12715, 972, 12, 2890, 4672, 8253, 273, 315, 3906, 540, 8503, 4455, 540, 11381, 540, 29808, 64, 82, 6, 364, 2901, 16, 959, 79, 16, 28500, 16, 31479, 16, 4793, 316, 365, 18, 10854,...
"""SMTP 'verify' command. Checks for address validity."""
"""SMTP 'verify' command -- checks for address validity."""
def verify(self, address): """SMTP 'verify' command. Checks for address validity.""" self.putcmd("vrfy", quoteaddr(address)) return self.getreply()
33277df4d8ce335176270f2501de2933739ddd3c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/33277df4d8ce335176270f2501de2933739ddd3c/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3929, 12, 2890, 16, 1758, 4672, 3536, 55, 14636, 296, 8705, 11, 1296, 1493, 4271, 364, 1758, 13800, 12123, 365, 18, 458, 4172, 2932, 16825, 93, 3113, 4914, 684, 3069, 12, 2867, 3719, 327...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3929, 12, 2890, 16, 1758, 4672, 3536, 55, 14636, 296, 8705, 11, 1296, 1493, 4271, 364, 1758, 13800, 12123, 365, 18, 458, 4172, 2932, 16825, 93, 3113, 4914, 684, 3069, 12, 2867, 3719, 327...
result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id)
result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id, company_id)
def onchange_partner_id(self, cr, uid, ids, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False): # Copy partner data to invoice, also the new field payment_type result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, date_invoice, payment_term, partner_bank_id) payment_type = False if partner_id: partner_line = self.pool.get('res.partner').browse(cr, uid, partner_id) if partner_line: if type=='in_invoice' or type=='in_refund': payment_type = partner_line.payment_type_supplier.id else: payment_type = partner_line.payment_type_customer.id if payment_type: result['value']['payment_type'] = payment_type return self.onchange_payment_type(cr, uid, ids, payment_type, partner_id, result)
cf9be14079eef5bcb578f22889621498f66aacda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9833/cf9be14079eef5bcb578f22889621498f66aacda/account_invoice.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 3427, 67, 31993, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 618, 16, 19170, 67, 350, 16, 1509, 67, 16119, 33, 8381, 16, 5184, 67, 6408, 33, 8381, 16, 19170, 67, 10546,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 3427, 67, 31993, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 618, 16, 19170, 67, 350, 16, 1509, 67, 16119, 33, 8381, 16, 5184, 67, 6408, 33, 8381, 16, 19170, 67, 10546,...
uo.addheader('Range', 'bytes=%s-' % rlen)
headers.append(('Range', 'bytes=%s-' % rlen)) uo.addheaders = headers
def read_file_content(self): if not self._retrieved or self.uploadByUrl: # Get file contents wikipedia.output(u'Reading file %s' % self.url) if '://' in self.url: resume = False dt = 15
ea1c58d03dbc2e3d9a652b98906a40612ff7b553 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/ea1c58d03dbc2e3d9a652b98906a40612ff7b553/upload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 768, 67, 1745, 12, 2890, 4672, 309, 486, 365, 6315, 14580, 2155, 578, 365, 18, 6327, 858, 1489, 30, 468, 968, 585, 2939, 21137, 18, 2844, 12, 89, 11, 15714, 585, 738, 87, 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, 855, 67, 768, 67, 1745, 12, 2890, 4672, 309, 486, 365, 6315, 14580, 2155, 578, 365, 18, 6327, 858, 1489, 30, 468, 968, 585, 2939, 21137, 18, 2844, 12, 89, 11, 15714, 585, 738, 87, 11...
request.user.getFormattedDateTime( wikiutil.version2timestamp(idx.mtime())) or _('N/A'))
request.user.getFormattedDateTime(idx.mtime()) or _('N/A'))
def getInfo(self): _ = self.request.getText request = self.request
112ce962db695889a0bc7d7130f192b2ece7a92e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/112ce962db695889a0bc7d7130f192b2ece7a92e/SystemInfo.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17142, 12, 2890, 4672, 389, 273, 365, 18, 2293, 18, 588, 1528, 590, 273, 365, 18, 2293, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17142, 12, 2890, 4672, 389, 273, 365, 18, 2293, 18, 588, 1528, 590, 273, 365, 18, 2293, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
fo = open(test_support.TESTFN, "rb")
fo = open(test_support.TESTFN, "r")
def test_print(self): d = deque(range(200)) d.append(d) try: fo = open(test_support.TESTFN, "wb") fo.write(str(d)) fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), repr(d)) finally: fo.close() os.remove(test_support.TESTFN)
a298c0b8a7d06b4262b35baebca62bab653bbf81 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/a298c0b8a7d06b4262b35baebca62bab653bbf81/test_deque.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1188, 12, 2890, 4672, 302, 273, 21147, 12, 3676, 12, 6976, 3719, 302, 18, 6923, 12, 72, 13, 775, 30, 18261, 273, 1696, 12, 3813, 67, 13261, 18, 16961, 19793, 16, 315, 9464, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1188, 12, 2890, 4672, 302, 273, 21147, 12, 3676, 12, 6976, 3719, 302, 18, 6923, 12, 72, 13, 775, 30, 18261, 273, 1696, 12, 3813, 67, 13261, 18, 16961, 19793, 16, 315, 9464, ...
<TABLE> <TR> <TD>Username:</TD> <TD><INPUT name="username" type="text"> (Hint: any username will work)</TD> </TR> <TR> <TD>Password:</TD> <TD><INPUT name="password" type="password"> (Hint: redfoot)</TD> </TR> <TR> <TD colspan=2"><INPUT value="Login" type="submit"></TD> </TR>
<TABLE> <TR> <TD>Username:</TD> <TD><INPUT name="username" type="text"> (Hint: any username will work)</TD> </TR> <TR> <TD>Password:</TD> <TD><INPUT name="password" type="password"> (Hint: redfoot)</TD> </TR> <TR> <TD colspan="2"><INPUT value="Login" type="submit"></TD> </TR> </TABLE>
def authenticated(self, request, response): parameters = request.getParameters() session = request.getSession() if hasattr(session, 'username'): return 1 elif parameters['username']!="" and \ parameters['password']!="" and parameters['password']=="redfoot": session.username = parameters['username'] return 1 else: response.write("""
826e6f4dc15f8e9c7fbf4366667f8ddff5934466 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/826e6f4dc15f8e9c7fbf4366667f8ddff5934466/sample1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9370, 12, 2890, 16, 590, 16, 766, 4672, 1472, 273, 590, 18, 588, 2402, 1435, 1339, 273, 590, 18, 588, 2157, 1435, 309, 3859, 12, 3184, 16, 296, 5053, 11, 4672, 327, 404, 1327, 1472, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9370, 12, 2890, 16, 590, 16, 766, 4672, 1472, 273, 590, 18, 588, 2402, 1435, 1339, 273, 590, 18, 588, 2157, 1435, 309, 3859, 12, 3184, 16, 296, 5053, 11, 4672, 327, 404, 1327, 1472, ...
else
else:
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 472) else quickfix.StringField.__init__(self, 472, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1059, 9060, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1059, 9060, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
help: Help text to show in a tooltip
def __init__(self, label='', default='', help='', state='normal', *flags): """Create a FlagGroup with the given label and state. label: Label for the group default: Default selection help: Help text to show in a tooltip state: 'normal' for regular Flags, 'exclusive' for mutually-exclusive Flags *flags: All additional arguments are Flag controls """ Control.__init__(self, str, '', label, '', '') self.flags = flags self.state = state
57d407a827a5f2348c131eec7e0fa2b279dd1577 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4675/57d407a827a5f2348c131eec7e0fa2b279dd1577/control.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1433, 2218, 2187, 805, 2218, 2187, 2809, 2218, 2187, 919, 2218, 6130, 2187, 380, 7133, 4672, 3536, 1684, 279, 9960, 1114, 598, 326, 864, 1433, 471, 919, 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, 2738, 972, 12, 2890, 16, 1433, 2218, 2187, 805, 2218, 2187, 2809, 2218, 2187, 919, 2218, 6130, 2187, 380, 7133, 4672, 3536, 1684, 279, 9960, 1114, 598, 326, 864, 1433, 471, 919, 18...
print 'WARNING: failed to parse ldd output "'+line[:-1]+'", compared "'+line[:len(executable)+1]+'" and "'+executable+':'+'"'
print 'WARNING: failed to parse ldd output "'+line[:-1]+'"'
def lddlist_libraries_freebsd(executable): """returns a list of libraries that the executable depends on """ retval = [] pd = os.popen3('ldd '+executable) line = pd[1].readline() while (len(line)>0): subl = string.split(line) if (len(subl)>0): if (subl[0] == executable+':'): pass if (len(subl)>=6 and subl[2] == 'not' and subl[4] == 'dynamic'): return retval elif (len(subl)>=4): if (os.path.exists(subl[2])): retval += [subl[2]] else: print 'ldd returns non existing library '+subl[2] else: print 'WARNING: failed to parse ldd output "'+line[:-1]+'", len subl='+str(len(subl))+'' elif (line[:len(executable)+1] == executable+':'): pass else: print 'WARNING: failed to parse ldd output "'+line[:-1]+'", compared "'+line[:len(executable)+1]+'" and "'+executable+':'+'"' line = pd[1].readline() return retval
82956646eb861112466c02a3eddf9793cbe3c5e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6201/82956646eb861112466c02a3eddf9793cbe3c5e7/jk_lib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 449, 1098, 67, 31417, 67, 9156, 2038, 72, 12, 17751, 4672, 3536, 6154, 279, 666, 434, 14732, 716, 326, 9070, 10935, 603, 3536, 5221, 273, 5378, 4863, 273, 1140, 18, 84, 3190, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 328, 449, 1098, 67, 31417, 67, 9156, 2038, 72, 12, 17751, 4672, 3536, 6154, 279, 666, 434, 14732, 716, 326, 9070, 10935, 603, 3536, 5221, 273, 5378, 4863, 273, 1140, 18, 84, 3190, 23, ...
d = deque(xrange(100)) d.__init__(xrange(100, 200))
d = deque(xrange(-5125, -5000)) d.__init__(xrange(200))
def test_basics(self): d = deque(xrange(100)) d.__init__(xrange(100, 200)) for i in xrange(200, 400): d.append(i) for i in reversed(xrange(-200, 0)): d.appendleft(i) self.assertEqual(list(d), range(-200, 400)) self.assertEqual(len(d), 600)
7a4cc637b10bc88df173b42e22a51691a4182eb8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/7a4cc637b10bc88df173b42e22a51691a4182eb8/test_deque.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 9157, 2102, 12, 2890, 4672, 302, 273, 21147, 12, 92, 3676, 19236, 13757, 25, 16, 300, 25, 3784, 3719, 302, 16186, 2738, 972, 12, 92, 3676, 12, 6976, 3719, 364, 277, 316, 1231...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9157, 2102, 12, 2890, 4672, 302, 273, 21147, 12, 92, 3676, 19236, 13757, 25, 16, 300, 25, 3784, 3719, 302, 16186, 2738, 972, 12, 92, 3676, 12, 6976, 3719, 364, 277, 316, 1231...
self.PropertyStepSize.value = 1
self.Property.value = 0
def __init__(self): self.always_evaluate(True) self.last_trigger_time = TimeIn.value self.PropertyInc.value = False self.PropertyDec.value = False self.Enable.value = False self.PropertyStepSize.value = 1 self.PropertyMin.value = 0 self.PropertyMax.value = 100000 self.TriggerTimeDelta.value = 0.05
06bc2489bc34aff885b81bb01041ee2bcf45f8b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8421/06bc2489bc34aff885b81bb01041ee2bcf45f8b1/_property_modifier.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 17737, 67, 21024, 12, 5510, 13, 365, 18, 2722, 67, 10668, 67, 957, 273, 2647, 382, 18, 1132, 225, 365, 18, 1396, 14559, 18, 1132, 273, 1083, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 17737, 67, 21024, 12, 5510, 13, 365, 18, 2722, 67, 10668, 67, 957, 273, 2647, 382, 18, 1132, 225, 365, 18, 1396, 14559, 18, 1132, 273, 1083, ...
class ChannelContextMenu(FixedMenu):
class ChannelContextMenu(Screen):
def cancelClick(self): self.close(False)
d4fc7c9fea8e8a52d607596ab4d1027a82199de3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/d4fc7c9fea8e8a52d607596ab4d1027a82199de3/ChannelSelection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3755, 6563, 12, 2890, 4672, 365, 18, 4412, 12, 8381, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3755, 6563, 12, 2890, 4672, 365, 18, 4412, 12, 8381, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
W = Q + (k*2*m)*P
W = Q + k*twomP
def order(self, disable_warning=False): """ Return the order of this point on the elliptic curve. If the point has infinite order, returns 0.
c349c1cda66ccdb73d8c3a4b57eceb087747edcd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c349c1cda66ccdb73d8c3a4b57eceb087747edcd/ell_point.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1353, 12, 2890, 16, 4056, 67, 8551, 33, 8381, 4672, 3536, 2000, 326, 1353, 434, 333, 1634, 603, 326, 415, 549, 21507, 8882, 18, 971, 326, 1634, 711, 14853, 1353, 16, 1135, 374, 18, 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, 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, 1353, 12, 2890, 16, 4056, 67, 8551, 33, 8381, 4672, 3536, 2000, 326, 1353, 434, 333, 1634, 603, 326, 415, 549, 21507, 8882, 18, 971, 326, 1634, 711, 14853, 1353, 16, 1135, 374, 18, 2, ...
del names["__builtins__"]
if names.has_key("__builtins__"): del names["__builtins__"]
def check_all(modname): names = {} try: exec "import %s" % modname in names except ImportError: # silent fail here seems the best route since some modules # may not be available in all environments return verify(hasattr(sys.modules[modname], "__all__"), "%s has no __all__ attribute" % modname) names = {} exec "from %s import *" % modname in names del names["__builtins__"] keys = names.keys() keys.sort() all = list(sys.modules[modname].__all__) # in case it's a tuple all.sort() verify(keys==all, "%s != %s" % (keys, all))
cc012e92b21fbd8476bbaa8d4aa91b7e78111182 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/cc012e92b21fbd8476bbaa8d4aa91b7e78111182/test___all__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 454, 12, 1711, 529, 4672, 1257, 273, 2618, 775, 30, 1196, 315, 5666, 738, 87, 6, 738, 16037, 316, 1257, 1335, 11308, 30, 468, 10404, 2321, 2674, 12001, 326, 3796, 1946, 3241, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 454, 12, 1711, 529, 4672, 1257, 273, 2618, 775, 30, 1196, 315, 5666, 738, 87, 6, 738, 16037, 316, 1257, 1335, 11308, 30, 468, 10404, 2321, 2674, 12001, 326, 3796, 1946, 3241, ...
feat_read = gdaltest.sl_lyr.GetNextFeature()
feat_read = sql_lyr.GetNextFeature()
dst_feat = ogr.Feature( feature_def = gdaltest.sl_lyr.GetLayerDefn() )
d6228cd064850d95937fb5ab368af77da084a02d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10289/d6228cd064850d95937fb5ab368af77da084a02d/ogr_sqlite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 3046, 67, 29735, 273, 320, 3197, 18, 4595, 12, 2572, 67, 536, 273, 15551, 2390, 395, 18, 2069, 67, 715, 86, 18, 967, 4576, 3262, 82, 1435, 262, 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, 3046, 67, 29735, 273, 320, 3197, 18, 4595, 12, 2572, 67, 536, 273, 15551, 2390, 395, 18, 2069, 67, 715, 86, 18, 967, 4576, 3262, 82, 1435, 262, 2, -100, -100, -100, -100, -100, -100, -100, ...
return NOT_FOUND_MSG % (next_part, wsgilib.construct_url(environ))
return NOT_FOUND_MSG % (next_part, request.construct_url(environ))
def debug(self, environ, start_response): assert request.path_info_pop(environ) == '_debug' next_part = request.path_info_pop(environ) method = getattr(self, next_part, None) if not method: start_response('404 Not Found', [('content-type', 'text/plain')]) return NOT_FOUND_MSG % (next_part, wsgilib.construct_url(environ)) if not getattr(method, 'exposed', False): start_response('403 Forbidden', [('content-type', 'text/plain')]) return FORBIDDEN_MSG % next_part return method(environ, start_response)
bfceb7aa266724f818b7696526816d18411f0d39 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12946/bfceb7aa266724f818b7696526816d18411f0d39/middleware.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 1815, 590, 18, 803, 67, 1376, 67, 5120, 12, 28684, 13, 422, 2070, 4148, 11, 1024, 67, 2680, 273, 590, 18, 803, 67, 1376, 67, 5120, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 1815, 590, 18, 803, 67, 1376, 67, 5120, 12, 28684, 13, 422, 2070, 4148, 11, 1024, 67, 2680, 273, 590, 18, 803, 67, 1376, 67, 5120, ...
adb_putcat2 = cfunc('tcadbputcat2', libtc, c_bool, ('adb', c_void_p, 1), ('kstr', c_char_p, 1), ('vstr', c_char_p, 1))
adb_putcat2 = cfunc_fast('tcadbputcat2', libtc, c_bool, ('adb', c_void_p, 1), ('kstr', c_char_p, 1), ('vstr', c_char_p, 1))
def __del__(self): if self and libtc: libtc.tcmapdel(self)
d933a88c35eaafd1e33ecc67d5d79a71d19a200b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4926/d933a88c35eaafd1e33ecc67d5d79a71d19a200b/tc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3771, 972, 12, 2890, 4672, 309, 365, 471, 2561, 5111, 30, 2561, 5111, 18, 5111, 1458, 3771, 12, 2890, 13, 2, 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, 1001, 3771, 972, 12, 2890, 4672, 309, 365, 471, 2561, 5111, 30, 2561, 5111, 18, 5111, 1458, 3771, 12, 2890, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
except util.SSL.WantReadError: return 0 finally: if cancel: cancel.cancel()
raise except util.SSL.WantWriteError: return 0 except util.SSL.WantReadError: return 0
def socket_send(descriptor, data): timeout = descriptor.gettimeout() if timeout: cancel = exc_after(timeout, TimeoutError) else: cancel = None try: try: return descriptor.send(data) except socket.error, e: if e[0] == errno.EWOULDBLOCK or e[0] == errno.ENOTCONN: return 0 raise except util.SSL.WantWriteError: return 0 except util.SSL.WantReadError: return 0 finally: if cancel: cancel.cancel()
33ccd249ce6338c6350d1a12be9b41ce6591de83 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/33ccd249ce6338c6350d1a12be9b41ce6591de83/greenio.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2987, 67, 4661, 12, 12628, 16, 501, 4672, 2021, 273, 4950, 18, 588, 4538, 1435, 309, 2021, 30, 3755, 273, 3533, 67, 5205, 12, 4538, 16, 28758, 13, 469, 30, 3755, 273, 599, 775, 30, 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, 2987, 67, 4661, 12, 12628, 16, 501, 4672, 2021, 273, 4950, 18, 588, 4538, 1435, 309, 2021, 30, 3755, 273, 3533, 67, 5205, 12, 4538, 16, 28758, 13, 469, 30, 3755, 273, 599, 775, 30, 7...
self.myRequests[-1].append(self.raw_requestline)
self.myRequests[self.reqidx].append(self.raw_requestline)
def handle_one_request(self): result = self.parentClass.handle_one_request(self) self.myRequests[-1].append(self.raw_requestline) return result
9a96ed69551dade73e041c5d7528afed89a0c37e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/9a96ed69551dade73e041c5d7528afed89a0c37e/test_xmlrpc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 476, 67, 2293, 12, 2890, 4672, 563, 273, 365, 18, 2938, 797, 18, 4110, 67, 476, 67, 2293, 12, 2890, 13, 365, 18, 4811, 6421, 63, 2890, 18, 3658, 3465, 8009, 6923, 12, 2890,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 67, 476, 67, 2293, 12, 2890, 4672, 563, 273, 365, 18, 2938, 797, 18, 4110, 67, 476, 67, 2293, 12, 2890, 13, 365, 18, 4811, 6421, 63, 2890, 18, 3658, 3465, 8009, 6923, 12, 2890,...
try: ignore = posix.fdopen except: raise AttributeError, 'dup() method unavailable'
if not hasattr(posix, 'fdopen'): raise AttributeError, 'dup() method unavailable'
def dup(self): import posix
dcd465307021ea32e342ce955e99e3bb4a129848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/dcd465307021ea32e342ce955e99e3bb4a129848/posixfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9417, 12, 2890, 4672, 1930, 16366, 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, ...
[ 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, 9417, 12, 2890, 4672, 1930, 16366, 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, ...
% (name, name, attrs, ['','CHECKED'][isChecked], value)
% (name, offValue, name, attrs, ['','CHECKED'][isChecked], onValue)
def checkbox(name, isChecked, value=1, attrs=''): ''' An html checkbox. Also adds a hidden __expect__ variable since the browser doesn\'t often send unchecked checkboxes. ''' return '<input type="hidden" name="__expect__" value="%s;0">' \ '<input type="checkbox" name="%s" %s %s value="%s">' \ % (name, name, attrs, ['','CHECKED'][isChecked], value)
a412a333f940f97e784c0081dbb8548de154a52c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8821/a412a333f940f97e784c0081dbb8548de154a52c/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11832, 12, 529, 16, 31041, 16, 460, 33, 21, 16, 3422, 2218, 11, 4672, 9163, 1922, 1729, 11832, 18, 8080, 4831, 279, 5949, 1001, 12339, 972, 2190, 3241, 326, 4748, 3302, 3730, 88, 16337, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11832, 12, 529, 16, 31041, 16, 460, 33, 21, 16, 3422, 2218, 11, 4672, 9163, 1922, 1729, 11832, 18, 8080, 4831, 279, 5949, 1001, 12339, 972, 2190, 3241, 326, 4748, 3302, 3730, 88, 16337, ...
result[campaign.id]=str(quantity) return result _columns = { 'code1' : fields.function(_campaign_code,string='Code',type="char",size=64,method=True,readonly=True), 'offer_id' : fields.many2one('dm.offer', 'Offer',domain=[('state','in',['ready','open']),('type','in',['new','standart','rewrite'])], required=True,
result[campaign.id] = str(quantity) return result _columns = { 'code1': fields.function(_campaign_code, string='Code', type="char", size=64, method=True, readonly=True), 'offer_id': fields.many2one('dm.offer', 'Offer', domain=[('state', 'in', ['ready', 'open']), ('type', 'in', ['new', 'standart', 'rewrite'])], required=True,
def _quantity_usable_total(self, cr, uid, ids, name, args, context={}): result={} campaigns = self.browse(cr,uid,ids) for campaign in campaigns: quantity=0 numeric=True for propo in campaign.proposition_ids: if propo.quantity_usable.isdigit(): quantity += int(propo.quantity_usable) else: result[campaign.id]='Check Segments' numeric=False break if numeric: result[campaign.id]=str(quantity) return result
7ee897432c7e7d5a5c8e889fc429c3c1b66627fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/7ee897432c7e7d5a5c8e889fc429c3c1b66627fd/dm_campaign.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 16172, 67, 16665, 67, 4963, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 833, 16, 819, 12938, 4672, 563, 12938, 8965, 87, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16172, 67, 16665, 67, 4963, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 508, 16, 833, 16, 819, 12938, 4672, 563, 12938, 8965, 87, 273, 365, 18, 25731, 12, 3353, 16, 1911, 16, 22...
repack_info): super(RepackWin32, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, repack_info) self.platform = "win32"
platform_formatted, repack_info): super(RepackWin, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, platform_formatted, repack_info)
def __init__(self, build, partner_dir, build_dir, working_dir, final_dir, repack_info): super(RepackWin32, self).__init__(build, partner_dir, build_dir, working_dir, final_dir, repack_info) self.platform = "win32"
8345bd04fc746d831846644290606cce5844b5a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10262/8345bd04fc746d831846644290606cce5844b5a8/partner-repacks.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1361, 16, 19170, 67, 1214, 16, 1361, 67, 1214, 16, 5960, 67, 1214, 16, 727, 67, 1214, 16, 2071, 484, 67, 1376, 4672, 2240, 12, 426, 2920, 18049, 1578, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1361, 16, 19170, 67, 1214, 16, 1361, 67, 1214, 16, 5960, 67, 1214, 16, 727, 67, 1214, 16, 2071, 484, 67, 1376, 4672, 2240, 12, 426, 2920, 18049, 1578, ...
(config.REC_CMD, string.split(prog.channel_id)[0], duration, title)
(config.REC_CMD, prog.tunerid, duration, title)
def checkToRecord(): rec_cmd = None scheduledRecordings = getScheduledRecordings() progs = scheduledRecordings.getProgramList() now = time.time() for prog in progs.values(): print 'checkToRecord: progloop = %s' % prog try: recording = prog.isRecording except: recording = FALSE if prog.start <= now and prog.stop >= now and recording == FALSE: # just add to the 'we want to record this' list # then end the loop, and figure out which has priority, # remember to take into account the full length of the shows # and how much they overlap, or chop one short # yeah thats a good idea but make sure its not like 5 mins duration = int(prog.stop - now - 10) if duration < 60: return FALSE title = '%s--%s' % (prog.title, time.strftime('%Y-%m-%d-%H%M', time.localtime(prog.start))) rec_cmd = '%s %s %s "%s"' % \ (config.REC_CMD, string.split(prog.channel_id)[0], duration, title) print 'REC_CMD: %s' % rec_cmd prog.isRecording = TRUE scheduledRecordings.setProgramList(progs) saveScheduledRecordings(scheduledRecordings) return rec_cmd
1472741f9fde310060e5bbb1631fd592d214b145 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/1472741f9fde310060e5bbb1631fd592d214b145/rec_interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 774, 2115, 13332, 1950, 67, 4172, 273, 599, 9755, 2115, 899, 273, 30879, 72, 2115, 899, 1435, 225, 450, 564, 273, 9755, 2115, 899, 18, 588, 9459, 682, 1435, 225, 2037, 273, 813, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 774, 2115, 13332, 1950, 67, 4172, 273, 599, 9755, 2115, 899, 273, 30879, 72, 2115, 899, 1435, 225, 450, 564, 273, 9755, 2115, 899, 18, 588, 9459, 682, 1435, 225, 2037, 273, 813, 1...
for ca in ca_info: self.enzyme_record.CA.append(ca[2:].strip())
self.enzyme_record.CA = string.join([self.enzyme_record.CA,ca_info[2:].strip()],'')
def catalytic_activity(self, ca_info): for ca in ca_info: self.enzyme_record.CA.append(ca[2:].strip())
34aea942e95a30dff9ff864abe0f09eb6b8b5849 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/34aea942e95a30dff9ff864abe0f09eb6b8b5849/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 3145, 93, 88, 335, 67, 9653, 12, 2890, 16, 3474, 67, 1376, 4672, 364, 3474, 316, 3474, 67, 1376, 30, 365, 18, 275, 94, 2942, 73, 67, 3366, 18, 3587, 18, 6923, 12, 5353, 63, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 3145, 93, 88, 335, 67, 9653, 12, 2890, 16, 3474, 67, 1376, 4672, 364, 3474, 316, 3474, 67, 1376, 30, 365, 18, 275, 94, 2942, 73, 67, 3366, 18, 3587, 18, 6923, 12, 5353, 63, 22...
if not self.literal_block:
if self.literal_block or self.literal: pass else:
def encode(self, text): """ Encode special characters in `text` & return. # $ % & ~ _ ^ \ { } Escaping with a backslash does not help with backslashes, ~ and ^.
c045734350487e7f8b5a345ef15bf977ebd4a889 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/c045734350487e7f8b5a345ef15bf977ebd4a889/latex2e.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 6240, 4582, 3949, 316, 1375, 955, 68, 473, 327, 18, 468, 271, 738, 473, 4871, 389, 3602, 521, 288, 289, 512, 1017, 24447, 598, 279, 23253, 1552, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 12, 2890, 16, 977, 4672, 3536, 6240, 4582, 3949, 316, 1375, 955, 68, 473, 327, 18, 468, 271, 738, 473, 4871, 389, 3602, 521, 288, 289, 512, 1017, 24447, 598, 279, 23253, 1552, 48...
CopyFile(plugindir + "nppanda3d.dmg", plugfile)
CopyFile(plugindir + os.path.basename(plugfile), plugfile)
def MakeRuntime(): # Delete the current. if (os.path.exists(GetOutputDir()+"/stage")): shutil.rmtree(GetOutputDir()+"/stage") if (os.path.exists(GetOutputDir()+"/rlib")): shutil.rmtree(GetOutputDir()+"/rlib") # Create a couple of directories. coreapidir = GetOutputDir()+"/stage/coreapi/"+RUNTIME_PLATFORM+"/"+RUNTIME_VERSION+"/" plugindir = GetOutputDir()+"/stage/plugin/"+RUNTIME_PLATFORM+"/"+RUNTIME_VERSION+"/" MakeDirectory(GetOutputDir()+"/rlib") MakeDirectory(GetOutputDir()+"/stage") MakeDirectory(GetOutputDir()+"/stage/coreapi") MakeDirectory(GetOutputDir()+"/stage/coreapi/"+RUNTIME_PLATFORM) MakeDirectory(GetOutputDir()+"/stage/plugin") MakeDirectory(GetOutputDir()+"/stage/plugin/"+RUNTIME_PLATFORM) MakeDirectory(coreapidir); MakeDirectory(plugindir) # Copy the p3d_plugin file to coreapi dir and the plugin to the plugin dir. plugfile = CalcLocation("p3d_plugin.dll", None) CopyFile(coreapidir + os.path.basename(plugfile), plugfile) if (sys.platform == "darwin"): plugfile = CalcLocation("nppanda3d.plugin", None) if (os.path.isdir(GetOutputDir()+"/tmp/bundle")): oscmd("rm -rf %s" % BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) MakeDirectory(GetOutputDir()+"/tmp/bundle") CopyTree(GetOutputDir()+"/tmp/bundle/nppanda3d.plugin", plugfile) if (os.path.exists(GetOutputDir()+"/plugins/nppanda3d.dmg")): oscmd("rm -rf " + BracketNameWithQuotes(GetOutputDir()+"/plugins/nppanda3d.dmg")) oscmd("hdiutil create -fs HFS+ -srcfolder %s -volname nppanda3d %s" % (GetOutputDir()+"/tmp/bundle", GetOutputDir()+"/plugins/nppanda3d.dmg")) CopyFile(plugindir + os.path.basename(plugfile), GetOutputDir()+"/plugins/nppanda3d.dmg") oscmd("rm -rf " + BracketNameWithQuotes(GetOutputDir()+"/tmp/bundle")) else: plugfile = CalcLocation("nppanda3d.dll", None) CopyFile(plugindir + "nppanda3d.dmg", plugfile) # Copy the important libraries to built/rlib/. CopyFile(GetOutputDir()+"/rlib/Config.prc", GetOutputDir()+"/etc/Config.prc") plugfile = CalcLocation("p3dpython.exe", None) CopyFile(GetOutputDir()+"/rlib/"+os.path.basename(plugfile), plugfile) plugfile = CalcLocation("runp3d_frozen.pyd", None) CopyFile(GetOutputDir()+"/rlib/"+os.path.basename(plugfile), plugfile) if (sys.platform.startswith("win")): for base in os.listdir(GetOutputDir()+"/bin"): if (base.endswith(".dll")): omit = False for romit in RUNTIME_OMIT: if fnmatch.fnmatch(base, romit): omit = True if omit: continue CopyFile(GetOutputDir()+"/rlib/"+base, GetOutputDir()+"/bin/"+base) else: for base in os.listdir(GetOutputDir()+"/lib"): if (base.startswith("lib")) and (base.endswith(".so") or base.endswith(".dylib")): omit = False for romit in RUNTIME_OMIT: if fnmatch.fnmatch(base, romit): omit = True if omit: continue CopyFile(GetOutputDir()+"/rlib/"+base, GetOutputDir()+"/lib/"+base) if (sys.platform == "darwin"): oscmd("strip "+GetOutputDir()+"/rlib/"+base) else: oscmd("strip --strip-all "+GetOutputDir()+"/rlib/"+base) # Invoke the make_package and make_contents scripts. command = SDK["PYTHONEXEC"] + " direct/src/plugin/make_package.py" command += " -d \"" + GetOutputDir() + "/stage\"" command += " -s \"" + GetOutputDir() + "/rlib\"" command += " -p panda3d_%s_%s" % (RUNTIME_PLATFORM, RUNTIME_VERSION) oscmd(command) command = SDK["PYTHONEXEC"] + " direct/src/plugin/make_contents.py" command += " -d \"" + GetOutputDir() + "/stage\"" oscmd(command) # Tar the whole thing. if (not sys.platform.startswith("win")): if (os.path.exists("runtime_%s_%s.tar.bz2" % (RUNTIME_PLATFORM, RUNTIME_VERSION))): os.remove("runtime_%s_%s.tar.bz2" % (RUNTIME_PLATFORM, RUNTIME_VERSION)) oscmd("cd " + GetOutputDir() + "/stage/ && tar -cjvf " + os.getcwd() + ("/runtime_%s_%s.tar.bz2 coreapi panda3d plugin" % (RUNTIME_PLATFORM, RUNTIME_VERSION)))
5f119ddd28f300822f72eb6b3a36d2d969cd7f1e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/5f119ddd28f300822f72eb6b3a36d2d969cd7f1e/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 5576, 13332, 468, 2504, 326, 783, 18, 309, 261, 538, 18, 803, 18, 1808, 12, 967, 1447, 1621, 1435, 9078, 19, 12869, 6, 3719, 30, 11060, 18, 86, 17371, 12, 967, 1447, 1621, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 5576, 13332, 468, 2504, 326, 783, 18, 309, 261, 538, 18, 803, 18, 1808, 12, 967, 1447, 1621, 1435, 9078, 19, 12869, 6, 3719, 30, 11060, 18, 86, 17371, 12, 967, 1447, 1621, 1435, ...
def __init__(self, message): self.message = message
def __init__(self, msg): self.msg = msg
def __init__(self, message): self.message = message
b5027f778753355f1d9ebf8cb4725d6056a3f0a3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11479/b5027f778753355f1d9ebf8cb4725d6056a3f0a3/NodeSet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 365, 18, 2150, 273, 883, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 883, 4672, 365, 18, 2150, 273, 883, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
def __init__(self):
def __init__(self, host='game.eternal-lands.com', port=2001): self.host = host self.port = port self.LOG_IN_OK = False
def __init__(self): self.__setup() pass
e9336a953df9a043de95a448a1f396dd28003dde /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5162/e9336a953df9a043de95a448a1f396dd28003dde/login.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1479, 2218, 13957, 18, 847, 82, 287, 17, 80, 5708, 18, 832, 2187, 1756, 33, 6976, 21, 4672, 365, 18, 2564, 273, 1479, 365, 18, 655, 273, 1756, 365, 18,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1479, 2218, 13957, 18, 847, 82, 287, 17, 80, 5708, 18, 832, 2187, 1756, 33, 6976, 21, 4672, 365, 18, 2564, 273, 1479, 365, 18, 655, 273, 1756, 365, 18,...
timestamp = "%s-%s-%sT%s:%s:%sZ" % (b[0:4], b[4:6], b[6:8], b[8:10], b[10:12], b[12:14])
timestamp = imageData[1]
def checkbot(): """ Main function """ # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? waitTime = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator duplicatesActive = False # Use the duplicate option duplicatesReport = False # Use the duplicate-report option sendemailActive = False # Use the send-email logFullError = True # Raise an error when the log is full # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many files do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-nologerror': logFullError = False elif arg == '-commons': commonsActive = True elif arg.startswith('-duplicates'): duplicatesActive = True if len(arg) == 11: duplicates_rollback = 1 elif len(arg) > 11: duplicates_rollback = int(arg[12:]) elif arg == '-duplicatereport': duplicatesReport = True elif arg == '-sendemail': sendemailActive = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many files do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True waitTime = int(wikipedia.input(u'How many time do you want to wait before checking the files?')) elif len(arg) > 5: wait = True waitTime = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = wikipedia.input(u'From witch page do you want to start?') elif len(arg) > 6: firstPageTitle = arg[7:] firstPageTitle = firstPageTitle.split(":")[1:] generator = wikipedia.getSite().allpages(start=firstPageTitle, namespace=6) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-ref'): if len(arg) == 4: refName = str(wikipedia.input(u'The references of what page should I parse?')) elif len(arg) > 4: refName = str(arg[5:]) generator = pagegenerators.ReferringPageGenerator(wikipedia.Page(wikipedia.getSite(), refName)) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # Block of text to translate the parameters set above. image_old_namespace = u"%s:" % site.image_namespace() image_namespace = u"File:" # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if waitTime == 0: wait = False # A little block-statement to ensure that the bot will not start with en-parameters if site.lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") return # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site, sendemailActive = sendemailActive, duplicatesReport = duplicatesReport, logFullError = logFullError) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged, limit) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = site.newimages(number = limit) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = site.getUrl(regexPageUrl, no_hostname = True) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % pageRegex.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. # Take the additional settings for the Project mainClass.takesettings() # Not the main, but the most important loop. #parsed = False if wait: # Let's sleep... generator = mainClass.wait(waitTime, generator, normal, limit) for image in generator: # When you've a lot of image to skip before working use this workaround, otherwise # let this commented, thanks. [ decoment also parsed = False if you want to use it # #if image.title() != u'File:Nytlogo379x64.gif' and not parsed: # wikipedia.output(u"%s already parsed." % image.title()) # continue #else: # parsed = True # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ image_old_namespace.lower() not in image.title().lower() and 'file:' not in image.title().lower(): wikipedia.output(u'%s seems not an file, skip it...' % image.title()) continue if normal: imageData = image image = imageData[0] #20100511133318L --- 15:33, 11 mag 2010 e 18 sec b = str(imageData[1]) # use b as variable to make smaller the timestamp-formula used below.. # fixing the timestamp to the format that we normally use.. timestamp = "%s-%s-%sT%s:%s:%sZ" % (b[0:4], b[4:6], b[6:8], b[8:10], b[10:12], b[12:14]) uploader = imageData[2] comment = imageData[3] # useless, in reality.. else: timestamp = None uploader = None comment = None # useless, also this, let it here for further developments try: imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) except IndexError:# Namespace image not found, that's not an image! Let's skip... try: imageName = image.title().split(image_old_namespace)[1] except IndexError: wikipedia.output(u"%s is not a file, skipping..." % image.title()) continue mainClass.setParameters(imageName, timestamp, uploader) # Setting the image for the main class # Skip block if skip == True: skip = mainClass.skipImages(skip_number, limit) if skip == True: continue # Check on commons if there's already an image with the same name if commonsActive == True and site.family.name != "commons": response = mainClass.checkImageOnCommons() if response == False: continue # Check if there are duplicates of the image on the project selected if duplicatesActive == True: response2 = mainClass.checkImageDuplicated(duplicates_rollback) if response2 == False: continue resultCheck = mainClass.checkStep() if resultCheck: continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) else: wikipedia.output(u"\t\t\t>> STOP! <<") break # Exit
718c26e440835e890aeb9eccc86467e322fe9cd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/718c26e440835e890aeb9eccc86467e322fe9cd3/checkimages.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 4819, 13332, 3536, 12740, 445, 3536, 468, 3498, 980, 14593, 1472, 7666, 273, 1053, 468, 20709, 1839, 7999, 866, 777, 326, 4602, 35, 1800, 273, 8958, 468, 9017, 4906, 4602, 866, 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, 866, 4819, 13332, 3536, 12740, 445, 3536, 468, 3498, 980, 14593, 1472, 7666, 273, 1053, 468, 20709, 1839, 7999, 866, 777, 326, 4602, 35, 1800, 273, 8958, 468, 9017, 4906, 4602, 866, 35, ...
return inclusive
elif n.startswith('xmlns:'): unused_namespace_dict[n] = attr.value return inclusive, unused_namespace_dict
def _inclusiveNamespacePrefixes(node, context, unsuppressedPrefixes): '''http://www.w3.org/TR/xml-exc-c14n/ InclusiveNamespaces PrefixList parameter, which lists namespace prefixes that are handled in the manner described by the Canonical XML Recommendation''' inclusive = [] if node.prefix: usedPrefixes = ['xmlns:%s' %node.prefix] else: usedPrefixes = ['xmlns'] for a in _attrs(node): if a.nodeName.startswith('xmlns') or not a.prefix: continue usedPrefixes.append('xmlns:%s' %a.prefix) for attr in context: n = attr.nodeName if n in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns:') and n[6:] in unsuppressedPrefixes: inclusive.append(attr) elif n.startswith('xmlns') and n[5:] in unsuppressedPrefixes: inclusive.append(attr) elif attr.nodeName in usedPrefixes: inclusive.append(attr) return inclusive
c0147db0b9b6607aa24507cb068c88c1f611cec5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/c0147db0b9b6607aa24507cb068c88c1f611cec5/c14n.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 267, 9173, 3402, 11700, 12, 2159, 16, 819, 16, 640, 2859, 10906, 11700, 4672, 9163, 2505, 2207, 5591, 18, 91, 23, 18, 3341, 19, 4349, 19, 2902, 17, 10075, 17, 71, 3461, 82, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 267, 9173, 3402, 11700, 12, 2159, 16, 819, 16, 640, 2859, 10906, 11700, 4672, 9163, 2505, 2207, 5591, 18, 91, 23, 18, 3341, 19, 4349, 19, 2902, 17, 10075, 17, 71, 3461, 82, 19, ...
def getBondLength(self, isBondLength):
def getBondLength(self, isBondLength, atomDistPrecision):
def getBondLength(self, isBondLength): '''returns the atom center distance between the atoms connected by the highlighted bond. Note that this does *not* return the covalent bondlength''' from VQT import vlen glpane = self.glpane if isBondLength: a1 = glpane.selobj.atom1 a2 = glpane.selobj.atom2
1c8387d0b036edd275a4e706a0e6dcc393ab92fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/1c8387d0b036edd275a4e706a0e6dcc393ab92fa/DynamicTip.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29585, 1782, 12, 2890, 16, 353, 9807, 1782, 16, 3179, 5133, 15410, 4672, 9163, 6154, 326, 3179, 4617, 3888, 3086, 326, 9006, 5840, 635, 326, 24375, 8427, 18, 3609, 716, 333, 1552, 380, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29585, 1782, 12, 2890, 16, 353, 9807, 1782, 16, 3179, 5133, 15410, 4672, 9163, 6154, 326, 3179, 4617, 3888, 3086, 326, 9006, 5840, 635, 326, 24375, 8427, 18, 3609, 716, 333, 1552, 380, 9...
if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous')
m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0)
def matrix(arg0=None, arg1=None, arg2=None, arg3=None, sparse=None): """ Create a matrix. INPUT: Supported formats 1. matrix([sparse=True]): the 0x0 matrix over ZZ 2. matrix(list_of_rows, [sparse=True]): matrix with each row constructed from the list_of_rows 3. matrix(nrows, entries, [sparse=True]): matrix with given number of rows and flat list of entries 4. matrix(nrows, ncols, entries, [sparse=True]): matrix with given number of rows and columns with flat list of entries 5. matrix(ring, list_of_row, [sparse=True]): matrix over ring with rows the elements of the list_of_rows 6. matrix(ring, nrows, entries, [sparse=True]): matrix over ring with given number of rows and entries from the flat list 7. matrix(ring, nrows, ncols, entries, [sparse=True]): matrix over the given ring with given number of rows and columns and entries. 8. matrix(numpy_array) The sparse option is optional, must be explicitly named (i.e., sparse=True), and may be either True or False. The entries can instead be a dictionary of key:value pairs of the form (i,j):x, where i,j are integers instead of a list. If sparse is not specified and the entries are a dictionary, it default to True. OUTPUT: a matrix EXAMPLES: 1. The degenerate matrix input format: sage: m = matrix(); m [] sage: parent(m) Full MatrixSpace of 0 by 0 dense matrices over Integer Ring sage: m = matrix(sparse=True); m [] sage: parent(m) Full MatrixSpace of 0 by 0 sparse matrices over Integer Ring 2. The "matrix(list_of_rows, [sparse])" input format. Notice that SAGE is careful to find a sensible common ring for all the entries (using the Sequence object): sage: x = polygen(QQ) sage: m = matrix([[1/3,2+x],[3,4]]); m [ 1/3 x + 2] [ 3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Rational Field sage: m = matrix([[1,2],[3,4/7]]); m [ 1 2] [ 3 4/7] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix([[1,2,3], [RDF(2), CDF(1,2), 3]]); m [ 1.0 2.0 3.0] [ 2.0 1.0 + 2.0*I 3.0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Complex Double Field sage: V = GF(7)^2 sage: m = matrix([V.0, V.0+2*V.1], sparse=True); m [1 0] [1 2] sage: parent(m) Full MatrixSpace of 2 by 2 sparse matrices over Finite Field of size 7 3. matrix(nrows, entries, [sparse]): sage: matrix(2,[1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The number of rows must divide the number of entries. sage: matrix(5,[1,2,3, 4,5,6]) Traceback (most recent call last): ... TypeError: entries has the wrong length 4. matrix(nrows, ncols, entries, [sparse]): sage: matrix(2,3, [1,2,3, 4,5,6]) [1 2 3] [4 5 6] sage: matrix(3,2, [1,2, 3/4, 5/6, 7*x, 8*x]) [ 1 2] [3/4 5/6] [7*x 8*x] The length of the entry list must be the same as the number of rows times columns. sage: matrix(3,3, [1,2, 3/4, 5/6, 7*x, 8*x]) Traceback (most recent call last): ... TypeError: entries has the wrong length 5. matrix(ring, list_of_row, [sparse]): sage: m = matrix(QQ, [[1,2], [3,4]]); m [1 2] [3 4] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field sage: m = matrix(GF(7), [[1/3,2/3,1/2], [3/4,4/5,7]]); m [5 3 4] [6 5 0] sage: parent(m) Full MatrixSpace of 2 by 3 dense matrices over Finite Field of size 7 6. matrix(ring, nrows, entries, [sparse]): sage: M = ZZ^4 sage: m = matrix(QQ, [M([1,2,3,4]), M([-1,0,3,4])]); m [ 1 2 3 4] [-1 0 3 4] sage: parent(m) Full MatrixSpace of 2 by 4 dense matrices over Rational Field 7. matrix(ring, nrows, ncols, entries, [sparse]) sage: matrix(QQ, 2, 2, [1,2,3,4]) [1 2] [3 4] sage: matrix(GF(5), 2, 3, range(6)) [0 1 2] [3 4 0] sage: matrix(ZZ, 10, 10, range(100)).parent() Full MatrixSpace of 10 by 10 dense matrices over Integer Ring sage: matrix(ZZ, 10, 10, range(100), sparse=True).parent() Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring sage: R = PolynomialRing(QQ, 9, 'x') sage: A = matrix(R, 3, 3, R.gens()); A [x0 x1 x2] [x3 x4 x5] [x6 x7 x8] sage: det(A) -x2*x4*x6 + x1*x5*x6 + x2*x3*x7 - x0*x5*x7 - x1*x3*x8 + x0*x4*x8 CREATING SPARSE MATRICES FROM DICTS: sage: a = matrix({(1,2):10, (2,3):5/1}) sage: print a, a.parent() [ 0 0 0 0] [ 0 0 10 0] [ 0 0 0 5] Full MatrixSpace of 3 by 4 sparse matrices over Rational Field sage: a = matrix({(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] True sage: a = matrix(3,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(3,5,{(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0] [ 0 0 10] [ 0 0 0] True sage: a = matrix(QQ, 3, 5, {(1,2):10}, sparse=True) sage: print a, a.is_sparse() [ 0 0 0 0 0] [ 0 0 10 0 0] [ 0 0 0 0 0] True 8. Creating a matrix from a numpy array Any numpy array with a datatype of float or complex may be passed to matrix If the data type is float the result will be a matrix over the real double field. complex numpy arrays will give matrices over the complex double field. The data of the numpy array must be contiguous, so slices of other matrices will raise an exception. sage: import numpy sage: n=numpy.array([[1,2],[3,4]],float) sage: m=matrix(n) sage: n=numpy.array([[numpy.complex(0,1),numpy.complex(0,2)],[3,4]],complex) sage: m=matrix(n) TESTS: sage: import numpy sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float32') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'float64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex64') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = numpy.array([[1,2,3],[4,5,6],[7,8,9]],'complex128') sage: matrix(a) [1.0 2.0 3.0] [4.0 5.0 6.0] [7.0 8.0 9.0] sage: a = matrix([[1,2],[3,4]]) sage: b = matrix(a.numpy()); b [1 2] [3 4] sage: a == b True sage: c = matrix(a.numpy('float32')); c [1.0 2.0] [3.0 4.0] """ if hasattr(arg0, '_matrix_'): if arg1 is None: arg1 = rings.ZZ return arg0._matrix_(arg1) if hasattr(arg1, '_matrix_'): return arg1._matrix_(arg0) if arg0 is None: # 1. matrix([sparse]): # the 0x0 matrix over ZZ # the degenerate matrix ring = rings.ZZ nrows = 0 ncols = 0 entries = [] elif isinstance(arg0, (list, tuple)): # 2. matrix(list_of_rows, [sparse]): # matrix with each row constructed from the list_of_rows # list of rows if not (arg1 is None and arg2 is None and arg3 is None): raise TypeError, "invalid input" nrows = len(arg0) if nrows == 0: ncols = 0 else: ncols = len(arg0[0]) w = sum([list(v) for v in arg0], []) entries, ring = prepare(w) elif isinstance(arg0, dict): # 2. matrix(dict_of_rows, sparse=True): if sparse is None: sparse = True entries, ring = prepare_dict(arg0) nrows = nrows_from_dict(entries) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, [sparse]): # matrix with given number of rows and flat list of entries nrows = int(arg0) entries, ring = prepare(arg1) ncols = len(entries) // nrows elif not rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 3. matrix(nrows, entries, sparse=True): # matrix with given number of rows and sparse dict of entries if sparse is None: sparse = True nrows = int(arg0) entries, ring = prepare_dict(arg1) ncols = ncols_from_dict(entries) elif not rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 4. matrix(nrows, ncols, entries, [sparse]): # matrix with given number of rows and columns with flat list of entries nrows = int(arg0) ncols = int(arg1) entries, ring = prepare(arg2) elif not rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 4. matrix(nrows, ncols, entries, sparse=True): # matrix with given number of rows and columns with flat list of entries if sparse is None: sparse = True nrows = int(arg0) ncols = int(arg1) entries, ring = prepare_dict(arg2) elif rings.is_Ring(arg0) and isinstance(arg1, (list, tuple)) and arg2 is None and arg3 is None: # 5. matrix(ring, list_of_row, [sparse]): # matrix over ring with rows the elements of the list_of_rows ring = arg0 nrows = len(arg1) if nrows == 0: ncols = 0 else: try: ncols = len(arg1[0]) except TypeError: raise TypeError, "If making a matrix with the matrix(ring, list_of_row, [sparse]) constructor, the second input must be a list of rows." entries = sum([list(v) for v in arg1], []) elif rings.is_Ring(arg0) and isinstance(arg1, dict) and arg2 is None and arg3 is None: # 5. matrix(ring, dict, sparse=True): # matrix over ring with rows the elements the dict if sparse is None: sparse = True ring = arg0 entries = arg1 nrows = nrows_from_dict(entries) elif rings.is_Ring(arg0) and isinstance(arg2, (list, tuple)) and arg3 is None: # 6. matrix(ring, nrows, entries, [sparse]): # matrix over ring with given number of rows and entries from the flat list ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = len(entries) // nrows elif rings.is_Ring(arg0) and isinstance(arg2, dict) and arg3 is None: # 6. matrix(ring, nrows, entries, sparse=True) # matrix over ring with given number of rows and entries from the dict if sparse is None: sparse = True ring = arg0 nrows = int(arg1) entries = arg2 if nrows == 0: ncols = 0 else: ncols = ncols_from_dict(entries) elif rings.is_Ring(arg0): # 7. matrix(ring, nrows, ncols, entries, [sparse]): # matrix over the given ring with given number of rows and columns and entries. ring = arg0 nrows = int(arg1) if arg2 is None: ncols = nrows else: ncols = int(arg2) entries = arg3 if isinstance(entries, dict): if sparse is None: sparse = True else: import numpy if isinstance(arg0,numpy.ndarray): str_dtype = str(arg0.dtype) if str_dtype.count('float32')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('float64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(RDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex64')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy32(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('complex128')==1: if arg0.flags.c_contiguous==True or arg0.flags.f_contiguous==True: m=matrix(CDF,arg0.shape[0],arg0.shape[1],0) m._replace_self_with_numpy(arg0) if arg0.flags.c_contiguous: return m else: return m.transpose() else: raise TypeError('numpy matrix must be either c_contiguous or f_contiguous') elif str_dtype.count('object') == 1: #Get the raw nested list from the numpy array #and feed it back into matrix try: return matrix( map(list, list(arg0)) ) except TypeError: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError("cannot convert numpy matrix to SAGE matrix") else: raise TypeError, "unknown matrix constructor format. Type matrix? for help" if sparse is None: sparse = False return matrix_space.MatrixSpace(ring, nrows, ncols, sparse=sparse)(entries)
aee2e5ab4b0be97a6e29e4a927f71363c9a070ed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/aee2e5ab4b0be97a6e29e4a927f71363c9a070ed/constructor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3148, 12, 3175, 20, 33, 7036, 16, 1501, 21, 33, 7036, 16, 1501, 22, 33, 7036, 16, 1501, 23, 33, 7036, 16, 9387, 33, 7036, 4672, 3536, 1788, 279, 3148, 18, 225, 12943, 30, 19503, 6449...
query['sort_on'] = sort_index query['sort_order'] = self.sort_order
if self.sort_withcatalog : query['sort_on'] = sort_index query['sort_order'] = self.sort_order
def finderQuery(self) : """ return query for results depending on some params """ request = self.request if self.query : return self.query elif self.typeview == 'selection': return {'uid' : self.blacklist} elif self.displaywithoutquery or self.searchsubmit : query = {} path = {} if not self.searchsubmit : path['depth'] = 1 path['query'] = self.browsedpath query['path'] = path sort_index = self.sort_on query['sort_on'] = sort_index query['sort_order'] = self.sort_order if self.types : query['portal_type'] = self.types if self.searchsubmit : # TODO : use a dynamic form with different possible searchform fields q = request.get('SearchableText', '') if q : for char in '?-+*': q = q.replace(char, ' ') r=q.split() r = " AND ".join(r) searchterms = _quote_bad_chars(r)+'*' query['SearchableText'] = searchterms #query = {'path': {'query': '/cktest', 'depth': 2}, 'sort_on': 'getObjPositionInParent'} return query
5e1bd0b8474637a44e6095e689d013db886351d2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9052/5e1bd0b8474637a44e6095e689d013db886351d2/finder.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7532, 1138, 12, 2890, 13, 294, 3536, 327, 843, 364, 1686, 8353, 603, 2690, 859, 3536, 225, 590, 273, 365, 18, 2293, 309, 365, 18, 2271, 294, 327, 365, 18, 2271, 1327, 365, 18, 723, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7532, 1138, 12, 2890, 13, 294, 3536, 327, 843, 364, 1686, 8353, 603, 2690, 859, 3536, 225, 590, 273, 365, 18, 2293, 309, 365, 18, 2271, 294, 327, 365, 18, 2271, 1327, 365, 18, 723, 1...
this = apply(_quickfix.new_ListExecInstType, args)
this = _quickfix.new_ListExecInstType(*args)
def __init__(self, *args): this = apply(_quickfix.new_ListExecInstType, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 682, 1905, 10773, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 682, 1905, 10773, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, ...
self.assertEqual(func, os.remove) self.assertEqual(arg, self.childpath)
if func is os.remove: self.assertEqual(arg, self.childpath) else: self.assertIs(func, os.listdir, "func must be either os.remove or os.listdir") self.assertEqual(arg, TESTFN)
def check_args_to_onerror(self, func, arg, exc): if self.errorState == 0: self.assertEqual(func, os.remove) self.assertEqual(arg, self.childpath) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 1 else: self.assertEqual(func, os.rmdir) self.assertEqual(arg, TESTFN) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 2
19e9ae5a8d3a0990ca4d6116a4b1a9ef4656e03b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/19e9ae5a8d3a0990ca4d6116a4b1a9ef4656e03b/test_shutil.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1968, 67, 869, 67, 265, 1636, 12, 2890, 16, 1326, 16, 1501, 16, 3533, 4672, 309, 365, 18, 1636, 1119, 422, 374, 30, 309, 1326, 353, 1140, 18, 4479, 30, 365, 18, 11231, 5812,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 1968, 67, 869, 67, 265, 1636, 12, 2890, 16, 1326, 16, 1501, 16, 3533, 4672, 309, 365, 18, 1636, 1119, 422, 374, 30, 309, 1326, 353, 1140, 18, 4479, 30, 365, 18, 11231, 5812,...
pkgdir = os.path.join(data.expand('${SVNDIR}', localdata), pkg)
relpath = ud.path if relpath.startswith('/'): relpath = relpath[1:] pkgdir = os.path.join(data.expand('${SVNDIR}', d), ud.host, relpath)
def go(self, loc, ud, d): """Fetch url"""
8f7194038c3bd45794988096b5a295417ce36b89 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2672/8f7194038c3bd45794988096b5a295417ce36b89/svn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1960, 12, 2890, 16, 1515, 16, 23969, 16, 302, 4672, 3536, 5005, 880, 8395, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1960, 12, 2890, 16, 1515, 16, 23969, 16, 302, 4672, 3536, 5005, 880, 8395, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if not os.path.isfile(os.path.join(MEDIA_ROOT, version_path)):
if not os.path.isfile(smart_str(os.path.join(MEDIA_ROOT, version_path))):
def render(self, context): try: source = self.src.resolve(context) except VariableDoesNotExist: return None if self.version_prefix: version_prefix = self.version_prefix else: try: version_prefix = self.version_prefix_var.resolve(context) except VariableDoesNotExist: return None try: source = force_unicode(source) version_path = get_version_path(url_to_path(source), version_prefix) if not os.path.isfile(os.path.join(MEDIA_ROOT, version_path)): # create version version_path = version_generator(url_to_path(source), version_prefix) elif os.path.getmtime(os.path.join(MEDIA_ROOT, url_to_path(source))) > os.path.getmtime(os.path.join(MEDIA_ROOT, version_path)): # recreate version if original image was updated version_path = version_generator(url_to_path(source), version_prefix, force=True) context[self.var_name] = FileObject(version_path) except: context[self.var_name] = "" return ''
ba75c7397ad347fe99b5ef5c98fe29e360e77cc1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12975/ba75c7397ad347fe99b5ef5c98fe29e360e77cc1/fb_versions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 819, 4672, 775, 30, 1084, 273, 365, 18, 4816, 18, 10828, 12, 2472, 13, 1335, 7110, 15264, 30, 327, 599, 309, 365, 18, 1589, 67, 3239, 30, 1177, 67, 3239, 273, 365...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 819, 4672, 775, 30, 1084, 273, 365, 18, 4816, 18, 10828, 12, 2472, 13, 1335, 7110, 15264, 30, 327, 599, 309, 365, 18, 1589, 67, 3239, 30, 1177, 67, 3239, 273, 365...
RoutesContext = DefaultRoutesContext deprecated('RoutesContext', "('from repoze.bfg.urldispatch import RoutesContext' is now " "deprecated; instead use 'from repoze.bfg.urldispatch import " "DefaultRoutesContext')", )
def __init__(self, **kw): self.__dict__.update(kw)
fab47b47407306d893f43517c322e724612c834f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14321/fab47b47407306d893f43517c322e724612c834f/urldispatch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2826, 9987, 4672, 365, 16186, 1576, 25648, 2725, 12, 9987, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2826, 9987, 4672, 365, 16186, 1576, 25648, 2725, 12, 9987, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
librsync.librsyncError, C.UnknownFileTypeError
librsync.librsyncError, C.UnknownFileTypeError,
def catch_error(exc): """Return true if exception exc should be caught""" for exception_class in (rpath.SkipFileException, rpath.RPathException, librsync.librsyncError, C.UnknownFileTypeError zlib.error): if isinstance(exc, exception_class): return 1 if (isinstance(exc, EnvironmentError) and # the invalid mode shows up in backups of /proc for some reason (exc[0] in ('invalid mode: rb', 'Not a gzipped file') or errno.errorcode.has_key(exc[0]) and errno.errorcode[exc[0]] in ('EPERM', 'ENOENT', 'EACCES', 'EBUSY', 'EEXIST', 'ENOTDIR', 'EILSEQ', 'ENAMETOOLONG', 'EINTR', 'ESTALE', 'ENOTEMPTY', 'EIO', 'ETXTBSY', 'ESRCH', 'EINVAL', 'EDEADLOCK', 'EDEADLK', 'EOPNOTSUPP', 'ETIMEDOUT'))): return 1 return 0
5daf429621ec601a2365f2406850227935d0801f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/783/5daf429621ec601a2365f2406850227935d0801f/robust.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1044, 67, 1636, 12, 10075, 4672, 3536, 990, 638, 309, 1520, 3533, 1410, 506, 13537, 8395, 364, 1520, 67, 1106, 316, 261, 86, 803, 18, 6368, 812, 503, 16, 436, 803, 18, 54, 743, 503, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1044, 67, 1636, 12, 10075, 4672, 3536, 990, 638, 309, 1520, 3533, 1410, 506, 13537, 8395, 364, 1520, 67, 1106, 316, 261, 86, 803, 18, 6368, 812, 503, 16, 436, 803, 18, 54, 743, 503, ...
def __createRawCursor__(self):
def __createRawCursor__():
def __createRawCursor__(self): """ A method that is only used for testing. It return a cursor object to the database currently open. """ return self.db.cursor()
756890fb4599378e90ea67f0294b07d61cdb0e9b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/756890fb4599378e90ea67f0294b07d61cdb0e9b/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2640, 4809, 6688, 972, 13332, 3536, 432, 707, 716, 353, 1338, 1399, 364, 7769, 18, 225, 2597, 327, 279, 3347, 733, 358, 326, 2063, 4551, 1696, 18, 3536, 327, 365, 18, 1966, 18, 9...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2640, 4809, 6688, 972, 13332, 3536, 432, 707, 716, 353, 1338, 1399, 364, 7769, 18, 225, 2597, 327, 279, 3347, 733, 358, 326, 2063, 4551, 1696, 18, 3536, 327, 365, 18, 1966, 18, 9...
for p in patches),
for p in reversed(patches)),
def __build_cover(tmpl, patches, msg_id, options): """Build the cover message (series description) to be sent via SMTP """ sender = __get_sender() if options.version: version_str = ' %s' % options.version else: version_str = '' if options.prefix: prefix_str = options.prefix + ' ' else: confprefix = config.get('stgit.mail.prefix') if confprefix: prefix_str = confprefix + ' ' else: prefix_str = '' total_nr_str = str(len(patches)) patch_nr_str = '0'.zfill(len(total_nr_str)) if len(patches) > 1: number_str = ' %s/%s' % (patch_nr_str, total_nr_str) else: number_str = '' tmpl_dict = {'sender': sender, # for backward template compatibility 'maintainer': sender, # for backward template compatibility 'endofheaders': '', # for backward template compatibility 'date': '', 'version': version_str, 'prefix': prefix_str, 'patchnr': patch_nr_str, 'totalnr': total_nr_str, 'number': number_str, 'shortlog': stack.shortlog(crt_series.get_patch(p) for p in patches), 'diffstat': gitlib.diffstat(git.diff( rev1 = git_id(crt_series, '%s^' % patches[0]), rev2 = git_id(crt_series, '%s' % patches[-1]), diff_flags = options.diff_flags))} try: msg_string = tmpl % tmpl_dict except KeyError, err: raise CmdException, 'Unknown patch template variable: %s' \ % err except TypeError: raise CmdException, 'Only "%(name)s" variables are ' \ 'supported in the patch template' if options.edit_cover: msg_string = __edit_message(msg_string) # The Python email message try: msg = email.message_from_string(msg_string) except Exception, ex: raise CmdException, 'template parsing error: %s' % str(ex) __build_address_headers(msg, options) __build_extra_headers(msg, msg_id, options.refid) __encode_message(msg) return msg
c9379a15770a699c0d64ae0897ea1a8e235a2c71 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12366/c9379a15770a699c0d64ae0897ea1a8e235a2c71/mail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3510, 67, 3165, 12, 24717, 16, 16482, 16, 1234, 67, 350, 16, 702, 4672, 3536, 3116, 326, 5590, 883, 261, 10222, 2477, 13, 358, 506, 3271, 3970, 18102, 3536, 5793, 273, 1001, 588, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 3510, 67, 3165, 12, 24717, 16, 16482, 16, 1234, 67, 350, 16, 702, 4672, 3536, 3116, 326, 5590, 883, 261, 10222, 2477, 13, 358, 506, 3271, 3970, 18102, 3536, 5793, 273, 1001, 588, ...
try: pid = int(codecs.open( os.path.join(getConfig()['global']['workingDir'], getConfig()['global']['daemonInfo']), 'w', 'utf-8').read())
try: pid = int(codecs.open( os.path.join(getConfig()['global']['workingDir'], getConfig()['global']['daemonInfo']), 'r', 'utf-8').read())
def _main(arglist): signal.signal(signal.SIGINT, signalHandler) try: (argp, rest) = getopt.gnu_getopt(arglist[1:], "sdfrokc:h", longopts=["state", "daemon", "full-help", "run", "runonce", "kill", "config=", "set-default-config=", "help", "list-failed", "list-saved", "purged-saved", "purge-failed", "comment-config"]) except getopt.GetoptError: sys.stderrUTF.write(helpMessage) sys.exit(1) global _action, _runOnce, configFile, REDIRECT_TO, saved for param, argum in argp: if param == "--daemon" or param == "-d": _action = "daemon" elif param == "--run" or param == "-r": _action = "run" elif param == "--runonce" or param == "-o": _action = "run" _runOnce = True elif param =="--state" or param == "-s": _action = 'state' elif param == "--kill" or param == "-k": _action = "kill" elif param == "--config" or param == "-c": configFile = argum elif param == "--purge-failed": _action="purge-failed" elif param == "--help" or param == "-h": _action = 'help' elif param == "--full-help" or param == "-f": _action = 'fullhelp' elif param == "--set-default-config": _action ='set-default-config' elif param == "--list-failed": _action = 'list-failed' elif param == "--list-saved": _action = 'list-saved' elif param == "--purge-saved": _action = 'purge-saved' elif param == "--comment-config": _action = 'comment-config' if _action == 'comment-config': # do not use ReFormatString b/c we want to preserve lines for e.g. > sample.cfg print commentConfig raise SystemExit elif _action == "daemon": getConfig(filename=configFile, reload=True) if os.name == u'nt' or os.name == u'dos' or os.name == u'ce': logStatusMsg( u"daemon mode not supported on Windows. will try to continue, but this is likely to crash", 1) elif os.name == u'mac' or os.name == u"os2": logStatusMsg( u"daemon mode may have issues on your platform. will try to continue, but may crash. feel free to submit a ticket with relevant output on this issue", 1) getConfig()['global']['verbose'] = 0 if os.getcwd() != getConfig()['global']['workingDir'] or os.getcwd() != os.path.realpath( getConfig()['global']['workingDir'] ): os.chdir(getConfig()['global']['workingDir']) if isinstance(getConfig()['global']['umask'], int ): try: os.umask( getConfig()['global']['umask'] ) except (AttributeError, ValueError), m: logStatusMsg( u'cannot set umask. Umask must be an integer value. Umask only available on some platforms. %s' % unicode(m), 2) logStatusMsg(u"entering Daemon mode", 5) if (hasattr(os, "devnull")): REDIRECT_TO = os.devnull else: REDIRECT_TO = "/dev/null" callDaemon() logStatusMsg( u"--- RSSDler %s" % getVersion() , 4) main() elif _action == 'fullhelp': sys.stdoutUTF.write(unicode(ReFormatString(inputstring=helpMessage)) + os.linesep) raise SystemExit elif _action == 'help': sys.stdoutUTF.write(unicode(ReFormatString(inputstring=cliOptions)) + os.linesep) raise SystemExit elif _action == "kill": getConfig(filename=configFile, reload=True) pid = int(codecs.open(os.path.join(getConfig()['global']['workingDir'], getConfig()['global']['daemonInfo']), 'r', 'utf-8').read()) raise SystemExit elif _action == "list-failed": getConfig(filename=configFile, reload=True) if os.getcwd() != getConfig()['global']['workingDir'] or os.getcwd() != os.path.realpath( getConfig()['global']['workingDir'] ): os.chdir(getConfig()['global']['workingDir']) logStatusMsg(u"changed directory to %s" % getConfig()['global']['workingDir'], 5) while 1: getSaved( getConfig()['global']['saveFile'] ) try: getSaved.lock() getSaved.load() break except (Locked, IOError, ValueError, IndexError): del saved time.sleep(3) continue for failure in getSaved.failedDown: print failure['link'] getSaved.unlock() raise SystemExit elif _action == "list-saved": getConfig(filename=configFile, reload=True) if os.getcwd() != getConfig()['global']['workingDir'] or os.getcwd() != os.path.realpath( getConfig()['global']['workingDir'] ): os.chdir(getConfig()['global']['workingDir']) logStatusMsg(u"changed directory to %s" % getConfig()['global']['workingDir'], 5) while 1: getSaved( getConfig()['global']['saveFile'] ) try: getSaved.lock() getSaved.load() break except (Locked, IOError, ValueError, IndexError): del saved time.sleep(3) continue for down in getSaved().downloads: print down getSaved().unlock() sys.exit() elif _action == "purge-failed": getConfig(filename=configFile, reload=True) if os.getcwd() != getConfig()['global']['workingDir'] or os.getcwd() != os.path.realpath( getConfig()['global']['workingDir'] ): os.chdir(getConfig()['global']['workingDir'])
13d117720c8018be030f6516cb9906c0b2260aa1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/13d117720c8018be030f6516cb9906c0b2260aa1/rssdler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5254, 12, 3175, 1098, 4672, 4277, 18, 10420, 12, 10420, 18, 18513, 3217, 16, 4277, 1503, 13, 775, 30, 261, 3175, 84, 16, 3127, 13, 273, 225, 336, 3838, 18, 1600, 89, 67, 588, 38...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 12, 3175, 1098, 4672, 4277, 18, 10420, 12, 10420, 18, 18513, 3217, 16, 4277, 1503, 13, 775, 30, 261, 3175, 84, 16, 3127, 13, 273, 225, 336, 3838, 18, 1600, 89, 67, 588, 38...
if what == "chunks" and self.last_tover > 0:
if what == "chunks" and self.last_tover > 0. and tover > 0.:
def swap(self, what, mode=None): "Swap chunks or slices using a certain bounds reference."
47dfe4a697632e15817b133a135a93c989b6f6d0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12687/47dfe4a697632e15817b133a135a93c989b6f6d0/index.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7720, 12, 2890, 16, 4121, 16, 1965, 33, 7036, 4672, 315, 12521, 6055, 578, 12390, 1450, 279, 8626, 4972, 2114, 1199, 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, 7720, 12, 2890, 16, 4121, 16, 1965, 33, 7036, 4672, 315, 12521, 6055, 578, 12390, 1450, 279, 8626, 4972, 2114, 1199, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.LogWindow.show()
self.LogWindow.show()
def window_state_event_cb(window, event): if event.changed_mask & gtk.gdk.WINDOW_STATE_ICONIFIED: if event.new_window_state & gtk.gdk.WINDOW_STATE_ICONIFIED: self.minimized = 1 else: self.minimized = 0
de19e9fd7192b52611630ff5e726665e825d19de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8738/de19e9fd7192b52611630ff5e726665e825d19de/frame.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2742, 67, 2019, 67, 2575, 67, 7358, 12, 5668, 16, 871, 4672, 309, 871, 18, 6703, 67, 4455, 473, 22718, 18, 75, 2883, 18, 23407, 67, 7998, 67, 21745, 13519, 30, 309, 871, 18, 2704, 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, 2742, 67, 2019, 67, 2575, 67, 7358, 12, 5668, 16, 871, 4672, 309, 871, 18, 6703, 67, 4455, 473, 22718, 18, 75, 2883, 18, 23407, 67, 7998, 67, 21745, 13519, 30, 309, 871, 18, 2704, 67...
return isinstance(member, ModuleType)
return False
def can_document_member(cls, member, membername, isattr, parent): return isinstance(member, ModuleType)
fd1313e7b895befa6478154fe627a8974effc014 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5532/fd1313e7b895befa6478154fe627a8974effc014/autodoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 848, 67, 5457, 67, 5990, 12, 6429, 16, 3140, 16, 3140, 529, 16, 353, 1747, 16, 982, 4672, 327, 1549, 12, 5990, 16, 5924, 559, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 848, 67, 5457, 67, 5990, 12, 6429, 16, 3140, 16, 3140, 529, 16, 353, 1747, 16, 982, 4672, 327, 1549, 12, 5990, 16, 5924, 559, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -...
default=u'Values ${val} is not allowed for vocabulary of element ${label}.',
default=u'Values ${val} are not allowed for vocabulary of element ${label}.',
def validate_vocabulary(self, instance, value, errors): """Make sure value is inside the allowed values for a given vocabulary""" badvalues = [] if value: # coerce value into a list called values values = value if type(value) in STRING_TYPES: values = [value] elif type(value) == BooleanType: values = [str(value)] elif type(value) not in (TupleType, ListType): raise TypeError("Field value type error: %s" % type(value)) vocab = self.Vocabulary(instance) # filter empty values = [instance.unicodeEncode(v) for v in values if v.strip()] # extract valid values from vocabulary valids = [] for v in vocab: if type(v) in (TupleType, ListType): v = v[0] if not type(v) in STRING_TYPES: v = str(v) valids.append(instance.unicodeEncode(v)) # check field values badvalues = [val for val in values if not val in valids]
c023d3352babadc7d91a4f5e383ddeca3024e27a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12165/c023d3352babadc7d91a4f5e383ddeca3024e27a/Field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 67, 15913, 13631, 12, 2890, 16, 791, 16, 460, 16, 1334, 4672, 3536, 6464, 3071, 460, 353, 4832, 326, 2935, 924, 364, 279, 864, 20906, 8395, 5570, 2372, 273, 5378, 309, 460, 30, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 67, 15913, 13631, 12, 2890, 16, 791, 16, 460, 16, 1334, 4672, 3536, 6464, 3071, 460, 353, 4832, 326, 2935, 924, 364, 279, 864, 20906, 8395, 5570, 2372, 273, 5378, 309, 460, 30, 4...
def displayChangedMenuState(self): self.mouseOverSelectingItem.Check(self.display.useMouseOverSelecting()) self.showRegionNamesMenuItem.Check(self.display.showRegionNames()) self.showNeuronNamesMenuItem.Check(self.display.showNeuronNames()) self.labelsFloatOnTopMenuItem.Check(self.display.labelsFloatOnTop()) self.useGhostsMenuItem.Check(self.display.useGhosts()) self.resetViewMenuItem.Enable(self.display.viewDimensions == 3) self.zoomToFitMenuItem.Enable(self.display.viewDimensions == 2) self.zoomToSelectionMenuItem.Enable(self.display.viewDimensions == 2 and any(self.display.selection())) self.GetToolBar().ToggleTool(self._view2DId, self.display.viewDimensions == 2) self.GetToolBar().ToggleTool(self._view3DId, self.display.viewDimensions == 3)
def toolBar(self): toolBar = wx.ToolBar(self) toolBar.AddCheckLabelTool(self.viewIn2DMenuItem.GetId(), gettext('2D View'), self.loadBitmap("View2D.png")) self.Bind(wx.EVT_TOOL, self.display.onViewIn2D, id = self.viewIn2DMenuItem.GetId()) toolBar.AddCheckLabelTool(self.viewIn3DMenuItem.GetId(), gettext('3D View'), self.loadBitmap("View3D.png")) self.Bind(wx.EVT_TOOL, self.display.onViewIn3D, id = self.viewIn3DMenuItem.GetId()) toolBar.AddSeparator() toolBar.AddLabelTool(self.zoomToFitMenuItem.GetId(), gettext('Zoom To Fit'), self.loadBitmap("ZoomToFit.png")) toolBar.AddLabelTool(self.zoomToSelectionMenuItem.GetId(), gettext('Zoom To Selection'), self.loadBitmap("ZoomToSelection.png")) toolBar.AddLabelTool(self.zoomInMenuItem.GetId(), gettext('Zoom In'), self.loadBitmap("ZoomIn.png")) toolBar.AddLabelTool(self.zoomOutMenuItem.GetId(), gettext('Zoom Out'), self.loadBitmap("ZoomOut.png")) toolBar.Realize() return toolBar def onUpdateUI(self, event): eventId = event.GetId() if eventId == self.mouseOverSelectingItem.GetId(): event.Check(self.display.useMouseOverSelecting()) elif eventId == self.showRegionNamesMenuItem.GetId(): event.Check(self.display.showRegionNames()) elif eventId == self.showNeuronNamesMenuItem.GetId(): event.Check(self.display.showNeuronNames()) elif eventId == self.labelsFloatOnTopMenuItem.GetId(): event.Check(self.display.labelsFloatOnTop()) elif eventId == self.useGhostsMenuItem.GetId(): event.Check(self.display.useGhosts()) elif eventId == self.viewIn2DMenuItem.GetId(): event.Check(self.display.viewDimensions == 2) elif eventId == self.viewIn3DMenuItem.GetId(): event.Check(self.display.viewDimensions == 3) elif eventId == self.resetViewMenuItem.GetId(): event.Enable(self.display.viewDimensions == 3) elif eventId == self.zoomToFitMenuItem.GetId(): event.Enable(self.display.viewDimensions == 2) elif eventId == self.zoomToSelectionMenuItem.GetId(): event.Enable(self.display.viewDimensions == 2 and any(self.display.selection()))
def displayChangedMenuState(self): self.mouseOverSelectingItem.Check(self.display.useMouseOverSelecting()) self.showRegionNamesMenuItem.Check(self.display.showRegionNames()) self.showNeuronNamesMenuItem.Check(self.display.showNeuronNames()) self.labelsFloatOnTopMenuItem.Check(self.display.labelsFloatOnTop()) self.useGhostsMenuItem.Check(self.display.useGhosts()) self.resetViewMenuItem.Enable(self.display.viewDimensions == 3) self.zoomToFitMenuItem.Enable(self.display.viewDimensions == 2) self.zoomToSelectionMenuItem.Enable(self.display.viewDimensions == 2 and any(self.display.selection())) self.GetToolBar().ToggleTool(self._view2DId, self.display.viewDimensions == 2) self.GetToolBar().ToggleTool(self._view3DId, self.display.viewDimensions == 3)
41c8baefbb8245f0a407ec793bbafee6a34bb0e1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6368/41c8baefbb8245f0a407ec793bbafee6a34bb0e1/NeuroptikonFrame.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5226, 5190, 12, 2890, 4672, 5226, 5190, 273, 7075, 18, 6364, 5190, 12, 2890, 13, 5226, 5190, 18, 986, 1564, 2224, 6364, 12, 2890, 18, 1945, 382, 22, 40, 12958, 18, 967, 548, 9334, 2497...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5226, 5190, 12, 2890, 4672, 5226, 5190, 273, 7075, 18, 6364, 5190, 12, 2890, 13, 5226, 5190, 18, 986, 1564, 2224, 6364, 12, 2890, 18, 1945, 382, 22, 40, 12958, 18, 967, 548, 9334, 2497...
uri=uri._reduri self._parser=Redland.librdf_new_parser(_world._world, name, mime_type, uri)
ruri=uri._reduri else: ruri=None self._parser=Redland.librdf_new_parser(_world._world, name, mime_type, ruri)
def __init__(self, name="rdfxml", mime_type="application/rdf+xml", uri=None): """Create an RDF Parser (constructor).
fd7c031031ec0ac08c4a9519bf32ff0ab61e9369 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14754/fd7c031031ec0ac08c4a9519bf32ff0ab61e9369/RDF.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 508, 1546, 19299, 2902, 3113, 4892, 67, 723, 1546, 3685, 19, 19299, 15, 2902, 3113, 2003, 33, 7036, 4672, 3536, 1684, 392, 13539, 6783, 261, 12316, 2934, 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, 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, 1546, 19299, 2902, 3113, 4892, 67, 723, 1546, 3685, 19, 19299, 15, 2902, 3113, 2003, 33, 7036, 4672, 3536, 1684, 392, 13539, 6783, 261, 12316, 2934, 2...
test_capi1()
def test_capi1(): try: _testcapi.raise_exception(BadException, 1) except TypeError, err: exc, err, tb = sys.exc_info() co = tb.tb_frame.f_code assert co.co_name == "test_capi1" assert co.co_filename.endswith('test_exceptions.py') else: print "Expected exception"
aa3dc456583aaffcccc16da82bb68669264880b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/aa3dc456583aaffcccc16da82bb68669264880b4/test_exceptions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 71, 2425, 21, 13332, 775, 30, 389, 3813, 71, 2425, 18, 11628, 67, 4064, 12, 6434, 503, 16, 404, 13, 1335, 3580, 16, 393, 30, 3533, 16, 393, 16, 8739, 273, 2589, 18, 10075, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 71, 2425, 21, 13332, 775, 30, 389, 3813, 71, 2425, 18, 11628, 67, 4064, 12, 6434, 503, 16, 404, 13, 1335, 3580, 16, 393, 30, 3533, 16, 393, 16, 8739, 273, 2589, 18, 10075, ...
filler="a:b:c:"
filler = "a:b:c:"
def untranslate(trans, prepend = 1): filler="a:b:c:" if prepend == 1: context = "%s%s" % (filler,trans) else: context = trans (rc, raw) = selinux.selinux_trans_to_raw_context(context) if rc != 0: return trans if prepend: raw = raw[len(filler):] if raw == "": return trans else: return raw
8ad29a27255b6eb5a4f8e1083ce9832034f3e205 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7147/8ad29a27255b6eb5a4f8e1083ce9832034f3e205/seobject.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 640, 13929, 12, 2338, 16, 8254, 273, 404, 4672, 28187, 273, 315, 69, 30, 70, 30, 71, 2773, 309, 8254, 422, 404, 30, 819, 273, 2213, 87, 9, 87, 6, 738, 261, 5935, 264, 16, 2338, 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, 640, 13929, 12, 2338, 16, 8254, 273, 404, 4672, 28187, 273, 315, 69, 30, 70, 30, 71, 2773, 309, 8254, 422, 404, 30, 819, 273, 2213, 87, 9, 87, 6, 738, 261, 5935, 264, 16, 2338, 13,...
cmd = 'DELETE FROM %s WHERE JobID in (%s)' % ( table, jobIDString )
cmd = 'DELETE FROM %s WHERE JobID in (%s)' % ( table, jobIDString )
def removeJobFromDB(self, jobIDs): """Remove job from DB
80754a3f17531def7cbc50d246e9e547c954723a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/80754a3f17531def7cbc50d246e9e547c954723a/JobDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1206, 2278, 1265, 2290, 12, 2890, 16, 1719, 5103, 4672, 3536, 3288, 1719, 628, 2383, 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,...
[ 1, 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, 1206, 2278, 1265, 2290, 12, 2890, 16, 1719, 5103, 4672, 3536, 3288, 1719, 628, 2383, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
def substr(str,x1,x2):
def substr(s, x1, x2):
def substr(str,x1,x2): raise DeprecatedIDCError, "substr() is deprecated. Use python string operations instead."
4f22943d42ee1d5013421d280b3bd776bee83fb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3410/4f22943d42ee1d5013421d280b3bd776bee83fb9/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2373, 12, 87, 16, 619, 21, 16, 619, 22, 4672, 1002, 9336, 734, 39, 668, 16, 315, 10706, 1435, 353, 6849, 18, 2672, 5790, 533, 5295, 3560, 1199, 225, 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, 2373, 12, 87, 16, 619, 21, 16, 619, 22, 4672, 1002, 9336, 734, 39, 668, 16, 315, 10706, 1435, 353, 6849, 18, 2672, 5790, 533, 5295, 3560, 1199, 225, 2, -100, -100, -100, -100, -100, ...
alephsysnos = get_fieldvalues(recID, "909C0o")
alephsysnos = get_fieldvalues(recID, "970__a")
def print_record(recID, format='hb', ot='', decompress=zlib.decompress): "Prints record 'recID' formatted accoding to 'format'." out = "" # sanity check: if not record_exists(recID): return out # print record opening tags, if needed: if format == "marcxml" or format == "oai_dc": out += " <record>\n" out += " <header>\n" for id in get_fieldvalues(recID,oaiidfield): out += " <identifier>%s</identifier>\n" % id out += " <datestamp>%s</datestamp>\n" % get_modification_date(recID) out += " </header>\n" out += " <metadata>\n" if format.startswith("xm") or format == "marcxml": # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format' -- they are not in "bibfmt" table; so fetch all the data from "bibXXx" tables: if format == "marcxml": out += """ <record xmlns="http://www.loc.gov/MARC21/slim">\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) elif format.startswith("xm"): out += """ <record>\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) for digit1 in range(0,10): for digit2 in range(0,10): bx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) query = "SELECT b.tag,b.value,bb.field_number FROM %s AS b, %s AS bb "\ "WHERE bb.id_bibrec='%s' AND b.id=bb.id_bibxxx AND b.tag LIKE '%s%%' "\ "ORDER BY bb.field_number, b.tag ASC" % (bx, bibx, recID, str(digit1)+str(digit2)) if dbg: out += "<br>Debug: " + query res = run_sql(query) field_number_old = -999 field_old = "" for row in res: field, value, field_number = row[0], row[1], row[2] ind1, ind2 = field[3], field[4] if ind1 == "_": ind1 = "" if ind2 == "_": ind2 = "" # print field tag if field_number != field_number_old or field[:-1] != field_old[:-1]: if format.startswith("xm") or format == "marcxml": fieldid = encode_for_xml(field[0:3]) if field_number_old != -999: out += """ </datafield>\n""" out += """ <datafield tag="%s" ind1="%s" ind2="%s">\n""" % (encode_for_xml(field[0:3]), encode_for_xml(ind1), encode_for_xml(ind2)) field_number_old = field_number field_old = field # print subfield value if format.startswith("xm") or format == "marcxml": value = encode_for_xml(value) out += """ <subfield code="%s">%s</subfield>\n""" % (encode_for_xml(field[-1:]), value) # all fields/subfields printed in this run, so close the tag: if (format.startswith("xm") or format == "marcxml") and field_number_old != -999: out += """ </datafield>\n""" # we are at the end of printing the record: if format.startswith("xm") or format == "marcxml": out += " </record>\n" elif format == "xd" or format == "oai_dc": # XML Dublin Core format, possibly OAI -- select only some bibXXx fields: out += """ <dc xmlns="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://www.openarchives.org/OAI/1.1/dc.xsd">\n""" for f in get_fieldvalues(recID, "041__a"): out += " <language>%s</language>\n" % f for f in get_fieldvalues(recID, "100__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "700__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "245__a"): out += " <title>%s</title>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "65017a"): out += " <subject>%s</subject>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "8564_u"): out += " <identifier>%s</identifier>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "520__a"): out += " <description>%s</description>\n" % encode_for_xml(f) out += " <date>%s</date>\n" % get_creation_date(recID) out += " </dc>\n" elif str(format[0:3]).isdigit(): # user has asked to print some fields only if format == "001": out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, recID, format) else: vals = get_fieldvalues(recID, format) for val in vals: out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, val, format) elif format.startswith('t'): ## user directly asked for some tags to be displayed only out += get_fieldvalues_alephseq_like(recID, ot) elif format == "hm": out += "<pre>" + get_fieldvalues_alephseq_like(recID, ot) + "</pre>" elif format.startswith("h") and ot: ## user directly asked for some tags to be displayed only out += "<pre>" + get_fieldvalues_alephseq_like(recID, ot) + "</pre>" elif format == "hd": # HTML detailed format # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format', so either call BibFormat on the fly or use default format # second, see if we are calling BibFormat on the fly: if cfg_call_bibformat: out += call_bibformat(recID) else: # okay, need to construct a simple "Detailed record" format of our own: out += "<p>&nbsp;" # secondly, title: titles = get_fieldvalues(recID, "245__a") for title in titles: out += "<p><p><center><big><strong>%s</strong></big></center>" % title # thirdly, authors: authors = get_fieldvalues(recID, "100__a") + get_fieldvalues(recID, "700__a") if authors: out += "<p><p><center>" for author in authors: out += """<a href="%s/search.py?p=%s&f=author">%s</a> ;""" % (weburl, urllib.quote(author), author) out += "</center>" # fourthly, date of creation: dates = get_fieldvalues(recID, "260__c") for date in dates: out += "<p><center><small>%s</small></center>" % date # fifthly, abstract: abstracts = get_fieldvalues(recID, "520__a") for abstract in abstracts: out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>Abstract:</strong> %s</small></p>""" % abstract # fifthly bis, keywords: keywords = get_fieldvalues(recID, "6531_a") if len(keywords): out += """<p style="margin-left: 15%; width: 70%"> <small><strong>Keyword(s):</strong></small>""" for keyword in keywords: out += """<small><a href="%s/search.py?p=%s&f=keyword">%s</a> ;</small> """ % (weburl, urllib.quote(keyword), keyword) # fifthly bis bis, published in: prs_p = get_fieldvalues(recID, "909C4p") prs_v = get_fieldvalues(recID, "909C4v") prs_y = get_fieldvalues(recID, "909C4y") prs_n = get_fieldvalues(recID, "909C4n") prs_c = get_fieldvalues(recID, "909C4c") for idx in range(0,len(prs_p)): out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>Publ. in:</strong> %s""" % prs_p[idx] if prs_v and prs_v[idx]: out += """<strong>%s</strong>""" % prs_v[idx] if prs_y and prs_y[idx]: out += """(%s)""" % prs_y[idx] if prs_n and prs_n[idx]: out += """, no.%s""" % prs_n[idx] if prs_c and prs_c[idx]: out += """, p.%s""" % prs_c[idx] out += """.</small>""" # sixthly, fulltext link: urls_z = get_fieldvalues(recID, "8564_z") urls_u = get_fieldvalues(recID, "8564_u") for idx in range(0,len(urls_u)): link_text = "URL" if urls_z[idx]: link_text = urls_z[idx] out += """<p style="margin-left: 15%%; width: 70%%"> <small><strong>%s:</strong> <a href="%s">%s</a></small>""" % (link_text, urls_u[idx], urls_u[idx]) # print some white space at the end: out += "<p><p>" elif format == "hb-fly": # HTML brief called on the fly; suitable for testing brief formats out += call_bibformat(recID, "BRIEF_HTML") out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?id=%s">Detailed record</a></span>""" \ % (weburl, recID) elif format == "hd-ejournalsite": # HTML brief called on the fly; suitable for testing brief formats out += call_bibformat(recID, "EJOURNALSITE") out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?id=%s">Detailed record</a></span>""" \ % (weburl, recID) else: # HTML brief format by default query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' does not exist in format 'format', so print some default format: # firstly, title: titles = get_fieldvalues(recID, "245__a") for title in titles: out += "<strong>%s</strong> " % title # secondly, authors: authors = get_fieldvalues(recID, "100__a") + get_fieldvalues(recID, "700__a") if authors: out += " / " for i in range (0,cfg_author_et_al_threshold): if i < len(authors): out += """<a href="%s/search.py?p=%s&f=author">%s</a> ;""" % (weburl, urllib.quote(authors[i]), authors[i]) if len(authors) > cfg_author_et_al_threshold: out += " <em>et al.</em>" # thirdly, date of creation: dates = get_fieldvalues(recID, "260__c") for date in dates: out += " %s." % date # thirdly bis, report numbers: rns = get_fieldvalues(recID, "037__a") for rn in rns: out += """ <small class="quicknote">[%s]</small>""" % rn rns = get_fieldvalues(recID, "088__a") for rn in rns: out += """ <small class="quicknote">[%s]</small>""" % rn # fourthly, beginning of abstract: abstracts = get_fieldvalues(recID, "520__a") for abstract in abstracts: out += "<br><small>%s [...]</small>" % abstract[:1+string.find(abstract, '.')] # fifthly, fulltext link: urls_z = get_fieldvalues(recID, "8564_z") urls_u = get_fieldvalues(recID, "8564_u") for idx in range(0,len(urls_u)): out += """<br><small class="note"><a class="note" href="%s">%s</a></small>""" % (urls_u[idx], urls_u[idx]) # at the end of HTML mode, print the "Detailed record" functionality: if cfg_use_aleph_sysnos: alephsysnos = get_fieldvalues(recID, "909C0o") if len(alephsysnos)>0: alephsysno = alephsysnos[0] out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?sysnb=%s">Detailed record</a></span>""" \ % (weburl, alephsysno) else: out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?id=%s">Detailed record</a></span>""" \ % (weburl, recID) else: out += """<br><span class="moreinfo"><a class="moreinfo" href="%s/search.py?id=%s">Detailed record</a></span>""" \ % (weburl, recID) # ...and the "Mark record" functionality: #out += """<span class="moreinfo"> - <input name="recid" type="checkbox" value="%s"> Mark record</span>""" % recID # print record closing tags, if needed: if format == "marcxml" or format == "oai_dc": out += " </metadata>\n" out += " </record>\n" return out
f8885ff5b8b672e89581fb5ee226eb8e5bf90872 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f8885ff5b8b672e89581fb5ee226eb8e5bf90872/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 3366, 12, 3927, 734, 16, 740, 2218, 76, 70, 2187, 15835, 2218, 2187, 16824, 33, 94, 2941, 18, 323, 14706, 4672, 315, 15402, 1409, 296, 3927, 734, 11, 4955, 4078, 4751, 358, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 3366, 12, 3927, 734, 16, 740, 2218, 76, 70, 2187, 15835, 2218, 2187, 16824, 33, 94, 2941, 18, 323, 14706, 4672, 315, 15402, 1409, 296, 3927, 734, 11, 4955, 4078, 4751, 358, 2...
v = [x for x in v if v != 1]
v = [x for x in v if x != 1]
def invariants(self): """ Return elementary invariants of this abelian group, by which we mean a nondecreasing (immutable) sequence of integers $n_i$, $1 \leq i \leq k$, with $n_i$ dividing $n_{i+1}$, and such that this group is abstractly isomorphic to $\ZZ/n_1\ZZ \times\cdots\times \ZZ/n_k\ZZ.$
8d0551894c264fac468d199853e2f0add7c8b944 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8d0551894c264fac468d199853e2f0add7c8b944/finite_subgroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 15886, 12, 2890, 4672, 3536, 2000, 930, 814, 316, 15886, 434, 333, 1223, 292, 2779, 1041, 16, 635, 1492, 732, 3722, 279, 1661, 323, 1793, 11730, 261, 381, 5146, 13, 3102, 434, 12321...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 316, 15886, 12, 2890, 4672, 3536, 2000, 930, 814, 316, 15886, 434, 333, 1223, 292, 2779, 1041, 16, 635, 1492, 732, 3722, 279, 1661, 323, 1793, 11730, 261, 381, 5146, 13, 3102, 434, 12321...
server = RPCClient('Stager/Stager',useCertificates=useCerts)
server = RPCClient('Stager/Stager',useCertificates=self.useCerts)
def getJobsForRetry(self,retry,site): try: server = RPCClient('Stager/Stager',useCertificates=useCerts) result = server.getJobsForRetry(retry,site) return result except Exception, x: errorStr = "StagerDBClient.getJobsForRetry failed" gLogger.exception(errorStr,lException=x) return S_ERROR(errorStr+": "+str(x))
3ed5597134718830480f7f1b611dd7039dcffb7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/3ed5597134718830480f7f1b611dd7039dcffb7b/StagerClient.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 7276, 1290, 7539, 12, 2890, 16, 9620, 16, 4256, 4672, 775, 30, 1438, 273, 8295, 1227, 2668, 510, 6817, 19, 510, 6817, 2187, 1202, 14133, 33, 2890, 18, 1202, 16273, 13, 563, 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, 336, 7276, 1290, 7539, 12, 2890, 16, 9620, 16, 4256, 4672, 775, 30, 1438, 273, 8295, 1227, 2668, 510, 6817, 19, 510, 6817, 2187, 1202, 14133, 33, 2890, 18, 1202, 16273, 13, 563, 273, 1...
found_start_id = False
def main(args): ''' Main loop. ''' site = wikipedia.getSite(u'commons', u'commons') wikipedia.setSite(site) start_id=0 found_start_id = False conn = None cursor = None (conn, cursor) = connectDatabase() conn2 = None cursor2 = None (conn2, cursor2) = connectDatabase2('commonswiki-p.db.toolserver.org', u'u_multichill_commons_categories_p') if(len(args) >1): if len(args) > 2: start_id=args[2] sourcedir = args[0] destinationdir = args[1] if os.path.isdir(sourcedir) and os.path.isdir(destinationdir): #print sourcedir for subdir in os.listdir(sourcedir): #print subdir if os.path.isdir(sourcedir + subdir): #print subdir for sourcefilename in glob.glob(sourcedir + subdir + "/*.jpg"): duplicates = findDuplicateImages(sourcefilename) if duplicates: wikipedia.output(u'Found duplicate image at %s' % duplicates.pop()) else: #Get the file id fileId = getFileId(sourcefilename) print str(fileId) #Get metadata metadata = getMetadata(fileId, cursor) #Check if we got metadata if metadata: #Get description description = getDescription(metadata) # The hard part, find suitable categories categories = getCategories(metadata, cursor, cursor2) #print categories description = description + categories print description #Get destinationfilename destinationFilename = getTitle(metadata) #Copy file to destination dir shutil.copy(sourcefilename, destinationdir + destinationFilename + '.jpg') #And save the description as well outputDescriptionFile(destinationdir + destinationFilename + '.txt', description) #Save it
d40ae98e89fc2145baa4083e2e5bf5cef18c6eba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7426/d40ae98e89fc2145baa4083e2e5bf5cef18c6eba/batch_generator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 12, 1968, 4672, 9163, 12740, 2798, 18, 9163, 2834, 273, 21137, 18, 588, 4956, 12, 89, 11, 6054, 87, 2187, 582, 11, 6054, 87, 6134, 21137, 18, 542, 4956, 12, 4256, 13, 225, 787, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1968, 4672, 9163, 12740, 2798, 18, 9163, 2834, 273, 21137, 18, 588, 4956, 12, 89, 11, 6054, 87, 2187, 582, 11, 6054, 87, 6134, 21137, 18, 542, 4956, 12, 4256, 13, 225, 787, ...
requirements += " && %s " % archrequirement
if requirements != "": requirements += " && " requirements += " %s " % archrequirement
def createJDL(self, cladfilename,jobType,UserJDLRequirementsFile): """ _createJDL_ create the scheduler JDL combining the user specified bit of the JDL """
32ae346f16f84a2feb453c3fbfed800e78518c15 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/32ae346f16f84a2feb453c3fbfed800e78518c15/GLiteBulkSubmitter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 46, 8914, 12, 2890, 16, 927, 361, 3459, 16, 4688, 559, 16, 1299, 46, 8914, 15465, 812, 4672, 3536, 389, 2640, 46, 8914, 67, 225, 752, 326, 8129, 804, 8914, 29189, 326, 729, 1269, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 46, 8914, 12, 2890, 16, 927, 361, 3459, 16, 4688, 559, 16, 1299, 46, 8914, 15465, 812, 4672, 3536, 389, 2640, 46, 8914, 67, 225, 752, 326, 8129, 804, 8914, 29189, 326, 729, 1269, ...
if pymax(self.pk) * dr > self.maxstep: dr /= (pymax(self.pk) * dr / self.maxstep)
if abs(pymax(self.pk) * dr) > self.maxstep: dr /= abs((pymax(self.pk) * dr) / self.maxstep)
def determine_step(self, stp): dr = stp - self.old_stp if pymax(self.pk) * dr > self.maxstep: dr /= (pymax(self.pk) * dr / self.maxstep) stp = self.old_stp + dr return stp
641f60dd96106011e01aa0fa742d73c4ded7f0ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/641f60dd96106011e01aa0fa742d73c4ded7f0ab/linesearch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 67, 4119, 12, 2890, 16, 384, 84, 4672, 5081, 273, 384, 84, 300, 365, 18, 1673, 67, 20355, 309, 2417, 12, 2074, 1896, 12, 2890, 18, 5465, 13, 380, 5081, 13, 405, 365, 18, 1896, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 67, 4119, 12, 2890, 16, 384, 84, 4672, 5081, 273, 384, 84, 300, 365, 18, 1673, 67, 20355, 309, 2417, 12, 2074, 1896, 12, 2890, 18, 5465, 13, 380, 5081, 13, 405, 365, 18, 1896, ...