rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
cats = page.categories() | text = page.get() | def add_category(sort_by_last_name = False): ''' A robot to mass-add a category to a list of pages. ''' site = wikipedia.getSite() if gen: newcatTitle = wikipedia.input(u'Category to add (do not give namespace):') if not wikipedia.getSite().nocapitalize: newcatTitle = newcatTitle[:1].capitalize() + newcatTitle[1:] # set edit summary message wikipedia.setAction(wikipedia.translate(wikipedia.getSite(), msg_add) % newcatTitle) cat_namespace = wikipedia.getSite().category_namespaces()[0] answer = '' for page in gen: if answer != 'a': answer = '' while answer not in ('y','n','a'): answer = wikipedia.input(u'%s [y/n/a(ll)]:' % (page.aslink())) if answer == 'a': confirm = '' while confirm not in ('y','n'): confirm = wikipedia.input(u'This should be used if and only if you are sure that your links are correct! Are you sure? [y/n]:') if confirm == 'n': answer = '' if answer == 'y' or answer == 'a': try: cats = page.categories() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist yet. Ignoring." % (page.title())) pass except wikipedia.IsRedirectPage,arg: redirTarget = wikipedia.Page(site,arg.args[0]) wikipedia.output(u"WARNING: %s is redirect to %s. Ignoring." % (page.title(), redirTarget.title())) else: wikipedia.output(u"Current categories:") for cat in cats: wikipedia.output(u"* %s" % cat.title()) catpl = wikipedia.Page(site, cat_namespace + ':' + newcatTitle) if sort_by_last_name: catpl = sorted_by_last_name(catpl, page) if catpl in cats: wikipedia.output(u"%s is already in %s." % (page.title(), catpl.title())) else: wikipedia.output(u'Adding %s' % catpl.aslink()) cats.append(catpl) text = page.get() text = wikipedia.replaceCategoryLinks(text, cats) try: page.put(text) except wikipedia.EditConflict: wikipedia.output(u'Skipping %s because of edit conflict' % (page.title())) | 45008cced57caf61675ccb870b2711b7907b916c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/45008cced57caf61675ccb870b2711b7907b916c/category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
2834,
273,
21137,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4743,
12,
3804,
67,
1637,
67,
2722,
67,
529,
273,
1083,
4672,
9163,
432,
14386,
358,
8039,
17,
1289,
279,
3150,
358,
279,
666,
434,
4689,
18,
9163,
2834,
273,
21137,
18,
588,
... |
suffixes = "*." + " *.".join(suffix_map[obj_type]) | suffixes = "*" + " *".join(suffix_map[obj_type]) | def get_save_file_locator_from_gui(parent, obj_type, locator=None): # Ignore current locator for now # In the future, use locator to guide GUI for better starting directory suffixes = "*." + " *.".join(suffix_map[obj_type]) fileName = QtGui.QFileDialog.getSaveFileName( parent, "Save Vistrail...", core.system.vistrails_file_directory(), "VisTrails files (%s)" % suffixes, # filetypes.strip() None, QtGui.QFileDialog.DontConfirmOverwrite) if fileName.isEmpty(): return None f = str(fileName) # check for proper suffix found_suffix = False for suffix in suffix_map[obj_type]: if f.endswith(suffix): found_suffix = True break if not found_suffix: if obj_type == 'vistrail': f += get_vistrails_configuration().defaultFileType else: f += '.' + suffix_map[obj_type][0] if os.path.isfile(f): msg = QtGui.QMessageBox(QtGui.QMessageBox.Question, "VisTrails", "File exists. Overwrite?", (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), parent) if msg.exec_() == QtGui.QMessageBox.No: return None dirName = os.path.dirname(str(f)) setattr(get_vistrails_persistent_configuration(), 'fileDirectory', dirName) core.system.set_vistrails_file_directory(dirName) return FileLocator(f) | b6e60981558cdaaa9d03bfc9939c8c2ed09c98ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6341/b6e60981558cdaaa9d03bfc9939c8c2ed09c98ab/locator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5688,
67,
768,
67,
20048,
67,
2080,
67,
20292,
12,
2938,
16,
1081,
67,
723,
16,
8871,
33,
7036,
4672,
468,
8049,
783,
8871,
364,
2037,
468,
657,
326,
3563,
16,
999,
8871,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5688,
67,
768,
67,
20048,
67,
2080,
67,
20292,
12,
2938,
16,
1081,
67,
723,
16,
8871,
33,
7036,
4672,
468,
8049,
783,
8871,
364,
2037,
468,
657,
326,
3563,
16,
999,
8871,
35... |
setTimeout("server_ping_while_alive();", server_ping_time); | def notebook_lib(): s= r""" | 1521f06de5154c3561f96928efa10282a3541291 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/1521f06de5154c3561f96928efa10282a3541291/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
14718,
67,
2941,
13332,
272,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
baduser = True | wikipedia.output(u'The user has been blocked! Skip him..') continue | def DefineSign(welcomesite, SignPage): Page = wikipedia.Page(welcomesite, SignPage) SignText = Page.get() reg = "\* (.*?)\n" list_sign = re.findall(reg, SignText) return list_sign | bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13184,
2766,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
4672,
3460,
273,
21137,
18,
1964,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
13,
4383,
1528,
273,
3460,
18,
588,
1435,
960,
273,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13184,
2766,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
4672,
3460,
273,
21137,
18,
1964,
12,
91,
292,
10127,
1137,
16,
4383,
1964,
13,
4383,
1528,
273,
3460,
18,
588,
1435,
960,
273,
1... |
sage: Graph().longest_path(weighted = True) | sage: Graph().longest_path(weighted=True) | def longest_path(self, s = None, t = None, weighted = False, algorithm = "MILP", solver = None, verbose = 0): r""" Returns a longest path of ``self``. | 815c98d316de2356ea416011f877811bcf39fae3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/815c98d316de2356ea416011f877811bcf39fae3/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12163,
67,
803,
12,
2890,
16,
272,
273,
599,
16,
268,
273,
599,
16,
13747,
273,
1083,
16,
4886,
273,
315,
49,
2627,
52,
3113,
12776,
273,
599,
16,
3988,
273,
374,
4672,
436,
8395,
28... |
Numeric_det = linalg.determinant | basic_det = linalg.determinant | def check_random(self): from scipy.basic import linalg Numeric_det = linalg.determinant n = 20 for i in range(4): a = random([n,n]) d1 = det(a) d2 = Numeric_det(a) assert_almost_equal(d1,d2) | 7a2c431004271fb01e28862a93afb11b83c27914 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/7a2c431004271fb01e28862a93afb11b83c27914/test_basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9188,
12,
2890,
4672,
628,
10966,
18,
13240,
1930,
11818,
5337,
67,
8238,
273,
11818,
18,
72,
4443,
970,
290,
273,
4200,
364,
277,
316,
1048,
12,
24,
4672,
279,
273,
2744,
381... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9188,
12,
2890,
4672,
628,
10966,
18,
13240,
1930,
11818,
5337,
67,
8238,
273,
11818,
18,
72,
4443,
970,
290,
273,
4200,
364,
277,
316,
1048,
12,
24,
4672,
279,
273,
2744,
381... |
print 'fail with size = %d, data type = %d and method %s' % (sizes[k], i, methods[j]) | print 'fail with size = %d, data type = %d and method %s' % (sizes[k], datatypes[i], methods[j]) | def warp_19(): if test_cli_utilities.get_gdalwarp_path() is None: return 'skip' gdaltest.tiff_drv = gdal.GetDriverByName( 'GTiff' ) if gdaltest.tiff_drv is None: return 'skip' datatypes = [ gdal.GDT_Byte, gdal.GDT_Int16, gdal.GDT_CInt16, gdal.GDT_UInt16, gdal.GDT_Int32, gdal.GDT_CInt32, gdal.GDT_UInt32, gdal.GDT_Float32, gdal.GDT_CFloat32, gdal.GDT_Float64, gdal.GDT_CFloat64 ] methods = [ 'near', 'bilinear', 'cubic', 'cubicspline', 'lanczos' ] sizes = [ 1, 2, 3, 7 ] for k in range(len(sizes)): print 'Testing size = %d ...' % (sizes[k]) for j in range(len(methods)): for i in range(len(datatypes)): if warp_19_internal(sizes[k], datatypes[i], methods[j]) != 'success': print 'fail with size = %d, data type = %d and method %s' % (sizes[k], i, methods[j]) return 'fail' return 'success' | 9230bc33bbb747d7030130a625f6575a967c2102 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10290/9230bc33bbb747d7030130a625f6575a967c2102/warp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
67,
3657,
13332,
225,
309,
1842,
67,
4857,
67,
1367,
1961,
18,
588,
67,
19016,
287,
905,
84,
67,
803,
1435,
353,
599,
30,
327,
296,
7457,
11,
225,
15551,
2390,
395,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
11441,
67,
3657,
13332,
225,
309,
1842,
67,
4857,
67,
1367,
1961,
18,
588,
67,
19016,
287,
905,
84,
67,
803,
1435,
353,
599,
30,
327,
296,
7457,
11,
225,
15551,
2390,
395,
18,
8... |
def setClassifier(self, c, id): | def setPredictor(self, predictor, id): | def setClassifier(self, c, id): """handles incoming classifier (prediction, as could be a regressor as well)""" if not c: if self.classifiers.has_key(id): del self.classifiers[id] if len(self.classifiers) == 0: self.outvar = None else: self.warning(id, "") else: if len(self.classifiers) and c.classVar <> self.outvar: vartypes = {1:"discrete", 2:"continuous"} self.warning(id, "Predictor %s is ignored due to inconsistent outcome variables\n%s/%s <> %s/%s (type or variable mismatch)" % (c.name, c.classVar.name, vartypes.get(c.classVar.varType, "?"), self.outvar.name, vartypes.get(self.outvar.varType, "?"))) return else: self.outvar = c.classVar self.classifiers[id] = c | 63e34d56e155a4f1aba288f36a71868771294735 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/63e34d56e155a4f1aba288f36a71868771294735/OWPredictions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
21362,
280,
12,
2890,
16,
7810,
280,
16,
612,
4672,
3536,
24111,
6935,
14622,
261,
15803,
16,
487,
3377,
506,
279,
960,
663,
280,
487,
5492,
15574,
309,
486,
276,
30,
309,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
21362,
280,
12,
2890,
16,
7810,
280,
16,
612,
4672,
3536,
24111,
6935,
14622,
261,
15803,
16,
487,
3377,
506,
279,
960,
663,
280,
487,
5492,
15574,
309,
486,
276,
30,
309,
365,
18... |
>>> rev_merger(keys, rev_twdict) | >>> rev_merger(keys, rev_twdict, True) | def rev_merger(anno_dict, use_dict, verbose=True): """ merge extra bindings into reverse dict | 2a50941be1a6c8368a3d1c517506ec114dd7579d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1969/2a50941be1a6c8368a3d1c517506ec114dd7579d/pyzh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5588,
67,
6592,
693,
12,
1072,
83,
67,
1576,
16,
999,
67,
1576,
16,
3988,
33,
5510,
4672,
3536,
2691,
2870,
7394,
1368,
4219,
2065,
225,
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,
5588,
67,
6592,
693,
12,
1072,
83,
67,
1576,
16,
999,
67,
1576,
16,
3988,
33,
5510,
4672,
3536,
2691,
2870,
7394,
1368,
4219,
2065,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print >> self.fileobj, repr(list(os.times())+ [getruntime()]) | print >> self.fileobj, repr(currenttimes+ [getruntime()]) | def run(self): # run forever (only exit if an error occurs) while True: try: # tell the monitoring process about my cpu information... print >> self.fileobj, repr(list(os.times())+ [getruntime()]) self.fileobj.flush() | db068eb508d1e3adc21c062b6f49137c9bce75fc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7272/db068eb508d1e3adc21c062b6f49137c9bce75fc/nonportable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
1086,
21238,
261,
3700,
2427,
309,
392,
555,
9938,
13,
1323,
1053,
30,
775,
30,
468,
9276,
326,
16309,
1207,
2973,
3399,
8326,
1779,
2777,
1172,
1671,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
1086,
21238,
261,
3700,
2427,
309,
392,
555,
9938,
13,
1323,
1053,
30,
775,
30,
468,
9276,
326,
16309,
1207,
2973,
3399,
8326,
1779,
2777,
1172,
1671,
365,
18,... |
result += ' "-sTOOLS=%s"' % string.join( string.split( toolsets, ',' ), ' ' ) result += ' "-sBOOST_ROOT=%s"' % boost_root | result += '-sTOOLS=%s' % string.join( string.split( toolsets, ',' ), ' ' ) | def bjam_command( toolsets ): result = '"%s"' % tool_path( bjam ) if not toolsets is None: result += ' "-sTOOLS=%s"' % string.join( string.split( toolsets, ',' ), ' ' ) result += ' "-sBOOST_ROOT=%s"' % boost_root return result | cb3bf0e2aaf71156423e0967a9e6571cb015a2e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/cb3bf0e2aaf71156423e0967a9e6571cb015a2e5/regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
78,
301,
67,
3076,
12,
5226,
4424,
262,
30,
563,
273,
22563,
87,
5187,
738,
5226,
67,
803,
12,
324,
78,
301,
262,
309,
486,
5226,
4424,
353,
599,
30,
563,
1011,
2400,
87,
26263,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
324,
78,
301,
67,
3076,
12,
5226,
4424,
262,
30,
563,
273,
22563,
87,
5187,
738,
5226,
67,
803,
12,
324,
78,
301,
262,
309,
486,
5226,
4424,
353,
599,
30,
563,
1011,
2400,
87,
26263,... |
def delete(self, *args, **kwargs): proxy = xmlrpclib.ServerProxy(settings.DATASTORE_PROXY) proxy.reload_datastore() | proxy = xmlrpclib.ServerProxy(settings.DATASTORE_PROXY) proxy.reload_datastore() def delete(self, *args, **kwargs): | def save(self, *args, **kwargs): proxy = xmlrpclib.ServerProxy(settings.DATASTORE_PROXY) proxy.reload_datastore() super(Location, self).save(*args, **kwargs) | af9bfca2a7f8ee1bd988d20a9d41ae1f79408f57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11540/af9bfca2a7f8ee1bd988d20a9d41ae1f79408f57/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2889,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
4272,
18,
4883,
13651,
67,
16085,
13,
2889,
18,
17517,
67,
24522,
1435,
2240,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1923,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
2889,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
4272,
18,
4883,
13651,
67,
16085,
13,
2889,
18,
17517,
67,
24522,
1435,
2240,
... |
self.log(DangerousStyleAttr({"parent":self.parent.name, "element":self.name, "attr":"style", "valu3":evil})) | self.log(DangerousStyleAttr({"parent":self.parent.name, "element":self.name, "attr":"style", "value":evil})) | def validateSafe(self,value): htmlValidator = HTMLValidator(value) if not htmlValidator.messages: self.log(ValidHtml({"parent":self.parent.name, "element":self.name,"value":self.value})) for message in htmlValidator.messages: self.log(NotHtml({"parent":self.parent.name, "element":self.name,"value":self.value, "message": message})) for evil in htmlValidator.scripts: self.log(SecurityRisk({"parent":self.parent.name, "element":self.name, "tag":evil})) for evil in htmlValidator.styleattrs: self.log(DangerousStyleAttr({"parent":self.parent.name, "element":self.name, "attr":"style", "valu3":evil})) for evil in htmlValidator.scriptattrs: self.log(SecurityRiskAttr({"parent":self.parent.name, "element":self.name, "attr":evil})) | d43ee14824d90eabaf6975cfdbad608085101d9e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5012/d43ee14824d90eabaf6975cfdbad608085101d9e/validators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
9890,
12,
2890,
16,
1132,
4672,
1729,
5126,
273,
3982,
5126,
12,
1132,
13,
309,
486,
1729,
5126,
18,
6833,
30,
365,
18,
1330,
12,
1556,
4353,
12590,
6,
2938,
6877,
2890,
18,
2938... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1954,
9890,
12,
2890,
16,
1132,
4672,
1729,
5126,
273,
3982,
5126,
12,
1132,
13,
309,
486,
1729,
5126,
18,
6833,
30,
365,
18,
1330,
12,
1556,
4353,
12590,
6,
2938,
6877,
2890,
18,
2938... |
template = generate_template(M-l, K-l*Kshared, Kshared, wt) W[l:M, offset_i:offset_i+K-l*Kshared] = template offset_i += K-l*Kshared | template = generate_template(M-l, K-Kshared_offset, Kshared, wt) W[l:M, offset_i:offset_i+K-Kshared_offset] = template offset_i += K-Kshared_offset Kshared_offset += Kshared | def create_noise_connectivity_matrix_fixed_pairwise(M, Nnoise, gamma, g, w, epsilon): NE = int(gamma * Nnoise) NI = int(Nnoise - NE) KE = int(epsilon * NE) KI = int(epsilon * NI) KEshared = 0 KIshared = 0 if NE > 0: KEshared = int(1. * KE**2 / NE) if NI > 0: KIshared = int(1. * KI**2 / NI) # check whether it is possible to realize desired connectivity; # this translate to (M - 1 ) * epsilon <= 1 assert(KEshared * (M - 1) <= KE), '[error] impossible parameter choices' assert(KIshared * (M - 1) <= KI), '[error] impossible parameter choices' # the two next conditions are fullfilled if the two conditions # above are fullfilled; they are left in for documentation assert(M*(KE-KEshared) <= NE) assert(M*(KI-KIshared) <= NI) W = np.zeros((M, NE+NI)) for k in xrange(2): K = [KE, KI][k] Kshared = [KEshared, KIshared][k] wt = [w, -g*w][k] if K > 0: offset_i = k*NE for l in xrange(M-1): template = generate_template(M-l, K-l*Kshared, Kshared, wt) W[l:M, offset_i:offset_i+K-l*Kshared] = template offset_i += K-l*Kshared return W | 221e14c66ac2d70cdbc23d7f462177acecfac554 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6301/221e14c66ac2d70cdbc23d7f462177acecfac554/helper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
17814,
67,
3612,
2818,
67,
5667,
67,
12429,
67,
6017,
2460,
12,
49,
16,
423,
17814,
16,
9601,
16,
314,
16,
341,
16,
12263,
4672,
12901,
273,
509,
12,
20589,
380,
423,
17814,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
17814,
67,
3612,
2818,
67,
5667,
67,
12429,
67,
6017,
2460,
12,
49,
16,
423,
17814,
16,
9601,
16,
314,
16,
341,
16,
12263,
4672,
12901,
273,
509,
12,
20589,
380,
423,
17814,
... |
while j > 0: | while j >= 0: | def prettyOut(self, value): names = [] octets = tuple(map(None, str(value))) i = 0 while i < len(octets): v = ord(octets[i]) j = 7 while j > 0: if v & (0x01<<j): name = self.__namedValues.getName(i*8+7-j) if name is None: raise error.ProtocolError( 'Unknown named value %s' % v ) names.append(name) j = j - 1 i = i + 1 return string.join(map(lambda x: str(x), names), ', ') | 06c097eb719158f56c8653de8907577dfbf0884c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/06c097eb719158f56c8653de8907577dfbf0884c/rfc1902.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
1182,
12,
2890,
16,
460,
4672,
1257,
273,
5378,
25497,
273,
3193,
12,
1458,
12,
7036,
16,
609,
12,
1132,
20349,
277,
273,
374,
1323,
277,
411,
562,
12,
13410,
2413,
4672,
331,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7517,
1182,
12,
2890,
16,
460,
4672,
1257,
273,
5378,
25497,
273,
3193,
12,
1458,
12,
7036,
16,
609,
12,
1132,
20349,
277,
273,
374,
1323,
277,
411,
562,
12,
13410,
2413,
4672,
331,
27... |
def dispatch_departure(self, node, method_name): | def dispatch_departure(self, node): node_name = node.__class__.__name__ | def dispatch_departure(self, node, method_name): method = getattr(self, 'depart_' + method_name, self.unknown_departure) return method(node) | 41ec3151e9193001efadd991606c3e15505afa0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/41ec3151e9193001efadd991606c3e15505afa0d/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
67,
323,
2680,
594,
12,
2890,
16,
756,
4672,
756,
67,
529,
273,
756,
16186,
1106,
972,
16186,
529,
972,
707,
273,
3869,
12,
2890,
16,
296,
323,
2680,
4623,
397,
707,
67,
529,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3435,
67,
323,
2680,
594,
12,
2890,
16,
756,
4672,
756,
67,
529,
273,
756,
16186,
1106,
972,
16186,
529,
972,
707,
273,
3869,
12,
2890,
16,
296,
323,
2680,
4623,
397,
707,
67,
529,
1... |
sage: V.M | sage: V.M | def set_magma_attribute(self, attrname, value): """ INPUTS: attrname -- string value -- something coercible to a MagmaElement | 06891bc866b47f420feaea6eefc08baf44cc4cb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/06891bc866b47f420feaea6eefc08baf44cc4cb9/magma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4527,
2540,
67,
4589,
12,
2890,
16,
1604,
529,
16,
460,
4672,
3536,
12943,
55,
30,
1604,
529,
1493,
533,
460,
1493,
5943,
1825,
12610,
1523,
358,
279,
490,
9454,
1046,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4527,
2540,
67,
4589,
12,
2890,
16,
1604,
529,
16,
460,
4672,
3536,
12943,
55,
30,
1604,
529,
1493,
533,
460,
1493,
5943,
1825,
12610,
1523,
358,
279,
490,
9454,
1046,
2,
-100... |
'certificate': terp.get('certificate'), | 'certificate': terp.get('certificate') or None, | def update_list(self, cr, uid, context={}): robj = self.pool.get('ir.module.repository') res = [0, 0] # [update, add] | 91e2f842616bfc85f06aae2ff954afa226496b59 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/91e2f842616bfc85f06aae2ff954afa226496b59/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1098,
12,
2890,
16,
4422,
16,
4555,
16,
819,
12938,
4672,
721,
441,
273,
365,
18,
6011,
18,
588,
2668,
481,
18,
2978,
18,
9071,
6134,
400,
273,
306,
20,
16,
374,
65,
468,
... |
'archidxfoot.html', d, raw=1, lang=mlist.preferred_language, | 'archidxfoot.html', d, | def html_foot(self): # avoid i18n side-effects mlist = self.maillist otrans = i18n.get_translation() i18n.set_language(mlist.preferred_language) try: d = {"lastdate": html_quote(i18n.ctime(self.lastdate)), "archivedate": html_quote(i18n.ctime(self.archivedate)), "listinfo": mlist.GetScriptURL('listinfo', absolute=1), "version": self.version, } i = {"thread": _("thread"), "subject": _("subject"), "author": _("author"), "date": _("date") } finally: i18n.set_translation(otrans) | 05680dc805dee943b5e1696ee9dfd280c934de1d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/05680dc805dee943b5e1696ee9dfd280c934de1d/HyperArch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
10923,
12,
2890,
4672,
468,
4543,
277,
2643,
82,
4889,
17,
13867,
87,
312,
1098,
273,
365,
18,
4408,
1098,
320,
2338,
273,
277,
2643,
82,
18,
588,
67,
10173,
1435,
277,
2643,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
67,
10923,
12,
2890,
4672,
468,
4543,
277,
2643,
82,
4889,
17,
13867,
87,
312,
1098,
273,
365,
18,
4408,
1098,
320,
2338,
273,
277,
2643,
82,
18,
588,
67,
10173,
1435,
277,
2643,... |
print "iq callback ", type, from_address, query, error | print "iq callback ", type, fromAddress, query, error | def HandleIq(self, iqElement): type = iqElement.getType() fromAddress = iqElement.getFrom() query = iqElement.getQuery() error = iqElement.getError() if query == 'jabber:iq:roster': self.NotifyPresenceChanged(fromAddress) print "iq callback ", type, from_address, query, error | 60aa9aa211cac0941cc271415a00ce1fe66a023f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/60aa9aa211cac0941cc271415a00ce1fe66a023f/ChandlerJabber.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
45,
85,
12,
2890,
16,
24288,
1046,
4672,
618,
273,
24288,
1046,
18,
588,
559,
1435,
628,
1887,
273,
24288,
1046,
18,
588,
1265,
1435,
843,
273,
24288,
1046,
18,
588,
1138,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5004,
45,
85,
12,
2890,
16,
24288,
1046,
4672,
618,
273,
24288,
1046,
18,
588,
559,
1435,
628,
1887,
273,
24288,
1046,
18,
588,
1265,
1435,
843,
273,
24288,
1046,
18,
588,
1138,
1435,
... |
class PackagingTests(unittest.TestCase): | expected_options = { u"main": u"main", u"resourcePackages": { u"testing-bar-lib": u"bar", u"testing-foo-lib": u"foo", u"testing-jetpack-core-lib": u"jetpack-core" }, u"packageData": {}, u"rootPaths": [u"resource://testing-jetpack-core-lib/", u"resource://testing-bar-lib/", u"resource://testing-foo-lib/"], u"resources": { u"testing-bar-lib": [u"resources", u"testing-bar-lib"], u"testing-foo-lib": [u"resources", u"testing-foo-lib"], u"testing-jetpack-core-lib": [u"resources", u"testing-jetpack-core-lib"] }, u"loader": u"resource://testing-jetpack-core-lib/loader.js" } class XpiTests(unittest.TestCase): | def get_configs(pkg_name): pkg_path = os.path.join(static_files_path, 'packages', pkg_name) if not (os.path.exists(pkg_path) and os.path.isdir(pkg_path)): raise Exception('path does not exist: %s' % pkg_path) target_cfg = packaging.get_config_in_dir(pkg_path) pkg_cfg = packaging.build_config(static_files_path, target_cfg) deps = packaging.get_deps_for_targets(pkg_cfg, [pkg_name]) build = packaging.generate_build_for_target( pkg_cfg=pkg_cfg, target=pkg_name, deps=deps, prefix='testing-' ) return Bunch(target_cfg=target_cfg, pkg_cfg=pkg_cfg, build=build) | 80c91de0bc308c7fc84674e93bb787bc0bdd86e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14687/80c91de0bc308c7fc84674e93bb787bc0bdd86e5/test_xpi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10955,
12,
10657,
67,
529,
4672,
3475,
67,
803,
273,
1140,
18,
803,
18,
5701,
12,
3845,
67,
2354,
67,
803,
16,
296,
10308,
2187,
3475,
67,
529,
13,
309,
486,
261,
538,
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,
336,
67,
10955,
12,
10657,
67,
529,
4672,
3475,
67,
803,
273,
1140,
18,
803,
18,
5701,
12,
3845,
67,
2354,
67,
803,
16,
296,
10308,
2187,
3475,
67,
529,
13,
309,
486,
261,
538,
18,
... |
print(hashKey, recd.hashKey) | print("compare:", hashKey, recd.hashKey) | def requestPhotoBits(self, recd): print("requestingPhotoBits...", len(self.my_acty.get_joined_buddies())) photoTakingBuddy = None for buddy in self.my_acty.get_joined_buddies(): if (not buddy.props.owner): keyHash = util._sha_data(buddy.props.key) hashKey = util.printable_hash(keyHash) #todo: bug dcbw about this... print(hashKey, recd.hashKey) if (hashKey == recd.hashKey): photoTakingBuddy = buddy | cb107b8476bf337bf704f6349e5756c4744a0af1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6451/cb107b8476bf337bf704f6349e5756c4744a0af1/mesh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
19934,
6495,
12,
2890,
16,
1950,
72,
4672,
1172,
2932,
2293,
310,
19934,
6495,
7070,
16,
562,
12,
2890,
18,
4811,
67,
621,
93,
18,
588,
67,
5701,
329,
67,
70,
20567,
606,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
590,
19934,
6495,
12,
2890,
16,
1950,
72,
4672,
1172,
2932,
2293,
310,
19934,
6495,
7070,
16,
562,
12,
2890,
18,
4811,
67,
621,
93,
18,
588,
67,
5701,
329,
67,
70,
20567,
606,
1435,
... |
where_clause = ' where '+string.join(where_clause, ' and ') | where_clause = ' where ' + ' and '.join(where_clause) | def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): """ Get the list of records in list view grouped by the given ``groupby`` fields | 827ce83b5767611573e3e504cd882f1684b5bd2a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/827ce83b5767611573e3e504cd882f1684b5bd2a/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
1655,
12,
2890,
16,
4422,
16,
4555,
16,
2461,
16,
1466,
16,
13126,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
968,
326,
666,
434,
3853,
316,
666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
855,
67,
1655,
12,
2890,
16,
4422,
16,
4555,
16,
2461,
16,
1466,
16,
13126,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
819,
33,
7036,
4672,
3536,
968,
326,
666,
434,
3853,
316,
666,
... |
sage: [value, cut, [ setA, setB ]] = g.vertex_connectivity(sets=True) sage: len(setA) == 1 or len(setB) == 1 | sage: [value, cut, [ setA, setB ]] = g.vertex_connectivity(sets=True) sage: len(setA) == 1 or len(setB) == 1 | def vertex_connectivity(self, value_only=True, sets=False, solver=None, verbose=0): r""" Returns the vertex connectivity of the graph. For more information, see the `Wikipedia article on connectivity <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_. INPUT: | 06f830c7a677dbabf75020fadb7c4c3325a771f8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/06f830c7a677dbabf75020fadb7c4c3325a771f8/generic_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5253,
67,
3612,
2818,
12,
2890,
16,
460,
67,
3700,
33,
5510,
16,
1678,
33,
8381,
16,
12776,
33,
7036,
16,
3988,
33,
20,
4672,
436,
8395,
2860,
326,
5253,
20301,
434,
326,
2667,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5253,
67,
3612,
2818,
12,
2890,
16,
460,
67,
3700,
33,
5510,
16,
1678,
33,
8381,
16,
12776,
33,
7036,
16,
3988,
33,
20,
4672,
436,
8395,
2860,
326,
5253,
20301,
434,
326,
2667,
18,
2... |
nuninst_comp = nuninst_new | for k in nuninst: nuninst_comp[k] = nuninst[k] | def iter_packages(self, packages, output): extra = [] nuninst_comp = self.get_nuninst() | 6abbd90bfcb33ae5f570c924e7387a2633b9d0de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/6abbd90bfcb33ae5f570c924e7387a2633b9d0de/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
from re import escape, compile | def _prepareTargetRepository(self): """ Create the base directory if it doesn't exist, and execute ``darcs initialize`` if needed. """ | 5e5b4967e89c99046884bacd6b13974d01087474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/5e5b4967e89c99046884bacd6b13974d01087474/darcs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
2326,
3305,
12,
2890,
4672,
3536,
1788,
326,
1026,
1867,
309,
518,
3302,
1404,
1005,
16,
471,
1836,
12176,
72,
297,
2143,
4046,
10335,
309,
3577,
18,
3536,
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,
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,
9366,
2326,
3305,
12,
2890,
4672,
3536,
1788,
326,
1026,
1867,
309,
518,
3302,
1404,
1005,
16,
471,
1836,
12176,
72,
297,
2143,
4046,
10335,
309,
3577,
18,
3536,
2,
-100,
-100,
-100... | |
decomp_data = zlib.decompress(chan.comp_data) | decomp_data = zlib.decompress(comp_data) | def __read_data_compressed(self, channels): # At least in post-4.0 files, the compressed data isn't interleaved at # all. It's stored in uniform compressed blocks -- this probably # compresses far better than interleaved data. # Strangely, the compressed data seems to always be little-endian. for i in range(len(channels)): cch = self.channel_compression_headers[i] chan = channels[i] # Data seems to be little-endian regardless of the rest of the file fmt_str = '<'+chan.fmt_str self.acq_file.seek(cch.compressed_data_offset) comp_data = self.acq_file.read(cch.compressed_data_len) decomp_data = zlib.decompress(chan.comp_data) # raw_data starts out as zeros. Yeah, this feels hacky to me, too. np.add(chan.raw_data, np.fromstring(decomp_data, fmt_str), chan.raw_data) | 38f8219c6596651ad1c345373591a1928a6ac079 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14571/38f8219c6596651ad1c345373591a1928a6ac079/readers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
896,
67,
892,
67,
15385,
12,
2890,
16,
5750,
4672,
468,
2380,
4520,
316,
1603,
17,
24,
18,
20,
1390,
16,
326,
8968,
501,
5177,
1404,
1554,
22593,
622,
468,
777,
18,
2597,
1807,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
67,
892,
67,
15385,
12,
2890,
16,
5750,
4672,
468,
2380,
4520,
316,
1603,
17,
24,
18,
20,
1390,
16,
326,
8968,
501,
5177,
1404,
1554,
22593,
622,
468,
777,
18,
2597,
1807,
... |
'de': (CAT, u"Kategorie:Exzellenter Artikel"), | 'de': (BACK, u"Vorlage:Exzellent"), | def LINKS(site,name, ignore=[]): p=wikipedia.Page(site, name) links=p.linkedPages() for n in links[:]: t=n.titleWithoutNamespace() if t[0] in u"/#" or t in ignore: links.remove(n) links.sort() return links | 09aab92b74b29b78fbb1e2084b167b7cb6ee205c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/09aab92b74b29b78fbb1e2084b167b7cb6ee205c/featured.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22926,
55,
12,
4256,
16,
529,
16,
2305,
33,
8526,
4672,
293,
33,
11999,
13744,
18,
1964,
12,
4256,
16,
508,
13,
4716,
33,
84,
18,
17738,
5716,
1435,
364,
290,
316,
4716,
10531,
14542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22926,
55,
12,
4256,
16,
529,
16,
2305,
33,
8526,
4672,
293,
33,
11999,
13744,
18,
1964,
12,
4256,
16,
508,
13,
4716,
33,
84,
18,
17738,
5716,
1435,
364,
290,
316,
4716,
10531,
14542,
... |
('(%Z)', '(%s)' % tz, 'time zone name'), | ('%Z', '%s' % tz, 'time zone name'), | def strftest(now): if verbose: print "strftime test for", time.ctime(now) nowsecs = str(long(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) if now[3] < 12: ampm='AM' else: ampm='PM' jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) try: if now[8]: tz = time.tzname[1] else: tz = time.tzname[0] except AttributeError: tz = '' if now[3] > 12: clock12 = now[3] - 12 elif now[3] > 0: clock12 = now[3] else: clock12 = 12 expectations = ( ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ('%A', calendar.day_name[now[6]], 'full weekday name'), ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%B', calendar.month_name[now[1]], 'full month name'), # %c see below ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ('%H', '%02d' % now[3], 'hour (00-23)'), ('%I', '%02d' % clock12, 'hour (01-12)'), ('%j', '%03d' % now[7], 'julian day (001-366)'), ('%m', '%02d' % now[1], 'month as number (01-12)'), ('%M', '%02d' % now[4], 'minute, (00-59)'), ('%p', ampm, 'AM or PM as appropriate'), ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ('%U', '%02d' % ((now[7] + jan1[6])/7), 'week number of the year (Sun 1st)'), ('%w', '%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)/7), 'week number of the year (Mon 1st)'), # %x see below ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%y', '%02d' % (now[0]%100), 'year without century'), ('%Y', '%d' % now[0], 'year with century'), # %Z see below ('%%', '%', 'single percent sign'), ) nonstandard_expectations = ( # These are standard but don't have predictable output ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), '%m/%d/%y %H:%M:%S'), ('(%Z)', '(%s)' % tz, 'time zone name'), # These are some platform specific extensions ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ('%n', '\n', 'newline character'), ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), '%I:%M:%S %p'), ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ('%s', nowsecs, 'seconds since the Epoch in UCT'), ('%t', '\t', 'tab character'), ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%3y', '%03d' % (now[0]%100), 'year without century rendered using fieldwidth'), ) if verbose: print "Strftime test, platform: %s, Python version: %s" % \ (sys.platform, string.split(sys.version)[0]) for e in expectations: try: result = time.strftime(e[0], now) except ValueError, error: print "Standard '%s' format gave error:" % e[0], error continue if result == e[1]: continue if result[0] == '%': print "Does not support standard '%s' format (%s)" % (e[0], e[2]) else: print "Conflict for %s (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) for e in nonstandard_expectations: try: result = time.strftime(e[0], now) except ValueError, result: if verbose: print "Error for nonstandard '%s' format (%s): %s" % \ (e[0], e[2], str(result)) continue if result == e[1]: if verbose: print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) elif result[0] == '%': if verbose: print "Does not appear to support '%s' format (%s)" % (e[0], e[2]) else: if verbose: print "Conflict for nonstandard '%s' format (%s):" % (e[0], e[2]) print " Expected %s, but got %s" % (e[1], result) | 7944ea523ed1da2cfa99c922509caa07114b4096 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7944ea523ed1da2cfa99c922509caa07114b4096/test_strftime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
12,
3338,
4672,
309,
3988,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
21317,
273,
609,
12,
5748,
12,
3338,
3719,
10531,
17,
21,
65,
... |
busyHeb = select([hebergementTable.heb_pk], | busyHeb = select([reservationsTable.heb_fk], | def action_search(self, action, data): wrapper = getSAWrapper('gites_wallons') session = wrapper.session hebergementTable = wrapper.getMapper('hebergement') proprioTable = wrapper.getMapper('proprio') reservationsTable = wrapper.getMapper('reservation_proprio') provincesTable = wrapper.getMapper('province') episTable = wrapper.getMapper('link_hebergement_epis') hebergementType = data.get('hebergementType') provinces = data.get('provinces') classification = data.get('classification') capacityMin = data.get('capacityMin') roomAmount = data.get('roomAmount') checkAnimals = data.get('animals') checkSmokers = data.get('smokers') fromDate = data.get('fromDate') toDate = data.get('toDate') seeResults = self.request.form.has_key('form.seeResults') | 8e6739217892afdacbe711db07793ccf2660b3bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10188/8e6739217892afdacbe711db07793ccf2660b3bb/SearchHebergement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
18,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
3072,
12,
2890,
16,
1301,
16,
501,
4672,
4053,
273,
1322,
37,
3611,
2668,
75,
2997,
67,
8019,
7008,
6134,
1339,
273,
4053,
18,
3184,
3904,
31317,
820,
1388,
273,
4053,
18,
58... |
m = re.match(r"(?P<file_name>[A-Za-z0-9\-]*)\.(?P<extension>[a-z]{2,3})$", file) files_list.append(os.path.join(BASE_ROOT, file)) | m = re.match(r"(?P<file_name>[A-Za-z0-9\-]*)\." + "(?P<extension>gif|jpg|png|tif)$", file) if m: files_list.append(file) | def resize(files): pass | b076b36f3565caa33a18c29138c2db7f770cec3a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4038/b076b36f3565caa33a18c29138c2db7f770cec3a/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
12,
2354,
4672,
1342,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
12,
2354,
4672,
1342,
225,
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,
-1... |
if delta==0: | if delta<=0: | def readTextHelper_generator(info,cursor): cursorIndexMap={} startKeyCount=globalVars.keyCounter cursorIndexMap.clear() reader=info.copy() if not reader.isCollapsed: readToLimit=True reader.collapse() else: readToLimit=False keepReading=True keepUpdating=True oldSpokenIndex=None endIndex=None while keepUpdating: if keepReading: bookmark=reader.bookmark index=hash(bookmark) reader.expand(textHandler.UNIT_READINGCHUNK) cursorIndexMap[index]=bookmark speech.speakFormattedText(reader,includeBlankText=False,index=index) if readToLimit: delta=reader.compareEnd(info) if delta>=0: keepReading=False endIndex=index else: reader.collapse(end=True) else: reader.collapse() delta=reader.moveByUnit(textHandler.UNIT_READINGCHUNK,1) if delta==0: keepReading=False endIndex=index spokenIndex=speech.getLastSpeechIndex() if spokenIndex!=oldSpokenIndex: oldSpokenIndex=spokenIndex bookmark=cursorIndexMap.get(spokenIndex,None) if bookmark is not None: updater=reader.obj.makeTextInfo(bookmark) if cursor==CURSOR_CARET: updater.updateCaret() if cursor!=CURSOR_CARET or globalVars.caretMovesReviewCursor: updater.obj.reviewPosition=updater if endIndex is not None and spokenIndex==endIndex: keepUpdating=keepReading=False while speech.isPaused: yield startKeyCount=globalVars.keyCounter if globalVars.keyCounter!=startKeyCount: speech.cancelSpeech() keepUpdating=keepReading=False yield | 7982a4510511c7f3430bbdfab904aaf8b2f99dbf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/7982a4510511c7f3430bbdfab904aaf8b2f99dbf/sayAllHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1528,
2276,
67,
8812,
12,
1376,
16,
9216,
4672,
3347,
1016,
863,
12938,
24822,
1380,
33,
6347,
5555,
18,
856,
4789,
3347,
1016,
863,
18,
8507,
1435,
2949,
33,
1376,
18,
3530,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1528,
2276,
67,
8812,
12,
1376,
16,
9216,
4672,
3347,
1016,
863,
12938,
24822,
1380,
33,
6347,
5555,
18,
856,
4789,
3347,
1016,
863,
18,
8507,
1435,
2949,
33,
1376,
18,
3530,
1435,
... |
editor = _(u"Server") | editor = _(u"Subscriber") | def __init__(self, frame, conflicts, callback): self.conflicts = conflicts self.acceptButtons = list() self.discardButtons = list() self.textControls = list() self.callback = callback | ba06200edfd8d747c58f5a9b8609572d183ea0f8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/ba06200edfd8d747c58f5a9b8609572d183ea0f8/ConflictDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
14450,
16,
1348,
4672,
365,
18,
20340,
87,
273,
14450,
365,
18,
9436,
14388,
273,
666,
1435,
365,
18,
31992,
14388,
273,
666,
1435,
365,
18,
95... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
14450,
16,
1348,
4672,
365,
18,
20340,
87,
273,
14450,
365,
18,
9436,
14388,
273,
666,
1435,
365,
18,
31992,
14388,
273,
666,
1435,
365,
18,
95... |
run = self.build_run([self.enable_act]) | run = self.build_run(actions=[self.enable_act]) | def enable(self): if self.enable_act: run = self.build_run([self.enable_act]) self.enable_runs.appendleft(run) run.start() | c24c6174f0d18dcac30704bbe2b220956db34191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14977/c24c6174f0d18dcac30704bbe2b220956db34191/job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
12,
2890,
4672,
309,
365,
18,
7589,
67,
621,
30,
1086,
273,
365,
18,
3510,
67,
2681,
12,
4905,
22850,
2890,
18,
7589,
67,
621,
5717,
365,
18,
7589,
67,
20152,
18,
6923,
4482,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
12,
2890,
4672,
309,
365,
18,
7589,
67,
621,
30,
1086,
273,
365,
18,
3510,
67,
2681,
12,
4905,
22850,
2890,
18,
7589,
67,
621,
5717,
365,
18,
7589,
67,
20152,
18,
6923,
4482,
1... |
fd, name = tempfile.mkstemp() fileobj = os.fdopen(fd, "w+b") try: | with TemporaryFile("w+b") as fileobj: | def test_write_simple_dict(self): fd, name = tempfile.mkstemp() fileobj = os.fdopen(fd, "w+b") try: writer = csv.DictWriter(fileobj, fieldnames = ["f1", "f2", "f3"]) writer.writerow({"f1": 10, "f3": "abc"}) fileobj.seek(0) self.assertEqual(fileobj.read(), "10,,abc\r\n") finally: fileobj.close() os.unlink(name) | 02b1d9a951b66534b2fd77809400d61c745873e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/02b1d9a951b66534b2fd77809400d61c745873e5/test_csv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2626,
67,
9647,
67,
1576,
12,
2890,
4672,
598,
22791,
812,
2932,
91,
15,
70,
7923,
487,
17041,
30,
2633,
273,
6101,
18,
5014,
2289,
12,
768,
2603,
16,
25051,
273,
8247,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2626,
67,
9647,
67,
1576,
12,
2890,
4672,
598,
22791,
812,
2932,
91,
15,
70,
7923,
487,
17041,
30,
2633,
273,
6101,
18,
5014,
2289,
12,
768,
2603,
16,
25051,
273,
8247,
74,
... |
def setFocalPoint(self,*pos): | def setFocalPoint(self, *pos): | def setFocalPoint(self,*pos): """ Sets the focal point of the Camera with the Scene | 1854c8488520f906732b4f370cdb2d7253cc6936 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/1854c8488520f906732b4f370cdb2d7253cc6936/camera.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24340,
23735,
2148,
12,
2890,
16,
380,
917,
4672,
3536,
11511,
326,
284,
23735,
1634,
434,
326,
30355,
598,
326,
29347,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
24340,
23735,
2148,
12,
2890,
16,
380,
917,
4672,
3536,
11511,
326,
284,
23735,
1634,
434,
326,
30355,
598,
326,
29347,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
'strarglens':{isstring:',int 'strarglens_td':{isstring:',int'}, | 'strarglens':{isstring:',int 'strarglens_td':{isstring:',int'}, 'strarglens_nm':{isstring:', | #ifdef F2PY_CB_RETURNCOMPLEX | 5c8f992c6ff487f0b5c97cb80ad0706473d05074 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/14925/5c8f992c6ff487f0b5c97cb80ad0706473d05074/cb_rules.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
478,
22,
16235,
67,
8876,
67,
14033,
10057,
21130,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
430,
536,
478,
22,
16235,
67,
8876,
67,
14033,
10057,
21130,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
tab = [ [self[0]] ] for i in range(1,len(self)): if self[i-1].value > self[i].value: tab.append([self[i]]) else: l = len(tab)-1 tab[l].append(self[i]) return Tableau(tab) | shape = self.parent().shape.conjugate() tab = [] s = 0 for i in range(len(shape)): col = [ self[s+k] for k in range(shape[i]) ] col.reverse() s += shape[i] tab.append(col) tab = Tableau(tab) return(tab.conjugate()) | def to_tableau(self): | f5cf21397db0cd18b6691a15594e6e520d46ad99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/f5cf21397db0cd18b6691a15594e6e520d46ad99/tensor_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
2121,
8377,
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... | [
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,
358,
67,
2121,
8377,
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... |
def __pypytrace___(self): | def __pypytrace__(self): | def __pypytrace___(self): pass | d468f6dcc073ac80504ccc266b13ca3f918d86e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/d468f6dcc073ac80504ccc266b13ca3f918d86e4/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
22680,
93,
5129,
972,
12,
2890,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1001,
22680,
93,
5129,
972,
12,
2890,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
statusmsg = "status changed" | statusmsg = "Status Changed" | def politics(request, action): user = request.user player = user.get_profile() statusmsg = "" request.user.get_profile().lastactivity = datetime.datetime.utcnow() request.user.get_profile().save() try: for postitem in request.POST: if '-' not in postitem: continue action, key = postitem.split('-') otheruser = get_object_or_404(User, id=int(key)) otherplayer = otheruser.get_profile() if action == 'begforpeace' and len(request.POST[postitem]): msg = Message() msg.subject="offer of peace" msg.fromplayer=user msg.toplayer=otheruser msgtext = [] msgtext.append("<h1>"+user.username+" is offering the hand of peace</h1>") msgtext.append("") msgtext.append(request.POST[postitem]) msgtext.append("") msgtext.append("<h1>Declare Peace?</h1> ") msg.message = "\n".join(msgtext) msg.save() statusmsg = "message sent" if action == 'changestatus': currelation = player.getpoliticalrelation(otherplayer) if currelation != "enemy" and currelation != request.POST[postitem]: player.setpoliticalrelation(otherplayer,request.POST[postitem]) player.save() otherplayer.save() user.save() otheruser.save() statusmsg = "status changed" except: raise neighborhood = buildneighborhood(user) neighbors = {} neighbors['normal'] = [] neighbors['enemies'] = [] for neighbor in neighborhood['neighbors']: neighbor.relation = player.getpoliticalrelation(neighbor.get_profile()) if neighbor == user: continue if user.get_profile().getpoliticalrelation(neighbor.get_profile()) == "enemy": neighbors['enemies'].append(neighbor) else: neighbors['normal'].append(neighbor) context = {'neighbors': neighbors, 'player':player} if statusmsg: context['statusmsg'] = statusmsg slider = render_to_string('neighbors.xhtml', context) jsonresponse = {'slider': slider} if statusmsg: jsonresponse['status'] = statusmsg return HttpResponse(simplejson.dumps(jsonresponse)) | 7dad8bedf81dd5ada7a89fb1f4cff90674d7a430 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2020/7dad8bedf81dd5ada7a89fb1f4cff90674d7a430/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2952,
305,
2102,
12,
2293,
16,
1301,
4672,
729,
273,
590,
18,
1355,
7291,
273,
729,
18,
588,
67,
5040,
1435,
1267,
3576,
273,
1408,
225,
590,
18,
1355,
18,
588,
67,
5040,
7675,
2722,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2952,
305,
2102,
12,
2293,
16,
1301,
4672,
729,
273,
590,
18,
1355,
7291,
273,
729,
18,
588,
67,
5040,
1435,
1267,
3576,
273,
1408,
225,
590,
18,
1355,
18,
588,
67,
5040,
7675,
2722,
... |
else: raise ValueError("Either a serial port or an XBee must be provided to construct a Dispatch") | def __init__(self, ser=None, xbee=None): if xbee: self.xbee = xbee elif ser: self.xbee = XBee(ser) else: raise ValueError("Either a serial port or an XBee must be provided to construct a Dispatch") self.handlers = [] | 48349a092af0dc446738b06554a35353b17faed6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10631/48349a092af0dc446738b06554a35353b17faed6/dispatch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
703,
33,
7036,
16,
15970,
1340,
33,
7036,
4672,
309,
15970,
1340,
30,
365,
18,
6114,
1340,
273,
15970,
1340,
1327,
703,
30,
365,
18,
6114,
1340,
273,
113... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
703,
33,
7036,
16,
15970,
1340,
33,
7036,
4672,
309,
15970,
1340,
30,
365,
18,
6114,
1340,
273,
15970,
1340,
1327,
703,
30,
365,
18,
6114,
1340,
273,
113... | |
raise InvalidValueError(r, storage_map[r][0]) | raise InvalidValueError(r, storage_map[r][0], hint='perform output') | def f(): debug("starting f") for x in no_recycling: x[0] = None | 9d2ae40758edfaa9975891827cc404076217ae20 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/9d2ae40758edfaa9975891827cc404076217ae20/debugmode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
13332,
1198,
2932,
18526,
284,
7923,
364,
619,
316,
1158,
67,
266,
2431,
830,
310,
30,
619,
63,
20,
65,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
13332,
1198,
2932,
18526,
284,
7923,
364,
619,
316,
1158,
67,
266,
2431,
830,
310,
30,
619,
63,
20,
65,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if can_gsm_encode(enc, file): | if can_gsm_encode(enc, infile): | def check_gsm_compatible(infile): file_name = infile.rsplit(os.sep,1)[1] for enc in encodings: try: if can_gsm_encode(enc, file): print "PASSES gsm encoding (%s)" % file_name break except UnicodeEncodeError, e: print "FAILS GSM ENCODING (%s)! (file was read as type %s)" % (file_name,enc) print " Failed on line %d" % line_count print " " + str(e) break return | 64166739cb760733cee6660c94264e4320bebbd8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/64166739cb760733cee6660c94264e4320bebbd8/is_gsm_compatible.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
564,
81,
67,
10943,
12,
267,
768,
4672,
585,
67,
529,
273,
14568,
18,
86,
4939,
12,
538,
18,
10814,
16,
21,
25146,
21,
65,
364,
2446,
316,
24118,
30,
775,
30,
309,
848,
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,
866,
67,
564,
81,
67,
10943,
12,
267,
768,
4672,
585,
67,
529,
273,
14568,
18,
86,
4939,
12,
538,
18,
10814,
16,
21,
25146,
21,
65,
364,
2446,
316,
24118,
30,
775,
30,
309,
848,
67... |
self.addTransition('ACTIVE', 'reset', 'TUNING') | def __init__(self): # zero the state machine statemachine.StateMachine.__init__(self) | 8394f1cef9a64658cae76898a2b0b10fe4ca14ba /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11576/8394f1cef9a64658cae76898a2b0b10fe4ca14ba/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
3634,
326,
919,
5228,
919,
9149,
18,
1119,
6981,
16186,
2738,
972,
12,
2890,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
468,
3634,
326,
919,
5228,
919,
9149,
18,
1119,
6981,
16186,
2738,
972,
12,
2890,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
if job.inputdata.tag_info: | if self.inputdatatype == 'DQ2' and job.inputdata.tag_info: | def prepare(self,app,appsubconfig,appmasterconfig,jobmasterconfig): '''prepare the subjob specific configuration''' | 7153a256b893385cacb491594e3771feab9cc4e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/7153a256b893385cacb491594e3771feab9cc4e1/AthenaPandaRTHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2910,
16,
11411,
373,
1425,
16,
2910,
7525,
1425,
16,
4688,
7525,
1425,
4672,
9163,
9366,
326,
720,
4688,
2923,
1664,
26418,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2910,
16,
11411,
373,
1425,
16,
2910,
7525,
1425,
16,
4688,
7525,
1425,
4672,
9163,
9366,
326,
720,
4688,
2923,
1664,
26418,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
A200.setSuperMembers([puteaux, R3]) A300.setSuperMembers([issy, R2]) | A200.setSuperMembers([puteaux, R2]) A300.setSuperMembers([puteaux, R3]) | def makeAccounts(self): # create all accounts under the root account self.root = RootAccount(name='Accounts') # =========================================================================== # Define the "Location" Dimension for an apartment with 4 dimension members. # =========================================================================== self.locationDim = locationDim = Dimension(name="Location") self.zoneA = zoneA = DimensionMember(name="zoneA", desc="zoneA", dimension=locationDim) self.puteaux = puteaux = DimensionMember(name="Puteaux", desc="Puteaux", dimension=locationDim) self.issy = issy = DimensionMember(name="Issy", desc="Issy", dimension=locationDim) puteaux.addSuperMember(zoneA) # City 'Puteaux' is in region 'zoneA' issy.addSuperMember(zoneA) # =========================================================================== # Define the "RoomNumber" Dimension for an apartment with 2 members. # =========================================================================== self.roomNumberDim = roomNumberDim = Dimension(name="RoomNumber") self.R2 = R2 = DimensionMember(name="2-roomed", desc="2-roomed", dimension=roomNumberDim) self.R3 = R3 = DimensionMember(name="3-roomed", desc="3-roomed", dimension=roomNumberDim) # =========================================================================== # Define the "Apartment" Dimension with 4 members. # =========================================================================== self.apartmentDim = apartmentDim = Dimension(name="Apartment") self.A100 = A100 = DimensionMember(name="A100", desc="Apartment 100", dimension=apartmentDim) self.A200 = A200 = DimensionMember(name="A200", desc="Apartment 200", dimension=apartmentDim) self.A300 = A300 = DimensionMember(name="A300", desc="Apartment 300", dimension=apartmentDim) self.A400 = A400 = DimensionMember(name="A400", desc="Apartment 400", dimension=apartmentDim) A100.setSuperMembers([puteaux, R2]) A200.setSuperMembers([puteaux, R3]) A300.setSuperMembers([issy, R2]) A400.setSuperMembers([issy, R3]) # =========================================================================== # Define the "Expense" Dimension with 2 members. # =========================================================================== self.expenseDim = expenseDim = Dimension(name="Expense") self.warrantyMember = warrantyMember = DimensionMember(name="Warranty", desc="Warranty", dimension=expenseDim) self.taxesMember = taxesMember = DimensionMember(name="Taxes", desc="Taxes", dimension=expenseDim) # =========================================================================== # ASSETS # =========================================================================== self.asset = Account(parent=self.root, name='Asset', type=TYPE_ASSET) bank = Account(parent=self.asset, name='Bank') apart = Account(parent=self.asset, name='All apartments') apart100 = self.apart100 = Account(parent=apart, name='Apartment 100', dimensionMembers=[A100]) # =========================================================================== # EXPENSES # =========================================================================== self.expense = Account(parent=self.root, name='Expense', type=TYPE_EXPENSE) warranty = Account(parent=self.expense, name='Warranty') warranty100 = self.warranty100 = Account(parent=warranty, name='Warranty 100', dimensionMembers=[A100, warrantyMember]) warranty200 = self.warranty200 = Account(parent=warranty, name='Warranty 200', dimensionMembers=[A200, warrantyMember]) warranty300 = self.warranty300 = Account(parent=warranty, name='Warranty 300', dimensionMembers=[A300, warrantyMember]) warranty400 = self.warranty400 = Account(parent=warranty, name='Warranty 400', dimensionMembers=[A400, warrantyMember]) taxes = Account(parent=self.expense, name='Taxes') taxes100 = self.taxes100 = Account(parent=taxes, name='Taxes 100', dimensionMembers=[A100, taxesMember]) taxes200 = self.taxes200 = Account(parent=taxes, name='Taxes 200', dimensionMembers=[A200, taxesMember]) taxes300 = self.taxes300 = Account(parent=taxes, name='Taxes 300', dimensionMembers=[A300, taxesMember]) taxes400 = self.taxes400 = Account(parent=taxes, name='Taxes 400', dimensionMembers=[A400, taxesMember]) # =========================================================================== # INCOMES # =========================================================================== self.income = Account(parent=self.root, name='Income', type=TYPE_INCOME) rent = Account(parent=self.income, name='Rent') rent100 = self.rent100 = Account(parent=rent, name='Rent 100', dimensionMembers=[A100]) # =========================================================================== # LIABILITIES # =========================================================================== self.liability = Account(parent=self.root, name='Liability', type=TYPE_LIABILITY) loan = Account(parent=self.liability, name='Loan') loan100 = self.loan100 = Account(parent=loan, name='Loan 100', dimensionMembers=[A100]) # =========================================================================== # EQUITY # =========================================================================== self.equity = Account(parent=self.root, name='Equity', type=TYPE_EQUITY) bank.makeInitialTransaction(self.equity, Money(200000), Date(2005,1,1)) equity100 = self.equity100 = Account(parent=self.equity, name='Equity 100', dimensionMembers=[A100]) bank.makeInitialTransaction(self.equity100, Money(20000), Date(2005,1,1)) # =========================================================================== # Make some transactions # =========================================================================== Transaction(Date(2005,1,2), 'contract a loan', bank, loan100, 150000) Transaction(Date(2005,1,3), 'buy an apartment', apart100, bank, 200000) Transaction(Date(2005,1,4), 'pay 1 year warranty', warranty100, bank, 0.5) Transaction(Date(2005,1,4), 'pay 1 year property tax', taxes100, bank, 2) Transaction(Date(2005,1,5), 'rent the appartment', bank, rent100, 600*12) Transaction(Date(2005,1,4), 'pay 1 year warranty', warranty200, bank, 0.5) Transaction(Date(2005,1,4), 'pay 1 year property tax', taxes200, bank, 2) Transaction(Date(2005,1,4), 'pay 1 year warranty', warranty300, bank, 1) Transaction(Date(2005,1,4), 'pay 1 year property tax', taxes300, bank, 3) Transaction(Date(2005,1,4), 'pay 1 year warranty', warranty400, bank, 1) Transaction(Date(2005,1,4), 'pay 1 year property tax', taxes400, bank, 2) | 9bc73fbee5a3f7bb4e235b6a368d9d83475b1729 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2380/9bc73fbee5a3f7bb4e235b6a368d9d83475b1729/test_multi_dimensions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
13971,
12,
2890,
4672,
225,
468,
752,
777,
9484,
3613,
326,
1365,
2236,
365,
18,
3085,
273,
7450,
3032,
12,
529,
2218,
13971,
6134,
225,
468,
422,
22121,
33,
468,
13184,
326,
315,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
13971,
12,
2890,
4672,
225,
468,
752,
777,
9484,
3613,
326,
1365,
2236,
365,
18,
3085,
273,
7450,
3032,
12,
529,
2218,
13971,
6134,
225,
468,
422,
22121,
33,
468,
13184,
326,
315,
... |
'datas': fields.function(_data_get,method=True,fnct_inv=_data_set,string='File Content',type="binary"), | 'datas': fields.function(_data_get,method=True,store=True,fnct_inv=_data_set,string='File Content',type="binary"), | def _data_set(self, cr, obj, id, name, value, uid=None, context={}): if not value: return True if (not context) or context.get('store_method','fs')=='fs': path = os.path.join(os.getcwd(), "filestore", cr.dbname) if not os.path.isdir(path): os.makedirs(path) flag = None # This can be improved for dirs in os.listdir(path): if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000: flag = dirs break flag = flag or create_directory(path) filename = random_name() fname = os.path.join(path, flag, filename) fp = file(fname,'wb') v = base64.decodestring(value) fp.write(v) filesize = os.stat(fname).st_size cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id)) else: cr.execute('update ir_attachment set datas=%s,store_method=%s where id=%s', (Binary(value),'db',id)) return True | 0cf74c1d331badd05add9688a357a572a6875938 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/0cf74c1d331badd05add9688a357a572a6875938/document.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
892,
67,
542,
12,
2890,
16,
4422,
16,
1081,
16,
612,
16,
508,
16,
460,
16,
4555,
33,
7036,
16,
819,
12938,
4672,
309,
486,
460,
30,
327,
1053,
309,
261,
902,
819,
13,
578,
819... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
892,
67,
542,
12,
2890,
16,
4422,
16,
1081,
16,
612,
16,
508,
16,
460,
16,
4555,
33,
7036,
16,
819,
12938,
4672,
309,
486,
460,
30,
327,
1053,
309,
261,
902,
819,
13,
578,
819... |
v[0] = tmp_bit | v[0] = tmp_bit | def NKStarGraph(self,n,k): r''' Returns the (n,k)-star graph. | 4f3314b6f54cf8c98c9f00dbbe1f70db68b427e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/4f3314b6f54cf8c98c9f00dbbe1f70db68b427e4/graph_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
47,
18379,
4137,
12,
2890,
16,
82,
16,
79,
4672,
436,
26418,
2860,
326,
261,
82,
16,
79,
24950,
10983,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
FORUM_BASE_TITLE = get('FORUM_BASE_TITLE', 'Django Bulletin Board') FORUM_META_DESCRIPTION = get('FORUM_META_DESCRIPTION', '') FORUM_META_KEYWORDS = get('FORUM_META_KEYWORDS', '') TOPIC_PAGE_SIZE = get('TOPIC_PAGE_SIZE', 10) FORUM_PAGE_SIZE = get('FORUM_PAGE_SIZE', 20) SEARCH_PAGE_SIZE = get('SEARCH_PAGE_SIZE', 20) USERS_PAGE_SIZE = get('USERS_PAGE_SIZE', 20) AVATARS_UPLOAD_TO = get('AVATARS_UPLOAD_TO', 'forum/avatars') AVATAR_WIDTH = get('AVATAR_WIDTH', 60) AVATAR_HEIGHT = get('AVATAR_HEIGHT', 60) DEFAULT_TIME_ZONE = get('DEFAULT_TIME_ZONE', 3) SIGNATURE_MAX_LENGTH = get('SIGNATURE_MAX_LENGTH', 1024) SIGNATURE_MAX_LINES = get('SIGNATURE_MAX_LINES', 3) READ_TIMEOUT = get('READ_TIMEOUT', 3600 * 24 * 7) HEADER = get('HEADER', 'DjangoBB') TAGLINE = get('TAGLINE', 'Django based forum engine') DEFAULT_MARKUP = get('DEFAULT_MARKUP', 'bbcode') NOTICE = get('NOTICE', '') USER_ONLINE_TIMEOUT = get('USER_ONLINE_TIMEOUT', 15) EMAIL_DEBUG = get('FORUM_EMAIL_DEBUG', False) POST_USER_SEARCH = get('POST_USER_SEARCH', 1) | FORUM_BASE_TITLE = get('DJANGOBB_FORUM_BASE_TITLE', 'Django Bulletin Board') FORUM_META_DESCRIPTION = get('DJANGOBB_FORUM_META_DESCRIPTION', '') FORUM_META_KEYWORDS = get('DJANGOBB_FORUM_META_KEYWORDS', '') TOPIC_PAGE_SIZE = get('DJANGOBB_TOPIC_PAGE_SIZE', 10) FORUM_PAGE_SIZE = get('DJANGOBB_FORUM_PAGE_SIZE', 20) SEARCH_PAGE_SIZE = get('DJANGOBB_SEARCH_PAGE_SIZE', 20) USERS_PAGE_SIZE = get('DJANGOBB_USERS_PAGE_SIZE', 20) AVATARS_UPLOAD_TO = get('DJANGOBB_AVATARS_UPLOAD_TO', 'forum/avatars') AVATAR_WIDTH = get('DJANGOBB_AVATAR_WIDTH', 60) AVATAR_HEIGHT = get('DJANGOBB_AVATAR_HEIGHT', 60) DEFAULT_TIME_ZONE = get('DJANGOBB_DEFAULT_TIME_ZONE', 3) SIGNATURE_MAX_LENGTH = get('DJANGOBB_SIGNATURE_MAX_LENGTH', 1024) SIGNATURE_MAX_LINES = get('DJANGOBB_SIGNATURE_MAX_LINES', 3) READ_TIMEOUT = get('DJANGOBB_READ_TIMEOUT', 3600 * 24 * 7) HEADER = get('DJANGOBB_HEADER', 'DjangoBB') TAGLINE = get('DJANGOBB_TAGLINE', 'Django based forum engine') DEFAULT_MARKUP = get('DJANGOBB_DEFAULT_MARKUP', 'bbcode') NOTICE = get('DJANGOBB_NOTICE', '') USER_ONLINE_TIMEOUT = get('DJANGOBB_USER_ONLINE_TIMEOUT', 15) EMAIL_DEBUG = get('DJANGOBB_FORUM_EMAIL_DEBUG', False) POST_USER_SEARCH = get('DJANGOBB_POST_USER_SEARCH', 1) | def get(key, default): return getattr(settings, key, default) | ec838de748db1f3ae64fe1ca517d112349fff91a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13701/ec838de748db1f3ae64fe1ca517d112349fff91a/settings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
856,
16,
805,
4672,
327,
3869,
12,
4272,
16,
498,
16,
805,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
856,
16,
805,
4672,
327,
3869,
12,
4272,
16,
498,
16,
805,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.create_ballon_custom_layout(), | self.create_balloon_custom_layout(), | def __init__(self, parent=None, tabs=None, fields=None, show_default_button=True, no_reboot=False): super(Settings, self).__init__(parent) | be3ebcaac1dd2e0670e719d9cf324d18f7d2074c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1208/be3ebcaac1dd2e0670e719d9cf324d18f7d2074c/gui_pyqt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
10920,
33,
7036,
16,
1466,
33,
7036,
16,
2405,
67,
1886,
67,
5391,
33,
5510,
16,
1158,
67,
266,
7137,
33,
8381,
4672,
2240,
12,
2628... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
33,
7036,
16,
10920,
33,
7036,
16,
1466,
33,
7036,
16,
2405,
67,
1886,
67,
5391,
33,
5510,
16,
1158,
67,
266,
7137,
33,
8381,
4672,
2240,
12,
2628... |
def w_set_parent(space, self, w_parent): | def w_set_parent(space, w_self, w_parent): self = space.interp_w(AppGreenlet, w_self) | def w_set_parent(space, self, w_parent): newparent = space.interp_w(AppGreenlet, w_parent) curr = newparent while 1: if space.is_true(space.is_(self, curr)): raise OperationError(space.w_ValueError, space.wrap("cyclic parent chain")) if not space.is_true(space.is_(curr.w_parent, space.w_None)): break curr = curr.w_parent self.w_parent = newparent | fbc6eff872a83065c4601c3d34616f7fde2abe39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/fbc6eff872a83065c4601c3d34616f7fde2abe39/interp_greenlet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
67,
542,
67,
2938,
12,
2981,
16,
341,
67,
2890,
16,
341,
67,
2938,
4672,
365,
273,
3476,
18,
24940,
67,
91,
12,
3371,
21453,
1810,
16,
341,
67,
2890,
13,
394,
2938,
273,
3476,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
67,
542,
67,
2938,
12,
2981,
16,
341,
67,
2890,
16,
341,
67,
2938,
4672,
365,
273,
3476,
18,
24940,
67,
91,
12,
3371,
21453,
1810,
16,
341,
67,
2890,
13,
394,
2938,
273,
3476,
... |
self.head += self.stylesheets | def __init__(self, document): nodes.NodeVisitor.__init__(self, document) self.settings = settings = document.settings self.latex_encoding = self.to_latex_encoding(settings.output_encoding) self.use_latex_toc = settings.use_latex_toc self.use_latex_docinfo = settings.use_latex_docinfo self.use_latex_footnotes = settings.use_latex_footnotes self._use_latex_citations = settings.use_latex_citations self.embed_stylesheet = settings.embed_stylesheet self._reference_label = settings.reference_label self.hyperlink_color = settings.hyperlink_color self.compound_enumerators = settings.compound_enumerators self.font_encoding = settings.font_encoding self.section_prefix_for_enumerators = ( settings.section_prefix_for_enumerators) self.section_enumerator_separator = ( settings.section_enumerator_separator.replace('_', '\\_')) if self.hyperlink_color == '0': self.hyperlink_color = 'black' self.colorlinks = 'false' else: self.colorlinks = 'true' if self.settings.literal_block_env != '': self.settings.use_verbatim_when_possible = True if self.settings.use_bibtex: self.bibtex = self.settings.use_bibtex.split(',',1) # TODO avoid errors on not declared citations. else: self.bibtex = None # language: labels, bibliographic_fields, and author_separators. # to allow writing labes for specific languages. self.language = languages.get_language(settings.language_code) self.babel = Babel(settings.language_code) self.author_separator = self.language.author_separators[0] self.d_options = self.settings.documentoptions if self.babel.get_language(): self.d_options += ',%s' % self.babel.get_language() self.latex_equivalents[u'\u00A0'] = self.babel.nobr | e6dd1bf37f940e4bb62e65a85b414caa9a5c54aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/e6dd1bf37f940e4bb62e65a85b414caa9a5c54aa/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
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,
2738,
972,
12,
2890,
16,
1668,
4672,
2199,
18,
907,
7413,
16186,
2738,
972,
12,
2890,
16,
1668,
13,
365,
18,
4272,
273,
1947,
273,
1668,
18,
4272,
365,
18,
26264,
67,
5999,
273,
... | |
start() | t=time.clock() | def time(function,*args,**kwargs): from timing import start, finish, milli repeat_range=range(repeat_count) apply(function,args,kwargs) start() for i in repeat_range: apply(function,args,kwargs) finish() return float(milli())/len(repeat_range) | ae9f1be84782f767256031744538ea72bc3962de /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/ae9f1be84782f767256031744538ea72bc3962de/Test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
813,
12,
915,
16,
14,
1968,
16,
636,
4333,
4672,
628,
15538,
1930,
787,
16,
4076,
16,
312,
16607,
225,
7666,
67,
3676,
33,
3676,
12,
9374,
67,
1883,
13,
2230,
12,
915,
16,
1968,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
813,
12,
915,
16,
14,
1968,
16,
636,
4333,
4672,
628,
15538,
1930,
787,
16,
4076,
16,
312,
16607,
225,
7666,
67,
3676,
33,
3676,
12,
9374,
67,
1883,
13,
2230,
12,
915,
16,
1968,
16,
... |
comDCB.fDtrControl = win32file.DTR_CONTROL_ENABLE; else: comDCB.fDtrControl = win32file.DTR_CONTROL_DISABLE; win32file.SetCommState(self.hComPort, comDCB) | win32file.EscapeCommFunction(self.hComPort, win32file.SETDTR) else: win32file.EscapeCommFunction(self.hComPort, win32file.CLRDTR) | def setDTR(self,level=1): """set terminal status line""" if not self.hComPort: raise portNotOpenError comDCB = win32file.GetCommState(self.hComPort) if level: comDCB.fDtrControl = win32file.DTR_CONTROL_ENABLE; else: comDCB.fDtrControl = win32file.DTR_CONTROL_DISABLE; win32file.SetCommState(self.hComPort, comDCB) | dc17cf28314ae0ff91fea3d547938e780d9271f3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/dc17cf28314ae0ff91fea3d547938e780d9271f3/serialwin32.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
40,
4349,
12,
2890,
16,
2815,
33,
21,
4672,
3536,
542,
8651,
1267,
980,
8395,
309,
486,
365,
18,
76,
799,
2617,
30,
1002,
1756,
1248,
3678,
668,
532,
5528,
38,
273,
5657,
1578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
40,
4349,
12,
2890,
16,
2815,
33,
21,
4672,
3536,
542,
8651,
1267,
980,
8395,
309,
486,
365,
18,
76,
799,
2617,
30,
1002,
1756,
1248,
3678,
668,
532,
5528,
38,
273,
5657,
1578,
... |
return Dec_p1 | return _Dec_p1 | def compare_total(self, other): """Compares self to other using the abstract representations. | c5de0969ca2a82c66efd30bb675f03c2324a3b27 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/c5de0969ca2a82c66efd30bb675f03c2324a3b27/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
4963,
12,
2890,
16,
1308,
4672,
3536,
19199,
365,
358,
1308,
1450,
326,
8770,
27851,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
4963,
12,
2890,
16,
1308,
4672,
3536,
19199,
365,
358,
1308,
1450,
326,
8770,
27851,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
assert self.lock_fd, "Queue should be open" | def UpdateJobUnlocked(self, job): assert self.lock_fd, "Queue should be open" | db37da70629b9485fe5c286b919b9bfd29258050 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/db37da70629b9485fe5c286b919b9bfd29258050/jqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
2278,
7087,
329,
12,
2890,
16,
1719,
4672,
1815,
365,
18,
739,
67,
8313,
16,
315,
3183,
1410,
506,
1696,
6,
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,
2315,
2278,
7087,
329,
12,
2890,
16,
1719,
4672,
1815,
365,
18,
739,
67,
8313,
16,
315,
3183,
1410,
506,
1696,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
sy=yp1-yp | sy=-(yp1-yp) | def local_transform(self): "by default, do abcd_transform on self.beam, assuming small angles" ar=Numeric.array dot=Numeric.dot tr=Numeric.transpose xp, yp, zp=tuple(self.beam.local_direction) #it better be a small angle, so sin(theta)=theta for this to work dx, dy, dz=tuple(self.beam.local_x0) #dz should always be zero in these coordinates x1,xp1, y1, yp1 =self.abcd_transform((dx, xp, dy, yp)) sx=xp1-xp #this is sort of a sine of a rotation angle of x about y cx=math.sqrt(1-sx*sx) sy=yp1-yp #this is sort of a sine of a rotation angle of y about x cy=math.sqrt(1-sy*sy) rot=dot(ar(((cx, 0, -sx),(0,1,0),(sx,0,cx))),ar(((1,0,0),(0,cy,-sy),(0,sy,cy)))) self.beam.transform(self.globalize_transform(rot)) self.q_transform() | 9684a4610d180f74c96f0f81e092a8433c660627 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6028/9684a4610d180f74c96f0f81e092a8433c660627/general_optics.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
6547,
12,
2890,
4672,
315,
1637,
805,
16,
741,
1223,
4315,
67,
6547,
603,
365,
18,
27385,
16,
15144,
5264,
15479,
6,
419,
33,
9902,
18,
1126,
3928,
33,
9902,
18,
9811,
433,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
6547,
12,
2890,
4672,
315,
1637,
805,
16,
741,
1223,
4315,
67,
6547,
603,
365,
18,
27385,
16,
15144,
5264,
15479,
6,
419,
33,
9902,
18,
1126,
3928,
33,
9902,
18,
9811,
433,
... |
self.storage.manage_delObjects(ids) | self._get_storage().manage_delObjects(ids) | def deleteImages(self, ids, REQUEST=None): """Delete images from the collection | 52816e9bf3dbc64bc7ebe48c948b5bc7c4d721e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/52816e9bf3dbc64bc7ebe48c948b5bc7c4d721e8/NyImageContainer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
8946,
12,
2890,
16,
3258,
16,
12492,
33,
7036,
4672,
3536,
2613,
4602,
628,
326,
1849,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
8946,
12,
2890,
16,
3258,
16,
12492,
33,
7036,
4672,
3536,
2613,
4602,
628,
326,
1849,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
f = context['entry_filter'] | f = context.get('entry_filter') | def include_pwlist(context): f = context['entry_filter'] entries = Entry.objects.filter(Q(name__contains=f) | Q(user__contains=f) | Q(email__contains=f) | Q(extra__contains=f)) if f else Entry.objects.all() return { 'entry_list': entries, 'entry_filter': f, } | 14a4495a02f243a7de84b1c9d813bf68a20c2226 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10339/14a4495a02f243a7de84b1c9d813bf68a20c2226/ttags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2341,
67,
14921,
1098,
12,
2472,
4672,
284,
273,
819,
18,
588,
2668,
4099,
67,
2188,
6134,
3222,
273,
3841,
18,
6911,
18,
2188,
12,
53,
12,
529,
972,
12298,
33,
74,
13,
571,
2238,
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,
2341,
67,
14921,
1098,
12,
2472,
4672,
284,
273,
819,
18,
588,
2668,
4099,
67,
2188,
6134,
3222,
273,
3841,
18,
6911,
18,
2188,
12,
53,
12,
529,
972,
12298,
33,
74,
13,
571,
2238,
12... |
self.musicManager.setVolume(0.7) | def enableMusic(self, bEnableMusic): if self.AppHasAudioFocus and self.musicManagerIsValid: self.musicManager.setActive(bEnableMusic) self.musicActive = bEnableMusic if bEnableMusic: self.notify.debug("Enabling music") else: self.notify.debug("Disabling music") def SetAllSfxEnables(self, bEnabled): for i in range(len(self.sfxManagerList)): if (self.sfxManagerIsValidList[i]): self.sfxManagerList[i].setActive(bEnabled) def enableSoundEffects(self, bEnableSoundEffects): if self.AppHasAudioFocus or (bEnableSoundEffects==0): self.SetAllSfxEnables(bEnableSoundEffects) self.sfxActive=bEnableSoundEffects if bEnableSoundEffects: self.notify.debug("Enabling sound effects") else: self.notify.debug("Disabling sound effects") def disableAllAudio(self): self.AppHasAudioFocus = 0 self.SetAllSfxEnables(0) if self.musicManagerIsValid: self.musicManager.setActive(0) self.notify.debug("Disabling audio") def enableAllAudio(self): self.AppHasAudioFocus = 1 self.SetAllSfxEnables(self.sfxActive) if self.musicManagerIsValid: self.musicManager.setActive(self.musicActive) self.notify.debug("Enabling audio") | def createAudioManager(self): self.sfxManager = AudioManager.createAudioManager() self.sfxManagerIsValid=self.sfxManager!=None \ and self.sfxManager.isValid() if self.sfxManagerIsValid: self.sfxManager.setActive(self.sfxActive) | 2ac25dc558bb4f703cc7eb924071ecbb408410a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/2ac25dc558bb4f703cc7eb924071ecbb408410a1/ShowBase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12719,
1318,
12,
2890,
4672,
365,
18,
87,
19595,
1318,
273,
15045,
1318,
18,
2640,
12719,
1318,
1435,
365,
18,
87,
19595,
1318,
20536,
33,
2890,
18,
87,
19595,
1318,
5,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12719,
1318,
12,
2890,
4672,
365,
18,
87,
19595,
1318,
273,
15045,
1318,
18,
2640,
12719,
1318,
1435,
365,
18,
87,
19595,
1318,
20536,
33,
2890,
18,
87,
19595,
1318,
5,
33,
7036,
... |
ValueError, "BCH codes does not exist with the given input." | raise ValueError, "BCH codes does not exist with the given input." | def BCHCode(n,delta,F,b=0): r""" A 'Bose-Chaudhuri-Hockenghem code' (or BCH code for short) is the largest possible cyclic code of length n over field F=GF(q), whose generator polynomial has zeros (which contain the set) $Z = \{a^{b},a^{b+1}, ..., a^{b+delta-2}\}$, where a is a primitive $n^{th}$ root of unity in the splitting field $GF(q^m)$, b is an integer $0\leq b\leq n-delta+1$ and m is the multiplicative order of q modulo n. (The integers $b,...,b+delta-2$ typically lie in the range $1,...,n-1$.) The integer $delta \geq 1$ is called the "designed distance". The length n of the code and the size q of the base field must be relatively prime. The generator polynomial is equal to the least common multiple of the minimal polynomials of the elements of the set $Z$ above. Special cases are b=1 (resulting codes are called 'narrow-sense' BCH codes), and $n=q^m-1$ (known as 'primitive' BCH codes). It may happen that several values of delta give rise to the same BCH code. Thlargest one is called the Bose distance of the code. The true minimum distance, d, of the code is greater than or equal to the Bose distance, so $d\geq delta$. EXAMPLES: sage: FF.<a> = GF(3^2,"a") sage: x = PolynomialRing(FF,"x").gen() sage: L = [b.minpoly() for b in [a,a^2,a^3]]; g = LCM(L) sage: f = x^(8)-1 sage: g.divides(f) True sage: C = CyclicCode(8,g); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3),1); C Linear code of length 8, dimension 4 over Finite Field of size 3 sage: C.minimum_distance() 4 sage: C = BCHCode(8,3,GF(3)); C Linear code of length 8, dimension 3 over Finite Field of size 3 sage: C.minimum_distance() 5 REFERENCES: [HP] W. C. Huffman, V. Pless, Fundamentals of Error-Correcting Codes, Cambridge Univ. Press, 2003. """ q = F.order() R = IntegerModRing(n) m = R(q).multiplicative_order() FF = GF(q**m,"a"); a = FF.gen() x = PolynomialRing(FF,"x").gen() L0 = [a**i for i in range(b,b+delta)] L1 = [b.minpoly() for b in L0] g = LCM(L1) if not(g.divides(x**n-1)): ValueError, "BCH codes does not exist with the given input." return CyclicCodeFromGeneratingPolynomial(n,g) | d2c4dcfbc2ea652477956c101c383f86fc539afd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2c4dcfbc2ea652477956c101c383f86fc539afd/code_constructions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
605,
1792,
1085,
12,
82,
16,
9878,
16,
42,
16,
70,
33,
20,
4672,
436,
8395,
432,
296,
38,
2584,
17,
782,
24901,
76,
1650,
17,
44,
975,
275,
17680,
351,
981,
11,
261,
280,
605,
1792... |
super(ContactForm, self).__init__(data=data, files=files, *args, **kwargs) | super(ContactBaseForm, self).__init__(data=data, files=files, *args, **kwargs) | def __init__(self, data=None, files=None, request=None, *args, **kwargs): if request is None: raise TypeError("Keyword argument 'request' must be supplied") super(ContactForm, self).__init__(data=data, files=files, *args, **kwargs) self.request = request | a00e74ecf453c6c0ef288cd9348a79439906a2f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9004/a00e74ecf453c6c0ef288cd9348a79439906a2f1/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
1390,
33,
7036,
16,
590,
33,
7036,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
590,
353,
599,
30,
1002,
3580,
2932,
8736,
1237,
296,
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,
2738,
972,
12,
2890,
16,
501,
33,
7036,
16,
1390,
33,
7036,
16,
590,
33,
7036,
16,
380,
1968,
16,
2826,
4333,
4672,
309,
590,
353,
599,
30,
1002,
3580,
2932,
8736,
1237,
296,
2... |
if 'CFBundleShortVersionString' in pl: | if pl.get('CFBundleShortVersionString'): | def getVersionString(pl): # Gets a version string from the plist. # if there's a valid CFBundleShortVersionString, returns that. # else if there's a CFBundleVersion, returns that # else returns an empty string. CFBundleShortVersionString = '' if 'CFBundleShortVersionString' in pl: CFBundleShortVersionString = \ pl['CFBundleShortVersionString'].split()[0] if "Bundle versions string, short" in pl: CFBundleShortVersionString = \ pl['Bundle versions string, short'].split()[0] if CFBundleShortVersionString: if CFBundleShortVersionString[0] in "0123456789": # starts with a number; that's good # now for another edge case thanks to Adobe: # replace commas with periods CFBundleShortVersionString = \ CFBundleShortVersionString.replace(',','.') return CFBundleShortVersionString if 'CFBundleVersion' in pl: # no CFBundleShortVersionString, or bad one CFBundleVersion = str(pl['CFBundleVersion']).split()[0] if CFBundleVersion[0] in "0123456789": # starts with a number; that's good # now for another edge case thanks to Adobe: # replace commas with periods CFBundleVersion = CFBundleVersion.replace(',','.') return CFBundleVersion return '' | 2bb654567cd5ddf42ad65bae6ed0ea2b6011ee28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/2bb654567cd5ddf42ad65bae6ed0ea2b6011ee28/munkicommon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8343,
780,
12,
412,
4672,
468,
11881,
279,
1177,
533,
628,
326,
21074,
18,
468,
309,
1915,
1807,
279,
923,
6123,
3405,
4897,
1444,
780,
16,
1135,
716,
18,
468,
469,
309,
1915,
1807,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8343,
780,
12,
412,
4672,
468,
11881,
279,
1177,
533,
628,
326,
21074,
18,
468,
309,
1915,
1807,
279,
923,
6123,
3405,
4897,
1444,
780,
16,
1135,
716,
18,
468,
469,
309,
1915,
1807,
27... |
self.vo = gConfig.getValue('/DIRAC/VirtualOrganization', 'lhcb') | self.vo = gConfig.getValue( '/DIRAC/VirtualOrganization', 'lhcb' ) | def __init__(self,storageName,protocol,path,host,port,spaceToken,wspath): self.isok = True self.gfal = False self.lcg_util = False | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5697,
461,
16,
8373,
16,
803,
16,
2564,
16,
655,
16,
2981,
1345,
16,
4749,
803,
4672,
365,
18,
291,
601,
273,
1053,
365,
18,
75,
74,
287,
273,
1083,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5697,
461,
16,
8373,
16,
803,
16,
2564,
16,
655,
16,
2981,
1345,
16,
4749,
803,
4672,
365,
18,
291,
601,
273,
1053,
365,
18,
75,
74,
287,
273,
1083,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.DoubleField.__init__(self, 834) else quickfix.DoubleField.__init__(self, 834, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
5026,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
5265,
974,
16186,
2738,
972,
12,
2890,
16,
1725,
5026,
13,
469,
9549,
904,
18,
5265,
974,
16186,
2738,
... |
def connect_ec2(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): | def connect_ec2(self, aws_access_key_id=None, aws_secret_access_key=None, **kwargs): | def connect_ec2(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): if aws_access_key_id == None: aws_access_key_id = self.config.get("Credentials", "aws_access_key_id") if aws_secret_access_key == None: aws_secret_access_key = self.config.get("Credentials", "aws_secret_access_key") return boto.connect_ec2(aws_access_key_id, aws_access_key_id, **kwargs) | ca6d8cd5334c879c346dc0576450e57a18f6fef1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10599/ca6d8cd5334c879c346dc0576450e57a18f6fef1/environment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
67,
557,
22,
12,
2890,
16,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
2826,
4333,
4672,
309,
2287,
67,
3860,
67,
856,
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,
3077,
67,
557,
22,
12,
2890,
16,
2287,
67,
3860,
67,
856,
67,
350,
33,
7036,
16,
2287,
67,
5875,
67,
3860,
67,
856,
33,
7036,
16,
2826,
4333,
4672,
309,
2287,
67,
3860,
67,
856,
67... |
print subVars("Headings","before-numbered-headings",linenum,enum) | print subVars("Headings","before-numbered-headings") | def handleNumbered(linenum,enum): global outline, parents v["%%"] = outline[linenum][0] children = getChildren(linenum) if enum == 1: print subVars("Headings","before-numbered-headings",linenum,enum) if children: print subVars("Headings","branch-numbered-heading",linenum,enum) parents.append([linenum,enum]) handleObjects(children) parents.pop() print subVars("Headings","after-numbered-headings",linenum,enum) else: print subVars("Headings","leaf-numbered-heading",linenum,enum) | 06415efd07e1e7445f08ac0ea608650310478422 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6154/06415efd07e1e7445f08ac0ea608650310478422/otl2tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1854,
329,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
331,
9614,
11438,
11929,
273,
16363,
63,
7511,
7924,
6362,
20,
65,
2325,
273,
10268,
12,
7511,
7924,
13,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1854,
329,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
225,
331,
9614,
11438,
11929,
273,
16363,
63,
7511,
7924,
6362,
20,
65,
2325,
273,
10268,
12,
7511,
7924,
13,
309,... |
str -- cputime information | str -- time information | def data_to_list(out, n, time): """ Convert output of Hart's sieve and n to a list and time. INPUT: out -- snapshot of text output of Hart's QuadraticSieve program n -- the integer being factored OUTPUT: list -- proper factors found so far str -- cputime information """ if time: out = out.strip() w = out.split('\n') t = get_time(w[-1]) out = '\n'.join(w[:-1]) else: t = '' Z = sage.rings.integer.Integer i = out.find(':') if i == -1: return [] v = out[i+1:].split() v = list(set([Z(m) for m in v if Z(m) != n])) v.sort() return v, t | c72cb41de260fcfa8265885e73fdf7027366e905 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/c72cb41de260fcfa8265885e73fdf7027366e905/qsieve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
67,
869,
67,
1098,
12,
659,
16,
290,
16,
813,
4672,
3536,
4037,
876,
434,
670,
485,
1807,
272,
21271,
471,
290,
358,
279,
666,
471,
813,
18,
225,
12943,
30,
596,
1493,
4439,
434... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
67,
869,
67,
1098,
12,
659,
16,
290,
16,
813,
4672,
3536,
4037,
876,
434,
670,
485,
1807,
272,
21271,
471,
290,
358,
279,
666,
471,
813,
18,
225,
12943,
30,
596,
1493,
4439,
434... |
Can you use SAGE to find a counterexample to the conjecture? | Can you use Sage to find a counterexample to the conjecture? | def lucas_number1(n,P,Q): """ Returns then n-th Lucas number ``of the first kind'' (this is not standard terminology). The Lucas sequence $L^{(1)}_n$ is defined by the initial conditions $L^{(1)}_1=0$, $L^{(1)}_2=1$ and the recurrence relation $L^{(1)}_{n+2} = P*L^{(1)}_{n+1} - Q*L^{(1)}_n$. Wraps GAP's Lucas(...)[1]. P=1, Q=-1 fives the Fibonacci sequence. INPUT: n -- integer P, Q -- integer or rational numbers OUTPUT: integer or rational number EXAMPLES: sage: lucas_number1(5,1,-1) 5 sage: lucas_number1(6,1,-1) 8 sage: lucas_number1(7,1,-1) 13 sage: lucas_number1(7,1,-2) 43 sage: lucas_number1(5,2,3/5) 229/25 sage: lucas_number1(5,2,1.5) Traceback (most recent call last): ... TypeError: no canonical coercion from Real Field with 53 bits of precision to Rational Field There was a conjecture that the sequence $L_n$ defined by $L_{n+2} = L_{n+1} + L_n$, $L_1=1$, $L_2=3$, has the property that $n$ prime implies that $L_n$ is prime. sage: lucas = lambda n:(5/2)*lucas_number1(n,1,-1)+(1/2)*lucas_number2(n,1,-1) sage: [[lucas(n),is_prime(lucas(n)),n+1,is_prime(n+1)] for n in range(15)] [[1, False, 1, False], [3, True, 2, True], [4, False, 3, True], [7, True, 4, False], [11, True, 5, True], [18, False, 6, False], [29, True, 7, True], [47, True, 8, False], [76, False, 9, False], [123, False, 10, False], [199, True, 11, True], [322, False, 12, False], [521, True, 13, True], [843, False, 14, False], [1364, False, 15, False]] Can you use SAGE to find a counterexample to the conjecture? """ ans=gap.eval("Lucas(%s,%s,%s)[1]"%(QQ._coerce_(P),QQ._coerce_(Q),ZZ(n))) return sage_eval(ans) | fcc51f78ab94f4ee5fa3e2e7e0a10872da32b076 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fcc51f78ab94f4ee5fa3e2e7e0a10872da32b076/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
5286,
345,
67,
2696,
21,
12,
82,
16,
52,
16,
53,
4672,
3536,
2860,
1508,
290,
17,
451,
511,
5286,
345,
1300,
12176,
792,
326,
1122,
3846,
6309,
261,
2211,
353,
486,
4529,
16122,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
5286,
345,
67,
2696,
21,
12,
82,
16,
52,
16,
53,
4672,
3536,
2860,
1508,
290,
17,
451,
511,
5286,
345,
1300,
12176,
792,
326,
1122,
3846,
6309,
261,
2211,
353,
486,
4529,
16122,
... |
elif "killing" in logdata: | elif "kill" in logdata: | def do_actual_test(testtype, restrictionfn, testname, is_python_test): global endput global mobileNoSubprocess # match python if testtype == 's': if not mobileNoSubprocess: (pyout, pyerr) = exec_command('python '+testname) (testout, testerr) = exec_repy_script(testname, restrictionfn, {'simple':''}) else: # TODO: Read in captured tests and compare with exec repy script output? (testout, testerr) = exec_repy_script(testname, restrictionfn, {'simple':''}) pyout = testout pyerr = testerr capture_test_result(testname, pyout, pyerr, ".py") capture_test_result(testname, testout, testerr, ".repy") same = True if pyout != testout: # stdout differs endput = endput+testname+"\n"+ "standard out mismatch '"+pyout+"' != '"+testout+"'\n\n" same = False if pyerr != testerr: # stderr differs endput = endput+testname+"\n"+ "standard err mismatch '"+pyerr+"' != '"+testerr+"'\n\n" same = False return same # any out, no err... elif testtype == 'n': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout != '' and testerr == '': return True elif mobileNoSubprocess and testout != '' and testout.find('Traceback') == -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # any err, no out... elif testtype == 'e': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout == '' and testerr != '': return True elif mobileNoSubprocess and testout.find('Traceback') != -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # no err, no out... elif testtype == 'z': if is_python_test: (testout, testerr) = exec_command("python " + testname) else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if testout == '' and testerr == '': return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # any err, any out... elif testtype == 'b': if is_python_test: (testout, testerr) = exec_repy_script(testname, '') else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") if (not mobileNoSubprocess) and testout != '' and testerr != '': return True elif mobileNoSubprocess and testout.find('Traceback') != -1: return True else: endput = endput+testname+"\nout:"+testout+"err:"+ testerr+"\n\n" return False # no err, no out (logging)... elif testtype == 'l': # remove any existing log try: os.remove("experiment.log.old") os.remove("experiment.log.new") except OSError: pass # run the experiment if not mobileNoSubprocess: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'logfile':'experiment.log', 'status':'foo'}) else: (testout, testerr) = exec_repy_script(testname, restrictionfn, {'status':'foo'}) capture_test_result(testname, testout, testerr, ".repy") # first, check to make sure there was no output or error if mobileNoSubprocess or (testout == '' and testerr == ''): if not mobileNoSubprocess: try: myfo = file("experiment.log.old","r") logdata = myfo.read() myfo.close() if os.path.exists("experiment.log.new"): myfo = file("experiment.log.new","r") logdata = logdata + myfo.read() myfo.close() # use only the last 16KB logdata = logdata[-16*1024:] except: endput = endput+testname+"\nCan't read log!\n\n" return False else: logdata = testout if "Fail" in logdata: endput = endput+testname+"\nString 'Fail' in logdata\n\n" return False # Armon: Use this to test that logging from the external process is working elif "killing" in logdata: return True elif "Success" not in logdata: endput = endput+testname+"\nString 'Success' or 'killing' not in logdata\n\n" return False else: return True else: endput = endput+testname+"\nHad output or errput! out:"+testout+"err:"+ testerr+"\n\n" return False else: raise Exception, "Unknown test type '"+str(testout)+"'" | d8ac0874850202813e63a494191075408d02a897 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/d8ac0874850202813e63a494191075408d02a897/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
18672,
67,
3813,
12,
3813,
723,
16,
9318,
4293,
16,
1842,
529,
16,
353,
67,
8103,
67,
3813,
4672,
2552,
679,
458,
2552,
13411,
2279,
1676,
2567,
225,
468,
845,
5790,
309,
1842... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
18672,
67,
3813,
12,
3813,
723,
16,
9318,
4293,
16,
1842,
529,
16,
353,
67,
8103,
67,
3813,
4672,
2552,
679,
458,
2552,
13411,
2279,
1676,
2567,
225,
468,
845,
5790,
309,
1842... |
class FooterActions(common.ViewletBase): | class FooterActions(ViewletBase): | def update(self): # from viewletbase self.portal_state = getMultiAdapter((self.context, self.request), name=u'plone_portal_state') self.site_url = self.portal_state.portal_url() | 7cf764824bfbaaa6785669e5b91cf263affd05ab /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6871/7cf764824bfbaaa6785669e5b91cf263affd05ab/viewlets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
468,
628,
1476,
1810,
1969,
365,
18,
24386,
67,
2019,
273,
31863,
4216,
12443,
2890,
18,
2472,
16,
365,
18,
2293,
3631,
508,
33,
89,
11,
412,
476,
67,
24386,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
468,
628,
1476,
1810,
1969,
365,
18,
24386,
67,
2019,
273,
31863,
4216,
12443,
2890,
18,
2472,
16,
365,
18,
2293,
3631,
508,
33,
89,
11,
412,
476,
67,
24386,
67,
... |
cwd=cwd) | cwd=cwd, env=env) | def call_subprocess(cmd, show_stdout=True, filter_stdout=None, cwd=None, raise_on_returncode=True): cmd_parts = [] for part in cmd: if ' ' in part or '\n' in part or '"' in part or "'" in part: part = '"%s"' % part.replace('"', '\\"') cmd_parts.append(part) cmd_desc = ' '.join(cmd_parts) if show_stdout: stdout = None else: stdout = subprocess.PIPE logger.debug("Running command %s" % cmd_desc) try: proc = subprocess.Popen( cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, cwd=cwd) except Exception, e: logger.fatal( "Error %s while executing command %s" % (e, cmd_desc)) raise if stdout is not None: stdout = proc.stdout while 1: line = stdout.readline() if not line: break line = line.rstrip() if filter_stdout: level = filter_stdout(line) if isinstance(level, tuple): level, line = level logger.log(level, line) if not logger.stdout_level_matches(level): logger.show_progress() else: logger.info(line) else: proc.communicate() proc.wait() if proc.returncode: if raise_on_returncode: raise OSError( "Command %s failed with error code %s" % (cmd_desc, proc.returncode)) else: logger.warn( "Command %s had error code %s" % (cmd_desc, proc.returncode)) | 3b6e4846a45fc1208324a411d5ffcc94decf518d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12981/3b6e4846a45fc1208324a411d5ffcc94decf518d/virtualenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
1717,
2567,
12,
4172,
16,
2405,
67,
10283,
33,
5510,
16,
1034,
67,
10283,
33,
7036,
16,
7239,
33,
7036,
16,
1002,
67,
265,
67,
2463,
710,
33,
5510,
4672,
1797,
67,
6019,
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,
745,
67,
1717,
2567,
12,
4172,
16,
2405,
67,
10283,
33,
5510,
16,
1034,
67,
10283,
33,
7036,
16,
7239,
33,
7036,
16,
1002,
67,
265,
67,
2463,
710,
33,
5510,
4672,
1797,
67,
6019,
273... |
def findnames(file, prefix=""): | def findnames(file, prefixes=()): | def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names | 579a88041a1a9cc8ca9f85676580727206847931 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/579a88041a1a9cc8ca9f85676580727206847931/undoc_symbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1973,
12,
768,
16,
9419,
33,
1435,
4672,
1257,
273,
2618,
364,
980,
316,
585,
18,
896,
3548,
13332,
309,
980,
63,
20,
65,
422,
11817,
4278,
1324,
1466,
273,
980,
18,
4939,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
1973,
12,
768,
16,
9419,
33,
1435,
4672,
1257,
273,
2618,
364,
980,
316,
585,
18,
896,
3548,
13332,
309,
980,
63,
20,
65,
422,
11817,
4278,
1324,
1466,
273,
980,
18,
4939,
1435,
... |
args['vcpus'] = self.be_bnew[constants.BE_VCPUS] | args['vcpus'] = self.be_new[constants.BE_VCPUS] | def BuildHooksEnv(self): """Build hooks env. | 61be6ba4f7b5cc8442261cbf7f8d33a5d0aa44a2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/61be6ba4f7b5cc8442261cbf7f8d33a5d0aa44a2/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
13620,
3491,
12,
2890,
4672,
3536,
3116,
9153,
1550,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3998,
13620,
3491,
12,
2890,
4672,
3536,
3116,
9153,
1550,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
__id__ = "$Id: Advection_diffusion.py,v 1.19 2003/11/28 22:17:26 tan2 Exp $" | __id__ = "$Id: Advection_diffusion.py,v 1.20 2004/05/26 23:53:35 tan2 Exp $" | def stable_timestep(self): dt = self.CitcomModule.stable_timestep(self.all_variables) return dt | ce1f445ba77690331f86849d82dc6483a85ec693 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8488/ce1f445ba77690331f86849d82dc6483a85ec693/Advection_diffusion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14114,
67,
8584,
395,
881,
12,
2890,
4672,
3681,
273,
365,
18,
39,
305,
832,
3120,
18,
15021,
67,
8584,
395,
881,
12,
2890,
18,
454,
67,
7528,
13,
327,
3681,
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,
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,
14114,
67,
8584,
395,
881,
12,
2890,
4672,
3681,
273,
365,
18,
39,
305,
832,
3120,
18,
15021,
67,
8584,
395,
881,
12,
2890,
18,
454,
67,
7528,
13,
327,
3681,
2,
-100,
-100,
-100,
-10... |
cline = cline + " -NEWTREE=%s -align" % self.new_tree | cline += " -NEWTREE=%s -align" % self.new_tree | def __str__(self): """Write out the command line as a string.""" cline = self.command + " " + self.sequence_file | 2eec844bd4b813ca4a021c23a58ac4936477a812 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7167/2eec844bd4b813ca4a021c23a58ac4936477a812/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
3536,
3067,
596,
326,
1296,
980,
487,
279,
533,
12123,
927,
558,
273,
365,
18,
3076,
397,
315,
315,
397,
365,
18,
6178,
67,
768,
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,
1001,
701,
972,
12,
2890,
4672,
3536,
3067,
596,
326,
1296,
980,
487,
279,
533,
12123,
927,
558,
273,
365,
18,
3076,
397,
315,
315,
397,
365,
18,
6178,
67,
768,
2,
-100,
-100,
-100,
... |
wikipedia.output(u'%s\n Loaded %s regular expresions\n%s' % ('-'*50, len(avbotglobals.vandalRegexps.items()), '-'*50)) | wikipedia.output(u'\nLoaded %s regular expresions...' % (len(avbotglobals.vandalRegexps.items()))) | def loadRegexpList(): """ Carga lista de expresiones regulares """ """ Load regular expression list """ #p=wikipedia.Page(avbotglobals.preferences['site'], u'User:%s/Lista del bien y del mal.css' % avbotglobals.preferences['ownerNick']) goodandevil=u'Lista del bien y del mal.css' if avbotglobals.preferences['site'].lang=='en': goodandevil=u'Good and evil list.css' elif avbotglobals.preferences['site'].lang=='pt': goodandevil=u'Expressões.css' p=wikipedia.Page(avbotglobals.preferences['site'], u'%s:%s/%s' % (avbotglobals.namespaces[2], avbotglobals.preferences['ownerNick'], goodandevil)) raw='' if p.exists(): if not p.isRedirectPage() and not p.isDisambig(): raw=p.get() else: wikipedia.output(u'A preferences page is needed in [[%s]]' % p.title()) wikipedia.output(u'#Introduce one regexp per line. Format: REGEXP;;POINTS;;CLASS;;') if not avbotglobals.preferences['force']: sys.exit() c=0 error=u'' avbotglobals.vandalRegexps={} dontsort=[] dosort=[] for l in raw.splitlines(): c+=1 l=l.strip() if len(l)>=12: #Avoid short dangerous regexps if l=='<pre>' or l=='</pre>': #Skip preformatted labels continue if l[0]=='#' or l[0]=='<': #Skip no regexps lines dontsort.append(l) continue l=l.lower() #Be careful with LoadMessages(), always lower or always upper dosort.append(l) try: l=re.sub(ur"(?im)^([^\#]*?)\#[^\n\r]*?$", ur"\1", l)#Clean inline comments t=l.split(';;') type=t[2] reg=t[0] score=int(t[1]) regex=ur'%s%s%s' % (avbotglobals.preferences['context'], reg, avbotglobals.preferences['context']) avbotglobals.vandalRegexps[reg]={'type':type, 'compiled':re.compile(ur'(?im)%s' % regex), 'score':score} except: error+=u'** Regexp error: Line: %d\n' % c #Sorting list #dejo de funcionar con la api? #dosort.sort() #if not avbotglobals.preferences['nosave']: #ordenada=wikipedia.Page(avbotglobals.preferences['site'], u'User:%s/Lista del bien y del mal.css' % avbotglobals.preferences['botNick']) #ordenada.put(u'<pre>\n%s\n\n%s\n</pre>' % ('\n'.join(dontsort), '\n'.join(dosort)), u'BOT - Ordenando lista [[User:Emijrp/Lista del bien y del mal.css]]') wikipedia.output(u'%s\n Loaded %s regular expresions\n%s' % ('-'*50, len(avbotglobals.vandalRegexps.items()), '-'*50)) return error | 027e589bf2acac38cd09859ce3933751c2e2d5b4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3342/027e589bf2acac38cd09859ce3933751c2e2d5b4/avbotload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
14621,
682,
13332,
3536,
385,
3175,
69,
17822,
443,
1329,
455,
285,
281,
960,
332,
4807,
3536,
3536,
4444,
6736,
2652,
666,
3536,
468,
84,
33,
11999,
13744,
18,
1964,
12,
842,
4819... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14621,
682,
13332,
3536,
385,
3175,
69,
17822,
443,
1329,
455,
285,
281,
960,
332,
4807,
3536,
3536,
4444,
6736,
2652,
666,
3536,
468,
84,
33,
11999,
13744,
18,
1964,
12,
842,
4819... |
def write_allow (zapfile, pattern): title = "AdZapper PASS filter" desc = "Automatically generated, you should not edit this filter." scheme, host, path, query, fragment = urlparse.urlsplit(pattern) d = locals() for key, value in d: d[key] = xmlify(value) | def write_allow (zapfile, adclass, pattern): d = get_rule_dict(adclass, pattern) | def write_allow (zapfile, pattern): title = "AdZapper PASS filter" desc = "Automatically generated, you should not edit this filter." scheme, host, path, query, fragment = urlparse.urlsplit(pattern) d = locals() for key, value in d: d[key] = xmlify(value) zapfile.write("""<allow title="%(title)s" desc="%(desc)s" scheme="%(scheme)s" host="%(host)s" path="%(path)s" query="%(query)s" fragment="%(fragment)s"/> | 5fa0e81bf922324d404b7f57f5fdb223b9c2790a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/5fa0e81bf922324d404b7f57f5fdb223b9c2790a/adzap2wc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5965,
261,
94,
438,
768,
16,
1261,
1106,
16,
1936,
4672,
225,
302,
273,
336,
67,
5345,
67,
1576,
12,
361,
1106,
16,
1936,
13,
11419,
768,
18,
2626,
2932,
3660,
32,
5965,
20... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
5965,
261,
94,
438,
768,
16,
1261,
1106,
16,
1936,
4672,
225,
302,
273,
336,
67,
5345,
67,
1576,
12,
361,
1106,
16,
1936,
13,
11419,
768,
18,
2626,
2932,
3660,
32,
5965,
20... |
return self.exceptions == other.exceptions | if isinstance(other, CatchAllCondition): return self.exceptions == other.exceptions return False | def __eq__(self, other): return self.exceptions == other.exceptions | 9c21c2edd99372f5e19d02f24a28a58b1c75efe2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3449/9c21c2edd99372f5e19d02f24a28a58b1c75efe2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11253,
972,
12,
2890,
16,
1308,
4672,
327,
365,
18,
11855,
422,
1308,
18,
11855,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11253,
972,
12,
2890,
16,
1308,
4672,
327,
365,
18,
11855,
422,
1308,
18,
11855,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
ligolw.make_parser(ContentHandler(xmldoc)).parse(fileobj) | ligolw.make_parser((contenthandler or ContentHandler)(xmldoc)).parse(fileobj) | def load_fileobj(fileobj, gz = False, xmldoc = None): """ Parse the contents of the file object fileobj, and return the contents as a LIGO Light Weight document tree. The file object does not need to be seekable. The file is gzip decompressed while reading if gz is set to True. If the optional xmldoc argument is provided and not None, the parsed XML tree will be appended to that document, otherwise a new document will be created. The return value is a tuple, the first element of the tuple is the XML document and the second is a string containing the MD5 digest in hex digits of the bytestream that was parsed. Example: >>> import sys >>> xmldoc, digest = utils.load_fileobj(sys.stdin, verbose = True, gz = True) """ fileobj = MD5File(fileobj) md5obj = fileobj.md5obj if gz: fileobj = gzip.GzipFile(mode = "rb", fileobj = RewindableInputFile(fileobj)) if xmldoc is None: xmldoc = ligolw.Document() ligolw.make_parser(ContentHandler(xmldoc)).parse(fileobj) return xmldoc, md5obj.hexdigest() | 13c86842bf2f455a05128a39b2ce65464e3af786 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/13c86842bf2f455a05128a39b2ce65464e3af786/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
768,
2603,
12,
768,
2603,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
4672,
3536,
2884,
326,
2939,
434,
326,
585,
733,
17041,
16,
471,
327,
326,
2939,
487,
279,
511,
3047... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
2603,
12,
768,
2603,
16,
14136,
273,
1083,
16,
2025,
2434,
273,
599,
4672,
3536,
2884,
326,
2939,
434,
326,
585,
733,
17041,
16,
471,
327,
326,
2939,
487,
279,
511,
3047... |
print options print opts | def _tree(self,options): opts=CharBuffer(options) print options print opts name=opts.next_word() if opts.next_nonwhitespace()!='=': raise NexusError,'Syntax error in tree description: %s' % options[:50] rooted=False weight=1.0 while opts.peek_nonwhitespace()=='[': open=opts.next_nonwhitespace() symbol=opts.next() if symbol!='&': raise NexusError,'Illegal special comment [%s...] in tree description: %s' % (symbol, options[:50]) special=opts.next() value=opts.next_until(']') closing=opts.next() if special=='R': rooted=True elif special=='U': rooted=False elif special=='W': weight=float(value) tree=Tree(name=name,weight=weight,rooted=rooted,tree=opts.rest().strip()) # if there's an active translation table, translate if self.translate: for n in tree.get_terminals(): try: tree.node(n).data.taxon=safename(self.translate[int(tree.node(n).data.taxon)]) except (ValueError,KeyError): raise NexusError,'Unable to substitue %s using \'translate\' data.' % tree.node(n).data.taxon self.trees.append(tree) | d42b00fd8f167a72f54536d537e9bcd57395f58a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/d42b00fd8f167a72f54536d537e9bcd57395f58a/Nexus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3413,
12,
2890,
16,
2116,
4672,
1500,
33,
2156,
1892,
12,
2116,
13,
508,
33,
4952,
18,
4285,
67,
1095,
1435,
309,
1500,
18,
4285,
67,
5836,
18777,
1435,
5,
2218,
2218,
30,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3413,
12,
2890,
16,
2116,
4672,
1500,
33,
2156,
1892,
12,
2116,
13,
508,
33,
4952,
18,
4285,
67,
1095,
1435,
309,
1500,
18,
4285,
67,
5836,
18777,
1435,
5,
2218,
2218,
30,
1002,
... | |
return self.expand(''.join(self.dns_txt(self.expand(spec)))) | txt = ''.join(self.dns_txt(self.expand(spec))) return self.expand(txt,stripdot=False) | def get_explanation(self, spec): """Expand an explanation.""" if spec: return self.expand(''.join(self.dns_txt(self.expand(spec)))) else: return 'explanation : Required option is missing' | 357cd1b740e7a93a1ed954617028ed60ebab9137 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/139/357cd1b740e7a93a1ed954617028ed60ebab9137/spf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
338,
15854,
12,
2890,
16,
857,
4672,
3536,
12271,
392,
21285,
12123,
309,
857,
30,
6463,
273,
875,
18,
5701,
12,
2890,
18,
14926,
67,
5830,
12,
2890,
18,
12320,
12,
2793,
2034... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
338,
15854,
12,
2890,
16,
857,
4672,
3536,
12271,
392,
21285,
12123,
309,
857,
30,
6463,
273,
875,
18,
5701,
12,
2890,
18,
14926,
67,
5830,
12,
2890,
18,
12320,
12,
2793,
2034... |
@verbose: if verbose, will print the sqlquery used | def populate_stats_list(self, connection, limit = None, filter = ''): """ Gets top stats from database for later ranking @connection: connection to a sqlite database @limit: put a limit on the number of stats to rank @filter: apply a filter (i.e., a SQLite WHERE clause). Note: If the filter uses colums from tables other than self.table, must include the join conditions as well @verbose: if verbose, will print the sqlquery used """ if limit is not None: limit = "LIMIT " + str(limit) else: limit = '' sqlquery = ''.join([""" SELECT """, self.ranking_stat, """ FROM """, self.table, filter, """ ORDER BY """, self.ranking_stat, ' ', self.rank_by, """ """, limit ]) self.stats = [stat[0] for stat in connection.cursor().execute(sqlquery).fetchall()] self.stats.sort() | 5f2565ff73ac5bb136a63ea9bdcc2f3d54c21eb8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/5f2565ff73ac5bb136a63ea9bdcc2f3d54c21eb8/ligolw_sqlutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
5296,
67,
1098,
12,
2890,
16,
1459,
16,
1800,
273,
599,
16,
1034,
273,
875,
4672,
3536,
11881,
1760,
3177,
628,
2063,
364,
5137,
23087,
632,
4071,
30,
1459,
358,
279,
16184,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
5296,
67,
1098,
12,
2890,
16,
1459,
16,
1800,
273,
599,
16,
1034,
273,
875,
4672,
3536,
11881,
1760,
3177,
628,
2063,
364,
5137,
23087,
632,
4071,
30,
1459,
358,
279,
16184,
... | |
return cjson.encode(session.statistics) + "\r\n" | return seq + " " + cjson.encode(session.statistics) + "\r\n" | def got_command(self, dispatcher, command, headers): if command == "update": local_media = self.session_manager.update_session(dispatcher, **headers) if local_media is None: return "halting\r\n" else: return " ".join([local_media[0][0]] + [str(media[1]) for media in local_media]) + "\r\n" else: # remove session = self.session_manager.remove_session(**headers) return cjson.encode(session.statistics) + "\r\n" | 5d8d23d72394b575564423e278067e682d95a428 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3445/5d8d23d72394b575564423e278067e682d95a428/relay.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
67,
3076,
12,
2890,
16,
7393,
16,
1296,
16,
1607,
4672,
309,
1296,
422,
315,
2725,
6877,
1191,
67,
5829,
273,
365,
18,
3184,
67,
4181,
18,
2725,
67,
3184,
12,
18495,
16,
2826,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
67,
3076,
12,
2890,
16,
7393,
16,
1296,
16,
1607,
4672,
309,
1296,
422,
315,
2725,
6877,
1191,
67,
5829,
273,
365,
18,
3184,
67,
4181,
18,
2725,
67,
3184,
12,
18495,
16,
2826,
... |
this_deps = deps[f] | return __mtime_cache.setdefault(f, os.path.getmtime(f)) except os.error: return __mtime_cache.setdefault(f, 0) def process_filename(f, m): base, ext = os.path.splitext(f) if ext == '.pyx': if m.language == 'c++': return base + '.cpp' else: return base + '.c' else: return f def compile_time(f, m): """ Return the time file f was last built as part of module m """ return mtime_or_zero("%s/%s"%(SITE_PACKAGES,f)) def compile_cmd(f, m): """ Command line to compile file f as part of module m """ if f.endswith('.pyx'): pyx_inst_file = '%s/%s'%(SITE_PACKAGES, f) print "%s --> %s"%(f, pyx_inst_file) os.system('cp %s %s 2>/dev/null'%(f, pyx_inst_file)) outfile = f[:-4] if m.language == 'c++': outfile += ".cpp" else: outfile += ".c" cmd = "python2.5 `which cython` --embed-positions --incref-local-binop -I%s -o %s %s"%(os.getcwd(), outfile, f) elif f.endswith(('.c','.cc','.cpp')): cmd = "touch %s"%f return cmd def implicit_deps(f): """ List of implicit dependencies for file f in module m E.g. .pxd file corresponding to a .pyx """ if f.endswith('.pyx'): name = f[:-4] + '.pxd' if os.path.exists(name): return [name] return [] def implicit_deps_mtime(f): """ Modification time of implicit dependencies in f (e.g. .pxd file corresponding to a .pyx) """ deps = implicit_deps(f) if len(deps) == 0: return 0 return max(map(mtime_or_zero, deps)) def recursive_mtime(f): """ Recursively compute last modification time of file f and included files. The computed values are cached in global dictionary '__recursive_mtime_cache' """ try: return __recursive_mtime_cache[f] | def need_to_build(deps, f, outfile): if is_newer(f, outfile): print '\nBuilding %s because it depends on %s.' % (outfile, f) return True try: this_deps = deps[f] except KeyError: # if we get this far, f has no includes, so it is a leaf node return False for d in this_deps: if need_to_build(deps, d, outfile): return True return False | c82811cc0b935d826f6cfba833e4406f8eb9ed19 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/c82811cc0b935d826f6cfba833e4406f8eb9ed19/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1608,
67,
869,
67,
3510,
12,
14877,
16,
284,
16,
8756,
4672,
309,
353,
67,
2704,
264,
12,
74,
16,
8756,
4672,
1172,
2337,
82,
16713,
738,
87,
2724,
518,
10935,
603,
738,
87,
1093,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1608,
67,
869,
67,
3510,
12,
14877,
16,
284,
16,
8756,
4672,
309,
353,
67,
2704,
264,
12,
74,
16,
8756,
4672,
1172,
2337,
82,
16713,
738,
87,
2724,
518,
10935,
603,
738,
87,
1093,
73... |
n.event_ConnectToMe(self.main, dc_ad.port, fail_cb) | n.event_ConnectToMe(self.main, port, fail_cb) | def fail_cb(detail): if err_visible: self.pushStatus( "*** Connection to <%s> failed: %s" % (nick, detail)) | dd234d528cd71d79e824f5c35919d0378f9bad49 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8524/dd234d528cd71d79e824f5c35919d0378f9bad49/dtella_dc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2321,
67,
7358,
12,
8992,
4672,
309,
393,
67,
8613,
30,
365,
18,
6206,
1482,
12,
315,
14465,
4050,
358,
23930,
87,
34,
2535,
30,
738,
87,
6,
738,
261,
17091,
16,
7664,
3719,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2321,
67,
7358,
12,
8992,
4672,
309,
393,
67,
8613,
30,
365,
18,
6206,
1482,
12,
315,
14465,
4050,
358,
23930,
87,
34,
2535,
30,
738,
87,
6,
738,
261,
17091,
16,
7664,
3719,
2,
-100,... |
"""Return a list with the distribution of k-dcrossings on complete matchings on n vertices. | """ Return a list with the distribution of k-dcrossings on complete matchings on n vertices. | def dcrossvec_cm(n): """Return a list with the distribution of k-dcrossings on complete matchings on n vertices. INPUT: n -- a nonnegative integer. OUTPUT: A list whose k'th entry is the number of complete matchings m for which dcrossing(m) = k. For example, let L = dcrossvec_cm(4). We have L = [0, 1, 0, 2]. L[1] is 1 because there's one matching on 4 vertices that is 1-dcrossing: [(2, 4), (1, 3)]. L[0] is zero because dcrossing() returns the *largest* k for which the matching has a dcrossing, and 0-dcrossing is equivalent to 1-dcrossing for complete matchings. One tricky bit is that noncrossing matchings get put at the end, because L[-1] is the last element of the list. Because of this, you should not think of the last element of the list as having index n-1, but rather -1. If n is negative, you get silly results. Don't use them in your next paper. :) EXAMPLES: The single complete matching on 2 vertices has no crossings, so the only nonzero entry of the list (the last entry) is 1: sage: from sage.tests.arxiv_0812_2725 import * sage: dcrossvec_cm(2) [0, 1] Similarly, the empty matching has no crossings: sage: dcrossvec_cm(0) [1] For odd n, there are no complete matchings, so the list has all zeros: sage: dcrossvec_cm(5) [0, 0, 0, 0, 0] sage: dcrossvec_cm(4) [0, 1, 0, 2] """ vec = [0] * max(n, 1) for m in CompleteMatchings(n): vec[dcrossing(m)] += 1 return vec | 68c6d34d0ab8083475ed792d9de3b56cc81dd56f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/68c6d34d0ab8083475ed792d9de3b56cc81dd56f/arxiv_0812_2725.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6744,
3984,
8799,
67,
7670,
12,
82,
4672,
3536,
2000,
279,
666,
598,
326,
7006,
434,
417,
17,
7201,
3984,
899,
603,
3912,
845,
899,
603,
290,
6928,
18,
225,
12943,
30,
290,
1493,
279,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6744,
3984,
8799,
67,
7670,
12,
82,
4672,
3536,
2000,
279,
666,
598,
326,
7006,
434,
417,
17,
7201,
3984,
899,
603,
3912,
845,
899,
603,
290,
6928,
18,
225,
12943,
30,
290,
1493,
279,
... |
if dirname[-1:] != "/": | if dirname[-1:] != "/" and dirname != "": | def genBasenames2(oldfilenames): (basenames, dirnames) = ([], []) for filename in oldfilenames: (dirname, basename) = os.path.split(filename) if dirname[-1:] != "/": dirname += "/" basenames.append(basename) dirnames.append(dirname) return (basenames, dirnames) | 427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
11494,
6809,
22,
12,
1673,
19875,
4672,
261,
9157,
6809,
16,
1577,
1973,
13,
273,
23265,
6487,
5378,
13,
364,
1544,
316,
1592,
19875,
30,
261,
12287,
16,
4882,
13,
273,
1140,
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,
3157,
11494,
6809,
22,
12,
1673,
19875,
4672,
261,
9157,
6809,
16,
1577,
1973,
13,
273,
23265,
6487,
5378,
13,
364,
1544,
316,
1592,
19875,
30,
261,
12287,
16,
4882,
13,
273,
1140,
18,
... |
sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'dillhole':['b2','=', 0]}) | sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'expression':['b2','=', 0]}) | def delete_rows(self, query): """ DOCSTRING COMMENTS: - Query must have no join statements (you can only delete from one table at a time) (This might be an interesting TODO later, ie: another function that creates multiple delete statements from a query with joins... I don't think it's really necessary at this time though. - Use a query instance to modify your database. - Note that you cannot use a GenericSQLQuery. (NO RESPONSIBILITY) - If you would like to remove all data that satisfies a query, enter that query as a parameter in the delete_rows function. - Recommended use: have some kind of primary key column that you use as a parameter in the query - Be careful, test your query first. - (Examples of this) - Also note that this database must be the database that the query is associated with (test that?) ROBERT : I haven't tested this... if if doesn't work, then it is probably the param_tuple thing... send me an email if it's not working EXAMPLES: sage: DB = SQLDatabase() sage: DB.create_table('simon',{'a1':{'sql':'bool','primary_key':False}, 'b2':{'sql':'int', 'primary_key':False}}) sage: DB.add_data('simon',[(0,0),(1,1),(1,2)]) sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'dillhole':['b2','=', 0]}) sage: DB.delete_rows(p) sage: cur = DB.get_cursor() sage: (cur.execute('select * from simon')).fetchall() [(1, 1), (1, 2)] syntax: delete from table_name where blah=val """ # Check query is associated with this database # TODO : Robert, does this work? And do you suggest any other checking? if not isinstance(query, SQLQuery): raise TypeError('%s is not a valid SQLQuery'%query) if query.__database__ is not self: raise ValueError('%s is not associated to this database.'%query) if (query.__query_string__).__contains__(' JOIN '): raise ValueError('%s is not a valid query. Can only delete from one table at a time.'%query) delete_statement = re.sub('SELECT .* FROM', 'DELETE FROM', query.__query_string__) try: tup = str(query.__param_tuple__).rstrip(')') + ',)' cur = self.__connection__.cursor() if query.__param_tuple__ is not None: tup = [] for i in range(len(query.__param_tuple__)): tup.append(str(query.__param_tuple__[i])) cur.execute(delete_statement, tuple(tup)) else: cur.execute(delete_statement) except: raise RuntimeError('Failure to complete delete. Check your data.') | 12098d45ba68813e42a6a22032a2f2e6d360e158 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/12098d45ba68813e42a6a22032a2f2e6d360e158/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
3870,
12,
2890,
16,
843,
4672,
3536,
5467,
39,
5804,
19400,
55,
30,
300,
2770,
1297,
1240,
1158,
1233,
6317,
261,
19940,
848,
1338,
1430,
628,
1245,
1014,
622,
279,
813,
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,
1430,
67,
3870,
12,
2890,
16,
843,
4672,
3536,
5467,
39,
5804,
19400,
55,
30,
300,
2770,
1297,
1240,
1158,
1233,
6317,
261,
19940,
848,
1338,
1430,
628,
1245,
1014,
622,
279,
813,
13,
... |
this = apply(_quickfix.new_OrderID, args) | this = _quickfix.new_OrderID(*args) | def __init__(self, *args): this = apply(_quickfix.new_OrderID, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2448,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2448,
734,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
18... |
XmlData = map(lambda x: re.sub(r'(<\s*(?:[^:]*:)?VOName\s*>\s*).*?(\s*<\s*/)', | xmlData = map(lambda x: re.sub(r'(<\s*(?:[^:]*:)?VOName\s*>\s*).*?(\s*<\s*/)', | def SendXMLFiles(fileDir, removeOriginal = False): global Config path = os.path.join(fileDir, "*") files = glob.glob(path) probeNamePattern = re.compile(r'<\s*(?:[^:]*:)?ProbeName\s*>') siteNamePattern = re.compile(r'<\s*(?:[^:]*:)?SiteName\s*>') endUsageRecordPattern = re.compile(r'<\s*/\s*(?:[^:]*:)?UsageRecord\s*>') LocalUserIdPattern = re.compile(r'<\s*(?:[^:]*:)?LocalUserId\s*>\s*(?P<Value>.*?)\s*<\s*/') VONamePattern = re.compile(r'<\s*(?:[^:]*:)?VOName\s*>\s*(?P<Value>.*?)\s*<\s*/') ReportableVONamePattern = re.compile(r'<\s*(?:[^:]*:)?ReportableVOName\s*>\s*(?P<Value>.*?)\s*<\s*/') endUserIdentityPattern = re.compile(r'<\s*/\s*(?:[^:]*:)?UserIdentity\s*>') responseString = "" for xmlFilename in files: DebugPrint(0, "***********************************************************") DebugPrint(1,"xmlFilename: ",xmlFilename) if (failedSendCount + len(OutstandingRecord)) >= Config.get_MaxPendingFiles(): responseString = "Fatal Error: too many pending files" DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString # Open the XML file in_file = open(xmlFilename, "r") xmlData = [] # Need to check for keys that may be missing and add them: hasProbeName = False hasSiteName = False LocalUserId = None VOName = None ReportableVOName = None seenEndUserIdentity = None for line in in_file: if probeNamePattern.match(line): hasProbeName = True if siteNamePattern.match(line): hasSiteName = True match = LocalUserIdPattern.search(line, re.IGNORECASE) if match and not seenEndUserIdentity: LocalUserId = match.group('Value') match = VONamePattern.search(line, re.IGNORECASE) if match and not seenEndUserIdentity: VOName = match.group('Value') match = ReportableVOName.search(line, re.IGNORECASE) if match and not seenEndUserIdentity: ReportableVOName = match.group('Value') if endUserIdentityPattern.match(line, re.IGNORECASE): # Check for VOName and ReportableVOName in UserIdentity # clause and update or add if necessary seenEndUserIdentity = True if LocalUserId and not \ (VOName and ReportableVOName): vo_info = VOfromUser(LocalUserId) if vo_info: if (VOName and VOName != vo_info[VOName]): # Update entry XmlData = map(lambda x: re.sub(r'(<\s*(?:[^:]*:)?VOName\s*>\s*).*?(\s*<\s*/)', r'\1' + vo_info[VOName] + r'\2', x)) elif (not VOName): # New entry xmlData.append('<VOName>' + vo_info[VOName] + '</VOName>\n') if (ReportableVOName and ReportableVOName != vo_info[ReportableVOName]): # Update entry XmlData = map(lambda x: re.sub(r'(<\s*(?:[^:]*:)?ReportableVOName\s*>\s*).*?(\s*<\s*/)', r'\1' + vo_info[ReportableVOName] + r'\2', x)) elif (not ReportableVOName): # New entry xmlData.append('<ReportableVOName>' + vo_info[ReportableVOName] + '</ReportableVOName>\n') if endUsageRecordPattern.match(line): if not hasProbeName: xmlData.append('<ProbeName>' + Config.get_MeterName() + '</ProbeName>\n') if not hasSiteName: xmlData.append('<SiteName>' + Config.get_SiteName() + '</SiteName>\n') xmlData.append(line) in_file.close() # Open the back up file # fill the back up file dirIndex = 0 recordIndex = 0 success = False ind = 0 f = 0 while not success: (f,dirIndex,recordIndex) = OpenNewRecordFile(dirIndex,recordIndex) DebugPrint(1,"Will save in the record in:",f.name) DebugPrint(3,"DirIndex=",dirIndex," RecordIndex=",recordIndex) if f.name == "<stdout>": responseString = "Fatal Error: unable to save record prior to send attempt" DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString else: try: for line in xmlData: f.write(line) f.flush() if f.tell() > 0: success = True DebugPrint(3,"suceeded to fill: ",f.name) else: DebugPrint(0,"failed to fill: ",f.name) if f.name != "<stdout>": os.remove(f.name) except: DebugPrint(0,"failed to fill with exception: ",f.name,"--", sys.exc_info(),"--",sys.exc_info()[0],"++",sys.exc_info()[1]) if f.name != "<stdout>": os.remove(f.name) if removeOriginal and f.name != "<stdout>": os.remove(xmlFilename) DebugPrint(0, 'Saved record to ' + f.name) # Currently, the recordXml is in a list format, with each # item being a line of xml. The collector web service # requires the xml to be sent as a string. This logic here # turns the xml list into a single xml string. usageXmlString = "" for line in xmlData: usageXmlString = usageXmlString + line DebugPrint(1, 'UsageXml: ' + usageXmlString) # Attempt to send the record to the collector response = __sendUsageXML(Config.get_MeterName(), usageXmlString) DebugPrint(0, 'Response code: ' + str(response.get_code())) DebugPrint(0, 'Response message: ' + response.get_message()) # Determine if the call was successful based on the # response code. Currently, 0 = success if response.get_code() == 0: DebugPrint(1, 'Response indicates success, ' + f.name + ' will be deleted') os.remove(f.name) else: failedSendCount += 1 DebugPrint(1, 'Response indicates failure, ' + f.name + ' will not be deleted') DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString | e8a55e85dabbdfea821b70b7ae475063f602189a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/637/e8a55e85dabbdfea821b70b7ae475063f602189a/Gratia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
4201,
2697,
12,
768,
1621,
16,
1206,
8176,
273,
1083,
4672,
2552,
1903,
225,
589,
273,
1140,
18,
803,
18,
5701,
12,
768,
1621,
16,
10971,
13,
1390,
273,
4715,
18,
10581,
12,
803,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
4201,
2697,
12,
768,
1621,
16,
1206,
8176,
273,
1083,
4672,
2552,
1903,
225,
589,
273,
1140,
18,
803,
18,
5701,
12,
768,
1621,
16,
10971,
13,
1390,
273,
4715,
18,
10581,
12,
803,... |
- ``u`` - vertex at which to start search - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. EXAMPLES:: sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(G.breadth_first_search(0)) [0, 1, 4, 2, 3] | - ``start`` - vertex or list of vertices from which to start the traversal - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. - ``distance`` - the maximum distance from the ``start`` nodes to traverse. The ``start`` nodes are distance zero from themselves. - ``neighbors`` - a function giving the neighbors of a vertex. The function should take a vertex and return a list of vertices. For a graph, ``neighbors`` is by default the :meth:`.neighbors` function of the graph. For a digraph, the ``neighbors`` function defaults to the :meth:`.successors` function of the graph. EXAMPLES:: sage: G = Graph( { 0: [1], 1: [2], 2: [3], 3: [4], 4: [0]} ) | def depth_first_search(self, u, ignore_direction=False): """ Returns an iterator over vertices in a depth-first ordering. INPUT: - ``u`` - vertex at which to start search - ``ignore_direction`` - (default False) only applies to directed graphs. If True, searches across edges in either direction. EXAMPLES:: sage: G = Graph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(G.breadth_first_search(0)) [0, 1, 4, 2, 3] sage: list(G.depth_first_search(0)) [0, 4, 3, 2, 1] :: sage: D = DiGraph( { 0: {1: 1}, 1: {2: 1}, 2: {3: 1}, 3: {4: 2}, 4: {0: 2} } ) sage: list(D.breadth_first_search(0)) [0, 1, 2, 3, 4] sage: list(D.depth_first_search(0)) [0, 1, 2, 3, 4] :: sage: D = DiGraph({1:[0], 2:[0]}) sage: list(D.depth_first_search(0)) [0] sage: list(D.depth_first_search(0, ignore_direction=True)) [0, 2, 1] """ # This function is straight from an old version of networkx if not self._directed or ignore_direction: neighbors=self.neighbor_iterator else: neighbors=self.successor_iterator # nlist=[] # list of nodes in a DFS preorder seen={} # nodes seen queue=[u] # use as LIFO queue seen[u]=True while queue: v=queue.pop() # nlist.append(v) yield v for w in neighbors(v): if w not in seen: seen[w]=True queue.append(w) | 86c87838982df2cf8d1498df619239da8ff542e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/86c87838982df2cf8d1498df619239da8ff542e3/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3598,
67,
3645,
67,
3072,
12,
2890,
16,
582,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
6928,
316,
279,
3598,
17,
3645,
9543,
18,
225,
12943,
30,
282,
300,
12176,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3598,
67,
3645,
67,
3072,
12,
2890,
16,
582,
16,
2305,
67,
9855,
33,
8381,
4672,
3536,
2860,
392,
2775,
1879,
6928,
316,
279,
3598,
17,
3645,
9543,
18,
225,
12943,
30,
282,
300,
12176,... |
def create_period_weekly(self,cr, uid, ids, context={}): res=self.create_period(cr, uid, ids, context, 6, 'Weekly') | def create_period_weekly(self, cr, uid, ids, context=None): res = self.create_period(cr, uid, ids, context, 6, 'Weekly') | def _get_new_period_start(self,cr,uid,context={}): cr.execute("select max(date_stop) from stock_period") result=cr.fetchone() last_date = result and result[0] or False if last_date: period_start = mx.DateTime.strptime(last_date,"%Y-%m-%d %H:%M:%S")+ RelativeDateTime(days=1) period_start = period_start - RelativeDateTime(hours=period_start.hour, minutes=period_start.minute, seconds=period_start.second) else: period_start = mx.DateTime.today() return period_start.strftime('%Y-%m-%d') | 6a21b5d661b74602c870fac41f3c8c42e8bc6c33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6a21b5d661b74602c870fac41f3c8c42e8bc6c33/stock_planning.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
2704,
67,
6908,
67,
1937,
12,
2890,
16,
3353,
16,
1911,
16,
2472,
12938,
4672,
4422,
18,
8837,
2932,
4025,
943,
12,
712,
67,
5681,
13,
628,
12480,
67,
6908,
7923,
563,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2704,
67,
6908,
67,
1937,
12,
2890,
16,
3353,
16,
1911,
16,
2472,
12938,
4672,
4422,
18,
8837,
2932,
4025,
943,
12,
712,
67,
5681,
13,
628,
12480,
67,
6908,
7923,
563,
... |
transaction().abort() | transaction.abort() | def install_product(app, product_dir, product_name, meta_types, folder_permissions, raise_exc=0, log_exc=1): path_join=os.path.join isdir=os.path.isdir exists=os.path.exists global_dict=globals() silly=('__doc__',) if 1: # Preserve indentation for diff :-) package_dir=path_join(product_dir, product_name) __traceback_info__=product_name if not isdir(package_dir): return if not exists(path_join(package_dir, '__init__.py')): if not exists(path_join(package_dir, '__init__.pyc')): if not exists(path_join(package_dir, '__init__.pyo')): return try: product=__import__("Products.%s" % product_name, global_dict, global_dict, silly) # Install items into the misc_ namespace, used by products # and the framework itself to store common static resources # like icon images. misc_=pgetattr(product, 'misc_', {}) if misc_: if isinstance(misc_, dict): misc_=Misc_(product_name, misc_) Application.misc_.__dict__[product_name]=misc_ # Here we create a ProductContext object which contains # information about the product and provides an interface # for registering things like classes and help topics that # should be associated with that product. Products are # expected to implement a method named 'initialize' in # their __init__.py that takes the ProductContext as an # argument. productObject=App.Product.initializeProduct( product, product_name, package_dir, app) context=ProductContext(productObject, app, product) # Look for an 'initialize' method in the product. If it does # not exist, then this is an old product that has never been # updated. In that case, we will analyze the product and # build up enough information to do initialization manually. initmethod=pgetattr(product, 'initialize', None) if initmethod is not None: initmethod(context) # Support old-style product metadata. Older products may # define attributes to name their permissions, meta_types, # constructors, etc. permissions={} new_permissions={} if pgetattr(product, '__ac_permissions__', None) is not None: warn('__init__.py of %s has a long deprecated ' '\'__ac_permissions__\' attribute. ' '\'__ac_permissions__\' will be ignored by ' 'install_product in Zope 2.10. Please use registerClass ' 'instead.' % product.__name__, DeprecationWarning) for p in pgetattr(product, '__ac_permissions__', ()): permission, names, default = ( tuple(p)+('Manager',))[:3] if names: for name in names: permissions[name]=permission elif not folder_permissions.has_key(permission): new_permissions[permission]=() if pgetattr(product, 'meta_types', None) is not None: warn('__init__.py of %s has a long deprecated \'meta_types\' ' 'attribute. \'meta_types\' will be ignored by ' 'install_product in Zope 2.10. Please use registerClass ' 'instead.' % product.__name__, DeprecationWarning) for meta_type in pgetattr(product, 'meta_types', ()): # Modern product initialization via a ProductContext # adds 'product' and 'permission' keys to the meta_type # mapping. We have to add these here for old products. pname=permissions.get(meta_type['action'], None) if pname is not None: meta_type['permission']=pname meta_type['product']=productObject.id meta_type['visibility'] = 'Global' meta_types.append(meta_type) if pgetattr(product, 'methods', None) is not None: warn('__init__.py of %s has a long deprecated \'methods\' ' 'attribute. \'methods\' will be ignored by ' 'install_product in Zope 2.10. Please use registerClass ' 'instead.' % product.__name__, DeprecationWarning) for name,method in pgetattr( product, 'methods', {}).items(): if not hasattr(Folder.Folder, name): setattr(Folder.Folder, name, method) if name[-9:]!='__roles__': # not Just setting roles if (permissions.has_key(name) and not folder_permissions.has_key( permissions[name])): permission=permissions[name] if new_permissions.has_key(permission): new_permissions[permission].append(name) else: new_permissions[permission]=[name] if new_permissions: new_permissions=new_permissions.items() for permission, names in new_permissions: folder_permissions[permission]=names new_permissions.sort() Folder.Folder.__ac_permissions__=tuple( list(Folder.Folder.__ac_permissions__)+new_permissions) if not doInstall(): transaction().abort() else: transaction.get().note('Installed product '+product_name) transaction.commit() except: if log_exc: LOG.error('Couldn\'t install %s' % product_name, exc_info=sys.exc_info()) transaction.abort() if raise_exc: raise | c456979ed8f28d29a5fbf2b33d26319250b9c27c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/c456979ed8f28d29a5fbf2b33d26319250b9c27c/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
67,
5896,
12,
2910,
16,
3017,
67,
1214,
16,
3017,
67,
529,
16,
2191,
67,
2352,
16,
3009,
67,
9612,
16,
1002,
67,
10075,
33,
20,
16,
613,
67,
10075,
33,
21,
4672,
225,
589,
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,
3799,
67,
5896,
12,
2910,
16,
3017,
67,
1214,
16,
3017,
67,
529,
16,
2191,
67,
2352,
16,
3009,
67,
9612,
16,
1002,
67,
10075,
33,
20,
16,
613,
67,
10075,
33,
21,
4672,
225,
589,
67... |
return self.get_frame_up_to(common).inv * other.get_frame_up_to(common) | return other.get_frame_up_to(common).inv * self.get_frame_up_to(common) | def get_frame_relative_to(self, other): common = common_parent([self, other]) return self.get_frame_up_to(common).inv * other.get_frame_up_to(common) | 64f66cff41e9a2e2b0cc0d0c83bf0b9c2d29062f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11052/64f66cff41e9a2e2b0cc0d0c83bf0b9c2d29062f/glmixin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3789,
67,
11626,
67,
869,
12,
2890,
16,
1308,
4672,
2975,
273,
2975,
67,
2938,
3816,
2890,
16,
1308,
5717,
327,
365,
18,
588,
67,
3789,
67,
416,
67,
869,
12,
6054,
2934,
576... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
3789,
67,
11626,
67,
869,
12,
2890,
16,
1308,
4672,
2975,
273,
2975,
67,
2938,
3816,
2890,
16,
1308,
5717,
327,
365,
18,
588,
67,
3789,
67,
416,
67,
869,
12,
6054,
2934,
576... |
print client.response.status | def make_folder(cls, ref): if cls.exists(ref): if cls.is_folder(ref): return raise OSError("[Errno 20] Not a directory: '%s'" % ref) parent = utils.get_dirname(ref) if not cls.is_folder(parent): raise OSError("[Errno 20] Not a directory: '%s'" % parent) ref, client = cls._get_client(ref) path = str(ref.path) dprint(path) responses = client.mkcol(path) print client.response.status | 86f487d201afc0c26ccca3cb3fdfd7f84807d2f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/86f487d201afc0c26ccca3cb3fdfd7f84807d2f7/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
5609,
12,
6429,
16,
1278,
4672,
309,
2028,
18,
1808,
12,
1734,
4672,
309,
2028,
18,
291,
67,
5609,
12,
1734,
4672,
327,
1002,
10002,
2932,
63,
2524,
2135,
4200,
65,
2288,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5609,
12,
6429,
16,
1278,
4672,
309,
2028,
18,
1808,
12,
1734,
4672,
309,
2028,
18,
291,
67,
5609,
12,
1734,
4672,
327,
1002,
10002,
2932,
63,
2524,
2135,
4200,
65,
2288,
279... | |
domid = int(sxp.child_value(info, 'domid', '-1')) | def xm_console(args): arg_check(args, "console", 1, 2) quiet = False; try: (options, params) = getopt.gnu_getopt(args, 'q', ['quiet']) except getopt.GetoptError, opterr: err(opterr) usage('console') for (k, v) in options: if k in ['-q', '--quiet']: quiet = True else: assert False if len(params) != 1: err('No domain given') usage('console') dom = params[0] try: info = server.xend.domain(dom) except: if quiet: sys.exit(1) else: raise domid = int(sxp.child_value(info, 'domid', '-1')) if domid == -1: if quiet: sys.exit(1) else: raise xmlrpclib.Fault(0, "Domain '%s' is not started" % dom) console.execConsole(domid) | 66275d5df1e999156fc34a534e5b84089b415be3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/66275d5df1e999156fc34a534e5b84089b415be3/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25179,
67,
8698,
12,
1968,
4672,
1501,
67,
1893,
12,
1968,
16,
315,
8698,
3113,
404,
16,
576,
13,
225,
10902,
273,
1083,
31,
225,
775,
30,
261,
2116,
16,
859,
13,
273,
336,
3838,
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,
25179,
67,
8698,
12,
1968,
4672,
1501,
67,
1893,
12,
1968,
16,
315,
8698,
3113,
404,
16,
576,
13,
225,
10902,
273,
1083,
31,
225,
775,
30,
261,
2116,
16,
859,
13,
273,
336,
3838,
18,... | |
self.socket.listen(self.request_queue_size) def fileno(self): """Return socket file number. Interface required by select(). """ return self.socket.fileno() | pass | def server_activate(self): """Called by constructor to activate the server. | dd4c61dbf554aa00cd0e32e94620607dcc47f870 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/dd4c61dbf554aa00cd0e32e94620607dcc47f870/SocketServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
67,
10014,
12,
2890,
4672,
3536,
8185,
635,
3885,
358,
10235,
326,
1438,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
67,
10014,
12,
2890,
4672,
3536,
8185,
635,
3885,
358,
10235,
326,
1438,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for obj_id, obj_name in obj.name_get(cursor, user, res.values(), context=context): | for obj_id, obj_name in obj.name_get(cursor, user, [x for x in res.values() if x], context=context): | def _fnct_read(self, obj, cursor, user, ids, prop, arg, context=None): property_obj = obj.pool.get('ir.property') res = property_obj.get(cursor, user, prop, obj._name, ids, context=context) | 47381db05c408c7025e680c83436730fe003b74a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/47381db05c408c7025e680c83436730fe003b74a/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4293,
299,
67,
896,
12,
2890,
16,
1081,
16,
3347,
16,
729,
16,
3258,
16,
2270,
16,
1501,
16,
819,
33,
7036,
4672,
1272,
67,
2603,
273,
1081,
18,
6011,
18,
588,
2668,
481,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4293,
299,
67,
896,
12,
2890,
16,
1081,
16,
3347,
16,
729,
16,
3258,
16,
2270,
16,
1501,
16,
819,
33,
7036,
4672,
1272,
67,
2603,
273,
1081,
18,
6011,
18,
588,
2668,
481,
18,
... |
'email': user['mail'], | 'email': user.get('mail', ''), | def handle_unicode(s): if not isinstance(s, unicode): try: return s.decode('utf-8') except: return s.decode('latin-1') else: return s | fae8dbd5a8e528fbef603226450f4d80f0b9ae7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/fae8dbd5a8e528fbef603226450f4d80f0b9ae7b/directory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
9124,
12,
87,
4672,
309,
486,
1549,
12,
87,
16,
5252,
4672,
775,
30,
327,
272,
18,
3922,
2668,
3158,
17,
28,
6134,
1335,
30,
327,
272,
18,
3922,
2668,
26578,
17,
21,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1640,
67,
9124,
12,
87,
4672,
309,
486,
1549,
12,
87,
16,
5252,
4672,
775,
30,
327,
272,
18,
3922,
2668,
3158,
17,
28,
6134,
1335,
30,
327,
272,
18,
3922,
2668,
26578,
17,
21,
6134,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.