rem
stringlengths
2
226k
add
stringlengths
0
227k
context
stringlengths
8
228k
meta
stringlengths
156
215
input_ids
list
attention_mask
list
labels
list
if self._isConnected(fromMac):
if force or self._isConnected(fromMac):
def _closeCONN(self,fromMac): # Check if this client is even connected if self._isConnected(fromMac): # We just need to set the closed flag, since the socket will detect that and close itself # Lock the client self.clientDataBuffer[fromMac]["lock"].acquire() # Set it to be closed self.clientDataBuffer[fromMac]["closed"] = True # Unlock self.clientDataBuffer[fromMac]["lock"].release()
1524f73ddcdafea0593a636c358a3704901f8ce9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/1524f73ddcdafea0593a636c358a3704901f8ce9/NATLayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4412, 27733, 12, 2890, 16, 2080, 9990, 4672, 468, 2073, 309, 333, 1004, 353, 5456, 5840, 309, 2944, 578, 365, 6315, 291, 8932, 12, 2080, 9990, 4672, 468, 1660, 2537, 1608, 358, 444,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4412, 27733, 12, 2890, 16, 2080, 9990, 4672, 468, 2073, 309, 333, 1004, 353, 5456, 5840, 309, 2944, 578, 365, 6315, 291, 8932, 12, 2080, 9990, 4672, 468, 1660, 2537, 1608, 358, 444,...
] + commands.walkopts + commands.commitopts,
] + commands.walkopts + commands.commitopts + headeropts,
def _branchtags(self): q = self.mq if not q.applied: return super(mqrepo, self)._branchtags()
3f718adeb1de061eac12572efbce9fdaae657238 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/3f718adeb1de061eac12572efbce9fdaae657238/mq.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7500, 4156, 12, 2890, 4672, 1043, 273, 365, 18, 11636, 309, 486, 1043, 18, 438, 3110, 30, 327, 2240, 12, 11636, 7422, 16, 365, 2934, 67, 7500, 4156, 1435, 2, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 7500, 4156, 12, 2890, 4672, 1043, 273, 365, 18, 11636, 309, 486, 1043, 18, 438, 3110, 30, 327, 2240, 12, 11636, 7422, 16, 365, 2934, 67, 7500, 4156, 1435, 2, -100, -100, -100, -10...
if headwordTrad[i] != headwordSimp[i]: charList = [headwordTrad[i], headwordSimp[i]]
if entry.HeadwordTraditional[i] != entry.HeadwordSimplified[i]: charList = [entry.HeadwordTraditional[i], entry.HeadwordSimplified[i]]
def checkCharacterReading(entryList, readingName, readingOptions={}, ignoreFifthTone=False): for entry in entryList: headwordTrad, headwordSimp, reading = entry if headwordTrad != headwordSimp: headword = headwordTrad + "'/'" + headwordSimp else: headword = headwordTrad try: operator = getReadingOperator(readingName, readingOptions) entities = operator.decompose(reading) except exception.DecompositionError: print ("WARNING: can't parse line '" \ + headwordTrad + "', '" + headwordSimp + "', '" + reading \ + "'").encode(default_encoding) continue entitiesFiltered = [] for entity in entities: if re.match(r"\s+$", entity): continue entitiesFiltered.append(entity) if (len(entitiesFiltered) != len(headwordTrad)) \ or (len(entitiesFiltered) != len(headwordSimp)): print ("WARNING: can't parse line '" \ + headwordTrad + "', '" + headwordSimp + "', '" + reading \ + "'").encode(default_encoding) continue for i, entity in enumerate(entitiesFiltered): if getReadingOperator(readingName).isReadingEntity(entity): if headwordTrad[i] != headwordSimp[i]: charList = [headwordTrad[i], headwordSimp[i]] else: charList = [headwordTrad[i]] for char in charList: validReading = True try: readingList = getCJK().getReadingForCharacter(char, readingName, **readingOptions) if not hasReading(entity, readingList, readingName, ignoreFifthTone): print (char + " " + entity + ", known readings: " \ + ', '.join(readingList) + "; for headword '" \ + headword + "'").encode(default_encoding) except exception.NoInformationError: pass else: # Check mapping of non-Pinyin entities. They either map # to the same character again (e.g. ellipsis: ...) or have # a different form described by table NON_PINYIN_MAPPING if headwordTrad[i] != entity \ and (headwordTrad[i] not in NON_PINYIN_MAPPING \ or NON_PINYIN_MAPPING[headwordTrad[i]] != entity): print ("WARNING: invalid mapping of entity '" \ + headwordTrad[i] + "' to '" + entity \ + "'; for headword '" + headword + "'")\ .encode(default_encoding) elif headwordSimp[i] != entity \ and (headwordSimp[i] not in NON_PINYIN_MAPPING \ or NON_PINYIN_MAPPING[headwordSimp[i]] != entity): print ("WARNING: invalid mapping of entity '" \ + headwordSimp[i] + "' to '" + entity \ + "'; for headword '" + headword + "'")\ .encode(default_encoding)
03ee2902c9101f1e847d6ed9b78fc134a514e71a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11128/03ee2902c9101f1e847d6ed9b78fc134a514e71a/checkcedict.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 7069, 15714, 12, 4099, 682, 16, 6453, 461, 16, 6453, 1320, 28793, 2305, 42, 430, 451, 56, 476, 33, 8381, 4672, 364, 1241, 316, 1241, 682, 30, 910, 1095, 1609, 72, 16, 910, 1095, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7069, 15714, 12, 4099, 682, 16, 6453, 461, 16, 6453, 1320, 28793, 2305, 42, 430, 451, 56, 476, 33, 8381, 4672, 364, 1241, 316, 1241, 682, 30, 910, 1095, 1609, 72, 16, 910, 1095, ...
try: body = [output, extra] except NameError: body = [output]
body = [output]
def perform_modifydbquery(colID, ln, dbquery='', callback='yes', confirm=-1): """form to modify the dbquery of the collection. dbquery - the dbquery of the collection.""" subtitle = '' output = "" col_dict = dict(get_def_name('', "collection")) if colID and col_dict.has_key(int(colID)): colID = int(colID) subtitle = """<a name="1">1. Modify collection query for collection '%s'</a>&nbsp;&nbsp&nbsp;<small>[<a title="See guide" href="%s/admin/websearch/guide.html#3.1">?</a>]</small>""" % (col_dict[colID], weburl) if confirm == -1: res = run_sql("SELECT dbquery FROM collection WHERE id=%s" % colID) dbquery = res[0][0] if not dbquery: dbquery = '' reg_sons = len(get_col_tree(colID, 'r')) vir_sons = len(get_col_tree(colID, 'v')) if reg_sons > 1: if dbquery: output += "Warning: This collection got subcollections, and should because of this not have a collection query, for further explanation, check the WebSearch Guide<br>" elif reg_sons <= 1: if not dbquery: output += "Warning: This collection does not have any subcollections, and should because of this have a collection query, for further explanation, check the WebSearch Guide<br>" text = """ <span class="adminlabel">Query</span> <input class="admin_w200" type="text" name="dbquery" value="%s" /><br> """ % dbquery output += createhiddenform(action="modifydbquery", text=text, button="Modify", colID=colID, ln=ln, confirm=1) if confirm in ["1", 1]: res = modify_dbquery(colID, dbquery) if res: if dbquery == "": text = """<b><span class="info">Query removed for this collection.</span></b>""" else: text = """<b><span class="info">Query set for this collection.</span></b>""" else: text = """<b><span class="info">Sorry, could not change query.</span></b>""" output += text try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_modifydbquery", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body)
8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec/websearchadminlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 17042, 1966, 2271, 12, 1293, 734, 16, 7211, 16, 1319, 2271, 2218, 2187, 1348, 2218, 9707, 2187, 6932, 29711, 21, 4672, 3536, 687, 358, 5612, 326, 1319, 2271, 434, 326, 1849, 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, 3073, 67, 17042, 1966, 2271, 12, 1293, 734, 16, 7211, 16, 1319, 2271, 2218, 2187, 1348, 2218, 9707, 2187, 6932, 29711, 21, 4672, 3536, 687, 358, 5612, 326, 1319, 2271, 434, 326, 1849, 18...
"WHERE _ROWID_ = NEW._ROWID_ " %(table, column))
"WHERE _ROWID_ = NEW._ROWID_ ; " %(table, column))
def createTrigger(self, table, column, onAction, pinned=False): onAction = onAction.lower() name = "%s_%s" % (table, onAction) assert(onAction in ["insert", "update"])
490a0284cbbb406b602ed786a560a158b7f2ee9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/490a0284cbbb406b602ed786a560a158b7f2ee9f/schema.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 6518, 12, 2890, 16, 1014, 16, 1057, 16, 603, 1803, 16, 26193, 33, 8381, 4672, 603, 1803, 273, 603, 1803, 18, 8167, 1435, 508, 273, 2213, 87, 10185, 87, 6, 738, 261, 2121, 16, 60...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 6518, 12, 2890, 16, 1014, 16, 1057, 16, 603, 1803, 16, 26193, 33, 8381, 4672, 603, 1803, 273, 603, 1803, 18, 8167, 1435, 508, 273, 2213, 87, 10185, 87, 6, 738, 261, 2121, 16, 60...
n = ((n+3)/4)*4
n = ((n+3)//4)*4
def pack_fstring(self, n, s): if n < 0: raise ValueError, 'fstring size must be nonnegative' data = s[:n] n = ((n+3)/4)*4 data = data + (n - len(data)) * '\0' self.__buf.write(data)
948da7c4ce62c3623afbd99187d995403d1c213f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/948da7c4ce62c3623afbd99187d995403d1c213f/xdrlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2298, 67, 74, 1080, 12, 2890, 16, 290, 16, 272, 4672, 309, 290, 411, 374, 30, 1002, 2068, 16, 296, 74, 1080, 963, 1297, 506, 1661, 13258, 11, 501, 273, 272, 10531, 82, 65, 290, 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, 2298, 67, 74, 1080, 12, 2890, 16, 290, 16, 272, 4672, 309, 290, 411, 374, 30, 1002, 2068, 16, 296, 74, 1080, 963, 1297, 506, 1661, 13258, 11, 501, 273, 272, 10531, 82, 65, 290, 273, ...
""" Send a command, and return its response code """
"""Send a command, and return its response code."""
def docmd(self, cmd, args=""): """ Send a command, and return its response code """ self.putcmd(cmd,args) (code,msg)=self.getreply() return code
de1c0a3c6cefc0960617175f1a9491221d9defa6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/de1c0a3c6cefc0960617175f1a9491221d9defa6/smtplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1264, 12, 2890, 16, 1797, 16, 833, 1546, 6, 4672, 3536, 3826, 279, 1296, 16, 471, 327, 2097, 766, 981, 12123, 365, 18, 458, 4172, 12, 4172, 16, 1968, 13, 261, 710, 16, 3576, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 997, 1264, 12, 2890, 16, 1797, 16, 833, 1546, 6, 4672, 3536, 3826, 279, 1296, 16, 471, 327, 2097, 766, 981, 12123, 365, 18, 458, 4172, 12, 4172, 16, 1968, 13, 261, 710, 16, 3576, 13,...
mosue button is used.
mouse button is used
def __set_initial_values_to_member_variables(self, parent): """ Set initial values to member variables.
9ae715a5e5636a399b096e5ae41244f4b45b148e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5252/9ae715a5e5636a399b096e5ae41244f4b45b148e/gui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 67, 6769, 67, 2372, 67, 869, 67, 5990, 67, 7528, 12, 2890, 16, 982, 4672, 3536, 1000, 2172, 924, 358, 3140, 3152, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 542, 67, 6769, 67, 2372, 67, 869, 67, 5990, 67, 7528, 12, 2890, 16, 982, 4672, 3536, 1000, 2172, 924, 358, 3140, 3152, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100...
except Exception, e:
except Exception:
def _process_end(self, cr, uid, modules): if not modules: return True modules = list(modules) module_in = ",".join(["%s"] * len(modules)) cr.execute('select id,name,model,res_id,module from ir_model_data where module in (' + module_in + ') and noupdate=%s', modules + [False]) wkf_todo = [] for (id, name, model, res_id,module) in cr.fetchall(): if (module,name) not in self.loads: self.unlink_mark[(model,res_id)] = id if model=='workflow.activity': cr.execute('select res_type,res_id from wkf_instance where id in (select inst_id from wkf_workitem where act_id=%s)', (res_id,)) wkf_todo.extend(cr.fetchall()) cr.execute("update wkf_transition set condition='True', role_id=NULL, signal=NULL,act_to=act_from,act_from=%s where act_to=%s", (res_id,res_id)) cr.execute("delete from wkf_transition where act_to=%s", (res_id,))
a87d9064378fdedc4e5772c458222d78e2fcacd5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/a87d9064378fdedc4e5772c458222d78e2fcacd5/ir_model.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 409, 12, 2890, 16, 4422, 16, 4555, 16, 4381, 4672, 309, 486, 4381, 30, 327, 1053, 4381, 273, 666, 12, 6400, 13, 1605, 67, 267, 273, 5753, 18, 5701, 3816, 28385, 87, 11...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2567, 67, 409, 12, 2890, 16, 4422, 16, 4555, 16, 4381, 4672, 309, 486, 4381, 30, 327, 1053, 4381, 273, 666, 12, 6400, 13, 1605, 67, 267, 273, 5753, 18, 5701, 3816, 28385, 87, 11...
this = apply(_quickfix.new_AssignmentUnit, args)
this = _quickfix.new_AssignmentUnit(*args)
def __init__(self, *args): this = apply(_quickfix.new_AssignmentUnit, args) try: self.this.append(this) except: self.this = this
7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 7729, 2802, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 4672, 333, 273, 389, 19525, 904, 18, 2704, 67, 7729, 2802, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 365, 1...
raise "No children allowed"
msg = "No children allowed. Found '%s'" % name raise SyntaxError, msg
def child(self, name, atts): raise "No children allowed"
4c0a2919ecd746999a7f6c0bac713439432a104d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7049/4c0a2919ecd746999a7f6c0bac713439432a104d/handlers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1151, 12, 2890, 16, 508, 16, 15687, 4672, 1234, 273, 315, 2279, 2325, 2935, 18, 10750, 1995, 87, 4970, 738, 508, 1002, 18453, 16, 1234, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 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, 1151, 12, 2890, 16, 508, 16, 15687, 4672, 1234, 273, 315, 2279, 2325, 2935, 18, 10750, 1995, 87, 4970, 738, 508, 1002, 18453, 16, 1234, 225, 2, -100, -100, -100, -100, -100, -100, -100, ...
if options.for_qemu not in ('true', 'false'): parser.error("Please specify either true or false for --for_qemu")
if options.enable_tablet not in ('true', 'false'): parser.error("Please specify either true or false for --enable_tablet")
def main(): parser = OptionParser(USAGE) parser.add_option('--mounted_dir', dest='mounted_dir', help='directory where the Chromium OS image is mounted') parser.add_option('--for_qemu', dest='for_qemu', default="true", help='fixup image for qemu') (options, args) = parser.parse_args() if not options.mounted_dir: parser.error("Please specify the mount point for the Chromium OS image"); if options.for_qemu not in ('true', 'false'): parser.error("Please specify either true or false for --for_qemu") FixPostInst(options.mounted_dir) if (options.for_qemu == 'true'): FixXorgConf(options.mounted_dir)
e79e88eb0ebd00998aa9feb256b8c6aaf21e4842 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9626/e79e88eb0ebd00998aa9feb256b8c6aaf21e4842/fixup_image_for_qemu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 12, 29550, 13, 2082, 18, 1289, 67, 3482, 2668, 413, 4778, 329, 67, 1214, 2187, 1570, 2218, 4778, 329, 67, 1214, 2187, 2809, 2218, 5149, 1625, 326, 1680, 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, 2774, 13332, 2082, 273, 18862, 12, 29550, 13, 2082, 18, 1289, 67, 3482, 2668, 413, 4778, 329, 67, 1214, 2187, 1570, 2218, 4778, 329, 67, 1214, 2187, 2809, 2218, 5149, 1625, 326, 1680, 52...
if strob is not None:
if strob is not None and strob != '' and int(strob) > 0:
def setLight(self, rgb=None, led10w1=None, led10w2=None, strob=None, fade=None): cmd = 'setlight' if strob is not None: cmd += ' -strob {0}'.format(int(strob)) if fade is not None: cmd += ' -fade {0}'.format(int(fade)) if rgb is not None: rgb = re.split('\W+', rgb) if len(rgb) == 0: rgb = str(rgb) rgb = rgb.lstrip('#') lv = len(rgb) rgb = list(str(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3)) # TODO DEBUG HERE value if len(rgb) == 3: cmd += ' -rgb {R} {G} {B}'.format(R=rgb[0], G=rgb[1], B=rgb[2]) if led10w1 is not None: cmd += ' -10w1 {0}'.format(int(led10w1)) if led10w2 is not None: cmd += ' -10w2 {0}'.format(int(led10w2))
fc75a516b6dfa9066d5032825999aa295075cdd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4363/fc75a516b6dfa9066d5032825999aa295075cdd6/kxkmcard.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 12128, 12, 2890, 16, 6917, 33, 7036, 16, 12987, 2163, 91, 21, 33, 7036, 16, 12987, 2163, 91, 22, 33, 7036, 16, 384, 303, 70, 33, 7036, 16, 24444, 33, 7036, 4672, 1797, 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, 444, 12128, 12, 2890, 16, 6917, 33, 7036, 16, 12987, 2163, 91, 21, 33, 7036, 16, 12987, 2163, 91, 22, 33, 7036, 16, 384, 303, 70, 33, 7036, 16, 24444, 33, 7036, 4672, 1797, 273, 296,...
None, [STRING],
None, [STRING],
def fl_add_fselector_appbutton(p1, py_fn, p3): """ fl_add_fselector_appbutton(p1, py_fn, p3) """ c_fn = cfunc_none_voidp(py_fn) _cfunc_refs[get_rand_dictkey()] = c_fn _fl_add_fselector_appbutton(p1, c_fn, p3)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 1289, 67, 74, 9663, 67, 2910, 5391, 12, 84, 21, 16, 2395, 67, 4293, 16, 293, 23, 4672, 3536, 1183, 67, 1289, 67, 74, 9663, 67, 2910, 5391, 12, 84, 21, 16, 2395, 67, 4293,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 1289, 67, 74, 9663, 67, 2910, 5391, 12, 84, 21, 16, 2395, 67, 4293, 16, 293, 23, 4672, 3536, 1183, 67, 1289, 67, 74, 9663, 67, 2910, 5391, 12, 84, 21, 16, 2395, 67, 4293,...
* conditions is a dictionary keyed on column names
* conditions - a dictionary keyed on column names
def Select(self, table, columns, conditions={}): """Select(table, conditions) - retrieve specific row data Returns a list of row column->value mapping dictionaries. * columns is a list of which column data to return. If columns is None, all columns will be returned. * conditions is a dictionary keyed on column names containing callable conditions expecting the data string as an argument and returning a boolean. """ try: if not self.__tablecolumns.has_key(table): self.__load_column_info(table) if columns is None: columns = self.__tablecolumns[table] matching_rowids = self.__Select(table, columns, conditions) except DBError, dberror: raise TableDBError, dberror[1] # return the matches as a list of dictionaries return matching_rowids.values()
2f402c360391b04790d2fa168370966eb65ae848 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2f402c360391b04790d2fa168370966eb65ae848/dbtables.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6766, 12, 2890, 16, 1014, 16, 2168, 16, 4636, 12938, 4672, 3536, 3391, 12, 2121, 16, 4636, 13, 300, 4614, 2923, 1027, 501, 2860, 279, 666, 434, 1027, 1057, 2122, 1132, 2874, 16176, 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, 6766, 12, 2890, 16, 1014, 16, 2168, 16, 4636, 12938, 4672, 3536, 3391, 12, 2121, 16, 4636, 13, 300, 4614, 2923, 1027, 501, 2860, 279, 666, 434, 1027, 1057, 2122, 1132, 2874, 16176, 18, ...
if self.CPU_clock: gobject.source_remove(self.CPU_clock)
if self.timer: gobject.source_remove(self.timer)
def pause_CPU(self, widget, *args, **kwargs): # FIXME abstract that properly. if self.CPU_clock: gobject.source_remove(self.CPU_clock) widget.set_label("_Continue") self.CPU_clock = None else: self.CPU_clock = gobject.timeout_add(10, C64.iterate) widget.set_label("_Pause")
52bcc440ddde00bc85a828905af3df81bdaa9e84 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6661/52bcc440ddde00bc85a828905af3df81bdaa9e84/gdisplay.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11722, 67, 15222, 12, 2890, 16, 3604, 16, 380, 1968, 16, 2826, 4333, 4672, 468, 9852, 8770, 716, 8214, 18, 309, 365, 18, 12542, 30, 314, 1612, 18, 3168, 67, 4479, 12, 2890, 18, 12542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11722, 67, 15222, 12, 2890, 16, 3604, 16, 380, 1968, 16, 2826, 4333, 4672, 468, 9852, 8770, 716, 8214, 18, 309, 365, 18, 12542, 30, 314, 1612, 18, 3168, 67, 4479, 12, 2890, 18, 12542, ...
self.lyric_artist_title.set_markup("<b>" + song.getArtist() + " - " + song.getTitle() + "</b>")
self.lyric_artist_title.set_markup("<b>" + escape(song.getArtist()) + " - " + escape(song.getTitle()) + "</b>")
def update_lyrics(self, song): if song.getArtist() and song.getTitle(): try: lyric = get_lyrics(song.getArtist(), song.getTitle()) except: lyric = None LOG.error("Lyrics get error") pass if lyric: self.lyrics_buffer.set_text(lyric) else: self.lyrics_buffer.set_text(_("Lyric not found")) self.lyric_artist_title.set_markup("<b>" + song.getArtist() + " - " + song.getTitle() + "</b>") self.current_song_label.set_markup("<b>" + song.getTitle() + "</b>")
727a0daffe1ac8db5409563a3a6fe4c682e21a0d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14563/727a0daffe1ac8db5409563a3a6fe4c682e21a0d/information_controller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 715, 1512, 87, 12, 2890, 16, 17180, 4672, 309, 17180, 18, 588, 4411, 376, 1435, 471, 17180, 18, 588, 4247, 13332, 775, 30, 18519, 1512, 273, 336, 67, 715, 1512, 87, 12, 816, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 715, 1512, 87, 12, 2890, 16, 17180, 4672, 309, 17180, 18, 588, 4411, 376, 1435, 471, 17180, 18, 588, 4247, 13332, 775, 30, 18519, 1512, 273, 336, 67, 715, 1512, 87, 12, 816, ...
FL_Coord, STRING],
FL_Coord, STRING],
def fl_create_pixmapbutton(type, x, y, w, h, label): """ fl_create_pixmapbutton(type, x, y, w, h, label) -> object """ retval = _fl_create_pixmapbutton(type, x, y, w, h, label) return retval
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 14861, 1458, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 14861, 1458, 5391, 12, 723, 16, 619, 16, 677, 16, 341, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 2640, 67, 14861, 1458, 5391, 12, 723, 16, 619, 16, 677, 16, 341, 16, 366, 16, 1433, 4672, 3536, 1183, 67, 2640, 67, 14861, 1458, 5391, 12, 723, 16, 619, 16, 677, 16, 341, ...
file.close()
raise UserCreationError() try: lines = users_file.readlines() except IOError, e: logging.critical("There was an error reading the users file (%s). The " "error is: %s." % (User.users_file, e)) raise UserCreationError() users_file.close()
def create_user(name): """Creates a new User. Writes an entry in users.txt for the new user. Exceptions: If the specified name contains any characters other than letters, numbers, or spaces, raises an InvalidNameError. If another user exists with this name, raises a NameAlreadyExistsError. """ # TODO Validate name try: file = open(User.users_file) lines = file.readlines() except IOError, e: logging.critical("There was an error opening the users file (%s). The " "error is: %s." % (User.users_file, e)) file.close() ids = [] names = [] for line in files: entry = line.split(':') if len(entry) != 2: logging.error("There is an invalid entry in the users file: %s. " "Skipping this entry." % line) ids.append(entry[0]) names.append(entry[1]) if name in names: raise NameAlreadyExistsError() id = randint(1000, 9999) while str(id) in ids: id = random.randint(1000, 9999) try: file = open(User.users_file, 'a') file.write("%s:%s\n" % (id, name)) except IOError, e: logging.critical("There was an error opening the users file (%s). The " "error is: %s." % (User.users_file, e)) file.close() return User(id)
feaeaa92c068a38b62d763b0747751948256dbfa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2803/feaeaa92c068a38b62d763b0747751948256dbfa/user.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 1355, 12, 529, 4672, 3536, 2729, 279, 394, 2177, 18, 30053, 392, 1241, 316, 3677, 18, 5830, 364, 326, 394, 729, 18, 12781, 30, 971, 326, 1269, 508, 1914, 1281, 3949, 1308, 235...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 1355, 12, 529, 4672, 3536, 2729, 279, 394, 2177, 18, 30053, 392, 1241, 316, 3677, 18, 5830, 364, 326, 394, 729, 18, 12781, 30, 971, 326, 1269, 508, 1914, 1281, 3949, 1308, 235...
if role in (controlTypes.ROLE_PARAGRAPH, controlTypes.ROLE_EDITABLETEXT):
if ignoreEditableText and role in (controlTypes.ROLE_PARAGRAPH, controlTypes.ROLE_EDITABLETEXT):
def _getControlFieldForObject(self, obj): role = obj.role if role in (controlTypes.ROLE_PARAGRAPH, controlTypes.ROLE_EDITABLETEXT): # This is basically just a text node. return None field = textInfos.ControlField() field["role"] = obj.role states = obj.states # The user doesn't care about certain states, as they are obvious. states.discard(controlTypes.STATE_EDITABLE) states.discard(controlTypes.STATE_MULTILINE) states.discard(controlTypes.STATE_FOCUSED) field["states"] = states field["name"] = obj.name field["_childcount"] = obj.childCount field["level"] = obj.positionInfo.get("level") if role == controlTypes.ROLE_TABLE: field["table-id"] = 1 # FIXME field["table-rowcount"] = obj.rowCount field["table-columncount"] = obj.columnCount if role in (controlTypes.ROLE_TABLECELL, controlTypes.ROLE_TABLECOLUMNHEADER, controlTypes.ROLE_TABLEROWHEADER): field["table-id"] = 1 # FIXME field["table-rownumber"] = obj.rowNumber field["table-columnnumber"] = obj.columnNumber return field
45ccf301ea23d908cbe16950df13a73867e8dc51 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/45ccf301ea23d908cbe16950df13a73867e8dc51/compoundDocuments.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3367, 974, 1290, 921, 12, 2890, 16, 1081, 4672, 2478, 273, 1081, 18, 4615, 309, 2305, 15470, 1528, 471, 2478, 316, 261, 7098, 2016, 18, 16256, 67, 2778, 1781, 54, 18045, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 3367, 974, 1290, 921, 12, 2890, 16, 1081, 4672, 2478, 273, 1081, 18, 4615, 309, 2305, 15470, 1528, 471, 2478, 316, 261, 7098, 2016, 18, 16256, 67, 2778, 1781, 54, 18045, 16, ...
res.container = self.container
res.container = copy.deepcopy(self.container)
def __add__(self,other): """ >>> c1=SparseIntVect(10) >>> c1[0] = 3 >>> c1[4] = 5 >>> c2=SparseIntVect(10) >>> c2[0] = 2 >>> c2[5] = 6 >>> c3 = c2+c1 >>> [x for x in c3] [(0, 5), (4, 5), (5, 6)]
1f2aff8a3b0d18e01d45b5ef21647527796baefb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9195/1f2aff8a3b0d18e01d45b5ef21647527796baefb/SparseIntVect.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 972, 12, 2890, 16, 3011, 4672, 3536, 4080, 276, 21, 33, 20565, 1702, 58, 386, 12, 2163, 13, 4080, 276, 21, 63, 20, 65, 273, 890, 4080, 276, 21, 63, 24, 65, 273, 1381, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1289, 972, 12, 2890, 16, 3011, 4672, 3536, 4080, 276, 21, 33, 20565, 1702, 58, 386, 12, 2163, 13, 4080, 276, 21, 63, 20, 65, 273, 890, 4080, 276, 21, 63, 24, 65, 273, 1381, 4...
if values[0].isdigit():
ctid = values[0][:-1] if ctid.isdigit():
def _parse(self): """ Parse /proc/user_beancounters and store the values in the object """ # TODO adjust the code to also parse more than one container so that we # could also run on a container node ubc_file = open(self._filename, 'r') self._resources = {} for line in ubc_file: values = line.strip().split() values_len = len(values) if values_len == 2: self._bc_version = values[1] elif values_len >= 6: if values_len == 7: if values[0].isdigit(): # we got the container id self._container_id = values[0] else: # header line continue del values[0] resource_name = values[0] resource_values = values[1:] # skip the name self._resources[resource_name] = VzUbcMonResource(resource_seq=resource_values)
ccc1039dd30bf9c266d22f0c12f314778e624c0e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12019/ccc1039dd30bf9c266d22f0c12f314778e624c0e/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 12, 2890, 4672, 3536, 2884, 342, 9381, 19, 1355, 67, 14496, 23426, 471, 1707, 326, 924, 316, 326, 733, 3536, 468, 2660, 5765, 326, 981, 358, 2546, 1109, 1898, 2353, 1245, 1478...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 2890, 4672, 3536, 2884, 342, 9381, 19, 1355, 67, 14496, 23426, 471, 1707, 326, 924, 316, 326, 733, 3536, 468, 2660, 5765, 326, 981, 358, 2546, 1109, 1898, 2353, 1245, 1478...
paths_edited.append(path)
files_edited.append(path)
def attrs_equal(attrs, a, b): for attr in attrs: if getattr(a, attr) != getattr(b, attr): return False
429032fa7a0adc75619ec1c9f5d039321108985f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10616/429032fa7a0adc75619ec1c9f5d039321108985f/dirindex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3422, 67, 9729, 12, 7039, 16, 279, 16, 324, 4672, 364, 1604, 316, 3422, 30, 309, 3869, 12, 69, 16, 1604, 13, 480, 3869, 12, 70, 16, 1604, 4672, 327, 1083, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3422, 67, 9729, 12, 7039, 16, 279, 16, 324, 4672, 364, 1604, 316, 3422, 30, 309, 3869, 12, 69, 16, 1604, 13, 480, 3869, 12, 70, 16, 1604, 4672, 327, 1083, 2, -100, -100, -100, -100, ...
state = "gone"
state = _("gone")
def run(self):
d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d/proximity.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
sage: MS = MatrixSpace(ZZ, 2) sage: a = list(MS) Traceback (most recent call last): ... NotImplementedError: object does not support iteration
sage: MS = MatrixSpace(ZZ, 2, 3) sage: i = iter(MS) sage: a = [ i.next() for _ in range(6) ] sage: a[0] [0 0 0] [0 0 0] sage: a[4] [0 0 0] [1 0 0]
def __iter__(self): """ EXAMPLES: sage: MS = MatrixSpace(GF(2),2) sage: a = list(MS) sage: len(a) 16 sage: a[0] [0 0] [0 0]
88ca56dcdc705a815cdb5722c4d420f776b1e36e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/88ca56dcdc705a815cdb5722c4d420f776b1e36e/matrix_space.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 12, 2890, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 9238, 273, 7298, 3819, 12, 43, 42, 12, 22, 3631, 22, 13, 272, 410, 30, 279, 273, 666, 12, 3537, 13, 272, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2165, 972, 12, 2890, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 9238, 273, 7298, 3819, 12, 43, 42, 12, 22, 3631, 22, 13, 272, 410, 30, 279, 273, 666, 12, 3537, 13, 272, ...
str += ' '*depth + ' </UL>\n'
str += ' '*depth + ' </ul>\n'
def _class_tree_item(self, uid=None, depth=0): if uid is not None: doc = self._docmap.get(uid, None) str = ' '*depth + '<LI> <B>' + self._uid_to_href(uid)+'</B>' if doc and doc.descr(): str += ': <I>' + self._summary(doc) + '</I>' str += '\n' if doc and doc.children(): str += ' '*depth + ' <UL>\n' children = [l.target() for l in doc.children()] children.sort() for child in children: str += self._class_tree_item(child, depth+4) str += ' '*depth + ' </UL>\n' return str
89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/89bd16eaf8c7e556babe42c6a92621dbc9b8a7e9/html.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1106, 67, 3413, 67, 1726, 12, 2890, 16, 4555, 33, 7036, 16, 3598, 33, 20, 4672, 309, 4555, 353, 486, 599, 30, 997, 273, 365, 6315, 2434, 1458, 18, 588, 12, 1911, 16, 599, 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, 389, 1106, 67, 3413, 67, 1726, 12, 2890, 16, 4555, 33, 7036, 16, 3598, 33, 20, 4672, 309, 4555, 353, 486, 599, 30, 997, 273, 365, 6315, 2434, 1458, 18, 588, 12, 1911, 16, 599, 13, ...
try: self.origin = attrs["origin"] except KeyError: pass try: self.type = attrs["type"] except KeyError: pass
for attrname in ("origin", "type", "pubdate", "refreshdate"): try: setattr(self, attrname, attrs[attrname]) except KeyError: pass
def start_element(self, name, attrs): self.data = "" self.parent.append(XMLTag(name, attrs)) if name == "file": fileobj = MetalinkFile(attrs["name"], attrs) self.files.append(fileobj) if name == "metalink": try: self.origin = attrs["origin"] except KeyError: pass try: self.type = attrs["type"] except KeyError: pass
6e89e1cb38fca06747d95fc9b91e67d285a75e4e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6425/6e89e1cb38fca06747d95fc9b91e67d285a75e4e/metalink.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 67, 2956, 12, 2890, 16, 508, 16, 3422, 4672, 365, 18, 892, 273, 1408, 365, 18, 2938, 18, 6923, 12, 4201, 1805, 12, 529, 16, 3422, 3719, 309, 508, 422, 315, 768, 6877, 17041, 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, 787, 67, 2956, 12, 2890, 16, 508, 16, 3422, 4672, 365, 18, 892, 273, 1408, 365, 18, 2938, 18, 6923, 12, 4201, 1805, 12, 529, 16, 3422, 3719, 309, 508, 422, 315, 768, 6877, 17041, 273...
def __init__( self , ref_el , a , b , m ):
def __init__( self , ref_el , m ):
def __init__( self , ref_el , a , b , m ): # this gives roots on the default (-1,1) reference element (xs_ref,ws_ref) = compute_gauss_jacobi_rule( a , b , m )
9763c2aa9ced5be1f6bdc4b19ca4726449e6c9b2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/625/9763c2aa9ced5be1f6bdc4b19ca4726449e6c9b2/quadrature.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1001, 2738, 972, 12, 365, 269, 1278, 67, 292, 269, 312, 262, 30, 468, 333, 14758, 12876, 603, 326, 805, 24927, 21, 16, 21, 13, 2114, 930, 261, 13713, 67, 1734, 16, 4749, 67, 173...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 225, 1652, 1001, 2738, 972, 12, 365, 269, 1278, 67, 292, 269, 312, 262, 30, 468, 333, 14758, 12876, 603, 326, 805, 24927, 21, 16, 21, 13, 2114, 930, 261, 13713, 67, 1734, 16, 4749, 67, 173...
start_list = os.path.abspath(start).split(sep) path_list = os.path.abspath(path).split(sep)
start_list = posixpath.abspath(start).split(sep) path_list = posixpath.abspath(path).split(sep)
def relpath(self, path, start=os.curdir, sep="/"): # Relpath implementation directly ripped and modified from Python 2.6 source. if not path: raise ValueError("no path specified") start_list = os.path.abspath(start).split(sep) path_list = os.path.abspath(path).split(sep) # Work out how much of the filepath is shared by start and path. i = len(self.commonprefix([start_list, path_list])) rel_list = [".."] * (len(start_list)-i) + path_list[i:] if not rel_list: return os.curdir return os.path.join(*rel_list)
9f95d6e0c2518cceab2e48bf9309c695c0495921 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4412/9f95d6e0c2518cceab2e48bf9309c695c0495921/baseClass.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14614, 12, 2890, 16, 589, 16, 787, 33, 538, 18, 1397, 1214, 16, 5478, 1546, 4898, 4672, 468, 4275, 803, 4471, 5122, 436, 625, 1845, 471, 4358, 628, 6600, 576, 18, 26, 1084, 18, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14614, 12, 2890, 16, 589, 16, 787, 33, 538, 18, 1397, 1214, 16, 5478, 1546, 4898, 4672, 468, 4275, 803, 4471, 5122, 436, 625, 1845, 471, 4358, 628, 6600, 576, 18, 26, 1084, 18, 309, ...
class pAdicGeneralExtensionRingCappedRelative(pAdicGeneralExtensionGeneric, pAdicCappedRelativeRingGeneric): def __init__(self, upoly, epoly, poly, prec, halt, print_mode, names): pAdicGeneralExtensionGeneric.__init__(self, upoly, epoly, poly, prec, print_mode, names, pAdicGeneralExtensionCappedRelativeElement)
def gen(self, n=0): if n != 0: raise IndexError, "extension has only one generator" #this won't work for padic_general extensions return self([0,1])
b9ffa8b1f92ad68de3210909edfe6b8fd5f5e7af /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/b9ffa8b1f92ad68de3210909edfe6b8fd5f5e7af/padic_extension_leaves.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 12, 2890, 16, 290, 33, 20, 4672, 309, 290, 480, 374, 30, 1002, 10195, 16, 315, 6447, 711, 1338, 1245, 4456, 6, 468, 2211, 8462, 1404, 1440, 364, 4627, 335, 67, 12259, 4418, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3157, 12, 2890, 16, 290, 33, 20, 4672, 309, 290, 480, 374, 30, 1002, 10195, 16, 315, 6447, 711, 1338, 1245, 4456, 6, 468, 2211, 8462, 1404, 1440, 364, 4627, 335, 67, 12259, 4418, 327, ...
def call_from_main(function, *args, **kargs):
def call_from_main(function, *args, **kwargs):
def call_from_main(function, *args, **kargs): """ Call a function from the main loop. The function isn't called when this function is called, it is called when the watcher in the main loop is called by the notifier. """ _lock.acquire() _callbacks.append(function, args, kwargs) _lock.release()
f41c59697541559111e0ed3c147dff9bc6697de4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/f41c59697541559111e0ed3c147dff9bc6697de4/fthread.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 2080, 67, 5254, 12, 915, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 3049, 279, 445, 628, 326, 2774, 2798, 18, 1021, 445, 5177, 1404, 2566, 1347, 333, 445, 353, 2566, 16, 518, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 745, 67, 2080, 67, 5254, 12, 915, 16, 380, 1968, 16, 2826, 4333, 4672, 3536, 3049, 279, 445, 628, 326, 2774, 2798, 18, 1021, 445, 5177, 1404, 2566, 1347, 333, 445, 353, 2566, 16, 518, ...
def __init__(self, cb):
def __init__(self):
def __init__(self, cb): gtk.HBox.__init__(self) combo = gtk.ComboBox(PlayList.lists_model()) cell = gtk.CellRendererText() combo.pack_start(cell, True) combo.add_attribute(cell, 'text', 0) combo.set_active(0) self.pack_start(combo)
9c701556952d3e0476b1cdf1642f5c98851e8063 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/9c701556952d3e0476b1cdf1642f5c98851e8063/widgets.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 4672, 22718, 18, 44, 3514, 16186, 2738, 972, 12, 2890, 13, 16778, 273, 22718, 18, 22199, 12, 11765, 682, 18, 9772, 67, 2284, 10756, 2484, 273, 22718, 18, 4020,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22718, 18, 44, 3514, 16186, 2738, 972, 12, 2890, 13, 16778, 273, 22718, 18, 22199, 12, 11765, 682, 18, 9772, 67, 2284, 10756, 2484, 273, 22718, 18, 4020,...
def __new__(cls, resource_or_realm=False, id=False, version=False,
def __new__(cls, resource_or_realm=None, id=False, version=False,
def __new__(cls, resource_or_realm=False, id=False, version=False, parent=False): """Create a new Resource object from a specification.
75bd55f0befa2ad8587922b3c0301bb899356248 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/75bd55f0befa2ad8587922b3c0301bb899356248/resource.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2704, 972, 12, 6429, 16, 1058, 67, 280, 67, 24056, 33, 7036, 16, 612, 33, 8381, 16, 1177, 33, 8381, 16, 982, 33, 8381, 4672, 3536, 1684, 279, 394, 2591, 733, 628, 279, 7490, 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, 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, 2704, 972, 12, 6429, 16, 1058, 67, 280, 67, 24056, 33, 7036, 16, 612, 33, 8381, 16, 1177, 33, 8381, 16, 982, 33, 8381, 4672, 3536, 1684, 279, 394, 2591, 733, 628, 279, 7490, 18...
except timeout, (strerror):
except socket.timeout:
def Test3(udpsock, serveraddr): """ The client sends a request asking to receive an echo from the same address but from a different port on the address and port the request came from """ retVal = {"resp":False, "ex_ip":None, "ex_port":None} BUFSIZ = 1024 reply = "" request = "ping3" udpsock.sendto(request, serveraddr) try: reply, rcvaddr = udpsock.recvfrom(BUFSIZ) except timeout, (strerror): return retVal except ValueError, (strerror): if DEBUG: print >> sys.stderr, "NATCheck:", "Could not receive data: %s" % (strerror) return retVal except error, (errno, strerror): if DEBUG: print >> sys.stderr, "NATCheck:", "Could not receive data: %s" % (strerror) return retVal ex_ip, ex_port = reply.split(":") retVal["resp"] = True retVal["ex_ip"] = ex_ip retVal["ex_port"] = ex_port return retVal
68ebc7081d02ad719eccc360ae365de6cf099732 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9686/68ebc7081d02ad719eccc360ae365de6cf099732/NatCheck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7766, 23, 12, 1100, 1121, 975, 16, 1438, 4793, 4672, 3536, 1021, 1004, 9573, 279, 590, 29288, 358, 6798, 392, 3376, 628, 326, 1967, 1758, 1496, 628, 279, 3775, 1756, 603, 326, 1758, 471,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7766, 23, 12, 1100, 1121, 975, 16, 1438, 4793, 4672, 3536, 1021, 1004, 9573, 279, 590, 29288, 358, 6798, 392, 3376, 628, 326, 1967, 1758, 1496, 628, 279, 3775, 1756, 603, 326, 1758, 471,...
try: body = [fin_output, extra] except NameError: body = [fin_output]
body = [fin_output]
def perform_index(colID=1, ln=cdslang, mtype='', content='', confirm=0): """The index method, calling methods to show the collection tree, create new collections and add collections to tree. """ subtitle = "Overview" colID = int(colID) col_dict = dict(get_def_name('', "collection")) output = "" fin_output = "" if not col_dict.has_key(1): res = add_col(cdsname, '', '') if res: fin_output += """<b><span class="info">Created root collection.</span></b><br>""" else: return "Cannot create root collection, please check database." if cdsname != run_sql("SELECT name from collection WHERE id=1")[0][0]: res = run_sql("update collection set name='%s' where id=1" % cdsname) if res: fin_output += """<b><span class="info">The name of the root collection has been modified to be the same as the CDS Invenio installation name given prior to installing CDS Invenio.</span><b><br>""" else: return "Error renaming root collection." fin_output += """ <table> <tr> <td>0.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_showall">Show all</a></small></td> <td>1.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_addcollection">Create new collection</a></small></td> <td>2.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_addcollectiontotree">Attach collection to tree</a></small></td> <td>3.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_modifycollectiontree">Modify collection tree</a></small></td> <td>4.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_checkwebcollstatus">Webcoll Status</a></small></td> </tr><tr> <td>5.&nbsp;<small><a href="%s/admin/websearch/websearchadmin.py?colID=%s&amp;ln=%s&amp;mtype=perform_checkcollectionstatus">Collections Status</a></small></td> </tr> </table> """ % (weburl, colID, ln, weburl, colID, ln, weburl, colID, ln, weburl, colID, ln, weburl, colID, ln, weburl, colID, ln) if mtype == "": fin_output += """<br><br><b><span class="info">For managing the collections, select an item from the menu.</span><b><br>""" if mtype == "perform_addcollection" and content: fin_output += content elif mtype == "perform_addcollection" or mtype == "perform_showall": fin_output += perform_addcollection(colID=colID, ln=ln, callback='') fin_output += "<br>" if mtype == "perform_addcollectiontotree" and content: fin_output += content elif mtype == "perform_addcollectiontotree" or mtype == "perform_showall": fin_output += perform_addcollectiontotree(colID=colID, ln=ln, callback='') fin_output += "<br>" if mtype == "perform_modifycollectiontree" and content: fin_output += content elif mtype == "perform_modifycollectiontree" or mtype == "perform_showall": fin_output += perform_modifycollectiontree(colID=colID, ln=ln, callback='') fin_output += "<br>" if mtype == "perform_checkwebcollstatus" and content: fin_output += content elif mtype == "perform_checkwebcollstatus" or mtype == "perform_showall": fin_output += perform_checkwebcollstatus(colID, ln, callback='') if mtype == "perform_checkcollectionstatus" and content: fin_output += content elif mtype == "perform_checkcollectionstatus" or mtype == "perform_showall": fin_output += perform_checkcollectionstatus(colID, ln, callback='') try: body = [fin_output, extra] except NameError: body = [fin_output] return addadminbox('<b>Menu</b>', body)
fb83561e15cf55d482f8b6090f9c163f4f103bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/fb83561e15cf55d482f8b6090f9c163f4f103bae/websearchadminlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 1615, 12, 1293, 734, 33, 21, 16, 7211, 33, 4315, 2069, 539, 16, 22189, 2218, 2187, 913, 2218, 2187, 6932, 33, 20, 4672, 3536, 1986, 770, 707, 16, 4440, 2590, 358, 2405, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 1615, 12, 1293, 734, 33, 21, 16, 7211, 33, 4315, 2069, 539, 16, 22189, 2218, 2187, 913, 2218, 2187, 6932, 33, 20, 4672, 3536, 1986, 770, 707, 16, 4440, 2590, 358, 2405, 326, ...
wx.Dialog.__init__(self, None, -1, "Set Event Enables for " + str(s))
wx.Dialog.__init__(self, None, -1, "Set Event Enables for " + str(s), size=wx.Size(400, 250))
def __init__(self, s): wx.Dialog.__init__(self, None, -1, "Set Event Enables for " + str(s)) self.s = s sizer = wx.BoxSizer(wx.VERTICAL)
0e8f7115de513b9ddef5db6b3913a6d5b8f57658 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3867/0e8f7115de513b9ddef5db6b3913a6d5b8f57658/_sensor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 272, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 599, 16, 300, 21, 16, 315, 694, 2587, 1374, 1538, 364, 315, 397, 609, 12, 87, 3631, 963, 33,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 272, 4672, 7075, 18, 6353, 16186, 2738, 972, 12, 2890, 16, 599, 16, 300, 21, 16, 315, 694, 2587, 1374, 1538, 364, 315, 397, 609, 12, 87, 3631, 963, 33,...
if end: break
def _parse_action(self): self.action = None for match in self._tag_re.finditer(self.text): end = match.group(1) == '/' tag = match.group(2).lower() if tag != 'form': continue attrs = _parse_attrs(match.group(3)) self.action = attrs.get('action', '') self.method = attrs.get('method', 'GET') self.id = attrs.get('id') # @@: enctype? if end: break else: assert 0, "No </form> tag found" assert self.action is not None, ( "No <form> tag found")
dc9f4f505738c0c3b900c774159edb2918181ef6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11400/dc9f4f505738c0c3b900c774159edb2918181ef6/fixture.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2670, 67, 1128, 12, 2890, 4672, 365, 18, 1128, 273, 599, 364, 845, 316, 365, 6315, 2692, 67, 266, 18, 4720, 2165, 12, 2890, 18, 955, 4672, 679, 273, 845, 18, 1655, 12, 21, 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, 389, 2670, 67, 1128, 12, 2890, 4672, 365, 18, 1128, 273, 599, 364, 845, 316, 365, 6315, 2692, 67, 266, 18, 4720, 2165, 12, 2890, 18, 955, 4672, 679, 273, 845, 18, 1655, 12, 21, 13, ...
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout=subprocess.PIPE)
def test_abs_paths(self): # Make sure all imported modules have their __file__ and __cached__ # attributes as absolute paths. Arranging to put the Lib directory on # PYTHONPATH would cause the os module to have a relative path for # __file__ if abs_paths() does not get run. sys and builtins (the # only other modules imported before site.py runs) do not have # __file__ or __cached__ because they are built-in. parent = os.path.relpath(os.path.dirname(os.__file__)) env = os.environ.copy() env['PYTHONPATH'] = parent command = 'import os; print(os.__file__, os.__cached__)' # First, prove that with -S (no 'import site'), the paths are # relative. proc = subprocess.Popen([sys.executable, '-S', '-c', command], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() self.assertEqual(proc.returncode, 0) os__file__, os__cached__ = stdout.split() self.assertFalse(os.path.isabs(os__file__)) self.assertFalse(os.path.isabs(os__cached__)) # Now, with 'import site', it works. proc = subprocess.Popen([sys.executable, '-c', command], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() self.assertEqual(proc.returncode, 0) os__file__, os__cached__ = stdout.split() self.assertTrue(os.path.isabs(os__file__)) self.assertTrue(os.path.isabs(os__cached__))
f3bc258b947de621b5487f8be8f07f936fc7fdf9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/f3bc258b947de621b5487f8be8f07f936fc7fdf9/test_site.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5113, 67, 4481, 12, 2890, 4672, 468, 4344, 3071, 777, 9101, 4381, 1240, 3675, 1001, 768, 972, 471, 1001, 7097, 972, 468, 1677, 487, 4967, 2953, 18, 225, 10371, 18183, 358, 1378...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5113, 67, 4481, 12, 2890, 4672, 468, 4344, 3071, 777, 9101, 4381, 1240, 3675, 1001, 768, 972, 471, 1001, 7097, 972, 468, 1677, 487, 4967, 2953, 18, 225, 10371, 18183, 358, 1378...
def test_ec_curves_ECDSA(self):
def test_ec_curves_ECDSA(self):
def test_ec_curves_ECDSA(self): # XXX leaks 5200 bytes for curveName, curveLen in curves: self.sign_verify_ecdsa(curveName, curveLen)
6df482996cb3d1ac49df8d16ca06961b172316be /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8055/6df482996cb3d1ac49df8d16ca06961b172316be/test_ec_curves.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 557, 67, 1397, 3324, 67, 7228, 19748, 12, 2890, 4672, 468, 11329, 20891, 87, 1381, 6976, 1731, 364, 8882, 461, 16, 8882, 2891, 316, 24106, 30, 365, 18, 2977, 67, 8705, 67, 55...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 557, 67, 1397, 3324, 67, 7228, 19748, 12, 2890, 4672, 468, 11329, 20891, 87, 1381, 6976, 1731, 364, 8882, 461, 16, 8882, 2891, 316, 24106, 30, 365, 18, 2977, 67, 8705, 67, 55...
return None id = None if p: git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) m = git_re.search(p.stdout.read()) if m: id = m.group(2) return id
pass return None
def git_fetch_id(): """ Fetch the GIT identifier for the local tree. Errors are swallowed. """ try: p = subprocess.Popen(['git', 'log', '-1'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=(sys.platform=='win32')) except OSError: # 'git' is apparently either not installed or not executable. return None id = None if p: git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M) m = git_re.search(p.stdout.read()) if m: id = m.group(2) return id
26d0299aa5d6db0e7d013aa0137b4746a1f53492 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/26d0299aa5d6db0e7d013aa0137b4746a1f53492/lastchange.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5071, 67, 5754, 67, 350, 13332, 3536, 8065, 326, 611, 1285, 2756, 364, 326, 1191, 2151, 18, 225, 9372, 854, 1352, 8151, 18, 3536, 775, 30, 293, 273, 6652, 18, 52, 3190, 12, 3292, 6845,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5071, 67, 5754, 67, 350, 13332, 3536, 8065, 326, 611, 1285, 2756, 364, 326, 1191, 2151, 18, 225, 9372, 854, 1352, 8151, 18, 3536, 775, 30, 293, 273, 6652, 18, 52, 3190, 12, 3292, 6845,...
style = wxSP_NOBORDER|wxSP_LIVE_UPDATE)
style = wxSP_NOBORDER|wxNO_3D|wxSP_LIVE_UPDATE)
def __init__(self, parent, inspector): wxSplitterWindow.__init__(self, parent, -1, style = wxSP_NOBORDER|wxSP_LIVE_UPDATE)#wxNO_3D|wxSP_3D) self.inspector = inspector self.categories = wxSplitterWindow(self, -1, style = wxNO_3D|wxSP_3D|wxSP_LIVE_UPDATE)#style = wxSP_NOBORDER) self.definitions = InspectorEventScrollWin(self, inspector) self.SetMinimumPaneSize(20) self.SplitHorizontally(self.categories, self.definitions) self.SetSashPosition(100) self.categoryClasses = wxListCtrl(self.categories, 100, style = wxLC_LIST) self.selCatClass = -1 EVT_LIST_ITEM_SELECTED(self.categoryClasses, 100, self.OnCatClassSelect) EVT_LIST_ITEM_DESELECTED(self.categoryClasses, 100, self.OnCatClassDeselect)
746f53548fb8bb54a235b1bfa31a4bdb769818e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/746f53548fb8bb54a235b1bfa31a4bdb769818e8/Inspector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 16, 22700, 4672, 7075, 26738, 3829, 16186, 2738, 972, 12, 2890, 16, 982, 16, 300, 21, 16, 2154, 273, 7075, 3118, 67, 3417, 38, 7954, 96, 27226, 3118...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 982, 16, 22700, 4672, 7075, 26738, 3829, 16186, 2738, 972, 12, 2890, 16, 982, 16, 300, 21, 16, 2154, 273, 7075, 3118, 67, 3417, 38, 7954, 96, 27226, 3118...
buf = tmp.read()
buf = tmp.read(BUFSIZE)
def do_GET(self): if self.path.find('?') != -1: path = self.path.split('?',1)[0] else: path = self.path if path[0] == '/': path = path[1:] # TODO: process 404 and other errors
7987d29d1f831952df754717e2393ee8e6da88ec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14156/7987d29d1f831952df754717e2393ee8e6da88ec/tagconvd.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 67, 3264, 12, 2890, 4672, 309, 365, 18, 803, 18, 4720, 2668, 4899, 13, 480, 300, 21, 30, 589, 273, 365, 18, 803, 18, 4939, 2668, 35, 2187, 21, 25146, 20, 65, 469, 30, 589, 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, 741, 67, 3264, 12, 2890, 4672, 309, 365, 18, 803, 18, 4720, 2668, 4899, 13, 480, 300, 21, 30, 589, 273, 365, 18, 803, 18, 4939, 2668, 35, 2187, 21, 25146, 20, 65, 469, 30, 589, 273...
except ItemError.NoSuchAttributeError:
if not isinstance(callback, WakeupCall):
def __isValid(self, wakeupCall): if wakeupCall is None or wakeupCall.delay.seconds <= 0: return False
ed35102bbff3365db6217a5bcdbe9765f8560d80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/ed35102bbff3365db6217a5bcdbe9765f8560d80/WakeupCaller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 26810, 12, 2890, 16, 19891, 416, 1477, 4672, 309, 19891, 416, 1477, 353, 599, 578, 19891, 416, 1477, 18, 10790, 18, 7572, 1648, 374, 30, 327, 1083, 2, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 26810, 12, 2890, 16, 19891, 416, 1477, 4672, 309, 19891, 416, 1477, 353, 599, 578, 19891, 416, 1477, 18, 10790, 18, 7572, 1648, 374, 30, 327, 1083, 2, -100, -100, -100, -100, -100,...
fetch_page_size: number of instances to return per get-all call (note, AppEngine has a builtin limit of 1000)
fetch_page_size: number of instances to return per get-all call (note, App Engine has a builtin limit of 1000)
def write_xsd_metadata(self, type_el, model_xml_name): """Appends the XML Schema elements of the property types of this model type to the given parent element.""" top_el = append_child(type_el, XSD_ELEMENT_NAME) top_el.attributes[NAME_ATTR_NAME] = model_xml_name seq_el = xsd_append_sequence(top_el)
f1ef349bd1c659ea27cfa687ecaacc447aa95b50 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4753/f1ef349bd1c659ea27cfa687ecaacc447aa95b50/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 19144, 67, 4165, 12, 2890, 16, 618, 67, 292, 16, 938, 67, 2902, 67, 529, 4672, 3536, 15049, 326, 3167, 4611, 2186, 434, 326, 1272, 1953, 434, 333, 938, 618, 358, 326, 864, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 19144, 67, 4165, 12, 2890, 16, 618, 67, 292, 16, 938, 67, 2902, 67, 529, 4672, 3536, 15049, 326, 3167, 4611, 2186, 434, 326, 1272, 1953, 434, 333, 938, 618, 358, 326, 864, ...
tmp_dir = 'linux.%s' % j
def run_once(self): """ Represents a single iteration of the process. Uncompresses a previously calculated number of copies of the linux kernel, sequentially or in parallel, and then compares the tree with a base tree, that was uncompressed on the very beginning. """
7d7a5f2c250bdb7a9e6fcdca01d7b9e4f05bca16 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/7d7a5f2c250bdb7a9e6fcdca01d7b9e4f05bca16/dma_memtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 4672, 3536, 868, 6706, 87, 279, 2202, 6532, 434, 326, 1207, 18, 1351, 14706, 281, 279, 7243, 8894, 1300, 434, 13200, 434, 326, 19725, 5536, 16, 695, 6979, 6261,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 8243, 12, 2890, 4672, 3536, 868, 6706, 87, 279, 2202, 6532, 434, 326, 1207, 18, 1351, 14706, 281, 279, 7243, 8894, 1300, 434, 13200, 434, 326, 19725, 5536, 16, 695, 6979, 6261,...
else:
transport = client.get_channel().get_transport() if not transport.is_active(): dprint("Cached channel closed. Opening new connection for %s" % ref) client = None if client is None:
def _get_client(cls, ref): newref = cls._copy_root_reference_without_username(ref) if newref in cls.connection_cache: client = cls.connection_cache[newref] if cls.debug: dprint("Found cached sftp connection: %s" % client) else: client = cls._get_sftp(ref) if cls.debug: dprint("Creating sftp connection: %s" % client) cls.connection_cache[newref] = client return client
4d9958325e95abe3f6b98541473e740c9aefa612 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/4d9958325e95abe3f6b98541473e740c9aefa612/sftp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 2625, 12, 6429, 16, 1278, 4672, 394, 1734, 273, 2028, 6315, 3530, 67, 3085, 67, 6180, 67, 13299, 67, 5053, 12, 1734, 13, 309, 394, 1734, 316, 2028, 18, 4071, 67, 2493, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2625, 12, 6429, 16, 1278, 4672, 394, 1734, 273, 2028, 6315, 3530, 67, 3085, 67, 6180, 67, 13299, 67, 5053, 12, 1734, 13, 309, 394, 1734, 316, 2028, 18, 4071, 67, 2493, ...
if (conn.host == host and conn.port == port and
if (conn.host == host and conn.port == port and
def checkConnectionStarted(self, url): scheme, host, port, path = download_utils.parseURL(url) conns = self._getServerConnections(scheme, host, port) for conn in conns['active']: try: if (conn.host == host and conn.port == port and conn.path == path): return True except: pass return False
4011da037c62b509416a1c376c7db9540b22aa70 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/4011da037c62b509416a1c376c7db9540b22aa70/httpclienttest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1952, 9217, 12, 2890, 16, 880, 4672, 4355, 16, 1479, 16, 1756, 16, 589, 273, 4224, 67, 5471, 18, 2670, 1785, 12, 718, 13, 18976, 273, 365, 6315, 588, 2081, 9314, 12, 9068, 16, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 1952, 9217, 12, 2890, 16, 880, 4672, 4355, 16, 1479, 16, 1756, 16, 589, 273, 4224, 67, 5471, 18, 2670, 1785, 12, 718, 13, 18976, 273, 365, 6315, 588, 2081, 9314, 12, 9068, 16, 1...
('Relocations', ('ptr', 'PointerToRelocations', ('array', 'NumberOfRelocations', ('struct', [
('Relocations', ('ptr', 'PointerToRelocations', ('array', '0', 'NumberOfRelocations', ('struct', [
def symname(value): parts = struct.unpack("<2L", value) if parts[0] == 0: return string_table_entry(parts[1]) else: return '%s'
78d4d7fefc14a1bc325a3ad295f03e21dfda170f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11986/78d4d7fefc14a1bc325a3ad295f03e21dfda170f/coff-dump.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 63, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 12, 6019, 63, 21, 5717, 4...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5382, 529, 12, 1132, 4672, 2140, 273, 1958, 18, 17309, 2932, 32, 22, 48, 3113, 460, 13, 309, 2140, 63, 20, 65, 422, 374, 30, 327, 533, 67, 2121, 67, 4099, 12, 6019, 63, 21, 5717, 4...
passed = False
success = False
def run_imfit(): default('imfit') return imfit( imagename=two_gaussians_image, estimates=two_gaussians_estimates, newestimates=newestimates )
8eccdfd089c274e940f3689d52ad99f3e7be170d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/8eccdfd089c274e940f3689d52ad99f3e7be170d/imfit_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 67, 381, 7216, 13332, 805, 2668, 381, 7216, 6134, 327, 709, 7216, 12, 8902, 1069, 33, 15415, 67, 75, 10325, 19657, 67, 2730, 16, 27585, 33, 15415, 67, 75, 10325, 19657, 67, 395, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1086, 67, 381, 7216, 13332, 805, 2668, 381, 7216, 6134, 327, 709, 7216, 12, 8902, 1069, 33, 15415, 67, 75, 10325, 19657, 67, 2730, 16, 27585, 33, 15415, 67, 75, 10325, 19657, 67, 395, ...
self.SetAcceleratorTable(wxAcceleratorTable( [ (keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1], wxID_SHELL_HISTORYUP), (keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1], wxID_SHELL_HISTORYDOWN), (keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1], wxID_SHELL_CODECOMP), (keyDefs['CallTips'][0], keyDefs['CallTips'][1], wxID_SHELL_CALLTIPS), (0, WXK_HOME, wxID_SHELL_HOME), ] ))
self.sc = {} self.sc[(keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1])] = self.OnHistoryUp self.sc[(keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1])] = self.OnHistoryDown self.sc[(keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1])] = self.OnShellCodeComplete self.sc[(keyDefs['CallTips'][0], keyDefs['CallTips'][1])] = self.OnShellCallTips
def bindShortcuts(self): self.SetAcceleratorTable(wxAcceleratorTable( [ (keyDefs['HistoryUp'][0], keyDefs['HistoryUp'][1], wxID_SHELL_HISTORYUP), (keyDefs['HistoryDown'][0], keyDefs['HistoryDown'][1], wxID_SHELL_HISTORYDOWN), (keyDefs['CodeComplete'][0], keyDefs['CodeComplete'][1], wxID_SHELL_CODECOMP), (keyDefs['CallTips'][0], keyDefs['CallTips'][1], wxID_SHELL_CALLTIPS), (0, WXK_HOME, wxID_SHELL_HOME), ] ))
d5a669da15d2e8a7535de861d1c5d76aa8e94985 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/d5a669da15d2e8a7535de861d1c5d76aa8e94985/ShellEditor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1993, 15576, 87, 12, 2890, 4672, 365, 18, 694, 28417, 1388, 12, 27226, 28417, 1388, 12, 306, 261, 856, 14554, 3292, 5623, 1211, 3546, 63, 20, 6487, 498, 14554, 3292, 5623, 1211, 3546, 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, 1993, 15576, 87, 12, 2890, 4672, 365, 18, 694, 28417, 1388, 12, 27226, 28417, 1388, 12, 306, 261, 856, 14554, 3292, 5623, 1211, 3546, 63, 20, 6487, 498, 14554, 3292, 5623, 1211, 3546, 63...
r""" Perform ``SubByte`` on a single byte/halfbyte ``b``. A ``ZeroDivision`` exception is raised if an attempt is made to perform an inversion on the zero element. This can be disabled by passing ``allow_zero_inversion=True`` to the constructor. A zero inversion will result in an inconsistent
r""" Perform ``SubByte`` on a single byte/halfbyte ``b``. A ``ZeroDivision`` exception is raised if an attempt is made to perform an inversion on the zero element. This can be disabled by passing ``allow_zero_inversion=True`` to the constructor. A zero inversion can result in an inconsistent
def sub_byte(self, b): r""" Perform ``SubByte`` on a single byte/halfbyte ``b``. A ``ZeroDivision`` exception is raised if an attempt is made to perform an inversion on the zero element. This can be disabled by passing ``allow_zero_inversion=True`` to the constructor. A zero inversion will result in an inconsistent equation system. INPUT: - ``b`` - an element in self.base_ring() EXAMPLE: The S-Box table for `GF(2^4)`:: sage: sr = mq.SR(1, 1, 1, 4, allow_zero_inversions=True) sage: for e in sr.base_ring(): ... print '% 20s % 20s'%(e, sr.sub_byte(e)) 0 a^2 + a a a^2 + 1 a^2 a a^3 a^3 + 1 a + 1 a^2 a^2 + a a^2 + a + 1 a^3 + a^2 a + 1 a^3 + a + 1 a^3 + a^2 a^2 + 1 a^3 + a^2 + a a^3 + a a^3 + a^2 + a + 1 a^2 + a + 1 a^3 + a a^3 + a^2 + a 0 a^3 + a^2 + a + 1 a^3 a^3 + a^2 + 1 1 a^3 + 1 a^3 + a^2 + 1 1 a^3 + a + 1 """ if not b: if not self._allow_zero_inversions: raise ZeroDivisionError, "A zero inversion occurred during an encryption or key schedule." else: return self.sbox_constant() try: return self._sub_byte_lookup[b] except AttributeError: e = self.e k = self.k
d2531bfd55e8dc010cd9c1e87cc62d2c514562d4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/d2531bfd55e8dc010cd9c1e87cc62d2c514562d4/sr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 67, 7229, 12, 2890, 16, 324, 4672, 436, 8395, 11217, 12176, 1676, 3216, 10335, 603, 279, 2202, 1160, 19, 20222, 7229, 12176, 70, 68, 8338, 225, 432, 12176, 7170, 28223, 10335, 1520, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 720, 67, 7229, 12, 2890, 16, 324, 4672, 436, 8395, 11217, 12176, 1676, 3216, 10335, 603, 279, 2202, 1160, 19, 20222, 7229, 12176, 70, 68, 8338, 225, 432, 12176, 7170, 28223, 10335, 1520, ...
try: body = [output, extra] except NameError: body = [output]
body = [output]
def perform_showoutputformats(colID, ln, callback='yes', content='', confirm=-1): """shows the outputformats of the current collection colID - the collection id.""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) subtitle = """<a name="10">10. Modify output formats for collection '%s'</a>&nbsp;&nbsp&nbsp;<small>[<a title="See guide" href="%s/admin/websearch/guide.html#3.10">?</a>]</small>""" % (col_dict[colID], weburl) output = """ <dl> <dt>Output format actions (not specific to the chosen collection) <dd>Go to the BibFormat interface to modify</dd> <dt>Collection specific actions <dd><a href="addexistingoutputformat?colID=%s&amp;ln=%s#10.2">Add existing output format to collection</a></dd> </dl> """ % (colID, ln) header = ['', 'Code', 'Output format', 'Actions'] actions = [] col_fmt = get_col_fmt(colID) fmt_dict = dict(get_def_name('', "format")) i = 0 if len(col_fmt) > 0: for (id_format, colID_fld, code, score) in col_fmt: move = """<table cellspacing="1" cellpadding="0" border="0"><tr><td>""" if i != 0: move += """<a href="%s/admin/websearch/websearchadmin.py/switchfmtscore?colID=%s&amp;ln=%s&amp;type=format&amp;id_1=%s&amp;id_2=%s&amp;rand=%s#10"><img border="0" src="%s/img/smallup.gif" title="Move format up"></a>""" % (weburl, colID, ln, id_format, col_fmt[i - 1][0], random.randint(0, 1000), weburl) else: move += "&nbsp;&nbsp;&nbsp;" move += "</td><td>" i += 1 if i != len(col_fmt): move += '<a href="%s/admin/websearch/websearchadmin.py/switchfmtscore?colID=%s&amp;ln=%s&amp;type=format&amp;id_1=%s&amp;id_2=%s&amp;rand=%s#10"><img border="0" src="%s/img/smalldown.gif" title="Move format down"></a>' % (weburl, colID, ln, id_format, col_fmt[i][0], random.randint(0, 1000), weburl) move += """</td></tr></table>""" actions.append([move, code, fmt_dict[int(id_format)]]) for col in [(('Remove', 'removeoutputformat'),)]: actions[-1].append('<a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&amp;ln=%s&amp;fmtID=%s#10">%s</a>' % (weburl, col[0][1], colID, ln, id_format, col[0][0])) for (str, function) in col[1:]: actions[-1][-1] += ' / <a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&amp;ln=%s&amp;fmtID=%s#10">%s</a>' % (weburl, function, colID, ln, id_format, str) output += tupletotable(header=header, tuple=actions) else: output += """No output formats exists for this collection""" output += content try: body = [output, extra] except NameError: body = [output] if callback: return perform_editcollection(colID, ln, "perform_showoutputformats", addadminbox(subtitle, body)) else: return addadminbox(subtitle, body)
8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8dcf4c4b5c4b6097cd6d61f62b4123913eecc2ec/websearchadminlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 4500, 2844, 11962, 12, 1293, 734, 16, 7211, 16, 1348, 2218, 9707, 2187, 913, 2218, 2187, 6932, 29711, 21, 4672, 3536, 4500, 87, 326, 876, 11962, 434, 326, 783, 1849, 645, 734, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 4500, 2844, 11962, 12, 1293, 734, 16, 7211, 16, 1348, 2218, 9707, 2187, 913, 2218, 2187, 6932, 29711, 21, 4672, 3536, 4500, 87, 326, 876, 11962, 434, 326, 783, 1849, 645, 734, ...
- ``labels`` - if False, each edge is a tuple (u,v) of
- ``labels`` - if ``False``, each edge is a tuple `(u,v)` of
def edge_boundary(self, vertices1, vertices2=None, labels=True): """ Returns a list of edges (u,v,l) with u in vertices1 and v in vertices2. If vertices2 is None, then it is set to the complement of vertices1.
abc7c82c21e5482072ca507c6b1b4c8cb722723e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/abc7c82c21e5482072ca507c6b1b4c8cb722723e/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3591, 67, 16604, 12, 2890, 16, 6928, 21, 16, 6928, 22, 33, 7036, 16, 3249, 33, 5510, 4672, 3536, 2860, 279, 666, 434, 5231, 261, 89, 16, 90, 16, 80, 13, 598, 582, 316, 6928, 21, 47...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3591, 67, 16604, 12, 2890, 16, 6928, 21, 16, 6928, 22, 33, 7036, 16, 3249, 33, 5510, 4672, 3536, 2860, 279, 666, 434, 5231, 261, 89, 16, 90, 16, 80, 13, 598, 582, 316, 6928, 21, 47...
if sys.version.startswith('2.5') or sys.version.startswith('2.6'): n = From('builtin', [('*', None)], None) else: n = From('builtin', [('*', None)])
if From.__init__.func_code.co_argcount - len(From.__init__.func_defaults) == 4: n = From('builtin', [('*', None)], None) else: n = From('builtin', [('*', None)])
def visitModule(self, node): # --- bootstrap built-in classes if self.module.ident == 'builtin': for dummy in getgx().builtins: self.visit(Class(dummy, [], None, Pass()))
56253b464c44b42d3133a4c61110541dec2765e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6661/56253b464c44b42d3133a4c61110541dec2765e3/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 3120, 12, 2890, 16, 756, 4672, 468, 9948, 7065, 6650, 17, 267, 3318, 309, 365, 18, 2978, 18, 6392, 422, 296, 24553, 4278, 364, 9609, 316, 336, 75, 92, 7675, 12406, 2679, 30, 365,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3757, 3120, 12, 2890, 16, 756, 4672, 468, 9948, 7065, 6650, 17, 267, 3318, 309, 365, 18, 2978, 18, 6392, 422, 296, 24553, 4278, 364, 9609, 316, 336, 75, 92, 7675, 12406, 2679, 30, 365,...
self.assert_re_search('testtmp.c:5', out)
self.assert_re_search('testtmp.c:[45]', out)
def checkBuiltProgram(self): # Run gdb and verify that it is able to correctly locate the # testtmp.c source file. out, errs = self.runcmd("gdb --batch " + "-ex 'break main' -ex 'run' -ex 'step' link/testtmp </dev/null") self.assert_equal(errs, '') self.assert_re_search('puts\\(HELLO_WORLD\\);', out) self.assert_re_search('testtmp.c:5', out)
fdaf4c739372bb2a573823fa0779dc82dc60ac67 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7392/fdaf4c739372bb2a573823fa0779dc82dc60ac67/testdistcc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 16409, 9459, 12, 2890, 4672, 468, 1939, 314, 1966, 471, 3929, 716, 518, 353, 7752, 358, 8783, 10627, 326, 468, 1842, 5645, 18, 71, 1084, 585, 18, 596, 16, 6962, 273, 365, 18, 86, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 16409, 9459, 12, 2890, 4672, 468, 1939, 314, 1966, 471, 3929, 716, 518, 353, 7752, 358, 8783, 10627, 326, 468, 1842, 5645, 18, 71, 1084, 585, 18, 596, 16, 6962, 273, 365, 18, 86, ...
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
def get_fsencoding(env): output = subprocess.check_output( [sys.executable, "-c", "import sys; print(sys.getfilesystemencoding())"], env=env) return output.rstrip().decode('ascii')
bbdca40f4241bd0560e2a0b447b5713a9e918ce9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/bbdca40f4241bd0560e2a0b447b5713a9e918ce9/test_sys.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2556, 5999, 12, 3074, 4672, 876, 273, 6652, 18, 1893, 67, 2844, 12, 306, 9499, 18, 17751, 16, 3701, 71, 3113, 315, 5666, 2589, 31, 1172, 12, 9499, 18, 588, 17846, 5999, 1435, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 2556, 5999, 12, 3074, 4672, 876, 273, 6652, 18, 1893, 67, 2844, 12, 306, 9499, 18, 17751, 16, 3701, 71, 3113, 315, 5666, 2589, 31, 1172, 12, 9499, 18, 588, 17846, 5999, 1435, ...
notificationTool = self.getSite().portal_anonymous_notification notificationTool.add_email_subscription( email, organisation, sector, country, notif_type, lang, str(self.absolute_url()) + '/confirm' ) except ValueError, e: if is_valid_email(email): errors['email_exists'] = True
if 'Anonymous User' != REQUEST.AUTHENTICATED_USER.getUserName(): errors['message'] = 'Only non-registered users can submit this form' else: notificationTool = self.getSite().portal_anonymous_notification notificationTool.add_email_subscription( email, organisation, sector, country, notif_type, lang, str(self.absolute_url()) + '/confirm' ) except Exception, e: errors['message'] = e
def subscribe(self, REQUEST, notif_type, lang=None): """ Add a new subscribtion. First to a temporary list, then after confirmation to the correct container """ email = REQUEST.get('email', '') organisation = REQUEST.get('organisation', '') sector = REQUEST.get('sector', '') country = REQUEST.get('country', '') errors = {} REQUEST.SESSION['errors'] = {} # Send errors back to form if not is_valid_email(email): errors['email'] = True if not organisation: errors['organisation'] = True if not lang: lang = self.get_implicit_lang() try: notificationTool = self.getSite().portal_anonymous_notification notificationTool.add_email_subscription( email, organisation, sector, country, notif_type, lang, str(self.absolute_url()) + '/confirm' ) except ValueError, e: if is_valid_email(email): errors['email_exists'] = True if not len(errors): return REQUEST.RESPONSE.redirect(self.absolute_url() + '/thank_you') else: REQUEST.SESSION['errors'] = errors return REQUEST.RESPONSE.redirect(self.absolute_url())
57c50f06b3ce82b87e00d5ba2cdf6cae4068c28e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3287/57c50f06b3ce82b87e00d5ba2cdf6cae4068c28e/AnonymousSubscriber.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9129, 12, 2890, 16, 12492, 16, 486, 430, 67, 723, 16, 3303, 33, 7036, 4672, 3536, 1436, 279, 394, 10189, 24252, 18, 5783, 358, 279, 6269, 666, 16, 1508, 1839, 14296, 358, 326, 3434, 14...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9129, 12, 2890, 16, 12492, 16, 486, 430, 67, 723, 16, 3303, 33, 7036, 4672, 3536, 1436, 279, 394, 10189, 24252, 18, 5783, 358, 279, 6269, 666, 16, 1508, 1839, 14296, 358, 326, 3434, 14...
if l.direction == FORWARD and r.direction == FORWARD and
if l.direction == FORWARD and \ r.direction == FORWARD and \
def try_substitution(l, r, cur, examine_modes=False): if l.left.is_compound(): if is_substitution(l, r, cur, examine_modes) and l.left.direction == FORWARD: if l.direction == FORWARD and r.direction == FORWARD and cur.direction == FORWARD: return "fwd_subst" elif l.direction == BACKWARD and r.direction == BACKWARD and cur.direction == BACKWARD: return "fwd_xsubst" elif r.left.is_compound(): if is_substitution(r, l, cur, examine_modes) and r.left.direction == BACKWARD if r.direction == FORWARD and l.direction == FORWARD and cur.direction == FORWARD: return "bwd_xsubst" elif r.direction == BACKWARD and l.direction == BACKWARD and cur.direction == BACKWARD: return "bwd_subst" return None
695998eaddc7dcad449dc24401146d91dca6b556 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8383/695998eaddc7dcad449dc24401146d91dca6b556/trace.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 1717, 14278, 12, 80, 16, 436, 16, 662, 16, 19707, 558, 67, 19282, 33, 8381, 4672, 309, 328, 18, 4482, 18, 291, 67, 22585, 13332, 309, 353, 67, 1717, 14278, 12, 80, 16, 436, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 775, 67, 1717, 14278, 12, 80, 16, 436, 16, 662, 16, 19707, 558, 67, 19282, 33, 8381, 4672, 309, 328, 18, 4482, 18, 291, 67, 22585, 13332, 309, 353, 67, 1717, 14278, 12, 80, 16, 436, ...
and the fourth has no control points: path = [[p1, c1, c2, p2], [c3, c4, p3], [c5, p4], [p5], ...]
and the fourth has no control points:: path = [[p1, c1, c2, p2], [c3, c4, p3], [c5, p4], [p5], ...]
def bezier3d(path, **options): """ Draws a 3-dimensional bezier path. Input is similar to bezier_path, but each point in the path and each control point is required to have 3 coordinates. INPUT: - ``path`` - a list of curves, which each is a list of points. See further detail below. - ``thickness`` - (default: 2) - ``color`` - a word that describes a color - ``opacity`` - (default: 1) if less than 1 then is transparent - ``aspect_ratio`` - (default:[1,1,1]) The path is a list of curves, and each curve is a list of points. Each point is a tuple (x,y,z). The first curve contains the endpoints as the first and last point in the list. All other curves assume a starting point given by the last entry in the preceding list, and take the last point in the list as their opposite endpoint. A curve can have 0, 1 or 2 control points listed between the endpoints. In the input example for path below, the first and second curves have 2 control points, the third has one, and the fourth has no control points: path = [[p1, c1, c2, p2], [c3, c4, p3], [c5, p4], [p5], ...] In the case of no control points, a straight line will be drawn between the two endpoints. If one control point is supplied, then the curve at each of the endpoints will be tangent to the line from that endpoint to the control point. Similarly, in the case of two control points, at each endpoint the curve will be tangent to the line connecting that endpoint with the control point immediately after or immediately preceding it in the list. So in our example above, the curve between p1 and p2 is tangent to the line through p1 and c1 at p1, and tangent to the line through p2 and c2 at p2. Similarly, the curve between p2 and p3 is tangent to line(p2,c3) at p2 and tangent to line(p3,c4) at p3. Curve(p3,p4) is tangent to line(p3,c5) at p3 and tangent to line(p4,c5) at p4. Curve(p4,p5) is a straight line. EXAMPLES: sage: path = [[(0,0,0),(.5,.1,.2),(.75,3,-1),(1,1,0)],[(.5,1,.2),(1,.5,0)],[(.7,.2,.5)]] sage: b = bezier3d(path, color='green') sage: b To construct a simple curve, create a list containing a single list: sage: path = [[(0,0,0),(1,0,0),(0,1,0),(0,1,1)]] sage: curve = bezier3d(path, thickness=5, color='blue') sage: curve """ import parametric_plot3d as P3D from sage.modules.free_module_element import vector from sage.calculus.calculus import var p0 = vector(path[0][-1]) t = var('t') if len(path[0]) > 2: B = (1-t)**3*vector(path[0][0])+3*t*(1-t)**2*vector(path[0][1])+3*t**2*(1-t)*vector(path[0][-2])+t**3*p0 G = P3D.parametric_plot3d(list(B), (0, 1), color=options['color'], aspect_ratio=options['aspect_ratio'], thickness=options['thickness'], opacity=options['opacity']) else: G = line3d([path[0][0], p0], color=options['color'], thickness=options['thickness'], opacity=options['opacity']) for curve in path[1:]: if len(curve) > 1: p1 = vector(curve[0]) p2 = vector(curve[-2]) p3 = vector(curve[-1]) B = (1-t)**3*p0+3*t*(1-t)**2*p1+3*t**2*(1-t)*p2+t**3*p3 G += P3D.parametric_plot3d(list(B), (0, 1), color=options['color'], aspect_ratio=options['aspect_ratio'], thickness=options['thickness'], opacity=options['opacity']) else: G += line3d([p0,curve[0]], color=options['color'], thickness=options['thickness'], opacity=options['opacity']) p0 = curve[-1] return G
a074a851cc2fcbb495453d24cda3b4b1c0b78eec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a074a851cc2fcbb495453d24cda3b4b1c0b78eec/shapes2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29368, 23, 72, 12, 803, 16, 2826, 2116, 4672, 3536, 10184, 87, 279, 890, 17, 31236, 29368, 589, 18, 225, 2741, 353, 7281, 358, 29368, 67, 803, 16, 1496, 1517, 1634, 316, 326, 589, 471,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29368, 23, 72, 12, 803, 16, 2826, 2116, 4672, 3536, 10184, 87, 279, 890, 17, 31236, 29368, 589, 18, 225, 2741, 353, 7281, 358, 29368, 67, 803, 16, 1496, 1517, 1634, 316, 326, 589, 471,...
if os.path.isdir(path): path = os.path.join(path, '')
path = self._FixDir(path)
def _ExpandTests(self, test_list_path): # Convert the test specification to an absolute, normalized # path and make sure directories end with the OS path separator. path = os.path.join(path_utils.LayoutTestsDir(test_list_path), test_list_path) path = os.path.normpath(path) if os.path.isdir(path): path = os.path.join(path, '') # This is kind of slow - O(n*m) - since this is called for all # entries in the test lists. It has not been a performance # issue so far. Maybe we should re-measure the time spent reading # in the test lists? result = [] for test in self._full_test_list: if test.startswith(path): result.append(test) return result
a6ee86af99098a57a481db725e55456d1bc46f5b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/a6ee86af99098a57a481db725e55456d1bc46f5b/test_expectations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 12271, 14650, 12, 2890, 16, 1842, 67, 1098, 67, 803, 4672, 468, 4037, 326, 1842, 7490, 358, 392, 4967, 16, 5640, 468, 589, 471, 1221, 3071, 6402, 679, 598, 326, 5932, 589, 4182, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12271, 14650, 12, 2890, 16, 1842, 67, 1098, 67, 803, 4672, 468, 4037, 326, 1842, 7490, 358, 392, 4967, 16, 5640, 468, 589, 471, 1221, 3071, 6402, 679, 598, 326, 5932, 589, 4182, 1...
print "receiving list from %r" % options.url data = get_messages(options.endpoint)
print "receiving list from %r" % options.endpoint data = get_messages(options.endpoint, credentials=options.credentials)
def main(): parser = OptionParser() parser.add_option("-e", "--endpoint", dest="endpoint", help="URL of the endpoint") (options, args) = parser.parse_args() print "receiving list from %r" % options.url data = get_messages(options.endpoint) for message in data['messages']: url = message['url'] payload = get_message(url) if payload: # Do something with message... print payload acknowledge(url)
4d080ae1179357bf121e7177155d906af75470f3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13970/4d080ae1179357bf121e7177155d906af75470f3/recv_fmtp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 2082, 273, 18862, 1435, 2082, 18, 1289, 67, 3482, 2932, 17, 73, 3113, 5238, 8003, 3113, 1570, 1546, 8003, 3113, 2809, 1546, 1785, 434, 326, 2494, 7923, 261, 2116, 16, 833, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2082, 273, 18862, 1435, 2082, 18, 1289, 67, 3482, 2932, 17, 73, 3113, 5238, 8003, 3113, 1570, 1546, 8003, 3113, 2809, 1546, 1785, 434, 326, 2494, 7923, 261, 2116, 16, 833, 1...
elif isinstance(self.destination, DictType): options[typeid]=self.destination.get(typeid, [None]) elif isinstance(self.destination, ListType): options[typeid]=self.destination
elif isinstance(destination, DictType): options[typeid]=destination.get(typeid, [None]) elif isinstance(destination, ListType): options[typeid]=destination
def lookupDestinationsFor(typeinfo, tool, purl): """ search where the user can add a typeid instance """ # first, discover who can contain the type searchFor = [] for regType in tool.listTypeInfo(): if typeinfo.globalAllow(): searchFor.append(regType.getId()) elif regType.filter_content_types and \ typeinfo.getId() in regType.allowed_content_types: searchFor.append(regType.getId()) # after, gimme the path/s containers = [] for wanted in searchFor: for brain in \ instance.portal_catalog(portal_type=wanted): obj = brain.getObject() if obj != None and \ hasattr(obj.aq_explicit,'isPrincipiaFolderish'): containers.append(purl.getRelativeUrl(obj)) # ok, go on... return containers
b8218e6ab5b17cabfbb6f2f9b33b853fcd8112d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b8218e6ab5b17cabfbb6f2f9b33b853fcd8112d4/Widget.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3689, 27992, 1290, 12, 723, 1376, 16, 5226, 16, 293, 718, 4672, 3536, 1623, 1625, 326, 729, 848, 527, 279, 618, 350, 791, 3536, 468, 1122, 16, 10372, 10354, 848, 912, 326, 618, 1623, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3689, 27992, 1290, 12, 723, 1376, 16, 5226, 16, 293, 718, 4672, 3536, 1623, 1625, 326, 729, 848, 527, 279, 618, 350, 791, 3536, 468, 1122, 16, 10372, 10354, 848, 912, 326, 618, 1623, 1...
def multiple_shooting(model, initial_u, grid=[(0, 1)], initial_y=None, GRADIENT_THRESHOLD=0.0001):
def multiple_shooting(model, initial_u, grid=[(0, 1)], initial_y=None, plot=True):
def multiple_shooting(model, initial_u, grid=[(0, 1)], initial_y=None, GRADIENT_THRESHOLD=0.0001): """ Does multiple shooting. @param model: The model to simulate/optimize over. @param initial_u: A list of initial inputs for each segment. If not a list, it is assumed to be the same initial input for each segment. @param grid: A list of 2-tuples per segment. The first element in each tuple being the segment start time, the second element the segment end time. @param initial_y: Can be three things: * A list of initial states for all grids. If any of these are None they will be replaced by the default model state. * None -- same as default state. * One state. This state will be the initial state for every segment. A list of initial states for each segment except the first one. If not a list the same initial state will be used for each segment. @return: The optimal inputs (Us). """ model.reset() default_state = model.getStates().copy() # Check for errors if not len(grid) >= 1: raise ShootingException('You need to specify at least one segment.') try: if len(initial_u) != len(grid): raise ShootingException('initial_u parameters must either be constant, or the same length as grid segments.') except TypeError: initial_u = [initial_u] * len(grid) try: if len(initial_y) != len(grid): raise ShootingException('initial_y states must either be constant, or the same length as grid segments.') except TypeError: initial_y = [initial_y] * len(grid) if math.fabs(grid[0][0]) > 0.001: print "Warning: The start time of the first segment should usually coinside with the model start time." if math.fabs(grid[-1][1]-1) > 0.001: print "Warning: The end time of the last segment should usually coinside with the model end time." def check_inequality(a, b): if a >= b: raise ShootingException('One grid segment is incorrectly formatted.') map(check_inequality, *zip(*grid)) def substitute_None(x): if x is None: return default_state else: return x initial_y = map(substitute_None, initial_y) # Denormalize times def denormalize_segment(start_time, end_time): model_sim_len = model.getFinalTime() - model.getStartTime() start_time = model.getStartTime() + model_sim_len * start_time end_time = model.getStartTime() + model_sim_len * end_time return (start_time, end_time) grid = map(denormalize_segment, *zip(*grid)) # Preparing for multiple shooting def shoot_all_segments_p(p): """A different paramtrization than shoot_all_segments(...).""" assert p.ndim == 1 def shoot_all_segments(ys, us): """Does the actual multiple shooting. @param ys: The initial states for each segment. @param us: The control signal for each segment. @return: A tuple consisting of: 1. Cost. 2. Cost gradient. """ assert len(us) == len(grid) assert len(ys) == len(grid) assert len(ys[0]) == model.getModelSize() def shoot_single_segment(u, y0, segment_times): if len(y0) != model.getModelSize(): raise ShootingException('Wrong length to single segment: %s != %s' % (len(y0), model.getModelSize())) seg_start_time = segment_times[0] seg_end_time = segment_times[1] model.reset() u = u.flatten() y0 = y0.flatten() model.setInputs(u) model.setStates(y0) seg_gradient, seg_last_y, seg_gradparams = _shoot(model, seg_start_time, seg_end_time) return seg_gradient, seg_last_y, seg_gradparams # Shoot all segments except the last one just to make sure that # it is being shot last to be able to extract the optimization # cost. results = map(shoot_single_segment, us[0:-1], ys[0:-1], grid[0:-1]) results.append(shoot_single_segment(us[-1], ys[-1], grid[-1])) model_cost = model.evalCost() gradients, last_ys, seg_gradparams = zip(*results) seg_gradparams = seg_gradparams[0] # they are all the same cost = model_cost + sum( ( ys[-1] - N.array(last_ys)[-1] )**2 ) #cost = model_cost print '=========================' print 'cost:', cost print 'Model cost:', model_cost print '=========================' # TODO: Calculate gradient gradient = N.zeros(len(ys) + len(us)) gradient = None return cost, gradient ys = p[0 : len(grid) * model.getModelSize()] ys = ys.reshape( (len(grid), model.getModelSize()) ) us = p[len(grid) * model.getModelSize() : ] us = us.reshape( (len(grid), 1) ) # Assumes only one input signal return shoot_all_segments(ys, us) def f(p): """The cost evaluation function. @param p: A concatenation of initial states (excluding the first segment) and parameters. """ cost, gradient = shoot_all_segments_p(p) global last_gradient global last_gradient_p if gradient is not None: last_gradient = gradient.copy() last_gradient_p = p.copy() return cost def df(p): """Returns the gradient of f(cur_u).""" if max(gradient_u - cur_u) < GRADIENT_THRESHOLD: print "Using existing gradient" gradient = last_gradient else: print "Recalculating gradient" cost, gradient = shoot_all_segments_p(p) return gradient def f_ineq(p): us = p[len(grid) * model.getModelSize() : ] us = us.reshape( (len(grid), 1) ) # Assumes only one input signal return N.concatenate( (-0.5-us, u-1) ) # Initial try p0 = N.concatenate( (N.array(initial_y).flatten(), N.array(initial_u).flatten()) ) # Get OpenOPT handler p = NLP(f, p0, maxIter = 1e3, maxFunEvals = 1e2) # Equalities as a constraint between the segments p.Aeq = N.zeros( (len(p0), len(p0)) ) for i in range(model.getModelSize() * (len(grid) - 1)): p.Aeq[i, i] = 1 p.Aeq[i, i + model.getModelSize()] = -1 #print p.Aeq[0] #import pdb #pdb.set_trace() #return p.beq = N.zeros(len(p0)) #p.df = df p.plot = 1 p.iprint = 1 u_opt = p.solve('ralg') return u_opt
6d98183104454c3d8d4ffff4b76a13354c973395 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7711/6d98183104454c3d8d4ffff4b76a13354c973395/shooting.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3229, 67, 674, 1632, 310, 12, 2284, 16, 2172, 67, 89, 16, 3068, 22850, 12, 20, 16, 404, 13, 6487, 2172, 67, 93, 33, 7036, 16, 3207, 33, 5510, 4672, 3536, 9637, 3229, 699, 1632, 310, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3229, 67, 674, 1632, 310, 12, 2284, 16, 2172, 67, 89, 16, 3068, 22850, 12, 20, 16, 404, 13, 6487, 2172, 67, 93, 33, 7036, 16, 3207, 33, 5510, 4672, 3536, 9637, 3229, 699, 1632, 310, ...
return self.PointerToRawData <= offset < self.VirtualAddress + self.SizeOfRawData
return self.PointerToRawData <= offset < self.PointerToRawData + self.SizeOfRawData
def contains_offset(self, offset): """Check whether the section contains the file offset provided.""" if not self.PointerToRawData: # bss and other sections containing only uninitialized data must have 0 # and do not take space in the file return False return self.PointerToRawData <= offset < self.VirtualAddress + self.SizeOfRawData
a75f4e72a095cbb10e6947fcbd0c3f6b7ffbcfce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/213/a75f4e72a095cbb10e6947fcbd0c3f6b7ffbcfce/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1914, 67, 3348, 12, 2890, 16, 1384, 4672, 3536, 1564, 2856, 326, 2442, 1914, 326, 585, 1384, 2112, 12123, 225, 309, 486, 365, 18, 4926, 774, 31733, 30, 468, 324, 1049, 471, 1308, 7178, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1914, 67, 3348, 12, 2890, 16, 1384, 4672, 3536, 1564, 2856, 326, 2442, 1914, 326, 585, 1384, 2112, 12123, 225, 309, 486, 365, 18, 4926, 774, 31733, 30, 468, 324, 1049, 471, 1308, 7178, ...
raise TracError, 'Component "%s" not registered' % cls.__name__
raise TracError('Component "%s" not registered' % cls.__name__)
def __getitem__(self, cls): """Activate the component instance for the given class, or return the existing the instance if the component has already been activated.""" if cls not in self.enabled: self.enabled[cls] = self.is_component_enabled(cls) if not self.enabled[cls]: return None component = self.components.get(cls) if not component: if cls not in ComponentMeta._components: raise TracError, 'Component "%s" not registered' % cls.__name__ try: component = cls(self) except TypeError, e: raise TracError, 'Unable to instantiate component %r (%s)' \ % (cls, e) return component
16ce1ac0eac15917384332e8d3858788cafa50e4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9317/16ce1ac0eac15917384332e8d3858788cafa50e4/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 31571, 972, 12, 2890, 16, 2028, 4672, 3536, 21370, 326, 1794, 791, 364, 326, 864, 667, 16, 578, 327, 326, 2062, 326, 791, 309, 326, 1794, 711, 1818, 2118, 14892, 12123, 309, 2028, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 31571, 972, 12, 2890, 16, 2028, 4672, 3536, 21370, 326, 1794, 791, 364, 326, 864, 667, 16, 578, 327, 326, 2062, 326, 791, 309, 326, 1794, 711, 1818, 2118, 14892, 12123, 309, 2028, ...
newlabel_tray1 = newlabel1 newlabel_tray2 = newlabel2 newlabel = newlabel1 + '\n' + newlabel2 if newlabel != self.cursonglabel.get_label(): self.cursonglabel.set_markup(newlabel) if newlabel_tray1 != self.traycursonglabel1.get_label(): self.traycursonglabel1.set_markup(newlabel_tray1) if newlabel_tray2 != self.traycursonglabel2.get_label(): self.traycursonglabel2.set_markup(newlabel_tray2)
if newlabel1 != self.cursonglabel1.get_label(): self.cursonglabel1.set_markup(newlabel1) if newlabel2 != self.cursonglabel2.get_label(): self.cursonglabel2.set_markup(newlabel2) if newlabel1 != self.traycursonglabel1.get_label(): self.traycursonglabel1.set_markup(newlabel1) if newlabel2 != self.traycursonglabel2.get_label(): self.traycursonglabel2.set_markup(newlabel2)
def update_cursong(self): if self.conn and self.status and self.status.state in ['play', 'pause']: # We must show the trayprogressbar and trayalbumeventbox # before changing self.cursonglabel (and consequently calling # self.labelnotify()) in order to ensure that the notification # popup will have the correct height when being displayed for # the first time after a stopped state. self.trayprogressbar.show() self.traycursonglabel2.show() if self.show_covers: self.trayalbumeventbox.show() self.trayalbumimage2.show() self.traycursonglabel1.set_ellipsize(pango.ELLIPSIZE_END) self.traycursonglabel2.set_ellipsize(pango.ELLIPSIZE_END) newlabelfound = False if len(self.currsongformat1) > 0: newlabel1 = '<big><b>' + self.parse_formatting(self.currsongformat1, self.songinfo, True) + ' </b></big>' else: newlabel1 = '<big><b> </b></big>' if len(self.currsongformat2) > 0: newlabel2 = '<small>' + self.parse_formatting(self.currsongformat2, self.songinfo, True) + ' </small>' else: newlabel2 = '<small> </small>' newlabel_tray1 = newlabel1 newlabel_tray2 = newlabel2 newlabel = newlabel1 + '\n' + newlabel2 if newlabel != self.cursonglabel.get_label(): self.cursonglabel.set_markup(newlabel) if newlabel_tray1 != self.traycursonglabel1.get_label(): self.traycursonglabel1.set_markup(newlabel_tray1) if newlabel_tray2 != self.traycursonglabel2.get_label(): self.traycursonglabel2.set_markup(newlabel_tray2) else: self.traycursonglabel1.set_ellipsize(pango.ELLIPSIZE_NONE) self.traycursonglabel2.set_ellipsize(pango.ELLIPSIZE_NONE) if self.expanded: self.cursonglabel.set_markup('<big><b>' + _('Stopped') + '</b></big>\n<small>' + _('Click to collapse') + '</small>') else: self.cursonglabel.set_markup('<big><b>' + _('Stopped') + '</b></big>\n<small>' + _('Click to expand') + '</small>') if not self.conn: self.traycursonglabel1.set_label(_('Not connected')) else: self.traycursonglabel1.set_label(_('Stopped')) self.trayprogressbar.hide() self.trayalbumeventbox.hide() self.trayalbumimage2.hide() self.traycursonglabel2.hide() self.update_infofile()
ccb1f822b0cc1fe60b4ddc98916d38a21b31d2b6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2312/ccb1f822b0cc1fe60b4ddc98916d38a21b31d2b6/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 1397, 816, 75, 12, 2890, 4672, 309, 365, 18, 4646, 471, 365, 18, 2327, 471, 365, 18, 2327, 18, 2019, 316, 10228, 1601, 2187, 296, 19476, 3546, 30, 468, 1660, 1297, 2405, 326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 1397, 816, 75, 12, 2890, 4672, 309, 365, 18, 4646, 471, 365, 18, 2327, 471, 365, 18, 2327, 18, 2019, 316, 10228, 1601, 2187, 296, 19476, 3546, 30, 468, 1660, 1297, 2405, 326,...
if in_mf:
if mfentry:
def handle(xlist, dobackup): xlist[0].append(abs) if dobackup and not opts['no_backup'] and os.path.exists(rel): bakname = "%s.orig" % rel ui.note(_('saving current version of %s as %s\n') % (rel, bakname)) shutil.copyfile(rel, bakname) shutil.copymode(rel, bakname) if ui.verbose or not exact: ui.status(xlist[1] % rel)
b220f0f06a9f1aeff53a90e55e16fd502ed24fdd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/b220f0f06a9f1aeff53a90e55e16fd502ed24fdd/commands.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 92, 1098, 16, 741, 9572, 4672, 619, 1098, 63, 20, 8009, 6923, 12, 5113, 13, 309, 741, 9572, 471, 486, 1500, 3292, 2135, 67, 9572, 3546, 471, 1140, 18, 803, 18, 1808, 12, 28...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 92, 1098, 16, 741, 9572, 4672, 619, 1098, 63, 20, 8009, 6923, 12, 5113, 13, 309, 741, 9572, 471, 486, 1500, 3292, 2135, 67, 9572, 3546, 471, 1140, 18, 803, 18, 1808, 12, 28...
def take_focuses(self, reverse, x, y, focuses): """ This adds to focuses Focuse objects corresponding to the focuses
def take_focuses(self, cminx, cminy, cmaxx, cmaxy, reverse, x, y, focuses): """ This adds to focuses Focus objects corresponding to the focuses
def take_focuses(self, reverse, x, y, focuses): """ This adds to focuses Focuse objects corresponding to the focuses added to this object and its children, transformed into screen coordinates. """ if self.reverse: reverse = reverse * self.reverse
fc0f7cecc49ee6b4508f3074442f8e3b82709254 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10962/fc0f7cecc49ee6b4508f3074442f8e3b82709254/render.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4862, 67, 13923, 281, 12, 2890, 16, 276, 1154, 92, 16, 276, 1154, 93, 16, 276, 1896, 92, 16, 276, 1896, 93, 16, 4219, 16, 619, 16, 677, 16, 7155, 281, 4672, 3536, 1220, 4831, 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, 4862, 67, 13923, 281, 12, 2890, 16, 276, 1154, 92, 16, 276, 1154, 93, 16, 276, 1896, 92, 16, 276, 1896, 93, 16, 4219, 16, 619, 16, 677, 16, 7155, 281, 4672, 3536, 1220, 4831, 358, ...
shapes="M,n,N", extradoc="""
shapes="M, n, N", extradoc="""
def _entropy(self, M, n, N): k = r_[N-(M-n):min(n,N)+1] vals = self.pmf(k,M,n,N) lvals = where(vals==0.0,0.0,log(vals)) return -sum(vals*lvals,axis=0)
48ba19baad4689b1adfc686887dc76e1a520ab52 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12971/48ba19baad4689b1adfc686887dc76e1a520ab52/distributions.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 21937, 12, 2890, 16, 490, 16, 290, 16, 423, 4672, 417, 273, 436, 67, 63, 50, 17, 12, 49, 17, 82, 4672, 1154, 12, 82, 16, 50, 27921, 21, 65, 5773, 273, 365, 18, 7755, 74, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 21937, 12, 2890, 16, 490, 16, 290, 16, 423, 4672, 417, 273, 436, 67, 63, 50, 17, 12, 49, 17, 82, 4672, 1154, 12, 82, 16, 50, 27921, 21, 65, 5773, 273, 365, 18, 7755, 74, 12,...
isofstype = self.__isofstype,
isofstype = self._isofstype,
def __get_efi_image_stanzas(self, isodir, name): # FIXME: this only supports one kernel right now...
4a670c764a1a949c866539b8a6a60e2729747acb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9342/4a670c764a1a949c866539b8a6a60e2729747acb/live.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 10241, 77, 67, 2730, 67, 541, 94, 345, 12, 2890, 16, 353, 369, 481, 16, 508, 4672, 468, 9852, 30, 333, 1338, 6146, 1245, 5536, 2145, 2037, 2777, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 67, 10241, 77, 67, 2730, 67, 541, 94, 345, 12, 2890, 16, 353, 369, 481, 16, 508, 4672, 468, 9852, 30, 333, 1338, 6146, 1245, 5536, 2145, 2037, 2777, 2, -100, -100, -100, -...
so['stylesheet_path'] = os.path.join('data', 'stylesheet.txt')
stylesheet_path = os.path.join('data', 'stylesheet.txt') so['stylesheet_path'] = stylesheet_path
def test_stylesheet_dependencies(self): # Parameters to publish_file. s = {'settings_overrides': {}} so = s['settings_overrides'] so['embed_stylesheet'] = 0 so['stylesheet_path'] = os.path.join('data', 'stylesheet.txt') so['stylesheet'] = None s['writer_name'] = 'html' self.assert_(os.path.join('data', 'stylesheet.txt') not in self.get_record(**s)) so['embed_stylesheet'] = 1 self.assert_('data/stylesheet.txt' in self.get_record(**s)) del so['embed_stylesheet'] s['writer_name'] = 'latex' self.assert_('data/stylesheet.txt' in self.get_record(**s))
568874b9e92dd3af4f03d487d74f99a4da27277b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/568874b9e92dd3af4f03d487d74f99a4da27277b/test_dependencies.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
raise AutoGenError(msg="%s used in module %s cannot be found in any package!" % (GuidCName, Info.Name))
raise AutoGenError(msg="%s used in module %s cannot be found in any package!" % (GuidCName, self.Module))
def GetDepexTokenList(self, Info): Dxs = self.Module.Depex if Dxs == None or Dxs == "": return []
eef9afbed0b6dabb11ef75d2c98772d7136c5179 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/914/eef9afbed0b6dabb11ef75d2c98772d7136c5179/AutoGen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 16316, 338, 1345, 682, 12, 2890, 16, 3807, 4672, 463, 13713, 273, 365, 18, 3120, 18, 16316, 338, 309, 463, 13713, 422, 599, 578, 463, 13713, 422, 1408, 30, 327, 5378, 2, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 968, 16316, 338, 1345, 682, 12, 2890, 16, 3807, 4672, 463, 13713, 273, 365, 18, 3120, 18, 16316, 338, 309, 463, 13713, 422, 599, 578, 463, 13713, 422, 1408, 30, 327, 5378, 2, -100, -10...
def printScopeError(elementType, lineno):
def printError(fname, *misc): """Print error associated with a given file; avoid printing duplicates""" if fname: silenceValue = ' '.join(map(str, misc)) if fname not in silenceErrors: print >>sys.stderr, fname silenceErrors[fname] = set() elif silenceValue in silenceErrors[fname]: return silenceErrors[fname].add(silenceValue) print >>sys.stderr, 'wmliterator:', for item in misc: print >>sys.stderr, item, print >>sys.stderr def printScopeError(elementType, fname, lineno):
def printScopeError(elementType, lineno): """Print out warning if a scope was unable to close""" print >>sys.stderr, 'wmliterator: attempt to close empty scope at', elementType, 'line', lineno+1
0102da6ad83060d3ae0feccfa3d8643ce7252178 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/0102da6ad83060d3ae0feccfa3d8643ce7252178/wmliterator.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1172, 668, 12, 12749, 16, 380, 23667, 4672, 3536, 5108, 555, 3627, 598, 279, 864, 585, 31, 4543, 19171, 11211, 8395, 309, 5299, 30, 31468, 620, 273, 296, 2418, 5701, 12, 1458, 12, 701, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 668, 12, 12749, 16, 380, 23667, 4672, 3536, 5108, 555, 3627, 598, 279, 864, 585, 31, 4543, 19171, 11211, 8395, 309, 5299, 30, 31468, 620, 273, 296, 2418, 5701, 12, 1458, 12, 701, ...
"Are you afraid, like Gaudi, of not completeing your work?",
"Are you afraid, like Gaudi, of not completing your work?",
def respond(self,str): # find a match among keys for i in range(0,len(self.keys)): match = self.keys[i].match(str) if match: # found a match ... stuff with corresponding value # chosen randomly from among the available options resp = random.choice(self.values[i]) # we've got a response... stuff in reflected text where indicated pos = string.find(resp,'%') while pos > -1: num = string.atoi(resp[pos+1:pos+2]) resp = resp[:pos] + \ self.translate(match.group(num),gReflections) + \ resp[pos+2:] pos = string.find(resp,'%') # fix munged punctuation at the end if resp[-2:] == '?.': resp = resp[:-2] + '.' if resp[-2:] == '??': resp = resp[:-2] + '?' return resp
f8582a5b773d64d782ffeb9db4a75b22ae04342d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1488/f8582a5b773d64d782ffeb9db4a75b22ae04342d/eliza.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6846, 12, 2890, 16, 701, 4672, 468, 1104, 279, 845, 17200, 1311, 364, 277, 316, 1048, 12, 20, 16, 1897, 12, 2890, 18, 2452, 3719, 30, 845, 273, 365, 18, 2452, 63, 77, 8009, 1916, 12,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6846, 12, 2890, 16, 701, 4672, 468, 1104, 279, 845, 17200, 1311, 364, 277, 316, 1048, 12, 20, 16, 1897, 12, 2890, 18, 2452, 3719, 30, 845, 273, 365, 18, 2452, 63, 77, 8009, 1916, 12,...
matches = re.findall("^([0-9]*)(\.[0-9]{1,2})?([kMGT]{0,1}B)$", string) elif 'du' == format:
matches = re.findall("^([0-9]*)(\.[0-9]{1,2})?([kMGT]{0,1}B)$", human) elif 'du' == hformat:
def human_to_bytes(string, format = 'si'): """Convert a string like 10.2GB into bytes. By default use SI standard (base 10). The format of the GNU command 'du' (base 2) also supported.""" if 'si' == format: multiplier = { 'B' : 1, 'kB': 1000, 'MB': 1000**2, \ 'GB': 1000**3, 'TB': 1000**4 } matches = re.findall("^([0-9]*)(\.[0-9]{1,2})?([kMGT]{0,1}B)$", string) elif 'du' == format: multiplier = { 'B' : 1, 'KB': 1024, 'MB': 1024**2, \ 'GB': 1024**3, 'TB': 1024**4 } matches = re.findall("^([0-9]*)(\.[0-9]{1,2})?([KMGT]{0,1}B)$", string) else: raise ValueError("Invalid format: '%s'" % format) if [] == matches or 2 > len(matches[0]): raise ValueError("Invalid input for '%s' (format='%s')" % (string, format)) return int(float(matches[0][0]+matches[0][1]) * multiplier[matches[0][2]])
4935a515d81b04620ff2ab4659d81e155c21c9e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7853/4935a515d81b04620ff2ab4659d81e155c21c9e0/FileUtilities.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8672, 67, 869, 67, 3890, 12, 1080, 16, 740, 273, 296, 7722, 11, 4672, 3536, 2723, 279, 533, 3007, 1728, 18, 22, 5887, 1368, 1731, 18, 225, 2525, 805, 999, 5705, 4529, 261, 1969, 1728, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8672, 67, 869, 67, 3890, 12, 1080, 16, 740, 273, 296, 7722, 11, 4672, 3536, 2723, 279, 533, 3007, 1728, 18, 22, 5887, 1368, 1731, 18, 225, 2525, 805, 999, 5705, 4529, 261, 1969, 1728, ...
estr = "Invalid symbol."
estr = "Invalid symbol code."
def _colorize(doc, token, errors, warnings=None, tagName='para'): """ Given a string containing the contents of a paragraph, produce a DOM C{Element} encoding that paragraph. Colorized regions are represented using DOM C{Element}s, and text is represented using DOM C{Text}s. @param errors: A list of errors. Any newly generated errors will be appended to this list. @type errors: C{list} of C{string} @param warnings: A list of warnings. Any newly generated warnings will be appended to this list. To ignore warnings, use a value of None. @type warnings: C{list} of C{string} @param tagName: The element tag for the DOM C{Element} that should be generated. @type tagName: C{string} @return: a DOM C{Element} encoding the given paragraph. @returntype: C{Element} """ str = token.contents linenum = 0 if warnings == None: warnings = [] # Maintain a stack of DOM elements, containing the ancestors of # the text currently being analyzed. New elements are pushed when # "{" is encountered, and old elements are popped when "}" is # encountered. stack = [doc.createElement(tagName)] # This is just used to make error-reporting friendlier. It's a # stack parallel to "stack" containing the index of each element's # open brace. openbrace_stack = [0] # Process the string, scanning for '{' and '}'s. start is the # index of the first unprocessed character. Each time through the # loop, we process the text from the first unprocessed character # to the next open or close brace. start = 0 while 1: match = _BRACE_RE.search(str, start) if match == None: break end = match.start() # Open braces start new colorizing elements. When preceeded # by a capital letter, they specify a colored region, as # defined by the _COLORIZING_TAGS dictionary. Otherwise, # use a special "literal braces" element (with tag "litbrace"), # and convert them to literal braces once we find the matching # close-brace. if match.group() == '{': if (end>0) and 'A' <= str[end-1] <= 'Z': if (end-1) > start: stack[-1].appendChild(doc.createTextNode(str[start:end-1])) if not _COLORIZING_TAGS.has_key(str[end-1]): estr = "Unknown inline markup tag." errors.append(ColorizingError(estr, token, end-1)) stack.append(doc.createElement('unknown')) else: tag = _COLORIZING_TAGS[str[end-1]] stack.append(doc.createElement(tag)) else: if end > start: stack[-1].appendChild(doc.createTextNode(str[start:end])) stack.append(doc.createElement('litbrace')) openbrace_stack.append(end) stack[-2].appendChild(stack[-1]) # Close braces end colorizing elements. elif match.group() == '}': # Check for (and ignore) unbalanced braces. if len(stack) <= 1: estr = "Unbalanced '}'." errors.append(ColorizingError(estr, token, end)) start = end + 1 continue # Add any remaining text. if end > start: stack[-1].appendChild(doc.createTextNode(str[start:end])) # Special handling for symbols: if stack[-1].tagName == 'symbol': if (len(stack[-1].childNodes) != 1 or not isinstance(stack[-1].childNodes[0], Text)): estr = "Invalid symbol." errors.append(ColorizingError(estr, token, end)) else: symb = stack[-1].childNodes[0].data if _SYMBOLS.has_key(symb): # It's a symbol symbol = doc.createElement('symbol') stack[-2].removeChild(stack[-1]) stack[-2].appendChild(symbol) symbol.appendChild(doc.createTextNode(symb)) else: estr = "Invalid symbol." errors.append(ColorizingError(estr, token, end)) # Special handling for escape elements: if stack[-1].tagName == 'escape': if (len(stack[-1].childNodes) != 1 or not isinstance(stack[-1].childNodes[0], Text)): estr = "Invalid escape." errors.append(ColorizingError(estr, token, end)) else: escp = stack[-1].childNodes[0].data if _ESCAPES.has_key(escp): # It's an escape from _ESCPAES stack[-2].removeChild(stack[-1]) escp = _ESCAPES[escp] stack[-2].appendChild(doc.createTextNode(escp)) elif len(escp) == 1: # It's a single-character escape (eg E{.}) stack[-2].removeChild(stack[-1]) stack[-2].appendChild(doc.createTextNode(escp)) else: estr = "Invalid escape." errors.append(ColorizingError(estr, token, end)) # Special handling for literal braces elements: if stack[-1].tagName == 'litbrace': children = stack[-1].childNodes stack[-2].removeChild(stack[-1]) stack[-2].appendChild(doc.createTextNode('{')) for child in children: stack[-2].appendChild(child) stack[-2].appendChild(doc.createTextNode('}')) # Special handling for link-type elements: if stack[-1].tagName in _LINK_COLORIZING_TAGS: link = _colorize_link(doc, stack[-1], token, end, warnings, errors) # Pop the completed element. openbrace_stack.pop() stack.pop() start = end+1 # Add any final text. if start < len(str): stack[-1].appendChild(doc.createTextNode(str[start:])) if len(stack) != 1: estr = "Unbalanced '{'." errors.append(ColorizingError(estr, token, openbrace_stack[-1])) return stack[0]
36ace726c8fc4e9c1a450d16c75087d594ead7cf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/36ace726c8fc4e9c1a450d16c75087d594ead7cf/epytext.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3266, 554, 12, 2434, 16, 1147, 16, 1334, 16, 5599, 33, 7036, 16, 7196, 2218, 25072, 11, 4672, 3536, 16803, 279, 533, 4191, 326, 2939, 434, 279, 10190, 16, 11402, 279, 4703, 385, 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, 389, 3266, 554, 12, 2434, 16, 1147, 16, 1334, 16, 5599, 33, 7036, 16, 7196, 2218, 25072, 11, 4672, 3536, 16803, 279, 533, 4191, 326, 2939, 434, 279, 10190, 16, 11402, 279, 4703, 385, 9...
return _win_functype_cache[(restype, argtypes)]
return _win_functype_cache[(restype, argtypes, flags)]
def WINFUNCTYPE(restype, *argtypes): # docstring set later (very similar to CFUNCTYPE.__doc__) try: return _win_functype_cache[(restype, argtypes)] except KeyError: class WinFunctionType(_CFuncPtr): _argtypes_ = argtypes _restype_ = restype _flags_ = _FUNCFLAG_STDCALL _win_functype_cache[(restype, argtypes)] = WinFunctionType return WinFunctionType
80c06d808e835167ce387b53461bda158c7c9257 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/80c06d808e835167ce387b53461bda158c7c9257/ctypes__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 678, 19212, 2124, 17331, 12, 8792, 388, 16, 380, 3175, 2352, 4672, 468, 14525, 444, 5137, 261, 3242, 7281, 358, 6123, 2124, 17331, 16186, 2434, 972, 13, 775, 30, 327, 389, 8082, 67, 74, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 678, 19212, 2124, 17331, 12, 8792, 388, 16, 380, 3175, 2352, 4672, 468, 14525, 444, 5137, 261, 3242, 7281, 358, 6123, 2124, 17331, 16186, 2434, 972, 13, 775, 30, 327, 389, 8082, 67, 74, ...
dominfo.waitForDevices()
try: dominfo.waitForDevices() except Exception, ex: log.warn("Failed to setup devices for " + str(dominfo) + ": " + str(ex)) dominfo.destroy() raise
def domain_start(self, domid, start_paused = True): """Start a managed domain
08c9f6ee4d17eb440e4d9670635e99ae5735c1a2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6195/08c9f6ee4d17eb440e4d9670635e99ae5735c1a2/XendDomain.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2461, 67, 1937, 12, 2890, 16, 4092, 350, 16, 787, 67, 8774, 3668, 273, 1053, 4672, 3536, 1685, 279, 7016, 2461, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2461, 67, 1937, 12, 2890, 16, 4092, 350, 16, 787, 67, 8774, 3668, 273, 1053, 4672, 3536, 1685, 279, 7016, 2461, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
p7, data = SMIME.smime_load_pkcs7_bio(signature) assert data.read() == cleartext
p7, data = SMIME.smime_load_pkcs7_bio(self.signature) assert data.read() == self.cleartext
def check_2_verify(self): s = SMIME.SMIME() x509 = X509.load_cert('signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('ca.pem') s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7_bio(signature) assert data.read() == cleartext assert isinstance(p7, SMIME.PKCS7), p7 v = s.verify(p7) assert v == cleartext
8d88bcc39abdc6db218e3a485dc691c215692d64 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/8d88bcc39abdc6db218e3a485dc691c215692d64/test_smime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 22, 67, 8705, 12, 2890, 4672, 272, 273, 12014, 3114, 18, 7303, 3114, 1435, 225, 619, 5995, 273, 1139, 5995, 18, 945, 67, 7593, 2668, 2977, 264, 18, 20313, 6134, 4343, 273, 113...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 22, 67, 8705, 12, 2890, 4672, 272, 273, 12014, 3114, 18, 7303, 3114, 1435, 225, 619, 5995, 273, 1139, 5995, 18, 945, 67, 7593, 2668, 2977, 264, 18, 20313, 6134, 4343, 273, 113...
currentItemOf = schema.One() shares = schema.Sequence(initialValue=())
currentItemOf = schema.One(otherName="item") shares = schema.Sequence(initialValue=(), otherName="contents")
def makeContainer(parent, name, child): if child is None: return itemKind.newItem(name, parent) else: return child
7490192192e0de90940ac6643058a5eaca743943 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/7490192192e0de90940ac6643058a5eaca743943/ContentModel.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1221, 2170, 12, 2938, 16, 508, 16, 1151, 4672, 309, 1151, 353, 599, 30, 327, 761, 5677, 18, 2704, 1180, 12, 529, 16, 982, 13, 469, 30, 327, 1151, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1221, 2170, 12, 2938, 16, 508, 16, 1151, 4672, 309, 1151, 353, 599, 30, 327, 761, 5677, 18, 2704, 1180, 12, 529, 16, 982, 13, 469, 30, 327, 1151, 2, -100, -100, -100, -100, -100, -10...
if license: _add_license(tmpdir)
def export(src, dst, process_directives=True, keywords={}, exclude_dirs=[], exclude_files=[], license=False, directive_vars={}): """ Build from a directory to a directory. src: Source dir to build from dst: destination directory to build to process_directives: if true, process <!-- command.. directives in html/xml files Keywords: key/value pairs used for keyword replacement on the sources. As in, if the source files contain $date$ the keywords dict could contain {"$date$": "23.09.08"}, to insert that date into the sources. exclude_dirs: directoriy blacklist. Will not be included in the build exclude_files: file blacklist. Will not be included in the build license: path to a license file to append to sources directive_vars: a dictionary that will passed on to the diretive handling. Can be used to control the handling of the directives """ src = os.path.abspath(src); # make sure it's absolute # get a temporary place to do stuff tmpbase = tempfile.mkdtemp(".tmp", "dfbuild.") ## this is kinda dumb but copytree always copy to a non-extant subdir tmpdir = os.path.join(tmpbase, "src") shutil.copytree(src, tmpdir) if process_directives: _process_directive_files(tmpdir, directive_vars) # remove empty directories and stuff in the blacklist _clean_dir(tmpdir, exclude_dirs, exclude_files) if license: _add_license(tmpdir) if keywords: _add_keywords(tmpdir, keywords) #copy the stuff to its final destination and get rid of temp copy: if not os.path.isdir(dst): os.mkdir(dst) # stupid copy function to get around the must-put-in-subdir thingy in shutil.copytree for entry in os.listdir(tmpdir): path = os.path.join(tmpdir, entry) if os.path.isdir(path): shutil.copytree(path, os.path.join(dst, entry)) else: shutil.copy(os.path.join(tmpdir,entry), dst) shutil.rmtree(tmpbase)
1ed9ee651d62953a613b6ba16c7f4039e477d748 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10925/1ed9ee651d62953a613b6ba16c7f4039e477d748/dfbuild.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 12, 4816, 16, 3046, 16, 1207, 67, 30850, 33, 5510, 16, 7093, 28793, 4433, 67, 8291, 22850, 6487, 4433, 67, 2354, 22850, 6487, 8630, 33, 8381, 16, 8655, 67, 4699, 12938, 4672, 3536,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3359, 12, 4816, 16, 3046, 16, 1207, 67, 30850, 33, 5510, 16, 7093, 28793, 4433, 67, 8291, 22850, 6487, 4433, 67, 2354, 22850, 6487, 8630, 33, 8381, 16, 8655, 67, 4699, 12938, 4672, 3536,...
if list[2][:3] in ('4.1','4.2','4.3'): libs = ['gfortranbegin'] break
if list[2][:3] in ('4.1','4.2','4.3'): libs = ['gfortranbegin'] break
def gccFortranLibs(): """Test whether -lfrtbegin is required. This can probably be done in a more reliable way, but using popen3 is relatively efficient.""" libs = ['g2c'] try: import popen2 stderr = popen2.popen3('gcc -v')[2] except OSError: return libs for l in stderr.readlines(): list = string.split(l) if len(list) > 3 and list[:2] == ['gcc', 'version']: if list[2][:3] in ('4.1','4.2','4.3'): libs = ['gfortranbegin'] break if list[2][:2] in ('3.', '4.'): libs = ['frtbegin'] + libs break return libs
1627808a9aa21cd9de2888035d3f1c94c6d395f2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12817/1627808a9aa21cd9de2888035d3f1c94c6d395f2/TestSCons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 952, 1290, 13171, 5664, 87, 13332, 3536, 4709, 2856, 300, 20850, 3797, 10086, 353, 1931, 18, 225, 1220, 848, 8656, 506, 2731, 316, 279, 1898, 31024, 4031, 16, 1496, 1450, 30925, 23, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 314, 952, 1290, 13171, 5664, 87, 13332, 3536, 4709, 2856, 300, 20850, 3797, 10086, 353, 1931, 18, 225, 1220, 848, 8656, 506, 2731, 316, 279, 1898, 31024, 4031, 16, 1496, 1450, 30925, 23, ...
for index, label in zip(range(1, 14), _LABELS[2:]):
for index, label in zip(range(2, 15), _LABELS[2:]):
def plot_2d_graphs(self): """ For each one of the throughput parameters, generate a set of gnuplot commands that will create a parametric surface with file size vs. record size vs. throughput. """ datasource_2d = os.path.join(self.output_dir, '2d-datasource-file') for index, label in zip(range(1, 14), _LABELS[2:]): commands_path = os.path.join(self.output_dir, '2d-%s.do' % label) commands = "" commands += "set title 'Iozone performance: %s'\n" % label commands += "set logscale x\n" commands += "set xlabel 'File size (KB)'\n" commands += "set ylabel 'Througput (MB/s)'\n" commands += "set terminal png small size 450 350\n" commands += "set output '%s'\n" % os.path.join(self.output_dir, '2d-%s.png' % label) commands += ("plot '%s' using 1:%s title '%s' with lines \n" % (datasource_2d, index, label)) commands_file = open(commands_path, 'w') commands_file.write(commands) commands_file.close() try: utils.run("%s %s" % (self.gnuplot, commands_path)) except error.CmdError, e: logging.error("Problem plotting from commands file %s: %s", commands_file, str(e))
eec7b934f957585f06f13ffa73a5dd19065b9a6e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/eec7b934f957585f06f13ffa73a5dd19065b9a6e/postprocessing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 67, 22, 72, 67, 30016, 12, 2890, 4672, 3536, 2457, 1517, 1245, 434, 326, 24677, 1472, 16, 2103, 279, 444, 434, 314, 13053, 4032, 4364, 716, 903, 752, 279, 579, 1591, 9034, 598, 5...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3207, 67, 22, 72, 67, 30016, 12, 2890, 4672, 3536, 2457, 1517, 1245, 434, 326, 24677, 1472, 16, 2103, 279, 444, 434, 314, 13053, 4032, 4364, 716, 903, 752, 279, 579, 1591, 9034, 598, 5...
if flavours.has_key(flavouring[1]): flavours[flavouring[1]][flavouring[0]] = flav_template else: flavours[flavouring[1]] = {flavouring[0]: flav_template} if not flavours.has_key(taste): taste = 'error' return flavours[taste]
flavour[flavouring[0]] = flav_template if not flavour: return DEFAULT_FLAVOURS["error"] return flavour
def _getFlavour(self, taste = 'html'): """ Flavours, or views, or templates, as some may call it, defaults are given, but can be overidden with files on the datadir. Don't like the default html templates, add your own, head.html, story.html etc. """ # Ugly default templates, have to though :( html = {'content_type' : 'text/html', 'head' : """<html><head><link rel="alternate" type="application/rss+xml" title="RSS" href="$url/?flav=rss" /><title>$blog_title $pi_da $pi_mo $pi_yr</title></head><body><center><font size="+3">$blog_title</font><br />$pi_da $pi_mo $pi_yr</center><p />""", 'date_head' : '<div class="blosxomDayDiv">\n<span class="blosxomDate">$date</span>', 'story' : """<p><a name="$fn"><b>$title</b></a><br />$body<br /><br />posted at: $ti | path: <a href="$base_url/$absolute_path" title="path">/$absolute_path</a> | <a href="$base_url/$file_path.$flavour">permanent link to this entry</a></p>\n""", 'date_foot' : '</div>', 'foot' : """<p /><center><a href="http://roughingit.subtlehints.net/pyblosxom"><img src="http://roughingit.subtlehints.net/images/pb_pyblosxom.gif" border="0" /></body></html>"""} rss = {'content_type' : 'text/xml', 'head' : """<?xml version="1.0"?>\n<!-- name="generator" content="$pyblosxom_name/$pyblosxom_version" -->\n<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">\n\n<rss version="0.91">\n <channel>\n <title>$blog_title $pi_da $pi_mo $pi_yr</title>\n <link>$url</link>\n <description>$blog_description</description>\n <language>$blog_language</language>\n""", 'story' : """<item>\n <title>$title</title>\n <link>$base_url/$file_path.html</link>\n <description>$body</description>\n </item>\n""", 'foot' : ' </channel>\n</rss>'} rss3 = {'content_type' : 'text/plain', 'head' : """title: $blog_title\ndescription: $blog_description\nlink: $url\ncreator: $blog_author\nerrorsTo: $blog_author\nlang: $blog_language\n\n\n""", 'story' : """title: $title\nlink: $base_url/$file_path.html\ncreated: $w3cdate\nsubject: $path\nguid: $file_path\n\n""", 'foot' : ''} esf = {'content_type' : 'text/plain', 'head' : """title: $blog_title\ncontact: contact@example.com (The Contact Person)\nlink: $url\n\n\n""", 'story' : """$mtime\t$title\t$base_url/$file_path\n""", 'foot' : ''} error = {'content_type' : 'text/plain', 'head' : """ Error: I'm afraid this is the first I've heard of a "$flavour" flavoured pyblosxom.\n Try dropping the "?flav=$flavour" bit from the end of the URL.\n\n"""} flavours = {'html' : html, 'rss' : rss, 'error' : error, 'rss3' : rss3, 'esf' : esf} # End of ugly portion! Yucks :) # Look for flavours in datadir
9b5f45cbba0b224c21a4961822b3744eb81d2271 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/9b5f45cbba0b224c21a4961822b3744eb81d2271/blosxom.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 2340, 842, 477, 12, 2890, 16, 268, 14725, 273, 296, 2620, 11, 4672, 3536, 3857, 842, 4390, 16, 578, 7361, 16, 578, 5539, 16, 487, 2690, 2026, 745, 518, 16, 3467, 854, 864, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2340, 842, 477, 12, 2890, 16, 268, 14725, 273, 296, 2620, 11, 4672, 3536, 3857, 842, 4390, 16, 578, 7361, 16, 578, 5539, 16, 487, 2690, 2026, 745, 518, 16, 3467, 854, 864, ...
<Feature Id='Complete' Title='Modula-3' Description='everything.' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
def MakeMSIWithWix(input): wix = open(input + ".wxs", "w") wix.write(
3cd74c76a1f28f2277964d69834365789b8c1363 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9328/3cd74c76a1f28f2277964d69834365789b8c1363/pylib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 49, 2320, 1190, 59, 697, 12, 2630, 4672, 225, 341, 697, 273, 1696, 12, 2630, 397, 3552, 91, 13713, 3113, 315, 91, 7923, 341, 697, 18, 2626, 12, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4344, 49, 2320, 1190, 59, 697, 12, 2630, 4672, 225, 341, 697, 273, 1696, 12, 2630, 397, 3552, 91, 13713, 3113, 315, 91, 7923, 341, 697, 18, 2626, 12, 2, -100, -100, -100, -100, -100, ...
Attempt to convert from a resource set to a ROA prefix set. This doesn't work in the general case but is sometimes useful anyway. """ return self.roa_prefix_set_type([self.roa_prefix_set_type.prefix_type(r.min, r._prefixlen()) for r in self])
Convert from a resource set to a ROA prefix set. """ return self.roa_prefix_set_type([ self.roa_prefix_set_type.prefix_type(r.min, r._prefixlen()) for r in self.chop_into_prefixes()])
def to_roa_prefix_set(self): """ Attempt to convert from a resource set to a ROA prefix set. This doesn't work in the general case but is sometimes useful anyway. """ return self.roa_prefix_set_type([self.roa_prefix_set_type.prefix_type(r.min, r._prefixlen()) for r in self])
aa07ae9fa3429fbf12adf155b34a9e64be85a1a1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/119/aa07ae9fa3429fbf12adf155b34a9e64be85a1a1/resource_set.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 303, 69, 67, 3239, 67, 542, 12, 2890, 4672, 3536, 12864, 358, 1765, 628, 279, 1058, 444, 358, 279, 6525, 37, 1633, 444, 18, 225, 1220, 3302, 1404, 1440, 316, 326, 7470, 648, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 303, 69, 67, 3239, 67, 542, 12, 2890, 4672, 3536, 12864, 358, 1765, 628, 279, 1058, 444, 358, 279, 6525, 37, 1633, 444, 18, 225, 1220, 3302, 1404, 1440, 316, 326, 7470, 648, ...
self.Page.header = re.sub('{{'+self.tpl+'\n[^}]*\n}}',self.attr2text(),self.Page.header)
self.Page.header = re.sub('{{'+self.tpl+'\n.*?\n}}',self.attr2text(),self.Page.header,re.DOTALL)
def run(self): whys = self.analyzePage() if self.archivedThreads < int(self.get('minthreadstoarchive',2)): return #We might not want to archive a measly few threads (lowers edit frequency) if whys: #Save the archives first (so that bugs don't cause a loss of data) for a in sorted(self.archives.keys()): self.commentParams['count'] = self.archives[a].archivedThreads comment = self.archiveSummary % self.commentParams self.archives[a].update(comment)
05d0a809a7af1ed3d953730588f456da4e668d99 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/05d0a809a7af1ed3d953730588f456da4e668d99/archivebot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 600, 1900, 273, 365, 18, 304, 9508, 1964, 1435, 309, 365, 18, 991, 2950, 13233, 411, 509, 12, 2890, 18, 588, 2668, 1154, 5930, 30168, 10686, 2187, 22, 3719, 30, 3...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 2890, 4672, 600, 1900, 273, 365, 18, 304, 9508, 1964, 1435, 309, 365, 18, 991, 2950, 13233, 411, 509, 12, 2890, 18, 588, 2668, 1154, 5930, 30168, 10686, 2187, 22, 3719, 30, 3...
_format(self, ''.join(Base.verbatim.invoke(self, tex)[1:]).split('\n'))
s = ''.join(Base.verbatim.invoke(self, tex)[1:]).replace('\r','').split('\n') _format(self, s)
def invoke(self, tex): if self.macroMode == Base.Environment.MODE_END: return _format(self, ''.join(Base.verbatim.invoke(self, tex)[1:]).split('\n'))
42ef9db08c0f81271eaec9acfc2a6b9b065e7bb4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7864/42ef9db08c0f81271eaec9acfc2a6b9b065e7bb4/listings.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 16, 16573, 4672, 309, 365, 18, 26448, 2309, 422, 3360, 18, 5494, 18, 7038, 67, 4415, 30, 327, 272, 273, 875, 18, 5701, 12, 2171, 18, 16629, 22204, 18, 14407, 12, 2890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4356, 12, 2890, 16, 16573, 4672, 309, 365, 18, 26448, 2309, 422, 3360, 18, 5494, 18, 7038, 67, 4415, 30, 327, 272, 273, 875, 18, 5701, 12, 2171, 18, 16629, 22204, 18, 14407, 12, 2890, ...
stylesheet_path = os.path.join('data', 'stylesheet.txt')
stylesheet_path = 'data/stylesheet.txt'
def test_stylesheet_dependencies(self): # Parameters to publish_file. s = {'settings_overrides': {}} so = s['settings_overrides'] so['embed_stylesheet'] = 0 stylesheet_path = os.path.join('data', 'stylesheet.txt') so['stylesheet_path'] = stylesheet_path so['stylesheet'] = None s['writer_name'] = 'html' self.assert_(stylesheet_path not in self.get_record(**s)) so['embed_stylesheet'] = 1 self.assert_(stylesheet_path in self.get_record(**s)) s['writer_name'] = 'latex' self.assert_(stylesheet_path in self.get_record(**s)) del so['embed_stylesheet'] self.assert_(stylesheet_path not in self.get_record(**s))
ec154e64a5680783f844ac69db02b16713afa848 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5620/ec154e64a5680783f844ac69db02b16713afa848/test_dependencies.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 19403, 67, 11037, 12, 2890, 4672, 468, 7012, 358, 3808, 67, 768, 18, 272, 273, 13666, 4272, 67, 19775, 4278, 2618, 97, 1427, 273, 272, 3292, 4272, 67, 19775, 3546, 1427, 3292, ...
of the original `document` document, pass settings=document.settings.
of the original `document`, pass settings=document.settings.
def publish_from_doctree(document, destination_path=None, writer=None, writer_name='pseudoxml', settings=None, settings_spec=None, settings_overrides=None, config_section=None, enable_exit_status=None): """ Set up & run a `Publisher` to render from an existing document tree data structure, for programmatic use with string I/O. Return a pair of encoded string output and document parts. Note that document.settings is overridden; if you want to use the settings of the original `document` document, pass settings=document.settings. For encoded string output, be sure to set the 'output_encoding' setting to the desired encoding. Set it to 'unicode' for unencoded Unicode string output. Here's one way:: publish_from_doctree( ..., settings_overrides={'output_encoding': 'unicode'}) Parameters: see `publish_programmatically`. """ # Create fresh Transformer object, to be populated from Writer component. document.transformer = Transformer(document) # Don't apply default transforms twice: document.transformer.default_transforms = (document.transformer .reprocess_transforms) reader = docutils.readers.doctree.Reader(parser_name='null') pub = Publisher(reader, None, writer, source=io.DocTreeInput(document), destination_class=io.StringOutput, settings=settings) pub.set_writer(writer_name) pub.process_programmatic_settings( settings_spec, settings_overrides, config_section) pub.set_destination(None, destination_path) output = pub.publish(enable_exit_status=enable_exit_status) return output, pub.writer.parts
bedc37b2f4d7ae0c48570980c864271ef6586551 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/bedc37b2f4d7ae0c48570980c864271ef6586551/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2080, 67, 2896, 299, 992, 12, 5457, 16, 2929, 67, 803, 33, 7036, 16, 2633, 33, 7036, 16, 2633, 67, 529, 2218, 84, 23715, 2409, 781, 2187, 1947, 33, 7036, 16, 1947, 67, 2793...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3808, 67, 2080, 67, 2896, 299, 992, 12, 5457, 16, 2929, 67, 803, 33, 7036, 16, 2633, 33, 7036, 16, 2633, 67, 529, 2218, 84, 23715, 2409, 781, 2187, 1947, 33, 7036, 16, 1947, 67, 2793...
push('%') push(ch)
return timedelta(minutes=59) base = cls(8, 9, 10, tzinfo=OperandDependentOffset()) d0 = base.replace(minute=3) d1 = base.replace(minute=9) d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: got = cmp(x, y) expected = cmp(x.minute, y.minute) self.assertEqual(got, expected) if cls is not time: d0 = base.replace(minute=3, tzinfo=OperandDependentOffset()) d1 = base.replace(minute=9, tzinfo=OperandDependentOffset()) d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: got = cmp(x, y) if (x is d0 or x is d1) and (y is d0 or y is d1): expected = 0 elif x is y is d2: expected = 0 elif x is d2: expected = -1 else: assert y is d2 expected = 1 self.assertEqual(got, expected) class TestTimeTZ(TestTime, TZInfoBase): theclass = time def test_empty(self): t = self.theclass() self.assertEqual(t.hour, 0) self.assertEqual(t.minute, 0) self.assertEqual(t.second, 0) self.assertEqual(t.microsecond, 0) self.failUnless(t.tzinfo is None) def test_zones(self): est = FixedOffset(-300, "EST", 1) utc = FixedOffset(0, "UTC", -2) met = FixedOffset(60, "MET", 3) t1 = time( 7, 47, tzinfo=est) t2 = time(12, 47, tzinfo=utc) t3 = time(13, 47, tzinfo=met) t4 = time(microsecond=40) t5 = time(microsecond=40, tzinfo=utc) self.assertEqual(t1.tzinfo, est) self.assertEqual(t2.tzinfo, utc) self.assertEqual(t3.tzinfo, met) self.failUnless(t4.tzinfo is None) self.assertEqual(t5.tzinfo, utc) self.assertEqual(t1.utcoffset(), timedelta(minutes=-300)) self.assertEqual(t2.utcoffset(), timedelta(minutes=0)) self.assertEqual(t3.utcoffset(), timedelta(minutes=60)) self.failUnless(t4.utcoffset() is None) self.assertRaises(TypeError, t1.utcoffset, "no args") self.assertEqual(t1.tzname(), "EST") self.assertEqual(t2.tzname(), "UTC") self.assertEqual(t3.tzname(), "MET") self.failUnless(t4.tzname() is None) self.assertRaises(TypeError, t1.tzname, "no args") self.assertEqual(t1.dst(), timedelta(minutes=1)) self.assertEqual(t2.dst(), timedelta(minutes=-2)) self.assertEqual(t3.dst(), timedelta(minutes=3)) self.failUnless(t4.dst() is None) self.assertRaises(TypeError, t1.dst, "no args") self.assertEqual(hash(t1), hash(t2)) self.assertEqual(hash(t1), hash(t3)) self.assertEqual(hash(t2), hash(t3)) self.assertEqual(t1, t2) self.assertEqual(t1, t3) self.assertEqual(t2, t3) self.assertRaises(TypeError, lambda: t4 == t5) self.assertRaises(TypeError, lambda: t4 < t5) self.assertRaises(TypeError, lambda: t5 < t4) self.assertEqual(str(t1), "07:47:00-05:00") self.assertEqual(str(t2), "12:47:00+00:00") self.assertEqual(str(t3), "13:47:00+01:00") self.assertEqual(str(t4), "00:00:00.000040") self.assertEqual(str(t5), "00:00:00.000040+00:00") self.assertEqual(t1.isoformat(), "07:47:00-05:00") self.assertEqual(t2.isoformat(), "12:47:00+00:00") self.assertEqual(t3.isoformat(), "13:47:00+01:00") self.assertEqual(t4.isoformat(), "00:00:00.000040") self.assertEqual(t5.isoformat(), "00:00:00.000040+00:00") d = 'datetime.time' self.assertEqual(repr(t1), d + "(7, 47, tzinfo=est)") self.assertEqual(repr(t2), d + "(12, 47, tzinfo=utc)") self.assertEqual(repr(t3), d + "(13, 47, tzinfo=met)") self.assertEqual(repr(t4), d + "(0, 0, 0, 40)") self.assertEqual(repr(t5), d + "(0, 0, 0, 40, tzinfo=utc)") self.assertEqual(t1.strftime("%H:%M:%S %%Z=%Z %%z=%z"), "07:47:00 %Z=EST %z=-0500") self.assertEqual(t2.strftime("%H:%M:%S %Z %z"), "12:47:00 UTC +0000") self.assertEqual(t3.strftime("%H:%M:%S %Z %z"), "13:47:00 MET +0100") yuck = FixedOffset(-1439, "%z %Z %%z%%Z") t1 = time(23, 59, tzinfo=yuck) self.assertEqual(t1.strftime("%H:%M %%Z='%Z' %%z='%z'"), "23:59 %Z='%z %Z %%z%%Z' %z='-2359'") class Badtzname(tzinfo): def tzname(self, dt): return 42 t = time(2, 3, 4, tzinfo=Badtzname()) self.assertEqual(t.strftime("%H:%M:%S"), "02:03:04") self.assertRaises(TypeError, t.strftime, "%Z") def test_hash_edge_cases(self): t1 = self.theclass(0, 1, 2, 3, tzinfo=FixedOffset(1439, "")) t2 = self.theclass(0, 0, 2, 3, tzinfo=FixedOffset(1438, "")) self.assertEqual(hash(t1), hash(t2)) t1 = self.theclass(23, 58, 6, 100, tzinfo=FixedOffset(-1000, "")) t2 = self.theclass(23, 48, 6, 100, tzinfo=FixedOffset(-1010, "")) self.assertEqual(hash(t1), hash(t2)) def test_pickling(self): args = 20, 59, 16, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) derived = unpickler.loads(green) self.assertEqual(orig, derived) tinfo = PicklableFixedOffset(-300, 'cookie') orig = self.theclass(5, 6, 7, tzinfo=tinfo) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) derived = unpickler.loads(green) self.assertEqual(orig, derived) self.failUnless(isinstance(derived.tzinfo, PicklableFixedOffset)) self.assertEqual(derived.utcoffset(), timedelta(minutes=-300)) self.assertEqual(derived.tzname(), 'cookie') def test_more_bool(self): cls = self.theclass t = cls(0, tzinfo=FixedOffset(-300, "")) self.failUnless(t) t = cls(5, tzinfo=FixedOffset(-300, "")) self.failUnless(t) t = cls(5, tzinfo=FixedOffset(300, "")) self.failUnless(not t) t = cls(23, 59, tzinfo=FixedOffset(23*60 + 59, "")) self.failUnless(not t) t = cls(0, tzinfo=FixedOffset(23*60 + 59, "")) self.failUnless(t) t = cls(0, tzinfo=FixedOffset(24*60, "")) self.assertRaises(ValueError, lambda: bool(t)) t = cls(0, tzinfo=FixedOffset(-24*60, "")) self.assertRaises(ValueError, lambda: bool(t)) def test_replace(self): cls = self.theclass z100 = FixedOffset(100, "+100") zm200 = FixedOffset(timedelta(minutes=-200), "-200") args = [1, 2, 3, 4, z100] base = cls(*args) self.assertEqual(base, base.replace()) i = 0 for name, newval in (("hour", 5), ("minute", 6), ("second", 7), ("microsecond", 8), ("tzinfo", zm200)): newargs = args[:] newargs[i] = newval expected = cls(*newargs) got = base.replace(**{name: newval}) self.assertEqual(expected, got) i += 1 self.assertEqual(base.tzname(), "+100") base2 = base.replace(tzinfo=None) self.failUnless(base2.tzinfo is None) self.failUnless(base2.tzname() is None) base3 = base2.replace(tzinfo=z100) self.assertEqual(base, base3) self.failUnless(base.tzinfo is base3.tzinfo) base = cls(1) self.assertRaises(ValueError, base.replace, hour=24) self.assertRaises(ValueError, base.replace, minute=-1) self.assertRaises(ValueError, base.replace, second=100) self.assertRaises(ValueError, base.replace, microsecond=1000000) def test_mixed_compare(self): t1 = time(1, 2, 3) t2 = time(1, 2, 3) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=None) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(None, "")) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) class Varies(tzinfo): def __init__(self): self.offset = timedelta(minutes=22) def utcoffset(self, t): self.offset += timedelta(minutes=1) return self.offset v = Varies() t1 = t2.replace(tzinfo=v) t2 = t2.replace(tzinfo=v) self.assertEqual(t1.utcoffset(), timedelta(minutes=23)) self.assertEqual(t2.utcoffset(), timedelta(minutes=24)) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=Varies()) self.failUnless(t1 < t2) class TestDateTimeTZ(TestDateTime, TZInfoBase): theclass = datetime def test_trivial(self): dt = self.theclass(1, 2, 3, 4, 5, 6, 7) self.assertEqual(dt.year, 1) self.assertEqual(dt.month, 2) self.assertEqual(dt.day, 3) self.assertEqual(dt.hour, 4) self.assertEqual(dt.minute, 5) self.assertEqual(dt.second, 6) self.assertEqual(dt.microsecond, 7) self.assertEqual(dt.tzinfo, None) def test_even_more_compare(self): t1 = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "")) t2 = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=FixedOffset(-1439, "")) self.failUnless(t1 < t2) self.failUnless(t1 != t2) self.failUnless(t2 > t1) self.failUnless(t1 == t1) self.failUnless(t2 == t2) t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, "")) t2 = self.theclass(2, 1, 1, 3, 13, tzinfo=FixedOffset(3*60+13+2, "")) self.assertEqual(t1, t2) t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(0, "")) self.failUnless(t1 > t2) t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(2, "")) self.failUnless(t1 < t2) t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""), second=1) self.failUnless(t1 > t2) t1 = self.theclass(1, 12, 31, 23, 59, tzinfo=FixedOffset(1, ""), microsecond=1) self.failUnless(t1 > t2) t2 = self.theclass.min self.assertRaises(TypeError, lambda: t1 == t2) self.assertEqual(t2, t2) class Naive(tzinfo): def utcoffset(self, dt): return None t2 = self.theclass(5, 6, 7, tzinfo=Naive()) self.assertRaises(TypeError, lambda: t1 == t2) self.assertEqual(t2, t2) t1 = self.theclass(5, 6, 7) self.assertEqual(t1, t2) class Bogus(tzinfo): def utcoffset(self, dt): return timedelta(minutes=1440) t1 = self.theclass(2, 2, 2, tzinfo=Bogus()) t2 = self.theclass(2, 2, 2, tzinfo=FixedOffset(0, "")) self.assertRaises(ValueError, lambda: t1 == t2) def test_pickling(self): args = 6, 7, 23, 20, 59, 1, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) derived = unpickler.loads(green) self.assertEqual(orig, derived) tinfo = PicklableFixedOffset(-300, 'cookie') orig = self.theclass(*args, **{'tzinfo': tinfo}) derived = self.theclass(1, 1, 1, tzinfo=FixedOffset(0, "", 0)) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) derived = unpickler.loads(green) self.assertEqual(orig, derived) self.failUnless(isinstance(derived.tzinfo, PicklableFixedOffset)) self.assertEqual(derived.utcoffset(), timedelta(minutes=-300)) self.assertEqual(derived.tzname(), 'cookie') def test_extreme_hashes(self): t = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "")) hash(t) t = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=FixedOffset(-1439, "")) hash(t) t = self.theclass(5, 5, 5, tzinfo=FixedOffset(-1440, "")) self.assertRaises(ValueError, hash, t) def test_zones(self): est = FixedOffset(-300, "EST") utc = FixedOffset(0, "UTC") met = FixedOffset(60, "MET") t1 = datetime(2002, 3, 19, 7, 47, tzinfo=est) t2 = datetime(2002, 3, 19, 12, 47, tzinfo=utc) t3 = datetime(2002, 3, 19, 13, 47, tzinfo=met) self.assertEqual(t1.tzinfo, est) self.assertEqual(t2.tzinfo, utc) self.assertEqual(t3.tzinfo, met) self.assertEqual(t1.utcoffset(), timedelta(minutes=-300)) self.assertEqual(t2.utcoffset(), timedelta(minutes=0)) self.assertEqual(t3.utcoffset(), timedelta(minutes=60)) self.assertEqual(t1.tzname(), "EST") self.assertEqual(t2.tzname(), "UTC") self.assertEqual(t3.tzname(), "MET") self.assertEqual(hash(t1), hash(t2)) self.assertEqual(hash(t1), hash(t3)) self.assertEqual(hash(t2), hash(t3)) self.assertEqual(t1, t2) self.assertEqual(t1, t3) self.assertEqual(t2, t3) self.assertEqual(str(t1), "2002-03-19 07:47:00-05:00") self.assertEqual(str(t2), "2002-03-19 12:47:00+00:00") self.assertEqual(str(t3), "2002-03-19 13:47:00+01:00") d = 'datetime.datetime(2002, 3, 19, ' self.assertEqual(repr(t1), d + "7, 47, tzinfo=est)") self.assertEqual(repr(t2), d + "12, 47, tzinfo=utc)") self.assertEqual(repr(t3), d + "13, 47, tzinfo=met)") def test_combine(self): met = FixedOffset(60, "MET") d = date(2002, 3, 4) tz = time(18, 45, 3, 1234, tzinfo=met) dt = datetime.combine(d, tz) self.assertEqual(dt, datetime(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met)) def test_extract(self): met = FixedOffset(60, "MET") dt = self.theclass(2002, 3, 4, 18, 45, 3, 1234, tzinfo=met) self.assertEqual(dt.date(), date(2002, 3, 4)) self.assertEqual(dt.time(), time(18, 45, 3, 1234)) self.assertEqual(dt.timetz(), time(18, 45, 3, 1234, tzinfo=met)) def test_tz_aware_arithmetic(self): import random now = self.theclass.now() tz55 = FixedOffset(-330, "west 5:30") timeaware = now.time().replace(tzinfo=tz55) nowaware = self.theclass.combine(now.date(), timeaware) self.failUnless(nowaware.tzinfo is tz55) self.assertEqual(nowaware.timetz(), timeaware) self.assertRaises(TypeError, lambda: now - nowaware) self.assertRaises(TypeError, lambda: nowaware - now) self.assertRaises(TypeError, lambda: now + nowaware) self.assertRaises(TypeError, lambda: nowaware + now) self.assertRaises(TypeError, lambda: nowaware + nowaware) self.assertEqual(now - now, timedelta(0)) self.assertEqual(nowaware - nowaware, timedelta(0)) delta = timedelta(weeks=1, minutes=12, microseconds=5678) nowawareplus = nowaware + delta self.failUnless(nowaware.tzinfo is tz55) nowawareplus2 = delta + nowaware self.failUnless(nowawareplus2.tzinfo is tz55) self.assertEqual(nowawareplus, nowawareplus2) diff = nowawareplus - delta self.failUnless(diff.tzinfo is tz55) self.assertEqual(nowaware, diff) self.assertRaises(TypeError, lambda: delta - nowawareplus) self.assertEqual(nowawareplus - nowaware, delta) tzr = FixedOffset(random.randrange(-1439, 1440), "randomtimezone") nowawareplus = nowawareplus.replace(tzinfo=tzr) self.failUnless(nowawareplus.tzinfo is tzr) got = nowaware - nowawareplus expected = nowawareplus.utcoffset() - nowaware.utcoffset() - delta self.assertEqual(got, expected) min = self.theclass(1, 1, 1, tzinfo=FixedOffset(1439, "min")) max = self.theclass(MAXYEAR, 12, 31, 23, 59, 59, 999999, tzinfo=FixedOffset(-1439, "max")) maxdiff = max - min self.assertEqual(maxdiff, self.theclass.max - self.theclass.min + timedelta(minutes=2*1439)) def test_tzinfo_now(self): meth = self.theclass.now base = meth() off42 = FixedOffset(42, "42") another = meth(off42) again = meth(tz=off42) self.failUnless(another.tzinfo is again.tzinfo) self.assertEqual(another.utcoffset(), timedelta(minutes=42)) self.assertRaises(TypeError, meth, 16) self.assertRaises(TypeError, meth, tzinfo=16) self.assertRaises(TypeError, meth, tinfo=off42) self.assertRaises(TypeError, meth, off42, off42) weirdtz = FixedOffset(timedelta(hours=15, minutes=58), "weirdtz", 0) utc = FixedOffset(0, "utc", 0) for dummy in range(3): now = datetime.now(weirdtz) self.failUnless(now.tzinfo is weirdtz) utcnow = datetime.utcnow().replace(tzinfo=utc) now2 = utcnow.astimezone(weirdtz) if abs(now - now2) < timedelta(seconds=30): break else: self.fail("utcnow(), now(tz), or astimezone() may be broken") def test_tzinfo_fromtimestamp(self): import time meth = self.theclass.fromtimestamp ts = time.time() base = meth(ts) off42 = FixedOffset(42, "42") another = meth(ts, off42) again = meth(ts, tz=off42) self.failUnless(another.tzinfo is again.tzinfo) self.assertEqual(another.utcoffset(), timedelta(minutes=42)) self.assertRaises(TypeError, meth, ts, 16) self.assertRaises(TypeError, meth, ts, tzinfo=16) self.assertRaises(TypeError, meth, ts, tinfo=off42) self.assertRaises(TypeError, meth, ts, off42, off42) self.assertRaises(TypeError, meth) timestamp = 1000000000 utcdatetime = datetime.utcfromtimestamp(timestamp) utcoffset = timedelta(hours=-15, minutes=39) tz = FixedOffset(utcoffset, "tz", 0) expected = utcdatetime + utcoffset got = datetime.fromtimestamp(timestamp, tz) self.assertEqual(expected, got.replace(tzinfo=None)) def test_tzinfo_utcnow(self): meth = self.theclass.utcnow base = meth() off42 = FixedOffset(42, "42") self.assertRaises(TypeError, meth, off42) self.assertRaises(TypeError, meth, tzinfo=off42) def test_tzinfo_utcfromtimestamp(self): import time meth = self.theclass.utcfromtimestamp ts = time.time() base = meth(ts) off42 = FixedOffset(42, "42") self.assertRaises(TypeError, meth, ts, off42) self.assertRaises(TypeError, meth, ts, tzinfo=off42) def test_tzinfo_timetuple(self): class DST(tzinfo): def __init__(self, dstvalue): if isinstance(dstvalue, int): dstvalue = timedelta(minutes=dstvalue) self.dstvalue = dstvalue def dst(self, dt): return self.dstvalue cls = self.theclass for dstvalue, flag in (-33, 1), (33, 1), (0, 0), (None, -1): d = cls(1, 1, 1, 10, 20, 30, 40, tzinfo=DST(dstvalue)) t = d.timetuple() self.assertEqual(1, t.tm_year) self.assertEqual(1, t.tm_mon) self.assertEqual(1, t.tm_mday) self.assertEqual(10, t.tm_hour) self.assertEqual(20, t.tm_min) self.assertEqual(30, t.tm_sec) self.assertEqual(0, t.tm_wday) self.assertEqual(1, t.tm_yday) self.assertEqual(flag, t.tm_isdst) self.assertRaises(TypeError, cls(1, 1, 1, tzinfo=DST("x")).timetuple) self.assertEqual(cls(1,1,1, tzinfo=DST(1439)).timetuple().tm_isdst, 1) self.assertEqual(cls(1,1,1, tzinfo=DST(-1439)).timetuple().tm_isdst, 1) self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(1440)).timetuple) self.assertRaises(ValueError, cls(1,1,1, tzinfo=DST(-1440)).timetuple) def test_utctimetuple(self): class DST(tzinfo): def __init__(self, dstvalue): if isinstance(dstvalue, int): dstvalue = timedelta(minutes=dstvalue) self.dstvalue = dstvalue def dst(self, dt): return self.dstvalue cls = self.theclass self.assertRaises(NotImplementedError, cls(1, 1, 1, tzinfo=DST(0)).utcoffset) class UOFS(DST): def __init__(self, uofs, dofs=None): DST.__init__(self, dofs) self.uofs = timedelta(minutes=uofs) def utcoffset(self, dt): return self.uofs for dstvalue in -33, 33, 0, None: d = cls(1, 2, 3, 10, 20, 30, 40, tzinfo=UOFS(-53, dstvalue)) t = d.utctimetuple() self.assertEqual(d.year, t.tm_year) self.assertEqual(d.month, t.tm_mon) self.assertEqual(d.day, t.tm_mday) self.assertEqual(11, t.tm_hour) self.assertEqual(13, t.tm_min) self.assertEqual(d.second, t.tm_sec) self.assertEqual(d.weekday(), t.tm_wday) self.assertEqual(d.toordinal() - date(1, 1, 1).toordinal() + 1, t.tm_yday) self.assertEqual(0, t.tm_isdst) tiny = cls(MINYEAR, 1, 1, 0, 0, 37, tzinfo=UOFS(1439)) t = tiny.utctimetuple() self.assertEqual(t.tm_year, MINYEAR-1) self.assertEqual(t.tm_mon, 12) self.assertEqual(t.tm_mday, 31) self.assertEqual(t.tm_hour, 0) self.assertEqual(t.tm_min, 1) self.assertEqual(t.tm_sec, 37) self.assertEqual(t.tm_yday, 366) self.assertEqual(t.tm_isdst, 0) huge = cls(MAXYEAR, 12, 31, 23, 59, 37, 999999, tzinfo=UOFS(-1439)) t = huge.utctimetuple() self.assertEqual(t.tm_year, MAXYEAR+1) self.assertEqual(t.tm_mon, 1) self.assertEqual(t.tm_mday, 1) self.assertEqual(t.tm_hour, 23) self.assertEqual(t.tm_min, 58) self.assertEqual(t.tm_sec, 37) self.assertEqual(t.tm_yday, 1) self.assertEqual(t.tm_isdst, 0) def test_tzinfo_isoformat(self): zero = FixedOffset(0, "+00:00") plus = FixedOffset(220, "+03:40") minus = FixedOffset(-231, "-03:51") unknown = FixedOffset(None, "") cls = self.theclass datestr = '0001-02-03' for ofs in None, zero, plus, minus, unknown: for us in 0, 987001: d = cls(1, 2, 3, 4, 5, 59, us, tzinfo=ofs) timestr = '04:05:59' + (us and '.987001' or '') ofsstr = ofs is not None and d.tzname() or '' tailstr = timestr + ofsstr iso = d.isoformat() self.assertEqual(iso, datestr + 'T' + tailstr) self.assertEqual(iso, d.isoformat('T')) self.assertEqual(d.isoformat('k'), datestr + 'k' + tailstr) self.assertEqual(str(d), datestr + ' ' + tailstr) def test_replace(self): cls = self.theclass z100 = FixedOffset(100, "+100") zm200 = FixedOffset(timedelta(minutes=-200), "-200") args = [1, 2, 3, 4, 5, 6, 7, z100] base = cls(*args) self.assertEqual(base, base.replace()) i = 0 for name, newval in (("year", 2), ("month", 3), ("day", 4), ("hour", 5), ("minute", 6), ("second", 7), ("microsecond", 8), ("tzinfo", zm200)): newargs = args[:] newargs[i] = newval expected = cls(*newargs) got = base.replace(**{name: newval}) self.assertEqual(expected, got) i += 1 self.assertEqual(base.tzname(), "+100") base2 = base.replace(tzinfo=None) self.failUnless(base2.tzinfo is None) self.failUnless(base2.tzname() is None) base3 = base2.replace(tzinfo=z100) self.assertEqual(base, base3) self.failUnless(base.tzinfo is base3.tzinfo) base = cls(2000, 2, 29) self.assertRaises(ValueError, base.replace, year=2001) def test_more_astimezone(self): fnone = FixedOffset(None, "None") f44m = FixedOffset(44, "44") fm5h = FixedOffset(-timedelta(hours=5), "m300") dt = self.theclass.now(tz=f44m) self.failUnless(dt.tzinfo is f44m) self.assertRaises(ValueError, dt.astimezone, fnone) self.assertRaises(TypeError, dt.astimezone, None) x = dt.astimezone(dt.tzinfo) self.failUnless(x.tzinfo is f44m) self.assertEqual(x.date(), dt.date()) self.assertEqual(x.time(), dt.time()) got = dt.astimezone(fm5h) self.failUnless(got.tzinfo is fm5h) self.assertEqual(got.utcoffset(), timedelta(hours=-5)) expected = dt - dt.utcoffset() expected += fm5h.utcoffset(dt) expected = expected.replace(tzinfo=fm5h) self.assertEqual(got.date(), expected.date()) self.assertEqual(got.time(), expected.time()) self.assertEqual(got.timetz(), expected.timetz()) self.failUnless(got.tzinfo is expected.tzinfo) self.assertEqual(got, expected) def test_aware_subtract(self): cls = self.theclass class OperandDependentOffset(tzinfo): def utcoffset(self, t): if t.minute < 10: return timedelta(minutes=t.minute) else: return timedelta(minutes=59) base = cls(8, 9, 10, 11, 12, 13, 14, tzinfo=OperandDependentOffset()) d0 = base.replace(minute=3) d1 = base.replace(minute=9) d2 = base.replace(minute=11) for x in d0, d1, d2: for y in d0, d1, d2: got = x - y expected = timedelta(minutes=x.minute - y.minute) self.assertEqual(got, expected) base = cls(8, 9, 10, 11, 12, 13, 14) d0 = base.replace(minute=3, tzinfo=OperandDependentOffset()) d1 = base.replace(minute=9, tzinfo=OperandDependentOffset()) d2 = base.replace(minute=11, tzinfo=OperandDependentOffset()) for x in d0, d1, d2: for y in d0, d1, d2: got = x - y if (x is d0 or x is d1) and (y is d0 or y is d1): expected = timedelta(0) elif x is y is d2: expected = timedelta(0) elif x is d2: expected = timedelta(minutes=(11-59)-0) else: assert y is d2 expected = timedelta(minutes=0-(11-59)) self.assertEqual(got, expected) def test_mixed_compare(self): t1 = datetime(1, 2, 3, 4, 5, 6, 7) t2 = datetime(1, 2, 3, 4, 5, 6, 7) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=None) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(None, "")) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=FixedOffset(0, "")) self.assertRaises(TypeError, lambda: t1 == t2) class Varies(tzinfo): def __init__(self): self.offset = timedelta(minutes=22) def utcoffset(self, t): self.offset += timedelta(minutes=1) return self.offset v = Varies() t1 = t2.replace(tzinfo=v) t2 = t2.replace(tzinfo=v) self.assertEqual(t1.utcoffset(), timedelta(minutes=23)) self.assertEqual(t2.utcoffset(), timedelta(minutes=24)) self.assertEqual(t1, t2) t2 = t2.replace(tzinfo=Varies()) self.failUnless(t1 < t2) def first_sunday_on_or_after(dt): days_to_go = 6 - dt.weekday() if days_to_go: dt += timedelta(days_to_go) return dt ZERO = timedelta(0) HOUR = timedelta(hours=1) DAY = timedelta(days=1) DSTSTART = datetime(1, 4, 1, 2) DSTEND = datetime(1, 10, 25, 1) class USTimeZone(tzinfo): def __init__(self, hours, reprname, stdname, dstname): self.stdoffset = timedelta(hours=hours) self.reprname = reprname self.stdname = stdname self.dstname = dstname def __repr__(self): return self.reprname def tzname(self, dt): if self.dst(dt): return self.dstname else: return self.stdname def utcoffset(self, dt): return self.stdoffset + self.dst(dt) def dst(self, dt): if dt is None or dt.tzinfo is None: return ZERO assert dt.tzinfo is self start = first_sunday_on_or_after(DSTSTART.replace(year=dt.year)) assert start.weekday() == 6 and start.month == 4 and start.day <= 7 end = first_sunday_on_or_after(DSTEND.replace(year=dt.year)) assert end.weekday() == 6 and end.month == 10 and end.day >= 25 if start <= dt.replace(tzinfo=None) < end: return HOUR else: return ZERO Eastern = USTimeZone(-5, "Eastern", "EST", "EDT") Central = USTimeZone(-6, "Central", "CST", "CDT") Mountain = USTimeZone(-7, "Mountain", "MST", "MDT") Pacific = USTimeZone(-8, "Pacific", "PST", "PDT") utc_real = FixedOffset(0, "UTC", 0) utc_fake = FixedOffset(-12*60, "UTCfake", 0) class TestTimezoneConversions(unittest.TestCase): dston = datetime(2002, 4, 7, 2) dstoff = datetime(2002, 10, 27, 1) theclass = datetime def checkinside(self, dt, tz, utc, dston, dstoff): self.assertEqual(dt.dst(), HOUR) self.assertEqual(dt.astimezone(tz), dt) asutc = dt.astimezone(utc) there_and_back = asutc.astimezone(tz) if dt.date() == dston.date() and dt.hour == 2: self.assertEqual(there_and_back + HOUR, dt) self.assertEqual(there_and_back.dst(), ZERO) self.assertEqual(there_and_back.astimezone(utc), dt.astimezone(utc)) else: self.assertEqual(dt, there_and_back) nexthour_utc = asutc + HOUR nexthour_tz = nexthour_utc.astimezone(tz) if dt.date() == dstoff.date() and dt.hour == 0: self.assertEqual(nexthour_tz, dt.replace(hour=1)) nexthour_utc += HOUR nexthour_tz = nexthour_utc.astimezone(tz) self.assertEqual(nexthour_tz, dt.replace(hour=1)) else: self.assertEqual(nexthour_tz - dt, HOUR) def checkoutside(self, dt, tz, utc): self.assertEqual(dt.dst(), ZERO) self.assertEqual(dt.astimezone(tz), dt) asutc = dt.astimezone(utc) there_and_back = asutc.astimezone(tz) self.assertEqual(dt, there_and_back) def convert_between_tz_and_utc(self, tz, utc): dston = self.dston.replace(tzinfo=tz) dstoff = self.dstoff.replace(tzinfo=tz) for delta in (timedelta(weeks=13), DAY, HOUR, timedelta(minutes=1), timedelta(microseconds=1)): self.checkinside(dston, tz, utc, dston, dstoff) for during in dston + delta, dstoff - delta: self.checkinside(during, tz, utc, dston, dstoff) self.checkoutside(dstoff, tz, utc) for outside in dston - delta, dstoff + delta: self.checkoutside(outside, tz, utc) def test_easy(self): self.convert_between_tz_and_utc(Eastern, utc_real) self.convert_between_tz_and_utc(Pacific, utc_real) self.convert_between_tz_and_utc(Eastern, utc_fake) self.convert_between_tz_and_utc(Pacific, utc_fake) self.convert_between_tz_and_utc(Eastern, Pacific) self.convert_between_tz_and_utc(Pacific, Eastern) def test_tricky(self): fourback = self.dston - timedelta(hours=4) ninewest = FixedOffset(-9*60, "-0900", 0) fourback = fourback.replace(tzinfo=ninewest) expected = self.dston.replace(hour=3) got = fourback.astimezone(Eastern).replace(tzinfo=None) self.assertEqual(expected, got) sixutc = self.dston.replace(hour=6, tzinfo=utc_real) expected = self.dston.replace(hour=1) got = sixutc.astimezone(Eastern).replace(tzinfo=None) self.assertEqual(expected, got) for utc in utc_real, utc_fake: for tz in Eastern, Pacific: first_std_hour = self.dstoff - timedelta(hours=2) first_std_hour -= tz.utcoffset(None) asutc = first_std_hour + utc.utcoffset(None) asutcbase = asutc.replace(tzinfo=utc) for tzhour in (0, 1, 1, 2): expectedbase = self.dstoff.replace(hour=tzhour) for minute in 0, 30, 59: expected = expectedbase.replace(minute=minute) asutc = asutcbase.replace(minute=minute) astz = asutc.astimezone(tz) self.assertEqual(astz.replace(tzinfo=None), expected) asutcbase += HOUR def test_bogus_dst(self): class ok(tzinfo): def utcoffset(self, dt): return HOUR def dst(self, dt): return HOUR now = self.theclass.now().replace(tzinfo=utc_real) now.astimezone(ok()) class notok(ok): def dst(self, dt): return None self.assertRaises(ValueError, now.astimezone, notok()) def test_fromutc(self): self.assertRaises(TypeError, Eastern.fromutc) now = datetime.utcnow().replace(tzinfo=utc_real) self.assertRaises(ValueError, Eastern.fromutc, now) now = now.replace(tzinfo=Eastern) enow = Eastern.fromutc(now) self.assertEqual(enow.tzinfo, Eastern) self.assertRaises(TypeError, Eastern.fromutc, now, now) self.assertRaises(TypeError, Eastern.fromutc, date.today()) class FauxUSTimeZone(USTimeZone): def fromutc(self, dt): return dt + self.stdoffset FEastern = FauxUSTimeZone(-5, "FEastern", "FEST", "FEDT") start = self.dston.replace(hour=4, tzinfo=Eastern) fstart = start.replace(tzinfo=FEastern) for wall in 23, 0, 1, 3, 4, 5: expected = start.replace(hour=wall) if wall == 23: expected -= timedelta(days=1) got = Eastern.fromutc(start) self.assertEqual(expected, got) expected = fstart + FEastern.stdoffset got = FEastern.fromutc(fstart) self.assertEqual(expected, got) got = fstart.replace(tzinfo=utc_real).astimezone(FEastern) self.assertEqual(expected, got) start += HOUR fstart += HOUR start = self.dstoff.replace(hour=4, tzinfo=Eastern) fstart = start.replace(tzinfo=FEastern) for wall in 0, 1, 1, 2, 3, 4: expected = start.replace(hour=wall) got = Eastern.fromutc(start) self.assertEqual(expected, got) expected = fstart + FEastern.stdoffset got = FEastern.fromutc(fstart) self.assertEqual(expected, got) got = fstart.replace(tzinfo=utc_real).astimezone(FEastern) self.assertEqual(expected, got) start += HOUR fstart += HOUR def test_suite(): allsuites = [unittest.makeSuite(klass, 'test') for klass in (TestModule, TestTZInfo, TestTimeDelta, TestDateOnly, TestDate, TestDateTime, TestTime, TestTimeTZ, TestDateTimeTZ, TestTimezoneConversions, ) ] return unittest.TestSuite(allsuites) def test_main(): import sys r = unittest.TextTestRunner(stream=sys.stdout, verbosity=2) s = test_suite() lastrc = None while True: r.run(s) if 1: break gc.collect() if gc.garbage: raise SystemError("gc.garbage not empty after test run: %r" % gc.garbage) if hasattr(sys, 'gettotalrefcount'): thisrc = sys.gettotalrefcount() print >> sys.stderr, '*' * 10, 'total refs:', thisrc, if lastrc: print >> sys.stderr, 'delta:', thisrc - lastrc
def _wrap_strftime(object, format, timetuple): year = timetuple[0] if year < 1900: raise ValueError("year=%d is before 1900; the datetime strftime() " "methods require year >= 1900" % year) # Don't call _utcoffset() or tzname() unless actually needed. zreplace = None # the string to use for %z Zreplace = None # the string to use for %Z # Scan format for %z and %Z escapes, replacing as needed. newformat = [] push = newformat.append i, n = 0, len(format) while i < n: ch = format[i] i += 1 if ch == '%': if i < n: ch = format[i] i += 1 if ch == 'z': if zreplace is None: zreplace = "" if hasattr(object, "_utcoffset"): offset = object._utcoffset() if offset is not None: sign = '+' if offset < 0: offset = -offset sign = '-' h, m = divmod(offset, 60) zreplace = '%c%02d%02d' % (sign, h, m) assert '%' not in zreplace newformat.append(zreplace) elif ch == 'Z': if Zreplace is None: Zreplace = "" if hasattr(object, "tzname"): s = object.tzname() if s is not None: # strftime is going to have at this: escape % Zreplace = s.replace('%', '%%') newformat.append(Zreplace) else: push('%') push(ch) else: push('%') else: push(ch) newformat = "".join(newformat) return _time.strftime(newformat, timetuple)
4fbea4a68c465cb2082a8fc276ffe29811e82ec7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6753/4fbea4a68c465cb2082a8fc276ffe29811e82ec7/test_datetime.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4113, 67, 701, 9982, 12, 1612, 16, 740, 16, 26668, 2268, 4672, 3286, 273, 26668, 2268, 63, 20, 65, 309, 3286, 411, 5342, 713, 30, 1002, 2068, 2932, 6874, 5095, 72, 353, 1865, 5342...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 4113, 67, 701, 9982, 12, 1612, 16, 740, 16, 26668, 2268, 4672, 3286, 273, 26668, 2268, 63, 20, 65, 309, 3286, 411, 5342, 713, 30, 1002, 2068, 2932, 6874, 5095, 72, 353, 1865, 5342...
hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc))
if uparts[0] and uparts[1]: hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) else: hurl = '%s%s' % (davpath, urllib.quote(fileloc))
def mk_propname_response(self,uri,propnames,doc): """ make a new <prop> result element for a PROPNAME request This will simply format the propnames list. propnames should have the format {NS1 : [prop1, prop2, ...], NS2: ...} """ re=doc.createElement("D:response") # write href information uparts=urlparse.urlparse(uri) fileloc=uparts[2] if isinstance(fileloc, unicode): fileloc = fileloc.encode('utf-8') href=doc.createElement("D:href") davpath = self._dataclass.parent.get_davpath() hurl = '%s://%s%s%s' % (uparts[0], uparts[1], davpath, urllib.quote(fileloc)) huri=doc.createTextNode(hurl) href.appendChild(huri) re.appendChild(href) ps=doc.createElement("D:propstat") nsnum=0 for ns,plist in propnames.items(): # write prop element pr=doc.createElement("D:prop") if ns == 'DAV': nsp = 'D' else: nsp="ns"+str(nsnum) ps.setAttribute("xmlns:"+nsp,ns) nsnum=nsnum+1 # write propertynames for p in plist: pe=doc.createElement(nsp+":"+p) pr.appendChild(pe) ps.appendChild(pr) re.appendChild(ps) return re
b275fc4601263e58def6d8ff29088e18a6a6b09d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/b275fc4601263e58def6d8ff29088e18a6a6b09d/webdav.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5028, 67, 5986, 529, 67, 2740, 12, 2890, 16, 1650, 16, 5986, 1973, 16, 2434, 4672, 3536, 1221, 279, 394, 411, 5986, 34, 563, 930, 364, 279, 16258, 1985, 590, 225, 1220, 903, 8616, 740,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5028, 67, 5986, 529, 67, 2740, 12, 2890, 16, 1650, 16, 5986, 1973, 16, 2434, 4672, 3536, 1221, 279, 394, 411, 5986, 34, 563, 930, 364, 279, 16258, 1985, 590, 225, 1220, 903, 8616, 740,...
self.__lock.acquire()
self._available.acquire()
def _return_cnx(self, cnx): self.__lock.acquire() try: self.__cnxs.append(cnx) self.__cursize -= 1 self.__available.notify() finally: self.__lock.release()
4439746dd49f45fdd6d37cb8534b75a39afcdad0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9317/4439746dd49f45fdd6d37cb8534b75a39afcdad0/db.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2463, 67, 10305, 92, 12, 2890, 16, 29492, 4672, 365, 6315, 5699, 18, 1077, 1039, 1435, 775, 30, 365, 16186, 10305, 13713, 18, 6923, 12, 10305, 92, 13, 365, 16186, 1397, 1467, 3947, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2463, 67, 10305, 92, 12, 2890, 16, 29492, 4672, 365, 6315, 5699, 18, 1077, 1039, 1435, 775, 30, 365, 16186, 10305, 13713, 18, 6923, 12, 10305, 92, 13, 365, 16186, 1397, 1467, 3947, ...
source_code=source_code)
source_code=source_code, html_show_formats=config.plot_html_show_formats)
def run(arguments, content, options, state_machine, state, lineno): if arguments and content: raise RuntimeError("plot:: directive can't have both args and content") document = state_machine.document config = document.settings.env.config options.setdefault('include-source', config.plot_include_source) # determine input rst_file = document.attributes['source'] rst_dir = os.path.dirname(rst_file) if arguments: if not config.plot_basedir: source_file_name = os.path.join(rst_dir, directives.uri(arguments[0])) else: source_file_name = os.path.join(setup.confdir, config.plot_basedir, directives.uri(arguments[0])) code = open(source_file_name, 'r').read() output_base = os.path.basename(source_file_name) else: source_file_name = rst_file code = textwrap.dedent("\n".join(map(str, content))) counter = document.attributes.get('_plot_counter', 0) + 1 document.attributes['_plot_counter'] = counter base, ext = os.path.splitext(os.path.basename(source_file_name)) output_base = '%s-%d.py' % (base, counter) base, source_ext = os.path.splitext(output_base) if source_ext in ('.py', '.rst', '.txt'): output_base = base else: source_ext = '' # ensure that LaTeX includegraphics doesn't choke in foo.bar.pdf filenames output_base = output_base.replace('.', '-') # is it in doctest format? is_doctest = contains_doctest(code) if options.has_key('format'): if options['format'] == 'python': is_doctest = False else: is_doctest = True # determine output directory name fragment source_rel_name = relpath(source_file_name, setup.confdir) source_rel_dir = os.path.dirname(source_rel_name) while source_rel_dir.startswith(os.path.sep): source_rel_dir = source_rel_dir[1:] # build_dir: where to place output files (temporarily) build_dir = os.path.join(os.path.dirname(setup.app.doctreedir), 'plot_directive', source_rel_dir) if not os.path.exists(build_dir): os.makedirs(build_dir) # output_dir: final location in the builder's directory dest_dir = os.path.abspath(os.path.join(setup.app.builder.outdir, source_rel_dir)) # how to link to files from the RST file dest_dir_link = os.path.join(relpath(setup.confdir, rst_dir), source_rel_dir).replace(os.path.sep, '/') build_dir_link = relpath(build_dir, rst_dir).replace(os.path.sep, '/') source_link = dest_dir_link + '/' + output_base + source_ext # make figures try: images = makefig(code, source_file_name, build_dir, output_base, config) except PlotError, err: reporter = state.memo.reporter sm = reporter.system_message( 3, "Exception occurred in plotting %s: %s" % (output_base, err), line=lineno) return [sm] # generate output restructuredtext if options['include-source']: if is_doctest: lines = [''] lines += [row.rstrip() for row in code.split('\n')] else: lines = ['.. code-block:: python', ''] lines += [' %s' % row.rstrip() for row in code.split('\n')] source_code = "\n".join(lines) else: source_code = "" opts = [':%s: %s' % (key, val) for key, val in options.items() if key in ('alt', 'height', 'width', 'scale', 'align', 'class')] if sphinx.__version__ >= "0.6": only_html = ".. only:: html" only_latex = ".. only:: latex" else: only_html = ".. htmlonly::" only_latex = ".. latexonly::" result = format_template( TEMPLATE, dest_dir=dest_dir_link, build_dir=build_dir_link, source_link=source_link, only_html=only_html, only_latex=only_latex, options=opts, images=images, source_code=source_code) lines = result.split("\n") if len(lines): state_machine.insert_input( lines, state_machine.input_lines.source(0)) # copy image files to builder's output directory if not os.path.exists(dest_dir): os.makedirs(dest_dir) for img in images: for fn in img.filenames(): shutil.copyfile(fn, os.path.join(dest_dir, os.path.basename(fn))) # copy script (if necessary) if source_file_name == rst_file: target_name = os.path.join(dest_dir, output_base + source_ext) f = open(target_name, 'w') f.write(unescape_doctest(code)) f.close() return []
bf7dc71b2a1cd18fb7b7d5db46334beed4a47f4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14925/bf7dc71b2a1cd18fb7b7d5db46334beed4a47f4b/plot_directive.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1086, 12, 7099, 16, 913, 16, 702, 16, 919, 67, 9149, 16, 919, 16, 7586, 4672, 309, 1775, 471, 913, 30, 1002, 7265, 2932, 4032, 2866, 8655, 848, 1404, 1240, 3937, 833, 471, 913, 7923, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 12, 7099, 16, 913, 16, 702, 16, 919, 67, 9149, 16, 919, 16, 7586, 4672, 309, 1775, 471, 913, 30, 1002, 7265, 2932, 4032, 2866, 8655, 848, 1404, 1240, 3937, 833, 471, 913, 7923, ...
self.assertRaises(TypeError, self.enum, 'abc', 2)
self.assertRaises(TypeError, self.enum, 'abc', 'a') self.assertRaises(TypeError, self.enum, 'abc', 2, 3)
def test_argumentcheck(self): self.assertRaises(TypeError, self.enum) # no arguments self.assertRaises(TypeError, self.enum, 1) # wrong type (not iterable) self.assertRaises(TypeError, self.enum, 'abc', 2) # too many arguments
e24946e91bf7a631d3ee4540ad5d43ecdd68fd18 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/e24946e91bf7a631d3ee4540ad5d43ecdd68fd18/test_enumerate.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3446, 1893, 12, 2890, 4672, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 365, 18, 7924, 13, 468, 1158, 1775, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 365, 18, 7924, 16, 404...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 3446, 1893, 12, 2890, 4672, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 365, 18, 7924, 13, 468, 1158, 1775, 365, 18, 11231, 12649, 6141, 12, 19030, 16, 365, 18, 7924, 16, 404...
def log(self, branch = None):
def log(self, branch=0):
def log(self, branch = None): r""" Compute the p-adic logarithm of any unit in $\Z_p$. (See below for normalization.) The usual power series for log with values in the additive group of $\Z_p$ only converges for 1-units (units congruent to 1 modulo p). However, there is a unique extension of log to a homomorphism defined on all the units. If u = a*v is a unit with v = 1 (mod p), then we define log(u) = log(v). This is the correct extension because the units U of Z_p splits as a product U = V x <w>, where V is the subgroup of 1-units and w is a (p-1)st root of unity. The <w> factor is torsion, so must go to 0 under any homomorphism to the torsion free group $(\Z_p, +)$.
0780026840a08aa901fd7e00aaa4cc716eb639f0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/0780026840a08aa901fd7e00aaa4cc716eb639f0/padic_generic_element.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 2890, 16, 3803, 33, 20, 4672, 436, 8395, 8155, 326, 293, 17, 20333, 613, 31249, 434, 1281, 2836, 316, 271, 64, 62, 67, 84, 8, 18, 261, 9704, 5712, 364, 13728, 12998, 225, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 613, 12, 2890, 16, 3803, 33, 20, 4672, 436, 8395, 8155, 326, 293, 17, 20333, 613, 31249, 434, 1281, 2836, 316, 271, 64, 62, 67, 84, 8, 18, 261, 9704, 5712, 364, 13728, 12998, 225, 10...
self.__saveb = dict(os.environb)
if os.name not in ('os2', 'nt'): self.__saveb = dict(os.environb)
def setUp(self): self.__save = dict(os.environ) self.__saveb = dict(os.environb) for key, value in self._reference().items(): os.environ[key] = value
208d28cd41ad5cb4bd8665923d486d96232d9a42 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/208d28cd41ad5cb4bd8665923d486d96232d9a42/test_os.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 16186, 5688, 273, 2065, 12, 538, 18, 28684, 13, 309, 1140, 18, 529, 486, 316, 7707, 538, 22, 2187, 296, 496, 11, 4672, 365, 16186, 5688, 70, 273, 2065, 12, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 365, 16186, 5688, 273, 2065, 12, 538, 18, 28684, 13, 309, 1140, 18, 529, 486, 316, 7707, 538, 22, 2187, 296, 496, 11, 4672, 365, 16186, 5688, 70, 273, 2065, 12, ...
except Exception,x:
except Exception, x:
def submitPilots(self, taskQueueDict, pilotsToSubmit, workDir=None ): """ Submit pilot for the given TaskQueue, this method just insert the request in the corresponding ThreadPool, the submission is done from the Thread Pool job """ try:
65482708e833fd2f044badf2f7e0684898d23e4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/65482708e833fd2f044badf2f7e0684898d23e4b/PilotDirector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4879, 52, 330, 6968, 12, 2890, 16, 1562, 3183, 5014, 16, 24970, 6968, 774, 11620, 16, 1440, 1621, 33, 7036, 262, 30, 3536, 17320, 293, 22797, 364, 326, 864, 3837, 3183, 16, 333, 707, 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, 4879, 52, 330, 6968, 12, 2890, 16, 1562, 3183, 5014, 16, 24970, 6968, 774, 11620, 16, 1440, 1621, 33, 7036, 262, 30, 3536, 17320, 293, 22797, 364, 326, 864, 3837, 3183, 16, 333, 707, 2...
self.attach(*list(_subparts))
for p in _subparts: self.attach(p)
def __init__(self, _subtype='mixed', boundary=None, *_subparts, **_params): """Creates a multipart/* type message.
111dc69719cff7d1c91c7bed3c842c793021f49b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/111dc69719cff7d1c91c7bed3c842c793021f49b/MIMEMultipart.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 389, 21974, 2218, 19562, 2187, 7679, 33, 7036, 16, 380, 67, 1717, 6019, 16, 2826, 67, 2010, 4672, 3536, 2729, 279, 10263, 20308, 618, 883, 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, 1001, 2738, 972, 12, 2890, 16, 389, 21974, 2218, 19562, 2187, 7679, 33, 7036, 16, 380, 67, 1717, 6019, 16, 2826, 67, 2010, 4672, 3536, 2729, 279, 10263, 20308, 618, 883, 18, 2, -100, -...
line.encode('ascii')]
line]
def check_output(self, code, line_number, name): code = '\n'.join(code) line = ' File "<string>", line %s in <module>' % line_number expected = [ 'Fatal Python error: ' + name, '', 'Traceback (most recent call first):', line.encode('ascii')] process = subprocess.Popen( [sys.executable, '-c', code], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = process.communicate() stderr = stderr.decode('ascii', 'backslashreplace') lines = stderr.splitlines() self.assertEqual(lines, expected)
766dda12e6c6ca73d6fb9a9d220037b54963af88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13341/766dda12e6c6ca73d6fb9a9d220037b54963af88/tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2844, 12, 2890, 16, 981, 16, 980, 67, 2696, 16, 508, 4672, 981, 273, 2337, 82, 10332, 5701, 12, 710, 13, 980, 273, 296, 225, 1387, 3532, 1080, 2984, 16, 980, 738, 87, 316, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 2844, 12, 2890, 16, 981, 16, 980, 67, 2696, 16, 508, 4672, 981, 273, 2337, 82, 10332, 5701, 12, 710, 13, 980, 273, 296, 225, 1387, 3532, 1080, 2984, 16, 980, 738, 87, 316, ...