rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
scope = self.scope | scope = self.data['scope'] | def setScopeInfos(self, context, request, showbreadcrumbs): """ set scope and all infos related to scope """ browsedpath = request.get('browsedpath', self.browsedpath) # find browser root and rootpath if undefined if self.root is None : if self.rootpath : self.root = aq_inner(self.portal.restrictedTraverse(self.rootpath)) else : root = aq_inner(context) while not INavigationRoot.providedBy(root) : root = aq_inner(root.aq_parent) self.root = root self.rootpath = '/'.join(root.getPhysicalPath()) # find scope if undefined # by default scope = browsedpath or first parent folderish or context if context is a folder scope = self.scope if scope is None : if browsedpath : self.scope = scope = aq_inner(self.portal.restrictedTraverse(browsedpath)) else : folder = aq_inner(context) if not bool(getattr(aq_base(folder), 'isPrincipiaFolderish', False)) : folder = aq_inner(folder.aq_parent) self.scope = scope = folder self.scopetitle = scope.pretty_title_or_id() self.scopetype = scopetype = scope.portal_type self.scopeiconclass = 'contenttype-%s divicon' % scopetype.lower().replace(' ','-') # set browsedpath and browsed_url self.browsedpath = '/'.join(scope.getPhysicalPath()) self.browsed_url = scope.absolute_url() if scope is not self.root : parentscope = aq_inner(scope.aq_parent) self.parentpath = '/'.join(parentscope.getPhysicalPath()) # set breadcrumbs # TODO : use self.catalog if showbreadcrumbs : crumbs = [] item = scope itempath = self.browsedpath while itempath != self.rootpath : crumb = {} crumb['path'] = itempath crumb['title'] = item.title_or_id() crumbs.append(crumb) item = aq_inner(item.aq_parent) itempath = '/'.join(item.getPhysicalPath()) crumbs.reverse() self.breadcrumbs = crumbs | 347e94cd476fff654d676c70d876655150dcb18b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9052/347e94cd476fff654d676c70d876655150dcb18b/finder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
3876,
7655,
12,
2890,
16,
819,
16,
590,
16,
2405,
31603,
4672,
3536,
444,
2146,
471,
777,
10626,
3746,
358,
2146,
3536,
324,
492,
730,
803,
273,
590,
18,
588,
2668,
70,
492,
730,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3876,
7655,
12,
2890,
16,
819,
16,
590,
16,
2405,
31603,
4672,
3536,
444,
2146,
471,
777,
10626,
3746,
358,
2146,
3536,
324,
492,
730,
803,
273,
590,
18,
588,
2668,
70,
492,
730,
... |
ddate_col.set_title ("Done date") | ddate_col.set_title ("Closing date") | def __create_closed_tasks_tview(self): # Done date column ddate_col = gtk.TreeViewColumn() render_text = gtk.CellRendererText() ddate_col.set_title ("Done date") ddate_col.pack_start (render_text , expand=True) ddate_col.set_attributes (render_text , markup=self.CTASKS_MODEL_DDATE) ddate_col.set_sort_column_id (self.CTASKS_MODEL_DDATE) self.taskdone_tview.append_column (ddate_col) # Title column title_col = gtk.TreeViewColumn() render_text = gtk.CellRendererText() title_col.set_title ("Title") title_col.pack_start (render_text , expand=True) title_col.set_attributes (render_text , markup=self.CTASKS_MODEL_TITLE) title_col.set_sort_column_id (self.CTASKS_MODEL_TITLE) title_col.set_expand (True) self.taskdone_tview.append_column (title_col) | 6d9ee7797322193d89f4fa677dc9f68712ebd3ef /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/6d9ee7797322193d89f4fa677dc9f68712ebd3ef/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
12204,
67,
9416,
67,
88,
1945,
12,
2890,
4672,
225,
468,
8677,
1509,
1057,
302,
712,
67,
1293,
565,
273,
22718,
18,
2471,
1767,
1494,
1435,
1743,
67,
955,
225,
273,
227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
67,
12204,
67,
9416,
67,
88,
1945,
12,
2890,
4672,
225,
468,
8677,
1509,
1057,
302,
712,
67,
1293,
565,
273,
22718,
18,
2471,
1767,
1494,
1435,
1743,
67,
955,
225,
273,
227... |
if categories: | if categories and not set(currentCategories)==set(categories): | def categorizeImage(page, id, cursor, cursor2): # get metadata metadata = getMetadata(id, cursor) # get current text oldtext = page.get() # get current categories currentCategories =[] for cat in page.categories(): currentCategories.append(cat.titleWithoutNamespace().strip().replace(u' ', u'_')) # remove templates cleanDescription = wikipedia.removeCategoryLinks(imagerecat.removeTemplates(page.get()), wikipedia.getSite()) # get new categories categories = getCategories(metadata, cursor, cursor2, currentCategories) if categories: description = cleanDescription + u'\n\n' + categories comment = u'Trying to find better categories for this [[Commons:Batch uploading/Geograph|Geograph]] image' wikipedia.output(description) wikipedia.showDiff(oldtext, description) page.put(description, comment) | 13640e5b25007e90e4c1b757ef1f8076451e4bc9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7426/13640e5b25007e90e4c1b757ef1f8076451e4bc9/categorize_images.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31921,
554,
2040,
12,
2433,
16,
612,
16,
3347,
16,
3347,
22,
4672,
468,
336,
1982,
1982,
273,
11159,
12,
350,
16,
3347,
13,
468,
336,
783,
977,
1592,
955,
273,
1363,
18,
588,
1435,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31921,
554,
2040,
12,
2433,
16,
612,
16,
3347,
16,
3347,
22,
4672,
468,
336,
1982,
1982,
273,
11159,
12,
350,
16,
3347,
13,
468,
336,
783,
977,
1592,
955,
273,
1363,
18,
588,
1435,
4... |
output='int 1,000 float 1,000.00 str str', func=locale.format_string) | output='int 1%s000 float 1%s000.00 str str' % (sep, sep), func=locale.format_string) | def testformat(formatstr, value, grouping = 0, output=None, func=locale.format): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(value), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(value)), result = func(formatstr, value, grouping = grouping) if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(value), repr(result), repr(output)) else: if verbose: print "yes" | 54f680e9b976137c901bc36e6f07ec2a312dbe3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/54f680e9b976137c901bc36e6f07ec2a312dbe3b/test_locale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2139,
12,
2139,
701,
16,
460,
16,
12116,
273,
374,
16,
876,
33,
7036,
16,
1326,
33,
6339,
18,
2139,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
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,
1842,
2139,
12,
2139,
701,
16,
460,
16,
12116,
273,
374,
16,
876,
33,
7036,
16,
1326,
33,
6339,
18,
2139,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
... |
except UnicodeEncodeError: output(u"ERROR> link from %s to %s:%s is invalid encoding?!" % (self.linkname(), newsite, newname)) | except UnicodeError: output(u"ERROR: link from %s to [[%s:%s]] is invalid encoding?!" % (self.aslink(), newsite, newname)) | def interwiki(self): """A list of interwiki links in the page. This will retrieve the page text to do its work, so it can raise the same exceptions that are raised by the get() method. | 4d4b100c0c4a5b0a22bf72174e33f887a4a5106f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/4d4b100c0c4a5b0a22bf72174e33f887a4a5106f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1554,
13044,
12,
2890,
4672,
3536,
37,
666,
434,
1554,
13044,
4716,
316,
326,
1363,
18,
1220,
903,
4614,
326,
1363,
977,
358,
741,
2097,
1440,
16,
1427,
518,
848,
1002,
326,
1967,
4798,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1554,
13044,
12,
2890,
4672,
3536,
37,
666,
434,
1554,
13044,
4716,
316,
326,
1363,
18,
1220,
903,
4614,
326,
1363,
977,
358,
741,
2097,
1440,
16,
1427,
518,
848,
1002,
326,
1967,
4798,
... |
self.append(self.read(len)) | self.append(str(self.read(len), "latin-1")) | def load_short_binstring(self): len = ord(self.read(1)) self.append(self.read(len)) | d53465c7c36ba596622297dc44ebcc6db9ee1d4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/d53465c7c36ba596622297dc44ebcc6db9ee1d4d/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6620,
67,
4757,
1080,
12,
2890,
4672,
562,
273,
4642,
12,
2890,
18,
896,
12,
21,
3719,
365,
18,
6923,
12,
2890,
18,
896,
12,
1897,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
6620,
67,
4757,
1080,
12,
2890,
4672,
562,
273,
4642,
12,
2890,
18,
896,
12,
21,
3719,
365,
18,
6923,
12,
2890,
18,
896,
12,
1897,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) | test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1) | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_type.__name__, str(sys.exc_value) else: print expression, "FAILED" traceback.print_exc(file=sys.stdout) else: if exception: print expression, "FAILED" if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got result", repr(r) else: if r != result: print expression, "FAILED" print "expected", repr(result) print "got result", repr(r) | 0a2834dcd5225e58ecbabd8284a9268fcf954294 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/0a2834dcd5225e58ecbabd8284a9268fcf954294/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... |
auto_away=self.settings["auto_away"] auto_xa=self.settings["auto_xa"] | auto_away = self.settings.get("auto_away") auto_xa = self.settings.get("auto_xa") | def ev_idle(self,event,arg): if not self.cjc.stream: return auto_away=self.settings["auto_away"] auto_xa=self.settings["auto_xa"] if auto_away and auto_xa: minidle=min(auto_away,auto_xa) elif auto_away: minidle=auto_away elif auto_xa: minidle=auto_xa else: return idle=int(arg/60) if idle<minidle: return p=self.cjc.get_user_info(self.cjc.jid,"presence") if (not p or p.get_type()=="unavailable" or (p.get_show() in self.settings["no_auto_away_when"] and not self.away_saved_presence)): return | a56bbb69642415bcf30398f952a28bae4493b609 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12768/a56bbb69642415bcf30398f952a28bae4493b609/presence.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2113,
67,
20390,
12,
2890,
16,
2575,
16,
3175,
4672,
309,
486,
365,
18,
71,
78,
71,
18,
3256,
30,
327,
3656,
67,
26718,
273,
365,
18,
4272,
18,
588,
2932,
6079,
67,
26718,
7923,
3656... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2113,
67,
20390,
12,
2890,
16,
2575,
16,
3175,
4672,
309,
486,
365,
18,
71,
78,
71,
18,
3256,
30,
327,
3656,
67,
26718,
273,
365,
18,
4272,
18,
588,
2932,
6079,
67,
26718,
7923,
3656... |
if os.path.exists(path_o): | if not os.path.exists(path): | def ensure_thumnnail_created(id, path): """Temporary hack during migration to make sure thumbnails are created.""" if os.path.exists(path): return path_o = path.rsplit('-', 1)[0] # original file is not present. Can't create thumbnails. if os.path.exists(path_o): return prefix = os.path.basename(path_o) assert not prefix.endswith('.jpg') write_image(open(path_o).read(), prefix) # write_image also writes the original image to a new file. Delete it as we already have the original image. os.remove(path_o + '.jpg') db.getdb().update('cover', where='id=$id', vars=locals(), filename_s=prefix + '-S.jpg', filename_m=prefix + '-M.jpg', filename_l=prefix + '-L.jpg', ) | eecfd13485da438cfd98a3bfc1e28702b1f95fe8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/eecfd13485da438cfd98a3bfc1e28702b1f95fe8/code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3387,
67,
451,
755,
6025,
67,
4824,
12,
350,
16,
589,
4672,
3536,
11685,
11769,
4982,
6333,
358,
1221,
3071,
30526,
854,
2522,
12123,
309,
1140,
18,
803,
18,
1808,
12,
803,
4672,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3387,
67,
451,
755,
6025,
67,
4824,
12,
350,
16,
589,
4672,
3536,
11685,
11769,
4982,
6333,
358,
1221,
3071,
30526,
854,
2522,
12123,
309,
1140,
18,
803,
18,
1808,
12,
803,
4672,
327,
... |
""" | r""" | def to_list(self): """ Return self as a list. | d2bea0c9898d10512ce54569c87e5b09be4cdba6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d2bea0c9898d10512ce54569c87e5b09be4cdba6/partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1098,
12,
2890,
4672,
436,
8395,
2000,
365,
487,
279,
666,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
67,
1098,
12,
2890,
4672,
436,
8395,
2000,
365,
487,
279,
666,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if str(x) != 'unhashable type': | if str(x).find("unhashable") == -1: | def items(l): """items(l) -> list of items Generate a list of one of each item in l. The items are returned in arbitrary order. """ try: return asdict(l).keys() except TypeError, x: if str(x) != 'unhashable type': raise # asdict failed because l is unhashable. Back up to a naive # implementation. l = l[:] l.sort() i = 0 while i < len(l)-1: if l[i] == l[i+1]: del l[i] else: i += 1 return l | 5791f573f46946a41503dd960746ff4dfd43fdcd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/5791f573f46946a41503dd960746ff4dfd43fdcd/listfns.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1516,
12,
80,
4672,
3536,
3319,
12,
80,
13,
317,
666,
434,
1516,
225,
6654,
279,
666,
434,
1245,
434,
1517,
761,
316,
328,
18,
225,
1021,
1516,
854,
2106,
316,
11078,
1353,
18,
225,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1516,
12,
80,
4672,
3536,
3319,
12,
80,
13,
317,
666,
434,
1516,
225,
6654,
279,
666,
434,
1245,
434,
1517,
761,
316,
328,
18,
225,
1021,
1516,
854,
2106,
316,
11078,
1353,
18,
225,
... |
<html lang="en"> | <html lang=en> | def startFormatting(title, identifier, source): document = """Content-Type:text/html;charset=UTF-8 | f5f4c3ed6200811f1911f1b21ca420f1c2697ec6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5033/f5f4c3ed6200811f1911f1b21ca420f1c2697ec6/trackerlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
23974,
12,
2649,
16,
2756,
16,
1084,
4672,
1668,
273,
3536,
1350,
17,
559,
30,
955,
19,
2620,
31,
9999,
33,
5159,
17,
28,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
787,
23974,
12,
2649,
16,
2756,
16,
1084,
4672,
1668,
273,
3536,
1350,
17,
559,
30,
955,
19,
2620,
31,
9999,
33,
5159,
17,
28,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
list, tuple, or vector | list, tuple, or vector. | def ruler_frame(lower_left, upper_right, ticks=4, sub_ticks=4, **kwds): """ Draw a frame made of 3D rulers, with major and minor ticks. INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector - ``ticks`` - (default: 4) the number of major ticks shown on each ruler - ``sub_ticks`` - (default: 4) the number of shown subdivisions between each major tick Type ``line3d.options`` for a dictionary of the default options for lines which are also available. EXAMPLES: A ruler frame:: sage: from sage.plot.plot3d.shapes2 import ruler_frame sage: F = ruler_frame([1,2,3],vector([2,3,4])); F A ruler frame with some options:: sage: F = ruler_frame([1,2,3],vector([2,3,4]),ticks=6, sub_ticks=2, color='red'); F """ return ruler(lower_left, (upper_right[0], lower_left[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], upper_right[1], lower_left[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) \ + ruler(lower_left, (lower_left[0], lower_left[1], upper_right[2]), ticks=ticks, sub_ticks=sub_ticks, absolute=True, **kwds) | c85cd8e70aed89c86059888b9925f160e190c0a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/c85cd8e70aed89c86059888b9925f160e190c0a7/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
67,
3789,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
2826,
25577,
4672,
3536,
10184,
279,
2623,
7165,
434,
890,
40,
436,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
17040,
67,
3789,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
13003,
33,
24,
16,
720,
67,
11767,
33,
24,
16,
2826,
25577,
4672,
3536,
10184,
279,
2623,
7165,
434,
890,
40,
436,
3... |
return complete_xf_version | return complete_xf_version | def get_xforms_version(): """ Return version string of installed XForms library/header """ complete_xf_version = "" try: header_filename = "/usr/include/forms.h" formsh = open(header_filename, "r") except IOError: raise XFormsLoadError("XForms library toolkit is not installed" \ "properly") else: try: # a reasonable to catch version values fconten = formsh.read(2200) except IOError: raise XFormsLoadError("XForms library toolkit is not installed" \ "properly") else: formsh.close() listconten = fconten.split("\n") for singline in listconten: idx_ver = singline.find("FL_VERSION") if idx_ver != -1: strg_ver1 = singline[idx_ver:len(singline)] strg_ver = strg_ver1.replace("FL_VERSION", "").strip(" ") break for singline in listconten: idx_rev = singline.find("FL_REVISION") if idx_rev != -1: strg_rev1 = singline[idx_rev:len(singline)] strg_rev = strg_rev1.replace("FL_REVISION", "").strip(" ") break for singline in listconten: idx_fix = singline.find("FL_FIXLEVEL") if idx_fix != -1: strg_fix1 = singline[idx_fix:len(singline)] strg_fix = strg_fix1.replace("FL_FIXLEVEL", "").strip(" ").strip('"') break complete_xf_version = strg_ver+"."+strg_rev+"."+strg_fix return complete_xf_version | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
92,
9741,
67,
1589,
13332,
3536,
2000,
1177,
533,
434,
5876,
1139,
18529,
5313,
19,
3374,
3536,
225,
3912,
67,
5841,
67,
1589,
273,
1408,
775,
30,
1446,
67,
3459,
273,
2206,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
92,
9741,
67,
1589,
13332,
3536,
2000,
1177,
533,
434,
5876,
1139,
18529,
5313,
19,
3374,
3536,
225,
3912,
67,
5841,
67,
1589,
273,
1408,
775,
30,
1446,
67,
3459,
273,
2206,
1... |
"non-zero flags not allowed in calls to sendall() on %s" % | "non-zero flags not allowed in calls to recv() on %s" % | def recv(self, buflen=1024, flags=0): if self._sslobj: if flags != 0: raise ValueError( "non-zero flags not allowed in calls to sendall() on %s" % self.__class__) while True: try: return self.read(buflen) except SSLError, x: if x.args[0] == SSL_ERROR_WANT_READ: continue else: raise x else: return socket.recv(self, buflen, flags) | b24122abf2bfe84fa713e7288b0987fd88477098 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/b24122abf2bfe84fa713e7288b0987fd88477098/ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10665,
12,
2890,
16,
1681,
1897,
33,
2163,
3247,
16,
2943,
33,
20,
4672,
309,
365,
6315,
1049,
383,
441,
30,
309,
2943,
480,
374,
30,
1002,
2068,
12,
315,
5836,
17,
7124,
2943,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10665,
12,
2890,
16,
1681,
1897,
33,
2163,
3247,
16,
2943,
33,
20,
4672,
309,
365,
6315,
1049,
383,
441,
30,
309,
2943,
480,
374,
30,
1002,
2068,
12,
315,
5836,
17,
7124,
2943,
486,
... |
environ = self.setup_env(PATH_INFO='/%s' % pagename, HTTP_COOKIE=cookie) request = self.process_request(environ) | request = self.run_request(path='/%s' % pagename, HTTP_COOKIE=cookie) | def testMoinLoginAuthSession(self): """ run some requests with moin_login auth, check whether session works """ from MoinMoin.auth import MoinLogin from MoinMoin.user import User self.config = self.TestConfig(auth=[MoinLogin()]) username = u'MoinLoginAuthTestUser' password = u'secret' User(self.request, name=username, password=password).save() # create user trail_expected = [] first = True for pagename in self.PAGES: if first: formdata = urllib.urlencode({ 'name': username.encode('utf-8'), 'password': password.encode('utf-8'), 'login': 'login', }) environ = self.setup_env(PATH_INFO='/%s' % pagename, HTTP_CONTENT_TYPE='application/x-www-form-urlencoded', HTTP_CONTENT_LENGTH='%d' % len(formdata), QUERY_STRING='action=login', REQUEST_METHOD='POST', **{'wsgi.input': StringIO.StringIO(formdata)}) else: # not first page, use session cookie environ = self.setup_env(PATH_INFO='/%s' % pagename, HTTP_COOKIE=cookie) request = self.process_request(environ) | 8da57c08ef8cfbefd2d454c1dc46ccccab25736c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/8da57c08ef8cfbefd2d454c1dc46ccccab25736c/test_auth.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
49,
885,
5358,
1730,
2157,
12,
2890,
4672,
3536,
1086,
2690,
3285,
598,
312,
885,
67,
5819,
1357,
16,
866,
2856,
1339,
6330,
3536,
628,
490,
885,
49,
885,
18,
1944,
1930,
490,
88... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
49,
885,
5358,
1730,
2157,
12,
2890,
4672,
3536,
1086,
2690,
3285,
598,
312,
885,
67,
5819,
1357,
16,
866,
2856,
1339,
6330,
3536,
628,
490,
885,
49,
885,
18,
1944,
1930,
490,
88... |
if not value: continue | if value is None: continue | def _processForm(self, data=1, metadata=None): request = self.REQUEST form = request.form fieldset = form.get('fieldset', None) schema = self.Schema() schemata = self.Schemata() fields = [] | 9fae6c7390ead2beff4444f7659661363460fee0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/9fae6c7390ead2beff4444f7659661363460fee0/BaseObject.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
1204,
12,
2890,
16,
501,
33,
21,
16,
1982,
33,
7036,
4672,
590,
273,
365,
18,
5519,
646,
273,
590,
18,
687,
16885,
273,
646,
18,
588,
2668,
23397,
2187,
599,
13,
1963,
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,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
1204,
12,
2890,
16,
501,
33,
21,
16,
1982,
33,
7036,
4672,
590,
273,
365,
18,
5519,
646,
273,
590,
18,
687,
16885,
273,
646,
18,
588,
2668,
23397,
2187,
599,
13,
1963,
273... |
os.close(lock_file) os.remove(lock_filename) | _ReleaseLock(lock_file, lock_filename) | def main(options, args): """Runs all the selected tests for the given build type and target.""" # Create the lock file to prevent another instance of this script from # running. lock_filename = '%s\\%s' % (CHROMIUM_SOURCE_DIR, LOCK_FILE) try: lock_file = os.open(lock_filename, os.O_CREAT | os.O_EXCL | os.O_TRUNC | os.O_RDWR) except OSError, err: print 'Failed to open lock file:\n ' + str(err) return 1 # Write the pid of this script (the python.exe process) to the lock file. os.write(lock_file, str(os.getpid())) options.target = options.target.title() start_time = time.time() print 'Change directory to ' + CHROMIUM_SOURCE_DIR os.chdir(CHROMIUM_SOURCE_DIR) cmd = 'gclient sync' _RunCommand(cmd, options.dry_run, shell=True) print 'Elapsed time: %ds' % (time.time() - start_time) # Do a clean build. Remove the build output directory first. # TODO(wtc): Consider using Python's rmtree function in the shutil module, # or the RemoveDirectory function in # trunk/tools/buildbot/scripts/common/chromium_utils.py. cmd = 'rmdir /s /q %s\\%s\\%s' % (CHROMIUM_SOURCE_DIR, CHROMIUM_SOLUTION_DIR, options.target) _RunCommand(cmd, options.dry_run, shell=True) print 'Elapsed time: %ds' % (time.time() - start_time) cmd = '%s\\cov-build.exe --dir %s devenv.com %s\\%s /build %s' % ( COVERITY_BIN_DIR, COVERITY_INTERMEDIATE_DIR, CHROMIUM_SOURCE_DIR, CHROMIUM_SOLUTION_FILE, options.target) _RunCommand(cmd, options.dry_run) print 'Elapsed time: %ds' % (time.time() - start_time) cmd = '%s\\cov-analyze.exe --dir %s %s' % (COVERITY_BIN_DIR, COVERITY_INTERMEDIATE_DIR, COVERITY_ANALYZE_OPTIONS) _RunCommand(cmd, options.dry_run) print 'Elapsed time: %ds' % (time.time() - start_time) cmd = ('%s\\cov-commit-defects.exe --dir %s --remote %s --port %s' '--product %s ' '--target %s ' '--user %s ' '--password %s') % (COVERITY_BIN_DIR, COVERITY_INTERMEDIATE_DIR, COVERITY_REMOTE, COVERITY_PORT, COVERITY_PRODUCT, COVERITY_TARGET, COVERITY_USER, CHROMIUM_PASSWORD) _RunCommand(cmd, options.dry_run) print 'Total time: %ds' % (time.time() - start_time) os.close(lock_file) os.remove(lock_filename) return 0 | 6c5cc7993d5dddffff198dead864ea32a31b4fe2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/6c5cc7993d5dddffff198dead864ea32a31b4fe2/coverity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
3536,
9361,
777,
326,
3170,
7434,
364,
326,
864,
1361,
618,
471,
1018,
12123,
468,
1788,
326,
2176,
585,
358,
5309,
4042,
791,
434,
333,
2728,
628,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
3536,
9361,
777,
326,
3170,
7434,
364,
326,
864,
1361,
618,
471,
1018,
12123,
468,
1788,
326,
2176,
585,
358,
5309,
4042,
791,
434,
333,
2728,
628,
468,
... |
if class_name is None: return UNKNOWN | if class_name is UNKNOWN: return UNKNOWN | def get_canonical_name(value): """ @return: the canonical name for C{value}, or C{UNKNOWN} if no canonical name can be found. Currently, C{get_canonical_name} can find canonical names for: modules; functions; non-nested classes; methods of non-nested classes; and some class methods of non-nested classes. @rtype: L{DottedName} or C{None} """ if not hasattr(value, '__name__'): return UNKNOWN # Get the name via introspection. if isinstance(value, ModuleType): dotted_name = DottedName(value.__name__) elif isinstance(value, (ClassType, TypeType)): if value.__module__ == '__builtin__': dotted_name = DottedName(value.__name__) else: dotted_name = DottedName(value.__module__, value.__name__) elif (inspect.ismethod(value) and value.im_self is not None and value.im_class is ClassType and not value.__name__.startswith('<')): # class method. class_name = get_canonical_name(value.im_self) if class_name is None: return UNKNOWN dotted_name = DottedName(class_name, value.__name__) elif (inspect.ismethod(value) and not value.__name__.startswith('<')): class_name = get_canonical_name(value.im_class) if class_name is None: return UNKNOWN dotted_name = DottedName(class_name, value.__name__) elif (isinstance(value, FunctionType) and not value.__name__.startswith('<')): module_name = _find_function_module(value) if module_name is None: return UNKNOWN dotted_name = DottedName(module_name, value.__name__) else: return UNKNOWN return verify_name(value, dotted_name) | cca6605cf40b6db939bd79ccc9c98c99a63350ca /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3512/cca6605cf40b6db939bd79ccc9c98c99a63350ca/docintrospecter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
18288,
67,
529,
12,
1132,
4672,
3536,
632,
2463,
30,
326,
7378,
508,
364,
385,
95,
1132,
5779,
578,
385,
95,
14737,
97,
309,
1158,
7378,
508,
848,
506,
1392,
18,
225,
15212,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18288,
67,
529,
12,
1132,
4672,
3536,
632,
2463,
30,
326,
7378,
508,
364,
385,
95,
1132,
5779,
578,
385,
95,
14737,
97,
309,
1158,
7378,
508,
848,
506,
1392,
18,
225,
15212,
... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 434) else quickfix.CharField.__init__(self, 434, 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,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
5026,
13,
469,
9549,
904,
18,
2156,
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,
2156,
974,
16186,
2738,
972,
12,
2890,
16,
1059,
5026,
13,
469,
9549,
904,
18,
2156,
974,
16186,
2738,
... |
self[data].strftime.mythformat()) | self[data].mythformat()) | def formatJob(self, cmd): """ Program.formatPath(cmd) -> formatted command string 'cmd' string is formatted as per MythJobQueue syntax """ for tag in ('chanid','title','subtitle','description','hostname', 'category','recgroup','playgroup','parentid','findid', 'recstatus','rectype'): cmd = cmd.replace('%%%s%%' % tag.upper(), str(self[tag])) for (tag, data) in (('STARTTIME','recstartts'),('ENDTIME','recendts'), ('PROGSTART','starttime'),('PROGEND','endtime')): cmd = cmd.replace('%%%s%%' % tag, \ self[data].strftime.mythformat()) cmd = cmd.replace('%%%sISO%%' % tag, \ self[data].isoformat()) cmd = cmd.replace('%%%sISOUTC%%' % tag, \ (self[data]+timedelta(0,altzone)).isoformat()) cmd = cmd.replace('%VERBOSELEVEL%', MythLog._parselevel()) cmd = cmd.replace('%RECID%', str(self.recordid)) | 332f6a30c1cad460be22c5d5cf58716f3a4c388d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/332f6a30c1cad460be22c5d5cf58716f3a4c388d/mythproto.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
2278,
12,
2890,
16,
1797,
4672,
3536,
13586,
18,
2139,
743,
12,
4172,
13,
317,
4955,
1296,
533,
296,
4172,
11,
533,
353,
4955,
487,
1534,
8005,
451,
2278,
3183,
6279,
3536,
364,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
2278,
12,
2890,
16,
1797,
4672,
3536,
13586,
18,
2139,
743,
12,
4172,
13,
317,
4955,
1296,
533,
296,
4172,
11,
533,
353,
4955,
487,
1534,
8005,
451,
2278,
3183,
6279,
3536,
364,
1... |
def _fill(self, wtd): | def _fill(self, wtd): | def _fill(self, wtd): | f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f1d302d15f45741d8b0d5e81b4b0e5a61c6fa580/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5935,
12,
2890,
16,
341,
4465,
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,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5935,
12,
2890,
16,
341,
4465,
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,... |
testformat(formatstr, *args) testformat(unicode(formatstr), *args) | testformat(formatstr, *args) testformat(unicode(formatstr), *args) | def testboth(formatstr, *args): testformat(formatstr, *args) testformat(unicode(formatstr), *args) | 38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18237,
12,
2139,
701,
16,
380,
1968,
4672,
1842,
2139,
12,
2139,
701,
16,
380,
1968,
13,
1842,
2139,
12,
9124,
12,
2139,
701,
3631,
380,
1968,
13,
282,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
18237,
12,
2139,
701,
16,
380,
1968,
4672,
1842,
2139,
12,
2139,
701,
16,
380,
1968,
13,
1842,
2139,
12,
9124,
12,
2139,
701,
3631,
380,
1968,
13,
282,
2,
-100,
-100,
-100,
-100,... |
self.lineno += 1 | self.line += 1 | def skip(self): input = self.source while (True): ch = input[self.cursor] self.cursor += 1 next = input[self.cursor] | 50348dc50eb62cab6cb5bf5defc94e9229e847a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/50348dc50eb62cab6cb5bf5defc94e9229e847a4/Tokenizer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2488,
12,
2890,
4672,
810,
273,
365,
18,
3168,
225,
1323,
261,
5510,
4672,
462,
273,
810,
63,
2890,
18,
9216,
65,
365,
18,
9216,
1011,
404,
1024,
273,
810,
63,
2890,
18,
9216,
65,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2488,
12,
2890,
4672,
810,
273,
365,
18,
3168,
225,
1323,
261,
5510,
4672,
462,
273,
810,
63,
2890,
18,
9216,
65,
365,
18,
9216,
1011,
404,
1024,
273,
810,
63,
2890,
18,
9216,
65,
2,... |
select combi.item_id, combi.bucket, coalesce(data.demand,0), coalesce(data2.planned,0) from (select item_id, d.bucket as bucket, d.start as start from (select distinct item_id from demand %s order by item_id %s) as items cross join (select %s as bucket, min(day) as start from dates where day >= '%s' and day < '%s' group by bucket) d ) as combi | select items.item_id, d.bucket, d.startdate, d.enddate, coalesce(sum(demand.quantity),0), coalesce(sum(pln.quantity),0) from (select distinct item_id from demand %s order by item_id %s) as items -- Multiply with buckets cross join ( select %s as bucket, %s_start as startdate, %s_end as enddate from dates where day >= '%s' and day < '%s' group by bucket, startdate, enddate ) d | def demandquery(item, bucket, startdate, enddate, offset=0, limit=None): if item: filterstring = 'where item_id = %s' else: filterstring = '' if limit: if offset == 0: limitstring = 'limit %d' % int(limit) else: limitstring = 'limit %d offset %d' % (int(limit),int(offset)) else: limitstring = '' cursor = connection.cursor() query = ''' select combi.item_id, combi.bucket, coalesce(data.demand,0), coalesce(data2.planned,0) from (select item_id, d.bucket as bucket, d.start as start from (select distinct item_id from demand %s order by item_id %s) as items cross join (select %s as bucket, min(day) as start from dates where day >= '%s' and day < '%s' group by bucket) d ) as combi -- Planned quantity left join (select items.item_id as item_id, %s as bucket, sum(out_operationplan.quantity) as planned from out_operationplan, dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where out_operationplan.enddate = d.day and out_operationplan.demand_id = inp.name and inp.item_id = items.item_id and out_operationplan.enddate >= '%s' and out_operationplan.enddate < '%s' group by items.item_id, bucket) data2 on combi.item_id = data2.item_id and combi.bucket = data2.bucket -- Requested quantity left join (select items.item_id as item_id, %s as bucket, sum(inp.quantity) as demand from dates as d, demand as inp, (select distinct item_id from demand %s order by item_id %s) as items where date(inp.due) = d.day and inp.due >= '%s' and inp.due < '%s' and inp.item_id = items.item_id group by items.item_id, bucket) data on combi.item_id = data.item_id and combi.bucket = data.bucket -- Sort the result order by combi.item_id, combi.start ''' % (filterstring, limitstring,bucket,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate, bucket,filterstring,limitstring,startdate,enddate) if item: cursor.execute(query, (item,item,item)) else: cursor.execute(query) resultset = [] previtem = None rowset = [] for row in cursor.fetchall(): if row[0] != previtem: if previtem: resultset.append(rowset) rowset = [] previtem = row[0] backlog = 0 # @todo Setting the backlog to 0 is not correct: it may be non-zero from the plan before the start date backlog += row[2] - row[3] rowset.append( { 'item': row[0], 'bucket': row[1], 'requested': row[2], 'supplied': row[3], 'backlog': backlog, } ) if previtem: resultset.append(rowset) return resultset | 776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8604/776cd72ff4cb8fa56a39290bfbe91a5586a0ae6d/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23653,
2271,
12,
1726,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
4672,
309,
761,
30,
1034,
1080,
273,
296,
6051,
761,
67,
350,
273,
738,
87,
11,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23653,
2271,
12,
1726,
16,
2783,
16,
787,
712,
16,
679,
712,
16,
1384,
33,
20,
16,
1800,
33,
7036,
4672,
309,
761,
30,
1034,
1080,
273,
296,
6051,
761,
67,
350,
273,
738,
87,
11,
4... |
def nogateway(x): | def nogateway(): | def nogateway(x): request.setResponseCode(504) # Gateway timeout return "No gateway available" | 17dab814373e52402b931a3655edf1091cd50594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13049/17dab814373e52402b931a3655edf1091cd50594/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
290,
717,
3200,
13332,
590,
18,
542,
1064,
1085,
12,
25,
3028,
13,
468,
11381,
2021,
327,
315,
2279,
6878,
2319,
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,
290,
717,
3200,
13332,
590,
18,
542,
1064,
1085,
12,
25,
3028,
13,
468,
11381,
2021,
327,
315,
2279,
6878,
2319,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Parameters ========== h : (N, N) ndarray | Parameters: h: (N, N) ndarray | def truncate_along_axis(h, s, direction, centers_ic, cutoff): """Truncate h and s such along a cartesian axis. Parameters ========== h : (N, N) ndarray Hamiltonian matrix. s : (N, N) ndarray Overlap matrix. direction : {'x', 'y', 'z'} Truncate allong a cartesian axis. centers_ic : (N, 3) ndarray Centers of the basis functions. cutoff : float The (direction-axis projected) cutoff distance. """ dtype = h.dtype ni = len(centers_ic) d = 'xyz'.index(direction) pos_i = centers_ic[:, d] for i in range(ni): dpos_i = abs(pos_i - pos_i[i]) mask_i = (dpos_i < cutoff).astype(dtype) h[i, :] *= mask_i h[:, i] *= mask_i s[i, :] *= mask_i s[:, i] *= mask_i | 19139927a2697871abc2bc1cb7c9b7f053478908 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/19139927a2697871abc2bc1cb7c9b7f053478908/siesta.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
67,
287,
932,
67,
4890,
12,
76,
16,
272,
16,
4068,
16,
17723,
67,
335,
16,
13383,
4672,
3536,
25871,
366,
471,
272,
4123,
7563,
279,
24549,
2654,
18,
225,
7012,
30,
225,
366,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
67,
287,
932,
67,
4890,
12,
76,
16,
272,
16,
4068,
16,
17723,
67,
335,
16,
13383,
4672,
3536,
25871,
366,
471,
272,
4123,
7563,
279,
24549,
2654,
18,
225,
7012,
30,
225,
366,
... |
self.mc.CALL(self.stack_check_slowpath_imm) | self.mc.CALL(imm(self.stack_check_slowpath)) | def _call_header_with_stack_check(self): startaddr, length, slowpathaddr = self.cpu.insert_stack_check() if slowpathaddr == 0: pass # no stack check (e.g. not translated) else: self.mc.MOV(eax, esp) # MOV eax, current self.mc.SUB(eax, heap(startaddr)) # SUB eax, [startaddr] self.mc.CMP(eax, imm(length)) # CMP eax, length self.mc.J_il8(rx86.Conditions['B'], 0) # JB .skip jb_location = self.mc.get_relative_pos() self.mc.CALL(self.stack_check_slowpath_imm) # CALL slowpath # patch the JB above # .skip: offset = self.mc.get_relative_pos() - jb_location assert 0 < offset <= 127 self.mc.overwrite(jb_location-1, chr(offset)) # self._call_header() | 6bc9ade812f014c6aebce1452a76e194d9852757 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/6bc9ade812f014c6aebce1452a76e194d9852757/assembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1991,
67,
3374,
67,
1918,
67,
3772,
67,
1893,
12,
2890,
4672,
787,
4793,
16,
769,
16,
11816,
803,
4793,
273,
365,
18,
11447,
18,
6387,
67,
3772,
67,
1893,
1435,
309,
11816,
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,
389,
1991,
67,
3374,
67,
1918,
67,
3772,
67,
1893,
12,
2890,
4672,
787,
4793,
16,
769,
16,
11816,
803,
4793,
273,
365,
18,
11447,
18,
6387,
67,
3772,
67,
1893,
1435,
309,
11816,
803,
... |
if template_string in template_defaults.keys(): template_string = template_defaults[template_string] edit_template = Template(template_string) def edit(obj, bg=False, editor=None): | if not(isinstance(template_string,Template)): template_string = Template(template_string) fields = set(template_fields(template_string)) if not(fields <= set(['file','line']) and ('file' in fields)): raise ValueError, "Only ${file} and ${line} are allowed as template variables, and ${file} must occur." edit_template = template_string def set_editor(editor_name,opts=''): r""" Sets the editor to be used by the edit command by basic editor name. Currently, the system only knows appropriate call strings for a limited number of editors. If you want to use another editor, you should set the whole edit template via set_edit_template. AUTHOR: Nils Bruin (2007-10-05) EXAMPLE: sage: from sage.misc.edit_module import set_editor sage: set_editor('vi') sage: sage.misc.edit_module.edit_template.template 'vi -c ${line} ${file}' """ if sage.misc.edit_module.template_defaults.has_key(editor_name): set_edit_template(Template(template_defaults[editor_name].safe_substitute(opts=opts))) else: raise ValueError, "editor_name not known. Try set_edit_template(<template_string>) instead." def edit(obj, editor=None): | def set_edit_template(template_string): r""" Sets default edit template string. It should reference ${file} and ${line}. This routine normally needs to be called prior to using 'edit'. However, if the editor set in the shell variable EDITOR is known, then the system will substitute an appropriate template for you. See edit_module.template_defaults for the recognised templates. AUTHOR: Nils Bruin (2007-10-03) EXAMPLE: sage: from sage.misc.edit_module import set_edit_template sage: set_edit_template("echo EDIT ${file}:${line}") sage: edit(sage) # not tested EDIT /usr/local/sage/default/devel/sage/sage/__init__.py:1 """ global edit_template if template_string in template_defaults.keys(): template_string = template_defaults[template_string] edit_template = Template(template_string) | 604e3deef78a9a92504bae236ecd5f8626c4ce87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/604e3deef78a9a92504bae236ecd5f8626c4ce87/edit_module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4619,
67,
3202,
12,
3202,
67,
1080,
4672,
436,
8395,
11511,
805,
3874,
1542,
533,
18,
225,
2597,
1410,
2114,
3531,
768,
97,
471,
3531,
1369,
5496,
1220,
12245,
15849,
4260,
358,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4619,
67,
3202,
12,
3202,
67,
1080,
4672,
436,
8395,
11511,
805,
3874,
1542,
533,
18,
225,
2597,
1410,
2114,
3531,
768,
97,
471,
3531,
1369,
5496,
1220,
12245,
15849,
4260,
358,... |
def calculatePageCount(self, attempt_wrap=False): | def _calculatePageCount(self, attempt_wrap=False): | def calculatePageCount(self, attempt_wrap=False): """Calculates offsets into the STC for each page This pre-calculates the page offsets for each page to support print preview being able to seek backwards and forwards. """ page_offsets = [] page_line_start = 0 lines_on_page = 0 num_lines = self.stc.GetLineCount() line = 0 while line < num_lines: if attempt_wrap: wrap_count = self.stc.WrapCount(line) if wrap_count > 1 and self.debuglevel > 0: print("found wrapped line %d: %d" % (line, wrap_count)) else: wrap_count = 1 # If the next line pushes the count over the edge, mark a page and # start the next page if lines_on_page + wrap_count > self.lines_pp: start_pos = self.stc.PositionFromLine(page_line_start) end_pos = self.stc.GetLineEndPosition(page_line_start + lines_on_page - 1) if self.debuglevel > 0: print("Page: line %d - %d" % (page_line_start, page_line_start + lines_on_page)) page_offsets.append((start_pos, end_pos)) page_line_start = line lines_on_page = 0 lines_on_page += wrap_count line += 1 if lines_on_page > 0: start_pos = self.stc.PositionFromLine(page_line_start) end_pos = self.stc.GetLineEndPosition(page_line_start + lines_on_page) page_offsets.append((start_pos, end_pos)) self.page_count = len(page_offsets) self.page_offsets = page_offsets if self.debuglevel > 0: print("page offsets: %s" % self.page_offsets) | 6ae8303bbb1a0f5f38a844558be6a34a650019a1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11522/6ae8303bbb1a0f5f38a844558be6a34a650019a1/stcprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
1964,
1380,
12,
2890,
16,
4395,
67,
4113,
33,
8381,
4672,
3536,
10587,
8738,
1368,
326,
2347,
39,
364,
1517,
1363,
225,
1220,
675,
17,
12780,
815,
326,
1363,
8738,
364,
1517,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11162,
1964,
1380,
12,
2890,
16,
4395,
67,
4113,
33,
8381,
4672,
3536,
10587,
8738,
1368,
326,
2347,
39,
364,
1517,
1363,
225,
1220,
675,
17,
12780,
815,
326,
1363,
8738,
364,
1517,... |
self.mayReturnEmpty = False for e in exprs: if e.mayReturnEmpty: self.mayReturnEmpty = True break | if exprs: self.mayReturnEmpty = False for e in exprs: if e.mayReturnEmpty: self.mayReturnEmpty = True break else: self.mayReturnEmpty = True | def __init__( self, exprs, savelist = False ): super(MatchFirst,self).__init__(exprs, savelist) self.mayReturnEmpty = False for e in exprs: if e.mayReturnEmpty: self.mayReturnEmpty = True break | dda2a500387325587692217da639d3c17f38e5a1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12364/dda2a500387325587692217da639d3c17f38e5a1/pyparsing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
22523,
16,
4087,
5449,
273,
1083,
262,
30,
2240,
12,
2060,
3759,
16,
2890,
2934,
972,
2738,
972,
12,
8638,
87,
16,
4087,
5449,
13,
309,
22523,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
22523,
16,
4087,
5449,
273,
1083,
262,
30,
2240,
12,
2060,
3759,
16,
2890,
2934,
972,
2738,
972,
12,
8638,
87,
16,
4087,
5449,
13,
309,
22523,
30,
365,
... |
if instance is not None: | if instance._get_pk_val() is None: return getattr(instance, "__%s_save_defered_tags" % self.name, "") elif instance is not None: | def __get__(self, instance, owner=None): """ Tag getter. Returns an instance's tags if accessed on an instance, and all of a model's tags if called on a class. That is, this model:: | 84f3c701976f0dbf0c11f0c22fd1ff64aeba6ddf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4290/84f3c701976f0dbf0c11f0c22fd1ff64aeba6ddf/fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
791,
16,
3410,
33,
7036,
4672,
3536,
4034,
7060,
18,
2860,
392,
791,
1807,
2342,
309,
15539,
603,
392,
791,
16,
471,
777,
434,
279,
938,
1807,
2342,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
972,
12,
2890,
16,
791,
16,
3410,
33,
7036,
4672,
3536,
4034,
7060,
18,
2860,
392,
791,
1807,
2342,
309,
15539,
603,
392,
791,
16,
471,
777,
434,
279,
938,
1807,
2342,
309,
... |
fields2 = map(lambda x: (x[:i+1]==f[:i+1] and x[i+1:]) or [], fields) | fields2 = map(lambda x: (x[:i+1]==f[:i+1] and x[i+1:]) \ or [], fields) | def __export_row(self, cr, uid, row, fields, prefix, context=None): if not context: context={} lines = [] data = map(lambda x: '', range(len(fields))) done = [] for fpos in range(len(fields)): f = fields[fpos] if f and f[:len(prefix)] == prefix: r = row i = 0 while i<len(f): r = r[f[i]] if not r: break if isinstance(r, (browse_record_list, list)): first = True fields2 = map(lambda x: (x[:i+1]==f[:i+1] and x[i+1:]) or [], fields) if fields2 in done: break done.append(fields2) for row2 in r: lines2 = self.__export_row(cr, uid, row2, fields2, f[i+2:], context) if first: for fpos2 in range(len(fields)): if lines2 and lines2[0][fpos2]: data[fpos2] = lines2[0][fpos2] lines+= lines2[1:] first = False else: lines+= lines2 break i+=1 if i==len(f): data[fpos] = str(r or '') return [data] + lines | a87484186968213949c8b22ca9745b8fb61ec758 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/a87484186968213949c8b22ca9745b8fb61ec758/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
6530,
67,
492,
12,
2890,
16,
4422,
16,
4555,
16,
1027,
16,
1466,
16,
1633,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
2362,
273,
5378,
501,
273,
852,
12,
14661,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6530,
67,
492,
12,
2890,
16,
4422,
16,
4555,
16,
1027,
16,
1466,
16,
1633,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
2362,
273,
5378,
501,
273,
852,
12,
14661,
61... |
self.tk.call(self._w, 'addhistory', str) | self.tk.call(self._w, 'addhistory', str) | def add_history(self, str): | b0e44d61d9e592e1acd6aa05eac9704ba5776f61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b0e44d61d9e592e1acd6aa05eac9704ba5776f61/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8189,
12,
2890,
16,
609,
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... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8189,
12,
2890,
16,
609,
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,
... |
self.parser.parseError() | self.parser.parseError("No DOCTYPE seen.") | def processCharacters(self, data): self.parser.parseError() self.parser.phase = self.parser.phases["rootElement"] self.parser.phase.processCharacters(data) | f533ceac7b05451a5f5f98d0b1297288096ac71c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10463/f533ceac7b05451a5f5f98d0b1297288096ac71c/parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
11600,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
2670,
668,
2932,
2279,
5467,
17331,
5881,
1199,
13,
365,
18,
4288,
18,
13961,
273,
365,
18,
4288,
18,
844,
3304,
9614,
3085,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
11600,
12,
2890,
16,
501,
4672,
365,
18,
4288,
18,
2670,
668,
2932,
2279,
5467,
17331,
5881,
1199,
13,
365,
18,
4288,
18,
13961,
273,
365,
18,
4288,
18,
844,
3304,
9614,
3085,
10... |
reactor.stop() else: reactor.callFromThread(reactor.stop) | self._stop_reactor() else: reactor.callFromThread(self._stop_reactor) | def _NH_SIPEngineDidEnd(self, notification): if threadable.isInIOThread(): reactor.stop() else: reactor.callFromThread(reactor.stop) | 9885b83d2a6ef49837c109a96c7b044dbe506717 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/9885b83d2a6ef49837c109a96c7b044dbe506717/sip_subscribe_rls.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
50,
44,
67,
17739,
4410,
18250,
1638,
12,
2890,
16,
3851,
4672,
309,
2650,
429,
18,
291,
382,
4294,
3830,
13332,
19178,
18,
5681,
1435,
469,
30,
19178,
18,
1991,
1265,
3830,
12,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
50,
44,
67,
17739,
4410,
18250,
1638,
12,
2890,
16,
3851,
4672,
309,
2650,
429,
18,
291,
382,
4294,
3830,
13332,
19178,
18,
5681,
1435,
469,
30,
19178,
18,
1991,
1265,
3830,
12,
2... |
print "P2P Behaviour Started at port", str(self.myAgent.P2PPORT) | print self.getName(),": P2P Behaviour Started at port", str(self.myAgent.P2PPORT) | def onStart(self): open = False while open == False: try: self.server = SocketServer.ThreadingTCPServer(('', self.myAgent.P2PPORT), self.P2PRequestHandler) open = True except: self.myAgent.P2PPORT = random.randint(1025,65535) self.server._jabber_messageCB = self.myAgent._jabber_messageCB print "P2P Behaviour Started at port", str(self.myAgent.P2PPORT) | 9f0b7c0364d086fd6fa03dbe1cb839f880130866 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10121/9f0b7c0364d086fd6fa03dbe1cb839f880130866/Agent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1685,
12,
2890,
4672,
1696,
273,
1083,
1323,
1696,
422,
1083,
30,
775,
30,
365,
18,
3567,
273,
8758,
2081,
18,
3830,
310,
13891,
2081,
12,
2668,
2187,
365,
18,
4811,
3630,
18,
52,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
1685,
12,
2890,
4672,
1696,
273,
1083,
1323,
1696,
422,
1083,
30,
775,
30,
365,
18,
3567,
273,
8758,
2081,
18,
3830,
310,
13891,
2081,
12,
2668,
2187,
365,
18,
4811,
3630,
18,
52,... |
txmbrs = self.matchNaevr(na[0], na[1]) | if len(na) == 2: txmbrs = self.matchNaevr(na[0], na[1]) | def deselect(self, pattern): """ Remove these packages from the transaction. This is more user orientated than .remove(). Used from kickstart/install -blah. """ | 6526164c728cc28bd8d7b357768e0620dbc7a4fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/6526164c728cc28bd8d7b357768e0620dbc7a4fe/transactioninfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2832,
13759,
12,
2890,
16,
1936,
4672,
3536,
3581,
4259,
5907,
628,
326,
2492,
18,
1220,
353,
1898,
729,
7891,
690,
2353,
263,
4479,
7675,
10286,
628,
23228,
1937,
19,
5425,
300,
3083,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2832,
13759,
12,
2890,
16,
1936,
4672,
3536,
3581,
4259,
5907,
628,
326,
2492,
18,
1220,
353,
1898,
729,
7891,
690,
2353,
263,
4479,
7675,
10286,
628,
23228,
1937,
19,
5425,
300,
3083,
9... |
if len(current_labels): weight = 3 | if has_labels: print "weight = 3 for %s" % log_line_id weight = 3.0 | def index(self): current_labels = {} current_transcript_page = None current_page = 1 current_page_lines = 0 last_act = None previous_log_line_id = None launch_time = int(self.redis_conn.hget("mission:%s" % self.mission_name, "utc_launch_time")) acts = list(Act.Query(self.redis_conn, self.mission_name)) key_scenes = list(KeyScene.Query(self.redis_conn, self.mission_name)) glossary_items = dict([ (item.identifier.lower(), item) for item in Glossary.Query(self.redis_conn, self.mission_name) ]) for chunk in self.parser.get_chunks(): timestamp = chunk['timestamp'] log_line_id = "%s:%i" % (self.transcript_name, timestamp) # See if there's transcript page info, and update it if so if chunk['meta'].get('_page', 0): current_transcript_page = int(chunk["meta"]['_page']) if current_transcript_page: self.redis_conn.set("log_line:%s:page" % log_line_id, current_transcript_page) # Look up the act for act in acts: if act.includes(timestamp): break else: print "Error: No act for timestamp %s" % seconds_to_timestamp(timestamp) continue # If we've filled up the current page, go to a new one if current_page_lines >= self.LINES_PER_PAGE or (last_act is not None and last_act != act): current_page += 1 current_page_lines = 0 last_act = act # First, create a record with some useful information info_key = "log_line:%s:info" % log_line_id info_record = { "offset": chunk['offset'], "page": current_page, "act": act.number, "utc_time": launch_time + timestamp, } if current_transcript_page: info_record["transcript_page"] = current_transcript_page | d285e29e466e607adad3fc65af7df65097e97d54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13780/d285e29e466e607adad3fc65af7df65097e97d54/indexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
783,
67,
5336,
273,
2618,
783,
67,
27257,
67,
2433,
273,
599,
783,
67,
2433,
273,
404,
783,
67,
2433,
67,
3548,
273,
374,
1142,
67,
621,
273,
599,
2416,
67,
1330... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
12,
2890,
4672,
783,
67,
5336,
273,
2618,
783,
67,
27257,
67,
2433,
273,
599,
783,
67,
2433,
273,
404,
783,
67,
2433,
67,
3548,
273,
374,
1142,
67,
621,
273,
599,
2416,
67,
1330... |
MASTER can be given as a master widget.""" Variable.__init__(self, master) | MASTER can be given as master widget. VALUE is an optional value (defaults to 0.0) NAME is an optional Tcl name (defaults to PY_VARnum). If NAME matches an existing variable and VALUE is omitted then the existing value is retained. """ Variable.__init__(self, master, value, name) | def __init__(self, master=None): """Construct a float variable. | 72daca43c49dee94d35b25084bba9045bd6d0f49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/72daca43c49dee94d35b25084bba9045bd6d0f49/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
4672,
3536,
7249,
279,
1431,
2190,
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,
... | [
1,
1,
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,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
4672,
3536,
7249,
279,
1431,
2190,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.satposdepends[int(nim.connectedTo.value)]=x | connto = self.getRoot(x, int(nim.connectedTo.value)) if not self.satposdepends.has_key(connto): self.satposdepends[connto] = [] self.satposdepends[connto].append(x) | def update(self): sec = secClass.getInstance() self.configuredSatellites = Set() sec.clear() ## this do unlinking NIMs too !! print "sec config cleared" | 9063d6049a81d8945126c66e0a12ce8b5a64b4a1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6652/9063d6049a81d8945126c66e0a12ce8b5a64b4a1/NimManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
1428,
273,
1428,
797,
18,
588,
1442,
1435,
365,
18,
16449,
15163,
1165,
2997,
273,
1000,
1435,
1428,
18,
8507,
1435,
7541,
333,
741,
8255,
310,
423,
3445,
87,
4885,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
2890,
4672,
1428,
273,
1428,
797,
18,
588,
1442,
1435,
365,
18,
16449,
15163,
1165,
2997,
273,
1000,
1435,
1428,
18,
8507,
1435,
7541,
333,
741,
8255,
310,
423,
3445,
87,
4885,... |
self.failIfEqual(time.gmtime(xmas2002),time.localtime(xmas2002)) self.failUnless(time.tzname[0] in ('EST','AEST')) self.failUnless(time.tzname[1] in ('EST','EDT','AEDT')) self.failUnlessEqual(len(time.tzname),2) self.failUnlessEqual(time.daylight,1) self.failUnlessEqual(time.timezone,-36000) self.failUnlessEqual(time.altzone,-39600) self.failUnlessEqual(time.localtime(xmas2002).tm_isdst,1) | self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) self.failUnless(time.tzname[0] == 'AEST', str(time.tzname[0])) self.failUnless(time.tzname[1] == 'AEDT', str(time.tzname[1])) self.failUnlessEqual(len(time.tzname), 2) self.failUnlessEqual(time.daylight, 1) self.failUnlessEqual(time.timezone, -36000) self.failUnlessEqual(time.altzone, -39600) self.failUnlessEqual(time.localtime(xmas2002).tm_isdst, 1) | def test_tzset(self): if not hasattr(time, "tzset"): return # Can't test this; don't want the test suite to fail | 7f2588c073e80ab9932f69d1c5766aa73f4ae7d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/7f2588c073e80ab9932f69d1c5766aa73f4ae7d0/test_time.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
12994,
542,
12,
2890,
4672,
309,
486,
3859,
12,
957,
16,
315,
12994,
542,
6,
4672,
327,
468,
4480,
1404,
1842,
333,
31,
2727,
1404,
2545,
326,
1842,
11371,
358,
2321,
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,
1842,
67,
12994,
542,
12,
2890,
4672,
309,
486,
3859,
12,
957,
16,
315,
12994,
542,
6,
4672,
327,
468,
4480,
1404,
1842,
333,
31,
2727,
1404,
2545,
326,
1842,
11371,
358,
2321,
2,
-100... |
if key.startswith(data_group): | kid = key.split('/')[2] if kid == id: | def __get_data_children(self, tree, data_group=None): if data_group is None: return {} | 7d26143b836fee7ce6345d1890361e66bc688727 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/762/7d26143b836fee7ce6345d1890361e66bc688727/nexus_dst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
67,
892,
67,
5906,
12,
2890,
16,
2151,
16,
501,
67,
1655,
33,
7036,
4672,
309,
501,
67,
1655,
353,
599,
30,
327,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
588,
67,
892,
67,
5906,
12,
2890,
16,
2151,
16,
501,
67,
1655,
33,
7036,
4672,
309,
501,
67,
1655,
353,
599,
30,
327,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
return mod.new(key[: keySize], mod.MODE_CBC, iv[: mod.block_size]) | if counterMode: return mod.new(key[:keySize], mod.MODE_CTR, iv[:mod.block_size], counter=_Counter(iv, mod)) else: return mod.new(key[: keySize], mod.MODE_CBC, iv[: mod.block_size]) | def _getCipher(self, cip, iv, key): modName, keySize, counterMode = self.cipherMap[cip] if not modName: return # no cipher mod = __import__('Crypto.Cipher.%s'%modName, {}, {}, 'x') | a9151850423e3f3eee146aaa3a2e95e167c80b24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/a9151850423e3f3eee146aaa3a2e95e167c80b24/transport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
13896,
12,
2890,
16,
276,
625,
16,
4674,
16,
498,
4672,
681,
461,
16,
498,
1225,
16,
3895,
2309,
273,
365,
18,
17094,
863,
63,
3449,
65,
309,
486,
681,
461,
30,
327,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
13896,
12,
2890,
16,
276,
625,
16,
4674,
16,
498,
4672,
681,
461,
16,
498,
1225,
16,
3895,
2309,
273,
365,
18,
17094,
863,
63,
3449,
65,
309,
486,
681,
461,
30,
327,
468,
... |
raise Exception('AccessDenied') | raise security.ExceptionNoTb('AccessDenied') | def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): return True cr = pooler.get_db(db).cursor() if passwd not in _salt_cache: cr.execute( 'select login from res_users where id=%s', (uid,) ) stored_login = cr.fetchone() if stored_login: stored_login = stored_login[0] if not login(db,stored_login,passwd): return False salt = _salt_cache[passwd] cr.execute(' select count(*) from res_users where id=%s and password=%s', (int(uid), encrypt_md5( passwd, salt )) ) res = cr.fetchone()[0] cr.close() if not bool(res): raise Exception('AccessDenied') if res: security._uid_cache[uid] = passwd return bool(res) | 6846791c64da3d42cdf1a976059df8ebf42ef855 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6846791c64da3d42cdf1a976059df8ebf42ef855/crypt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
1966,
16,
4555,
16,
19093,
4672,
309,
4373,
6315,
1911,
67,
2493,
18,
5332,
67,
856,
12,
4555,
262,
471,
261,
7462,
6315,
1911,
67,
2493,
63,
1911,
65,
631,
24002,
4672,
327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
1966,
16,
4555,
16,
19093,
4672,
309,
4373,
6315,
1911,
67,
2493,
18,
5332,
67,
856,
12,
4555,
262,
471,
261,
7462,
6315,
1911,
67,
2493,
63,
1911,
65,
631,
24002,
4672,
327,
... |
print "AddSite(%s)" % login_base, site_id = AddSite(admin, name, abbreviated_name, login_base, {'latitude': latitude, 'longitude': longitude}) | site_fields = random_site() print "AddSite", site_id = AddSite(admin, site_fields) | def unicmp(a, b, encoding = "utf-8"): """ When connected directly to the DB, values are returned as raw 8-bit strings that may need to be decoded (as UTF-8 by default) in order to compare them against expected Python Unicode strings. """ is8bit = re.compile("[\x80-\xff]").search if isinstance(a, str) and is8bit(a): a = unicode(a, encoding) if isinstance(b, str) and is8bit(b): b = unicode(b, encoding) return a == b | f51dbe12c30f8473b083ea86b3dade41e56f4615 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/f51dbe12c30f8473b083ea86b3dade41e56f4615/Test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
335,
1291,
12,
69,
16,
324,
16,
2688,
273,
315,
3158,
17,
28,
6,
4672,
3536,
5203,
5840,
5122,
358,
326,
2383,
16,
924,
854,
2106,
487,
1831,
1725,
17,
3682,
2064,
716,
2026,
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,
640,
335,
1291,
12,
69,
16,
324,
16,
2688,
273,
315,
3158,
17,
28,
6,
4672,
3536,
5203,
5840,
5122,
358,
326,
2383,
16,
924,
854,
2106,
487,
1831,
1725,
17,
3682,
2064,
716,
2026,
16... |
print state.deleted | def undo(self, event): # wxGlade: Movinator.<event_handler> if state.last_action == 1: self.grid_1.SetCellValue(state.last_info[0], state.last_info[1], state.last_info[2]) mid = self.grid_1.GetRowLabelValue(state.last_info[0]) state.edited.remove((mid, state.last_info[1])) paintCell(self.grid_1, mid, state.last_info[0], state.last_info[1]) print state.edited elif state.last_action == 2: row = state.last_info.pop(0) unshiftRows(self.grid_1, row) self.grid_1.SetRowLabelValue(row, state.last_info[0]) for j in xrange(self.grid_1.GetNumberCols()): self.grid_1.SetCellValue(row, j, state.last_info[j + 1]) paintCell(self.grid_1, state.last_info[0], row, j) state.deleted.remove(state.last_info[0]) print state.deleted self.enableUndo(False) | 61e85a19eab6040b0d3364c60a9ea0b7878c41ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2517/61e85a19eab6040b0d3364c60a9ea0b7878c41ef/movinator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
12,
2890,
16,
871,
4672,
468,
7075,
21308,
2486,
30,
490,
1527,
4240,
22782,
2575,
67,
4176,
34,
309,
919,
18,
2722,
67,
1128,
422,
404,
30,
365,
18,
5222,
67,
21,
18,
694,
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,
15436,
12,
2890,
16,
871,
4672,
468,
7075,
21308,
2486,
30,
490,
1527,
4240,
22782,
2575,
67,
4176,
34,
309,
919,
18,
2722,
67,
1128,
422,
404,
30,
365,
18,
5222,
67,
21,
18,
694,
27... | |
self._rbuf = data[nl:] buffers[-1] = data[:nl] break | self._rbuf.write(buffer(data, nl)) if buf_len: buf.write(buffer(data, 0, nl)) break else: return data[:nl] | def readline(self, size=-1): data = self._rbuf if size < 0: # Read until \n or EOF, whichever comes first if self._rbufsize <= 1: # Speed up unbuffered case assert data == "" buffers = [] recv = self._sock.recv while data != "\n": data = recv(1) if not data: break buffers.append(data) return "".join(buffers) nl = data.find('\n') if nl >= 0: nl += 1 self._rbuf = data[nl:] return data[:nl] buffers = [] if data: buffers.append(data) self._rbuf = "" while True: data = self._sock.recv(self._rbufsize) if not data: break buffers.append(data) nl = data.find('\n') if nl >= 0: nl += 1 self._rbuf = data[nl:] buffers[-1] = data[:nl] break return "".join(buffers) else: # Read until size bytes or \n or EOF seen, whichever comes first nl = data.find('\n', 0, size) if nl >= 0: nl += 1 self._rbuf = data[nl:] return data[:nl] buf_len = len(data) if buf_len >= size: self._rbuf = data[size:] return data[:size] buffers = [] if data: buffers.append(data) self._rbuf = "" while True: data = self._sock.recv(self._rbufsize) if not data: break buffers.append(data) left = size - buf_len nl = data.find('\n', 0, left) if nl >= 0: nl += 1 self._rbuf = data[nl:] buffers[-1] = data[:nl] break n = len(data) if n >= left: self._rbuf = data[left:] buffers[-1] = data[:left] break buf_len += n return "".join(buffers) | ff256883cb7306979505241c85b4cf8a95366e5b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/ff256883cb7306979505241c85b4cf8a95366e5b/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
501,
273,
365,
6315,
86,
4385,
309,
963,
411,
374,
30,
468,
2720,
3180,
521,
82,
578,
6431,
16,
600,
335,
580,
502,
14535,
1122,
309,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
501,
273,
365,
6315,
86,
4385,
309,
963,
411,
374,
30,
468,
2720,
3180,
521,
82,
578,
6431,
16,
600,
335,
580,
502,
14535,
1122,
309,
365,
... |
cur_list = skel_to_col_attr_list(self.__skeleton__[table]) | cur_list = skel_to_col_attr_list(self.__skeleton__[table_name]) | def drop_primary_key(self, table, col_name): """ WORD ON THE STREET IS THAT SQLITE IS RETARDED ABOUT *ALTER TABLE* COMMANDS... SO MEANWHILE WE ACCOMPLISH THIS BY CREATING A TEMPORARY TABLE. SUGGESTIONS FOR SPEEDUP ARE WELCOME. (OR JUST SEND A PATCH...) | 85d02cb25b26fc015382d67ed0b0b5b5529e5568 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/85d02cb25b26fc015382d67ed0b0b5b5529e5568/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3640,
67,
8258,
67,
856,
12,
2890,
16,
1014,
16,
645,
67,
529,
4672,
3536,
21464,
6229,
12786,
2347,
862,
1584,
4437,
7662,
789,
3063,
5398,
4437,
10366,
985,
7660,
10336,
5069,
380,
188... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3640,
67,
8258,
67,
856,
12,
2890,
16,
1014,
16,
645,
67,
529,
4672,
3536,
21464,
6229,
12786,
2347,
862,
1584,
4437,
7662,
789,
3063,
5398,
4437,
10366,
985,
7660,
10336,
5069,
380,
188... |
launch_date = datetime.now() | launch_date = date | def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': return | 6b4adfbab21f2784cf425c5711d0bf996b80f832 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6b4adfbab21f2784cf425c5711d0bf996b80f832/marketing_campaign.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
67,
476,
12,
2890,
16,
4422,
16,
4555,
16,
26409,
16,
819,
33,
7036,
4672,
309,
26409,
18,
2019,
480,
296,
9012,
4278,
327,
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,
389,
2567,
67,
476,
12,
2890,
16,
4422,
16,
4555,
16,
26409,
16,
819,
33,
7036,
4672,
309,
26409,
18,
2019,
480,
296,
9012,
4278,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
_string = p.sub(r"\\includegraphics{\1}", _string) | string = p.sub(r"\\includegraphics{\1}", string) return string def transform_substitutions(string): """ substitutions """ | def transform(string): """ convert/transform one line """ global frame_opened, enum_item_level # nasty thing to do global frame_header, frame_footer, next_frame_footer preamble = "" # for enumeration/itemize environment commands # handle itemizing/enumerations p = re.compile("^([\*\#]+).*$") m = p.match(string) if (m == None): my_enum_item_level = "" else: my_enum_item_level = m.group(1) # trivial: old level = new level if (my_enum_item_level == enum_item_level): pass else: # find common part common = -1 while (len(enum_item_level) > common + 1) and \ (len(my_enum_item_level) > common + 1) and \ (enum_item_level[common+1] == my_enum_item_level[common+1]): common = common + 1 # close enum_item_level environments from back to front for i in range(len(enum_item_level)-1, common, -1): if (enum_item_level[i] == "*"): preamble = preamble + "\\end{itemize}\n" elif (enum_item_level[i] == "#"): preamble = preamble + "\\end{enumerate}\n" # open my_enum_item_level environments from front to back for i in range(common+1, len(my_enum_item_level)): if (my_enum_item_level[i] == "*"): preamble = preamble + "\\begin{itemize}\n" elif (my_enum_item_level[i] == "#"): preamble = preamble + "\\begin{enumerate}\n" enum_item_level = my_enum_item_level # now, substitute item markers p = re.compile("^([\*\#]+)(.*)$") _string = p.sub(r" \\item\2", string) string = _string # header and footer definitions p = re.compile("^@FRAMEHEADER=(.*)$", re.VERBOSE) m = p.match(string) if (m != None): #print m.group(1) frame_header = m.group(1) string = "" p = re.compile("^@FRAMEFOOTER=(.*)$", re.VERBOSE) m = p.match(string) if (m != None): #print m.group(1) next_frame_footer = m.group(1) string = "" # detect manual closing of frames p = re.compile(r"(?:^\s*\\end{\s*frame\s*})|(?:^\[\s*frame\s*\]>)") if (frame_opened == 1): if (len(p.findall(string)) > 0): frame_opened = 0 # headings (3) to frames p = re.compile("^====\s*(.*?)\s*====(.*)", re.VERBOSE) if (frame_opened == 0): _string = p.sub(r"\\begin{frame}\2\n \\frametitle{\1}\n <---FRAMEHEADER---> \n", string) else: _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\n\\begin{frame}\2\n \\frametitle{\1}\n <---FRAMEHEADER---> \n", string) if (string != _string): frame_opened = 1 # headings (2) to subsections string = _string p = re.compile("^===\s*(.*?)\s*===(.*)", re.VERBOSE) if (frame_opened == 1): _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\\subsection\2{\1}\n\n", string) else: _string = p.sub(r"\n\\subsection\2{\1}\n\n", string) if (string != _string): frame_opened = 0 # headings (1) to sections string = _string p = re.compile("^==\s*(.*?)\s*==(.*)", re.VERBOSE) if (frame_opened == 1): _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\n\\section\2{\1}\n\n", string) else: _string = p.sub(r"\n\n\\section\2{\1}\n\n", string) if (string != _string): frame_opened = 0 _string = _string.replace("<---FRAMEHEADER--->", frame_header) _string = _string.replace("<---FRAMEFOOTER--->", frame_footer) if (_string.find("\\end{frame}") != -1): frame_footer = next_frame_footer # latex environments, the users takes full responsibility # for closing ALL opened environments # exampe: # <[block]{block title} # message # [block]> # -> open p = re.compile("^<\[([^{}]*?)\]", re.VERBOSE) _string = p.sub(r"\\begin{\1}", _string) # -> close p = re.compile("^\[([^{}]*?)\]>", re.VERBOSE) _string = p.sub(r"\\end{\1}", _string) # columns p = re.compile("^\[\[\[(.*?)\]\]\]", re.VERBOSE) _string = p.sub(r"\\column{\1}", _string) # bold font p = re.compile("'''(.*?)'''", re.VERBOSE) _string = p.sub(r"\\textbf{\1}", _string) # italic font p = re.compile("''(.*?)''", re.VERBOSE) _string = p.sub(r"\\emph{\1}", _string) # typewriter font p = re.compile("@(.*?)@", re.VERBOSE) _string = p.sub(r"\\texttt{\1}", _string) # alerts p = re.compile("!(.*?)!", re.VERBOSE) _string = p.sub(r"\\alert{\1}", _string) # colors p = re.compile("_([^_\\\\]*?)_([^_]*?[^_\\\\])_", re.VERBOSE) _string = p.sub(r"\\textcolor{\1}{\2}", _string) # footnotes p = re.compile("\(\(\((.*?)\)\)\)", re.VERBOSE) _string = p.sub(r"\\footnote{\1}", _string) # figures/images p = re.compile("\<\<\<(.*?),(.*?)\>\>\>", re.VERBOSE) _string = p.sub(r"\\includegraphics[\2]{\1}", _string) p = re.compile("\<\<\<(.*?)\>\>\>", re.VERBOSE) _string = p.sub(r"\\includegraphics{\1}", _string) # substitutions p = re.compile("(\s)-->(\s)", re.VERBOSE) _string = p.sub(r"\1$\\rightarrow$\2", _string) p = re.compile("(\s)<--(\s)", re.VERBOSE) _string = p.sub(r"\1$\\leftarrow$\2", _string) p = re.compile("(\s)==>(\s)", re.VERBOSE) _string = p.sub(r"\1$\\Rightarrow$\2", _string) p = re.compile("(\s)<==(\s)", re.VERBOSE) _string = p.sub(r"\1$\\Leftarrow$\2", _string) p = re.compile("(\s):-\)(\s)", re.VERBOSE) _string = p.sub(r"\1\\smiley\2", _string) p = re.compile("(\s):-\((\s)", re.VERBOSE) _string = p.sub(r"\1\\frownie\2", _string) # to be continued ... return preamble + _string | 1947325dce6126afe82562ecb94d6cdf480ca241 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14466/1947325dce6126afe82562ecb94d6cdf480ca241/wiki2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
1080,
4672,
3536,
1765,
19,
6547,
1245,
980,
3536,
2552,
2623,
67,
25304,
16,
2792,
67,
1726,
67,
2815,
565,
468,
290,
689,
93,
7757,
358,
741,
2552,
2623,
67,
3374,
16,
2623... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
1080,
4672,
3536,
1765,
19,
6547,
1245,
980,
3536,
2552,
2623,
67,
25304,
16,
2792,
67,
1726,
67,
2815,
565,
468,
290,
689,
93,
7757,
358,
741,
2552,
2623,
67,
3374,
16,
2623... |
self.xmlnode=xmlnode.docCopyNode(common_doc,1) | self.xmlnode=xmlnode_node_or_node.docCopyNode(common_doc,1) | def __init__(self,xmlnode_or_node=None): self.xmlnode=None self.xpath_ctxt=None if isinstance(xmlnode_or_node,libxml2.xmlNode): ns=xmlnode.ns() if ns.getContent() != DISCO_ITEMS_NS: raise RosterError,"Bad disco-items namespace" self.xmlnode=xmlnode.docCopyNode(common_doc,1) common_root.addChild(self.xmlnode) self.ns=self.xmlnode.ns() else: self.xmlnode=common_root.newChild(None,"query",None) self.ns=self.xmlnode.newNs(DISCO_ITEMS_NS,None) self.xmlnode.setNs(self.ns) if xmlnode_or_node: self.xmlnode.setProp("node",to_utf8(xmlnode_or_node)) self.xpath_ctxt=common_doc.xpathNewContext() self.xpath_ctxt.setContextNode(self.xmlnode) self.xpath_ctxt.xpathRegisterNs("d",DISCO_ITEMS_NS) | 9d12cdc3241bcfde5765409cc8e03e69cf7e6ed9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/9d12cdc3241bcfde5765409cc8e03e69cf7e6ed9/disco.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2902,
2159,
67,
280,
67,
2159,
33,
7036,
4672,
365,
18,
2902,
2159,
33,
7036,
365,
18,
18644,
67,
20364,
33,
7036,
309,
1549,
12,
2902,
2159,
67,
280,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2902,
2159,
67,
280,
67,
2159,
33,
7036,
4672,
365,
18,
2902,
2159,
33,
7036,
365,
18,
18644,
67,
20364,
33,
7036,
309,
1549,
12,
2902,
2159,
67,
280,
... |
subject = _('Mailman results for %s') % self.real_name responsemsg = Message.UserNotification(msg.GetSender(), | realname = self.real_name subject = _('Mailman results for %(realname)s') responsemsg = Message.UserNotification(msg.get_sender(), | def ParseMailCommands(self, msg): # Break any infloops. If this has come from a Mailman server then # it'll have this header. It's still possible to infloop between two # servers because there's no guaranteed way to know it came from a # bot. if msg.get('x-beenthere') or msg.get('list-id'): return # check the autoresponse stuff if self.autorespond_requests: # TBD: this is a hack and is not safe with respect to errors in # the Replybot module. It should be redesigned to work with the # robust delivery scheme. from Mailman.Handlers import Replybot Replybot.process(self, msg, msgdata={'torequest':1}) if self.autorespond_requests == 1: # Yes, auto-respond and discard return | bfed9ae359e2eea17ad856f6284f7870ede7b63f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/bfed9ae359e2eea17ad856f6284f7870ede7b63f/MailCommandHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
12,
2890,
16,
1234,
4672,
468,
17030,
1281,
8286,
383,
4473,
18,
225,
971,
333,
711,
12404,
628,
279,
11542,
4728,
1438,
1508,
468,
518,
5614,
1240,
333,
1446,
18,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
12,
2890,
16,
1234,
4672,
468,
17030,
1281,
8286,
383,
4473,
18,
225,
971,
333,
711,
12404,
628,
279,
11542,
4728,
1438,
1508,
468,
518,
5614,
1240,
333,
1446,
18,
225,... |
return m def list(self, n): return [self(i) for i in range(0,n)] | return Integer(m) class A111787(SloaneSequence): r""" This function returns the $n$-th number of Sloane's sequence A111787 $a(n)=0$ if $n$ is an odd prime or a power of 2. For numbers of the third kind (see A111774) we proceed as follows: suppose $n$ is to be written as sum of $k$ consecutive integers starting with $m$, then $2n = k(2m + k - 1)$. Let $p$ be the smallest odd prime divisor of $n$ then $a(n) = min(p,2n/p)$. See: \url{http://www.jaapspies.nl/mathfiles/problem2005-2C.pdf} INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A111787; a a(n) is the least k >= 3 such that n can be written as sum of k consecutive integers. a(n)=0 if such a k does not exist. sage: a.offset 1 sage: a(1) 0 sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(100) 5 sage: a(256) 0 sage: a(29) 0 sage: a.list(20) [0, 0, 0, 0, 0, 3, 0, 0, 3, 4, 0, 3, 0, 4, 3, 0, 0, 3, 0, 5] sage: a(-1) Traceback (most recent call last): ... ValueError: input n (=-1) must be a positive integer AUTHOR: - Jaap Spies (2007-01-14) """ def _repr_(self): return "a(n) is the least k >= 3 such that n can be written as sum of k consecutive integers. a(n)=0 if such a k does not exist." offset = 1 def _eval(self, n): if arith.is_prime(n) or is_power_of_two(n): return 0 else: for d in srange(3,n,2): if n % d == 0: return min(d, 2*n/d) | def _eval(self, n): if n == 1 or n == 0: return 1 m = 0 for d in [i for i in arith.divisors(n) if i%2]: # d is odd divisor k = min(d, 2*n/d) if k > m: m = k return m | da9c7077d971928cf55f4cb1660269f1a93e0d92 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/da9c7077d971928cf55f4cb1660269f1a93e0d92/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
404,
578,
290,
422,
374,
30,
327,
404,
312,
273,
374,
364,
302,
316,
306,
77,
364,
277,
316,
419,
483,
18,
2892,
291,
1383,
12,
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,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
404,
578,
290,
422,
374,
30,
327,
404,
312,
273,
374,
364,
302,
316,
306,
77,
364,
277,
316,
419,
483,
18,
2892,
291,
1383,
12,
8... |
if type(conversion) is not type(""): ofp.write("(%s\n" % macroname) | ofp.write("(%s\n" % macroname) | def subconvert(line, ofp, table, discards, autoclosing, knownempty, endchar=None): stack = [] while line: if line[0] == endchar and not stack: return line[1:] m = _comment_rx.match(line) if m: text = m.group(1) if text: ofp.write("(COMMENT\n") ofp.write("-%s\n" % encode(text)) ofp.write(")COMMENT\n") ofp.write("-\\n\n") else: ofp.write("-\\n\n") line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s%s" % (m.group(1), line[m.end():]) continue m =_end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in autoclosing: raise LaTeXFormatError("open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] ofp.write(")document\n") elif envname == stack[-1]: ofp.write(")%s\n" % envname) del stack[-1] else: | 96b07a9453cea31e40ee00a69838d4fc29ad3d66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/96b07a9453cea31e40ee00a69838d4fc29ad3d66/latex2esis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
1369,
16,
434,
84,
16,
1014,
16,
10388,
87,
16,
23173,
10910,
16,
4846,
5531,
16,
679,
3001,
33,
7036,
4672,
2110,
273,
5378,
1323,
980,
30,
309,
980,
63,
20,
65,
422,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
720,
6283,
12,
1369,
16,
434,
84,
16,
1014,
16,
10388,
87,
16,
23173,
10910,
16,
4846,
5531,
16,
679,
3001,
33,
7036,
4672,
2110,
273,
5378,
1323,
980,
30,
309,
980,
63,
20,
65,
422,... |
self.pipelineShortName = pipelineShortName | self.pipelineName = pipelineName | def __init__(self, scratchDir, wfName, pipelineShortName, pipelineNumber): self.wfName = wfName self.pipelineShortName = pipelineShortName self.pipelineNumber = pipelineNumber | 315fed894682d914284861c750293930dc4c7c5a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6549/315fed894682d914284861c750293930dc4c7c5a/killjobs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
15289,
1621,
16,
11578,
461,
16,
5873,
29983,
16,
5873,
1854,
4672,
365,
18,
15581,
461,
273,
11578,
461,
365,
18,
14511,
461,
273,
5873,
461,
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,
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,
15289,
1621,
16,
11578,
461,
16,
5873,
29983,
16,
5873,
1854,
4672,
365,
18,
15581,
461,
273,
11578,
461,
365,
18,
14511,
461,
273,
5873,
461,
365,
18,
1... |
if isinstance(reference, uri.Reference): | if isinstance(reference, Reference): | def remove(reference): if isinstance(reference, uri.Reference): path = str(reference.path) elif isinstance(reference, uri.Path): path = str(path) | 5acb3d078dee387b8946120b0bf5136ea2650552 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5acb3d078dee387b8946120b0bf5136ea2650552/file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
6180,
4672,
309,
1549,
12,
6180,
16,
6268,
4672,
589,
273,
609,
12,
6180,
18,
803,
13,
1327,
1549,
12,
6180,
16,
2003,
18,
743,
4672,
589,
273,
609,
12,
803,
13,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1206,
12,
6180,
4672,
309,
1549,
12,
6180,
16,
6268,
4672,
589,
273,
609,
12,
6180,
18,
803,
13,
1327,
1549,
12,
6180,
16,
2003,
18,
743,
4672,
589,
273,
609,
12,
803,
13,
2,
-100,
... |
return (kvp(v-1,z,n-1) - kvp(v+1,z,n-1))/2.0 | return (kvp(v-1,z,n-1) + kvp(v+1,z,n-1))/(-2.0) | def kvp(v,z,n=1): """Return the nth derivative of Kv(z) with respect to z. """ if not isinstance(n,types.IntType) or (n<0): raise ValueError, "n must be a non-negative integer." if n == 0: return kv(v,z) else: return (kvp(v-1,z,n-1) - kvp(v+1,z,n-1))/2.0 | 25fdc9a434d27ad47c3e1b11ae461962bd71e2fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/25fdc9a434d27ad47c3e1b11ae461962bd71e2fe/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6047,
84,
12,
90,
16,
94,
16,
82,
33,
21,
4672,
3536,
990,
326,
20196,
16417,
434,
1475,
90,
12,
94,
13,
598,
8762,
358,
998,
18,
3536,
309,
486,
1549,
12,
82,
16,
2352,
18,
1702,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6047,
84,
12,
90,
16,
94,
16,
82,
33,
21,
4672,
3536,
990,
326,
20196,
16417,
434,
1475,
90,
12,
94,
13,
598,
8762,
358,
998,
18,
3536,
309,
486,
1549,
12,
82,
16,
2352,
18,
1702,
... |
def MoveSkel(target): | def MoveSkel(prefix): CreateDirectory("." + prefix) | def MoveSkel(target): for a in ["bin", "pkg", "lib", "www", "man"]: os.file.rename(a, target + "/" + a) | 518b7ebb6be46e8ecaf4edf41a80478bf3d99ffd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9328/518b7ebb6be46e8ecaf4edf41a80478bf3d99ffd/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9933,
5925,
292,
12,
3239,
4672,
1788,
2853,
2932,
1199,
397,
1633,
13,
364,
279,
316,
8247,
4757,
3113,
315,
10657,
3113,
315,
2941,
3113,
315,
5591,
3113,
315,
4728,
11929,
30,
1140,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9933,
5925,
292,
12,
3239,
4672,
1788,
2853,
2932,
1199,
397,
1633,
13,
364,
279,
316,
8247,
4757,
3113,
315,
10657,
3113,
315,
2941,
3113,
315,
5591,
3113,
315,
4728,
11929,
30,
1140,
1... |
if not (key.startswith('t:') or key.startswith('i18n:')): | if (not (key.startswith('t:') or key.startswith('i18n:')) or key == 't:contextMenu'): | def startElement(self,name, attrs): self.depth = self.depth + 1 | 3a8b5d04708d27f5ab853299f15a40cf9059e68c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/3a8b5d04708d27f5ab853299f15a40cf9059e68c/template_compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13591,
12,
2890,
16,
529,
16,
3422,
4672,
365,
18,
5979,
273,
365,
18,
5979,
397,
404,
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,
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,
13591,
12,
2890,
16,
529,
16,
3422,
4672,
365,
18,
5979,
273,
365,
18,
5979,
397,
404,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
group.add_option('--smtp', dest='smtp_server', default='', | group.add_option('--smtp', dest='smtp_server', | def __init__(self, fname=None): self.options = { 'interface': '', 'netrpc': True, 'netport': '8070', 'xmlrpc': False, 'xmlport': '8069', 'webdav': False, 'webdavport': '8080', 'soap': False, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'pg_path': None, 'admin_passwd': 'admin', 'verbose': False, 'debug_mode': False, 'pidfile': None, 'logfile': None, 'secure': False, 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_password': False, 'stop_after_init': False, 'data_path': '/var/lib/trytond', } | b5cebcba6e2c93354148fdb6d3407093b6d2dd03 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/b5cebcba6e2c93354148fdb6d3407093b6d2dd03/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5299,
33,
7036,
4672,
365,
18,
2116,
273,
288,
296,
5831,
4278,
10226,
296,
2758,
7452,
4278,
1053,
16,
296,
2758,
655,
4278,
296,
3672,
7301,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5299,
33,
7036,
4672,
365,
18,
2116,
273,
288,
296,
5831,
4278,
10226,
296,
2758,
7452,
4278,
1053,
16,
296,
2758,
655,
4278,
296,
3672,
7301,
2187,
296,
... |
if options.pidfile: | if options.daemonize and options.pidfile: | def _validate_callback(option, opt_str, value, parser, valid_values): if value not in valid_values: raise OptionValueError('%s must be one of: %s, not %s' % (opt_str, '|'.join(valid_values), value)) setattr(parser.values, option.dest, value) | ff02549a468acc0c7660216e44139bcdb6868d0d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/ff02549a468acc0c7660216e44139bcdb6868d0d/standalone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5662,
67,
3394,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
16,
923,
67,
2372,
4672,
309,
460,
486,
316,
923,
67,
2372,
30,
1002,
2698,
23610,
29909,
87,
1297,
506,
1245,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5662,
67,
3394,
12,
3482,
16,
2153,
67,
701,
16,
460,
16,
2082,
16,
923,
67,
2372,
4672,
309,
460,
486,
316,
923,
67,
2372,
30,
1002,
2698,
23610,
29909,
87,
1297,
506,
1245,
43... |
raw_errors = parse(file).getElementsByTagName("error") for raw_error in raw_errors: if (show_all_leaks or getTextOf(raw_error, "kind") != "Leak_PossiblyLost"): self._errors.add(ValgrindError(source_dir, raw_error)) | try: raw_errors = parse(file).getElementsByTagName("error") for raw_error in raw_errors: if (show_all_leaks or getTextOf(raw_error, "kind") != "Leak_PossiblyLost"): self._errors.add(ValgrindError(source_dir, raw_error)) except ExpatError, e: logging.warn("could not parse %s: %s" % (file, e)) lineno = e.lineno - 1 context_lines = 5 context_start = max(0, lineno - context_lines) context_end = lineno + context_lines + 1 context_file = open(file, "r") for i in range(0, context_start): context_file.readline() for i in range(context_start, context_end): context_data = context_file.readline().rstrip() if i != lineno: logging.warn(" %s" % context_data) else: logging.warn("> %s" % context_data) context_file.close() continue | def __init__(self, source_dir, files, show_all_leaks=False): '''Reads in a set of files. | 7bb860aa9310e178431f0cb83696b7d2a5856f37 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/7bb860aa9310e178431f0cb83696b7d2a5856f37/valgrind_analyze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1084,
67,
1214,
16,
1390,
16,
2405,
67,
454,
67,
298,
581,
87,
33,
8381,
4672,
9163,
7483,
316,
279,
444,
434,
1390,
18,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1084,
67,
1214,
16,
1390,
16,
2405,
67,
454,
67,
298,
581,
87,
33,
8381,
4672,
9163,
7483,
316,
279,
444,
434,
1390,
18,
2,
-100,
-100,
-100,
-100,
-10... |
self.shutdownAudio() elif self.audioShutdown and \ nav.getFirstAudioOffset(self.audio + 1) != 0x0000 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x3fff: self.restartAudio() else: print "Beware!" | self.shutdownAudio() elif self.audioShutdown and \ self.audio != -1 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x0000 and \ nav.getFirstAudioOffset(self.audio + 1) != 0x3fff: self.restartAudio() | def vobuHeader(self, src, buf): """The signal handler for the source's vobu-header signal.""" gst.log("Vobu header") | 36ab5c0361e1443af8d4e5fd45da15fb689c4fac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5222/36ab5c0361e1443af8d4e5fd45da15fb689c4fac/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
947,
89,
1864,
12,
2890,
16,
1705,
16,
1681,
4672,
3536,
1986,
4277,
1838,
364,
326,
1084,
1807,
331,
947,
89,
17,
3374,
4277,
12123,
314,
334,
18,
1330,
2932,
58,
947,
89,
1446,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
947,
89,
1864,
12,
2890,
16,
1705,
16,
1681,
4672,
3536,
1986,
4277,
1838,
364,
326,
1084,
1807,
331,
947,
89,
17,
3374,
4277,
12123,
314,
334,
18,
1330,
2932,
58,
947,
89,
1446,
... |
landscape_types = [''] | landscape_types = [] | def search_geopoints_frontpage(self, arrStakeholders='', arrSupplyChains='', arrAdministrativeLevels='', arrLandscapeTypes='', path='', geo_types=None, geo_query=None, REQUEST=None): """ """ arr_geo_types = [] if arrStakeholders: arr_geo_types.extend( arrStakeholders.split(',') ); | 3f85cfac49df96fe13e920164b73bf1cc0ab4699 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/3f85cfac49df96fe13e920164b73bf1cc0ab4699/GeoMapTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
908,
556,
763,
87,
67,
10211,
2433,
12,
2890,
16,
2454,
510,
911,
9000,
2218,
2187,
2454,
3088,
1283,
15945,
2218,
2187,
2454,
4446,
3337,
1535,
12240,
2218,
2187,
2454,
29398,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
908,
556,
763,
87,
67,
10211,
2433,
12,
2890,
16,
2454,
510,
911,
9000,
2218,
2187,
2454,
3088,
1283,
15945,
2218,
2187,
2454,
4446,
3337,
1535,
12240,
2218,
2187,
2454,
29398,
... |
actor.setParseAction(R("actor")) | def reporter(s, loc, toks): pass # print "%20s %-50s" % (name, toks) | 29016c50b61ac5c64a6e0473527fc958d9ff1d0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2289/29016c50b61ac5c64a6e0473527fc958d9ff1d0d/linesyntax.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11528,
12,
87,
16,
1515,
16,
21404,
4672,
1342,
468,
1172,
2213,
3462,
87,
738,
17,
3361,
87,
6,
738,
261,
529,
16,
21404,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11528,
12,
87,
16,
1515,
16,
21404,
4672,
1342,
468,
1172,
2213,
3462,
87,
738,
17,
3361,
87,
6,
738,
261,
529,
16,
21404,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.alive = False | self.alive.clear() | def OnPortSettings(self, event=None): """Show the portsettings dialog. The reader thread is stopped for the settings change.""" if event is not None: #will be none iwhencalled on startup self.StopThread() self.serial.close() ok = False while not ok: dialog_serial_cfg = wxSerialConfigDialog.SerialConfigDialog(None, -1, "", show=wxSerialConfigDialog.SHOW_BAUDRATE|wxSerialConfigDialog.SHOW_FORMAT|wxSerialConfigDialog.SHOW_FLOW, serial=self.serial ) result = dialog_serial_cfg.ShowModal() dialog_serial_cfg.Destroy() #open port if not called on startup, open it on startup and OK too if result == wxID_OK or event is not None: try: self.serial.open() except serial.SerialException, e: dlg = wxMessageDialog(None, str(e), "Serial Port Error", wxOK | wxICON_ERROR) dlg.ShowModal() dlg.Destroy() else: self.StartThread() self.SetTitle("Serial Terminal on %s [%s, %s%s%s%s%s]" % ( self.serial.portstr, self.serial.baudrate, self.serial.bytesize, self.serial.parity, self.serial.stopbits, self.serial.rtscts and ' RTS/CTS' or '', self.serial.xonxoff and ' Xon/Xoff' or '', ) ) ok = True else: #on startup, dialog aborted self.alive = False ok = True | 3df461ebbf6aac508e7b497f9ca64fb1f9736861 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/3df461ebbf6aac508e7b497f9ca64fb1f9736861/wxTerminal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2617,
2628,
12,
2890,
16,
871,
33,
7036,
4672,
3536,
5706,
326,
1756,
4272,
6176,
18,
1021,
2949,
2650,
353,
9627,
364,
326,
1947,
2549,
12123,
309,
871,
353,
486,
599,
30,
6647,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2617,
2628,
12,
2890,
16,
871,
33,
7036,
4672,
3536,
5706,
326,
1756,
4272,
6176,
18,
1021,
2949,
2650,
353,
9627,
364,
326,
1947,
2549,
12123,
309,
871,
353,
486,
599,
30,
6647,
... |
raise BrowseRecordError(_('Wrong ID for the browse record, got %r, expected an integer.') % (id,)) | raise BrowseRecordError(_('Wrong ID for the %s browse record, got %r, expected an integer.') % (self._table_name, id,)) | def __init__(self, cr, uid, id, table, cache, context=None, list_class=None, fields_process=None, fields_only=True): ''' table : the object (inherited from orm) context : dictionary with an optional context ''' if not context: context = {} self._list_class = list_class or browse_record_list self._cr = cr self._uid = uid self._id = id self._table = table self._table_name = self._table._name self.__logger = logging.getLogger( 'osv.browse_record.' + self._table_name) self._context = context self._fields_process = fields_process self._fields_only = fields_only | 906ac8c4a593f2791252a50599cd52271d80939b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/906ac8c4a593f2791252a50599cd52271d80939b/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4422,
16,
4555,
16,
612,
16,
1014,
16,
1247,
16,
819,
33,
7036,
16,
666,
67,
1106,
33,
7036,
16,
1466,
67,
2567,
33,
7036,
16,
1466,
67,
3700,
33,
55... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4422,
16,
4555,
16,
612,
16,
1014,
16,
1247,
16,
819,
33,
7036,
16,
666,
67,
1106,
33,
7036,
16,
1466,
67,
2567,
33,
7036,
16,
1466,
67,
3700,
33,
55... |
self._dirty = False self._client.do_PUT(self._uri, self._root) | self._dirty_flag = False if self._isChild: self._parent.persist() else: self._client.do_PUT(self._uri, self._root) | def persist(self): """ Update the server with any modifications that have been made to this instance. """ | 3313d042df4985bef89ce45cecf597816a15faa9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7637/3313d042df4985bef89ce45cecf597816a15faa9/proxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
12,
2890,
4672,
3536,
2315,
326,
1438,
598,
1281,
17953,
716,
1240,
2118,
7165,
358,
333,
791,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3898,
12,
2890,
4672,
3536,
2315,
326,
1438,
598,
1281,
17953,
716,
1240,
2118,
7165,
358,
333,
791,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
traceback.print_exc() | def _AddControl(self, parent, # who the control is added to control_type, # type of control to add. events_class, events_init_args, # class/Init() args **item_attrs): # extra control attributes. # Outlook Toolbars suck :) # We have tried a number of options: temp/perm in the standard toolbar, # Always creating our own toolbar, etc. # This seems to be fairly common: # http://groups.google.com/groups?threadm=eKKmbvQvAHA.1808%40tkmsftngp02 # Now the strategy is just to use our own, permanent toolbar, with # permanent items, and ignore uninstall issues. # We search all commandbars for a control with our Tag. If found, we # use it (the user may have customized the bar and moved our buttons # elsewhere). If we can not find the child control, we then try and # locate our toolbar, creating if necessary. Our items get added to # that. assert item_attrs.has_key('Tag'), "Need a 'Tag' attribute!" image_fname = None if 'image' in item_attrs: image_fname = item_attrs['image'] del item_attrs['image'] | 6edebeaac5e29f87c52dd91e4af1f53c2291351d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/6edebeaac5e29f87c52dd91e4af1f53c2291351d/addin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
986,
3367,
12,
2890,
16,
982,
16,
468,
10354,
326,
3325,
353,
3096,
358,
3325,
67,
723,
16,
468,
618,
434,
3325,
358,
527,
18,
2641,
67,
1106,
16,
2641,
67,
2738,
67,
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,
389,
986,
3367,
12,
2890,
16,
982,
16,
468,
10354,
326,
3325,
353,
3096,
358,
3325,
67,
723,
16,
468,
618,
434,
3325,
358,
527,
18,
2641,
67,
1106,
16,
2641,
67,
2738,
67,
1968,
16,
... | |
cline = cline + " -USETREE=%s" % self.guide_tree | cline += " -USETREE=%s" % self.guide_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,
... |
for k, v in [('Detect Language', 'auto'), ('Gaelic', 'el'), ('Chinese (Traditional)', 'zh-TW'), ('Chinese (Simplified)', 'zh-CN')]: | for k, v in [('Detect Language', 'auto'), ('Gaelic', 'ga'), ('Chinese (Traditional)', 'zh-TW'), ('Chinese (Simplified)', 'zh-CN')]: | def update_languages(self): '''Naively try to determine if new languages are available by scraping http://translate.google.com''' restr = '<meta name="description" content="Google's free online language translation service instantly translates text and web pages. This translator supports: (.*?)">' resp = urllib2.urlopen(urllib2.Request('http://translate.google.com', None, {'User-Agent':'Traduisons/%s' % msg_VERSION})).read() m = re.search(restr, resp) d = {} if m: names = m.group(1).split(', ') for name in names: n = re.search('<option value="([^"]+)">%s[^<]*</option>' % name, resp) if n: d[name] = n.group(1) else: return False for k, v in [('Detect Language', 'auto'), ('Gaelic', 'el'), ('Chinese (Traditional)', 'zh-TW'), ('Chinese (Simplified)', 'zh-CN')]: d[k] = v for k in self.dictLang: if not d.has_key(k): print k, ': Unavailable' self.dictLang = d else: print 'Unable to update_languages' return False | c89de8f9412403279eccf3e90850d8ffdde19a59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/c89de8f9412403279eccf3e90850d8ffdde19a59/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
14045,
12,
2890,
4672,
9163,
24101,
4492,
775,
358,
4199,
309,
394,
8191,
854,
2319,
635,
888,
1266,
310,
1062,
2207,
13929,
18,
9536,
18,
832,
26418,
400,
313,
273,
2368,
3901... |
assert(_add_new_format(bibdoc, url, format, docname, description, doctype, newname, description, comment)) | assert(_add_new_format(bibdoc, url, format, docname, doctype, newname, description, comment)) | def _add_new_icon(bibdoc, url, restriction): """Adds a new icon to an existing bibdoc, replacing the previous one if it exists. If url is empty, just remove the current icon.""" if not url: bibdoc.delete_icon() else: try: path = urllib2.urlparse.urlsplit(url)[2] filename = os.path.split(path)[-1] format = filename[len(file_strip_ext(filename)):] tmpurl = download_url(url, format) try: try: icondoc = bibdoc.add_icon(tmpurl, 'icon-%s' % bibdoc.get_docname()) if restriction and restriction != KEEP_OLD_VALUE: icondoc.set_status(restriction) except StandardError, e: write_message("('%s', '%s') icon not added because '%s'." % (url, format, e), stream=sys.stderr) raise finally: os.remove(tmpurl) except Exception, e: write_message("Error in downloading '%s' because of: %s" % (url, e), stream=sys.stderr) raise return True | e607c54401456326aaaf12557dce27ff83f31b60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/e607c54401456326aaaf12557dce27ff83f31b60/bibupload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
2704,
67,
3950,
12,
70,
495,
2434,
16,
880,
16,
9318,
4672,
3536,
3655,
279,
394,
4126,
358,
392,
2062,
25581,
2434,
16,
13993,
326,
2416,
1245,
309,
518,
1704,
18,
971,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
67,
2704,
67,
3950,
12,
70,
495,
2434,
16,
880,
16,
9318,
4672,
3536,
3655,
279,
394,
4126,
358,
392,
2062,
25581,
2434,
16,
13993,
326,
2416,
1245,
309,
518,
1704,
18,
971,... |
update_timeout = setTimeout('check_for_cell_update()', cell_output_delta); | var time_left = getTime() - update_time - cell_output_delta; if(time_left > 0) { update_timeout = setTimeout('check_for_cell_update()', time_left); } else { check_for_cell_update(); } | def javascript(): s = r""" | da2842effe3912283a0cf2046f64d4c6d1af156b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/da2842effe3912283a0cf2046f64d4c6d1af156b/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
436,
8395,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
436,
8395,
282,
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,
-... |
ifp = open(inp, 'rb') | ifp = io.open(inp, 'rb') | def binhex(inp, out): """(infilename, outfilename) - Create binhex-encoded copy of a file""" finfo = getfileinfo(inp) ofp = BinHex(finfo, out) ifp = open(inp, 'rb') # XXXX Do textfile translation on non-mac systems while 1: d = ifp.read(128000) if not d: break ofp.write(d) ofp.close_data() ifp.close() ifp = openrsrc(inp, 'rb') while 1: d = ifp.read(128000) if not d: break ofp.write_rsrc(d) ofp.close() ifp.close() | d5e0c2c0b48e2296fdcfabfd393523441eae3797 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d5e0c2c0b48e2296fdcfabfd393523441eae3797/binhex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4158,
7118,
12,
31647,
16,
596,
4672,
3536,
12,
267,
3459,
16,
596,
3459,
13,
300,
1788,
4158,
7118,
17,
10787,
1610,
434,
279,
585,
8395,
15190,
273,
336,
768,
1376,
12,
31647,
13,
43... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4158,
7118,
12,
31647,
16,
596,
4672,
3536,
12,
267,
3459,
16,
596,
3459,
13,
300,
1788,
4158,
7118,
17,
10787,
1610,
434,
279,
585,
8395,
15190,
273,
336,
768,
1376,
12,
31647,
13,
43... |
self.check_random() | self.update_playing_mode_if_necessary() | def play(self): self.__should_stop = False self.is_new = False while self.current_music != None: self.check_random() self.current_music.play(self.play_callback) self.is_playing = True self.__listener.update_music(self.current_music) | 43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd/aspyplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
4672,
365,
16186,
13139,
67,
5681,
273,
1083,
365,
18,
291,
67,
2704,
273,
1083,
225,
1323,
365,
18,
2972,
67,
81,
14894,
480,
599,
30,
365,
18,
2725,
67,
1601,
310,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
4672,
365,
16186,
13139,
67,
5681,
273,
1083,
365,
18,
291,
67,
2704,
273,
1083,
225,
1323,
365,
18,
2972,
67,
81,
14894,
480,
599,
30,
365,
18,
2725,
67,
1601,
310,
... |
if size < 0: size = sys.maxint readsize = self.min_readsize else: readsize = size bufs = "" | if size < 0: size = sys.maxint bufs = [] readsize = min(100, size) | def readline(self, size=-1): if size < 0: size = sys.maxint # Line can be as long as maxint readsize = self.min_readsize # Read from file in small chunks else: readsize = size # Only read in as much as specified | 94857c88febb30ed9845f0b48036d4df50580a91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/94857c88febb30ed9845f0b48036d4df50580a91/gzip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
309,
963,
411,
374,
30,
963,
273,
2589,
18,
1896,
474,
2868,
468,
5377,
848,
506,
487,
1525,
487,
943,
474,
855,
1467,
273,
365,
18,
1154,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12023,
12,
2890,
16,
963,
29711,
21,
4672,
309,
963,
411,
374,
30,
963,
273,
2589,
18,
1896,
474,
2868,
468,
5377,
848,
506,
487,
1525,
487,
943,
474,
855,
1467,
273,
365,
18,
1154,
... |
code[skip] = len(code) - skip | code[skip] = _len(code) - skip | def fixup(literal, flags=flags): return _sre.getlower(literal, flags) | 01c9f8c35f583338e3638906ceeef9d2f29a0254 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/01c9f8c35f583338e3638906ceeef9d2f29a0254/sre_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
12,
13107,
16,
2943,
33,
7133,
4672,
327,
389,
87,
266,
18,
588,
8167,
12,
13107,
16,
2943,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
Jabberd2 uses jabber:client.""" | Jabberd2 uses jabber:client. 'server' argument is a server name that you are connecting to (f.e. "localhost"). 'port' can be specified if 'server' resolves to correct IP. If it is not then you'll need to specify IP and port while calling "connect()".""" | def __init__(self,server,port=5347,typ=None,debug=['always', 'nodebuilder']): """ Init function for Components. As components use a different auth mechanism which includes the namespace of the component. Jabberd1.4 and Ejabberd use the default namespace then for all client messages. Jabberd2 uses jabber:client.""" CommonClient.__init__(self,server,port=port,debug=debug) self.typ=typ | ed133f2254c443a98492a937de5f55688aa7eb2c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7194/ed133f2254c443a98492a937de5f55688aa7eb2c/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3567,
16,
655,
33,
25,
5026,
27,
16,
12846,
33,
7036,
16,
4148,
33,
3292,
17737,
2187,
296,
2159,
9574,
3546,
4672,
3536,
4378,
445,
364,
25286,
18,
2970... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3567,
16,
655,
33,
25,
5026,
27,
16,
12846,
33,
7036,
16,
4148,
33,
3292,
17737,
2187,
296,
2159,
9574,
3546,
4672,
3536,
4378,
445,
364,
25286,
18,
2970... |
conf.l2types.register(801, Dot11) conf.l2types.register_num2layer(105, Dot11) conf.l2types.register(802, PrismHeader) conf.l2types.register(803, RadioTap) conf.l2types.register_num2layer(127, RadioTap) | conf.l2types.register(105, Dot11) conf.l2types.register_num2layer(801, Dot11) conf.l2types.register(119, PrismHeader) conf.l2types.register_num2layer(802, PrismHeader) conf.l2types.register(127, RadioTap) conf.l2types.register_num2layer(803, RadioTap) | def decrypt(self,key=None): if key is None: key = conf.wepkey if key: c = ARC4.new(self.iv+key) self.add_payload(LLC(c.decrypt(self.wepdata))) | 4bba4d4aeb1fc07990081ee28795519baf81525b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7311/4bba4d4aeb1fc07990081ee28795519baf81525b/dot11.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8420,
12,
2890,
16,
856,
33,
7036,
4672,
309,
498,
353,
599,
30,
498,
273,
2195,
18,
91,
881,
856,
309,
498,
30,
276,
273,
6052,
39,
24,
18,
2704,
12,
2890,
18,
427,
15,
856,
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,
8420,
12,
2890,
16,
856,
33,
7036,
4672,
309,
498,
353,
599,
30,
498,
273,
2195,
18,
91,
881,
856,
309,
498,
30,
276,
273,
6052,
39,
24,
18,
2704,
12,
2890,
18,
427,
15,
856,
13,
... |
if text is not None: | if text not in (None, Undefined): | def evaluateText(self, expr): text = self.evaluate(expr) if text is not None: text = str(text) return text | 911344420e6c6ca003c882eec4727ecb9f47e0b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/911344420e6c6ca003c882eec4727ecb9f47e0b8/TALES.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5956,
1528,
12,
2890,
16,
3065,
4672,
977,
273,
365,
18,
21024,
12,
8638,
13,
309,
977,
486,
316,
261,
7036,
16,
22243,
4672,
977,
273,
609,
12,
955,
13,
327,
977,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5956,
1528,
12,
2890,
16,
3065,
4672,
977,
273,
365,
18,
21024,
12,
8638,
13,
309,
977,
486,
316,
261,
7036,
16,
22243,
4672,
977,
273,
609,
12,
955,
13,
327,
977,
2,
-100,
-100,
-10... |
return machine, full_path, general_dir, uid | return host, full_path, general_dir, uid | def get_LVAdata_from_file(file): """ this function takes the name of an xml file containing a single LVAlertTable and it returns: host: the machine the payload file was created on full_path: the full path to (and including) the payload file general_dir: the directory in gracedb that the output of your code should be written to uid: the gracedb unique id associated with the event in the LVAlertTable """ doc = utils.load_filename(opts.online_input) lvatable = table.get_table(doc, LVAlertTable.tableName) lvatable = table.get_table(doc, LVAlertTable.tableName) host, full_path, general_dir = _parse_file_url(lvatable[0].file) uid = lvatable[0].uid return machine, full_path, general_dir, uid | 6b2841cd86572f5911f105d280b5b65d19859e93 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/6b2841cd86572f5911f105d280b5b65d19859e93/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
48,
27722,
892,
67,
2080,
67,
768,
12,
768,
4672,
3536,
333,
445,
5530,
326,
508,
434,
392,
2025,
585,
4191,
279,
2202,
29268,
13298,
1388,
471,
518,
1135,
30,
1479,
30,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
48,
27722,
892,
67,
2080,
67,
768,
12,
768,
4672,
3536,
333,
445,
5530,
326,
508,
434,
392,
2025,
585,
4191,
279,
2202,
29268,
13298,
1388,
471,
518,
1135,
30,
1479,
30,
326,
... |
False) will be considered for clustering. When used this way, testfunc must return a numeric result indicating the sort order of the two candidates it has been passed: >0 if the first is "greater" than the second, <0 if the first is "less" than the second, and 0 if the order does not matter (like a subtraction operator). | False) will be considered for clustering. | def ClusterSnglBurstTable(sngl_burst_table, testfunc, clusterfunc, bailoutfunc = None): """ Cluster the candidates in the sngl_burst table. testfunc will be passed a pair in random order, and must return 0 (or False) if they should be clustered. clusterfunc will be passed a pair of candidates in random order, and must modify the contents of the first so as to be a "cluster" of the two. If bailoutfunc is not None, the candidates will be sorted into "increasing" order using testfunc as a comparison operator, and then only pairs of candidates for which bailoutfunc returns 0 (or False) will be considered for clustering. When used this way, testfunc must return a numeric result indicating the sort order of the two candidates it has been passed: >0 if the first is "greater" than the second, <0 if the first is "less" than the second, and 0 if the order does not matter (like a subtraction operator). The return value is True if the sngl_burst table was modified, and False if it was not. """ table_changed = False outer_did_cluster = True while outer_did_cluster: outer_did_cluster = False if bailoutfunc is not None: sngl_burst_table.sort(testfunc) i = 0 while i < len(sngl_burst_table): a = sngl_burst_table[i] j = i + 1 inner_did_cluster = False while j < len(sngl_burst_table): b = sngl_burst_table[j] if not testfunc(a, b): clusterfunc(a, sngl_burst_table.pop(j)) table_changed = outer_did_cluster = inner_did_cluster = True elif bailoutfunc is not None and bailoutfunc(a, b): break else: j += 1 if not inner_did_cluster: i += 1 return table_changed | 78bc9afbf1c89d333828b2a9b94e9f3a3b63de57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/78bc9afbf1c89d333828b2a9b94e9f3a3b63de57/ligolw_bucluster.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5584,
55,
3368,
80,
38,
18593,
1388,
12,
87,
3368,
80,
67,
70,
18593,
67,
2121,
16,
1842,
644,
16,
2855,
644,
16,
18422,
659,
644,
273,
599,
4672,
3536,
5584,
326,
7965,
316,
326,
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,
5584,
55,
3368,
80,
38,
18593,
1388,
12,
87,
3368,
80,
67,
70,
18593,
67,
2121,
16,
1842,
644,
16,
2855,
644,
16,
18422,
659,
644,
273,
599,
4672,
3536,
5584,
326,
7965,
316,
326,
27... |
if pattern[0] != '.': disk_names = filter(lambda x: x[0] != '.', disk_names) disk_names = fnmatch.filter(disk_names, pattern) if strings: names.extend(disk_names) else: | names.extend(disk_names) if not strings: if pattern[0] != '.': disk_names = filter(lambda x: x[0] != '.', disk_names) disk_names = fnmatch.filter(disk_names, pattern) | def _glob1(self, pattern, ondisk=True, source=False, strings=False): """ Globs for and returns a list of entry names matching a single pattern in this directory. | 2958b4895e2270f8e56503dbda89ab0dced75be0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12817/2958b4895e2270f8e56503dbda89ab0dced75be0/FS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10581,
21,
12,
2890,
16,
1936,
16,
603,
10863,
33,
5510,
16,
1084,
33,
8381,
16,
2064,
33,
8381,
4672,
3536,
18901,
87,
364,
471,
1135,
279,
666,
434,
1241,
1257,
3607,
279,
2202,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10581,
21,
12,
2890,
16,
1936,
16,
603,
10863,
33,
5510,
16,
1084,
33,
8381,
16,
2064,
33,
8381,
4672,
3536,
18901,
87,
364,
471,
1135,
279,
666,
434,
1241,
1257,
3607,
279,
2202,... |
(not compileTest or (compileTest and compileSuccessful))): | (compileTest or (not compileTest and compareSuccessful))): | def reportSingleTest(sourceTree, testName, testDir, fullWebDir): """ generate a single problem's test result page """ # get the current directory currentDir = os.getcwd() # switch to the web directory and open the report file os.chdir(fullWebDir) #-------------------------------------------------------------------------- # parse the compilation report and determine if we compiled #-------------------------------------------------------------------------- compileFile = "%s.make.out" % (testName) try: cf = open(compileFile, 'r') except IOError: print "WARNING: no compilation file found" compileSuccessful = 0 else: makeLines = cf.readlines() # successful compilation be indicated by SUCCESS or # Nothing to be done for `all'. Look for both compileSuccessful = 0 for line in makeLines: if (string.find(line, "SUCCESS") >= 0 or string.find(line, "Nothing to be done") >= 0): compileSuccessful = 1 break cf.close() #-------------------------------------------------------------------------- # parse the compare report and determine if we passed #-------------------------------------------------------------------------- compileTest = getParam(testName + ".compileTest") if (not compileTest): compareFile = "%s.compare.out" % (testName) try: cf = open(compareFile, 'r') except IOError: print "WARNING: no comparison file found" compareSuccessful = 0 diffLines = [''] else: diffLines = cf.readlines() # successful comparison is indicated by PLOTFILES AGREE compareSuccessful = 0 for line in diffLines: if (string.find(line, "PLOTFILES AGREE") >= 0): compareSuccessful = 1 break cf.close() #-------------------------------------------------------------------------- # write out the status file for this problem, with either # PASSED or FAILED #-------------------------------------------------------------------------- statusFile = "%s.status" % (testName) sf = open(statusFile, 'w') if (compileSuccessful and (not compileTest or (compileTest and compileSuccessful))): sf.write("PASSED\n") print " %s PASSED" % (testName) else: sf.write("FAILED\n") print " %s FAILED" % (testName) sf.close() #-------------------------------------------------------------------------- # generate the HTML page for this test #-------------------------------------------------------------------------- # check to see if the CSS file is present, if not, write it if (not os.path.isfile("tests.css")): create_css() htmlFile = "%s.html" % (testName) hf = open(htmlFile, 'w') newHead = HTMLHeader + r"""<CENTER><H1><A HREF="index.html">@TESTDIR@</A> / @TESTNAME@</H1></CENTER>""" newHead = newHead.replace("@TESTDIR@", testDir) newHead = newHead.replace("@TESTNAME@", testName) hf.write(newHead) if (not compileTest): useMPI = getParam("%s.useMPI" % (testName)) if (useMPI): numprocs = getParam("%s.numprocs" % (testName)) hf.write("<P><b>Parallel Run</b><br>numprocs = %d\n" % (numprocs) ) hf.write("<P> \n") # is this a restart test? restart = getParam("%s.restartTest" % (testName) ) if (restart): restartFileNum = getParam("%s.restartTest" % (testName) ) hf.write("<P><b>Restart Test</b><br>Job was run as normal and then restarted from checkpoint # %d, and the two final outputs were compared\n" % (restartFileNum) ) hf.write("<P> \n") # write out the information about the test buildDir = getParam("%s.buildDir" % (testName) ) hf.write("<P><b>build directory:</b> %s\n" % (buildDir) ) inputFile = getParam("%s.inputFile" % (testName) ) hf.write("<P><b>input file:</b> <A HREF=\"%s.%s\">%s</A>\n" % (testName, inputFile, inputFile) ) if (sourceTree == "Parallel"): probinFile = getParam("%s.probinFile" % (testName) ) hf.write("<P><b>probin file:</b> <A HREF=\"%s.%s\">%s</A>\n" % (testName, probinFile, probinFile) ) auxFiles = getAuxFiles(testName) i = 1 for file in auxFiles: hf.write("<P><b>aux%dFile:</b> <A HREF=\"%s.%s\">%s</A>\n" % (i, testName, file, file) ) i = i + 1 dim = getParam("%s.dim" % (testName) ) hf.write("<P><b>dimensionality:</b> %s\n" % (dim) ) hf.write("<P> \n") # write out the compilation report if (compileSuccessful): hf.write("<P><H3 CLASS=\"passed\">Compilation Successful</H3></P>\n") else: hf.write("<P><H3 CLASS=\"failed\">Compilation Failed</H3></P>\n") hf.write("<A HREF=\"%s.make.out\">make output</A>\n" % (testName) ) hf.write("<P> \n") if (not compileTest): # write out the comparison report if (compareSuccessful): hf.write("<P><H3 CLASS=\"passed\">Comparison Successful</H3></P>\n") else: hf.write("<P><H3 CLASS=\"failed\">Comparison Failed</H3></P>\n") hf.write("<A HREF=\"%s.run.out\">execution output</A>\n" % (testName) ) hf.write("<P> \n") hf.write("<PRE>\n") for line in diffLines: hf.write(line) hf.write("</PRE>\n") # show any visualizations doVis = getParam("%s.doVis" % (testName) ) if (doVis): pngFile = getRecentFileName(fullWebDir, testName, ".png") hf.write("<P> \n") hf.write("<P><IMG SRC='%s' BORDER=0>" % (pngFile) ) # close hf.write("</BODY>\n") hf.write("</HTML>\n") hf.close() # switch back to the original directory os.chdir(currentDir) | f5d3a017772a869f9b0e80f2134ee571d6ae2f5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5861/f5d3a017772a869f9b0e80f2134ee571d6ae2f5d/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
5281,
4709,
12,
3168,
2471,
16,
1842,
461,
16,
1842,
1621,
16,
1983,
4079,
1621,
4672,
3536,
2103,
279,
2202,
6199,
1807,
1842,
563,
1363,
3536,
225,
468,
336,
326,
783,
1867,
783,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2605,
5281,
4709,
12,
3168,
2471,
16,
1842,
461,
16,
1842,
1621,
16,
1983,
4079,
1621,
4672,
3536,
2103,
279,
2202,
6199,
1807,
1842,
563,
1363,
3536,
225,
468,
336,
326,
783,
1867,
783,... |
path = path + '/' + b | path += '/' + b | def join(a, *p): """Join two or more pathname components, inserting '/' as needed""" path = a for b in p: if b[:1] == '/': path = b elif path == '' or path[-1:] == '/': path = path + b else: path = path + '/' + b return path | c95a55943ea1c83ad71e85b7a460d2a68ebd2eee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/c95a55943ea1c83ad71e85b7a460d2a68ebd2eee/posixpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1233,
12,
69,
16,
380,
84,
4672,
3536,
4572,
2795,
578,
1898,
9806,
4085,
16,
21079,
2023,
487,
3577,
8395,
589,
273,
279,
364,
324,
316,
293,
30,
309,
324,
10531,
21,
65,
422,
2023,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1233,
12,
69,
16,
380,
84,
4672,
3536,
4572,
2795,
578,
1898,
9806,
4085,
16,
21079,
2023,
487,
3577,
8395,
589,
273,
279,
364,
324,
316,
293,
30,
309,
324,
10531,
21,
65,
422,
2023,
... |
'5.16.2' | '5.16.3' | def version(self): """ Return the version of Maxima that Sage includes. | eef9f724d2b7852ba890125498be057da43f7957 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/eef9f724d2b7852ba890125498be057da43f7957/maxima.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1177,
12,
2890,
4672,
3536,
2000,
326,
1177,
434,
4238,
13888,
716,
348,
410,
6104,
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,... | [
1,
1,
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,
1177,
12,
2890,
4672,
3536,
2000,
326,
1177,
434,
4238,
13888,
716,
348,
410,
6104,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.download_serverhtml() | def prepare(self, thread): pyfile = self.parent | 051d12f49389a2126bbcf86d5bde384c47a0814d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9838/051d12f49389a2126bbcf86d5bde384c47a0814d/RapidshareCom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2650,
4672,
2395,
768,
273,
365,
18,
2938,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2911,
12,
2890,
16,
2650,
4672,
2395,
768,
273,
365,
18,
2938,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
vname = var.name() | vname = var.uid().shortname() | def _var_summary(self, variables, sortorder, container, heading='Variable Summary'): """ @return: The HTML code for a variable summary table. This is used by L{_module_to_html} to list the variables in a module; and by L{_class_to_html} to list instance variables and class variables. @rtype: C{string} """ variables = self._sort(variables, sortorder) if len(variables) == 0: return '' str = self._table_header(heading, 'summary') | 7e1af2abc702612461ceeb001b4b551d49cb71d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7e1af2abc702612461ceeb001b4b551d49cb71d3/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1401,
67,
7687,
12,
2890,
16,
3152,
16,
1524,
1019,
16,
1478,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
4916,
1014,
18,
225,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1401,
67,
7687,
12,
2890,
16,
3152,
16,
1524,
1019,
16,
1478,
16,
11053,
2218,
3092,
17967,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
4916,
1014,
18,
225,
12... |
properties.append({'name': 'owner', 'type': 'text', 'label': 'Owner'}) | restrict_owner = self.config.get('ticket', 'restrict_owner', '') if restrict_owner.lower() in TRUE: usernames = [escape(u[0]) for u in self.env.get_known_users()] properties.append({'name': 'owner', 'type': 'select', 'label': 'Owner', 'options': usernames}) else: properties.append({'name': 'owner', 'type': 'text', 'label': 'Owner'}) | def rows_to_list(sql): list = [] cursor.execute(sql) while 1: row = cursor.fetchone() if not row: break list.append(row[0]) return list | f88a4554c21b29c3e879cca8e0e344427daed094 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/f88a4554c21b29c3e879cca8e0e344427daed094/Query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2595,
67,
869,
67,
1098,
12,
4669,
4672,
666,
273,
5378,
3347,
18,
8837,
12,
4669,
13,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
309,
486,
1027,
30,
898,
666,
18,
6923,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2595,
67,
869,
67,
1098,
12,
4669,
4672,
666,
273,
5378,
3347,
18,
8837,
12,
4669,
13,
1323,
404,
30,
1027,
273,
3347,
18,
5754,
476,
1435,
309,
486,
1027,
30,
898,
666,
18,
6923,
12... |
try: num = int(name)-1 except ValueError: v = variables.get(name, None) else: v = variables.get(num, None) | v = variables.get(name, None) | def args(): if remainder is not None: tmpnode=Node() tmpnode.children.append(remainder) yield tmpnode for x in n.children[1:]: yield x | f5e1c7af9b2a4537dd5faad537987c049b74c615 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12391/f5e1c7af9b2a4537dd5faad537987c049b74c615/expander.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
833,
13332,
309,
10022,
353,
486,
599,
30,
1853,
2159,
33,
907,
1435,
1853,
2159,
18,
5906,
18,
6923,
12,
2764,
25407,
13,
2824,
1853,
2159,
364,
619,
316,
290,
18,
5906,
63,
21,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
833,
13332,
309,
10022,
353,
486,
599,
30,
1853,
2159,
33,
907,
1435,
1853,
2159,
18,
5906,
18,
6923,
12,
2764,
25407,
13,
2824,
1853,
2159,
364,
619,
316,
290,
18,
5906,
63,
21,
30,
... |
def get_playlist(self): | def set_playlist(self): | def get_playlist(self): file_list = [] for root, dirs, files in os.walk(self.media_dir): for file in files: s = file.split('.') ext = s[len(s)-1] if ext.lower() == self.channel.format and not '/.' in file: file_list.append(root + os.sep + file) return file_list | e5ceb2dd324130917f21293db926c014038e4702 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12047/e5ceb2dd324130917f21293db926c014038e4702/deefuzz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1601,
1098,
12,
2890,
4672,
585,
67,
1098,
273,
5378,
364,
1365,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
2890,
18,
5829,
67,
1214,
4672,
364,
585,
316,
1390,
30,
272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
1601,
1098,
12,
2890,
4672,
585,
67,
1098,
273,
5378,
364,
1365,
16,
7717,
16,
1390,
316,
1140,
18,
11348,
12,
2890,
18,
5829,
67,
1214,
4672,
364,
585,
316,
1390,
30,
272,
... |
users.append({'title': 'Student', | users.append({'title': user_title, | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 34dc0e8c1da81ec9656e2801368e28d454bb4bc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/34dc0e8c1da81ec9656e2801368e28d454bb4bc8/nametagmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1215,
270,
278,
1341,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
3536,
2103,
15135,
278,
1341,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1215,
270,
278,
1341,
12,
2890,
16,
590,
16,
8332,
16,
1245,
16,
2795,
16,
1605,
16,
2870,
16,
11243,
4672,
3536,
2103,
15135,
278,
1341,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
@listener("connect") def onCONNECT(self, host, port): | def connected(self, host, port): | def onTIMERRECONNECT(self): self.connect() | ee04d1310030de66ce7c342469f94a6c8ff128f0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3020/ee04d1310030de66ce7c342469f94a6c8ff128f0/bot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
56,
31582,
862,
11032,
12,
2890,
4672,
365,
18,
3612,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
56,
31582,
862,
11032,
12,
2890,
4672,
365,
18,
3612,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'code':fields.char('Code', size=64, required=False, readonly=False), | 'code':fields.char('Code', size=64, required=False, readonly=False), | def onchange_amount(self, cr, uid, ids, amount, typ): amt = amount if typ and typ == 'per': if int(amt) > 0: amt = amt / 100 return {'value':{'amount':amt}} | 90e8a2a9ac966d2bf970850306e713ecc1398f14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e8a2a9ac966d2bf970850306e713ecc1398f14/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
8949,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
3844,
16,
3815,
4672,
25123,
273,
3844,
309,
3815,
471,
3815,
422,
296,
457,
4278,
309,
509,
12,
301,
88,
13,
405,
37... |
"""[1:].format(start,end,chapter,"eng") | """[1:].format(start,end,chaptername,"eng") | def generateChap(start, end, chapter, type): """Generates chapters""" # Matroska if type == 'MKV': return """ <ChapterAtom> <ChapterTimeStart>{}</ChapterTimeStart> <ChapterTimeEnd>{}</ChapterTimeEnd> <ChapterDisplay> <ChapterString>Chapter {:02d}</ChapterString> <ChapterLanguage>{}</ChapterLanguage> </ChapterDisplay> </ChapterAtom> | 783e706a8cc971cea83a2a5c030b5bfe68c6a872 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14863/783e706a8cc971cea83a2a5c030b5bfe68c6a872/vfr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
782,
438,
12,
1937,
16,
679,
16,
23580,
16,
618,
4672,
3536,
6653,
462,
1657,
414,
8395,
468,
14493,
6973,
7282,
309,
618,
422,
296,
49,
16945,
4278,
327,
3536,
411,
782,
2487,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
782,
438,
12,
1937,
16,
679,
16,
23580,
16,
618,
4672,
3536,
6653,
462,
1657,
414,
8395,
468,
14493,
6973,
7282,
309,
618,
422,
296,
49,
16945,
4278,
327,
3536,
411,
782,
2487,
3... |
raise exceptions.BadArgumentError(logging.SYSU_SPECIFY_LGN_FST_LST) | raise exceptions.BadArgumentError( logging.SYSU_SPECIFY_LGN_FST_LST) | def AddUser(self, lastname = None, firstname = None, password = None, primary_group=None, profile=None, skel=None, login=None, gecos=None, system = False, batch=False): """Add a user and return his/her (uid, login, pass).""" | 2d1ecedf1a4d5090557df25efcb2a065c17595e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/2d1ecedf1a4d5090557df25efcb2a065c17595e0/users.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1299,
12,
2890,
16,
1142,
529,
273,
599,
16,
1122,
529,
273,
599,
16,
2201,
273,
599,
16,
3354,
67,
1655,
33,
7036,
16,
3042,
33,
7036,
16,
4343,
292,
33,
7036,
16,
3925,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1299,
12,
2890,
16,
1142,
529,
273,
599,
16,
1122,
529,
273,
599,
16,
2201,
273,
599,
16,
3354,
67,
1655,
33,
7036,
16,
3042,
33,
7036,
16,
4343,
292,
33,
7036,
16,
3925,
33,
... |
self.assertEqual(ind.info('info1'), 4) | if alleleType() == 'binary': self.assertEqual(ind.info('info1'), 2) else: self.assertEqual(ind.info('info1'), 4) | def testFunc3(ind): self.assertEqual(ind.info('info1'), 4) return True | 6d4a5bc21e3547aaef826001bc704711002ccbc7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/401/6d4a5bc21e3547aaef826001bc704711002ccbc7/test_09_pyOperator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2622,
23,
12,
728,
4672,
309,
14551,
559,
1435,
422,
296,
8578,
4278,
365,
18,
11231,
5812,
12,
728,
18,
1376,
2668,
1376,
21,
19899,
576,
13,
469,
30,
365,
18,
11231,
5812,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2622,
23,
12,
728,
4672,
309,
14551,
559,
1435,
422,
296,
8578,
4278,
365,
18,
11231,
5812,
12,
728,
18,
1376,
2668,
1376,
21,
19899,
576,
13,
469,
30,
365,
18,
11231,
5812,
12,
... |
@type graph: graph @param graph: Graph. | def shortest_path(self, source): """ Return the shortest path distance between source node and all other nodes using Dijkstra's algorithm. @attention: All weights must be nonnegative. | a947e9ed8c01be0315d65804057ded2696656ddf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4687/a947e9ed8c01be0315d65804057ded2696656ddf/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20579,
67,
803,
12,
2890,
16,
1084,
4672,
3536,
2000,
326,
20579,
589,
3888,
3086,
1084,
756,
471,
777,
1308,
2199,
1450,
463,
8302,
79,
701,
69,
1807,
4886,
18,
225,
632,
17899,
30,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20579,
67,
803,
12,
2890,
16,
1084,
4672,
3536,
2000,
326,
20579,
589,
3888,
3086,
1084,
756,
471,
777,
1308,
2199,
1450,
463,
8302,
79,
701,
69,
1807,
4886,
18,
225,
632,
17899,
30,
4... | |
msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...' | msg_txt += self.truncate_data(cr, uid, message.description, context=context) | def _get_display_text(self, cr, uid, ids, name, arg, context=None): if context is None: context = {} tz = context.get('tz') result = {} for message in self.browse(cr, uid, ids, context=context): msg_txt = '' if message.history: msg_txt += (message.email_from or '/') + _(' wrote on ') + format_date_tz(message.date, tz) + ':\n\t' if message.description: msg_txt += '\n\t'.join(message.description.split('\n')[:3]) + '...' else: msg_txt = (message.user_id.name or '/') + _(' on ') + format_date_tz(message.date, tz) + ':\n\t' if message.name == _('Opportunity'): msg_txt += _("Converted to Opportunity") else: msg_txt += _("Changed Status to: ") + message.name result[message.id] = msg_txt return result | 81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/81cd29fff9dda5ffb03b3e931be2d853b7f2d8bb/mail_gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
5417,
67,
955,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
6016,
273,
819,
18,
588,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5417,
67,
955,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
819,
353,
599,
30,
819,
273,
2618,
6016,
273,
819,
18,
588,
26... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.