rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
You can easly convert it to a binary string with: ''.join(chr(i) for i in ckbytelistVariable) | You can easly convert it to a binary string with:: ''.join(chr(i) for i in ckbytelistVariable) | def getAttributeValue(self, obj_id, attr, allAsBinary = False): """ C_GetAttributeValue | 2fcad4b0bf8377d18d6bd13bd94a33bf62cc9ba0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6899/2fcad4b0bf8377d18d6bd13bd94a33bf62cc9ba0/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22777,
12,
2890,
16,
1081,
67,
350,
16,
1604,
16,
777,
1463,
5905,
273,
1083,
4672,
3536,
385,
67,
967,
14942,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22777,
12,
2890,
16,
1081,
67,
350,
16,
1604,
16,
777,
1463,
5905,
273,
1083,
4672,
3536,
385,
67,
967,
14942,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.w.win_update() env.history.message(greenmsg(cmd) + str(len(contract_list)) + " atoms unselected.") | msg = greenmsg(cmd) + str(len(contract_list)) + " atom(s) unselected." from platform import fix_plurals env.history.message(fix_plurals(msg)) self.w.win_update() | def selectContract(self): """Unselect any atom that is bonded to only one other selected atom. """ # Added by Mark 050923. cmd = "Contract Selection: " if self.selwhat == SELWHAT_CHUNKS: env.history.message(greenmsg(cmd) + redmsg("Doesn't work in Select Chunks mode.")) return if not self.assy.selatoms: env.history.message(greenmsg(cmd) + redmsg("No atoms selected.")) return contract_list = [] # Contains list of atoms to be unselected. assert self.selwhat == SELWHAT_ATOMS for a in self.selatoms.values(): if a.picked: # If a select atom has an unpicked neighbor, it gets added to the contract_list for n in a.neighbors(): if not n.picked: contract_list.append(a) break # Unselect the atom in the contract_list for a in contract_list: a.unpick() self.w.win_update() env.history.message(greenmsg(cmd) + str(len(contract_list)) + " atoms unselected.") | e6d6b90a59e53c62df9b4101618a6cfcc876a006 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e6d6b90a59e53c62df9b4101618a6cfcc876a006/ops_select.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
8924,
12,
2890,
4672,
3536,
984,
4025,
1281,
3179,
716,
353,
324,
265,
785,
358,
1338,
1245,
1308,
3170,
3179,
18,
3536,
468,
25808,
635,
6622,
374,
5995,
4366,
18,
225,
1797,
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,
2027,
8924,
12,
2890,
4672,
3536,
984,
4025,
1281,
3179,
716,
353,
324,
265,
785,
358,
1338,
1245,
1308,
3170,
3179,
18,
3536,
468,
25808,
635,
6622,
374,
5995,
4366,
18,
225,
1797,
273,... |
system(NMAKE + "/f makefile.vc clean") system(NMAKE + "/f makefile.vc TCLDIR=%s" % tcldir) system(NMAKE + "/f makefile.vc TCLDIR=%s INSTALLDIR=%s install" % (tcldir, dest)) | nmake("makefile.vc", "clean", TCLDIR=tcldir) nmake("makefile.vc", TCLDIR=tcldir) nmake("makefile.vc", "install", TCLDIR=tcldir, INSTALLDIR=dest) | def build(platform, clean): if platform == "Win32": dest = os.path.join(ROOT, "tcltk") machine = "X86" elif platform == "x64": dest = os.path.join(ROOT, "tcltk64") machine = "X64" else: raise ValueError(platform) # TCL tcldir = os.path.join(ROOT, TCL) if True: os.chdir(os.path.join(tcldir, "win")) if clean: system(NMAKE + "/f makefile.vc clean") system(NMAKE + "/f makefile.vc") system(NMAKE + "/f makefile.vc INSTALLDIR=%s install" % dest) # TK if True: os.chdir(os.path.join(ROOT, TK, "win")) if clean: system(NMAKE + "/f makefile.vc clean") system(NMAKE + "/f makefile.vc TCLDIR=%s" % tcldir) system(NMAKE + "/f makefile.vc TCLDIR=%s INSTALLDIR=%s install" % (tcldir, dest)) # TIX if True: # python9.mak is available at http://svn.python.org os.chdir(os.path.join(ROOT, TIX, "win")) if clean: system(NMAKE + "/f python9.mak clean") system(NMAKE + "/f python9.mak MACHINE=%s" % machine) system(NMAKE + "/f python9.mak install") | 8affb5f2360c057176c820efc425906bdb36ee49 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/8affb5f2360c057176c820efc425906bdb36ee49/build_tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
12,
9898,
16,
2721,
4672,
309,
4072,
422,
315,
18049,
1578,
6877,
1570,
273,
1140,
18,
803,
18,
5701,
12,
9185,
16,
315,
88,
830,
16099,
7923,
5228,
273,
315,
60,
5292,
6,
1327,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
9898,
16,
2721,
4672,
309,
4072,
422,
315,
18049,
1578,
6877,
1570,
273,
1140,
18,
803,
18,
5701,
12,
9185,
16,
315,
88,
830,
16099,
7923,
5228,
273,
315,
60,
5292,
6,
1327,
... |
self.ctx.out("[RUNNING] (PID %d)" % pid) | self.ctx.out("[RUNNING] (PID %d)%s" % (pid, cache_backend)) | def status(self, args): location = self.ctx.dir / "lib" / "python" / "omeroweb" self.ctx.out("OMERO.web status... ", newline=False) import omeroweb.settings as settings deploy = getattr(settings, 'APPLICATION_SERVER', DEFAULT_SERVER_TYPE) rv = 0 if deploy in FASTCGI_TYPES: try: f=open(self.ctx.dir / "var" / "django.pid", 'r') pid = int(f.read()) except IOError: self.ctx.out("[NOT STARTED]") return rv import signal try: os.kill(pid, 0) # NULL signal self.ctx.out("[RUNNING] (PID %d)" % pid) except: self.ctx.out("[NOT STARTED]") return rv else: self.ctx.err("DEVELOPMENT: You will have to check status by hand!") return rv | efcc7022e5bfbb639c930b55eea63db8b1176eb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/efcc7022e5bfbb639c930b55eea63db8b1176eb4/web.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1267,
12,
2890,
16,
833,
4672,
2117,
273,
365,
18,
5900,
18,
1214,
342,
315,
2941,
6,
342,
315,
8103,
6,
342,
315,
362,
264,
543,
24008,
6,
365,
18,
5900,
18,
659,
2932,
1872,
13309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1267,
12,
2890,
16,
833,
4672,
2117,
273,
365,
18,
5900,
18,
1214,
342,
315,
2941,
6,
342,
315,
8103,
6,
342,
315,
362,
264,
543,
24008,
6,
365,
18,
5900,
18,
659,
2932,
1872,
13309,... |
self._prev_text_and_style = raw_text, self.style | self._prev_draw_state = state | def func(index, atom, curpos): return self._font.size(atom) | 844a78bea598ab6407504830a8c0a84578a68ce5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5406/844a78bea598ab6407504830a8c0a84578a68ce5/TextEdit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1326,
12,
1615,
16,
3179,
16,
662,
917,
4672,
327,
365,
6315,
5776,
18,
1467,
12,
7466,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
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,
1326,
12,
1615,
16,
3179,
16,
662,
917,
4672,
327,
365,
6315,
5776,
18,
1467,
12,
7466,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if item: | if item is not None: | def _aslist(self, item=None): if item: return self.data[int(item)] else: return self.data | 47c5b9d5f405ed97cc4aca66c83f73269a0da2f1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/47c5b9d5f405ed97cc4aca66c83f73269a0da2f1/Types.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
345,
1098,
12,
2890,
16,
761,
33,
7036,
4672,
309,
761,
353,
486,
599,
30,
327,
365,
18,
892,
63,
474,
12,
1726,
25887,
469,
30,
327,
365,
18,
892,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
345,
1098,
12,
2890,
16,
761,
33,
7036,
4672,
309,
761,
353,
486,
599,
30,
327,
365,
18,
892,
63,
474,
12,
1726,
25887,
469,
30,
327,
365,
18,
892,
2,
-100,
-100,
-100,
-100,
... |
caseNumber = trTags[i].td.nextSibling.nextSibling.contents[0].strip() | caseNumber = trTags[i].td.nextSibling.nextSibling.contents[0] | def scrapeCourt(courtID, result, verbosity, daemonmode): if verbosity >= 1: result += "NOW SCRAPING COURT: " + str(courtID) + "\n" if verbosity >= 2: print "NOW SCRAPING COURT: " + str(courtID) if (courtID == 1): """ PDFs are available from the first circuit if you go to their RSS feed. So go to their RSS feed we shall. """ urls = ("http://www.ca1.uscourts.gov/opinions/opinionrss.php",) ct = Court.objects.get(courtUUID='ca1') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " & ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNamesAndNumbers = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-.*?\W)(.*)$") # incredibly, this RSS feed is in cron order, so new stuff is at the # end. Mind blowing. i = len(caseLinks)-1 if verbosity >= 2: print str(i) dupCount = 0 while i > 0: # First: docType, since we don't support them all... docType = docTypes[i].text.strip() if verbosity >= 2: print docType if "unpublished" in docType.lower(): documentType = "Unpublished" elif "published" in docType.lower(): documentType = "Published" elif "errata" in docType.lower(): documentType = "Errata" else: # something weird we don't know about, punt i -= 1 continue # next, we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) # then we download the PDF, make the hash and document myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i -= 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 8: # eighth dup in a a row. BREAK! # this is 8 here b/c this court has tech problems. break i -= 1 continue else: dupCount = 0 # otherwise, we continue doc.documentType = documentType # next: caseDate caseDate = caseDateRegex.search(descriptions[i].text).group(1) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next: caseNumber caseNumber = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(1) # next: caseNameShort caseNameShort = caseNumberRegex.search(caseNamesAndNumbers[i].text)\ .group(2) # check for dups, make the object if necessary, otherwise, get it cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i -= 1 return result elif (courtID == 2): """ URL hacking FTW. """ urls = ( "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=OPN&IW_FIELD_TEXT=OPN&IW_SORT=-Date&IW_BATCHSIZE=100", "http://www.ca2.uscourts.gov/decisions?IW_DATABASE=SUM&IW_FIELD_TEXT=SUM&IW_SORT=-Date&IW_BATCHSIZE=100", ) ct = Court.objects.get(courtUUID='ca2') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue soup = BeautifulSoup(html) aTagsRegex = re.compile('(.*?.pdf).*?', re.IGNORECASE) caseNumRegex = re.compile('.*/(\d{1,2}-\d{3,4})(.*).pdf') aTags = soup.findAll(attrs={'href' : aTagsRegex}) if daemonmode: # this mess is necessary because the court puts random # (literally) numbers throughout their links. No idea why, # but the solution is to figure out the caselinks here, and to hand # those to the sha1 generator. aTagsEncoded = [] for i in aTags: caseLink = i.get('href') caseLink = aTagsRegex.search(caseLink).group(1) try: caseNumbers = caseNumRegex.search(caseLink).group(1) except: caseNumbers = "" aTagsEncoded.append(caseNumbers) # if it's daemonmode, see if the court has changed changed = courtChanged(url, str(aTagsEncoded)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = aTagsRegex.search(caseLink).group(1) caseLink = urljoin(url, caseLink) if verbosity >= 2: print str(i) + ": " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNum = caseNumRegex.search(caseLink).group(1) if verbosity >= 2: print "caseNum: " + str(caseNum) # and the docType documentType = caseNumRegex.search(caseLink).group(2) if 'opn' in documentType: # it's unpublished doc.documentType = "Published" elif 'so' in documentType: doc.documentType = "Unpublished" # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.contents[0] # next, we can do the caseDate caseDate = aTags[i].parent.parent.nextSibling.nextSibling\ .nextSibling.nextSibling.nextSibling.nextSibling.contents[0]\ .replace(' ', ' ').strip() # some caseDate cleanup splitDate = caseDate.split('-') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # check for duplicates, make the object in their absence cite, created = hasDuplicate(caseNum, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 3): """ This URL provides the latest 25 cases, so I need to pick out the new ones and only get those. I can do this efficiently by trying to do each, and then giving up once I hit one that I've done before. This will work because they are in reverse chronological order. """ # if these URLs change, the docType identification (below) will need # to be updated. It's lazy, but effective. urls = ("http://www.ca3.uscourts.gov/recentop/week/recprec.htm", "http://www.ca3.uscourts.gov/recentop/week/recnon2day.htm",) ct = Court.objects.get(courtUUID='ca3') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) # we will use these vars in our while loop, better not to compile them # each time regexII = re.compile('\d{2}/\d{2}/\d{2}') regexIII = re.compile('\d{2}-\d{4}') i = 0 dupCount = 0 while i < len(aTags): # caseLink and caseNameShort caseLink = aTags[i].get('href') myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 caseNameShort = aTags[i].contents[0] # caseDate and caseNumber junk = aTags[i].previous.previous.previous try: # this error seems to happen upon dups...not sure why yet caseDate = regexII.search(junk).group(0) caseNumber = regexIII.search(junk).group(0) except: i = i+1 continue # next up is the caseDate splitDate = caseDate.split('/') caseDate = datetime.date(int("20" + splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # Make a decision about the docType. if "recprec.htm" in str(url): doc.documentType = "Published" elif "recnon2day.htm" in str(url): doc.documentType = "Unpublished" cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 4): """The fourth circuit is THE worst form of HTML I've ever seen. It's going to break a lot, but I've done my best to clean it up, and make it reliable.""" urls = ("http://pacer.ca4.uscourts.gov/opinions_today.htm",) ct = Court.objects.get(courtUUID='ca4') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # sadly, beautifulsoup chokes on the lines lines of this file because # the HTML is so bad. Stop laughing - the HTML IS awful, but it's not # funny. Anyway, to make this thing work, we must pull out the target # attributes. And so we do. regex = re.compile("target.*>", re.IGNORECASE) html = re.sub(regex, ">", html) soup = BeautifulSoup(html) # all links ending in pdf, case insensitive regex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": regex}) i = 0 dupCount = 0 regexII = re.compile('\d{2}/\d{2}/\d{4}') regexIII = re.compile('\d{4}(.*)') while i < len(aTags): # caseLink field, and save it caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caselink, we can get the caseNumber and documentType fileName = caseLink.split('/')[-1] caseNumber, documentType = fileName.split('.')[0:2] # the caseNumber needs a hyphen inserted after the second digit caseNumber = caseNumber[0:2] + "-" + caseNumber[2:] if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' else: doc.documentType = "" # next, we do the caseDate and caseNameShort, so we can quit before # we get too far along. junk = aTags[i].contents[0].replace(' ', ' ').strip() try: # this error seems to happen upon dups...not sure why yet caseDate = cleanString(regexII.search(junk).group(0)) caseNameShort = regexIII.search(junk).group(1) except: i += 1 continue # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # let's check for duplicates before we proceed cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 5): """New fifth circuit scraper, which can get back versions all the way to 1992! This is exciting, but be warned, the search is not reliable on recent dates. It has been known not to bring back results that are definitely within the set. Watch closely. """ urls = ("http://www.ca5.uscourts.gov/Opinions.aspx",) ct = Court.objects.get(courtUUID='ca5') for url in urls: # Use just one date, it seems to work better this way. todayObject = datetime.date.today() if verbosity >= 2: print "start date: " + str(todayObject) startDate = time.strftime('%m/%d/%Y', todayObject.timetuple()) if verbosity >= 2: print "Start date is: " + startDate # these are a mess because the court has a security check. postValues = { '__EVENTTARGET' : '', '__EVENTARGUMENT' : '', '__VIEWSTATE' : '/wEPDwULLTEwOTU2NTA2NDMPZBYCAgEPZBYKAgEPDxYIHgtDZWxsUGFkZGluZ2YeC0NlbGxTcGFjaW5nZh4JQmFja0NvbG9yCRcQJ/8eBF8hU0ICiIAYZGQCAw8PFggfAGYfAWYfAgmZzP//HwMCiIAYZGQCGQ9kFgYCAg8PFgQfAgqHAR8DAghkZAIEDw8WBB8CCocBHwMCCGRkAgYPDxYEHwIKhwEfAwIIZGQCGw9kFooBAgIPDxYEHwIKhwEfAwIIZGQCBA8PFgQfAgqHAR8DAghkZAIGDw8WBB8CCocBHwMCCGRkAggPDxYEHwIKhwEfAwIIZGQCCg8PFgQfAgqHAR8DAghkZAIMDw8WBB8CCocBHwMCCGRkAg4PDxYEHwIKhwEfAwIIZGQCEA8PFgQfAgqHAR8DAghkZAISDw8WBB8CCocBHwMCCGRkAhQPDxYEHwIKhwEfAwIIZGQCFg8PFgQfAgqHAR8DAghkZAIYDw8WBB8CCocBHwMCCGRkAhoPDxYEHwIKhwEfAwIIZGQCHA8PFgQfAgqHAR8DAghkZAIeDw8WBB8CCocBHwMCCGRkAiAPDxYEHwIKhwEfAwIIZGQCIg8PFgQfAgqHAR8DAghkZAIkDw8WBB8CCocBHwMCCGRkAiYPDxYEHwIKhwEfAwIIZGQCKA8PFgQfAgqHAR8DAghkZAIqDw8WBB8CCocBHwMCCGRkAiwPDxYEHwIKhwEfAwIIZGQCLg8PFgQfAgqHAR8DAghkZAIwDw8WBB8CCocBHwMCCGRkAjIPDxYEHwIKhwEfAwIIZGQCNA8PFgQfAgqHAR8DAghkZAI2Dw8WBB8CCocBHwMCCGRkAjgPDxYEHwIKhwEfAwIIZGQCOg8PFgQfAgqHAR8DAghkZAI8Dw8WBB8CCocBHwMCCGRkAj4PDxYEHwIKhwEfAwIIZGQCQA8PFgQfAgqHAR8DAghkZAJCDw8WBB8CCocBHwMCCGRkAkQPDxYEHwIKhwEfAwIIZGQCRg8PFgQfAgqHAR8DAghkZAJIDw8WBB8CCocBHwMCCGRkAkoPDxYEHwIKhwEfAwIIZGQCTA8PFgQfAgqHAR8DAghkZAJODw8WBB8CCocBHwMCCGRkAlAPDxYEHwIKhwEfAwIIZGQCUg8PFgQfAgqHAR8DAghkZAJUDw8WBB8CCocBHwMCCGRkAlYPDxYEHwIKhwEfAwIIZGQCWA8PFgQfAgqHAR8DAghkZAJaDw8WBB8CCocBHwMCCGRkAlwPDxYEHwIKhwEfAwIIZGQCXg8PFgQfAgqHAR8DAghkZAJgDw8WBB8CCocBHwMCCGRkAmIPDxYEHwIKhwEfAwIIZGQCZA8PFgQfAgqHAR8DAghkZAJmDw8WBB8CCocBHwMCCGRkAmgPDxYEHwIKhwEfAwIIZGQCag8PFgQfAgqHAR8DAghkZAJsDw8WBB8CCocBHwMCCGRkAm4PDxYEHwIKhwEfAwIIZGQCcA8PFgQfAgqHAR8DAghkZAJyDw8WBB8CCocBHwMCCGRkAnQPDxYEHwIKhwEfAwIIZGQCdg8PFgQfAgqHAR8DAghkZAJ4Dw8WBB8CCocBHwMCCGRkAnoPDxYEHwIKhwEfAwIIZGQCfA8PFgQfAgqHAR8DAghkZAJ+Dw8WBB8CCocBHwMCCGRkAoABDw8WBB8CCocBHwMCCGRkAoIBDw8WBB8CCocBHwMCCGRkAoQBDw8WBB8CCocBHwMCCGRkAoYBDw8WBB8CCocBHwMCCGRkAogBDw8WBB8CCocBHwMCCGRkAooBDw8WBB8CCocBHwMCCGRkAh0PEGRkFgECAmRkcx2JRvTiy039dck7+vdOCUS6J5s=', 'txtBeginDate' : startDate, 'txtEndDate' : '', 'txtDocketNumber' : '', 'txtTitle=' : '', 'btnSearch' : 'Search', '__EVENTVALIDATION' : '/wEWCALd2o3pAgLH8d2nDwKAzfnNDgLChrRGAr2b+P4BAvnknLMEAqWf8+4KAqC3sP0KVcw25xdB1YPfbcUwUCqEYjQqaqM=', } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) #if verbosity >= 2: print soup #all links ending in pdf, case insensitive aTagRegex = re.compile("pdf$", re.IGNORECASE) aTags = soup.findAll(attrs={"href": aTagRegex}) unpubRegex = re.compile(r"pinions.*unpub") i = 0 dupCount = 0 numP = 0 numQ = 0 while i < len(aTags): # this page has PDFs that aren't cases, we must filter them out if 'pinion' not in str(aTags[i]): # it's not an opinion, increment and punt if verbosity >= 2: print "Punting non-opinion URL: " + str(aTags[i]) i += 1 continue # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue # next, we do the docStatus field, b/c we need to include it in # the dup check. This is because we need to abort after we have # three non-precedential and three precedential from this court. if unpubRegex.search(str(aTags[i])) == None: # it's published, else it's unpublished documentType = "Published" numP += 1 else: documentType = "Unpublished" numQ += 1 if verbosity >= 2: print "documentType: " + documentType doc.documentType = documentType if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount >= 3 and numP >= 3 and numQ >= 3: # third dup in a a row for both U and P. break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].contents[0] # next, we do the caseDate caseDate = aTags[i].next.next.contents[0].contents[0] # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next, we do the caseNameShort caseNameShort = aTags[i].next.next.next.next.next.contents[0]\ .contents[0] # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 6): """Results are available without an HTML POST, but those results lack a date field. Hence, we must do an HTML POST. Missing a day == OK. Just need to monkey with the date POSTed. """ urls = ("http://www.ca6.uscourts.gov/cgi-bin/opinions.pl",) ct = Court.objects.get(courtUUID = 'ca6') for url in urls: today = datetime.date.today() formattedToday = str(today.month) + '/' + str(today.day) + '/' +\ str(today.year) postValues = { 'CASENUM' : '', 'TITLE' : '', 'FROMDATE' : formattedToday, 'TODATE' : formattedToday, 'OPINNUM' : '' } data = urllib.urlencode(postValues) req = urllib2.Request(url, data) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].next.next.next.next.next.contents[0] # using the filename, we can determine the documentType... fileName = aTags[i].contents[0] if 'n' in fileName: # it's unpublished doc.documentType = "Unpublished" elif 'p' in fileName: doc.documentType = "Published" # next, we can do the caseDate caseDate = aTags[i].next.next.next.next.next.next.next.next\ .contents[0] caseDate = cleanString(caseDate) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[0]),int(splitDate[1]), int(splitDate[2])) doc.dateFiled = caseDate # next, the caseNameShort (there's probably a better way to do this. caseNameShort = aTags[i].next.next.next.next.next.next.next.next\ .next.next.next # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 7): """another court where we need to do a post. This will be a good starting place for getting the judge field, when we're ready for that. Missing a day == OK. Queries return cases for the past week. """ urls = ("http://www.ca7.uscourts.gov/fdocs/docs.fwx",) ct = Court.objects.get(courtUUID = 'ca7') for url in urls: # if these strings change, check that documentType still gets set correctly. dataStrings = ("yr=&num=&Submit=Past+Week&dtype=Opinion&scrid=Select+a+Case", "yr=&num=&Submit=Past+Week&dtype=Nonprecedential+Disposition&scrid=Select+a+Case",) for dataString in dataStrings: req = urllib2.Request(url, dataString) try: html = urllib2.urlopen(req).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url+dataString, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get("href") caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType caseNumber = aTags[i].previous.previous.previous.previous.previous\ .previous.previous.previous.previous.previous # next up: caseDate caseDate = aTags[i].previous.previous.previous.contents[0] caseDate = cleanString(caseDate) splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # next up: caseNameShort caseNameShort = aTags[i].previous.previous.previous.previous\ .previous.previous.previous # next up: docStatus if "type=Opinion" in dataString: doc.documentType = "Published" elif "type=Nonprecedential+Disposition" in dataString: doc.documentType = "Unpublished" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 8): urls = ("http://www.ca8.uscourts.gov/cgi-bin/new/today2.pl",) ct = Court.objects.get(courtUUID = 'ca8') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result soup = BeautifulSoup(html) aTagsRegex = re.compile('pdf$', re.IGNORECASE) aTags = soup.findAll(attrs={'href' : aTagsRegex}) caseNumRegex = re.compile('(\d{2})(\d{4})(u|p)', re.IGNORECASE) caseDateRegex = re.compile('(\d{2}/\d{2}/\d{4})(.*)(</b>)') i = 0 dupCount = 0 while i < len(aTags): # we begin with the caseLink field caseLink = aTags[i].get('href') caseLink = urljoin(url, caseLink) myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # using caseLink, we can get the caseNumber and documentType junk = aTags[i].contents[0] caseNumber = caseNumRegex.search(junk).group(1) + "-" +\ caseNumRegex.search(junk).group(2) documentType = caseNumRegex.search(junk).group(3).upper() if documentType == 'U': doc.documentType = 'Unpublished' elif documentType == 'P': doc.documentType = 'Published' # caseDate is next on the block junk = str(aTags[i].next.next.next) caseDate = caseDateRegex.search(junk).group(1) caseDate = cleanString(caseDate) caseNameShort = caseDateRegex.search(junk).group(2) # some caseDate cleanup splitDate = caseDate.split('/') caseDate = datetime.date(int(splitDate[2]),int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 9): """This court, by virtue of having a javascript laden website, was very hard to parse properly. BeautifulSoup couldn't handle it at all, so lxml has to be used. lxml seems pretty useful, but it was a pain to learn.""" # these URLs redirect now. So much for hacking them. A new approach can probably be done using POST data. urls = ( "http://www.ca9.uscourts.gov/opinions/?o_mode=view&o_sort_field=19&o_sort_type=DESC&o_page_size=100", "http://www.ca9.uscourts.gov/memoranda/?o_mode=view&o_sort_field=21&o_sort_type=DESC&o_page_size=100",) ct = Court.objects.get(courtUUID = 'ca9') for url in urls: if verbosity >= 2: print "Link is now: " + url try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue tree = fromstring(html) if url == urls[0]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[6]/label') elif url == urls[1]: caseLinks = tree.xpath('//table[3]/tbody/tr/td/a') caseNumbers = tree.xpath('//table[3]/tbody/tr/td[2]/label') caseDates = tree.xpath('//table[3]/tbody/tr/td[7]/label') if daemonmode: # if it's daemonmode, see if the court has changed # this is necessary because the 9th circuit puts random numbers # in their HTML. This gets rid of those, so SHA1 can be generated. listofLinks = [] for i in caseLinks: listofLinks.append(i.get('href')) changed = courtChanged(url, str(listofLinks)) if not changed: # if not, bail. If so, continue to the scraping. return result i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].get('href') caseLink = urljoin(url, caseLink) if verbosity >= 2: print "CaseLink is: " + caseLink # special case if 'no memos filed' in caseLink.lower(): i += 1 continue myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 2: print "Error creating file. Punting..." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 if dupCount == 5: # fifth dup in a a row. BREAK! break i += 1 continue else: dupCount = 0 # next, we'll do the caseNumber caseNumber = caseNumbers[i].text if verbosity >= 2: print "CaseNumber is: " + caseNumber # next up: document type (static for now) if 'memoranda' in url: doc.documentType = "Unpublished" elif 'opinions' in url: doc.documentType = "Published" if verbosity >= 2: print "Document type is: " + doc.documentType # next up: caseDate splitDate = caseDates[i].text.split('/') caseDate = datetime.date(int(splitDate[2]), int(splitDate[0]), int(splitDate[1])) doc.dateFiled = caseDate if verbosity >= 2: print "CaseDate is: " + str(caseDate) #next up: caseNameShort caseNameShort = titlecase(caseLinks[i].text.lower()) if verbosity >= 2: print "CaseNameShort is: " + caseNameShort + "\n\n" # now that we have the caseNumber and caseNameShort, we can dup check cite, created = hasDuplicate(caseNumber, caseNameShort) # last, save evrything (pdf, citation and document) doc.citation = cite doc.local_path.save(trunc(cleanString(caseNameShort), 80) + ".pdf", myFile) logger.debug(time.strftime("%a, %d %b %Y %H:%M", time.localtime()) + ": Added " + ct.courtShortName + ": " + cite.caseNameShort) doc.save() i += 1 return result elif (courtID == 10): # a daily feed of all the items posted THAT day. Missing a day == bad. urls = ("http://www.ck10.uscourts.gov/opinions/new/daily_decisions.rss",) ct = Court.objects.get(courtUUID = 'ca10') for url in urls: try: html = urllib2.urlopen(url).read() except: result += "****ERROR CONNECTING TO COURT: " + str(courtID) + "****\n" continue if daemonmode: # if it's daemonmode, see if the court has changed changed = courtChanged(url, html) if not changed: # if not, bail. If so, continue to the scraping. return result # this code gets rid of errant ampersands - they throw big errors # when parsing. We replace them later. if '&' in html: punctuationRegex = re.compile(" & ") html = re.sub(punctuationRegex, " & ", html) tree = etree.fromstring(html) else: tree = etree.fromstring(html) caseLinks = tree.xpath("//item/link") descriptions = tree.xpath("//item/description") docTypes = tree.xpath("//item/category") caseNames = tree.xpath("//item/title") caseDateRegex = re.compile("(\d{2}/\d{2}/\d{4})", re.VERBOSE | re.DOTALL) caseNumberRegex = re.compile("(\d{2}-\d{4})(.*)$") i = 0 dupCount = 0 while i < len(caseLinks): # we begin with the caseLink field caseLink = caseLinks[i].text caseLink = urljoin(url, caseLink) if verbosity >= 2: print "Link: " + caseLink myFile, doc, created, error = makeDocFromURL(caseLink, ct) if error: # things broke, punt this iteration if verbosity >= 1: print "Error creating file, punting." i += 1 continue if not created: # it's an oldie, punt! if verbosity >= 2: result += "Duplicate found at " + str(i) + "\n" dupCount += 1 # this section is commented out because ca10 doesn't publish # their cases in any order resembling sanity. Thus, this bit # of code is moot. Ugh. | bb2449c1a8141bd53a8e2339af75ec01a177eba5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6762/bb2449c1a8141bd53a8e2339af75ec01a177eba5/scrape_and_parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
25360,
29328,
88,
12,
71,
477,
88,
734,
16,
563,
16,
11561,
16,
8131,
3188,
4672,
309,
11561,
1545,
404,
30,
563,
1011,
315,
27091,
348,
5093,
2203,
1360,
7910,
1099,
56,
30,
315,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
888,
25360,
29328,
88,
12,
71,
477,
88,
734,
16,
563,
16,
11561,
16,
8131,
3188,
4672,
309,
11561,
1545,
404,
30,
563,
1011,
315,
27091,
348,
5093,
2203,
1360,
7910,
1099,
56,
30,
315,... |
self.isResizing = 0 | def setJitteringSize(self): self.isResizing = 0 self.graph.setData(self.data) self.updateGraph() | 3b9dc20860e1e7af83f13fd27cf8036ecb949be5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/3b9dc20860e1e7af83f13fd27cf8036ecb949be5/OWParallelCoordinates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
46,
6132,
310,
1225,
12,
2890,
4672,
365,
18,
4660,
18,
542,
751,
12,
2890,
18,
892,
13,
365,
18,
2725,
4137,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
46,
6132,
310,
1225,
12,
2890,
4672,
365,
18,
4660,
18,
542,
751,
12,
2890,
18,
892,
13,
365,
18,
2725,
4137,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
timeStamp = Time.DateTime() | timeStamp = Time.toString() | def setJobStatus(self, status='', minor='', sendFlag=True): """ Send job status information to the JobState service for jobID """ if not self.jobID: return S_OK('Local execution, jobID is null.') | c48197836d3a42ef2d691b4d6f40e4f4798ebd41 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12864/c48197836d3a42ef2d691b4d6f40e4f4798ebd41/JobReport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
23422,
12,
2890,
16,
1267,
2218,
2187,
8439,
2218,
2187,
1366,
4678,
33,
5510,
4672,
3536,
2479,
1719,
1267,
1779,
358,
326,
3956,
1119,
1156,
364,
28913,
3536,
309,
486,
365,
18,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
23422,
12,
2890,
16,
1267,
2218,
2187,
8439,
2218,
2187,
1366,
4678,
33,
5510,
4672,
3536,
2479,
1719,
1267,
1779,
358,
326,
3956,
1119,
1156,
364,
28913,
3536,
309,
486,
365,
18,
4... |
self.add_tag(t.get_name()) | self.add_tag(t) | def set_complex_title(self,text,tags=[]): due_date = no_date defer_date = no_date if text: # Get tags in the title #NOTE: the ?: tells regexp that the first one is # a non-capturing group, so it must not be returned # to findall. http://www.amk.ca/python/howto/regex/regex.html # ~~~~Invernizzi for match in re.findall(r'(?:^|[\s])(@\w+)', text): tags.append(GTG.core.tagstore.Tag(match, self.req)) # Remove the @ #text =text.replace(match,match[1:],1) # Get attributes regexp = r'([\s]*)([\w-]+):([^\s]+)' for spaces, attribute, args in re.findall(regexp, text): valid_attribute = True if attribute.lower() in ["tags", "tag"] or \ attribute.lower() in [_("tags"), _("tag")]: for tag in args.split(","): if not tag.startswith("@") : tag = "@"+tag tags.append(GTG.core.tagstore.Tag(tag, self.req)) elif attribute.lower() == "defer" or \ attribute.lower() == _("defer"): defer_date = get_canonical_date(args) if not defer_date: valid_attribute = False elif attribute.lower() == "due" or \ attribute.lower() == _("due"): due_date = get_canonical_date(args) if not due_date: valid_attribute = False else: # attribute is unknown valid_attribute = False if valid_attribute: # if the command is valid we have to remove it # from the task title text = \ text.replace("%s%s:%s" % (spaces, attribute, args), "") | 3d8b277c418bff1f6b0f289b58ca54e88972da4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/3d8b277c418bff1f6b0f289b58ca54e88972da4c/task.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14259,
67,
2649,
12,
2890,
16,
955,
16,
4156,
33,
8526,
4672,
6541,
67,
712,
273,
1158,
67,
712,
2220,
67,
712,
273,
1158,
67,
712,
309,
977,
30,
225,
468,
968,
2342,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
14259,
67,
2649,
12,
2890,
16,
955,
16,
4156,
33,
8526,
4672,
6541,
67,
712,
273,
1158,
67,
712,
2220,
67,
712,
273,
1158,
67,
712,
309,
977,
30,
225,
468,
968,
2342,
316,
... |
return S_OK(fstat) else: return S_ERROR(lfc.sstrerror(lfc.cvar.serrno)) def __getDNFromUID(self,userID): | return S_OK( fstat ) else: return S_ERROR( lfc.sstrerror( lfc.cvar.serrno ) ) def __getDNFromUID( self, userID ): | def __getPathStat(self,path='',guid=''): if path: path = '%s%s' % (self.prefix,path) fstat = lfc.lfc_filestatg() value = lfc.lfc_statg(path,guid,fstat) if value == 0: return S_OK(fstat) else: return S_ERROR(lfc.sstrerror(lfc.cvar.serrno)) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
743,
5000,
12,
2890,
16,
803,
2218,
2187,
14066,
2218,
11,
4672,
309,
589,
30,
589,
273,
1995,
87,
9,
87,
11,
738,
261,
2890,
18,
3239,
16,
803,
13,
284,
5642,
273,
328,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
743,
5000,
12,
2890,
16,
803,
2218,
2187,
14066,
2218,
11,
4672,
309,
589,
30,
589,
273,
1995,
87,
9,
87,
11,
738,
261,
2890,
18,
3239,
16,
803,
13,
284,
5642,
273,
328,
... |
def eb(err): | def eb(failure): | def eb(err): if cur: err.throwExceptionIntoGenerator(cur[0]) return err | 4d565b2305f09bcd50f88451251823d3afe24718 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/4d565b2305f09bcd50f88451251823d3afe24718/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
20371,
12,
12251,
4672,
309,
662,
30,
393,
18,
12849,
503,
5952,
3908,
12,
1397,
63,
20,
5717,
327,
393,
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,
20371,
12,
12251,
4672,
309,
662,
30,
393,
18,
12849,
503,
5952,
3908,
12,
1397,
63,
20,
5717,
327,
393,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, error_codes_mapper, codes=codes) | def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, error_codes_mapper, codes=codes) | def forward(app, codes): for code in codes: if not isinstance(code, int): raise TypeError('All status codes should be type int. ' '%s is not valid'%repr(code)) def error_codes_mapper(code, message, environ, global_conf, codes): if codes.has_key(code): return codes[code] else: return None return custom_forward(app, error_codes_mapper, codes=codes) | 22490c2d4a12c9768ccf8ed24cd6b378eee33e72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/22490c2d4a12c9768ccf8ed24cd6b378eee33e72/errordocument.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5104,
12,
2910,
16,
6198,
4672,
364,
981,
316,
6198,
30,
309,
486,
1549,
12,
710,
16,
509,
4672,
1002,
3580,
2668,
1595,
1267,
6198,
1410,
506,
618,
509,
18,
296,
1995,
87,
353,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5104,
12,
2910,
16,
6198,
4672,
364,
981,
316,
6198,
30,
309,
486,
1549,
12,
710,
16,
509,
4672,
1002,
3580,
2668,
1595,
1267,
6198,
1410,
506,
618,
509,
18,
296,
1995,
87,
353,
486,
... |
p1 = re.compile(r'\Declare(LaTeX|DocBook|LinuxDoc)Class') p2 = re.compile(r'^.*\DeclareLaTeXClass *(.*)') p3 = re.compile(r'^.*\DeclareDocBookClass *(.*)') p4 = re.compile(r'^.*\DeclareLinuxDocClass *(.*)') p5 = re.compile(r'\[([^,]*),[^]]*\]') p6 = re.compile('^{') p7 = re.compile(r'\[([^]]*)\] *{([^}]*)}') | def checkLatexConfig(check_config): ''' Explore the LaTeX configuration ''' print 'checking LaTeX configuration... ', # First, remove the files that we want to re-create removeFiles(['textclass.lst', 'packages.lst', 'chkconfig.sed']) # if not check_config: print ' default values' print '+checking list of textclasses... ' tx = open('textclass.lst', 'w') tx.write(''' | 7f6a2747424dc1ff1cce7f3c683da43ffed37724 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/7f6a2747424dc1ff1cce7f3c683da43ffed37724/configure.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6607,
338,
809,
12,
1893,
67,
1425,
4672,
9163,
7784,
383,
266,
326,
21072,
21575,
60,
1664,
9163,
1172,
296,
24609,
21072,
21575,
60,
1664,
2777,
2265,
468,
5783,
16,
1206,
326,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6607,
338,
809,
12,
1893,
67,
1425,
4672,
9163,
7784,
383,
266,
326,
21072,
21575,
60,
1664,
9163,
1172,
296,
24609,
21072,
21575,
60,
1664,
2777,
2265,
468,
5783,
16,
1206,
326,
13... | |
log.info("ExitList updated. Next update in %.1f seconds.", nextUpdate) reactor.callLater(nextUpdate, self.update) | if nextUpdate > 0: log.info("ExitList updated. Next update in %.1f seconds.", nextUpdate) reactor.callLater(nextUpdate, self.update) else: log.notice("Export file is not up-to-date. Trying again in 10 minutes.") reactor.callLater(10 * 60, self.update) | def update(self): next = self.el.update() nextUpdate = time.mktime(next.timetuple()) - time.time() log.info("ExitList updated. Next update in %.1f seconds.", nextUpdate) | 0e66f7ef61dbd94ae2d4ebcc5d508da539ac15e7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9986/0e66f7ef61dbd94ae2d4ebcc5d508da539ac15e7/dnsel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
1024,
273,
365,
18,
292,
18,
2725,
1435,
1024,
1891,
273,
813,
18,
24816,
957,
12,
4285,
18,
8584,
278,
2268,
10756,
300,
813,
18,
957,
1435,
613,
18,
1376,
2932,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
4672,
1024,
273,
365,
18,
292,
18,
2725,
1435,
1024,
1891,
273,
813,
18,
24816,
957,
12,
4285,
18,
8584,
278,
2268,
10756,
300,
813,
18,
957,
1435,
613,
18,
1376,
2932,... |
def __getpicklefile(self.path): | def __getpicklefile(self, path): | def __getpicklefile(self.path): return os.path.join(self.__picklepath, "p%s" % _slashre.sub('!', path)) | f368cc0a391519da9ebb05b15bba868745a44a87 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2304/f368cc0a391519da9ebb05b15bba868745a44a87/pickleProps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
20847,
768,
12,
2890,
16,
589,
4672,
327,
1140,
18,
803,
18,
5701,
12,
2890,
16186,
20847,
803,
16,
315,
84,
9,
87,
6,
738,
389,
12877,
266,
18,
1717,
2668,
5,
2187,
589,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
588,
20847,
768,
12,
2890,
16,
589,
4672,
327,
1140,
18,
803,
18,
5701,
12,
2890,
16186,
20847,
803,
16,
315,
84,
9,
87,
6,
738,
389,
12877,
266,
18,
1717,
2668,
5,
2187,
589,
... |
sage: sr = mq.SR(2,2,2,4) | sage: sr = mq.SR(2, 2, 2, 4) | def hex_str_vector(self, M): """ Return a one dimensional AES like representation of the matrix M. | 26b5b14a2a46b23848ccefac3b41425cf353e86a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/26b5b14a2a46b23848ccefac3b41425cf353e86a/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
701,
67,
7737,
12,
2890,
16,
490,
4672,
3536,
2000,
279,
1245,
17469,
15986,
3007,
4335,
434,
326,
3148,
490,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3827,
67,
701,
67,
7737,
12,
2890,
16,
490,
4672,
3536,
2000,
279,
1245,
17469,
15986,
3007,
4335,
434,
326,
3148,
490,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
rect = win32structures.RECT() win32functions.GetWindowRect(handle, byref(rect)) return rect | rect = win32structures.RECT() win32functions.GetWindowRect(handle, byref(rect)) return rect | def rectangle(handle): rect = win32structures.RECT() win32functions.GetWindowRect(handle, byref(rect)) return rect | 2bdae3a49fa9ad42a9628b8679eff4c2bbdb85df /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6953/2bdae3a49fa9ad42a9628b8679eff4c2bbdb85df/handleprops.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11845,
12,
4110,
4672,
4917,
273,
5657,
1578,
27979,
18,
4512,
1435,
5657,
1578,
10722,
18,
967,
3829,
6120,
12,
4110,
16,
12725,
12,
2607,
3719,
327,
4917,
225,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
11845,
12,
4110,
4672,
4917,
273,
5657,
1578,
27979,
18,
4512,
1435,
5657,
1578,
10722,
18,
967,
3829,
6120,
12,
4110,
16,
12725,
12,
2607,
3719,
327,
4917,
225,
2,
-100,
-100,
-100,
-10... |
force_update = True | force_load = True | def load_pages(force_update = False): for page, path in exclusion_file_list(): try: if not os.path.exists(path): print 'Creating file \'%s\' (%s)' % ( wikipedia.config.shortpath(path), page.aslink()) force_update = True else: file_age = time.time() - os.path.getmtime(path) if file_age > 24 * 60 * 60: print 'Updating file \'%s\' (%s)' % ( wikipedia.config.shortpath(path), page.aslink()) force_update = True except OSError: raise if force_update: data = None try: data = page.get() except KeyboardInterrupt: raise except wikipedia.IsRedirectPage, arg: data = page.getRedirectTarget().get() except: error('Getting page failed') if data: f = codecs.open(path, 'w', 'utf-8') f.write(data) f.close() return | e8580311da32621d1a5295ed08c368281d379fc5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/e8580311da32621d1a5295ed08c368281d379fc5/copyright.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
7267,
12,
5734,
67,
2725,
273,
1083,
4672,
364,
1363,
16,
589,
316,
21244,
67,
768,
67,
1098,
13332,
775,
30,
309,
486,
1140,
18,
803,
18,
1808,
12,
803,
4672,
1172,
296,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
7267,
12,
5734,
67,
2725,
273,
1083,
4672,
364,
1363,
16,
589,
316,
21244,
67,
768,
67,
1098,
13332,
775,
30,
309,
486,
1140,
18,
803,
18,
1808,
12,
803,
4672,
1172,
296,
1... |
categories = self.browse(cursor, user, ids, context=context) for category in categories: if category.parent: name = category.parent.name+' / '+ category.name | def _name(category): if category.id in res: return res[category.id] elif category.parent: return _name(category.parent) + ' / ' + category.name | def get_rec_name(self, cursor, user, ids, name, arg, context=None): if not ids: return {} res = {} categories = self.browse(cursor, user, ids, context=context) for category in categories: if category.parent: name = category.parent.name+' / '+ category.name else: name = category.name res[category.id] = name return res | ae1b78bdf7f4c89a701c31aee42ad16a89ce9013 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9285/ae1b78bdf7f4c89a701c31aee42ad16a89ce9013/category.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3927,
67,
529,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
486,
3258,
30,
327,
2618,
400,
273,
2618,
1652,
389,
529,
12,
4743,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3927,
67,
529,
12,
2890,
16,
3347,
16,
729,
16,
3258,
16,
508,
16,
1501,
16,
819,
33,
7036,
4672,
309,
486,
3258,
30,
327,
2618,
400,
273,
2618,
1652,
389,
529,
12,
4743,
... |
return self.http_error_auth_reqed('proxy-authenticate', | response = self.http_error_auth_reqed('proxy-authenticate', | def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in # authority. Assume there isn't one, since urllib.request does not (and # should not, RFC 3986 s. 3.2.1) support requests for URLs containing # userinfo. authority = req.host return self.http_error_auth_reqed('proxy-authenticate', authority, req, headers) | d381e177aa0fcffa5fb5322069fb388049ef0a43 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/d381e177aa0fcffa5fb5322069fb388049ef0a43/request.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
7132,
27,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
468,
1062,
67,
1636,
67,
1944,
67,
3658,
329,
4991,
716,
1915,
353,
1158,
18297,
1794,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
7132,
27,
12,
2890,
16,
1111,
16,
4253,
16,
981,
16,
1234,
16,
1607,
4672,
468,
1062,
67,
1636,
67,
1944,
67,
3658,
329,
4991,
716,
1915,
353,
1158,
18297,
1794,
... |
_fl_finish = cfuncproto(so_libforms, "fl_finish", None, [], | _fl_finish = cfuncproto(so_libforms, "fl_finish", None, [], | def fl_initialize(lsysargv, sysargv, appclass, appopt, nappopt): """ fl_initialize(num_args, args, appl_class, appl_options, num_appl_opts) -> display """ # to verify if installed XForms is compatible verify_version_compatibility() lsysargv = 1 argum = "".join(sysargv) cli_args_nr = cty.c_int(lsysargv) #1 cli_args_nr_p = cty.byref(cli_args_nr) cli_args = cty.c_char_p(argum) # " " structopts = cty.POINTER(FL_CMD_OPT)() retval = _fl_initialize(cli_args_nr_p, cli_args, appclass, structopts, nappopt) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
11160,
12,
3251,
1900,
19485,
16,
2589,
19485,
16,
595,
1106,
16,
595,
3838,
16,
27133,
1631,
337,
4672,
3536,
1183,
67,
11160,
12,
2107,
67,
1968,
16,
833,
16,
27808,
67,
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,
1183,
67,
11160,
12,
3251,
1900,
19485,
16,
2589,
19485,
16,
595,
1106,
16,
595,
3838,
16,
27133,
1631,
337,
4672,
3536,
1183,
67,
11160,
12,
2107,
67,
1968,
16,
833,
16,
27808,
67,
11... |
def has_node(self, path, rev): | def has_node(self, path, rev=None): | def has_node(self, path, rev): """ Tell if there's a node at the specified (path,rev) combination. """ try: self.get_node() return True except TracError: return False | c6469e6bb3d62446f80b828ec2526f0707dcdeab /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/c6469e6bb3d62446f80b828ec2526f0707dcdeab/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
2159,
12,
2890,
16,
589,
16,
5588,
33,
7036,
4672,
3536,
29860,
309,
1915,
1807,
279,
756,
622,
326,
1269,
261,
803,
16,
9083,
13,
10702,
18,
3536,
775,
30,
365,
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,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
711,
67,
2159,
12,
2890,
16,
589,
16,
5588,
33,
7036,
4672,
3536,
29860,
309,
1915,
1807,
279,
756,
622,
326,
1269,
261,
803,
16,
9083,
13,
10702,
18,
3536,
775,
30,
365,
18,
588,
67... |
'''Toggle recording''' | """ Toggles recording. If there's an error, a warning/error message is issued to the user. Parameters: widget -- reserved for GTK callbacks, don't use it explicitly. """ | def Record(self, widget=None): '''Toggle recording''' # toggling the record button invokes this function so we use the settingButtons var to # indicate that we're just changing the GUI state and dont need to do anything code-wise if self.settingButtons: return if self.isRecording: self.project.stop() self.addInstrumentButton.set_sensitive(True) return canRecord = False for i in self.project.instruments: if i.isArmed: canRecord = True | d98c0166f58a20c11dd843ed644fda9b8e03dc8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/d98c0166f58a20c11dd843ed644fda9b8e03dc8b/JokosherApp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5059,
12,
2890,
16,
3604,
33,
7036,
4672,
3536,
399,
23972,
1040,
14949,
18,
971,
1915,
1807,
392,
555,
16,
279,
3436,
19,
1636,
883,
353,
16865,
358,
326,
729,
18,
225,
7012,
30,
3604... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5059,
12,
2890,
16,
3604,
33,
7036,
4672,
3536,
399,
23972,
1040,
14949,
18,
971,
1915,
1807,
392,
555,
16,
279,
3436,
19,
1636,
883,
353,
16865,
358,
326,
729,
18,
225,
7012,
30,
3604... |
"virStream"] | "virStream", "virDomainSnapshot"] | def buildStubs(): global py_types global py_return_types global unknown_types try: f = open(os.path.join(srcPref,"libvirt-api.xml")) data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: try: f = open(os.path.join(srcPref,"..","docs","libvirt-api.xml")) data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg sys.exit(1) n = len(functions.keys()) print "Found %d functions in libvirt-api.xml" % (n) py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject") try: f = open(os.path.join(srcPref,"libvirt-override-api.xml")) data = f.read() (parser, target) = getparser() parser.feed(data) parser.close() except IOError, msg: print file, ":", msg print "Found %d functions in libvirt-override-api.xml" % ( len(functions.keys()) - n) nb_wrap = 0 failed = 0 skipped = 0 include = open("libvirt.h", "w") include.write("/* Generated */\n\n") export = open("libvirt-export.c", "w") export.write("/* Generated */\n\n") wrapper = open("libvirt.c", "w") wrapper.write("/* Generated */\n\n") wrapper.write("#include <Python.h>\n") wrapper.write("#include <libvirt/libvirt.h>\n") wrapper.write("#include \"typewrappers.h\"\n") wrapper.write("#include \"libvirt.h\"\n\n") for function in functions.keys(): ret = print_function_wrapper(function, wrapper, export, include) if ret < 0: failed = failed + 1 functions_failed.append(function) del functions[function] if ret == 0: skipped = skipped + 1 functions_skipped.append(function) del functions[function] if ret == 1: nb_wrap = nb_wrap + 1 include.close() export.close() wrapper.close() print "Generated %d wrapper functions" % nb_wrap print "Missing type converters: " for type in unknown_types.keys(): print "%s:%d " % (type, len(unknown_types[type])), print for f in functions_failed: print "ERROR: failed %s" % f if failed > 0: return -1 return 0 | 37f24b06c0f96539f8964e0b41010f4ebe514f5f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8293/37f24b06c0f96539f8964e0b41010f4ebe514f5f/generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
11974,
87,
13332,
2552,
2395,
67,
2352,
2552,
2395,
67,
2463,
67,
2352,
2552,
5917,
67,
2352,
225,
775,
30,
284,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
4816,
23218,
10837,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
11974,
87,
13332,
2552,
2395,
67,
2352,
2552,
2395,
67,
2463,
67,
2352,
2552,
5917,
67,
2352,
225,
775,
30,
284,
273,
1696,
12,
538,
18,
803,
18,
5701,
12,
4816,
23218,
10837,
29... |
Either `QQ` or `RDF`. Raises `TypeError` if `other` is not a | Either `\QQ` or `RDF`. Raises ``TypeError`` if ``other`` is not a | def coerce_field(self, other): """ Return the number type that contains both `self.field()` and `other`. | 6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/6f5d9d004aadaa2ef31b928e21f139a72b5e9ce0/polyhedra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12270,
67,
1518,
12,
2890,
16,
1308,
4672,
3536,
2000,
326,
1300,
618,
716,
1914,
3937,
1375,
2890,
18,
1518,
20338,
471,
1375,
3011,
8338,
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,
12270,
67,
1518,
12,
2890,
16,
1308,
4672,
3536,
2000,
326,
1300,
618,
716,
1914,
3937,
1375,
2890,
18,
1518,
20338,
471,
1375,
3011,
8338,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
structure. It treats these 'holes' as unnamed arrays of bytes. | structure. It treats these 'holes' as unnamed arrays of bytes. | def GetFirstMember(sid): """ Get offset of the first member of a structure @param sid: structure type ID @return: -1 if bad structure type ID is passed or structure has no members otherwise returns offset of the first member. @note: IDA allows 'holes' between members of a structure. It treats these 'holes' as unnamed arrays of bytes. """ s = idaapi.get_struc(sid) if not s: return -1 return idaapi.get_struc_first_offset(s) | b4e25f451affe08a6e318876abc65c2d4bf738a0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/b4e25f451affe08a6e318876abc65c2d4bf738a0/idc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3759,
4419,
12,
7453,
4672,
3536,
968,
1384,
434,
326,
1122,
3140,
434,
279,
3695,
225,
632,
891,
7348,
30,
3695,
618,
1599,
225,
632,
2463,
30,
300,
21,
309,
5570,
3695,
618,
159... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
3759,
4419,
12,
7453,
4672,
3536,
968,
1384,
434,
326,
1122,
3140,
434,
279,
3695,
225,
632,
891,
7348,
30,
3695,
618,
1599,
225,
632,
2463,
30,
300,
21,
309,
5570,
3695,
618,
159... |
self.gctrack() | def setUp(self): self.pipeline = gst.parse_launch('fakesrc name=source ! fakesink') src = self.pipeline.get_by_name('source') self.srcpad = src.get_pad('src') self.gctrack() | ca1cb51d1abd8d3e44b0947fb497ec96d2d54736 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1020/ca1cb51d1abd8d3e44b0947fb497ec96d2d54736/test_pad.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
365,
18,
14511,
273,
314,
334,
18,
2670,
67,
20738,
2668,
507,
79,
281,
1310,
508,
33,
3168,
401,
284,
3223,
754,
6134,
1705,
273,
365,
18,
14511,
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,
24292,
12,
2890,
4672,
365,
18,
14511,
273,
314,
334,
18,
2670,
67,
20738,
2668,
507,
79,
281,
1310,
508,
33,
3168,
401,
284,
3223,
754,
6134,
1705,
273,
365,
18,
14511,
18,
588,
67,
... | |
self._required_members = _LUTHandler.required_members | self._required_members = _LUTHandler.required_members[:] | def __init__(self, dim, id, base, name, attrs): SimpleHandler.__init__(self, id, base, name, attrs) self._method = attrs.get("method", "linear") self._required_members = _LUTHandler.required_members for i in range(dim): self._required_members.append("Breaks%d" % i) self._dim = dim self._keys = {} | d458b1c0e28df7c44c8735a6eef2db97db58767c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/d458b1c0e28df7c44c8735a6eef2db97db58767c/Parse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2464,
16,
612,
16,
1026,
16,
508,
16,
3422,
4672,
4477,
1503,
16186,
2738,
972,
12,
2890,
16,
612,
16,
1026,
16,
508,
16,
3422,
13,
365,
6315,
2039,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2464,
16,
612,
16,
1026,
16,
508,
16,
3422,
4672,
4477,
1503,
16186,
2738,
972,
12,
2890,
16,
612,
16,
1026,
16,
508,
16,
3422,
13,
365,
6315,
2039,
27... |
self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | pass | def __init__(self, about=None, meta=None, label=None, id=None, cell=None, valueOf_=None, mixedclass_=None, content_=None): super(CellSet, self).__init__(about, meta, label, id, valueOf_, mixedclass_, content_, ) self.cell = _cast(None, cell) self.valueOf_ = valueOf_ if mixedclass_ is None: self.mixedclass_ = MixedContainer else: self.mixedclass_ = mixedclass_ if content_ is None: self.content_ = [] else: self.content_ = content_ self.valueOf_ = valueOf_ | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
2484,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2973,
33,
7036,
16,
2191,
33,
7036,
16,
1433,
33,
7036,
16,
612,
33,
7036,
16,
2484,
33,
7036,
16,
4323,
67,
33,
7036,
16,
7826,
1106,
67,
33,
7036,
... |
def checkout(self, dest): | def obtain(self, dest): | def checkout(self, dest): url, rev = self.get_url_rev() if rev: rev_options = ['-r', rev] rev_display = ' (to revision %s)' % rev else: rev_options = [] rev_display = '' checkout = True if os.path.exists(os.path.join(dest, '.svn')): existing_url = self.get_info(dest)[0] checkout = False if existing_url == url: logger.info('Checkout in %s exists, and has correct URL (%s)' % (display_path(dest), url)) logger.notify('Updating checkout %s%s' % (display_path(dest), rev_display)) call_subprocess( ['svn', 'update'] + rev_options + [dest]) else: logger.warn('svn checkout in %s exists with URL %s' % (display_path(dest), existing_url)) logger.warn('The plan is to install the svn repository %s' % url) response = ask('What to do? (s)witch, (i)gnore, (w)ipe, (b)ackup ', ('s', 'i', 'w', 'b')) if response == 's': logger.notify('Switching checkout %s to %s%s' % (display_path(dest), url, rev_display)) call_subprocess( ['svn', 'switch'] + rev_options + [url, dest]) elif response == 'i': # do nothing pass elif response == 'w': logger.warn('Deleting %s' % display_path(dest)) shutil.rmtree(dest) checkout = True elif response == 'b': dest_dir = backup_dir(dest) logger.warn('Backing up %s to %s' % display_path(dest, dest_dir)) shutil.move(dest, dest_dir) checkout = True if checkout: logger.notify('Checking out %s%s to %s' % (url, rev_display, display_path(dest))) call_subprocess( ['svn', 'checkout', '-q'] + rev_options + [url, dest]) | 404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/404ce4d68b7ccae8baf7b8e9c98d76c7210aa5aa/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
10228,
17,
86,
2187,
5588,
65,
5588,
67,
5417,
273,
296... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7161,
12,
2890,
16,
1570,
4672,
880,
16,
5588,
273,
365,
18,
588,
67,
718,
67,
9083,
1435,
309,
5588,
30,
5588,
67,
2116,
273,
10228,
17,
86,
2187,
5588,
65,
5588,
67,
5417,
273,
296... |
print "* som /som :",div_ncerr(som1,som2) print "* som /so :",div_ncerr(som1,som1[0]) print "* so /som :",div_ncerr(som1[0],som1) print "* som /scal:",div_ncerr(som1,(2,1)) print "* scal/som :",div_ncerr((2,1),som1) print "* so /so :",div_ncerr(som1[0],som1[1]) print "* so /scal:",div_ncerr(som1[0],(2,1)) print "* scal/so :",div_ncerr((2,1),som1[0]) | print "* som /som :", div_ncerr(som1, som2) print "* som /so :", div_ncerr(som1, som1[0]) print "* so /som :", div_ncerr(som1[0], som1) print "* som /scal:", div_ncerr(som1, (2, 1)) print "* scal/som :", div_ncerr((2, 1), som1) print "* so /so :", div_ncerr(som1[0], som1[1]) print "* so /scal:", div_ncerr(som1[0], (2, 1)) print "* scal/so :", div_ncerr((2, 1), som1[0]) | def div_ncerr(left, right, **kwargs): """ This function divides two objects (SOM, SO or tuple[val,val_err2]) and returns the result of the division in an SOM. The function does not handle the case of tuple/tuple. Parameters: ---------- -> left Object on the left of the division sign -> right Object on the right of the division sign -> kwargs is a list of key word arguments that the function accepts: axis=<y or x> This is the axis one wishes to manipulate. If no argument is given the default value is y axis_pos=<number> This is position of the axis in the axis array. If no argument is given, the default value is 0 Returns: ------- <- A SOM or SO containing the results of the division Exceptions: ---------- <- TypeError is raised if the tuple/tuple case is presented to the function <- IndexError is raised if the two SOMs do not contain the same number of spectra <- RunTimeError is raised if the x-axis units of the SOMs do not match <- RunTimeError is raised if the y-axis units of the SOMs do not match <- RunTimeError is raised if the x-axes of the two SOs are not equal """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(left,right) (l_descr,r_descr)=hlr_utils.get_descr(left,right) # error check information if r_descr=="SOM" and l_descr=="SOM": hlr_utils.hlr_math_compatible(left,l_descr,right,r_descr) elif l_descr=="number" and r_descr=="number": raise RuntimeError, "tuple, tuple operation is not supported!" else: pass # Check for axis keyword argument try: axis = kwargs["axis"] except KeyError: axis = "y" # Check for axis_pos keyword argument try: axis_pos = kwargs["axis_pos"] except KeyError: axis_pos = 0 result=hlr_utils.copy_som_attr(result,res_descr,left,l_descr,right,r_descr) # iterate through the values import array_manip for i in range(hlr_utils.get_length(left,right)): val1 = hlr_utils.get_value(left, i, l_descr, axis, axis_pos) err2_1 = hlr_utils.get_err2(left, i, l_descr, axis, axis_pos) val2 = hlr_utils.get_value(right, i, r_descr, axis, axis_pos) err2_2 = hlr_utils.get_err2(right, i, r_descr, axis, axis_pos) (descr_1,descr_2)=hlr_utils.get_descr(val1, val2) hlr_utils.hlr_math_compatible(val1, descr_1, val2, descr_2) value = array_manip.div_ncerr(val1, err2_1, val2, err2_2) map_so = hlr_utils.get_map_so(left,right,i) hlr_utils.result_insert(result, res_descr, value, map_so, axis, axis_pos) return result | 8b5bb0bc0b961242500a156041e567f572942fc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8b5bb0bc0b961242500a156041e567f572942fc3/hlr_div_ncerr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3739,
67,
14202,
370,
12,
4482,
16,
2145,
16,
2826,
4333,
4672,
3536,
1220,
445,
3739,
4369,
2795,
2184,
261,
55,
1872,
16,
7460,
578,
3193,
63,
1125,
16,
1125,
67,
370,
22,
5717,
471,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3739,
67,
14202,
370,
12,
4482,
16,
2145,
16,
2826,
4333,
4672,
3536,
1220,
445,
3739,
4369,
2795,
2184,
261,
55,
1872,
16,
7460,
578,
3193,
63,
1125,
16,
1125,
67,
370,
22,
5717,
471,... |
return self.open(newurl, data) | if data is None: return self.open(newurl) else: return self.open(newurl, data) | def http_error_302(self, url, fp, errcode, errmsg, headers, data=None): # XXX The server can force infinite recursion here! if headers.has_key('location'): newurl = headers['location'] elif headers.has_key('uri'): newurl = headers['uri'] else: return void = fp.read() fp.close() # In case the server sent a relative URL, join with original: newurl = basejoin("http:" + url, newurl) return self.open(newurl, data) | 3eecb974f9c7631df1e540e3061ea03edb43a813 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3eecb974f9c7631df1e540e3061ea03edb43a813/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1062,
67,
1636,
67,
23,
3103,
12,
2890,
16,
880,
16,
4253,
16,
393,
710,
16,
17460,
16,
1607,
16,
501,
33,
7036,
4672,
468,
11329,
1021,
1438,
848,
2944,
14853,
13917,
2674,
5,
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,
1062,
67,
1636,
67,
23,
3103,
12,
2890,
16,
880,
16,
4253,
16,
393,
710,
16,
17460,
16,
1607,
16,
501,
33,
7036,
4672,
468,
11329,
1021,
1438,
848,
2944,
14853,
13917,
2674,
5,
309,
... |
variables x,y:: | variables `x`, `y`:: | def contour_plot(f, xrange, yrange, **options): r""" ``contour_plot`` takes a function of two variables, `f(x,y)` and plots contour lines of the function over the specified ``xrange`` and ``yrange`` as demonstrated below. ``contour_plot(f, (xmin, xmax), (ymin, ymax), ...)`` INPUT: - ``f`` -- a function of two variables - ``(xmin, xmax)`` -- 2-tuple, the range of ``x`` values OR 3-tuple ``(x,xmin,xmax)`` - ``(ymin, ymax)`` -- 2-tuple, the range of ``y`` values OR 3-tuple ``(y,ymin,ymax)`` The following inputs must all be passed in as named parameters: - ``plot_points`` -- integer (default: 100); number of points to plot in each direction of the grid. For old computers, 25 is fine, but should not be used to verify specific intersection points. - ``fill`` -- bool (default: ``True``), whether to color in the area between contour lines - ``cmap`` -- a colormap (default: ``'gray'``), the name of a predefined colormap, a list of colors or an instance of a matplotlib Colormap. Type: ``import matplotlib.cm; matplotlib.cm.datad.keys()`` for available colormap names. - ``contours`` -- integer or list of numbers (default: ``None``): If a list of numbers is given, then this specifies the contour levels to use. If an integer is given, then this many contour lines are used, but the exact levels are determined automatically. If ``None`` is passed (or the option is not given), then the number of contour lines is determined automatically, and is usually about 5. - ``linewidths`` -- integer or list of integer (default: None), if a single integer all levels will be of the width given, otherwise the levels will be plotted with the width in the order given. If the list is shorter than the number of contours, then the widths will be repeated cyclically. - ``linestyles`` -- string or list of strings (default: None), the style of the lines to be plotted, one of: solid, dashed, dashdot, or dotted. If the list is shorter than the number of contours, then the styles will be repeated cyclically. - ``labels`` -- boolean (default: False) Show level labels or not. The following options are to adjust the style and placement of labels, they have no effect if no labels are shown. - ``label_fontsize`` -- integer (default: 9), the font size of the labels. - ``label_colors`` -- string or sequence of colors (default: None) If a string, gives the name of a single color with which to draw all labels. If a sequence, gives the colors of the labels. A color is a string giving the name of one or a 3-tuple of floats. - ``label_inline`` -- boolean (default: False if fill is True, otherwise True), controls whether the underlying contour is removed or not. - ``label_inline_spacing`` -- integer (default: 3), When inline, this is the amount of contour that is removed from each side, in pixels. - ``label_fmt`` -- a format string (default: "%1.2f"), this is used to get the label text from the level. This can also be a dictionary with the contour levels as keys and corresponding text string labels as values. EXAMPLES: Here we plot a simple function of two variables. Note that since the input function is an expression, we need to explicitly declare the variables in 3-tuples for the range:: sage: x,y = var('x,y') sage: contour_plot(cos(x^2+y^2), (x, -4, 4), (y, -4, 4)) Here we change the ranges and add some options:: sage: x,y = var('x,y') sage: contour_plot((x^2)*cos(x*y), (x, -10, 5), (y, -5, 5), fill=False, plot_points=150) An even more complicated plot:: sage: x,y = var('x,y') sage: contour_plot(sin(x^2 + y^2)*cos(x)*sin(y), (x, -4, 4), (y, -4, 4),plot_points=150) Some elliptic curves, but with symbolic endpoints. In the first example, the plot is rotated 90 degrees because we switch the variables x,y:: sage: x,y = var('x,y') sage: contour_plot(y^2 + 1 - x^3 - x, (y,-pi,pi), (x,-pi,pi)) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi)) We can play with the contour levels:: sage: x,y = var('x,y') sage: f(x,y) = x^2 + y^2 sage: contour_plot(f, (-2, 2), (-2, 2)) sage: contour_plot(f, (-2, 2), (-2, 2), contours=2, cmap=[(1,0,0), (0,1,0), (0,0,1)]) sage: contour_plot(f, (-2, 2), (-2, 2), contours=(0.1, 1.0, 1.2, 1.4), cmap='hsv') sage: contour_plot(f, (-2, 2), (-2, 2), contours=(1.0,), fill=False, aspect_ratio=1) sage: contour_plot(x-y^2,(x,-5,5),(y,-3,3),contours=[-4,0,1]) We can change the style of the lines:: sage: contour_plot(f, (-2,2), (-2,2), fill=False, linewidths=10) sage: contour_plot(f, (-2,2), (-2,2), fill=False, linestyles='dashdot') sage: contour_plot(x^2-y^2,(x,-3,3),(y,-3,3),contours=[0,1,2,3,4],linewidths=[1,5],linestyles=['solid','dashed'],fill=False) sage: contour_plot(x^2-y^2,(x,-3,3),(y,-3,3),contours=[0,1,2,3,4],linewidths=[1,5],linestyles=['solid','dashed']) We can add labels and play with them:: sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_fmt="%1.0f", label_colors='black') sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, contours=[-4,0,4], label_fmt={-4:"low", 0:"medium", 4: "hi"}, label_colors='black') sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_fontsize=18) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_inline_spacing=1) sage: contour_plot(y^2 + 1 - x^3 - x, (x,-pi,pi), (y,-pi,pi), fill=False, cmap='hsv', labels=True, label_inline=False) If fill is True (the default), then we may have to color the labels so that we can see them:: sage: contour_plot(f, (-2,2), (-2,2), labels=True, label_colors='red') This should plot concentric circles centered at the origin:: sage: x,y = var('x,y') sage: contour_plot(x^2+y^2-2,(x,-1,1), (y,-1,1)).show(aspect_ratio=1) Extra options will get passed on to show(), as long as they are valid:: sage: f(x, y) = cos(x) + sin(y) sage: contour_plot(f, (0, pi), (0, pi), axes=True) sage: contour_plot(f, (0, pi), (0, pi)).show(axes=True) # These are equivalent Note that with ``fill=False`` and grayscale contours, there is the possibility of confusion between the contours and the axes, so use ``fill=False`` together with ``axes=True`` with caution:: sage: contour_plot(f, (-pi, pi), (-pi, pi), fill=False, axes=True) TESTS: To check that ticket 5221 is fixed, note that this has three curves, not two:: sage: x,y = var('x,y') sage: contour_plot(x-y^2,(x,-5,5),(y,-3,3),contours=[-4,-2,0], fill=False) """ from sage.plot.plot import Graphics from sage.plot.misc import setup_for_eval_on_grid g, ranges = setup_for_eval_on_grid([f], [xrange, yrange], options['plot_points']) g = g[0] xrange,yrange=[r[:2] for r in ranges] xy_data_array = [[g(x, y) for x in xsrange(*ranges[0], include_endpoint=True)] for y in xsrange(*ranges[1], include_endpoint=True)] g = Graphics() g._set_extra_kwds(Graphics._extract_kwds_for_show(options, ignore=['xmin', 'xmax'])) g.add_primitive(ContourPlot(xy_data_array, xrange, yrange, options)) return g | 1be89942e80d3d044db8b1d126931ba7f5a875fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/1be89942e80d3d044db8b1d126931ba7f5a875fb/contour_plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
12176,
1213,
477,
67,
4032,
10335,
5530,
279,
445,
434,
2795,
3152,
16,
1375,
74,
12,
92,
16,
93,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
15332,
67,
4032,
12,
74,
16,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
12176,
1213,
477,
67,
4032,
10335,
5530,
279,
445,
434,
2795,
3152,
16,
1375,
74,
12,
92,
16,
93,
... |
<a\s+href="/etext/(?P<etext2>.*?)"> | <a\s+href="/[^/]+/(?P<etext2>\d+)/?"> | def _strip_tags(snippet): snippet = snippet.replace(" ", " ") snippet = snippet.replace(""", "\"") snippet = snippet.replace("\r", " ") snippet = snippet.replace("\n", " ") snippet = snippet.replace("<br>", "\n") snippet = snippet.replace("<li>", "\n") return _TAG_RE.subn('', snippet)[0] | 31dd086c8d900d52a3b2356457051a42c54db006 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14744/31dd086c8d900d52a3b2356457051a42c54db006/gutenbergweb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6406,
67,
4156,
12,
25788,
4672,
13016,
273,
13016,
18,
2079,
2932,
10,
10600,
31,
3113,
315,
9369,
13016,
273,
13016,
18,
2079,
2932,
10,
9270,
31,
3113,
11143,
13,
13016,
273,
130... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6406,
67,
4156,
12,
25788,
4672,
13016,
273,
13016,
18,
2079,
2932,
10,
10600,
31,
3113,
315,
9369,
13016,
273,
13016,
18,
2079,
2932,
10,
9270,
31,
3113,
11143,
13,
13016,
273,
130... |
QSIZE = 16 TIME = 5 | format = SV.RGB8_FRAMES qsize = 2 | def main(): QSIZE = 16 TIME = 5 audio = 0 num, den = 1, 1 opts, args = getopt.getopt(sys.argv[1:], 'aq:r:t:') for opt, arg in opts: if opt == '-a': audio = 1 elif opt == '-q': QSIZE = string.atoi(arg) elif opt == '-r': [nstr, dstr] = string.splitfields(arg, '/') num, den = string.atoi(nstr), string.atoi(dstr) elif opt == '-t': TIME = string.atoi(arg) if args[2:]: sys.stderr.write('usage: Vrec [options] [file [audiofile]]\n') sys.exit(2) if args: filename = args[0] else: filename = 'film.video' if args[1:] and not audio: sys.stderr.write('-a turned on by appearance of 2nd file\n') audio = 1 if audio: if args[1:]: audiofilename = args[1] else: audiofilename = 'film.aiff' else: audiofilename = None gl.foreground() x, y = SV.PAL_XMAX / 4, SV.PAL_YMAX / 4 print x, 'x', y gl.minsize(40, 30) gl.stepunit(8, 6) gl.maxsize(SV.PAL_XMAX, SV.PAL_YMAX) gl.keepaspect(SV.PAL_XMAX, SV.PAL_YMAX) win = gl.winopen(filename) x, y = gl.getsize() print x, 'x', y v = sv.OpenVideo() v.BindGLWindow(win, SV.IN_REPLACE) v.SetSize(x, y) v.BindGLWindow(win, SV.IN_REPLACE) v.SetCaptureFormat(SV.RGB_FRAMES) v.SetCaptureMode(SV.BLOCKING_CAPTURE) v.SetQueueSize(QSIZE) v.InitCapture() if v.GetQueueSize() != QSIZE: QSIZE = v.GetQueueSize() print 'Warning: QSIZE reduced to', QSIZE | 62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/62f6bc8e55ef2d0e226b1c3ad7b9aca58407ab7a/Vrec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
740,
273,
29537,
18,
11343,
28,
67,
15072,
55,
1043,
1467,
273,
576,
7447,
273,
374,
818,
16,
5545,
273,
404,
16,
404,
225,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
740,
273,
29537,
18,
11343,
28,
67,
15072,
55,
1043,
1467,
273,
576,
7447,
273,
374,
818,
16,
5545,
273,
404,
16,
404,
225,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
... |
import traceback | def reader(lnum=[lnum]): highlight[lnum[0]] = 1 try: return linecache.getline(file, lnum[0]) finally: lnum[0] += 1 | 09adc182bec2333c33693ed33586acc2848b097c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/09adc182bec2333c33693ed33586acc2848b097c/cgitb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2949,
12,
80,
2107,
22850,
80,
2107,
65,
4672,
8839,
63,
80,
2107,
63,
20,
13563,
273,
404,
775,
30,
327,
4739,
557,
807,
18,
588,
1369,
12,
768,
16,
328,
2107,
63,
20,
5717,
3095,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2949,
12,
80,
2107,
22850,
80,
2107,
65,
4672,
8839,
63,
80,
2107,
63,
20,
13563,
273,
404,
775,
30,
327,
4739,
557,
807,
18,
588,
1369,
12,
768,
16,
328,
2107,
63,
20,
5717,
3095,
... | |
0.83373002513114902 - 0.98889770576286506*I | 0.833730025131149 - 0.988897705762865*I | def cos(self): """ EXAMPLES: sage: (1+I).cos() 0.83373002513114902 - 0.98889770576286506*I """ return self.parent()(self._pari_().cos()) | 193380da4580283517e8b5d85f0bf8d1c6d47fce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/193380da4580283517e8b5d85f0bf8d1c6d47fce/complex_number.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4987,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
14445,
1435,
374,
18,
28,
3707,
9036,
713,
2947,
3437,
2499,
7616,
300,
374,
18,
29,
5482,
6675,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4987,
12,
2890,
4672,
3536,
5675,
8900,
11386,
30,
272,
410,
30,
261,
21,
15,
45,
2934,
14445,
1435,
374,
18,
28,
3707,
9036,
713,
2947,
3437,
2499,
7616,
300,
374,
18,
29,
5482,
6675,... |
scons: warning: Support for pre-2.2 Python (%s) is deprecated. | scons: warning: Support for pre-2.4 Python (%s) is deprecated. | def deprecated_python_version(version=sys.version_info): return version < (2, 2, 0) | cb2754c7467be7fe19102326d3bb497ab2192f7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12817/cb2754c7467be7fe19102326d3bb497ab2192f7d/TestSCons.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6849,
67,
8103,
67,
1589,
12,
1589,
33,
9499,
18,
1589,
67,
1376,
4672,
327,
1177,
411,
261,
22,
16,
576,
16,
374,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6849,
67,
8103,
67,
1589,
12,
1589,
33,
9499,
18,
1589,
67,
1376,
4672,
327,
1177,
411,
261,
22,
16,
576,
16,
374,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.unique_md_filenames | conf.unique_md_filenames = True | def _makeMetadata(self, path, cachedir, comps=False, repoview=False, repoviewtitle=False, baseurl=False, output=False, basedir=False, split=False, update=True): """Create repodata and repoview.""" conf = createrepo.MetaDataConfig() conf.cachedir = os.path.join(cachedir, 'createrepocache') conf.update = update self.unique_md_filenames if output: conf.outputdir = output else: conf.outputdir = path conf.directory = path conf.database = True if comps: conf.groupfile = comps if basedir: conf.basedir = basedir if baseurl: conf.baseurl = baseurl if split: conf.split = True conf.directories = split repomatic = createrepo.SplitMetaDataGenerator(conf) else: repomatic = createrepo.MetaDataGenerator(conf) self.logger.info('Making repodata') repomatic.doPkgMetadata() repomatic.doRepoMetadata() repomatic.doFinalMove() if repoview: # setup the repoview call repoview = ['/usr/bin/repoview'] repoview.append('--quiet') repoview.append('--state-dir') repoview.append(os.path.join(cachedir, 'repoviewcache')) if repoviewtitle: repoview.append('--title') repoview.append(repoviewtitle) repoview.append(path) # run the command pypungi.util._doRunCommand(repoview, self.logger) | 6843a12485a57be4bddb59c7d5fa0d1c17e82e1c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8489/6843a12485a57be4bddb59c7d5fa0d1c17e82e1c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
2277,
12,
2890,
16,
589,
16,
3472,
481,
16,
13979,
33,
8381,
16,
3538,
1945,
33,
8381,
16,
3538,
1945,
2649,
33,
8381,
16,
25427,
33,
8381,
16,
876,
33,
8381,
16,
15573,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
2277,
12,
2890,
16,
589,
16,
3472,
481,
16,
13979,
33,
8381,
16,
3538,
1945,
33,
8381,
16,
3538,
1945,
2649,
33,
8381,
16,
25427,
33,
8381,
16,
876,
33,
8381,
16,
15573,
3... |
_fl_set_gc_clipping = cfuncproto(so_libforms, "fl_set_gc_clipping", None, [GC, FL_Coord, FL_Coord, FL_Coord, FL_Coord], | _fl_set_gc_clipping = cfuncproto(so_libforms, "fl_set_gc_clipping", None, [GC, FL_Coord, FL_Coord, FL_Coord, FL_Coord], | def fl_set_clipping(x, y, w, h): """ fl_set_clipping(x, y, w, h) """ _fl_set_clipping(x, y, w, h) | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
14161,
1382,
12,
92,
16,
677,
16,
341,
16,
366,
4672,
3536,
1183,
67,
542,
67,
14161,
1382,
12,
92,
16,
677,
16,
341,
16,
366,
13,
3536,
225,
389,
2242,
67,
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,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
14161,
1382,
12,
92,
16,
677,
16,
341,
16,
366,
4672,
3536,
1183,
67,
542,
67,
14161,
1382,
12,
92,
16,
677,
16,
341,
16,
366,
13,
3536,
225,
389,
2242,
67,
542,... |
self.username = "[REC]"+str(self.record.username[:14]) | self.username = "[REC"+("%d"%self.cid)+"]"+str(self.record.username[:14]) | def loadRecord(self, playbackFile): self.logger.debug('trying to load recording %s' % playbackFile) self.record = self.loadRecording(playbackFile) self.logger.debug('# loaded record: %d' % len(self.record.list)) self.logger.debug('# %s, %s' % (self.record.vehicle, self.record.username)) if len(self.record.list) == 0: self.logger.debug('nothing to play back!') return False self.username = "[REC]"+str(self.record.username[:14]) self.buffersize = self.record.list[0].size self.truckname = self.record.vehicle return True | 7890dc09d9ff54125709ecf0b39bddce38259a19 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5557/7890dc09d9ff54125709ecf0b39bddce38259a19/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2115,
12,
2890,
16,
26335,
812,
4672,
365,
18,
4901,
18,
4148,
2668,
698,
310,
358,
1262,
14949,
738,
87,
11,
738,
26335,
812,
13,
365,
18,
3366,
273,
365,
18,
945,
21037,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
2115,
12,
2890,
16,
26335,
812,
4672,
365,
18,
4901,
18,
4148,
2668,
698,
310,
358,
1262,
14949,
738,
87,
11,
738,
26335,
812,
13,
365,
18,
3366,
273,
365,
18,
945,
21037,
12,
... |
if foundGroup: inGroup = True | inGroup = foundGroup | def updateChangeSet(self, itemList, keepExisting = False, recurse = True, resolveDeps = True, test = False, updateByDefault = True, callback=None, split = True, sync = False, fromChangesets = [], checkPathConflicts = True, checkPrimaryPins = True, resolveRepos = True, syncChildren = False, updateOnly = False, resolveGroupList=None, installMissing = False, removeNotByDefault = False, keepRequired = False, migrate = False, criticalUpdateInfo=None, resolveSource = None, updateJob = None): """Create an update job. DEPRECATED, use newUpdateJob and prepareUpdateJob instead""" # FIXME: this API has gotten far out of hand. Refactor when # non backwards compatible API changes are acceptable. # In particular. installMissing and updateOnly have similar meanings, # (but expanding updateOnly meaning would require making incompatible # changes), split has lost meaning, keepExisting is also practically # meaningless at this level. # CNY-492 assert(split) | fd2c0c00bcde73033a066d00b7a7e4d43e384f88 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/fd2c0c00bcde73033a066d00b7a7e4d43e384f88/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
21565,
12,
2890,
16,
761,
682,
16,
3455,
9895,
273,
1083,
16,
11502,
273,
1053,
16,
2245,
14430,
273,
1053,
16,
1842,
273,
1083,
16,
1089,
858,
1868,
273,
1053,
16,
1348,
33,
703... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
21565,
12,
2890,
16,
761,
682,
16,
3455,
9895,
273,
1083,
16,
11502,
273,
1053,
16,
2245,
14430,
273,
1053,
16,
1842,
273,
1083,
16,
1089,
858,
1868,
273,
1053,
16,
1348,
33,
703... |
select stock.date, min(stock.id), sum(stock.product_qty) as qty, 0 as planned_qty | select stock.date, min(stock.id) as id, sum(stock.product_qty) as qty, 0 as planned_qty | def init(self, cr): tools.drop_view_if_exists(cr, 'report_products_to_received_planned') cr.execute(""" create or replace view report_products_to_received_planned as ( select stock.date, min(stock.id), sum(stock.product_qty) as qty, 0 as planned_qty from stock_picking picking inner join stock_move stock on picking.id = stock.picking_id and picking.type = 'in' where stock.date between (select cast(date_trunc('week', current_date) as date)) and (select cast(date_trunc('week', current_date) as date) + 7) group by stock.date | d1c818f1f1c2c2310b1b2eff79c5c8c61511f900 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/d1c818f1f1c2c2310b1b2eff79c5c8c61511f900/stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
8513,
18,
7285,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
6006,
67,
18736,
67,
869,
67,
15213,
67,
412,
10041,
6134,
4422,
18,
8837,
2932,
3660,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
8513,
18,
7285,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
6006,
67,
18736,
67,
869,
67,
15213,
67,
412,
10041,
6134,
4422,
18,
8837,
2932,
3660,
... |
yumconf[repo]["exclude"] = self.exclude _repo = getRepoDB(rpmconfig, yumconf, reponame=repo) | self.yumconf[repo]["exclude"] = self.exclude _repo = getRepoDB(rpmconfig, self.yumconf, reponame=repo) | def load(self, ks, dir, beta_key_verify=False): self.dir = dir self.exclude = None | c232d221a79504a21976cd8b4b3de89be76368aa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1143/c232d221a79504a21976cd8b4b3de89be76368aa/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
11654,
16,
1577,
16,
6796,
67,
856,
67,
8705,
33,
8381,
4672,
365,
18,
1214,
273,
1577,
365,
18,
10157,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
12,
2890,
16,
11654,
16,
1577,
16,
6796,
67,
856,
67,
8705,
33,
8381,
4672,
365,
18,
1214,
273,
1577,
365,
18,
10157,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
finally: try: if fork_pid > 0: os.kill(fork_pid, signal.SIGKILL) except: pass | self.assert_(self.a_called) self.assert_(self.b_called) self.assert_(handler_b_exception_raised) | def force_test_exit(): # Sigh, both imports seem necessary to avoid errors. import os fork_pid = os.fork() if fork_pid: # In parent. return fork_pid # In child. import os, time try: # Wait 5 seconds longer than the expected alarm to give enough # time for the normal sequence of events to occur. This is # just a stop-gap to try to prevent the test from hanging. time.sleep(MAX_DURATION + 5) print >> sys.__stdout__, ' child should not have to kill parent' for signame in "SIGHUP", "SIGUSR1", "SIGUSR2", "SIGALRM": os.kill(pid, getattr(signal, signame)) print >> sys.__stdout__, " child sent", signame, "to", pid time.sleep(1) finally: os._exit(0) | 73dd02de154505c1bd9be384ef7bcb0fe31b6db5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/73dd02de154505c1bd9be384ef7bcb0fe31b6db5/test_signal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
67,
3813,
67,
8593,
13332,
468,
348,
2031,
16,
3937,
10095,
19264,
4573,
358,
4543,
1334,
18,
1930,
1140,
12515,
67,
6610,
273,
1140,
18,
23335,
1435,
309,
12515,
67,
6610,
30,
468... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2944,
67,
3813,
67,
8593,
13332,
468,
348,
2031,
16,
3937,
10095,
19264,
4573,
358,
4543,
1334,
18,
1930,
1140,
12515,
67,
6610,
273,
1140,
18,
23335,
1435,
309,
12515,
67,
6610,
30,
468... |
if value not in [True,False]: raise TypeError, "Value should be True or False" | if value not in [True,False,'Horizontal','Vertical']: raise TypeError, "Value should be True, False, Horizontal or Vertical" | def SetEnableGrid(self, value): """Set True to enable grid.""" if value not in [True,False]: raise TypeError, "Value should be True or False" self._gridEnabled= value self.Redraw() | 2b9590d611ee348b941906117a78da68f3fddce2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/2b9590d611ee348b941906117a78da68f3fddce2/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
8317,
6313,
12,
2890,
16,
460,
4672,
3536,
694,
1053,
358,
4237,
3068,
12123,
309,
460,
486,
316,
306,
5510,
16,
8381,
11189,
14457,
17023,
15704,
3546,
30,
1002,
3580,
16,
315,
62... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
8317,
6313,
12,
2890,
16,
460,
4672,
3536,
694,
1053,
358,
4237,
3068,
12123,
309,
460,
486,
316,
306,
5510,
16,
8381,
11189,
14457,
17023,
15704,
3546,
30,
1002,
3580,
16,
315,
62... |
serv.bind(("", 9091)) | serv.bind(("", PORT)) | def server(evt): serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM) serv.settimeout(3) serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) serv.bind(("", 9091)) serv.listen(5) try: conn, addr = serv.accept() except socket.timeout: pass else: conn.send("220 Hola mundo\n") conn.close() finally: serv.close() evt.set() | 16ed5b4bfe1c7af50a6634750aafa792357fc74c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/16ed5b4bfe1c7af50a6634750aafa792357fc74c/test_smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
12,
73,
11734,
4672,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
13515,
18,
4424,
27844,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1438,
12,
73,
11734,
4672,
13515,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
3507,
67,
13693,
13,
13515,
18,
542,
4538,
12,
23,
13,
13515,
18,
4424,
27844,... |
cpath = self.debugger.get_call_path() id_path_to_iinfo = self.inspect_info.get(cpath, {}) | ssid = self.debugger.get_stack_situation_id() id_path_to_iinfo = self.inspect_info.get(ssid, {}) | def set_locals(self, locals): vars = locals.keys() vars.sort(key=lambda n: n.lower()) | e032f4d4e7d00a05fe0f27b0ce4695345bb987e0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12738/e032f4d4e7d00a05fe0f27b0ce4695345bb987e0/debugger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
17977,
12,
2890,
16,
8985,
4672,
4153,
273,
8985,
18,
2452,
1435,
4153,
18,
3804,
12,
856,
33,
14661,
290,
30,
290,
18,
8167,
10756,
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,
444,
67,
17977,
12,
2890,
16,
8985,
4672,
4153,
273,
8985,
18,
2452,
1435,
4153,
18,
3804,
12,
856,
33,
14661,
290,
30,
290,
18,
8167,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
raise Exceptions.InvalidParameterValue(value,e) | raise Exceptions.InvalidParameterValue(value) | def _control(self,value): """ Control input value for dangerous characters or types, like "#" | 3b350deccc564cf5f25e80dce327e395c3c941dd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10967/3b350deccc564cf5f25e80dce327e395c3c941dd/InAndOutputs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7098,
12,
2890,
16,
1132,
4672,
3536,
8888,
810,
460,
364,
27308,
1481,
3949,
578,
1953,
16,
3007,
13092,
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,
7098,
12,
2890,
16,
1132,
4672,
3536,
8888,
810,
460,
364,
27308,
1481,
3949,
578,
1953,
16,
3007,
13092,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def fields_get(self, cr, uid, *args): res = super(res_partner_bank, self).fields_get(cr, uid, *args) | def fields_get(self, cr, uid, fields=None, context=None): res = super(res_partner_bank, self).fields_get(cr, uid, fields, context) | def fields_get(self, cr, uid, *args): res = super(res_partner_bank, self).fields_get(cr, uid, *args) type_ids = self.pool.get('res.partner.bank.type').search(cr, uid, []) types = self.pool.get('res.partner.bank.type').browse(cr, uid, type_ids) for t in types: for f in t.field_ids: if f.name in res: res[f.name].setdefault('states',{}) res[f.name]['states'][t.code] = [('readonly',f.readonly),('required',f.required)] return res | 7200e4d9e2437a53f08c6dde17d5dd5b4d37d746 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/7200e4d9e2437a53f08c6dde17d5dd5b4d37d746/partner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
455,
67,
31993,
67,
10546,
16,
365,
2934,
2821,
67,
588,
12,
3353,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
4672,
400,
273,
2240,
12,
455,
67,
31993,
67,
10546,
16,
365,
2934,
2821,
67,
588,
12,
3353,
16,
... |
return """UUID(%r, "%s-%s-%s-%s-%s", pseudo=%r, base=%r)""" % ( self.name, self.iid[0], self.iid[1], self.iid[2], self.iid[3] + self.iid[4], "".join([self.iid[i] for i in xrange(5, 11)]), self.pseudo, self.base) | return """%s(%r, "%s-%s-%s-%s-%s", base=%r)""" % ( self.type, self.name, self.iid[0], self.iid[1], self.iid[2], self.iid[3] + self.iid[4], "".join([self.iid[i] for i in xrange(5, 11)]), self.base) | def __repr__(self): return """UUID(%r, "%s-%s-%s-%s-%s", pseudo=%r, base=%r)""" % ( self.name, self.iid[0], self.iid[1], self.iid[2], self.iid[3] + self.iid[4], "".join([self.iid[i] for i in xrange(5, 11)]), self.pseudo, self.base) | b27c6528ebaf2229b80b9856a60cc082ead28538 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/b27c6528ebaf2229b80b9856a60cc082ead28538/gqi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
3536,
5562,
9275,
86,
16,
2213,
87,
6456,
87,
6456,
87,
6456,
87,
6456,
87,
3113,
12454,
5095,
86,
16,
1026,
5095,
86,
15574,
738,
261,
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,
12715,
972,
12,
2890,
4672,
327,
3536,
5562,
9275,
86,
16,
2213,
87,
6456,
87,
6456,
87,
6456,
87,
6456,
87,
3113,
12454,
5095,
86,
16,
1026,
5095,
86,
15574,
738,
261,
365,
18,
... |
get = self.get_handler | get = self.get_object | def view(self, context): # Set Style css = Path(self.abspath).get_pathto('/ui/tracker/tracker.css') context.styles.append(str(css)) | 1fa77be5b783398ca5fc70ac4c6bcf0d082732e2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/1fa77be5b783398ca5fc70ac4c6bcf0d082732e2/tracker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
12,
2890,
16,
819,
4672,
468,
1000,
9767,
3747,
273,
2666,
12,
2890,
18,
5113,
803,
2934,
588,
67,
803,
869,
2668,
19,
4881,
19,
16543,
19,
16543,
18,
5212,
6134,
819,
18,
10218,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1476,
12,
2890,
16,
819,
4672,
468,
1000,
9767,
3747,
273,
2666,
12,
2890,
18,
5113,
803,
2934,
588,
67,
803,
869,
2668,
19,
4881,
19,
16543,
19,
16543,
18,
5212,
6134,
819,
18,
10218,... |
matched = re.compile("^%include\s+(.*)").match(line) | matched = include_regex.match(line) | def replace_lines(filename): try: file = open(filename) for line in file.readlines(): matched = re.compile("^%include\s+(.*)").match(line) if matched: replace_lines(matched.group(1)) else: sys.stdout.write(line) file.close() except IOError, detail: print detail sys.exit(2) | 848eaf483df9eb79342ae841a80f7724c85899f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1639/848eaf483df9eb79342ae841a80f7724c85899f0/ks_fold_include.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
67,
3548,
12,
3459,
4672,
775,
30,
585,
273,
1696,
12,
3459,
13,
364,
980,
316,
585,
18,
896,
3548,
13332,
4847,
273,
2341,
67,
7584,
18,
1916,
12,
1369,
13,
309,
4847,
30,
145... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
67,
3548,
12,
3459,
4672,
775,
30,
585,
273,
1696,
12,
3459,
13,
364,
980,
316,
585,
18,
896,
3548,
13332,
4847,
273,
2341,
67,
7584,
18,
1916,
12,
1369,
13,
309,
4847,
30,
145... |
assert len(inputs) > 1 | assert len(inputs) > 1, inputs | def main(args): sections = SplitArgsIntoSections(args[1:]) assert len(sections) == 3 (base, inputs, options) = sections assert len(base) == 3 input = base[0] cppdir = base[1] hdir = base[2] assert len(inputs) > 1 generate_bindings = inputs[0] perl_modules = inputs[1:] include_dirs = [] for perl_module in perl_modules: include_dir = os.path.dirname(perl_module) if not include_dir in include_dirs: include_dirs.append(include_dir) # The defines come in as one flat string. Split it up into distinct arguments. if '--defines' in options: defines_index = options.index('--defines') if defines_index + 1 < len(options): split_options = shlex.split(options[defines_index + 1]) if split_options: options[defines_index + 1] = ' '.join(split_options) # Build up the command. command = ['perl', '-w'] for include_dir in include_dirs: command.extend(['-I', include_dir]) command.append(generate_bindings) command.extend(options) command.extend(['--outputDir', cppdir, input]) # Do it. check_call is new in 2.5, so simulate its behavior with call and # assert. return_code = subprocess.call(command) assert return_code == 0 # Both the .cpp and .h were generated in cppdir, but if hdir is different, # the .h needs to move. Copy it instead of using os.rename for maximum # portability in all cases. if cppdir != hdir: input_basename = os.path.basename(input) (root, ext) = os.path.splitext(input_basename) hname = 'V8%s.h' % root hsrc = os.path.join(cppdir, hname) hdst = os.path.join(hdir, hname) shutil.copyfile(hsrc, hdst) os.unlink(hsrc) return return_code | 462753c21e60db697e50b72c59d79b18f709cce1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/462753c21e60db697e50b72c59d79b18f709cce1/rule_binding.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
4672,
7178,
273,
5385,
2615,
5952,
15965,
12,
1968,
63,
21,
30,
5717,
1815,
562,
12,
11657,
13,
422,
890,
261,
1969,
16,
4540,
16,
702,
13,
273,
7178,
225,
1815,
562,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1968,
4672,
7178,
273,
5385,
2615,
5952,
15965,
12,
1968,
63,
21,
30,
5717,
1815,
562,
12,
11657,
13,
422,
890,
261,
1969,
16,
4540,
16,
702,
13,
273,
7178,
225,
1815,
562,
... |
msg = osaf.mail.message.messageTextToKind(view, text) | status, msg = osaf.mail.message.messageTextToKind(view, text) | def importEmail(text, view, coll=None, selectedCollection=False): msg = osaf.mail.message.messageTextToKind(view, text) if selectedCollection or coll is None: coll = Block.findBlockByName("MainView").getSidebarSelectedCollection() if msg is not None: coll.add(msg.itsItem) return msg.itsItem | 41d42bdac23ef03837ab4cca5e9f2779abf8395e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/41d42bdac23ef03837ab4cca5e9f2779abf8395e/ChooseFormat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
4134,
12,
955,
16,
1476,
16,
4508,
33,
7036,
16,
3170,
2532,
33,
8381,
4672,
1267,
16,
1234,
273,
1140,
1727,
18,
4408,
18,
2150,
18,
2150,
1528,
774,
5677,
12,
1945,
16,
977,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
4134,
12,
955,
16,
1476,
16,
4508,
33,
7036,
16,
3170,
2532,
33,
8381,
4672,
1267,
16,
1234,
273,
1140,
1727,
18,
4408,
18,
2150,
18,
2150,
1528,
774,
5677,
12,
1945,
16,
977,
... |
s = req[p] if len(s) > 1 or po not in s: | if len(req[p]) > 1 or po.name not in req[p]: | def _return_all_provides(po): """ Return all the provides, via. yield. """ # These are done one by one, so that we get lazy loading for prov in po.provides_names: yield prov for prov in po.filelist: yield prov for prov in po.dirlist: yield prov for prov in po.ghostlist: yield prov | 287e5ee6125c9f2d7fb9e4cbf0f478ce07a5704a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/287e5ee6125c9f2d7fb9e4cbf0f478ce07a5704a/packageSack.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2463,
67,
454,
67,
685,
13427,
12,
1631,
4672,
3536,
2000,
777,
326,
8121,
16,
3970,
18,
2824,
18,
3536,
468,
8646,
854,
2731,
1245,
635,
1245,
16,
1427,
716,
732,
336,
7962,
7153... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2463,
67,
454,
67,
685,
13427,
12,
1631,
4672,
3536,
2000,
777,
326,
8121,
16,
3970,
18,
2824,
18,
3536,
468,
8646,
854,
2731,
1245,
635,
1245,
16,
1427,
716,
732,
336,
7962,
7153... |
ca = self.changelog.node(self.manifest.linkrev(n)) cc = manifestchangeset[n] if ca != cc: self.ui.warn("manifest %s points to %s, not %s\n" % (hex(n), hex(ca), hex(cc))) errors += 1 | def verify(self): filelinkrevs = {} filenodes = {} manifestchangeset = {} changesets = revisions = files = 0 errors = 0 | d28dfb673f54a4ab197cab7a012ae86c69a139b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/d28dfb673f54a4ab197cab7a012ae86c69a139b4/hg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
2890,
4672,
661,
27269,
266,
6904,
273,
2618,
661,
275,
1145,
273,
2618,
5643,
6329,
278,
273,
2618,
3478,
2413,
273,
18325,
273,
1390,
273,
374,
1334,
273,
374,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
12,
2890,
4672,
661,
27269,
266,
6904,
273,
2618,
661,
275,
1145,
273,
2618,
5643,
6329,
278,
273,
2618,
3478,
2413,
273,
18325,
273,
1390,
273,
374,
1334,
273,
374,
2,
-100,
-100,... | |
'\n\nThis module is already installed on your system') | '\n\nThis addon is already installed on your system') | def fields_get(self, cr, uid, fields=None, context=None, read_access=True): """ If an addon is already installed, set it to readonly as res.config.installer doesn't handle uninstallations of already installed addons """ fields = super(res_config_installer, self).fields_get( cr, uid, fields, context, read_access) | 1aadecf71f7e78e4fca6b4feadd7f5d8178d1f57 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1aadecf71f7e78e4fca6b4feadd7f5d8178d1f57/res_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
855,
67,
3860,
33,
5510,
4672,
3536,
971,
392,
15466,
353,
1818,
5876,
16,
444,
518,
358,
1710... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1466,
33,
7036,
16,
819,
33,
7036,
16,
855,
67,
3860,
33,
5510,
4672,
3536,
971,
392,
15466,
353,
1818,
5876,
16,
444,
518,
358,
1710... |
" foo -> bar;\n" | " A -> B;\n" | def test_single_edge_diagram(): # empty diagram str = ("diagram {\n" " foo -> bar;\n" "}\n") tree = parse(tokenize(str)) nodelist, edgelist = ScreenNodeBuilder.build(tree) assert len(nodelist) == 2 assert len(edgelist) == 1 assert nodelist[0].label == 'foo' assert nodelist[0].xy == (0, 0) assert nodelist[1].label == 'bar' assert nodelist[1].xy == (1, 0) assert edgelist[0].node1.id == 'foo' assert edgelist[0].node2.id == 'bar' | 37d15913646c539dab125b1c383ced5555d40089 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/81/37d15913646c539dab125b1c383ced5555d40089/test_parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
7526,
67,
7126,
67,
12264,
1940,
13332,
468,
1008,
19750,
609,
273,
7566,
12264,
1940,
18890,
82,
6,
315,
225,
432,
317,
605,
9747,
82,
6,
315,
6280,
82,
7923,
2151,
273,
110... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7526,
67,
7126,
67,
12264,
1940,
13332,
468,
1008,
19750,
609,
273,
7566,
12264,
1940,
18890,
82,
6,
315,
225,
432,
317,
605,
9747,
82,
6,
315,
6280,
82,
7923,
2151,
273,
110... |
this = apply(_quickfix.new_SecurityExchange, args) | this = _quickfix.new_SecurityExchange(*args) | def __init__(self, *args): this = apply(_quickfix.new_SecurityExchange, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
4368,
11688,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
4368,
11688,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
... |
found = 1 | def fixup_bifuncindexes_chunk(container): removes = [] entries = find_all_elements(container, "bifuncindex") function_entries = find_all_elements(container, "function") for entry in entries: function_name = entry.getAttribute("name") found = 0 for func_entry in function_entries: t2 = func_entry.childNodes[0].data if t2[-2:] != "()": continue t2 = t2[:-2] if t2 == function_name: func_entry.setAttribute("index", "index") func_entry.setAttribute("module", "__builtin__") if not found: removes.append(entry) found = 1 for entry in removes: container.removeChild(entry) | 86cd6771d5c8e23f1912369c34c6caa0b647d80c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/86cd6771d5c8e23f1912369c34c6caa0b647d80c/docfixer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
67,
70,
430,
551,
11265,
67,
6551,
12,
3782,
4672,
7157,
273,
5378,
3222,
273,
1104,
67,
454,
67,
6274,
12,
3782,
16,
315,
70,
430,
551,
1615,
7923,
445,
67,
8219,
273,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2917,
416,
67,
70,
430,
551,
11265,
67,
6551,
12,
3782,
4672,
7157,
273,
5378,
3222,
273,
1104,
67,
454,
67,
6274,
12,
3782,
16,
315,
70,
430,
551,
1615,
7923,
445,
67,
8219,
273,
11... | |
trytond.tests.install_module('company') | trytond.tests.test_tryton.install_module('company') | def setUp(self): trytond.tests.install_module('company') self.company = RPCProxy('company.company') self.employee = RPCProxy('company.employee') self.currency = RPCProxy('currency.currency') | e22dc8371c5294ab664a4f35325c05cfdfc88998 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9291/e22dc8371c5294ab664a4f35325c05cfdfc88998/test_company.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
775,
88,
1434,
18,
16341,
18,
3813,
67,
698,
1917,
18,
5425,
67,
2978,
2668,
16840,
6134,
365,
18,
16840,
273,
8295,
3886,
2668,
16840,
18,
16840,
6134,
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,
24292,
12,
2890,
4672,
775,
88,
1434,
18,
16341,
18,
3813,
67,
698,
1917,
18,
5425,
67,
2978,
2668,
16840,
6134,
365,
18,
16840,
273,
8295,
3886,
2668,
16840,
18,
16840,
6134,
365,
18,
... |
fo = open(test_support.TESTFN, "wb") | fo = open(test_support.TESTFN, "w", encoding="ascii") | def test_print(self): d = self.type2test(range(200)) d.append(d) d.extend(range(200,400)) d.append(d) d.append(400) try: fo = open(test_support.TESTFN, "wb") fo.write(str(d)) fo.close() fo = open(test_support.TESTFN, "rb") self.assertEqual(fo.read(), repr(d)) finally: fo.close() os.remove(test_support.TESTFN) | 55c331efec65158acdce8c1dc59ddfb9a097ffda /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/55c331efec65158acdce8c1dc59ddfb9a097ffda/list_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1188,
12,
2890,
4672,
302,
273,
365,
18,
723,
22,
3813,
12,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
302,
18,
14313,
12,
3676,
12,
6976,
16,
16010,
3719,
302,
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,
1188,
12,
2890,
4672,
302,
273,
365,
18,
723,
22,
3813,
12,
3676,
12,
6976,
3719,
302,
18,
6923,
12,
72,
13,
302,
18,
14313,
12,
3676,
12,
6976,
16,
16010,
3719,
302,
18,
... |
for ( int _i = 0; _i < node->v.%{KIND_W/O_SUFFIX}.%{VALUE}.size; _i++ ) { v->%{TARGET}.append((ExpressionAst::%{AST_TYPE}) node->v.%{KIND_W/O_SUFFIX}.%{VALUE}.elements[_i]); | for ( int _i = 0; _i < node->v.%{KIND_W/O_SUFFIX}.%{VALUE}->size; _i++ ) { v->%{TARGET}.append((ExpressionAst::%{AST_TYPE}) node->v.%{KIND_W/O_SUFFIX}.%{VALUE}->elements[_i]); | # sdef example line: | af0e539da70400feff49df833a112d59df0356d8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6362/af0e539da70400feff49df833a112d59df0356d8/conversionGenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
272,
536,
3454,
980,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
272,
536,
3454,
980,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
print "ERROR: cannot create %s. definition not found in %s" % \ | print "Error: cannot create %s. definition not found in %s" % \ | def create_item_from_schema(item_name): try: (type, body_list) = schema[item_name] exit_status = os.system('psql %s %s -qc "%s" > /dev/null 2>&1' % \ (config['PLC_DB_NAME'], config['PLC_DB_USER'],"".join(body_list) ) ) if exit_status: raise Exception except Exception, fault: print 'ERROR: create %s failed. Check schema.' % item_name sys.exit(1) raise fault except KeyError: print "ERROR: cannot create %s. definition not found in %s" % \ (key, schema_file) return False | af98851618b632afb0a950644c796b7c633ace40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/af98851618b632afb0a950644c796b7c633ace40/upgrade-db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
1726,
67,
2080,
67,
4821,
12,
1726,
67,
529,
4672,
225,
775,
30,
261,
723,
16,
1417,
67,
1098,
13,
273,
1963,
63,
1726,
67,
529,
65,
2427,
67,
2327,
273,
1140,
18,
4299,
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,
752,
67,
1726,
67,
2080,
67,
4821,
12,
1726,
67,
529,
4672,
225,
775,
30,
261,
723,
16,
1417,
67,
1098,
13,
273,
1963,
63,
1726,
67,
529,
65,
2427,
67,
2327,
273,
1140,
18,
4299,
2... |
dev = app.PostScriptDevice | dev = PostScriptDevice | def do_print(self): app = self.main_window.application bbox = self.document.BoundingRect(visible = 0, printable = 1) if bbox is None: app.MessageBox(title = _("Save As PostScript"), message = _("\nThe document doesn't have \n" "any printable layers.\n"), icon = pixmaps.Warning, icon1=pixmaps.smallicon) return try: filename = '' file = None if self.print_dest.get() == 'file': # print to file filename = self.print_filename.get() # use filename as file just in case the user is trying # to save into an EPS that is referenced by the # document. The psdevice knows how to handle such cases. file = filename title = os.path.basename(filename) else: file = os.popen(self.print_command.get(), 'w') title = 'sK1' try: dev = app.PostScriptDevice ps_dev = dev(file, as_eps = 1, bounding_box = tuple(bbox), rotate = self.var_rotate.get(), For = os_utils.get_real_username(), CreationDate = os_utils.current_date(), Title = title, document = self.document) self.document.Draw(ps_dev) ps_dev.Close() if filename: self.document.meta.ps_filename = filename self.document.meta.ps_directory =os.path.split(filename)[0] finally: # close the file. Check for the close attribute first # because file can be either a string or a file object. if hasattr(file, "close"): file.close() | eb5cc5e19d8768819b3b85bf2c175fd90ee70fed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3123/eb5cc5e19d8768819b3b85bf2c175fd90ee70fed/printdlg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1188,
12,
2890,
4672,
595,
273,
365,
18,
5254,
67,
5668,
18,
3685,
8472,
273,
365,
18,
5457,
18,
3499,
310,
6120,
12,
8613,
273,
374,
16,
23474,
273,
404,
13,
309,
8472,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1188,
12,
2890,
4672,
595,
273,
365,
18,
5254,
67,
5668,
18,
3685,
8472,
273,
365,
18,
5457,
18,
3499,
310,
6120,
12,
8613,
273,
374,
16,
23474,
273,
404,
13,
309,
8472,
353... |
drawSwatches = (colls > 2 or (colls == 2 and (master not in allCollection or self.primaryCollection.itsUUID == allCollection.itsUUID)) ) | drawSwatches = (colls > 1 or (colls == 1 and (self.primaryCollection.itsUUID == allCollection.itsUUID))) | def Draw(self, dc, styles, selected, leftSideCutoff=False, rightSideCutOff=False): # @@@ add a general cutoff parameter? event = self.event # recurring items, when deleted or stamped non-Calendar, are sometimes # passed to Draw before wxSynchronize is called, ignore those items if (event.itsItem.isDeleted() or not has_stamp(event, Calendar.EventStamp)): return isAnyTimeOrAllDay = Calendar.isDayEvent(event) allCollection = schema.ns('osaf.pim', event.itsItem.itsView).allCollection # Draw one event - an event consists of one or more bounds clipRect = None (cx,cy,cwidth,cheight) = dc.GetClippingBox() if not cwidth == cheight == 0: clipRect = (cx,cy,cwidth,cheight) gradientLeft, gradientRight, outlineColor, textColor = \ self.getEventColors(selected) dc.SetTextForeground(textColor) for rectIndex, itemRect in enumerate(self.GetBoundsRects()): | 9a5ad8c5997afdb4cfc5e3eb00b8621141108f56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/9a5ad8c5997afdb4cfc5e3eb00b8621141108f56/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
12,
2890,
16,
6744,
16,
5687,
16,
3170,
16,
2002,
8895,
15812,
3674,
33,
8381,
16,
2145,
8895,
15812,
7210,
33,
8381,
4672,
468,
22175,
36,
527,
279,
7470,
13383,
1569,
35,
871,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10184,
12,
2890,
16,
6744,
16,
5687,
16,
3170,
16,
2002,
8895,
15812,
3674,
33,
8381,
16,
2145,
8895,
15812,
7210,
33,
8381,
4672,
468,
22175,
36,
527,
279,
7470,
13383,
1569,
35,
871,
... |
print 'Date time: %s' % dt | def _parse_incoming_timestamp(self, timestamp): """Parse a Service Center Time Stamp (SCTS) string into a Python datetime object, or None if the timestamp couldn't be parsed. The SCTS format does not seem to be standardized, but looks something like: YY/MM/DD,HH:MM:SS.""" | 278363ddf8f4e5a49c67f1376e765f8979ac2640 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/278363ddf8f4e5a49c67f1376e765f8979ac2640/gsmmodem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
31033,
67,
5508,
12,
2890,
16,
2858,
4672,
3536,
3201,
279,
1956,
25766,
2647,
934,
931,
261,
55,
1268,
55,
13,
533,
1368,
279,
6600,
3314,
733,
16,
578,
599,
309,
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,
2670,
67,
31033,
67,
5508,
12,
2890,
16,
2858,
4672,
3536,
3201,
279,
1956,
25766,
2647,
934,
931,
261,
55,
1268,
55,
13,
533,
1368,
279,
6600,
3314,
733,
16,
578,
599,
309,
326,
... | |
packageRootFolder = self.packageRootFolder files = GlobDirectoryWalker(packageRootFolder) | files = GlobDirectoryWalker(self.sourceFolder) | def _addSizes(self): "Write .sizes file with info about number and size of files." | d932aaa96ea8845f4755fa2da90712cb71b9e9c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d932aaa96ea8845f4755fa2da90712cb71b9e9c4/buildpkg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
11923,
12,
2890,
4672,
315,
3067,
263,
11914,
585,
598,
1123,
2973,
1300,
471,
963,
434,
1390,
1199,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
11923,
12,
2890,
4672,
315,
3067,
263,
11914,
585,
598,
1123,
2973,
1300,
471,
963,
434,
1390,
1199,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def createJoinTables(cls, ifNotExists=False): | def createJoinTables(cls, ifNotExists=False, connection=None): conn = connection or cls._connection | def createJoinTables(cls, ifNotExists=False): for join in cls._getJoinsToCreate(): if ifNotExists and \ cls._connection.tableExists(join.intermediateTable): continue cls._connection._SO_createJoinTable(join) | 5095cfa4c32001226e31b16fc79027c429b12d8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8798/5095cfa4c32001226e31b16fc79027c429b12d8b/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4572,
6905,
12,
6429,
16,
309,
29210,
33,
8381,
16,
1459,
33,
7036,
4672,
1487,
273,
1459,
578,
2028,
6315,
4071,
364,
1233,
316,
2028,
6315,
588,
4572,
11634,
1684,
13332,
309,
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,
752,
4572,
6905,
12,
6429,
16,
309,
29210,
33,
8381,
16,
1459,
33,
7036,
4672,
1487,
273,
1459,
578,
2028,
6315,
4071,
364,
1233,
316,
2028,
6315,
588,
4572,
11634,
1684,
13332,
309,
309... |
this = apply(_quickfix.new_BrokerOfCredit, args) | this = _quickfix.new_BrokerOfCredit(*args) | def __init__(self, *args): this = apply(_quickfix.new_BrokerOfCredit, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
11194,
951,
16520,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
11194,
951,
16520,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
... |
self.__setRect() def __setRect(self): | self._setRect() def _setRect(self): | def setRect(self, width, height): """gives the board a fixed size in tile coordinates""" self.__fixedWidth = width self.__fixedHeight = height self.__setRect() | 3cfa042f86670ffe09d2e20f2b8eb09fdb555c75 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1679/3cfa042f86670ffe09d2e20f2b8eb09fdb555c75/board.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6120,
12,
2890,
16,
1835,
16,
2072,
4672,
3536,
75,
3606,
326,
11094,
279,
5499,
963,
316,
4769,
5513,
8395,
365,
16186,
12429,
2384,
273,
1835,
365,
16186,
12429,
2686,
273,
2072,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6120,
12,
2890,
16,
1835,
16,
2072,
4672,
3536,
75,
3606,
326,
11094,
279,
5499,
963,
316,
4769,
5513,
8395,
365,
16186,
12429,
2384,
273,
1835,
365,
16186,
12429,
2686,
273,
2072,
... |
limit = collection.getItemCount() | def randomResults(self): collection = self.targetCollection() limit = collection.getItemCount() if collection is not None: results = [x for x in collection.queryCatalog(sort_on=None, object_provides=IImageContent.__identifier__)] try: random.shuffle(results) if limit: return results[:limit] return results except AttributeError: return [] return [] | 7ba071df76a5e95aa10675d6b90f61cef4664fdc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10161/7ba071df76a5e95aa10675d6b90f61cef4664fdc/auslfeportletmultimedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
3447,
12,
2890,
4672,
1849,
273,
365,
18,
3299,
2532,
1435,
309,
1849,
353,
486,
599,
30,
1686,
273,
306,
92,
364,
619,
316,
1849,
18,
2271,
9769,
12,
3804,
67,
265,
33,
7036,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2744,
3447,
12,
2890,
4672,
1849,
273,
365,
18,
3299,
2532,
1435,
309,
1849,
353,
486,
599,
30,
1686,
273,
306,
92,
364,
619,
316,
1849,
18,
2271,
9769,
12,
3804,
67,
265,
33,
7036,
... | |
my = Root(config_opts) cmd = "PS1='mock-chroot> ' %s %s /bin/bash" % (config_opts['chroot'], my.rootdir) my.debug("executing: %s" % cmd) my._mount() ret = os.system(cmd) my.close() my.debug("finished shell with retval %d" % ret) | os.environ['PS1'] = "mock-chroot> " do_run_cmd(config_opts, "/bin/bash", raw_chroot=1) | def main(): # before we go on, make sure the user is a member of the 'mock' group. member = False for item in os.getgroups(): try: grptup = grp.getgrgid(item) except KeyError, e: continue if grptup[0] == 'mock': member = True if not member: print "You need to be a member of the mock group for this to work" sys.exit(1) # and make sure they're not root if os.geteuid() == 0: error("Don't try to run mock as root!") sys.exit(1) # config path config_path='/etc/mock' # defaults config_opts = {} config_opts['basedir'] = '/var/lib/mock/' # root name is automatically added to this config_opts['chroot'] = '/usr/sbin/mock-helper chroot' config_opts['mount'] = '/usr/sbin/mock-helper mount' config_opts['umount'] = '/usr/sbin/mock-helper umount' config_opts['rm'] = '/usr/sbin/mock-helper rm' config_opts['mknod'] = '/usr/sbin/mock-helper mknod' config_opts['yum'] = '/usr/sbin/mock-helper yum' config_opts['runuser'] = '/sbin/runuser' config_opts['chroot_setup_cmd'] = 'install buildsys-build' config_opts['chrootuser'] = 'mockbuild' config_opts['chrootgroup'] = 'mockbuild' config_opts['chrootuid'] = 500 config_opts['chrootgid'] = 500 config_opts['chroothome'] = '/builddir' config_opts['clean'] = True config_opts['debug'] = False config_opts['quiet'] = False config_opts['target_arch'] = 'i386' config_opts['files'] = {} config_opts['yum.conf'] = '' config_opts['macros'] = """ | 950a02e8990b7b978bb944a4c62a252273c46a64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7328/950a02e8990b7b978bb944a4c62a252273c46a64/mock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
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,
2774,
13332,
468,
1865,
732,
1960,
603,
16,
1221,
3071,
326,
729,
353,
279,
3140,
434,
326,
296,
22851,
11,
1041,
18,
3140,
273,
1083,
364,
761,
316,
1140,
18,
588,
4650,
13332,
775,
3... |
'de': u'Entferne in Spam-Whitelist eingetragenen Weblink auf %s', | 'de': u'Entferne in Spam-Blacklist eingetragenen Weblink auf %s', | def main(): automatic = False msg = { 'de': u'Entferne in Spam-Whitelist eingetragenen Weblink auf %s', 'en': u'Removing links to spammed site %s', 'nl': u'Links naar gespamde site %s verwijderd', } spamSite = '' for arg in wikipedia.handleArgs(): if arg.startswith("-automatic"): automatic = True else: spamSite = arg if not automatic: wikipedia.put_throttle.setDelay(1) if not spamSite: wikipedia.output(u"No spam site specified.") sys.exit() mysite = wikipedia.getSite() pages = list(set(mysite.linksearch(spamSite))) wikipedia.getall(mysite, pages) for p in pages: text = p.get() if not spamSite in text: continue # Show the title of the page we're working on. # Highlight the title in purple. wikipedia.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title()) lines = text.split('\n') newpage = [] lastok = "" for line in lines: if spamSite in line: if lastok: wikipedia.output(lastok) wikipedia.output('\03{lightred}%s\03{default}' % line) lastok = None else: newpage.append(line) if line.strip(): if lastok is None: wikipedia.output(line) lastok = line if automatic: answer = "y" else: answer = wikipedia.inputChoice(u'\nDelete the red lines?', ['yes', 'no', 'edit'], ['y', 'N', 'e'], 'n') if answer == "n": continue elif answer == "e": editor = editarticle.TextEditor() newtext = editor.edit(text, highlight = spamSite, jumpIndex = text.find(spamSite)) else: newtext = "\n".join(newpage) if newtext != text: p.put(newtext, wikipedia.translate(mysite, msg) % spamSite) | 3acdbf47f1dc332862773d203d954fcafb4ac381 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/3acdbf47f1dc332862773d203d954fcafb4ac381/spamremove.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
5859,
273,
1083,
1234,
273,
288,
296,
323,
4278,
582,
11,
14199,
586,
4644,
316,
5878,
301,
17,
25811,
425,
310,
278,
2458,
275,
275,
2999,
1232,
279,
696,
738,
87,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
5859,
273,
1083,
1234,
273,
288,
296,
323,
4278,
582,
11,
14199,
586,
4644,
316,
5878,
301,
17,
25811,
425,
310,
278,
2458,
275,
275,
2999,
1232,
279,
696,
738,
87,
2187,
... |
solv = self.pool.get(2) | solv = self.pool.solvable(2) | def test_solvable(self): solv = self.pool.get(2) assert solv print solv print "%s-%s.%s[%s]" % (solv.name(),solv.evr(),solv.arch(),solv.vendor()) | e5988cf88f7f8cd523948dc8463d678d76cf2eb3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12482/e5988cf88f7f8cd523948dc8463d678d76cf2eb3/solvable.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
18281,
16845,
12,
2890,
4672,
3704,
90,
273,
365,
18,
6011,
18,
18281,
16845,
12,
22,
13,
1815,
3704,
90,
1172,
3704,
90,
1172,
2213,
87,
6456,
87,
7866,
87,
14451,
87,
4279,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18281,
16845,
12,
2890,
4672,
3704,
90,
273,
365,
18,
6011,
18,
18281,
16845,
12,
22,
13,
1815,
3704,
90,
1172,
3704,
90,
1172,
2213,
87,
6456,
87,
7866,
87,
14451,
87,
4279,... |
'export DIRACLIB=%s' % os.path.join( proPath, cliParams.platform, 'lib' ) ] ) | 'export DIRACLIB=%s' % os.path.join( proPath, cliParams.platform, 'lib' ), 'export TERMINFO=%s' % os.path.join( proPath, cliParans.platform, 'share', 'terminfo' ) ] ) | def usage(): print "Usage %s <opts> <cfgFile>" % sys.argv[0] for cmdOpt in cmdOpts: print " %s %s : %s" % ( cmdOpt[0].ljust( 3 ), cmdOpt[1].ljust( 20 ), cmdOpt[2] ) sys.exit( 1 ) | dcd0de626b19e3210218a8c08ff632a97dae5763 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/dcd0de626b19e3210218a8c08ff632a97dae5763/dirac-install.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
738,
87,
411,
4952,
34,
411,
7066,
812,
2984,
738,
2589,
18,
19485,
63,
20,
65,
364,
1797,
6179,
316,
1797,
5476,
30,
1172,
315,
738,
87,
738,
87,
294,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
315,
5357,
738,
87,
411,
4952,
34,
411,
7066,
812,
2984,
738,
2589,
18,
19485,
63,
20,
65,
364,
1797,
6179,
316,
1797,
5476,
30,
1172,
315,
738,
87,
738,
87,
294,
... |
def RegisterAddin(klass): | def _DoRegister(klass, root): | def RegisterAddin(klass): # prints to help debug binary install issues. import _winreg key = _winreg.CreateKey(_winreg.HKEY_CURRENT_USER, "Software\\Microsoft\\Office\\Outlook\\Addins") subkey = _winreg.CreateKey(key, klass._reg_progid_) _winreg.SetValueEx(subkey, "CommandLineSafe", 0, _winreg.REG_DWORD, 0) _winreg.SetValueEx(subkey, "LoadBehavior", 0, _winreg.REG_DWORD, 3) _winreg.SetValueEx(subkey, "Description", 0, _winreg.REG_SZ, "SpamBayes anti-spam tool") _winreg.SetValueEx(subkey, "FriendlyName", 0, _winreg.REG_SZ, "SpamBayes") print "Registration complete." | 3ffaf00d3c667e55d9355ad693e4a1edec0cfb6d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/3ffaf00d3c667e55d9355ad693e4a1edec0cfb6d/addin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5433,
986,
267,
12,
22626,
4672,
468,
14971,
358,
2809,
1198,
3112,
3799,
8296,
18,
1930,
389,
8082,
1574,
498,
273,
389,
8082,
1574,
18,
1684,
653,
24899,
8082,
1574,
18,
44,
3297,
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,
5433,
986,
267,
12,
22626,
4672,
468,
14971,
358,
2809,
1198,
3112,
3799,
8296,
18,
1930,
389,
8082,
1574,
498,
273,
389,
8082,
1574,
18,
1684,
653,
24899,
8082,
1574,
18,
44,
3297,
67,
... |
elif command == 'setSpeed': speed = 0 speed = int(params.get('speed')) speed = max(0, min(speed, 9)) self.setVirtualSpeed(speed) | elif command == 'setVirtualSpeed': virtualSpeed = int(params.get('virtualSpeed')) speed = max(0, min(virtualSpeed, len(SpeedConfigurations) - 1)) self.setVirtualSpeed(virtualSpeed) | def doCommand(self, params): command = params.get('name', None) print "DOCOMMAND", command, params | d7f132a37f0a5156cb270112101db0884e9724ff /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10557/d7f132a37f0a5156cb270112101db0884e9724ff/micropolisturbogearsengine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2189,
12,
2890,
16,
859,
4672,
1296,
273,
859,
18,
588,
2668,
529,
2187,
599,
13,
1172,
315,
3191,
19104,
3113,
1296,
16,
859,
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,
741,
2189,
12,
2890,
16,
859,
4672,
1296,
273,
859,
18,
588,
2668,
529,
2187,
599,
13,
1172,
315,
3191,
19104,
3113,
1296,
16,
859,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
tmp_pieces = re.sub(r'(?P<str>[aeiou!@ | tmp_pieces = re.sub(r'(?P<str>[aeiouAEIOU!@ | def drawstringframed(self, string, x, y, width, height, fgcolor=None, bgcolor=None, font=None, ptsize=0, align_h='left', align_v='top'): | db8532a0d8416ad857cfce2b4ba7c7cc588d7e39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/db8532a0d8416ad857cfce2b4ba7c7cc588d7e39/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
1080,
74,
1940,
329,
12,
2890,
16,
533,
16,
619,
16,
677,
16,
1835,
16,
2072,
16,
10186,
3266,
33,
7036,
16,
31509,
33,
7036,
16,
3512,
33,
7036,
16,
5818,
1467,
33,
20,
16,
... |
neighs = Phi2_quad(X, ss_points[j_prev], ss_points[pos]).roots() for (xj,ej) in neighs: | neighbors = Phi2_quad(X, ss_points[j_prev], ss_points[pos]).roots() for (xj,ej) in neighbors: | def supersingular_points(self): r""" This function computes the supersingular j-invariants over the finite field associated to self. | 92cd55dac1a723811af08302aa326e1a81ceb4a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/92cd55dac1a723811af08302aa326e1a81ceb4a8/ssmod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
1169,
414,
17830,
67,
4139,
12,
2890,
4672,
436,
8395,
1220,
445,
15881,
326,
1169,
414,
17830,
525,
17,
267,
15886,
1879,
326,
25922,
652,
3627,
358,
365,
18,
2,
-100,
-100,
-100,
-100,... |
help__label__ = u'Help' help__access__ = True def help(self, context): help = self.gettext(u"Read the doc in README file.") return help.encode('utf-8') | def new_thread(self, context): title = context.get_form_value('dc:title').strip() if not title: return context.come_back(u"No title given.") | 3b838d86710a06bfa99bd20af2526ac017d5816d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/3b838d86710a06bfa99bd20af2526ac017d5816d/forum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
5930,
12,
2890,
16,
819,
4672,
2077,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
7201,
30,
2649,
16063,
6406,
1435,
309,
486,
2077,
30,
327,
819,
18,
5624,
67,
823,
12,
89,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
394,
67,
5930,
12,
2890,
16,
819,
4672,
2077,
273,
819,
18,
588,
67,
687,
67,
1132,
2668,
7201,
30,
2649,
16063,
6406,
1435,
309,
486,
2077,
30,
327,
819,
18,
5624,
67,
823,
12,
89,
... | |
_pending = [] self._remove(reqpkg, cs, lk, _pending, depth) if _pending: self._pending(cs, lk, _pending, depth) | self._remove(reqpkg, cs, lk, None, depth) | def _pending(self, changeset, locked, pending, depth=0): #print "[%03d] _pending()" % depth #depth += 1 | fa863c9ad9e8fb247c36224ac1e88ebd00689a16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8317/fa863c9ad9e8fb247c36224ac1e88ebd00689a16/transaction.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9561,
12,
2890,
16,
22463,
16,
8586,
16,
4634,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
9561,
10031,
738,
3598,
468,
5979,
1011,
404,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9561,
12,
2890,
16,
22463,
16,
8586,
16,
4634,
16,
3598,
33,
20,
4672,
468,
1188,
30048,
4630,
72,
65,
389,
9561,
10031,
738,
3598,
468,
5979,
1011,
404,
2,
-100,
-100,
-100,
-100... |
for event in NamespaceFlattener()(self.tree): | for event in NamespaceFlattener(prefixes={ 'http://www.w3.org/1999/xhtml': '' })(self.tree): | def __iter__(self): depth = 0 ignore_until = None previous = None for event in NamespaceFlattener()(self.tree): if previous is not None: if previous[0] == START: depth += 1 if ignore_until <= depth: ignore_until = None if ignore_until is None: for token in self.tokens(previous, event): yield token if token["type"] == "EmptyTag": ignore_until = depth if previous[0] == END: depth -= 1 previous = event if previous is not None: if ignore_until is None or ignore_until <= depth: for token in self.tokens(previous, None): yield token elif ignore_until is not None: raise ValueError("Illformed DOM event stream: void element without END_ELEMENT") | 2e3d453f62e9b672eea548e02a6417f511971fd4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4487/2e3d453f62e9b672eea548e02a6417f511971fd4/genshistream.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2165,
972,
12,
2890,
4672,
3598,
273,
374,
2305,
67,
12198,
273,
599,
2416,
273,
599,
364,
871,
316,
6005,
2340,
4558,
708,
12,
17777,
5899,
296,
2505,
2207,
5591,
18,
91,
23,
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,
2165,
972,
12,
2890,
4672,
3598,
273,
374,
2305,
67,
12198,
273,
599,
2416,
273,
599,
364,
871,
316,
6005,
2340,
4558,
708,
12,
17777,
5899,
296,
2505,
2207,
5591,
18,
91,
23,
18... |
text = text.replace(' ', '~') | text = text.replace(' ', self.babel.nobr) | def encode(self, text): """ Encode special characters (``# $ % & ~ _ ^ \ { }``) in `text` & return """ # Escaping with a backslash does not help with backslashes, ~ and ^. | 7c1fb88acf91c8bf24bc6130b40b1b7bb6da62ff /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8194/7c1fb88acf91c8bf24bc6130b40b1b7bb6da62ff/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
977,
4672,
3536,
6240,
4582,
3949,
261,
10335,
7,
271,
738,
473,
4871,
389,
3602,
521,
288,
289,
10335,
13,
316,
1375,
955,
68,
473,
327,
3536,
468,
512,
1017,
2444... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
977,
4672,
3536,
6240,
4582,
3949,
261,
10335,
7,
271,
738,
473,
4871,
389,
3602,
521,
288,
289,
10335,
13,
316,
1375,
955,
68,
473,
327,
3536,
468,
512,
1017,
2444... |
write(POP * len(object)) write(self.get(memo[d])) | write(POP * len(object) + self.get(memo[d])) | def save_tuple(self, object): d = id(object) | 971792dafe584efc723c3014ded6af302d155a6f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/971792dafe584efc723c3014ded6af302d155a6f/pickle.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
8052,
12,
2890,
16,
733,
4672,
302,
273,
612,
12,
1612,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1923,
67,
8052,
12,
2890,
16,
733,
4672,
302,
273,
612,
12,
1612,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
cmdList.append( 'PRIMARY KEY ( %s )' % ", ".join( [ "`%s`" % str(f) for f in thisTable['PrimaryKey'] ] ) ) | cmdList.append( 'PRIMARY KEY ( %s )' % ", ".join( [ "`%s`" % str( f ) for f in thisTable['PrimaryKey'] ] ) ) | def _createTables( self, tableDict, force=False ): """ tableDict: tableName: { 'Fields' : { 'Field': 'Description' }, 'ForeignKeys': {'Field': 'Table' }, 'PrimaryKey': 'Id', 'Indexes': { 'Index': [] }, 'UniqueIndexes': { 'Index': [] }, 'Engine': 'InnoDB' } only 'Fields' is a mandatory key. | 0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08/MySQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2640,
6905,
12,
365,
16,
1014,
5014,
16,
2944,
33,
8381,
262,
30,
3536,
1014,
5014,
30,
4775,
30,
288,
296,
2314,
11,
294,
288,
296,
974,
4278,
296,
3291,
11,
19879,
296,
28285,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2640,
6905,
12,
365,
16,
1014,
5014,
16,
2944,
33,
8381,
262,
30,
3536,
1014,
5014,
30,
4775,
30,
288,
296,
2314,
11,
294,
288,
296,
974,
4278,
296,
3291,
11,
19879,
296,
28285,
... |
return m | return default | def _queryFactoryMethod(self, container, m=None): try: if self.product and self.factory: p = container.manage_addProduct[self.product] t = getattr(p, self.factory, None) if getSecurityManager().validate(p, p, self.factory, t): m = t except: LOG('Types Tool', ERROR, '_queryFactoryMethod raised an exception', error=sys.exc_info()) return m | a198ce0c44e307a6dd25e83daa15e759733e8c9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/a198ce0c44e307a6dd25e83daa15e759733e8c9d/TypesTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2271,
1733,
1305,
12,
2890,
16,
1478,
16,
312,
33,
7036,
4672,
775,
30,
309,
365,
18,
5896,
471,
365,
18,
6848,
30,
293,
273,
1478,
18,
12633,
67,
1289,
4133,
63,
2890,
18,
5896... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2271,
1733,
1305,
12,
2890,
16,
1478,
16,
312,
33,
7036,
4672,
775,
30,
309,
365,
18,
5896,
471,
365,
18,
6848,
30,
293,
273,
1478,
18,
12633,
67,
1289,
4133,
63,
2890,
18,
5896... |
, | , | def _delOb( self, id ): # # Override ObjectManager's version to clean up any plugin # registrations for the deleted object # plugins = self._getOb( 'plugins', None ) | 614e1161e47ef43710a900ca047bf9c4b146dbfb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/614e1161e47ef43710a900ca047bf9c4b146dbfb/PluggableAuthService.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3771,
10516,
12,
365,
16,
612,
262,
30,
468,
468,
282,
1439,
17566,
1807,
1177,
358,
2721,
731,
1281,
1909,
468,
282,
28620,
364,
326,
4282,
733,
468,
4799,
273,
365,
6315,
588,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
3771,
10516,
12,
365,
16,
612,
262,
30,
468,
468,
282,
1439,
17566,
1807,
1177,
358,
2721,
731,
1281,
1909,
468,
282,
28620,
364,
326,
4282,
733,
468,
4799,
273,
365,
6315,
588,
1... |
timeout = Timings.window_find_timout | timeout = Timings.window_find_timeout | def _resolve_from_appdata( criteria_, app, timeout = None, retry_interval = None): "Should not be used at the moment!" if timeout is None: timeout = Timings.window_find_timout if retry_interval is None: retry_interval = Timings.window_find_retry global cur_item # get the stored item corresponding to this request matched_control = app.GetMatchHistoryItem(cur_item) cur_item += 1 # remove parameters from the original search that changes each time criteria = [crit.copy() for crit in criteria_] # Remove any attributes from the current search that are # completely language dependent for unloc_attrib in ['title_re', 'title', 'best_match']: for c in criteria: if c.has_key(unloc_attrib): del c[unloc_attrib] #found_criteria = item[0] #for c in found_criteria: # if c.has_key('process'): # del c['process'] # # They should match - so if htey don't print it out. #if found_criteria != search_criteria: # print "\t\t", matched[cur_index - 3][0] # print "\t" ,matched[cur_index - 2][0] # print search_criteria # print "---" # print found_criteria # raise RuntimeError("Mismatch") # so let's use the ID from the matched control... #print item[1] # we need to try and get a good match for the dialog # this could be done by matching # - number/positoin of controls # - class # anything else? dialog_criterion = criteria[0] #print list(matched_control) dialog_criterion['class_name'] = matched_control[1]['Class'] # find all the windows in the process process_hwnds = findwindows.find_windows(**dialog_criterion) dialog = None ctrl = None if len(process_hwnds) >= 1: similar_child_count = [h for h in process_hwnds if matched_control[1]['ControlCount'] -2 <= len(handleprops.children(h)) and matched_control[1]['ControlCount'] +2 >= len(handleprops.children(h))] if len(similar_child_count) == 0: #print "None Similar child count!!???" #print matched_control[1]['ControlCount'], \ # len(handleprops.children(h)) pass else: process_hwnds = similar_child_count for h in process_hwnds: #print controls.WrapHandle(h).GetProperties() #print "======", h, h, h dialog = controls.WrapHandle(h) # if a control was specified also if len(criteria_) > 1: # find it in the original data #print item[2] # remove those criteria which are langauge specific ctrl_criterion = criteria[1] #def has_same_id(other_ctrl): # print "==="*20 # print "testing", item[2]['ControlID'], # print "against", other_ctrl # return item[2]['ControlID'] == \ # handleprops.controlid(other_ctrl) ctrl_criterion['class_name'] = matched_control[2]['Class'] ctrl_criterion['parent'] = dialog.handle ctrl_criterion['top_level_only'] = False #ctrl_criterion['predicate_func'] = has_same_id #print "CTRLCTRJL", ctrl_criterion ctrl_hwnds = findwindows.find_windows(**ctrl_criterion) if len(ctrl_hwnds) > 1: same_ids = \ [hwnd for hwnd in ctrl_hwnds if handleprops.controlid(hwnd) == \ matched_control[2]['ControlID']] if len(same_ids) >= 1: ctrl_hwnds = same_ids try: ctrl = controls.WrapHandle(ctrl_hwnds[0]) except IndexError: print "-+-+=_" * 20 print found_criteria raise break # it is possible that the dialog will not be found - so we # should raise an error if dialog is None: raise findwindows.WindowNotFoundError() if len(criteria_) == 2 and ctrl is None: raise findwindows.WindowNotFoundError() if ctrl: return dialog, ctrl else: return (dialog, ) #print process_hwnds | 83885a77cbecf9a44ca5b16f8251c3d32fdabea8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6953/83885a77cbecf9a44ca5b16f8251c3d32fdabea8/application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10828,
67,
2080,
67,
2910,
892,
12,
3582,
67,
16,
595,
16,
2021,
273,
599,
16,
3300,
67,
6624,
273,
599,
4672,
315,
14309,
486,
506,
1399,
622,
326,
10382,
4442,
225,
309,
2021,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10828,
67,
2080,
67,
2910,
892,
12,
3582,
67,
16,
595,
16,
2021,
273,
599,
16,
3300,
67,
6624,
273,
599,
4672,
315,
14309,
486,
506,
1399,
622,
326,
10382,
4442,
225,
309,
2021,
... |
self.check_split(self.wrapper, text, expect) | self.check_split(text, expect) | def test_em_dash(self): # Test text with em-dashes text = "Em-dashes should be written -- thus." self.check_wrap(text, 25, ["Em-dashes should be", "written -- thus."]) | d1a72a0d5e14d04ea83f154e5ed23202d311db46 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/d1a72a0d5e14d04ea83f154e5ed23202d311db46/test_textwrap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
351,
67,
21817,
12,
2890,
4672,
468,
7766,
977,
598,
801,
17,
72,
7690,
977,
273,
315,
1514,
17,
72,
7690,
1410,
506,
5941,
1493,
12493,
1199,
365,
18,
1893,
67,
4113,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
351,
67,
21817,
12,
2890,
4672,
468,
7766,
977,
598,
801,
17,
72,
7690,
977,
273,
315,
1514,
17,
72,
7690,
1410,
506,
5941,
1493,
12493,
1199,
365,
18,
1893,
67,
4113,
12,
... |
if activity.status == "RLS": n = NewsItem(user=self.member.person, author=request.userid, course=activity.offering, source_app="grades", title="%s grade available" % (activity.name), | if self.activity.status == "RLS": n = NewsItem(user=self.member.person, author=None, course=self.activity.offering, source_app="grades", title="%s grade available" % (self.activity.offering), | def save(self): super(NumericGrade, self).save() if activity.status == "RLS": n = NewsItem(user=self.member.person, author=request.userid, course=activity.offering, source_app="grades", title="%s grade available" % (activity.name), content="...", url=reverse('grades.views.student', course_slug=course.slug) ) n.save() | 5b86bc080f2e0ac2cb75fe2d814675a45076f51d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6634/5b86bc080f2e0ac2cb75fe2d814675a45076f51d/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
2240,
12,
9902,
14571,
323,
16,
365,
2934,
5688,
1435,
309,
365,
18,
9653,
18,
2327,
422,
315,
54,
3045,
6877,
225,
290,
273,
27061,
1180,
12,
1355,
33,
2890,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
4672,
2240,
12,
9902,
14571,
323,
16,
365,
2934,
5688,
1435,
309,
365,
18,
9653,
18,
2327,
422,
315,
54,
3045,
6877,
225,
290,
273,
27061,
1180,
12,
1355,
33,
2890,
18,... |
instance.menuRecentFiles.delete(1,END) | menu = instance.menuRecentFiles menu.delete(1,END) i = 0 ; ul = 0; ullen = len(ullist) | def UpdateRecentFilesList(self,newFile=None): "Load or update the recent files list, and menu if required" rfList=[] if os.path.exists(self.recentFilesPath): RFfile=open(self.recentFilesPath,'r') try: rfList=RFfile.readlines() finally: RFfile.close() if newFile: newFile=os.path.abspath(newFile)+'\n' if newFile in rfList: rfList.remove(newFile) rfList.insert(0,newFile) rfList=self.__CleanRecentFiles(rfList) #print self.flist.inversedict #print self.top.instanceDict #print self if rfList: for instance in self.top.instanceDict.keys(): instance.menuRecentFiles.delete(1,END) for file in rfList: fileName=file[0:-1] instance.menuRecentFiles.add_command(label=fileName, command=instance.__RecentFileCallback(fileName)) | f9aa65e18bab94efccc6204d2c0ad0e56d6806dc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f9aa65e18bab94efccc6204d2c0ad0e56d6806dc/EditorWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
17076,
2697,
682,
12,
2890,
16,
2704,
812,
33,
7036,
4672,
315,
2563,
578,
1089,
326,
8399,
1390,
666,
16,
471,
3824,
309,
1931,
6,
9075,
682,
33,
8526,
309,
1140,
18,
803,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2315,
17076,
2697,
682,
12,
2890,
16,
2704,
812,
33,
7036,
4672,
315,
2563,
578,
1089,
326,
8399,
1390,
666,
16,
471,
3824,
309,
1931,
6,
9075,
682,
33,
8526,
309,
1140,
18,
803,
18,
... |
(u'day2', u'%02i', now.day), | def _interpolate(message, event): "Expand factoid variables" utcnow = datetime.utcnow() now = utcnow.replace(tzinfo=tzutc()).astimezone(tzlocal()) substitutions = [(u'who', event.sender['nick']), (u'channel', event.channel), (u'source', event.source), (u'year', unicode(now.year)), (u'month2', u'%02i' % now.month), (u'month1', unicode(now.month)), (u'month', unicode(now.strftime('%B'))), (u'mon', unicode(now.strftime('%b'))), (u'day', unicode(now.day)), (u'day2', u'%02i', now.day), (u'hour', unicode(now.hour)), (u'minute', unicode(now.minute)), (u'second', unicode(now.second)), (u'date', format_date(utcnow, 'date')), (u'time', format_date(utcnow, 'time')), (u'dow', unicode(now.strftime('%A'))), (u'weekday', unicode(now.strftime('%A'))), (u'unixtime', unicode(utcnow.strftime('%s'))), ] for var, expansion in substitutions: message = message.replace(u'$' + var, expansion) return message | 9e8ccd06cd34d716d21a940a75b355c08185a30c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12048/9e8ccd06cd34d716d21a940a75b355c08185a30c/factoid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
18676,
340,
12,
2150,
16,
871,
4672,
315,
12271,
5410,
839,
3152,
6,
19665,
273,
3314,
18,
17892,
3338,
1435,
2037,
273,
19665,
18,
2079,
12,
12994,
1376,
33,
12994,
17892,
1435,
29... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18676,
340,
12,
2150,
16,
871,
4672,
315,
12271,
5410,
839,
3152,
6,
19665,
273,
3314,
18,
17892,
3338,
1435,
2037,
273,
19665,
18,
2079,
12,
12994,
1376,
33,
12994,
17892,
1435,
29... | |
if self.writeAvailable > 0: | if self.writeLimit is None: return None elif self.writeAvailable > 0: | def registerWritten(self, length): """Called by protocol to tell us more bytes were written.""" # Check if there are bytes available to write if self.writeAvailable > 0: self.writeAvailable -= length return True return False | 58eccda74a195382b889cef4bef5351d7ade115f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/665/58eccda74a195382b889cef4bef5351d7ade115f/policies.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
12643,
12,
2890,
16,
769,
4672,
3536,
8185,
635,
1771,
358,
9276,
584,
1898,
1731,
4591,
5941,
12123,
468,
2073,
309,
1915,
854,
1731,
2319,
358,
1045,
309,
365,
18,
2626,
3039,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1744,
12643,
12,
2890,
16,
769,
4672,
3536,
8185,
635,
1771,
358,
9276,
584,
1898,
1731,
4591,
5941,
12123,
468,
2073,
309,
1915,
854,
1731,
2319,
358,
1045,
309,
365,
18,
2626,
3039,
35... |
J_C = ((alpha ** 2 * C5 * (-(Sqrt(2) * k ** 3 * (-10000 * beta ** 2 - (0, 15360) * beta * k + 6363 * k ** 2)) - Sqrt(kmax * (-k + kmax)) * ((0, 3840) * beta * (k - kmax) ** 2 * kmax + | J_C = ((alpha ** 2 * C5 * (-(Sqrt(2) * k ** 3 * (-10000 * beta ** 2 - 15360 * 1j * beta * k + 6363 * k ** 2)) - Sqrt(kmax * (-k + kmax)) * (3840 * 1j * beta * (k - kmax) ** 2 * kmax + | def J_C(self, k, alpha, beta, C5): """Solution for J_B which is the integral for B in terms of constants C3 and C4.""" kmax = k[-1] kmin = k[0] J_C = ((alpha ** 2 * C5 * (-(Sqrt(2) * k ** 3 * (-10000 * beta ** 2 - (0, 15360) * beta * k + 6363 * k ** 2)) - Sqrt(kmax * (-k + kmax)) * ((0, 3840) * beta * (k - kmax) ** 2 * kmax + 400 * beta ** 2 * (3 * k ** 2 - 14 * k * kmax + 8 * kmax ** 2) + 9 * (15 * k ** 4 + 10 * k ** 3 * kmax - 248 * k ** 2 * kmax ** 2 + 336 * k * kmax ** 3 - 128 * kmax ** 4)) + Sqrt(kmax * (k + kmax)) * ((0, 3840) * beta * kmax * (k + kmax) ** 2 + 400 * beta ** 2 * (3 * k ** 2 + 14 * k * kmax + 8 * kmax ** 2) - 9 * (-15 * k ** 4 + 10 * k ** 3 * kmax + 248 * k ** 2 * kmax ** 2 + 336 * k * kmax ** 3 + 128 * kmax ** 4)) + Sqrt((k - kmin) * kmin) * (-400 * beta ** 2 * (3 * k ** 2 - 14 * k * kmin + 8 * kmin ** 2) - (0, 60) * beta * (15 * k ** 3 - 54 * k ** 2 * kmin + 8 * k * kmin ** 2 + 16 * kmin ** 3) + 9 * (15 * k ** 4 + 10 * k ** 3 * kmin - 248 * k ** 2 * kmin ** 2 + 336 * k * kmin ** 3 - 128 * kmin ** 4)) + Sqrt(kmin) * Sqrt(k + kmin) * ((0, -3840) * beta * kmin * (k + kmin) ** 2 - 400 * beta ** 2 * (3 * k ** 2 + 14 * k * kmin + 8 * kmin ** 2) + 9 * (-15 * k ** 4 + 10 * k ** 3 * kmin + 248 * k ** 2 * kmin ** 2 + 336 * k * kmin ** 3 + 128 * kmin ** 4)) + (15 * k ** 3 * (-80 * beta ** 2 - (0, 60) * beta * k + 9 * k ** 2) * Pi) / 2. + 15 * k ** 3 * (80 * beta ** 2 + (0, 60) * beta * k - 9 * k ** 2) * ArcTan(Sqrt(kmin / (k - kmin))) - 15 * k ** 3 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * (1 + Sqrt(2)) * Sqrt(k)) + k ** 3 * (Sqrt(2) * (-10000 * beta ** 2 - (0, 15360) * beta * k + 6363 * k ** 2) + 15 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * Sqrt(k)) + 15 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * (1 + Sqrt(2)) * Sqrt(k))) - 15 * k ** 3 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * (Sqrt(kmax) + Sqrt(-k + kmax))) - 15 * k ** 3 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * (Sqrt(kmax) + Sqrt(k + kmax))) + 15 * k ** 3 * (80 * beta ** 2 + 9 * k ** 2) * Log(2 * (Sqrt(kmin) + Sqrt(k + kmin))))) / (14400. * beta ** 2 * k)) | 8a3dcbeb3a42e1c1040ab2e9d5cd6ce5cc20775d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7283/8a3dcbeb3a42e1c1040ab2e9d5cd6ce5cc20775d/analyticsolution.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
804,
67,
39,
12,
2890,
16,
417,
16,
4190,
16,
6796,
16,
385,
25,
4672,
3536,
16135,
364,
804,
67,
38,
1492,
353,
326,
21423,
364,
605,
316,
6548,
434,
6810,
385,
23,
471,
385,
24,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
804,
67,
39,
12,
2890,
16,
417,
16,
4190,
16,
6796,
16,
385,
25,
4672,
3536,
16135,
364,
804,
67,
38,
1492,
353,
326,
21423,
364,
605,
316,
6548,
434,
6810,
385,
23,
471,
385,
24,
... |
print >>sys.stderr, message | def sso(request): """Endpoint for AuthnRequests asynchronously sent, i.e. POST or Redirect""" # 1. Process the request, separate POST and GET treatment message = get_idff12_request_message(request) if not message: return HttpResponseForbidden('Invalid SAML 1.1 AuthnRequest: "%s"' % message) server = create_idff12_server(request) login = lasso.Login(server) while True: try: login.processAuthnRequestMsg(message) break except lasso.DsInvalidSignatureError: message = _('Invalid signature on SAML 1.1 AuthnRequest: %r') % message print >>sys.stderr, message logging.error(message) return HttpResponseForbidden() except lasso.ProfileInvalidMsgError: message = _('Invalid SAML 1.1 AuthnRequest: %r') % message logging.error(message) return HttpResponseForbidden() except lasso.ServerProviderNotFoundError: # This path is not exceptionnal it should be normal since we did # not load any provider in the Server object provider_id = login.remoteProviderId # 2. Lookup the ProviderID logging.info(_('ID-FFv1.2: AuthnRequest from %r') % provider_id) providers = LibertyProvider.objects.filter( entity_id = login.remoteProviderId) if not providers: # TODO: handle autoloading of metadatas consent_obtained = False message = _('ID-FFv1.2: provider %r unknown') % provider_id logging.warning(message) return HttpResponseForbidden(message) # XXX: does consent be always automatic for known providers ? Maybe # add a configuration key on the provider. consent_obtained = True server.addProviderFromBuffer(lasso.PROVIDER_ROLE_SP, providers[0].metadata.read()) # Flags possible: # - consent # - isPassive # - forceAuthn # # 3. TODO: Check for permission if login.mustAuthenticate(): # TODO: # check that it exists a login transaction for this request id # - if there is, then provoke one with a redirect to # login?next=<current_url> # - if there is then set user_authenticated to the result of the # login event # Work around lack of informations returned by mustAuthenticate() if login.request.forceAuthn or request.user.is_anonymous(): print >>sys.stderr, login.request.dump() return redirect_to_login(request.build_absolute_uri()) else: user_authenticated = True else: user_authenticated = not request.user.is_anonymous() # 3.1 Ask for consent if user_authenticated: # TODO: for autoloaded providers always ask for consent if login.mustAskForConsent() or not consent_obtained: # TODO: replace False by check against request id if False: consent_obtained = True # i.e. redirect to /idp/consent?id=requestId # then check that Consent(id=requestId) exists in the database else: return HttpResponseRedirect('consent?id=%s&next=%s' % ( login.request.requestId, urllib.quote(request.build_absolute_uri())) ) # 4. Validate the request, passing authentication and consent status try: print >>sys.stderr, 'coin' login.validateRequestMsg(user_authenticated, consent_obtained) print >>sys.stderr, 'coin' except: raise do_federation = False else: do_federation = True # 5. Lookup the federations if do_federation: load_federation(request, login) load_session(request, login) # 3. Build and assertion, fill attributes build_assertion(request, login) # 4. build response if login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_ART: print >>sys.stderr, 'coincoin' login.buildArtifactMsg(lasso.HTTP_METHOD_REDIRECT) save_artifact(request, login) elif login.protocolProfile == lasso.LOGIN_PROTOCOL_PROFILE_BRWS_POST: login.buildAuthnResponseMsg() else: raise NotImplementedError() save_federation(request, login) save_session(request, login) return return_idff12_response(login, title = _('Authentication response')) | 27b9b5b413eb834c493e6e48b4dd901785f657be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11208/27b9b5b413eb834c493e6e48b4dd901785f657be/idff12_endpoints.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27250,
12,
2293,
4672,
3536,
3293,
364,
3123,
82,
6421,
14952,
3271,
16,
277,
18,
73,
18,
5485,
578,
9942,
8395,
468,
404,
18,
4389,
326,
590,
16,
9004,
5485,
471,
4978,
24266,
883,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27250,
12,
2293,
4672,
3536,
3293,
364,
3123,
82,
6421,
14952,
3271,
16,
277,
18,
73,
18,
5485,
578,
9942,
8395,
468,
404,
18,
4389,
326,
590,
16,
9004,
5485,
471,
4978,
24266,
883,
27... | |
if (gcompris.get_properties().fullscreen): | if (gcompris.get_properties().fullscreen and not gcompris.get_properties().noxf86vm): | def child_callback(fd, cond, data): # restore pointergrab if running fullscreen if (gcompris.get_properties().fullscreen): gtk.gdk.pointer_grab(data.window.window, True, 0, data.window.window) #global board #board.window.set_property("accept-focus", 1) #board.window.set_keep_above(False) gcompris.sound.reopen() #a bug in tuxpaint 9.14: it does not suppress it lockfile lockfile = os.getenv('HOME') + '/.tuxpaint/lockfile.dat' try: os.remove(lockfile) except: print lockfile, 'not removed.' global pid pid = None gcompris.bar_hide(0) gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM) | f66ade93d9f146e79457097f9f5627f3f2deb211 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11306/f66ade93d9f146e79457097f9f5627f3f2deb211/tuxpaint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1151,
67,
3394,
12,
8313,
16,
225,
6941,
16,
501,
4672,
468,
5217,
4407,
2752,
70,
309,
3549,
1983,
9252,
309,
261,
75,
832,
683,
291,
18,
588,
67,
4738,
7675,
2854,
9252,
471,
486,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1151,
67,
3394,
12,
8313,
16,
225,
6941,
16,
501,
4672,
468,
5217,
4407,
2752,
70,
309,
3549,
1983,
9252,
309,
261,
75,
832,
683,
291,
18,
588,
67,
4738,
7675,
2854,
9252,
471,
486,
... |
version = int(version) | try : version = int(version) except ValueError : accession = record.id version = 0 | def _load_bioentry_table(self, record): """Fill the bioentry table with sequence information. | e319c614f79532d523a494d20fd52368313b6f6c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/e319c614f79532d523a494d20fd52368313b6f6c/Loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
21010,
4099,
67,
2121,
12,
2890,
16,
1409,
4672,
3536,
8026,
326,
25091,
4099,
1014,
598,
3102,
1779,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
945,
67,
21010,
4099,
67,
2121,
12,
2890,
16,
1409,
4672,
3536,
8026,
326,
25091,
4099,
1014,
598,
3102,
1779,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.