rem
stringlengths
1
322k
add
stringlengths
0
2.05M
context
stringlengths
4
228k
meta
stringlengths
156
215
ds['DataTier'], \ ds['ProcessedDataset']) \
ds['ProcessedDataset'], \ ds['DataTier']) \
def closeRequest(self, workflowFile): """ _closeRequest_
ce9cbea0377608d6e6bd06fedd8fb3622e8b8f49 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/ce9cbea0377608d6e6bd06fedd8fb3622e8b8f49/MergeSensorComponent.py
expr = '' is_the_first = True for run in runs_list: if is_the_first: expr += "(" is_the_first = False else: expr += " or " if run.count("-"): run_limits = \ [x.strip() for x in run.split('-') if x.strip()] expr += "(x >= %s and x <= %s)" % ( run_limits[0], run_limits[1]) else: expr += "x == %s" % run if not is_the_fi...
if runs_list: expr = '' is_the_first = True for run in runs_list: if is_the_first: expr += "(" is_the_first = False else: expr += " or " if run.count("-"): run_limits = \ [x.strip() for x in run.split('-') if x.strip()] expr += "(x >= %s and x <= %s)" % ( run_limits[0], run_limits[1]) else: expr += "x == %s" % run i...
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 ...
4d7f58ceb882a590207e18223ff8a03ed74aa56a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/4d7f58ceb882a590207e18223ff8a03ed74aa56a/prepareRelValWorkflows.py
[str(x['RunNumber']) for x in input_file['RunsList']]
[int(x['RunNumber']) for x in input_file['RunsList']]
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 ...
a3962ab33777264a6a08aea585d641cf5c037023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/a3962ab33777264a6a08aea585d641cf5c037023/prepareRelValWorkflows.py
dqmData['Runs'] = ",".join(list(runs_to_process))
dqmData['Runs'] = \ ",".join([str(x) for x in list(runs_to_process)])
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 ...
a3962ab33777264a6a08aea585d641cf5c037023 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/a3962ab33777264a6a08aea585d641cf5c037023/prepareRelValWorkflows.py
msg += ex
msg += str(ex)
def publishStatusToDashboard(self, jobSpecId, data): """ _publishStatusToDashboard_
5a5dbe1212c44c83bc3260919c0ce68f5227766a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/5a5dbe1212c44c83bc3260919c0ce68f5227766a/CondorG.py
def __init__(self, stagein=False): StageOutImpl.__init__(self, stagein) self.numRetries = 5 self.retryPause = 300
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
targetDirCheck = "rfstat %s 2> /dev/null | grep Protection" % targetDir print "Check dir existence : %s" % targetDirCheck try: targetDirCheckExitCode, targetDirCheckOutput = runCommandWithOutput(targetDirCheck) except Exception, ex: msg = "Error: Exception while invoking command:\n" msg += "%s\n" % targetDirCheck msg ...
if not self.checkDirExists(targetDir):
def createOutputDirectory(self, targetPFN): """ _createOutputDirectory_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
fileclassDirCheck = "rfstat %s 2> /dev/null | grep Protection" % fileclassDir print "Check dir existence : %s" % fileclassDirCheck try: fileclassDirCheckExitCode, fileclassDirCheckOutput = runCommandWithOutput(fileclassDirCheck) except Exception, ex: msg = "Error: Exception while invoking command:\n" msg += "%s\n" % r...
if not self.checkDirExists(fileclassDir):
def createOutputDirectory(self, targetPFN): """ _createOutputDirectory_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
self.createDir(fileclassDir, self.permissions)
self.createDir(fileclassDir)
def createOutputDirectory(self, targetPFN): """ _createOutputDirectory_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
else: regExpParser = re.compile('Protection.*: d') if ( regExpParser.match(fileclassDirCheckOutput) == None): raise StageOutError("Output path is not a directory !")
def createOutputDirectory(self, targetPFN): """ _createOutputDirectory_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
self.createDir(targetDir, self.permissions) else: regExpParser = re.compile('Protection.*: d') if ( regExpParser.match(targetDirCheckOutput) == None): raise StageOutError("Output path is not a directory !")
self.createDir(targetDir)
def createOutputDirectory(self, targetPFN): """ _createOutputDirectory_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
def createDir(self, directory, mode):
def checkDirExists(self, directory): """ _checkDirExists_ Check if directory exists (will fail if it exists as a file) """ command = "rfstat %s 2> /dev/null | grep Protection" % directory print "Check dir existence : %s" % command try: exitCode, output = runCommandWithOutput(command) except Exception, ex: msg = "Erro...
def createDir(self, directory, mode): """ _createDir_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
Creates directory with no permissions """ cmd = "nsmkdir -m %s -p \"%s\"" % (mode, directory) execute(cmd)
Creates directory with correct permissions """ command = "(umask %s ; nsmkdir -m %s -p \"%s\")" % (self.umask, self.permissions, directory) execute(command)
def createDir(self, directory, mode): """ _createDir_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
def setFileClass(self, directory, fileclass): """ _setFileClass_
8674b360d5d69889b93b75de76ac61bc98ade9a5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/8674b360d5d69889b93b75de76ac61bc98ade9a5/RFCPCERNImpl.py
args['producer'] = 'ProdSys' args['step'] = 'Pass-1'
def httpPost(self, analysisFile): """ _httpPost_
5d349b83a18f6c388b1cc05acfb65c112a28563d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/5d349b83a18f6c388b1cc05acfb65c112a28563d/RuntimeOfflineDQM.py
args['workflow'] = self.inputDataset args['mssname'] = self.mssNames[filename]
def httpPost(self, analysisFile): """ _httpPost_
5d349b83a18f6c388b1cc05acfb65c112a28563d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8887/5d349b83a18f6c388b1cc05acfb65c112a28563d/RuntimeOfflineDQM.py
edit_toolbar_button, accelerator='<Ctrl>c')
edit_toolbar, accelerator='<Ctrl>c')
def _setup_toolbars(self, have_toolbox): """ Setup the toolbars.. """ project_toolbar = gtk.Toolbar() custom_slide_toolbar = gtk.Toolbar() custom_stator_toolbar = gtk.Toolbar() edit_toolbar = gtk.Toolbar()
99a70d60845b2ab17b723c29885651d5cc8ec72d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/99a70d60845b2ab17b723c29885651d5cc8ec72d/SlideruleActivity.py
edit_toolbar_button, accelerator='<Ctrl>v')
edit_toolbar, accelerator='<Ctrl>v')
def _setup_toolbars(self, have_toolbox): """ Setup the toolbars.. """ project_toolbar = gtk.Toolbar() custom_slide_toolbar = gtk.Toolbar() custom_stator_toolbar = gtk.Toolbar() edit_toolbar = gtk.Toolbar()
99a70d60845b2ab17b723c29885651d5cc8ec72d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/99a70d60845b2ab17b723c29885651d5cc8ec72d/SlideruleActivity.py
if self.sr.last is not None: data = self.sr.last.labels[0] if data is not None: clipBoard.set_text(str(data))
if self.sr.last is None and self.sr.last.labels[0] is not None: clipBoard.set_text(self.sr.last.labels[0])
def _copy_cb(self, arg=None): """ Copy a number to the clipboard from the active slide. """ clipBoard = gtk.Clipboard() if self.sr.last is not None: data = self.sr.last.labels[0] if data is not None: clipBoard.set_text(str(data)) return
f03002240af8bcf3b3ae85f2f40e94c6748f934c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/f03002240af8bcf3b3ae85f2f40e94c6748f934c/SlideruleActivity.py
def _show_slides(self, top, bottom, function):
def _show_slides(self, slide, stator, function):
def _show_slides(self, top, bottom, function): self._hide_all() self._top_combo.set_active(_SLIDES.index(top)) self.set_slide() self._bottom_combo.set_active(_STATORS.index(bottom)) self.set_stator() self._function_combo.set_active(_FUNCTIONS.index(function)) self.sr.update_slide_labels() self.sr.update_results_label()
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
self._top_combo.set_active(_SLIDES.index(top))
self._slide_combo.set_active(_SLIDES.index(slide))
def _show_slides(self, top, bottom, function): self._hide_all() self._top_combo.set_active(_SLIDES.index(top)) self.set_slide() self._bottom_combo.set_active(_STATORS.index(bottom)) self.set_stator() self._function_combo.set_active(_FUNCTIONS.index(function)) self.sr.update_slide_labels() self.sr.update_results_label()
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
self._bottom_combo.set_active(_STATORS.index(bottom))
self._stator_combo.set_active(_STATORS.index(stator))
def _show_slides(self, top, bottom, function): self._hide_all() self._top_combo.set_active(_SLIDES.index(top)) self.set_slide() self._bottom_combo.set_active(_STATORS.index(bottom)) self.set_stator() self._function_combo.set_active(_FUNCTIONS.index(function)) self.sr.update_slide_labels() self.sr.update_results_label()
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
self._show_slides(_L, _L2, _FL)
self._show_slides(_L, _L, _FL)
def show_l(self): """ linear scale """ self.sr.active_slide = self.sr.name_to_slide('L') self.sr.active_stator = self.sr.name_to_stator('L2') self._show_slides(_L, _L2, _FL)
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
def _top_combo_cb(self, arg=None):
def _slide_combo_cb(self, arg=None):
def _top_combo_cb(self, arg=None): """ Read value from slide combo box """ _top_dictionary = {_C: 'C', _CI: 'CI', _A: 'A', _K: 'K', _S: 'S', _T: 'T', _L: 'L', _LL0: 'LL0', _LLn: 'LLn', _UD: 'custom'} self.sr.active_slide = self.sr.name_to_slide(_top_dictionary[ _SLIDES[self._top_combo.get_active()]]) function = self._p...
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
_SLIDES[self._top_combo.get_active()]])
_SLIDES[self._slide_combo.get_active()]])
def _top_combo_cb(self, arg=None): """ Read value from slide combo box """ _top_dictionary = {_C: 'C', _CI: 'CI', _A: 'A', _K: 'K', _S: 'S', _T: 'T', _L: 'L', _LL0: 'LL0', _LLn: 'LLn', _UD: 'custom'} self.sr.active_slide = self.sr.name_to_slide(_top_dictionary[ _SLIDES[self._top_combo.get_active()]]) function = self._p...
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
def _bottom_combo_cb(self, arg=None):
def _stator_combo_cb(self, arg=None):
def _bottom_combo_cb(self, arg=None): """ Read value from stator combo box """ _bottom_dictionary = {_D: 'D', _DI: 'DI', _L: 'L2', _B: 'B', _K: 'K2', _S: 'S2', _T: 'T2', _LL0: 'LL02', _LLn: 'LLn2', _UD: 'custom2'} self.sr.active_stator = self.sr.name_to_stator(_bottom_dictionary[ _STATORS[self._bottom_combo.get_active(...
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
_STATORS[self._bottom_combo.get_active()]])
_STATORS[self._stator_combo.get_active()]])
def _bottom_combo_cb(self, arg=None): """ Read value from stator combo box """ _bottom_dictionary = {_D: 'D', _DI: 'DI', _L: 'L2', _B: 'B', _K: 'K2', _S: 'S2', _T: 'T2', _LL0: 'LL02', _LLn: 'LLn2', _UD: 'custom2'} self.sr.active_stator = self.sr.name_to_stator(_bottom_dictionary[ _STATORS[self._bottom_combo.get_active(...
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
self._top_combo = _combo_factory(_SLIDES, _C, _('slides'), self._top_combo_cb,
self._slide_combo = _combo_factory(_SLIDES, _C, _('slides'), self._slide_combo_cb,
def _setup_toolbars(self, have_toolbox): """ Setup the toolbars.. """
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
self._bottom_combo = _combo_factory(_STATORS, _D, _('stators'), self._bottom_combo_cb, project_toolbar)
self._stator_combo = _combo_factory(_STATORS, _D, _('stators'), self._stator_combo_cb, project_toolbar)
def _setup_toolbars(self, have_toolbox): """ Setup the toolbars.. """
53eee49e3fcce38adf97e3dc8198346f709dc071 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/53eee49e3fcce38adf97e3dc8198346f709dc071/SlideruleActivity.py
list = self.list
list = self.list[:]
def find_sprite(self, pos): list = self.list list.reverse() for spr in list: if spr.hit(pos): return spr return None
bf7d05037cefad8ad269031c1ea652b064248610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/bf7d05037cefad8ad269031c1ea652b064248610/sprites.py
if self.sr.last is None and self.sr.last.labels[0] is not None:
if self.sr.last is not None and self.sr.last.labels[0] is not None:
def _copy_cb(self, arg=None): """ Copy a number to the clipboard from the active slide. """ clipBoard = gtk.Clipboard() if self.sr.last is None and self.sr.last.labels[0] is not None: clipBoard.set_text(self.sr.last.labels[0]) return
a9282caa89f1ed03c975efcd6ca3252137e15eb3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/a9282caa89f1ed03c975efcd6ca3252137e15eb3/SlideruleActivity.py
self.parent._min_entry.set_text('NaN')
self.parent._domain_min[slide].set_text('NaN')
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text, slide): """ Create custom slide and stator from text entered on toolbar. """ try: min_value = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max_value = float(max_text) except Value...
210956a4f314b89412965b07cc044540be7a9165 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/210956a4f314b89412965b07cc044540be7a9165/window.py
self.parent._max_entry.set_text('NaN')
self.parent._domain_max[slide].set_text('NaN')
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text, slide): """ Create custom slide and stator from text entered on toolbar. """ try: min_value = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max_value = float(max_text) except Value...
210956a4f314b89412965b07cc044540be7a9165 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/210956a4f314b89412965b07cc044540be7a9165/window.py
self.parent._step_entry.set_text('NaN')
self.parent._step_size[slide].set_text('NaN')
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text, slide): """ Create custom slide and stator from text entered on toolbar. """ try: min_value = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max_value = float(max_text) except Value...
210956a4f314b89412965b07cc044540be7a9165 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/210956a4f314b89412965b07cc044540be7a9165/window.py
scale *= float(SWIDTH - 2 * OFFSET) / SCALE
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET
log = (log10 - offset) * SCALE * scale + OFFSET else: log = offset * SCALE * scale + OFFSET
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
svg += ' x="%0.2f"\n' % (ln)
svg += ' x="%0.2f"\n' % (log)
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
svg += ' d="M %0.2f,%d,%0.2f,%d"\n' % (ln, height1, ln, height2)
svg += ' d="M %0.2f,%d,%0.2f,%d"\n' % (log, height1, log, height2)
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
scale *= float(SWIDTH - 2 * OFFSET) / SCALE
def special_mark(self, offset, height3, height2, height1, string, flip=False, scale=1.0): """ Plot special marks, e.g., e and pi """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET svg += ' <text style="font-size:12...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET
log = (log10 - offset) * SCALE * scale + OFFSET else: log = offset * SCALE * scale + OFFSET
def special_mark(self, offset, height3, height2, height1, string, flip=False, scale=1.0): """ Plot special marks, e.g., e and pi """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET svg += ' <text style="font-size:12...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
svg += ' x="%0.2f"\n' % (ln)
svg += ' x="%0.2f"\n' % (log)
def special_mark(self, offset, height3, height2, height1, string, flip=False, scale=1.0): """ Plot special marks, e.g., e and pi """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET svg += ' <text style="font-size:12...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
svg += ' d="M %0.2f,%d,%0.2f,%d"\n' % (ln, height1, ln, height2)
svg += ' d="M %0.2f,%d,%0.2f,%d"\n' % (log, height1, log, height2)
def special_mark(self, offset, height3, height2, height1, string, flip=False, scale=1.0): """ Plot special marks, e.g., e and pi """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET svg += ' <text style="font-size:12...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
scale *= float(SWIDTH - 2 * OFFSET) / SCALE
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
scale *= float(SWIDTH - 2 * OFFSET) / SCALE
def mark(self, offset, height3, height2, height1, string=None, flip=False, scale=1.0): """ Plot marks in a range from 1 to 10 along the length of the slide """ svg = '' scale *= float(SWIDTH - 2 * OFFSET) / SCALE if flip: ln = (log10 - offset) * SCALE * scale + OFFSET else: ln = offset * SCALE * scale + OFFSET if strin...
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
return math.exp(x / 1000.)
return math.pow(10, x / 1000.)
def label_function(x): return math.exp(x / 1000.)
165ca7c39e7dc341d61764ed36821e9d89caebd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/165ca7c39e7dc341d61764ed36821e9d89caebd7/genslides.py
y = math.pow(10, precision)
y = pow(10, precision)
def round(x, precision=2): if precision == 2: return(float(int(x * 100 + 0.5) / 100.)) elif precision == 1: return(float(int(x * 10 + 0.5) / 10.)) elif precision == 0: return(int(x + 0.5)) else: y = math.pow(10, precision) return(float(int(x * y + 0.5) / y))
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
return round(math.exp(dx / SCALE) * rescale)
return round(exp(dx / SCALE) * rescale)
def _calc_log(dx): """ C and D scales """ rescale = 1 if dx < 0: rescale = 0.1 dx += SWIDTH - (2.0 * OFFSET) return round(math.exp(dx / SCALE) * rescale)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
return round(10.0/ math.exp(dx / SCALE) * rescale)
return round(10.0 / exp(dx / SCALE) * rescale)
def _calc_inverse_log(dx): """ CI and DI scales """ rescale = 1 if dx < 0: rescale = 0.1 dx += SWIDTH - (2.0 * OFFSET) return round(10.0/ math.exp(dx / SCALE) * rescale)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
A = math.exp(2 * dx / SCALE) * rescale
A = exp(2 * dx / SCALE) * rescale
def _calc_log_squared(dx): """ A and B scales """ rescale = 1 if dx < 0: dx += SWIDTH - (2.0 * OFFSET) rescale = 0.01 A = math.exp(2 * dx / SCALE) * rescale if A > 50: return round(A, 1) else: return round(A)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
K = math.exp(3 * dx / SCALE) * rescale
K = exp(3 * dx / SCALE) * rescale
def _calc_log_cubed(dx): """ K scale """ rescale = 1 if dx < 0: rescale = 0.001 dx += SWIDTH - (2.0 * OFFSET) K = math.exp(3 * dx / SCALE) * rescale if K > 500: return round(K, 0) elif K > 50: return round(K, 1) else: return round(K)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
LL0 = math.exp(math.exp(dx / SCALE) / 1000)
LL0 = exp(exp(dx / SCALE) / 1000)
def _calc_log_log(dx): """ LL0 scale """ if dx < 0: dx += SWIDTH - (2.0 * OFFSET) LL0 = math.exp(math.exp(dx / SCALE) / 1000) if LL0 > 1.002: return round(LL0, 5) else: return round(LL0, 6)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
return round(10 * ((dx / SCALE) / math.log(10) - 1.0))
return round(10 * ((dx / SCALE) / log(10) - 1.0))
def _calc_linear(dx): """ L scale """ if dx < 0: dx += SWIDTH - (2.0 * OFFSET) return round(10 * ((dx / SCALE) / math.log(10) - 1.0)) else: return round(10 * (dx / SCALE) / math.log(10))
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
return round(10 * (dx / SCALE) / math.log(10))
return round(10 * (dx / SCALE) / log(10))
def _calc_linear(dx): """ L scale """ if dx < 0: dx += SWIDTH - (2.0 * OFFSET) return round(10 * ((dx / SCALE) / math.log(10) - 1.0)) else: return round(10 * (dx / SCALE) / math.log(10))
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
s = math.exp(dx)/10
s = exp(dx)/10
def _calc_sine(dx): """ S scale """ dx /= SCALE s = math.exp(dx)/10 if s > 1.0: s = 1.0 S = 180.0 * math.asin(s) / math.pi if S > 60: return round(S, 1) else: return round(S)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
S = 180.0 * math.asin(s) / math.pi
S = 180.0 * asin(s) / pi
def _calc_sine(dx): """ S scale """ dx /= SCALE s = math.exp(dx)/10 if s > 1.0: s = 1.0 S = 180.0 * math.asin(s) / math.pi if S > 60: return round(S, 1) else: return round(S)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
t = math.exp(dx)/10
t = exp(dx)/10
def _calc_tangent(dx): """ T scale """ dx /= SCALE t = math.exp(dx)/10 if t > 1.0: t = 1.0 return round(180.0 * math.atan(t) / math.pi)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
return round(180.0 * math.atan(t) / math.pi)
return round(180.0 * atan(t) / pi)
def _calc_tangent(dx): """ T scale """ dx /= SCALE t = math.exp(dx)/10 if t > 1.0: t = 1.0 return round(180.0 * math.atan(t) / math.pi)
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
600, SHEIGHT)
800, SHEIGHT)
def __init__(self, canvas, path, parent=None): """ Handle launch from both within and without of Sugar environment. """ SLIDES = {'C':[C_slide, self._calc_C], 'CI':[CI_slide, self._calc_CI], 'A':[A_slide, self._calc_A], 'K':[K_slide, self._calc_K], 'S':[S_slide, self._calc_S], 'T':[T_slide, self._calc_T], 'L':[L_slide,...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
self.make_custom_slide('math.log(x, 10)', 'x', 'math.exp(x)', 1, 10, 1)
self.make_custom_slide('log(x, 10)', 'x', 'exp(x)', 1, 10, 1)
def __init__(self, canvas, path, parent=None): """ Handle launch from both within and without of Sugar environment. """ SLIDES = {'C':[C_slide, self._calc_C], 'CI':[CI_slide, self._calc_CI], 'A':[A_slide, self._calc_A], 'K':[K_slide, self._calc_K], 'S':[S_slide, self._calc_S], 'T':[T_slide, self._calc_T], 'L':[L_slide,...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
if k == 'a':
if k in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'period', 'minus', 'Return', 'BackSpace']: if self.reticule.match(self.last): if self.last == self.reticule.tabs[TOP].spr: self._process_numeric_input(self.last, k) elif k == 'a':
def _keypress_cb(self, area, event): """ Keypress: moving the slides with the arrow keys """ k = gtk.gdk.keyval_name(event.keyval) if self.parent == None: return if k == 'a': self.parent.show_a() elif k == 'k': self.parent.show_k() elif k == 'c' or k == 'asterisk' or k == 'x': self.parent.show_c() elif k == 'i': self.p...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
elif k == 'Left' or k == 'comma': self._move_slides(self.last, -1) elif k == 'Right' or k == 'period': self._move_slides(self.last, 1) elif k == 'Home' or k == 'Pause':
elif k == 'Left' or k == 'less': if self.last is not None: self._move_slides(self.last, -1) elif k == 'Right' or k == 'greater': if self.last is not None: self._move_slides(self.last, 1) elif k == 'Home' or k == 'Pause' or k == 'Up':
def _keypress_cb(self, area, event): """ Keypress: moving the slides with the arrow keys """ k = gtk.gdk.keyval_name(event.keyval) if self.parent == None: return if k == 'a': self.parent.show_a() elif k == 'k': self.parent.show_k() elif k == 'c' or k == 'asterisk' or k == 'x': self.parent.show_c() elif k == 'i': self.p...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
elif k == 'Return' or k == 'BackSpace':
elif k == 'Down':
def _keypress_cb(self, area, event): """ Keypress: moving the slides with the arrow keys """ k = gtk.gdk.keyval_name(event.keyval) if self.parent == None: return if k == 'a': self.parent.show_a() elif k == 'k': self.parent.show_k() elif k == 'c' or k == 'asterisk' or k == 'x': self.parent.show_c() elif k == 'i': self.p...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
min = float(min_text)
min_value = float(min_text)
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text): """ Create custom slide and stator from text entered on toolbar. """ try: min = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max = float(max_text) except ValueError: self.parent....
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
max = float(max_text)
max_value = float(max_text)
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text): """ Create custom slide and stator from text entered on toolbar. """ try: min = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max = float(max_text) except ValueError: self.parent....
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
step = float(step_text)
step_value = float(step_text)
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text): """ Create custom slide and stator from text entered on toolbar. """ try: min = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max = float(max_text) except ValueError: self.parent....
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
def make_custom_slide(self, offset_text, label_text, calculate_text, min_text, max_text, step_text): """ Create custom slide and stator from text entered on toolbar. """ try: min = float(min_text) except ValueError: self.parent._min_entry.set_text('NaN') return try: max = float(max_text) except ValueError: self.parent....
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
self._calc_custom, custom_offset_function, custom_label_function, min, max, step)
self._calc_custom, custom_offset_function, custom_label_function, min_value, max_value, step_value)
myf = "def f(x): return " + label_text.replace('import','')
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
custom_label_function, min, max, step)
custom_label_function, min_value, max_value, step_value)
myf = "def f(x): return " + label_text.replace('import','')
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
v_right = round(math.log(10)) + v_left
v_right = round(log(10)) + v_left
def _update_top(self, function): v_left = function() if self.active_stator.name == 'L2': v_right = 10 + v_left elif self.active_stator.name == 'D': v_right = v_left * 10. elif self.active_stator.name == 'B': v_right = v_left * 100. elif self.active_stator.name == 'K2': v_right = v_left * 1000. elif self.active_stator.n...
5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py
'ch': { 'title': u'中文 - 0%' },
def header(): c.slackslog = request.POST if ('submit' in request.POST and request.POST['submit'] == _gettext('Search')): redirect( url( controller = 'root', action = 'template', templatefile = 'docs', parameter1 = request.POST['search'].replace(' ', '').lower() ), code = 303 ) c.loop.languages = { 'ch': { 'title': u'中文...
e895cad39f226d654d39c307e9c4c45c3dd587dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/e895cad39f226d654d39c307e9c4c45c3dd587dd/helpers.py
}, 'pl': { 'title': u'Polski - 0%'
def header(): c.slackslog = request.POST if ('submit' in request.POST and request.POST['submit'] == _gettext('Search')): redirect( url( controller = 'root', action = 'template', templatefile = 'docs', parameter1 = request.POST['search'].replace(' ', '').lower() ), code = 303 ) c.loop.languages = { 'ch': { 'title': u'中文...
e895cad39f226d654d39c307e9c4c45c3dd587dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/e895cad39f226d654d39c307e9c4c45c3dd587dd/helpers.py
return escape(json.dumps(string, sort_keys=True, indent=4))
return json.dumps(string, sort_keys=True, indent=4)
def format(string): string = templating.getvariable(string, '.', c) return escape(json.dumps(string, sort_keys=True, indent=4))
ed01c5746b0005295e87f85be22e9bcf625d4d01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/ed01c5746b0005295e87f85be22e9bcf625d4d01/helpers.py
}, { 'title': 'try', 'url': 'try' }, { 'title': 'return', 'url': 'return' }, { 'title': 'trim', 'url': 'trim'
def docs(): c.loop.articles = [ { 'articles': [ { 'title': 'Getting Started', 'url': 'gettingstarted' }, { 'title': 'Comparison of SUIT to its Alternatives', 'url': 'comparison' }, { 'title': 'Features', 'url': 'features' }, { 'title': 'Reading Docs', 'url': 'readingdocs' }, { 'title': 'Rules', 'url': 'rules' }, { 'tit...
5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e/helpers.py
'articles': [],
'articles': [ { 'title': 'b', 'url': 'b' }, { 'title': 'i', 'url': 'i' }, { 'title': 'u', 'url': 'u' }, { 'title': 's', 'url': 's' }, { 'title': 'url (BBCode Rule)', 'url': 'urlbbcoderule' }, { 'title': 'email', 'url': 'email' }, { 'title': 'img', 'url': 'img' }, { 'title': 'size', 'url': 'size' }, { 'title': 'font', '...
def docs(): c.loop.articles = [ { 'articles': [ { 'title': 'Getting Started', 'url': 'gettingstarted' }, { 'title': 'Comparison of SUIT to its Alternatives', 'url': 'comparison' }, { 'title': 'Features', 'url': 'features' }, { 'title': 'Reading Docs', 'url': 'readingdocs' }, { 'title': 'Rules', 'url': 'rules' }, { 'tit...
5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e/helpers.py
'articles': [], 'title': 'Helper Functions', 'url': 'helperfunctions' }, {
def docs(): c.loop.articles = [ { 'articles': [ { 'title': 'Getting Started', 'url': 'gettingstarted' }, { 'title': 'Comparison of SUIT to its Alternatives', 'url': 'comparison' }, { 'title': 'Features', 'url': 'features' }, { 'title': 'Reading Docs', 'url': 'readingdocs' }, { 'title': 'Rules', 'url': 'rules' }, { 'tit...
5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/858/5210c7fde85c51fd0c8c8142cd3dd35de7c9f48e/helpers.py
blockconf = IBlockConfig(self.context) self.image_layout = blockconf.image_layout
self.blockconf = IBlockConfig(self.context) self.image_layout = self.blockconf.image_layout
def __init__(self, context, request): super(BlockView, self).__init__(context, request) self.portal_state = getMultiAdapter((self.context, self.request), name=u'plone_portal_state') self.sl_portal_url = self.portal_state.portal_url() blockconf = IBlockConfig(self.context) self.image_layout = blockconf.image_layout
e900aca84a59e23c89a17d0ea148eb460945c64c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10241/e900aca84a59e23c89a17d0ea148eb460945c64c/views.py
blockconf = IBlockConfig(self.context) return blockconf.block_height or ''
height = self.blockconf.block_height return height and '%spx' % height or ''
def getBlockHeight(self): blockconf = IBlockConfig(self.context) return blockconf.block_height or ''
e900aca84a59e23c89a17d0ea148eb460945c64c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10241/e900aca84a59e23c89a17d0ea148eb460945c64c/views.py
def image_wrapper_style(self): """ sets width of the div wrapping the image, so the caption linebreaks """ blockconf = IBlockConfig(self.context) width, height = blockconf.image_dimension return "width: %spx" % width
def getImageTag(self): alt = unicode(self.context.getImageAltText(), self.context.getCharset()) title = unicode(self.context.getImageCaption(), self.context.getCharset())
2a3e432e4ecce93d5ff9b2d221f0b87974995276 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10241/2a3e432e4ecce93d5ff9b2d221f0b87974995276/views.py
return '%s: %s' % (title, shorten_line(message))
return _("%(title)s: %(message)s", title=title, message=shorten_line(message))
def render_timeline_event(self, context, field, event): changesets, show_location, show_files = event[3] cset, cset_resource, repos_for_uid = changesets[0] message = cset.message or '' reponame = cset_resource.parent.id rev_b, rev_a = cset.rev, cset.rev #? FIXME
a7acab36c48ad3de683bcc5366929be4028b9b7e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/a7acab36c48ad3de683bcc5366929be4028b9b7e/changeset.py
margin, id and usemap * `border` and `margin` can only be a number
margin, margin-(left,right,top,bottom), id and usemap * `border`, `margin`, and `margin-`* can only be a single number
def expand_macro(self, formatter, name, content): min_depth, max_depth = 1, 6 title = None inline = 0 if content: argv = [arg.strip() for arg in content.split(',')] if len(argv) > 0: depth = argv[0] if '-' in depth: min_depth, max_depth = [int(d) for d in depth.split('-', 1)] else: min_depth = max_depth = int(depth) if...
8ff8254fd0fea71073c407dc62d6a83285e22d31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/8ff8254fd0fea71073c407dc62d6a83285e22d31/macros.py
attr_re = re.compile('(align|valign|border|margin|width|height|alt'
attr_re = re.compile('(align|valign|border|width|height|alt' '|margin(?:-(?:left|right|top|bottom))?'
def expand_macro(self, formatter, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args.pop(0)
8ff8254fd0fea71073c407dc62d6a83285e22d31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/8ff8254fd0fea71073c407dc62d6a83285e22d31/macros.py
elif key == 'margin' and 'margin-left' not in style: style['margin'] = ' %dpx' % int(val)
elif key in ('margin-top', 'margin-bottom'): style[key] = ' %dpx' % int(val) elif key in ('margin', 'margin-left', 'margin-right') \ and 'display' not in style: style[key] = ' %dpx' % int(val)
def expand_macro(self, formatter, name, content): # args will be null if the macro is called without parenthesis. if not content: return '' # parse arguments # we expect the 1st argument to be a filename (filespec) args = content.split(',') if len(args) == 0: raise Exception("No argument.") filespec = args.pop(0)
8ff8254fd0fea71073c407dc62d6a83285e22d31 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/8ff8254fd0fea71073c407dc62d6a83285e22d31/macros.py
if 'error' in e.reason.lower():
if title.lower() in e.reason.lower():
def _dispatch_request(req, env, env_error): resp = [] # fixup env.abs_href if `[trac] base_url` was not specified if env and not env.abs_href.base: env._abs_href = req.abs_href try: if not env and env_error: raise HTTPInternalError(env_error) try: dispatcher = RequestDispatcher(env) dispatcher.dispatch(req) except Re...
661f6c1b61cc51319666032248bd1b2ed84e323a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/661f6c1b61cc51319666032248bd1b2ed84e323a/main.py
control.append(tag_('to %(owner)s ', owner=owners[0]))
owner = tag.input(type='hidden', id=id, name=id, value=owners[0]) control.append(tag_('to %(owner)s ', owner=tag(owners[0], owner)))
def render_ticket_action_control(self, req, ticket, action):
1cea85eb245d59928a5905da8919ef7ae8775793 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/1cea85eb245d59928a5905da8919ef7ae8775793/default_workflow.py
cursor = db.cursor()
def _sync(self, reponame, rev, clean): rm = RepositoryManager(self.env) if reponame == '*': if rev is not None: raise TracError(_('Cannot synchronize a single revision ' 'on multiple repositories')) repositories = rm.get_real_repositories() else: if is_default(reponame): reponame = '' repos = rm.get_repository(reponame...
f8ca175526ffc64392028800657e11a151fbf641 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/f8ca175526ffc64392028800657e11a151fbf641/admin.py
if True not in [issubclass(x, ComponentManager) for x in bases]: init = d.get('__init__') if not init: for init in [b.__init__._original for b in new_class.mro() if issubclass(b, Component) and '__init__' in b.__dict__]: break def maybe_init(self, compmgr, init=init, cls=new_class): if cls not in compmgr.componen...
def __new__(mcs, name, bases, d): """Create the component class."""
d540f2e8f30786db68aa5ed51e50a2a373209c55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/d540f2e8f30786db68aa5ed51e50a2a373209c55/core.py
def __new__(cls, *args, **kwargs): """Return an existing instance of the component if it has already been activated, otherwise create a new instance. """ if issubclass(cls, ComponentManager): self = super(Component, cls).__new__(cls) self.compmgr = self return self compmgr = args[0] self = compmgr.components.get(cl...
def maybe_init(self, compmgr, init=init, cls=new_class): if cls not in compmgr.components: compmgr.components[cls] = self if init: try: init(self) except: del compmgr.components[cls] raise
d540f2e8f30786db68aa5ed51e50a2a373209c55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/d540f2e8f30786db68aa5ed51e50a2a373209c55/core.py
authenticated = x < 10
authenticated = int(x < 10)
def _prep_session_table(db, spread_visits=False): """ Populate the session table with known values. Return a tuple of lists: (auth_list, anon_list, all_list) """ cursor = db.cursor() cursor.execute("DELETE FROM session") cursor.execute("DELETE FROM session_attribute") last_visit_base = time.mktime(datetime(2010, 1, 1)...
e733b0b0f7984cc41da842d42ecca46063d4aede /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/e733b0b0f7984cc41da842d42ecca46063d4aede/session.py
youngest = repos.get_changeset(repos.youngest_rev)
try: youngest = repos.get_changeset(repos.youngest_rev) except NoSuchChangeset: youngest = None
def _render_repository_index(self, context, all_repositories, order, desc): # Color scale for the age column timerange = custom_colorizer = None if self.color_scale: custom_colorizer = self.get_custom_colorizer()
ff7b0c11f133725cdf79df0d1864a420f0dd28b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ff7b0c11f133725cdf79df0d1864a420f0dd28b8/browser.py
entry = (reponame, repoinfo, None, None, "XXX")
entry = (reponame, repoinfo, None, None, u"\u2013")
def _render_repository_index(self, context, all_repositories, order, desc): # Color scale for the age column timerange = custom_colorizer = None if self.color_scale: custom_colorizer = self.get_custom_colorizer()
ff7b0c11f133725cdf79df0d1864a420f0dd28b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ff7b0c11f133725cdf79df0d1864a420f0dd28b8/browser.py
return youngest and youngest.date
return (youngest and youngest.date or to_datetime(0), embedded_numbers(reponame.lower())) elif order == 'author': def repo_order((reponame, repoinfo, repos, youngest, err)): return (youngest and youngest.author.lower() or '', embedded_numbers(reponame.lower()))
def repo_order((reponame, repoinfo, repos, youngest, err)): return youngest and youngest.date
ff7b0c11f133725cdf79df0d1864a420f0dd28b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ff7b0c11f133725cdf79df0d1864a420f0dd28b8/browser.py
return changes[a.rev].date
return (changes[a.rev].date, embedded_numbers(a.name.lower()))
def file_order(a): return changes[a.rev].date
ff7b0c11f133725cdf79df0d1864a420f0dd28b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ff7b0c11f133725cdf79df0d1864a420f0dd28b8/browser.py
return changes[a.rev].author.lower()
return (changes[a.rev].author.lower(), embedded_numbers(a.name.lower()))
def file_order(a): return changes[a.rev].author.lower()
ff7b0c11f133725cdf79df0d1864a420f0dd28b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/ff7b0c11f133725cdf79df0d1864a420f0dd28b8/browser.py
for key in ('type', 'label', 'options')
for key in ('type', 'label', 'options', 'optgroups')
def display_html(self, req, query): db = self.env.get_db_cnx()
dcc39d94d6888fdd9211067ddf3b07ec722cbdc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/dcc39d94d6888fdd9211067ddf3b07ec722cbdc8/query.py
def __init__(self, input, correct, file, line, setup=None, teardown=None, context=None):
def __init__(self, title, input, correct, file, line, setup=None, teardown=None, context=None):
def __init__(self, input, correct, file, line, setup=None, teardown=None, context=None): unittest.TestCase.__init__(self, 'test') self.title, self.input = input.split('\n', 1) if self.title: self.title = self.title.strip() self.correct = correct self.file = file self.line = line self._setup = setup self._teardown = tea...
6648663ff7931a79e9e83e80dd03f1448d2d7676 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6648663ff7931a79e9e83e80dd03f1448d2d7676/formatter.py
self.title, self.input = input.split('\n', 1) if self.title: self.title = self.title.strip()
self.title = title self.input = input
def __init__(self, input, correct, file, line, setup=None, teardown=None, context=None): unittest.TestCase.__init__(self, 'test') self.title, self.input = input.split('\n', 1) if self.title: self.title = self.title.strip() self.correct = correct self.file = file self.line = line self._setup = setup self._teardown = tea...
6648663ff7931a79e9e83e80dd03f1448d2d7676 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6648663ff7931a79e9e83e80dd03f1448d2d7676/formatter.py
import re
def test(self): """Testing WikiFormatter""" formatter = self.formatter() v = unicode(formatter.generate(**self.generate_opts)).replace('\r','') try: self.assertEquals(self.correct, v) except AssertionError, e: msg = to_unicode(e) import re match = re.match(r"u?'(.*)' != u?'(.*)'", msg) if match: g1 = ["%s\n" % x for x ...
6648663ff7931a79e9e83e80dd03f1448d2d7676 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6648663ff7931a79e9e83e80dd03f1448d2d7676/formatter.py
if not data: file = os.path.join(os.path.split(file)[0], 'wiki-tests.txt') data = open(file, 'r').read().decode('utf-8') tests = data.split('=' * 30) next_line = 1 line = 0 for test in tests: if line != next_line: line = next_line if not test or test == '\n': continue next_line += len(test.split('\n')) - 1 blocks = tes...
def add_test_cases(data, filename): tests = re.compile('^(%s.*)$' % ('=' * 30), re.MULTILINE).split(data) next_line = 1 line = 0 for title, test in zip(tests[1::2], tests[2::2]): title = title.lstrip('=').strip() if line != next_line: line = next_line if not test or test == '\n': continue next_line += len(test.split('\...
def suite(data=None, setup=None, file=__file__, teardown=None, context=None): suite = unittest.TestSuite() if not data: file = os.path.join(os.path.split(file)[0], 'wiki-tests.txt') data = open(file, 'r').read().decode('utf-8') tests = data.split('=' * 30) next_line = 1 line = 0 for test in tests: if line != next_line:...
6648663ff7931a79e9e83e80dd03f1448d2d7676 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/6648663ff7931a79e9e83e80dd03f1448d2d7676/formatter.py
def open_environment(env_path=None, use_cache=False): """Open an existing environment object, and verify that the database is up to date. :param env_path: absolute path to the environment directory; if ommitted, the value of the `TRAC_ENV` environment variable is used :param use_cache: whether the environment should b...
448b8864b6b15d45425b866c318e6592f82275d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/448b8864b6b15d45425b866c318e6592f82275d1/env.py
def open_environment(env_path=None, use_cache=False): """Open an existing environment object, and verify that the database is up to date. :param env_path: absolute path to the environment directory; if ommitted, the value of the `TRAC_ENV` environment variable is used :param use_cache: whether the environment should b...
448b8864b6b15d45425b866c318e6592f82275d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/448b8864b6b15d45425b866c318e6592f82275d1/env.py