rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
""" MAX_DIFF = timedelta(120 * 365) MIN_DIFF = timedelta(hours=1) | Represents a period in time using a start and end time. """ | def __init__(self, name, color): """ Create a category with the given name and color. | c737fbb26e428df0d8a1e1d888dbdf8efa3b1d24 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/c737fbb26e428df0d8a1e1d888dbdf8efa3b1d24/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
2036,
4672,
3536,
1788,
279,
3150,
598,
326,
864,
508,
471,
2036,
18,
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,
1001,
2738,
972,
12,
2890,
16,
508,
16,
2036,
4672,
3536,
1788,
279,
3150,
598,
326,
864,
508,
471,
2036,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return MutableSeq(self.data, self.alphabet) | return MutableSeq(str(self), self.alphabet) | def tomutable(self): # Needed? Or use a function? return MutableSeq(self.data, self.alphabet) | cfd18f549209e113f9acb2de74eeaf74108ccd1d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/cfd18f549209e113f9acb2de74eeaf74108ccd1d/Seq.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
5146,
12,
2890,
4672,
282,
468,
26480,
35,
225,
2965,
999,
279,
445,
35,
327,
10960,
6926,
12,
2890,
18,
892,
16,
365,
18,
287,
8907,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
358,
5146,
12,
2890,
4672,
282,
468,
26480,
35,
225,
2965,
999,
279,
445,
35,
327,
10960,
6926,
12,
2890,
18,
892,
16,
365,
18,
287,
8907,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def TestAll(self, root_key): self.WriteTestData(root_key) self.ReadTestData(root_key) self.DeleteTestData(root_key) | def TestAll(self, root_key, subkeystr="sub_key"): self.WriteTestData(root_key, subkeystr) self.ReadTestData(root_key, subkeystr) self.DeleteTestData(root_key, subkeystr) | def TestAll(self, root_key): self.WriteTestData(root_key) self.ReadTestData(root_key) self.DeleteTestData(root_key) | f3eb94a6b1ba946a780f9bec3f012f5a68326881 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/f3eb94a6b1ba946a780f9bec3f012f5a68326881/test_winreg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
1595,
12,
2890,
16,
1365,
67,
856,
4672,
365,
18,
3067,
4709,
751,
12,
3085,
67,
856,
13,
365,
18,
1994,
4709,
751,
12,
3085,
67,
856,
13,
365,
18,
2613,
4709,
751,
12,
3085,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7766,
1595,
12,
2890,
16,
1365,
67,
856,
4672,
365,
18,
3067,
4709,
751,
12,
3085,
67,
856,
13,
365,
18,
1994,
4709,
751,
12,
3085,
67,
856,
13,
365,
18,
2613,
4709,
751,
12,
3085,
... |
[Link(mlist.GetRelativeScriptURL('listinfo'), Bold(mlist.real_name)), | [Link(mlist.GetScriptURL('listinfo'), Bold(mlist.real_name)), | def FormatListinfoOverview(error=None): "Present a general welcome and itemize the (public) lists for this host." # XXX We need a portable way to determine the host by which we are being # visited! An absolute URL would do... http_host = os.environ.get('HTTP_HOST', os.environ.get('SERVER_NAME')) port = os.environ.get('SERVER_PORT') # strip off the port if there is one if port and http_host[-len(port)-1:] == ':'+port: http_host = http_host[:-len(port)-1] if mm_cfg.VIRTUAL_HOST_OVERVIEW and http_host: host_name = http_host else: host_name = mm_cfg.DEFAULT_HOST_NAME doc = Document() legend = "%s Mailing Lists" % host_name doc.SetTitle(legend) table = Table(border=0, width="100%") table.AddRow([Center(Header(2, legend))]) table.AddCellInfo(max(table.GetCurrentRowIndex(), 0), 0, colspan=2, bgcolor="#99ccff") advertised = [] names = Utils.list_names() names.sort() for n in names: mlist = MailList.MailList(n, lock=0) if mlist.advertised: if mm_cfg.VIRTUAL_HOST_OVERVIEW and \ http_host and \ string.find(http_host, mlist.web_page_url) == -1 and \ string.find(mlist.web_page_url, http_host) == -1: # List is for different identity of this host - skip it. continue else: advertised.append(mlist) if error: greeting = FontAttr(error, color="ff5060", size="+1") else: greeting = FontAttr('Welcome!', size='+2') if not advertised: welcome_items = (greeting, "<p>" " There currently are no publicly-advertised ", Link(mm_cfg.MAILMAN_URL, "mailman"), " mailing lists on %s." % host_name, ) else: welcome_items = ( greeting, '''<p>Below is a listing of all the public mailing lists on %(hostname)s. Click on a list name to get more information about the list, or to subscribe, unsubscribe, and change the preferences on your subscription.''' % {'hostname': host_name}, ) welcome_items = (welcome_items + (" To visit the info page for an unadvertised list," " open a URL similar to this one, but with a '/' and" + (" the %slist name appended." % ((error and "right ") or "")) + '<p> List administrators, you can visit ', Link("%sadmin%s/" % ('../' * Utils.GetNestingLevel(), mm_cfg.CGIEXT), "the list admin overview page"), " to find the management interface for your list." "<p>(Send questions or comments to ", Link("mailto:%s" % mm_cfg.MAILMAN_OWNER, mm_cfg.MAILMAN_OWNER), ".)<p>")) table.AddRow([apply(Container, welcome_items)]) table.AddCellInfo(max(table.GetCurrentRowIndex(), 0), 0, colspan=2) if advertised: table.AddRow([' ', ' ']) table.AddRow([Bold(FontAttr('List', size='+2')), Bold(FontAttr('Description', size='+2')) ]) for mlist in advertised: table.AddRow( [Link(mlist.GetRelativeScriptURL('listinfo'), Bold(mlist.real_name)), mlist.description or Italic('[no description available]')]) doc.AddItem(table) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format(bgcolor="#ffffff") | 1d892a94dfe1f7fb57582c0bff2e9e3b217e85e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/1d892a94dfe1f7fb57582c0bff2e9e3b217e85e5/listinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4077,
682,
1376,
26648,
12,
1636,
33,
7036,
4672,
315,
6351,
279,
7470,
28329,
471,
761,
554,
326,
261,
482,
13,
6035,
364,
333,
1479,
1199,
225,
468,
11329,
1660,
1608,
279,
1756,
429,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4077,
682,
1376,
26648,
12,
1636,
33,
7036,
4672,
315,
6351,
279,
7470,
28329,
471,
761,
554,
326,
261,
482,
13,
6035,
364,
333,
1479,
1199,
225,
468,
11329,
1660,
1608,
279,
1756,
429,
... |
self.new_text('boostbook:purpose',escape(brief_xhtml.toxml('utf-8'))), | self.new_text('boostbook:purpose',brief_xhtml.toxml('utf-8')), | def x_article(self,node): description_xhtml = self.new_node('div',klass='description') brief_xhtml = self.new_node('span', self.x(self.get_child(self.get_child(node,tag='articleinfo'), tag='articlepurpose' )), klass='brief' ) body_item = self.get_child(node,tag='title').nextSibling download_item = None while body_item: item = self.x(body_item) if item: download_i = self.get_child(item,tag='boostbook:download') if download_i: download_item = download_i else: description_xhtml.appendChild(item) body_item = body_item.nextSibling return self.new_node( 'item', self.new_text('title',node.getAttribute('name')), self.new_text('pubDate',node.getAttribute('last-revision')), self.new_text('boostbook:purpose',escape(brief_xhtml.toxml('utf-8'))), download_item, self.new_text('description',escape(description_xhtml.toxml('utf-8'))) ) | a459bbd52e23f7d32b79791e96e4a9b5d60f09cd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9849/a459bbd52e23f7d32b79791e96e4a9b5d60f09cd/bbook2rss.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
67,
11480,
12,
2890,
16,
2159,
4672,
2477,
67,
26341,
273,
365,
18,
2704,
67,
2159,
2668,
2892,
2187,
22626,
2218,
3384,
6134,
324,
17802,
67,
26341,
273,
365,
18,
2704,
67,
2159,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
67,
11480,
12,
2890,
16,
2159,
4672,
2477,
67,
26341,
273,
365,
18,
2704,
67,
2159,
2668,
2892,
2187,
22626,
2218,
3384,
6134,
324,
17802,
67,
26341,
273,
365,
18,
2704,
67,
2159,
... |
sc = init_db_dictionary("selfcitedict") | sc = init_db_dictionary("selfcitdict") | def get_self_cited_by(record_id): """Return a list of doc ids [y1,y2,..] for the rec id x given as param, so that x cites y1,y2,.. and x and each y share an author """ result = [] sc = init_db_dictionary("selfcitedict") if sc and sc.has_key(record_id): result.extend(sc[record_id]) if (len(result) == 0): return None return result | 8a2d1d6b648be4fc593302076237736443d51ac2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/8a2d1d6b648be4fc593302076237736443d51ac2/bibrank_citation_searcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
2890,
67,
71,
16261,
67,
1637,
12,
3366,
67,
350,
4672,
3536,
990,
279,
666,
434,
997,
3258,
306,
93,
21,
16,
93,
22,
16,
838,
65,
364,
326,
1950,
612,
619,
864,
487,
579,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2890,
67,
71,
16261,
67,
1637,
12,
3366,
67,
350,
4672,
3536,
990,
279,
666,
434,
997,
3258,
306,
93,
21,
16,
93,
22,
16,
838,
65,
364,
326,
1950,
612,
619,
864,
487,
579,... |
open('demopwd.cfg', 'r').read().split(':', 2) | open('demopwd.cfg', 'r').readline().strip().split(':', 2) | def setUp(self): # pylint: disable-msg=C0103 """setting up helper variables for tests""" self.username, self.userpwd, self.useremail = \ open('demopwd.cfg', 'r').read().split(':', 2) self.cern = cern.ExternalAuthCern() | 432132641f04317005d6668881c49824097a3c71 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/432132641f04317005d6668881c49824097a3c71/external_authentication_cern_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
3536,
8920,
731,
4222,
3152,
364,
7434,
8395,
365,
18,
5053,
16,
365,
18,
1355,
27487,
16,
365,
18,
1355,
3652... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
7601,
30,
4056,
17,
3576,
33,
39,
1611,
4630,
3536,
8920,
731,
4222,
3152,
364,
7434,
8395,
365,
18,
5053,
16,
365,
18,
1355,
27487,
16,
365,
18,
1355,
3652... |
VBD_methods = [] | VBD_metrics_methods = [] | def VBD_get_all(self, session): xendom = XendDomain.instance() vbds = [d.get_vbds() for d in XendDomain.instance().list('all')] vbds = reduce(lambda x, y: x + y, vbds) return xen_api_success(vbds) | f5e09f7461489dc9d1d93eb52b74f378d590af78 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/f5e09f7461489dc9d1d93eb52b74f378d590af78/XendAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
776,
18096,
67,
588,
67,
454,
12,
2890,
16,
1339,
4672,
619,
409,
362,
273,
1139,
409,
3748,
18,
1336,
1435,
16653,
2377,
273,
306,
72,
18,
588,
67,
90,
70,
2377,
1435,
364,
302,
316... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
776,
18096,
67,
588,
67,
454,
12,
2890,
16,
1339,
4672,
619,
409,
362,
273,
1139,
409,
3748,
18,
1336,
1435,
16653,
2377,
273,
306,
72,
18,
588,
67,
90,
70,
2377,
1435,
364,
302,
316... |
out,err,res = executil.execWithCaptureErrorStatus("/sbin/cman_tool",args) | out,err,res = executil.execWithCaptureErrorStatus("/usr/sbin/cman_tool",args) | def getClusterStatus(self): args = list() args.append("/sbin/cman_tool") args.append("status") cmdstr = ' '.join(args) try: out,err,res = executil.execWithCaptureErrorStatus("/sbin/cman_tool",args) except RuntimeError, e: return False | 1065bb253fe7c9c4739c6f1418df4f6d4f998a85 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3879/1065bb253fe7c9c4739c6f1418df4f6d4f998a85/CommandHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21206,
1482,
12,
2890,
4672,
833,
273,
666,
1435,
833,
18,
6923,
2932,
19,
87,
4757,
19,
71,
4728,
67,
6738,
7923,
833,
18,
6923,
2932,
2327,
7923,
1797,
701,
273,
296,
2418,
5701,
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,
21206,
1482,
12,
2890,
4672,
833,
273,
666,
1435,
833,
18,
6923,
2932,
19,
87,
4757,
19,
71,
4728,
67,
6738,
7923,
833,
18,
6923,
2932,
2327,
7923,
1797,
701,
273,
296,
2418,
5701,
12,... |
ecasound_binary = os.getenv("ECASOUND","") | try: ecasound_binary = os.environ['ECASOUND'] except KeyError: ecasound_binary = '' | def initialize(I): | f89e247c6e140f3b46e86be10ec92989fafb6c36 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/221/f89e247c6e140f3b46e86be10ec92989fafb6c36/ecacontrol.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
45,
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,
4046,
12,
45,
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,
-10... |
class FilterTests(unittest.TestCase): | class BaseTest(unittest.TestCase): """Basic bookkeeping required for testing.""" def setUp(self): if '__warningregistry__' in globals(): del globals()['__warningregistry__'] if hasattr(warning_tests, '__warningregistry__'): del warning_tests.__warningregistry__ if hasattr(sys, '__warningregistry__'): del sys.__warningregistry__ sys.modules['warnings'] = self.module super(BaseTest, self).setUp() def tearDown(self): sys.modules['warnings'] = original_warnings super(BaseTest, self).tearDown() class FilterTests(object): | def warnings_state(module): """Use a specific warnings implementation in warning_tests.""" global __warningregistry__ for to_clear in (sys, warning_tests): try: to_clear.__warningregistry__.clear() except AttributeError: pass try: __warningregistry__.clear() except NameError: pass original_warnings = warning_tests.warnings try: warning_tests.warnings = module yield finally: warning_tests.warnings = original_warnings | c234aa4a542d628a9341637977fc458f47a485ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/c234aa4a542d628a9341637977fc458f47a485ae/test_warnings.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5599,
67,
2019,
12,
2978,
4672,
3536,
3727,
279,
2923,
5599,
4471,
316,
3436,
67,
16341,
12123,
2552,
1001,
8551,
9893,
972,
364,
358,
67,
8507,
316,
261,
9499,
16,
3436,
67,
16341,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5599,
67,
2019,
12,
2978,
4672,
3536,
3727,
279,
2923,
5599,
4471,
316,
3436,
67,
16341,
12123,
2552,
1001,
8551,
9893,
972,
364,
358,
67,
8507,
316,
261,
9499,
16,
3436,
67,
16341,
4672... |
if not handleInfoFile(dirpath, parts, ".obj", sceneryObject, authors): return | def handleObject(dirpath, filename, libraryFileHandle, libraryPlaceholderFileHandle, objects, authors): objectSourcePath = os.path.join(dirpath, filename) parts = dirpath.split("/", 2) print "Handling object: " + objectSourcePath # Create an instance of the SceneryObject class sceneryObject = classes.SceneryObject(parts[2], filename) # Set up paths and copy files if not copySupportFiles(dirpath, parts): return # Handle the info.txt file if not handleInfoFile(dirpath, parts, ".obj", sceneryObject, authors): return # Copy the object file shutil.copyfile(objectSourcePath, os.path.join(classes.Configuration.osxFolder, parts[2], filename)) # Open the object file = open(objectSourcePath, "rU") objectFileContents = file.readlines() file.close() # Define the regex patterns: texturePattern = re.compile("TEXTURE\s+(.*)") litTexturePattern = re.compile("TEXTURE_LIT\s+(.*)") foundTexture = 0 for line in objectFileContents: result = texturePattern.match(line) if result: textureFile = os.path.join(dirpath, result.group(1)) if (result.group(1) == ""): print " WARNING: Object specifies a blank texture - valid but may not be as intended" elif os.path.isfile(textureFile): shutil.copyfile(textureFile, os.path.join(classes.Configuration.osxFolder, parts[2], result.group(1))) else: print " ERROR: Cannot find texture - object excluded (" + textureFile + ")" return result = litTexturePattern.match(line) if result: textureFile = os.path.join(dirpath, result.group(1)) if os.path.isfile(textureFile): shutil.copyfile(textureFile, os.path.join(classes.Configuration.osxFolder, parts[2], result.group(1))) else: print " ERROR: Cannot find LIT texture - object excluded (" + textureFile + ")" return # Object is valid, append it to the list objects.append(sceneryObject) # Write to the library.txt file for virtualPath in sceneryObject.virtualPaths: libraryFileHandle.write("EXPORT opensceneryx/" + virtualPath + " " + sceneryObject.getFilePath() + "\n") libraryPlaceholderFileHandle.write("EXPORT_BACKUP opensceneryx/" + virtualPath + " opensceneryx/placeholder.obj\n") | 5d85d733c345934088eebd21200220a1ee2d66fa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5176/5d85d733c345934088eebd21200220a1ee2d66fa/functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
921,
12,
1214,
803,
16,
1544,
16,
5313,
812,
3259,
16,
5313,
14038,
812,
3259,
16,
2184,
16,
14494,
4672,
733,
1830,
743,
273,
1140,
18,
803,
18,
5701,
12,
1214,
803,
16,
1544,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
921,
12,
1214,
803,
16,
1544,
16,
5313,
812,
3259,
16,
5313,
14038,
812,
3259,
16,
2184,
16,
14494,
4672,
733,
1830,
743,
273,
1140,
18,
803,
18,
5701,
12,
1214,
803,
16,
1544,
... | |
vals['parent.currency'], context=context) | vals['_parent_sale.currency'], context=context) | def on_change_with_amount(self, cursor, user, ids, vals, context=None): currency_obj = self.pool.get('currency.currency') if vals.get('type') == 'line': if isinstance(vals.get('parent.currency'), (int, long)): currency = currency_obj.browse(cursor, user, vals['parent.currency'], context=context) else: currency = vals['parent.currency'] return currency_obj.round(cursor, user, currency, Decimal(str(vals.get('quantity') or '0.0')) * \ (vals.get('unit_price') or Decimal('0.0'))) return Decimal('0.0') | 63ab9b352113f550a19cea3cf8f4525ee1ffdbe6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9306/63ab9b352113f550a19cea3cf8f4525ee1ffdbe6/sale.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
1918,
67,
8949,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
5462,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7095,
18,
7095,
6134,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
3427,
67,
1918,
67,
8949,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
5773,
16,
819,
33,
7036,
4672,
5462,
67,
2603,
273,
365,
18,
6011,
18,
588,
2668,
7095,
18,
7095,
6134,
... |
err_log = "" | err_log = "Errors:\n------\n" nb_err=0 std_log='' str_log1 = "Coda File is Imported : " str_not='' str_not1='' | def _coda_parsing(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) codafile = data['form']['coda'] jur_id = data['form']['journal_id'] def_pay_acc = data['form']['def_payable'] def_rec_acc = data['form']['def_receivable'] str_log = "" err_log = "" bank_statement={} bank_statement_lines={} bank_statements=[] recordlist = base64.decodestring(codafile).split('\n')#remove \r by dhaval recordlist.pop() for line in recordlist: if line[0] == '0': # header data | 8771236bbdea36b286344d806879abc29c41dc0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/8771236bbdea36b286344d806879abc29c41dc0d/coda_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1559,
69,
67,
24979,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
11012,
69,
768,
273,
501,
3292,
687,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1559,
69,
67,
24979,
12,
2890,
16,
4422,
16,
4555,
16,
501,
16,
819,
4672,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
11012,
69,
768,
273,
501,
3292,
687,... |
self.body.append(self.starttag(node, 'colgroup')) self.context.append('</colgroup>\n') | pass | def visit_tgroup(self, node): # Mozilla needs <colgroup>: self.body.append(self.starttag(node, 'colgroup')) # Appended by thead or tbody: self.context.append('</colgroup>\n') | 6375238ab8247c4cfacf9efad70324a50b6c7ce8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/6375238ab8247c4cfacf9efad70324a50b6c7ce8/OOwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
88,
1655,
12,
2890,
16,
756,
4672,
468,
19058,
10745,
4260,
411,
1293,
1655,
28593,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
1293,
1655,
26112,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
88,
1655,
12,
2890,
16,
756,
4672,
468,
19058,
10745,
4260,
411,
1293,
1655,
28593,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
1293,
1655,
26112,
4... |
a = array(a,copy=False) | def put (a, ind, v): """put(a, ind, v) results in a[n] = v[n] for all n in ind If v is shorter than mask it will be repeated as necessary. In particular v can be a scalar or length 1 array. The routine put is the equivalent of the following (although the loop is in C for speed): ind = array(indices, copy=False) v = array(values, copy=False).astype(a, a.dtype) for i in ind: a.flat[i] = v[i] a must be a contiguous Numeric array. """ a = array(a,copy=False) return a.put(v,ind) | 4588d7ffbcb85009875a6cb8138c28676aa4d179 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/4588d7ffbcb85009875a6cb8138c28676aa4d179/oldnumeric.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
261,
69,
16,
1547,
16,
331,
4672,
3536,
458,
12,
69,
16,
1547,
16,
331,
13,
1686,
316,
279,
63,
82,
65,
273,
331,
63,
82,
65,
364,
777,
290,
316,
1547,
971,
331,
353,
19623,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1378,
261,
69,
16,
1547,
16,
331,
4672,
3536,
458,
12,
69,
16,
1547,
16,
331,
13,
1686,
316,
279,
63,
82,
65,
273,
331,
63,
82,
65,
364,
777,
290,
316,
1547,
971,
331,
353,
19623,
... | |
import sndhdr import unittest from test.support import findfile class TestFormats(unittest.TestCase): def test_data(self): for filename, expected in ( ('sndhdr.8svx', ('8svx', 0, 1, 0, 8)), ('sndhdr.aifc', ('aifc', 44100, 2, 5, 16)), ('sndhdr.aiff', ('aiff', 44100, 2, 5, 16)), ('sndhdr.au', ('au', 44100, 2, 5.0, 16)), ('sndhdr.hcom', ('hcom', 22050.0, 1, -1, 8)), ('sndhdr.sndt', ('sndt', 44100, 1, 5, 8)), ('sndhdr.voc', ('voc', 0, 1, -1, 8)), ('sndhdr.wav', ('wav', 44100, 2, -1, 16)), ): filename = findfile(filename, subdir="sndhdrdata") what = sndhdr.what(filename) self.assertNotEqual(what, None, filename) self.assertSequenceEqual(what, expected) if __name__ == '__main__': unittest.main() | def test_data(self): for filename, expected in ( ('sndhdr.8svx', ('8svx', 0, 1, 0, 8)), ('sndhdr.aifc', ('aifc', 44100, 2, 5, 16)), ('sndhdr.aiff', ('aiff', 44100, 2, 5, 16)), ('sndhdr.au', ('au', 44100, 2, 5.0, 16)), ('sndhdr.hcom', ('hcom', 22050.0, 1, -1, 8)), ('sndhdr.sndt', ('sndt', 44100, 1, 5, 8)), ('sndhdr.voc', ('voc', 0, 1, -1, 8)), ('sndhdr.wav', ('wav', 44100, 2, -1, 16)), ): filename = findfile(filename, subdir="sndhdrdata") what = sndhdr.what(filename) self.assertNotEqual(what, None, filename) self.assertSequenceEqual(what, expected) | f8079a1cc2de978790fb258b5d8e0c2be64ec481 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/f8079a1cc2de978790fb258b5d8e0c2be64ec481/test_sndhdr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
892,
12,
2890,
4672,
364,
1544,
16,
2665,
316,
261,
7707,
87,
4880,
16587,
18,
28,
5751,
92,
2187,
7707,
28,
5751,
92,
2187,
374,
16,
404,
16,
374,
16,
1725,
13,
3631,
7707... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
892,
12,
2890,
4672,
364,
1544,
16,
2665,
316,
261,
7707,
87,
4880,
16587,
18,
28,
5751,
92,
2187,
7707,
28,
5751,
92,
2187,
374,
16,
404,
16,
374,
16,
1725,
13,
3631,
7707... | |
def foundService(result): if result is None: | def foundService(service): if service is None: | def foundService(result): if result is None: raise Exception("No Rio Karma device could be found automatically") usn, (host, port) = result keychain.lookup(usn).addCallback( gotPassword, host, port, usn).addErrback( result.errback) | f827156440c723bf6100cdd7e8e74036b26144c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/f827156440c723bf6100cdd7e8e74036b26144c4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1392,
1179,
12,
3278,
4672,
309,
1156,
353,
599,
30,
1002,
1185,
2932,
2279,
534,
1594,
1475,
297,
2540,
2346,
3377,
506,
1392,
6635,
7923,
584,
82,
16,
261,
2564,
16,
1756,
13,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1392,
1179,
12,
3278,
4672,
309,
1156,
353,
599,
30,
1002,
1185,
2932,
2279,
534,
1594,
1475,
297,
2540,
2346,
3377,
506,
1392,
6635,
7923,
584,
82,
16,
261,
2564,
16,
1756,
13,
273,
5... |
ce.setProxy(self.proxy,940) | ce.setProxy( self.proxy, 940 ) | def updatePilotStatus( self ): """ Update status of pilots in transient states """ for queue in self.queueDict: ce = self.queueDict[queue]['CE'] ceName = self.queueDict[queue]['CEName'] queueName = self.queueDict[queue]['QueueName'] result = pilotAgentsDB.selectPilots( {'DestinationSite':ceName, 'Queue':queueName, 'GridType':'DIRAC', 'GridSite':self.siteName, 'Status':TRANSIENT_PILOT_STATUS} ) if not result['OK']: self.log.error( 'Failed to select pilots: %s' % result['Message'] ) continue pilotRefs = result['Value'] if not pilotRefs: continue | e99c1cc388c80826da2da9077d74d2e5b147e592 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/e99c1cc388c80826da2da9077d74d2e5b147e592/SiteDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
52,
22797,
1482,
12,
365,
262,
30,
3536,
2315,
1267,
434,
24970,
6968,
316,
12315,
5493,
3536,
364,
2389,
316,
365,
18,
4000,
5014,
30,
5898,
273,
365,
18,
4000,
5014,
63,
4000,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
52,
22797,
1482,
12,
365,
262,
30,
3536,
2315,
1267,
434,
24970,
6968,
316,
12315,
5493,
3536,
364,
2389,
316,
365,
18,
4000,
5014,
30,
5898,
273,
365,
18,
4000,
5014,
63,
4000,
... |
if config.warn.ignore_bug_before=='None': | if config.warn.ignore_bug_before == 'None': | def warning(*msg): _logger.warning('WARNING theano.configdefaults: '+' '.join(msg)) | 66b759886efb4d5e1e9f87083747433f79ba8a14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/66b759886efb4d5e1e9f87083747433f79ba8a14/configdefaults.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3436,
30857,
3576,
4672,
389,
4901,
18,
8551,
2668,
9511,
326,
31922,
18,
1425,
7606,
30,
10058,
2418,
5701,
12,
3576,
3719,
225,
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,
3436,
30857,
3576,
4672,
389,
4901,
18,
8551,
2668,
9511,
326,
31922,
18,
1425,
7606,
30,
10058,
2418,
5701,
12,
3576,
3719,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
graph = False binned = False | def commands(options, command, args): if command == 'database': if len(args) == 0: raise CommandException import dbinit mydb = dbinit.MyDB(options) if args[0] == 'drop': if len(args) > 2: raise CommandException mydb.admin() mydb.drop() if len(args) == 2 and args[1] == 'init': mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'init': if len(args) > 1: raise CommandException mydb.admin() mydb.create() mydb.connect() mydb.populate() mydb.close() return if args[0] == 'clean': if len(args) > 1: raise CommandException mydb.connect() mydb.clean() return raise CommandException import db, info info.source = db.Database() info.source.host = options.host info.source.db = options.db info.source.passwd = options.passwd info.source.user = options.user info.source.connect() info.source.update_dict(globals()) system = info.source.__dict__[options.system] if type(options.get) is str: info.source.get = options.get if options.runs is None: runs = info.source.allRuns else: rx = re.compile(options.runs) runs = [] for run in info.source.allRuns: if rx.match(run.name): runs.append(run) info.display_run = runs[0].run if command == 'runs': user = None opts, args = getopts(args, '-u') if len(args): raise CommandException for o,a in opts: if o == '-u': user = a info.source.listRuns(user) return if command == 'stats': if len(args) == 0: info.source.listStats() elif len(args) == 1: info.source.listStats(args[0]) else: raise CommandException return if command == 'stat': if len(args) != 1: raise CommandException stats = info.source.getStat(args[0]) for stat in stats: if graph: graphdata(runs, stat.name, stat.name, stat) else: print stat.name printdata(runs, stat) return if command == 'bins': if len(args) == 0: info.source.listBins() elif len(args) == 1: info.source.listBins(args[0]) else: raise CommandException return if command == 'formulas': if len(args) == 0: info.source.listFormulas() elif len(args) == 1: info.source.listFormulas(args[0]) else: raise CommandException return if command == 'samples': if len(args): raise CommandException info.source.listTicks(runs) return if len(args): raise CommandException if command == 'usertime': import copy kernel = copy.copy(system.full_cpu.numCycles) kernel.bins = 'kernel' user = copy.copy(system.full_cpu.numCycles) user.bins = 'user' if graph: graphdata(runs, 'usertime', 'User Fraction', user / system.full_cpu.numCycles) else: printdata(runs, user / system.full_cpu.numCycles) return if command == 'ticks': if binned: print 'kernel ticks' system.full_cpu.numCycles.bins = 'kernel' printdata(runs, system.full_cpu.numCycles) print 'idle ticks' system.full_cpu.numCycles.bins = 'idle' printdata(runs, system.full_cpu.numCycles) print 'user ticks' system.full_cpu.numCycles.bins = 'user' printdata(runs, system.full_cpu.numCycles) print 'total ticks' system.full_cpu.numCycles.bins = None printdata(runs, system.full_cpu.numCycles) return if command == 'packets': packets = system.tsunami.nsgige.rxPackets if graph: graphdata(runs, 'packets', 'Packets', packets) else: printdata(runs, packets) return if command == 'ppt' or command == 'tpp': ppt = system.tsunami.nsgige.rxPackets / sim_ticks printdata(runs, ppt, command == 'tpp') return if command == 'pps': pps = system.tsunami.nsgige.rxPackets / sim_seconds if graph: graphdata(runs, 'pps', 'Packets/s', pps) else: printdata(runs, pps) return if command == 'bpt' or command == 'tpb': bytes = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes bpt = bytes / sim_ticks * 8 if graph: graphdata(runs, 'bpt', 'bps / Hz', bpt) else: printdata(runs, bpt, command == 'tpb') return if command == 'bptb' or command == 'tpbb': bytes = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes print 'kernel stats' bytes.bins = 'kernel' printdata(runs, bytes / ticks) print 'idle stats' bytes.bins = 'idle' printdata(runs, bytes / ticks) print 'user stats' bytes.bins = 'user' printdata(runs, bytes / ticks) return if command == 'bytes': stat = system.tsunami.nsgige.rxBytes + system.tsunami.nsgige.txBytes if binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None printdata(runs, stat) return if command == 'rxbps': gbps = system.tsunami.nsgige.rxBandwidth / 1e9 if graph: graphdata(runs, 'rxbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'txbps': gbps = system.tsunami.nsgige.txBandwidth / 1e9 if graph: graphdata(runs, 'txbps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'bps': rxbps = system.tsunami.nsgige.rxBandwidth txbps = system.tsunami.nsgige.txBandwidth gbps = (rxbps + txbps) / 1e9 if graph: graphdata(runs, 'bps', 'Bandwidth (Gbps)', gbps) else: printdata(runs, gbps) return if command == 'misses': stat = system.L3.overall_mshr_misses if binned: print '%s kernel stats' % stat.name stat.bins = 'kernel' printdata(runs, stat) print '%s idle stats' % stat.name stat.bins = 'idle' printdata(runs, stat) print '%s user stats' % stat.name stat.bins = 'user' printdata(runs, stat) print '%s total stats' % stat.name stat.bins = None if graph: graphdata(runs, 'misses', 'Overall MSHR Misses', stat) else: printdata(runs, stat) return if command == 'mpkb': misses = system.L3.overall_mshr_misses rxbytes = system.tsunami.nsgige.rxBytes txbytes = system.tsunami.nsgige.txBytes if binned: print 'mpkb kernel stats' misses.bins = 'kernel' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb idle stats' misses.bins = 'idle' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb user stats' misses.bins = 'user' mpkb = misses / ((rxbytes + txbytes) / 1024) printdata(runs, mpkb) print 'mpkb total stats' mpkb = misses / ((rxbytes + txbytes) / 1024) misses.bins = None if graph: graphdata(runs, 'mpkb', 'Misses / KB', mpkb) else: printdata(runs, mpkb) return if command == 'execute': printdata(runs, system.full_cpu.ISSUE__count) return if command == 'commit': printdata(runs, system.full_cpu.COM__count) return if command == 'fetch': printdata(runs, system.full_cpu.FETCH__count) return if command == 'rxbpp': bpp = system.tsunami.nsgige.rxBytes / system.tsunami.nsgige.rxPackets printdata(run, 8 * bpp) return if command == 'txbpp': bpp = system.tsunami.nsgige.txBytes / system.tsunami.nsgige.txPackets printdata(run, 8 * bpp) return raise CommandException | 45d1d2b973c623d3e06788c2d890c401bdd01da9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7385/45d1d2b973c623d3e06788c2d890c401bdd01da9/stats.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4364,
12,
2116,
16,
1296,
16,
833,
4672,
309,
1296,
422,
296,
6231,
4278,
309,
562,
12,
1968,
13,
422,
374,
30,
1002,
3498,
503,
225,
1930,
1319,
2738,
3399,
1966,
273,
1319,
2738,
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,
4364,
12,
2116,
16,
1296,
16,
833,
4672,
309,
1296,
422,
296,
6231,
4278,
309,
562,
12,
1968,
13,
422,
374,
30,
1002,
3498,
503,
225,
1930,
1319,
2738,
3399,
1966,
273,
1319,
2738,
18,... | |
actions = ai_tool.listActionInfos(object=self.context,categories=('folder_buttons',)) | actions = ai_tool.listActionInfos(object=self.context, categories=('folder_buttons',)) | def available_actions(self): """ Returns a list of available action ids """ ai_tool = getToolByName(self.context, 'portal_actions') actions = ai_tool.listActionInfos(object=self.context,categories=('folder_buttons',)) available_action_ids = [a['id'] for a in actions if a['available'] and a['visible'] and a['allowed'] ] return available_action_ids | 086c930a95814e0c914242398727cb342087835f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11908/086c930a95814e0c914242398727cb342087835f/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2319,
67,
4905,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
2319,
1301,
3258,
3536,
14679,
67,
6738,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
24386,
67,
4905,
6134,
4209,
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,
2319,
67,
4905,
12,
2890,
4672,
3536,
2860,
279,
666,
434,
2319,
1301,
3258,
3536,
14679,
67,
6738,
273,
336,
6364,
5911,
12,
2890,
18,
2472,
16,
296,
24386,
67,
4905,
6134,
4209,
273,
... |
self._test_files_list = files self._test_files = set(files) | def PrepareListsAndPrintOutput(self): """Create appropriate subsets of test lists and returns a ResultSummary object. Also prints expected test counts.""" | 93ef176c40555a6f3a3895f745a977efe1b5037b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/93ef176c40555a6f3a3895f745a977efe1b5037b/run_webkit_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7730,
7432,
1876,
5108,
1447,
12,
2890,
4672,
3536,
1684,
5505,
30760,
434,
1842,
6035,
471,
1135,
279,
3438,
4733,
733,
18,
8080,
14971,
2665,
1842,
6880,
12123,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
7730,
7432,
1876,
5108,
1447,
12,
2890,
4672,
3536,
1684,
5505,
30760,
434,
1842,
6035,
471,
1135,
279,
3438,
4733,
733,
18,
8080,
14971,
2665,
1842,
6880,
12123,
2,
-100,
-100,
-100,
-100... | |
@run_in_green_thread | def start(self, local_sdp, remote_sdp, stream_index): notification_center = NotificationCenter() try: context = 'sdp_negotiation' self.remote_identity = CPIMIdentity(self.session.remote_identity.uri, self.session.remote_identity.display_name) remote_media = remote_sdp.media[stream_index] remote_accept_types = remote_media.attributes.getfirst('accept-types') # TODO: update accept_types and accept_wrapped_types from remote_media self.cpim_enabled = contains_mime_type(self.accept_types, 'message/cpim') remote_uri_path = remote_media.attributes.getfirst('path') if remote_uri_path is None: raise AttributeError("remote SDP media does not have 'path' attribute") full_remote_path = [parse_uri(uri) for uri in remote_uri_path.split()] context = 'start' self.msrp = self.msrp_connector.complete(full_remote_path) if self.use_msrp_session: self.msrp_session = MSRPSession(self.msrp, accept_types=self.accept_types, on_incoming_cb=self._handle_incoming) self.msrp_connector = None except Exception, ex: ndata = TimestampedNotificationData(context=context, failure=Failure(), reason=str(ex) or type(ex).__name__) notification_center.post_notification('MediaStreamDidFail', self, ndata) else: notification_center.post_notification('MediaStreamDidStart', self, data=TimestampedNotificationData()) | 808885ac10478772e2bfe6de766f17ca0603057a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/808885ac10478772e2bfe6de766f17ca0603057a/msrp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
12,
2890,
16,
1191,
67,
6427,
84,
16,
2632,
67,
6427,
84,
16,
1407,
67,
1615,
4672,
3851,
67,
5693,
273,
8050,
8449,
1435,
775,
30,
819,
273,
296,
6427,
84,
67,
14518,
352,
7072... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1191,
67,
6427,
84,
16,
2632,
67,
6427,
84,
16,
1407,
67,
1615,
4672,
3851,
67,
5693,
273,
8050,
8449,
1435,
775,
30,
819,
273,
296,
6427,
84,
67,
14518,
352,
7072... | |
et = time.time() diff = et - st print >>sys.stderr,"Downloader: got_have_field: took",diff | def got_have_bitfield(self, have): if self.downloader.picker.am_I_complete() and have.complete(): # Arno: If we're both seeds if self.downloader.super_seeding: self.connection.send_bitfield(have.tostring()) # be nice, show you're a seed too self.connection.close() self.downloader.add_disconnected_seed(self.connection.get_readable_id()) return | 522d62ffa5517e5c4a0d1c76bd5093e38b876f79 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/522d62ffa5517e5c4a0d1c76bd5093e38b876f79/Downloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2363,
67,
21516,
67,
3682,
1518,
12,
2890,
16,
1240,
4672,
225,
309,
365,
18,
2378,
6714,
18,
10569,
18,
301,
67,
45,
67,
6226,
1435,
471,
1240,
18,
6226,
13332,
468,
1201,
2135,
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,
2363,
67,
21516,
67,
3682,
1518,
12,
2890,
16,
1240,
4672,
225,
309,
365,
18,
2378,
6714,
18,
10569,
18,
301,
67,
45,
67,
6226,
1435,
471,
1240,
18,
6226,
13332,
468,
1201,
2135,
30,
... | |
def writeable(self, instance, debug=False): | def writeable(self, instance, debug=True): | def writeable(self, instance, debug=False): if 'w' not in self.mode: if debug: log("Tried to update %s:%s but field is not writeable." % \ (instance.portal_type, self.getName())) return False | 7ceff8c470eae33b4a063061230f3f8948cfaf8b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12165/7ceff8c470eae33b4a063061230f3f8948cfaf8b/Field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30223,
12,
2890,
16,
791,
16,
1198,
33,
5510,
4672,
309,
296,
91,
11,
486,
316,
365,
18,
3188,
30,
309,
1198,
30,
613,
2932,
29847,
358,
1089,
738,
87,
5319,
87,
1496,
652,
353,
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,
30223,
12,
2890,
16,
791,
16,
1198,
33,
5510,
4672,
309,
296,
91,
11,
486,
316,
365,
18,
3188,
30,
309,
1198,
30,
613,
2932,
29847,
358,
1089,
738,
87,
5319,
87,
1496,
652,
353,
486,... |
s = mdns_tool.service(snTemplate % i, "local", "_newservice._tcp", 100, hnTemplate % i, ipaddr="5.5.5.%d" % i) s.publish() output = "DISCOVERED: " + snTemplate % i + "." + fqst + \ ". at 5.5.5.%d:100 ()" % i | [s, output] = self.newLocalService(snTemplate % i, st, domain, port, hnTemplate % i, ipTemplate % i) | def test_DiscoverMultipleServices(self): snTemplate = "My New Service %d" hnTemplate = "newnode-%d" fqst = "_newservice._tcp.local" | 69206d7a7a498cea8a3c057a19f26483bf5732db /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9489/69206d7a7a498cea8a3c057a19f26483bf5732db/test_mdns.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26082,
8438,
5676,
12,
2890,
4672,
4556,
2283,
273,
315,
12062,
1166,
1956,
738,
72,
6,
366,
82,
2283,
273,
315,
2704,
2159,
6456,
72,
6,
8508,
334,
273,
4192,
2704,
3278,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
26082,
8438,
5676,
12,
2890,
4672,
4556,
2283,
273,
315,
12062,
1166,
1956,
738,
72,
6,
366,
82,
2283,
273,
315,
2704,
2159,
6456,
72,
6,
8508,
334,
273,
4192,
2704,
3278,
63... |
self.document = url or "unknown" | self.url = url or "unknown" | def __init__ (self, rules, url, **opts): if wc.config['showerrors']: self.error = self._error self.warning = self._warning self.fatalError = self._fatalError HtmlParser.__init__(self) self.rules = rules self.comments = opts['comments'] self.javascript = opts['javascript'] self.data = [] self.rulestack = [] self.buffer = [] self.document = url or "unknown" if self.javascript: self.jsEnv = jslib.new_jsenv() self.popup_counter = 0 | 48f4bfe5083772710aa5a3dfced631a192a1eb57 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/48f4bfe5083772710aa5a3dfced631a192a1eb57/Rewriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
2931,
16,
880,
16,
2826,
4952,
4672,
309,
14310,
18,
1425,
3292,
4500,
4324,
3546,
30,
365,
18,
1636,
273,
365,
6315,
1636,
365,
18,
8551,
273,
365,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
16,
2931,
16,
880,
16,
2826,
4952,
4672,
309,
14310,
18,
1425,
3292,
4500,
4324,
3546,
30,
365,
18,
1636,
273,
365,
6315,
1636,
365,
18,
8551,
273,
365,
631... |
return channel in network.channels | return bool(getchan(network, channel)) | def ischan(network, channel): return channel in network.channels | 507a4f6d59b0605bdcef8ff21242050428040a4a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10693/507a4f6d59b0605bdcef8ff21242050428040a4a/chaninfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
7472,
12,
5185,
16,
1904,
4672,
327,
1426,
12,
588,
7472,
12,
5185,
16,
1904,
3719,
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,... | [
1,
1,
1,
1,
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,
353,
7472,
12,
5185,
16,
1904,
4672,
327,
1426,
12,
588,
7472,
12,
5185,
16,
1904,
3719,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
start_time=max(0,self.view.timelog.tick_count-self.view.timelog.tick_limit+1)*self.view.dt | start_index=max(0,self.view.timelog.tick_count-self.view.timelog.tick_limit+1) count=min(self.view.timelog.tick_limit,self.view.timelog.tick_count) start_time=start_index*self.view.dt | def extract_data(self): tau=float(self.filter.value) dt=self.view.dt if tau<dt: dt_tau=None else: dt_tau=dt/tau decimals=int(self.decimals.value) format='%%1.%df'%decimals start_time=max(0,self.view.timelog.tick_count-self.view.timelog.tick_limit+1)*self.view.dt data=[] title=['t'] for key,watch in self.view.watcher.active.items(): name,func,args=key d=watch.get(dt_tau=dt_tau) n=len(watch.get_first()) while len(data)<len(d): data.append(['%0.4f'%(start_time+(len(data)+0)*self.view.dt)]) for i in range(n): title.append('%s.%s%s[%d]'%(name,func.__name__,args,i)) for j in range(len(d)): dd=d[j] if dd is None: data[j].append(None) else: data[j].append(format%dd[i]) return data,title | a7c749f4cf1e3182248cccd1cf7c2dbf0435d002 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9336/a7c749f4cf1e3182248cccd1cf7c2dbf0435d002/data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
892,
12,
2890,
4672,
225,
12284,
33,
5659,
12,
2890,
18,
2188,
18,
1132,
13,
3681,
33,
2890,
18,
1945,
18,
7510,
309,
12284,
32,
7510,
30,
3681,
67,
29908,
33,
7036,
469,
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,
2608,
67,
892,
12,
2890,
4672,
225,
12284,
33,
5659,
12,
2890,
18,
2188,
18,
1132,
13,
3681,
33,
2890,
18,
1945,
18,
7510,
309,
12284,
32,
7510,
30,
3681,
67,
29908,
33,
7036,
469,
3... |
def make_module_from_c(pyxfile): | def make_module_from_c(cfile): | def make_module_from_c(pyxfile): from distutils.core import setup from distutils.extension import Extension from Pyrex.Distutils import build_ext #try: # from distutils.log import set_threshold # set_threshold(10000) #except ImportError: # print "ERROR IMPORTING" # pass dirpath = pyxfile.dirpath() lastdir = path.local() os.chdir(str(dirpath)) try: modname = pyxfile.get('purebasename') if debug: print "modname", modname c = stdoutcapture.Capture(mixed_out_err = True) try: try: setup( name = "testmodules", ext_modules=[ Extension(modname, [str(pyxfile)]) ], cmdclass = {'build_ext': build_ext}, script_name = 'setup.py', script_args = ['-q', 'build_ext', '--inplace'] #script_args = ['build_ext', '--inplace'] ) finally: foutput, foutput = c.done() except: print foutput.read() raise # XXX do we need to do some check on fout/ferr? # XXX not a nice way to import a module if debug: print "inserting path to sys.path", dirpath sys.path.insert(0, '.') if debug: print "import %(modname)s as testmodule" % locals() exec "import %(modname)s as testmodule" % locals() sys.path.pop(0) finally: os.chdir(str(lastdir)) #if not debug: #dirpath.rmtree() return testmodule | 7af1a34ef0fb9f9c6378f37b418b678b2abd19c9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/7af1a34ef0fb9f9c6378f37b418b678b2abd19c9/buildpyxmodule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2978,
67,
2080,
67,
71,
12,
71,
768,
4672,
628,
2411,
5471,
18,
3644,
1930,
3875,
628,
2411,
5471,
18,
6447,
1930,
10021,
628,
4707,
266,
92,
18,
5133,
5471,
1930,
1361,
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,
2978,
67,
2080,
67,
71,
12,
71,
768,
4672,
628,
2411,
5471,
18,
3644,
1930,
3875,
628,
2411,
5471,
18,
6447,
1930,
10021,
628,
4707,
266,
92,
18,
5133,
5471,
1930,
1361,
67,
... |
from quippy.progbar import ProgressBar pb = ProgressBar(0,len(frange(*opt.range.indices(len(all_configs)))),80,showValue=True) for i, at in fenumerate(itertools.islice(all_configs, opt.range.start+1, opt.range.stop, opt.range.step)): | if got_length: from quippy.progbar import ProgressBar pb = ProgressBar(0,len(frange(*opt.range.indices(len(all_configs)))),80,showValue=True) for i, at in fenumerate(itertools.islice(all_configs, opt.range.start-1, opt.range.stop, opt.range.step)): | def process(at): # Override lattice if opt.lattice is not None: at.set_lattice(opt.lattice) # Filter parameters if opt.params is not None: for k in at.params.keys(): k = k.lower() if not k in opt.params: del at.params[k] # Merge from merge_config if opt.merge: for k in opt.merge_properties: # specify property type explicity - needed because of NumPy ambiguity between logical and integer at.add_property(k, getattr(merge_config, k), property_type=merge_config.properties[k][1]) # Execute user code if opt.exec_code is not None: exec(opt.exec_code) # Do the writing if outfile is not None: if opt.properties is None: outfile.write(at) else: # Convert from frac_pos to pos if 'frac_pos' in opt.properties and not at.has_property('frac_pos'): at.add_property('frac_pos', 0.0, n_cols=3) at.frac_pos[:] = dot(at.g, at.pos) # or vice-versa if 'pos' in opt.properties and not at.has_property('pos'): at.add_property('pos', 0.0, n_cols=3) at.pos[:] = dot(at.lattice, at.frac_pos) try: # Try to do the filtering at the writing stage outfile.write(at, properties=opt.properties) except TypeError: p.error('Cannot specify property filtering when writing to file "%s"' % outfile) | b03c761e4b0456ba9ccb516b971ed5e762269acb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/b03c761e4b0456ba9ccb516b971ed5e762269acb/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
270,
4672,
468,
1439,
16690,
309,
2153,
18,
80,
24966,
353,
486,
599,
30,
622,
18,
542,
67,
80,
24966,
12,
3838,
18,
80,
24966,
13,
225,
468,
4008,
1472,
309,
2153,
18,
201... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
270,
4672,
468,
1439,
16690,
309,
2153,
18,
80,
24966,
353,
486,
599,
30,
622,
18,
542,
67,
80,
24966,
12,
3838,
18,
80,
24966,
13,
225,
468,
4008,
1472,
309,
2153,
18,
201... |
if p != [1, 2, 3]: | if p != [1, 3, 2]: | def iterator(self): """ EXAMPLES: sage: Permutations(3, avoiding=[1,3,2]).list() # indirect doctest [[1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]] sage: Permutations(4, avoiding=[1,3,2]).list() [[4, 1, 3, 2], [4, 2, 1, 3], [4, 2, 3, 1], [4, 3, 1, 2], [4, 3, 2, 1], [3, 4, 1, 2], [3, 4, 2, 1], [2, 3, 4, 1], [3, 2, 4, 1], [1, 3, 2, 4], [2, 1, 3, 4], [2, 3, 1, 4], [3, 1, 2, 4], [3, 2, 1, 4]] | 17bf5478c8a20e2689ed54e70c90d7ab7bf08eae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/17bf5478c8a20e2689ed54e70c90d7ab7bf08eae/permutation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
13813,
22190,
12,
23,
16,
4543,
310,
22850,
21,
16,
23,
16,
22,
65,
2934,
1098,
1435,
468,
16807,
31263,
395,
12167,
21... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2775,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
13813,
22190,
12,
23,
16,
4543,
310,
22850,
21,
16,
23,
16,
22,
65,
2934,
1098,
1435,
468,
16807,
31263,
395,
12167,
21... |
telts = range(len(self.tabrows[row]) - 1, -1, -1) | telts = range(len(self.tabrows[self.currows[row]]) - 1, -1, -1) | def layoutTabs(self): if self.count() < 1: return | 76d9ea2f2340e175f4f7bdb5d591f85dd51e962a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/76d9ea2f2340e175f4f7bdb5d591f85dd51e962a/MultiTabBar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3511,
17348,
12,
2890,
4672,
309,
365,
18,
1883,
1435,
411,
404,
30,
327,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3511,
17348,
12,
2890,
4672,
309,
365,
18,
1883,
1435,
411,
404,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
""" fl_create_xyplot(t, x, y, w, h, label) -> object """ | """ fl_create_xyplot(t, x, y, w, h, label) -> pObject """ | def fl_create_xyplot(t, x, y, w, h, label): """ fl_create_xyplot(t, x, y, w, h, label) -> object """ retval = _fl_create_xyplot(t, x, y, w, h, label) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
2640,
67,
1698,
4032,
12,
88,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
1698,
4032,
12,
88,
16,
619,
16,
677,
16,
341,
16,
366,
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,
1183,
67,
2640,
67,
1698,
4032,
12,
88,
16,
619,
16,
677,
16,
341,
16,
366,
16,
1433,
4672,
3536,
1183,
67,
2640,
67,
1698,
4032,
12,
88,
16,
619,
16,
677,
16,
341,
16,
366,
16,
... |
cs = cs + ", " connection_string = cs[:-2] + ")" try: TOPSerial = eval(connection_string) except serial.SerialException, detail: e = ErrorDialog(self.myParent, detail) else: TOPSerial.open() d = ConnectDialog(self.myParent, connection_string) n = TOPSerial.inWaiting() result = TOPSerial.read(n) sleep(0.1) | from graphics import tops_graphs | def connect_action(self, event): chosen_model = self.optionMODEL_value.get() chosen_port = self.option1_value.get() if chosen_model == 'Custom': # FIXME : convert this section to the new Connector API. # No more string construction! cs = "serial.Serial(" for k,v in self.options.items(): print k,v n, t = v cs = cs + "%s = " %k if t == 'str': cs = cs + "'" + eval("self.option%s_value.get()" %n) + "'" elif t == 'int': try: int(eval("self.option%s_value.get()" %n)) except ValueError: cs = cs + "None" else: cs = cs + str(int(eval("self.option%s_value.get()" %n))) elif t == 'bool': cs = cs + str(bool(eval("self.option%s_value.get()" %n))) cs = cs + ", " connection_string = cs[:-2] + ")" # remove last ", " try: TOPSerial = eval(connection_string) except serial.SerialException, detail: e = ErrorDialog(self.myParent, detail) else: TOPSerial.open() d = ConnectDialog(self.myParent, connection_string) n = TOPSerial.inWaiting() result = TOPSerial.read(n) sleep(0.1) # prevent full buffer effect while TOPSerial.inWaiting() > 0: result = result + TOPSerial.read(TOPSerial.inWaiting()) sleep(0.1) self.replace_text(result) else: module = models.models[chosen_model] exec('from models.%s import ModelConnector' % module) mc = ModelConnector(chosen_port) try: mc.open() except serial.SerialException, detail: e = ErrorDialog(self.myParent, detail) else: d = ConnectDialog(self.myParent, mc) result = mc.download() self.replace_text(result) | 135d939c78bc39bb12402ac629e370f6612c2e2d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5205/135d939c78bc39bb12402ac629e370f6612c2e2d/tkops.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
67,
1128,
12,
2890,
16,
871,
4672,
225,
10447,
67,
2284,
273,
365,
18,
3482,
17391,
67,
1132,
18,
588,
1435,
10447,
67,
655,
273,
365,
18,
3482,
21,
67,
1132,
18,
588,
1435,
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,
3077,
67,
1128,
12,
2890,
16,
871,
4672,
225,
10447,
67,
2284,
273,
365,
18,
3482,
17391,
67,
1132,
18,
588,
1435,
10447,
67,
655,
273,
365,
18,
3482,
21,
67,
1132,
18,
588,
1435,
22... |
config_file_list = ["address_pools.cfg", "build.cfg", "cdkeys.cfg", "tests_base.cfg", "tests.cfg", "unittests.cfg"] | config_file_list = ["build.cfg", "cdkeys.cfg", "tests_base.cfg", "tests.cfg", "unittests.cfg"] | def check_iso(url, destination, hash): """ Verifies if ISO that can be find on url is on destination with right hash. This function will verify the SHA1 hash of the ISO image. If the file turns out to be missing or corrupted, let the user know we can download it. @param url: URL where the ISO file can be found. @param destination: Directory in local disk where we'd like the iso to be. @param hash: SHA1 hash for the ISO image. """ logging.info("Verifying iso %s", os.path.basename(url)) if not destination: os.makedirs(destination) iso_path = os.path.join(destination, os.path.basename(url)) if not os.path.isfile(iso_path) or ( utils.hash_file(iso_path, method="sha1") != hash): logging.warning("%s not found or corrupted", iso_path) logging.warning("Would you like to download it? (y/n)") iso_download = raw_input() if iso_download == 'y': utils.unmap_url_cache(destination, url, hash, method="sha1") else: logging.warning("Missing file %s. Please download it", iso_path) else: logging.debug("%s present, with proper checksum", iso_path) | 5caaf13aff2ddd91838e74c0ad4c846788c2c242 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/5caaf13aff2ddd91838e74c0ad4c846788c2c242/get_started.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9699,
12,
718,
16,
2929,
16,
1651,
4672,
3536,
6160,
5032,
309,
9351,
716,
848,
506,
1104,
603,
880,
353,
603,
2929,
598,
2145,
1651,
18,
225,
1220,
445,
903,
3929,
326,
9777,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9699,
12,
718,
16,
2929,
16,
1651,
4672,
3536,
6160,
5032,
309,
9351,
716,
848,
506,
1104,
603,
880,
353,
603,
2929,
598,
2145,
1651,
18,
225,
1220,
445,
903,
3929,
326,
9777,... |
return self._action(*troveSetList, ActionClass = GroupUnionAction) | return self._action(ActionClass = GroupUnionAction, *troveSetList) | def union(self, *troveSetList): return self._action(*troveSetList, ActionClass = GroupUnionAction) | d5cd416fce497abb2065fa1182b9d65b8242d794 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8747/d5cd416fce497abb2065fa1182b9d65b8242d794/groupsetrecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7812,
12,
2890,
16,
380,
88,
303,
537,
694,
682,
4672,
327,
365,
6315,
1128,
30857,
88,
303,
537,
694,
682,
16,
4382,
797,
273,
3756,
14325,
1803,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7812,
12,
2890,
16,
380,
88,
303,
537,
694,
682,
4672,
327,
365,
6315,
1128,
30857,
88,
303,
537,
694,
682,
16,
4382,
797,
273,
3756,
14325,
1803,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
paths = self.get_paths_for_node(tid) | if self.is_displayed(tid): paths = self.get_paths_for_node(tid) else: paths = None | def __update_node(self,tid,inroot): if tid not in self.node_to_remove: todis = self.__is_displayed(tid) curdis = self.is_displayed(tid) if todis: #if the task was not displayed previously but now should #we add it. if not curdis: | c0223bac1ad93ec020e7e0aef0dbef46537fbafb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/c0223bac1ad93ec020e7e0aef0dbef46537fbafb/filteredtree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2725,
67,
2159,
12,
2890,
16,
18081,
16,
267,
3085,
4672,
309,
11594,
486,
316,
365,
18,
2159,
67,
869,
67,
4479,
30,
358,
2251,
273,
365,
16186,
291,
67,
5417,
329,
12,
18081,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
67,
2159,
12,
2890,
16,
18081,
16,
267,
3085,
4672,
309,
11594,
486,
316,
365,
18,
2159,
67,
869,
67,
4479,
30,
358,
2251,
273,
365,
16186,
291,
67,
5417,
329,
12,
18081,
... |
self._out.write('<' + name) | self._write('<' + name) | def startElement(self, name, attrs): self._out.write('<' + name) for (name, value) in attrs.items(): self._out.write(' %s=%s' % (name, quoteattr(value))) self._out.write('>') | cb328763261cc3b346c08d4105ffc5bb02350316 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/cb328763261cc3b346c08d4105ffc5bb02350316/saxutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13591,
12,
2890,
16,
508,
16,
3422,
4672,
365,
6315,
2626,
2668,
32,
11,
397,
508,
13,
364,
261,
529,
16,
460,
13,
316,
3422,
18,
3319,
13332,
365,
6315,
659,
18,
2626,
2668,
738,
87... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13591,
12,
2890,
16,
508,
16,
3422,
4672,
365,
6315,
2626,
2668,
32,
11,
397,
508,
13,
364,
261,
529,
16,
460,
13,
316,
3422,
18,
3319,
13332,
365,
6315,
659,
18,
2626,
2668,
738,
87... |
def SetHeight( self, value ) : | def SetHeight(self, value): | def SetHeight( self, value ) : self.Height = value return self | 13865299ef9bc077be9a5eaa4326b7a30307d828 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3330/13865299ef9bc077be9a5eaa4326b7a30307d828/PropertySets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
2686,
12,
2890,
16,
460,
4672,
365,
18,
2686,
273,
460,
327,
365,
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,
1000,
2686,
12,
2890,
16,
460,
4672,
365,
18,
2686,
273,
460,
327,
365,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
for f in os.listdir("."): | for f in os.listdir(dir): | def do_clobber(dryrun=False, skip=None): try: for f in os.listdir("."): if skip is not None and f in skip: print "Skipping", f continue clobber_path=f+clobber_suffix if os.path.isfile(f): print "Removing", f if not dryrun: if os.path.exists(clobber_path): os.unlink(clobber_path) # Prevent repeated moving. if f.endswith(clobber_suffix): os.unlink(f) else: shutil.move(f, clobber_path) os.unlink(clobber_path) elif os.path.isdir(f): print "Removing %s/" % f if not dryrun: if os.path.exists(clobber_path): rmdirRecursive(clobber_path) # Prevent repeated moving. if f.endswith(clobber_suffix): rmdirRecursive(f) else: shutil.move(f, clobber_path) rmdirRecursive(clobber_path) except: print "Couldn't clobber properly, bailing out." sys.exit(1) | 8fd578291b3c8fddba8b901618c3aefa4752040a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6206/8fd578291b3c8fddba8b901618c3aefa4752040a/clobberer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
71,
1295,
744,
12,
25011,
2681,
33,
8381,
16,
2488,
33,
7036,
4672,
775,
30,
364,
284,
316,
1140,
18,
1098,
1214,
12,
1214,
4672,
309,
2488,
353,
486,
599,
471,
284,
316,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
71,
1295,
744,
12,
25011,
2681,
33,
8381,
16,
2488,
33,
7036,
4672,
775,
30,
364,
284,
316,
1140,
18,
1098,
1214,
12,
1214,
4672,
309,
2488,
353,
486,
599,
471,
284,
316,
24... |
new = T.fill(out, elem_op(new)) if new.broadcastable != out.broadcastable: dlen = len(new.broadcastable) - len(out.broadcastable) if dlen > 0: dimshuffle_op = T.DimShuffle(new.broadcastable, range(dlen, len(new.broadcastable))) new = dimshuffle_op(new) elif dlen < 0: dimshuffle_op = T.DimShuffle(new.broadcastable, ['x' for x in range(-dlen)] + range(0, len(new.broadcastable))) new = dimshuffle_op(new) | new = elem_op(new) if new.type.broadcastable != out.type.broadcastable: new = T.fill(out, new) | def same(x, y): return len(x) == len(y) and all(N.all(xe == ye) for xe, ye in zip(x, y)) | 24718ae9ce5c05062fc4d4123c55a3a39126ca69 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/24718ae9ce5c05062fc4d4123c55a3a39126ca69/opt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1967,
12,
92,
16,
677,
4672,
327,
562,
12,
92,
13,
422,
562,
12,
93,
13,
471,
777,
12,
50,
18,
454,
12,
6554,
422,
677,
73,
13,
364,
20517,
16,
677,
73,
316,
3144,
12,
92,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1967,
12,
92,
16,
677,
4672,
327,
562,
12,
92,
13,
422,
562,
12,
93,
13,
471,
777,
12,
50,
18,
454,
12,
6554,
422,
677,
73,
13,
364,
20517,
16,
677,
73,
316,
3144,
12,
92,
16,
... |
library_dirs=dblib_dir, | library_dirs=[dblib_dir], | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 6c8af65295229596ada11221e47a0cd074a5df45 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/6c8af65295229596ada11221e47a0cd074a5df45/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
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,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
self.publicinterface = schema_raw_data.pop('publicinterface', 0) self.createPublicInterface() | self.custom_index = schema_raw_data.pop('custom_index', '') | def manageProperties(self, REQUEST=None, **kwargs): """ """ if not self.checkPermissionEditObject(): raise EXCEPTION_NOTAUTHORIZED, EXCEPTION_NOTAUTHORIZED_MSG | 14baf7f5c127930c02d506ef08b88f4dcba64523 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/14baf7f5c127930c02d506ef08b88f4dcba64523/meeting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
2297,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
3536,
309,
486,
365,
18,
1893,
5041,
4666,
921,
13332,
1002,
23136,
67,
4400,
28383,
16,
23136,
67,
4400,
28383,
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,
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,
10680,
2297,
12,
2890,
16,
12492,
33,
7036,
16,
2826,
4333,
4672,
3536,
3536,
309,
486,
365,
18,
1893,
5041,
4666,
921,
13332,
1002,
23136,
67,
4400,
28383,
16,
23136,
67,
4400,
28383,
6... |
while gtk.events_pending(): gtk.main_iteration() | def withdraw_app_toggle(self, action): if self.ignore_toggle_signal: return self.ignore_toggle_signal = True if self.UIManager.get_widget('/traymenu/showmenu').get_active() == True: self.withdraw_app_undo() else: self.withdraw_app() while gtk.events_pending(): gtk.main_iteration() gobject.timeout_add(500, self.set_ignore_toggle_signal_false) | f5b353702ccfc2d586824eb85ea9fc31cc8d745e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/f5b353702ccfc2d586824eb85ea9fc31cc8d745e/sonata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
598,
9446,
67,
2910,
67,
14401,
12,
2890,
16,
1301,
4672,
309,
365,
18,
6185,
67,
14401,
67,
10420,
30,
327,
365,
18,
6185,
67,
14401,
67,
10420,
273,
1053,
309,
365,
18,
5370,
1318,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
598,
9446,
67,
2910,
67,
14401,
12,
2890,
16,
1301,
4672,
309,
365,
18,
6185,
67,
14401,
67,
10420,
30,
327,
365,
18,
6185,
67,
14401,
67,
10420,
273,
1053,
309,
365,
18,
5370,
1318,
... | |
vetoParentDags = None, vetoCat = 3): | vetoParentDags = None, vetoCat = 3, ifos = []): | def injZeroSlidePlots(dag, plotDir, config, logPath, injectionSuffix, zerolagSuffix, slideSuffix, cacheFile, doDagCategories, parentDags = None, vetoParentDags = None, vetoCat = 3): """ set up plots for injections, zero lag and time slides dag = the dag plotDir = directory in to set up plots config = config file logPath = location where log files will be written injectionSuffix = the string to restrict to for injections zerolagSuffix = the string to restrict to for zero lag slideSuffix = the string to restrict to for time slides cacheFile = the input cache file for plotting doCategories = dag categories turned on parentDags = the name of the parent dag to add vetoParentDags = the name of the veto parent dag to add vetoCat = veto category """ # first stage plotcp = copy.deepcopy(config) plotcp.add_section("plot-arguments") plotcp.set("plot-arguments","plotinspinj","") plotcp.set("plot-arguments","plotinjnum","") plotcp.set("plot-arguments","plotinspmissed","") plotcp.set("plot-arguments","ploteffdistcut","") plotcp.set("plot-arguments","write-script","") injPlotNode = plot_setup( plotDir, \ plotcp, logPath, "first", injectionSuffix, zerolagSuffix, \ slideSuffix, injectionSuffix, cacheFile, injectionSuffix ) if doDagCategories: injPlotNode.set_category('plotting') dag.add_node(injPlotNode) if parentDags: for thisDag in parentDags: injPlotNode.add_parent(thisDag) # second stage vetoString = "_CAT_" + str(vetoCat) + "_VETO" plotcp = copy.deepcopy(config) plotcp.add_section("plot-arguments") plotcp.set("plot-arguments","plotinspinj","") plotcp.set("plot-arguments","plotsnrchi","") plotcp.set("plot-arguments","plotethinca","") plotcp.set("plot-arguments","plotinjnum","") plotcp.set("plot-arguments","plotinspmissed","") plotcp.set("plot-arguments","plotinspfound","") plotcp.set("plot-arguments","plotcoincmissed","") plotcp.set("plot-arguments","ploteffdistcut","") plotcp.set("plot-arguments","write-script","") injPlotVetoNode = plot_setup( plotDir, \ plotcp, logPath, "second", injectionSuffix + vetoString, \ zerolagSuffix + vetoString, slideSuffix + vetoString, \ injectionSuffix + vetoString, cacheFile, injectionSuffix, \ tag=vetoString[1:]) if doDagCategories: injPlotVetoNode.set_category('plotting') dag.add_node(injPlotVetoNode) if parentDags: for thisDag in parentDags: injPlotVetoNode.add_parent(thisDag) if vetoParentDags: for thisDag in vetoParentDags: injPlotVetoNode.add_parent(thisDag) if not doDagCategories: injPlotVetoNode.add_parent(injPlotNode) return dag | fc357fee84a913444239d3b3d8829e5f036f7cd4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5758/fc357fee84a913444239d3b3d8829e5f036f7cd4/inspiralutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
78,
7170,
21068,
29311,
12,
30204,
16,
3207,
1621,
16,
642,
16,
613,
743,
16,
10380,
5791,
16,
24910,
355,
346,
5791,
16,
12701,
5791,
16,
18748,
16,
741,
40,
346,
10487,
16,
982,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
316,
78,
7170,
21068,
29311,
12,
30204,
16,
3207,
1621,
16,
642,
16,
613,
743,
16,
10380,
5791,
16,
24910,
355,
346,
5791,
16,
12701,
5791,
16,
18748,
16,
741,
40,
346,
10487,
16,
982,... |
result = [] result.append("{") result.append("\"id\": %s," % addQuotes(job.fqid)) result.append("\"status\": %s," % addQuotes(job.status)) result.append("\"name\": %s," % addQuotes(job.name)) result.append("\"application\": %s," % addQuotes(job.application.__class__.__name__)) result.append("\"backend\": %s," % addQuotes(job.backend.__class__.__name__) ) result.append("\"subjobs\": %s," % addQuotes(str(len(job.subjobs)))) result.append("\"inputdir\": %s," % addQuotes(job.inputdir)) result.append("\"outputdir\": %s," % addQuotes(job.outputdir)) result.append("\"uuid\": %s," % addQuotes(job.info.uuid)) result.append("\"submitted\": %s," % addQuotes(str(len(job.subjobs.select(status='submitted'))))) result.append("\"running\": %s," % addQuotes(str(len(job.subjobs.select(status='running'))))) result.append("\"completed\": %s," % addQuotes(str(len(job.subjobs.select(status='completed'))))) result.append("\"failed\": %s," % addQuotes(str(len(job.subjobs.select(status='failed'))))) result.append("\"actualCE\": %s" % addQuotes(job.backend.actualCE)) result.append("}") return "".join(result) | undefinedAttribute = 'UNDEFINED' try: result = [] result.append("{") result.append("\"id\": %s," % addQuotes(job.fqid)) result.append("\"status\": %s," % addQuotes(job.status)) result.append("\"name\": %s," % addQuotes(job.name)) result.append("\"application\": %s," % addQuotes(job.application.__class__.__name__)) result.append("\"backend\": %s," % addQuotes(job.backend.__class__.__name__)) result.append("\"subjobs\": %s," % addQuotes(str(len(job.subjobs)))) result.append("\"inputdir\": %s," % addQuotes(job.inputdir)) result.append("\"outputdir\": %s," % addQuotes(job.outputdir)) result.append("\"uuid\": %s," % addQuotes(job.info.uuid)) result.append("\"submitted\": %s," % addQuotes(str(len(job.subjobs.select(status='submitted'))))) result.append("\"running\": %s," % addQuotes(str(len(job.subjobs.select(status='running'))))) result.append("\"completed\": %s," % addQuotes(str(len(job.subjobs.select(status='completed'))))) result.append("\"failed\": %s," % addQuotes(str(len(job.subjobs.select(status='failed'))))) try: result.append("\"actualCE\": %s" % addQuotes(job.backend.actualCE)) except AttributeError: result.append("\"actualCE\": %s" % addQuotes(undefinedAttribute)) result.append("}") return "".join(result) except RegistryKeyError: return "" | def get_job_JSON(job): result = [] result.append("{") result.append("\"id\": %s," % addQuotes(job.fqid)) result.append("\"status\": %s," % addQuotes(job.status)) result.append("\"name\": %s," % addQuotes(job.name)) result.append("\"application\": %s," % addQuotes(job.application.__class__.__name__)) result.append("\"backend\": %s," % addQuotes(job.backend.__class__.__name__) ) result.append("\"subjobs\": %s," % addQuotes(str(len(job.subjobs)))) #test for expandable data result.append("\"inputdir\": %s," % addQuotes(job.inputdir)) result.append("\"outputdir\": %s," % addQuotes(job.outputdir)) result.append("\"uuid\": %s," % addQuotes(job.info.uuid)) result.append("\"submitted\": %s," % addQuotes(str(len(job.subjobs.select(status='submitted'))))) result.append("\"running\": %s," % addQuotes(str(len(job.subjobs.select(status='running'))))) result.append("\"completed\": %s," % addQuotes(str(len(job.subjobs.select(status='completed'))))) result.append("\"failed\": %s," % addQuotes(str(len(job.subjobs.select(status='failed'))))) result.append("\"actualCE\": %s" % addQuotes(job.backend.actualCE)) result.append("}") return "".join(result) | 51a04e9e54c12d73f2d42a7bbc5ba23cb2ae8076 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/51a04e9e54c12d73f2d42a7bbc5ba23cb2ae8076/http_server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4688,
67,
2986,
12,
4688,
4672,
225,
563,
273,
5378,
563,
18,
6923,
2932,
95,
7923,
225,
563,
18,
6923,
2932,
2412,
350,
21392,
738,
87,
10837,
738,
527,
14292,
12,
4688,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4688,
67,
2986,
12,
4688,
4672,
225,
563,
273,
5378,
563,
18,
6923,
2932,
95,
7923,
225,
563,
18,
6923,
2932,
2412,
350,
21392,
738,
87,
10837,
738,
527,
14292,
12,
4688,
18,
... |
def verbosity_constraints(self): self.quiet = self.configbool('ui', 'quiet') self.verbose = self.configbool('ui', 'verbose') self.debugflag = self.configbool('ui', 'debug') if self.debugflag: self.verbose = True self.quiet = False elif self.verbose and self.quiet: self.quiet = self.verbose = False | def verbosity_constraints(self): self.quiet = self.configbool('ui', 'quiet') self.verbose = self.configbool('ui', 'verbose') self.debugflag = self.configbool('ui', 'debug') | 6c602d5bec0d6980478a19db42a28096c1f3c77a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/6c602d5bec0d6980478a19db42a28096c1f3c77a/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11561,
67,
11967,
12,
2890,
4672,
365,
18,
20380,
273,
365,
18,
1425,
6430,
2668,
4881,
2187,
296,
20380,
6134,
365,
18,
11369,
273,
365,
18,
1425,
6430,
2668,
4881,
2187,
296,
11369,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11561,
67,
11967,
12,
2890,
4672,
365,
18,
20380,
273,
365,
18,
1425,
6430,
2668,
4881,
2187,
296,
20380,
6134,
365,
18,
11369,
273,
365,
18,
1425,
6430,
2668,
4881,
2187,
296,
11369,
61... | |
head, tail = os.path.split(self.file) head, tail = head.lower(), tail.lower() | head, tail = os.path.split(self.file) head, tail = head.lower(), tail.lower() | def isAlive(self): """Returns true if the editor process is still alive""" | 85567b5032906a9f5419c63c9bb39d6dd7ce0f1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/85567b5032906a9f5419c63c9bb39d6dd7ce0f1b/winword.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
10608,
12,
2890,
4672,
3536,
1356,
638,
309,
326,
4858,
1207,
353,
4859,
13714,
8395,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
10608,
12,
2890,
4672,
3536,
1356,
638,
309,
326,
4858,
1207,
353,
4859,
13714,
8395,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
i = self.f.items() | i = iter(self.f.items()) | def test_for_cursor_memleak(self): if not hasattr(self.f, 'iteritems'): return | 5b8d24a7f74ce799efc4d77cf58d8e496635ef0d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/5b8d24a7f74ce799efc4d77cf58d8e496635ef0d/test_bsddb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
67,
9216,
67,
3917,
298,
581,
12,
2890,
4672,
309,
486,
3859,
12,
2890,
18,
74,
16,
296,
2165,
3319,
11,
4672,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1884,
67,
9216,
67,
3917,
298,
581,
12,
2890,
4672,
309,
486,
3859,
12,
2890,
18,
74,
16,
296,
2165,
3319,
11,
4672,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print s | if self.options.debug: print s | def do_new(self, subcmd, opts): """${cmd_name}: insert a new mirror into the database | 6bc2b0a10e217e256f03671d7c9a3bb0782e1ed1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3890/6bc2b0a10e217e256f03671d7c9a3bb0782e1ed1/mirrordoctor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2704,
12,
2890,
16,
720,
4172,
16,
1500,
4672,
3536,
18498,
4172,
67,
529,
6713,
2243,
279,
394,
15593,
1368,
326,
2063,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2704,
12,
2890,
16,
720,
4172,
16,
1500,
4672,
3536,
18498,
4172,
67,
529,
6713,
2243,
279,
394,
15593,
1368,
326,
2063,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ts = TicketSystem(self.env) self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'new'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'assigned'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'accepted'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'reopened'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'closed'})) | self.req.perm = PermissionCache(self.env) self.assertEqual(['leave'], self._get_actions({'status': 'new'})) self.assertEqual(['leave'], self._get_actions({'status': 'assigned'})) self.assertEqual(['leave'], self._get_actions({'status': 'accepted'})) self.assertEqual(['leave'], self._get_actions({'status': 'reopened'})) self.assertEqual(['leave'], self._get_actions({'status': 'closed'})) | def test_available_actions_no_perms(self): ts = TicketSystem(self.env) self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'new'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'assigned'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'accepted'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'reopened'})) self.assertEqual(['leave'], self._ts_get_available_actions(ts, {'status': 'closed'})) | 54878a8763e661b4ad70d357c6059829cf444570 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9317/54878a8763e661b4ad70d357c6059829cf444570/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
2135,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
3658,
18,
12160,
273,
4641,
18,
5041,
1649,
12,
2890,
18,
3074,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
2135,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
3658,
18,
12160,
273,
4641,
18,
5041,
1649,
12,
2890,
18,
3074,
... |
_safe_close(tosock) | def exchange_mesg(serverinfo, fromsock, tosock): try: while True: mesg = fromsock.recv(RECV_SIZE) tosock.send(mesg) except Exception, exp: # Something went wrong, close both sockets _safe_close(fromsock) _safe_close(tosock) # Decrement the connected client count serverinfo["num_clients"] -= 1 | e280793d22279ee24a1c842da4865021e3336bc6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/e280793d22279ee24a1c842da4865021e3336bc6/forwarder_rpc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7829,
67,
26244,
75,
12,
3567,
1376,
16,
628,
15031,
16,
358,
15031,
4672,
775,
30,
1323,
1053,
30,
15216,
75,
273,
628,
15031,
18,
18334,
12,
862,
22007,
67,
4574,
13,
358,
15031,
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,
7829,
67,
26244,
75,
12,
3567,
1376,
16,
628,
15031,
16,
358,
15031,
4672,
775,
30,
1323,
1053,
30,
15216,
75,
273,
628,
15031,
18,
18334,
12,
862,
22007,
67,
4574,
13,
358,
15031,
18,... | |
paramopt = val.value | if val.value == "true": paramopt = "yes" | def gen_docs(doc, dir, templatedir): try: bodyfile = open(templatedir + "/header.html", "r") bodydata = bodyfile.read() bodyfile.close() intfile = open(templatedir + "/interface.html", "r") intdata = intfile.read() intfile.close() menufile = open(templatedir + "/menu.html", "r") menudata = menufile.read() menufile.close() indexfile = open(templatedir + "/module_list.html","r") indexdata = indexfile.read() indexfile.close() modulefile = open(templatedir + "/module.html","r") moduledata = modulefile.read() modulefile.close() except: error("Could not open templates") try: os.chdir(dir) except: error("Could now chdir to target directory") | 1601fb373835146f38e0b9516b7bb7bd41eddfaa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7247/1601fb373835146f38e0b9516b7bb7bd41eddfaa/sedoctool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3157,
67,
8532,
12,
2434,
16,
1577,
16,
13988,
690,
481,
4672,
225,
775,
30,
1417,
768,
273,
1696,
12,
27380,
690,
481,
397,
2206,
3374,
18,
2620,
3113,
315,
86,
7923,
1417,
892,
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,
3157,
67,
8532,
12,
2434,
16,
1577,
16,
13988,
690,
481,
4672,
225,
775,
30,
1417,
768,
273,
1696,
12,
27380,
690,
481,
397,
2206,
3374,
18,
2620,
3113,
315,
86,
7923,
1417,
892,
273,
... |
errors.append( 'Room <strong>%s</strong> is not available at the times requested by <strong>%s</strong>. Bug the webmasters to find out why you were allowed to assign this room.' % (base_room.name, self) ) | errors.append( u'Room <strong>%s</strong> is not available at the times requested by <strong>%s</strong>. Bug the webmasters to find out why you were allowed to assign this room.' % (base_room.name, self) ) | def assign_room(self, base_room, compromise=True, clear_others=False): """ Assign the classroom given, except at the times needed by this class. """ rooms_to_assign = base_room.identical_resources().filter(event__in=list(self.meeting_times.all())) status = True errors = [] if clear_others: self.clearRooms() if compromise is False: # Check that the room satisfies all needs of the class. result = base_room.satisfies_requests(self) if result[0] is False: status = False errors.append( 'Room <strong>%s</strong> does not have all resources that <strong>%s</strong> needs (or it is too small) and you have opted not to compromise. Try a better room.' % (base_room.name, self) ) if rooms_to_assign.count() != self.meeting_times.count(): status = False errors.append( 'Room <strong>%s</strong> is not available at the times requested by <strong>%s</strong>. Bug the webmasters to find out why you were allowed to assign this room.' % (base_room.name, self) ) for r in rooms_to_assign: r.clear_schedule_cache(self.parent_program) result = self.assignClassRoom(r) if not result: status = False occupiers_str = '' occupiers_set = base_room.assignments() if occupiers_set.count() > 0: # We really shouldn't have to test for this, but I guess it's safer not to assume... -ageng 2008-11-02 occupiers_str = ' by <strong>%s</strong>' % (occupiers_set[0].target or occupiers_set[0].target_subj) errors.append( 'Error: Room <strong>%s</strong> is already taken%s. Please assign a different one to <strong>%s</strong>. While you\'re at it, bug the webmasters to find out why you were allowed to assign a conflict.' % ( base_room.name, occupiers_str, self ) ) return (status, errors) | ac4e32124e9cb5f77723bb7e7325ac6d02285935 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12041/ac4e32124e9cb5f77723bb7e7325ac6d02285935/class_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2683,
67,
13924,
12,
2890,
16,
1026,
67,
13924,
16,
1161,
4108,
33,
5510,
16,
2424,
67,
28197,
33,
8381,
4672,
3536,
12093,
326,
667,
13924,
864,
16,
1335,
622,
326,
4124,
3577,
635,
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,
2683,
67,
13924,
12,
2890,
16,
1026,
67,
13924,
16,
1161,
4108,
33,
5510,
16,
2424,
67,
28197,
33,
8381,
4672,
3536,
12093,
326,
667,
13924,
864,
16,
1335,
622,
326,
4124,
3577,
635,
3... |
conf.gather_wsdk_versions(lst) conf.gather_icl_versions(lst) | def get_msvc_versions(conf): if not conf.env['MSVC_INSTALLED_VERSIONS']: lst = [] conf.gather_msvc_versions(lst) conf.gather_wsdk_versions(lst) conf.gather_icl_versions(lst) conf.env['MSVC_INSTALLED_VERSIONS'] = lst return conf.env['MSVC_INSTALLED_VERSIONS'] | 52ebe71179be62aad4ee939b4efc1d02d04b02c4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/52ebe71179be62aad4ee939b4efc1d02d04b02c4/msvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
959,
4227,
67,
10169,
12,
3923,
4672,
309,
486,
2195,
18,
3074,
3292,
3537,
13464,
67,
19784,
27751,
67,
5757,
55,
3546,
30,
9441,
273,
5378,
2195,
18,
75,
4806,
67,
959,
4227... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
959,
4227,
67,
10169,
12,
3923,
4672,
309,
486,
2195,
18,
3074,
3292,
3537,
13464,
67,
19784,
27751,
67,
5757,
55,
3546,
30,
9441,
273,
5378,
2195,
18,
75,
4806,
67,
959,
4227... | |
if sort_on is None: sort_on = ('+', linkcl.labelprop()) else: sort_on = ('+', sort_on) | sort_on = ('+', linkcl.labelprop()) | def menu(self, size=None, height=None, showid=0, additional=[], sort_on=None, **conditions): ''' Render a form select list for this property | 35ec49ae42df96c75af99be5cb81144aeac348bf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/35ec49ae42df96c75af99be5cb81144aeac348bf/templating.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
12,
2890,
16,
963,
33,
7036,
16,
2072,
33,
7036,
16,
2405,
350,
33,
20,
16,
3312,
22850,
6487,
1524,
67,
265,
33,
7036,
16,
2826,
6381,
4672,
9163,
6987,
279,
646,
2027,
666,
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,
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,
3824,
12,
2890,
16,
963,
33,
7036,
16,
2072,
33,
7036,
16,
2405,
350,
33,
20,
16,
3312,
22850,
6487,
1524,
67,
265,
33,
7036,
16,
2826,
6381,
4672,
9163,
6987,
279,
646,
2027,
666,
3... |
is self.path not in sys.path: | if self.path not in sys.path: | def __init__(self, path, fault_tolerance, debug_output): self.duplicate_path = False self.fault_tolerance = fault_tolerance self.debug_output = debug_output self.path = path is self.path not in sys.path: sys.path.append(self.path) else: self.duplicate_path = True self.dir_modules = [] if debug_output >= DEBUG_ALL print "Scanning directory: %s" % self.path sys.path.append(self.path) self.scan() self.load() | 75dbf626c3b697e568752995866893479a555cae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/635/75dbf626c3b697e568752995866893479a555cae/moduleloader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
12530,
67,
25456,
16,
1198,
67,
2844,
4672,
365,
18,
17342,
67,
803,
273,
225,
1083,
365,
18,
643,
67,
25456,
273,
12530,
67,
25456,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
12530,
67,
25456,
16,
1198,
67,
2844,
4672,
365,
18,
17342,
67,
803,
273,
225,
1083,
365,
18,
643,
67,
25456,
273,
12530,
67,
25456,
365,
18,
... |
if input["asReference"] == True: | if input.has_key("asReference") and input["asReference"] == True: | def setValue(self, input): """Set input value for this input""" # if HTTP GET was performed, the type does not have to be set if not input.has_key("type") and\ (input["value"].find("http://") == 0 or input["value"].find("http%3A%2F%2F") == 0): input["asReference"] = True | ceb152845fbf1e1996776a118f4b2af3c4b0564a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10967/ceb152845fbf1e1996776a118f4b2af3c4b0564a/InAndOutputs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5524,
12,
2890,
16,
810,
4672,
3536,
694,
810,
460,
364,
333,
810,
8395,
225,
468,
309,
2239,
4978,
1703,
9591,
16,
326,
618,
1552,
486,
1240,
358,
506,
444,
309,
486,
810,
18,
5332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5524,
12,
2890,
16,
810,
4672,
3536,
694,
810,
460,
364,
333,
810,
8395,
225,
468,
309,
2239,
4978,
1703,
9591,
16,
326,
618,
1552,
486,
1240,
358,
506,
444,
309,
486,
810,
18,
5332,
... |
stopbits = property(getStopbits, setStopbits, "Stopbits setting") | stopbits = property(getStopbits, setStopbits, doc="Stopbits setting") | def getStopbits(self): """Get the current stopbits setting.""" return self._stopbits | 1e38a72063a44f9dca664713f3959764f9e6369a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/1e38a72063a44f9dca664713f3959764f9e6369a/serialutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4947,
6789,
12,
2890,
4672,
3536,
967,
326,
783,
2132,
6789,
3637,
12123,
327,
365,
6315,
5681,
6789,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
4947,
6789,
12,
2890,
4672,
3536,
967,
326,
783,
2132,
6789,
3637,
12123,
327,
365,
6315,
5681,
6789,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
success = True | pe_total = 0 pe_passed = 0 | def main(options, args): directory = args[0] success = True for file in os.listdir(directory): path = os.path.abspath(os.path.join(directory, file)) if not IsPEFile(path): continue pe = pefile.PE(path, fast_load=True) # Check for /DYNAMICBASE. if pe.OPTIONAL_HEADER.DllCharacteristics & DYNAMICBASE_FLAG: if options.verbose: print "Checking %s for /DYNAMICBASE... PASS" % path else: success = False print "Checking %s for /DYNAMICBASE... FAIL" % path # Check for /NXCOMPAT. if pe.OPTIONAL_HEADER.DllCharacteristics & NXCOMPAT_FLAG: if options.verbose: print "Checking %s for /NXCOMPAT... PASS" % path else: success = False print "Checking %s for /NXCOMPAT... FAIL" % path if not success: # TODO(scherkus): change this back to 1 once I've fixed failing builds. sys.exit(0) | cf0c25ef3bef50304307750af0e9329a8a131554 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/cf0c25ef3bef50304307750af0e9329a8a131554/checkbins.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2116,
16,
833,
4672,
1867,
273,
833,
63,
20,
65,
2804,
67,
4963,
273,
374,
2804,
67,
23603,
273,
374,
225,
364,
585,
316,
1140,
18,
1098,
1214,
12,
5149,
4672,
589,
273,
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,
2774,
12,
2116,
16,
833,
4672,
1867,
273,
833,
63,
20,
65,
2804,
67,
4963,
273,
374,
2804,
67,
23603,
273,
374,
225,
364,
585,
316,
1140,
18,
1098,
1214,
12,
5149,
4672,
589,
273,
11... |
print 'Error: All streams must have either one Z trace or a set of ZNE traces (from the same station)' return | print 'Warning: All streams must have either one Z trace or a set of three ZNE traces. Stream discarded.' self.streams.pop(i) continue | def __init__(self, streams = None, options = None): self.streams = streams self.options = options #Define some flags, dictionaries and plotting options self.flagFilt=False #False:no filter True:filter self.flagFiltTyp=0 #0: bandpass 1: bandstop 2:lowpass 3: highpass self.dictFiltTyp={'Bandpass':0, 'Bandstop':1, 'Lowpass':2, 'Highpass':3} self.flagFiltZPH=False #False: no zero-phase True: zero-phase filtering self.valFiltLow=np.NaN # These are overridden with low/high estimated from sampling rate self.valFiltHigh=np.NaN self.flagWheelZoom=True #Switch use of mousewheel for zooming self.flagPhase=0 #0:P 1:S 2:Magnitude self.dictPhase={'P':0, 'S':1, 'Mag':2} self.dictPhaseInverse = {} # We need the reverted dictionary for switching throug the Phase radio button for i in self.dictPhase.items(): self.dictPhaseInverse[i[1]] = i[0] self.dictPhaseColors={'P':'red', 'S':'blue', 'Psynth':'black', 'Ssynth':'black', 'Mag':'green'} self.dictPhaseLinestyles={'P':'-', 'S':'-', 'Psynth':'--', 'Ssynth':'--'} self.pickingColor = self.dictPhaseColors['P'] self.magPickWindow=10 #Estimating the maximum/minimum in a sample-window around click self.magMinMarker='x' self.magMaxMarker='x' self.magMarkerEdgeWidth=1.8 self.magMarkerSize=20 self.axvlinewidths=1.2 #dictionary for key-bindings self.dictKeybindings = {'setPick': 'alt', 'setPickError': ' ', 'delPick': 'escape', 'setMagMin': 'alt', 'setMagMax': ' ', 'switchPhase': 'control', 'delMagMinMax': 'escape', 'switchWheelZoom': 'z', 'switchPan': 'p', 'prevStream': 'y', 'nextStream': 'x', 'setPWeight0': '0', 'setPWeight1': '1', 'setPWeight2': '2', 'setPWeight3': '3', # 'setPWeight4': '4', 'setPWeight5': '5', 'setSWeight0': '0', 'setSWeight1': '1', 'setSWeight2': '2', 'setSWeight3': '3', # 'setSWeight4': '4', 'setSWeight5': '5', 'setPPolUp': 'u', 'setPPolPoorUp': '+', 'setPPolDown': 'd', 'setPPolPoorDown': '-', 'setSPolUp': 'u', 'setSPolPoorUp': '+', 'setSPolDown': 'd', 'setSPolPoorDown': '-', 'setPOnsetImpulsive': 'i', 'setPOnsetEmergent': 'e', 'setSOnsetImpulsive': 'i', 'setSOnsetEmergent': 'e'} self.threeDlocPath = '/baysoft/obspyck/3dloc/' self.threeDlocOutfile = self.threeDlocPath + '3dloc-out' self.threeDlocInfile = self.threeDlocPath + '3dloc-in' self.threeDlocPreCall = 'rm %s %s &> /dev/null' \ % (self.threeDlocOutfile, self.threeDlocInfile) self.threeDlocCall = 'export D3_VELOCITY=/scratch/rh_vel/vp_5836/;' + \ 'export D3_VELOCITY_2=/scratch/rh_vel/vs_32220/;' + \ 'cd %s;' % self.threeDlocPath + \ '3dloc_pitsa' self.hyp2000Path = '/baysoft/obspyck/hyp_2000/' self.hyp2000Controlfile = self.hyp2000Path + 'bay2000.inp' self.hyp2000Phasefile = self.hyp2000Path + 'hyp2000.pha' self.hyp2000Stationsfile = self.hyp2000Path + 'stations.dat' self.hyp2000Summary = self.hyp2000Path + 'hypo.prt' self.hyp2000PreCall = 'rm %s %s %s &> /dev/null' \ % (self.hyp2000Phasefile, self.hyp2000Stationsfile, self.hyp2000Summary) self.hyp2000Call = 'export HYP2000_DATA=%s;' % (self.hyp2000Path) + \ 'cd $HYP2000_DATA;' + \ 'hyp2000 < bay2000.inp &> /dev/null' self.xmlEventID = None self.locationType = None self.flagSpectrogram = False # indicates which of the available events from seishub was loaded self.seishubEventCurrent = None # indicates how many events are available from seishub self.seishubEventCount = None # If keybindings option is set only show keybindings and exit if self.options.keybindings: for k, v in self.dictKeybindings.iteritems(): print "%s: \"%s\"" % (k, v) return | a7ea27b0d88f474941076cae7ab6b09e010a3a46 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/a7ea27b0d88f474941076cae7ab6b09e010a3a46/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8205,
273,
599,
16,
702,
273,
599,
4672,
365,
18,
16320,
273,
8205,
365,
18,
2116,
273,
702,
468,
11644,
2690,
2943,
16,
16176,
471,
20947,
702,
365,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
8205,
273,
599,
16,
702,
273,
599,
4672,
365,
18,
16320,
273,
8205,
365,
18,
2116,
273,
702,
468,
11644,
2690,
2943,
16,
16176,
471,
20947,
702,
365,
18,... |
discount=(list_price-price) / list_price * 100 result['price_unit']=list_price | discount=(new_list_price-price) / new_list_price * 100 result['price_unit']=new_list_price | def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True,date_order=False,packaging=False,fiscal_position=False): res=super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, lang, update_tax,date_order,fiscal_position=fiscal_position) | 09263c29730891dba703fcb1a2bfb60b2db55bf7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/09263c29730891dba703fcb1a2bfb60b2db55bf7/product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
350,
67,
3427,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
846,
335,
5449,
16,
3017,
16,
26667,
33,
20,
16,
582,
362,
33,
8381,
16,
26667,
67,
89,
538,
33,
20,
16,
582,
... |
logger.setLevel(config['log_level'] or '0') | logger.setLevel(tools.config['log_level'] or '0') | def init_logger(): from tools import config import os logger = logging.getLogger() if config['syslog']: # SysLog Handler if os.name == 'nt': sysloghandler = logging.handlers.NTEventLogHandler("%s %s" % (release.description, release.version)) else: sysloghandler = logging.handlers.SysLogHandler('/dev/log') formatter = logging.Formatter('%(application)s:%(uncoloredlevelname)s:%(name)s:%(message)s') sysloghandler.setFormatter(formatter) logger.addHandler(sysloghandler) # create a format for log messages and dates formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') if config['logfile']: # LogFile Handler logf = config['logfile'] try: dirname = os.path.dirname(logf) if dirname and not os.path.isdir(dirname): os.makedirs(dirname) handler = logging.handlers.TimedRotatingFileHandler(logf,'D',1,30) except Exception, ex: sys.stderr.write("ERROR: couldn't create the logfile directory\n") handler = logging.StreamHandler(sys.stdout) else: # Normal Handler on standard output handler = logging.StreamHandler(sys.stdout) # tell the handler to use this format handler.setFormatter(formatter) # add the handler to the root logger logger.addHandler(handler) logger.setLevel(config['log_level'] or '0') if isinstance(handler, logging.StreamHandler) and os.name != 'nt': # change color of level names # uses of ANSI color codes # see http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html # maybe use http://code.activestate.com/recipes/574451/ colors = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', None, 'default'] foreground = lambda f: 30 + colors.index(f) background = lambda f: 40 + colors.index(f) mapping = { 'DEBUG_RPC': ('blue', 'white'), 'DEBUG': ('blue', 'default'), 'INFO': ('green', 'default'), 'WARNING': ('yellow', 'default'), 'ERROR': ('red', 'default'), 'CRITICAL': ('white', 'red'), } for level, (fg, bg) in mapping.items(): msg = "\x1b[%dm\x1b[%dm%s\x1b[0m" % (foreground(fg), background(bg), level) logging.addLevelName(getattr(logging, level), msg) | 2bc319d919ca7c2de535017d13c5635f761dbdf4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7397/2bc319d919ca7c2de535017d13c5635f761dbdf4/netsvc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
4901,
13332,
628,
8513,
1930,
642,
1930,
1140,
225,
1194,
273,
2907,
18,
588,
3328,
1435,
225,
309,
642,
3292,
9499,
1330,
3546,
30,
468,
16995,
1343,
4663,
309,
1140,
18,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
67,
4901,
13332,
628,
8513,
1930,
642,
1930,
1140,
225,
1194,
273,
2907,
18,
588,
3328,
1435,
225,
309,
642,
3292,
9499,
1330,
3546,
30,
468,
16995,
1343,
4663,
309,
1140,
18,
529,... |
pywikibot.output(u"NOTE: %s redirects to an invalid title" % page.aslink(True)) | pywikibot.output(u"NOTE: %s redirects to an invalid title" % page.aslink(True)) | def batchLoaded(self, counter): """ This is called by a worker to tell us that the promised batch of pages was loaded. In other words, all the pages in self.pending have already been preloaded. | f16d711ee4d69f05a569882514fadb88191f35f4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/f16d711ee4d69f05a569882514fadb88191f35f4/interwiki.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2581,
8835,
12,
2890,
16,
3895,
4672,
3536,
1220,
353,
2566,
635,
279,
4322,
358,
9276,
584,
716,
326,
3012,
5918,
2581,
434,
4689,
1703,
4203,
18,
657,
1308,
4511,
16,
777,
326,
4689,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2581,
8835,
12,
2890,
16,
3895,
4672,
3536,
1220,
353,
2566,
635,
279,
4322,
358,
9276,
584,
716,
326,
3012,
5918,
2581,
434,
4689,
1703,
4203,
18,
657,
1308,
4511,
16,
777,
326,
4689,
... |
print ("WARNING: Cannot include %s -- " "file not found" % filename) | logging.warning("Cannot include %s -- file not found", filename) | def parse(self, file, list, restricted=False, prev_indent=-1): """ Read and parse lines from file until a line with an indent level lower than or equal to prev_indent is encountered. | 6f0b471d69a023b83623e7b2bd000cdc604b22ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/6f0b471d69a023b83623e7b2bd000cdc604b22ac/kvm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
585,
16,
666,
16,
15693,
33,
8381,
16,
2807,
67,
9355,
29711,
21,
4672,
3536,
2720,
471,
1109,
2362,
628,
585,
3180,
279,
980,
598,
392,
3504,
1801,
2612,
2353,
578... |
- plot(y1,...,x=x) | - plot(y1,y2,...,x=x) | def plot(self, *args, **kwargs): """Draw line and scatter plots. | 3d6a03460d3fcdf67eb332ad64f531dca7d361d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4727/3d6a03460d3fcdf67eb332ad64f531dca7d361d1/common.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
6493,
980,
471,
14644,
17931,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
380,
1968,
16,
2826,
4333,
4672,
3536,
6493,
980,
471,
14644,
17931,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
output.seek(comp_lenghts_pos) | output.seek(comp_lengths_pos) | def _compress_member(input, in_size, output, basename, mtime): comp_lenghts_pos = _prepare_header(output, in_size, basename, mtime) comp_lengths = _compress_data(input, in_size, output) end_pos = output.tell() output.seek(comp_lenghts_pos) for comp_len in comp_lengths: _write16(output, comp_len) output.seek(end_pos) | 599e1e2a4e20b94572217d36e0d7135c9204a61d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4495/599e1e2a4e20b94572217d36e0d7135c9204a61d/compressor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14706,
67,
5990,
12,
2630,
16,
316,
67,
1467,
16,
876,
16,
4882,
16,
13158,
4672,
1161,
67,
1897,
75,
647,
87,
67,
917,
273,
389,
9366,
67,
3374,
12,
2844,
16,
316,
67,
1467,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14706,
67,
5990,
12,
2630,
16,
316,
67,
1467,
16,
876,
16,
4882,
16,
13158,
4672,
1161,
67,
1897,
75,
647,
87,
67,
917,
273,
389,
9366,
67,
3374,
12,
2844,
16,
316,
67,
1467,
... |
data = inputstream.EncodingBytes( attributes["content"].encode(self.parser.tokenizer.stream.charEncoding[0])) | data = inputstream.EncodingBytes(attributes["content"].encode("utf-8")) | def startTagMeta(self, token): self.tree.insertElement(token) self.tree.openElements.pop() token["selfClosingAcknowledged"] = True | 9d478a3f2b1f4fffa9b04f4a976a77aa7ef391fc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9368/9d478a3f2b1f4fffa9b04f4a976a77aa7ef391fc/html5parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
2781,
12,
2890,
16,
1147,
4672,
365,
18,
3413,
18,
6387,
1046,
12,
2316,
13,
365,
18,
3413,
18,
3190,
3471,
18,
5120,
1435,
1147,
9614,
2890,
15745,
11931,
10378,
2423,
11929,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
1805,
2781,
12,
2890,
16,
1147,
4672,
365,
18,
3413,
18,
6387,
1046,
12,
2316,
13,
365,
18,
3413,
18,
3190,
3471,
18,
5120,
1435,
1147,
9614,
2890,
15745,
11931,
10378,
2423,
11929,... |
choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list] choices.sort(key = lambda x: int(x[0])) ConfigSelection.__init__(self, choices = choices, default = default) | ConfigSelection.__init__(self, choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list], default = default) | def __init__(self, list, default = None): if default is not None: default = str(default) choices = [(str(orbpos), desc) for (orbpos, desc, flags) in list] choices.sort(key = lambda x: int(x[0])) ConfigSelection.__init__(self, choices = choices, default = default) | 3c8f046e30595b284a2b9c391a7ee7bdf662a284 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/3c8f046e30595b284a2b9c391a7ee7bdf662a284/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
666,
16,
805,
273,
599,
4672,
309,
805,
353,
486,
599,
30,
805,
273,
609,
12,
1886,
13,
7246,
273,
306,
12,
701,
12,
16640,
917,
3631,
3044,
13,
364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
666,
16,
805,
273,
599,
4672,
309,
805,
353,
486,
599,
30,
805,
273,
609,
12,
1886,
13,
7246,
273,
306,
12,
701,
12,
16640,
917,
3631,
3044,
13,
364,
... |
new_status = self.status() self._transcript.addChange('status', old_status, new_status) | def issue_followup(self, action, comment='', text_format='plain', assignees=[], assignees_group=[], RESPONSE=None): """ issue followup handling """ | b440b1d34f2c4816f72603814485d3451d7fd863 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1807/b440b1d34f2c4816f72603814485d3451d7fd863/Issue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
67,
14641,
416,
12,
2890,
16,
1301,
16,
2879,
2218,
2187,
977,
67,
2139,
2218,
7446,
2187,
2683,
25521,
22850,
6487,
2683,
25521,
67,
1655,
22850,
6487,
20645,
33,
7036,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5672,
67,
14641,
416,
12,
2890,
16,
1301,
16,
2879,
2218,
2187,
977,
67,
2139,
2218,
7446,
2187,
2683,
25521,
22850,
6487,
2683,
25521,
67,
1655,
22850,
6487,
20645,
33,
7036,
4672,
3536,
... | |
dir = '/usr/lib' | dir = '/home/rtfb' | def __init__ (self, parent, id, title): wx.Frame.__init__ (self, parent, -1, title) | 027251afddcf33be6b949e9d0edfa68002408636 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9028/027251afddcf33be6b949e9d0edfa68002408636/teststc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
982,
16,
612,
16,
2077,
4672,
7075,
18,
3219,
16186,
2738,
972,
261,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
982,
16,
612,
16,
2077,
4672,
7075,
18,
3219,
16186,
2738,
972,
261,
2890,
16,
982,
16,
300,
21,
16,
2077,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.write(cr , uid, ids ,{'state' : 'to install'}) | self.write(cr , uid, ids ,{'state' : 'to install'}) | def action_install(self,cr,uid,ids,context=None): self.write(cr , uid, ids ,{'state' : 'to install'}) self.download(cr, uid, ids, context=context) for id in ids: cr.execute("select m.id as id from ir_module_module_dependency d inner join ir_module_module m on (m.name=d.name) where d.module_id=%d and m.state='uninstalled'",(id,)) dep_ids = map(lambda x:x[0],cr.fetchall()) if len(dep_ids): self.action_install(cr,uid,dep_ids,context=context) | 0534a872d8a2c20279c20902e0897da6bdcf6f33 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/0534a872d8a2c20279c20902e0897da6bdcf6f33/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
5425,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2472,
33,
7036,
4672,
365,
18,
2626,
12,
3353,
269,
4555,
16,
3258,
269,
27828,
2019,
11,
294,
296,
869,
3799,
11,
6792,
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,
1301,
67,
5425,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
2472,
33,
7036,
4672,
365,
18,
2626,
12,
3353,
269,
4555,
16,
3258,
269,
27828,
2019,
11,
294,
296,
869,
3799,
11,
6792,
3... |
except ConfigParser.NoSectionError: | else: | def get_product_version(filename): '''Get product version used in archive paths etc. TODO: add new section. At the moment this gets executable version. ''' config = ConfigParser.ConfigParser() config.readfp(open(filename)) # First try RC file, then define-macro version = '' try: version = config.get('Executable', 'version') except ConfigParser.NoSectionError: print 'Executable version not found, using default.' # Remove quotation marks if len(version) > 0: if version[0] == '"': version = version[1:] if version[len(version) - 1] == '"': version = version[:len(version) - 1] return version | 2bfe942d97e7c5ace17408eefdad90dbb4f5b229 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/618/2bfe942d97e7c5ace17408eefdad90dbb4f5b229/SetVersions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5896,
67,
1589,
12,
3459,
4672,
9163,
967,
3017,
1177,
1399,
316,
5052,
2953,
5527,
18,
2660,
30,
527,
394,
2442,
18,
2380,
326,
10382,
333,
5571,
9070,
1177,
18,
9163,
642,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5896,
67,
1589,
12,
3459,
4672,
9163,
967,
3017,
1177,
1399,
316,
5052,
2953,
5527,
18,
2660,
30,
527,
394,
2442,
18,
2380,
326,
10382,
333,
5571,
9070,
1177,
18,
9163,
642,
2... |
module = doctest._normalize_module(module, depth=3) | module = doctest._normalize_module(module) | def FunctionalDocTestSuite(module=None, **kw): module = doctest._normalize_module(module, depth=3) return FunctionalSuiteFactory(module, **kw).doctestsuite() | 0f8c43cbed1421a01aee7ba731daec005c495fea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/0f8c43cbed1421a01aee7ba731daec005c495fea/functional.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4284,
287,
1759,
4709,
13587,
12,
2978,
33,
7036,
16,
2826,
9987,
4672,
1605,
273,
31263,
395,
6315,
12237,
67,
2978,
12,
2978,
13,
327,
4284,
287,
13587,
1733,
12,
2978,
16,
2826,
9987,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4284,
287,
1759,
4709,
13587,
12,
2978,
33,
7036,
16,
2826,
9987,
4672,
1605,
273,
31263,
395,
6315,
12237,
67,
2978,
12,
2978,
13,
327,
4284,
287,
13587,
1733,
12,
2978,
16,
2826,
9987,... |
print line print "\t print "\tdef __unicode__(self, *args):" print "\t\ttry:" print "\t\t\treturn unicode(self.__call__(*args))" print "\t\texcept pythoncom.com_error:" print "\t\t\treturn repr(self)" print "\tdef __str__(self, *args):" print "\t\treturn str(self.__unicode__(*args))" print "\tdef __int__(self, *args):" print "\t\treturn int(self.__call__(*args))" | print >> stream, line print >> stream, "\t print >> stream, "\tdef __unicode__(self, *args):" print >> stream, "\t\ttry:" print >> stream, "\t\t\treturn unicode(self.__call__(*args))" print >> stream, "\t\texcept pythoncom.com_error:" print >> stream, "\t\t\treturn repr(self)" print >> stream, "\tdef __str__(self, *args):" print >> stream, "\t\treturn str(self.__unicode__(*args))" print >> stream, "\tdef __int__(self, *args):" print >> stream, "\t\treturn int(self.__call__(*args))" | ret = [ "\tdef __call__(self):\n\t\treturn self._ApplyTypes_(*%s)" % propArgs] | d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/677/d465d55b4c2e9a03e3b613dd6344bf0290ff0ff6/genpy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
325,
273,
306,
1548,
88,
536,
1001,
1991,
972,
12,
2890,
4672,
64,
82,
64,
88,
64,
88,
2463,
365,
6315,
7001,
2016,
67,
30857,
9,
87,
2225,
738,
2270,
2615,
65,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
325,
273,
306,
1548,
88,
536,
1001,
1991,
972,
12,
2890,
4672,
64,
82,
64,
88,
64,
88,
2463,
365,
6315,
7001,
2016,
67,
30857,
9,
87,
2225,
738,
2270,
2615,
65,
2,
-100,
-100,
-100,
-100,
... |
while os.path.exists(self.__dir): self.__dir += "_" self.__filename += '_' | def __init__(self, name, notebook, id, system=None, passcode = ''): name = ' '.join(name.split()) self.__id = id self.__system = system self.__next_id = (_notebook.MAX_WORKSHEETS) * id self.__name = name self.__notebook = notebook self.__passcode = crypt.crypt(passcode, self.salt()) self.__passcrypt= True dir = list(name) for i in range(len(dir)): if not dir[i].isalnum() and dir[i] != '_': dir[i]='_' dir = ''.join(dir) self.__filename = dir self.__dir = '%s/%s'%(notebook.worksheet_directory(), dir) while os.path.exists(self.__dir): self.__dir += "_" self.__filename += '_' self.__comp_is_running = False if not os.path.exists(self.__dir): os.makedirs(self.__dir) self.__queue = [] self.__cells = [ ] for i in range(INITIAL_NUM_CELLS): self.append_new_cell() | e09f83a078fe48857a3b799ad3f973273dc97dfc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e09f83a078fe48857a3b799ad3f973273dc97dfc/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
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,
508,
16,
14718,
16,
612,
16,
2619,
33,
7036,
16,
1342,
710,
273,
875,
4672,
508,
273,
296,
2418,
5701,
12,
529,
18,
4939,
10756,
365,
16186,
350,
273,
... | |
def N2p(self, p): | def N3p(self, p): | def N2p(self, p): return -(1+p[1])/4.0 | fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8645/fe068c7d5a9a7a2245d29d05c23d7dc62cec27ce/TestFIATLagrange.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
423,
23,
84,
12,
2890,
16,
293,
4672,
327,
300,
12,
21,
15,
84,
63,
21,
5717,
19,
24,
18,
20,
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,
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,
423,
23,
84,
12,
2890,
16,
293,
4672,
327,
300,
12,
21,
15,
84,
63,
21,
5717,
19,
24,
18,
20,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
None, [cty.POINTER(FL_OBJECT), cty.c_int], | None, [cty.POINTER(FL_OBJECT), cty.c_int], | def fl_set_xyplot_fontsize(obj, size): """ fl_set_xyplot_fontsize(obj, size) """ _fl_set_xyplot_fontsize(obj, size) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
1698,
4032,
67,
23055,
12,
2603,
16,
963,
4672,
3536,
1183,
67,
542,
67,
1698,
4032,
67,
23055,
12,
2603,
16,
963,
13,
3536,
225,
389,
2242,
67,
542,
67,
1698,
403... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
1698,
4032,
67,
23055,
12,
2603,
16,
963,
4672,
3536,
1183,
67,
542,
67,
1698,
4032,
67,
23055,
12,
2603,
16,
963,
13,
3536,
225,
389,
2242,
67,
542,
67,
1698,
403... |
return self.reader.next() | data = self.reader.next() data, bytesencoded = self.encode(data, self.errors) return data | def next(self): | 22791c2e9fe5c9a3d790fb80dd88d46f50523625 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/22791c2e9fe5c9a3d790fb80dd88d46f50523625/codecs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
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,
1024,
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,
-... |
if m is not nomask: try: shape = result.shape except AttributeError: pass else: if m.shape != shape: m = mask_or(getmaskarray(a), getmaskarray(b)) | def __call__ (self, a, *args, **kwargs): "Execute the call behavior." | 377645d4602e5dde51cba0ab859a66a958750157 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/377645d4602e5dde51cba0ab859a66a958750157/ma.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
261,
2890,
16,
279,
16,
380,
1968,
16,
2826,
4333,
4672,
315,
5289,
326,
745,
6885,
1199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
261,
2890,
16,
279,
16,
380,
1968,
16,
2826,
4333,
4672,
315,
5289,
326,
745,
6885,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
print 'Preferred dict keys:', preferred_dict_keys | def select_preferred_dict(self): print 'Preferred dicts:', self.preferred_dicts preferred_dict_keys = [item[0] for item in sorted(self.preferred_dicts.iteritems(), key=lambda x: -x[1])] print 'Preferred dict keys:', preferred_dict_keys try: for i, dict_key in enumerate(preferred_dict_keys): print '********' print '%d Preferred dict key: %r ' % (i, dict_key) print '********' for page_num in range(self.tabs.count()): print 'Looking at tab %d (%s)' % (page_num, unicode(self.tabs.tabText(page_num)).encode('utf8')) web_view = self.tabs.widget(page_num) dict_uuid = str(web_view.property('dictionary').toByteArray()) print 'dict_uuid: %r' % dict_uuid if dict_uuid == dict_key: print 'Preferred dictionary: %s' % unicode(self.tabs.tabText(page_num)).encode('utf8') self.tabs.setCurrentIndex(page_num) raise StopIteration() except StopIteration: pass | 67a3086e42b74c3a053a1f3d5818584b41ba19d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14305/67a3086e42b74c3a053a1f3d5818584b41ba19d4/qtui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
67,
23616,
67,
1576,
12,
2890,
4672,
1172,
296,
16028,
15838,
30,
2187,
365,
18,
23616,
67,
16287,
9119,
67,
1576,
67,
2452,
273,
306,
1726,
63,
20,
65,
364,
761,
316,
3115,
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,
2027,
67,
23616,
67,
1576,
12,
2890,
4672,
1172,
296,
16028,
15838,
30,
2187,
365,
18,
23616,
67,
16287,
9119,
67,
1576,
67,
2452,
273,
306,
1726,
63,
20,
65,
364,
761,
316,
3115,
12,
... | |
raise Exception('Bad username or password') | raise ExceptionNoTb('Bad username or password') | def access(db, uid, passwd, sec_level, ids): cr = pooler.get_db(db).cursor() if passwd: cr.execute('select id from res_users where id=%s and password=%s', (uid, passwd)) else: cr.execute('select id from res_users where id=%s and password is null', (uid,)) res = cr.fetchone() cr.close() if not res: raise Exception('Bad username or password') return res[0] | a9174e7c7fd0884f41f1fb442866bb432e1b10d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12853/a9174e7c7fd0884f41f1fb442866bb432e1b10d3/security.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2006,
12,
1966,
16,
4555,
16,
19093,
16,
1428,
67,
2815,
16,
3258,
4672,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
1435,
309,
19093,
30,
4422,
18,
8837,
2668,
4025... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2006,
12,
1966,
16,
4555,
16,
19093,
16,
1428,
67,
2815,
16,
3258,
4672,
4422,
273,
2845,
264,
18,
588,
67,
1966,
12,
1966,
2934,
9216,
1435,
309,
19093,
30,
4422,
18,
8837,
2668,
4025... |
return str(long((n / (2 ** 20)) * 10) / 10.0) | return str(long((float(n) / (2 ** 20)) * 10) / 10.0) | def mbfy(n): return str(long((n / (2 ** 20)) * 10) / 10.0) | 7c010455af08d67a6fff4d351a543a7db6d0bc58 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4538/7c010455af08d67a6fff4d351a543a7db6d0bc58/DownloaderFeedback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4903,
74,
93,
12,
82,
4672,
327,
609,
12,
5748,
12443,
5659,
12,
82,
13,
342,
261,
22,
2826,
4200,
3719,
380,
1728,
13,
342,
1728,
18,
20,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4903,
74,
93,
12,
82,
4672,
327,
609,
12,
5748,
12443,
5659,
12,
82,
13,
342,
261,
22,
2826,
4200,
3719,
380,
1728,
13,
342,
1728,
18,
20,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
... |
page = ErrorPage("The Job ID seems to be expired.") | page = ErrorPage(form, "The Job ID seems to be expired.") | def main(): form = cgi.FieldStorage() page = None job_id = check_job_id(form) if job_id==None: page = ErrorPage("The Job ID seems to be expired.") else: page = RefinePrepPage(form) try: print page.html_page() except RefinePrepError, err: text = '<center><p>%s</p></center>' % (err.text) page = ErrorPage(form, text) print page.html_page() except xmlrpclib.Fault, err: page = ErrorPage(form, "xmlrpclib.Fault: " +str(err)) print page.html_page() except socket.error, err: page = ErrorPage(form, "socket.error: " + str(err)) print page.html_page() | 7513555019c5fc099aa4aa56f3137e326a5a06fd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/7513555019c5fc099aa4aa56f3137e326a5a06fd/refineprep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
646,
273,
276,
10052,
18,
974,
3245,
1435,
225,
1363,
273,
599,
1719,
67,
350,
273,
866,
67,
4688,
67,
350,
12,
687,
13,
309,
1719,
67,
350,
631,
7036,
30,
1363,
273,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
646,
273,
276,
10052,
18,
974,
3245,
1435,
225,
1363,
273,
599,
1719,
67,
350,
273,
866,
67,
4688,
67,
350,
12,
687,
13,
309,
1719,
67,
350,
631,
7036,
30,
1363,
273,
10... |
if type(val) == type(""): | if isinstance(val, str): | def value_encode(self, val): if type(val) == type(""): return val, _quote(val) else: return val, _quote( dumps(val) ) | 1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/1a1c2ba2c90cd7efc93d61a9c6617f3aa3090256/Cookie.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
309,
1549,
12,
1125,
16,
609,
4672,
327,
1244,
16,
389,
6889,
12,
1125,
13,
469,
30,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1125,
13,
262,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
460,
67,
3015,
12,
2890,
16,
1244,
4672,
309,
1549,
12,
1125,
16,
609,
4672,
327,
1244,
16,
389,
6889,
12,
1125,
13,
469,
30,
327,
1244,
16,
389,
6889,
12,
6711,
12,
1125,
13,
262,
... |
h[wh] = abs(dstepi[wh]*x[wh]) | h[wh] = numpy.abs(dstepi[wh]*x[wh]) | def fdjac2(self, fcn, x, fvec, step=None, ulimited=None, ulimit=None, dside=None, epsfcn=None, autoderivative=1, functkw=None, xall=None, ifree=None, dstep=None): | 14558c711c4693ee25ced2a48d6eaf300224bc75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/682/14558c711c4693ee25ced2a48d6eaf300224bc75/mpfit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5194,
31390,
22,
12,
2890,
16,
8036,
82,
16,
619,
16,
284,
8799,
16,
2235,
33,
7036,
16,
7493,
1038,
329,
33,
7036,
16,
7493,
1038,
33,
7036,
16,
3780,
831,
33,
7036,
16,
7785,
7142,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5194,
31390,
22,
12,
2890,
16,
8036,
82,
16,
619,
16,
284,
8799,
16,
2235,
33,
7036,
16,
7493,
1038,
329,
33,
7036,
16,
7493,
1038,
33,
7036,
16,
3780,
831,
33,
7036,
16,
7785,
7142,... |
"scons clam_vmqt4_path=vmqt prefix=%(installPath)s clam_prefix=%(installPath)s external_dll_path=%(externalDllPath)s crossmingw=1 "%localDefinitions, | "scons prefix=%(installPath)s clam_prefix=%(installPath)s external_dll_path=%(externalDllPath)s crossmingw=1 "%localDefinitions, | def set_qtdir_to_qt3(x) : os.environ['QTDIR']=localDefinitions['qt3dir'] | 2422332d1d2326f726ebd0c4fe623e5143c4f969 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1456/2422332d1d2326f726ebd0c4fe623e5143c4f969/clam_testfarm_client_mingw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
23311,
1214,
67,
869,
67,
23311,
23,
12,
92,
13,
294,
1140,
18,
28684,
3292,
53,
56,
4537,
3546,
33,
3729,
7130,
3292,
23311,
23,
1214,
3546,
225,
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,
444,
67,
23311,
1214,
67,
869,
67,
23311,
23,
12,
92,
13,
294,
1140,
18,
28684,
3292,
53,
56,
4537,
3546,
33,
3729,
7130,
3292,
23311,
23,
1214,
3546,
225,
2,
-100,
-100,
-100,
-100,
... |
self.desctiption = pa_sink_info.description | self.description = pa_sink_info.description | def __init__(self, pa_sink_info): PulseSink.__init__(self, pa_sink_info.index, pa_sink_info.name, pa_sink_info.mute, PulseVolumeCtypes(pa_sink_info.volume), PulseClient("Selected Sink")) | 913e2317612466b8b9087f1c2e5834c00e88c5f6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7984/913e2317612466b8b9087f1c2e5834c00e88c5f6/PulseSink.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6790,
67,
17074,
67,
1376,
4672,
453,
24667,
11326,
16186,
2738,
972,
12,
2890,
16,
6790,
67,
17074,
67,
1376,
18,
1615,
16,
6790,
67,
17074,
67,
1376,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6790,
67,
17074,
67,
1376,
4672,
453,
24667,
11326,
16186,
2738,
972,
12,
2890,
16,
6790,
67,
17074,
67,
1376,
18,
1615,
16,
6790,
67,
17074,
67,
1376,
1... |
result = self.getStorageElement(se) | result = self.__getStorageElement(se) | def __checkLFNPFNConvention(self,lfn,pfn,se): """ Check that the PFN corresponds to the LFN-PFN convention """ # Check if the PFN corresponds to the LFN convention lfn_pfn = True # flag that the lfn is contained in the pfn if (len(pfn)<len(lfn)) or (pfn[-len(lfn):] != lfn) : return S_ERROR('PFN does not correspond to the LFN convention') | 3a1d62a93268fba30f0401e755b54ae70528755c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/3a1d62a93268fba30f0401e755b54ae70528755c/FileCatalogDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
9105,
23430,
19793,
25947,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
307,
4672,
3536,
2073,
716,
326,
453,
19793,
13955,
358,
326,
18803,
50,
17,
52,
19793,
15797,
3536,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1893,
9105,
23430,
19793,
25947,
12,
2890,
16,
80,
4293,
16,
84,
4293,
16,
307,
4672,
3536,
2073,
716,
326,
453,
19793,
13955,
358,
326,
18803,
50,
17,
52,
19793,
15797,
3536,
468,... |
files = [f for f in os.listdir(self.root) if f.startswith(self.warcfile_prefix) and f.endswith('.warc')] | files = [os.path.basename(f) for f in self.find(self.root) if f.endswith('.warc')] | def get_next_warcfile(self): if self.next_warcfile is None: files = [f for f in os.listdir(self.root) if f.startswith(self.warcfile_prefix) and f.endswith('.warc')] if files: files.sort() self.next_warcfile = files[-1] else: self.next_warcfile = self.warcfile_prefix + '_0000_00.warc' path = self.get_path(self.next_warcfile) if os.path.exists(path) and self.filesize(path) > self.maxsize: count = int(web.numify(self.next_warcfile)) + 1 self.next_warcfile = self.warcfile_prefix + web.denumify("%06d" % count, "_XXXX_XX.warc") return self.next_warcfile | 9a93e23dcba943777c1f316759496fb043e822d3 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3913/9a93e23dcba943777c1f316759496fb043e822d3/disk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
905,
71,
768,
12,
2890,
4672,
309,
365,
18,
4285,
67,
905,
71,
768,
353,
599,
30,
1390,
273,
306,
538,
18,
803,
18,
13909,
12,
74,
13,
364,
284,
316,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
905,
71,
768,
12,
2890,
4672,
309,
365,
18,
4285,
67,
905,
71,
768,
353,
599,
30,
1390,
273,
306,
538,
18,
803,
18,
13909,
12,
74,
13,
364,
284,
316,
365,
18,
... |
assert isinstance(self.search_static_first, int) | assert isinstance(self.search_static_first, type(0)) | def __init__ (self, default_lib_dirs=default_lib_dirs, default_include_dirs=default_include_dirs, ): self.__class__.info = {} self.local_prefixes = [] defaults = {} defaults['library_dirs'] = os.pathsep.join(default_lib_dirs) defaults['include_dirs'] = os.pathsep.join(default_include_dirs) defaults['src_dirs'] = os.pathsep.join(default_src_dirs) defaults['search_static_first'] = str(self.search_static_first) self.cp = ConfigParser.ConfigParser(defaults) cf = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'site.cfg') self.cp.read([cf]) if not self.cp.has_section(self.section): self.cp.add_section(self.section) self.search_static_first = self.cp.getboolean(self.section, 'search_static_first') assert isinstance(self.search_static_first, int) | 4fa288b6450b86343571e40830e44e6f02c64764 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/4fa288b6450b86343571e40830e44e6f02c64764/system_info.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
805,
67,
2941,
67,
8291,
33,
1886,
67,
2941,
67,
8291,
16,
805,
67,
6702,
67,
8291,
33,
1886,
67,
6702,
67,
8291,
16,
262,
30,
365,
16186,
1106,
25648... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2890,
16,
805,
67,
2941,
67,
8291,
33,
1886,
67,
2941,
67,
8291,
16,
805,
67,
6702,
67,
8291,
33,
1886,
67,
6702,
67,
8291,
16,
262,
30,
365,
16186,
1106,
25648... |
self.need_charpos = any([d.need_charpos for d in self.directives \ if isinstance(d, Directive)]) | self.need_prettyprinter = any([d.need_prettyprinter \ for d in self.directives \ if isinstance(d, Directive)]) self.need_charpos = self.need_prettyprinter or \ any([d.need_charpos \ for d in self.directives \ if isinstance(d, Directive)]) | def __init__(self, control): if isinstance(control, basestring): self.directives = tuple(parse_control_string(control)) elif isinstance(control, (tuple, list)): self.directives = control self.need_charpos = any([d.need_charpos for d in self.directives \ if isinstance(d, Directive)]) | a1132b044a3d9566e527e7c92e625ea53ae3f492 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2063/a1132b044a3d9566e527e7c92e625ea53ae3f492/format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3325,
4672,
309,
1549,
12,
7098,
16,
10699,
4672,
365,
18,
30850,
273,
3193,
12,
2670,
67,
7098,
67,
1080,
12,
7098,
3719,
1327,
1549,
12,
7098,
16,
261,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3325,
4672,
309,
1549,
12,
7098,
16,
10699,
4672,
365,
18,
30850,
273,
3193,
12,
2670,
67,
7098,
67,
1080,
12,
7098,
3719,
1327,
1549,
12,
7098,
16,
261,... |
def do_hex(self,args): | opts_hex=OptionParser(usage="hex [-l len] path") opts_hex.add_option("-l", "--length", type="int", dest="length", default=256, help="number of bytes to read (default 256)") def do_hex(self,args,opts): | def do_hex(self,args): if len(args) != 1 : print "usage: hex path" return s=self.client.readAll(args[0]) print hexdump.dump(s) | 21a8a4b3d4dbf3aa514f44bdbb72fc77d361f2e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2726/21a8a4b3d4dbf3aa514f44bdbb72fc77d361f2e8/styxsh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1500,
67,
7118,
33,
1895,
2678,
12,
9167,
1546,
7118,
23059,
80,
562,
65,
589,
7923,
1500,
67,
7118,
18,
1289,
67,
3482,
2932,
17,
80,
3113,
5238,
2469,
3113,
618,
1546,
474,
3113,
1570,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1500,
67,
7118,
33,
1895,
2678,
12,
9167,
1546,
7118,
23059,
80,
562,
65,
589,
7923,
1500,
67,
7118,
18,
1289,
67,
3482,
2932,
17,
80,
3113,
5238,
2469,
3113,
618,
1546,
474,
3113,
1570,
154... |
if os.path.exists(depdir): print "Directory " + options.depprefix + " exists, removing in..." | if os.path.exists(depprefix): print "Directory " + depprefix + " exists, removing in..." | def progress(blocks, blocksize, total): ESC = chr(27); sys.stdout.write(ESC + '[2K' + ESC+'[G') text = " %i of %i bytes (%.0f percent) complete" % (blocks*blocksize, total, float(blocks*blocksize*100)/total) sys.stdout.write(text + '\x08'*len(text)) sys.stdout.flush() | 69e63582c2b3c6baabf63890dbd9bdebdfd6ca2c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5491/69e63582c2b3c6baabf63890dbd9bdebdfd6ca2c/getbuildtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4007,
12,
7996,
16,
18440,
16,
2078,
4672,
512,
2312,
273,
4513,
12,
5324,
1769,
2589,
18,
10283,
18,
2626,
12,
41,
2312,
397,
5271,
22,
47,
11,
397,
512,
2312,
6797,
63,
43,
6134,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4007,
12,
7996,
16,
18440,
16,
2078,
4672,
512,
2312,
273,
4513,
12,
5324,
1769,
2589,
18,
10283,
18,
2626,
12,
41,
2312,
397,
5271,
22,
47,
11,
397,
512,
2312,
6797,
63,
43,
6134,
9... |
jau = [ BooksView.wrap(a, width=30).strip() for a in au ] return QVariant("\n".join(jau)) | return QVariant("\n".join(au)) | def data(self, index, role): if role == Qt.DisplayRole or role == Qt.EditRole: row, col = index.row(), index.column() if col == 0: text = self.db.title(row) if text: return QVariant(BooksView.wrap(text, width=35)) elif col == 1: au = self.db.authors(row) if au: au = au.split(',') jau = [ BooksView.wrap(a, width=30).strip() for a in au ] return QVariant("\n".join(jau)) elif col == 2: size = self.db.max_size(row) if size: return QVariant(BooksView.human_readable(size)) elif col == 3: dt = self.db.timestamp(row) if dt: dt = dt - timedelta(seconds=time.timezone) + timedelta(hours=time.daylight) return QVariant(dt.strftime(BooksView.TIME_FMT).decode(preferred_encoding, 'replace')) elif col == 4: r = self.db.rating(row) r = r/2 if r else 0 return QVariant(r) elif col == 5: pub = self.db.publisher(row) if pub: return QVariant(BooksView.wrap(pub, 20)) elif col == 6: tags = self.db.tags(row) if tags: return QVariant(', '.join(tags.split(','))) elif col == 7: series = self.db.series(row) if series: return QVariant(series + ' [%d]'%self.db.series_index(row)) return NONE elif role == Qt.TextAlignmentRole and index.column() in [2, 3, 4]: return QVariant(Qt.AlignRight | Qt.AlignVCenter) elif role == Qt.ToolTipRole and index.isValid(): if index.column() in self.editable_cols: return QVariant(_("Double click to <b>edit</b> me<br><br>")) return NONE | 1e39c5ee210ae6046fcac853207123f7586facf7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/1e39c5ee210ae6046fcac853207123f7586facf7/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
501,
12,
2890,
16,
770,
16,
2478,
4672,
309,
2478,
422,
7354,
18,
4236,
2996,
578,
2478,
422,
7354,
18,
4666,
2996,
30,
1027,
16,
645,
273,
770,
18,
492,
9334,
770,
18,
2827,
1435,
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,
501,
12,
2890,
16,
770,
16,
2478,
4672,
309,
2478,
422,
7354,
18,
4236,
2996,
578,
2478,
422,
7354,
18,
4666,
2996,
30,
1027,
16,
645,
273,
770,
18,
492,
9334,
770,
18,
2827,
1435,
3... |
from bibclassify_webinterface import \ | from invenio.bibclassify_webinterface import \ | def print_records(req, recIDs, jrec=1, rg=10, format='hb', ot='', ln=CFG_SITE_LANG, relevances=[], relevances_prologue="(", relevances_epilogue="%%)", decompress=zlib.decompress, search_pattern='', print_records_prologue_p=True, print_records_epilogue_p=True, verbose=0, tab=''): """ Prints list of records 'recIDs' formatted according to 'format' in groups of 'rg' starting from 'jrec'. Assumes that the input list 'recIDs' is sorted in reverse order, so it counts records from tail to head. A value of 'rg=-9999' means to print all records: to be used with care. Print also list of RELEVANCES for each record (if defined), in between RELEVANCE_PROLOGUE and RELEVANCE_EPILOGUE. Print prologue and/or epilogue specific to 'format' if 'print_records_prologue_p' and/or print_records_epilogue_p' are True. """ # load the right message language _ = gettext_set_language(ln) # sanity checking: if req is None: return # get user_info (for formatting based on user) if isinstance(req, cStringIO.OutputType): user_info = {} else: user_info = collect_user_info(req) if len(recIDs): nb_found = len(recIDs) if rg == -9999: # print all records rg = nb_found else: rg = abs(rg) if jrec < 1: # sanity checks jrec = 1 if jrec > nb_found: jrec = max(nb_found-rg+1, 1) # will print records from irec_max to irec_min excluded: irec_max = nb_found - jrec irec_min = nb_found - jrec - rg if irec_min < 0: irec_min = -1 if irec_max >= nb_found: irec_max = nb_found - 1 #req.write("%s:%d-%d" % (recIDs, irec_min, irec_max)) if format.startswith('x'): # print header if needed if print_records_prologue_p: print_records_prologue(req, format) # print records recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] format_records(recIDs_to_print, format, ln=ln, search_pattern=search_pattern, record_separator="\n", user_info=user_info, req=req) # print footer if needed if print_records_epilogue_p: print_records_epilogue(req, format) elif format.startswith('t') or str(format[0:3]).isdigit(): # we are doing plain text output: for irec in range(irec_max, irec_min, -1): x = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) req.write(x) if x: req.write('\n') elif format == 'excel': recIDs_to_print = [recIDs[x] for x in range(irec_max, irec_min, -1)] create_excel(recIDs=recIDs_to_print, req=req, ln=ln, ot=ot) else: # we are doing HTML output: if format == 'hp' or format.startswith("hb_") or format.startswith("hd_"): # portfolio and on-the-fly formats: for irec in range(irec_max, irec_min, -1): req.write(print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose)) elif format.startswith("hb"): # HTML brief format: display_add_to_basket = True if user_info: if user_info['email'] == 'guest': if CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS > 4: display_add_to_basket = False else: if not user_info['precached_usebaskets']: display_add_to_basket = False req.write(websearch_templates.tmpl_record_format_htmlbrief_header( ln = ln)) for irec in range(irec_max, irec_min, -1): row_number = jrec+irec_max-irec recid = recIDs[irec] if relevances and relevances[irec]: relevance = relevances[irec] else: relevance = '' record = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) req.write(websearch_templates.tmpl_record_format_htmlbrief_body( ln = ln, recid = recid, row_number = row_number, relevance = relevance, record = record, relevances_prologue = relevances_prologue, relevances_epilogue = relevances_epilogue, display_add_to_basket = display_add_to_basket )) req.write(websearch_templates.tmpl_record_format_htmlbrief_footer( ln = ln, display_add_to_basket = display_add_to_basket)) elif format.startswith("hd"): # HTML detailed format: for irec in range(irec_max, irec_min, -1): if record_exists(recIDs[irec]) == -1: print_warning(req, _("The record has been deleted.")) continue unordered_tabs = get_detailed_page_tabs(get_colID(guess_primary_collection_of_a_record(recIDs[irec])), recIDs[irec], ln=ln) ordered_tabs_id = [(tab_id, values['order']) for (tab_id, values) in unordered_tabs.iteritems()] ordered_tabs_id.sort(lambda x,y: cmp(x[1],y[1])) link_ln = '' if ln != CFG_SITE_LANG: link_ln = '?ln=%s' % ln if CFG_WEBSEARCH_USE_ALEPH_SYSNOS: recid_to_display = get_fieldvalues(recIDs[irec], CFG_BIBUPLOAD_EXTERNAL_SYSNO_TAG)[0] else: recid_to_display = recIDs[irec] citedbynum = 0 #num of citations, to be shown in the cit tab references = -1 #num of references citedbynum = get_cited_by_count(recid_to_display) reftag = "" reftags = get_field_tags("reference") if reftags: reftag = reftags[0] tmprec = get_record(recid_to_display) if reftag and len(reftag) > 4: references = len(record_get_field_instances(tmprec, reftag[0:3], reftag[3], reftag[4])) tabs = [(unordered_tabs[tab_id]['label'], \ '%s/record/%s/%s%s' % (CFG_SITE_URL, recid_to_display, tab_id, link_ln), \ tab_id == tab, unordered_tabs[tab_id]['enabled']) \ for (tab_id, order) in ordered_tabs_id if unordered_tabs[tab_id]['visible'] == True] # load content if tab == 'usage': req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, citationnum=citedbynum, referencenum=references)) r = calculate_reading_similarity_list(recIDs[irec], "downloads") downloadsimilarity = None downloadhistory = None #if r: # downloadsimilarity = r if CFG_BIBRANK_SHOW_DOWNLOAD_GRAPHS: downloadhistory = create_download_history_graph_and_box(recIDs[irec], ln) r = calculate_reading_similarity_list(recIDs[irec], "pageviews") viewsimilarity = None if r: viewsimilarity = r content = websearch_templates.tmpl_detailed_record_statistics(recIDs[irec], ln, downloadsimilarity=downloadsimilarity, downloadhistory=downloadhistory, viewsimilarity=viewsimilarity) req.write(content) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln)) elif tab == 'citations': recid = recIDs[irec] req.write(webstyle_templates.detailed_record_container_top(recid, tabs, ln, citationnum=citedbynum, referencenum=references)) req.write(websearch_templates.tmpl_detailed_record_citations_prologue(recid, ln)) # Citing citinglist = calculate_cited_by_list(recid) req.write(websearch_templates.tmpl_detailed_record_citations_citing_list(recid, ln, citinglist=citinglist)) # Self-cited selfcited = get_self_cited_by(recid) req.write(websearch_templates.tmpl_detailed_record_citations_self_cited(recid, ln, selfcited=selfcited, citinglist=citinglist)) # Co-cited s = calculate_co_cited_with_list(recid) cociting = None if s: cociting = s req.write(websearch_templates.tmpl_detailed_record_citations_co_citing(recid, ln, cociting=cociting)) # Citation history, if needed citationhistory = None if citinglist: citationhistory = create_citation_history_graph_and_box(recid, ln) #debug if verbose > 3: print_warning(req, "Citation graph debug: " + \ str(len(citationhistory))) req.write(websearch_templates.tmpl_detailed_record_citations_citation_history(recid, ln, citationhistory)) req.write(websearch_templates.tmpl_detailed_record_citations_epilogue(recid, ln)) req.write(webstyle_templates.detailed_record_container_bottom(recid, tabs, ln)) elif tab == 'references': req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, citationnum=citedbynum, referencenum=references)) req.write(format_record(recIDs[irec], 'HDREF', ln=ln, user_info=user_info, verbose=verbose)) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln)) elif tab == 'keywords': from bibclassify_webinterface import \ record_get_keywords, get_sorting_options, \ generate_keywords, get_keywords_body from invenio.webinterface_handler import wash_urlargd form = req.form argd = wash_urlargd(form, { 'generate': (str, 'no'), 'sort': (str, 'occurrences'), 'type': (str, 'tagcloud'), 'numbering': (str, 'off'), }) recid = recIDs[irec] req.write(webstyle_templates.detailed_record_container_top(recid, tabs, ln, citationnum=citedbynum, referencenum=references)) if argd['generate'] == 'yes': # The user asked to generate the keywords. keywords = generate_keywords(req, recid) else: # Get the keywords contained in the MARC. keywords = record_get_keywords(recid, argd) if keywords: req.write(get_sorting_options(argd, keywords)) elif argd['sort'] == 'related' and not keywords: req.write('You may want to run BibIndex.') # Output the keywords or the generate button. get_keywords_body(keywords, req, recid, argd) req.write(webstyle_templates.detailed_record_container_bottom(recid, tabs, ln)) else: # Metadata tab req.write(webstyle_templates.detailed_record_container_top(recIDs[irec], tabs, ln, show_short_rec_p=False, citationnum=citedbynum, referencenum=references)) creationdate = None modificationdate = None if record_exists(recIDs[irec]) == 1: creationdate = get_creation_date(recIDs[irec]) modificationdate = get_modification_date(recIDs[irec]) content = print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose) content = websearch_templates.tmpl_detailed_record_metadata( recID = recIDs[irec], ln = ln, format = format, creationdate = creationdate, modificationdate = modificationdate, content = content) req.write(content) req.write(webstyle_templates.detailed_record_container_bottom(recIDs[irec], tabs, ln, creationdate=creationdate, modificationdate=modificationdate, show_short_rec_p=False)) if len(tabs) > 0: # Add the mini box at bottom of the page if CFG_WEBCOMMENT_ALLOW_REVIEWS: from invenio.webcomment import get_mini_reviews reviews = get_mini_reviews(recid = recIDs[irec], ln=ln) else: reviews = '' actions = format_record(recIDs[irec], 'HDACT', ln=ln, user_info=user_info, verbose=verbose) files = format_record(recIDs[irec], 'HDFILE', ln=ln, user_info=user_info, verbose=verbose) req.write(webstyle_templates.detailed_record_mini_panel(recIDs[irec], ln, format, files=files, reviews=reviews, actions=actions)) else: # Other formats for irec in range(irec_max, irec_min, -1): req.write(print_record(recIDs[irec], format, ot, ln, search_pattern=search_pattern, user_info=user_info, verbose=verbose)) else: print_warning(req, _("Use different search terms.")) | 1f36de4a1583defc003b35eb8e6d1701b25a5511 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12027/1f36de4a1583defc003b35eb8e6d1701b25a5511/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
67,
7094,
12,
3658,
16,
1950,
5103,
16,
525,
3927,
33,
21,
16,
14524,
33,
2163,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
6707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7094,
12,
3658,
16,
1950,
5103,
16,
525,
3927,
33,
21,
16,
14524,
33,
2163,
16,
740,
2218,
76,
70,
2187,
15835,
2218,
2187,
7211,
33,
19727,
67,
20609,
67,
10571,
16,
6707,
... |
tar = tarfile.open(self.arch_name, 'w:' + self.algo.replace('tar.', '')) | tar = tarfile.open(arch_name, 'w:' + self.algo.replace('tar.', '')) | def archive(self): """ Create the archive (override or subclass) """ import tarfile | 464a87414a1fb565e4e69a8076e1356940ff17e1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2886/464a87414a1fb565e4e69a8076e1356940ff17e1/Scripting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5052,
12,
2890,
4672,
3536,
1788,
326,
5052,
261,
10601,
578,
10177,
13,
3536,
1930,
25857,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
5052,
12,
2890,
4672,
3536,
1788,
326,
5052,
261,
10601,
578,
10177,
13,
3536,
1930,
25857,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
raise_opts = ["", "-raise"] | raise_opts = ["-noraise", ""] | def open(self, url, new=0, autoraise=True): if new == 0: action = self.remote_action elif new == 1: action = self.remote_action_newwin elif new == 2: if self.remote_action_newtab is None: action = self.remote_action_newwin else: action = self.remote_action_newtab else: raise Error("Bad 'new' parameter to open(); " + "expected 0, 1, or 2, got %s" % new) | 8e4d38088c2fe5a8a46273cdd213694be451bcaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/8e4d38088c2fe5a8a46273cdd213694be451bcaa/webbrowser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
5510,
4672,
309,
394,
422,
374,
30,
1301,
273,
365,
18,
7222,
67,
1128,
1327,
394,
422,
404,
30,
1301,
273,
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,
1696,
12,
2890,
16,
880,
16,
394,
33,
20,
16,
2059,
10610,
784,
33,
5510,
4672,
309,
394,
422,
374,
30,
1301,
273,
365,
18,
7222,
67,
1128,
1327,
394,
422,
404,
30,
1301,
273,
365,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.