rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if (self.use_verbatim_for_literal): self.body.append('\\end{verbatim}\n') else: | if not self.use_verbatim_for_literal: | def depart_literal_block(self, node): if (self.use_verbatim_for_literal): self.body.append('\\end{verbatim}\n') else: self.body.append('}\n') | 31085edde97ab1a6fc3459ff3047d6906a3e97a9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/31085edde97ab1a6fc3459ff3047d6906a3e97a9/latex2e.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
13107,
67,
2629,
12,
2890,
16,
756,
4672,
309,
486,
365,
18,
1202,
67,
16629,
22204,
67,
1884,
67,
13107,
30,
365,
18,
3432,
18,
6923,
2668,
6280,
82,
6134,
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,
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,
26000,
67,
13107,
67,
2629,
12,
2890,
16,
756,
4672,
309,
486,
365,
18,
1202,
67,
16629,
22204,
67,
1884,
67,
13107,
30,
365,
18,
3432,
18,
6923,
2668,
6280,
82,
6134,
2,
-100,
-100,
... |
self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) | self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) | def __init__(self, parent, add_watch, is_local, name, dict=None): wxListCtrl.__init__(self, parent, wxID_NSVIEW, style = wxLC_REPORT | wxLC_SINGLE_SEL ) self.InsertColumn(0, 'Attribute', wxLIST_FORMAT_LEFT, 125) self.InsertColumn(1, 'Value', wxLIST_FORMAT_LEFT, 200) | 872f754eafee36b7b9b20954604570707e5cd36c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/872f754eafee36b7b9b20954604570707e5cd36c/Debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
527,
67,
7585,
16,
353,
67,
3729,
16,
508,
16,
2065,
33,
7036,
4672,
7075,
682,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
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,
1001,
2738,
972,
12,
2890,
16,
982,
16,
527,
67,
7585,
16,
353,
67,
3729,
16,
508,
16,
2065,
33,
7036,
4672,
7075,
682,
12418,
16186,
2738,
972,
12,
2890,
16,
982,
16,
7075,
734,
67,... |
self._send_csv(req, ['report', 'title'], rows, '\t', mimetype='text/tab-separated-values', | self._send_csv(req, ['report', 'title', 'description'], rows, '\t', mimetype='text/tab-separated-values', | def _render_list(self, req): """Render the list of available reports.""" sort = req.args.get('sort', 'report') asc = bool(int(req.args.get('asc', 1))) format = req.args.get('format') rows = self.env.db_query(""" SELECT id, title, description FROM report ORDER BY %s %s """ % ('title' if sort == 'title' else 'id', '' if asc else 'DESC')) if format == 'rss': data = {'rows': rows} return 'report_list.rss', data, 'application/rss+xml' elif format == 'csv': self._send_csv(req, ['report', 'title'], rows, mimetype='text/csv', filename='reports.csv') elif format == 'tab': self._send_csv(req, ['report', 'title'], rows, '\t', mimetype='text/tab-separated-values', filename='reports.tsv') | 965aa9542c451c320b30297bce32a7152055fc02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/965aa9542c451c320b30297bce32a7152055fc02/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1098,
12,
2890,
16,
1111,
4672,
3536,
3420,
326,
666,
434,
2319,
10557,
12123,
1524,
273,
1111,
18,
1968,
18,
588,
2668,
3804,
2187,
296,
6006,
6134,
6972,
273,
1426,
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,
389,
5902,
67,
1098,
12,
2890,
16,
1111,
4672,
3536,
3420,
326,
666,
434,
2319,
10557,
12123,
1524,
273,
1111,
18,
1968,
18,
588,
2668,
3804,
2187,
296,
6006,
6134,
6972,
273,
1426,
12,
... |
sys.stderr.write('\n> File to upload: ') | sys.stderr.write('\n--- File to upload: ') | def writer(self): """loop and copy console->serial until EXITCHARCTER character is found. when MENUCHARACTER is found, interpret the next key locally. """ menu_active = False try: while self.alive: try: c = console.getkey() except KeyboardInterrupt: c = '\x03' if menu_active: if c == MENUCHARACTER or c == EXITCHARCTER: # Menu character again/exit char -> send itself self.serial.write(c) # send character if self.echo: sys.stdout.write(c) elif c == '\x15': # CTRL+U -> upload file sys.stderr.write('\n> File to upload: ') sys.stderr.flush() console.cleanup() filename = sys.stdin.readline().rstrip('\r\n') if filename: try: file = open(filename, 'r') sys.stderr.write('> Sending file %s ' % filename) while True: line = file.readline().rstrip('\r\n') if not line: break self.serial.write(line) self.serial.write('\r\n') # Wait for output buffer to drain. self.serial.flush() sys.stderr.write('.') # Progress indicator. sys.stderr.write('\n> File %s sent.\n' % filename) except IOError, e: sys.stderr.write('> Error opening file %s: %s\n' % (filename, e)) console.setup() elif c in '\x08hH?': # CTRL+H, h, H, ? -> Show help sys.stderr.write(get_help_text()) elif c == '\x12': # CTRL+R -> Toggle RTS self.rts_state = not self.rts_state self.serial.setRTS(self.rts_state) sys.stderr.write('<RTS %s>' % (self.rts_state and 'active' or 'inactive')) elif c == '\x04': # CTRL+D -> Toggle DTR self.dtr_state = not self.dtr_state self.serial.setDTR(self.dtr_state) sys.stderr.write('<DTR %s>' % (self.dtr_state and 'active' or 'inactive')) elif c == '\x02': # CTRL+B -> toggle BREAK condition self.break_state = not self.break_state self.serial.setBreak(self.break_state) sys.stderr.write('<BREAK %s>' % (self.break_state and 'active' or 'inactive')) elif c == '\x05': # CTRL+E -> toggle local echo self.echo = not self.echo sys.stderr.write('<local echo %s>' % (self.echo and 'active' or 'inactive')) elif c == '\x09': # CTRL+I -> info self.dump_port_settings() #~ elif c in 'pP': # P -> change port XXX reader thread would exit elif c in 'bB': # B -> change baudrate sys.stderr.write('\n> Baudrate: ') sys.stderr.flush() console.cleanup() backup = self.serial.baudrate try: self.serial.baudrate = int(sys.stdin.readline().strip()) except ValueError, e: sys.stderr.write('\n> Error setting baudrate: %s' % (e,)) self.serial.baudrate = backup console.setup() self.dump_port_settings() elif c == '8': # 8 -> change to 8 bits self.serial.bytesize = serial.EIGHTBITS self.dump_port_settings() elif c == '7': # 7 -> change to 8 bits self.serial.bytesize = serial.SEVENBITS self.dump_port_settings() elif c in 'eE': # E -> change to even parity self.serial.parity = serial.PARITY_EVEN self.dump_port_settings() elif c in 'oO': # O -> change to odd parity self.serial.parity = serial.PARITY_ODD self.dump_port_settings() elif c in 'mM': # M -> change to mark parity self.serial.parity = serial.PARITY_MARK self.dump_port_settings() elif c in 'sS': # S -> change to space parity self.serial.parity = serial.PARITY_SPACE self.dump_port_settings() elif c in 'nN': # N -> change to no parity self.serial.parity = serial.PARITY_NONE self.dump_port_settings() elif c == '1': # 1 -> change to 1 stop bits self.serial.stopbits = serial.STOPBITS_ONE self.dump_port_settings() elif c == '2': # 2 -> change to 2 stop bits self.serial.stopbits = serial.STOPBITS_TWO self.dump_port_settings() elif c == '3': # 3 -> change to 1.5 stop bits self.serial.stopbits = serial.STOPBITS_ONE_POINT_FIVE self.dump_port_settings() elif c in 'xX': # X -> change software flow control self.serial.xonxoff = (c == 'X') self.dump_port_settings() elif c in 'rR': # R -> change hardware flow control self.serial.rtscts = (c == 'R') self.dump_port_settings() else: sys.stderr.write('<unknown menu character %s>' % key_description(c)) menu_active = False elif c == MENUCHARACTER: # next char will be for menu menu_active = True elif c == EXITCHARCTER: self.stop() break # exit app elif c == '\n': self.serial.write(self.newline) # send newline character(s) if self.echo: sys.stdout.write(c) # local echo is a real newline in any case else: self.serial.write(c) # send character if self.echo: sys.stdout.write(c) except: self.alive = False raise | c61cb24df3b85c0b769f2fa31ac2433f3c0e4b39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/c61cb24df3b85c0b769f2fa31ac2433f3c0e4b39/miniterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2633,
12,
2890,
4672,
3536,
6498,
471,
1610,
2983,
2122,
8818,
3180,
28407,
7305,
1268,
654,
3351,
353,
1392,
18,
1347,
490,
1157,
57,
27858,
353,
1392,
16,
10634,
326,
1024,
498,
13760,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2633,
12,
2890,
4672,
3536,
6498,
471,
1610,
2983,
2122,
8818,
3180,
28407,
7305,
1268,
654,
3351,
353,
1392,
18,
1347,
490,
1157,
57,
27858,
353,
1392,
16,
10634,
326,
1024,
498,
13760,
... |
value='1', checked=form_get(request, 'titlesearch'), | value='1', checked=form_get(request, 'titlesearch', escaped=True), | def advanced_ui(macro): """ Returns the code for the advanced search user interface @param macro: current macro instance """ _ = macro._ f = macro.formatter request = macro.request disabledIfMoinSearch = not request.cfg.xapian_search and \ ' disabled="disabled"' or '' search_boxes = ''.join([ f.table_row(1), f.table_cell(1, attrs={'rowspan': '5', 'class': 'searchfor'}), f.text(_('Search for items')), f.table_cell(0), ''.join([''.join([ f.table_row(1), f.table_cell(1), f.text(txt), f.table_cell(0), f.table_cell(1), f.rawHTML(input_field), f.table_cell(0), f.table_row(0), ]) for txt, input_field in ( (_('containing all the following terms'), '<input type="text" name="and_terms" size="30" value="%s">' % (form_get(request, 'and_terms') or form_get(request, 'value'))), (_('containing one or more of the following terms'), '<input type="text" name="or_terms" size="30" value="%s">' % form_get(request, 'or_terms')), (_('not containing the following terms'), '<input type="text" name="not_terms" size="30" value="%s">' % form_get(request, 'not_terms')), #('containing only one of the following terms', # '<input type="text" name="xor_terms" size="30" value="%s">' # % form_get(request, 'xor_terms')), # TODO: dropdown-box? (_('last modified since (e.g. last 2 weeks)'), '<input type="text" name="mtime" size="30" value="%s">' % form_get(request, 'mtime')), )]) ]) # category selection categories = form_get(request, 'categories') c_select = makeSelection('categories', [('', _('any category'))] + [(cat, '%s' % cat) for cat in getCategories(request)], categories, 3, True) # language selection searchedlang = form_get(request, 'language') langs = dict([(lang, lmeta['x-language-in-english']) for lang, lmeta in languages.items()]) userlang = macro.request.lang lang_select = makeSelection('language', [('', _('any language')), (userlang, langs[userlang])] + sorted(langs.items(), key=lambda i: i[1]), searchedlang, 3, True) # mimetype selection mimetype = form_get(request, 'mimetype') mt_select = makeSelection('mimetype', [('', _('any mimetype'))] + [(type, 'all %s files' % type) for type in getMimetypes()] + [(m[1], '*%s - %s' % m) for m in sorted(mimetypes.types_map.items())], mimetype, 3, True) # misc search options (checkboxes) search_options = ''.join([ ''.join([ f.table_row(1), f.table_cell(1, attrs={'class': 'searchfor'}), txt[0], f.table_cell(0), f.table_cell(1, colspan=2), unicode(txt[1]), txt[2], f.table_cell(0), f.table_row(0), ]) for txt in ( (_('Categories'), unicode(c_select), ''), (_('Language'), unicode(lang_select), ''), (_('File Type'), unicode(mt_select), ''), ('', html.INPUT(type='checkbox', name='titlesearch', value='1', checked=form_get(request, 'titlesearch'), id='titlesearch'), '<label for="titlesearch">%s</label>' % _('Search only in titles')), ('', html.INPUT(type='checkbox', name='case', value='1', checked=form_get(request, 'case'), id='case'), '<label for="case">%s</label>' % _('Case-sensitive search')), ('', html.INPUT(type='checkbox', name='excludeunderlay', value='1', checked=form_get(request, 'excludeunderlay'), id='excludeunderlay'), '<label for="excludeunderlay">%s</label>' % _('Exclude underlay')), ('', html.INPUT(type='checkbox', name='nosystemitems', value='1', checked=form_get(request, 'nosystemitems'), id='nosystempages'), '<label for="nosystempages">%s</label>' % _('No system items')), ('', html.INPUT(type='checkbox', name='historysearch', value='1', checked=form_get(request, 'historysearch'), disabled=(not request.cfg.xapian_search or not request.cfg.xapian_index_history), id='historysearch'), '<label for="historysearch">%s</label>' % _('Search in all page revisions')) ) ]) # the dialogue return f.rawHTML('\n'.join([ u'<form method="get" action="%s/%s">' % (macro.request.getScriptname(), wikiutil.quoteWikinameURL(macro.request.formatter.page.page_name)), u'<div>', u'<input type="hidden" name="action" value="fullsearch">', u'<input type="hidden" name="advancedsearch" value="1">', f.table(1, attrs={'tableclass': 'advancedsearch'}), search_boxes, search_options, f.table_row(1), f.table_cell(1, attrs={'class': 'submit', 'colspan': '3'}), u'<input type="submit" value="%s">' % _('Go get it!'), f.table_cell(0), f.table_row(0), f.table(0), u'</div>', u'</form>', ])) | 64bbbaa35e708345ab13c5f9e67c9054fad53cc7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/64bbbaa35e708345ab13c5f9e67c9054fad53cc7/AdvancedSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16111,
67,
4881,
12,
26448,
4672,
3536,
2860,
326,
981,
364,
326,
16111,
1623,
729,
1560,
225,
632,
891,
11522,
30,
783,
11522,
791,
3536,
389,
273,
11522,
6315,
284,
273,
11522,
18,
123... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16111,
67,
4881,
12,
26448,
4672,
3536,
2860,
326,
981,
364,
326,
16111,
1623,
729,
1560,
225,
632,
891,
11522,
30,
783,
11522,
791,
3536,
389,
273,
11522,
6315,
284,
273,
11522,
18,
123... |
except KeyError, why: | except IndexError, why: | def width(self): """Returns the width of the Dataset.""" try: return len(self._data[0]) except KeyError, why: return 0 | ddf4b441b07c1542b1bd44b5db4bb61c5fa79cc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14944/ddf4b441b07c1542b1bd44b5db4bb61c5fa79cc8/core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1835,
12,
2890,
4672,
3536,
1356,
326,
1835,
434,
326,
10778,
12123,
775,
30,
327,
562,
12,
2890,
6315,
892,
63,
20,
5717,
1335,
10195,
16,
11598,
30,
327,
374,
2,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1835,
12,
2890,
4672,
3536,
1356,
326,
1835,
434,
326,
10778,
12123,
775,
30,
327,
562,
12,
2890,
6315,
892,
63,
20,
5717,
1335,
10195,
16,
11598,
30,
327,
374,
2,
-100,
-100,
-100,
-1... |
node = self.optimize_minptrmoves(node) | node = self.optimize_cleanup(node) | def optimize(self, node): node = self.optimize_simpleloop(node) node = self.optimize_minptrmoves(node) node = self.optimize_onceuponatime(node) node = self.optimize_propagate(node) node = self.optimize_simpleloop(node) node = self.optimize_moreloop(node) node = self.optimize_propagate(node) node = self.optimize_stdlib(node) return node | b03aadd5b3cad0ef70b4d2812c22eb9f2db4fcec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2040/b03aadd5b3cad0ef70b4d2812c22eb9f2db4fcec/esotope-bfc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
12,
2890,
16,
756,
4672,
756,
273,
365,
18,
29155,
67,
9812,
412,
24214,
556,
12,
2159,
13,
756,
273,
365,
18,
29155,
67,
16732,
12,
2159,
13,
756,
273,
365,
18,
29155,
67,
82... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10979,
12,
2890,
16,
756,
4672,
756,
273,
365,
18,
29155,
67,
9812,
412,
24214,
556,
12,
2159,
13,
756,
273,
365,
18,
29155,
67,
16732,
12,
2159,
13,
756,
273,
365,
18,
29155,
67,
82... |
self.endtransfer), conn[1]) | self.endtransfer), conn[1]) | def retrfile(self, file, type): import ftplib self.endtransfer() if type in ('d', 'D'): cmd = 'TYPE A'; isdir = 1 else: cmd = 'TYPE ' + type; isdir = 0 try: self.ftp.voidcmd(cmd) except ftplib.all_errors: self.init() self.ftp.voidcmd(cmd) conn = None if file and not isdir: # Use nlst to see if the file exists at all try: self.ftp.nlst(file) except ftplib.error_perm, reason: raise IOError, ('ftp error', reason), sys.exc_info()[2] # Restore the transfer mode! self.ftp.voidcmd(cmd) # Try to retrieve as a file try: cmd = 'RETR ' + file conn = self.ftp.ntransfercmd(cmd) except ftplib.error_perm, reason: if reason[:3] != '550': raise IOError, ('ftp error', reason), sys.exc_info()[2] if not conn: # Set transfer mode to ASCII! self.ftp.voidcmd('TYPE A') # Try a directory listing if file: cmd = 'LIST ' + file else: cmd = 'LIST' conn = self.ftp.ntransfercmd(cmd) self.busy = 1 # Pass back both a suitably decorated object and a retrieval length return (addclosehook(conn[0].makefile('rb'), self.endtransfer), conn[1]) | b49f88bfc122440e6b056b3c051ac3f928a1df92 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b49f88bfc122440e6b056b3c051ac3f928a1df92/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17343,
768,
12,
2890,
16,
585,
16,
618,
4672,
1930,
11038,
6673,
365,
18,
409,
13866,
1435,
309,
618,
316,
7707,
72,
2187,
296,
40,
11,
4672,
1797,
273,
296,
2399,
432,
13506,
9783,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17343,
768,
12,
2890,
16,
585,
16,
618,
4672,
1930,
11038,
6673,
365,
18,
409,
13866,
1435,
309,
618,
316,
7707,
72,
2187,
296,
40,
11,
4672,
1797,
273,
296,
2399,
432,
13506,
9783,
27... |
r.append('<details lang="%s" content="%s"/>' % (l, self.utXmlEncode(selfself.getLocalProperty('details', l)))) | r.append('<details lang="%s" content="%s"/>' % (l, self.utXmlEncode(self.getLocalProperty('details', l)))) | def export_this_body_custom(self): r = [] for l in self.gl_get_languages(): r.append('<location lang="%s" content="%s"/>' % (l, self.utXmlEncode(self.getLocalProperty('location', l)))) r.append('<location_address lang="%s" content="%s"/>' % (l, self.utXmlEncode(self.getLocalProperty('location_address', l)))) r.append('<host lang="%s" content="%s"/>' % (l, self.utXmlEncode(self.getLocalProperty('host', l)))) r.append('<details lang="%s" content="%s"/>' % (l, self.utXmlEncode(selfself.getLocalProperty('details', l)))) return ''.join(r) | d875dce2cd7a36f7f0f4190b4afe0c8794061309 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3287/d875dce2cd7a36f7f0f4190b4afe0c8794061309/NyEvent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2211,
67,
3432,
67,
3662,
12,
2890,
4672,
436,
273,
5378,
364,
328,
316,
365,
18,
7043,
67,
588,
67,
14045,
13332,
436,
18,
6923,
2668,
32,
3562,
3303,
11613,
87,
6,
913,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
2211,
67,
3432,
67,
3662,
12,
2890,
4672,
436,
273,
5378,
364,
328,
316,
365,
18,
7043,
67,
588,
67,
14045,
13332,
436,
18,
6923,
2668,
32,
3562,
3303,
11613,
87,
6,
913,
1... |
return self.cache | return self.output_cache | def get_output_cache(self): return self.cache | a6f51cd0e257501ea4f0864483cd73ad05576b37 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/a6f51cd0e257501ea4f0864483cd73ad05576b37/power.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
67,
2493,
12,
2890,
4672,
327,
365,
18,
2493,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2844,
67,
2493,
12,
2890,
4672,
327,
365,
18,
2493,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
task = get() | ready, task = poll(1.0) if not ready: continue | def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None): assert maxtasks is None or (type(maxtasks) == int and maxtasks > 0) pid = os.getpid() put = outqueue.put get = inqueue.get if hasattr(inqueue, '_writer'): inqueue._writer.close() outqueue._reader.close() if initializer is not None: initializer(*initargs) if SIG_SOFT_TIMEOUT is not None: signal.signal(SIG_SOFT_TIMEOUT, soft_timeout_sighandler) completed = 0 while maxtasks is None or (maxtasks and completed < maxtasks): try: task = get() except (EOFError, IOError): debug('worker got EOFError or IOError -- exiting') break if task is None: debug('worker got sentinel -- exiting') break job, i, func, args, kwds = task put((ACK, (job, i, time.time(), pid))) try: result = (True, func(*args, **kwds)) except Exception, e: result = (False, e) try: put((READY, (job, i, result))) except Exception, exc: wrapped = MaybeEncodingError(exc, result[1]) put((READY, (job, i, (False, wrapped)))) completed += 1 debug('worker exiting after %d tasks' % completed) | e877cad70f3f20a25e8dccb1296602d9f54a0b7c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2024/e877cad70f3f20a25e8dccb1296602d9f54a0b7c/pool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4322,
12,
267,
4000,
16,
596,
4000,
16,
12562,
33,
7036,
16,
1208,
1968,
33,
9334,
943,
9416,
33,
7036,
4672,
1815,
943,
9416,
353,
599,
578,
261,
723,
12,
1896,
9416,
13,
422,
509,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4322,
12,
267,
4000,
16,
596,
4000,
16,
12562,
33,
7036,
16,
1208,
1968,
33,
9334,
943,
9416,
33,
7036,
4672,
1815,
943,
9416,
353,
599,
578,
261,
723,
12,
1896,
9416,
13,
422,
509,
... |
for element in list: | for element in inputlist: | def computeRankForDt(list,threshold): counter = 0 for element in list: if abs(element) > threshold: counter = counter + 1 rank = float(counter) / float(len(list)) return rank | fd13c4566cb6da062a6e5ba73e68bd260af90c85 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/fd13c4566cb6da062a6e5ba73e68bd260af90c85/analyseQscan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
12925,
1290,
19739,
12,
1098,
16,
8699,
4672,
3895,
273,
374,
364,
930,
316,
810,
1098,
30,
309,
2417,
12,
2956,
13,
405,
5573,
30,
3895,
273,
3895,
397,
404,
6171,
273,
1431,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
12925,
1290,
19739,
12,
1098,
16,
8699,
4672,
3895,
273,
374,
364,
930,
316,
810,
1098,
30,
309,
2417,
12,
2956,
13,
405,
5573,
30,
3895,
273,
3895,
397,
404,
6171,
273,
1431,
12... |
l1 = list(conn1,table); l1.sort() l2 = list(conn2,table); l2.sort() | l1, l1_deleted = list(conn1,table); l1.sort() l2, l2_deleted = list(conn2,table) l2.sort() | def compare(conn1, conn2, table): l1 = list(conn1,table); l1.sort() l2 = list(conn2,table); l2.sort() output = [] matcher = difflib.SequenceMatcher(None, l1, l2) for tag, i1, i2, j1, j2 in matcher.get_opcodes(): if tag != "equal": output.append(" %7s l1[%d:%d] (%s) l2[%d:%d] (%s)" % (tag, i1, i2, l1[i1:i2], j1, j2, l2[j1:j2])) if len(output) > 0: print "%s : ================== " % table for l in output: print l | 7409aa2363a1e59aa7e2b3f6a0793241c4f4e71a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/7409aa2363a1e59aa7e2b3f6a0793241c4f4e71a/enums.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
12,
4646,
21,
16,
1487,
22,
16,
1014,
4672,
328,
21,
16,
328,
21,
67,
8600,
273,
666,
12,
4646,
21,
16,
2121,
1769,
328,
21,
18,
3804,
1435,
328,
22,
16,
328,
22,
67,
8600,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
12,
4646,
21,
16,
1487,
22,
16,
1014,
4672,
328,
21,
16,
328,
21,
67,
8600,
273,
666,
12,
4646,
21,
16,
2121,
1769,
328,
21,
18,
3804,
1435,
328,
22,
16,
328,
22,
67,
8600,
... |
bg = (0, 0, 0) | bgtype = 'color' bgcolor1 = bgcolor2 = (0, 0, 0) | def _set_background(self, widget, ccontext = None, bounds = None): 'Set the background of `widget` to `color`.' if not widget.window: return False if ccontext is None: ccontext = widget.window.cairo_create() if bounds is None: bounds = widget.window.get_size() if self._black and widget is self.pres: bg = (0, 0, 0) elif self._logo and widget is self.pres: if not hasattr(self,"_logo_pbuf"): try: self._logo_pbuf = gtk.gdk.pixbuf_new_from_file_at_size( config.get("screen", "logo"), int(bounds[0]/1.5), int(bounds[1]/1.5)) except gobject.GError: print "Error: Could not open logo file." self._logo_pbuf = None bg = c2dec(config.getcolor("screen", "logo_bg")) ccontext.set_source_rgb(bg[0], bg[1], bg[2]) ccontext.paint() if self._logo_pbuf <> None: ccontext.set_source_pixbuf(self._logo_pbuf, (bounds[0]-self._logo_pbuf.get_width())/2,\ (bounds[1]-self._logo_pbuf.get_height())/2) ccontext.paint() return else: bgtype = config.get("screen", "bg_type") bgimage = config.get("screen", "bg_image") bgcolor1 = config.getcolor("screen", "bg_color_1") bgcolor2 = config.getcolor("screen", "bg_color_2") if bgtype == 'image': bgkey = str(bounds[0])+'x'+str(bounds[1]) try: if self.bg_dirty or bgkey not in self.bg_img: pixbuf = gtk.gdk.pixbuf_new_from_file(bgimage) self.bg_img[bgkey] = pixbuf.scale_simple(bounds[0], bounds[1], gtk.gdk.INTERP_BILINEAR) except gobject.GError: print "Error: Could not open background file." if hasattr(self, 'bg_img') and bgkey in self.bg_img: del self.bg_img[bgkey] bg = (0,0,0) #Set back to the default config.setcolor("screen", "bg_color_1", (0, 13107, 19660)) config.setcolor("screen", "bg_color_2", (0, 26214, 39321)) else: ccontext.set_source_pixbuf(self.bg_img[bgkey], 0, 0) ccontext.paint() return finally: self.bg_dirty = False elif bgtype == 'color': color = (c2dec(bgcolor1), c2dec(bgcolor2)) if len(color) >= 3 and isinstance(color[0], (float, int)): # Draw a solid color ccontext.set_source_rgb(color[0], color[1], color[2]) ccontext.paint() elif isinstance(color[0], tuple): # Draw a gradiant if config.get("screen", "bg_angle") == u"\u2193": #Down gr_x1 = gr_y1 = gr_x2 = 0 gr_y2 = bounds[1] elif config.get("screen", "bg_angle") == u'\u2199': #Down-Left gr_x2 = gr_y1 = 0 (gr_x1, gr_y2) = bounds elif config.get("screen", "bg_angle") == u'\u2192': #Right gr_x1 = gr_y1 = gr_y2 = 0 gr_x2 = bounds[0] else: # Down-Right gr_x1 = gr_y1 = 0 (gr_x2, gr_y2) = bounds gradient = cairo.LinearGradient(gr_x1, gr_y1, gr_x2, gr_y2) for i in range(len(color)): gradient.add_color_stop_rgb(1.0*i/(len(color)-1), color[i][0], color[i][1], color[i][2]) ccontext.rectangle(0,0, bounds[0], bounds[1]) ccontext.set_source(gradient) ccontext.fill() else: print "_set_background: Incorrect color" | 8d23729024fa76f4a1017ef684bb5b59fc46d99c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5029/8d23729024fa76f4a1017ef684bb5b59fc46d99c/screen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
9342,
12,
2890,
16,
3604,
16,
276,
2472,
273,
599,
16,
4972,
273,
599,
4672,
296,
694,
326,
5412,
434,
1375,
6587,
68,
358,
1375,
3266,
68,
1093,
309,
486,
3604,
18,
56... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
67,
9342,
12,
2890,
16,
3604,
16,
276,
2472,
273,
599,
16,
4972,
273,
599,
4672,
296,
694,
326,
5412,
434,
1375,
6587,
68,
358,
1375,
3266,
68,
1093,
309,
486,
3604,
18,
56... |
if os.path.exists(fn): | if os.path.lexists(fn): | def _ftype(mode): """ Given a "mode" return the name of the type of file. """ if stat.S_ISREG(mode): return "file" if stat.S_ISDIR(mode): return "directory" if stat.S_ISLNK(mode): return "symlink" if stat.S_ISFIFO(mode): return "fifo" if stat.S_ISCHR(mode): return "character device" if stat.S_ISBLK(mode): return "block device" return "<unknown>" | e52668626f3818e886fa41fbff8f1802b7ae07f1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/e52668626f3818e886fa41fbff8f1802b7ae07f1/packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
74,
723,
12,
3188,
4672,
3536,
16803,
279,
315,
3188,
6,
327,
326,
508,
434,
326,
618,
434,
585,
18,
3536,
309,
610,
18,
55,
67,
5127,
5937,
12,
3188,
4672,
225,
327,
315,
768,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
74,
723,
12,
3188,
4672,
3536,
16803,
279,
315,
3188,
6,
327,
326,
508,
434,
326,
618,
434,
585,
18,
3536,
309,
610,
18,
55,
67,
5127,
5937,
12,
3188,
4672,
225,
327,
315,
768,
... |
return self._proxy.bugzilla.setstatus(id,status, self.user,self.password,comment,private) | return self._proxy.bugzilla.changeStatus(id,status, self.user,self.password,comment,private,private_in_it,nomail) | def _setstatus(self,id,status,comment='',private=False): '''Set the status of the bug with the given ID. You may optionally include a comment to be added, and may further choose to mark that comment as private. The status may be anything from querydefaults['bug_status_list']. Common statuses: 'NEW','ASSIGNED','MODIFIED','NEEDINFO' Less common: 'VERIFIED','ON_DEV','ON_QA','REOPENED' 'CLOSED' is not valid with this method; use closebug() instead. ''' return self._proxy.bugzilla.setstatus(id,status, self.user,self.password,comment,private) | 9a8879dae9bd9b9fcb43a1f3653d6a18826ea0be /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5050/9a8879dae9bd9b9fcb43a1f3653d6a18826ea0be/bugzilla.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
2327,
12,
2890,
16,
350,
16,
2327,
16,
3469,
2218,
2187,
1152,
33,
8381,
4672,
9163,
694,
326,
1267,
434,
326,
7934,
598,
326,
864,
1599,
18,
4554,
2026,
8771,
2341,
279,
287... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
2327,
12,
2890,
16,
350,
16,
2327,
16,
3469,
2218,
2187,
1152,
33,
8381,
4672,
9163,
694,
326,
1267,
434,
326,
7934,
598,
326,
864,
1599,
18,
4554,
2026,
8771,
2341,
279,
287... |
host = basehost + str(num) | leadingZeros = len(first) - len(str(num)) host = basehost + "0"*leadingZeros + str(num) | def main(): global VERBOSE_OUTPUT_ENABLED # seedq holds addresses of machines containing the file # Each element is a tuple of the form ([user@]host, file) seedq = Queue.Queue() # targetq holds addresses of machines that need the file # Each element is a tuple of the form ([user@]host, filedest) targetq = TargetQueue() # list of sub process PID's pidList = [] # set logging to default logging_enabled = LOGGING_ENABLED # You can use -u to specify a username username = None # script usage usage = USAGE % sys.argv[0] try: optlist, args = getopt.gnu_getopt(sys.argv[1:], "u:f:r:l:sv") except: print "ERROR: ", sys.exc_info()[1] sys.exit(1) if len(args) < 2: print "ERROR: Must specify a file and a file destination" print usage sys.exit(1) # get name of file to transfer try: filename = args[0] filepath = os.path.realpath(filename) filedest = args[1] #if filedest[0] != '/': # print "Specify a full path for filedest" # sys.exit(1) except: print usage sys.exit(1) if not os.path.isfile(filepath): print "ERROR: '%s' not found" % filepath sys.exit(1) # 3 ways to populate the targetq targetList = [] # temporarily holds target hosts for opt, arg in optlist: if opt == '-f': # file # read '\n' separated hosts from file try: FILE = open(arg, "r") except: print "ERROR: Failed to open hosts file:", arg sys.exit(0) for host in FILE.readlines(): targetList.append((host.split("\n")[0].strip(), filedest)) FILE.close() elif opt == '-r': # range. modify to work with letters and not just ints try: # format: -r <base_hostname><[0-1,3-3,5-11...]> # eg. -r host[1-2,4-6] generates host1, host2, host4, host5, host6 basehost = arg.split("[")[0] # get 3 part ranges eg: ["1-3","5-5"] ranges = arg.split("[")[1].strip("[]").split(",") minLeadZeroCount = 0 leadZeroCounts = [] splitRanges = [] for rng in ranges: first = rng.split("-")[0] last = rng.split("-")[1] splitRanges.append((first, last)) leadZeroCounts.append(len(re.search("0*(?=.*)", first).group(0))) leadZeroCounts.append(len(re.search("0*(?=.*)", last).group(0))) if leadZeroCounts: minLeadZeroCount = min(leadZeroCounts) basehost = basehost + "0" * minLeadZeroCount for first, last in splitRanges: first = first[minLeadZeroCount:] last = last[minLeadZeroCount:] for first, last in splitRanges: for num in range(int(first), int(last)+1): host = basehost + str(num) targetList.append((host, filedest)) except: print "ERROR: Invalid argument for -r:", arg sys.exit(1) elif opt == '-l': # list # quote multiple hosts # read list of hosts from stdin hostlist = arg.split() for host in hostlist: targetList.append((host.strip(), filedest)) elif opt == '-u': # username username = arg elif opt == '-s': # log transfer statistics logging_enabled = True elif opt == '-v': # verbose output VERBOSE_OUTPUT_ENABLED = True # remove duplicate targets and add them to targetq targetList = set(targetList) for target in targetList: if username: # add username to scp call target = (username + '@' + target[0], target[1]) targetq.put(target) # ensure there are target hosts in the queue if targetq.qsize() < 1: print "There are no targets in the queue" print usage sys.exit(1) # ready to start the transfers print "transferring %s to %d host(s)..." % (filename, targetq.qsize()) start_time = time.time() # see TimeQueue definition above for more info timeq = TimeQueue(start_time) # used to tell threads to exit haltFlag = threading.Event() try: # returns when all transfers are complete or exception startTransfers(seedq, targetq, timeq, filepath, filedest, username,\ pidList, haltFlag) except KeyboardInterrupt: # catches ctrl-c haltFlag.set() # tell threads to exit print "Caught ctrl-c. Exiting" pids = [pid for pid in pidList] # make a deep copy for pid in pids: # I don't know about this one... try: ret = call("kill -9 %d" % pid, shell=True, stdin=PIPE,\ stdout=PIPE, stderr=PIPE) except: print sys.exc_info()[1] continue os._exit(2) # transfers are complete, print out the stats elapsed_time = time.time() - start_time file_size = os.path.getsize(filepath) / (10**6) # file size in MB files_received = seedq.qsize() - 1 # -1 for first seed stats = "\nreceived by: %d hosts\nfile_size: %dMB\ \nelapsed time: %.2fs" % (files_received, file_size, elapsed_time) print stats # create log file # use -s switch to turn on or off if logging_enabled: header = time.ctime() + "\n" if not os.path.exists(LOG_FILE): header = "Columns: [Elapsed Time(s)] [Active Seeds] " +\ "[Files Transferred]\n\n" + header logfile = open(LOG_FILE, "a") logfile.write(header) while timeq.qsize() > 0: string = timeq.get() logfile.write(string+"\n") logfile.write("\n\n") logfile.close() | 831790812a3211288da3aab1b4dd59ac30700abd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1259/831790812a3211288da3aab1b4dd59ac30700abd/scpWave.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
27857,
67,
15527,
67,
13560,
468,
5009,
85,
14798,
6138,
434,
15942,
4191,
326,
585,
468,
8315,
930,
353,
279,
3193,
434,
326,
646,
23265,
1355,
36,
65,
2564,
16,
585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
27857,
67,
15527,
67,
13560,
468,
5009,
85,
14798,
6138,
434,
15942,
4191,
326,
585,
468,
8315,
930,
353,
279,
3193,
434,
326,
646,
23265,
1355,
36,
65,
2564,
16,
585,... |
f.close() try: os.remove(fname) except os.error: pass | f.close() try: os.remove(fname) except os.error: pass | def test(openmethod, what): if verbose: print '\nTesting: ', what fname = tempfile.mktemp() f = openmethod(fname, 'c') verify(f.keys() == []) if verbose: print 'creation...' f['0'] = '' f['a'] = 'Guido' f['b'] = 'van' f['c'] = 'Rossum' f['d'] = 'invented' f['f'] = 'Python' if verbose: print '%s %s %s' % (f['a'], f['b'], f['c']) if what == 'BTree' : if verbose: print 'key ordering...' f.set_location(f.first()[0]) while 1: try: rec = f.next() except KeyError: if rec != f.last(): print 'Error, last != last!' f.previous() break if verbose: print rec if not f.has_key('a'): print 'Error, missing key!' f.sync() f.close() if verbose: print 'modification...' f = openmethod(fname, 'w') f['d'] = 'discovered' if verbose: print 'access...' for key in f.keys(): word = f[key] if verbose: print word f.close() try: os.remove(fname) except os.error: pass | 8388895fe43da057006e50cae5d1b6e2a12083e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/8388895fe43da057006e50cae5d1b6e2a12083e0/test_bsddb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
3190,
2039,
16,
4121,
4672,
225,
309,
3988,
30,
1172,
2337,
82,
22218,
30,
2265,
4121,
225,
5299,
273,
13275,
18,
24816,
5814,
1435,
284,
273,
1696,
2039,
12,
12749,
16,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
3190,
2039,
16,
4121,
4672,
225,
309,
3988,
30,
1172,
2337,
82,
22218,
30,
2265,
4121,
225,
5299,
273,
13275,
18,
24816,
5814,
1435,
284,
273,
1696,
2039,
12,
12749,
16,
296,
... |
""" if not (is_ComplexNumber(s)): if is_ComplexNumber(t): C = t.parent() else: C = ComplexField() s = C(s) return s.gamma_inc(t) | EXAMPLES: sage: gamma_inc(CDF(0,1), 3) 0.00320857499337 + 0.0124061862007*I sage: gamma_inc(3, 3) 0.846380162253687 sage: gamma_inc(RDF(1), 3) 0.0497870683678639 """ try: return s.gamma_inc(t) except AttributeError: if not (is_ComplexNumber(s)): if is_ComplexNumber(t): C = t.parent() else: C = ComplexField() s = C(s) return s.gamma_inc(t) | def gamma_inc(s, t): """ Incomplete Gamma function Gamma(s,t). """ if not (is_ComplexNumber(s)): if is_ComplexNumber(t): C = t.parent() else: C = ComplexField() s = C(s) return s.gamma_inc(t) #s = pari.new_with_prec(s, prec) #t = pari.new_with_prec(s, prec) #return complex_field.ComplexField()(s.incgam(t, prec).python(prec)) | aac4df9fff4c7999b0f05f2e3ff40cc621d872fe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/aac4df9fff4c7999b0f05f2e3ff40cc621d872fe/transcendental.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9601,
67,
9523,
12,
87,
16,
268,
4672,
3536,
657,
6226,
25409,
445,
25409,
12,
87,
16,
88,
2934,
3536,
309,
486,
261,
291,
67,
12795,
1854,
12,
87,
3719,
30,
309,
353,
67,
12795,
185... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9601,
67,
9523,
12,
87,
16,
268,
4672,
3536,
657,
6226,
25409,
445,
25409,
12,
87,
16,
88,
2934,
3536,
309,
486,
261,
291,
67,
12795,
1854,
12,
87,
3719,
30,
309,
353,
67,
12795,
185... |
different instances. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ Loader.notify.debug("Loading model once: %s under %s" % (modelPath, nodeName)) | different instances. underNode may be either a node name, or a NodePath or a Node to an already-existing node. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ Loader.notify.debug("Loading model once: %s under %s" % (modelPath, underNode)) | def loadModelOnceUnder(self, modelPath, nodeName): """loadModelOnceUnder(self, string, string) Behaves like loadModelOnce, but also implicitly creates a new node to attach the model under, which helps to differentiate different instances. This is useful when you want to load a model once several times before parenting each instance somewhere, or when you want to load a model and immediately set a transform on it. But also consider loadModelCopy(). """ | 2e8d405a9dfc2e7d06a1ae242439eca86be85e31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/2e8d405a9dfc2e7d06a1ae242439eca86be85e31/Loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
1488,
12212,
14655,
12,
2890,
16,
938,
743,
16,
7553,
4672,
3536,
945,
1488,
12212,
14655,
12,
2890,
16,
533,
16,
533,
13,
4823,
76,
6606,
3007,
1262,
1488,
12212,
16,
1496,
2546,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1488,
12212,
14655,
12,
2890,
16,
938,
743,
16,
7553,
4672,
3536,
945,
1488,
12212,
14655,
12,
2890,
16,
533,
16,
533,
13,
4823,
76,
6606,
3007,
1262,
1488,
12212,
16,
1496,
2546,
... |
r = m8.run( options['host'] ) | r = m8.run() | def __printMatrix( matrix ): """ Print the part right of the diagonal in a matrix """ nr = len( matrix ) for i in range(nr): print '%5i'%(i+1), for i in range(nr): print '\n%2i'%(i+1), for k in range(i): print ' '*5, for j in range(i, nr): print '%5.2f'%matrix[i,j], | b73c2c50d8d9695f24a8fa4ce6f032698f2008d5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/482/b73c2c50d8d9695f24a8fa4ce6f032698f2008d5/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1188,
4635,
12,
3148,
262,
30,
3536,
3038,
326,
1087,
2145,
434,
326,
15425,
316,
279,
3148,
3536,
9884,
273,
562,
12,
3148,
262,
364,
277,
316,
1048,
12,
11611,
4672,
1172,
1995,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1188,
4635,
12,
3148,
262,
30,
3536,
3038,
326,
1087,
2145,
434,
326,
15425,
316,
279,
3148,
3536,
9884,
273,
562,
12,
3148,
262,
364,
277,
316,
1048,
12,
11611,
4672,
1172,
1995,
... |
if len(classes[name].super) == 0: | if not classes.has_key(name): if not root.has_key(name): root[name] = {} return root[name] elif len(classes[name].super) == 0: | def travTilBase(name, classes, root): if len(classes[name].super) == 0: if not root.has_key(name): root[name] = {} return root[name] else: c = travTilBase(classes[name].super[0].name, classes, root) if not c.has_key(name): c[name] = {} return c[name] | 90a7d6f141c705b970a2d5e9b7164b8c8de72d19 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/90a7d6f141c705b970a2d5e9b7164b8c8de72d19/ClassBrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1284,
90,
56,
330,
2171,
12,
529,
16,
3318,
16,
1365,
4672,
309,
486,
3318,
18,
5332,
67,
856,
12,
529,
4672,
309,
486,
1365,
18,
5332,
67,
856,
12,
529,
4672,
1365,
63,
529,
65,
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,
1284,
90,
56,
330,
2171,
12,
529,
16,
3318,
16,
1365,
4672,
309,
486,
3318,
18,
5332,
67,
856,
12,
529,
4672,
309,
486,
1365,
18,
5332,
67,
856,
12,
529,
4672,
1365,
63,
529,
65,
2... |
def _memo_property(meth): """ Convenience decorator for memoized properties. Intended for read-only, unchanging properties. Instead of caching values on the instance directly (i.e. self._value = value), stores in a weak-key dictionary as dct[self] = value. In addition to not polluting the instance dict, it provides a way to cache values across instances; any two instances which hash to the same value and compare equal will return the same value when the property is read. This allows the sharing of things like file modes and per-file locks, which are tied to the underlying file and not any particular instance. Caveats: 1. A strong reference is held to the value, so returning self is a bad idea 2. Can't initialize the value in a constructor, unlike self._value caching """ import functools import weakref dct = weakref.WeakKeyDictionary() def wrap(self): if self not in dct: return dct.setdefault(self, meth(self)) return dct[self] functools.update_wrapper(wrap, meth) return property(wrap) | import weakref import threading phil = threading.RLock() | def _memo_property(meth): """ Convenience decorator for memoized properties. Intended for read-only, unchanging properties. Instead of caching values on the instance directly (i.e. self._value = value), stores in a weak-key dictionary as dct[self] = value. In addition to not polluting the instance dict, it provides a way to cache values across instances; any two instances which hash to the same value and compare equal will return the same value when the property is read. This allows the sharing of things like file modes and per-file locks, which are tied to the underlying file and not any particular instance. Caveats: 1. A strong reference is held to the value, so returning self is a bad idea 2. Can't initialize the value in a constructor, unlike self._value caching """ import functools import weakref dct = weakref.WeakKeyDictionary() def wrap(self): if self not in dct: return dct.setdefault(self, meth(self)) return dct[self] functools.update_wrapper(wrap, meth) return property(wrap) | b1a598a2d723040490bcce9fa07057de259dfbab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10380/b1a598a2d723040490bcce9fa07057de259dfbab/highlevel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1930,
16046,
1734,
1930,
17254,
225,
1844,
330,
273,
17254,
18,
54,
2531,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1930,
16046,
1734,
1930,
17254,
225,
1844,
330,
273,
17254,
18,
54,
2531,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def get_info (self, id): | def sql_sub_vars(self, sql, args): m = re.search(dynvars_re, sql) if not m: return sql aname=m.group()[1:] try: arg = args[aname] except KeyError: raise Exception("Dynamic variable '$%s' not defined." % aname) self.cgi.hdf.setValue('report.var.'+aname , arg) sql = m.string[:m.start()] + arg + m.string[m.end():] return self.sql_sub_vars(sql, args) def get_info(self, id, args): | def get_info (self, id): cursor = self.db.cursor() | 75b7922a48dbc77ce2883a57f9de55ff2dbe67d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/75b7922a48dbc77ce2883a57f9de55ff2dbe67d0/Report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
67,
1717,
67,
4699,
12,
2890,
16,
1847,
16,
833,
4672,
312,
273,
283,
18,
3072,
12,
28595,
4699,
67,
266,
16,
1847,
13,
309,
486,
312,
30,
327,
1847,
392,
339,
33,
81,
18,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1847,
67,
1717,
67,
4699,
12,
2890,
16,
1847,
16,
833,
4672,
312,
273,
283,
18,
3072,
12,
28595,
4699,
67,
266,
16,
1847,
13,
309,
486,
312,
30,
327,
1847,
392,
339,
33,
81,
18,
16... |
def renderText(self, text, value): if self.show_flags: url = self.ltool.getFlagForLanguageCode(value) if url is not None: return self._image_template % ( self.portal_url + url, text, text ) return text | def renderSelectedItem(self, index, text, value, name, cssClass): id = '%s.%s' % (name, index) elem = renderElement('input', type="checkbox", cssClass=cssClass, name=name, id=id, value=value, checked="checked") text = self.renderText(text, value) return self._joinButtonToMessageTemplate % (cssClass, elem, text, value) | 2185cf3f799c57f1930fb83add59248bcdc06d80 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12189/2185cf3f799c57f1930fb83add59248bcdc06d80/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
7416,
1180,
12,
2890,
16,
770,
16,
977,
16,
460,
16,
508,
16,
29880,
4672,
612,
273,
1995,
87,
7866,
87,
11,
738,
261,
529,
16,
770,
13,
3659,
273,
1743,
1046,
2668,
2630,
2187... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
7416,
1180,
12,
2890,
16,
770,
16,
977,
16,
460,
16,
508,
16,
29880,
4672,
612,
273,
1995,
87,
7866,
87,
11,
738,
261,
529,
16,
770,
13,
3659,
273,
1743,
1046,
2668,
2630,
2187... | |
self._script += "legend(%s),...\n" % tuple(legends) | legends = ','.join("'%s'" % l for l in legends) self._script += "legend(%s),...\n" % legends | def _replot(self): """Replot all axes and all plotitems in the backend.""" # NOTE: only the current figure (gcf) is redrawn. if DEBUG: print "Doing replot in backend" | 005e6ec275a9d7b85beb6de41f188ce17cddde5f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4727/005e6ec275a9d7b85beb6de41f188ce17cddde5f/matlab2_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
266,
4032,
12,
2890,
4672,
3536,
426,
4032,
777,
6515,
471,
777,
3207,
3319,
316,
326,
4221,
12123,
468,
5219,
30,
1338,
326,
783,
7837,
261,
75,
8522,
13,
353,
16540,
82,
18,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
266,
4032,
12,
2890,
4672,
3536,
426,
4032,
777,
6515,
471,
777,
3207,
3319,
316,
326,
4221,
12123,
468,
5219,
30,
1338,
326,
783,
7837,
261,
75,
8522,
13,
353,
16540,
82,
18,
309... |
if self.ui_entry_folder.get_text() != "": | if self.ui_entry_folder.get_text() and self.xbe_name != "": | def get_iso_infos(self, filename): xiso = XisoExtractor(NullWriter()) error = xiso.parse(filename) if error: self.xbe_name = None self.ui_label_iso_infos.set_markup(error) else: self.xbe_name = xiso.xbe_name self.ui_label_iso_infos.set_markup(_("Title name: <b>%s</b> (%d MB)") % (self.xbe_name, os.path.getsize(filename)/(1024*1024)) ) if self.ui_entry_folder.get_text() != "": self.ui_entry_folder.set_text(os.path.join(os.getcwd(),self.xbe_name)) | 153a5c9d4a0de5f95f392cca5c994d8a57e34146 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/153a5c9d4a0de5f95f392cca5c994d8a57e34146/gxiso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9699,
67,
18227,
12,
2890,
16,
1544,
4672,
619,
9699,
273,
1139,
9699,
10958,
12,
2041,
2289,
10756,
555,
273,
619,
9699,
18,
2670,
12,
3459,
13,
309,
555,
30,
365,
18,
92,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9699,
67,
18227,
12,
2890,
16,
1544,
4672,
619,
9699,
273,
1139,
9699,
10958,
12,
2041,
2289,
10756,
555,
273,
619,
9699,
18,
2670,
12,
3459,
13,
309,
555,
30,
365,
18,
92,
... |
nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes) | nodelist = [] nodelist.append(self.assign) nodelist.append(self.list) nodelist.append(self.body) if self.else_ is not None: nodelist.append(self.else_) return tuple(nodelist) | def getChildNodes(self): nodes = [] nodes.append(self.assign) nodes.append(self.list) nodes.append(self.body) if self.else_ is not None: nodes.append(self.else_) return tuple(nodes) | 0ac16ec1493e76721d37d537a132195fdb2cbe4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/0ac16ec1493e76721d37d537a132195fdb2cbe4f/ast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
6923,
12,
2890,
18,
6145,
13,
2199,
18,
6923,
12,
2890,
18,
1098,
13,
2199,
18,
6923,
12,
2890,
18,
3432,
13,
309,
365,
18,
12107,
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,
23895,
12,
2890,
4672,
2199,
273,
5378,
2199,
18,
6923,
12,
2890,
18,
6145,
13,
2199,
18,
6923,
12,
2890,
18,
1098,
13,
2199,
18,
6923,
12,
2890,
18,
3432,
13,
309,
365,
18,
12107,
6... |
if os.path.isdir(os.path.join(gview.home_dir, 'xmlconfig')): mfile = 'DefaultMenuFile.xml' if not os.path.isfile(os.path.join(gview.home_dir, 'xmlconfig',mfile)): | xml_dir = os.path.join(gview.home_dir, 'xmlconfig') if os.path.isdir(xml_dir): mfile = 'NewMenuFile.xml' if not os.path.isfile(os.path.join(xml_dir, mfile)): | def main(): # get command line options and args # openev -m menufile -i iconfile -t toolfile image1 image2 ...... (options, ifiles) = getopt.getopt(sys.argv[1:], 'm:i:t:p:') if os.path.isdir(os.path.join(gview.home_dir, 'xmlconfig')): mfile = 'DefaultMenuFile.xml' if not os.path.isfile(os.path.join(gview.home_dir, 'xmlconfig',mfile)): mfile = None ifile = 'DefaultIconFile.xml' if not os.path.isfile(os.path.join(gview.home_dir, 'xmlconfig',ifile)): ifile = None pfile = 'DefaultPyshellFile.xml' if not os.path.isfile(os.path.join(gview.home_dir, 'xmlconfig',pfile)): pfile = None else: mfile=None ifile=None pfile=None tfile = None for opt in options[0:]: if opt[0] == '-m': mfile=opt[1] elif opt[0] == '-i': ifile=opt[1] elif opt[0] == '-p': pfile=opt[1] elif opt[0] == '-t': tfile=opt[1] app = gviewapp.GViewApp(toolfile=tfile,menufile=mfile,iconfile=ifile,pyshellfile=pfile) gview.app = app app.subscribe('quit',gtk.main_quit) app.show_layerdlg() app.new_view(title=None) app.do_auto_imports() for item in ifiles: app.file_open_by_name(item) gtk.main() | a0ec84d337b7c8fab26f094e722a11b1a4d77ec5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11090/a0ec84d337b7c8fab26f094e722a11b1a4d77ec5/openev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
336,
1296,
980,
702,
471,
833,
468,
1696,
14965,
300,
81,
21247,
696,
398,
300,
77,
4126,
768,
300,
88,
5226,
768,
1316,
21,
1316,
22,
1372,
2777,
261,
2116,
16,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
336,
1296,
980,
702,
471,
833,
468,
1696,
14965,
300,
81,
21247,
696,
398,
300,
77,
4126,
768,
300,
88,
5226,
768,
1316,
21,
1316,
22,
1372,
2777,
261,
2116,
16,
309,... |
mainSizer=wx.BoxSizer(wx.VERTICAL) | mainSizer = panel.sizer | def Configure( self, choices=[], fore = (0, 0, 0), back = (255, 255, 255), fontInfo = None | 5a9e24db893d311594502a931adac4c0bc74b70e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8076/5a9e24db893d311594502a931adac4c0bc74b70e/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11758,
12,
365,
16,
7246,
22850,
6487,
895,
273,
261,
20,
16,
374,
16,
374,
3631,
1473,
273,
261,
10395,
16,
4561,
16,
4561,
3631,
3512,
966,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11758,
12,
365,
16,
7246,
22850,
6487,
895,
273,
261,
20,
16,
374,
16,
374,
3631,
1473,
273,
261,
10395,
16,
4561,
16,
4561,
3631,
3512,
966,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,... |
def _set_basicSelectionOffsets(self): pass | def _set_basicSelectionOffsets(self,offsets): raise NotImplementedError | def _set_basicSelectionOffsets(self): pass | b8f14d539ed80fefb643088e2bba69cbb40d08c0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/b8f14d539ed80fefb643088e2bba69cbb40d08c0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
13240,
6233,
13830,
12,
2890,
4672,
1342,
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... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
13240,
6233,
13830,
12,
2890,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print "plip" | def on_checkmenuitem_correction_toggled(self, widget, data=None): print "plip" toolbutton_show_correction = self.builder.get_object("toolbutton_show_correction") self.controller.notify_toogle_correction(toolbutton_show_correction.props.active) | 0948e099a01936038473300271d5caa7bc50337b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11741/0948e099a01936038473300271d5caa7bc50337b/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1893,
5414,
1726,
67,
20916,
67,
88,
23972,
1259,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
5226,
5391,
67,
4500,
67,
20916,
273,
365,
18,
9574,
18,
588,
67,
1612,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
1893,
5414,
1726,
67,
20916,
67,
88,
23972,
1259,
12,
2890,
16,
3604,
16,
501,
33,
7036,
4672,
5226,
5391,
67,
4500,
67,
20916,
273,
365,
18,
9574,
18,
588,
67,
1612,
2932,
... | |
inifile.write ("[metadata]\n") | lines.append ("[metadata]") | def create_inifile (self): # Create an inifile containing data describing the installation. # This could be done without creating a real file, but # a file is (at least) useful for debugging bdist_wininst. | 34b4134b92d8ae35d7116619c46b7cf5f0d39e62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/34b4134b92d8ae35d7116619c46b7cf5f0d39e62/bdist_wininst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
752,
67,
267,
430,
398,
261,
2890,
4672,
468,
1788,
392,
316,
430,
398,
4191,
501,
16868,
326,
13193,
18,
468,
1220,
3377,
506,
2731,
2887,
4979,
279,
2863,
585,
16,
1496,
468,
279,
58... |
if gc.collect() == 0: raise TestFailed | expect_not(gc.collect(), 0, "method") | def __init__(self): self.init = self.__init__ | c8cba5afd5227dd0e35904dd00d844e47ca1c07a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/c8cba5afd5227dd0e35904dd00d844e47ca1c07a/test_gc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
2738,
273,
365,
16186,
2738,
972,
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,
1001,
2738,
972,
12,
2890,
4672,
365,
18,
2738,
273,
365,
16186,
2738,
972,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
except ValueError: print "Cannot extract S31." | except ValueError: print "Cannot extract S31:\n ", rec, file_name return [] | def extract_tls_parameters(remark_3_records): | c7414c7bd0f10baaa7d702b1454c3d4335e68afe /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/c7414c7bd0f10baaa7d702b1454c3d4335e68afe/remark_3_interpretation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
17116,
67,
3977,
12,
2764,
1313,
67,
23,
67,
7094,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
2608,
67,
17116,
67,
3977,
12,
2764,
1313,
67,
23,
67,
7094,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print "using wireless interface...", self.GetWirelessInterface()[5:] | print "using wireless interface...", self.GetWirelessInterface() self.wifi.LoadInterfaces() self.wired.LoadInterfaces() | def ReadConfig(self): if os.path.isfile(self.app_conf): iface = self.DetectWirelessInterface() if not iface: iface = "wlan0" self.SetWirelessInterface(self.get_option("Settings", "wireless_interface", default=iface)) self.SetWiredInterface(self.get_option("Settings", "wired_interface", default="eth0")) self.SetWPADriver(self.get_option("Settings", "wpa_driver", default="wext")) self.SetAlwaysShowWiredInterface(self.get_option("Settings", "always_show_wired_interface", default=False)) | 85eaabcfff64034cf260450c9ebddf0cd6c22d34 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12280/85eaabcfff64034cf260450c9ebddf0cd6c22d34/daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2720,
809,
12,
2890,
4672,
309,
1140,
18,
803,
18,
291,
768,
12,
2890,
18,
2910,
67,
3923,
4672,
9751,
273,
365,
18,
12081,
15249,
2656,
1358,
1435,
309,
486,
9751,
30,
9751,
273,
315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2720,
809,
12,
2890,
4672,
309,
1140,
18,
803,
18,
291,
768,
12,
2890,
18,
2910,
67,
3923,
4672,
9751,
273,
365,
18,
12081,
15249,
2656,
1358,
1435,
309,
486,
9751,
30,
9751,
273,
315,... |
trial_packages = ['kernel'] | trial_pkg_names = [] | def make_runners(): """Define the top-level packages that need to be tested. """ nose_packages = ['config', 'core', 'extensions', 'frontend', 'lib', 'scripts', 'testing', 'utils', # Note that we list the kernel here, though the bulk of it # is twisted-based, because nose picks up doctests that # twisted doesn't. 'kernel'] # The machinery in kernel needs twisted for real testing trial_packages = ['kernel'] if have_wx: nose_packages.append('gui') #nose_packages = ['config', 'utils'] # dbg #trial_packages = [] # dbg nose_packages = ['IPython.%s' % m for m in nose_packages ] trial_packages = ['IPython.%s' % m for m in trial_packages ] # Make runners, most with nose nose_testers = [IPTester(params=v) for v in nose_packages] runners = zip(nose_packages, nose_testers) # And add twisted ones if conditions are met if have_zi and have_twisted and have_foolscap: trial_testers = [IPTester('trial', params=v) for v in trial_packages] runners.extend(zip(trial_packages, trial_testers)) return runners | 34dd139174a73549251f695dd08f2a9e3ababcf0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3900/34dd139174a73549251f695dd08f2a9e3ababcf0/iptest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2681,
9646,
13332,
3536,
11644,
326,
1760,
17,
2815,
5907,
716,
1608,
358,
506,
18432,
18,
3536,
225,
1158,
307,
67,
10308,
273,
10228,
1425,
2187,
296,
3644,
2187,
296,
9489,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2681,
9646,
13332,
3536,
11644,
326,
1760,
17,
2815,
5907,
716,
1608,
358,
506,
18432,
18,
3536,
225,
1158,
307,
67,
10308,
273,
10228,
1425,
2187,
296,
3644,
2187,
296,
9489,
... |
p.fillColor = path.fillColor p.strokeColor = path.strokeColor p.strokeWidth = path.strokeWidth | p.fill = path.fill p.stroke = path.stroke p.strokewidth = path.strokewidth p.closed = path.closed | def copypath(self, path): # Expand the path copy with the properties from add_color_info() p = path.copy() p.fillColor = path.fillColor p.strokeColor = path.strokeColor p.strokeWidth = path.strokeWidth | 4284758b928e6ce257c68e38e49e8e35b9986569 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/612/4284758b928e6ce257c68e38e49e8e35b9986569/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
803,
12,
2890,
16,
589,
4672,
468,
16429,
326,
589,
1610,
598,
326,
1790,
628,
527,
67,
3266,
67,
1376,
1435,
293,
273,
589,
18,
3530,
1435,
293,
18,
5935,
2957,
273,
589,
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,
1610,
803,
12,
2890,
16,
589,
4672,
468,
16429,
326,
589,
1610,
598,
326,
1790,
628,
527,
67,
3266,
67,
1376,
1435,
293,
273,
589,
18,
3530,
1435,
293,
18,
5935,
2957,
273,
589,
18,
... |
chance = int( ( char.skill[ LUMBERJACKING ] - woodtable[ resname ][ MINSKILL ] ) / 10 ) | chance = max(0, char.skill[LUMBERJACKING] - woodtable[ resname ][ MINSKILL ]) / 1000.0 | def successlumberjacking( char, args ): socket = char.socket pos = args[0] # Target POS resource = wolfpack.finditem(args[1]) amount = args[2] tool = wolfpack.finditem(args[3]) resname = args[4] table = args[5] # Lets make sure we stayed next to the tree # Player can reach that ? if char.pos.map != pos.map or char.pos.distance( pos ) > chopdistance: socket.sysmessage("You have moved too far away to gather any wood.") socket.deltag( 'is_lumberjacking' ) return False if not resource.hastag( 'resourcecount' ): return False if int( resource.gettag( 'resourcecount' ) ) <= 0: char.socket.clilocmessage( 500488, '', GRAY ) return False reqskill = woodtable[ resname ][ REQSKILL ] chance = int( ( char.skill[ LUMBERJACKING ] - woodtable[ resname ][ MINSKILL ] ) / 10 ) if char.skill[ LUMBERJACKING ] < reqskill: char.socket.clilocmessage( 500298 ) # You are not skilled enough... return False else: # Skill Check against LUMBERJACKING if not char.checkskill( LUMBERJACKING, reqskill, 1200 ): char.socket.clilocmessage( 500495 ) # You hack at the tree for a while but fail to produce... success = 0 return False elif chance >= randint(1, 100): char.socket.clilocmessage( 500498 ) # You put some logs into your backpack if tool.gettag( 'remaining_uses' ) > 1: tool.settag( 'remaining_uses', int( int( tool.gettag( 'remaining_uses' ) ) - 1 ) ) tool.resendtooltip() elif tool.gettag( 'remaining_uses' ) == 1: tool.delete() # You broke your axe! socket.clilocmessage( 500499, '', GRAY ) char.socket.deltag( 'is_lumberjacking' ) success = 1 else: char.socket.clilocmessage( 500495 ) # You hack at the tree for a while but fail to produce... success = 0 return False if success == 1: # Check for a backpack backpack = char.getbackpack() if not backpack: return False # Create an item in my pack (logs to be specific) resourceitem = wolfpack.additem( "1bdd" ) if ( FELUCIA2XRESGAIN == TRUE ) and ( char.pos.map == 0 ): resourceitem.amount = 20 else: resourceitem.amount = 10 resourceitem.settag( 'resname', resname ) # Used when crafting if not wolfpack.utilities.tobackpack( resourceitem, char ): resourceitem.update() # Resend weight char.socket.resendstatus() if resource.gettag( 'resourcecount' ) >= 1: resource.settag( 'resourcecount', int( amount - 1 ) ) elif resource.gettag( 'resourcecount' ) == 0: if not resource.hastag ('resource_empty') and int( resource.gettag( 'resourcecount' ) ) == 0: resource.settag( 'resource_empty', 'true' ) resource.addtimer( woodrespawndelay, "skills.lumberjacking.respawnvein", [], True ) return True | ff1e5179f20e994488b4adb347d69c41909b78b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/ff1e5179f20e994488b4adb347d69c41909b78b4/lumberjacking.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2216,
80,
1226,
78,
484,
310,
12,
1149,
16,
833,
262,
30,
2987,
273,
1149,
18,
7814,
949,
273,
833,
63,
20,
65,
468,
5916,
12511,
1058,
273,
341,
355,
74,
2920,
18,
4720,
1726,
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,
2216,
80,
1226,
78,
484,
310,
12,
1149,
16,
833,
262,
30,
2987,
273,
1149,
18,
7814,
949,
273,
833,
63,
20,
65,
468,
5916,
12511,
1058,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
... |
return bessel_J(nu,z,s,p) | return bessel_J(nu,z,algorithm=s,prec=p) | def __call__(self,z): nu = self.order() t = self.type() s = self.system() p = self.prec() if t == "I": return bessel_I(nu,z,s,p) if t == "J": return bessel_J(nu,z,s,p) if t == "K": return bessel_K(nu,z,p) if t == "Y": return bessel_J(nu,z) | 6634f9ab85d7944da6788aaab93ffaa3f22ce5ac /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/6634f9ab85d7944da6788aaab93ffaa3f22ce5ac/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
94,
4672,
9244,
273,
365,
18,
1019,
1435,
268,
273,
365,
18,
723,
1435,
272,
273,
365,
18,
4299,
1435,
293,
273,
365,
18,
4036,
1435,
309,
268,
422,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
94,
4672,
9244,
273,
365,
18,
1019,
1435,
268,
273,
365,
18,
723,
1435,
272,
273,
365,
18,
4299,
1435,
293,
273,
365,
18,
4036,
1435,
309,
268,
422,
31... |
def _plotTotalNumberOfJobs( self, startTime, endTime, condDict, groupingFields, filename ): selectFields = ( self._getSQLStringForGrouping( groupingFields) + ", %s, %s, SUM(%s)/SUM(%s)", | def _plotNumberOfJobs( self, startTime, endTime, condDict, groupingFields, filename ): selectFields = ( self._getSQLStringForGrouping( groupingFields) + ", %s, %s, SUM(%s)/(SUM(%s)/COUNT(%s))", | def _plotTotalNumberOfJobs( self, startTime, endTime, condDict, groupingFields, filename ): selectFields = ( self._getSQLStringForGrouping( groupingFields) + ", %s, %s, SUM(%s)/SUM(%s)", groupingFields + [ 'startTime', 'bucketLength', 'Jobs', 'entriesInBucket' ] ) retVal = self._getTypeData( startTime, endTime, selectFields, condDict, groupingFields, {} ) if not retVal[ 'OK' ]: return retVal dataDict, granularity = retVal[ 'Value' ] self.stripDataField( dataDict, 0 ) dataDict = self._acumulate( granularity, startTime, endTime, dataDict ) gLogger.info( "Generating plot", "%s with granularity of %s" % ( filename, granularity ) ) metadata = { 'title' : 'Total Jobs by %s' % " -> ".join( groupingFields ) , 'starttime' : startTime, 'endtime' : endTime, 'span' : granularity, 'ylabel' : "jobs", 'is_cumulative' : True } return generateCumulativePlot( filename, dataDict, metadata ) | 8ef9b42256eb936e92442dc239c0b18c7e9fdd2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/8ef9b42256eb936e92442dc239c0b18c7e9fdd2e/WMSHistoryPlotter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4032,
9226,
7276,
12,
365,
16,
8657,
16,
13859,
16,
6941,
5014,
16,
12116,
2314,
16,
1544,
262,
30,
2027,
2314,
273,
261,
365,
6315,
588,
3997,
780,
1290,
21014,
12,
12116,
2314,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4032,
9226,
7276,
12,
365,
16,
8657,
16,
13859,
16,
6941,
5014,
16,
12116,
2314,
16,
1544,
262,
30,
2027,
2314,
273,
261,
365,
6315,
588,
3997,
780,
1290,
21014,
12,
12116,
2314,
... |
rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"') | rx = re.compile('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I) | def find_user_password(self, realm, authuri): user, password = HTTPPasswordMgr.find_user_password(self,realm,authuri) if user is not None: return user, password return HTTPPasswordMgr.find_user_password(self, None, authuri) | 853ddd5cb96981966b935ed75bf8af0cfd0bee24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/853ddd5cb96981966b935ed75bf8af0cfd0bee24/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1355,
67,
3664,
12,
2890,
16,
11319,
16,
1357,
1650,
4672,
729,
16,
2201,
273,
2239,
3913,
9455,
18,
4720,
67,
1355,
67,
3664,
12,
2890,
16,
24056,
16,
1944,
1650,
13,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
1355,
67,
3664,
12,
2890,
16,
11319,
16,
1357,
1650,
4672,
729,
16,
2201,
273,
2239,
3913,
9455,
18,
4720,
67,
1355,
67,
3664,
12,
2890,
16,
24056,
16,
1944,
1650,
13,
309,
... |
name='', client=None, var=None, | name='', client=None, debug=0, var=None, | def __init__(self, addr, storage='1', cache_size=20000000, name='', client=None, var=None, min_disconnect_poll=5, max_disconnect_poll=300, wait=0, read_only=0, read_only_fallback=0): | f8411024b047be56a119c3b6f827f9a505337f1a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/f8411024b047be56a119c3b6f827f9a505337f1a/ClientStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3091,
16,
2502,
2218,
21,
2187,
1247,
67,
1467,
33,
22,
17877,
16,
508,
2218,
2187,
1004,
33,
7036,
16,
1198,
33,
20,
16,
569,
33,
7036,
16,
1131,
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,
1001,
2738,
972,
12,
2890,
16,
3091,
16,
2502,
2218,
21,
2187,
1247,
67,
1467,
33,
22,
17877,
16,
508,
2218,
2187,
1004,
33,
7036,
16,
1198,
33,
20,
16,
569,
33,
7036,
16,
1131,
67,
... |
SnglInspiralUtils.slideTriggersOnRingWithVector(coinc_table, shift_vector, rings) full_coinc_table.extend(CoincInspiralUtils.coincInspiralTable(coinc_table,coinc_stat)) | if coinc_table: SnglInspiralUtils.slideTriggersOnRingWithVector(coinc_table, shift_vector, rings) full_coinc_table.extend(CoincInspiralUtils.coincInspiralTable(coinc_table,coinc_stat)) | def get_slide_coincs_from_cache(cachefile, pattern, match, verb, coinc_stat): full_coinc_table = [] cache = cachefile.sieve(description=pattern, exact_match=match) found, missed = cache.checkfilesexist() files = found.pfnlist() if not len(files): print >>sys.stderr, "cache contains no files with " + pattern + " description" return None # split the time slide files into 105 groups to aid with I/O num_files=len(files) print num_files groups_of_files = split_seq(files,105) print groups_of_files for filegroup in groups_of_files: if filegroup: # extract the coinc table coinc_table = SnglInspiralUtils.ReadSnglInspiralFromFiles(filegroup, mangle_event_id=False, verbose=verb, non_lsc_tables_ok=False) segDict = SearchSummaryUtils.GetSegListFromSearchSummaries(filegroup) rings = segments.segmentlist(iterutils.flatten(segDict.values())) rings.sort() for k,ring in enumerate(rings): rings[k] = segments.segment(rings[k][0], rings[k][1] + 10**(-9)) shift_vector = {"H1": 0, "H2": 0, "L1": 5, "V1": 5} SnglInspiralUtils.slideTriggersOnRingWithVector(coinc_table, shift_vector, rings) full_coinc_table.extend(CoincInspiralUtils.coincInspiralTable(coinc_table,coinc_stat)) return full_coinc_table | ac107208501dabc1a21119d63db8e2cf38455b11 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3592/ac107208501dabc1a21119d63db8e2cf38455b11/pylal_ihope_to_randomforest_input.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
26371,
67,
12645,
2143,
67,
2080,
67,
2493,
12,
2493,
768,
16,
1936,
16,
845,
16,
6405,
16,
13170,
71,
67,
5642,
4672,
1983,
67,
12645,
71,
67,
2121,
273,
5378,
1247,
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,
67,
26371,
67,
12645,
2143,
67,
2080,
67,
2493,
12,
2493,
768,
16,
1936,
16,
845,
16,
6405,
16,
13170,
71,
67,
5642,
4672,
1983,
67,
12645,
71,
67,
2121,
273,
5378,
1247,
273,
1... |
outfiles[f] = f | outfiles[f] = "%s.%s.%s" %(f, job.getFQID('.'), time.strftime("%Y%m%d%H%M%S")) fout = FileSpec() fout.lfn = outfiles[f] fout.type = 'output' fout.dataset = job.outputdata.datasetname fout.destinationDBlock = job.outputdata.datasetname fout.destinationSE = job.backend.site jspec.addFile(fout) | def prepare(self,app,appsubconfig,appmasterconfig,jobmasterconfig): '''prepare the subjob specific configuration''' | 0de971d1c818d2bef860a39a93ed9cf131d99767 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/0de971d1c818d2bef860a39a93ed9cf131d99767/ExecutablePandaRTHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2910,
16,
11411,
373,
1425,
16,
2910,
7525,
1425,
16,
4688,
7525,
1425,
4672,
9163,
9366,
326,
720,
4688,
2923,
1664,
26418,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
2911,
12,
2890,
16,
2910,
16,
11411,
373,
1425,
16,
2910,
7525,
1425,
16,
4688,
7525,
1425,
4672,
9163,
9366,
326,
720,
4688,
2923,
1664,
26418,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
extension = os.path.basename(filename).rsplit(".", 1)[1] | options = "" for setting in settings: value = setting.GetValue().strip() if len(value) == 0: value = self.FindDefault(FMaya_UIRender.__IMPORT_OPTIONS, setting.GetPrettyName()) options = (options + setting.GetCommand() + "=" + value + ";") extension = FUtils.GetExtension(filename).lower() | def WriteImport(self, filename, logname, outputDir, settings, isAnimated): """WriteImport(filename, logname, outputDir, settings, isAnimated) -> list_of_str Implements FApplication.WriteImport(). Assumes a COLLADA, maya binary, or maya ascii file is being imported. """ baseName = FUtils.GetProperFilename(filename) self.__currentImportProperName = baseName output = (os.path.join(outputDir, baseName)).replace("\\", "/") filename = filename.replace("\\", "/") self.__currentFilename = output + ".mb" extension = os.path.basename(filename).rsplit(".", 1)[1] if (extension == "mb"): command = ("catch(`file -type \"mayaBinary\" -o \"" + filename + "\"`);\n") elif (extension == "ma"): command = ("catch(`file -type \"mayaAscii\" -o \"" + filename + "\"`);\n") else: command = ("catch(`file -type \"COLLADA importer\" -o \"" + filename + "\"`);\n") self.__melScript.write( "$logname = \"" + logname.replace("\\", "/") + "\";\n" + "$descriptor = `cmdFileOutput -o $logname`;\n" + "catch(`file -f -new`);\n" + command + "catch(`file -rename \"" + output + "\"`);\n" + "catch(`file -save -type \"mayaBinary\"`);\n" + "cmdFileOutput -c $descriptor;\n" + "fixNewlines $logname;\n\n") self.__testImportCount = self.__testImportCount + 1 return [os.path.normpath(baseName + ".mb"),] | aaaf419583f4d5bf16ff80994387de818eb565fa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11176/aaaf419583f4d5bf16ff80994387de818eb565fa/FMaya_UIRender.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
5010,
12,
2890,
16,
1544,
16,
613,
529,
16,
21412,
16,
1947,
16,
353,
979,
17275,
4672,
3536,
3067,
5010,
12,
3459,
16,
613,
529,
16,
21412,
16,
1947,
16,
353,
979,
17275,
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,
2598,
5010,
12,
2890,
16,
1544,
16,
613,
529,
16,
21412,
16,
1947,
16,
353,
979,
17275,
4672,
3536,
3067,
5010,
12,
3459,
16,
613,
529,
16,
21412,
16,
1947,
16,
353,
979,
17275,
13,
... |
def __init__(self): | def __init__(self, xmin=None, xmax=None, ymin=None, ymax=None): | def __init__(self): """ Create a new empty Graphics objects with all the defaults. | 4cdc64d73e24ddcdf396a7b5f766f02774b0c237 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4cdc64d73e24ddcdf396a7b5f766f02774b0c237/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
4672,
3536,
1788,
279,
394,
1008,
16830,
2184,
598,
777,
326,
3467,
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,
1001,
2738,
972,
12,
2890,
16,
13777,
33,
7036,
16,
14016,
33,
7036,
16,
15763,
33,
7036,
16,
15275,
33,
7036,
4672,
3536,
1788,
279,
394,
1008,
16830,
2184,
598,
777,
326,
3467,
18,
2... |
if string.lower(urltype) != 'http': | if urltype.lower() != 'http': | def open_http(self, url, data=None): """Use HTTP protocol.""" import httplib user_passwd = None if type(url) is types.StringType: host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) url = rest user_passwd = None if string.lower(urltype) != 'http': realhost = None else: realhost, rest = splithost(rest) if realhost: user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) #print "proxy via http:", host, selector if not host: raise IOError, ('http error', 'no host given') if user_passwd: import base64 auth = string.strip(base64.encodestring(user_passwd)) else: auth = None h = httplib.HTTP(host) if data is not None: h.putrequest('POST', selector) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', selector) if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: apply(h.putheader, args) h.endheaders() if data is not None: h.send(data + '\r\n') errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == 200: return addinfourl(fp, headers, "http:" + url) else: if data is None: return self.http_error(url, fp, errcode, errmsg, headers) else: return self.http_error(url, fp, errcode, errmsg, headers, data) | 2aa671823938e593ea9dedd33b3cc4194fde8a0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2aa671823938e593ea9dedd33b3cc4194fde8a0a/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2505,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
3536,
3727,
2239,
1771,
12123,
1930,
15851,
6673,
729,
67,
24002,
273,
599,
309,
618,
12,
718,
13,
353,
1953,
18,
780,
559,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2505,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
3536,
3727,
2239,
1771,
12123,
1930,
15851,
6673,
729,
67,
24002,
273,
599,
309,
618,
12,
718,
13,
353,
1953,
18,
780,
559,
... |
raise exceptions.StopException("%s: stopped, can't cache." % self.getName()) | raise exceptions.LicornStopException("%s: stopped, can't cache." % self.getName()) | def __cache_one_file(self, filename, batch = False, force = False) : """ Add a file to the cache. """ | 8928e9e090e8ebea71cf432acff7e2490e63dc87 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7650/8928e9e090e8ebea71cf432acff7e2490e63dc87/internals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2493,
67,
476,
67,
768,
12,
2890,
16,
1544,
16,
2581,
273,
1083,
16,
2944,
273,
1083,
13,
294,
3536,
1436,
279,
585,
358,
326,
1247,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2493,
67,
476,
67,
768,
12,
2890,
16,
1544,
16,
2581,
273,
1083,
16,
2944,
273,
1083,
13,
294,
3536,
1436,
279,
585,
358,
326,
1247,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
... |
f = os.path.join(addons.get_module_path(mod.name), 'i18n', lang + '.po') | f = os.path.join(modpath, 'i18n', lang + '.po') | def update_translations(self, cr, uid, ids, filter_lang=None): logger = netsvc.Logger() | bc7750f1aad1bb88fa9f224bc2b8fb29856fbb9d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/bc7750f1aad1bb88fa9f224bc2b8fb29856fbb9d/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
13457,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1034,
67,
4936,
33,
7036,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
13457,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1034,
67,
4936,
33,
7036,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if vhost: cmd += ",vhost=on" | if netdev_extra_params: cmd += ",%s" % netdev_extra_params | def add_net(help, vlan, mode, ifname=None, script=None, downscript=None, tftp=None, bootfile=None, hostfwd=[], netdev_id=None, vhost=False): if has_option(help, "netdev"): cmd = " -netdev %s,id=%s" % (mode, netdev_id) if vhost: cmd += ",vhost=on" else: cmd = " -net %s,vlan=%d" % (mode, vlan) if mode == "tap": if ifname: cmd += ",ifname='%s'" % ifname if script: cmd += ",script='%s'" % script cmd += ",downscript='%s'" % (downscript or "no") elif mode == "user": if tftp and "[,tftp=" in help: cmd += ",tftp='%s'" % tftp if bootfile and "[,bootfile=" in help: cmd += ",bootfile='%s'" % bootfile if "[,hostfwd=" in help: for host_port, guest_port in hostfwd: cmd += ",hostfwd=tcp::%s-:%s" % (host_port, guest_port) return cmd | 6ac600700df3c95a5a4f162b510874017133720b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/6ac600700df3c95a5a4f162b510874017133720b/kvm_vm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2758,
12,
5201,
16,
11954,
16,
1965,
16,
309,
529,
33,
7036,
16,
2728,
33,
7036,
16,
2588,
4263,
33,
7036,
16,
268,
11727,
33,
7036,
16,
4835,
768,
33,
7036,
16,
1479,
27131... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2758,
12,
5201,
16,
11954,
16,
1965,
16,
309,
529,
33,
7036,
16,
2728,
33,
7036,
16,
2588,
4263,
33,
7036,
16,
268,
11727,
33,
7036,
16,
4835,
768,
33,
7036,
16,
1479,
27131... |
s += getNumberedTypedString(referrers, maxLen=80, | print getNumberedTypedString(referrers, maxLen=80, | def referrersStr(self, numEach=3): """referrers of the first few of each type of object""" s = '' counts = list(set(self._count2types.keys())) counts.sort() counts.reverse() for count in counts: types = makeList(self._count2types[count]) for typ in types: s += '\n\nTYPE: %s' % typ for i in xrange(min(numEach,len(self._type2objs[typ]))): obj = self._type2objs[typ][i] s += '\nOBJ: %s\n' % safeRepr(obj) referrers = gc.get_referrers(obj) s += '%s REFERRERS:\n' % len(referrers) if len(referrers): s += getNumberedTypedString(referrers, maxLen=80, numPrefix='REF') else: s += '<No Referrers>' return s | 3ca67a4446150254249b7af7a05e2ea39a6c2405 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/3ca67a4446150254249b7af7a05e2ea39a6c2405/ObjectPool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1278,
370,
414,
1585,
12,
2890,
16,
818,
3442,
33,
23,
4672,
3536,
1734,
370,
414,
434,
326,
1122,
11315,
434,
1517,
618,
434,
733,
8395,
272,
273,
875,
6880,
273,
666,
12,
542,
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,
1278,
370,
414,
1585,
12,
2890,
16,
818,
3442,
33,
23,
4672,
3536,
1734,
370,
414,
434,
326,
1122,
11315,
434,
1517,
618,
434,
733,
8395,
272,
273,
875,
6880,
273,
666,
12,
542,
12,
... |
s = boto.utils.get_instance_metadata() | s = boto.utils.get_instance_userdata() | def get_metadata(self): metadata = {} s = boto.utils.get_instance_metadata() if s: l = s.split('|') for nvpair in l: t = nvpair.split('=') metadata[t[0].strip()] = t[1].strip() | 2afdf2712eddc8524c40436ac89de18e3c85f913 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1098/2afdf2712eddc8524c40436ac89de18e3c85f913/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4165,
12,
2890,
4672,
1982,
273,
2618,
272,
273,
17228,
18,
5471,
18,
588,
67,
1336,
67,
1355,
892,
1435,
309,
272,
30,
328,
273,
272,
18,
4939,
2668,
96,
6134,
364,
8779,
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,
336,
67,
4165,
12,
2890,
4672,
1982,
273,
2618,
272,
273,
17228,
18,
5471,
18,
588,
67,
1336,
67,
1355,
892,
1435,
309,
272,
30,
328,
273,
272,
18,
4939,
2668,
96,
6134,
364,
8779,
6... |
return self._executeSingleFileCatalogFunction( lfn, 'getFileMetadata', catalogs=catalogs ) else: return self._executeFileCatalogFunction( lfn, 'getFileMetadata', catalogs=catalogs ) def getCatalogFileSize( self, lfn, singleFile=False, catalogs=[] ): | return self._executeSingleFileCatalogFunction( lfn, 'getFileMetadata', catalogs = catalogs ) else: return self._executeFileCatalogFunction( lfn, 'getFileMetadata', catalogs = catalogs ) def getCatalogFileSize( self, lfn, singleFile = False, catalogs = [] ): | def getCatalogFileMetadata( self, lfn, singleFile=False, catalogs=[] ): """ Get the metadata associated to a file in the FileCatalog 'lfn' is the files to check (can be a single file or list of lfns) """ if singleFile: return self._executeSingleFileCatalogFunction( lfn, 'getFileMetadata', catalogs=catalogs ) else: return self._executeFileCatalogFunction( lfn, 'getFileMetadata', catalogs=catalogs ) | 8cfc8d124489ba672254aee3d1fff4f748757c6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/8cfc8d124489ba672254aee3d1fff4f748757c6c/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1927,
4392,
812,
2277,
12,
365,
16,
328,
4293,
16,
2202,
812,
33,
8381,
16,
26455,
33,
8526,
262,
30,
3536,
968,
326,
1982,
3627,
358,
279,
585,
316,
326,
1387,
9769,
225,
296,
80,
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,
1927,
4392,
812,
2277,
12,
365,
16,
328,
4293,
16,
2202,
812,
33,
8381,
16,
26455,
33,
8526,
262,
30,
3536,
968,
326,
1982,
3627,
358,
279,
585,
316,
326,
1387,
9769,
225,
296,
80,
4... |
log.debug('Fetching...') return message | log.debug('Fetching metadata...') messageIn = psMessageReader(message) requestId = messageIn.getMessageId() dataBlockId = messageIn.getDataBlockIds()[0] data = messageIn.getData(dataBlockId) metadataRef = data.attribs['metadataIdRef'] md = messageIn.getMetadata(metadataRef) subjectNS = md.subject['ns'] subjectId = md.subject['id'] eventType = md.eventType log.debug('*** request id: %s' % requestId) log.debug('*** data id: %s' % dataBlockId) log.debug('*** metadata ref/id: %s' % metadataRef) log.debug('*** subject ns: %s' % subjectNS) log.debug('*** subject id: %s' % subjectId) log.debug('*** event type: %s' % eventType) messageOut = psMessageBuilder('message.%s' % time(), 'MetadataKeyResponse', messageIdRef=requestId) for i in range(0, 1): metadataId = 'metadata.%s' % time() interfaceData = { 'ifAddress type="ipv4"':'64.57.28.58', 'hostName':'rtr.atla.net.internet2.edu', 'ifName':'xe-2/0/0.0', 'direction':'in', 'capacity':'10000000000', 'description':'BACKBONE: ATLA-WASH 10GE | I2-ATLA-WASH-10GE-05133' } metaParams = {'supportedEventType':['http://ggf.org/ns/nmwg/tools/snmp/2.0', 'http://ggf.org/ns/nmwg/characteristic/utilization/2.0']} messageOut.addMetadataBlock(metadataId, metadataIdRef='rtr.atla.net.internet2.edu--xe-2/0/0.0-in', subject='64.57.28.243', subjectType='interface', subjectData=interfaceData, eventType='http://ggf.org/ns/nmwg/characteristic/utilization/2.0', params=metaParams, paramid='1') dataBlockId = 'data.%s' % time() messageOut.addDataBlock(dataBlockId, metadataIdRef=metadataId) keyParams = {'maKey': 'a593c5016d0778e59d76c6ba42fffc3a'} messageOut.addKeyToDataBlock(dataBlockId, paramid='params.0',params=keyParams) return messageOut.message | def metadataKeyRequest(self, message): log.debug('Fetching...') # do something return message | dc1a1363afe589215e38f23c5fe5889f03ef8a9c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4678/dc1a1363afe589215e38f23c5fe5889f03ef8a9c/ma_service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1982,
653,
691,
12,
2890,
16,
883,
4672,
613,
18,
4148,
2668,
30806,
7821,
13,
468,
741,
5943,
327,
883,
225,
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,
1982,
653,
691,
12,
2890,
16,
883,
4672,
613,
18,
4148,
2668,
30806,
7821,
13,
468,
741,
5943,
327,
883,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if not tab or self.count() == 0: | if self.count() == 0: | def setCurrentTab(self, tab): if not tab or self.count() == 0: return if isinstance(tab, int): tab = self.tab(tab) if tab == self.currentTab(): return; index = self.indexOf(tab.identifier()) if index not in self.tabrows[-1]: for row in range(len(self.tabrows) - 2, -1, -1): if index in self.tabrows[row]: saverow = self.tabrows[row] self.tabrows[row] = self.tabrows[-1] self.tabrows[-1] = saverow self.layoutTabs() self.repaint() break QTabBar.setCurrentTab(self, tab) | 76d9ea2f2340e175f4f7bdb5d591f85dd51e962a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/76d9ea2f2340e175f4f7bdb5d591f85dd51e962a/MultiTabBar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12589,
5661,
12,
2890,
16,
3246,
4672,
309,
365,
18,
1883,
1435,
422,
374,
30,
327,
309,
1549,
12,
7032,
16,
509,
4672,
3246,
273,
365,
18,
7032,
12,
7032,
13,
309,
3246,
422,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12589,
5661,
12,
2890,
16,
3246,
4672,
309,
365,
18,
1883,
1435,
422,
374,
30,
327,
309,
1549,
12,
7032,
16,
509,
4672,
3246,
273,
365,
18,
7032,
12,
7032,
13,
309,
3246,
422,
365,
1... |
""" | r""" | def plot_fourier_series_partial_sum(self,N,L,xmin,xmax): """ Plots the partial sum \[ f(x) \sim \frac{a_0}{2} + \sum_{n=1}^N [a_n\cos(\frac{n\pi x}{L}) + b_n\sin(\frac{n\pi x}{L})], \] over xmin < x < xmin. | 1647ed1843fe080249d8ccf31cefcde17c19a01d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/1647ed1843fe080249d8ccf31cefcde17c19a01d/piecewise.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
74,
24775,
67,
10222,
67,
11601,
67,
1364,
12,
2890,
16,
50,
16,
48,
16,
92,
1154,
16,
92,
1896,
4672,
436,
8395,
3008,
6968,
326,
4702,
2142,
521,
63,
284,
12,
92,
13,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
74,
24775,
67,
10222,
67,
11601,
67,
1364,
12,
2890,
16,
50,
16,
48,
16,
92,
1154,
16,
92,
1896,
4672,
436,
8395,
3008,
6968,
326,
4702,
2142,
521,
63,
284,
12,
92,
13,
5... |
if py2exe is None and do_py2app is None: | if py2exe is None and do_py2app is False: | def run(self): py2app.run(self) | f64d7df593601f0aa27049ea006c7d08ec9bbc49 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12415/f64d7df593601f0aa27049ea006c7d08ec9bbc49/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2395,
22,
2910,
18,
2681,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2395,
22,
2910,
18,
2681,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
Number.__init__(self, text, self.DECIMAL) | Number.__init__(self, text, Number.DECIMAL) | def __init__(self, text): Number.__init__(self, text, self.DECIMAL) | 61c498782190367933ab197480db4d4669c6485b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/61c498782190367933ab197480db4d4669c6485b/number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
977,
4672,
3588,
16186,
2738,
972,
12,
2890,
16,
977,
16,
365,
18,
23816,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
977,
4672,
3588,
16186,
2738,
972,
12,
2890,
16,
977,
16,
365,
18,
23816,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
q = v | q = v.copy() | def matvec(self, iter, v): """ Compute a matrix-vector product between the current limited-memory positive-definite approximation to the inverse Hessian matrix and the vector v using the LBFGS two-loop recursion formula. The 'iter' argument is the current iteration number. When the inner product <y,s> of one of the pairs is nearly zero, the function returns the input vector v, i.e., no preconditioning occurs. In this case, a safeguarding step should probably be taken. """ q = v for i in range(min(self.npairs, iter)): k = (iter-1-i) % self.npairs self.ys[k] = numpy.dot(self.y[:,k], self.s[:,k]) if abs(self.ys[k]) < 1.0e-12: return v self.alpha[k] = numpy.dot(self.s[:,k], q)/self.ys[k] q -= self.alpha[k] * self.y[:,k] r = q if self.scaling and iter > 0: last = (iter-1) % self.npairs self.gamma = self.ys[last]/numpy.dot(self.y[:,last],self.y[:,last]) r *= self.gamma for i in range(min(self.npairs-1,iter-1), -1, -1): k = (iter-1-i) % self.npairs beta = numpy.dot(self.y[:,k], r)/self.ys[k] r += (self.alpha[k] - beta) * self.s[:,k] return r | c0bee4a3d38becfd3132c7582b173cf009159bd1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13857/c0bee4a3d38becfd3132c7582b173cf009159bd1/lbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4834,
8799,
12,
2890,
16,
1400,
16,
331,
4672,
3536,
8155,
279,
3148,
17,
7737,
3017,
3086,
326,
783,
13594,
17,
7858,
6895,
17,
5649,
1137,
24769,
358,
326,
8322,
670,
20529,
3148,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4834,
8799,
12,
2890,
16,
1400,
16,
331,
4672,
3536,
8155,
279,
3148,
17,
7737,
3017,
3086,
326,
783,
13594,
17,
7858,
6895,
17,
5649,
1137,
24769,
358,
326,
8322,
670,
20529,
3148,
471,... |
wikipedia.output(u"* %s" % pl.aslink()) | wikipedia.output(u"* %s" % curpl.aslink()) | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' print "This bot has two modes: you can add a category link to all" print "pages mentioned in a List that is now in another wikipedia page" print "or you can add a category link to all pages that link to a" print "specific page. If you want the second, please give an empty" print "answer to the first question." listpage = wikipedia.input(u'Wikipedia page with list of pages to change:') if listpage: try: pl = wikipedia.Page(wikipedia.getSite(), listpage) except NoPage: wikipedia.output(u'The page ' + listpage + ' could not be loaded from the server.') sys.exit() pagenames = pl.links() else: refpage = wikipedia.input(u'Wikipedia page that is now linked to:') pl = wikipedia.Page(wikipedia.getSite(), refpage) pagenames = wikipedia.getReferences(pl) print " ==> %d pages to process"%len(pagenames) print newcat = wikipedia.input(u'Category to add (do not give namespace):') newcat = newcat[:1].capitalize() + newcat[1:] # get edit summary message wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg_add) % newcat) cat_namespace = wikipedia.getSite().category_namespaces()[0] answer = '' for nm in pagenames: pl2 = wikipedia.Page(wikipedia.getSite(), nm) if answer != 'a': answer = '' while answer not in ('y','n','a'): answer = wikipedia.input(u'%s [y/n/a(ll)]:' % (pl2.aslink())) if answer == 'a': confirm = '' while confirm not in ('y','n'): confirm = wikipedia.input(u'This should be used if and only if you are sure that your links are correct! Are you sure? [y/n]:') if answer == 'y' or answer == 'a': try: cats = pl2.categories() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist yet. Ignoring."%(pl2.aslocallink())) pass except wikipedia.IsRedirectPage,arg: pl3 = wikipedia.Page(wikipedia.getSite(),arg.args[0]) wikipedia.output(u"WARNING: %s is redirect to [[%s]]. Ignoring."%(pl2.aslocallink(),pl3.aslocallink())) else: wikipedia.output(u"Current categories:") for curpl in cats: wikipedia.output(u"* %s" % pl.aslink()) catpl = wikipedia.Page(wikipedia.getSite(), cat_namespace + ':' + newcat) if sort_by_last_name: catpl = sorted_by_last_name(catpl, pl2) if catpl in cats: wikipedia.output(u"%s already has %s"%(pl2.aslocallink(), catpl.aslocallink())) else: wikipedia.output(u'Adding %s' % catpl.aslocallink()) cats.append(catpl) text = pl2.get() text = wikipedia.replaceCategoryLinks(text, cats) pl2.put(text) | f6ecf9a5931e1c4c8aac83057e513ba1985e64ab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/f6ecf9a5931e1c4c8aac83057e513ba1985e64ab/category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
1172,
315,
2503,
2512,
711,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
1172,
315,
2503,
2512,
711,... |
for n in xrange((bisect.bisect_left(self.bins, new) or 1) - 1, len(self.bins)): | for n in xrange(bisect.bisect_left(tuple(bin.extent[1] for bin in self.bins), new.extent[0]), len(self.bins)): | def pack(self, cache_entry): # find all bins in which this cache_entry belongs. the # test is, for each bin, to iterate through time slide # dictionaries applying the offsets to both the bin and the # cache_entry and checking if the cache_entry's segment # intersects the segments already in the bin, comparing # only those that are involved in the time slide. FIXME: # almost correct: still doesn't take care to compare only # the segments for the instruments identified in the offset # dictionary (so gives false positives but no false # negatives) new = LALCacheBin() new.add(cache_entry, cache_entry.to_segmentlistdict()) new.extent.protract(self.max_gap) matching_bins = [] for n in xrange((bisect.bisect_left(self.bins, new) or 1) - 1, len(self.bins)): bin = self.bins[n] for offsetdict in self.timeslides: new.size.offsets.update(offsetdict) bin.size.offsets.update(offsetdict) if bin.size.is_coincident(new.size): matching_bins.append(n) break bin.size.offsets.clear() new.size.offsets.clear() new.extent = new.size.extent_all() | 69866d56421b302c1276f750bf24cf85555eadc2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/69866d56421b302c1276f750bf24cf85555eadc2/ligolw_cafe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
1247,
67,
4099,
4672,
468,
1104,
777,
8963,
316,
1492,
333,
1247,
67,
4099,
11081,
18,
225,
326,
468,
1842,
353,
16,
364,
1517,
4158,
16,
358,
7401,
3059,
813,
1270... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2890,
16,
1247,
67,
4099,
4672,
468,
1104,
777,
8963,
316,
1492,
333,
1247,
67,
4099,
11081,
18,
225,
326,
468,
1842,
353,
16,
364,
1517,
4158,
16,
358,
7401,
3059,
813,
1270... |
zones.remove(0) | def initVisibility(self): # start out with every zone visible, since none of the zones have # been hidden self.curVisibleZoneNums = list2dict(self.zoneNums) # we have not entered any zone yet self.curZoneNum = None | 6c7bc22d3edc012fb50a48366d51db144c437ede /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/6c7bc22d3edc012fb50a48366d51db144c437ede/DistributedLevel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
10135,
12,
2890,
4672,
468,
787,
596,
598,
3614,
4157,
6021,
16,
3241,
6555,
434,
326,
13975,
1240,
468,
2118,
5949,
365,
18,
1397,
6207,
4226,
25532,
273,
666,
22,
1576,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
10135,
12,
2890,
4672,
468,
787,
596,
598,
3614,
4157,
6021,
16,
3241,
6555,
434,
326,
13975,
1240,
468,
2118,
5949,
365,
18,
1397,
6207,
4226,
25532,
273,
666,
22,
1576,
12,
2890,... | |
is_secure, port, proxy, proxy_port, debug) | is_secure, port, proxy, proxy_port, debug, https_connection_factory) | def __init__(self, aws_access_key_id=None, aws_secret_access_key=None, is_secure=False, port=None, proxy=None, proxy_port=None, host=DefaultHost, debug=0): AWSAuthConnection.__init__(self, host, aws_access_key_id, aws_secret_access_key, is_secure, port, proxy, proxy_port, debug) | f50fd1f8a801bb1d9b2b389bc0ba0ef716f89186 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1098/f50fd1f8a801bb1d9b2b389bc0ba0ef716f89186/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
353,
67,
8869,
33,
8381,
16,
1756,
33,
7036,
16,
288... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
353,
67,
8869,
33,
8381,
16,
1756,
33,
7036,
16,
288... |
server.start() | def main(): | 5ff7b3b6722adf0535960e4a3538deb96c66b426 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11436/5ff7b3b6722adf0535960e4a3538deb96c66b426/crossfire_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer, ForkingUnixDatagramServer] | dgramservers = [UnixDatagramServer, ThreadingUnixDatagramServer] if hasattr(os, 'fork') and os.name not in ('os2',): dgramservers.append(ForkingUnixDatagramServer) | def testloop(proto, servers, hdlrcls, testfunc): for svrcls in servers: addr = pickaddr(proto) if verbose: print "ADDR =", addr print "CLASS =", svrcls t = ServerThread(addr, svrcls, hdlrcls) if verbose: print "server created" t.start() if verbose: print "server running" for i in range(NREQ): time.sleep(DELAY) if verbose: print "test client", i testfunc(proto, addr) if verbose: print "waiting for server" t.join() if verbose: print "done" | fc404ffca54cf3ad7ff2f378554f4d638e969082 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fc404ffca54cf3ad7ff2f378554f4d638e969082/test_socketserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6498,
12,
9393,
16,
7084,
16,
366,
5761,
86,
6429,
16,
1842,
644,
4672,
364,
5893,
86,
6429,
316,
7084,
30,
3091,
273,
6002,
4793,
12,
9393,
13,
309,
3988,
30,
1172,
315,
14142,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6498,
12,
9393,
16,
7084,
16,
366,
5761,
86,
6429,
16,
1842,
644,
4672,
364,
5893,
86,
6429,
316,
7084,
30,
3091,
273,
6002,
4793,
12,
9393,
13,
309,
3988,
30,
1172,
315,
14142,
... |
for (file, name) in opts.get('modules', []): if not self.add_module(file, 0): self.add_module(name, 0) | if opts.get('private_css', 'default') in STYLESHEETS.keys(): self._private_css_var.set(opts.get('private_css', 'default')) else: self._private_css_var.set('-other-') self._css_entry.insert(0, opts.get('private_css', 'default')) except Exception, e: sys.stderr.write('!!!Error opening %s: %s\n!!!' % (prjfile, e)) self._root.bell() | def open(self, prjfile): self._filename = prjfile if 1:#try: opts = load(open(prjfile, 'r')) opts['modules'].sort(lambda e1, e2: cmp(e1[1], e2[1])) self._name_entry.delete(0, 'end') if opts.get('prj_name'): self._name_entry.insert(0, opts['prj_name']) self._url_entry.delete(0, 'end') if opts.get('prj_url'): self._url_entry.insert(0, opts['prj_url']) self._out_entry.delete(0, 'end') self._out_entry.insert(0, opts.get('outdir', 'html')) self._css_entry.delete(0, 'end') if opts.get('css', 'default') in STYLESHEETS.keys(): self._css_var.set(opts.get('css', 'default')) else: self._css_var.set('-other-') self._css_entry.insert(0, opts.get('css', 'default')) for (file, name) in opts.get('modules', []): if not self.add_module(file, 0): self.add_module(name, 0) #except: # self._top.bell() | 4cf6d74130c32443c10897614b39d1c2c512796c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/4cf6d74130c32443c10897614b39d1c2c512796c/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
27378,
768,
4672,
365,
6315,
3459,
273,
27378,
768,
309,
404,
27363,
698,
30,
1500,
273,
1262,
12,
3190,
12,
683,
78,
768,
16,
296,
86,
26112,
1500,
3292,
6400,
294... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
27378,
768,
4672,
365,
6315,
3459,
273,
27378,
768,
309,
404,
27363,
698,
30,
1500,
273,
1262,
12,
3190,
12,
683,
78,
768,
16,
296,
86,
26112,
1500,
3292,
6400,
294... |
print 'Loading %d article(s)' % len(read_funcs) | log.debug('Loading %d article(s)', len(read_funcs)) | def article_load_started(self, read_funcs): print 'Loading %d article(s)' % len(read_funcs) self.tabs.blockSignals(True) for read_func in read_funcs: view = QWebView() view.setPage(WebPage(self)) view.setHtml('Loading...') view.setProperty('loading', QVariant(True)) dictionary = read_func.source dict_title = format_title(dictionary) view.setProperty('dictionary', QVariant(dictionary.uuid)) self.tabs.addTab(view, dict_title) self.tabs.setTabToolTip(self.tabs.count() - 1, u'\n'.join((dict_title, read_func.title))) self.select_preferred_dict() self.tabs.blockSignals(False) | 67a3086e42b74c3a053a1f3d5818584b41ba19d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14305/67a3086e42b74c3a053a1f3d5818584b41ba19d4/qtui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7559,
67,
945,
67,
14561,
12,
2890,
16,
855,
67,
17728,
4672,
613,
18,
4148,
2668,
10515,
738,
72,
7559,
12,
87,
13,
2187,
562,
12,
896,
67,
17728,
3719,
365,
18,
16056,
18,
2629,
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,
7559,
67,
945,
67,
14561,
12,
2890,
16,
855,
67,
17728,
4672,
613,
18,
4148,
2668,
10515,
738,
72,
7559,
12,
87,
13,
2187,
562,
12,
896,
67,
17728,
3719,
365,
18,
16056,
18,
2629,
23... |
debit = credit = 0.0 context.update({'date':inv.date_invoice}) context_unreconciled=context.copy() | if inv.reconciled: res[inv.id] = 0.0 continue inv_total = inv.amount_total context_unreconciled = context.copy() | def _amount_residual(self, cr, uid, ids, name, args, context=None): res = {} if context is None: context = {} | de07ce885d3aa664797929fae2a42f5331431229 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/de07ce885d3aa664797929fae2a42f5331431229/invoice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8949,
67,
455,
5557,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
400,
273,
2618,
309,
819,
353,
599,
30,
819,
273,
2618,
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,
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,
389,
8949,
67,
455,
5557,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
400,
273,
2618,
309,
819,
353,
599,
30,
819,
273,
2618,
2,
-100,
-100,
... |
ret = { 'val': None, 'msg': 'Not yet implemented' } response = HttpResponse(content_type="application/json") simplejson.dump(classrooms_dicts, ret) return response | return self.ajax_schedule_last_changed_cached(prog) @cache_function def ajax_schedule_last_changed_cached(self, prog): ret = { 'val': str(get_uuid()), 'msg': 'UUID that changes every time the schedule is updated' } response = HttpResponse(content_type="application/json") simplejson.dump(ret, response) response.raw_value = ret return response ajax_schedule_last_changed_cached.get_or_create_token(('prog',)) ajax_schedule_last_changed_cached.depend_on_model(lambda: ResourceAssignment) ajax_schedule_last_changed_cached.depend_on_model(lambda:Resource) ajax_schedule_last_changed_cached.depend_on_model(lambda: ResourceRequest) ajax_schedule_last_changed_cached.depend_on_model(lambda: Event) ajax_schedule_last_changed_cached.depend_on_model(lambda: UserBit) ajax_schedule_last_changed_cached.depend_on_model(lambda: ClassSection) | def ajax_schedule_last_changed(self, request, tl, one, two, module, extra, prog): ret = { 'val': None, # Should either be 'None' or a valid datetime object corresponding the the timestamp at which the schedule was last changed in any way 'msg': 'Not yet implemented' } | 44838a9a08be2b6a7f14955f6210e2ff0f554fd2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/44838a9a08be2b6a7f14955f6210e2ff0f554fd2/ajaxschedulingmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10733,
67,
10676,
67,
2722,
67,
6703,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
325,
273,
288,
296,
1125,
4278,
599,
16,
225,
468,
9363,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10733,
67,
10676,
67,
2722,
67,
6703,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
325,
273,
288,
296,
1125,
4278,
599,
16,
225,
468,
9363,
3... |
if os.path.exists(BaseTool.TMP_DIR): shutil.rmtree(BaseTool.TMP_DIR) os.mkdir(BaseTool.TMP_DIR) | self.temp_dir = tempfile.mkdtemp() | def __init__(self): # If we have a testing.tmp directory, we didn't cleanup last time. if os.path.exists(BaseTool.TMP_DIR): shutil.rmtree(BaseTool.TMP_DIR) os.mkdir(BaseTool.TMP_DIR) | 09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
971,
732,
1240,
279,
7769,
18,
5645,
1867,
16,
732,
10242,
1404,
6686,
1142,
813,
18,
309,
1140,
18,
803,
18,
1808,
12,
2171,
6364,
18,
28259,
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,
1001,
2738,
972,
12,
2890,
4672,
468,
971,
732,
1240,
279,
7769,
18,
5645,
1867,
16,
732,
10242,
1404,
6686,
1142,
813,
18,
309,
1140,
18,
803,
18,
1808,
12,
2171,
6364,
18,
28259,
67,... |
nodes = [] | nodes = set() | def make_burca2_fragment(dag, parents, input_cache, tag): # note that the likelihood data collection step immediately # preceding this is a choke point in the pipeline, where all jobs # must complete before anything else can begin, so there is no # advantage in grouping files in time order at this stage. # therefore, to load balance the jobs, we randomize the input # files. input_cache = list(input_cache) random.shuffle(input_cache) nodes = [] # FIXME: this whole function just isn't the way I want this to # work. I want to provide DAG nodes, not input files... while input_cache: node = BurcaNode(burca2job) node.set_name("ligolw_burca2_%s_%d" % (tag, len(nodes))) node.add_macro("macrocomment", tag) node.add_input_cache(input_cache[-10:]) del input_cache[-10:] for parent in parents: node.add_parent(parent) nodes.append(node) dag.add_node(node) return nodes | 40a9937130115c4762623af8bdfa60662e979e5f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/40a9937130115c4762623af8bdfa60662e979e5f/power.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
70,
295,
5353,
22,
67,
11956,
12,
30204,
16,
6298,
16,
810,
67,
2493,
16,
1047,
4672,
468,
4721,
716,
326,
18067,
501,
1849,
2235,
7636,
468,
19969,
333,
353,
279,
462,
3056,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
70,
295,
5353,
22,
67,
11956,
12,
30204,
16,
6298,
16,
810,
67,
2493,
16,
1047,
4672,
468,
4721,
716,
326,
18067,
501,
1849,
2235,
7636,
468,
19969,
333,
353,
279,
462,
3056,... |
for aCompartment in self.CompartmentList: if ( self.Level == 1 ): | if ( self.Level == 1 ): for aCompartment in self.CompartmentList: | def getPath( self, aCompartmentID ): for aCompartment in self.CompartmentList: if ( self.Level == 1 ): if ( aCompartment[1] == aCompartmentID ): if ( aCompartment[6] == '' ): aPath = '/' + aCompartmentID return aPath else: aPath = self.getPath( aCompartment[6] ) + '/' + aCompartmentID return aPath | 5558e00913030ea93e1b91139dd82f86730b4cf9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/5558e00913030ea93e1b91139dd82f86730b4cf9/convertSBML2EML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
365,
16,
279,
799,
15750,
734,
262,
30,
225,
309,
261,
365,
18,
2355,
422,
404,
262,
30,
364,
279,
799,
15750,
316,
365,
18,
799,
15750,
682,
30,
309,
261,
279,
799,
15750,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4339,
12,
365,
16,
279,
799,
15750,
734,
262,
30,
225,
309,
261,
365,
18,
2355,
422,
404,
262,
30,
364,
279,
799,
15750,
316,
365,
18,
799,
15750,
682,
30,
309,
261,
279,
799,
15750,... |
remote_key = ConnectRegistry(remote_name, HKEY_CURRENT_USER) except EnvironmentError, exc: print "Could not connect to the remote machine -", exc.strerror remote_key = None if remote_key is not None: TestAll(remote_key) print "Remote registry tests worked" else: print "Remote registry calls can be tested using", print "'test_winreg.py --remote \\\\machine_name'" h = ConnectRegistry(None, HKEY_LOCAL_MACHINE) h.Close() | WinregTests.remote_name = sys.argv[sys.argv.index("--remote")+1] except (IndexError, ValueError): print "Remote registry calls can be tested using", print "'test_winreg.py --remote \\\\machine_name'" WinregTests.remote_name = None test_main() | def TestAll(root_key): WriteTestData(root_key) ReadTestData(root_key) DeleteTestData(root_key) | a3865fddcb24adeae97886ce81e1f18e4070c715 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/a3865fddcb24adeae97886ce81e1f18e4070c715/test_winreg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
1595,
12,
3085,
67,
856,
4672,
2598,
4709,
751,
12,
3085,
67,
856,
13,
2720,
4709,
751,
12,
3085,
67,
856,
13,
2504,
4709,
751,
12,
3085,
67,
856,
13,
225,
2,
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,
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,
7766,
1595,
12,
3085,
67,
856,
4672,
2598,
4709,
751,
12,
3085,
67,
856,
13,
2720,
4709,
751,
12,
3085,
67,
856,
13,
2504,
4709,
751,
12,
3085,
67,
856,
13,
225,
2,
-100,
-100,
-100,... |
cmd += ' >& %s/freevo_record_%s.log &' % (config.LOGDIR, int(time.time())) | cmd = self.cmd + ' >& %s/freevo_record_%s.log &' % (config.LOGDIR, int(time.time())) | def make_cmd(self): '''Build the command line for this recording.''' | a1a318b986b324db50c849510235040fcceb7f49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/a1a318b986b324db50c849510235040fcceb7f49/record_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4172,
12,
2890,
4672,
9163,
3116,
326,
1296,
980,
364,
333,
14949,
1093,
6309,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4172,
12,
2890,
4672,
9163,
3116,
326,
1296,
980,
364,
333,
14949,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if( skill != wolfpack.FENCING and skill != wolfpack.MACEFIGHTING and skill != wolfpack.SWORDSMANSHIP and skill != wolfpack.WRESTLING ): | if( skill != FENCING and skill != MACEFIGHTING and skill != SWORDSMANSHIP and skill != WRESTLING ): | def onUse( char, item ): # Either the dummy is swinging or we aren't assigned to a dummy if( item.id != 0x1070 and item.id != 0x1074 ): return 1 # Distance & Direction checks if( char.distanceto( item ) > 1 ): char.message( 'You must be standing in front of or behind the dummy to use it.' ) return 1 # Calculates the direction we'll have to look # to focus the dummy direction = char.directionto( item ) # For a n/s dummy we need to either face north or south if( item.id == 0x1070 and direction != 0 and direction != 4 ): char.message( 'You must be standing in front of or behind the dummy to use it.' ) return 1 # For a e/w dummy we need to either face eath or west elif( item.id == 0x1074 and direction != 2 and direction != 6 ): char.message( 'You must be standing in front of or behind the dummy to use it.' ) return 1 # Turn to the correct direction if( char.direction != direction ): char.direction = direction char.update() skill = char.combatskill() # Determine the combat skill used by the character # We can only train FENCING+MACEFIGHTING+SWORDSMANSHIP+WRESTLING if( skill != wolfpack.FENCING and skill != wolfpack.MACEFIGHTING and skill != wolfpack.SWORDSMANSHIP and skill != wolfpack.WRESTLING ): char.message( "You can't train with this weapon on this dummy." ) return 1 # If we've already learned all we can > cancel. if( char.baseskill[ skill ] >= 300 ): char.message( "You can learn much from a dummy but you have already learned it all." ) return 1 # This increases the users skill char.checkskill( skill, 0, 1000 ) # Display the char-action # (combat swing 1handed) char.action( 0x09 ) if( item.id == 0x1070 or item.id == 0x1074 ): item.id += 1 # Resend the item to surrounding clients after # changing the id and play the soundeffect # originating from the dummy item.update() item.soundeffect( 0x33 ) # Add a timer to reset the id wolfpack.addtimer( "training_dummy.resetid", 3000, (item.serial,) ) return 1 | 57cb06e8c6c8e74aa2c51a4b85d82a344202b5cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/57cb06e8c6c8e74aa2c51a4b85d82a344202b5cb/training_dummy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3727,
12,
1149,
16,
761,
262,
30,
468,
14635,
326,
9609,
353,
9028,
310,
578,
732,
11526,
1404,
6958,
358,
279,
9609,
309,
12,
761,
18,
350,
480,
374,
92,
2163,
7301,
471,
761,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3727,
12,
1149,
16,
761,
262,
30,
468,
14635,
326,
9609,
353,
9028,
310,
578,
732,
11526,
1404,
6958,
358,
279,
9609,
309,
12,
761,
18,
350,
480,
374,
92,
2163,
7301,
471,
761,
... |
self.run_in_target('chown', '-R', '%s:%s' % (self.vm.user,)*2, '/home/%s/.ssh/' % (self.vm.user)) | self.run_in_target('chown', '-R', '%s:%s' % ((self.vm.user,)*2), '/home/%s/.ssh/' % (self.vm.user)) | def install_authorized_keys(self): if self.vm.ssh_key: os.mkdir('%s/root/.ssh' % self.destdir, 0700) shutil.copy(self.vm.ssh_key, '%s/root/.ssh/authorized_keys' % self.destdir) os.chmod('%s/root/.ssh/authorized_keys' % self.destdir, 0644) if self.vm.ssh_user_key: os.mkdir('%s/home/%s/.ssh' % (self.destdir, self.vm.user), 0700) shutil.copy(self.vm.ssh_user_key, '%s/home/%s/.ssh/authorized_keys' % (self.destdir, self.vm.user)) os.chmod('%s/home/%s/.ssh/authorized_keys' % (self.destdir, self.vm.user), 0644) self.run_in_target('chown', '-R', '%s:%s' % (self.vm.user,)*2, '/home/%s/.ssh/' % (self.vm.user)) | c45bb8a3a25357d5016a0fde4ba39bada62ea962 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1496/c45bb8a3a25357d5016a0fde4ba39bada62ea962/dapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
8434,
67,
2452,
12,
2890,
4672,
309,
365,
18,
3489,
18,
10975,
67,
856,
30,
1140,
18,
26686,
29909,
87,
19,
3085,
15865,
10975,
11,
738,
365,
18,
10488,
1214,
16,
10934,
713,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
8434,
67,
2452,
12,
2890,
4672,
309,
365,
18,
3489,
18,
10975,
67,
856,
30,
1140,
18,
26686,
29909,
87,
19,
3085,
15865,
10975,
11,
738,
365,
18,
10488,
1214,
16,
10934,
713,... |
_task_params["priority"] = int(opt[1]) | _TASK_PARAMS["priority"] = int(opt[1]) | def _task_build_params( task_name, argv, description="", help_specific_usage="", version=__revision__, specific_params=("", []), task_submit_elaborate_specific_parameter_fnc=None, task_submit_check_options_fnc=None): """ Build the BibTask params. @param argv: a list of string as in sys.argv @param description: is the generic description printed in the usage page; @param help_specific_usage: is the specific parameter help @param task_submit_elaborate_specific_parameter_fnc: will be called passing a key and a value, for parsing specific cli parameters. Must return True if it has recognized the parameter. Must eventually update the options with bibtask_set_option; @param task_submit_check_options: must check the validity of options (via bibtask_get_option) once all the options where parsed; """ global _task_params, _options _options = {} if task_name in CFG_BIBTASK_DEFAULT_TASK_SETTINGS: _options.update(CFG_BIBTASK_DEFAULT_TASK_SETTINGS[task_name]) # set user-defined options: try: (short_params, long_params) = specific_params opts, args = getopt.gnu_getopt(argv[1:], "hVv:u:s:t:P:N:L:" + short_params, [ "help", "version", "verbose=", "user=", "sleep=", "runtime=", "priority=", "name=", "limit=", "profile=" ] + long_params) except getopt.GetoptError, err: _usage(1, err, help_specific_usage=help_specific_usage, description=description) try: for opt in opts: if opt[0] in ("-h", "--help"): _usage(0, help_specific_usage=help_specific_usage, description=description) elif opt[0] in ("-V", "--version"): print _task_params["version"] sys.exit(0) elif opt[0] in ("-u", "--user"): _task_params["user"] = opt[1] elif opt[0] in ("-v", "--verbose"): _task_params["verbose"] = int(opt[1]) elif opt[0] in ("-s", "--sleeptime"): if task_name not in CFG_TASK_IS_NOT_A_DEAMON: get_datetime(opt[1]) # see if it is a valid shift _task_params["sleeptime"] = opt[1] elif opt[0] in ("-t", "--runtime"): _task_params["runtime"] = get_datetime(opt[1]) elif opt[0] in ("-P", "--priority"): _task_params["priority"] = int(opt[1]) elif opt[0] in ("-N", "--name"): _task_params["task_specific_name"] = opt[1] elif opt[0] in ("-L", "--limit"): _task_params["runtime_limit"] = parse_runtime_limit(opt[1]) elif opt[0] in ("--profile", ): _task_params["profile"] += opt[1].split(',') elif not callable(task_submit_elaborate_specific_parameter_fnc) or \ not task_submit_elaborate_specific_parameter_fnc(opt[0], opt[1], opts, args): _usage(1, help_specific_usage=help_specific_usage, description=description) except StandardError, e: _usage(e, help_specific_usage=help_specific_usage, description=description) if callable(task_submit_check_options_fnc): if not task_submit_check_options_fnc(): _usage(1, help_specific_usage=help_specific_usage, description=description) | e9bc8dbefc702ea212bd46520d513f1d8b201695 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/e9bc8dbefc702ea212bd46520d513f1d8b201695/bibtask.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4146,
67,
3510,
67,
2010,
12,
1562,
67,
529,
16,
5261,
16,
2477,
1546,
3113,
2809,
67,
12524,
67,
9167,
1546,
3113,
1177,
33,
972,
13057,
972,
16,
2923,
67,
2010,
33,
2932,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4146,
67,
3510,
67,
2010,
12,
1562,
67,
529,
16,
5261,
16,
2477,
1546,
3113,
2809,
67,
12524,
67,
9167,
1546,
3113,
1177,
33,
972,
13057,
972,
16,
2923,
67,
2010,
33,
2932,
3113,
... |
return (location and CLSD_TITLE or CLD_TITLE) % args | return (location and CLSD_TITLE or CSD_TITLE) % args | def buildItemDescription(mailStamp): #XXX Post Preview I will clean up # this logic since there are more # efficient ways to get the # item description strings. # Most likely will use a dict # instead of Globals for localizable strings # then build the key dynamically based on # recurrence frequency / interval and whether # the Event has a location and a recurrence # end date item = mailStamp.itsItem view = item.itsView isEvent = has_stamp(item, EventStamp) if isEvent: event = EventStamp(item) master = event.getMaster() recur = getattr(event, 'rruleset', None) noTime = event.allDay or event.anyTime location = getattr(event, 'location', u'') if location: location = location.displayName.strip() startDate, startTime = formatDateAndTime(view, event.startTime) endDate, endTime = formatDateAndTime(view, event.endTime) if getattr(event.startTime, "tzinfo", None) == view.tzinfo.floating: timezone = u"" else: timezone = getTimeZoneCode(view, event.startTime) if startDate == endDate: # The Event starts and ends on the same day endDate = None args = {'title': item.displayName, 'startTime': startTime, 'startDate': startDate, 'endTime': endTime, 'endDate': endDate, 'location': location, 'timezone': timezone, } if recur: args['masterStartDate'], args['masterStartTime'] = \ formatDateAndTime(view, master.startTime) args['masterEndDate'], args['masterEndTime'] = \ formatDateAndTime(view, master.endTime) args['masterTimeZone'] = getTimeZoneCode(view, master.startTime) if recur.isComplex(): if noTime: if endDate: return (location and CLD_TITLE or CD_TITLE) % args else: return (location and CL_TITLE or C_TITLE) % args if endDate: return (location and CLSD_TITLE or CLD_TITLE) % args else: return (location and CLS_TITLE or CL_TITLE) % args rule = recur.rrules.first() freq = rule.freq interval = rule.interval until = rule.calculatedUntil() args['recurrenceEndDate'] = until and formatDateAndTime(view, until)[0] or u'' ret = None if freq == "daily": if noTime: if until: ret = location and DUL_TITLE or DU_TITLE else: ret = location and DL_TITLE or D_TITLE else: if until: ret = location and DTUL_TITLE or DTU_TITLE else: ret = location and DTL_TITLE or DT_TITLE elif freq == "weekly": args['dayName'] = weekdayName(event.startTime) if noTime: if until: if interval == 2: ret = location and BUL_TITLE or BU_TITLE else: ret = location and WUL_TITLE or WU_TITLE else: if interval == 2: ret = location and BL_TITLE or B_TITLE else: ret = location and WL_TITLE or W_TITLE else: if until: if interval == 2: ret = location and BTUL_TITLE or BTU_TITLE else: ret = location and WTUL_TITLE or WTU_TITLE else: if interval == 2: ret = location and BTL_TITLE or BT_TITLE else: ret = location and WTL_TITLE or WT_TITLE elif freq == "monthly": num = int(PyICU.SimpleDateFormat(_(u"dd")).format(event.startTime)) args['abbreviation'] = PyICU.ChoiceFormat(DAY_OF_MONTH).format(num) args['dayOfMonth'] = num if noTime: if until: ret = location and MUL_TITLE or MU_TITLE else: ret = location and ML_TITLE or M_TITLE else: if until: ret = location and MTUL_TITLE or MTU_TITLE else: ret = location and MTL_TITLE or MT_TITLE elif freq == "yearly": if noTime: if until: ret = location and YUL_TITLE or YU_TITLE else: ret = location and YL_TITLE or Y_TITLE else: if until: if endDate: ret = location and YTULD_TITLE or YTUD_TITLE else: ret = location and YTUL_TITLE or YTU_TITLE else: if endDate: ret = location and YTLD_TITLE or YTD_TITLE else: ret = location and YTL_TITLE or YT_TITLE return ret % args if noTime: if endDate: return (location and ALD_TITLE or AD_TITLE) % args else: return (location and AL_TITLE or A_TITLE) % args else: if endDate: return (location and ELD_TITLE or ED_TITLE) % args else: return (location and EL_TITLE or E_TITLE) % args return item.displayName | 3ba7c328b2c98e3845fdea7a2d9641207c27c23a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/3ba7c328b2c98e3845fdea7a2d9641207c27c23a/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
1180,
3291,
12,
4408,
8860,
4672,
468,
15639,
5616,
22289,
467,
903,
2721,
731,
468,
333,
4058,
3241,
1915,
854,
1898,
468,
14382,
16226,
358,
336,
326,
468,
761,
2477,
2064,
18,
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,
1361,
1180,
3291,
12,
4408,
8860,
4672,
468,
15639,
5616,
22289,
467,
903,
2721,
731,
468,
333,
4058,
3241,
1915,
854,
1898,
468,
14382,
16226,
358,
336,
326,
468,
761,
2477,
2064,
18,
4... |
while parallelize_isfunctionfinished(phandle) == False: | while not parallelize_isfunctionfinished(phandle): | def locateandprocessvessels(statefunctionargtuplelist, uniquename, sleeptime, acceptnewnode=False,parallelinstances=1): """ <Purpose> Looks up a public key and then calls a function on a set of nodes <Arguments> statefunctionargtuplelist: A list of tuples with a start state (publickey), end state (publickey), a function to change the node state, and a list of arguments to the function. The function has the first two arguments already provided, the node handle and the node name. uniquename: A unique name for this action that can be used for logging and to ensure multiple copies aren't running sleeptime: The amount of time to sleep between lookups / node processing acceptnewnode: Allow a new node to have the following key. Will create a new key and add a per node key to the database parallelinstances: The number of concurrent events that should process nodes. <Exceptions> None <Side Effects> Ensures there is only one lookup for this key happening at a time <Returns> This function runs forever (unless there is a fatal error) """ logfn = "log."+str(uniquename) # set up the circular logger (at least 50 MB buffer) loggerfo = logging.circular_logger(logfn, 50*1024*1024) # redirect standard out / error to the circular log buffer sys.stdout = loggerfo sys.stderr = loggerfo lockname = "polling."+uniquename time_updatetime(34612) # get a unique lock based upon the key if runonce.getprocesslock(lockname) != True: # Someone else has the lock... print time.time(),"The lock is held. Exiting" return print time.time(),"Starting..." # BUG: There could be a nasty race here where a node isn't seen as in a # state because it doesn't advertise in time to be listed. # This will be fixed when we fix the NM advertisement bug (next update) so # I'll leave it in for now. cachednodelist = [] while True: for statefunctionargtuple in statefunctionargtuplelist: startstate = statefunctionargtuple[0] endstate = statefunctionargtuple[1] nodeprocessfunction = statefunctionargtuple[2] args = statefunctionargtuple[3:] # I likely need to do something smart here when this fails... nodelist = advertise.lookup(startstate) # shuffle the nodelist to avoid reoccurring failures on processing # the same node over and over -- allows us to eventually process # other nodes random.shuffle(nodelist) print time.time(),"For start state '"+str(startstate['e'])[:10]+"...' found nodelist:",nodelist | 8bc026a50e60280d4f30df59ce49673f1feff62b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7263/8bc026a50e60280d4f30df59ce49673f1feff62b/pollinglib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
464,
2567,
90,
403,
10558,
12,
2019,
915,
3175,
88,
89,
412,
5449,
16,
15426,
1069,
16,
272,
11182,
10650,
16,
2791,
2704,
2159,
33,
8381,
16,
18054,
10162,
33,
21,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
464,
2567,
90,
403,
10558,
12,
2019,
915,
3175,
88,
89,
412,
5449,
16,
15426,
1069,
16,
272,
11182,
10650,
16,
2791,
2704,
2159,
33,
8381,
16,
18054,
10162,
33,
21,
4672,
3536,
... |
return self._p_blob_uncommitted or self._p_blob_data | return self._p_blob_uncommitted or self._p_blob_committed | def _current_filename(self): # NOTE: _p_blob_data and _p_blob_uncommitted appear by virtue of # Connection._setstate return self._p_blob_uncommitted or self._p_blob_data | 643e267fc6a101e92771800dab10b088efbf4084 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10048/643e267fc6a101e92771800dab10b088efbf4084/blob.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2972,
67,
3459,
12,
2890,
4672,
468,
5219,
30,
389,
84,
67,
10721,
67,
892,
471,
389,
84,
67,
10721,
67,
551,
362,
7948,
9788,
635,
331,
2714,
344,
434,
468,
4050,
6315,
542,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2972,
67,
3459,
12,
2890,
4672,
468,
5219,
30,
389,
84,
67,
10721,
67,
892,
471,
389,
84,
67,
10721,
67,
551,
362,
7948,
9788,
635,
331,
2714,
344,
434,
468,
4050,
6315,
542,
20... |
writeQuickStub(f, method, stubName) | writeQuickStub(f, customMethodCalls, method, stubName) | def writeMethodStub(f, method): """ Write a method stub to `f`. Return an xpc_qsFunctionSpec initializer. """ stubName = method.iface.name + '_' + header.methodNativeName(method) writeQuickStub(f, method, stubName) fs = '{"%s", %s, %d}' % (method.name, stubName, len(method.params)) return fs | ff779f91c85a5fbb1f57868d70359366fb6c4a65 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/ff779f91c85a5fbb1f57868d70359366fb6c4a65/qsgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1305,
11974,
12,
74,
16,
707,
4672,
3536,
2598,
279,
707,
7168,
358,
1375,
74,
8338,
2000,
392,
619,
2436,
67,
12926,
2083,
1990,
12562,
18,
3536,
7168,
461,
273,
707,
18,
31479,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1305,
11974,
12,
74,
16,
707,
4672,
3536,
2598,
279,
707,
7168,
358,
1375,
74,
8338,
2000,
392,
619,
2436,
67,
12926,
2083,
1990,
12562,
18,
3536,
7168,
461,
273,
707,
18,
31479,
... |
cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" | cmd = form.getvalue("cmd", "view") page = form.getvalue("page", "FrontPage") | def main(): form = cgi.FieldStorage() print "Content-type: text/html" print cmd = form.getvalue("cmd") or "view" page = form.getvalue("page") or "FrontPage" wiki = WikiPage(page) wiki.load() method = getattr(wiki, 'cmd_' + cmd, None) or wiki.cmd_view method(form) | 307b4e75ddd2dfcf11ad0cd156e368354a309e7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/307b4e75ddd2dfcf11ad0cd156e368354a309e7f/cgi3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
646,
273,
276,
10052,
18,
974,
3245,
1435,
1172,
315,
1350,
17,
723,
30,
977,
19,
2620,
6,
1172,
1797,
273,
646,
18,
588,
1132,
2932,
4172,
3113,
315,
1945,
7923,
1363,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
646,
273,
276,
10052,
18,
974,
3245,
1435,
1172,
315,
1350,
17,
723,
30,
977,
19,
2620,
6,
1172,
1797,
273,
646,
18,
588,
1132,
2932,
4172,
3113,
315,
1945,
7923,
1363,
27... |
self.stop_now = True | self.stop_now = True | def expand_directory(self, item, stop_when_image_found, go_buttons_enabled): if self.stop_now == False and self.closing_app == False: folderlist = [] | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
5149,
12,
2890,
16,
761,
16,
2132,
67,
13723,
67,
2730,
67,
7015,
16,
1960,
67,
16016,
67,
5745,
4672,
309,
365,
18,
5681,
67,
3338,
422,
1083,
471,
365,
18,
19506,
67,
291... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4542,
67,
5149,
12,
2890,
16,
761,
16,
2132,
67,
13723,
67,
2730,
67,
7015,
16,
1960,
67,
16016,
67,
5745,
4672,
309,
365,
18,
5681,
67,
3338,
422,
1083,
471,
365,
18,
19506,
67,
291... |
uri = "http://%s:%s/%s" % (hostname,port,path) | uri = "http://%s:%s%s" % (hostname,port,path) | def __init__(self): ServerConnection.__init__(self, None) self.handler = RedfootServerConnection.handler | 3bc3a7bbb476ef1def5fa3a28de4d3da08129c7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/3bc3a7bbb476ef1def5fa3a28de4d3da08129c7a/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3224,
1952,
16186,
2738,
972,
12,
2890,
16,
599,
13,
365,
18,
4176,
273,
4621,
10923,
2081,
1952,
18,
4176,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3224,
1952,
16186,
2738,
972,
12,
2890,
16,
599,
13,
365,
18,
4176,
273,
4621,
10923,
2081,
1952,
18,
4176,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
PythonUtil.uniqueElements(vzl) | uniqueElements(vzl) | def _sendAddInterest(self, contextId, scopeId, parentId, zoneIdList): """ Part of the new otp-server code. | 48362bd801ca5fd4df968b9f15660545c2d55dc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/48362bd801ca5fd4df968b9f15660545c2d55dc3/DoInterestManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
986,
29281,
12,
2890,
16,
819,
548,
16,
2146,
548,
16,
11582,
16,
4157,
22117,
4672,
3536,
6393,
434,
326,
394,
28625,
17,
3567,
981,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
986,
29281,
12,
2890,
16,
819,
548,
16,
2146,
548,
16,
11582,
16,
4157,
22117,
4672,
3536,
6393,
434,
326,
394,
28625,
17,
3567,
981,
18,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
self.logger.warning("ThreadPackageGlobalMirror mirroring command failed %s:%s %s"%(target, root, str(result))) | self.logger.warning("ThreadPackageGlobalMirror mirroring command failed %s:%s %s" % (target, root, str(result))) | def onSuccess(self, result, args): target, root = args out, err, code = result if code == 0: self.logger.debug("ThreadPackageGlobalMirror succeed on %s:%s"%(target, root)) else: self.logger.warning("ThreadPackageGlobalMirror mirroring command failed %s:%s %s"%(target, root, str(result))) | 7879d145d6e1f41cca4fb3f4649b20d89d33e95f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/7879d145d6e1f41cca4fb3f4649b20d89d33e95f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20613,
12,
2890,
16,
563,
16,
833,
4672,
1018,
16,
1365,
273,
833,
596,
16,
393,
16,
981,
273,
563,
309,
981,
422,
374,
30,
365,
18,
4901,
18,
4148,
2932,
3830,
2261,
5160,
13035,
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,
20613,
12,
2890,
16,
563,
16,
833,
4672,
1018,
16,
1365,
273,
833,
596,
16,
393,
16,
981,
273,
563,
309,
981,
422,
374,
30,
365,
18,
4901,
18,
4148,
2932,
3830,
2261,
5160,
13035,
12... |
mname = 'do_' + command | return 1 def handle(self): """Handle a single HTTP request. You normally don't need to override this method; see the class __doc__ string for information on how to handle specific HTTP commands such as GET and POST. """ self.raw_requestline = self.rfile.readline() if not self.parse_request(): return mname = 'do_' + self.command | def handle(self): """Handle a single HTTP request. | 36007764b971a8256164992682c76a0728c992ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/36007764b971a8256164992682c76a0728c992ec/BaseHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
4672,
3536,
3259,
279,
2202,
2239,
590,
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,
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,
1640,
12,
2890,
4672,
3536,
3259,
279,
2202,
2239,
590,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def increase(self): super(VariantSynthSetting,self).increase() return self.valueName def decrease(self): super(VariantSynthSetting,self).decrease() return self.valueName | def __init__(self): super(VariantSynthSetting,self).__init__("variant",0,synthDriverHandler.getSynth().variantCount-1) | f4c2ab556ad882ca719ca7ac8a7be56254094646 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9340/f4c2ab556ad882ca719ca7ac8a7be56254094646/_synthSettingsRing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
9356,
10503,
451,
5568,
16,
2890,
2934,
972,
2738,
972,
2932,
8688,
3113,
20,
16,
11982,
451,
4668,
1503,
18,
588,
10503,
451,
7675,
8688,
1380... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
9356,
10503,
451,
5568,
16,
2890,
2934,
972,
2738,
972,
2932,
8688,
3113,
20,
16,
11982,
451,
4668,
1503,
18,
588,
10503,
451,
7675,
8688,
1380... | |
timetables = set(findRelatedTimetables(term) + findRelatedTimetables(ttschema)) | def sectionMap(self, term, ttschema): """Compute a mapping of timetable slots to sections. | 79f08e92d6ce80c190189a584f7acf6f26640a36 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7127/79f08e92d6ce80c190189a584f7acf6f26640a36/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
863,
12,
2890,
16,
2481,
16,
268,
3428,
1243,
4672,
3536,
7018,
279,
2874,
434,
26668,
429,
12169,
358,
7178,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
863,
12,
2890,
16,
2481,
16,
268,
3428,
1243,
4672,
3536,
7018,
279,
2874,
434,
26668,
429,
12169,
358,
7178,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.execCheck.set_active (TRUE) | self.execCheck.set_active (True) | def __init__ (self, driver, app): """ Constructor. """ gtk.Frame.__init__ (self) frameLabel = gtk.Label() frameLabel.set_markup ("<b>" + escapeMarkup( _("Application")+": "+app.name) + "</b>") frameLabel.show() self.set_label_widget (frameLabel) self.driver = driver self.app = app tooltips = gtk.Tooltips() table = gtk.Table(2, 2) self.execCheck = WrappingCheckButton (_("Apply only to this executable")) self.execCheck.set_sensitive (app.device.config.writable) tooltips.set_tip (self.execCheck, _( "Leave this disabled to configure all applications.\n" "Beware that some applications or games are just a shell script " "that starts a real executable with a different name.")) self.execCheck.show() table.attach (self.execCheck, 0, 1, 0, 1, 0, 0, 5, 5) self.execEntry = gtk.Entry() if app.executable != None: self.execCheck.set_active (TRUE) self.execEntry.set_text (app.executable) self.execEntry.set_sensitive (app.device.config.writable and app.executable != None) self.execEntry.show() self.execCheck.connect ("toggled", self.execToggled) self.execEntry.connect ("changed", self.execChanged) table.attach (self.execEntry, 1, 2, 0, 1, gtk.EXPAND|gtk.FILL, 0, 5, 5) notebook = gtk.Notebook() self.sectPages = [] self.sectLabels = [] unknownPage = UnknownSectionPage (driver, app) if not driver or len(unknownPage.opts) > 0: unknownPage.show() unknownLabel = gtk.Label (_("Unknown")) unknownLabel.show() notebook.append_page (unknownPage, unknownLabel) self.sectPages.append (unknownPage) self.sectLabels.append (unknownLabel) if driver: for sect in driver.optSections: sectPage = SectionPage (sect, app) sectPage.show() desc = sect.getDesc([lang]) if desc: if len(desc) > 30: # Truncate long section descriptions and add a # tooltip with the full description. # Eek: need an event box since tooltips don't work # on labels. try: space = desc[20:].index(' ') + 20 if space < 30: shortDesc = desc[:space] else: shortDesc = desc[:30] except ValueError: shortDesc = desc[:30] labelWidget = gtk.EventBox() tooltips.set_tip (labelWidget, desc) sectLabel = gtk.Label (shortDesc + " ...") sectLabel.show() labelWidget.add (sectLabel) else: sectLabel = gtk.Label (desc) labelWidget = sectLabel else: sectLabel = gtk.Label (_("(no description)")) labelWidget = sectLabel labelWidget.show() notebook.append_page (sectPage, labelWidget) self.sectPages.append (sectPage) self.sectLabels.append (sectLabel) if len(self.sectLabels) > 0: style = self.sectLabels[0].get_style() self.default_normal_fg = style.fg[gtk.STATE_NORMAL].copy() self.default_active_fg = style.fg[gtk.STATE_ACTIVE].copy() self.validate() notebook.show() table.attach (notebook, 0, 2, 1, 2, gtk.FILL, gtk.EXPAND|gtk.FILL, 5, 5) table.show() self.add (table) | ab8126074d7036807d1d842171687cc01617a181 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4580/ab8126074d7036807d1d842171687cc01617a181/driconf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
3419,
16,
595,
4672,
3536,
11417,
18,
3536,
22718,
18,
3219,
16186,
2738,
972,
261,
2890,
13,
2623,
2224,
273,
22718,
18,
2224,
1435,
2623,
2224,
18,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
3419,
16,
595,
4672,
3536,
11417,
18,
3536,
22718,
18,
3219,
16186,
2738,
972,
261,
2890,
13,
2623,
2224,
273,
22718,
18,
2224,
1435,
2623,
2224,
18,
542,... |
self.assert_ (os.path.exists(filename), \ | self.assert_ (os.path.lexists(filename), \ | def test_list_files(self): for key in sorted(backends): print "debug: test_list_files: key='%s'" % (key, ) for (cleaner_id, __name, __value) in backends[key].get_options(): backends[key].set_option(cleaner_id, True) for filename in backends[key].list_files(): self.assert_ (type(filename) is str) self.assert_ (os.path.exists(filename), \ "In backend '%s' path does not exist: '%s' \ " % (key, filename)) | 18478f728f52d5b096698cd1aacebf770b66e683 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/18478f728f52d5b096698cd1aacebf770b66e683/CleanerBackend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1098,
67,
2354,
12,
2890,
4672,
364,
498,
316,
3115,
12,
823,
5839,
4672,
1172,
315,
4148,
30,
1842,
67,
1098,
67,
2354,
30,
498,
28713,
87,
4970,
738,
261,
856,
16,
262,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1098,
67,
2354,
12,
2890,
4672,
364,
498,
316,
3115,
12,
823,
5839,
4672,
1172,
315,
4148,
30,
1842,
67,
1098,
67,
2354,
30,
498,
28713,
87,
4970,
738,
261,
856,
16,
262,
3... |
if defItem.bIsDispatch: defName = defItem.python_name | if defItem.bWritten: defName = defItem.python_name | def WriteClass(self, generator): generator.checkWriteCoClassBaseClass() doc = self.doc stream = generator.file if generator.generate_type == GEN_DEMAND_CHILD: # Some special imports we must setup. referenced_items = [] for ref, flag in self.sources: referenced_items.append(ref) for ref, flag in self.interfaces: referenced_items.append(ref) print >> stream, "import sys" for ref in referenced_items: print >> stream, "__import__('%s.%s')" % (generator.base_mod_name, ref.python_name) print >> stream, "%s = sys.modules['%s.%s'].%s" % (ref.python_name, generator.base_mod_name, ref.python_name, ref.python_name) try: progId = pythoncom.ProgIDFromCLSID(self.clsid) print >> stream, "# This CoClass is known by the name '%s'" % (progId) except pythoncom.com_error: pass print >> stream, 'class %s(CoClassBaseClass): # A CoClass' % (self.python_name) if doc and doc[1]: print >> stream, '\t# ' + doc[1] print >> stream, '\tCLSID = %r' % (self.clsid,) print >> stream, '\tcoclass_sources = [' defItem = None for item, flag in self.sources: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key) print >> stream, '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_source = %s' % (defName,) print >> stream, '\tcoclass_interfaces = [' defItem = None for item, flag in self.interfaces: if flag & pythoncom.IMPLTYPEFLAG_FDEFAULT: # and dual: defItem = item # check if non-dispatchable - if so no real Python class has been written. Write the iid as a string instead. if item.bIsDispatch: key = item.python_name else: key = repr(str(item.clsid)) # really the iid. print >> stream, '\t\t%s,' % (key,) print >> stream, '\t]' if defItem: if defItem.bIsDispatch: defName = defItem.python_name else: defName = repr(str(defItem.clsid)) # really the iid. print >> stream, '\tdefault_interface = %s' % (defName,) self.bWritten = 1 print >> stream | fd594dd3d924d07ca777cfbaa3f8bc198446c77e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/fd594dd3d924d07ca777cfbaa3f8bc198446c77e/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
4249,
797,
2171,
797,
1435,
997,
273,
365,
18,
2434,
1407,
273,
4456,
18,
768,
309,
4456,
18,
7163,
67,
723,
422,
611,
1157,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
797,
12,
2890,
16,
4456,
4672,
4456,
18,
1893,
3067,
4249,
797,
2171,
797,
1435,
997,
273,
365,
18,
2434,
1407,
273,
4456,
18,
768,
309,
4456,
18,
7163,
67,
723,
422,
611,
1157,
... |
self.name = name | self.name = self.orig_name = name | def __init__(self, name='MyLibrary', scope='GLOBAL'): self.name = name self.scope = scope | 741f21f7acbc342e2ffb24bf504d114c0189a5c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/741f21f7acbc342e2ffb24bf504d114c0189a5c6/test_handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
2218,
12062,
9313,
2187,
2146,
2218,
20402,
11,
4672,
365,
18,
529,
273,
365,
18,
4949,
67,
529,
273,
508,
365,
18,
4887,
273,
2146,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
2218,
12062,
9313,
2187,
2146,
2218,
20402,
11,
4672,
365,
18,
529,
273,
365,
18,
4949,
67,
529,
273,
508,
365,
18,
4887,
273,
2146,
2,
-100,
-100,
... |
acc = 'r' | acc = '' | def has_permission(self, path): acc = 'r' | fb50fdf6b616357187cb5bf3f91d7c61ecf7eb51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/fb50fdf6b616357187cb5bf3f91d7c61ecf7eb51/authzperm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
9827,
12,
2890,
16,
589,
4672,
4078,
273,
296,
86,
11,
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,... | [
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,
711,
67,
9827,
12,
2890,
16,
589,
4672,
4078,
273,
296,
86,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ref = '/'.join( page.split('.')[0].split('-') ) if ref.upper() == ref: ref = 'BOOST_MPL_%s' % ref output.write( ( '.. |%(ref)s| replace:: |``%(ref)s``|__\n' + '.. |``%(ref)s``| replace:: :refentry:`%(ref)s`\n' + '__ `%(ref)s`_\n' ) % { 'ref': ref } ) elif ref.lower() == ref: | if name and name not in special_cases: ref = name else: ref = '/'.join( page.split('.')[0].split('-') ) if ref.upper() == ref or ref.lower() == ref: | def __include_page( output, page ): output.write( '.. include:: %s\n' % page ) # output.write( '.. raw:: LaTeX\n\n' ) # output.write( ' \\newpage\n\n') ref = '/'.join( page.split('.')[0].split('-') ) if ref.upper() == ref: # macros ref = 'BOOST_MPL_%s' % ref output.write( ( '.. |%(ref)s| replace:: |``%(ref)s``|__\n' + '.. |``%(ref)s``| replace:: :refentry:`%(ref)s`\n' + '__ `%(ref)s`_\n' ) % { 'ref': ref } ) elif ref.lower() == ref: output.write( ( '.. |%(ref)s| replace:: |``%(ref)s``|__\n' + '.. |``%(ref)s``| replace:: :refentry:`%(ref)s`\n' + '__ `%(ref)s`_\n' ) % { 'ref': ref } ) else: if ref.find( '/' ) == -1: ref = ' '.join( filter( lambda x: len(x) > 0, re.split( '([A-Z][a-z]+)', ref ) ) ) output.write( '.. |%(ref)s| replace:: `%(ref)s`_\n' % { 'ref': ref } ) modtime = time.gmtime( os.stat( page ).st_mtime ) output.write( '.. modtime: %s\n' % time.strftime( '%B %d, %Y %H:%M:%S +0000', modtime ) ) output.write( '\n' ) | a3525672838341ee8b525af61d043a09dc5bd2ec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9982/a3525672838341ee8b525af61d043a09dc5bd2ec/refmanual.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6702,
67,
2433,
12,
876,
16,
1363,
262,
30,
876,
18,
2626,
12,
11597,
2341,
2866,
738,
87,
64,
82,
11,
738,
1363,
262,
468,
876,
18,
2626,
12,
11597,
1831,
2866,
21072,
21575,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6702,
67,
2433,
12,
876,
16,
1363,
262,
30,
876,
18,
2626,
12,
11597,
2341,
2866,
738,
87,
64,
82,
11,
738,
1363,
262,
468,
876,
18,
2626,
12,
11597,
1831,
2866,
21072,
21575,
... |
self.loggingServers = gConfig.getValue( csSection+'/LoggingServers' , self.loggingServers ) mySection = csSection+'/'+self.flavour self.loggingServers = gConfig.getValue( mySection+'/LoggingServers' , self.loggingServers ) mySection = csSection+'/'+platform self.loggingServers = gConfig.getValue( mySection+'/LoggingServers' , self.loggingServers ) if self.loggingServers: self.log.info( ' LoggingServers:', ', '.join(self.loggingServers) ) | def configure(self, csSection, platform): """ Here goes especific configuration for gLite PilotDirectors """ PilotDirector.configure(self, csSection, platform ) self.loggingServers = gConfig.getValue( csSection+'/LoggingServers' , self.loggingServers ) mySection = csSection+'/'+self.flavour self.loggingServers = gConfig.getValue( mySection+'/LoggingServers' , self.loggingServers ) mySection = csSection+'/'+platform self.loggingServers = gConfig.getValue( mySection+'/LoggingServers' , self.loggingServers ) if self.loggingServers: self.log.info( ' LoggingServers:', ', '.join(self.loggingServers) ) self.log.info( '' ) self.log.info( '===============================================' ) | fa7e1acf2366840f1d4cda612a71bf42d42faea6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/fa7e1acf2366840f1d4cda612a71bf42d42faea6/Director.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
16,
2873,
5285,
16,
4072,
4672,
3536,
13743,
13998,
24001,
1507,
1664,
364,
314,
20291,
453,
22797,
5368,
1383,
3536,
453,
22797,
28280,
18,
14895,
12,
2890,
16,
2873,
5285... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5068,
12,
2890,
16,
2873,
5285,
16,
4072,
4672,
3536,
13743,
13998,
24001,
1507,
1664,
364,
314,
20291,
453,
22797,
5368,
1383,
3536,
453,
22797,
28280,
18,
14895,
12,
2890,
16,
2873,
5285... | |
filename = self.filename if filename: internalname = canv._doc.hasForm(filename) if not internalname: canv.beginForm(filename) canv.saveState() x, y = self.x, self.y w, h = self.width, self.height canv.drawInlineImage(filename, x, y, w, h) canv.restoreState() canv.endForm() canv.doForm(filename) else: canv.doForm(filename) | if self.filename: x, y = self.x, self.y w, h = self.width, self.height canv.drawInlineImage(self.filename, x, y, w, h) | def drawOn(self, canv): filename = self.filename if filename: internalname = canv._doc.hasForm(filename) if not internalname: canv.beginForm(filename) canv.saveState() x, y = self.x, self.y w, h = self.width, self.height canv.drawInlineImage(filename, x, y, w, h) canv.restoreState() canv.endForm() canv.doForm(filename) else: canv.doForm(filename) | aafc1814be6a4de64b7efd8b7f705e1382792c4d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/aafc1814be6a4de64b7efd8b7f705e1382792c4d/pythonpoint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1398,
12,
2890,
16,
848,
90,
4672,
1544,
273,
365,
18,
3459,
309,
1544,
30,
2713,
529,
273,
848,
90,
6315,
2434,
18,
5332,
1204,
12,
3459,
13,
309,
486,
2713,
529,
30,
848,
90,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1398,
12,
2890,
16,
848,
90,
4672,
1544,
273,
365,
18,
3459,
309,
1544,
30,
2713,
529,
273,
848,
90,
6315,
2434,
18,
5332,
1204,
12,
3459,
13,
309,
486,
2713,
529,
30,
848,
90,... |
[ self.buffer.setdefault(u['uid'], u['cn']) for u in users ] | [ self.buffer.setdefault(u['uid'], self.decode_cn(u['cn'])) for u in users ] | def findLDAPUsers(self, acl_folder, params='', term='', role='', dn=''): """ search for users in LDAP """ if self.REQUEST.has_key('search_user'): if params and term: try: self.buffer = {} users = acl_folder.findUser(search_param=params, search_term=term) [ self.buffer.setdefault(u['uid'], u['cn']) for u in users ] return users except: return () else: return () elif self.REQUEST.has_key('search_role'): try: self.buffer = {} users = self.getUsersByRole(acl_folder, [(role, dn)]) [ self.buffer.setdefault(u['uid'][0], u['cn'][0]) for u in users ] return users except: return () else: return () | 89e89904327a13d994fd1b104119ea254c707b5e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/89e89904327a13d994fd1b104119ea254c707b5e/plugLDAPUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
15496,
6588,
12,
2890,
16,
7895,
67,
5609,
16,
859,
2218,
2187,
2481,
2218,
2187,
2478,
2218,
2187,
8800,
2218,
11,
4672,
3536,
1623,
364,
3677,
316,
11916,
3536,
309,
365,
18,
551... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
15496,
6588,
12,
2890,
16,
7895,
67,
5609,
16,
859,
2218,
2187,
2481,
2218,
2187,
2478,
2218,
2187,
8800,
2218,
11,
4672,
3536,
1623,
364,
3677,
316,
11916,
3536,
309,
365,
18,
551... |
if not os.path.isdir(tile_dir + zoom): os.mkdir(tile_dir + zoom) if not os.path.isdir(tile_dir + zoom + '/' + str_x): os.mkdir(tile_dir + zoom + '/' + str_x) | def render_tiles(bbox, mapfile, tile_dir, minZoom=1,maxZoom=18, name="unknown"): print "render_tiles(",bbox, mapfile, tile_dir, minZoom,maxZoom, name,")" if not os.path.isdir(tile_dir): os.mkdir(tile_dir) gprj = GoogleProjection(maxZoom+1) m = Map(2 * 256,2 * 256) load_map(m,mapfile) prj = Projection("+proj=merc +datum=WGS84") ll0 = (bbox[0],bbox[3]) ll1 = (bbox[2],bbox[1]) for z in range(minZoom,maxZoom + 1): px0 = gprj.fromLLtoPixel(ll0,z) px1 = gprj.fromLLtoPixel(ll1,z) for x in range(int(px0[0]/256.0),int(px1[0]/256.0)+1): for y in range(int(px0[1]/256.0),int(px1[1]/256.0)+1): p0 = gprj.fromPixelToLL((x * 256.0, (y+1) * 256.0),z) p1 = gprj.fromPixelToLL(((x+1) * 256.0, y * 256.0),z) # render a new tile and store it on filesystem c0 = prj.forward(Coord(p0[0],p0[1])) c1 = prj.forward(Coord(p1[0],p1[1])) bbox = Envelope(c0.x,c0.y,c1.x,c1.y) bbox.width(bbox.width() * 2) bbox.height(bbox.height() * 2) m.zoom_to_box(bbox) # check if we have directories in place zoom = "%s" % z str_x = "%s" % x str_y = "%s" % y if not os.path.isdir(tile_dir + zoom): os.mkdir(tile_dir + zoom) if not os.path.isdir(tile_dir + zoom + '/' + str_x): os.mkdir(tile_dir + zoom + '/' + str_x) tile_uri = tile_dir + zoom + '/' + str_x + '/' + str_y + '.png' exists= "" if os.path.isfile(tile_uri): exists= "exists" else: im = Image(512, 512) render(m, im) view = im.view(128,128,256,256) # x,y,width,height save_to_file(tile_uri,'png',view) command = "convert -colors 255 %s %s" % (tile_uri,tile_uri) call(command, shell=True) bytes=os.stat(tile_uri)[6] empty= '' if bytes == 137: empty = " Empty Tile " print name,"[",minZoom,"-",maxZoom,"]: " ,z,x,y,"p:",p0,p1,exists, empty | a7fa294241e329e31de538f00c7cf3d366e08c29 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9131/a7fa294241e329e31de538f00c7cf3d366e08c29/generate_tiles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
28366,
12,
20737,
16,
852,
768,
16,
4769,
67,
1214,
16,
1131,
11497,
33,
21,
16,
1896,
11497,
33,
2643,
16,
508,
1546,
8172,
6,
4672,
1172,
315,
5902,
67,
28366,
2932,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
28366,
12,
20737,
16,
852,
768,
16,
4769,
67,
1214,
16,
1131,
11497,
33,
21,
16,
1896,
11497,
33,
2643,
16,
508,
1546,
8172,
6,
4672,
1172,
315,
5902,
67,
28366,
2932,
16,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.