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
attribute dictionary is prefix keyed by xml xmlns xsd wsdl soap all other keys are namespace values. """ self.attributes = {XMLSchemaComponent.xsd:{},\ XMLSchemaComponent.xmlns:{}}
structure of attributes dictionary ['xmlns'][xmlns_key] -- xmlns namespace ['xmlns'][prefix] -- declared namespace prefix [namespace][prefix] -- attributes declared in a namespace [attribute] -- attributes w/o prefix, default namespaces do not directly apply to attributes, ie Name can't collide with QName. """ self.attributes = {XMLSchemaComponent.xmlns:{}}
def setAttributes(self, node): """Sets up attribute dictionary, checks for required attributes and sets default attribute values. attr is for default attribute values determined at runtime.
36f34bdb62c4299586877f31abafd4a91e255843 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/36f34bdb62c4299586877f31abafd4a91e255843/XMLSchema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 21175, 12, 2890, 16, 756, 4672, 3536, 2785, 731, 1566, 3880, 16, 4271, 364, 1931, 1677, 471, 1678, 805, 1566, 924, 18, 1604, 353, 364, 805, 1566, 924, 11383, 622, 3099, 18, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 21175, 12, 2890, 16, 756, 4672, 3536, 2785, 731, 1566, 3880, 16, 4271, 364, 1931, 1677, 471, 1678, 805, 1566, 924, 18, 1604, 353, 364, 805, 1566, 924, 11383, 622, 3099, 18, 2, -100, -1...
for n in undo.childNodes: if n.nodeType == xml.Node.ELEMENT_NODE:
for node in undo.childNodes: if node.nodeType == xml.Node.ELEMENT_NODE:
def LoadFromFile(uri): """ Loads a project from a save file on disk. uri The filesystem location of the project file to load. Currently only file:// URIs are considered valid. """ p = Project() (scheme, domain, projectfile, params, query, fragment) = urlparse.urlparse(uri, "file") if scheme != "file": # raise "The URI scheme used is invalid." message raise OpenProjectError(1,scheme) Globals.debug(projectfile) if not os.path.exists(projectfile): raise OpenProjectError(4,projectfile) try: gzipfile = gzip.GzipFile(projectfile, "r") doc = xml.parse(gzipfile) except Exception, e: Globals.debug(e.__class__, e) # raise "This file doesn't unzip" message raise OpenProjectError(2,projectfile) p.projectfile = projectfile #only open projects with the proper version number version = doc.firstChild.getAttribute("version") if version != Globals.VERSION: if version == "0.1": LoadFromZPOFile(p, doc) #copy the project so that the 0.1 is not overwritten when the user clicks save withoutExt = os.path.splitext(projectfile)[0] shutil.copy(projectfile, "%s.0.1.jokosher" % withoutExt) return p else: if not version: version = "0.1" # 0.1 projects had version as element, not attr # raise a "this project was created in a different version of Jokosher" message raise OpenProjectError(3,version) params = doc.getElementsByTagName("Parameters")[0] LoadParametersFromXML(p, params) # Hack to set the transport mode p.transport.SetMode(p.transportMode) p.transport.SetBPM(p.transportbpm) try: undo = doc.getElementsByTagName("Undo")[0] except IndexError: Globals.debug("No saved undo in project file") else: for n in undo.childNodes: if n.nodeType == xml.Node.ELEMENT_NODE: cmdList = [] cmdList.append(str(n.getAttribute("object"))) cmdList.append(str(n.getAttribute("function"))) cmdList.extend(LoadListFromXML(n)) p._Project__savedUndoStack.append(cmdList) try: redo = doc.getElementsByTagName("Redo")[0] except IndexError: Globals.debug("No saved redo in project file") else: for n in redo.childNodes: if n.nodeType == xml.Node.ELEMENT_NODE: cmdList = [] cmdList.append(str(n.getAttribute("object"))) cmdList.append(str(n.getAttribute("function"))) cmdList.extend(LoadListFromXML(n)) p._Project__redoStack.append(cmdList) for instr in doc.getElementsByTagName("Instrument"): try: id = int(instr.getAttribute("id")) except ValueError: id = None i = Instrument(p, None, None, None, id) i.LoadFromXML(instr) p.instruments.append(i) if i.isSolo: p.soloInstrCount += 1 for instr in doc.getElementsByTagName("DeadInstrument"): try: id = int(instr.getAttribute("id")) except ValueError: id = None i = Instrument(p, None, None, None, id) i.LoadFromXML(instr) p.graveyard.append(i) i.RemoveAndUnlinkPlaybackbin() return p
e2b4f4a534dc5054c26a7ac44730cd6e0c158de4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10033/e2b4f4a534dc5054c26a7ac44730cd6e0c158de4/Project.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 13087, 12, 1650, 4672, 3536, 4444, 87, 279, 1984, 628, 279, 1923, 585, 603, 4234, 18, 225, 2003, 1021, 6496, 2117, 434, 326, 1984, 585, 358, 1262, 18, 15212, 1338, 585, 2207, 24565...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4444, 13087, 12, 1650, 4672, 3536, 4444, 87, 279, 1984, 628, 279, 1923, 585, 603, 4234, 18, 225, 2003, 1021, 6496, 2117, 434, 326, 1984, 585, 358, 1262, 18, 15212, 1338, 585, 2207, 24565...
import sagedoc
def search_doc(s, extra=''): """ Full text search of the SAGE HTML documentation for lines containing s. The search is not case sensitive. """ cmd = 'sage -grepdoc "%s" | grep "%s"'%(s,extra) old_banner = os.environ.has_key('SAGE_BANNER') if old_banner: old_banner = os.environ['SAGE_BANNER'] os.environ['SAGE_BANNER'] = "no" r = os.popen(cmd).read() if old_banner == False: del os.environ['SAGE_BANNER'] else: os.environ['SAGE_BANNER'] = old_banner from sage.server.support import EMBEDDED_MODE if EMBEDDED_MODE: # I.e., running from the notebook print format_search_as_html('Documentation', r, s + extra) else: from sage.misc.all import pager pager()(r)
dcebe748f1ef8b1b2487c34467d71b3d3e2fcf7d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/dcebe748f1ef8b1b2487c34467d71b3d3e2fcf7d/sagedoc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 67, 2434, 12, 87, 16, 2870, 2218, 11, 4672, 3536, 11692, 977, 1623, 434, 326, 348, 2833, 3982, 7323, 364, 2362, 4191, 272, 18, 225, 1021, 1623, 353, 486, 648, 16692, 18, 3536, 17...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 67, 2434, 12, 87, 16, 2870, 2218, 11, 4672, 3536, 11692, 977, 1623, 434, 326, 348, 2833, 3982, 7323, 364, 2362, 4191, 272, 18, 225, 1021, 1623, 353, 486, 648, 16692, 18, 3536, 17...
source = unicode(source)
if source is not None: source = unicode(source)
def _get_sources(self, cursor, args): ''' Take a list of (name, ttype, lang, source). Add the translations to the cache. Return a dict with the translations. ''' res = {} clause = '' value = [] if len(args) > cursor.IN_MAX: for i in range(0, len(args), cursor.IN_MAX): sub_args = args[i:i + cursor.IN_MAX] res.update(self._get_sources(cursor, sub_args)) return res for name, ttype, lang, source in args: name = unicode(name) ttype = unicode(ttype) lang = unicode(lang) source = unicode(source) trans = self.get(cursor, (lang, ttype, name, source)) if trans is not None: res[(name, ttype, lang, source)] = trans else: res[(name, ttype, lang, source)] = False self.add(cursor, (lang, ttype, name, source), False) if clause: clause += ' OR ' if source: source = source.strip().replace('\n',' ') clause += '(lang = %s ' \ 'AND type = %s ' \ 'AND name = %s ' \ 'AND src = %s ' \ 'AND value != \'\' ' \ 'AND value IS NOT NULL ' \ 'AND fuzzy = false)' value.extend((lang, ttype, str(name), source)) else: clause += '(lang = %s ' \ 'AND type = %s ' \ 'AND name = %s ' \ 'AND value != \'\' ' \ 'AND value IS NOT NULL ' \ 'AND fuzzy = false)' value.extend((lang, ttype, str(name))) if clause: cursor.execute('SELECT lang, type, name, src, value ' \ 'FROM ir_translation ' \ 'WHERE ' + clause, value) for lang, ttype, name, source, value in cursor.fetchall(): res[(name, ttype, lang, source)] = value self.add(cursor, (lang, ttype, name, source), value) return res
3064b752e06cc01a13d8de2d39b10967b20cb1ed /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/3064b752e06cc01a13d8de2d39b10967b20cb1ed/translation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 10141, 12, 2890, 16, 3347, 16, 833, 4672, 9163, 17129, 279, 666, 434, 261, 529, 16, 27963, 16, 3303, 16, 1084, 2934, 1436, 326, 7863, 358, 326, 1247, 18, 2000, 279, 2065,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 10141, 12, 2890, 16, 3347, 16, 833, 4672, 9163, 17129, 279, 666, 434, 261, 529, 16, 27963, 16, 3303, 16, 1084, 2934, 1436, 326, 7863, 358, 326, 1247, 18, 2000, 279, 2065,...
def format_html(table): r = '<html><head><style type="text/css">a {color: black; text-decoration: none;} </style></head><body>'
def format_header(rev, changeset): url = '%s/log/%s' % (REPO_URL, changeset) return '<a href="%s">Eventlet changeset %s: %s</a><p>' % (url, rev, changeset) def format_html(table, rev, changeset): r = '<html><head><style type="text/css">a.x {color: black; text-decoration: none;} </style></head><body>' r += format_header(rev, changeset)
def format_html(table): r = '<html><head><style type="text/css">a {color: black; text-decoration: none;} </style></head><body>' r += table r += '</body></html>' return r
8d522fc4736968ac3cd598ebbea9e2c50311575c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10078/8d522fc4736968ac3cd598ebbea9e2c50311575c/generate_report.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 740, 67, 3374, 12, 9083, 16, 22463, 4672, 880, 273, 1995, 87, 19, 1330, 5258, 87, 11, 738, 261, 862, 2419, 67, 1785, 16, 22463, 13, 327, 2368, 69, 3897, 11613, 87, 6441, 1133, 1810, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3374, 12, 9083, 16, 22463, 4672, 880, 273, 1995, 87, 19, 1330, 5258, 87, 11, 738, 261, 862, 2419, 67, 1785, 16, 22463, 13, 327, 2368, 69, 3897, 11613, 87, 6441, 1133, 1810, ...
self.assert_(self.i.length == 25)
self.assert_(self.i.length == 26)
def runTest(self): # g1 and g2 are the same, so their intersection is the same self.i = self.g1.intersect(self.g2) self.assert_(self.i.start == self.g1.start) self.assert_(self.i.end == self.g1.end) self.assert_(self.i.length == self.g1.length)
7ea094a5a9369af6702e865d752b1bac938f2e5d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5978/7ea094a5a9369af6702e865d752b1bac938f2e5d/test_geometry.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 4709, 12, 2890, 4672, 468, 314, 21, 471, 314, 22, 854, 326, 1967, 16, 1427, 3675, 7619, 353, 326, 1967, 365, 18, 77, 273, 365, 18, 75, 21, 18, 12288, 12, 2890, 18, 75, 22, 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, 4709, 12, 2890, 4672, 468, 314, 21, 471, 314, 22, 854, 326, 1967, 16, 1427, 3675, 7619, 353, 326, 1967, 365, 18, 77, 273, 365, 18, 75, 21, 18, 12288, 12, 2890, 18, 75, 22, 13...
that the shape is still a partition.
that the shape is still a partition. Indices are of the form [i,j] where i is the row-index and j is the column-index, and are 0-based.
def outside_corners(self): """ Returns a list of the positions where we can add a box so that the shape is still a partition.
9683db4d95158b54c00baed7b5cbffa0cffe3831 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/9683db4d95158b54c00baed7b5cbffa0cffe3831/partition.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8220, 67, 3850, 9646, 12, 2890, 4672, 3536, 2860, 279, 666, 434, 326, 6865, 1625, 732, 848, 527, 279, 3919, 1427, 716, 326, 2179, 353, 4859, 279, 3590, 18, 2, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8220, 67, 3850, 9646, 12, 2890, 4672, 3536, 2860, 279, 666, 434, 326, 6865, 1625, 732, 848, 527, 279, 3919, 1427, 716, 326, 2179, 353, 4859, 279, 3590, 18, 2, -100, -100, -100, -100, -...
photoinfo['date'] = getDate(photoinfo['fulldescription'])
def getMetadata(photo_id): ''' Get all the metadata for a single image and store it in the photoinfo dict ''' photoinfo = {} url = 'http://www.navy.mil/view_single.asp?id=' + str(photo_id) navyPage = urllib.urlopen(url) data = navyPage.read() soup = BeautifulSoup(data) if soup.find("meta", {'name' : 'HI_RES_IMAGE'}): photoinfo['url'] = soup.find("meta", {'name' : 'HI_RES_IMAGE'}).get('content') if soup.find("meta", {'name' : 'DESCRIPTION'}): photoinfo['fulldescription'] = soup.find("meta", {'name' : 'DESCRIPTION'}).get('content') if soup.find("meta", {'name' : 'ALT_TAG'}): photoinfo['shortdescription'] = soup.find("meta", {'name' : 'ALT_TAG'}).get('content') if photoinfo.get('url') and photoinfo.get('fulldescription') and photoinfo.get('shortdescription'): photoinfo['navyid'] = getNavyIdentifier(photoinfo['url']) #photoinfo['description'] = cleanDescription(photoinfo['fulldescription']) photoinfo['date'] = getDate(photoinfo['fulldescription']) photoinfo['author'] = getAuthor(photoinfo['fulldescription']) photoinfo['location'] = getLocation(photoinfo['fulldescription']) return photoinfo else: # Incorrect photo_id return False
c29787770c8ab97f95095952b2694df3ee6a8596 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7426/c29787770c8ab97f95095952b2694df3ee6a8596/navy_bot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11159, 12, 17232, 67, 350, 4672, 9163, 968, 777, 326, 1982, 364, 279, 2202, 1316, 471, 1707, 518, 316, 326, 24542, 885, 617, 2065, 9163, 24542, 885, 617, 273, 2618, 225, 880, 273, 296, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11159, 12, 17232, 67, 350, 4672, 9163, 968, 777, 326, 1982, 364, 279, 2202, 1316, 471, 1707, 518, 316, 326, 24542, 885, 617, 2065, 9163, 24542, 885, 617, 273, 2618, 225, 880, 273, 296, ...
output(u""+mediawiki_messages.get('spamprotectiontitle', self.site()))
def putPage(self, text, comment = None, watchArticle = False, minorEdit = True, newPage = False, token = None, gettoken = False, sysop = False): """ Upload 'text' as new contents for this Page by filling out the edit page.
97a20de5f5c8f5da484625fd4f7f4656062c08fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/97a20de5f5c8f5da484625fd4f7f4656062c08fb/wikipedia.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1378, 1964, 12, 2890, 16, 977, 16, 2879, 273, 599, 16, 4267, 7880, 273, 1083, 16, 8439, 4666, 273, 1053, 16, 394, 1964, 273, 1083, 16, 1147, 273, 599, 16, 336, 2316, 273, 1083, 16, 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, 1378, 1964, 12, 2890, 16, 977, 16, 2879, 273, 599, 16, 4267, 7880, 273, 1083, 16, 8439, 4666, 273, 1053, 16, 394, 1964, 273, 1083, 16, 1147, 273, 599, 16, 336, 2316, 273, 1083, 16, 2...
self.no_download = True
def postCheck(self, dl):
c175b751e48f0b533cc11f99aa0c636c70b73bc8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/c175b751e48f0b533cc11f99aa0c636c70b73bc8/RapidshareCom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 1564, 12, 2890, 16, 8910, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1603, 1564, 12, 2890, 16, 8910, 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, -10...
if href and not context.get('id'): context['id'] = href
if href: context = self._getContext() if not context.get('id'): context['id'] = href
def _start_enclosure(self, attrsD): attrsD = self._itsAnHrefDamnIt(attrsD) context = self._getContext() attrsD['rel']='enclosure' context.setdefault('links', []).append(FeedParserDict(attrsD)) href = attrsD.get('href') if href and not context.get('id'): context['id'] = href
b46d7e4f5773873813bf0c2abf7f311d20f6ee9d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10695/b46d7e4f5773873813bf0c2abf7f311d20f6ee9d/feedparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1937, 67, 1331, 5919, 12, 2890, 16, 3422, 40, 4672, 3422, 40, 273, 365, 6315, 1282, 979, 15962, 40, 301, 82, 7193, 12, 7039, 40, 13, 819, 273, 365, 6315, 29120, 1435, 3422, 40, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1937, 67, 1331, 5919, 12, 2890, 16, 3422, 40, 4672, 3422, 40, 273, 365, 6315, 1282, 979, 15962, 40, 301, 82, 7193, 12, 7039, 40, 13, 819, 273, 365, 6315, 29120, 1435, 3422, 40, ...
return json.load(response)
return json.loads(content)
def get_messages(url, credentials=None): """ Receive list of messages """ parsedurl = urlparse.urlparse(url) if parsedurl.scheme == 'https': conn = httplib.HTTPSConnection(parsedurl.netloc) else: conn = httplib.HTTPConnection(parsedurl.netloc) headers = {'Accept': 'application/json'} if credentials: headers['Authorization'] = 'Basic %s' % (credentials.encode('base64').strip()) conn.request("GET", parsedurl.path, headers=headers) response = conn.getresponse() print response.status, response.reason conn.close() if response.status != 200: return [] return json.load(response)
1f9c2d827ce616693dc4c13fdcc34205095c3d3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13970/1f9c2d827ce616693dc4c13fdcc34205095c3d3c/recv_fmtp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 6833, 12, 718, 16, 4448, 33, 7036, 4672, 3536, 17046, 666, 434, 2743, 3536, 225, 2707, 718, 273, 15185, 18, 718, 2670, 12, 718, 13, 309, 2707, 718, 18, 9068, 422, 296, 4528, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6833, 12, 718, 16, 4448, 33, 7036, 4672, 3536, 17046, 666, 434, 2743, 3536, 225, 2707, 718, 273, 15185, 18, 718, 2670, 12, 718, 13, 309, 2707, 718, 18, 9068, 422, 296, 4528, ...
return Q(self.trace_pairing(v).det())
return QQ(self.trace_pairing(v).det())
def discriminant(self, v=None): """ Returns the discriminant of the ring of integers of the number field, or if v is specified, the determinant of the trace pairing on the elements of the list v.
2bbf5223397ec2f7cfb9ddfba7025d0cefa90502 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/2bbf5223397ec2f7cfb9ddfba7025d0cefa90502/number_field.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29649, 20030, 12, 2890, 16, 331, 33, 7036, 4672, 3536, 2860, 326, 29649, 20030, 434, 326, 9221, 434, 12321, 434, 326, 1300, 652, 16, 578, 309, 331, 353, 1269, 16, 326, 6328, 970, 434, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29649, 20030, 12, 2890, 16, 331, 33, 7036, 4672, 3536, 2860, 326, 29649, 20030, 434, 326, 9221, 434, 12321, 434, 326, 1300, 652, 16, 578, 309, 331, 353, 1269, 16, 326, 6328, 970, 434, ...
authlist = self.esmtp_features["auth"].split()
advertised_authlist = self.esmtp_features["auth"].split()
def encode_plain(user, password): s = "\0%s\0%s" % (user, password) return encode_base64(s.encode('ascii'), eol='')
b35e4efd9e3f99e8a38b5a609a2d5317f5390c37 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/b35e4efd9e3f99e8a38b5a609a2d5317f5390c37/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2017, 67, 7446, 12, 1355, 16, 2201, 4672, 272, 273, 1548, 20, 9, 87, 64, 20, 9, 87, 6, 738, 261, 1355, 16, 2201, 13, 327, 2017, 67, 1969, 1105, 12, 87, 18, 3015, 2668, 9184, 19899,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2017, 67, 7446, 12, 1355, 16, 2201, 4672, 272, 273, 1548, 20, 9, 87, 64, 20, 9, 87, 6, 738, 261, 1355, 16, 2201, 13, 327, 2017, 67, 1969, 1105, 12, 87, 18, 3015, 2668, 9184, 19899,...
'CultureInfo': 'en-US', 'SafeSearch': 'Off', 'Requests': {
'CultureInfo': region_code, 'SafeSearch': 'Off', 'Requests': {
def soap(engine, query, url, numresults = 10): print " %s query..." % engine.capitalize() search_request_retry = config.copyright_connection_tries while search_request_retry: try: if engine == 'google': import google google.LICENSE_KEY = config.google_key data = google.doGoogleSearch('%s "%s"' % (no_result_with_those_words, query)) for entry in data.results: add_in_urllist(url, entry.URL, 'google') elif engine == 'yahoo': import yahoo.search.web data = yahoo.search.web.WebSearch(config.yahoo_appid, query='"%s" %s' % ( query.encode('utf_8'), no_result_with_those_words ), results = numresults) for entry in data.parse_results(): add_in_urllist(url, entry.Url, 'yahoo') elif engine == 'msn': #max_query_len = 150? from SOAPpy import WSDL try: server = WSDL.Proxy('http://soap.search.msn.com/webservices.asmx?wsdl') except: print "Live Search Error" raise params = {'AppID': config.msn_appid, 'Query': '%s "%s"' % (no_result_with_those_words, query), 'CultureInfo': 'en-US', 'SafeSearch': 'Off', 'Requests': { 'SourceRequest':{'Source': 'Web', 'Offset': 0, 'Count': 10, 'ResultFields': 'All',}}} results = '' server_results = server.Search(Request = params) if server_results.Responses[0].Results: results = server_results.Responses[0].Results[0] if results: # list or instance? if type(results) == type([]): for entry in results: add_in_urllist(url, entry.Url, 'msn') else: add_in_urllist(url, results.Url, 'msn') search_request_retry = 0 except KeyboardInterrupt: raise except Exception, err: print "Got an error ->", err # # SOAP.faultType: <Fault SOAP-ENV:Server: Exception from service object: # Daily limit of 1000 queries exceeded for key ***> # if 'Daily limit' in str(err): exceeded_in_queries('google') if 'limit exceeded' in str(err): exceeded_in_queries('yahoo') if search_request_retry: search_request_retry -= 1
df982418feb2fee96037cb0fe13fcf2215c639bd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/df982418feb2fee96037cb0fe13fcf2215c639bd/copyright.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9930, 12, 8944, 16, 843, 16, 880, 16, 818, 4717, 273, 1728, 4672, 1172, 315, 225, 738, 87, 843, 7070, 738, 4073, 18, 5909, 7053, 554, 1435, 1623, 67, 2293, 67, 9620, 273, 642, 18, 29...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9930, 12, 8944, 16, 843, 16, 880, 16, 818, 4717, 273, 1728, 4672, 1172, 315, 225, 738, 87, 843, 7070, 738, 4073, 18, 5909, 7053, 554, 1435, 1623, 67, 2293, 67, 9620, 273, 642, 18, 29...
This has nothing to do with pickling. This internal method replaces the cached representative by one in reduced form.
Reduce the element modulo the defining ideal of the quotient ring. This internal method replaces the cached representative by one in reduced form. (Note that this has nothing to do with pickling.)
def _reduce_(self): """ This has nothing to do with pickling. This internal method replaces the cached representative by one in reduced form. TESTS:: sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring_element.QuotientRingElement'> sage: a._reduce_() sage: a._QuotientRingElement__rep x """ I = self.parent().defining_ideal() self.__rep = I.reduce(self.__rep)
fe2b46cf11f13c5d5c987520501f153b38a5b3cb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fe2b46cf11f13c5d5c987520501f153b38a5b3cb/quotient_ring_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12498, 67, 12, 2890, 4672, 3536, 24614, 326, 930, 26109, 326, 9364, 23349, 434, 326, 26708, 9221, 18, 225, 1220, 2713, 707, 12878, 326, 3472, 23174, 635, 1245, 316, 13162, 646, 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, 389, 12498, 67, 12, 2890, 4672, 3536, 24614, 326, 930, 26109, 326, 9364, 23349, 434, 326, 26708, 9221, 18, 225, 1220, 2713, 707, 12878, 326, 3472, 23174, 635, 1245, 316, 13162, 646, 18, ...
sf = pygame.Surface ((10, 20), 0, 32) sf.fill ((0, 0, 0)) ar = pygame.PixelArray (sf)
for bpp in (8, 16, 24, 32): sf = pygame.Surface ((10, 20), 0, bpp) sf.fill ((0, 0, 0)) ar = pygame.PixelArray (sf)
def test_set_pixel (self): sf = pygame.Surface ((10, 20), 0, 32) sf.fill ((0, 0, 0)) ar = pygame.PixelArray (sf)
8c52ec7e2d3c922d31ce5b160f9bf0527da94d40 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1298/8c52ec7e2d3c922d31ce5b160f9bf0527da94d40/pixelarray_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 542, 67, 11743, 261, 2890, 4672, 9033, 273, 2395, 13957, 18, 11508, 14015, 2163, 16, 4200, 3631, 374, 16, 3847, 13, 9033, 18, 5935, 14015, 20, 16, 374, 16, 374, 3719, 419, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 542, 67, 11743, 261, 2890, 4672, 9033, 273, 2395, 13957, 18, 11508, 14015, 2163, 16, 4200, 3631, 374, 16, 3847, 13, 9033, 18, 5935, 14015, 20, 16, 374, 16, 374, 3719, 419, 27...
daypos, timepos = divmod(pos, len(self._timeset))
daypos, timepos = divmod(pos, len(timeset))
def _iter(self): year, month, day, hour, minute, second, weekday, yearday, _ = \ self._dtstart.timetuple()
d375f07e08a8fd61f1640e67f981e1abdac8d8d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8441/d375f07e08a8fd61f1640e67f981e1abdac8d8d1/rrule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2165, 12, 2890, 4672, 3286, 16, 3138, 16, 2548, 16, 6126, 16, 8044, 16, 2205, 16, 7560, 16, 677, 73, 1060, 528, 16, 389, 273, 521, 365, 6315, 7510, 1937, 18, 8584, 278, 2268, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2165, 12, 2890, 4672, 3286, 16, 3138, 16, 2548, 16, 6126, 16, 8044, 16, 2205, 16, 7560, 16, 677, 73, 1060, 528, 16, 389, 273, 521, 365, 6315, 7510, 1937, 18, 8584, 278, 2268, 14...
tax_code_obj.create_tax_code(cursor, user, tax_code_template, datas['form']['company'], context=context, template2tax_code=template2tax_code)
tax_code_template_obj.create_tax_code(cursor, user, tax_code_template, datas['form']['company'], context=context, template2tax_code=template2tax_code)
def _action_create_account(self, cursor, user, datas, context=None): account_type_template_obj = \ self.pool.get('account.account.type.template') account_template_obj = self.pool.get('account.account.template') tax_code_template_obj = self.pool.get('account.tax.code.template') tax_template_obj = self.pool.get('account.tax.template')
7b0aa114d11fec207e44ed59e7d9e70c94ec9197 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9290/7b0aa114d11fec207e44ed59e7d9e70c94ec9197/account.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1128, 67, 2640, 67, 4631, 12, 2890, 16, 3347, 16, 729, 16, 5386, 16, 819, 33, 7036, 4672, 2236, 67, 723, 67, 3202, 67, 2603, 273, 521, 365, 18, 6011, 18, 588, 2668, 4631, 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, 389, 1128, 67, 2640, 67, 4631, 12, 2890, 16, 3347, 16, 729, 16, 5386, 16, 819, 33, 7036, 4672, 2236, 67, 723, 67, 3202, 67, 2603, 273, 521, 365, 18, 6011, 18, 588, 2668, 4631, 18, ...
if prop is not None: if args[k] and (isinstance(prop, hyperdb.Multilink) or isinstance(prop, hyperdb.Link)): classname = prop.classname try: linkcl = self._db.getclass(classname) except KeyError: labelprop = None comments[classname] = _('''The linked class %(classname)s no longer exists''')%locals() labelprop = linkcl.labelprop(1) hrefable = os.path.exists( os.path.join(self._db.config.TEMPLATES, classname+'.item')) if isinstance(prop, hyperdb.Multilink) and args[k]: ml = [] for linkid in args[k]: if isinstance(linkid, type(())): sublabel = linkid[0] + ' ' linkids = linkid[1] else: sublabel = '' linkids = [linkid] subml = [] for linkid in linkids: label = classname + linkid try: if labelprop is not None and \ labelprop != 'id': label = linkcl.get(linkid, labelprop) except IndexError: comments['no_link'] = _('''<strike>The linked node no longer exists</strike>''') subml.append('<strike>%s</strike>'%label) else: if hrefable: subml.append('<a href="%s%s">%s</a>'%( classname, linkid, label)) else: subml.append(label) ml.append(sublabel + ', '.join(subml)) cell.append('%s:\n %s'%(k, ', '.join(ml))) elif isinstance(prop, hyperdb.Link) and args[k]: label = classname + args[k] if labelprop is not None and labelprop != 'id':
if prop is None: comments['no_exist'] = _('''<em>The indicated property no longer exists</em>''') cell.append('<em>%s: %s</em>\n'%(k, str(args[k]))) continue if args[k] and (isinstance(prop, hyperdb.Multilink) or isinstance(prop, hyperdb.Link)): classname = prop.classname try: linkcl = self._db.getclass(classname) except KeyError: labelprop = None comments[classname] = _('''The linked class %(classname)s no longer exists''')%locals() labelprop = linkcl.labelprop(1) try: template = find_template(self._db.config.TEMPLATES, classname, 'item') if template[1].startswith('_generic'): raise NoTemplate, 'not really...' hrefable = 1 except NoTemplate: hrefable = 0 if isinstance(prop, hyperdb.Multilink) and args[k]: ml = [] for linkid in args[k]: if isinstance(linkid, type(())): sublabel = linkid[0] + ' ' linkids = linkid[1] else: sublabel = '' linkids = [linkid] subml = [] for linkid in linkids: label = classname + linkid
def history(self, direction='descending', dre=re.compile('\d+')): l = ['<table class="history">' '<tr><th colspan="4" class="header">', _('History'), '</th></tr><tr>', _('<th>Date</th>'), _('<th>User</th>'), _('<th>Action</th>'), _('<th>Args</th>'), '</tr>'] current = {} comments = {} history = self._klass.history(self._nodeid) history.sort() timezone = self._db.getUserTimezone() if direction == 'descending': history.reverse() for prop_n in self._props.keys(): prop = self[prop_n] if isinstance(prop, HTMLProperty): current[prop_n] = prop.plain() # make link if hrefable if (self._props.has_key(prop_n) and isinstance(self._props[prop_n], hyperdb.Link)): classname = self._props[prop_n].classname try: find_template(self._db.config.TEMPLATES, classname, 'item') except NoTemplate: pass else: id = self._klass.get(self._nodeid, prop_n, None) current[prop_n] = '<a href="%s%s">%s</a>'%( classname, id, current[prop_n])
1ea8cff47f70916ee19486dfd32766235b849f94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/1ea8cff47f70916ee19486dfd32766235b849f94/templating.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 4068, 2218, 5569, 2846, 2187, 302, 266, 33, 266, 18, 11100, 2668, 64, 72, 6797, 3719, 30, 328, 273, 10228, 32, 2121, 667, 1546, 8189, 7918, 2368, 313, 4438, 451, 20...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4927, 12, 2890, 16, 4068, 2218, 5569, 2846, 2187, 302, 266, 33, 266, 18, 11100, 2668, 64, 72, 6797, 3719, 30, 328, 273, 10228, 32, 2121, 667, 1546, 8189, 7918, 2368, 313, 4438, 451, 20...
reply = getattr(self, 'xwf_email_subscribe_key', None) email_address = mail['from']
reply = getattr(self, 'email_subscribe_key', None) thepin = pin( msg.sender, self.getValueFor('hashkey') )
def mail_subscribe_key(self, context, REQUEST, mail=None, body=''): """ A hook used by the MailBoxer framework, which we provide here as a clean default. """ smtpserver = smtplib.SMTP(self.MailHost.smtp_host, int(self.MailHost.smtp_port)) returnpath=self.getValueFor('returnpath') if not returnpath: returnpath = self.getValueFor('moderator')[0] reply = getattr(self, 'xwf_email_subscribe_key', None) email_address = mail['from'] if reply: reply_text = reply(REQUEST, list_object=context, getValueFor=self.getValueFor, mail=mail, body=body) smtpserver.sendmail(returnpath, [email_address], reply_text) else: pass smtpserver.quit()
23c20aaac6d9dabc6649a8df6a2934aec71d70c7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6274/23c20aaac6d9dabc6649a8df6a2934aec71d70c7/XWFMailingList.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4791, 67, 9174, 67, 856, 12, 2890, 16, 819, 16, 12492, 16, 4791, 33, 7036, 16, 1417, 2218, 11, 4672, 3536, 432, 3953, 1399, 635, 326, 11542, 3514, 264, 8257, 16, 1492, 732, 5615, 2674,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4791, 67, 9174, 67, 856, 12, 2890, 16, 819, 16, 12492, 16, 4791, 33, 7036, 16, 1417, 2218, 11, 4672, 3536, 432, 3953, 1399, 635, 326, 11542, 3514, 264, 8257, 16, 1492, 732, 5615, 2674,...
self.body.append( '\\end{itemize}\n' )
self.body.append('\\end{itemize}\n' )
def depart_bullet_list(self, node): self.body.append( '\\end{itemize}\n' )
f1c936c7b824a9c68698c2d6eb95c28f15eb4fbe /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/f1c936c7b824a9c68698c2d6eb95c28f15eb4fbe/python_latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 70, 19994, 67, 1098, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 12, 3718, 409, 95, 1726, 554, 6280, 82, 11, 262, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26000, 67, 70, 19994, 67, 1098, 12, 2890, 16, 756, 4672, 365, 18, 3432, 18, 6923, 12, 3718, 409, 95, 1726, 554, 6280, 82, 11, 262, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
x = complex(x, 0)
x = _to_complex(x)
def cos(x): """cos(x) Return the cosine of x.""" x = complex(x, 0) real = math.cos(x.real) * math.cosh(x.imag) imag = -math.sin(x.real) * math.sinh(x.imag) return complex(real, imag)
d265b40c2f1e228c0cbd532ea68ae4f9079e1876 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/d265b40c2f1e228c0cbd532ea68ae4f9079e1876/cmath.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4987, 12, 92, 4672, 3536, 14445, 12, 92, 13, 225, 2000, 326, 31633, 434, 619, 12123, 225, 619, 273, 389, 869, 67, 14259, 12, 92, 13, 2863, 273, 4233, 18, 14445, 12, 92, 18, 7688, 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, 4987, 12, 92, 4672, 3536, 14445, 12, 92, 13, 225, 2000, 326, 31633, 434, 619, 12123, 225, 619, 273, 389, 869, 67, 14259, 12, 92, 13, 2863, 273, 4233, 18, 14445, 12, 92, 18, 7688, 13,...
elapmsg = "Elasped Time: " + self.hhmmss_str(self.duration)
elapmsg = "Elasped Time: " + self.hhmmss_str(int(self.duration))
def launch( self , nsteps, filename = '', caption = "Progress", message = "Calculating...", dflag = 0): """Launch a progress bar dialog and update while a file is being written. nsteps - total steps for the progress bar (final size in bytes of filename) filename - name of file we are waiting for. caption - dialog caption message - text that appears above the progress bar dflag - if True, display duration (in seconds) below progressbar """ self.abort = False filesize = 0 sinc = .1 self.stime = time.time()
30850dda57395442f710cb546912468fcae68fcc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/30850dda57395442f710cb546912468fcae68fcc/ProgressBar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8037, 12, 365, 269, 290, 8986, 16, 1544, 273, 10226, 11006, 273, 315, 5491, 3113, 883, 273, 315, 30238, 7070, 16, 302, 6420, 273, 374, 4672, 3536, 9569, 279, 4007, 4653, 6176, 471, 1089,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8037, 12, 365, 269, 290, 8986, 16, 1544, 273, 10226, 11006, 273, 315, 5491, 3113, 883, 273, 315, 30238, 7070, 16, 302, 6420, 273, 374, 4672, 3536, 9569, 279, 4007, 4653, 6176, 471, 1089,...
return http.Response(stream=s)
return HTMLResponse(stream=s)
def render(self, ctx): id = self.id(ctx) if not ctx.args.has_key('input'): input_text = '' else: input_text = ctx.args['input'][0] input_text = input_text.replace('\r\n', '\n') # DOS
39855fabbbbe971c1c1d64566b1625e9c1c6d482 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/39855fabbbbe971c1c1d64566b1625e9c1c6d482/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 1103, 4672, 612, 273, 365, 18, 350, 12, 5900, 13, 309, 486, 1103, 18, 1968, 18, 5332, 67, 856, 2668, 2630, 11, 4672, 810, 67, 955, 273, 875, 469, 30, 810, 67, 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, 1743, 12, 2890, 16, 1103, 4672, 612, 273, 365, 18, 350, 12, 5900, 13, 309, 486, 1103, 18, 1968, 18, 5332, 67, 856, 2668, 2630, 11, 4672, 810, 67, 955, 273, 875, 469, 30, 810, 67, 9...
"""%(number, number+1))
"""%(save_name, number, number+1))
def __show_page(self, number): global current_log f = self.send_head() if f: f = StringIO() f.write(""" <html><head><title>SAGE Calculator (%s)</title></head>\n <script language=javascript> function scroll_to_bottom() { document.getElementById(%s).scrollIntoView(); document.io%s.elements[0].focus(); }
f222050139d0f9d9c6171de9f4d6247466c1de72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/f222050139d0f9d9c6171de9f4d6247466c1de72/server1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4500, 67, 2433, 12, 2890, 16, 1300, 4672, 2552, 783, 67, 1330, 284, 273, 365, 18, 4661, 67, 1978, 1435, 309, 284, 30, 284, 273, 15777, 1435, 284, 18, 2626, 2932, 3660, 411, 2620,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 4500, 67, 2433, 12, 2890, 16, 1300, 4672, 2552, 783, 67, 1330, 284, 273, 365, 18, 4661, 67, 1978, 1435, 309, 284, 30, 284, 273, 15777, 1435, 284, 18, 2626, 2932, 3660, 411, 2620,...
print_directory() print_arguments()
def g(f=f): f()
41550751b18a239c982718c5055b4428c016b302 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/41550751b18a239c982718c5055b4428c016b302/cgi.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 12, 74, 33, 74, 4672, 284, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 12, 74, 33, 74, 4672, 284, 1435, 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, -...
events = metatool.listAllowedSubjects(content_type = "Event")
my_type = self.getPortalTypeName() events = metatool.listAllowedSubjects(content_type = my_type)
def getEventTypes(self): """fetch a list of the available event types from the vocabulary """ metatool = getToolByName(self, "portal_metadata") events = metatool.listAllowedSubjects(content_type = "Event") return events
ac9c43bbbac9a25538a4e792678f36a9b243df80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11956/ac9c43bbbac9a25538a4e792678f36a9b243df80/event.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9832, 2016, 12, 2890, 4672, 3536, 5754, 279, 666, 434, 326, 2319, 871, 1953, 628, 326, 20906, 3536, 5100, 270, 1371, 273, 336, 6364, 5911, 12, 2890, 16, 315, 24386, 67, 4165, 7923, 3399,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9832, 2016, 12, 2890, 4672, 3536, 5754, 279, 666, 434, 326, 2319, 871, 1953, 628, 326, 20906, 3536, 5100, 270, 1371, 273, 336, 6364, 5911, 12, 2890, 16, 315, 24386, 67, 4165, 7923, 3399,...
self.KillHandler,
def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.KillHandler, self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers
814d8c519498ba4f6ab732363a6f66cc5da8a33c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/814d8c519498ba4f6ab732363a6f66cc5da8a33c/testserver.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 590, 16, 1004, 67, 2867, 16, 2987, 67, 3567, 4672, 365, 6315, 3612, 67, 11046, 273, 306, 365, 18, 5961, 5215, 1503, 16, 365, 18, 2081, 1730, 5215, 1503, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 590, 16, 1004, 67, 2867, 16, 2987, 67, 3567, 4672, 365, 6315, 3612, 67, 11046, 273, 306, 365, 18, 5961, 5215, 1503, 16, 365, 18, 2081, 1730, 5215, 1503, ...
msg = _('argument "-" with mode %r' % self._mode)
msg = _('argument "-" with mode %r') % self._mode
def __call__(self, string): # the special argument "-" means sys.std{in,out} if string == '-': if 'r' in self._mode: return _sys.stdin elif 'w' in self._mode: return _sys.stdout else: msg = _('argument "-" with mode %r' % self._mode) raise ValueError(msg)
f2af8579d9039e824c5815ad0429169908275fa7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/f2af8579d9039e824c5815ad0429169908275fa7/argparse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 533, 4672, 468, 326, 4582, 1237, 7514, 4696, 2589, 18, 5084, 95, 267, 16, 659, 97, 309, 533, 422, 4014, 30, 309, 296, 86, 11, 316, 365, 6315, 3188, 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, 1001, 1991, 972, 12, 2890, 16, 533, 4672, 468, 326, 4582, 1237, 7514, 4696, 2589, 18, 5084, 95, 267, 16, 659, 97, 309, 533, 422, 4014, 30, 309, 296, 86, 11, 316, 365, 6315, 3188, 30,...
from zhipy import interpreter
from zhpyi import interpreter
def commandtool(): """command line tool method input: speficy the input source output: speficy the output source python: compile to python and run cmp: input raw zhpy source and run """ parser = OptionParser( usage="usage: %prog [-i|-p] input [-o output]", version="zhpy %s"%version) parser.add_option("-i", "--input", help="speficy the input source", dest="input", default = None) parser.add_option("-o", "--output", help="speficy the output source", dest="output", default = None) parser.add_option("-p", "--python", help="compile to python and run", dest="python", default = None) parser.add_option("-c", "--cmd", help="input zhpy program as string and run", dest="cmp", default = None) (options, args) = parser.parse_args() os.chdir(os.getcwd()) #run as script if options.cmp: test = options.cmp annotator() result = convertor(test) try_run(result) return #run as command #TODO: accept args argv = sys.argv[1:] if len(argv) >= 1: if (options.input is None) and argv[0].endswith("py"): options.input = argv[0] if options.python: options.input = options.python #if options.input: test = file(options.input, "r").read() annotator() result = convertor(test) if len(argv) == 2: if argv[0].endswith("py") and argv[1].endswith("py"): options.output = argv[1] if options.python: filename = os.path.splitext(options.python)[0] file("n_"+filename+".py","w").write(result) print "compile to python and run: %s"%("n_"+filename+".py") if options.output: file(options.output,"w").write(result) else: try_run(result) else: from zhipy import interpreter interpreter()
849f75729d59f2d9ab90eb17e77cfea7deab1d4c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1969/849f75729d59f2d9ab90eb17e77cfea7deab1d4c/zhpy_cmd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 6738, 13332, 3536, 3076, 980, 5226, 707, 225, 810, 30, 17785, 74, 335, 93, 326, 810, 1084, 876, 30, 17785, 74, 335, 93, 326, 876, 1084, 5790, 30, 4074, 358, 5790, 471, 1086, 9411...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1296, 6738, 13332, 3536, 3076, 980, 5226, 707, 225, 810, 30, 17785, 74, 335, 93, 326, 810, 1084, 876, 30, 17785, 74, 335, 93, 326, 876, 1084, 5790, 30, 4074, 358, 5790, 471, 1086, 9411...
r""" The sequence $tau(n)$, which is the number of divisors of $n$. This sequence is also denoted $d(n)$ (also called $\tau(n)$ or $\sigma_0(n)$), the number of divisors of n. INPUT: n -- positive integer OUTPUT: EXAMPLES: sage: d = sloane.A000005; d The integer sequence tau(n), which is the number of divisors of n. sage: d(1) 1 sage: d(6) 4 sage: d(51) 4 sage: d(100) 9 sage: d(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: d.list(10) [1, 2, 2, 3, 2, 4, 2, 4, 3, 4] AUTHOR: -- Jaap Spies (2006-12-10) -- William Stein (2007-01-08) """ def __init__(self):
def __init__(self): r""" The sequence $tau(n)$, which is the number of divisors of $n$. This sequence is also denoted $d(n)$ (also called $\tau(n)$ or $\sigma_0(n)$), the number of divisors of n. INPUT: n -- positive integer OUTPUT: EXAMPLES: sage: d = sloane.A000005; d The integer sequence tau(n), which is the number of divisors of n. sage: d(1) 1 sage: d(6) 4 sage: d(51) 4 sage: d(100) 9 sage: d(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: d.list(10) [1, 2, 2, 3, 2, 4, 2, 4, 3, 4] AUTHOR: -- Jaap Spies (2006-12-10) -- William Stein (2007-01-08) """
def _eval(self, n): return 0
8b300fed02e947af57b58146f62dccfc715cf0b9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8b300fed02e947af57b58146f62dccfc715cf0b9/sloane_functions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 327, 374, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 8622, 12, 2890, 16, 290, 4672, 327, 374, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.pool.get('ir.model.access').check(cr, user, self._name, 'read', context=context)
self.pool.get('ir.model.access').check(cr, access_rights_uid or user, self._name, 'read', context=context)
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False): """ Search for record/s based on a search domain.
fb1b59cc7592103b77e5eba54e06b0470f245930 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/fb1b59cc7592103b77e5eba54e06b0470f245930/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 1384, 33, 20, 16, 1800, 33, 7036, 16, 1353, 33, 7036, 16, 819, 33, 7036, 16, 1056, 33, 8381, 4672, 3536, 5167, 364, 1409, 19, 87, 25...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1623, 12, 2890, 16, 4422, 16, 729, 16, 833, 16, 1384, 33, 20, 16, 1800, 33, 7036, 16, 1353, 33, 7036, 16, 819, 33, 7036, 16, 1056, 33, 8381, 4672, 3536, 5167, 364, 1409, 19, 87, 25...
print "WARNING: Going to slow: ", spent, " ", left
print "WARNING: Going too slow: ", spent, " ", left
def emulate_cycle(self): # self.joypad_driver.button_up(True) X = 1<<6 # About 1<<6 to make sure we have a clean distrubution of about # 1<<6 frames per second start_time = time.time() self.handle_events() # Come back to this cycle every 1/X seconds self.emulate(constants.GAMEBOY_CLOCK / X) # if use_rsdl: # RSDL.Delay(100) spent = time.time() - start_time left = (1.0/X) - spent if left > 0: time.sleep(left) else: print "WARNING: Going to slow: ", spent, " ", left
3da070f5d0a13e2c15e48f522e814dfb35203837 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/3da070f5d0a13e2c15e48f522e814dfb35203837/gameboy_implementation.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 801, 6243, 67, 13946, 12, 2890, 4672, 468, 365, 18, 30952, 879, 361, 67, 7407, 18, 5391, 67, 416, 12, 5510, 13, 1139, 273, 404, 17685, 26, 468, 9771, 659, 404, 17685, 26, 358, 1221, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 801, 6243, 67, 13946, 12, 2890, 4672, 468, 365, 18, 30952, 879, 361, 67, 7407, 18, 5391, 67, 416, 12, 5510, 13, 1139, 273, 404, 17685, 26, 468, 9771, 659, 404, 17685, 26, 358, 1221, ...
req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project))
req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project))
def send_project_index(req, mpr, dir): req.content_type = 'text/html' req.write('<html><head><title>Available Projects</title></head>') req.write('<body><h1>Available Projects</h1><ul>') for project in os.listdir(dir): req.write('<li><a href="%s">%s</a></li>' % (href_join(mpr.idx_location, project), project)) req.write('</ul></body><html>')
a834c4782e0c1c35cf7f1159a7cfaa86bfd7dde0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/a834c4782e0c1c35cf7f1159a7cfaa86bfd7dde0/ModPythonHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 4406, 67, 1615, 12, 3658, 16, 312, 683, 16, 1577, 4672, 1111, 18, 1745, 67, 723, 273, 296, 955, 19, 2620, 11, 1111, 18, 2626, 2668, 32, 2620, 4438, 1978, 4438, 2649, 34, 52...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 4406, 67, 1615, 12, 3658, 16, 312, 683, 16, 1577, 4672, 1111, 18, 1745, 67, 723, 273, 296, 955, 19, 2620, 11, 1111, 18, 2626, 2668, 32, 2620, 4438, 1978, 4438, 2649, 34, 52...
footnote = self.document.explicit_targets[label] ref['refid'] = footnote['id']
id = self.document.nameids[label] footnote = self.document.ids[id] ref['refid'] = id
def number_footnote_references(self, startnum): """Assign numbers to autonumbered footnote references.""" i = 0 for ref in self.document.autofootnote_refs: if ref.resolved or ref.hasattr('refid'): continue try: label = self.autofootnote_labels[i] except IndexError: msg = self.document.reporter.error( 'Too many autonumbered footnote references: only %s ' 'corresponding footnotes available.' % len(self.autofootnote_labels)) msgid = self.document.set_id(msg) self.document.messages += msg for ref in self.document.autofootnote_refs[i:]: if ref.resolved or ref.hasattr('refname'): continue prb = nodes.problematic( ref.rawsource, ref.rawsource, refid=msgid) prbid = self.document.set_id(prb) msg.add_backref(prbid) ref.parent.replace(ref, prb) break ref += nodes.Text(label) footnote = self.document.explicit_targets[label] ref['refid'] = footnote['id'] self.document.note_refid(ref) footnote.add_backref(ref['id']) ref.resolved = 1 i += 1
16a3cbc26d0b078fa3f8e18df50b2b84433cdf8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/16a3cbc26d0b078fa3f8e18df50b2b84433cdf8a/references.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1300, 67, 10923, 7652, 67, 14353, 12, 2890, 16, 787, 2107, 4672, 3536, 4910, 5600, 358, 2059, 265, 1226, 329, 14200, 7652, 5351, 12123, 277, 273, 374, 364, 1278, 316, 365, 18, 5457, 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, 1300, 67, 10923, 7652, 67, 14353, 12, 2890, 16, 787, 2107, 4672, 3536, 4910, 5600, 358, 2059, 265, 1226, 329, 14200, 7652, 5351, 12123, 277, 273, 374, 364, 1278, 316, 365, 18, 5457, 18, ...
attrs = [("builder", self._options.builder_name), ("testtype", "layout-tests")] if self._options.master_name: attrs.append(("master", self._options.master_name))
attrs = [("builder", self._options.builder_name), ("testtype", "layout-tests"), ("master", self._options.master_name)]
def _upload_json_files(self): if not self._options.test_results_server: return
9e827c3d9f200979570d47d103509a1162d1ec73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/9e827c3d9f200979570d47d103509a1162d1ec73/run_webkit_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6327, 67, 1977, 67, 2354, 12, 2890, 4672, 309, 486, 365, 6315, 2116, 18, 3813, 67, 4717, 67, 3567, 30, 327, 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, 389, 6327, 67, 1977, 67, 2354, 12, 2890, 4672, 309, 486, 365, 6315, 2116, 18, 3813, 67, 4717, 67, 3567, 30, 327, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -1...
str = 'ISA*00* *00* *ZZ*ZZ000 *ZZ*ZZ001 *030828*1128*U*00401*000010121*0*T*:~\n' str += 'GS*HC*ZZ000*ZZ001*20030828*1128*17*X*004010X098~\n' str += 'GE*0*17~\n' str += 'IEA*1*000010555~\n' (err_cde, err_str) = self._get_first_error(str)
str1 = 'ISA*00* *00* *ZZ*ZZ000 *ZZ*ZZ001 *030828*1128*U*00401*000010121*0*T*:~\n' str1 += 'GS*HC*ZZ000*ZZ001*20030828*1128*17*X*004010X098~\n' str1 += 'GE*0*17~\n' str1 += 'IEA*1*000010555~\n' (err_cde, err_str) = self._get_first_error(str1)
def test_IEA_id_match_ISA_id(self): seg = None str = 'ISA*00* *00* *ZZ*ZZ000 *ZZ*ZZ001 *030828*1128*U*00401*000010121*0*T*:~\n' str += 'GS*HC*ZZ000*ZZ001*20030828*1128*17*X*004010X098~\n' str += 'GE*0*17~\n' str += 'IEA*1*000010555~\n' (err_cde, err_str) = self._get_first_error(str) self.assertEqual(err_cde, '001', err_str)
1433c380fc3bf2e7c5ac05b385e1b69e19134b72 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11528/1433c380fc3bf2e7c5ac05b385e1b69e19134b72/x12file.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8732, 37, 67, 350, 67, 1916, 67, 5127, 37, 67, 350, 12, 2890, 4672, 2291, 273, 599, 609, 21, 273, 296, 5127, 37, 14, 713, 14, 1850, 380, 713, 14, 1850, 380, 27096, 14, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 8732, 37, 67, 350, 67, 1916, 67, 5127, 37, 67, 350, 12, 2890, 4672, 2291, 273, 599, 609, 21, 273, 296, 5127, 37, 14, 713, 14, 1850, 380, 713, 14, 1850, 380, 27096, 14, 27...
row['time'] = iso8601.parse_date(row['time'].value)
date_time = row['time'].value date_time_adjusted = '%s-%s-%s' % ( date_time[0:4], date_time[4:6], date_time[6:]) row['time'] = iso8601.parse_date(date_time_adjusted)
def get_timeseries(self, filter_id, location_id, parameter_id, start_date, end_date): """ SELECT TIME,VALUE,FLAG,DETECTION,COMMENT from ExTimeSeries WHERE filterId = 'MFPS' AND parameterId = 'H.meting' AND locationId = 'BW_NZ_04' AND time BETWEEN '2007-01-01 13:00:00' AND '2008-01-10 13:00:00' """ q = ("select time, value, flag, detection, comment from " "extimeseries where filterid='%s' and locationid='%s' " "and parameterid='%s' and time between '%s' and '%s'" % (filter_id, location_id, parameter_id, start_date.strftime(JDBC_DATE_FORMAT), end_date.strftime(JDBC_DATE_FORMAT))) query_result = self.query(q) result = named_list( query_result, ['time', 'value', 'flag', 'detection', 'comment']) for row in result: row['time'] = iso8601.parse_date(row['time'].value) return result
dbe0014b56e8b79ac3d6636cf61218725679ded2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11153/dbe0014b56e8b79ac3d6636cf61218725679ded2/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 28494, 12, 2890, 16, 1034, 67, 350, 16, 2117, 67, 350, 16, 1569, 67, 350, 16, 787, 67, 712, 16, 679, 67, 712, 4672, 3536, 9111, 8721, 16, 4051, 16, 9651, 16, 1639, 1448, 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, 336, 67, 28494, 12, 2890, 16, 1034, 67, 350, 16, 2117, 67, 350, 16, 1569, 67, 350, 16, 787, 67, 712, 16, 679, 67, 712, 4672, 3536, 9111, 8721, 16, 4051, 16, 9651, 16, 1639, 1448, 3...
all_r = test_all_config_results[c] for t in all_r: s += float(t.score_pos) if len(all_r) == 1: stars = '' elif len(all_r) >= 10: stars = ' ***' elif len(all_r) >= int(1/KEEP_P): stars = ' **' else: stars = ' *' print 'Score: %0.6f %s (%.1f%s%s)' % \ (test.score, test, s / len(all_r), stars, (len(all_r) > 2) and (' in %d' % len(all_r)) or "")
print 'H-Score: %0.9f %s' % (test.score, test)
def ScoreTests(results): scored = [] timed = [] sized = [] t_min = float(min([test.time() for test in results])) #t_max = float(max([test.time() for test in results])) s_min = float(min([test.size() for test in results])) #s_max = float(max([test.size() for test in results])) for test in results: # Hyperbolic function. Smaller scores still better red = 0.999 # minimum factors for each dimension are 1/1000 test.score = ((test.size() - s_min * red) * (test.time() - t_min * red)) scored.append((test.score, test)) timed.append((test.time(), test)) sized.append((test.size(), test)) #end scored.sort() timed.sort() sized.sort() best_by_size = [] best_by_time = [] pos = 0 for (score, test) in scored: pos += 1 test.score_pos = pos c = test.config() if not test_all_config_results.has_key(c): test_all_config_results[c] = [test] else: test_all_config_results[c].append(test) #end #end scored = [x[1] for x in scored] for test in scored: test.size_pos = PosInAlist(sized, test) test.time_pos = PosInAlist(timed, test) #end for test in scored: c = test.config() s = 0.0 all_r = test_all_config_results[c] for t in all_r: s += float(t.score_pos) #end if len(all_r) == 1: stars = '' elif len(all_r) >= 10: stars = ' ***' elif len(all_r) >= int(1/KEEP_P): stars = ' **' else: stars = ' *' print 'Score: %0.6f %s (%.1f%s%s)' % \ (test.score, test, s / len(all_r), stars, (len(all_r) > 2) and (' in %d' % len(all_r)) or "") #end return scored
ca6951c05772975cff7d67dba745c3bc33e71252 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4464/ca6951c05772975cff7d67dba745c3bc33e71252/xdelta3-regtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20671, 14650, 12, 4717, 4672, 4462, 72, 273, 5378, 7491, 273, 5378, 26046, 273, 5378, 225, 268, 67, 1154, 273, 1431, 12, 1154, 3816, 3813, 18, 957, 1435, 364, 1842, 316, 1686, 22643, 468...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20671, 14650, 12, 4717, 4672, 4462, 72, 273, 5378, 7491, 273, 5378, 26046, 273, 5378, 225, 268, 67, 1154, 273, 1431, 12, 1154, 3816, 3813, 18, 957, 1435, 364, 1842, 316, 1686, 22643, 468...
sqlite_defines.append(('PY_MAJOR_VERSION',
sqlite_defines.append(('PY_MAJOR_VERSION',
def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/3dc6bb3c25dd2834b198a4bbcff2f9b760d1a2d9/setup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 527, 67, 1214, 67, 869, 67, 1098, 12, 2890, 18, 9576, 18, 12083, 67, 8291, 16, 1173, 13640, 19, ...
opts, args = getopt.getopt(argv, "m:ah", ["commit-name=", "all", "help"])
opts, args = getopt.getopt(argv, "m:aesh", ["commit-name=", "all", "edit-long-comment", "skip-long-comment", "help"])
def __init__(self): self.name = None self.all = None self.help = False self.files = ""
5add7fca73485e5351d7d20e84c1174f86ef00dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11934/5add7fca73485e5351d7d20e84c1174f86ef00dd/dg.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 365, 18, 454, 273, 599, 365, 18, 5201, 273, 1083, 365, 18, 2354, 273, 1408, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 529, 273, 599, 365, 18, 454, 273, 599, 365, 18, 5201, 273, 1083, 365, 18, 2354, 273, 1408, 2, -100, -100, -100, -100, -100, -100, -100, -100, ...
self.stat += (self.stat**2 + getattr(trig,statistic.name)**2)**(1./2)
self.stat = (self.stat**2 + getattr(trig,statistic.name)**2)**(1./2)
def add_trig(self,trig,statistic): self.numifos +=1 if statistic.name == 'effective_snr': self.stat = (self.stat**2 + trig.get_effective_snr()**2)**(1./2) elif statistic.name == 'bitten_l': snr=trig.snr self.rsq= (self.stat**2 + snr**2)**(1./2) self.bl=statistic.get_bittenl( self.bl, snr ) self.stat=min( self.bl, self.rsq ) else: self.stat += (self.stat**2 + getattr(trig,statistic.name)**2)**(1./2) # sets the data for the single inspiral trigger setattr(self,trig.ifo,trig)
96fea81c4503c18e809baef430682114ec19cbb3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3592/96fea81c4503c18e809baef430682114ec19cbb3/CoincInspiralUtils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 313, 360, 12, 2890, 16, 313, 360, 16, 5642, 5846, 4672, 225, 365, 18, 2107, 430, 538, 1011, 21, 309, 21605, 18, 529, 422, 296, 28894, 67, 8134, 86, 4278, 365, 18, 5642, 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, 527, 67, 313, 360, 12, 2890, 16, 313, 360, 16, 5642, 5846, 4672, 225, 365, 18, 2107, 430, 538, 1011, 21, 309, 21605, 18, 529, 422, 296, 28894, 67, 8134, 86, 4278, 365, 18, 5642, 273,...
if type(getattr(py_item, m)) == MethodType:
if ismethod(getattr(py_item, m), m):
def checkModule(self, moduleName, module=None, ignore=()): ''' succeed iff pyclbr.readmodule_ex(modulename) corresponds to the actual module object, module. Any identifiers in ignore are ignored. If no module is provided, the appropriate module is loaded with __import__.'''
72a925f8cd88b62bf84ae9701ad9e59a7e7d85d9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/72a925f8cd88b62bf84ae9701ad9e59a7e7d85d9/test_pyclbr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 3120, 12, 2890, 16, 9780, 16, 1605, 33, 7036, 16, 2305, 33, 1435, 4672, 9163, 12897, 21437, 2395, 830, 2848, 18, 896, 2978, 67, 338, 12, 1711, 332, 1069, 13, 13955, 358, 326, 3214...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3120, 12, 2890, 16, 9780, 16, 1605, 33, 7036, 16, 2305, 33, 1435, 4672, 9163, 12897, 21437, 2395, 830, 2848, 18, 896, 2978, 67, 338, 12, 1711, 332, 1069, 13, 13955, 358, 326, 3214...
identity.current.user.id, approvedStatus.statuscodeid,
identity.current.user.id, self.approvedStatus.statuscodeid,
def add_package(self, package, owner, summary): '''Add a new package to the database. ''' # Check that the tg.identity is allowed to set an owner if not identity.in_any_group('cvsadmin'): return dict(status=False, message='User must be in cvsadmin')
48b4c95df35399b9205c63bf94720f75862df541 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9953/48b4c95df35399b9205c63bf94720f75862df541/dispatcher.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5610, 12, 2890, 16, 2181, 16, 3410, 16, 4916, 4672, 9163, 986, 279, 394, 2181, 358, 326, 2063, 18, 9163, 468, 2073, 716, 326, 18289, 18, 10781, 353, 2935, 358, 444, 392, 3410,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 5610, 12, 2890, 16, 2181, 16, 3410, 16, 4916, 4672, 9163, 986, 279, 394, 2181, 358, 326, 2063, 18, 9163, 468, 2073, 716, 326, 18289, 18, 10781, 353, 2935, 358, 444, 392, 3410,...
if {}!=self.readerstates: hresult, newstates = SCardGetStatusChange( self.hcontext, 0, self.readerstates.values() )
if {}!=readerstates: hresult, newstates = SCardGetStatusChange( self.hcontext, 0, readerstates.values() )
def waitforcard( self ): """Wait for card insertion and returns a card service.""" AbstractCardRequest.waitforcard( self ) cardfound=False
bd906620dedf29f1dd4a18dfc01ad590122ac8b1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3537/bd906620dedf29f1dd4a18dfc01ad590122ac8b1/PCSCCardRequest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2529, 1884, 3327, 12, 365, 262, 30, 3536, 5480, 364, 5270, 12626, 471, 1135, 279, 5270, 1156, 12123, 4115, 6415, 691, 18, 7048, 1884, 3327, 12, 365, 262, 5270, 7015, 33, 8381, 2, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2529, 1884, 3327, 12, 365, 262, 30, 3536, 5480, 364, 5270, 12626, 471, 1135, 279, 5270, 1156, 12123, 4115, 6415, 691, 18, 7048, 1884, 3327, 12, 365, 262, 5270, 7015, 33, 8381, 2, -100, ...
sage: from sage.misc.preparser import preparse sage: preparse("R.<x> = ZZ['x']") "R = ZZ['x']; (x,) = R._first_ngens(Integer(1))" sage: preparse("R.<x> = ZZ['y']") "R = ZZ['y']; (x,) = R._first_ngens(Integer(1))" sage: preparse("R.<x,y> = ZZ[]") "R = ZZ['x, y']; (x, y,) = R._first_ngens(Integer(2))" sage: preparse("R.<x,y> = ZZ['u,v']") "R = ZZ['u,v']; (x, y,) = R._first_ngens(Integer(2))" sage: preparse("K.<a> = QQ[2^(1/3)]") 'K = QQ[Integer(2)**(Integer(1)/Integer(3))]; (a,) = K._first_ngens(Integer(1))' sage: preparse("K.<a, b> = QQ[2^(1/3), 2^(1/2)]") 'K = QQ[Integer(2)**(Integer(1)/Integer(3)), Integer(2)**(Integer(1)/Integer(2))]; (a, b,) = K._first_ngens(Integer(2))'
def preparse(line, reset=True, do_time=False, ignore_prompts=False): r""" sage: from sage.misc.preparser import preparse sage: preparse("R.<x> = ZZ['x']") "R = ZZ['x']; (x,) = R._first_ngens(Integer(1))" sage: preparse("R.<x> = ZZ['y']") "R = ZZ['y']; (x,) = R._first_ngens(Integer(1))" sage: preparse("R.<x,y> = ZZ[]") "R = ZZ['x, y']; (x, y,) = R._first_ngens(Integer(2))" sage: preparse("R.<x,y> = ZZ['u,v']") "R = ZZ['u,v']; (x, y,) = R._first_ngens(Integer(2))" sage: preparse("K.<a> = QQ[2^(1/3)]") 'K = QQ[Integer(2)**(Integer(1)/Integer(3))]; (a,) = K._first_ngens(Integer(1))' sage: preparse("K.<a, b> = QQ[2^(1/3), 2^(1/2)]") 'K = QQ[Integer(2)**(Integer(1)/Integer(3)), Integer(2)**(Integer(1)/Integer(2))]; (a, b,) = K._first_ngens(Integer(2))' """ try: # [1,2,..,n] notation L, literals = strip_string_literals(line) L = parse_ellipsis(L, preparse_step=False) line = L % literals except SyntaxError: pass # find where the parens are for function assignment notation oparen_index = -1 cparen_index = -1 # for caclulus function notation: paren_level = 0 first_eq_index = -1 global in_single_quote, in_double_quote, in_triple_quote line = line.rstrip() # xreadlines leaves the '\n' at end of line L = line.lstrip() if len(L) > 0 and L[0] in ['#', '!']: return line if L.startswith('...'): i = line.find('...') return line[:i+3] + preparse(line[i+3:], reset=reset, do_time=do_time, ignore_prompts=ignore_prompts) # Wrap integers with ZZ() and reals with RR(). def wrap_num(i, line, is_real, num_start): zz = line[num_start:i] if is_real or '.' in zz: if zz[-1] == '.' and i < len(line) and line[i].isalpha(): # by popular demand -- this allows, e.g., 173.sqrt(). if '.' in zz[:-1]: O = "RealNumber('"; C="')." else: O = "Integer("; C = ")." zz = zz[:-1] else: O = "RealNumber('"; C="')" else: O = "Integer("; C = ")" line = line[:num_start] + O + zz + C + line[i:] return line, len(O+C) i = 0 num_start = -1 in_number = False is_real = False in_args = False if reset: in_single_quote = False in_double_quote = False in_triple_quote = False if ignore_prompts: # Get rid of leading sage: and >>> so that pasting of examples from # the documentation works. line = strip_prompts(line) while i < len(line): # Update quote parsing if line[i] == "'": if not in_quote(): in_single_quote = True i += 1 continue elif in_single_quote: in_single_quote = False i += 1 continue elif line[i:i+3] == '"""': if not in_quote(): in_triple_quote = True i += 3 continue elif in_triple_quote: in_triple_quote = False i += 3 continue elif line[i] == '"': if not in_quote(): in_double_quote = True i += 1 continue elif in_double_quote: in_double_quote = False i += 1 continue # Decide if we should wrap a particular integer or real literal if in_number: if line[i] == ".": is_real = True elif not line[i].isdigit(): # end of a number # Do we wrap? if in_quote(): # do not wrap pass elif i < len(line) and line[i] in 'eE': # Yes, in scientific notation, so will wrap later is_real = True i += 1 if i < len(line) and line[i] == '-': i += 2 continue elif i < len(line) and line[i] in 'rR': # Raw number so do not wrap; but have to get rid of the "r". line = line[:i] + line[i+1:] else: line, n = wrap_num(i, line, is_real, num_start) i += n in_number = False is_real = False continue elif line[i] == ";" and not in_quote(): line = line[:i+1] + preparse(line[i+1:], reset, do_time, ignore_prompts) i = len(line) continue # Support for generator construction syntax: # "obj.<gen0,gen1,...,genN> = objConstructor(...)" # is converted into # "obj = objConstructor(..., names=("gen0", "gen1", ..., "genN")); \ # (gen0, gen1, ..., genN,) = obj.gens()" # # Also, obj.<gen0,gen1,...,genN> = R[...] is converted into # "obj = R['gen0,gen1,..., genN']; (gen0, gen1, ..., genN,) = obj.gens()" # # LIMITATIONS: # - The entire constructor *must* be on one line. # # AUTHORS: # -- 2006-04-14: Joe Wetherell (jlwether@alum.mit.edu) # -- 2006-04-17: William Stein - improvements to allow multiple statements. # -- 2006-05-01: William -- fix bug that Joe found # -- 2006-10-31: William -- fix so obj doesn't have to be mutated elif (line[i:i+2] == ".<") and not in_quote(): try: gen_end = line.index(">", i+2) except ValueError: # Syntax Error -- let Python notice and raise the error i += 2 continue gen_begin = i while gen_begin > 0 and line[gen_begin-1] != ';': gen_begin -= 1 # parse out the object name and the list of generator names gen_obj = line[gen_begin:i].strip() gen_list = [s.strip() for s in line[i+2:gen_end].split(',')] for g in gen_list: if (not g.isalnum() and not g.replace("_","").isalnum()) or len(g) == 0 or not g[0].isalpha(): raise SyntaxError, "variable name (='%s') must be alpha-numeric and begin with a letter"%g # format names as a list of strings and a list of variables gen_names = tuple(gen_list) gen_vars = ", ".join(gen_list) # find end of constructor: # either end of line, next semicolon, or next #. line_after = line[gen_end:] c = line_after.find('#') if c==-1: c = len(line_after) s = line_after.find(';') if s==-1: s = len(line_after) c = min(c,s) + gen_end # Find where the parenthesis of the constructor ends if line[:c].rstrip()[-1] == ']': # brackets constructor c0 = line[:c].find(']') d0 = line[:c0].rfind('[') if c0 == -1: raise SyntaxError, 'constructor must end with ) or ]' in_square_brackets = line[d0+1:c0] if in_square_brackets.strip() == '': # as a convenience to the user, 'K.<a> = ZZ[]' -> 'K.<a> = ZZ["a"]' in_square_brackets = "'%s'" % gen_vars line_new = '%s%s%s; (%s,) = %s._first_ngens(%s)'%( line[:i] + line[gen_end+1:d0+1], in_square_brackets, line[c0:c], gen_vars, gen_obj, gen_vars.count(',')+1) else: c0 = line[:c].rfind(')') # General constructor -- rewrite the input line as two commands # We have to determine whether or not to put a comma before # the list of names. We do this only if there are already # arguments to the constructor. Some constructors have no # arguments, e.g., "K.<a> = f.root_field( )" c1 = line[:c0].rfind('(') if len(line[c1+1:c0].strip()) > 0: sep = ',' else: sep = '' line_new = '%s%snames=%s); (%s,) = %s._first_ngens(%s)'%( line[:i] + line[gen_end+1:c0], sep, gen_names, gen_vars, gen_obj, gen_vars.count(',')+1) line = line_new + line[c:] #i = len(line_new) i += 1 continue # Support for calculus-like function assignment, the line # "f(x,y,z) = sin(x^3 - 4*y) + y^x" # gets turnd into # "f = SR(sin(x^3 - 4*y) + y^x).function(x,y,z)" # AUTHORS: # - Bobby Moretti: initial version - 02/2007 # - William Stein: make variables become defined if they aren't already defined. elif (line[i] == "(") and not in_quote(): paren_level += 1 # we need to make sure that this is the first open paren we find if oparen_index == -1: oparen_index = i i += 1 continue elif (line[i] == ")") and not in_quote(): cparen_index = i paren_level -= 1 i += 1 continue elif (line[i] == "=") and paren_level == 0 and not in_quote(): if first_eq_index == -1: first_eq_index = i eq = i if cparen_index == -1: i += 1 continue # make sure the '=' sign is on its own, reprsenting assignment eq_chars = ["=", "!", ">", "<", "+", "-", "*", "/", "^"] if eq+1 < len(line) and (line[eq-1] in eq_chars or line[eq+1] in eq_chars): i += 1 continue line_before = line[:oparen_index].strip() if line_before == "" or not line_before.isalnum(): i += 1 continue if eq != first_eq_index: i += 1 continue vars_end = cparen_index vars_begin = oparen_index+1 # figure out where the line ends line_after = line[vars_end+1:] try: a = line.index("#") except ValueError: a = len(line) try: b = line.index(";") except ValueError: b = len(line) a = min(a,b) vars = line[vars_begin:vars_end].split(",") vars = [v.strip() for v in vars] b = [] # construct the parsed line k = line[:vars_begin-1].rfind(';') if k == -1: k = len(line) - len(line.lstrip()) b.append(line[:k]) b.append('_=var("%s");'%(','.join(vars))) b.append(line[k:vars_begin-1]) b.append('=') b.append('symbolic_expression(') b.append(line[eq+1:a].strip()) b.append(').function(') b.append(','.join(vars)) b.append(')') b.append(line[a:]) line = ''.join(b) # i should get set to the position of the first paren after the new # assignment operator n = len(line_before) i = line.find('=', n) + 2 continue # ####### END CALCULUS ######## # exponents can be either ^ or ** elif line[i] == "^" and not in_quote(): line = line[:i] + "**" + line[i+1:] i += 2 continue elif line[i] == "." and i > 0 and i < len(line)-1 and not in_quote() and \ (isalphadigit_(line[i-1]) or line[i-1] == ")" or line[i-1] == ']') and line[i+1].isdigit(): # Generators: replace all ".<number>" by ".gen(<number>)" # If . is preceeded by \, then replace "\." by ".". j = i+1 while j < len(line) and line[j].isdigit(): j += 1 line = line[:i] + ".gen(" + line[i+1:j] + ")" + line[j:] i = j+4 if not in_number and \ not in_quote(): if i < len(line)-1 and line[i] == '\\': j = i+1 while j < len(line) and line[j].isspace(): j += 1 while j < len(line) and not line[j] in '*/;:\\#\'"': j += 1 line = line[:i] + "._backslash_(" + line[i+1:j] + ')' + line[j:] elif (line[i].isdigit() or \ (len(line)>i+1 and line[i] == '.' and line[i+1].isdigit())) and \ (i == 0 or (i > 0 and not (isalphadigit_(line[i-1]) \ or line[i-1] == ')'))): in_number = True num_start = i # Decide if we hit a comment, so we're done. if line[i] == '#' and not (in_single_quote or in_double_quote or in_triple_quote): i = len(line) break i += 1 if in_number: line, _ = wrap_num(i, line, is_real, num_start) # Time command like in MAGMA: (commented out, since it's standard in IPython now) L = line.lstrip() if do_time: if L[:5] == "time ": # strip semicolon from end of line if line[-1:] == ";": line = line[:-1] indent = ' '*(len(line) - len(L)) line = indent + '__time__=misc.cputime(); __wall__=misc.walltime(); %s; print \ "Time: CPU %%.2f s, Wall: %%.2f s"%%(misc.cputime(__time__), misc.walltime(__wall__))'%L[4:] return line
cf09301fa857850ed335f942676ba3db235b1226 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/cf09301fa857850ed335f942676ba3db235b1226/preparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 675, 2670, 12, 1369, 16, 2715, 33, 5510, 16, 741, 67, 957, 33, 8381, 16, 2305, 67, 17401, 1092, 33, 8381, 4672, 436, 8395, 3536, 775, 30, 468, 306, 21, 16, 22, 16, 838, 16, 82, 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, 675, 2670, 12, 1369, 16, 2715, 33, 5510, 16, 741, 67, 957, 33, 8381, 16, 2305, 67, 17401, 1092, 33, 8381, 4672, 436, 8395, 3536, 775, 30, 468, 306, 21, 16, 22, 16, 838, 16, 82, 65,...
backgroundSubtractedExposure = exposure.Factory(exposure, exposure.getMaskedImage().getBBox(), true)
maskedImage = exposure.getMaskedImage() bbox = afwImg.BBox(maskedImage.getXY0(), maskedImage.getWidth(), maskedImage.getHeight()) backgroundSubtractedExposure = exposure.Factory(exposure, bbox, true)
def estimateBackground(exposure, backgroundPolicy, subtract=True): """Estimate exposure's background using parameters in backgroundPolicy. If subtract is true, make a copy of the exposure and subtract the background. Return background, backgroundSubtractedExposure""" backgroundSubtractedExposure = exposure.Factory(exposure, exposure.getMaskedImage().getBBox(), true) image = exposure.getMaskedImage().getImage() background = getBackground(image, backgroundPolicy) del image if not background: raise RuntimeError, "Unable to estimate background for exposure" if not subtract: return background, None copyImage = backgroundSubtractedExposure.getMaskedImage().getImage() copyImage -= background.getImageF() del copyImage return background, backgroundSubtractedExposure
fec080f54dbacecfc7c862ca65fb75f947ed2bc1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6523/fec080f54dbacecfc7c862ca65fb75f947ed2bc1/sourceDetection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11108, 8199, 12, 22739, 16, 5412, 2582, 16, 10418, 33, 5510, 4672, 3536, 13638, 14620, 1807, 5412, 1450, 1472, 316, 5412, 2582, 18, 225, 971, 10418, 353, 638, 16, 1221, 279, 1610, 434, 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, 11108, 8199, 12, 22739, 16, 5412, 2582, 16, 10418, 33, 5510, 4672, 3536, 13638, 14620, 1807, 5412, 1450, 1472, 316, 5412, 2582, 18, 225, 971, 10418, 353, 638, 16, 1221, 279, 1610, 434, 3...
return S_OK({'Successful':successful,'Failed':failed}) def setFileMode(self,lfns,connection=False): connection = self._getConnection(connection)
return S_OK( {'Successful':successful, 'Failed':failed} ) def setFileMode( self, lfns, connection = False ): connection = self._getConnection( connection )
def setFileOwner(self,lfns,connection=False): connection = self._getConnection(connection) """ Get set the group for the supplied files """ res = self._findFiles(lfns,['FileID','UID'],connection=connection) if not res['OK']: return res failed = res['Value']['Failed'] successful = {} for lfn in res['Value']['Successful'].keys(): owner = lfns[lfn]['Owner'] if type(owner) in StringTypes: userRes = self.db.ugManager.findUser(owner) if not userRes['OK']: return userRes owner = userRes['Value'] currentOwner = res['Value']['Successful'][lfn]['UID'] if int(owner) == int(currentOwner): successful[lfn] = True else: fileID = res['Value']['Successful'][lfn]['FileID'] res = self._setFileOwner(fileID,owner,connection=connection) if not res['OK']: failed[lfn] = res['Message'] else: successful[lfn] = True return S_OK({'Successful':successful,'Failed':failed})
26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19658, 5541, 12, 2890, 16, 20850, 2387, 16, 4071, 33, 8381, 4672, 1459, 273, 365, 6315, 588, 1952, 12, 4071, 13, 3536, 968, 444, 326, 1041, 364, 326, 4580, 1390, 3536, 400, 273, 365, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19658, 5541, 12, 2890, 16, 20850, 2387, 16, 4071, 33, 8381, 4672, 1459, 273, 365, 6315, 588, 1952, 12, 4071, 13, 3536, 968, 444, 326, 1041, 364, 326, 4580, 1390, 3536, 400, 273, 365, 6...
for i in range(NEVENTS):
for i_unused in range(NEVENTS):
def __init__(self): self.options = None # Game options self.state = snapshot() # A snapshot structure self.snapsht = snapshot() # Last snapshot taken for time-travel purposes self.quad = None # contents of our quadrant self.damage = [0.0] * NDEVICES # damage encountered self.future = [] # future events for i in range(NEVENTS): self.future.append(event()) self.passwd = None; # Self Destruct password self.enemies = [] self.quadrant = None # where we are in the large self.sector = None # where we are in the small self.tholian = None # Tholian enemy object self.base = None # position of base in current quadrant self.battle = None # base coordinates being attacked self.plnet = None # location of planet in quadrant self.gamewon = False # Finished! self.ididit = False # action taken -- allows enemy to attack self.alive = False # we are alive (not killed) self.justin = False # just entered quadrant self.shldup = False # shields are up self.shldchg = False # shield is changing (affects efficiency) self.iscate = False # super commander is here self.ientesc = False # attempted escape from supercommander self.resting = False # rest time self.icraft = False # Kirk in Galileo self.landed = False # party on planet (true), on ship (false) self.alldone = False # game is now finished self.neutz = False # Romulan Neutral Zone self.isarmed = False # probe is armed self.inorbit = False # orbiting a planet self.imine = False # mining self.icrystl = False # dilithium crystals aboard self.iseenit = False # seen base attack report self.thawed = False # thawed game self.condition = None # "green", "yellow", "red", "docked", "dead" self.iscraft = None # "onship", "offship", "removed" self.skill = None # Player skill level self.inkling = 0 # initial number of klingons self.inbase = 0 # initial number of bases self.incom = 0 # initial number of commanders self.inscom = 0 # initial number of commanders self.inrom = 0 # initial number of commanders self.instar = 0 # initial stars self.intorps = 0 # initial/max torpedoes self.torps = 0 # number of torpedoes self.ship = 0 # ship type -- 'E' is Enterprise self.abandoned = 0 # count of crew abandoned in space self.length = 0 # length of game self.klhere = 0 # klingons here self.casual = 0 # causalties self.nhelp = 0 # calls for help self.nkinks = 0 # count of energy-barrier crossings self.iplnet = None # planet # in quadrant self.inplan = 0 # initial planets self.irhere = 0 # Romulans in quadrant self.isatb = 0 # =2 if super commander is attacking base self.tourn = None # tournament number self.nprobes = 0 # number of probes available self.inresor = 0.0 # initial resources self.intime = 0.0 # initial time self.inenrg = 0.0 # initial/max energy self.inshld = 0.0 # initial/max shield self.inlsr = 0.0 # initial life support resources self.indate = 0.0 # initial date self.energy = 0.0 # energy level self.shield = 0.0 # shield level self.warpfac = 0.0 # warp speed self.lsupres = 0.0 # life support reserves self.optime = 0.0 # time taken by current operation self.damfac = 0.0 # damage factor self.lastchart = 0.0 # time star chart was last updated self.cryprob = 0.0 # probability that crystal will work self.probe = None # object holding probe course info self.height = 0.0 # height of orbit around planet
eafdd35f1af1e4e93d3609a0adbe768b562907e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3176/eafdd35f1af1e4e93d3609a0adbe768b562907e0/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 365, 18, 2116, 273, 599, 202, 7, 14121, 702, 365, 18, 2019, 273, 4439, 1435, 202, 7, 432, 4439, 3695, 365, 18, 28449, 87, 647, 273, 4439, 1435, 202, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4672, 365, 18, 2116, 273, 599, 202, 7, 14121, 702, 365, 18, 2019, 273, 4439, 1435, 202, 7, 432, 4439, 3695, 365, 18, 28449, 87, 647, 273, 4439, 1435, 202, ...
TR( contents = [
TR( contents = [
def makePage( _T, _N, _M, MIRRORS_DATA, lang, charset ): navigation = Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['home'], href=makeURL( '.', lang ))] ), Tree \ ( [ P ( contents = [ Img( src = '%(ROOT)simages/englishlogo.png', width = 16, height = 10), A( 'English', href='%(BASE)s.' )]), P ( contents = [ Img( src = '%(ROOT)simages/germanylogo.png', width = 16, height = 10), A( 'Deutsch', href='%(BASE)sde/' )]), P ( contents = [ Img( src = '%(ROOT)simages/greecelogo.png', width = 16, height = 10), A( '&#917;&#955;&#955;&#951;&#965;&#953;&#954;&#940;', href='%(BASE)sel/' )]), P ( contents = [ Img( src = '%(ROOT)simages/francelogo.png', width = 16, height = 10), A( 'Fran&#231;ais', href='%(BASE)sfr/' )]), P ( contents = [ Img( src = '%(ROOT)simages/italylogo.png', width = 16, height = 10), A( 'Italiano', href='%(BASE)sit/' )]), P ( contents = [ Img( src = '%(ROOT)simages/netherlandslogo.png', width = 16, height = 10), A( 'Nederlands', href='%(BASE)snl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/polandlogo.png', width = 16, height = 10), A( 'Polski', href='%(BASE)spl/' )]), P ( contents = [ Img( src = '%(ROOT)simages/portugallogo.png', width = 16, height = 10), A( 'Portugu&#234;s', href='%(BASE)spt/' )]), P ( contents = [ Img( src = '%(ROOT)simages/russialogo.png', width = 16, height = 10), A( '&#1056;&#1091;&#1089;&#1089;&#1082;&#1080;&#1081;', href='%(BASE)sru/' )]), P ( contents = [ Img( src = '%(ROOT)simages/spanishlogo.png', width = 16, height = 10), A( 'Espa&#241ol', href='%(BASE)ses/' )]), P ( contents = [ Img( src = '%(ROOT)simages/finlandlogo.png', width = 16, height = 10), A( 'Suomi', href='%(BASE)sfi/' )]), P ( contents = [ Img( src = '%(ROOT)simages/swedenlogo.png', width = 16, height = 10), A( 'Svenska', href='%(BASE)ssv/' )]), P ( contents = [ Img( src = '%(ROOT)simages/czechlogo.png', width = 16, height = 10), A( '&#268;esky', href='%(BASE)scs/' )]) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['news'], href=makeURL( 'news/', lang ) )]), Tree ( A( _N['archive'], href=makeURL( 'news/archive/', lang ) ) ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['introduction'], href=makeURL( 'introduction/', lang ) ) ]), Tree \ ( [ #A( _N['status'], href=makeURL('introduction/status/everything.html' ), A( _N['screenshots'], href=makeURL( 'pictures/screenshots/', lang) ), A( _N['ports'], href=makeURL( 'introduction/ports', lang ) ), A( _N['license'], href='%(BASE)slicense.html' ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['download'], href=makeURL( 'download', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['documentation'] ]), Tree \ ( [ A( _N['users'], href=makeURL( 'documentation/users/', lang ) ), Tree \ ( [ A( _N['installation'], href=makeURL( 'documentation/users/installation', lang ) ), A( _N['using'], href=makeURL( 'documentation/users/using', lang ) ), A( _N['shell'], href=makeURL( 'documentation/users/shell/index', lang ) ), A( _N['applications'], href=makeURL( 'documentation/users/applications/index', lang ) ), A( _N['faq'], href=makeURL( 'documentation/users/faq', lang ) ), #_N['ports'], #A( _N['links'], href=makeURL( 'documentation/users/links', lang ) ) ] ), A( _N['developers'], href=makeURL( 'documentation/developers/index', lang ) ), Tree \ ( [ A( _N['contribute'], href=makeURL( 'documentation/developers/contribute', lang ) ), A( 'Roadmap', href=makeURL( 'documentation/developers/roadmap', lang ) ), A( _N['bug-tracker'], href='http://sourceforge.net/tracker/?atid=439463&group_id=43586&func=browse' ), A( _N['working-with-subversion'], href=makeURL( 'documentation/developers/svn', lang ) ), A( _N['compiling'], href=makeURL( 'documentation/developers/compiling', lang ) ), A( _N['application-development-manual'], href=makeURL( 'documentation/developers/app-dev/index', lang ) ), A( _N['zune-application-development-manual'], href=makeURL( 'documentation/developers/zune-application-development', lang ) ), A( _N['system-development-manual'], href=makeURL( 'documentation/developers/system-development', lang ) ), A( _N['debugging-manual'], href=makeURL( 'documentation/developers/debugging', lang ) ), A( _N['reference'], href=makeURL( 'documentation/developers/autodocs/index', lang ) ), A( _N['specifications'], href=makeURL( 'documentation/developers/specifications/', lang ) ), A( _N['ui-style-guide'], href=makeURL( 'documentation/developers/ui', lang ) ), A( _N['documenting'], href=makeURL( 'documentation/developers/documenting', lang ) ), A( _N['porting'], href=makeURL( 'documentation/developers/porting', lang ) ), A( _N['translating'], href=makeURL( 'documentation/developers/translating', lang ) ), A( _N['summaries'], href=makeURL( 'documentation/developers/summaries/', lang ) ), A( _N['links'], href=makeURL( 'documentation/developers/links', lang ) ) ] ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['contact'], href=makeURL( 'contact', lang ) )]), Tree \ ( [ A( _N['mailing-lists'], href=makeURL( 'contact', lang, 'mailing-lists' ) ), #A( _N['forums'], href=makeURL( 'contact', lang, 'forums' ) ), A( _N['irc-channels'], href=makeURL( 'contact', lang, 'irc-channels' ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['credits'], href=makeURL( 'credits', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( 'Acknowledgements', href=makeURL( 'acknowledgements', lang ) )]), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), _N['pictures']]), Tree \ ( [ A( _N['developers'], href=makeURL( 'pictures/developers/', lang ) ), A( _N['developers-together'], href=makeURL( 'pictures/developers-together/', lang ) ) ] ), BR(), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['sponsors'], href=makeURL( 'sponsors', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['linking'], href=makeURL( 'linking', lang ) )]), P ( contents = [ Img( src = '%(ROOT)simages/pointer.png' ), A( _N['links'], href=makeURL( 'links', lang ) )]) ] ) counter = Img( src = 'http://www.hepe.com/cgi-bin/wwwcount.cgi?df=aros.dat&dd=E&ft=0' ) sponsors = Table\ ( cellspacing = 5, cellpadding = 0, contents = [ TR ( TD ( A ( Img( src = '%(ROOT)simages/trustec-small.png', border = 0 ), href = 'http://www.trustsec.de/' ) ) ), TR ( TD ( A ( Img( src = '%(ROOT)simages/genesi-small.gif', border = 0 ), href = 'http://www.pegasosppc.com/' ) ) ), TR ( TD ( A \ ( Img \ ( src = 'http://sflogo.sourceforge.net/sflogo.php?group_id=43586&type=1', width = 88, height = 31, border = 0, alt = 'SourceForge Logo' ), href = 'http://sourceforge.net/' ) ) ) ] ) bar = Table( border = 0, cellpadding = 2, cellspacing = 2, width = 171, valign = 'top', contents = [ TR( valign = 'top', contents = [ TD( rowspan = 8, width=15 ), TD() ] ), TR( valign = 'top', contents = TD( navigation ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = counter ) ), TR( TD(), height=15 ), TR( valign = 'top', contents = TD( align = 'center', contents = sponsors ) ), TR( TD(), height=30 ), TR \ ( valign = 'top', contents = TD \ ( align = 'center', contents = A \ ( Img \ ( src = '%(ROOT)simages/noeupatents-small.png', border = 0 ), href = 'http://petition.eurolinux.org/' ) ) ) ] ) statsPHP = ''' <?php //define("_BBC_PAGE_NAME", "my page title"); define("_BBCLONE_DIR", "%(ROOT)smybbclone/"); define("COUNTER", _BBCLONE_DIR."index.php"); if (file_exists(COUNTER)) include_once(COUNTER); ?> ''' statsPHP2 = ''' <?php echo date("m.d.y"); ?> ''' statsPHP3 = ''' <?php echo "<map name=\\"map\\">"; echo "<area shape=\\"rect\\" coords=\\"11,80,82,95\\" alt=\\"http://www.aros.org\\" href=\\"http://www.aros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"87,78,165,95\\" alt=\\"AROS-Exec\\" href=\\"http://www.aros-exec.org\\">"; echo "<area shape=\\"rect\\" coords=\\"244,77,323,95166,77,240,95\\" alt=\\"Team AROS\\" href=\\"http://www.teamaros.org\\">"; echo "<area shape=\\"rect\\" coords=\\"166,77,240,95\\" alt=\\"AROS-Exec Archives\\" href=\\"http://archives.aros-exec.org\\">"; echo "</map>"; ?> ''' statsPHP4 = ''' <?php echo "<table width=\\"100%%\\"><tr><td>"; echo "<div style=\\"text-align: right;\\">"; echo "<font color=\\"#aaaaaa\\">"; ?> ''' statsPHP6 = ''' <?php echo "</font></div>"; echo "</p></tr></td></table>"; ?> ''' statsPHP5= ''' <?php include( '/home/groups/a/ar/aros/htdocs/rsfeed/browserdetect.php'); $win_ie56 = (browser_detection('browser') == 'ie' ) && (browser_detection('number') >= 5 ) && (browser_detection('number') < 7 ); if ($win_ie56) { echo \"<img src=\\"/images/kittymascot.gif\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.gif\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } else { echo \"<img src=\\"/images/kittymascot.png\\" style=\\"float:right\\" border=\\"0\\"></img><img src=\\"/images/toplogomenu.png\\" border=\\"0\\" usemap=\\"#map\\"></img>"; } ?> ''' page = HTML( [ Head( [ Charset( charset ), Title( 'AROS Research Operating System' ), Link( href = '%(ROOT)saros.css', type = 'text/css', rel = 'stylesheet' ), Meta( name = 'keywords', content = 'AROS, OS, operating system, research, open source, portage' ) ] ), Body( style = 'margin: 0px;', bgcolor = '#ffffff', contents = [ statsPHP3, Table( border = 0, cellspacing = 0, cellpadding = 0, width = '100%%', contents = [ TR( [ TD( halign = 'top', width = '100%%', height = 109, background='%(ROOT)simages/backgroundtop.png' ,rowspan = 4, contents = statsPHP5)
6f57d571cb5a191a538d1b271f46a3e100233a4d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4747/6f57d571cb5a191a538d1b271f46a3e100233a4d/page.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1964, 12, 389, 56, 16, 389, 50, 16, 389, 49, 16, 490, 7937, 2784, 55, 67, 4883, 16, 3303, 16, 4856, 262, 30, 10394, 273, 4902, 521, 261, 306, 453, 261, 2939, 273, 306, 2221, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 1964, 12, 389, 56, 16, 389, 50, 16, 389, 49, 16, 490, 7937, 2784, 55, 67, 4883, 16, 3303, 16, 4856, 262, 30, 10394, 273, 4902, 521, 261, 306, 453, 261, 2939, 273, 306, 2221, ...
p_url = '/admin/product/product/%s/' % product.pk pv_url = '/admin/product/productvariation/%s/delete/' % product.pk
p_url = reverse_admin_url(Product, 'change', args=(product.pk,)) pv_url = reverse_admin_url(ProductVariation, 'delete', args=(product.pk,))
def list_variations(configurableproduct): opts = configurableproduct.get_all_options() output = "{% load admin_modify adminmedia %}" output += "<table>" for p_opt in opts: opt_strs = [] [opt_strs.append(opt.name) for opt in p_opt] opt_str = ', '.join(opt_strs) product = configurableproduct.get_product_from_options(p_opt) if product: p_url = '/admin/product/product/%s/' % product.pk pv_url = '/admin/product/productvariation/%s/delete/' % product.pk output += """ <tr> <td>%s</td> <td><a href="%s">%s</a></td> <td><a class="deletelink" href="%s">%s</a></td> </tr> """ % (opt_str, p_url, product.slug, pv_url, _("Delete ProductVariation")) else: #opt_pks = [str(opt.pk) for opt in p_opt] #opt_pks = ','.join(opt_pks) # TODO [NFA]: Blocked by Django ticket #7738. opt_pks = '' add_url = '/admin/product/productvariation/add/' + \ "?product=%s&parent=%s&options=%s" % ( configurableproduct.product.pk, configurableproduct.product.pk, opt_pks) output += """ <tr> <td>%s</td> <td/> <td><a href="%s" class="add-another" id="add_productvariation"> <img src="{%% admin_media_prefix %%}img/admin/icon_addlink.gif" width="10" height="10" alt="Add ProductVariation"/> Add Variation</a></td> </tr> """ % (opt_str, add_url) output += "</table>" t = Template(output) return t.render(Context())
d5511ada1d2012a751b78b5b036cd931c9b31d80 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/171/d5511ada1d2012a751b78b5b036cd931c9b31d80/satchmo_product_admin.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 4093, 1012, 12, 1425, 7463, 5896, 4672, 1500, 273, 14593, 5896, 18, 588, 67, 454, 67, 2116, 1435, 876, 273, 4144, 9, 1262, 3981, 67, 17042, 3981, 5829, 738, 1532, 876, 1011, 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, 666, 67, 4093, 1012, 12, 1425, 7463, 5896, 4672, 1500, 273, 14593, 5896, 18, 588, 67, 454, 67, 2116, 1435, 876, 273, 4144, 9, 1262, 3981, 67, 17042, 3981, 5829, 738, 1532, 876, 1011, 3...
p = pool.QueuePool(creator=mock_dbapi.connect, pool_size=3,
p = self._queuepool_fixture(pool_size=3,
def test_trick_the_counter(self): """this is a "flaw" in the connection pool; since threadlocal uses a single ConnectionFairy per thread with an open/close counter, you can fool the counter into giving you a ConnectionFairy with an ambiguous counter. i.e. its not true reference counting."""
7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/7513b46730d1b57a6b8addde8dfb4f83ee1e6cb4/test_pool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 313, 1200, 67, 5787, 67, 7476, 12, 2890, 4672, 3536, 2211, 353, 279, 315, 2242, 2219, 6, 316, 326, 1459, 2845, 31, 3241, 2650, 3729, 4692, 279, 2202, 4050, 42, 1826, 93, 1534...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 313, 1200, 67, 5787, 67, 7476, 12, 2890, 4672, 3536, 2211, 353, 279, 315, 2242, 2219, 6, 316, 326, 1459, 2845, 31, 3241, 2650, 3729, 4692, 279, 2202, 4050, 42, 1826, 93, 1534...
z3cfile = z3c.pt.PageTemplateFile(
z3cfile = pagetemplate.PageTemplateFile(
def testBigTablePathFile(self): table = self.table
0362910487a742f6f9bbfbad6694fa0f51c35813 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9696/0362910487a742f6f9bbfbad6694fa0f51c35813/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 9901, 1388, 743, 812, 12, 2890, 4672, 1014, 273, 365, 18, 2121, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1842, 9901, 1388, 743, 812, 12, 2890, 4672, 1014, 273, 365, 18, 2121, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print result.keys()
def get_campaign_purchase_line_ids(self , cr, uid, ids, context): result = {}
d33b01638b25348f4ae35965351a308e159b193b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/d33b01638b25348f4ae35965351a308e159b193b/dm_purchase_advanced.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 14608, 67, 12688, 12104, 67, 1369, 67, 2232, 12, 2890, 269, 4422, 16, 4555, 16, 3258, 16, 819, 4672, 563, 273, 2618, 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, 336, 67, 14608, 67, 12688, 12104, 67, 1369, 67, 2232, 12, 2890, 269, 4422, 16, 4555, 16, 3258, 16, 819, 4672, 563, 273, 2618, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
msg += wrap('pattern: %s' % pattern)
if pattern: msg += wrap('pattern: %s' % pattern)
def email_notify(alert, records, argstr): global FROMADDR global ALERTURL global DEBUGLEVEL global DEVELOPERADDR if len(records) == 0: return msg = "" if DEBUGLEVEL > 0: msg = "*** THIS MESSAGE WAS SENT IN DEBUG MODE, DON'T TAKE IT INTO ACCOUNT ***\n\n" msg += "Hello\n\n" msg += wrap("Below are the results of the email alert that you set up with the CERN Document Server. This is an automatic message, please don't reply to its address. For any question, use <%s> instead." % supportemail) email = get_email(alert[0]) url = weburl + "/search.py?" + argstr pattern = get_pattern(argstr) catalogue = get_catalogue(argstr) catword = 'collection' if get_catalogue_num(argstr) > 1: catword += 's' time = strftime("%d-%m-%Y") msg += '\n' + wrap('alert name: %s' % alert[5]) msg += wrap('pattern: %s' % pattern) if catalogue: msg += wrap('%s: %s' % (catword, catalogue)) msg += wrap('frequency: %s ' % format_frequency(alert[3])) msg += wrap('run time: %s ' % strftime("%a %d-%m-%Y %H:%M:%S")) recword = 'record' if len(records) > 1: recword += 's' msg += wrap('found: %s %s' % (len(records), recword)) msg += "url: <%s/search.py?%s>\n" % (weburl, argstr) msg += wrap_records(print_records(records)) msg += "\n-- \nCERN Document Server Alert Service <%s>\nUnsubscribe? See <%s>\nNeed human intervention? Contact <%s>" % (weburl, ALERTURL, supportemail) subject = 'Alert %s run on %s' % (alert[5], time) body = forge_email(FROMADDR, email, subject, msg) if DEBUGLEVEL > 0: print "********************************************************************************" print body print "********************************************************************************" if DEBUGLEVEL < 2: send_email(FROMADDR, email, body) if DEBUGLEVEL == 4: for a in DEVELOPERADDR: send_email(FROMADDR, a, body)
ccffb769787c8a50f3c580a7cce3916a487c950a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/ccffb769787c8a50f3c580a7cce3916a487c950a/alert_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2699, 67, 12336, 12, 11798, 16, 3853, 16, 833, 313, 4672, 2552, 4571, 14142, 2552, 7981, 11539, 1785, 2552, 6369, 10398, 2552, 2030, 24397, 3194, 14142, 225, 309, 562, 12, 7094, 13, 422, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2699, 67, 12336, 12, 11798, 16, 3853, 16, 833, 313, 4672, 2552, 4571, 14142, 2552, 7981, 11539, 1785, 2552, 6369, 10398, 2552, 2030, 24397, 3194, 14142, 225, 309, 562, 12, 7094, 13, 422, ...
self.update_(nil)
def fetchItemValues(item): title = item.getTitle() feedTitle = item.getFeed().getTitle() keep = item.showSaveButton() share = item.hasSharableURL() threads.callOnMainThread(finishSetup, title, feedTitle, keep, share) def finishSetup(title, feedTitle, keep, share): self.titleLabel.setStringValue_(title) self.feedLabel.setStringValue_(feedTitle) self.keepButton.setEnabled_(keep) self.shareButton.setEnabled_(share) self.update_(nil) eventloop.addUrgentCall(lambda:fetchItemValues(item), "Fetching item values")
def setup(self, item, renderer): self.playingItem = item self.titleLabel.setStringValue_(unicode(item.getTitle())) self.feedLabel.setStringValue_(unicode(item.getFeed().getTitle())) self.keepButton.setEnabled_(item.showSaveButton()) self.shareButton.setEnabled_(item.hasSharableURL()) self.renderer = renderer self.update_(nil)
1aef0d6dd1087e85f1cb4f16ae4c51b3ae99df1b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12354/1aef0d6dd1087e85f1cb4f16ae4c51b3ae99df1b/VideoDisplay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 16, 761, 16, 5690, 4672, 365, 18, 1601, 310, 1180, 273, 761, 365, 18, 2649, 2224, 18, 542, 19733, 67, 12, 9124, 12, 1726, 18, 588, 4247, 1435, 3719, 365, 18, 7848, 22...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 12, 2890, 16, 761, 16, 5690, 4672, 365, 18, 1601, 310, 1180, 273, 761, 365, 18, 2649, 2224, 18, 542, 19733, 67, 12, 9124, 12, 1726, 18, 588, 4247, 1435, 3719, 365, 18, 7848, 22...
without effecting this threads data:
without affecting this thread's data:
... def squared(self):
349104f3c25913589a248c31691ec7d2190401af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/349104f3c25913589a248c31691ec7d2190401af/_threading_local.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 377, 1652, 21778, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 377, 1652, 21778, 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, -...
'bytes'."""
'bytes'. 'zinfo_or_arcname' is either a ZipInfo instance or the name of the file in the archive.""" if not isinstance(zinfo_or_arcname, ZipInfo): zinfo = ZipInfo(filename=zinfo_or_arcname, date_time=time.localtime(time.time())) zinfo.compress_type = self.compression else: zinfo = zinfo_or_arcname
def writestr(self, zinfo, bytes): """Write a file into the archive. The contents is the string 'bytes'.""" self._writecheck(zinfo) zinfo.file_size = len(bytes) # Uncompressed size zinfo.CRC = binascii.crc32(bytes) # CRC-32 checksum if zinfo.compress_type == ZIP_DEFLATED: co = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15) bytes = co.compress(bytes) + co.flush() zinfo.compress_size = len(bytes) # Compressed size else: zinfo.compress_size = zinfo.file_size zinfo.header_offset = self.fp.tell() # Start of header bytes self.fp.write(zinfo.FileHeader()) zinfo.file_offset = self.fp.tell() # Start of file bytes self.fp.write(bytes) if zinfo.flag_bits & 0x08: # Write CRC and file sizes after the file data self.fp.write(struct.pack("<lll", zinfo.CRC, zinfo.compress_size, zinfo.file_size)) self.filelist.append(zinfo) self.NameToInfo[zinfo.filename] = zinfo
33331e271a17ff37ca21224255394ebde60c9b05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/33331e271a17ff37ca21224255394ebde60c9b05/zipfile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7262, 313, 12, 2890, 16, 998, 1376, 16, 1731, 4672, 3536, 3067, 279, 585, 1368, 326, 5052, 18, 225, 1021, 2939, 353, 326, 533, 296, 3890, 10332, 225, 296, 94, 1376, 67, 280, 67, 11828,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7262, 313, 12, 2890, 16, 998, 1376, 16, 1731, 4672, 3536, 3067, 279, 585, 1368, 326, 5052, 18, 225, 1021, 2939, 353, 326, 533, 296, 3890, 10332, 225, 296, 94, 1376, 67, 280, 67, 11828,...
n = width - len(s) if n <= 0: return s half = n/2 if n%2 and width%2: half = half+1 return ' '*half + s + ' '*(n-half)
return s.center(width)
def center(s, width): """center(s, width) -> string Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. """ n = width - len(s) if n <= 0: return s half = n/2 if n%2 and width%2: # This ensures that center(center(s, i), j) = center(s, j) half = half+1 return ' '*half + s + ' '*(n-half)
4e577568f34ac8283d2070929bf3c3090b3e722f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4e577568f34ac8283d2070929bf3c3090b3e722f/string.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4617, 12, 87, 16, 1835, 4672, 3536, 5693, 12, 87, 16, 1835, 13, 317, 533, 225, 2000, 279, 4617, 1177, 434, 272, 16, 316, 279, 652, 434, 326, 1269, 1835, 18, 14426, 598, 7292, 487, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4617, 12, 87, 16, 1835, 4672, 3536, 5693, 12, 87, 16, 1835, 13, 317, 533, 225, 2000, 279, 4617, 1177, 434, 272, 16, 316, 279, 652, 434, 326, 1269, 1835, 18, 14426, 598, 7292, 487, 35...
def __init__(data = None)
def __init__(data = None):
def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 301) else quickfix.IntField.__init__(self, 301, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 26403, 13, 469, 9549, 904, 18, 1702, 974, 16186, 2738, 972, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 2738, 972, 12, 892, 273, 599, 4672, 309, 501, 422, 599, 30, 9549, 904, 18, 1702, 974, 16186, 2738, 972, 12, 2890, 16, 26403, 13, 469, 9549, 904, 18, 1702, 974, 16186, 2738, 972, ...
" returns module and compiled function "
" returns module and compiled function "
def compile_test(function, annotation, isolate=True, **kwds): " returns module and compiled function " if llvm_test(): if run_isolated_only and not isolate: py.test.skip("skipping not isolated test") # maintain only 3 isolated process (if any) _cleanup(leave=3) optimize = kwds.pop('optimize', optimize_tests) mod, fn = genllvm_compile(function, annotation, optimize=optimize, logging=False, isolate=isolate, **kwds) if isolate: ext_modules.append(mod) return mod, fn
e0c8e4067d13cd5f4b1e95d81f08d37a1be8fe76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/e0c8e4067d13cd5f4b1e95d81f08d37a1be8fe76/runtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 67, 3813, 12, 915, 16, 3204, 16, 30630, 33, 5510, 16, 2826, 25577, 4672, 315, 1135, 1605, 471, 7743, 445, 315, 309, 328, 3070, 81, 67, 3813, 13332, 309, 1086, 67, 291, 30469, 67,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 67, 3813, 12, 915, 16, 3204, 16, 30630, 33, 5510, 16, 2826, 25577, 4672, 315, 1135, 1605, 471, 7743, 445, 315, 309, 328, 3070, 81, 67, 3813, 13332, 309, 1086, 67, 291, 30469, 67,...
p = Integer(p)
if not isinstance(p, Integer): p = Integer(p) if not isinstance(prec, Integer): prec = Integer(prec) if not isinstance(halt, Integer): halt = Integer(halt)
def Zp(p, prec = 20, type = 'capped-rel', print_mode = None, halt = 40, names = None, check=True): """ Return a model of the $p$-adic integer $\Z_p$. INPUT: p -- integer the p in Z_p prec -- integer (default: 20) the precision cap of the ring. Except for the fixed modulus case, individual elements keep track of their own precision. type -- string (default: 'capped-rel') see notes section below for options. print_mode -- string (default: series) the print mode; see notes section below for options. halt -- integer (default: 40): only applicable for type='lazy' check -- bool (default: True): wether to verify that the input is valid. OUTPUT: the corresponding p-adic ring EXAMPLES: We create rings with various parameters sage: Zp(7) 7-adic Ring with capped relative precision 20 sage: Zp(9) Traceback (most recent call last): ... ValueError: p must be prime sage: Zp(17, 5) 17-adic Ring with capped relative precision 5 sage: Zp(17, 5)(-1) 16 + 16*17 + 16*17^2 + 16*17^3 + 16*17^4 + O(17^5) It works even with a fairly huge cap: sage: Zp(next_prime(10^50), 100000) 100000000000000000000000000000000000000000000000151-adic Ring with capped relative precision 100000 We create each type of ring: sage: Zp(7, 20, 'capped-rel') 7-adic Ring with capped relative precision 20 sage: Zp(7, 20, 'fixed-mod') 7-adic Ring of fixed modulus 7^20 sage: Zp(7, 20, 'capped-abs') 7-adic Ring with capped absolute precision 20 #sage: Zp(7, 20, 'lazy') #Lazy 7-adic Ring We create a capped relative ring with each print mode: sage: k = Zp(7, 8, print_mode='series'); k 7-adic Ring with capped relative precision 8 sage: k(7*(19)) 5*7 + 2*7^2 + O(7^9) sage: k(7*(-19)) 2*7 + 4*7^2 + 6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + 6*7^7 + 6*7^8 + O(7^9) sage: k = Zp(7, print_mode='val-unit'); k 7-adic Ring with capped relative precision 20 sage: k(7*(19)) 7 * 19 + O(7^21) sage: k(7*(-19)) 7 * 79792266297611982 + O(7^21) sage: k = Zp(7, print_mode='terse'); k 7-adic Ring with capped relative precision 20 sage: k(7*(19)) 133 + O(7^21) sage: k(7*(-19)) 558545864083283874 + O(7^21) Note that $p$-adic rings are cached (via weak references): sage: a = Zp(7); b = Zp(7) sage: a is b True We create some elements in various rings: sage: R = Zp(5); a = R(4); a 4 + O(5^20) sage: S = Zp(5, 10, type = 'capped-abs'); b = S(2); b 2 + O(5^10) sage: a + b 1 + 5 + O(5^10) NOTES: type -- string (default: 'capped-rel'), the type of p-adic ring. 'capped-rel' -- pAdicRingCappedRelative. This is the default, considers precision as the precision of the unit part. Tracks precision of individual elements, but bounds the precision of any element with a precision cap. 'fixed-mod' -- pAdicRingFixedMod. This is basically a wrapper around $\Z / p^n \Z$, adding functions appropriate to p-adics. This is the fastest option. 'capped-abs' -- pAdicRingCappedAbsolute. The same as pAdicRingFixedMod, but keeps track of precision. 'lazy' -- pAdicRingLazy. Uses lazy elements so that additional precision can be requested during a computation. There is some amount of performance penalty because of this ability. print_mode -- string (default: None) Leaving print_mode as None uses the global default print mode. Other allowable values are: 'val-unit' -- elements are displayed as p^k*u 'terse' -- elements are displayed as an integer in base 10 'series' -- elements are displayed as series in p 'digits' -- elements are displayed as a string of base p digits 'bars' -- elements are displayed as a string of base p digits with separators For more details and more control, see sage.rings.padics.padic_printing or look at padic_printing.<tab> from the command line. """ if check: p = Integer(p) if not p.is_prime(): raise ValueError, "p must be prime" if not isinstance(prec, (int, long, Integer)): raise TypeError, "prec must be an integer" elif isinstance(prec, (int, long)): prec = Integer(prec) if not isinstance(halt, (int, long, Integer)): raise TypeError, "prec must be an integer" elif isinstance(halt, (int, long)): halt = Integer(halt) if names is None: name = str(p) elif isinstance(names, tuple): name = names[0] else: name = str(names) if type != 'lazy': key = (p, prec, type, name, print_mode) else: key = (p, prec, halt, name, print_mode) if padic_ring_cache.has_key(key): K = padic_ring_cache[key]() if not (K is None): return K if (type == 'capped-rel'): K = pAdicRingCappedRelative(p, prec, print_mode, name) elif (type == 'fixed-mod'): K = pAdicRingFixedMod(p, prec, print_mode, name) elif (type == 'capped-abs'): K = pAdicRingCappedAbsolute(p, prec, print_mode, name) elif (type == 'lazy'): raise NotImplementedError, "lazy p-adics need more work. Sorry." K = pAdicRingLazy(p, prec, print_mode, halt, name) else: raise ValueError, "type must be one of 'capped-rel', 'fixed-mod', 'capped-abs' or 'lazy'" padic_ring_cache[key] = weakref.ref(K) return K
52b1691f211d5745f1620cd0a7f20ac04ca573c9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/52b1691f211d5745f1620cd0a7f20ac04ca573c9/factory.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2285, 84, 12, 84, 16, 13382, 273, 4200, 16, 618, 273, 296, 5909, 1845, 17, 2878, 2187, 1172, 67, 3188, 273, 599, 16, 18389, 273, 8063, 16, 1257, 273, 599, 16, 866, 33, 5510, 4672, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2285, 84, 12, 84, 16, 13382, 273, 4200, 16, 618, 273, 296, 5909, 1845, 17, 2878, 2187, 1172, 67, 3188, 273, 599, 16, 18389, 273, 8063, 16, 1257, 273, 599, 16, 866, 33, 5510, 4672, 35...
<type 'None'>
<type 'NoneType'>
... def g():
297abadc6b871c61388c3df2e5e7b3e531a9a813 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/297abadc6b871c61388c3df2e5e7b3e531a9a813/test_generators.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1372, 540, 1652, 314, 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...
[ 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, 1372, 540, 1652, 314, 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, ...
width, height = self.superview().frame().size
superview = self.superview() if superview is None: return width, height = superview.frame().size
def recalculateFrame(self): width, height = self.superview().frame().size if width == 0 or height == 0: return if self._glyphs: columnCount = int(width / self._cellWidth) rowCount = len(self._glyphs) / columnCount if columnCount * rowCount < len(self._glyphs): rowCount += 1 newWidth = self._cellWidth * columnCount newHeight = self._cellHeight * rowCount else: columnCount = 0 rowCount = 0 newWidth = newHeight = 0 if not self.inLiveResize(): if width > newWidth: newWidth = width if height > newHeight: newHeight = height self.setFrame_(((0, 0), (newWidth, newHeight))) self._columnCount = columnCount self._rowCount = rowCount self.setNeedsDisplay_(True)
3791ac4ee394c67b719633b6c1b1eeafd6db7e5e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8848/3791ac4ee394c67b719633b6c1b1eeafd6db7e5e/glyphCellView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26657, 3219, 12, 2890, 4672, 2240, 1945, 273, 365, 18, 9565, 1945, 1435, 309, 2240, 1945, 353, 599, 30, 327, 1835, 16, 2072, 273, 2240, 1945, 18, 3789, 7675, 1467, 309, 1835, 422, 374, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26657, 3219, 12, 2890, 4672, 2240, 1945, 273, 365, 18, 9565, 1945, 1435, 309, 2240, 1945, 353, 599, 30, 327, 1835, 16, 2072, 273, 2240, 1945, 18, 3789, 7675, 1467, 309, 1835, 422, 374, ...
self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
self.assertEqual(b.partition(b'w'), (b'mississippi', b'', b''))
def test_partition(self): b = self.type2test(b'mississippi') self.assertEqual(b.partition(b'ss'), (b'mi', b'ss', b'issippi')) self.assertEqual(b.rpartition(b'w'), (b'', b'', b'mississippi'))
efa45f35b529a61aceb4e1266ded7a0b268b0c17 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/efa45f35b529a61aceb4e1266ded7a0b268b0c17/test_bytes.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10534, 12, 2890, 4672, 324, 273, 365, 18, 723, 22, 3813, 12, 70, 17784, 1054, 1054, 625, 7259, 6134, 365, 18, 11231, 5812, 12, 70, 18, 10534, 12, 70, 1807, 87, 19899, 261, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10534, 12, 2890, 4672, 324, 273, 365, 18, 723, 22, 3813, 12, 70, 17784, 1054, 1054, 625, 7259, 6134, 365, 18, 11231, 5812, 12, 70, 18, 10534, 12, 70, 1807, 87, 19899, 261, ...
self._lock.acquire() try: path = normpath(path) self.mount_tree[path] = MountFS.FileMount(path, callable, info_callable) finally: self._lock.release()
path = normpath(path) self.mount_tree[path] = MountFS.FileMount(path, callable, info_callable) @synchronize
def mountfile(self, path, open_callable=None, info_callable=None): self._lock.acquire() try: path = normpath(path) self.mount_tree[path] = MountFS.FileMount(path, callable, info_callable) finally: self._lock.release()
55488646ab3bb52783488eb894e034bb2323f1b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5578/55488646ab3bb52783488eb894e034bb2323f1b7/mountfs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5344, 768, 12, 2890, 16, 589, 16, 1696, 67, 7293, 33, 7036, 16, 1123, 67, 7293, 33, 7036, 4672, 365, 6315, 739, 18, 1077, 1039, 1435, 775, 30, 589, 273, 20446, 12, 803, 13, 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, 5344, 768, 12, 2890, 16, 589, 16, 1696, 67, 7293, 33, 7036, 16, 1123, 67, 7293, 33, 7036, 4672, 365, 6315, 739, 18, 1077, 1039, 1435, 775, 30, 589, 273, 20446, 12, 803, 13, 365, 18, ...
c, "http://www.acme.com/foo%2f%25/<<%0anew/",
c, "http://www.acme.com/foo%2f%25/<<%0anewå/æøå",
def test_url_encoding(self): # Try some URL encodings of the PATHs. # (the behaviour here has changed from libwww-perl) from cookielib import CookieJar, DefaultCookiePolicy
955695bec1f630813e54be181c6fabb67ef37742 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/955695bec1f630813e54be181c6fabb67ef37742/test_cookielib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 718, 67, 5999, 12, 2890, 4672, 468, 6161, 2690, 1976, 24118, 434, 326, 7767, 87, 18, 468, 261, 5787, 14273, 2674, 711, 3550, 628, 2561, 5591, 17, 457, 80, 13, 628, 15860, 77,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 718, 67, 5999, 12, 2890, 4672, 468, 6161, 2690, 1976, 24118, 434, 326, 7767, 87, 18, 468, 261, 5787, 14273, 2674, 711, 3550, 628, 2561, 5591, 17, 457, 80, 13, 628, 15860, 77,...
if 'Shared' in roles:
if 'Shared' in object_roles:
def allowed(self, object, object_roles=None): """Check whether the user has access to object, assuming that object.__roles__ is the given roles.""" if object_roles is None or 'Anonymous' in object_roles: return 1 usr_roles=self.getRolesInContext(object) for role in object_roles: if role in usr_roles: # The user apparently has one of the necessary # roles, but first make sure the object exists # in the context of the parent of the acl_users # folder. ufolder = getattr(self, 'aq_parent', None) ucontext = getattr(ufolder, 'aq_parent', None) if ucontext is not None: if object is None: # This is a strange rule, though # it doesn't cause any security holes. SDH return 1 if not hasattr(object, 'aq_inContextOf'): if hasattr(object, 'im_self'): # This is a method. Grab its self. object=object.im_self if not hasattr(object, 'aq_inContextOf'): # object is not wrapped, therefore we # can't determine context. # Fail the access attempt. Otherwise # this would be a security hole. return None if not object.aq_inContextOf(ucontext, 1): if 'Shared' in object_roles: # Damn, old role setting. Waaa object_roles=self._shared_roles(object) if 'Anonymous' in roles: return 1 return None # Note that if self were not wrapped, it would # not be possible to determine the user's context # and this method would return 1. # However, as long as user folders always return # wrapped user objects, this is safe. return 1
995ab4d721e0d0e83a1b565d61aad7f69e7f302a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/995ab4d721e0d0e83a1b565d61aad7f69e7f302a/User.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2935, 12, 2890, 16, 733, 16, 733, 67, 7774, 33, 7036, 4672, 3536, 1564, 2856, 326, 729, 711, 2006, 358, 733, 16, 15144, 716, 733, 16186, 7774, 972, 353, 326, 864, 4900, 12123, 309, 733...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2935, 12, 2890, 16, 733, 16, 733, 67, 7774, 33, 7036, 4672, 3536, 1564, 2856, 326, 729, 711, 2006, 358, 733, 16, 15144, 716, 733, 16186, 7774, 972, 353, 326, 864, 4900, 12123, 309, 733...
["help", "port=", "baud=", "rtscts", "xonxoff", "localport"])
["help", "port=", "baud=", "rtscts", "xonxoff", "localport="])
def stop(self): """Stop copying""" if self.alive: self.alive = False self.thread_read.join()
9f28a563c2c4afc7867589a5e1be1fb3d5b696ed /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/9f28a563c2c4afc7867589a5e1be1fb3d5b696ed/tcp_serial_redirect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2132, 12, 2890, 4672, 3536, 4947, 8933, 8395, 309, 365, 18, 11462, 30, 365, 18, 11462, 273, 1083, 365, 18, 5930, 67, 896, 18, 5701, 1435, 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, 2132, 12, 2890, 4672, 3536, 4947, 8933, 8395, 309, 365, 18, 11462, 30, 365, 18, 11462, 273, 1083, 365, 18, 5930, 67, 896, 18, 5701, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -...
if not section or section == "DEFAULT":
if not section or section == DEFAULTSECT: option = self.optionxform(option)
def has_option(self, section, option): """Check for the existence of a given option in a given section.""" if not section or section == "DEFAULT": return option in self.__defaults elif not self.has_section(section): return 0 else: option = self.optionxform(option) return option in self.__sections[section]
490cbf56868a5118b635128d808b569527adaab6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/490cbf56868a5118b635128d808b569527adaab6/ConfigParser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 67, 3482, 12, 2890, 16, 2442, 16, 1456, 4672, 3536, 1564, 364, 326, 15782, 434, 279, 864, 1456, 316, 279, 864, 2442, 12123, 309, 486, 2442, 578, 2442, 422, 3331, 1090, 1268, 30, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 711, 67, 3482, 12, 2890, 16, 2442, 16, 1456, 4672, 3536, 1564, 364, 326, 15782, 434, 279, 864, 1456, 316, 279, 864, 2442, 12123, 309, 486, 2442, 578, 2442, 422, 3331, 1090, 1268, 30, 1...
self._opener = CachedOpenerDirector(*handlers)
self._opener = urllib2.build_opener(*handlers) self._opener.addheaders = []
def _get_opener(self): """Build a urllib2 OpenerDirector based on request options.""" if self._opener is None: handlers = [] # if you specify a ProxyHandler when creating the opener # it _must_ come before all other handlers in the list or urllib2 # chokes. if self.opts.proxies: handlers.append( CachedProxyHandler(self.opts.proxies) ) if keepalive_handler and self.opts.keepalive: handlers.append( keepalive_handler ) if range_handlers and (self.opts.range or self.opts.reget): handlers.extend( range_handlers ) handlers.append( auth_handler ) self._opener = CachedOpenerDirector(*handlers) return self._opener
f8e09d44bf6d99154cb2e13ba3803e9ac22a7adc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7001/f8e09d44bf6d99154cb2e13ba3803e9ac22a7adc/grabber.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 25098, 12, 2890, 4672, 3536, 3116, 279, 11527, 22, 6066, 708, 28280, 2511, 603, 590, 702, 12123, 309, 365, 6315, 25098, 353, 599, 30, 4919, 273, 5378, 468, 309, 1846, 4800,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 25098, 12, 2890, 4672, 3536, 3116, 279, 11527, 22, 6066, 708, 28280, 2511, 603, 590, 702, 12123, 309, 365, 6315, 25098, 353, 599, 30, 4919, 273, 5378, 468, 309, 1846, 4800,...
if len(self.instance.secondary_nodes) != 1:
if len(instance.secondary_nodes) != 1:
def CheckPrereq(self): """Check prerequisites.
e90225317101f9d3088352270741c7986fc344d0 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7542/e90225317101f9d3088352270741c7986fc344d0/cmdlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 2050, 822, 85, 12, 2890, 4672, 3536, 1564, 30328, 16608, 2997, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2073, 2050, 822, 85, 12, 2890, 4672, 3536, 1564, 30328, 16608, 2997, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
if not cbFun(sendRequestHandle, None,
if not cbFun(sendRequestHandle, errorIndication,
def _handleResponse( self, snmpEngine, transportDomain, transportAddress, messageProcessingModel, securityModel, securityName, securityLevel, contextEngineId, contextName, pduVersion, PDU, timeout, retryCount, pMod, rspPDU, sendRequestHandle, (cbFun, cbCtx) ): varBindTable = pMod.apiBulkPDU.getVarBindTable(PDU, rspPDU)
27e2d28b7cb3e387c17a11f2e2a8deb4ce7a6aa1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/587/27e2d28b7cb3e387c17a11f2e2a8deb4ce7a6aa1/cmdgen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4110, 1064, 12, 365, 16, 15366, 4410, 16, 4736, 3748, 16, 4736, 1887, 16, 883, 7798, 1488, 16, 4373, 1488, 16, 4373, 461, 16, 4373, 2355, 16, 819, 4410, 548, 16, 819, 461, 16, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4110, 1064, 12, 365, 16, 15366, 4410, 16, 4736, 3748, 16, 4736, 1887, 16, 883, 7798, 1488, 16, 4373, 1488, 16, 4373, 461, 16, 4373, 2355, 16, 819, 4410, 548, 16, 819, 461, 16, 2...
return idaapi.apply_cdecl(ea, type) def ParseTypes(input, flags):
return idaapi.apply_cdecl(ea, newtype) def ParseTypes(inputtype, flags):
def SetType(ea, type): """ Set type of function/variable @param ea: the address of the object @param type: the type string in C declaration form. Must contain the closing ';' if specified as an empty string, then the assciated with 'ea' will be deleted @return: 1-ok, 0-failed. """ return idaapi.apply_cdecl(ea, type)
4f22943d42ee1d5013421d280b3bd776bee83fb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3410/4f22943d42ee1d5013421d280b3bd776bee83fb9/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 559, 12, 24852, 16, 618, 4672, 3536, 1000, 618, 434, 445, 19, 6105, 225, 632, 891, 24164, 30, 326, 1758, 434, 326, 733, 632, 891, 618, 30, 326, 618, 533, 316, 385, 8266, 646, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 559, 12, 24852, 16, 618, 4672, 3536, 1000, 618, 434, 445, 19, 6105, 225, 632, 891, 24164, 30, 326, 1758, 434, 326, 733, 632, 891, 618, 30, 326, 618, 533, 316, 385, 8266, 646, 1...
out += "In <strong><a href=\"
out += "<strong><a href=\"
def print_results_overview(colls, results_final_nb_total, results_final_nb, cpu_time): "Prints results overview box with links to particular collections below." out = "" if len(colls) == 1: # if one collection only, print nothing: return out # first find total number of hits: out += "<p><table width=\"100%%\" border=0 cellspacing=0 cellpadding=2>" \ "<tr><td class=\"results\"><strong>Results overview:</strong> Found <strong>%s</strong> records in %.2f seconds.</td></tr>" % \ (nice_number(results_final_nb_total), cpu_time) # then print hits per collection: out += "<tr><td class=\"resultsbis\">" for coll in colls: if results_final_nb[coll] > 0: out += "In <strong><a href=\"#%s\">%s</a></strong>, " \ "<a href=\"#%s\">%s records found</a><br>" \ % (urllib.quote(coll), coll, urllib.quote(coll), nice_number(results_final_nb[coll])) out += "</td></tr></table>\n" return out
03e310531e299959e23e689e2221361a7aa1e6d6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/03e310531e299959e23e689e2221361a7aa1e6d6/search_engine.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 4717, 67, 26081, 12, 1293, 3251, 16, 1686, 67, 6385, 67, 6423, 67, 4963, 16, 1686, 67, 6385, 67, 6423, 16, 8326, 67, 957, 4672, 315, 15402, 1686, 18471, 3919, 598, 4716, 358,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 67, 4717, 67, 26081, 12, 1293, 3251, 16, 1686, 67, 6385, 67, 6423, 67, 4963, 16, 1686, 67, 6385, 67, 6423, 16, 8326, 67, 957, 4672, 315, 15402, 1686, 18471, 3919, 598, 4716, 358,...
BLANK_FILE_NAME = dirname(abspath(__file__)) + "/blank.pdf"
BLANK_FILE_NAME = dirname(realpath(__file__)) + "/blank.pdf"
def main(): # Handle Arguments BLANK_FILE_NAME = dirname(abspath(__file__)) + "/blank.pdf" if len(sys.argv) < 2: print "Usage: ./bookfold.py input.pdf" sys.exit(1) else: print sys.argv[1] input_doc = sys.argv[1] blank = PdfFileReader(file(BLANK_FILE_NAME, "rb")) input1 = PdfFileReader(file(input_doc, "rb")) # Copy the Input Document to Output (padding if necessary) cloned_output = get_cloned_output_writer(input1, blank) with tempfile.TemporaryFile() as temp_pdf: cloned_output.write(temp_pdf) input2 = PdfFileReader(temp_pdf) rearranged_output = get_rearranged_output_writer(input2) output_doc_name = generate_output_name(input_doc) with file(output_doc_name, "wb") as output_stream: rearranged_output.write(output_stream)
f1fef5b43f8554f58c354551a6acdfe995981246 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/71/f1fef5b43f8554f58c354551a6acdfe995981246/bookfold.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 468, 5004, 13599, 29727, 67, 3776, 67, 1985, 273, 4283, 12, 7688, 803, 12, 972, 768, 972, 3719, 397, 2206, 12111, 18, 7699, 6, 225, 309, 562, 12, 9499, 18, 19485, 13, 411,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5004, 13599, 29727, 67, 3776, 67, 1985, 273, 4283, 12, 7688, 803, 12, 972, 768, 972, 3719, 397, 2206, 12111, 18, 7699, 6, 225, 309, 562, 12, 9499, 18, 19485, 13, 411,...
'price' : price
'price' : price, 'edition' : '1',
def add_book(request): if request.method == "POST": form = BookForm(request.POST) if form.is_valid(): student_id = form.cleaned_data['seller'] price = form.cleaned_data['price'] barcode = form.cleaned_data['barcode'] try: metabook = MetaBook.objects.get(barcode=barcode) except MetaBook.DoesNotExist: initial = { 'barcode' : barcode, 'seller' : student_id, 'price' : price } form = NewBookForm(initial=initial) vars = {'form' : form} template = 'books/add_new_book.html' return rtr(template, vars, context_instance=RC(request)) try: seller = User.objects.get(id=student_id) except User.DoesNotExist: seller = import_user(student_id) if seller == None: message = "Invalid Student ID: %s" % student_id return tidy_error(request, message) book = Book(price=price, status="F", metabook=metabook, seller=seller) book.save() Log(book=book, who=request.user, action='A').save() vars = { 'title' : metabook.title, 'book_id' : book.id } template = 'books/update_book/added.html' return rtr(template, vars, context_instance=RC(request)) # the form isn't valid. send the user back. vars = {'form' : form} template = 'books/add_book.html' return rtr(template, vars, context_instance=RC(request)) else: # the user is hitting the page for the first time form = BookForm() vars = {'form' : form} template = 'books/add_book.html' return rtr(template, vars, context_instance=RC(request))
9941edc1e025df2677100e118266f423b3f0d815 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8671/9941edc1e025df2677100e118266f423b3f0d815/books.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 3618, 12, 2293, 4672, 309, 590, 18, 2039, 422, 315, 3798, 6877, 646, 273, 20258, 1204, 12, 2293, 18, 3798, 13, 309, 646, 18, 291, 67, 877, 13332, 18110, 67, 350, 273, 646, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 3618, 12, 2293, 4672, 309, 590, 18, 2039, 422, 315, 3798, 6877, 646, 273, 20258, 1204, 12, 2293, 18, 3798, 13, 309, 646, 18, 291, 67, 877, 13332, 18110, 67, 350, 273, 646, 1...
preprocessor=cc + " -E",
preprocessor=cpp,
def customize_compiler(compiler): """Do any platform-specific customization of a CCompiler instance. Mainly needed on Unix, so we can plug in the information that varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": (cc, opt, ccshared, ldshared, so_ext) = \ get_config_vars('CC', 'OPT', 'CCSHARED', 'LDSHARED', 'SO') cc_cmd = cc + ' ' + opt compiler.set_executables( preprocessor=cc + " -E", # not always! compiler=cc_cmd, compiler_so=cc_cmd + ' ' + ccshared, linker_so=ldshared, linker_exe=cc) compiler.shared_lib_extension = so_ext
3cae4f751724c51adceff65f8f14b7b5a109b967 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/3cae4f751724c51adceff65f8f14b7b5a109b967/sysconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20236, 67, 9576, 12, 9576, 4672, 3536, 3244, 1281, 4072, 17, 12524, 1679, 1588, 434, 279, 385, 9213, 791, 18, 225, 12740, 715, 3577, 603, 9480, 16, 1427, 732, 848, 15852, 316, 326, 1779,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 20236, 67, 9576, 12, 9576, 4672, 3536, 3244, 1281, 4072, 17, 12524, 1679, 1588, 434, 279, 385, 9213, 791, 18, 225, 12740, 715, 3577, 603, 9480, 16, 1427, 732, 848, 15852, 316, 326, 1779,...
v -- something that defines a set of points in 3 space, for example:
v -- something that defines a set of points in 3 space, for example:
def list_plot3d(v, interpolation_type='default', texture="automatic", point_list=None,**kwds): """ A 3-dimensional plot of a surface defined by the list $v$ of points in 3-dimensional space. INPUT: v -- something that defines a set of points in 3 space, for example: * a matrix * a list of 3-tuples * a list of lists (all of the same length) -- this is treated the same as a matrix. texture -- (default: "automatic"), solid light blue OPTIONAL KEYWORDS: interpolation_type - 'linear', 'nn' (nearest neighbor), 'spline' 'linear' will perform linear interpolation The option 'nn' will interpolate by averaging the value of the nearest neighbors, this produces an interpolating function that is smoother than a linear interpolation, it has one derivative everywhere except at the sample points. The option 'spline' interpolates using a bivariate B-spline. When v is a matrix the default is to use linear interpolation, when v is a list of points the default is nearest neighbor. degree - an integer between 1 and 5, controls the degree of spline used for spline interpolation. For data that is highly oscillatory use higher values point_list - If point_list=True is passed, then if the array is a list of lists of length three, it will be treated as an array of points rather than a 3xn array. num_points - Number of points to sample interpolating function in each direction. By default for an nxn array this is n. **kwds -- all other arguments are passed to the surface function OUTPUT: a 3d plot EXAMPLES: We plot a matrix that illustrates summation modulo $n$. sage: n = 5; list_plot3d(matrix(RDF,n,[(i+j)%n for i in [1..n] for j in [1..n]])) We plot a matrix of values of sin. sage: pi = float(pi) sage: m = matrix(RDF, 6, [sin(i^2 + j^2) for i in [0,pi/5,..,pi] for j in [0,pi/5,..,pi]]) sage: list_plot3d(m, texture='yellow', frame_aspect_ratio=[1,1,1/3]) Though it doesn't change the shap of the graph, increasing num_points can increase the clarity of the graph sage: list_plot3d(m, texture='yellow', frame_aspect_ratio=[1,1,1/3],num_points=40) We can change the interpolation type sage: list_plot3d(m, texture='yellow', interpolation_type='nn',frame_aspect_ratio=[1,1,1/3]) We can make this look better by increasing the number of samples sage: list_plot3d(m, texture='yellow', interpolation_type='nn',frame_aspect_ratio=[1,1,1/3],num_points=40) Lets try a spline sage: list_plot3d(m, texture='yellow', interpolation_type='spline',frame_aspect_ratio=[1,1,1/3]) That spline doesn't capture the oscillation very well, lets try a higher degree spline sage: list_plot3d(m, texture='yellow', interpolation_type='spline', degree=5, frame_aspect_ratio=[1,1,1/3]) We plot a list of lists: sage: show(list_plot3d([[1, 1, 1, 1], [1, 2, 1, 2], [1, 1, 3, 1], [1, 2, 1, 4]])) We plot a list of points: As a first example we can extract the (x,y,z) coordinates from the above example and make a list plot out of it. By default we do linear interpolation. sage: l=[] sage: for i in range(6): ... for j in range(6): ... l.append((float(i*pi/5),float(j*pi/5),m[i,j])) sage: list_plot3d(l,texture='yellow') Note that the points do not have to be regularly sampled. For example sage: l=[] sage: for i in range(-5,5): ... for j in range(-5,5): ... l.append((normalvariate(0,1),normalvariate(0,1),normalvariate(0,1))) sage: list_plot3d(l,interpolation_type='nn',texture='yellow',num_points=100) """ import numpy if texture == "automatic": texture = "lightblue" if is_Matrix(v): if interpolation_type=='default' or interpolation_type=='linear' and not kwds.has_key('num_points'): return list_plot3d_matrix(v, texture=texture, **kwds) else: l=[] for i in xrange(v.nrows()): for j in xrange(v.ncols()): l.append((i,j,v[i,j])) return list_plot3d_tuples(l,interpolation_type,texture,**kwds) if type(v)==numpy.ndarray: return list_plot3d(matrix(v),interpolation_type,texture,**kwds) if isinstance(v, list): if len(v) == 0: # return empty 3d graphic from base import Graphics3d return Graphics3d() elif isinstance(v[0],tuple) or point_list==True and len(v[0]) == 3: return list_plot3d_tuples(v,interpolation_type,texture=texture, **kwds) else: return list_plot3d_array_of_arrays(v, interpolation_type,texture, **kwds) raise TypeError, "v must be a matrix or list"
ea74ed1949e5ccd70daa2a51401dd3e411dc0d2f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/ea74ed1949e5ccd70daa2a51401dd3e411dc0d2f/list_plot3d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 4032, 23, 72, 12, 90, 16, 12851, 67, 723, 2218, 1886, 2187, 11428, 1546, 5854, 4941, 3113, 1634, 67, 1098, 33, 7036, 16, 636, 25577, 4672, 3536, 432, 890, 17, 31236, 3207, 434...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 4032, 23, 72, 12, 90, 16, 12851, 67, 723, 2218, 1886, 2187, 11428, 1546, 5854, 4941, 3113, 1634, 67, 1098, 33, 7036, 16, 636, 25577, 4672, 3536, 432, 890, 17, 31236, 3207, 434...
return cls
return cls.RedirectContext()
def setredirect(cls, redirect): cls.redirect = staticmethod(redirect) return cls
0e3b538e21cea125f893468e3838575e7619c791 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/0e3b538e21cea125f893468e3838575e7619c791/orngServerFiles.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 7590, 12, 6429, 16, 3136, 4672, 2028, 18, 7590, 273, 760, 2039, 12, 7590, 13, 327, 2028, 18, 5961, 1042, 1435, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 7590, 12, 6429, 16, 3136, 4672, 2028, 18, 7590, 273, 760, 2039, 12, 7590, 13, 327, 2028, 18, 5961, 1042, 1435, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
The preferred method to construct an :class:`Inspector` is via the
The preferred method to construct an :class:`.Inspector` is via the
def cache(fn, self, con, *args, **kw): info_cache = kw.get('info_cache', None) if info_cache is None: return fn(self, con, *args, **kw) key = ( fn.__name__, tuple(a for a in args if isinstance(a, basestring)), tuple((k, v) for k, v in kw.iteritems() if isinstance(v, (basestring, int, float))) ) ret = info_cache.get(key) if ret is None: ret = fn(self, con, *args, **kw) info_cache[key] = ret return ret
914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1074/914ae5bcd4dbac844d26c70eeeb2f8bffd03c20d/reflection.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1247, 12, 4293, 16, 365, 16, 356, 16, 380, 1968, 16, 2826, 9987, 4672, 1123, 67, 2493, 273, 5323, 18, 588, 2668, 1376, 67, 2493, 2187, 599, 13, 309, 1123, 67, 2493, 353, 599, 30, 327...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1247, 12, 4293, 16, 365, 16, 356, 16, 380, 1968, 16, 2826, 9987, 4672, 1123, 67, 2493, 273, 5323, 18, 588, 2668, 1376, 67, 2493, 2187, 599, 13, 309, 1123, 67, 2493, 353, 599, 30, 327...
raise "\nERROR: Invalid Tree Item. "
raise Exception("\nERROR: Invalid Tree Item. ")
def SetPyData(self, item, data): """Sets the data associated to an item."""
e1463b9df091ad0e9d76292564d4389882b28de1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/e1463b9df091ad0e9d76292564d4389882b28de1/customtreectrl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1000, 9413, 751, 12, 2890, 16, 761, 16, 501, 4672, 3536, 2785, 326, 501, 3627, 358, 392, 761, 12123, 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, 1000, 9413, 751, 12, 2890, 16, 761, 16, 501, 4672, 3536, 2785, 326, 501, 3627, 358, 392, 761, 12123, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
operator = 'in'
if res_ids: opeartor = 'in'
def _rec_convert(ids): if field_obj == table: return ids return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type)
b04f3e28317eb5cd6ecb626c9d77dcd96edaafda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/b04f3e28317eb5cd6ecb626c9d77dcd96edaafda/expression.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 6283, 12, 2232, 4672, 309, 652, 67, 2603, 422, 1014, 30, 327, 3258, 327, 365, 16186, 8837, 67, 10543, 67, 267, 12, 3353, 16, 652, 6315, 350, 21, 16, 652, 6315, 2878, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 6283, 12, 2232, 4672, 309, 652, 67, 2603, 422, 1014, 30, 327, 3258, 327, 365, 16186, 8837, 67, 10543, 67, 267, 12, 3353, 16, 652, 6315, 350, 21, 16, 652, 6315, 2878, 1...
def exists(self,lfns,connection=False): connection = self._getConnection(connection)
def exists( self, lfns, connection = False ): connection = self._getConnection( connection )
def exists(self,lfns,connection=False): connection = self._getConnection(connection) """ Determine whether a file exists in the catalog """ res = self._findFiles(lfns,connection=connection) successful = dict.fromkeys(res['Value']['Successful'],True) failed = {} for lfn,error in res['Value']['Failed'].items(): if error == 'No such file or directory': successful[lfn] = False else: failed[lfn] = error return S_OK({"Successful":successful,"Failed":failed})
26c5008a7adbc1c761e2409bed59b7710e5f2c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/26c5008a7adbc1c761e2409bed59b7710e5f2c74/FileManagerBase.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1704, 12, 365, 16, 18594, 2387, 16, 1459, 273, 1083, 262, 30, 1459, 273, 365, 6315, 588, 1952, 12, 1459, 262, 3536, 10229, 2856, 279, 585, 1704, 316, 326, 6222, 3536, 400, 273, 365, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1704, 12, 365, 16, 18594, 2387, 16, 1459, 273, 1083, 262, 30, 1459, 273, 365, 6315, 588, 1952, 12, 1459, 262, 3536, 10229, 2856, 279, 585, 1704, 316, 326, 6222, 3536, 400, 273, 365, 63...
raise BackendError('Panda',"ERROR : could not find supported locations in the %s cloud for %s, %s" % (job.backend.requirements.cloud,job.inputdata.dataset,job.backend.libds))
raise BackendError('Panda',"ERROR : could not find supported locations in the %s cloud for %s, %s" % (job.backend.requirements.cloud,dataset,job.backend.libds))
def runPandaBrokerage(job): # get locations when site==AUTO if job.backend.site == "AUTO": libdslocation = [] if job.backend.libds: try: libdslocation = Client.getLocations(job.backend.libds,[],job.backend.requirements.cloud,False,False) except exceptions.SystemExit: raise BackendError('Panda','Error in Client.getLocations for libDS') if not libdslocation: raise ApplicationConfigurationError(None,'Could not locate libDS %s'%job.backend.libds) else: libdslocation = libdslocation.values()[0] tmpSites = [] if job.inputdata: dataset = '' try: dataset = job.inputdata.dataset[0] except: try: dataset = job.inputdata.DQ2dataset except: raise ApplicationConfigurationError(None,'Could not determine input datasetname for Panda brokerage') if not dataset: raise ApplicationConfigurationError(None,'Could not determine input datasetname for Panda brokerage') fileList = [] try: fileList = Client.queryFilesInDataset(dataset,False) except exceptions.SystemExit: raise BackendError('Panda','Error in Client.queryFilesInDataset') try: dsLocationMap = Client.getLocations(dataset,fileList,job.backend.requirements.cloud,False,False,expCloud=True) except exceptions.SystemExit: raise BackendError('Panda','Error in Client.getLocations') # no location if dsLocationMap == {}: raise BackendError('Panda',"ERROR : could not find supported locations in the %s cloud for %s" % (job.backend.requirements.cloud,job.inputdata.dataset[0])) # run brokerage for tmpItem in dsLocationMap.values(): if not libdslocation or tmpItem == libdslocation: tmpSites.append(tmpItem[0]) else: for site,spec in Client.PandaSites.iteritems(): if spec['cloud']==job.backend.requirements.cloud and spec['status']=='online' and not Client.isExcudedSite(site): if not libdslocation or site == libdslocation: tmpSites.append(site) if not tmpSites: raise BackendError('Panda',"ERROR : could not find supported locations in the %s cloud for %s, %s" % (job.backend.requirements.cloud,job.inputdata.dataset,job.backend.libds)) tag = '' try: tag = 'Atlas-%s' % job.application.atlas_release except: pass try: status,out = Client.runBrokerage(tmpSites,tag,verbose=False,trustIS=config['trustIS']) except exceptions.SystemExit: raise BackendError('Panda','Exception in Client.runBrokerage: %s %s'%(sys.exc_info()[0],sys.exc_info()[1])) if status != 0: raise BackendError('Panda','Non-zero to run brokerage for automatic assignment: %s' % out) if not Client.PandaSites.has_key(out): raise BackendError('Panda','brokerage gave wrong PandaSiteID:%s' % out) # set site job.backend.site = out # patch for BNL if job.backend.site == "ANALY_BNL": job.backend.site = "ANALY_BNL_ATLAS_1" # long queue if job.backend.requirements.long: job.backend.site = re.sub('ANALY_','ANALY_LONG_',job.backend.site) job.backend.actualCE = job.backend.site # correct the cloud in case site was not AUTO job.backend.requirements.cloud = Client.PandaSites[job.backend.site]['cloud'] logger.info('Panda brokerage results: cloud %s, site %s'%(job.backend.requirements.cloud,job.backend.site))
3f526908c9f22ead6d732694154b735c755d32c5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1488/3f526908c9f22ead6d732694154b735c755d32c5/Panda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 52, 464, 69, 11194, 410, 12, 4688, 4672, 468, 336, 7838, 1347, 2834, 631, 18909, 225, 309, 1719, 18, 9993, 18, 4256, 422, 315, 18909, 6877, 2561, 2377, 3562, 273, 5378, 309, 1719, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 52, 464, 69, 11194, 410, 12, 4688, 4672, 468, 336, 7838, 1347, 2834, 631, 18909, 225, 309, 1719, 18, 9993, 18, 4256, 422, 315, 18909, 6877, 2561, 2377, 3562, 273, 5378, 309, 1719, ...
xml_data = unicode(xml_data, 'utf-32be').encode('utf-8')
def _detectEncoding(self, xml_data): """Given a document, tries to detect its XML encoding.""" xml_encoding = sniffed_xml_encoding = None try: if xml_data[:4] == '\x4c\x6f\xa7\x94': # EBCDIC xml_data = self._ebcdic_to_ascii(xml_data) elif xml_data[:4] == '\x00\x3c\x00\x3f': # UTF-16BE sniffed_xml_encoding = 'utf-16be' xml_data = unicode(xml_data, 'utf-16be').encode('utf-8') elif (len(xml_data) >= 4) and (xml_data[:2] == '\xfe\xff') \ and (xml_data[2:4] != '\x00\x00'): # UTF-16BE with BOM sniffed_xml_encoding = 'utf-16be' xml_data = unicode(xml_data[2:], 'utf-16be').encode('utf-8') elif xml_data[:4] == '\x3c\x00\x3f\x00': # UTF-16LE sniffed_xml_encoding = 'utf-16le' xml_data = unicode(xml_data, 'utf-16le').encode('utf-8') elif (len(xml_data) >= 4) and (xml_data[:2] == '\xff\xfe') and \ (xml_data[2:4] != '\x00\x00'): # UTF-16LE with BOM sniffed_xml_encoding = 'utf-16le' xml_data = unicode(xml_data[2:], 'utf-16le').encode('utf-8') elif xml_data[:4] == '\x00\x00\x00\x3c': # UTF-32BE sniffed_xml_encoding = 'utf-32be' xml_data = unicode(xml_data, 'utf-32be').encode('utf-8') elif xml_data[:4] == '\x3c\x00\x00\x00': # UTF-32LE sniffed_xml_encoding = 'utf-32le' xml_data = unicode(xml_data, 'utf-32le').encode('utf-8') elif xml_data[:4] == '\x00\x00\xfe\xff': # UTF-32BE with BOM sniffed_xml_encoding = 'utf-32be' xml_data = unicode(xml_data[4:], 'utf-32be').encode('utf-8') elif xml_data[:4] == '\xff\xfe\x00\x00': # UTF-32LE with BOM sniffed_xml_encoding = 'utf-32le' xml_data = unicode(xml_data[4:], 'utf-32le').encode('utf-8') elif xml_data[:3] == '\xef\xbb\xbf': # UTF-8 with BOM sniffed_xml_encoding = 'utf-8' xml_data = unicode(xml_data[3:], 'utf-8').encode('utf-8') else: sniffed_xml_encoding = 'ascii' pass xml_encoding_match = re.compile \ ('^<\?.*encoding=[\'"](.*?)[\'"].*\?>')\ .match(xml_data) if xml_encoding_match is None: # By Kovid to use the content-type header in HTML files xml_encoding_match = re.compile(r'<meta.*?http-equiv=[\'"]Content-type[\'"].*?content=[\'"].*?charset=(\S+).*?[\'"]', re.IGNORECASE).search(xml_data) except: xml_encoding_match = None if xml_encoding_match: xml_encoding = xml_encoding_match.groups()[0].lower() if sniffed_xml_encoding and \ (xml_encoding in ('iso-10646-ucs-2', 'ucs-2', 'csunicode', 'iso-10646-ucs-4', 'ucs-4', 'csucs4', 'utf-16', 'utf-32', 'utf_16', 'utf_32', 'utf16', 'u16')): xml_encoding = sniffed_xml_encoding return xml_data, xml_encoding, sniffed_xml_encoding
731811e871f20bd77d869ea51ffa661da0fdeb26 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/731811e871f20bd77d869ea51ffa661da0fdeb26/BeautifulSoup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 16518, 4705, 12, 2890, 16, 2025, 67, 892, 4672, 3536, 6083, 279, 1668, 16, 9327, 358, 5966, 2097, 3167, 2688, 12123, 2025, 67, 5999, 273, 26974, 329, 67, 2902, 67, 5999, 273, 599, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 16518, 4705, 12, 2890, 16, 2025, 67, 892, 4672, 3536, 6083, 279, 1668, 16, 9327, 358, 5966, 2097, 3167, 2688, 12123, 2025, 67, 5999, 273, 26974, 329, 67, 2902, 67, 5999, 273, 599, ...
elif pr("Branch:") or pr("Tag"):
elif pr("Branch:"): self.branches.append(pr.value) state = self.SINGLE elif pr("Tag"):
def parse(self, revision): from datetime import datetime
99161ee430dbc4a866be3eb80981544ead94434b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5981/99161ee430dbc4a866be3eb80981544ead94434b/monotone.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 6350, 4672, 628, 3314, 1930, 3314, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 12, 2890, 16, 6350, 4672, 628, 3314, 1930, 3314, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
aliases = Utils.FindMatchingAddresses(name, self.members,
aliases = Utils.FindMatchingAddresses(name, self.members,
def DeleteMember(self, name, whence=None, admin_notif=None, userack=1):
d4117e2559487604b13fa55121d903681fad00c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/d4117e2559487604b13fa55121d903681fad00c3/MailList.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2504, 4419, 12, 2890, 16, 508, 16, 23692, 33, 7036, 16, 3981, 67, 902, 430, 33, 7036, 16, 729, 484, 33, 21, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2504, 4419, 12, 2890, 16, 508, 16, 23692, 33, 7036, 16, 3981, 67, 902, 430, 33, 7036, 16, 729, 484, 33, 21, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") obj = cls(*args, **kwargs)
if hasattr(warnings, 'catch_warnings'): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") obj = cls(*args, **kwargs)
def assertDeprecated(self, cls, *args, **kwargs): with warnings.catch_warnings(record=True) as w: warnings.simplefilter("always") obj = cls(*args, **kwargs)
0a96eae12228b4e67a7ad3864e41ed5063f6b330 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3482/0a96eae12228b4e67a7ad3864e41ed5063f6b330/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1815, 13534, 12, 2890, 16, 2028, 16, 380, 1968, 16, 2826, 4333, 4672, 598, 5599, 18, 14683, 67, 12103, 12, 3366, 33, 5510, 13, 487, 341, 30, 5599, 18, 9647, 2188, 2932, 17737, 7923, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1815, 13534, 12, 2890, 16, 2028, 16, 380, 1968, 16, 2826, 4333, 4672, 598, 5599, 18, 14683, 67, 12103, 12, 3366, 33, 5510, 13, 487, 341, 30, 5599, 18, 9647, 2188, 2932, 17737, 7923, 10...
ans = ans._fix(context=context)
ans = ans._fix(context)
def _divide(self, other, divmod = 0, context=None): """Return a / b, to context.prec precision.
b277e15abb88b70aabae5a4859ba6920ae8be40f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b277e15abb88b70aabae5a4859ba6920ae8be40f/decimal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2892, 831, 12, 2890, 16, 1308, 16, 26105, 273, 374, 16, 819, 33, 7036, 4672, 3536, 990, 279, 342, 324, 16, 358, 819, 18, 4036, 6039, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 2892, 831, 12, 2890, 16, 1308, 16, 26105, 273, 374, 16, 819, 33, 7036, 4672, 3536, 990, 279, 342, 324, 16, 358, 819, 18, 4036, 6039, 18, 2, -100, -100, -100, -100, -100, -100, -...
separator += linesep * (1 + isdigest)
separator += linesep
def _parsebody(self, container, fp): # Parse the body, but first split the payload on the content-type # boundary if present. boundary = container.get_boundary() isdigest = (container.get_type() == 'multipart/digest') # If there's a boundary, split the payload text into its constituent # parts and parse each separately. Otherwise, just parse the rest of # the body as a single message. Note: any exceptions raised in the # recursive parse need to have their line numbers coerced. if boundary: preamble = epilogue = None # Split into subparts. The first boundary we're looking for won't # have the leading newline since we're at the start of the body # text. separator = '--' + boundary payload = fp.read() start = payload.find(separator) if start < 0: raise Errors.BoundaryError( "Couldn't find starting boundary: %s" % boundary) if start > 0: # there's some pre-MIME boundary preamble preamble = payload[0:start] # Find out what kind of line endings we're using start += len(separator) cre = re.compile('\r\n|\r|\n') mo = cre.search(payload, start) if mo: start += len(mo.group(0)) * (1 + isdigest) # We create a compiled regexp first because we need to be able to # specify the start position, and the module function doesn't # support this signature. :( cre = re.compile('(?P<sep>\r\n|\r|\n)' + re.escape(separator) + '--') mo = cre.search(payload, start) if not mo: raise Errors.BoundaryError( "Couldn't find terminating boundary: %s" % boundary) terminator = mo.start() linesep = mo.group('sep') if mo.end() < len(payload): # there's some post-MIME boundary epilogue epilogue = payload[mo.end():] # We split the textual payload on the boundary separator, which # includes the trailing newline. If the container is a # multipart/digest then the subparts are by default message/rfc822 # instead of text/plain. In that case, they'll have an extra # newline before the headers to distinguish the message's headers # from the subpart headers. separator += linesep * (1 + isdigest) parts = payload[start:terminator].split(linesep + separator) for part in parts: msgobj = self.parsestr(part) container.preamble = preamble container.epilogue = epilogue container.attach(msgobj) elif container.get_main_type() == 'multipart': # Very bad. A message is a multipart with no boundary! raise Errors.BoundaryError( 'multipart message with no defined boundary') elif container.get_type() == 'message/delivery-status': # This special kind of type contains blocks of headers separated # by a blank line. We'll represent each header block as a # separate Message object blocks = [] while 1: blockmsg = self._class() self._parseheaders(blockmsg, fp) if not len(blockmsg): # No more header blocks left break blocks.append(blockmsg) container.set_payload(blocks) elif container.get_main_type() == 'message': # Create a container for the payload, but watch out for there not # being any headers left try: msg = self.parse(fp) except Errors.HeaderParseError: msg = self._class() self._parsebody(msg, fp) container.attach(msg) else: container.set_payload(fp.read())
f6caeba03a59944602f7c0eec69c9f275f9608eb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/f6caeba03a59944602f7c0eec69c9f275f9608eb/Parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 3432, 12, 2890, 16, 1478, 16, 4253, 4672, 468, 2884, 326, 1417, 16, 1496, 1122, 1416, 326, 2385, 603, 326, 913, 17, 723, 468, 7679, 309, 3430, 18, 7679, 273, 1478, 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, 389, 2670, 3432, 12, 2890, 16, 1478, 16, 4253, 4672, 468, 2884, 326, 1417, 16, 1496, 1122, 1416, 326, 2385, 603, 326, 913, 17, 723, 468, 7679, 309, 3430, 18, 7679, 273, 1478, 18, 588, ...
except (socket.error, http.client.HTTPException) as e: retry = (errno.ECONNRESET, errno.ECONNABORTED, http.client.BadStatusLine) if i or e[0] not in retry:
except socket.error as e: if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED): raise except http.client.BadStatusLine: if i:
def request(self, host, handler, request_body, verbose=0): #retry request once if cached connection has gone cold for i in (0, 1): try: return self.single_request(host, handler, request_body, verbose) except (socket.error, http.client.HTTPException) as e: retry = (errno.ECONNRESET, errno.ECONNABORTED, http.client.BadStatusLine) #close after we sent request if i or e[0] not in retry: raise
4e874cac2247e151dcc6489aec509af127d55401 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8125/4e874cac2247e151dcc6489aec509af127d55401/client.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 1479, 16, 1838, 16, 590, 67, 3432, 16, 3988, 33, 20, 4672, 468, 9620, 590, 3647, 309, 3472, 1459, 711, 22296, 645, 72, 364, 277, 316, 261, 20, 16, 404, 4672, 775, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 590, 12, 2890, 16, 1479, 16, 1838, 16, 590, 67, 3432, 16, 3988, 33, 20, 4672, 468, 9620, 590, 3647, 309, 3472, 1459, 711, 22296, 645, 72, 364, 277, 316, 261, 20, 16, 404, 4672, 775, ...
elif report_error:
else:
def trHandleCode(code, gen_dict_line, report_error, output_format): import time try: err = prj_srs.ImportFromEPSG( code ) except: err = 1 if err != 0 and report_error: print 'Unable to lookup ',code,', either not a valid EPSG' print 'code, or it the EPSG csv files are not accessable.' sys.exit(2) else: if output_format == '-pretty_wkt': if gen_dict_line: print 'EPSG:',code print prj_srs.ExportToPrettyWkt() if output_format == '-xml': print prj_srs.ExportToXML() if output_format == '-wkt': if gen_dict_line: print 'EPSG:',code print prj_srs.ExportToWkt() if output_format == '-proj4': out_string = prj_srs.ExportToProj4() name = prj_srs.GetAttrValue('PROJCS') if name is None: name = prj_srs.GetAttrValue('GEOGCS') print '# '+name if err == 0 and string.find(out_string,'+proj=') > -1: print '<%s> %s no_defs <>' % (str(code), out_string) elif report_error: print '# Unable to translate coordinate system into PROJ.4 format.' if output_format == '-postgis': name = prj_srs.GetAttrValue('PROJCS') if name is None: name = prj_srs.GetAttrValue('GEOGCS') try: proj4text = prj_srs.ExportToProj4() except: err = 1 wkt = prj_srs.ExportToWkt() print '---' print '--- EPSG : %s' % name print '---' if err: print '-- (unable to translate)' else: print 'INSERT INTO "spatial_ref_sys" ("srid","auth_name","auth_srid","srtext","proj4text") VALUES (%s,\'EPSG\',%s,\'%s\',\'%s\');' % \ (str(code),str(code),wkt,proj4text)
8409f97a1cc83675aaaec53f5be210030b1712fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10289/8409f97a1cc83675aaaec53f5be210030b1712fb/epsg_tr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 433, 3259, 1085, 12, 710, 16, 3157, 67, 1576, 67, 1369, 16, 2605, 67, 1636, 16, 876, 67, 2139, 4672, 225, 1930, 813, 225, 775, 30, 393, 273, 27378, 67, 87, 5453, 18, 5010, 1265, 41, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 433, 3259, 1085, 12, 710, 16, 3157, 67, 1576, 67, 1369, 16, 2605, 67, 1636, 16, 876, 67, 2139, 4672, 225, 1930, 813, 225, 775, 30, 393, 273, 27378, 67, 87, 5453, 18, 5010, 1265, 41, ...
0.92387953251128674), (2.1598449493429825, 0.83146961230254546),
0.92387953251128674), (2.1598449493429825, 0.831469612302545...),
def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize = True): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm for plotting a function f. See the docstring for plot for a description of the algorithm. INPUT: f -- a function of one variable p1, p2 -- two points to refine between plot_points -- (default: 5) the minimal number of plot points. adaptive_recursion -- (default: 5) how many levels of recursion to go before giving up when doing adaptive refinement. Setting this to 0 disables adaptive refinement. adaptive_tolerance -- (default: 0.01) how large a difference should be before the adaptive refinement code considers it significant. See the documentation for plot() for more information. OUTPUT: list -- a list of points (x, f(x)) in the interval xrange, which aproximate the function f. TESTS: sage: from sage.plot.plot import generate_plot_points sage: generate_plot_points(sin, (0, pi), plot_points=2, adaptive_recursion=0) [(0.0, 0.0), (3.1415926535897931, 1.2246...e-16)] sage: generate_plot_points(sin(x), (-pi, pi), randomize=False) [(-3.1415926535897931, -1.2246...e-16), (-2.748893571891069, -0.38268343236508989), (-2.3561944901923448, -0.707106781186547...), (-2.1598449493429825, -0.83146961230254546), (-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), (-1.5707963267948966, -1.0), (-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828, -0.707106781186547...), (-0.39269908169872414, -0.38268343236508978), (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), (0.78539816339744828, 0.707106781186547...), (0.98174770424681035, 0.83146961230254524), (1.1780972450961724, 0.92387953251128674), (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 0.92387953251128674), (2.1598449493429825, 0.83146961230254546), (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246...e-16)] This shows that lowering adaptive_tolerance and raising adaptive_recursion both increase the number of subdivision points: sage: x = var('x') sage: f = sin(1/x) sage: [len(generate_plot_points(f, (-pi, pi), adaptive_tolerance=i)) for i in [0.01, 0.001, 0.0001]] [42, 67, 104] sage: [len(generate_plot_points(f, (-pi, pi), adaptive_recursion=i)) for i in [5, 10, 15]] [34, 144, 897] """ x, data = var_and_list_of_values(xrange, plot_points) xmin = data[0] xmax = data[-1] delta = float(xmax-xmin) / plot_points random = current_randstate().python_random().random exceptions = 0; msg='' exception_indices = [] for i in range(len(data)): xi = data[i] # Slightly randomize the interior sample points if # randomize is true if randomize and i > 0 and i < plot_points-1: xi += delta*(random() - 0.5) try: data[i] = (float(xi), float(f(xi))) if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) exceptions += 1 exception_indices.append(i) except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) if i == 0: for j in range(1, 99): xj = xi + delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) elif i == plot_points-1: for j in range(1, 99): xj = xi - delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) else: exceptions += 1 exception_indices.append(i) exceptions += 1 exception_indices.append(i) data = [data[i] for i in range(len(data)) if i not in exception_indices] # adaptive refinement i, j = 0, 0 adaptive_tolerance = delta * float(adaptive_tolerance) adaptive_recursion = int(adaptive_recursion) while i < len(data) - 1: for p in adaptive_refinement(f, data[i], data[i+1], adaptive_tolerance=adaptive_tolerance, adaptive_recursion=adaptive_recursion): data.insert(i+1, p) i += 1 i += 1 if (len(data) == 0 and exceptions > 0) or exceptions > 10: sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points."%exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'"%msg, level=0) return data
7d47c9787ca7bd441904f4820a1ea3c72893977e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7d47c9787ca7bd441904f4820a1ea3c72893977e/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 4032, 67, 4139, 12, 74, 16, 12314, 16, 3207, 67, 4139, 33, 25, 16, 5855, 688, 67, 25456, 33, 20, 18, 1611, 16, 5855, 688, 67, 31347, 33, 25, 16, 2744, 554, 273, 1053, 467...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 67, 4032, 67, 4139, 12, 74, 16, 12314, 16, 3207, 67, 4139, 33, 25, 16, 5855, 688, 67, 25456, 33, 20, 18, 1611, 16, 5855, 688, 67, 31347, 33, 25, 16, 2744, 554, 273, 1053, 467...
} for p in self.manager.getAddablePortletTypes()]
} for p in self.manager.getAddablePortletTypes() if check_permission(p)]
def sort_key(v): return v.get('title')
0d3b209de78f0e51c2f32c9e6a6f24c87266e1c6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12194/0d3b209de78f0e51c2f32c9e6a6f24c87266e1c6/editmanager.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1524, 67, 856, 12, 90, 4672, 327, 331, 18, 588, 2668, 2649, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1524, 67, 856, 12, 90, 4672, 327, 331, 18, 588, 2668, 2649, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
Subwidget Class --------- ----- selection ComboBox filter ComboBox dirlist ScrolledListBox filelist ScrolledListBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixFileSelectBox', ['options'], cnf, kw) self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') self.subwidget_list['filter'] = _dummyComboBox(self, 'filter') self.subwidget_list['selection'] = _dummyComboBox(self, 'selection') def apply_filter(self): self.tk.call(self._w, 'filter')
Subwidget Class --------- ----- selection ComboBox filter ComboBox dirlist ScrolledListBox filelist ScrolledListBox""" def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixFileSelectBox', ['options'], cnf, kw) self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist') self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist') self.subwidget_list['filter'] = _dummyComboBox(self, 'filter') self.subwidget_list['selection'] = _dummyComboBox(self, 'selection') def apply_filter(self): self.tk.call(self._w, 'filter')
def popdown(self):
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, 1843, 2378, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1843, 2378, 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, -...
s=L3PacketSocket(*args, **kargs)
if not isinstance(x, Gen): x = SetGen(x) s=conf.L3socket(*args, **kargs)
def send(x, inter=0, *args, **kargs): """Send packets at layer 3""" s=L3PacketSocket(*args, **kargs) for p in x: s.send(p) time.sleep(inter)
722a4073400c335f86f3f613ddc3e31e4e032485 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7311/722a4073400c335f86f3f613ddc3e31e4e032485/scapy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 12, 92, 16, 1554, 33, 20, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 3826, 12640, 622, 3018, 890, 8395, 309, 486, 1549, 12, 92, 16, 10938, 4672, 619, 273, 1000, 7642, 12, 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, 1366, 12, 92, 16, 1554, 33, 20, 16, 380, 1968, 16, 2826, 79, 1968, 4672, 3536, 3826, 12640, 622, 3018, 890, 8395, 309, 486, 1549, 12, 92, 16, 10938, 4672, 619, 273, 1000, 7642, 12, 9...
def isFirefoxLocked(self, profile_path): """ Checks if a firefox profile is open. Looks for parent lock file in firefox profile. If file exists, profile is open. Args: profile_path: path to profile folder """ lock = os.path.join(profile_path, self.lockname) return os.path.exists(lock)
def isFirefoxLocked(self, profile_path): """ Checks if a firefox profile is open.
00d72a461cb1ea885a85d2ef38ae54199ba28ea1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1918/00d72a461cb1ea885a85d2ef38ae54199ba28ea1/installer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 9723, 13873, 8966, 12, 2890, 16, 3042, 67, 803, 4672, 3536, 13074, 309, 279, 4452, 13873, 3042, 353, 1696, 18, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 353, 9723, 13873, 8966, 12, 2890, 16, 3042, 67, 803, 4672, 3536, 13074, 309, 279, 4452, 13873, 3042, 353, 1696, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
Mailbox
IMailbox
def authenticateUserPASS(self, user, password): """Perform authentication of a username/password login. @type user: C{str} @param user: The name of the user attempting to log in. @type password: C{str} @param password: The password to attempt to authenticate with. @rtype: C{Deferred} @return: A deferred whose callback invoked if the login is successful, and whose errback will be invoked otherwise. """ if self.portal is not None: return self.portal.login( cred.credentials.UsernamePassword(user, password), None, Mailbox ) return defer.fail(cred.error.UnauthorizedLogin())
c65ae3e1b754c76ebb48087f5eae255a0467d27f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/c65ae3e1b754c76ebb48087f5eae255a0467d27f/pop3.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8929, 1299, 10884, 12, 2890, 16, 729, 16, 2201, 4672, 3536, 4990, 5107, 434, 279, 2718, 19, 3664, 3925, 18, 225, 632, 723, 729, 30, 385, 95, 701, 97, 632, 891, 729, 30, 1021, 508, 43...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8929, 1299, 10884, 12, 2890, 16, 729, 16, 2201, 4672, 3536, 4990, 5107, 434, 279, 2718, 19, 3664, 3925, 18, 225, 632, 723, 729, 30, 385, 95, 701, 97, 632, 891, 729, 30, 1021, 508, 43...