rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
quantity_rest = 0 | quantity_rest = 0 | def action_consume(self, cr, uid, ids, quantity, location_id=False, context=None): ''' Consumed product with specific quatity from specific source location @ param cr: the database cursor @ param uid: the user id @ param ids: ids of stock move object to be consumed @ param quantity : specify consume quantity @ param location_id : specify source location @ param context: context arguments | 18be8e52469417aa8e0ec02e033c0942d0ad805f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/18be8e52469417aa8e0ec02e033c0942d0ad805f/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
21224,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10457,
16,
2117,
67,
350,
33,
8381,
16,
225,
819,
33,
7036,
4672,
9163,
22210,
329,
3017,
598,
2923,
25847,
560,
628,
2923,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21224,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10457,
16,
2117,
67,
350,
33,
8381,
16,
225,
819,
33,
7036,
4672,
9163,
22210,
329,
3017,
598,
2923,
25847,
560,
628,
2923,... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 770) else quickfix.IntField.__init__(self, 770, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
7301,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
7301,
13,
469,
9549,
904,
18,
1702,
974,
16186,
2738,
... |
0.21762156185440268 - 0.86801414289592493*I | 0.217621561854402 - 0.868014142895925*I | def cotan(self): """ EXAMPLES: sage: (1+I).cotan() 0.21762156185440268 - 0.86801414289592493*I sage: i = ComplexField(200).0 sage: (1+i).cotan() 0.21762156185440268136513424360523807352075436916785404091068128 - 0.86801414289592494863584920891627388827343874994609327121115055*I # 32-bit 0.21762156185440268136513424360523807352075436916785404091068128 - 0.86801414289592494863584920891627388827343874994609327121115055*I # 64-bit sage: i = ComplexField(220).0 sage: (1+i).cotan() 0.21762156185440268136513424360523807352075436916785404091068124239250 - 0.86801414289592494863584920891627388827343874994609327121115071646235*I # 32-bit 0.21762156185440268136513424360523807352075436916785404091068124239250 - 0.86801414289592494863584920891627388827343874994609327121115071646235*I # 64-bit """ return self.parent()(self._pari_().cotan()) | 293427b47ee2bb564117092226099ed44acd171f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/293427b47ee2bb564117092226099ed44acd171f/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
352,
304,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
71,
352,
304,
1435,
374,
18,
22,
4033,
8898,
28946,
30489,
6334,
3103,
300,
374,
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,
276,
352,
304,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
71,
352,
304,
1435,
374,
18,
22,
4033,
8898,
28946,
30489,
6334,
3103,
300,
374,
18,
... |
def DrawGrid(self): self.DC.SetPen(wx.Pen(wx.NamedColour(self.grid_color), 0)) | def DrawGrid(self, DC): DC.SetPen(wx.Pen(MakeColor(self.colors[COLOR_GRID_LINES]), 0)) | def DrawGrid(self): self.DC.SetPen(wx.Pen(wx.NamedColour(self.grid_color), 0)) | b25cb7db43121f1f6899b7ebfcd6ccc3806dd0f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/b25cb7db43121f1f6899b7ebfcd6ccc3806dd0f6/calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
6313,
12,
2890,
4672,
365,
18,
5528,
18,
694,
24251,
12,
27226,
18,
24251,
12,
27226,
18,
7604,
26404,
12,
2890,
18,
5222,
67,
3266,
3631,
374,
3719,
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,
0,
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,
10184,
6313,
12,
2890,
4672,
365,
18,
5528,
18,
694,
24251,
12,
27226,
18,
24251,
12,
27226,
18,
7604,
26404,
12,
2890,
18,
5222,
67,
3266,
3631,
374,
3719,
2,
-100,
-100,
-100,
-100,
... |
return self.version_compare(tmp) | return tmp[-1] | def latest_version(self, pkgname): tmp = self.package_versions(pkgname) return self.version_compare(tmp) | b0e61917179037533fcea89bb154f2074a0534fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10378/b0e61917179037533fcea89bb154f2074a0534fd/description_tree.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4891,
67,
1589,
12,
2890,
16,
29348,
4672,
225,
1853,
273,
365,
18,
5610,
67,
10169,
12,
10657,
529,
13,
327,
365,
18,
1589,
67,
9877,
12,
5645,
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,
4891,
67,
1589,
12,
2890,
16,
29348,
4672,
225,
1853,
273,
365,
18,
5610,
67,
10169,
12,
10657,
529,
13,
327,
365,
18,
1589,
67,
9877,
12,
5645,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
locale.setlocale(locale.LC_ALL, loc) | locale.setlocale(locale.LC_ALL, loc) | def Locale_Date(datum, loc='en_US'): """ Convert the locale number to a float @type number: str @param number: Date representation in locale @type loc: str @param loc: Customer locale """ # Complete locale with encoding if necessary if loc.find('.') == -1: loc += '.utf-8' try: locale.setlocale(locale.LC_ALL, loc) except locale.Error: raise Exception, 'Unsuported locale (%s)' % loc return Format_Date(datum, locale.nl_langinfo(locale.D_FMT)) | c041e3dad1fe98eaa603d782345fbf4bedbfc741 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10003/c041e3dad1fe98eaa603d782345fbf4bedbfc741/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6458,
67,
1626,
12,
3404,
379,
16,
1515,
2218,
275,
67,
3378,
11,
4672,
3536,
4037,
326,
2573,
1300,
358,
279,
1431,
225,
632,
723,
225,
1300,
30,
609,
632,
891,
1300,
30,
2167,
4335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6458,
67,
1626,
12,
3404,
379,
16,
1515,
2218,
275,
67,
3378,
11,
4672,
3536,
4037,
326,
2573,
1300,
358,
279,
1431,
225,
632,
723,
225,
1300,
30,
609,
632,
891,
1300,
30,
2167,
4335,
... |
return """"You must be authenticated to view this page. You are authenticated as "%s".""" % (login) | return ("You must be authenticated to view this page." "You are authenticated as "%s".") % (login) | def secure(self): login = self.authenticate() return """"You must be authenticated to view this page. You are authenticated as "%s".""" % (login) | f9bce60c179f61f101f7506d8da5f1c062b72d26 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6393/f9bce60c179f61f101f7506d8da5f1c062b72d26/authn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8177,
12,
2890,
4672,
3925,
273,
365,
18,
22035,
1435,
327,
3536,
6,
6225,
1297,
506,
9370,
358,
1476,
333,
1363,
18,
4554,
854,
9370,
487,
473,
9270,
31,
9,
87,
10,
9270,
31,
12123,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8177,
12,
2890,
4672,
3925,
273,
365,
18,
22035,
1435,
327,
3536,
6,
6225,
1297,
506,
9370,
358,
1476,
333,
1363,
18,
4554,
854,
9370,
487,
473,
9270,
31,
9,
87,
10,
9270,
31,
12123,
... |
if result[:11] == 'Bad command' and sys.platform == 'win32': | res = bbox_re.search(result) if res is None and sys.platform=='win32': | def convert_bounding_box(inname, outname): fid = open(inname,'r') oldfile = fid.read() fid.close() gsargs = '-dNOPAUSE -dBATCH -sDEVICE=bbox' # use cygwin gs if present cmd = 'gs %s %s' % (gsargs, inname) w, r = os.popen4(cmd) w.close() result = r.read() r.close() if result[:11] == 'Bad command' and sys.platform == 'win32': cmd = 'gswin32c %s %s' % (gsargs, inname) w, r = os.popen4(cmd) w.close() result = r.read() r.close() if result[:11] == 'Bad command': return False res = bbox_re.search(result) bbox = map(int,res.groups()) newstr = bbox2_re.sub("BoundingBox: %d %d %d %d" % tuple(bbox), oldfile) fid = open(outname, 'wb') fid.write(newstr) fid.close() return True | 09d23f7e8e736abc56a2ea5a98859b764df109a3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/09d23f7e8e736abc56a2ea5a98859b764df109a3/gist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
3653,
310,
67,
2147,
12,
267,
529,
16,
596,
529,
4672,
13444,
273,
1696,
12,
267,
529,
11189,
86,
6134,
1592,
768,
273,
13444,
18,
896,
1435,
13444,
18,
4412,
1435,
10763,
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,
1765,
67,
3653,
310,
67,
2147,
12,
267,
529,
16,
596,
529,
4672,
13444,
273,
1696,
12,
267,
529,
11189,
86,
6134,
1592,
768,
273,
13444,
18,
896,
1435,
13444,
18,
4412,
1435,
10763,
19... |
def draw(self, context): self._layout(context, 0, 0, context.width, context.height) | def draw(self, context): self._layout(context, 0, 0, context.width, context.height) | 98e1e81912d0dbac6aedf9117ef8e8b08cf796e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/98e1e81912d0dbac6aedf9117ef8e8b08cf796e3/style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
16,
819,
4672,
365,
6315,
6741,
12,
2472,
16,
374,
16,
374,
16,
819,
18,
2819,
16,
819,
18,
4210,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3724,
12,
2890,
16,
819,
4672,
365,
6315,
6741,
12,
2472,
16,
374,
16,
374,
16,
819,
18,
2819,
16,
819,
18,
4210,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
pkgpath = os.path.join(receiptsdir, item) | pkgpath = os.path.join(sl_receiptsdir, item) | def shouldRebuildDB(pkgdbpath): """ Checks to see if our internal package DB should be rebuilt. If anything in /Library/Receipts, /Library/Receipts/boms, or /Library/Receipts/db/a.receiptdb has a newer modtime than our database, we should rebuild. """ receiptsdir = "/Library/Receipts" bomsdir = "/Library/Receipts/boms" sl_receiptsdir = "/private/var/db/receipts" installhistory = "/Library/Receipts/InstallHistory.plist" applepkgdb = "/Library/Receipts/db/a.receiptdb" if not os.path.exists(pkgdbpath): return True packagedb_modtime = os.stat(pkgdbpath).st_mtime if os.path.exists(receiptsdir): receiptsdir_modtime = os.stat(receiptsdir).st_mtime if packagedb_modtime < receiptsdir_modtime: return True receiptlist = os.listdir(receiptsdir) for item in receiptlist: if item.endswith(".pkg"): pkgpath = os.path.join(receiptsdir, item) pkg_modtime = os.stat(pkgpath).st_mtime if (packagedb_modtime < pkg_modtime): return True if os.path.exists(bomsdir): bomsdir_modtime = os.stat(bomsdir).st_mtime if packagedb_modtime < bomsdir_modtime: return True bomlist = os.listdir(bomsdir) for item in bomlist: if item.endswith(".bom"): bompath = os.path.join(bomsdir, item) bom_modtime = os.stat(bompath).st_mtime if (packagedb_modtime < bom_modtime): return True if os.path.exists(sl_receiptsdir): receiptsdir_modtime = os.stat(sl_receiptsdir).st_mtime if packagedb_modtime < receiptsdir_modtime: return True receiptlist = os.listdir(sl_receiptsdir) for item in receiptlist: if item.endswith(".bom") or item.endswith(".plist"): pkgpath = os.path.join(receiptsdir, item) pkg_modtime = os.stat(pkgpath).st_mtime if (packagedb_modtime < pkg_modtime): return True if os.path.exists(installhistory): installhistory_modtime = os.stat(installhistory).st_mtime if packagedb_modtime < installhistory_modtime: return True if os.path.exists(applepkgdb): applepkgdb_modtime = os.stat(applepkgdb).st_mtime if packagedb_modtime < applepkgdb_modtime: return True # if we got this far, we don't need to update the db return False | ca3e0a2f06ebb441db4a8d7a6bb42bbbb2191445 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6241/ca3e0a2f06ebb441db4a8d7a6bb42bbbb2191445/removepackages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
426,
3510,
2290,
12,
10657,
1966,
803,
4672,
3536,
13074,
358,
2621,
309,
3134,
2713,
2181,
2383,
1410,
506,
283,
12406,
18,
971,
6967,
316,
342,
9313,
19,
4779,
27827,
16,
342,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1410,
426,
3510,
2290,
12,
10657,
1966,
803,
4672,
3536,
13074,
358,
2621,
309,
3134,
2713,
2181,
2383,
1410,
506,
283,
12406,
18,
971,
6967,
316,
342,
9313,
19,
4779,
27827,
16,
342,
93... |
if len(blacklist) > 0: for ceb in blacklist : if ce.find(ceb) > 0: passblack = 0 | for ceb in blacklist : if ce.find(ceb) > 0: passblack = 0 | def lcgInfo(self, tags, seList=None, blacklist=None, whitelist=None, vo='cms'): """ execute a resources discovery through bdii returns a list of resulting sites """ celist = [] | 7455213f20cb4d439c1ed5cc1b445b7bd2f1ca99 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/7455213f20cb4d439c1ed5cc1b445b7bd2f1ca99/SchedulerGLiteAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9109,
75,
966,
12,
2890,
16,
2342,
16,
695,
682,
33,
7036,
16,
11709,
33,
7036,
16,
10734,
33,
7036,
16,
19993,
2218,
6851,
11,
4672,
3536,
1836,
279,
2703,
11030,
3059,
13837,
2835,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9109,
75,
966,
12,
2890,
16,
2342,
16,
695,
682,
33,
7036,
16,
11709,
33,
7036,
16,
10734,
33,
7036,
16,
19993,
2218,
6851,
11,
4672,
3536,
1836,
279,
2703,
11030,
3059,
13837,
2835,
1... |
return render_to_response('saveSearch.html', {'form': form },context_instance=RequestContext(request),processors=[settings_processor]) | return render_to_response('saveSearch.html', {'form': form },context_instance=RequestContext(request)) | def saveSearch(request,search_id=None): if request.method == 'POST': form = saveSearchForm(request.POST) if form.is_valid(): if search_id: editedsearch = Search.objects.get(id=search_id) if request.user!=editedsearch.user: return HttpResponse("<p style='text-align:center;'>You don't have access to this search</p>") else: data = form.cleaned_data editedsearch = Search.objects.get(id=search_id) editedsearch.title = data['title'] editedsearch.description = data['description'] editedsearch.user=request.user editedsearch.timestamp=datetime.now().strftime("%d/%m/%y") editedsearch.isPublic = data['isPublic'] editedsearch.save() return HttpResponseRedirect('%ssearch/saved/' % settings.SITE_ROOT) else: data = form.cleaned_data request.session['search'].title = data['title'] request.session['search'].description = data['description'] request.session['search'].user=request.user request.session['search'].timestamp=datetime.now().strftime("%d/%m/%y") request.session['search'].isPublic = data['isPublic'] request.session['search'].save() return HttpResponseRedirect('%ssearch/saved/' % settings.SITE_ROOT) else: if search_id: oldsearch = Search.objects.get(id=search_id) if request.user!=oldsearch.user: return HttpResponse("<p style='text-align:center;'>You don't have access to this search</p>") form = saveSearchForm({'title':oldsearch.title,'description':oldsearch.description,'isPublic':oldsearch.isPublic, 'search_id':search_id}) else: form = saveSearchForm() return render_to_response('saveSearch.html', {'form': form },context_instance=RequestContext(request),processors=[settings_processor]) | c93ad06aaa77c2511dad5881fd1ee5b6ced6212a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6163/c93ad06aaa77c2511dad5881fd1ee5b6ced6212a/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2979,
12,
2293,
16,
3072,
67,
350,
33,
7036,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
646,
273,
1923,
2979,
1204,
12,
2293,
18,
3798,
13,
309,
646,
18,
291,
67,
877,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
2979,
12,
2293,
16,
3072,
67,
350,
33,
7036,
4672,
309,
590,
18,
2039,
422,
296,
3798,
4278,
646,
273,
1923,
2979,
1204,
12,
2293,
18,
3798,
13,
309,
646,
18,
291,
67,
877,
133... |
and not ignoreNone or faceClasses[edge.leftFaceLabel()] is not None]) | and (not ignoreNone or faceClasses[edge.leftFaceLabel()] is not None)]) | def applyFaceClassification(map, faceClasses, ignoreNone = True): """Removes all edges between faces with the same class/label. Uses `removeEdges()` internally. `faceClasses` should be a mapping from face labels to labels/classes that can be compared for equality. E.g. to faces face1 and face2 will be merged iff faceClasses[face1.label()] == faceClasses[face2.label()]. If `ignoreNone` is set (default), faces classified with `None` values will be ignored (i.e. not merged with neighbors that are also assigned None). `classifyFacesFromLabelImage` creates a suitable sequence (but there are better, more direct ways).""" return removeEdges(map, [ edge.label() for edge in map.edgeIter() if faceClasses[edge.leftFaceLabel()] == faceClasses[edge.rightFaceLabel()] and not ignoreNone or faceClasses[edge.leftFaceLabel()] is not None]) | bcfb82ac6d674e488f9a83ec4b51ad33955ce61a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/bcfb82ac6d674e488f9a83ec4b51ad33955ce61a/maputils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
11824,
19168,
12,
1458,
16,
7945,
4818,
16,
2305,
7036,
273,
1053,
4672,
3536,
6220,
777,
5231,
3086,
11058,
598,
326,
1967,
667,
19,
1925,
18,
14854,
1375,
4479,
10697,
20338,
12963... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
11824,
19168,
12,
1458,
16,
7945,
4818,
16,
2305,
7036,
273,
1053,
4672,
3536,
6220,
777,
5231,
3086,
11058,
598,
326,
1967,
667,
19,
1925,
18,
14854,
1375,
4479,
10697,
20338,
12963... |
return (packages, keyring, maxtid) | pkgdata[tid] = data return (packages, keyring, maxtid, pkgdata) | def readPackages(dbpath): import bsddb, cStringIO packages = {} keyring = None #openpgp.PGPKeyRing() maxtid = None db = bsddb.hashopen(dbpath + "Packages", "r") #for (tid, data) in db.iteritems(): for tid in db.keys(): data = db[tid] tid = unpack("I", tid)[0] if tid == 0: maxtid = unpack("I", data)[0] continue fd = cStringIO.StringIO(data) pkg = ReadRpm("rpmdb", fd=fd) pkg.readHeader(None, rpmdbtag, 1, 1) if pkg["name"] == "gpg-pubkey": #for k in openpgp.parsePGPKeys(pkg["description"]): # keyring.addKey(k) pkg["group"] = (pkg["group"],) packages[tid] = pkg return (packages, keyring, maxtid) | 36064e9e7b8187b1d2723e47eb83915d362cf0b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/36064e9e7b8187b1d2723e47eb83915d362cf0b4/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
11425,
12,
1966,
803,
4672,
1930,
7081,
449,
70,
16,
276,
780,
4294,
5907,
273,
2618,
20923,
273,
599,
468,
3190,
84,
6403,
18,
52,
9681,
653,
10369,
1435,
943,
18081,
273,
599,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
11425,
12,
1966,
803,
4672,
1930,
7081,
449,
70,
16,
276,
780,
4294,
5907,
273,
2618,
20923,
273,
599,
468,
3190,
84,
6403,
18,
52,
9681,
653,
10369,
1435,
943,
18081,
273,
599,
1... |
newlist.sort(key=lambda t: t[0].lower()) | newlist.sort(key=keyfunc) | def add_entry(word, subword, dic=new): entry = dic.get(word) if not entry: dic[word] = entry = [[], {}] if subword: add_entry(subword, '', dic=entry[1]) else: try: entry[0].append(builder.get_relative_uri('genindex', fn) + '#' + tid) except NoUri: pass | b423f9f280d4a3a68084201e1fdeb49f7db0f6ad /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5532/b423f9f280d4a3a68084201e1fdeb49f7db0f6ad/environment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4099,
12,
1095,
16,
720,
1095,
16,
11681,
33,
2704,
4672,
1241,
273,
11681,
18,
588,
12,
1095,
13,
309,
486,
1241,
30,
11681,
63,
1095,
65,
273,
1241,
273,
12167,
6487,
2618,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
4099,
12,
1095,
16,
720,
1095,
16,
11681,
33,
2704,
4672,
1241,
273,
11681,
18,
588,
12,
1095,
13,
309,
486,
1241,
30,
11681,
63,
1095,
65,
273,
1241,
273,
12167,
6487,
2618,
... |
self.browser = None | def __init__(self, hits): global _resultscounter hits = map(lambda (path, hits): (sucktitle(path), path, hits), hits) hits.sort() self.hits = hits nicehits = map( lambda (title, path, hits): title + '\r' + string.join( map(lambda (c, p): "%s (%d)" % (p, c), hits), ', '), hits) nicehits.sort() self.w = W.Window((440, 300), "Search results %d" % _resultscounter, minsize = (200, 100)) self.w.results = TwoLineList((-1, -1, 1, -14), nicehits, self.listhit) self.w.open() self.w.bind('return', self.listhit) self.w.bind('enter', self.listhit) _resultscounter = _resultscounter + 1 self.browser = None | 098c24d1623b3e159a985711de5b9d4b7648128e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/098c24d1623b3e159a985711de5b9d4b7648128e/PyDocSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11076,
4672,
2552,
389,
2088,
1017,
2096,
11076,
273,
852,
12,
14661,
261,
803,
16,
11076,
4672,
261,
87,
9031,
2649,
12,
803,
3631,
589,
16,
11076,
3631,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11076,
4672,
2552,
389,
2088,
1017,
2096,
11076,
273,
852,
12,
14661,
261,
803,
16,
11076,
4672,
261,
87,
9031,
2649,
12,
803,
3631,
589,
16,
11076,
3631,
... | |
if not section or section == "DEFAULT": | if not section or section == DEFAULTSECT: option = self.optionxform(option) | def has_option(self, section, option): """Check for the existence of a given option in a given section.""" if not section or section == "DEFAULT": return option in self.__defaults elif not self.has_section(section): return 0 else: option = self.optionxform(option) return option in self.__sections[section] | c2ff9051d2dace414d5ec928fa3e41edd9297992 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c2ff9051d2dace414d5ec928fa3e41edd9297992/ConfigParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
3482,
12,
2890,
16,
2442,
16,
1456,
4672,
3536,
1564,
364,
326,
15782,
434,
279,
864,
1456,
316,
279,
864,
2442,
12123,
309,
486,
2442,
578,
2442,
422,
3331,
1090,
1268,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
3482,
12,
2890,
16,
2442,
16,
1456,
4672,
3536,
1564,
364,
326,
15782,
434,
279,
864,
1456,
316,
279,
864,
2442,
12123,
309,
486,
2442,
578,
2442,
422,
3331,
1090,
1268,
30,
1... |
err_log= err_log +'\n Application Error : ' + str(e) | err_log= err_log +'\n\nApplication Error : ' + str(e) | 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') recordlist.pop() for line in recordlist: if line[0] == '0': # header data bank_statement["bank_statement_line"]={} bank_statement['date'] = str2date(line[5:11]) bank_statement['journal_id']=data['form']['journal_id'] period_id = pool.get('account.period').search(cr,uid,[('date_start','<=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d"))),('date_stop','>=',time.strftime('%Y-%m-%d',time.strptime(bank_statement['date'],"%y/%m/%d")))]) if not period_id: raise wizard.except_wizard('Data Error!', "The File contains the Date which doesn't fall within the pre-defined period!'") bank_statement['period_id'] = period_id[0] bank_statement['state']='draft' elif line[0] == '1': # old balance data bal_start = list2float(line[43:58]) if line[42] == '1': # 1= Debit bal_start = - bal_start bank_statement["balance_start"]= bal_start bank_statement["acc_number"]=line[5:17] bank_statement["acc_holder"]=line[64:90] elif line[0]=='2': # movement data record 2 if line[1]=='1': # movement data record 2.1 st_line = {} st_line['statement_id']=0 st_line['name'] = line[2:10] st_line['date'] = time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")) st_line_amt = list2float(line[32:47]) if line[61]=='1': st_line['ref']=(line[65:77]) st_line['free_comm']='' else: st_line['free_comm']=line[62:115] st_line['ref']='' st_line['val_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[47:53]),"%y/%m/%d")), st_line['entry_date']=time.strftime('%Y-%m-%d',time.strptime(str2date(line[115:121]),"%y/%m/%d")), st_line['partner_id']=0 if line[31] == '1': #1=Debit st_line_amt = - st_line_amt st_line['account_id'] = def_pay_acc else: st_line['account_id'] = def_rec_acc st_line['amount'] = st_line_amt bank_statement_lines[st_line['name']]=st_line bank_statement["bank_statement_line"]=bank_statement_lines elif line[1] == '3': # movement data record 3.1 st_line_name = line[2:10] st_line_partner_acc = str(line[10:47]).strip() cntry_number=line[10:47] contry_name=line[47:125] #bank_ids = pool.get('res.partner.bank').search(cr,uid,[('number','=',st_line_partner_acc)]) bank_ids = pool.get('res.partner.bank').search(cr,uid,[('acc_number','=',st_line_partner_acc)]) if bank_ids: bank = pool.get('res.partner.bank').browse(cr,uid,bank_ids[0],context) line=bank_statement_lines[st_line_name] line['cntry_number']=cntry_number line['contry_name']=contry_name if line and bank.partner_id: line['partner_id']=bank.partner_id.id if line['amount'] < 0 : line['account_id']=bank.partner_id.property_account_payable.id else: line['account_id']=bank.partner_id.property_account_receivable.id bank_statement_lines[st_line_name]=line else: line=bank_statement_lines[st_line_name] line['cntry_number']=cntry_number line['contry_name']=contry_name bank_statement_lines[st_line_name]=line bank_statement["bank_statement_line"]=bank_statement_lines elif line[0]=='3': pass elif line[0]=='8': # new balance record bal_end = list2float(line[42:57]) if line[41] == '1': # 1=Debit bal_end = - bal_end bank_statement["balance_end_real"]= bal_end elif line[0]=='9': # footer record bank_statements.append(bank_statement) #end for bkst_list=[] #bk_st_id=0 nb_err=0 err_log='' str_log='' std_log='' str_log1 = "Coda File is Imported : " str_not='' str_not1='' for statement in bank_statements: try: bk_st_id = pool.get('account.bank.statement').create(cr,uid,{ 'journal_id': statement['journal_id'], 'date':time.strftime('%Y-%m-%d',time.strptime(statement['date'],"%y/%m/%d")), 'period_id':statement['period_id'], 'balance_start': statement["balance_start"], 'balance_end_real': statement["balance_end_real"], 'state':'draft', }) lines=statement["bank_statement_line"] for value in lines: line=lines[value] str_not1="Partner name:%s \n Partner Account Number:%s \n Communication:%s \n Value Date:%s \n Entry Date:%s \n"%(line["contry_name"],line["cntry_number"],line["free_comm"],line["val_date"],line["entry_date"][0]) id=pool.get('account.bank.statement.line').create(cr,uid,{ 'name':line['name'], 'date': line['date'], 'amount': line['amount'], #'partner_id':line['partner_id'] or 0, 'partner_id':line['partner_id'] or 0, 'account_id':line['account_id'], 'statement_id': bk_st_id, 'note':str_not1, 'ref':line['ref'], }) cr.commit() str_not= "\n \nAccount Number: %s \nAccount Holder Name: %s " %(statement["acc_number"],statement["acc_holder"]) std_log = std_log + "\nDate : %s, Starting Balance : %.2f , Ending Balance : %.2f "\ %(statement['date'], float(statement["balance_start"]), float(statement["balance_end_real"])) bkst_list.append(bk_st_id) except osv.except_osv, e: cr.rollback() nb_err+=1 err_log= err_log +'\n Application Error : ' + str(e) | 10c86cbdb20071e46450c22f2e1d268cc160de0e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7339/10c86cbdb20071e46450c22f2e1d268cc160de0e/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,
225,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
11012,
69,
768,
273,
501,
3292,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
225,
2845,
273,
2845,
264,
18,
588,
67,
6011,
12,
3353,
18,
20979,
13,
11012,
69,
768,
273,
501,
3292,... |
None, [cty.c_int], | None, [cty.c_int], | def flps_linestyle(p1): """ flps_linestyle(p1) """ _flps_linestyle(p1) | 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,
1121,
67,
7511,
19706,
12,
84,
21,
4672,
3536,
1183,
1121,
67,
7511,
19706,
12,
84,
21,
13,
3536,
225,
389,
2242,
1121,
67,
7511,
19706,
12,
84,
21,
13,
282,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
1121,
67,
7511,
19706,
12,
84,
21,
4672,
3536,
1183,
1121,
67,
7511,
19706,
12,
84,
21,
13,
3536,
225,
389,
2242,
1121,
67,
7511,
19706,
12,
84,
21,
13,
282,
2,
-100,
-100,
-10... |
text = _("Package selection is disabled due to an error in setup. Please fix your repository configuration and try again.\n\n%s") $ msg | text = _("Package selection is disabled due to an error in setup. Please fix your repository configuration and try again.\n\n%s") % msg | def __init__ (self, callback=None): import tempfile | 75be912b009381fd2b8b2f899db54f9f5b04d2db /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5376/75be912b009381fd2b8b2f899db54f9f5b04d2db/packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1348,
33,
7036,
4672,
1930,
13275,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
1348,
33,
7036,
4672,
1930,
13275,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
mb.member_functions( "Instance" ).call_policies = call_policies.return_internal_reference( ) mb.free_function( "gGetApplication" ).call_policies = call_policies.return_internal_reference( ) | mb.member_functions( "Instance" ).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object ) mb.free_function( "gGetApplication" ).call_policies = call_policies.return_value_policy( call_policies.reference_existing_object ) | def camel_convert(name): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() | 1d84cb9355520f838700035751a60bc7f388e4b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14932/1d84cb9355520f838700035751a60bc7f388e4b2/xfx_utility.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8990,
67,
6283,
12,
529,
4672,
272,
21,
273,
283,
18,
1717,
2668,
10604,
13,
3816,
37,
17,
62,
6362,
69,
17,
94,
7941,
2187,
436,
8314,
21,
22202,
22,
2187,
508,
13,
327,
283,
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,
8990,
67,
6283,
12,
529,
4672,
272,
21,
273,
283,
18,
1717,
2668,
10604,
13,
3816,
37,
17,
62,
6362,
69,
17,
94,
7941,
2187,
436,
8314,
21,
22202,
22,
2187,
508,
13,
327,
283,
18,
... |
if hasattr(os, "symlink"): os.symlink( | os.remove(test_support.TESTFN + "2") f = open(test_support.TESTFN + "2", "wb") f.write("bar") f.close() self.assertIs( posixpath.samefile( | def test_samefile(self): f = open(test_support.TESTFN + "1", "wb") try: f.write("foo") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "1" ), True ) # If we don't have links, assume that os.stat doesn't return resonable # inode information and thus, that samefile() doesn't work if hasattr(os, "symlink"): os.symlink( test_support.TESTFN + "1", test_support.TESTFN + "2" ) self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), True ) os.remove(test_support.TESTFN + "2") f = open(test_support.TESTFN + "2", "wb") f.write("bar") f.close() self.assertIs( posixpath.samefile( test_support.TESTFN + "1", test_support.TESTFN + "2" ), False ) finally: if not f.close(): f.close() try: os.remove(test_support.TESTFN + "1") except os.error: pass try: os.remove(test_support.TESTFN + "2") except os.error: pass | dbead56cb603e5e34bad0dc6e066d7dec411b422 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/dbead56cb603e5e34bad0dc6e066d7dec411b422/test_posixpath.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14307,
768,
12,
2890,
4672,
284,
273,
1696,
12,
3813,
67,
13261,
18,
16961,
19793,
397,
315,
21,
3113,
315,
9464,
7923,
775,
30,
284,
18,
2626,
2932,
11351,
7923,
284,
18,
44... |
p[0] = pywbem.CIMMethod(mname, return_type=dt, parameters=params, | p[0] = CIMMethod(mname, return_type=dt, parameters=params, | def p_methodDeclaration(p): """methodDeclaration : dataType methodName '(' ')' ';' | dataType methodName '(' parameterList ')' ';' | qualifierList dataType methodName '(' ')' ';' | qualifierList dataType methodName '(' parameterList ')' ';' """ paramlist = [] quals = [] if isinstance(p[1], basestring): # no quals dt = p[1] mname = p[2] if p[4] != ')': paramlist = p[4] else: # quals present quals = p[1] dt = p[2] mname = p[3] if p[5] != ')': paramlist = p[5] params = dict([(param.name, param) for param in paramlist]) quals = dict([(q.name, q) for q in quals]) p[0] = pywbem.CIMMethod(mname, return_type=dt, parameters=params, qualifiers=quals) # note: class_origin is set when adding method to class. # TODO what to do with propagated? | d1a547f385819908b15c26774bc5fc75671b5883 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10648/d1a547f385819908b15c26774bc5fc75671b5883/mof_compiler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
67,
2039,
6094,
12,
84,
4672,
3536,
2039,
6094,
294,
8891,
4918,
7321,
5777,
7554,
571,
8891,
4918,
7321,
1569,
682,
5777,
7554,
571,
12327,
682,
8891,
4918,
7321,
5777,
7554,
571,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
67,
2039,
6094,
12,
84,
4672,
3536,
2039,
6094,
294,
8891,
4918,
7321,
5777,
7554,
571,
8891,
4918,
7321,
1569,
682,
5777,
7554,
571,
12327,
682,
8891,
4918,
7321,
5777,
7554,
571,
... |
script.write(" /sbin/ip route replace $IP/32 table $LINK" | script.write(" /sbin/ip route replace $IP table $LINK proto static" | def _WriteNetScript(self, instance, seq, nic): """Write a script to connect a net interface to the proper bridge. | 8866ec860a32980a838f7a47815ac33142c56028 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/8866ec860a32980a838f7a47815ac33142c56028/hv_kvm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3067,
7308,
3651,
12,
2890,
16,
791,
16,
3833,
16,
11562,
4672,
3536,
3067,
279,
2728,
358,
3077,
279,
2901,
1560,
358,
326,
5338,
10105,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3067,
7308,
3651,
12,
2890,
16,
791,
16,
3833,
16,
11562,
4672,
3536,
3067,
279,
2728,
358,
3077,
279,
2901,
1560,
358,
326,
5338,
10105,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.cr.execute("SELECT COALESCE(SUM(debit-credit), 0) FROM account_move_line WHERE account_id=%d AND date>=%s AND date<=%s and state<>'draft'", (a.id, date1, date2)) node_achievements = float(self.cr.fetchone()[0]) * (post_obj.sens=='produit' and -1 or 1) childs_achievements = reduce(operator.add, [compute_achievements(c) for c in a.child_ids], 0) | self.cr.execute("SELECT COALESCE(SUM(debit-credit), 0) " \ "FROM account_move_line "\ "WHERE account_id = %d " \ "AND date>=%s " \ "AND date<=%s " \ "AND state<>'draft'", (a.id, date1, date2)) node_achievements = float(self.cr.fetchone()[0]) * \ (post_obj.sens == 'produit' and -1 or 1) childs_achievements = reduce(operator.add, [compute_achievements(c) for c in a.child_ids], 0) | def compute_achievements(a): self.cr.execute("SELECT COALESCE(SUM(debit-credit), 0) FROM account_move_line WHERE account_id=%d AND date>=%s AND date<=%s and state<>'draft'", (a.id, date1, date2)) | 68aae5136530777994716ab44554cf3f5c7bd8d1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/68aae5136530777994716ab44554cf3f5c7bd8d1/account_analytic_budget_report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
497,
1385,
90,
17110,
12,
69,
4672,
365,
18,
3353,
18,
8837,
2932,
4803,
7910,
37,
11386,
1441,
12,
14020,
12,
323,
3682,
17,
20688,
3631,
374,
13,
4571,
2236,
67,
8501,
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,
3671,
67,
497,
1385,
90,
17110,
12,
69,
4672,
365,
18,
3353,
18,
8837,
2932,
4803,
7910,
37,
11386,
1441,
12,
14020,
12,
323,
3682,
17,
20688,
3631,
374,
13,
4571,
2236,
67,
8501,
67,
... |
headers=None, **kws): | headers=None): | def _httpreq(self, service_path, method='GET', body=None, form=None, headers=None, **kws): """ make an http request to the service. | 47e6fe17862a5f974e46929577872fc98af8f950 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11603/47e6fe17862a5f974e46929577872fc98af8f950/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2022,
1484,
85,
12,
2890,
16,
1156,
67,
803,
16,
707,
2218,
3264,
2187,
1417,
33,
7036,
16,
646,
33,
7036,
16,
1607,
33,
7036,
4672,
3536,
1221,
392,
1062,
590,
358,
326,
1156,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2022,
1484,
85,
12,
2890,
16,
1156,
67,
803,
16,
707,
2218,
3264,
2187,
1417,
33,
7036,
16,
646,
33,
7036,
16,
1607,
33,
7036,
4672,
3536,
1221,
392,
1062,
590,
358,
326,
1156,
... |
print resource, lang | def cmd_set_translation(argv, path_to_tx=None): "Assign translation files to a resource" usage="usage: %prog [tx_options] set_translation [options] <file>" description="Assign a file as the translation file of a specific resource"\ " in a given language. These info is stored in a configuration file"\ " and is used for synchronization between the server and the local"\ " repository" parser = OptionParser(usage=usage, description=description) parser.add_option("-l","--language", action="store", dest="lang", default=None, help="Language of the translation file") parser.add_option("-r","--resource", action="store", dest="resource_slug", default=None, help="Specify resource name") (options, args) = parser.parse_args(argv) resource = options.resource_slug lang = options.lang print resource, lang if not resource or not lang: parser.error("You need to specify a resource and a language for the" " translation") if len(args) != 1: parser.error("Please specify a file") path_to_file = args[0] if not os.path.exists(path_to_file): utils.MSG("tx: File does not exist.") return # instantiate the project.Project prj = project.Project(path_to_tx) root_dir = prj.txdata['meta']['root_dir'] if root_dir not in os.path.normpath(os.path.abspath(path_to_file)): utils.MSG("File must be under the project root directory.") return map_object = {} for r_entry in prj.txdata['resources']: if r_entry['resource_slug'] == resource: map_object = r_entry break if not map_object: utils.MSG("tx: You should first run 'set_source_file' to map the source file.") return if lang == map_object['source_lang']: utils.MSG("tx: You cannot set translation file for the source language.") utils.MSG("Source languages contain the strings which will be translated!") return utils.MSG("Updating txdata file ...") path_to_file = os.path.relpath(path_to_file, root_dir) if map_object['translations'].has_key(lang): for key, value in map_object['translations'][lang].items(): if value == path_to_file: utils.MSG("tx: The file already exists in the specific resource.") return map_object['translations'][lang]['file'] = path_to_file else: # Create the language file list map_object['translations'][lang] = {'file' : path_to_file} prj.save() utils.MSG("Done.") | 5d36dc6aa7124bc32c1ce18630e5d16730ad2911 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11326/5d36dc6aa7124bc32c1ce18630e5d16730ad2911/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
542,
67,
10173,
12,
19485,
16,
589,
67,
869,
67,
978,
33,
7036,
4672,
315,
4910,
4794,
1390,
358,
279,
1058,
6,
225,
4084,
1546,
9167,
30,
738,
14654,
306,
978,
67,
2116,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1797,
67,
542,
67,
10173,
12,
19485,
16,
589,
67,
869,
67,
978,
33,
7036,
4672,
315,
4910,
4794,
1390,
358,
279,
1058,
6,
225,
4084,
1546,
9167,
30,
738,
14654,
306,
978,
67,
2116,
6... | |
if pkt: self.dissect(pkt) | if _pkt: self.dissect(_pkt) if not _internal: self.dissection_done(self) | def __init__(self, pkt="", **fields): self.time = time.time() self.aliastypes = [ self.__class__ ] + self.aliastypes self.default_fields = {} self.overloaded_fields = {} self.fields={} self.fieldtype={} self.__dict__["payload"] = NoPayload() for f in self.fields_desc: self.default_fields[f] = f.default self.fieldtype[f] = f self.initialized = 1 if pkt: self.dissect(pkt) for f in fields.keys(): self.fields[f] = self.fieldtype[f].any2i(self,fields[f]) | bb17e27cf238d69b2d6d3093a41494135963bc23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/bb17e27cf238d69b2d6d3093a41494135963bc23/scapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11536,
1546,
3113,
2826,
2821,
4672,
365,
18,
957,
225,
273,
813,
18,
957,
1435,
365,
18,
18083,
689,
989,
273,
306,
365,
16186,
1106,
972,
308,
397,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
11536,
1546,
3113,
2826,
2821,
4672,
365,
18,
957,
225,
273,
813,
18,
957,
1435,
365,
18,
18083,
689,
989,
273,
306,
365,
16186,
1106,
972,
308,
397,
365... |
sage: w.suffix_trie() | sage: w.suffix_trie() | def suffix_trie(self): r""" Returns the suffix trie of self. The *suffix trie* of a finite word `w` is a data structure representing the factors of `w`. It is a tree whose edges are labelled with letters of `w`, and whose leafs correspond to suffixes of `w`. See sage.combinat.words.suffix_trees.SuffixTrie? for more information. EXAMPLES:: | 3b1af04f0a27d5f0e8da71474158c869f20b49a6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/3b1af04f0a27d5f0e8da71474158c869f20b49a6/word.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3758,
67,
3051,
12,
2890,
4672,
436,
8395,
2860,
326,
3758,
19080,
434,
365,
18,
225,
1021,
380,
8477,
19080,
14,
434,
279,
25922,
2076,
1375,
91,
68,
353,
279,
501,
3695,
5123,
326,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3758,
67,
3051,
12,
2890,
4672,
436,
8395,
2860,
326,
3758,
19080,
434,
365,
18,
225,
1021,
380,
8477,
19080,
14,
434,
279,
25922,
2076,
1375,
91,
68,
353,
279,
501,
3695,
5123,
326,
1... |
def end_var(self): self.end_var() | def end_var(self): self.end_i() | def end_var(self): self.end_var() | 20b35690ee3c685b26abc9a7ddc1fe028abe1f31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/20b35690ee3c685b26abc9a7ddc1fe028abe1f31/htmllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
67,
1401,
12,
2890,
4672,
365,
18,
409,
67,
1401,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
679,
67,
1401,
12,
2890,
4672,
365,
18,
409,
67,
1401,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
class CompressedArray: | class CompressedArray(object): | def __init__(self, function, arguments): self.function = function self.arguments = arguments | add010a0724b58d582a54819961c43716c7b4604 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/add010a0724b58d582a54819961c43716c7b4604/multimethod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
445,
16,
1775,
4672,
365,
18,
915,
273,
445,
365,
18,
7099,
273,
1775,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
445,
16,
1775,
4672,
365,
18,
915,
273,
445,
365,
18,
7099,
273,
1775,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): | def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): | def __init__(self, counts=None, calledfuncs=None, infile=None, outfile=None): self.counts = counts if self.counts is None: self.counts = {} self.counter = self.counts.copy() # map (filename, lineno) to count self.calledfuncs = calledfuncs if self.calledfuncs is None: self.calledfuncs = {} self.calledfuncs = self.calledfuncs.copy() self.infile = infile self.outfile = outfile if self.infile: # try and merge existing counts file try: thingie = pickle.load(open(self.infile, 'r')) if type(thingie) is types.DictType: # backwards compatibility for old trace.py after Zooko touched it but before calledfuncs --Zooko 2001-10-24 self.update(self.__class__(thingie)) elif type(thingie) is types.TupleType and len(thingie) == 2: counts, calledfuncs = thingie self.update(self.__class__(counts, calledfuncs)) except (IOError, EOFError): pass except pickle.UnpicklingError: # backwards compatibility for old trace.py before Zooko touched it --Zooko 2001-10-24 self.update(self.__class__(marshal.load(open(self.infile)))) | 1255e8bca5f975b133653db2e2f74b0d4cb7a9da /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1255e8bca5f975b133653db2e2f74b0d4cb7a9da/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6880,
33,
7036,
16,
2566,
17728,
33,
7036,
16,
14568,
33,
7036,
16,
8756,
33,
7036,
4672,
365,
18,
8008,
273,
6880,
309,
365,
18,
8008,
353,
599,
30,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
6880,
33,
7036,
16,
2566,
17728,
33,
7036,
16,
14568,
33,
7036,
16,
8756,
33,
7036,
4672,
365,
18,
8008,
273,
6880,
309,
365,
18,
8008,
353,
599,
30,
3... |
cmdclass = {"uninstall" : uninstall, "install" : install, "install_data" : install_data, "build_ext" : build_ext, "sdist" : sdist}, | cmdclass = {"uninstall" : uninstall, "install" : install, "install_data" : install_data, "build_ext" : build_ext, "sdist" : sdist}, | def add_defaults (self): _sdist.add_defaults (self) # Remove pyx source and add c source if os.path.exists ("src/compizconfig.pyx"): self.filelist.exclude_pattern ("src/compizconfig.pyx") self.filelist.append ("src/compizconfig.c") | 90823d58ea0d9aa94581e62c4c9c0e9ffef69b69 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7183/90823d58ea0d9aa94581e62c4c9c0e9ffef69b69/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7606,
261,
2890,
4672,
389,
87,
4413,
18,
1289,
67,
7606,
261,
2890,
13,
468,
3581,
2395,
92,
1084,
471,
527,
276,
1084,
309,
1140,
18,
803,
18,
1808,
7566,
4816,
19,
2919,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
7606,
261,
2890,
4672,
389,
87,
4413,
18,
1289,
67,
7606,
261,
2890,
13,
468,
3581,
2395,
92,
1084,
471,
527,
276,
1084,
309,
1140,
18,
803,
18,
1808,
7566,
4816,
19,
2919,
... |
self.assertEqual(0x80000000, -2147483648L) self.assertEqual(0xffffffff, -1) self.assertEqual(-(0x80000000), 2147483648L) self.assertEqual(-(0xffffffff), 1) self.assertEqual(-0x80000000, 2147483648L) self.assertEqual(-0xffffffff, 1) | if platform_long_is_32_bits: self.assertEqual(0x80000000, -2147483648L) self.assertEqual(0xffffffff, -1) self.assertEqual(-(0x80000000), 2147483648L) self.assertEqual(-(0xffffffff), 1) self.assertEqual(-0x80000000, 2147483648L) self.assertEqual(-0xffffffff, 1) else: self.assertEqual(0x8000000000000000, -9223372036854775808L) self.assertEqual(0xffffffffffffffff, -1) self.assertEqual(-(0x8000000000000000), 9223372036854775808L) self.assertEqual(-(0xffffffffffffffff), 1) self.assertEqual(-0x8000000000000000, 9223372036854775808L) self.assertEqual(-0xffffffffffffffff, 1) | def test_hex_unsigned(self): # This test is in a <string> so we can ignore the warnings exec """if 1: # Positive-looking constants with negavive values self.assertEqual(0x80000000, -2147483648L) self.assertEqual(0xffffffff, -1) # Ditto with a minus sign and parentheses self.assertEqual(-(0x80000000), 2147483648L) self.assertEqual(-(0xffffffff), 1) # Ditto with a minus sign and NO parentheses # This failed in Python 2.2 through 2.2.2 and in 2.3a1 self.assertEqual(-0x80000000, 2147483648L) self.assertEqual(-0xffffffff, 1) \n""" | dcfdceb9a21881b58f0278dda92a7cdce6782614 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/dcfdceb9a21881b58f0278dda92a7cdce6782614/test_hexoct.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7118,
67,
22297,
12,
2890,
4672,
468,
1220,
1842,
353,
316,
279,
411,
1080,
34,
1427,
732,
848,
2305,
326,
5599,
1196,
3536,
430,
404,
30,
468,
6818,
3720,
17,
7330,
310,
681... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7118,
67,
22297,
12,
2890,
4672,
468,
1220,
1842,
353,
316,
279,
411,
1080,
34,
1427,
732,
848,
2305,
326,
5599,
1196,
3536,
430,
404,
30,
468,
6818,
3720,
17,
7330,
310,
681... |
d._post(builder, env, envname, self) task = self.gentask(builder, env, envname, 'cprogram', options, self.plugins) | d._post(builder, env, envname, [self]+blacklist) task = self.gentask(builder, env, envname, 'cprogram', options, extradepends=self.plugins, blacklist=[self]+blacklist) | def _post(self, builder, env, envname): for d in self.depends: d._post(builder, env, envname) options = coptions() if env['STATIC']: for d in self.plugins: d._post(builder, env, envname, self) task = self.gentask(builder, env, envname, 'cprogram', options, self.plugins) elif not self.tasks.has_key(envname): task = self.gentask(builder, env, envname, 'cprogram', options) for d in self.plugins: d._post(builder, env, envname, self) | bb9405bd0d9f5558082aacf11e1b5e9479adec61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7302/bb9405bd0d9f5558082aacf11e1b5e9479adec61/module.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2767,
12,
2890,
16,
2089,
16,
1550,
16,
1550,
529,
4672,
364,
302,
316,
365,
18,
27360,
30,
302,
6315,
2767,
12,
9574,
16,
1550,
16,
1550,
529,
13,
702,
273,
1825,
573,
1435,
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,
389,
2767,
12,
2890,
16,
2089,
16,
1550,
16,
1550,
529,
4672,
364,
302,
316,
365,
18,
27360,
30,
302,
6315,
2767,
12,
9574,
16,
1550,
16,
1550,
529,
13,
702,
273,
1825,
573,
1435,
30... |
self.tool.registerScript('plone_javascripts.js') | self.tool.registerScript('jstest.js') | def afterSetUp(self): self.tool = getattr(self.portal, JSTOOLNAME) self.tool.clearResources() self.toolpath = '/' + self.tool.absolute_url(1) self.portalpath = '/' + getToolByName(self.portal, 'portal_url')(1) self.tool.registerScript('plone_javascripts.js') self.setRoles(['Manager']) self.portal.invokeFactory('Document', 'index_html') self.setRoles(['Member']) | 4b851d95cf836272a0108bdeda337e7d9a2c055e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12274/4b851d95cf836272a0108bdeda337e7d9a2c055e/testJSRegistry.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
694,
1211,
12,
2890,
4672,
365,
18,
6738,
273,
3869,
12,
2890,
18,
24386,
16,
804,
31487,
1741,
1985,
13,
365,
18,
6738,
18,
8507,
3805,
1435,
365,
18,
6738,
803,
273,
2023,
397,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1839,
694,
1211,
12,
2890,
4672,
365,
18,
6738,
273,
3869,
12,
2890,
18,
24386,
16,
804,
31487,
1741,
1985,
13,
365,
18,
6738,
18,
8507,
3805,
1435,
365,
18,
6738,
803,
273,
2023,
397,... |
ir_default_obj = self.pool.get('ir.default') defaults = ir_default_obj.get_default(self._name, False) for field, field_value in defaults.items(): if field in fields_names: fld_def = (field in self._columns) and self._columns[field] \ or self._inherit_fields[field][2] if fld_def._type in ('many2one',): if not isinstance(field_value, (int, long)): continue obj = self.pool.get(fld_def.model_name) if not hasattr(obj, 'search') \ or not obj.search([ ('id', '=', field_value), ]): continue if with_rec_name and 'rec_name' in obj._columns: value[field + '.rec_name'] = obj.browse(field_value ).rec_name if fld_def._type in ('many2many'): if not isinstance(field_value, list): continue obj = fld_def.get_target(self.pool) field_value2 = [] for i in range(len(field_value)): | for name in (self._inherits.keys() + [self._name]): defaults = ir_default_obj.get_default(name, False) for field_name, field_value in defaults.items(): if field_name in fields_names: if field_name in self._columns: field = self._columns[field_name] else: field = self._inherit_fields[field_name][2] if field._type in ('many2one',): if not isinstance(field_value, (int, long)): continue obj = self.pool.get(field.model_name) | def default_get(self, fields_names, with_rec_name=True): ''' Return a dict with the default values for each field in fields_names. | 0eefa10e5f821238910586b23cd04e67d1e91f23 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/0eefa10e5f821238910586b23cd04e67d1e91f23/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
1466,
67,
1973,
16,
598,
67,
3927,
67,
529,
33,
5510,
4672,
9163,
2000,
279,
2065,
598,
326,
805,
924,
364,
1517,
652,
316,
1466,
67,
1973,
18,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
588,
12,
2890,
16,
1466,
67,
1973,
16,
598,
67,
3927,
67,
529,
33,
5510,
4672,
9163,
2000,
279,
2065,
598,
326,
805,
924,
364,
1517,
652,
316,
1466,
67,
1973,
18,
2,
-100,
... |
From http://www.codeguru.com/forum/showthread.php?t=194400: Let the point be C (Cx,Cy) and the line be AB (Ax,Ay) to (Bx,By). Let P be the point of perpendicular projection of C on AB. The parameter r, which indicates P's position along AB, is computed by the dot product of AC and AB divided by the square of the length of AB: | def distance_to(self, p): """The distance from the wall to point p | b87a74ef16a98a162d3b0052991f05ce85951be5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14940/b87a74ef16a98a162d3b0052991f05ce85951be5/Wall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3888,
67,
869,
12,
2890,
16,
293,
4672,
3536,
1986,
3888,
628,
326,
17662,
358,
1634,
293,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3888,
67,
869,
12,
2890,
16,
293,
4672,
3536,
1986,
3888,
628,
326,
17662,
358,
1634,
293,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
f = open(filename, 'r') | f = open(filename, 'rb') | def fix(filename): | 56c54edd697e115b58cc816c27128e8b823290b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/56c54edd697e115b58cc816c27128e8b823290b2/pathfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
12,
3459,
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,
2917,
12,
3459,
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,
-... |
bar = ctypes_copy(foo) | bar = copy(foo) | def test_copy(self): foo = _Foo(2, 5.0) bar = ctypes_copy(foo) foo.x = 0 foo.y = 0 self.assertEqual(bar.x, 2) self.assertAlmostEqual(bar.y, 5.0) | fd8326704a001f539cb22d3f1c0abda08bf99805 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/fd8326704a001f539cb22d3f1c0abda08bf99805/test_multiprocessing.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3530,
12,
2890,
4672,
8431,
273,
389,
42,
5161,
12,
22,
16,
1381,
18,
20,
13,
4653,
273,
1610,
12,
11351,
13,
8431,
18,
92,
273,
374,
8431,
18,
93,
273,
374,
365,
18,
112... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3530,
12,
2890,
4672,
8431,
273,
389,
42,
5161,
12,
22,
16,
1381,
18,
20,
13,
4653,
273,
1610,
12,
11351,
13,
8431,
18,
92,
273,
374,
8431,
18,
93,
273,
374,
365,
18,
112... |
optional_headers=["activdbg.h"], platforms=['win32'], | def copy_file(self, src, dest): dest, copied = install_data.copy_file(self, src, dest) # 2to3 if not self.dry_run and copied: refactor_filenames([dest]) return dest, copied | 81287649b4934f18e2e85dcf81cc437daf1c2fb5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/677/81287649b4934f18e2e85dcf81cc437daf1c2fb5/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
768,
12,
2890,
16,
1705,
16,
1570,
4672,
1570,
16,
9268,
273,
3799,
67,
892,
18,
3530,
67,
768,
12,
2890,
16,
1705,
16,
1570,
13,
468,
576,
869,
23,
309,
486,
365,
18,
25... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
67,
768,
12,
2890,
16,
1705,
16,
1570,
4672,
1570,
16,
9268,
273,
3799,
67,
892,
18,
3530,
67,
768,
12,
2890,
16,
1705,
16,
1570,
13,
468,
576,
869,
23,
309,
486,
365,
18,
25... | |
self.annotation = Annotation() | self.annotation = Annotation(self) | def fromDom(self, node): self.setAttributes(node) contents = self.getContents(node) content = [] | 6d624a54ef4e80f277c247ef300c646e01f4568e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13054/6d624a54ef4e80f277c247ef300c646e01f4568e/XMLSchema.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
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,
628,
8832,
12,
2890,
16,
756,
4672,
365,
18,
542,
2498,
12,
2159,
13,
2939,
273,
365,
18,
588,
6323,
12,
2159,
13,
913,
273,
5378,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if options['stage_to_start_from'] <= 2 and extract_tag_from_record(record,'FFT') != None: | if options['stage_to_start_from'] <= 2 and extract_tag_from_record(record, 'FFT') != None: | def bibupload(record): """Main function: process a record and fit it in the tables bibfmt, bibrec, bibrec_bibxxx, bibxxx with proper record metadata. Return (error_code, recID) of the processed record. """ error = None #If there are special tags to proceed check if it exists in the record if options['tag'] != None and not(record.has_key(options['tag'])): write_message(" Failed: Tag not found, enter a valid tag to update.", verbose=1, stream=sys.stderr) return (1, -1) #Extraction of the Record Id rec_id = retrieve_rec_id(record) if rec_id == -1: return (1, -1) else: write_message(" -Retrieve record Id (found %s) : DONE." % rec_id, verbose=2) write_message(" -Check if the xml marc file is already in the database : DONE" , verbose=2) # Reference mode check if there are reference tag if options['mode'] == 'reference': error = extract_tag_from_record(record, cfg_bibupload_reference_tag) if error == None: write_message(" Failed : No reference tags has been found...", verbose=1, stream=sys.stderr) return (1, -1) else: error = None write_message(" -Check if reference tags exist : DONE", verbose=2) if options['mode'] == 'insert': # Insert the record into the bibrec databases to have a recordId rec_id = create_new_record() write_message(" -Creation of a new record id (%d) : DONE" % rec_id, verbose=2) # we add the record Id control field to the record error = record_add_field(record, '001', '', '', rec_id) if error == None: write_message(" Failed: " \ "Error during adding the 001 controlfield " \ "to the record", verbose=1, stream=sys.stderr) return (1, rec_id) else: error = None elif options['mode'] != 'insert' and options['mode'] != 'format' and options['stage_to_start_from'] != 5: # Update Mode #Retrieve the old record to update rec_old = create_record(print_record(int(rec_id),'xm'), 2)[0] if rec_old == None: write_message(" Failed during the creation of the old record!", verbose=1, stream=sys.stderr) return (1, rec_id) else: write_message(" -Retrieve the old record to update : DONE", verbose=2) #Delete tags to correct in the record if options['mode'] == 'correct' or options['mode'] == 'reference': delete_tags_to_correct(record, rec_old) write_message(" -Delete the old tags to correct in the old record: DONE", verbose=2) # Append new tag to the old record and update the new record with the old_record modified if options['mode'] == 'append' or options['mode'] == 'correct' or options['mode'] == 'reference': record = append_new_tag_to_old_record(record, rec_old) write_message(" -Append new tags to the old record: DONE", verbose=2) # now we clear all the rows from bibrec_bibxxx from the old record delete_bibrec_bibxxx(rec_old, rec_id) write_message(" -Clean bibrec_bibxxx: DONE", verbose=2) write_message(" -Stage COMPLETED", verbose=2) #Have a look if we have FMT tags write_message("Stage 1: Start (Insert of FMT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 1 and extract_tag_from_record(record,'FMT') != None: record = insert_fmt_tags(record, rec_id) if record == None: write_message(" Stage 1 failed: Error while inserting FMT tags", verbose=1, stream=sys.stderr) return (1, rec_id) elif record == 0: #Mode format finished stat['nb_records_updated'] += 1 return (0, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) #Have a look if we have FFT tags write_message("Stage 2: Start (Process FFT tags if exist).", verbose=2) if options['stage_to_start_from'] <= 2 and extract_tag_from_record(record,'FFT') != None: if options['mode'] == 'insert' or options['mode'] == 'append': record = insert_fft_tags(record, rec_id) else: record = update_fft_tag(record, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Update of the BibFmt write_message("Stage 3 : Start (Update bibfmt).", verbose=2) if options['stage_to_start_from'] <= 3: # format the single record as xml rec_xml_new = record_xml_output(record) #Update bibfmt with the format xm of this record error = update_bibfmt_format(rec_id, rec_xml_new, 'xm') if error == 1: write_message(" Failed: error during update_bibfmt_format", verbose=1, stream=sys.stderr) return (1, rec_id) write_message(" -Stage COMPLETED", verbose=2) # Update the database MetaData write_message("Stage 4 : Start (Update the database with the metadata).", verbose=2) if options['stage_to_start_from'] <= 4: update_database_with_metadata(record, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) # Finally we update the bibrec table with the current date write_message("Stage 5 : Start (Update bibrec table with current date).", verbose=2) if options['stage_to_start_from'] <= 5 and options['mode'] != 'insert' and options['notimechange'] == 0: now = convert_datestruct_to_datetext(time.localtime()) write_message(" -Retrieve current localtime : DONE", verbose=2) update_bibrec_modif_date(now, rec_id) write_message(" -Stage COMPLETED", verbose=2) else: write_message(" -Stage NOT NEEDED", verbose=2) #Increase statistics if options['mode'] == 'insert': stat['nb_records_inserted'] += 1 else: stat['nb_records_updated'] += 1 #Upload of this record finish write_message("Record "+str(rec_id)+" DONE", verbose=1) return (0, rec_id) | c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25581,
6327,
12,
3366,
4672,
3536,
6376,
445,
30,
1207,
279,
1409,
471,
4845,
518,
316,
326,
4606,
25581,
8666,
16,
25581,
3927,
16,
25581,
3927,
67,
70,
495,
18310,
16,
25581,
18310,
59... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25581,
6327,
12,
3366,
4672,
3536,
6376,
445,
30,
1207,
279,
1409,
471,
4845,
518,
316,
326,
4606,
25581,
8666,
16,
25581,
3927,
16,
25581,
3927,
67,
70,
495,
18310,
16,
25581,
18310,
59... |
if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 elif P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 elif P.eval("%s %s %s"%(self.name(), P._greaterthan_symbol(), other.name())) == P._true_symbol(): return 1 | try: if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 except RuntimeError: pass try: if P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 except RuntimeError: pass try: if P.eval("%s %s %s"%(self.name(), P._greaterthan_symbol(), other.name())) == P._true_symbol(): return 1 except: pass | def __cmp__(self, other): P = self.parent() if P.eval("%s %s %s"%(self.name(), P._equality_symbol(), other.name())) == P._true_symbol(): return 0 elif P.eval("%s %s %s"%(self.name(), P._lessthan_symbol(), other.name())) == P._true_symbol(): return -1 elif P.eval("%s %s %s"%(self.name(), P._greaterthan_symbol(), other.name())) == P._true_symbol(): return 1 | b016ee8aaeebdcc6ac0323d9c32aaaa599dce877 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b016ee8aaeebdcc6ac0323d9c32aaaa599dce877/expect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
453,
273,
365,
18,
2938,
1435,
309,
453,
18,
8622,
27188,
87,
738,
87,
738,
87,
6,
17105,
2890,
18,
529,
9334,
453,
6315,
9729,
560,
67,
71... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9625,
972,
12,
2890,
16,
1308,
4672,
453,
273,
365,
18,
2938,
1435,
309,
453,
18,
8622,
27188,
87,
738,
87,
738,
87,
6,
17105,
2890,
18,
529,
9334,
453,
6315,
9729,
560,
67,
71... |
failed['%s/%s' % (dirPath,fileName)] = error | fname = '%s/%s' % (dirPath,fileName) fname = fname.replace('//','/') failed[fname] = error | def _findFiles(self,lfns,metadata=['FileID'],connection=False): connection = self._getConnection(connection) """ Find file ID if it exists for the given list of LFNs """ dirDict = self._getFileDirectories(lfns) failed = {} directoryIDs = {} for dirPath in dirDict.keys(): res = self.db.dtree.findDir(dirPath) if (not res['OK']) or (not res['Value']): error = res.get('Message','No such file or directory') for fileName in dirDict[dirPath]: failed['%s/%s' % (dirPath,fileName)] = error else: directoryIDs[dirPath] = res['Value'] successful = {} for dirPath in directoryIDs.keys(): fileNames = dirDict[dirPath] res = self._getDirectoryFiles(directoryIDs[dirPath],fileNames,metadata,connection=connection) if (not res['OK']) or (not res['Value']): error = res.get('Message','No such file or directory') for fileName in fileNames: failed['%s/%s' % (dirPath,fileName)] = error else: for fileName,fileDict in res['Value'].items(): successful["%s/%s" % (dirPath,fileName)] = fileDict return S_OK({"Successful":successful,"Failed":failed}) | ab67cc5ab5284fed4da0b8d6db61bae143bc95b8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/ab67cc5ab5284fed4da0b8d6db61bae143bc95b8/FileManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
2697,
12,
2890,
16,
20850,
2387,
16,
4165,
33,
3292,
812,
734,
17337,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
3536,
4163,
585,
1599,
309,
518,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
2697,
12,
2890,
16,
20850,
2387,
16,
4165,
33,
3292,
812,
734,
17337,
4071,
33,
8381,
4672,
1459,
273,
365,
6315,
588,
1952,
12,
4071,
13,
3536,
4163,
585,
1599,
309,
518,
1... |
'license_url', nargs="1") | 'license_url', nargs=1) | def add_common_args(subparser): # source options subparser.add_argument( '--rdf_dir', dest='rdf_dir', action='store', help='Directory containing the license RDF files; ' 'defaults to ./cc/licenserdf/licenses/') | e13154c15a008d3f967642f34a9541c132a49b16 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4330/e13154c15a008d3f967642f34a9541c132a49b16/license.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
6054,
67,
1968,
12,
1717,
4288,
4672,
468,
1084,
702,
720,
4288,
18,
1289,
67,
3446,
12,
3534,
19299,
67,
1214,
2187,
1570,
2218,
19299,
67,
1214,
2187,
1301,
2218,
2233,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
6054,
67,
1968,
12,
1717,
4288,
4672,
468,
1084,
702,
720,
4288,
18,
1289,
67,
3446,
12,
3534,
19299,
67,
1214,
2187,
1570,
2218,
19299,
67,
1214,
2187,
1301,
2218,
2233,
2187,
... |
skip=["parser.h"], also=["egg_composite1.cxx","egg_composite2.cxx"]) | skip=[], also=["egg_composite1.cxx","egg_composite2.cxx"]) | if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n" | ed6952787498a15bccd6f8f8637519830d83c696 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/ed6952787498a15bccd6f8f8637519830d83c696/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
261,
1125,
422,
296,
2124,
12904,
11,
4672,
2195,
273,
2195,
397,
6619,
318,
536,
315,
397,
498,
397,
1548,
82,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
309,
261,
1125,
422,
296,
2124,
12904,
11,
4672,
2195,
273,
2195,
397,
6619,
318,
536,
315,
397,
498,
397,
1548,
82,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, howmany=5, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMEVENT, 'en') return eval(expr) | search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, howmany=5, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMEVENT, 'en') return eval(expr) | def getInitiativesEvents(self, folder=None): """returns a list with events related with a folder inside the Initiatives folder""" try: search_keywords = u' or '.join((folder.getLocalProperty('keywords', 'en')+' '+folder.getLocalProperty('title', 'en')).split()) expr = 'self.getCatalogedObjects(meta_type=\'%s\', approved=1, howmany=5, objectkeywords_%s=search_keywords)' % (METATYPE_NYSEMEVENT, 'en') return eval(expr) except: return None | 9bafd90013beef4170a14ef742a93e7bdabaa85c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3287/9bafd90013beef4170a14ef742a93e7bdabaa85c/SEMIDESite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26458,
77,
8785,
3783,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
2641,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
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,
26458,
77,
8785,
3783,
12,
2890,
16,
3009,
33,
7036,
4672,
3536,
6154,
279,
666,
598,
2641,
3746,
598,
279,
3009,
4832,
326,
4378,
77,
8785,
3009,
8395,
775,
30,
1623,
67,
11771,
273,
... |
self.player = gui.player | def detach(self): gui = plugin.getbyname(plugin.AUDIO_PLAYER).playerGUI | 9fccded0dc51a3e574d38a6a227bb68b2f60ca15 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/9fccded0dc51a3e574d38a6a227bb68b2f60ca15/detach.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10199,
12,
2890,
4672,
13238,
282,
273,
1909,
18,
588,
1637,
529,
12,
4094,
18,
14237,
2565,
51,
67,
52,
22166,
2934,
14872,
43,
5370,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10199,
12,
2890,
4672,
13238,
282,
273,
1909,
18,
588,
1637,
529,
12,
4094,
18,
14237,
2565,
51,
67,
52,
22166,
2934,
14872,
43,
5370,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
num_retries=gdata.service.DEFAULT_NUM_RETRIES, delay=gdata.service.DEFAULT_DELAY, backoff=gdata.service.DEFAULT_BACKOFF): | num_retries=DEFAULT_NUM_RETRIES, delay=DEFAULT_DELAY, backoff=DEFAULT_BACKOFF): | def GetGeneratorFromLinkFinder(self, link_finder, func, num_retries=gdata.service.DEFAULT_NUM_RETRIES, delay=gdata.service.DEFAULT_DELAY, backoff=gdata.service.DEFAULT_BACKOFF): """returns a generator for pagination""" yield link_finder next = link_finder.GetNextLink() while next is not None: next_feed = func(str(self.GetWithRetries( next.href, num_retries=num_retries, delay=delay, backoff=backoff))) yield next_feed next = next_feed.GetNextLink() | 3ef6aea43d441e96c86546673bf50f2d3cb553fd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6580/3ef6aea43d441e96c86546673bf50f2d3cb553fd/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3908,
1265,
2098,
8441,
12,
2890,
16,
1692,
67,
15356,
16,
1326,
16,
818,
67,
15215,
33,
5280,
67,
6069,
67,
862,
6566,
3991,
16,
4624,
33,
5280,
67,
26101,
16,
12260,
33,
5280,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3908,
1265,
2098,
8441,
12,
2890,
16,
1692,
67,
15356,
16,
1326,
16,
818,
67,
15215,
33,
5280,
67,
6069,
67,
862,
6566,
3991,
16,
4624,
33,
5280,
67,
26101,
16,
12260,
33,
5280,
... |
R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor)) | R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor())) | def r1_factor(self, cutoff_factor=None): f_obs = self.fo_sq.f_sq_as_f() if cutoff_factor is not None: strong = f_obs.data() > cutoff_factor*f_obs.sigmas() f_obs = f_obs.select(strong) f_calc = self.f_calc.select(strong) else: f_calc = self.f_calc R1 = f_obs.r1_factor(f_calc, scale_factor=math.sqrt(self.scale_factor)) return R1, f_obs.size() | 4f9ce3bd2cd66a802dbc8c56b12bafcd7539d6dc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/696/4f9ce3bd2cd66a802dbc8c56b12bafcd7539d6dc/least_squares.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
21,
67,
6812,
12,
2890,
16,
13383,
67,
6812,
33,
7036,
4672,
284,
67,
10992,
273,
365,
18,
617,
67,
11410,
18,
74,
67,
11410,
67,
345,
67,
74,
1435,
309,
13383,
67,
6812,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
436,
21,
67,
6812,
12,
2890,
16,
13383,
67,
6812,
33,
7036,
4672,
284,
67,
10992,
273,
365,
18,
617,
67,
11410,
18,
74,
67,
11410,
67,
345,
67,
74,
1435,
309,
13383,
67,
6812,
353,
... |
log(4, 'Deleting Header %s' % hdrfn) | todel = todel + 1 log(6, 'Deleting Header %s' % hdrfn) if todel > 0: | def clean_up_old_headers(rpmDBInfo, HeaderInfo): serverlist = conf.servers hdrlist = [] for serverid in serverlist: hdrdir = conf.serverhdrdir[serverid] hdrlist = getfilelist(hdrdir, '.hdr', hdrlist) for hdrfn in hdrlist: hdr = readHeader(hdrfn) (e, n, v, r, a) = getENVRA(hdr) if rpmDBInfo.exists(n, a): (e1, v1, r1) = rpmDBInfo.evr(n, a) rc = compareEVR((e1, v1, r1), (e, v, r)) # if the rpmdb has an equal or better rpm then delete # the header if (rc >= 0): log(4, 'Deleting Header %s' % hdrfn) os.unlink(hdrfn) if not HeaderInfo.exists(n, a): # if its not in the HeaderInfo nevral anymore just kill it log(4, 'Deleting Header %s' % hdrfn) os.unlink(hdrfn) | d40c764fdda3cbd5c1670b61abb41a16a59a072b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/d40c764fdda3cbd5c1670b61abb41a16a59a072b/clientStuff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
416,
67,
1673,
67,
2485,
12,
86,
7755,
2290,
966,
16,
4304,
966,
4672,
1438,
1098,
273,
2195,
18,
14247,
7723,
1098,
273,
5378,
364,
1438,
350,
316,
1438,
1098,
30,
7723,
121... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
67,
416,
67,
1673,
67,
2485,
12,
86,
7755,
2290,
966,
16,
4304,
966,
4672,
1438,
1098,
273,
2195,
18,
14247,
7723,
1098,
273,
5378,
364,
1438,
350,
316,
1438,
1098,
30,
7723,
121... |
<h2>%s</h2><div style="text-align:center;">%s</div> | <h2>%s</h2> <div style="text-align:left;">%s</div> | def user_line(login): uid = users.login_to_uid(login) return '''<tr><td>%s</td><td>%s</td><td>%s</td></tr>''' % ( u[uid]['gecos'], login, uid) | eb92fc56664814fed9f428d02ee7bb3f8903a836 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7650/eb92fc56664814fed9f428d02ee7bb3f8903a836/groups.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
1369,
12,
5819,
4672,
4555,
273,
3677,
18,
5819,
67,
869,
67,
1911,
12,
5819,
13,
327,
9163,
32,
313,
4438,
4465,
9822,
87,
1757,
4465,
4438,
4465,
9822,
87,
1757,
4465,
4438,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
729,
67,
1369,
12,
5819,
4672,
4555,
273,
3677,
18,
5819,
67,
869,
67,
1911,
12,
5819,
13,
327,
9163,
32,
313,
4438,
4465,
9822,
87,
1757,
4465,
4438,
4465,
9822,
87,
1757,
4465,
4438,... |
('dialogName', None, INITOPT), | ('dialogName', 'DirectDialog_' + `DirectDialog.PanelIndex`, INITOPT), | def __init__(self, parent = None, **kw): """ DirectDialog(kw) | 2c5d146913e55fef5c3d5d79e6c7e639e7a529fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/2c5d146913e55fef5c3d5d79e6c7e639e7a529fb/DirectDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
273,
599,
16,
2826,
9987,
4672,
3536,
9908,
6353,
12,
9987,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
982,
273,
599,
16,
2826,
9987,
4672,
3536,
9908,
6353,
12,
9987,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return self.handle_tab_complete(text, self.playlistTabs.getView()) def handle_tab_complete(self, text, view): | return self.handle_tab_complete(text, self.playlist_tabs.get_all_tabs()) def handle_tab_complete(self, text, view_items): | def complete_playlist(self, text, line, begidx, endidx): return self.handle_tab_complete(text, self.playlistTabs.getView()) | ba7e51e3e03d9068a7e95e9beba806bfd19f9f19 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/ba7e51e3e03d9068a7e95e9beba806bfd19f9f19/interpreter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
67,
1601,
1098,
12,
2890,
16,
977,
16,
980,
16,
16847,
3465,
16,
679,
3465,
4672,
327,
365,
18,
4110,
67,
7032,
67,
6226,
12,
955,
16,
365,
18,
1601,
1098,
17348,
18,
588,
1767... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
67,
1601,
1098,
12,
2890,
16,
977,
16,
980,
16,
16847,
3465,
16,
679,
3465,
4672,
327,
365,
18,
4110,
67,
7032,
67,
6226,
12,
955,
16,
365,
18,
1601,
1098,
17348,
18,
588,
1767... |
st.set_value('button', button) st.set_value('palette', palette) st.set_value('sx', sx) st.set_value('sy', sy) st.set_value('ex', ex) st.set_value('ey', ey) | st.set_value('button', button, 'int') st.set_value('palette', palette, 'uint') st.set_value('sx', sx, 'int') st.set_value('sy', sy, 'int') st.set_value('ex', ex, 'int') st.set_value('ey', ey, 'int') | def highlight(area, button, palette, immediate=True): """Create and return a new highlight event based on the specified highlight area, button number, and color palette. If `immediate` is True, the event is created as an out-of-band event so that it takes affect as soon as possible.""" (sx, sy, ex, ey) = area st = gst.Structure('application/x-gst-dvd') st.set_value('event', 'dvd-spu-highlight') st.set_value('button', button) st.set_value('palette', palette) st.set_value('sx', sx) st.set_value('sy', sy) st.set_value('ex', ex) st.set_value('ey', ey) return createCustom(st, outOfBand=immediate) | 4898748e95eaff2770482c23cfedf85eef165a0a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5222/4898748e95eaff2770482c23cfedf85eef165a0a/events.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8839,
12,
5036,
16,
3568,
16,
12127,
16,
14483,
33,
5510,
4672,
3536,
1684,
471,
327,
279,
394,
8839,
871,
2511,
603,
326,
1269,
8839,
5091,
16,
3568,
1300,
16,
471,
2036,
12127,
18,
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,
8839,
12,
5036,
16,
3568,
16,
12127,
16,
14483,
33,
5510,
4672,
3536,
1684,
471,
327,
279,
394,
8839,
871,
2511,
603,
326,
1269,
8839,
5091,
16,
3568,
1300,
16,
471,
2036,
12127,
18,
9... |
if visible(key): constants.append((key, value)) | constants.append((key, value)) | def docmodule(self, object, name=None): """Produce HTML documentation for a module object.""" name = object.__name__ # ignore the passed-in name parts = split(name, '.') links = [] for i in range(len(parts)-1): links.append( '<a href="%s.html"><font color="#ffffff">%s</font></a>' % (join(parts[:i+1], '.'), parts[i])) linkedname = join(links + parts[-1:], '.') head = '<big><big><strong>%s</strong></big></big>' % linkedname try: path = inspect.getabsfile(object) filelink = '<a href="file:%s">%s</a>' % (path, path) except TypeError: filelink = '(built-in)' info = [] if hasattr(object, '__version__'): version = str(object.__version__) if version[:11] == '$' + 'Revision: ' and version[-1:] == '$': version = strip(version[11:-1]) info.append('version %s' % self.escape(version)) if hasattr(object, '__date__'): info.append(self.escape(str(object.__date__))) if info: head = head + ' (%s)' % join(info, ', ') result = self.heading( head, '#ffffff', '#7799ee', '<a href=".">index</a><br>' + filelink) | 4483cbd7eb6854684bc5af9c43d558ab8a2bcacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4483cbd7eb6854684bc5af9c43d558ab8a2bcacf/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
468,
2305,
326,
2275,
17,
267,
508,
2140,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
2978,
12,
2890,
16,
733,
16,
508,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
1605,
733,
12123,
508,
273,
733,
16186,
529,
972,
468,
2305,
326,
2275,
17,
267,
508,
2140,
27... |
if self.pieces is None and self.outstanding == 0: | if self.pieces is None and self.outstanding <= 0: | def getPeerPieces(self, key, failedSite = None): """Retrieve the piece information from the peers. @param key: the key to request from the peers """ if failedSite is None: log.msg('Starting the lookup of piece hashes in peers') self.outstanding = 0 # Remove any peers with the wrong piece hash #for site in self.peers.keys(): # if self.peers[site].get('l', '') != key: # del self.peers[site] else: log.msg('Piece hash lookup failed for peer %r' % (failedSite, )) self.peers[failedSite]['failed'] = True self.outstanding -= 1 | f0796336aaebe37fdf50d650fdc6fae72dbb4553 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/665/f0796336aaebe37fdf50d650fdc6fae72dbb4553/PeerManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29875,
16539,
8610,
12,
2890,
16,
498,
16,
2535,
4956,
273,
599,
4672,
3536,
5767,
326,
11151,
1779,
628,
326,
10082,
18,
225,
632,
891,
498,
30,
326,
498,
358,
590,
628,
326,
10082,
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,
29875,
16539,
8610,
12,
2890,
16,
498,
16,
2535,
4956,
273,
599,
4672,
3536,
5767,
326,
11151,
1779,
628,
326,
10082,
18,
225,
632,
891,
498,
30,
326,
498,
358,
590,
628,
326,
10082,
3... |
args = {"prop_name": prop_name, "prop_value": self.encode_cdata(prop_value), "prop_type": str(prop_type)} self.file.write("""<%(prop_name)s type="%(prop_type)s">%(prop_value)s</%(prop_name)s>""" % args) | args = {"prop_name": prop_name, "prop_value": self.encode_cdata(prop_value)} params["type"] = str(prop_type) args['params'] = "" for k in params: args['params'] += '%s="%s" ' % (str(k), str(params[k])) self.file.write("""<%(prop_name)s %(params)s>%(prop_value)s</%(prop_name)s>""" % args) | def encode_default(self, prop_name, prop_value, prop_type): """Encode Default encoding property""" if prop_type == "str": prop_type = "string" args = {"prop_name": prop_name, "prop_value": self.encode_cdata(prop_value), "prop_type": str(prop_type)} self.file.write("""<%(prop_name)s type="%(prop_type)s">%(prop_value)s</%(prop_name)s>""" % args) | cfbb216885b7f2bd3e8fc7f4132c4520cec263bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10599/cfbb216885b7f2bd3e8fc7f4132c4520cec263bc/xmlize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
67,
1886,
12,
2890,
16,
2270,
67,
529,
16,
2270,
67,
1132,
16,
2270,
67,
723,
4672,
3536,
5509,
2989,
2688,
1272,
8395,
309,
2270,
67,
723,
422,
315,
701,
6877,
2270,
67,
723,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
67,
1886,
12,
2890,
16,
2270,
67,
529,
16,
2270,
67,
1132,
16,
2270,
67,
723,
4672,
3536,
5509,
2989,
2688,
1272,
8395,
309,
2270,
67,
723,
422,
315,
701,
6877,
2270,
67,
723,
... |
"type" : "JCompileJob" | "type" : "JClassDepJob" | def listJobTriggers(self): return { | b825f522a73030154214f3277b7b6f2927bd165e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/b825f522a73030154214f3277b7b6f2927bd165e/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
2278,
15114,
12,
2890,
4672,
327,
288,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
2278,
15114,
12,
2890,
4672,
327,
288,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
unittest.TestSuite._wrapped_run(self, result) | unittest.TestSuite._wrapped_run(self, *args, **kwargs) | def _wrapped_run(self, result): "Python 2.7 / unittest2 compatibility - there must be a better way..." self.setUp() if hasattr(self, 'fixture'): for test in self._tests: if hasattr(test, 'setFixture'): test.setFixture(self.fixture) unittest.TestSuite._wrapped_run(self, result) self.tearDown() return result | 88ad58867f3a8849c808c5bcb55d4f13fc9e87c9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9317/88ad58867f3a8849c808c5bcb55d4f13fc9e87c9/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18704,
67,
2681,
12,
2890,
16,
563,
4672,
315,
15774,
576,
18,
27,
342,
2836,
3813,
22,
8926,
300,
1915,
1297,
506,
279,
7844,
4031,
7070,
365,
18,
542,
1211,
1435,
309,
3859,
12,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18704,
67,
2681,
12,
2890,
16,
563,
4672,
315,
15774,
576,
18,
27,
342,
2836,
3813,
22,
8926,
300,
1915,
1297,
506,
279,
7844,
4031,
7070,
365,
18,
542,
1211,
1435,
309,
3859,
12,... |
"all the tests where not executed") | "all the tests were not executed") | def runTest(self): "test parallel jobs" try: import threading except: raise NoThreadsException() | ad65c7cdcfec7b5f31dabf737fe6535a8d4b7ba8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7126/ad65c7cdcfec7b5f31dabf737fe6535a8d4b7ba8/JobTests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
12,
2890,
4672,
315,
3813,
7230,
6550,
6,
225,
775,
30,
1930,
17254,
1335,
30,
1002,
2631,
13233,
503,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
4709,
12,
2890,
4672,
315,
3813,
7230,
6550,
6,
225,
775,
30,
1930,
17254,
1335,
30,
1002,
2631,
13233,
503,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
class A000255(SloaneSequence): r""" $a(n) = n*a(n-1) + (n-1)*a(n-2)$, with $a(0) = 1$, $a(1) = 1$. With offset 1, permanent of (0,1)-matrix of size $n \times (n+d)$ with $d=1$ and $n$ zeros not on a line. This is a special case of Theorem 2.3 of Seok-Zun Song et al. Extremes of permanents of (0,1)-matrices, p. 201-202. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000255;a a(n) = n*a(n-1) + (n-1)*a(n-2), a(0) = 1, a(1) = 1. sage: a(0) 1 sage: a(1) 1 sage: a.offset 0 sage: a(8) 148329 sage: a(22) 9923922230666898717143 sage: a.list(9) [1, 1, 3, 11, 53, 309, 2119, 16687, 148329] AUTHOR: -- Jaap Spies (2007-01-13) """ def __init__(self): | _k = 1 class A000153(ExtremesOfPermanentsSequence): def __init__(self): r""" $a(n) = n*a(n-1) + (n-2)*a(n-2)$, with $a(0) = 0$, $a(1) = 1$. With offset 1, permanent of (0,1)-matrix of size $n \times (n+d)$ with $d=2$ and $n$ zeros not on a line. This is a special case of Theorem 2.3 of Seok-Zun Song et al. Extremes of permanents of (0,1)-matrices, p. 201-202. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A000153; a a(n) = n*a(n-1) + (n-2)*a(n-2), with a(0) = 0, a(1) = 1. sage: a(0) 0 sage: a(1) 1 sage: a(8) 82508 sage: a(20) 10315043624498196944 sage: a.list(8) [0, 1, 2, 7, 32, 181, 1214, 9403] AUTHOR: -- Jaap Spies (2007-01-13) """ | def list(self, n): self._eval(n) # force computation return self._b[:n] | d2510d4232e17c9cea8d1a0271c6be68a81d317b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/d2510d4232e17c9cea8d1a0271c6be68a81d317b/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
666,
12,
2890,
16,
290,
4672,
365,
6315,
8622,
12,
82,
13,
282,
468,
2944,
16039,
327,
365,
6315,
70,
10531,
82,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
[ E*A/L, 0., 0., -E*A/L, 0., 0. ], [ 0., 12*E*I*f5/L**3., 6*E*I*f2/L**2., 0., -12*E*I*f5/L**3., 6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 4*E*I*f3/L, 0., -6*E*I*f2/L**2., 2*E*I*f4/L ], [-E*A/L, 0., 0., E*A/L, 0., 0. ], [ 0., -12*E*I*f5/L**3.,-6*E*I*f2/L**2., 0., 12*E*I*f5/L**3.,-6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 2*E*I*f4/L, 0., -6*E*I*f2/L**2., 4*E*I*f3/L ] | [ E*A/L, 0., 0., -E*A/L, 0., 0. ], [ 0., 12*E*I*f5/L**3., 6*E*I*f2/L**2., 0., -12*E*I*f5/L**3., 6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 4*E*I*f3/L, 0., -6*E*I*f2/L**2., 2*E*I*f4/L ], [-E*A/L, 0., 0., E*A/L, 0., 0. ], [ 0., -12*E*I*f5/L**3.,-6*E*I*f2/L**2., 0., 12*E*I*f5/L**3.,-6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 2*E*I*f4/L, 0., -6*E*I*f2/L**2., 4*E*I*f3/L ] | def beam2g(ex,ey,ep,N,eq=None): """ Compute the element stiffness matrix for a two dimensional beam element with respect to geometric nonlinearity. Parameters: ex = [x1, x2] ey = [y1, y2] element node coordinates ep = [E,A,I] element properties; E: Young's modulus A: cross section area I: moment of inertia N axial force in the beam eq distributed transverse load Returns: Ke element stiffness matrix (6 x 6) fe element load vector (6 x 1) """ if eq != None: if size(eq) > 1: print "eq should be a scalar !!!" return else: q = eq[0] else: q = 0 b = mat([ [ex[1]-ex[0]], [ey[1]-ey[0]] ]) L = asscalar(sqrt(b.T*b)) n = asarray(b/L).reshape(2,) E,A,I = ep rho = -N*L**2/(pi**2*E*I) kL = pi*sqrt(abs(rho))+finfo(float).eps if rho > 0: f1 = (kL/2)/tan(kL/2) f2 = (1/12.)*kL**2/(1-f1) f3 = f1/4+3*f2/4 f4 = -f1/2+3*f2/2 f5 = f1*f2 h = 6*(2/kL**2-(1+cos(kL))/(kL*sin(kL))) elif rho < 0: f1 = (kL/2)/tanh(kL/2) f2 = -(1/12.)*kL**2/(1-f1) f3 = f1/4+3*f2/4 f4 = -f1/2+3*f2/2 f5 = f1*f2 h = -6*(2/kL**2-(1+cosh(kL))/(kL*sinh(kL))) else: f1 = f2 = f3 = f4 = f5 = h = 1 Kle = mat([ [ E*A/L, 0., 0., -E*A/L, 0., 0. ], [ 0., 12*E*I*f5/L**3., 6*E*I*f2/L**2., 0., -12*E*I*f5/L**3., 6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 4*E*I*f3/L, 0., -6*E*I*f2/L**2., 2*E*I*f4/L ], [-E*A/L, 0., 0., E*A/L, 0., 0. ], [ 0., -12*E*I*f5/L**3.,-6*E*I*f2/L**2., 0., 12*E*I*f5/L**3.,-6*E*I*f2/L**2.], [ 0., 6*E*I*f2/L**2., 2*E*I*f4/L, 0., -6*E*I*f2/L**2., 4*E*I*f3/L ] ]) fle = q*L*mat([0.,1/2.,L*h/12,0.,1/2.,-L*h/12]).T G = mat([ [ n[0], n[1], 0, 0, 0, 0], [-n[1], n[0], 0, 0, 0, 0], [ 0, 0, 1, 0, 0, 0], [ 0, 0, 0, n[0], n[1], 0], [ 0, 0, 0,-n[1], n[0], 0], [ 0, 0, 0, 0, 0, 1] ]) Ke = G.T*Kle*G fe = G.T*fle if eq != None: return Ke,fe else: return Ke | 802fb797c1c505715968b6bf327cad5ed7e0e712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1235/802fb797c1c505715968b6bf327cad5ed7e0e712/pycalfem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16751,
22,
75,
12,
338,
16,
402,
16,
881,
16,
50,
16,
11253,
33,
7036,
4672,
3536,
8155,
326,
930,
384,
3048,
4496,
3148,
364,
279,
2795,
17469,
16751,
930,
598,
8762,
358,
7364,
1591,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16751,
22,
75,
12,
338,
16,
402,
16,
881,
16,
50,
16,
11253,
33,
7036,
4672,
3536,
8155,
326,
930,
384,
3048,
4496,
3148,
364,
279,
2795,
17469,
16751,
930,
598,
8762,
358,
7364,
1591,... |
t = xstransact("%s/device" % self.vmpath) | def _releaseDevices(self, suspend = False): """Release all domain's devices. Nothrow guarantee.""" if self.image: try: log.debug("Destroying device model") self.image.destroyDeviceModel() except Exception, e: log.exception("Device model destroy failed %s" % str(e)) else: log.debug("No device model") | 567bf13f5e8d256674fac5d7e03aa187caf202f2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/567bf13f5e8d256674fac5d7e03aa187caf202f2/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9340,
10053,
12,
2890,
16,
20413,
273,
1083,
4672,
3536,
7391,
777,
2461,
1807,
7166,
18,
225,
2288,
76,
492,
18779,
12123,
309,
365,
18,
2730,
30,
775,
30,
613,
18,
4148,
2932,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9340,
10053,
12,
2890,
16,
20413,
273,
1083,
4672,
3536,
7391,
777,
2461,
1807,
7166,
18,
225,
2288,
76,
492,
18779,
12123,
309,
365,
18,
2730,
30,
775,
30,
613,
18,
4148,
2932,
1... | |
('get_d', [Mpfr, RoundingMode], ctypes.c_double), ('get_d_2exp', [ctypes.POINTER(ctypes.c_long), Mpfr, RoundingMode], | ('get_d', [IMpfr, RoundingMode], ctypes.c_double), ('get_d_2exp', [ctypes.POINTER(ctypes.c_long), IMpfr, RoundingMode], | def error_on_failure(result, func, args): if result: raise ValueError("call failed") return result | b450c0023d8375a0580fdd1ed0db290a5d5cd85a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7048/b450c0023d8375a0580fdd1ed0db290a5d5cd85a/pympfr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
555,
67,
265,
67,
12251,
12,
2088,
16,
1326,
16,
833,
4672,
309,
563,
30,
1002,
2068,
2932,
1991,
2535,
7923,
327,
563,
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,
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,
555,
67,
265,
67,
12251,
12,
2088,
16,
1326,
16,
833,
4672,
309,
563,
30,
1002,
2068,
2932,
1991,
2535,
7923,
327,
563,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.do_alarm_unlink(cr, uid, ids) | alarm_obj = self.pool.get('res.alarm') alarm_obj.do_alarm_unlink(cr, uid, ids, self._name) | def unlink(self, cr, uid, ids, context=None): res = False for id in ids: ls = common.caldav_id2real_id(id) if not isinstance(ls, (str, int, long)) and len(ls) >= 2: date_new = ls[1] for record in self.read(cr, uid, [common.caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: exdate = (record['exdate'] and (record['exdate'] + ',') or '') + \ ''.join((re.compile('\d')).findall(date_new)) + 'Z' if record['date'] == date_new: res = self.write(cr, uid, [common.caldav_id2real_id(id)], {'exdate': exdate}) else: ids = map(lambda x: common.caldav_id2real_id(x), ids) res = super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids)) self.do_alarm_unlink(cr, uid, ids) else: ids = map(lambda x: common.caldav_id2real_id(x), ids) res = super(crm_meeting, self).unlink(cr, uid, ids) self.do_alarm_unlink(cr, uid, ids) return res | 2989254e134c0efd8265d710ce402e27bd1ea1c6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/2989254e134c0efd8265d710ce402e27bd1ea1c6/crm_meeting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
400,
273,
1083,
364,
612,
316,
3258,
30,
7180,
273,
2975,
18,
771,
20752,
67,
350,
22,
7688,
67,
350,
12,
350,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
400,
273,
1083,
364,
612,
316,
3258,
30,
7180,
273,
2975,
18,
771,
20752,
67,
350,
22,
7688,
67,
350,
12,
350,
... |
this = apply(_quickfix.new_MDEntryOriginator, args) | this = _quickfix.new_MDEntryOriginator(*args) | def __init__(self, *args): this = apply(_quickfix.new_MDEntryOriginator, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6188,
1622,
4741,
4240,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6188,
1622,
4741,
4240,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
... |
install = self.find_peer ('install') inputs = install.get_inputs () outputs = install.get_outputs () assert (len (inputs) == len (outputs)) | def run (self): | ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/ba0506b3492a13f5c8cec7598bf2b5f9735ac7b2/bdist_dumb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1086,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
assert_equal(self.tcf.setting_table.doc.value, 'Whatever \\') | assert_equal(self.tcf.setting_table.doc.value, 'Whatever ') | def test_rows(self): tsv = StringIO('''Ignored text before tables... | 37e85f1c7332dea3027f2d1c9072e8b85c216a95 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7408/37e85f1c7332dea3027f2d1c9072e8b85c216a95/test_tsvreader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3870,
12,
2890,
4672,
22731,
273,
15777,
2668,
6309,
15596,
977,
1865,
4606,
2777,
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,
1842,
67,
3870,
12,
2890,
4672,
22731,
273,
15777,
2668,
6309,
15596,
977,
1865,
4606,
2777,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
SVN_VERSION = "`SVN version <svn://svn.zope.org/repos/main/zope.sqlalchemy/trunk | setup( name='zope.sqlalchemy', version='0.2', packages=find_packages('src'), package_dir = {'':'src'}, include_package_data=True, zip_safe=False, namespace_packages=['zope'], author='Laurence Rowe', author_email='laurence@lrowe.co.uk', url='http://pypi.python.org/pypi/zope.sqlalchemy', description=text('README.txt'), long_description=text('src/zope/sqlalchemy/README.txt', 'CHANGES.txt', out=True), license='ZPL 2.1', keywords='zope zope3 sqlalchemy', classifiers=[ "Framework :: Zope3", "Programming Language :: Python", "License :: OSI Approved :: Zope Public License", "Topic :: Software Development :: Libraries :: Python Modules", ], | def desc(*texts): return '\n'.join(texts) | 9964ec3d4c3d0cea05037e581e51564baf468774 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9906/9964ec3d4c3d0cea05037e581e51564baf468774/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3044,
30857,
26256,
4672,
327,
2337,
82,
10332,
5701,
12,
26256,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3044,
30857,
26256,
4672,
327,
2337,
82,
10332,
5701,
12,
26256,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
return | return False | def alpm_install_targets(self, targets, repo = None): # TODO: check if there's something searched for or a repo selected, and # update the pkg_treeview accordingly self.busy_status_label = self.all_widgets.get_widget('busy_status_label') number_pkgs_to_download =\ self.alpm_get_number_of_packages_to_download(targets) | 8f90b0f951a01773d8498fe71f08a3fa9c6bba7e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2759/8f90b0f951a01773d8498fe71f08a3fa9c6bba7e/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
524,
7755,
67,
5425,
67,
11358,
12,
2890,
16,
5774,
16,
3538,
273,
599,
4672,
468,
2660,
30,
866,
309,
1915,
1807,
5943,
19242,
364,
578,
279,
3538,
3170,
16,
471,
468,
1089,
326,
3475... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
524,
7755,
67,
5425,
67,
11358,
12,
2890,
16,
5774,
16,
3538,
273,
599,
4672,
468,
2660,
30,
866,
309,
1915,
1807,
5943,
19242,
364,
578,
279,
3538,
3170,
16,
471,
468,
1089,
326,
3475... |
test_support.unlink(test_support.TESTFN) | def setUp(self): """Setup of a temp file to use for testing""" self.text = "test_urllib: %s\n" % self.__class__.__name__ test_support.unlink(test_support.TESTFN) FILE = file(test_support.TESTFN, 'wb') try: FILE.write(self.text) finally: FILE.close() self.pathname = test_support.TESTFN self.returned_obj = urllib.urlopen("file:%s" % self.pathname) | 1e4afd81038f3163dce9d90d36641f195570ea08 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/1e4afd81038f3163dce9d90d36641f195570ea08/test_urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
3536,
7365,
434,
279,
1906,
585,
358,
999,
364,
7769,
8395,
365,
18,
955,
273,
315,
3813,
67,
718,
2941,
30,
738,
87,
64,
82,
6,
738,
365,
16186,
1106,
972,
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,
24292,
12,
2890,
4672,
3536,
7365,
434,
279,
1906,
585,
358,
999,
364,
7769,
8395,
365,
18,
955,
273,
315,
3813,
67,
718,
2941,
30,
738,
87,
64,
82,
6,
738,
365,
16186,
1106,
972,
16... | |
cr.execute("select (now() - min(write_date)) <= '%s'::interval from \"%s\" where id in (%s)"% (delta,self._table,",".join(map(str, ids))) ) | for i in range((len(ids) / ID_MAX) + ((len(ids) % ID_MAX) and 1 or 0)): sub_ids = ids[ID_MAX * i:ID_MAX * (i + 1)] cr.execute("select (now() - min(write_date)) <= '%s'::interval " \ "from \"%s\" where id in (%s)" % (delta, self._table, ",".join(map(str, sub_ids))) ) | def unlink(self, cr, uid, ids, context=None): if not context: context={} if not ids: return True if isinstance(ids, (int, long)): ids = [ids] delta= context.get('read_delta',False) if delta and self._log_access: cr.execute("select (now() - min(write_date)) <= '%s'::interval from \"%s\" where id in (%s)"% (delta,self._table,",".join(map(str, ids))) ) res= cr.fetchone() if res and res[0]: raise except_orm('ConcurrencyException', 'This record was modified in the meanwhile') | 49d7cae04d7977f364f6f5de70e1e3d7090f240e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/49d7cae04d7977f364f6f5de70e1e3d7090f240e/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
309,
486,
819,
30,
819,
12938,
309,
486,
3258,
30,
327,
1053,
309,
1549,
12,
2232,
16,
261,
474,
16,
1525,
3719... |
self._order.remove(key) | def __delitem__(self, key): """See interface `IWriteContainer`""" zope.app.container.contained.uncontained(self._data[key], self, key) self._order.remove(key) del self._data[key] | f76a61b230ec7d15f3c68cdb3c7ccfd771924380 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/f76a61b230ec7d15f3c68cdb3c7ccfd771924380/requirement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
1726,
972,
12,
2890,
16,
498,
4672,
3536,
9704,
1560,
1375,
45,
3067,
2170,
68,
8395,
998,
1306,
18,
2910,
18,
3782,
18,
1213,
8707,
18,
551,
1580,
8707,
12,
2890,
6315,
89... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
3771,
1726,
972,
12,
2890,
16,
498,
4672,
3536,
9704,
1560,
1375,
45,
3067,
2170,
68,
8395,
998,
1306,
18,
2910,
18,
3782,
18,
1213,
8707,
18,
551,
1580,
8707,
12,
2890,
6315,
89... | |
if index != self.current_mask.index: | if self.current_mask and self.blend_filter: | def SelectCurrentMask(self, index): "Insert mask data, based on given index, into pipeline." | 2cd865491ff7bba76812f6cd455801c8c3cc9892 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/2cd865491ff7bba76812f6cd455801c8c3cc9892/slice_.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6766,
3935,
5796,
12,
2890,
16,
770,
4672,
315,
4600,
3066,
501,
16,
2511,
603,
864,
770,
16,
1368,
5873,
1199,
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,
6766,
3935,
5796,
12,
2890,
16,
770,
4672,
315,
4600,
3066,
501,
16,
2511,
603,
864,
770,
16,
1368,
5873,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.log("Query limit exceeded. Stopping at %s of %s. Try again tomorrow" % (len(self.results)+1, len(self.queries))) | self.log("Stopping at %s of %s. Try again tomorrow" % (self.queries.index(q)+1, len(self.queries))) | def harvest(self): if len(self.results) > 0: self.log("Resuming harvest at query %d" % (len(self.results)+1)) for q in self.queries: #q = self.queries.pop() if 'harvested' not in q: # if this query has not been harvested recs = self._get_records(q) query = self._build_query(q) | f8b9426bc1e3306bbf3491dbbd29014b4920b6b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8937/f8b9426bc1e3306bbf3491dbbd29014b4920b6b7/worldcat2olac.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17895,
26923,
12,
2890,
4672,
309,
562,
12,
2890,
18,
4717,
13,
405,
374,
30,
365,
18,
1330,
2932,
607,
21249,
17895,
26923,
622,
843,
738,
72,
6,
738,
261,
1897,
12,
2890,
18,
4717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17895,
26923,
12,
2890,
4672,
309,
562,
12,
2890,
18,
4717,
13,
405,
374,
30,
365,
18,
1330,
2932,
607,
21249,
17895,
26923,
622,
843,
738,
72,
6,
738,
261,
1897,
12,
2890,
18,
4717,
... |
global ICUDATA_DAT global CLDR_VERSION | global CLDR_VERSION | def main(): global ANDROID_BUILD_TOP # $ANDROID_BUILD_TOP global ICU4C_DIR # $ANDROID_BUILD_TOP/external/icu4c global ICU_VERSION # ICU version number global ICUDATA # e.g. "icudt42l" global ICUDATA_DAT # e.g. "icudt42l.dat" global CLDR_VERSION # CLDR version. The value can be vary upon ICU release. global TMP_DAT_PATH # temp directory to store all resource files and # intermediate dat files. global VERBOSE VERBOSE = False show_help = False try: opts, args = getopt.getopt(sys.argv[1:], 'hv', ['help', 'verbose']) except getopt.error: PrintHelpAndExit() for opt, arg in opts: if opt in ('-h', '--help'): show_help = True elif opt in ('-v', '--verbose'): VERBOSE = True if len(args) < 1: show_help = True if show_help: PrintHelpAndExit() # TODO: is there any advantage to requiring this as an argument? couldn't we just glob it from # the file system, looking for "icudt\d+l.*\.txt"? ICU_VERSION = args[0] if re.search(r'[0-9]+\.[0-9]+', ICU_VERSION) == None: print "'%s' is not a valid icu version number!" % (ICU_VERSION) sys.exit(1) ICUDATA = "icudt" + re.sub(r'([^0-9])', "", ICU_VERSION) + "l" CLDR_VERSION = "1.8" ANDROID_BUILD_TOP = os.environ.get("ANDROID_BUILD_TOP") if not ANDROID_BUILD_TOP: print "$ANDROID_BUILD_TOP not set! Run 'env_setup.sh'." sys.exit(1) ICU4C_DIR = os.path.join(ANDROID_BUILD_TOP, "external", "icu4c") ICUDATA_DAT = ICUDATA + ".dat" # Check for required source files. stubdata_dir = os.path.join(ICU4C_DIR, "stubdata") full_data_filename = os.path.join(stubdata_dir, ICUDATA + "-all.dat") if not os.path.isfile(full_data_filename): print "%s not present." % full_data_filename sys.exit(1) # Create a temporary working directory. TMP_DAT_PATH = os.path.join(ICU4C_DIR, "tmp") if os.path.exists(TMP_DAT_PATH): shutil.rmtree(TMP_DAT_PATH) os.mkdir(TMP_DAT_PATH) # Extract resource files from icudtxxl-all.dat to TMP_DAT_PATH. ExtractAllResourceToTempDir() # TODO: is there any advantage to hard-coding this? couldn't we just glob it from the file system? datlist = ["us", "us-euro", "default", "us-japan", "zh", "medium", "large"] for dat_subtag in datlist: output_filename = os.path.join(stubdata_dir, ICUDATA + "-" + dat_subtag + ".dat") MakeDat(stubdata_dir, dat_subtag) # Copy icudtxxl.dat to stubdata directory with corresponding subtag. shutil.copyfile(os.path.join(TMP_DAT_PATH, ICUDATA_DAT), output_filename) print "Generated ICU data: %s" % (output_filename) # Cleanup temporary working directory and icudtxxl.dat shutil.rmtree(TMP_DAT_PATH) os.remove(os.path.join(stubdata_dir, ICUDATA_DAT)) | 7173c2a35d19fbdcad4e894b17842fdc2b6dfa81 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10672/7173c2a35d19fbdcad4e894b17842fdc2b6dfa81/icu_dat_generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2552,
4116,
1457,
734,
67,
20215,
67,
10462,
225,
468,
271,
4307,
1457,
734,
67,
20215,
67,
10462,
2552,
28009,
24,
39,
67,
4537,
377,
468,
271,
4307,
1457,
734,
67,
20215,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2552,
4116,
1457,
734,
67,
20215,
67,
10462,
225,
468,
271,
4307,
1457,
734,
67,
20215,
67,
10462,
2552,
28009,
24,
39,
67,
4537,
377,
468,
271,
4307,
1457,
734,
67,
20215,
... |
class SubversionTests(unittest.TestCase): | class SubversionTests(DjangoTestCase): | def testBadRoot(self): """Testing a bad CVSROOT""" file = 'test/testfile' rev = Revision('1.1') badrepo = Repository(name='CVS', path=self.cvs_repo_path + '2', tool=Tool.objects.get(name='CVS')) badtool = badrepo.get_scmtool() | 0e4a713b40cd9da0364a55af4c7b049f4cb172b5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/0e4a713b40cd9da0364a55af4c7b049f4cb172b5/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
6434,
2375,
12,
2890,
4672,
3536,
22218,
279,
5570,
385,
14640,
9185,
8395,
585,
273,
296,
3813,
19,
3813,
768,
11,
5588,
273,
13132,
2668,
21,
18,
21,
6134,
5570,
7422,
273,
6281,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6434,
2375,
12,
2890,
4672,
3536,
22218,
279,
5570,
385,
14640,
9185,
8395,
585,
273,
296,
3813,
19,
3813,
768,
11,
5588,
273,
13132,
2668,
21,
18,
21,
6134,
5570,
7422,
273,
6281,... |
label=_(u'e-mail')) | label=_(u'E-mail')) | def _(msg): return msg | 7644a0e36651bcf2d8ba453eb3c9a48462d29c5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7994/7644a0e36651bcf2d8ba453eb3c9a48462d29c5d/forms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12,
3576,
4672,
327,
1234,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12,
3576,
4672,
327,
1234,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
just_loaded_const = None | def computeStackDepth(self): UNREACHABLE = -1 co_code = self.co_code self._stackdepths = [UNREACHABLE] * len(co_code) self._stackdepths[0] = 0 just_loaded_const = None consts_w = self.getConsts() finally_targets = {} largestsize = 0 i = 0 | bd2c01a1a62bae1d8db481e24bf33f53fd629b95 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6934/bd2c01a1a62bae1d8db481e24bf33f53fd629b95/pyassem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
2624,
6148,
12,
2890,
4672,
5019,
862,
18133,
2782,
273,
300,
21,
1825,
67,
710,
273,
365,
18,
2894,
67,
710,
365,
6315,
3772,
5979,
87,
273,
306,
2124,
862,
18133,
2782,
65,
380... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
2624,
6148,
12,
2890,
4672,
5019,
862,
18133,
2782,
273,
300,
21,
1825,
67,
710,
273,
365,
18,
2894,
67,
710,
365,
6315,
3772,
5979,
87,
273,
306,
2124,
862,
18133,
2782,
65,
380... | |
return self.artcmd('ARTICLE ' + id) | return self.artcmd('ARTICLE {0}'.format(id)) | def article(self, id): """Process an ARTICLE command. Argument: - id: article number or message id Returns: - resp: server response if successful - nr: article number - id: message id - list: the lines of the article""" | 9bd2973908ef080e31fd8a2b44c929188a135cb0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/9bd2973908ef080e31fd8a2b44c929188a135cb0/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7559,
12,
2890,
16,
612,
4672,
3536,
2227,
392,
6052,
56,
2871,
900,
1296,
18,
225,
5067,
30,
300,
612,
30,
7559,
1300,
578,
883,
612,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7559,
12,
2890,
16,
612,
4672,
3536,
2227,
392,
6052,
56,
2871,
900,
1296,
18,
225,
5067,
30,
300,
612,
30,
7559,
1300,
578,
883,
612,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
... |
article_text = wp.wp_load_article(title) | article_text = unicode(wp.wp_load_article(title), 'utf8') | def send_article(s, title): s.send_response(200) #s.send_header("Content-type", "text/html; charset=utf-8") s.send_header("Content-type", "text/html") s.end_headers() | b4ad023a7e1b6a574b80d38fad8f16d7d19af4ba /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6694/b4ad023a7e1b6a574b80d38fad8f16d7d19af4ba/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
11480,
12,
87,
16,
2077,
4672,
272,
18,
4661,
67,
2740,
12,
6976,
13,
468,
87,
18,
4661,
67,
3374,
2932,
1350,
17,
723,
3113,
315,
955,
19,
2620,
31,
4856,
33,
3158,
17,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
11480,
12,
87,
16,
2077,
4672,
272,
18,
4661,
67,
2740,
12,
6976,
13,
468,
87,
18,
4661,
67,
3374,
2932,
1350,
17,
723,
3113,
315,
955,
19,
2620,
31,
4856,
33,
3158,
17,
... |
Example:: | def constraint(self, n=-1, fid=0): """Obtain the set of orthogonal equations that make the solution of the rank deficient normal equations possible. | 677de4c4725196364c59a0aae2f2b3d9f8c60766 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7472/677de4c4725196364c59a0aae2f2b3d9f8c60766/fitting.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4954,
12,
2890,
16,
290,
29711,
21,
16,
13444,
33,
20,
4672,
3536,
20019,
326,
444,
434,
16208,
28396,
30369,
716,
1221,
326,
6959,
434,
326,
6171,
1652,
11068,
2212,
30369,
3323,
18,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4954,
12,
2890,
16,
290,
29711,
21,
16,
13444,
33,
20,
4672,
3536,
20019,
326,
444,
434,
16208,
28396,
30369,
716,
1221,
326,
6959,
434,
326,
6171,
1652,
11068,
2212,
30369,
3323,
18,
2,... | |
""" Test cases for close_file_descriptor_if_open function """ def setUp(self): """ Set up test fixtures """ | """ Test cases for close_file_descriptor_if_open function. """ def setUp(self): """ Set up test fixtures. """ | def mock_getrlimit(res): if res == resource.RLIMIT_CORE: raise ValueError("Bogus platform doesn't have RLIMIT_CORE") else: return None | 33a5bfc655a6417210c5c80d9f942714bf596533 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4939/33a5bfc655a6417210c5c80d9f942714bf596533/test_daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5416,
67,
588,
1321,
1038,
12,
455,
4672,
309,
400,
422,
1058,
18,
54,
8283,
67,
15715,
30,
1002,
2068,
2932,
38,
28774,
4072,
3302,
1404,
1240,
534,
8283,
67,
15715,
7923,
469,
30,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5416,
67,
588,
1321,
1038,
12,
455,
4672,
309,
400,
422,
1058,
18,
54,
8283,
67,
15715,
30,
1002,
2068,
2932,
38,
28774,
4072,
3302,
1404,
1240,
534,
8283,
67,
15715,
7923,
469,
30,
32... |
if ascii in range(33,128): keyList.append(chr(ascii)) else: keyList.append(keyPress[1]) | keyList.append(keyPress[1]) | def speakKey(keyPress,ascii): global word if ((keyPress[0] is None) or (keyPress[0]==frozenset(['Shift'])) or (keyPress[0]==frozenset(['Control','Alt']))) and (ascii in range(33,255)): if isTypingProtected(): char="*" else: char=chr(ascii) if config.conf["keyboard"]["speakTypedCharacters"]: speech.speakSymbol(char) if config.conf["keyboard"]["speakTypedWords"] and (((keyPress[1]>=ord('a')) and (ascii<=ord('z'))) or ((ascii>=ord('A')) and (ascii<=ord('Z')))): word+=char elif config.conf["keyboard"]["speakTypedWords"] and (len(word)>=1): speech.speakText(word) word="" else: if config.conf["keyboard"]["speakCommandKeys"]: keyList=[] if (keyPress[0] is not None) and (len(keyPress[0])>0): keyList+=keyPress[0] if ascii in range(33,128): keyList.append(chr(ascii)) else: keyList.append(keyPress[1]) label="+".join(keyList) speech.speakMessage(keyList) if config.conf["keyboard"]["speakTypedWords"] and (len(word)>=1): speech.speakMessage(word) word="" if ascii==32 and ((config.conf["keyboard"]["speakTypedCharacters"] and not config.conf["keyboard"]["speakTypedWords"]) or (config.conf["keyboard"]["speakTypedCharacters"] and config.conf["keyboard"]["speakTypedWords"] and (len(word)==0))): speech.speakSymbol(chr(ascii)) | de8c7aac7e80eacb2f20dee295bd37b202465b6c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9340/de8c7aac7e80eacb2f20dee295bd37b202465b6c/keyboardHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
10244,
653,
12,
856,
11840,
16,
9184,
4672,
2552,
2076,
309,
14015,
856,
11840,
63,
20,
65,
353,
599,
13,
578,
261,
856,
11840,
63,
20,
65,
631,
28138,
542,
12,
3292,
10544,
3546,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
10244,
653,
12,
856,
11840,
16,
9184,
4672,
2552,
2076,
309,
14015,
856,
11840,
63,
20,
65,
353,
599,
13,
578,
261,
856,
11840,
63,
20,
65,
631,
28138,
542,
12,
3292,
10544,
3546,... |
hexdata = (string.replace("".join(tokens[5:10]), " ", "")) data = [] i = 0 while i < len(hexdata): data.append(hexdata[i] + hexdata[i+1] + ' ') i += 2 self.trans.appendHexData(''.join(data)) | data = ''.join(tokens[5:10]) self.trans.appendHexData(data) self.setupData = data | def parse(self, line, timestamp=None, frame=None): self.lineNumber += 1 tokens = line.split() try: # Do a small stupid sanity check if this is a correct usbmon log line try: if len(tokens) < 4: return if not(int(tokens[0],16) and int(tokens[1]) and (tokens[2] in ('S', 'C', 'E'))): return except: print "Error on line %d:" % self.lineNumber return | 9d4f56f70ef56f49c13b983dfed59f2331839b43 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6119/9d4f56f70ef56f49c13b983dfed59f2331839b43/Log.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
980,
16,
2858,
33,
7036,
16,
2623,
33,
7036,
4672,
365,
18,
1369,
1854,
1011,
404,
2430,
273,
980,
18,
4939,
1435,
775,
30,
468,
2256,
279,
5264,
384,
416,
350,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
980,
16,
2858,
33,
7036,
16,
2623,
33,
7036,
4672,
365,
18,
1369,
1854,
1011,
404,
2430,
273,
980,
18,
4939,
1435,
775,
30,
468,
2256,
279,
5264,
384,
416,
350,
1... |
sage: ECM().factor((2^197 + 1)/3) | sage: ecm.factor((2^197 + 1)/3) | def factor(self, n, factor_digits=None, B1=2000, **kwds): """ Returns a list of all probable prime factors of n, using gmp-ecm. INPUT: n -- a positive integer factor_digits -- optional guess at how many digits are in the smallest factor. B1 -- initial lower bound, defaults to 2000 (15 digit factors) kwds -- arguments to pass to ecm-gmp. See help for ECM for more details. OUTPUT: factorization of n NOTE: Trial division should typically be performed before using this method. Also, if you suspect that n is the product of two similarly-sized primes, other methods (such as pari's quadratic sieve) will usually be faster. EXAMPLES: sage: ECM().factor(602400691612422154516282778947806249229526581) [45949729863572179, 13109994191499930367061460439] sage: ECM().factor((2^197 + 1)/3) # takes a long time [197002597249, 1348959352853811313, 251951573867253012259144010843] """ factors = self.find_factor(n, factor_digits, B1, **kwds) factors.sort() if len(factors) != 2: return factors _primality = [self.primality[0], self.primality[1]] try: last_B1 = self.last_params['B1'] except AttributeError: self.last_params = {} self.last_params['B1'] = 10 last_B1 = 10 if not _primality[1]: factors[1:2] = self.factor(factors[1], B1=last_B1, **kwds) _primality[1:2] = self.primality if not _primality[0]: factors[0:1] = self.factor(factors[0], B1=last_B1, **kwds) _primality[0:1] = self.primality self.primality = _primality factors.sort() return factors | 0d3bb568164fbc244c62876c80cf8a348d8f7fd8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0d3bb568164fbc244c62876c80cf8a348d8f7fd8/ecm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5578,
12,
2890,
16,
290,
16,
5578,
67,
16649,
33,
7036,
16,
605,
21,
33,
17172,
16,
2826,
25577,
4672,
3536,
2860,
279,
666,
434,
777,
3137,
429,
17014,
14490,
434,
290,
16,
1450,
2681... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5578,
12,
2890,
16,
290,
16,
5578,
67,
16649,
33,
7036,
16,
605,
21,
33,
17172,
16,
2826,
25577,
4672,
3536,
2860,
279,
666,
434,
777,
3137,
429,
17014,
14490,
434,
290,
16,
1450,
2681... |
def get_class_from_test_case(TC, default = ''): | def get_class_from_test_case(TC): | def get_class_from_test_case(TC, default = ''): TC = TC.__name__ if 'Type' in TC: return '.' + TC[:TC.index('Type')] else: return default | 2b6b7ca41174137cbb11abbffdb525dfaa8cc717 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1298/2b6b7ca41174137cbb11abbffdb525dfaa8cc717/gen_stubs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1106,
67,
2080,
67,
3813,
67,
3593,
12,
15988,
4672,
23718,
273,
23718,
16186,
529,
972,
309,
296,
559,
11,
316,
23718,
30,
327,
2611,
397,
23718,
10531,
15988,
18,
1615,
2668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1106,
67,
2080,
67,
3813,
67,
3593,
12,
15988,
4672,
23718,
273,
23718,
16186,
529,
972,
309,
296,
559,
11,
316,
23718,
30,
327,
2611,
397,
23718,
10531,
15988,
18,
1615,
2668,
... |
import sys | import sys nr_nodes = info['nr_nodes'] | def find_relaxed_node(node_list): import sys if node_list is None: node_list = range(0, info['nr_nodes']) nodeload = [0] nodeload = nodeload * info['nr_nodes'] from xen.xend import XendDomain doms = XendDomain.instance().list('all') for dom in doms: cpuinfo = dom.getVCPUInfo() for vcpu in sxp.children(cpuinfo, 'vcpu'): def vinfo(n, t): return t(sxp.child_value(vcpu, n)) cpumap = vinfo('cpumap', list) for i in node_list: node_cpumask = info['node_to_cpu'][i] for j in node_cpumask: if j in cpumap: nodeload[i] += 1 break for i in node_list: if len(info['node_to_cpu'][i]) > 0: nodeload[i] = int(nodeload[i] / len(info['node_to_cpu'][i])) else: nodeload[i] = sys.maxint index = nodeload.index( min(nodeload) ) return index | 435047b7eabb773a669aadb88435b1402ddcd864 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6195/435047b7eabb773a669aadb88435b1402ddcd864/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
2878,
651,
329,
67,
2159,
12,
2159,
67,
1098,
4672,
1930,
2589,
9884,
67,
4690,
273,
1123,
3292,
11611,
67,
4690,
3546,
309,
756,
67,
1098,
353,
599,
30,
756,
67,
1098,
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,
1104,
67,
2878,
651,
329,
67,
2159,
12,
2159,
67,
1098,
4672,
1930,
2589,
9884,
67,
4690,
273,
1123,
3292,
11611,
67,
4690,
3546,
309,
756,
67,
1098,
353,
599,
30,
756,
67,
1098,
273,
... |
adress, | password, address, | def white(string): return "\033[1;37m" + string + "\033[0m" | 515b3a87636238271bf0bfb0472703bfcd10397e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/515b3a87636238271bf0bfb0472703bfcd10397e/pyLoadCli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9578,
12,
1080,
4672,
327,
1548,
15265,
63,
21,
31,
6418,
81,
6,
397,
533,
397,
1548,
15265,
63,
20,
81,
6,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9578,
12,
1080,
4672,
327,
1548,
15265,
63,
21,
31,
6418,
81,
6,
397,
533,
397,
1548,
15265,
63,
20,
81,
6,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return self.matrix(entries, copy=copy, coerce=coerce) | return self.matrix(entries, copy=copy, coerce=coerce, rows=rows) | def __call__(self, entries=0, coerce=True, copy=True): """ EXAMPLES: sage: k = GF(7); G = MatrixGroup([matrix(k,2,[1,1,0,1]), matrix(k,2,[1,0,0,2])]) sage: g = G.0 sage: MatrixSpace(k,2)(g) [1 1] [0 1] """ if entries is None: entries = 0 | 192734a65d46a440a9a23799e61c0666d7af3dbc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/192734a65d46a440a9a23799e61c0666d7af3dbc/matrix_space.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
3222,
33,
20,
16,
12270,
33,
5510,
16,
1610,
33,
5510,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
417,
273,
611,
42,
12,
27,
1769,
611,
273,
7298... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
3222,
33,
20,
16,
12270,
33,
5510,
16,
1610,
33,
5510,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
417,
273,
611,
42,
12,
27,
1769,
611,
273,
7298... |
return http.Response(stream = message(s, '/')) | return HTMLResponse(stream = message(s, '/')) | def render(self, ctx): if self.msg: s = self.msg else: s = "This is an invalid page." if self.username == 'guest': s += ' You might have to login to view this page.' return http.Response(stream = message(s, '/')) | 39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
309,
365,
18,
3576,
30,
272,
273,
365,
18,
3576,
469,
30,
272,
273,
315,
2503,
353,
392,
2057,
1363,
1199,
309,
365,
18,
5053,
422,
296,
18908,
4278,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1103,
4672,
309,
365,
18,
3576,
30,
272,
273,
365,
18,
3576,
469,
30,
272,
273,
315,
2503,
353,
392,
2057,
1363,
1199,
309,
365,
18,
5053,
422,
296,
18908,
4278,
... |
game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova = True | game.state.galaxy[game.quadrant.i][game.quadrant.j].supernova = True | def debugme(): "Access to the internals for debugging." proutn("Reset levels? ") if ja() == True: if game.energy < game.inenrg: game.energy = game.inenrg game.shield = game.inshld game.torps = game.intorps game.lsupres = game.inlsr proutn("Reset damage? ") if ja() == True: for i in range(NDEVICES): if game.damage[i] > 0.0: game.damage[i] = 0.0 proutn("Toggle debug flag? ") if ja() == True: idebug = not idebug if idebug: prout("Debug output ON") else: prout("Debug output OFF") proutn("Cause selective damage? ") if ja() == True: for i in range(NDEVICES): proutn("Kill %s?" % device[i]) scanner.chew() key = scanner.next() if key == IHALPHA and scanner.sees("y"): game.damage[i] = 10.0 proutn("Examine/change events? ") if ja() == True: ev = event() w = coord() legends = { FSNOVA: "Supernova ", FTBEAM: "T Beam ", FSNAP: "Snapshot ", FBATTAK: "Base Attack ", FCDBAS: "Base Destroy ", FSCMOVE: "SC Move ", FSCDBAS: "SC Base Destroy ", FDSPROB: "Probe Move ", FDISTR: "Distress Call ", FENSLV: "Enslavement ", FREPRO: "Klingon Build ", } for i in range(1, NEVENTS): proutn(legends[i]) if is_scheduled(i): proutn("%.2f" % (scheduled(i)-game.state.date)) if i == FENSLV or i == FREPRO: ev = findevent(i) proutn(" in %s" % ev.quadrant) else: proutn("never") proutn("? ") scanner.chew() key = scanner.next() if key == 'n': unschedule(i) scanner.chew() elif key == IHREAL: ev = schedule(i, scanner.real) if i == FENSLV or i == FREPRO: scanner.chew() proutn("In quadrant- ") key = scanner.next() # IHEOL says to leave coordinates as they are if key != IHEOL: if key != IHREAL: prout("Event %d canceled, no x coordinate." % (i)) unschedule(i) continue w.x = int(round(scanner.real)) key = scanner.next() if key != IHREAL: prout("Event %d canceled, no y coordinate." % (i)) unschedule(i) continue w.y = int(round(scanner.real)) ev.quadrant = w scanner.chew() proutn("Induce supernova here? ") if ja() == True: game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova = True atover(True) | e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
1435,
422,
1053,
30,
309,
7920,
18,
15358,
411,
7920,
18,
267,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
3501,
13332,
315,
1862,
358,
326,
8216,
1031,
364,
10450,
1199,
450,
322,
82,
2932,
7013,
7575,
35,
9369,
309,
26879,
1435,
422,
1053,
30,
309,
7920,
18,
15358,
411,
7920,
18,
267,... |
print(d, end=' ', file=fo) | fo.write(str(d)) | def test_print(self): d = self.type2test(xrange(200)) d.append(d) d.extend(xrange(200,400)) d.append(d) d.append(400) try: fo = open(test_support.TESTFN, "wb") print(d, end=' ', file=fo) fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), repr(d)) finally: fo.close() os.remove(test_support.TESTFN) | c60cb7c9de9a3d638d4298458eed8db9a6844f45 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/c60cb7c9de9a3d638d4298458eed8db9a6844f45/list_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1188,
12,
2890,
4672,
302,
273,
365,
18,
723,
22,
3813,
12,
92,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
302,
18,
14313,
12,
92,
3676,
12,
6976,
16,
16010,
3719,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1188,
12,
2890,
4672,
302,
273,
365,
18,
723,
22,
3813,
12,
92,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
302,
18,
14313,
12,
92,
3676,
12,
6976,
16,
16010,
3719,
... |
self._strokeColorRGB = aColor | self._fillColorRGB = aColor | def setFillColor(self, aColor): """Takes a color object, allowing colors to be referred to by name""" if type(aColor) == ColorType: rgb = (aColor.red, aColor.green, aColor.blue) self._strokeColorRGB = rgb self._code.append('%0.2f %0.2f %0.2f rg' % rgb ) elif type(aColor) in _SeqTypes: l = len(aColor) if l==3: self._strokeColorRGB = aColor self._code.append('%0.2f %0.2f %0.2f rg' % aColor ) elif l==4: self.setFillColorCMYK(self, aColor[0], aColor[1], aColor[2], aColor[3]) else: raise 'Unknown color', str(aColor) else: raise 'Unknown color', str(aColor) | 0952c62198d44f397dc72c980ced18075d265da8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/0952c62198d44f397dc72c980ced18075d265da8/canvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27101,
2957,
12,
2890,
16,
279,
2957,
4672,
3536,
11524,
279,
2036,
733,
16,
15632,
5740,
358,
506,
29230,
358,
635,
508,
8395,
309,
618,
12,
69,
2957,
13,
422,
5563,
559,
30,
6917,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27101,
2957,
12,
2890,
16,
279,
2957,
4672,
3536,
11524,
279,
2036,
733,
16,
15632,
5740,
358,
506,
29230,
358,
635,
508,
8395,
309,
618,
12,
69,
2957,
13,
422,
5563,
559,
30,
6917,
27... |
logger.warning("Rebuilding index '%s' installed on value '%s' of type %s in attribute '%s' on %s", name, self, type(self), attribute, item._repr_()) | if logger is not None: logger.warning("Rebuilding index '%s' installed on value '%s' of type %s in attribute '%s' on %s", name, self, type(self), attribute, item._repr_()) | def _rebuildIndex(self, logger, index, item, attribute, name, subIndexes=True): logger.warning("Rebuilding index '%s' installed on value '%s' of type %s in attribute '%s' on %s", name, self, type(self), attribute, item._repr_()) | 7413bf47fc09a3c50fe0393603e4152dfa5cd48e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/7413bf47fc09a3c50fe0393603e4152dfa5cd48e/Indexed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
266,
3510,
1016,
12,
2890,
16,
1194,
16,
770,
16,
761,
16,
1566,
16,
508,
16,
720,
8639,
33,
5510,
4672,
225,
1194,
18,
8551,
2932,
426,
3510,
310,
770,
1995,
87,
11,
5876,
603,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
266,
3510,
1016,
12,
2890,
16,
1194,
16,
770,
16,
761,
16,
1566,
16,
508,
16,
720,
8639,
33,
5510,
4672,
225,
1194,
18,
8551,
2932,
426,
3510,
310,
770,
1995,
87,
11,
5876,
603,... |
res = line[i] row[field[len(prefix)]] = res or False | res = line[i] or False row[field[len(prefix)]] = res | def process_liness(self, datas, prefix, current_module, model_name, fields_def, position=0, skip=0): line = datas[position] row = {} warning = [] data_res_id = False xml_id = False nbrmax = position+1 | b63e2b434c2e19dfd41d82c46af6943f61114955 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/b63e2b434c2e19dfd41d82c46af6943f61114955/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
783,
67,
2978,
16,
938,
67,
529,
16,
1466,
67,
536,
16,
1754,
33,
20,
16,
2488,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
80,
6336,
12,
2890,
16,
5386,
16,
1633,
16,
783,
67,
2978,
16,
938,
67,
529,
16,
1466,
67,
536,
16,
1754,
33,
20,
16,
2488,
33,
20,
4672,
980,
273,
5386,
63,
3276,
65,
... |
compute a 200-bit approximation to sqrt(2) which is wrong in the 33'rd bit. :: | compute a 200-bit approximation to `sqrt(2)` which is wrong in the 33'rd bit:: | def algdep(z, degree, known_bits=None, use_bits=None, known_digits=None, use_digits=None, height_bound=None, proof=False): """ Returns a polynomial of degree at most `degree` which is approximately satisfied by the number `z`. Note that the returned polynomial need not be irreducible, and indeed usually won't be if `z` is a good approximation to an algebraic number of degree less than `degree`. You can specify the number of known bits or digits with ``known_bits=k`` or ``known_digits=k``; Pari is then told to compute the result using `0.8k` of these bits/digits. (The Pari documentation recommends using a factor between .6 and .9, but internally defaults to .8.) Or, you can specify the precision to use directly with ``use_bits=k`` or ``use_digits=k``. If none of these are specified, then the precision is taken from the input value. A height bound may specified to indicate the maximum coefficient size of the returned polynomial; if a sufficiently small polyomial is not found then ``None`` wil be returned. If ``proof=True`` then the result is returned only if it can be proved correct (i.e. the only possible minimal polynomial satisfying the height bound, or no such polynomial exists). Otherwise a ``ValueError`` is raised indicating that higher precision is required. ALGORITHM: Uses LLL for real/complex inputs, PARI C-library algdep command otherwise. Note that ``algebraic_dependency`` is a synonym for ``algdep``. INPUT: - ``z`` - real, complex, or `p`-adic number - ``degree`` - an integer - ``height_bound`` - an integer (default ``None``) specifying the maximum coefficient size for the returned polynomial - ``proof`` - a boolean (default ``False``), requres height_bound to be set EXAMPLES:: sage: algdep(1.888888888888888, 1) 9*x - 17 sage: algdep(0.12121212121212,1) 33*x - 4 sage: algdep(sqrt(2),2) x^2 - 2 This example involves a complex number. :: sage: z = (1/2)*(1 + RDF(sqrt(3)) *CC.0); z 0.500000000000000 + 0.866025403784439*I sage: p = algdep(z, 6); p x^3 + 1 sage: p.factor() (x + 1) * (x^2 - x + 1) sage: z^2 - z + 1 0 This example involves a `p`-adic number. :: sage: K = Qp(3, print_mode = 'series') sage: a = K(7/19); a 1 + 2*3 + 3^2 + 3^3 + 2*3^4 + 2*3^5 + 3^8 + 2*3^9 + 3^11 + 3^12 + 2*3^15 + 2*3^16 + 3^17 + 2*3^19 + O(3^20) sage: algdep(a, 1) 19*x - 7 These examples show the importance of proper precision control. We compute a 200-bit approximation to sqrt(2) which is wrong in the 33'rd bit. :: sage: z = sqrt(RealField(200)(2)) + (1/2)^33 sage: p = algdep(z, 4); p 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: factor(p) 227004321085*x^4 - 216947902586*x^3 - 99411220986*x^2 + 82234881648*x - 211871195088 sage: algdep(z, 4, known_bits=32) x^2 - 2 sage: algdep(z, 4, known_digits=10) x^2 - 2 sage: algdep(z, 4, use_bits=25) x^2 - 2 sage: algdep(z, 4, use_digits=8) x^2 - 2 Using the ``height_bound`` and ``proof`` parameters, we can see that `pi` is not the root of an integer polynomial of degree at most 5 and coefficients bounded above by 10. :: sage: algdep(pi.n(), 5, height_bound=10, proof=True) is None True For stronger results, we need more precicion. :: sage: algdep(pi.n(), 5, height_bound=100, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 5, height_bound=100, proof=True) is None True sage: algdep(pi.n(), 10, height_bound=10, proof=True) is None Traceback (most recent call last): ... ValueError: insufficient precision for non-existence proof sage: algdep(pi.n(200), 10, height_bound=10, proof=True) is None True We can also use ``proof=True`` to get positive results. :: sage: a = sqrt(2) + sqrt(3) + sqrt(5) sage: algdep(a.n(), 8, height_bound=1000, proof=True) Traceback (most recent call last): ... ValueError: insufficient precision for uniqueness proof sage: f = algdep(a.n(1000), 8, height_bound=1000, proof=True); f x^8 - 40*x^6 + 352*x^4 - 960*x^2 + 576 sage: f(a).expand() 0 """ if proof and not height_bound: raise ValueError, "height_bound must be given for proof=True" x = ZZ['x'].gen() if isinstance(z, (int, long, integer.Integer)): if height_bound and abs(z) >= height_bound: return None return x - ZZ(z) degree = ZZ(degree) if isinstance(z, (sage.rings.rational.Rational)): if height_bound and max(abs(z.denominator()), abs(z.numerator())) >= height_bound: return None return z.denominator()*x - z.numerator() if isinstance(z, float): z = sage.rings.real_mpfr.RR(z) elif isinstance(z, complex): z = sage.rings.complex_field.CC(z) if isinstance(z, (sage.rings.real_mpfr.RealNumber, sage.rings.complex_number.ComplexNumber)): log2_10 = 3.32192809488736 prec = z.prec() - 6 if known_digits is not None: known_bits = known_digits * log2_10 if known_bits is not None: use_bits = known_bits * 0.8 if use_digits is not None: use_bits = use_digits * log2_10 if use_bits is not None: prec = int(use_bits) is_complex = isinstance(z, sage.rings.complex_number.ComplexNumber) n = degree+1 from sage.matrix.all import matrix M = matrix(ZZ, n, n+1+int(is_complex)) r = ZZ(1) << prec M[0, 0] = 1 M[0,-1] = r for k in range(1, degree+1): M[k,k] = 1 r *= z if is_complex: M[k, -1] = r.real().round() M[k, -2] = r.imag().round() else: M[k, -1] = r.round() LLL = M.LLL(delta=.75) coeffs = LLL[0][:n] if height_bound: def norm(v): # norm on an integer vector invokes Integer.sqrt() which tries to factor... from sage.rings.real_mpfi import RIF return v.change_ring(RIF).norm() if max(abs(a) for a in coeffs) > height_bound: if proof: # Given an LLL reduced basis $b_1, ..., b_n$, we only # know that $|b_1| <= 2^((n-1)/2) |x|$ for non-zero $x \in L$. if norm(LLL[0]) <= 2**((n-1)/2) * n.sqrt() * height_bound: raise ValueError, "insufficient precision for non-existence proof" return None elif proof and norm(LLL[1]) < 2**((n-1)/2) * max(norm(LLL[0]), n.sqrt()*height_bound): raise ValueError, "insufficient precision for uniqueness proof" if coeffs[degree] < 0: coeffs = -coeffs f = list(coeffs) elif proof or height_bound: raise NotImplementedError, "proof and height bound only implemented for real and complex numbers" else: y = pari(z) f = y.algdep(degree) return x.parent()(f) | b5ed948d4508215af6091ab48ef3eea7f0de520e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/b5ed948d4508215af6091ab48ef3eea7f0de520e/arith.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11989,
15037,
12,
94,
16,
10782,
16,
4846,
67,
6789,
33,
7036,
16,
999,
67,
6789,
33,
7036,
16,
4846,
67,
16649,
33,
7036,
16,
999,
67,
16649,
33,
7036,
16,
2072,
67,
3653,
33,
7036,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11989,
15037,
12,
94,
16,
10782,
16,
4846,
67,
6789,
33,
7036,
16,
999,
67,
6789,
33,
7036,
16,
4846,
67,
16649,
33,
7036,
16,
999,
67,
16649,
33,
7036,
16,
2072,
67,
3653,
33,
7036,... |
solution is not SymbolisEquation (as happens for example for | solution is not SymbolicEquation (as happens for example for | def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): """ Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent variable (hereafter called ``y``) - ``ics`` - (optional) the initial or boundary conditions - for a first-order equation, specify the initial ``x`` and ``y`` - for a second-order equation, specify the initial ``x``, ``y``, and ``dy/dx`` - for a second-order boundary solution, specify initial and final ``x`` and ``y`` initial conditions gives error if the solution is not SymbolisEquation (as happens for example for clairot equation) - ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation. - ``show_method`` - (optional) if true, then Sage returns pair ``[solution, method]``, where method is the string describing method which has been used to get solution (Maxima uses the following order for first order equations: linear, separable, exact (including exact with integrating factor), homogeneous, bernoulli, generalized homogeneous) - use carefully in class, see below for the example of the equation which is separable but this property is not recognized by Maxima and equation is solved as exact. - ``contrib_ode`` - (optional) if true, desolve allows to solve clairot, lagrange, riccati and some other equations. May take a long time and thus turned off by default. Initial conditions can be used only if the result is one SymbolicEquation (does not contain singular solution, for example) OUTPUT: In most cases returns SymbolicEquation which defines the solution implicitly. If the result is in the form y(x)=... (happens for linear eqs.), returns the right-hand side only. The possible constant solutions of separable ODE's are omitted. EXAMPLES:: sage: x = var('x') sage: y = function('y', x) sage: desolve(diff(y,x) + y - 1, y) (c + e^x)*e^(-x) :: sage: f = desolve(diff(y,x) + y - 1, y, ics=[10,2]); f (e^10 + e^x)*e^(-x) :: sage: plot(f) We can also solve second-order differential equations.:: sage: x = var('x') sage: y = function('y', x) sage: de = diff(y,x,2) - y == x sage: desolve(de, y) k1*e^x + k2*e^(-x) - x :: sage: f = desolve(de, y, [10,2,1]); f -x + 5*e^(-x + 10) + 7*e^(x - 10) sage: f(x=10) 2 sage: diff(f,x)(x=10) 1 :: sage: de = diff(y,x,2) + y == 0 sage: desolve(de, y) k1*sin(x) + k2*cos(x) sage: desolve(de, y, [0,1,pi/2,4]) 4*sin(x) + cos(x) sage: desolve(y*diff(y,x)+sin(x)==0,y) -1/2*y(x)^2 == c - cos(x) Clairot equation: general and singular solutions:: sage: desolve(diff(y,x)^2+x*diff(y,x)-y==0,y,contrib_ode=True,show_method=True) [[y(x) == c^2 + c*x, y(x) == -1/4*x^2], 'clairault'] For equations involving more variables we specify independent variable:: sage: a,b,c,n=var('a b c n') sage: desolve(x^2*diff(y,x)==a+b*x^n+c*x^2*y^2,y,ivar=x,contrib_ode=True) [[y(x) == 0, (b*x^(n - 2) + a/x^2)*c^2*u == 0]] sage: desolve(x^2*diff(y,x)==a+b*x^n+c*x^2*y^2,y,ivar=x,contrib_ode=True,show_method=True) [[[y(x) == 0, (b*x^(n - 2) + a/x^2)*c^2*u == 0]], 'riccati'] Higher orded, not involving independent variable:: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y).expand() 1/6*y(x)^3 + k1*y(x) == k2 + x sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,1,3]).expand() 1/6*y(x)^3 - 5/3*y(x) == x - 3/2 sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,1,3],show_method=True) [1/6*y(x)^3 - 5/3*y(x) == x - 3/2, 'freeofx'] Separable equations - Sage returns solution in implicit form:: sage: desolve(diff(y,x)*sin(y) == cos(x),y) -cos(y(x)) == c + sin(x) sage: desolve(diff(y,x)*sin(y) == cos(x),y,show_method=True) [-cos(y(x)) == c + sin(x), 'separable'] sage: desolve(diff(y,x)*sin(y) == cos(x),y,[pi/2,1]) -cos(y(x)) == sin(x) - cos(1) - 1 Linear equation - Sage returns the expression on the right hand side only:: sage: desolve(diff(y,x)+(y) == cos(x),y) 1/2*((sin(x) + cos(x))*e^x + 2*c)*e^(-x) sage: desolve(diff(y,x)+(y) == cos(x),y,show_method=True) [1/2*((sin(x) + cos(x))*e^x + 2*c)*e^(-x), 'linear'] sage: desolve(diff(y,x)+(y) == cos(x),y,[0,1]) 1/2*(e^x*sin(x) + e^x*cos(x) + 1)*e^(-x) This ODE with separated variables is solved as exact. Explanation - factor does not split `e^{x-y}` in Maxima into `e^{x}e^{y}`:: sage: desolve(diff(y,x)==exp(x-y),y,show_method=True) [-e^x + e^y(x) == c, 'exact'] You can solve Bessel equations. You can also use initial conditions, but you cannot put (sometimes desired) initial condition at x=0, since this point is singlar point of the equation. Anyway, if the solution should be bounded at x=0, then k2=0.:: sage: desolve(x^2*diff(y,x,x)+x*diff(y,x)+(x^2-4)*y==0,y) k1*bessel_j(2, x) + k2*bessel_y(2, x) Difficult ODE produces error:: sage: desolve(sqrt(y)*diff(y,x)+e^(y)+cos(x)-sin(x+y)==0,y) # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." Difficult ODE produces error - moreover, takes a long time :: sage: desolve(sqrt(y)*diff(y,x)+e^(y)+cos(x)-sin(x+y)==0,y,contrib_ode=True) # not tested Some more types od ODE's:: sage: desolve(x*diff(y,x)^2-(1+x*y)*diff(y,x)+y==0,y,contrib_ode=True,show_method=True) [[y(x) == c + log(x), y(x) == c*e^x], 'factor'] :: sage: desolve(diff(y,x)==(x+y)^2,y,contrib_ode=True,show_method=True) [[[x == c - arctan(sqrt(t)), y(x) == -x - sqrt(t)], [x == c + arctan(sqrt(t)), y(x) == -x + sqrt(t)]], 'lagrange'] These two examples produce error (as expected, Maxima 5.18 cannot solve equations from initial conditions). Current Maxima 5.18 returns false answer in this case!:: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,2]).expand() # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." :: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,2],show_method=True) # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." Second order linear ODE:: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y) (k2*x + k1)*e^(-x) + 1/2*sin(x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,show_method=True) [(k2*x + k1)*e^(-x) + 1/2*sin(x), 'variationofparameters'] sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,1]) 1/2*(7*x + 6)*e^(-x) + 1/2*sin(x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,1],show_method=True) [1/2*(7*x + 6)*e^(-x) + 1/2*sin(x), 'variationofparameters'] sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,pi/2,2]) 3*((e^(1/2*pi) - 2)*x/pi + 1)*e^(-x) + 1/2*sin(x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,pi/2,2],show_method=True) [3*((e^(1/2*pi) - 2)*x/pi + 1)*e^(-x) + 1/2*sin(x), 'variationofparameters'] sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y) (k2*x + k1)*e^(-x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,show_method=True) [(k2*x + k1)*e^(-x), 'constcoeff'] sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,1]) (4*x + 3)*e^(-x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,1],show_method=True) [(4*x + 3)*e^(-x), 'constcoeff'] sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,pi/2,2]) (2*(2*e^(1/2*pi) - 3)*x/pi + 3)*e^(-x) sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,pi/2,2],show_method=True) [(2*(2*e^(1/2*pi) - 3)*x/pi + 3)*e^(-x), 'constcoeff'] This equation can be solved within Maxima but not within Sage. It needs assumptions assume(x>0,y>0) and works in Maxima, but not in Sage:: sage: assume(x>0) # not tested sage: assume(y>0) # not tested sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y,y,show_method=True) # not tested TESTS: Trac #6479 fixed:: sage: x = var('x') sage: y = function('y', x) sage: desolve( diff(y,x,x) == 0, y, [0,0,1]) x :: sage: desolve( diff(y,x,x) == 0, y, [0,1,1]) x + 1 AUTHORS: - David Joyner (1-2006) - Robert Bradshaw (10-2008) - Robert Marik (10-2009) """ if is_SymbolicEquation(de): de = de.lhs() - de.rhs() if is_SymbolicVariable(dvar): raise ValueError, "You have to declare dependent variable as a function, eg. y=function('y',x)" # for backwards compatibility if isinstance(dvar, list): dvar, ivar = dvar elif ivar is None: ivars = de.variables() ivars = [t for t in ivars if t is not dvar] if len(ivars) != 1: raise ValueError, "Unable to determine independent variable, please specify." ivar = ivars[0] def sanitize_var(exprs): return exprs.replace("'"+dvar_str+"("+ivar_str+")",dvar_str) dvar_str=dvar.operator()._maxima_().str() ivar_str=ivar._maxima_().str() de00 = de._maxima_().str() de0 = sanitize_var(de00) ode_solver="ode2" cmd="(TEMP:%s(%s,%s,%s), if TEMP=false then TEMP else substitute(%s=%s(%s),TEMP))"%(ode_solver,de0,dvar_str,ivar_str,dvar_str,dvar_str,ivar_str) # we produce string like this # ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y(x),x) soln = maxima(cmd) if str(soln).strip() == 'false': if contrib_ode: ode_solver="contrib_ode" maxima("load('contrib_ode)") cmd="(TEMP:%s(%s,%s,%s), if TEMP=false then TEMP else substitute(%s=%s(%s),TEMP))"%(ode_solver,de0,dvar_str,ivar_str,dvar_str,dvar_str,ivar_str) # we produce string like this # (TEMP:contrib_ode(x*('diff(y,x,1))^2-(x*y+1)*'diff(y,x,1)+y,y,x), if TEMP=false then TEMP else substitute(y=y(x),TEMP)) soln = maxima(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this ODE." else: raise NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." if show_method: maxima_method=maxima("method") if (ics is not None): if not is_SymbolicEquation(soln.sage()): raise NotImplementedError, "Maxima was unable to use initial condition for this equation (%s)"%(maxima_method.str()) if len(ics) == 2: tempic=(ivar==ics[0])._maxima_().str() tempic=tempic+","+(dvar==ics[1])._maxima_().str() cmd="(TEMP:ic1(%s(%s,%s,%s),%s),substitute(%s=%s(%s),TEMP))"%(ode_solver,de00,dvar_str,ivar_str,tempic,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:ic2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,'diff(y,x)=1),substitute(y=y(x),TEMP)) soln=maxima(cmd) if len(ics) == 3: #fixed ic2 command from Maxima - we have to ensure that %k1, %k2 do not depend on variables, should be removed when fixed in Maxima maxima("ic2_sage(soln,xa,ya,dya):=block([programmode:true,backsubst:true,singsolve:true,temp,%k2,%k1,TEMP_k], \ noteqn(xa), noteqn(ya), noteqn(dya), boundtest('%k1,%k1), boundtest('%k2,%k2), \ temp: lhs(soln) - rhs(soln), \ TEMP_k:solve([subst([xa,ya],soln), subst([dya,xa], lhs(dya)=-subst(0,lhs(dya),diff(temp,lhs(xa)))/diff(temp,lhs(ya)))],[%k1,%k2]), \ if not freeof(lhs(ya),TEMP_k) or not freeof(lhs(xa),TEMP_k) then return (false), \ temp: maplist(lambda([zz], subst(zz,soln)), TEMP_k), \ if length(temp)=1 then return(first(temp)) else return(temp))") tempic=(ivar==ics[0])._maxima_().str() tempic=tempic+","+(dvar==ics[1])._maxima_().str() tempic=tempic+",'diff("+dvar_str+","+ivar_str+")="+(ics[2])._maxima_().str() cmd="(TEMP:ic2_sage(%s(%s,%s,%s),%s),substitute(%s=%s(%s),TEMP))"%(ode_solver,de00,dvar_str,ivar_str,tempic,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:ic2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,'diff(y,x)=1),substitute(y=y(x),TEMP)) soln=maxima(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this IVP. Remove the initial contition to get the general solution." if len(ics) == 4: #fixed bc2 command from Maxima - we have to ensure that %k1, %k2 do not depend on variables, should be removed when fixed in Maxima maxima("bc2_sage(soln,xa,ya,xb,yb):=block([programmode:true,backsubst:true,singsolve:true,temp,%k1,%k2,TEMP_k], \ noteqn(xa), noteqn(ya), noteqn(xb), noteqn(yb), boundtest('%k1,%k1), boundtest('%k2,%k2), \ TEMP_k:solve([subst([xa,ya],soln), subst([xb,yb],soln)], [%k1,%k2]), \ if not freeof(lhs(ya),TEMP_k) or not freeof(lhs(xa),TEMP_k) then return (false), \ temp: maplist(lambda([zz], subst(zz,soln)),TEMP_k), \ if length(temp)=1 then return(first(temp)) else return(temp))") cmd="bc2_sage(%s(%s,%s,%s),%s,%s=%s,%s,%s=%s)"%(ode_solver,de00,dvar_str,ivar_str,(ivar==ics[0])._maxima_().str(),dvar_str,(ics[1])._maxima_().str(),(ivar==ics[2])._maxima_().str(),dvar_str,(ics[3])._maxima_().str()) cmd="(TEMP:%s,substitute(%s=%s(%s),TEMP))"%(cmd,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:bc2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,x=%pi/2,y=2),substitute(y=y(x),TEMP)) soln=maxima(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this BVP. Remove the initial contition to get the general solution." soln=soln.sage() if is_SymbolicEquation(soln) and soln.lhs() == dvar: # Remark: Here we do not check that the right hand side does not depend on dvar. # This probably will not hapen for soutions obtained via ode2, anyway. soln = soln.rhs() if show_method: return [soln,maxima_method.str()] else: return soln | 7f133a6744923b72b06980a1787657382d80133b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/7f133a6744923b72b06980a1787657382d80133b/desolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2832,
5390,
12,
323,
16,
302,
1401,
16,
277,
2143,
33,
7036,
16,
277,
1401,
33,
7036,
16,
2405,
67,
2039,
33,
8381,
16,
13608,
67,
390,
33,
8381,
4672,
3536,
348,
355,
3324,
279,
404... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2832,
5390,
12,
323,
16,
302,
1401,
16,
277,
2143,
33,
7036,
16,
277,
1401,
33,
7036,
16,
2405,
67,
2039,
33,
8381,
16,
13608,
67,
390,
33,
8381,
4672,
3536,
348,
355,
3324,
279,
404... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.