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 len(ids) == 0: self.log.debug("No events found") return try: while len(ids) < self.batch: ids.add(self.queue.get_nowait().fileId) count += 1 except Queue.Empty: pass self.log.info("Processing %s events (%s ids). %s remaining"\ % (count, len(ids), self.queue.qsize())) try: self.callback(ids) except: self.log.exception("Callback error") | self.event.wait(2) if len(ids) == 0: self.log.debug("No events found") else: if self.event.isSet(): self.log.warn("Skipping processing of %s events (%s ids). %s remaining"\ % (count, len(ids), self.queue.qsize())) else: self.log.info("Processing %s events (%s ids). %s remaining"\ % (count, len(ids), self.queue.qsize())) try: self.callback(ids) except: self.log.exception("Callback error") | def execute(self): | cbfa36e460ff5ac20dff3c571862ab24db5d2989 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12409/cbfa36e460ff5ac20dff3c571862ab24db5d2989/fsDropBoxMonitorClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
_weighInstallNotUpdown = 1 | def getWeight(self, changeset): weight = 0 for pkg in changeset: if changeset[pkg] is REMOVE: weight += 1 else: weight += 5 return weight | aec98224ca89229d16b8f41f05636695a75a2f7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/aec98224ca89229d16b8f41f05636695a75a2f7a/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30535,
12,
2890,
16,
22463,
4672,
3119,
273,
374,
364,
3475,
316,
22463,
30,
309,
22463,
63,
10657,
65,
353,
26056,
30,
3119,
1011,
404,
469,
30,
3119,
1011,
1381,
327,
3119,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
30535,
12,
2890,
16,
22463,
4672,
3119,
273,
374,
364,
3475,
316,
22463,
30,
309,
22463,
63,
10657,
65,
353,
26056,
30,
3119,
1011,
404,
469,
30,
3119,
1011,
1381,
327,
3119,
2,
-100,
... | |
if getattr(self.reporter, 'cancel_requested', False): return 1 | def buildSources(self): if getattr(self.reporter, 'cancel_requested', False): return 1 if not self.booksByTitle: self.fetchBooksByTitle() | 1ce23c231468dc03709ee76c7da814fa41c6e4a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/1ce23c231468dc03709ee76c7da814fa41c6e4a7/catalog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
8628,
12,
2890,
4672,
430,
486,
365,
18,
12567,
858,
4247,
30,
365,
18,
5754,
9084,
87,
858,
4247,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
8628,
12,
2890,
4672,
430,
486,
365,
18,
12567,
858,
4247,
30,
365,
18,
5754,
9084,
87,
858,
4247,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
gc.set_image_interpolation(self.interpolation) | self._cached_image.set_image_interpolation(self.interpolation) | def _render(self, gc): """ Actually draws the plot. Implements the Base2DPlot interface. """ if not self._image_cache_valid: self._compute_cached_image() if "bottom" in self.origin: sy = -1 else: sy = 1 if "left" in self.origin: sx = 1 else: sx = -1 | d62579e9c3776385c77f01769eff42d386d0299b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13167/d62579e9c3776385c77f01769eff42d386d0299b/image_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
12,
2890,
16,
8859,
4672,
3536,
4603,
3452,
30013,
326,
3207,
18,
225,
29704,
326,
3360,
22,
40,
11532,
1560,
18,
3536,
309,
486,
365,
6315,
2730,
67,
2493,
67,
877,
30,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
12,
2890,
16,
8859,
4672,
3536,
4603,
3452,
30013,
326,
3207,
18,
225,
29704,
326,
3360,
22,
40,
11532,
1560,
18,
3536,
309,
486,
365,
6315,
2730,
67,
2493,
67,
877,
30,
365... |
assert ap == u'/bax:foo[1]/bar:baz[1]' | assert ap == u'/bax:foo/bar:baz' dup1 = baz.xml_following_sibling.xml_following_sibling dup2 = dup1.xml_following_sibling ap = abspath(dup2, {u'bax': u'http://bax.com'}) assert ap == u'/bax:foo/bax:dup[2]' | def test_abspath_with_default_ns(): doc = parse(XML2) baz = doc.xml_first_child.xml_first_child ap = abspath(baz) assert ap == u'/*[namespace-uri()="http://bax.com" and local-name()="foo"][1]/*[namespace-uri()="http://bax.com" and local-name()="baz"][1]' assert [baz] == list(doc.xml_select(ap)) ap = abspath(baz.xml_following_sibling) assert ap == u'/*[namespace-uri()="http://bax.com" and local-name()="foo"][1]/bar:baz[1]' assert [baz.xml_following_sibling] == list(doc.xml_select(ap)) ap = abspath(baz, {u'bax': u'http://bax.com'}) assert ap == u'/bax:foo[1]/bax:baz[1]' ap = abspath(baz.xml_following_sibling, {u'bax': u'http://bax.com'}) assert ap == u'/bax:foo[1]/bar:baz[1]' | a2e357919857ad41e629083b96743665e09b2981 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14078/a2e357919857ad41e629083b96743665e09b2981/test_abs_path.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5113,
803,
67,
1918,
67,
1886,
67,
2387,
13332,
997,
273,
1109,
12,
4201,
22,
13,
29025,
273,
997,
18,
2902,
67,
3645,
67,
3624,
18,
2902,
67,
3645,
67,
3624,
513,
273,
948... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5113,
803,
67,
1918,
67,
1886,
67,
2387,
13332,
997,
273,
1109,
12,
4201,
22,
13,
29025,
273,
997,
18,
2902,
67,
3645,
67,
3624,
18,
2902,
67,
3645,
67,
3624,
513,
273,
948... |
f = self._findSource() | f = self.doDownload() | def do(self): | 737a8796608637ca137885bcc7d33f42ecec5ac5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/737a8796608637ca137885bcc7d33f42ecec5ac5/source.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
if f.name in f.getChildren(): | if filename in destdir.getChildren(): | def mknod(path, mode=0600, device=None): filename = posixpath.basename(path) dirname = posixpath.dirname(path) f = _findFileFromPath(dirname) if not access(path, mode): raise OSError(errno.EPERM, '') if not isinstance(f, FakeDir): raise OSError(errno.ENOTDIR, '') if f.name in f.getChildren(): raise OSError(errno.EEXIST, '') | aa20dce7c6d5bb9f33d932aab3323692451f4886 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10739/aa20dce7c6d5bb9f33d932aab3323692451f4886/os_mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
19888,
12,
803,
16,
1965,
33,
7677,
713,
16,
2346,
33,
7036,
4672,
1544,
273,
16366,
803,
18,
13909,
12,
803,
13,
4283,
225,
273,
16366,
803,
18,
12287,
12,
803,
13,
284,
3639,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5028,
19888,
12,
803,
16,
1965,
33,
7677,
713,
16,
2346,
33,
7036,
4672,
1544,
273,
16366,
803,
18,
13909,
12,
803,
13,
4283,
225,
273,
16366,
803,
18,
12287,
12,
803,
13,
284,
3639,
... |
path = model.NextImagePath() if path is True: | status = model.Next() if status is None: | def GetLocalPath(self): return self._localPath | dabd478119ddd03f0fd0847e7c386fc9e6c499d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4583/dabd478119ddd03f0fd0847e7c386fc9e6c499d6/slideshowmodel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
2042,
743,
12,
2890,
4672,
327,
365,
6315,
3729,
743,
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... | [
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,
968,
2042,
743,
12,
2890,
4672,
327,
365,
6315,
3729,
743,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'account_id': account_id[0], | 'account_id': account_id, | def _do_create(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) analytic_account_obj = pool.get('account.analytic.account') res_partner_obj = pool.get('res.partner') account_payment_term_obj = pool.get('account.payment.term') | 37282f32e2cd0512223b1c651bc783fc2a2cb12c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/37282f32e2cd0512223b1c651bc783fc2a2cb12c/hr_timesheet_final_invoice_create.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
392,
7834,
335,
67,
4631,
67,
2603,
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,
389,
2896,
67,
2640,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
392,
7834,
335,
67,
4631,
67,
2603,
273,
... |
def __call__(self, x): import sage.rings.all if sage.rings.all.is_Infinity(x): return Expect.__call__(self, 'inf') else: return Expect.__call__(self, x) | def __call__(self, x): import sage.rings.all if sage.rings.all.is_Infinity(x): return Expect.__call__(self, 'inf') else: return Expect.__call__(self, x) | c37aae41caccee4a71a6b90ea9abcd5b070a7522 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/c37aae41caccee4a71a6b90ea9abcd5b070a7522/axiom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
4672,
1930,
272,
410,
18,
86,
899,
18,
454,
309,
272,
410,
18,
86,
899,
18,
454,
18,
291,
67,
382,
7850,
12,
92,
4672,
327,
15510,
16186,
1991,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
4672,
1930,
272,
410,
18,
86,
899,
18,
454,
309,
272,
410,
18,
86,
899,
18,
454,
18,
291,
67,
382,
7850,
12,
92,
4672,
327,
15510,
16186,
1991,
... | |
print >> sys.stderr, "packageData_checker.py debug: ending __main__ section" print >> sys.stderr, "packageData_checker.py debug: done with all of import" | def print_listings(): """ """ global packageMapping_for_files if LIST_UNCLASSIFIED_FILES: #bruce 080223; usage: pass cad/src/*.py == ../*.py as arguments packageMapping_for_files = dict(packageMapping_for_files) for pyfile in sys.argv[1:]: if pyfile.endswith('.py'): basename_ext = os.path.basename(pyfile) basename, ext = os.path.splitext(basename_ext) if not packageMapping_for_files.has_key(basename): packageMapping_for_files[basename] = " NOT YET CLASSIFIED: " # print "missing file:", basename else: print "unrecognized argument: %r" % (pyfile,) continue collect_virtual_listing( packageMapping_for_files, T_MODULE) collect_virtual_listing( packageMapping_for_packages, T_PACKAGE) for subdirname, note in subdir_notes.items(): parts = subdirname.split('/') dir1 = get_virtual_subdir(parts, assert_already_there = True) FAKENAME_NOTE = " FAKENAME_NOTE " # not a valid basename, but a string (since .lower() gets called on it) sort_order = ORDER_SUBDIR_NOTE dir1[FAKENAME_NOTE] = (sort_order, note) _toplevel_virtual_subdir.print_listing(skip_toplevel_indent = True) return | 6592cb59f5cd9278218a488768a48b6b5519974c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/6592cb59f5cd9278218a488768a48b6b5519974c/packageData_checker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
1098,
899,
13332,
3536,
3536,
225,
2552,
2181,
3233,
67,
1884,
67,
2354,
225,
309,
15130,
67,
2124,
5237,
13519,
67,
12669,
30,
468,
2848,
3965,
16314,
3103,
4366,
31,
4084,
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,
1172,
67,
1098,
899,
13332,
3536,
3536,
225,
2552,
2181,
3233,
67,
1884,
67,
2354,
225,
309,
15130,
67,
2124,
5237,
13519,
67,
12669,
30,
468,
2848,
3965,
16314,
3103,
4366,
31,
4084,
30... | |
err,InstanceClass = do_windows('install')(self,arg) | err = do_windows('install')(self,arg) | def do_install(self,arg): err,InstanceClass = do_windows('install')(self,arg) if not err: # If we installed successfully, put info in registry for the # real Service class to use: command = '"%s" -C "%s"' % ( # This gives us the instance script for buildout instances # and the install script for classic instances. os.path.join(os.path.split(sys.argv[0])[0],'runzope'), self.options.configfile ) InstanceClass.setReg('command',command) # This is unfortunately needed because runzope.exe is a setuptools # generated .exe that spawns off a sub process, so pid would give us # the wrong event name. InstanceClass.setReg('pid_filename',self.options.configroot.pid_filename) | 07b89a02e6216c735247661f8a09175f5e597e2e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9658/07b89a02e6216c735247661f8a09175f5e597e2e/zopectl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
5425,
12,
2890,
16,
3175,
4672,
393,
273,
741,
67,
13226,
2668,
5425,
6134,
12,
2890,
16,
3175,
13,
309,
486,
393,
30,
468,
971,
732,
5876,
4985,
16,
1378,
1123,
316,
4023,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5425,
12,
2890,
16,
3175,
4672,
393,
273,
741,
67,
13226,
2668,
5425,
6134,
12,
2890,
16,
3175,
13,
309,
486,
393,
30,
468,
971,
732,
5876,
4985,
16,
1378,
1123,
316,
4023,
... |
self.dict[headerseen] = string.strip(line[len(headerseen)+2:]) | self.dict[headerseen] = string.strip(line[len(headerseen)+1:]) | def readheaders(self): """Read header lines. Read header lines up to the entirely blank line that terminates them. The (normally blank) line that ends the headers is skipped, but not included in the returned list. If a non-header line ends the headers, (which is an error), an attempt is made to backspace over it; it is never included in the returned list. The variable self.status is set to the empty string if all went well, otherwise it is an error message. The variable self.headers is a completely uninterpreted list of lines contained in the header (so printing them will reproduce the header exactly as it appears in the file). """ self.dict = {} self.unixfrom = '' self.headers = list = [] self.status = '' headerseen = "" firstline = 1 startofline = unread = tell = None if hasattr(self.fp, 'unread'): unread = self.fp.unread elif self.seekable: tell = self.fp.tell while 1: if tell: startofline = tell() line = self.fp.readline() if not line: self.status = 'EOF in headers' break # Skip unix From name time lines if firstline and line[:5] == 'From ': self.unixfrom = self.unixfrom + line continue firstline = 0 if headerseen and line[0] in ' \t': # It's a continuation line. list.append(line) x = (self.dict[headerseen] + "\n " + string.strip(line)) self.dict[headerseen] = string.strip(x) continue elif self.iscomment(line): # It's a comment. Ignore it. continue elif self.islast(line): # Note! No pushback here! The delimiter line gets eaten. break headerseen = self.isheader(line) if headerseen: # It's a legal header line, save it. list.append(line) self.dict[headerseen] = string.strip(line[len(headerseen)+2:]) continue else: # It's not a header line; throw it back and stop here. if not self.dict: self.status = 'No headers' else: self.status = 'Non-header line where header expected' # Try to undo the read. if unread: unread(line) elif tell: self.fp.seek(startofline) else: self.status = self.status + '; bad seek' break | d8957d6802551c6510974667e102027ed07a0fa5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d8957d6802551c6510974667e102027ed07a0fa5/rfc822.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2485,
12,
2890,
4672,
3536,
1994,
1446,
2362,
18,
225,
2720,
1446,
2362,
731,
358,
326,
21658,
7052,
980,
716,
30559,
2182,
18,
225,
1021,
261,
7959,
1230,
7052,
13,
980,
716,
3930,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2485,
12,
2890,
4672,
3536,
1994,
1446,
2362,
18,
225,
2720,
1446,
2362,
731,
358,
326,
21658,
7052,
980,
716,
30559,
2182,
18,
225,
1021,
261,
7959,
1230,
7052,
13,
980,
716,
3930,... |
self.score.getQuestionTotal()+1,self.param.val('length'))) | self.score.getQuestionTotal()+1, self.param.val('length'))) | def quiz(self,oldbox): #Defining kana selection parameters. self.kanaEngine.kanaSelectParams( (self.param.val('basic_hiragana'), self.param.val('modified_hiragana'), self.param.val('contracted_hiragana'), self.param.val('basic_katakana'), self.param.val('modified_katakana'), self.param.val('contracted_katakana'), self.param.val('additional_katakana')), (self.param.val('basic_hiragana_portions'), self.param.val('modified_hiragana_portions'), self.param.val('contracted_hiragana_portions'), self.param.val('basic_katakana_portions'), self.param.val('modified_katakana_portions'), self.param.val('contracted_katakana_portions'), self.param.val('additional_katakana_portions')), self.param.val('kana_no_repeat'), self.param.val('rand_answer_sel_range')) #Randomly getting a kana (respecting bellow conditions). self.kana = self.kanaEngine.randomKana() | 64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16479,
12,
2890,
16,
1673,
2147,
4672,
468,
6443,
310,
417,
13848,
4421,
1472,
18,
365,
18,
79,
13848,
4410,
18,
79,
13848,
3391,
1370,
12,
261,
2890,
18,
891,
18,
1125,
2668,
13240,
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,
16479,
12,
2890,
16,
1673,
2147,
4672,
468,
6443,
310,
417,
13848,
4421,
1472,
18,
365,
18,
79,
13848,
4410,
18,
79,
13848,
3391,
1370,
12,
261,
2890,
18,
891,
18,
1125,
2668,
13240,
6... |
else: event.ignore() | QtGui.QLineEdit.keyPressEvent(self,event) | def keyPressEvent(self, event): """ keyPressEvent(event) -> None If this is a string line edit, we can use Ctrl+Enter to enter the file name """ k = event.key() s = event.modifiers() if (k == QtCore.Qt.Key_Enter or k == QtCore.Qt.Key_Return): if s & QtCore.Qt.ShiftModifier: event.accept() if self.contentIsString and not self.multiLines: fileName = QtGui.QFileDialog.getOpenFileName(self, 'Use Filename ' 'as Value...', self.text(), 'All files ' '(*.*)') if not fileName.isEmpty(): self.setText(fileName) self.updateParent() | 42c083af305ea3db22beafff133d2acea623f474 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6341/42c083af305ea3db22beafff133d2acea623f474/method_dropbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
11840,
1133,
12,
2890,
16,
871,
4672,
3536,
498,
11840,
1133,
12,
2575,
13,
317,
599,
971,
333,
353,
279,
533,
980,
3874,
16,
732,
848,
999,
30715,
15,
10237,
358,
6103,
326,
585,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
498,
11840,
1133,
12,
2890,
16,
871,
4672,
3536,
498,
11840,
1133,
12,
2575,
13,
317,
599,
971,
333,
353,
279,
533,
980,
3874,
16,
732,
848,
999,
30715,
15,
10237,
358,
6103,
326,
585,... |
if isinstance(host, types.TupleType): | if isinstance(host, tuple): | def __init__(self, host, debugfunc=None): if isinstance(host, types.TupleType): host, self.weight = host else: self.weight = 1 | aa973f034fdfe4801db987afda8191177edefc04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/aa973f034fdfe4801db987afda8191177edefc04/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1198,
644,
33,
7036,
4672,
309,
1549,
12,
2564,
16,
3193,
4672,
1479,
16,
365,
18,
4865,
273,
1479,
469,
30,
365,
18,
4865,
273,
404,
2,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
16,
1198,
644,
33,
7036,
4672,
309,
1549,
12,
2564,
16,
3193,
4672,
1479,
16,
365,
18,
4865,
273,
1479,
469,
30,
365,
18,
4865,
273,
404,
2,
-100... |
PlotBase.draw(self) self.x_formatter_cb(self.ax) | def draw( self ): PlotBase.draw(self) self.x_formatter_cb(self.ax) if self.gdata.isEmpty(): return None tmp_x = []; tmp_y = [] | ffc6d6cabe145c25dc211d7c1daa3f9a712612c8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/ffc6d6cabe145c25dc211d7c1daa3f9a712612c8/BarGraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
365,
262,
30,
1377,
309,
365,
18,
75,
892,
18,
291,
1921,
13332,
327,
599,
225,
1853,
67,
92,
273,
5378,
31,
1853,
67,
93,
273,
5378,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
365,
262,
30,
1377,
309,
365,
18,
75,
892,
18,
291,
1921,
13332,
327,
599,
225,
1853,
67,
92,
273,
5378,
31,
1853,
67,
93,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,... | |
def DefineSign(welcomesite, SignPage): Page = wikipedia.Page(welcomesite, SignPage) | def DefineSign(wsite, SignPage): Page = wikipedia.Page(wsite, SignPage) | def blocked(username, welcomesite): #A little block to check if the user has already been blocked (to skip him) reg = """<li>[0-9][0-9]:[0-9][0-9], [0-9][0-9] (.*?) [0-9][0-9][0-9][0-9] <a href=\"/wiki/(.*?)\" title=\"(.*?)\">(.*?)</a> \(<a href=\"/wiki/(.*?)\" title=\"(.*?)\">(.*?)</a>""" block_text = welcomesite.getUrl('/w/index.php?title=Special:Log/block&page=User:' + username) numblock = re.findall(reg, block_text) if numblock == list(): return 'Free' else: return 'Blocked' | bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/bf50a20b7e53b37ac1a5a7ffeb2895c56bcf1f38/welcome.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14547,
12,
5053,
16,
341,
292,
10127,
1137,
4672,
468,
37,
12720,
1203,
358,
866,
309,
326,
729,
711,
1818,
2118,
14547,
261,
869,
2488,
366,
381,
13,
960,
273,
3536,
32,
549,
23224,
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,
14547,
12,
5053,
16,
341,
292,
10127,
1137,
4672,
468,
37,
12720,
1203,
358,
866,
309,
326,
729,
711,
1818,
2118,
14547,
261,
869,
2488,
366,
381,
13,
960,
273,
3536,
32,
549,
23224,
2... |
def macosxVersionCmp(self, cmp, version, arglist): import sys print >>sys.stderr, 'FIXME: macosxVersionCmp unimplemented.' return False | def macosxVersionCmp(self, cmp, version, arglist): import sys print >>sys.stderr, 'FIXME: macosxVersionCmp unimplemented.' return False | e6a51faefd2aa31804c7d79a3868d66afe35eb3d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11986/e6a51faefd2aa31804c7d79a3868d66afe35eb3d/Tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5318,
538,
92,
1444,
31832,
12,
2890,
16,
9411,
16,
1177,
16,
31805,
4672,
1930,
2589,
1172,
1671,
9499,
18,
11241,
16,
296,
25810,
30,
5318,
538,
92,
1444,
31832,
640,
21099,
1093,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5318,
538,
92,
1444,
31832,
12,
2890,
16,
9411,
16,
1177,
16,
31805,
4672,
1930,
2589,
1172,
1671,
9499,
18,
11241,
16,
296,
25810,
30,
5318,
538,
92,
1444,
31832,
640,
21099,
1093,
327,... | |
self.connect_changed_signals() | def main(self): | c72b6838dcb0b550e4eff4f42194bf7f0922f3e4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7036/c72b6838dcb0b550e4eff4f42194bf7f0922f3e4/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
self._init() | self._index=BTree() | def clear(self): | f8d4e017bcdc493e4f0cfb9aa5a2cf5f042df633 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/f8d4e017bcdc493e4f0cfb9aa5a2cf5f042df633/TextIndex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "\033[32m" | print("\033[32m", end='') | def green(self): print "\033[32m" | fc50e2444a71cd15a13d345a1f9359c0ceb01f43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8290/fc50e2444a71cd15a13d345a1f9359c0ceb01f43/UnixConsoleHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10004,
12,
2890,
4672,
1172,
1548,
15265,
63,
1578,
81,
6,
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... | [
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,
10004,
12,
2890,
4672,
1172,
1548,
15265,
63,
1578,
81,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print "Interrupt detected, cleaning up." | print timestamp(), "! Interrupt detected, cleaning up." | def push_rpm(rpm, channel, user, password, satserver): '''Push rpm into Satellite using rhnpush as needed''' if options.debug: verbose_flag = '-vv' elif options.verbose: verbose_flag = '-v' else: verbose_flag = '' if re.search('\.src\.rpm$', rpm): # source rpm, setting --source flag source_flag = '--source' else: source_flag = '' if options.force: force_flag = '--force' else: force_flag = '' # call rhnpush subprocess try: if options.verbose: print "Calling rhnpush to upload %s into %s:" % (rpm.split('/')[-1], channel) if not options.demo: rhnpush = subprocess.Popen(['rhnpush', source_flag, '--channel', channel, '--username', options.user, '--password', password, '--server', 'http://' + satserver + '/APP', rpm, verbose_flag, force_flag ], shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) rhnpush.wait() except KeyboardInterrupt: print "Interrupt detected, cleaning up." output, errors = rhnpush.communicate() print "stderr on rhnpush process:", errors os.kill(rhnpush.pid, signal.SIGKILL) sys.exit(1) if options.demo: return 0 else: output, errors = rhnpush.communicate() if (options.verbose) or (not rhnpush.returncode == 0): print output if not errors == '': print "stderr on rhnpush process:\n", errors print "rhnpush exited with returncode:", rhnpush.returncode return rhnpush.returncode | 07e2421549e748ccb09a392c60834eaea3e54917 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3457/07e2421549e748ccb09a392c60834eaea3e54917/dell-satellite-sync.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1817,
67,
86,
7755,
12,
86,
7755,
16,
1904,
16,
729,
16,
2201,
16,
5942,
3567,
4672,
9163,
7621,
25228,
1368,
25793,
19345,
1450,
6259,
82,
6206,
487,
3577,
26418,
309,
702,
18,
4148,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1817,
67,
86,
7755,
12,
86,
7755,
16,
1904,
16,
729,
16,
2201,
16,
5942,
3567,
4672,
9163,
7621,
25228,
1368,
25793,
19345,
1450,
6259,
82,
6206,
487,
3577,
26418,
309,
702,
18,
4148,
... |
obj._abc_registry = abcs.get(obj, {}).copy() | obj._abc_registry = abcs.get(obj, WeakSet()).copy() | def dash_R_cleanup(fs, ps, pic, abcs): import gc, copy_reg import _strptime, linecache, dircache import urlparse, urllib, urllib2, mimetypes, doctest import struct, filecmp, _abcoll from abc import _Abstract from distutils.dir_util import _path_created # Restore some original values. warnings.filters[:] = fs copy_reg.dispatch_table.clear() copy_reg.dispatch_table.update(ps) sys.path_importer_cache.clear() sys.path_importer_cache.update(pic) # Clear ABC registries, restoring previously saved ABC registries. for abc in [getattr(_abcoll, a) for a in _abcoll.__all__]: if not issubclass(abc, _Abstract): continue for obj in abc.__subclasses__() + [abc]: obj._abc_registry = abcs.get(obj, {}).copy() obj._abc_cache.clear() obj._abc_negative_cache.clear() # Clear assorted module caches. _path_created.clear() re.purge() _strptime._regex_cache.clear() urlparse.clear_cache() urllib.urlcleanup() urllib2.install_opener(None) dircache.reset() linecache.clearcache() mimetypes._default_mime_types() struct._cache.clear() filecmp._cache.clear() doctest.master = None # Collect cyclic trash. gc.collect() | 5dfe63809ac181887d7233f90ad32efb23f3d5f7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/5dfe63809ac181887d7233f90ad32efb23f3d5f7/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12558,
67,
54,
67,
16732,
12,
2556,
16,
4250,
16,
19189,
16,
1223,
2143,
4672,
1930,
8859,
16,
1610,
67,
1574,
1930,
389,
701,
10650,
16,
4739,
557,
807,
16,
1577,
2493,
1930,
15185,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12558,
67,
54,
67,
16732,
12,
2556,
16,
4250,
16,
19189,
16,
1223,
2143,
4672,
1930,
8859,
16,
1610,
67,
1574,
1930,
389,
701,
10650,
16,
4739,
557,
807,
16,
1577,
2493,
1930,
15185,
1... |
print """cl(ear) [lineno] | print """cl(ear) [file:][lineno] | def help_cl(self): print """cl(ear) [lineno] | e6af561e644b3c3d27f74762680a82963535cb3b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/e6af561e644b3c3d27f74762680a82963535cb3b/pdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
830,
12,
2890,
4672,
1172,
3536,
830,
12,
2091,
13,
306,
17782,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2809,
67,
830,
12,
2890,
4672,
1172,
3536,
830,
12,
2091,
13,
306,
17782,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
name='bgColCb', parent=self.panel3, pos=wxPoint(8, 72), size=wxSize(89, 21), style=0, validator=wxDefaultValidator, | name='bgColCb', parent=self.panel3, pos=wxPoint(8, 80), size=wxSize(96, 21), style=0, validator=wxDefaultValidator, | def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(true) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize) | aac0471ac41eaa175cbaa05604248123746b2b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/aac0471ac41eaa175cbaa05604248123746b2b22/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... |
if re.search('ERROR FAIL', cmd.logs['stdio'].getText()): return WARNINGS if re.search('ERROR TODO WORKED', cmd.logs['stdio'].getText()): | if re.search('TEST-UNEXPECTED-', cmd.logs['stdio'].getText()): | def evaluateCommand(self, cmd): superResult = ShellCommandReportTimeout.evaluateCommand(self, cmd) if SUCCESS != superResult: return WARNINGS if re.search('ERROR FAIL', cmd.logs['stdio'].getText()): return WARNINGS if re.search('ERROR TODO WORKED', cmd.logs['stdio'].getText()): return WARNINGS if re.search('FAIL Exited', cmd.logs['stdio'].getText()): return WARNINGS if not re.search('INFO PASS', cmd.logs['stdio'].getText()): return WARNINGS return SUCCESS | 7a98e6a7b1b7c3be64f4ca6d0a6392c5ed6108e2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/7a98e6a7b1b7c3be64f4ca6d0a6392c5ed6108e2/steps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5956,
2189,
12,
2890,
16,
1797,
4672,
2240,
1253,
273,
19433,
2189,
4820,
2694,
18,
21024,
2189,
12,
2890,
16,
1797,
13,
309,
16561,
480,
2240,
1253,
30,
327,
9744,
55,
309,
283,
18,
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,
5956,
2189,
12,
2890,
16,
1797,
4672,
2240,
1253,
273,
19433,
2189,
4820,
2694,
18,
21024,
2189,
12,
2890,
16,
1797,
13,
309,
16561,
480,
2240,
1253,
30,
327,
9744,
55,
309,
283,
18,
3... |
def __init__(self, host='localhost', ssl_port=8443, handler=cfg['prefix'] or "/candlepin", | def __init__(self, host='localhost', ssl_port=8443, handler=config['prefix'] or "/candlepin", | def __init__(self, host='localhost', ssl_port=8443, handler=cfg['prefix'] or "/candlepin", cert_file=None, key_file=None): self.host = host self.ssl_port = ssl_port self.handler = handler self.conn = None self.basic_auth_conn = None self.cert_file = cert_file self.key_file = key_file config = initConfig() self.candlepin_ca_file = config['candlepin_ca_file'] config_insecure = config['insecure'] self.insecure = False if config_insecure: self.insecure = True if self.candlepin_ca_file == None: log.info("Value \'candlepin_ca_file\' not present in config file. Assuming default value: %s", DEFAULT_CA_FILE) self.candlepin_ca_file = DEFAULT_CA_FILE # initialize connection self.conn = Restlib(self.host, self.ssl_port, self.handler, self.cert_file, self.key_file, self.candlepin_ca_file, self.insecure) log.info("Connection Established: host: %s, port: %s, handler: %s" % (self.host, self.ssl_port, self.handler)) log.info("Connection using cert_file: %s, key_file: %s, ca_file: %s insecure_mode: %s" % (self.cert_file, self.key_file, self.candlepin_ca_file, self.insecure)) #log.info("trace: %s" % trace_me()) | cec4d0300523fea681593155a664697628c163f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11137/cec4d0300523fea681593155a664697628c163f3/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
2218,
13014,
2187,
5832,
67,
655,
33,
5193,
8942,
16,
1838,
33,
1425,
3292,
3239,
3546,
578,
2206,
71,
464,
298,
13097,
3113,
3320,
67,
768,
33,
70... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1479,
2218,
13014,
2187,
5832,
67,
655,
33,
5193,
8942,
16,
1838,
33,
1425,
3292,
3239,
3546,
578,
2206,
71,
464,
298,
13097,
3113,
3320,
67,
768,
33,
70... |
paths = self.client.get_list(defs.LAUNCHERS, defs.LAUNCHERS_LIST) path.remove(path) | paths = self.client_taskman.get_list(GROUP_DEFAULT, defs.LAUNCHERS_LIST) paths.remove(path) | def remove(self, button): selection = self.treeview_launchers.get_selection() (model, iter) = selection.get_selected() path = model.get_value(iter, 2) # TODO: don't check if it exists, perhaps it's invalid if os.path.exists(path): paths = self.client.get_list(defs.LAUNCHERS, defs.LAUNCHERS_LIST) path.remove(path) if path.startswith(defs.HOME_LAUNCHERS_DIR): os.remove(path) self.client.set_list(defs.LAUNCHERS, defs.LAUNCHERS_LIST, paths) self.refresh_tree(paths, model) | 621f1c221f9d9f9d36cd658661406fdc1873b9a2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/621f1c221f9d9f9d36cd658661406fdc1873b9a2/awnClass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
3568,
4672,
4421,
273,
365,
18,
3413,
1945,
67,
20738,
414,
18,
588,
67,
10705,
1435,
261,
2284,
16,
1400,
13,
273,
4421,
18,
588,
67,
8109,
1435,
589,
273,
938,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
12,
2890,
16,
3568,
4672,
4421,
273,
365,
18,
3413,
1945,
67,
20738,
414,
18,
588,
67,
10705,
1435,
261,
2284,
16,
1400,
13,
273,
4421,
18,
588,
67,
8109,
1435,
589,
273,
938,
... |
"""Return the number of open bonds for element <eleNum>. Currently, only for the single bond case. """ | """Return the number of open bonds for element <eleNum>. Currently, only for the single bond case. """ | def getElemBondCount(self, eleNum): """Return the number of open bonds for element <eleNum>. Currently, only for the single bond case. """ elem = self._perodicalTable[eleNum] bond = elem.bonds if bond: return bond[0][0] else: return 0 | 3b028f76618d4601127f8e68774efbbf6c318379 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/3b028f76618d4601127f8e68774efbbf6c318379/elements.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4774,
3269,
9807,
1380,
12,
2890,
16,
5043,
2578,
4672,
3536,
990,
326,
1300,
434,
1696,
15692,
364,
930,
411,
6516,
2578,
18652,
15212,
16,
1338,
364,
326,
2202,
8427,
648,
18,
3536,
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,
4774,
3269,
9807,
1380,
12,
2890,
16,
5043,
2578,
4672,
3536,
990,
326,
1300,
434,
1696,
15692,
364,
930,
411,
6516,
2578,
18652,
15212,
16,
1338,
364,
326,
2202,
8427,
648,
18,
3536,
36... |
self.cols[1].set_sort_column_id(2) | self.cols[1].set_sort_column_id(1) | def __init__(self, frame, ChatNotebook): self.frame = frame self.joinedrooms = {} self.autojoin = 1 self.rooms = [] config = self.frame.np.config.sections self.PrivateRooms = config["private_rooms"]["rooms"] #self.PrivateRoomsOperator = config["private_rooms"]["operator"] #self.PrivateRoomsMembership = config["private_rooms"]["membership"] self.clist = [] self.roomsmodel = gtk.ListStore(str, int, int) frame.roomlist.RoomsList.set_model(self.roomsmodel) self.cols = InitialiseColumns(frame.roomlist.RoomsList, [_("Room"), 150, "text", self.RoomStatus], [_("Users"), -1, "text", self.RoomStatus], ) self.cols[0].set_sort_column_id(0) self.cols[1].set_sort_column_id(2) self.roomsmodel.set_sort_func(1, self.PrivateRoomsSort, 1) self.roomsmodel.set_sort_column_id(1, gtk.SORT_DESCENDING) self.cols[1].set_sort_indicator(True) for i in range (2): parent = self.cols[i].get_widget().get_ancestor(gtk.Button) if parent: parent.connect('button_press_event', PressHeader) | bd22d9a79d709d993463602575ff87e47daaa60e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8738/bd22d9a79d709d993463602575ff87e47daaa60e/chatrooms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
16903,
19751,
4672,
365,
18,
3789,
273,
2623,
365,
18,
5701,
329,
13924,
87,
273,
2618,
365,
18,
6079,
5701,
273,
404,
365,
18,
13924,
87,
273,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2623,
16,
16903,
19751,
4672,
365,
18,
3789,
273,
2623,
365,
18,
5701,
329,
13924,
87,
273,
2618,
365,
18,
6079,
5701,
273,
404,
365,
18,
13924,
87,
273,... |
There are no rational points with x-cordinate 3. | There are no rational points with x-coordinate 3. | def lift_x(self, x, all=False): """ Given the x-coordinate of a point on the curve, use the defining polynomial to find all affine points on this curve with the given x-coordinate. EXAMPLES: sage: E = EllipticCurve('37a'); E Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field sage: E.lift_x(1) (1 : 0 : 1) sage: E.lift_x(2) (2 : 2 : 1) sage: E.lift_x(1/4, all=True) [(1/4 : -3/8 : 1), (1/4 : -5/8 : 1)] There are no rational points with x-cordinate 3. sage: E.lift_x(3) Traceback (most recent call last): ... ValueError: No point with x-coordinate 3 on Elliptic Curve defined by y^2 + y = x^3 - x over Rational Field However, there are two such points in $E(\R)$: sage: E.change_ring(RR).lift_x(3, all=True) [(3.00000000000000 : 4.42442890089805 : 1.00000000000000), (3.00000000000000 : -5.42442890089805 : 1.00000000000000)] And of course it always works in $E(\C)$: sage: E.change_ring(RR).lift_x(.5, all=True) [] sage: E.change_ring(CC).lift_x(.5) (0.500000000000000 : -0.500000000000000 + 0.353553390593274*I : 1.00000000000000) We can perform these operations over finite fields too: sage: E = E.change_ring(GF(17)); E Elliptic Curve defined by y^2 + y = x^3 + 16*x over Finite Field of size 17 sage: E.lift_x(7) (7 : 11 : 1) sage: E.lift_x(3) Traceback (most recent call last): ... ValueError: No point with x-coordinate 3 on Elliptic Curve defined by y^2 + y = x^3 + 16*x over Finite Field of size 17 Note that there is only one lift with x-coordinate 10 in $E(\F_{17})$. sage: E.lift_x(10, all=True) [(10 : 8 : 1)] We can lift over more exotic rings too. sage: E = EllipticCurve('37a'); sage: E.lift_x(pAdicField(17, 5)(6)) (6 + O(17^5) : 2 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5) : 1 + O(17^5)) sage: K.<t> = PowerSeriesRing(QQ, 't', 5) sage: E.lift_x(1+t) (1 + t : 2*t - t^2 + 5*t^3 - 21*t^4 + O(t^5) : 1) sage: K.<a> = GF(16) sage: E = E.change_ring(K) sage: E.lift_x(a^3) (a^3 : a^3 + a : 1) AUTHOR: Robert Bradshaw, 2007-04-24 TEST: sage: E = EllipticCurve('37a').short_weierstrass_model().change_ring(GF(17)) sage: E.lift_x(3, all=True) [] sage: E.lift_x(7, all=True) [(7 : 3 : 1), (7 : 14 : 1)] """ a1, a2, a3, a4, a6 = self.ainvs() f = ((x + a2) * x + a4) * x + a6 K = self.base_ring() x += K(0) one = x.parent()(1) if a1.is_zero() and a3.is_zero(): if f.is_square(): if all: ys = f.sqrt(all=True) return [self.point([x, y, one], check=False) for y in ys] else: return self.point([x, f.sqrt(), one], check=False) else: b = (a1*x + a3) D = b*b + 4*f if K.characteristic() == 2: R = PolynomialRing(K, 'y') F = R([-f,b,1]) ys = F.roots(multiplicities=False) if all: return [self.point([x, y, one], check=False) for y in ys] elif len(ys) > 0: return self.point([x, ys[0], one], check=False) elif D.is_square(): if all: return [self.point([x, (-b+d)/2, one], check=False) for d in D.sqrt(all=True)] else: return self.point([x, (-b+D.sqrt())/2, one], check=False) if all: return [] else: raise ValueError, "No point with x-coordinate %s on %s"%(x, self) | 09e345b25236d5bd15eecd86cc093a836e7ba6db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/09e345b25236d5bd15eecd86cc093a836e7ba6db/ell_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28080,
67,
92,
12,
2890,
16,
619,
16,
777,
33,
8381,
4672,
3536,
16803,
326,
619,
17,
29191,
434,
279,
1634,
603,
326,
8882,
16,
999,
326,
9364,
16991,
358,
1104,
777,
28381,
3143,
603... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28080,
67,
92,
12,
2890,
16,
619,
16,
777,
33,
8381,
4672,
3536,
16803,
326,
619,
17,
29191,
434,
279,
1634,
603,
326,
8882,
16,
999,
326,
9364,
16991,
358,
1104,
777,
28381,
3143,
603... |
fmode = lstat(dst)[ST_MODE] | fmode = lstat(entry.attrib['dst'])[ST_MODE] | def InstallSymLink(self, src, dst): try: fmode = lstat(dst)[ST_MODE] if S_ISREG(fmode) or S_ISLNK(fmode): unlink(dst) elif S_ISDIR(fmode): system("mv %s/ %s.bak"%(dst, dst)) else: unlink(dst) except OSError, e: pass try: symlink(src, dst) except OSError, e: return False | 1af3cb42a465bc87f64d63e1005d4e5014c6a6c1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11867/1af3cb42a465bc87f64d63e1005d4e5014c6a6c1/Toolset.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
11901,
2098,
12,
2890,
16,
1705,
16,
3046,
4672,
775,
30,
284,
3188,
273,
328,
5642,
12,
4099,
18,
14588,
3292,
11057,
19486,
63,
882,
67,
7038,
65,
309,
348,
67,
5127,
5937,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10284,
11901,
2098,
12,
2890,
16,
1705,
16,
3046,
4672,
775,
30,
284,
3188,
273,
328,
5642,
12,
4099,
18,
14588,
3292,
11057,
19486,
63,
882,
67,
7038,
65,
309,
348,
67,
5127,
5937,
12... |
def new_salt(self, secret_key): """Return a new salt Return value must be 4 bytes long.""" return generate_key()[:4] | def should_save(self): """True if the session should be saved.""" return self.modified | 3b1cb999459f564c8d2cc15063f878e381d0d355 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14437/3b1cb999459f564c8d2cc15063f878e381d0d355/securecookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
67,
5688,
12,
2890,
4672,
3536,
5510,
309,
326,
1339,
1410,
506,
5198,
12123,
327,
365,
18,
7342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
67,
5688,
12,
2890,
4672,
3536,
5510,
309,
326,
1339,
1410,
506,
5198,
12123,
327,
365,
18,
7342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) | try: DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) except Exception: if os.path.exists(compiled_o3djs_outpath): os.unlink(compiled_o3djs_outpath) raise | def main(argv): """Builds the O3D API docs and externs and the o3djs docs.""" global _java_exe _java_exe = argv[0] global _third_party_dir _third_party_dir = argv[1] global _o3d_third_party_dir _o3d_third_party_dir = os.path.normpath( os.path.join(os.path.dirname(__file__), '..', 'third_party')) # Fix up the python path of subprocesses by setting PYTHONPATH. pythonpath = os.pathsep.join([MakePath(_o3d_third_party_dir, 'gflags', 'python'), MakePath(_o3d_third_party_dir, 'ply')]) orig_pythonpath = os.environ.get('PYTHONPATH') if orig_pythonpath: pythonpath = os.pathsep.join([pythonpath, orig_pythonpath]) os.environ['PYTHONPATH'] = pythonpath js_list_filename = MakePath('..', 'samples', 'o3djs', 'js_list.manifest') idl_list_filename = MakePath('..', 'plugin', 'idl_list.manifest') js_list_basepath = os.path.dirname(js_list_filename) idl_list_basepath = os.path.dirname(idl_list_filename) global _output_dir _output_dir = argv[2] docs_outpath = os.path.join(_output_dir, 'documentation') docs_js_outpath = MakePath(docs_outpath, 'apijs') externs_js_outpath = MakePath(_output_dir, 'externs') o3d_docs_ezt_outpath = MakePath(docs_outpath, 'reference') o3d_docs_html_outpath = MakePath(docs_outpath, 'local_html') o3djs_docs_ezt_outpath = MakePath(docs_outpath, 'reference', 'jsdocs') o3djs_docs_html_outpath = MakePath(docs_outpath, 'local_html', 'jsdocs') o3d_externs_path = MakePath(_output_dir, 'o3d-externs.js') o3djs_exports_path = MakePath(_output_dir, 'o3d-exports.js') compiled_o3djs_outpath = MakePath(docs_outpath, 'base.js') externs_path = MakePath('externs', 'externs.js') o3d_extra_externs_path = MakePath('externs', 'o3d-extra-externs.js') js_list = eval(open(js_list_filename, "r").read()) idl_list = eval(open(idl_list_filename, "r").read()) idl_files = AppendBasePath(idl_list_basepath, idl_list) o3djs_files = AppendBasePath(js_list_basepath, js_list) # we need to put base.js first? o3djs_files = ( filter(lambda x: x.endswith('base.js'), o3djs_files) + filter(lambda x: not x.endswith('base.js'), o3djs_files)) docs_js_files = [os.path.join( docs_js_outpath, os.path.splitext(os.path.basename(f))[0] + '.js') for f in idl_list] DeleteOldDocs(MakePath(docs_outpath)) BuildJavaScriptForDocsFromIDLs(idl_files, docs_js_outpath) BuildO3DDocsFromJavaScript([o3d_extra_externs_path] + docs_js_files, o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildO3DClassHierarchy(o3d_docs_html_outpath) BuildJavaScriptForExternsFromIDLs(idl_files, externs_js_outpath) BuildO3DExternsFile(externs_js_outpath, o3d_extra_externs_path, o3d_externs_path) BuildO3DJSDocs(o3djs_files + [o3d_externs_path], o3djs_docs_ezt_outpath, o3djs_docs_html_outpath, o3djs_exports_path) CopyStaticFiles(o3d_docs_ezt_outpath, o3d_docs_html_outpath) BuildCompiledO3DJS(o3djs_files + [o3djs_exports_path], externs_path, o3d_externs_path, compiled_o3djs_outpath) | c802a1f6ff13658d66edaa83fc8a9b19edaf9e91 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/c802a1f6ff13658d66edaa83fc8a9b19edaf9e91/build_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
3536,
7746,
326,
531,
23,
40,
1491,
3270,
471,
18885,
87,
471,
326,
320,
23,
72,
2924,
3270,
12123,
2552,
389,
6290,
67,
14880,
389,
6290,
67,
14880,
273,
5261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3536,
7746,
326,
531,
23,
40,
1491,
3270,
471,
18885,
87,
471,
326,
320,
23,
72,
2924,
3270,
12123,
2552,
389,
6290,
67,
14880,
389,
6290,
67,
14880,
273,
5261,
... |
print 'parsing comments for', post | def parse_comments(self, post): print 'parsing comments for', post comments = {} unresolved_parents = {} | 3971ab248c9675fd10b8e78a70a73a9f06d0bdb4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5796/3971ab248c9675fd10b8e78a70a73a9f06d0bdb4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
9231,
12,
2890,
16,
1603,
4672,
5678,
273,
2618,
20573,
67,
12606,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
9231,
12,
2890,
16,
1603,
4672,
5678,
273,
2618,
20573,
67,
12606,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
indices = range(self.scan_data.measurement.acquired) | indices = np.arange(self.scan_data.measurement.acquired) | def processAverageSpectrum(self, indices=None): if indices is None: indices = range(self.scan_data.measurement.acquired) n_indices = len(indices) if n_indices: masked = self.scan_data.measurement.masked[...][indices] indices = indices[np.logical_not(masked)] n_indices = len(indices) if n_indices: self.statusbar.showMessage('Averaging spectra ...') QtGui.qApp.processEvents() | f7e7ef2ae251544a0a582184010122b0cfa44b1c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14949/f7e7ef2ae251544a0a582184010122b0cfa44b1c/mcaanalysiswindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
17115,
55,
13324,
12,
2890,
16,
4295,
33,
7036,
4672,
309,
4295,
353,
599,
30,
4295,
273,
1130,
18,
297,
726,
12,
2890,
18,
9871,
67,
892,
18,
16944,
18,
1077,
1402,
13,
290,
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,
1207,
17115,
55,
13324,
12,
2890,
16,
4295,
33,
7036,
4672,
309,
4295,
353,
599,
30,
4295,
273,
1130,
18,
297,
726,
12,
2890,
18,
9871,
67,
892,
18,
16944,
18,
1077,
1402,
13,
290,
6... |
utils.run_cmd("git pull %s %s"%(self.git_repo, self.branch)) else: utils.run_cmd("git pull %s master"%(self.git_repo)) | utils.run_cmd("git pull origin %s"%self.branch) else: utils.run_cmd("git pull origin master") | def pull(self): os.chdir(self.co_path) | c091b1cce9bdf60f3242b5eb68e22e8f8b0f9645 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4427/c091b1cce9bdf60f3242b5eb68e22e8f8b0f9645/git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6892,
12,
2890,
4672,
1140,
18,
343,
1214,
12,
2890,
18,
2894,
67,
803,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6892,
12,
2890,
4672,
1140,
18,
343,
1214,
12,
2890,
18,
2894,
67,
803,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
message = i18n.segment.Message() | message = Message() | def process_message(message, keep_spaces): # Normalize the message message.normalize() # Left strip if message: x = message[0] if isinstance(x, unicode) and x.strip() == u'': del message[0] # Right strip if message: x = message[-1] if isinstance(x, unicode) and x.strip() == u'': del message[-1] # Process if message: # Check wether the message is only one element if len(message) == 1 and isinstance(message[0], XML.Element): node = message[0] message = i18n.segment.Message(node.children) for x in process_message(message, keep_spaces): yield x else: # Check wether the node message has real text to process. for x in message: if isinstance(x, unicode): if x.strip(): break elif isinstance(x, XML.Element): for node in x.traverse(): if isinstance(node, unicode): if node.strip(): break else: continue break else: # Nothing to translate raise StopIteration # Something to translate: segmentation for segment in message.get_segments(keep_spaces): yield segment | c739b4f97afe8840a74ebda80ca18c7e05965f49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/c739b4f97afe8840a74ebda80ca18c7e05965f49/XHTML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
2150,
12,
2150,
16,
3455,
67,
9554,
4672,
468,
14282,
326,
883,
883,
18,
12237,
1435,
468,
13338,
2569,
309,
883,
30,
619,
273,
883,
63,
20,
65,
309,
1549,
12,
92,
16,
5252... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2150,
12,
2150,
16,
3455,
67,
9554,
4672,
468,
14282,
326,
883,
883,
18,
12237,
1435,
468,
13338,
2569,
309,
883,
30,
619,
273,
883,
63,
20,
65,
309,
1549,
12,
92,
16,
5252... |
self.gnbd_ip.set_text("") | def clear_fi_forms(self): self.apc_port.set_text("") self.apc_switch.set_text("") self.wti_port.set_text("") self.brocade_port.set_text("") self.vixel_port.set_text("") self.gnbd_ip.set_text("") self.sanbox2_port.set_text("") self.bladecenter_blade.set_text("") self.mcdata_port.set_text("") self.egenera_lpan.set_text("") self.egenera_pserver.set_text("") self.bullpap_domain.set_text("") | 66ac32aee48ed39c9a1821e4ba792531add72903 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3879/66ac32aee48ed39c9a1821e4ba792531add72903/FenceHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
22056,
67,
9741,
12,
2890,
4672,
365,
18,
438,
71,
67,
655,
18,
542,
67,
955,
2932,
7923,
365,
18,
438,
71,
67,
9610,
18,
542,
67,
955,
2932,
7923,
365,
18,
6046,
77,
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,
2424,
67,
22056,
67,
9741,
12,
2890,
4672,
365,
18,
438,
71,
67,
655,
18,
542,
67,
955,
2932,
7923,
365,
18,
438,
71,
67,
9610,
18,
542,
67,
955,
2932,
7923,
365,
18,
6046,
77,
67,... | |
def number_of_partitions(n,k=None, algorithm='bober'): | def number_of_partitions(n,k=None, algorithm='default'): | def number_of_partitions(n,k=None, algorithm='bober'): r""" Returns the size of partitions_list(n,k). INPUT: n -- an integer k -- (default: None); if specified, instead returns the cardinality of the set of all (unordered) partitions of the positive integer n into sums with k summands. algorithm -- (default: 'bober') 'bober' -- use Jonathon Bober's implementation (*very* fast, but new and not well tested yet). 'gap' -- use GAP (VERY *slow*) 'pari' -- use PARI. Speed seems the same as GAP until $n$ is in the thousands, in which case PARI is faster. *But* PARI has a bug, e.g., on 64-bit Linux PARI-2.3.2 outputs numbpart(147007)%1000 as 536, but it should be 533!. So do not use this option. IMPLEMENTATION: Wraps GAP's NrPartitions or PARI's numbpart function. Use the function \code{partitions(n)} to return a generator over all partitions of $n$. It is possible to associate with every partition of the integer n a conjugacy class of permutations in the symmetric group on n points and vice versa. Therefore p(n) = NrPartitions(n) is the number of conjugacy classes of the symmetric group on n points. EXAMPLES: sage: v = list(partitions(5)); v [(1, 1, 1, 1, 1), (1, 1, 1, 2), (1, 2, 2), (1, 1, 3), (2, 3), (1, 4), (5,)] sage: len(v) 7 sage: number_of_partitions(5, algorithm='gap') 7 sage: number_of_partitions(5, algorithm='pari') 7 sage: number_of_partitions(5, algorithm='bober') 7 The input must be a nonnegative integer or a ValueError is raised. sage: number_of_partitions(-5) Traceback (most recent call last): ... ValueError: n (=-5) must be a nonnegative integer sage: number_of_partitions(10,2) 5 sage: number_of_partitions(10) 42 sage: number_of_partitions(3) 3 sage: number_of_partitions(10) 42 sage: number_of_partitions(3, algorithm='pari') 3 sage: number_of_partitions(10, algorithm='pari') 42 sage: number_of_partitions(40) 37338 sage: number_of_partitions(100) 190569292 A generating function for p(n) is given by the reciprocal of Euler's function: \[ \sum_{n=0}^\infty p(n)x^n = \prod_{k=1}^\infty \left(\frac {1}{1-x^k} \right). \] We use SAGE to verify that the first several coefficients do instead agree: sage: q = PowerSeriesRing(QQ, 'q', default_prec=9).gen() sage: prod([(1-q^k)^(-1) for k in range(1,9)]) ## partial product of 1 + q + 2*q^2 + 3*q^3 + 5*q^4 + 7*q^5 + 11*q^6 + 15*q^7 + 22*q^8 + O(q^9) sage: [number_of_partitions(k) for k in range(2,10)] [2, 3, 5, 7, 11, 15, 22, 30] REFERENCES: http://en.wikipedia.org/wiki/Partition_%28number_theory%29 """ n = ZZ(n) if n < 0: raise ValueError, "n (=%s) must be a nonnegative integer"%n elif n == 0: return ZZ(1) if algorithm == 'gap': if k==None: ans=gap.eval("NrPartitions(%s)"%(ZZ(n))) else: ans=gap.eval("NrPartitions(%s,%s)"%(ZZ(n),ZZ(k))) return ZZ(ans) elif algorithm == 'bober': return partitions_ext.number_of_partitions(n) elif algorithm == 'pari': if not k is None: raise ValueError, "cannot specify second argument k if the algorithm is PARI" return ZZ(pari(ZZ(n)).numbpart()) raise ValueError, "unknown algorithm '%s'"%algorithm | 8a5d6da61789d8ca741f4ba72dacb9a127d70350 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/8a5d6da61789d8ca741f4ba72dacb9a127d70350/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1300,
67,
792,
67,
21275,
12,
82,
16,
79,
33,
7036,
16,
4886,
2218,
1886,
11,
4672,
436,
8395,
2860,
326,
963,
434,
10060,
67,
1098,
12,
82,
16,
79,
2934,
225,
12943,
30,
290,
1493,
... |
opts, args = getopt.getopt(sys.argv[1:], "c:i:s:", ["cache", "internet2_netblocks", "socket"]) | global debug global logfile opts, args = getopt.getopt(sys.argv[1:], "c:i:s:dl:", ["cache", "internet2_netblocks", "socket", "debug", "log"]) | def parse_args(): global cachefile global socketfile global internet2_netblocks_file opts, args = getopt.getopt(sys.argv[1:], "c:i:s:", ["cache", "internet2_netblocks", "socket"]) for option, argument in opts: if option in ("-c", "--cache"): cachefile = argument if option in ("-i", "--internet2_netblocks"): internet2_netblocks_file = argument if option in ("-s", "--socket"): socketfile = argument | e692c0bb4927ba75fe4859eed72d903f59912e95 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13031/e692c0bb4927ba75fe4859eed72d903f59912e95/mirrorlist_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1968,
13332,
2552,
1247,
768,
2552,
2987,
768,
2552,
24264,
22,
67,
2758,
7996,
67,
768,
2552,
1198,
2552,
15204,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
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,
1109,
67,
1968,
13332,
2552,
1247,
768,
2552,
2987,
768,
2552,
24264,
22,
67,
2758,
7996,
67,
768,
2552,
1198,
2552,
15204,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
... |
format='%(asctime)s %(levelname)-8s %(message)s', stream=sys.stderr) | format='%(asctime)s %(levelname)-8s %(message)s', stream=sys.stderr) | def setup_logging(inDownloader=False): global _loggingSetup if _loggingSetup: return if inDownloader: logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)-8s %(message)s', stream=sys.stderr) else: logger = logging.getLogger('') logger.setLevel(logging.DEBUG) rotater = ApatheticRotatingFileHandler(config.get(prefs.LOG_PATHNAME), mode="a", maxBytes=100000, backupCount=5) rotater.setLevel(logging.DEBUG) formatter = logging.Formatter('%(asctime)s %(levelname)-8s %(message)s') rotater.setFormatter(formatter) logging.getLogger('').addHandler(rotater) rotater.doRollover() sys.stderr = sys.stdout = AutoflushingStream(rotater.stream) # Disable the xpcom log handlers. This just means the log handler we # install at the root level will handle it instead. The xpcom one # generates errors when it writes to stderr. xpcomLogger = logging.getLogger('xpcom') for handler in xpcomLogger.handlers[:]: xpcomLogger.removeHandler(handler) _loggingSetup = True | 24edb968426de64c0cc9e61f085bf1ff09896f3e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/24edb968426de64c0cc9e61f085bf1ff09896f3e/utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
11167,
12,
267,
4164,
6714,
33,
8381,
4672,
2552,
389,
11167,
7365,
309,
389,
11167,
7365,
30,
327,
225,
309,
316,
4164,
6714,
30,
2907,
18,
13240,
809,
12,
2815,
33,
11167,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
67,
11167,
12,
267,
4164,
6714,
33,
8381,
4672,
2552,
389,
11167,
7365,
309,
389,
11167,
7365,
30,
327,
225,
309,
316,
4164,
6714,
30,
2907,
18,
13240,
809,
12,
2815,
33,
11167,
... |
pprint(request.__dict__, request_buffer) | def send_error_notification(self, request, error): from zine.notifications import send_notification_template, ZINE_ERROR request_buffer = StringIO() pprint(request.__dict__, request_buffer) request_buffer.seek(0) send_notification_template( ZINE_ERROR, 'notifications/on_server_error.zeml', user=request.user, summary=error.message, request_details=request_buffer.read(), longtext=''.join(format_exception(*sys.exc_info())) ) | 997bdf41f72ca87d015a2823d1221cf86ac2904e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12815/997bdf41f72ca87d015a2823d1221cf86ac2904e/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1636,
67,
9927,
12,
2890,
16,
590,
16,
555,
4672,
628,
998,
558,
18,
15286,
1930,
1366,
67,
9927,
67,
3202,
16,
2285,
3740,
67,
3589,
590,
67,
4106,
273,
15777,
1435,
590,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
1636,
67,
9927,
12,
2890,
16,
590,
16,
555,
4672,
628,
998,
558,
18,
15286,
1930,
1366,
67,
9927,
67,
3202,
16,
2285,
3740,
67,
3589,
590,
67,
4106,
273,
15777,
1435,
590,
... | |
old_cursor.execute("SELECT id, name, loaned FROM volumes;") for i in old_cursor.fetchall(): o = new_db.Volume(name=i[1], loaned=bool(i[2])) o.save(); o.flush() | old_cursor.execute("SELECT id, name FROM volumes;") for i in old_cursor.fetchall(): o = new_db.Volume(name=i[1]) try: o.save(); o.flush() except Exception, e: self.debug.show(str(e)) continue | def convert_from_old_db(self, source_file, destination_file): #{{{ # TODO: table.insert().execute({'number':1, 'o_title':'test1'}, {'number':2, 'title: 'test2'}) is faster! print 'Converting old database - it can take several minutes...' gutils.info(self,_("Griffith will now convert your database to the new format. This can take several minutes if you have a large database.")) from sqlalchemy.orm import clear_mappers from sql import GriffithSQL from gutils import digits_only import os if not os.path.isfile(source_file): return False if open(source_file).readline()[:47] == '** This file contains an SQLite 2.1 database **': try: import sqlite from sqlite import DatabaseError except: print 'Old DB conversion: please install pysqlite legacy (v1.0)' gutils.warning(self,_("Old DB conversion: please install pysqlite legacy (v1.0)")) return False else: from pysqlite2 import dbapi2 as sqlite from pysqlite2.dbapi2 import DatabaseError if os.path.isfile(destination_file): # rename destination_file if it already exist i = 1 while True: if os.path.isfile("%s_%s" % (destination_file, i)): i += 1 else: break os.rename(destination_file, "%s_%s" % (destination_file, i)) try: old_db = sqlite.connect(source_file) except DatabaseError, e: if str(e) == 'file is encrypted or is not a database': print 'Your database is most probably in wrong SQLite format, please convert it to SQLite3:' print '$ sqlite ~/.griffith/griffith.gri .dump | sqlite3 ~/.griffith/griffith.gri3' print '$ mv ~/.griffith/griffith.gri{,2}' print '$ mv ~/.griffith/griffith.gri{3,}' print 'or install pysqlite in version 1.0' gutils.warning(self,_("Your database is most probably in SQLite2 format, please convert it to SQLite3")) else: raise return False old_cursor = old_db.cursor() # fix old database old_cursor.execute("UPDATE movies SET media = '1' WHERE media = 'DVD';") old_cursor.execute("UPDATE movies SET media = '2' WHERE media = 'DVD-R';") old_cursor.execute("UPDATE movies SET media = '3' WHERE media = 'DVD-RW';") old_cursor.execute("UPDATE movies SET media = '4' WHERE media = 'DVD+R';") old_cursor.execute("UPDATE movies SET media = '5' WHERE media = 'DVD+RW';") old_cursor.execute("UPDATE movies SET media = '6' WHERE media = 'DVD-RAM';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'DivX';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'DIVX';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'XviD';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'XVID';") old_cursor.execute("UPDATE movies SET media = '7' WHERE media = 'WMV';") old_cursor.execute("UPDATE movies SET media = '9' WHERE media = 'VCD';") old_cursor.execute("UPDATE movies SET media = '10' WHERE media = 'SVCD'; ") old_cursor.execute("UPDATE movies SET media = '11' WHERE media = 'VHS';") old_cursor.execute("UPDATE movies SET media = '12' WHERE media = 'BETACAM';") old_cursor.execute("UPDATE movies SET collection_id=0 WHERE collection_id<1") old_cursor.execute("UPDATE movies SET volume_id=0 WHERE volume_id<1") old_cursor.execute("UPDATE movies SET color=NULL WHERE color<1 OR color=''") old_cursor.execute("UPDATE movies SET condition=NULL WHERE condition<0 OR condition='' OR condition>2") old_cursor.execute("UPDATE movies SET layers=NULL WHERE layers<0 OR layers='' OR layers>3") old_cursor.execute("UPDATE movies SET region=NULL WHERE region='' OR region=2 OR region<0 OR region>8") old_cursor.execute("UPDATE movies SET year=NULL WHERE year<1900 or year>2007") old_cursor.execute("UPDATE movies SET rating=0 WHERE rating<0") # FIXME? old_cursor.execute("UPDATE movies SET rating=10 WHERE rating>10") # FIXME? old_cursor.execute("UPDATE loans SET return_date=NULL WHERE return_date=''") old_cursor.execute("DELETE FROM loans WHERE date='' OR date ISNULL") old_cursor.execute("DELETE FROM loans WHERE movie_id=0") old_cursor.execute("DELETE FROM loans WHERE movie_id NOT IN (SELECT id FROM movies)") old_cursor.execute("DELETE FROM volumes WHERE name = ''") old_cursor.execute("DELETE FROM volumes WHERE name = 'None'") old_cursor.execute("DELETE FROM collections WHERE name = ''") old_cursor.execute("DELETE FROM collections WHERE name = 'None'") old_cursor.execute("DELETE FROM languages WHERE name = ''") self.config['db_type'] = 'sqlite' self.config['default_db'] = 'griffith.db' self.config['posters'] = 'posters' self.config['color'] = 0 self.config['condition'] = 0 self.config['layers'] = 0 self.config['media'] = 0 self.config['region'] = 0 self.config['vcodec'] = 0 self.locations['posters'] = os.path.join(self.locations['home'], 'posters') new_db = GriffithSQL(self.config, self.debug, self.locations['home']) # collections collection_mapper = {0:None, u'':None} old_cursor.execute("SELECT id, name, loaned FROM collections;") for i in old_cursor.fetchall(): o = new_db.Collection(name=i[1], loaned=bool(i[2])) o.save(); o.flush() collection_mapper[i[0]] = o.collection_id # volumes volume_mapper = {0:None, u'':None} old_cursor.execute("SELECT id, name, loaned FROM volumes;") for i in old_cursor.fetchall(): o = new_db.Volume(name=i[1], loaned=bool(i[2])) o.save(); o.flush() volume_mapper[i[0]] = o.volume_id # people person_mapper = {} old_cursor.execute("SELECT id, name, email, phone FROM people;") for i in old_cursor.fetchall(): o = new_db.Person(name=i[1], email=i[2], phone=i[3]) o.save(); o.flush() person_mapper[i[0]] = o.person_id # languages language_mapper = {} old_cursor.execute("SELECT id, name FROM languages;") for i in old_cursor.fetchall(): o = new_db.Lang.get_by(name=i[1]) if o is not None: language_mapper[i[0]] = o.lang_id else: o = new_db.Lang(name=i[1]) o.save(); o.flush() language_mapper[i[0]] = o.lang_id # media medium_mapper = {'0':None} old_cursor.execute("SELECT id, name FROM media;") for i in old_cursor.fetchall(): o = new_db.Medium.get_by(name=i[1]) if o is not None: medium_mapper[i[0]] = o.medium_id else: o = new_db.Medium(name=i[1]) o.save(); o.flush() medium_mapper[i[0]] = o.medium_id # tags tag_mapper = {} old_cursor.execute("SELECT id, name FROM tags;") for i in old_cursor.fetchall(): o = new_db.Tag.get_by(name=i[1]) if o is not None: tag_mapper[i[0]] = o.tag_id else: o = new_db.Tag(name=i[1]) o.save(); o.flush() tag_mapper[i[0]] = o.tag_id # movies movie_mapper = {} old_cursor.execute(""" SELECT id, volume_id, collection_id, original_title, title, director, number, image, plot, country, year, runtime, classification, genre, studio, site, imdb, actors, trailer, rating, loaned, media, num_media, obs, seen, region, condition, color, layers FROM movies ORDER BY number;""") for i in old_cursor.fetchall(): o = new_db.Movie() o.number = digits_only(i[6]) o.volume_id = volume_mapper[i[1]] o.collection_id = collection_mapper[i[2]] o.o_title = i[3][:255] o.title = i[4][:255] o.director = i[5][:255] o.image = i[7][:128] o.plot = i[8] o.country = i[9][:128] o.year = digits_only(i[10]) o.runtime = digits_only(i[11]) o.classification = i[12][:128] o.genre = i[13][:128] o.studio = i[14][:128] o.o_site = i[15][:255] o.site = i[16][:255] o.cast = i[17] o.trailer = i[18][:255] o.rating = digits_only(i[19]) o.loaned = bool(i[20]) o.medium_id = medium_mapper[int(i[21])] o.media_num = digits_only(i[22]) o.notes = i[23] o.seen = bool(i[24]) o.region = digits_only(i[25]) o.cond = digits_only(i[26], 5) o.color = digits_only(i[27], 3) o.layers = digits_only(i[28], 4) o.save(); o.flush() movie_mapper[i[0]] = o.movie_id # movie tag old_cursor.execute("SELECT movie_id, tag_id FROM movie_tag;") for i in old_cursor.fetchall(): o = new_db.MovieTag.get_by(movie_id=movie_mapper[i[0]], tag_id=tag_mapper[i[1]]) if o is None: m = new_db.Movie.get_by(movie_id=movie_mapper[i[0]]) t = new_db.Tag.get_by(tag_id=tag_mapper[i[1]]) t.save() m.tags.append(t) m.save(); m.flush() # movie lang old_cursor.execute("SELECT movie_id, lang_id, type FROM movie_lang;") for i in old_cursor.fetchall(): o = new_db.MovieLang.get_by(movie_id=movie_mapper[i[0]], lang_id=language_mapper[i[1]], type=i[2]) if o is None: m = new_db.Movie.get_by(movie_id=movie_mapper[i[0]]) l = new_db.MovieLang(lang_id=language_mapper[i[1]], type=i[2]) l.save() m.languages.append(l) m.save(); m.flush() # loans old_cursor.execute("SELECT person_id, movie_id, volume_id, collection_id, date, return_date FROM loans;") for i in old_cursor.fetchall(): m = new_db.Movie.get_by(movie_id=movie_mapper[i[1]]) o = new_db.Loan() o.person_id = person_mapper[i[0]] o.volume_id = volume_mapper[i[2]] o.collection_id = collection_mapper[i[3]] o.date = str(i[4])[:10] if i[5] is not None: o.return_date = str(i[5])[:10] else: m.loaned = True o.save(); m.loans.append(o) m.flush() clear_mappers() return True | 2dadec19fe55a20ffd9eb6f4ebb1688a211b033a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2687/2dadec19fe55a20ffd9eb6f4ebb1688a211b033a/dbupgrade.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
2080,
67,
1673,
67,
1966,
12,
2890,
16,
1084,
67,
768,
16,
2929,
67,
768,
4672,
202,
3642,
12187,
468,
2660,
30,
1014,
18,
6387,
7675,
8837,
12590,
11,
2696,
4278,
21,
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,
1765,
67,
2080,
67,
1673,
67,
1966,
12,
2890,
16,
1084,
67,
768,
16,
2929,
67,
768,
4672,
202,
3642,
12187,
468,
2660,
30,
1014,
18,
6387,
7675,
8837,
12590,
11,
2696,
4278,
21,
16,
... |
c(names='.') | c(names=subdir) | def _initializeWorkingDir(self, root, repository, module, subdir): """ Setup the monotone working copy The user must setup a monotone working directory himself. Then we simply use 'monotone commit', without having to specify a database file or branch. Monotone looks up the database and branch in it's MT directory. """ | b2f9902b127996b2c171f1afba402b14e4a52a50 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/b2f9902b127996b2c171f1afba402b14e4a52a50/monotone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11160,
14836,
1621,
12,
2890,
16,
1365,
16,
3352,
16,
1605,
16,
16921,
4672,
3536,
10939,
326,
6921,
352,
476,
5960,
1610,
225,
1021,
729,
1297,
3875,
279,
6921,
352,
476,
5960,
186... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11160,
14836,
1621,
12,
2890,
16,
1365,
16,
3352,
16,
1605,
16,
16921,
4672,
3536,
10939,
326,
6921,
352,
476,
5960,
1610,
225,
1021,
729,
1297,
3875,
279,
6921,
352,
476,
5960,
186... |
title = "%s <code>(%s)</code>" % (title, variant) | title = u"%s <code>(%s)</code>" % (title, variant) | def page_link(page, variant=model.Text.HEAD, create=False, link=True, icon=True, icon_size=16): if create: page = page.encode('utf-8').replace("<", "<") page = page.replace(">", ">") page = page.replace("&", "&") url = urllib.quote(page) url = "/page/new?title=%s" % url url = instance_url(c.instance, path=url) return "<a class='page_link new' href='%s'>%s</a>" % (url, page) if page.is_deleted(): link = False if not link: return cgi.escape(page.title) text = "" _text = page.variant_head(variant) if icon: text += "<img class='dgb_icon' src='%s' /> " % text_icon(_text, page, size=icon_size) text += "<a class='page_link exists' href='%s'>%s</a>" title = page.title if variant != model.Text.HEAD: title = "%s <code>(%s)</code>" % (title, variant) return text % (entity_url(_text), cgi.escape(title)) | d3aabe3fe9dc3859e3a5d92f8d18e6ed2121896a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10360/d3aabe3fe9dc3859e3a5d92f8d18e6ed2121896a/helpers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1363,
67,
1232,
12,
2433,
16,
5437,
33,
2284,
18,
1528,
18,
12458,
16,
752,
33,
8381,
16,
1692,
33,
5510,
16,
4126,
33,
5510,
16,
4126,
67,
1467,
33,
2313,
4672,
309,
752,
30,
1363,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1363,
67,
1232,
12,
2433,
16,
5437,
33,
2284,
18,
1528,
18,
12458,
16,
752,
33,
8381,
16,
1692,
33,
5510,
16,
4126,
33,
5510,
16,
4126,
67,
1467,
33,
2313,
4672,
309,
752,
30,
1363,
... |
12345 > llin register 45 DL secret hello world | 12345 > llin register 45 DL hello world | def testScript(self): a = """ 8005551219 > llin register 20 dl secret crummy user 8005551219 < Hello cuser! You are now registered as Distribution point team leader at KANO State. """ self.runScript(a) # this should succeed because we just created him Reporter.objects.get(alias="cuser") dict = {"alias":"fail"} # make sure checking a non-existant user fails self.assertRaises(Reporter.DoesNotExist, Reporter.objects.get, **dict) | f47a45ce40c2d07eef6e7d34514c9541ea3d902b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/f47a45ce40c2d07eef6e7d34514c9541ea3d902b/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
3651,
12,
2890,
4672,
279,
273,
3536,
1725,
713,
2539,
13757,
3657,
405,
6579,
267,
1744,
4200,
8910,
4001,
4422,
379,
4811,
729,
1725,
713,
2539,
13757,
3657,
411,
20889,
276,
1355,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3651,
12,
2890,
4672,
279,
273,
3536,
1725,
713,
2539,
13757,
3657,
405,
6579,
267,
1744,
4200,
8910,
4001,
4422,
379,
4811,
729,
1725,
713,
2539,
13757,
3657,
411,
20889,
276,
1355,... |
if "e" in reports: log( " Generating expected_results ..." ) | if 'e' in reports: log( ' Generating expected_results ...' ) | def make_result_pages( test_results_file , expected_results_file , failures_markup_file , source , run_date , comment_file , results_dir , result_prefix , xslt_proc_name , reports ): log( "Producing the reports..." ) __log__ = 1 output_dir = os.path.join( results_dir, result_prefix ) if not os.path.exists( output_dir ): os.makedirs( output_dir ) xslt_proc = registered_xsltprocs[ xslt_proc_name ] if comment_file != "": comment_file = os.path.abspath( comment_file ) if expected_results_file != "": expected_results_file = os.path.abspath( expected_results_file ) else: expected_results_file = os.path.abspath( map_path( "empty_expected_results.xml" ) ) extended_test_results = os.path.join( output_dir, "extended_test_results.xml" ) if "x" in reports: log( " Merging with expected results..." ) xslt_proc( test_results_file , xsl_path( "add_expected_results.xsl" ) , extended_test_results , { "expected_results_file": expected_results_file, "failures_markup_file" : failures_markup_file } ) links = os.path.join( output_dir, "links.html" ) test_output_dir = os.path.join( output_dir, "output" ) if not os.path.exists( test_output_dir ): os.makedirs( test_output_dir ) if "l" in reports: log( " Making test output files..." ) xslt_proc( extended_test_results , xsl_path( "links_page.xsl" ) , links , { "source": source , "run_date": run_date , "comment_file": comment_file , "explicit_markup_file" : failures_markup_file } ) issues = os.path.join( output_dir, "issues.html" ) if "i" in reports: log( " Making issues list..." ) xslt_proc( extended_test_results , xsl_path( "issues_page.xsl" ) , issues , { "source": source , "run_date": run_date , "comment_file": comment_file , "explicit_markup_file" : failures_markup_file } ) for mode in ( "developer", "user" ): if mode[0] + "d" in reports: log( " Making detailed %s report..." % mode ) xslt_proc( extended_test_results , xsl_path( "result_page.xsl" ) , os.path.join( output_dir, "%s_%s" % ( mode, "result_page.html" ) ) , { "links_file": "links.html" , "mode": mode , "source": source , "run_date": run_date , "comment_file": comment_file , "expected_results_file": expected_results_file , "explicit_markup_file" : failures_markup_file } ); for mode in ( "developer", "user" ): if mode[0] + "s" in reports: log( " Making summary %s report..." % mode ) xslt_proc( extended_test_results , xsl_path( "summary_page.xsl" ) , os.path.join( output_dir, "%s_%s" % ( mode, "summary_page.html" ) ) , { "mode" : mode , "source": source , "run_date": run_date , "comment_file": comment_file , "explicit_markup_file" : failures_markup_file } ); if "e" in reports: log( " Generating expected_results ..." ) xslt_proc( extended_test_results , xsl_path( "produce_expected_results.xsl" ) , os.path.join( output_dir, "expected_results.xml" ) ) shutil.copyfile( xsl_path( "master.css" ), os.path.join( output_dir, "master.css" ) ) | 032bc19415907e1c169b60349b3cd5a706b5789e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7959/032bc19415907e1c169b60349b3cd5a706b5789e/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2088,
67,
7267,
12,
1842,
67,
4717,
67,
768,
269,
2665,
67,
4717,
67,
768,
269,
11720,
67,
15056,
67,
768,
269,
1084,
269,
1086,
67,
712,
269,
2879,
67,
768,
269,
1686,
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,
1221,
67,
2088,
67,
7267,
12,
1842,
67,
4717,
67,
768,
269,
2665,
67,
4717,
67,
768,
269,
11720,
67,
15056,
67,
768,
269,
1084,
269,
1086,
67,
712,
269,
2879,
67,
768,
269,
1686,
67,... |
server.mark_dead(msg[1]) | if type(msg) is types.TupleType: msg = msg[1] server.mark_dead(msg) | def _incrdecr(self, cmd, key, delta): check_key(key) server, key = self._get_server(key) if not server: return 0 self._statlog(cmd) cmd = "%s %s %d" % (cmd, key, delta) try: server.send_cmd(cmd) line = server.readline() return int(line) except socket.error, msg: server.mark_dead(msg[1]) return None | 88a4a25d1f1f5b18f3054d2146c90327a0fd9d97 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11935/88a4a25d1f1f5b18f3054d2146c90327a0fd9d97/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
267,
3353,
323,
3353,
12,
2890,
16,
1797,
16,
498,
16,
3622,
4672,
866,
67,
856,
12,
856,
13,
1438,
16,
498,
273,
365,
6315,
588,
67,
3567,
12,
856,
13,
309,
486,
1438,
30,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
267,
3353,
323,
3353,
12,
2890,
16,
1797,
16,
498,
16,
3622,
4672,
866,
67,
856,
12,
856,
13,
1438,
16,
498,
273,
365,
6315,
588,
67,
3567,
12,
856,
13,
309,
486,
1438,
30,
32... |
if self.debug > 1: print 'Updating the atoms in kwargs' print atoms.get_positions() | def __init__(self, nc='out.nc', outnc=None, debug=0, stay_alive=False, **kwargs): ''' Initialize the Jacapo calculator | e111e7f7da49e775bf6f578ffb8369e435e7a68c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/e111e7f7da49e775bf6f578ffb8369e435e7a68c/jacapo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8194,
2218,
659,
18,
14202,
2187,
596,
14202,
33,
7036,
16,
1198,
33,
20,
16,
23449,
67,
11462,
33,
8381,
16,
2826,
4333,
4672,
9163,
9190,
326,
804,
107... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
8194,
2218,
659,
18,
14202,
2187,
596,
14202,
33,
7036,
16,
1198,
33,
20,
16,
23449,
67,
11462,
33,
8381,
16,
2826,
4333,
4672,
9163,
9190,
326,
804,
107... | |
return Dec_p1 | return _Dec_p1 | def compare_total(self, other): """Compares self to other using the abstract representations. | ebab68ad25421add045049bc0a87fbe7000ec3f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/ebab68ad25421add045049bc0a87fbe7000ec3f7/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
4963,
12,
2890,
16,
1308,
4672,
3536,
19199,
365,
358,
1308,
1450,
326,
8770,
27851,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3400,
67,
4963,
12,
2890,
16,
1308,
4672,
3536,
19199,
365,
358,
1308,
1450,
326,
8770,
27851,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
for dirPath,dn in directory.items(): res = self.__getDNUserID(dn) | for dirPath, dn in directory.items(): res = self.__getDNUserID( dn ) | def changeDirectoryOwner(self,directory): """ Change the ownership of the directory to the user associated to the supplied DN """ res = self.__checkArgumentFormat(directory) if not res['OK']: return res directory = res['Value'] successful = {} failed = {} created = self.__openSession() for dirPath,dn in directory.items(): res = self.__getDNUserID(dn) if not res['OK']: failed[dirPath] = res['Message'] else: userID = res['Value'] res = self.__changeOwner(dirPath,userID) if not res['OK']: failed[dirPath] = res['Message'] else: successful[dirPath] = True if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
2853,
5541,
12,
2890,
16,
5149,
4672,
3536,
7576,
326,
23178,
434,
326,
1867,
358,
326,
729,
3627,
358,
326,
4580,
18001,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
5149,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
2853,
5541,
12,
2890,
16,
5149,
4672,
3536,
7576,
326,
23178,
434,
326,
1867,
358,
326,
729,
3627,
358,
326,
4580,
18001,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
5149,
13... |
print self.resort | def restart_load(self): """Method which is called upon restart.""" # Try to read sorting file if os.path.isfile('ase-sort.dat'): self.sort = [] self.resort = [] file = open('ase-sort.dat', 'r') lines = file.readlines() file.close() for line in lines: data = line.split() self.sort.append(int(data[0])) self.resort.append(int(data[1])) atoms = ase.io.read('CONTCAR', format='vasp')[self.resort] else: atoms = ase.io.read('CONTCAR', format='vasp') self.sort = range(len(atoms)) self.resort = range(len(atoms)) print self.resort self.atoms = atoms.copy() self.read_incar() self.set_results(atoms) self.read_outcar() self.read_kpoints() self.read_potcar() | 828db324feb8644addb9df66b0668465900f7ba9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5735/828db324feb8644addb9df66b0668465900f7ba9/vasp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7870,
67,
945,
12,
2890,
4672,
3536,
1305,
1492,
353,
2566,
12318,
7870,
12123,
225,
468,
6161,
358,
855,
9602,
585,
309,
1140,
18,
803,
18,
291,
768,
2668,
448,
17,
3804,
18,
3404,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7870,
67,
945,
12,
2890,
4672,
3536,
1305,
1492,
353,
2566,
12318,
7870,
12123,
225,
468,
6161,
358,
855,
9602,
585,
309,
1140,
18,
803,
18,
291,
768,
2668,
448,
17,
3804,
18,
3404,
11... | |
self.assertTrue(False) | def test_update_delete_schedule(self): ''' Tests multiple updates to a repo's sync schedule and the case where multiple updates are created with no schedules. ''' | a1ecd043f684eca8fe20c51aa4f370c9bdc978f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10692/a1ecd043f684eca8fe20c51aa4f370c9bdc978f9/test_repo_sync_schedule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2725,
67,
3733,
67,
10676,
12,
2890,
4672,
9163,
7766,
87,
3229,
4533,
358,
279,
3538,
1807,
3792,
4788,
471,
326,
648,
1625,
3229,
4533,
854,
2522,
598,
1158,
26720,
18,
9163,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2725,
67,
3733,
67,
10676,
12,
2890,
4672,
9163,
7766,
87,
3229,
4533,
358,
279,
3538,
1807,
3792,
4788,
471,
326,
648,
1625,
3229,
4533,
854,
2522,
598,
1158,
26720,
18,
9163,... | |
return S_OK(attributeValues) def __updateTransformationParameter(self,transID,paramName,paramValue,connection=False): if not (paramName in self.mutable): return S_ERROR("Can not update the '%s' transformation parameter" % paramName) req = "UPDATE Transformations SET %s='%s', LastUpdate=UTC_TIMESTAMP() WHERE TransformationID=%d" % (paramName,paramValue,transID) return self._update(req,connection) def _getTransformationID(self,transName,connection=False): | return S_OK( attributeValues ) def __updateTransformationParameter( self, transID, paramName, paramValue, connection = False ): if not ( paramName in self.mutable ): return S_ERROR( "Can not update the '%s' transformation parameter" % paramName ) req = "UPDATE Transformations SET %s='%s', LastUpdate=UTC_TIMESTAMP() WHERE TransformationID=%d" % ( paramName, paramValue, transID ) return self._update( req, connection ) def _getTransformationID( self, transName, connection = False ): | def __getTableDistinctAttributeValues(self,table,possible,attributes,selectDict,older,newer,timeStamp,connection=False): connection = self.__getConnection(connection) attributeValues = {} for attribute in attributes: if possible and (not attribute in possible): return S_ERROR('Requested attribute (%s) does not exist in table %s' % (attribute,table)) res = self.getDistinctAttributeValues(table,attribute,condDict=selectDict,older=older,newer=newer,timeStamp=timeStamp,connection=connection) if not res['OK']: return S_ERROR('Failed to serve values for attribute %s in table %s' % (attribute,table)) attributeValues[attribute] = res['Value'] return S_OK(attributeValues) | 9ad007ea503b29694fc081c1646b7c5ecd07b1f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9ad007ea503b29694fc081c1646b7c5ecd07b1f2/TransformationDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1388,
23402,
31770,
12,
2890,
16,
2121,
16,
12708,
16,
4350,
16,
4025,
5014,
16,
1498,
16,
2704,
264,
16,
957,
8860,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
16186,
588,
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,
1001,
588,
1388,
23402,
31770,
12,
2890,
16,
2121,
16,
12708,
16,
4350,
16,
4025,
5014,
16,
1498,
16,
2704,
264,
16,
957,
8860,
16,
4071,
33,
8381,
4672,
1459,
273,
365,
16186,
588,
19... |
response2 = mainClass.checkImageDuplicated(imageName) | response2 = mainClass.checkImageDuplicated() | def checkbot(): """ Main function """ # Command line configurable parameters repeat = True # Restart after having check all the images? limit = 80 # How many images check? time_sleep = 30 # How many time sleep after the check? skip_number = 0 # How many images to skip before checking? wait_number = 0 # How many time sleep before the check? commonsActive = False # Check if on commons there's an image with the same name? normal = False # Check the new images or use another generator? urlUsed = False # Use the url-related function instead of the new-pages generator regexGen = False # Use the regex generator untagged = False # Use the untagged generator skip_list = list() # Inizialize the skip list used below duplicatesActive = False # Use the duplicate option duplicatesReport = False # Use the duplicate-report option sendemailActive = False # Use the send-email option # Here below there are the parameters. for arg in wikipedia.handleArgs(): if arg.startswith('-limit'): if len(arg) == 7: limit = int(wikipedia.input(u'How many images do you want to check?')) else: limit = int(arg[7:]) if arg.startswith('-time'): if len(arg) == 5: time_sleep = int(wikipedia.input(u'How many seconds do you want runs to be apart?')) else: time_sleep = int(arg[6:]) elif arg == '-break': repeat = False elif arg == '-commons': commonsActive = True elif arg == '-duplicates': duplicatesActive = True elif arg == '-duplicatereport': duplicatesReport = True elif arg == '-sendemail': sendemailActive = True elif arg.startswith('-skip'): if len(arg) == 5: skip = True skip_number = int(wikipedia.input(u'How many images do you want to skip?')) elif len(arg) > 5: skip = True skip_number = int(arg[6:]) elif arg.startswith('-wait'): if len(arg) == 5: wait = True wait_number = int(wikipedia.input(u'How many time do you want to wait before checking the images?')) elif len(arg) > 5: wait = True wait_number = int(arg[6:]) elif arg.startswith('-start'): if len(arg) == 6: firstPageTitle = str(wikipedia.input(u'From witch page do you want to start?')) elif len(arg) > 6: firstPageTitle = str(arg[7:]) generator = wikipedia.getSite().allpages(start='Image:%s' % firstPageTitle) repeat = False elif arg.startswith('-page'): if len(arg) == 5: regexPageName = str(wikipedia.input(u'Which page do you want to use for the regex?')) elif len(arg) > 5: regexPageName = str(arg[6:]) repeat = False regexGen = True elif arg.startswith('-url'): if len(arg) == 4: regexPageUrl = str(wikipedia.input(u'Which url do you want to use for the regex?')) elif len(arg) > 4: regexPageUrl = str(arg[5:]) urlUsed = True repeat = False regexGen = True elif arg.startswith('-regex'): if len(arg) == 6: regexpToUse = str(wikipedia.input(u'Which regex do you want to use?')) elif len(arg) > 6: regexpToUse = str(arg[7:]) generator = 'regex' repeat = False elif arg.startswith('-cat'): if len(arg) == 4: catName = str(wikipedia.input(u'In which category do I work?')) elif len(arg) > 4: catName = str(arg[5:]) catSelected = catlib.Category(wikipedia.getSite(), 'Category:%s' % catName) generator = pagegenerators.CategorizedPageGenerator(catSelected) repeat = False elif arg.startswith('-ref'): if len(arg) == 4: refName = str(wikipedia.input(u'The references of what page should I parse?')) elif len(arg) > 4: refName = str(arg[5:]) generator = pagegenerators.ReferringPageGenerator(wikipedia.Page(wikipedia.getSite(), refName)) repeat = False elif arg.startswith('-untagged'): untagged = True if len(arg) == 9: projectUntagged = str(wikipedia.input(u'In which project should I work?')) elif len(arg) > 9: projectUntagged = str(arg[10:]) # Understand if the generator it's the default or not. try: generator except NameError: normal = True # Define the site. site = wikipedia.getSite() # Block of text to translate the parameters set above. image_n = site.image_namespace() image_namespace = "%s:" % image_n # Example: "User_talk:" unvertext = wikipedia.translate(site, n_txt) di = wikipedia.translate(site, delete_immediately) dih = wikipedia.translate(site, delete_immediately_head) din = wikipedia.translate(site, delete_immediately_notification) nh = wikipedia.translate(site, nothing_head) nn = wikipedia.translate(site, nothing_notification) dels = wikipedia.translate(site, del_comm) smwl = wikipedia.translate(site, second_message_without_license) TextFind = wikipedia.translate(site, txt_find) hiddentemplate = wikipedia.translate(site, HiddenTemplate) # If there's an hidden template, change the used HiddenTN = wikipedia.translate(site, HiddenTemplateNotification) # A template as {{en is not a license! Adding also them in the whitelist template... for langK in wikipedia.Family('wikipedia').langs.keys(): hiddentemplate.append('%s' % langK) # If the images to skip are 0, set the skip variable to False (the same for the wait time) if skip_number == 0: skip = False if wait_number == 0: wait = False # nothing = Defining an empty image description nothing = ['', ' ', ' ', ' ', '\n', '\n ', '\n ', '\n\n', '\n \n', ' \n', ' \n ', ' \n \n'] # something = Minimal requirements for an image description. # If this fits, no tagging will take place (if there aren't other issues) # MIT license is ok on italian wikipedia, let also this here something = ['{{', "'''MIT license'''"] # Don't put "}}" here, please. Useless and can give problems. # Unused file extensions. Does not contain PDF. notallowed = ("xcf", "xls", "sxw", "sxi", "sxc", "sxd") # A little block-statement to ensure that the bot will not start with en-parameters if site.lang not in project_inserted: wikipedia.output(u"Your project is not supported by this script. You have to edit the script and add it!") wikipedia.stopme() # Some formatting for delete immediately template di = '\n%s' % di dels = dels % di # Reading the log of the new images if another generator is not given. if normal == True: if limit == 1: wikipedia.output(u"Retrieving the latest file for checking...") else: wikipedia.output(u"Retrieving the latest %d files for checking..." % limit) # Main Loop while 1: # Defing the Main Class. mainClass = main(site, sendemailActive = sendemailActive, duplicatesReport = duplicatesReport) # Untagged is True? Let's take that generator if untagged == True: generator = mainClass.untaggedGenerator(projectUntagged, limit) normal = False # Ensure that normal is False # Normal True? Take the default generator if normal == True: generator = pagegenerators.NewimagesPageGenerator(number = limit, site = site) # if urlUsed and regexGen, get the source for the generator if urlUsed == True and regexGen == True: textRegex = site.getUrl(regexPageUrl, no_hostname = True) # Not an url but a wiki page as "source" for the regex elif regexGen == True: pageRegex = wikipedia.Page(site, regexPageName) try: textRegex = pageRegex.get() except wikipedia.NoPage: wikipedia.output(u"%s doesn't exist!" % page.title()) textRegex = '' # No source, so the bot will quit later. # If generator is the regex' one, use your own Generator using an url or page and a regex. if generator == 'regex' and regexGen == True: generator = mainClass.regexGenerator(regexpToUse, textRegex) # Ok, We (should) have a generator, so let's go on. try: # Take the additional settings for the Project tupla_written = mainClass.takesettings() except wikipedia.Error: # Error? Settings = None wikipedia.output(u'Problems with loading the settigs, run without them.') tupla_written = None some_problem = False # Ensure that if the list given is empty it will be converted to "None" # (but it should be already done in the takesettings() function) if tupla_written == []: tupla_written = None # Real-Time page loaded if tupla_written != None: wikipedia.output(u'\t >> Loaded the real-time page... <<') # No settings found, No problem, continue. else: wikipedia.output(u'\t >> No additional settings found! <<') # Not the main, but the most important loop. #parsed = False for image in generator: # When you've a lot of image to skip before working use this workaround, otherwise # let this commented, thanks. [ decoment also parsed = False if you want to use it # #if image.title() != u'Immagine:Nytlogo379x64.gif' and not parsed: # wikipedia.output(u"%s already parsed." % image.title()) # continue #else: # parsed = True # If I don't inizialize the generator, wait part and skip part are useless if wait: printWithTimeZone(u'Waiting %s seconds before checking the images,' % wait_number) # Let's sleep... time.sleep(wait_number) # Never sleep again (we are in a loop) wait = False # If the generator returns something that is not an image, simply skip it. if normal == False and regexGen == False: if image_namespace.lower() not in image.title().lower() and \ 'image:' not in image.title().lower(): wikipedia.output(u'%s seems not an image, skip it...' % image.title()) continue try: imageName = image.title().split(image_namespace)[1] # Deleting the namespace (useless here) except IndexError:# Namespace image not found, that's not an image! Let's skip... wikipedia.output(u"%s is not an image, skipping..." % image.title()) continue # Skip block if skip == True: # If the images to skip are more the images to check, make them the same number if skip_number > limit: skip_number = limit # Print a starting message only if no images has been skipped if skip_list == []: if skip_number == 1: wikipedia.output(u'Skipping the first image:\n') else: wikipedia.output(u'Skipping the first %s images:\n' % skip_number) # If we still have pages to skip: if len(skip_list) < skip_number: wikipedia.output(u'Skipping %s...' % imageName) skip_list.append(imageName) if skip_number == 1: wikipedia.output('') skip = False continue else: wikipedia.output('') # Print a blank line. skip = False elif skip_list == []: # Skip must be false if we are here but # the user has set 0 as images to skip wikipedia.output(u'\t\t>> No images to skip...<<') skip_list.append('skip = Off') # Only to print it once parentesi = False # parentesi are these in italian: { ( ) } [] delete = False tagged = False extension = imageName.split('.')[-1] # get the extension from the image's name # Page => ImagePage p = wikipedia.ImagePage(site, image.title()) # Get the text in the image (called g) try: g = p.get() except wikipedia.NoPage: wikipedia.output(u"Skipping %s because it has been deleted." % imageName) continue except wikipedia.IsRedirectPage: wikipedia.output(u"The file description for %s is a redirect?!" % imageName ) continue # Check on commons if there's already an image with the same name if commonsActive == True: response = mainClass.checkImageOnCommons(imageName) if response == False: continue # Check if there are duplicates of the image on the project selected if duplicatesActive == True: response2 = mainClass.checkImageDuplicated(imageName) if response2 == False: continue # Is the image already tagged? If yes, no need to double-check, skip for i in TextFind: # If there are {{ use regex, otherwise no (if there's not the {{ may not be a template # and the regex will be wrong) if '{{' in i: regexP = re.compile('\{\{(?:template|)%s ?(?:\||\n|\}) ?' % i.split('{{')[1].replace(' ', '[ _]'), re.I) result = regexP.findall(g) if result != []: tagged = True elif i.lower() in g: tagged = True # Deleting the useless template from the description (before adding something # in the image the original text will be reloaded, don't worry). hiddenTemplateFound = False white_template_found = 0 for l in hiddentemplate: if tagged == False: res = re.findall(r'\{\{(?:[Tt]emplate:|)%s(?: \n|\||\n|\})' % l.lower(), g.lower()) if res != []: white_template_found += 1 if l != '' and l != ' ': # Check that l is not nothing or a space # Deleting! (replace the template with nothing) g = re.sub(r'\{\{(?:template:|)%s' % l.lower(), r'', g.lower()) hiddenTemplateFound = True if white_template_found == 1: wikipedia.output(u'A white template found, skipping the template...') elif white_template_found == 0: pass # if nothing found, print nothing else: wikipedia.output(u'White templates found: %s; skipping those templates...' % white_template_found) for a_word in something: # something is the array with {{, MIT License and so on. if a_word in g: # There's a template, probably a license (or I hope so) parentesi = True # Is the extension allowed? (is it an image or f.e. a .xls file?) for parl in notallowed: if parl.lower() in extension.lower(): delete = True some_problem = False # If it has "some_problem" it must check # the additional settings. # if tupla_writte, use addictional settings if tupla_written != None: # In every tupla there's a setting configuration for tupla in tupla_written: name = tupla[1] find_tipe = tupla[2] find = tupla[3] find_list = mainClass.load(find) imagechanges = tupla[4] if imagechanges.lower() == 'false': imagestatus = False elif imagechanges.lower() == 'true': imagestatus = True else: wikipedia.output(u"Error! Imagechanges set wrongly!") tupla_written = None break summary = tupla[5] head_2 = tupla[6] text = tupla[7] text = text % imageName mexCatched = tupla[8] wikipedia.setAction(summary) for k in find_list: if find_tipe.lower() == 'findonly': if k.lower() == g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched break elif find_tipe.lower() == 'find': if k.lower() in g.lower(): some_problem = True text_used = text head_used = head_2 imagestatus_used = imagestatus name_used = name summary_used = summary mex_used = mexCatched continue # If the image exists (maybe it has been deleting during the oder # checking parts or something, who knows? ;-)) if p.exists(): # Here begins the check block. if tagged == True: # Tagged? Yes, skip. printWithTimeZone(u'%s is already tagged...' % imageName) continue if some_problem == True: if mex_used in g: wikipedia.output(u'Image already fixed. Skip.') continue wikipedia.output(u"The image description for %s contains %s..." % (imageName, name_used)) if mex_used.lower() == 'default': mex_used = unvertext if imagestatus_used == False: reported = mainClass.report_image(imageName) else: reported = True if reported == True: #if imagestatus_used == True: mainClass.report(mex_used, imageName, text_used, "\n%s\n" % head_used, None, imagestatus_used, summary_used) else: wikipedia.output(u"Skipping the image...") some_problem = False continue elif parentesi == True: printWithTimeZone(u"%s seems ok," % imageName) # It works also without this... but i want only to be sure ^^ parentesi = False continue elif delete == True: wikipedia.output(u"%s is not a file!" % imageName) # Modify summary text wikipedia.setAction(dels) canctext = di % extension notification = din % imageName head = dih mainClass.report(canctext, imageName, notification, head) delete = False continue elif g in nothing: wikipedia.output(u"The image description for %s does not contain a license template!" % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue else: wikipedia.output(u"%s has only text and not the specific license..." % imageName) if hiddenTemplateFound and HiddenTN != None and HiddenTN != '' and HiddenTN != ' ': notification = HiddenTN % imageName else: notification = nn % imageName head = nh mainClass.report(unvertext, imageName, notification, head, smwl) continue # A little block to perform the repeat or to break. if repeat == True: printWithTimeZone(u"Waiting for %s seconds," % time_sleep) time.sleep(time_sleep) elif repeat == False: wikipedia.output(u"\t\t\t>> STOP! <<") return True # Exit | 35a9f9395ca206d18b529e378fe7a0b110b9f1c4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/35a9f9395ca206d18b529e378fe7a0b110b9f1c4/checkimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4819,
13332,
3536,
12740,
445,
3536,
468,
3498,
980,
14593,
1472,
7666,
273,
1053,
468,
20709,
1839,
7999,
866,
777,
326,
4602,
35,
1800,
273,
8958,
468,
9017,
4906,
4602,
866,
35,
... |
break return selection, active_id, inactive_id | return selection, active_id, inactive_id return [], self.multi_iw.id, self.class_iw.id | def get_all_selected(self): for display in (self.multi_iw.id, self.class_iw.id): if display.IsSelection(): selection = display.GetSelectedItems(display.GetGridCursorRow(), display.GetGridCursorCol()) active_id = display inactive_id = self.get_other_multi(display) break return selection, active_id, inactive_id | 8ef4cdf90c3b4cc82ad23f32e8c344c272dc3b00 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9927/8ef4cdf90c3b4cc82ad23f32e8c344c272dc3b00/classifier_display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
454,
67,
8109,
12,
2890,
4672,
364,
2562,
316,
261,
2890,
18,
7027,
67,
22315,
18,
350,
16,
365,
18,
1106,
67,
22315,
18,
350,
4672,
309,
2562,
18,
2520,
6233,
13332,
4421,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
454,
67,
8109,
12,
2890,
4672,
364,
2562,
316,
261,
2890,
18,
7027,
67,
22315,
18,
350,
16,
365,
18,
1106,
67,
22315,
18,
350,
4672,
309,
2562,
18,
2520,
6233,
13332,
4421,
... |
try: vResult = _POs[0].verify(fast=self.setup.get('quick', False)) except TypeError: vResult = _POs[0].verify() | vResult = self._verifyHelper(_POs[0]) | def VerifyPackage(self, entry, modlist, pinned_version=None): """ Verify Package status for entry. Performs the following: - Checks for the presence of required Package Instances. - Compares the evra 'version' info against self.installed{}. - RPM level package verify (rpm --verify). - Checks for the presence of unrequired package instances. | fa828a85c54e0e883cfac6ad19227776c95ecb68 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11867/fa828a85c54e0e883cfac6ad19227776c95ecb68/YUMng.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8553,
2261,
12,
2890,
16,
1241,
16,
681,
1098,
16,
26193,
67,
1589,
33,
7036,
4672,
3536,
8553,
7508,
1267,
364,
1241,
18,
27391,
326,
3751,
30,
300,
13074,
364,
326,
9805,
434,
1931,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8553,
2261,
12,
2890,
16,
1241,
16,
681,
1098,
16,
26193,
67,
1589,
33,
7036,
4672,
3536,
8553,
7508,
1267,
364,
1241,
18,
27391,
326,
3751,
30,
300,
13074,
364,
326,
9805,
434,
1931,
... |
obj = numpy.asarray(obj) | if dtype is None: obj = numpy.asarray(obj) else: obj = numpy.asarray(obj, dtype) | def _conv(obj): """ Convert an object to the preferred form for input to the odr routine. """ if obj is None: return obj else: obj = numpy.asarray(obj) if obj.shape == (): # Scalar. return obj.dtype.type(obj) else: return obj | cd6d82b7329eed7a642d19bad5f088731a21c06e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/cd6d82b7329eed7a642d19bad5f088731a21c06e/odrpack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4896,
12,
2603,
4672,
3536,
4037,
392,
733,
358,
326,
9119,
646,
364,
810,
358,
326,
320,
3069,
12245,
18,
3536,
225,
309,
1081,
353,
599,
30,
327,
1081,
469,
30,
309,
3182,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4896,
12,
2603,
4672,
3536,
4037,
392,
733,
358,
326,
9119,
646,
364,
810,
358,
326,
320,
3069,
12245,
18,
3536,
225,
309,
1081,
353,
599,
30,
327,
1081,
469,
30,
309,
3182,
353,
... |
self.langbox.set_markup(self.fromLang() + ' | ' + self.toLang() + ': ') | self.langbox.set_markup(self.from_lang() + ' | ' + self.to_lang() + ': ') | def enter_callback(self, widget, data = None): '''Submit entrybox text for translation.''' buf = self.resultbuffer1 if self.entry.get_text() in ('.clear', 'clear()'): buf.set_text('') self.entry.set_text('') return result = self.text(self.entry.get_text()) if result is None: return | 14df03d8cb360b4e980acabb44bd6dbe0fd79acd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9947/14df03d8cb360b4e980acabb44bd6dbe0fd79acd/traduisons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6103,
67,
3394,
12,
2890,
16,
3604,
16,
501,
273,
599,
4672,
9163,
11620,
1241,
2147,
977,
364,
4794,
1093,
6309,
1681,
273,
365,
18,
2088,
4106,
21,
309,
365,
18,
4099,
18,
588,
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,
6103,
67,
3394,
12,
2890,
16,
3604,
16,
501,
273,
599,
4672,
9163,
11620,
1241,
2147,
977,
364,
4794,
1093,
6309,
1681,
273,
365,
18,
2088,
4106,
21,
309,
365,
18,
4099,
18,
588,
67,
... |
comp_args((1, 2)) | def test_float_literals(self): self.assertRaises(SyntaxError, eval, "2e") self.assertRaises(SyntaxError, eval, "2.0e+") self.assertRaises(SyntaxError, eval, "1e-") self.assertRaises(SyntaxError, eval, "3-4e/21") | def comp_args((a, b)): print a,b | 5374db00e0b331040acf11a1ed8ac595f665f4db /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/5374db00e0b331040acf11a1ed8ac595f665f4db/test_compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1161,
67,
1968,
12443,
69,
16,
324,
3719,
30,
1172,
279,
16,
70,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1161,
67,
1968,
12443,
69,
16,
324,
3719,
30,
1172,
279,
16,
70,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return super(account_analytic_account, self).create(cr, uid, vals, ctx) | return super(account_analytic_account, self).create(cr, uid, vals, context=context) | def create(self, cr, uid, vals, ctx={}): parent_id = vals.get('parent_id', 0) if ('code' not in vals or not vals['code']) and not parent_id: vals['code'] = self.pool.get('ir.sequence').get(cr, uid, 'account.analytic.account') return super(account_analytic_account, self).create(cr, uid, vals, ctx) | d442092a8d2ddeaf5ca2612107b826bb6abbe948 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/d442092a8d2ddeaf5ca2612107b826bb6abbe948/project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
1103,
12938,
4672,
982,
67,
350,
273,
5773,
18,
588,
2668,
2938,
67,
350,
2187,
374,
13,
309,
7707,
710,
11,
486,
316,
5773,
578,
486... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
4422,
16,
4555,
16,
5773,
16,
1103,
12938,
4672,
982,
67,
350,
273,
5773,
18,
588,
2668,
2938,
67,
350,
2187,
374,
13,
309,
7707,
710,
11,
486,
316,
5773,
578,
486... |
value.replace(',','.') | value = value.replace(',','.') | def _to_tuple(self, instance, value): """ COMMENT TO-DO """ if not value: value = self.getDefault(instance) | d8cc8c726c8d62f94777dcc6b672905dbe8548e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/d8cc8c726c8d62f94777dcc6b672905dbe8548e9/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
67,
8052,
12,
2890,
16,
791,
16,
460,
4672,
3536,
19400,
8493,
17,
3191,
3536,
309,
486,
460,
30,
460,
273,
365,
18,
588,
1868,
12,
1336,
13,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
67,
8052,
12,
2890,
16,
791,
16,
460,
4672,
3536,
19400,
8493,
17,
3191,
3536,
309,
486,
460,
30,
460,
273,
365,
18,
588,
1868,
12,
1336,
13,
2,
-100,
-100,
-100,
-100,
-10... |
self.dicts[i]['distEpi']) | self.dicts[i]['distHypo']) | def calculateStationMagnitudes(self): for i in range(len(self.streams)): if (self.dicts[i].has_key('MagMin1') and self.dicts[i].has_key('MagMin2') and self.dicts[i].has_key('MagMax1') and self.dicts[i].has_key('MagMax2')): amp = self.dicts[i]['MagMax1'] - self.dicts[i]['MagMin1'] timedelta = abs(self.dicts[i]['MagMax1T'] - self.dicts[i]['MagMin1T']) timedelta /= self.streams[i][1].stats.sampling_rate #print self.dicts[i]['pazN'] mag = estimateMagnitude(self.dicts[i]['pazN'], amp, timedelta, self.dicts[i]['distEpi']) amp = self.dicts[i]['MagMax2'] - self.dicts[i]['MagMin2'] timedelta = abs(self.dicts[i]['MagMax2T'] - self.dicts[i]['MagMin2T']) timedelta /= self.streams[i][2].stats.sampling_rate mag += estimateMagnitude(self.dicts[i]['pazE'], amp, timedelta, self.dicts[i]['distEpi']) mag /= 2. self.dicts[i]['Mag'] = mag self.dicts[i]['MagChannel'] = '%s,%s' % (self.streams[i][1].stats.channel, self.streams[i][2].stats.channel) print 'calculated new magnitude for %s: %0.2f (channels: %s)' \ % (self.dicts[i]['Station'], self.dicts[i]['Mag'], self.dicts[i]['MagChannel']) elif (self.dicts[i].has_key('MagMin1') and self.dicts[i].has_key('MagMax1')): amp = self.dicts[i]['MagMax1'] - self.dicts[i]['MagMin1'] timedelta = abs(self.dicts[i]['MagMax1T'] - self.dicts[i]['MagMin1T']) timedelta /= self.streams[i][1].stats.sampling_rate #print self.dicts[i]['pazN'] mag = estimateMagnitude(self.dicts[i]['pazN'], amp, timedelta, self.dicts[i]['distEpi']) self.dicts[i]['Mag'] = mag self.dicts[i]['MagChannel'] = '%s' % self.streams[i][1].stats.channel print 'calculated new magnitude for %s: %0.2f (channels: %s)' \ % (self.dicts[i]['Station'], self.dicts[i]['Mag'], self.dicts[i]['MagChannel']) elif (self.dicts[i].has_key('MagMin2') and self.dicts[i].has_key('MagMax2')): amp = self.dicts[i]['MagMax2'] - self.dicts[i]['MagMin2'] timedelta = abs(self.dicts[i]['MagMax2T'] - self.dicts[i]['MagMin2T']) timedelta /= self.streams[i][2].stats.sampling_rate #print self.dicts[i]['pazN'] mag = estimateMagnitude(self.dicts[i]['pazE'], amp, timedelta, self.dicts[i]['distEpi']) self.dicts[i]['Mag'] = mag self.dicts[i]['MagChannel'] = '%s' % self.streams[i][2].stats.channel print 'calculated new magnitude for %s: %0.2f (channels: %s)' \ % (self.dicts[i]['Station'], self.dicts[i]['Mag'], self.dicts[i]['MagChannel']) | 5249c4b61e16ab546a165c5d1b478a55c116e1cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/5249c4b61e16ab546a165c5d1b478a55c116e1cc/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
16672,
11372,
82,
24751,
12,
2890,
4672,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
16320,
3719,
30,
309,
261,
2890,
18,
16287,
63,
77,
8009,
5332,
67,
856,
2668,
11372,
2930,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
16672,
11372,
82,
24751,
12,
2890,
4672,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
16320,
3719,
30,
309,
261,
2890,
18,
16287,
63,
77,
8009,
5332,
67,
856,
2668,
11372,
2930,
... |
def docclass(self, object, funcs={}, classes={}): | def docclass(self, object, name=None, funcs={}, classes={}): | def docclass(self, object, funcs={}, classes={}): """Produce HTML documentation for a class object.""" name = object.__name__ bases = object.__bases__ contents = '' | 37f7b38eb6247564c00c8a355ab12268e8486c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/37f7b38eb6247564c00c8a355ab12268e8486c4e/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
12938,
4672,
3536,
25884,
3982,
7323,
364,
279,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
1106,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
12938,
4672,
3536,
25884,
3982,
7323,
364,
279,
667,
733,
12123,
508,
273,
733,
16186,
529,
972,
8337,
273,
733,
... |
def ChangeServiceConfig(pythonClassString, serviceName, startType = None, errorControl = None, serviceDeps = None, userName = None, password = None, exeName = None, displayName = None, perfMonIni = None, perfMonDll = None): | def ChangeServiceConfig(pythonClassString, serviceName, startType = None, errorControl = None, bRunInteractive = 0, serviceDeps = None, userName = None, password = None, exeName = None, displayName = None, perfMonIni = None, perfMonDll = None): | def ChangeServiceConfig(pythonClassString, serviceName, startType = None, errorControl = None, serviceDeps = None, userName = None, password = None, exeName = None, displayName = None, perfMonIni = None, perfMonDll = None): # Before doing anything, remove any perfmon counters. try: import perfmon perfmon.UnloadPerfCounterTextStrings("python.exe "+serviceName) except (ImportError, win32api.error): pass # The EXE location may have changed exeName = '"%s"' % LocatePythonServiceExe(exeName) # Handle the default arguments. if startType is None: startType = win32service.SERVICE_NO_CHANGE if errorControl is None: errorControl = win32service.SERVICE_NO_CHANGE hscm = win32service.OpenSCManager(None,None,win32service.SC_MANAGER_ALL_ACCESS) try: hs = SmartOpenService(hscm, serviceName, win32service.SERVICE_ALL_ACCESS) try: win32service.ChangeServiceConfig(hs, win32service.SERVICE_NO_CHANGE, # service type startType, errorControl, # error control type exeName, None, 0, serviceDeps, userName, password, displayName) finally: win32service.CloseServiceHandle(hs) finally: win32service.CloseServiceHandle(hscm) InstallPythonClassString(pythonClassString, serviceName) # If I have performance monitor info to install, do that. if perfMonIni is not None: InstallPerfmonForService(serviceName, perfMonIni, perfMonDll) | ace6349f680363035807225fbc1f73bbf99875e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/ace6349f680363035807225fbc1f73bbf99875e9/win32serviceutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7576,
1179,
809,
12,
8103,
797,
780,
16,
6773,
16,
787,
559,
273,
599,
16,
555,
3367,
273,
599,
16,
324,
1997,
26442,
273,
374,
16,
1156,
14430,
273,
599,
16,
12065,
273,
599,
16,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7576,
1179,
809,
12,
8103,
797,
780,
16,
6773,
16,
787,
559,
273,
599,
16,
555,
3367,
273,
599,
16,
324,
1997,
26442,
273,
374,
16,
1156,
14430,
273,
599,
16,
12065,
273,
599,
16,
22... |
try: msg = str(self.msg) except UnicodeError: msg = self.msg | msg = self.msg if type(msg) not in (types.UnicodeType, types.StringType): try: msg = str(self.msg) except UnicodeError: msg = self.msg | def getMessage(self): """ Return the message for this LogRecord. | 3de856f2685877a497ef4ba67da740c033c316c2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3de856f2685877a497ef4ba67da740c033c316c2/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2381,
12,
2890,
4672,
3536,
2000,
326,
883,
364,
333,
25612,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
2381,
12,
2890,
4672,
3536,
2000,
326,
883,
364,
333,
25612,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Type = args[0]; | Type = args[0] | def main(): Comm = Epetra.PyComm(); args = sys.argv[1:] if len(args) == 0: Type = "Amesos_Lapack" else: Type = args[0]; NumGlobalRows = 10; Map = Epetra.Map(NumGlobalRows, 0, Comm); LHS_exact = Epetra.MultiVector(Map, 1); LHS = Epetra.MultiVector(Map, 1); RHS = Epetra.MultiVector(Map, 1); Matrix = Epetra.CrsMatrix(Epetra.Copy, Map, 0); Indices = Epetra.IntSerialDenseVector(3); Values = Epetra.SerialDenseVector(3); Values[0] = 2.0; Values[1] = -1.0; Values[2] = -1.0; NumLocalRows = Map.NumMyElements() # Builds the matrix (1D Laplacian) for ii in range(0, NumLocalRows): i = Map.GID(ii) Indices[0] = i; if i == 0: NumEntries = 2; Indices[1] = i + 1; elif i == NumGlobalRows - 1: NumEntries = 2; Indices[1] = i - 1; else: NumEntries = 3; Indices[1] = i - 1; Indices[2] = i + 1; Matrix.InsertGlobalValues(i, NumEntries, Values, Indices); ierr = Matrix.FillComplete(); LHS_exact.Random(); Matrix.Multiply(False, LHS_exact, RHS); LHS.PutScalar(1.0); Problem = Epetra.LinearProblem(Matrix, LHS, RHS); if Type == "Amesos_Lapack": Solver = Amesos.Lapack(Problem); elif Type == "Amesos_Klu": Solver = Amesos.Klu(Problem); elif Type == "Amesos_Umfpack": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Pardiso": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Taucs": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Superlu": Solver = Amesos.Superlu(Problem); elif Type == "Amesos_Superludist": Solver = Amesos.Superludist(Problem); elif Type == "Amesos_Dscpack": Solver = Amesos.Dscpack(Problem); elif Type == "Amesos_Mumps": Solver = Amesos.Mumps(Problem); else: print 'Selected solver (%s) not available' % Type PrintHelp(); sys.exit(-2); AmesosList = { "PrintStatus": True, "PrintTiming": True }; Solver.SetParameters(AmesosList); Solver.SymbolicFactorization(); Solver.NumericFactorization(); ierr = Solver.Solve(); print "Solver.Solve() return code = ", ierr del Solver | b0de99b594baede77af9aff7c1b994a5d198a226 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/b0de99b594baede77af9aff7c1b994a5d198a226/exSolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
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,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
67,... |
troveTups = [ x for x in packages if not group.hasTrove(*x)] | troveTups = [ x for x in packages if not (group.hasTrove(*x) and group.isExlicit(*x)) ] troveTups = packages.keys() | def addPackagesForComponents(group, repos, troveCache): """ Add the containing packages for any components added to group. Then switch the components to being implicit, but byDefault=True, while other non-specified components are byDefault=False. """ packages = {} for (n,v,f), explicit, byDefault, comps in group.iterTroveListInfo(): if not explicit: continue if ':' in n: pkg = n.split(':', 1)[0] packages.setdefault((pkg, v, f), {})[n] = byDefault # if the user mentions both foo and foo:runtime, don't remove # direct link to foo:runtime troveTups = [ x for x in packages if not group.hasTrove(*x)] hasTroves = repos.hasTroves(troveTups) troveTups = [ x for x in troveTups if hasTroves[x] ] if not troveTups: return troveCache.cacheTroves(troveTups) for troveTup in troveTups: addedComps = packages[troveTup] byDefault = bool([x for x in addedComps.iteritems() if x[1]]) group.addTrove(troveTup, True, byDefault, [], reason=(ADD_REASON_ADDED,)) for comp, byDefault, isStrong in troveCache.iterTroveListInfo(troveTup): if comp[0] in addedComps: byDefault = addedComps[comp[0]] # delete the strong reference to this trove, so that # the trove can be added as a weak reference group.delTrove(*comp) else: byDefault = False group.addTrove(comp, False, byDefault, [], reason=(ADD_REASON_ADDED,)) | 279dc3a0ab02018ec14798d7001576236ec7ce8c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/279dc3a0ab02018ec14798d7001576236ec7ce8c/grouprecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11425,
1290,
7171,
12,
1655,
16,
13686,
16,
23432,
537,
1649,
4672,
3536,
1436,
326,
4191,
5907,
364,
1281,
4085,
3096,
358,
1041,
18,
9697,
1620,
326,
4085,
358,
3832,
10592,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11425,
1290,
7171,
12,
1655,
16,
13686,
16,
23432,
537,
1649,
4672,
3536,
1436,
326,
4191,
5907,
364,
1281,
4085,
3096,
358,
1041,
18,
9697,
1620,
326,
4085,
358,
3832,
10592,
16,
1... |
tftp_root = os.environ.get('KVM_TEST_tftp', '') if tftp_root: self.tftp_root = os.path.join(kvm_test_dir, tftp_root) if not os.path.isdir(self.tftp_root): os.makedirs(self.tftp_root) else: self.tftp_root = tftp_root self.kernel_args = os.environ.get('KVM_TEST_kernel_args', '') self.finish_program = os.environ.get('KVM_TEST_finish_program', '') cdrom_iso = os.environ.get('KVM_TEST_cdrom_cd1') self.unattended_file = os.environ.get('KVM_TEST_unattended_file') install_virtio = os.environ.get('KVM_TEST_install_virtio', 'no') if install_virtio == 'yes': self.install_virtio = True else: self.install_virtio = False virtio_floppy = os.environ.get('KVM_TEST_virtio_floppy', '') self.virtio_floppy = None self.virtio_floppy_mount = tempfile.mkdtemp(prefix='floppy_', dir='/tmp') if self.install_virtio: if virtio_floppy and os.path.isfile(virtio_floppy): print package_that_owns(virtio_floppy) self.virtio_floppy = virtio_floppy elif virtio_floppy and not os.path.isfile(virtio_floppy): print ('Virtio floppy path %s was not found. Please verify' % virtio_floppy) vni = os.environ.get('KVM_TEST_virtio_network_installer', '') self.virtio_network_installer = None if self.install_virtio and vni: self.virtio_network_installer = vni voi = os.environ.get('KVM_TEST_virtio_oemsetup_id', '') self.virtio_oemsetup_identifier = None if self.install_virtio and voi: self.virtio_oemsetup_identifier = voi vsp = os.environ.get('KVM_TEST_virtio_storage_path', '') self.virtio_storage_path = None if self.install_virtio and vsp: self.virtio_storage_path = vsp self.qemu_img_bin = os.environ.get('KVM_TEST_qemu_img_binary') if not os.path.isabs(self.qemu_img_bin): self.qemu_img_bin = os.path.join(kvm_test_dir, self.qemu_img_bin) self.cdrom_iso = os.path.join(kvm_test_dir, cdrom_iso) | attributes = ['kernel_args', 'finish_program', 'cdrom_cd1', 'unattended_file', 'medium', 'url', 'kernel', 'initrd', 'nfs_server', 'nfs_dir', 'pxe_dir', 'pxe_image', 'pxe_initrd', 'install_virtio', 'tftp', 'qemu_img_binary', 'floppy'] for a in attributes: self._setattr(a) if self.install_virtio == 'yes': v_attributes = ['virtio_floppy', 'virtio_storage_path', 'virtio_network_path', 'virtio_oemsetup_id', 'virtio_network_installer'] for va in v_attributes: self._setattr(va) self.virtio_floppy_mount = tempfile.mkdtemp(prefix='virtio_floppy_', dir='/tmp') if self.tftp: self.tftp = os.path.join(kvm_test_dir, self.tftp) if not os.path.isdir(self.tftp): os.makedirs(self.tftp) if not os.path.isabs(self.qemu_img_binary): self.qemu_img_binary = os.path.join(kvm_test_dir, self.qemu_img_binary) self.cdrom_cd1 = os.path.join(kvm_test_dir, self.cdrom_cd1) | def __init__(self): """ Gets params from environment variables and sets class attributes. """ script_dir = os.path.dirname(sys.modules[__name__].__file__) kvm_test_dir = os.path.abspath(os.path.join(script_dir, "..")) images_dir = os.path.join(kvm_test_dir, 'images') self.deps_dir = os.path.join(kvm_test_dir, 'deps') self.unattended_dir = os.path.join(kvm_test_dir, 'unattended') | d245408f9a2fd5877bf4770afc7b97ad08147815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/d245408f9a2fd5877bf4770afc7b97ad08147815/unattended.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
11881,
859,
628,
3330,
3152,
471,
1678,
667,
1677,
18,
3536,
2728,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
9499,
18,
6400,
63,
972,
529,
972... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4672,
3536,
11881,
859,
628,
3330,
3152,
471,
1678,
667,
1677,
18,
3536,
2728,
67,
1214,
273,
1140,
18,
803,
18,
12287,
12,
9499,
18,
6400,
63,
972,
529,
972... |
def xtest_multiple_sessions(self): | def test_multiple_sessions(self): nmessages = 100 nconsumers = 3 | def xtest_multiple_sessions(self): # create a single producer session1 = self.conn.createSession() topic = self.random_topic(session1) producer = session1.createProducer(topic) | 495a97b7732a060d96e59c2e67732ce9cdc8c4da /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4509/495a97b7732a060d96e59c2e67732ce9cdc8c4da/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9622,
67,
16794,
12,
2890,
4672,
290,
6833,
273,
2130,
290,
17664,
414,
273,
890,
225,
468,
752,
279,
2202,
12608,
1339,
21,
273,
365,
18,
4646,
18,
2640,
2157,
1435,
3958,
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,
1842,
67,
9622,
67,
16794,
12,
2890,
4672,
290,
6833,
273,
2130,
290,
17664,
414,
273,
890,
225,
468,
752,
279,
2202,
12608,
1339,
21,
273,
365,
18,
4646,
18,
2640,
2157,
1435,
3958,
2... |
string with extraneous characters.""" | string with extraneous characters. >>> __TimeZoneKeyNameWorkaround("foo\\0xxx") 'foo' >>> __TimeZoneKeyNameWorkaround("foo") 'foo' """ | def __TimeZoneKeyNameWorkaround(name): """It may be a bug in Vista, but in standard Windows Vista install (both 32-bit and 64-bit), it appears the TimeZoneKeyName returns a string with extraneous characters.""" # remove anything after and including the first null character. value, garbage = name.split('\x00',1) return value | d114241701ea9b334d8a8a6948b014cfddec846c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/992/d114241701ea9b334d8a8a6948b014cfddec846c/win32timezone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
16760,
13987,
2421,
12716,
12,
529,
4672,
3536,
7193,
2026,
506,
279,
7934,
316,
776,
376,
69,
16,
1496,
316,
4529,
8202,
776,
376,
69,
3799,
261,
18237,
3847,
17,
3682,
471,
5178,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16760,
13987,
2421,
12716,
12,
529,
4672,
3536,
7193,
2026,
506,
279,
7934,
316,
776,
376,
69,
16,
1496,
316,
4529,
8202,
776,
376,
69,
3799,
261,
18237,
3847,
17,
3682,
471,
5178,... |
Set the Python locale to 'C'. This ensures that the Python env is portable across platforms and locales. | Set the Python locale to lc variable. | def setPythonLocale(): """ Set the Python locale to 'C'. This ensures that the Python env is portable across platforms and locales. """ try: locale.setlocale(locale.LC_ALL, 'C') except locale.Error: pass | d4f46d65f57606f484b564f9010dc6afc4a34fbb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/d4f46d65f57606f484b564f9010dc6afc4a34fbb/i18nmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
15774,
3916,
13332,
3536,
1000,
326,
6600,
2573,
358,
9109,
2190,
18,
3536,
775,
30,
2573,
18,
542,
6339,
12,
6339,
18,
13394,
67,
4685,
16,
296,
39,
6134,
1335,
2573,
18,
668,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
15774,
3916,
13332,
3536,
1000,
326,
6600,
2573,
358,
9109,
2190,
18,
3536,
775,
30,
2573,
18,
542,
6339,
12,
6339,
18,
13394,
67,
4685,
16,
296,
39,
6134,
1335,
2573,
18,
668,
30... |
self.god.stub_function(tempfile, 'mkdtmp') | self.god.stub_function(tempfile, 'mkdtemp') | def test_run(self): self.god.stub_function(os, 'chdir') self.god.stub_function(tempfile, 'mkdtmp') self.god.stub_function(utils, 'open_write_close') self.god.stub_function(shutil, 'copy') self.god.stub_function(shutil, 'rmtree') control_files = [] def _my_execute_code(control_file, namespace): control_files.append(control_file) self.god.stub_with(self.job, '_execute_code', _my_execute_code) | 1b768ef6bbbc140af108034d9791b1f5919caab8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/1b768ef6bbbc140af108034d9791b1f5919caab8/server_job_unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2681,
12,
2890,
4672,
365,
18,
75,
369,
18,
12847,
67,
915,
12,
538,
16,
296,
343,
1214,
6134,
365,
18,
75,
369,
18,
12847,
67,
915,
12,
5814,
768,
16,
296,
24816,
72,
58... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2681,
12,
2890,
4672,
365,
18,
75,
369,
18,
12847,
67,
915,
12,
538,
16,
296,
343,
1214,
6134,
365,
18,
75,
369,
18,
12847,
67,
915,
12,
5814,
768,
16,
296,
24816,
72,
58... |
para = paragraph_stream(stream, 'p', {}, parameters.getSampleStyleSheet()) | para = paragraph_stream(stream, 'p', {}, parameters) | def test_formatting(self): parameters = Param() data = '<p>TXT <i>TEXT<u>TEXT</u></i></p>' stream = XMLParser(data) stream.next() para = paragraph_stream(stream, 'p', {}, parameters.getSampleStyleSheet()) self.assertEqual(para.text, '<para>TXT <i>TEXT<u>TEXT</u></i></para>') | e3c78fc65729ed0a33412c3127995be39d356e50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/e3c78fc65729ed0a33412c3127995be39d356e50/test_rml2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2139,
1787,
12,
2890,
4672,
1472,
273,
3014,
1435,
501,
273,
2368,
84,
34,
29399,
411,
77,
34,
5151,
32,
89,
34,
5151,
1757,
89,
4695,
77,
4695,
84,
1870,
1407,
273,
3167,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2139,
1787,
12,
2890,
4672,
1472,
273,
3014,
1435,
501,
273,
2368,
84,
34,
29399,
411,
77,
34,
5151,
32,
89,
34,
5151,
1757,
89,
4695,
77,
4695,
84,
1870,
1407,
273,
3167,
... |
p = subprocess.Popen( (self.progs[prog], '-T'+format, tmp_name), cwd=tmp_dir, stderr=subprocess.PIPE, stdout=subprocess.PIPE, creationflags = 0x8000000) | if os.sys.platform == 'win32': p = subprocess.Popen( (self.progs[prog], '-T'+format, tmp_name), cwd=tmp_dir, stderr=subprocess.PIPE, stdout=subprocess.PIPE, creationflags = 0x8000000) else: p = subprocess.Popen( (self.progs[prog], '-T'+format, tmp_name), cwd=tmp_dir, stderr=subprocess.PIPE, stdout=subprocess.PIPE) | def create(self, prog=None, format='ps'): """Creates and returns a Postscript representation of the graph. | 2b6650a3c1e1510f1eb66ae75a9d04b131d42931 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6368/2b6650a3c1e1510f1eb66ae75a9d04b131d42931/pydot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
12,
2890,
16,
11243,
33,
7036,
16,
740,
2218,
1121,
11,
4672,
3536,
2729,
471,
1135,
279,
5616,
4263,
4335,
434,
326,
2667,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
752,
12,
2890,
16,
11243,
33,
7036,
16,
740,
2218,
1121,
11,
4672,
3536,
2729,
471,
1135,
279,
5616,
4263,
4335,
434,
326,
2667,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
fft_opt_info = get_info('fft_opt') | djbfft_info = {} mkl_info = get_info('mkl') if mkl_info: mkl_info.setdefault('define_macros', []).append(('SCIPY_MKL_H', None)) fft_opt_info = mkl_info else: fft_opt_info = get_info('fftw3') or get_info('fftw2') \ or get_info('dfftw') djbfft_info = get_info('djbfft') | def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info config = Configuration('fftpack',parent_package, top_path) fft_opt_info = get_info('fft_opt') config.add_data_dir('tests') config.add_library('dfftpack', sources=[join('dfftpack','*.f')]) sources = ['fftpack.pyf','src/zfft.c','src/drfft.c','src/zrfft.c', 'src/zfftnd.c'] config.add_extension('_fftpack', sources=sources, libraries=['dfftpack'], extra_info = fft_opt_info ) config.add_extension('convolve', sources = ['convolve.pyf','src/convolve.c'], libraries = ['dfftpack'], extra_info = fft_opt_info ) return config | e6df4f9da588ebde3b652de8d07b242580d5e77b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/e6df4f9da588ebde3b652de8d07b242580d5e77b/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1664,
12,
2938,
67,
5610,
2218,
2187,
3669,
67,
803,
33,
7036,
4672,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
4659,
628,
3972,
18,
4413,
5471,
18,
4299,
67,
1376,
1930,
33... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1664,
12,
2938,
67,
5610,
2218,
2187,
3669,
67,
803,
33,
7036,
4672,
628,
3972,
18,
4413,
5471,
18,
23667,
67,
1367,
1930,
4659,
628,
3972,
18,
4413,
5471,
18,
4299,
67,
1376,
1930,
33... |
def send_to(self, data, addr, flags=0): self._checkClosed() if self._sslobj: raise ValueError("send_to not allowed on instances of %s" % | def sendto(self, data, addr, flags=0): self._checkClosed() if self._sslobj: raise ValueError("sendto not allowed on instances of %s" % | def send_to(self, data, addr, flags=0): self._checkClosed() if self._sslobj: raise ValueError("send_to not allowed on instances of %s" % self.__class__) else: return socket.send_to(self, data, addr, flags) | d1f1a629022b16229ae04508689fbceb0bb482d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/d1f1a629022b16229ae04508689fbceb0bb482d7/ssl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
869,
12,
2890,
16,
501,
16,
3091,
16,
2943,
33,
20,
4672,
365,
6315,
1893,
7395,
1435,
309,
365,
6315,
1049,
383,
441,
30,
1002,
2068,
2932,
4661,
869,
486,
2935,
603,
3884,
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,
1366,
869,
12,
2890,
16,
501,
16,
3091,
16,
2943,
33,
20,
4672,
365,
6315,
1893,
7395,
1435,
309,
365,
6315,
1049,
383,
441,
30,
1002,
2068,
2932,
4661,
869,
486,
2935,
603,
3884,
434,... |
"-d", self.repository.basedir) cvsco = ExternalCommand(command=cmd) | "-d", subdir) cvsco = ExternalCommand(cwd=parentdir, command=cmd) | def _prepareWorkingDirectory(self, source_repo): """ Checkout a working copy of the target CVS. """ | c9b88a6ac8853c71215eea17bf83fa5148aaba91 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5981/c9b88a6ac8853c71215eea17bf83fa5148aaba91/cvsps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
14836,
2853,
12,
2890,
16,
1084,
67,
7422,
4672,
3536,
29153,
279,
5960,
1610,
434,
326,
1018,
385,
14640,
18,
3536,
2,
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,
389,
9366,
14836,
2853,
12,
2890,
16,
1084,
67,
7422,
4672,
3536,
29153,
279,
5960,
1610,
434,
326,
1018,
385,
14640,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
homob = len(self.moenergies[1]) - 1 | homob = len(moenergies[1]) - 1 | def parse(self, fupdate=0.05, cupdate=0.002): """Extract information from the logfile.""" inputfile = utils.openlogfile(self.filename) if self.progress: inputfile.seek(0, 2) #go to end of file nstep = inputfile.tell() inputfile.seek(0) self.progress.initialize(nstep) oldstep = 0 # Used to avoid extracting the final geometry twice in a GeoOpt NOTFOUND, GETLAST, NOMORE = range(3) finalgeometry = NOTFOUND # Used for calculating the scftarget (variables names taken from the ADF manual) accint = SCFconv = sconv2 = None # keep track of nosym and unrestricted case to parse Energies since it doens't have an all Irreps section nosymflag = False unrestrictedflag = False for line in inputfile: if self.progress and random.random() < cupdate: step = inputfile.tell() if step != oldstep: self.progress.update(step, "Unsupported Information") oldstep = step if line.find("INPUT FILE") >= 0: | cdea9cfefada3b48d1408c0a77370d457a0edd8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8167/cdea9cfefada3b48d1408c0a77370d457a0edd8a/adfparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
284,
2725,
33,
20,
18,
6260,
16,
276,
2725,
33,
20,
18,
24908,
4672,
3536,
4976,
1779,
628,
326,
15204,
12123,
810,
768,
273,
2990,
18,
3190,
28806,
12,
2890,
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,
1109,
12,
2890,
16,
284,
2725,
33,
20,
18,
6260,
16,
276,
2725,
33,
20,
18,
24908,
4672,
3536,
4976,
1779,
628,
326,
15204,
12123,
810,
768,
273,
2990,
18,
3190,
28806,
12,
2890,
18,
... |
save(gc,test_name()+'.bmp') def check_spline36(self): | save(gc,test_name()+'.bmp') def test_spline36(self): | def check_spline16(self): gc = self.generic_sun("spline16") save(gc,test_name()+'.bmp') | 1d96ab014629902ff0c3275273182d01de39da50 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13166/1d96ab014629902ff0c3275273182d01de39da50/image_test_case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13106,
558,
2313,
12,
2890,
4672,
8859,
273,
365,
18,
13540,
67,
16924,
2932,
13106,
558,
2313,
7923,
1923,
12,
13241,
16,
3813,
67,
529,
1435,
6797,
18,
70,
1291,
6134,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
13106,
558,
2313,
12,
2890,
4672,
8859,
273,
365,
18,
13540,
67,
16924,
2932,
13106,
558,
2313,
7923,
1923,
12,
13241,
16,
3813,
67,
529,
1435,
6797,
18,
70,
1291,
6134,
2,
-1... |
style=wxDIALOG_MODAL|wxCAPTION) | style=wxDIALOG_MODAL|wxCAPTION|wxSYSTEM_MENU) | def __init__(self, parent, title, show_resolved): wxDialog.__init__(self, parent, -1, title, style=wxDIALOG_MODAL|wxCAPTION) self.show_resolved = show_resolved | 8bfcb893526ff90ecb1436418450327bd4196777 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/8bfcb893526ff90ecb1436418450327bd4196777/wxclient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
2405,
67,
11792,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
16,
2154,
33,
27226,
2565,
18683,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
2077,
16,
2405,
67,
11792,
4672,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
982,
16,
300,
21,
16,
2077,
16,
2154,
33,
27226,
2565,
18683,
67,
... |
sys.stdout.write("%s\n" % (CFG_REFEXTRACT_XML_VERSION.encode("utf-8"),)) sys.stdout.write("%s\n" % (CFG_REFEXTRACT_XML_COLLECTION_OPEN.encode("utf-8"),)) | sys.stdout.write("%s\n" \ % CFG_REFEXTRACT_XML_VERSION.encode("utf-8")) sys.stdout.write("%s\n" \ % CFG_REFEXTRACT_XML_COLLECTION_OPEN.encode("utf-8")) | def main(): """Main function. """ global cli_opts (cli_opts, cli_args) = get_cli_options() extract_jobs = get_recids_and_filepaths(cli_args) if len(extract_jobs) == 0: ## no files provided for reference extraction - error message usage() ## Read the journal titles knowledge base, creating the search patterns and replace terms: (title_search_kb, title_search_standardised_titles, title_search_keys) = \ build_titles_knowledge_base(CFG_REFEXTRACT_KB_JOURNAL_TITLES) (preprint_reportnum_sre, standardised_preprint_reportnum_categs) = \ build_institutes_preprints_numeration_knowledge_base(CFG_REFEXTRACT_KB_REPORT_NUMBERS) done_coltags = 0 ## flag to signal that the XML collection tags have been output for curitem in extract_jobs: extract_error = 0 ## extraction was OK unless determined otherwise ## reset the stats counters: count_misc = count_title = count_reportnum = count_url = 0 recid = curitem[0] if cli_opts['verbosity'] >= 1: sys.stdout.write("--- processing RecID: %s pdffile: %s\n" \ % (str(curitem[0]), curitem[1])) if not done_coltags: ## Output opening XML collection tags: if cli_opts['xmlfile']: try: ofilehdl = open(cli_opts['xmlfile'], 'w') ofilehdl.write("%s\n" % CFG_REFEXTRACT_XML_VERSION.encode("utf-8")) ofilehdl.write("%s\n" % CFG_REFEXTRACT_XML_COLLECTION_OPEN.encode("utf-8")) ofilehdl.flush() except: sys.stdout.write("***%s\n\n" % cli_opts['xmlfile']) raise IOError("Cannot open %s to write!" % cli_opts['xmlfile']) else: sys.stdout.write("%s\n" % (CFG_REFEXTRACT_XML_VERSION.encode("utf-8"),)) sys.stdout.write("%s\n" % (CFG_REFEXTRACT_XML_COLLECTION_OPEN.encode("utf-8"),)) done_coltags = 1 ## 1. Get this document body as plaintext: (docbody, extract_error) = get_plaintext_document_body(curitem[1]) if extract_error == 0 and len(docbody) == 0: extract_error = 3 if cli_opts['verbosity'] >= 1: sys.stdout.write("-----get_plaintext_document_body gave: %s lines," \ " overall error: %s\n" % (str(len(docbody)), str(extract_error))) if len(docbody) > 0: ## the document body is not empty: ## 2. If necessary, locate the reference section: if cli_opts['treat_as_reference_section']: ## don't search for citations in the document body: treat it as a reference section: reflines = docbody else: ## launch search for the reference section in the document body: (reflines, extract_error) = extract_references_from_fulltext(docbody) if len(reflines) == 0 and extract_error == 0: extract_error = 6 if cli_opts['verbosity'] >= 1: sys.stdout.write("-----extract_references_from_fulltext gave " \ "len(reflines): %s overall error: %s\n" \ % (str(len(reflines)), str(extract_error))) ## 3. Standardise the reference lines: | afd852f45332d11ac027b8d47ce1a922ce7f2cc6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/afd852f45332d11ac027b8d47ce1a922ce7f2cc6/refextract.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
445,
18,
3536,
2552,
4942,
67,
4952,
261,
4857,
67,
4952,
16,
4942,
67,
1968,
13,
273,
225,
336,
67,
4857,
67,
2116,
1435,
225,
2608,
67,
10088,
273,
336,
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,
2774,
13332,
3536,
6376,
445,
18,
3536,
2552,
4942,
67,
4952,
261,
4857,
67,
4952,
16,
4942,
67,
1968,
13,
273,
225,
336,
67,
4857,
67,
2116,
1435,
225,
2608,
67,
10088,
273,
336,
67,
... |
resultDict = result['value'] | resultDict = result['Value'] | def rescheduleJob (self, jobID): """ Reschedule the given job to run again from scratch. Retain the already defined parameters in the parameter Attic """ # Check Verified Flag result = self.getJobAttributes( jobID, ['Status','MinorStatus','VerifiedFlag','RescheduleCounter', 'Owner','OwnerDN','OwnerGroup','DIRACSetup'] ) if result['OK']: resultDict = result['value'] else: return S_ERROR('JobDB.getJobAttributes: can not retrieve job attributes') | 217021ab63329dc922bb37e596caca5cf0d30ec7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/217021ab63329dc922bb37e596caca5cf0d30ec7/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
400,
2847,
2278,
261,
2890,
16,
28913,
4672,
3536,
1124,
2847,
326,
864,
1719,
358,
1086,
3382,
628,
15289,
18,
17100,
530,
326,
1818,
2553,
1472,
316,
326,
1569,
6020,
335,
3536,
468,
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,
400,
2847,
2278,
261,
2890,
16,
28913,
4672,
3536,
1124,
2847,
326,
864,
1719,
358,
1086,
3382,
628,
15289,
18,
17100,
530,
326,
1818,
2553,
1472,
316,
326,
1569,
6020,
335,
3536,
468,
2... |
overlayimage=Image.new("RGBA",screensize) | overlayimage=Image.new("RGBA",screensize, (0,0,0,0)) | def createChapterMenu(screensize, screendpi, numberofitems): """Creates all the necessary menu images and files for the MythBurn menus.""" #Get the main menu node (we must only have 1) menunode=themeDOM.getElementsByTagName("submenu") if menunode.length!=1: fatalError("Cannot find submenu element in theme file") menunode=menunode[0] menuitems=menunode.getElementsByTagName("chapter") #Total number of video items on a single menu page (no less than 1!) itemsperpage = menuitems.length write( "Chapter items per page %s " % itemsperpage) #Get background image filename backgroundfilename = menunode.attributes["background"].value if backgroundfilename=="": fatalError("Background image is not set in theme file") backgroundfilename = getThemeFile(themeName,backgroundfilename) write( "Background image file is %s" % backgroundfilename) if not doesFileExist(backgroundfilename): fatalError("Background image not found (%s)" % backgroundfilename) #Get highlight color highlightcolor = "red" if menunode.hasAttribute("highlightcolor"): highlightcolor = menunode.attributes["highlightcolor"].value #Get menu music menumusic = "menumusic.ac3" if menunode.hasAttribute("music"): menumusic = menunode.attributes["music"].value #Get menu length menulength = 15 if menunode.hasAttribute("length"): menulength = int(menunode.attributes["length"].value) write("Music is %s, length is %s seconds" % (menumusic, menulength)) #Page number counter page=1 write( "Creating DVD sub-menus") while page <= numberofitems: write( "Sub-menu %s " % page) #instead of loading the background image and drawing on it we now #make a transparent image and draw all items on it. This overlay #image is then added to the required background image when the #preview items are added (the reason for this is it will assist #if the background image is actually a video) overlayimage=Image.new("RGBA",screensize) draw=ImageDraw.Draw(overlayimage) #Create image to hold button masks (same size as background) bgimagemask=Image.new("RGBA",overlayimage.size) drawmask=ImageDraw.Draw(bgimagemask) spumuxdom = xml.dom.minidom.parseString('<subpictures><stream><spu force="yes" start="00:00:00.0" highlight="" select="" ></spu></stream></subpictures>') spunode = spumuxdom.documentElement.firstChild.firstChild #Extract the thumbnails chapterlist=createVideoChapters(page,itemsperpage,getLengthOfVideo(page),True) chapterlist=string.split(chapterlist,",") #now need to preprocess the menu to see if any preview videos are required #This must be done on an individual basis since we do the resize as the #images are extracted. #first make sure the preview folder is empty and present previewfolder = createEmptyPreviewFolder(page) haspreview = False previewsegment=int(getLengthOfVideo(page) / itemsperpage) previewtime = 0 previewchapter = 0 previewx = [] previewy = [] previeww = [] previewh = [] previewmask = [] while previewchapter < itemsperpage: menuitem=menuitems[ previewchapter ] #generate the preview if required (px=9999 means not required) px, py, pw, ph, maskimage = generateVideoPreview(page, previewchapter, menuitem, previewtime, menulength, previewfolder) previewx.append(px) previewy.append(py) previeww.append(pw) previewh.append(ph) previewmask.append(maskimage) if px != 9999: haspreview = True previewchapter+=1 previewtime+=previewsegment #Loop through all the items on this menu page chapter=0 while chapter < itemsperpage: # and itemsonthispage < itemsperpage: menuitem=menuitems[ chapter ] chapter+=1 drawThemeItem(page, itemsperpage, page, menuitem, overlayimage, draw, bgimagemask, drawmask, highlightcolor, spumuxdom, spunode, 999, chapter, chapterlist) #Save this menu image and its mask bgimage=Image.open(backgroundfilename,"r").resize(screensize) bgimage.paste(overlayimage, (0,0), overlayimage) bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page),"JPEG", quality=90) bgimagemask.save(os.path.join(getTempPath(),"chaptermenumask-%s.png" % page),"PNG",quality=90,optimize=0) if haspreview == True: numframes=secondsToFrames(menulength) #numframes should be the number of preview images that have been created write( "Generating the preview images" ) framenum = 0 while framenum < numframes: previewchapter = 0 while previewchapter < itemsperpage: if previewx[previewchapter] != 9999: previewpath = os.path.join(getItemTempPath(page), "preview") previewfile = "preview-i%d-t1-f%d.jpg" % (previewchapter, framenum) imagefile = os.path.join(previewpath, previewfile) if doesFileExist(imagefile): picture = Image.open(imagefile, "r").resize((previeww[previewchapter], previewh[previewchapter])) picture = picture.convert("RGBA") imagemaskfile = os.path.join(previewpath, "mask-i%d.png" % previewchapter) if previewmask[previewchapter] != None: bgimage.paste(picture, (previewx[previewchapter], previewy[previewchapter]), previewmask[previewchapter]) else: bgimage.paste(picture, (previewx[previewchapter], previewy[previewchapter])) del picture previewchapter+=1 bgimage.save(os.path.join(getTempPath(),"chaptermenu-%s-f%06d.jpg" % (page, framenum)),"JPEG",quality=90) framenum+=1 spumuxdom.documentElement.firstChild.firstChild.setAttribute("select",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page)) spumuxdom.documentElement.firstChild.firstChild.setAttribute("highlight",os.path.join(getTempPath(),"chaptermenumask-%s.png" % page)) #Release large amounts of memory ASAP ! del draw del bgimage del drawmask del bgimagemask del overlayimage del previewx del previewy del previewmask #write( spumuxdom.toprettyxml()) WriteXMLToFile (spumuxdom,os.path.join(getTempPath(),"chapterspumux-%s.xml" % page)) if chaptermenuAspectRatio == "4:3": aspect_ratio = '2' elif chaptermenuAspectRatio == "16:9": aspect_ratio = '3' else: if getAspectRatioOfVideo(page) > aspectRatioThreshold: aspect_ratio = '3' else: aspect_ratio = '2' write("Encoding Chapter Menu Page %s using aspect ratio '%s'" % (page, chaptermenuAspectRatio)) if haspreview == True: encodeMenu(os.path.join(getTempPath(),"chaptermenu-%s-f%%06d.jpg" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"chapterspumux-%s.xml" % page), os.path.join(getTempPath(),"chaptermenu-%s.mpg" % page), aspect_ratio) else: encodeMenu(os.path.join(getTempPath(),"chaptermenu-%s.jpg" % page), os.path.join(getTempPath(),"temp.m2v"), getThemeFile(themeName,menumusic), menulength, os.path.join(getTempPath(),"temp.mpg"), os.path.join(getTempPath(),"chapterspumux-%s.xml" % page), os.path.join(getTempPath(),"chaptermenu-%s.mpg" % page), aspect_ratio) #Move on to the next page page+=1 | c82d8a0c4a33fc669861191621297cdbb83d3d9b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13713/c82d8a0c4a33fc669861191621297cdbb83d3d9b/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
782,
2487,
4599,
12,
1017,
266,
773,
554,
16,
888,
266,
409,
7259,
16,
1300,
792,
3319,
4672,
3536,
2729,
777,
326,
4573,
3824,
4602,
471,
1390,
364,
326,
8005,
451,
38,
321,
2137... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
782,
2487,
4599,
12,
1017,
266,
773,
554,
16,
888,
266,
409,
7259,
16,
1300,
792,
3319,
4672,
3536,
2729,
777,
326,
4573,
3824,
4602,
471,
1390,
364,
326,
8005,
451,
38,
321,
2137... |
sage: filename = tmp_filename() + '.png' sage: r.png(file='"%s"'%filename) | sage: filename = tmp_filename() + '.png' sage: r.png(file='"%s"'%filename) | def plot(self, *args, **kwargs): """ The R plot function. Type r.help('plot') for much more extensive documentatin about this function. See the examples below for how to use it to write output to a FILE. | cc0ae2fe046cb29c675913dd00183435eaa1f913 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/cc0ae2fe046cb29c675913dd00183435eaa1f913/r.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
1021,
534,
3207,
445,
18,
225,
1412,
436,
18,
5201,
2668,
4032,
6134,
364,
9816,
1898,
1110,
14315,
1668,
270,
267,
2973,
333,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
1021,
534,
3207,
445,
18,
225,
1412,
436,
18,
5201,
2668,
4032,
6134,
364,
9816,
1898,
1110,
14315,
1668,
270,
267,
2973,
333,
... |
models.signals.post_syncdb.send(sender=app, app=app, created_models=created_models, verbosity=verbosity, interactive=interactive) | if self._is_multidb(): models.signals.post_syncdb.send( sender=app, app=app, created_models=created_models, verbosity=verbosity, interactive=interactive, db=self.db_alias, ) else: models.signals.post_syncdb.send( sender=app, app=app, created_models=created_models, verbosity=verbosity, interactive=interactive, ) | def really_send_create_signal(self, app_label, model_names): """ Sends a post_syncdb signal for the model specified. | b908f79ad316712308ca2e4f55eba0f21eb28513 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13142/b908f79ad316712308ca2e4f55eba0f21eb28513/generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8654,
67,
4661,
67,
2640,
67,
10420,
12,
2890,
16,
595,
67,
1925,
16,
938,
67,
1973,
4672,
3536,
2479,
87,
279,
1603,
67,
8389,
1966,
4277,
364,
326,
938,
1269,
18,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8654,
67,
4661,
67,
2640,
67,
10420,
12,
2890,
16,
595,
67,
1925,
16,
938,
67,
1973,
4672,
3536,
2479,
87,
279,
1603,
67,
8389,
1966,
4277,
364,
326,
938,
1269,
18,
2,
-100,
-100,
-1... |
self.build_temp, | self.implib_dir, | def msvc_prelink_hack (self, sources, ext, extra_args): | b593793fce7853d8788254483dfbcf5f0f21bd27 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/b593793fce7853d8788254483dfbcf5f0f21bd27/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
1484,
1232,
67,
76,
484,
261,
2890,
16,
5550,
16,
1110,
16,
2870,
67,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4086,
4227,
67,
1484,
1232,
67,
76,
484,
261,
2890,
16,
5550,
16,
1110,
16,
2870,
67,
1968,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif message.type != gst.MESSAGE_STATE_CHANGED: print '%s: %s:' % (message.src.get_path_string(), message.type.value_nicks[1]) if message.structure: print ' %s' % message.structure.to_string() else: print ' (no structure)' | def __message(self, bus, message): if message.type == gst.MESSAGE_EOS: self.__end(False) elif message.type == gst.MESSAGE_ERROR: err, debug = message.parse_error() self.info.error("%s" % err, debug) elif message.type != gst.MESSAGE_STATE_CHANGED: print '%s: %s:' % (message.src.get_path_string(), message.type.value_nicks[1]) if message.structure: print ' %s' % message.structure.to_string() else: print ' (no structure)' return True | a7537478887627e35dd912191d6723e66e6aa168 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/a7537478887627e35dd912191d6723e66e6aa168/player.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2150,
12,
2890,
16,
5766,
16,
883,
4672,
309,
883,
18,
723,
422,
314,
334,
18,
8723,
67,
41,
4618,
30,
365,
16186,
409,
12,
8381,
13,
1327,
883,
18,
723,
422,
314,
334,
18,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2150,
12,
2890,
16,
5766,
16,
883,
4672,
309,
883,
18,
723,
422,
314,
334,
18,
8723,
67,
41,
4618,
30,
365,
16186,
409,
12,
8381,
13,
1327,
883,
18,
723,
422,
314,
334,
18,
8... | |
""" Used for unpickling. See __getstate__. EXAMPLES:: sage: state = units.__getstate__() sage: units.__setstate__(state) """ self.__name = state[0] self.__data = state[1] self.__units = {} | """ Used for unpickling. See __getstate__. EXAMPLES:: sage: state = units.__getstate__() sage: units.__setstate__(state) """ self.__name = state[0] self.__data = state[1] self.__units = {} | def __setstate__(self, state): | ed891e5784edd8a5e4d544f1ef837edc82b93924 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ed891e5784edd8a5e4d544f1ef837edc82b93924/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
2019,
972,
12,
2890,
16,
919,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
2019,
972,
12,
2890,
16,
919,
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,
... |
self.__socket.join() | while self.__socket.isAlive(): self.__socket.join(1) | def start(self, sock, force = False): logSys.info("Starting Fail2ban") # First set the mask to only allow access to owner os.umask(0077) if self.__daemon: ret = self.__createDaemon() if ret: logSys.info("Daemon started") else: logSys.error("Could not create daemon") raise ServerInitializationError("Could not create daemon") # Start the communication logSys.debug("Starting communication") try: self.__socket.initialize(sock, force) self.__socket.start() self.__socket.join() except SSocketErrorException: logSys.error("Could not start server") logSys.info("Exiting Fail2ban") | ac0ed230834a37acc4626e858af3d48720ae708f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12786/ac0ed230834a37acc4626e858af3d48720ae708f/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
7313,
16,
2944,
273,
1083,
4672,
613,
12712,
18,
1376,
2932,
11715,
8911,
22,
21515,
7923,
468,
5783,
444,
326,
3066,
358,
1338,
1699,
2006,
358,
3410,
1140,
18,
379,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
7313,
16,
2944,
273,
1083,
4672,
613,
12712,
18,
1376,
2932,
11715,
8911,
22,
21515,
7923,
468,
5783,
444,
326,
3066,
358,
1338,
1699,
2006,
358,
3410,
1140,
18,
379,
... |
sage: a = sloane.A000261; a | sage: a = sloane.A000261;a | def list(self, n): self._eval(n) # force computation return self._b[:n] | 4e126d13403b67192b1f9a1f3f86e89eae8a6861 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/4e126d13403b67192b1f9a1f3f86e89eae8a6861/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
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,
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,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
filter_types, callbacks, sortable) | filter_types, callbacks, sortable, sort_on) | def __init__(self, treeview, coltypes, colnames, values=[], filters=None, filter_types=None, callbacks={}, sortable=False, sort_on=-1): TableBase.__init__(self, treeview, coltypes, colnames, values, filters, filter_types, callbacks, sortable) | 7d1db798f76d5ec401ebbcb523dbe04d0a0c6c02 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/7d1db798f76d5ec401ebbcb523dbe04d0a0c6c02/widget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2151,
1945,
16,
645,
2352,
16,
645,
1973,
16,
924,
22850,
6487,
3415,
33,
7036,
16,
1034,
67,
2352,
33,
7036,
16,
6689,
28793,
18092,
33,
8381,
16,
1524,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2151,
1945,
16,
645,
2352,
16,
645,
1973,
16,
924,
22850,
6487,
3415,
33,
7036,
16,
1034,
67,
2352,
33,
7036,
16,
6689,
28793,
18092,
33,
8381,
16,
1524,... |
for t in self.utConvertToList(roles): role, location = t.split('||') if location == '/': location = '' loc = self.unrestrictedTraverse(location) if location != '': res = self.utListDifference( loc.get_local_roles_for_userid(name), [role]) if len(res): loc.manage_setLocalRoles(name, res) else: loc.manage_delLocalRoles([name]) else: self.getAuthenticationTool()._doDelUserRoles([name]) if REQUEST: | auth_tool = self.getAuthenticationTool() for location in self.utConvertToList(roles): auth_tool.manage_revokeUserRole(name, location, REQUEST) if REQUEST is not None: | def admin_revokeuserroles(self, name='', roles=[], REQUEST=None): """ Revoke roles from an user. """ redirect_url = REQUEST.environ.get('HTTP_REFERER', '%s/admin_userroles_html?name=%s' % (self.absolute_url(), name)) if len(roles) == 0: if REQUEST is not None: self.setSessionErrorsTrans("No role(s) selected") return REQUEST.RESPONSE.redirect(redirect_url) else: raise ValueError("No role(s) provided") | 1706ce73143f30823553db8b7c6323382b3d4d51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/1706ce73143f30823553db8b7c6323382b3d4d51/CHMSite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
9083,
3056,
1355,
7774,
12,
2890,
16,
508,
2218,
2187,
4900,
22850,
6487,
12492,
33,
7036,
4672,
3536,
23863,
4900,
628,
392,
729,
18,
3536,
3136,
67,
718,
273,
12492,
18,
2868... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3981,
67,
9083,
3056,
1355,
7774,
12,
2890,
16,
508,
2218,
2187,
4900,
22850,
6487,
12492,
33,
7036,
4672,
3536,
23863,
4900,
628,
392,
729,
18,
3536,
3136,
67,
718,
273,
12492,
18,
2868... |
nextInTT = m.eval('keyTangent -in %d -q -itt %s;'%(index,attrpath)) nextInTW = m.eval('keyTangent -in %d -q -iw %s;'%(index,attrpath)) | nextInTT = cmd.keyTangent(attrpath,index=(index,),query=True,inTangentType=True) nextInTW = cmd.keyTangent(attrpath,index=(index,),query=True,inWeight=True) | def __init__( self, attrpath, keyTime=None, keyIdx=None ): #if the attrpath doesn't exist, then just create an empty key instance if not m.eval('objExists "%s";'%(attrpath,)): self.obj = None self.attr = None self.time = None self.value = None self.iw = None self.ow = None self.itt = None self.ott = None self.time = None return | 8781a673d03469676f09284ae55510ab6d71bde7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1810/8781a673d03469676f09284ae55510ab6d71bde7/keyUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
1604,
803,
16,
498,
950,
33,
7036,
16,
498,
4223,
33,
7036,
262,
30,
468,
430,
326,
1604,
803,
3302,
1404,
1005,
16,
1508,
2537,
752,
392,
1008,
498,
79... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
365,
16,
1604,
803,
16,
498,
950,
33,
7036,
16,
498,
4223,
33,
7036,
262,
30,
468,
430,
326,
1604,
803,
3302,
1404,
1005,
16,
1508,
2537,
752,
392,
1008,
498,
79... |
self.set_playlist() lp_new = len(self.playlist) | new_playlist = self.get_playlist() lp_new = len(new_playlist) | def get_next_media(self): # Init playlist if self.lp != 0: self.set_playlist() lp_new = len(self.playlist) #self.logger.write(self.playlist) | b5e9ba95fb119a579c4d9baa04a915d54abc16d6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12047/b5e9ba95fb119a579c4d9baa04a915d54abc16d6/deefuzzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
5829,
12,
2890,
4672,
468,
4378,
16428,
309,
365,
18,
9953,
480,
374,
30,
394,
67,
1601,
1098,
273,
365,
18,
588,
67,
1601,
1098,
1435,
12423,
67,
2704,
273,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
5829,
12,
2890,
4672,
468,
4378,
16428,
309,
365,
18,
9953,
480,
374,
30,
394,
67,
1601,
1098,
273,
365,
18,
588,
67,
1601,
1098,
1435,
12423,
67,
2704,
273,
562,
... |
self.names = [] self.url = url | self.names = [] self.url = url | def __init__(self, url, verbose=VERBOSE, checker=None): self.myverbose = verbose # now unused self.checker = checker self.base = None self.links = {} | f97eecccb714a71cf5a1ca9399cd9c579014a5b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f97eecccb714a71cf5a1ca9399cd9c579014a5b9/wcnew.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
16,
3988,
33,
21900,
16,
12489,
33,
7036,
4672,
365,
18,
4811,
11369,
273,
3988,
468,
2037,
10197,
365,
18,
19243,
273,
12489,
365,
18,
1969,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
16,
3988,
33,
21900,
16,
12489,
33,
7036,
4672,
365,
18,
4811,
11369,
273,
3988,
468,
2037,
10197,
365,
18,
19243,
273,
12489,
365,
18,
1969,
273,
5... |
raise KeyError, "key out of bounds" | raise IndexError, "index out of bounds" | def __setitem__(self, key, val): if isinstance(key, types.TupleType): row = key[0] col = key[1] func = getattr(sparsetools, self.ftype+'cscsetel') M, N = self.shape if (row < 0): row = M + row if (col < 0): col = N + col if (row < 0) or (col < 0): raise IndexError, "index out of bounds" if (col >= N): self.indptr = resize1d(self.indptr, col+2) self.indptr[N+1:] = self.indptr[N] N = col+1 if (row >= M): M = row+1 self.shape = (M, N) nzmax = self.nzmax if (nzmax < self.nnz+1): # need more room alloc = max(1, self.allocsize) self.data = resize1d(self.data, nzmax + alloc) self.rowind = resize1d(self.rowind, nzmax + alloc) func(self.data, self.rowind, self.indptr, row, col, val) self._check() elif isinstance(key, types.IntType): if (key < self.nnz): self.data[key] = val else: raise KeyError, "key out of bounds" else: raise NotImplementedError | cc9a850083c66543ac7901fd68022fbe73610704 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/cc9a850083c66543ac7901fd68022fbe73610704/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
1244,
4672,
309,
1549,
12,
856,
16,
1953,
18,
9038,
559,
4672,
1027,
273,
498,
63,
20,
65,
645,
273,
498,
63,
21,
65,
1326,
273,
3869,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
1726,
972,
12,
2890,
16,
498,
16,
1244,
4672,
309,
1549,
12,
856,
16,
1953,
18,
9038,
559,
4672,
1027,
273,
498,
63,
20,
65,
645,
273,
498,
63,
21,
65,
1326,
273,
3869,
... |
proPath = cliParams.basePath | proPath = cliParams.targetPath | def usage(): print "Usage %s <opts> <cfgFile>" % sys.argv[0] for cmdOpt in cmdOpts: print " %s %s : %s" % ( cmdOpt[0].ljust( 3 ), cmdOpt[1].ljust( 20 ), cmdOpt[2] ) sys.exit( 1 ) | 591a1a318b333008b062c7cbcccfca31c735cb42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/591a1a318b333008b062c7cbcccfca31c735cb42/dirac-install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
738,
87,
411,
4952,
34,
411,
7066,
812,
2984,
738,
2589,
18,
19485,
63,
20,
65,
364,
1797,
6179,
316,
1797,
5476,
30,
1172,
315,
738,
87,
738,
87,
294,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
738,
87,
411,
4952,
34,
411,
7066,
812,
2984,
738,
2589,
18,
19485,
63,
20,
65,
364,
1797,
6179,
316,
1797,
5476,
30,
1172,
315,
738,
87,
738,
87,
294,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.