rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
'sl': (CAT, u"Category:Izbrani članki"), 'sq': (BACK, u"Template:Perfekt"), 'sr': (BACK, u"Шаблон:Изабрани"),
'sl': (CAT, u"Kategorija:Vsi izbrani članki"), 'sq': (BACK, u"Stampa:Artikulli perfekt"), 'sr': (CAT, u"Категорија:Изабрани"),
def LINKS(site,name, ignore=[]): p=wikipedia.Page(site, name) links=p.linkedPages() for n in links[:]: t=n.titleWithoutNamespace() if t[0] in u"/#" or t in ignore: links.remove(n) links.sort() return links
3e1ba3cfdef60ecb29c20449b00342c87340bac2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4404/3e1ba3cfdef60ecb29c20449b00342c87340bac2/featured.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22926, 55, 12, 4256, 16, 529, 16, 2305, 33, 8526, 4672, 293, 33, 11999, 13744, 18, 1964, 12, 4256, 16, 508, 13, 4716, 33, 84, 18, 17738, 5716, 1435, 364, 290, 316, 4716, 10531, 14542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22926, 55, 12, 4256, 16, 529, 16, 2305, 33, 8526, 4672, 293, 33, 11999, 13744, 18, 1964, 12, 4256, 16, 508, 13, 4716, 33, 84, 18, 17738, 5716, 1435, 364, 290, 316, 4716, 10531, 14542, ...
if not os.path.exists(name): return None
if not os.path.exists(name): return None, None
def get_info(name): """ Get info for a locally installed campaign. If expects a direct path to the info.cfg file. """ if not os.path.exists(name): return None p = wmlparser.Parser(None) p.parse_file(name) info = wmldata.DataSub("WML") p.parse_top(info) uploads = info.get_or_create_sub("info").get_text_val("uploads", "") version = info.get_or_create_sub("info").get_text_val("version", "") return uploads, version
8994b2eead22777a4e67b9a4e2afb8f3fb75b843 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/8994b2eead22777a4e67b9a4e2afb8f3fb75b843/campaigns_client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1376, 12, 529, 4672, 3536, 968, 1123, 364, 279, 13760, 5876, 8965, 18, 971, 10999, 279, 2657, 589, 358, 326, 1123, 18, 7066, 585, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1376, 12, 529, 4672, 3536, 968, 1123, 364, 279, 13760, 5876, 8965, 18, 971, 10999, 279, 2657, 589, 358, 326, 1123, 18, 7066, 585, 18, 3536, 309, 486, 1140, 18, 803, 18, 1808, ...
def _wrap_ayum_getKeyForRepo(repo, callback=None): """ This is a wrapper for calling self.ayum.getKeyForRepo() because otherwise we take a real reference through the bound method and that is d00m. """ return self.ayum.getKeyForRepo(repo, callback)
def __init__(self, ayum): self.repos = {} # list of repos by repoid pointing a repo object # of repo options/misc data self.callback = None # progress callback used for populateSack() for importing the xml files self.cache = 0 self.pkgSack = MetaSack() self.logger = logging.getLogger("yum.RepoStorage")
9ef1d3f6193fe6135fa7d8c31eca447a66007dfe /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5445/9ef1d3f6193fe6135fa7d8c31eca447a66007dfe/repos.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 26179, 379, 4672, 365, 18, 15564, 273, 2618, 468, 666, 434, 13686, 635, 2071, 839, 17022, 279, 3538, 733, 468, 434, 3538, 702, 19, 23667, 501, 365, 18, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 26179, 379, 4672, 365, 18, 15564, 273, 2618, 468, 666, 434, 13686, 635, 2071, 839, 17022, 279, 3538, 733, 468, 434, 3538, 702, 19, 23667, 501, 365, 18, 3...
recdate=time.strptime( "%s" % record[1],"%Y-%m-%d %H:%M:%S")
recdate=time.strptime( "%s" % record[0],"%Y-%m-%d %H:%M:%S")
def getFileInformation(file, outputfile): impl = xml.dom.minidom.getDOMImplementation() infoDOM = impl.createDocument(None, "fileinfo", None) top_element = infoDOM.documentElement # if the jobfile has amended file details use them details = file.getElementsByTagName("details") if details.length > 0: node = infoDOM.createElement("type") node.appendChild(infoDOM.createTextNode(file.attributes["type"].value)) top_element.appendChild(node) node = infoDOM.createElement("filename") node.appendChild(infoDOM.createTextNode(file.attributes["filename"].value)) top_element.appendChild(node) node = infoDOM.createElement("title") node.appendChild(infoDOM.createTextNode(details[0].attributes["title"].value)) top_element.appendChild(node) node = infoDOM.createElement("recordingdate") node.appendChild(infoDOM.createTextNode(details[0].attributes["startdate"].value)) top_element.appendChild(node) node = infoDOM.createElement("recordingtime") node.appendChild(infoDOM.createTextNode(details[0].attributes["starttime"].value)) top_element.appendChild(node) node = infoDOM.createElement("subtitle") node.appendChild(infoDOM.createTextNode(details[0].attributes["subtitle"].value)) top_element.appendChild(node) node = infoDOM.createElement("description") node.appendChild(infoDOM.createTextNode(getText(details[0]))) top_element.appendChild(node) node = infoDOM.createElement("rating") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("coverfile") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) #FIXME: add cutlist to details? node = infoDOM.createElement("cutlist") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) #if this a myth recording we still need to find the chanid, starttime and hascutlist if file.attributes["type"].value=="recording": sqlstatement = """SELECT starttime, chanid FROM recorded WHERE basename = '%s'""" % file.attributes["filename"].value.replace("'", "\\'") db = getDatabaseConnection() cursor = db.cursor() cursor.execute(sqlstatement) result = cursor.fetchall() numrows = int(cursor.rowcount) #We must have exactly 1 row returned for this recording if numrows!=1: fatalError("Failed to get recording details from the DB for %s" % file.attributes["filename"].value) # iterate through resultset for record in result: node = infoDOM.createElement("chanid") node.appendChild(infoDOM.createTextNode("%s" % record[0])) top_element.appendChild(node) #date time is returned as 2005-12-19 00:15:00 recdate=time.strptime( "%s" % record[1],"%Y-%m-%d %H:%M:%S") node = infoDOM.createElement("starttime") node.appendChild(infoDOM.createTextNode( time.strftime("%Y-%m-%dT%H:%M:%S", recdate))) top_element.appendChild(node) starttime = record[0] chanid = record[1] # find the cutlist if available sqlstatement = """SELECT mark, type FROM recordedmarkup WHERE chanid = '%s' AND starttime = '%s' AND type IN (0,1) ORDER BY mark""" % (chanid, starttime) cursor = db.cursor() # execute SQL statement cursor.execute(sqlstatement) if cursor.rowcount > 0: node = infoDOM.createElement("hascutlist") node.appendChild(infoDOM.createTextNode("yes")) top_element.appendChild(node) else: node = infoDOM.createElement("hascutlist") node.appendChild(infoDOM.createTextNode("no")) top_element.appendChild(node) db.close() del db del cursor elif file.attributes["type"].value=="recording": sqlstatement = """SELECT progstart, stars, cutlist, category, description, subtitle, title, starttime, chanid FROM recorded WHERE basename = '%s'""" % file.attributes["filename"].value.replace("'", "\\'") # connect db = getDatabaseConnection() # create a cursor cursor = db.cursor() # execute SQL statement cursor.execute(sqlstatement) # get the resultset as a tuple result = cursor.fetchall() # get the number of rows in the resultset numrows = int(cursor.rowcount) #We must have exactly 1 row returned for this recording if numrows!=1: fatalError("Failed to get recording details from the DB for %s" % file.attributes["filename"].value) # iterate through resultset for record in result: #write( record[0] , "-->", record[1], record[2], record[3]) write( " " + record[6]) #Create an XML DOM to hold information about this video file node = infoDOM.createElement("type") node.appendChild(infoDOM.createTextNode(file.attributes["type"].value)) top_element.appendChild(node) node = infoDOM.createElement("filename") node.appendChild(infoDOM.createTextNode(file.attributes["filename"].value)) top_element.appendChild(node) node = infoDOM.createElement("title") node.appendChild(infoDOM.createTextNode(unicode(record[6], "UTF-8"))) top_element.appendChild(node) #date time is returned as 2005-12-19 00:15:00 recdate=time.strptime( "%s" % record[0],"%Y-%m-%d %H:%M:%S") node = infoDOM.createElement("recordingdate") node.appendChild(infoDOM.createTextNode( time.strftime(dateformat,recdate) )) top_element.appendChild(node) node = infoDOM.createElement("recordingtime") node.appendChild(infoDOM.createTextNode( time.strftime(timeformat,recdate))) top_element.appendChild(node) node = infoDOM.createElement("subtitle") node.appendChild(infoDOM.createTextNode(unicode(record[5], "UTF-8"))) top_element.appendChild(node) node = infoDOM.createElement("description") node.appendChild(infoDOM.createTextNode(unicode(record[4], "UTF-8"))) top_element.appendChild(node) node = infoDOM.createElement("rating") node.appendChild(infoDOM.createTextNode("%s" % record[1])) top_element.appendChild(node) node = infoDOM.createElement("coverfile") node.appendChild(infoDOM.createTextNode("")) #node.appendChild(infoDOM.createTextNode(record[8])) top_element.appendChild(node) node = infoDOM.createElement("chanid") node.appendChild(infoDOM.createTextNode("%s" % record[8])) top_element.appendChild(node) #date time is returned as 2005-12-19 00:15:00 recdate=time.strptime( "%s" % record[7],"%Y-%m-%d %H:%M:%S") node = infoDOM.createElement("starttime") node.appendChild(infoDOM.createTextNode( time.strftime("%Y-%m-%dT%H:%M:%S", recdate))) top_element.appendChild(node) starttime = record[7] chanid = record[8] # find the cutlist if available sqlstatement = """SELECT mark, type FROM recordedmarkup WHERE chanid = '%s' AND starttime = '%s' AND type IN (0,1) ORDER BY mark""" % (chanid, starttime) cursor = db.cursor() # execute SQL statement cursor.execute(sqlstatement) if cursor.rowcount > 0: node = infoDOM.createElement("hascutlist") node.appendChild(infoDOM.createTextNode("yes")) top_element.appendChild(node) else: node = infoDOM.createElement("hascutlist") node.appendChild(infoDOM.createTextNode("no")) top_element.appendChild(node) db.close() del db del cursor elif file.attributes["type"].value=="video": filename = os.path.join(videopath, file.attributes["filename"].value.replace("'", "\\'")) sqlstatement="""select title, director, plot, rating, inetref, year, userrating, length, coverfile from videometadata where filename='%s'""" % filename # connect db = getDatabaseConnection() # create a cursor cursor = db.cursor() # execute SQL statement cursor.execute(sqlstatement) # get the resultset as a tuple result = cursor.fetchall() # get the number of rows in the resultset numrows = int(cursor.rowcount) #title,director,plot,rating,inetref,year,userrating,length,coverfile #We must have exactly 1 row returned for this recording if numrows<>1: #Theres no record in the database so use a dummy row so we dont die! #title,director,plot,rating,inetref,year,userrating,length,coverfile record = file.attributes["filename"].value, "","",0,"","",0,0,"" for record in result: write( " " + record[0]) node = infoDOM.createElement("type") node.appendChild(infoDOM.createTextNode(file.attributes["type"].value)) top_element.appendChild(node) node = infoDOM.createElement("filename") node.appendChild(infoDOM.createTextNode(file.attributes["filename"].value)) top_element.appendChild(node) node = infoDOM.createElement("title") node.appendChild(infoDOM.createTextNode(unicode(record[0], "UTF-8"))) top_element.appendChild(node) node = infoDOM.createElement("recordingdate") date = int(record[5]) if date != 1895: node.appendChild(infoDOM.createTextNode("%s" % record[5])) else: node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("recordingtime") #node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("subtitle") #node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("description") desc = unicode(record[2], "UTF-8") if desc != "None": node.appendChild(infoDOM.createTextNode(desc)) else: node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("rating") node.appendChild(infoDOM.createTextNode("%s" % record[6])) top_element.appendChild(node) node = infoDOM.createElement("cutlist") #node.appendChild(infoDOM.createTextNode(record[2])) top_element.appendChild(node) node = infoDOM.createElement("coverfile") if doesFileExist(record[8]): node.appendChild(infoDOM.createTextNode(record[8])) else: node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) db.close() del db del cursor elif file.attributes["type"].value=="file": node = infoDOM.createElement("type") node.appendChild(infoDOM.createTextNode(file.attributes["type"].value)) top_element.appendChild(node) node = infoDOM.createElement("filename") node.appendChild(infoDOM.createTextNode(file.attributes["filename"].value)) top_element.appendChild(node) node = infoDOM.createElement("title") node.appendChild(infoDOM.createTextNode(file.attributes["filename"].value)) top_element.appendChild(node) node = infoDOM.createElement("recordingdate") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("recordingtime") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("subtitle") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("description") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("rating") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("cutlist") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) node = infoDOM.createElement("coverfile") node.appendChild(infoDOM.createTextNode("")) top_element.appendChild(node) WriteXMLToFile (infoDOM, outputfile)
c01667a2e10b3707bac6f8d9bbdd43eb0fa8d89d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/13713/c01667a2e10b3707bac6f8d9bbdd43eb0fa8d89d/mythburn.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 5369, 12, 768, 16, 876, 768, 4672, 9380, 273, 2025, 18, 9859, 18, 1154, 350, 362, 18, 588, 8168, 13621, 1435, 1123, 8168, 273, 9380, 18, 2640, 2519, 12, 7036, 16, 315, 768, 1376,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6034, 5369, 12, 768, 16, 876, 768, 4672, 9380, 273, 2025, 18, 9859, 18, 1154, 350, 362, 18, 588, 8168, 13621, 1435, 1123, 8168, 273, 9380, 18, 2640, 2519, 12, 7036, 16, 315, 768, 1376,...
data = re.sub(r'<([^<\s]+?)\s*/>', self._shorttag_replace, data)
data = re.sub(r'<([^<>\s]+?)\s*/>', self._shorttag_replace, data)
def feed(self, data): data = re.compile(r'<!((?!DOCTYPE|--|\[))', re.IGNORECASE).sub(r'&lt;!\1', data) #data = re.sub(r'<(\S+?)\s*?/>', self._shorttag_replace, data) # bug [ 1399464 ] Bad regexp for _shorttag_replace data = re.sub(r'<([^<\s]+?)\s*/>', self._shorttag_replace, data) data = data.replace('&#39;', "'") data = data.replace('&#34;', '"') if self.encoding and type(data) == type(u''): data = data.encode(self.encoding) sgmllib.SGMLParser.feed(self, data)
44482af2baebba8741223b8967e4efeaf8365c45 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/44482af2baebba8741223b8967e4efeaf8365c45/feedparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4746, 12, 2890, 16, 501, 4672, 501, 273, 283, 18, 11100, 12, 86, 11, 5586, 12, 19306, 29824, 96, 413, 8960, 63, 3719, 2187, 283, 18, 20118, 13415, 2934, 1717, 12, 86, 11, 10, 5618, 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, 4746, 12, 2890, 16, 501, 4672, 501, 273, 283, 18, 11100, 12, 86, 11, 5586, 12, 19306, 29824, 96, 413, 8960, 63, 3719, 2187, 283, 18, 20118, 13415, 2934, 1717, 12, 86, 11, 10, 5618, 3...
print "IGNORING table"
pass
def render_table(self, table): tabletext = [] prev = table.previous if getattr(prev, 'name', None) == 'a' and prev.get('name', None) == 'end': print "IGNORING table" elif getattr(table.next, 'name', None) != 'tr': print "IGNORING table" elif re.search('attended the Committee', (table.findPrevious(text=re.compile('[a-z]')) or '').strip()): print "IGNORING table" elif len(table.findAllPrevious(text=re.compile('[a-z]'))) < 6: print "IGNORING table" else: print "PRINTING table" tabletext.append('<data>') tabletext.append(str(table)) tabletext.append('</data>') table.contents = [] print str(table)[0:200] return ''.join(tabletext)
6f5d3aa05f0dcde05fa26d65e6d987be8dbcf0d2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8428/6f5d3aa05f0dcde05fa26d65e6d987be8dbcf0d2/parse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 2121, 12, 2890, 16, 1014, 4672, 11968, 408, 273, 5378, 2807, 273, 1014, 18, 11515, 309, 3869, 12, 10001, 16, 296, 529, 2187, 599, 13, 422, 296, 69, 11, 471, 2807, 18, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 2121, 12, 2890, 16, 1014, 4672, 11968, 408, 273, 5378, 2807, 273, 1014, 18, 11515, 309, 3869, 12, 10001, 16, 296, 529, 2187, 599, 13, 422, 296, 69, 11, 471, 2807, 18, 588, ...
if self.need_refresh:
flag = 0 if not self.has_info(): flag = 1
def get_info(self): """ Return a dictonary with items that are compatible with scipy_distutils.setup keyword arguments. """ if self.need_refresh: if self.verbose: print self.__class__.__name__ + ':' for p in self.local_prefixes + prefixes: if self.verbose: print ' Looking in',p,'...' self.calc_info(p) if self.info: break self.need_refresh = 0 if self.verbose: if not self.info: print ' NOT AVAILABLE' else: print ' FOUND:' for k,v in self.info.items(): print ' %s = %s'%(k,v) print return self.info
06a9f21379b2631f3e5fd182ea2af524fedbdf28 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/06a9f21379b2631f3e5fd182ea2af524fedbdf28/system_info.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1376, 12, 2890, 4672, 3536, 2000, 279, 2065, 265, 814, 598, 1516, 716, 854, 7318, 598, 10966, 67, 4413, 5471, 18, 8401, 4932, 1775, 18, 3536, 2982, 273, 374, 309, 486, 365, 18...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1376, 12, 2890, 4672, 3536, 2000, 279, 2065, 265, 814, 598, 1516, 716, 854, 7318, 598, 10966, 67, 4413, 5471, 18, 8401, 4932, 1775, 18, 3536, 2982, 273, 374, 309, 486, 365, 18...
while not channel.has_result():
while True: yield inner
def _inc(inner, self, key, channel, channels): try: while not channel.has_result(): for item in inner: inner.send(item) for _ in channel: pass yield inner, channel finally: channels.discard(channel) if self.counter.dec(key): callqueue.add(self._check, key) inner.finish(channel.result())
010e3ceb7ac4166a932dfbd4f9020a6aa1795911 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14361/010e3ceb7ac4166a932dfbd4f9020a6aa1795911/taskfarm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9523, 12, 7872, 16, 365, 16, 498, 16, 1904, 16, 5750, 4672, 775, 30, 1323, 1053, 30, 2824, 3443, 364, 761, 316, 3443, 30, 3443, 18, 4661, 12, 1726, 13, 364, 389, 316, 1904, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9523, 12, 7872, 16, 365, 16, 498, 16, 1904, 16, 5750, 4672, 775, 30, 1323, 1053, 30, 2824, 3443, 364, 761, 316, 3443, 30, 3443, 18, 4661, 12, 1726, 13, 364, 389, 316, 1904, 30, ...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 755) else quickfix.StringField.__init__(self, 755, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 2371, 2539, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 780, 974, 16186, 2738, 972, 12, 2890, 16, 2371, 2539, 13, 469, 9549, 904, 18, 780, 974, 16186, 2738, ...
mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum'))
def __init__(self, rootObj, conf): self.rootObj = rootObj self.yum_cache_opts = conf self.yumSharedCachePath = self.yum_cache_opts['dir'] % self.yum_cache_opts self.state = rootObj.state self.rootdir = rootObj.rootdir self.online = rootObj.online rootObj.yum_cacheObj = self rootObj.addHook("preyum", self._yumCachePreYumHook) rootObj.addHook("postyum", self._yumCachePostYumHook) rootObj.addHook("preinit", self._yumCachePreInitHook) rootObj.umountCmds.append('umount -n %s/var/cache/yum' % rootObj.rootdir) rootObj.mountCmds.append('mount -n --bind %s %s/var/cache/yum' % (self.yumSharedCachePath, rootObj.rootdir)) mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum')) mock.util.mkdirIfAbsent(self.yumSharedCachePath) self.yumCacheLock = open(os.path.join(self.yumSharedCachePath, "yumcache.lock"), "a+")
fc3a2ad3016ab8a5c20d71cbd34e9b40f056f7f5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7328/fc3a2ad3016ab8a5c20d71cbd34e9b40f056f7f5/yum_cache.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1365, 2675, 16, 2195, 4672, 365, 18, 3085, 2675, 273, 1365, 2675, 365, 18, 93, 379, 67, 2493, 67, 4952, 273, 2195, 365, 18, 93, 379, 7887, 1649, 743, 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, 1001, 2738, 972, 12, 2890, 16, 1365, 2675, 16, 2195, 4672, 365, 18, 3085, 2675, 273, 1365, 2675, 365, 18, 93, 379, 67, 2493, 67, 4952, 273, 2195, 365, 18, 93, 379, 7887, 1649, 743, 2...
x1 = self.archive._int()
x1 = self.archive._int32()
def testInt(self): """Test storage and retrieval of Int""" x0 = 42 self.archive._int(x0) self.setRead() self.assertEqual(self.size, 4) x1 = self.archive._int() self.assertEqual(x0, x1)
527997eab92cc3a66dcd3f6f3b3042ee1a85d9b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14747/527997eab92cc3a66dcd3f6f3b3042ee1a85d9b8/ArchiveTests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 1702, 12, 2890, 4672, 3536, 4709, 2502, 471, 22613, 434, 3094, 8395, 619, 20, 273, 14856, 365, 18, 10686, 6315, 474, 12, 92, 20, 13, 365, 18, 542, 1994, 1435, 365, 18, 11231, 581...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1702, 12, 2890, 4672, 3536, 4709, 2502, 471, 22613, 434, 3094, 8395, 619, 20, 273, 14856, 365, 18, 10686, 6315, 474, 12, 92, 20, 13, 365, 18, 542, 1994, 1435, 365, 18, 11231, 581...
"A wrap around all filesystem operations"
"""A cross-platform, abstract wrapper for filesystem operations."""
def close(self): if not self.file.closed: self.file.close()
367a95e4363ae8b7515230480fff6ef354b95226 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3782/367a95e4363ae8b7515230480fff6ef354b95226/FTPServer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 309, 486, 365, 18, 768, 18, 12204, 30, 365, 18, 768, 18, 4412, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 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, 1746, 12, 2890, 4672, 309, 486, 365, 18, 768, 18, 12204, 30, 365, 18, 768, 18, 4412, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sage: J = range(7)
sage: J = range(8)
def dwt(self,other="haar",wavelet_k=2): """ Wraps the gsl WaveletTransform.forward in dwt.pyx (written by Johua Kantor). Assumes the length of the sample is a power of 2. Uses the GSL function gsl_wavelet_transform_forward.
431e77dd49c749a75ebdd4465e177155608021e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/431e77dd49c749a75ebdd4465e177155608021e6/dft.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 6046, 12, 2890, 16, 3011, 1546, 3395, 297, 3113, 24801, 808, 67, 79, 33, 22, 4672, 3536, 678, 7506, 326, 314, 2069, 678, 842, 808, 4059, 18, 11565, 316, 302, 6046, 18, 2074, 92, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 302, 6046, 12, 2890, 16, 3011, 1546, 3395, 297, 3113, 24801, 808, 67, 79, 33, 22, 4672, 3536, 678, 7506, 326, 314, 2069, 678, 842, 808, 4059, 18, 11565, 316, 302, 6046, 18, 2074, 92, ...
del cleaned_data["numberUnitsDamaged"] self._errors["numberUnitsDamaged"] = self.error_class(["You have forgotten Damaged reason"]) else: print 'ok' return cleaned_data
raise forms.ValidationError("You have forgotten to select the Damage Reason") return my_dr
def clean(self): cleaned_data = self.cleaned_data my_losses = cleaned_data.get('numberUnitsLost') my_lr = cleaned_data.get('unitsLostReason') my_damadged = cleaned_data.get('numberUnitsDamaged') my_dr = cleaned_data.get('unitsDamagedReason')
98959dbdb10174fc285daa151fcafa2459af00d7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12559/98959dbdb10174fc285daa151fcafa2459af00d7/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 12, 2890, 4672, 9426, 67, 892, 273, 365, 18, 6200, 329, 67, 892, 3399, 67, 30851, 273, 9426, 67, 892, 18, 588, 2668, 2696, 7537, 19024, 6134, 3399, 67, 10826, 273, 9426, 67, 892,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2721, 12, 2890, 4672, 9426, 67, 892, 273, 365, 18, 6200, 329, 67, 892, 3399, 67, 30851, 273, 9426, 67, 892, 18, 588, 2668, 2696, 7537, 19024, 6134, 3399, 67, 10826, 273, 9426, 67, 892,...
if takes_libs: if libraries is None: libraries = self.libraries elif type (libraries) in (ListType, TupleType): libraries = list (libraries) + (self.libraries or []) else: raise TypeError, \ "'libraries' (if supplied) must be a list of strings" if library_dirs is None: library_dirs = self.library_dirs elif type (library_dirs) in (ListType, TupleType): library_dirs = list (library_dirs) + (self.library_dirs or []) else: raise TypeError, \ "'library_dirs' (if supplied) must be a list of strings" return (objects, output_dir, libraries, library_dirs)
return (objects, output_dir) def _fix_lib_args (self, libraries, library_dirs, runtime_library_dirs): """Typecheck and fix up some of the arguments supplied to the 'link_*' methods. Specifically: ensure that all arguments are lists, and augment them with their permanent versions (eg. 'self.libraries' augments 'libraries'). Return a tuple with fixed versions of all arguments.""" if libraries is None: libraries = self.libraries elif type (libraries) in (ListType, TupleType): libraries = list (libraries) + (self.libraries or [])
def _fix_link_args (self, objects, output_dir, takes_libs=0, libraries=None, library_dirs=None): """Typecheck and fix up some of the arguments supplied to the 'link_*' methods and return the fixed values. Specifically: ensure that 'objects' is a list; if output_dir is None, use self.output_dir; ensure that 'libraries' and 'library_dirs' are both lists, and augment them with 'self.libraries' and 'self.library_dirs'. If 'takes_libs' is true, return a tuple (objects, output_dir, libraries, library_dirs; else return (objects, output_dir)."""
95814602b55f2db3c2f66568a412da3709fb4635 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/95814602b55f2db3c2f66568a412da3709fb4635/ccompiler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 904, 67, 1232, 67, 1968, 261, 2890, 16, 2184, 16, 876, 67, 1214, 16, 5530, 67, 21571, 33, 20, 16, 14732, 33, 7036, 16, 5313, 67, 8291, 33, 7036, 4672, 3536, 559, 1893, 471, 2917...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 904, 67, 1232, 67, 1968, 261, 2890, 16, 2184, 16, 876, 67, 1214, 16, 5530, 67, 21571, 33, 20, 16, 14732, 33, 7036, 16, 5313, 67, 8291, 33, 7036, 4672, 3536, 559, 1893, 471, 2917...
key = '%s:%s' % (self.plotName(), name)
key = '%s/%s' % (self.plotName(), name)
def savePen(self, name, pen): key = '%s:%s' % (self.plotName(), name) self.settings.setValue(key, pen)
14ad4626440885b949068a9ed1513d52a79f0e96 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3979/14ad4626440885b949068a9ed1513d52a79f0e96/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 24251, 12, 2890, 16, 508, 16, 14264, 4672, 498, 273, 1995, 87, 5258, 87, 11, 738, 261, 2890, 18, 4032, 461, 9334, 508, 13, 365, 18, 4272, 18, 542, 620, 12, 856, 16, 14264, 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, 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, 24251, 12, 2890, 16, 508, 16, 14264, 4672, 498, 273, 1995, 87, 5258, 87, 11, 738, 261, 2890, 18, 4032, 461, 9334, 508, 13, 365, 18, 4272, 18, 542, 620, 12, 856, 16, 14264, 13, ...
self.wfile.write('''\
self.body.append('''\
def pageHeader(self, title): """Render the page header""" self.wfile.write('''\
9ec27745eca2b32846ac6d0967914e882c0b0a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2097/9ec27745eca2b32846ac6d0967914e882c0b0a74/openid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 1864, 12, 2890, 16, 2077, 4672, 3536, 3420, 326, 1363, 1446, 8395, 365, 18, 91, 768, 18, 2626, 2668, 6309, 64, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1363, 1864, 12, 2890, 16, 2077, 4672, 3536, 3420, 326, 1363, 1446, 8395, 365, 18, 91, 768, 18, 2626, 2668, 6309, 64, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if optional and type(params[0]) is type(()):
if optional and type(params[0]) is TupleType:
def subconvert(self, endchar=None, depth=0): stack = [] line = self.line if DEBUG and endchar: self.err_write( "subconvert(%s)\n line = %s\n" % (`endchar`, `line[:20]`)) while line: if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line return line m = _comment_rx.match(line) if m: text = m.group(1) if text: self.write("(COMMENT\n- %s \n)COMMENT\n-\\n\n" % encode(text)) line = line[m.end():] continue m = _begin_env_rx.match(line) if m: # re-write to use the macro handler line = r"\%s %s" % (m.group(1), line[m.end():]) continue m = _end_env_rx.match(line) if m: # end of environment envname = m.group(1) if envname == "document": # special magic for n in stack[1:]: if n not in self.autoclosing: raise LaTeXFormatError( "open element on stack: " + `n`) # should be more careful, but this is easier to code: stack = [] self.write(")document\n") elif stack and envname == stack[-1]: self.write(")%s\n" % envname) del stack[-1] popping(envname, "a", len(stack) + depth) else: self.err_write("stack: %s\n" % `stack`) raise LaTeXFormatError( "environment close for %s doesn't match" % envname) line = line[m.end():] continue m = _begin_macro_rx.match(line) if m: # start of macro macroname = m.group(1) if macroname == "verbatim": # really magic case! pos = string.find(line, "\\end{verbatim}") text = line[m.end(1):pos] self.write("(verbatim\n") self.write("-%s\n" % encode(text)) self.write(")verbatim\n") line = line[pos + len("\\end{verbatim}"):] continue numbered = 1 opened = 0 if macroname[-1] == "*": macroname = macroname[:-1] numbered = 0 if macroname in self.autoclosing and macroname in stack: while stack[-1] != macroname: top = stack.pop() if top and top not in self.discards: self.write(")%s\n-\\n\n" % top) popping(top, "b", len(stack) + depth) if macroname not in self.discards: self.write("-\\n\n)%s\n-\\n\n" % macroname) popping(macroname, "c", len(stack) + depth - 1) del stack[-1] # if macroname in self.discards: self.push_output(StringIO.StringIO()) else: self.push_output(self.ofp) # params, optional, empty, environ = self.start_macro(macroname) if not numbered: self.write("Anumbered TOKEN no\n") # rip off the macroname if params: if optional and len(params) == 1: line = line[m.end():] else: line = line[m.end(1):] elif empty: line = line[m.end(1):] else: line = line[m.end():] # # Very ugly special case to deal with \item[]. The catch # is that this needs to occur outside the for loop that # handles attribute parsing so we can 'continue' the outer # loop. # if optional and type(params[0]) is type(()): # the attribute name isn't used in this special case pushing(macroname, "a", depth + len(stack)) stack.append(macroname) self.write("(%s\n" % macroname) m = _start_optional_rx.match(line) if m: self.line = line[m.end():] line = self.subconvert("]", depth + len(stack)) line = "}" + line continue # handle attribute mappings here: for attrname in params: if optional: optional = 0 if type(attrname) is type(""): m = _optional_rx.match(line) if m: line = line[m.end():] self.write("A%s TOKEN %s\n" % (attrname, encode(m.group(1)))) elif type(attrname) is type(()): # This is a sub-element; but don't place the # element we found on the stack (\section-like) pushing(macroname, "b", len(stack) + depth) stack.append(macroname) self.write("(%s\n" % macroname) macroname = attrname[0] m = _start_group_rx.match(line) if m: line = line[m.end():] elif type(attrname) is type([]): # A normal subelement: <macroname><attrname>...</>... attrname = attrname[0] if not opened: opened = 1 self.write("(%s\n" % macroname) pushing(macroname, "c", len(stack) + depth) self.write("(%s\n" % attrname) pushing(attrname, "sub-elem", len(stack) + depth + 1) self.line = skip_white(line)[1:] line = self.subconvert("}", len(stack) + depth + 1)[1:] dbgmsg("subconvert() ==> " + `line[:20]`) popping(attrname, "sub-elem", len(stack) + depth + 1) self.write(")%s\n" % attrname) else: m = _parameter_rx.match(line) if not m: raise LaTeXFormatError( "could not extract parameter %s for %s: %s" % (attrname, macroname, `line[:100]`)) value = m.group(1) if _token_rx.match(value): dtype = "TOKEN" else: dtype = "CDATA" self.write("A%s %s %s\n" % (attrname, dtype, encode(value))) line = line[m.end():] if params and type(params[-1]) is type('') \ and (not empty) and not environ: # attempt to strip off next '{' m = _start_group_rx.match(line) if not m: raise LaTeXFormatError( "non-empty element '%s' has no content: %s" % (macroname, line[:12])) line = line[m.end():] if not opened: self.write("(%s\n" % macroname) pushing(macroname, "d", len(stack) + depth) if empty: line = "}" + line stack.append(macroname) self.pop_output() continue if line[0] == endchar and not stack: if DEBUG: self.err_write("subconvert() --> %s\n" % `line[1:21]`) self.line = line[1:] return self.line if line[0] == "}": # end of macro or group macroname = stack[-1] conversion = self.table.get(macroname) if macroname \ and macroname not in self.discards \ and type(conversion) is not type(""): # otherwise, it was just a bare group self.write(")%s\n" % stack[-1]) popping(macroname, "d", len(stack) + depth - 1) del stack[-1] line = line[1:] continue if line[0] == "{": pushing("", "e", len(stack) + depth) stack.append("") line = line[1:] continue if line[0] == "\\" and line[1] in ESCAPED_CHARS: self.write("-%s\n" % encode(line[1])) line = line[2:] continue if line[:2] == r"\\": self.write("(BREAK\n)BREAK\n") line = line[2:] continue m = _text_rx.match(line) if m: text = encode(m.group()) self.write("-%s\n" % text) line = line[m.end():] continue # special case because of \item[] if line[0] == "]": self.write("-]\n") line = line[1:] continue # avoid infinite loops extra = "" if len(line) > 100: extra = "..." raise LaTeXFormatError("could not identify markup: %s%s" % (`line[:100]`, extra)) while stack and stack[-1] in self.autoclosing: self.write("-\\n\n") self.write(")%s\n" % stack[-1]) popping(stack.pop(), "e", len(stack) + depth - 1) if stack: raise LaTeXFormatError("elements remain on stack: " + string.join(stack, ", ")) # otherwise we just ran out of input here...
54fb7fb9d0ff1c96849572ff809cc9323e87bfa4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/54fb7fb9d0ff1c96849572ff809cc9323e87bfa4/latex2esis.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 6283, 12, 2890, 16, 679, 3001, 33, 7036, 16, 3598, 33, 20, 4672, 2110, 273, 5378, 980, 273, 365, 18, 1369, 309, 6369, 471, 679, 3001, 30, 365, 18, 370, 67, 2626, 12, 315, 1717, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 6283, 12, 2890, 16, 679, 3001, 33, 7036, 16, 3598, 33, 20, 4672, 2110, 273, 5378, 980, 273, 365, 18, 1369, 309, 6369, 471, 679, 3001, 30, 365, 18, 370, 67, 2626, 12, 315, 1717, ...
res = utils._regex.findall(node.text) for key in res: newtext = eval(key, {}, self.localcontext) node.text = newtext image_data = base64.decodestring(node.text) if not image_data: return False s = cStringIO.StringIO(image_data)
res = utils._regex.findall(node.text) for key in res: newtext = eval(key, {}, self.localcontext) node.text = newtext image_data = None if node.text: image_data = base64.decodestring(node.text) if image_data: s = cStringIO.StringIO(image_data) else: return False
def _image(self, node): import urllib from reportlab.lib.utils import ImageReader if not node.get('file') : if node.get('name'): image_data = self.images[node.get('name')] s = cStringIO.StringIO(image_data) else: import base64 if self.localcontext: res = utils._regex.findall(node.text) for key in res: newtext = eval(key, {}, self.localcontext) node.text = newtext image_data = base64.decodestring(node.text) if not image_data: return False s = cStringIO.StringIO(image_data) else: if node.get('file') in self.images: s = cStringIO.StringIO(self.images[node.get('file')]) else: try: u = urllib.urlopen(str(node.get('file'))) s = cStringIO.StringIO(u.read()) except Exception: u = file(os.path.join(self.path,str(node.get('file'))), 'rb') s = cStringIO.StringIO(u.read()) img = ImageReader(s) (sx,sy) = img.getSize()
6e3c34ddd5717bef2d81b2348d2310bc60425889 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/6e3c34ddd5717bef2d81b2348d2310bc60425889/trml2pdf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2730, 12, 2890, 16, 756, 4672, 1930, 11527, 628, 2605, 7411, 18, 2941, 18, 5471, 1930, 3421, 2514, 309, 486, 756, 18, 588, 2668, 768, 6134, 294, 309, 756, 18, 588, 2668, 529, 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, 389, 2730, 12, 2890, 16, 756, 4672, 1930, 11527, 628, 2605, 7411, 18, 2941, 18, 5471, 1930, 3421, 2514, 309, 486, 756, 18, 588, 2668, 768, 6134, 294, 309, 756, 18, 588, 2668, 529, 11, ...
elif type in ['http', 'https', 'ftp', 'ftps', 'bittorrent']:
elif typestr in ['http', 'https', 'ftp', 'ftps', 'bittorrent']:
def validate_url(self, url): if url.endswith(".torrent"): type = "bittorrent" else: chars = url.find(":") type = url[:chars] allowed_types = ["ftp", "ftps", "http", "https", "rsync", "bittorrent", "magnet", "ed2k"] if not type in allowed_types: return False elif type in ['http', 'https', 'ftp', 'ftps', 'bittorrent']: m = re.search(r'\w+://.+\..+/.*', url) if m == None: return False return True
cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/cedf2d3fa50ba7140bc823ffa4ba7db6a4c37228/metalinkc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1954, 67, 718, 12, 2890, 16, 880, 4672, 309, 880, 18, 5839, 1918, 2932, 18, 13039, 547, 6, 4672, 618, 273, 315, 3682, 13039, 547, 6, 469, 30, 5230, 273, 880, 18, 4720, 2932, 2773, 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, 1954, 67, 718, 12, 2890, 16, 880, 4672, 309, 880, 18, 5839, 1918, 2932, 18, 13039, 547, 6, 4672, 618, 273, 315, 3682, 13039, 547, 6, 469, 30, 5230, 273, 880, 18, 4720, 2932, 2773, 13...
stdpath = ['usr/local/lib','/usr/lib']
stdpath = ['/usr/local/lib','/usr/lib']
def _libnexus(): """ Load the NeXus library whereever it may be. """ # NEXUSLIB takes precedence if 'NEXUSLIB' in os.environ: file = os.environ['NEXUSLIB'] if not os.path.isfile(file): raise OSError, \ "File %s from environment variable NEXUSLIB does exist"%(file) files = [file] else: files = [] # Default names and locations to look for the library are system dependent filedir = os.path.dirname(__file__) if sys.platform in ('win32','cygwin'): files += [filedir+"/libNeXus.dll", filedir+"/libNeXus-0.dll", 'C:/Program Files/NeXus Data Format/bin/libNeXus-0.dll'] else: if sys.platform in ('darwin'): lib = 'libNeXus.dylib' ldenv = 'DYLD_LIBRARY_PATH' else: lib = 'libNeXus.so' ldenv = 'LD_LIBRARY_PATH' # Search the load library path as well as the standard locations ldpath = [p for p in os.environ.get(ldenv,'').split(':') if p != ''] stdpath = ['usr/local/lib','/usr/lib'] files += [os.path.join(p,lib) for p in [filedir]+ldpath+stdpath] # Given a list of files, try loading the first one that is available. for file in files: if not os.path.isfile(file): continue try: return ctypes.cdll[file] except: raise OSError, \ "NeXus library %s could not be loaded: %s"%(file,sys.exc_info()[0]) raise OSError, "Set NEXUSLIB or move NeXus to one of: %s"%(", ".join(files))
87baa9bc3bba5bfc7e875c4fccde80524bb35a58 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7515/87baa9bc3bba5bfc7e875c4fccde80524bb35a58/nxs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2941, 82, 21029, 13332, 3536, 4444, 326, 7455, 60, 407, 5313, 1625, 6084, 518, 2026, 506, 18, 3536, 468, 24011, 3378, 14484, 5530, 14172, 309, 296, 50, 2294, 3378, 14484, 11, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2941, 82, 21029, 13332, 3536, 4444, 326, 7455, 60, 407, 5313, 1625, 6084, 518, 2026, 506, 18, 3536, 468, 24011, 3378, 14484, 5530, 14172, 309, 296, 50, 2294, 3378, 14484, 11, 316, 1...
__version__ = '$Id: ttfonts.py,v 1.7 2002/09/02 16:17:29 mgedmin Exp $'
__version__ = '$Id: ttfonts.py,v 1.8 2002/09/06 15:53:51 mgedmin Exp $'
def getSubsetInternalName(self, subset, doc): '''Returns the name of a PDF Font object corresponding to a given subset of this dynamic font. Use this function instead of PDFDocument.getInternalFontName.'''
ddd85034b4c35b2b4ee7b2e22177e894b8b1a474 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7053/ddd85034b4c35b2b4ee7b2e22177e894b8b1a474/ttfonts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7040, 542, 3061, 461, 12, 2890, 16, 7931, 16, 997, 4672, 9163, 1356, 326, 508, 434, 279, 12667, 10063, 733, 4656, 358, 279, 864, 7931, 434, 333, 5976, 3512, 18, 225, 2672, 333, 445, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7040, 542, 3061, 461, 12, 2890, 16, 7931, 16, 997, 4672, 9163, 1356, 326, 508, 434, 279, 12667, 10063, 733, 4656, 358, 279, 864, 7931, 434, 333, 5976, 3512, 18, 225, 2672, 333, 445, 35...
( 'fontsize', "16") ]
( 'fontsize', str (props.fontSize ())) ]
def outputDot (self, props): fn = "%s.dot" % self.fileStem () self._dotfile = fn f = open (fn, "w")
28008532aef10b3cdeb86e9d6e2ab1cf4b2e7903 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11834/28008532aef10b3cdeb86e9d6e2ab1cf4b2e7903/profile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 10412, 261, 2890, 16, 3458, 4672, 2295, 273, 2213, 87, 18, 9811, 6, 738, 365, 18, 768, 28771, 1832, 365, 6315, 9811, 768, 273, 2295, 284, 273, 1696, 261, 4293, 16, 315, 91, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 876, 10412, 261, 2890, 16, 3458, 4672, 2295, 273, 2213, 87, 18, 9811, 6, 738, 365, 18, 768, 28771, 1832, 365, 6315, 9811, 768, 273, 2295, 284, 273, 1696, 261, 4293, 16, 315, 91, 7923, ...
is_nb_ = space.is_
space.ExceptionTable.append('UnificationError') space.ExceptionTable.sort() is_nb_ = space.is_
def boundmethod(*args): return func(space, *args)
54c01b836a2e69981f5f892c328d0e5629452fc1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/54c01b836a2e69981f5f892c328d0e5629452fc1/logic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2489, 2039, 30857, 1968, 4672, 327, 1326, 12, 2981, 16, 380, 1968, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2489, 2039, 30857, 1968, 4672, 327, 1326, 12, 2981, 16, 380, 1968, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if len(temp_buf):
elif len(temp_buf):
def getModuleXML(file_name): ''' Returns the XML data for a module in a list, one line per list item. ''' # Try to open the file, if it cant, just ignore it. try: module_file = open(file_name, "r") module_code = module_file.readlines() module_file.close() except: warning("cannot open file %s for read, skipping" % file_name) return [] module_buf = [] # Infer the module name, which is the base of the file name. module_buf.append("<module name=\"%s\">\n" % os.path.splitext(os.path.split(file_name)[-1])[0]) temp_buf = [] # Phases: find header - looking for the header of the file. # get header - get the header comments and stop when first # whitespace is encountered. # find interface - looking for interfaces to get info for. phase = "find header" # Go line by line and figure out what to do with it. for line in module_code: # In this phase, whitespace and stray code is ignored at the # top of the file. if phase == "find header": if line.isspace(): continue # Once a comment is encountered, start trying to get the # header documentation. elif getXMLComment(line): phase = "get header" # If an interface is found, there is no header, and no # documentation for the interface. elif getParams(line,INTERFACE)\ or getParams(line,TEMPLATE): phase = "find interface" # In this phase, XML comments are being retrieved for the file. if phase == "get header": if getXMLComment(line): temp_buf.append(getXMLComment(line)) continue # If the line is whitespace, the file header is over, # continue on to find interfaces. elif line.isspace(): module_buf += temp_buf temp_buf = [] phase = "find interface" continue # Oops! The comments we have been getting weren't part # of the header so attribute them to an interface # instead. elif getParams(line,INTERFACE)\ or getParams(line,TEMPLATE): phase = "find interface" # In this phase, XML comments are being attributed if phase == "find interface": if getXMLComment(line): temp_buf.append(getXMLComment(line)) continue # If the line is the declaration of a interface, # infer the interface name and add all the comments # to the main buffer. elif getParams(line,INTERFACE): module_buf.append("<interface name=\"%s\">\n"\ % getParams(line,INTERFACE)[0]) if len(temp_buf): module_buf += temp_buf else: module_buf.append("<summary>\n") module_buf.append("Summary is missing!\n") module_buf.append("</summary>\n") module_buf.append("<param name=\"?\">\n") module_buf.append("Parameter descriptions are missing!\n") module_buf.append("</param>\n") temp_buf = [] module_buf.append("</interface>\n") continue elif getParams(line,TEMPLATE): module_buf.append("<template name =\"%s\">\n"\ % getParams(line,TEMPLATE)[0]) if len(temp_buf): module_buf += temp_buf else: module_buf.append("<summary>\n") module_buf.append("Summary is missing!\n") module_buf.append("</summary>\n") module_buf.append("<param name=\"?\">\n") module_buf.append("Parameter descriptions are missing!\n") module_buf.append("</param>\n") temp_buf = [] module_buf.append("</template>\n") # If there are XML comments at the end of the file, they arn't # attributed to anything. These are ignored. if len(temp_buf): warning("orphan XML comments at bottom of file %s" % file_name) module_buf.append("</module>\n") return module_buf
e694b51e6b36af5e61298d0c8db30515bc57c702 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7247/e694b51e6b36af5e61298d0c8db30515bc57c702/segenxml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11251, 4201, 12, 768, 67, 529, 4672, 9163, 2860, 326, 3167, 501, 364, 279, 1605, 316, 279, 666, 16, 1245, 980, 1534, 666, 761, 18, 9163, 225, 468, 6161, 358, 1696, 326, 585, 16, 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, 11251, 4201, 12, 768, 67, 529, 4672, 9163, 2860, 326, 3167, 501, 364, 279, 1605, 316, 279, 666, 16, 1245, 980, 1534, 666, 761, 18, 9163, 225, 468, 6161, 358, 1696, 326, 585, 16, 309, ...
def assert_array_compare(comparision, x, y, err_msg='', verbose=True,
def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
def assert_array_compare(comparision, x, y, err_msg='', verbose=True, header=''): from numpy.core import asarray x = asarray(x) y = asarray(y) try: cond = (x.shape==() or y.shape==()) or x.shape == y.shape if not cond: msg = build_err_msg([x, y], err_msg + '\n(shapes %s, %s mismatch)' % (x.shape, y.shape), verbose=verbose, header=header, names=('x', 'y')) assert cond, msg reduced = comparision(x, y).ravel() cond = reduced.all() if not cond: match = 100-100.0*reduced.tolist().count(1)/len(reduced) msg = build_err_msg([x, y], err_msg + '\n(mismatch %s%%)' % (match,), verbose=verbose, header=header, names=('x', 'y')) assert cond, msg except ValueError: msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header, names=('x', 'y')) raise ValueError(msg)
640a99d367e691eef576af04a29da06ba34acf23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/640a99d367e691eef576af04a29da06ba34acf23/utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1815, 67, 1126, 67, 9877, 12, 23050, 16, 619, 16, 677, 16, 393, 67, 3576, 2218, 2187, 3988, 33, 5510, 16, 1446, 2218, 11, 4672, 628, 3972, 18, 3644, 1930, 10455, 619, 273, 10455, 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, 1815, 67, 1126, 67, 9877, 12, 23050, 16, 619, 16, 677, 16, 393, 67, 3576, 2218, 2187, 3988, 33, 5510, 16, 1446, 2218, 11, 4672, 628, 3972, 18, 3644, 1930, 10455, 619, 273, 10455, 12, ...
self.myref = None
self.resetRef = None
def __init__(self, session): self.xmlfile = resolveFilename(SCOPE_PLUGINS, "SystemPlugins/NetworkWizard/networkwizard.xml") WizardLanguage.__init__(self, session, showSteps = False, showStepSlider = False) Rc.__init__(self) self.session = session self["wizard"] = Pixmap() self.InterfaceState = None self.isInterfaceUp = None self.WlanPluginInstalled = None self.ap = None self.selectedInterface = None self.NextStep = None self.myref = None self.checkRef = None self.AdapterRef = None self.WlanList = None self.isWlanPluginInstalled()
d6e258a761abb1074a1157d17b9c42b7f28959ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/d6e258a761abb1074a1157d17b9c42b7f28959ce/NetworkWizard.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1339, 4672, 365, 18, 2902, 768, 273, 2245, 5359, 12, 19444, 67, 19415, 55, 16, 315, 3163, 9461, 19, 3906, 27130, 19, 5185, 31837, 18, 2902, 7923, 678, 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, 1001, 2738, 972, 12, 2890, 16, 1339, 4672, 365, 18, 2902, 768, 273, 2245, 5359, 12, 19444, 67, 19415, 55, 16, 315, 3163, 9461, 19, 3906, 27130, 19, 5185, 31837, 18, 2902, 7923, 678, 13...
if not exitPolicy.endswith("accept *:*") and not exitPolicy.endswith("reject *:*"):
if exitPolicy == None: exitPolicy = "<default>" elif not exitPolicy.endswith("accept *:*") and not exitPolicy.endswith("reject *:*"):
def drawSummary(screen, vals, maxX, maxY): """ Draws top area containing static information. arm - <System Name> (<OS> <Version>) Tor <Tor Version> <Relay Nickname> - <IP Addr>:<ORPort>, [Dir Port: <DirPort>, ]Control Port (<open, password, cookie>): <ControlPort> Fingerprint: <Fingerprint> Config: <Config> Exit Policy: <ExitPolicy> Example: arm - odin (Linux 2.6.24-24-generic) Tor 0.2.0.34 (r18423) odin - 76.104.132.98:9001, Dir Port: 9030, Control Port (cookie): 9051 Fingerprint: BDAD31F6F318E0413833E8EBDA956F76E4D66788 Config: /home/atagar/.vidalia/torrc Exit Policy: reject *:* """ screen.erase() # Line 1 if maxY >= 1: screen.addstr(0, 0, ("arm - %s (%s %s)" % (vals["sys-name"], vals["sys-os"], vals["sys-version"]))[:maxX - 1], SUMMARY_ATTR) if 45 < maxX: screen.addstr(0, 45, ("Tor %s" % vals["version"])[:maxX - 46], SUMMARY_ATTR) # Line 2 (authentication label red if open, green if credentials required) if maxY >= 2: dirPortLabel = "Dir Port: %s, " % vals["DirPort"] if not vals["DirPort"] == None else "" # TODO: if both cookie and password are set then which takes priority? if vals["IsPasswordAuthSet"]: controlPortAuthLabel = "password" elif vals["IsCookieAuthSet"]: controlPortAuthLabel = "cookie" else: controlPortAuthLabel = "open" controlPortAuthColor = "red" if controlPortAuthLabel == "open" else "green" labelStart = "%s - %s:%s, %sControl Port (" % (vals["Nickname"], vals["address"], vals["ORPort"], dirPortLabel) screen.addstr(1, 0, labelStart[:maxX - 1], SUMMARY_ATTR) xLoc = len(labelStart) if xLoc < maxX: screen.addstr(1, xLoc, controlPortAuthLabel[:maxX - xLoc - 1], COLOR_ATTR[controlPortAuthColor] | SUMMARY_ATTR) xLoc += len(controlPortAuthLabel) if xLoc < maxX: screen.addstr(1, xLoc, ("): %s" % vals["ControlPort"])[:maxX - xLoc - 1], SUMMARY_ATTR) # Lines 3-5 if maxY >= 3: screen.addstr(2, 0, ("Fingerprint: %s" % vals["fingerprint"])[:maxX - 1], SUMMARY_ATTR) if maxY >= 4: screen.addstr(3, 0, ("Config: %s" % vals["config-file"])[:maxX - 1], SUMMARY_ATTR) # adds note when default exit policy is appended if maxY >= 5: exitPolicy = vals["ExitPolicy"] if not exitPolicy.endswith("accept *:*") and not exitPolicy.endswith("reject *:*"): exitPolicy += ", <default>" screen.addstr(4, 0, ("Exit Policy: %s" % exitPolicy)[:maxX - 1], SUMMARY_ATTR) screen.refresh()
4562d0e1b3720d2da3331f73647d113cbf4681fa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13459/4562d0e1b3720d2da3331f73647d113cbf4681fa/armInterface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4733, 12, 9252, 16, 5773, 16, 21482, 16, 21509, 4672, 3536, 10184, 87, 1760, 5091, 4191, 760, 1779, 18, 225, 23563, 300, 411, 3163, 1770, 34, 261, 32, 4618, 34, 411, 1444, 23429, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 4733, 12, 9252, 16, 5773, 16, 21482, 16, 21509, 4672, 3536, 10184, 87, 1760, 5091, 4191, 760, 1779, 18, 225, 23563, 300, 411, 3163, 1770, 34, 261, 32, 4618, 34, 411, 1444, 23429, ...
raise Error("unable to complete: " + cmdline + '\n',
raise Error("unable to complete: " + cmdline,
def pubStatus(args): '''status Show status of projects checked out in the workspace with regards to commits. ''' global log log = LogFile(context.logname(),nolog) reps = args recurse = False if 'recurse' in args: recurse = True reps.remove('recurse') if len(reps) == 0: # We try to derive project names from the current directory whever # it is a subdirectory of buildTop or srcTop. cwd = os.path.realpath(os.getcwd()) buildTop = os.path.realpath(context.value('buildTop')) srcTop = os.path.realpath(context.value('srcTop')) srcDir = srcTop srcPrefix = os.path.commonprefix([ cwd,srcTop ]) buildPrefix = os.path.commonprefix([ cwd, buildTop ]) if srcPrefix == srcTop: srcDir = cwd elif buildPrefix == buildTop: srcDir = cwd.replace(buildTop,srcTop) if os.path.exists(srcDir): for repdir in findFiles(srcDir,'\.git'): reps += [ os.path.dirname(repdir.replace(srcTop + os.sep,'')) ] else: reps = [ context.cwdProject() ] if recurse: raise NotYetImplemented() else: cmdline = 'git status' prev = os.getcwd() for r in reps: os.chdir(context.srcDir(r)) try: cmd = subprocess.Popen(cmdline,shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) line = cmd.stdout.readline() untracked = False while line != '': look = re.match('#\s+([a-z]+):\s+(\S+)',line) if look: sys.stdout.write(' '.join([ look.group(1).capitalize()[0], r, look.group(2)]) + '\n') elif re.match('# Untracked files:',line): untracked = True elif untracked: look = re.match('# (\S+)',line) if look: sys.stdout.write(' '.join(['?', r, look.group(1)]) + '\n') line = cmd.stdout.readline() cmd.wait() if cmd.returncode != 0: raise Error("unable to complete: " + cmdline + '\n', cmd.returncode) except Error, e: # It is ok. git will return error code 1 when no changes # are to be committed. None os.chdir(prev)
3eb90d1f8ec09fc84ae921584bd73c951235b43d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1360/3eb90d1f8ec09fc84ae921584bd73c951235b43d/dws.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 1482, 12, 1968, 4672, 9163, 2327, 1171, 9674, 1267, 434, 10137, 5950, 596, 316, 326, 6003, 598, 12283, 87, 358, 14335, 18, 9163, 2552, 613, 613, 273, 1827, 812, 12, 2472, 18, 1330,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5634, 1482, 12, 1968, 4672, 9163, 2327, 1171, 9674, 1267, 434, 10137, 5950, 596, 316, 326, 6003, 598, 12283, 87, 358, 14335, 18, 9163, 2552, 613, 613, 273, 1827, 812, 12, 2472, 18, 1330,...
print self.challenge
def __init__(self, credentials, host, request_uri, headers, response, content, http): Authentication.__init__(self, credentials, host, request_uri, headers, response, content, http) challenge = _parse_www_authenticate(response, 'www-authenticate') self.challenge = challenge['hmacdigest'] print self.challenge # TODO: self.challenge['domain'] self.challenge['reason'] = self.challenge.get('reason', 'unauthorized') if self.challenge['reason'] not in ['unauthorized', 'integrity']: self.challenge['reason'] = 'unauthorized' self.challenge['salt'] = self.challenge.get('salt', '') if not self.challenge.get('snonce'): raise UnimplementedHmacDigestAuthOptionError( _("The challenge doesn't contain a server nonce, or this one is empty.")) self.challenge['algorithm'] = self.challenge.get('algorithm', 'HMAC-SHA-1') if self.challenge['algorithm'] not in ['HMAC-SHA-1', 'HMAC-MD5']: raise UnimplementedHmacDigestAuthOptionError( _("Unsupported value for algorithm: %s." % self.challenge['algorithm'])) self.challenge['pw-algorithm'] = self.challenge.get('pw-algorithm', 'SHA-1') if self.challenge['pw-algorithm'] not in ['SHA-1', 'MD5']: raise UnimplementedHmacDigestAuthOptionError( _("Unsupported value for pw-algorithm: %s." % self.challenge['pw-algorithm'])) if self.challenge['algorithm'] == 'HMAC-MD5': self.hashmod = md5 else: self.hashmod = sha if self.challenge['pw-algorithm'] == 'MD5': self.pwhashmod = md5 else: self.pwhashmod = sha self.key = "".join([self.credentials[0], ":", self.pwhashmod.new("".join([self.credentials[1], self.challenge['salt']])).hexdigest().lower(), ":", self.challenge['realm'] ]) print response['www-authenticate'] print "".join([self.credentials[1], self.challenge['salt']]) print "key_str = %s" % self.key self.key = self.pwhashmod.new(self.key).hexdigest().lower()
f634f1a25cd25833ecef558b8a927fbe1c2a3575 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13138/f634f1a25cd25833ecef558b8a927fbe1c2a3575/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650, 16, 1607, 16, 766, 16, 913, 16, 1062, 4672, 8665, 16186, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4448, 16, 1479, 16, 590, 67, 1650, 16, 1607, 16, 766, 16, 913, 16, 1062, 4672, 8665, 16186, 2738, 972, 12, 2890, 16, 4448, 16, 1479, 16, 590, 67, 1650,...
if dep.count(">="):
if not dep in self.queues["add"]: dep_todo_list.append(dep) while dep_todo_list: dep = dep_todo_list.pop(0) if dep.count(">="):
def _req_pac_check(to_check): to_do = [] pac = self.database.get_by_name(to_check)
c38998089dceafcbcd06e6b79d30a63d93cd7607 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2654/c38998089dceafcbcd06e6b79d30a63d93cd7607/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3658, 67, 84, 1077, 67, 1893, 12, 869, 67, 1893, 4672, 358, 67, 2896, 273, 5378, 293, 1077, 273, 365, 18, 6231, 18, 588, 67, 1637, 67, 529, 12, 869, 67, 1893, 13, 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, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3658, 67, 84, 1077, 67, 1893, 12, 869, 67, 1893, 4672, 358, 67, 2896, 273, 5378, 293, 1077, 273, 365, 18, 6231, 18, 588, 67, 1637, 67, 529, 12, 869, 67, 1893, 13, 2, -100, -10...
transactions = Transaction.objects.filter( Q(credit_account=account) | Q(debit_account=account)).order_by('-registered')
transactions = Transaction.objects.filter(entry_set__account=account)
def account_summary(request, group, account, page='1'): """Account details and a paginated list with recent transactions involving the user""" # Get account object try: group = Group.objects.get(slug=group) account = group.account_set.get(slug=account) except (Group.DoesNotExist, Account.DoesNotExist): raise Http404 # Save account in session # I think it's a bit of hack to switch account when the referrer is the # group-list view, but that view is in fact only used for selecting between # your own accounts. request_from_group_list = ('HTTP_REFERER' in request.META and urlparse(request.META['HTTP_REFERER'])[2] == reverse('group-list')) if request.user == account.owner: request.session['my_account'] = account # Check that user is owner of account or admin of account group if group.admins.filter(id=request.user.id).count(): is_admin = True elif request.user.id == account.owner.id: is_admin = False else: return HttpResponseForbidden(_('Forbidden')) # Get related transactions transactions = Transaction.objects.filter( Q(credit_account=account) | Q(debit_account=account)).order_by('-registered') # Warn owner of account about a low balance if request.user == account.owner: if account.is_blocked(): request.user.message_set.create( message=_('The account balance is below the block limit,' + ' please contact the group admin or deposit enough to' + ' pass the limit.')) elif account.needs_warning(): request.user.message_set.create( message=_('The account balance is below the warning limit.')) # Pass on to generic view response = object_list(request, transactions, paginate_by=20, page=page, allow_empty=True, template_name='accounting/account_summary.html', extra_context={ 'is_admin': is_admin, 'account': account, 'group': group, }, template_object_name='transaction') populate_xheaders(request, response, Account, account.id) return response
ab836bd3b76baf7e77302febd00863053eb64853 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12178/ab836bd3b76baf7e77302febd00863053eb64853/views.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2236, 67, 7687, 12, 2293, 16, 1041, 16, 2236, 16, 1363, 2218, 21, 11, 4672, 3536, 3032, 3189, 471, 279, 25373, 666, 598, 8399, 8938, 29876, 6282, 326, 729, 8395, 225, 468, 968, 2236, 7...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2236, 67, 7687, 12, 2293, 16, 1041, 16, 2236, 16, 1363, 2218, 21, 11, 4672, 3536, 3032, 3189, 471, 279, 25373, 666, 598, 8399, 8938, 29876, 6282, 326, 729, 8395, 225, 468, 968, 2236, 7...
relative importance of that node to its graph. 'Closeness centrality may be defined as the total graph-theoretic distance of a given node from all other nodes... Closeness is an inverse measure of centrality
relative importance of that vertex to its graph. 'Closeness centrality may be defined as the total graph-theoretic distance of a given vertex from all other vertices... Closeness is an inverse measure of centrality
def centrality_closeness(self, v=False): r""" Returns the closeness centrality (1/average distance to all nodes) as a dictionary of values keyed by node. The degree centrality is normalized to be in range (0,1). Measures of the centrality of a vertex within a graph determine the relative importance of that node to its graph. 'Closeness centrality may be defined as the total graph-theoretic distance of a given node from all other nodes... Closeness is an inverse measure of centrality in that a larger value indicates a less central actor while a smaller value indicates a more central actor,' [1]. INPUT: v -- a vertex label (to find degree centrality of only one node) REFERENCE: [1] Stephen P Borgatti. (1995). Centrality and AIDS. [Online] Available: http://www.analytictech.com/networks/centaids.htm
7d819cbf1df622e9f76b4801233dbb334f44d362 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/7d819cbf1df622e9f76b4801233dbb334f44d362/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 8230, 7919, 67, 7550, 87, 15681, 12, 2890, 16, 331, 33, 8381, 4672, 436, 8395, 2860, 326, 1219, 87, 15681, 276, 8230, 7919, 261, 21, 19, 15621, 3888, 358, 777, 2199, 13, 487, 279,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 8230, 7919, 67, 7550, 87, 15681, 12, 2890, 16, 331, 33, 8381, 4672, 436, 8395, 2860, 326, 1219, 87, 15681, 276, 8230, 7919, 261, 21, 19, 15621, 3888, 358, 777, 2199, 13, 487, 279,...
actual_time = after_stop_event[1] - before_stop_event[1] diff_time = actual_time - expected_time
api_start = before_stop_event[1] api_end = after_stop_event[1] actual_time = api_end - api_start all_stops = get_stoptimes_on_interval(api_start, api_end) all_stoptimes = 0 for stop in all_stops: TOS, stop_amount = stop all_stoptimes += stop_amount
def commit_time(thread_dict, TOC): resource = thread_dict["resource"] thread_dict[resource] += TOC - thread_dict["begin"] thread_dict["begin"] = TOC
a0862f2f0f70573664ad719ff30496ba1d2d6164 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7995/a0862f2f0f70573664ad719ff30496ba1d2d6164/island_stats.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3294, 67, 957, 12, 5930, 67, 1576, 16, 8493, 39, 4672, 1058, 273, 2650, 67, 1576, 9614, 3146, 11929, 2650, 67, 1576, 63, 3146, 65, 1011, 8493, 39, 300, 2650, 67, 1576, 9614, 10086, 119...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3294, 67, 957, 12, 5930, 67, 1576, 16, 8493, 39, 4672, 1058, 273, 2650, 67, 1576, 9614, 3146, 11929, 2650, 67, 1576, 63, 3146, 65, 1011, 8493, 39, 300, 2650, 67, 1576, 9614, 10086, 119...
tweakedID = recurrenceID.astimezone(ICUtzinfo.default) event = EventStamp(item).getRecurrenceID(tweakedID)
masterTzinfo = masterEvent.startTime.tzinfo tweakedID = recurrenceID.astimezone(masterTzinfo) event = masterEvent.getRecurrenceID(tweakedID) if event is None: tweakedID = recurrenceID.astimezone(tzinfo) event = masterEvent.getRecurrenceID(tweakedID)
def ShowTimezoneDialogCallback(): ShowTurnOnTimezonesDialog(view=app.UIRepositoryView)
866e12310424c93dbd03de58942a16a7900cc85f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/866e12310424c93dbd03de58942a16a7900cc85f/ICalendar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9674, 17989, 6353, 2428, 13332, 9674, 15858, 1398, 950, 14203, 6353, 12, 1945, 33, 2910, 18, 5370, 3305, 1767, 13, 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, 9674, 17989, 6353, 2428, 13332, 9674, 15858, 1398, 950, 14203, 6353, 12, 1945, 33, 2910, 18, 5370, 3305, 1767, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
apply(self.cb, self.cb_arg)
apply(self.cb, (self.cb_arg,))
def poll(self): if not self.async: raise error, 'Can only call poll() in async mode' if not self.busy_cmd: return if self.testready(): if self.cb: apply(self.cb, self.cb_arg)
26c86abb4b1d031770d8f8eb01850893bf0594aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/26c86abb4b1d031770d8f8eb01850893bf0594aa/VCR.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7672, 12, 2890, 4672, 309, 486, 365, 18, 3810, 30, 1002, 555, 16, 296, 2568, 1338, 745, 7672, 1435, 316, 4326, 1965, 11, 309, 486, 365, 18, 9274, 93, 67, 4172, 30, 327, 309, 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, 7672, 12, 2890, 4672, 309, 486, 365, 18, 3810, 30, 1002, 555, 16, 296, 2568, 1338, 745, 7672, 1435, 316, 4326, 1965, 11, 309, 486, 365, 18, 9274, 93, 67, 4172, 30, 327, 309, 365, 18,...
M = self.lattice().dual()
M = self.dual_lattice()
def facet_normals(self): r""" Return normals to facets of ``self``.
a3e3306597435e3589001abd0b89714b99258af9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a3e3306597435e3589001abd0b89714b99258af9/cone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11082, 67, 7959, 1031, 12, 2890, 4672, 436, 8395, 2000, 19487, 358, 21681, 434, 12176, 2890, 68, 8338, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 11082, 67, 7959, 1031, 12, 2890, 4672, 436, 8395, 2000, 19487, 358, 21681, 434, 12176, 2890, 68, 8338, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
print(keys) print(vals) raise Exception("Number of vals does not equal number of keys")
raise Exception("Number of vals does not equal number of keys. \ Number of vals are: "+str(len(vals))+" and number of keys are: "+str(len(keys)))
def get_w_start_attributes(self): """ Extract ValueReference and Start attribute for all algebraic variables in the XML document. Returns: Dict with ValueReference as key and Start attribute as value. """ keys = self._xpatheval("//ScalarVariable/ValueReference/text()[../../VariableCategory=\"algebraic\"]") vals = self._xpatheval("//ScalarVariable/Attributes/*/Start/text()[../../../../VariableCategory=\"algebraic\"]") if len(keys)!=len(vals): print(keys) print(vals) raise Exception("Number of vals does not equal number of keys") return dict(zip(keys,vals))
f764f349d643190118591f5efb0058e97cef2494 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/f764f349d643190118591f5efb0058e97cef2494/xmlparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 91, 67, 1937, 67, 4350, 12, 2890, 4672, 3536, 8152, 1445, 2404, 471, 3603, 1566, 364, 777, 524, 29087, 335, 3152, 316, 326, 3167, 1668, 18, 225, 2860, 30, 9696, 598, 1445, 240...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 91, 67, 1937, 67, 4350, 12, 2890, 4672, 3536, 8152, 1445, 2404, 471, 3603, 1566, 364, 777, 524, 29087, 335, 3152, 316, 326, 3167, 1668, 18, 225, 2860, 30, 9696, 598, 1445, 240...
be enclosed in double quotes ("..."), with "\" as escape character.
be enclosed in double quotes ("..."), with "\\" as escape character.
def debugbuilddag(ui, repo, text, mergeable_file=False, appended_file=False, overwritten_file=False, new_file=False): """builds a repo with a given dag from scratch in the current empty repo Elements: - "+n" is a linear run of n nodes based on the current default parent - "." is a single node based on the current default parent - "$" resets the default parent to null (implied at the start); otherwise the default parent is always the last node created - "<p" sets the default parent to the backref p - "*p" is a fork at parent p, which is a backref - "*p1/p2" is a merge of parents p1 and p2, which are backrefs - "/p2" is a merge of the preceding node and p2 - ":tag" defines a local tag for the preceding node - "@branch" sets the named branch for subsequent nodes - "!command" runs the command using your shell - "!!my command\\n" is like "!", but to the end of the line - "#...\\n" is a comment up to the end of the line Whitespace between the above elements is ignored. A backref is either - a number n, which references the node curr-n, where curr is the current node, or - the name of a local tag you placed earlier using ":tag", or - empty to denote the default parent. All string valued-elements are either strictly alphanumeric, or must be enclosed in double quotes ("..."), with "\" as escape character. Note that the --overwritten-file and --appended-file options imply the use of "HGMERGE=internal:local" during DAG buildup. """ if not (mergeable_file or appended_file or overwritten_file or new_file): raise util.Abort(_('need at least one of -m, -a, -o, -n')) if len(repo.changelog) > 0: raise util.Abort(_('repository is not empty')) if overwritten_file or appended_file: # we don't want to fail in merges during buildup os.environ['HGMERGE'] = 'internal:local' def writefile(fname, text, fmode="w"): f = open(fname, fmode) try: f.write(text) finally: f.close() if mergeable_file: linesperrev = 2 # determine number of revs in DAG n = 0 for type, data in dagparser.parsedag(text): if type == 'n': n += 1 # make a file with k lines per rev writefile("mf", "\n".join(str(i) for i in xrange(0, n * linesperrev)) + "\n") at = -1 atbranch = 'default' for type, data in dagparser.parsedag(text): if type == 'n': ui.status('node %s\n' % str(data)) id, ps = data p1 = ps[0] if p1 != at: update(ui, repo, node=p1, clean=True) at = p1 if repo.dirstate.branch() != atbranch: branch(ui, repo, atbranch, force=True) if len(ps) > 1: p2 = ps[1] merge(ui, repo, node=p2) if mergeable_file: f = open("mf", "r+") try: lines = f.read().split("\n") lines[id * linesperrev] += " r%i" % id f.seek(0) f.write("\n".join(lines)) finally: f.close() if appended_file: writefile("af", "r%i\n" % id, "a") if overwritten_file: writefile("of", "r%i\n" % id) if new_file: writefile("nf%i" % id, "r%i\n" % id) commit(ui, repo, addremove=True, message="r%i" % id, date=(id, 0)) at = id elif type == 'l': id, name = data ui.status('tag %s\n' % name) tag(ui, repo, name, local=True) elif type == 'a': ui.status('branch %s\n' % data) atbranch = data elif type in 'cC': r = util.system(data, cwd=repo.root) if r: desc, r = util.explain_exit(r) raise util.Abort(_('%s command %s') % (data, desc))
69409d0c542bc657ebfd10ae80b008792e43dd3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/69409d0c542bc657ebfd10ae80b008792e43dd3f/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 70, 89, 330, 449, 346, 12, 4881, 16, 3538, 16, 977, 16, 2691, 429, 67, 768, 33, 8381, 16, 12317, 67, 768, 33, 8381, 16, 15345, 67, 768, 33, 8381, 16, 394, 67, 768, 33, 8381, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1198, 70, 89, 330, 449, 346, 12, 4881, 16, 3538, 16, 977, 16, 2691, 429, 67, 768, 33, 8381, 16, 12317, 67, 768, 33, 8381, 16, 15345, 67, 768, 33, 8381, 16, 394, 67, 768, 33, 8381, ...
self.syntax_error('reference to unknown entity')
self.syntax_error("reference to unknown entity `&%s;'" % name)
def goahead(self, end): rawdata = self.rawdata i = 0 n = len(rawdata) while i < n: if i > 0: self.__at_start = 0 if self.nomoretags: data = rawdata[i:n] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = n break res = interesting.search(rawdata, i) if res: j = res.start(0) else: j = n if i < j: data = rawdata[i:j] if self.__at_start and space.match(data) is None: self.syntax_error('illegal data at start of file') self.__at_start = 0 if not self.stack and space.match(data) is None: self.syntax_error('data not in content') if illegal.search(data): self.syntax_error('illegal character in content') self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = j if i == n: break if rawdata[i] == '<': if starttagopen.match(rawdata, i): if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue k = self.parse_starttag(i) if k < 0: break self.__seen_starttag = 1 self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if endtagopen.match(rawdata, i): k = self.parse_endtag(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if commentopen.match(rawdata, i): if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue k = self.parse_comment(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue if cdataopen.match(rawdata, i): k = self.parse_cdata(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:i], '\n') i = k continue res = xmldecl.match(rawdata, i) if res: if not self.__at_start: self.syntax_error("<?xml?> declaration not at start of document") version, encoding, standalone = res.group('version', 'encoding', 'standalone') if version[1:-1] != '1.0': raise RuntimeError, 'only XML version 1.0 supported' if encoding: encoding = encoding[1:-1] if standalone: standalone = standalone[1:-1] self.handle_xml(encoding, standalone) i = res.end(0) continue res = procopen.match(rawdata, i) if res: k = self.parse_proc(i) if k < 0: break self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue res = doctype.match(rawdata, i) if res: if self.literal: data = rawdata[i] self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') i = i+1 continue if self.__seen_doctype: self.syntax_error('multiple DOCTYPE elements') if self.__seen_starttag: self.syntax_error('DOCTYPE not at beginning of document') k = self.parse_doctype(res) if k < 0: break self.__seen_doctype = res.group('name') self.lineno = self.lineno + string.count(rawdata[i:k], '\n') i = k continue elif rawdata[i] == '&': if self.literal: data = rawdata[i] self.handle_data(data) i = i+1 continue res = charref.match(rawdata, i) if res is not None: i = res.end(0) if rawdata[i-1] != ';': self.syntax_error("`;' missing in charref") i = i-1 if not self.stack: self.syntax_error('data not in content') self.handle_charref(res.group('char')[:-1]) self.lineno = self.lineno + string.count(res.group(0), '\n') continue res = entityref.match(rawdata, i) if res is not None: i = res.end(0) if rawdata[i-1] != ';': self.syntax_error("`;' missing in entityref") i = i-1 name = res.group('name') if self.entitydefs.has_key(name): self.rawdata = rawdata = rawdata[:res.start(0)] + self.entitydefs[name] + rawdata[i:] n = len(rawdata) i = res.start(0) else: self.syntax_error('reference to unknown entity') self.unknown_entityref(name) self.lineno = self.lineno + string.count(res.group(0), '\n') continue elif rawdata[i] == ']': if self.literal: data = rawdata[i] self.handle_data(data) i = i+1 continue if n-i < 3: break if cdataclose.match(rawdata, i): self.syntax_error("bogus `]]>'") self.handle_data(rawdata[i]) i = i+1 continue else: raise RuntimeError, 'neither < nor & ??' # We get here only if incomplete matches but # nothing else break # end while if i > 0: self.__at_start = 0 if end and i < n: data = rawdata[i] self.syntax_error("bogus `%s'" % data) if illegal.search(data): self.syntax_error('illegal character in content') self.handle_data(data) self.lineno = self.lineno + string.count(data, '\n') self.rawdata = rawdata[i+1:] return self.goahead(end) self.rawdata = rawdata[i:] if end: if not self.__seen_starttag: self.syntax_error('no elements in file') if self.stack: self.syntax_error('missing end tags') while self.stack: self.finish_endtag(self.stack[-1][0])
aada75fb5faa7544a109c9e40590affa66f1e7c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/aada75fb5faa7544a109c9e40590affa66f1e7c5/xmllib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1960, 11617, 12, 2890, 16, 679, 4672, 1831, 892, 273, 365, 18, 1899, 892, 277, 273, 374, 290, 273, 562, 12, 1899, 892, 13, 1323, 277, 411, 290, 30, 309, 277, 405, 374, 30, 365, 16186...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1960, 11617, 12, 2890, 16, 679, 4672, 1831, 892, 273, 365, 18, 1899, 892, 277, 273, 374, 290, 273, 562, 12, 1899, 892, 13, 1323, 277, 411, 290, 30, 309, 277, 405, 374, 30, 365, 16186...
self._ts_get_available_actions(ts, {'status': 'reopened'})) self.assertEqual(['leave', 'reopen'], self._ts_get_available_actions(ts, {'status': 'closed'}))
self._get_actions({'status': 'reopened'})) self.assertEqual(['leave', 'reopen'], self._get_actions({'status': 'closed'}))
def test_available_actions_full_perms(self): ts = TicketSystem(self.env) self.perm.grant_permission('anonymous', 'TICKET_CREATE') self.perm.grant_permission('anonymous', 'TICKET_MODIFY') self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'new'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'assigned'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'accepted'})) self.assertEqual(['leave', 'resolve', 'reassign', 'accept'], self._ts_get_available_actions(ts, {'status': 'reopened'})) self.assertEqual(['leave', 'reopen'], self._ts_get_available_actions(ts, {'status': 'closed'}))
efa685fe3578b6c546f6ddde160f360b879f6552 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2831/efa685fe3578b6c546f6ddde160f360b879f6552/api.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5699, 67, 4905, 67, 2854, 67, 15969, 12, 2890, 4672, 3742, 273, 22023, 3163, 12, 2890, 18, 3074, 13, 365, 18, 12160, 18, 16243, 67, 9827, 2668, 19070, 2187, 296, 56, 16656, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5699, 67, 4905, 67, 2854, 67, 15969, 12, 2890, 4672, 3742, 273, 22023, 3163, 12, 2890, 18, 3074, 13, 365, 18, 12160, 18, 16243, 67, 9827, 2668, 19070, 2187, 296, 56, 16656, 1...
_log.error("Page for %s not found" % chronam_url) def newspaper_photo_ids(flickr_key): u = 'http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=%s&photoset_id=72157619452486566&format=json&nojsoncallback=1' % settings.FLICKR_KEY
_log.info("already knew about %s" % flickr_url) _log.info("created %s flickr urls" % create_count) def newspaper_photo_ids(key): """ Fetches JSON info for all the images in the Flickr newspaper set. """ u = 'http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=%s&photoset_id=72157619452486566&format=json&nojsoncallback=1' % key
def handle(self, flickr_key, **options): _log.debug("looking for chronam page content on flickr") for flickr_url, chronam_url in flickr_chronam_links(flickr_key): _log.info("found flickr/chronam link: %s, %s" % (flickr_url, chronam_url)) path = urlparse(chronam_url).path page = Page.lookup(path) if page: f, created = FlickrUrl.objects.get_or_create(value=flickr_url, page=page) if created: f.save() _log.info("updated page (%s) with flickr url (%s)" % (page, flickr_url)) else: _log.info("already knew about %s" % flickr_url) else: _log.error("Page for %s not found" % chronam_url)
be8746a116cc73c7ce5609419d9d07929f50a585 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6299/be8746a116cc73c7ce5609419d9d07929f50a585/flickr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 1183, 16254, 67, 856, 16, 2826, 2116, 4672, 389, 1330, 18, 4148, 2932, 7330, 310, 364, 12227, 301, 1363, 913, 603, 1183, 16254, 7923, 364, 1183, 16254, 67, 718, 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, 1640, 12, 2890, 16, 1183, 16254, 67, 856, 16, 2826, 2116, 4672, 389, 1330, 18, 4148, 2932, 7330, 310, 364, 12227, 301, 1363, 913, 603, 1183, 16254, 7923, 364, 1183, 16254, 67, 718, 16, ...
self.assertEqual(d["mailbox"][0], "/srv/mail/usertest/Maildir")
self.assertEqual(d["mailbox"][0], "/home/mail/usertest/Maildir")
def test_MailControl(self): self.m.addUser("usertest", "userpass", "test", "test", "/home/mail/usertest", False) self.m.addMailObjectClass("usertest", "usertestmail") d = self.m.getDetailedUser("usertest") self.assertEqual(d["mailbox"][0], "/srv/mail/usertest/Maildir") self.assertEqual(self.m.hasMailObjectClass("usertest"), True) self.m.removeUserObjectClass("usertest", "mailAccount") self.assertEqual(self.m.hasMailObjectClass("usertest"), False)
bc8182d9890b12a978950dec9436479ee2f988ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5988/bc8182d9890b12a978950dec9436479ee2f988ec/testmail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 6759, 3367, 12, 2890, 4672, 365, 18, 81, 18, 1289, 1299, 2932, 407, 1051, 395, 3113, 315, 1355, 5466, 3113, 315, 3813, 3113, 315, 3813, 3113, 2206, 8712, 19, 4408, 19, 407, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6759, 3367, 12, 2890, 4672, 365, 18, 81, 18, 1289, 1299, 2932, 407, 1051, 395, 3113, 315, 1355, 5466, 3113, 315, 3813, 3113, 315, 3813, 3113, 2206, 8712, 19, 4408, 19, 407, 1...
firstsize = os.path.getsize("junk_test.out") time.sleep(1) secondsize = os.path.getsize("junk_test.out") if firstsize == secondsize: passcount = passcount + 1 logstream.write(" PASS ]\n") else:
try: firstsize = os.path.getsize("junk_test.out") time.sleep(1) secondsize = os.path.getsize("junk_test.out") except (OSError, IOError):
def do_oddballtests(): global passcount global failcount global endput # oddball "stop" tests... logstream.write("Running test %-50s [" % "Stop Test 1") logstream.flush() (testout, testerr) = exec_repy_script("stop_testsleep.py", "restrictions.default", {'stop':'nonexist', 'status':'foo'}) if testout == '' and testerr == '': passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 endput = endput+"Stop Test 1\noutput or errput! out:"+testout+"err:"+ testerr+"\n\n" logstream.write("FAILED]\n") # oddball "stop" test2... logstream.write("Running test %-50s [" % "Stop Test 2") logstream.flush() (testout, testerr) = exec_repy_script("stop_testsleep.py", "restrictions.default", {'stop':'repy.py', 'status':'foo'}) if (not mobileNoSubprocess) and testout == '' and testerr != '': passcount = passcount + 1 logstream.write(" PASS ]\n") elif mobileNoSubprocess and testout.find('Traceback') == -1: passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 logstream.write("FAILED]\n") endput = endput+"Stop Test 2\noutput or no errput! out:"+testout+"err:"+ testerr+"\n\n" # oddball "stop" test3... logstream.write("Running test %-50s [" % "Stop Test 3") logstream.flush() # clean up the stop file if it already exists... if os.path.exists('junk_test.out'): os.remove('junk_test.out') (testout, testerr) = exec_repy_script('stop_testsleepwrite.py', "restrictions.default", {'stop':'junk_test.out','status':'foo'}) if testout == '' and testerr == '': passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 logstream.write("FAILED]\n") endput = endput+"Stop Test 3\noutput or errput! out:"+testout+"err:"+ testerr+"\n\n" # "stop" test3, however with an absolute path to the stop file logstream.write("Running test %-50s [" % "Absolute Path Stop Test") logstream.flush() # clean up the stop file if it already exists... if os.path.exists('junk_test.out'): os.remove('junk_test.out') currentdirectory = os.getcwd() stopfilename = os.path.join(currentdirectory,'junk_test.out') # This is needed when a space is in the directory where the tests are run stopfilename = '"'+stopfilename+'"' (testout, testerr) = exec_repy_script('stop_testsleepwrite.py', "restrictions.default", {'stop':stopfilename,'status':'foo'}) if testout == '' and testerr == '': passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 logstream.write("FAILED]\n") endput = endput+"Absolute Path Stop Test\noutput or errput! out:"+testout+"err:"+ testerr+"\n\n" # Test running repy from a sub directory logstream.write("Running test %-50s [" % "Sub-directory test") logstream.flush() # Make a temporary directory if not os.path.exists("subdirtest"): os.mkdir("subdirtest") (testout, testerr) = exec_repy_script("../n_testinit.py", "../restrictions.default", {'cwd':'subdirtest'}) if testout != '' and testerr == '': passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 endput = endput+"Sub-directory test\nno output or errput! out:"+testout+"err:"+ testerr+"\n\n" logstream.write("FAILED]\n") # oddball killing the parent test... logstream.write("Running test %-50s [" % "Kill Repy resource monitor.") logstream.flush() # Mac or Linux... if nonportable.ostype == 'Darwin' or nonportable.ostype == 'Linux': # Get the location of python locationproc = subprocess.Popen("which python",shell=True,stdout=subprocess.PIPE) locationproc.wait() location = locationproc.stdout.read().strip() locationproc.stdout.close() # Start the test p = subprocess.Popen((location+" repy.py restrictions.default killp_writetodisk.py").split(),stdout=subprocess.PIPE, stderr=subprocess.PIPE) pid = p.pid # give it a few seconds to start... time.sleep(4) # find the orphaned child's PID... Different on Mac / Linux because of ps # options... if nonportable.ostype == 'Darwin' or nonportable.osrealtype == 'FreeBSD': # run ps and print the 1st field (PID) of the line with 2nd field (PPID) # equal to the parent pid... childpidprocess = subprocess.Popen("ps -aO ppid | awk '{if ($2=="+str(pid)+") {print $1}}'",stdout=subprocess.PIPE, shell=True) childpidstring = childpidprocess.stdout.read().strip() childpidprocess.stdout.close() elif nonportable.ostype == 'Linux': # run ps and print the 2nd field (PID) of the line with 3rd field (PPID) # equal to the parent pid... childpidprocess = subprocess.Popen("ps -ef | awk '{if ($3=="+str(pid)+") {print $2}}'",stdout=subprocess.PIPE, shell=True) childpidstring = childpidprocess.stdout.read().strip() childpidprocess.stdout.close() else: print "Internal Error re-examining OS type '"+nonportable.ostype+"'!" sys.exit(1) # Windows elif nonportable.ostype == 'Windows' or nonportable.ostype == 'WindowsCE': # this is much easier because we don't worry about the path or have # children to worry about. p = subprocess.Popen("python repy.py restrictions.default killp_writetodisk.py".split(),stdout=subprocess.PIPE,stderr=subprocess.PIPE) pid = p.pid # Wait while the process starts time.sleep(4) else: print "Error: Unknown OS type '"+nonportable.ostype+"'!" sys.exit(1) # Kill the repy resource monitor harshexit.portablekill(pid) time.sleep(1) # See ticket #413 and #421 # This is a workaround for the possibility that the repy child was sleeping if nonportable.ostype == 'Darwin' or nonportable.ostype == 'Linux': # Send SIGCONT to the child if the process still exists, it should wake up, # get a read error when checking the pipe, and then exit... try: os.kill(int(childpidstring), signal.SIGCONT) except OSError: # the child has likely exited pass # Wait for the signal to take effect time.sleep(1) # Make sure the file size is not changing firstsize = os.path.getsize("junk_test.out") time.sleep(1) secondsize = os.path.getsize("junk_test.out") if firstsize == secondsize: passcount = passcount + 1 logstream.write(" PASS ]\n") else: failcount = failcount + 1 logstream.write("FAILED]\n") endput = endput+"Killing Repy's resource monitor did not stop repy!\n\n" # Close the pipes p.stdout.close() p.stderr.close() # Make sure repy.py works when invoked with options in a various order (to # test that adding getopt worked.) logstream.write("Running test %-50s [" % "repy.py takes args any order") test_process = subprocess.Popen(["python", "repy.py", "--simple", "--logfile", "log.log", "restrictions.loose", "testoptions.py"]) test_process.wait() # Check that log was created. if os.path.exists("log.log.old"): os.remove("log.log.old") test_process = subprocess.Popen(["python", "repy.py", "--logfile", "log.log", "--simple", "restrictions.loose", "testoptions.py"]) test_process.wait() # Check that log was created (again). if os.path.exists("log.log.old"): passcount += 1 logstream.write(" PASS ]\n") os.remove("log.log.old") else: failcount += 1 logstream.write("FAILED]\n") endput = endput+"Passing arguments in the opposite order failed!\n\n" else: failcount += 1 logstream.write("FAILED]\n") endput = endput+"Test for passing arguments in the opposite order failed!\n\n" logstream.flush()
674d4855c6ccac01e22e2078644a545a705d4beb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/674d4855c6ccac01e22e2078644a545a705d4beb/run_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 369, 1966, 454, 16341, 13332, 2552, 1342, 1883, 2552, 2321, 1883, 2552, 679, 458, 225, 468, 14800, 19067, 315, 5681, 6, 7434, 2777, 613, 3256, 18, 2626, 2932, 7051, 1842, 738, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 369, 1966, 454, 16341, 13332, 2552, 1342, 1883, 2552, 2321, 1883, 2552, 679, 458, 225, 468, 14800, 19067, 315, 5681, 6, 7434, 2777, 613, 3256, 18, 2626, 2932, 7051, 1842, 738, 1...
translations.append(' "%s": "%s"' % (msg, escapeJS(normalizedMessages[msg])))
translations.append(' "%s": "%s"' % (escapeJS(msg), escapeJS(normalizedMessages[msg])))
def generate(infile, languageCode, namespace): global MESSAGES if namespace != "": namespace += "." if len(languageCode.split("_")) > 1: requireString = "#require(%s%s)" % (namespace, languageCode.split("_")[0]) else: requireString = "" output = '''/* ************************************************************************ qooxdoo - the new era of web development http://qooxdoo.org Copyright: 2004-2007 by 1&1 Internet AG, Germany, http://www.1and1.org License: LGPL: http://www.gnu.org/licenses/lgpl.html EPL 1.0: http://www.eclipse.org/org/documents/epl-v10.php Authors: * Sebastian Werner (wpbasti) * Andreas Ecker (ecker) * Fabian Jakobs (fjakobs)
0ef4e6ce130c007187a329a8d2a7c12ce3d581ed /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5718/0ef4e6ce130c007187a329a8d2a7c12ce3d581ed/msgfmt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 12, 267, 768, 16, 14722, 16, 1981, 4672, 2552, 29251, 309, 1981, 480, 1408, 30, 1981, 1011, 4585, 309, 562, 12, 4923, 1085, 18, 4939, 2932, 9548, 3719, 405, 404, 30, 2583, 780, 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, 2103, 12, 267, 768, 16, 14722, 16, 1981, 4672, 2552, 29251, 309, 1981, 480, 1408, 30, 1981, 1011, 4585, 309, 562, 12, 4923, 1085, 18, 4939, 2932, 9548, 3719, 405, 404, 30, 2583, 780, 2...
raise BadArgumnentError return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unistr),
raise TypeError return PyUnicode_EncodeASCII(unicode(unistr),
def PyUnicode_AsASCIIString(unistr): if not type(unistr) == unicode: raise BadArgumnentError return PyUnicode_EncodeASCII(PyUnicode_AS_UNICODE(unistr), len(unicode), None)
0e540b97b49394c1d38eed66d9b3eec5969d6c9a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/0e540b97b49394c1d38eed66d9b3eec5969d6c9a/unicodecodec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4707, 16532, 67, 1463, 13756, 780, 12, 318, 3337, 4672, 225, 309, 486, 618, 12, 318, 3337, 13, 422, 5252, 30, 1002, 3580, 327, 4707, 16532, 67, 5509, 13756, 12, 9124, 12, 318, 3337, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4707, 16532, 67, 1463, 13756, 780, 12, 318, 3337, 4672, 225, 309, 486, 618, 12, 318, 3337, 13, 422, 5252, 30, 1002, 3580, 327, 4707, 16532, 67, 5509, 13756, 12, 9124, 12, 318, 3337, 36...
sage: E.saturate()
sage: E.saturate()
def set_verbose(self, verbose): """ Set the verbosity of printing of output by the 2-descent and other functions.
1cc4edc9aafb88d044d853b60331d1432546cf60 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/1cc4edc9aafb88d044d853b60331d1432546cf60/interface.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 67, 11369, 12, 2890, 16, 3988, 4672, 3536, 1000, 326, 11561, 434, 19171, 434, 876, 635, 326, 576, 17, 5569, 319, 471, 1308, 4186, 18, 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, 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, 444, 67, 11369, 12, 2890, 16, 3988, 4672, 3536, 1000, 326, 11561, 434, 19171, 434, 876, 635, 326, 576, 17, 5569, 319, 471, 1308, 4186, 18, 2, -100, -100, -100, -100, -100, -100, -100, ...
Startup_with_large_calendar /usr/bin/time --format=%e -o test_profile/time.log .../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py
Startup_with_large_calendar ...time... --format=%e -o test_profile/time.log .../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py
def runSingles(options): """ Run the test(s) specified with the options.single parameter. >>> options = parseOptions() >>> checkOptions(options) >>> options.dryrun = True >>> options.verbose = True >>> options.modes = ['release'] >>> options.single = 'ThisTestDoesNotExist' >>> runSingles(options) Test(s) not found False >>> options.modes = ['release', 'debug'] >>> options.single = 'TestCrypto.py' >>> runSingles(options) /.../release/RunPython... application/tests/TestCrypto.py -v - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /.../debug/RunPython... application/tests/TestCrypto.py -v - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False >>> options.modes = ['release'] >>> options.single = 'TestCreateAccounts.py' >>> runSingles(options) /.../RunChandler... --create --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --chandlerTests=TestCreateAccounts -D2 -M0 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False >>> options.single = 'PerfLargeDataSharing.py' >>> runSingles(options) /.../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --catsPerfLog=test_profile/time.log --scriptFile=tools/QATestScripts/Performance/PerfLargeDataSharing.py --restore=test_profile/__repository__.001 PerfLargeDataSharing.py | 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + False >>> options.single = 'startup_large.py' >>> runSingles(options) Creating repository for startup time tests /.../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --scriptFile=tools/QATestScripts/Performance/quit.py --restore=test_profile/__repository__.001 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Startup_with_large_calendar /usr/bin/time --format=%e -o test_profile/time.log .../RunChandler... --catch=tests --profileDir=test_profile --parcelPath=tools/QATestScripts/DataFiles --scriptFile=tools/QATestScripts/Performance/end.py 0.00 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + ... False >>> options.single = 'TestCrypto.py,TestSchemaAPI.py' >>> runSingles(options) /.../RunPython... application/tests/TestCrypto.py -v - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + /.../RunPython... application/tests/TestSchemaAPI.py -v ... """ failed = False tests = buildTestList(options, False) if not tests: log('Test(s) not found') else: for test in tests: dirname, name = os.path.split(test) if os.path.split(dirname)[1] == 'Functional': if runFuncTest(options, name[:-3]): failed = True elif name.startswith('Perf'): if runPerfTests(options, [test]): failed = True elif name in ('startup', 'startup_large'): if runPerfTests(options, [name]): failed = True else: if runUnitTests(options, [test]): failed = True if failed and not options.noStop: break return failed
ecb374e04dcb540c94be5ad6c9c04be2a1369cef /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/ecb374e04dcb540c94be5ad6c9c04be2a1369cef/rt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 55, 310, 1040, 12, 2116, 4672, 3536, 1939, 326, 1842, 12, 87, 13, 1269, 598, 326, 702, 18, 7526, 1569, 18, 225, 4080, 702, 273, 1109, 1320, 1435, 4080, 866, 1320, 12, 2116, 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, 1086, 55, 310, 1040, 12, 2116, 4672, 3536, 1939, 326, 1842, 12, 87, 13, 1269, 598, 326, 702, 18, 7526, 1569, 18, 225, 4080, 702, 273, 1109, 1320, 1435, 4080, 866, 1320, 12, 2116, 13, ...
filter = res_company_ldap.ldap_filter % (user.login,)
filter = filter_format(res_company_ldap.ldap_filter, (user.login,))
def _ldap_check(db, uid, passwd): try: return oldfnc(db, uid, passwd) except: # AccessDenied pass
c2d798c06f7cd34b8f5ed60f1c8ea20072ad9ff9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7339/c2d798c06f7cd34b8f5ed60f1c8ea20072ad9ff9/users_ldap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14394, 67, 1893, 12, 1966, 16, 4555, 16, 19093, 4672, 775, 30, 327, 1592, 4293, 71, 12, 1966, 16, 4555, 16, 19093, 13, 1335, 30, 468, 5016, 10410, 1342, 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, 14394, 67, 1893, 12, 1966, 16, 4555, 16, 19093, 4672, 775, 30, 327, 1592, 4293, 71, 12, 1966, 16, 4555, 16, 19093, 13, 1335, 30, 468, 5016, 10410, 1342, 2, -100, -100, -100, -100,...
return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
try: return self.canvas.setFont(fname, utils.unit_get(node.get('size'))) except KeyError, e: raise KeyError('Font "%s" is not registered in the engine' % fname)
def setFont(self, node): fname = node.get('name') return self.canvas.setFont(fname, utils.unit_get(node.get('size')))
b4a563cc1c610c998d50db044ec46d1b24a0fbd6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/b4a563cc1c610c998d50db044ec46d1b24a0fbd6/trml2pdf.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20454, 12, 2890, 16, 756, 4672, 5299, 273, 756, 18, 588, 2668, 529, 6134, 327, 365, 18, 15424, 18, 542, 5711, 12, 12749, 16, 2990, 18, 4873, 67, 588, 12, 2159, 18, 588, 2668, 1467, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 20454, 12, 2890, 16, 756, 4672, 5299, 273, 756, 18, 588, 2668, 529, 6134, 327, 365, 18, 15424, 18, 542, 5711, 12, 12749, 16, 2990, 18, 4873, 67, 588, 12, 2159, 18, 588, 2668, 1467, 1...
else: if base_type == "struct": self.index.add(name, self.filename, not self.is_header,
else: if base_type == "struct": self.index_add(name, self.filename, not self.is_header,
#self.debug("end typedef type", token)
c7d1398e49a7858195b4b8e0b9832ded1fb9f169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3857/c7d1398e49a7858195b4b8e0b9832ded1fb9f169/apibuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 2890, 18, 4148, 2932, 409, 618, 536, 618, 3113, 1147, 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, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 2890, 18, 4148, 2932, 409, 618, 536, 618, 3113, 1147, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
sorted(testcases_processes.values(), key=lambda tc:tc.__name__)
sorted(testcases_processes.values(), key=lambda tc:tc.__name__) + sorted(testcases_threads.values(), key=lambda tc:tc.__name__) + sorted(testcases_manager.values(), key=lambda tc:tc.__name__)
def test_main(run=None): if sys.platform.startswith("linux"): try: lock = multiprocessing.RLock() except OSError: from test.test_support import TestSkipped raise TestSkipped("OSError raises on RLock creation, see issue 3111!") if run is None: from test.test_support import run_unittest as run util.get_temp_dir() # creates temp directory for use by all processes multiprocessing.get_logger().setLevel(LOG_LEVEL) #ProcessesMixin.pool = multiprocessing.Pool(4) #ThreadsMixin.pool = multiprocessing.dummy.Pool(4) #ManagerMixin.manager.__init__() #ManagerMixin.manager.start() #ManagerMixin.pool = ManagerMixin.manager.Pool(4) testcases = ( sorted(testcases_processes.values(), key=lambda tc:tc.__name__) #+ #sorted(testcases_threads.values(), key=lambda tc:tc.__name__) + #sorted(testcases_manager.values(), key=lambda tc:tc.__name__) ) loadTestsFromTestCase = unittest.defaultTestLoader.loadTestsFromTestCase suite = unittest.TestSuite(loadTestsFromTestCase(tc) for tc in testcases) run(suite) #ThreadsMixin.pool.terminate() #ProcessesMixin.pool.terminate() #ManagerMixin.pool.terminate() #ManagerMixin.manager.shutdown() #del ProcessesMixin.pool, ThreadsMixin.pool, ManagerMixin.pool
9cbd5a7ebf2e75965579f3919b8cd9004fbf3411 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/9cbd5a7ebf2e75965579f3919b8cd9004fbf3411/test_multiprocessing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 12, 2681, 33, 7036, 4672, 309, 2589, 18, 9898, 18, 17514, 1918, 2932, 20132, 6, 4672, 775, 30, 2176, 273, 21828, 18, 54, 2531, 1435, 1335, 10002, 30, 628, 1842, 18, 381...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 12, 2681, 33, 7036, 4672, 309, 2589, 18, 9898, 18, 17514, 1918, 2932, 20132, 6, 4672, 775, 30, 2176, 273, 21828, 18, 54, 2531, 1435, 1335, 10002, 30, 628, 1842, 18, 381...
- n: a non negative integer
- ``n``: a non negative integer
def _pow_naive(self, n): r""" A naive implementation of __pow__
eda1aa3ffdb57ef7907cbd3de37a32cfd1f0fe01 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/eda1aa3ffdb57ef7907cbd3de37a32cfd1f0fe01/monoids.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 23509, 67, 6582, 688, 12, 2890, 16, 290, 4672, 436, 8395, 432, 28224, 4471, 434, 1001, 23509, 972, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 23509, 67, 6582, 688, 12, 2890, 16, 290, 4672, 436, 8395, 432, 28224, 4471, 434, 1001, 23509, 972, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
parser.resolvers.add(RunResolver(os.path.dirname(content)))
def main(): """Called from console script """ op = _createOptionParser(usage=usage) op.add_option("-x", "--xsl", metavar="transform.xsl", help="XSL transform", dest="xsl", default=None) (options, args) = op.parse_args() if len(args) > 2: op.error("Wrong number of arguments.") elif len(args) == 2: if options.xsl or options.rules: op.error("Wrong number of arguments.") path, content = args if path.lower().endswith('.xsl'): options.xsl = path else: options.rules = path elif len(args) == 1: content, = args else: op.error("Wrong number of arguments.") if options.rules is None and options.xsl is None: op.error("Must supply either options or rules") if options.trace: logger.setLevel(logging.DEBUG) if options.xsl is not None: output_xslt = etree.parse(options.xsl) else: parser = etree.HTMLParser() output_xslt = compile_theme( rules=options.rules, theme=options.theme, extra=options.extra, parser=parser, read_network=options.read_network, absolute_prefix=options.absolute_prefix, includemode=options.includemode, ) if content == '-': content = sys.stdin if options.read_network: access_control = AC_READ_NET else: access_control = AC_READ_FILE parser.resolvers.add(RunResolver(os.path.dirname(content))) transform = etree.XSLT(output_xslt, access_control=access_control) content_doc = etree.parse(content, parser=etree.HTMLParser()) output_html = transform(content_doc) output_html.write(options.output, encoding='UTF-8', pretty_print=options.pretty_print) for msg in transform.error_log: logger.warn(msg)
9f2cbc183961a9d45ba479a27ee8c41b1581faf6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12188/9f2cbc183961a9d45ba479a27ee8c41b1581faf6/run.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 8185, 628, 2983, 2728, 3536, 1061, 273, 389, 2640, 1895, 2678, 12, 9167, 33, 9167, 13, 1061, 18, 1289, 67, 3482, 2932, 17, 92, 3113, 5238, 30903, 3113, 15050, 1546, 65...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 8185, 628, 2983, 2728, 3536, 1061, 273, 389, 2640, 1895, 2678, 12, 9167, 33, 9167, 13, 1061, 18, 1289, 67, 3482, 2932, 17, 92, 3113, 5238, 30903, 3113, 15050, 1546, 65...
'proxy-password' or 'proxy_password' variable.
'proxy-password' or 'proxy_password' variable, or in 'http_proxy' or 'https_proxy' as "protocol://[username:password@]host:port".
def _get_access_url(self, url): return url.to_string()
6669e55d5e203c11593196b8639c52efa5ba675f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5609/6669e55d5e203c11593196b8639c52efa5ba675f/http.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 3860, 67, 718, 12, 2890, 16, 880, 4672, 327, 880, 18, 869, 67, 1080, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 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, 389, 588, 67, 3860, 67, 718, 12, 2890, 16, 880, 4672, 327, 880, 18, 869, 67, 1080, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
0.70709209610 - 0.42035364080*I
0.70709209 - 0.42035364*I
def gamma_inc(self, t): """ Return the incomplete Gamma function evaluated at this complex number.
293427b47ee2bb564117092226099ed44acd171f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/293427b47ee2bb564117092226099ed44acd171f/complex_number.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9601, 67, 9523, 12, 2890, 16, 268, 4672, 3536, 2000, 326, 14715, 25409, 445, 12697, 622, 333, 7233, 1300, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9601, 67, 9523, 12, 2890, 16, 268, 4672, 3536, 2000, 326, 14715, 25409, 445, 12697, 622, 333, 7233, 1300, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
if (self.changed>0 and self.parentPanel.messageConfirm(message%' and loose current changes')) or\
if (self.changed>0 and self.parentPanel.messageConfirm(message%' and lose current changes')) or\
def checkTime(self): if (not (self.frame.dead or self.parentFrame.dead)) and \ hasattr(self,'fileName') and os.path.exists(self.fileName): try: pos=self.source.GetCurrentPos() fileTime=os.path.getmtime(self.fileName) if fileTime>self.fileTime: #file is modified self.fileTime=fileTime baseName=os.path.basename(self.fileName) message=baseName+' is modified externally.\nDo you want to reload it%s?' if (self.changed>0 and self.parentPanel.messageConfirm(message%' and loose current changes')) or\ (not self.changed>0 and (self.parentPanel.getValue('AutoReloadChangedFile') or self.parentPanel.messageConfirm(message%''))): self.revert() self.source.GotoPos(pos) return 1 except: return 0
f07081ae3fdcbc8b326cbf1e19167b6c483b49ca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2464/f07081ae3fdcbc8b326cbf1e19167b6c483b49ca/Child.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 950, 12, 2890, 4672, 309, 261, 902, 261, 2890, 18, 3789, 18, 22097, 578, 365, 18, 2938, 3219, 18, 22097, 3719, 471, 521, 3859, 12, 2890, 11189, 17812, 6134, 471, 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, 866, 950, 12, 2890, 4672, 309, 261, 902, 261, 2890, 18, 3789, 18, 22097, 578, 365, 18, 2938, 3219, 18, 22097, 3719, 471, 521, 3859, 12, 2890, 11189, 17812, 6134, 471, 1140, 18, 803, 18...
f_iter.name = '%s *' % p.name return f_iter
_many.name = '%s *' % p.name return _many
def f_iter(tokens, s): 'Iterative implementation preventing the stack overflow.' res = [] try: while True: (v, s) = p.run(tokens, s) res.append(v) except NoParseError, e: return (res, e.state)
a98e7a502632761f6288209a1068fea4b06004b2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11574/a98e7a502632761f6288209a1068fea4b06004b2/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 67, 2165, 12, 7860, 16, 272, 4672, 296, 2360, 1535, 4471, 5309, 310, 326, 2110, 9391, 1093, 400, 273, 5378, 775, 30, 1323, 1053, 30, 261, 90, 16, 272, 13, 273, 293, 18, 2681, 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, 284, 67, 2165, 12, 7860, 16, 272, 4672, 296, 2360, 1535, 4471, 5309, 310, 326, 2110, 9391, 1093, 400, 273, 5378, 775, 30, 1323, 1053, 30, 261, 90, 16, 272, 13, 273, 293, 18, 2681, 12...
return run_sql("UPDATE schTASK SET progress=%s where id=%s", (msg, options["task"]))
return run_sql("UPDATE schTASK SET progress=%s WHERE id=%s", (msg, options["task"]))
def task_update_progress(msg): """Updates progress information in the BibSched task table.""" global options if options["verbose"] >= 9: write_message("Updating task progress to %s." % msg) return run_sql("UPDATE schTASK SET progress=%s where id=%s", (msg, options["task"]))
c01e7675eac4ac02844b96fe38be4646d43de28c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/c01e7675eac4ac02844b96fe38be4646d43de28c/bibupload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1562, 67, 2725, 67, 8298, 12, 3576, 4672, 3536, 5121, 4007, 1779, 316, 326, 605, 495, 55, 2049, 1562, 1014, 12123, 2552, 702, 309, 702, 9614, 11369, 11929, 1545, 2468, 30, 1045, 67, 2150...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1562, 67, 2725, 67, 8298, 12, 3576, 4672, 3536, 5121, 4007, 1779, 316, 326, 605, 495, 55, 2049, 1562, 1014, 12123, 2552, 702, 309, 702, 9614, 11369, 11929, 1545, 2468, 30, 1045, 67, 2150...
value = self._poly_ring(value)
value = self._poly_ring._coerce_(value)
def __call__(self, value): # todo: I don't understand why the direct _poly_ring.__call__() # doesn't work....
f6a8f5488f8d925c36ca4c79abbe0bd0ef8977bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9417/f6a8f5488f8d925c36ca4c79abbe0bd0ef8977bc/monsky_washnitzer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 460, 4672, 468, 10621, 30, 467, 2727, 1404, 22413, 11598, 326, 2657, 389, 16353, 67, 8022, 16186, 1991, 972, 1435, 468, 3302, 1404, 1440, 6265, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 460, 4672, 468, 10621, 30, 467, 2727, 1404, 22413, 11598, 326, 2657, 389, 16353, 67, 8022, 16186, 1991, 972, 1435, 468, 3302, 1404, 1440, 6265, 2, -100, -1...
assert_equals(len(lib.handlers), 0)
assert_equals(len(lib.handlers), 1)
def test_handler_is_not_created_with_invalid_methods(self): for reason in ['Attribute', 'Signature']: lib = TestLibrary('Invalid%sArgDocDynamicJavaLibrary' % reason) assert_equals(len(lib.handlers), 0)
6fbcc6c0dc97c5db83b815121f44d9e1c3826c2e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6988/6fbcc6c0dc97c5db83b815121f44d9e1c3826c2e/test_testlibrary.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4176, 67, 291, 67, 902, 67, 4824, 67, 1918, 67, 5387, 67, 5163, 12, 2890, 4672, 364, 3971, 316, 10228, 1499, 2187, 296, 5374, 3546, 30, 2561, 273, 7766, 9313, 2668, 1941, 9, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4176, 67, 291, 67, 902, 67, 4824, 67, 1918, 67, 5387, 67, 5163, 12, 2890, 4672, 364, 3971, 316, 10228, 1499, 2187, 296, 5374, 3546, 30, 2561, 273, 7766, 9313, 2668, 1941, 9, ...
for junk in range(60):
for junk in range(360):
def main(): # Initialize the update url to just be the ip address of this machine. ip = getmyip() updateurl = 'http://' + ip + ':12345/' if len(sys.argv) == 1: sys.argv.append(updateurl) else: sys.argv[1] = updateurl # Create a temp directory to serve the updates from that we can # automatically clean up when we are done. tmpserver = tempfile.mkdtemp() try: test_updater.create_folders(tmpserver) ############################ # Run the rsync only tests # ############################ # Run the noup test (Nothing should fail, nothing should be updated) runRsyncTest('-x', tmpserver + '/noup/') # Run the wronghash test(There should be an RsyncError, and no updates) runRsyncTest('-e', tmpserver + '/wronghash/') # Run the badkeysig test (There should be no updates) runRsyncTest('-x', tmpserver + '/badkeysig/') # Run the corruptmeta test (there should be an RsyncError, and no updates) runRsyncTest('-e', tmpserver + '/corruptmeta/') # Run the updatenmmain test (only nmmain should get updated) runRsyncTest('-u', tmpserver + '/updatenmmain/', ['nmmain.py', 'metainfo']) # Run an update that should get us into a state where the softwareupdater has # a different key than what the metainfo is signed with. The next test will # ensure that our method of dealing with this situation works. runRsyncTest('-u', tmpserver + '/updater/', ['softwareupdater.py', 'metainfo']) # Run an update that should successfully update from the strange state from # the previous test. runRsyncTest('-u', tmpserver + '/updater_new/', ['nmmain.py', 'metainfo']) ##################################### # Finished running rsync only tests # ##################################### # Copy back everything from noup so the restart tests start with a # clean slate. for originalfile in glob.glob(tmpserver + '/noup/*'): shutil.copy(originalfile, os.path.basename(originalfile)) ################################## # Software updater restart tests # ################################## # Start the web server for the first update webserver = run_webserver(tmpserver + '/updater/') # Keep track of whether ps is there (it isn't on Windows) no_ps = False if nonportable.ostype == 'Windows': # If we are running on windows, disable the ps calls. no_ps = True # We use bsd syntax for the ps command because it works on bsd, darwin, and linux. # (bsd syntax means basically no dash before the options and maybe some different # letters used for the options.) # The 'ww' is to make sure that bsd doesn't limit the column length of output. # The 'ax' shows all processes. # The 'u' shows the username rather than user id running the process. pscommand = 'ps auxww' updateprocess = subprocess.Popen(['python', 'softwareupdater.py']) if not no_ps: # Only do the ps check if ps is available ps = subprocess.Popen(pscommand + ' | grep "softwareupdater.py" | grep -v grep', shell=True, stdout=subprocess.PIPE) psout = ps.communicate()[0] print 'Initial ps out:' print psout if psout == '': print 'Failure to start initially' # Wait for 2 minutes for the update to happen and the # process to die. for junk in range(60): if updateprocess.poll() != None: break time.sleep(2) ret = updateprocess.returncode if ret != 10: if ret == None: raise Exception("First software updater never died.") elif ret == 55: raise Exception("Software updater failed to get the process lock.") elif ret == 1: raise Exception("Softwareupdater failed with an uncaught exception. \n\ See end of softwareupdater.old in v2 for details.") else: raise Exception("Unknown return code from the software updater (" + str(ret) + ")") else: print "Old softwareupdater returned correctly" if not no_ps: # Only do the ps check if ps is available ps = subprocess.Popen(pscommand + ' | grep "softwareupdater.py" | grep -v grep', shell=True, stdout=subprocess.PIPE) psout = ps.communicate()[0] print 'After ps out:' print psout if psout == '': print 'New updater failed to start!' else: print 'softwareupdater restart success!' # We need to kill the webserver serving from /updater, and start one serving # from updater_new kill_webserver(webserver.pid, updateurl) webserver = run_webserver(tmpserver + '/updater_new/') print "Waiting 2 minutes for the second update to happen" # Wait 2 minutes for the second update to happen. # Is there a way to get a handle for the new softwareupdater? time.sleep(120) # If nmmain's version has been updated, the second update was a success! nmmainfile = file('nmmain.py', 'r') nmmaindata = nmmainfile.read() nmmainfile.close() if 'version = "1234"' in nmmaindata: print 'Second update a success!' else: print 'Second update failed to happen within 2 minutes' # Kill the webserver again now that we are all done with it. kill_webserver(webserver.pid, updateurl) ###################################### # End Software updater restart tests # ###################################### except: traceback.print_exc() finally: # Clean up the temporary server directory. # This throws an exception on Windows if a file is still in use (for example, # if the webserver started in a test couldn't be shut down). shutil.rmtree(tmpserver)
f00e741c2211f2bf55279a3ea8c69404ff684903 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/f00e741c2211f2bf55279a3ea8c69404ff684903/test_updater_local.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 9190, 326, 1089, 880, 358, 2537, 506, 326, 2359, 1758, 434, 333, 5228, 18, 2359, 273, 336, 4811, 625, 1435, 1089, 718, 273, 296, 2505, 8931, 397, 2359, 397, 4290, 2138,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9190, 326, 1089, 880, 358, 2537, 506, 326, 2359, 1758, 434, 333, 5228, 18, 2359, 273, 336, 4811, 625, 1435, 1089, 718, 273, 296, 2505, 8931, 397, 2359, 397, 4290, 2138,...
guess_include_path(env, conf, 'OpenAL', 'AL')
guess_include_path(env, conf, 'OpenAL', 'AL')
def check_openal(env, conf): print "Checking for OpenAL..." # put this here for crosscompiling if env['platform'] == 'windows': guess_include_path(env, conf, 'OpenAL', 'AL') return print " Checking for openal-config...", openalcfg = env.WhereIs("openal-config") if openalcfg: print openalcfg env.ParseConfig(openalcfg+" --cflags --libs") else: print "not found" guess_include_path(env, conf, 'OpenAL', 'AL')
0bb908fe820b0faebff097dd1c3c48dcbfe7472c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1030/0bb908fe820b0faebff097dd1c3c48dcbfe7472c/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 3190, 287, 12, 3074, 16, 2195, 4672, 1172, 315, 14294, 364, 3502, 1013, 7070, 468, 1378, 333, 2674, 364, 6828, 2919, 4973, 309, 1550, 3292, 9898, 3546, 422, 296, 13226, 4278, 72...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 3190, 287, 12, 3074, 16, 2195, 4672, 1172, 315, 14294, 364, 3502, 1013, 7070, 468, 1378, 333, 2674, 364, 6828, 2919, 4973, 309, 1550, 3292, 9898, 3546, 422, 296, 13226, 4278, 72...
checkfile=execname+platform+'.good' if not os.path.isfile(checkfile): checkfile=execname+'.good' if not os.path.isfile(checkfile): checkfile=None
checkfile=execname+'.good'
def kill_proc(p, timeout): k = subprocess.Popen(['kill',str(p.pid)]) k.wait() now = time.time() end_time = now + timeout # give it a little time while end_time > now: if p.poll(): return now = time.time() # use the big hammer (and don't bother waiting) subprocess.Popen(['kill','-9', str(p.pid)]) return
97dd26e665e2ca235f4c8596da4b25c90663de32 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6895/97dd26e665e2ca235f4c8596da4b25c90663de32/sub_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8673, 67, 9381, 12, 84, 16, 2021, 4672, 417, 273, 6652, 18, 52, 3190, 12, 3292, 16418, 2187, 701, 12, 84, 18, 6610, 13, 5717, 417, 18, 7048, 1435, 2037, 273, 813, 18, 957, 1435, 679,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8673, 67, 9381, 12, 84, 16, 2021, 4672, 417, 273, 6652, 18, 52, 3190, 12, 3292, 16418, 2187, 701, 12, 84, 18, 6610, 13, 5717, 417, 18, 7048, 1435, 2037, 273, 813, 18, 957, 1435, 679,...
return self.makeaclass(request, tl, one, two, module, extra, prog, cls)
return self.makeaclass_logic(request, tl, one, two, module, extra, prog, cls)
def editclass(self, request, tl, one, two, module, extra, prog): try: int(extra) except: raise ESPError("False"), "Invalid integer for class ID!"
d5c0fc860d2e09a259f61647f114c599bbf5ed30 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12041/d5c0fc860d2e09a259f61647f114c599bbf5ed30/teacherclassregmodule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 1106, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 4672, 775, 30, 509, 12, 7763, 13, 1335, 30, 1002, 512, 3118, 668, 2932, 8381, 6, 3631, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3874, 1106, 12, 2890, 16, 590, 16, 8332, 16, 1245, 16, 2795, 16, 1605, 16, 2870, 16, 11243, 4672, 775, 30, 509, 12, 7763, 13, 1335, 30, 1002, 512, 3118, 668, 2932, 8381, 6, 3631, 315...
assert layout[i] is None, "%s overlaps %r" % (fieldname, layout[i])
assert layout[i] is None, "%s overlaps %r" % (name, layout[i])
def layout_addfield(layout, offset, ctype, prefix): size = _sizeof(ctype) name = prefix i = 0 while name in layout: i += 1 name = '%s_%d' % (prefix, i) field = Field(name, ctype) for i in range(offset, offset+size): assert layout[i] is None, "%s overlaps %r" % (fieldname, layout[i]) layout[i] = field return field
5309f53987adcdad8b8860c85898fe97c4ffb65e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/5309f53987adcdad8b8860c85898fe97c4ffb65e/rffi_platform.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3511, 67, 1289, 1518, 12, 6741, 16, 1384, 16, 11920, 16, 1633, 4672, 963, 273, 389, 1467, 792, 12, 12387, 13, 508, 273, 1633, 277, 273, 374, 1323, 508, 316, 3511, 30, 277, 1011, 404, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3511, 67, 1289, 1518, 12, 6741, 16, 1384, 16, 11920, 16, 1633, 4672, 963, 273, 389, 1467, 792, 12, 12387, 13, 508, 273, 1633, 277, 273, 374, 1323, 508, 316, 3511, 30, 277, 1011, 404, ...
self.settings["CFLAGS"]="-Os -march=armv4 -pipe"
self.settings["CFLAGS"]+=" -march=armv4"
def __init__(self,myspec): generic_arm.__init__(self,myspec) self.settings["CHOST"]="armv4l-unknown-linux-gnu" self.settings["CFLAGS"]="-Os -march=armv4 -pipe"
53fab4b752e759327ccdfc975b482828b7745033 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7327/53fab4b752e759327ccdfc975b482828b7745033/arm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 81, 1900, 705, 4672, 5210, 67, 4610, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 1792, 4005, 11929, 1546, 4610, 90, 24, 80, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 81, 1900, 705, 4672, 5210, 67, 4610, 16186, 2738, 972, 12, 2890, 16, 81, 1900, 705, 13, 365, 18, 4272, 9614, 1792, 4005, 11929, 1546, 4610, 90, 24, 80, ...
def main(args0):
def _main(args0):
def main(args0): """Process options and arguments""" usage = "usage: cifras.py number1 ... numberN final\n %s" % __doc__.strip() parser = optparse.OptionParser(usage) parser.add_option('-t', '--test', dest='test', default=False, action="store_true", help='Run unittests') options, args = parser.parse_args(args0) if options.test: return _test() nums0 = map(int, args) if len(args) < 2: parser.print_help() return 1 nums, final = nums0[:-1], nums0[-1] result = process(final, map(get_strnum, nums), show_approx=True) if result: print "%d = %s" % (final, result[1]) else: print "Couldn't find the number %d" % final
60c7aebc8b2891d0ccb154e6cb392938ead6036f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4835/60c7aebc8b2891d0ccb154e6cb392938ead6036f/cifras.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 5254, 12, 1968, 20, 4672, 3536, 2227, 702, 471, 1775, 8395, 4084, 273, 315, 9167, 30, 276, 430, 21636, 18, 2074, 1300, 21, 1372, 1300, 50, 727, 64, 82, 565, 738, 87, 6, 738, 100...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 12, 1968, 20, 4672, 3536, 2227, 702, 471, 1775, 8395, 4084, 273, 315, 9167, 30, 276, 430, 21636, 18, 2074, 1300, 21, 1372, 1300, 50, 727, 64, 82, 565, 738, 87, 6, 738, 100...
summary = "TinderboxPrint: TUnit<br/>" + str(passCount) + "/" + str(failCount) + "\n"
summary = "TinderboxPrint: TUnit<br/>" + summaryText(passCount,failCount) + "\n"
def createSummary(self, log): passCount = 0 failCount = 0 for line in log.readlines(): if "TEST-PASS" in line: passCount = passCount + 1 if "TEST-UNEXPECTED-" in line: failCount = failCount + 1 summary = "TinderboxPrint: TUnit<br/>" + str(passCount) + "/" + str(failCount) + "\n" self.addCompleteLog('summary', summary)
a10704a66fa8fd8ba47e9724a37190bcf0cc8ec3 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13067/a10704a66fa8fd8ba47e9724a37190bcf0cc8ec3/steps.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 4733, 12, 2890, 16, 613, 4672, 1342, 1380, 273, 374, 2321, 1380, 273, 374, 364, 980, 316, 613, 18, 896, 3548, 13332, 309, 315, 16961, 17, 10884, 6, 316, 980, 30, 1342, 1380, 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, 752, 4733, 12, 2890, 16, 613, 4672, 1342, 1380, 273, 374, 2321, 1380, 273, 374, 364, 980, 316, 613, 18, 896, 3548, 13332, 309, 315, 16961, 17, 10884, 6, 316, 980, 30, 1342, 1380, 273, ...
attr_x = field.from_ldap(x[1].get(field.db_column, []), connection=self.connection).lower() attr_y = field.from_ldap(y[1].get(field.db_column, []), connection=self.connection).lower()
attr_x = field.from_ldap(x[1].get(field.db_column, []), connection=self.connection) attr_y = field.from_ldap(y[1].get(field.db_column, []), connection=self.connection) if hasattr(attr_x, 'lower'): attr_x = attr_x.lower() if hasattr(attr_y, 'lower'): attr_y = attr_y.lower()
def cmpvals(x, y): for fieldname in ordering: if fieldname.startswith('-'): fieldname = fieldname[1:] negate = True else: negate = False field = query.model._meta.get_field(fieldname) attr_x = field.from_ldap(x[1].get(field.db_column, []), connection=self.connection).lower() attr_y = field.from_ldap(y[1].get(field.db_column, []), connection=self.connection).lower() val = negate and cmp(attr_y, attr_x) or cmp(attr_x, attr_y) if val: return val return 0
82901736cde9aae9fbe8b6acc0aad2141ecd9583 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12933/82901736cde9aae9fbe8b6acc0aad2141ecd9583/query.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 4524, 12, 92, 16, 677, 4672, 364, 14680, 316, 9543, 30, 309, 14680, 18, 17514, 1918, 2668, 6627, 4672, 14680, 273, 14680, 63, 21, 26894, 15626, 273, 1053, 469, 30, 15626, 273, 1083...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9411, 4524, 12, 92, 16, 677, 4672, 364, 14680, 316, 9543, 30, 309, 14680, 18, 17514, 1918, 2668, 6627, 4672, 14680, 273, 14680, 63, 21, 26894, 15626, 273, 1053, 469, 30, 15626, 273, 1083...
self.pushContent('description', attrsD, 'text/html', self.infeed or self.inentry or self.insource)
context = self._getContext() if context.has_key('summary'): self._summaryKey = 'content' self._start_content(attrsD) else: self.pushContent('description', attrsD, 'text/html', self.infeed or self.inentry or self.insource)
def _start_description(self, attrsD): self.pushContent('description', attrsD, 'text/html', self.infeed or self.inentry or self.insource)
50cbe5fb44dbff087e8cca95d332bb7b7cc15747 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/50cbe5fb44dbff087e8cca95d332bb7b7cc15747/feedparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1937, 67, 3384, 12, 2890, 16, 3422, 40, 4672, 365, 18, 6206, 1350, 2668, 3384, 2187, 3422, 40, 16, 296, 955, 19, 2620, 2187, 365, 18, 267, 7848, 578, 365, 18, 267, 4099, 578, 36...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1937, 67, 3384, 12, 2890, 16, 3422, 40, 4672, 365, 18, 6206, 1350, 2668, 3384, 2187, 3422, 40, 16, 296, 955, 19, 2620, 2187, 365, 18, 267, 7848, 578, 365, 18, 267, 4099, 578, 36...
logger.notifyChannel("init", netsvc.LOG_WARNING, "couldn't export translation for report %s %s %s" % name, report_type, fname)
logger.notifyChannel("init", netsvc.LOG_WARNING, "couldn't export translation for report %s %s %s" % (name, report_type, fname))
for field_name, field_def in obj._columns.iteritems(): name = obj_name + "," + field_name value = "" if lang: cr.execute("SELECT * FROM ir_translation WHERE type='field' AND name=%s AND lang=%s", (name,lang)) res = cr.dictfetchall() if len(res): value = res[0]['value'] out.append(["field", name, "0", field_def.string.encode('utf8'), value]) if field_def.translate: ids = osv.orm.orm.search(obj, cr, uid, []) obj_values = obj.read(cr, uid, ids, [field_name]) for obj_value in obj_values: trans = "" if lang: cr.execute("SELECT * FROM ir_translation WHERE type='model' AND name=%s AND res_id=%d AND lang=%s", (name, obj_value['id'], lang)) res = cr.dictfetchall() if len(res): trans = res[0]['value'] out.append(["model", name, obj_value['id'], obj_value[field_name], trans]) if hasattr(field_def, 'selection') and isinstance(field_def.selection, (list, tuple)): for key, val in field_def.selection: to_translate.append(["selection", name, [val.encode('utf8')]])
5063faf7021f56ed361c817859711a6ecf36a05e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/5063faf7021f56ed361c817859711a6ecf36a05e/translate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 364, 652, 67, 529, 16, 652, 67, 536, 316, 1081, 6315, 5112, 18, 2165, 3319, 13332, 508, 273, 1081, 67, 529, 397, 5753, 397, 652, 67, 529, 460, 273, 1408, 309, 3303, 30, 4422, 18, 8837, 293...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 364, 652, 67, 529, 16, 652, 67, 536, 316, 1081, 6315, 5112, 18, 2165, 3319, 13332, 508, 273, 1081, 67, 529, 397, 5753, 397, 652, 67, 529, 460, 273, 1408, 309, 3303, 30, 4422, 18, 8837, 293...
fk_refcols.append(desc.tablename + '.' + pk_col.key)
target_path = "%s.%s" % (desc.tablename, pk_col.key) schema = desc.table_options.get('schema', None) if e1_schema is not None: target_path = "%s.%s" % (e1_schema, target_path) fk_refcols.append(target_path)
def create_tables(self): # Warning: if the table was specified manually, the join clauses won't # be computed. We might want to autodetect joins based on fk, as for # autoloaded entities if self.secondary_table: return if self.inverse: if self.inverse.secondary_table: self.secondary_table = self.inverse.secondary_table self.primaryjoin_clauses = self.inverse.secondaryjoin_clauses self.secondaryjoin_clauses = self.inverse.primaryjoin_clauses return
7fc6ed76574ff22da6afddc52aa614bd9ba2ff9f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11921/7fc6ed76574ff22da6afddc52aa614bd9ba2ff9f/relationships.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 9373, 12, 2890, 4672, 468, 9728, 30, 309, 326, 1014, 1703, 1269, 10036, 16, 326, 1233, 14093, 8462, 1404, 468, 506, 8470, 18, 1660, 4825, 2545, 358, 2059, 369, 278, 386, 13471, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9373, 12, 2890, 4672, 468, 9728, 30, 309, 326, 1014, 1703, 1269, 10036, 16, 326, 1233, 14093, 8462, 1404, 468, 506, 8470, 18, 1660, 4825, 2545, 358, 2059, 369, 278, 386, 13471, ...
exception name; and C{descr} is a L{ParsedDocstring} describing the circumstances under which the exception specified by C{exc} is raised.
exception name; and C{descr} is a L{ParsedDocstring <epydoc.markup.ParsedDocstring>} describing the circumstances under which the exception specified by C{exc} is raised.
def select_variables(self, group=None, value_type=None, inherited=None, public=None, imported=None): """ Return a specified subset of this class's L{sorted_variables} list. If C{value_type} is given, then only return variables whose values have the specified type. If C{group} is given, then only return variables that belong to the specified group. If C{inherited} is True, then only return inherited variables; if C{inherited} is False, then only return local variables.
33121bce6f65cd75f953a9ffe4dbeae5bc5d3f3e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/33121bce6f65cd75f953a9ffe4dbeae5bc5d3f3e/apidoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 67, 7528, 12, 2890, 16, 1041, 33, 7036, 16, 460, 67, 723, 33, 7036, 16, 12078, 33, 7036, 16, 1071, 33, 7036, 16, 9101, 33, 7036, 4672, 3536, 2000, 279, 1269, 7931, 434, 333, 66...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2027, 67, 7528, 12, 2890, 16, 1041, 33, 7036, 16, 460, 67, 723, 33, 7036, 16, 12078, 33, 7036, 16, 1071, 33, 7036, 16, 9101, 33, 7036, 4672, 3536, 2000, 279, 1269, 7931, 434, 333, 66...
a = a[:a.index('
a = a[:a.index('
def do_base(self, attrs): self.base = dict(attrs).get('href', self.base)
d0f945ba321163205fcd740cf408717ece69844e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9519/d0f945ba321163205fcd740cf408717ece69844e/functional.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1969, 12, 2890, 16, 3422, 4672, 365, 18, 1969, 273, 2065, 12, 7039, 2934, 588, 2668, 7547, 2187, 365, 18, 1969, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 1969, 12, 2890, 16, 3422, 4672, 365, 18, 1969, 273, 2065, 12, 7039, 2934, 588, 2668, 7547, 2187, 365, 18, 1969, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
&gt; <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln , _("Manage Format Templates")))
&gt; <a class"=navtrail" href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln , _("Manage Format Templates")))
def format_template_show(req, bft, code=None, ln=config.cdslang, ln_for_preview=config.cdslang, pattern_for_preview="", content_type_for_preview="text/html", chosen_option=""): """ Main page for template edition. Check for authentication and print formats editor. @param ln language @param code the code being edited @param bft the name of the template to show @param ln_for_preview the language for the preview (for bfo) @param pattern_for_preview the search pattern to be used for the preview (for bfo) @param content_type_for_preview the (MIME) content type of the preview @param chosen_option returned value for dialog_box warning """ ln = wash_language(ln) _ = gettext_set_language(ln) navtrail_previous_links = bibformatadminlib.getnavtrail(''' &gt; <a class=navtrail href="%s/admin/bibformat/bibformatadmin.py/format_templates_manage?ln=%s">%s</a>''' % (config.weburl, ln , _("Manage Format Templates"))) try: uid = getUid(req) except MySQLdb.Error, e: return error_page(req) (auth_code, auth_msg) = check_user(req, 'cfgbibformat') if not auth_code: format_template = wash_url_argument(bft, 'str') ln_preview = wash_language(ln_for_preview) pattern_preview = wash_url_argument(pattern_for_preview, 'str') if not bibformatadminlib.can_read_format_template(bft): #No read permission return page(title=_("Restricted Format Template"), body = """You don't have permission to view this format template.""", language=ln, navtrail = navtrail_previous_links, errors = [("ERR_BIBFORMAT_CANNOT_READ_TEMPLATE_FILE", format_template , "")], lastupdated=__lastupdated__, req=req) format_name = bibformat_engine.get_format_template_attrs(bft)['name'] if not bibformatadminlib.can_write_format_template(bft) and \ chosen_option == "": #No write permission return dialog_box(req=req, ln=ln, title="File Permission on %s" % format_name, message="You don't have write permission " \ "on <i>%s</i>.<br/> You can view the template" \ ", but not edit it." % format_name, navtrail=navtrail_previous_links, options=[ _("Ok")]) if bft.endswith('.xsl'): format_name += ' (XSL)' return page(title=_("Format Template %s"%format_name), body=bibformatadminlib.perform_request_format_template_show(format_template, code=code, ln=ln, ln_for_preview=ln_preview, pattern_for_preview=pattern_preview, content_type_for_preview=content_type_for_preview), uid=uid, language=ln, navtrail = navtrail_previous_links, lastupdated=__lastupdated__, req=req) else: return page_not_authorized(req=req, text=auth_msg, navtrail=navtrail_previous_links)
f08fe81d00d74f462e6a931c4d621a61c821b5b1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/f08fe81d00d74f462e6a931c4d621a61c821b5b1/bibformatadmin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 3202, 67, 4500, 12, 3658, 16, 324, 1222, 16, 981, 33, 7036, 16, 7211, 33, 1425, 18, 4315, 2069, 539, 16, 7211, 67, 1884, 67, 12102, 33, 1425, 18, 4315, 2069, 539, 16, 1936, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 3202, 67, 4500, 12, 3658, 16, 324, 1222, 16, 981, 33, 7036, 16, 7211, 33, 1425, 18, 4315, 2069, 539, 16, 7211, 67, 1884, 67, 12102, 33, 1425, 18, 4315, 2069, 539, 16, 1936, ...
extraJoin = "ffFlavor.flavorId = tmpQ.flavorId AND"
extraJoin = "ffFlavor.flavorId = gtlTmp.localFlavorId AND"
def _getTroveList(self, authToken, clientVersion, troveSpecs, versionType = _GTL_VERSION_TYPE_NONE, latestFilter = _GET_TROVE_ALL_VERSIONS, flavorFilter = _GET_TROVE_ALL_FLAVORS, withFlavors = False): self.log(3, versionType, latestFilter, flavorFilter) cu = self.db.cursor() singleVersionSpec = None dropTroveTable = False
d2e38a5c1a3fea2af98beb91e54b3a47f74dd2ad /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/d2e38a5c1a3fea2af98beb91e54b3a47f74dd2ad/netserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 56, 303, 537, 682, 12, 2890, 16, 24050, 16, 1004, 1444, 16, 23432, 537, 15999, 16, 1177, 559, 273, 389, 43, 5967, 67, 5757, 67, 2399, 67, 9826, 16, 4891, 1586, 273, 389, 32...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 56, 303, 537, 682, 12, 2890, 16, 24050, 16, 1004, 1444, 16, 23432, 537, 15999, 16, 1177, 559, 273, 389, 43, 5967, 67, 5757, 67, 2399, 67, 9826, 16, 4891, 1586, 273, 389, 32...
s1 = InternedString( "hello" ) s2 = InternedString( "hello" )
s1 = InternedString( "nothingElseIsUsingThisStringYet" ) s2 = InternedString( "nothingElseIsUsingThisStringYet" )
def test( self ) : self.assertEqual( InternedString.size(), 0 ) s1 = InternedString( "hello" ) s2 = InternedString( "hello" ) self.assertEqual( s1, s2 ) self.assertEqual( str( s1 ), "hello" ) self.assertEqual( str( s1 ), str( s2 ) ) self.assertEqual( InternedString.size(), 1 ) s3 = InternedString( "cat" ) self.assertNotEqual( s1, s3 ) self.assertEqual( str( s3 ), "cat" ) self.assertEqual( str( s1 ), "hello" ) self.assertEqual( str( s2 ), "hello" ) self.assertEqual( InternedString.size(), 2 ) s4 = InternedString( s1 ) self.assertEqual( s1, s4 ) self.assertEqual( s2, s4 ) self.assertNotEqual( s3, s4 )
74ae2fb28aa5be38a5f9ecd08417bd4719840928 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9042/74ae2fb28aa5be38a5f9ecd08417bd4719840928/Interned.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 12, 365, 262, 294, 225, 365, 18, 11231, 5812, 12, 31048, 329, 780, 18, 1467, 9334, 374, 262, 225, 272, 21, 273, 31048, 329, 780, 12, 315, 30874, 12427, 2520, 7736, 2503, 780, 61,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 12, 365, 262, 294, 225, 365, 18, 11231, 5812, 12, 31048, 329, 780, 18, 1467, 9334, 374, 262, 225, 272, 21, 273, 31048, 329, 780, 12, 315, 30874, 12427, 2520, 7736, 2503, 780, 61,...
self.unexpected_difference.added_files \ = self.remove_variant_features(self.unexpected_difference.added_files) self.unexpected_difference.removed_files \ = self.remove_variant_features(self.unexpected_difference.removed_files) self.unexpected_difference.modified_files \ = self.remove_variant_features(self.unexpected_difference.modified_files) self.unexpected_difference.touched_files \ = self.remove_variant_features(self.unexpected_difference.touched_files)
def run_build_system( self, extra_args='', subdir='', stdout = None, stderr = '', status = 0, match = None, pass_toolset = None, **kw):
109fba60a09838d9c10f23b1b0f5999619965b4a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9981/109fba60a09838d9c10f23b1b0f5999619965b4a/BoostBuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3510, 67, 4299, 12, 365, 16, 2870, 67, 1968, 2218, 2187, 16921, 2218, 2187, 3909, 273, 599, 16, 4514, 273, 10226, 1267, 273, 374, 16, 845, 273, 599, 16, 1342, 67, 6738, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 3510, 67, 4299, 12, 365, 16, 2870, 67, 1968, 2218, 2187, 16921, 2218, 2187, 3909, 273, 599, 16, 4514, 273, 10226, 1267, 273, 374, 16, 845, 273, 599, 16, 1342, 67, 6738, 542, ...
diskname = self.transientDisk(a.id, i)
diskname = self.transientDisk(a.id, i, disktype)
def cron(self):
787afd97a19dbc056f066117a0e80a968ac780eb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5161/787afd97a19dbc056f066117a0e80a968ac780eb/xenpv.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9998, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9998, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
def warning_msg(msg): """ """ print '** Warning ** : %s' % msg def strip(str, least=False): """ Strip a string Remove all ' ', '\n', '\r' and '\t' at the begin and the end of the string """ m = re.search('^((\r|\n|\t)+|( )+)*', str) if m is not None and m.group(0) != '': str = ' ' + str[len(m.group(0)):] m = re.search('((\r|\n)+|( )+)*\Z', str) if m is not None and m.group(0) != '': str = str[:-len(m.group(0))] + ' ' return str
def stream_next(stream): """ return the next value of the stream (event, value, line_number) or (None, None, None) if StopIteration exception is raised """ try: event, value, line_number = stream.next() return (event, value, line_number) except StopIteration: return (None, None, None) def normalize(data, least=False): """ Normalize data """ if least == True: data = u'X%sX' % data data = u' '.join(data.split()) if least == True: return data[1:-1] return data
def warning_msg(msg): """ """ print '** Warning ** : %s' % msg
51b02e012792ad1fcdef1300580c1d6a58548c1f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/51b02e012792ad1fcdef1300580c1d6a58548c1f/rml.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3436, 67, 3576, 12, 3576, 4672, 3536, 3536, 1172, 23392, 9728, 2826, 294, 738, 87, 11, 738, 1234, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3436, 67, 3576, 12, 3576, 4672, 3536, 3536, 1172, 23392, 9728, 2826, 294, 738, 87, 11, 738, 1234, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
a = ag.special
a = dummyUi.special
def taoChanged(ui, action, current): global obj, cb, aa obj = ui cb = 'taoChanged' aa = action ac = current
cab51a71fb93a9cecf5da8538bf4b838683e089c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5222/cab51a71fb93a9cecf5da8538bf4b838683e089c/uimanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17433, 5033, 12, 4881, 16, 1301, 16, 783, 4672, 2552, 1081, 16, 2875, 16, 12391, 1081, 273, 5915, 2875, 273, 296, 2351, 83, 5033, 11, 12391, 273, 1301, 1721, 273, 783, 2, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 17433, 5033, 12, 4881, 16, 1301, 16, 783, 4672, 2552, 1081, 16, 2875, 16, 12391, 1081, 273, 5915, 2875, 273, 296, 2351, 83, 5033, 11, 12391, 273, 1301, 1721, 273, 783, 2, -100, -100, -...
comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VSComponents.dat'
comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VCComponents.dat'
def _parse_msvc7_overrides(version): """ Parse any overridden defaults for MSVS directory locations in MSVS .NET. """ # First, we get the shell folder for this user: if not SCons.Util.can_read_reg: raise SCons.Errors.InternalError, "No Windows registry module was found" comps = "" try: (comps, t) = SCons.Util.RegGetValue(SCons.Util.HKEY_CURRENT_USER, r'Software\Microsoft\Windows\CurrentVersion' +\ r'\Explorer\Shell Folders\Local AppData') except SCons.Util.RegError: raise SCons.Errors.InternalError, "The Local AppData directory was not found in the registry." comps = comps + '\\Microsoft\\VisualStudio\\' + version + '\\VSComponents.dat' dirs = {} if os.path.exists(comps): # now we parse the directories from this file, if it exists. # We only look for entries after: [VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories], # since this file could contain a number of things... f = open(comps,'r') line = f.readline() found = 0 while line: line.strip() if found == 1: (key, val) = line.split('=',1) key = key.replace(' Dirs','') dirs[key.upper()] = val if line.find(r'[VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories]') >= 0: found = 1 if line == '': found = 0 line = f.readline() f.close() else: # since the file didn't exist, we have only the defaults in # the registry to work with. try: K = 'SOFTWARE\\Microsoft\\VisualStudio\\' + version K = K + r'\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories' k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,K) i = 0 while 1: try: (key,val,t) = SCons.Util.RegEnumValue(k,i) key = key.replace(' Dirs','') dirs[key.upper()] = val i = i + 1 except SCons.Util.RegError: break except SCons.Util.RegError: # if we got here, then we didn't find the registry entries: raise SCons.Errors.InternalError, "Unable to find MSVC paths in the registry." return dirs
a154eb893e9f2b8e632d7cd92d1480b94e0d2fe8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12817/a154eb893e9f2b8e632d7cd92d1480b94e0d2fe8/msvc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 959, 4227, 27, 67, 19775, 12, 1589, 4672, 3536, 2884, 1281, 11000, 3467, 364, 9238, 14640, 1867, 7838, 316, 9238, 14640, 263, 14843, 18, 3536, 225, 468, 5783, 16, 732, 336...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 959, 4227, 27, 67, 19775, 12, 1589, 4672, 3536, 2884, 1281, 11000, 3467, 364, 9238, 14640, 1867, 7838, 316, 9238, 14640, 263, 14843, 18, 3536, 225, 468, 5783, 16, 732, 336...
if self.subwidget_list.has_key(name): self.tk.call(self._w, 'invoke', name)
if self.subwidget_list.has_key(name): self.tk.call(self._w, 'invoke', name)
def invoke(self, name):
0049f0036898e656085d5c214ba07642a9c25a6e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0049f0036898e656085d5c214ba07642a9c25a6e/Tix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 16, 508, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 16, 508, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis)
val = hlr_utils.get_value(obj, i, o_descr, "x", axis) err2 = hlr_utils.get_err2(obj, i, o_descr, "x", axis)
def wavelength_to_scalar_Q(obj,**kwargs): """ This function converts a primary axis of a SOM or SO from wavelength to scalar_Q. The wavelength axis for a SOM must be in units of Angstroms. The primary axis of a SO is assumed to be in units of Angstroms. A tuple of [wavelength, wavelength_err2] (assumed to be in units of Angstroms) can be converted to [scalar_Q, scalar_Q_err2]. Parameters: ---------- -> obj is the SOM, SO or tuple to be converted -> kwargs is a list of key word arguments that the function accepts: polar= a tuple or list of tuples containing the polar angle and its associated error^2 units= a string containing the expected units for this function. The default for this function is Angstroms half_angle=<boolean> This keyword, if set to True, will take the given polar angle and divide it by 2. The default behavior is division by 1. Return: ------ <- A SOM or SO with a primary axis in wavelength or a tuple converted to scalar_Q Exceptions: ---------- <- TypeError is raised if the incoming object is not a type the function recognizes <- RuntimeError is raised if a SOM is not passed and no polar angle is provided <- RuntimeError is raised if the SOM x-axis units are not Angstroms """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj) (o_descr,d_descr)=hlr_utils.get_descr(obj) if o_descr == "list": raise TypeError, "Do not know how to handle given type: %s" %\ o_descr else: pass # Setup keyword arguments try: polar = kwargs["polar"] except KeyError: polar = None try: units = kwargs["units"] except KeyError: units = "Angstroms" try: value = kwargs["half_angle"] if value: divisor = 2.0 else: divisor = 1.0 except KeyError: divisor = 1.0 # Primary axis for transformation. If a SO is passed, the function, will # assume the axis for transformation is at the 0 position if o_descr == "SOM": axis = hlr_utils.hlr_1D_units(obj, units) else: axis = 0 result=hlr_utils.copy_som_attr(result,res_descr,obj,o_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "1/Angstroms", axis) result.setAxisLabel(axis, "scalar wavevector transfer") result.setYUnits("Counts/A-1") result.setYLabel("Intensity") else: pass if polar == None: if o_descr == "SOM": try: obj.attr_list.instrument.get_primary() inst = obj.attr_list.instrument except RuntimeError: raise RuntimeError, "A detector was not provided!" else: raise RuntimeError, "If no SOM is provided, then polar "\ +"information must be given." else: (p_descr,e_descr) = hlr_utils.get_descr(polar) # iterate through the values import axis_manip for i in range(hlr_utils.get_length(obj)): val = hlr_utils.get_value(obj,i,o_descr,"x",axis) err2 = hlr_utils.get_err2(obj,i,o_descr,"x",axis) map_so = hlr_utils.get_map_so(obj,None,i) if polar == None: (angle,angle_err2) = hlr_utils.get_parameter("polar",map_so,inst) else: angle = hlr_utils.get_value(polar,i,p_descr) angle_err2 = hlr_utils.get_err2(polar,i,p_descr) value=axis_manip.wavelength_to_scalar_Q(val, err2, angle/divisor, angle_err2/divisor) if o_descr != "number": value1 = axis_manip.reverse_array_cp(value[0]) value2 = axis_manip.reverse_array_cp(value[1]) rev_value = (value1,value2) else: rev_value = value if map_so != None: map_so.y=axis_manip.reverse_array_cp(map_so.y) map_so.var_y=axis_manip.reverse_array_cp(map_so.var_y) else: pass hlr_utils.result_insert(result,res_descr,rev_value,map_so,"x",axis) return result
7d83b6f5d5d15076b08b26f742c3cd9eb8f954cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/7d83b6f5d5d15076b08b26f742c3cd9eb8f954cf/hlr_wavelength_to_scalar_Q.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 8748, 67, 53, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 4981, 67, 53, 18, 1021, 21410,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21410, 67, 869, 67, 8748, 67, 53, 12, 2603, 16, 636, 4333, 4672, 3536, 1220, 445, 7759, 279, 3354, 2654, 434, 279, 348, 1872, 578, 7460, 628, 21410, 358, 4981, 67, 53, 18, 1021, 21410,...
if (method == 'POST' and is_xml and env.get('SOAPAction', None)
if (method == 'POST' and is_xml and env.get('HTTP_SOAPACTION', None)
def __call__(self, input_stream, output_steam, env): """See `zope.app.publication.interfaces.IPublicationRequestFactory`""" method = env.get('REQUEST_METHOD', 'GET').upper()
bcd548aaa478235cc962230a64a16059857f79e3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9689/bcd548aaa478235cc962230a64a16059857f79e3/httpfactory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 810, 67, 3256, 16, 876, 67, 334, 3820, 16, 1550, 4672, 3536, 9704, 1375, 94, 1306, 18, 2910, 18, 28631, 18, 15898, 18, 2579, 447, 367, 691, 1733, 68, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 810, 67, 3256, 16, 876, 67, 334, 3820, 16, 1550, 4672, 3536, 9704, 1375, 94, 1306, 18, 2910, 18, 28631, 18, 15898, 18, 2579, 447, 367, 691, 1733, 68, 8...
d = npy.subtract.reduce(positions[self.indices]) d2 = npy.dot(d, d) d *= 0.5 * npy.dot(npy.subtract.reduce(forces[self.indices]), d) / d2
d = np.subtract.reduce(positions[self.indices]) d2 = np.dot(d, d) d *= 0.5 * np.dot(np.subtract.reduce(forces[self.indices]), d) / d2
def adjust_forces(self, positions, forces): d = npy.subtract.reduce(positions[self.indices]) d2 = npy.dot(d, d) d *= 0.5 * npy.dot(npy.subtract.reduce(forces[self.indices]), d) / d2 forces[self.indices] += (-d, d)
56bb90af6cdb34a67cf793d22cfe7c3089a8af39 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1380/56bb90af6cdb34a67cf793d22cfe7c3089a8af39/constraints.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5765, 67, 1884, 764, 12, 2890, 16, 6865, 16, 26376, 4672, 302, 273, 1130, 18, 1717, 1575, 18, 12498, 12, 12388, 63, 2890, 18, 6836, 5717, 302, 22, 273, 1130, 18, 9811, 12, 72, 16, 30...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5765, 67, 1884, 764, 12, 2890, 16, 6865, 16, 26376, 4672, 302, 273, 1130, 18, 1717, 1575, 18, 12498, 12, 12388, 63, 2890, 18, 6836, 5717, 302, 22, 273, 1130, 18, 9811, 12, 72, 16, 30...
tracker = app.sharing_tracker.get_tracker(info)
tracker = app.sharing_tracker.get_tracker(info.id)
def on_row_clicked(self, view, iter): info = view.model[iter][0] info.mount = True self.view.model_changed() current_display = app.display_manager.get_current_display() # The displays don't disappear automatically so handle the case # where the user disconnects and then immediately reconnects to # the same share. Won't have this problem if the display just # disappears automatically but it doesn't. try: if current_display.id == info.id: tracker = app.sharing_tracker.get_tracker(info) except AttributeError: pass
82d136f6c738e14fdb6aaf2a25eeec759ed64dc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12354/82d136f6c738e14fdb6aaf2a25eeec759ed64dc4/tablist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 492, 67, 7475, 329, 12, 2890, 16, 1476, 16, 1400, 4672, 1123, 273, 1476, 18, 2284, 63, 2165, 6362, 20, 65, 1123, 18, 4778, 273, 1053, 365, 18, 1945, 18, 2284, 67, 6703, 1435...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 492, 67, 7475, 329, 12, 2890, 16, 1476, 16, 1400, 4672, 1123, 273, 1476, 18, 2284, 63, 2165, 6362, 20, 65, 1123, 18, 4778, 273, 1053, 365, 18, 1945, 18, 2284, 67, 6703, 1435...
try: obj = getattr(obj, component)
try: obj = getattr(obj, components[-1])
def _find_object_in_module(name, module, docmap): """ Search for an object or variable named C{name} in the given module, given the DocMap C{docmap}. """ # Is it an object in the containing module? try: components = name.split('.') # Use getattr to follow all components but the last one. obj = module for component in components[:-1]: obj_parent = obj obj_name = component try: obj = getattr(obj, component) except: try: obj = obj.__getattribute__(obj, component) except: return None obj_uid = make_uid(obj) # Is it a variable in obj? var = _find_variable_in(components[-1], obj_uid, docmap) if var is not None: return var # Is it an object in obj? try: obj = getattr(obj, component) except: try: obj = obj.__getattribute__(obj, component) except: return None try: return make_uid(obj, obj_uid, components[-1]) except: return None except KeyError: return None
236a55230cc9e7acc0257074c24c16494a9d044c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/236a55230cc9e7acc0257074c24c16494a9d044c/uid.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 1612, 67, 267, 67, 2978, 12, 529, 16, 1605, 16, 997, 1458, 4672, 3536, 5167, 364, 392, 733, 578, 2190, 4141, 385, 95, 529, 97, 316, 326, 864, 1605, 16, 864, 326, 3521,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4720, 67, 1612, 67, 267, 67, 2978, 12, 529, 16, 1605, 16, 997, 1458, 4672, 3536, 5167, 364, 392, 733, 578, 2190, 4141, 385, 95, 529, 97, 316, 326, 864, 1605, 16, 864, 326, 3521,...
sage: E=EllipticCurve('14a1')
sage: E = EllipticCurve('14a1')
def has_nonsplit_multiplicative_reduction(self): r""" Return True if there is non-split multiplicative reduction.
d268d826e9ff15e8e9c26c0ba3dd27591f648207 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d268d826e9ff15e8e9c26c0ba3dd27591f648207/ell_local_data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 67, 5836, 4939, 67, 7027, 28884, 67, 1118, 4062, 12, 2890, 4672, 436, 8395, 2000, 1053, 309, 1915, 353, 1661, 17, 4939, 3309, 28884, 225, 20176, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 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, 711, 67, 5836, 4939, 67, 7027, 28884, 67, 1118, 4062, 12, 2890, 4672, 436, 8395, 2000, 1053, 309, 1915, 353, 1661, 17, 4939, 3309, 28884, 225, 20176, 18, 2, -100, -100, -100, -100, -100,...
def setuid():
def setuid(self):
def setuid(): if os.getuid() == 0 and self.options.uid: try: os.setuid(int(self.options.uid)) except: os.setuid(pwd.getpwnam(self.options.uid).pw_uid)
116fa27cd07b0a31f0380138921012942675e5f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11991/116fa27cd07b0a31f0380138921012942675e5f7/syncpkgcd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1911, 12, 2890, 4672, 309, 1140, 18, 588, 1911, 1435, 422, 374, 471, 365, 18, 2116, 18, 1911, 30, 775, 30, 1140, 18, 542, 1911, 12, 474, 12, 2890, 18, 2116, 18, 1911, 3719, 1335...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 1911, 12, 2890, 4672, 309, 1140, 18, 588, 1911, 1435, 422, 374, 471, 365, 18, 2116, 18, 1911, 30, 775, 30, 1140, 18, 542, 1911, 12, 474, 12, 2890, 18, 2116, 18, 1911, 3719, 1335...
... def f():
... def _f():
... def f():
d15cfea8aa793029f37d6148bdc30a0be8b9a87f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/d15cfea8aa793029f37d6148bdc30a0be8b9a87f/doctest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 1652, 284, 13332, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 1652, 284, 13332, 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, -100, ...
if rw_checkout: RunCommand(['repo', 'forall', '-c', 'git', 'config', 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', 'http://git.chromium.org/git'], cwd=buildroot)
def RepoSync(buildroot, rw_checkout=False, retries=_DEFAULT_RETRIES): """Uses repo to checkout the source code. Keyword arguments: rw_checkout -- Reconfigure repo after sync'ing to read-write. retries -- Number of retries to try before failing on the sync. """ while retries > 0: try: # The --trace option ensures that repo shows the output from git. This # is needed so that the buildbot can kill us if git is not making # progress. RunCommand(['repo', '--trace', 'sync'], cwd=buildroot) if rw_checkout: # Always re-run in case of new git repos or repo sync # failed in a previous run because of a forced Stop Build. RunCommand(['repo', 'forall', '-c', 'git', 'config', 'url.ssh://git@gitrw.chromium.org:9222.pushinsteadof', 'http://git.chromium.org/git'], cwd=buildroot) retries = 0 except: retries -= 1 if retries > 0: Warning('CBUILDBOT -- Repo Sync Failed, retrying') else: Warning('CBUILDBOT -- Retries exhausted') raise # Output manifest RunCommand(['repo', 'manifest', '-r', '-o', '-'], cwd=buildroot)
4847031faad12e0f7b2fd3f047c77cad7b0a4003 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/4847031faad12e0f7b2fd3f047c77cad7b0a4003/cbuildbot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15118, 4047, 12, 3510, 3085, 16, 7985, 67, 17300, 33, 8381, 16, 9453, 33, 67, 5280, 67, 862, 6566, 3991, 4672, 3536, 15128, 3538, 358, 13926, 326, 1084, 981, 18, 225, 18317, 1775, 30, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15118, 4047, 12, 3510, 3085, 16, 7985, 67, 17300, 33, 8381, 16, 9453, 33, 67, 5280, 67, 862, 6566, 3991, 4672, 3536, 15128, 3538, 358, 13926, 326, 1084, 981, 18, 225, 18317, 1775, 30, ...
print "changed."
print("changed.")
def check(file): if os.path.isdir(file) and not os.path.islink(file): if verbose: print "listing directory", file names = os.listdir(file) for name in names: fullname = os.path.join(file, name) if ((recurse and os.path.isdir(fullname) and not os.path.islink(fullname)) or name.lower().endswith(".py")): check(fullname) return if verbose: print "checking", file, "...", try: f = open(file) except IOError as msg: errprint("%s: I/O Error: %s" % (file, str(msg))) return r = Reindenter(f) f.close() if r.run(): if verbose: print "changed." if dryrun: print "But this is a dry run, so leaving it alone." if not dryrun: bak = file + ".bak" if os.path.exists(bak): os.remove(bak) os.rename(file, bak) if verbose: print "renamed", file, "to", bak f = open(file, "w") r.write(f) f.close() if verbose: print "wrote new", file else: if verbose: print "unchanged."
2f30fac56992ed396f664b446bcb83b1b3e1add5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/2f30fac56992ed396f664b446bcb83b1b3e1add5/reindent.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 768, 4672, 309, 1140, 18, 803, 18, 291, 1214, 12, 768, 13, 471, 486, 1140, 18, 803, 18, 291, 1232, 12, 768, 4672, 309, 3988, 30, 1172, 315, 21228, 1867, 3113, 585, 1257, 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, 866, 12, 768, 4672, 309, 1140, 18, 803, 18, 291, 1214, 12, 768, 13, 471, 486, 1140, 18, 803, 18, 291, 1232, 12, 768, 4672, 309, 3988, 30, 1172, 315, 21228, 1867, 3113, 585, 1257, 273...
if fbro.parent_id != vals['parent_id']:
if fbro.parent_id.id != vals['parent_id']:
def write(self, cr, uid, ids, vals, context=None): if not isinstance(ids, list): ids = [ids] res = self.search(cr, uid, [('id', 'in', ids)]) if not len(res): return False if not self._check_duplication(cr, uid, vals, ids, 'write'): raise osv.except_osv(_('ValidateError'), _('File name must be unique!')) if 'parent_id' in vals: # perhaps this file is changing directory nctx = nodes.get_node_context(cr,uid,context) dirobj = self.pool.get('document.directory') dbro = dirobj.browse(cr, uid, vals['parent_id'], context=context) ids2 = [] result = False for fbro in self.browse(cr, uid, ids, context=context): if fbro.parent_id != vals['parent_id']: fnode = nodes.node_file(None,None,nctx,fbro) res = fnode.move_to(cr, fbro, dbro, True) if isinstance(res, dict): vals2 = vals.copy() vals2.update(res) wid = res.get('id', fbro.id) result = super(document_file,self).write(cr,uid,wid,vals2,context=context) # TODO: how to handle/merge several results? elif res == True: ids2.append(fbro.id) elif res == False: pass ids = ids2 if len(ids): result = super(document_file,self).write(cr, uid, ids, vals, context=context) cr.commit() return result
530932640babacde4973fd47f2a9632c1d70bd3d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/530932640babacde4973fd47f2a9632c1d70bd3d/document.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 309, 486, 1549, 12, 2232, 16, 666, 4672, 3258, 273, 306, 2232, 65, 400, 273, 365, 18, 3072, 12, 3353,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5773, 16, 819, 33, 7036, 4672, 309, 486, 1549, 12, 2232, 16, 666, 4672, 3258, 273, 306, 2232, 65, 400, 273, 365, 18, 3072, 12, 3353,...
self._get_index_items(fraise.descr(), link, index)
self._get_term_index_items(fraise.descr(), link, index)
def _extract_index(self): """ @return: A dictionary mapping from terms to lists of source documents. @rtype: C{dictionary} """ index = {} for (uid, doc) in self._docmap.items(): if (not self._show_private) and self._is_private(`uid`): continue if uid.is_function(): link = Link(`uid`, uid.module()) elif uid.is_method(): link = Link(`uid`, uid.cls()) else: link = Link(`uid`, uid)
7e1af2abc702612461ceeb001b4b551d49cb71d3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/7e1af2abc702612461ceeb001b4b551d49cb71d3/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8004, 67, 1615, 12, 2890, 4672, 3536, 632, 2463, 30, 432, 3880, 2874, 628, 6548, 358, 6035, 434, 1084, 7429, 18, 632, 86, 723, 30, 385, 95, 15556, 97, 3536, 770, 273, 2618, 364, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8004, 67, 1615, 12, 2890, 4672, 3536, 632, 2463, 30, 432, 3880, 2874, 628, 6548, 358, 6035, 434, 1084, 7429, 18, 632, 86, 723, 30, 385, 95, 15556, 97, 3536, 770, 273, 2618, 364, ...
auth_attribs=()
auth_attribs=(),
def moin_session(request, **kw): """ Authenticate via cookie. We don't handle initial logins (except to set the appropriate cookie), just ongoing sessions, and logout. Use another method for initial login. """ import hmac import base64 username = kw.get('name') login = kw.get('login') logout = kw.get('logout') user_obj = kw.get('user_obj') cfg = request.cfg verbose = False cookie_name = 'MOIN_ID' if hasattr(cfg,'moin_session_verbose'): verbose = cfg.moin_session_verbose if hasattr(cfg, 'moin_session_cookie_name'): cookie_name = cfg.moin_session_cookie_name if verbose: request.log("auth.moin_session: name=%s login=%r logout=%r user_obj=%r" % (username, login, logout, user_obj)) if login: if verbose: request.log("moin_session performing login action") # Has any other method successfully authenticated? if user_obj != None and user_obj.valid: # Yes - set up session cookie if verbose: request.log("moin_session got valid user from previous auth method, setting cookie...") if verbose: request.log("moin_session got auth_username %s." % user_obj.auth_username) setSessionCookie(request, user_obj) return user_obj, True # we make continuing possible, e.g. for smbmount else: # No other method succeeded, so allow continuation... # XXX Cookie clear here??? if verbose: request.log("moin_session did not get valid user from previous auth method, doing nothing") return user_obj, True try: if verbose: request.log("trying to get cookie...") cookie = Cookie.SimpleCookie(request.saved_cookie) except Cookie.CookieError: # ignore invalid cookies, else user can't relogin if verbose: request.log("caught Cookie.CookieError") cookie = None if not (cookie != None and cookie.has_key(cookie_name)): # No valid cookie if verbose: request.log("either no cookie or no %s key" % cookie_name) return user_obj, True try: cookie_hmac, cookie_body = cookie[cookie_name].value.split(':',1) except ValueError: # Invalid cookie if verbose: request.log("invalid cookie format: (%s)" % cookie[cookie_name].value) return user_obj, True if cookie_hmac != hmac.new(cfg.moin_session_secret, cookie_body).hexdigest(): # Invalid cookie # XXX Cookie clear here??? if verbose: request.log("cookie recovered had invalid hmac") return user_obj, True # We can trust cookie if verbose: request.log("Cookie OK, authenticated.") params = { 'username': '', 'id': '' } cookie_pairs = cookie_body.split(":") for key, value in [pair.split("=",1) for pair in cookie_pairs]: params[key] = value # XXX Should check expiry from cookie # XXX Should name be in auth_attribs? u = user.User(request, id=base64.decodestring(params['id']), auth_username=base64.decodestring(params['username']), auth_method='moin_session', auth_attribs=() ) if logout: if verbose: request.log("Logout requested, setting u invalid and 'deleting' cookie") u.valid = 0 # just make user invalid, but remember him deleteCookie(request, cookie_name) return u, True # we return a invalidated user object, so that # following auth methods can get the name of # the user who logged out setSessionCookie(request, u) # refreshes cookie lifetime return u, True # use True to get other methods called, too
ef1096937fe84fb3d22b2765bd2a87780d73b2fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/ef1096937fe84fb3d22b2765bd2a87780d73b2fa/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 885, 67, 3184, 12, 2293, 16, 2826, 9987, 4672, 3536, 26644, 3970, 3878, 18, 1660, 2727, 1404, 1640, 2172, 613, 2679, 261, 14137, 358, 444, 326, 5505, 3878, 3631, 2537, 30542, 8856, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 885, 67, 3184, 12, 2293, 16, 2826, 9987, 4672, 3536, 26644, 3970, 3878, 18, 1660, 2727, 1404, 1640, 2172, 613, 2679, 261, 14137, 358, 444, 326, 5505, 3878, 3631, 2537, 30542, 8856, ...
except IOError:
except (IOError, EOFError):
def load(self): """ Loads the tags from the data file. """ try: datafile = file(self.filename, "rb") self.tags = pickle.load(datafile) except IOError: self.tags = [] else: datafile.close()
681485666330aff8c2674ebff8164fe881d7071a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/681485666330aff8c2674ebff8164fe881d7071a/wikisync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1262, 12, 2890, 4672, 3536, 4444, 87, 326, 2342, 628, 326, 501, 585, 18, 3536, 775, 30, 30682, 273, 585, 12, 2890, 18, 3459, 16, 315, 6731, 7923, 365, 18, 4156, 273, 13379, 18, 945, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 3536, 4444, 87, 326, 2342, 628, 326, 501, 585, 18, 3536, 775, 30, 30682, 273, 585, 12, 2890, 18, 3459, 16, 315, 6731, 7923, 365, 18, 4156, 273, 13379, 18, 945, ...
newvf = sqmail.vfolder.VFolder(name=vf.name, query=vf.query, \
newvf = sqmail.vfolder.VFolder(name="***new***", query=vf.query, \
def copy_vfolder(self): node = self.widget.folderlist.selection[0] vf = self.vfolder() newvf = sqmail.vfolder.VFolder(name=vf.name, query=vf.query, \ parent=vf.parent) newvf.setname("Copy of "+newvf.getname()) newvf.save()
ecfc28d45eea3a44f1ff7b5e48bba257291c04f0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3083/ecfc28d45eea3a44f1ff7b5e48bba257291c04f0/reader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 67, 90, 5609, 12, 2890, 4672, 756, 273, 365, 18, 6587, 18, 5609, 1098, 18, 10705, 63, 20, 65, 28902, 273, 365, 18, 90, 5609, 1435, 394, 90, 74, 273, 4744, 4408, 18, 90, 5609, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1610, 67, 90, 5609, 12, 2890, 4672, 756, 273, 365, 18, 6587, 18, 5609, 1098, 18, 10705, 63, 20, 65, 28902, 273, 365, 18, 90, 5609, 1435, 394, 90, 74, 273, 4744, 4408, 18, 90, 5609, ...
x, y = self._textAndRects[1][offset][:2]
text,rects=self._textAndRects if not text or not rects or offset>=len(rects): raise LookupError x,y=rects[offset][:2]
def _getPointFromOffset(self, offset): x, y = self._textAndRects[1][offset][:2] return textInfos.Point(x, y)
a236ae851fbb85c472b3679d868b1184c6a436cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/a236ae851fbb85c472b3679d868b1184c6a436cc/displayModel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 2148, 1265, 2335, 12, 2890, 16, 1384, 4672, 977, 16, 2607, 87, 33, 2890, 6315, 955, 1876, 6120, 87, 309, 486, 977, 578, 486, 4917, 87, 578, 1384, 34, 33, 1897, 12, 2607, 87...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 2148, 1265, 2335, 12, 2890, 16, 1384, 4672, 977, 16, 2607, 87, 33, 2890, 6315, 955, 1876, 6120, 87, 309, 486, 977, 578, 486, 4917, 87, 578, 1384, 34, 33, 1897, 12, 2607, 87...