rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
nonWordRe=re.compile(r"(\W)") | nonWordRe=re.compile(r"([^a-zA-Z0-9_.])") | def writeInCols(dLine,indentCol,maxCol,indentAtt,file): """writes out the strings (trying not to cut them) in dLine up to maxCol indenting each newline with indentCol. The '&' of the continuation line is at maxCol. indentAtt is the actual intent, and the new indent is returned""" strRe=re.compile(r"('[^'\n]*'|\"[^\"\n]*\")") nonWordRe=re.compile(r"(\W)") maxSize=maxCol-indentCol-1 tol=min(maxSize/6,6)+indentCol for fragment in dLine: if indentAtt+len(fragment)<maxCol: file.write(fragment) indentAtt+=len(fragment) elif len(fragment.lstrip())<=maxSize: file.write("&\n"+(" "*indentCol)) file.write(fragment.lstrip()) indentAtt=indentCol+len(fragment.lstrip()) else: sPieces=strRe.split(fragment) for sPiece in sPieces: if sPiece and (not (sPiece[0]=='"' or sPiece[0]=="'")): subPieces=nonWordRe.split(sPiece) else: subPieces=[sPiece] for subPiece in subPieces: if indentAtt==indentCol: file.write(subPiece.lstrip()) indentAtt+=len(subPiece.lstrip()) elif indentAtt<tol or indentAtt+len(subPiece)<maxCol: file.write(subPiece) indentAtt+=len(subPiece) else: file.write("&\n"+(" "*indentCol)) file.write(subPiece.lstrip()) indentAtt=indentCol+len(subPiece.lstrip()) return indentAtt | 306bf65acffe3e1cf1230009a83273c8d9720fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2834/306bf65acffe3e1cf1230009a83273c8d9720fce/normalizeFortranFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
382,
8011,
12,
72,
1670,
16,
9355,
914,
16,
1896,
914,
16,
9355,
3075,
16,
768,
4672,
3536,
13284,
596,
326,
2064,
261,
698,
310,
486,
358,
6391,
2182,
13,
316,
302,
1670,
731,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
382,
8011,
12,
72,
1670,
16,
9355,
914,
16,
1896,
914,
16,
9355,
3075,
16,
768,
4672,
3536,
13284,
596,
326,
2064,
261,
698,
310,
486,
358,
6391,
2182,
13,
316,
302,
1670,
731,
... |
print 'Recovering', inp, 'into', outp | print "Recovering", inp, "into", outp | def recover(inp, outp, verbose=0, partial=0, force=0, pack=0): print 'Recovering', inp, 'into', outp if os.path.exists(outp) and not force: die("%s exists" % outp) file = open(inp, "rb") if file.read(4) != ZODB.FileStorage.packed_version: die("input is not a file storage") file.seek(0,2) file_size = file.tell() ofs = ZODB.FileStorage.FileStorage(outp, create=1) _ts = None ok = 1 prog1 = 0 preindex = {} undone = 0 pos = 4 while pos: try: npos, transaction = read_transaction_header(file, pos, file_size) except EOFError: break except: print "\n%s: %s\n" % sys.exc_info()[:2] if not verbose: progress(prog1) pos = scan(file, pos) continue if transaction is None: undone = undone + npos - pos pos = npos continue else: pos = npos tid = transaction.tid if _ts is None: _ts = TimeStamp(tid) else: t = TimeStamp(tid) if t <= _ts: if ok: print ('Time stamps out of order %s, %s' % (_ts, t)) ok = 0 _ts = t.laterThan(_ts) tid = `_ts` else: _ts = t if not ok: print ('Time stamps back in order %s' % (t)) ok = 1 if verbose: print 'begin', if verbose > 1: print sys.stdout.flush() ofs.tpc_begin(transaction, tid, transaction.status) if verbose: print 'begin', pos, _ts, if verbose > 1: print sys.stdout.flush() nrec = 0 try: for r in transaction: oid = r.oid if verbose > 1: print u64(oid), r.version, len(r.data) pre = preindex.get(oid) s = ofs.store(oid, pre, r.data, r.version, transaction) preindex[oid] = s nrec += 1 except: if partial and nrec: ofs._status = 'p' ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) if verbose: print 'partial' else: ofs.tpc_abort(transaction) print "\n%s: %s\n" % sys.exc_info()[:2] if not verbose: progress(prog1) pos = scan(file, pos) else: ofs.tpc_vote(transaction) ofs.tpc_finish(transaction) if verbose: print 'finish' sys.stdout.flush() if not verbose: prog = pos * 20l / file_size while prog > prog1: prog1 = prog1 + 1 iprogress(prog1) bad = file_size - undone - ofs._pos print "\n%s bytes removed during recovery" % bad if undone: print "%s bytes of undone transaction data were skipped" % undone if pack is not None: print "Packing ..." from ZODB.referencesf import referencesf ofs.pack(pack, referencesf) ofs.close() | 9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/9bf5e2e14a6436c3a8e756728b18bc7a4b7dd814/fsrecover.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5910,
12,
31647,
16,
596,
84,
16,
3988,
33,
20,
16,
4702,
33,
20,
16,
2944,
33,
20,
16,
2298,
33,
20,
4672,
1172,
315,
27622,
310,
3113,
12789,
16,
315,
18591,
3113,
596,
84,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5910,
12,
31647,
16,
596,
84,
16,
3988,
33,
20,
16,
4702,
33,
20,
16,
2944,
33,
20,
16,
2298,
33,
20,
4672,
1172,
315,
27622,
310,
3113,
12789,
16,
315,
18591,
3113,
596,
84,
225,
... |
FUNCATTR_START : 'startEA', FUNCATTR_END : 'endEA', FUNCATTR_FLAGS : 'flags', FUNCATTR_FRAME : 'frame', FUNCATTR_FRSIZE : 'frsize', FUNCATTR_FRREGS : 'frregs', FUNCATTR_ARGSIZE : 'argsize', FUNCATTR_FPD : 'fpd', FUNCATTR_COLOR : 'color', FUNCATTR_OWNER : 'owner', FUNCATTR_REFQTY : 'refqty' | FUNCATTR_START : (True, 'startEA'), FUNCATTR_END : (True, 'endEA'), FUNCATTR_FLAGS : (False, 'flags'), FUNCATTR_FRAME : (True, 'frame'), FUNCATTR_FRSIZE : (True, 'frsize'), FUNCATTR_FRREGS : (True, 'frregs'), FUNCATTR_ARGSIZE : (True, 'argsize'), FUNCATTR_FPD : (False, 'fpd'), FUNCATTR_COLOR : (False, 'color'), FUNCATTR_OWNER : (True, 'owner'), FUNCATTR_REFQTY : (True, 'refqty') | def SetFunctionAttr(ea, attr, value): """ Set a function attribute @param ea: any address belonging to the function @param attr: one of FUNCATTR_... constants @param value: new value of the attribute @return: 1-ok, 0-failed """ func = idaapi.get_func(ea) if func: _IDC_SetAttr(func, _FUNCATTRMAP, attr, value) return idaapi.update_func(func) | 8b2650eebaf80bde2146ed36982b6253636dd286 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3410/8b2650eebaf80bde2146ed36982b6253636dd286/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
2083,
3843,
12,
24852,
16,
1604,
16,
460,
4672,
3536,
1000,
279,
445,
1566,
225,
632,
891,
24164,
30,
1281,
1758,
17622,
358,
326,
445,
632,
891,
1604,
30,
1245,
434,
478,
21163,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
2083,
3843,
12,
24852,
16,
1604,
16,
460,
4672,
3536,
1000,
279,
445,
1566,
225,
632,
891,
24164,
30,
1281,
1758,
17622,
358,
326,
445,
632,
891,
1604,
30,
1245,
434,
478,
21163,
... |
self.current_item.play() | self.__current.play() | def play(self, next=False): """ play the playlist """ if not self.playlist: log.warning('empty playlist') return False | 5949d6a14c5ea1900f65dfd873a7ac49fa7e8687 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/5949d6a14c5ea1900f65dfd873a7ac49fa7e8687/playlist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1024,
33,
8381,
4672,
3536,
6599,
326,
16428,
3536,
309,
486,
365,
18,
1601,
1098,
30,
613,
18,
8551,
2668,
5531,
16428,
6134,
327,
1083,
2,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1024,
33,
8381,
4672,
3536,
6599,
326,
16428,
3536,
309,
486,
365,
18,
1601,
1098,
30,
613,
18,
8551,
2668,
5531,
16428,
6134,
327,
1083,
2,
-100,
-100,
-100,
-100,
... |
found = False for dependspo in txmbr.depends_on: if member.po == dependspo: found = True break if not found: member.setAsDep(txmbr.po) | found = False for dependspo in txmbr.depends_on: if member.po == dependspo: found = True break if not found: member.setAsDep(txmbr.po) | def _checkInstall(self, txmbr): reqs = txmbr.po.returnPrco('requires') provs = txmbr.po.returnPrco('provides') | 706733f3b9121b7d3da62e013544b91b3b990490 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5445/706733f3b9121b7d3da62e013544b91b3b990490/depsolve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
6410,
12,
2890,
16,
2229,
1627,
86,
4672,
20927,
273,
2229,
1627,
86,
18,
1631,
18,
2463,
28763,
83,
2668,
18942,
6134,
450,
6904,
273,
2229,
1627,
86,
18,
1631,
18,
2463,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
6410,
12,
2890,
16,
2229,
1627,
86,
4672,
20927,
273,
2229,
1627,
86,
18,
1631,
18,
2463,
28763,
83,
2668,
18942,
6134,
450,
6904,
273,
2229,
1627,
86,
18,
1631,
18,
2463,
2... |
vid_per_page = 10 | def video_search(request): video_suitable_for = request.GET.get('videosuitable') video_uploaded = request.GET.get('videouploaded') season = request.GET.get('season') lang = request.GET.get('lang') prac_arr = request.GET.getlist('prac') query = request.GET.get('query') page = request.GET.get('page') geog = request.GET.get('geog') id = request.GET.get('id') partners = request.GET.getlist('partner') from_date = request.GET.get('from_date'); to_date = request.GET.get('to_date'); search_box_params = {} vids = Video.objects.annotate(viewers = Count('screening__farmers_attendance',distinct=True)) if(query): vids = vids.filter(title__icontains = query) search_box_params['query'] = query if(video_suitable_for): vids = vids.filter(video_suitable_for = int(video_suitable_for)) search_box_params['video_suitable_for'] = video_suitable_for if(from_date): search_box_params['from_date'] = from_date; from_date = datetime.date(*map(int,from_date.split('-'))) vids = vids.filter(video_production_end_date__gt = from_date) if(to_date): search_box_params['to_date'] = to_date; to_date = datetime.date(*map(int,to_date.split('-'))) vids = vids.filter(video_production_end_date__lt = to_date) if(video_uploaded == '1'): vids = vids.exclude(youtubeid = '') search_box_params['video_uploaded'] = video_uploaded elif(video_uploaded == '0'): vids = vids.filter(youtubeid = '') search_box_params['video_uploaded'] = video_uploaded if(season): vids = vids.filter(related_agricultural_practices__seasonality = season); search_box_params['season'] = season if(lang): vids = vids.filter(language__id = int(lang)) search_box_params['sel_lang'] = lang search_box_params['langs'] = Language.objects.all().values('id','language_name') if(prac_arr): vids = vids.filter(related_agricultural_practices__id__in = [int(i) for i in prac_arr]) search_box_params['prac'] = prac_arr search_box_params['all_pracs'] = Practices.objects.all().values('id','practice_name') if(geog): geog = geog.upper(); if(geog=="STATE"): vids = vids.filter(village__block__district__state__id = int(id)) elif(geog=="DISTRICT"): vids = vids.filter(village__block__district__id = int(id)) elif(geog=="BLOCK"): vids = vids.filter(village__block__id = int(id)) elif(geog=="VILLAGE"): vids = vids.filter(village__id = int(id)) search_box_params['geog_val'] = views.common.breadcrumbs_options(geog,id) else: search_box_params['geog_val'] = views.common.breadcrumbs_options("COUNTRY",1) if(partners): vids = vids.filter(village__block__district__partner__id__in = map(int,partners)) search_box_params['sel_partners'] = partners search_box_params['all_partners'] = Partners.objects.all().values('id','partner_name') vids = vids.order_by('id') #for paging vid_count = vids.count() tot_pages = int(math.ceil(float(vid_count)/15)) if(not page or int(page) > tot_pages): page = 1 page = int(page) vid_per_page = 10 vids = vids[(page-1)*vid_per_page:((page-1)*vid_per_page)+vid_per_page] paging = dict(tot_pages = range(1,tot_pages+1), vid_count = vid_count, cur_page = page) if vids: all_vid_adoptions = run_query_dict(video_analytics_sql.get_adoption_for_multiple_videos(vids.values_list('id',flat=True)), 'id') for vid in vids: vid.adoptions = all_vid_adoptions[vid.id][0] return render_to_response("searchvideo_result.html",dict(vids = vids, paging=paging, search_box_params = search_box_params)) | 4310904281d6634cf7aa9d118b3787c3255e9211 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11995/4310904281d6634cf7aa9d118b3787c3255e9211/video_analytics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6191,
67,
3072,
12,
2293,
4672,
6191,
67,
26560,
9085,
67,
1884,
273,
590,
18,
3264,
18,
588,
2668,
6768,
538,
89,
9085,
6134,
6191,
67,
23249,
273,
590,
18,
3264,
18,
588,
2668,
9115,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6191,
67,
3072,
12,
2293,
4672,
6191,
67,
26560,
9085,
67,
1884,
273,
590,
18,
3264,
18,
588,
2668,
6768,
538,
89,
9085,
6134,
6191,
67,
23249,
273,
590,
18,
3264,
18,
588,
2668,
9115,... | |
postlaunch = '-none-' | prelaunch = '-none-' | def make_ticket_text(engineer): tag_prefix = date.today().strftime('release_%Y%m%d') # get release tag existing_tags_today = command('git tag -l %s*' % tag_prefix) if existing_tags_today: tag = '%s.%.2d' % (tag_prefix, len(existing_tags_today)) else: tag = tag_prefix last_release = command('git tag -l release_*') if last_release: last_release = last_release[-1] else: last_release = '' changes = command( 'git', 'log', "--format=* %h %s", last_release.strip() + '..') changes = ''.join(changes) prelaunch = [] postlaunch = [] needs_reactor_setup = raw_input('Does this release require a reactor_setup? [n]') needs_flyway = raw_input('Does this release require a migration? [y]') if needs_reactor_setup[:1].lower() in ('y', '1'): postlaunch.append('* service reactor stop') postlaunch.append('* paster reactor_setup /var/local/config/production.ini') postlaunch.append('* service reactor start') if needs_flyway[:1].lower() in ('', 'y', '1'): prelaunch.append('* dump the database in case we need to roll back') postlaunch.append('* paster flyway --url mongo://sfn-mongo-1:27017/') if postlaunch: postlaunch = [ 'From sfu-scmprocess-1 so the following:\n' ] + postlaunch postlaunch = '\n'.join(postlaunch) else: postlaunch = '-none-' if prelaunch: prelaunch = [ 'From sfu-scmprocess-1 so the following:\n' ] + prelaunch postlaunch = '\n'.join(postlaunch) else: postlaunch = '-none-' return TICKET_TEMPLATE.substitute(locals()), tag | 92787e56267bc459c105c56a331f244756cec436 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/92787e56267bc459c105c56a331f244756cec436/push_re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
16282,
67,
955,
12,
8944,
264,
4672,
1047,
67,
3239,
273,
1509,
18,
30064,
7675,
701,
9982,
2668,
9340,
10185,
61,
9,
81,
9,
72,
6134,
468,
336,
3992,
1047,
2062,
67,
4156,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16282,
67,
955,
12,
8944,
264,
4672,
1047,
67,
3239,
273,
1509,
18,
30064,
7675,
701,
9982,
2668,
9340,
10185,
61,
9,
81,
9,
72,
6134,
468,
336,
3992,
1047,
2062,
67,
4156,
... |
scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER) | def add_label(self, box, content): hbox = gtk.HBox(False, 4) | 83a200d579bb831f8f76d2d58f83b385981056c5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/83a200d579bb831f8f76d2d58f83b385981056c5/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1925,
12,
2890,
16,
3919,
16,
913,
4672,
366,
2147,
273,
22718,
18,
44,
3514,
12,
8381,
16,
1059,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
527,
67,
1925,
12,
2890,
16,
3919,
16,
913,
4672,
366,
2147,
273,
22718,
18,
44,
3514,
12,
8381,
16,
1059,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
return False return True | pass return False | def is_cidr(string): '''Returns true if argument is valid classless inter-domain routing syntax, false otherwise''' try: x = openipam.iptypes.IP(string) if x.version() == 4 and x.prefixlen() >= 32: return False if x.version() == 6 and x.prefixlen() >= 128: return False except: return False return True | d04e0e995120cbd7695e27d8c1059dbf46cf8e48 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7602/d04e0e995120cbd7695e27d8c1059dbf46cf8e48/validation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
13478,
86,
12,
1080,
4672,
9163,
1356,
638,
309,
1237,
353,
923,
667,
2656,
1554,
17,
4308,
7502,
6279,
16,
629,
3541,
26418,
775,
30,
619,
273,
1696,
625,
301,
18,
77,
825,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13478,
86,
12,
1080,
4672,
9163,
1356,
638,
309,
1237,
353,
923,
667,
2656,
1554,
17,
4308,
7502,
6279,
16,
629,
3541,
26418,
775,
30,
619,
273,
1696,
625,
301,
18,
77,
825,
... |
_x, _y, screenWidth, screenHeight = wxGetClientDisplayRect() | _x, _y, screenWidth, screenHeight = wx.GetClientDisplayRect() | def initScreenVars(): global screenWidth, screenHeight, wxDefaultFramePos, wxDefaultFrameSize global edWidth, inspWidth, paletteHeight, bottomHeight, underPalette global oglBoldFont, oglStdFont screenWidth = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_X) screenHeight = wx.SystemSettings.GetMetric(wx.SYS_SCREEN_Y) if wx.Platform == '__WXMSW__': _x, _y, screenWidth, screenHeight = wxGetClientDisplayRect() screenHeight -= topMenuHeight else: # handle dual monitors on Linux if screenWidth / screenHeight >= 2: screenWidth = screenWidth / 2 screenWidth = int(screenWidth - verticalTaskbarWidth) screenHeight = int(screenHeight - horizontalTaskbarHeight - topMenuHeight) if wx.Platform == '__WXMSW__': wxDefaultFramePos = wx.DefaultPosition wxDefaultFrameSize = wx.DefaultSize else: wxDefaultFramePos = (screenWidth / 4, screenHeight / 4) wxDefaultFrameSize = (int(round(screenWidth / 1.5)), int(round(screenHeight / 1.5))) edWidth = int(screenWidth * editorScreenWidthPerc - windowManagerSide * 2) inspWidth = screenWidth - edWidth + 1 - windowManagerSide * 4 paletteHeight = paletteHeights[paletteStyle] bottomHeight = screenHeight - paletteHeight underPalette = paletteHeight + windowManagerTop + windowManagerBottom + topMenuHeight if wx.Platform == '__WXMSW__': oglBoldFont = wx.Font(7, wx.DEFAULT, wx.NORMAL, wx.BOLD, False) oglStdFont = wx.Font(7, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False) else: oglBoldFont = wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, False) oglStdFont = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, False) | a421ca6352aa067b7b9e0c55cc96e810cc9b49d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/a421ca6352aa067b7b9e0c55cc96e810cc9b49d6/Preferences.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
7956,
5555,
13332,
2552,
5518,
2384,
16,
5518,
2686,
16,
7075,
1868,
3219,
1616,
16,
7075,
1868,
3219,
1225,
2552,
1675,
2384,
16,
316,
1752,
2384,
16,
12127,
2686,
16,
5469,
2686,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
7956,
5555,
13332,
2552,
5518,
2384,
16,
5518,
2686,
16,
7075,
1868,
3219,
1616,
16,
7075,
1868,
3219,
1225,
2552,
1675,
2384,
16,
316,
1752,
2384,
16,
12127,
2686,
16,
5469,
2686,
... |
status = STATUS_WRITING | def dd(self, src, dest, callback=None, bs=32768, count = -1, skip=0, seek=0): if type(src) in (str, unicode): srcfile = self.backend.open(src) else: srcfile = src | a70e957ae62024bb854ab7edb509c3b57e010d96 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/a70e957ae62024bb854ab7edb509c3b57e010d96/ufo_dd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6957,
12,
2890,
16,
1705,
16,
1570,
16,
1348,
33,
7036,
16,
7081,
33,
1578,
6669,
28,
16,
1056,
273,
300,
21,
16,
2488,
33,
20,
16,
6520,
33,
20,
4672,
309,
618,
12,
4816,
13,
316,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6957,
12,
2890,
16,
1705,
16,
1570,
16,
1348,
33,
7036,
16,
7081,
33,
1578,
6669,
28,
16,
1056,
273,
300,
21,
16,
2488,
33,
20,
16,
6520,
33,
20,
4672,
309,
618,
12,
4816,
13,
316,... | |
class IFileDescriptor(Interface): """A file descriptor. | class ILoggingContext(Interface): """ Give context information that will be used to log events generated by this item. """ def logPrefix(): """ @return: Prefix used during log formatting to indicate context. @rtype: C{str} """ class IFileDescriptor(ILoggingContext): """ A file descriptor. | def getHost(): """Get the host that this port is listening for. | f11a3027b430c8456f64e197c1a0626f178e1f18 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12595/f11a3027b430c8456f64e197c1a0626f178e1f18/interfaces.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8580,
13332,
3536,
967,
326,
1479,
716,
333,
1756,
353,
13895,
364,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8580,
13332,
3536,
967,
326,
1479,
716,
333,
1756,
353,
13895,
364,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
__slots__ = ["instance_name", "force", "hvparams", "beparams"] | __slots__ = OpCode.__slots__ + [ "instance_name", "force", "hvparams", "beparams", ] | def Summary(self): """Generates a summary description of this opcode. | 4f05fd3bdb49a9f1628b9915afde3c0d83367f6d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/4f05fd3bdb49a9f1628b9915afde3c0d83367f6d/opcodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17967,
12,
2890,
4672,
3536,
6653,
279,
4916,
2477,
434,
333,
11396,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17967,
12,
2890,
4672,
3536,
6653,
279,
4916,
2477,
434,
333,
11396,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.factory.protocols.remove(self) | def connectionLost(self, reason): log.debug("Relay at %s disconnected" % self.ip) self.factory.protocols.remove(self) for command, defer, timer in self.commands.itervalues(): timer.cancel() defer.errback(RelayError("Relay at %s disconnected" % self.ip)) | 9cd1172ac08b2c56e5306de057b497d3ccd87ee7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3445/9cd1172ac08b2c56e5306de057b497d3ccd87ee7/dispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
19024,
12,
2890,
16,
3971,
4672,
613,
18,
4148,
2932,
27186,
622,
738,
87,
17853,
6,
738,
365,
18,
625,
13,
364,
1296,
16,
2220,
16,
5441,
316,
365,
18,
7847,
18,
2165,
2372,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1459,
19024,
12,
2890,
16,
3971,
4672,
613,
18,
4148,
2932,
27186,
622,
738,
87,
17853,
6,
738,
365,
18,
625,
13,
364,
1296,
16,
2220,
16,
5441,
316,
365,
18,
7847,
18,
2165,
2372,
1... | |
"""Delayed.loop(ticks,func[,args=()]) -> Stoppable | """Delayed.loop(func[, ticks=0][, args=()]) -> Stoppable | def loop(self, func,ticks=0,args=()): """Delayed.loop(ticks,func[,args=()]) -> Stoppable | df1b71b5fe1dba88c3aad64b4f99f9196a64bd1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/df1b71b5fe1dba88c3aad64b4f99f9196a64bd1f/delay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2798,
12,
2890,
16,
1326,
16,
11767,
33,
20,
16,
1968,
33,
1435,
4672,
3536,
29527,
18,
6498,
12,
11767,
16,
644,
63,
16,
1968,
33,
1435,
5717,
317,
5131,
19586,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2798,
12,
2890,
16,
1326,
16,
11767,
33,
20,
16,
1968,
33,
1435,
4672,
3536,
29527,
18,
6498,
12,
11767,
16,
644,
63,
16,
1968,
33,
1435,
5717,
317,
5131,
19586,
2,
-100,
-100,
-100,
... |
w_closure, w_bytecode]) | w_closure, w_bytecode]) | def build_arguments(self, space, w_arguments, w_kwargs, w_defaults, w_closure): # We cannot systematically go to the application-level (_app.py) # to do this dirty work, for bootstrapping reasons. So we check # if we are in the most simple case and if so do not go to the # application-level at all. co = self if (co.co_flags & (CO_VARARGS|CO_VARKEYWORDS) == 0 and (w_kwargs is None or not space.is_true(w_kwargs)) and (w_closure is None or not space.is_true(w_closure))): # looks like a simple case, see if we got exactly the correct # number of arguments try: args = space.unpacktuple(w_arguments, self.co_argcount) except ValueError: pass # no else: # yes! fine! argnames = [space.wrap(name) for name in co.co_varnames] w_arguments = space.newdict(zip(argnames, args)) return w_arguments # non-trivial case. I won't do it myself. if w_kwargs is None: w_kwargs = space.newdict([]) if w_defaults is None: w_defaults = space.newtuple([]) if w_closure is None: w_closure = space.newtuple([]) w_bytecode = space.wrap(co) w_arguments = space.gethelper(appfile).call( "decode_code_arguments", [w_arguments, w_kwargs, w_defaults, w_closure, w_bytecode]) # we assume that decode_codee_arguments() gives us a dictionary # of the correct length. return w_arguments | 61f349e7901abf44edd8b701518f6e959c3f7978 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/61f349e7901abf44edd8b701518f6e959c3f7978/pycode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
7099,
12,
2890,
16,
3476,
16,
341,
67,
7099,
16,
341,
67,
4333,
16,
341,
67,
7606,
16,
341,
67,
20823,
4672,
468,
1660,
2780,
2619,
2126,
1230,
1960,
358,
326,
2521,
17,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
7099,
12,
2890,
16,
3476,
16,
341,
67,
7099,
16,
341,
67,
4333,
16,
341,
67,
7606,
16,
341,
67,
20823,
4672,
468,
1660,
2780,
2619,
2126,
1230,
1960,
358,
326,
2521,
17,
28... |
ceFactory = ComputingElementFactory( ceUniqueID ) | ceFactory = ComputingElementFactory( ) | def initialize( self, loops = 0 ): """Sets default parameters and creates CE instance """ #Disable monitoring self.am_setOption( 'MonitoringEnabled', False ) # self.log.setLevel('debug') #temporary for debugging self.am_setOption( 'MaxCycles', loops ) | d075bf5188d7d32b4728c3f582086953fc97577d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/d075bf5188d7d32b4728c3f582086953fc97577d/JobAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
365,
16,
14075,
273,
374,
262,
30,
3536,
2785,
805,
1472,
471,
3414,
29538,
791,
3536,
468,
11879,
16309,
365,
18,
301,
67,
542,
1895,
12,
296,
18410,
1526,
2187,
1083,
262,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
365,
16,
14075,
273,
374,
262,
30,
3536,
2785,
805,
1472,
471,
3414,
29538,
791,
3536,
468,
11879,
16309,
365,
18,
301,
67,
542,
1895,
12,
296,
18410,
1526,
2187,
1083,
262,
... |
class Cmp: | class MethodNumber: | def __coerce__(self, other): if isinstance(other, Coerce): return self.arg, other.arg else: return (self.arg, other) | fd288c7cd59cffcdb110d04dca1ba2e821aabac7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/fd288c7cd59cffcdb110d04dca1ba2e821aabac7/test_coercion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2894,
2765,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
7695,
2765,
4672,
327,
365,
18,
3175,
16,
1308,
18,
3175,
469,
30,
327,
261,
2890,
18,
3175,
16,
1308,
13,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2894,
2765,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
7695,
2765,
4672,
327,
365,
18,
3175,
16,
1308,
18,
3175,
469,
30,
327,
261,
2890,
18,
3175,
16,
1308,
13,
2... |
r_arm_angles = [] r_arm_efforts = [] l_arm_angles = [] l_arm_efforts = [] | arm_angles = [[], []] arm_efforts = [[], []] | def joint_states_cb(self, data): r_arm_angles = [] r_arm_efforts = [] l_arm_angles = [] l_arm_efforts = [] r_jt_idx_list = [17, 18, 16, 20, 19, 21, 22] l_jt_idx_list = [31, 32, 30, 34, 33, 35, 36] for i,nm in enumerate(self.joint_nm_list): idx = r_jt_idx_list[i] if data.name[idx] != 'r_'+nm+'_joint': raise RuntimeError('joint angle name does not match. Expected: %s, Actual: %s i: %d'%('r_'+nm+'_joint', data.name[idx], i)) r_arm_angles.append(data.position[idx]) r_arm_efforts.append(data.effort[idx]) | 3a682eff0bfca2c49f435a978c645b4e046ad110 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8117/3a682eff0bfca2c49f435a978c645b4e046ad110/simple_arm_trajectories.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15916,
67,
7992,
67,
7358,
12,
2890,
16,
501,
4672,
23563,
67,
12356,
273,
12167,
6487,
5378,
65,
23563,
67,
17098,
499,
87,
273,
12167,
6487,
5378,
65,
436,
67,
78,
88,
67,
3465,
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,
15916,
67,
7992,
67,
7358,
12,
2890,
16,
501,
4672,
23563,
67,
12356,
273,
12167,
6487,
5378,
65,
23563,
67,
17098,
499,
87,
273,
12167,
6487,
5378,
65,
436,
67,
78,
88,
67,
3465,
67,
... |
@param debug: debug level (0 or 1, for os api 10) | @param debug: debug level (0 or 1, for OS Api 10) | def OSEnvironment(instance, debug=0): """Calculate the environment for an os script. @type instance: instance object @param instance: target instance for the os script run @type debug: integer @param debug: debug level (0 or 1, for os api 10) @rtype: dict @return: dict of environment variables """ result = {} result['OS_API_VERSION'] = '%d' % constants.OS_API_VERSION result['INSTANCE_NAME'] = instance.name result['HYPERVISOR'] = instance.hypervisor result['DISK_COUNT'] = '%d' % len(instance.disks) result['NIC_COUNT'] = '%d' % len(instance.nics) result['DEBUG_LEVEL'] = '%d' % debug for idx, disk in enumerate(instance.disks): real_disk = _RecursiveFindBD(disk) if real_disk is None: raise errors.BlockDeviceError("Block device '%s' is not set up" % str(disk)) real_disk.Open() result['DISK_%d_PATH' % idx] = real_disk.dev_path # FIXME: When disks will have read-only mode, populate this result['DISK_%d_ACCESS' % idx] = 'W' if constants.HV_DISK_TYPE in instance.hvparams: result['DISK_%d_FRONTEND_TYPE' % idx] = \ instance.hvparams[constants.HV_DISK_TYPE] if disk.dev_type in constants.LDS_BLOCK: result['DISK_%d_BACKEND_TYPE' % idx] = 'block' elif disk.dev_type == constants.LD_FILE: result['DISK_%d_BACKEND_TYPE' % idx] = \ 'file:%s' % disk.physical_id[0] for idx, nic in enumerate(instance.nics): result['NIC_%d_MAC' % idx] = nic.mac if nic.ip: result['NIC_%d_IP' % idx] = nic.ip result['NIC_%d_BRIDGE' % idx] = nic.bridge if constants.HV_NIC_TYPE in instance.hvparams: result['NIC_%d_FRONTEND_TYPE' % idx] = \ instance.hvparams[constants.HV_NIC_TYPE] return result | 10c2650b20cea3203db19baa02cca416127a3cea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/10c2650b20cea3203db19baa02cca416127a3cea/backend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5932,
5494,
12,
1336,
16,
1198,
33,
20,
4672,
3536,
8695,
326,
3330,
364,
392,
1140,
2728,
18,
225,
632,
723,
791,
30,
791,
733,
632,
891,
791,
30,
1018,
791,
364,
326,
1140,
2728,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5932,
5494,
12,
1336,
16,
1198,
33,
20,
4672,
3536,
8695,
326,
3330,
364,
392,
1140,
2728,
18,
225,
632,
723,
791,
30,
791,
733,
632,
891,
791,
30,
1018,
791,
364,
326,
1140,
2728,
1... |
image = new_image | if height != width: image = new_image | def save_image(cls, filename, fp, content_type=None, thumbnail_size=None, thumbnail_meta=None, square=False, save_original=False, original_meta=None): if content_type is None: content_type = guess_type(filename) if content_type[0]: content_type = content_type[0] else: content_type = 'application/octet-stream' if not content_type.lower() in SUPPORTED_BY_PIL: return None, None thumbnail_meta = thumbnail_meta or {} image = Image.open(fp) format = image.format if save_original: original_meta = original_meta or {} with cls.create(content_type=content_type, filename=filename, **original_meta) as fp_w: filename = fp_w.name if 'transparency' in image.info: image.save(fp_w, format, transparency=image.info['transparency']) else: image.save(fp_w, format) original = cls.query.get(filename=fp_w.name) else: original=None if square: height = image.size[0] width = image.size[1] sz = max(width, height) if 'transparency' in image.info: new_image = Image.new('RGBA', (sz,sz)) else: new_image = Image.new('RGB', (sz,sz), 'white') if height < width: # image is wider than tall, so center horizontally new_image.paste(image, ((width-height)/2, 0)) elif height > width: # image is taller than wide, so center vertically new_image.paste(image, (0, (height-width)/2)) image = new_image if thumbnail_size: image.thumbnail(thumbnail_size, Image.ANTIALIAS) with cls.create(content_type=content_type, filename=filename, **thumbnail_meta) as fp_w: if 'transparency' in image.info: image.save(fp_w, format, transparency=image.info['transparency']) else: image.save(fp_w, format) thumbnail=cls.query.get(filename=fp_w.name) return original, thumbnail | c6a5927796de02af58fb3d2b6daef67235afe974 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1036/c6a5927796de02af58fb3d2b6daef67235afe974/filesystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
2730,
12,
6429,
16,
1544,
16,
4253,
16,
913,
67,
723,
33,
7036,
16,
9134,
67,
1467,
33,
7036,
16,
9134,
67,
3901,
33,
7036,
16,
8576,
33,
8381,
16,
1923,
67,
8830,
33,
83... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
2730,
12,
6429,
16,
1544,
16,
4253,
16,
913,
67,
723,
33,
7036,
16,
9134,
67,
1467,
33,
7036,
16,
9134,
67,
3901,
33,
7036,
16,
8576,
33,
8381,
16,
1923,
67,
8830,
33,
83... |
cr.execute('select sum(nb_register) from event_registration where id IN %s', (tuple(reg_ids),)) number = cr.fetchone() | number = 0.0 if reg_ids: cr.execute('select sum(nb_register) from event_registration where id IN %s', (tuple(reg_ids),)) number = cr.fetchone() | def _get_register(self, cr, uid, ids, fields, args, context=None): """Get Confirm or uncofirm register value. @param ids: List of Event registration type's id @param fields: List of function fields(register_current and register_prospect). @param context: A standard dictionary for contextual values @return: Dictionary of function fields value. """ register_pool = self.pool.get('event.registration') res = {} for event in self.browse(cr, uid, ids, context): res[event.id] = {} for field in fields: res[event.id][field] = False state = [] if 'register_current' in fields: state += ['open', 'done'] if 'register_prospect' in fields: state.append('draft') | 39655a3578b18c3aac36322c556e4b06d5203a00 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/39655a3578b18c3aac36322c556e4b06d5203a00/event.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4861,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1466,
16,
833,
16,
819,
33,
7036,
4672,
3536,
967,
17580,
578,
6301,
792,
3985,
1744,
460,
18,
632,
891,
3258,
30,
987... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4861,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
1466,
16,
833,
16,
819,
33,
7036,
4672,
3536,
967,
17580,
578,
6301,
792,
3985,
1744,
460,
18,
632,
891,
3258,
30,
987... |
raise ParseError() | raise ParseError("Bad argument -- expected name or tuple") | def parse_funcdef_arg(elt): """ If the given tree token element contains a valid function definition argument (i.e., an identifier token or nested list of identifiers), then return a corresponding string identifier or nested list of string identifiers. Otherwise, raise a ParseError. """ if isinstance(elt, list): if elt[0] == (token.OP, '('): if len(elt) == 3: return parse_funcdef_arg(elt[1]) else: return [parse_funcdef_arg(e) for e in elt[1:-1] if e != (token.OP, ',')] else: raise ParseError() elif elt[0] == token.NAME: return elt[1] else: raise ParseError() | 76aa87c4f3f84f87b6c947e3387d535503259a2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/76aa87c4f3f84f87b6c947e3387d535503259a2a/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
644,
536,
67,
3175,
12,
20224,
4672,
3536,
971,
326,
864,
2151,
1147,
930,
1914,
279,
923,
445,
2379,
1237,
261,
77,
18,
73,
12990,
392,
2756,
1147,
578,
4764,
666,
434,
9863... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
644,
536,
67,
3175,
12,
20224,
4672,
3536,
971,
326,
864,
2151,
1147,
930,
1914,
279,
923,
445,
2379,
1237,
261,
77,
18,
73,
12990,
392,
2756,
1147,
578,
4764,
666,
434,
9863... |
if options.cr and options.lf: parser.error("ony one of --cr or --lf can be specified") | mode = options.net_newline.upper() if mode == 'CR': net_newline = '\r' elif mode == 'LF': net_newline = '\n' elif mode == 'CR+LF' or mode == 'CRLF': net_newline = '\r\n' else: parser.error("Invalid value for --net-nl. Valid are 'CR', 'LF' and 'CR+LF'/'CRLF'.") mode = options.ser_newline.upper() if mode == 'CR': ser_newline = '\r' elif mode == 'LF': ser_newline = '\n' elif mode == 'CR+LF' or mode == 'CRLF': ser_newline = '\r\n' else: parser.error("Invalid value for --ser-nl. Valid are 'CR', 'LF' and 'CR+LF'/'CRLF'.") | def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join() | 8c80bbcfa2dee7de96e5435fdcc0741993aac1ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10955/8c80bbcfa2dee7de96e5435fdcc0741993aac1ac/tcp_serial_redirect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
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,
0,
0,
0,
0,
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,
2132,
12,
2890,
4672,
3536,
4947,
8933,
8395,
309,
365,
18,
11462,
30,
365,
18,
11462,
273,
1083,
365,
18,
5930,
67,
896,
18,
5701,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.errstr.SetError("Error setting field " + f[1] + ": " + OpenIPMI.get_error_string(rv)) raise Exception() | err = ("Error setting field " + f[1] + ": " + OpenIPMI.get_error_string(rv)) self.errstr.SetError(err) raise Exception(err) | def SetupArgs(self): self.errstr.SetError("") args = self.args for f in self.fields: idx = f[0] vtype = f[2] fw = f[3] if (vtype == "bool"): if (fw.get()): val = "true" else: val = "false" pass pass elif (vtype == "enum"): val = str(fw.get()) pass elif ((vtype == "str") or (vtype == "int")): val = str(fw.get()) if (val == ""): val = None pass pass else: continue rv = args.set_val(idx, None, val); if (rv != 0): self.errstr.SetError("Error setting field " + f[1] + ": " + OpenIPMI.get_error_string(rv)) raise Exception() pass return args | f2ad6ddfd85737a99b6ff86af4c43e1a1f28a201 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3867/f2ad6ddfd85737a99b6ff86af4c43e1a1f28a201/gui_domainDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
2615,
12,
2890,
4672,
365,
18,
370,
701,
18,
694,
668,
2932,
7923,
833,
273,
365,
18,
1968,
364,
284,
316,
365,
18,
2821,
30,
2067,
273,
284,
63,
20,
65,
26504,
273,
284,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10939,
2615,
12,
2890,
4672,
365,
18,
370,
701,
18,
694,
668,
2932,
7923,
833,
273,
365,
18,
1968,
364,
284,
316,
365,
18,
2821,
30,
2067,
273,
284,
63,
20,
65,
26504,
273,
284,
63,
... |
Eq('Language', preflang) | In('Language', [preflang, '']) | def __call__(self): """ call - XXX: we should think about caching here...""" self.request.set('disable_border', True) context = Acquisition.aq_inner(self.context) subject = self.request.get('subject', []) portal_languages = getToolByName(context, 'portal_languages') preflang = portal_languages.getPreferredLanguage() portal_catalog = getToolByName(context, 'portal_catalog') if hasattr(portal_catalog, 'getZCatalog'): portal_catalog = portal_catalog.getZCatalog() PQ = Eq('portal_type', 'File') & \ In('object_provides', 'slc.publications.interfaces.IPublicationEnhanced') & \ In('Subject', subject) & \ Eq('review_state', 'published') & \ Eq('Language', [preflang, '']) PUBS = portal_catalog.evalAdvancedQuery(PQ, (('effective','desc'),) ) publist = {} parentlist = [] # we implement a simple sorting by folder id to have a grouping. This is not too nice yet for P in PUBS: path = P.getPath() parentpath = os.path.dirname(path) parentlist.append(parentpath) section = publist.get(parentpath, []) section.append(P) publist[parentpath] = section Q = In('portal_type', ['Folder', 'Large Plone Folder']) & \ In('object_provides', 'slc.publications.interfaces.IPublicationContainerEnhanced')& \ Eq('Language', preflang) PARENTS = portal_catalog.evalAdvancedQuery(Q, (('getObjPositionInParent','asc'),) ) self.publist = publist self.parents = [(x.getPath(), x) for x in PARENTS] return self.template() | 5077db634a3bc5dba0090a91b959799159d31a61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10274/5077db634a3bc5dba0090a91b959799159d31a61/publications_by_subject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
3536,
745,
300,
11329,
30,
732,
1410,
15507,
2973,
11393,
2674,
7070,
3660,
365,
18,
2293,
18,
542,
2668,
8394,
67,
8815,
2187,
1053,
13,
225,
819,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
3536,
745,
300,
11329,
30,
732,
1410,
15507,
2973,
11393,
2674,
7070,
3660,
365,
18,
2293,
18,
542,
2668,
8394,
67,
8815,
2187,
1053,
13,
225,
819,
273,
... |
ct = time.localtime(os.stat(rasterfilename)[9]) | ct = time.localtime(os.stat(rasterfilename)[stat.ST_MTIME]) | def shortDescription(self): file = "%s.%s.%d.%d" % (self.file[string.rindex(self.file, '/') + 1:], self.device, self.dpi, self.band) | 2fde7017415f15a51e685f3c27484bd16bd13d7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1296/2fde7017415f15a51e685f3c27484bd16bd13d7f/gscheck_raster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
3291,
12,
2890,
4672,
585,
273,
2213,
87,
7866,
87,
7866,
72,
7866,
72,
6,
738,
261,
2890,
18,
768,
63,
1080,
18,
86,
1615,
12,
2890,
18,
768,
16,
2023,
13,
397,
404,
30,
648... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3025,
3291,
12,
2890,
4672,
585,
273,
2213,
87,
7866,
87,
7866,
72,
7866,
72,
6,
738,
261,
2890,
18,
768,
63,
1080,
18,
86,
1615,
12,
2890,
18,
768,
16,
2023,
13,
397,
404,
30,
648... |
print dlg.errors, dlg.output | def OnCancelbtnButton(self, event): if not self.finished: self.detach() self.prepareResult() if self.modally: self.EndModal(wxCANCEL) else: self.EndModal(wxOK) | 8a41e3bf82c0c120f6143c7b96d1a2dabbba7ffc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/8a41e3bf82c0c120f6143c7b96d1a2dabbba7ffc/ProcessProgressDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6691,
11898,
3616,
12,
2890,
16,
871,
4672,
309,
486,
365,
18,
13527,
30,
365,
18,
8238,
497,
1435,
365,
18,
9366,
1253,
1435,
309,
365,
18,
1711,
1230,
30,
365,
18,
1638,
20191,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
6691,
11898,
3616,
12,
2890,
16,
871,
4672,
309,
486,
365,
18,
13527,
30,
365,
18,
8238,
497,
1435,
365,
18,
9366,
1253,
1435,
309,
365,
18,
1711,
1230,
30,
365,
18,
1638,
20191,... | |
device=self.get_value(data, "DEVICE") | device=self.get_value(data, "DEVNAME") | def add_usb(self, line): data=line.split('#') print_debug ( "add_usb() data=%s" %data ) device=self.get_value(data, "DEVICE") fstype=self.get_value(data, "ID_FS_TYPE") #device=data[1].split('=')[1] #fstype=data[4] # /dev/sda #if len(device) < 9: if fstype == "": vendor=self.get_value(data, "ID_VENDOR") model=self.get_value(data, "ID_MODEL") #vendor=data[5].split('=')[1] #model=data[6].split('=')[1] # this is a disk, search a partition self.show_notification( _("From terminal %(host)s.\nConnected USB device %(device)s\n%(vendor)s %(model)s" ) \ %{"host":shared.remotehost, "device":device, "vendor":vendor, "model":model } ) return # we have something like /dev/sda1 #fstype=data[4].split('=')[1] if not self.mounter_remote(device, fstype, "--mount"): self.show_notification ( _("Can't mount device %s") %(device) ) return remote_mnt="/mnt/%s" %(device[5:]) local_mount_point = self.get_local_mountpoint(line) label = os.path.basename(local_mount_point) # mount with fuse and ltspfs self.mounter_local(local_mount_point, remote_mnt, device=device, label=label, mode="mount") # launch desktop filemanager self.launch_desktop_filemanager(local_mount_point) self.mounted[device]=local_mount_point print_debug ( "add_usb() self.mounted=%s" %(self.mounted) ) print_debug ( "add_usb() ADD usb, done...") | e062fae2efc2130227b7a2218ed381f3b24530ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13520/e062fae2efc2130227b7a2218ed381f3b24530ac/tcos-devices.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
25525,
12,
2890,
16,
980,
4672,
501,
33,
1369,
18,
4939,
2668,
7,
6134,
1172,
67,
4148,
261,
315,
1289,
67,
25525,
1435,
501,
5095,
87,
6,
738,
892,
262,
225,
2346,
33,
2890... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
25525,
12,
2890,
16,
980,
4672,
501,
33,
1369,
18,
4939,
2668,
7,
6134,
1172,
67,
4148,
261,
315,
1289,
67,
25525,
1435,
501,
5095,
87,
6,
738,
892,
262,
225,
2346,
33,
2890... |
ui.windows.new(ConsoleWindow, None, "console").activate() | windows.new(ConsoleWindow, None, "console").activate() | def onCommandConsole(e): ui.windows.new(ConsoleWindow, None, "console").activate() | c07d8e3003d5c86e34499621445c92034d52baab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/c07d8e3003d5c86e34499621445c92034d52baab/console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
2189,
10215,
12,
73,
4672,
9965,
18,
2704,
12,
10215,
3829,
16,
599,
16,
315,
8698,
20387,
10014,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
2189,
10215,
12,
73,
4672,
9965,
18,
2704,
12,
10215,
3829,
16,
599,
16,
315,
8698,
20387,
10014,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
label.pack(side = TOP, fill = X) | label.pack(side=TOP, fill=X) | def build_tools(self): tframe = self.tframe canvas = self.canvas fr=TFrame(tframe, style='FlatFrame', borderwidth=12) fr.pack(side = TOP, fill = X) label = TLabel(fr, style='FlatLabel') label.pack(side = TOP, fill = X) label = TLabel(tframe, style='HLine') label.pack(side = TOP, fill = X) | 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,
6642,
12,
2890,
4672,
3253,
1474,
273,
365,
18,
88,
3789,
5953,
273,
365,
18,
15424,
225,
3812,
33,
56,
3219,
12,
88,
3789,
16,
2154,
2218,
16384,
3219,
2187,
5795,
2819,
33,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
6642,
12,
2890,
4672,
3253,
1474,
273,
365,
18,
88,
3789,
5953,
273,
365,
18,
15424,
225,
3812,
33,
56,
3219,
12,
88,
3789,
16,
2154,
2218,
16384,
3219,
2187,
5795,
2819,
33,... |
if config.DEBUG: | if config.DEBUG > 1: | def actions(self, item): self.item = item # don't allow this for items on an audio cd, only on the disc itself if item.type == 'audio' and item.parent.type == 'audiocd': return [] | bd5cfad09cc9489cc9e53263495b7ffd8ae27130 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/bd5cfad09cc9489cc9e53263495b7ffd8ae27130/coversearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4209,
12,
2890,
16,
761,
4672,
365,
18,
1726,
273,
761,
468,
2727,
1404,
1699,
333,
364,
1516,
603,
392,
7447,
7976,
16,
1338,
603,
326,
19169,
6174,
309,
761,
18,
723,
422,
296,
11509... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4209,
12,
2890,
16,
761,
4672,
365,
18,
1726,
273,
761,
468,
2727,
1404,
1699,
333,
364,
1516,
603,
392,
7447,
7976,
16,
1338,
603,
326,
19169,
6174,
309,
761,
18,
723,
422,
296,
11509... |
This transform requires a startnode, which which contains generation | This transform requires a startnode, which contains generation | def update_section_numbers(self, node, prefix=(), depth=0): depth += 1 if prefix: sectnum = 1 else: sectnum = self.startvalue for child in node: if isinstance(child, nodes.section): numbers = prefix + (str(sectnum),) title = child[0] # Use for spacing: generated = nodes.generated( '', (self.prefix + '.'.join(numbers) + self.suffix + u'\u00a0' * 3), classes=['sectnum']) title.insert(0, generated) title['auto'] = 1 if depth < self.maxdepth: self.update_section_numbers(child, numbers, depth) sectnum += 1 | 674a1b132a73f8b15454e722d1557aa393ad7dd3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8194/674a1b132a73f8b15454e722d1557aa393ad7dd3/parts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
33,
9334,
3598,
33,
20,
4672,
3598,
1011,
404,
309,
1633,
30,
29140,
2107,
273,
404,
469,
30,
29140,
2107,
273,
365,
18,
1937,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
33,
9334,
3598,
33,
20,
4672,
3598,
1011,
404,
309,
1633,
30,
29140,
2107,
273,
404,
469,
30,
29140,
2107,
273,
365,
18,
1937,
... |
def getLog(*args): return apply(_quickfix.Acceptor_getLog, args) | def getLog(*args): return _quickfix.Acceptor_getLog(*args) | def getLog(*args): return apply(_quickfix.Acceptor_getLog, args) | 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,
9189,
30857,
1968,
4672,
327,
2230,
24899,
19525,
904,
18,
5933,
280,
67,
588,
1343,
16,
833,
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,
... | [
1,
1,
1,
1,
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,
9189,
30857,
1968,
4672,
327,
2230,
24899,
19525,
904,
18,
5933,
280,
67,
588,
1343,
16,
833,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return int(user) | return int(Transaction().user) | def default_act_to(self): return int(user) | 32e306abcab47d1bfc1f2e9586f8fdbee7db533a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/32e306abcab47d1bfc1f2e9586f8fdbee7db533a/request.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
621,
67,
869,
12,
2890,
4672,
327,
509,
12,
1355,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
621,
67,
869,
12,
2890,
4672,
327,
509,
12,
1355,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if status.jobStatus in ['defined','unknown','assigned','waiting','activated','sent','finished']: | bjstats = [bj2.status for bj2 in job.backend.buildjobs] new_stat = None for s in ['defined','unknown','assigned','waiting','activated','sent','finished', 'starting','running','holding','transferring', 'failed', 'cancelled']: if s in bjstats: new_stat = s break if new_stat in ['defined','unknown','assigned','waiting','activated','sent','finished']: | def master_updateMonitoringInformation(jobs): '''Monitor jobs''' from pandatools import Client | 9581154059ad0ff17c1a9158bb75bec21a836f87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/9581154059ad0ff17c1a9158bb75bec21a836f87/Panda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4171,
67,
2725,
18410,
5369,
12,
10088,
4672,
9163,
7187,
6550,
26418,
628,
293,
464,
270,
8192,
1930,
2445,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
4171,
67,
2725,
18410,
5369,
12,
10088,
4672,
9163,
7187,
6550,
26418,
628,
293,
464,
270,
8192,
1930,
2445,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
docid = list(r)[0] | try: docid = list(r)[0] except IndexError: docid = 'none' | def setup(self, environ): from medin.dws import RESULT_SIMPLE from medin.terms import VocabError areas = get_areas(environ) q = get_query(environ) errors = q.verify() if errors: for error in errors: msg_error(environ, error) | 516eed5b16aa60789da33569c29d306a7465f0ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12122/516eed5b16aa60789da33569c29d306a7465f0ec/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
5473,
4672,
628,
6735,
267,
18,
72,
4749,
1930,
17210,
67,
31669,
900,
628,
6735,
267,
18,
10112,
1930,
776,
6780,
668,
225,
15586,
273,
336,
67,
21766,
12,
28684,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
5473,
4672,
628,
6735,
267,
18,
72,
4749,
1930,
17210,
67,
31669,
900,
628,
6735,
267,
18,
10112,
1930,
776,
6780,
668,
225,
15586,
273,
336,
67,
21766,
12,
28684,
... |
b = b.set_selected(sel, set_max) sel = b < b_min | b = b.set_selected(sel, params.filter.b_iso_max) sel = b < params.filter.b_iso_min | def reset_adps(fmodels, selection, b_min, b_max, set_min, set_max): xrs = fmodels.fmodel_xray().xray_structure b = xrs.extract_u_iso_or_u_equiv()*adptbx.u_as_b(1.) sel = b > b_max sel &= selection b = b.set_selected(sel, set_max) sel = b < b_min sel &= selection b = b.set_selected(sel, set_min) xrs = xrs.set_b_iso(values=b) fmodels.update_xray_structure(xray_structure = xrs, update_f_calc=True, update_f_mask=False) | c83e5aaf0a98a33f9afd742b631944b224553620 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/c83e5aaf0a98a33f9afd742b631944b224553620/grow_density.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
361,
1121,
12,
74,
7665,
16,
4421,
16,
324,
67,
1154,
16,
324,
67,
1896,
16,
444,
67,
1154,
16,
444,
67,
1896,
4672,
619,
5453,
273,
284,
7665,
18,
74,
2284,
67,
92,
435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2715,
67,
361,
1121,
12,
74,
7665,
16,
4421,
16,
324,
67,
1154,
16,
324,
67,
1896,
16,
444,
67,
1154,
16,
444,
67,
1896,
4672,
619,
5453,
273,
284,
7665,
18,
74,
2284,
67,
92,
435,... |
Corkscrew.draw(self) | Corkscrew.draw(self, color = interior_color) | def draw(self, **mods): radius, axis, turn, n, color = self.args color0 = mods.get('color',color)##kluge ##e todo: should be more general; maybe should get "state ref" (to show & edit) as arg, too? if color != color0: if debug_color_override: print "color override in %r from %r to %r" % (self, color, color0) # seems to happen to much and then get stuck... ###@@@ else: if debug_color_override: print "no color override in %r for %r" % (self, color) color = color0 offset = axis * 2 halfoffset = offset / 2.0 interior_color = ave_colors(0.8,color, white) ### self.args = list(self.args) # slow! self.args[-1] = interior_color #### kluge! and/or misnamed, since used for both sides i think if 1: # draw the ribbon-edges; looks slightly better this way in some ways, worse in other ways -- # basically, looks good on egdes that face you, bad on edges that face away (if the ribbons had actual thickness) # (guess: some kluge with lighting and normals could fix this) Corkscrew.draw(self) if 0: glTranslate(offset, 0,0) Corkscrew.draw(self) ### maybe we should make the two edges look different, since they are (major vs minor groove) glTranslate(-offset, 0,0) ## glColor3fv(interior_color) | 04ed8f2bd084f471db071e497663a58ef4b1f8b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/04ed8f2bd084f471db071e497663a58ef4b1f8b9/testdraw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
16,
2826,
22760,
4672,
5725,
16,
2654,
16,
7005,
16,
290,
16,
2036,
273,
365,
18,
1968,
2036,
20,
273,
15546,
18,
588,
2668,
3266,
2187,
3266,
13,
1189,
16391,
21627,
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,
3724,
12,
2890,
16,
2826,
22760,
4672,
5725,
16,
2654,
16,
7005,
16,
290,
16,
2036,
273,
365,
18,
1968,
2036,
20,
273,
15546,
18,
588,
2668,
3266,
2187,
3266,
13,
1189,
16391,
21627,
7... |
register.filter('taxed_discount_line_total', discount_line_total) | register.filter('taxed_discount_line_total', taxed_discount_line_total) | def taxed_discount_line_total(cartitem, discount): """Returns the discounted line total for this cart item with taxes included.""" price = untaxed_discount_line_total(cartitem, discount) taxer = satchmo_tax._get_taxprocessor() price = price + taxer.by_price(cartitem.product.taxClass, price) return price | e364b235c0cdf280ff4108f594d51279fc8d056a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13656/e364b235c0cdf280ff4108f594d51279fc8d056a/satchmo_discounts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5320,
329,
67,
23650,
67,
1369,
67,
4963,
12,
11848,
1726,
16,
12137,
4672,
3536,
1356,
326,
12137,
329,
980,
2078,
364,
333,
7035,
761,
598,
5320,
281,
5849,
12123,
6205,
273,
640,
8066... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5320,
329,
67,
23650,
67,
1369,
67,
4963,
12,
11848,
1726,
16,
12137,
4672,
3536,
1356,
326,
12137,
329,
980,
2078,
364,
333,
7035,
761,
598,
5320,
281,
5849,
12123,
6205,
273,
640,
8066... |
expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] print(self.getDebugPrefix() + " * Expression changed: " + expr) | print(self.getDebugPrefix() + " * Expression change denied for operator: [" + op.text + "]") elif op.type == Operator.UNARY and (lastOccurence <= 0 or (isVarChar(expr[lastOccurence - 1]) == False and expr[lastOccurence - 1] != ')')): end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or ((expr[end] == '(' or expr[end] == '[') and end == lastOccurence + 1)): if (expr[end] == '(' or expr[end] == '[') and end == lastOccurence + 1: bracketCounter = 1 else: bracketCounter = 0 while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(' or expr[end] == '[': bracketCounter += 1 elif expr[end] == ')' or expr[end] == ']': bracketCounter -= 1 end += 1 operandRight = expr[lastOccurence+op.textLen:end]; start = lastOccurence - 1 if (start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')'): expr = expr[:lastOccurence] + "(" + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] lastOccurence += 1 else: pass | def buildCleanExpr(self, expr): self.recursionLevel += 1 expr = expr.replace(" ", "") print(self.getDebugPrefix() + " * buildCleanExpr: " + expr) # For every operator level for opLevel in self.operatorLevels: # For every operator in the current level for op in opLevel.operators: lastOccurence = expr.find(op.text) while lastOccurence is not -1: if lastOccurence == len(expr) - 1: raise CompilerException("Missing operand") if isVarChar(expr[lastOccurence + len(op.text)]) or expr[lastOccurence + len(op.text)] == '(' or op.text == '(' or expr[lastOccurence + len(op.text)] == '[' or op.text == '[': if op.type == Operator.BINARY: # Left operand start = lastOccurence - 1 while start >= 0 and (isVarChar(expr[start]) or ((expr[start] == ')' or expr[start] == ']') and start == lastOccurence - 1)): if expr[start] == ')' or expr[start] == ']': bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and start > 0: start -= 1 if expr[start] == ')' or expr[start] == ']': bracketCounter += 1 elif expr[start] == '(' or expr[start] == '[': bracketCounter -= 1 start -= 1 operandLeft = expr[start+1:lastOccurence]; # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or (expr[end] == '(' and end == lastOccurence + 1) or (expr[end] == '[' and end == lastOccurence + 1)): if op.text == '[' or op.text == '(' or (expr[end] == '(' and end == lastOccurence + 1) or (expr[end] == '[' and end == lastOccurence + 1): bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr): if expr[end] == '(' or expr[end] == '[': bracketCounter += 1 print(bracketCounter) elif expr[end] == ')' or expr[end] == ']': bracketCounter -= 1 print(bracketCounter) if bracketCounter == 1 and op.text != '[' and op.text != '(': end -= 1 bracketCounter = 0 elif bracketCounter == 0: # and expr[lastOccurence + op.textLen] != '(' and expr[lastOccurence + op.textLen] != '[': end -= 2 end += 1 end += 1 operandRight = expr[lastOccurence + op.textLen:end]; print(self.getDebugPrefix() + " * buildCleanExpr.operators: " + operandLeft + " [" + op.text + "] " + operandRight) # Bind #=================================================== # #======================================================= # print(expr) # if start >= 0: # print("START[" + str(start) + "]: " + expr[start]) # else: # print("START: " + "OUT OF STRING") # # if end < len(expr): # print("END[" + str(end) + "]: " + expr[end]) # else: # print("END: " + "OUT OF STRING") # #======================================================= #=================================================== if operandLeft and (operandRight and ((start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')')) or op.text == "("): if op.text == "(": newOpText = "#" expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + ")" + newOpText + "(" + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight) + 1:] elif op.text == "[": newOpText = "@" expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + ")" + newOpText + "(" + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight) + 1:] else: expr = expr[:lastOccurence - len(operandLeft)] + "(" + operandLeft + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] print(self.getDebugPrefix() + " * Expression changed: " + expr) else: print(self.getDebugPrefix() + " * Expression change denied for operator: [" + op.text + "]") elif op.type == Operator.UNARY and (lastOccurence <= 0 or (isVarChar(expr[lastOccurence - 1]) == False and expr[lastOccurence - 1] != ')')): #print("Unary check for operator [" + op.text + "]") #print(" Unary.lastOccurence: " + str(lastOccurence)) #print(" Unary.expr[lastOccurence - 1]: " + expr[lastOccurence - 1]) #print(" Unary.isVarChar(expr[lastOccurence - 1]): " + str(isVarChar(expr[lastOccurence - 1]))) # Right operand end = lastOccurence + op.textLen while end < len(expr) and (isVarChar(expr[end]) or ((expr[end] == '(' or expr[end] == '[') and end == lastOccurence + 1)): if (expr[end] == '(' or expr[end] == '[') and end == lastOccurence + 1: bracketCounter = 1 else: bracketCounter = 0 # Move to last part of the bracket while bracketCounter > 0 and end < len(expr)-1: end += 1 if expr[end] == '(' or expr[end] == '[': bracketCounter += 1 elif expr[end] == ')' or expr[end] == ']': bracketCounter -= 1 end += 1 operandRight = expr[lastOccurence+op.textLen:end]; #print("[" + op.text + "] " + operandRight) start = lastOccurence - 1 if (start < 0 or expr[start] != '(') or (end >= len(expr) or expr[end] != ')'): expr = expr[:lastOccurence] + "(" + op.text + operandRight + ")" + expr[lastOccurence + len(op.text) + len(operandRight):] lastOccurence += 1 #print("EX.UNARY: " + expr) else: pass #print("EX.UNARY expression change denied: [" + op.text + "]") else: # If a binary version does not exist it means the operator has been used incorrectly if not self.similarOperatorExists(op): raise CompilerException("Syntax error concerning the unary operator [" + op.text + "]") elif expr[lastOccurence + len(op.text)] != '(' and expr[lastOccurence + len(op.text)] != '[': if self.similarOperatorExists(op): pass else: raise CompilerException("Operator [" + op.text + "] expects a valid expression (encountered '" + expr[lastOccurence + len(op.text)] + "')") lastOccurence = expr.find(op.text, lastOccurence + len(op.text)) self.recursionLevel -= 1 return expr | 59735d35e5f2e37f81792e01c59207ab9f2e0cc2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14498/59735d35e5f2e37f81792e01c59207ab9f2e0cc2/ExpressionParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
7605,
4742,
12,
2890,
16,
3065,
4672,
365,
18,
31347,
2355,
1011,
404,
225,
3065,
273,
3065,
18,
2079,
2932,
3104,
1408,
13,
225,
1172,
12,
2890,
18,
588,
2829,
2244,
1435,
397,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
7605,
4742,
12,
2890,
16,
3065,
4672,
365,
18,
31347,
2355,
1011,
404,
225,
3065,
273,
3065,
18,
2079,
2932,
3104,
1408,
13,
225,
1172,
12,
2890,
18,
588,
2829,
2244,
1435,
397,
... |
aStartTime= aLogger.getStartTime() aEndTime = aLogger.getEndTime() | aStartTime = aLoggerStartTime anEndTime = aLoggerEndTime | def saveLoggerData( self, aFullPNString='', aStartTime=-1, aEndTime=-1, aInterval=-1, aSaveDirectory='./Data'): | ea4e8e2718af60beede467ccee0cb1bdb0f1e349 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/ea4e8e2718af60beede467ccee0cb1bdb0f1e349/Session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
3328,
751,
12,
365,
16,
279,
5080,
15124,
780,
2218,
2187,
279,
13649,
29711,
21,
16,
279,
25255,
29711,
21,
16,
279,
4006,
29711,
21,
16,
279,
4755,
2853,
2218,
18,
19,
751,
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,
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,
1923,
3328,
751,
12,
365,
16,
279,
5080,
15124,
780,
2218,
2187,
279,
13649,
29711,
21,
16,
279,
25255,
29711,
21,
16,
279,
4006,
29711,
21,
16,
279,
4755,
2853,
2218,
18,
19,
751,
11,... |
print "barrier: slave=" + self.hostid + " master=" + master | self.report("selected as slave, master=" + master) | def slave(self): # Clip out the master host in the barrier, remove any # trailing local identifier following a #. This allows # multiple members per host which is particularly helpful # in testing. master = (self.members[0].split('#'))[0] | bb655f3af134dd0fb185950c28aa4391201eb99d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/bb655f3af134dd0fb185950c28aa4391201eb99d/barrier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11735,
12,
2890,
4672,
468,
385,
3169,
596,
326,
4171,
1479,
316,
326,
24651,
16,
1206,
1281,
468,
7341,
1191,
2756,
3751,
279,
468,
18,
225,
1220,
5360,
468,
3229,
4833,
1534,
1479,
149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11735,
12,
2890,
4672,
468,
385,
3169,
596,
326,
4171,
1479,
316,
326,
24651,
16,
1206,
1281,
468,
7341,
1191,
2756,
3751,
279,
468,
18,
225,
1220,
5360,
468,
3229,
4833,
1534,
1479,
149... |
if is_exists: | if is_exists: | def import_cal(self, cr, uid, data, context={}): file_content = base64.decodestring(data) event_obj = self.pool.get('basic.calendar.event') event_obj.__attribute__.update(self.__attribute__) vals = event_obj.import_ical(cr, uid, file_content) ids = [] for val in vals: is_exists = common.uid2openobjectid(cr, val['id'], self._name) if val.has_key('create_date'): val.pop('create_date') val['caldav_url'] = context.get('url') or '' val.pop('id') if is_exists: self.write(cr, uid, [is_exists], val) ids.append(is_exists) else: case_id = self.create(cr, uid, val) ids.append(case_id) return ids | 75258015cae6ae0d493e7eb6204a16eafed73cd9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/75258015cae6ae0d493e7eb6204a16eafed73cd9/crm_meeting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
585,
67,
1745,
273,
1026,
1105,
18,
4924,
1145,
371,
12,
892,
13,
871,
67,
2603,
273,
365,
18,
6011,
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,
1930,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
12938,
4672,
585,
67,
1745,
273,
1026,
1105,
18,
4924,
1145,
371,
12,
892,
13,
871,
67,
2603,
273,
365,
18,
6011,
18,
... |
def __init__( self, message="adasd", path=None, stdout=True, process=lambda _:_ ): Log.__init__(self, path, stdout) | def __init__( self, message, path=None, stdout=True, process=lambda _:_, overwrite=False ): Log.__init__(self, path, stdout, overwrite) | def __init__( self, message="adasd", path=None, stdout=True, process=lambda _:_ ): Log.__init__(self, path, stdout) self.message = message self.processor = process | 7ed6110d37a914d582e30fbe68bf4f3906cfd610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13002/7ed6110d37a914d582e30fbe68bf4f3906cfd610/watchdog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
883,
16,
589,
33,
7036,
16,
3909,
33,
5510,
16,
1207,
33,
14661,
389,
30,
67,
16,
6156,
33,
8381,
262,
30,
1827,
16186,
2738,
972,
12,
2890,
16,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
883,
16,
589,
33,
7036,
16,
3909,
33,
5510,
16,
1207,
33,
14661,
389,
30,
67,
16,
6156,
33,
8381,
262,
30,
1827,
16186,
2738,
972,
12,
2890,
16,
589,
... |
self.keywords = [ _KeywordFactory(kw) for kw in kwdata.keywords ] | self.keywords = Keywords(kwdata.keywords) | def __init__(self, kwdata): self.vars = kwdata.vars self.items = kwdata.items self.range = kwdata.range BaseKeyword.__init__(self, kwdata.name, type='for') self.keywords = [ _KeywordFactory(kw) for kw in kwdata.keywords ] | 0ec40629cd09b4a0b3bda8e23e0d6bc4cd28e4cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/0ec40629cd09b4a0b3bda8e23e0d6bc4cd28e4cb/keywords.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5323,
892,
4672,
365,
18,
4699,
273,
5323,
892,
18,
4699,
365,
18,
3319,
273,
5323,
892,
18,
3319,
365,
18,
3676,
273,
5323,
892,
18,
3676,
3360,
8736,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5323,
892,
4672,
365,
18,
4699,
273,
5323,
892,
18,
4699,
365,
18,
3319,
273,
5323,
892,
18,
3319,
365,
18,
3676,
273,
5323,
892,
18,
3676,
3360,
8736,
... |
if installedcmp(mypkgdep[2:])<=0: return 1 | mycatpkg=catpkgsplit(mypkgdep[2:]) mykey=mycatpkg[0]+"/"+mycatpkg[1] if not installcache.has_key(mykey): return 0 for x in installcache[mykey]: if pkgcmp(x[1][1:],mycatpkg[1:])>=0: return 1 | def dep_depreduce(mypkgdep): if mypkgdep[0]=="!": if isinstalled(mypkgdep[1:]): return 0 else: return 1 elif mypkgdep[0]=="=": if isspecific(mypkgdep[1:]): if isinstalled(mypkgdep[1:]): return 1 else: return 0 else: return None elif mypkgdep[0:2]==">=": if not isspecific(mypkgdep[2:]): return None if isinstalled(getgeneral(mypkgdep[2:])): if installedcmp(mypkgdep[2:])<=0: return 1 return 0 elif mypkgdep[0:2]=="<=": if not isspecific(mypkgdep[2:]): return None if isinstalled(getgeneral(mypkgdep[2:])): if installedcmp(mypkgdep[2:])>=0: return 1 return 0 elif mypkgdep[0]=="<": if not isspecific(mypkgdep[1:]): return None if isinstalled(getgeneral(mypkgdep[1:])): if installedcmp(mypkgdep[1:])>0: return 1 return 0 elif mypkgdep[0]==">": if not isspecific(mypkgdep[1:]): return None if isinstalled(getgeneral(mypkgdep[1:])): if installedcmp(mypkgdep[1:])<0: return 1 return 0 if not isspecific(mypkgdep): if isinstalled(mypkgdep): return 1 else: return 0 else: return None | 89268f330fdfe435c9ad2ced21f6552bdacff1f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/89268f330fdfe435c9ad2ced21f6552bdacff1f2/portage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5993,
67,
323,
6510,
3965,
12,
81,
879,
14931,
15037,
4672,
309,
312,
879,
14931,
15037,
63,
20,
65,
31713,
4442,
30,
309,
353,
13435,
12,
81,
879,
14931,
15037,
63,
21,
26894,
4672,
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,
5993,
67,
323,
6510,
3965,
12,
81,
879,
14931,
15037,
4672,
309,
312,
879,
14931,
15037,
63,
20,
65,
31713,
4442,
30,
309,
353,
13435,
12,
81,
879,
14931,
15037,
63,
21,
26894,
4672,
3... |
cmd = "%s %s %s.txt" % (conv_program, tmp_name, tmp_name) | cmd = "%s -enc UTF-8 %s %s.txt" % (conv_program, tmp_name, tmp_name) | def get_words_from_fulltext(url_direct_or_indirect, separators="[^\w]", split=string.split, force_file_extension=None): """Returns all the words contained in the document specified by URL_DIRECT_OR_INDIRECT with the words being split by SEPARATORS. If FORCE_FILE_EXTENSION is set (e.g. to "pdf", then treat URL_DIRECT_OR_INDIRECT as a PDF file. (This is interesting to index Indico for example.) Note also that URL_DIRECT_OR_INDIRECT may be either a direct URL to the fulltext file or an URL to a setlink-like page body that presents the links to be indexed. In the latter case the URL_DIRECT_OR_INDIRECT is parsed to extract actual direct URLs to fulltext documents, for all knows file extensions as specified by global conv_programs config variable. """ if cfg_bibindex_fulltext_index_local_files_only and string.find(url_direct_or_indirect, weburl) < 0: return [] if options["verbose"] >= 2: write_message("... reading fulltext files from %s started" % url_direct_or_indirect) fulltext_urls = None if not force_file_extension: url_direct = None fulltext_urls = None # check for direct link in url url_direct_or_indirect_ext = lower(split(url_direct_or_indirect,".")[-1]) if url_direct_or_indirect_ext in conv_programs.keys(): fulltext_urls = [(url_direct_or_indirect_ext,url_direct_or_indirect)] # Indirect url. Try to fetch the real fulltext(s) if not fulltext_urls: # read "setlink" data try: htmlpagebody = urllib.urlopen(url_direct_or_indirect).read() except: sys.stderr.write("Error: Cannot read %s.\n" % url_direct_or_indirect) return [] fulltext_urls = get_fulltext_urls_from_html_page(htmlpagebody) if options["verbose"] >= 9: write_message("... fulltext_urls = %s" % fulltext_urls) else: fulltext_urls = [[force_file_extension, url_direct_or_indirect]] words = {} # process as many urls as they were found: for (ext,url_direct) in fulltext_urls: if options["verbose"] >= 2: write_message(".... processing %s from %s started" % (ext,url_direct)) # sanity check: if not url_direct: break; # read fulltext file: try: url = urllib.urlopen(url_direct) except: sys.stderr.write("Error: Cannot read %s.\n" % url_direct) break # try other fulltext files... tmp_name = tempfile.mktemp('invenio.tmp') tmp_fd = open(tmp_name, "w") data_chunk = url.read(8*1024) while data_chunk: tmp_fd.write(data_chunk) data_chunk = url.read(8*1024) tmp_fd.close() # try all available conversion programs according to their order: bingo = 0 for conv_program in conv_programs[ext]: if os.path.exists(conv_program): # intelligence on how to run various conversion programs: cmd = "" # wil keep command to run bingo = 0 # had we success? if os.path.basename(conv_program) == "pdftotext": cmd = "%s %s %s.txt" % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "pstotext": if ext == "ps.gz": # is there gzip available? if os.path.exists(conv_programs_helpers["gz"]): cmd = "%s -cd %s | %s > %s.txt" \ % (conv_programs_helpers["gz"], tmp_name, conv_program, tmp_name) else: cmd = "%s %s > %s.txt" \ % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "ps2ascii": if ext == "ps.gz": # is there gzip available? if os.path.exists(conv_programs_helpers["gz"]): cmd = "%s -cd %s | %s > %s.txt"\ % (conv_programs_helpers["gz"], tmp_name, conv_program, tmp_name) else: cmd = "%s %s %s.txt" \ % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "antiword": cmd = "%s %s > %s.txt" % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "catdoc": cmd = "%s %s > %s.txt" % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "wvText": cmd = "%s %s %s.txt" % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "ppthtml": # is there html2text available? if os.path.exists(conv_programs_helpers["html"]): cmd = "%s %s | %s > %s.txt"\ % (conv_program, tmp_name, conv_programs_helpers["html"], tmp_name) else: cmd = "%s %s > %s.txt" \ % (conv_program, tmp_name, tmp_name) elif os.path.basename(conv_program) == "xlhtml": # is there html2text available? if os.path.exists(conv_programs_helpers["html"]): cmd = "%s %s | %s > %s.txt" % \ (conv_program, tmp_name, conv_programs_helpers["html"], tmp_name) else: cmd = "%s %s > %s.txt" % \ (conv_program, tmp_name, tmp_name) else: sys.stderr.write("Error: Do not know how to handle %s conversion program.\n" % conv_program) # try to run it: try: if options["verbose"] >= 9: write_message("..... launching %s" % cmd) errcode = os.system(cmd) if errcode == 0 and os.path.exists("%s.txt" % tmp_name): bingo = 1 break # bingo! else: write_message("Error while running %s for %s.\n" % (cmd, url_direct), sys.stderr) except: write_message("Error running %s for %s.\n" % (cmd, url_direct), sys.stderr) # were we successful? if bingo: tmp_name_txt_file = open("%s.txt" % tmp_name) for phrase in tmp_name_txt_file.xreadlines(): for word in get_words_from_phrase(phrase): if not words.has_key(word): words[word] = 1; tmp_name_txt_file.close() else: if options["verbose"]: write_message("No conversion success for %s.\n" % (url_direct), sys.stderr) # delete temp files (they might not exist): try: os.unlink(tmp_name) os.unlink(tmp_name + ".txt") except StandardError: write_message("Error: Could not delete file. It didn't exist", sys.stderr) if options["verbose"] >= 2: write_message(".... processing %s from %s ended" % (ext,url_direct)) if options["verbose"] >= 2: write_message("... reading fulltext files from %s ended" % url_direct_or_indirect) return words.keys() | 31f485a1e848b595b5b0e3d660ea0d7535f1852e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/31f485a1e848b595b5b0e3d660ea0d7535f1852e/bibindex_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3753,
67,
2080,
67,
2854,
955,
12,
718,
67,
7205,
67,
280,
67,
728,
867,
16,
14815,
1546,
15441,
91,
65,
3113,
1416,
33,
1080,
18,
4939,
16,
2944,
67,
768,
67,
6447,
33,
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,
336,
67,
3753,
67,
2080,
67,
2854,
955,
12,
718,
67,
7205,
67,
280,
67,
728,
867,
16,
14815,
1546,
15441,
91,
65,
3113,
1416,
33,
1080,
18,
4939,
16,
2944,
67,
768,
67,
6447,
33,
7... |
self.userNicknameCache.clear() | self.userNicknameCache.remove(cacheKey) | def clear_nicknames(self): uq = UserQuery(self, self.zsqlalchemy) uq.clear_nicknames() m = 'clear_nicknames: Cleared nicknames from %s (%s)' %\ (self.getProperty('fn', ''), self.getId()) log.info(m) | 70331476aa882559fb87159b4a6dbe3e5544a90c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6270/70331476aa882559fb87159b4a6dbe3e5544a90c/CustomUser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
17091,
1973,
12,
2890,
4672,
582,
85,
273,
2177,
1138,
12,
2890,
16,
365,
18,
94,
4669,
24182,
13,
582,
85,
18,
8507,
67,
17091,
1973,
1435,
312,
273,
296,
8507,
67,
17091,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
17091,
1973,
12,
2890,
4672,
582,
85,
273,
2177,
1138,
12,
2890,
16,
365,
18,
94,
4669,
24182,
13,
582,
85,
18,
8507,
67,
17091,
1973,
1435,
312,
273,
296,
8507,
67,
17091,
... |
rev_date = "$Date: 2003/12/22 10:35:51 $"[7:-2] | rev_date = "$Date: 2004/01/15 11:05:20 $"[7:-2] | def getGRUFVersion(self,): """ getGRUFVersion(self,) => Return human-readable GRUF version as a string. """ rev_date = "$Date: 2003/12/22 10:35:51 $"[7:-2] return "%s / Revised %s" % (version__, rev_date) | faa5917fe0f92a290610325433ca7782f15b4b42 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/faa5917fe0f92a290610325433ca7782f15b4b42/GroupUserFolder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
6997,
57,
42,
1444,
12,
2890,
16,
4672,
3536,
336,
6997,
57,
42,
1444,
12,
2890,
16,
13,
516,
2000,
8672,
17,
11018,
15228,
57,
42,
1177,
487,
279,
533,
18,
3536,
5588,
67,
712,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6997,
57,
42,
1444,
12,
2890,
16,
4672,
3536,
336,
6997,
57,
42,
1444,
12,
2890,
16,
13,
516,
2000,
8672,
17,
11018,
15228,
57,
42,
1177,
487,
279,
533,
18,
3536,
5588,
67,
712,... |
if active is None: | if active: self.active = 1 elif active is None: self.active = None else: | def set_active(self, active): """ Sets the segment to active if active is True, to inactive if active if False, and undefined if active is None. """ if active is None: self.active = 0 elif active: self.active = 1 else: self.active = -1 return self | 8913cf1acce296caf6c2f3b1a7bcbc59402f3965 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3589/8913cf1acce296caf6c2f3b1a7bcbc59402f3965/lsctables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3535,
12,
2890,
16,
2695,
4672,
3536,
11511,
326,
3267,
358,
2695,
309,
2695,
353,
1053,
16,
358,
16838,
309,
2695,
309,
1083,
16,
471,
3109,
309,
2695,
353,
599,
18,
3536,
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,
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,
3535,
12,
2890,
16,
2695,
4672,
3536,
11511,
326,
3267,
358,
2695,
309,
2695,
353,
1053,
16,
358,
16838,
309,
2695,
309,
1083,
16,
471,
3109,
309,
2695,
353,
599,
18,
3536,
30... |
def usage(): | if not cliParams.releasesToBuild: | def usage(): Script.showHelp() exit( 2 ) | dd3f705359d354a930e4bae539baa68051aa2d10 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/dd3f705359d354a930e4bae539baa68051aa2d10/dirac-distribution.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
486,
4942,
1370,
18,
28416,
774,
3116,
30,
7739,
18,
4500,
6696,
1435,
2427,
12,
576,
262,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
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,
309,
486,
4942,
1370,
18,
28416,
774,
3116,
30,
7739,
18,
4500,
6696,
1435,
2427,
12,
576,
262,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
cmd = args.pop(0) | self.cmdname = cmd = args.pop(0) | def _checkvar(m): if int(m.groups()[0]) <= len(args): return m.group() else: return '' | 1a158ce063202ed4bb73c7165f71b2f8c5a090fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/1a158ce063202ed4bb73c7165f71b2f8c5a090fa/dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1401,
12,
81,
4672,
309,
509,
12,
81,
18,
4650,
1435,
63,
20,
5717,
1648,
562,
12,
1968,
4672,
327,
312,
18,
1655,
1435,
469,
30,
327,
875,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1401,
12,
81,
4672,
309,
509,
12,
81,
18,
4650,
1435,
63,
20,
5717,
1648,
562,
12,
1968,
4672,
327,
312,
18,
1655,
1435,
469,
30,
327,
875,
2,
-100,
-100,
-100,
-100,
-100... |
realhost = None | realhost = None | def open_http(self, url, data=None): import httplib if type(url) is type(""): host, selector = splithost(url) user_passwd, host = splituser(host) realhost = host else: host, selector = url urltype, rest = splittype(selector) user_passwd = None if string.lower(urltype) != 'http': realhost = None else: realhost, rest = splithost(rest) user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) #print "proxy via http:", host, selector if not host: raise IOError, ('http error', 'no host given') if user_passwd: import base64 auth = string.strip(base64.encodestring(user_passwd)) else: auth = None h = httplib.HTTP(host) if data is not None: h.putrequest('POST', selector) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', selector) if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) for args in self.addheaders: apply(h.putheader, args) h.endheaders() if data is not None: h.send(data + '\r\n') errcode, errmsg, headers = h.getreply() fp = h.getfile() if errcode == 200: return addinfourl(fp, headers, "http:" + url) else: return self.http_error(url, fp, errcode, errmsg, headers) | 7e7ca0ba1753f9088a9b2afb3351a02127337974 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7e7ca0ba1753f9088a9b2afb3351a02127337974/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2505,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
1930,
15851,
6673,
309,
618,
12,
718,
13,
353,
618,
2932,
6,
4672,
1479,
16,
3451,
273,
6121,
483,
669,
12,
718,
13,
729,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
67,
2505,
12,
2890,
16,
880,
16,
501,
33,
7036,
4672,
1930,
15851,
6673,
309,
618,
12,
718,
13,
353,
618,
2932,
6,
4672,
1479,
16,
3451,
273,
6121,
483,
669,
12,
718,
13,
729,
... |
si = Numeric.sign(xm-xf) + ((xm-xf)==0) | si = Num.sign(xm-xf) + ((xm-xf)==0) | def fminbound(func, x1, x2, args=(), xtol=1e-5, maxfun=500, full_output=0, disp=1): """Bounded minimization for scalar functions. Description: Finds a local minimizer of the scalar function func in the interval x1 < xopt < x2 using Brent's method. (See brent for auto-bracketing). Inputs: func -- the function to be minimized (must accept scalar input and return scalar output). x1, x2 -- the optimization bounds. args -- extra arguments to pass to function. xtol -- the convergence tolerance. maxfun -- maximum function evaluations. full_output -- Non-zero to return optional outputs. disp -- Non-zero to print messages. 0 : no message printing. 1 : non-convergence notification messages only. 2 : print a message on convergence too. 3 : print iteration results. Outputs: (xopt, {fval, ierr, numfunc}) xopt -- The minimizer of the function over the interval. fval -- The function value at the minimum point. ierr -- An error flag (0 if converged, 1 if maximum number of function calls reached). numfunc -- The number of function calls. """ if x1 > x2: raise ValueError, "The lower bound exceeds the upper bound." flag = 0 header = ' Func-count x f(x) Procedure' step=' initial' sqrt_eps = sqrt(2.2e-16) golden_mean = 0.5*(3.0-sqrt(5.0)) a, b = x1, x2 fulc = a + golden_mean*(b-a) nfc, xf = fulc, fulc rat = e = 0.0 x = xf fx = func(x,*args) num = 1 fmin_data = (1, xf, fx) ffulc = fnfc = fx xm = 0.5*(a+b) tol1 = sqrt_eps*abs(xf) + xtol / 3.0 tol2 = 2.0*tol1 if disp > 2: print (" ") print (header) print "%5.0f %12.6g %12.6g %s" % (fmin_data + (step,)) while ( abs(xf-xm) > (tol2 - 0.5*(b-a)) ): golden = 1 # Check for parabolic fit if abs(e) > tol1: golden = 0 r = (xf-nfc)*(fx-ffulc) q = (xf-fulc)*(fx-fnfc) p = (xf-fulc)*q - (xf-nfc)*r q = 2.0*(q-r) if q > 0.0: p = -p q = abs(q) r = e e = rat # Check for acceptability of parabola if ( (abs(p) < abs(0.5*q*r)) and (p > q*(a-xf)) and (p < q*(b-xf))): rat = (p+0.0) / q; x = xf + rat step = ' parabolic' if ((x-a) < tol2) or ((b-x) < tol2): si = Numeric.sign(xm-xf) + ((xm-xf)==0) rat = tol1*si else: # do a golden section step golden = 1 if golden: # Do a golden-section step if xf >= xm: e=a-xf else: e=b-xf rat = golden_mean*e step = ' golden' si = Numeric.sign(rat) + (rat == 0) x = xf + si*max([abs(rat), tol1]) fu = func(x,*args) num += 1 fmin_data = (num, x, fu) if disp > 2: print "%5.0f %12.6g %12.6g %s" % (fmin_data + (step,)) if fu <= fx: if x >= xf: a = xf else: b = xf fulc, ffulc = nfc, fnfc nfc, fnfc = xf, fx xf, fx = x, fu else: if x < xf: a = x else: b = x if (fu <= fnfc) or (nfc == xf): fulc, ffulc = nfc, fnfc nfc, fnfc = x, fu elif (fu <= ffulc) or (fulc == xf) or (fulc == nfc): fulc, ffulc = x, fu xm = 0.5*(a+b) tol1 = sqrt_eps*abs(xf) + xtol/3.0 tol2 = 2.0*tol1 if num >= maxfun: flag = 1 fval = fx if disp > 0: _endprint(x, flag, fval, maxfun, xtol, disp) if full_output: return xf, fval, flag, num else: return xf fval = fx if disp > 0: _endprint(x, flag, fval, maxfun, xtol, disp) if full_output: return xf, fval, flag, num else: return xf | 926e615eebcd9f2ca3373b1887f74b532b10bda4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/926e615eebcd9f2ca3373b1887f74b532b10bda4/optimize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
3653,
12,
644,
16,
619,
21,
16,
619,
22,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
25,
16,
943,
12125,
33,
12483,
16,
1983,
67,
2844,
33,
20,
16,
16232,
33,
21,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
1154,
3653,
12,
644,
16,
619,
21,
16,
619,
22,
16,
833,
33,
9334,
619,
3490,
33,
21,
73,
17,
25,
16,
943,
12125,
33,
12483,
16,
1983,
67,
2844,
33,
20,
16,
16232,
33,
21,
46... |
seenPages = [] | seenPages = set() | def DuplicateFilterPageGenerator(generator): """ Wraps around another generator. Yields all pages, but prevents duplicates. """ seenPages = [] for page in generator: if page not in seenPages: seenPages.append(page) yield page | d0f34031e370c3d5697d523988f14a1b40211664 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4404/d0f34031e370c3d5697d523988f14a1b40211664/pagegenerators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19072,
1586,
1964,
3908,
12,
8812,
4672,
3536,
678,
7506,
6740,
4042,
4456,
18,
31666,
87,
777,
4689,
16,
1496,
17793,
11211,
18,
3536,
5881,
5716,
273,
444,
1435,
364,
1363,
316,
4456,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19072,
1586,
1964,
3908,
12,
8812,
4672,
3536,
678,
7506,
6740,
4042,
4456,
18,
31666,
87,
777,
4689,
16,
1496,
17793,
11211,
18,
3536,
5881,
5716,
273,
444,
1435,
364,
1363,
316,
4456,
... |
newLowerMelds = sorted(newLowerMelds, key=lambda x: len(x), reverse=True) | newLowerMelds = sorted(newLowerMelds, key=len, reverse=True) | def newTilePositions(self): """returns list(TileAttr). The tiles are not associated to any board.""" result = list() newUpperMelds = sorted(self.player.exposedMelds, key=meldKey) if self.player.concealedMelds: newLowerMelds = sorted(self.player.concealedMelds) else: tileStr = ''.join(self.player.concealedTileNames) content = HandContent.cached(self.player.game.ruleset, tileStr) newLowerMelds = list(Meld(x) for x in content.sortedMelds.split()) if not self.player.game.isScoringGame(): if self.rearrangeMelds: if newLowerMelds[0].pairs[0] == 'Xy': newLowerMelds = sorted(newLowerMelds, key=lambda x: len(x), reverse=True) else: # generate one meld with all sorted tiles newLowerMelds = [Meld(sorted(sum((x.pairs for x in newLowerMelds), []), key=elementKey))] for yPos, melds in ((0, newUpperMelds), (self.lowerY, newLowerMelds)): meldDistance = self.concealedMeldDistance if yPos else self.exposedMeldDistance meldX = 0 meldY = yPos for meld in melds: for idx, tileName in enumerate(meld.pairs): newTile = TileAttr(tileName, meldX, meldY) newTile.dark = meld.pairs[idx].istitle() and (yPos== 0 or self.player.game.isScoringGame()) if self.player.game.isScoringGame(): newTile.focusable = idx == 0 else: newTile.focusable = (tileName[0] not in 'fy' and tileName != 'Xy' and self.player == self.player.game.activePlayer and (meld.state == CONCEALED and (len(meld) < 4 or meld.meldType == REST))) result.append(newTile) meldX += 1 meldX += meldDistance self.newBonusPositions(result) return sorted(result, key=lambda x: x.yoffset * 100 + x.xoffset) | 75bb42bfcbf79d5642c18294e60dc2d62ba83834 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1679/75bb42bfcbf79d5642c18294e60dc2d62ba83834/handboard.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
9337,
11024,
12,
2890,
4672,
3536,
6154,
666,
12,
9337,
3843,
2934,
1021,
12568,
854,
486,
3627,
358,
1281,
11094,
12123,
563,
273,
666,
1435,
394,
5988,
49,
488,
87,
273,
3115,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
9337,
11024,
12,
2890,
4672,
3536,
6154,
666,
12,
9337,
3843,
2934,
1021,
12568,
854,
486,
3627,
358,
1281,
11094,
12123,
563,
273,
666,
1435,
394,
5988,
49,
488,
87,
273,
3115,
12,... |
def suite(loader=unittest.defaultTestLoader): """Creates the all_tests TestSuite.""" script_parent_path = os.path.abspath(os.path.dirname(sys.argv[0])) test_files = AllTestFilesInDir(script_parent_path) module_names = [os.path.splitext(f)[0] for f in test_files] modules = map(__import__, module_names) return unittest.TestSuite([loader.loadTestsFromModule(m) for m in modules]) | def testWaitForConnectionDoubleArg(self): MonkeyRunner.waitForConnection(2, '*') def testWaitForConnectionKeywordArg(self): MonkeyRunner.waitForConnection(timeout=2, deviceId='foo') def testWaitForConnectionKeywordArgTooMany(self): try: MonkeyRunner.waitForConnection(timeout=2, deviceId='foo', extra='fail') except TypeError: return self.fail('Should have raised TypeError') def testSleep(self): start = time.time() MonkeyRunner.sleep(1.5) end = time.time() self.assertTrue(end - start >= 1.5) | def suite(loader=unittest.defaultTestLoader): """Creates the all_tests TestSuite.""" script_parent_path = os.path.abspath(os.path.dirname(sys.argv[0])) # Find all the _test.py files in the same directory we are in test_files = AllTestFilesInDir(script_parent_path) # Convert them into module names module_names = [os.path.splitext(f)[0] for f in test_files] # And import them modules = map(__import__, module_names) # And create the test suite for all these modules return unittest.TestSuite([loader.loadTestsFromModule(m) for m in modules]) | 66cfd4bfe8f1b4cc794234c1340f6a9c55d62ac2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5268/66cfd4bfe8f1b4cc794234c1340f6a9c55d62ac2/MonkeyRunner_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11371,
12,
6714,
33,
4873,
3813,
18,
1886,
4709,
2886,
4672,
3536,
2729,
326,
777,
67,
16341,
7766,
13587,
12123,
2728,
67,
2938,
67,
803,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11371,
12,
6714,
33,
4873,
3813,
18,
1886,
4709,
2886,
4672,
3536,
2729,
326,
777,
67,
16341,
7766,
13587,
12123,
2728,
67,
2938,
67,
803,
273,
1140,
18,
803,
18,
5113,
803,
12,
538,
1... |
active_browsers = Browser.objects.filter(factory__in=active_factories) preload_foreign_keys(active_browsers, factory=active_factories, factory__operating_system=True, browser_group=True) | active_browsers = Browser.objects.filter( factory__in=active_factories, active=True) browser_groups = BrowserGroup.objects.all() preload_foreign_keys(active_browsers, browser_group=browser_groups, factory=active_factories, factory__operating_system=True) | def details(http_request, request_group_id): """ Show details about the selected request group. """ request_group = get_object_or_404(RequestGroup, id=request_group_id) queued = datetime.now() - request_group.submitted queued_seconds = queued.seconds + queued.days * 24 * 3600 website = request_group.website active_factories = Factory.objects.filter( last_poll__gte=last_poll_timeout()) active_browsers = Browser.objects.filter(factory__in=active_factories) preload_foreign_keys(active_browsers, factory=active_factories, factory__operating_system=True, browser_group=True) requests = request_group.request_set.all() platform_queue_estimates = [] for platform in Platform.objects.all(): estimates = [] for request in requests: if request.platform_id == platform.id: estimates.append({ 'browser': request.browser_string(), 'status': request.status() or queue_estimate( request, active_browsers, queued_seconds), }) if estimates: estimates.sort() platform_queue_estimates.append((platform, estimates)) return render_to_response('requests/details.html', locals()) | 4332a2c0331234871cccff8899fe36140e1c420b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3111/4332a2c0331234871cccff8899fe36140e1c420b/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3189,
12,
2505,
67,
2293,
16,
590,
67,
1655,
67,
350,
4672,
3536,
9674,
3189,
2973,
326,
3170,
590,
1041,
18,
3536,
590,
67,
1655,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
691,
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,
3189,
12,
2505,
67,
2293,
16,
590,
67,
1655,
67,
350,
4672,
3536,
9674,
3189,
2973,
326,
3170,
590,
1041,
18,
3536,
590,
67,
1655,
273,
336,
67,
1612,
67,
280,
67,
11746,
12,
691,
11... |
class ParamCategory(Param): def __init__(self, keyword, default=None): self.keyword = keyword self.category = keyword def isSettable(self): return False def getCtrl(self, parent, initial=None): box = wx.StaticBox(parent, -1, self.keyword) ctrl = wx.StaticBoxSizer(box, wx.VERTICAL) return ctrl | def isSettable(self): return False | 1f6160b06a4444687324525ba5d4c2d9892fbf5c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/1f6160b06a4444687324525ba5d4c2d9892fbf5c/userparams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13532,
2121,
12,
2890,
4672,
327,
1083,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13532,
2121,
12,
2890,
4672,
327,
1083,
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,
-... | |
result = self.__runCommand( cmd ) | result = self._runCommand( cmd ) | def getResourceUsage( self ): """Returns a dictionary containing CPUConsumed, CPULimit, WallClockConsumed and WallClockLimit for current slot. All values returned in seconds. """ cmd = 'qstat -f %s' % ( self.jobID ) result = self.__runCommand( cmd ) if not result['OK']: return result | c7c892f960b28a3ca4f732316059af6234c47439 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/c7c892f960b28a3ca4f732316059af6234c47439/PBSTimeLeft.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5070,
5357,
12,
365,
262,
30,
3536,
1356,
279,
3880,
4191,
12154,
20554,
16,
5181,
1506,
1038,
16,
678,
454,
14027,
20554,
471,
678,
454,
14027,
3039,
364,
783,
4694,
18,
225,
4826,
924,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5070,
5357,
12,
365,
262,
30,
3536,
1356,
279,
3880,
4191,
12154,
20554,
16,
5181,
1506,
1038,
16,
678,
454,
14027,
20554,
471,
678,
454,
14027,
3039,
364,
783,
4694,
18,
225,
4826,
924,... |
self.respond("500 Can't connect over a privileged port.") | self.respond("504 Can't connect over a privileged port.") | def ftp_PORT(self, line): """Start an active data-channel.""" # parse PORT request getting IP and PORT # TODO - add a comment describing how the algorithm used to get such # values works (reference http://cr.yp.to/ftp/retr.html). try: line = line.split(',') ip = ".".join(line[:4]).replace(',','.') port = (int(line[4]) * 256) + int(line[5]) except (ValueError, OverflowError): self.respond("500 Invalid PORT format.") return | 6651b74b68bd60bf9746812fa74db806f04125c3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/6651b74b68bd60bf9746812fa74db806f04125c3/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
6354,
12,
2890,
16,
980,
4672,
3536,
1685,
392,
2695,
501,
17,
4327,
12123,
468,
1109,
20987,
590,
8742,
2971,
471,
20987,
468,
2660,
300,
527,
279,
2879,
16868,
3661,
326,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
6354,
12,
2890,
16,
980,
4672,
3536,
1685,
392,
2695,
501,
17,
4327,
12123,
468,
1109,
20987,
590,
8742,
2971,
471,
20987,
468,
2660,
300,
527,
279,
2879,
16868,
3661,
326,
48... |
p_initial = _safe_copy_and_check(p_initial, (N,)) if not p_initial.any(): p_initial = _random_norm(N) p_transition = _safe_copy_and_check(p_transition, (N,N)) if not p_transition.any(): p_transition = _random_norm((N,N)) p_emission = _safe_copy_and_check(p_emission, (N,M)) if not p_emission.any(): p_emission = _random_norm((N,M)) | try : p_initial = _safe_copy_and_check(p_initial, (N,)) if not p_initial.any(): p_initial = _random_norm(N) p_transition = _safe_copy_and_check(p_transition, (N,N)) if not p_transition.any(): p_transition = _random_norm((N,N)) p_emission = _safe_copy_and_check(p_emission, (N,M)) if not p_emission.any(): p_emission = _random_norm((N,M)) except AttributeError : p_initial = _safe_copy_and_check(p_initial, (N,)) or \ _random_norm(N) p_transition = _safe_copy_and_check(p_transition, (N,N)) or \ _random_norm((N,N)) p_emission = _safe_copy_and_check(p_emission, (N,M)) or \ _random_norm((N,M)) | def _baum_welch(N, M, training_outputs, p_initial=None, p_transition=None, p_emission=None, pseudo_initial=None, pseudo_transition=None, pseudo_emission=None, update_fn=None): # Returns (p_initial, p_transition, p_emission) p_initial = _safe_copy_and_check(p_initial, (N,)) if not p_initial.any(): p_initial = _random_norm(N) p_transition = _safe_copy_and_check(p_transition, (N,N)) if not p_transition.any(): p_transition = _random_norm((N,N)) p_emission = _safe_copy_and_check(p_emission, (N,M)) if not p_emission.any(): p_emission = _random_norm((N,M)) # Do all the calculations in log space to avoid underflows. lp_initial, lp_transition, lp_emission = map( log, (p_initial, p_transition, p_emission)) lpseudo_initial, lpseudo_transition, lpseudo_emission = map( _safe_log, (pseudo_initial, pseudo_transition, pseudo_emission)) # Iterate through each sequence of output, updating the parameters # to the HMM. Stop when the log likelihoods of the sequences # stops varying. prev_llik = None for i in range(MAX_ITERATIONS): llik = LOG0 for outputs in training_outputs: x = _baum_welch_one( N, M, outputs, lp_initial, lp_transition, lp_emission, lpseudo_initial, lpseudo_transition, lpseudo_emission,) llik += x if update_fn is not None: update_fn(i, llik) if prev_llik is not None and fabs(prev_llik-llik) < 0.1: break prev_llik = llik else: raise "HMM did not converge in %d iterations" % MAX_ITERATIONS # Return everything back in normal space. return map(exp, (lp_initial, lp_transition, lp_emission)) | da0fd9f574701ebfa67047750de6b3ef7cbb1d92 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/da0fd9f574701ebfa67047750de6b3ef7cbb1d92/MarkovModel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12124,
379,
67,
91,
292,
343,
12,
50,
16,
490,
16,
8277,
67,
12295,
16,
293,
67,
6769,
33,
7036,
16,
293,
67,
14936,
33,
7036,
16,
293,
67,
351,
19710,
33,
7036,
16,
12454,
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,
389,
12124,
379,
67,
91,
292,
343,
12,
50,
16,
490,
16,
8277,
67,
12295,
16,
293,
67,
6769,
33,
7036,
16,
293,
67,
14936,
33,
7036,
16,
293,
67,
351,
19710,
33,
7036,
16,
12454,
67... |
elif regType.filter_content_types and \ typeinfo.getId() in regType.allowed_content_types: searchFor.append(regType.getId()) | elif regType.filter_content_types and regType.allowed_content_types: act_dict = dict([ (act, 0) for act in regType.allowed_content_types ]) if act_dict.has_key(typeinfo.getId()): searchFor.append(regType.getId()) | def lookupDestinationsFor(self, typeinfo, tool, purl, destination_types=None): """ search where the user can add a typeid instance """ searchFor = [] | cdb86a6cc10d9cd8a25888cdab075e77511dd455 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/cdb86a6cc10d9cd8a25888cdab075e77511dd455/Widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3689,
27992,
1290,
12,
2890,
16,
618,
1376,
16,
5226,
16,
293,
718,
16,
2929,
67,
2352,
33,
7036,
4672,
3536,
1623,
1625,
326,
729,
848,
527,
279,
618,
350,
791,
3536,
1623,
1290,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3689,
27992,
1290,
12,
2890,
16,
618,
1376,
16,
5226,
16,
293,
718,
16,
2929,
67,
2352,
33,
7036,
4672,
3536,
1623,
1625,
326,
729,
848,
527,
279,
618,
350,
791,
3536,
1623,
1290,
273,... |
p = self.protocol(self.domain, len(self.toEmail)*2+2) | p = self.protocol(self.domain, self.nEmails*2+2) | def buildProtocol(self, addr): p = self.protocol(self.domain, len(self.toEmail)*2+2) p.factory = self return p | 9533f45fbe95d4df1edcfed370e813357345282d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9533f45fbe95d4df1edcfed370e813357345282d/smtp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5752,
12,
2890,
16,
3091,
4672,
293,
273,
365,
18,
8373,
12,
2890,
18,
4308,
16,
365,
18,
82,
26614,
14,
22,
15,
22,
13,
293,
18,
6848,
273,
365,
327,
293,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5752,
12,
2890,
16,
3091,
4672,
293,
273,
365,
18,
8373,
12,
2890,
18,
4308,
16,
365,
18,
82,
26614,
14,
22,
15,
22,
13,
293,
18,
6848,
273,
365,
327,
293,
2,
-100,
-100,
-10... |
for x in updatelh] | for x in updatelb] | def checkbranch(lheads, rheads, updatelh): ''' check whether there are more local heads than remote heads on a specific branch. | dcad1b282cbe4322e65e3cd4daaeb78a033c9f4a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/dcad1b282cbe4322e65e3cd4daaeb78a033c9f4a/localrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
7500,
12,
80,
20263,
16,
436,
20263,
16,
2166,
270,
292,
76,
4672,
9163,
866,
2856,
1915,
854,
1898,
1191,
22742,
2353,
2632,
22742,
603,
279,
2923,
3803,
18,
2,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
866,
7500,
12,
80,
20263,
16,
436,
20263,
16,
2166,
270,
292,
76,
4672,
9163,
866,
2856,
1915,
854,
1898,
1191,
22742,
2353,
2632,
22742,
603,
279,
2923,
3803,
18,
2,
-100,
-100,
-100,
... |
ff = "%."+self.data.domain[self.attributeName].numberOfDecimals+1+"f" | ff = "%."+str(self.data.domain[self.attributeName].numberOfDecimals+1)+"f" | def refreshVisibleOutcomes(self): if not self.data or not self.visibleOutcomes: return self.tips.removeAll() if self.pureHistogram: self.refreshPureVisibleOutcomes() return self.enableYRaxis(0) self.setAxisScale(QwtPlot.yRight, 0.0, 1.0, 0.1) self.setYRaxisTitle("") keys = self.hdata.keys() if self.variableContinuous: keys.sort() | 04f6de6ae1114398b6e2d56e64d6b62873b0e304 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/04f6de6ae1114398b6e2d56e64d6b62873b0e304/OWDistributions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
6207,
1182,
10127,
12,
2890,
4672,
309,
486,
365,
18,
892,
578,
486,
365,
18,
8613,
1182,
10127,
30,
327,
365,
18,
88,
7146,
18,
4479,
1595,
1435,
309,
365,
18,
84,
594,
12874,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
6207,
1182,
10127,
12,
2890,
4672,
309,
486,
365,
18,
892,
578,
486,
365,
18,
8613,
1182,
10127,
30,
327,
365,
18,
88,
7146,
18,
4479,
1595,
1435,
309,
365,
18,
84,
594,
12874,
... |
if lastTag[1] == tag.tagFormatConstructed and \ lastTag[0] != tag.tagClassUniversal: | if tagSet and \ tagSet[0][1] == tag.tagFormatConstructed and \ tagSet[0][0] != tag.tagClassUniversal: | def __call__(self, substrate, asn1Spec=None, tagSet=None, length=None, state=stDecodeTag, recursiveFlag=1): # Decode tag & length while state != stStop: if state == stDecodeTag: # Decode tag if not substrate: raise error.SubstrateUnderrunError( 'Short octet stream on tag decoding' ) t = ord(substrate[0]) tagClass = t&0xC0 tagFormat = t&0x20 tagId = t&0x1F substrate = substrate[1:] if tagId == 0x1F: tagId = 0L while 1: if not substrate: raise error.SubstrateUnderrunError( 'Short octet stream on long tag decoding' ) t = ord(substrate[0]) tagId = tagId << 7 | (t&0x7F) substrate = substrate[1:] if not t&0x80: break lastTag = tag.Tag( tagClass=tagClass, tagFormat=tagFormat, tagId=tagId ) if tagSet is None: tagSet = tag.TagSet((), lastTag) # base tag not recovered else: tagSet = lastTag + tagSet state = stDecodeLength if state == stDecodeLength: # Decode length if not substrate: raise error.SubstrateUnderrunError( 'Short octet stream on length decoding' ) firstOctet = ord(substrate[0]) if firstOctet == 128: size = 1 length = -1 elif firstOctet < 128: length, size = firstOctet, 1 else: size = firstOctet & 0x7F # encoded in size bytes length = 0 lengthString = substrate[1:size+1] # missing check on maximum size, which shouldn't be a # problem, we can handle more than is possible if len(lengthString) != size: raise error.SubstrateUnderrunError( '%s<%s at %s' % (size, len(lengthString), tagSet) ) for char in lengthString: length = (length << 8) | ord(char) size = size + 1 state = stGetValueDecoder substrate = substrate[size:] if length != -1 and len(substrate) < length: raise error.SubstrateUnderrunError( '%d-octet short' % (length - len(substrate)) ) if state == stGetValueDecoder: if asn1Spec is None: state = stGetValueDecoderByTag else: state = stGetValueDecoderByAsn1Spec # # There're two ways of creating subtypes in ASN.1 what influences # decoder operation. These methods are: # 1) Either base types used in or no IMPLICIT tagging has been # applied on subtyping. # 2) Subtype syntax drops base type information (by means of # IMPLICIT tagging. # The first case allows for complete tag recovery from substrate # while the second one requires original ASN.1 type spec for # decoding. # # In either case a set of tags (tagSet) is coming from substrate # in an incremental, tag-by-tag fashion (this is the case of # EXPLICIT tag which is most basic). Outermost tag comes first # from the wire. # if state == stGetValueDecoderByTag: concreteDecoder = self.__codecMap.get(tagSet) if concreteDecoder: state = stDecodeValue else: concreteDecoder = self.__codecMap.get(tagSet[:1]) if concreteDecoder: state = stDecodeValue else: state = stTryAsExplicitTag if state == stGetValueDecoderByAsn1Spec: if tagSet == eoo.endOfOctets.getTagSet(): concreteDecoder = self.__codecMap[tagSet] state = stDecodeValue continue if type(asn1Spec) == types.DictType: __chosenSpec = asn1Spec.get(tagSet) elif asn1Spec is not None: __chosenSpec = asn1Spec else: __chosenSpec = None if __chosenSpec is None or not\ __chosenSpec.getTypeMap().has_key(tagSet): state = stTryAsExplicitTag else: # use base type for codec lookup to recover untagged types baseTag = __chosenSpec.getTagSet().getBaseTag() if baseTag: # XXX ugly baseTagSet = tag.TagSet(baseTag, baseTag) else: baseTagSet = tag.TagSet() concreteDecoder = self.__codecMap.get( # tagged subtype baseTagSet ) if concreteDecoder: asn1Spec = __chosenSpec state = stDecodeValue else: state = stTryAsExplicitTag if state == stTryAsExplicitTag: if lastTag[1] == tag.tagFormatConstructed and \ lastTag[0] != tag.tagClassUniversal: # Assume explicit tagging state = stDecodeTag else: raise error.PyAsn1Error( '%s not in asn1Spec: %s' % (tagSet, asn1Spec) ) if state == stDecodeValue: if recursiveFlag: decodeFun = self else: decodeFun = None if length == -1: # indef length value, substrate = concreteDecoder.indefLenValueDecoder( substrate, asn1Spec, tagSet, length, stGetValueDecoder, decodeFun ) else: value, _substrate = concreteDecoder.valueDecoder( substrate[:length], asn1Spec, tagSet, length, stGetValueDecoder, decodeFun ) if recursiveFlag: substrate = substrate[length:] else: substrate = _substrate state = stStop return value, substrate | 2dacc4511def29cede2cdf25f181141eb9c3aff3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4168/2dacc4511def29cede2cdf25f181141eb9c3aff3/decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
2373,
340,
16,
12211,
21,
1990,
33,
7036,
16,
1047,
694,
33,
7036,
16,
769,
33,
7036,
16,
919,
33,
334,
6615,
1805,
16,
5904,
4678,
33,
21,
4672,
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,
1001,
1991,
972,
12,
2890,
16,
2373,
340,
16,
12211,
21,
1990,
33,
7036,
16,
1047,
694,
33,
7036,
16,
769,
33,
7036,
16,
919,
33,
334,
6615,
1805,
16,
5904,
4678,
33,
21,
4672,
468,
... |
self.load_hashfile(filename) | if self.get_hashfile_format(filename): log("HashFile detected, loading: '%s'" % filename) self.load_hashfile(filename) | def __init__(self, initial_files=[]): self.init_window() self.new_hashfile() | 4ea1f13de038d4f844826cb7bd3925ffd32e0440 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2200/4ea1f13de038d4f844826cb7bd3925ffd32e0440/parano.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2172,
67,
2354,
33,
8526,
4672,
365,
18,
2738,
67,
5668,
1435,
365,
18,
2704,
67,
2816,
768,
1435,
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,
2172,
67,
2354,
33,
8526,
4672,
365,
18,
2738,
67,
5668,
1435,
365,
18,
2704,
67,
2816,
768,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
'product_uos_qty': obj.stock_incoming_left, | 'product_uos_qty': obj.incoming_left, | def procure_incomming_left(self, cr, uid, ids, context, *args): result = {} # need to check with requirement for obj in self.browse(cr, uid, ids): location_id = obj.warehouse_id and obj.warehouse_id.lot_stock_id.id or False output_id = obj.warehouse_id and obj.warehouse_id.lot_output_id.id or False if location_id and output_id: move_id = self.pool.get('stock.move').create(cr, uid, { 'name': obj.product_id.name[:64], 'product_id': obj.product_id.id, 'date_planned': obj.period_id.date_start, 'product_qty': obj.stock_incoming_left, 'product_uom': obj.product_uom.id, 'product_uos_qty': obj.stock_incoming_left, 'product_uos': obj.product_uom.id, 'location_id': location_id, 'location_dest_id': output_id, 'state': 'waiting', }) proc_id = self.pool.get('mrp.procurement').create(cr, uid, { 'name': 'Procure left From Planning', 'origin': 'Stock Planning', 'date_planned': obj.period_id.date_start, 'product_id': obj.product_id.id, 'product_qty': obj.stock_incoming_left, 'product_uom': obj.product_uom.id, 'product_uos_qty': obj.stock_incoming_left, 'product_uos': obj.product_uom.id, 'location_id': obj.warehouse_id.lot_stock_id.id, 'procure_method': obj.product_id.product_tmpl_id.procure_method, 'move_id': move_id, }) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'mrp.procurement', proc_id, 'button_confirm', cr) self.write(cr, uid, obj.id,{'state':'done'}) return True | ff08d2d4d1046d4ae7d44dc6ad41d16b31476908 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/ff08d2d4d1046d4ae7d44dc6ad41d16b31476908/stock_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5418,
594,
67,
267,
5702,
310,
67,
4482,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
16,
380,
1968,
4672,
563,
273,
2618,
468,
1608,
358,
866,
598,
12405,
364,
1081,
316,
365,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5418,
594,
67,
267,
5702,
310,
67,
4482,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
16,
380,
1968,
4672,
563,
273,
2618,
468,
1608,
358,
866,
598,
12405,
364,
1081,
316,
365,
1... |
This should be called once per request, then you should get the value from request object lang attribute. | This should be called once per request, then you should get the value from request object lang attribute. | def requestLanguage(request): """ Return the user interface language for this request. The user interface language is taken from the user preferences for registered users, or request environment, or the default language of the wiki, or English. This should be called once per request, then you should get the value from request object lang attribute. Unclear what this means: "Until the code for get text is fixed, we are caching the request language locally." @param request: the request object @keyword usecache: whether to get the value form the local cache or actually look for it. This will update the cache data. @rtype: string @return: ISO language code, e.g. 'en' """ # Return the user language preferences for registered users if request.user.valid and request.user.language: return request.user.language # Or try to return one of the user browser accepted languages, if it # is available on this wiki... available = wikiLanguages() if not request.cfg.language_ignore_browser: for lang in browserLanguages(request): if available.has_key(lang): if request.http_accept_language: request.setHttpHeader('Vary: Accept-Language') return lang # Or return the wiki default language... if available.has_key(request.cfg.language_default): lang = request.cfg.language_default # If everything else fails, read the manual... or return 'en' else: lang = 'en' return lang | 7e24d43853684fff4e8344c2d07bb51908c229c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/7e24d43853684fff4e8344c2d07bb51908c229c3/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
3779,
12,
2293,
4672,
3536,
2000,
326,
729,
1560,
2653,
364,
333,
590,
18,
225,
1021,
729,
1560,
2653,
353,
9830,
628,
326,
729,
12750,
364,
4104,
3677,
16,
578,
590,
3330,
16,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
3779,
12,
2293,
4672,
3536,
2000,
326,
729,
1560,
2653,
364,
333,
590,
18,
225,
1021,
729,
1560,
2653,
353,
9830,
628,
326,
729,
12750,
364,
4104,
3677,
16,
578,
590,
3330,
16,
57... |
return crypt.crypt(password, '6a') | hashed = hashlib.sha1(password).hexdigest() return hashed[3:] + hashed[:3] | def get_crypt_password(password): """ Cryptographic function used for password hashing @param password: password to hash """ return crypt.crypt(password, '6a') | 882bd86d30658100435194dc84c71407ddbd5a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4230/882bd86d30658100435194dc84c71407ddbd5a46/auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22784,
67,
3664,
12,
3664,
4672,
3536,
22752,
16983,
445,
1399,
364,
2201,
24641,
632,
891,
2201,
30,
2201,
358,
1651,
3536,
14242,
273,
15956,
18,
7819,
21,
12,
3664,
2934,
711... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
22784,
67,
3664,
12,
3664,
4672,
3536,
22752,
16983,
445,
1399,
364,
2201,
24641,
632,
891,
2201,
30,
2201,
358,
1651,
3536,
14242,
273,
15956,
18,
7819,
21,
12,
3664,
2934,
711... |
state.proxyPorts = [_addressAndPort(arg)] | state.proxyPorts = [_addressAndPort(a) for a in arg.split(',')] | def run(): global state # Read the arguments. try: opts, args = getopt.getopt(sys.argv[1:], 'hbd:p:l:u:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() runSelfTest = False for opt, arg in opts: if opt == '-h': print >>sys.stderr, __doc__ sys.exit() elif opt == '-b': state.launchUI = True # '-p' and '-d' are handled by the storage.database_type call # below, in case you are wondering why they are missing. elif opt == '-l': state.proxyPorts = [_addressAndPort(arg)] elif opt == '-u': state.uiPort = int(arg) elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) state.DBName, state.useDB = storage.database_type(opts) # Let the user know what they are using... v = get_current_version() print "%s\n" % (v.get_long_version("SpamBayes POP3 Proxy"),) if 0 <= len(args) <= 2: # Normal usage, with optional server name and port number. if len(args) == 1: state.servers = [(args[0], 110)] elif len(args) == 2: state.servers = [(args[0], int(args[1]))] # Default to listening on port 110 for command-line-specified servers. if len(args) > 0 and state.proxyPorts == []: state.proxyPorts = [('', 110)] try: prepare() except AlreadyRunningException: print >>sys.stderr, \ "ERROR: The proxy is already running on this machine." print >>sys.stderr, "Please stop the existing proxy and try again" return start() else: print >>sys.stderr, __doc__ | 031d3ea6746531c9fcc35e9be2df307d8999e4da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/031d3ea6746531c9fcc35e9be2df307d8999e4da/sb_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
13332,
2552,
919,
468,
2720,
326,
1775,
18,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
76,
16410,
30,
84,
30,
80,
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,
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,
13332,
2552,
919,
468,
2720,
326,
1775,
18,
775,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
76,
16410,
30,
84,
30,
80,
30,
... |
Returns the sum of a graph with itself n times. Note that the graph must on the left side of the multiplication currently. | Returns the sum of a graph with itself n times. | def __mul__(self, n): """ Returns the sum of a graph with itself n times. Note that the graph must on the left side of the multiplication currently. | c0285f94b12042b37faf4142207c21a7997044a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c0285f94b12042b37faf4142207c21a7997044a9/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16411,
972,
12,
2890,
16,
290,
4672,
3536,
2860,
326,
2142,
434,
279,
2667,
598,
6174,
290,
4124,
18,
225,
3609,
716,
326,
2667,
1297,
603,
326,
2002,
4889,
434,
326,
23066,
4551,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16411,
972,
12,
2890,
16,
290,
4672,
3536,
2860,
326,
2142,
434,
279,
2667,
598,
6174,
290,
4124,
18,
225,
3609,
716,
326,
2667,
1297,
603,
326,
2002,
4889,
434,
326,
23066,
4551,
... |
self.queue.put(name) | if string.strip(name): self.queue.put(name) | def run(self, host='127.0.0.1', port=socketPort): #print 'running listner thread %d'%id(self) import socket from select import select # Open a socket and listen. s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.bind((host, port)) except socket.error, err: ##print 'Socket error', str(err) # printing from thread not useful because it's async ##if err[0] == 10048: # Address already in use ## print 'Already a Boa running as a server' ##else: ## print 'Server mode not started:', err self.closed.set() return s.listen(5) while 1: while 1: # Listen for 0.25 s, then check if closed is set. In that case, # end thread by returning. ready, dummy, dummy = select([s],[],[], selectTimeout) if self.closed.isSet(): #print 'closing listner thread %d'%id(self) return if ready: break # Accept a connection, read the data and put it into the queue. conn, addr = s.accept() l = [] while 1: data = conn.recv(1024) if not data: break l.append(data) name = ''.join(l) self.queue.put(name) conn.close() | b3e0036832bc8c7134065b41c3a8bc7fe8e88814 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/b3e0036832bc8c7134065b41c3a8bc7fe8e88814/EditorUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1479,
2218,
14260,
18,
20,
18,
20,
18,
21,
2187,
1756,
33,
7814,
2617,
4672,
468,
1188,
296,
8704,
666,
1224,
2650,
738,
72,
11,
9,
350,
12,
2890,
13,
1930,
2987,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
1479,
2218,
14260,
18,
20,
18,
20,
18,
21,
2187,
1756,
33,
7814,
2617,
4672,
468,
1188,
296,
8704,
666,
1224,
2650,
738,
72,
11,
9,
350,
12,
2890,
13,
1930,
2987,... |
toolinit=self.TEMPL_TOOLINIT % repr([m+'.'+c.getName() for c,m in self.generatedClasses if c.getStereoType() in self.portal_tools]) | toolinit=self.TEMPL_TOOLINIT % ','.join([m+'.'+c.getName() for c,m in self.generatedClasses if c.getStereoType() in self.portal_tools]) | def generateStdFiles(self, target,projectName,generatedModules): #generates __init__.py, Extensions/Install.py and the skins directory #the result is a QuickInstaller installable product #remove trailing slash if target[-1] in ('/','\\'): target=target[:-1] templdir=os.path.join(sys.path[0],'templates') initTemplate=open(os.path.join(templdir,'__init__.py')).read() | baf6c7c14770d691e71b22520c4c4a40455a4956 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/baf6c7c14770d691e71b22520c4c4a40455a4956/ArchGenXML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
10436,
2697,
12,
2890,
16,
1018,
16,
4406,
461,
16,
11168,
7782,
4672,
468,
3441,
815,
1001,
2738,
25648,
2074,
16,
23105,
19,
6410,
18,
2074,
471,
326,
4343,
2679,
1867,
468,
5787... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
10436,
2697,
12,
2890,
16,
1018,
16,
4406,
461,
16,
11168,
7782,
4672,
468,
3441,
815,
1001,
2738,
25648,
2074,
16,
23105,
19,
6410,
18,
2074,
471,
326,
4343,
2679,
1867,
468,
5787... |
list, msg = self.eval_print_amount(selection, list, msg) count = len(list) if not list: return 0, list | stat_list, msg = self.eval_print_amount(selection, stat_list, msg) count = len(stat_list) if not stat_list: return 0, stat_list | def get_print_list(self, sel_list): width = self.max_name_len if self.fcn_list: list = self.fcn_list[:] msg = " Ordered by: " + self.sort_type + '\n' else: list = self.stats.keys() msg = " Random listing order was used\n" | 1076eed9bee3b873e1cb1bcca42f40854ecd9db4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/1076eed9bee3b873e1cb1bcca42f40854ecd9db4/pstats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1188,
67,
1098,
12,
2890,
16,
357,
67,
1098,
4672,
1835,
273,
365,
18,
1896,
67,
529,
67,
1897,
309,
365,
18,
7142,
82,
67,
1098,
30,
666,
273,
365,
18,
7142,
82,
67,
1098... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1188,
67,
1098,
12,
2890,
16,
357,
67,
1098,
4672,
1835,
273,
365,
18,
1896,
67,
529,
67,
1897,
309,
365,
18,
7142,
82,
67,
1098,
30,
666,
273,
365,
18,
7142,
82,
67,
1098... |
elif self.have_gzip and os.access(filename+'.gz', os.R_OK): | elif have_gzip and os.access(filename+'.gz', os.R_OK): | def load_from_outcar(self, filename): """ This function reads atom positions, unit cell, forces and stress tensor from the VASP OUTCAR file """ if os.access(filename, os.R_OK): F=file(filename) elif self.have_gzip and os.access(filename+'.gz', os.R_OK): F=gzip.open(filename+'.gz') else: raise Exception("Missing file") self.debug('Could not read %s' % filename, LOG_ERROR) line=" " while line: line = F.readline() if line.startswith(" number of dos"): # number of dos NEDOS = 301 number of ions NIONS = 10 data = line.split() self.num_atoms = int(data[-1]) elif line.startswith(" POSITION"): # POSITION TOTAL-FORCE (eV/Angst) # ----------------------------------------------------------------------------------- # -0.00003 -0.00002 0.07380 0.000005 0.000005 -0.000031 # 0.00003 -0.00002 6.85381 0.000003 0.000006 -0.000031 F.readline() #data = fromfile( F, dtype('float'), 6*self.num_atoms, ' ' ).reshape((self.num_atoms,6)) data = zeros((self.num_atoms,6)) for i in range(self.num_atoms): data[i,:] = [float(val) for val in F.readline().split() ] self.atoms = mat(data[:,0:3]) self.forces = mat(data[:,3:6]) elif line.startswith(" number of electron"): # number of electron 94.0000001 magnetization 0.0000060 -0.0364612 0.0000000 data=line.split() self.__magnetization = mat(zeros((1,3))) if len(data) == 8: self.__magnetization[0,0]=float(data[5]) self.__magnetization[0,1]=float(data[6]) self.__magnetization[0,2]=float(data[7]) elif len(data) == 6: self.debug("Only collinear magnetization available", LOG_WARNING) self.__magnetization[0,2]=float(data[5]) else: self.debug("No magnetization available", LOG_WARNING) | f924c4775968ccf81701e052f26b94f7d3d2b0c7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7324/f924c4775968ccf81701e052f26b94f7d3d2b0c7/calculation_set.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2080,
67,
659,
9815,
12,
2890,
16,
1544,
4672,
3536,
1220,
445,
6838,
3179,
6865,
16,
2836,
2484,
16,
26376,
471,
384,
663,
8171,
628,
326,
776,
3033,
52,
8210,
39,
985,
585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2080,
67,
659,
9815,
12,
2890,
16,
1544,
4672,
3536,
1220,
445,
6838,
3179,
6865,
16,
2836,
2484,
16,
26376,
471,
384,
663,
8171,
628,
326,
776,
3033,
52,
8210,
39,
985,
585,... |
GROUP BY file, unit ORDER BY unit""", (build.id, step.name)) | GROUP BY file, item_name.value ORDER BY item_name.value ORDER BY unit""", (build.id, step.name)) | def render_summary(self, req, config, build, step, category): assert category == 'coverage' | 3bec888be3e4ac20a7e5aaf60ad25d96bca0c988 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4547/3bec888be3e4ac20a7e5aaf60ad25d96bca0c988/summarizers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
7687,
12,
2890,
16,
1111,
16,
642,
16,
1361,
16,
2235,
16,
3150,
4672,
1815,
3150,
422,
296,
16356,
11,
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,
1743,
67,
7687,
12,
2890,
16,
1111,
16,
642,
16,
1361,
16,
2235,
16,
3150,
4672,
1815,
3150,
422,
296,
16356,
11,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def find_dependend_dlls(self, use_runw, dlls): | def find_dependend_dlls(self, use_runw, dlls, pypath): | def find_dependend_dlls(self, use_runw, dlls): import py2exe_util sysdir = py2exe_util.get_sysdir() windir = py2exe_util.get_windir() # This is the tail of the path windows uses when looking for dlls # XXX On Windows NT, the SYSTEM directory is also searched exedir = os.path.dirname(sys.executable) syspath = os.environ['PATH'] loadpath = string.join([exedir, sysdir, windir, syspath], ';') | b4bc4a708a243dbdccbab16ae16901e1bfb8d26a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1361/b4bc4a708a243dbdccbab16ae16901e1bfb8d26a/py2exe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
5817,
409,
67,
27670,
87,
12,
2890,
16,
999,
67,
2681,
91,
16,
302,
2906,
87,
16,
2395,
803,
4672,
1930,
2395,
22,
14880,
67,
1367,
2589,
1214,
273,
2395,
22,
14880,
67,
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,
1104,
67,
5817,
409,
67,
27670,
87,
12,
2890,
16,
999,
67,
2681,
91,
16,
302,
2906,
87,
16,
2395,
803,
4672,
1930,
2395,
22,
14880,
67,
1367,
2589,
1214,
273,
2395,
22,
14880,
67,
13... |
self.runtime_config = None self.sim_config = None self.backend_driver = None self.data_manager = None self.we_driver = None self.worker = None self.hostname = None def runtime_init(self, runtime_config, load_sim_config=True): self.runtime_config = runtime_config if load_sim_config: self.load_sim_config() def sim_init(self, sim_config, sim_config_src): """Create the necessary state for a new simulation""" raise NotImplementedError def load_sim_config(self): """Load the static simulation configuration from disk""" self.runtime_config.require(RC_SIM_CONFIG_KEY) log.info("loading static simulation configuration from '%s'" % self.runtime_config[RC_SIM_CONFIG_KEY]) self.sim_config, self.sim_config_src = pickle.load(open(self.runtime_config[RC_SIM_CONFIG_KEY], 'rb')) def save_sim_config(self): """Save the static simulation configuration information to disk""" self.runtime_config.require(RC_SIM_CONFIG_KEY) log.info("saving static simulation configuration to '%s'" % self.runtime_config[RC_SIM_CONFIG_KEY]) pickle.dump((self.sim_config,self.sim_config_src), open(self.runtime_config[RC_SIM_CONFIG_KEY], 'wb'), pickle.HIGHEST_PROTOCOL) def load_data_manager(self): """Load and configure the data manager""" from wemd.data_manager import make_data_manager self.data_manager = make_data_manager(self.runtime_config) def load_we_driver(self): """Load and configure the WE driver""" from wemd.we_drivers import get_we_driver Driver = get_we_driver(self.sim_config['wemd.we_driver']) self.we_driver = Driver() self.we_driver.sim_config = self.sim_config self.we_driver.runtime_init(self.runtime_config) def run(self): """Enter a running state, such as driving the simulation or waiting for network data to arrive for processing.""" raise NotImplementedError def set_hostname(self, hostname): self.hostname = hostname def shutdown(self, exit_code=0): pass class WESimMaster(WESimManagerBase): """ The overall driver of a WE simulation, responsible for all state I/O and overall coordination of workers. """ def __init__(self): super(WESimMaster,self).__init__() self.we_iter = None def run_we(self): """Bin, split, and merge particles.""" raise NotImplementedError def continue_simulation(self): """Determine if another iteration will occur""" raise NotImplementedError def shutdown(self, exit_code=0): if self.data_manager is not None: self.data_manager.close_hdf5() if self.worker is not None: self.worker.shutdown(exit_code) def load_work_manager(self, driver_name): from wemd.work_managers.default import DefaultWorkManager if driver_name in ('', 'serial', 'default'): log.info('using default work manager') driver = DefaultWorkManager elif driver_name == 'mpi': log.info('using MPI work manager') from wemd.util import mpi as wemd_mpi wemd_mpi.init_mpi() from wemd.work_managers.mpi import MPIWEMaster, MPIWEWorker if not wemd_mpi.is_mpi_active(): log.warning('MPI environment not available; using serial driver') driver = DefaultWEMaster if wemd_mpi.is_rank_0(): driver = MPIWEMaster else: driver = MPIWEWorker elif driver_name == 'tcp_server': log.info('using TCP simulation manager (server)') from wemd.work_managers.tcpip import TCPWEMaster driver = TCPWEMaster elif driver_name == 'tcp_client': log.info('using TCP simulation manager (client)') from wemd.work_managers.tcpip import TCPWEWorker driver = TCPWEWorker else: raise ConfigError('invalid simulation manager driver %r specified' % driver_name) return driver def run(self): if self.we_driver is None: self.load_we_driver() if self.worker is None: driver_name = self.runtime_config.get('work_manager.driver', 'serial').lower() WM = self.load_work_manager(driver_name) self.worker = WM(self.runtime_config, True) if self.hostname is not None: self.worker.set_hostname(self.hostname) if self.worker.worker_is_master() and self.data_manager is None: self.load_data_manager() self.worker.runtime_init(self.runtime_config, True) max_wallclock = self.max_wallclock if( max_wallclock is not None): we_cur_wallclock = time.time() - self.start_wallclock loop_start_time = loop_end_time = None segments = None prev_max_seg_id = None max_seg_id = None incomplete_segs = False while self.continue_simulation(): if self.worker.worker_is_master(): debug_name = 'master' else: debug_name = 'worker' log.info('DEBUG: %r start of loop %r' % (debug_name,time.time())) if( max_wallclock is not None): if( loop_end_time is not None): loop_duration = loop_end_time - loop_start_time we_cur_wallclock += loop_duration if( we_cur_wallclock + loop_duration * 2.0 > max_wallclock ): log.info('Shutdown so walltime does not exceed max wallclock:%r'%(max_wallclock)) self.shutdown(0) sys.exit(0) loop_start_time = time.time() try: if self.worker.worker_is_master(): log.info('DEBUG: %r %r prepare iteration' % (debug_name,time.time())) self.prepare_iteration() current_iteration = self.we_iter.n_iter log.info('WE iteration %d (of %d requested)' % (current_iteration, self.max_iterations)) n_inc = self.data_manager.num_incomplete_segments(self.we_iter) log.info('%d segments remaining in WE iteration %d' % (n_inc, current_iteration)) if n_inc == 0: log.info('DEBUG: %r %r n_inc==0' % (debug_name,time.time())) segments = self.data_manager.get_segments(self.we_iter.n_iter, load_p_parent = True) max_seg_id = max([s.seg_id for s in segments]) segments = self.run_we(segments = segments) self.worker.post_iter(self.we_iter) self.finalize_iteration() continue if segments is None: log.info('DEBUG: %r %r segment is None' % (debug_name,time.time())) segments = self.data_manager.get_segments(self.we_iter.n_iter, status_criteria = Segment.SEG_STATUS_PREPARED, load_p_parent = True) if not segments: log.warn('restarting %d incomplete segments' % n_inc) segments = self.data_manager.get_segments(self.we_iter.n_iter, status_criteria = Segment.SEG_STATUS_COMPLETE, status_negate = True, load_p_parent = True) max_seg_id = self.data_manager.get_max_seg_id(self.we_iter.n_iter) incomplete_segs = True if incomplete_segs == False: prev_max_seg_id = max_seg_id seg_ids = [s.seg_id for s in segments if s.seg_id is not None] if len(seg_ids) > 0: max_seg_id = max(seg_ids) else: max_seg_id = None if max_seg_id is None: log.info('DEBUG: %r %r assign segids' % (debug_name,time.time())) if prev_max_seg_id is None: prev_max_seg_id = self.data_manager.get_max_seg_id(self.we_iter.n_iter - 1) for i in xrange(0,len(segments)): segments[i].seg_id = prev_max_seg_id + i + 1 max_seg_id = segments[-1].seg_id log.info('DEBUG: %r %r propagate_particles' % (debug_name,time.time())) segments = self.worker.propagate_particles(self.we_iter, segments) if self.worker.worker_is_master(): log.info('DEBUG: %r %r update segments' % (debug_name,time.time())) self.data_manager.update_segments(self.we_iter, list(segments)) except: log.info('DEBUG: %r %r shutdown !!!' % (debug_name,time.time())) self.shutdown(EX_ERROR) raise sys.exit(EX_ERROR) if self.worker.worker_is_master(): log.info('DEBUG: %r %r run_we' % (debug_name,time.time())) if incomplete_segs: segments = self.data_manager.get_segments(self.we_iter.n_iter, load_p_parent = True) incomplete_segs = False segments = self.run_we(segments = segments) log.info('DEBUG: %r %r post_iter/finalize_iter' % (debug_name,time.time())) self.worker.post_iter(self.we_iter) self.finalize_iteration() log.info('DEBUG: %r %r worker finalize_iter' % (debug_name,time.time())) self.worker.finalize_iteration() if(max_wallclock is not None): loop_end_time = time.time() log.info('DEBUG: %r end of loop %r' % (debug_name,time.time())) | super(DefaultSimManager,self).__init__() self.max_iterations = 1 self.worker_blocksize = 1 def runtime_init(self, runtime_config, load_sim_config = True): super(DefaultSimManager, self).runtime_init(runtime_config, load_sim_config) self.max_iterations = runtime_config.get_int('limits.max_iterations', 1) try: max_wallclock_list = runtime_config.get_list('limits.max_wallclock', type=float, split=':') self.max_wallclock = max_wallclock_list[0]*60*60+max_wallclock_list[1]*60+max_wallclock_list[2] self.start_wallclock = time.time() except KeyError: self.max_wallclock = None self.start_wallclock = None self.worker_blocksize = runtime_config.get_int('backend.blocksize', 1) | def __init__(self): # Runtime configuration; can be changed between invocations (to change file locations, etc) self.runtime_config = None | 701db2728330d757dd095b3f8eefa47128a64ccb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6168/701db2728330d757dd095b3f8eefa47128a64ccb/default.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
2509,
1664,
31,
848,
506,
3550,
3086,
27849,
261,
869,
2549,
585,
7838,
16,
5527,
13,
365,
18,
9448,
67,
1425,
273,
599,
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,
1001,
2738,
972,
12,
2890,
4672,
468,
2509,
1664,
31,
848,
506,
3550,
3086,
27849,
261,
869,
2549,
585,
7838,
16,
5527,
13,
365,
18,
9448,
67,
1425,
273,
599,
2,
-100,
-100,
-100,
-100... |
self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid)) | try: self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid)) except sqlite.IntegrityError: pass | def set_authors(self, id, authors): ''' @param authors: A list of authors. ''' self.conn.execute('DELETE FROM books_authors_link WHERE book=?',(id,)) for a in authors: if not a: continue a = a.strip() author = self.conn.execute('SELECT id from authors WHERE name=?', (a,)).fetchone() if author: aid = author[0] # Handle change of case self.conn.execute('UPDATE authors SET name=? WHERE id=?', (a, aid)) else: aid = self.conn.execute('INSERT INTO authors(name) VALUES (?)', (a,)).lastrowid self.conn.execute('INSERT INTO books_authors_link(book, author) VALUES (?,?)', (id, aid)) self.conn.commit() | 57ff561aff5518dfd8ee9545074aeb954679b390 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/57ff561aff5518dfd8ee9545074aeb954679b390/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
19368,
12,
2890,
16,
612,
16,
14494,
4672,
9163,
632,
891,
14494,
30,
432,
666,
434,
14494,
18,
9163,
365,
18,
4646,
18,
8837,
2668,
6460,
4571,
6978,
87,
67,
19368,
67,
1232,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19368,
12,
2890,
16,
612,
16,
14494,
4672,
9163,
632,
891,
14494,
30,
432,
666,
434,
14494,
18,
9163,
365,
18,
4646,
18,
8837,
2668,
6460,
4571,
6978,
87,
67,
19368,
67,
1232,... |
<pForm> : form not to be re-drawn temporarly | @params: <pForm> : pointer to form not to be re-drawn temporarly | def fl_freeze_form(pForm): """ fl_freeze_form(pForm) It does not temporarily redraw a form while changes are being made, so all changes made are instead buffered internally. <pForm> : form not to be re-drawn temporarly """ _fl_freeze_form = cfuncproto( load_so_libforms(), "fl_freeze_form", \ None, [cty.POINTER(FL_FORM)], \ """void fl_freeze_form(FL_FORM * form) """) keep_elem_refs(pForm) _fl_freeze_form(pForm) | bd6cf497d94f877a33a2bba90b9d74b9e4c950cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/bd6cf497d94f877a33a2bba90b9d74b9e4c950cb/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
29631,
67,
687,
12,
84,
1204,
4672,
3536,
1183,
67,
29631,
67,
687,
12,
84,
1204,
13,
2597,
1552,
486,
18917,
16540,
279,
646,
1323,
3478,
854,
3832,
7165,
16,
1427,
777,
347... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
29631,
67,
687,
12,
84,
1204,
4672,
3536,
1183,
67,
29631,
67,
687,
12,
84,
1204,
13,
2597,
1552,
486,
18917,
16540,
279,
646,
1323,
3478,
854,
3832,
7165,
16,
1427,
777,
347... |
self.choose_possible_deformations() | self.choose_possible_deformations(first=True) | def __init__(self, gui): Simulation.__init__(self, gui) self.set_title("Homogeneous scaling") vbox = gtk.VBox() self.packtext(vbox, "XXXX Bla bla bla.") self.packimageselection(vbox) pack(vbox, gtk.Label("")) | f279a17bf375cb074bc23f77fea9ebb0cd25fd4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5572/f279a17bf375cb074bc23f77fea9ebb0cd25fd4d/scaling.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13238,
4672,
9587,
6234,
16186,
2738,
972,
12,
2890,
16,
13238,
13,
365,
18,
542,
67,
2649,
2932,
44,
362,
30075,
1481,
10612,
7923,
331,
2147,
273,
22718,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13238,
4672,
9587,
6234,
16186,
2738,
972,
12,
2890,
16,
13238,
13,
365,
18,
542,
67,
2649,
2932,
44,
362,
30075,
1481,
10612,
7923,
331,
2147,
273,
22718,... |
[(word: 111, word: 111, None)] | [(word: 111, word: 111, word: 1)] | def rauzy_graph(self, n): r""" Returns the Rauzy graph of the factors of length n of self. | 475cb7fff73a8e5079540a881833d4140abb4165 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/475cb7fff73a8e5079540a881833d4140abb4165/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
767,
89,
21832,
67,
4660,
12,
2890,
16,
290,
4672,
436,
8395,
2860,
326,
534,
8377,
21832,
2667,
434,
326,
14490,
434,
769,
290,
434,
365,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
767,
89,
21832,
67,
4660,
12,
2890,
16,
290,
4672,
436,
8395,
2860,
326,
534,
8377,
21832,
2667,
434,
326,
14490,
434,
769,
290,
434,
365,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
user_settings = module_to_dict(settings._target) db_host = user_settings['DATABASE_HOST'] db_port = user_settings['DATABASE_PORT'] db_pass = user_settings['DATABASE_PASSWORD'] db_name = user_settings['DATABASE_NAME'] db_user = user_settings['DATABASE_USER'] | db_host = settings.DATABASE_HOST db_port = settings.DATABASE_PORT db_pass = settings.DATABASE_PASSWORD db_name = settings.DATABASE_NAME db_user = settings.DATABASE_USER | def handle_noargs(self, **options): """Delete the old database.""" from django.conf import settings # Because settings are imported lazily, we need to explicitly load them. settings._import_settings() engine = settings.DATABASE_ENGINE user_settings = module_to_dict(settings._target) #engine = user_settings['DATABASE_ENGINE'] db_host = user_settings['DATABASE_HOST'] db_port = user_settings['DATABASE_PORT'] db_pass = user_settings['DATABASE_PASSWORD'] db_name = user_settings['DATABASE_NAME'] db_user = user_settings['DATABASE_USER'] | bbc0388f942a549e55106dbc588a667728e693e8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/171/bbc0388f942a549e55106dbc588a667728e693e8/delete_all_dbs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2135,
1968,
12,
2890,
16,
2826,
2116,
4672,
3536,
2613,
326,
1592,
2063,
12123,
628,
13710,
18,
3923,
1930,
1947,
468,
15191,
1947,
854,
9101,
25047,
16,
732,
1608,
358,
8122,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2135,
1968,
12,
2890,
16,
2826,
2116,
4672,
3536,
2613,
326,
1592,
2063,
12123,
628,
13710,
18,
3923,
1930,
1947,
468,
15191,
1947,
854,
9101,
25047,
16,
732,
1608,
358,
8122,
... |
add_cover_image(key, ia) | add_cover_image(ret, ia) return print 'run work finder' for a in authors: akey = a['key'] title_redirects = find_title_redirects(akey) works = find_works(akey, get_books(akey, books_query(akey)), existing=title_redirects) works = list(works) updated = update_works(akey, works, do_updates=True) | def write_edition(ia, edition): loc = 'ia:' + ia add_lang(edition) q = build_query(loc, edition) authors = [] for a in q.get('authors', []): if 'key' in a: authors.append({'key': a['key']}) else: try: ret = ol.new(a, comment='new author') except: print a raise print 'ret:', ret assert isinstance(ret, basestring) authors.append({'key': ret}) q['source_records'] = [loc] if authors: q['authors'] = authors for attempt in range(50): if attempt > 0: print 'retrying' try: ret = ol.new(q, comment='initial import') except httplib.BadStatusLine: sleep(30) continue except: # httplib.BadStatusLine print q raise break print 'ret:', ret assert isinstance(ret, basestring) key = ret pool.update(key, q) print 'add_cover_image' add_cover_image(key, ia) | 0ca2ba9abef7bc4e7a966877772b3d83199b1c48 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/0ca2ba9abef7bc4e7a966877772b3d83199b1c48/load_scribe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
329,
608,
12,
1155,
16,
28432,
4672,
1515,
273,
296,
1155,
2497,
397,
20389,
527,
67,
4936,
12,
329,
608,
13,
1043,
273,
1361,
67,
2271,
12,
1829,
16,
28432,
13,
14494,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
329,
608,
12,
1155,
16,
28432,
4672,
1515,
273,
296,
1155,
2497,
397,
20389,
527,
67,
4936,
12,
329,
608,
13,
1043,
273,
1361,
67,
2271,
12,
1829,
16,
28432,
13,
14494,
273,
... |
"""Utility function to split the given name, in "Last Name, First Initial" format, into its constituent parts. Will always return a two-tuple, which will contain the last name and first initial or two empty strings.""" if name.strip() and self.input.get('start-time','').strip() == '' and self.input.get('end-time','').strip() == '': | """Utility function to split the given name, in "Last Name, First Initial" format, into its constituent parts. Will always return a two-tuple, which will contain the last name and first initial or two empty strings.""" if name.strip() and self.input.get('start-time','').strip() == ''\ and self.input.get('end-time','').strip() == '': | def __get_faculty_names(self, name): """Utility function to split the given name, in "Last Name, First Initial" format, into its constituent parts. Will always return a two-tuple, which will contain the last name and first initial or two empty strings.""" | 20eab91c91a9f72ec790d8c5d1fb9261b7b89028 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4025/20eab91c91a9f72ec790d8c5d1fb9261b7b89028/formatters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
11639,
406,
93,
67,
1973,
12,
2890,
16,
508,
4672,
3536,
6497,
445,
358,
1416,
326,
864,
508,
16,
316,
315,
3024,
1770,
16,
5783,
10188,
6,
740,
16,
1368,
2097,
29152,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
11639,
406,
93,
67,
1973,
12,
2890,
16,
508,
4672,
3536,
6497,
445,
358,
1416,
326,
864,
508,
16,
316,
315,
3024,
1770,
16,
5783,
10188,
6,
740,
16,
1368,
2097,
29152,
... |
datetime = datetime.utcfromtimestamp(datetime) | datetime = datetime_.utcfromtimestamp(datetime) | def format_datetime(datetime=None, format='medium', tzinfo=None, locale=LC_TIME): """Return a date formatted according to the given pattern. >>> dt = datetime(2007, 04, 01, 15, 30) >>> format_datetime(dt, locale='en_US') u'Apr 1, 2007 3:30:00 PM' For any pattern requiring the display of the time-zone, the third-party ``pytz`` package is needed to explicitly specify the time-zone: >>> from pytz import timezone >>> format_datetime(dt, 'full', tzinfo=timezone('Europe/Paris'), ... locale='fr_FR') u'dimanche 1 avril 2007 17:30:00 HEC' >>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz", ... tzinfo=timezone('US/Eastern'), locale='en') u'2007.04.01 AD at 11:30:00 EDT' :param datetime: the `datetime` object; if `None`, the current date and time is used :param format: one of "full", "long", "medium", or "short", or a custom date/time pattern :param tzinfo: the timezone to apply to the time for display :param locale: a `Locale` object or a locale identifier :rtype: `unicode` """ if datetime is None: datetime = datetime_.utcnow() elif isinstance(datetime, (int, long)): datetime = datetime.utcfromtimestamp(datetime) elif isinstance(datetime, time): datetime = datetime_.combine(date.today(), datetime) if datetime.tzinfo is None: datetime = datetime.replace(tzinfo=UTC) if tzinfo is not None: datetime = datetime.astimezone(tzinfo) if hasattr(tzinfo, 'normalize'): # pytz datetime = tzinfo.normalize(datetime) locale = Locale.parse(locale) if format in ('full', 'long', 'medium', 'short'): return get_datetime_format(format, locale=locale) \ .replace('{0}', format_time(datetime, format, tzinfo=None, locale=locale)) \ .replace('{1}', format_date(datetime, format, locale=locale)) else: return parse_pattern(format).apply(datetime, locale) | deae48d9a410fc2d52b84cad9484073934dccb1a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8909/deae48d9a410fc2d52b84cad9484073934dccb1a/dates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
6585,
12,
6585,
33,
7036,
16,
740,
2218,
19011,
2187,
15732,
33,
7036,
16,
2573,
33,
13394,
67,
4684,
4672,
3536,
990,
279,
1509,
4955,
4888,
358,
326,
864,
1936,
18,
225,
408... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
67,
6585,
12,
6585,
33,
7036,
16,
740,
2218,
19011,
2187,
15732,
33,
7036,
16,
2573,
33,
13394,
67,
4684,
4672,
3536,
990,
279,
1509,
4955,
4888,
358,
326,
864,
1936,
18,
225,
408... |
suites = utils.to_list(suites) | suites = [ (name, name) for name in utils.to_list(suites) ] | def filter_by_names(self, suites=None, tests=None): suites = utils.to_list(suites) tests = utils.to_list(tests) if suites == [] and tests == []: return if not self._filter_by_names(suites, tests): self._raise_no_tests_filtered_by_names(suites, tests) | ab2c9fcecadba021b0b198124832914c03875027 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/ab2c9fcecadba021b0b198124832914c03875027/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1034,
67,
1637,
67,
1973,
12,
2890,
16,
27208,
33,
7036,
16,
7434,
33,
7036,
4672,
27208,
273,
306,
261,
529,
16,
508,
13,
364,
508,
316,
2990,
18,
869,
67,
1098,
12,
26560,
2997,
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,
1034,
67,
1637,
67,
1973,
12,
2890,
16,
27208,
33,
7036,
16,
7434,
33,
7036,
4672,
27208,
273,
306,
261,
529,
16,
508,
13,
364,
508,
316,
2990,
18,
869,
67,
1098,
12,
26560,
2997,
13... |
if type == 'head' | if type == 'head': | def __init__(self, inspJob, procParams, ifo, trig, cp,opts,dag, type='plot',sngl_table = None): try: inspiral.InspiralNode.__init__(self, inspJob) injFile = self.checkInjections(cp) | 2dc2e350726e2e7ea364221fc50017bc2cae21ec /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/2dc2e350726e2e7ea364221fc50017bc2cae21ec/fu_Condor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
618,
2218,
4032,
2187,
87,
3368,
80,
67,
2121,
273,
599,
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,
1001,
2738,
972,
12,
2890,
16,
316,
1752,
2278,
16,
5418,
1370,
16,
21479,
16,
23142,
16,
3283,
16,
4952,
16,
30204,
16,
618,
2218,
4032,
2187,
87,
3368,
80,
67,
2121,
273,
599,
4672,
... |
'blurrable' : True, | def copy(self): """ Return a copy of widget instance, consisting of field name and properties dictionary. """ cdict = dict(vars(self)) properties = deepcopy(cdict) return self.__class__(**properties) | f7c24772f8477316e3ed7b3e50de518e8bf5f593 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12165/f7c24772f8477316e3ed7b3e50de518e8bf5f593/Widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
3604,
791,
16,
23570,
434,
652,
508,
471,
1790,
3880,
18,
3536,
276,
1576,
273,
2065,
12,
4699,
12,
2890,
3719,
1790,
273,
7217,
12,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
3604,
791,
16,
23570,
434,
652,
508,
471,
1790,
3880,
18,
3536,
276,
1576,
273,
2065,
12,
4699,
12,
2890,
3719,
1790,
273,
7217,
12,
7... | |
sheets = self.read(cr, uid, ids, ['state']) if any(s['state'] in ('confirm', 'done') for s in sheets): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sheet(s) which are already confirmed !')) | sheets = self.read(cr, uid, ids, ['state','total_attendance']) for sheet in sheets: if sheet['state'] in ('confirm', 'done'): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sheet(s) which are already confirmed !')) elif sheet['total_attendance'] <> 0.00: raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sheet(s) which have attendance entries encoded !')) | def unlink(self, cr, uid, ids, context=None): sheets = self.read(cr, uid, ids, ['state']) if any(s['state'] in ('confirm', 'done') for s in sheets): raise osv.except_osv(_('Invalid action !'), _('Cannot delete Sheet(s) which are already confirmed !')) return super(hr_timesheet_sheet, self).unlink(cr, uid, ids, context=context) | f5a36da0c15e9e18a36a253981bbaaf5054fae7b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f5a36da0c15e9e18a36a253981bbaaf5054fae7b/hr_timesheet_sheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
25273,
273,
365,
18,
896,
12,
3353,
16,
4555,
16,
3258,
16,
10228,
2019,
17023,
4963,
67,
4558,
409,
1359,
19486,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
25273,
273,
365,
18,
896,
12,
3353,
16,
4555,
16,
3258,
16,
10228,
2019,
17023,
4963,
67,
4558,
409,
1359,
19486,... |
self.x = x self.y = y def moveby(self, dx, dy): self.moveto(self.x + dx, self.y + dy) | def moveto(self, x, y): | a9b383de5cc662464dfbac36854b1d4ca07c0a0c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a9b383de5cc662464dfbac36854b1d4ca07c0a0c/solitaire.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5730,
11453,
12,
2890,
16,
619,
16,
677,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5730,
11453,
12,
2890,
16,
619,
16,
677,
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,
... | |
body = block_unwrap(body) | body, hasBlock = block_unwrap(body) | def __for_in(node): # Optional variable declarations varDecl = getattr(node, "varDecl", None) # Body is optional - at least in comprehensions tails body = getattr(node, "body", None) if body: body = block_unwrap(body) else: body = "" return "for(%s in %s)%s" % (compress(node.iterator), compress(node.object), body) | dc4be74e05f8704c44c6e99305663d8c2247a4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/dc4be74e05f8704c44c6e99305663d8c2247a4b3/Compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1884,
67,
267,
12,
2159,
4672,
468,
4055,
2190,
12312,
569,
3456,
273,
3869,
12,
2159,
16,
315,
1401,
3456,
3113,
599,
13,
225,
468,
5652,
353,
3129,
300,
622,
4520,
316,
1161,
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,
1001,
1884,
67,
267,
12,
2159,
4672,
468,
4055,
2190,
12312,
569,
3456,
273,
3869,
12,
2159,
16,
315,
1401,
3456,
3113,
599,
13,
225,
468,
5652,
353,
3129,
300,
622,
4520,
316,
1161,
2... |
header2 = self.tmpl_group_table_title(text=_("Waiting members")) | header2 = self.tmpl_group_table_title(text=_("Members awaiting approval")) | def tmpl_display_manage_member(self, grpID, group_name, members, pending_members, infos=[], warnings=[], ln=cdslang): """Display current members and waiting members of a group. Parameters: | 304840914b1d98a3b67f7a7fded57b0a48a94a45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/304840914b1d98a3b67f7a7fded57b0a48a94a45/websession_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
5417,
67,
12633,
67,
5990,
12,
2890,
16,
14295,
734,
16,
1041,
67,
529,
16,
4833,
16,
4634,
67,
7640,
16,
10626,
22850,
6487,
5599,
22850,
6487,
7211,
33,
4315,
2069,
539,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
5417,
67,
12633,
67,
5990,
12,
2890,
16,
14295,
734,
16,
1041,
67,
529,
16,
4833,
16,
4634,
67,
7640,
16,
10626,
22850,
6487,
5599,
22850,
6487,
7211,
33,
4315,
2069,
539,
4... |
dcg.grabDtellaTopic() | dch.grabDtellaTopic() | def syncComplete(self): | 56d6386ca5e6ab7608999d40425ac7092601dc16 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8524/56d6386ca5e6ab7608999d40425ac7092601dc16/dtella.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
6322,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3792,
6322,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if str( key ).startswith( str( checkedKey ) + '/' ): | if toUtf8(key).startswith(toUtf8(checkedKey) + '/'): | def parentChecked(self, index): key = self.key( index ) for checkedKey in [folder for folder in self.selectedFolders() if folder != key ]: if str( key ).startswith( str( checkedKey ) + '/' ): return True | 88197bb50adfe2d09ba36ab8c1821a6e4577c470 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11141/88197bb50adfe2d09ba36ab8c1821a6e4577c470/dirselector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
982,
11454,
12,
2890,
16,
770,
4672,
498,
273,
365,
18,
856,
12,
770,
262,
364,
5950,
653,
316,
306,
5609,
364,
3009,
316,
365,
18,
8109,
14885,
1435,
309,
3009,
480,
498,
308,
30,
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,
982,
11454,
12,
2890,
16,
770,
4672,
498,
273,
365,
18,
856,
12,
770,
262,
364,
5950,
653,
316,
306,
5609,
364,
3009,
316,
365,
18,
8109,
14885,
1435,
309,
3009,
480,
498,
308,
30,
3... |
if ((invalid(oid) and not hasattr(object, '_p_resolveConflict')) or invalid(None)): | if invalid(oid) and not hasattr(object, '_p_resolveConflict'): | def commit(self, object, transaction): if object is self: # We registered ourself. Execute a commit action, if any. if self.__onCommitActions is not None: method_name, args, kw = self.__onCommitActions.pop(0) apply(getattr(self, method_name), (transaction,) + args, kw) return oid = object._p_oid invalid = self._invalid if oid is None or object._p_jar is not self: # new object oid = self.new_oid() object._p_jar = self object._p_oid = oid self._creating.append(oid) | 3864625806d3ff7ef2c87394f31ee0a6fa94234f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3864625806d3ff7ef2c87394f31ee0a6fa94234f/Connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2890,
16,
733,
16,
2492,
4672,
309,
733,
353,
365,
30,
468,
1660,
4104,
3134,
2890,
18,
225,
7903,
279,
3294,
1301,
16,
309,
1281,
18,
309,
365,
16186,
265,
5580,
6100,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2890,
16,
733,
16,
2492,
4672,
309,
733,
353,
365,
30,
468,
1660,
4104,
3134,
2890,
18,
225,
7903,
279,
3294,
1301,
16,
309,
1281,
18,
309,
365,
16186,
265,
5580,
6100,
353,
... |
ValueError: invalid literal for int(): ffffff | ValueError: invalid literal for int() with base 10: 'ffffff' | def HexColor(val, htmlOnly=False, alpha=False): """This function converts a hex string, or an actual integer number, into the corresponding color. E.g., in "#AABBCC" or 0xAABBCC, AA is the red, BB is the green, and CC is the blue (00-FF). An alpha value can also be given in the form #AABBCCDD or 0xAABBCCDD where DD is the alpha value. For completeness I assume that #aabbcc or 0xaabbcc are hex numbers otherwise a pure integer is converted as decimal rgb. If htmlOnly is true, only the #aabbcc form is allowed. >>> HexColor('#ffffff') Color(1,1,1) >>> HexColor('#FFFFFF') Color(1,1,1) >>> HexColor('0xffffff') Color(1,1,1) >>> HexColor('16777215') Color(1,1,1) An '0x' or '#' prefix is required for hex (as opposed to decimal): >>> HexColor('ffffff') Traceback (most recent call last): ValueError: invalid literal for int(): ffffff >>> HexColor('#FFFFFF', htmlOnly=True) Color(1,1,1) >>> HexColor('0xffffff', htmlOnly=True) Traceback (most recent call last): ValueError: not a hex string >>> HexColor('16777215', htmlOnly=True) Traceback (most recent call last): ValueError: not a hex string """ #" for emacs if isinstance(val,basestring): b = 10 if val[:1] == '#': val = val[1:] b = 16 if len(val) == 8: alpha = True else: if htmlOnly: raise ValueError('not a hex string') if val[:2].lower() == '0x': b = 16 val = val[2:] if len(val) == 8: alpha = True val = int(val,b) if alpha: return Color((val>>24)&0xFF/255.0,((val>>16)&0xFF)/255.0,((val>>8)&0xFF)/255.0,(val&0xFF)/255.0) return Color(((val>>16)&0xFF)/255.0,((val>>8)&0xFF)/255.0,(val&0xFF)/255.0) | ada77b22cd562c515451132957a1f948849dcae9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3878/ada77b22cd562c515451132957a1f948849dcae9/colors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15734,
2957,
12,
1125,
16,
1729,
3386,
33,
8381,
16,
4190,
33,
8381,
4672,
3536,
2503,
445,
7759,
279,
3827,
533,
16,
578,
392,
3214,
3571,
1300,
16,
1368,
326,
4656,
2036,
18,
225,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15734,
2957,
12,
1125,
16,
1729,
3386,
33,
8381,
16,
4190,
33,
8381,
4672,
3536,
2503,
445,
7759,
279,
3827,
533,
16,
578,
392,
3214,
3571,
1300,
16,
1368,
326,
4656,
2036,
18,
225,
51... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.