rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if not self._dom_to_html_cache.has_key( (tree,container) ): | if not self._epytext_cache.has_key( (tree,container) ): | def _dom_to_html(self, tree, container=None, indent=0): """ Given the DOM tree for an epytext string (as returned by L{epytext.parse}), return a string encoding it in HTML. This string does not include C{<html>} or C{<body>} tags. @param tree: The DOM tree for an epytext string. @type tree: C{xml.dom.minidom.Element} @param container: The container in which to look up objects by name (e.g., for link directives). @type container: Python module """ if not self._dom_to_html_cache.has_key( (tree,container) ): html = self._dom_to_html_helper(tree, container, indent, 0) self._dom_to_html_cache[tree, container] = html return self._dom_to_html_cache[tree,container] | 60b4598f963657af72659f4c3492b6028c51c37e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/60b4598f963657af72659f4c3492b6028c51c37e/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9859,
67,
869,
67,
2620,
12,
2890,
16,
2151,
16,
1478,
33,
7036,
16,
3504,
33,
20,
4672,
3536,
16803,
326,
4703,
2151,
364,
392,
425,
2074,
955,
533,
261,
345,
2106,
635,
511,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9859,
67,
869,
67,
2620,
12,
2890,
16,
2151,
16,
1478,
33,
7036,
16,
3504,
33,
20,
4672,
3536,
16803,
326,
4703,
2151,
364,
392,
425,
2074,
955,
533,
261,
345,
2106,
635,
511,
9... |
self.body.append( '\\end{list}\n' ) | self.out.append( '\\end{list}\n' ) | def depart_bullet_list (self, node): # NOTE: see `visit_bullet_list` if (hasattr (self, 'topic_classes') and ('contents' in self.topic_classes)): self.body.append( '\\end{list}\n' ) else: self.body.append( '\\end{itemize}\n' ) | 37db8ffa549b63ebad9bbc3310aeafe2a276f03b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5620/37db8ffa549b63ebad9bbc3310aeafe2a276f03b/rst2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
70,
19994,
67,
1098,
261,
2890,
16,
756,
4672,
468,
5219,
30,
2621,
1375,
11658,
67,
70,
19994,
67,
1098,
68,
309,
261,
5332,
1747,
261,
2890,
16,
296,
10476,
67,
4701,
6134... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
70,
19994,
67,
1098,
261,
2890,
16,
756,
4672,
468,
5219,
30,
2621,
1375,
11658,
67,
70,
19994,
67,
1098,
68,
309,
261,
5332,
1747,
261,
2890,
16,
296,
10476,
67,
4701,
6134... |
for a in atom[2:]: response += self._processAtom(a, sessionID) | for e in elem[2:]: response += self._processElement(e, sessionID) | def _processPerson2(self,atom, sessionID): # Person2 atoms process their contents, and then convert all # pronouns from 1st person to 3nd person, and vice versa. response = "" for a in atom[2:]: response += self._processAtom(a, sessionID) # An atomic <person2/> tag, is a shortcut for <person><star/><person>. if len(atom[2:]) == 0: response = self._processAtom(['star',{}], sessionID) # run it through the 'person2' subber return self._subbers['person2'].sub(response) | cdb5ca51cf362e7f41cc166060e200bc84fcb1e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6428/cdb5ca51cf362e7f41cc166060e200bc84fcb1e8/Kernel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
8346,
22,
12,
2890,
16,
7466,
16,
13737,
4672,
468,
11573,
22,
9006,
1207,
3675,
2939,
16,
471,
1508,
1765,
777,
468,
846,
265,
465,
87,
628,
404,
334,
6175,
358,
890,
4880,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2567,
8346,
22,
12,
2890,
16,
7466,
16,
13737,
4672,
468,
11573,
22,
9006,
1207,
3675,
2939,
16,
471,
1508,
1765,
777,
468,
846,
265,
465,
87,
628,
404,
334,
6175,
358,
890,
4880,... |
lineno, issue.encode('utf-8'), text.strip().encode('utf-8')]) del writer | lineno, issue.encode('utf-8'), text.strip().encode('utf-8')]) | def write_log_entry(self, lineno, issue, text): f = open(self.log_file_name, 'ab') writer = csv.writer(f) writer.writerow([self.docname.encode('utf-8'), lineno, issue.encode('utf-8'), text.strip().encode('utf-8')]) del writer f.close() | 265f533c108c6859634fe50d980e0d80c6b0ca63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/265f533c108c6859634fe50d980e0d80c6b0ca63/suspicious.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1330,
67,
4099,
12,
2890,
16,
7586,
16,
5672,
16,
977,
4672,
284,
273,
1696,
12,
2890,
18,
1330,
67,
768,
67,
529,
16,
296,
378,
6134,
2633,
273,
6101,
18,
6299,
12,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
1330,
67,
4099,
12,
2890,
16,
7586,
16,
5672,
16,
977,
4672,
284,
273,
1696,
12,
2890,
18,
1330,
67,
768,
67,
529,
16,
296,
378,
6134,
2633,
273,
6101,
18,
6299,
12,
74,
... |
if ((template_exists and template_newer) or self.force_manifest or self.manifest_only): | if ((template_exists and (template_newer or setup_newer)) or self.force_manifest or self.manifest_only): | def get_file_list (self): """Figure out the list of files to include in the source distribution, and put it in 'self.files'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the state of the filesystem. """ template_exists = os.path.isfile (self.template) if template_exists: template_newer = newer (self.template, self.manifest) | b2db0eb695d2d62cb1a74c51bb005a23821a76ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b2db0eb695d2d62cb1a74c51bb005a23821a76ce/sdist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
768,
67,
1098,
261,
2890,
4672,
3536,
42,
15906,
596,
326,
666,
434,
1390,
358,
2341,
316,
326,
1084,
7006,
16,
471,
1378,
518,
316,
296,
2890,
18,
2354,
10332,
225,
1220,
482... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
768,
67,
1098,
261,
2890,
4672,
3536,
42,
15906,
596,
326,
666,
434,
1390,
358,
2341,
316,
326,
1084,
7006,
16,
471,
1378,
518,
316,
296,
2890,
18,
2354,
10332,
225,
1220,
482... |
_max = float(self._max_entry.get_text()) | _max = self._max_entry.get_text() if _max == '': return _max = float(_max) | def _set_max_clicked_cb(self, widget): _max = float(self._max_entry.get_text()) if _max < self._value: logging.warning('Cannot put maximum lower then current value: %f' % self._value) return if _max > self._insmax: logging.warning('Cannot override parameter maximum: %f' % self._insmax) return self._max = _max self._range = self._max - self._min self._max_value.set_label('%e' % self._max) self._max_entry.set_text('') self._main_slider.set_range(self._min, self._max) | 4034ffa2c6e15c036cdf4d0a3d66f8b8c530ed74 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6471/4034ffa2c6e15c036cdf4d0a3d66f8b8c530ed74/slider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
1896,
67,
7475,
329,
67,
7358,
12,
2890,
16,
3604,
4672,
389,
1896,
273,
365,
6315,
1896,
67,
4099,
18,
588,
67,
955,
1435,
309,
389,
1896,
422,
875,
30,
327,
389,
1896... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
67,
1896,
67,
7475,
329,
67,
7358,
12,
2890,
16,
3604,
4672,
389,
1896,
273,
365,
6315,
1896,
67,
4099,
18,
588,
67,
955,
1435,
309,
389,
1896,
422,
875,
30,
327,
389,
1896... |
const float * x, int xS0, int xS1, int xS2, int xS3, const float * z, int zS0, int zS1, int zS2, int zS3, const float * gz, int gzS0, int gzS1, int gzS2, int gzS3, | const float * x, int xS0, int xS1, int xS2, int xS3, const float * z, int zS0, int zS1, int zS2, int zS3, const float * gz, int gzS0, int gzS1, int gzS2, int gzS3, | def c_support_code_apply(self, node, nodename): # This code considers every position in the output z, andthen computes the gradient for the # input pixels that were downsampled to that z-position. It does so by running along every # z row (sometimes plus one, to make sure every gx row gets totally filled), and by # running along every x col. This code is not sensitive to the ignore_border flag along # the row dimension (since it runs for every position in the output z), but it is sensitive # along the col dimension. ignore_border = int(self.ignore_border) return """ template<int ds0, int ds1> // ds0 is the downsampling factor in rows, ds1 in columns __global__ void kDownsampleMaxGrad_%(nodename)s( int D0, int D1, int D2, int D3, int xD2, int xD3, const float * x, int xS0, int xS1, int xS2, int xS3, const float * z, int zS0, int zS1, int zS2, int zS3, const float * gz, int gzS0, int gzS1, int gzS2, int gzS3, float *gx) { // D0: number of image rows // D1: number of image cols // D2: number of z rows // D3: number of z cols // xD2: number of x rows // xD3: number of x cols // various .S. variables are strides float cur_max, cur_x, my_z, my_gz; int i0 = blockIdx.x; // image row int i1 = 0; // image col int i2 = blockIdx.y; // row wrt z and/or gz, ranges from 0 to D2 - 1 OR D2 (as needed to cover all x rows) int x_col = threadIdx.x; // col wrt x, ranges from 0 to xD3 - 1 int z_col = x_col/ds1; // z_col corresponding to this x_col | 98f8608be75b8b81997fa956395f0063b48ea567 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/98f8608be75b8b81997fa956395f0063b48ea567/blas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
13261,
67,
710,
67,
9010,
12,
2890,
16,
756,
16,
14003,
1069,
4672,
468,
1220,
981,
1959,
24290,
3614,
1754,
316,
326,
876,
998,
16,
471,
15991,
15881,
326,
10292,
364,
326,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
13261,
67,
710,
67,
9010,
12,
2890,
16,
756,
16,
14003,
1069,
4672,
468,
1220,
981,
1959,
24290,
3614,
1754,
316,
326,
876,
998,
16,
471,
15991,
15881,
326,
10292,
364,
326,
4... |
fp = open(textfile, 'r+') except IOError, e: if e.errno <> errno.ENOENT: raise omask = os.umask(007) try: fp = open(textfile, 'w+') finally: os.umask(omask) func(mlist, db, fp) | fp = open(textfile, 'w+') finally: os.umask(omask) try: func(mlist, fp) if func is _addvirtual: _check_for_virtual_loopaddr(mlist, textfile) finally: | def do_create(mlist, dbfile, textfile, func): lockfp = None try: # First, open the dbhash file using built-in open so we can acquire an # exclusive lock on it. See the discussion above for why we do it # this way instead of specifying the `l' option to dbhash.open() db = bsddb.hashopen(dbfile, 'c') lockfp = open(dbfile) fcntl.flock(lockfp.fileno(), fcntl.LOCK_EX) # Crack open the plain text file try: fp = open(textfile, 'r+') except IOError, e: if e.errno <> errno.ENOENT: raise omask = os.umask(007) try: fp = open(textfile, 'w+') finally: os.umask(omask) func(mlist, db, fp) # And flush everything out to disk fp.close() # Now double check the virtual plain text file if func is addvirtual: check_for_virtual_loopaddr(mlist, db, textfile) db.sync() db.close() finally: if lockfp: fcntl.flock(lockfp.fileno(), fcntl.LOCK_UN) lockfp.close() | d8d3d0e580cb1a2fb47a8454c25e13ad444faeb5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/d8d3d0e580cb1a2fb47a8454c25e13ad444faeb5/Postfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2640,
12,
781,
376,
16,
1319,
768,
16,
977,
768,
16,
1326,
4672,
2176,
7944,
273,
599,
775,
30,
468,
5783,
16,
1696,
326,
1319,
2816,
585,
1450,
6650,
17,
267,
1696,
1427,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2640,
12,
781,
376,
16,
1319,
768,
16,
977,
768,
16,
1326,
4672,
2176,
7944,
273,
599,
775,
30,
468,
5783,
16,
1696,
326,
1319,
2816,
585,
1450,
6650,
17,
267,
1696,
1427,
7... |
def copyHtmlFile(self, libraryName, versionName, variantName, demoVersion="build", demobrowserDir=None): if not demobrowserDir: demobrowserDir = os.path.join(self.dir, "demobrowser") console.info("Copying HTML file to demobrowser directory %s" %demobrowserDir) sourceFilePath = os.path.join(demobrowserDir,"source", "demo", "template.html") | def copyHtmlFile(self, libraryName, versionName, variantName, demoVersion, demoBrowser): dbManifest = getDataFromJsonFile(os.path.join(demoBrowser, "Manifest.json")) dbResourcePath = dbManifest["provides"]["resource"] dbNamespace = dbManifest["provides"]["namespace"] sourceFilePath = os.path.join(demoBrowser, dbResourcePath, dbNamespace, "demo_template.html") | def copyHtmlFile(self, libraryName, versionName, variantName, demoVersion="build", demobrowserDir=None): if not demobrowserDir: demobrowserDir = os.path.join(self.dir, "demobrowser") console.info("Copying HTML file to demobrowser directory %s" %demobrowserDir) sourceFilePath = os.path.join(demobrowserDir,"source", "demo", "template.html") sourceFile = codecs.open(sourceFilePath, 'r', 'utf-8') targetDir = os.path.join(demobrowserDir, demoVersion, "demo", libraryName) if not os.path.isdir(targetDir): os.makedirs(targetDir) targetFilePath = os.path.join(targetDir, versionName + "-" + variantName + ".html") targetFile = codecs.open(targetFilePath, "w", "utf-8") for line in sourceFile: demoUrl = "../../../../%s/%s/demo/%s/%s/" %(libraryName,versionName,variantName,demoVersion) targetFile.write(line.replace("$LIBRARY", demoUrl)) targetFile.close() return targetFilePath | c325c3134575404d867a5452a6f71564b021240c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/c325c3134575404d867a5452a6f71564b021240c/repository.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
565,
1652,
1610,
4353,
812,
12,
2890,
16,
5313,
461,
16,
1177,
461,
16,
5437,
461,
16,
21477,
1444,
16,
21477,
9132,
4672,
225,
1319,
9121,
273,
4303,
1265,
3185,
812,
12,
538,
18,
803,
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,
565,
1652,
1610,
4353,
812,
12,
2890,
16,
5313,
461,
16,
1177,
461,
16,
5437,
461,
16,
21477,
1444,
16,
21477,
9132,
4672,
225,
1319,
9121,
273,
4303,
1265,
3185,
812,
12,
538,
18,
803,
18,
... |
'''Return message matching the given uid''' | '''Return message (no substance) matching the given uid.''' | def __getitem__(self, key): '''Return message matching the given uid''' imap.SelectFolder(self.name) # We really want to use RFC822.PEEK here, as that doesn't effect # the status of the message. Unfortunately, it appears that not # all IMAP servers support this, even though it is in RFC1730 response = imap.uid("FETCH", key, self.rfc822_command) if response[0] != "OK": self.rfc822_command = "RFC822" response = imap.uid("FETCH", key, self.rfc822_command) self._check(response, "uid fetch") data = _extract_fetch_data(response[1][0]) messageText = data["RFC822"] | 38e241315078b9384bccd1d99859b684a56a14e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/38e241315078b9384bccd1d99859b684a56a14e1/imapfilter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
498,
4672,
9163,
990,
883,
261,
2135,
720,
593,
13,
3607,
326,
864,
4555,
1093,
6309,
282,
20226,
18,
3391,
3899,
12,
2890,
18,
529,
13,
468,
1660,
8654... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31571,
972,
12,
2890,
16,
498,
4672,
9163,
990,
883,
261,
2135,
720,
593,
13,
3607,
326,
864,
4555,
1093,
6309,
282,
20226,
18,
3391,
3899,
12,
2890,
18,
529,
13,
468,
1660,
8654... |
menu += ' <a class="download_sws" href="download">Download</a>'%self.filename() menu += ' <a class="delete" href="delete">Delete</a> | menu += ' <a class="download_sws" href="download">Download</a>' + vbar menu += ' <a class="delete" href="delete">Delete</a>' | def html(self, include_title=True, do_print=False, authorized=False, confirm_before_leave=False): n = len(self.__cells) s = '' if include_title: if self.computing(): interrupt_class = "interrupt" else: interrupt_class = "interrupt_grey" S = self.system() if not (S is None): system = ' (%s mode)'%S else: system ='' if not authorized: lock_text = ' <span id="worksheet_lock" class="locked" onClick="unlock_worksheet()">[locked]</span>' else: lock_text = '' | 3ee068fbcd3d732a87fc89b01684245c94122485 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/3ee068fbcd3d732a87fc89b01684245c94122485/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
12,
2890,
16,
2341,
67,
2649,
33,
5510,
16,
741,
67,
1188,
33,
8381,
16,
10799,
33,
8381,
16,
6932,
67,
5771,
67,
19574,
33,
8381,
4672,
290,
273,
562,
12,
2890,
16186,
14741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
12,
2890,
16,
2341,
67,
2649,
33,
5510,
16,
741,
67,
1188,
33,
8381,
16,
10799,
33,
8381,
16,
6932,
67,
5771,
67,
19574,
33,
8381,
4672,
290,
273,
562,
12,
2890,
16186,
14741,
... |
def spherical_bessel_J(n, var): | def spherical_bessel_J(n, var, alg="maxima"): | def spherical_bessel_J(n, var): r""" Returns the spherical Bessel function of the first kind for integers n > -1. Reference: A&S 10.1.8 page 437 and A&S 10.1.15 page 439. EXAMPLES: sage: spherical_bessel_J(2,x) (-(1 - 24/(8*x^2))*sin(x) - 3*cos(x)/x)/x """ _init() return meval("spherical_bessel_j(%s,%s)"%(ZZ(n),var)) | 0fb37ff99a113a9a0b53b260456b3ff8fa211fee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0fb37ff99a113a9a0b53b260456b3ff8fa211fee/special.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
21570,
67,
70,
403,
292,
67,
46,
12,
82,
16,
569,
16,
11989,
1546,
1896,
13888,
6,
4672,
436,
8395,
2860,
326,
272,
21570,
605,
403,
292,
445,
434,
326,
1122,
3846,
364,
12321,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
21570,
67,
70,
403,
292,
67,
46,
12,
82,
16,
569,
16,
11989,
1546,
1896,
13888,
6,
4672,
436,
8395,
2860,
326,
272,
21570,
605,
403,
292,
445,
434,
326,
1122,
3846,
364,
12321,
... |
func(*args, **kw) except pythoncom.com_error, details: if details[0]==hresult: return self.fail("Excepected COM exception with HRESULT 0x%x" % hresult) class TestCase(unittest.TestCase, TestCaseMixin): def __call__(self, result=None): if result is None: result = self.defaultTestResult() self._preTest() try: unittest.TestCase.__call__(self, result) finally: self._postTest(result) class CapturingFunctionTestCase(unittest.FunctionTestCase, TestCaseMixin): | gtrc = sys.gettotalrefcount except AttributeError: return def gtrc(): return 0 trc = gtrc() for i in range(self.num_leak_iters): self.real_test(result) if result.shouldStop: break del i lost = (gtrc() - trc) // self.num_leak_iters if lost < 0: msg = "LeakTest: %s appeared to gain %d references!!" % (self.real_test, -lost) result.addFailure(self.real_test, (AssertionError, msg, None)) if lost > 0: msg = "LeakTest: %s lost %d references" % (self.real_test, lost) result.addFailure(self.real_test, (AssertionError, msg, None)) class TestLoader(unittest.TestLoader): def loadTestsFromTestCase(self, testCaseClass): """Return a suite of all tests cases contained in testCaseClass""" leak_tests = [] for name in self.getTestCaseNames(testCaseClass): real_test = testCaseClass(name) leak_test = self._getTestWrapper(real_test) leak_tests.append(leak_test) return self.suiteClass(leak_tests) def _getTestWrapper(self, test): no_leak_tests = getattr(test, "no_leak_tests", False) if no_leak_tests: print "Test says it doesn't want leak tests!" return test return LeakTestCase(test) def loadTestsFromModule(self, mod): if hasattr(mod, "suite"): return mod.suite() else: return unittest.TestLoader.loadTestsFromModule(self, mod) def loadTestsFromName(self, name, module=None): test = unittest.TestLoader.loadTestsFromName(self, name, module) if isinstance(test, unittest.TestSuite): pass elif isinstance(test, unittest.TestCase): test = self._getTestWrapper(test) else: print "XXX - what is", test return test TestCase = unittest.TestCase def CapturingFunctionTestCase(*args, **kw): real_test = _CapturingFunctionTestCase(*args, **kw) return LeakTestCase(real_test) class _CapturingFunctionTestCase(unittest.FunctionTestCase): | def assertRaisesCOM_HRESULT(self, hresult, func, *args, **kw): try: func(*args, **kw) except pythoncom.com_error, details: if details[0]==hresult: return self.fail("Excepected COM exception with HRESULT 0x%x" % hresult) | 401af4e5b82d1801963b1a20fd4f8fa0884dc514 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/401af4e5b82d1801963b1a20fd4f8fa0884dc514/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
12649,
6141,
4208,
67,
44,
12289,
12,
2890,
16,
366,
2088,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
775,
30,
1326,
30857,
1968,
16,
2826,
9987,
13,
1335,
5790,
832,
18,
832... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
12649,
6141,
4208,
67,
44,
12289,
12,
2890,
16,
366,
2088,
16,
1326,
16,
380,
1968,
16,
2826,
9987,
4672,
775,
30,
1326,
30857,
1968,
16,
2826,
9987,
13,
1335,
5790,
832,
18,
832... |
fileobj = file(filename, 'w') try: config.write(fileobj) fileobj.close() finally: fileobj.close() | config.save() | def _update_sample_config(self): from ConfigParser import ConfigParser config = ConfigParser() for section, options in self.config.defaults().items(): config.add_section(section) for name, value in options.items(): config.set(section, name, value) filename = os.path.join(self.env.path, 'conf', 'trac.ini.sample') try: fileobj = file(filename, 'w') try: config.write(fileobj) fileobj.close() finally: fileobj.close() self.log.info('Wrote sample configuration file with the new ' 'settings and their default values: %s', filename) except IOError, e: self.log.warn('Couldn\'t write sample configuration file (%s)', e, exc_info=True) | 1a79d35c98623b52e7bcaa8db76dee25a37a04b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/1a79d35c98623b52e7bcaa8db76dee25a37a04b9/env.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
6358,
67,
1425,
12,
2890,
4672,
628,
25076,
1930,
25076,
642,
273,
25076,
1435,
364,
2442,
16,
702,
316,
365,
18,
1425,
18,
7606,
7675,
3319,
13332,
642,
18,
1289,
67,
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,
389,
2725,
67,
6358,
67,
1425,
12,
2890,
4672,
628,
25076,
1930,
25076,
642,
273,
25076,
1435,
364,
2442,
16,
702,
316,
365,
18,
1425,
18,
7606,
7675,
3319,
13332,
642,
18,
1289,
67,
3... |
for path in (src_dir, os.path.join(dst_dir, os.path.pardir)): | for path in (src_dir, os.path.abspath(os.path.join(dst_dir, os.path.pardir)) ): | def read_data(path): f = open(path) data = f.read() f.close() return data | bc55384567155f6dee7522f55ec45c435c283b58 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/bc55384567155f6dee7522f55ec45c435c283b58/test_shutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
892,
12,
803,
4672,
284,
273,
1696,
12,
803,
13,
501,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
327,
501,
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,
855,
67,
892,
12,
803,
4672,
284,
273,
1696,
12,
803,
13,
501,
273,
284,
18,
896,
1435,
284,
18,
4412,
1435,
327,
501,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
<path d="M58,84c-4,20-38-4-8-24l-6-5c-36,43,15,56,23,27z" fill="url( <path d="M40,14c-40,37-37,52-9,68l1-8c-16-13-29-21,16-56z" fill="url( <path d="M31,33c19,23,20,7,35,41l-9,1.7c-4-19-8-14-31-37z" fill="url( </g> </svg> </body></html>""") | '<path d="M58,84c-4,20-38-4-8-24l-6-5c-36,43,15,56,23,27z" fill="url( '<path d="M40,14c-40,37-37,52-9,68l1-8c-16-13-29-21,16-56z" fill="url( '<path d="M31,33c19,23,20,7,35,41l-9,1.7c-4-19-8-14-31-37z" fill="url( '</g>' + '</svg>' + '</body></html>') | def test_ns(self): self.saxdiff( | 5a7dc60c29a6ac63dfdfdd0533a6be322c730bfa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/5a7dc60c29a6ac63dfdfdd0533a6be322c730bfa/test_sax.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2387,
12,
2890,
4672,
365,
18,
87,
651,
5413,
12,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2387,
12,
2890,
4672,
365,
18,
87,
651,
5413,
12,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
g = QQ['x'](f) return g | return QQ['x'](f) | def hilbert_class_polynomial(self): r""" Returns a polynomial over $\QQ$ whose roots generate the Hilbert class field of this quadratic field. | 2a259e3659e2fbb631c618303984449cc23e8057 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2a259e3659e2fbb631c618303984449cc23e8057/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
366,
330,
25925,
67,
1106,
67,
3915,
13602,
12,
2890,
4672,
436,
8395,
2860,
279,
16991,
1879,
271,
64,
53,
53,
8,
8272,
12876,
2103,
326,
670,
330,
25925,
667,
652,
434,
333,
26146,
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,
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,
366,
330,
25925,
67,
1106,
67,
3915,
13602,
12,
2890,
4672,
436,
8395,
2860,
279,
16991,
1879,
271,
64,
53,
53,
8,
8272,
12876,
2103,
326,
670,
330,
25925,
667,
652,
434,
333,
26146,
6... |
return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__)) | return "%s (%s)" % (self._testMethodName, _strclass(self.__class__)) | def __str__(self): return "%s (%s)" % (self.__testMethodName, _strclass(self.__class__)) | 81cdb4ebe1e8062168f44f12c80e0426344add31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/81cdb4ebe1e8062168f44f12c80e0426344add31/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
2890,
16186,
3813,
11666,
16,
389,
701,
1106,
12,
2890,
16186,
1106,
972,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
2213,
87,
6142,
87,
2225,
738,
261,
2890,
16186,
3813,
11666,
16,
389,
701,
1106,
12,
2890,
16186,
1106,
972,
3719,
2,
-100,
-100,
-100,
-100,
-100,
... |
if ignore_search_restriction: q = u'%s' % query else: | q = query if not ignore_search_restriction: | def search(self, query, return_matches=False, ignore_search_restriction=False): if not query or not query.strip(): q = '' if not ignore_search_restriction: q = self.search_restriction else: if ignore_search_restriction: q = u'%s' % query else: q = u'%s (%s)' % (self.search_restriction, query) if not q: if return_matches: return list(self._map) # when return_matches, do not update the maps! self._map_filtered = list(self._map) return matches = sorted(self.parse(q)) ans = [id for id in self._map if id in matches] if return_matches: return ans self._map_filtered = ans | c0fbc32e4caf64715d7fb2014563d2aad947f05c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/c0fbc32e4caf64715d7fb2014563d2aad947f05c/caches.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
12,
2890,
16,
843,
16,
327,
67,
8436,
33,
8381,
16,
2305,
67,
3072,
67,
23954,
33,
8381,
4672,
309,
486,
843,
578,
486,
843,
18,
6406,
13332,
1043,
273,
875,
309,
486,
2305,
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,
1623,
12,
2890,
16,
843,
16,
327,
67,
8436,
33,
8381,
16,
2305,
67,
3072,
67,
23954,
33,
8381,
4672,
309,
486,
843,
578,
486,
843,
18,
6406,
13332,
1043,
273,
875,
309,
486,
2305,
67... |
if self.timestamp.match(self.welcome) <= 0: | m = self.timestamp.match(self.welcome) if not m: | def apop(self, user, secret): """Authorisation | 9675d2b1083cc98732c9632f8e8306bfc087a410 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/9675d2b1083cc98732c9632f8e8306bfc087a410/poplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
513,
556,
12,
2890,
16,
729,
16,
4001,
4672,
3536,
3594,
10742,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
513,
556,
12,
2890,
16,
729,
16,
4001,
4672,
3536,
3594,
10742,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if i < first: continue | if i < first: i = i+1 continue | def undoLog(self, first, last, filter=None): self._lock_acquire() try: transactions=self._data.items() pos=len(transactions) encode=base64.encodestring r=[] append=r.append i=0 while i < last and pos: pos=pos-1 if i < first: continue tid, (p, u, d, e, t) = transactions[pos] if p: continue d={'id': encode(tid)[:-1], 'time': TimeStamp(tid).timeTime(), 'user_name': u, 'description': d} if e: d.update(loads(e)) | 790aaedb1613a0f34f64e37303c780c26f86c2cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/790aaedb1613a0f34f64e37303c780c26f86c2cf/DemoStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1343,
12,
2890,
16,
1122,
16,
1142,
16,
1034,
33,
7036,
4672,
365,
6315,
739,
67,
1077,
1039,
1435,
775,
30,
8938,
33,
2890,
6315,
892,
18,
3319,
1435,
949,
33,
1897,
12,
20376,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15436,
1343,
12,
2890,
16,
1122,
16,
1142,
16,
1034,
33,
7036,
4672,
365,
6315,
739,
67,
1077,
1039,
1435,
775,
30,
8938,
33,
2890,
6315,
892,
18,
3319,
1435,
949,
33,
1897,
12,
20376,... |
for file in (zipname, tempfile.TemporaryFile(), StringIO.StringIO()): zipTest(file, zipfile.ZIP_STORED, writtenData) | if zlib: def testDeflated(self): for f in (TESTFN2, TemporaryFile(), StringIO()): self.zipTest(f, zipfile.ZIP_DEFLATED) | def zipTest(f, compression, srccontents): zip = zipfile.ZipFile(f, "w", compression) # Create the ZIP archive zip.write(srcname, "another"+os.extsep+"name") zip.write(srcname, srcname) zip.close() zip = zipfile.ZipFile(f, "r", compression) # Read the ZIP archive readData2 = zip.read(srcname) readData1 = zip.read("another"+os.extsep+"name") zip.close() if readData1 != srccontents or readData2 != srccontents: raise TestFailed, "Written data doesn't equal read data." | 2d2ac3a0a10cdc817f61cb177b9af6e2cc4d5007 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/2d2ac3a0a10cdc817f61cb177b9af6e2cc4d5007/test_zipfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3144,
4709,
12,
74,
16,
9154,
16,
1705,
3980,
4672,
3144,
273,
18823,
18,
29394,
12,
74,
16,
315,
91,
3113,
9154,
13,
282,
468,
1788,
326,
18277,
5052,
3144,
18,
2626,
12,
4816,
529,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3144,
4709,
12,
74,
16,
9154,
16,
1705,
3980,
4672,
3144,
273,
18823,
18,
29394,
12,
74,
16,
315,
91,
3113,
9154,
13,
282,
468,
1788,
326,
18277,
5052,
3144,
18,
2626,
12,
4816,
529,
... |
self.p.portal.registerChecker( PublicKeyCredentialsCheckerDB(self.clientdb)) | self.p.portal.registerChecker(PublicKeyCredentialsCheckerDB(self.clientdb)) | def setUp(self): self.jobdb = JobDatabaseSQLite(test=True) self.monitordb = MonitorDatabase(test=True) self.clientdb = ClientDatabase(test=True) self.dsage_server = DSageServer(self.jobdb, self.monitordb, self.clientdb, log_level=5) self.realm = Realm(self.dsage_server) self.p = _SSHKeyPortalRoot(portal.Portal(self.realm)) self.clientdb = ClientDatabase(test=True) self.p.portal.registerChecker( PublicKeyCredentialsCheckerDB(self.clientdb)) self.client_factory = pb.PBServerFactory(self.p) self.hostname = 'localhost' self.server = reactor.listenTCP(0, self.client_factory) self.port = self.server.getHost().port | f009ab440a5d140f7060b7885d4f6e112512b2dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/f009ab440a5d140f7060b7885d4f6e112512b2dc/test_remote.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
4688,
1966,
273,
3956,
4254,
3997,
1137,
12,
3813,
33,
5510,
13,
365,
18,
2586,
305,
517,
70,
273,
14086,
4254,
12,
3813,
33,
5510,
13,
365,
18,
2625,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
4688,
1966,
273,
3956,
4254,
3997,
1137,
12,
3813,
33,
5510,
13,
365,
18,
2586,
305,
517,
70,
273,
14086,
4254,
12,
3813,
33,
5510,
13,
365,
18,
2625,
... |
LOG('Transience', WARNING, '%s failed when calling %s in %s' % (name,callback, '/'.join(path)), error=sys.exc_info() ) | LOG.warn('%s failed when calling %s in %s' % (name,callback, '/'.join(path)), exc_info=sys.exc_info()) | def _notify(self, item, callback, name): if callable(callback): sm = getSecurityManager() try: user = sm.getUser() try: newSecurityManager(None, nobody) callback(item, self) except: # dont raise, just log path = self.getPhysicalPath() LOG('Transience', WARNING, '%s failed when calling %s in %s' % (name,callback, '/'.join(path)), error=sys.exc_info() ) finally: setSecurityManager(sm) else: err = '%s in %s attempted to call non-callable %s' path = self.getPhysicalPath() LOG('Transience', WARNING, err % (name, '/'.join(path), callback), error=sys.exc_info() ) | 791ea4a915270f180becd9581650dc98d0d998e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/791ea4a915270f180becd9581650dc98d0d998e4/Transience.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12336,
12,
2890,
16,
761,
16,
1348,
16,
508,
4672,
309,
4140,
12,
3394,
4672,
3029,
273,
19288,
1318,
1435,
775,
30,
729,
273,
3029,
18,
588,
1299,
1435,
775,
30,
394,
4368,
1318,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12336,
12,
2890,
16,
761,
16,
1348,
16,
508,
4672,
309,
4140,
12,
3394,
4672,
3029,
273,
19288,
1318,
1435,
775,
30,
729,
273,
3029,
18,
588,
1299,
1435,
775,
30,
394,
4368,
1318,... |
serversocket.bind(('0.0.0.0', settings.SERVER_PORT)) | serversocket.bind(bindInfo) | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(packedSize) responseSize = unpackSize(responseSizePacked) response = '' while len(response) < responseSize: response += s.recv(responseSize - len(response)) print "Received %s bytes " % len(response) print "Got:" + response s.close() return response | fa42ccd8ff665ee11a0257bdbd15ba5d7f6f6f17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13527/fa42ccd8ff665ee11a0257bdbd15ba5d7f6f6f17/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
12,
3567,
16,
655,
16,
892,
4672,
272,
273,
2987,
1435,
1172,
315,
3612,
310,
358,
738,
87,
5319,
87,
6,
738,
261,
3567,
16,
655,
13,
272,
18,
3612,
12443,
3567,
16,
1756,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1004,
12,
3567,
16,
655,
16,
892,
4672,
272,
273,
2987,
1435,
1172,
315,
3612,
310,
358,
738,
87,
5319,
87,
6,
738,
261,
3567,
16,
655,
13,
272,
18,
3612,
12443,
3567,
16,
1756,
3719... |
return self.tokens[self.parsepos] | return self._curr | def curr (self): """Returns the current token.""" return self.tokens[self.parsepos] | bd9ed2c17d104bb179792ba3d49e42faf3be4343 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/bd9ed2c17d104bb179792ba3d49e42faf3be4343/treegenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4306,
261,
2890,
4672,
3536,
1356,
326,
783,
1147,
12123,
327,
365,
18,
7860,
63,
2890,
18,
2670,
917,
65,
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,
4306,
261,
2890,
4672,
3536,
1356,
326,
783,
1147,
12123,
327,
365,
18,
7860,
63,
2890,
18,
2670,
917,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tz_offset, tz_is_valid = self.tz_validate(input[1]) | def get_time(self, input, request_nick): """return the requested time string | b4584c763d1c30d99f2200f65f570aabe0a3e501 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10749/b4584c763d1c30d99f2200f65f570aabe0a3e501/bottime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
957,
12,
2890,
16,
810,
16,
590,
67,
17091,
4672,
3536,
2463,
326,
3764,
813,
533,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
957,
12,
2890,
16,
810,
16,
590,
67,
17091,
4672,
3536,
2463,
326,
3764,
813,
533,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
utils.sh_escape(self.build_dir),)) | utils.sh_escape(self.build_dir),), timeout=600) | def install(self, addresses, build=True, insert_modules=True, syncdir=None): """ Compile the kvm software on the host that the object was initialized with. | b212297edbada24e5309babca751d45907a7157d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/b212297edbada24e5309babca751d45907a7157d/kvm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3799,
12,
2890,
16,
6138,
16,
1361,
33,
5510,
16,
2243,
67,
6400,
33,
5510,
16,
3792,
1214,
33,
7036,
4672,
3536,
16143,
326,
417,
3489,
17888,
603,
326,
1479,
716,
326,
733,
1703,
645... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3799,
12,
2890,
16,
6138,
16,
1361,
33,
5510,
16,
2243,
67,
6400,
33,
5510,
16,
3792,
1214,
33,
7036,
4672,
3536,
16143,
326,
417,
3489,
17888,
603,
326,
1479,
716,
326,
733,
1703,
645... |
'rts': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x12')), 'dtr': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x04')), 'break': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x02')), 'echo': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x05')), 'info': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x09')), 'upload': '%s, %s' % (key_description(MENUCHARACTER), key_description('\x15')), 'itself': '%s, %s' % (key_description(MENUCHARACTER), key_description(MENUCHARACTER)), 'exchar': '%s, %s' % (key_description(MENUCHARACTER), key_description(EXITCHARCTER)), | 'rts': key_description('\x12'), 'repr': key_description('\x01'), 'dtr': key_description('\x04'), 'lfm': key_description('\x0c'), 'break': key_description('\x02'), 'echo': key_description('\x05'), 'info': key_description('\x09'), 'upload': key_description('\x15'), 'itself': key_description(MENUCHARACTER), 'exchar': key_description(EXITCHARCTER), | def get_help_text(): return """ | 6fa76fbc381f3c5ee17d29cea5a9c019b706b34e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2937/6fa76fbc381f3c5ee17d29cea5a9c019b706b34e/miniterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5201,
67,
955,
13332,
327,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5201,
67,
955,
13332,
327,
3536,
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,... |
changesets.append(changeset.ChangeSetFromFile(outFile)) | changesets[csIndex] = changeset.ChangeSetFromFile(outFile) | def getChangeSets(self, repos, jobList, withFiles=True, withFileContents=True, callback=None): for job in jobList: if job[1][0]: raise CacheError('can only cache install,' ' not update changesets') if job[3]: raise CacheError('Cannot cache absolute changesets') | 97430e877272099311c5d531c0402fc0efbfbde6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8749/97430e877272099311c5d531c0402fc0efbfbde6/repocache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
3043,
2785,
12,
2890,
16,
13686,
16,
1719,
682,
16,
598,
2697,
33,
5510,
16,
598,
812,
6323,
33,
5510,
16,
1348,
33,
7036,
4672,
364,
1719,
316,
1719,
682,
30,
309,
1719,
63,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3043,
2785,
12,
2890,
16,
13686,
16,
1719,
682,
16,
598,
2697,
33,
5510,
16,
598,
812,
6323,
33,
5510,
16,
1348,
33,
7036,
4672,
364,
1719,
316,
1719,
682,
30,
309,
1719,
63,
21... |
print "Standard '%s' format gaver error:" % (e[0], error) | print "Standard '%s' format gave error: %s" % (e[0], error) | def strftest1(self, now): if test_support.verbose: print "strftime test for", time.ctime(now) now = self.now # Make sure any characters that could be taken as regex syntax is # escaped in escapestr() expectations = ( ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ('%A', calendar.day_name[now[6]], 'full weekday name'), ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ('%B', calendar.month_name[now[1]], 'full month name'), # %c see below ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ('%H', '%02d' % now[3], 'hour (00-23)'), ('%I', '%02d' % self.clock12, 'hour (01-12)'), ('%j', '%03d' % now[7], 'julian day (001-366)'), ('%m', '%02d' % now[1], 'month as number (01-12)'), ('%M', '%02d' % now[4], 'minute, (00-59)'), ('%p', self.ampm, 'AM or PM as appropriate'), ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ('%U', '%02d' % ((now[7] + self.jan1[6])//7), 'week number of the year (Sun 1st)'), ('%w', '0?%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ('%W', '%02d' % ((now[7] + (self.jan1[6] - 1)%7)//7), 'week number of the year (Mon 1st)'), # %x see below ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ('%y', '%02d' % (now[0]%100), 'year without century'), ('%Y', '%d' % now[0], 'year with century'), # %Z see below ('%%', '%', 'single percent sign'), ) | 08c182d6fb5d9880da3caf136049722d410361dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/08c182d6fb5d9880da3caf136049722d410361dd/test_strftime.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
21,
12,
2890,
16,
2037,
4672,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
273,
365,
18,
3338,
468,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
609,
1222,
395,
21,
12,
2890,
16,
2037,
4672,
309,
1842,
67,
13261,
18,
11369,
30,
1172,
315,
701,
9982,
1842,
364,
3113,
813,
18,
21261,
12,
3338,
13,
2037,
273,
365,
18,
3338,
468,
... |
>>> f(i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, ... i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, ... i23, i24, i25, i26, i27, i28, i29, i30, i31, i32, i33, ... i34, i35, i36, i37, i38, i39, i40, i41, i42, i43, i44, ... i45, i46, i47, i48, i49, i50, i51, i52, i53, i54, i55, ... i56, i57, i58, i59, i60, i61, i62, i63, i64, i65, i66, ... i67, i68, i69, i70, i71, i72, i73, i74, i75, i76, i77, ... i78, i79, i80, i81, i82, i83, i84, i85, i86, i87, i88, ... i89, i90, i91, i92, i93, i94, i95, i96, i97, i98, i99, ... i100, i101, i102, i103, i104, i105, i106, i107, i108, ... i109, i110, i111, i112, i113, i114, i115, i116, i117, ... i118, i119, i120, i121, i122, i123, i124, i125, i126, ... i127, i128, i129, i130, i131, i132, i133, i134, i135, ... i136, i137, i138, i139, i140, i141, i142, i143, i144, ... i145, i146, i147, i148, i149, i150, i151, i152, i153, ... i154, i155, i156, i157, i158, i159, i160, i161, i162, ... i163, i164, i165, i166, i167, i168, i169, i170, i171, ... i172, i173, i174, i175, i176, i177, i178, i179, i180, ... i181, i182, i183, i184, i185, i186, i187, i188, i189, ... i190, i191, i192, i193, i194, i195, i196, i197, i198, ... i199, i200, i201, i202, i203, i204, i205, i206, i207, ... i208, i209, i210, i211, i212, i213, i214, i215, i216, ... i217, i218, i219, i220, i221, i222, i223, i224, i225, ... i226, i227, i228, i229, i230, i231, i232, i233, i234, ... i235, i236, i237, i238, i239, i240, i241, i242, i243, ... i244, i245, i246, i247, i248, i249, i250, i251, i252, ... i253, i254, i255) Traceback (most recent call last): SyntaxError: more than 255 arguments (<doctest test.test_syntax[25]>, line 1) | >>> def f(it, *varargs): | 5f8c58479227a85c1f0ce4fec273433495ceac8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/5f8c58479227a85c1f0ce4fec273433495ceac8d/test_syntax.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
305,
16,
380,
1401,
1968,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
12,
305,
16,
380,
1401,
1968,
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,
... | |
defaults.update(Dict(self.request, self.pagename).get_dict()) return defaults | if params["remoteMatch"] is not None: params["remoteMatch"] = re.compile(params["remoteMatch"], re.U) return params | def parsePage(self): defaults = { "remotePrefix": "", "localPrefix": "", "remoteWiki": "" } defaults.update(Dict(self.request, self.pagename).get_dict()) return defaults | 040e5dcf6357c3b978815cb65f08dc31b1f2365c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/040e5dcf6357c3b978815cb65f08dc31b1f2365c/SyncPages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1964,
12,
2890,
4672,
3467,
273,
288,
315,
7222,
2244,
6877,
23453,
315,
3729,
2244,
6877,
23453,
315,
7222,
25438,
6877,
1408,
289,
225,
3467,
18,
2725,
12,
5014,
12,
2890,
18,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
1964,
12,
2890,
4672,
3467,
273,
288,
315,
7222,
2244,
6877,
23453,
315,
3729,
2244,
6877,
23453,
315,
7222,
25438,
6877,
1408,
289,
225,
3467,
18,
2725,
12,
5014,
12,
2890,
18,
22... |
IncDirectory("FREETYPE", "/usr/X11/include/freetype2/") | IncDirectory("FREETYPE", "/usr/X11/include/freetype2") | def parseopts(args): global OPTIMIZE,INSTALLER,RUNTIME,GENMAN global VERSION,COMPRESSOR,VERBOSE,THREADCOUNT longopts = [ "help", "optimize=","everything","nothing","installer","runtime", "version=","lzma","no-python","threads=","outputdir="] anything = 0 for pkg in PkgListGet(): longopts.append("no-"+pkg.lower()) for pkg in PkgListGet(): longopts.append("use-"+pkg.lower()) try: opts, extras = getopt.getopt(args, "", longopts) for option,value in opts: if (option=="--help"): raise "usage" elif (option=="--optimize"): OPTIMIZE=value elif (option=="--installer"): INSTALLER=1 elif (option=="--runtime"): RUNTIME=1 elif (option=="--genman"): GENMAN=1 elif (option=="--everything"): PkgEnableAll() elif (option=="--nothing"): PkgDisableAll() elif (option=="--threads"): THREADCOUNT=int(value) elif (option=="--outputdir"): SetOutputDir(value.strip()) elif (option=="--version"): VERSION=value if (len(VERSION.split(".")) != 3): raise "usage" elif (option=="--lzma"): COMPRESSOR="lzma" else: for pkg in PkgListGet(): if (option=="--use-"+pkg.lower()): PkgEnable(pkg) break for pkg in PkgListGet(): if (option=="--no-"+pkg.lower()): PkgDisable(pkg) break anything = 1 except: usage(0) if (anything==0): usage(0) if (OPTIMIZE=="1"): OPTIMIZE=1 elif (OPTIMIZE=="2"): OPTIMIZE=2 elif (OPTIMIZE=="3"): OPTIMIZE=3 elif (OPTIMIZE=="4"): OPTIMIZE=4 else: usage("Invalid setting for OPTIMIZE") | ea3a9ffaa80b498b69dcba7321b34e79a781b3a0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8543/ea3a9ffaa80b498b69dcba7321b34e79a781b3a0/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4952,
12,
1968,
4672,
2552,
16456,
3445,
15641,
16,
28865,
654,
16,
54,
25375,
16,
16652,
9560,
2552,
8456,
16,
4208,
22526,
916,
16,
21900,
16,
21730,
7240,
1525,
4952,
273,
306,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
4952,
12,
1968,
4672,
2552,
16456,
3445,
15641,
16,
28865,
654,
16,
54,
25375,
16,
16652,
9560,
2552,
8456,
16,
4208,
22526,
916,
16,
21900,
16,
21730,
7240,
1525,
4952,
273,
306,
... |
version = '0.0.0.0' | version = '' ver_file = '' | def main(argv): version = '0.0.0.0' if len(argv) > 0: opts, args = getopt.getopt(argv, "hclv:f:", [ "help", "cleanup", "libraries", "version=", "file="]) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() if opt in ("-v", "--version"): version = arg print "Start building WinMerge release version " + version if opt in ("-c", "--cleanup"): if cleanup_build() == True: print 'Cleanup done.' sys.exit() if opt in ("-l", "--libraries"): build_libraries() sys.exit() if opt in ("-f", "--file"): ver_file = arg # Check all required tools are found (script configuration) if check_tools() == False: sys.exit() # Check we are running from correct folder (and go to root if found) if find_winmerge_root() == False: print 'ERROR: Cannot find WinMerge root folder!' print 'The script must be run from WinMerge tree\'s root folder' print '(which has Src- and Filter -folders as subfolders) or from' print 'Tools/Scripts -folder (where this script is located).' sys.exit() # Check 64-bit ShellExtension is compiled if check_x64shellext() == False: sys.exit() # Create the distribution folder if it doesn't exist try: if not os.path.exists(dist_root_folder): os.mkdir(dist_root_folder) except EnvironmentError, einst: print 'Error creating distribution folder: ' + dist_root_folder print einst sys.exit() # Remove old build's files if cleanup_build() == False: sys.exit() if len(ver_file) > 0: version_read = get_product_version(ver_file) if len(version_read) > 0: version = version_read set_resource_version(ver_file) version_folder = 'WinMerge-' + version dist_folder = get_and_create_dist_folder(version_folder) if dist_folder == '': sys.exit(1) dist_src_folder = get_src_dist_folder(dist_folder, version_folder) svn_export(dist_src_folder) setup_translations() build_targets() build_manual() build_innosetup_installer(dist_folder) dist_bin_folder = get_and_create_bin_folder(dist_folder, version_folder) create_bin_folders(dist_bin_folder, dist_src_folder) # Do the cleanup after creating binary distrib folders, as some files # and folders are copied from source folders to binary folders. cleanup_dlls_from_plugins(dist_src_folder) runtimes_folder = get_and_create_runtimes_folder(dist_folder, version) create_runtime_folder(runtimes_folder) print 'WinMerge release script ready!' | 2fb63ad336c6ab033eddfb72b565c9856cdfd0af /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5344/2fb63ad336c6ab033eddfb72b565c9856cdfd0af/create_release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
1177,
273,
875,
1924,
67,
768,
273,
875,
309,
562,
12,
19485,
13,
405,
374,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
16,
315,
76,
830,
90,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19485,
4672,
1177,
273,
875,
1924,
67,
768,
273,
875,
309,
562,
12,
19485,
13,
405,
374,
30,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
19485,
16,
315,
76,
830,
90,
... |
lib_filename = os.path.join(workdir, '%s.so'% module_name) | lib_filename = os.path.join(workdir, '%s.%s' % (module_name, get_lib_extension())) | def gcc_module_compile_str(module_name, src_code, location=None, include_dirs=[], lib_dirs=[], libs=[], preargs=[], tmpdir=None): #TODO: don't to the dlimport in this function preargs= [] if preargs is None else list(preargs) preargs.append('-fPIC') no_opt = False include_dirs = [distutils.sysconfig.get_python_inc()] + \ numpy.distutils.misc_util.get_numpy_include_dirs()\ + include_dirs libs = [os.path.split(distutils.sysconfig.get_python_inc())[-1]] + libs workdir = location cppfilename = os.path.join(workdir, 'mod.cpp') cppfile = file(cppfilename, 'w') debug('Writing module C++ code to', cppfilename) ofiles = [] rval = None cppfile.write(src_code) cppfile.close() lib_filename = os.path.join(workdir, '%s.so'% module_name) debug('Generating shared lib', lib_filename) cmd = ['g++', '-shared', '-g'] if no_opt: cmd.extend(p for p in preargs if not p.startswith('-O')) else: cmd.extend(preargs) cmd.extend('-I%s'%idir for idir in include_dirs) cmd.extend(['-o',lib_filename]) cmd.append(cppfilename) cmd.extend(['-L%s'%ldir for ldir in lib_dirs]) cmd.extend(['-l%s'%l for l in libs]) debug('Running cmd', ' '.join(cmd)) p = subprocess.Popen(cmd) status = p.wait() if status: error('g++ return status', status) else: #touch the __init__ file file(os.path.join(workdir, "__init__.py"),'w').close() rval = dlimport(lib_filename) return rval | 34736410034ae227077cfdd63b7214eb3408525e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/34736410034ae227077cfdd63b7214eb3408525e/cmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
952,
67,
2978,
67,
11100,
67,
701,
12,
2978,
67,
529,
16,
1705,
67,
710,
16,
2117,
33,
7036,
16,
2341,
67,
8291,
22850,
6487,
2561,
67,
8291,
22850,
6487,
15042,
22850,
6487,
675,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
952,
67,
2978,
67,
11100,
67,
701,
12,
2978,
67,
529,
16,
1705,
67,
710,
16,
2117,
33,
7036,
16,
2341,
67,
8291,
22850,
6487,
2561,
67,
8291,
22850,
6487,
15042,
22850,
6487,
675,... |
out_record_in_format = call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) | out_record_in_format = call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid, verbose=verbose) | def print_record(recID, format='hb', ot='', ln=cdslang, decompress=zlib.decompress, search_pattern=None, uid=None): "Prints record 'recID' formatted accoding to 'format'." _ = gettext_set_language(ln) out = "" # sanity check: record_exist_p = record_exists(recID) if record_exist_p == 0: # doesn't exist return out # New Python BibFormat procedure for formatting # Old procedure follows further below # We must still check some special formats, but these # should disappear when BibFormat improves. if not (CFG_BIBFORMAT_USE_OLD_BIBFORMAT \ or format.lower().startswith('t') \ or format.lower().startswith('hm') \ or str(format[0:3]).isdigit() \ or ot): # Unspecified format is hd if format == '': format = 'hd' if record_exist_p == -1 and get_output_format_content_type(format) == 'text/html': # HTML output displays a default value for deleted records. # Other format have to deal with it. out += _("The record has been deleted.") else: out += call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) # at the end of HTML brief mode, print the "Detailed record" functionality: if format.lower().startswith('hb') and \ format.lower() != 'hb_p': out += websearch_templates.tmpl_print_record_brief_links( ln = ln, recID = recID, weburl = weburl ) return out # Old PHP BibFormat procedure for formatting # print record opening tags, if needed: if format == "marcxml" or format == "oai_dc": out += " <record>\n" out += " <header>\n" for oai_id in get_fieldvalues(recID, CFG_OAI_ID_FIELD): out += " <identifier>%s</identifier>\n" % oai_id out += " <datestamp>%s</datestamp>\n" % get_modification_date(recID) out += " </header>\n" out += " <metadata>\n" if format.startswith("xm") or format == "marcxml": # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res and record_exist_p == 1: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format' -- they are not in "bibfmt" table; so fetch all the data from "bibXXx" tables: if format == "marcxml": out += """ <record xmlns="http://www.loc.gov/MARC21/slim">\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) elif format.startswith("xm"): out += """ <record>\n""" out += " <controlfield tag=\"001\">%d</controlfield>\n" % int(recID) if record_exist_p == -1: # deleted record, so display only OAI ID and 980: oai_ids = get_fieldvalues(recID, CFG_OAI_ID_FIELD) if oai_ids: out += "<datafield tag=\"%s\" ind1=\"%s\" ind2=\"%s\"><subfield code=\"%s\">%s</subfield></datafield>\n" % \ (CFG_OAI_ID_FIELD[0:3], CFG_OAI_ID_FIELD[3:4], CFG_OAI_ID_FIELD[4:5], CFG_OAI_ID_FIELD[5:6], oai_ids[0]) out += "<datafield tag=\"980\" ind1=\"\" ind2=\"\"><subfield code=\"c\">DELETED</subfield></datafield>\n" else: for digit1 in range(0, 10): for digit2 in range(0, 10): bx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) 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, recID, str(digit1)+str(digit2)) res = run_sql(query) 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 format.startswith("xm") or format == "marcxml": if field_number_old != -999: out += """ </datafield>\n""" out += """ <datafield tag="%s" ind1="%s" ind2="%s">\n""" % \ (encode_for_xml(field[0:3]), encode_for_xml(ind1), encode_for_xml(ind2)) field_number_old = field_number field_old = field # print subfield value if format.startswith("xm") or format == "marcxml": value = encode_for_xml(value) out += """ <subfield code="%s">%s</subfield>\n""" % (encode_for_xml(field[-1:]), value) # all fields/subfields printed in this run, so close the tag: if (format.startswith("xm") or format == "marcxml") and field_number_old != -999: out += """ </datafield>\n""" # we are at the end of printing the record: if format.startswith("xm") or format == "marcxml": out += " </record>\n" elif format == "xd" or format == "oai_dc": # XML Dublin Core format, possibly OAI -- select only some bibXXx fields: out += """ <dc xmlns="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://purl.org/dc/elements/1.1/ http://www.openarchives.org/OAI/1.1/dc.xsd">\n""" if record_exist_p == -1: out += "" else: for f in get_fieldvalues(recID, "041__a"): out += " <language>%s</language>\n" % f for f in get_fieldvalues(recID, "100__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "700__a"): out += " <creator>%s</creator>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "245__a"): out += " <title>%s</title>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "65017a"): out += " <subject>%s</subject>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "8564_u"): out += " <identifier>%s</identifier>\n" % encode_for_xml(f) for f in get_fieldvalues(recID, "520__a"): out += " <description>%s</description>\n" % encode_for_xml(f) out += " <date>%s</date>\n" % get_creation_date(recID) out += " </dc>\n" elif str(format[0:3]).isdigit(): # user has asked to print some fields only if format == "001": out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, recID, format) else: vals = get_fieldvalues(recID, format) for val in vals: out += "<!--%s-begin-->%s<!--%s-end-->\n" % (format, val, format) elif format.startswith('t'): ## user directly asked for some tags to be displayed only if record_exist_p == -1: out += get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"]) else: out += get_fieldvalues_alephseq_like(recID, ot) elif format == "hm": if record_exist_p == -1: out += "<pre>" + cgi.escape(get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"])) + "</pre>" else: out += "<pre>" + cgi.escape(get_fieldvalues_alephseq_like(recID, ot)) + "</pre>" elif format.startswith("h") and ot: ## user directly asked for some tags to be displayed only if record_exist_p == -1: out += "<pre>" + get_fieldvalues_alephseq_like(recID, ["001", CFG_OAI_ID_FIELD, "980"]) + "</pre>" else: out += "<pre>" + get_fieldvalues_alephseq_like(recID, ot) + "</pre>" elif format == "hd": # HTML detailed format if record_exist_p == -1: out += _("The record has been deleted.") else: # look for detailed format existence: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format', so try to call BibFormat on the fly or use default format: out_record_in_format = call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) if out_record_in_format: out += out_record_in_format else: out += websearch_templates.tmpl_print_record_detailed( ln = ln, recID = recID, weburl = weburl, ) elif format.startswith("hb_") or format.startswith("hd_"): # underscore means that HTML brief/detailed formats should be called on-the-fly; suitable for testing formats if record_exist_p == -1: out += _("The record has been deleted.") else: out += call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) elif format.startswith("hx"): # BibTeX format, called on the fly: if record_exist_p == -1: out += _("The record has been deleted.") else: out += call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) elif format.startswith("hs"): # for citation/download similarity navigation links: if record_exist_p == -1: out += _("The record has been deleted.") else: out += '<a href="%s">' % websearch_templates.build_search_url(recid=recID, ln=ln) # firstly, title: titles = get_fieldvalues(recID, "245__a") if titles: for title in titles: out += "<strong>%s</strong>" % title else: # usual title not found, try conference title: titles = get_fieldvalues(recID, "111__a") if titles: for title in titles: out += "<strong>%s</strong>" % title else: # just print record ID: out += "<strong>%s %d</strong>" % (get_field_i18nname("record ID", ln), recID) out += "</a>" # secondly, authors: authors = get_fieldvalues(recID, "100__a") + get_fieldvalues(recID, "700__a") if authors: out += " - %s" % authors[0] if len(authors) > 1: out += " <em>et al</em>" # thirdly publication info: publinfos = get_fieldvalues(recID, "773__s") if not publinfos: publinfos = get_fieldvalues(recID, "909C4s") if not publinfos: publinfos = get_fieldvalues(recID, "037__a") if not publinfos: publinfos = get_fieldvalues(recID, "088__a") if publinfos: out += " - %s" % publinfos[0] else: # fourthly publication year (if not publication info): years = get_fieldvalues(recID, "773__y") if not years: years = get_fieldvalues(recID, "909C4y") if not years: years = get_fieldvalues(recID, "260__c") if years: out += " (%s)" % years[0] else: # HTML brief format by default if record_exist_p == -1: out += _("The record has been deleted.") else: query = "SELECT value FROM bibfmt WHERE id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query) if res: # record 'recID' is formatted in 'format', so print it out += "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format', so try to call BibFormat on the fly: or use default format: if CFG_WEBSEARCH_CALL_BIBFORMAT: out_record_in_format = call_bibformat(recID, format, ln, search_pattern=search_pattern, uid=uid) if out_record_in_format: out += out_record_in_format else: out += websearch_templates.tmpl_print_record_brief( ln = ln, recID = recID, weburl = weburl, ) else: out += websearch_templates.tmpl_print_record_brief( ln = ln, recID = recID, weburl = weburl, ) # at the end of HTML brief mode, print the "Detailed record" functionality: if format == 'hp' or format.startswith("hb_") or format.startswith("hd_"): pass # do nothing for portfolio and on-the-fly formats else: out += websearch_templates.tmpl_print_record_brief_links( ln = ln, recID = recID, weburl = weburl, ) # print record closing tags, if needed: if format == "marcxml" or format == "oai_dc": out += " </metadata>\n" out += " </record>\n" return out | 845a99c9c5de9c5d99d06ec25bc8f5be515522e8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/845a99c9c5de9c5d99d06ec25bc8f5be515522e8/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
3366,
12,
3927,
734,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
4315,
2069,
539,
16,
16824,
33,
94,
2941,
18,
323,
14706,
16,
1623,
67,
4951,
33,
7036,
16,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
3366,
12,
3927,
734,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
4315,
2069,
539,
16,
16824,
33,
94,
2941,
18,
323,
14706,
16,
1623,
67,
4951,
33,
7036,
16,
4... |
task = task_low_level_submission('bibupload', 'bibdocfile', '-a', tmp_file_name, '-N', 'FFT', '-S2', '-v9') | task = task_low_level_submission('bibupload', 'bibdocfile', '-a', tmp_file_name, '-N', 'FFT', '-S2') | def bibupload_ffts(ffts, append=False, debug=False): """Given an ffts dictionary it creates the xml and submit it.""" xml = ffts_to_xml(ffts) if xml: print xml tmp_file_fd, tmp_file_name = mkstemp(suffix='.xml', prefix="bibdocfile_%s" % time.strftime("%Y-%m-%d_%H:%M:%S"), dir=CFG_TMPDIR) os.write(tmp_file_fd, xml) os.close(tmp_file_fd) os.chmod(tmp_file_name, 0644) if append: wait_for_user("This will be appended via BibUpload") if debug: task = task_low_level_submission('bibupload', 'bibdocfile', '-a', tmp_file_name, '-N', 'FFT', '-S2', '-v9') else: task = task_low_level_submission('bibupload', 'bibdocfile', '-a', tmp_file_name, '-N', 'FFT', '-S2', '-v9') print "BibUpload append submitted with id %s" % task else: wait_for_user("This will be corrected via BibUpload") if debug: task = task_low_level_submission('bibupload', 'bibdocfile', '-c', tmp_file_name, '-N', 'FFT', '-S2', '-v9') else: task = task_low_level_submission('bibupload', 'bibdocfile', '-c', tmp_file_name, '-N', 'FFT', '-S2') print "BibUpload correct submitted with id %s" % task else: print >> sys.stderr, "WARNING: no MARC to upload." return True | 988a40bcd752f10dc18b75dc48bab593d04d7e28 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/988a40bcd752f10dc18b75dc48bab593d04d7e28/bibdocfilecli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25581,
6327,
67,
25174,
87,
12,
25174,
87,
16,
714,
33,
8381,
16,
1198,
33,
8381,
4672,
3536,
6083,
392,
15741,
87,
3880,
518,
3414,
326,
2025,
471,
4879,
518,
12123,
2025,
273,
15741,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25581,
6327,
67,
25174,
87,
12,
25174,
87,
16,
714,
33,
8381,
16,
1198,
33,
8381,
4672,
3536,
6083,
392,
15741,
87,
3880,
518,
3414,
326,
2025,
471,
4879,
518,
12123,
2025,
273,
15741,
... |
def __init__(self, user_name, api_key, api_secret, session_key): | def __init__(self, user_name, api_key, api_secret, session_key=""): | def __init__(self, user_name, api_key, api_secret, session_key): _BaseObject.__init__(self, api_key, api_secret, session_key) self.name = user_name self._past_events_index = 0 self._recommended_events_index = 0 self._recommended_artists_index = 0 | 8d8063afe8067477accae5bef5e470a4a3cbfa5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/8d8063afe8067477accae5bef5e470a4a3cbfa5d/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
729,
67,
529,
16,
1536,
67,
856,
16,
1536,
67,
5875,
16,
1339,
67,
856,
1546,
6,
4672,
389,
2171,
921,
16186,
2738,
972,
12,
2890,
16,
1536,
67,
856,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
729,
67,
529,
16,
1536,
67,
856,
16,
1536,
67,
5875,
16,
1339,
67,
856,
1546,
6,
4672,
389,
2171,
921,
16186,
2738,
972,
12,
2890,
16,
1536,
67,
856,
... |
elif dist.maintainer: if not dist.maintainer_email: | elif metadata.maintainer: if not metadata.maintainer_email: | def check_metadata (self): | d76d5ed4286be14faefb34c708b9fe5863a2c047 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d76d5ed4286be14faefb34c708b9fe5863a2c047/sdist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4165,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
4165,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
.select(lambda item: (item, proj1(item))) \ .todict() | .select(lambda item: (key_selector(item), item)) \ .to_dict() | def todict(self, proj1=None, proj2=None): if proj1 and proj2: return self \ .select(lambda item: (proj1(item), proj2(item))) \ .todict() elif proj1: return self \ .select(lambda item: (item, proj1(item))) \ .todict() else: return dict(self) | f134b825431ac82f3dbba76e7a945a0e195d27cf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14315/f134b825431ac82f3dbba76e7a945a0e195d27cf/pyquery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
1576,
12,
2890,
16,
10296,
21,
33,
7036,
16,
10296,
22,
33,
7036,
4672,
309,
10296,
21,
471,
10296,
22,
30,
327,
365,
521,
263,
4025,
12,
14661,
761,
30,
261,
17995,
21,
12,
172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
1576,
12,
2890,
16,
10296,
21,
33,
7036,
16,
10296,
22,
33,
7036,
4672,
309,
10296,
21,
471,
10296,
22,
30,
327,
365,
521,
263,
4025,
12,
14661,
761,
30,
261,
17995,
21,
12,
172... |
self.exc = exc | if exc is None: self.exc = _SilentException() else: self.exc = exc | def __init__(self, seconds, exc=TimeoutError): self.seconds = seconds self.exc = exc | 15af1869a96ad55e13c55ed1a3ee6ea83469c719 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/15af1869a96ad55e13c55ed1a3ee6ea83469c719/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3974,
16,
3533,
33,
2694,
668,
4672,
365,
18,
7572,
273,
3974,
365,
18,
10075,
273,
3533,
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,
0,
0,
0,
0,
0,
0,
0,
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,
3974,
16,
3533,
33,
2694,
668,
4672,
365,
18,
7572,
273,
3974,
365,
18,
10075,
273,
3533,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'Unfortunately, due to Python compiler limitations' \ ' context is not available\n', | 'Unfortunately, due to Python compiler limitations', ' context is not available\n', 'Program text is\n%s' % '\n'.join(["%04d: %s" % (i+1, srclines[i]) for i in range(len(srclines))]), | def format ( self ): """ Format self nicely """ | b05d379bfeb2bb22b3830a352887c25e072387a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/b05d379bfeb2bb22b3830a352887c25e072387a3/SkunkExcept.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
261,
365,
262,
30,
3536,
4077,
365,
11562,
2357,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
261,
365,
262,
30,
3536,
4077,
365,
11562,
2357,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
support.run_unittest(PEP3120Test) | support.run_unittest(PEP3120Test, BuiltinCompileTests) | def test_main(): support.run_unittest(PEP3120Test) | a319028429a0456a16f17c4903c8c2854b102960 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/a319028429a0456a16f17c4903c8c2854b102960/test_pep3120.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
1423,
52,
23,
22343,
4709,
16,
27376,
267,
9937,
14650,
13,
225,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
13332,
2865,
18,
2681,
67,
4873,
3813,
12,
1423,
52,
23,
22343,
4709,
16,
27376,
267,
9937,
14650,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
def __init__(self, data, testdefaults=None, parent=None): | def __init__(self, data, parent=None): | def __init__(self, data, testdefaults=None, parent=None): BaseTestSuite.__init__(self, data.name, data.source, parent) self.variables = GLOBAL_VARIABLES.copy() self.variables.set_from_variable_table(data.variable_table) self.source = data.source self.doc = data.setting_table.doc.value self.metadata = self._get_metadata(data.setting_table.metadata) self.imports = data.setting_table.imports self.user_keywords = UserLibrary(data.keyword_table.keywords) self.setup = Setup(data.setting_table.suite_setup.name, data.setting_table.suite_setup.args) self.teardown = Teardown(data.setting_table.suite_teardown.name, data.setting_table.suite_teardown.args) | 1197844b161cb87f977ac685990521cc80ac8253 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/1197844b161cb87f977ac685990521cc80ac8253/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
982,
33,
7036,
4672,
3360,
4709,
13587,
16186,
2738,
972,
12,
2890,
16,
501,
18,
529,
16,
501,
18,
3168,
16,
982,
13,
365,
18,
7528,
273,
7779... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
982,
33,
7036,
4672,
3360,
4709,
13587,
16186,
2738,
972,
12,
2890,
16,
501,
18,
529,
16,
501,
18,
3168,
16,
982,
13,
365,
18,
7528,
273,
7779... |
print element | def top_bar(self,emission,source,param): #print dir(emission) element = emission.name_get() #if element == 'contacts_list' or element == 'save_contact': #try: #emission.part_swallow_get(param).delete() #except Exception,e: #print e #try: #emission.delete() #except Exception,e: #print e #if element == 'main_dialer_window': print element #emission.signal_emit('close_application','*') self.main.emit('back') #else: #print element | 01c25941dcc46b5166dcddd3aeed3ae3b26b48e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4712/01c25941dcc46b5166dcddd3aeed3ae3b26b48e6/paroli-dialer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1760,
67,
3215,
12,
2890,
16,
351,
19710,
16,
3168,
16,
891,
4672,
468,
1188,
1577,
12,
351,
19710,
13,
930,
273,
801,
19710,
18,
529,
67,
588,
1435,
468,
430,
930,
422,
296,
20777,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1760,
67,
3215,
12,
2890,
16,
351,
19710,
16,
3168,
16,
891,
4672,
468,
1188,
1577,
12,
351,
19710,
13,
930,
273,
801,
19710,
18,
529,
67,
588,
1435,
468,
430,
930,
422,
296,
20777,
... | |
remove(f) | remove(dl) | def postCheck(self, dl): | 72a6a690e039c4ce9e9fa88fac75446080171cca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/72a6a690e039c4ce9e9fa88fac75446080171cca/RapidshareCom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
1564,
12,
2890,
16,
8910,
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,
1603,
1564,
12,
2890,
16,
8910,
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,
-10... |
name = unicodeName(name, language, altlanguage) | def html2unicode(name, language, altlanguage=None): name = removeEntity(name) name = unicodeName(name, language, altlanguage) import re Runi = re.compile('&#(\d+);') result = u'' i=0 while i < len(name): m = Runi.match(name[i:]) if m: result += unichr(int(m.group(1))) i += m.end() else: try: result += name[i] i += 1 except UnicodeDecodeError: print repr(name) raise return result | 8a20ede1500cc2b2aa6341ce8fee5b30d219623f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/8a20ede1500cc2b2aa6341ce8fee5b30d219623f/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
22,
9124,
12,
529,
16,
2653,
16,
3770,
4923,
33,
7036,
4672,
508,
273,
1206,
1943,
12,
529,
13,
225,
1930,
283,
1939,
77,
273,
283,
18,
11100,
2668,
18642,
4713,
72,
15,
1769,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1729,
22,
9124,
12,
529,
16,
2653,
16,
3770,
4923,
33,
7036,
4672,
508,
273,
1206,
1943,
12,
529,
13,
225,
1930,
283,
1939,
77,
273,
283,
18,
11100,
2668,
18642,
4713,
72,
15,
1769,
... | |
if status in ["fail", "error"]: | if status == "fail": | def raw_handler(self, *args): if not handler.__name__.startswith("request_"): raise ValueError("This decorator can only be used on a katcp request.") msgname = handler.__name__[8:].replace("_","-") reply_args = handler(self, *args) status = reply_args[0] if status in ["fail", "error"]: return katcp.Message.reply(msgname, *pack_types((Str(),Str()), reply_args)) if status == "ok": return katcp.Message.reply(msgname, *pack_types((Str(),) + types, reply_args)) raise ValueError("First returned value must be 'ok', 'fail' or 'error'.") | b9739f1beb6eb69bc5fa664208d1c89a3e5b300c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10400/b9739f1beb6eb69bc5fa664208d1c89a3e5b300c/kattypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1831,
67,
4176,
12,
2890,
16,
380,
1968,
4672,
309,
486,
1838,
16186,
529,
25648,
17514,
1918,
2932,
2293,
9548,
4672,
1002,
2068,
2932,
2503,
7367,
848,
1338,
506,
1399,
603,
279,
417,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1831,
67,
4176,
12,
2890,
16,
380,
1968,
4672,
309,
486,
1838,
16186,
529,
25648,
17514,
1918,
2932,
2293,
9548,
4672,
1002,
2068,
2932,
2503,
7367,
848,
1338,
506,
1399,
603,
279,
417,
... |
self.dialog = gtk.Dialog(parent = parent, title = _("Add a new tag")) self.dialog.connect('close', self.destroy) self.dialog.set_border_width(12) self.dialog.set_resizable(False) self.dialog.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, | gtk.Dialog.__init__(self, _("Add a new tag"), parent) self.set_border_width(6) self.set_resizable(False) self.add_buttons(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, | def __init__(self, parent, can_change): if can_change == True: self.limit = False can = ["title", "version", "artist", "album", "performer", "discnumber"] else: self.limit = True can = can_change can.sort() | 44deb3636adb3eb180d1cc44ce811a1cb782bb80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/44deb3636adb3eb180d1cc44ce811a1cb782bb80/widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
848,
67,
3427,
4672,
309,
848,
67,
3427,
422,
1053,
30,
365,
18,
3595,
273,
1083,
848,
273,
8247,
2649,
3113,
315,
1589,
3113,
315,
25737,
3113,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
982,
16,
848,
67,
3427,
4672,
309,
848,
67,
3427,
422,
1053,
30,
365,
18,
3595,
273,
1083,
848,
273,
8247,
2649,
3113,
315,
1589,
3113,
315,
25737,
3113,... |
if 'downloadDir' not in self['global'] or self['global']['downloadDir'] == None: raise SystemExit(u"Must specify downloadDir in [global] config\nInvalid configuration, no download directory") | if self['global']['downloadDir'] == None: raise SystemExit(u"""Must specify downloadDir in [global] config Invalid configuration, no download directory""") | def check(self): global mechanize if not self['global']['urllib'] and not mechanize: print >> sys.stderr, 'Using urllib2 instead of mechanize. setting urllib = True' self['global']['urllib'] = True if 'saveFile' not in self['global'] or self['global']['saveFile'] == None: self['global']['saveFile'] = u'savedstate.dat' if 'downloadDir' not in self['global'] or self['global']['downloadDir'] == None: raise SystemExit(u"Must specify downloadDir in [global] config\nInvalid configuration, no download directory") if 'runOnce' not in self['global'] or self['global']['runOnce'] == None: self['global']['runOnce'] = False if 'scanMins' not in self['global'] or self['global']['scanMins'] == None: self['global']['scanMins'] = 15 if self['global']['cookieType'] == 'MSIECookieJar' and self['global']['urllib']: raise SystemExit( u"Cannot use MSIECookieJar with urllib = True. Choose one or the other. May be caused by failed mechanize import. Incompatible configuration, IE cookies must use mechanize. please install and configure mechanize") if self['global']['cookieType'] not in ['MSIECookieJar' ,'LWPCookieJar' , 'MozillaCookieJar' ]: raise SystemExit(u'Invalid cookieType option: %s. Only MSIECookieJar, LWPCookieJar, and MozillaCookieJar are valid options. Exiting...' % self['global']['cookieType']) if 'lockPort' not in self['global'] or self['global']['lockPort'] == None: self['global']['lockPort'] = 8023 if 'log' in self['global'] and self['global']['log']: if 'logFile' not in self['global'] or self['global']['logFile'] == None: self['global']['logFile'] = u'downloads.log' # check all directories to make sure they exist. Ask for creation? if self['global']['downloadDir']: if not os.path.isdir( os.path.join(self['global']['workingDir'], self['global']['downloadDir']) ): try: os.mkdir( os.path.join(self['global']['workingDir'], self['global']['downloadDir']) ) except OSError, m: raise SystemExit(unicodeC(m) + os.linesep + u"Could not find path %s and could not make a directory there. Please make sure this path is correct and try creating the folder with proper permissions for me" % os.path.join(self['global']['workingDir'], self['global']['downloadDir'])) for thread in self['threads']: if self['threads'][thread]['directory'] and not os.path.isdir( os.path.join(self['global']['workingDir'], self['threads'][thread]['directory']) ): try: os.mkdir( os.path.join(self['global']['workingDir'], self['threads'][thread]['directory']) ) except OSError, m: raise SystemExit(unicodeC(m) + os.linesep + u"Could not find path %s and could not make a directory there. Please make sure this path is correct and try creating the folder with proper permissions for me" % os.path.join(self['global']['workingDir'], self['threads'][thread]['directory'])) for downDict in self['threads'][thread]['downloads']: if downDict['Dir'] and not os.path.isdir( os.path.join(self['global']['workingDir'], downDict['Dir'] ) ): try: os.mkdir( os.path.join(self['global']['workingDir'], downDict['Dir'] ) ) except OSError, m: raise SystemExit(unicodeC(m) + os.linesep + u"Could not find path %s and could not make a directory there. Please make sure this path is correct and try creating the folder with proper permissions for me" % os.path.join(self['global']['workingDir'], downDict['Dir'] )) | 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,
866,
12,
2890,
4672,
2552,
1791,
7472,
554,
309,
486,
365,
3292,
6347,
21712,
718,
2941,
3546,
471,
486,
1791,
7472,
554,
30,
1172,
1671,
2589,
18,
11241,
16,
296,
7736,
11527,
22,
3560,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
12,
2890,
4672,
2552,
1791,
7472,
554,
309,
486,
365,
3292,
6347,
21712,
718,
2941,
3546,
471,
486,
1791,
7472,
554,
30,
1172,
1671,
2589,
18,
11241,
16,
296,
7736,
11527,
22,
3560,... |
self.onBrowse(self.utility.lang.get('choosevideoanalyser'),self.analyser) | self.onBrowse(self.analyser,self.utility.lang.get('choosevideoanalyser')) | def onBrowseAnalyser(self, event = None): self.onBrowse(self.utility.lang.get('choosevideoanalyser'),self.analyser) | 76862ea4579e5b42f076e233b20d63b7cbb789f0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9686/76862ea4579e5b42f076e233b20d63b7cbb789f0/abcoption.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
27304,
979,
3450,
550,
12,
2890,
16,
871,
273,
599,
4672,
365,
18,
265,
27304,
12,
2890,
18,
304,
3450,
550,
16,
2890,
18,
1367,
560,
18,
4936,
18,
588,
2668,
25777,
9115,
304,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
27304,
979,
3450,
550,
12,
2890,
16,
871,
273,
599,
4672,
365,
18,
265,
27304,
12,
2890,
18,
304,
3450,
550,
16,
2890,
18,
1367,
560,
18,
4936,
18,
588,
2668,
25777,
9115,
304,
... |
controlPanel.decelerate1() | controlPanel.decelerate10() | def propertyChange(self, event): if (event.propertyName == "Value") : # event.oldValue is the UsbNode # # uncomment the following line to see controller names #print "|"+event.oldValue.getController().toString()+"|" # # Select just the device (controller) we want if (event.oldValue.getController().toString() == desiredControllerName) : # event.newValue is the value, e.g. 1.0 # Check for desired component and act component = event.oldValue.getComponent().toString() value = event.newValue # # uncomment the following to see all entries #print component, value # if (component == componentWheel and value > 0.0) : controlPanel.accelerate1() if (component == componentWheel and value < 0.0) : controlPanel.decelerate1() if (component == componentPress and value > 0.0) : # alternate direction controlPanel.setIsForward(not controlPanel.getIsForward()) return | 91ff0c02210705669636d63c8a29718615ffbadc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2146/91ff0c02210705669636d63c8a29718615ffbadc/USBThrottle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1272,
3043,
12,
2890,
16,
871,
4672,
309,
261,
2575,
18,
4468,
461,
422,
315,
620,
7923,
294,
468,
871,
18,
1673,
620,
353,
326,
9376,
70,
907,
468,
468,
12704,
475,
326,
3751,
980,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1272,
3043,
12,
2890,
16,
871,
4672,
309,
261,
2575,
18,
4468,
461,
422,
315,
620,
7923,
294,
468,
871,
18,
1673,
620,
353,
326,
9376,
70,
907,
468,
468,
12704,
475,
326,
3751,
980,
... |
if event.transparency == "confirmed": if event.allDay: hours = 12.0 else: hours = event.duration.seconds / (60 * 60) | if (event.transparency == "confirmed" and (event.allDay or (not event.anyTime and event.duration != zero_delta))): | def updateBusy(event, start): # Broken out into a separate function because we're going # to call it for each non-recurring events, and for each # individual occurrence of all the recurring events. # In the case of the latter, event may be the master, or # a modification; we're trying to avoid creating all the # items for individual computed occurrences. if event.transparency == "confirmed": | b31c7f21f040e03a857a64320483f9e46b579f01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/b31c7f21f040e03a857a64320483f9e46b579f01/CalendarBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
29289,
12,
2575,
16,
787,
4672,
468,
605,
19906,
596,
1368,
279,
9004,
445,
2724,
732,
4565,
8554,
468,
358,
745,
518,
364,
1517,
1661,
17,
266,
21179,
2641,
16,
471,
364,
1517,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
29289,
12,
2575,
16,
787,
4672,
468,
605,
19906,
596,
1368,
279,
9004,
445,
2724,
732,
4565,
8554,
468,
358,
745,
518,
364,
1517,
1661,
17,
266,
21179,
2641,
16,
471,
364,
1517,
... |
price_unit=uos_id=prod_name=a=False | price_unit=uos_id=prod_name=a=data_partner=False | def product_id_change(self, cr, uid, ids,product_id,partner_id=False,member_price=False): price_unit=uos_id=prod_name=a=False | 2d4c7de0c7ef7d0424d25cc794c8b1f894368de0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/2d4c7de0c7ef7d0424d25cc794c8b1f894368de0/cci_mission.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5896,
67,
350,
16,
31993,
67,
350,
33,
8381,
16,
5990,
67,
8694,
33,
8381,
4672,
6205,
67,
4873,
33,
89,
538,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
5896,
67,
350,
16,
31993,
67,
350,
33,
8381,
16,
5990,
67,
8694,
33,
8381,
4672,
6205,
67,
4873,
33,
89,
538,
6... |
'he': u'%d & | 'he':u'%d לפנה"ס', | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 2f8392c560135a8fa55641f181fd3a11ca38d1c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/2f8392c560135a8fa55641f181fd3a11ca38d1c1/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
302,
4672,
1930,
21137,
327,
21137,
18,
2620,
22,
9124,
12443,
712,
67,
2139,
63,
81,
6362,
2890,
18,
4256,
18,
4936,
5717,
738,
302,
16,
2834,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
302,
4672,
1930,
21137,
327,
21137,
18,
2620,
22,
9124,
12443,
712,
67,
2139,
63,
81,
6362,
2890,
18,
4256,
18,
4936,
5717,
738,
302,
16,
2834,
... |
def checkVarListRelevant(newslist): | def checkVarListRelevant(newslist,randint): | def checkVarListRelevant(newslist): """returns true only if the newslist is relevant (major or close to home)""" if (not (newslist[0] in minorNewsTypes())): return 1 if (newslist[0] in minorNewsTypes()) and (checkSystemRelevant(newslist[6])): return 1 | 3d999b687e07fad9dd6af794f9c23adad2fe9b2a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2883/3d999b687e07fad9dd6af794f9c23adad2fe9b2a/dynamic_news.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1537,
682,
17018,
7445,
12,
18443,
1098,
16,
7884,
474,
4672,
3536,
6154,
638,
1338,
309,
326,
14783,
1098,
353,
9368,
261,
14019,
578,
1746,
358,
6382,
15574,
309,
261,
902,
261,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1537,
682,
17018,
7445,
12,
18443,
1098,
16,
7884,
474,
4672,
3536,
6154,
638,
1338,
309,
326,
14783,
1098,
353,
9368,
261,
14019,
578,
1746,
358,
6382,
15574,
309,
261,
902,
261,
1... |
else: | else: | def getPilotSummaryWeb(self,selectDict,sortList,startItem,maxItems): """ Get summary of the pilot jobs status by CE/site in a standard structure """ | 4281b6ebd17e9e6456de007d4a03f9fe1ab6a236 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4281b6ebd17e9e6456de007d4a03f9fe1ab6a236/PilotAgentsDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1689,
22797,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
3804,
682,
16,
1937,
1180,
16,
1896,
3126,
4672,
3536,
968,
4916,
434,
326,
293,
22797,
6550,
1267,
635,
29538,
19,
4256,
316,
279,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1689,
22797,
4733,
4079,
12,
2890,
16,
4025,
5014,
16,
3804,
682,
16,
1937,
1180,
16,
1896,
3126,
4672,
3536,
968,
4916,
434,
326,
293,
22797,
6550,
1267,
635,
29538,
19,
4256,
316,
279,... |
time.sleep(0.05) Thread(target=self._doItSharer).start() | self._addThread(target=self._doItSharer) | def testWaitingExclusiveBlocksSharer(self): self.sl.acquire(shared=1) # the lock is acquired in shared mode... Thread(target=self._doItExclusive).start() # ...but now an exclusive is waiting... time.sleep(0.05) Thread(target=self._doItSharer).start() # ...so the sharer should be blocked as well self.assertRaises(Queue.Empty, self.done.get, True, 0.2) self.sl.release() # The exclusive passed before self.assertEqual(self.done.get(True, 1), 'EXC') self.assertEqual(self.done.get(True, 1), 'SHR') | 4607c978b8f973b63c49547f1b8d6061fdbd78d3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/4607c978b8f973b63c49547f1b8d6061fdbd78d3/ganeti.locking_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
15946,
17075,
6450,
1555,
14500,
12,
2890,
4672,
365,
18,
2069,
18,
1077,
1039,
12,
11574,
33,
21,
13,
468,
326,
2176,
353,
20598,
316,
5116,
1965,
2777,
4884,
12,
3299,
33,
2890,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
15946,
17075,
6450,
1555,
14500,
12,
2890,
4672,
365,
18,
2069,
18,
1077,
1039,
12,
11574,
33,
21,
13,
468,
326,
2176,
353,
20598,
316,
5116,
1965,
2777,
4884,
12,
3299,
33,
2890,
... |
slab[-1].z += h | slab.positions[-nads:, 2] += h | def build(): p = OptionParser(usage='%prog [options] [ads@]surf [output file]', version='%prog 0.1', description='Example ads/surf: CO@2x2Ru0001') p.add_option('-l', '--layers', type='int', default=4, help='Number of layers.') p.add_option('-v', '--vacuum', type='float', default=5.0, help='Vacuum.') p.add_option('-x', '--crystal-structure', help='Crystal structure.', choices=['sc', 'fcc', 'bcc', 'hcp']) p.add_option('-a', '--lattice-constant', type='float', help='Lattice constant in Angstrom.') p.add_option('--c_over_a', type='float', help='c/a ratio.') p.add_option('--height', type='float', help='Height of adsorbate over surface.') p.add_option('--distance', type='float', help='Distance between adsorbate and nearest surface atoms.') p.add_option('--site', help='Adsorption site.', choices=['fcc', 'hcc', 'hollow', 'bridge']) p.add_option('-M', '--magnetic-moment', type='float', default=0.0, help='Magnetic moment.') p.add_option('-G', '--gui', action='store_true', help="Pop up ASE's GUI.") opt, args = p.parse_args() if not 1 <= len(args) <= 2: p.error("incorrect number of arguments") if '@' in args[0]: ads, surf = args[0].split('@') else: ads = None surf = args[0] if surf[0].isdigit(): i1 = surf.index('x') n = int(surf[:i1]) i2 = i1 + 1 while surf[i2].isdigit(): i2 += 1 m = int(surf[i1 + 1:i2]) surf = surf[i2:] else: n = 1 m = 1 if surf[-1].isdigit(): if surf[1].isdigit(): face = surf[1:] surf = surf[0] else: face = surf[2:] surf = surf[:2] else: face = None Z = atomic_numbers[surf] state = reference_states[Z] if opt.crystal_structure: x = opt.crystal_structure else: x = state['symmetry'].lower() if opt.lattice_constant: a = opt.lattice_constant else: a = estimate_lattice_constant(surf, x, opt.c_over_a) if x == 'fcc': if face is None: face = '111' slab = fcc111(surf, (n, m, opt.layers), a, opt.vacuum) r = a / np.sqrt(2) / 2 elif x == 'bcc': if face is None: face = '110' slab = bcc110(surf, (n, m, opt.layers), a, opt.vacuum) r = a * np.sqrt(3) / 4 elif x == 'hcp': if face is None: face = '0001' slab = hcp0001(surf, (n, m, opt.layers), a, opt.c_over_a, opt.vacuum) r = a / 2 else: raise NotImplementedError magmom = opt.magnetic_moment if magmom is None: magmom = {'Ni': 0.6, 'Co': 1.2, 'Fe': 2.3}.get(surf, 0.0) slab.set_initial_magnetic_moments([magmom] * len(slab)) slab.pbc = 1 name = '%dx%d%s%s' % (n, m, surf, face) if ads: site = 'ontop' if '-' in ads: site, ads = ads.split('-') name = site + '-' + ads + '@' + name symbols = string2symbols(ads) if len(symbols) == 1: ads = Atoms(ads) else: ads = molecules(ads) add_adsorbate(slab, ads, 0.0, site) d = opt.distance if d is None: d = r + covalent_radii[ads[0].number] / 2 h = opt.height if h is None: R = slab.positions y = ((R[:-1] - R[-1])**2).sum(1).min()**0.5 print y h = (d**2 - y**2)**0.5 print h else: assert opt.distance is None slab[-1].z += h if len(args) == 2: write(args[1], slab) elif not opt.gui: write(name + '.traj', slab) if opt.gui: view(slab) | 6c55c86b784d7854b677ee5f0d833a95898655bc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/6c55c86b784d7854b677ee5f0d833a95898655bc/adsorb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
13332,
293,
273,
18862,
12,
9167,
28713,
14654,
225,
306,
2116,
65,
306,
17318,
36,
65,
10050,
74,
306,
2844,
585,
65,
2187,
1177,
28713,
14654,
374,
18,
21,
2187,
2477,
2218,
1090... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
13332,
293,
273,
18862,
12,
9167,
28713,
14654,
225,
306,
2116,
65,
306,
17318,
36,
65,
10050,
74,
306,
2844,
585,
65,
2187,
1177,
28713,
14654,
374,
18,
21,
2187,
2477,
2218,
1090... |
return unicode(self.encode('utf-8')) | return unicode(self).encode('utf-8') | def __str__(self): return unicode(self.encode('utf-8')) | 44b3ae4e61c6bb695e64bcaf00761cac7d683b75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7032/44b3ae4e61c6bb695e64bcaf00761cac7d683b75/cpp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
5252,
12,
2890,
18,
3015,
2668,
3158,
17,
28,
26112,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
5252,
12,
2890,
18,
3015,
2668,
3158,
17,
28,
26112,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return True else: return False | return False | def on_main_window_key_press_event(self, widget, event): portable_keys_mapping = { gtk.keysyms.Down: keyboard.DOWN, gtk.keysyms.Up: keyboard.UP, gtk.keysyms.Right: keyboard.RIGHT, gtk.keysyms.Left: keyboard.LEFT, } if event.keyval in portable_keys_mapping: control = shift = False if event.state & gtk.gdk.SHIFT_MASK: shift = True if event.state & gtk.gdk.CONTROL_MASK: control = True key = portable_keys_mapping[event.keyval] keyboard.handleKey(key, shift, control) return True else: return False | 2052cee6a518bf41ec84e148122ed482953eca4b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/2052cee6a518bf41ec84e148122ed482953eca4b/callbackhandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5254,
67,
5668,
67,
856,
67,
1028,
67,
2575,
12,
2890,
16,
3604,
16,
871,
4672,
1756,
429,
67,
2452,
67,
6770,
273,
288,
22718,
18,
2452,
93,
959,
18,
4164,
30,
16263,
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,
603,
67,
5254,
67,
5668,
67,
856,
67,
1028,
67,
2575,
12,
2890,
16,
3604,
16,
871,
4672,
1756,
429,
67,
2452,
67,
6770,
273,
288,
22718,
18,
2452,
93,
959,
18,
4164,
30,
16263,
18,
... |
ind = 0 | def SendXMLFiles(fileDir, removeOriginal = False, resourceType = None): global Config global failedSendCount global suppressedCount global successfulSendCount path = os.path.join(fileDir, "*") files = glob.glob(path) responseString = "" for xmlFilename in files: DebugPrint(0, "***********************************************************") if os.path.getsize(xmlFilename) == 0: DebugPrint(0, "File " + xmlFilename + " is zero-length: skipping") os.remove(xmlFilename) continue DebugPrint(1,"xmlFilename: ",xmlFilename) if (failedSendCount + len(OutstandingRecord)) >= Config.get_MaxPendingFiles(): responseString = "Fatal Error: too many pending files" DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString # Open the XML file try: xmlDoc = xml.dom.minidom.parse(xmlFilename) except: DebugPrint(0, "Failed to parse XML file ", xmlFilename, "--", sys.exc_info(),"--",sys.exc_info()[0],"++",sys.exc_info()[1]) xmlDoc = None if xmlDoc: DebugPrint(1, "Adding information to parsed XML") xmlDoc.normalize() if not CheckXmlDoc(xmlDoc,True,resourceType): xmlDoc.unlink() DebugPrint(0, "No unsuppressed usage records in " + \ xmlFilename + ": not sending") suppressedCount += 1 # Cleanup old records - SPC - NERSC 08/28/07 if removeOriginal: os.remove(xmlFilename) continue # Generate the XML xmlData = safeEncodeXML(xmlDoc) # Close and clean up the document xmlDoc.unlink() else: # XML parsing failed: slurp the file in to xmlData and # send as-is. DebugPrint(1, "Backing up and sending failed XML as is.") try: in_file = open(xmlFilename, "r") except: DebugPrint(0, "Unable to open xmlFilename for simple read") continue xmlData = in_file.readlines() in_file.close() # Open the back up file # fill the back up file dirIndex = 0 success = False ind = 0 f = 0 while not success: (f,dirIndex) = OpenNewRecordFile(dirIndex) DebugPrint(1,"Will save in the record in:",f.name) DebugPrint(3,"DirIndex=",dirIndex) if f.name == "<stdout>": responseString = "Fatal Error: unable to save record prior to send attempt" DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString else: try: for line in xmlData: f.write(line) f.flush() if f.tell() > 0: success = True DebugPrint(3,"suceeded to fill: ",f.name) else: DebugPrint(0,"failed to fill: ",f.name) if f.name != "<stdout>": os.remove(f.name) except: DebugPrint(0,"failed to fill with exception: ",f.name,"--", sys.exc_info(),"--",sys.exc_info()[0],"++",sys.exc_info()[1]) if f.name != "<stdout>": os.remove(f.name) if removeOriginal and f.name != "<stdout>": os.remove(xmlFilename) DebugPrint(0, 'Saved record to ' + f.name) # Currently, the recordXml is in a list format, with each # item being a line of xml. The collector web service # requires the xml to be sent as a string. This logic here # turns the xml list into a single xml string. usageXmlString = "" for line in xmlData: usageXmlString = usageXmlString + line DebugPrint(3, 'UsageXml: ' + usageXmlString) # If XMLFiles can ever be anything else than Update messages, # then one should be able to deduce messageType from the root # element of the XML. messageType = "URLEncodedUpdate" # Attempt to send the record to the collector response = __sendUsageXML(Config.get_MeterName(), usageXmlString, messageType) DebugPrint(0, 'Response code: ' + str(response.get_code())) DebugPrint(0, 'Response message: ' + response.get_message()) # Determine if the call was successful based on the # response code. Currently, 0 = success if response.get_code() == 0: DebugPrint(1, 'Response indicates success, ' + f.name + ' will be deleted') successfulSendCount += 1 os.remove(f.name) else: failedSendCount += 1 DebugPrint(1, 'Response indicates failure, ' + f.name + ' will not be deleted') DebugPrint(0, responseString) DebugPrint(0, "***********************************************************") return responseString | 2abb6f512aead669f454a58e7b6bf70e0d0428a5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/637/2abb6f512aead669f454a58e7b6bf70e0d0428a5/Gratia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
4201,
2697,
12,
768,
1621,
16,
1206,
8176,
273,
1083,
16,
14110,
273,
599,
4672,
2552,
1903,
2552,
2535,
3826,
1380,
2552,
24448,
1380,
2552,
6873,
3826,
1380,
225,
589,
273,
1140,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
4201,
2697,
12,
768,
1621,
16,
1206,
8176,
273,
1083,
16,
14110,
273,
599,
4672,
2552,
1903,
2552,
2535,
3826,
1380,
2552,
24448,
1380,
2552,
6873,
3826,
1380,
225,
589,
273,
1140,
... | |
normals = vtk.vtkPolyDataNormals() normals.SetInput(polydata) normals.SetFeatureAngle(80) normals.AutoOrientNormalsOn() normals.GetOutput().ReleaseDataFlagOn() | clean = vtk.vtkCleanPolyData() clean.SetInput(polydata) clean.PointMergingOn() | def AddNewActor(self, pubsub_evt): """ Create surface actor, save into project and send it to viewer. """ surface_data = pubsub_evt.data mask, spacing = pubsub_evt.data min_value, max_value = mask.threshold_range fill_holes = True | 5e0c04d2840332d9d2d850f99bfae4e38b645a60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10228/5e0c04d2840332d9d2d850f99bfae4e38b645a60/surface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1908,
17876,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
3536,
1788,
9034,
8327,
16,
1923,
1368,
1984,
471,
1366,
518,
358,
14157,
18,
3536,
9034,
67,
892,
273,
23288,
67,
73,
11734,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1436,
1908,
17876,
12,
2890,
16,
23288,
67,
73,
11734,
4672,
3536,
1788,
9034,
8327,
16,
1923,
1368,
1984,
471,
1366,
518,
358,
14157,
18,
3536,
9034,
67,
892,
273,
23288,
67,
73,
11734,... |
'cc': cc, 'ot': ot, 'sp': sp, 'ec': ec, | 'cc': cc, 'ot': ot, 'sp': sp, 'ec': ec, | def tmpl_search_box(self, ln, as, cc, cc_intl, ot, sp, action, fieldslist, f1, f2, f3, m1, m2, m3, p1, p2, p3, op1, op2, rm, p, f, coll_selects, d1y, d2y, d1m, d2m, d1d, d2d, sort_formats, sf, so, ranks, sc, rg, formats, of, pl, jrec, ec): """ Displays the *Nearest search terms* box | d80e9e5b545268d60103014de3d2c09f38531285 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2139/d80e9e5b545268d60103014de3d2c09f38531285/websearch_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10720,
67,
3072,
67,
2147,
12,
2890,
16,
7211,
16,
487,
16,
4946,
16,
4946,
67,
474,
80,
16,
15835,
16,
1694,
16,
1301,
16,
1466,
1098,
16,
284,
21,
16,
284,
22,
16,
284,
23,
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,
10720,
67,
3072,
67,
2147,
12,
2890,
16,
7211,
16,
487,
16,
4946,
16,
4946,
67,
474,
80,
16,
15835,
16,
1694,
16,
1301,
16,
1466,
1098,
16,
284,
21,
16,
284,
22,
16,
284,
23,
16,
... |
result = gettext.dgettext(self.domainName, candidate) | result = self.__gnutranslations.ugettext(candidate) | def getTranslationsOf(self, srcName): # print "searching for translations of %s"%srcName # Use a dict to get uniqueness: results = {} result = gettext.dgettext(self.domainName, srcName) #print "result in domain %s is %s"%(self.domainName, result) if result!=srcName: results[result]=None | e3230b35cf0a50384c3b230b4b4134bcba10c503 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10139/e3230b35cf0a50384c3b230b4b4134bcba10c503/i18n.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12297,
951,
12,
2890,
16,
1705,
461,
4672,
468,
1172,
315,
3072,
310,
364,
7863,
434,
738,
87,
28385,
4816,
461,
468,
2672,
279,
2065,
358,
336,
31596,
30,
1686,
273,
2618,
563,
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,
336,
12297,
951,
12,
2890,
16,
1705,
461,
4672,
468,
1172,
315,
3072,
310,
364,
7863,
434,
738,
87,
28385,
4816,
461,
468,
2672,
279,
2065,
358,
336,
31596,
30,
1686,
273,
2618,
563,
2... |
import versionInfo | versionInfo = sys.modules.get("versionInfo") shouldPlayErrorSound = versionInfo and versionInfo.isTestVersion | def handle(self,record): # Late import because versionInfo requires gettext, which isn't yet initialised when logHandler is first imported. import versionInfo if record.levelno>=logging.CRITICAL: winsound.PlaySound("SystemHand",winsound.SND_ALIAS) elif record.levelno>=logging.ERROR and versionInfo.isTestVersion: # Only play the error sound if this is a test version. try: nvwave.playWaveFile("waves\\error.wav") except: pass return logging.FileHandler.handle(self,record) | 13e5c7352542828023a0a144af2aab6fd3c7b555 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/13e5c7352542828023a0a144af2aab6fd3c7b555/logHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
12,
2890,
16,
3366,
4672,
468,
511,
340,
1930,
2724,
20555,
4991,
24972,
16,
1492,
5177,
1404,
4671,
30372,
1347,
613,
1503,
353,
1122,
9101,
18,
225,
20555,
273,
2589,
18,
6400,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
3366,
4672,
468,
511,
340,
1930,
2724,
20555,
4991,
24972,
16,
1492,
5177,
1404,
4671,
30372,
1347,
613,
1503,
353,
1122,
9101,
18,
225,
20555,
273,
2589,
18,
6400,
1... |
parser.add_option( "", "--user", dest="user", help="SourceForge user name" ) parser.add_option( "", "--toolset", dest="toolset", help="toolset to use to build needed tools" ) parser.usage = "make_tarballs [options] temp_dir [start_step]\n\n" + \ | parser.add_option( "-r", "--cvs-branch", dest="cvs_branch", metavar="cvs-branch" , help = "cvs branch to get the sources from (e.g RC_1_32_0). Important: it is case sensitive" ) parser.add_option( "-u", "--sf-user", dest="sf_user", metavar="sf-user" , help = "SourceForge user name (for CVS)" ) parser.add_option( "-t", "--toolset", dest="toolset", help="toolset to use to build needed tools" ) parser.add_option( "-s", "--start-step", dest="start_step" ) parser.usage = "make_tarballs [options] target_directory \n\n" + \ | def accept_args( args ): #( release_version, cvs_tag, sf_user, temp_dir, start_step ) = accept_args( sys.argv[ 1: ] ) parser = optparse.OptionParser() parser.add_option( "", "--version", dest="version", help="release version" ) parser.add_option( "", "--tag", dest="tag", help="CVS tag" ) parser.add_option( "", "--user", dest="user", help="SourceForge user name" ) parser.add_option( "", "--toolset", dest="toolset", help="toolset to use to build needed tools" ) parser.usage = "make_tarballs [options] temp_dir [start_step]\n\n" + \ "Requirements:\n" + \ "\tcvs - to export sources with windows newlines \n" + \ "\tbash cvs - (cygwin) to export sources with posix newlines\n" + \ "\tbjam - to build BoostBook\n" + \ "\t7z - to create zipball\n" + \ "\tuser-config.jam in user directory ($HOME/%HOME%) - to build BoostBook\n" + \ "\tmv - posix move" ( options, args ) = parser.parse_args( args ) temp_dir = None start_step = None if ( len( args ) > 0 ): temp_dir = args[0] if ( len( args ) > 1 ): start_step = args[1] if ( start_step is None ): start_step = "" ( version, tag, user, toolset ) = ( options.version , options.tag , options.user , options.toolset ) if ( version is None or tag is None or user is None or temp_dir is None or toolset is None ): parser.print_help() sys.exit( 1 ) return ( version, tag, user, toolset, temp_dir, start_step ) | aed988a5e1a863624694559f7ea11b246f37978e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7960/aed988a5e1a863624694559f7ea11b246f37978e/make_tarballs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
67,
1968,
12,
833,
262,
30,
468,
12,
3992,
67,
1589,
16,
276,
6904,
67,
2692,
16,
9033,
67,
1355,
16,
1906,
67,
1214,
16,
787,
67,
4119,
262,
273,
2791,
67,
1968,
12,
2589,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
1968,
12,
833,
262,
30,
468,
12,
3992,
67,
1589,
16,
276,
6904,
67,
2692,
16,
9033,
67,
1355,
16,
1906,
67,
1214,
16,
787,
67,
4119,
262,
273,
2791,
67,
1968,
12,
2589,
1... |
value_list = [eval(value) for value in data.split('\\')] | value_list = [float(value) for value in data.split('\\')] | def GetImageWindowLevel(self, preset=WL_PRESET, multiple=WL_MULT): """ Return image window center / level (related to brightness). This is an integer or a floating point. If the value can't be read, return None. | 4c174d5889ea9a0c455a25e04c5ab7f7f061a574 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/4c174d5889ea9a0c455a25e04c5ab7f7f061a574/dicom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2040,
3829,
2355,
12,
2890,
16,
12313,
33,
59,
48,
67,
3670,
4043,
16,
3229,
33,
59,
48,
67,
12845,
4672,
3536,
2000,
1316,
2742,
4617,
342,
1801,
261,
9243,
358,
22492,
2934,
122... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2040,
3829,
2355,
12,
2890,
16,
12313,
33,
59,
48,
67,
3670,
4043,
16,
3229,
33,
59,
48,
67,
12845,
4672,
3536,
2000,
1316,
2742,
4617,
342,
1801,
261,
9243,
358,
22492,
2934,
122... |
""" | """ | def execute(self, inputs, update = 0, last = 0): """ Created: 29.05.2006, KP Description: Execute the filter with given inputs and return the output """ if not ProcessingFilter.ProcessingFilter.execute(self, inputs): return None image = self.getInput(1) | 6d7b572696d4ecdce2049b45a6e109836f3272c9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2877/6d7b572696d4ecdce2049b45a6e109836f3272c9/SegmentationFilters.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
4540,
16,
1089,
273,
374,
16,
1142,
273,
374,
4672,
3536,
12953,
30,
12899,
18,
6260,
18,
6976,
26,
16,
1475,
52,
6507,
30,
7903,
326,
1034,
598,
864,
4540,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
16,
4540,
16,
1089,
273,
374,
16,
1142,
273,
374,
4672,
3536,
12953,
30,
12899,
18,
6260,
18,
6976,
26,
16,
1475,
52,
6507,
30,
7903,
326,
1034,
598,
864,
4540,
471,
... |
pos = 0 while 1: match = self.newLinePattern.search (text, pos) if not match: break self.lineno = self.lineno + 1 pos = match.end (0) | self.lineno = self.lineno + self.calcNewLines (text, 0, len (text)) | def readText (self): | 4e40c07fcc94f4237dfbc46774cb4bd5627af518 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12443/4e40c07fcc94f4237dfbc46774cb4bd5627af518/xil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1528,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
1528,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
""" | """initialize an instance of LayeredUpdates with the given attributes | def __init__(self, *sprites, **kwargs): """ You can set the default layer through kwargs using 'default_layer' and an integer for the layer. The default layer is 0. If the sprite you add has an attribute layer then that layer will be used. If the **kwarg contains 'layer' then the sprites passed will be added to that layer (overriding the sprite.layer attribute). If neither sprite has attribute layer nor kwarg then the default layer is used to add the sprites. """ self._spritelayers = {} self._spritelist = [] AbstractGroup.__init__(self) self._default_layer = kwargs.get('default_layer', 0) self.add(*sprites, **kwargs) | d9760f3e4782abb02dd98080337626eefdad67ee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1298/d9760f3e4782abb02dd98080337626eefdad67ee/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1752,
24047,
16,
2826,
4333,
4672,
3536,
11160,
392,
791,
434,
12112,
329,
5121,
598,
326,
864,
1677,
225,
4554,
848,
444,
326,
805,
3018,
3059,
1205,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1752,
24047,
16,
2826,
4333,
4672,
3536,
11160,
392,
791,
434,
12112,
329,
5121,
598,
326,
864,
1677,
225,
4554,
848,
444,
326,
805,
3018,
3059,
1205,... |
elif utf8_width(_('status')) > ct_len + ui_len: | elif utf8_width(_('status')) > st_len: | def _repo_match(repo, patterns): rid = repo.id.lower() rnm = repo.name.lower() for pat in patterns: if fnmatch.fnmatch(rid, pat): return True if fnmatch.fnmatch(rnm, pat): return True return False | ac8eed8587a347dddf827efd1c0d7ab8674b2a79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5445/ac8eed8587a347dddf827efd1c0d7ab8674b2a79/yumcommands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7422,
67,
1916,
12,
7422,
16,
6884,
4672,
10911,
273,
3538,
18,
350,
18,
8167,
1435,
436,
15094,
273,
3538,
18,
529,
18,
8167,
1435,
364,
9670,
316,
6884,
30,
309,
18764,
18,
4293... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7422,
67,
1916,
12,
7422,
16,
6884,
4672,
10911,
273,
3538,
18,
350,
18,
8167,
1435,
436,
15094,
273,
3538,
18,
529,
18,
8167,
1435,
364,
9670,
316,
6884,
30,
309,
18764,
18,
4293... |
if wrap_file_cont.find(func.c_name) == -1 and override_file_cont.find(method.c_name): | if wrap_file_cont.find(func.c_name) == -1 and override_file_cont.find(func.c_name): | def add_override_methods(parser): # add methods and functions from override file override_docs = docextract.extract(["../"]) for d in override_docs.keys(): is_method = -1 params = ['parameters'] for param in override_docs[d].params: params.append( ('some_type', param[0]) ) for i in range(len(c_class_list)): if d.startswith(c_class_list[i]+"_"): is_method = i name = d.replace(c_class_list[i]+"_", "") break #print ('c-name', d, tuple(params)) if is_method != -1: # add as method parser.define_method(name, ('c-name', d), ('of-object', get_python_name(c_class_list[i])), tuple(params)) else: # add as functions parser.define_function(d, ('c-name', d), tuple(params)) | 866a8c0ee094fd0dc90f4bc5851f1d812a4b3231 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6171/866a8c0ee094fd0dc90f4bc5851f1d812a4b3231/pygwy-generate-doc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
10601,
67,
5163,
12,
4288,
4672,
468,
527,
2590,
471,
4186,
628,
3849,
585,
3849,
67,
8532,
273,
741,
26155,
1575,
18,
8004,
3816,
6,
838,
4898,
5717,
364,
302,
316,
3849,
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,
527,
67,
10601,
67,
5163,
12,
4288,
4672,
468,
527,
2590,
471,
4186,
628,
3849,
585,
3849,
67,
8532,
273,
741,
26155,
1575,
18,
8004,
3816,
6,
838,
4898,
5717,
364,
302,
316,
3849,
67,... |
'active': fields.boolean('Active'), | 'active': fields.boolean('Active'), 'create_date': fields.datetime('Created Date'), 'write_date': fields.datetime('Modifided Date'), | def import_cal(self, cr, uid, content, data_id=None, context=None): ical_data = base64.decodestring(content) self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, context) parsedCal = vobject.readOne(ical_data) att_data = [] res = [] for child in parsedCal.getChildren(): if child.name.lower() in ('vevent', 'vtodo'): vals = self.parse_ics(cr, uid, child, context=context) else: vals = {} continue if vals: res.append(vals) self.ical_reset('value') return res | 34a879d3905a9a1ebf968a61170135178a8176cb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/34a879d3905a9a1ebf968a61170135178a8176cb/base_calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
913,
16,
501,
67,
350,
33,
7036,
16,
819,
33,
7036,
4672,
277,
771,
67,
892,
273,
1026,
1105,
18,
4924,
1145,
371,
12,
1745,
13,
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,
1930,
67,
771,
12,
2890,
16,
4422,
16,
4555,
16,
913,
16,
501,
67,
350,
33,
7036,
16,
819,
33,
7036,
4672,
277,
771,
67,
892,
273,
1026,
1105,
18,
4924,
1145,
371,
12,
1745,
13,
36... |
raise ValueError, "n must be >= -2" if len(self.__qn) < n+3: self.pn(n) | raise ValueError, "n must be at least -2" if n > len(self._x): raise ValueError, "n must be at most %s"%len(self._x) try: return self.__qn[n+2] except (AttributeError, IndexError): pass self.pn(n) | def qn(self, n): """ Return the denominator of the n-th partial convergent, computed using the recurrence. EXAMPLES: sage: c = continued_fraction(pi); c [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 3] sage: c.pn(0), c.qn(0) (3, 1) sage: len(c) 14 sage: c.pn(13), c.qn(13) (245850922, 78256779) """ n = ZZ(n) if n < -2: raise ValueError, "n must be >= -2" if len(self.__qn) < n+3: self.pn(n) return self.__qn[n+2] | d73b29daa62859857d2978861ab788761aa7dae7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/d73b29daa62859857d2978861ab788761aa7dae7/contfrac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31054,
12,
2890,
16,
290,
4672,
3536,
2000,
326,
15030,
434,
326,
290,
17,
451,
4702,
14581,
75,
319,
16,
8470,
1450,
326,
25939,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
276,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31054,
12,
2890,
16,
290,
4672,
3536,
2000,
326,
15030,
434,
326,
290,
17,
451,
4702,
14581,
75,
319,
16,
8470,
1450,
326,
25939,
18,
225,
5675,
8900,
11386,
30,
272,
410,
30,
276,
273... |
opthbox.pack_start(optlabel) opthbox.pack_start(self.optentry) navshell.pack_start(self.frame_dict['Other_Advanced'], False,False,0) echbox=gtk.HBox(spacing=5,homogeneous=False) | echbox = gtk.HBox(spacing=5) | def init_dialog(self): self.dialog = gtk.Window() self.dialog.set_title('GDAL Export Tool') self.dialog.set_border_width(10) self.tips=gtk.Tooltips() #self.dialog.set_default_size(500,400) self.dialog.set_resizable(True) | 18bebfddf000a5af98d1ab83e4246e700756e2a4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11090/18bebfddf000a5af98d1ab83e4246e700756e2a4/Tool_Export.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
12730,
12,
2890,
4672,
365,
18,
12730,
273,
22718,
18,
3829,
1435,
365,
18,
12730,
18,
542,
67,
2649,
2668,
27338,
1013,
11054,
13288,
6134,
365,
18,
12730,
18,
542,
67,
8815,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
12730,
12,
2890,
4672,
365,
18,
12730,
273,
22718,
18,
3829,
1435,
365,
18,
12730,
18,
542,
67,
2649,
2668,
27338,
1013,
11054,
13288,
6134,
365,
18,
12730,
18,
542,
67,
8815,
... |
self.songlist.populate(artists, albums) | self.parent.songlist.populate(artists, albums) | def rebuildLevels(self, level, list, selections): dprint("level=%d selections=%s" % (level, selections)) self.shown = level + 1 if self.shown < len(self.lists): dprint("shown=%d" % self.shown) self.dirlevels.DeleteAfter(self.shown) | 0ef70c5a19c75ffab56ceb6e4d6bab1286152640 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/0ef70c5a19c75ffab56ceb6e4d6bab1286152640/mpd_major_mode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13419,
12240,
12,
2890,
16,
1801,
16,
666,
16,
21738,
4672,
302,
1188,
2932,
2815,
5095,
72,
21738,
5095,
87,
6,
738,
261,
2815,
16,
21738,
3719,
365,
18,
674,
995,
273,
1801,
397,
404... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13419,
12240,
12,
2890,
16,
1801,
16,
666,
16,
21738,
4672,
302,
1188,
2932,
2815,
5095,
72,
21738,
5095,
87,
6,
738,
261,
2815,
16,
21738,
3719,
365,
18,
674,
995,
273,
1801,
397,
404... |
msg = "Warning: Trying to print a hypo2000 phase file" + \ " with S phase without P phase.\n" + \ | msg = "Trying to print a hypo2000 phase file " + \ "with S phase without P phase.\n" + \ | def doHyp2000(self): self.setXMLEventID() subprocess.call(self.hyp2000PreCall, shell = True) f = open(self.hyp2000Phasefile, 'w') f2 = open(self.hyp2000Stationsfile, 'w') network = "BW" #fmt = "RWMOIP?0 091229124412.22 13.99IS?0" fmtP = "%4s%1sP%1s%1i %15s" fmtS = "%12s%1sS%1s%1i\n" #fmt2 = " BGLD4739.14N01300.75E 930" fmt2 = "%6s%02i%05.2fN%03i%05.2fE%4i\n" #self.coords = [] for i in range(len(self.streams)): sta = self.dicts[i]['Station'] lon = self.dicts[i]['StaLon'] lon_deg = int(lon) lon_min = (lon - lon_deg) * 60. lat = self.dicts[i]['StaLat'] lat_deg = int(lat) lat_min = (lat - lat_deg) * 60. ele = self.dicts[i]['StaEle'] * 1000 f2.write(fmt2 % (sta, lat_deg, lat_min, lon_deg, lon_min, ele)) #self.coords.append([lon, lat]) if not self.dicts[i].has_key('P') and not self.dicts[i].has_key('S'): continue if self.dicts[i].has_key('P'): t = self.streams[i][0].stats.starttime t += self.dicts[i]['P'] date = t.strftime("%y%m%d%H%M%S") #print date date += ".%02d" % (t.microsecond / 1e4 + 0.5) #print t.microsecond #print date if self.dicts[i].has_key('POnset'): if self.dicts[i]['POnset'] == 'impulsive': onset = 'I' elif self.dicts[i]['POnset'] == 'emergent': onset = 'E' else: #XXX check for other names correctly!!! onset = '?' else: onset = '?' if self.dicts[i].has_key('PPol'): if self.dicts[i]['PPol'] == "up" or \ self.dicts[i]['PPol'] == "poorup": polarity = "U" elif self.dicts[i]['PPol'] == "down" or \ self.dicts[i]['PPol'] == "poordown": polarity = "D" else: #XXX check for other names correctly!!! polarity = "D" else: polarity = "?" if self.dicts[i].has_key('PWeight'): weight = int(self.dicts[i]['PWeight']) else: weight = 0 f.write(fmtP % (sta, onset, polarity, weight, date)) if self.dicts[i].has_key('S'): if not self.dicts[i].has_key('P'): msg = "Warning: Trying to print a hypo2000 phase file" + \ " with S phase without P phase.\n" + \ "This case might not be covered correctly and " + \ "could screw our file up!" warnings.warn(msg) t2 = self.streams[i][0].stats.starttime t2 += self.dicts[i]['S'] date2 = t2.strftime("%H%M%S") date2 += ".%02d" % (t2.microsecond / 1e4 + 0.5) if self.dicts[i].has_key('SOnset'): if self.dicts[i]['SOnset'] == 'impulsive': onset2 = 'I' elif self.dicts[i]['SOnset'] == 'emergent': onset2 = 'E' else: #XXX check for other names correctly!!! onset2 = '?' else: onset2 = '?' if self.dicts[i].has_key('SPol'): if self.dicts[i]['SPol'] == "up" or \ self.dicts[i]['SPol'] == "poorup": polarity2 = "U" elif self.dicts[i]['SPol'] == "down" or \ self.dicts[i]['SPol'] == "poordown": polarity2 = "D" else: #XXX check for other names correctly!!! polarity2 = "D" else: polarity2 = "?" if self.dicts[i].has_key('SWeight'): weight2 = int(self.dicts[i]['SWeight']) else: weight2 = 0 f.write(fmtS % (date2, onset2, polarity2, weight2)) else: f.write("\n") f.close() f2.close() print 'Phases for Hypo2000:' self.catFile(self.hyp2000Phasefile) print 'Stations for Hypo2000:' self.catFile(self.hyp2000Stationsfile) subprocess.call(self.hyp2000Call, shell = True) print '--> hyp2000 finished' self.catFile(self.hyp2000Summary) | 6251f6073c9e4a4474a81252907e61450cdc5343 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/6251f6073c9e4a4474a81252907e61450cdc5343/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
44,
879,
17172,
12,
2890,
4672,
365,
18,
542,
60,
9687,
616,
734,
1435,
6652,
18,
1991,
12,
2890,
18,
76,
879,
17172,
1386,
1477,
16,
5972,
273,
1053,
13,
284,
273,
1696,
12,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
44,
879,
17172,
12,
2890,
4672,
365,
18,
542,
60,
9687,
616,
734,
1435,
6652,
18,
1991,
12,
2890,
18,
76,
879,
17172,
1386,
1477,
16,
5972,
273,
1053,
13,
284,
273,
1696,
12,
28... |
lat=lat, lng=long)) | lat=lat, lng=long), use_float=True) | def placeName(lat, long): geonames = restkit.Resource('http://ws.geonames.org/') addr = jsonlib.read(geonames.get("findNearestAddressJSON", lat=lat, lng=long)) if 'address' in addr: addr = addr['address'] return "%s %s, %s %s" % (addr['streetNumber'], addr['street'] or addr['adminName2'], addr['placename'], addr['adminCode1']) else: pl = jsonlib.read(geonames.get("findNearbyPlaceNameJSON", lat=lat, lng=long, style='short')) if 'geonames' in pl: return pl['geonames'][0]['name'] else: return "no geo %r" % pl | 98396c4c0f7a38852979a0dacb0787b4be6a15bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12883/98396c4c0f7a38852979a0dacb0787b4be6a15bc/map2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
461,
12,
4801,
16,
1525,
4672,
8244,
265,
753,
273,
3127,
8691,
18,
1420,
2668,
2505,
2207,
4749,
18,
908,
265,
753,
18,
3341,
2473,
13,
3091,
273,
1163,
2941,
18,
896,
12,
908,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3166,
461,
12,
4801,
16,
1525,
4672,
8244,
265,
753,
273,
3127,
8691,
18,
1420,
2668,
2505,
2207,
4749,
18,
908,
265,
753,
18,
3341,
2473,
13,
3091,
273,
1163,
2941,
18,
896,
12,
908,
... |
timer.sleep(0.033) | forwardCamera.background(0) | def testRedLightDetector(self): # Create a vision system with two mock cameras and an EventHub cfg = { 'name' : 'Test', 'type' : 'TestSubsystem' } cfg = core.ConfigNode.fromString(str(cfg)) forwardCamera = vision.Camera(640,480) backwardCamera = vision.Camera(640,480) | 0ecefb998dc72110f3fdf1303502deae88148fae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10608/0ecefb998dc72110f3fdf1303502deae88148fae/TestVisionSystem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3715,
12128,
12594,
12,
2890,
4672,
468,
1788,
279,
331,
1951,
2619,
598,
2795,
5416,
5861,
12067,
471,
392,
2587,
8182,
2776,
273,
288,
296,
529,
11,
294,
296,
4709,
2187,
296,
72... |
results = results + (_("Subscription was <em>deferred</em> " "because %s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>") % x) | results += (_("Subscription was <em>deferred</em> " "because %(x)s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>")) | def process_form(mlist, doc): form = cgi.FieldStorage() error = 0 results = '' # Preliminaries done, actual processing of the form input below. if form.has_key("language"): language = form["language"].value else: language = mlist.preferred_language os.environ['LANG'] = language if form.has_key("UserOptions") or \ form.has_key("info") and \ not form.has_key("email"): # then # Go to user options section. if not form.has_key("info"): doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_("You must supply your email address."))) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor="#ffffff") return addr = form['info'].value member = mlist.FindUser(addr) if not member: doc.AddItem(Header(2, _("Error"))) doc.AddItem(Bold(_("%s has no subscribed addr <i>%s</i>.") % (mlist.real_name, addr))) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format(bgcolor="#ffffff") return call_script(mlist, member, 'options') # should never get here! assert 0 if not form.has_key("email"): error = 1 results = results + _("You must supply a valid email address.<br>") # # define email so we don't get a NameError below # with if email == mlist.GetListEmail() -scott # email = "" else: email = form["email"].value remote = remote_addr() if email == mlist.GetListEmail(): error = 1 if remote: remote = _("Web site ") + remote else: remote = _("unidentified origin") badremote = "\n\tfrom " + remote syslog("mischief", "Attempt to self subscribe %s:%s" % (email, badremote)) results = results + _("You must not subscribe a list to itself!<br>") if not form.has_key("pw") or not form.has_key("pw-conf"): error = 1 results = (results + _("You must supply a valid password, and confirm it.<br>")) else: pw = form["pw"].value pwc = form["pw-conf"].value if not error and pw <> pwc: error = 1 results = results + _("Your passwords did not match.<br>") if form.has_key("digest"): try: digest = int(form['digest'].value) except ValueError: # TBD: Hmm, this shouldn't happen digest = 0 else: digest = mlist.digest_is_default if not mlist.digestable: digest = 0 elif not mlist.nondigestable: digest = 1 if not error: try: if mlist.FindUser(email): raise Errors.MMAlreadyAMember, email if digest: digesting = " digest" else: digesting = "" mlist.AddMember(email, pw, digest, remote, language) # # check for all the errors that mlist.AddMember can throw # options on the web page for this cgi # except Errors.MMBadEmailError: results = results + (_("Mailman won't accept the given email " "address as a valid address. (Does it " "have an @ in it???)<p>")) except Errors.MMListError: results = results + (_("The list is not fully functional, and " "can not accept subscription requests.<p>")) except Errors.MMSubscribeNeedsConfirmation: results = results + (_("Confirmation from your email address is " "required, to prevent anyone from " "subscribing you without permission. " "Instructions are being " "sent to you at %s. Please note your " "subscription will not start until you " "confirm your subscription.") % email) except Errors.MMNeedApproval, x: results = results + (_("Subscription was <em>deferred</em> " "because %s. Your request has been " "forwarded to the list administrator. " "You will receive email informing you " "of the moderator's decision when they " "get to your request.<p>") % x) except Errors.MMHostileAddress: results = results + (_("Your subscription is not allowed because " "the email address you gave is insecure.<p>")) except Errors.MMAlreadyAMember: results = results + _("You are already subscribed!<p>") # # these shouldn't happen, but if someone's futzing with the cgi # they might -scott # except Errors.MMCantDigestError: results = results + \ _("No one can subscribe to the digest of this list!") except Errors.MMMustDigestError: results = results + \ _("This list only supports digest subscriptions!") else: results = results + \ _("You have been successfully subscribed to %s.") % \ (mlist.real_name) PrintResults(mlist, results, doc, language) | b121e4076f4c5d170d07eefd6361b44bbafc2f9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/b121e4076f4c5d170d07eefd6361b44bbafc2f9f/subscribe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
687,
12,
781,
376,
16,
997,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
555,
273,
374,
1686,
273,
875,
225,
468,
453,
2878,
381,
267,
5646,
2731,
16,
3214,
4929,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
687,
12,
781,
376,
16,
997,
4672,
646,
273,
276,
10052,
18,
974,
3245,
1435,
555,
273,
374,
1686,
273,
875,
225,
468,
453,
2878,
381,
267,
5646,
2731,
16,
3214,
4929,
434,
... |
if res['balance'] != 0: | if abs(res['balance']) >= 0.5 * 10**-int(config['price_accuracy']): | def lines(self, form, ids={}, done=None, level=0): """ Returns all the data needed for the report lines (account info plus debit/credit/balance in the selected period and the full year) """ if not ids: ids = self.ids if not ids: return [] if not done: done = {} if form.has_key('account_list') and form['account_list']: account_ids = form['account_list'][0][2] del form['account_list'] res = {} result_acc = [] accounts_levels = {} account_obj = self.pool.get('account.account') period_obj = self.pool.get('account.period') fiscalyear_obj = self.pool.get('account.fiscalyear') | 48445ba664cc47f86f88c30115c796e1d8e92d6a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/48445ba664cc47f86f88c30115c796e1d8e92d6a/account_balance.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2362,
12,
2890,
16,
646,
16,
3258,
28793,
2731,
33,
7036,
16,
1801,
33,
20,
4672,
3536,
2860,
777,
326,
501,
3577,
364,
326,
2605,
2362,
261,
4631,
1123,
8737,
443,
3682,
19,
20688,
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,
2362,
12,
2890,
16,
646,
16,
3258,
28793,
2731,
33,
7036,
16,
1801,
33,
20,
4672,
3536,
2860,
777,
326,
501,
3577,
364,
326,
2605,
2362,
261,
4631,
1123,
8737,
443,
3682,
19,
20688,
19... |
elif valueStr == self.zoomMenuWdg._items[-1]: | elif strVal == self.zoomMenuWdg._items[-1]: | def doZoomMenu(self, *args): """Handle new selection from zoom menu.""" valueStr = self.zoomMenuWdg.getString() valueList = valueStr.split("/") if len(valueList) > 1: zoomFac = float(valueList[0]) / float(valueList[1]) else: zoomFac = int(valueList[0]) self.setZoom(zoomFac) # enable or disable zoom in/out widgets as appropriate if valueStr == self.zoomMenuWdg._items[0]: self.zoomInWdg["state"] = "normal" self.zoomOutWdg["state"] = "disabled" elif valueStr == self.zoomMenuWdg._items[-1]: self.zoomInWdg["state"] = "disabled" self.zoomOutWdg["state"] = "normal" else: self.zoomInWdg["state"] = "normal" self.zoomOutWdg["state"] = "normal" | f6acf1b41d9f8bc361017b632a5be4b62e606910 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6236/f6acf1b41d9f8bc361017b632a5be4b62e606910/GrayImageDispWdg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
11497,
4599,
12,
2890,
16,
380,
1968,
4672,
3536,
3259,
394,
4421,
628,
7182,
3824,
12123,
460,
1585,
273,
365,
18,
14932,
4599,
59,
72,
75,
18,
588,
780,
1435,
460,
682,
273,
460... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
11497,
4599,
12,
2890,
16,
380,
1968,
4672,
3536,
3259,
394,
4421,
628,
7182,
3824,
12123,
460,
1585,
273,
365,
18,
14932,
4599,
59,
72,
75,
18,
588,
780,
1435,
460,
682,
273,
460... |
"domestic_violence_survivor", "dvo_occurred") | "domestic_violence_survivor", "dv_occurred") | def createClientHistoricalRecs(self, sspIndex, personId): for historical in self.getPersonHistoricalData(sspIndex, personId): try: # Get the fields in site_service_participation table: phIndex = historical.id | 5bbf3f488fa2b83ab9aed1ab27bdcf7a9909a7dd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9116/5bbf3f488fa2b83ab9aed1ab27bdcf7a9909a7dd/hmiscsv30writer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30872,
8648,
10129,
19589,
12,
2890,
16,
272,
1752,
1016,
16,
6175,
548,
4672,
364,
23922,
316,
365,
18,
588,
8346,
8648,
10129,
751,
12,
1049,
84,
1016,
16,
6175,
548,
4672,
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,
30872,
8648,
10129,
19589,
12,
2890,
16,
272,
1752,
1016,
16,
6175,
548,
4672,
364,
23922,
316,
365,
18,
588,
8346,
8648,
10129,
751,
12,
1049,
84,
1016,
16,
6175,
548,
4672,
775,
30,
... |
yield self.SaveAs() | yield (yield self.SaveAs()) | def Save(self): if self.path: try: yield self.SaveFile(self.path) except Exception, exn: dialogs.error(self, "Error saving file '%s'\n\n%s" % (path, exn)) raise else: yield self.SaveAs() | 5235bc643ba17d08c3cb1bd02626ac021c357d97 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11441/5235bc643ba17d08c3cb1bd02626ac021c357d97/editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7074,
12,
2890,
4672,
309,
365,
18,
803,
30,
775,
30,
2824,
365,
18,
4755,
812,
12,
2890,
18,
803,
13,
1335,
1185,
16,
431,
82,
30,
7609,
14072,
18,
1636,
12,
2890,
16,
315,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7074,
12,
2890,
4672,
309,
365,
18,
803,
30,
775,
30,
2824,
365,
18,
4755,
812,
12,
2890,
18,
803,
13,
1335,
1185,
16,
431,
82,
30,
7609,
14072,
18,
1636,
12,
2890,
16,
315,
668,
1... |
api_url += 'action=query&format=xml&list=allpages&apfrom=%s&aplimit=%i&apnamespace=%i' % (startEncoded, 10, namespace) | api_url += 'action=query&format=xml&list=allpages&apfrom=%s&aplimit=%i&apnamespace=%i' % (startEncoded, config.special_page_limit, namespace) | def allpages(self, start='!', namespace=None, includeredirects=True, throttle=True): """ Yield all Pages in alphabetical order. | bd376de1a214750aca76f40f6d1a4c6ae5057ad7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/bd376de1a214750aca76f40f6d1a4c6ae5057ad7/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
7267,
12,
2890,
16,
787,
2218,
5,
2187,
1981,
33,
7036,
16,
2823,
89,
765,
329,
867,
87,
33,
5510,
16,
18304,
33,
5510,
4672,
3536,
31666,
777,
22648,
316,
10877,
1706,
1353,
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,
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,
777,
7267,
12,
2890,
16,
787,
2218,
5,
2187,
1981,
33,
7036,
16,
2823,
89,
765,
329,
867,
87,
33,
5510,
16,
18304,
33,
5510,
4672,
3536,
31666,
777,
22648,
316,
10877,
1706,
1353,
18,
... |
utils.rmtree( results_libs ) utils.rmtree( results_status ) | rmtree( results_libs ) rmtree( results_status ) | def test( toolsets , args ): if args == []: args = [ "test", "process" ] try: start_build_monitor() cd = os.getcwd() os.chdir( os.path.join( boost_root, 'status' ) ) log( 'Making "%s" directory...' % regression_results ) utils.makedirs( regression_results ) results_libs = os.path.join( regression_results, 'libs' ) results_status = os.path.join( regression_results, 'status' ) if "clean" in args: utils.rmtree( results_libs ) utils.rmtree( results_status ) if "test" in args: test_cmd = [] if not toolsets is None: test_cmd.append( 'set TOOLS=%s' % string.join( toolsets, ' ' ) ) test_cmd.append( 'set BOOST_ROOT=%s' % boost_root ) test_cmd.append( '"%s" -d2 --dump-tests "-sALL_LOCATE_TARGET=%s" >>%s 2>&1' % ( bjam_path , regression_results , regression_log ) ) utils.checked_system( test_cmd, [ 1 ] ) if "process" in args: process_bjam_log() os.chdir( cd ) finally: stop_build_monitor() | afee980c07dd4bdddaf7abe89f0ddb9a22f23738 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/afee980c07dd4bdddaf7abe89f0ddb9a22f23738/regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
5226,
4424,
269,
833,
262,
30,
309,
833,
422,
5378,
30,
833,
273,
306,
315,
3813,
3113,
315,
2567,
6,
308,
225,
775,
30,
787,
67,
3510,
67,
10259,
1435,
7976,
273,
1140,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
5226,
4424,
269,
833,
262,
30,
309,
833,
422,
5378,
30,
833,
273,
306,
315,
3813,
3113,
315,
2567,
6,
308,
225,
775,
30,
787,
67,
3510,
67,
10259,
1435,
7976,
273,
1140,
18... |
points = leval.evaluateComplete(model.boards[-1].board, WHITE, True) | points = leval.evaluateComplete(model.getBoardAtPly(model.ply).board, WHITE, True) | def game_changed (self, model): if model.status == DRAW: points = 0 elif model.status == WHITEWON: points = maxint elif model.status == BLACKWON: points = -maxint else: points = leval.evaluateComplete(model.boards[-1].board, WHITE, True) self.plot.addScore(points) # As shown_changed will normally be emitted just after game_changed - # if we are viewing the latest position - we can do the selection change # now, and thereby avoid redraw being called twice if self.plot.selected == model.ply-model.lowply -1: self.plot.select(model.ply-model.lowply) self.plot.redraw() # Uncomment this to debug eval function return board = model.boards[-1].board opboard = model.boards[-1].clone().board opboard.setColor(1-opboard.color) material, phase = leval.evalMaterial (board) if board.color == WHITE: print "material", -material e1 = leval.evalKingTropism (board) e2 = leval.evalKingTropism (opboard) print "evaluation: %d + %d = %d " % (e1, e2, e1+e2) p1 = leval.evalPawnStructure (board, phase) p2 = leval.evalPawnStructure (opboard, phase) print "pawns: %d + %d = %d " % (p1, p2, p1+p2) print "knights:",-leval.evalKnights (board) print "king:",-leval.evalKing(board,phase) else: print "material", material print "evaluation:",leval.evalKingTropism (board) print "pawns:", leval.evalPawnStructure (board, phase) print "pawns2:", leval.evalPawnStructure (opboard, phase) print "pawns3:", leval.evalPawnStructure (board, phase) + \ leval.evalPawnStructure (opboard, phase) print "knights:",leval.evalKnights (board) print "king:",leval.evalKing(board,phase) print "----------------------" | 63b1e69deba0f6e8fdef346dd2c682942bba257a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5339/63b1e69deba0f6e8fdef346dd2c682942bba257a/scorePanel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7920,
67,
6703,
261,
2890,
16,
938,
4672,
309,
938,
18,
2327,
422,
463,
10821,
30,
3143,
273,
374,
1327,
938,
18,
2327,
422,
24353,
59,
673,
30,
3143,
273,
943,
474,
1327,
938,
18,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7920,
67,
6703,
261,
2890,
16,
938,
4672,
309,
938,
18,
2327,
422,
463,
10821,
30,
3143,
273,
374,
1327,
938,
18,
2327,
422,
24353,
59,
673,
30,
3143,
273,
943,
474,
1327,
938,
18,
2... |
sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] | sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] | def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): """ Computes the matrix of Frobenius on Monsky-Washnitzer cohomology, with respect to the basis $(dx/y, x dx/y)$. INPUT: Q -- cubic polynomial $Q(x) = x^3 + ax + b$ defining an elliptic curve E by $y^2 = Q(x)$. The coefficient ring of Q should be a $\Z/(p^M)\Z$-algebra in which the matrix of frobenius will be constructed. p -- prime >= 5 for which E has good reduction M -- integer >= 2; $p$-adic precision of the coefficient ring trace -- (optional) the trace of the matrix, if known in advance. This is easy to compute because it's just the $a_p$ of the curve. If the trace is supplied, matrix_of_frobenius will use it to speed the computation (i.e. we know the determinant is $p$, so we have two conditions, so really only column of the matrix needs to be computed. It's actually a little more complicated than that, but that's the basic idea.) If trace=None, then both columns will be computed independently, and you can get a strong indication of correctness by verifying the trace afterwards. WARNING: -- THE RESULT WILL NOT NECESSARILY BE CORRECT TO M p-ADIC DIGITS. If you want prec digits of precision, you need to use the function adjusted_prec(), and then you need to reduce the answer mod p^prec at the end. OUTPUT: 2x2 matrix of frobenius on Monsky-Washnitzer cohomology, with entries in the coefficient ring of Q. EXAMPLES: A simple example: sage: p = 5 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: M 5 sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A [3090 187] [2945 408] But the result is only accurate to prec digits: sage: B = A.change_ring(Integers(p**prec)) sage: B [90 62] [70 33] Check trace (123 = -2 mod 125) and determinant: sage: B.det() 5 sage: B.trace() 123 sage: EllipticCurve([-1, 1/4]).ap(5) -2 Try using the trace to speed up the calculation: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), ... p, M, -2) sage: A [2715 187] [1445 408] Hmmm... it looks different, but that's because the trace of our first answer was only -2 modulo $5^3$, not -2 modulo $5^5$. So the right answer is: sage: A.change_ring(Integers(p**prec)) [90 62] [70 33] Check it works with only one digit of precision: sage: p = 5 sage: prec = 1 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) sage: A.change_ring(Integers(p)) [0 2] [0 3] Here's an example that's particularly badly conditioned for using the trace trick: sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The problem here is that the top-right entry is divisible by 11, and the bottom-left entry is divisible by $11^2$. So when you apply the trace trick, neither $F(dx/y)$ nor $F(x dx/y)$ is enough to compute the whole matrix to the desired precision, even if you try increasing the target precision by one. Nevertheless, \code{matrix_of_frobenius} knows how to get the right answer by evaluating $F((x+1) dx/y)$ instead: sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 + 7*x + 8, p, M, -2) sage: A.change_ring(Integers(p**prec)) [1144 176] [ 847 185] The running time is about \code{O(p * prec**2)} (times some logarithmic factors), so it's feasible to run on fairly large primes, or precision (or both?!?!): sage: p = 10007 sage: prec = 2 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)); B # long time [74311982 57996908] [95877067 25828133] sage: B.det() # long time 10007 sage: B.trace() # long time 66 sage: EllipticCurve([-1, 1/4]).ap(10007) # long time 66 sage: p = 5 sage: prec = 300 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time sage: B = A.change_ring(Integers(p**prec)) # long time sage: B.det() # long time 5 sage: -B.trace() # long time 2 sage: EllipticCurve([-1, 1/4]).ap(5) # long time -2 Let's check consistency of the results for a range of precisions: sage: p = 5 sage: max_prec = 60 sage: M = monsky_washnitzer.adjusted_prec(p, max_prec) sage: R.<x> = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius(x^3 - x + R(1/4), p, M) # long time sage: A = A.change_ring(Integers(p**max_prec)) # long time sage: result = [] # long time sage: for prec in range(1, max_prec): # long time ... M = monsky_washnitzer.adjusted_prec(p, prec) # long time ... R.<x> = PolynomialRing(Integers(p^M),'x') # long time ... B = monsky_washnitzer.matrix_of_frobenius( # long time ... x^3 - x + R(1/4), p, M) # long time ... B = B.change_ring(Integers(p**prec)) # long time ... result.append(B == A.change_ring( # long time ... Integers(p**prec))) # long time sage: result == [True] * (max_prec - 1) # long time True The remaining examples discuss what happens when you take the coefficient ring to be a power series ring; i.e. in effect you're looking at a family of curves. The code does in fact work... sage: p = 11 sage: prec = 3 sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: S.<t> = PowerSeriesRing(Integers(p**M), default_prec=4) sage: a = 7 + t + 3*t^2 sage: b = 8 - 6*t + 17*t^2 sage: R.<x> = PolynomialRing(S) sage: Q = x**3 + a*x + b sage: A = monsky_washnitzer.matrix_of_frobenius(Q, p, M) # long time sage: B = A.change_ring(PowerSeriesRing(Integers(p**prec), 't', default_prec=4)) # long time sage: B # long time [1144 + 264*t + 841*t^2 + 1025*t^3 + O(t^4) 176 + 1052*t + 216*t^2 + 523*t^3 + O(t^4)] [ 847 + 668*t + 81*t^2 + 424*t^3 + O(t^4) 185 + 341*t + 171*t^2 + 642*t^3 + O(t^4)] The trace trick should work for power series rings too, even in the badly- conditioned case. Unfortunately I don't know how to compute the trace in advance, so I'm not sure exactly how this would help. Also, I suspect the running time will be dominated by the expansion, so the trace trick won't really speed things up anyway. Another problem is that the determinant is not always p: sage: B.det() # long time 11 + 484*t^2 + 451*t^3 + O(t^4) However, it appears that the determinant always has the property that if you substitute t -> 11t, you do get the constant series p (mod p**prec). Similarly for the trace. And since the parameter only really makes sense when it's divisible by p anyway, perhaps this isn't a problem after all. """ M = int(M) if M < 2: raise ValueError, "M (=%s) must be at least 2" % M base_ring = Q.base_ring() # Expand out frobenius of dx/y and x dx/y. # (You can substitute frobenius_expansion_by_series here, that will work # as well. See its docstring for some performance notes.) F0, F1, offset = frobenius_expansion_by_newton(Q, p, M) #F0, F1, offset = frobenius_expansion_by_series(Q, p, M) if compute_exact_forms: # we need to do all the work to get the exact expressions f such that F(x^i dx/y) = df + \sum a_i x^i dx/y F0_coeffs = transpose_list(F0.coeffs()) F0_reduced, f_0 = reduce_all(Q, p, F0_coeffs, offset, True) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced, f_1 = reduce_all(Q, p, F1_coeffs, offset, True) elif M == 2: # This implies that only one digit of precision is valid, so we only need # to reduce the second column. Also, the trace doesn't help at all. F0_reduced = [ base_ring(0), base_ring(0) ] F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) elif trace is None: # No trace provided, just reduce F(dx/y) and F(x dx/y) separately. F0_coeffs = transpose_list(F0.coeffs()) F0_reduced = reduce_all(Q, p, F0_coeffs, offset) F1_coeffs = transpose_list(F1.coeffs()) F1_reduced = reduce_all(Q, p, F1_coeffs, offset) else: # Trace has been provided. # In most cases this can be used to quickly compute F(dx/y) from # F(x dx/y). However, if we're unlucky, the (dx/y)-component of # F(x dx/y) (i.e. the top-right corner of the matrix) may be divisible # by p, in which case there isn't enough information to get the # (x dx/y)-component of F(dx/y) to the desired precision. When this # happens, it turns out that F((x+1) dx/y) always *does* give enough # information (together with the trace) to get both columns to the # desired precision. # First however we need a quick way of telling whether the top-right # corner is divisible by p, i.e. we want to compute the second column # of the matrix mod p. We could do this by just running the entire # algorithm with M = 2 (which assures precision 1). Luckily, we've # already done most of the work by computing F1 to high precision; so # all we need to do is extract the coefficients that would correspond # to the first term of the series, and run the reduction on them. # todo: actually we only need to do this reduction step mod p^2, not # mod p^M, which is what the code currently does. If the base ring # is Integers(p^M), then it's easy. Otherwise it's tricky to construct # the right ring, I don't know how to do it. F1_coeffs = transpose_list(F1.coeffs()) F1_modp_coeffs = F1_coeffs[int((M-2)*p):] # make a copy, because reduce_all will destroy the coefficients: F1_modp_coeffs = [[cell for cell in row] for row in F1_modp_coeffs] F1_modp_offset = offset - (M-2)*p F1_modp_reduced = reduce_all(Q, p, F1_modp_coeffs, F1_modp_offset) if F1_modp_reduced[0].is_unit(): # If the first entry is invertible mod p, then F(x dx/y) is sufficient # to get the whole matrix. F1_reduced = reduce_all(Q, p, F1_coeffs, offset) F0_reduced = [ base_ring(trace) - F1_reduced[1], None ] # using that the determinant is p: F0_reduced[1] = (F0_reduced[0] * F1_reduced[1] - base_ring(p)) \ / F1_reduced[0] else: # If the first entry is zero mod p, then F((x+1) dx/y) will be sufficient # to get the whole matrix. (Here we are using the fact that the second # entry *cannot* be zero mod p. This is guaranteed by some results in # section 3.2 of ``Computation of p-adic Heights and Log Convergence'' # by Mazur, Stein, Tate. But let's quickly check it anyway :-)) assert F1_modp_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in the second column " \ "should be invertible mod p!" G0_coeffs = transpose_list( (F0 + F1).coeffs()) G0_reduced = reduce_all(Q, p, G0_coeffs, offset) # Now G0_reduced expresses F((x+1) dx/y) in terms of dx/y and x dx/y. # Re-express this in terms of (x+1) dx/y and x dx/y. H0_reduced = [ G0_reduced[0], G0_reduced[1] - G0_reduced[0] ] # The thing we're about to divide by better be a unit. assert H0_reduced[1].is_unit(), \ "Hey that's impossible! The second entry in this column " \ "should be invertible mod p!" # Figure out the second column using the trace... H1_reduced = [ None, base_ring(trace) - H0_reduced[0] ] # ... and using that the determinant is p: H1_reduced[0] = (H0_reduced[0] * H1_reduced[1] - base_ring(p)) \ / H0_reduced[1] # Finally, change back to the usual basis (dx/y, x dx/y) F1_reduced = [ H1_reduced[0], \ H1_reduced[0] + H1_reduced[1] ] F0_reduced = [ H0_reduced[0] - F1_reduced[0], H0_reduced[0] + H0_reduced[1] - F1_reduced[1] ] # One more sanity check: our final result should be congruent mod p # to the approximation we used earlier. assert not ( (F1_reduced[0] - F1_modp_reduced[0]).is_unit() or \ (F1_reduced[1] - F1_modp_reduced[1]).is_unit() or \ F0_reduced[0].is_unit() or F0_reduced[1].is_unit()), \ "Hey that's impossible! The output matrix is not congruent mod p " \ "to the approximation found earlier!" if compute_exact_forms: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]), f_0, f_1 else: return matrix(base_ring, 2, 2, [F0_reduced[0], F1_reduced[0], F0_reduced[1], F1_reduced[1]]) | e8c5dfe629aabf0303b396e56733ea0c7032d92a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e8c5dfe629aabf0303b396e56733ea0c7032d92a/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
67,
792,
67,
74,
303,
19425,
8384,
12,
53,
16,
293,
16,
490,
16,
2606,
33,
7036,
16,
3671,
67,
17165,
67,
9741,
33,
8381,
4672,
3536,
14169,
281,
326,
3148,
434,
478,
303,
1942... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3148,
67,
792,
67,
74,
303,
19425,
8384,
12,
53,
16,
293,
16,
490,
16,
2606,
33,
7036,
16,
3671,
67,
17165,
67,
9741,
33,
8381,
4672,
3536,
14169,
281,
326,
3148,
434,
478,
303,
1942... |
if vtyp is not None or vval is not None: | if vtyp is not None or hasval: | def _var_details(self, variables, container, heading='Variable Details'): """ @return: The HTML code for a variable details table. This is used by L{_module_to_html} to describe the variables in a module; and by L{_class_to_html} to describe instance variables and class variables. @rtype: C{string} """ variables = self._sort(variables) if len(variables) == 0: return '' str = self._table_header(heading, 'details')+'</table>' | 7e1af2abc702612461ceeb001b4b551d49cb71d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7e1af2abc702612461ceeb001b4b551d49cb71d3/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1401,
67,
6395,
12,
2890,
16,
3152,
16,
1478,
16,
11053,
2218,
3092,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
3189,
1014,
18,
225,
1220,
353,
1399,
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,
389,
1401,
67,
6395,
12,
2890,
16,
3152,
16,
1478,
16,
11053,
2218,
3092,
21897,
11,
4672,
3536,
632,
2463,
30,
1021,
3982,
981,
364,
279,
2190,
3189,
1014,
18,
225,
1220,
353,
1399,
6... |
Example ------- | Examples -------- | def cublasSaxpy(n, alpha, x, incx, y, incy): """ Real vector addition. Computes the sum of a single-precision vector scaled by a single-precision scalar and another single-precision vector. Parameters ---------- n : int Number of elements in input vectors. alpha : numpy.float32 Single-precision scalar. x : ctypes.c_void_p Pointer to single-precision input vector. incx : int Storage spacing between elements of `x`. y : ctypes.c_void_p Pointer to single-precision input/output vector. incy : int Storage spacing between elements of `y`. Example ------- >>> import pycuda.autoinit >>> import pycuda.gpuarray as gpuarray >>> import numpy as np >>> alpha = np.float32(np.random.rand()) >>> x = np.random.rand(5).astype(np.float32) >>> y = np.random.rand(5).astype(np.float32) >>> x_gpu = gpuarray.to_gpu(x) >>> y_gpu = gpuarray.to_gpu(y) >>> cublasSaxpy(x_gpu.size, alpha, x_gpu.gpudata, 1, y_gpu.gpudata, 1) >>> np.allclose(y_gpu.get(), alpha*x+y) True Notes ----- Both `x` and `y` must contain `n` elements. """ _libcublas.cublasSaxpy(n, alpha, int(x), incx, int(y), incy) status = cublasGetError() cublasCheckStatus(status) | f3eb0a79d8c436d509dec60f91ff7a7dcced528c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14753/f3eb0a79d8c436d509dec60f91ff7a7dcced528c/cublas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
30579,
55,
651,
2074,
12,
82,
16,
4190,
16,
619,
16,
7290,
92,
16,
677,
16,
316,
2431,
4672,
3536,
15987,
3806,
2719,
18,
225,
14169,
281,
326,
2142,
434,
279,
2202,
17,
14548,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
30579,
55,
651,
2074,
12,
82,
16,
4190,
16,
619,
16,
7290,
92,
16,
677,
16,
316,
2431,
4672,
3536,
15987,
3806,
2719,
18,
225,
14169,
281,
326,
2142,
434,
279,
2202,
17,
14548,
... |
self.failUnless(type(val) in (int, int), | self.failUnless(type(val) in (int,), | def _checkItemAttributes(self, item, attrs): for attr, typ in attrs: val = getattr(item, attr) if typ is int: self.failUnless(type(val) in (int, int), "Attr %r has value %r" % (attr, val)) new_val = val + 1 elif typ is str: if val is not None: # on py2k, must be string or unicode. py3k must be string or bytes. self.failUnless(type(val) in (str, str), "Attr %r has value %r" % (attr, val)) new_val = val + " new value" else: new_val = "new value" else: self.fail("Don't know what %s is" % (typ,)) # set the attribute just to make sure we can. setattr(item, attr, new_val) | d34ade72fb67315d3f588e74b26f7138ef945966 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/677/d34ade72fb67315d3f588e74b26f7138ef945966/test_win32wnet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1180,
2498,
12,
2890,
16,
761,
16,
3422,
4672,
364,
1604,
16,
3815,
316,
3422,
30,
1244,
273,
3869,
12,
1726,
16,
1604,
13,
309,
3815,
353,
509,
30,
365,
18,
6870,
984,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
1180,
2498,
12,
2890,
16,
761,
16,
3422,
4672,
364,
1604,
16,
3815,
316,
3422,
30,
1244,
273,
3869,
12,
1726,
16,
1604,
13,
309,
3815,
353,
509,
30,
365,
18,
6870,
984,
26... |
super(Move, self).__init__() self._rpc_allowed += [ 'set_state_done', 'set_state_draft', ] | super(Inventory, self).__init__() self._sql_constraints += [ ('location_day_uniq', 'UNIQUE(location,inventory_day)', 'Only one inventory for a given location is allowed '\ 'for an inventory day.'), ] | def __init__(self): super(Move, self).__init__() self._rpc_allowed += [ 'set_state_done', 'set_state_draft', ] | 97b5b7f758f2acb4fc87255ae834f7b7b898c215 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9298/97b5b7f758f2acb4fc87255ae834f7b7b898c215/inventory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
7607,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
7452,
67,
8151,
1011,
306,
296,
542,
67,
2019,
67,
8734,
2187,
296,
542,
67,
2019,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
7607,
16,
365,
2934,
972,
2738,
972,
1435,
365,
6315,
7452,
67,
8151,
1011,
306,
296,
542,
67,
2019,
67,
8734,
2187,
296,
542,
67,
2019,
67,
... |
obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'tree', obj_) self.content_.append(obj_) if hasattr(self, 'add_tree'): self.add_tree(obj_.value) elif hasattr(self, 'set_tree'): self.set_tree(obj_.value) elif nodeName_ == 'set': | self.tree.append(obj_) elif nodeName_ == 'set': | def buildChildren(self, child_, nodeName_, from_subclass=False): if nodeName_ == 'network': type_name_ = child_.attrib.get('{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <network> element') obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'network', obj_) self.content_.append(obj_) if hasattr(self, 'add_network'): self.add_network(obj_.value) elif hasattr(self, 'set_network'): self.set_network(obj_.value) elif nodeName_ == 'tree': type_name_ = child_.attrib.get('{http://www.w3.org/2001/XMLSchema-instance}type') if type_name_ is None: type_name_ = child_.attrib.get('type') if type_name_ is not None: type_names_ = type_name_.split(':') if len(type_names_) == 1: type_name_ = type_names_[0] else: type_name_ = type_names_[1] class_ = globals()[type_name_] obj_ = class_.factory() obj_.build(child_) else: raise NotImplementedError( 'Class not implemented for <tree> element') obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'tree', obj_) self.content_.append(obj_) if hasattr(self, 'add_tree'): self.add_tree(obj_.value) elif hasattr(self, 'set_tree'): self.set_tree(obj_.value) elif nodeName_ == 'set': obj_ = TreeAndNetworkSet.factory() obj_.build(child_) obj_ = self.mixedclass_(MixedContainer.CategoryComplex, MixedContainer.TypeNone, 'set', obj_) self.content_.append(obj_) if hasattr(self, 'add_set'): self.add_set(obj_.value) elif hasattr(self, 'set_set'): self.set_set(obj_.value) if not from_subclass and child_.tail is not None: obj_ = self.mixedclass_(MixedContainer.CategoryText, MixedContainer.TypeNone, '', child_.tail) self.content_.append(obj_) super(Trees, self).buildChildren(child_, nodeName_, True) | 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,
1361,
4212,
12,
2890,
16,
1151,
67,
16,
7553,
67,
16,
628,
67,
10678,
33,
8381,
4672,
309,
7553,
67,
422,
296,
5185,
4278,
618,
67,
529,
67,
273,
1151,
27799,
14588,
18,
588,
2668,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
4212,
12,
2890,
16,
1151,
67,
16,
7553,
67,
16,
628,
67,
10678,
33,
8381,
4672,
309,
7553,
67,
422,
296,
5185,
4278,
618,
67,
529,
67,
273,
1151,
27799,
14588,
18,
588,
2668,
9... |
labeltabColsTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts tabs,\ncolumns per tab') self.scaleTabCols=Scale(frameIndentSize,variable=self.tabCols, orient='horizontal',tickinterval=2,from_=2,to=8) | def CreatePageFontTab(self): #tkVars self.fontSize=StringVar(self) self.fontBold=BooleanVar(self) self.fontName=StringVar(self) self.spaceNum=IntVar(self) self.tabCols=IntVar(self) self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation #body frame frame=self.tabPages.pages['Fonts/Tabs']['page'] #body section frames frameFont=Frame(frame,borderwidth=2,relief=GROOVE) frameIndent=Frame(frame,borderwidth=2,relief=GROOVE) #frameFont labelFontTitle=Label(frameFont,text='Set Base Editor Font') frameFontName=Frame(frameFont) frameFontParam=Frame(frameFont) labelFontNameTitle=Label(frameFontName,justify=LEFT, text='Font :') self.listFontName=Listbox(frameFontName,height=5,takefocus=FALSE, exportselection=FALSE) self.listFontName.bind('<ButtonRelease-1>',self.OnListFontButtonRelease) scrollFont=Scrollbar(frameFontName) scrollFont.config(command=self.listFontName.yview) self.listFontName.config(yscrollcommand=scrollFont.set) labelFontSizeTitle=Label(frameFontParam,text='Size :') self.optMenuFontSize=DynOptionMenu(frameFontParam,self.fontSize,None, command=self.SetFontSample) checkFontBold=Checkbutton(frameFontParam,variable=self.fontBold, onvalue=1,offvalue=0,text='Bold',command=self.SetFontSample) frameFontSample=Frame(frameFont,relief=SOLID,borderwidth=1) self.labelFontSample=Label(frameFontSample, text='AaBbCcDdEe\nFfGgHhIiJjK\n1234567890\n#:+=(){}[]', justify=LEFT,font=self.editFont) #frameIndent labelIndentTitle=Label(frameIndent,text='Set Indentation Defaults') frameIndentType=Frame(frameIndent) frameIndentSize=Frame(frameIndent) labelIndentTypeTitle=Label(frameIndentType, text='Choose indentation type :') radioUseSpaces=Radiobutton(frameIndentType,variable=self.indentBySpaces, value=1,text='Tab key inserts spaces') radioUseTabs=Radiobutton(frameIndentType,variable=self.indentBySpaces, value=0,text='Tab key inserts tabs') labelIndentSizeTitle=Label(frameIndentSize, text='Choose indentation size :') labelSpaceNumTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts spaces,\nspaces per tab') self.scaleSpaceNum=Scale(frameIndentSize,variable=self.spaceNum, orient='horizontal',tickinterval=2,from_=2,to=8) labeltabColsTitle=Label(frameIndentSize,justify=LEFT, text='when tab key inserts tabs,\ncolumns per tab') self.scaleTabCols=Scale(frameIndentSize,variable=self.tabCols, orient='horizontal',tickinterval=2,from_=2,to=8) #widget packing #body frameFont.pack(side=LEFT,padx=5,pady=10,expand=TRUE,fill=BOTH) frameIndent.pack(side=LEFT,padx=5,pady=10,fill=Y) #frameFont labelFontTitle.pack(side=TOP,anchor=W,padx=5,pady=5) frameFontName.pack(side=TOP,padx=5,pady=5,fill=X) frameFontParam.pack(side=TOP,padx=5,pady=5,fill=X) labelFontNameTitle.pack(side=TOP,anchor=W) self.listFontName.pack(side=LEFT,expand=TRUE,fill=X) scrollFont.pack(side=LEFT,fill=Y) labelFontSizeTitle.pack(side=LEFT,anchor=W) self.optMenuFontSize.pack(side=LEFT,anchor=W) checkFontBold.pack(side=LEFT,anchor=W,padx=20) frameFontSample.pack(side=TOP,padx=5,pady=5,expand=TRUE,fill=BOTH) self.labelFontSample.pack(expand=TRUE,fill=BOTH) #frameIndent labelIndentTitle.pack(side=TOP,anchor=W,padx=5,pady=5) frameIndentType.pack(side=TOP,padx=5,fill=X) frameIndentSize.pack(side=TOP,padx=5,pady=5,fill=BOTH) labelIndentTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) radioUseSpaces.pack(side=TOP,anchor=W,padx=5) radioUseTabs.pack(side=TOP,anchor=W,padx=5) labelIndentSizeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelSpaceNumTitle.pack(side=TOP,anchor=W,padx=5) self.scaleSpaceNum.pack(side=TOP,padx=5,fill=X) labeltabColsTitle.pack(side=TOP,anchor=W,padx=5) self.scaleTabCols.pack(side=TOP,padx=5,fill=X) return frame | b1eca4be69a0167f9c1cbaa5333c6f34bfdac742 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b1eca4be69a0167f9c1cbaa5333c6f34bfdac742/configDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1964,
5711,
5661,
12,
2890,
4672,
468,
16099,
5555,
365,
18,
5776,
1225,
33,
780,
1537,
12,
2890,
13,
365,
18,
5776,
38,
1673,
33,
5507,
1537,
12,
2890,
13,
365,
18,
5776,
461,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1788,
1964,
5711,
5661,
12,
2890,
4672,
468,
16099,
5555,
365,
18,
5776,
1225,
33,
780,
1537,
12,
2890,
13,
365,
18,
5776,
38,
1673,
33,
5507,
1537,
12,
2890,
13,
365,
18,
5776,
461,
... | |
self.add_crontab_entry() subprocess.call(['killall', 'cozy-applet.py']) | self.__add_crontab_entry() self.__stop_applet() | def delete_event(self, widget, event, data=None): if self.config.changed(): self.config.write() subprocess.call([COZY_MKFS_PATH, self.config.get_full_target_path(), str(self.config.get_backup_id())]) if self.permanent_radio.get_active(): self.add_crontab_entry() subprocess.call(['killall', 'cozy-applet.py']) else: self.remove_crontab_entry() a = os.system("ps -ef | grep -v grep | grep cozy-applet.py") if a != 0: subprocess.Popen([COZY_APPLET_PATH]) self.restart_manager() | b8eb09d77c6c5b344494faa001ce2dc4706eac45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/736/b8eb09d77c6c5b344494faa001ce2dc4706eac45/cozy-configdialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
2575,
12,
2890,
16,
3604,
16,
871,
16,
501,
33,
7036,
4672,
309,
365,
18,
1425,
18,
6703,
13332,
365,
18,
1425,
18,
2626,
1435,
6652,
18,
1991,
3816,
3865,
62,
61,
67,
49,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
2575,
12,
2890,
16,
3604,
16,
871,
16,
501,
33,
7036,
4672,
309,
365,
18,
1425,
18,
6703,
13332,
365,
18,
1425,
18,
2626,
1435,
6652,
18,
1991,
3816,
3865,
62,
61,
67,
49,
... |
logger.debug ('fetching %s' % url) promise= client.getPage (str (url)) promise.addCallback (self.parsePage, user, channel, url) promise.addErrback (self.failed, user, channel, url) return promise def parsePage (self, page, user, channel, url): g= self.title_re.search (page) if g is not None: self.titleFound= True title= BeautifulStoneSoup (g.groups ()[0], convertEntities=BeautifulStoneSoup.XHTML_ENTITIES).contents[0] titleParts= title.split () title= ' '.join (titleParts) return [(channel, u"%s: %s" % (user, title))] | return [(channel, u"%s: no tiene titulo?!?" % (user, ))] | def message (self, user, channel, message): g= self.url_re.search (message) if g is not None: url= g.groups()[0] mimetype, encoding= mimetypes.guess_type (url) if mimetype not in (None, 'text/html'): return [(channel, "%s: %s" % (user, mimetype))] else: logger.debug ('fetching %s' % url) promise= client.getPage (str (url)) promise.addCallback (self.parsePage, user, channel, url) promise.addErrback (self.failed, user, channel, url) return promise | db26c8f1732caf8b00e3220b7da779ed02cb0a25 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5759/db26c8f1732caf8b00e3220b7da779ed02cb0a25/url.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
261,
2890,
16,
729,
16,
1904,
16,
883,
4672,
314,
33,
365,
18,
718,
67,
266,
18,
3072,
261,
2150,
13,
309,
314,
353,
486,
599,
30,
880,
33,
314,
18,
4650,
1435,
63,
20,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
883,
261,
2890,
16,
729,
16,
1904,
16,
883,
4672,
314,
33,
365,
18,
718,
67,
266,
18,
3072,
261,
2150,
13,
309,
314,
353,
486,
599,
30,
880,
33,
314,
18,
4650,
1435,
63,
20,
65,
... |
def tableRowClose(fp=sys.stdout): | def tableRowClose(fp=None): if not fp: fp = sys.stdout | def tableRowClose(fp=sys.stdout): fp.write(" </tr>\n") | b2159a61955ae5ea5d5e9af1376faca5b2527133 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/b2159a61955ae5ea5d5e9af1376faca5b2527133/html_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1014,
1999,
4605,
12,
7944,
33,
7036,
4672,
309,
486,
4253,
30,
4253,
273,
2589,
18,
10283,
4253,
18,
2626,
2932,
225,
7765,
313,
5333,
82,
7923,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1014,
1999,
4605,
12,
7944,
33,
7036,
4672,
309,
486,
4253,
30,
4253,
273,
2589,
18,
10283,
4253,
18,
2626,
2932,
225,
7765,
313,
5333,
82,
7923,
282,
2,
-100,
-100,
-100,
-100,
-100,
... |
req.write(tmpl("notfound", repo=virtual)) else: if req.form.has_key('static'): static = os.path.join(templater.templatepath(), "static") fname = req.form['static'][0] req.write(staticfile(static, fname, req) or tmpl("error", error="%r not found" % fname)) else: sortable = ["name", "description", "contact", "lastchange"] sortcolumn, descending = self.repos_sorted if req.form.has_key('sort'): sortcolumn = req.form['sort'][0] descending = sortcolumn.startswith('-') if descending: sortcolumn = sortcolumn[1:] if sortcolumn not in sortable: sortcolumn = "" sort = [("sort_%s" % column, "%s%s" % ((not descending and column == sortcolumn) and "-" or "", column)) for column in sortable] req.write(tmpl("index", entries=entries, sortcolumn=sortcolumn, descending=descending, **dict(sort))) | if req.form.has_key('static'): static = os.path.join(templater.templatepath(), "static") fname = req.form['static'][0] req.write(staticfile(static, fname, req) or tmpl("error", error="%r not found" % fname)) else: sortable = ["name", "description", "contact", "lastchange"] sortcolumn, descending = self.repos_sorted if req.form.has_key('sort'): sortcolumn = req.form['sort'][0] descending = sortcolumn.startswith('-') if descending: sortcolumn = sortcolumn[1:] if sortcolumn not in sortable: sortcolumn = "" sort = [("sort_%s" % column, "%s%s" % ((not descending and column == sortcolumn) and "-" or "", column)) for column in sortable] req.write(tmpl("index", entries=entries, sortcolumn=sortcolumn, descending=descending, **dict(sort))) finally: tmpl = None | def get(section, name, default=None): return u.config(section, name, default, untrusted=True) | c83aed3419db82f951df457a948c5f44b594bdde /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/c83aed3419db82f951df457a948c5f44b594bdde/hgwebdir_mod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
3464,
16,
508,
16,
805,
33,
7036,
4672,
327,
582,
18,
1425,
12,
3464,
16,
508,
16,
805,
16,
640,
25247,
33,
5510,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
12,
3464,
16,
508,
16,
805,
33,
7036,
4672,
327,
582,
18,
1425,
12,
3464,
16,
508,
16,
805,
16,
640,
25247,
33,
5510,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.