rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
play_rb = widgetset.RadioButton(_("Play videos one after another"), rbg) stop_rb = widgetset.RadioButton(_("Stop after each video"), rbg) | play_rb = widgetset.RadioButton(_("Play video and audio items one after another"), rbg) stop_rb = widgetset.RadioButton(_("Stop after each video or audio item"), rbg) | def build_widget(self): v = widgetset.VBox() | 7d4d7b1e58174ab7e560a611b35bb8e5a8843446 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/7d4d7b1e58174ab7e560a611b35bb8e5a8843446/prefpanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6587,
12,
2890,
4672,
331,
273,
3604,
542,
18,
58,
3514,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6587,
12,
2890,
4672,
331,
273,
3604,
542,
18,
58,
3514,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
_branch(subpattern, b) else: subpattern.append((SUBPATTERN, (group, p))) | p = _branch(state, b) subpattern.append((SUBPATTERN, (group, p))) | def _parse(source, pattern, flags=()): # parse regular expression pattern into an operator list. subpattern = SubPattern(pattern) this = None while 1: if str(source.next) in ("|", ")"): break # end of subpattern this = source.get() if this is None: break # end of pattern if this and this[0] not in SPECIAL_CHARS: subpattern.append((LITERAL, this)) elif this == "[": # character set set = [] | 842e911e887411eb043a164240fdb6b694895e87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/842e911e887411eb043a164240fdb6b694895e87/sre_parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
12,
3168,
16,
1936,
16,
2943,
33,
1435,
4672,
225,
468,
1109,
6736,
2652,
1936,
1368,
392,
3726,
666,
18,
225,
720,
4951,
273,
2592,
3234,
12,
4951,
13,
225,
333,
273,
599,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
12,
3168,
16,
1936,
16,
2943,
33,
1435,
4672,
225,
468,
1109,
6736,
2652,
1936,
1368,
392,
3726,
666,
18,
225,
720,
4951,
273,
2592,
3234,
12,
4951,
13,
225,
333,
273,
599,
... |
class A( (base.in.parens) ): pass class B( (lambda:calculated.base)() ): pass | - class A( (base.in.parens) ): pass - class B( (lambda:calculated.base)() ): pass | def parse_classdef_bases(self, elt): """ If the given tree token element contains a valid base list (that contains only dotted names), then return a corresponding list of L{DottedName}s. Otherwise, raise a ParseError. @bug: Does not handle either of:: class A( (base.in.parens) ): pass class B( (lambda:calculated.base)() ): pass """ if (not isinstance(elt, list) or elt[0] != (token.OP, '(')): raise ParseError() return self.parse_dotted_name_list(elt[1:-1]) | 8ca0444b7e82785ddab055f0d90bed1ddc6cea99 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/8ca0444b7e82785ddab055f0d90bed1ddc6cea99/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1106,
536,
67,
18602,
12,
2890,
16,
11572,
4672,
3536,
971,
326,
864,
2151,
1147,
930,
1914,
279,
923,
1026,
666,
261,
19056,
1914,
1338,
20965,
1257,
3631,
1508,
327,
279,
465... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1106,
536,
67,
18602,
12,
2890,
16,
11572,
4672,
3536,
971,
326,
864,
2151,
1147,
930,
1914,
279,
923,
1026,
666,
261,
19056,
1914,
1338,
20965,
1257,
3631,
1508,
327,
279,
465... |
s = decode_header(s) | s = decode_header(s.replace('\r', '')) | def _decode_header(self, s): from email.Header import decode_header s = decode_header(s) return ''.join(map(lambda x:self._to_decode(x[0], [x[1]]), s or [])) | 823e69341e844235250e5440158254d30fb89d78 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/823e69341e844235250e5440158254d30fb89d78/openerp_mailgate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3922,
67,
3374,
12,
2890,
16,
272,
4672,
628,
2699,
18,
1864,
1930,
2495,
67,
3374,
272,
273,
2495,
67,
3374,
12,
87,
18,
2079,
2668,
64,
86,
2187,
875,
3719,
327,
875,
18,
5701... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3922,
67,
3374,
12,
2890,
16,
272,
4672,
628,
2699,
18,
1864,
1930,
2495,
67,
3374,
272,
273,
2495,
67,
3374,
12,
87,
18,
2079,
2668,
64,
86,
2187,
875,
3719,
327,
875,
18,
5701... |
if cell.rowspan == 1 and not getattr(cell, 'colspanned', False): styles.append( ('SPAN',(col_idx,row_idx), (col_idx+cell.colspan-1,row_idx)) ) | def checkSpans(t): if getattr(t, 'checked_spans', False): return styles = [] num_rows = len(t.children) for row_idx, row in enumerate(t.children): col_idx = 0 for cell in row.children: if cell.colspan > 1: emptycell = getEmptyCell(None, cell.colspan-1, cell.rowspan) emptycell.moveto(cell) # move behind orignal cell if cell.rowspan == 1 and not getattr(cell, 'colspanned', False): styles.append( ('SPAN',(col_idx,row_idx), (col_idx+cell.colspan-1,row_idx)) ) emptycell.colspanned = True if row_idx + cell.rowspan > num_rows: # fix broken rowspans cell.attributes['rowspan'] = num_rows - row_idx col_idx += 1 for row_idx, row in enumerate(t.children): col_idx = 0 for cell in row.children: if cell.rowspan > 1: emptycell = getEmptyCell(None, cell.colspan, cell.rowspan-1) last_col_idx = len(t.children[row_idx+1].children) - 1 if col_idx > last_col_idx: emptycell.moveto(t.children[row_idx+1].children[last_col_idx]) else: emptycell.moveto(t.children[row_idx+1].children[col_idx], prefix=True) if not getattr(cell, 'rowspanned', False): styles.append(('SPAN',(col_idx,row_idx),(col_idx + cell.colspan-1,row_idx+cell.rowspan-1))) emptycell.rowspanned = True if cell.colspan > 1: emptycell.colspanned = True col_idx += 1 numcols = max(len(row.children) for row in t.children) for row in t.children: while len(row.children) < numcols: row.appendChild(getEmptyCell(None, colspan=1, rowspan=1)) t.checked_spans = True t.span_styles = styles | 9bf00d87d55487ba2eab74086ffcf973de28f613 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12390/9bf00d87d55487ba2eab74086ffcf973de28f613/rltables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
17798,
12,
88,
4672,
309,
3869,
12,
88,
16,
296,
4532,
67,
30885,
2187,
1083,
4672,
327,
5687,
273,
5378,
818,
67,
3870,
273,
562,
12,
88,
18,
5906,
13,
364,
1027,
67,
3465,
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,
866,
17798,
12,
88,
4672,
309,
3869,
12,
88,
16,
296,
4532,
67,
30885,
2187,
1083,
4672,
327,
5687,
273,
5378,
818,
67,
3870,
273,
562,
12,
88,
18,
5906,
13,
364,
1027,
67,
3465,
16,... | |
fixtures = ['user-paulproteus'] | def test__exp_tag_add_multiple_tags__web(self): tag_text = 'rofl, con, hipster' desired_tags = ['rofl', 'con', 'hipster'] username='stipe' project_name='automatic' url = '/people/add_tag_to_project_exp' good_input = { 'username': username, 'project_name': project_name, 'tag_text': tag_text } response = Client().post(url, good_input) response = Client().get('/people/', {'u': username}) self.assertContains(response, username) self.assertContains(response, project_name) self.assertNotContains(response, tag_text) # the thing # withspaces will # not fly for tag in desired_tags: # but each tag alone, that's splendid self.assertContains(response, tag) | 1ac00e832d0855d866ab3836a446f7d49b990c15 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11976/1ac00e832d0855d866ab3836a446f7d49b990c15/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
972,
2749,
67,
2692,
67,
1289,
67,
9622,
67,
4156,
972,
4875,
12,
2890,
4672,
1047,
67,
955,
273,
296,
303,
2242,
16,
356,
16,
366,
625,
8190,
11,
6049,
67,
4156,
273,
10228,
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,
972,
2749,
67,
2692,
67,
1289,
67,
9622,
67,
4156,
972,
4875,
12,
2890,
4672,
1047,
67,
955,
273,
296,
303,
2242,
16,
356,
16,
366,
625,
8190,
11,
6049,
67,
4156,
273,
10228,
3... | |
this = apply(_quickfix.new_RoundingModulus, args) | this = _quickfix.new_RoundingModulus(*args) | def __init__(self, *args): this = apply(_quickfix.new_RoundingModulus, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
11066,
310,
1739,
17284,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
11066,
310,
1739,
17284,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... |
"outgoing|out": (outgoing, [], 'hg outgoing [DEST]'), | "outgoing|out": (outgoing, [('p', 'patch', None, 'show patch')], 'hg outgoing [-p] [DEST]'), | def verify(ui, repo): """verify the integrity of the repository""" return repo.verify() | 91f0b1cc17f517bbd0bdf0eb5e1fe86fa39ddfc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/91f0b1cc17f517bbd0bdf0eb5e1fe86fa39ddfc3/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3929,
12,
4881,
16,
3538,
4672,
3536,
8705,
326,
24425,
434,
326,
3352,
8395,
327,
3538,
18,
8705,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return Breacrumb( | return Breadcrumb( | def breadcrumb(cls, request, context): return Breacrumb( cls.conf.local_name, None, 'Feature suggestions', lazy_reverse('feature_voting:index'), ) | fb4f9c2209985472251027ee022c1819dacc4584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14173/fb4f9c2209985472251027ee022c1819dacc4584/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19538,
12,
6429,
16,
590,
16,
819,
4672,
327,
605,
12173,
12,
2028,
18,
3923,
18,
3729,
67,
529,
16,
599,
16,
296,
4595,
17969,
2187,
7962,
67,
9845,
2668,
7238,
67,
90,
17128,
30,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19538,
12,
6429,
16,
590,
16,
819,
4672,
327,
605,
12173,
12,
2028,
18,
3923,
18,
3729,
67,
529,
16,
599,
16,
296,
4595,
17969,
2187,
7962,
67,
9845,
2668,
7238,
67,
90,
17128,
30,
1... |
return {'value':{'address_id': addr['delivery'], 'partner_invoice_id' : addr['invoice'] , 'pricelist_id': pricelist}} | return {'value': { 'address_id': addr['delivery'], 'partner_invoice_id': addr['invoice'], 'pricelist_id': pricelist } } | def onchange_partner_id(self, cr, uid, ids, part): if not part: return {'value':{'address_id': False ,'partner_invoice_id' : False , 'pricelist_id' : self.pool.get('product.pricelist').search(cr,uid,[('type','=','sale')])[0]}} addr = self.pool.get('res.partner').address_get(cr, uid, [part], ['delivery','invoice','default']) partner = self.pool.get('res.partner').browse(cr, uid,part) pricelist = partner.property_product_pricelist and partner.property_product_pricelist.id or False return {'value':{'address_id': addr['delivery'], 'partner_invoice_id' : addr['invoice'] , 'pricelist_id': pricelist}} | 0fe331ad2ffd5967cda7186e9110f283bdb71cab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/0fe331ad2ffd5967cda7186e9110f283bdb71cab/mrp_repair.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1087,
4672,
309,
486,
1087,
30,
327,
13666,
1132,
4278,
27828,
2867,
67,
350,
4278,
1083,
269,
11,
31993,
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,
603,
3427,
67,
31993,
67,
350,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1087,
4672,
309,
486,
1087,
30,
327,
13666,
1132,
4278,
27828,
2867,
67,
350,
4278,
1083,
269,
11,
31993,
67,... |
assert dname in ('wrans', 'debates', 'wms', 'wesminhall', 'lordspages') | assert dname in ('wrans', 'debates', 'wms', 'westminhall', 'lordspages') | def RunFilterFile(FILTERfunction, xprev, sdate, sdatever, dname, jfin, patchfile, jfout, forcereparse, bquietc): # now apply patches and parse patchtempfilename = tempfile.mktemp("", "pw-applypatchtemp-", miscfuncs.tmppath) print "reading " + jfin # apply patch filter kfin = jfin if os.path.isfile(patchfile) and ApplyPatches(jfin, patchtempfilename, patchfile): kfin = patchtempfilename # read the text of the file ofin = open(kfin) text = ofin.read() ofin.close() tempfilenameoldxml = None # do the filtering according to the type. Some stuff is being inlined here if dname == 'regmem': regmemout = open(tempfilename, 'w') FILTERfunction(regmemout, text, sdate) # totally different filter function format regmemout.close() # all other hansard types else: assert dname in ('wrans', 'debates', 'wms', 'wesminhall', 'lordspages') (flatb, gidname) = FILTERfunction(text, sdate) CreateGIDs(gidname, sdate, sdatever, flatb) # wrans case is special, with its question-id numbered gids if dname == 'wrans': majblocks = CreateWransGIDs(flatb, (sdate + sdatever)) # combine the date and datever. the old style gids stand on the paragraphs still bMakeOldWransGidsToNew = (sdate < "2005") fout = open(tempfilename, "w") WriteXMLHeader(fout); fout.write('<publicwhip scrapeversion="%s" latest="yes">\n' % sdatever) # go through and output all the records into the file if dname == 'wrans': for majblock in majblocks: WriteXMLspeechrecord(fout, majblock[0], bMakeOldWransGidsToNew, True) for qblock in majblock[1]: qblock.WriteXMLrecords(fout, bMakeOldWransGidsToNew) else: for qb in flatb: WriteXMLspeechrecord(fout, qb, False, False) fout.write("</publicwhip>\n\n") fout.close() # load in a previous file and over-write it if necessary if xprev: xin = open(xprev[0], "r") xprevs = xin.read() xin.close() # separate out the scrape versions mpw = re.search('<publicwhip scrapeversion="([^"]*)" latest="yes">\n([\s\S]*?)</publicwhip>', xprevs) if not mpw: print "mismatch with pw header" print re.search('<publicwhip[^>]*>', xprevs).group(0) assert mpw.group(1) == xprev[1] if dname == 'wrans': xprevcompress = FactorChangesWrans(majblocks, mpw.group(2)) else: xprevcompress = FactorChanges(flatb, mpw.group(2)) tempfilenameoldxml = tempfile.mktemp(".xml", "pw-filtertempold-", miscfuncs.tmppath) foout = open(tempfilenameoldxml, "w") WriteXMLHeader(foout) foout.write('<publicwhip scrapeversion="%s" latest="no">\n' % xprev[1]) foout.writelines(xprevcompress) foout.write("</publicwhip>\n\n") foout.close() # in win32 this function leaves the file open and stops it being renamed if sys.platform != "win32": xmlvalidate.parse(tempfilename) # validate XML before renaming # in case of error, an exception is thrown, so this line would not be reached # we rename both files (the old and new xml) at once if os.path.isfile(jfout): os.remove(jfout) os.rename(tempfilename, jfout) # copy over onto old xml file if tempfilenameoldxml: if sys.platform != "win32": xmlvalidate.parse(tempfilenameoldxml) # validate XML before renaming assert os.path.isfile(xprev[0]) os.remove(xprev[0]) os.rename(tempfilenameoldxml, xprev[0]) | 7cb6872c7859cb66a33bea4f7c9a9fa5b5f1318f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8428/7cb6872c7859cb66a33bea4f7c9a9fa5b5f1318f/runfilters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
1586,
812,
12,
11126,
915,
16,
619,
10001,
16,
272,
712,
16,
272,
712,
502,
16,
302,
529,
16,
525,
926,
16,
4729,
768,
16,
525,
617,
322,
16,
364,
71,
822,
2670,
16,
324,
203... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
1586,
812,
12,
11126,
915,
16,
619,
10001,
16,
272,
712,
16,
272,
712,
502,
16,
302,
529,
16,
525,
926,
16,
4729,
768,
16,
525,
617,
322,
16,
364,
71,
822,
2670,
16,
324,
203... |
"""Try to guess which module an object was defined in.""" | """Return the module an object was defined in, or None if not found.""" | def getmodule(object): """Try to guess which module an object was defined in.""" if isclass(object): return sys.modules.get(object.__module__) try: file = getabsfile(object) except TypeError: return None if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] for module in sys.modules.values(): if hasattr(module, '__file__'): modulesbyfile[getabsfile(module)] = module.__name__ if modulesbyfile.has_key(file): return sys.modules[modulesbyfile[file]] main = sys.modules['__main__'] try: mainobject = getattr(main, object.__name__) if mainobject is object: return main except AttributeError: pass builtin = sys.modules['__builtin__'] try: builtinobject = getattr(builtin, object.__name__) if builtinobject is object: return builtin except AttributeError: pass | d6c86dae430f16a4790418f8c96eb8ef11aab251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d6c86dae430f16a4790418f8c96eb8ef11aab251/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2978,
12,
1612,
4672,
3536,
990,
326,
1605,
392,
733,
1703,
2553,
316,
16,
578,
599,
309,
486,
1392,
12123,
309,
28209,
12,
1612,
4672,
327,
2589,
18,
6400,
18,
588,
12,
1612,
161... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2978,
12,
1612,
4672,
3536,
990,
326,
1605,
392,
733,
1703,
2553,
316,
16,
578,
599,
309,
486,
1392,
12123,
309,
28209,
12,
1612,
4672,
327,
2589,
18,
6400,
18,
588,
12,
1612,
161... |
Borg.__init__(self) | Borg.__init__(self, self.__class__.__name__) | def __init__(self): Borg.__init__(self) | 0f8a63a4ebfed62583b6829e0a91d220fcbc35d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/0f8a63a4ebfed62583b6829e0a91d220fcbc35d2/borg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
605,
3341,
16186,
2738,
972,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
605,
3341,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if(is_protected(name)): continue | if(is_protected(name)): continue | def search_node(self, search_str, nb_inputs=-1, nb_outputs=-1): """ Return a list of Factory corresponding to search_str """ | a357784b20ed0a39e6d23228ce8a2a17eb2996f2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11338/a357784b20ed0a39e6d23228ce8a2a17eb2996f2/pkgmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
2159,
12,
2890,
16,
1623,
67,
701,
16,
4264,
67,
10029,
29711,
21,
16,
4264,
67,
12295,
29711,
21,
4672,
3536,
2000,
279,
666,
434,
7822,
4656,
358,
1623,
67,
701,
3536,
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,
1623,
67,
2159,
12,
2890,
16,
1623,
67,
701,
16,
4264,
67,
10029,
29711,
21,
16,
4264,
67,
12295,
29711,
21,
4672,
3536,
2000,
279,
666,
434,
7822,
4656,
358,
1623,
67,
701,
3536,
2,
... |
guess = (maxval + minval) / 2 | guess = (maxval + minval) // 2 | def fisher_exact(table) : """Performs a Fisher exact test on a 2x2 contingency table. Parameters ---------- table : array_like of ints A 2x2 contingency table. Returns ------- oddsratio : float This is prior odds ratio and not a posterior estimate. p_value : float P-value for 2-sided hypothesis of independence. Notes ----- The calculated odds ratio is different from the one R uses. In R language, this implementation returns the (more common) "unconditional Maximum Likelihood Estimate", while R uses the "conditional Maximum Likelihood Estimate". Examples -------- >>> fisher_exact([[100, 2], [1000, 5]]) (0.25, 0.13007593634330314) """ hypergeom = distributions.hypergeom c = np.asarray(table, dtype=np.int64) # int32 is not enough for the algorithm if not c.shape == (2, 2): raise ValueError("The input `table` must be of shape (2, 2).") if c[1,0] > 0 and c[0,1] > 0: odssratio = c[0,0] * c[1,1] / float(c[1,0] * c[0,1]) else: odssratio = np.inf n1 = c[0,0] + c[0,1] n2 = c[1,0] + c[1,1] n = c[0,0] + c[1,0] mode = int(float((n + 1) * (n1 + 1)) / (n1 + n2 + 2)) pexact = hypergeom.pmf(c[0,0], n1 + n2, n1, n) pmode = hypergeom.pmf(mode, n1 + n2, n1, n) epsilon = 1 - 1e-4 if float(np.abs(pexact - pmode)) / np.abs(np.max(pexact, pmode)) <= 1 - epsilon: return odssratio, 1 elif c[0,0] < mode: plower = hypergeom.cdf(c[0,0], n1 + n2, n1, n) if hypergeom.pmf(n, n1 + n2, n1, n) > pexact / epsilon: return odssratio, plower # Binary search for where to begin upper half. minval = mode maxval = n guess = -1 while maxval - minval > 1: if maxval == minval + 1 and guess == minval: guess = maxval else: guess = (maxval + minval) / 2 pguess = hypergeom.pmf(guess, n1 + n2, n1, n) if pguess <= pexact and hypergeom.pmf(guess - 1, n1 + n2, n1, n) > pexact: break elif pguess < pexact: maxval = guess else: minval = guess if guess == -1: guess = minval while guess > 0 and hypergeom.pmf(guess, n1 + n2, n1, n) < pexact * epsilon: guess -= 1 while hypergeom.pmf(guess, n1 + n2, n1, n) > pexact / epsilon: guess += 1 p = plower + hypergeom.sf(guess - 1, n1 + n2, n1, n) if p > 1.0: p = 1.0 return odssratio, p else: pupper = hypergeom.sf(c[0,0] - 1, n1 + n2, n1, n) if hypergeom.pmf(0, n1 + n2, n1, n) > pexact / epsilon: return odssratio, pupper # Binary search for where to begin lower half. minval = 0 maxval = mode guess = -1 while maxval - minval > 1: if maxval == minval + 1 and guess == minval: guess = maxval else: guess = (maxval + minval) / 2 pguess = hypergeom.pmf(guess, n1 + n2, n1, n) if pguess <= pexact and hypergeom.pmf(guess + 1, n1 + n2, n1, n) > pexact: break elif pguess <= pexact: minval = guess else: maxval = guess if guess == -1: guess = minval while hypergeom.pmf(guess, n1 + n2, n1, n) < pexact * epsilon: guess += 1 while guess > 0 and hypergeom.pmf(guess, n1 + n2, n1, n) > pexact / epsilon: guess -= 1 p = pupper + hypergeom.cdf(guess, n1 + n2, n1, n) if p > 1.0: p = 1.0 return odssratio, p | 5a6a857dc520d1177b14f4d93debf040fadaff72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/5a6a857dc520d1177b14f4d93debf040fadaff72/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
31721,
67,
17165,
12,
2121,
13,
294,
3536,
9409,
279,
478,
31721,
5565,
1842,
603,
279,
576,
92,
22,
466,
310,
2075,
1014,
18,
225,
7012,
12181,
1014,
294,
526,
67,
5625,
434,
155... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
31721,
67,
17165,
12,
2121,
13,
294,
3536,
9409,
279,
478,
31721,
5565,
1842,
603,
279,
576,
92,
22,
466,
310,
2075,
1014,
18,
225,
7012,
12181,
1014,
294,
526,
67,
5625,
434,
155... |
except (OSError, IOError, WindowsError): logging.debug("clean_up: %s kicked up while removing %s", e, temp_file) eventloop.add_timeout(1.0, clean_up, "conversion clean_up attempt", (clean_up, temp_file, file_and_directory, attempts+1)) | except (OSError, IOError, WindowsError), e: logging.debug("clean_up: %s kicked up while removing %s", e, temp_file) timeout = 1.0 * attempts eventloop.add_timeout( timeout, clean_up, "conversion clean_up attempt", (temp_file, file_and_directory, attempts+1)) | def clean_up(temp_file, file_and_directory=False, attempts=0): if attempts > 5: return if os.path.exists(temp_file): try: os.remove(temp_file) except (OSError, IOError, WindowsError): logging.debug("clean_up: %s kicked up while removing %s", e, temp_file) eventloop.add_timeout(1.0, clean_up, "conversion clean_up attempt", (clean_up, temp_file, file_and_directory, attempts+1)) if file_and_directory: path = os.path.dirname(temp_file) if os.path.exists(path): try: os.rmdir(path) except (OSError, IOError, WindowsError), e: logging.debug("clean_up: %s kicked up while removing %s", e, path) eventloop.add_timeout(1.0, clean_up, "conversion clean_up attempt", (clean_up, temp_file, file_and_directory, attempts+1)) | 87c690352f9dad9df087e4c9e69b99c153a5352c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/87c690352f9dad9df087e4c9e69b99c153a5352c/videoconversion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
416,
12,
5814,
67,
768,
16,
585,
67,
464,
67,
5149,
33,
8381,
16,
7531,
33,
20,
4672,
309,
7531,
405,
1381,
30,
327,
309,
1140,
18,
803,
18,
1808,
12,
5814,
67,
768,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
416,
12,
5814,
67,
768,
16,
585,
67,
464,
67,
5149,
33,
8381,
16,
7531,
33,
20,
4672,
309,
7531,
405,
1381,
30,
327,
309,
1140,
18,
803,
18,
1808,
12,
5814,
67,
768,
4672... |
return super(meeting_confidential_info, self).create(cr, uid, *args) | return super(meeting_confidential_info, self).create(cr, uid, *args, **args2) | def create(self, cr, uid, *args): if 'group' in args[0] and args[0]['group']: if args[0]['group'] == "group1": args[0]['name'] ="Confidential Info of Group 1" else: args[0]['name'] ="Confidential Info of Group 2" return super(meeting_confidential_info, self).create(cr, uid, *args) | 1d32d1ec04c7c435603d63d632589c5cd8b0e9e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/1d32d1ec04c7c435603d63d632589c5cd8b0e9e3/cci_crm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
380,
1968,
4672,
309,
296,
1655,
11,
316,
833,
63,
20,
65,
471,
833,
63,
20,
23962,
1655,
3546,
30,
309,
833,
63,
20,
23962,
1655,
3546,
422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
380,
1968,
4672,
309,
296,
1655,
11,
316,
833,
63,
20,
65,
471,
833,
63,
20,
23962,
1655,
3546,
30,
309,
833,
63,
20,
23962,
1655,
3546,
422,
... |
si = rffi.make(sysinfo_struct) | si = rffi.make(SYSTEM_INFO) | def _get_page_size(): try: si = rffi.make(sysinfo_struct) GetSystemInfo(si) return int(si.c_dwPageSize) finally: lltype.free(si, flavor="raw") | f53cdc52815837ae3e6f65a826fcb8f8fb920d3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/f53cdc52815837ae3e6f65a826fcb8f8fb920d3f/rmmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2433,
67,
1467,
13332,
775,
30,
7533,
273,
436,
1403,
77,
18,
6540,
12,
14318,
67,
5923,
13,
968,
3163,
966,
12,
7722,
13,
327,
509,
12,
7722,
18,
71,
67,
22512,
24035,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2433,
67,
1467,
13332,
775,
30,
7533,
273,
436,
1403,
77,
18,
6540,
12,
14318,
67,
5923,
13,
968,
3163,
966,
12,
7722,
13,
327,
509,
12,
7722,
18,
71,
67,
22512,
24035,... |
checkProg('the splitindex processor', ['splitindex.pl', 'splitindex', 'java splitindex'], | path, splitindex = checkProg('the splitindex processor', ['splitindex.pl', 'splitindex'], | def checkOtherEntries(): ''' entries other than Format and Converter ''' checkProg('ChkTeX', ['chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38'], rc_entry = [ r'\chktex_command "%%"' ]) checkProgAlternatives('BibTeX or alternative programs', ['bibtex', 'bibtex8', 'biber'], rc_entry = [ r'\bibtex_command "%%"' ], alt_rc_entry = [ r'\bibtex_alternatives "%%"' ]) checkProg('JBibTeX, the Japanese BibTeX', ['jbibtex', 'bibtex'], rc_entry = [ r'\jbibtex_command "%%"' ]) checkProgAlternatives('available index processors', ['texindy', 'makeindex -c -q'], rc_entry = [ r'\index_command "%%"' ], alt_rc_entry = [ r'\index_alternatives "%%"' ]) checkProg('an index processor appropriate to Japanese', ['mendex -c -q', 'makeindex -c -q'], rc_entry = [ r'\jindex_command "%%"' ]) checkProg('the splitindex processor', ['splitindex.pl', 'splitindex', 'java splitindex'], rc_entry = [ r'\splitindex_command "%%"' ]) checkProg('a nomenclature processor', ['makeindex'], rc_entry = [ r'\nomencl_command "makeindex -s nomencl.ist"' ]) ## FIXME: OCTAVE is not used anywhere # path, OCTAVE = checkProg('Octave', ['octave']) ## FIXME: MAPLE is not used anywhere # path, MAPLE = checkProg('Maple', ['maple']) checkProg('a spool command', ['lp', 'lpr'], rc_entry = [ r'''\print_spool_printerprefix "-d " | 0c4f7f62c15e146ee0a93508fcc5f038421b10f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7514/0c4f7f62c15e146ee0a93508fcc5f038421b10f6/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
8290,
5400,
13332,
9163,
3222,
1308,
2353,
4077,
471,
14768,
9163,
866,
626,
75,
2668,
782,
79,
21575,
60,
2187,
10228,
343,
8629,
338,
300,
82,
21,
300,
82,
23,
300,
82,
26,
300,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
8290,
5400,
13332,
9163,
3222,
1308,
2353,
4077,
471,
14768,
9163,
866,
626,
75,
2668,
782,
79,
21575,
60,
2187,
10228,
343,
8629,
338,
300,
82,
21,
300,
82,
23,
300,
82,
26,
300,... |
width_height = re.compile(u'''^(.+?)[ ]\[?([0-9]+)x([0-9]+)[^\\/]*$''', re.UNICODE) | width_height = re.compile(u'''^(.+?)\[?([0-9]+)x([0-9]+)\\,[^\\/]''', re.UNICODE) | def getVideoDetails(videofilename, screenshot=False): '''Using ffmpeg (if it can be found) get a video file's details return False if ffmpeg is cannot be found return empty dictionary if the file is not a video return dictionary of the Video's details ''' ffmpeg_details = {u'video': u'', u'audio': u'', u'duration': 0, u'stereo': 0, u'hdtv': 0} global ffmpeg if not ffmpeg and not screenshot: return ffmpeg_details if not ffmpeg and screenshot: return False video = re.compile(u' Video: ') video_HDTV_small = re.compile(u' 1280x', re.UNICODE) video_HDTV_large = re.compile(u' 1920x', re.UNICODE) width_height = re.compile(u'''^(.+?)[ ]\[?([0-9]+)x([0-9]+)[^\\/]*$''', re.UNICODE) audio = re.compile(u' Audio: ', re.UNICODE) audio_stereo = re.compile(u' stereo,', re.UNICODE) audio_mono = re.compile(u' mono,', re.UNICODE) audio_ac3 = re.compile(u' ac3,', re.UNICODE) audio_51 = re.compile(u' 5.1,', re.UNICODE) audio_2C = re.compile(u' 2 channels,', re.UNICODE) audio_1C = re.compile(u' 1 channels,', re.UNICODE) audio_6C = re.compile(u' 6 channels,', re.UNICODE) try: p = subprocess.Popen(u'ffmpeg -i "%s"' % (videofilename), shell=True, bufsize=4096, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) except: if not screenshot: return ffmpeg_details else: return False ffmpeg_found = True alldata = 3 datacount = 0 while 1: if datacount == alldata: # Stop if all the required data has been extracted from ffmpeg's output break data = p.stderr.readline() if data == '': break try: data = unicode(data, 'utf8') except (UnicodeDecodeError): continue # Skip any line that has non-utf8 characters in it except (UnicodeEncodeError, TypeError): pass if data.endswith(u'command not found\n'): ffmpeg_found = False break if data.startswith(u' Duration:'): time = (data[data.index(':')+1: data.index('.')]).strip() ffmpeg_details[u'duration'] = (360*(int(time[:2]))+(int(time[3:5])*60))+int(time[6:8]) datacount+=1 elif len(video.findall(data)): match = width_height.match(data) datacount+=1 if match: dummy, width, height = match.groups() width, height = float(width), float(height) aspect = height/width if screenshot: ffmpeg_details[u'width'] = width ffmpeg_details[u'height'] = height ffmpeg_details[u'aspect'] = aspect if width > 1300.0 or width > 800.0 or width == 720.0 or width == 1080.0 : ffmpeg_details[u'video']+=u'HDTV' ffmpeg_details[u'hdtv'] = 1 elif aspect <= 0.5625: ffmpeg_details[u'video']+=u'WIDESCREEN' if len(ffmpeg_details[u'video']): comma = u',' else: comma = u'' if width > 1300.0: ffmpeg_details[u'video']+=comma+u'1080' elif width > 800.0: ffmpeg_details[u'video']+=comma+u'720' elif len(audio.findall(data)): datacount+=1 if len(audio_stereo.findall(data)) or len(audio_2C.findall(data)): ffmpeg_details[u'audio']+=u'STEREO' ffmpeg_details[u'stereo'] = 1 elif len(audio_mono.findall(data)) or len(audio_1C.findall(data)): ffmpeg_details[u'audio']+=u'MONO' elif (len(audio_51.findall(data)) and len(audio_ac3.findall(data))) or len(audio_6C.findall(data)): ffmpeg_details[u'audio']+=u'DOLBY' continue elif len(audio_51.findall(data)): ffmpeg_details[u'audio']+=u'SURROUND' if ffmpeg_found == False: ffmpeg = False return False else: return ffmpeg_details | 39c39b728dc8648ed385e9cd2c4994942d0ebeea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/39c39b728dc8648ed385e9cd2c4994942d0ebeea/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
10083,
3790,
12,
6768,
792,
2550,
16,
17179,
33,
8381,
4672,
9163,
7736,
6875,
19951,
261,
430,
518,
848,
506,
1392,
13,
336,
279,
6191,
585,
1807,
3189,
327,
1083,
309,
6875,
19951... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10083,
3790,
12,
6768,
792,
2550,
16,
17179,
33,
8381,
4672,
9163,
7736,
6875,
19951,
261,
430,
518,
848,
506,
1392,
13,
336,
279,
6191,
585,
1807,
3189,
327,
1083,
309,
6875,
19951... |
token_list = self.split_tokens(arg, 3, 4) | token_list = self.split_tokens(arg, 3) | def do_ba(self, arg): """ ba <a|w|e> <1|2|4|8> <address> [thread] - set hardware breakpoint """ if not self.lastEvent: raise CmdError, "no process is being debugged" debug = self.lastEvent.debug token_list = self.split_tokens(arg, 3, 4) access = token_list[0].lower() size = token_list[1] address = token_list[2] if access == 'a': access = debug.BP_BREAK_ON_ACCESS elif access == 'w': access = debug.BP_BREAK_ON_WRITE elif access == 'e': access = debug.BP_BREAK_ON_EXECUTION else: raise CmdError, "bad access type: %s" % token_list[0] if size == '1': size = debug.BP_WATCH_BYTE elif size == '2': size = debug.BP_WATCH_WORD elif size == '4': size = debug.BP_WATCH_DWORD elif size == '8': size = debug.BP_WATCH_QWORD else: raise CmdError, "bad breakpoint size: %s" % size if len(token_list) > 4: tid = self.input_thread(token_list[4]) pid = debug.system.get_thread(tid).get_pid() else: pid = self.lastEvent.get_pid() tid = self.lastEvent.get_tid() address = self.input_address(address, pid) if debug.has_hardware_breakpoint(tid, address): debug.erase_hardware_breakpoint(tid, address) debug.define_hardware_breakpoint(tid, address, access, size) debug.enable_hardware_breakpoint(tid, address) | 95edb553305e95a1ded0ce46aa595556f55c8dbe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7261/95edb553305e95a1ded0ce46aa595556f55c8dbe/pdebug.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
12124,
12,
2890,
16,
1501,
4672,
3536,
9846,
411,
69,
96,
91,
96,
73,
34,
411,
21,
96,
22,
96,
24,
96,
28,
34,
411,
2867,
34,
306,
5930,
65,
300,
444,
16251,
18820,
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,
741,
67,
12124,
12,
2890,
16,
1501,
4672,
3536,
9846,
411,
69,
96,
91,
96,
73,
34,
411,
21,
96,
22,
96,
24,
96,
28,
34,
411,
2867,
34,
306,
5930,
65,
300,
444,
16251,
18820,
3536,
... |
self.get_writer(evt.task_id, 'task_output_%s' % evt.arg('out_handle')) \ | self.get_writer(evt.task_id, 'debug/task_output_%s' % evt.arg('out_handle')) \ | def proc_evt_output(self, evt): self.get_writer(evt.task_id, 'task_output_%s' % evt.arg('out_handle')) \ .write(str(evt.arg('data'))) | 1b06946fb33c7c0aab869fedc66521834aeb3ef4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13148/1b06946fb33c7c0aab869fedc66521834aeb3ef4/beakerlc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5418,
67,
73,
11734,
67,
2844,
12,
2890,
16,
6324,
4672,
365,
18,
588,
67,
6299,
12,
73,
11734,
18,
4146,
67,
350,
16,
296,
4148,
19,
4146,
67,
2844,
10185,
87,
11,
738,
6324,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5418,
67,
73,
11734,
67,
2844,
12,
2890,
16,
6324,
4672,
365,
18,
588,
67,
6299,
12,
73,
11734,
18,
4146,
67,
350,
16,
296,
4148,
19,
4146,
67,
2844,
10185,
87,
11,
738,
6324,
18,
... |
return self.stylename | return self.stylename | def __str__(self): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if module in sys.builtin_module_names and not inpackage: | if module in sys.builtin_module_names and inpackage is None: | def _readmodule(module, path, inpackage=None): '''Do the hard work for readmodule[_ex].''' # Compute the full module name (prepending inpackage if set) if inpackage: fullmodule = "%s.%s" % (inpackage, module) else: fullmodule = module # Check in the cache if fullmodule in _modules: return _modules[fullmodule] # Initialize the dict for this module's contents dict = {} # Check if it is a built-in module; we don't do much for these if module in sys.builtin_module_names and not inpackage: _modules[module] = dict return dict # Check for a dotted module name i = module.rfind('.') if i >= 0: package = module[:i] submodule = module[i+1:] parent = _readmodule(package, path, inpackage) if inpackage: package = "%s.%s" % (inpackage, package) return _readmodule(submodule, parent['__path__'], package) # Search the path for the module f = None if inpackage: f, file, (suff, mode, type) = imp.find_module(module, path) else: f, file, (suff, mode, type) = imp.find_module(module, path + sys.path) if type == imp.PKG_DIRECTORY: dict['__path__'] = [file] path = [file] + path f, file, (suff, mode, type) = imp.find_module('__init__', [file]) _modules[fullmodule] = dict if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() return dict stack = [] # stack of (class, indent) pairs g = tokenize.generate_tokens(f.readline) try: for tokentype, token, start, end, line in g: if tokentype == DEDENT: lineno, thisindent = start # close nested classes and defs while stack and stack[-1][1] >= thisindent: del stack[-1] elif token == 'def': lineno, thisindent = start # close previous nested classes and defs while stack and stack[-1][1] >= thisindent: del stack[-1] tokentype, meth_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error if stack: cur_class = stack[-1][0] if isinstance(cur_class, Class): # it's a method cur_class._addmethod(meth_name, lineno) # else it's a nested def else: # it's a function dict[meth_name] = Function(fullmodule, meth_name, file, lineno) stack.append((None, thisindent)) # Marker for nested fns elif token == 'class': lineno, thisindent = start # close previous nested classes and defs while stack and stack[-1][1] >= thisindent: del stack[-1] tokentype, class_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # parse what follows the class name tokentype, token, start, end, line = g.next() inherit = None if token == '(': names = [] # List of superclasses # there's a list of superclasses level = 1 super = [] # Tokens making up current superclass while True: tokentype, token, start, end, line = g.next() if token in (')', ',') and level == 1: n = "".join(super) if n in dict: # we know this super class n = dict[n] else: c = n.split('.') if len(c) > 1: # super class is of the form # module.class: look in module for # class m = c[-2] c = c[-1] if m in _modules: d = _modules[m] if c in d: n = d[c] names.append(n) super = [] if token == '(': level += 1 elif token == ')': level -= 1 if level == 0: break elif token == ',' and level == 1: pass # only use NAME and OP (== dot) tokens for type name elif tokentype in (NAME, OP) and level == 1: super.append(token) # expressions in the base list are not supported inherit = names cur_class = Class(fullmodule, class_name, inherit, file, lineno) if not stack: dict[class_name] = cur_class stack.append((cur_class, thisindent)) elif token == 'import' and start[1] == 0: modules = _getnamelist(g) for mod, mod2 in modules: try: # Recursively read the imported module if not inpackage: _readmodule(mod, path) else: try: _readmodule(mod, path, inpackage) except ImportError: _readmodule(mod, []) except: # If we can't find or parse the imported module, # too bad -- don't die here. pass elif token == 'from' and start[1] == 0: mod, token = _getname(g) if not mod or token != "import": continue names = _getnamelist(g) try: # Recursively read the imported module d = _readmodule(mod, path, inpackage) except: # If we can't find or parse the imported module, # too bad -- don't die here. continue # add any classes that were defined in the imported module # to our name space if they were mentioned in the list for n, n2 in names: if n in d: dict[n2 or n] = d[n] elif n == '*': # don't add names that start with _ for n in d: if n[0] != '_': dict[n] = d[n] except StopIteration: pass f.close() return dict | 4b228016f7248c15c1df2d1be731768fca57d0ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/4b228016f7248c15c1df2d1be731768fca57d0ca/pyclbr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2978,
12,
2978,
16,
589,
16,
316,
5610,
33,
7036,
4672,
9163,
3244,
326,
7877,
1440,
364,
855,
2978,
63,
67,
338,
65,
1093,
6309,
468,
8155,
326,
1983,
1605,
508,
261,
1484,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
2978,
12,
2978,
16,
589,
16,
316,
5610,
33,
7036,
4672,
9163,
3244,
326,
7877,
1440,
364,
855,
2978,
63,
67,
338,
65,
1093,
6309,
468,
8155,
326,
1983,
1605,
508,
261,
1484,
... |
tab_ids.append(max_id + 1) | tab_ids.append(next_id) | def upgrade100(cursor): """Adds the Miro audio guide as a site for anyone who doesn't already have it and isn't using a theme. """ # if the user is using a theme, we don't do anything if not config.get(prefs.THEME_NAME) == prefs.THEME_NAME.default: return audio_guide_url = u'https://www.miroguide.com/audio/' favicon_url = u'https://www.miroguide.com/favicon.ico' cursor.execute("SELECT count(*) FROM channel_guide WHERE url=?", (audio_guide_url,)) count = cursor.fetchone()[0] if count > 0: return max_id = 0 for table in ('channel_folder', 'playlist_folder_item_map', 'channel_guide', 'playlist_item_map', 'feed', 'directory_feed_impl', 'remote_downloader', 'directory_watch_feed_impl', 'rss_feed_impl', 'rss_multi_feed_impl', 'scraper_feed_impl', 'feed_impl', 'search_downloads_feed_impl', 'http_auth_password', 'search_feed_impl', 'icon_cache', 'single_feed_impl', 'item', 'taborder_order', 'manual_feed_impl', 'theme_history', 'playlist', 'widgets_frontend_state', 'playlist_folder'): cursor.execute("SELECT MAX(id) from %s" % table) max_id = max(max_id, cursor.fetchone()[0]) cursor.execute("INSERT INTO channel_guide " "(id, url, allowedURLs, updated_url, favicon, firstTime) VALUES (?, ?, ?, ?, ?, ?)", (max_id + 1, audio_guide_url, "[]", audio_guide_url, favicon_url, True)) # add the new Audio Guide to the site tablist cursor.execute('SELECT tab_ids FROM taborder_order WHERE type=?',('site',)) row = cursor.fetchone() if row is not None: tab_ids = eval_container(row[0]) tab_ids.append(max_id + 1) cursor.execute('UPDATE taborder_order SET tab_ids=? WHERE type=?', (repr(tab_ids), 'site')) else: # no site taborder (#11985). We will create the TabOrder object on # startup, so no need to do anything here pass | 60f998bd2644c0f5d6c97a35a56d88186a546dfc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/60f998bd2644c0f5d6c97a35a56d88186a546dfc/databaseupgrade.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8400,
6625,
12,
9216,
4672,
3536,
3655,
326,
490,
11373,
7447,
7343,
487,
279,
2834,
364,
1281,
476,
10354,
3302,
1404,
1818,
1240,
518,
471,
5177,
1404,
1450,
279,
5006,
18,
3536,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8400,
6625,
12,
9216,
4672,
3536,
3655,
326,
490,
11373,
7447,
7343,
487,
279,
2834,
364,
1281,
476,
10354,
3302,
1404,
1818,
1240,
518,
471,
5177,
1404,
1450,
279,
5006,
18,
3536,
468,
... |
doc = _Request("album.getInfo", params).execute(True) | doc = _Request(self, "album.getInfo", params).execute(True) | def get_album_by_mbid(self, mbid): """Looks up an album by its MusicBrainz ID""" params = {"mbid": _unicode(mbid)} doc = _Request("album.getInfo", params).execute(True) return Album(_extract(doc, "artist"), _extract(doc, "name"), self) | 586fcae54112faed73187de72430dc571c6f7760 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/586fcae54112faed73187de72430dc571c6f7760/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
25090,
67,
1637,
67,
1627,
350,
12,
2890,
16,
4903,
350,
4672,
3536,
20475,
731,
392,
14844,
635,
2097,
490,
14894,
38,
7596,
94,
1599,
8395,
225,
859,
273,
12528,
1627,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
25090,
67,
1637,
67,
1627,
350,
12,
2890,
16,
4903,
350,
4672,
3536,
20475,
731,
392,
14844,
635,
2097,
490,
14894,
38,
7596,
94,
1599,
8395,
225,
859,
273,
12528,
1627,
350,
... |
return self.slideIndex()[number - 1][0] | try: return self.slideIndex()[number - 1][0] except IndexError: return 1 | def titleAt(self, number): """ Return the title of slide number """ return self.slideIndex()[number - 1][0] | 8c7b04b2d080f27ee13ff4803c07b095347ba1c1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/8c7b04b2d080f27ee13ff4803c07b095347ba1c1/SlideShow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2077,
861,
12,
2890,
16,
1300,
4672,
3536,
2000,
326,
2077,
434,
12701,
1300,
3536,
327,
365,
18,
26371,
1016,
1435,
63,
2696,
300,
404,
6362,
20,
65,
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,
0,
0,
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,
2077,
861,
12,
2890,
16,
1300,
4672,
3536,
2000,
326,
2077,
434,
12701,
1300,
3536,
327,
365,
18,
26371,
1016,
1435,
63,
2696,
300,
404,
6362,
20,
65,
2,
-100,
-100,
-100,
-100,
-100,
... |
'HTTPS')) | 'HTTPS', 'HTTP11')) | def test_others(self): cm = self.checkModule | 547a3167be9a49ce1199be00544011707d367d6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/547a3167be9a49ce1199be00544011707d367d6f/test_pyclbr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
28197,
12,
2890,
4672,
5003,
273,
365,
18,
1893,
3120,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
28197,
12,
2890,
4672,
5003,
273,
365,
18,
1893,
3120,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ok.place((900,250)) self._event_finish() | self.game.stuff_event(ok.on_place, (900,250)) self._event_finish() def on_wait(self, data): """ helper function for when we pass control of the event loop to a modal and need user input before we continue """ pass | def close_msgbox(game, actor, player): | 84c2c9bf76da2251a32e2f767e2d3a2d4532345f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14331/84c2c9bf76da2251a32e2f767e2d3a2d4532345f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
3576,
2147,
12,
13957,
16,
8327,
16,
7291,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
1746,
67,
3576,
2147,
12,
13957,
16,
8327,
16,
7291,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def docclass(self, object): | def docclass(self, object, name=None): | def docclass(self, object): """Produce text documentation for a given class object.""" name = object.__name__ bases = object.__bases__ | 2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2c3f3ddf9452a1f3f228e0d8c7abdbeed214a6b7/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
864,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
864,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
16186,
18602,
972,
2,
-10... |
if type(replicaTuple) == types.TupleType: lfns = [lfn] | if type(path) == types.TupleType: lfns = [path] | def removeFile(self, path): if type(replicaTuple) == types.TupleType: lfns = [lfn] elif type(path) == types.ListType: lfns = lfn else: return S_ERROR('LFCClient.removeFile: Must supply a path or list of paths') failed = {} successful = {} res = self.exists(lfns) if not res['OK']: return res lfnsToRemove = res['Value']['Successful'].keys() # If we have less than three lfns to query a session doesn't make sense if len(lfnsToRemove) > 2: self.__openSession() for lfn in lfnsToRemove: # If the files exist if res['Value']['Successful'][lfn]: fullLfn = '%s%s' % (self.prefix,lfn) value = lfc.lfc_unlink(fullLfn) if value == 0: successful[lfn] = True else: failed[lfn] = lfc.sstrerror(lfc.cvar.serrno) # If they don't exist the removal can be considered successful else: successful[lfn] = True for lfns in res['Value']['Failed'].keys(): failed[lfn] = res['Value']['Failed'][lfn] if self.session: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 95f2ea774520863ead2cd9f2cf913232cd97cf6b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/95f2ea774520863ead2cd9f2cf913232cd97cf6b/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
812,
12,
2890,
16,
589,
4672,
309,
618,
12,
803,
13,
422,
1953,
18,
9038,
559,
30,
18594,
2387,
273,
306,
803,
65,
1327,
618,
12,
803,
13,
422,
1953,
18,
19366,
30,
18594,
2387... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
812,
12,
2890,
16,
589,
4672,
309,
618,
12,
803,
13,
422,
1953,
18,
9038,
559,
30,
18594,
2387,
273,
306,
803,
65,
1327,
618,
12,
803,
13,
422,
1953,
18,
19366,
30,
18594,
2387... |
thumb_label = "%s : %ipx*%ipx" %(_(propInfo[0].capitalize()), thumb_width, thumb_height) thumb_sizes.append((thumb_name, thumb_width, thumb_height, thumb_label)) | thumb_label = "%s : %ipx*%ipx" %(_(thumb_name.capitalize()), thumb_width, thumb_height) thumb_extension = "/image_%s" %thumb_name thumb_sizes.append((thumb_name, thumb_width, thumb_height, thumb_label, thumb_extension)) | def getThumbSizes(self) : """ return an ordered list of thumb sizes taken from portal properties imaging properties return a list of tuples [(label, width,height)] """ context = aq_inner(self.context) imaging_properties = getToolByName(context, 'portal_properties').imaging_properties thumb_sizes_props = imaging_properties.getProperty('allowed_sizes') thumb_sizes = [] for prop in thumb_sizes_props : propInfo = prop.split(' ') thumb_name = propInfo[0] thumb_width = int(propInfo[1].split(':')[0]) thumb_height = int(propInfo[1].split(':')[1]) thumb_label = "%s : %ipx*%ipx" %(_(propInfo[0].capitalize()), thumb_width, thumb_height) thumb_sizes.append((thumb_name, thumb_width, thumb_height, thumb_label)) thumb_sizes.sort(key=lambda ts: ts[1]) return thumb_sizes | 2e14661a4fae5cbddf750364dabd8a066b6349fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9052/2e14661a4fae5cbddf750364dabd8a066b6349fd/finder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
18922,
11923,
12,
2890,
13,
294,
3536,
327,
392,
5901,
666,
434,
11156,
8453,
9830,
628,
11899,
1790,
709,
5755,
1790,
327,
279,
666,
434,
10384,
306,
12,
1925,
16,
1835,
16,
4210,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18922,
11923,
12,
2890,
13,
294,
3536,
327,
392,
5901,
666,
434,
11156,
8453,
9830,
628,
11899,
1790,
709,
5755,
1790,
327,
279,
666,
434,
10384,
306,
12,
1925,
16,
1835,
16,
4210,
... |
self.unlink(cr, uid, [id]) cr.execute('DELETE FROM ir_values WHERE value=%s', ('%s,%s' % (model, res_id),)) | ids = self.search(cr, uid, [('res_id','=',res_id), ('model','=',model)]) self.__logger.debug('=> Deleting %s: %s', self._name, ids) if len(ids) > 1 and \ self.__logger.isEnabledFor(logging.WARNING): self.__logger.warn( 'Got %d %s for (%s, %d): %s', len(ids), self._name, model, res_id, map(itemgetter('module','name'), self.read(cr, uid, ids, ['name', 'module']))) self.unlink(cr, uid, ids) cr.execute( 'DELETE FROM ir_values WHERE value=%s', ('%s,%s'%(model, res_id),)) | def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,module) in cr.fetchall(): if (module,name) not in self.loads: self.unlink_mark[(model,res_id)] = id if model=='workflow.activity': cr.execute('select res_type,res_id from wkf_instance where id in (select inst_id from wkf_workitem where act_id=%s)', (res_id,)) wkf_todo.extend(cr.fetchall()) cr.execute("update wkf_transition set condition='True', role_id=NULL, signal=NULL,act_to=act_from,act_from=%s where act_to=%s", (res_id,res_id)) cr.execute("delete from wkf_transition where act_to=%s", (res_id,)) | ca39947d11c1a94ded13d4bd9b683cec4c6eaab0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ca39947d11c1a94ded13d4bd9b683cec4c6eaab0/ir_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
409,
12,
2890,
16,
4422,
16,
4555,
16,
4381,
4672,
309,
486,
4381,
30,
327,
1053,
4381,
273,
666,
12,
6400,
13,
1605,
67,
267,
273,
5753,
18,
5701,
3816,
28385,
87,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
409,
12,
2890,
16,
4422,
16,
4555,
16,
4381,
4672,
309,
486,
4381,
30,
327,
1053,
4381,
273,
666,
12,
6400,
13,
1605,
67,
267,
273,
5753,
18,
5701,
3816,
28385,
87,
11... |
non negative integer | non negative real number | def width(self): r""" Returns the width of self. | 1d786912cc6fc9fc57594377b83d66c73deda9b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1d786912cc6fc9fc57594377b83d66c73deda9b8/paths.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1835,
12,
2890,
4672,
436,
8395,
2860,
326,
1835,
434,
365,
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,
... | [
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,
1835,
12,
2890,
4672,
436,
8395,
2860,
326,
1835,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
os.system(tool.replace('FILENAME', options.file)) | os.system(tool.replace('FILENAME', "'%s'" % options.file.replace("'","\'"))) | def doAction(options, config): """ Do specified in options action and return modified config """ if options.external_tool: tool = options.external_tool else: try: tool = [tool for tool in config['tools'] if \ tool.split()[0] == (options.tool or config['defaultTool'])][0] except: raise ParseError, 'Cannot find specified tool in database' if options.export: for wal in config['wallpapers']: print wal return config if options.add: if not os.path.exists(options.add): raise ActionError, 'File doesn\'t exist' fileList = makeWallpapersList(options.add) for fileName in fileList: if not fileName in config['wallpapers']: config['wallpapers'].append(fileName) return config if options.remove_current: options.remove = config['currentWal'] if not options.remove is None and options.remove != '': try: path = config['wallpapers'][int(options.remove)] except IndexError: raise ActionError, 'No such wallpaper in database.' except ValueError: if not os.path.exists(path): raise ActionError, 'File doesn\'t exist' fileList = makeWallpapersList(path) for fileName in fileList: config['wallpapers'].remove(fileName) return config if options.clear: config['wallpapers'] = [] config['currentWal'] = 0 return config if options.file: os.system(tool.replace('FILENAME', options.file)) return config if not config['wallpapers']: raise ActionError, 'The wallpapers database is empty. Use --add option to add images.' if options.number: if options.number < len(config['wallpapers']): config['currentWal'] = options.number else: raise ActionError, 'No such wallpaper in database.' if options.next: if len(config['wallpapers']) - 1 > config['currentWal']: config['currentWal'] += 1 else: config['currentWal'] = 0 if options.previous: if config['currentWal'] > 0: config['currentWal'] -= 1 else: config['currentWal'] = len(config['wallpapers']) - 1 if options.random: config['currentWal'] = random.randrange(len(config['wallpapers'])) if config['currentWal'] >= len(config['wallpapers']): raise ActionError, 'Selected wallpaper not in database' os.system(tool.replace('FILENAME', config['wallpapers'][config['currentWal']])) return config | 636858367fe8d6f40a8d98c995de34908825cc21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2621/636858367fe8d6f40a8d98c995de34908825cc21/wal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1803,
12,
2116,
16,
642,
4672,
3536,
2256,
1269,
316,
702,
1301,
471,
327,
4358,
642,
3536,
225,
309,
702,
18,
9375,
67,
6738,
30,
5226,
273,
702,
18,
9375,
67,
6738,
469,
30,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
1803,
12,
2116,
16,
642,
4672,
3536,
2256,
1269,
316,
702,
1301,
471,
327,
4358,
642,
3536,
225,
309,
702,
18,
9375,
67,
6738,
30,
5226,
273,
702,
18,
9375,
67,
6738,
469,
30,
7... |
print "--- CRASHED ---" | print "--- CRASHED ---" | def Done(self): print for failed in self.failed: self.PrintFailureHeader(failed.test) if failed.output.stderr: print "--- stderr ---" print failed.output.stderr.strip() if failed.output.stdout: print "--- stdout ---" print failed.output.stdout.strip() print "Command: %s" % EscapeCommand(failed.command) if failed.HasCrashed(): print "--- CRASHED ---" if len(self.failed) == 0: print "===" print "=== All tests succeeded" print "===" else: print print "===" print "=== %i tests failed" % len(self.failed) if self.crashed > 0: print "=== %i tests CRASHED" % self.crashed print "===" | 25578985647441a68370a0c93e5018acecf1a995 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6651/25578985647441a68370a0c93e5018acecf1a995/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8677,
12,
2890,
4672,
1172,
364,
2535,
316,
365,
18,
7307,
30,
365,
18,
5108,
5247,
1864,
12,
7307,
18,
3813,
13,
309,
2535,
18,
2844,
18,
11241,
30,
1172,
5238,
17,
4514,
9948,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8677,
12,
2890,
4672,
1172,
364,
2535,
316,
365,
18,
7307,
30,
365,
18,
5108,
5247,
1864,
12,
7307,
18,
3813,
13,
309,
2535,
18,
2844,
18,
11241,
30,
1172,
5238,
17,
4514,
9948,
6,
1... |
if not proof: prime_test = is_pseudoprime else: prime_test = is_prime randint = current_randstate().python_random().randint while(1): p = randint(lbound,n) if prime_test(p): return ZZ(p) | prime_test = is_pseudoprime randint = current_randstate().python_random().randint while True: p = randint(lbound, n) if prime_test(p): return ZZ(p) | def random_prime(n, proof=None, lbound=2): """ Returns a random prime p between `lbound` and n (i.e. `lbound <= p <= n`). The returned prime is chosen uniformly at random from the set of prime numbers less than or equal to n. INPUT: - ``n`` - an integer >= 2. - ``proof`` - bool or None (default: None) If False, the function uses a pseudo-primality test, which is much faster for really big numbers but does not provide a proof of primality. If None, uses the global default (see :mod:`sage.structure.proof.proof`) - ``lbound`` - an integer >= 2 lower bound for the chosen primes EXAMPLES:: sage: random_prime(100000) 88237 sage: random_prime(2) 2 Here we generate a random prime between 100 and 200:: sage: random_prime(200, lbound=100) 149 If all we care about is finding a pseudo prime, then we can pass in ``proof=False`` :: sage: random_prime(200, proof=False, lbound=100) 149 TESTS:: sage: type(random_prime(2)) <type 'sage.rings.integer.Integer'> sage: type(random_prime(100)) <type 'sage.rings.integer.Integer'> sage: random_prime(1, lbound=-2) #caused Sage hang #10112 Traceback (most recent call last): ... ValueError: n must be greater than or equal to 2 AUTHORS: - Jon Hanke (2006-08-08): with standard Stein cleanup - Jonathan Bober (2007-03-17) """ # since we don't want current_randstate to get # pulled when you say "from sage.arith import *". from sage.misc.randstate import current_randstate from sage.structure.proof.proof import get_flag proof = get_flag(proof, "arithmetic") n = ZZ(n) if n < 2: raise ValueError, "n must be greater than or equal to 2" if n < lbound: raise ValueError, "n must be greater than lbound: %s"%(lbound) elif n == 2: return ZZ(n) else: if not proof: prime_test = is_pseudoprime else: prime_test = is_prime randint = current_randstate().python_random().randint while(1): # In order to ensure that the returned prime is chosen # uniformly from the set of primes it is necessary to # choose a random number and then test for primality. # The method of choosing a random number and then returning # the closest prime smaller than it would typically not, # for example, return the first of a pair of twin primes. p = randint(lbound,n) if prime_test(p): return ZZ(p) | f8af711701bc089bc1b8de230c2f1e8220eef67e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/f8af711701bc089bc1b8de230c2f1e8220eef67e/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
16382,
12,
82,
16,
14601,
33,
7036,
16,
328,
3653,
33,
22,
4672,
3536,
2860,
279,
2744,
17014,
293,
3086,
1375,
80,
3653,
68,
471,
290,
261,
77,
18,
73,
18,
1375,
80,
3653,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
67,
16382,
12,
82,
16,
14601,
33,
7036,
16,
328,
3653,
33,
22,
4672,
3536,
2860,
279,
2744,
17014,
293,
3086,
1375,
80,
3653,
68,
471,
290,
261,
77,
18,
73,
18,
1375,
80,
3653,... |
if data_holiday[0].holiday_status_id.double_validation: | if not data_holiday[0].holiday_status_id.double_validation: | def holidays_validate(self, cr, uid, ids, *args): data_holiday = self.browse(cr, uid, ids) self.check_holidays(cr, uid, ids) if data_holiday[0].holiday_status_id.double_validation: vals = {'state':'validate1'} else: vals = {'state':'validate'} ids2 = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) if ids2: vals['manager_id'] = ids2[0] else: raise osv.except_osv(_('Warning !'),_('No user related to the selected employee.')) self.write(cr, uid, ids, vals) if data_holiday[0].holiday_status_id.double_validation: for record in data_holiday: if record.holiday_type=='employee' and record.type=='remove': vals= { 'name':record.name, 'date_from':record.date_from, 'date_to':record.date_to, 'calendar_id':record.employee_id.calendar_id.id, 'company_id':record.employee_id.company_id.id, 'resource_id':record.employee_id.resource_id.id } self.pool.get('resource.calendar.leaves').create(cr, uid, vals) return True | ee2e1acc780f9a33c3278d7f059fcdc2f8bef1ed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/ee2e1acc780f9a33c3278d7f059fcdc2f8bef1ed/hr_holidays.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28990,
67,
5662,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
501,
67,
76,
17559,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
13,
365,
18,
1893,
67,
76,
22999,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28990,
67,
5662,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
501,
67,
76,
17559,
273,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
13,
365,
18,
1893,
67,
76,
22999,... |
self.pid = os.fork() except: if gc_was_enabled: gc.enable() raise self._child_created = True if self.pid == 0: | def _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite): """Execute program (POSIX version)""" | 8c826b77e033df4e0a1b4ae39c9eafe3bd68336d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/8c826b77e033df4e0a1b4ae39c9eafe3bd68336d/subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8837,
67,
3624,
12,
2890,
16,
833,
16,
9070,
16,
675,
4177,
67,
4293,
16,
1746,
67,
74,
2377,
16,
7239,
16,
1550,
16,
26182,
67,
31276,
16,
11850,
1376,
16,
6710,
7133,
16,
5972... | |
msr = self.readSingleRecordToMSR(filename, dataflag = 0) | msr = self.readSingleRecordToMSR(filename, dataflag=0) | def getFirstRecordHeaderInfo(self, filename): """ Takes a Mini-SEED file and returns header of the first record. Returns a dictionary containing some header information from the first record of the Mini-SEED file only. It returns the location, network, station and channel information. @param filename: Mini-SEED file string. """ # read first header only msr = self.readSingleRecordToMSR(filename, dataflag = 0) header = {} chain = msr.contents # header attributes to be read attributes = ('location', 'network', 'station', 'channel') # loop over attributes for _i in attributes: header[_i] = getattr(chain, _i) return header | da81b4ce7064a28a168b56663efe435b307a52d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10470/da81b4ce7064a28a168b56663efe435b307a52d4/libmseed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7521,
2115,
1864,
966,
12,
2890,
16,
1544,
4672,
3536,
23004,
279,
27987,
17,
1090,
2056,
585,
471,
1135,
1446,
434,
326,
1122,
1409,
18,
225,
2860,
279,
3880,
4191,
2690,
1446,
1779,
62... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7521,
2115,
1864,
966,
12,
2890,
16,
1544,
4672,
3536,
23004,
279,
27987,
17,
1090,
2056,
585,
471,
1135,
1446,
434,
326,
1122,
1409,
18,
225,
2860,
279,
3880,
4191,
2690,
1446,
1779,
62... |
self.assert_(msg.get_labels() == ['filed', 'resent']) | self.assertEqual(msg.get_labels(), ['filed', 'resent']) | def test_labels(self): # Get, set, join, and leave labels msg = mailbox.BabylMessage(_sample_message) self.assertEqual(msg.get_labels(), []) msg.set_labels(['foobar']) self.assertEqual(msg.get_labels(), ['foobar']) msg.set_labels([]) self.assertEqual(msg.get_labels(), []) msg.add_label('filed') self.assertEqual(msg.get_labels(), ['filed']) msg.add_label('resent') self.assert_(msg.get_labels() == ['filed', 'resent']) msg.add_label('resent') self.assert_(msg.get_labels() == ['filed', 'resent']) msg.remove_label('filed') self.assertEqual(msg.get_labels(), ['resent']) msg.add_label('foobar') self.assert_(msg.get_labels() == ['resent', 'foobar']) msg.remove_label('unseen') self.assert_(msg.get_labels() == ['resent', 'foobar']) msg.set_labels(['foobar', 'answered']) self.assert_(msg.get_labels() == ['foobar', 'answered']) | 7731c36bc6f787ca91b8429603fe004822f1f2d8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/7731c36bc6f787ca91b8429603fe004822f1f2d8/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5336,
12,
2890,
4672,
468,
968,
16,
444,
16,
1233,
16,
471,
8851,
3249,
1234,
273,
14187,
18,
38,
24383,
80,
1079,
24899,
6358,
67,
2150,
13,
365,
18,
11231,
5812,
12,
3576,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5336,
12,
2890,
4672,
468,
968,
16,
444,
16,
1233,
16,
471,
8851,
3249,
1234,
273,
14187,
18,
38,
24383,
80,
1079,
24899,
6358,
67,
2150,
13,
365,
18,
11231,
5812,
12,
3576,
... |
return http.Response(stream = message("No data files",'..')) | return HTMLResponse(stream = message("No data files",'..')) | def render(self, ctx): dir = os.path.abspath(self.worksheet.data_directory()) if os.path.exists(dir): return static.File(dir) else: return http.Response(stream = message("No data files",'..')) | 5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/5da3b1cd72cd4a94421b8bc914d7957cdbe6b56d/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
2890,
18,
1252,
8118,
18,
892,
67,
5149,
10756,
309,
1140,
18,
803,
18,
1808,
12,
1214,
4672,
327,
760,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
1577,
273,
1140,
18,
803,
18,
5113,
803,
12,
2890,
18,
1252,
8118,
18,
892,
67,
5149,
10756,
309,
1140,
18,
803,
18,
1808,
12,
1214,
4672,
327,
760,
1... |
... xmin=0, ymin=-1, xmax=3, ymax=1, figsize=[2,1], axes=False) | ... xmin=0, ymin=-1, xmax=3, ymax=1, figsize=[2,1], axes=False) | def __mul__(self, other): """ Multiply two animations. This has the effect of appending the two animinations (the second comes after the first). | cc55e3abc6f1726ed77d68c51cac879f83a47628 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/cc55e3abc6f1726ed77d68c51cac879f83a47628/animate.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
5991,
1283,
2795,
25536,
18,
225,
1220,
711,
326,
5426,
434,
19997,
326,
2795,
10536,
10144,
261,
5787,
2205,
14535,
1839,
326,
1122,
2934... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
1308,
4672,
3536,
5991,
1283,
2795,
25536,
18,
225,
1220,
711,
326,
5426,
434,
19997,
326,
2795,
10536,
10144,
261,
5787,
2205,
14535,
1839,
326,
1122,
2934... |
version = "0.9.2", | version = "0.9.3", | def finalize_options (self): self.set_undefined_options('install', ('install_purelib', 'install_dir'), ('root', 'root'), ('force', 'force'), ) | 1f26a57068e762ab15047c0c6f415ab5ef8501fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/1f26a57068e762ab15047c0c6f415ab5ef8501fd/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
84,
594,
2941,
2187,
296,
5425,
67,
1214,
19899,
7707,
3085,
2187,
296,
3085,
19899,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
84,
594,
2941,
2187,
296,
5425,
67,
1214,
19899,
7707,
3085,
2187,
296,
3085,
19899,... |
sage: a = m(3/8); a | sage: a = m(3/8); a | def _next_var_name(self): """ Return the next available variable name in Magma. | c04f0ba44cf1a87c258dee9681bb5f4ba8144212 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c04f0ba44cf1a87c258dee9681bb5f4ba8144212/magma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4285,
67,
1401,
67,
529,
12,
2890,
4672,
3536,
2000,
326,
1024,
2319,
2190,
508,
316,
490,
9454,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4285,
67,
1401,
67,
529,
12,
2890,
4672,
3536,
2000,
326,
1024,
2319,
2190,
508,
316,
490,
9454,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
rospy.spin() | rospy.spin() | def execute_cb(goal): rospy.loginfo("Received a goal") if not set_tilt_profile([1.05, -.7, 1.05], [0.0, 1.8, 2.0125 + .3]): server.set_aborted(MoveBaseResult(), "Couldn't set the profile on the laser") return configure_laser() configure_head() move_base_client.send_goal(goal, None, None, feedback_cb) while not move_base_client.wait_for_result(rospy.Duration(0.1)): if server.is_preempt_requested(): if server.is_new_goal_available(): goal = server.accept_new_goal() move_base_client.send_goal(goal, None, None, feedback_cb) else: move_base_client.cancel_goal() terminal_state = move_base_client.get_state() result = move_base_client.get_result() if terminal_state == GoalStatus.PREEMPTED: server.set_preempted(result) elif terminal_state == GoalStatus.SUCCEEDED: server.set_succeeded(result) elif terminal_state == GoalStatus.ABORTED: server.set_aborted(result) else: server.set_aborted(result, "Unknown result from move_base") | 122c6f7455ce682a4e43ae2b05805de7bdb5d781 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9426/122c6f7455ce682a4e43ae2b05805de7bdb5d781/pr2_move_base.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
7358,
12,
27354,
4672,
721,
30884,
18,
1330,
1376,
2932,
8872,
279,
17683,
7923,
309,
486,
444,
67,
29419,
67,
5040,
3816,
21,
18,
6260,
16,
225,
300,
18,
27,
16,
404,
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,
1836,
67,
7358,
12,
27354,
4672,
721,
30884,
18,
1330,
1376,
2932,
8872,
279,
17683,
7923,
309,
486,
444,
67,
29419,
67,
5040,
3816,
21,
18,
6260,
16,
225,
300,
18,
27,
16,
404,
18,
... |
filtered += wc.filter.applyfilter(wc.filter.FILTER_RESPONSE_MODIFY, data, 'filter', attrs) | filtered += wc.filter.applyfilter( wc.filter.STAGE_RESPONSE_MODIFY, data, 'filter', attrs) | def _main (): """USAGE: test/run.sh test/filterfile.py <config dir> <.html file>""" if len(sys.argv)!=3: print _main.__doc__ sys.exit(1) confdir = sys.argv[1] fname = sys.argv[2] if fname=="-": f = sys.stdin else: f = file(fname) logfile = os.path.join(confdir, "logging.conf") wc.initlog(logfile, wc.Name, filelogs=False) wc.configuration.config = wc.configuration.init(confdir=confdir) wc.configuration.config.init_filter_modules() wc.proxy.dns_lookups.init_resolver() headers = wc.proxy.Headers.WcMessage() headers['Content-Type'] = "text/html" attrs = wc.filter.get_filterattrs(fname, [wc.filter.FILTER_RESPONSE_MODIFY], headers=headers, serverheaders=headers) filtered = "" data = f.read(2048) while data: print >>sys.stderr, "Test: data", len(data) try: filtered += wc.filter.applyfilter(wc.filter.FILTER_RESPONSE_MODIFY, data, 'filter', attrs) except wc.filter.FilterException, msg: print >>sys.stderr, "Test: exception:", msg pass data = f.read(2048) print >>sys.stderr, "Test: finishing" i = 1 while True: print >>sys.stderr, "Test: finish", i try: filtered += wc.filter.applyfilter(wc.filter.FILTER_RESPONSE_MODIFY, "", 'finish', attrs) break except wc.filter.FilterException, msg: print >>sys.stderr, "Test: finish: exception:", msg wc.proxy.proxy_poll(timeout=max(0, wc.proxy.run_timers())) i += 1 if i==200: # background downloading if javascript is too slow print >>sys.stderr, "Test: oooooops" break print "Filtered:", filtered | 678ba849fbf388983e9878b8f7f0379239e5ab00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/678ba849fbf388983e9878b8f7f0379239e5ab00/filterfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5254,
1832,
30,
3536,
29550,
30,
1842,
19,
2681,
18,
674,
1842,
19,
2188,
768,
18,
2074,
411,
1425,
1577,
34,
411,
18,
2620,
585,
2984,
3660,
309,
562,
12,
9499,
18,
19485,
13,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5254,
1832,
30,
3536,
29550,
30,
1842,
19,
2681,
18,
674,
1842,
19,
2188,
768,
18,
2074,
411,
1425,
1577,
34,
411,
18,
2620,
585,
2984,
3660,
309,
562,
12,
9499,
18,
19485,
13,
... |
def set_trace_cond(cond=None, marker='default'): | def set_trace_cond(cond=None, **kw): | def set_trace_cond(cond=None, marker='default'): """ Sets a condition for set_trace statements that have the specified marker. A condition can either callable, in which case it should take one argument, which is the number of times set_trace(marker) has been called, or it can be a number, in which case the break will only be called. """ Epdb.set_trace_cond(cond, marker) | 8409cafdd9e765520a2898ebeba6f505ffdd8d71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/8409cafdd9e765520a2898ebeba6f505ffdd8d71/epdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5129,
67,
10013,
12,
10013,
33,
7036,
16,
2826,
9987,
4672,
3536,
11511,
279,
2269,
364,
444,
67,
5129,
6317,
716,
1240,
326,
1269,
5373,
18,
225,
432,
2269,
848,
3344,
4140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5129,
67,
10013,
12,
10013,
33,
7036,
16,
2826,
9987,
4672,
3536,
11511,
279,
2269,
364,
444,
67,
5129,
6317,
716,
1240,
326,
1269,
5373,
18,
225,
432,
2269,
848,
3344,
4140,
... |
target.char.baseid = 'sheep_sheered' | target.char.baseid = 'sheep' | def response( char, args, target ): item = wolfpack.finditem( args[0] ) if not item: return if target.char and not char.canreach(target.char, 5): char.socket.clilocmessage(500312) return elif not target.item and not char.canreach(target.pos, 5): char.socket.clilocmessage(500312) return # Corpse => Carve # Wood => Kindling/Logs model = 0 if target.item: if target.item.id == 0x2006 and target.item.corpse: if not char.canreach(target.item, 5): char.socket.clilocmessage(500312) return carve_corpse( char, target.item ) return # For cutting fish elif target.item.id in fish: if target.item.getoutmostchar() != char: char.socket.clilocmessage(500312) return cut_fish(char, target.item) return else: model = target.item.id # This is for sheering only elif target.char and target.char.npc: if target.char.baseid == 'sheep_unsheered': target.char.id = 223 target.char.baseid = 'sheep_sheered' target.char.update() # Create Wool wool = wolfpack.additem("df8") wool.amount = 2 if not utilities.tobackpack(wool, char): wool.update() # Resend weight char.socket.resendstatus() char.socket.clilocmessage( 0x7A2E4 ) # You place the gathered wool into your backpack. # Let the wool regrow (minutes) delay = settings.getnumber('Game Speed', 'Regrow Wool Minutes', 180, 1) delay *= 60000 # Miliseconds per Minute target.char.dispel(None, 1, "regrow_wool", []) target.char.addtimer(delay, "blades.regrow_wool", [], 1, 0, "regrow_wool") return elif target.char.id == 'sheep_sheered': char.socket.clilocmessage( 0x7A2E1 ) # This sheep is not yet ready to be shorn. return else: char.socket.clilocmessage( 0x7A2E2 ) # You can only skin dead creatures. return else: model = target.model if target.model == 0: map = wolfpack.map( target.pos.x, target.pos.y, target.pos.map ) treeid = map['id'] elif target.model != 0: treeid = target.model if utilities.istree(treeid): # Axes/Polearms get Logs, Swords get kindling. # Also allows a mace's war axe to be use. 0x13af and 0x13b0 if item.type == 1002 or item.id == 0x13af or item.id == 0x13b0: if not item or not item.container == char: char.message( "You must equip this item to use it on this target!" ) return else: skills.lumberjacking.response( [ target, item, char ] ) # Swords and Fencing Weapons: Get kindling elif item.type == 1001 or item.type == 1005: skills.lumberjacking.hack_kindling( char, target.pos ) else: # You can't use a bladed item on that. char.socket.clilocmessage( 500494, "", GRAY ) return False | fdb5b14f9901e85f1a087ece92e36c0687c27c8c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/fdb5b14f9901e85f1a087ece92e36c0687c27c8c/blades.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
1149,
16,
833,
16,
1018,
262,
30,
761,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
833,
63,
20,
65,
262,
309,
486,
761,
30,
327,
225,
309,
1018,
18,
3001,
471,
486,
1149,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
766,
12,
1149,
16,
833,
16,
1018,
262,
30,
761,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
833,
63,
20,
65,
262,
309,
486,
761,
30,
327,
225,
309,
1018,
18,
3001,
471,
486,
1149,... |
bottle.moveto( char.pos.x, char.pos.y, char.pos.z, char.pos.map ) bottle.update() | bottle.update() | def poisonit( char, args ): potion = wolfpack.finditem(args[ 0 ]) item = wolfpack.finditem(args[ 1 ]) if not potion or not item: return skill = char.skill[ POISONING ] # poison strength : lesser(1), normal, greater, deadly(4) strength = int( potion.gettag( 'potiontype' ) ) - 13 # consume the potion / add a blank bottle potion.delete() bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): bottle.moveto( char.pos.x, char.pos.y, char.pos.z, char.pos.map ) bottle.update() # FIXME : success / fail chance if skill < ( strength + 0.8 ) * 200: # failed to poison item char.socket.clilocmessage( 1010518 ) return 1 # check skill advance char.checkskill( POISONING, 0, 1000 ) # FIXME : less / strong chance if random.randint( 0, 20 ) > ( skill - strength * 200 ): strength = strength - 1 if strength < 1: # failed to poison char.socket.clilocmessage( 502148 ) return 1 char.socket.clilocmessage( 1010518 ) else: char.socket.clilocmessage( 1010517 ) # decrease karma / fame # set poisoning infos as tags item.settag( 'poisoning_char', char.serial ) item.settag( 'poisoning_strength', strength ) item.settag( 'poisoning_skill', skill ) # weapon : poison chance when hit % = char.skill[ POISONING ] / 4 # number of uses before the poison wears off if item.hasscript( 'blades' ): item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 | 2616b0716784beecde638fa774c10ba40680b82a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/2616b0716784beecde638fa774c10ba40680b82a/poisoning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8275,
4530,
305,
12,
1149,
16,
833,
262,
30,
5974,
285,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
1968,
63,
374,
308,
13,
761,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
1968,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8275,
4530,
305,
12,
1149,
16,
833,
262,
30,
5974,
285,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
1968,
63,
374,
308,
13,
761,
273,
341,
355,
74,
2920,
18,
4720,
1726,
12,
1968,
... |
if key != IHEOL: if key != IHREAL: | if key != "IHEOL": if key != "IHREAL": | def debugme(): "Access to the internals for debugging." proutn("Reset levels? ") if ja() == True: if game.energy < game.inenrg: game.energy = game.inenrg game.shield = game.inshld game.torps = game.intorps game.lsupres = game.inlsr proutn("Reset damage? ") if ja() == True: for i in range(NDEVICES): if game.damage[i] > 0.0: game.damage[i] = 0.0 proutn("Toggle debug flag? ") if ja() == True: idebug = not idebug if idebug: prout("Debug output ON") else: prout("Debug output OFF") proutn("Cause selective damage? ") if ja() == True: for i in range(NDEVICES): proutn("Kill %s?" % device[i]) scanner.chew() key = scanner.next() if key == IHALPHA and scanner.sees("y"): game.damage[i] = 10.0 proutn("Examine/change events? ") if ja() == True: ev = event() w = coord() legends = { FSNOVA: "Supernova ", FTBEAM: "T Beam ", FSNAP: "Snapshot ", FBATTAK: "Base Attack ", FCDBAS: "Base Destroy ", FSCMOVE: "SC Move ", FSCDBAS: "SC Base Destroy ", FDSPROB: "Probe Move ", FDISTR: "Distress Call ", FENSLV: "Enslavement ", FREPRO: "Klingon Build ", } for i in range(1, NEVENTS): proutn(legends[i]) if is_scheduled(i): proutn("%.2f" % (scheduled(i)-game.state.date)) if i == FENSLV or i == FREPRO: ev = findevent(i) proutn(" in %s" % ev.quadrant) else: proutn("never") proutn("? ") scanner.chew() key = scanner.next() if key == 'n': unschedule(i) scanner.chew() elif key == IHREAL: ev = schedule(i, scanner.real) if i == FENSLV or i == FREPRO: scanner.chew() proutn("In quadrant- ") key = scanner.next() # IHEOL says to leave coordinates as they are if key != IHEOL: if key != IHREAL: prout("Event %d canceled, no x coordinate." % (i)) unschedule(i) continue w.i = int(round(scanner.real)) key = scanner.next() if key != IHREAL: prout("Event %d canceled, no y coordinate." % (i)) unschedule(i) continue w.j = int(round(scanner.real)) ev.quadrant = w scanner.chew() proutn("Induce supernova here? ") if ja() == True: game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova = True atover(True) | af15867a294e48006eba4fd9997cae401ccbfb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/af15867a294e48006eba4fd9997cae401ccbfb05/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
1435,
422,
1053,
30,
309,
7920,
18,
15358,
411,
7920,
18,
267,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
1435,
422,
1053,
30,
309,
7920,
18,
15358,
411,
7920,
18,
267,... |
if cur.disabled and (self["key_yellow"].getText()!=(_("Enable"))): | if cur.disabled and (self.key_yellow_choice != self.ENABLE): | def updateState(self): cur = self["timerlist"].getCurrent() if cur: if self["key_red"].getText()!=(_("Delete")): self["actions"].actions.update({"red":self.removeTimerQuestion}) self["key_red"].setText(_("Delete")) self["key_red"].instance.invalidate() if cur.disabled and (self["key_yellow"].getText()!=(_("Enable"))): self["actions"].actions.update({"yellow":self.toggleDisabledState}) self["key_yellow"].setText(_("Enable")) self["key_yellow"].instance.invalidate() elif cur.isRunning() and (self["key_yellow"].getText()!=(_(" "))): del self["actions"].actions["yellow"] self["key_yellow"].setText(_(" ")) self["key_yellow"].instance.invalidate() elif (not cur.isRunning()) and (not cur.disabled) and (self["key_yellow"].getText()!=(_("Disable"))): self["actions"].actions.update({"yellow":self.toggleDisabledState}) self["key_yellow"].setText(_("Disable")) self["key_yellow"].instance.invalidate() else: if self["key_red"].getText()!=(_(" ")): del self["actions"].actions["red"] self["key_red"].setText(_(" ")) self["key_red"].instance.invalidate() if self["key_yellow"].getText()!=(_(" ")): del self["actions"].actions["yellow"] self["key_yellow"].setText(_(" ")) self["key_yellow"].instance.invalidate() showCleanup = True for x in self.list: if (not x[0].disabled) and (x[1] == True): break else: showCleanup = False if showCleanup and (self["key_blue"].getText()!=(_("Cleanup"))): self["actions"].actions.update({"blue":self.cleanupQuestion}) self["key_blue"].setText(_("Cleanup")) self["key_blue"].instance.invalidate() elif (not showCleanup) and (self["key_blue"].getText()!=(_(" "))): del self["actions"].actions["blue"] self["key_blue"].setText(_(" ")) self["key_blue"].instance.invalidate() | 5421ff9c24b05aaa57cdbcf50eedba0edc714cb8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/5421ff9c24b05aaa57cdbcf50eedba0edc714cb8/TimerEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1119,
12,
2890,
4672,
662,
273,
365,
9614,
12542,
1098,
6,
8009,
588,
3935,
1435,
309,
662,
30,
309,
365,
9614,
856,
67,
1118,
6,
8009,
588,
1528,
1435,
5,
33,
24899,
2932,
2613,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
1119,
12,
2890,
4672,
662,
273,
365,
9614,
12542,
1098,
6,
8009,
588,
3935,
1435,
309,
662,
30,
309,
365,
9614,
856,
67,
1118,
6,
8009,
588,
1528,
1435,
5,
33,
24899,
2932,
2613,... |
None, | # typedef void (*lc_callback)(uint32_t, uint32_t, uint32_t, void*); | 252469d959d952d07c6c2b796be96c97a8628abc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3138/252469d959d952d07c6c2b796be96c97a8628abc/libconcord.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
618,
536,
918,
261,
14,
17704,
67,
3394,
21433,
11890,
1578,
67,
88,
16,
2254,
1578,
67,
88,
16,
2254,
1578,
67,
88,
16,
918,
14,
1769,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
468,
618,
536,
918,
261,
14,
17704,
67,
3394,
21433,
11890,
1578,
67,
88,
16,
2254,
1578,
67,
88,
16,
2254,
1578,
67,
88,
16,
918,
14,
1769,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
env['PATH_TRANSLATED']= os.path.normpath( os.path.join(os.getcwd(), env['PATH_INFO'])) | env['PATH_TRANSLATED']= posixpath.normpath( posixpath.join(os.getcwd(), env['PATH_INFO'])) | def get_env(self, req): env = self._ENV.copy() (path, params, query, fragment) = req.split_uri() if params: path = path + params # undo medusa bug while path and path[0] == '/': path = path[1:] if '%' in path: path = unquote(path) if query: # ZPublisher doesn't want the leading '?' query = query[1:] env['PATH_INFO']= '/' + path env['PATH_TRANSLATED']= os.path.normpath( os.path.join(os.getcwd(), env['PATH_INFO'])) if query: env['QUERY_STRING'] = query env['channel.creation_time']=time.time() for header in req.header: key,value = header.split(":",1) key = key.upper() value = value.strip() key = 'HTTP_%s' % ("_".join(key.split( "-"))) if value: env[key]=value return env | f8eab23b81963af0405e9be57ece55b7fef6f25b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8eab23b81963af0405e9be57ece55b7fef6f25b/ClockServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3074,
12,
2890,
16,
1111,
4672,
1550,
273,
365,
6315,
11986,
18,
3530,
1435,
261,
803,
16,
859,
16,
843,
16,
5481,
13,
273,
1111,
18,
4939,
67,
1650,
1435,
309,
859,
30,
589... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3074,
12,
2890,
16,
1111,
4672,
1550,
273,
365,
6315,
11986,
18,
3530,
1435,
261,
803,
16,
859,
16,
843,
16,
5481,
13,
273,
1111,
18,
4939,
67,
1650,
1435,
309,
859,
30,
589... |
box = OWGUI.widgetBox(self.controlArea, "Clusters (k)", addSpace=True) | box = OWGUI.widgetBox(self.controlArea, "Clusters (k)", addSpace=True, spacing=0) left, top, right, bottom = box.getContentsMargins() | def __init__(self, parent=None, signalManager = None): OWWidget.__init__(self, parent, signalManager, 'k-Means Clustering') | 5921e86a0f8db837ec398576f4d3480209314d2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/5921e86a0f8db837ec398576f4d3480209314d2a/OWKMeans.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
79,
17,
4667,
634,
29103,
6134,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
4277,
1318,
273,
599,
4672,
18233,
4609,
16186,
2738,
972,
12,
2890,
16,
982,
16,
4277,
1318,
16,
296,
79,
17,
4667,
634,
29103,
6134,... |
ci.id = self.name | ci.codec_id = self.name | def _cvt_to_pjsua(self): ci = _pjsua.Codec_Info() ci.id = self.name ci.priority = self.priority return ci | a345b69f22c973a48124a6e7446f914f111335d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1375/a345b69f22c973a48124a6e7446f914f111335d7/pjsua.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
11734,
67,
869,
67,
84,
2924,
11886,
12,
2890,
4672,
9039,
273,
389,
84,
2924,
11886,
18,
11008,
67,
966,
1435,
9039,
18,
21059,
67,
350,
273,
365,
18,
529,
9039,
18,
8457,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
71,
11734,
67,
869,
67,
84,
2924,
11886,
12,
2890,
4672,
9039,
273,
389,
84,
2924,
11886,
18,
11008,
67,
966,
1435,
9039,
18,
21059,
67,
350,
273,
365,
18,
529,
9039,
18,
8457,
... |
if any([f.find(l)>=0 for l in libs]): | if any([f.find(l)>=0 for l in l]): | def ldflags(libs=True, flags=False, libs_dir=False, include_dir=False): """Return a list of libraries against which an Op's object file should be linked to benefit from a BLAS implementation. Default: ['blas'], but configuration variable config.blas.ldflags overrides this. """ rval = [] if libs_dir: found_dyn=False dirs = [x[2:] for x in config.blas.ldflags.split() if x.startswith('-L')] libs = ldflags() for d in dirs: for f in os.listdir(d): if f.endswith('.so') or f.endswith('.dylib') or f.endswith('.dll'): if any([f.find(l)>=0 for l in libs]): found_dyn=True if not found_dyn and dirs: warning("We did not found a dynamic library into the library_dir of the library we use for blas. If you use ATLAS, make sure to compile it with dynamics library.") for t in config.blas.ldflags.split(): try: t0, t1, t2 = t[0:3] assert t0 == '-' except: raise ValueError('invalid token in config.blas.ldflags', t) if libs_dir and t1 == 'L': rval.append(t[2:]) elif include_dir and t1 == 'I': raise ValueError('Include dirs are not used for blas. We disable this as this can hide other headers and this is not wanted.', t) rval.append(t[2:]) elif libs and t1=='l': # example -lmkl rval.append(t[2:]) elif flags and t1 not in ['L','I','l']: # example -openmp rval.append(t) elif flags and t1 == 'L': #to find it when we load the compiled op if the env of the used is not well configured. rval.append('-Wl,-rpath,'+t[2:]) return rval | ca0945c95e6ee114e00a828f2f65cd0252fa6ab1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/ca0945c95e6ee114e00a828f2f65cd0252fa6ab1/blas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
2180,
80,
1341,
12,
21571,
33,
5510,
16,
2943,
33,
8381,
16,
15042,
67,
1214,
33,
8381,
16,
2341,
67,
1214,
33,
8381,
4672,
3536,
990,
279,
666,
434,
14732,
5314,
1492,
392,
6066,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
2180,
80,
1341,
12,
21571,
33,
5510,
16,
2943,
33,
8381,
16,
15042,
67,
1214,
33,
8381,
16,
2341,
67,
1214,
33,
8381,
4672,
3536,
990,
279,
666,
434,
14732,
5314,
1492,
392,
6066,... |
dhcp_header_t = ('header',language["dhcp_client"]) | dhcp_header_t = ('header', language["dhcp_client"]) | def __init__(self,body,pos,ui,dbus=None): global daemon, wireless, wired | b0005ec4de814166c61c5718311a6abcdfb25e8d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/353/b0005ec4de814166c61c5718311a6abcdfb25e8d/prefs_curses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
t^4 - 44*t^2 + 487 | t^4 + (-44)*t^2 + 487 | def minpoly(self, var): """ Return the minimal polynomial of this number field element. | 6a80c1192c3a342eae6f82872573df14cb76ebac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/6a80c1192c3a342eae6f82872573df14cb76ebac/number_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
16353,
12,
2890,
16,
569,
4672,
3536,
2000,
326,
16745,
16991,
434,
333,
1300,
652,
930,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
16353,
12,
2890,
16,
569,
4672,
3536,
2000,
326,
16745,
16991,
434,
333,
1300,
652,
930,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
result.addFile(sources.hsource(file, platforms, archs, doprocess)) | result.addFile(sources.hsource(file, fileplatforms, filearchs, doprocess)) | def scandir(self, path, local, process, platforms, archs, sourcelist = []): result = sources.directory() | c04f24b6cfc091cb371499211c80f4a4f0f88990 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/c04f24b6cfc091cb371499211c80f4a4f0f88990/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24865,
12,
2890,
16,
589,
16,
1191,
16,
1207,
16,
17422,
16,
6637,
87,
16,
272,
477,
2183,
376,
273,
5378,
4672,
563,
273,
5550,
18,
5149,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
24865,
12,
2890,
16,
589,
16,
1191,
16,
1207,
16,
17422,
16,
6637,
87,
16,
272,
477,
2183,
376,
273,
5378,
4672,
563,
273,
5550,
18,
5149,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if data.find(pid) != -1 or data.find(ppid) != -1: continue if data.find(u'miro') != -1: if data.find(u'mirobridge') != -1: logger.critical(u"Miro Bridge is already running:") logger.critical(u"(%s)" % data) else: logger.critical(u"Miro is already running and therefore Miro Bridge cannot be run:") logger.critical(u"(%s)" % data) | if data.find(u'miro.real') != -1: logger.critical(u"Miro is already running and therefore Miro Bridge should not be run:") logger.critical(u"(%s)" % data) | def isMirobridgeOrMiroRunning(): '''Check if Miro Bridge or Miro is already running. Only one can be running at the same time. return True if Miro Bridge or Miro us already running return False if Miro Bridge or Miro is NOT running ''' pid = str(os.getpid()) ppid = str(os.getppid()) try: p = subprocess.Popen(u'ps aux | grep "miro"', shell=True, bufsize=4096, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) except: return False while True: data = p.stdout.readline() if not data: return False if data.find(u'grep') != -1: continue if data.find(pid) != -1 or data.find(ppid) != -1: continue if data.find(u'miro') != -1: if data.find(u'mirobridge') != -1: logger.critical(u"Miro Bridge is already running:") logger.critical(u"(%s)" % data) else: logger.critical(u"Miro is already running and therefore Miro Bridge cannot be run:") logger.critical(u"(%s)" % data) break return True #end isMirobridgeOrMiroRunning() | 10d932a66066bdc1fdcfb153a5e76ddb0901ebd0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/10d932a66066bdc1fdcfb153a5e76ddb0901ebd0/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15707,
11373,
18337,
1162,
49,
11373,
7051,
13332,
9163,
1564,
309,
490,
11373,
24219,
578,
490,
11373,
353,
1818,
3549,
18,
5098,
1245,
848,
506,
3549,
622,
326,
1967,
813,
18,
327,
1053,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15707,
11373,
18337,
1162,
49,
11373,
7051,
13332,
9163,
1564,
309,
490,
11373,
24219,
578,
490,
11373,
353,
1818,
3549,
18,
5098,
1245,
848,
506,
3549,
622,
326,
1967,
813,
18,
327,
1053,... |
d = getProxy(MscConfig('msc').schedulers[scheduler_name]).callRemote( | d = getProxy(MscConfig().schedulers[scheduler_name]).callRemote( | def _gotScheduler(self, result): if not result: scheduler_name = MscConfig("msc").default_scheduler else: scheduler_name = result if scheduler_name not in MscConfig('msc').schedulers: return Failure("scheduler %s does not exist" % (scheduler_name)) | 605d2f2b81da4781406cdcf89675b49cf6bdeadd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5988/605d2f2b81da4781406cdcf89675b49cf6bdeadd/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
13212,
11870,
12,
2890,
16,
563,
4672,
309,
486,
563,
30,
8129,
67,
529,
273,
490,
1017,
809,
2932,
959,
71,
20387,
1886,
67,
19972,
469,
30,
8129,
67,
529,
273,
563,
309,
8129,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13212,
11870,
12,
2890,
16,
563,
4672,
309,
486,
563,
30,
8129,
67,
529,
273,
490,
1017,
809,
2932,
959,
71,
20387,
1886,
67,
19972,
469,
30,
8129,
67,
529,
273,
563,
309,
8129,
... |
self.active_char_action.time_left = time_span | self.active_char_action.time_left = self.active_char_action.time_span | def interrupt_active_action(self, action_id): """ Stops the active action if exist, and set as active the action with the 'action_id'. If the action_id is 'None', just stops the active action. """ self.active_char_action.time_left = time_span self.active_char_action = None if(action_id): action = self.get_action(action_id) if(action): self.active_char_action = action | 487fc7866fbe3a584da49fd428b76aea48031c12 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3492/487fc7866fbe3a584da49fd428b76aea48031c12/game_manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13123,
67,
3535,
67,
1128,
12,
2890,
16,
1301,
67,
350,
4672,
3536,
934,
4473,
326,
2695,
1301,
309,
1005,
16,
471,
444,
487,
2695,
326,
1301,
598,
326,
296,
1128,
67,
350,
10332,
971,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13123,
67,
3535,
67,
1128,
12,
2890,
16,
1301,
67,
350,
4672,
3536,
934,
4473,
326,
2695,
1301,
309,
1005,
16,
471,
444,
487,
2695,
326,
1301,
598,
326,
296,
1128,
67,
350,
10332,
971,... |
if not category.is_valid_value(value): | if not category.valid_value(value): | def _form_ratings (form): """Check category value validity""" for key, value in _get_prefix_vals(form, 'category_'): category = _get_category(key) if category is None: # unknown category error['categoryvalue'] = True return False if not category.is_valid_value(value): error['categoryvalue'] = True return False values[key] = value return True | e57320a5f66cd1bb8ce168580daf9cf533104b48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/e57320a5f66cd1bb8ce168580daf9cf533104b48/rating_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
687,
67,
17048,
899,
261,
687,
4672,
3536,
1564,
3150,
460,
13800,
8395,
364,
498,
16,
460,
316,
389,
588,
67,
3239,
67,
4524,
12,
687,
16,
296,
4743,
4623,
4672,
3150,
273,
389,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
687,
67,
17048,
899,
261,
687,
4672,
3536,
1564,
3150,
460,
13800,
8395,
364,
498,
16,
460,
316,
389,
588,
67,
3239,
67,
4524,
12,
687,
16,
296,
4743,
4623,
4672,
3150,
273,
389,
... |
g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) | g = self.clone(s) | def _handle_message(self, msg): s = StringIO() g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) # The payload of a message/rfc822 part should be a multipart sequence # of length 1. The zeroth element of the list should be the Message # object for the subpart.Extract that object, stringify it, and write # that out. g.flatten(msg.get_payload(0), unixfrom=0) self._fp.write(s.getvalue()) | 80924578be1107607fe5455a5f3a47c9be4c4765 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/80924578be1107607fe5455a5f3a47c9be4c4765/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2150,
12,
2890,
16,
1234,
4672,
272,
273,
15777,
1435,
314,
273,
365,
18,
14056,
12,
87,
13,
468,
1021,
2385,
434,
279,
883,
19,
16784,
24532,
1087,
1410,
506,
279,
1026... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
2150,
12,
2890,
16,
1234,
4672,
272,
273,
15777,
1435,
314,
273,
365,
18,
14056,
12,
87,
13,
468,
1021,
2385,
434,
279,
883,
19,
16784,
24532,
1087,
1410,
506,
279,
1026... |
def __init__(self, icon, label=None, is_locked=None, is_on=None): | def __init__(self, icon, label=None, is_locked=None, is_on=False): | def __init__(self, icon, label=None, is_locked=None, is_on=None): self.icon = icon self.label = label self.is_locked = is_locked self.is_on = is_on | f9591bbacc265ef786ef0d088a17b02c647f07c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5280/f9591bbacc265ef786ef0d088a17b02c647f07c2/icon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4126,
16,
1433,
33,
7036,
16,
353,
67,
15091,
33,
7036,
16,
353,
67,
265,
33,
8381,
4672,
365,
18,
3950,
273,
4126,
365,
18,
1925,
273,
1433,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4126,
16,
1433,
33,
7036,
16,
353,
67,
15091,
33,
7036,
16,
353,
67,
265,
33,
8381,
4672,
365,
18,
3950,
273,
4126,
365,
18,
1925,
273,
1433,
365,
18,
... |
'fill':'Fill contours or not', 'contours':"""Either an integer specifying the number of contour levels, or a sequence of numbers giving the actual contours to use.""", | 'fill':'Fill contours or not', 'contours':"""Either an integer specifying the number of contour levels, or a sequence of numbers giving the actual contours to use.""", 'linewidths':'the width of the lines to be plotted (ignored if fill=True)', 'linestyles':'the style of the lines to be plotted (ignored if fill=True)', 'labels':'show line labels or not (ignored if fill=True)', 'label_options':'a dictionary of options for the labels', | def _allowed_options(self): """ Return the allowed options for the ContourPlot class. | c8fbc541f4470707607df5346671b7bd37a4fa08 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/c8fbc541f4470707607df5346671b7bd37a4fa08/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8151,
67,
2116,
12,
2890,
4672,
3536,
2000,
326,
2935,
702,
364,
326,
1816,
477,
11532,
667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8151,
67,
2116,
12,
2890,
4672,
3536,
2000,
326,
2935,
702,
364,
326,
1816,
477,
11532,
667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
command = (sys.executable, 'webcleaner', 'start_nt') ret = os.spawnv(os.P_NOWAIT, command[0], command) | ret = os.spawnv(mode, command[0], command) | def start(): # already running? if os.path.exists(pidfile): raise Exception("webcleaner already started (lock file found). " "Do 'webcleaner stop' first.") try: command = (sys.executable, 'webcleaner', 'start_nt') ret = os.spawnv(os.P_NOWAIT, command[0], command) except OSError, exc: # this seems to happen when the command isn't found print exc raise Exception, \ "command '%s' failed: %s" % (command, exc[-1]) if ret != 0: # and this reflects the command running but failing raise Exception, \ "command '%s' failed with exit status %d" % (command, ret) | 282652b5a90df5a39fff99a5a606857d32bb2e8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/282652b5a90df5a39fff99a5a606857d32bb2e8f/_nt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
13332,
468,
1818,
3549,
35,
309,
1140,
18,
803,
18,
1808,
12,
6610,
768,
4672,
1002,
1185,
2932,
4875,
6200,
264,
1818,
5746,
261,
739,
585,
1392,
2934,
315,
315,
3244,
296,
4875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
13332,
468,
1818,
3549,
35,
309,
1140,
18,
803,
18,
1808,
12,
6610,
768,
4672,
1002,
1185,
2932,
4875,
6200,
264,
1818,
5746,
261,
739,
585,
1392,
2934,
315,
315,
3244,
296,
4875,
... |
if not_bonded == 1: msg = "%d open bond had multiple bonds. It was not bonded." % (not_bonded,) | singlets_not_bonded = self.multibonds() if singlets_not_bonded == 1: msg = "%d open bond had multiple bonds. It was not bonded." % (singlets_not_bonded,) | def make_bonds(self): "Make bonds between all bondable pairs of singlets" self.bondable_pairs_atoms = [] self.merged_chunks = [] not_bonded = 0 # Bondable pairs not bonded counter | 83cc4aff758b9d2dbd64cd45fddb71a888d8b734 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/83cc4aff758b9d2dbd64cd45fddb71a888d8b734/fusechunksMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
70,
4096,
12,
2890,
4672,
315,
6464,
15692,
3086,
777,
8427,
429,
5574,
434,
4864,
17307,
6,
225,
365,
18,
26425,
429,
67,
11545,
67,
14937,
273,
5378,
365,
18,
15459,
67,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4096,
12,
2890,
4672,
315,
6464,
15692,
3086,
777,
8427,
429,
5574,
434,
4864,
17307,
6,
225,
365,
18,
26425,
429,
67,
11545,
67,
14937,
273,
5378,
365,
18,
15459,
67,
14... |
L = at.lattice[:,i] | L = at.lattice[:,i].copy() | def write(self, at): | c678eb69f4e3322139aeed2586b2b437a89e282f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/c678eb69f4e3322139aeed2586b2b437a89e282f/sio2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
622,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
12,
2890,
16,
622,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
b.pack(side = LEFT) | b.pack(side=LEFT) | def build_status_bar(self): status_bar = self.status_bar canvas = self.canvas | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2327,
67,
3215,
12,
2890,
4672,
1267,
67,
3215,
273,
365,
18,
2327,
67,
3215,
5953,
273,
365,
18,
15424,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1361,
67,
2327,
67,
3215,
12,
2890,
4672,
1267,
67,
3215,
273,
365,
18,
2327,
67,
3215,
5953,
273,
365,
18,
15424,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def InsertLineControlPoint(self, dc = None): """Insert a control point at an arbitrary position.""" | def InsertLineControlPoint(self, dc = None, point = None): """Insert a control point at an optional given position.""" | def InsertLineControlPoint(self, dc = None): """Insert a control point at an arbitrary position.""" if dc: self.Erase(dc) | 4809f5df5d38a5d8068c7857e295a4ed22b8659c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/4809f5df5d38a5d8068c7857e295a4ed22b8659c/_lines.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8040,
1670,
3367,
2148,
12,
2890,
16,
6744,
273,
599,
16,
1634,
273,
599,
4672,
3536,
4600,
279,
3325,
1634,
622,
392,
3129,
864,
1754,
12123,
309,
6744,
30,
365,
18,
41,
5648,
12,
720... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8040,
1670,
3367,
2148,
12,
2890,
16,
6744,
273,
599,
16,
1634,
273,
599,
4672,
3536,
4600,
279,
3325,
1634,
622,
392,
3129,
864,
1754,
12123,
309,
6744,
30,
365,
18,
41,
5648,
12,
720... |
Tamagawa Number: 2, Local data at Fractional ideal (2*i + 1): Reduction type: bad non-split multiplicative Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1 Minimal discriminant valuation: 1 Conductor exponent: 1 Kodaira Symbol: I1 Tamagawa Number: 1] | Tamagawa Number: 2] | def local_data(self, P=None, proof = None): r""" Local data for this elliptic curve at the prime `P`. | 829cfc94952c0c1813e9f7aef0851ba5cb4e5b39 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/829cfc94952c0c1813e9f7aef0851ba5cb4e5b39/ell_number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
892,
12,
2890,
16,
453,
33,
7036,
16,
14601,
273,
599,
4672,
436,
8395,
3566,
501,
364,
333,
415,
549,
21507,
8882,
622,
326,
17014,
1375,
52,
8338,
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,
1191,
67,
892,
12,
2890,
16,
453,
33,
7036,
16,
14601,
273,
599,
4672,
436,
8395,
3566,
501,
364,
333,
415,
549,
21507,
8882,
622,
326,
17014,
1375,
52,
8338,
2,
-100,
-100,
-100,
-100... |
class ExtInPkgImporter(iu.Owner): | class ExtInPkgImporter(VFSOwner): | def getmod(self, nm): #print "PkgInVFSImporter.getmod %s -> %s" % (nm, self.name+'.'+nm) return self.owner.getmod(self.name+'.'+nm) | 547565fc5b71c2cb6c373b8bd254db91d35968b6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/547565fc5b71c2cb6c373b8bd254db91d35968b6/importer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1711,
12,
2890,
16,
8442,
4672,
468,
1188,
315,
11264,
382,
58,
4931,
21927,
18,
588,
1711,
738,
87,
317,
738,
87,
6,
738,
261,
15094,
16,
365,
18,
529,
6797,
1093,
15,
15094,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
1711,
12,
2890,
16,
8442,
4672,
468,
1188,
315,
11264,
382,
58,
4931,
21927,
18,
588,
1711,
738,
87,
317,
738,
87,
6,
738,
261,
15094,
16,
365,
18,
529,
6797,
1093,
15,
15094,
1... |
if plan == None: | if plan is None: | def _create_real_plan(inarray, outarray, realtype, flags): """Internal function to create real fft plan given an input and output np array and the realtype and flags integers""" if realtypes != None: raise ValueError, "Two real input arrays but no realtype list given" func, name, types = select(inarray,outarray) if len(types) < 3: plan = func(len(inarray.shape), np.asarray(inarray.shape,dtype=int),\ inarray, outarray, np.asarray(realtype), flags) if plan == None: raise Exception, "Error creating $libname$ plan %s for the given "\ "parameters" %name else: return plan, name elif types[2] == 1: plan = func(inarray.shape[0], inarray, outarray, realtype[0], flags) if plan == None: raise Exception, "Error creating $libname$ plan %s for the given "\ "parameters" %name else: return plan, name elif types[2] == 2: plan = func(inarray.shape[0], inarray.shape[1], inarray, outarray,\ realtype[0], realtype[1], flags) if plan == None: raise Exception, "Error creating $libname$ plan %s for the given "\ "parameters" %name else: return plan, name elif types[2] == 3: plan = func(inarray.shape[0], inarray.shape[1],inarray.shape[2], \ inarray, outarray, realtype[0], realtype[1], \ realtype[2], flags) if plan == None: raise Exception, "Error creating $libname$ plan %s for the given "\ "parameters" %name else: return plan, name else: raise ValueError, 'the dimensions are not correct' | 0767db93dbe7c46ae1fa263076dbea9e42efe30c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2275/0767db93dbe7c46ae1fa263076dbea9e42efe30c/planning.tmpl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
7688,
67,
7088,
12,
267,
1126,
16,
596,
1126,
16,
2863,
723,
16,
2943,
4672,
3536,
3061,
445,
358,
752,
2863,
15741,
4995,
864,
392,
810,
471,
876,
1130,
526,
471,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
7688,
67,
7088,
12,
267,
1126,
16,
596,
1126,
16,
2863,
723,
16,
2943,
4672,
3536,
3061,
445,
358,
752,
2863,
15741,
4995,
864,
392,
810,
471,
876,
1130,
526,
471,
326,
... |
info = metadata.long_description + '\n' | info = metadata.long_description or '' + '\n' | 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. | 018cbb15c04aa544708430bb5b91aebe3e808923 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/018cbb15c04aa544708430bb5b91aebe3e808923/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... |
sage: I.basis() | sage: I.basis() | def basis(self): """ Return an immutable sequence of elements of this ideal (note: their parent is the number field) that form a basis for this ideal viewed as a ZZ-module. | 5a0e2c618364767a01fc42126783eafd365abe47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/5a0e2c618364767a01fc42126783eafd365abe47/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10853,
12,
2890,
4672,
3536,
2000,
392,
11732,
3102,
434,
2186,
434,
333,
23349,
261,
7652,
30,
3675,
982,
353,
326,
1300,
652,
13,
716,
646,
279,
10853,
364,
333,
23349,
1476,
329,
487,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10853,
12,
2890,
4672,
3536,
2000,
392,
11732,
3102,
434,
2186,
434,
333,
23349,
261,
7652,
30,
3675,
982,
353,
326,
1300,
652,
13,
716,
646,
279,
10853,
364,
333,
23349,
1476,
329,
487,... |
cb_count = self.size / 4096 / (num_cb-2) | cb_count = self.size / self.BufferSize / (num_cb-2) | def send_file(self, fp, headers=None, cb=None, num_cb=10): http_conn = self.bucket.connection.connection if not headers: headers = {} headers['Content-MD5'] = self.base64md5 if headers.has_key('Content-Type'): self.content_type = headers['Content-Type'] elif self.path: self.content_type = mimetypes.guess_type(self.path)[0] if self.content_type == None: self.content_type = self.DefaultContentType headers['Content-Type'] = self.content_type else: headers['Content-Type'] = self.content_type headers['Content-Length'] = self.size final_headers = boto.utils.merge_meta(headers, self.metadata); path = '/%s/%s' % (self.bucket.name, self.name) path = urllib.quote(path) self.bucket.connection.add_aws_auth_header(final_headers, 'PUT', path) #the prepending of the protocol and true host must occur after #the authentication header is computed (line above). The #authentication includes the path, which for authentication is #only the bucket and key if self.bucket.connection.use_proxy: path = self.bucket.connection.prefix_proxy_to_path(path) try: http_conn.putrequest('PUT', path) for key in final_headers: http_conn.putheader(key,final_headers[key]) http_conn.endheaders() if cb: if num_cb > 2: cb_count = self.size / 4096 / (num_cb-2) else: cb_count = 0 i = total_bytes = 0 cb(total_bytes, self.size) l = fp.read(4096) while len(l) > 0: http_conn.send(l) if cb: total_bytes += len(l) i += 1 if i == cb_count: cb(total_bytes, self.size) i = 0 l = fp.read(4096) if cb: cb(total_bytes, self.size) response = http_conn.getresponse() body = response.read() except socket.error, e: print 'Caught a socket error, trying to recover' self.bucket.connection.make_http_connection() fp.seek(0) self.send_file(fp, headers) return except Exception, e: print 'Caught an unexpected exception' self.bucket.connection.make_http_connection() raise e if response.status != 200: raise S3ResponseError(response.status, response.reason, body) self.etag = response.getheader('etag') if self.etag != '"%s"' % self.md5: raise S3DataError('Injected data did not return correct MD5') | aef14ab9959c7eb637a2bba40646145bdbdf7b81 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1098/aef14ab9959c7eb637a2bba40646145bdbdf7b81/key.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
768,
12,
2890,
16,
4253,
16,
1607,
33,
7036,
16,
2875,
33,
7036,
16,
818,
67,
7358,
33,
2163,
4672,
1062,
67,
4646,
273,
365,
18,
7242,
18,
4071,
18,
4071,
309,
486,
1607,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
768,
12,
2890,
16,
4253,
16,
1607,
33,
7036,
16,
2875,
33,
7036,
16,
818,
67,
7358,
33,
2163,
4672,
1062,
67,
4646,
273,
365,
18,
7242,
18,
4071,
18,
4071,
309,
486,
1607,
... |
arch = self.config.get('default', 'arch') if arch == 'i386' yumarch = 'athlon' elif arch == 'ppc': yumarch = 'ppc64' elif arch == 'sparc': yumarch = 'sparc64v' else: yumarch = arch | def __init__(self, config, ksparser): | 1357a05145b4a73b99ea406ad36b89907f24231e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8489/1357a05145b4a73b99ea406ad36b89907f24231e/gather.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
16,
11654,
4288,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
1001,
2738,
972,
12,
2890,
16,
642,
16,
11654,
4288,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
v = self.get(section, option) val = int(v) if val not in (0, 1): | states = {'1': 1, 'yes': 1, 'true': 1, 'on': 1, '0': 0, 'no': 0, 'false': 0, 'off': 0} v = self.get(section, option) if not states.has_key(v.lower()): | def getboolean(self, section, option): v = self.get(section, option) val = int(v) if val not in (0, 1): raise ValueError, 'Not a boolean: %s' % v return val | 47334faf8be6e6a9d28284598f6906ad83f1e99c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/47334faf8be6e6a9d28284598f6906ad83f1e99c/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
374,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6494,
12,
2890,
16,
2442,
16,
1456,
4672,
5493,
273,
13666,
21,
4278,
404,
16,
296,
9707,
4278,
404,
16,
296,
3767,
4278,
404,
16,
296,
265,
4278,
404,
16,
296,
20,
4278,
374,
1... |
fakes = self.storage.get('priority_connection', 'fakes', default={}) while 1: name = random.choice(fakes.keys()) fake = fakes[name] try: browser = AuMBrowser(fake['username'], fake['password'], proxy=self.browser.proxy) except (AdopteBanned,BrowserIncorrectPassword), e: self.warning('Fake %s can\'t login: %s' % (name, e)) continue | try: fakes = self.storage.get('priority_connection', 'fakes', default={}) if len(fakes) == 0: return while 1: name = random.choice(fakes.keys()) fake = fakes[name] try: browser = AuMBrowser(fake['username'], fake['password'], proxy=self.browser.proxy) except (AdopteBanned,BrowserIncorrectPassword), e: self.warning('Fake %s can\'t login: %s' % (name, e)) continue | def activity_fakes(self): fakes = self.storage.get('priority_connection', 'fakes', default={}) while 1: name = random.choice(fakes.keys()) fake = fakes[name] try: browser = AuMBrowser(fake['username'], fake['password'], proxy=self.browser.proxy) except (AdopteBanned,BrowserIncorrectPassword), e: self.warning('Fake %s can\'t login: %s' % (name, e)) continue | 1fce063052d4fe0832850fae760131934fbaddc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7471/1fce063052d4fe0832850fae760131934fbaddc4/priority_connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5728,
67,
507,
79,
281,
12,
2890,
4672,
284,
3223,
273,
365,
18,
5697,
18,
588,
2668,
8457,
67,
4071,
2187,
296,
507,
79,
281,
2187,
805,
12938,
13,
1323,
404,
30,
508,
273,
2744,
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,
5728,
67,
507,
79,
281,
12,
2890,
4672,
284,
3223,
273,
365,
18,
5697,
18,
588,
2668,
8457,
67,
4071,
2187,
296,
507,
79,
281,
2187,
805,
12938,
13,
1323,
404,
30,
508,
273,
2744,
18... |
upload_files=None, time_request=False): | upload_files=None): | def post(self, url, params=None, headers={}, status=None, upload_files=None, time_request=False): environ = self.make_environ() if params and isinstance(params, dict): params = urllib.urlencode(params) if upload_files: params = cgi.parse_qsl(params, keep_blank_values=True) content_type, params = self.encode_multipart( params, upload_files) environ['CONTENT_TYPE'] = content_type environ['CONTENT_LENGTH'] = str(len(params)) environ['REQUEST_METHOD'] = 'POST' environ['wsgi.input'] = StringIO(params) req = TestRequest(url, environ) return self.do_request(req, status=status, time_request=time_request) | ca48091ea44cfac081ff0f611458fc46d92445ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/ca48091ea44cfac081ff0f611458fc46d92445ea/fixture.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
12,
2890,
16,
880,
16,
859,
33,
7036,
16,
1607,
28793,
1267,
33,
7036,
16,
3617,
67,
2354,
33,
7036,
4672,
5473,
273,
365,
18,
6540,
67,
28684,
1435,
309,
859,
471,
1549,
12,
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,
1603,
12,
2890,
16,
880,
16,
859,
33,
7036,
16,
1607,
28793,
1267,
33,
7036,
16,
3617,
67,
2354,
33,
7036,
4672,
5473,
273,
365,
18,
6540,
67,
28684,
1435,
309,
859,
471,
1549,
12,
2... |
os.system('invoke-rc.d webcleaner reload') | from wc import daemon daemon.reload() | def onCmdProxyReload (self, sender, sel, ptr): os.system('invoke-rc.d webcleaner reload') debug(GUI, "webcleaner reload") return 1 | 34a16f60bd5fc16a4e6a0a8726e745436071942b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/34a16f60bd5fc16a4e6a0a8726e745436071942b/ConfWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
5931,
3886,
13013,
261,
2890,
16,
5793,
16,
357,
16,
6571,
4672,
628,
14310,
1930,
8131,
8131,
18,
17517,
1435,
1198,
12,
43,
5370,
16,
315,
4875,
6200,
264,
7749,
7923,
327,
404,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
603,
5931,
3886,
13013,
261,
2890,
16,
5793,
16,
357,
16,
6571,
4672,
628,
14310,
1930,
8131,
8131,
18,
17517,
1435,
1198,
12,
43,
5370,
16,
315,
4875,
6200,
264,
7749,
7923,
327,
404,
... |
self.headers[n]=value | self.headers[name]=value | def setHeader(self, name, value): self.headers[n]=value | 9f9b7a24d55086a04c10843626094b465611634b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9f9b7a24d55086a04c10843626094b465611634b/BaseResponse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10859,
12,
2890,
16,
508,
16,
460,
4672,
365,
18,
2485,
63,
82,
65,
33,
1132,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10859,
12,
2890,
16,
508,
16,
460,
4672,
365,
18,
2485,
63,
82,
65,
33,
1132,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
p = urllib.urlopen("%s/workaround.php?%s" % (config.get('pylxr','web-url'),params)) | web_url = config.get('pylxr', 'web-url') p = urllib.urlopen("%s/workaround.php?%s" % (web_url,params)) | def search(req): try: search = req.form['tag'] config = parse_config() dbfile = config.get('pylxr', 'db-file') xafile = config.get('pylxr', 'xapian-dir') directory = os.path.join(os.path.dirname(__file__), "dbaccess/") dbsearch = apache.import_module('dbsearch', path=[directory]) # xapian = apache.import_module('xapianSearch', path=[directory]) DBS = dbsearch.DBSearch(dbfile) allTags = DBS.searchTag(search, '', allMatches=True) if allTags is not None: allTags.sort(key = lambda (a,b,c): (c,a,b)) # allMatches = xapian.search(xafile, search) params = urllib.urlencode({'config':xafile, 'search':search}) p = urllib.urlopen("%s/workaround.php?%s" % (config.get('pylxr','web-url'),params)) allMatches = eval(p.read()) if allMatches is not None: allMatches.sort() req.content_type = 'html' tmpl = psp.PSP(req, filename='templates/search.tmpl') tmpl.run( vars = { 'allTags':allTags, 'allMatches':allMatches, 'search':search } ) except Exception, ex: return str(ex) index(req) | 37cc0ca5ff39865b85a8f5fc026d08b12f3a0ff0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8874/37cc0ca5ff39865b85a8f5fc026d08b12f3a0ff0/index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
3658,
4672,
775,
30,
1623,
273,
1111,
18,
687,
3292,
2692,
3546,
225,
642,
273,
1109,
67,
1425,
1435,
1319,
768,
273,
642,
18,
588,
2668,
2074,
80,
92,
86,
2187,
296,
1966,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
3658,
4672,
775,
30,
1623,
273,
1111,
18,
687,
3292,
2692,
3546,
225,
642,
273,
1109,
67,
1425,
1435,
1319,
768,
273,
642,
18,
588,
2668,
2074,
80,
92,
86,
2187,
296,
1966,
... |
def setpage(self, new): """Sets page and pagelink""" | def setpage(self): """Sets page and page title""" site = wikipedia.getSite() | def setpage(self, new): """Sets page and pagelink""" pageTitle = self.options.page or wikipedia.input(u"Page to edit:") self.page = wikipedia.Page(self.site, pageTitle) if not self.options.edit_redirect and self.page.isRedirectPage(): self.page = wikipedia.Page(self.site, self.page.getRedirectTarget()) | cce9be524362045c1a52c4540f356d3f3fc47e11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/cce9be524362045c1a52c4540f356d3f3fc47e11/editarticle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2433,
12,
2890,
4672,
3536,
2785,
1363,
471,
1363,
2077,
8395,
2834,
273,
21137,
18,
588,
4956,
1435,
1363,
4247,
273,
365,
18,
2116,
18,
2433,
578,
21137,
18,
2630,
12,
89,
6,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2433,
12,
2890,
4672,
3536,
2785,
1363,
471,
1363,
2077,
8395,
2834,
273,
21137,
18,
588,
4956,
1435,
1363,
4247,
273,
365,
18,
2116,
18,
2433,
578,
21137,
18,
2630,
12,
89,
6,
19... |
if not row: break | if not row: break | def askdb(db, ns, sink, fields, tables, condition): scope = something(None, None, 'scope') c = db.cursor() q='select %s from %s where %s;' % (join(fields, ','), join(tables, ','), condition) c.execute(q) while 1: row=c.fetchone() if not row: break subj = something(sink, scope, 'ans') col = 0 for ol in row: sink.makeStatement(None, (RDFSink.SYMBOL, "%s%s" % (ns, fields[col])), subj, ol) col = col + 1 | 289614d10e959030dad93d224a41c4a114c198c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/289614d10e959030dad93d224a41c4a114c198c2/dbview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6827,
1966,
12,
1966,
16,
3153,
16,
9049,
16,
1466,
16,
4606,
16,
2269,
4672,
2146,
273,
5943,
12,
7036,
16,
599,
16,
296,
4887,
6134,
276,
273,
1319,
18,
9216,
1435,
1043,
2218,
4025,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6827,
1966,
12,
1966,
16,
3153,
16,
9049,
16,
1466,
16,
4606,
16,
2269,
4672,
2146,
273,
5943,
12,
7036,
16,
599,
16,
296,
4887,
6134,
276,
273,
1319,
18,
9216,
1435,
1043,
2218,
4025,... |
list = cacheList.sieve(ifo,cacheType,seg1) | list = cacheList.sieve(ifo,cacheType,None,True) list = list.sieve(None,None,seg1) | def filesMatchingGPSinCache(self, cacheString, time=None, cacheType=None, ifo_tag=None, ifo_in_coinc=None): cacheSubSet = self.ifoDict() try: cacheList = Cache.fromfile(open(cacheString)) cacheListTest = 0 except: print >> sys.stderr, "could not open the file " + cacheString cacheListTest = 1 if not cacheListTest: for ifo in self.ifoTypes: try: if time: if time[ifo]: time_ifo = time[ifo] else: #if ifo found in the analysed times, but not in coinc... if ifo_tag and len(ifo)==2 and re.search(ifo,ifo_tag): time_ifo = time[ifo_in_coinc[0]] else: continue seg1 = segments.segment(time_ifo,time_ifo+1) seg2 = segments.segment(time_ifo-1,time_ifo) else: seg1 = None seg2 = None list = cacheList.sieve(ifo,cacheType,seg1) list = list.sieve(None,None,seg2) cacheSubSet[ifo] = list except: continue return(cacheSubSet) | 83b03267f2a1ecc7fe4cacf4bd67596f4157dab5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/83b03267f2a1ecc7fe4cacf4bd67596f4157dab5/fu_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1390,
9517,
28983,
267,
1649,
12,
2890,
16,
1247,
780,
16,
813,
33,
7036,
16,
1247,
559,
33,
7036,
16,
21479,
67,
2692,
33,
7036,
16,
21479,
67,
267,
67,
12645,
71,
33,
7036,
4672,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1390,
9517,
28983,
267,
1649,
12,
2890,
16,
1247,
780,
16,
813,
33,
7036,
16,
1247,
559,
33,
7036,
16,
21479,
67,
2692,
33,
7036,
16,
21479,
67,
267,
67,
12645,
71,
33,
7036,
4672,
1... |
if not isinstance(other, Day): | if not isinstance(other, OHLC): | def __cmp__(self, other): """ Compare self and other. | a7213fc06b60e05eff34efa07d539c0f6047977d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a7213fc06b60e05eff34efa07d539c0f6047977d/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
11051,
365,
471,
1308,
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,
... | [
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,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
11051,
365,
471,
1308,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"""return true if the name is used in function decorator """ | """return true if the name is used in function decorator""" | def is_func_decorator(node): """return true if the name is used in function decorator """ parent = node.parent if parent is None: return 0 if isinstance(parent, astng.Decorators): return 1 return is_func_decorator(parent) | 5b1b907c3e112cd11a38f734c15233f5c1634d1a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/928/5b1b907c3e112cd11a38f734c15233f5c1634d1a/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
644,
67,
19142,
12,
2159,
4672,
3536,
2463,
638,
309,
326,
508,
353,
1399,
316,
445,
7367,
8395,
982,
273,
756,
18,
2938,
309,
982,
353,
599,
30,
327,
374,
309,
1549,
12,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
644,
67,
19142,
12,
2159,
4672,
3536,
2463,
638,
309,
326,
508,
353,
1399,
316,
445,
7367,
8395,
982,
273,
756,
18,
2938,
309,
982,
353,
599,
30,
327,
374,
309,
1549,
12,
29... |
hwdir = os.path.basename(project_info.info("PROJECT_PATH")) + "/hw" | hwdir = os.path.basename(project_info.info("PROJECT_PATH")) + "/hw" | def csrcGenerator(project_info): modules = project_info.info("MODULES") files = project_info.info("FILES") if "harvard" in project_info.info("CPU_INFOS")["CPU_TAGS"]: harvard = True else: harvard = False # file to be included in CSRC variable csrc = [] # file to be included in PCSRC variable pcsrc = [] # files to be included in CPPASRC variable cppasrc = [] # files to be included in CXXSRC variable cxxsrc = [] # files to be included in ASRC variable asrc = [] # constants to be included at the beginning of the makefile constants = {} for module, information in modules.items(): module_files = set([]) dependency_files = set([]) # assembly sources asm_files = set([]) hwdir = os.path.basename(project_info.info("PROJECT_PATH")) + "/hw" if information["enabled"]: if "constants" in information: constants.update(information["constants"]) cfiles, sfiles = findModuleFiles(module, project_info) module_files |= set(cfiles) asm_files |= set(sfiles) for file in information["hw"]: if file.endswith(".c"): module_files |= set([hwdir + "/" + os.path.basename(file)]) for file_dependency in information["depends"] + tuple(files.keys()): dependencyCFiles, dependencySFiles = findModuleFiles(file_dependency, project_info) dependency_files |= set(dependencyCFiles) asm_files |= set(dependencySFiles) for file in module_files: if not harvard or information.get("harvard", "both") == "both": csrc.append(file) if harvard and "harvard" in information: pcsrc.append(file) for file in dependency_files: csrc.append(file) for file in project_info.info("CPU_INFOS")["C_SRC"]: csrc.append(file) for file in project_info.info("CPU_INFOS")["PC_SRC"]: pcsrc.append(file) for file in asm_files: cppasrc.append(file) for file in project_info.info("CPU_INFOS")["CPPA_SRC"]: cppasrc.append(file) for file in project_info.info("CPU_INFOS")["CXX_SRC"]: cxxsrc.append(file) for file in project_info.info("CPU_INFOS")["ASRC"]: asrc.append(file) csrc = set(csrc) csrc = " \\\n\t".join(csrc) + " \\" pcsrc = set(pcsrc) pcsrc = " \\\n\t".join(pcsrc) + " \\" cppasrc = set(cppasrc) cppasrc = " \\\n\t".join(cppasrc) + " \\" cxxsrc = set(cxxsrc) cxxsrc = " \\\n\t".join(cxxsrc) + " \\" asrc = set(asrc) asrc = " \\\n\t".join(asrc) + " \\" constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + unicode(value) for key, value in constants.items()]) return csrc, pcsrc, cppasrc, cxxsrc, asrc, constants | 833e7f9734c6c68a972f14e5f2b423acf4a709f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9114/833e7f9734c6c68a972f14e5f2b423acf4a709f1/bertos_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2873,
1310,
3908,
12,
4406,
67,
1376,
4672,
4381,
273,
1984,
67,
1376,
18,
1376,
2932,
12194,
55,
7923,
1390,
273,
1984,
67,
1376,
18,
1376,
2932,
12669,
7923,
309,
315,
30250,
90,
1060,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2873,
1310,
3908,
12,
4406,
67,
1376,
4672,
4381,
273,
1984,
67,
1376,
18,
1376,
2932,
12194,
55,
7923,
1390,
273,
1984,
67,
1376,
18,
1376,
2932,
12669,
7923,
309,
315,
30250,
90,
1060,... |
seg_data.append(err_cde) | seg_data.set('AK403', err_cde) | def visit_ele(self, err_ele): """ @param err_ele: Segment error handler @type err_ele: L{error_handler.err_ele} """ valid_AK4_codes = ('1', '2', '3', '4', '5', '6', '7', '8', '9', '10') seg_base = pyx12.segment.segment('AK4', '~', '*', ':') if err_ele.subele_pos: seg_base.append('%i:%i' % (err_ele.ele_pos, err_ele.subele_pos)) else: seg_base.append('%i' % (err_ele.ele_pos)) if err_ele.ele_ref_num: seg_base.append(err_ele.ele_ref_num) else: seg_base.append('') seg_str = seg_base.format('~', '*', ':') for (err_cde, err_str, bad_value) in err_ele.errors: if err_cde in valid_AK4_codes: seg_data = pyx12.segment.segment(seg_str, '~', '*', ':') seg_data.append(err_cde) if bad_value: seg_data.append(bad_value) self._write(seg_data) | 276f75f3042688ca8d93384c37b4365fa3d41bc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11528/276f75f3042688ca8d93384c37b4365fa3d41bc9/error_997.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6516,
12,
2890,
16,
393,
67,
6516,
4672,
3536,
632,
891,
393,
67,
6516,
30,
10807,
555,
1838,
632,
723,
393,
67,
6516,
30,
511,
95,
1636,
67,
4176,
18,
370,
67,
6516,
97,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
6516,
12,
2890,
16,
393,
67,
6516,
4672,
3536,
632,
891,
393,
67,
6516,
30,
10807,
555,
1838,
632,
723,
393,
67,
6516,
30,
511,
95,
1636,
67,
4176,
18,
370,
67,
6516,
97,
... |
ogr_module],debug=1 ) | ogr_module],debug=0 ) | def unique(list): """Stolen from MapScript setup script""" dict = {} for item in list: dict[item] = '' return dict.keys() | 1a5ec10193c9426329dc46b2228679bf4830cd01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10290/1a5ec10193c9426329dc46b2228679bf4830cd01/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3089,
12,
1098,
4672,
3536,
510,
355,
275,
628,
1635,
3651,
3875,
2728,
8395,
2065,
273,
2618,
364,
761,
316,
666,
30,
2065,
63,
1726,
65,
273,
875,
327,
2065,
18,
2452,
1435,
282,
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,
3089,
12,
1098,
4672,
3536,
510,
355,
275,
628,
1635,
3651,
3875,
2728,
8395,
2065,
273,
2618,
364,
761,
316,
666,
30,
2065,
63,
1726,
65,
273,
875,
327,
2065,
18,
2452,
1435,
282,
2,
... |
(r'nil|false|true', Name.Constant), | (r'(nil|false|true)\b', Name.Constant), | def get_tokens_unprocessed(self, text): for index, token, value in \ RegexLexer.get_tokens_unprocessed(self, text): if token is Name: if value in self._functions: yield index, Name.Builtin, value continue elif '.' in value: a, b = value.split('.') yield index, Name, a yield index + len(a), Punctuation, u'.' yield index + len(a) + 1, Name, b continue yield index, token, value | b6aaea5d8fe2c82efa385284dda7c08210ef77e9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2885/b6aaea5d8fe2c82efa385284dda7c08210ef77e9/agile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
364,
770,
16,
1147,
16,
460,
316,
521,
15078,
13356,
18,
588,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
309,
1147,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
364,
770,
16,
1147,
16,
460,
316,
521,
15078,
13356,
18,
588,
67,
7860,
67,
318,
11005,
12,
2890,
16,
977,
4672,
309,
1147,
35... |
if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]): | if 'host' in [k.lower() for k in headers]: | def _send_request(self, method, url, body, headers): # If headers already contains a host header, then define the # optional skip_host argument to putrequest(). The check is # harder because field names are case insensitive. if 'Host' in (headers or [k for k in headers.iterkeys() if k.lower() == "host"]): self.putrequest(method, url, skip_host=1) else: self.putrequest(method, url) | 922ed41d8c276ae7638ed40408ca775221b8a0a7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/922ed41d8c276ae7638ed40408ca775221b8a0a7/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
67,
2293,
12,
2890,
16,
707,
16,
880,
16,
1417,
16,
1607,
4672,
468,
971,
1607,
1818,
1914,
279,
1479,
1446,
16,
1508,
4426,
326,
468,
3129,
2488,
67,
2564,
1237,
358,
1378,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4661,
67,
2293,
12,
2890,
16,
707,
16,
880,
16,
1417,
16,
1607,
4672,
468,
971,
1607,
1818,
1914,
279,
1479,
1446,
16,
1508,
4426,
326,
468,
3129,
2488,
67,
2564,
1237,
358,
1378,... |
"watchedTime < ? AND feed_id = ?", | "watchedTime < ? AND feed_id = ? AND keep = 0", | def feed_expiring_view(cls, feed_id, watched_before): return cls.make_view("watchedTime is not NULL AND " "watchedTime < ? AND feed_id = ?", (watched_before, feed_id), joins={'feed': 'item.feed_id=feed.id'}) | c94f36d2c7133b0bb13ee2200b97a0623b160db4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/c94f36d2c7133b0bb13ee2200b97a0623b160db4/item.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4746,
67,
2749,
11256,
67,
1945,
12,
6429,
16,
4746,
67,
350,
16,
23135,
67,
5771,
4672,
327,
2028,
18,
6540,
67,
1945,
2932,
7585,
329,
950,
353,
486,
3206,
4116,
315,
315,
7585,
329,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4746,
67,
2749,
11256,
67,
1945,
12,
6429,
16,
4746,
67,
350,
16,
23135,
67,
5771,
4672,
327,
2028,
18,
6540,
67,
1945,
2932,
7585,
329,
950,
353,
486,
3206,
4116,
315,
315,
7585,
329,... |
self._debug('opcode: getattr | self: %s | path: %s' % (repr(self), path)) | self._debug('opcode: getattr (%d) | self: %s | path: %s' % (self.GetContext()['pid'], repr(self), path)) | def getattr(self, path): ''' Callback which is called into when a stat() is performed on the user side of things. | cd822c1ab7cb45d165d663a1bfd2b556a20cd3f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5149/cd822c1ab7cb45d165d663a1bfd2b556a20cd3f4/fusethread.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3869,
12,
2890,
16,
589,
4672,
9163,
8444,
1492,
353,
2566,
1368,
1347,
279,
610,
1435,
353,
9591,
603,
326,
729,
4889,
434,
9198,
18,
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,
3869,
12,
2890,
16,
589,
4672,
9163,
8444,
1492,
353,
2566,
1368,
1347,
279,
610,
1435,
353,
9591,
603,
326,
729,
4889,
434,
9198,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
args = {'ob':'localimporttest.mod1.C'} | args = {'ob':'basic.mod.C'} | def test_edit_renders_ok(): system = processPackage('localimporttest') root = server.EditingPyDoctorResource(system) args = {'ob':'localimporttest.mod1.C'} result = getTextOfPage(root, 'edit', args=args) # very weak, but it's an assert that things didn't explode assert 'textarea' in result args = {'ob':'does.not.exist'} result = getTextOfPage(root, 'edit', args=args) assert 'An error occurred' in result | d3bf21f55d5f937ae38dd7eb7acb68f0d293f3e8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5471/d3bf21f55d5f937ae38dd7eb7acb68f0d293f3e8/test_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4619,
67,
1187,
6794,
67,
601,
13332,
2619,
273,
1207,
2261,
2668,
3729,
5666,
3813,
6134,
1365,
273,
1438,
18,
28029,
9413,
3244,
30206,
1420,
12,
4299,
13,
833,
273,
13666,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4619,
67,
1187,
6794,
67,
601,
13332,
2619,
273,
1207,
2261,
2668,
3729,
5666,
3813,
6134,
1365,
273,
1438,
18,
28029,
9413,
3244,
30206,
1420,
12,
4299,
13,
833,
273,
13666,
9... |
time.sleep(3) if errors > 10: | time.sleep(3) if errors > 10: | def run(self): self._logger.info("Thread started") dev = self._search_device(vendor_id, product_id) if dev == None: self._logger.critical("WMRS200 not found (%04X %04X), Connected devices:" % (vendor_id, product_id)) for bus in usb.busses(): for dev in bus.devices: logging.critical("- %04X:%04X" % (dev.idVendor, dev.idProduct)) exit(1) | 822182ec449b8c58e18968b0f412e182b83eb92c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3323/822182ec449b8c58e18968b0f412e182b83eb92c/WMRS200Reader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
6315,
4901,
18,
1376,
2932,
3830,
5746,
7923,
4461,
273,
365,
6315,
3072,
67,
5964,
12,
10645,
67,
350,
16,
3017,
67,
350,
13,
309,
4461,
422,
599,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
6315,
4901,
18,
1376,
2932,
3830,
5746,
7923,
4461,
273,
365,
6315,
3072,
67,
5964,
12,
10645,
67,
350,
16,
3017,
67,
350,
13,
309,
4461,
422,
599,
30,
365,
... |
while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] | def readmodule_ex(module, path=[], inpackage=None): '''Read a module file and return a dictionary of classes. Search for MODULE in PATH and sys.path, read and parse the module and return a dictionary with one entry for each class found in the module. If INPACKAGE is true, it must be the dotted name of the package in which we are searching for a submodule, and then PATH must be the package search path; otherwise, we are searching for a top-level module, and PATH is combined with sys.path. ''' # Compute the full module name (prepending inpackage if set) if inpackage: fullmodule = "%s.%s" % (inpackage, module) else: fullmodule = module # Check in the cache if fullmodule in _modules: return _modules[fullmodule] # Initialize the dict for this module's contents dict = {} # Check if it is a built-in module; we don't do much for these if module in sys.builtin_module_names and not inpackage: _modules[module] = dict return dict # Check for a dotted module name i = module.rfind('.') if i >= 0: package = module[:i] submodule = module[i+1:] parent = readmodule_ex(package, path, inpackage) if inpackage: package = "%s.%s" % (inpackage, package) return readmodule_ex(submodule, parent['__path__'], package) # Search the path for the module f = None if inpackage: f, file, (suff, mode, type) = imp.find_module(module, path) else: f, file, (suff, mode, type) = imp.find_module(module, path + sys.path) if type == imp.PKG_DIRECTORY: dict['__path__'] = [file] path = [file] + path f, file, (suff, mode, type) = imp.find_module('__init__', [file]) _modules[fullmodule] = dict if type != imp.PY_SOURCE: # not Python source, can't do anything with this module f.close() return dict classstack = [] # stack of (class, indent) pairs g = tokenize.generate_tokens(f.readline) try: for tokentype, token, start, end, line in g: if token == 'def': lineno, thisindent = start tokentype, meth_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] if classstack: # it's a class method cur_class = classstack[-1][0] cur_class._addmethod(meth_name, lineno) else: # it's a function dict[meth_name] = Function(module, meth_name, file, lineno) elif token == 'class': lineno, thisindent = start tokentype, class_name, start, end, line = g.next() if tokentype != NAME: continue # Syntax error # close all classes indented at least as much while classstack and \ classstack[-1][1] >= thisindent: del classstack[-1] # parse what follows the class name tokentype, token, start, end, line = g.next() inherit = None if token == '(': names = [] # List of superclasses # there's a list of superclasses level = 1 super = [] # Tokens making up current superclass while True: tokentype, token, start, end, line = g.next() if token in (')', ',') and level == 1: n = "".join(super) if n in dict: # we know this super class n = dict[n] else: c = n.split('.') if len(c) > 1: # super class is of the form # module.class: look in module for # class m = c[-2] c = c[-1] if m in _modules: d = _modules[m] if c in d: n = d[c] names.append(n) if token == '(': level += 1 elif token == ')': level -= 1 if level == 0: break elif token == ',' and level == 1: pass else: super.append(token) inherit = names cur_class = Class(module, class_name, inherit, file, lineno) dict[class_name] = cur_class classstack.append((cur_class, thisindent)) elif token == 'import' and start[1] == 0: modules = _getnamelist(g) for mod, mod2 in modules: try: # Recursively read the imported module if not inpackage: readmodule_ex(mod, path) else: try: readmodule_ex(mod, path, inpackage) except ImportError: readmodule_ex(mod) except: # If we can't find or parse the imported module, # too bad -- don't die here. pass elif token == 'from' and start[1] == 0: mod, token = _getname(g) if not mod or token != "import": continue names = _getnamelist(g) try: # Recursively read the imported module d = readmodule_ex(mod, path, inpackage) except: # If we can't find or parse the imported module, # too bad -- don't die here. continue # add any classes that were defined in the imported module # to our name space if they were mentioned in the list for n, n2 in names: if n in d: dict[n2 or n] = d[n] elif n == '*': # only add a name if not already there (to mimic # what Python does internally) also don't add # names that start with _ for n in d: if n[0] != '_' and not n in dict: dict[n] = d[n] except StopIteration: pass f.close() return dict | 69689ec153ac01a51540a5bb3eafceb7eb9c7ba7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/69689ec153ac01a51540a5bb3eafceb7eb9c7ba7/pyclbr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2978,
67,
338,
12,
2978,
16,
589,
22850,
6487,
316,
5610,
33,
7036,
4672,
9163,
1994,
279,
1605,
585,
471,
327,
279,
3880,
434,
3318,
18,
225,
5167,
364,
14057,
316,
7767,
471,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2978,
67,
338,
12,
2978,
16,
589,
22850,
6487,
316,
5610,
33,
7036,
4672,
9163,
1994,
279,
1605,
585,
471,
327,
279,
3880,
434,
3318,
18,
225,
5167,
364,
14057,
316,
7767,
471,
25... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.