rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
def revert_use_makebox(document): " Deletes use_makebox option of boxes " h = 0 while 1: h = find_token(document.body, 'use_makebox', 0) if h == -1: return del document.body[h] h += 1 | def revert_makebox(document): " Convert \\makebox to TeX code " i = 0 while 1: # only revert frameless boxes without an inner box i = find_token(document.body, '\\begin_inset Box Frameless', i) if i == -1: # remove the option use_makebox revert_use_makebox(document) return z = find_end_of_inset(document.body, i) if z == -1: document.warning("Malformed LyX document: Can't find end of box inset.") return j = find_token(document.body, 'use_makebox 1', i) # assure we found the makebox of the current box if j < z and j != -1: y = find_token(document.body, "\\begin_layout", i) if y > z or y == -1: document.warning("Malformed LyX document: Can't find layout in box.") return # remove the \end_layout \end_inset pair document.body[z - 2:z + 1] = put_cmd_in_ert("}") # determine the alignment k = find_token(document.body, 'hor_pos', j - 4) align = document.body[k][9] # determine the width l = find_token(document.body, 'width "', j + 1) length = document.body[l][7:] # remove trailing '"' length = length[:-1] length = latex_length(length)[1] subst = "\\makebox[" + length + "][" \ + align + "]{" document.body[i:y + 1] = put_cmd_in_ert(subst) i += 1 | 9d5b41e8fc107c294ca7fdbac0c3da4d8a9b7f9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/9d5b41e8fc107c294ca7fdbac0c3da4d8a9b7f9b/lyx_2_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
6540,
2147,
12,
5457,
4672,
315,
4037,
1736,
6540,
2147,
358,
28602,
60,
981,
315,
277,
273,
374,
1323,
404,
30,
468,
1338,
15226,
21799,
12617,
14356,
2887,
392,
3443,
3919,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15226,
67,
6540,
2147,
12,
5457,
4672,
315,
4037,
1736,
6540,
2147,
358,
28602,
60,
981,
315,
277,
273,
374,
1323,
404,
30,
468,
1338,
15226,
21799,
12617,
14356,
2887,
392,
3443,
3919,
... | |
deps, cacheModTime = cache.readmulti(cacheId, self.path) | classInfo, cacheModTime = self._getClassCache() deps = classInfo[cacheId] if cacheId in classInfo else None | def transitiveDepsAreFresh(depsStruct, cacheModTime): if cacheModTime is None: # TODO: this can currently only occur with a Cache.memcache result return False for dep in depsStruct["load"]: if dep.requestor != self.id: # this was included through a recursive traversal if dep.name in self._classesObj: classObj = self._classesObj[dep.name] if cacheModTime < classObj.m_time(): console.debug("Invalidating dep cache for %s, as %s is newer" % (self.id, classObj.id)) return False return True | a1279da621ac20b7821dec8ec07f0f8f6cdff441 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/a1279da621ac20b7821dec8ec07f0f8f6cdff441/Class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30442,
14430,
4704,
42,
1955,
12,
14877,
3823,
16,
1247,
1739,
950,
4672,
309,
1247,
1739,
950,
353,
599,
30,
225,
468,
2660,
30,
333,
848,
4551,
1338,
3334,
598,
279,
4379,
18,
3917,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30442,
14430,
4704,
42,
1955,
12,
14877,
3823,
16,
1247,
1739,
950,
4672,
309,
1247,
1739,
950,
353,
599,
30,
225,
468,
2660,
30,
333,
848,
4551,
1338,
3334,
598,
279,
4379,
18,
3917,
... |
self.o.assy.modified = 1 for mol in fixmols.values(): if mol.atoms: mol.shakedown() else: mol.kill() | self.o.assy.modified = 1 | def modifyDehydrogenate(self): self.status_msg("Dehydrogenating...") from platform import fix_plurals fixmols = {} if self.o.assy.selmols: counta = countm = 0 for m in self.o.assy.selmols: changed = m.Dehydrogenate() # note: this might have removed all atoms from m! Fixed below. if changed: counta += changed countm += 1 fixmols[id(m)] = m ###e In theory, we might have removed an H whose neighbor # is in a different chunk/molecule, which therefore might need a # shakedown... I have not tried to fix that, and I'm not # sure it's a bug (since Dehydrogenate did changeapp on it, # and maybe that's enough -- this needs review). if counta: didwhat = "Dehydrogenate: removed %d atom(s) from %d chunk(s)" \ % (counta, countm) if len(self.o.assy.selmols) > countm: didwhat += \ " (%d selected chunks(s) had no hydrogens)" \ % (len(self.o.assy.selmols) - countm) didwhat = fix_plurals(didwhat) else: didwhat = "Dehydrogenate: selected chunks contain no hydrogens" elif self.o.assy.selatoms: count = 0 for a in self.o.assy.selatoms.values(): ma = a.molecule for atm in list(a.neighbors()) + [a]: #bruce 041018 semantic change: added [a] as well matm = atm.molecule changed = atm.Dehydrogenate() if changed: count += 1 fixmols[id(ma)] = ma # shakedown at most once per mol fixmols[id(matm)] = matm if fixmols: didwhat = \ "Dehydrogenate: removed %d atom(s) from %d chunk(s)" \ % (count, len(fixmols)) didwhat = fix_plurals(didwhat) # Technically, we *should* say ", affected" instead of "from" # since the count includes mols of neighbors of # atoms we removed, not always only mols of atoms we removed. # Since that's rare, we word this assuming it didn't happen. # [#e needs low-pri fix to be accurate in that rare case; # might as well deliver that as a warning, since that case is # also "dangerous" in some sense.] else: didwhat = "Dehydrogenate: no hydrogens bonded to selected atoms" else: didwhat = "Dehydrogenate: nothing selected" if fixmols: self.o.assy.modified = 1 for mol in fixmols.values(): if mol.atoms: mol.shakedown() else: mol.kill() self.w.update() self.status_msg(didwhat) return | a1e9f5e57cd2af68cf70c5ca1c0bc27b35854b68 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/a1e9f5e57cd2af68cf70c5ca1c0bc27b35854b68/modes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
758,
18112,
24096,
340,
12,
2890,
4672,
365,
18,
2327,
67,
3576,
2932,
758,
18112,
24096,
1776,
7070,
13,
628,
4072,
1930,
2917,
67,
412,
17645,
2917,
81,
3528,
273,
2618,
309,
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,
5612,
758,
18112,
24096,
340,
12,
2890,
4672,
365,
18,
2327,
67,
3576,
2932,
758,
18112,
24096,
1776,
7070,
13,
628,
4072,
1930,
2917,
67,
412,
17645,
2917,
81,
3528,
273,
2618,
309,
365... |
def copy(self): """ Returns an instance of Database with default mutable=True. """ new_loc = tmp_filename() + '.db' os.system('cp '+ self.__dblocation__ + ' ' + new_loc) D = SQLDatabase(filename=new_loc, skeleton=copy(self.__skeleton__)) return D def save(self, filename): """ ROBERT : Read the following e.g.'s carefully. You might want to change them before distributing (i.e. os.system('rm '+save_loc)) But this should be a good intro to a bunch of functionality. (I mostly put it in for you). It covers creating a mutable db, saving it and opening it as an immutable db. Then it shows modification and the new awesome show method. (This is my most recent example - the show method is probably better than getting a cursor each time for the doctests so I wanted to put it in since I typically did that the other way -- i.e.: delete_rows method examples). EXAMPLES: sage: from sage.databases.db import DB_HOME sage: save_loc = DB_HOME + 'simon.db' sage: DB = SQLDatabase() sage: DB.create_table('simon',{'a1':{'sql':'bool','primary_key':False}, 'b2':{'sql':'int', 'primary_key':False}}) sage: DB.add_data('simon',[(0,0),(1,1),(1,2)]) sage: DB.save(save_loc) sage: immut = GenericSQLDatabase(save_loc) sage: immut.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: DB.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: p = SQLQuery(DB, {'table_name':'simon', 'display_cols':'b2', 'dillhole':['b2','>', 0]}) sage: DB.delete_rows(p) sage: DB.show('simon') a1 b2 ---------------------------------------- 0 0 sage: immut.show('simon') a1 b2 ---------------------------------------- 0 0 1 1 1 2 sage: import os sage: os.system('rm ' + save_loc) """ try: self.__connection__.execute('commit') except: pass os.system('cp ' + self.__dblocation__ + ' ' + filename) | def copy(self): """ Returns an instance of Database with default mutable=True. """ # copy .db file new_loc = tmp_filename() + '.db' os.system('cp '+ self.__dblocation__ + ' ' + new_loc) D = SQLDatabase(filename=new_loc, skeleton=copy(self.__skeleton__)) return D | ccd462ba82c8e638768d9aaffb11ed63f3c9a76d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/ccd462ba82c8e638768d9aaffb11ed63f3c9a76d/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2860,
392,
791,
434,
5130,
598,
805,
16074,
33,
5510,
18,
3536,
468,
1610,
263,
1966,
585,
394,
67,
1829,
273,
1853,
67,
3459,
1435,
397,
2418,
1966,
11,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2860,
392,
791,
434,
5130,
598,
805,
16074,
33,
5510,
18,
3536,
468,
1610,
263,
1966,
585,
394,
67,
1829,
273,
1853,
67,
3459,
1435,
397,
2418,
1966,
11,
11... | |
if self.discrete: i.quantity = round(fraction) else: i.quantity = fraction | if self.discrete: i.quantity = str(round(fraction)) else: i.quantity = str(fraction) | def setTotal(self, startdate, enddate, quantity): ''' Update the forecast quantity. The logic followed is three-fold: - If one or more forecast entries already exist in the daterange, the quantities of those entries are proportionally rescaled to fit the new quantity. - If no forecast entries exist yet, we create a new set of entries based on the bucket definition of the forecast calendar. This respects the weight ratios as defined in the calendar buckets. - In case no calendar or no calendar buckets can be identified, we simply create a single forecast entry for the specified daterange. ''' # Assure the end date is later than the start date. if startdate > enddate: tmp = startdate startdate = enddate enddate = tmp # Assure the type of the quantity if not isinstance(quantity,Decimal): quantity = Decimal(str(quantity)) # Round the quantity, if discrete flag is on if self.discrete: quantity = quantity.to_integral() # Step 0: Check for forecast entries intersecting with the current daterange startdate = startdate.date() enddate = enddate.date() entries = self.entries.filter(enddate__gt=startdate).filter(startdate__lt=enddate) if entries: # Case 1: Entries already exist in this daterange, which will be rescaled # Case 1, step 1: calculate current quantity and "clip" the existing entries # if required. current = 0 for i in entries: # Calculate the length of this bucket in seconds duration = i.enddate - i.startdate duration = duration.days+86400*duration.seconds if i.startdate == startdate and i.enddate == enddate: # This entry has exactly the same daterange: update the quantity and exit i.quantity = quantity i.save() return elif i.startdate < startdate and i.enddate > enddate: # This bucket starts before the daterange and also ends later. # We need to split the entry in three. # Part one: after our daterange, create a new entry p = i.enddate - enddate q = i.quantity * (p.days+86400*p.seconds) / duration if self.discrete: q = round(q) self.entries.create( \ startdate = enddate, enddate = i.enddate, quantity = q, ).save() # Part two: our date range, create a new entry self.entries.create( \ startdate = startdate, enddate = enddate, quantity = quantity, ).save() # Part three: before our daterange, update the existing entry p = startdate - i.startdate i.enddate = startdate i.quantity = i.quantity * (p.days+86400*p.seconds) / duration if self.discrete: i.quantity = round(i.quantity) i.save() # Done with this case... return elif i.startdate >= startdate and i.enddate <= enddate: # Entry falls completely in the range current += i.quantity elif i.startdate < enddate and i.enddate >= enddate: # This entry starts in the range and ends later. # Split the entry in two. p = i.enddate - enddate fraction = Decimal(i.quantity * (p.days+86400*p.seconds) / duration) current += i.quantity - fraction self.entries.create( \ startdate = i.startdate, enddate = enddate, quantity = i.quantity - fraction, ).save() i.startdate = enddate if self.discrete: i.quantity = round(fraction) else: i.quantity = fraction i.save() elif i.enddate > startdate and i.startdate <= startdate: # This entry ends in the range and starts earlier. # Split the entry in two. p = startdate - i.startdate fraction = Decimal(i.quantity * (p.days+86400*p.seconds) / duration) current += i.quantity - fraction self.entries.create( \ startdate = startdate, enddate = i.enddate, quantity = i.quantity - fraction, ).save() i.enddate = startdate if self.discrete: i.quantity = round(fraction) else: i.quantity = fraction i.save() # Case 1, step 2: Rescale the existing entries # Note that we retrieve an updated set of buckets from the database here... entries = self.entries.filter(enddate__gt=startdate).filter(startdate__lt=enddate) factor = quantity / current if factor == 0: for i in entries: i.delete() elif self.discrete: # Only put integers remainder = 0 for i in entries: q = Decimal(i.quantity * factor + remainder) i.quantity = q.to_integral() remainder = q - i.quantity i.save() else: # No rounding required for i in entries: i.quantity *= factor i.save() else: # Case 2: No intersecting forecast entries exist yet. We use the # calendar buckets to create a new set of forecast entries, respecting # the weight of each bucket. # Note: if the calendar values are updated later on, such changes are # obviously not reflected any more in the forecast entries. cal = self.calendar if cal: entries = cal.buckets.filter(enddate__gt=startdate).filter(startdate__lte=enddate) if entries: # Case 2a: We found calendar buckets # Case 2a, step 1: compute total sum of weight values weights = 0 for i in entries: p = min(i.enddate.date(),enddate) - max(i.startdate.date(),startdate) q = i.enddate.date() - i.startdate.date() weights += i.value * (p.days+86400*p.seconds) / (q.days+86400*q.seconds) # Case 2a, step 2: create a forecast entry for each calendar bucket remainder = Decimal(0) if weights == 0: # No non-zero weight buckets found: the update is infeasible return for i in entries: p = min(i.enddate.date(),enddate) - max(i.startdate.date(),startdate) q = i.enddate.date() - i.startdate.date() q = Decimal(quantity * i.value * (p.days+86400*p.seconds) / (q.days+86400*q.seconds) / weights) if self.discrete: q += remainder k = q.to_integral() remainder = q - k q = k if q > 0: self.entries.create( \ startdate=max(i.startdate.date(),startdate), enddate=min(i.enddate.date(),enddate), quantity=q, ).save() else: # Case 2b: No calendar buckets found at all # Create a new entry for the daterange self.entries.create(startdate=startdate,enddate=enddate,quantity=quantity).save() | be185fc1f8e444a57ca49b9420207c749e3d2f5f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8604/be185fc1f8e444a57ca49b9420207c749e3d2f5f/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25015,
12,
2890,
16,
787,
712,
16,
679,
712,
16,
10457,
4672,
9163,
2315,
326,
18763,
10457,
18,
1021,
4058,
10860,
353,
8925,
17,
16007,
30,
300,
971,
1245,
578,
1898,
18763,
3222,
1818... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25015,
12,
2890,
16,
787,
712,
16,
679,
712,
16,
10457,
4672,
9163,
2315,
326,
18763,
10457,
18,
1021,
4058,
10860,
353,
8925,
17,
16007,
30,
300,
971,
1245,
578,
1898,
18763,
3222,
1818... |
if not is_gui_thread(): return Dispatcher(self.recount)(*args) | def recount(self, *args): if not is_gui_thread(): # Re-call in GUI thread return Dispatcher(self.recount)(*args) ci = self.currentIndex() if not ci.isValid(): ci = self.indexAt(QPoint(10, 10)) try: self.model().refresh() except: #Database connection could be closed if an integrity check is happening pass if ci.isValid(): self.scrollTo(ci, QTreeView.PositionAtTop) | 5b61e4c95e4db628624ae9268315b5f3732ad040 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/5b61e4c95e4db628624ae9268315b5f3732ad040/tag_view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1883,
12,
2890,
16,
380,
1968,
4672,
309,
486,
353,
67,
20292,
67,
5930,
13332,
468,
868,
17,
1991,
316,
10978,
2650,
327,
16710,
12,
2890,
18,
266,
1883,
21433,
14,
1968,
13,
903... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1883,
12,
2890,
16,
380,
1968,
4672,
309,
486,
353,
67,
20292,
67,
5930,
13332,
468,
868,
17,
1991,
316,
10978,
2650,
327,
16710,
12,
2890,
18,
266,
1883,
21433,
14,
1968,
13,
903... | |
corefile = "/var/xen/dump/%s-%s.%s.core" % (this_time, self.info['name_label'], self.domid) | corefile = "%s/%s-%s.%s.core" % (coredir, this_time, self.info['name_label'], self.domid) | def dumpCore(self, corefile = None): """Create a core dump for this domain. | 4caa456392974c418522f2e80bc83e991b8b04cd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/4caa456392974c418522f2e80bc83e991b8b04cd/XendDomainInfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4657,
4670,
12,
2890,
16,
2922,
768,
273,
599,
4672,
3536,
1684,
279,
2922,
4657,
364,
333,
2461,
18,
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,
4657,
4670,
12,
2890,
16,
2922,
768,
273,
599,
4672,
3536,
1684,
279,
2922,
4657,
364,
333,
2461,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
bot.start() | try: bot.start() except KeyboardInterrupt: pass | def main(conf): """ Start the bot using a config file. :Parameters: - `conf`: config file location """ CONFIG = ConfigParser() CONFIG.read(conf) # Get the irc network configuration server = CONFIG.get("irc", "server") port = CONFIG.getint("irc", "port") channels = CONFIG.get("irc", "channels").split(",") nick = CONFIG.get("irc", "nick") try: server_pass = CONFIG.get("irc", "server_password") except: server_pass = None try: nick_pass = CONFIG.get("irc", "nick_password") except: nick_pass = None owner = [x.strip() for x in CONFIG.get("irc", "owners").split(",")] # Get the log section folder = CONFIG.get("log", "folder") stylesheet = CONFIG.get("log", "stylesheet") # Get the formation information types = ["join", "kick", "mode", "nick", "part", "pubmsg", "pubnotice", "quit", "topic"] format = {} for type in types: format[type] = CONFIG.get("format", type) bot = LogBot(server, port, server_pass, channels, owner, nick, nick_pass) bot.set_format(folder, format, stylesheet) bot.start() | 733c447041daea590404c94df8d5b074aedd2dc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2050/733c447041daea590404c94df8d5b074aedd2dc3/logbot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
3923,
4672,
3536,
3603,
326,
2512,
1450,
279,
642,
585,
18,
225,
294,
2402,
30,
300,
1375,
3923,
68,
30,
642,
585,
2117,
3536,
9128,
273,
25076,
1435,
9128,
18,
896,
12,
3923... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
3923,
4672,
3536,
3603,
326,
2512,
1450,
279,
642,
585,
18,
225,
294,
2402,
30,
300,
1375,
3923,
68,
30,
642,
585,
2117,
3536,
9128,
273,
25076,
1435,
9128,
18,
896,
12,
3923... |
bom_point = sbom_obj.browse(cr, uid, [bom_id])[0] | bom_point = bom_obj.browse(cr, uid, [bom_id])[0] | def change_prod_qty(self, cr, uid, ids, context): """ Changes the Quantity of Product. @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param ids: List of IDs selected @param context: A standard dictionary @return: """ record_id = context and context.get('active_id',False) assert record_id, _('Active Id is not found') prod_obj = self.pool.get('mrp.production') product_lines_obj = self.pool.get('mrp.production.product.line') bom_obj = self.pool.get('mrp.bom') for wiz_qty in self.browse(cr, uid, ids): prod = prod_obj.browse(cr, uid,record_id) prod_obj.write(cr, uid,prod.id, {'product_qty': wiz_qty.product_qty}) prod_obj.action_compute(cr, uid, [prod.id]) move_lines_obj = self.pool.get('stock.move') for move in prod.move_lines: bom_point = prod.bom_id bom_id = prod.bom_id.id if not bom_point: bom_id = bom_obj._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id) if not bom_id: raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) prod_obj.write(cr, uid, [prod.id], {'bom_id': bom_id}) bom_point = sbom_obj.browse(cr, uid, [bom_id])[0] if not bom_id: raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor res = bom_obj._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, []) for r in res[0]: if r['product_id']== move.product_id.id: move_lines_obj.write(cr, uid,move.id, {'product_qty' : r['product_qty']}) for m in prod.move_created_ids: move_lines_obj.write(cr, uid,m.id, {'product_qty': wiz_qty.product_qty}) return {} | 1afb92d56e92dc63e9cc31d1e926b392a75d80f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1afb92d56e92dc63e9cc31d1e926b392a75d80f3/change_production_qty.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
17672,
67,
85,
4098,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
4672,
3536,
17776,
326,
18189,
434,
8094,
18,
225,
632,
891,
365,
30,
1021,
733,
4407,
18,
632,
891,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2549,
67,
17672,
67,
85,
4098,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
4672,
3536,
17776,
326,
18189,
434,
8094,
18,
225,
632,
891,
365,
30,
1021,
733,
4407,
18,
632,
891,
4... |
picture_name = md['album_picture'].replace('_thumb', '') f.write('Album image identifier "%s"\n' % picture_name); | f.write('Album image identifier "%s"\n' % md['album_picture']); | def generate(self): ''' Generates new metadata file with default values. ''' | 2045c2b072368aa05e2d07eea387e6745fe9f77e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4663/2045c2b072368aa05e2d07eea387e6745fe9f77e/metadata.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
9163,
31902,
394,
1982,
585,
598,
805,
924,
18,
9163,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12,
2890,
4672,
9163,
31902,
394,
1982,
585,
598,
805,
924,
18,
9163,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) | shell = (os.name == 'nt') proc = subprocess.Popen(['git'] + command, shell=shell, stdout=subprocess.PIPE) | def RunGit(command): """Run a git subcommand, returning its output.""" proc = subprocess.Popen(['git'] + command, stdout=subprocess.PIPE) return proc.communicate()[0].strip() | 518e0028821eee26f7f22ed40e99e5ab0f588578 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/518e0028821eee26f7f22ed40e99e5ab0f588578/sync-webkit-git.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1939,
11540,
12,
3076,
4672,
3536,
1997,
279,
5071,
18856,
16,
5785,
2097,
876,
12123,
225,
5972,
273,
261,
538,
18,
529,
422,
296,
496,
6134,
5418,
273,
6652,
18,
52,
3190,
12,
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,
1939,
11540,
12,
3076,
4672,
3536,
1997,
279,
5071,
18856,
16,
5785,
2097,
876,
12123,
225,
5972,
273,
261,
538,
18,
529,
422,
296,
496,
6134,
5418,
273,
6652,
18,
52,
3190,
12,
3292,
... |
logger.info("Using mirobridge_interpreter_2_0_3") | logger.info("Using mirobridge_interpreter_2_0_3") | def __getattr__(self, attr): """Delegate everything but write to the stream""" return getattr(self.out, attr) | cefa7947527c8e9e2184befa6fb1cdca04096461 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13713/cefa7947527c8e9e2184befa6fb1cdca04096461/mirobridge.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1747,
972,
12,
2890,
16,
1604,
4672,
3536,
9586,
7756,
1496,
1045,
358,
326,
1407,
8395,
327,
3869,
12,
2890,
18,
659,
16,
1604,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
588,
1747,
972,
12,
2890,
16,
1604,
4672,
3536,
9586,
7756,
1496,
1045,
358,
326,
1407,
8395,
327,
3869,
12,
2890,
18,
659,
16,
1604,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def relfilter(repo, args): | def relfilter(repo, files): | def relfilter(repo, args): if os.getcwd() != repo.root: p = os.getcwd()[len(repo.root) + 1: ] return filterfiles(p, args) return args | 696aae8cd8215f7812988063e6685fe6e912a5e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/696aae8cd8215f7812988063e6685fe6e912a5e0/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
2188,
12,
7422,
16,
1390,
4672,
309,
1140,
18,
588,
11089,
1435,
480,
3538,
18,
3085,
30,
293,
273,
1140,
18,
588,
11089,
1435,
63,
1897,
12,
7422,
18,
3085,
13,
397,
404,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1279,
2188,
12,
7422,
16,
1390,
4672,
309,
1140,
18,
588,
11089,
1435,
480,
3538,
18,
3085,
30,
293,
273,
1140,
18,
588,
11089,
1435,
63,
1897,
12,
7422,
18,
3085,
13,
397,
404,
30,
... |
graph = pydot.Dot(fontsize="16", label=offer) graph.set('size', '10.7,7.3') graph.set('center', '1') graph.set('ratio', 'auto') graph.set('rotate', '90') graph.set('rankdir', 'LR') | graph = pydot.Dot(fontsize="16", label=offer, size='10.7, 7.3', center='1', ratio='auto', rotate='90', rankdir='LR' ) | def __init__(self, cr, uid, ids, data): logger = netsvc.Logger() try: import pydot except Exception, e: logger.notifyChannel('workflow', netsvc.LOG_WARNING, 'Import Error for pydot, you will not be able \ to render workflows\n' 'Consider Installing PyDot or dependencies: \ http://dkbza.org/pydot.html') raise e offer_id = ids self.done = False | 71449e9d60b79118e88c2c26b4163c6084a19775 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/71449e9d60b79118e88c2c26b4163c6084a19775/dm_print_offer_graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
501,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
775,
30,
1930,
2395,
9811,
1335,
1185,
16,
425,
30,
1194,
18,
12336,
290... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4422,
16,
4555,
16,
3258,
16,
501,
4672,
1194,
273,
21954,
4227,
18,
3328,
1435,
775,
30,
1930,
2395,
9811,
1335,
1185,
16,
425,
30,
1194,
18,
12336,
290... |
if mname in self.modules: return self.modules[mname] self.modules[mname] = m = self.hooks.new_module(mname) | m = self.modules.get(mname) if m is None: self.modules[mname] = m = self.hooks.new_module(mname) | def add_module(self, mname): if mname in self.modules: return self.modules[mname] self.modules[mname] = m = self.hooks.new_module(mname) m.__builtins__ = self.modules['__builtin__'] return m | ae4b5cb853172d4346276b57dad60870b384cfa2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/ae4b5cb853172d4346276b57dad60870b384cfa2/rexec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2978,
12,
2890,
16,
312,
529,
4672,
312,
273,
365,
18,
6400,
18,
588,
12,
81,
529,
13,
309,
312,
353,
599,
30,
365,
18,
6400,
63,
81,
529,
65,
273,
312,
273,
365,
18,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
2978,
12,
2890,
16,
312,
529,
4672,
312,
273,
365,
18,
6400,
18,
588,
12,
81,
529,
13,
309,
312,
353,
599,
30,
365,
18,
6400,
63,
81,
529,
65,
273,
312,
273,
365,
18,
10... |
return generator(fh) | return util.chunkbuffer(generator(fh)) | def generator(f): zd = bz2.BZ2Decompressor() zd.decompress("BZ") for chunk in util.filechunkiter(f, 4096): yield zd.decompress(chunk) | 0e797ba7fa525c4f135969f168883514daafb294 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/0e797ba7fa525c4f135969f168883514daafb294/changegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4456,
12,
74,
4672,
998,
72,
273,
24788,
22,
18,
38,
62,
22,
17731,
1028,
280,
1435,
998,
72,
18,
323,
14706,
2932,
38,
62,
7923,
364,
2441,
316,
1709,
18,
768,
6551,
2165,
12,
74,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4456,
12,
74,
4672,
998,
72,
273,
24788,
22,
18,
38,
62,
22,
17731,
1028,
280,
1435,
998,
72,
18,
323,
14706,
2932,
38,
62,
7923,
364,
2441,
316,
1709,
18,
768,
6551,
2165,
12,
74,
... |
sage: Tab.latex() | sage: Tab.latex() | def positionsOfUnmatchedPlus(self, i): | 32a3559acd5b97a7ee5e4709552657a21bace556 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/32a3559acd5b97a7ee5e4709552657a21bace556/tensor_product.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
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,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6865,
951,
984,
11073,
13207,
12,
2890,
16,
277,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if item.HasChildren(): | if item.HasChildren() and item.IsExpanded(): | def FillArray(self, item, array=[]): """ Internal function. Used to populate an array of selected items when the style TR_MULTIPLE is used. """ | e1463b9df091ad0e9d76292564d4389882b28de1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/e1463b9df091ad0e9d76292564d4389882b28de1/customtreectrl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14192,
1076,
12,
2890,
16,
761,
16,
526,
33,
8526,
4672,
3536,
3186,
445,
18,
10286,
358,
6490,
392,
526,
434,
3170,
1516,
1347,
326,
2154,
4235,
67,
24683,
900,
353,
1399,
18,
3536,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
14192,
1076,
12,
2890,
16,
761,
16,
526,
33,
8526,
4672,
3536,
3186,
445,
18,
10286,
358,
6490,
392,
526,
434,
3170,
1516,
1347,
326,
2154,
4235,
67,
24683,
900,
353,
1399,
18,
3536,
2... |
extras='geo' | extras='geo, tags' | def get(self): token = self.request.get("token") nsid = self.request.get("nsid") page = self.request.get("page") | 228425283fae59509f03a8940ec1965e88957938 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11110/228425283fae59509f03a8940ec1965e88957938/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
1147,
273,
365,
18,
2293,
18,
588,
2932,
2316,
7923,
3153,
350,
273,
365,
18,
2293,
18,
588,
2932,
2387,
350,
7923,
1363,
273,
365,
18,
2293,
18,
588,
2932,
2433,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
12,
2890,
4672,
1147,
273,
365,
18,
2293,
18,
588,
2932,
2316,
7923,
3153,
350,
273,
365,
18,
2293,
18,
588,
2932,
2387,
350,
7923,
1363,
273,
365,
18,
2293,
18,
588,
2932,
2433,
... |
sage: cmp(J0(37), 5) | sage: cmp(J0(37), 5) | def __cmp__(self, other): """ Compare two modular abelian varieties. | 4bbeb68b94297e37d4c00c70444c92361124e0e1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/4bbeb68b94297e37d4c00c70444c92361124e0e1/abvar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
11051,
2795,
681,
2490,
1223,
292,
2779,
1394,
278,
606,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
3536,
11051,
2795,
681,
2490,
1223,
292,
2779,
1394,
278,
606,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
try: return DateTime.strptime(d, '%H:%M:%S'), tz except: pass | def _dateConvertFromDB(d): if d==None: return None try: return DateTime.strptime(d, '%Y-%m-%d') #just Y/M/D except: pass try: return DateTime.strptime(d, '%H:%M:%S') #just hh:mm:ss except: pass dashind = string.rindex(d, '-') tz = d[dashind:] d = d[:dashind] try: return DateTime.strptime(d, '%H:%M:%S'), tz # timetz except: pass # NO -- it was already stripped off, above! -- js Thu Aug 9 11:51:23 2001 #strip off offset from gmt #d = d[:string.rindex(d, '-')] try: return DateTime.strptime(d, '%Y-%m-%d %H:%M:%S') # full date except: #print "date passed to convert function: |%s|" % d raise | 8830b586a28ef3b620195c52bc3c48e7f3cd50dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5832/8830b586a28ef3b620195c52bc3c48e7f3cd50dc/postconn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
712,
2723,
1265,
2290,
12,
72,
4672,
309,
302,
631,
7036,
30,
327,
599,
775,
30,
327,
3716,
18,
701,
10650,
12,
72,
16,
1995,
61,
6456,
81,
6456,
72,
6134,
468,
3732,
1624,
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,
389,
712,
2723,
1265,
2290,
12,
72,
4672,
309,
302,
631,
7036,
30,
327,
599,
775,
30,
327,
3716,
18,
701,
10650,
12,
72,
16,
1995,
61,
6456,
81,
6456,
72,
6134,
468,
3732,
1624,
19,
... | |
if os.name=="nt": self.install_nt_service() def state_nt_service (self, name): import win32serviceutil return win32serviceutil.QueryServiceStatus(name)[1] def install_nt_service (self): from wc import win32start, AppName, Configuration import win32serviceutil oldargs = sys.argv sys.argv = ['webcleaner', 'install'] win32serviceutil.HandleCommandLine(win32start.ProxyService) state = self.state_nt_service(AppName) while state==win32service.SERVICE_START_PENDING: time.sleep(1) state = self.state_nt_service(AppName) if state==win32service.SERVICE_RUNNING: sys.argv = ['webcleaner', 'stop'] win32serviceutil.HandleCommandLine(win32start.ProxyService) state = self.state_nt_service(AppName) while state==win32service.SERVICE_STOP_PENDING: time.sleep(1) state = self.state_nt_service(AppName) sys.argv = ['webcleaner', 'start'] win32serviceutil.HandleCommandLine(win32start.ProxyService) sys.argv = oldargs config = Configuration() config_url = "http://localhost:%d/" % config['port'] import time, webbrowser time.sleep(5) webbrowser.open(config_url) | def run (self): super(MyInstall, self).run() # we have to write a configuration file because we need the # <install_data> directory (and other stuff like author, url, ...) data = [] for d in ['purelib', 'platlib', 'lib', 'headers', 'scripts', 'data']: attr = 'install_%s'%d if self.root: # cut off root path prefix val = getattr(self, attr)[len(self.root):] else: val = getattr(self, attr) if attr=="install_data": base = os.path.join(val, 'share', 'webcleaner') data.append('config_dir = %r' % \ os.path.normcase(os.path.join(base, 'config'))) data.append('template_dir = %r' % \ os.path.normcase(os.path.join(base, 'templates'))) data.append("%s = %r" % (attr, val)) from pprint import pformat data.append('outputs = %s' % pformat(self.get_outputs())) self.distribution.create_conf_file(self.install_lib, data) # install proxy service if os.name=="nt": self.install_nt_service() | f4449716a250bb47d6d865c0f80d2ced279bbd0a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/f4449716a250bb47d6d865c0f80d2ced279bbd0a/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2240,
12,
12062,
6410,
16,
365,
2934,
2681,
1435,
468,
732,
1240,
358,
1045,
279,
1664,
585,
2724,
732,
1608,
326,
468,
411,
5425,
67,
892,
34,
1867,
261,
464,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
261,
2890,
4672,
2240,
12,
12062,
6410,
16,
365,
2934,
2681,
1435,
468,
732,
1240,
358,
1045,
279,
1664,
585,
2724,
732,
1608,
326,
468,
411,
5425,
67,
892,
34,
1867,
261,
464,
1... | |
if len(n) == 1: | if len(n) == 0: return FakeExpression([SR.one_element(), d], _operator.div) elif len(n) == 1: | def get_fake_div(self, ex): """ EXAMPLES:: | d0aefb279f74a67e37df90d59b73a7386bd1c35d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/d0aefb279f74a67e37df90d59b73a7386bd1c35d/expression_conversions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
28395,
67,
2892,
12,
2890,
16,
431,
4672,
3536,
5675,
8900,
11386,
2866,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
28395,
67,
2892,
12,
2890,
16,
431,
4672,
3536,
5675,
8900,
11386,
2866,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
out_fd.write(fds[index].read(row['length'])) | data = fds[index].read(row['length']) out_fd.write(data) | def create_new_stream(self,stream_ids): """ Creates a new stream by combining the streams given by the list stream_ids. @return the new stream id. """ if len(stream_ids)<2: return ## Store the new stream in the cache: dbh = DB.DBO(self.case) | 769cf727b8c526ace48594eef3263c998dfb50ea /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5568/769cf727b8c526ace48594eef3263c998dfb50ea/Reassembler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
67,
3256,
12,
2890,
16,
3256,
67,
2232,
4672,
3536,
10210,
279,
394,
1407,
635,
29189,
326,
8205,
864,
635,
326,
666,
1407,
67,
2232,
18,
225,
632,
2463,
326,
394,
1407,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2704,
67,
3256,
12,
2890,
16,
3256,
67,
2232,
4672,
3536,
10210,
279,
394,
1407,
635,
29189,
326,
8205,
864,
635,
326,
666,
1407,
67,
2232,
18,
225,
632,
2463,
326,
394,
1407,... |
rtype = epytext.to_html(rval.type()) | rtype = dom_to_html(rval.type(), container) | def _func_summary(self, functions, sort_order, heading='Function Summary'): 'Return a summary of the functions in a class or module' functions = self._sort(functions, sort_order) if len(functions) == 0: return '' str = self._table_header(heading, 'summary') for link in functions: func = link.target() fname = link.name() if not self._docmap.has_key(func): if WARN_MISSING: print 'WARNING: MISSING', func continue fdoc = self._docmap[func] # Try to find a documented ancestor. inheritdoc = 0 while (not fdoc.documented() and fdoc.overrides() and self._docmap.has_key(fdoc.overrides())): fdoc = self._docmap[fdoc.overrides()] inheritdoc = 1 rval = fdoc.returns() if rval.type(): rtype = epytext.to_html(rval.type()) else: rtype = ' ' | ad5bc28e61fc8837c138ad9d0c6ffb1dd1b518ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/ad5bc28e61fc8837c138ad9d0c6ffb1dd1b518ec/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
7687,
12,
2890,
16,
4186,
16,
1524,
67,
1019,
16,
11053,
2218,
2083,
17967,
11,
4672,
296,
990,
279,
4916,
434,
326,
4186,
316,
279,
667,
578,
1605,
11,
4186,
273,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
7687,
12,
2890,
16,
4186,
16,
1524,
67,
1019,
16,
11053,
2218,
2083,
17967,
11,
4672,
296,
990,
279,
4916,
434,
326,
4186,
316,
279,
667,
578,
1605,
11,
4186,
273,
365,
... |
child = subprocess.Popen(['0launch', '--source', '--get-selections'] + options + [self.interface], stdout = subprocess.PIPE) | child = subprocess.Popen([launch_prog, '--source', '--get-selections'] + options + [self.interface], stdout = subprocess.PIPE) | def get_selections(self, prompt = False): if self._selections: assert not prompt return self._selections | f5ffcb8b1e5c2e215261570586a798f939c72d2f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11549/f5ffcb8b1e5c2e215261570586a798f939c72d2f/support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
10705,
87,
12,
2890,
16,
6866,
273,
1083,
4672,
309,
365,
6315,
10705,
87,
30,
1815,
486,
6866,
327,
365,
6315,
10705,
87,
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,
336,
67,
10705,
87,
12,
2890,
16,
6866,
273,
1083,
4672,
309,
365,
6315,
10705,
87,
30,
1815,
486,
6866,
327,
365,
6315,
10705,
87,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
def update_collapsed_row(self, model, path, iter, user_data): """Build a list of task that must showed as collapsed in Treeview""" model = self.task_tv.get_model() tid = model.get_value(iter, tasktree.COL_TID) if (model.iter_has_child(iter) and self.task_tv.row_expanded(path) and tid in self.priv["collapsed_tids"]): self.priv["collapsed_tids"].remove(tid) elif (model.iter_has_child(iter) and not self.task_tv.row_expanded(path) and tid not in self.priv["collapsed_tids"]): self.priv["collapsed_tids"].append(tid) return False | def update_collapsed_row(self, model, path, iter, user_data): """Build a list of task that must showed as collapsed in Treeview""" model = self.task_tv.get_model() tid = model.get_value(iter, tasktree.COL_TID) # Remove expanded rows if (model.iter_has_child(iter) and self.task_tv.row_expanded(path) and tid in self.priv["collapsed_tids"]): self.priv["collapsed_tids"].remove(tid) # Append collapsed rows elif (model.iter_has_child(iter) and not self.task_tv.row_expanded(path) and tid not in self.priv["collapsed_tids"]): self.priv["collapsed_tids"].append(tid) | 1a7f1370f28f3e5b66447a7ed5fb6581efceb629 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/1a7f1370f28f3e5b66447a7ed5fb6581efceb629/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1293,
13886,
67,
492,
12,
2890,
16,
938,
16,
589,
16,
1400,
16,
729,
67,
892,
4672,
3536,
3116,
279,
666,
434,
1562,
716,
1297,
2405,
329,
487,
17027,
316,
4902,
1945,
8395,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
1293,
13886,
67,
492,
12,
2890,
16,
938,
16,
589,
16,
1400,
16,
729,
67,
892,
4672,
3536,
3116,
279,
666,
434,
1562,
716,
1297,
2405,
329,
487,
17027,
316,
4902,
1945,
8395,
... | |
import sys sys.modules['fedora.client.ProxyClient'] = ProxyClient sys.modules['fedora.client.AccountSystem'] = AccountSystem | def __setattr__(self, key, value): '''Set a key to a value. | 538c844f702f68d99ceb7fd2be9464d253bbe9e4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9952/538c844f702f68d99ceb7fd2be9464d253bbe9e4/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
498,
16,
460,
4672,
9163,
694,
279,
498,
358,
279,
460,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
542,
1747,
972,
12,
2890,
16,
498,
16,
460,
4672,
9163,
694,
279,
498,
358,
279,
460,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... | |
return set(temp_list) | retval = set(temp_list) | def _copy(self, obj): """ <Purpose> Create a deep copy of an object without using the python 'copy' module. Using copy.deepcopy() doesn't work because builtins like id and hasattr aren't available when this is called. <Arguments> self obj The object to make a deep copy of. <Exceptions> TypeError If an object is encountered that we don't know how to make a copy of. NamespaceViolationError If an unexpected error occurs while copying. This isn't the greatest solution, but in general the idea is we just need to abort the wrapped function call. <Side Effects> A new reference is created to every non-simple type of object. That is, everything except objects of type str, unicode, int, etc. <Returns> The deep copy of obj. """ try: # types.InstanceType is included because the user can provide an instance # of a class of their own in the list of callback args to settimer. if _is_in(type(obj), [str, unicode, int, long, float, complex, bool, types.NoneType, types.FunctionType, types.LambdaType, types.MethodType, types.InstanceType]): return obj elif _is_in(type(obj), [tuple, list, set, frozenset]): temp_list = [] for item in obj: temp_list.append(self._copy(item)) if type(obj) is tuple: return tuple(temp_list) elif type(obj) is set: return set(temp_list) elif type(obj) is frozenset: return frozenset(temp_list) else: return temp_list elif type(obj) is dict: temp_dict = {} for key in obj: temp_dict[key] = self._copy(obj[key]) return temp_dict # We don't copy certain objects. This is because copying an emulated file # object, for example, will cause the destructor of the original one to # be invoked, which will close the actual underlying file. As the object # is wrapped and the client does not have access to it, it's safe to not # wrap it. elif isinstance(obj, (NamespaceObjectWrapper, emulfile.emulated_file, emulcomm.emulated_socket, thread.LockType, virtual_namespace.VirtualNamespace)): return obj else: raise TypeError("_copy is not implemented for objects of type " + str(type(obj))) except Exception, e: self._handle_violation("_copy failed on " + str(obj) + " with message " + str(e)) | 269dec09cf5f6cd26664269cfea5fe441cc84fa4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/269dec09cf5f6cd26664269cfea5fe441cc84fa4/namespace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3530,
12,
2890,
16,
1081,
4672,
3536,
411,
10262,
4150,
34,
1788,
279,
4608,
1610,
434,
392,
733,
2887,
1450,
326,
5790,
296,
3530,
11,
1605,
18,
11637,
1610,
18,
16589,
3530,
1435,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3530,
12,
2890,
16,
1081,
4672,
3536,
411,
10262,
4150,
34,
1788,
279,
4608,
1610,
434,
392,
733,
2887,
1450,
326,
5790,
296,
3530,
11,
1605,
18,
11637,
1610,
18,
16589,
3530,
1435,... |
Publisher.subscribe(self.OnPageChanged, "PAGE_CHANGED") Publisher.subscribe(self.OnFileLoaded, "FILE_LOADED") Publisher.subscribe(self.OnDiffSizes, "DIFF_SIZES") Publisher.subscribe(self.OnThumbnailAdded, "THUMBNAIL_ADDED") Publisher.subscribe(self.OnThumbnailDone, "THUMBNAIL_DONE") Publisher.subscribe(self.OnProgressBegin, "SWF_BEGIN_SAVE") Publisher.subscribe(self.OnProgressUpdate, "SWF_PAGE_SAVED") Publisher.subscribe(self.OnProgressDone, "SWF_FILE_SAVED") Publisher.subscribe(self.OnCombineError, "SWF_COMBINE_ERROR") Publisher.subscribe(self.OnFileDroped, "FILE_DROPED") Publisher.subscribe(self.OnFilesDroped, "FILES_DROPED") self.view.Bind(wx.EVT_MENU, self.OnMenuOpen, id=wx.ID_OPEN) self.view.Bind(wx.EVT_MENU, self.OnMenuSave, id=wx.ID_SAVE) self.view.Bind(wx.EVT_MENU, self.OnMenuSaveSelected, id=wx.ID_SAVEAS) self.view.Bind(wx.EVT_MENU, self.OnMenuExit, id=wx.ID_EXIT) self.view.Bind(wx.EVT_MENU_RANGE, self.OnFileHistory, id=wx.ID_FILE1, id2=wx.ID_FILE9) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_SAVE) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_SAVEAS) self.view.Bind(wx.EVT_MENU, self.OnMenuSelectAll, id=wx.ID_SELECTALL) self.view.Bind(wx.EVT_MENU, self.OnMenuInvertSelection, id=ID_INVERT_SELECTION) self.view.Bind(wx.EVT_MENU, self.OnMenuSelectOdd, id=ID_SELECT_ODD) self.view.Bind(wx.EVT_MENU, self.OnMenuSelectEven, id=ID_SELECT_EVEN) self.view.Bind(wx.EVT_MENU, self.OnMenuOptions, id=wx.ID_PREFERENCES) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_SELECTALL) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_INVERT_SELECTION) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_SELECT_ODD) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_SELECT_EVEN) self.view.Bind(wx.EVT_MENU, self.OnAbout, id=wx.ID_ABOUT) self.view.Bind(wx.EVT_MENU, self.OnZoom, id=wx.ID_ZOOM_IN) self.view.Bind(wx.EVT_MENU, self.OnZoom, id=wx.ID_ZOOM_OUT) self.view.Bind(wx.EVT_MENU, self.OnZoom, id=wx.ID_ZOOM_100) self.view.Bind(wx.EVT_MENU, self.OnFit, id=wx.ID_ZOOM_FIT) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_ZOOM_IN) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_ZOOM_OUT) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_ZOOM_100) self.view.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=wx.ID_ZOOM_FIT) self.view.page_list.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectItem) self.view.Bind(wx.EVT_CLOSE, self.OnMenuExit) self.view.statusbar.btn_cancel.Bind(wx.EVT_BUTTON, self.OnThumbnailCancel) def OnFilesDroped(self, evt): dlg = wx.MessageDialog(self.view, u"You must drop only one file.", u"Notice", style=wx.OK, pos=wx.DefaultPosition) dlg.ShowModal() dlg.Destroy() def OnFileDroped(self, message): self.__Load(message.data["filename"]) def OnFileHistory(self, evt): fileNum = evt.GetId() - wx.ID_FILE1 filename = self.view.filehistory.GetHistoryFile(fileNum) self.__Load(filename) def OnProgressBegin(self, message): if self.__progress: self.__progress.Destroy() pages = message.data["pages"] style = ( wx.PD_APP_MODAL|wx.PD_ELAPSED_TIME| wx.PD_REMAINING_TIME|wx.PD_CAN_ABORT| wx.PD_AUTO_HIDE ) self.__progress = ProgressDialog(u"Saving...", u"Start saving SWF pages", maximum=pages-1, parent=self.view, style=style) self.__progress.Show() self.view.SetStatusText(u"Saving document...") def OnProgressUpdate(self, message): pagenr = message.data["pagenr"] pagenr0 = pagenr - 1 pages = message.data["pages"] keep_running, skip = self.__progress.Update( pagenr0, u"Saving SWF page %d of %d" % (pagenr, pages) ) if not keep_running and self.__threads.has_key("progress"): self.view.SetStatusText(u"Cancelling...") self.__threads.pop("progress").Stop() if pagenr0 % 10 == 0: self.__progress.SendSizeEvent() def OnProgressDone(self, message): self.__progress.Hide() if self.__threads.has_key("progress"): self.__threads.pop("progress") self.view.SetStatusText(u"SWF document saved successfully.") else: self.view.SetStatusText(u"") def OnCombineError(self, message): from wx.lib.dialogs import ScrolledMessageDialog ScrolledMessageDialog(self.view, message.data, u"Notice").ShowModal() def OnThumbnailAdded(self, message): self.view.statusbar.SetGaugeValue(message.data['pagenr']) tot = self.view.page_list.GetItemCount() self.view.SetStatusText(u"Generating thumbnails %s/%d" % (message.data['pagenr'], tot), 0) def OnThumbnailDone(self, message): self.view.statusbar.SetGaugeValue(0) self.view.SetStatusText(u"", 0) if self.__threads.has_key("thumbnails"): self.__threads.pop("thumbnails") def OnThumbnailCancel(self, event): if self.__threads.has_key("thumbnails"): self.__threads["thumbnails"].Stop() def OnSelectItem(self, event): self.__doc.ChangePage(event.GetIndex() + 1) def OnPageChanged(self, message): if self.view.page_list.GetSelectedItemCount() > 1: return self.view.page_preview.DisplayPage(message.data) def OnFileLoaded(self, message): if self.__progress: self.__progress.Destroy() self.__progress = None self.view.SetStatusText(u"Document loaded successfully.") self.view.page_list.DisplayEmptyThumbnails(message.data["pages"]) thumbs = self.__doc.GetThumbnails() t = self.view.page_list.DisplayThumbnails(thumbs) self.__threads["thumbnails"] = t self.view.statusbar.SetGaugeRange(message.data["pages"]) del self.__busy def OnDiffSizes(self, message): self.Message( u"In this PDF, width or height are not the same for " u"each page. This might cause problems if you export " u"pages of different dimensions into the same SWF file." ) def OnMenuOpen(self, event): dlg = wx.FileDialog(self.view, u"Choose PDF File:", style = wx.FD_CHANGE_DIR|wx.FD_OPEN, wildcard = u"PDF files (*.pdf)|*.pdf|all files (*.*)|*.*") if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() self.__Load(filename) def OnMenuSave(self, event, pages=None): defaultFile = self.__doc.lastsavefile allFiles = "*.*" if "wxMSW" in wx.PlatformInfo else "*" self.view.SetStatusText(u"") dlg = wx.FileDialog(self.view, u"Choose Save Filename:", style = wx.SAVE | wx.OVERWRITE_PROMPT, defaultFile=defaultFile, wildcard=u"SWF files (*.swf)|*.swf" "|all files (%s)|%s" % (allFiles, allFiles)) if dlg.ShowModal() == wx.ID_OK: self.__threads["progress"] = self.__doc.SaveSWF(dlg.GetPath(), pages, self.options) def OnUpdateUI(self, event): menubar = self.view.GetMenuBar() menubar.Enable(event.GetId(), self.__can_save) self.view.GetToolBar().EnableTool(event.GetId(), self.__can_save) def OnMenuSaveSelected(self, event): pages = [] page = self.view.page_list.GetFirstSelected() pages.append(page+1) while True: page = self.view.page_list.GetNextSelected(page) if page == -1: break pages.append(page+1) self.OnMenuSave(event, pages) def OnMenuExit(self, event): self.view.SetStatusText(u"Cleaning up...") self.__StopThreads() config = GetConfig() self.view.filehistory.Save(config) config.Flush() del self.view.filehistory dirpath = GetDataDir() data = self.options.quality_panel.pickle() try: f = file(os.path.join(dirpath, 'quality.pkl'), 'wb') pickle.dump(data, f) f.close() except IOError: pass try: f = file(os.path.join(dirpath, 'viewers.pkl'), 'wb') data = self.options.viewers_panel.pickle() pickle.dump(data, f) f.close() except Exception, e: pass self.view.Destroy() def OnMenuSelectAll(self, event): for i in range(0, self.view.page_list.GetItemCount()): self.view.page_list.Select(i, True) def OnMenuInvertSelection(self, event): for i in range(0, self.view.page_list.GetItemCount()): self.view.page_list.Select(i, not self.view.page_list.IsSelected(i)) def OnMenuSelectOdd(self, event): for i in range(0, self.view.page_list.GetItemCount()): self.view.page_list.Select(i, not bool(i%2)) def OnMenuSelectEven(self, event): for i in range(0, self.view.page_list.GetItemCount()): self.view.page_list.Select(i, bool(i%2)) def OnMenuOptions(self, event): self.options.ShowModal() def OnFit(self, event): self.__doc.Fit(self.view.page_preview.GetClientSize()) def OnZoom(self, event): zoom = { wx.ID_ZOOM_IN: .1, wx.ID_ZOOM_OUT: -.1, wx.ID_ZOOM_100: 1, } self.__doc.Zoom(zoom[event.GetId()]) def OnAbout(self, evt): AboutDialog(self.view) def __Load(self, filename): self.__can_save = True self.__StopThreads() self.view.SetStatusText(u"Loading document...") self.__busy = wx.BusyInfo(u"One moment please, " u"opening pdf document...") self.view.filehistory.AddFileToHistory(filename) wx.FutureCall(150, self.__doc.Load, filename) def __StopThreads(self): for n, t in self.__threads.items(): t.Stop() running = True while running: running = False for n, t in self.__threads.items(): running = running + t.IsRunning() time.sleep(0.1) def __ReadConfigurationFile(self): config = GetConfig() self.view.filehistory.Load(config) dirpath = GetDataDir() try: f = file(os.path.join(dirpath, 'quality.pkl'), 'rb') try: data = pickle.load(f) self.options.quality_panel.unpickle(data) except: self.Message( u"Error loading quality settings. " u"They will be reset to defaults. ") f.close() except IOError: pass try: f = file(os.path.join(dirpath, 'viewers.pkl'), 'rb') try: data = pickle.load(f) self.options.viewers_panel.unpickle(data) except: self.Message( u"Error loading viewers settings. " u"They will be reset to defaults. ") f.close() except IOError: pass def Message(self, message): dlg = wx.MessageDialog(self.view, message, style=wx.OK, pos=wx.DefaultPosition) dlg.ShowModal() dlg.Destroy() | def __init__(self): self.__doc = Document() | fcd6c28d68c03c59b4bb6281c6aa4848b3cddf56 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5722/fcd6c28d68c03c59b4bb6281c6aa4848b3cddf56/app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
365,
16186,
2434,
273,
4319,
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,
... | [
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,
12,
2890,
4672,
365,
16186,
2434,
273,
4319,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... | |
def info(self): """Return information about the database as a dictionary. | def info(self, ddoc=None): """Return information about the database or design document as a dictionary. Without an argument, returns database information. With an argument, return information for the given design document. | def info(self): """Return information about the database as a dictionary. | 5b167b7bdec7c8c4b35a7fb15abc9e7bf2f16d3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9373/5b167b7bdec7c8c4b35a7fb15abc9e7bf2f16d3e/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
4672,
3536,
990,
1779,
2973,
326,
2063,
487,
279,
3880,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1123,
12,
2890,
4672,
3536,
990,
1779,
2973,
326,
2063,
487,
279,
3880,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
linecache.getline(filename, lineno)), end=' ') | linecache.getline(filename, lineno)), end='') | def localtrace_trace(self, frame, why, arg): if why == "line": # record the file name and line number of every trace filename = frame.f_code.co_filename lineno = frame.f_lineno | dc50c696ab7e091cef5d88d98be44cef15efcc1f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/dc50c696ab7e091cef5d88d98be44cef15efcc1f/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
315,
1369,
6877,
468,
1409,
326,
585,
508,
471,
980,
1300,
434,
3614,
2606,
1544,
273,
2623,
18,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
315,
1369,
6877,
468,
1409,
326,
585,
508,
471,
980,
1300,
434,
3614,
2606,
1544,
273,
2623,
18,
7... |
with TemporaryDirectory('_chm2oeb', keep=True) as tdir: | with TemporaryDirectory('_snb2oeb', keep=True) as tdir: | def convert(self, stream, options, file_ext, log, accelerators): log.debug("Parsing SNB file...") snbFile = SNBFile() try: snbFile.Parse(stream) except: raise ValueError("Invalid SNB file") if not snbFile.IsValid(): log.debug("Invaild SNB file") raise ValueError("Invalid SNB file") log.debug("Handle meta data ...") from calibre.ebooks.conversion.plumber import create_oebbook oeb = create_oebbook(log, None, options, self, encoding=options.input_encoding, populate=False) meta = snbFile.GetFileStream('snbf/book.snbf') if meta != None: meta = etree.fromstring(meta) oeb.metadata.add('title', meta.find('.//head/name').text) oeb.metadata.add('creator', meta.find('.//head/author').text, attrib={'role':'aut'}) oeb.metadata.add('language', meta.find('.//head/language').text.lower().replace('_', '-')) oeb.metadata.add('creator', meta.find('.//head/generator').text) oeb.metadata.add('publisher', meta.find('.//head/publisher').text) cover = meta.find('.//head/cover') if cover != None and cover.text != None: oeb.guide.add('cover', 'Cover', cover.text) | 57cd538894e99e8893e18294e4d750d2268e898b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/57cd538894e99e8893e18294e4d750d2268e898b/input.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
12,
2890,
16,
1407,
16,
702,
16,
585,
67,
408,
16,
613,
16,
15153,
264,
3062,
4672,
613,
18,
4148,
2932,
13963,
14204,
38,
585,
7070,
13,
4556,
70,
812,
273,
14204,
38,
812,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
1407,
16,
702,
16,
585,
67,
408,
16,
613,
16,
15153,
264,
3062,
4672,
613,
18,
4148,
2932,
13963,
14204,
38,
585,
7070,
13,
4556,
70,
812,
273,
14204,
38,
812,
14... |
raise ElementError, "connection attribute not set" | raise ligolw.ElementError, "connection attribute not set" | def __init__(self, *attrs): """ Initialize """ table.Table.__init__(self, *attrs) self.dbtablename = table.StripTableName(self.getAttribute(u"Name")) try: # copy metadata from lsctables cls = lsctables.TableByName[self.dbtablename] self.tableName = cls.tableName self.validcolumns = cls.validcolumns self.constraints = cls.constraints self.ids = cls.ids self.RowType = cls.RowType except: # unknown table pass if self.connection is None: raise ElementError, "connection attribute not set" self.cursor = self.connection.cursor() | 880f2a9921d0ec12f209a5499115043a98b51f30 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3589/880f2a9921d0ec12f209a5499115043a98b51f30/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
7039,
4672,
3536,
9190,
3536,
1014,
18,
1388,
16186,
2738,
972,
12,
2890,
16,
380,
7039,
13,
365,
18,
1966,
7032,
14724,
273,
1014,
18,
16632,
7147,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
7039,
4672,
3536,
9190,
3536,
1014,
18,
1388,
16186,
2738,
972,
12,
2890,
16,
380,
7039,
13,
365,
18,
1966,
7032,
14724,
273,
1014,
18,
16632,
7147,
... |
systems[parentId] = {'systems':[], 'ovf:order':'0', 'ovf:startDelay':'0'} | systems[parentId] = {'systems':[]} | def getOvfStartup(ovf): """ Returns a schedule representing the startup order for a virtual appliance from an ovf. @param ovf: Ovf file @type ovf: DOM Document @rtype: dictionary @return: startup dictionary of domains """ startupDict = dict(boot='', entities=dict()) systems = startupDict['entities'] # Create a list of all startup sections startupSections = Ovf.getNodes(ovf, (Ovf.hasTagName, 'StartupSection')) # Create an entry in startup dictionary for each entry in Startup sections for section in startupSections: for item in section.getElementsByTagName('Item'): attributes = [] for i in range(item.attributes.length): attr = item.attributes.item(i) if attr.name == 'ovf:id': sysId = attr.value elif(attr.name == 'ovf:order' or attr.name == 'ovf:startDelay'): attributes.append((attr.name, attr.value)) # Store attribute pairs in dicitonary virtualSys = dict(attributes) if not virtualSys.has_key('ovf:order'): virtualSys['ovf:order'] = '0' if not virtualSys.has_key('ovf:startDelay'): virtualSys['ovf:startDelay'] = '0' parentId = section.parentNode.getAttribute('ovf:id') systems[parentId] = dict(systems=[]) systems[parentId]['systems'].append(sysId) systems[sysId] = virtualSys # Create a default entry for each system not in a startup section for each in Ovf.getNodes(ovf, (Ovf.hasTagName, 'VirtualSystem')): sysId = each.getAttribute('ovf:id') # If parentNode is Envelope, set as root system # else, trace back and fill in missing parent info if each.parentNode.tagName == 'Envelope': startupDict['boot'] = sysId systems[sysId] = {'ovf:order':'0', 'ovf:startDelay':'0'} else: parent = each.parentNode parentId = parent.getAttribute('ovf:id') if systems.has_key(parentId): systems[parentId]['systems'].append(sysId) systems[sysId] = {'ovf:order':'0', 'ovf:startDelay':'0'} while(not systems.has_key(parentId)): systems[parentId] = {'systems':[], 'ovf:order':'0', 'ovf:startDelay':'0'} systems[parentId]['systems'].append(sysId) systems[sysId] = {'ovf:order':'0', 'ovf:startDelay':'0'} # Increment, if not at root if parent.parentNode.tagName == 'Envelope': startupDict['boot'] = parentId else: parent = parent.parentNode sysId = parentId parentId = parent.getAttribute('ovf:id') return startupDict | 4421898065f2fcf9432304ad23ac78980de13c30 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9789/4421898065f2fcf9432304ad23ac78980de13c30/OvfLibvirt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17971,
90,
74,
22178,
12,
1527,
74,
4672,
3536,
2860,
279,
4788,
5123,
326,
11850,
1353,
364,
279,
5024,
513,
10671,
628,
392,
23094,
74,
18,
225,
632,
891,
23094,
74,
30,
531,
90,
74,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17971,
90,
74,
22178,
12,
1527,
74,
4672,
3536,
2860,
279,
4788,
5123,
326,
11850,
1353,
364,
279,
5024,
513,
10671,
628,
392,
23094,
74,
18,
225,
632,
891,
23094,
74,
30,
531,
90,
74,... |
self._readable = "r" in mode self._writable = "w" in mode self._seekable = False | def __init__(self, sock, mode): assert mode in ("r", "w", "rw") self._sock = sock self._mode = mode self._readable = "r" in mode self._writable = "w" in mode self._seekable = False | ef17c16b366b09a78dfe5fc5171fe2b0b29f60e5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ef17c16b366b09a78dfe5fc5171fe2b0b29f60e5/io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
16,
1965,
4672,
1815,
1965,
316,
7566,
86,
3113,
315,
91,
3113,
315,
21878,
7923,
365,
6315,
15031,
273,
7313,
365,
6315,
3188,
273,
1965,
365,
6315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7313,
16,
1965,
4672,
1815,
1965,
316,
7566,
86,
3113,
315,
91,
3113,
315,
21878,
7923,
365,
6315,
15031,
273,
7313,
365,
6315,
3188,
273,
1965,
365,
6315,... | |
self._render(gc, array([x+width/2]), min, bar_min, center, bar_max, max) | self._render(gc, array([x-width/4]), array([x+width/4]), min, bar_min, center, bar_max, max) | def _render_icon(self, gc, x, y, width, height): min = array([y + 1]) max = array([y + height - 1]) bar_min = array([y + height / 3]) bar_max = array([y + height - (height / 3)]) center = array([y + (height / 2)]) self._render(gc, array([x+width/2]), min, bar_min, center, bar_max, max) | cf4a756665182c1966da52cabf5a38a190cded14 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13167/cf4a756665182c1966da52cabf5a38a190cded14/base_candle_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
3950,
12,
2890,
16,
8859,
16,
619,
16,
677,
16,
1835,
16,
2072,
4672,
1131,
273,
526,
3816,
93,
397,
404,
5717,
943,
273,
526,
3816,
93,
397,
2072,
300,
404,
5717,
465... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
3950,
12,
2890,
16,
8859,
16,
619,
16,
677,
16,
1835,
16,
2072,
4672,
1131,
273,
526,
3816,
93,
397,
404,
5717,
943,
273,
526,
3816,
93,
397,
2072,
300,
404,
5717,
465... |
sql_layer = gdaltest.ds.ExecuteSQL( | sql_lyr = gdaltest.ds.ExecuteSQL( | def ogr_join_1(): gdaltest.ds = ogr.Open( 'data' ) sql_layer = gdaltest.ds.ExecuteSQL( 'SELECT * FROM poly LEFT JOIN idlink ON poly.eas_id = idlink.eas_id' ) count = sql_layer.GetFeatureCount() if count != 10: gdaltest.post_reason( 'Got wrong count with GetFeatureCount() - %d, expecting 10' % count ) return 'fail' return 'success' | 7bbd73cda38e785fdd60801d1f9ef3632893cd8d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10289/7bbd73cda38e785fdd60801d1f9ef3632893cd8d/ogr_join_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
5701,
67,
21,
13332,
15551,
2390,
395,
18,
2377,
273,
320,
3197,
18,
3678,
12,
296,
892,
11,
262,
225,
1847,
67,
715,
86,
273,
15551,
2390,
395,
18,
2377,
18,
5289,
39... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
320,
3197,
67,
5701,
67,
21,
13332,
15551,
2390,
395,
18,
2377,
273,
320,
3197,
18,
3678,
12,
296,
892,
11,
262,
225,
1847,
67,
715,
86,
273,
15551,
2390,
395,
18,
2377,
18,
5289,
39... |
@echo | def label_adjunction(node): node[1].category = ptb_to_cat(node[1], return_none_when_unmatched=True) or node.category node.kids[1] = label(node[1]) node[0].category = featureless(node.category) / featureless(node[1].category) node.kids[0] = label(node[0]) return node | ba3220a2c6b52f045b539ed94d094a73aa2cc2b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8383/ba3220a2c6b52f045b539ed94d094a73aa2cc2b9/catlab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1433,
67,
13829,
418,
12,
2159,
4672,
756,
63,
21,
8009,
4743,
273,
5818,
70,
67,
869,
67,
2574,
12,
2159,
63,
21,
6487,
327,
67,
6102,
67,
13723,
67,
318,
11073,
33,
5510,
13,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1433,
67,
13829,
418,
12,
2159,
4672,
756,
63,
21,
8009,
4743,
273,
5818,
70,
67,
869,
67,
2574,
12,
2159,
63,
21,
6487,
327,
67,
6102,
67,
13723,
67,
318,
11073,
33,
5510,
13,
578,
... | |
idc = id(c) | idc = compute_unique_id(c) | def run_once(): a = A() ida = id(a) b = B() idb = id(b) c = C() idc = id(c) llop.gc__collect(lltype.Void) llop.gc__collect(lltype.Void) llop.gc__collect(lltype.Void) return ida, idb, idc | 8624ed2e4cb7a9fc5cd3578b6a083738d4e4e7e9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/8624ed2e4cb7a9fc5cd3578b6a083738d4e4e7e9/test_boehm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
13332,
279,
273,
432,
1435,
612,
69,
273,
612,
12,
69,
13,
324,
273,
605,
1435,
612,
70,
273,
612,
12,
70,
13,
276,
273,
385,
1435,
612,
71,
273,
3671,
67,
6270,
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,
1086,
67,
8243,
13332,
279,
273,
432,
1435,
612,
69,
273,
612,
12,
69,
13,
324,
273,
605,
1435,
612,
70,
273,
612,
12,
70,
13,
276,
273,
385,
1435,
612,
71,
273,
3671,
67,
6270,
67... |
self.log.verbose( 'Processing TaskQueueID:', taskQueueID ) | self.log.verbose( 'Processing TaskQueue', taskQueueID ) | def execute(self): """Main Agent code: 1.- Query TaskQueueDB for existing TQs 2.- Add their Priorities 3.- Submit pilots """ | 4fc45f848c73ccd70e55d2692551954ac266f79d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/4fc45f848c73ccd70e55d2692551954ac266f79d/TaskQueueDirector.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
6376,
8669,
981,
30,
404,
18,
17,
2770,
3837,
3183,
2290,
364,
2062,
399,
53,
87,
576,
18,
17,
1436,
3675,
30326,
1961,
890,
18,
17,
17320,
24970,
6968,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
12,
2890,
4672,
3536,
6376,
8669,
981,
30,
404,
18,
17,
2770,
3837,
3183,
2290,
364,
2062,
399,
53,
87,
576,
18,
17,
1436,
3675,
30326,
1961,
890,
18,
17,
17320,
24970,
6968,
353... |
container_type.size = values.get('fized-size') | if (isinstance(node, Parameter) and node.type.name == 'utf8' and self._guess_direction(node) == PARAM_DIRECTION_IN): container_type.element_type = 'int8' container_type.size = array_values.get('fized-size') | def _parse_array(self, parent, node, options): array_opt = options.get('array') if array_opt: values = array_opt.all() else: values = {} container_type = Array(node.type.ctype, node.type.name) if 'zero-terminated' in values: container_type.zeroterminated = values.get( 'zero-terminated') == '1' length = values.get('length') if length is not None: param_index = parent.get_parameter_index(length) container_type.length_param_index = param_index container_type.size = values.get('fized-size') return container_type | 3e466d06a81200d7ff3a7958b8a5fea52caf5b12 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2770/3e466d06a81200d7ff3a7958b8a5fea52caf5b12/annotationparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
1126,
12,
2890,
16,
982,
16,
756,
16,
702,
4672,
526,
67,
3838,
273,
702,
18,
588,
2668,
1126,
6134,
309,
526,
67,
3838,
30,
924,
273,
526,
67,
3838,
18,
454,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
67,
1126,
12,
2890,
16,
982,
16,
756,
16,
702,
4672,
526,
67,
3838,
273,
702,
18,
588,
2668,
1126,
6134,
309,
526,
67,
3838,
30,
924,
273,
526,
67,
3838,
18,
454,
1435,
... |
self.assert_(mailbox.MHMessage(msg_mboxMMDF).get_sequences() \ == result) | self.assertEqual(mailbox.MHMessage(msg_mboxMMDF).get_sequences(), result) | def test_mboxmmdf_to_mh(self): # Convert mboxMessage and MMDFMessage to MHMessage for class_ in (mailbox.mboxMessage, mailbox.MMDFMessage): msg_mboxMMDF = class_(_sample_message) pairs = (('R', []), ('O', ['unseen']), ('D', ['unseen']), ('F', ['unseen', 'flagged']), ('A', ['unseen', 'replied']), ('RODFA', ['replied', 'flagged'])) for setting, result in pairs: msg_mboxMMDF.set_flags(setting) self.assert_(mailbox.MHMessage(msg_mboxMMDF).get_sequences() \ == result) | 7731c36bc6f787ca91b8429603fe004822f1f2d8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/7731c36bc6f787ca91b8429603fe004822f1f2d8/test_mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
81,
2147,
81,
1264,
74,
67,
869,
67,
81,
76,
12,
2890,
4672,
468,
4037,
312,
2147,
1079,
471,
18295,
4577,
1079,
358,
490,
44,
1079,
364,
667,
67,
316,
261,
4408,
2147,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
81,
2147,
81,
1264,
74,
67,
869,
67,
81,
76,
12,
2890,
4672,
468,
4037,
312,
2147,
1079,
471,
18295,
4577,
1079,
358,
490,
44,
1079,
364,
667,
67,
316,
261,
4408,
2147,
18,... |
_unreachable_names[name] = 2 | _unreachable_names[name] = 1 | def _unreachable_name_for(val_doc, docindex): assert isinstance(val_doc, ValueDoc) # [xx] (when) does this help? if (isinstance(val_doc, ModuleDoc) and len(val_doc.canonical_name)==1 and val_doc.package is None): for root_val in docindex.root: if root_val.canonical_name == val_doc.canonical_name: if root_val != val_doc: log.error("Name conflict: %r vs %r" % (val_doc, root_val)) break else: return val_doc.canonical_name, -1000 # Assign it an 'unreachable' name: if (val_doc.pyval is not UNKNOWN and hasattr(val_doc.pyval, '__name__')): try: name = DottedName(DottedName.UNREACHABLE, val_doc.pyval.__name__) except DottedName.InvalidDottedName: name = DottedName(DottedName.UNREACHABLE) else: name = DottedName(DottedName.UNREACHABLE) # Uniquify the name. if name in _unreachable_names: name = DottedName('%s-%s' % (name, _unreachable_names[name])) _unreachable_names[name] += 1 else: _unreachable_names[name] = 2 return name, -10000 | 0e091a39f32567a1c2b81c3ddf7af2d554a40739 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/0e091a39f32567a1c2b81c3ddf7af2d554a40739/docbuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
318,
17246,
67,
529,
67,
1884,
12,
1125,
67,
2434,
16,
997,
1615,
4672,
1815,
1549,
12,
1125,
67,
2434,
16,
1445,
1759,
13,
225,
468,
306,
5279,
65,
261,
13723,
13,
1552,
333,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
318,
17246,
67,
529,
67,
1884,
12,
1125,
67,
2434,
16,
997,
1615,
4672,
1815,
1549,
12,
1125,
67,
2434,
16,
1445,
1759,
13,
225,
468,
306,
5279,
65,
261,
13723,
13,
1552,
333,
2... |
subjectMatch = re.search('\s*\[Bug (\d+)\]\s+(New:)?', | subjectMatch = re.search('\s*\[\w+ (?P<bug_id>\d+)\]\s+(?P<new>New:)?', | def __init__(self, message): # Make sure this is actually a bug mail if not message['X-Bugzilla-Product']: raise NotBugmailException, 'Email lacks X-Bugzilla-Product header' # Initialize fields used lower that aren't always set self.dupe_of = None self.attach_id = None | b5104f10e1adbd9066199d0f1152edc65ef0543a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3483/b5104f10e1adbd9066199d0f1152edc65ef0543a/bugmail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
883,
4672,
468,
4344,
3071,
333,
353,
6013,
279,
7934,
4791,
309,
486,
883,
3292,
60,
17,
19865,
15990,
17,
4133,
3546,
30,
1002,
2288,
19865,
4408,
503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
883,
4672,
468,
4344,
3071,
333,
353,
6013,
279,
7934,
4791,
309,
486,
883,
3292,
60,
17,
19865,
15990,
17,
4133,
3546,
30,
1002,
2288,
19865,
4408,
503,
... |
lines.append("%s = %s" % (option, param.valueToText(val))) | if param is None: lines.append("%s = %s" % (option, val)) else: lines.append("%s = %s" % (option, param.valueToText(val))) | def configToText(): if GlobalPrefs.debuglevel > 0: dprint("Saving user configuration: %s" % GlobalPrefs.user) lines = ["# Automatically generated file! Do not edit -- use one of the following", "# files instead:", "#", "# peppy.cfg For general configuration on all platforms", "# [platform].cfg For configuration on a specific platform, where [platform]", "# is one of the platforms returned by the command", "# python -c 'import platform; print platform.system()'", "# [machine].cfg For configuration on a specific machine, where [machine]", "# is the hostname as returned by the command", "# python -c 'import platform; print platform.node()'", "", ] sections = GlobalPrefs.user.keys() sections.sort() for section in sections: options = GlobalPrefs.user[section] printed_section = False # flag to indicate if need to print header if options: keys = options.keys() keys.sort() for option in keys: val = options[option] param = GlobalPrefs.findParam(section, option) if param is None: dprint("Found a None param: %s[%s] = %s" % (section, option, val)) continue if not printed_section: lines.append("[%s]" % section) printed_section = True lines.append("%s = %s" % (option, param.valueToText(val))) lines.append("") text = os.linesep.join(lines) if GlobalPrefs.debuglevel > 0: dprint(text) return text | 9db011ea9e65c409bb3ab100c0af1033e3012eb0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/9db011ea9e65c409bb3ab100c0af1033e3012eb0/userparams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
774,
1528,
13332,
309,
8510,
1386,
2556,
18,
4148,
2815,
405,
374,
30,
302,
1188,
2932,
24660,
729,
1664,
30,
738,
87,
6,
738,
8510,
1386,
2556,
18,
1355,
13,
2362,
273,
8247,
7,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
774,
1528,
13332,
309,
8510,
1386,
2556,
18,
4148,
2815,
405,
374,
30,
302,
1188,
2932,
24660,
729,
1664,
30,
738,
87,
6,
738,
8510,
1386,
2556,
18,
1355,
13,
2362,
273,
8247,
7,
... |
if save and len(text) > 0: | if len(text) > 0: | def switch_mode(self, edit=False, save=False): self.edit = edit self.addButton.set_sensitive(edit) self.saveButton.set_property("visible", edit) self.editButton.set_property("visible", not edit) self.imagechangeButton.set_property("visible", edit) self.imageremoveButton.set_property("visible", edit and self.hasphoto) self.changeButton.set_property("visible", edit) | 337e2628519817abde9df50dbed69c769add8439 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2651/337e2628519817abde9df50dbed69c769add8439/arkadas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1620,
67,
3188,
12,
2890,
16,
3874,
33,
8381,
16,
1923,
33,
8381,
4672,
365,
18,
4619,
273,
3874,
365,
18,
1289,
3616,
18,
542,
67,
23481,
12,
4619,
13,
365,
18,
5688,
3616,
18,
542,... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.UtcTimeStampField.__init__(self, 367) else quickfix.UtcTimeStampField.__init__(self, 367, 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,
57,
5111,
21536,
974,
16186,
2738,
972,
12,
2890,
16,
6580,
27,
13,
469,
9549,
904,
18,
57,
5111,
215... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
57,
5111,
21536,
974,
16186,
2738,
972,
12,
2890,
16,
6580,
27,
13,
469,
9549,
904,
18,
57,
5111,
215... |
prog = 0 totLOC = 0 classCnt = 0 for module in modules: self.editor.statusBar.progress.SetValue(prog) prog = prog + 1 self.editor.statusBar.setHint('Parsing '+module+'...') if module[:7] != 'file://': print '%s skipped, only local files supported for Imports View' else: module = module[7:] try: f = open(module) except IOError: print "couldn't load %s" % module continue else: data = f.read() f.close() name = os.path.splitext(os.path.basename(module))[0] model = ModuleModel(data, name, self.editor, 1) relationships[name] = model.getModule() totLOC = totLOC + model.getModule().loc classCnt = classCnt + len(model.getModule().classes) print 'Project LOC: %d,\n%d classes in %d modules.'%(totLOC, classCnt, len(modules)) self.editor.statusBar.progress.SetValue(0) self.editor.statusBar.setHint('') | try: prog = 0 totLOC = 0 classCnt = 0 for module in modules: self.editor.statusBar.progress.SetValue(prog) prog = prog + 1 self.editor.setStatus('Parsing '+module+'...') if module[:7] != 'file://': print '%s skipped, only local files supported for Imports View' else: module = module[7:] try: f = open(module) except IOError: print "couldn't load %s" % module continue else: data = f.read() f.close() name = os.path.splitext(os.path.basename(module))[0] model = ModuleModel(data, name, self.editor, 1) relationships[name] = model.getModule() totLOC = totLOC + model.getModule().loc classCnt = classCnt + len(model.getModule().classes) print 'Project LOC: %d,\n%d classes in %d modules.'%(totLOC, classCnt, len(modules)) finally: self.editor.statusBar.progress.SetValue(0) self.editor.statusBar.setHint('') | def buildImportRelationshipDict(self, modules): relationships = {} | 613f5e6731aa745aa436bc6c5ca54006fbca433c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/613f5e6731aa745aa436bc6c5ca54006fbca433c/PythonEditorModels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
5010,
8180,
5014,
12,
2890,
16,
4381,
4672,
11499,
273,
2618,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1361,
5010,
8180,
5014,
12,
2890,
16,
4381,
4672,
11499,
273,
2618,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
- Coefficients `q_0, q_1, ...` of `q(T)` as in Duursama [D]_ | - Coefficients `q_0, q_1, ...` of `q(T)` as in Duursma [D]_ | def sd_duursma_q(C,i,d0): r""" INPUT: | 4dc974cc0477a4b87cefa14e19bab1ed6473070d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/4dc974cc0477a4b87cefa14e19bab1ed6473070d/linear_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8349,
67,
2544,
25152,
2540,
67,
85,
12,
39,
16,
77,
16,
72,
20,
4672,
436,
8395,
12943,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8349,
67,
2544,
25152,
2540,
67,
85,
12,
39,
16,
77,
16,
72,
20,
4672,
436,
8395,
12943,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
gLogger.error(errStr,srcDirectory) | gLogger.error( errStr, srcDirectory ) | def __getDir(self,srcDirectory,destDirectory): """ Black magic contained within... """ filesGot = 0 sizeGot = 0 | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1621,
12,
2890,
16,
4816,
2853,
16,
10488,
2853,
4672,
3536,
22467,
8146,
7542,
3470,
2777,
3536,
1390,
15617,
273,
374,
963,
15617,
273,
374,
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,
0,
0,
0,
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,
588,
1621,
12,
2890,
16,
4816,
2853,
16,
10488,
2853,
4672,
3536,
22467,
8146,
7542,
3470,
2777,
3536,
1390,
15617,
273,
374,
963,
15617,
273,
374,
2,
-100,
-100,
-100,
-100,
-100,
... |
field['label'] = _('Owner') | field['label'] = _("Owner") | def _prepare_fields(self, req, ticket): context = Context.from_request(req, ticket.resource) fields = [] owner_field = None for field in ticket.fields: name = field['name'] type_ = field['type'] | 8a7505f666e8590328936fd32f0bc362d6e2a6a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/8a7505f666e8590328936fd32f0bc362d6e2a6a0/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
2821,
12,
2890,
16,
1111,
16,
9322,
4672,
819,
273,
1772,
18,
2080,
67,
2293,
12,
3658,
16,
9322,
18,
3146,
13,
1466,
273,
5378,
3410,
67,
1518,
273,
599,
364,
652,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9366,
67,
2821,
12,
2890,
16,
1111,
16,
9322,
4672,
819,
273,
1772,
18,
2080,
67,
2293,
12,
3658,
16,
9322,
18,
3146,
13,
1466,
273,
5378,
3410,
67,
1518,
273,
599,
364,
652,
31... |
str += ' </DD>\n</DT></DL><hr>\n\n' | str += ' </dd>\n</dl>\n\n' str += '</td></tr></table>\n' str += '<br>\n' | def _func_details(self, functions, cls, heading='Function Details'): """## Return a detailed description of the functions in a class or module.""" functions = self._sort(functions) if len(functions) == 0: return '' str = self._table_header(heading, 'details')+'</TABLE>' | 1b52b16120989cc834166571a9a1e9b8676d968f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/1b52b16120989cc834166571a9a1e9b8676d968f/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
1189,
2000,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
644,
67,
6395,
12,
2890,
16,
4186,
16,
2028,
16,
11053,
2218,
2083,
21897,
11,
4672,
3536,
1189,
2000,
279,
6864,
2477,
434,
326,
4186,
316,
279,
667,
578,
1605,
12123,
4186,
273,
... |
if partner.refuse_membership: | if partner_data.refuse_membership: | def _membership_state(self, cr, uid, ids, name, args, context=None): #the call to super is deactivated because of unresolved conflicts with the 5.0 version #of the membership module in state priorities. It is replaced by the ugly copy/paste below #res = super(res_partner, self)._membership_state(cr, uid, ids, name, args, context) res = {} for id in ids: res[id] = 'none' today = time.strftime('%Y-%m-%d') for id in ids: partner_data = self.browse(cr,uid,id) if partner_data.membership_cancel and today > partner_data.membership_cancel: res[id] = 'canceled' continue if partner.refuse_membership: res[id] = 'canceled' continue if partner_data.free_member: res[id] = 'free' continue | 338251af20ddd97a2597d067ec163e4e5d64dc6d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/338251af20ddd97a2597d067ec163e4e5d64dc6d/cci_membership.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19679,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
468,
5787,
745,
358,
2240,
353,
443,
18836,
2724,
434,
20573,
14450,
598,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
19679,
67,
2019,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
833,
16,
819,
33,
7036,
4672,
468,
5787,
745,
358,
2240,
353,
443,
18836,
2724,
434,
20573,
14450,
598,
326,
... |
if on == 1 and sn != 2: return self._fix_nan(context) if sn == 1 and on != 2: return other._fix_nan(context) | if on == 1 and sn == 0: return self._fix(context) if sn == 1 and on == 0: return other._fix(context) | def min_mag(self, other, context=None): """Compares the values numerically with their sign ignored.""" other = _convert_other(other, raiseit=True) | e29d435e0cefb3e1772f6de0844e628aac3cf98e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/e29d435e0cefb3e1772f6de0844e628aac3cf98e/decimal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1131,
67,
4527,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
19199,
326,
924,
6389,
1230,
598,
3675,
1573,
5455,
12123,
1308,
273,
389,
6283,
67,
3011,
12,
3011,
16,
1002,
305,
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,
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,
1131,
67,
4527,
12,
2890,
16,
1308,
16,
819,
33,
7036,
4672,
3536,
19199,
326,
924,
6389,
1230,
598,
3675,
1573,
5455,
12123,
1308,
273,
389,
6283,
67,
3011,
12,
3011,
16,
1002,
305,
3... |
virial = zeros((3,3),float) | virial = numpy.zeros((3,3),float) | def read_castep_output(castep_file, cluster=None, abort=True): """Parse .castep file, and return Atoms object with positions, energy, forces, and possibly stress and atomic populations as well""" opened = False if type(castep_file) == type(''): opened = True castep_file = open(castep_file,'r') castep_output = [] got_header = False while True: line = castep_file.readline() if line == '': break castep_output.append(line) if line == ' | CCC AA SSS TTTTT EEEEE PPPP |\n': if got_header: break else: got_header = True if opened: castep_file.close() # NB: CASTEP doesn't always print 'Total time' run_time = -1.0 if abort: total_time = filter(lambda s: s.startswith('Total time'), castep_output) if total_time == []: has_converged = filter(lambda s: s.startswith('Total energy has converged'), castep_output) if has_converged == []: raise ValueError("castep didn't complete") else: run_time = float(total_time[0].split()[3]) # Now we should have contents of a valid .castep file in castep_output # First let's read the user parameters for this run from top of file param = CastepParam() param.read_from_castep_output(castep_output) # Next let's extract the lattice and atomic positions try: lattice_line = castep_output.index(' Unit Cell\n') except: raise ValueError('No unit cell found in castep file') lattice_lines = castep_output[lattice_line+3:lattice_line+6] R1 = map(float, lattice_lines[0].split()[0:3]) R2 = map(float, lattice_lines[1].split()[0:3]) R3 = map(float, lattice_lines[2].split()[0:3]) lattice = numpy.array([R1,R2,R3]) try: cell_first_line = castep_output.index(' Cell Contents\n') except ValueError: raise ValueError('No cell contents found in castep file') n_atoms = int(castep_output[cell_first_line+2].split()[-1]) if cluster is not None: # If we were passed in an Atoms object, construct mapping from # CASTEP (element, number) to original atom index cluster = cluster.copy() species_count = {} lookup = {} for i in range(cluster.n): el = cluster.species[i] if species_count.has_key(el): species_count[el] += 1 else: species_count[el] = 1 lookup[(el,species_count[el])] = i else: # Otherwise we make a new, empty Atoms object. Atoms will # be ordered as they are in .castep file. lookup = {} cluster = atoms.Atoms(n=n_atoms,lattice=lattice) cluster.params['castep_run_time'] = run_time cell_lines = castep_output[cell_first_line+10:cell_first_line+10+n_atoms] # Fill in species and fractional positions cluster.add_property('frac_pos',0.0,ncols=3) for i, line in enumerate(cell_lines): x1, el, num, u, v, w, x2 = line.split() num = int(num) if not (el,num) in lookup: lookup[(el,num)] = i cluster.species[lookup[(el,num)]] = el cluster.frac_pos[lookup[(el,num)]] = numpy.array(map(float, (u,v,w))) # Calculate cartesian postions from fractional positions cluster.pos[:] = numpy.array([ numpy.dot(cluster.frac_pos[i,:],cluster.lattice)for i in range(cluster.n) ]) if param.has_key('finite_basis_corr') and param['finite_basis_corr'].lower() == 'true': energy_lines = filter(lambda s: s.startswith('Total energy corrected for finite basis set'), \ castep_output) elif param.has_key('task') and param['task'].lower() == 'geometryoptimization': energy_lines = filter(lambda s: s.startswith(' BFGS: Final Enthalpy'), castep_output) else: energy_lines = filter(lambda s: s.startswith('Final energy') and not s.endswith('<- EDFT\n'), castep_output) if (len(energy_lines) == 0): if abort: raise ValueError('No total energy found in castep file') else: # Energy is second to last field on line (last is "eV") # Use last matching energy line in file cluster.params['energy'] = float(energy_lines[-1].split()[-2]) try: for fn in ('Forces', 'Symmetrised Forces'): force_start_lines = [s for s in castep_output if s.find('****** %s ******' % fn) != -1] if force_start_lines != []: break if force_start_lines == []: raise ValueError # Use last set of forces in file force_start = castep_output.index(force_start_lines[-1]) # Extract force lines from .castep file force_lines = castep_output[force_start+6:force_start+6+cluster.n] cluster.add_property('force',0.0,ncols=3) # Fill in the forces for i, line in enumerate(force_lines): line = line.replace('*','') # Remove the *s el, num_str, fx, fy, fz = line.split() num = int(num_str) cluster.force[lookup[(el,num)],:] = numpy.array((fx,fy,fz)) except ValueError, m: if abort: raise ValueError('No forces found in castep file %s: ' % m) # Have we calculated stress? if 'calculate_stress' in param and param['calculate_stress'].lower() == 'true': try: stress_start = castep_output.index(' ***************** Stress Tensor *****************\n') stress_lines = castep_output[stress_start+6:stress_start+9] virial = zeros((3,3),float) for i in range(3): star1, label, vx, vy, vz, star2 = stress_lines[i].split() virial[i,:] = numpy.array((vx,vy,vz)) # Convert to libAtoms units and append to comment line cluster.params['virial'] = ' '.join(map(str, reshape(virial/GPA,9))) except ValueError: if abort: raise ValueError('No stress tensor found in .castep file') # Have we calculated local populations and charges? if 'popn_calculate' in param and param['popn_calculate'].lower() == 'true': try: popn_start = castep_output.index(' Atomic Populations\n') popn_lines = castep_output[popn_start+4:popn_start+4+cluster.n] cluster.add_property('popn_s',0.0) cluster.add_property('popn_p',0.0) cluster.add_property('popn_d',0.0) cluster.add_property('popn_f',0.0) cluster.add_property('popn_total',0.0) cluster.add_property('popn_charge',0.0) for line in popn_lines: el, num_str, s, p, d, f, tot, charge = line.split() num = int(num_str) cluster.popn_s[lookup[(el,num)]] = float(s) cluster.popn_p[lookup[(el,num)]] = float(p) cluster.popn_d[lookup[(el,num)]] = float(d) cluster.popn_f[lookup[(el,num)]] = float(f) cluster.popn_total[lookup[(el,num)]] = float(tot) cluster.popn_charge[lookup[(el,num)]] = float(charge) except ValueError: if abort: raise ValueError('No populations found in castep file') return cluster | d674d25632085e5626bfc14696dcf8d3f70aa473 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8914/d674d25632085e5626bfc14696dcf8d3f70aa473/castep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
4155,
881,
67,
2844,
12,
4155,
881,
67,
768,
16,
2855,
33,
7036,
16,
6263,
33,
5510,
4672,
3536,
3201,
263,
4155,
881,
585,
16,
471,
327,
7149,
87,
733,
598,
6865,
16,
12929... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
4155,
881,
67,
2844,
12,
4155,
881,
67,
768,
16,
2855,
33,
7036,
16,
6263,
33,
5510,
4672,
3536,
3201,
263,
4155,
881,
585,
16,
471,
327,
7149,
87,
733,
598,
6865,
16,
12929... |
return tmp[-1] | return (len(tmp) > 0) and tmp[-1] or None | def latest_version(self, pkgname): tmp = self.package_versions(pkgname) return tmp[-1] | f21bc7aa8a9a140099a8b8a91d730c91af22d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10378/f21bc7aa8a9a140099a8b8a91d730c91af22d4b3/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,
1853,
18919,
21,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
1853,
18919,
21,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self._closer = closer | def __init__(self, sock, mode, closer): if mode not in ("r", "w", "rw"): raise ValueError("invalid mode: %r" % mode) io.RawIOBase.__init__(self) self._sock = sock self._mode = mode self._closer = closer self._reading = "r" in mode self._writing = "w" in mode closer.makefile_open() | 5632861bff7fa6411b4628799710688d14756ec1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/5632861bff7fa6411b4628799710688d14756ec1/socket.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
16,
1965,
16,
13306,
4672,
309,
1965,
486,
316,
7566,
86,
3113,
315,
91,
3113,
315,
21878,
6,
4672,
1002,
2068,
2932,
5387,
1965,
30,
738,
86,
6,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
7313,
16,
1965,
16,
13306,
4672,
309,
1965,
486,
316,
7566,
86,
3113,
315,
91,
3113,
315,
21878,
6,
4672,
1002,
2068,
2932,
5387,
1965,
30,
738,
86,
6,
... | |
self.host = self.relay.configure(self.relay.hostname) | self.host = self.relay.configure_relay(self.relay.hostname) | def __enter__(self): | 763a7216c5e2274251e083176000c4944c9507c2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11489/763a7216c5e2274251e083176000c4944c9507c2/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2328,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2328,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
"sharable": bool(vdi.attributes["sharable"].value), "read_only": bool(vdi.attributes["read_only"].value), | "sharable": vdi.attributes["sharable"].value == "True", "read_only": vdi.attributes["read_only"].value == "True", | def create_vdi(self, vdi): log(DEBUG, "create_vdi") | ab27a3a5eb568f77ad89c793f3f6d2b1c5b35ff4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6195/ab27a3a5eb568f77ad89c793f3f6d2b1c5b35ff4/xenapi_create.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
90,
3211,
12,
2890,
16,
331,
3211,
4672,
613,
12,
9394,
16,
315,
2640,
67,
90,
3211,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
90,
3211,
12,
2890,
16,
331,
3211,
4672,
613,
12,
9394,
16,
315,
2640,
67,
90,
3211,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
self.get_parent().props.visible = not self.get_parent().props.visible | if self.main_window.get_window().props.visible: self.main_window.hide() else: self.main_window.show() | def __show_main_window(self): if self.app.blocked == False: # show/hide main window self.get_parent().props.visible = not self.get_parent().props.visible else: # when blocked, don't show main window but a notification self.popup("OTR-Verwaltung arbeitet gerade...", self.app.get_notify_text(), 3) | 67ae3691eb4b368f280e474a6e85459e42379973 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11048/67ae3691eb4b368f280e474a6e85459e42379973/notify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4500,
67,
5254,
67,
5668,
12,
2890,
4672,
309,
365,
18,
2910,
18,
23156,
422,
1083,
30,
468,
2405,
19,
11248,
2774,
2742,
309,
365,
18,
5254,
67,
5668,
18,
588,
67,
5668,
7675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4500,
67,
5254,
67,
5668,
12,
2890,
4672,
309,
365,
18,
2910,
18,
23156,
422,
1083,
30,
468,
2405,
19,
11248,
2774,
2742,
309,
365,
18,
5254,
67,
5668,
18,
588,
67,
5668,
7675,
... |
shutil.copy(srcname, dstname) | shutil.copy2(srcname, dstname) try: shutil.copystat(srcname, dstname) except Exception, e: if verbose: print >>sys.stderr, "warning: ignoring failure to copy permission bits from '%s' to '%s': %s" % (filename, target, str(e)) | def cpy(srcname, dstname, verbose = False): if verbose: print >>sys.stderr, "copying '%s' to '%s' ..." % (srcname, dstname) shutil.copy(srcname, dstname) | af6ffa7d015ed03740fcb948b5782ab5f15b0638 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3589/af6ffa7d015ed03740fcb948b5782ab5f15b0638/dbtables.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24534,
12,
4816,
529,
16,
3046,
529,
16,
3988,
273,
1083,
4672,
309,
3988,
30,
1172,
1671,
9499,
18,
11241,
16,
315,
3530,
310,
1995,
87,
11,
358,
1995,
87,
11,
18483,
738,
261,
4816,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24534,
12,
4816,
529,
16,
3046,
529,
16,
3988,
273,
1083,
4672,
309,
3988,
30,
1172,
1671,
9499,
18,
11241,
16,
315,
3530,
310,
1995,
87,
11,
358,
1995,
87,
11,
18483,
738,
261,
4816,
... |
def add_date(self, date=""): if not date: | def add_recIDs_by_date(self, dates=""): """Add recIDs modified between DATES[0] and DATES[1]. If DATES is not set, then add records modified since the last run of the ranking method. """ if not dates: | def add_date(self, date=""): # If date is not set, then retrieve it from the database. # Reindex all formats newer than the modification date if not date: write_message("Using the last update time for the rank method") query = """SELECT last_updated FROM rnkMETHOD WHERE name='%s' """ % options["current_run"] res = run_sql(query) | be497a775e31aa1bbaa16c2d306e7aa635bdfe13 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/be497a775e31aa1bbaa16c2d306e7aa635bdfe13/bibrank_word_indexer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
712,
12,
2890,
16,
1509,
1546,
6,
4672,
468,
971,
1509,
353,
486,
444,
16,
1508,
4614,
518,
628,
326,
2063,
18,
468,
868,
1615,
777,
6449,
16069,
2353,
326,
11544,
1509,
309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
712,
12,
2890,
16,
1509,
1546,
6,
4672,
468,
971,
1509,
353,
486,
444,
16,
1508,
4614,
518,
628,
326,
2063,
18,
468,
868,
1615,
777,
6449,
16069,
2353,
326,
11544,
1509,
309,
... |
test(r"""sre.match('(a)|(b)', 'b').start(1)""", -1) test(r"""sre.match('(a)|(b)', 'b').end(1)""", -1) test(r"""sre.match('(a)|(b)', 'b').span(1)""", (-1, -1)) | test(r"""sre.match(r'(a)|(b)', 'b').start(1)""", -1) test(r"""sre.match(r'(a)|(b)', 'b').end(1)""", -1) test(r"""sre.match(r'(a)|(b)', 'b').span(1)""", (-1, -1)) | def test(expression, result, exception=None): try: r = eval(expression) except: if exception: if not isinstance(sys.exc_value, exception): print expression, "FAILED" # display name, not actual value if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got", sys.exc_type.__name__, str(sys.exc_value) else: print expression, "FAILED" traceback.print_exc(file=sys.stdout) else: if exception: print expression, "FAILED" if exception is sre.error: print "expected", "sre.error" else: print "expected", exception.__name__ print "got result", repr(r) else: if r != result: print expression, "FAILED" print "expected", repr(result) print "got result", repr(r) | 75e4f162be784b94ba0d3df4014079efb836f46b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/75e4f162be784b94ba0d3df4014079efb836f46b/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
12,
8692,
16,
563,
16,
1520,
33,
7036,
4672,
775,
30,
436,
273,
5302,
12,
8692,
13,
1335,
30,
309,
1520,
30,
309,
486,
1549,
12,
9499,
18,
10075,
67,
1132,
16,
1520,
4672,
1172... |
self.altproject = None | self.altprojects = None | def __init__(self, project, request, argdict, dirfilter=None): self.argdict = argdict self.dirfilter = dirfilter self.project = project self.altproject = None # If enabled, get alternative source language projects if settings.ENABLE_ALT_SRC: altsrcs = [lang for lang in get_profile(request.user).alt_src_langs.all()] if altsrcs: try: self.altprojects = [projects.get_translation_project(altsrcs[i], self.project.project) \ for i, lang in enumerate(altsrcs)] except IndexError: pass self.matchnames = self.getmatchnames(self.project.checker) self.searchtext = self.argdict.get("searchtext", "") # TODO: fix this in jToolkit if isinstance(self.searchtext, str): self.searchtext = self.searchtext.decode("utf8") self.showassigns = self.argdict.get("showassigns", 0) if isinstance(self.showassigns, (str, unicode)) and self.showassigns.isdigit(): self.showassigns = int(self.showassigns) self.request = request self.rights = self.project.getrights(request.user) if "view" not in self.rights: raise projects.Rights404Error(None) self.lastitem = None self.pofilename = self.argdict.pop("pofilename", None) if self.pofilename == "": self.pofilename = None if self.pofilename is None and self.dirfilter is not None and \ (self.dirfilter.endswith(".po") or self.dirfilter.endswith(".xlf")): self.pofilename = self.dirfilter self.receivetranslations() # TODO: clean up modes to be one variable self.viewmode = self.argdict.get("view", 0) and "view" in self.rights self.reviewmode = self.argdict.get("review", 0) self.translatemode = (self.argdict.get("translate", 0) or self.argdict.get("searchtext", 0)) and ("translate" in self.rights or "suggest" in self.rights) notice = {} try: self.finditem() except StopIteration, stoppedby: notice = self.getfinishedtext(stoppedby) self.item = None items = self.maketable() # self.pofilename can change in search... givenpofilename = self.pofilename formaction = self.makelink("") mainstats = "" pagelinks = None if self.viewmode: rows = self.getdisplayrows("view") icon="file" else: rows = self.getdisplayrows("translate") icon="edit" if self.pofilename is not None: postats = self.project.getpototals(self.pofilename) untranslated, fuzzy = postats["total"] - postats["translated"], postats["fuzzy"] translated, total = postats["translated"], postats["total"] mainstats = localize("%d/%d translated\n(%d untranslated, %d fuzzy)", translated, total, untranslated, fuzzy) pagelinks = self.getpagelinks("?translate=1&view=1", rows) navbarpath_dict = self.makenavbarpath_dict(self.project, self.request, self.pofilename, dirfilter=self.dirfilter or "") # templatising templatename = "translatepage" instancetitle = N_(settings.TITLE) # l10n: first parameter: name of the installation (like "Pootle") # l10n: second parameter: project name # l10n: third parameter: target language # l10n: fourth parameter: file name pagetitle = localize("%s: translating %s into %s: %s", instancetitle, self.project.projectname, self.project.languagename, self.pofilename) language = {"code": pagelayout.weblanguage(self.project.languagecode), "name": self.project.languagename, "dir": pagelayout.languagedir(self.project.languagecode)} stats = {"summary": mainstats, "checks": [], "tracks": [], "assigns": []} | eaba9cbb11bf5ebc097bc6fdeac3e478c6ebe36a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11388/eaba9cbb11bf5ebc097bc6fdeac3e478c6ebe36a/translatepage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1984,
16,
590,
16,
1501,
1576,
16,
1577,
2188,
33,
7036,
4672,
365,
18,
3175,
1576,
273,
1501,
1576,
365,
18,
1214,
2188,
273,
1577,
2188,
365,
18,
4406,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1984,
16,
590,
16,
1501,
1576,
16,
1577,
2188,
33,
7036,
4672,
365,
18,
3175,
1576,
273,
1501,
1576,
365,
18,
1214,
2188,
273,
1577,
2188,
365,
18,
4406,... |
with open(support.TESTFN, "rb") as f: | with self.open(support.TESTFN, "rb") as f: | def flush(self): record.append(3) super(MyFileIO, self).flush() | cdcd4bff129f84e10e493782d319cea1a31f9162 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8546/cdcd4bff129f84e10e493782d319cea1a31f9162/test_io.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3663,
12,
2890,
4672,
1409,
18,
6923,
12,
23,
13,
2240,
12,
12062,
812,
4294,
16,
365,
2934,
11330,
1435,
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,
3663,
12,
2890,
4672,
1409,
18,
6923,
12,
23,
13,
2240,
12,
12062,
812,
4294,
16,
365,
2934,
11330,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
self.atom('tag', attrib=attrib, parent=entry) | self.atom('category', attrib=attrib, parent=entry) | def _dump_post(self, post): url = url_for(post, _external=True) entry = self.atom('entry', {'{%s}base' % XML_NS: url}) self.atom('title', text=post.title, type='text', parent=entry) self.atom('id', text=post.uid, parent=entry) self.atom('updated', text=format_iso8601(post.last_update), parent=entry) self.atom('published', text=format_iso8601(post.pub_date), parent=entry) self.atom('link', href=url, parent=entry) | ce2d038263a857d8d20cafc831c517f027f114f9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12815/ce2d038263a857d8d20cafc831c517f027f114f9/zxa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8481,
67,
2767,
12,
2890,
16,
1603,
4672,
880,
273,
880,
67,
1884,
12,
2767,
16,
389,
9375,
33,
5510,
13,
1241,
273,
365,
18,
7466,
2668,
4099,
2187,
13666,
95,
9,
87,
97,
1969,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8481,
67,
2767,
12,
2890,
16,
1603,
4672,
880,
273,
880,
67,
1884,
12,
2767,
16,
389,
9375,
33,
5510,
13,
1241,
273,
365,
18,
7466,
2668,
4099,
2187,
13666,
95,
9,
87,
97,
1969,... |
word, nbhits = browsed_words_in_colls[0][0], browsed_words_in_colls[0][1] | phrase, nbhits = browsed_phrases_in_colls[0][0], browsed_phrases_in_colls[0][1] | def browse_pattern(req, colls, p, f, rg): """Browse either biliographic phrases or words indexes, and display it.""" ## do we search in words indexes? if not f: return browse_in_bibwords(req, p, f) ## prepare collection urlargument for later printing: p_orig = p urlarg_colls = "" for coll in colls: urlarg_colls += "&c=%s" % urllib.quote(coll) ## okay, "real browse" follows: browsed_words = browse_in_bibxxx(p, f, rg) while not browsed_words: # try again and again with shorter and shorter pattern: try: p = p[:-1] browsed_words = browse_in_bibxxx(p, f, rg) except: # probably there are no hits at all: req.write("<p>No values found.") return ## try to check hits in these particular collection selection: browsed_words_in_colls = [] for word,nbhits in browsed_words: word_hitlist = HitList() word_hitlists = search_pattern("", word, f, colls, 'e') for coll in colls: word_hitlist.union(word_hitlists[coll]) word_hitlist.calculate_nbhits() if word_hitlist._nbhits > 0: # okay, this word has some hits in colls, so add it: browsed_words_in_colls.append([word, word_hitlist._nbhits]) ## were there hits in collections? if browsed_words_in_colls == []: if browsed_words != []: print_warning(req, """<p>No match close to <em>%s</em> found in given collections. Please try different term.<p>Displaying matches in any collection...""" % p_orig, "") browsed_words_in_colls = browsed_words ## display results now: out = """<table class="searchresultsbox"> <thead> <tr> <th class="searchresultsboxheader" align="left"> hits </th> <th class="searchresultsboxheader" width="15"> </th> <th class="searchresultsboxheader" align="left"> %s </th> </tr> </thead> <tbody>""" % f if len(browsed_words_in_colls) == 1: # one hit only found: word, nbhits = browsed_words_in_colls[0][0], browsed_words_in_colls[0][1] out += """<tr> <td class="searchresultsboxbody" align="right"> %s </td> <td class="searchresultsboxbody" width="15"> </td> <td class="searchresultsboxbody" align="left"> <a href="%s/search.py?p=%%22%s%%22&f=%s%s">%s</a> </td> </tr>""" % (nbhits, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) elif len(browsed_words_in_colls) > 1: # first display what was found but the last one: for word, nbhits in browsed_words_in_colls[:-1]: out += """<tr> <td class="searchresultsboxbody" align="right"> %s </td> <td class="searchresultsboxbody" width="15"> </td> <td class="searchresultsboxbody" align="left"> <a href="%s/search.py?p=%%22%s%%22&f=%s%s">%s</a> </td> </tr>""" % (nbhits, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) # now display last hit as "next term": word, nbhits = browsed_words_in_colls[-1] out += """<tr><td colspan="2" class="normal"> </td> <td class="normal"> <img src="%s/img/sn.gif" alt="" border="0"> next %s: <a href="%s/search.py?search=Browse&p=%s&f=%s%s">%s</a> </td> </tr>""" % (weburl, f, weburl, urllib.quote(word), urllib.quote(f), urlarg_colls, word) out += """</tbody> </table>""" req.write(out) return | 535ed6a8d836745c0ddd7f1016fbe145d7c7bebd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/535ed6a8d836745c0ddd7f1016fbe145d7c7bebd/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
4951,
12,
3658,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
4672,
3536,
27304,
3344,
324,
15700,
16983,
31413,
578,
4511,
5596,
16,
471,
2562,
518,
12123,
7541,
741,
732,
1623... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21670,
67,
4951,
12,
3658,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
4672,
3536,
27304,
3344,
324,
15700,
16983,
31413,
578,
4511,
5596,
16,
471,
2562,
518,
12123,
7541,
741,
732,
1623... |
log.info('stop playing') self.stop() | return | def play(self, item, player=None): """ play an item """ self.item = item if self.player and self.player.is_playing(): log.info('stop playing') self.stop() | c625fd022e9c07023fcf392ffa3303e8d2b32768 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/c625fd022e9c07023fcf392ffa3303e8d2b32768/player.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
761,
16,
7291,
33,
7036,
4672,
3536,
6599,
392,
761,
3536,
365,
18,
1726,
565,
273,
761,
309,
365,
18,
14872,
471,
365,
18,
14872,
18,
291,
67,
1601,
310,
13332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6599,
12,
2890,
16,
761,
16,
7291,
33,
7036,
4672,
3536,
6599,
392,
761,
3536,
365,
18,
1726,
565,
273,
761,
309,
365,
18,
14872,
471,
365,
18,
14872,
18,
291,
67,
1601,
310,
13332,
... |
error_checker, *args | rettype, *protos | def _create_func( func_name, error_checker, *args | 252469d959d952d07c6c2b796be96c97a8628abc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3138/252469d959d952d07c6c2b796be96c97a8628abc/libconcord.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
644,
12,
1326,
67,
529,
16,
555,
67,
19243,
16,
380,
1968,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
67,
644,
12,
1326,
67,
529,
16,
555,
67,
19243,
16,
380,
1968,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.rbAlignment.SetSelection(text_to_ID(self.curOptions.alignment)) | self.rbAlignment.SetSelection(util.text_to_ID(self.curOptions.alignment)) | def SetOptions(self, menuOpts): """Set control values based on the provided MenuOptions.""" self.curOptions = menuOpts | 7b9d6d18d1afd9ee3255306b92a085116f43e566 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4675/7b9d6d18d1afd9ee3255306b92a085116f43e566/panels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1320,
12,
2890,
16,
3824,
5476,
4672,
3536,
694,
3325,
924,
2511,
603,
326,
2112,
9809,
1320,
12123,
365,
18,
1397,
1320,
273,
3824,
5476,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
1320,
12,
2890,
16,
3824,
5476,
4672,
3536,
694,
3325,
924,
2511,
603,
326,
2112,
9809,
1320,
12123,
365,
18,
1397,
1320,
273,
3824,
5476,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
handler = get_handler('../examples/hello.txt.en') | handler = get_handler('hello.txt') | def test_get(self): handler = get_handler('../examples/hello.txt.en') self.assertEqual(handler.to_str(), 'hello world\n') | 05ad743166834b950b86d9122f51ac7dbc465d1f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/05ad743166834b950b86d9122f51ac7dbc465d1f/test_handlers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
12,
2890,
4672,
1838,
273,
336,
67,
4176,
2668,
23711,
18,
5830,
6134,
365,
18,
11231,
5812,
12,
4176,
18,
869,
67,
701,
9334,
296,
23711,
9117,
64,
82,
6134,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
12,
2890,
4672,
1838,
273,
336,
67,
4176,
2668,
23711,
18,
5830,
6134,
365,
18,
11231,
5812,
12,
4176,
18,
869,
67,
701,
9334,
296,
23711,
9117,
64,
82,
6134,
2,
-100,
... |
}"""%(name, "\n || ".join([k.js_test() for k in keys])) | }"""%(name, "\n||".join([k.js_test() for k in keys])) | def all_tests(self): """Builds all tests currently in the handler. Returns a string of javascript code which defines all | 33fe3359559b65e1a1b5f80d29cf224d5b5c62ae /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/33fe3359559b65e1a1b5f80d29cf224d5b5c62ae/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
16341,
12,
2890,
4672,
3536,
7746,
777,
7434,
4551,
316,
326,
1838,
18,
225,
2860,
279,
533,
434,
11341,
981,
1492,
11164,
777,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
777,
67,
16341,
12,
2890,
4672,
3536,
7746,
777,
7434,
4551,
316,
326,
1838,
18,
225,
2860,
279,
533,
434,
11341,
981,
1492,
11164,
777,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
def copy(self, dad, offset): | def copy(self, dad=None, offset=V(0,0,0)): | def copy(self, dad, offset): """Copy the molecule to a new molecule. offset tells where it will go relative to the original. There should be a rotation parameter but there isn't. """ pairlis = [] ndix = {} numol = molecule(self.assy, gensym(self.name)) for a in self.atoms.itervalues(): na = a.copy(numol) pairlis += [(a, na)] ndix[a.key] = na for (a, na) in pairlis: for b in a.bonds: if b.other(a).key in ndix: numol.bond(na,ndix[b.other(a).key]) numol.curpos =self.curpos+offset numol.shakedown() numol.setDisplay(self.display) self.unpick() numol.pick() numol.dad = dad return numol | aee9ddd500528fc1707d554edb28bccc7bb6e383 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/aee9ddd500528fc1707d554edb28bccc7bb6e383/chem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
302,
361,
33,
7036,
16,
1384,
33,
58,
12,
20,
16,
20,
16,
20,
3719,
30,
3536,
2951,
326,
13661,
358,
279,
394,
13661,
18,
1384,
24551,
1625,
518,
903,
1960,
3632,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
16,
302,
361,
33,
7036,
16,
1384,
33,
58,
12,
20,
16,
20,
16,
20,
3719,
30,
3536,
2951,
326,
13661,
358,
279,
394,
13661,
18,
1384,
24551,
1625,
518,
903,
1960,
3632,... |
new_offset = unpack('I', data.read(4))[0] if(new_offset != 0): offsets.append(new_offset) if(maker_note_offset != None): dir.append(decode_maker_note(data, maker_note_offset, verbose=verbose)) | new_relative_offset = unpack('I', data.read(4))[0] if(new_relative_offset != 0): relative_offsets.append(new_offset) if(makernote_abs_offset != None): dir.append(decode_makernote(data, makernote_abs_offset, verbose=verbose)) | def decode_ifd(data, initial_offset, tags=EXIF_TAGS, make_note_tag=EXIF_TAGS[MAKER_NOTE_TAG_ID], verbose=False): # IFDs have the format: # 2 bytes number of tags/entries in the IFD. # 12 bytes for each IFD entry (times the number of tags). # 4 bytes offset to the next IFD. # # IFD entries have the format: # 2 bytes tag id. # 2 bytes tag type. # 4 bytes tag value length. # 4 bytes either tag value of offset to tag value (if length > 4). # # Tag types: # 1 byte # 2 string # 3 short # 4 long # 5 rational # 6 signed byte # 7 undefined # 8 signed short # 9 signed long # 10 signed rational # 11 float # 12 double dirs = [] # We usually have 4 child IFDs: EXIF, Preview, Raw and Maker Note. offsets = [initial_offset, ] maker_note_offset = None while(offsets): offset = offsets.pop() if(verbose == 2): print('Offset: %d' %(offset)) if(not offset): continue # Start parsing a new IFD. dir = [] data.seek(offset, os.SEEK_SET) # Parse the directory content. n = unpack('H', data.read(2))[0] if(verbose == 2): print('N: %d' %(n)) while(n): if(verbose == 2): print('We are at %d' % (data.tell())) tag_id = unpack('H', data.read(2))[0] tag = tags.get(tag_id, 'Unknown Tag') typ_id = unpack('H', data.read(2))[0] typ_fmt, typ_size = TYPES.get(typ_id, DEF_TYPE) len = unpack('I', data.read(4))[0] unpack_fmt = typ_fmt if(typ_fmt != None and not typ_fmt[0] == '_'): unpack_fmt = len * typ_fmt unpack_bytes = [] val_size = typ_size * len if(val_size > 4): new_offset = unpack('I', data.read(4))[0] # Special handling for the Marker Note. if(make_note_tag and tag == make_note_tag): maker_note_offset = new_offset n -= 1 continue # Go there... here = data.tell() data.seek(new_offset, os.SEEK_SET) if(verbose == 2): print('Jump to %d' % (new_offset)) # Read the data to decode. unpack_bytes = data.read(val_size) # ...and back. data.seek(here, os.SEEK_SET) if(verbose == 2): print('Jump back') else: # Read the data to decode (4 bytes in this case). unpack_bytes = data.read(4) # Do we need padding (only if the data size would be < 4 bytes)? if(val_size < 4 and typ_fmt != None and not typ_fmt[0] == '_'): pad = 'x' * (4 - val_size) unpack_fmt += pad # Decode the tag value. # Here we have a few special cases and only is inside a Nikon Marker # Note: Linearization Table being one. | 8483e58fe5248b95ad1491a88492acba5adb4975 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6485/8483e58fe5248b95ad1491a88492acba5adb4975/nef_decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
430,
72,
12,
892,
16,
2172,
67,
3348,
16,
2342,
33,
2294,
5501,
67,
29915,
16,
1221,
67,
7652,
67,
2692,
33,
2294,
5501,
67,
29915,
63,
5535,
27221,
67,
17857,
67,
7927,
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,
2495,
67,
430,
72,
12,
892,
16,
2172,
67,
3348,
16,
2342,
33,
2294,
5501,
67,
29915,
16,
1221,
67,
7652,
67,
2692,
33,
2294,
5501,
67,
29915,
63,
5535,
27221,
67,
17857,
67,
7927,
67... |
dir_datetimes.append( datetime(*strptime(dir, "%Y-%m-%d %H:%M:%S")[0:6]) ) | dir_datetimes.append( datetime(*strptime(dir, BACKUP_DIR_DATE_FORMAT)[0:6]) ) | def get_available_backups(self): self.parent_backup_dir = client.get_string("/apps/flyback/external_storage_location") if not self.parent_backup_dir: | c2a6c9ab1e23311dbdda0f5ed73a521e619bcf98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3798/c2a6c9ab1e23311dbdda0f5ed73a521e619bcf98/flyback.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5699,
67,
9572,
87,
12,
2890,
4672,
365,
18,
2938,
67,
9572,
67,
1214,
273,
1004,
18,
588,
67,
1080,
2932,
19,
11411,
19,
29670,
823,
19,
9375,
67,
5697,
67,
3562,
7923,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5699,
67,
9572,
87,
12,
2890,
4672,
365,
18,
2938,
67,
9572,
67,
1214,
273,
1004,
18,
588,
67,
1080,
2932,
19,
11411,
19,
29670,
823,
19,
9375,
67,
5697,
67,
3562,
7923,
309... |
self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 120) | self.assertEqual(u.fp.raw.fp._sock.gettimeout(), 120) | def test_http_Value(self): u = urllib2.urlopen("http://www.python.org", timeout=120) self.assertEqual(u.fp._sock.fp._sock.gettimeout(), 120) | 51b2a8d774e7420ac15a785d34fb4344035675fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/51b2a8d774e7420ac15a785d34fb4344035675fd/test_urllib2net.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2505,
67,
620,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
5591,
18,
8103,
18,
3341,
3113,
2021,
33,
22343,
13,
365,
18,
11231,
5812,
12,
89,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2505,
67,
620,
12,
2890,
4672,
582,
273,
11527,
22,
18,
295,
18589,
2932,
2505,
2207,
5591,
18,
8103,
18,
3341,
3113,
2021,
33,
22343,
13,
365,
18,
11231,
5812,
12,
89,
18,
... |
def __init__(self, send_delay=10000000, gripper_point=(0.23, 0.0, 0.0)): | def __init__(self, send_delay=50000000, gripper_point=(0.23, 0.0, 0.0)): | def __init__(self, send_delay=10000000, gripper_point=(0.23, 0.0, 0.0)): log("Loading SimpleArmTrajectory") self.joint_names_list = [['r_shoulder_pan_joint', 'r_shoulder_lift_joint', 'r_upper_arm_roll_joint', 'r_elbow_flex_joint', 'r_forearm_roll_joint', 'r_wrist_flex_joint', 'r_wrist_roll_joint'], ['l_shoulder_pan_joint', 'l_shoulder_lift_joint', 'l_upper_arm_roll_joint', 'l_elbow_flex_joint', 'l_forearm_roll_joint', 'l_wrist_flex_joint', 'l_wrist_roll_joint']] | 3a682eff0bfca2c49f435a978c645b4e046ad110 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8117/3a682eff0bfca2c49f435a978c645b4e046ad110/simple_arm_trajectories.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1366,
67,
10790,
33,
25,
17877,
16,
314,
21335,
457,
67,
1153,
28657,
20,
18,
4366,
16,
374,
18,
20,
16,
374,
18,
20,
3719,
30,
613,
2932,
10515,
4477,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1366,
67,
10790,
33,
25,
17877,
16,
314,
21335,
457,
67,
1153,
28657,
20,
18,
4366,
16,
374,
18,
20,
16,
374,
18,
20,
3719,
30,
613,
2932,
10515,
4477,... |
return sys.modules[__name__[:rfind(__name__,'.')]].__path__[0] | return sys.modules[__name__].__path__[0] | def package_home(globals_dict): | 61908bec20512309c26b9021844881d1c6f9a64a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/61908bec20512309c26b9021844881d1c6f9a64a/Globals.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2181,
67,
8712,
12,
16227,
67,
1576,
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,
... | [
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,
2181,
67,
8712,
12,
16227,
67,
1576,
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... |
"secure", "partition", "managed", "hmc_version", "cmd_prompt" ] | "secure", "partition", "managed", "hmc_version", "cmd_prompt", "separator" ] | def main(): device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", "action", "ipaddr", "login", "passwd", "passwd_script", "secure", "partition", "managed", "hmc_version", "cmd_prompt" ] options = check_input(device_opt, process_input(device_opt)) ## ## Fence agent specific defaults ##### if 0 == options.has_key("-c"): options["-c"] = [ ":~>", "]\$" ] if 0 == options.has_key("-x"): fail_usage("Failed: You have to use ssh connection (-x) to fence device") if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") if (0 == ["list", "monitor"].count(options["-o"].lower())) and (0 == options.has_key("-n")): fail_usage("Failed: You have to enter name of the partition") if 1 == options.has_key("-H") and (options["-H"] != "3" and options["-H"] != "4"): fail_usage("Failed: You have to enter valid version number: 3 or 4") ## ## Operate the fencing device #### conn = fence_login(options) fence_action(conn, options, set_power_status, get_power_status, get_lpar_list) ## ## Logout from system ###### conn.send("quit\r\n") conn.close() | 96e27b8d2247d64abc53633ba81cc0cff474d668 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6868/96e27b8d2247d64abc53633ba81cc0cff474d668/fence_lpar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2346,
67,
3838,
273,
306,
225,
315,
5201,
3113,
315,
1589,
3113,
315,
5629,
3113,
315,
20380,
3113,
315,
11369,
3113,
315,
4148,
3113,
315,
1128,
3113,
315,
625,
4793,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
2346,
67,
3838,
273,
306,
225,
315,
5201,
3113,
315,
1589,
3113,
315,
5629,
3113,
315,
20380,
3113,
315,
11369,
3113,
315,
4148,
3113,
315,
1128,
3113,
315,
625,
4793,
3113,
... |
self.document.reporter.warning('"compound" not supported', base_node=node) | pass | def visit_compound(self, node): self.document.reporter.warning('"compound" not supported', base_node=node) | bdf9926cc9cebcea470a8a249ba9134a25cce769 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5620/bdf9926cc9cebcea470a8a249ba9134a25cce769/manpage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
22585,
12,
2890,
16,
756,
4672,
365,
18,
5457,
18,
266,
7988,
18,
8551,
22076,
22585,
6,
486,
3260,
2187,
1026,
67,
2159,
33,
2159,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
22585,
12,
2890,
16,
756,
4672,
365,
18,
5457,
18,
266,
7988,
18,
8551,
22076,
22585,
6,
486,
3260,
2187,
1026,
67,
2159,
33,
2159,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,... |
if len(parts) != 1: if parts[1] in componentsToRemove: byDefault = False | if len(parts) == 2 and parts[1] in componentsToRemove: byDefault = False | def _addImplicitTroves(self, childGroups): componentsToRemove = self.removeComponentList | ebb35f5a98dfff5be41a36d29e2d0b29839f78e7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/ebb35f5a98dfff5be41a36d29e2d0b29839f78e7/grouprecipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
15787,
56,
303,
3324,
12,
2890,
16,
1151,
3621,
4672,
4085,
12765,
273,
365,
18,
4479,
1841,
682,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
15787,
56,
303,
3324,
12,
2890,
16,
1151,
3621,
4672,
4085,
12765,
273,
365,
18,
4479,
1841,
682,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
- ``ManinSymbol`` - the `i`'th Manin symbol in the list. | ``ManinSymbol`` - the `i`'th Manin symbol in the list. | def manin_symbol(self, i): """ Returns the i'th ManinSymbol in this ManinSymbolList. | 9ae824ec769dcfde5ec83bc3e40af81e971a8b62 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9ae824ec769dcfde5ec83bc3e40af81e971a8b62/manin_symbols.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3161,
267,
67,
7175,
12,
2890,
16,
277,
4672,
3536,
2860,
326,
277,
1404,
76,
8660,
267,
5335,
316,
333,
8660,
267,
5335,
682,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
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,
3161,
267,
67,
7175,
12,
2890,
16,
277,
4672,
3536,
2860,
326,
277,
1404,
76,
8660,
267,
5335,
316,
333,
8660,
267,
5335,
682,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
for key, value in headers.iteritems(): | for key, value in headers.items(): | def __init__(self, url, data=None, headers={}): # unwrap('<URL:type://host/path>') --> 'type://host/path' self.__original = unwrap(url) self.type = None # self.__r_type is what's left after doing the splittype self.host = None self.port = None self.data = data self.headers = {} for key, value in headers.iteritems(): self.add_header(key, value) | 5146cd2143c5033148b5128a74243b44f617b854 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/5146cd2143c5033148b5128a74243b44f617b854/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
16,
501,
33,
7036,
16,
1607,
12938,
4672,
468,
11014,
2668,
32,
1785,
30,
723,
2207,
2564,
19,
803,
1870,
13,
15431,
296,
723,
2207,
2564,
19,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
880,
16,
501,
33,
7036,
16,
1607,
12938,
4672,
468,
11014,
2668,
32,
1785,
30,
723,
2207,
2564,
19,
803,
1870,
13,
15431,
296,
723,
2207,
2564,
19,
803,
... |
site = self.site) | site = self.site) | def __call__(self, m, d): import wikipedia return wikipedia.html2unicode((date_format[m][self.site.lang]) % d, site = self.site) | 77348e64753248c38f56abf347a0f4ea56aa5d03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/77348e64753248c38f56abf347a0f4ea56aa5d03/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
302,
4672,
1930,
21137,
327,
21137,
18,
2620,
22,
9124,
12443,
712,
67,
2139,
63,
81,
6362,
2890,
18,
4256,
18,
4936,
5717,
738,
302,
16,
2834,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
312,
16,
302,
4672,
1930,
21137,
327,
21137,
18,
2620,
22,
9124,
12443,
712,
67,
2139,
63,
81,
6362,
2890,
18,
4256,
18,
4936,
5717,
738,
302,
16,
2834,
... |
if len(ritems)==1: | if len(ritems) == 1: | def get_users(self,name): if name.find("@")>=0: if self.roster: try: ritems=self.roster.get_items_by_name(name,self.settings["case_sensitive"]) except KeyError: ritems=None if ritems: if len(ritems)==1: return [ritems[0].jid] try: return [pyxmpp.JID(name)] except pyxmpp.JIDError: self.__logger.error(u"Invalid JID: %s" % (name,)) return None | ccaf74aaac293546ae6aab585b071a799026af33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12768/ccaf74aaac293546ae6aab585b071a799026af33/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5577,
12,
2890,
16,
529,
4672,
309,
508,
18,
4720,
2932,
36,
7923,
34,
33,
20,
30,
309,
365,
18,
303,
8190,
30,
775,
30,
436,
3319,
33,
2890,
18,
303,
8190,
18,
588,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5577,
12,
2890,
16,
529,
4672,
309,
508,
18,
4720,
2932,
36,
7923,
34,
33,
20,
30,
309,
365,
18,
303,
8190,
30,
775,
30,
436,
3319,
33,
2890,
18,
303,
8190,
18,
588,
67,
... |
def OnLoginCVS(self, event): | def OnLoginCVS(self, event, cvsroot=''): | def OnLoginCVS(self, event): cvsDir = self.list.node.resourcepath | b94d80a8d6380c520f64a27f00e364c24e6099b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/b94d80a8d6380c520f64a27f00e364c24e6099b8/CVSExplorer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
5358,
39,
14640,
12,
2890,
16,
871,
16,
276,
6904,
3085,
2218,
11,
4672,
276,
6904,
1621,
273,
365,
18,
1098,
18,
2159,
18,
3146,
803,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
5358,
39,
14640,
12,
2890,
16,
871,
16,
276,
6904,
3085,
2218,
11,
4672,
276,
6904,
1621,
273,
365,
18,
1098,
18,
2159,
18,
3146,
803,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if encoding.lower() == 'q': | if encoding == 'q': | def decode(s): """Return a decoded string according to RFC 2047, as a unicode string.""" rtn = [] parts = ecre.split(s, 1) while parts: # If there are less than 4 parts, it can't be encoded and we're done if len(parts) < 5: rtn.extend(parts) break # The first element is any non-encoded leading text rtn.append(parts[0]) charset = parts[1] encoding = parts[2] atom = parts[3] # The next chunk to decode should be in parts[4] parts = ecre.split(parts[4]) # The encoding must be either `q' or `b', case-insensitive if encoding.lower() == 'q': func = _qdecode elif encoding.lower() == 'b': func = _bdecode else: func = _identity # Decode and get the unicode in the charset rtn.append(unicode(func(atom), charset)) # Now that we've decoded everything, we just need to join all the parts # together into the final string. return UEMPTYSTRING.join(rtn) | fa4ae2d937f23575cf56440bc1109df04699d23b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/fa4ae2d937f23575cf56440bc1109df04699d23b/Utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
87,
4672,
3536,
990,
279,
6383,
533,
4888,
358,
8372,
11492,
27,
16,
487,
279,
5252,
533,
12123,
12119,
273,
5378,
2140,
273,
425,
1793,
18,
4939,
12,
87,
16,
404,
13,
1323,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
12,
87,
4672,
3536,
990,
279,
6383,
533,
4888,
358,
8372,
11492,
27,
16,
487,
279,
5252,
533,
12123,
12119,
273,
5378,
2140,
273,
425,
1793,
18,
4939,
12,
87,
16,
404,
13,
1323,
... |
zip.write(file) zip.write(ascfile) | zip.write(file, os.path.basename(file)) zip.write(ascfile, os.path.basename(ascfile)) | def buildPackages(self): for filename in os.listdir(self.distDir): for (pack, regex) in self.packageRegex.items(): if re.compile(regex).match(filename): file = self.distDir + "/" + filename ascfile = file + ".asc" zipFileName = self.packDir + "/" + pack + ".z" # If .asc file is there, build Zip file if os.access(ascfile, os.R_OK): zip = zipfile.ZipFile(zipFileName, "w") zip.write(file) zip.write(ascfile) zip.close() self.packageList[pack] = zipFileName break if len(self.packageList) > 0: return True else: return False | bccb8cb88416f1c7cb5dd7285c9816588f2d5b1a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7360/bccb8cb88416f1c7cb5dd7285c9816588f2d5b1a/gettor_packages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
11425,
12,
2890,
4672,
364,
1544,
316,
1140,
18,
1098,
1214,
12,
2890,
18,
4413,
1621,
4672,
364,
261,
2920,
16,
3936,
13,
316,
365,
18,
5610,
6628,
18,
3319,
13332,
309,
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,
1361,
11425,
12,
2890,
4672,
364,
1544,
316,
1140,
18,
1098,
1214,
12,
2890,
18,
4413,
1621,
4672,
364,
261,
2920,
16,
3936,
13,
316,
365,
18,
5610,
6628,
18,
3319,
13332,
309,
283,
18... |
url = "" keys = params.keys() keys.sort() | deco = [(key.lower(),i,key) for i,key in enumerate(params.keys())] deco.sort() keys = [key for _,_,key in deco] url = '' canonical = '' | def make_url(self, returnURL, paymentReason, pipelineName, **params): """ Generate the URL with the signature required for a transaction """ params['callerKey'] = str(self.aws_access_key_id) params['returnURL'] = str(returnURL) params['paymentReason'] = str(paymentReason) params['pipelineName'] = pipelineName | 8d08548b096b0ee319c5f725053f593549e9804b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1098/8d08548b096b0ee319c5f725053f593549e9804b/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
718,
12,
2890,
16,
327,
1785,
16,
5184,
8385,
16,
5873,
461,
16,
2826,
2010,
4672,
3536,
6654,
326,
1976,
598,
326,
3372,
1931,
364,
279,
2492,
3536,
859,
3292,
16140,
653,
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,
1221,
67,
718,
12,
2890,
16,
327,
1785,
16,
5184,
8385,
16,
5873,
461,
16,
2826,
2010,
4672,
3536,
6654,
326,
1976,
598,
326,
3372,
1931,
364,
279,
2492,
3536,
859,
3292,
16140,
653,
3... |
"""construct a file object. | """Construct a File object. | def __init__(self, file, **keyw): """construct a file object. | 1ad1a64c1cb68257b9fa744cb8c97d06c68365e4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9569/1ad1a64c1cb68257b9fa744cb8c97d06c68365e4/PlotItems.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
16,
2826,
856,
91,
4672,
3536,
10062,
279,
585,
733,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
16,
2826,
856,
91,
4672,
3536,
10062,
279,
585,
733,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print 'shlex: reading from %s, line %d' % (self.instream,self.lineno) | print 'shlex: reading from %s, line %d' \ % (self.instream, self.lineno) | def __init__(self, instream=None, infile=None): if instream: self.instream = instream self.infile = infile else: self.instream = sys.stdin self.infile = None self.commenters = '#' self.wordchars = 'abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_' self.whitespace = ' \t\r\n' self.quotes = '\'"' self.state = ' ' self.pushback = []; self.lineno = 1 self.debug = 0 self.token = '' | 52dc76c81fffa709fae35af92538723d23ad18d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/52dc76c81fffa709fae35af92538723d23ad18d6/shlex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1804,
793,
33,
7036,
16,
14568,
33,
7036,
4672,
309,
1804,
793,
30,
365,
18,
267,
3256,
273,
1804,
793,
365,
18,
267,
768,
273,
14568,
469,
30,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1804,
793,
33,
7036,
16,
14568,
33,
7036,
4672,
309,
1804,
793,
30,
365,
18,
267,
3256,
273,
1804,
793,
365,
18,
267,
768,
273,
14568,
469,
30,
365,
18... |
episodes = self.get_new_episodes() | updated_urls = [c.url for c in channels] episodes = self.get_new_episodes([c for c in self.channels if c.url in updated_urls]) | def update_feed_cache_finish_callback(self, channels=None, notify_no_new_episodes=False, select_url_afterwards=None): | 9aacf63abe0095fd13d378620cd70c48d6c9441b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12778/9aacf63abe0095fd13d378620cd70c48d6c9441b/gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
7848,
67,
2493,
67,
13749,
67,
3394,
12,
2890,
16,
5750,
33,
7036,
16,
5066,
67,
2135,
67,
2704,
67,
881,
27134,
33,
8381,
16,
2027,
67,
718,
67,
5205,
6397,
33,
7036,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
67,
7848,
67,
2493,
67,
13749,
67,
3394,
12,
2890,
16,
5750,
33,
7036,
16,
5066,
67,
2135,
67,
2704,
67,
881,
27134,
33,
8381,
16,
2027,
67,
718,
67,
5205,
6397,
33,
7036,
4672... |
for prefix in 're:', 'glob:', 'path:': | for prefix in 're:', 'glob:', 'path:', 'relpath:': | def patkind(name): for prefix in 're:', 'glob:', 'path:': if name.startswith(prefix): return name.split(':', 1) for c in name: if c in _globchars: return 'glob', name return 'relpath', name | 594c5d7ede332229c08396390e8079b109da396f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/594c5d7ede332229c08396390e8079b109da396f/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9670,
9224,
12,
529,
4672,
364,
1633,
316,
296,
266,
30,
2187,
296,
10581,
30,
2187,
296,
803,
30,
2187,
296,
2878,
803,
2497,
30,
309,
508,
18,
17514,
1918,
12,
3239,
4672,
327,
508,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9670,
9224,
12,
529,
4672,
364,
1633,
316,
296,
266,
30,
2187,
296,
10581,
30,
2187,
296,
803,
30,
2187,
296,
2878,
803,
2497,
30,
309,
508,
18,
17514,
1918,
12,
3239,
4672,
327,
508,
... |
The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. | The other seven default arguments (verbose, quiet, generate, exclude, single, randomize, and leakdebug) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. | def main(tests=None, testdir=None, verbose=0, quiet=0, generate=0, exclude=0, single=0, randomize=0): """Execute a test suite. This also parses command-line options and modifies its behavior accordingly. tests -- a list of strings containing test names (optional) testdir -- the directory in which to look for tests (optional) Users other than the Python test suite will certainly want to specify testdir; if it's omitted, the directory containing the Python test suite is searched for. If the tests argument is omitted, the tests listed on the command-line will be used. If that's empty, too, then all *.py files beginning with test_ will be used. The other six default arguments (verbose, quiet, generate, exclude, single, and randomize) allow programmers calling main() directly to set the values that would normally be set by flags on the command line. """ try: opts, args = getopt.getopt(sys.argv[1:], 'vgqxsr') except getopt.error, msg: print msg print __doc__ return 2 for o, a in opts: if o == '-v': verbose = verbose+1 if o == '-q': quiet = 1; verbose = 0 if o == '-g': generate = 1 if o == '-x': exclude = 1 if o == '-s': single = 1 if o == '-r': randomize = 1 if generate and verbose: print "-g and -v don't go together!" return 2 good = [] bad = [] skipped = [] if single: from tempfile import gettempdir filename = os.path.join(gettempdir(), 'pynexttest') try: fp = open(filename, 'r') next = string.strip(fp.read()) tests = [next] fp.close() except IOError: pass for i in range(len(args)): # Strip trailing ".py" from arguments if args[i][-3:] == '.py': args[i] = args[i][:-3] stdtests = STDTESTS[:] nottests = NOTTESTS[:] if exclude: for arg in args: if arg in stdtests: stdtests.remove(arg) nottests[:0] = args args = [] tests = tests or args or findtests(testdir, stdtests, nottests) if single: tests = tests[:1] if randomize: random.shuffle(tests) test_support.verbose = verbose # Tell tests to be moderately quiet save_modules = sys.modules.keys() for test in tests: if not quiet: print test ok = runtest(test, generate, verbose, testdir) if ok > 0: good.append(test) elif ok == 0: bad.append(test) else: if not quiet: print "test", test, print "skipped -- an optional feature could not be imported" skipped.append(test) # Unload the newly imported modules (best effort finalization) for module in sys.modules.keys(): if module not in save_modules and module.startswith("test."): test_support.unload(module) if good and not quiet: if not bad and not skipped and len(good) > 1: print "All", print count(len(good), "test"), "OK." if bad: print count(len(bad), "test"), "failed:", print string.join(bad) if skipped and not quiet: print count(len(skipped), "test"), "skipped:", print string.join(skipped) if single: alltests = findtests(testdir, stdtests, nottests) for i in range(len(alltests)): if tests[0] == alltests[i]: if i == len(alltests) - 1: os.unlink(filename) else: fp = open(filename, 'w') fp.write(alltests[i+1] + '\n') fp.close() break else: os.unlink(filename) return len(bad) > 0 | a873b03ebb24076b3664ba694eeed4ab07d176d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a873b03ebb24076b3664ba694eeed4ab07d176d9/regrtest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
4672,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
16341,
33,
7036,
16,
1842,
1214,
33,
7036,
16,
3988,
33,
20,
16,
10902,
33,
20,
16,
2103,
33,
20,
16,
4433,
33,
20,
16,
2202,
33,
20,
16,
2744,
554,
33,
20,
4672,
3536,
... |
return endbaseAtoms[1] | return endbaseAtoms[0] | def get_five_prime_end_base_atom(self): """ Returns the five prime end base atom of this strand. If one doesn't exist, returns None @see: self.get_strand_end_base_atoms() """ endbaseAtoms = self.get_strand_end_base_atoms() return endbaseAtoms[1] | aafa3515c4462b36394a6bb2da7d59da450e8a9f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/aafa3515c4462b36394a6bb2da7d59da450e8a9f/DnaStrand.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
74,
688,
67,
16382,
67,
409,
67,
1969,
67,
7466,
12,
2890,
4672,
3536,
2860,
326,
23714,
17014,
679,
1026,
3179,
434,
333,
16706,
18,
971,
1245,
3302,
1404,
1005,
16,
1135,
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,
336,
67,
74,
688,
67,
16382,
67,
409,
67,
1969,
67,
7466,
12,
2890,
4672,
3536,
2860,
326,
23714,
17014,
679,
1026,
3179,
434,
333,
16706,
18,
971,
1245,
3302,
1404,
1005,
16,
1135,
59... |
fields = [] conditions = [] | if fields == None: fields = [] if conditions == None: conditions = [] | def build_post_form_args(self, bucket_name, key, expires_in = 6000, acl = None, success_action_redirect = None, max_content_length = None, http_method = "http"): """ Taken from the AWS book Python examples and modified for use with boto This only returns the arguments required for the post form, not the actual form This does not return the file input field which also needs to be added | da405a484d62efbf140d39cedf1b447234b6f055 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1098/da405a484d62efbf140d39cedf1b447234b6f055/connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2767,
67,
687,
67,
1968,
12,
2890,
16,
2783,
67,
529,
16,
498,
16,
7368,
67,
267,
273,
1666,
3784,
16,
7895,
273,
599,
16,
2216,
67,
1128,
67,
7590,
273,
599,
16,
943,
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,
1361,
67,
2767,
67,
687,
67,
1968,
12,
2890,
16,
2783,
67,
529,
16,
498,
16,
7368,
67,
267,
273,
1666,
3784,
16,
7895,
273,
599,
16,
2216,
67,
1128,
67,
7590,
273,
599,
16,
943,
67... |
P += arrow((pos[u][0],pos[u][1]),(pos[v][0],pos[v][1]),rgbcolor=color) | this_edge=edge_style.copy() this_edge['rgbcolor']=color P += arrow((pos[u][0],pos[u][1]),(pos[v][0],pos[v][1]), **this_edge) | def plot(self, pos=None, layout=None, vertex_labels=True, edge_labels=False, vertex_size=200, graph_border=False, vertex_colors=None, partition=None, edge_colors=None, scaling_term=0.05, iterations=50, loop_size=.1, talk=False, color_by_label=False, heights=None): """ Returns a graphics object representing the (di)graph. INPUT: pos -- an optional positioning dictionary layout -- what kind of layout to use, takes precedence over pos 'circular' -- plots the graph with vertices evenly distributed on a circle 'spring' -- uses the traditional spring layout, using the graph's current positions as initial positions vertex_labels -- whether to print vertex labels edge_labels -- whether to print edge labels. By default, False, but if True, the result of str(l) is printed on the edge for each label l. Labels equal to None are not printed. vertex_size -- size of vertices displayed graph_border -- whether to include a box around the graph vertex_colors -- optional dictionary to specify vertex colors: each key is a color recognizable by matplotlib, and each corresponding entry is a list of vertices. If a vertex is not listed, it looks invisible on the resulting plot (it doesn't get drawn). edge_colors -- a dictionary specifying edge colors: each key is a color recognized by matplotlib, and each entry is a list of edges. partition -- a partition of the vertex set. if specified, plot will show each cell in a different color. vertex_colors takes precedence. scaling_term -- default is 0.05. if vertices are getting chopped off, increase; if graph is too small, decrease. should be positive, but values much bigger than 1/8 won't be useful unless the vertices are huge talk -- if true, prints large vertices with white backgrounds so that labels are legible on slides iterations -- how many iterations of the spring layout algorithm to go through, if applicable color_by_label -- if True, color edges by their labels heights -- if specified, this is a dictionary from a set of floating point heights to a set of vertices EXAMPLES: sage: from math import sin, cos, pi sage: P = graphs.PetersenGraph() sage: d = {'#FF0000':[0,5], '#FF9900':[1,6], '#FFFF00':[2,7], '#00FF00':[3,8], '#0000FF':[4,9]} sage: pos_dict = {} sage: for i in range(5): ... x = float(cos(pi/2 + ((2*pi)/5)*i)) ... y = float(sin(pi/2 + ((2*pi)/5)*i)) ... pos_dict[i] = [x,y] ... sage: for i in range(10)[5:]: ... x = float(0.5*cos(pi/2 + ((2*pi)/5)*i)) ... y = float(0.5*sin(pi/2 + ((2*pi)/5)*i)) ... pos_dict[i] = [x,y] ... sage: pl = P.plot(pos=pos_dict, vertex_colors=d) sage: pl.show() sage: C = graphs.CubeGraph(8) sage: P = C.plot(vertex_labels=False, vertex_size=0, graph_border=True) sage: P.show() sage: G = graphs.HeawoodGraph() sage: for u,v,l in G.edges(): ... G.set_edge_label(u,v,'(' + str(u) + ',' + str(v) + ')') sage: G.plot(edge_labels=True).show() sage: D = DiGraph( { 0: [1, 10, 19], 1: [8, 2], 2: [3, 6], 3: [19, 4], 4: [17, 5], 5: [6, 15], 6: [7], 7: [8, 14], 8: [9], 9: [10, 13], 10: [11], 11: [12, 18], 12: [16, 13], 13: [14], 14: [15], 15: [16], 16: [17], 17: [18], 18: [19], 19: []} ) sage: for u,v,l in D.edges(): ... D.set_edge_label(u,v,'(' + str(u) + ',' + str(v) + ')') sage: D.plot(edge_labels=True, layout='circular').show() | 7524291de527a0df574d754449e74a613f7db457 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7524291de527a0df574d754449e74a613f7db457/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
949,
33,
7036,
16,
3511,
33,
7036,
16,
5253,
67,
5336,
33,
5510,
16,
3591,
67,
5336,
33,
8381,
16,
5253,
67,
1467,
33,
6976,
16,
2667,
67,
8815,
33,
8381,
16,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
12,
2890,
16,
949,
33,
7036,
16,
3511,
33,
7036,
16,
5253,
67,
5336,
33,
5510,
16,
3591,
67,
5336,
33,
8381,
16,
5253,
67,
1467,
33,
6976,
16,
2667,
67,
8815,
33,
8381,
16,
5... |
RemovedTroveIds.troveId == Provides.instanceId | RemovedTroveIds.troveId = Provides.instanceId | def _orderComponents(compGraph): | c3870e643626054f9dc7fe38751e71be00f92f1b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/c3870e643626054f9dc7fe38751e71be00f92f1b/deptable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
7171,
12,
2919,
4137,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1019,
7171,
12,
2919,
4137,
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,
-1... |
return len(self.arraydata[0]) | return len(HEADER_DATA) | def columnCount(self, parent): return len(self.arraydata[0]) | 607d61ba1ff81f344fc9e6cfe12ee3d3a86a8bff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13158/607d61ba1ff81f344fc9e6cfe12ee3d3a86a8bff/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22429,
12,
2890,
16,
982,
4672,
327,
562,
12,
7557,
67,
4883,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22429,
12,
2890,
16,
982,
4672,
327,
562,
12,
7557,
67,
4883,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.