rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
offset = pa - bank.startaddr print "%06o -> (%2s,%04o)" % (pa, bank.name, offset) return (bank.banknum, offset) | if bank: offset = pa - bank.startaddr return (bank.banknum, offset) else: return (None, 0) | def convertPAToBank(self, pa): print "%06o" % pa bank = self.findBank(pa) offset = pa - bank.startaddr print "%06o -> (%2s,%04o)" % (pa, bank.name, offset) return (bank.banknum, offset) | 136b6e89f0a20b9a457e69e75f36a5cd6f6e32a3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/136b6e89f0a20b9a457e69e75f36a5cd6f6e32a3/agcasm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
4066,
774,
16040,
12,
2890,
16,
6790,
4672,
1172,
2213,
7677,
83,
6,
738,
6790,
11218,
273,
365,
18,
4720,
16040,
12,
8774,
13,
309,
11218,
30,
1384,
273,
6790,
300,
11218,
18,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
4066,
774,
16040,
12,
2890,
16,
6790,
4672,
1172,
2213,
7677,
83,
6,
738,
6790,
11218,
273,
365,
18,
4720,
16040,
12,
8774,
13,
309,
11218,
30,
1384,
273,
6790,
300,
11218,
18,
1... |
def _find_first_match_( self, keys, item ): is_match = lambda k: self.match( item, k ) | def _find_first_match_(self, keys, item): is_match = lambda k: self.match(item, k) | def _find_first_match_( self, keys, item ): is_match = lambda k: self.match( item, k ) # use of ifilter here would be more efficent matches = filter( is_match, keys ) if matches: return matches[0] raise KeyError( item ) | c68039a3f4004e3fe46621e4c6512fd2401398fc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/c68039a3f4004e3fe46621e4c6512fd2401398fc/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
3645,
67,
1916,
67,
12,
2890,
16,
1311,
16,
761,
4672,
353,
67,
1916,
273,
3195,
417,
30,
365,
18,
1916,
12,
1726,
16,
417,
13,
468,
999,
434,
309,
1088,
2674,
4102,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4720,
67,
3645,
67,
1916,
67,
12,
2890,
16,
1311,
16,
761,
4672,
353,
67,
1916,
273,
3195,
417,
30,
365,
18,
1916,
12,
1726,
16,
417,
13,
468,
999,
434,
309,
1088,
2674,
4102,
... |
def getConsoleLineLength(): return max(consoleScreenBufferInfo.dwSize.x,80) | def getConsoleLineLength(): return max(consoleScreenBufferInfo.dwSize.x,80) | 0364a6ca21009645b3268773b1bdcc15d83753f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9340/0364a6ca21009645b3268773b1bdcc15d83753f6/winConsoleHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
10215,
1670,
1782,
13332,
327,
943,
12,
8698,
7956,
1892,
966,
18,
22512,
1225,
18,
92,
16,
3672,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
10215,
1670,
1782,
13332,
327,
943,
12,
8698,
7956,
1892,
966,
18,
22512,
1225,
18,
92,
16,
3672,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
typelist = list(DropTypeList) | def restoreItem(self, item): if item is None: return wasnocalc = self.nocalc self.nocalc = 1 itemtype = item.ActiveState if itemtype == 'player': self.PlayerMade.setChecked(1) self.showPlayerWidgets(item) typelist = list(TypeList) else: self.Drop.setChecked(1) self.showDropWidgets(item) typelist = list(DropTypeList) self.ItemLevel.setText(item.Level) location = item.Location self.Equipped.setChecked(int(item.Equipped)) for slot in range(0, item.slotCount()): typecombo = self.Type[slot] typecombo.clear() if itemtype == 'player' and \ not item.slot(slot).slotType() == 'player': typelist = list(CraftedTypeList) gemtype = str(item.slot(slot).type()) if not gemtype in typelist: typelist.append(gemtype) typecombo.insertItems(0, list(typelist)) typecombo.setCurrentIndex(typelist.index(gemtype)) self.TypeChanged(typelist.index(gemtype), slot) gemeffect = str(item.slot(slot).effect()) effect = self.Effect[slot].findText(gemeffect) if len(gemeffect) and effect < 0: if itemtype == 'player': self.Effect[slot].addItem(gemeffect) self.Effect[slot].setCurrentIndex(self.Effect[slot].count() - 1) self.EffectChanged(effect, slot) else: if not self.Effect[slot].isEditable(): self.Effect[slot].setEditable(True) self.Effect[slot].setEditText(gemeffect) else: self.Effect[slot].setCurrentIndex(effect) self.EffectChanged(effect, slot) if itemtype == 'drop': self.AmountEdit[slot].setText(item.slot(slot).amount()) else: gemamount = item.slot(slot).amount() amount = self.AmountDrop[slot].findText(gemamount) if len(gemamount) and gemamount != "0" and amount < 0: self.AmountDrop[slot].addItem(gemamount) self.AmountDrop[slot].setCurrentIndex(self.AmountDrop[slot].count() - 1) else: self.AmountDrop[slot].setCurrentIndex(amount) if itemtype == 'player' and item.slot(slot).slotType() == 'player': quacombo = self.Quality[slot] gemqua = item.slot(slot).qua() if gemqua in QualityValues: if quacombo.count() > 0: quacombo.setCurrentIndex(QualityValues.index(gemqua)) else: self.Requirement[slot].setText(item.slot(slot).requirement()) self.AFDPS_Edit.setText(item.AFDPS) self.Speed_Edit.setText(item.Speed) self.Bonus_Edit.setText(item.Bonus) if itemtype == 'drop': self.QualEdit.setText(item.ItemQuality) self.ItemName.setText(item.ItemName) else: if item.ItemQuality in QualityValues: self.QualDrop.setCurrentIndex( QualityValues.index(item.ItemQuality)) self.nocalc = wasnocalc if self.nocalc: return self.calculate() | 77f2999b99baed9bbe3aa43e1cfd8d4e448f34ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/77f2999b99baed9bbe3aa43e1cfd8d4e448f34ce/ScWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5217,
1180,
12,
2890,
16,
761,
4672,
309,
761,
353,
599,
30,
327,
14487,
23735,
71,
273,
365,
18,
82,
23735,
71,
365,
18,
82,
23735,
71,
273,
404,
761,
723,
273,
761,
18,
3896,
1119,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5217,
1180,
12,
2890,
16,
761,
4672,
309,
761,
353,
599,
30,
327,
14487,
23735,
71,
273,
365,
18,
82,
23735,
71,
365,
18,
82,
23735,
71,
273,
404,
761,
723,
273,
761,
18,
3896,
1119,... | |
return QtCore.QSize(metrics.width(self.text())+10, | width = min(metrics.width(self.text())+10,70) return QtCore.QSize(width, | def sizeHint(self): metrics = QtGui.QFontMetrics(self.font()) return QtCore.QSize(metrics.width(self.text())+10, metrics.height()+6) | 9dce3e150565757bcb7ffa2daf2858d3fc68530e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6341/9dce3e150565757bcb7ffa2daf2858d3fc68530e/constant_configuration.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
7002,
12,
2890,
4672,
4309,
273,
23425,
18,
53,
5711,
5653,
12,
2890,
18,
5776,
10756,
1835,
273,
1131,
12,
9597,
18,
2819,
12,
2890,
18,
955,
10756,
15,
2163,
16,
7301,
13,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
963,
7002,
12,
2890,
4672,
4309,
273,
23425,
18,
53,
5711,
5653,
12,
2890,
18,
5776,
10756,
1835,
273,
1131,
12,
9597,
18,
2819,
12,
2890,
18,
955,
10756,
15,
2163,
16,
7301,
13,
327,
... |
''' % (root, get_local_site_pkgs(root=''), dpath)) | ''' % (rsfroot, get_local_site_pkgs(root=''), dpath)) | def mk_csh_script(script_nm): 'Write the (t)csh environments setup script' global dpath csh = open(script_nm, 'w') csh.write('''#!/bin/csh | 6f411a9c2ac1ce299e662eba6482fb564978eb19 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3143/6f411a9c2ac1ce299e662eba6482fb564978eb19/setenv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
71,
674,
67,
4263,
12,
4263,
67,
15094,
4672,
296,
3067,
326,
261,
88,
13,
71,
674,
15900,
3875,
2728,
11,
2552,
302,
803,
225,
276,
674,
273,
1696,
12,
4263,
67,
15094,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
67,
71,
674,
67,
4263,
12,
4263,
67,
15094,
4672,
296,
3067,
326,
261,
88,
13,
71,
674,
15900,
3875,
2728,
11,
2552,
302,
803,
225,
276,
674,
273,
1696,
12,
4263,
67,
15094,
16... |
raise ValueError, "name is too long (>%d)" \ % (LENGTH_NAME) | raise ValueError("name is too long (>%d)" % (LENGTH_NAME)) | def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. """ self._check("aw") | 9d576e732e0c14bd37ecb65d8001d6f596cc8566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9d576e732e0c14bd37ecb65d8001d6f596cc8566/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
768,
12,
2890,
16,
8232,
1376,
16,
17041,
33,
7036,
4672,
3536,
986,
326,
20334,
966,
733,
1375,
11718,
1376,
11,
358,
326,
5052,
18,
971,
1375,
768,
2603,
11,
353,
864,
16,
8232,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
768,
12,
2890,
16,
8232,
1376,
16,
17041,
33,
7036,
4672,
3536,
986,
326,
20334,
966,
733,
1375,
11718,
1376,
11,
358,
326,
5052,
18,
971,
1375,
768,
2603,
11,
353,
864,
16,
8232,... |
left_count = int(file.read().strip()) - self.count | self.left_count = int(file.read().strip()) - self.count | def do_some_calc(self): left_count = -1 | cb6bc49d36771dd5e95ebfdee0c01b59a5a8c9b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/600/cb6bc49d36771dd5e95ebfdee0c01b59a5a8c9b7/process.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
19068,
67,
12448,
12,
2890,
4672,
2002,
67,
1883,
273,
300,
21,
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,
741,
67,
19068,
67,
12448,
12,
2890,
4672,
2002,
67,
1883,
273,
300,
21,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
revision = Revision(data) self.revisions.append(revision) | self.data = data self.mtime = datetime.now() | def set_data(self, data): revision = Revision(data) self.revisions.append(revision) | 726eed312a5ece49d0c15a2ea1039578c995ccb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/726eed312a5ece49d0c15a2ea1039578c995ccb9/memory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
892,
12,
2890,
16,
501,
4672,
6350,
273,
13132,
12,
892,
13,
365,
18,
29892,
18,
6923,
12,
13057,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
892,
12,
2890,
16,
501,
4672,
6350,
273,
13132,
12,
892,
13,
365,
18,
29892,
18,
6923,
12,
13057,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
self.body.append('\\subsubsection{') | self.body.append('\\subsubsection{%s\label{%s}}\n' % (s1, s2)) | def visit_title(self, node): #self.pdebug('%% [(visit_title) section_level: %d node: "%s"]\n' % \ # (self.section_level, node.astext().lower())) if self.section_level == 0: self.title_before_section = 1 if self.seealso: self.body.append('\\end{seealso}\n') self.seealso = 0 if node.astext().lower() == 'see also': self.body.append('\\begin{seealso}\n') self.seealso = 1 raise nodes.SkipNode else: if self.section_level == 0: # It's the document title before any section. self.title = self.encode(node.astext()) raise nodes.SkipNode else: # It's a title for a section in-side the document. self.body.append('\n\n') self.body.append('%' + '_' * 75) self.body.append('\n\n') | cadca0b7f7a27904b2dda705f5a3c8137f0afa74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/cadca0b7f7a27904b2dda705f5a3c8137f0afa74/python_latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
468,
2890,
18,
84,
4148,
2668,
11438,
306,
12,
11658,
67,
2649,
13,
2442,
67,
2815,
30,
738,
72,
225,
756,
30,
2213,
87,
11929,
64,
82,
11,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
2649,
12,
2890,
16,
756,
4672,
468,
2890,
18,
84,
4148,
2668,
11438,
306,
12,
11658,
67,
2649,
13,
2442,
67,
2815,
30,
738,
72,
225,
756,
30,
2213,
87,
11929,
64,
82,
11,
... |
print "\tExcluding strangely small mRNA exon: %s, %s [geneid, length]" % (row[0], (row[5]-row[4])) | print "\tExcluding strangely small mRNA exon: %s, %s [geneid, length]" % (row[0], (row[3]-row[2])) | def main(): """ Main execution. """ # Begin timing execution starttime = time.time() # Check that RNAhybrid exists, and is executable assert(os.path.exists(RNAHYBRID_PATH) and os.access(RNAHYBRID_PATH, os.X_OK)) usage = "usage: %prog [OPTIONS]" parser = OptionParser(usage) # General settings #parser.add_option("-s", "--oneSpecies", help="Specify a species list for a query, such as " # "Hs,Pt [Default: Use all species.]", # default=False, action="store", type="string", dest="speciesList") # This ignores hyperthreading pseudo-cores, which is fine since we hose the ALU parser.add_option("-j", help="Threads. We parallelize the invocations of RNAhybrid. [Default: # of CPU cores]", default=os.sysconf('SC_NPROCESSORS_ONLN'), action="store", type="int", dest="threads") parser.add_option("-n", "--nocache", help="Don't use local cache to retreive prior RNAhybrid" "results. [Default: False]", default=False, action="store_true", dest="noCache") group = OptionGroup(parser, "Range Settings (optional)") parser.add_option("--start-num", help="What number miRNA ortholog group to start scanning from (inclusive).", default=-1, action="store", type="int", dest="startNum") parser.add_option("--stop-num", help="What number miRNA ortholog group to STOP scanning at (exclusive).", default=-1, action="store", type="int", dest="stopNum") parser.add_option_group(group) (options, args) = parser.parse_args() if len(args) == 0: parser.error("Try -h for help.") # Sanity check range inputs range_given = False if options.startNum >= 0 or options.stopNum >= 0: if not (options.startNum >= 0 and options.stopNum >= 0): parser.error("If you specifiy a start/stop, you must specify both ends of the range!") if options.startNum >= options.stopNum: parser.error("Invalid scan range.") range_given = True # This is a dict mapping short species tags ('Hs','Cf') to TAXIDs. # Note: These are /local/ TAXIDs via localtaxid_to_org (in cafeuser?) speciesMap = {'Hs': 7951, # Human 'Pt': 7943, # Chimp 'Cf': 7959, # Dog 'Rn': 8385, # Rat 'Gg': 7458, # Chicken 'Mm': 8364} # Mouse # Either one or all species #speciesList = speciesMap.keys() #if options.oneSpecies: # speciesList = [options.oneSpecies] oracle_password = open(ORACLE_PWFILE, 'r').readline() dbase = cx_Oracle.connect(ORACLE_USERNAME, oracle_password, ORACLE_SERVER + ':1521/' + ORACLE_DB) print "Connected to %s\n" % dbase.dsn # Get list of distinct orthologous groups. mirna_id_dbcursor = dbase.cursor() mirna_id_dbcursor.execute("SELECT DISTINCT(MMO_MATUREMIRID) FROM LCHANG.MIRBASE_MIR_ORTHOLOG " "WHERE MMO_MATURESEQ IS NOT NULL ORDER BY 1") # validated: # where mmo_maturemirid in ('hsa-miR-124', 'hsa-miR-1', 'hsa-miR-373','hsa-miR-155', 'hsa-miR-30a','hsa-let-7b') # and mmo_species in ('mm9', 'rn4', 'canFam2', 'hg18') mirna_mirid_queries = mirna_id_dbcursor.fetchall() mirna_id_dbcursor.close() # (The list slicing is because fetchall() returns tuples. mirna_mirid_queries = [x[0] for x in mirna_mirid_queries] # We do some list slicing here to get a range [if specified] of queries # This is so on a cluster, each machine can run over a selected few miRNAs if range_given == True: mirna_mirid_queries = mirna_mirid_queries[options.startNum:options.stopNum] print "Targeting %s miRNAs orthologous clusters" % len(mirna_mirid_queries) # Now that we have the list of miRNA orthologous clusters, make a dict of tuples # corresponding to the miRNA values. mirna_queries = {} # This will look like: # mirna_queries[MIR_ID] = ((MMO_SPECIES, MMO_MATURESEQ), (MMO_SPECIES, MMO_MATURESEQ) ...) mirna_dbcursor = dbase.cursor() # This is an inelegant way to select only the MIRIDs we want, but Oracle's lack of a # limit statement means this second query makes things more flexible with MySQL environments. mirna_dbcursor.execute("SELECT MMO_MATUREMIRID, MMO_SPECIES, MMO_MATURESEQ " "FROM LCHANG.MIRBASE_MIR_ORTHOLOG " "WHERE MMO_MATURESEQ IS NOT NULL ORDER BY 1, 2") for row in mirna_dbcursor.fetchall(): if row[0] in mirna_mirid_queries: # Sanity check that miRNAs are actual sequences try: assert(re.match("^[AUTGC]*$", row[2], re.IGNORECASE)) mirna_queries.setdefault(row[0], set()).add((row[1], row[2])) except AssertionError: print "\tIgnoring miRNA with 'N' or invalid char: %s, %s [mirid, species]" % (row[0], row[1]) mirna_dbcursor.close() # Sanity check that should never fail (unless you've broken the SQL queries) assert(len(mirna_mirid_queries) == len(mirna_queries)) print "miRNA data retreived.\n" ### --------------------------------------------- ### At this point, we have all the necessary miRNA clusters, so ### it's time to build /mRNA/ clusters from the database. ### ### We do this by getting the coding positions from @@@@@@@@@@@@, then ### selecting those regions from @@@@@@@@@@@. ### ### NOTE: Make sure to take the reverse compliment of the reverse strands. ### ### We preserve the gene id, and other meta data, so that later on, we can ### see if a region was a coding region, UTR, etc. ### --------------------------------------------- # *** There are a few data structures here to take note of. *** homologene_to_mrna = {} # homologene_to_mrna: (Dict) # key: hge_homologeneid # TODO: Double-check that not all HGE_GENEIDs map to MRC_GENEIDs # # Homologene has 244,950 rows, while the select has only 67,520 # val: set((mrc_geneid, mrc_transcript_no), (mrc_geneid, mrc_transcript_no), ...) mrna_to_seq = {} # mrna_to_seq: (Dict) # key: mrc_geneid # TODO: Double-check that mrc_transcript_no is NOT needed here # val: (gcs_taxid, gcs_localtaxid, gcs_complement, gcs_start, gcs_stop) mrna_to_exons = {} # mrna_to_exons: (Dict) # key: (mrc_geneid, mrc_transcript_no) # val: [(mrc_start, mrc_stop), (mrc_start, mrc_stop), ...] mrna_to_cds = {} # mrna_to_cds: (Dict) # key: (mrna_geneid, mrc_transcript_no) # val: [(cds_start, cds_stop), (cds_start, cds_stop), ...] # homologene_to_mrna print "Populating: homologene_to_mrna" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT DISTINCT HGE_HOMOLOGENEID, MRC_GENEID, MRC_TRANSCRIPT_NO " "FROM PAP.HOMOLOGENE, PAP.MRNA_COORDINATES " "WHERE PAP.HOMOLOGENE.HGE_GENEID = PAP.MRNA_COORDINATES.MRC_GENEID " "AND ROWNUM < 1000 " "ORDER BY MRC_GENEID, MRC_TRANSCRIPT_NO") for row in SQLGenerator(mrna_dbase): homologene_to_mrna.setdefault(row[0], set()).add((row[1], row[2])) mrna_dbase.close() print "Populated.\n" # mrna_to_seq print "Populating: mrna_to_seq" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT DISTINCT(MRC_GENEID), GCS_TAXID, GCS_LOCALTAXID, " "GCS_COMPLEMENT, GCS_START, GCS_STOP " "FROM PAP.MRNA_COORDINATES, PAP.GENE_COORDINATES " "WHERE PAP.MRNA_COORDINATES.MRC_GENEID = PAP.GENE_COORDINATES.GCS_GENEID " "AND ROWNUM < 1000") for row in SQLGenerator(mrna_dbase): assert(row[4] < row[5]) # Start < Stop mrna_to_seq[row[0]] = tuple(row[1:]) mrna_dbase.close() print "Populated.\n" # mrna_to_exons print "Populating: mrna_to_exons" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT MRC_GENEID, MRC_TRANSCRIPT_NO, MRC_START, MRC_STOP " "FROM PAP.MRNA_COORDINATES " "WHERE ROWNUM < 1000 " "ORDER BY MRC_START") for row in SQLGenerator(mrna_dbase): try: assert(row[2] < row[3]) # Start < Stop mrna_to_exons.setdefault((row[0], row[1]), []).append((row[2], row[3])) except AssertionError: print "\tExcluding strangely small mRNA exon: %s, %s [geneid, length]" % (row[0], (row[5]-row[4])) mrna_dbase.close() print "Populated.\n" sanity_overlap_check(mrna_to_exons) # mrna_to_cds print "Populating: mrna_to_cds" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT DISTINCT MRC_GENEID, MRC_TRANSCRIPT_NO, CDS_START, CDS_STOP " "FROM PAP.MRNA_COORDINATES, PAP.CDS_COORDINATES " "WHERE PAP.MRNA_COORDINATES.MRC_GENEID = PAP.CDS_COORDINATES.CDS_GENEID " "AND PAP.MRNA_COORDINATES.MRC_TRANSCRIPT_NO = PAP.CDS_COORDINATES.CDS_TRANSCRIPT_NO " "AND ROWNUM < 100 " "ORDER BY CDS_START") for row in SQLGenerator(mrna_dbase): assert(row[2] < row[3]) # Start < Stop mrna_to_cds.setdefault((row[0], row[1]), []).append((row[2], row[3])) mrna_dbase.close() print "Populated.\n" sanity_overlap_check(mrna_to_cds) ### --------------------------------------------- ### First, start looping to populate our input_queue for threads to work ### Then, when filled, keep topping it off, while we periodically poll output_queue ### --------------------------------------------- input_queue = Queue.Queue(maxsize = 1000) # A threadsafe producer/consumer Queue output_queue = Queue.Queue(maxsize = 1000) # Same, but for product of RNAhybrid # REMINDER: # AT SOME POINT!!!!!!!!!!!!!! # Take reverse complement of sequence via PAP.GENE_COORDINATES quit() # We work on one miRNA cluster at a time, and loop over all sequence clusters for mirid, sepecies_mirna_pairs in mirna_queries.iteritems(): """ Loop over mirna_queries dict handing out clusters of miRNAs to threads. """ #'abc' = [(species, atagaga), (species2, tagatataccc)] #-> span rnahybrid thread #-> input queue = miRNA ## DATABASE SELECT HERE work_left = True while True: """ This loop runs until we've exhausted all sequences for the given mmo_mirid cluster. """ while work_left == True: """ input_queue filling loop """ # Fill work queue with mirna_cluster:sequence_cluster pairs # We loop over all sequence clusters, until our queue is full # keep advancing in database record mirna_sql = mirna_db_cursor.fetchone() if mirna_sql == None: # We must be out of input miRNA ortholog groups mirna_db_cursor.close() work_left = False # Stop trying to fill the input_queue break # Populate print "\n\tUTR target: \t %s (entrez id)\n" % t_prm_sql[0] miRNAcursor = dbase.cursor() miRNAcursor.execute("SELECT DOM_MATURESEQ FROM DIST_ORTHOLOG_MIRNA WHERE DOM_LOCAL_TAXID = " + str(speciesMap[species]) + " LIMIT " + speed_limit) while True: rna_sql = miRNAcursor.fetchone() if rna_sql == None: miRNAcursor.close() break # Put in queue queue.put((t_prm_sql[0], t_prm_sql[1], rna_sql[0])) #rnahybrid(options.noCache, species, t_prm_sql[0], t_prm_sql[1], rna_sql[0]) print "\nAll done!\n" print "Execution took: %s secs." % (time.time()-starttime) | 41561c4d5008b6e6d8df360341af56d59d8a3e62 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12607/41561c4d5008b6e6d8df360341af56d59d8a3e62/scan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
12740,
4588,
18,
3536,
225,
468,
14323,
15538,
4588,
23437,
273,
813,
18,
957,
1435,
225,
468,
2073,
716,
534,
11277,
18112,
14400,
1704,
16,
471,
353,
9070,
1815,
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,
2774,
13332,
3536,
12740,
4588,
18,
3536,
225,
468,
14323,
15538,
4588,
23437,
273,
813,
18,
957,
1435,
225,
468,
2073,
716,
534,
11277,
18112,
14400,
1704,
16,
471,
353,
9070,
1815,
12,
... |
mask = int(m.group(2)[1:]) mask = 32 - mask | mask = m.group(2) if mask is None: mask = 8 * (m.group(1).count('.') + 1) else: mask = int(mask[1:]) mask = 32 - mask | def ip2num(ipAddr): parts = ipAddr.split('.') parts = map(int, parts) if len(parts) != 4: parts = (parts + [0, 0, 0, 0])[:4] return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3] | b96fbb8d0058efa0b1b8d6adbe875488cb03e4fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/b96fbb8d0058efa0b1b8d6adbe875488cb03e4fc/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2359,
22,
2107,
12,
625,
3178,
4672,
2140,
273,
2359,
3178,
18,
4939,
2668,
1093,
13,
2140,
273,
852,
12,
474,
16,
2140,
13,
309,
562,
12,
6019,
13,
480,
1059,
30,
2140,
273,
261,
60... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2359,
22,
2107,
12,
625,
3178,
4672,
2140,
273,
2359,
3178,
18,
4939,
2668,
1093,
13,
2140,
273,
852,
12,
474,
16,
2140,
13,
309,
562,
12,
6019,
13,
480,
1059,
30,
2140,
273,
261,
60... |
return md5.new(open(path, 'r').read()).hexdigest() | if md5 is not None: return md5.new(open(path, 'r').read()).hexdigest() hash = hashlib.new('md5') hash.update(open(path, 'r').read()) return hash.hexdigest() | def getHash(self, path=None): """Get the hash of a file. | 17c1e9c1a5f8b766fb612f98a46f914671483c57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9162/17c1e9c1a5f8b766fb612f98a46f914671483c57/cachemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16075,
12,
2890,
16,
589,
33,
7036,
4672,
3536,
967,
326,
1651,
434,
279,
585,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16075,
12,
2890,
16,
589,
33,
7036,
4672,
3536,
967,
326,
1651,
434,
279,
585,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
parity = property(getParity, setParity, "Parity setting") | parity = property(getParity, setParity, doc="Parity setting") | def getParity(self): """Get the current parity setting.""" return self._parity | 9d013c965287ad26d1e017f834280065158386e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/9d013c965287ad26d1e017f834280065158386e5/serialutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1553,
560,
12,
2890,
4672,
3536,
967,
326,
783,
19904,
3637,
12123,
327,
365,
6315,
1065,
560,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
1553,
560,
12,
2890,
4672,
3536,
967,
326,
783,
19904,
3637,
12123,
327,
365,
6315,
1065,
560,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if self.iq_response_handlers.has_key((id,fr.as_unicode())): key=(id,fr.as_unicode()) | if fr: ufr=fr.as_unicode() else: ufr=None if self.iq_response_handlers.has_key((id,ufr)): key=(id,ufr) | def process_iq(self,stanza): id=stanza.get_id() fr=stanza.get_from() | 1b8226065fdd33c9a6f5121c5a2b0886d6355754 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12769/1b8226065fdd33c9a6f5121c5a2b0886d6355754/stream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
18638,
12,
2890,
16,
541,
11939,
4672,
612,
33,
541,
11939,
18,
588,
67,
350,
1435,
3812,
33,
541,
11939,
18,
588,
67,
2080,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
18638,
12,
2890,
16,
541,
11939,
4672,
612,
33,
541,
11939,
18,
588,
67,
350,
1435,
3812,
33,
541,
11939,
18,
588,
67,
2080,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fp.write('mv %s /mnt/boto.cfg; ' % BotoConfigPath) fp.write('mv /root/.ssh/authorized_keys /mnt/authorized_keys; ') | fp.write('sudo mv %s /mnt/boto.cfg; ' % BotoConfigPath) fp.write('mv ~/.ssh/authorized_keys /mnt/authorized_keys; ') | def bundle(self, bucket=None, prefix=None, key_file=None, cert_file=None, size=None, ssh_key=None, fp=None, clear_history=True): iobject = IObject() if not bucket: bucket = iobject.get_string('Name of S3 bucket') if not prefix: prefix = iobject.get_string('Prefix for AMI file') if not key_file: key_file = iobject.get_filename('Path to RSA private key file') if not cert_file: cert_file = iobject.get_filename('Path to RSA public cert file') if not size: size = iobject.get_int('Size (in MB) of bundled image') if not ssh_key: ssh_key = self.server.get_ssh_key_file() self.copy_x509(key_file, cert_file) if not fp: fp = StringIO.StringIO() fp.write('mv %s /mnt/boto.cfg; ' % BotoConfigPath) fp.write('mv /root/.ssh/authorized_keys /mnt/authorized_keys; ') if clear_history: fp.write('history -c; ') fp.write(self.bundle_image(prefix, size, ssh_key)) fp.write('; ') fp.write(self.upload_bundle(bucket, prefix, ssh_key)) fp.write('; ') fp.write('mv /mnt/boto.cfg %s; ' % BotoConfigPath) fp.write('mv /mnt/authorized_keys /root/.ssh/authorized_keys\n') command = fp.getvalue() print 'running the following command on the remote server:' print command t = self.ssh_client.run(command) print '\t%s' % t[0] print '\t%s' % t[1] print '...complete!' print 'registering image...' self.image_id = self.server.ec2.register_image('%s/%s.manifest.xml' % (bucket, prefix)) return self.image_id | 05d1febbc997d57cdcdff56afa99864b37115371 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/05d1febbc997d57cdcdff56afa99864b37115371/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3440,
12,
2890,
16,
2783,
33,
7036,
16,
1633,
33,
7036,
16,
498,
67,
768,
33,
7036,
16,
3320,
67,
768,
33,
7036,
16,
963,
33,
7036,
16,
7056,
67,
856,
33,
7036,
16,
4253,
33,
7036,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3440,
12,
2890,
16,
2783,
33,
7036,
16,
1633,
33,
7036,
16,
498,
67,
768,
33,
7036,
16,
3320,
67,
768,
33,
7036,
16,
963,
33,
7036,
16,
7056,
67,
856,
33,
7036,
16,
4253,
33,
7036,... |
self.accept(self.uniqueName('lostConnection'), self.lostConnection) | self.accept(self._getLostConnectionEvent(), self.lostConnection) | def __init__(self, connectMethod, config, hasOwnerView = False, threadedNet = None): assert self.notify.debugCall() if threadedNet is None: # Default value. threadedNet = config.GetBool('threaded-net', False) # let the C connection repository know whether we're supporting # 'owner' views of distributed objects (i.e. 'receives ownrecv', # 'I own this object and have a separate view of it regardless of # where it currently is located') CConnectionRepository.__init__(self, hasOwnerView, threadedNet) self.setWantMessageBundling(config.GetBool('want-message-bundling', 1)) # DoInterestManager.__init__ relies on CConnectionRepository being # initialized DoInterestManager.__init__(self) DoCollectionManager.__init__(self) self.setPythonRepository(self) | 0911189492d4cb48456d939caae7c25cede0ee70 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/0911189492d4cb48456d939caae7c25cede0ee70/ConnectionRepository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3077,
1305,
16,
642,
16,
711,
5541,
1767,
273,
1083,
16,
286,
20528,
7308,
273,
599,
4672,
1815,
365,
18,
12336,
18,
4148,
1477,
1435,
309,
286,
20528,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3077,
1305,
16,
642,
16,
711,
5541,
1767,
273,
1083,
16,
286,
20528,
7308,
273,
599,
4672,
1815,
365,
18,
12336,
18,
4148,
1477,
1435,
309,
286,
20528,
7... |
def is_stemmer_available_for_language(lang): """Return true if stemmer for language LANG is available. Return false otherwise. """ return lang == 'english' _stemmers[get_ident()] = PorterStemmer() def stem(word, lang=CFG_BIBINDEX_STEMMER_DEFAULT_LANGUAGE): """Return WORD stemmed according to language LANG (e.g. 'en').""" if lang == 'english': return _stemmers[get_ident()].stem(word, 0, len(word)-1) else: return word | def _create_stemmers(): """Create stemmers dictionary for all possible languages.""" stemmers_initialized = {} for lang in Stemmer.algorithms(): try: stemmers_initialized[lang] = Stemmer.Stemmer(lang, 40000) except TypeError: pass return stemmers_initialized | 59faff2caf003b2cc5ecdfe67a12ea6b7fb05ac5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/59faff2caf003b2cc5ecdfe67a12ea6b7fb05ac5/bibindex_engine_stemmer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
19781,
81,
414,
13332,
3536,
1684,
13119,
81,
414,
3880,
364,
777,
3323,
8191,
12123,
13119,
81,
414,
67,
13227,
273,
2618,
364,
3303,
316,
348,
874,
6592,
18,
287,
13365,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
19781,
81,
414,
13332,
3536,
1684,
13119,
81,
414,
3880,
364,
777,
3323,
8191,
12123,
13119,
81,
414,
67,
13227,
273,
2618,
364,
3303,
316,
348,
874,
6592,
18,
287,
13365,... | |
print "CONFIG: ", self.CONFIG | print "PYTHON: ", self.PYTHON print "GETTEXT: ", self.GETTEXT | def debug(self): print "CHANDLERHOME: ", self.CHANDLERHOME print "CHANDLERBIN: ", self.CHANDLERBIN print "BINROOT: ", self.BINROOT print "CONFIG: ", self.CONFIG print "ROOTDIR: ", self.ROOTDIR print "OUTPUTFILE: ", self.OUTPUTFILE print "WXRC: ", self.WXRC print "XRC_FILES: ", self.XRC_FILES | 0aae62c583e3322f5743c0fc69e591ebf63d4f41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/0aae62c583e3322f5743c0fc69e591ebf63d4f41/createPot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2890,
4672,
1172,
315,
1792,
4307,
14668,
14209,
30,
3104,
365,
18,
1792,
4307,
14668,
14209,
1172,
315,
1792,
4307,
14668,
12615,
30,
3104,
365,
18,
1792,
4307,
14668,
12615,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
12,
2890,
4672,
1172,
315,
1792,
4307,
14668,
14209,
30,
3104,
365,
18,
1792,
4307,
14668,
14209,
1172,
315,
1792,
4307,
14668,
12615,
30,
3104,
365,
18,
1792,
4307,
14668,
12615,
11... |
run_sql("UPDATE schTASK SET runtime=%s, status='WAITING', progress='' WHERE id=%s", (new_runtime, _task_params['task_id'])) write_message("Task | run_sql("UPDATE schTASK SET runtime=%s, status='WAITING', progress='' WHERE id=%s", (new_runtime, _TASK_PARAMS['task_id'])) write_message("Task | def _task_run(task_run_fnc): """Runs the task by fetching arguments from the BibSched task queue. This is what BibSched will be invoking via daemon call. The task prints Fibonacci numbers for up to NUM on the stdout, and some messages on stderr. @param task_run_fnc: will be called as the main core function. Must return False in case of errors. Return True in case of success and False in case of failure.""" ## We prepare the pid file inside /prefix/var/run/taskname_id.pid check_running_process_user() try: pidfile_name = os.path.join(CFG_PREFIX, 'var', 'run', 'bibsched_task_%d.pid' % _task_params['task_id']) pidfile = open(pidfile_name, 'w') pidfile.write(str(os.getpid())) pidfile.close() except OSError: register_exception(alert_admin=True) task_update_status("ERROR") return False ## check task status: task_status = task_read_status() if task_status not in ("WAITING", "SCHEDULED"): write_message("Error: The task #%d is %s. I expected WAITING or SCHEDULED." % (_task_params['task_id'], task_status), sys.stderr) return False time_now = time.time() if _task_params['runtime_limit'] is not None and os.environ.get('BIBSCHED_MODE', 'manual') != 'manual': if not _task_params['runtime_limit'][0][0] <= time_now <= _task_params['runtime_limit'][0][1]: if time_now <= _task_params['runtime_limit'][0][0]: new_runtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(_task_params['runtime_limit'][0][0])) else: new_runtime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(_task_params['runtime_limit'][1][0])) progress = run_sql("SELECT progress FROM schTASK WHERE id=%s", (_task_params['task_id'], )) if progress: progress = progress[0][0] else: progress = '' g = re.match(r'Postponed (\d+) time\(s\)', progress) if g: postponed_times = int(g.group(1)) else: postponed_times = 0 run_sql("UPDATE schTASK SET runtime=%s, status='WAITING', progress=%s WHERE id=%s", (new_runtime, 'Postponed %d time(s)' % (postponed_times + 1), _task_params['task_id'])) write_message("Task #%d postponed because outside of runtime limit" % _task_params['task_id']) return True ## initialize signal handler: signal.signal(signal.SIGUSR2, signal.SIG_IGN) signal.signal(signal.SIGTSTP, _task_sig_sleep) signal.signal(signal.SIGTERM, _task_sig_stop) signal.signal(signal.SIGQUIT, _task_sig_stop) signal.signal(signal.SIGABRT, _task_sig_suicide) signal.signal(signal.SIGINT, _task_sig_stop) ## we can run the task now: write_message("Task #%d started." % _task_params['task_id']) task_update_status("RUNNING") ## run the task: _task_params['task_starting_time'] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()) sleeptime = _task_params['sleeptime'] try: try: if callable(task_run_fnc) and task_run_fnc(): task_update_status("DONE") else: task_update_status("DONE WITH ERRORS") except SystemExit: pass except: register_exception(alert_admin=True) task_update_status("ERROR") finally: task_status = task_read_status() if sleeptime: new_runtime = get_datetime(sleeptime) ## The task is a daemon. We resubmit it if task_status == 'DONE': ## It has finished in a good way. We recycle the database row run_sql("UPDATE schTASK SET runtime=%s, status='WAITING', progress='' WHERE id=%s", (new_runtime, _task_params['task_id'])) write_message("Task #%d finished and resubmitted." % _task_params['task_id']) elif task_status == 'STOPPED': run_sql("UPDATE schTASK SET status='WAITING', progress='' WHERE id=%s", (_task_params['task_id'], )) write_message("Task #%d stopped and resubmitted." % _task_params['task_id']) else: ## We keep the bad result and we resubmit with another id. #res = run_sql('SELECT proc,user,sleeptime,arguments,priority FROM schTASK WHERE id=%s', (_task_params['task_id'], )) #proc, user, sleeptime, arguments, priority = res[0] #run_sql("""INSERT INTO schTASK (proc,user, #runtime,sleeptime,status,arguments,priority) #VALUES (%s,%s,%s,%s,'WAITING',%s, %s)""", #(proc, user, new_runtime, sleeptime, arguments, priority)) write_message("Task #%d finished but not resubmitted. [%s]" % (_task_params['task_id'], task_status)) else: ## we are done: write_message("Task #%d finished. [%s]" % (_task_params['task_id'], task_status)) ## Removing the pid os.remove(pidfile_name) return True | e9bc8dbefc702ea212bd46520d513f1d8b201695 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/e9bc8dbefc702ea212bd46520d513f1d8b201695/bibtask.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4146,
67,
2681,
12,
4146,
67,
2681,
67,
4293,
71,
4672,
3536,
9361,
326,
1562,
635,
16191,
1775,
628,
326,
605,
495,
55,
2049,
1562,
2389,
18,
1220,
353,
4121,
605,
495,
55,
2049,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4146,
67,
2681,
12,
4146,
67,
2681,
67,
4293,
71,
4672,
3536,
9361,
326,
1562,
635,
16191,
1775,
628,
326,
605,
495,
55,
2049,
1562,
2389,
18,
1220,
353,
4121,
605,
495,
55,
2049,... |
def _GetUpdatedParams(old_params, update_dict): | def _GetUpdatedParams(old_params, update_dict, use_default=True, use_none=False): | def _GetUpdatedParams(old_params, update_dict): """Return the new version of a parameter dictionary. @type old_params: dict @param old_params: old parameters @type update_dict: dict @param update_dict: dict containing new parameter values, or constants.VALUE_DEFAULT to reset the parameter to its default value @rtype: dict @return: the new parameter dictionary """ params_copy = copy.deepcopy(old_params) for key, val in update_dict.iteritems(): if val == constants.VALUE_DEFAULT: try: del params_copy[key] except KeyError: pass else: params_copy[key] = val return params_copy | 21d7df5fef538b66773f1e9b97f9ba35d0c628e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/21d7df5fef538b66773f1e9b97f9ba35d0c628e4/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
967,
7381,
1370,
12,
1673,
67,
2010,
16,
1089,
67,
1576,
16,
999,
67,
1886,
33,
5510,
16,
999,
67,
6102,
33,
8381,
4672,
3536,
990,
326,
394,
1177,
434,
279,
1569,
3880,
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,
389,
967,
7381,
1370,
12,
1673,
67,
2010,
16,
1089,
67,
1576,
16,
999,
67,
1886,
33,
5510,
16,
999,
67,
6102,
33,
8381,
4672,
3536,
990,
326,
394,
1177,
434,
279,
1569,
3880,
18,
225... |
filled in left. We fill in columns left to right.""" | filled in yet. We fill in columns left to right.""" | def h(self, node): "h function is straight-line distance from a node's state to goal." locs = getattr(self.graph, 'locations', None) if locs: return int(distance(locs[node.state], locs[self.goal])) else: return infinity | 9d81cd6a41cfaf7f9793d30a1416c14a274b4ecb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/16/9d81cd6a41cfaf7f9793d30a1416c14a274b4ecb/search.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
12,
2890,
16,
756,
4672,
315,
76,
445,
353,
21251,
17,
1369,
3888,
628,
279,
756,
1807,
919,
358,
17683,
1199,
26357,
273,
3869,
12,
2890,
18,
4660,
16,
296,
12352,
2187,
599,
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,
366,
12,
2890,
16,
756,
4672,
315,
76,
445,
353,
21251,
17,
1369,
3888,
628,
279,
756,
1807,
919,
358,
17683,
1199,
26357,
273,
3869,
12,
2890,
18,
4660,
16,
296,
12352,
2187,
599,
13,... |
components.registerAdapter(ListModel, types.ListType, IModel) | def setData(self, data): setattr(self.parent, self.name, data) | e70670c2aaa33d993aef6063360e7e45bf5d9b39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/e70670c2aaa33d993aef6063360e7e45bf5d9b39/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
501,
4672,
9241,
12,
2890,
18,
2938,
16,
365,
18,
529,
16,
501,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
501,
4672,
9241,
12,
2890,
18,
2938,
16,
365,
18,
529,
16,
501,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
if text and text[0] in u' \n\x85\u2028\u2029': hints += unicode(self.best_indent) tail = text[-2:] while len(tail) < 2: tail = u' '+tail if tail[-1] in u'\n\x85\u2028\u2029': if tail[-2] in u'\n\x85\u2028\u2029': | if text: if text[0] in u' \n\x85\u2028\u2029': hints += unicode(self.best_indent) if text[-1] not in u'\n\x85\u2028\u2029': hints += u'-' elif len(text) == 1 or text[-2] in u'\n\x85\u2028\u2029': | def determine_block_hints(self, text): hints = u'' if text and text[0] in u' \n\x85\u2028\u2029': hints += unicode(self.best_indent) tail = text[-2:] while len(tail) < 2: tail = u' '+tail if tail[-1] in u'\n\x85\u2028\u2029': if tail[-2] in u'\n\x85\u2028\u2029': hints += u'+' else: hints += u'-' return hints | 3163d33440bebbd90b4b72eafe7880748597a089 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/94/3163d33440bebbd90b4b72eafe7880748597a089/emitter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
67,
2629,
67,
24598,
12,
2890,
16,
977,
4672,
13442,
273,
582,
6309,
309,
977,
30,
309,
977,
63,
20,
65,
316,
582,
11,
521,
82,
64,
92,
7140,
64,
89,
18212,
28,
64,
89,
18212... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
67,
2629,
67,
24598,
12,
2890,
16,
977,
4672,
13442,
273,
582,
6309,
309,
977,
30,
309,
977,
63,
20,
65,
316,
582,
11,
521,
82,
64,
92,
7140,
64,
89,
18212,
28,
64,
89,
18212... |
// Set a flag in case the builder wants to have different behavior // on the second pass. | // Propagate up to the parent def if we're an inner function. | 58afad4d3cade0a037f53f0a04cb23589df417b1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12949/58afad4d3cade0a037f53f0a04cb23589df417b1/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
368,
1186,
9095,
340,
731,
358,
326,
982,
1652,
309,
732,
4565,
392,
3443,
445,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
368,
1186,
9095,
340,
731,
358,
326,
982,
1652,
309,
732,
4565,
392,
3443,
445,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
args = args + to | if to[0] == '-to': to = to[1:] args = args + ('-to',) + tuple(to) | def put(self, data, to=None): args = (self.name, 'put', data) if to: args = args + to apply(self.tk.call, args) | f59254c5479eb2cf959502b211c95ed8d21cd76b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f59254c5479eb2cf959502b211c95ed8d21cd76b/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
12,
2890,
16,
501,
16,
358,
33,
7036,
4672,
833,
273,
261,
2890,
18,
529,
16,
296,
458,
2187,
501,
13,
309,
358,
30,
309,
358,
63,
20,
65,
422,
2400,
869,
4278,
358,
273,
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,
1378,
12,
2890,
16,
501,
16,
358,
33,
7036,
4672,
833,
273,
261,
2890,
18,
529,
16,
296,
458,
2187,
501,
13,
309,
358,
30,
309,
358,
63,
20,
65,
422,
2400,
869,
4278,
358,
273,
358... |
<body style="width: %dpx"> | <body style="width: %dpx; background: white"> | def render_table(server, soup, table, css, base_dir, width, height, dpi, factor=1.0): head = '' for e in soup.findAll(['link', 'style']): head += unicode(e)+'\n\n' style = '' for key, val in css.items(): style += key + ':%s;'%val html = u'''\ | d0106bd4a0764b59980ee90b7dc92c035c68666b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/d0106bd4a0764b59980ee90b7dc92c035c68666b/table_as_image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2121,
12,
3567,
16,
15418,
16,
1014,
16,
3747,
16,
1026,
67,
1214,
16,
1835,
16,
2072,
16,
16361,
16,
5578,
33,
21,
18,
20,
4672,
910,
273,
875,
364,
425,
316,
15418,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
2121,
12,
3567,
16,
15418,
16,
1014,
16,
3747,
16,
1026,
67,
1214,
16,
1835,
16,
2072,
16,
16361,
16,
5578,
33,
21,
18,
20,
4672,
910,
273,
875,
364,
425,
316,
15418,
18,
... |
attr_value = __tab_para_alignment.get(attr_value, __tab_para_alignment['left']) | attr_value = __tab_para_alignment.get(attr_value) | def create_paragraph(pdf_stylesheet, element, content): """ """ parent_style = 'Normal' style_attr = {} content = ''.join(content) bulletText = None for key, attr_value in element[1].iteritems(): key = key[1] if key == 'style': parent_style = attr_value elif key == 'bulletText': bulletText = attr_value else: if key == 'alignment': attr_value = __tab_para_alignment.get(attr_value, __tab_para_alignment['left']) elif key in ['leftIndent', 'rightIndent']: attr_value = get_value_reportlab(attr_value) style_attr[key] = attr_value if not pdf_stylesheet.has_key(parent_style): parent_style = 'Normal' style = ParagraphStyle('', parent=pdf_stylesheet[parent_style], **style_attr) return Paragraph(content, style, bulletText) | 51b02e012792ad1fcdef1300580c1d6a58548c1f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/51b02e012792ad1fcdef1300580c1d6a58548c1f/rml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
22445,
12,
7699,
67,
19403,
16,
930,
16,
913,
4672,
3536,
3536,
982,
67,
4060,
273,
296,
5506,
11,
2154,
67,
1747,
273,
2618,
913,
273,
875,
18,
5701,
12,
1745,
13,
31650,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
22445,
12,
7699,
67,
19403,
16,
930,
16,
913,
4672,
3536,
3536,
982,
67,
4060,
273,
296,
5506,
11,
2154,
67,
1747,
273,
2618,
913,
273,
875,
18,
5701,
12,
1745,
13,
31650,
1... |
self._length = {} | self.length = {} | def __init__(self, items=[], threshold=0.0, warp=1.0, str_item=lambda x:x, N=3, pad_len=None, pad_char='$', str_query=None): """Constructor @param threshold: Minimum similarity (between 0 and 1) for a string to be considered a match. @param warp: Use warp greater than 1.0 (but less than 3.0) to increase the similarity assigned to short string pairs to imrpove recall. 0.0 < warp < 1. 0 is disallowed, because it reduces the similarity of short strings relative to long strings, which is not what you want (trust me). | 3494fa39678f2e5bc57cacb7df60645ab385db6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12095/3494fa39678f2e5bc57cacb7df60645ab385db6a/ngram.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1516,
22850,
6487,
5573,
33,
20,
18,
20,
16,
341,
11441,
33,
21,
18,
20,
16,
609,
67,
1726,
33,
14661,
619,
30,
92,
16,
423,
33,
23,
16,
4627,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1516,
22850,
6487,
5573,
33,
20,
18,
20,
16,
341,
11441,
33,
21,
18,
20,
16,
609,
67,
1726,
33,
14661,
619,
30,
92,
16,
423,
33,
23,
16,
4627,
67,
... |
self.assertFalse(unittest2.TestCase.longMessage) | self.assertTrue(unittest2.TestCase.longMessage) | def testDefault(self): self.assertFalse(unittest2.TestCase.longMessage) | 79f5c89e04cd43efefde4ac0ba6e34c7067fd640 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7464/79f5c89e04cd43efefde4ac0ba6e34c7067fd640/test_unittest2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1868,
12,
2890,
4672,
365,
18,
11231,
8381,
12,
4873,
3813,
22,
18,
4709,
2449,
18,
5748,
1079,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1868,
12,
2890,
4672,
365,
18,
11231,
8381,
12,
4873,
3813,
22,
18,
4709,
2449,
18,
5748,
1079,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() | portfolio_entry = mysite.profile.models.PortfolioEntry.objects.filter(person=person, project=project)[0] citation = mysite.profile.models.Citation() | def create_citations_from_launchpad_results(dia_id, lp_results): "Input: A dictionary that maps from a project name to information " "about that project, e.g. " """ { 'F-Spot': { 'url': 'http://launchpad.net/f-spot', 'involvement_types': ['Bug Management', 'Bazaar Branches'], 'languages': ['python', 'ruby'], 'citation_url': "https://launchpad.net/~paulproteus", } } and the id of the DataImportAttempt they came from. Side-effect: Create matching structures in the DB and mark our success in the database.""" # {{{ dia = DataImportAttempt.objects.get(id=dia_id) person = dia.person for project_name in lp_results: result = lp_results[project_name] for involvement_type in result['involvement_types']: (project, _) = Project.objects.get_or_create(name=project_name) # This works like a 'get_first_or_create'. # Sometimes there are more than one existing PortfolioEntry # with the details in question. # FIXME: This is untested. if PortfolioEntry.objects.filter(person=person, project=project).count() == 0: portfolio_entry = PortfolioEntry(person=person, project=project) portfolio_entry.save() portfolio_entry = PortfolioEntry.objects.filter(person=person, project=project)[0] citation = Citation() citation.languages = ", ".join(result['languages']) citation.contributor_role = involvement_type citation.portfolio_entry = portfolio_entry citation.data_import_attempt = dia citation.url = result['citation_url'] citation.save_and_check_for_duplicates() person.last_polled = datetime.datetime.now() person.save() dia.completed = True dia.save() # }}} | f1d0d2222a9a25e0a8611c6a5776e209776dcdc0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11976/f1d0d2222a9a25e0a8611c6a5776e209776dcdc0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
71,
18282,
67,
2080,
67,
20738,
6982,
67,
4717,
12,
72,
1155,
67,
350,
16,
12423,
67,
4717,
4672,
315,
1210,
30,
432,
3880,
716,
7565,
628,
279,
1984,
508,
358,
1779,
315,
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,
752,
67,
71,
18282,
67,
2080,
67,
20738,
6982,
67,
4717,
12,
72,
1155,
67,
350,
16,
12423,
67,
4717,
4672,
315,
1210,
30,
432,
3880,
716,
7565,
628,
279,
1984,
508,
358,
1779,
315,
3... |
from Explorers.ExplorerNodes import TransportError | def open(self, node): if node and node.isFolderish(): from Explorers.ExplorerNodes import TransportError try: self.lcFiles.refreshItems(self.modImages, node) except TransportError, v: wxMessageBox(str(v), 'Transport Error', wxOK | wxICON_EXCLAMATION | wxCENTRE) return self.updatePathLabel() if self.style & wxSAVE: btn = saveStr else: btn = openStr self.btOK.SetLabel(btn) return | 29c63b34f15350d68f2bffb35ff76d0e602e0bee /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/29c63b34f15350d68f2bffb35ff76d0e602e0bee/FileDlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
756,
4672,
309,
756,
471,
756,
18,
291,
3899,
1468,
13332,
775,
30,
365,
18,
17704,
2697,
18,
9144,
3126,
12,
2890,
18,
1711,
8946,
16,
756,
13,
1335,
9514,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
756,
4672,
309,
756,
471,
756,
18,
291,
3899,
1468,
13332,
775,
30,
365,
18,
17704,
2697,
18,
9144,
3126,
12,
2890,
18,
1711,
8946,
16,
756,
13,
1335,
9514,
668,
... | |
def reverse(viewname, urlconf=None, args=[], kwargs={}, prefix=None): locale = utils.supported_language(kwargs.pop('locale', | def reverse(*args, **kwargs): reverse_kwargs = kwargs.get('kwargs', {}) locale = utils.supported_language(reverse_kwargs.pop('locale', | def reverse(viewname, urlconf=None, args=[], kwargs={}, prefix=None): locale = utils.supported_language(kwargs.pop('locale', translation.get_language())) path = django_reverse(viewname, urlconf, args, kwargs, prefix) return utils.locale_url(path, locale) | 5d251f508c6236ce58768e731ce47d9133416948 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11458/5d251f508c6236ce58768e731ce47d9133416948/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4219,
30857,
1968,
16,
2826,
4333,
4672,
4219,
67,
4333,
273,
1205,
18,
588,
2668,
4333,
2187,
2618,
13,
2573,
273,
2990,
18,
4127,
67,
4923,
12,
9845,
67,
4333,
18,
5120,
2668,
6339,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4219,
30857,
1968,
16,
2826,
4333,
4672,
4219,
67,
4333,
273,
1205,
18,
588,
2668,
4333,
2187,
2618,
13,
2573,
273,
2990,
18,
4127,
67,
4923,
12,
9845,
67,
4333,
18,
5120,
2668,
6339,
... |
print 'UnitCell not found, there are probably no atoms in ',ncfile | def read_only_atoms(self,ncfile): '''read only the atoms from an existing netcdf file. Used to initialize a calculator from a ncfilename. | 6825c2f5d7bf25604251877d75df92c5e4940acc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5572/6825c2f5d7bf25604251877d75df92c5e4940acc/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
3700,
67,
14937,
12,
2890,
16,
14202,
768,
4672,
9163,
896,
1338,
326,
9006,
628,
392,
2062,
2901,
24799,
585,
18,
10286,
358,
4046,
279,
15497,
628,
279,
8194,
3459,
18,
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,
855,
67,
3700,
67,
14937,
12,
2890,
16,
14202,
768,
4672,
9163,
896,
1338,
326,
9006,
628,
392,
2062,
2901,
24799,
585,
18,
10286,
358,
4046,
279,
15497,
628,
279,
8194,
3459,
18,
2,
-... | |
raise hg.RepoError(_("couldn't parse location %s") % path) | self.repoerror(_("couldn't parse location %s") % path) | def __init__(self, ui, path, create=0): self._url = path self.ui = ui | d749d14b9a64f994adbac33fdac7100d51bc15f4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/d749d14b9a64f994adbac33fdac7100d51bc15f4/sshrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5915,
16,
589,
16,
752,
33,
20,
4672,
365,
6315,
718,
273,
589,
365,
18,
4881,
273,
5915,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5915,
16,
589,
16,
752,
33,
20,
4672,
365,
6315,
718,
273,
589,
365,
18,
4881,
273,
5915,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
config_parser = ConfigParser object from which options are read. | config_parser = ConfigParser object | def __init__(self, config_parser): """ config_parser = ConfigParser object from which options are read. """ pipeline.CondorDAGJob.__init__(self, get_universe(config_parser), get_executable(config_parser, "lalapps_power")) pipeline.AnalysisJob.__init__(self, config_parser) | b2f9cca63cb8b82a5294c75a5545f7b0c1c54261 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/b2f9cca63cb8b82a5294c75a5545f7b0c1c54261/power.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
642,
67,
4288,
4672,
3536,
642,
67,
4288,
273,
25076,
733,
3536,
5873,
18,
12441,
280,
40,
1781,
2278,
16186,
2738,
972,
12,
2890,
16,
336,
67,
318,
1748... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
642,
67,
4288,
4672,
3536,
642,
67,
4288,
273,
25076,
733,
3536,
5873,
18,
12441,
280,
40,
1781,
2278,
16186,
2738,
972,
12,
2890,
16,
336,
67,
318,
1748... |
if dom and dom.domid != self.domid: | if dom and dom.domid and dom.domid != self.domid: | def _checkName(self, name): """Check if a vm name is valid. Valid names contain alphabetic characters, digits, or characters in '_-.:/+'. The same name cannot be used for more than one vm at the same time. | 9a8baeafc1d546959ad9bf2b686d2335c83a6ad4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/9a8baeafc1d546959ad9bf2b686d2335c83a6ad4/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
461,
12,
2890,
16,
508,
4672,
3536,
1564,
309,
279,
4268,
508,
353,
923,
18,
2364,
1257,
912,
524,
8133,
7943,
3949,
16,
6815,
16,
578,
3949,
316,
2070,
17,
18,
27824,
6797,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
461,
12,
2890,
16,
508,
4672,
3536,
1564,
309,
279,
4268,
508,
353,
923,
18,
2364,
1257,
912,
524,
8133,
7943,
3949,
16,
6815,
16,
578,
3949,
316,
2070,
17,
18,
27824,
6797,... |
title, head, body = parse_html(f) | if doctor: title, head, body = parse_html(f) else: if old: f=f.read() title, head, body = '', '', f | def upload_html(object, f): dir, name = os.path.split(f) f=open(f) # There is a Document bugs that causes file uploads to fail. # Waaa. This will be fixed in 1.10.2. #f=f.read() title, head, body = parse_html(f) if old: call(object.manage_addDocument, id=name, file=body) else: call(object.manage_addDTMLDocument, id=name, title=title, file=body) # Now add META and other tags as property if head: object=object.__class__(object.url+'/'+name, username=object.username, password=object.password) call(object.manage_addProperty, id="loadsite-head", type="text", value=head) | 9d889bec612f3bf809e69d44817c619206e3be32 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9d889bec612f3bf809e69d44817c619206e3be32/load_site.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
67,
2620,
12,
1612,
16,
284,
4672,
1577,
16,
508,
273,
1140,
18,
803,
18,
4939,
12,
74,
13,
284,
33,
3190,
12,
74,
13,
468,
6149,
353,
279,
4319,
22398,
716,
14119,
585,
18427,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
67,
2620,
12,
1612,
16,
284,
4672,
1577,
16,
508,
273,
1140,
18,
803,
18,
4939,
12,
74,
13,
284,
33,
3190,
12,
74,
13,
468,
6149,
353,
279,
4319,
22398,
716,
14119,
585,
18427,... |
reference = [data] | messages.append(data) | def image(name, arguments, options, content, lineno, content_offset, block_text, state, state_machine): reference = ''.join(arguments[0].split('\n')) if reference.find(' ') != -1: error = state_machine.reporter.error( 'Image URI contains whitespace.', nodes.literal_block(block_text, block_text), line=lineno) return [error] options['uri'] = reference if options.has_key('target'): block = states.escape2null(options['target']).splitlines() block = [line for line in block] target_type, data = state.parse_target(block, block_text, lineno) if target_type == 'refuri': reference = nodes.reference(refuri=data) elif target_type == 'refname': reference = nodes.reference( refname=data, name=whitespace_normalize_name(options['target'])) state.document.note_refname(reference) else: # malformed target reference = [data] # data is a system message del options['target'] else: reference = None image_node = nodes.image(block_text, **options) if reference: reference += image_node return [reference] else: return [image_node] | e5aabad2376b6842d6729785b035057e02af2fe4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/e5aabad2376b6842d6729785b035057e02af2fe4/images.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1316,
12,
529,
16,
1775,
16,
702,
16,
913,
16,
7586,
16,
913,
67,
3348,
16,
1203,
67,
955,
16,
919,
16,
919,
67,
9149,
4672,
2114,
273,
875,
18,
5701,
12,
7099,
63,
20,
8009,
4939,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1316,
12,
529,
16,
1775,
16,
702,
16,
913,
16,
7586,
16,
913,
67,
3348,
16,
1203,
67,
955,
16,
919,
16,
919,
67,
9149,
4672,
2114,
273,
875,
18,
5701,
12,
7099,
63,
20,
8009,
4939,... |
txheaders is a sequence of (field,value) pairs of any extra headers you would like to add | txheaders is a sequence of (field,value) pairs of any extra headers | def urllib2RetrievePage( url, txheaders=((u'User-agent', _USER_AGENT),)): u"""URL is the full path to the resource we are retrieve/Posting txheaders is a sequence of (field,value) pairs of any extra headers you would like to add """ global cj, opener txheadersEncoded = ( (x.encode('utf-8'), y.encode('utf-8') ) for x,y in txheaders ) urlNotEncoded = url time.sleep( getConfig()['global']['sleepTime'] ) url = encodeQuoteUrl( url , encoding='utf-8') if not url: logStatusMsg(u"utf encoding and quoting url failed, returning false %s" % url, 1 ) return False cjR = cookieHandler() if cjR == 1: logStatusMsg(u"building and installing urllib opener with cookiefile", 5) opener = urllib2.build_opener (urllib2.HTTPCookieProcessor(cj) ) urllib2.install_opener(opener) elif cjR == 0: logStatusMsg(u"building and installing urllib opener without cookiefile", 5) opener = urllib2.build_opener( ) urllib2.install_opener(opener) cj = 1 logStatusMsg(u"grabbing page at url %s" % urlNotEncoded, 5) return urllib2.urlopen( urllib2.Request(url, headers=dict(txheadersEncoded)) ) | 633e00b171a777d923e4aead2f2717108d53a3b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1664/633e00b171a777d923e4aead2f2717108d53a3b9/rssdler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11527,
22,
5767,
1964,
12,
880,
16,
2229,
2485,
33,
12443,
89,
11,
1299,
17,
5629,
2187,
389,
4714,
67,
15005,
3631,
3719,
30,
582,
8395,
1785,
353,
326,
1983,
589,
358,
326,
1058,
732... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11527,
22,
5767,
1964,
12,
880,
16,
2229,
2485,
33,
12443,
89,
11,
1299,
17,
5629,
2187,
389,
4714,
67,
15005,
3631,
3719,
30,
582,
8395,
1785,
353,
326,
1983,
589,
358,
326,
1058,
732... |
self._ts_get_available_actions(ts, {'status': 'assigned'})) | self._get_actions({'status': 'assigned'})) | def test_available_actions_full_perms(self): ts = TicketSystem(self.env) self.perm.grant_permission('anonymous', 'TICKET_CREATE') self.perm.grant_permission('anonymous', 'TICKET_MODIFY') self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'new'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'assigned'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'accepted'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'reopened'})) self.assertEqual(['leave', 'reopen'], self._ts_get_available_actions(ts, {'status': 'closed'})) | 54878a8763e661b4ad70d357c6059829cf444570 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9317/54878a8763e661b4ad70d357c6059829cf444570/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
2854,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
12160,
18,
16243,
67,
9827,
2668,
19070,
2187,
296,
56,
16656,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
2854,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
12160,
18,
16243,
67,
9827,
2668,
19070,
2187,
296,
56,
16656,
1... |
actiongroup_connected.get_action('SendFiles').set_property('short-label', '_Send...') | self.__actiongroup_connected.get_action('SendFiles').set_property('short-label', '_Send...') self.__actiongroup_connected.set_sensitive(False) self.__actiongroup.get_action("Disconnect").set_visible(False) | def __create_uimanager(self): ui = ''' <menubar name="MenuBar"> <menu action="File"> <menuitem action="Connect"/> <separator/> <menuitem action="Quit"/> </menu> <menu action="Device"> <menuitem action="CreateFolder"/> <menuitem action="SendFiles"/> <menuitem action="Delete"/> </menu> </menubar> <toolbar action="Toolbar"> <toolitem action="Connect"/> <separator/> <toolitem action="SendFiles"/> <toolitem action="Delete"/> </toolbar> ''' actiongroup = gtk.ActionGroup('MainActions') #TRANSLATE: see http://www.moeraki.com/pygtktutorial/pygtk2reference/class-gtkactiongroup.html#method-gtkactiongroup--set-translation-domain actiongroup.add_actions([('File', None, '_File'), ('Device', None, '_Device'), ('Connect', gtk.STOCK_CONNECT, '_Connect', None, 'Connect the device', self.connect_or_disconnect_device), ('Quit', gtk.STOCK_QUIT, '_Quit', None, 'Quit the Program', self.on_quit), ]) actiongroup_connected = gtk.ActionGroup('ActionConnected') actiongroup_connected.add_actions([('CreateFolder', None, '_Create folder...', None, 'Create a folder into the selected folder', self.on_create_folder), ('SendFiles', gtk.STOCK_OPEN, '_Send files to device...', '<Control>S', 'Pickup files to transfer into the device', self.on_send_files), ('Delete', gtk.STOCK_DELETE, '_Delete', 'Delete', 'Delete the selected objects from device', self.on_delete_files) ]) actiongroup_connected.get_action('SendFiles').set_property('short-label', '_Send...') uimanager = gtk.UIManager() uimanager.insert_action_group(actiongroup, 0) uimanager.insert_action_group(actiongroup_connected, 0) uimanager.add_ui_from_string(ui) self.window.add_accel_group(uimanager.get_accel_group()) self.__getWidget("vbox_Menu_And_ToolBar").pack_start(uimanager.get_widget('/MenuBar'), expand=False) self.__getWidget("vbox_Menu_And_ToolBar").pack_start(uimanager.get_widget('/Toolbar'), expand=False) | d382ec2a930240988ff9b57599420845a0b6f246 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2271/d382ec2a930240988ff9b57599420845a0b6f246/MTPnavigator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
89,
381,
1063,
12,
2890,
4672,
5915,
273,
9163,
411,
27617,
373,
297,
508,
1546,
4599,
5190,
6441,
411,
5414,
1301,
1546,
812,
6441,
411,
5414,
1726,
1301,
1546,
5215,
6,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2640,
67,
89,
381,
1063,
12,
2890,
4672,
5915,
273,
9163,
411,
27617,
373,
297,
508,
1546,
4599,
5190,
6441,
411,
5414,
1301,
1546,
812,
6441,
411,
5414,
1726,
1301,
1546,
5215,
6,... |
return highlight(source, lexers['none'], lfmter) | return '\\begin{Verbatim}[commandchars=@\\[\\]]\n' + \ escape_tex(source) + '\\end{Verbatim}\n' | def unhighlighted(): if self.dest == 'html': return '<pre>' + cgi.escape(source) + '</pre>\n' else: return highlight(source, lexers['none'], lfmter) | ec6d8993484c0137cea00272f4e4bd6d8a986208 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7032/ec6d8993484c0137cea00272f4e4bd6d8a986208/highlighting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
640,
15978,
329,
13332,
309,
365,
18,
10488,
422,
296,
2620,
4278,
327,
2368,
1484,
1870,
397,
276,
10052,
18,
6939,
12,
3168,
13,
397,
4357,
1484,
5333,
82,
11,
469,
30,
327,
8839,
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,
640,
15978,
329,
13332,
309,
365,
18,
10488,
422,
296,
2620,
4278,
327,
2368,
1484,
1870,
397,
276,
10052,
18,
6939,
12,
3168,
13,
397,
4357,
1484,
5333,
82,
11,
469,
30,
327,
8839,
12... |
case.user_id.address_id.email) or tools.config.get('email_from',False)}) | case.user_id.address_id.email and \ "%s <%s>" % (case.user_id.name, case.user_id.address_id.email)) or \ tools.config.get('email_from',False)}) | def default_get(self, cr, uid, fields, context=None): """ This function gets default values """ if not context: context = {} | 170bc320cc2ff1a86628679cd4a7c8ce38b047c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/170bc320cc2ff1a86628679cd4a7c8ce38b047c4/crm_send_email.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
33,
7036,
4672,
3536,
1220,
445,
5571,
805,
924,
3536,
309,
486,
819,
30,
819,
273,
2618,
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,
805,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
16,
819,
33,
7036,
4672,
3536,
1220,
445,
5571,
805,
924,
3536,
309,
486,
819,
30,
819,
273,
2618,
2,
-100,
-100,
-100,
-100,
-1... |
if exppart: expo = eval(exppart[1:]) | if exppart: expo = int(exppart[1:]) | def extract(s): res = decoder.match(s) if res is None: raise NotANumber, s sign, intpart, fraction, exppart = res.group(1,2,3,4) if sign == '+': sign = '' if fraction: fraction = fraction[1:] if exppart: expo = eval(exppart[1:]) else: expo = 0 return sign, intpart, fraction, expo | 2e42ce39be8b7def63d8ed779ca01e592e5d79cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2e42ce39be8b7def63d8ed779ca01e592e5d79cf/fpformat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
87,
4672,
400,
273,
8320,
18,
1916,
12,
87,
13,
309,
400,
353,
599,
30,
1002,
2288,
1258,
1226,
16,
272,
1573,
16,
509,
2680,
16,
8330,
16,
1329,
2680,
273,
400,
18,
1655,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
12,
87,
4672,
400,
273,
8320,
18,
1916,
12,
87,
13,
309,
400,
353,
599,
30,
1002,
2288,
1258,
1226,
16,
272,
1573,
16,
509,
2680,
16,
8330,
16,
1329,
2680,
273,
400,
18,
1655,
... |
- ``d`` - ``None``, a matrix, a list, or a tuple | - ``d`` - a matrix, a list, or a tuple (default: ``None``) | def state_array(self, d=None): """ Convert the parameter to a state array. INPUT: - ``d`` - ``None``, a matrix, a list, or a tuple EXAMPLES:: sage: sr = mq.SR(2, 2, 2, 4) sage: k = sr.base_ring() sage: e1 = [k.fetch_int(e) for e in range(2*2)]; e1 [0, 1, a, a + 1] sage: e2 = sr.phi( Matrix(k, 2*2, 1, e1) ) sage: sr.state_array(e1) # note the column major ordering [ 0 a] [ 1 a + 1] sage: sr.state_array(e2) [ 0 a] [ 1 a + 1] :: sage: sr.state_array() [0 0] [0 0] """ r = self.r c = self.c e = self.e k = self.base_ring() if d is None: return Matrix(k, r, c) if is_Matrix(d): if d.nrows() == r*c*e: return Matrix(k, c, r, self.antiphi(d)).transpose() elif d.ncols() == c and d.nrows() == r and d.base_ring() == k: return d if isinstance(d, tuple([list, tuple])): return Matrix(k, c, r, d).transpose() | 8851127220b91c29eb0dc162b4b9ae01cfac9a9f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/8851127220b91c29eb0dc162b4b9ae01cfac9a9f/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
1126,
12,
2890,
16,
302,
33,
7036,
4672,
3536,
4037,
326,
1569,
358,
279,
919,
526,
18,
225,
12943,
30,
282,
300,
225,
12176,
72,
10335,
300,
279,
3148,
16,
279,
666,
16,
57... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
919,
67,
1126,
12,
2890,
16,
302,
33,
7036,
4672,
3536,
4037,
326,
1569,
358,
279,
919,
526,
18,
225,
12943,
30,
282,
300,
225,
12176,
72,
10335,
300,
279,
3148,
16,
279,
666,
16,
57... |
value = central_authorizations(user_obj, perm) if not isinstance(value, bool): raise NotBooleanPermission("central_authorizations did not return a boolean value") | is_authorized = central_authorizations(user_obj, perm) if isinstance(is_authorized, bool): return is_authorized | def has_perm(self, user_obj, perm, obj=None): """ This method checks if the user_obj has perm on obj. Returns True or False Looks for the rule with the code_name = perm and the content_type of the obj If it exists returns the value of obj.field_name or obj.field_name() in case the field is a method. """ if obj is None: return False | a7d796e8765dc21870b569b0c6b59a07748fc5d6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14254/a7d796e8765dc21870b569b0c6b59a07748fc5d6/backends.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
12160,
12,
2890,
16,
729,
67,
2603,
16,
4641,
16,
1081,
33,
7036,
4672,
3536,
1220,
707,
4271,
309,
326,
729,
67,
2603,
711,
4641,
603,
1081,
18,
2860,
1053,
578,
1083,
10176,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
12160,
12,
2890,
16,
729,
67,
2603,
16,
4641,
16,
1081,
33,
7036,
4672,
3536,
1220,
707,
4271,
309,
326,
729,
67,
2603,
711,
4641,
603,
1081,
18,
2860,
1053,
578,
1083,
10176,... |
stop_thresh=0.5, N_connectivity=3): | low_thresh=0.5, high_thresh=1.5, N_connectivity=3, debug=0): | def region_grow(label_image, raw_image, ROI, roi_index, roi_inflate, stop_thresh=0.5, N_connectivity=3): """ region_grow(label_image, raw_image, ROI, roi_index, roi_inflate, stop_thresh) starting from a seed (masks or regions in the label_image) grow the regions based on (1) connectivity (2D or 3D) and (2) raw voxel values > stop threshold criterion. Parameters ---------- label_image : {nd_array} an image with labeled regions from get_blobs() method raw_image : {nd_array} raw image from which texture features get extracted ROI : {dictionary} Region of Interest structure that has blob bounding boxes. The largest 2D target bounding box is extracted. roi_index : {int} the single ROI element to apply region growing to. roi_inflate : {list} the maximum increase in the ROI bounding box. For 3D the tuple is [layers, rows, cols] and for 2D it is [rows, cols]. stop_thresh : {float} this is the percent of the voxel mean that the growing region must be greater than. region growing terminates when the raw_image is below this value. N_connectivity : {int} for growing this indicates how connected in a 3x3 or 3x3x3 window the un-labeled sample is. Make less than full connected for growing boundaries Returns ---------- updated_label_image : {nd_array} the label image with the selected ROi after region growing """ _c_ext_struct = NP.dtype([('Left', 'i'), ('Right', 'i'), ('Top', 'i'), ('Bottom', 'i'), ('Front', 'i'), ('Back', 'i'), ('Label', 'i'), ('Mass', 'i'), ('cX', 'f'), ('cY', 'f'), ('cZ', 'f')] ) expanded_ROI = NP.zeros(1, dtype=_c_ext_struct) dimensions = label_image.ndim if dimensions == 3: z_ext = roi_inflate[0] y_ext = roi_inflate[1] x_ext = roi_inflate[2] [layers, rows, cols] = label_image.shape updated_label_image = NP.zeros(layers*rows*cols, dtype=NP.int16).reshape(layers, rows, cols) updated_label_image = label_image.copy() else: y_ext = roi_inflate[0] x_ext = roi_inflate[1] [rows, cols] = label_image.shape updated_label_image = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) updated_label_image = label_image.copy() if dimensions == 2: left = ROI[roi_index]['Left']-x_ext right = ROI[roi_index]['Right']+x_ext bottom = ROI[roi_index]['Bottom']-y_ext top = ROI[roi_index]['Top']+y_ext Label = ROI[roi_index]['Label'] cutoff = stop_thresh * ROI[roi_index]['voxelMean'] if left < 0: left = 0 if bottom < 0: bottom = 0 if right > cols-1: right = cols-1 if top > rows-1: top = rows-1 expanded_ROI['Left'] = left expanded_ROI['Right'] = right expanded_ROI['Top'] = top expanded_ROI['Bottom'] = bottom expanded_ROI['Label'] = Label rows = top-bottom cols = right-left label = NP.zeros(rows*cols, dtype=NP.int16).reshape(rows, cols) section = NP.zeros(rows*cols, dtype=NP.float64).reshape(rows, cols) label = label_image[bottom:top, left:right].copy() section = (raw_image[bottom:top, left:right].astype(NP.float64)).copy() elif dimensions == 3: left = ROI[roi_index]['Left']-x_ext right = ROI[roi_index]['Right']+x_ext bottom = ROI[roi_index]['Bottom']-y_ext top = ROI[roi_index]['Top']+y_ext front = ROI[roi_index]['Front']-z_ext back = ROI[roi_index]['Back']+z_ext Label = ROI[roi_index]['Label'] cutoff = stop_thresh * ROI[roi_index]['voxelMean'] if left < 0: left = 0 if bottom < 0: bottom = 0 if right > cols-1: right = cols-1 if top > rows-1: top = rows-1 if front < 0: front = 0 if back > layers-1: back = layers-1 expanded_ROI['Left'] = left expanded_ROI['Right'] = right expanded_ROI['Top'] = top expanded_ROI['Bottom'] = bottom expanded_ROI['Back'] = back expanded_ROI['Front'] = front expanded_ROI['Label'] = Label rows = top-bottom cols = right-left layers = back-front label = NP.zeros(layers*rows*cols, dtype=NP.int16).reshape(layers, rows, cols) label = label_image[front:back, bottom:top, left:right].copy() section = NP.zeros(layers*rows*cols, dtype=NP.float64).reshape(layers, rows, cols) section = (raw_image[front:back, bottom:top, left:right].astype(NP.float64)).copy() # # this newgrow_ROI gets filled in and the label image is grown # newgrow_ROI = NP.zeros(1, dtype=_c_ext_struct) S.region_grow(section, label, expanded_ROI, newgrow_ROI, cutoff, Label, N_connectivity) if dimensions == 2: # adjust for delta window ROI[roi_index]['Left'] = newgrow_ROI['Left'] ROI[roi_index]['Right'] = newgrow_ROI['Right'] ROI[roi_index]['Top'] = newgrow_ROI['Top'] ROI[roi_index]['Bottom'] = newgrow_ROI['Bottom'] left = ROI[roi_index]['Left'] right = ROI[roi_index]['Right'] top = ROI[roi_index]['Top'] bottom = ROI[roi_index]['Bottom'] rows = top-bottom cols = right-left updated_label_image[bottom:top,left:right] = label[0:rows,0:cols] elif dimensions == 3: ROI[roi_index]['Left'] = newgrow_ROI['Left'] ROI[roi_index]['Right'] = newgrow_ROI['Right'] ROI[roi_index]['Top'] = newgrow_ROI['Top'] ROI[roi_index]['Bottom'] = newgrow_ROI['Bottom'] ROI[roi_index]['Front'] = newgrow_ROI['Front'] ROI[roi_index]['Back'] = newgrow_ROI['Back'] left = expanded_ROI['Left'] right = expanded_ROI['Right'] top = expanded_ROI['Top'] bottom = expanded_ROI['Bottom'] front = expanded_ROI['Front'] back = expanded_ROI['Back'] rows = top-bottom cols = right-left layers = back-front updated_label_image[front:back,bottom:top,left:right] = label[0:layers,0:rows,0:cols] return updated_label_image | aab765df487a57ee50c3db32eacf3c2df22c7e68 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/aab765df487a57ee50c3db32eacf3c2df22c7e68/_segmenter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
75,
492,
12,
1925,
67,
2730,
16,
1831,
67,
2730,
16,
6525,
45,
16,
25017,
67,
1615,
16,
25017,
67,
267,
2242,
340,
16,
4587,
67,
19237,
33,
20,
18,
25,
16,
3551,
67,
1923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3020,
67,
75,
492,
12,
1925,
67,
2730,
16,
1831,
67,
2730,
16,
6525,
45,
16,
25017,
67,
1615,
16,
25017,
67,
267,
2242,
340,
16,
4587,
67,
19237,
33,
20,
18,
25,
16,
3551,
67,
1923... |
if query_filter == None: | if str(query_filter) == None: | def __addQueryFilter(self, query_filter, eq): if query_filter == None: query_filter = eq else: query_filter = and_(query_filter, eq) return query_filter | 176751a2b7e208991250d37eb317088c7dba072e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/176751a2b7e208991250d37eb317088c7dba072e/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
1138,
1586,
12,
2890,
16,
843,
67,
2188,
16,
7555,
4672,
309,
609,
12,
2271,
67,
2188,
13,
422,
599,
30,
843,
67,
2188,
273,
7555,
469,
30,
843,
67,
2188,
273,
471,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
1138,
1586,
12,
2890,
16,
843,
67,
2188,
16,
7555,
4672,
309,
609,
12,
2271,
67,
2188,
13,
422,
599,
30,
843,
67,
2188,
273,
7555,
469,
30,
843,
67,
2188,
273,
471,
67,
... |
if len(self.races) > 0: logging.error("Found %i error reports" % len(self.races)) for report_list in self.races: | if len(self.reports) > 0: logging.error("Found %i error reports" % len(self.reports)) for report_list in self.reports: | def Report(self, check_sanity): sys.stdout.flush() #TODO(timurrrr): support positive tests / check_sanity==True | 3c013d85adbf98cad2aa5710b44488856eb85686 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/3c013d85adbf98cad2aa5710b44488856eb85686/drmemory_analyze.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8706,
12,
2890,
16,
866,
67,
87,
10417,
4672,
2589,
18,
10283,
18,
11330,
1435,
468,
6241,
12,
8584,
295,
523,
86,
4672,
2865,
6895,
7434,
342,
866,
67,
87,
10417,
631,
5510,
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,
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,
8706,
12,
2890,
16,
866,
67,
87,
10417,
4672,
2589,
18,
10283,
18,
11330,
1435,
468,
6241,
12,
8584,
295,
523,
86,
4672,
2865,
6895,
7434,
342,
866,
67,
87,
10417,
631,
5510,
2,
-100,
... |
el2 = etree.SubElement(el1, 'text:p', attrib={ | el2 = SubElement(el1, 'text:p', attrib={ | def depart_decoration(self, node): #global DEBUG #self.trace_depart_node(node) #DEBUG = 0 #ipshell('At depart_decoration') el = self.current_element.getchildren()[-1] self.current_element.remove(el) el1 = etree.Element('text:section', attrib={ 'text:name': '_rstFooterSection', }) el2 = etree.SubElement(el1, 'text:p', attrib={ 'text:style-name': 'rststyle-horizontalline'}) el1.append(el) self.footer_element = el1 | 277ba1af817dc725b8179dbbf649a815fdff5939 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/277ba1af817dc725b8179dbbf649a815fdff5939/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
11880,
367,
12,
2890,
16,
756,
4672,
468,
6347,
6369,
468,
2890,
18,
5129,
67,
323,
2680,
67,
2159,
12,
2159,
13,
468,
9394,
273,
374,
468,
625,
10304,
2668,
861,
26000,
67,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
11880,
367,
12,
2890,
16,
756,
4672,
468,
6347,
6369,
468,
2890,
18,
5129,
67,
323,
2680,
67,
2159,
12,
2159,
13,
468,
9394,
273,
374,
468,
625,
10304,
2668,
861,
26000,
67,... |
try: pp = r.parents(node) except: pp = [nullid, nullid] ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % ( i, r.start(i), r.length(i), r.base(i), r.linkrev(i), short(node), short(pp[0]), short(pp[1]))) | if format == 0: try: pp = r.parents(node) except: pp = [nullid, nullid] ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % ( i, r.start(i), r.length(i), r.base(i), r.linkrev(i), short(node), short(pp[0]), short(pp[1]))) elif format == 1: pr = r.parentrevs(i) ui.write("% 6d %04x % 8d % 8d % 8d % 6d % 6d % 6d % 6d %s\n" % ( i, r.flags(i), r.start(i), r.length(i), r.rawsize(i), r.base(i), r.linkrev(i), pr[0], pr[1], short(node))) | def debugindex(ui, repo, file_): """dump the contents of an index file""" r = None if repo: filelog = repo.file(file_) if len(filelog): r = filelog if not r: r = revlog.revlog(util.opener(os.getcwd(), audit=False), file_) ui.write(" rev offset length base linkrev" " nodeid p1 p2\n") for i in r: node = r.node(i) try: pp = r.parents(node) except: pp = [nullid, nullid] ui.write("% 6d % 9d % 7d % 6d % 7d %s %s %s\n" % ( i, r.start(i), r.length(i), r.base(i), r.linkrev(i), short(node), short(pp[0]), short(pp[1]))) | 4756b7a98999bf7d9bea711f5d9a93b82fb2025f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/4756b7a98999bf7d9bea711f5d9a93b82fb2025f/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
1615,
12,
4881,
16,
3538,
16,
585,
67,
4672,
3536,
8481,
326,
2939,
434,
392,
770,
585,
8395,
436,
273,
599,
309,
3538,
30,
661,
12970,
273,
3538,
18,
768,
12,
768,
67,
13,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
1615,
12,
4881,
16,
3538,
16,
585,
67,
4672,
3536,
8481,
326,
2939,
434,
392,
770,
585,
8395,
436,
273,
599,
309,
3538,
30,
661,
12970,
273,
3538,
18,
768,
12,
768,
67,
13,
309... |
if node['cols'] != 4: raise nodes.SkipNode | self.pep_table = node['cols'] == 4 | def visit_tgroup(self, node): if node['cols'] != 4: raise nodes.SkipNode self.entry = 0 | d726683036179809b4a2cc2e3671ee6e1ab075ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/d726683036179809b4a2cc2e3671ee6e1ab075ac/peps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
88,
1655,
12,
2890,
16,
756,
4672,
365,
18,
29363,
67,
2121,
273,
756,
3292,
6842,
3546,
422,
1059,
365,
18,
4099,
273,
374,
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,
3757,
67,
88,
1655,
12,
2890,
16,
756,
4672,
365,
18,
29363,
67,
2121,
273,
756,
3292,
6842,
3546,
422,
1059,
365,
18,
4099,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
label = TextRect( call_Expr(node_name, node) + name_suffix ) | label = DisplistChunk( TextRect( call_Expr(node_name, node) + name_suffix ) ) | def _C__delegate(self): # print "recomputing %r._delegate" % self # make sure this doesn't happen more often than the kidset changes -- not sure it'll work [seems to work] index = '_C__delegate' # compute the SimpleColumn expr we need (see comment above for why we need a mew one each time) kids = self.kids # usage tracked (that's important) assert not kids or type(list(kids)) == type([]) for kid in kids: # might be a legacy node or a new node (instance) assert not is_Expr(kid) or is_expr_Instance(kid) elts = map( _MT_try2_node_helper, kids) for elt in elts: # should be an expr (not instance) of _MT_try2_node_helper ##e remove when works, might not always be valid in future assert is_pure_expr(elt) expr = SimpleColumn(*elts) # [note: ok even when elts is empty, as of bugfix 061205 in SimpleColumn] if 1: # do we need to eval expr first? in theory i forget, but in practice this one evals to itself so it doesn't matter. ###k ##e do we need to discard usage tracking during the following?? res = self.Instance( expr, index, permit_expr_to_vary = True) ###IMPLEM permit_expr_to_vary return res | f4d0160248b4d41fcad1908a407becfeb288be00 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/f4d0160248b4d41fcad1908a407becfeb288be00/demo_MT.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
39,
972,
22216,
12,
2890,
4672,
468,
1172,
315,
266,
13406,
310,
738,
86,
6315,
22216,
6,
738,
365,
468,
1221,
3071,
333,
3302,
1404,
5865,
1898,
16337,
2353,
326,
17395,
542,
3478,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
39,
972,
22216,
12,
2890,
4672,
468,
1172,
315,
266,
13406,
310,
738,
86,
6315,
22216,
6,
738,
365,
468,
1221,
3071,
333,
3302,
1404,
5865,
1898,
16337,
2353,
326,
17395,
542,
3478,... |
for key, value in default_stop_words: | for key, value in default_stop_words.items(): | def __init__(self, index_dictionary = None, synstop = None): 'Create an inverted index' if (synstop is None): synstop = {} for key, value in default_stop_words: synstop[key] = value self.synstop = synstop | 808bcf50b7ef9713ece5d5d224b4f5d77c009e62 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/808bcf50b7ef9713ece5d5d224b4f5d77c009e62/InvertedIndex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
770,
67,
15556,
273,
599,
16,
6194,
5681,
273,
599,
4672,
296,
1684,
392,
18150,
770,
11,
309,
261,
11982,
5681,
353,
599,
4672,
6194,
5681,
273,
2618,
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,
1001,
2738,
972,
12,
2890,
16,
770,
67,
15556,
273,
599,
16,
6194,
5681,
273,
599,
4672,
296,
1684,
392,
18150,
770,
11,
309,
261,
11982,
5681,
353,
599,
4672,
6194,
5681,
273,
2618,
3... |
if milestone.has_key('date'): write_date('DTSTART', localtime(milestone['due'])) | write_date('DTSTART', localtime(milestone['due'])) | def write_utctime(name, value, params={}): write_prop(name, strftime('%Y%m%dT%H%M%SZ', value), params) | 9edd7fd8b100b8c6536275bdaf0db36ea27b62c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/9edd7fd8b100b8c6536275bdaf0db36ea27b62c5/Roadmap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1045,
67,
322,
21261,
12,
529,
16,
460,
16,
859,
12938,
4672,
1045,
67,
5986,
12,
529,
16,
10405,
29909,
61,
9,
81,
9,
23148,
9,
44,
9,
49,
9,
28830,
2187,
460,
3631,
859,
13,
2,
... |
verify(v3.func_code.co_varnames == ('a', '.2', 'rest', 'b', 'c')) | if sys.platform.startswith('java'): verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c')) else: verify(v3.func_code.co_varnames == ('a', '.2', 'rest', 'b', 'c')) | def v3(a, (b, c), *rest): return a, b, c, rest | bf3fa7b64c1804fdf2181e6768aba7e5324b9339 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/bf3fa7b64c1804fdf2181e6768aba7e5324b9339/test_grammar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
331,
23,
12,
69,
16,
261,
70,
16,
276,
3631,
380,
8792,
4672,
327,
279,
16,
324,
16,
276,
16,
3127,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
331,
23,
12,
69,
16,
261,
70,
16,
276,
3631,
380,
8792,
4672,
327,
279,
16,
324,
16,
276,
16,
3127,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
["<a href=\"http://bugs.debian.org/%s\"> | ["<a href=\"http://bugs.debian.org/%s\"> | def should_upgrade_src(self, src, suite): """Check if source package should be upgraded | 177c8f5fc4a4babd57ce8f0e7b6e6203c847dd07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2784/177c8f5fc4a4babd57ce8f0e7b6e6203c847dd07/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
67,
15097,
67,
4816,
12,
2890,
16,
1705,
16,
11371,
4672,
3536,
1564,
309,
1084,
2181,
1410,
506,
31049,
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,
1410,
67,
15097,
67,
4816,
12,
2890,
16,
1705,
16,
11371,
4672,
3536,
1564,
309,
1084,
2181,
1410,
506,
31049,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context) | self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context) | def export_cal(self, cr, uid, ids, vobj='vevent', context=None): """ Export Calendar @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param ids: List of calendar’s IDs @param context: A standard dictionary for contextual values """ if not context: context = {} ctx_model = context.get('model', None) ctx_res_id = context.get('res_id', None) ical = vobject.iCalendar() for cal in self.browse(cr, uid, ids): for line in cal.line_ids: if ctx_model and ctx_model != line.object_id.model: continue if line.name in ('valarm', 'attendee'): continue domain = eval(line.domain) if ctx_res_id: domain += [('id','=',ctx_res_id)] mod_obj = self.pool.get(line.object_id.model) data_ids = mod_obj.search(cr, uid, domain, context=context) datas = mod_obj.read(cr, uid, data_ids, context=context) context.update({'model': line.object_id.model, 'calendar_id': cal.id }) self.__attribute__ = get_attribute_mapping(cr, uid, line.name, context) self.create_ics(cr, uid, datas, line.name, ical, context=context) return ical.serialize() | 1263dd94aec18dc93f2c1301bed8d5db4810ef61 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1263dd94aec18dc93f2c1301bed8d5db4810ef61/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
331,
2603,
2218,
537,
616,
2187,
819,
33,
7036,
4672,
3536,
11054,
5542,
632,
891,
365,
30,
1021,
733,
4407,
632,
891,
4422,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
331,
2603,
2218,
537,
616,
2187,
819,
33,
7036,
4672,
3536,
11054,
5542,
632,
891,
365,
30,
1021,
733,
4407,
632,
891,
4422,
... |
cty.c_int, [Window, STRING], | cty.c_int, [Window, STRING], | def fl_newpup(win): """ fl_newpup(win) -> num. """ retval = _fl_newpup(win) return retval | 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,
1183,
67,
2704,
84,
416,
12,
8082,
4672,
3536,
1183,
67,
2704,
84,
416,
12,
8082,
13,
317,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
2704,
84,
416,
12,
8082,
13,
327,
5221,
282,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
2704,
84,
416,
12,
8082,
4672,
3536,
1183,
67,
2704,
84,
416,
12,
8082,
13,
317,
818,
18,
3536,
225,
5221,
273,
389,
2242,
67,
2704,
84,
416,
12,
8082,
13,
327,
5221,
282,
... |
from sage.groups.perm_gps.permgroup import PermutationGroup from sage.interfaces.all import gap gap.eval("l:=One(Rationals)") cmd = 'G:=Group(%s);'%words phi = gap.eval(cmd+"hom:=EpimorphismFromFreeGroup(G)") sol = str(gap.eval("ans:=PreImagesRepresentative(hom,%s)"%gap(g))) | sol = leg[1].word_problem(words, False)[0] | def solve(self,state): """ Solves the cube in the \code{state}, given as a dictionary as in \code{legal}. This uses GAP's \code{EpimorphismFromFreeGroup} and \code{PreImagesRepresentative}. EXAMPLES: sage: rubik = CubeGroup() sage: R_state = rubik.faces("R") sage: b = rubik.B() sage: d = rubik.D() sage: f = rubik.F() sage: l = rubik.L() sage: r = rubik.R() sage: u = rubik.U() sage: rubik.solve(R_state) ## time-consuming 'R' | 59103a11794caa9bbdc12cea7de7561675331351 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/59103a11794caa9bbdc12cea7de7561675331351/cubegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
2890,
16,
2019,
4672,
3536,
348,
355,
3324,
326,
18324,
316,
326,
521,
710,
95,
2019,
5779,
864,
487,
279,
3880,
487,
316,
521,
710,
95,
2013,
5496,
225,
1220,
4692,
611,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12439,
12,
2890,
16,
2019,
4672,
3536,
348,
355,
3324,
326,
18324,
316,
326,
521,
710,
95,
2019,
5779,
864,
487,
279,
3880,
487,
316,
521,
710,
95,
2013,
5496,
225,
1220,
4692,
611,
22... |
f = PDBFile( fname, mode='w' ) | f = IO.PDBFile( fname, mode='w' ) | def writePdb( self, fname, ter=1, amber=0, original=0, left=0, wrap=0, headlines=None, taillines=None): """ Save model as PDB file. | 2efe58e8c6f02909b5e16f2bfb06f031f73915dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/482/2efe58e8c6f02909b5e16f2bfb06f031f73915dd/PDBModel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
52,
1966,
12,
365,
16,
5299,
16,
19272,
33,
21,
16,
2125,
744,
33,
20,
16,
2282,
33,
20,
16,
2002,
33,
20,
16,
2193,
33,
20,
16,
910,
3548,
33,
7036,
16,
5798,
3548,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1045,
52,
1966,
12,
365,
16,
5299,
16,
19272,
33,
21,
16,
2125,
744,
33,
20,
16,
2282,
33,
20,
16,
2002,
33,
20,
16,
2193,
33,
20,
16,
910,
3548,
33,
7036,
16,
5798,
3548,
33,
70... |
def accept (self): | def accept(self): | def accept (self): # XXX can return either an address pair or None try: conn, addr = self.socket.accept() return conn, addr except socket.error, why: if why[0] == EWOULDBLOCK: pass else: raise socket.error, why | 79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
4672,
468,
11329,
848,
327,
3344,
392,
1758,
3082,
578,
599,
775,
30,
1487,
16,
3091,
273,
365,
18,
7814,
18,
9436,
1435,
327,
1487,
16,
3091,
1335,
2987,
18,
1636,
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,
2791,
12,
2890,
4672,
468,
11329,
848,
327,
3344,
392,
1758,
3082,
578,
599,
775,
30,
1487,
16,
3091,
273,
365,
18,
7814,
18,
9436,
1435,
327,
1487,
16,
3091,
1335,
2987,
18,
1636,
16,... |
if match: page = geturl(url=match) soup = BeautifulSoup(page) else: return 'Multiple results found: %s' % ', '.join(results) | if match is None: match = results[0][1] page = geturl(url=match, referer=self.search) soup = BeautifulSoup(page) | def forecast(self, location): page = geturl(url=self.search, opts={'query': location}, referer=self.baseurl) soup = BeautifulSoup(page) | 19e4c29ac356a309e2f1f1a0f148c48fef3860c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10942/19e4c29ac356a309e2f1f1a0f148c48fef3860c4/weather.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18763,
12,
2890,
16,
2117,
4672,
1363,
273,
336,
718,
12,
718,
33,
2890,
18,
3072,
16,
1500,
5899,
11,
2271,
4278,
2117,
5779,
18068,
33,
2890,
18,
1969,
718,
13,
15418,
273,
28132,
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,
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,
18763,
12,
2890,
16,
2117,
4672,
1363,
273,
336,
718,
12,
718,
33,
2890,
18,
3072,
16,
1500,
5899,
11,
2271,
4278,
2117,
5779,
18068,
33,
2890,
18,
1969,
718,
13,
15418,
273,
28132,
12... |
self.index = npy.asarray(mask, bool) | self.index = np.asarray(mask, bool) | def __init__(self, indices=None, mask=None): """Constrain chosen atoms. | 56bb90af6cdb34a67cf793d22cfe7c3089a8af39 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/56bb90af6cdb34a67cf793d22cfe7c3089a8af39/constraints.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4295,
33,
7036,
16,
3066,
33,
7036,
4672,
3536,
442,
27568,
10447,
9006,
18,
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,
1001,
2738,
972,
12,
2890,
16,
4295,
33,
7036,
16,
3066,
33,
7036,
4672,
3536,
442,
27568,
10447,
9006,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
gLogger.debug(infoStr) | gLogger.debug( infoStr ) | def removeFile(self,path): """Remove physically the file specified by its path """ res = self.checkArgumentFormat(path) if not res['OK']: return res urls = res['Value'] gLogger.debug("SRM2Storage.removeFile: Performing the removal of %s file(s)" % len(urls)) resDict = self.__gfaldeletesurls_wrapper(urls)['Value'] failed = resDict['Failed'] allResults = resDict['AllResults'] successful = {} for urlDict in allResults: if urlDict.has_key('surl') and urlDict['surl']: pathSURL = self.getUrl(urlDict['surl'])['Value'] if urlDict['status'] == 0: infoStr = 'SRM2Storage.removeFile: Successfully removed file: %s' % pathSURL gLogger.debug(infoStr) successful[pathSURL] = True elif urlDict['status'] == 2: # This is the case where the file doesn't exist. infoStr = 'SRM2Storage.removeFile: File did not exist, sucessfully removed: %s' % pathSURL gLogger.debug(infoStr) successful[pathSURL] = True else: errStr = "SRM2Storage.removeFile: Failed to remove file." errMessage = urlDict['ErrorMessage'] gLogger.error(errStr,"%s: %s" % (pathSURL,errMessage)) failed[pathSURL] = "%s %s" % (errStr,errMessage) resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
812,
12,
2890,
16,
803,
4672,
3536,
3288,
24758,
6478,
326,
585,
1269,
635,
2097,
589,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
486,
400,
3292,
3141,
3546,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
812,
12,
2890,
16,
803,
4672,
3536,
3288,
24758,
6478,
326,
585,
1269,
635,
2097,
589,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
486,
400,
3292,
3141,
3546,
30... |
if context.method is None: method = handler.get_method(request.method) | method_name = context.method if method_name is None: method_name = request.method try: getattr(handler, method_name) except AttributeError: response.set_status(404) method = root.not_found | def handle_request(connection, server): # Build the request object resource = File(connection) try: request = Request(resource) except BadRequest, exception: request = None request_line = exception.args[0] else: # Keep here (though redundant) to be used later in the access log request_line = request.state.request_line if request is None: # Build response for the 400 error response = Response(status_code=400) response.set_body('Bad Request') # Access Log content_length = response.get_content_length() server.log_access(connection, request_line, 400, content_length) # Send response response = response.to_str() connection.send(response) return # Build and set the context context = Context(request) set_context(context) # Get the root handler root = server.pool.pop() context.root = root # Authenticate cname = '__ac' cookie = context.get_cookie(cname) if cookie is not None: cookie = unquote(cookie) cookie = decodestring(cookie) username, password = cookie.split(':', 1) try: user = root.get_handler('users/%s' % username) except LookupError: pass except: server.log_error() else: if user.authenticate(password): context.user = user user = context.user # Hook (used to set the language) try: root.before_traverse() except: server.log_error() response = context.response # Traverse try: handler = root.get_handler(context.path) except LookupError: # Not Found (response code 404) response.set_status(404) method = root.not_found context.handler = root except: server.log_error() # Internal Server Error (500) response.set_status(500) method = root.internal_server_error else: context.handler = handler # Get the method if context.method is None: method = handler.get_method(request.method) else: method = handler.get_method(context.method) # Check security if method is None: if user is None: # Unauthorized (401) method = root.login_form else: # Forbidden (403) method = root.forbidden # Set the list of needed resources. The method we are going to # call may need external resources to be rendered properly, for # example it could need an style sheet or a javascript file to # be included in the html head (which it can not control). This # attribute lets the interface to add those resources. context.styles = [] context.scripts = [] # Get the transaction object transaction = transactions.get_transaction() try: # Call the method if method.im_func.func_code.co_flags & 8: response_body = method(**request.form) else: response_body = method() except UserError, exception: # Redirection transaction.rollback() goto = copy(request.referrer) goto.query['message'] = exception.args[0].encode('utf8') context.redirect(goto) response_body = None except Forbidden: transaction.rollback() if user is None: # Unauthorized (401) response_body = root.login_form() else: # Forbidden (403) response_body = root.forbidden() except: server.log_error() transaction.rollback() response_body = root.internal_server_error() else: # Save changes transaction.commit(user and user.name or 'NONE', str(request.path)) # Set the response body response.set_body(response_body) # After traverse hook try: root.after_traverse() except: response.set_status(500) body = root.internal_server_error() response.set_body(body) server.log_error() # Free the root object server.pool.push(root) # Access Log server.log_access(connection, request_line, response.state.status, response.get_content_length()) # Finish, send back the response response = response.to_str() connection.send(response) connection.close() | 0c295710429a33ecb8a695a40f7491d8a7828f7b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/0c295710429a33ecb8a695a40f7491d8a7828f7b/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
4071,
16,
1438,
4672,
468,
3998,
326,
590,
733,
1058,
273,
1387,
12,
4071,
13,
775,
30,
590,
273,
1567,
12,
3146,
13,
1335,
23223,
16,
1520,
30,
590,
273,
599,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
2293,
12,
4071,
16,
1438,
4672,
468,
3998,
326,
590,
733,
1058,
273,
1387,
12,
4071,
13,
775,
30,
590,
273,
1567,
12,
3146,
13,
1335,
23223,
16,
1520,
30,
590,
273,
599,
59... |
self.log.debug('Current proxy found to be valid for %s seconds' %proxyValidity) | def __getProdProxy(self,prodDN): """This method sets up the proxy for immediate use if not available, and checks the existing proxy if this is available. """ prodGroup = gConfig.getValue(self.section+'/ProductionGroup','lhcb_prod') self.log.info("Determining the length of proxy for DN %s" %prodDN) obtainProxy = False if not os.path.exists(self.proxyLocation): self.log.info("No proxy found") obtainProxy = True else: currentProxy = open(self.proxyLocation,'r') oldProxyStr = currentProxy.read() res = getProxyTimeLeft(oldProxyStr) if not res["OK"]: self.log.error("Could not determine the time left for proxy", res['Message']) res = S_OK(0) # force update of proxy | 283550e5e334af3f917fd0138553dfb987ecc7e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/283550e5e334af3f917fd0138553dfb987ecc7e4/StagerAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
30683,
3886,
12,
2890,
16,
17672,
8609,
4672,
3536,
2503,
707,
1678,
731,
326,
2889,
364,
14483,
999,
309,
486,
2319,
16,
471,
4271,
326,
2062,
2889,
309,
333,
353,
2319,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
30683,
3886,
12,
2890,
16,
17672,
8609,
4672,
3536,
2503,
707,
1678,
731,
326,
2889,
364,
14483,
999,
309,
486,
2319,
16,
471,
4271,
326,
2062,
2889,
309,
333,
353,
2319,
18,
... | |
for i in iselection: if (i.size() == 0): raise Sorry("No atom selected: %s" % show_string(atom_sel)) for atom in i: | for i, i_sel in enumerate(iselection): if (i_sel.size() == 0): raise Sorry("No atom selected: %s" % show_string(atom_sel[i])) for atom in i_sel: | def phil_atom_selections_as_i_seqs_multiple(self, cache, scope_extract, sel_attrs): result = [] for attr in sel_attrs: iselection = self.phil_atom_selection_multiple( cache=cache, scope_extract=scope_extract, attr=attr, raise_if_empty_selection=False) atom_sel = getattr(scope_extract, attr) for i in iselection: if (i.size() == 0): raise Sorry("No atom selected: %s" % show_string(atom_sel)) for atom in i: result.append(atom) return result | 3309880002eb93f23cdd2257cfffe9bba7b8d86d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/3309880002eb93f23cdd2257cfffe9bba7b8d86d/pdb_interpretation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1844,
330,
67,
7466,
67,
10705,
87,
67,
345,
67,
77,
67,
22437,
67,
9622,
12,
2890,
16,
1247,
16,
2146,
67,
8004,
16,
357,
67,
7039,
4672,
563,
273,
5378,
364,
1604,
316,
357,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1844,
330,
67,
7466,
67,
10705,
87,
67,
345,
67,
77,
67,
22437,
67,
9622,
12,
2890,
16,
1247,
16,
2146,
67,
8004,
16,
357,
67,
7039,
4672,
563,
273,
5378,
364,
1604,
316,
357,
67,
... |
countryname = "Unknown" | if value: countryname = "Unknown (%s)" % (value) else: countryname = "World" | def OnTooltip(self, widget, x, y, keyboard_mode, tooltip): try: (incorrectpath, column, cx, cy) = widget.get_path_at_pos(x, y) # the returned path is not correct since it calculates it pretending there's no header! (path, droppos) = widget.get_dest_row_at_pos(x, y) # the return path of this func is okay, but we also need to column name -_- except TypeError: # Either function returned None return False title = column.get_title() if (title != "Country"): return False model = widget.get_model() iter = model.get_iter(path) value = model.get_value(iter, 8) if not value.startswith('flag_'): tooltip.set_text(_("Unknown")) return True value = value[5:] print "Looking up %s" % (value,) countryname = code2name(value) if not countryname: countryname = "Unknown" tooltip.set_text(_(countryname)) return True | 6f144e3a7bcbbccc42fc8fff8eb40ee70a52f0f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/6f144e3a7bcbbccc42fc8fff8eb40ee70a52f0f6/chatrooms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
22444,
12,
2890,
16,
3604,
16,
619,
16,
677,
16,
16263,
67,
3188,
16,
11915,
4672,
775,
30,
261,
267,
6746,
803,
16,
1057,
16,
9494,
16,
6143,
13,
273,
3604,
18,
588,
67,
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,
2755,
22444,
12,
2890,
16,
3604,
16,
619,
16,
677,
16,
16263,
67,
3188,
16,
11915,
4672,
775,
30,
261,
267,
6746,
803,
16,
1057,
16,
9494,
16,
6143,
13,
273,
3604,
18,
588,
67,
803,
... |
win.simulationMenu.addSeparator() | def setupUi(win): """ Populates the "Simulation" menu (incuding its "Measurement" submenu) which appears in the main window menu bar. @param win: NE1's main window object. @type win: Ui_MainWindow """ # Populate the "Measurements" submenu. win.measurementsMenu.addAction(win.jigsThermoAction) win.measurementsMenu.addAction(win.jigsDistanceAction) win.measurementsMenu.addAction(win.jigsAngleAction) win.measurementsMenu.addAction(win.jigsDihedralAction) # Populate the "Simulation" menu. win.simulationMenu.addAction(win.simSetupAction) # "Run Dynamics" win.simulationMenu.addAction(win.simMoviePlayerAction) # "Play Movie" win.simulationMenu.addSeparator() win.simulationMenu.addAction(win.jigsMotorAction) win.simulationMenu.addAction(win.jigsLinearMotorAction) win.simulationMenu.addAction(win.jigsAnchorAction) win.simulationMenu.addAction(win.jigsStatAction) win.simulationMenu.addAction(win.jigsThermoAction) win.simulationMenu.addSeparator() win.simulationMenu.addAction(win.simNanoHiveAction) #NOTE: The GAMESS and ESPImage options are intentionally disabled #Disabling these items from the UI was a rattlesnake backlog item. #see this page for details: #U{<http://www.nanoengineer-1.net/mediawiki/index.php?title=Rattlesnake_Sprint_Backlog>} #See also: UserPrefs.py _hideOrShowTheseWidgetsInUserPreferenceDialog method #where the widgets in the UserPrefernces dialog corresponding to these actions #are hidden. if debug_pref("Show GAMESS and ESP Image UI options", Choice_boolean_False, prefs_key = True): win.simulationMenu.addAction(win.jigsGamessAction) # GAMESS win.simulationMenu.addAction(win.jigsESPImageAction) # ESP Image | 468a74b549faf7597f430ed5fb5f6b9acf218602 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/468a74b549faf7597f430ed5fb5f6b9acf218602/Ui_SimulationMenu.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
8082,
4672,
3536,
10264,
17099,
326,
315,
18419,
6,
3824,
261,
9523,
12673,
2097,
315,
17933,
6,
27539,
13,
1492,
14606,
316,
326,
2774,
2742,
3824,
4653,
18,
225,
632,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
8082,
4672,
3536,
10264,
17099,
326,
315,
18419,
6,
3824,
261,
9523,
12673,
2097,
315,
17933,
6,
27539,
13,
1492,
14606,
316,
326,
2774,
2742,
3824,
4653,
18,
225,
632,
... | |
def analyzeAPI(): | def analyzeAPITop(): | def analyzeAPI(): global wordsDict try: doc = loadAPI(API) ret = analyzeAPI(doc) print "Analyzed %d blocs" % (ret) doc.freeDoc() except: print "Failed to parse and analyze %s" % (API) print sys.exc_type, sys.exc_value sys.exit(1) print "Indexed %d words" % (len(wordsDict)) i = 0 skipped = 0 for word in wordsDict.keys(): refs = wordsDict[word] if refs == None: skipped = skipped + 1 continue; for (module, symbol) in refs.keys(): updateWord(word, symbol, refs[(module, symbol)]) i = i + 1 print "Found %d associations, skipped %d words" % (i, skipped) | 321be0c5bf7b74a3f5a21434ab2ad656b899bc11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12659/321be0c5bf7b74a3f5a21434ab2ad656b899bc11/index.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
2557,
3401,
13332,
2552,
4511,
5014,
225,
775,
30,
997,
273,
1262,
2557,
12,
2557,
13,
325,
273,
12375,
2557,
12,
2434,
13,
1172,
315,
979,
18409,
738,
72,
324,
24323,
6,
738,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
2557,
3401,
13332,
2552,
4511,
5014,
225,
775,
30,
997,
273,
1262,
2557,
12,
2557,
13,
325,
273,
12375,
2557,
12,
2434,
13,
1172,
315,
979,
18409,
738,
72,
324,
24323,
6,
738,
2... |
def son1_item_event(self, widget, event=None): | self.gcomprisBoard.level=level; self.gcomprisBoard.sublevel=1; self.cleanup() self.display_current_level() def increment_level(self): self.gcomprisBoard.sublevel += 1 if(self.gcomprisBoard.sublevel>self.gcomprisBoard.number_of_sublevel): self.gcomprisBoard.sublevel=1 self.gcomprisBoard.level += 1 if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel): gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM) return 0 return 1 def sound_item_event(self, widget, event, sound_struct): if self.board_paused: return | def set_level(self, level): print("Gcompris_melody set level. %i" % level) | d0b9a61ff7e201727e6e488e54d1db34d86881e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/d0b9a61ff7e201727e6e488e54d1db34d86881e4/melody.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2815,
12,
2890,
16,
1801,
4672,
1172,
2932,
43,
832,
683,
291,
67,
81,
292,
973,
444,
1801,
18,
738,
77,
6,
738,
1801,
13,
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,
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,
444,
67,
2815,
12,
2890,
16,
1801,
4672,
1172,
2932,
43,
832,
683,
291,
67,
81,
292,
973,
444,
1801,
18,
738,
77,
6,
738,
1801,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.LOG.debug('"%s" resolved to "%s"' % (item.path, realpath)) | self.LOG.debug('Item path "%s" resolved to "%s"' % (item.path, realpath)) | def mainloop(self): """ The main loop. """ # Print usage if not enough args if len(self.args) < 2: self.parser.print_help() self.parser.exit() | 7be5c896b244abd96852611847844ab3d05894ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4865/7be5c896b244abd96852611847844ab3d05894ff/rtmv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
6498,
12,
2890,
4672,
3536,
1021,
2774,
2798,
18,
3536,
468,
3038,
4084,
309,
486,
7304,
833,
309,
562,
12,
2890,
18,
1968,
13,
411,
576,
30,
365,
18,
4288,
18,
1188,
67,
5201,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2774,
6498,
12,
2890,
4672,
3536,
1021,
2774,
2798,
18,
3536,
468,
3038,
4084,
309,
486,
7304,
833,
309,
562,
12,
2890,
18,
1968,
13,
411,
576,
30,
365,
18,
4288,
18,
1188,
67,
5201,
... |
r.geometry( "sphere", {}, {} ) | r.geometry( "sphere", {}, { "red" : PrimitiveVariable( PrimitiveVariable.Interpolation.Constant, FloatData( 0 ) ), "green" : PrimitiveVariable( PrimitiveVariable.Interpolation.Constant, FloatData( 1 ) ), "blue" : PrimitiveVariable( PrimitiveVariable.Interpolation.Constant, FloatData( 0 ) ), } ) | def testPrimVars( self ) : r = Renderer() r.setOption( "gl:mode", StringData( "deferred" ) ) r.setOption( "gl:searchPath:shader", StringData( os.path.dirname( __file__ ) + "/shaders" ) ) r.worldBegin() #w = SceneViewer( "scene", r.scene() ) r.shader( "surface", "rgbColor", { "red" : FloatData( 1 ), "green" : FloatData( 0 ), "blue" : FloatData( 0 ) } ) r.concatTransform( M44f.createTranslated( V3f( 0, 0, -5 ) ) ) r.attributeBegin() | 686f08c6e1e459dbc1884fe646a6bd99017df827 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9042/686f08c6e1e459dbc1884fe646a6bd99017df827/Renderer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2050,
381,
5555,
12,
365,
262,
294,
225,
436,
273,
17589,
1435,
436,
18,
542,
1895,
12,
315,
7043,
30,
3188,
3113,
514,
751,
12,
315,
26622,
6,
262,
262,
436,
18,
542,
1895,
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,
1842,
2050,
381,
5555,
12,
365,
262,
294,
225,
436,
273,
17589,
1435,
436,
18,
542,
1895,
12,
315,
7043,
30,
3188,
3113,
514,
751,
12,
315,
26622,
6,
262,
262,
436,
18,
542,
1895,
12... |
else: p = "%s-ast.c" % mod.name f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' print >> f, ' print >> f print >>f, "static PyTypeObject* AST_type;" v = ChainOfVisitors( PyTypesDeclareVisitor(f), PyTypesVisitor(f), FunctionVisitor(f), ObjVisitor(f), ASTModuleVisitor(f), PartingShots(f), ) v.visit(mod) f.close() | f = open(p, "wb") print >> f, auto_gen_msg print >> f, ' print >> f, ' print >> f print >>f, "static PyTypeObject* AST_type;" v = ChainOfVisitors( PyTypesDeclareVisitor(f), PyTypesVisitor(f), FunctionVisitor(f), ObjVisitor(f), ASTModuleVisitor(f), PartingShots(f), ) v.visit(mod) f.close() | def main(srcfile): argv0 = sys.argv[0] components = argv0.split(os.sep) argv0 = os.sep.join(components[-2:]) auto_gen_msg = '/* File automatically generated by %s */\n' % argv0 mod = asdl.parse(srcfile) if not asdl.check(mod): sys.exit(1) if INC_DIR: p = "%s/%s-ast.h" % (INC_DIR, mod.name) else: p = "%s-ast.h" % mod.name f = open(p, "wb") print >> f, auto_gen_msg print >> f, '#include "asdl.h"\n' c = ChainOfVisitors(TypeDefVisitor(f), StructVisitor(f), PrototypeVisitor(f), ) c.visit(mod) print >>f, "PyObject* PyAST_mod2obj(mod_ty t);" f.close() if SRC_DIR: p = os.path.join(SRC_DIR, str(mod.name) + "-ast.c") else: p = "%s-ast.c" % mod.name f = open(p, "wb") print >> f, auto_gen_msg print >> f, '#include "Python.h"' print >> f, '#include "%s-ast.h"' % mod.name print >> f print >>f, "static PyTypeObject* AST_type;" v = ChainOfVisitors( PyTypesDeclareVisitor(f), PyTypesVisitor(f), FunctionVisitor(f), ObjVisitor(f), ASTModuleVisitor(f), PartingShots(f), ) v.visit(mod) f.close() | a16b1f8b52e596b5c88789d7be3825bc42ce64ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a16b1f8b52e596b5c88789d7be3825bc42ce64ad/asdl_c.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
4816,
768,
4672,
5261,
20,
273,
2589,
18,
19485,
63,
20,
65,
4085,
273,
5261,
20,
18,
4939,
12,
538,
18,
10814,
13,
5261,
20,
273,
1140,
18,
10814,
18,
5701,
12,
8119,
1891... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4816,
768,
4672,
5261,
20,
273,
2589,
18,
19485,
63,
20,
65,
4085,
273,
5261,
20,
18,
4939,
12,
538,
18,
10814,
13,
5261,
20,
273,
1140,
18,
10814,
18,
5701,
12,
8119,
1891... |
styles.stylize(styles.ST_INFO, '*'), mytime(), mesg)), | stylize(ST_INFO, '*'), mytime(), mesg)), | def notice(mesg, listener=None): """ Display a non-styles.stylized notice message on stderr.""" assert ltrace('logging', '| notice(%s L%s/R%s)' % (verbose.NOTICE, options.verbose, listener.verbose if listener else '-')) if listener and listener.verbose >= verbose.NOTICE: listener.process(LicornMessage(data=" %s %s %s\n" % ( styles.stylize(styles.ST_INFO, '*'), mytime(), mesg)), options.msgproc.getProxy()) if options.verbose >= verbose.NOTICE: sys.stderr.write(" %s %s %s\n" % ( styles.stylize(styles.ST_INFO, '*'), mytime(), mesg)) | a4712f82b2f0d14c0f1c465fc523b05667dfb57d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/a4712f82b2f0d14c0f1c465fc523b05667dfb57d/logging.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11690,
12,
26244,
75,
16,
2991,
33,
7036,
4672,
3536,
9311,
279,
1661,
17,
10218,
18,
334,
93,
80,
1235,
11690,
883,
603,
4514,
12123,
1815,
328,
5129,
2668,
11167,
2187,
6699,
11690,
92... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11690,
12,
26244,
75,
16,
2991,
33,
7036,
4672,
3536,
9311,
279,
1661,
17,
10218,
18,
334,
93,
80,
1235,
11690,
883,
603,
4514,
12123,
1815,
328,
5129,
2668,
11167,
2187,
6699,
11690,
92... |
self.driver.Delete( new_filename ) | if gdal.GetConfigOption( 'CPL_DEBUG', 'OFF' ) != 'ON': self.driver.Delete( new_filename ) | def testSetNoDataValue(self): | ae1760ad3431993c029a613974b0e9e98f40041b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10290/ae1760ad3431993c029a613974b0e9e98f40041b/gdaltest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
694,
2279,
28013,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
1842,
694,
2279,
28013,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if data: write(data) if not headers_sent: | towrite.append(data) if sum(map(len, towrite)) >= self.minimum_chunk_size: write(''.join(towrite)) towrite = [] if towrite: write(''.join(towrite)) if not headers_sent or use_chunked[0]: | def start_response(status, response_headers, exc_info=None): status_code[0] = status.split()[0] if exc_info: try: if headers_sent: # Re-raise original exception if headers sent raise exc_info[0], exc_info[1], exc_info[2] finally: # Avoid dangling circular ref exc_info = None | e563e5bd9ec98472013c20d498864b35060c9cfe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10078/e563e5bd9ec98472013c20d498864b35060c9cfe/wsgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
2740,
12,
2327,
16,
766,
67,
2485,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
63,
20,
65,
273,
1267,
18,
4939,
1435,
63,
20,
65,
309,
3533,
67,
1376,
30,
775,
30,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
67,
2740,
12,
2327,
16,
766,
67,
2485,
16,
3533,
67,
1376,
33,
7036,
4672,
1267,
67,
710,
63,
20,
65,
273,
1267,
18,
4939,
1435,
63,
20,
65,
309,
3533,
67,
1376,
30,
775,
30,
... |
im.weight(type='briggs',rmode='norm',robust=-1,mosaic=False) | im.weight(type='briggs',rmode='norm',robust=-1,mosaic=True) | def joint_deconvolve(datapath): print '--Joint deconvolution --' #Regrid GBT image onto synth imaging coordinates ia.open('orion_tsdmem.image') csys = ia.coordsys() ia.close() ia.open(datapath+'orion.gbt.im') ia.regrid(outfile='orion_tgbt_regrid.im',shape=[300,300,1,1], csys=csys.torecord(),overwrite=True) ia.close() #Deconvolve GBT image # Sigh. dc.open will warn about the lack of a PSF, but I can't seem to # define a PSF before calling dc.open. dc.open('orion_tgbt_regrid.im', psf='') #make gaussian for PSF (best guess for GBT beam based on beamsize #report in GBT image) dc.makegaussian('gbt_gau.im',bmaj='55arcsec',bmin='55arcsec', bpa='0deg',normalize=False) dc.close() os.system("rm -rf orion_tjoint3") dc.open('orion_tgbt_regrid.im',psf='gbt_gau.im') dc.setscales(scalemethod='uservector',uservector=[30.,100.,200.]) dc.clean(algorithm='fullmsclean',model='orion_tjoint3',niter=50, gain=0.3,mask='',threshold='0.5Jy') dc.close() #default('clean') ia.open('orion_tjoint3') ia.calc(pixels='orion_tjoint3*"'+datapath+'orion.mask6"') ia.close() im.open('orion.ms') im.selectvis(field=[2,3,4,5,6,7,8,9,10],spw=[0,1]) im.defineimage(nx=300,cellx='2arcsec',phasecenter=6,spw=[0,1]) im.setvp(dovp=True) #im.setscales(scalemethod='uservector',uservector=[0,3,10,30,100]) im.setscales(scalemethod='uservector',uservector=[0,3,10,30]) ###if clean component for large scale goes negative continue to use ##that scale im.setoptions(ftmachine='ft') im.setmfcontrol(stoplargenegatives=-1, cyclefactor=2.0, cyclespeedup=-1) im.weight(type='briggs',rmode='norm',robust=-1,mosaic=False) im.clean(algorithm='mfmultiscale', model='orion_tjoint3', image='orion_tjoint3.image', gain=0.3, niter=10000, mask=datapath+'orion.mask6', threshold='4mJy') im.close() return time.time() | eabb1f7fe7170c43e06f199166b04b62d71c12d1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/eabb1f7fe7170c43e06f199166b04b62d71c12d1/orion_regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15916,
67,
323,
4896,
5390,
12,
892,
803,
4672,
1172,
3534,
21574,
443,
4896,
5889,
1493,
11,
225,
468,
1617,
1691,
25069,
56,
1316,
10170,
6194,
451,
709,
5755,
5513,
20389,
18,
3190,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15916,
67,
323,
4896,
5390,
12,
892,
803,
4672,
1172,
3534,
21574,
443,
4896,
5889,
1493,
11,
225,
468,
1617,
1691,
25069,
56,
1316,
10170,
6194,
451,
709,
5755,
5513,
20389,
18,
3190,
2... |
def _getPartDeps1(self, partIncludes, variants, smartExclude, classList): self._console.debug("") self._console.info("Resolving part dependencies...") self._console.indent() partDeps = {} for partId in partIncludes: partExcludes = [] for otherPartId in partIncludes: if otherPartId != partId: partExcludes.extend(partIncludes[otherPartId]) partExcludes.extend(smartExclude) for classId in partIncludes[partId]: if not classId in classList: partIncludes[partId].remove(classId) if len(partIncludes[partId]) == 0: self._console.info("Part continue partClasses = self._depLoader.resolveDependencies(partIncludes[partId], partExcludes, variants) for classId in partClasses[:]: if not classId in classList: partClasses.remove(classId) self._console.debug("Part partDeps[partId] = partClasses return partDeps | def _getPartDeps1(self, partIncludes, variants, smartExclude, classList): self._console.debug("") self._console.info("Resolving part dependencies...") self._console.indent() | c24b9d0c5995e2b4156e1c5a032318aadd13b52b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/c24b9d0c5995e2b4156e1c5a032318aadd13b52b/PartBuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1988,
14430,
21,
12,
2890,
16,
1087,
16815,
16,
12935,
16,
13706,
12689,
16,
16035,
4672,
365,
6315,
8698,
18,
4148,
2932,
7923,
365,
6315,
8698,
18,
1376,
2932,
2903,
6282,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1988,
14430,
21,
12,
2890,
16,
1087,
16815,
16,
12935,
16,
13706,
12689,
16,
16035,
4672,
365,
6315,
8698,
18,
4148,
2932,
7923,
365,
6315,
8698,
18,
1376,
2932,
2903,
6282,
10... | |
def DoFlood(*args): return _micropolisengine.Micropolis_DoFlood(*args) | def DoFlood(*args): return _micropolisengine.Micropolis_DoFlood(*args) | e871b443bd46d35dc509a09e010b7658f0f23e7b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12485/e871b443bd46d35dc509a09e010b7658f0f23e7b/micropolisengine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
42,
383,
369,
30857,
1968,
4672,
327,
389,
27593,
1764,
355,
291,
8944,
18,
49,
335,
1764,
355,
291,
67,
3244,
42,
383,
369,
30857,
1968,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
42,
383,
369,
30857,
1968,
4672,
327,
389,
27593,
1764,
355,
291,
8944,
18,
49,
335,
1764,
355,
291,
67,
3244,
42,
383,
369,
30857,
1968,
13,
2,
-100,
-100,
-100,
-100,
-100,
-10... | |
self.dict = yaml.load( open(file_name, "r").read(), Loader=Loader | file = codecs.open( file_name, "r", sys.getfilesystemencoding() | def load(self, file_name): """ Load configuration from a yaml file | ac0725f69e2370a08a6766ee584e92e2d6d1f05d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5115/ac0725f69e2370a08a6766ee584e92e2d6d1f05d/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
585,
67,
529,
4672,
3536,
4444,
1664,
628,
279,
6097,
585,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
12,
2890,
16,
585,
67,
529,
4672,
3536,
4444,
1664,
628,
279,
6097,
585,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if model == 'ir.actions.act_window' \ and 'search_view_id' in datas \ and datas['search_view_id']: datas['search_view_id'] = datas['search_view_id'][0] | def _result_get(x, keys): if x[1] in keys: return False keys.append(x[1]) if x[3]: model,id = x[2].split(',') # FIXME: It might be a good idea to opt-in that kind of stuff # FIXME: instead of arbitrarily removing random fields fields = [ field for field in self.pool.get(model).fields_get_keys(cr, uid) if field not in EXCLUDED_FIELDS] | 0651254bedbb4999b3830e016e6e38a33996c748 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/0651254bedbb4999b3830e016e6e38a33996c748/ir_values.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2088,
67,
588,
12,
92,
16,
1311,
4672,
309,
619,
63,
21,
65,
316,
1311,
30,
327,
1083,
1311,
18,
6923,
12,
92,
63,
21,
5717,
309,
619,
63,
23,
14542,
938,
16,
350,
273,
619,
... | |
(qu1, qu2, tables) = self._where_calc(cr, user, args, context=context) | (where_clause, where_clause_params, tables) = self._where_calc(cr, user, args, context=context) | def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain. | 497518057d83648e49b98dd33b74213ed3fb31f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/497518057d83648e49b98dd33b74213ed3fb31f4/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
3536,
5167,
364,
1409,
19,
87,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
4422,
16,
729,
16,
833,
16,
1384,
33,
20,
16,
1800,
33,
7036,
16,
1353,
33,
7036,
16,
819,
33,
7036,
16,
1056,
33,
8381,
4672,
3536,
5167,
364,
1409,
19,
87,
25... |
old_conn = self.getConnection() | try: old_conn = self.threadingLocal.connection old_conn_is_threading = True except AttributeError: old_conn = self.processConnection old_conn_is_threading = False | def doInTransaction(self, func, *args, **kw): """ This routine can be used to run a function in a transaction, rolling the transaction back if any exception is raised from that function, and committing otherwise. | 94ba772aa5173fb3e5198df78445bf8958550fe1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8798/94ba772aa5173fb3e5198df78445bf8958550fe1/dbconnection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
382,
3342,
12,
2890,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1220,
12245,
848,
506,
1399,
358,
1086,
279,
445,
316,
279,
2492,
16,
21793,
326,
2492,
1473,
309,
1281,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
741,
382,
3342,
12,
2890,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
3536,
1220,
12245,
848,
506,
1399,
358,
1086,
279,
445,
316,
279,
2492,
16,
21793,
326,
2492,
1473,
309,
1281,
... |
self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | pass | def __init__(self, about=None, meta=None, label=None, id=None, row=None, valueOf_=None, mixedclass_=None, content_=None): super(RowSet, self).__init__(about, meta, label, id, valueOf_, mixedclass_, content_, ) self.row = _cast(None, row) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
1027,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
1027,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
33,
7036,
... |
dst="built/tmp/"+obj[:-4]+".cxx" | def EnqueueFlex(ipath=0,opts=0,pre=0,obj=0,src=0,dashi=0): if ((ipath==0)|(opts==0)|(pre==0)|(obj==0)|(src==0)): exit("syntax error in EnqueueFlex directive") if (COMPILER=="MSVC7"): wobj="built/tmp/"+obj[:-4]+".obj" dst="built/tmp/"+obj[:-4]+".cxx" fn=CompileFlexMSVC7 if (COMPILER=="LINUXA"): wobj="built/tmp/"+obj[:-4]+".o" dst="built/tmp/"+obj[:-4]+".cxx" fn=CompileFlexLINUXA if (SLAVEBUILD!=0) and (SLAVEBUILD!=wobj): return ipath = ["built/tmp"] + ipath + ["built/include"] fullsrc = CxxFindSource(src, ipath) if (OMIT.count("FLEX")): dir = os.path.dirname(fullsrc) CopyFile("built/tmp/"+dst, dir+"/"+dst+".prebuilt") EnqueueCxx(ipath=IPATH, opts=OPTS, obj=obj, src=dst) return() if (fullsrc == 0): exit("Cannot find source file "+src) DependencyQueue(fn, [pre,dst,fullsrc,wobj,ipath,opts,dashi], [wobj], [fullsrc], []) | d00f745e1ceedb7d59a09beac4f23f2f45af36fe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/d00f745e1ceedb7d59a09beac4f23f2f45af36fe/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1374,
4000,
19667,
12,
625,
421,
33,
20,
16,
4952,
33,
20,
16,
1484,
33,
20,
16,
2603,
33,
20,
16,
4816,
33,
20,
16,
21817,
77,
33,
20,
4672,
309,
14015,
625,
421,
631,
20,
14047,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1374,
4000,
19667,
12,
625,
421,
33,
20,
16,
4952,
33,
20,
16,
1484,
33,
20,
16,
2603,
33,
20,
16,
4816,
33,
20,
16,
21817,
77,
33,
20,
4672,
309,
14015,
625,
421,
631,
20,
14047,
... | |
res = run_sql(query, (recID, tag)) | res = run_sql(query, (recID, str(tag)+'%')) | def get_fieldvalues_alephseq_like(recID, tags_in): """Return buffer of ALEPH sequential-like textual format with fields found in the list TAGS_IN for record RECID.""" out = "" if type(tags_in) is not list: tags_in = [tags_in,] if len(tags_in) == 1 and len(tags_in[0]) == 6: ## case A: one concrete subfield asked, so print its value if found ## (use with care: can false you if field has multiple occurrences) out += string.join(get_fieldvalues(recID, tags_in[0]),"\n") else: ## case B: print our "text MARC" format; works safely all the time # find out which tags to output: dict_of_tags_out = {} if not tags_in: for i in range(0, 10): for j in range(0, 10): dict_of_tags_out["%d%d%%" % (i, j)] = 1 else: for tag in tags_in: if len(tag) == 0: for i in range(0, 10): for j in range(0, 10): dict_of_tags_out["%d%d%%" % (i, j)] = 1 elif len(tag) == 1: for j in range(0, 10): dict_of_tags_out["%s%d%%" % (tag, j)] = 1 elif len(tag) < 5: dict_of_tags_out["%s%%" % tag] = 1 elif tag >= 6: dict_of_tags_out[tag[0:5]] = 1 tags_out = dict_of_tags_out.keys() tags_out.sort() # search all bibXXx tables as needed: for tag in tags_out: digits = tag[0:2] try: intdigits = int(digits) if intdigits < 0 or intdigits > 99: raise ValueError except ValueError: # invalid tag value asked for continue if tag.startswith("001") or tag.startswith("00%"): if out: out += "\n" out += "%09d %s %d" % (recID, "001__", recID) bx = "bib%sx" % digits bibx = "bibrec_bib%sx" % digits query = "SELECT b.tag,b.value,bb.field_number FROM %s AS b, %s AS bb "\ "WHERE bb.id_bibrec=%%s AND b.id=bb.id_bibxxx AND b.tag LIKE %%s%%%% "\ "ORDER BY bb.field_number, b.tag ASC" % (bx, bibx) res = run_sql(query, (recID, tag)) # go through fields: field_number_old = -999 field_old = "" for row in res: field, value, field_number = row[0], row[1], row[2] ind1, ind2 = field[3], field[4] if ind1 == "_": ind1 = "" if ind2 == "_": ind2 = "" # print field tag if field_number != field_number_old or field[:-1] != field_old[:-1]: if out: out += "\n" out += "%09d %s " % (recID, field[:5]) field_number_old = field_number field_old = field # print subfield value if field[0:2] == "00" and field[-1:] == "_": out += value else: out += "$$%s%s" % (field[-1:], value) return out | b0a7a42e5f62a4288226e4e7ee86b0635ca9725d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/b0a7a42e5f62a4288226e4e7ee86b0635ca9725d/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1518,
2372,
67,
5349,
844,
5436,
67,
5625,
12,
3927,
734,
16,
2342,
67,
267,
4672,
3536,
990,
1613,
434,
432,
900,
8939,
21210,
17,
5625,
25774,
740,
598,
1466,
1392,
316,
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,
1518,
2372,
67,
5349,
844,
5436,
67,
5625,
12,
3927,
734,
16,
2342,
67,
267,
4672,
3536,
990,
1613,
434,
432,
900,
8939,
21210,
17,
5625,
25774,
740,
598,
1466,
1392,
316,
326... |
d = d %macros | def do(self, macros): for path in self.paths: path = path %macros dirs = util.braceExpand(path) for d in dirs: | 18777303521c30ba020574b0d3f0f043cb9d8a48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/18777303521c30ba020574b0d3f0f043cb9d8a48/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
4672,
364,
589,
316,
365,
18,
4481,
30,
589,
273,
589,
738,
5821,
6973,
7717,
273,
1709,
18,
70,
9963,
12271,
12,
803,
13,
364,
302,
316,
7717,
30,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
16,
24302,
4672,
364,
589,
316,
365,
18,
4481,
30,
589,
273,
589,
738,
5821,
6973,
7717,
273,
1709,
18,
70,
9963,
12271,
12,
803,
13,
364,
302,
316,
7717,
30,
2,
-100,... | |
bleft = a0 and a0.bleft or 0 | bleft = or_Expr( and_Expr( a0, a0.bleft), 0) | def draw(self): if self.print_lbox: print "print_lbox: %r lbox attrs are %r" % (self,(self.bleft, self.bright, self.bbottom, self.btop)) glPushMatrix() prior = None for a in self.drawables: if prior: # move from prior to a dy = prior.bbottom + self.gap + a.btop glTranslatef(0,-dy,0) # positive is up, but Column progresses down prior = a a.draw() glPopMatrix() return | afe0e58b40691afe453f33e2e027fc6ff467f64b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/afe0e58b40691afe453f33e2e027fc6ff467f64b/Column.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
309,
365,
18,
1188,
67,
80,
2147,
30,
1172,
315,
1188,
67,
80,
2147,
30,
738,
86,
328,
2147,
3422,
854,
738,
86,
6,
738,
261,
2890,
16,
12,
2890,
18,
70,
4482... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
309,
365,
18,
1188,
67,
80,
2147,
30,
1172,
315,
1188,
67,
80,
2147,
30,
738,
86,
328,
2147,
3422,
854,
738,
86,
6,
738,
261,
2890,
16,
12,
2890,
18,
70,
4482... |
self.clipboard.set_text(row[1]) self.pri_clipboard.set_text(row[1]) | self.clipboard.set_text(row[2]) self.pri_clipboard.set_text(row[2]) | def on_sql_log_activate(self, *args): if len(args) == 1: menuitem = args[0] if menuitem.name == "clear_all_entries": self.sql_log_model.clear() path, column = self.sql_log_tv.get_cursor() row = self.sql_log_model[path] if menuitem.name == "copy_sql_log": self.clipboard.set_text(row[1]) self.pri_clipboard.set_text(row[1]) elif menuitem.name == "set_as_query_text": self.current_query.textview.get_buffer().set_text(row[1]) if menuitem.name == "delete_sql_log": iter = self.sql_log_model.get_iter(path) self.sql_log_model.remove(iter) return True tv, path, tvc = args query = tv.get_model()[path][1] self.current_query.textview.get_buffer().set_text(query) return True | 7dda6efe0ce5eb9252a0950001c0288c1a84bb9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8147/7dda6efe0ce5eb9252a0950001c0288c1a84bb9f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4669,
67,
1330,
67,
10014,
12,
2890,
16,
380,
1968,
4672,
309,
562,
12,
1968,
13,
422,
404,
30,
3824,
1726,
273,
833,
63,
20,
65,
309,
3824,
1726,
18,
529,
422,
315,
8507,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
4669,
67,
1330,
67,
10014,
12,
2890,
16,
380,
1968,
4672,
309,
562,
12,
1968,
13,
422,
404,
30,
3824,
1726,
273,
833,
63,
20,
65,
309,
3824,
1726,
18,
529,
422,
315,
8507,
... |
self.assertEqual(mod.st[3][1:], | self.assertEqual(revise(*mod.st[3][1:]), | def test_stack(self): self.assert_(len(mod.st) >= 5) self.assertEqual(mod.st[0][1:], (modfile, 16, 'eggs', [' st = inspect.stack()\n'], 0)) self.assertEqual(mod.st[1][1:], (modfile, 9, 'spam', [' eggs(b + d, c + f)\n'], 0)) self.assertEqual(mod.st[2][1:], (modfile, 43, 'argue', [' spam(a, b, c)\n'], 0)) self.assertEqual(mod.st[3][1:], (modfile, 39, 'abuse', [' self.argue(a, b, c)\n'], 0)) | ef331d89f9877a0ab472e3241204c90fd2083ecd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/ef331d89f9877a0ab472e3241204c90fd2083ecd/test_inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3772,
12,
2890,
4672,
365,
18,
11231,
67,
12,
1897,
12,
1711,
18,
334,
13,
1545,
1381,
13,
365,
18,
11231,
5812,
12,
1711,
18,
334,
63,
20,
6362,
21,
30,
6487,
261,
1711,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3772,
12,
2890,
4672,
365,
18,
11231,
67,
12,
1897,
12,
1711,
18,
334,
13,
1545,
1381,
13,
365,
18,
11231,
5812,
12,
1711,
18,
334,
63,
20,
6362,
21,
30,
6487,
261,
1711,
... |
if d > 1: for i in range(x.ncols()): | if d != 1: for i in range(x.nrows()): | def add_column(B, H_B, a): """ The add column procedure. INPUT: B -- a non-singular square matrix H_B -- the Hermite normal form of B a -- a column vector OUTPUT: x -- a vector such that H' = H_B.augment(x) is the HNF of A = B.augment(a). """ t0 = verbose('starting add_column') # We use a direct solve method without inverse. This # is more clever than what is in Allan Steel's talk and # what is in that paper, in 2 ways -- (1) no inverse need # to be computed, and (2) we cleverly solve a vastly easier # system and recover the solution to the original system. # Here's how: # 1. We make a copy of B but with the last *nasty* row of B replaced # by a random very nice row. C = copy(B) C[C.nrows()-1] = [1]*C.ncols() # 2. Then we find the unique solution to C * x = a # (todo -- recover from bad case.) x = C.solve_right(a) # 3. We next delete the last row of B and find a basis vector k # for the 1-dimensional kernel. D = B.matrix_from_rows(range(C.nrows()-1)) N = D._rational_kernel_iml() if N.ncols() != 1: raise NotImplementedError, "need to recover gracefully from rank issues with matrix." k = N.matrix_from_columns([0]) # 4. The sought for solution z to B*z = a is some linear combination # z = x + alpha*k # and setting w to be the last row of B, this column vector z satisfies # w * z = a' # where a' is the last entry of a. Thus # w * (x + alpha*k) = a' # so w * x + alpha*w*k = a' # so alpha*w*k = a' - w*x. w = B[-1] # last row of B a_prime = a[-1] lhs = w*k rhs = a_prime - w * x alpha = rhs[0] / lhs[0] z = x + alpha*k zd, d = z._clear_denom() x = H_B * zd if d > 1: for i in range(x.ncols()): x[i,0] = x[i,0]/d verbose('finished add column', t0) return x | a36eb3fc8c1ecc0a0d1bb8770ac3104254da3893 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a36eb3fc8c1ecc0a0d1bb8770ac3104254da3893/matrix_integer_dense_hnf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2827,
12,
38,
16,
670,
67,
38,
16,
279,
4672,
3536,
1021,
527,
1057,
12131,
18,
225,
12943,
30,
605,
282,
1493,
279,
1661,
17,
17835,
8576,
3148,
670,
67,
38,
1493,
326,
670... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2827,
12,
38,
16,
670,
67,
38,
16,
279,
4672,
3536,
1021,
527,
1057,
12131,
18,
225,
12943,
30,
605,
282,
1493,
279,
1661,
17,
17835,
8576,
3148,
670,
67,
38,
1493,
326,
670... |
if move.move_dest_id.state in ('waiting','confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'}) | if move.move_dest_id.state in ('waiting', 'confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) | def action_done(self, cr, uid, ids, context=None): track_flag=False for move in self.browse(cr, uid, ids): if move.move_dest_id.id and (move.state != 'done'): cr.execute('insert into stock_move_history_ids (parent_id,child_id) values (%s,%s)', (move.id, move.move_dest_id.id)) if move.move_dest_id.state in ('waiting','confirmed'): self.write(cr, uid, [move.move_dest_id.id], {'state':'assigned'}) if move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) else: pass # self.action_done(cr, uid, [move.move_dest_id.id]) if move.move_dest_id.auto_validate: self.action_done(cr, uid, [move.move_dest_id.id], context=context) | 369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
8734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
3298,
67,
6420,
33,
8381,
364,
3635,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
4672,
309,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
8734,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
3298,
67,
6420,
33,
8381,
364,
3635,
316,
365,
18,
25731,
12,
3353,
16,
4555,
16,
3258,
4672,
309,
36... |
simpleEncoding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' simpleEncodingLength = len(simpleEncoding) """ This function scales the submitted values so that maxVal becomes the highest value. """ def simpleEncode(valueArray,maxValue): chartData = ['s:'] for currentValue in valueArray: if is_number(currentValue) and currentValue >= 0: chartData.append(simpleEncoding[int(round((simpleEncodingLength - 1) * currentValue / maxValue))]) else: chartData.append('_') | def testis_number(self): self.assertTrue(chart_encoding.is_number("1")) self.assertTrue(chart_encoding.is_number("0")) self.assertTrue(chart_encoding.is_number("-1")) | def is_number(s): try: float(s) return True except ValueError: return False | e3dc1d60d1e1ea5af82cb695a3f2dcd6b78767ac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2031/e3dc1d60d1e1ea5af82cb695a3f2dcd6b78767ac/chart_encoding_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2696,
12,
87,
4672,
775,
30,
1431,
12,
87,
13,
327,
1053,
1335,
2068,
30,
327,
1083,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
353,
67,
2696,
12,
87,
4672,
775,
30,
1431,
12,
87,
13,
327,
1053,
1335,
2068,
30,
327,
1083,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tags : list of integers | tags : list of int | def __init__(self, symbols=None, numbers=None, positions=None, tags=None, momenta=None, masses=None, magmoms=None, charges=None, cell=None, pbc=None, constraint=None, calculator=None): """Construct Atoms object. | 4f53c765c1e0026359605da5aba1d414cddb5674 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5572/4f53c765c1e0026359605da5aba1d414cddb5674/atoms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7963,
33,
7036,
16,
5600,
33,
7036,
16,
6865,
33,
7036,
16,
2342,
33,
7036,
16,
10382,
69,
33,
7036,
16,
8039,
281,
33,
7036,
16,
4447,
81,
25390,
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,
1001,
2738,
972,
12,
2890,
16,
7963,
33,
7036,
16,
5600,
33,
7036,
16,
6865,
33,
7036,
16,
2342,
33,
7036,
16,
10382,
69,
33,
7036,
16,
8039,
281,
33,
7036,
16,
4447,
81,
25390,
33,
... |
os.system("HOME=%s %s/bin/takenote --no-default" % | os.system("HOME=%s %s/bin/keepnote --no-default" % | def old_test_distutil(self): """Test distutil install""" install_dir = "test/tmp/distutil" home_dir = "test/tmp/home" mk_clean_dir(install_dir) mk_clean_dir(home_dir) self.assertEquals( os.system("python setup.py install --prefix=%s" % install_dir), 0) | b976ccda74d72b8e2f26f336899872a8d24c127e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4738/b976ccda74d72b8e2f26f336899872a8d24c127e/install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1592,
67,
3813,
67,
4413,
1367,
12,
2890,
4672,
3536,
4709,
2411,
1367,
3799,
8395,
225,
3799,
67,
1214,
273,
315,
3813,
19,
5645,
19,
4413,
1367,
6,
6382,
67,
1214,
273,
315,
3813,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1592,
67,
3813,
67,
4413,
1367,
12,
2890,
4672,
3536,
4709,
2411,
1367,
3799,
8395,
225,
3799,
67,
1214,
273,
315,
3813,
19,
5645,
19,
4413,
1367,
6,
6382,
67,
1214,
273,
315,
3813,
19... |
_debug(ui, "tag cache: tip unchanged\n") | def _readtagcache(ui, repo): '''Read the tag cache and return a tuple (heads, fnodes, cachetags, shouldwrite). If the cache is completely up-to-date, cachetags is a dict of the form returned by _readtags(); otherwise, it is None and heads and fnodes are set. In that case, heads is the list of all heads currently in the repository (ordered from tip to oldest) and fnodes is a mapping from head to .hgtags filenode. If those two are set, caller is responsible for reading tag info from each head.''' try: cachefile = repo.opener('tags.cache', 'r') # force reading the file for static-http cachelines = iter(cachefile) _debug(ui, 'reading tag cache from %s\n' % cachefile.name) except IOError: cachefile = None # The cache file consists of lines like # <headrev> <headnode> [<tagnode>] # where <headrev> and <headnode> redundantly identify a repository # head from the time the cache was written, and <tagnode> is the # filenode of .hgtags on that head. Heads with no .hgtags file will # have no <tagnode>. The cache is ordered from tip to oldest (which # is part of why <headrev> is there: a quick visual check is all # that's required to ensure correct order). # # This information is enough to let us avoid the most expensive part # of finding global tags, which is looking up <tagnode> in the # manifest for each head. cacherevs = [] # list of headrev cacheheads = [] # list of headnode cachefnode = {} # map headnode to filenode if cachefile: for line in cachelines: if line == "\n": break line = line.rstrip().split() cacherevs.append(int(line[0])) headnode = bin(line[1]) cacheheads.append(headnode) if len(line) == 3: fnode = bin(line[2]) cachefnode[headnode] = fnode tipnode = repo.changelog.tip() tiprev = len(repo.changelog) - 1 # Case 1 (common): tip is the same, so nothing has changed. # (Unchanged tip trivially means no changesets have been added. # But, thanks to localrepository.destroyed(), it also means none # have been destroyed by strip or rollback.) if cacheheads and cacheheads[0] == tipnode and cacherevs[0] == tiprev: _debug(ui, "tag cache: tip unchanged\n") tags = _readtags(ui, repo, cachelines, cachefile.name) cachefile.close() return (None, None, tags, False) if cachefile: cachefile.close() # ignore rest of file repoheads = repo.heads() # Case 2 (uncommon): empty repo; get out quickly and don't bother # writing an empty cache. if repoheads == [nullid]: return ([], {}, {}, False) # Case 3 (uncommon): cache file missing or empty. if not cacheheads: _debug(ui, 'tag cache: cache file missing or empty\n') # Case 4 (uncommon): tip rev decreased. This should only happen # when we're called from localrepository.destroyed(). Refresh the # cache so future invocations will not see disappeared heads in the # cache. elif cacheheads and tiprev < cacherevs[0]: _debug(ui, 'tag cache: tip rev decremented (from %d to %d), ' 'so we must be destroying nodes\n' % (cacherevs[0], tiprev)) # Case 5 (common): tip has changed, so we've added/replaced heads. else: _debug(ui, 'tag cache: tip has changed (%d:%s); must find new heads\n' % (tiprev, short(tipnode))) # Luckily, the code to handle cases 3, 4, 5 is the same. So the # above if/elif/else can disappear once we're confident this thing # actually works and we don't need the debug output. # N.B. in case 4 (nodes destroyed), "new head" really means "newly # exposed". newheads = [head for head in repoheads if head not in set(cacheheads)] _debug(ui, 'tag cache: found %d head(s) not in cache: %s\n' % (len(newheads), map(short, newheads))) # Now we have to lookup the .hgtags filenode for every new head. # This is the most expensive part of finding tags, so performance # depends primarily on the size of newheads. Worst case: no cache # file, so newheads == repoheads. for head in newheads: cctx = repo[head] try: fnode = cctx.filenode('.hgtags') cachefnode[head] = fnode except error.LookupError: # no .hgtags file on this head pass # Caller has to iterate over all heads, but can use the filenodes in # cachefnode to get to each .hgtags revision quickly. return (repoheads, cachefnode, None, True) | b2451d75e661d2c1bb8833ce32d5b7db4222606b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/b2451d75e661d2c1bb8833ce32d5b7db4222606b/tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2692,
2493,
12,
4881,
16,
3538,
4672,
9163,
1994,
326,
1047,
1247,
471,
327,
279,
3193,
261,
20263,
16,
2295,
1145,
16,
7122,
278,
1341,
16,
1410,
2626,
2934,
225,
971,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2692,
2493,
12,
4881,
16,
3538,
4672,
9163,
1994,
326,
1047,
1247,
471,
327,
279,
3193,
261,
20263,
16,
2295,
1145,
16,
7122,
278,
1341,
16,
1410,
2626,
2934,
225,
971,
326,
... | |
gLogger.error(errMessage,pathSURL) | gLogger.error( errMessage, pathSURL ) | def getTransportURL(self,path,protocols=False): """ Obtain the tURLs for the supplied path and protocols """ res = self.checkArgumentFormat(path) if not res['OK']: return res urls = res['Value'] | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29801,
1785,
12,
2890,
16,
803,
16,
31018,
33,
8381,
4672,
3536,
24850,
326,
268,
15749,
364,
326,
4580,
589,
471,
16534,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29801,
1785,
12,
2890,
16,
803,
16,
31018,
33,
8381,
4672,
3536,
24850,
326,
268,
15749,
364,
326,
4580,
589,
471,
16534,
3536,
400,
273,
365,
18,
1893,
1379,
1630,
12,
803,
13,
309,
4... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.